Open tannal opened 8 months ago
Turbofan Internal Representation for code optimization.
Graph graph-reducer.cc graph-assembler.cc graph-trimmer.cc graph-visualizer.cc graph.cc
input IR -> optimized IR
In v8
source code -> parser -> AST -> bytecode -|-> interpreter
|-> baseline compiler -> machine code
|-> optimizing compiler1 -> machine code
|-> optimizing compiler2 -> machine code
[xxx]CompilationJob
-PipelineImpl
--PipelineData
---InstructionSequence
----instruction_blocks
----virtual_registers
AstTraversalVisitor
SourceRangeAstVisitor
BytecodeGenerator
ControlFlowBuilder
-AstNode
Isolate
-Interpreter
--InterpreterCompilationJob
---BytecodeGenerator
ParseProgram
ParseFunction
ParseAny
Compiler class has a bunch of static methods which call above three functions.
xxxCompiler extends Compiler class.
BaselineCompiler
- compiler
https://github.com/plctlab/v8-internals/blob/master/slides/01-igniton-bytecode-dump.pdf
Design Documents
https://docs.google.com/document/d/11T2CRex9hXxoJwbYqVQ32yIPMh0uouUZLdyrtmMoL44/edit?pli=1