Confirmed users, Bureaucrats and Sysops emeriti
695
edits
No edit summary |
m (Reverted edits by Couponcodez (talk) to last revision by Curtisk) |
||
| (26 intermediate revisions by 10 users not shown) | |||
| Line 1: | Line 1: | ||
{{FeatureStatus | {{FeatureStatus | ||
|Feature name=Modern JIT Compiler for JavaScript | |Feature name=Modern JIT Compiler for JavaScript (IonMonkey) | ||
|Feature stage= | |Feature stage=Landed | ||
|Feature status=In progress | |||
|Feature version=Firefox 18 | |||
|Feature health=OK | |Feature health=OK | ||
}} | }} | ||
{{FeatureTeam | {{FeatureTeam | ||
|Feature product manager=Chris Blizzard | |||
|Feature feature manager=David Anderson | |Feature feature manager=David Anderson | ||
|Feature lead engineer=David Anderson, David Mandelin | |Feature lead engineer=David Anderson, David Mandelin | ||
|Feature qa lead=Paul Silaghi | |||
}} | }} | ||
{{FeaturePageBody | {{FeaturePageBody | ||
| Line 28: | Line 32: | ||
See [[/RegisterAllocator]] for information on the register allocator interfaces. | See [[/RegisterAllocator]] for information on the register allocator interfaces. | ||
|Feature implementation notes=# Bailouts | |Feature implementation notes=#<s> '''Bailouts'''</s> | ||
## <s>What: Bailouts are the heart of the optimizing compiler. When speculation fails (triggering a type, shape, overflow guard, etc), or C++ throws an exception, or needs to GC, we must be able to inspect the JIT frame, and if needed, reconstruct an interpreter frame.</s> | |||
## <s>Dependencies:</s> | |||
### <s>Register allocator</s> | |||
# | ### <s>Code Generator</s> | ||
# | ## <s>Work involved:</s> | ||
# | ### <s>Implementing guards</s> | ||
# Implement | ### <s>Snapshot building at guard points</s> | ||
# | ### <s>Bailout trampoline</s> | ||
# Implement | ### <s>Frame reconstruction</s> | ||
# | ## <s>Priority: Critical, blocks testing</s> | ||
# | ## <s>Time: 2-3 weeks</s> | ||
## <s>Owner: dvander</s> | |||
## <s>Status: <b>DONE</b></s> | |||
# '''Calls out to C++''' | |||
## What: Ability to call into C++ from JIT code. | |||
## Dependencies: Bailouts | |||
## Work involved: | |||
### Macro assembler interface for managing calls. | |||
### Ability to recover bailout information from within C++. | |||
### C++ function calling convention (bake in JSCompartment, hold active ion cx?) | |||
### Protocol for dealing with exceptions returned from C++ functions | |||
### GC needs to walk Ion frames | |||
## Priority: Very high | |||
## Time: 4+ weeks | |||
## Owner: <b>npierron</b> | |||
# '''Property Access and Inline Caches''' | |||
## What: Code to handle property access sites | |||
## Dependencies: Bailouts, Calls out to C++ | |||
## Work involved: | |||
### TypeOracle interface for learning about property accesses. | |||
### Four cases of knowledge: Monomorphic, Polymorphic, Megamorphic, and Unknown (IC) | |||
### Building JM-like IC structures into IM, solving old memory management problems like reset-on-GC, bloated IC structs | |||
## Priority: High | |||
## Time: 4-5 weeks? | |||
## Owner: TBD | |||
# <s>'''Function calls'''</s> | |||
## <s>What: Ability to call other Ion or interpreter JS functions</s> | |||
## <s>Dependencies: Bailouts</s> | |||
## <s>Work involved:</s> | |||
### <s>Handle monomorphic versus polymorphic calls (ICs).</s> | |||
### <s>Handle arity mismatches.</s> | |||
### <s>Modify trampolines and calling convention so frame reconstruction can restore nested frames.</s> | |||
## <s>Priority: High</s> | |||
## <s>Time: 4+ weeks</s> | |||
## <s>Status: <b>Done, except for TI integration.</b></s> | |||
## <s>Owner: sstangl</s> | |||
# '''Baseline Compiler''' | |||
## What: A compiler that replaces JägerMonkey as an untyped and fast compiler. | |||
## Dependencies: None, but needs close integration with ICs and type profiling | |||
## Work involved: Explore problem space. Ideally, we want to use IonMonkey as the baseline compiler, but whether the compiler itself is fast enough is an open question. Similarly, the expense of taking and translating snapshots must be measured on scripts with a huge number of local variables. | |||
### If IonMonkey is fast enough, we can just use it. | |||
### If optimization passes are expensive, we can turn them off. | |||
### If snapshots are too expensive, we can eliminate them and insert IR nodes to incrementally sync the stack. | |||
### If IonMonkey is too slow, we can write a new baseline compiler and possibly consider it generating off MIR. | |||
### Further work stems from this decision. | |||
## Priority: High | |||
## Time: 4 months | |||
## Owner: TBD | |||
# '''Type Feedback''' | |||
## What: Feedback mechanism to inform IonMonkey about likely types of access sites. | |||
## Dependencies: ICs | |||
## Work involved: | |||
### Explore problem space. Ideally we want to learn about types from ICs, using either previous IonMonkey runs or information from the baseline compiler (Ion or not). Therefore we should aim to share IC structures between all compilers. | |||
### Implement a TypeOracle derivation that uses run-time profiling to inform IonMonkey. | |||
## Priority: High | |||
## Time: 4 weeks | |||
## Owner: TBD | |||
# '''Type Inference Integration''' | |||
## What: Integrate IonMonkey's type system to Brian Hackett's type inference engine. | |||
## Dependencies: None | |||
## Work involved: | |||
### Use Type Inference to determine specializations and inlining. | |||
### Make a TypeOracle that uses inference results to inform IonMonkey. | |||
### Support on-stack invalidation. | |||
## Priority: High | |||
## Time: 4 weeks | |||
## Owner: <b>dvander</b> | |||
# <s>'''Method Inlining'''</s> | |||
## <s>What: Inline methods</s> | |||
## <s>Dependencies: Bailouts, either profiling, ICs, or calls out to C++</s> | |||
## <s>Work involved:</s> | |||
### <s>Some heuristic to determine whether methods should be inlined (this can be totally bogus, but maybe better to start with simple methods).</s> | |||
### <s>Changing IonBuilder such that JSScripts bytecode parsing can be "stacked" so inner SSA graph is inlined.</s> | |||
### <s>Change M/LSnapshots to be nested, so snapshots in an inner frame all point to the same outer snapshot.</s> | |||
### <s>Change snapshot encoding and frame reconstruction to support inlining.</s> | |||
## <s>Priority: Medium</s> | |||
## <s>Time: 3 weeks</s> | |||
## <s>Owner: <b>cdleary</b></s> | |||
# <s>'''On-Stack Replacement'''</s> | |||
## <s>What: Jump into JIT code at loop headers, possibly by profiling off-thread.</s> | |||
## <s>Work involved:</s> | |||
### <s>Explore ways to monitor hotness of JIT code.</s> | |||
### <s>Implement the ability to jump into Ion-compiled code at loop headers, possibly by inserting special OSR nodes in the IR.</s> | |||
## <s>Priority: Medium</s> | |||
## <s>Time: 4 weeks</s> | |||
## <s>Owner: <b>sstangl</b></s> | |||
# '''ARM Port''' | |||
## What: Port IonMonkey to ARM | |||
## Work involved: | |||
### Bootstrap ARM to x86 parity so both develop at the same time. | |||
## Priority: High | |||
## Time: 4 weeks | |||
## <b>Owner: mrosenberg</b> | |||
# '''Debugging''' | |||
## What: Work with jsd/jsdbg2 or whatever debugging APIs are required. | |||
## Dependencies: Bailouts, Baseline JIT | |||
## Work involved: | |||
### Deoptimizing from within C++ | |||
### Calling debug hooks/probes | |||
### Implementing breakpoints, EvalInFrame | |||
## Priority: Low (for now) | |||
## Time: ??? | |||
## Owner: TBD | |||
# '''Testing''' | |||
## What: We should be testing everything - correctness, perf, memory. | |||
## Dependencies: Bailouts | |||
## Work involved: | |||
### Making sure tbpl stays green, frequent merging from m-c. | |||
### Breaking down memory, cpu time of each Ion pass. | |||
### AWFY lines. | |||
## Priority: High | |||
## Time: Continuous | |||
## Owner: everyone | |||
}} | }} | ||
{{FeatureInfo | {{FeatureInfo | ||
|Feature priority=P1 | |Feature priority=P1 | ||
|Feature rank=1 | |||
|Feature roadmap=Platform | |Feature roadmap=Platform | ||
|Feature list=Platform | |Feature list=Platform | ||
|Feature project=Responsiveness | |||
|Feature engineering team=JavaScript | |Feature engineering team=JavaScript | ||
}} | }} | ||
{{FeatureTeamStatus}} | {{FeatureTeamStatus | ||
|Feature security status=sec-review-unnecessary | |||
|Feature security health=OK | |||
}} | |||