mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Inline static fields from Java
This commit is contained in:
21
compiler/testData/codegen/bytecodeTextMultifile/inlineJavaStaticFields/JClass.java
vendored
Normal file
21
compiler/testData/codegen/bytecodeTextMultifile/inlineJavaStaticFields/JClass.java
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class JClass {
|
||||
public final static int PrimitiveInt = 9000;
|
||||
public final static int BigPrimitiveInt = 59000;
|
||||
public final static long PrimitiveLong = 100000;
|
||||
public final static short PrimitiveShort = 900;
|
||||
public final static boolean PrimitiveBool = false;
|
||||
public final static float PrimitiveFloat = 36.6;
|
||||
public final static double PrimitiveDouble = 42.4242;
|
||||
public final static byte PrimitiveByte = -8;
|
||||
public final static char PrimitiveChar = 'K';
|
||||
public final static String Str = ":J";
|
||||
|
||||
@NotNull
|
||||
public final static Integer BoxedInt = 9500;
|
||||
|
||||
public static int NonFinal = 9700;
|
||||
|
||||
public final int NonStatic = 9800;
|
||||
}
|
||||
47
compiler/testData/codegen/bytecodeTextMultifile/inlineJavaStaticFields/test.kt
vendored
Normal file
47
compiler/testData/codegen/bytecodeTextMultifile/inlineJavaStaticFields/test.kt
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
object KoKobject {
|
||||
@JvmStatic
|
||||
val JvmStatic: Int = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
Integer.MIN_VALUE
|
||||
java.lang.Long.MAX_VALUE
|
||||
|
||||
JClass.PrimitiveInt
|
||||
JClass.BigPrimitiveInt
|
||||
JClass.PrimitiveByte
|
||||
JClass.PrimitiveChar
|
||||
JClass.PrimitiveLong
|
||||
JClass.PrimitiveShort
|
||||
JClass.PrimitiveBool
|
||||
JClass.PrimitiveFloat
|
||||
JClass.PrimitiveDouble
|
||||
JClass.Str
|
||||
|
||||
JClass.BoxedInt
|
||||
JClass.NonFinal
|
||||
|
||||
JClass().NonStatic
|
||||
|
||||
KoKobject.JvmStatic
|
||||
}
|
||||
|
||||
// @TestKt.class:
|
||||
// 1 LDC -2147483648
|
||||
// 1 LDC 9223372036854775807
|
||||
// 1 SIPUSH 9000
|
||||
// 1 LDC 59000
|
||||
// 1 LDC -8
|
||||
// 1 LDC K
|
||||
// 1 LDC 100000
|
||||
// 1 LDC 900
|
||||
// 1 LDC false
|
||||
// 1 LDC 36.6
|
||||
// 1 LDC 42.4242
|
||||
// 1 LDC ":J"
|
||||
// 1 GETSTATIC JClass.BoxedInt : Ljava/lang/Integer;
|
||||
// 1 GETSTATIC JClass.NonFinal : I
|
||||
// 1 GETFIELD JClass.NonStatic : I
|
||||
// 1 INVOKESTATIC KoKobject.getJvmStatic \(\)I
|
||||
// 3 POP2
|
||||
// 16 POP
|
||||
Reference in New Issue
Block a user