compilation process Interpreter - directly executes source code written in a high-level programming, translate to machine code line by line Dynamic Typed Languages - checks variable types at runtime Static Typed Languages - checks variable types at compile time
a prerequisite • The “maps check” checks what hidden class the object is pointing to and makes sure it is the same as the compiler expects. • If it matches, then the check succeeds; if not, then it fails and the code is deoptimized due to “wrong map.” De-Optimization - Wrong “Hidden Class”
Machine Code (SparkPlug) const c = doStuff2(a); // run Machine Code (SparkPlug) for (let i=0; i<100000; i++) { doStuff1(a); // After X runs, run Machine Code (TurboFan) } After Adding SparkPlug