I'm trying to understand performance of my JavaScript running within a Java application but I can't find a way to pass Truffle options through the Java interfaces like Bindings (when in Nashorn compat mode) and Context.
Specifically, I'm trying to turn on compilation info --engine.TraceCompilation mentioned in: https://www.graalvm.org/22.1/graalvm-as-a-platform/language-implementation-framework/Options/
but all I find are examples like this:
ScriptEngine js = scriptEngineManager.getEngineByName("graal.js");
Bindings bindings = js.getBindings(ScriptContext.ENGINE_SCOPE);
bindings.put("polyglot.js.allowHostAccess", true);
bindings.put("polyglot.js.nashorn-compat", true);
// ------- I want to do something like this: -----------
bindings.put("polyglot.js.engine.TraceCompilation", true); // <-- does not work
//--------------------------------------------------------
This guide mentions the list of options that can be passed this way and none of the Truffle options are listed: https://www.graalvm.org/22.1/reference-manual/js/ScriptEngine/
Note that for legacy reasons I need to use Nashorn compatibility mode to run the JavaScript code.