Reputation: 11
The V8 Engine contains both Ignition "Interpreter" (which is an interesting name for something that not only interprets) and TurboFan Compiler. TurboFan compiler helps to optimize "hot" parts of code by compiling it into machine code.
However, when it comes to Ignition Interpreter. It can produce byte code and then execute it. To create the byte code, however, it needs to "compile/transform" the AST (Abstract Syntax Tree). Is Ignition's ability to do it (create the byte code) possible only because it was built on TurboFan which itself can "compile" code?
Upvotes: 1
Views: 49
Reputation: 40491
No, the fact that Ignition's bytecode handlers are generated with Turbofan is totally unrelated to Ignition's ability to generate bytecode. Anyone (in V8 or other projects) can build any number of JavaScript compilers that compile JS to anything you want (bytecode, machine code, ES5, ES3, some random format of your own design, ...); there is no need to reuse parts of them for each other.
Upvotes: 1