12013-02-25 Filip Pizlo <fpizlo@apple.com>
2
3 The DFG backend's and OSR's decision to unbox a variable should be based on whether it's used in a typed context
4 https://bugs.webkit.org/show_bug.cgi?id=110433
5
6 Reviewed by NOBODY (OOPS!).
7
8 This introduces the equivalent of a liveness analysis, except for type checking.
9 A variable is said to be "profitable for unboxing" (i.e. live at a type check)
10 if there exists a type check on a GetLocal of that variable, and the type check
11 is consistent with the variable's prediction. Variables that are not profitable
12 for unboxing aren't unboxed. Previously they would have been.
13
14 This is a slight speed-up on some things but mostly neutral.
15
16 * dfg/DFGArgumentPosition.h:
17 (JSC::DFG::ArgumentPosition::ArgumentPosition):
18 (JSC::DFG::ArgumentPosition::mergeShouldNeverUnbox):
19 (JSC::DFG::ArgumentPosition::mergeArgumentPredictionAwareness):
20 (JSC::DFG::ArgumentPosition::mergeArgumentUnboxingAwareness):
21 (ArgumentPosition):
22 (JSC::DFG::ArgumentPosition::isProfitableToUnbox):
23 (JSC::DFG::ArgumentPosition::shouldUseDoubleFormat):
24 * dfg/DFGCommon.h:
25 (JSC::DFG::setAndCheck):
26 (DFG):
27 * dfg/DFGFixupPhase.cpp:
28 (JSC::DFG::FixupPhase::run):
29 (JSC::DFG::FixupPhase::fixupNode):
30 (JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
31 (FixupPhase):
32 (JSC::DFG::FixupPhase::alwaysUnboxSimplePrimitives):
33 (JSC::DFG::FixupPhase::setUseKindAndUnboxIfProfitable):
34 * dfg/DFGPredictionPropagationPhase.cpp:
35 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
36 * dfg/DFGSpeculativeJIT.cpp:
37 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
38 * dfg/DFGVariableAccessData.h:
39 (JSC::DFG::VariableAccessData::VariableAccessData):
40 (JSC::DFG::VariableAccessData::mergeIsCaptured):
41 (JSC::DFG::VariableAccessData::mergeIsProfitableToUnbox):
42 (VariableAccessData):
43 (JSC::DFG::VariableAccessData::isProfitableToUnbox):
44 (JSC::DFG::VariableAccessData::shouldUnboxIfPossible):
45 (JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
46 (JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
47 (JSC::DFG::VariableAccessData::shouldUseDoubleFormat):
48 (JSC::DFG::VariableAccessData::mergeFlags):
49