Skip to content

Commit f05d73d

Browse files
committed
vm: set --enable-native-access for agentscript graalvm-tests [JDK-8331671] [GR-57817]
1 parent cbba248 commit f05d73d

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

vm/tests/all/agentscript/agent-dumparray.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
>[??] rm -rf ${TMP_DIR}/array.hprof*
2828
>[7?] js --insight=sieveArrayInsight.js --heap.dump=${TMP_DIR}/array.hprof sieveArray.js
2929
# a JavaScript heap has been generated
30-
>[0] java -cp $CP HeapQuery ${TMP_DIR}/array.hprof -e 'heap.forEachObject((arr) => print(arr.length), "java.lang.Object[]");'
30+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -cp $CP HeapQuery ${TMP_DIR}/array.hprof -e 'heap.forEachObject((arr) => print(arr.length), "java.lang.Object[]");'
3131
50000
32-
>[0] java -cp $CP HeapQuery ${TMP_DIR}/array.hprof -e 'var max = 0; heap.forEachObject((arr) => { for (let i = 0; i < arr.length; i++) { let p = arr[i].value; if (p > max) max = p; } }, "java.lang.Object[]"); print("Maximal number is " + max);'
32+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -cp $CP HeapQuery ${TMP_DIR}/array.hprof -e 'var max = 0; heap.forEachObject((arr) => { for (let i = 0; i < arr.length; i++) { let p = arr[i].value; if (p > max) max = p; } }, "java.lang.Object[]"); print("Maximal number is " + max);'
3333
Maximal number is 611953

vm/tests/all/agentscript/agent-dumpheap.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
>[??] rm -rf ${TMP_DIR}/sample.hprof*
2828
>[7?] js --insight=agent-dump.js --heap.dump=${TMP_DIR}/sample.hprof agent-fib.js
2929
# a JavaScript heap has been generated
30-
>[0] java -cp $CP HeapQuery ${TMP_DIR}/sample.hprof -e 'heap.forEachClass((c) => c.name.startsWith("frame:") && print(c.name))'
30+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -cp $CP HeapQuery ${TMP_DIR}/sample.hprof -e 'heap.forEachClass((c) => c.name.startsWith("frame:") && print(c.name))'
3131
frame:minusTwo
32-
>[0] java -cp $CP HeapQuery ${TMP_DIR}/sample.hprof -e 'let arr = []; heap.forEachObject((frame) => { for (let p in frame) { arr.push(p); } }, "frame:minusTwo"); arr.sort(); print(arr);'
32+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -cp $CP HeapQuery ${TMP_DIR}/sample.hprof -e 'let arr = []; heap.forEachObject((frame) => { for (let p in frame) { arr.push(p); } }, "frame:minusTwo"); arr.sort(); print(arr);'
3333
["n", "this"]
34-
>[0] java -cp $CP HeapQuery ${TMP_DIR}/sample.hprof -e 'heap.forEachObject((frame) => print(frame.n.value), "frame:minusTwo");'
34+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -cp $CP HeapQuery ${TMP_DIR}/sample.hprof -e 'heap.forEachObject((frame) => print(frame.n.value), "frame:minusTwo");'
3535
2

vm/tests/all/agentscript/agent-embedding-symlinks.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# questions.
2323
#
2424
>[0] javac EmbeddingSymlinks*.java -d ${TMP_DIR}
25-
>[0] java -ea -cp ${TMP_DIR} EmbeddingSymlinks ${TMP_DIR}
25+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -ea -cp ${TMP_DIR} EmbeddingSymlinks ${TMP_DIR}
2626
loaded source named (?:fooMain\.js from truffle:[0-9a-f]+/fooMain\.js|foo from file:.*/baz\.mjs)
2727
loaded source named (?:fooMain\.js from truffle:[0-9a-f]+/fooMain\.js|foo from file:.*/baz\.mjs)
2828
computed add at foo from file:.*/baz\.mjs with value 42

vm/tests/all/agentscript/agent-embedding.test

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
# questions.
2323
#
2424
>[0] javac Embedding*.java -d ${TMP_DIR}
25-
>[0] java -ea -cp .:${TMP_DIR} Embedding
25+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -ea -cp .:${TMP_DIR} Embedding
2626
Everything is OK!
27-
>[0] java -ea -cp ${TMP_DIR} EmbeddingDoubled
27+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -ea -cp ${TMP_DIR} EmbeddingDoubled
2828
Everything is OK!
29-
>[0] java -ea -cp .:${TMP_DIR} EmbeddingMoreContexts 2
29+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -ea -cp .:${TMP_DIR} EmbeddingMoreContexts 2
3030
calling fib with 11
3131
result is 89
3232
calling fib with 12
@@ -46,7 +46,7 @@ OK 2 times!
4646
# ##################################################################
4747
# Register instrument using deprecated -Dtruffle.class.path.append
4848
# ##################################################################
49-
>[1] java -ea -Dtruffle.class.path.append=${TMP_DIR}/instrument.jar -cp ${TMP_DIR} EmbeddingRegisterSymbols primitives
49+
>[1] java --enable-native-access=org.graalvm.truffle.runtime -ea -Dtruffle.class.path.append=${TMP_DIR}/instrument.jar -cp ${TMP_DIR} EmbeddingRegisterSymbols primitives
5050
\[engine\] The internal option -Dtruffle\.class\.path\.append option is deprecated.*
5151

5252
Exception in thread "main" Stop: 0
@@ -61,7 +61,7 @@ Exception in thread "main" Stop: 0
6161
.*at.*org.graalvm.polyglot.Value.execute.*
6262
.*at.*EmbeddingRegisterSymbols.exportAndTest.*
6363
.*at.*EmbeddingRegisterSymbols.main.*
64-
>[1] java -ea -Dtruffle.class.path.append=${TMP_DIR}/instrument.jar -cp ${TMP_DIR} EmbeddingRegisterSymbols object
64+
>[1] java --enable-native-access=org.graalvm.truffle.runtime -ea -Dtruffle.class.path.append=${TMP_DIR}/instrument.jar -cp ${TMP_DIR} EmbeddingRegisterSymbols object
6565
\[engine\] The internal option -Dtruffle\.class\.path\.append option is deprecated.*
6666

6767
Exception in thread "main" Stop: 0
@@ -79,7 +79,7 @@ Exception in thread "main" Stop: 0
7979
# ##################################################################
8080
# Register instrument using module-path
8181
# ##################################################################
82-
>[1] java -ea --module-path ${TMP_DIR}/instrument.jar:${GRAALVM_HOME}/tools/insight -cp ${TMP_DIR} EmbeddingRegisterSymbols primitives
82+
>[1] java --enable-native-access=org.graalvm.truffle.runtime -ea --module-path ${TMP_DIR}/instrument.jar:${GRAALVM_HOME}/tools/insight -cp ${TMP_DIR} EmbeddingRegisterSymbols primitives
8383

8484
Exception in thread "main" Stop: 0
8585
.*at.*js.*insight.js.*
@@ -93,7 +93,7 @@ Exception in thread "main" Stop: 0
9393
.*at.*org.graalvm.polyglot.Value.execute.*
9494
.*at.*EmbeddingRegisterSymbols.exportAndTest.*
9595
.*at.*EmbeddingRegisterSymbols.main.*
96-
>[1] java -ea --module-path ${TMP_DIR}/instrument.jar:${GRAALVM_HOME}/tools/insight -cp ${TMP_DIR} EmbeddingRegisterSymbols object
96+
>[1] java --enable-native-access=org.graalvm.truffle.runtime -ea --module-path ${TMP_DIR}/instrument.jar:${GRAALVM_HOME}/tools/insight -cp ${TMP_DIR} EmbeddingRegisterSymbols object
9797

9898
Exception in thread "main" Stop: 0
9999
.*at.*js.*insight.js.*

vm/tests/all/agentscript/agent-lli.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#
2424
>[0?] export TOOLCHAIN_PATH=`lli --print-toolchain-path`
2525
>[0?] ${TOOLCHAIN_PATH}/clang agent-sieve.c -g -O0 -lm -o ${TMP_DIR}/sieve
26-
>[1] lli --polyglot --insight=agent-limit.js --experimental-options ${TMP_DIR}/sieve
26+
>[1] lli --vm.-enable-native-access=org.graalvm.truffle.runtime,ALL-UNNAMED --polyglot --insight=agent-limit.js --experimental-options ${TMP_DIR}/sieve
2727
found new prime number (<unavailable>|2)
2828
found new prime number (<unavailable>|3)
2929
found new prime number (<unavailable>|5)

vm/tests/all/agentscript/agent-python.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
#
2424
> cat > ${TMP_DIR}/test.py
2525
< print('Ahoj')
26-
> graalpy --insight=agent-python.py --experimental-options ${TMP_DIR}/test.py
26+
> graalpy --vm.-enable-native-access=org.graalvm.truffle.runtime --insight=agent-python.py --experimental-options ${TMP_DIR}/test.py
2727
Python: Insight version 1.2 is launching
2828
Python: Hooks are ready!
2929
Python: observed loading of test.py
3030
Ahoj
31-
> js --polyglot --insight=agent-python.py --experimental-options agent-fib.js
31+
> js --vm.-enable-native-access=org.graalvm.truffle.runtime --polyglot --insight=agent-python.py --experimental-options agent-fib.js
3232
Python: Insight version 1.2 is launching
3333
Python: Hooks are ready!
3434
Python: observed loading of agent-fib.js

vm/tests/all/agentscript/agent-r.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Ahoj
5353
2 calls to cat
5454
2 calls to stdout
5555
===================
56-
> Rscript --polyglot --insight=agent-histogram.js ${TMP_DIR}/fib.R
56+
> Rscript --vm.-enable-native-access=org.graalvm.truffle.runtime,ALL-UNNAMED --polyglot --insight=agent-histogram.js ${TMP_DIR}/fib.R
5757
8
5858
==== Histogram ====
5959
15 calls to fib
@@ -63,18 +63,18 @@ Ahoj
6363
===================
6464
> cat > ${TMP_DIR}/test.js
6565
< print('hi js!')
66-
> polyglot --jvm --agentscript=agent-r.R --experimental-options ${TMP_DIR}/test.js
66+
> polyglot --vm.-enable-native-access=org.graalvm.truffle.runtime,ALL-UNNAMED --jvm --agentscript=agent-r.R --experimental-options ${TMP_DIR}/test.js
6767
Warning.*agentscript.*deprecated.*insight.*
6868
R: Initializing GraalVM Insight script
6969
R: Hooks are ready!
7070
R: observed loading of.*test.js
7171
hi js!
72-
> polyglot --jvm --insight=agent-r.R ${TMP_DIR}/test.js
72+
> polyglot --vm.-enable-native-access=org.graalvm.truffle.runtime,ALL-UNNAMED --jvm --insight=agent-r.R ${TMP_DIR}/test.js
7373
R: Initializing GraalVM Insight script
7474
R: Hooks are ready!
7575
R: observed loading of.*test.js
7676
hi js!
77-
> polyglot --insight=agent-r.R ${TMP_DIR}/test.js
77+
> polyglot --vm.-enable-native-access=org.graalvm.truffle.runtime,ALL-UNNAMED --insight=agent-r.R ${TMP_DIR}/test.js
7878
R: Initializing GraalVM Insight script
7979
R: Hooks are ready!
8080
R: observed loading of.*test.js

vm/tests/all/agentscript/agent-ruby-dump.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
>[0] javac -cp $CP HeapQuery.java
2626
#> export TMP_DIR=/tmp
2727
> rm -rf /tmp/ruby*hprof*
28-
> truffleruby --polyglot --heap.dump=$TMP_DIR/ruby.hprof --insight=agent-ruby-dump.js hello-world.rb
28+
> truffleruby --vm.-enable-native-access=org.graalvm.truffle.runtime,ALL-UNNAMED --polyglot --heap.dump=$TMP_DIR/ruby.hprof --insight=agent-ruby-dump.js hello-world.rb
2929
dumping state of Ruby memory when executing Welcome#welcome
3030
Hello World!
3131
# check one frame was captured
32-
>[0] java -cp $CP HeapQuery ${TMP_DIR}/ruby.hprof -e 'heap.forEachClass((c) => c.name.startsWith("frame:") && print(c.name))'
32+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -cp $CP HeapQuery ${TMP_DIR}/ruby.hprof -e 'heap.forEachClass((c) => c.name.startsWith("frame:") && print(c.name))'
3333
frame:Welcome#welcome
3434
# check the h and w variable in the frame
35-
>[0] java -cp $CP HeapQuery ${TMP_DIR}/ruby.hprof -e 'heap.forEachObject((frame) => print(frame.self["@h"].toString() + " " + frame.w.toString() + "!"), "frame:Welcome#welcome")'
35+
>[0] java --enable-native-access=org.graalvm.truffle.runtime -cp $CP HeapQuery ${TMP_DIR}/ruby.hprof -e 'heap.forEachObject((frame) => print(frame.self["@h"].toString() + " " + frame.w.toString() + "!"), "frame:Welcome#welcome")'
3636
Hello World!

vm/tests/all/agentscript/agent-ruby.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Ruby: Insight version 1.2 is launching
2828
Ruby: Hooks are ready!
2929
Ruby: observed loading of .*test.rb
3030
Ahoj
31-
> js --polyglot --insight=agent-ruby.rb --experimental-options agent-fib.js
31+
> js --vm.-enable-native-access=org.graalvm.truffle.runtime,ALL-UNNAMED --polyglot --insight=agent-ruby.rb --experimental-options agent-fib.js
3232
Ruby: Insight version 1.2 is launching
3333
Ruby: Hooks are ready!
3434
Ruby: observed loading of agent-fib.js

0 commit comments

Comments
 (0)