lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 22 February 2017 at 02:54, William Ahern <william@25thandclement.com> wrote:
> ChakraCore seems to implement both trace-based and method-based JIT
> compilation:
>
>   When ChakraCore notices that a function or loop-body is being invoked
>   multiple times in the interpreter, it queues up the function in
>   ChakraCore's background JIT compiler pipeline to generate optimized JIT'ed
>   code for the function. Once the JIT'ed code is ready, ChakraCore replaces
>   the function or loop entry points such that subsequent calls to the
>   function or the loop start executing the faster JIT'ed code instead of
>   continuing to execute the bytecode via the interpreter.
>
>   Source: https://github.com/Microsoft/ChakraCore/wiki/Architecture-Overview
>

I am not sure - I think this is saying that even while a method is
executing in the Interpeter, it can switch to a JIT compiled version
when a loop starts. I believe JVMs do this as well - i.e. switch from
interpreter to JIT code while executing a method.

> SpiderMonkey also seems to have a tracing JIT compiler:
>
>   https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/Tracing_JIT
>

It is perhaps used in their baseline compiler? Their optimizing
compiler (https://wiki.mozilla.org/IonMonkey) is a whole method JIT as
per linked document. Certainly at one point they were using trace
compiler but I understood they moved away from that or I may be
mistaken here.

Regards
Dibyendu