Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
GraalVM JS: How I do pass Truffle options via Bindings (Nashorn compat mode) and Context in a Java application?

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.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

as the documentation states, those are language launcher options. You would typically provide them to a launcher like js, node or similar.

$ js --engine.TraceCompilation yourJSFile.js

As you seem to start from Java, you can also provide them to the Java process with system properties (by preprending polyglot and explicitly providing true for boolean options):

$ java -Dpolyglot.engine.TraceCompilation=true yourJavaClass

I don't believe you can provide those options as late as in the bindings of the language, because they should not affect the language but the overall GraalVM system. (this is also why your polyglot.js.engine.TraceCompilation is off; the option has nothing to do with js)

HTH, Christian

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda