public class com.oracle.truffle.sl.test.SLInteropObjectTest
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: com.oracle.truffle.sl.test.SLInteropObjectTest
super_class: java.lang.Object
{
private org.graalvm.polyglot.Context context;
descriptor: Lorg/graalvm/polyglot/Context;
flags: (0x0002) ACC_PRIVATE
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/oracle/truffle/sl/test/SLInteropObjectTest;
public void setUp();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=1, args_size=1
start local 0 0: aload 0
iconst_1
anewarray java.lang.String
dup
iconst_0
ldc "sl"
aastore
invokestatic org.graalvm.polyglot.Context.create:([Ljava/lang/String;)Lorg/graalvm/polyglot/Context;
putfield com.oracle.truffle.sl.test.SLInteropObjectTest.context:Lorg/graalvm/polyglot/Context;
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/oracle/truffle/sl/test/SLInteropObjectTest;
RuntimeVisibleAnnotations:
org.junit.Before()
public void tearDown();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield com.oracle.truffle.sl.test.SLInteropObjectTest.context:Lorg/graalvm/polyglot/Context;
invokevirtual org.graalvm.polyglot.Context.close:()V
1: aload 0
aconst_null
putfield com.oracle.truffle.sl.test.SLInteropObjectTest.context:Lorg/graalvm/polyglot/Context;
2: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/oracle/truffle/sl/test/SLInteropObjectTest;
RuntimeVisibleAnnotations:
org.junit.After()
public void testObject();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=5, args_size=1
start local 0 0: ldc "sl"
ldc "function main() {o = new(); o.a = 10; o.b = \"B\"; return o;}"
ldc "testObject.sl"
invokestatic org.graalvm.polyglot.Source.newBuilder:(Ljava/lang/String;Ljava/lang/CharSequence;Ljava/lang/String;)Lorg/graalvm/polyglot/Source$Builder;
invokevirtual org.graalvm.polyglot.Source$Builder.buildLiteral:()Lorg/graalvm/polyglot/Source;
astore 1
start local 1 1: aload 0
getfield com.oracle.truffle.sl.test.SLInteropObjectTest.context:Lorg/graalvm/polyglot/Context;
aload 1
invokevirtual org.graalvm.polyglot.Context.eval:(Lorg/graalvm/polyglot/Source;)Lorg/graalvm/polyglot/Value;
astore 2
start local 2 2: aload 2
invokevirtual org.graalvm.polyglot.Value.hasMembers:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
3: aload 2
ldc "a"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 3
start local 3 4: aload 3
invokestatic org.junit.Assert.assertNotNull:(Ljava/lang/Object;)V
5: aload 3
invokevirtual org.graalvm.polyglot.Value.isNumber:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
6: ldc 10
aload 3
invokevirtual org.graalvm.polyglot.Value.asInt:()I
i2l
invokestatic org.junit.Assert.assertEquals:(JJ)V
7: aload 2
ldc "b"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 4
start local 4 8: aload 4
invokestatic org.junit.Assert.assertNotNull:(Ljava/lang/Object;)V
9: aload 4
invokevirtual org.graalvm.polyglot.Value.isString:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
10: ldc "B"
aload 4
invokevirtual org.graalvm.polyglot.Value.asString:()Ljava/lang/String;
invokestatic org.junit.Assert.assertEquals:(Ljava/lang/Object;Ljava/lang/Object;)V
11: aload 2
ldc "a"
aload 4
invokevirtual org.graalvm.polyglot.Value.putMember:(Ljava/lang/String;Ljava/lang/Object;)V
12: aload 2
ldc "a"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 3
13: aload 3
invokevirtual org.graalvm.polyglot.Value.isString:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
14: ldc "B"
aload 3
invokevirtual org.graalvm.polyglot.Value.asString:()Ljava/lang/String;
invokestatic org.junit.Assert.assertEquals:(Ljava/lang/Object;Ljava/lang/Object;)V
15: aload 2
ldc "a"
invokevirtual org.graalvm.polyglot.Value.removeMember:(Ljava/lang/String;)Z
pop
16: aload 2
ldc "a"
invokevirtual org.graalvm.polyglot.Value.hasMember:(Ljava/lang/String;)Z
invokestatic org.junit.Assert.assertFalse:(Z)V
17: ldc "[b]"
aload 2
invokevirtual org.graalvm.polyglot.Value.getMemberKeys:()Ljava/util/Set;
invokevirtual java.lang.Object.toString:()Ljava/lang/String;
invokestatic org.junit.Assert.assertEquals:(Ljava/lang/Object;Ljava/lang/Object;)V
18: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 19 0 this Lcom/oracle/truffle/sl/test/SLInteropObjectTest;
1 19 1 src Lorg/graalvm/polyglot/Source;
2 19 2 obj Lorg/graalvm/polyglot/Value;
4 19 3 a Lorg/graalvm/polyglot/Value;
8 19 4 b Lorg/graalvm/polyglot/Value;
RuntimeVisibleAnnotations:
org.junit.Test()
public void testNewForeign();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=6, locals=4, args_size=1
start local 0 0: ldc "sl"
ldc "function getValue(type) {o = new(type); o.a = 10; return o.value;}"
ldc "testObject.sl"
invokestatic org.graalvm.polyglot.Source.newBuilder:(Ljava/lang/String;Ljava/lang/CharSequence;Ljava/lang/String;)Lorg/graalvm/polyglot/Source$Builder;
invokevirtual org.graalvm.polyglot.Source$Builder.buildLiteral:()Lorg/graalvm/polyglot/Source;
astore 1
start local 1 1: aload 0
getfield com.oracle.truffle.sl.test.SLInteropObjectTest.context:Lorg/graalvm/polyglot/Context;
aload 1
invokevirtual org.graalvm.polyglot.Context.eval:(Lorg/graalvm/polyglot/Source;)Lorg/graalvm/polyglot/Value;
pop
2: aload 0
getfield com.oracle.truffle.sl.test.SLInteropObjectTest.context:Lorg/graalvm/polyglot/Context;
ldc "sl"
invokevirtual org.graalvm.polyglot.Context.getBindings:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
ldc "getValue"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 2
start local 2 3: aload 2
iconst_1
anewarray java.lang.Object
dup
iconst_0
new com.oracle.truffle.sl.test.SLInteropObjectTest$TestType
dup
invokespecial com.oracle.truffle.sl.test.SLInteropObjectTest$TestType.<init>:()V
aastore
invokevirtual org.graalvm.polyglot.Value.execute:([Ljava/lang/Object;)Lorg/graalvm/polyglot/Value;
astore 3
start local 3 4: ldc 20
aload 3
invokevirtual org.graalvm.polyglot.Value.asLong:()J
invokestatic org.junit.Assert.assertEquals:(JJ)V
5: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/oracle/truffle/sl/test/SLInteropObjectTest;
1 6 1 src Lorg/graalvm/polyglot/Source;
3 6 2 getValue Lorg/graalvm/polyglot/Value;
4 6 3 ret Lorg/graalvm/polyglot/Value;
RuntimeVisibleAnnotations:
org.junit.Test()
}
SourceFile: "SLInteropObjectTest.java"
NestMembers:
com.oracle.truffle.sl.test.SLInteropObjectTest$TestObject com.oracle.truffle.sl.test.SLInteropObjectTest$TestType
InnerClasses:
private TestObject = com.oracle.truffle.sl.test.SLInteropObjectTest$TestObject of com.oracle.truffle.sl.test.SLInteropObjectTest
private TestType = com.oracle.truffle.sl.test.SLInteropObjectTest$TestType of com.oracle.truffle.sl.test.SLInteropObjectTest
public Builder = org.graalvm.polyglot.Source$Builder of org.graalvm.polyglot.Source