Move JVM Intrinsics class to package "kotlin.jvm.internal"

Delete unused intrinsics, reformat code, rename some declarations for better
readability
This commit is contained in:
Alexander Udalov
2014-02-12 20:56:01 +04:00
parent 22ef81b0f8
commit 3b1a043c13
11 changed files with 95 additions and 121 deletions
@@ -18,7 +18,6 @@ package org.jetbrains.jet.codegen;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import jet.runtime.Intrinsics;
import org.jetbrains.asm4.ClassReader;
import org.jetbrains.asm4.ClassVisitor;
import org.jetbrains.asm4.MethodVisitor;
@@ -28,7 +27,6 @@ import org.jetbrains.jet.cli.common.output.outputUtils.OutputUtilsPackage;
import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys;
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
import org.jetbrains.jet.config.CompilerConfiguration;
import org.jetbrains.jet.lang.resolve.java.JvmClassName;
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
import org.jetbrains.jet.lang.resolve.name.FqName;
@@ -166,8 +164,6 @@ public class GenerateNotNullAssertionsTest extends CodegenTestCase {
assertNotNull(file);
ClassReader reader = new ClassReader(file.asByteArray());
final String intrinsics = JvmClassName.byFqNameWithoutInnerClasses(Intrinsics.class.getName()).getInternalName();
reader.accept(new ClassVisitor(Opcodes.ASM4) {
@Override
public MethodVisitor visitMethod(
@@ -178,7 +174,7 @@ public class GenerateNotNullAssertionsTest extends CodegenTestCase {
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
assertFalse(
"Intrinsics method is called: " + name + desc + " Caller: " + callerName + callerDesc,
intrinsics.equals(owner)
"kotlin/jvm/internal/Intrinsics".equals(owner)
);
}
};
@@ -1,39 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.runtime;
import com.intellij.testFramework.UsefulTestCase;
import jet.runtime.Intrinsics;
public class JetNpeTest extends UsefulTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
}
public void testStackTrace () {
try {
Intrinsics.throwNpe();
fail("No Sure thrown");
}
catch (NullPointerException e) {
StackTraceElement stackTraceElement = e.getStackTrace()[0];
assertEquals(stackTraceElement.getMethodName(), "testStackTrace");
assertEquals(stackTraceElement.getClassName(), "org.jetbrains.jet.runtime.JetNpeTest");
}
}
}