tannal / ohmywork

0 stars 0 forks source link

Chromium V8 Ignition and turbofan #20

Open tannal opened 8 months ago

tannal commented 8 months ago

https://github.com/plctlab/v8-internals/blob/master/slides/01-igniton-bytecode-dump.pdf

image

image

Design Documents

https://docs.google.com/document/d/11T2CRex9hXxoJwbYqVQ32yIPMh0uouUZLdyrtmMoL44/edit?pli=1

tannal commented 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

image

image

tannal commented 8 months ago

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