4 ms·
Author here: we did, and as other comments say we removed it in favour of Ignition, with the intent of at some point in the future bringing back some form of ba
by Leszek 5y ago
Author here: we did, and as other comments say we removed it in favour of Ignition, with the intent of at some point in the future bringing back some form of baseline compiler.
The big difference is that Sparkplug compiles from bytecode, not from source, and thus the bytecode stays the source of truth for the program. Back in the FCG days, the optimising compiler had to re-parse the source code to AST, and compile from there - even worse, to be able to deoptimise back to FCG, it had to kind of "replay" FCG compilation to get the deopted stack frame right.
We did actually have a configuration (never released) that had Ignition, FCG, _and_ TurboFan, and boy was it a mess...
- MaxBarraclough 5y ago> We did actually have a configuration (never released) that had Ignition, FCG, _and_ TurboFan, and boy was it a mess... Do you mean it had technical debt that was never resolved, or do you mean 3 tiers is always too many? I believe WebKit's JavaScript engine currently has 4 tiers, [0] although that includes an interpreter as the first tier. [0] https://arstechnica.com/information-technology/2014/05/apple-integrates-llvm-compiler-to-boost-webkit-javascript-performance/ https://arstechnica.com/information-technology/2014/05/apple...
- Gaelan 5y agoMore recent source: https://webkit.org/blog/10308/speculation-in-javascriptcore/ https://webkit.org/blog/10308/speculation-in-javascriptcore/ The exact tiers have changed, but it’s still 4 of them: an interpreter (LLInt), the Baseline JIT, and two optimizing JITs
- Leszek 5y agoIt had massive technical debt. Both Ignition and FCG had to compile from source, and we had to be able to tier up from both of them up to TurboFan, so TurboFan maintained two front ends - one to compile from bytecode, and one to compile from AST. There was all sorts of complexity then around deoptimisation point IDs, maintaining consistent suspension points for generators/async functions, maintaining consistent type feedback across Ignition and FCG. Even better, for a while we had Crankshaft in there too as an optional "alternative" top-tier (while we were working on TurboFan), in a configuration we called the "Frankenpipeline". You can see that wonderful mess on slide 26 of this presentation: https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6HaCIu9wpZsrzqpIVIwQSuiXQ/edit?usp=drivesdk https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6H... (from this talk: https://youtu.be/r5OWCtuKiAk https://youtu.be/r5OWCtuKiAk) Three tiers is perfectly fine if the complexity is handled well, I could even see us adopting a fourth tier at some point in the future (not dissimilar indeed to JSC), most likely between Sparkplug and TurboFan.
- kaba0 5y agoCould you please compare it to OpenJDK’s JIT compilers? I’m unfortunately not familiar with V8 - but do I get it right that they have sort of converged and just got more similar?