This repository demonstrates testing GraalVM JavaScript execution using the following configurations:
- GraalVM 1.0.0RC6
- GraalVM 22.0.0.2
- OpenJDK 8 with GraalVM 1.0.0RC6 Polyglot
- OpenJDK 8 with GraalVM 22.0.0.2 Polyglot
The included Dockerfile will build a container with all of the necessary dependencies to test the above configurations. The run.sh script can then be run from within the container to see the results of executing the simple TireKick class, which evaluates and executes a small JavaScript program.
More details regarding running GraalVM JavaScript on non-GraalVM JVMs is available in the Oracle documentation.
The results show that execution works in all four configurations. However, the final configuration (OpenJDK 8 with GraalVM 22.0.0.2 Polyglot) generates several warnings regarding performance related to being unable to support runtime compilation.
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. The guest application code will therefore be executed in interpreted mode only. Execution only in interpreted mode will strongly impact the guest application performance. For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the ' -Dpolyglot.engine.WarnInterpreterOnly=false' system property.