What is the nature of a compiled script in JSR-223 context

140 views Asked by At

I couldn't find any clear answer. Is the script translated to ByteCode ? to a script specific pseudo-code ?

When i use a compiled nashorn script, is it simply compiled because the JIT compiler did its job on a java translation of the script OR because a specific parsed version of the script has been prepared for a nashorn kind of interpreting VM (kind of smallTalk option) ? Thanks for your help

1

There are 1 answers

0
Andreas On BEST ANSWER

The "nature" of a compiled script is entirely up to the script engine, e.g.

  • The raw script itself, if the script language doesn't have a compiled version
  • A parsed intermediate object, e.g. an abstract syntax tree for an expression
  • Internal object structures for evaluating the script, e.g. what a regular expression compiles to
  • Byte code
  • ...

The reason you can't find a clear answer, is that there is no clear answer. Every script engine will do its own thing.