Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda