Search code examples
trufflegraalvm

In Truffle, in which "level of abstraction" do the results of a partial evaluation belong?


I'm trying to understand how partial evaluation works in the Truffle language framework. I'm reading the papers Practical Partial Evaluation for High-Performance Dynamic Language Runtimes and One VM to Rule Them All.

I gather that, for performing PE, Truffle depends on the Graal JIT, as implied by this diagram:

enter image description here

Also, quoting from the first paper:

Graal compiles Java bytecode to optimized machine code, and can serve as a replacement for the Java HotSpot server compiler. We extended it with a frontend that performs PE, and added intrinsic methods that support our core primitives.

My question is: do the results of a PE actually exist as JVM bytecode at any point? Or are they directly constructed using Graal's internal representation, and converted to native code straightaway?


Solution

  • do the results of a PE actually exist as JVM bytecode at any point?

    No

    Or are they directly constructed using Graal's internal representation, and converted to native code straightaway?

    Yes