public class com.oracle.truffle.js.test.interop.FunctionTest
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: com.oracle.truffle.js.test.interop.FunctionTest
super_class: java.lang.Object
{
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 // com.oracle.truffle.js.test.interop.FunctionTest this
0: .line 56
aload 0 /* this */
invokespecial java.lang.Object.<init>:()V
return
end local 0 // com.oracle.truffle.js.test.interop.FunctionTest this
LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/oracle/truffle/js/test/interop/FunctionTest;
public void testInstantiate();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=9, args_size=1
start local 0 // com.oracle.truffle.js.test.interop.FunctionTest this
0: .line 60
aconst_null
astore 1
aconst_null
astore 2
1: iconst_0
anewarray java.lang.String
invokestatic com.oracle.truffle.js.test.JSTest.newContextBuilder:([Ljava/lang/String;)Lorg/graalvm/polyglot/Context$Builder;
invokevirtual org.graalvm.polyglot.Context$Builder.build:()Lorg/graalvm/polyglot/Context;
astore 3 /* context */
start local 3 // org.graalvm.polyglot.Context context
2: .line 61
aload 3 /* context */
ldc "js"
ldc "({ fn: function(arg) { this.arg = arg; } })"
invokevirtual org.graalvm.polyglot.Context.eval:(Ljava/lang/String;Ljava/lang/CharSequence;)Lorg/graalvm/polyglot/Value;
astore 4 /* functionHolder */
start local 4 // org.graalvm.polyglot.Value functionHolder
3: .line 62
aload 4 /* functionHolder */
ldc "fn"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 5 /* function */
start local 5 // org.graalvm.polyglot.Value function
4: .line 65
aload 5 /* function */
invokevirtual org.graalvm.polyglot.Value.canInstantiate:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
5: .line 66
aload 5 /* function */
iconst_1
anewarray java.lang.Object
dup
iconst_0
bipush 42
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokevirtual org.graalvm.polyglot.Value.newInstance:([Ljava/lang/Object;)Lorg/graalvm/polyglot/Value;
astore 6 /* instance */
start local 6 // org.graalvm.polyglot.Value instance
6: .line 69
aload 6 /* instance */
ldc "arg"
invokevirtual org.graalvm.polyglot.Value.hasMember:(Ljava/lang/String;)Z
invokestatic org.junit.Assert.assertTrue:(Z)V
7: .line 70
aload 6 /* instance */
ldc "arg"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 7 /* argument */
start local 7 // org.graalvm.polyglot.Value argument
8: .line 71
aload 7 /* argument */
invokevirtual org.graalvm.polyglot.Value.fitsInInt:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
9: .line 72
ldc 42
aload 7 /* argument */
invokevirtual org.graalvm.polyglot.Value.asInt:()I
i2l
invokestatic org.junit.Assert.assertEquals:(JJ)V
10: .line 75
aload 3 /* context */
ldc "js"
ldc "(function(instance, fn) { return instance instanceof fn; })"
invokevirtual org.graalvm.polyglot.Context.eval:(Ljava/lang/String;Ljava/lang/CharSequence;)Lorg/graalvm/polyglot/Value;
astore 8 /* instanceOf */
start local 8 // org.graalvm.polyglot.Value instanceOf
11: .line 76
aload 8 /* instanceOf */
invokevirtual org.graalvm.polyglot.Value.canExecute:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
12: .line 77
aload 8 /* instanceOf */
iconst_2
anewarray java.lang.Object
dup
iconst_0
aload 6 /* instance */
aastore
dup
iconst_1
aload 5 /* function */
aastore
invokevirtual org.graalvm.polyglot.Value.execute:([Ljava/lang/Object;)Lorg/graalvm/polyglot/Value;
invokevirtual org.graalvm.polyglot.Value.asBoolean:()Z
invokestatic org.junit.Assert.assertTrue:(Z)V
end local 8 // org.graalvm.polyglot.Value instanceOf
end local 7 // org.graalvm.polyglot.Value argument
end local 6 // org.graalvm.polyglot.Value instance
end local 5 // org.graalvm.polyglot.Value function
end local 4 // org.graalvm.polyglot.Value functionHolder
13: .line 78
aload 3 /* context */
ifnull 19
aload 3 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
goto 19
StackMap locals: com.oracle.truffle.js.test.interop.FunctionTest java.lang.Throwable java.lang.Throwable org.graalvm.polyglot.Context
StackMap stack: java.lang.Throwable
14: astore 1
aload 3 /* context */
ifnull 15
aload 3 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
end local 3 // org.graalvm.polyglot.Context context
StackMap locals:
StackMap stack:
15: aload 1
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
16: astore 2
aload 1
ifnonnull 17
aload 2
astore 1
goto 18
StackMap locals:
StackMap stack:
17: aload 1
aload 2
if_acmpeq 18
aload 1
aload 2
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
18: aload 1
athrow
19: .line 79
StackMap locals:
StackMap stack:
return
end local 0 // com.oracle.truffle.js.test.interop.FunctionTest this
LocalVariableTable:
Start End Slot Name Signature
0 20 0 this Lcom/oracle/truffle/js/test/interop/FunctionTest;
2 15 3 context Lorg/graalvm/polyglot/Context;
3 13 4 functionHolder Lorg/graalvm/polyglot/Value;
4 13 5 function Lorg/graalvm/polyglot/Value;
6 13 6 instance Lorg/graalvm/polyglot/Value;
8 13 7 argument Lorg/graalvm/polyglot/Value;
11 13 8 instanceOf Lorg/graalvm/polyglot/Value;
Exception table:
from to target type
2 13 14 any
1 16 16 any
RuntimeVisibleAnnotations:
org.junit.Test()
public void testInteropBindMemberFunctions();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=7, args_size=1
start local 0 // com.oracle.truffle.js.test.interop.FunctionTest this
0: .line 83
ldc "js"
ldc "var ob = {v:2};\nvar v = 0;var f = function(a) {\n this.v += a;}\nob.f = f;\nob\n"
1: .line 91
ldc "bindTest.js"
2: .line 83
invokestatic org.graalvm.polyglot.Source.newBuilder:(Ljava/lang/String;Ljava/lang/CharSequence;Ljava/lang/String;)Lorg/graalvm/polyglot/Source$Builder;
3: .line 91
invokevirtual org.graalvm.polyglot.Source$Builder.build:()Lorg/graalvm/polyglot/Source;
4: .line 83
astore 1 /* source */
start local 1 // org.graalvm.polyglot.Source source
5: .line 93
aconst_null
astore 2
aconst_null
astore 3
6: iconst_0
anewarray java.lang.String
invokestatic com.oracle.truffle.js.test.JSTest.newContextBuilder:([Ljava/lang/String;)Lorg/graalvm/polyglot/Context$Builder;
ldc "js.bind-member-functions"
ldc "true"
invokevirtual org.graalvm.polyglot.Context$Builder.option:(Ljava/lang/String;Ljava/lang/String;)Lorg/graalvm/polyglot/Context$Builder;
invokevirtual org.graalvm.polyglot.Context$Builder.build:()Lorg/graalvm/polyglot/Context;
astore 4 /* context */
start local 4 // org.graalvm.polyglot.Context context
7: .line 94
aload 4 /* context */
aload 1 /* source */
invokevirtual org.graalvm.polyglot.Context.eval:(Lorg/graalvm/polyglot/Source;)Lorg/graalvm/polyglot/Value;
astore 5 /* object */
start local 5 // org.graalvm.polyglot.Value object
8: .line 95
aload 5 /* object */
ldc "f"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
iconst_1
anewarray java.lang.Object
dup
iconst_0
bipush 40
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokevirtual org.graalvm.polyglot.Value.execute:([Ljava/lang/Object;)Lorg/graalvm/polyglot/Value;
pop
9: .line 96
aload 5 /* object */
ldc "v"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 6 /* result */
start local 6 // org.graalvm.polyglot.Value result
10: .line 97
new java.lang.StringBuilder
dup
ldc "Is number: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 6 /* result */
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.isNumber:()Z
invokestatic org.junit.Assert.assertTrue:(Ljava/lang/String;Z)V
11: .line 98
ldc 42
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.asInt:()I
i2l
invokestatic org.junit.Assert.assertEquals:(JJ)V
end local 6 // org.graalvm.polyglot.Value result
end local 5 // org.graalvm.polyglot.Value object
12: .line 99
aload 4 /* context */
ifnull 18
aload 4 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
goto 18
StackMap locals: com.oracle.truffle.js.test.interop.FunctionTest org.graalvm.polyglot.Source java.lang.Throwable java.lang.Throwable org.graalvm.polyglot.Context
StackMap stack: java.lang.Throwable
13: astore 2
aload 4 /* context */
ifnull 14
aload 4 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
end local 4 // org.graalvm.polyglot.Context context
StackMap locals:
StackMap stack:
14: aload 2
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
15: astore 3
aload 2
ifnonnull 16
aload 3
astore 2
goto 17
StackMap locals:
StackMap stack:
16: aload 2
aload 3
if_acmpeq 17
aload 2
aload 3
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
17: aload 2
athrow
18: .line 101
StackMap locals:
StackMap stack:
aconst_null
astore 2
aconst_null
astore 3
19: iconst_0
anewarray java.lang.String
invokestatic com.oracle.truffle.js.test.JSTest.newContextBuilder:([Ljava/lang/String;)Lorg/graalvm/polyglot/Context$Builder;
ldc "js.bind-member-functions"
ldc "false"
invokevirtual org.graalvm.polyglot.Context$Builder.option:(Ljava/lang/String;Ljava/lang/String;)Lorg/graalvm/polyglot/Context$Builder;
invokevirtual org.graalvm.polyglot.Context$Builder.build:()Lorg/graalvm/polyglot/Context;
astore 4 /* context */
start local 4 // org.graalvm.polyglot.Context context
20: .line 102
aload 4 /* context */
aload 1 /* source */
invokevirtual org.graalvm.polyglot.Context.eval:(Lorg/graalvm/polyglot/Source;)Lorg/graalvm/polyglot/Value;
astore 5 /* object */
start local 5 // org.graalvm.polyglot.Value object
21: .line 103
aload 5 /* object */
ldc "f"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
iconst_1
anewarray java.lang.Object
dup
iconst_0
bipush 40
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokevirtual org.graalvm.polyglot.Value.execute:([Ljava/lang/Object;)Lorg/graalvm/polyglot/Value;
pop
22: .line 104
aload 5 /* object */
ldc "v"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 6 /* result */
start local 6 // org.graalvm.polyglot.Value result
23: .line 105
new java.lang.StringBuilder
dup
ldc "Is number: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 6 /* result */
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.isNumber:()Z
invokestatic org.junit.Assert.assertTrue:(Ljava/lang/String;Z)V
24: .line 106
ldc 2
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.asInt:()I
i2l
invokestatic org.junit.Assert.assertEquals:(JJ)V
25: .line 107
aload 4 /* context */
ldc "js"
invokevirtual org.graalvm.polyglot.Context.getBindings:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
ldc "v"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 6 /* result */
26: .line 108
new java.lang.StringBuilder
dup
ldc "Is number: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 6 /* result */
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.isNumber:()Z
invokestatic org.junit.Assert.assertTrue:(Ljava/lang/String;Z)V
27: .line 109
ldc 40
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.asInt:()I
i2l
invokestatic org.junit.Assert.assertEquals:(JJ)V
end local 6 // org.graalvm.polyglot.Value result
end local 5 // org.graalvm.polyglot.Value object
28: .line 110
aload 4 /* context */
ifnull 34
aload 4 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
goto 34
StackMap locals: com.oracle.truffle.js.test.interop.FunctionTest org.graalvm.polyglot.Source java.lang.Throwable java.lang.Throwable org.graalvm.polyglot.Context
StackMap stack: java.lang.Throwable
29: astore 2
aload 4 /* context */
ifnull 30
aload 4 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
end local 4 // org.graalvm.polyglot.Context context
StackMap locals:
StackMap stack:
30: aload 2
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
31: astore 3
aload 2
ifnonnull 32
aload 3
astore 2
goto 33
StackMap locals:
StackMap stack:
32: aload 2
aload 3
if_acmpeq 33
aload 2
aload 3
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
33: aload 2
athrow
34: .line 113
StackMap locals:
StackMap stack:
aconst_null
astore 2
aconst_null
astore 3
35: iconst_0
anewarray java.lang.String
invokestatic com.oracle.truffle.js.test.JSTest.newContextBuilder:([Ljava/lang/String;)Lorg/graalvm/polyglot/Context$Builder;
invokevirtual org.graalvm.polyglot.Context$Builder.build:()Lorg/graalvm/polyglot/Context;
astore 4 /* context */
start local 4 // org.graalvm.polyglot.Context context
36: .line 114
aload 4 /* context */
aload 1 /* source */
invokevirtual org.graalvm.polyglot.Context.eval:(Lorg/graalvm/polyglot/Source;)Lorg/graalvm/polyglot/Value;
astore 5 /* object */
start local 5 // org.graalvm.polyglot.Value object
37: .line 115
aload 5 /* object */
ldc "f"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
iconst_1
anewarray java.lang.Object
dup
iconst_0
bipush 40
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokevirtual org.graalvm.polyglot.Value.execute:([Ljava/lang/Object;)Lorg/graalvm/polyglot/Value;
pop
38: .line 116
aload 5 /* object */
ldc "v"
invokevirtual org.graalvm.polyglot.Value.getMember:(Ljava/lang/String;)Lorg/graalvm/polyglot/Value;
astore 6 /* result */
start local 6 // org.graalvm.polyglot.Value result
39: .line 117
new java.lang.StringBuilder
dup
ldc "Is number: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 6 /* result */
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.isNumber:()Z
invokestatic org.junit.Assert.assertTrue:(Ljava/lang/String;Z)V
40: .line 118
ldc 42
aload 6 /* result */
invokevirtual org.graalvm.polyglot.Value.asInt:()I
i2l
invokestatic org.junit.Assert.assertEquals:(JJ)V
end local 6 // org.graalvm.polyglot.Value result
end local 5 // org.graalvm.polyglot.Value object
41: .line 119
aload 4 /* context */
ifnull 47
aload 4 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
goto 47
StackMap locals: com.oracle.truffle.js.test.interop.FunctionTest org.graalvm.polyglot.Source java.lang.Throwable java.lang.Throwable org.graalvm.polyglot.Context
StackMap stack: java.lang.Throwable
42: astore 2
aload 4 /* context */
ifnull 43
aload 4 /* context */
invokevirtual org.graalvm.polyglot.Context.close:()V
end local 4 // org.graalvm.polyglot.Context context
StackMap locals:
StackMap stack:
43: aload 2
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
44: astore 3
aload 2
ifnonnull 45
aload 3
astore 2
goto 46
StackMap locals:
StackMap stack:
45: aload 2
aload 3
if_acmpeq 46
aload 2
aload 3
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
46: aload 2
athrow
47: .line 120
StackMap locals:
StackMap stack:
return
end local 1 // org.graalvm.polyglot.Source source
end local 0 // com.oracle.truffle.js.test.interop.FunctionTest this
LocalVariableTable:
Start End Slot Name Signature
0 48 0 this Lcom/oracle/truffle/js/test/interop/FunctionTest;
5 48 1 source Lorg/graalvm/polyglot/Source;
7 14 4 context Lorg/graalvm/polyglot/Context;
8 12 5 object Lorg/graalvm/polyglot/Value;
10 12 6 result Lorg/graalvm/polyglot/Value;
20 30 4 context Lorg/graalvm/polyglot/Context;
21 28 5 object Lorg/graalvm/polyglot/Value;
23 28 6 result Lorg/graalvm/polyglot/Value;
36 43 4 context Lorg/graalvm/polyglot/Context;
37 41 5 object Lorg/graalvm/polyglot/Value;
39 41 6 result Lorg/graalvm/polyglot/Value;
Exception table:
from to target type
7 12 13 any
6 15 15 any
20 28 29 any
19 31 31 any
36 41 42 any
35 44 44 any
Exceptions:
throws java.lang.Exception
RuntimeVisibleAnnotations:
org.junit.Test()
}
SourceFile: "FunctionTest.java"
InnerClasses:
public final Builder = org.graalvm.polyglot.Context$Builder of org.graalvm.polyglot.Context
public Builder = org.graalvm.polyglot.Source$Builder of org.graalvm.polyglot.Source