in V8. The main purpose of it is to compile JavaScript to native code as quick as possible, generating the code without optimizations. It takes AST, walks over the nodes and emits calls to a macroassembler directly.
It takes AST and type feedback and compiles optimized code for your function. Optimized code of function replaces un-optimized one using on-stack replacement (OSR) then.
level intermediate representation (HIR) which consists of a control-flow graph (CFG) in static single assignment form (SSA). During the HIR generation, actual optimizations are applied, such as constant folding, method inlining, dynamic type feedback, etc… The result is an optimized CFG that is used as input to the next compiler - Lithium.
to machine-specific low-level intermediate representation (LIR). During LIR generation, Crankshaft can still apply some low-level optimizations to it. After LIR was generated, Crankshaft generates a sequence of native instructions for each Lithium instruction and gets executed.
Full Codegen compiler compiles JavaScript to native code without optimizations; • Profiling thread collects information about types, allowing to optimize your code; • Crankshaft is a black box where optimizations are applied;