| Differences between
and this patch
- Source/JavaScriptCore/ChangeLog +289 lines
Lines 1-3 Source/JavaScriptCore/ChangeLog_sec1
1
2014-09-25  Filip Pizlo  <fpizlo@apple.com>
2
3
        FTL should sink object allocations
4
        https://bugs.webkit.org/show_bug.cgi?id=136330
5
6
        Reviewed by Oliver Hunt.
7
        
8
        This adds a comprehensive infrastructure for sinking object allocations in DFG SSA form. The
9
        ultimate goal of sinking is to sink an allocation "past the points of its death" - i.e. to
10
        eliminate it completely. The way sinking reasons about the CFG means that it resembles a
11
        partial escape analysis: we create paths through a function where some allocation(s) don't
12
        have to be done at all even if there are other paths along which those allocations still have
13
        to happen. But it also produces other side benefits. Even if an allocation isn't eliminated
14
        along any path, the act of sinking reduces the number of barriers that have to execute.
15
        
16
        Because this was a fairly ambituous SSA analysis and transformation, I added a bunch of C++11
17
        sugar to the DFG's internal APIs to allow for easier iteration over blocks, nodes, and
18
        successors; and to add more functor goodness to allow for more lambdas.
19
        
20
        This is just the beginning. The bug has a bunch of other bugs that depend on it. So far this
21
        is a spectacular speed-up on microbenchmarks but it's still too limited to affect big
22
        benchmarks. I think it's best to land it in its current form and then to worry about the big
23
        benchmarks in subsequent work (see bug 137126).
24
25
        * CMakeLists.txt:
26
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
27
        * JavaScriptCore.xcodeproj/project.pbxproj:
28
        * bytecode/StructureSet.h:
29
        (JSC::StructureSet::iterator::iterator):
30
        (JSC::StructureSet::iterator::operator*):
31
        (JSC::StructureSet::iterator::operator++):
32
        (JSC::StructureSet::iterator::operator==):
33
        (JSC::StructureSet::iterator::operator!=):
34
        (JSC::StructureSet::begin):
35
        (JSC::StructureSet::end):
36
        * dfg/DFGAbstractInterpreter.h:
37
        (JSC::DFG::AbstractInterpreter::phiChildren):
38
        * dfg/DFGAbstractInterpreterInlines.h:
39
        (JSC::DFG::AbstractInterpreter<AbstractStateType>::AbstractInterpreter):
40
        (JSC::DFG::AbstractInterpreter<AbstractStateType>::startExecuting):
41
        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
42
        (JSC::DFG::AbstractInterpreter<AbstractStateType>::execute):
43
        * dfg/DFGAvailability.h:
44
        (JSC::DFG::Availability::shouldUseNode):
45
        (JSC::DFG::Availability::isFlushUseful):
46
        (JSC::DFG::Availability::isDead):
47
        (JSC::DFG::Availability::operator!=):
48
        * dfg/DFGAvailabilityMap.cpp: Added.
49
        (JSC::DFG::AvailabilityMap::prune):
50
        (JSC::DFG::AvailabilityMap::clear):
51
        (JSC::DFG::AvailabilityMap::dump):
52
        (JSC::DFG::AvailabilityMap::operator==):
53
        (JSC::DFG::AvailabilityMap::merge):
54
        * dfg/DFGAvailabilityMap.h: Added.
55
        (JSC::DFG::AvailabilityMap::forEachAvailability):
56
        * dfg/DFGBasicBlock.cpp:
57
        (JSC::DFG::BasicBlock::SSAData::SSAData):
58
        * dfg/DFGBasicBlock.h:
59
        (JSC::DFG::BasicBlock::begin):
60
        (JSC::DFG::BasicBlock::end):
61
        (JSC::DFG::BasicBlock::SuccessorsIterable::SuccessorsIterable):
62
        (JSC::DFG::BasicBlock::SuccessorsIterable::iterator::iterator):
63
        (JSC::DFG::BasicBlock::SuccessorsIterable::iterator::operator*):
64
        (JSC::DFG::BasicBlock::SuccessorsIterable::iterator::operator++):
65
        (JSC::DFG::BasicBlock::SuccessorsIterable::iterator::operator==):
66
        (JSC::DFG::BasicBlock::SuccessorsIterable::iterator::operator!=):
67
        (JSC::DFG::BasicBlock::SuccessorsIterable::begin):
68
        (JSC::DFG::BasicBlock::SuccessorsIterable::end):
69
        (JSC::DFG::BasicBlock::successors):
70
        * dfg/DFGClobberize.h:
71
        (JSC::DFG::clobberize):
72
        * dfg/DFGConstantFoldingPhase.cpp:
73
        (JSC::DFG::ConstantFoldingPhase::foldConstants):
74
        * dfg/DFGDoesGC.cpp:
75
        (JSC::DFG::doesGC):
76
        * dfg/DFGFixupPhase.cpp:
77
        (JSC::DFG::FixupPhase::fixupNode):
78
        * dfg/DFGFlushedAt.cpp:
79
        (JSC::DFG::FlushedAt::dump):
80
        * dfg/DFGFlushedAt.h:
81
        (JSC::DFG::FlushedAt::FlushedAt):
82
        * dfg/DFGGraph.cpp:
83
        (JSC::DFG::Graph::dump):
84
        (JSC::DFG::Graph::dumpBlockHeader):
85
        (JSC::DFG::Graph::mergeRelevantToOSR):
86
        (JSC::DFG::Graph::invalidateCFG):
87
        * dfg/DFGGraph.h:
88
        (JSC::DFG::Graph::NaturalBlockIterable::NaturalBlockIterable):
89
        (JSC::DFG::Graph::NaturalBlockIterable::iterator::iterator):
90
        (JSC::DFG::Graph::NaturalBlockIterable::iterator::operator*):
91
        (JSC::DFG::Graph::NaturalBlockIterable::iterator::operator++):
92
        (JSC::DFG::Graph::NaturalBlockIterable::iterator::operator==):
93
        (JSC::DFG::Graph::NaturalBlockIterable::iterator::operator!=):
94
        (JSC::DFG::Graph::NaturalBlockIterable::iterator::findNext):
95
        (JSC::DFG::Graph::NaturalBlockIterable::begin):
96
        (JSC::DFG::Graph::NaturalBlockIterable::end):
97
        (JSC::DFG::Graph::blocksInNaturalOrder):
98
        (JSC::DFG::Graph::doToChildrenWithNode):
99
        (JSC::DFG::Graph::doToChildren):
100
        * dfg/DFGHeapLocation.cpp:
101
        (WTF::printInternal):
102
        * dfg/DFGHeapLocation.h:
103
        * dfg/DFGInsertOSRHintsForUpdate.cpp: Added.
104
        (JSC::DFG::insertOSRHintsForUpdate):
105
        * dfg/DFGInsertOSRHintsForUpdate.h: Added.
106
        * dfg/DFGInsertionSet.h:
107
        (JSC::DFG::InsertionSet::graph):
108
        * dfg/DFGMayExit.cpp:
109
        (JSC::DFG::mayExit):
110
        * dfg/DFGNode.h:
111
        (JSC::DFG::Node::convertToPutByOffsetHint):
112
        (JSC::DFG::Node::convertToPutStructureHint):
113
        (JSC::DFG::Node::convertToPhantomNewObject):
114
        (JSC::DFG::Node::isCellConstant):
115
        (JSC::DFG::Node::castConstant):
116
        (JSC::DFG::Node::hasIdentifier):
117
        (JSC::DFG::Node::hasStorageAccessData):
118
        (JSC::DFG::Node::hasObjectMaterializationData):
119
        (JSC::DFG::Node::objectMaterializationData):
120
        (JSC::DFG::Node::isPhantomObjectAllocation):
121
        * dfg/DFGNodeType.h:
122
        * dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
123
        (JSC::DFG::OSRAvailabilityAnalysisPhase::run):
124
        (JSC::DFG::LocalOSRAvailabilityCalculator::endBlock):
125
        (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
126
        * dfg/DFGOSRAvailabilityAnalysisPhase.h:
127
        * dfg/DFGObjectAllocationSinkingPhase.cpp: Added.
128
        (JSC::DFG::ObjectAllocationSinkingPhase::ObjectAllocationSinkingPhase):
129
        (JSC::DFG::ObjectAllocationSinkingPhase::run):
130
        (JSC::DFG::ObjectAllocationSinkingPhase::performSinking):
131
        (JSC::DFG::ObjectAllocationSinkingPhase::determineMaterializationPoints):
132
        (JSC::DFG::ObjectAllocationSinkingPhase::placeMaterializationPoints):
133
        (JSC::DFG::ObjectAllocationSinkingPhase::lowerNonReadingOperationsOnPhantomAllocations):
134
        (JSC::DFG::ObjectAllocationSinkingPhase::promoteSunkenFields):
135
        (JSC::DFG::ObjectAllocationSinkingPhase::resolve):
136
        (JSC::DFG::ObjectAllocationSinkingPhase::handleNode):
137
        (JSC::DFG::ObjectAllocationSinkingPhase::createMaterialize):
138
        (JSC::DFG::ObjectAllocationSinkingPhase::populateMaterialize):
139
        (JSC::DFG::performObjectAllocationSinking):
140
        * dfg/DFGObjectAllocationSinkingPhase.h: Added.
141
        * dfg/DFGObjectMaterializationData.cpp: Added.
142
        (JSC::DFG::PhantomPropertyValue::dump):
143
        (JSC::DFG::ObjectMaterializationData::dump):
144
        (JSC::DFG::ObjectMaterializationData::oneWaySimilarityScore):
145
        (JSC::DFG::ObjectMaterializationData::similarityScore):
146
        * dfg/DFGObjectMaterializationData.h: Added.
147
        (JSC::DFG::PhantomPropertyValue::PhantomPropertyValue):
148
        (JSC::DFG::PhantomPropertyValue::operator==):
149
        * dfg/DFGPhantomCanonicalizationPhase.cpp:
150
        (JSC::DFG::PhantomCanonicalizationPhase::run):
151
        * dfg/DFGPhantomRemovalPhase.cpp:
152
        (JSC::DFG::PhantomRemovalPhase::run):
153
        * dfg/DFGPhiChildren.cpp: Added.
154
        (JSC::DFG::PhiChildren::PhiChildren):
155
        (JSC::DFG::PhiChildren::~PhiChildren):
156
        (JSC::DFG::PhiChildren::upsilonsOf):
157
        * dfg/DFGPhiChildren.h: Added.
158
        (JSC::DFG::PhiChildren::forAllIncomingValues):
159
        (JSC::DFG::PhiChildren::forAllTransitiveIncomingValues):
160
        * dfg/DFGPlan.cpp:
161
        (JSC::DFG::Plan::compileInThreadImpl):
162
        * dfg/DFGPrePostNumbering.cpp: Added.
163
        (JSC::DFG::PrePostNumbering::PrePostNumbering):
164
        (JSC::DFG::PrePostNumbering::~PrePostNumbering):
165
        (JSC::DFG::PrePostNumbering::compute):
166
        (WTF::printInternal):
167
        * dfg/DFGPrePostNumbering.h: Added.
168
        (JSC::DFG::PrePostNumbering::preNumber):
169
        (JSC::DFG::PrePostNumbering::postNumber):
170
        (JSC::DFG::PrePostNumbering::isStrictAncestorOf):
171
        (JSC::DFG::PrePostNumbering::isAncestorOf):
172
        (JSC::DFG::PrePostNumbering::isStrictDescendantOf):
173
        (JSC::DFG::PrePostNumbering::isDescendantOf):
174
        (JSC::DFG::PrePostNumbering::edgeKind):
175
        * dfg/DFGPredictionPropagationPhase.cpp:
176
        (JSC::DFG::PredictionPropagationPhase::propagate):
177
        * dfg/DFGPromoteHeapAccess.h: Added.
178
        (JSC::DFG::promoteHeapAccess):
179
        * dfg/DFGPromotedHeapLocation.cpp: Added.
180
        (JSC::DFG::PromotedLocationDescriptor::dump):
181
        (JSC::DFG::PromotedHeapLocation::createHint):
182
        (JSC::DFG::PromotedHeapLocation::dump):
183
        (WTF::printInternal):
184
        * dfg/DFGPromotedHeapLocation.h: Added.
185
        (JSC::DFG::PromotedLocationDescriptor::PromotedLocationDescriptor):
186
        (JSC::DFG::PromotedLocationDescriptor::operator!):
187
        (JSC::DFG::PromotedLocationDescriptor::kind):
188
        (JSC::DFG::PromotedLocationDescriptor::info):
189
        (JSC::DFG::PromotedLocationDescriptor::hash):
190
        (JSC::DFG::PromotedLocationDescriptor::operator==):
191
        (JSC::DFG::PromotedLocationDescriptor::operator!=):
192
        (JSC::DFG::PromotedLocationDescriptor::isHashTableDeletedValue):
193
        (JSC::DFG::PromotedHeapLocation::PromotedHeapLocation):
194
        (JSC::DFG::PromotedHeapLocation::operator!):
195
        (JSC::DFG::PromotedHeapLocation::kind):
196
        (JSC::DFG::PromotedHeapLocation::base):
197
        (JSC::DFG::PromotedHeapLocation::info):
198
        (JSC::DFG::PromotedHeapLocation::descriptor):
199
        (JSC::DFG::PromotedHeapLocation::hash):
200
        (JSC::DFG::PromotedHeapLocation::operator==):
201
        (JSC::DFG::PromotedHeapLocation::isHashTableDeletedValue):
202
        (JSC::DFG::PromotedHeapLocationHash::hash):
203
        (JSC::DFG::PromotedHeapLocationHash::equal):
204
        * dfg/DFGSSACalculator.cpp:
205
        (JSC::DFG::SSACalculator::reset):
206
        * dfg/DFGSSACalculator.h:
207
        * dfg/DFGSafeToExecute.h:
208
        (JSC::DFG::safeToExecute):
209
        * dfg/DFGSpeculativeJIT.cpp:
210
        (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
211
        * dfg/DFGSpeculativeJIT32_64.cpp:
212
        (JSC::DFG::SpeculativeJIT::compile):
213
        * dfg/DFGSpeculativeJIT64.cpp:
214
        (JSC::DFG::SpeculativeJIT::compile):
215
        * dfg/DFGStructureRegistrationPhase.cpp:
216
        (JSC::DFG::StructureRegistrationPhase::run):
217
        * dfg/DFGValidate.cpp:
218
        (JSC::DFG::Validate::validate):
219
        * ftl/FTLCapabilities.cpp:
220
        (JSC::FTL::canCompile):
221
        * ftl/FTLExitPropertyValue.cpp: Added.
222
        (JSC::FTL::ExitPropertyValue::dump):
223
        * ftl/FTLExitPropertyValue.h: Added.
224
        (JSC::FTL::ExitPropertyValue::ExitPropertyValue):
225
        (JSC::FTL::ExitPropertyValue::operator!):
226
        (JSC::FTL::ExitPropertyValue::location):
227
        (JSC::FTL::ExitPropertyValue::value):
228
        * ftl/FTLExitTimeObjectMaterialization.cpp: Added.
229
        (JSC::FTL::ExitTimeObjectMaterialization::ExitTimeObjectMaterialization):
230
        (JSC::FTL::ExitTimeObjectMaterialization::~ExitTimeObjectMaterialization):
231
        (JSC::FTL::ExitTimeObjectMaterialization::add):
232
        (JSC::FTL::ExitTimeObjectMaterialization::get):
233
        (JSC::FTL::ExitTimeObjectMaterialization::dump):
234
        * ftl/FTLExitTimeObjectMaterialization.h: Added.
235
        (JSC::FTL::ExitTimeObjectMaterialization::type):
236
        (JSC::FTL::ExitTimeObjectMaterialization::properties):
237
        * ftl/FTLExitValue.cpp:
238
        (JSC::FTL::ExitValue::materializeNewObject):
239
        (JSC::FTL::ExitValue::dumpInContext):
240
        * ftl/FTLExitValue.h:
241
        (JSC::FTL::ExitValue::isObjectMaterialization):
242
        (JSC::FTL::ExitValue::objectMaterialization):
243
        (JSC::FTL::ExitValue::withVirtualRegister):
244
        (JSC::FTL::ExitValue::valueFormat):
245
        * ftl/FTLLowerDFGToLLVM.cpp:
246
        (JSC::FTL::LowerDFGToLLVM::compileNode):
247
        (JSC::FTL::LowerDFGToLLVM::compileCheckStructure):
248
        (JSC::FTL::LowerDFGToLLVM::compileArrayifyToStructure):
249
        (JSC::FTL::LowerDFGToLLVM::compilePutStructure):
250
        (JSC::FTL::LowerDFGToLLVM::compileNewObject):
251
        (JSC::FTL::LowerDFGToLLVM::compileMultiGetByOffset):
252
        (JSC::FTL::LowerDFGToLLVM::compileMultiPutByOffset):
253
        (JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint):
254
        (JSC::FTL::LowerDFGToLLVM::compileCheckStructureImmediate):
255
        (JSC::FTL::LowerDFGToLLVM::compileMaterializeNewObject):
256
        (JSC::FTL::LowerDFGToLLVM::checkStructure):
257
        (JSC::FTL::LowerDFGToLLVM::allocateCell):
258
        (JSC::FTL::LowerDFGToLLVM::storeStructure):
259
        (JSC::FTL::LowerDFGToLLVM::allocateObject):
260
        (JSC::FTL::LowerDFGToLLVM::speculateStringObjectForStructureID):
261
        (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
262
        (JSC::FTL::LowerDFGToLLVM::buildExitArguments):
263
        (JSC::FTL::LowerDFGToLLVM::exitValueForAvailability):
264
        (JSC::FTL::LowerDFGToLLVM::exitValueForNode):
265
        (JSC::FTL::LowerDFGToLLVM::weakStructureID):
266
        (JSC::FTL::LowerDFGToLLVM::weakStructure):
267
        (JSC::FTL::LowerDFGToLLVM::availabilityMap):
268
        (JSC::FTL::LowerDFGToLLVM::availability): Deleted.
269
        * ftl/FTLOSRExit.h:
270
        * ftl/FTLOSRExitCompiler.cpp:
271
        (JSC::FTL::compileRecovery):
272
        (JSC::FTL::compileStub):
273
        * ftl/FTLOperations.cpp: Added.
274
        (JSC::FTL::operationNewObjectWithButterfly):
275
        (JSC::FTL::operationMaterializeObjectInOSR):
276
        * ftl/FTLOperations.h: Added.
277
        * ftl/FTLSwitchCase.h:
278
        (JSC::FTL::SwitchCase::SwitchCase):
279
        * runtime/JSObject.h:
280
        (JSC::JSObject::finishCreation):
281
        (JSC::JSFinalObject::JSFinalObject):
282
        (JSC::JSFinalObject::create):
283
        * runtime/Structure.cpp:
284
        (JSC::Structure::canUseForAllocationsOf):
285
        * runtime/Structure.h:
286
        * tests/stress/obviously-elidable-new-object-then-exit.js: Added.
287
        (sumOfArithSeries):
288
        (foo):
289
1
2014-09-25  Csaba Osztrogonác  <ossy@webkit.org>
290
2014-09-25  Csaba Osztrogonác  <ossy@webkit.org>
2
291
3
        Remove WinCE port from trunk
292
        Remove WinCE port from trunk
- Source/JavaScriptCore/CMakeLists.txt +10 lines
Lines 122-127 set(JavaScriptCore_SOURCES Source/JavaScriptCore/CMakeLists.txt_sec1
122
    dfg/DFGArrayMode.cpp
122
    dfg/DFGArrayMode.cpp
123
    dfg/DFGAtTailAbstractState.cpp
123
    dfg/DFGAtTailAbstractState.cpp
124
    dfg/DFGAvailability.cpp
124
    dfg/DFGAvailability.cpp
125
    dfg/DFGAvailabilityMap.cpp
125
    dfg/DFGBackwardsPropagationPhase.cpp
126
    dfg/DFGBackwardsPropagationPhase.cpp
126
    dfg/DFGBasicBlock.cpp
127
    dfg/DFGBasicBlock.cpp
127
    dfg/DFGBinarySwitch.cpp
128
    dfg/DFGBinarySwitch.cpp
Lines 164-169 set(JavaScriptCore_SOURCES Source/JavaScriptCore/CMakeLists.txt_sec2
164
    dfg/DFGGraphSafepoint.cpp
165
    dfg/DFGGraphSafepoint.cpp
165
    dfg/DFGHeapLocation.cpp
166
    dfg/DFGHeapLocation.cpp
166
    dfg/DFGInPlaceAbstractState.cpp
167
    dfg/DFGInPlaceAbstractState.cpp
168
    dfg/DFGInsertOSRHintsForUpdate.cpp
167
    dfg/DFGIntegerCheckCombiningPhase.cpp
169
    dfg/DFGIntegerCheckCombiningPhase.cpp
168
    dfg/DFGInvalidationPointInjectionPhase.cpp
170
    dfg/DFGInvalidationPointInjectionPhase.cpp
169
    dfg/DFGJITCode.cpp
171
    dfg/DFGJITCode.cpp
Lines 192-204 set(JavaScriptCore_SOURCES Source/JavaScriptCore/CMakeLists.txt_sec3
192
    dfg/DFGOSRExitCompilerCommon.cpp
194
    dfg/DFGOSRExitCompilerCommon.cpp
193
    dfg/DFGOSRExitJumpPlaceholder.cpp
195
    dfg/DFGOSRExitJumpPlaceholder.cpp
194
    dfg/DFGOSRExitPreparation.cpp
196
    dfg/DFGOSRExitPreparation.cpp
197
    dfg/DFGObjectAllocationSinkingPhase.cpp
198
    dfg/DFGObjectMaterializationData.cpp
195
    dfg/DFGOperations.cpp
199
    dfg/DFGOperations.cpp
196
    dfg/DFGPhantomCanonicalizationPhase.cpp
200
    dfg/DFGPhantomCanonicalizationPhase.cpp
197
    dfg/DFGPhantomRemovalPhase.cpp
201
    dfg/DFGPhantomRemovalPhase.cpp
198
    dfg/DFGPhase.cpp
202
    dfg/DFGPhase.cpp
203
    dfg/DFGPhiChildren.cpp
199
    dfg/DFGPlan.cpp
204
    dfg/DFGPlan.cpp
205
    dfg/DFGPrePostNumbering.cpp
200
    dfg/DFGPredictionInjectionPhase.cpp
206
    dfg/DFGPredictionInjectionPhase.cpp
201
    dfg/DFGPredictionPropagationPhase.cpp
207
    dfg/DFGPredictionPropagationPhase.cpp
208
    dfg/DFGPromotedHeapLocation.cpp
202
    dfg/DFGPureValue.cpp
209
    dfg/DFGPureValue.cpp
203
    dfg/DFGResurrectionForValidationPhase.cpp
210
    dfg/DFGResurrectionForValidationPhase.cpp
204
    dfg/DFGSSACalculator.cpp
211
    dfg/DFGSSACalculator.cpp
Lines 774-780 if (ENABLE_FTL_JIT) Source/JavaScriptCore/CMakeLists.txt_sec4
774
        ftl/FTLDataSection.cpp
781
        ftl/FTLDataSection.cpp
775
        ftl/FTLExitArgument.cpp
782
        ftl/FTLExitArgument.cpp
776
        ftl/FTLExitArgumentForOperand.cpp
783
        ftl/FTLExitArgumentForOperand.cpp
784
        ftl/FTLExitPropertyValue.cpp
777
        ftl/FTLExitThunkGenerator.cpp
785
        ftl/FTLExitThunkGenerator.cpp
786
        ftl/FTLExitTimeObjectMaterialization.cpp
778
        ftl/FTLExitValue.cpp
787
        ftl/FTLExitValue.cpp
779
        ftl/FTLFail.cpp
788
        ftl/FTLFail.cpp
780
        ftl/FTLForOSREntryJITCode.cpp
789
        ftl/FTLForOSREntryJITCode.cpp
Lines 789-794 if (ENABLE_FTL_JIT) Source/JavaScriptCore/CMakeLists.txt_sec5
789
        ftl/FTLOSREntry.cpp
798
        ftl/FTLOSREntry.cpp
790
        ftl/FTLOSRExitCompiler.cpp
799
        ftl/FTLOSRExitCompiler.cpp
791
        ftl/FTLOSRExit.cpp
800
        ftl/FTLOSRExit.cpp
801
        ftl/FTLOperations.cpp
792
        ftl/FTLOutput.cpp
802
        ftl/FTLOutput.cpp
793
        ftl/FTLRecoveryOpcode.cpp
803
        ftl/FTLRecoveryOpcode.cpp
794
        ftl/FTLRegisterAtOffset.cpp
804
        ftl/FTLRegisterAtOffset.cpp
- Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj -1 / +22 lines
Lines 1-4 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec1
1
<?xml version="1.0" encoding="utf-8"?>
1
<?xml version="1.0" encoding="utf-8"?>
2
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
  <ItemGroup Label="ProjectConfigurations">
3
  <ItemGroup Label="ProjectConfigurations">
4
    <ProjectConfiguration Include="DebugSuffix|Win32">
4
    <ProjectConfiguration Include="DebugSuffix|Win32">
Lines 368-373 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec2
368
    <ClCompile Include="..\dfg\DFGArrayMode.cpp" />
368
    <ClCompile Include="..\dfg\DFGArrayMode.cpp" />
369
    <ClCompile Include="..\dfg\DFGAtTailAbstractState.cpp" />
369
    <ClCompile Include="..\dfg\DFGAtTailAbstractState.cpp" />
370
    <ClCompile Include="..\dfg\DFGAvailability.cpp" />
370
    <ClCompile Include="..\dfg\DFGAvailability.cpp" />
371
    <ClCompile Include="..\dfg\DFGAvailabilityMap.cpp" />
371
    <ClCompile Include="..\dfg\DFGBackwardsPropagationPhase.cpp" />
372
    <ClCompile Include="..\dfg\DFGBackwardsPropagationPhase.cpp" />
372
    <ClCompile Include="..\dfg\DFGBasicBlock.cpp" />
373
    <ClCompile Include="..\dfg\DFGBasicBlock.cpp" />
373
    <ClCompile Include="..\dfg\DFGBinarySwitch.cpp" />
374
    <ClCompile Include="..\dfg\DFGBinarySwitch.cpp" />
Lines 410-415 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec3
410
    <ClCompile Include="..\dfg\DFGGraphSafepoint.cpp" />
411
    <ClCompile Include="..\dfg\DFGGraphSafepoint.cpp" />
411
    <ClCompile Include="..\dfg\DFGHeapLocation.cpp" />
412
    <ClCompile Include="..\dfg\DFGHeapLocation.cpp" />
412
    <ClCompile Include="..\dfg\DFGInPlaceAbstractState.cpp" />
413
    <ClCompile Include="..\dfg\DFGInPlaceAbstractState.cpp" />
414
    <ClCompile Include="..\dfg\DFGInsertOSRHintsForUpdate.cpp" />
413
    <ClCompile Include="..\dfg\DFGIntegerCheckCombiningPhase.cpp" />
415
    <ClCompile Include="..\dfg\DFGIntegerCheckCombiningPhase.cpp" />
414
    <ClCompile Include="..\dfg\DFGInvalidationPointInjectionPhase.cpp" />
416
    <ClCompile Include="..\dfg\DFGInvalidationPointInjectionPhase.cpp" />
415
    <ClCompile Include="..\dfg\DFGJITCode.cpp" />
417
    <ClCompile Include="..\dfg\DFGJITCode.cpp" />
Lines 439-450 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec4
439
    <ClCompile Include="..\dfg\DFGOSRExitCompilerCommon.cpp" />
441
    <ClCompile Include="..\dfg\DFGOSRExitCompilerCommon.cpp" />
440
    <ClCompile Include="..\dfg\DFGOSRExitJumpPlaceholder.cpp" />
442
    <ClCompile Include="..\dfg\DFGOSRExitJumpPlaceholder.cpp" />
441
    <ClCompile Include="..\dfg\DFGOSRExitPreparation.cpp" />
443
    <ClCompile Include="..\dfg\DFGOSRExitPreparation.cpp" />
444
    <ClCompile Include="..\dfg\DFGObjectAllocationSinkingPhase.cpp" />
445
    <ClCompile Include="..\dfg\DFGObjectMaterializationData.cpp" />
442
    <ClCompile Include="..\dfg\DFGPhantomCanonicalizationPhase.cpp" />
446
    <ClCompile Include="..\dfg\DFGPhantomCanonicalizationPhase.cpp" />
443
    <ClCompile Include="..\dfg\DFGPhantomRemovalPhase.cpp" />
447
    <ClCompile Include="..\dfg\DFGPhantomRemovalPhase.cpp" />
444
    <ClCompile Include="..\dfg\DFGPhase.cpp" />
448
    <ClCompile Include="..\dfg\DFGPhase.cpp" />
449
    <ClCompile Include="..\dfg\DFGPhiChildren.cpp" />
445
    <ClCompile Include="..\dfg\DFGPlan.cpp" />
450
    <ClCompile Include="..\dfg\DFGPlan.cpp" />
451
    <ClCompile Include="..\dfg\DFGPrePostNumbering.cpp" />
446
    <ClCompile Include="..\dfg\DFGPredictionInjectionPhase.cpp" />
452
    <ClCompile Include="..\dfg\DFGPredictionInjectionPhase.cpp" />
447
    <ClCompile Include="..\dfg\DFGPredictionPropagationPhase.cpp" />
453
    <ClCompile Include="..\dfg\DFGPredictionPropagationPhase.cpp" />
454
    <ClCompile Include="..\dfg\DFGPromotedHeapLocation.cpp" />
448
    <ClCompile Include="..\dfg\DFGPureValue.cpp" />
455
    <ClCompile Include="..\dfg\DFGPureValue.cpp" />
449
    <ClCompile Include="..\dfg\DFGResurrectionForValidationPhase.cpp" />
456
    <ClCompile Include="..\dfg\DFGResurrectionForValidationPhase.cpp" />
450
    <ClCompile Include="..\dfg\DFGSafepoint.cpp" />
457
    <ClCompile Include="..\dfg\DFGSafepoint.cpp" />
Lines 493-499 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec5
493
    <ClCompile Include="..\ftl\FTLDWARFRegister.cpp" />
500
    <ClCompile Include="..\ftl\FTLDWARFRegister.cpp" />
494
    <ClCompile Include="..\ftl\FTLExitArgument.cpp" />
501
    <ClCompile Include="..\ftl\FTLExitArgument.cpp" />
495
    <ClCompile Include="..\ftl\FTLExitArgumentForOperand.cpp" />
502
    <ClCompile Include="..\ftl\FTLExitArgumentForOperand.cpp" />
503
    <ClCompile Include="..\ftl\FTLExitPropertyValue.cpp" />
496
    <ClCompile Include="..\ftl\FTLExitThunkGenerator.cpp" />
504
    <ClCompile Include="..\ftl\FTLExitThunkGenerator.cpp" />
505
    <ClCompile Include="..\ftl\FTLExitTimeObjectMaterialization.cpp" />
497
    <ClCompile Include="..\ftl\FTLExitValue.cpp" />
506
    <ClCompile Include="..\ftl\FTLExitValue.cpp" />
498
    <ClCompile Include="..\ftl\FTLFail.cpp" />
507
    <ClCompile Include="..\ftl\FTLFail.cpp" />
499
    <ClCompile Include="..\ftl\FTLForOSREntryJITCode.cpp" />
508
    <ClCompile Include="..\ftl\FTLForOSREntryJITCode.cpp" />
Lines 508-513 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec6
508
    <ClCompile Include="..\ftl\FTLOSREntry.cpp" />
517
    <ClCompile Include="..\ftl\FTLOSREntry.cpp" />
509
    <ClCompile Include="..\ftl\FTLOSRExit.cpp" />
518
    <ClCompile Include="..\ftl\FTLOSRExit.cpp" />
510
    <ClCompile Include="..\ftl\FTLOSRExitCompiler.cpp" />
519
    <ClCompile Include="..\ftl\FTLOSRExitCompiler.cpp" />
520
    <ClCompile Include="..\ftl\FTLOperations.cpp" />
511
    <ClCompile Include="..\ftl\FTLOutput.cpp" />
521
    <ClCompile Include="..\ftl\FTLOutput.cpp" />
512
    <ClCompile Include="..\ftl\FTLRecoveryOpcode.cpp" />
522
    <ClCompile Include="..\ftl\FTLRecoveryOpcode.cpp" />
513
    <ClCompile Include="..\ftl\FTLRegisterAtOffset.cpp" />
523
    <ClCompile Include="..\ftl\FTLRegisterAtOffset.cpp" />
Lines 993-998 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec7
993
    <ClInclude Include="..\dfg\DFGArrayMode.h" />
1003
    <ClInclude Include="..\dfg\DFGArrayMode.h" />
994
    <ClInclude Include="..\dfg\DFGAtTailAbstractState.h" />
1004
    <ClInclude Include="..\dfg\DFGAtTailAbstractState.h" />
995
    <ClInclude Include="..\dfg\DFGAvailability.h" />
1005
    <ClInclude Include="..\dfg\DFGAvailability.h" />
1006
    <ClInclude Include="..\dfg\DFGAvailabilityMap.h" />
996
    <ClInclude Include="..\dfg\DFGBackwardsPropagationPhase.h" />
1007
    <ClInclude Include="..\dfg\DFGBackwardsPropagationPhase.h" />
997
    <ClInclude Include="..\dfg\DFGBasicBlock.h" />
1008
    <ClInclude Include="..\dfg\DFGBasicBlock.h" />
998
    <ClInclude Include="..\dfg\DFGBasicBlockInlines.h" />
1009
    <ClInclude Include="..\dfg\DFGBasicBlockInlines.h" />
Lines 1049-1054 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec8
1049
    <ClInclude Include="..\dfg\DFGGraphSafepoint.h" />
1060
    <ClInclude Include="..\dfg\DFGGraphSafepoint.h" />
1050
    <ClInclude Include="..\dfg\DFGHeapLocation.h" />
1061
    <ClInclude Include="..\dfg\DFGHeapLocation.h" />
1051
    <ClInclude Include="..\dfg\DFGInPlaceAbstractState.h" />
1062
    <ClInclude Include="..\dfg\DFGInPlaceAbstractState.h" />
1063
    <ClInclude Include="..\dfg\DFGInsertOSRHintsForUpdate.h" />
1052
    <ClInclude Include="..\dfg\DFGInsertionSet.h" />
1064
    <ClInclude Include="..\dfg\DFGInsertionSet.h" />
1053
    <ClInclude Include="..\dfg\DFGIntegerCheckCombiningPhase.h" />
1065
    <ClInclude Include="..\dfg\DFGIntegerCheckCombiningPhase.h" />
1054
    <ClInclude Include="..\dfg\DFGInvalidationPointInjectionPhase.h" />
1066
    <ClInclude Include="..\dfg\DFGInvalidationPointInjectionPhase.h" />
Lines 1073-1078 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec9
1073
    <ClInclude Include="..\dfg\DFGNodeFlags.h" />
1085
    <ClInclude Include="..\dfg\DFGNodeFlags.h" />
1074
    <ClInclude Include="..\dfg\DFGNodeOrigin.h" />
1086
    <ClInclude Include="..\dfg\DFGNodeOrigin.h" />
1075
    <ClInclude Include="..\dfg\DFGNodeType.h" />
1087
    <ClInclude Include="..\dfg\DFGNodeType.h" />
1088
    <ClInclude Include="..\dfg\DFGObjectAllocationSinkingPhase.h" />
1089
    <ClInclude Include="..\dfg\DFGObjectMaterializationData.h" />
1076
    <ClInclude Include="..\dfg\DFGOperations.h" />
1090
    <ClInclude Include="..\dfg\DFGOperations.h" />
1077
    <ClInclude Include="..\dfg\DFGOSRAvailabilityAnalysisPhase.h" />
1091
    <ClInclude Include="..\dfg\DFGOSRAvailabilityAnalysisPhase.h" />
1078
    <ClInclude Include="..\dfg\DFGOSREntry.h" />
1092
    <ClInclude Include="..\dfg\DFGOSREntry.h" />
Lines 1087-1095 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec10
1087
    <ClInclude Include="..\dfg\DFGPhantomCanonicalizationPhase.h" />
1101
    <ClInclude Include="..\dfg\DFGPhantomCanonicalizationPhase.h" />
1088
    <ClInclude Include="..\dfg\DFGPhantomRemovalPhase.h" />
1102
    <ClInclude Include="..\dfg\DFGPhantomRemovalPhase.h" />
1089
    <ClInclude Include="..\dfg\DFGPhase.h" />
1103
    <ClInclude Include="..\dfg\DFGPhase.h" />
1104
    <ClInclude Include="..\dfg\DFGPhiChildren.h" />
1090
    <ClInclude Include="..\dfg\DFGPlan.h" />
1105
    <ClInclude Include="..\dfg\DFGPlan.h" />
1106
    <ClInclude Include="..\dfg\DFGPrePostNumbering.h" />
1091
    <ClInclude Include="..\dfg\DFGPredictionInjectionPhase.h" />
1107
    <ClInclude Include="..\dfg\DFGPredictionInjectionPhase.h" />
1092
    <ClInclude Include="..\dfg\DFGPredictionPropagationPhase.h" />
1108
    <ClInclude Include="..\dfg\DFGPredictionPropagationPhase.h" />
1109
    <ClInclude Include="..\dfg\DFGPromoteHeapAccess.h" />
1110
    <ClInclude Include="..\dfg\DFGPromotedHeapLocation.h" />
1093
    <ClInclude Include="..\dfg\DFGPureValue.h" />
1111
    <ClInclude Include="..\dfg\DFGPureValue.h" />
1094
    <ClInclude Include="..\dfg\DFGRegisterBank.h" />
1112
    <ClInclude Include="..\dfg\DFGRegisterBank.h" />
1095
    <ClInclude Include="..\dfg\DFGRegisterSet.h" />
1113
    <ClInclude Include="..\dfg\DFGRegisterSet.h" />
Lines 1150-1156 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec11
1150
    <ClInclude Include="..\ftl\FTLExitArgument.h" />
1168
    <ClInclude Include="..\ftl\FTLExitArgument.h" />
1151
    <ClInclude Include="..\ftl\FTLExitArgumentForOperand.h" />
1169
    <ClInclude Include="..\ftl\FTLExitArgumentForOperand.h" />
1152
    <ClInclude Include="..\ftl\FTLExitArgumentList.h" />
1170
    <ClInclude Include="..\ftl\FTLExitArgumentList.h" />
1171
    <ClInclude Include="..\ftl\FTLExitPropertyValue.h" />
1153
    <ClInclude Include="..\ftl\FTLExitThunkGenerator.h" />
1172
    <ClInclude Include="..\ftl\FTLExitThunkGenerator.h" />
1173
    <ClInclude Include="..\ftl\FTLExitTimeObjectMaterialization.h" />
1154
    <ClInclude Include="..\ftl\FTLExitValue.h" />
1174
    <ClInclude Include="..\ftl\FTLExitValue.h" />
1155
    <ClInclude Include="..\ftl\FTLFail.h" />
1175
    <ClInclude Include="..\ftl\FTLFail.h" />
1156
    <ClInclude Include="..\ftl\FTLFormattedValue.h" />
1176
    <ClInclude Include="..\ftl\FTLFormattedValue.h" />
Lines 1170-1175 Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj_sec12
1170
    <ClInclude Include="..\ftl\FTLOSRExit.h" />
1190
    <ClInclude Include="..\ftl\FTLOSRExit.h" />
1171
    <ClInclude Include="..\ftl\FTLOSRExitCompilationInfo.h" />
1191
    <ClInclude Include="..\ftl\FTLOSRExitCompilationInfo.h" />
1172
    <ClInclude Include="..\ftl\FTLOSRExitCompiler.h" />
1192
    <ClInclude Include="..\ftl\FTLOSRExitCompiler.h" />
1193
    <ClInclude Include="..\ftl\FTLOperations.h" />
1173
    <ClInclude Include="..\ftl\FTLOutput.h" />
1194
    <ClInclude Include="..\ftl\FTLOutput.h" />
1174
    <ClInclude Include="..\ftl\FTLRecoveryOpcode.h" />
1195
    <ClInclude Include="..\ftl\FTLRecoveryOpcode.h" />
1175
    <ClInclude Include="..\ftl\FTLRegisterAtOffset.h" />
1196
    <ClInclude Include="..\ftl\FTLRegisterAtOffset.h" />
- Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +84 lines
Lines 209-214 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec1
209
		0F2B670917B6B5AB00A7AE3F /* TypedArrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DB17B6B5AB00A7AE3F /* TypedArrays.h */; settings = {ATTRIBUTES = (Private, ); }; };
209
		0F2B670917B6B5AB00A7AE3F /* TypedArrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DB17B6B5AB00A7AE3F /* TypedArrays.h */; settings = {ATTRIBUTES = (Private, ); }; };
210
		0F2B670A17B6B5AB00A7AE3F /* TypedArrayType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66DC17B6B5AB00A7AE3F /* TypedArrayType.cpp */; };
210
		0F2B670A17B6B5AB00A7AE3F /* TypedArrayType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66DC17B6B5AB00A7AE3F /* TypedArrayType.cpp */; };
211
		0F2B670B17B6B5AB00A7AE3F /* TypedArrayType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DD17B6B5AB00A7AE3F /* TypedArrayType.h */; settings = {ATTRIBUTES = (Private, ); }; };
211
		0F2B670B17B6B5AB00A7AE3F /* TypedArrayType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DD17B6B5AB00A7AE3F /* TypedArrayType.h */; settings = {ATTRIBUTES = (Private, ); }; };
212
		0F2B9CE219D0BA7D00B1D1B5 /* DFGAvailabilityMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CD619D0BA7D00B1D1B5 /* DFGAvailabilityMap.cpp */; };
213
		0F2B9CE319D0BA7D00B1D1B5 /* DFGAvailabilityMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CD719D0BA7D00B1D1B5 /* DFGAvailabilityMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
214
		0F2B9CE419D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CD819D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.cpp */; };
215
		0F2B9CE519D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CD919D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.h */; settings = {ATTRIBUTES = (Private, ); }; };
216
		0F2B9CE619D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CDA19D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.cpp */; };
217
		0F2B9CE719D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CDB19D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
218
		0F2B9CE819D0BA7D00B1D1B5 /* DFGObjectMaterializationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CDC19D0BA7D00B1D1B5 /* DFGObjectMaterializationData.cpp */; };
219
		0F2B9CE919D0BA7D00B1D1B5 /* DFGObjectMaterializationData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CDD19D0BA7D00B1D1B5 /* DFGObjectMaterializationData.h */; settings = {ATTRIBUTES = (Private, ); }; };
220
		0F2B9CEA19D0BA7D00B1D1B5 /* DFGPhiChildren.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CDE19D0BA7D00B1D1B5 /* DFGPhiChildren.cpp */; };
221
		0F2B9CEB19D0BA7D00B1D1B5 /* DFGPhiChildren.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CDF19D0BA7D00B1D1B5 /* DFGPhiChildren.h */; settings = {ATTRIBUTES = (Private, ); }; };
222
		0F2B9CEC19D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CE019D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.cpp */; };
223
		0F2B9CED19D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CE119D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
224
		0F2B9CF419D0BAC100B1D1B5 /* FTLExitPropertyValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CEE19D0BAC100B1D1B5 /* FTLExitPropertyValue.cpp */; };
225
		0F2B9CF519D0BAC100B1D1B5 /* FTLExitPropertyValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CEF19D0BAC100B1D1B5 /* FTLExitPropertyValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
226
		0F2B9CF619D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CF019D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.cpp */; };
227
		0F2B9CF719D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CF119D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.h */; settings = {ATTRIBUTES = (Private, ); }; };
228
		0F2B9CF819D0BAC100B1D1B5 /* FTLOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B9CF219D0BAC100B1D1B5 /* FTLOperations.cpp */; };
229
		0F2B9CF919D0BAC100B1D1B5 /* FTLOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B9CF319D0BAC100B1D1B5 /* FTLOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
212
		0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */; };
230
		0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */; };
213
		0F2BDC16151C5D4F00CD8910 /* DFGFixupPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC13151C5D4A00CD8910 /* DFGFixupPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
231
		0F2BDC16151C5D4F00CD8910 /* DFGFixupPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC13151C5D4A00CD8910 /* DFGFixupPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
214
		0F2BDC21151E803B00CD8910 /* DFGInsertionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
232
		0F2BDC21151E803B00CD8910 /* DFGInsertionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 272-277 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec2
272
		0F3B7E2D19A12AAE00D9BC56 /* CallEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B7E2C19A12AAE00D9BC56 /* CallEdge.cpp */; };
290
		0F3B7E2D19A12AAE00D9BC56 /* CallEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B7E2C19A12AAE00D9BC56 /* CallEdge.cpp */; };
273
		0F3D0BBC194A414300FC9CF9 /* ConstantStructureCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3D0BBA194A414300FC9CF9 /* ConstantStructureCheck.cpp */; };
291
		0F3D0BBC194A414300FC9CF9 /* ConstantStructureCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3D0BBA194A414300FC9CF9 /* ConstantStructureCheck.cpp */; };
274
		0F3D0BBD194A414300FC9CF9 /* ConstantStructureCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3D0BBB194A414300FC9CF9 /* ConstantStructureCheck.h */; settings = {ATTRIBUTES = (Private, ); }; };
292
		0F3D0BBD194A414300FC9CF9 /* ConstantStructureCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3D0BBB194A414300FC9CF9 /* ConstantStructureCheck.h */; settings = {ATTRIBUTES = (Private, ); }; };
293
		0F3E01AA19D353A500F61B7F /* DFGPrePostNumbering.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3E01A819D353A500F61B7F /* DFGPrePostNumbering.cpp */; };
294
		0F3E01AB19D353A500F61B7F /* DFGPrePostNumbering.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3E01A919D353A500F61B7F /* DFGPrePostNumbering.h */; settings = {ATTRIBUTES = (Private, ); }; };
275
		0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; };
295
		0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; };
276
		0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; };
296
		0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; };
277
		0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A4A1460CD6B00131F8F /* DataFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
297
		0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A4A1460CD6B00131F8F /* DataFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 443-448 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec3
443
		0FA7A8EB18B413C80052371D /* Reg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA7A8E918B413C80052371D /* Reg.cpp */; };
463
		0FA7A8EB18B413C80052371D /* Reg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA7A8E918B413C80052371D /* Reg.cpp */; };
444
		0FA7A8EC18B413C80052371D /* Reg.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA7A8EA18B413C80052371D /* Reg.h */; settings = {ATTRIBUTES = (Private, ); }; };
464
		0FA7A8EC18B413C80052371D /* Reg.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA7A8EA18B413C80052371D /* Reg.h */; settings = {ATTRIBUTES = (Private, ); }; };
445
		0FA7A8EE18CE4FD80052371D /* ScratchRegisterAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA7A8ED18CE4FD80052371D /* ScratchRegisterAllocator.cpp */; };
465
		0FA7A8EE18CE4FD80052371D /* ScratchRegisterAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA7A8ED18CE4FD80052371D /* ScratchRegisterAllocator.cpp */; };
466
		0FAA3E0919D0C2CB00FAC9E2 /* DFGPromoteHeapAccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FAA3E0819D0C2CB00FAC9E2 /* DFGPromoteHeapAccess.h */; settings = {ATTRIBUTES = (Private, ); }; };
446
		0FAF7EFD165BA91B000C8455 /* JITDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FAF7EFA165BA919000C8455 /* JITDisassembler.cpp */; };
467
		0FAF7EFD165BA91B000C8455 /* JITDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FAF7EFA165BA919000C8455 /* JITDisassembler.cpp */; };
447
		0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FAF7EFB165BA919000C8455 /* JITDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
468
		0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FAF7EFB165BA919000C8455 /* JITDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
448
		0FB105851675480F00F8AB6E /* ExitKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105821675480C00F8AB6E /* ExitKind.cpp */; };
469
		0FB105851675480F00F8AB6E /* ExitKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105821675480C00F8AB6E /* ExitKind.cpp */; };
Lines 1831-1836 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec4
1831
		0F2B66DB17B6B5AB00A7AE3F /* TypedArrays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedArrays.h; sourceTree = "<group>"; };
1852
		0F2B66DB17B6B5AB00A7AE3F /* TypedArrays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedArrays.h; sourceTree = "<group>"; };
1832
		0F2B66DC17B6B5AB00A7AE3F /* TypedArrayType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypedArrayType.cpp; sourceTree = "<group>"; };
1853
		0F2B66DC17B6B5AB00A7AE3F /* TypedArrayType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypedArrayType.cpp; sourceTree = "<group>"; };
1833
		0F2B66DD17B6B5AB00A7AE3F /* TypedArrayType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedArrayType.h; sourceTree = "<group>"; };
1854
		0F2B66DD17B6B5AB00A7AE3F /* TypedArrayType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedArrayType.h; sourceTree = "<group>"; };
1855
		0F2B9CD619D0BA7D00B1D1B5 /* DFGAvailabilityMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGAvailabilityMap.cpp; path = dfg/DFGAvailabilityMap.cpp; sourceTree = "<group>"; };
1856
		0F2B9CD719D0BA7D00B1D1B5 /* DFGAvailabilityMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAvailabilityMap.h; path = dfg/DFGAvailabilityMap.h; sourceTree = "<group>"; };
1857
		0F2B9CD819D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGInsertOSRHintsForUpdate.cpp; path = dfg/DFGInsertOSRHintsForUpdate.cpp; sourceTree = "<group>"; };
1858
		0F2B9CD919D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGInsertOSRHintsForUpdate.h; path = dfg/DFGInsertOSRHintsForUpdate.h; sourceTree = "<group>"; };
1859
		0F2B9CDA19D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGObjectAllocationSinkingPhase.cpp; path = dfg/DFGObjectAllocationSinkingPhase.cpp; sourceTree = "<group>"; };
1860
		0F2B9CDB19D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGObjectAllocationSinkingPhase.h; path = dfg/DFGObjectAllocationSinkingPhase.h; sourceTree = "<group>"; };
1861
		0F2B9CDC19D0BA7D00B1D1B5 /* DFGObjectMaterializationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGObjectMaterializationData.cpp; path = dfg/DFGObjectMaterializationData.cpp; sourceTree = "<group>"; };
1862
		0F2B9CDD19D0BA7D00B1D1B5 /* DFGObjectMaterializationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGObjectMaterializationData.h; path = dfg/DFGObjectMaterializationData.h; sourceTree = "<group>"; };
1863
		0F2B9CDE19D0BA7D00B1D1B5 /* DFGPhiChildren.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGPhiChildren.cpp; path = dfg/DFGPhiChildren.cpp; sourceTree = "<group>"; };
1864
		0F2B9CDF19D0BA7D00B1D1B5 /* DFGPhiChildren.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPhiChildren.h; path = dfg/DFGPhiChildren.h; sourceTree = "<group>"; };
1865
		0F2B9CE019D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGPromotedHeapLocation.cpp; path = dfg/DFGPromotedHeapLocation.cpp; sourceTree = "<group>"; };
1866
		0F2B9CE119D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPromotedHeapLocation.h; path = dfg/DFGPromotedHeapLocation.h; sourceTree = "<group>"; };
1867
		0F2B9CEE19D0BAC100B1D1B5 /* FTLExitPropertyValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLExitPropertyValue.cpp; path = ftl/FTLExitPropertyValue.cpp; sourceTree = "<group>"; };
1868
		0F2B9CEF19D0BAC100B1D1B5 /* FTLExitPropertyValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLExitPropertyValue.h; path = ftl/FTLExitPropertyValue.h; sourceTree = "<group>"; };
1869
		0F2B9CF019D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLExitTimeObjectMaterialization.cpp; path = ftl/FTLExitTimeObjectMaterialization.cpp; sourceTree = "<group>"; };
1870
		0F2B9CF119D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLExitTimeObjectMaterialization.h; path = ftl/FTLExitTimeObjectMaterialization.h; sourceTree = "<group>"; };
1871
		0F2B9CF219D0BAC100B1D1B5 /* FTLOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLOperations.cpp; path = ftl/FTLOperations.cpp; sourceTree = "<group>"; };
1872
		0F2B9CF319D0BAC100B1D1B5 /* FTLOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLOperations.h; path = ftl/FTLOperations.h; sourceTree = "<group>"; };
1834
		0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGFixupPhase.cpp; path = dfg/DFGFixupPhase.cpp; sourceTree = "<group>"; };
1873
		0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGFixupPhase.cpp; path = dfg/DFGFixupPhase.cpp; sourceTree = "<group>"; };
1835
		0F2BDC13151C5D4A00CD8910 /* DFGFixupPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGFixupPhase.h; path = dfg/DFGFixupPhase.h; sourceTree = "<group>"; };
1874
		0F2BDC13151C5D4A00CD8910 /* DFGFixupPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGFixupPhase.h; path = dfg/DFGFixupPhase.h; sourceTree = "<group>"; };
1836
		0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGInsertionSet.h; path = dfg/DFGInsertionSet.h; sourceTree = "<group>"; };
1875
		0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGInsertionSet.h; path = dfg/DFGInsertionSet.h; sourceTree = "<group>"; };
Lines 1892-1897 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec5
1892
		0F3B7E2C19A12AAE00D9BC56 /* CallEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallEdge.cpp; sourceTree = "<group>"; };
1931
		0F3B7E2C19A12AAE00D9BC56 /* CallEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallEdge.cpp; sourceTree = "<group>"; };
1893
		0F3D0BBA194A414300FC9CF9 /* ConstantStructureCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantStructureCheck.cpp; sourceTree = "<group>"; };
1932
		0F3D0BBA194A414300FC9CF9 /* ConstantStructureCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantStructureCheck.cpp; sourceTree = "<group>"; };
1894
		0F3D0BBB194A414300FC9CF9 /* ConstantStructureCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstantStructureCheck.h; sourceTree = "<group>"; };
1933
		0F3D0BBB194A414300FC9CF9 /* ConstantStructureCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstantStructureCheck.h; sourceTree = "<group>"; };
1934
		0F3E01A819D353A500F61B7F /* DFGPrePostNumbering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGPrePostNumbering.cpp; path = dfg/DFGPrePostNumbering.cpp; sourceTree = "<group>"; };
1935
		0F3E01A919D353A500F61B7F /* DFGPrePostNumbering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPrePostNumbering.h; path = dfg/DFGPrePostNumbering.h; sourceTree = "<group>"; };
1895
		0F426A451460CBAB00131F8F /* ValueRecovery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueRecovery.h; sourceTree = "<group>"; };
1936
		0F426A451460CBAB00131F8F /* ValueRecovery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueRecovery.h; sourceTree = "<group>"; };
1896
		0F426A461460CBAB00131F8F /* VirtualRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualRegister.h; sourceTree = "<group>"; };
1937
		0F426A461460CBAB00131F8F /* VirtualRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualRegister.h; sourceTree = "<group>"; };
1897
		0F426A4A1460CD6B00131F8F /* DataFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataFormat.h; sourceTree = "<group>"; };
1938
		0F426A4A1460CD6B00131F8F /* DataFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataFormat.h; sourceTree = "<group>"; };
Lines 2062-2067 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec6
2062
		0FA7A8E918B413C80052371D /* Reg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Reg.cpp; sourceTree = "<group>"; };
2103
		0FA7A8E918B413C80052371D /* Reg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Reg.cpp; sourceTree = "<group>"; };
2063
		0FA7A8EA18B413C80052371D /* Reg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reg.h; sourceTree = "<group>"; };
2104
		0FA7A8EA18B413C80052371D /* Reg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reg.h; sourceTree = "<group>"; };
2064
		0FA7A8ED18CE4FD80052371D /* ScratchRegisterAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScratchRegisterAllocator.cpp; sourceTree = "<group>"; };
2105
		0FA7A8ED18CE4FD80052371D /* ScratchRegisterAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScratchRegisterAllocator.cpp; sourceTree = "<group>"; };
2106
		0FAA3E0819D0C2CB00FAC9E2 /* DFGPromoteHeapAccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPromoteHeapAccess.h; path = dfg/DFGPromoteHeapAccess.h; sourceTree = "<group>"; };
2065
		0FAF7EFA165BA919000C8455 /* JITDisassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITDisassembler.cpp; sourceTree = "<group>"; };
2107
		0FAF7EFA165BA919000C8455 /* JITDisassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITDisassembler.cpp; sourceTree = "<group>"; };
2066
		0FAF7EFB165BA919000C8455 /* JITDisassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITDisassembler.h; sourceTree = "<group>"; };
2108
		0FAF7EFB165BA919000C8455 /* JITDisassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITDisassembler.h; sourceTree = "<group>"; };
2067
		0FB105821675480C00F8AB6E /* ExitKind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExitKind.cpp; sourceTree = "<group>"; };
2109
		0FB105821675480C00F8AB6E /* ExitKind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExitKind.cpp; sourceTree = "<group>"; };
Lines 3471-3478 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec7
3471
				0F235BBF17178E1C00690C7F /* FTLExitArgumentForOperand.cpp */,
3513
				0F235BBF17178E1C00690C7F /* FTLExitArgumentForOperand.cpp */,
3472
				0F235BC017178E1C00690C7F /* FTLExitArgumentForOperand.h */,
3514
				0F235BC017178E1C00690C7F /* FTLExitArgumentForOperand.h */,
3473
				0F235BC117178E1C00690C7F /* FTLExitArgumentList.h */,
3515
				0F235BC117178E1C00690C7F /* FTLExitArgumentList.h */,
3516
				0F2B9CEE19D0BAC100B1D1B5 /* FTLExitPropertyValue.cpp */,
3517
				0F2B9CEF19D0BAC100B1D1B5 /* FTLExitPropertyValue.h */,
3474
				0F235BC217178E1C00690C7F /* FTLExitThunkGenerator.cpp */,
3518
				0F235BC217178E1C00690C7F /* FTLExitThunkGenerator.cpp */,
3475
				0F235BC317178E1C00690C7F /* FTLExitThunkGenerator.h */,
3519
				0F235BC317178E1C00690C7F /* FTLExitThunkGenerator.h */,
3520
				0F2B9CF019D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.cpp */,
3521
				0F2B9CF119D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.h */,
3476
				0F235BC417178E1C00690C7F /* FTLExitValue.cpp */,
3522
				0F235BC417178E1C00690C7F /* FTLExitValue.cpp */,
3477
				0F235BC517178E1C00690C7F /* FTLExitValue.h */,
3523
				0F235BC517178E1C00690C7F /* FTLExitValue.h */,
3478
				A7F2996917A0BB670010417A /* FTLFail.cpp */,
3524
				A7F2996917A0BB670010417A /* FTLFail.cpp */,
Lines 3499-3504 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec8
3499
				0FEA0A04170513DB00BB722C /* FTLLowerDFGToLLVM.cpp */,
3545
				0FEA0A04170513DB00BB722C /* FTLLowerDFGToLLVM.cpp */,
3500
				0FEA0A05170513DB00BB722C /* FTLLowerDFGToLLVM.h */,
3546
				0FEA0A05170513DB00BB722C /* FTLLowerDFGToLLVM.h */,
3501
				A7D89D0117A0B90400773AD8 /* FTLLoweredNodeValue.h */,
3547
				A7D89D0117A0B90400773AD8 /* FTLLoweredNodeValue.h */,
3548
				0F2B9CF219D0BAC100B1D1B5 /* FTLOperations.cpp */,
3549
				0F2B9CF319D0BAC100B1D1B5 /* FTLOperations.h */,
3502
				0FD8A31717D51F2200CA2C40 /* FTLOSREntry.cpp */,
3550
				0FD8A31717D51F2200CA2C40 /* FTLOSREntry.cpp */,
3503
				0FD8A31817D51F2200CA2C40 /* FTLOSREntry.h */,
3551
				0FD8A31817D51F2200CA2C40 /* FTLOSREntry.h */,
3504
				0F235BC617178E1C00690C7F /* FTLOSRExit.cpp */,
3552
				0F235BC617178E1C00690C7F /* FTLOSRExit.cpp */,
Lines 4528-4533 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec9
4528
				A7D9A29017A0BC7400EE2618 /* DFGAtTailAbstractState.h */,
4576
				A7D9A29017A0BC7400EE2618 /* DFGAtTailAbstractState.h */,
4529
				0F666EC21835672B00D017F1 /* DFGAvailability.cpp */,
4577
				0F666EC21835672B00D017F1 /* DFGAvailability.cpp */,
4530
				0F666EC31835672B00D017F1 /* DFGAvailability.h */,
4578
				0F666EC31835672B00D017F1 /* DFGAvailability.h */,
4579
				0F2B9CD619D0BA7D00B1D1B5 /* DFGAvailabilityMap.cpp */,
4580
				0F2B9CD719D0BA7D00B1D1B5 /* DFGAvailabilityMap.h */,
4531
				0F714CA116EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.cpp */,
4581
				0F714CA116EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.cpp */,
4532
				0F714CA216EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.h */,
4582
				0F714CA216EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.h */,
4533
				A7D89CE317A0B8CC00773AD8 /* DFGBasicBlock.cpp */,
4583
				A7D89CE317A0B8CC00773AD8 /* DFGBasicBlock.cpp */,
Lines 4626-4631 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec10
4626
				A704D90017A0BAA8006BA554 /* DFGInPlaceAbstractState.cpp */,
4676
				A704D90017A0BAA8006BA554 /* DFGInPlaceAbstractState.cpp */,
4627
				A704D90117A0BAA8006BA554 /* DFGInPlaceAbstractState.h */,
4677
				A704D90117A0BAA8006BA554 /* DFGInPlaceAbstractState.h */,
4628
				0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */,
4678
				0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */,
4679
				0F2B9CD819D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.cpp */,
4680
				0F2B9CD919D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.h */,
4629
				0F300B7918AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.cpp */,
4681
				0F300B7918AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.cpp */,
4630
				0F300B7A18AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.h */,
4682
				0F300B7A18AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.h */,
4631
				0FC97F3718202119002C9B26 /* DFGInvalidationPointInjectionPhase.cpp */,
4683
				0FC97F3718202119002C9B26 /* DFGInvalidationPointInjectionPhase.cpp */,
Lines 4666-4671 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec11
4666
				0FA581B8150E952A00B9A2D9 /* DFGNodeFlags.h */,
4718
				0FA581B8150E952A00B9A2D9 /* DFGNodeFlags.h */,
4667
				0F300B7718AB051100A6D72E /* DFGNodeOrigin.h */,
4719
				0F300B7718AB051100A6D72E /* DFGNodeOrigin.h */,
4668
				0FA581B9150E952A00B9A2D9 /* DFGNodeType.h */,
4720
				0FA581B9150E952A00B9A2D9 /* DFGNodeType.h */,
4721
				0F2B9CDA19D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.cpp */,
4722
				0F2B9CDB19D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.h */,
4723
				0F2B9CDC19D0BA7D00B1D1B5 /* DFGObjectMaterializationData.cpp */,
4724
				0F2B9CDD19D0BA7D00B1D1B5 /* DFGObjectMaterializationData.h */,
4669
				86EC9DBF1328DF82002B2AD7 /* DFGOperations.cpp */,
4725
				86EC9DBF1328DF82002B2AD7 /* DFGOperations.cpp */,
4670
				86EC9DC01328DF82002B2AD7 /* DFGOperations.h */,
4726
				86EC9DC01328DF82002B2AD7 /* DFGOperations.h */,
4671
				A7D89CEE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.cpp */,
4727
				A7D89CEE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.cpp */,
Lines 4695-4706 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec12
4695
				0FBFDD03196C92BF007A5BFA /* DFGPhantomRemovalPhase.h */,
4751
				0FBFDD03196C92BF007A5BFA /* DFGPhantomRemovalPhase.h */,
4696
				0FFFC94F14EF909500C72532 /* DFGPhase.cpp */,
4752
				0FFFC94F14EF909500C72532 /* DFGPhase.cpp */,
4697
				0FFFC95014EF909500C72532 /* DFGPhase.h */,
4753
				0FFFC95014EF909500C72532 /* DFGPhase.h */,
4754
				0F2B9CDE19D0BA7D00B1D1B5 /* DFGPhiChildren.cpp */,
4755
				0F2B9CDF19D0BA7D00B1D1B5 /* DFGPhiChildren.h */,
4698
				A78A9772179738B8009DF744 /* DFGPlan.cpp */,
4756
				A78A9772179738B8009DF744 /* DFGPlan.cpp */,
4699
				A78A9773179738B8009DF744 /* DFGPlan.h */,
4757
				A78A9773179738B8009DF744 /* DFGPlan.h */,
4700
				0FBE0F6D16C1DB010082C5E8 /* DFGPredictionInjectionPhase.cpp */,
4758
				0FBE0F6D16C1DB010082C5E8 /* DFGPredictionInjectionPhase.cpp */,
4701
				0FBE0F6E16C1DB010082C5E8 /* DFGPredictionInjectionPhase.h */,
4759
				0FBE0F6E16C1DB010082C5E8 /* DFGPredictionInjectionPhase.h */,
4702
				0FFFC95114EF909500C72532 /* DFGPredictionPropagationPhase.cpp */,
4760
				0FFFC95114EF909500C72532 /* DFGPredictionPropagationPhase.cpp */,
4703
				0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */,
4761
				0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */,
4762
				0F3E01A819D353A500F61B7F /* DFGPrePostNumbering.cpp */,
4763
				0F3E01A919D353A500F61B7F /* DFGPrePostNumbering.h */,
4764
				0F2B9CE019D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.cpp */,
4765
				0F2B9CE119D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.h */,
4766
				0FAA3E0819D0C2CB00FAC9E2 /* DFGPromoteHeapAccess.h */,
4704
				0FB1765E196B8F9E0091052A /* DFGPureValue.cpp */,
4767
				0FB1765E196B8F9E0091052A /* DFGPureValue.cpp */,
4705
				0FB1765F196B8F9E0091052A /* DFGPureValue.h */,
4768
				0FB1765F196B8F9E0091052A /* DFGPureValue.h */,
4706
				86EC9DC11328DF82002B2AD7 /* DFGRegisterBank.h */,
4769
				86EC9DC11328DF82002B2AD7 /* DFGRegisterBank.h */,
Lines 5281-5286 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec13
5281
				A5D2E665195E174000A518E7 /* JSContextRefInternal.h in Headers */,
5344
				A5D2E665195E174000A518E7 /* JSContextRefInternal.h in Headers */,
5282
				A7D801A51880D66E0026C39B /* BuiltinExecutables.h in Headers */,
5345
				A7D801A51880D66E0026C39B /* BuiltinExecutables.h in Headers */,
5283
				A75EE9B218AAB7E200AAD043 /* BuiltinNames.h in Headers */,
5346
				A75EE9B218AAB7E200AAD043 /* BuiltinNames.h in Headers */,
5347
				0F2B9CF719D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.h in Headers */,
5284
				0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
5348
				0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
5285
				0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */,
5349
				0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */,
5286
				C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */,
5350
				C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */,
Lines 5339-5344 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec14
5339
				2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */,
5403
				2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */,
5340
				5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */,
5404
				5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */,
5341
				0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
5405
				0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
5406
				0F2B9CE519D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.h in Headers */,
5342
				0F2B66DF17B6B5AB00A7AE3F /* DataView.h in Headers */,
5407
				0F2B66DF17B6B5AB00A7AE3F /* DataView.h in Headers */,
5343
				BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
5408
				BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
5344
				41359CF30FDD89AD00206180 /* DateConversion.h in Headers */,
5409
				41359CF30FDD89AD00206180 /* DateConversion.h in Headers */,
Lines 5426-5435 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec15
5426
				A78A9779179738B8009DF744 /* DFGJITFinalizer.h in Headers */,
5491
				A78A9779179738B8009DF744 /* DFGJITFinalizer.h in Headers */,
5427
				0FC97F4018202119002C9B26 /* DFGJumpReplacement.h in Headers */,
5492
				0FC97F4018202119002C9B26 /* DFGJumpReplacement.h in Headers */,
5428
				A73A535B1799CD5D00170C19 /* DFGLazyJSValue.h in Headers */,
5493
				A73A535B1799CD5D00170C19 /* DFGLazyJSValue.h in Headers */,
5494
				0F2B9CE919D0BA7D00B1D1B5 /* DFGObjectMaterializationData.h in Headers */,
5429
				A7D9A29817A0BC7400EE2618 /* DFGLICMPhase.h in Headers */,
5495
				A7D9A29817A0BC7400EE2618 /* DFGLICMPhase.h in Headers */,
5430
				A7D89CFC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.h in Headers */,
5496
				A7D89CFC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.h in Headers */,
5431
				0FF0F19B16B729FA005DF95B /* DFGLongLivedState.h in Headers */,
5497
				0FF0F19B16B729FA005DF95B /* DFGLongLivedState.h in Headers */,
5432
				A767B5B617A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h in Headers */,
5498
				A767B5B617A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h in Headers */,
5499
				0F2B9CED19D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.h in Headers */,
5433
				A704D90717A0BAA8006BA554 /* DFGMergeMode.h in Headers */,
5500
				A704D90717A0BAA8006BA554 /* DFGMergeMode.h in Headers */,
5434
				0FB17663196B8F9E0091052A /* DFGPureValue.h in Headers */,
5501
				0FB17663196B8F9E0091052A /* DFGPureValue.h in Headers */,
5435
				0F2BDC451522801B00CD8910 /* DFGMinifiedGraph.h in Headers */,
5502
				0F2BDC451522801B00CD8910 /* DFGMinifiedGraph.h in Headers */,
Lines 5486-5491 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec16
5486
				0F2BDC471522802500CD8910 /* DFGValueRecoveryOverride.h in Headers */,
5553
				0F2BDC471522802500CD8910 /* DFGValueRecoveryOverride.h in Headers */,
5487
				0F2BDC481522802900CD8910 /* DFGValueSource.h in Headers */,
5554
				0F2BDC481522802900CD8910 /* DFGValueSource.h in Headers */,
5488
				0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
5555
				0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
5556
				0FAA3E0919D0C2CB00FAC9E2 /* DFGPromoteHeapAccess.h in Headers */,
5489
				0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */,
5557
				0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */,
5490
				0F2BDC491522809600CD8910 /* DFGVariableEvent.h in Headers */,
5558
				0F2BDC491522809600CD8910 /* DFGVariableEvent.h in Headers */,
5491
				0F2BDC4B1522809D00CD8910 /* DFGVariableEventStream.h in Headers */,
5559
				0F2BDC4B1522809D00CD8910 /* DFGVariableEventStream.h in Headers */,
Lines 5623-5628 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec17
5623
				0F24E55617F0B71C00ABB217 /* InlineCallFrameSet.h in Headers */,
5691
				0F24E55617F0B71C00ABB217 /* InlineCallFrameSet.h in Headers */,
5624
				99E45A2718A1B2590026D88F /* InputCursor.h in Headers */,
5692
				99E45A2718A1B2590026D88F /* InputCursor.h in Headers */,
5625
				A593CF7F1840362C00BFCE27 /* InspectorAgentBase.h in Headers */,
5693
				A593CF7F1840362C00BFCE27 /* InspectorAgentBase.h in Headers */,
5694
				0F3E01AB19D353A500F61B7F /* DFGPrePostNumbering.h in Headers */,
5626
				A593CF87184038CA00BFCE27 /* InspectorAgentRegistry.h in Headers */,
5695
				A593CF87184038CA00BFCE27 /* InspectorAgentRegistry.h in Headers */,
5627
				A593CF7D1840360300BFCE27 /* InspectorBackendDispatcher.h in Headers */,
5696
				A593CF7D1840360300BFCE27 /* InspectorBackendDispatcher.h in Headers */,
5628
				A5FD0082189B191A00633231 /* InspectorConsoleAgent.h in Headers */,
5697
				A5FD0082189B191A00633231 /* InspectorConsoleAgent.h in Headers */,
Lines 5647-5652 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec18
5647
				1429D77C0ED20D7300B89619 /* Interpreter.h in Headers */,
5716
				1429D77C0ED20D7300B89619 /* Interpreter.h in Headers */,
5648
				860BD801148EA6F200112B2F /* Intrinsic.h in Headers */,
5717
				860BD801148EA6F200112B2F /* Intrinsic.h in Headers */,
5649
				BC18C4130E16F5CD00B34460 /* JavaScript.h in Headers */,
5718
				BC18C4130E16F5CD00B34460 /* JavaScript.h in Headers */,
5719
				0F2B9CF519D0BAC100B1D1B5 /* FTLExitPropertyValue.h in Headers */,
5650
				A503FA1A188E0FB000110F14 /* JavaScriptCallFrame.h in Headers */,
5720
				A503FA1A188E0FB000110F14 /* JavaScriptCallFrame.h in Headers */,
5651
				BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
5721
				BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
5652
				BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */,
5722
				BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */,
Lines 5690-5695 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec19
5690
				657CF45919BF6662004ACBF2 /* JSCallee.h in Headers */,
5760
				657CF45919BF6662004ACBF2 /* JSCallee.h in Headers */,
5691
				BC18C4190E16F5CD00B34460 /* JSCallbackConstructor.h in Headers */,
5761
				BC18C4190E16F5CD00B34460 /* JSCallbackConstructor.h in Headers */,
5692
				BC18C41A0E16F5CD00B34460 /* JSCallbackFunction.h in Headers */,
5762
				BC18C41A0E16F5CD00B34460 /* JSCallbackFunction.h in Headers */,
5763
				0F2B9CF919D0BAC100B1D1B5 /* FTLOperations.h in Headers */,
5693
				BC18C41B0E16F5CD00B34460 /* JSCallbackObject.h in Headers */,
5764
				BC18C41B0E16F5CD00B34460 /* JSCallbackObject.h in Headers */,
5694
				BC18C41C0E16F5CD00B34460 /* JSCallbackObjectFunctions.h in Headers */,
5765
				BC18C41C0E16F5CD00B34460 /* JSCallbackObjectFunctions.h in Headers */,
5695
				A7D801A91880D6A80026C39B /* JSCBuiltins.h in Headers */,
5766
				A7D801A91880D6A80026C39B /* JSCBuiltins.h in Headers */,
Lines 5790-5795 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec20
5790
				BC18C42D0E16F5CD00B34460 /* JSEnvironmentRecord.h in Headers */,
5861
				BC18C42D0E16F5CD00B34460 /* JSEnvironmentRecord.h in Headers */,
5791
				86E3C615167BABD7006D760A /* JSVirtualMachine.h in Headers */,
5862
				86E3C615167BABD7006D760A /* JSVirtualMachine.h in Headers */,
5792
				86E3C61D167BABEE006D760A /* JSVirtualMachineInternal.h in Headers */,
5863
				86E3C61D167BABEE006D760A /* JSVirtualMachineInternal.h in Headers */,
5864
				0F2B9CE719D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.h in Headers */,
5793
				A7CA3AE817DA41AE006538AF /* JSWeakMap.h in Headers */,
5865
				A7CA3AE817DA41AE006538AF /* JSWeakMap.h in Headers */,
5794
				A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */,
5866
				A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */,
5795
				A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */,
5867
				A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */,
Lines 5904-5909 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec21
5904
				0F13912A16771C36009CCB07 /* ProfilerBytecodeSequence.h in Headers */,
5976
				0F13912A16771C36009CCB07 /* ProfilerBytecodeSequence.h in Headers */,
5905
				0FF729BA166AD360000F5BA3 /* ProfilerCompilation.h in Headers */,
5977
				0FF729BA166AD360000F5BA3 /* ProfilerCompilation.h in Headers */,
5906
				0FF729BB166AD360000F5BA3 /* ProfilerCompilationKind.h in Headers */,
5978
				0FF729BB166AD360000F5BA3 /* ProfilerCompilationKind.h in Headers */,
5979
				0F2B9CE319D0BA7D00B1D1B5 /* DFGAvailabilityMap.h in Headers */,
5907
				0FF729BC166AD360000F5BA3 /* ProfilerCompiledBytecode.h in Headers */,
5980
				0FF729BC166AD360000F5BA3 /* ProfilerCompiledBytecode.h in Headers */,
5908
				0FF729BD166AD360000F5BA3 /* ProfilerDatabase.h in Headers */,
5981
				0FF729BD166AD360000F5BA3 /* ProfilerDatabase.h in Headers */,
5909
				2A05ABD61961DF2400341750 /* JSPropertyNameEnumerator.h in Headers */,
5982
				2A05ABD61961DF2400341750 /* JSPropertyNameEnumerator.h in Headers */,
Lines 6011-6016 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec22
6011
				0FD2C92416D01EE900C7803F /* StructureInlines.h in Headers */,
6084
				0FD2C92416D01EE900C7803F /* StructureInlines.h in Headers */,
6012
				C2FE18A416BAEC4000AF3061 /* StructureRareData.h in Headers */,
6085
				C2FE18A416BAEC4000AF3061 /* StructureRareData.h in Headers */,
6013
				C20BA92D16BB1C1500B3AEA2 /* StructureRareDataInlines.h in Headers */,
6086
				C20BA92D16BB1C1500B3AEA2 /* StructureRareDataInlines.h in Headers */,
6087
				0F2B9CEB19D0BA7D00B1D1B5 /* DFGPhiChildren.h in Headers */,
6014
				0F9332A514CA7DDD0085F3C6 /* StructureSet.h in Headers */,
6088
				0F9332A514CA7DDD0085F3C6 /* StructureSet.h in Headers */,
6015
				0F766D3915AE4A1F008F363E /* StructureStubClearingWatchpoint.h in Headers */,
6089
				0F766D3915AE4A1F008F363E /* StructureStubClearingWatchpoint.h in Headers */,
6016
				BCCF0D080EF0AAB900413C8F /* StructureStubInfo.h in Headers */,
6090
				BCCF0D080EF0AAB900413C8F /* StructureStubInfo.h in Headers */,
Lines 6579-6584 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec23
6579
				1429D8DD0ED2205B00B89619 /* CallFrame.cpp in Sources */,
6653
				1429D8DD0ED2205B00B89619 /* CallFrame.cpp in Sources */,
6580
				0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */,
6654
				0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */,
6581
				0F93329D14CA7DC30085F3C6 /* CallLinkStatus.cpp in Sources */,
6655
				0F93329D14CA7DC30085F3C6 /* CallLinkStatus.cpp in Sources */,
6656
				0F2B9CE419D0BA7D00B1D1B5 /* DFGInsertOSRHintsForUpdate.cpp in Sources */,
6582
				0F73D7AE165A142D00ACAB71 /* ClosureCallStubRoutine.cpp in Sources */,
6657
				0F73D7AE165A142D00ACAB71 /* ClosureCallStubRoutine.cpp in Sources */,
6583
				969A07960ED1D3AE00F1F681 /* CodeBlock.cpp in Sources */,
6658
				969A07960ED1D3AE00F1F681 /* CodeBlock.cpp in Sources */,
6584
				0F8F94401667633000D61971 /* CodeBlockHash.cpp in Sources */,
6659
				0F8F94401667633000D61971 /* CodeBlockHash.cpp in Sources */,
Lines 6623-6634 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec24
6623
				A7D9A29417A0BC7400EE2618 /* DFGAtTailAbstractState.cpp in Sources */,
6698
				A7D9A29417A0BC7400EE2618 /* DFGAtTailAbstractState.cpp in Sources */,
6624
				0F666EC61835672B00D017F1 /* DFGAvailability.cpp in Sources */,
6699
				0F666EC61835672B00D017F1 /* DFGAvailability.cpp in Sources */,
6625
				0F714CA416EA92F000F3EBEB /* DFGBackwardsPropagationPhase.cpp in Sources */,
6700
				0F714CA416EA92F000F3EBEB /* DFGBackwardsPropagationPhase.cpp in Sources */,
6701
				0F2B9CEC19D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.cpp in Sources */,
6626
				A7D89CF217A0B8CC00773AD8 /* DFGBasicBlock.cpp in Sources */,
6702
				A7D89CF217A0B8CC00773AD8 /* DFGBasicBlock.cpp in Sources */,
6627
				A70B083217A0B79B00DAF14B /* DFGBinarySwitch.cpp in Sources */,
6703
				A70B083217A0B79B00DAF14B /* DFGBinarySwitch.cpp in Sources */,
6628
				2A88067819107D5500CB0BBB /* DFGFunctionWhitelist.cpp in Sources */,
6704
				2A88067819107D5500CB0BBB /* DFGFunctionWhitelist.cpp in Sources */,
6629
				A7D89CF317A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp in Sources */,
6705
				A7D89CF317A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp in Sources */,
6630
				86EC9DC41328DF82002B2AD7 /* DFGByteCodeParser.cpp in Sources */,
6706
				86EC9DC41328DF82002B2AD7 /* DFGByteCodeParser.cpp in Sources */,
6631
				0FD82E2114172CE300179C94 /* DFGCapabilities.cpp in Sources */,
6707
				0FD82E2114172CE300179C94 /* DFGCapabilities.cpp in Sources */,
6708
				0F2B9CE619D0BA7D00B1D1B5 /* DFGObjectAllocationSinkingPhase.cpp in Sources */,
6632
				0FFFC95714EF90A000C72532 /* DFGCFAPhase.cpp in Sources */,
6709
				0FFFC95714EF90A000C72532 /* DFGCFAPhase.cpp in Sources */,
6633
				0F3B3A271544C995003ED0FF /* DFGCFGSimplificationPhase.cpp in Sources */,
6710
				0F3B3A271544C995003ED0FF /* DFGCFGSimplificationPhase.cpp in Sources */,
6634
				A77A423F17A0BBFD00A8DB81 /* DFGClobberize.cpp in Sources */,
6711
				A77A423F17A0BBFD00A8DB81 /* DFGClobberize.cpp in Sources */,
Lines 6651-6656 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec25
6651
				0FCA9113195E66A000426438 /* VariableWatchpointSet.cpp in Sources */,
6728
				0FCA9113195E66A000426438 /* VariableWatchpointSet.cpp in Sources */,
6652
				0FD81AD2154FB4EE00983E72 /* DFGDominators.cpp in Sources */,
6729
				0FD81AD2154FB4EE00983E72 /* DFGDominators.cpp in Sources */,
6653
				0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
6730
				0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
6731
				0F2B9CE219D0BA7D00B1D1B5 /* DFGAvailabilityMap.cpp in Sources */,
6732
				0F2B9CE819D0BA7D00B1D1B5 /* DFGObjectMaterializationData.cpp in Sources */,
6654
				0FF0F19E16B72A0B005DF95B /* DFGEdge.cpp in Sources */,
6733
				0FF0F19E16B72A0B005DF95B /* DFGEdge.cpp in Sources */,
6655
				0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */,
6734
				0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */,
6656
				0F0123321944EA1B00843A0C /* DFGValueStrength.cpp in Sources */,
6735
				0F0123321944EA1B00843A0C /* DFGValueStrength.cpp in Sources */,
Lines 6767-6772 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec26
6767
				0FC3CCFF19ADA410006AC72A /* DFGBlockWorklist.cpp in Sources */,
6846
				0FC3CCFF19ADA410006AC72A /* DFGBlockWorklist.cpp in Sources */,
6768
				0FEA0A0D170513DB00BB722C /* FTLJITCode.cpp in Sources */,
6847
				0FEA0A0D170513DB00BB722C /* FTLJITCode.cpp in Sources */,
6769
				A78A9780179738D5009DF744 /* FTLJITFinalizer.cpp in Sources */,
6848
				A78A9780179738D5009DF744 /* FTLJITFinalizer.cpp in Sources */,
6849
				0F2B9CF419D0BAC100B1D1B5 /* FTLExitPropertyValue.cpp in Sources */,
6770
				0F6B1CB5185FC9E900845D97 /* FTLJSCall.cpp in Sources */,
6850
				0F6B1CB5185FC9E900845D97 /* FTLJSCall.cpp in Sources */,
6771
				0F8F2B95172E04A0007DBDA5 /* FTLLink.cpp in Sources */,
6851
				0F8F2B95172E04A0007DBDA5 /* FTLLink.cpp in Sources */,
6772
				0FCEFADF180738C000472CE4 /* FTLLocation.cpp in Sources */,
6852
				0FCEFADF180738C000472CE4 /* FTLLocation.cpp in Sources */,
Lines 6818-6823 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec27
6818
				0F24E55517F0B71C00ABB217 /* InlineCallFrameSet.cpp in Sources */,
6898
				0F24E55517F0B71C00ABB217 /* InlineCallFrameSet.cpp in Sources */,
6819
				A5CEEE14187F3BAD00E55C99 /* InspectorAgent.cpp in Sources */,
6899
				A5CEEE14187F3BAD00E55C99 /* InspectorAgent.cpp in Sources */,
6820
				A593CF86184038CA00BFCE27 /* InspectorAgentRegistry.cpp in Sources */,
6900
				A593CF86184038CA00BFCE27 /* InspectorAgentRegistry.cpp in Sources */,
6901
				0F2B9CF619D0BAC100B1D1B5 /* FTLExitTimeObjectMaterialization.cpp in Sources */,
6821
				A593CF7C1840360300BFCE27 /* InspectorBackendDispatcher.cpp in Sources */,
6902
				A593CF7C1840360300BFCE27 /* InspectorBackendDispatcher.cpp in Sources */,
6822
				2AF7382C18BBBF92008A5A37 /* StructureIDTable.cpp in Sources */,
6903
				2AF7382C18BBBF92008A5A37 /* StructureIDTable.cpp in Sources */,
6823
				A5FD0081189B191A00633231 /* InspectorConsoleAgent.cpp in Sources */,
6904
				A5FD0081189B191A00633231 /* InspectorConsoleAgent.cpp in Sources */,
Lines 6997-7002 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec28
6997
				0F9FC8C314E1B5FE00D52AE0 /* PolymorphicPutByIdList.cpp in Sources */,
7078
				0F9FC8C314E1B5FE00D52AE0 /* PolymorphicPutByIdList.cpp in Sources */,
6998
				0F98206016BFE38100240D02 /* PreciseJumpTargets.cpp in Sources */,
7079
				0F98206016BFE38100240D02 /* PreciseJumpTargets.cpp in Sources */,
6999
				95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
7080
				95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
7081
				0F2B9CF819D0BAC100B1D1B5 /* FTLOperations.cpp in Sources */,
7000
				95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
7082
				95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
7001
				95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
7083
				95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
7002
				0FF729AD166AD35C000F5BA3 /* ProfilerBytecode.cpp in Sources */,
7084
				0FF729AD166AD35C000F5BA3 /* ProfilerBytecode.cpp in Sources */,
Lines 7019-7024 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec29
7019
				65FB5117184EEE7000C12B70 /* ProtoCallFrame.cpp in Sources */,
7101
				65FB5117184EEE7000C12B70 /* ProtoCallFrame.cpp in Sources */,
7020
				1474C33C16AA2D9B0062F01D /* PrototypeMap.cpp in Sources */,
7102
				1474C33C16AA2D9B0062F01D /* PrototypeMap.cpp in Sources */,
7021
				0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */,
7103
				0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */,
7104
				0F3E01AA19D353A500F61B7F /* DFGPrePostNumbering.cpp in Sources */,
7022
				0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */,
7105
				0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */,
7023
				0FA7A8EB18B413C80052371D /* Reg.cpp in Sources */,
7106
				0FA7A8EB18B413C80052371D /* Reg.cpp in Sources */,
7024
				14280841107EC0930013E7B2 /* RegExp.cpp in Sources */,
7107
				14280841107EC0930013E7B2 /* RegExp.cpp in Sources */,
Lines 7088-7093 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec30
7088
				0FF42745158EBE91004CB9FF /* udis86_syn-att.c in Sources */,
7171
				0FF42745158EBE91004CB9FF /* udis86_syn-att.c in Sources */,
7089
				0FF42746158EBE91004CB9FF /* udis86_syn-intel.c in Sources */,
7172
				0FF42746158EBE91004CB9FF /* udis86_syn-intel.c in Sources */,
7090
				0FF42747158EBE91004CB9FF /* udis86_syn.c in Sources */,
7173
				0FF42747158EBE91004CB9FF /* udis86_syn.c in Sources */,
7174
				0F2B9CEA19D0BA7D00B1D1B5 /* DFGPhiChildren.cpp in Sources */,
7091
				0FF42732158EBD58004CB9FF /* UDis86Disassembler.cpp in Sources */,
7175
				0FF42732158EBD58004CB9FF /* UDis86Disassembler.cpp in Sources */,
7092
				A76F279415F13C9600517D67 /* UnlinkedCodeBlock.cpp in Sources */,
7176
				A76F279415F13C9600517D67 /* UnlinkedCodeBlock.cpp in Sources */,
7093
				B59F89391891F29F00D5CCDC /* UnlinkedInstructionStream.cpp in Sources */,
7177
				B59F89391891F29F00D5CCDC /* UnlinkedInstructionStream.cpp in Sources */,
- Source/JavaScriptCore/bytecode/StructureSet.h +31 lines
Lines 166-171 public: Source/JavaScriptCore/bytecode/StructureSet.h_sec1
166
        return structureList()->list()[structureList()->m_length - 1];
166
        return structureList()->list()[structureList()->m_length - 1];
167
    }
167
    }
168
    
168
    
169
    class iterator {
170
    public:
171
        iterator()
172
            : m_set(nullptr)
173
            , m_index(0)
174
        {
175
        }
176
        
177
        iterator(const StructureSet* set, size_t index)
178
            : m_set(set)
179
            , m_index(index)
180
        {
181
        }
182
        
183
        Structure* operator*() const { return m_set->at(m_index); }
184
        iterator& operator++()
185
        {
186
            m_index++;
187
            return *this;
188
        }
189
        bool operator==(const iterator& other) const { return m_index == other.m_index; }
190
        bool operator!=(const iterator& other) const { return !(*this == other); }
191
        
192
    private:
193
        const StructureSet* m_set;
194
        size_t m_index;
195
    };
196
    
197
    iterator begin() const { return iterator(this, 0); }
198
    iterator end() const { return iterator(this, size()); }
199
    
169
    bool operator==(const StructureSet& other) const;
200
    bool operator==(const StructureSet& other) const;
170
    
201
    
171
    SpeculatedType speculationFromStructures() const;
202
    SpeculatedType speculationFromStructures() const;
- Source/JavaScriptCore/dfg/DFGAbstractInterpreter.h -8 / +9 lines
Lines 32-37 Source/JavaScriptCore/dfg/DFGAbstractInterpreter.h_sec1
32
#include "DFGBranchDirection.h"
32
#include "DFGBranchDirection.h"
33
#include "DFGGraph.h"
33
#include "DFGGraph.h"
34
#include "DFGNode.h"
34
#include "DFGNode.h"
35
#include "DFGPhiChildren.h"
35
36
36
namespace JSC { namespace DFG {
37
namespace JSC { namespace DFG {
37
38
Lines 80-97 public: Source/JavaScriptCore/dfg/DFGAbstractInterpreter.h_sec2
80
    //
81
    //
81
    // This is guaranteed to be equivalent to doing:
82
    // This is guaranteed to be equivalent to doing:
82
    //
83
    //
83
    // if (state.startExecuting(index)) {
84
    // state.startExecuting()
84
    //     state.executeEdges(index);
85
    // state.executeEdges(index);
85
    //     result = state.executeEffects(index);
86
    // result = state.executeEffects(index);
86
    // } else
87
    //     result = true;
88
    bool execute(unsigned indexInBlock);
87
    bool execute(unsigned indexInBlock);
89
    bool execute(Node*);
88
    bool execute(Node*);
90
    
89
    
91
    // Indicate the start of execution of the node. It resets any state in the node
90
    // Indicate the start of execution of a node. It resets any state in the node
92
    // that is progressively built up by executeEdges() and executeEffects().
91
    // that is progressively built up by executeEdges() and executeEffects().
93
    bool startExecuting(Node*);
92
    void startExecuting();
94
    bool startExecuting(unsigned indexInBlock);
95
    
93
    
96
    // Abstractly execute the edges of the given node. This runs filterEdgeByUse()
94
    // Abstractly execute the edges of the given node. This runs filterEdgeByUse()
97
    // on all edges of the node. You can skip this step, if you have already used
95
    // on all edges of the node. You can skip this step, if you have already used
Lines 146-151 public: Source/JavaScriptCore/dfg/DFGAbstractInterpreter.h_sec3
146
    FiltrationResult filter(AbstractValue&, SpeculatedType);
144
    FiltrationResult filter(AbstractValue&, SpeculatedType);
147
    FiltrationResult filterByValue(AbstractValue&, FrozenValue);
145
    FiltrationResult filterByValue(AbstractValue&, FrozenValue);
148
    
146
    
147
    PhiChildren* phiChildren() { return m_phiChildren.get(); }
148
    
149
private:
149
private:
150
    void clobberWorld(const CodeOrigin&, unsigned indexInBlock);
150
    void clobberWorld(const CodeOrigin&, unsigned indexInBlock);
151
    void clobberCapturedVars(const CodeOrigin&);
151
    void clobberCapturedVars(const CodeOrigin&);
Lines 195-200 private: Source/JavaScriptCore/dfg/DFGAbstractInterpreter.h_sec4
195
    CodeBlock* m_codeBlock;
195
    CodeBlock* m_codeBlock;
196
    Graph& m_graph;
196
    Graph& m_graph;
197
    AbstractStateType& m_state;
197
    AbstractStateType& m_state;
198
    std::unique_ptr<PhiChildren> m_phiChildren;
198
};
199
};
199
200
200
} } // namespace JSC::DFG
201
} } // namespace JSC::DFG
- Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h -18 / +73 lines
Lines 43-48 AbstractInterpreter<AbstractStateType>:: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec1
43
    , m_graph(graph)
43
    , m_graph(graph)
44
    , m_state(state)
44
    , m_state(state)
45
{
45
{
46
    if (m_graph.m_form == SSA)
47
        m_phiChildren = std::make_unique<PhiChildren>(m_graph);
46
}
48
}
47
49
48
template<typename AbstractStateType>
50
template<typename AbstractStateType>
Lines 81-100 AbstractInterpreter<AbstractStateType>:: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec2
81
}
83
}
82
84
83
template<typename AbstractStateType>
85
template<typename AbstractStateType>
84
bool AbstractInterpreter<AbstractStateType>::startExecuting(Node* node)
86
void AbstractInterpreter<AbstractStateType>::startExecuting()
85
{
87
{
86
    ASSERT(m_state.block());
88
    ASSERT(m_state.block());
87
    ASSERT(m_state.isValid());
89
    ASSERT(m_state.isValid());
88
    
90
    
89
    m_state.setDidClobber(false);
91
    m_state.setDidClobber(false);
90
    
91
    return node->shouldGenerate();
92
}
93
94
template<typename AbstractStateType>
95
bool AbstractInterpreter<AbstractStateType>::startExecuting(unsigned indexInBlock)
96
{
97
    return startExecuting(m_state.block()->at(indexInBlock));
98
}
92
}
99
93
100
template<typename AbstractStateType>
94
template<typename AbstractStateType>
Lines 1260-1265 bool AbstractInterpreter<AbstractStateTy Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec3
1260
        forNode(node).set(m_graph, node->structure());
1254
        forNode(node).set(m_graph, node->structure());
1261
        break;
1255
        break;
1262
        
1256
        
1257
    case PhantomNewObject:
1258
    case BottomValue:
1259
        m_state.setDidClobber(true); // Prevent constant folding.
1260
        // This claims to return bottom.
1261
        break;
1262
        
1263
    case PutByOffsetHint:
1264
    case PutStructureHint:
1265
        break;
1266
        
1267
    case MaterializeNewObject: {
1268
        StructureSet set;
1269
        
1270
        m_phiChildren->forAllTransitiveIncomingValues(
1271
            m_graph.varArgChild(node, 0).node(),
1272
            [&] (Node* incoming) {
1273
                set.add(incoming->castConstant<Structure*>());
1274
            });
1275
        
1276
        forNode(node).set(m_graph, set);
1277
        break;
1278
    }
1279
        
1263
    case CreateActivation:
1280
    case CreateActivation:
1264
        forNode(node).set(
1281
        forNode(node).set(
1265
            m_graph, m_codeBlock->globalObjectFor(node->origin.semantic)->activationStructure());
1282
            m_graph, m_codeBlock->globalObjectFor(node->origin.semantic)->activationStructure());
Lines 1459-1465 bool AbstractInterpreter<AbstractStateTy Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec4
1459
        break;
1476
        break;
1460
        
1477
        
1461
    case CheckStructure: {
1478
    case CheckStructure: {
1462
        // FIXME: We should be able to propagate the structure sets of constants (i.e. prototypes).
1463
        AbstractValue& value = forNode(node->child1());
1479
        AbstractValue& value = forNode(node->child1());
1464
        ASSERT(!(value.m_type & ~SpecCell)); // Edge filtering should have already ensured this.
1480
        ASSERT(!(value.m_type & ~SpecCell)); // Edge filtering should have already ensured this.
1465
1481
Lines 1478-1483 bool AbstractInterpreter<AbstractStateTy Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec5
1478
        break;
1494
        break;
1479
    }
1495
    }
1480
        
1496
        
1497
    case CheckStructureImmediate: {
1498
        // FIXME: This currently can only reason about one structure at a time.
1499
        // https://bugs.webkit.org/show_bug.cgi?id=136988
1500
        
1501
        AbstractValue& value = forNode(node->child1());
1502
        StructureSet& set = node->structureSet();
1503
        
1504
        if (value.value()) {
1505
            if (Structure* structure = jsDynamicCast<Structure*>(value.value())) {
1506
                if (set.contains(structure)) {
1507
                    m_state.setFoundConstants(true);
1508
                    break;
1509
                }
1510
            }
1511
            m_state.setIsValid(false);
1512
            break;
1513
        }
1514
        
1515
        if (m_phiChildren) {
1516
            bool allGood = true;
1517
            m_phiChildren->forAllTransitiveIncomingValues(
1518
                node,
1519
                [&] (Node* incoming) {
1520
                    if (Structure* structure = incoming->dynamicCastConstant<Structure*>()) {
1521
                        if (set.contains(structure))
1522
                            return;
1523
                    }
1524
                    allGood = false;
1525
                });
1526
            if (allGood) {
1527
                m_state.setFoundConstants(true);
1528
                break;
1529
            }
1530
        }
1531
            
1532
        if (Structure* structure = set.onlyStructure()) {
1533
            filterByValue(node->child1(), *m_graph.freeze(structure));
1534
            break;
1535
        }
1536
        
1537
        // Aw shucks, we can't do anything!
1538
        break;
1539
    }
1540
        
1481
    case PutStructure:
1541
    case PutStructure:
1482
        if (!forNode(node->child1()).m_structure.isClear()) {
1542
        if (!forNode(node->child1()).m_structure.isClear()) {
1483
            if (forNode(node->child1()).m_structure.onlyStructure() == node->transition()->next)
1543
            if (forNode(node->child1()).m_structure.onlyStructure() == node->transition()->next)
Lines 1957-1971 bool AbstractInterpreter<AbstractStateTy Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec6
1957
2017
1958
    case CheckTierUpAndOSREnter:
2018
    case CheckTierUpAndOSREnter:
1959
    case LoopHint:
2019
    case LoopHint:
1960
        // We pretend that it can exit because it may want to get all state.
2020
    case ZombieHint:
1961
        break;
2021
        break;
1962
2022
1963
    case ZombieHint:
1964
    case Unreachable:
2023
    case Unreachable:
1965
    case LastNodeType:
2024
    case LastNodeType:
1966
    case ArithIMul:
2025
    case ArithIMul:
1967
    case FiatInt52:
2026
    case FiatInt52:
1968
    case BottomValue:
1969
        DFG_CRASH(m_graph, node, "Unexpected node type");
2027
        DFG_CRASH(m_graph, node, "Unexpected node type");
1970
        break;
2028
        break;
1971
    }
2029
    }
Lines 1983-1991 template<typename AbstractStateType> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec7
1983
bool AbstractInterpreter<AbstractStateType>::execute(unsigned indexInBlock)
2041
bool AbstractInterpreter<AbstractStateType>::execute(unsigned indexInBlock)
1984
{
2042
{
1985
    Node* node = m_state.block()->at(indexInBlock);
2043
    Node* node = m_state.block()->at(indexInBlock);
1986
    if (!startExecuting(node))
1987
        return true;
1988
    
2044
    
2045
    startExecuting();
1989
    executeEdges(node);
2046
    executeEdges(node);
1990
    return executeEffects(indexInBlock, node);
2047
    return executeEffects(indexInBlock, node);
1991
}
2048
}
Lines 1993-2001 bool AbstractInterpreter<AbstractStateTy Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h_sec8
1993
template<typename AbstractStateType>
2050
template<typename AbstractStateType>
1994
bool AbstractInterpreter<AbstractStateType>::execute(Node* node)
2051
bool AbstractInterpreter<AbstractStateType>::execute(Node* node)
1995
{
2052
{
1996
    if (!startExecuting(node))
2053
    startExecuting();
1997
        return true;
1998
    
1999
    executeEdges(node);
2054
    executeEdges(node);
2000
    return executeEffects(UINT_MAX, node);
2055
    return executeEffects(UINT_MAX, node);
2001
}
2056
}
- Source/JavaScriptCore/dfg/DFGAvailability.h +12 lines
Lines 85-90 public: Source/JavaScriptCore/dfg/DFGAvailability.h_sec1
85
    bool nodeIsUnavailable() const { return m_node == unavailableMarker(); }
85
    bool nodeIsUnavailable() const { return m_node == unavailableMarker(); }
86
    
86
    
87
    bool hasNode() const { return !nodeIsUndecided() && !nodeIsUnavailable(); }
87
    bool hasNode() const { return !nodeIsUndecided() && !nodeIsUnavailable(); }
88
    bool shouldUseNode() const { return !isFlushUseful() && hasNode(); }
88
    
89
    
89
    Node* node() const
90
    Node* node() const
90
    {
91
    {
Lines 94-99 public: Source/JavaScriptCore/dfg/DFGAvailability.h_sec2
94
    }
95
    }
95
    
96
    
96
    FlushedAt flushedAt() const { return m_flushedAt; }
97
    FlushedAt flushedAt() const { return m_flushedAt; }
98
    bool isFlushUseful() const
99
    {
100
        return flushedAt().format() != DeadFlush && flushedAt().format() != ConflictingFlush;
101
    }
102
    
103
    bool isDead() const { return !isFlushUseful() && !hasNode(); }
97
    
104
    
98
    bool operator!() const { return nodeIsUnavailable() && flushedAt().format() == ConflictingFlush; }
105
    bool operator!() const { return nodeIsUnavailable() && flushedAt().format() == ConflictingFlush; }
99
106
Lines 103-108 public: Source/JavaScriptCore/dfg/DFGAvailability.h_sec3
103
            && m_flushedAt == other.m_flushedAt;
110
            && m_flushedAt == other.m_flushedAt;
104
    }
111
    }
105
    
112
    
113
    bool operator!=(const Availability& other) const
114
    {
115
        return !(*this == other);
116
    }
117
    
106
    Availability merge(const Availability& other) const
118
    Availability merge(const Availability& other) const
107
    {
119
    {
108
        return Availability(
120
        return Availability(
- Source/JavaScriptCore/dfg/DFGAvailabilityMap.cpp +96 lines
Line 0 Source/JavaScriptCore/dfg/DFGAvailabilityMap.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DFGAvailabilityMap.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "OperandsInlines.h"
32
#include <wtf/ListDump.h>
33
34
namespace JSC { namespace DFG {
35
36
void AvailabilityMap::prune()
37
{
38
    if (m_heap.isEmpty())
39
        return;
40
    
41
    HashSet<Node*> possibleNodes;
42
    
43
    for (unsigned i = m_locals.size(); i--;) {
44
        if (m_locals[i].hasNode())
45
            possibleNodes.add(m_locals[i].node());
46
    }
47
48
    int oldPossibleNodesSize;
49
    do {
50
        oldPossibleNodesSize = possibleNodes.size();
51
        for (auto pair : m_heap) {
52
            if (pair.value.hasNode() && possibleNodes.contains(pair.key.base()))
53
                possibleNodes.add(pair.value.node());
54
        }
55
    } while (oldPossibleNodesSize != possibleNodes.size());
56
    
57
    HashMap<PromotedHeapLocation, Availability> newHeap;
58
    for (auto pair : m_heap) {
59
        if (possibleNodes.contains(pair.key.base()))
60
            newHeap.add(pair.key, pair.value);
61
    }
62
    m_heap = newHeap;
63
}
64
65
void AvailabilityMap::clear()
66
{
67
    m_locals.fill(Availability());
68
    m_heap.clear();
69
}
70
71
void AvailabilityMap::dump(PrintStream& out) const
72
{
73
    out.print("{locals = ", m_locals, "; heap = ", mapDump(m_heap), "}");
74
}
75
76
bool AvailabilityMap::operator==(const AvailabilityMap& other) const
77
{
78
    return m_locals == other.m_locals
79
        && m_heap == other.m_heap;
80
}
81
82
void AvailabilityMap::merge(const AvailabilityMap& other)
83
{
84
    for (unsigned i = other.m_locals.size(); i--;)
85
        m_locals[i] = other.m_locals[i].merge(m_locals[i]);
86
    
87
    for (auto pair : other.m_heap) {
88
        auto result = m_heap.add(pair.key, Availability());
89
        result.iterator->value = pair.value.merge(result.iterator->value);
90
    }
91
}
92
93
} } // namespace JSC::DFG
94
95
#endif // ENABLE(DFG_JIT)
96
- Source/JavaScriptCore/dfg/DFGAvailabilityMap.h +64 lines
Line 0 Source/JavaScriptCore/dfg/DFGAvailabilityMap.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGAvailabilityMap_h
27
#define DFGAvailabilityMap_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGAvailability.h"
32
#include "DFGPromotedHeapLocation.h"
33
34
namespace JSC { namespace DFG {
35
36
struct AvailabilityMap {
37
    void prune();
38
    void clear();
39
    
40
    void dump(PrintStream& out) const;
41
    
42
    bool operator==(const AvailabilityMap& other) const;
43
    
44
    void merge(const AvailabilityMap& other);
45
    
46
    template<typename Functor>
47
    void forEachAvailability(const Functor& functor)
48
    {
49
        for (unsigned i = m_locals.size(); i--;)
50
            functor(m_locals[i]);
51
        for (auto pair : m_heap)
52
            functor(pair.value);
53
    }
54
    
55
    Operands<Availability> m_locals;
56
    HashMap<PromotedHeapLocation, Availability> m_heap;
57
};
58
59
} } // namespace JSC::DFG
60
61
#endif // ENABLE(DFG_JIT)
62
63
#endif // DFGAvailabilityMap_h
64
- Source/JavaScriptCore/dfg/DFGBasicBlock.cpp -2 / +2 lines
Lines 118-126 void BasicBlock::dump(PrintStream& out) Source/JavaScriptCore/dfg/DFGBasicBlock.cpp_sec1
118
}
118
}
119
119
120
BasicBlock::SSAData::SSAData(BasicBlock* block)
120
BasicBlock::SSAData::SSAData(BasicBlock* block)
121
    : availabilityAtHead(OperandsLike, block->variablesAtHead)
122
    , availabilityAtTail(OperandsLike, block->variablesAtHead)
123
{
121
{
122
    availabilityAtHead.m_locals = Operands<Availability>(OperandsLike, block->variablesAtHead);
123
    availabilityAtTail.m_locals = Operands<Availability>(OperandsLike, block->variablesAtHead);
124
}
124
}
125
125
126
BasicBlock::SSAData::~SSAData() { }
126
BasicBlock::SSAData::~SSAData() { }
- Source/JavaScriptCore/dfg/DFGBasicBlock.h -3 / +79 lines
Lines 30-35 Source/JavaScriptCore/dfg/DFGBasicBlock.h_sec1
30
30
31
#include "DFGAbstractValue.h"
31
#include "DFGAbstractValue.h"
32
#include "DFGAvailability.h"
32
#include "DFGAvailability.h"
33
#include "DFGAvailabilityMap.h"
33
#include "DFGBranchDirection.h"
34
#include "DFGBranchDirection.h"
34
#include "DFGFlushedAt.h"
35
#include "DFGFlushedAt.h"
35
#include "DFGNode.h"
36
#include "DFGNode.h"
Lines 46-51 class Graph; Source/JavaScriptCore/dfg/DFGBasicBlock.h_sec2
46
class InsertionSet;
47
class InsertionSet;
47
48
48
typedef Vector<BasicBlock*, 2> PredecessorList;
49
typedef Vector<BasicBlock*, 2> PredecessorList;
50
typedef Vector<Node*, 8> BlockNodeList;
49
51
50
struct BasicBlock : RefCounted<BasicBlock> {
52
struct BasicBlock : RefCounted<BasicBlock> {
51
    BasicBlock(
53
    BasicBlock(
Lines 85-90 struct BasicBlock : RefCounted<BasicBloc Source/JavaScriptCore/dfg/DFGBasicBlock.h_sec3
85
    bool isInPhis(Node* node) const;
87
    bool isInPhis(Node* node) const;
86
    bool isInBlock(Node* myNode) const;
88
    bool isInBlock(Node* myNode) const;
87
    
89
    
90
    BlockNodeList::iterator begin() { return m_nodes.begin(); }
91
    BlockNodeList::iterator end() { return m_nodes.end(); }
92
    
88
    unsigned numSuccessors() { return last()->numSuccessors(); }
93
    unsigned numSuccessors() { return last()->numSuccessors(); }
89
    
94
    
90
    BasicBlock*& successor(unsigned index)
95
    BasicBlock*& successor(unsigned index)
Lines 96-101 struct BasicBlock : RefCounted<BasicBloc Source/JavaScriptCore/dfg/DFGBasicBlock.h_sec4
96
        return last()->successorForCondition(condition);
101
        return last()->successorForCondition(condition);
97
    }
102
    }
98
    
103
    
104
    class SuccessorsIterable {
105
    public:
106
        SuccessorsIterable()
107
            : m_block(nullptr)
108
        {
109
        }
110
        
111
        SuccessorsIterable(BasicBlock* block)
112
            : m_block(block)
113
        {
114
        }
115
        
116
        class iterator {
117
        public:
118
            iterator()
119
                : m_block(nullptr)
120
                , m_index(UINT_MAX)
121
            {
122
            }
123
            
124
            iterator(BasicBlock* block, unsigned index)
125
                : m_block(block)
126
                , m_index(index)
127
            {
128
            }
129
            
130
            BasicBlock* operator*()
131
            {
132
                return m_block->successor(m_index);
133
            }
134
            
135
            iterator& operator++()
136
            {
137
                m_index++;
138
                return *this;
139
            }
140
            
141
            bool operator==(const iterator& other) const
142
            {
143
                return m_index == other.m_index;
144
            }
145
            
146
            bool operator!=(const iterator& other) const
147
            {
148
                return !(*this == other);
149
            }
150
        private:
151
            BasicBlock* m_block;
152
            unsigned m_index;
153
        };
154
        
155
        iterator begin()
156
        {
157
            return iterator(m_block, 0);
158
        }
159
        
160
        iterator end()
161
        {
162
            return iterator(m_block, m_block->numSuccessors());
163
        }
164
        
165
    private:
166
        BasicBlock* m_block;
167
    };
168
    
169
    SuccessorsIterable successors()
170
    {
171
        return SuccessorsIterable(this);
172
    }
173
    
99
    void removePredecessor(BasicBlock* block);
174
    void removePredecessor(BasicBlock* block);
100
    void replacePredecessor(BasicBlock* from, BasicBlock* to);
175
    void replacePredecessor(BasicBlock* from, BasicBlock* to);
101
176
Lines 169-176 struct BasicBlock : RefCounted<BasicBloc Source/JavaScriptCore/dfg/DFGBasicBlock.h_sec5
169
    unsigned innerMostLoopIndices[numberOfInnerMostLoopIndices];
244
    unsigned innerMostLoopIndices[numberOfInnerMostLoopIndices];
170
245
171
    struct SSAData {
246
    struct SSAData {
172
        Operands<Availability> availabilityAtHead;
247
        AvailabilityMap availabilityAtHead;
173
        Operands<Availability> availabilityAtTail;
248
        AvailabilityMap availabilityAtTail;
249
        
174
        HashSet<Node*> liveAtHead;
250
        HashSet<Node*> liveAtHead;
175
        HashSet<Node*> liveAtTail;
251
        HashSet<Node*> liveAtTail;
176
        HashMap<Node*, AbstractValue> valuesAtHead;
252
        HashMap<Node*, AbstractValue> valuesAtHead;
Lines 183-189 struct BasicBlock : RefCounted<BasicBloc Source/JavaScriptCore/dfg/DFGBasicBlock.h_sec6
183
    
259
    
184
private:
260
private:
185
    friend class InsertionSet;
261
    friend class InsertionSet;
186
    Vector<Node*, 8> m_nodes;
262
    BlockNodeList m_nodes;
187
};
263
};
188
264
189
typedef Vector<BasicBlock*, 5> BlockList;
265
typedef Vector<BasicBlock*, 5> BlockList;
- Source/JavaScriptCore/dfg/DFGClobberize.h -5 / +6 lines
Lines 109-114 void clobberize(Graph& graph, Node* node Source/JavaScriptCore/dfg/DFGClobberize.h_sec1
109
    case HardPhantom:
109
    case HardPhantom:
110
    case Check:
110
    case Check:
111
    case ExtractOSREntryLocal:
111
    case ExtractOSREntryLocal:
112
    case CheckStructureImmediate:
112
        return;
113
        return;
113
        
114
        
114
    case BitAnd:
115
    case BitAnd:
Lines 273-278 void clobberize(Graph& graph, Node* node Source/JavaScriptCore/dfg/DFGClobberize.h_sec2
273
    case ProfileDidCall:
274
    case ProfileDidCall:
274
    case StoreBarrier:
275
    case StoreBarrier:
275
    case StoreBarrierWithNullCheck:
276
    case StoreBarrierWithNullCheck:
277
    case PutByOffsetHint:
278
    case PutStructureHint:
276
        write(SideState);
279
        write(SideState);
277
        return;
280
        return;
278
        
281
        
Lines 787-803 void clobberize(Graph& graph, Node* node Source/JavaScriptCore/dfg/DFGClobberize.h_sec3
787
    case NewObject:
790
    case NewObject:
788
    case NewRegexp:
791
    case NewRegexp:
789
    case NewStringObject:
792
    case NewStringObject:
790
        read(HeapObjectCount);
793
    case PhantomNewObject:
791
        write(HeapObjectCount);
794
    case MaterializeNewObject:
792
        return;
793
        
794
    case NewFunctionNoCheck:
795
    case NewFunctionNoCheck:
795
    case NewFunction:
796
    case NewFunction:
796
    case NewFunctionExpression:
797
    case NewFunctionExpression:
797
        read(HeapObjectCount);
798
        read(HeapObjectCount);
798
        write(HeapObjectCount);
799
        write(HeapObjectCount);
799
        return;
800
        return;
800
801
        
801
    case RegExpExec:
802
    case RegExpExec:
802
    case RegExpTest:
803
    case RegExpTest:
803
        read(RegExpState);
804
        read(RegExpState);
- Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp +36 lines
Lines 124-129 private: Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp_sec1
124
                break;
124
                break;
125
            }
125
            }
126
                
126
                
127
            case CheckStructureImmediate: {
128
                AbstractValue& value = m_state.forNode(node->child1());
129
                StructureSet& set = node->structureSet();
130
                
131
                if (value.value()) {
132
                    if (Structure* structure = jsDynamicCast<Structure*>(value.value())) {
133
                        if (set.contains(structure)) {
134
                            m_interpreter.execute(indexInBlock);
135
                            node->convertToPhantom();
136
                            eliminated = true;
137
                            break;
138
                        }
139
                    }
140
                }
141
                
142
                if (PhiChildren* phiChildren = m_interpreter.phiChildren()) {
143
                    bool allGood = true;
144
                    phiChildren->forAllTransitiveIncomingValues(
145
                        node,
146
                        [&] (Node* incoming) {
147
                            if (Structure* structure = incoming->dynamicCastConstant<Structure*>()) {
148
                                if (set.contains(structure))
149
                                    return;
150
                            }
151
                            allGood = false;
152
                        });
153
                    if (allGood) {
154
                        m_interpreter.execute(indexInBlock);
155
                        node->convertToPhantom();
156
                        eliminated = true;
157
                        break;
158
                    }
159
                }
160
                break;
161
            }
162
                
127
            case CheckArray:
163
            case CheckArray:
128
            case Arrayify: {
164
            case Arrayify: {
129
                if (!node->arrayMode().alreadyChecked(m_graph, node, m_state.forNode(node->child1())))
165
                if (!node->arrayMode().alreadyChecked(m_graph, node, m_state.forNode(node->child1())))
- Source/JavaScriptCore/dfg/DFGDoesGC.cpp +5 lines
Lines 199-204 bool doesGC(Graph& graph, Node* node) Source/JavaScriptCore/dfg/DFGDoesGC.cpp_sec1
199
    case BooleanToNumber:
199
    case BooleanToNumber:
200
    case CheckBadCell:
200
    case CheckBadCell:
201
    case BottomValue:
201
    case BottomValue:
202
    case PhantomNewObject:
203
    case PutByOffsetHint:
204
    case CheckStructureImmediate:
205
    case PutStructureHint:
202
        return false;
206
        return false;
203
207
204
    case CreateActivation:
208
    case CreateActivation:
Lines 225-230 bool doesGC(Graph& graph, Node* node) Source/JavaScriptCore/dfg/DFGDoesGC.cpp_sec2
225
    case GetGenericPropertyEnumerator:
229
    case GetGenericPropertyEnumerator:
226
    case GetEnumeratorPname:
230
    case GetEnumeratorPname:
227
    case ToIndexString:
231
    case ToIndexString:
232
    case MaterializeNewObject:
228
        return true;
233
        return true;
229
        
234
        
230
    case MultiPutByOffset:
235
    case MultiPutByOffset:
- Source/JavaScriptCore/dfg/DFGFixupPhase.cpp +5 lines
Lines 1013-1018 private: Source/JavaScriptCore/dfg/DFGFixupPhase.cpp_sec1
1013
        case Int52Constant:
1013
        case Int52Constant:
1014
        case Identity: // This should have been cleaned up.
1014
        case Identity: // This should have been cleaned up.
1015
        case BooleanToNumber:
1015
        case BooleanToNumber:
1016
        case PhantomNewObject:
1017
        case PutByOffsetHint:
1018
        case CheckStructureImmediate:
1019
        case PutStructureHint:
1020
        case MaterializeNewObject:
1016
            // These are just nodes that we don't currently expect to see during fixup.
1021
            // These are just nodes that we don't currently expect to see during fixup.
1017
            // If we ever wanted to insert them prior to fixup, then we just have to create
1022
            // If we ever wanted to insert them prior to fixup, then we just have to create
1018
            // fixup rules for them.
1023
            // fixup rules for them.
- Source/JavaScriptCore/dfg/DFGFlushedAt.cpp -1 / +3 lines
Lines 36-43 void FlushedAt::dump(PrintStream& out) c Source/JavaScriptCore/dfg/DFGFlushedAt.cpp_sec1
36
{
36
{
37
    if (m_format == DeadFlush || m_format == ConflictingFlush)
37
    if (m_format == DeadFlush || m_format == ConflictingFlush)
38
        out.print(m_format);
38
        out.print(m_format);
39
    else
39
    else if (m_virtualRegister.isValid())
40
        out.print("r", m_virtualRegister, ":", m_format);
40
        out.print("r", m_virtualRegister, ":", m_format);
41
    else
42
        out.print(m_format);
41
}
43
}
42
44
43
void FlushedAt::dumpInContext(PrintStream& out, DumpContext*) const
45
void FlushedAt::dumpInContext(PrintStream& out, DumpContext*) const
- Source/JavaScriptCore/dfg/DFGFlushedAt.h -2 lines
Lines 52-59 public: Source/JavaScriptCore/dfg/DFGFlushedAt.h_sec1
52
    {
52
    {
53
        if (format == DeadFlush)
53
        if (format == DeadFlush)
54
            ASSERT(!virtualRegister.isValid());
54
            ASSERT(!virtualRegister.isValid());
55
        else
56
            ASSERT(virtualRegister.isValid());
57
    }
55
    }
58
    
56
    
59
    bool operator!() const { return m_format == DeadFlush; }
57
    bool operator!() const { return m_format == DeadFlush; }
- Source/JavaScriptCore/dfg/DFGGraph.cpp +33 lines
Lines 323-328 void Graph::dump(PrintStream& out, const Source/JavaScriptCore/dfg/DFGGraph.cpp_sec1
323
        out.print(comma, inContext(JSValue(node->typedArray()), context));
323
        out.print(comma, inContext(JSValue(node->typedArray()), context));
324
    if (node->hasStoragePointer())
324
    if (node->hasStoragePointer())
325
        out.print(comma, RawPointer(node->storagePointer()));
325
        out.print(comma, RawPointer(node->storagePointer()));
326
    if (node->hasObjectMaterializationData())
327
        out.print(comma, node->objectMaterializationData());
326
    if (node->isConstant())
328
    if (node->isConstant())
327
        out.print(comma, pointerDumpInContext(node->constant(), context));
329
        out.print(comma, pointerDumpInContext(node->constant(), context));
328
    if (node->isJump())
330
    if (node->isJump())
Lines 368-379 void Graph::dumpBlockHeader(PrintStream& Source/JavaScriptCore/dfg/DFGGraph.cpp_sec2
368
    for (size_t i = 0; i < block->predecessors.size(); ++i)
370
    for (size_t i = 0; i < block->predecessors.size(); ++i)
369
        out.print(" ", *block->predecessors[i]);
371
        out.print(" ", *block->predecessors[i]);
370
    out.print("\n");
372
    out.print("\n");
373
    out.print(prefix, "  Successors:");
374
    for (BasicBlock* successor : block->successors()) {
375
        out.print(" ", *successor);
376
        if (m_prePostNumbering.isValid())
377
            out.print(" (", m_prePostNumbering.edgeKind(block, successor), ")");
378
    }
379
    out.print("\n");
371
    if (m_dominators.isValid()) {
380
    if (m_dominators.isValid()) {
372
        out.print(prefix, "  Dominated by: ", m_dominators.dominatorsOf(block), "\n");
381
        out.print(prefix, "  Dominated by: ", m_dominators.dominatorsOf(block), "\n");
373
        out.print(prefix, "  Dominates: ", m_dominators.blocksDominatedBy(block), "\n");
382
        out.print(prefix, "  Dominates: ", m_dominators.blocksDominatedBy(block), "\n");
374
        out.print(prefix, "  Dominance Frontier: ", m_dominators.dominanceFrontierOf(block), "\n");
383
        out.print(prefix, "  Dominance Frontier: ", m_dominators.dominanceFrontierOf(block), "\n");
375
        out.print(prefix, "  Iterated Dominance Frontier: ", m_dominators.iteratedDominanceFrontierOf(BlockList(1, block)), "\n");
384
        out.print(prefix, "  Iterated Dominance Frontier: ", m_dominators.iteratedDominanceFrontierOf(BlockList(1, block)), "\n");
376
    }
385
    }
386
    if (m_prePostNumbering.isValid())
387
        out.print(prefix, "  Pre/Post Numbering: ", m_prePostNumbering.preNumber(block), "/", m_prePostNumbering.postNumber(block), "\n");
377
    if (m_naturalLoops.isValid()) {
388
    if (m_naturalLoops.isValid()) {
378
        if (const NaturalLoop* loop = m_naturalLoops.headerOf(block)) {
389
        if (const NaturalLoop* loop = m_naturalLoops.headerOf(block)) {
379
            out.print(prefix, "  Loop header, contains:");
390
            out.print(prefix, "  Loop header, contains:");
Lines 562-567 void Graph::resetReachability() Source/JavaScriptCore/dfg/DFGGraph.cpp_sec3
562
    determineReachability();
573
    determineReachability();
563
}
574
}
564
575
576
void Graph::mergeRelevantToOSR()
577
{
578
    for (BasicBlock* block : blocksInNaturalOrder()) {
579
        for (Node* node : *block) {
580
            switch (node->op()) {
581
            case MovHint:
582
                node->child1()->mergeFlags(NodeRelevantToOSR);
583
                break;
584
                
585
            case PutStructureHint:
586
            case PutByOffsetHint:
587
                node->child2()->mergeFlags(NodeRelevantToOSR);
588
                break;
589
                
590
            default:
591
                break;
592
            }
593
        }
594
    }
595
}
596
565
namespace {
597
namespace {
566
598
567
class RefCountCalculator {
599
class RefCountCalculator {
Lines 707-712 void Graph::invalidateCFG() Source/JavaScriptCore/dfg/DFGGraph.cpp_sec4
707
{
739
{
708
    m_dominators.invalidate();
740
    m_dominators.invalidate();
709
    m_naturalLoops.invalidate();
741
    m_naturalLoops.invalidate();
742
    m_prePostNumbering.invalidate();
710
}
743
}
711
744
712
void Graph::substituteGetLocal(BasicBlock& block, unsigned startIndexInBlock, VariableAccessData* variableAccessData, Node* newGetLocal)
745
void Graph::substituteGetLocal(BasicBlock& block, unsigned startIndexInBlock, VariableAccessData* variableAccessData, Node* newGetLocal)
- Source/JavaScriptCore/dfg/DFGGraph.h -41 / +140 lines
Lines 39-44 Source/JavaScriptCore/dfg/DFGGraph.h_sec1
39
#include "DFGNode.h"
39
#include "DFGNode.h"
40
#include "DFGNodeAllocator.h"
40
#include "DFGNodeAllocator.h"
41
#include "DFGPlan.h"
41
#include "DFGPlan.h"
42
#include "DFGPrePostNumbering.h"
42
#include "DFGScannable.h"
43
#include "DFGScannable.h"
43
#include "JSStack.h"
44
#include "JSStack.h"
44
#include "MethodOfGettingAValueProfile.h"
45
#include "MethodOfGettingAValueProfile.h"
Lines 55-60 class ExecState; Source/JavaScriptCore/dfg/DFGGraph.h_sec2
55
56
56
namespace DFG {
57
namespace DFG {
57
58
59
#define DFG_NODE_DO_TO_CHILDREN(graph, node, thingToDo) do {            \
60
        Node* _node = (node);                                           \
61
        if (_node->flags() & NodeHasVarArgs) {                          \
62
            for (unsigned _childIdx = _node->firstChild();              \
63
                _childIdx < _node->firstChild() + _node->numChildren(); \
64
                _childIdx++) {                                          \
65
                if (!!(graph).m_varArgChildren[_childIdx])              \
66
                    thingToDo(_node, (graph).m_varArgChildren[_childIdx]); \
67
            }                                                           \
68
        } else {                                                        \
69
            if (!_node->child1()) {                                     \
70
                ASSERT(                                                 \
71
                    !_node->child2()                                    \
72
                    && !_node->child3());                               \
73
                break;                                                  \
74
            }                                                           \
75
            thingToDo(_node, _node->child1());                          \
76
                                                                        \
77
            if (!_node->child2()) {                                     \
78
                ASSERT(!_node->child3());                               \
79
                break;                                                  \
80
            }                                                           \
81
            thingToDo(_node, _node->child2());                          \
82
                                                                        \
83
            if (!_node->child3())                                       \
84
                break;                                                  \
85
            thingToDo(_node, _node->child3());                          \
86
        }                                                               \
87
    } while (false)
88
89
#define DFG_ASSERT(graph, node, assertion) do {                         \
90
        if (!!(assertion))                                              \
91
            break;                                                      \
92
        (graph).handleAssertionFailure(                                 \
93
            (node), __FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion); \
94
    } while (false)
95
96
#define DFG_CRASH(graph, node, reason)                                  \
97
    (graph).handleAssertionFailure(                                     \
98
        (node), __FILE__, __LINE__, WTF_PRETTY_FUNCTION, (reason));
99
58
struct InlineVariableData {
100
struct InlineVariableData {
59
    InlineCallFrame* inlineCallFrame;
101
    InlineCallFrame* inlineCallFrame;
60
    unsigned argumentPositionStart;
102
    unsigned argumentPositionStart;
Lines 565-570 public: Source/JavaScriptCore/dfg/DFGGraph.h_sec3
565
    void determineReachability();
607
    void determineReachability();
566
    void resetReachability();
608
    void resetReachability();
567
    
609
    
610
    void mergeRelevantToOSR();
611
    
568
    void computeRefCounts();
612
    void computeRefCounts();
569
    
613
    
570
    unsigned varArgNumChildren(Node* node)
614
    unsigned varArgNumChildren(Node* node)
Lines 676-681 public: Source/JavaScriptCore/dfg/DFGGraph.h_sec4
676
    BlockList blocksInPreOrder();
720
    BlockList blocksInPreOrder();
677
    BlockList blocksInPostOrder();
721
    BlockList blocksInPostOrder();
678
    
722
    
723
    class NaturalBlockIterable {
724
    public:
725
        NaturalBlockIterable()
726
            : m_graph(nullptr)
727
        {
728
        }
729
        
730
        NaturalBlockIterable(Graph& graph)
731
            : m_graph(&graph)
732
        {
733
        }
734
        
735
        class iterator {
736
        public:
737
            iterator()
738
                : m_graph(nullptr)
739
                , m_index(0)
740
            {
741
            }
742
            
743
            iterator(Graph& graph, BlockIndex index)
744
                : m_graph(&graph)
745
                , m_index(findNext(index))
746
            {
747
            }
748
            
749
            BasicBlock *operator*()
750
            {
751
                return m_graph->block(m_index);
752
            }
753
            
754
            iterator& operator++()
755
            {
756
                m_index = findNext(m_index + 1);
757
                return *this;
758
            }
759
            
760
            bool operator==(const iterator& other) const
761
            {
762
                return m_index == other.m_index;
763
            }
764
            
765
            bool operator!=(const iterator& other) const
766
            {
767
                return !(*this == other);
768
            }
769
            
770
        private:
771
            BlockIndex findNext(BlockIndex index)
772
            {
773
                while (index < m_graph->numBlocks() && !m_graph->block(index))
774
                    index++;
775
                return index;
776
            }
777
            
778
            Graph* m_graph;
779
            BlockIndex m_index;
780
        };
781
        
782
        iterator begin()
783
        {
784
            return iterator(*m_graph, 0);
785
        }
786
        
787
        iterator end()
788
        {
789
            return iterator(*m_graph, m_graph->numBlocks());
790
        }
791
        
792
    private:
793
        Graph* m_graph;
794
    };
795
    
796
    NaturalBlockIterable blocksInNaturalOrder()
797
    {
798
        return NaturalBlockIterable(*this);
799
    }
800
    
801
    template<typename ChildFunctor>
802
    void doToChildrenWithNode(Node* node, const ChildFunctor& functor)
803
    {
804
        DFG_NODE_DO_TO_CHILDREN(*this, node, functor);
805
    }
806
    
807
    template<typename ChildFunctor>
808
    void doToChildren(Node* node, const ChildFunctor& functor)
809
    {
810
        doToChildrenWithNode(
811
            node,
812
            [&functor] (Node*, Edge& edge) {
813
                functor(edge);
814
            });
815
    }
816
    
679
    Profiler::Compilation* compilation() { return m_plan.compilation.get(); }
817
    Profiler::Compilation* compilation() { return m_plan.compilation.get(); }
680
    
818
    
681
    DesiredIdentifiers& identifiers() { return m_plan.identifiers; }
819
    DesiredIdentifiers& identifiers() { return m_plan.identifiers; }
Lines 736-747 public: Source/JavaScriptCore/dfg/DFGGraph.h_sec5
736
    Bag<SwitchData> m_switchData;
874
    Bag<SwitchData> m_switchData;
737
    Bag<MultiGetByOffsetData> m_multiGetByOffsetData;
875
    Bag<MultiGetByOffsetData> m_multiGetByOffsetData;
738
    Bag<MultiPutByOffsetData> m_multiPutByOffsetData;
876
    Bag<MultiPutByOffsetData> m_multiPutByOffsetData;
877
    Bag<ObjectMaterializationData> m_objectMaterializationData;
739
    Vector<InlineVariableData, 4> m_inlineVariableData;
878
    Vector<InlineVariableData, 4> m_inlineVariableData;
740
    HashMap<CodeBlock*, std::unique_ptr<FullBytecodeLiveness>> m_bytecodeLiveness;
879
    HashMap<CodeBlock*, std::unique_ptr<FullBytecodeLiveness>> m_bytecodeLiveness;
741
    bool m_hasArguments;
880
    bool m_hasArguments;
742
    HashSet<ExecutableBase*> m_executablesWhoseArgumentsEscaped;
881
    HashSet<ExecutableBase*> m_executablesWhoseArgumentsEscaped;
743
    BitVector m_lazyVars;
882
    BitVector m_lazyVars;
744
    Dominators m_dominators;
883
    Dominators m_dominators;
884
    PrePostNumbering m_prePostNumbering;
745
    NaturalLoops m_naturalLoops;
885
    NaturalLoops m_naturalLoops;
746
    unsigned m_localVars;
886
    unsigned m_localVars;
747
    unsigned m_nextMachineLocal;
887
    unsigned m_nextMachineLocal;
Lines 786-832 private: Source/JavaScriptCore/dfg/DFGGraph.h_sec6
786
    }
926
    }
787
};
927
};
788
928
789
#define DFG_NODE_DO_TO_CHILDREN(graph, node, thingToDo) do {            \
790
        Node* _node = (node);                                           \
791
        if (_node->flags() & NodeHasVarArgs) {                          \
792
            for (unsigned _childIdx = _node->firstChild();              \
793
                _childIdx < _node->firstChild() + _node->numChildren(); \
794
                _childIdx++) {                                          \
795
                if (!!(graph).m_varArgChildren[_childIdx])              \
796
                    thingToDo(_node, (graph).m_varArgChildren[_childIdx]); \
797
            }                                                           \
798
        } else {                                                        \
799
            if (!_node->child1()) {                                     \
800
                ASSERT(                                                 \
801
                    !_node->child2()                                    \
802
                    && !_node->child3());                               \
803
                break;                                                  \
804
            }                                                           \
805
            thingToDo(_node, _node->child1());                          \
806
                                                                        \
807
            if (!_node->child2()) {                                     \
808
                ASSERT(!_node->child3());                               \
809
                break;                                                  \
810
            }                                                           \
811
            thingToDo(_node, _node->child2());                          \
812
                                                                        \
813
            if (!_node->child3())                                       \
814
                break;                                                  \
815
            thingToDo(_node, _node->child3());                          \
816
        }                                                               \
817
    } while (false)
818
819
#define DFG_ASSERT(graph, node, assertion) do {                         \
820
        if (!!(assertion))                                              \
821
            break;                                                      \
822
        (graph).handleAssertionFailure(                                 \
823
            (node), __FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion); \
824
    } while (false)
825
826
#define DFG_CRASH(graph, node, reason)                                  \
827
    (graph).handleAssertionFailure(                                     \
828
        (node), __FILE__, __LINE__, WTF_PRETTY_FUNCTION, (reason));
829
830
} } // namespace JSC::DFG
929
} } // namespace JSC::DFG
831
930
832
#endif
931
#endif
- Source/JavaScriptCore/dfg/DFGHeapLocation.cpp +4 lines
Lines 147-152 void printInternal(PrintStream& out, Loc Source/JavaScriptCore/dfg/DFGHeapLocation.cpp_sec1
147
    case AllocationProfileWatchpointLoc:
147
    case AllocationProfileWatchpointLoc:
148
        out.print("AllocationProfileWatchpointLoc");
148
        out.print("AllocationProfileWatchpointLoc");
149
        return;
149
        return;
150
        
151
    case StructureLoc:
152
        out.print("StructureLoc");
153
        return;
150
    }
154
    }
151
    
155
    
152
    RELEASE_ASSERT_NOT_REACHED();
156
    RELEASE_ASSERT_NOT_REACHED();
- Source/JavaScriptCore/dfg/DFGHeapLocation.h +1 lines
Lines 55-60 enum LocationKind { Source/JavaScriptCore/dfg/DFGHeapLocation.h_sec1
55
    MyArgumentsLengthLoc,
55
    MyArgumentsLengthLoc,
56
    NamedPropertyLoc,
56
    NamedPropertyLoc,
57
    SetterLoc,
57
    SetterLoc,
58
    StructureLoc,
58
    TypeOfLoc,
59
    TypeOfLoc,
59
    TypedArrayByteOffsetLoc,
60
    TypedArrayByteOffsetLoc,
60
    VarInjectionWatchpointLoc,
61
    VarInjectionWatchpointLoc,
- Source/JavaScriptCore/dfg/DFGInsertOSRHintsForUpdate.cpp +60 lines
Line 0 Source/JavaScriptCore/dfg/DFGInsertOSRHintsForUpdate.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DFGInsertOSRHintsForUpdate.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "JSCInlines.h"
32
33
namespace JSC { namespace DFG {
34
35
void insertOSRHintsForUpdate(
36
    InsertionSet& insertionSet, unsigned nodeIndex, NodeOrigin origin,
37
    AvailabilityMap& availability, Node* originalNode, Node* newNode)
38
{
39
    for (unsigned i = availability.m_locals.size(); i--;) {
40
        int operand = availability.m_locals.operandForIndex(i);
41
        
42
        if (availability.m_locals[i].hasNode() && availability.m_locals[i].node() == originalNode) {
43
            insertionSet.insertNode(
44
                nodeIndex, SpecNone, MovHint, origin, OpInfo(operand),
45
                newNode->defaultEdge());
46
        }
47
    }
48
    
49
    for (auto pair : availability.m_heap) {
50
        if (pair.value.hasNode() && pair.value.node() == originalNode) {
51
            insertionSet.insert(
52
                nodeIndex, pair.key.createHint(insertionSet.graph(), origin, newNode));
53
        }
54
    }
55
}
56
57
} } // namespace JSC::DFG
58
59
#endif // ENABLE(DFG_JIT)
60
- Source/JavaScriptCore/dfg/DFGInsertOSRHintsForUpdate.h +45 lines
Line 0 Source/JavaScriptCore/dfg/DFGInsertOSRHintsForUpdate.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGInsertOSRHintsForUpdate_h
27
#define DFGInsertOSRHintsForUpdate_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGAvailabilityMap.h"
32
#include "DFGInsertionSet.h"
33
34
namespace JSC { namespace DFG {
35
36
void insertOSRHintsForUpdate(
37
    InsertionSet&, unsigned nodeIndex, NodeOrigin, AvailabilityMap&,
38
    Node* originalNode, Node* newNode);
39
40
} } // namespace JSC::DFG
41
42
#endif // ENABLE(DFG_JIT)
43
44
#endif // DFGInsertOSRHintsForUpdate_h
45
- Source/JavaScriptCore/dfg/DFGInsertionSet.h +2 lines
Lines 43-48 public: Source/JavaScriptCore/dfg/DFGInsertionSet.h_sec1
43
    {
43
    {
44
    }
44
    }
45
    
45
    
46
    Graph& graph() { return m_graph; }
47
    
46
    Node* insert(const Insertion& insertion)
48
    Node* insert(const Insertion& insertion)
47
    {
49
    {
48
        ASSERT(!m_insertions.size() || m_insertions.last().index() <= insertion.index());
50
        ASSERT(!m_insertions.size() || m_insertions.last().index() <= insertion.index());
- Source/JavaScriptCore/dfg/DFGMayExit.cpp +4 lines
Lines 75-80 bool mayExit(Graph& graph, Node* node) Source/JavaScriptCore/dfg/DFGMayExit.cpp_sec1
75
    case Phi:
75
    case Phi:
76
    case Upsilon:
76
    case Upsilon:
77
    case ZombieHint:
77
    case ZombieHint:
78
    case BottomValue:
79
    case PutStructureHint:
80
    case PutByOffsetHint:
81
    case PhantomNewObject:
78
        break;
82
        break;
79
        
83
        
80
    default:
84
    default:
- Source/JavaScriptCore/dfg/DFGNode.h -2 / +68 lines
Lines 38-43 Source/JavaScriptCore/dfg/DFGNode.h_sec1
38
#include "DFGNodeFlags.h"
38
#include "DFGNodeFlags.h"
39
#include "DFGNodeOrigin.h"
39
#include "DFGNodeOrigin.h"
40
#include "DFGNodeType.h"
40
#include "DFGNodeType.h"
41
#include "DFGObjectMaterializationData.h"
41
#include "DFGTransition.h"
42
#include "DFGTransition.h"
42
#include "DFGUseKind.h"
43
#include "DFGUseKind.h"
43
#include "DFGVariableAccessData.h"
44
#include "DFGVariableAccessData.h"
Lines 500-505 struct Node { Source/JavaScriptCore/dfg/DFGNode.h_sec2
500
        m_flags &= ~NodeClobbersWorld;
501
        m_flags &= ~NodeClobbersWorld;
501
    }
502
    }
502
    
503
    
504
    void convertToPutByOffsetHint()
505
    {
506
        ASSERT(m_op == PutByOffset);
507
        m_opInfo = storageAccessData().identifierNumber;
508
        m_op = PutByOffsetHint;
509
        child1() = child2();
510
        child2() = child3();
511
        child3() = Edge();
512
    }
513
    
514
    void convertToPutStructureHint(Node* structure)
515
    {
516
        ASSERT(m_op == PutStructure);
517
        ASSERT(structure->castConstant<Structure*>() == transition()->next);
518
        m_op = PutStructureHint;
519
        m_opInfo = 0;
520
        child2() = Edge(structure, KnownCellUse);
521
    }
522
    
523
    void convertToPhantomNewObject()
524
    {
525
        ASSERT(m_op == NewObject || m_op == MaterializeNewObject);
526
        m_op = PhantomNewObject;
527
        m_flags &= ~NodeHasVarArgs;
528
        m_opInfo = 0;
529
        m_opInfo2 = 0;
530
        children = AdjacencyList();
531
    }
532
    
503
    void convertToPhantomLocal()
533
    void convertToPhantomLocal()
504
    {
534
    {
505
        ASSERT(m_op == Phantom && (child1()->op() == Phi || child1()->op() == SetLocal || child1()->op() == SetArgument));
535
        ASSERT(m_op == Phantom && (child1()->op() == Phi || child1()->op() == SetLocal || child1()->op() == SetArgument));
Lines 580-586 struct Node { Source/JavaScriptCore/dfg/DFGNode.h_sec3
580
     
610
     
581
    bool isCellConstant()
611
    bool isCellConstant()
582
    {
612
    {
583
        return isConstant() && constant()->value().isCell();
613
        return isConstant() && constant()->value() && constant()->value().isCell();
584
    }
614
    }
585
     
615
     
586
    JSCell* asCell()
616
    JSCell* asCell()
Lines 595-600 struct Node { Source/JavaScriptCore/dfg/DFGNode.h_sec4
595
            return nullptr;
625
            return nullptr;
596
        return jsDynamicCast<T>(asCell());
626
        return jsDynamicCast<T>(asCell());
597
    }
627
    }
628
    
629
    template<typename T>
630
    T castConstant()
631
    {
632
        T result = dynamicCastConstant<T>();
633
        RELEASE_ASSERT(result);
634
        return result;
635
    }
598
     
636
     
599
    bool containsMovHint()
637
    bool containsMovHint()
600
    {
638
    {
Lines 704-709 struct Node { Source/JavaScriptCore/dfg/DFGNode.h_sec5
704
        case PutById:
742
        case PutById:
705
        case PutByIdFlush:
743
        case PutByIdFlush:
706
        case PutByIdDirect:
744
        case PutByIdDirect:
745
        case PutByOffsetHint:
707
            return true;
746
            return true;
708
        default:
747
        default:
709
            return false;
748
            return false;
Lines 1155-1161 struct Node { Source/JavaScriptCore/dfg/DFGNode.h_sec6
1155
    
1194
    
1156
    bool hasStorageAccessData()
1195
    bool hasStorageAccessData()
1157
    {
1196
    {
1158
        return op() == GetByOffset || op() == GetGetterSetterByOffset || op() == PutByOffset;
1197
        switch (op()) {
1198
        case GetByOffset:
1199
        case PutByOffset:
1200
        case GetGetterSetterByOffset:
1201
            return true;
1202
        default:
1203
            return false;
1204
        }
1159
    }
1205
    }
1160
    
1206
    
1161
    StorageAccessData& storageAccessData()
1207
    StorageAccessData& storageAccessData()
Lines 1184-1189 struct Node { Source/JavaScriptCore/dfg/DFGNode.h_sec7
1184
        return *reinterpret_cast<MultiPutByOffsetData*>(m_opInfo);
1230
        return *reinterpret_cast<MultiPutByOffsetData*>(m_opInfo);
1185
    }
1231
    }
1186
    
1232
    
1233
    bool hasObjectMaterializationData()
1234
    {
1235
        return op() == MaterializeNewObject;
1236
    }
1237
    
1238
    ObjectMaterializationData& objectMaterializationData()
1239
    {
1240
        return *reinterpret_cast<ObjectMaterializationData*>(m_opInfo);
1241
    }
1242
    
1243
    bool isPhantomObjectAllocation()
1244
    {
1245
        switch (op()) {
1246
        case PhantomNewObject:
1247
            return true;
1248
        default:
1249
            return false;
1250
        }
1251
    }
1252
    
1187
    bool hasFunctionDeclIndex()
1253
    bool hasFunctionDeclIndex()
1188
    {
1254
    {
1189
        return op() == NewFunction
1255
        return op() == NewFunction
- Source/JavaScriptCore/dfg/DFGNodeType.h +7 lines
Lines 228-233 namespace JSC { namespace DFG { Source/JavaScriptCore/dfg/DFGNodeType.h_sec1
228
    macro(NewTypedArray, NodeResultJS | NodeClobbersWorld | NodeMustGenerate) \
228
    macro(NewTypedArray, NodeResultJS | NodeClobbersWorld | NodeMustGenerate) \
229
    macro(NewRegexp, NodeResultJS) \
229
    macro(NewRegexp, NodeResultJS) \
230
    \
230
    \
231
    /* Support for allocation sinking. */\
232
    macro(PhantomNewObject, NodeResultJS) \
233
    macro(PutByOffsetHint, NodeMustGenerate) \
234
    macro(CheckStructureImmediate, NodeMustGenerate) \
235
    macro(PutStructureHint, NodeMustGenerate) \
236
    macro(MaterializeNewObject, NodeResultJS | NodeHasVarArgs) \
237
    \
231
    /* Nodes for misc operations. */\
238
    /* Nodes for misc operations. */\
232
    macro(Breakpoint, NodeMustGenerate) \
239
    macro(Breakpoint, NodeMustGenerate) \
233
    macro(ProfileWillCall, NodeMustGenerate) \
240
    macro(ProfileWillCall, NodeMustGenerate) \
- Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp -22 / +26 lines
Lines 32-37 Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp_sec1
32
#include "DFGGraph.h"
32
#include "DFGGraph.h"
33
#include "DFGInsertionSet.h"
33
#include "DFGInsertionSet.h"
34
#include "DFGPhase.h"
34
#include "DFGPhase.h"
35
#include "DFGPromoteHeapAccess.h"
35
#include "JSCInlines.h"
36
#include "JSCInlines.h"
36
37
37
namespace JSC { namespace DFG {
38
namespace JSC { namespace DFG {
Lines 51-75 public: Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp_sec2
51
            BasicBlock* block = m_graph.block(blockIndex);
52
            BasicBlock* block = m_graph.block(blockIndex);
52
            if (!block)
53
            if (!block)
53
                continue;
54
                continue;
54
            block->ssa->availabilityAtHead.fill(Availability());
55
            block->ssa->availabilityAtHead.clear();
55
            block->ssa->availabilityAtTail.fill(Availability());
56
            block->ssa->availabilityAtTail.clear();
56
        }
57
        }
57
        
58
        
58
        BasicBlock* root = m_graph.block(0);
59
        BasicBlock* root = m_graph.block(0);
59
        for (unsigned argument = root->ssa->availabilityAtHead.numberOfArguments(); argument--;) {
60
        root->ssa->availabilityAtHead.m_locals.fill(Availability::unavailable());
60
            root->ssa->availabilityAtHead.argument(argument) =
61
        for (unsigned argument = root->ssa->availabilityAtHead.m_locals.numberOfArguments(); argument--;) {
62
            root->ssa->availabilityAtHead.m_locals.argument(argument) =
61
                Availability::unavailable().withFlush(
63
                Availability::unavailable().withFlush(
62
                    FlushedAt(FlushedJSValue, virtualRegisterForArgument(argument)));
64
                    FlushedAt(FlushedJSValue, virtualRegisterForArgument(argument)));
63
        }
65
        }
64
66
65
        if (m_graph.m_plan.mode == FTLForOSREntryMode) {
66
            for (unsigned local = m_graph.m_profiledBlock->m_numCalleeRegisters; local--;)
67
                root->ssa->availabilityAtHead.local(local) = Availability::unavailable();
68
        } else {
69
            for (unsigned local = root->ssa->availabilityAtHead.numberOfLocals(); local--;)
70
                root->ssa->availabilityAtHead.local(local) = Availability::unavailable();
71
        }
72
        
73
        // This could be made more efficient by processing blocks in reverse postorder.
67
        // This could be made more efficient by processing blocks in reverse postorder.
74
        
68
        
75
        LocalOSRAvailabilityCalculator calculator;
69
        LocalOSRAvailabilityCalculator calculator;
Lines 87-92 public: Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp_sec3
87
                for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex)
81
                for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex)
88
                    calculator.executeNode(block->at(nodeIndex));
82
                    calculator.executeNode(block->at(nodeIndex));
89
                
83
                
84
                calculator.m_availability.prune();
85
                
90
                if (calculator.m_availability == block->ssa->availabilityAtTail)
86
                if (calculator.m_availability == block->ssa->availabilityAtTail)
91
                    continue;
87
                    continue;
92
                
88
                
Lines 95-105 public: Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp_sec4
95
                
91
                
96
                for (unsigned successorIndex = block->numSuccessors(); successorIndex--;) {
92
                for (unsigned successorIndex = block->numSuccessors(); successorIndex--;) {
97
                    BasicBlock* successor = block->successor(successorIndex);
93
                    BasicBlock* successor = block->successor(successorIndex);
98
                    for (unsigned i = calculator.m_availability.size(); i--;) {
94
                    successor->ssa->availabilityAtHead.merge(calculator.m_availability);
99
                        successor->ssa->availabilityAtHead[i] =
100
                            calculator.m_availability[i].merge(
101
                                successor->ssa->availabilityAtHead[i]);
102
                    }
103
                }
95
                }
104
            }
96
            }
105
        } while (changed);
97
        } while (changed);
Lines 127-164 void LocalOSRAvailabilityCalculator::beg Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp_sec5
127
    m_availability = block->ssa->availabilityAtHead;
119
    m_availability = block->ssa->availabilityAtHead;
128
}
120
}
129
121
122
void LocalOSRAvailabilityCalculator::endBlock(BasicBlock* block)
123
{
124
    m_availability = block->ssa->availabilityAtTail;
125
}
126
130
void LocalOSRAvailabilityCalculator::executeNode(Node* node)
127
void LocalOSRAvailabilityCalculator::executeNode(Node* node)
131
{
128
{
132
    switch (node->op()) {
129
    switch (node->op()) {
133
    case SetLocal: {
130
    case SetLocal: {
134
        VariableAccessData* variable = node->variableAccessData();
131
        VariableAccessData* variable = node->variableAccessData();
135
        m_availability.operand(variable->local()) =
132
        m_availability.m_locals.operand(variable->local()) =
136
            Availability(node->child1().node(), variable->flushedAt());
133
            Availability(node->child1().node(), variable->flushedAt());
137
        break;
134
        break;
138
    }
135
    }
139
136
140
    case GetArgument: {
137
    case GetArgument: {
141
        VariableAccessData* variable = node->variableAccessData();
138
        VariableAccessData* variable = node->variableAccessData();
142
        m_availability.operand(variable->local()) =
139
        m_availability.m_locals.operand(variable->local()) =
143
            Availability(node, variable->flushedAt());
140
            Availability(node, variable->flushedAt());
144
        break;
141
        break;
145
    }
142
    }
146
143
147
    case MovHint: {
144
    case MovHint: {
148
        m_availability.operand(node->unlinkedLocal()) =
145
        m_availability.m_locals.operand(node->unlinkedLocal()) =
149
            Availability(node->child1().node());
146
            Availability(node->child1().node());
150
        break;
147
        break;
151
    }
148
    }
152
149
153
    case ZombieHint: {
150
    case ZombieHint: {
154
        m_availability.operand(node->unlinkedLocal()) =
151
        m_availability.m_locals.operand(node->unlinkedLocal()) =
155
            Availability::unavailable();
152
            Availability::unavailable();
156
        break;
153
        break;
157
    }
154
    }
158
155
        
159
    default:
156
    default:
160
        break;
157
        break;
161
    }
158
    }
159
    
160
    promoteHeapAccess(
161
        node,
162
        [&] (PromotedHeapLocation location, Edge value) {
163
            m_availability.m_heap.set(location, Availability(value.node()));
164
        },
165
        [&] (PromotedHeapLocation) { });
162
}
166
}
163
167
164
} } // namespace JSC::DFG
168
} } // namespace JSC::DFG
- Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h -2 / +5 lines
Lines 37-43 class Graph; Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h_sec1
37
37
38
// Computes BasicBlock::ssa->availabiltiyAtHead/Tail. This is a forward flow type inference
38
// Computes BasicBlock::ssa->availabiltiyAtHead/Tail. This is a forward flow type inference
39
// over MovHints and SetLocals. This analysis is run directly by the Plan for preparing for
39
// over MovHints and SetLocals. This analysis is run directly by the Plan for preparing for
40
// lowering to LLVM IR, but it can also be used as a utility.
40
// lowering to LLVM IR, but it can also be used as a utility. Note that if you run it before
41
// stack layout, all of the flush availability will omit the virtual register - but it will
42
// tell you the format.
41
43
42
bool performOSRAvailabilityAnalysis(Graph&);
44
bool performOSRAvailabilityAnalysis(Graph&);
43
45
Lines 49-57 public: Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h_sec2
49
    ~LocalOSRAvailabilityCalculator();
51
    ~LocalOSRAvailabilityCalculator();
50
    
52
    
51
    void beginBlock(BasicBlock*);
53
    void beginBlock(BasicBlock*);
54
    void endBlock(BasicBlock*); // Useful if you want to get data for the end of the block. You don't need to call this if you did beginBlock() and then executeNode() for every node.
52
    void executeNode(Node*);
55
    void executeNode(Node*);
53
    
56
    
54
    Operands<Availability> m_availability;
57
    AvailabilityMap m_availability;
55
};
58
};
56
59
57
} } // namespace JSC::DFG
60
} } // namespace JSC::DFG
- Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp +807 lines
Line 0 Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DFGObjectAllocationSinkingPhase.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGAbstractHeap.h"
32
#include "DFGBlockMapInlines.h"
33
#include "DFGClobberize.h"
34
#include "DFGGraph.h"
35
#include "DFGInsertOSRHintsForUpdate.h"
36
#include "DFGInsertionSet.h"
37
#include "DFGLivenessAnalysisPhase.h"
38
#include "DFGOSRAvailabilityAnalysisPhase.h"
39
#include "DFGPhase.h"
40
#include "DFGPromoteHeapAccess.h"
41
#include "DFGSSACalculator.h"
42
#include "DFGValidate.h"
43
#include "JSCInlines.h"
44
45
namespace JSC { namespace DFG {
46
47
static bool verbose = false;
48
49
class ObjectAllocationSinkingPhase : public Phase {
50
public:
51
    ObjectAllocationSinkingPhase(Graph& graph)
52
        : Phase(graph, "object allocation sinking")
53
        , m_ssaCalculator(graph)
54
        , m_insertionSet(graph)
55
    {
56
    }
57
    
58
    bool run()
59
    {
60
        ASSERT(m_graph.m_fixpointState == FixpointNotConverged);
61
        
62
        m_graph.m_dominators.computeIfNecessary(m_graph);
63
        
64
        // Logically we wish to consider every NewObject and sink it. However it's probably not
65
        // profitable to sink a NewObject that will always escape. So, first we do a very simple
66
        // forward flow analysis that determines the set of NewObject nodes that have any chance
67
        // of benefiting from object allocation sinking. Then we fixpoint the following rules:
68
        //
69
        // - For each NewObject, we turn the original NewObject into a PhantomNewObject and then
70
        //   we insert MaterializeNewObject just before those escaping sites that come before any
71
        //   other escaping sites - that is, there is no path between the allocation and those sites
72
        //   that would see any other escape. Note that Upsilons constitute escaping sites. Then we
73
        //   insert additional MaterializeNewObject nodes on Upsilons that feed into Phis that mix
74
        //   materializations and the original PhantomNewObject. We then turn each PutByOffset over a
75
        //   PhantomNewObject into a PutByOffsetHint.
76
        //
77
        // - We perform the same optimization for MaterializeNewObject. This allows us to cover
78
        //   cases where we had MaterializeNewObject flowing into a PutByOffsetHint.
79
        //
80
        // We could also add this rule:
81
        //
82
        // - If all of the Upsilons of a Phi have a MaterializeNewObject that isn't used by anyone
83
        //   else, then replace the Phi with the MaterializeNewObject.
84
        //
85
        //   FIXME: Implement this. Note that this totally doable but it requires some gnarly
86
        //   code, and to be effective the pruner needs to be aware of it. Currently any Upsilon
87
        //   is considered to be an escape even by the pruner, so it's unlikely that we'll see
88
        //   many cases of Phi over Materializations.
89
        //   https://bugs.webkit.org/show_bug.cgi?id=136927
90
        
91
        if (!performSinking())
92
            return false;
93
        
94
        while (performSinking()) { }
95
        
96
        if (verbose) {
97
            dataLog("Graph after sinking:\n");
98
            m_graph.dump();
99
        }
100
        
101
        return true;
102
    }
103
104
private:
105
    bool performSinking()
106
    {
107
        m_graph.computeRefCounts();
108
        performLivenessAnalysis(m_graph);
109
        performOSRAvailabilityAnalysis(m_graph);
110
        
111
        CString graphBeforeSinking;
112
        if (Options::verboseValidationFailure() && Options::validateGraphAtEachPhase()) {
113
            StringPrintStream out;
114
            m_graph.dump(out);
115
            graphBeforeSinking = out.toCString();
116
        }
117
        
118
        if (verbose) {
119
            dataLog("Graph before sinking:\n");
120
            m_graph.dump();
121
        }
122
        
123
        determineMaterializationPoints();
124
        if (m_sinkCandidates.isEmpty())
125
            return false;
126
        
127
        // At this point we are committed to sinking the sinking candidates.
128
        placeMaterializationPoints();
129
        lowerNonReadingOperationsOnPhantomAllocations();
130
        promoteSunkenFields();
131
        
132
        if (Options::validateGraphAtEachPhase())
133
            validate(m_graph, DumpGraph, graphBeforeSinking);
134
        
135
        if (verbose)
136
            dataLog("Sinking iteration changed the graph.\n");
137
        return true;
138
    }
139
    
140
    void determineMaterializationPoints()
141
    {
142
        // The premise of this pass is that if there exists a point in the program where some
143
        // path from a phantom allocation site to that point causes materialization, then *all*
144
        // paths cause materialization. This should mean that there are never any redundant
145
        // materializations.
146
        
147
        m_sinkCandidates.clear();
148
        m_edgeToMaterializationPoint.clear();
149
        
150
        BlockMap<HashMap<Node*, bool>> materializedAtHead(m_graph);
151
        BlockMap<HashMap<Node*, bool>> materializedAtTail(m_graph);
152
        
153
        bool changed;
154
        do {
155
            if (verbose)
156
                dataLog("Doing iteration of materialization point placement.\n");
157
            changed = false;
158
            for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
159
                HashMap<Node*, bool> materialized = materializedAtHead[block];
160
                for (Node* node : *block) {
161
                    handleNode(
162
                        node,
163
                        [&] () {
164
                            materialized.add(node, false);
165
                        },
166
                        [&] (Node* escapee) {
167
                            auto iter = materialized.find(escapee);
168
                            if (iter != materialized.end())
169
                                iter->value = true;
170
                        });
171
                }
172
                
173
                if (verbose)
174
                    dataLog("    Materialized at tail of ", pointerDump(block), ": ", mapDump(materialized), "\n");
175
                
176
                if (materialized == materializedAtTail[block])
177
                    continue;
178
                
179
                materializedAtTail[block] = materialized;
180
                changed = true;
181
                
182
                // Only propagate things to our successors if they are alive in all successors.
183
                // So, we prune materialized-at-tail to only include things that are live.
184
                Vector<Node*> toRemove;
185
                for (auto pair : materialized) {
186
                    if (!block->ssa->liveAtTail.contains(pair.key))
187
                        toRemove.append(pair.key);
188
                }
189
                for (Node* key : toRemove)
190
                    materialized.remove(key);
191
                
192
                for (BasicBlock* successorBlock : block->successors()) {
193
                    for (auto pair : materialized) {
194
                        materializedAtHead[successorBlock].add(
195
                            pair.key, false).iterator->value |= pair.value;
196
                    }
197
                }
198
            }
199
        } while (changed);
200
        
201
        // Determine the sink candidates. Broadly, a sink candidate is a node that handleNode()
202
        // believes is sinkable, and one of the following is true:
203
        //
204
        // 1) There exists a basic block with only backward outgoing edges (or no outgoing edges)
205
        //    in which the node wasn't materialized. This is meant to catch effectively-infinite
206
        //    loops in which we don't need to have allocated the object.
207
        //
208
        // 2) There exists a basic block at the tail of which the node is not materialized and the
209
        //    node is dead.
210
        //
211
        // 3) The sum of execution counts of the materializations is less than the sum of
212
        //    execution counts of the original node.
213
        //
214
        // We currently implement only rule #2.
215
        // FIXME: Implement the two other rules.
216
        // https://bugs.webkit.org/show_bug.cgi?id=137073 (rule #1)
217
        // https://bugs.webkit.org/show_bug.cgi?id=137074 (rule #3)
218
        
219
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
220
            for (auto pair : materializedAtTail[block]) {
221
                if (pair.value)
222
                    continue; // It was materialized.
223
                
224
                if (block->ssa->liveAtTail.contains(pair.key))
225
                    continue; // It might still get materialized in all of the successors.
226
                
227
                // We know that it died in this block and it wasn't materialized. That means that
228
                // if we sink this allocation, then *this* will be a path along which we never
229
                // have to allocate. Profit!
230
                m_sinkCandidates.add(pair.key);
231
            }
232
        }
233
        
234
        if (m_sinkCandidates.isEmpty())
235
            return;
236
        
237
        // A materialization edge exists at any point where a node escapes but hasn't been
238
        // materialized yet.
239
        //
240
        // FIXME: This can create duplicate allocations when we really only needed to perform one.
241
        // For example:
242
        //
243
        //     var o = new Object();
244
        //     if (rare) {
245
        //         if (stuff)
246
        //             call(o); // o escapes here.
247
        //         return;
248
        //     }
249
        //     // o doesn't escape down here.
250
        //
251
        // In this example, we would place a materialization point at call(o) and then we would find
252
        // ourselves having to insert another one at the implicit else case of that if statement
253
        // ('cause we've broken critical edges). We would instead really like to just have one
254
        // materialization point right at the top of the then case of "if (rare)". To do this, we can
255
        // find the LCA of the various materializations in the dom tree.
256
        // https://bugs.webkit.org/show_bug.cgi?id=137124
257
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
258
            HashSet<Node*> materialized;
259
            for (auto pair : materializedAtHead[block]) {
260
                if (pair.value && m_sinkCandidates.contains(pair.key))
261
                    materialized.add(pair.key);
262
            }
263
            
264
            for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
265
                Node* node = block->at(nodeIndex);
266
                
267
                handleNode(
268
                    node,
269
                    [&] () { },
270
                    [&] (Node* escapee) {
271
                        if (!m_sinkCandidates.contains(escapee))
272
                            return;
273
                        
274
                        if (!materialized.add(escapee).isNewEntry)
275
                            return;
276
                        
277
                        Node* materialize = createMaterialize(escapee, node->origin);
278
                        if (verbose)
279
                            dataLog("Adding materialization point: ", node, "->", escapee, " = ", materialize, "\n");
280
                        m_edgeToMaterializationPoint.add(
281
                            std::make_pair(node, escapee), materialize);
282
                    });
283
            }
284
        }
285
    }
286
    
287
    void placeMaterializationPoints()
288
    {
289
        m_ssaCalculator.reset();
290
        
291
        HashMap<Node*, SSACalculator::Variable*> nodeToVariable;
292
        Vector<Node*> indexToNode;
293
        
294
        for (Node* node : m_sinkCandidates) {
295
            SSACalculator::Variable* variable = m_ssaCalculator.newVariable();
296
            nodeToVariable.add(node, variable);
297
            ASSERT(indexToNode.size() == variable->index());
298
            indexToNode.append(node);
299
        }
300
        
301
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
302
            for (Node* node : *block) {
303
                if (SSACalculator::Variable* variable = nodeToVariable.get(node))
304
                    m_ssaCalculator.newDef(variable, block, node);
305
                
306
                m_graph.doToChildren(
307
                    node,
308
                    [&] (Edge edge) {
309
                        Node* materialize =
310
                            m_edgeToMaterializationPoint.get(std::make_pair(node, edge.node()));
311
                        if (!materialize)
312
                            return;
313
                        
314
                        m_ssaCalculator.newDef(
315
                            nodeToVariable.get(edge.node()), block, materialize);
316
                    });
317
            }
318
        }
319
        
320
        m_ssaCalculator.computePhis(
321
            [&] (SSACalculator::Variable* variable, BasicBlock* block) -> Node* {
322
                Node* allocation = indexToNode[variable->index()];
323
                if (!block->ssa->liveAtHead.contains(allocation))
324
                    return nullptr;
325
                
326
                Node* phiNode = m_graph.addNode(allocation->prediction(), Phi, NodeOrigin());
327
                phiNode->mergeFlags(NodeResultJS);
328
                return phiNode;
329
            });
330
        
331
        // Place Phis in the right places. Replace all uses of any allocation with the appropriate
332
        // materialization. Create the appropriate Upsilon nodes.
333
        LocalOSRAvailabilityCalculator availabilityCalculator;
334
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
335
            HashMap<Node*, Node*> mapping;
336
            
337
            for (Node* candidate : block->ssa->liveAtHead) {
338
                SSACalculator::Variable* variable = nodeToVariable.get(candidate);
339
                if (!variable)
340
                    continue;
341
                
342
                SSACalculator::Def* def = m_ssaCalculator.reachingDefAtHead(block, variable);
343
                if (!def)
344
                    continue;
345
                
346
                mapping.set(indexToNode[variable->index()], def->value());
347
            }
348
            
349
            availabilityCalculator.beginBlock(block);
350
            for (SSACalculator::Def* phiDef : m_ssaCalculator.phisForBlock(block)) {
351
                m_insertionSet.insert(0, phiDef->value());
352
                
353
                Node* originalNode = indexToNode[phiDef->variable()->index()];
354
                insertOSRHintsForUpdate(
355
                    m_insertionSet, 0, NodeOrigin(), availabilityCalculator.m_availability,
356
                    originalNode, phiDef->value());
357
358
                mapping.set(originalNode, phiDef->value());
359
            }
360
            
361
            for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
362
                Node* node = block->at(nodeIndex);
363
364
                m_graph.doToChildren(
365
                    node,
366
                    [&] (Edge edge) {
367
                        Node* materialize = m_edgeToMaterializationPoint.get(
368
                            std::make_pair(node, edge.node()));
369
                        if (materialize) {
370
                            m_insertionSet.insert(nodeIndex, materialize);
371
                            insertOSRHintsForUpdate(
372
                                m_insertionSet, nodeIndex, node->origin,
373
                                availabilityCalculator.m_availability, edge.node(), materialize);
374
                            mapping.set(edge.node(), materialize);
375
                        }
376
                    });
377
378
                availabilityCalculator.executeNode(node);
379
                
380
                m_graph.doToChildren(
381
                    node,
382
                    [&] (Edge& edge) {
383
                        if (Node* materialize = mapping.get(edge.node()))
384
                            edge.setNode(materialize);
385
                    });
386
            }
387
            
388
            size_t upsilonInsertionPoint = block->size() - 1;
389
            NodeOrigin upsilonOrigin = block->last()->origin;
390
            for (BasicBlock* successorBlock : block->successors()) {
391
                for (SSACalculator::Def* phiDef : m_ssaCalculator.phisForBlock(successorBlock)) {
392
                    Node* phiNode = phiDef->value();
393
                    SSACalculator::Variable* variable = phiDef->variable();
394
                    Node* allocation = indexToNode[variable->index()];
395
                    
396
                    Node* originalIncoming = mapping.get(allocation);
397
                    Node* incoming;
398
                    if (originalIncoming == allocation) {
399
                        // If we have a Phi that combines materializations with the original
400
                        // phantom object, then the path with the phantom object must materialize.
401
                        
402
                        incoming = createMaterialize(allocation, upsilonOrigin);
403
                        m_insertionSet.insert(upsilonInsertionPoint, incoming);
404
                        insertOSRHintsForUpdate(
405
                            m_insertionSet, upsilonInsertionPoint, upsilonOrigin,
406
                            availabilityCalculator.m_availability, originalIncoming, incoming);
407
                    } else
408
                        incoming = originalIncoming;
409
                    
410
                    Node* upsilon = m_insertionSet.insertNode(
411
                        upsilonInsertionPoint, SpecNone, Upsilon, upsilonOrigin,
412
                        OpInfo(phiNode), incoming->defaultEdge());
413
                    
414
                    if (originalIncoming == allocation) {
415
                        m_edgeToMaterializationPoint.add(
416
                            std::make_pair(upsilon, allocation), incoming);
417
                    }
418
                }
419
            }
420
            
421
            m_insertionSet.execute(block);
422
        }
423
        
424
        // At this point we have dummy materialization nodes along with edges to them. This means
425
        // that the part of the control flow graph that prefers to see actual object allocations
426
        // is completely fixed up, except for the materializations themselves.
427
    }
428
    
429
    void lowerNonReadingOperationsOnPhantomAllocations()
430
    {
431
        // Lower everything but reading operations on phantom allocations. We absolutely have to
432
        // lower all writes so as to reveal them to the SSA calculator. We cannot lower reads
433
        // because the whole point is that those go away completely.
434
        
435
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
436
            for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
437
                Node* node = block->at(nodeIndex);
438
                switch (node->op()) {
439
                case PutByOffset: {
440
                    if (m_sinkCandidates.contains(node->child2().node()))
441
                        node->convertToPutByOffsetHint();
442
                    break;
443
                }
444
                    
445
                case PutStructure: {
446
                    if (m_sinkCandidates.contains(node->child1().node())) {
447
                        Node* structure = m_insertionSet.insertConstant(
448
                            nodeIndex, node->origin, JSValue(node->transition()->next));
449
                        node->convertToPutStructureHint(structure);
450
                    }
451
                    break;
452
                }
453
                    
454
                case NewObject: {
455
                    if (m_sinkCandidates.contains(node)) {
456
                        Node* structure = m_insertionSet.insertConstant(
457
                            nodeIndex + 1, node->origin, JSValue(node->structure()));
458
                        m_insertionSet.insertNode(
459
                            nodeIndex + 1, SpecNone, PutStructureHint, node->origin,
460
                            Edge(node, KnownCellUse), Edge(structure, KnownCellUse));
461
                        node->convertToPhantomNewObject();
462
                    }
463
                    break;
464
                }
465
                    
466
                case MaterializeNewObject: {
467
                    if (m_sinkCandidates.contains(node)) {
468
                        m_insertionSet.insertNode(
469
                            nodeIndex + 1, SpecNone, PutStructureHint, node->origin,
470
                            Edge(node, KnownCellUse), m_graph.varArgChild(node, 0));
471
                        for (unsigned i = 0; i < node->objectMaterializationData().m_properties.size(); ++i) {
472
                            m_insertionSet.insertNode(
473
                                nodeIndex + 1, SpecNone, PutByOffsetHint, node->origin,
474
                                Edge(node, KnownCellUse), m_graph.varArgChild(node, i + 1));
475
                        }
476
                        node->convertToPhantomNewObject();
477
                    }
478
                    break;
479
                }
480
                    
481
                case StoreBarrier:
482
                case StoreBarrierWithNullCheck: {
483
                    if (m_sinkCandidates.contains(node->child1().node()))
484
                        node->convertToPhantom();
485
                    break;
486
                }
487
                    
488
                default:
489
                    break;
490
                }
491
                
492
                m_graph.doToChildren(
493
                    node,
494
                    [&] (Edge& edge) {
495
                        if (m_sinkCandidates.contains(edge.node()))
496
                            edge.setUseKind(KnownCellUse);
497
                    });
498
            }
499
            m_insertionSet.execute(block);
500
        }
501
    }
502
    
503
    void promoteSunkenFields()
504
    {
505
        // Henceforth when we encounter a materialization point, we will want to ask *who* it is
506
        // a materialization for. Invert the map to be able to answer such questions.
507
        m_materializationPointToEscapee.clear();
508
        for (auto pair : m_edgeToMaterializationPoint)
509
            m_materializationPointToEscapee.add(pair.value, pair.key.second);
510
        
511
        // Collect the set of heap locations that we will be operating over.
512
        HashSet<PromotedHeapLocation> locations;
513
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
514
            for (Node* node : *block) {
515
                promoteHeapAccess(
516
                    node,
517
                    [&] (PromotedHeapLocation location, Edge) {
518
                        locations.add(location);
519
                    },
520
                    [&] (PromotedHeapLocation location) {
521
                        locations.add(location);
522
                    });
523
            }
524
        }
525
        
526
        // Figure out which locations belong to which allocations.
527
        m_locationsForAllocation.clear();
528
        for (PromotedHeapLocation location : locations) {
529
            auto result = m_locationsForAllocation.add(location.base(), Vector<PromotedHeapLocation>());
530
            ASSERT(!result.iterator->value.contains(location));
531
            result.iterator->value.append(location);
532
        }
533
        
534
        // For each sunken thingy, make sure we create Bottom values for all of its fields.
535
        // Note that this has the hilarious slight inefficiency of creating redundant hints for
536
        // things that were previously materializations. This should only impact compile times and
537
        // not code quality, and it's necessary for soundness without some data structure hackage.
538
        // For example, a MaterializeNewObject that we choose to sink may have new fields added to
539
        // it conditionally. That would necessitate Bottoms.
540
        Node* bottom = nullptr;
541
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
542
            if (block == m_graph.block(0))
543
                bottom = m_insertionSet.insertNode(0, SpecNone, BottomValue, NodeOrigin());
544
            
545
            for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
546
                Node* node = block->at(nodeIndex);
547
                for (PromotedHeapLocation location : m_locationsForAllocation.get(node)) {
548
                    m_insertionSet.insert(
549
                        nodeIndex + 1, location.createHint(m_graph, node->origin, bottom));
550
                }
551
            }
552
            m_insertionSet.execute(block);
553
        }
554
555
        m_ssaCalculator.reset();
556
557
        // Collect the set of "variables" that we will be sinking.
558
        m_locationToVariable.clear();
559
        m_indexToLocation.clear();
560
        for (PromotedHeapLocation location : locations) {
561
            SSACalculator::Variable* variable = m_ssaCalculator.newVariable();
562
            m_locationToVariable.add(location, variable);
563
            ASSERT(m_indexToLocation.size() == variable->index());
564
            m_indexToLocation.append(location);
565
        }
566
        
567
        // Create Defs from the existing hints.
568
        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
569
            for (Node* node : *block) {
570
                promoteHeapAccess(
571
                    node,
572
                    [&] (PromotedHeapLocation location, Edge value) {
573
                        SSACalculator::Variable* variable = m_locationToVariable.get(location);
574
                        m_ssaCalculator.newDef(variable, block, value.node());
575
                    },
576
                    [&] (PromotedHeapLocation) { });
577
            }
578
        }
579
        
580
        // OMG run the SSA calculator to create Phis!
581
        m_ssaCalculator.computePhis(
582
            [&] (SSACalculator::Variable* variable, BasicBlock* block) -> Node* {
583
                PromotedHeapLocation location = m_indexToLocation[variable->index()];
584
                if (!block->ssa->liveAtHead.contains(location.base()))
585
                    return nullptr;
586
                
587
                Node* phiNode = m_graph.addNode(SpecHeapTop, Phi, NodeOrigin());
588
                phiNode->mergeFlags(NodeResultJS);
589
                return phiNode;
590
            });
591
        
592
        // Place Phis in the right places, replace all uses of any load with the appropriate
593
        // value, and create the appropriate Upsilon nodes.
594
        m_graph.clearReplacements();
595
        for (BasicBlock* block : m_graph.blocksInPreOrder()) {
596
            // This mapping table is intended to be lazy. If something is omitted from the table,
597
            // it means that there haven't been any local stores to that promoted heap location.
598
            m_localMapping.clear();
599
            
600
            // Insert the Phi functions that we had previously created.
601
            for (SSACalculator::Def* phiDef : m_ssaCalculator.phisForBlock(block)) {
602
                PromotedHeapLocation location = m_indexToLocation[phiDef->variable()->index()];
603
                
604
                m_insertionSet.insert(
605
                    0, phiDef->value());
606
                m_insertionSet.insert(
607
                    0, location.createHint(m_graph, NodeOrigin(), phiDef->value()));
608
                m_localMapping.add(location, phiDef->value());
609
            }
610
            
611
            if (verbose)
612
                dataLog("Local mapping at ", pointerDump(block), ": ", mapDump(m_localMapping), "\n");
613
            
614
            // Process the block and replace all uses of loads with the promoted value.
615
            for (Node* node : *block) {
616
                m_graph.performSubstitution(node);
617
                
618
                if (Node* escapee = m_materializationPointToEscapee.get(node))
619
                    populateMaterialize(block, node, escapee);
620
                
621
                promoteHeapAccess(
622
                    node,
623
                    [&] (PromotedHeapLocation location, Edge value) {
624
                        m_localMapping.set(location, value.node());
625
                    },
626
                    [&] (PromotedHeapLocation location) {
627
                        node->replaceWith(resolve(block, location));
628
                    });
629
            }
630
            
631
            // Gotta drop some Upsilons.
632
            size_t upsilonInsertionPoint = block->size() - 1;
633
            NodeOrigin upsilonOrigin = block->last()->origin;
634
            for (BasicBlock* successorBlock : block->successors()) {
635
                for (SSACalculator::Def* phiDef : m_ssaCalculator.phisForBlock(successorBlock)) {
636
                    Node* phiNode = phiDef->value();
637
                    SSACalculator::Variable* variable = phiDef->variable();
638
                    PromotedHeapLocation location = m_indexToLocation[variable->index()];
639
                    Node* incoming = resolve(block, location);
640
                    
641
                    m_insertionSet.insertNode(
642
                        upsilonInsertionPoint, SpecNone, Upsilon, upsilonOrigin,
643
                        OpInfo(phiNode), incoming->defaultEdge());
644
                }
645
            }
646
            
647
            m_insertionSet.execute(block);
648
        }
649
    }
650
    
651
    Node* resolve(BasicBlock* block, PromotedHeapLocation location)
652
    {
653
        if (Node* result = m_localMapping.get(location))
654
            return result;
655
        
656
        // This implies that there is no local mapping. Find a non-local mapping.
657
        SSACalculator::Def* def = m_ssaCalculator.nonLocalReachingDef(
658
            block, m_locationToVariable.get(location));
659
        ASSERT(def);
660
        ASSERT(def->value());
661
        m_localMapping.add(location, def->value());
662
        return def->value();
663
    }
664
665
    template<typename SinkCandidateFunctor, typename EscapeFunctor>
666
    void handleNode(
667
        Node* node,
668
        const SinkCandidateFunctor& sinkCandidate,
669
        const EscapeFunctor& escape)
670
    {
671
        switch (node->op()) {
672
        case NewObject:
673
        case MaterializeNewObject:
674
            sinkCandidate();
675
            break;
676
            
677
        case CheckStructure:
678
        case GetByOffset:
679
        case MultiGetByOffset:
680
        case PutStructure:
681
        case GetGetterSetterByOffset:
682
        case MovHint:
683
        case Phantom:
684
        case Check:
685
        case HardPhantom:
686
        case StoreBarrier:
687
        case StoreBarrierWithNullCheck:
688
        case PutByOffsetHint:
689
            break;
690
            
691
        case PutByOffset:
692
            escape(node->child3().node());
693
            break;
694
            
695
        case MultiPutByOffset:
696
            // FIXME: In the future we should be able to handle this. It's just a matter of
697
            // building the appropriate *Hint variant of this instruction, along with a
698
            // PhantomStructureSelect node - since this transforms the Structure in a conditional
699
            // way.
700
            // https://bugs.webkit.org/show_bug.cgi?id=136924
701
            escape(node->child1().node());
702
            escape(node->child2().node());
703
            break;
704
705
        default:
706
            m_graph.doToChildren(
707
                node,
708
                [&escape] (Edge edge) {
709
                    escape(edge.node());
710
                });
711
            break;
712
        }
713
    }
714
    
715
    Node* createMaterialize(Node* escapee, const NodeOrigin whereOrigin)
716
    {
717
        switch (escapee->op()) {
718
        case NewObject:
719
        case MaterializeNewObject: {
720
            ObjectMaterializationData* data = m_graph.m_objectMaterializationData.add();
721
            
722
            Node* result = m_graph.addNode(
723
                escapee->prediction(), Node::VarArg, MaterializeNewObject,
724
                NodeOrigin(
725
                    escapee->origin.semantic,
726
                    whereOrigin.forExit),
727
                OpInfo(data), OpInfo(), 0, 0);
728
            return result;
729
        }
730
            
731
        default:
732
            DFG_CRASH(m_graph, escapee, "Bad escapee op");
733
            return nullptr;
734
        }
735
    }
736
    
737
    void populateMaterialize(BasicBlock* block, Node* node, Node* escapee)
738
    {
739
        switch (node->op()) {
740
        case MaterializeNewObject: {
741
            ObjectMaterializationData& data = node->objectMaterializationData();
742
            unsigned firstChild = m_graph.m_varArgChildren.size();
743
            
744
            Vector<PromotedHeapLocation> locations = m_locationsForAllocation.get(escapee);
745
            
746
            PromotedHeapLocation structure(StructurePLoc, escapee);
747
            ASSERT(locations.contains(structure));
748
            
749
            m_graph.m_varArgChildren.append(Edge(resolve(block, structure), KnownCellUse));
750
            
751
            for (unsigned i = 0; i < locations.size(); ++i) {
752
                switch (locations[i].kind()) {
753
                case StructurePLoc: {
754
                    ASSERT(locations[i] == structure);
755
                    break;
756
                }
757
                    
758
                case NamedPropertyPLoc: {
759
                    Node* value = resolve(block, locations[i]);
760
                    if (value->op() == BottomValue) {
761
                        // We can skip Bottoms entirely.
762
                        break;
763
                    }
764
                    
765
                    data.m_properties.append(PhantomPropertyValue(locations[i].info()));
766
                    m_graph.m_varArgChildren.append(value);
767
                    break;
768
                }
769
                    
770
                default:
771
                    DFG_CRASH(m_graph, node, "Bad location kind");
772
                }
773
            }
774
            
775
            node->children = AdjacencyList(
776
                AdjacencyList::Variable,
777
                firstChild, m_graph.m_varArgChildren.size() - firstChild);
778
            break;
779
        }
780
            
781
        default:
782
            DFG_CRASH(m_graph, node, "Bad materialize op");
783
            break;
784
        }
785
    }
786
    
787
    SSACalculator m_ssaCalculator;
788
    HashSet<Node*> m_sinkCandidates;
789
    HashMap<std::pair<Node*, Node*>, Node*> m_edgeToMaterializationPoint;
790
    HashMap<Node*, Node*> m_materializationPointToEscapee;
791
    HashMap<Node*, Vector<PromotedHeapLocation>> m_locationsForAllocation;
792
    HashMap<PromotedHeapLocation, SSACalculator::Variable*> m_locationToVariable;
793
    Vector<PromotedHeapLocation> m_indexToLocation;
794
    HashMap<PromotedHeapLocation, Node*> m_localMapping;
795
    InsertionSet m_insertionSet;
796
};
797
    
798
bool performObjectAllocationSinking(Graph& graph)
799
{
800
    SamplingRegion samplingRegion("DFG Object Allocation Sinking Phase");
801
    return runPhase<ObjectAllocationSinkingPhase>(graph);
802
}
803
804
} } // namespace JSC::DFG
805
806
#endif // ENABLE(DFG_JIT)
807
- Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.h +47 lines
Line 0 Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGObjectAllocationSinkingPhase_h
27
#define DFGObjectAllocationSinkingPhase_h
28
29
#if ENABLE(DFG_JIT)
30
31
namespace JSC { namespace DFG {
32
33
class Graph;
34
35
// Sinks object allocations down to their uses. This will sink the allocations over OSR exits, by
36
// replacing all stores to those objects with store hints so that OSR exit can materialize the
37
// object. This may sink allocations past returns, creating control flow paths along which the
38
// objects are not allocated at all. Replaces all uses of the objects' fields with SSA data flow.
39
40
bool performObjectAllocationSinking(Graph&);
41
42
} } // namespace JSC::DFG
43
44
#endif // ENABLE(DFG_JIT)
45
46
#endif // DFGObjectAllocationSinkingPhase_h
47
- Source/JavaScriptCore/dfg/DFGObjectMaterializationData.cpp +63 lines
Line 0 Source/JavaScriptCore/dfg/DFGObjectMaterializationData.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DFGObjectMaterializationData.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include <wtf/ListDump.h>
32
33
namespace JSC { namespace DFG {
34
35
void PhantomPropertyValue::dump(PrintStream& out) const
36
{
37
    out.print("id", m_identifierNumber);
38
}
39
40
void ObjectMaterializationData::dump(PrintStream& out) const
41
{
42
    out.print("[", listDump(m_properties), "]");
43
}
44
45
float ObjectMaterializationData::oneWaySimilarityScore(
46
    const ObjectMaterializationData& other) const
47
{
48
    unsigned numHits = 0;
49
    for (PhantomPropertyValue value : m_properties) {
50
        if (other.m_properties.contains(value))
51
            numHits++;
52
    }
53
    return static_cast<float>(numHits) / static_cast<float>(m_properties.size());
54
}
55
56
float ObjectMaterializationData::similarityScore(const ObjectMaterializationData& other) const
57
{
58
    return std::min(oneWaySimilarityScore(other), other.oneWaySimilarityScore(*this));
59
}
60
61
} } // namespace JSC::DFG
62
63
#endif // ENABLE(DFG_JIT)
- Source/JavaScriptCore/dfg/DFGObjectMaterializationData.h +76 lines
Line 0 Source/JavaScriptCore/dfg/DFGObjectMaterializationData.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGObjectMaterializationData_h
27
#define DFGObjectMaterializationData_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include <wtf/MathExtras.h>
32
#include <wtf/PrintStream.h>
33
#include <wtf/Vector.h>
34
35
namespace JSC { namespace DFG {
36
37
struct PhantomPropertyValue {
38
    PhantomPropertyValue()
39
        : m_identifierNumber(UINT_MAX)
40
    {
41
    }
42
    
43
    PhantomPropertyValue(unsigned identifierNumber)
44
        : m_identifierNumber(identifierNumber)
45
    {
46
    }
47
    
48
    unsigned m_identifierNumber;
49
    
50
    bool operator==(const PhantomPropertyValue& other) const
51
    {
52
        return m_identifierNumber == other.m_identifierNumber;
53
    }
54
    
55
    void dump(PrintStream&) const;
56
};
57
58
struct ObjectMaterializationData {
59
    // Determines the meaning of the passed nodes.
60
    Vector<PhantomPropertyValue> m_properties;
61
    
62
    void dump(PrintStream&) const;
63
    
64
    // The fraction of my properties that the other data has.
65
    float oneWaySimilarityScore(const ObjectMaterializationData&) const;
66
    
67
    // The minimum of the two possible one-way scores.
68
    float similarityScore(const ObjectMaterializationData&) const;
69
};
70
71
} } // namespace JSC::DFG
72
73
#endif // ENABLE(DFG_JIT)
74
75
#endif // DFGObjectMaterializationData_h
76
- Source/JavaScriptCore/dfg/DFGPhantomCanonicalizationPhase.cpp -12 / +1 lines
Lines 52-69 public: Source/JavaScriptCore/dfg/DFGPhantomCanonicalizationPhase.cpp_sec1
52
        ASSERT(m_graph.m_form == SSA);
52
        ASSERT(m_graph.m_form == SSA);
53
        
53
        
54
        m_graph.clearFlagsOnAllNodes(NodeNeedsPhantom | NodeNeedsHardPhantom | NodeRelevantToOSR);
54
        m_graph.clearFlagsOnAllNodes(NodeNeedsPhantom | NodeNeedsHardPhantom | NodeRelevantToOSR);
55
        
55
        m_graph.mergeRelevantToOSR();
56
        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
57
            BasicBlock* block = m_graph.block(blockIndex);
58
            if (!block)
59
                continue;
60
            
61
            for (unsigned i = block->size(); i--;) {
62
                Node* node = block->at(i);
63
                if (node->op() == MovHint)
64
                    node->child1()->mergeFlags(NodeRelevantToOSR);
65
            }
66
        }
67
        
56
        
68
        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
57
        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
69
            BasicBlock* block = m_graph.block(blockIndex);
58
            BasicBlock* block = m_graph.block(blockIndex);
- Source/JavaScriptCore/dfg/DFGPhantomRemovalPhase.cpp -11 / +1 lines
Lines 74-90 public: Source/JavaScriptCore/dfg/DFGPhantomRemovalPhase.cpp_sec1
74
            }
74
            }
75
        }
75
        }
76
        
76
        
77
        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
77
        m_graph.mergeRelevantToOSR();
78
            BasicBlock* block = m_graph.block(blockIndex);
79
            if (!block)
80
                continue;
81
            
82
            for (unsigned i = block->size(); i--;) {
83
                Node* node = block->at(i);
84
                if (node->op() == MovHint)
85
                    node->child1()->mergeFlags(NodeRelevantToOSR);
86
            }
87
        }
88
        
78
        
89
        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
79
        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
90
            BasicBlock* block = m_graph.block(blockIndex);
80
            BasicBlock* block = m_graph.block(blockIndex);
- Source/JavaScriptCore/dfg/DFGPhiChildren.cpp +64 lines
Line 0 Source/JavaScriptCore/dfg/DFGPhiChildren.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DFGPhiChildren.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGGraph.h"
32
33
namespace JSC { namespace DFG {
34
35
PhiChildren::PhiChildren()
36
{
37
}
38
39
PhiChildren::PhiChildren(Graph& graph)
40
{
41
    for (BasicBlock* block : graph.blocksInNaturalOrder()) {
42
        for (Node* node : *block) {
43
            if (node->op() != Upsilon)
44
                continue;
45
            
46
            m_children.add(node->phi(), List()).iterator->value.append(node);
47
        }
48
    }
49
}
50
51
PhiChildren::~PhiChildren()
52
{
53
}
54
55
const PhiChildren::List& PhiChildren::upsilonsOf(Node* node) const
56
{
57
    ASSERT(node->op() == Phi);
58
    return m_children.find(node)->value;
59
}
60
61
} } // namespace JSC::DFG
62
63
#endif // ENABLE(DFG_JIT)
64
- Source/JavaScriptCore/dfg/DFGPhiChildren.h +92 lines
Line 0 Source/JavaScriptCore/dfg/DFGPhiChildren.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGPhiChildren_h
27
#define DFGPhiChildren_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGNode.h"
32
#include <wtf/HashSet.h>
33
#include <wtf/Vector.h>
34
35
namespace JSC { namespace DFG {
36
37
class Graph;
38
39
class PhiChildren {
40
public:
41
    typedef Vector<Node*, 3> List;
42
    
43
    PhiChildren();
44
    PhiChildren(Graph&);
45
    ~PhiChildren();
46
    
47
    // The list of Upsilons that point to the children of the Phi.
48
    const List& upsilonsOf(Node*) const;
49
    
50
    template<typename Functor>
51
    void forAllIncomingValues(Node* node, const Functor& functor)
52
    {
53
        for (Node* upsilon : upsilonsOf(node))
54
            functor(upsilon->child1().node());
55
    }
56
    
57
    // This walks the Phi graph.
58
    template<typename Functor>
59
    void forAllTransitiveIncomingValues(Node* node, const Functor& functor)
60
    {
61
        if (node->op() != Phi) {
62
            functor(node);
63
            return;
64
        }
65
        HashSet<Node*> seen;
66
        Vector<Node*> worklist;
67
        seen.add(node);
68
        worklist.append(node);
69
        while (!worklist.isEmpty()) {
70
            Node* currentNode = worklist.takeLast();
71
            forAllIncomingValues(
72
                currentNode,
73
                [&] (Node* incomingNode) {
74
                    if (incomingNode->op() == Phi) {
75
                        if (seen.add(incomingNode).isNewEntry)
76
                            worklist.append(incomingNode);
77
                    } else
78
                        functor(incomingNode);
79
                });
80
        }
81
    }
82
    
83
private:
84
    HashMap<Node*, List> m_children;
85
};
86
87
} } // namespace JSC::DFG
88
89
#endif // ENABLE(DFG_JIT)
90
91
#endif // DFGPhiChildren_h
92
- Source/JavaScriptCore/dfg/DFGPlan.cpp -1 / +8 lines
Lines 49-54 Source/JavaScriptCore/dfg/DFGPlan.cpp_sec1
49
#include "DFGLoopPreHeaderCreationPhase.h"
49
#include "DFGLoopPreHeaderCreationPhase.h"
50
#include "DFGOSRAvailabilityAnalysisPhase.h"
50
#include "DFGOSRAvailabilityAnalysisPhase.h"
51
#include "DFGOSREntrypointCreationPhase.h"
51
#include "DFGOSREntrypointCreationPhase.h"
52
#include "DFGObjectAllocationSinkingPhase.h"
52
#include "DFGPhantomCanonicalizationPhase.h"
53
#include "DFGPhantomCanonicalizationPhase.h"
53
#include "DFGPhantomRemovalPhase.h"
54
#include "DFGPhantomRemovalPhase.h"
54
#include "DFGPredictionInjectionPhase.h"
55
#include "DFGPredictionInjectionPhase.h"
Lines 277-282 Plan::CompilationPath Plan::compileInThr Source/JavaScriptCore/dfg/DFGPlan.cpp_sec2
277
    if (validationEnabled()) {
278
    if (validationEnabled()) {
278
        dfg.m_dominators.computeIfNecessary(dfg);
279
        dfg.m_dominators.computeIfNecessary(dfg);
279
        dfg.m_naturalLoops.computeIfNecessary(dfg);
280
        dfg.m_naturalLoops.computeIfNecessary(dfg);
281
        dfg.m_prePostNumbering.computeIfNecessary(dfg);
280
    }
282
    }
281
283
282
    switch (mode) {
284
    switch (mode) {
Lines 325-335 Plan::CompilationPath Plan::compileInThr Source/JavaScriptCore/dfg/DFGPlan.cpp_sec3
325
        performCFA(dfg);
327
        performCFA(dfg);
326
        performConstantFolding(dfg);
328
        performConstantFolding(dfg);
327
        performPhantomCanonicalization(dfg); // Reduce the graph size a lot.
329
        performPhantomCanonicalization(dfg); // Reduce the graph size a lot.
328
        if (performStrengthReduction(dfg)) {
330
        changed = false;
331
        changed |= performStrengthReduction(dfg);
332
        changed |= performCriticalEdgeBreaking(dfg);
333
        changed |= performObjectAllocationSinking(dfg);
334
        if (changed) {
329
            // State-at-tail and state-at-head will be invalid if we did strength reduction since
335
            // State-at-tail and state-at-head will be invalid if we did strength reduction since
330
            // it might increase live ranges.
336
            // it might increase live ranges.
331
            performLivenessAnalysis(dfg);
337
            performLivenessAnalysis(dfg);
332
            performCFA(dfg);
338
            performCFA(dfg);
339
            performConstantFolding(dfg);
333
        }
340
        }
334
        performLICM(dfg);
341
        performLICM(dfg);
335
        performPhantomCanonicalization(dfg);
342
        performPhantomCanonicalization(dfg);
- Source/JavaScriptCore/dfg/DFGPrePostNumbering.cpp +89 lines
Line 0 Source/JavaScriptCore/dfg/DFGPrePostNumbering.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DFGPrePostNumbering.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGBlockMapInlines.h"
32
#include "DFGBlockWorklist.h"
33
#include "DFGGraph.h"
34
35
namespace JSC { namespace DFG {
36
37
PrePostNumbering::PrePostNumbering() { }
38
PrePostNumbering::~PrePostNumbering() { }
39
40
void PrePostNumbering::compute(Graph& graph)
41
{
42
    m_map = BlockMap<Numbering>(graph);
43
    
44
    PostOrderBlockWorklist worklist;
45
    worklist.push(graph.block(0));
46
    unsigned nextPreNumber = 0;
47
    unsigned nextPostNumber = 0;
48
    while (BlockWithOrder item = worklist.pop()) {
49
        switch (item.order) {
50
        case PreOrder:
51
            m_map[item.block].m_preNumber = nextPreNumber++;
52
            worklist.pushPost(item.block);
53
            for (BasicBlock* successor : item.block->successors())
54
                worklist.push(successor);
55
            break;
56
        case PostOrder:
57
            m_map[item.block].m_postNumber = nextPostNumber++;
58
            break;
59
        }
60
    }
61
}
62
63
} } // namespace JSC::DFG
64
65
namespace WTF {
66
67
using namespace JSC::DFG;
68
69
void printInternal(PrintStream& out, EdgeKind kind)
70
{
71
    switch (kind) {
72
    case ForwardEdge:
73
        out.print("ForwardEdge");
74
        return;
75
    case CrossEdge:
76
        out.print("CrossEdge");
77
        return;
78
    case BackEdge:
79
        out.print("BackEdge");
80
        return;
81
    }
82
    
83
    RELEASE_ASSERT_NOT_REACHED();
84
}
85
86
} // namespace WTF
87
88
#endif // ENABLE(DFG_JIT)
89
- Source/JavaScriptCore/dfg/DFGPrePostNumbering.h +108 lines
Line 0 Source/JavaScriptCore/dfg/DFGPrePostNumbering.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGPrePostNumbering_h
27
#define DFGPrePostNumbering_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGAnalysis.h"
32
#include "DFGBasicBlock.h"
33
#include "DFGBlockMap.h"
34
35
namespace JSC { namespace DFG {
36
37
enum EdgeKind {
38
    ForwardEdge,
39
    CrossEdge,
40
    BackEdge
41
};
42
43
class PrePostNumbering : public Analysis<PrePostNumbering> {
44
public:
45
    PrePostNumbering();
46
    ~PrePostNumbering();
47
48
    void compute(Graph&);
49
    
50
    unsigned preNumber(BasicBlock* block) const { return m_map[block].m_preNumber; }
51
    unsigned postNumber(BasicBlock* block) const { return m_map[block].m_postNumber; }
52
    
53
    // Is from a strict ancestor of to?
54
    bool isStrictAncestorOf(BasicBlock* from, BasicBlock* to) const
55
    {
56
        return preNumber(from) < preNumber(to)
57
            && postNumber(from) > postNumber(to);
58
    }
59
    
60
    bool isAncestorOf(BasicBlock* from, BasicBlock* to) const
61
    {
62
        return from == to || isStrictAncestorOf(from, to);
63
    }
64
    
65
    bool isStrictDescendantOf(BasicBlock* from, BasicBlock* to) const
66
    {
67
        return isStrictAncestorOf(to, from);
68
    }
69
    
70
    bool isDescendantOf(BasicBlock* from, BasicBlock* to) const
71
    {
72
        return isAncestorOf(to, from);
73
    }
74
    
75
    // This will give a bogus answer if there is actually no such edge. If you want to determine
76
    // if there is any such edge, you have to do it yourself.
77
    EdgeKind edgeKind(BasicBlock* from, BasicBlock* to) const
78
    {
79
        if (isStrictDescendantOf(to, from))
80
            return ForwardEdge;
81
        
82
        if (isAncestorOf(to, from))
83
            return BackEdge;
84
        
85
        return CrossEdge;
86
    }
87
    
88
private:
89
    struct Numbering {
90
        unsigned m_preNumber;
91
        unsigned m_postNumber;
92
    };
93
    
94
    BlockMap<Numbering> m_map;
95
};
96
97
} } // namespace JSC::DFG
98
99
namespace WTF {
100
101
void printInternal(PrintStream&, JSC::DFG::EdgeKind);
102
103
} // namespace WTF
104
105
#endif // ENABLE(DFG_JIT)
106
107
#endif // DFGPrePostNumbering_h
108
- Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp -1 / +6 lines
Lines 560-566 private: Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp_sec1
560
        case DoubleConstant:
560
        case DoubleConstant:
561
        case Int52Constant:
561
        case Int52Constant:
562
        case Identity:
562
        case Identity:
563
        case BooleanToNumber: {
563
        case BooleanToNumber:
564
        case PhantomNewObject:
565
        case PutByOffsetHint:
566
        case CheckStructureImmediate:
567
        case PutStructureHint:
568
        case MaterializeNewObject: {
564
            // This node should never be visible at this stage of compilation. It is
569
            // This node should never be visible at this stage of compilation. It is
565
            // inserted by fixup(), which follows this phase.
570
            // inserted by fixup(), which follows this phase.
566
            RELEASE_ASSERT_NOT_REACHED();
571
            RELEASE_ASSERT_NOT_REACHED();
- Source/JavaScriptCore/dfg/DFGPromoteHeapAccess.h +90 lines
Line 0 Source/JavaScriptCore/dfg/DFGPromoteHeapAccess.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGPromoteHeapAccess_h
27
#define DFGPromoteHeapAccess_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGNode.h"
32
#include "DFGPromotedHeapLocation.h"
33
34
namespace JSC { namespace DFG {
35
36
// Note that the write functor is really the useful thing here. The read functor is only useful
37
// for the object allocation sinking phase.
38
template<typename WriteFunctor, typename ReadFunctor>
39
void promoteHeapAccess(Node* node, const WriteFunctor& write, const ReadFunctor& read)
40
{
41
    switch (node->op()) {
42
    case CheckStructure: {
43
        if (node->child1()->isPhantomObjectAllocation())
44
            read(PromotedHeapLocation(StructurePLoc, node->child1()));
45
        break;
46
    }
47
    
48
    case GetByOffset:
49
    case GetGetterSetterByOffset: {
50
        if (node->child2()->isPhantomObjectAllocation()) {
51
            unsigned identifierNumber = node->storageAccessData().identifierNumber;
52
            read(PromotedHeapLocation(NamedPropertyPLoc, node->child2(), identifierNumber));
53
        }
54
        break;
55
    }
56
57
    case MultiGetByOffset: {
58
        if (node->child1()->isPhantomObjectAllocation()) {
59
            unsigned identifierNumber = node->multiGetByOffsetData().identifierNumber;
60
            read(PromotedHeapLocation(NamedPropertyPLoc, node->child1(), identifierNumber));
61
        }
62
        break;
63
    }
64
65
    case PutStructureHint: {
66
        ASSERT(node->child1()->isPhantomObjectAllocation());
67
        write(PromotedHeapLocation(StructurePLoc, node->child1()), node->child2());
68
        break;
69
    }
70
71
    case PutByOffsetHint: {
72
        ASSERT(node->child1()->isPhantomObjectAllocation());
73
        unsigned identifierNumber = node->identifierNumber();
74
        write(
75
            PromotedHeapLocation(NamedPropertyPLoc, node->child1(), identifierNumber),
76
            node->child2());
77
        break;
78
    }
79
80
    default:
81
        break;
82
    }
83
}
84
85
} } // namespace JSC::DFG
86
87
#endif // ENABLE(DFG_JIT)
88
89
#endif // DFGPromoteHeapAccess_h
90
- Source/JavaScriptCore/dfg/DFGPromotedHeapLocation.cpp +94 lines
Line 0 Source/JavaScriptCore/dfg/DFGPromotedHeapLocation.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DFGPromotedHeapLocation.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGGraph.h"
32
#include "JSCInlines.h"
33
34
namespace JSC { namespace DFG {
35
36
void PromotedLocationDescriptor::dump(PrintStream& out) const
37
{
38
    out.print(m_kind, "(", m_info, ")");
39
}
40
41
Node* PromotedHeapLocation::createHint(Graph& graph, NodeOrigin origin, Node* value)
42
{
43
    switch (kind()) {
44
    case StructurePLoc:
45
        return graph.addNode(
46
            SpecNone, PutStructureHint, origin,
47
            Edge(base(), KnownCellUse), Edge(value, KnownCellUse));
48
        
49
    case NamedPropertyPLoc:
50
        return graph.addNode(
51
            SpecNone, PutByOffsetHint, origin,
52
            OpInfo(info()), Edge(base(), KnownCellUse), Edge(value, UntypedUse));
53
        
54
    case InvalidPromotedLocationKind:
55
        return nullptr;
56
    }
57
    
58
    RELEASE_ASSERT_NOT_REACHED();
59
}
60
61
void PromotedHeapLocation::dump(PrintStream& out) const
62
{
63
    out.print(kind(), "(", m_base, ", ", info(), ")");
64
}
65
66
} } // namespace JSC::DFG
67
68
namespace WTF {
69
70
using namespace JSC::DFG;
71
72
void printInternal(PrintStream& out, PromotedLocationKind kind)
73
{
74
    switch (kind) {
75
    case InvalidPromotedLocationKind:
76
        out.print("InvalidPromotedLocationKind");
77
        return;
78
        
79
    case StructurePLoc:
80
        out.print("StructurePLoc");
81
        return;
82
        
83
    case NamedPropertyPLoc:
84
        out.print("NamedPropertyPLoc");
85
        return;
86
    }
87
    
88
    RELEASE_ASSERT_NOT_REACHED();
89
}
90
91
} // namespace WTF;
92
93
#endif // ENABLE(DFG_JIT)
94
- Source/JavaScriptCore/dfg/DFGPromotedHeapLocation.h +172 lines
Line 0 Source/JavaScriptCore/dfg/DFGPromotedHeapLocation.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DFGPromotedHeapLocation_h
27
#define DFGPromotedHeapLocation_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include "DFGNode.h"
32
#include <wtf/PrintStream.h>
33
34
namespace JSC { namespace DFG {
35
36
enum PromotedLocationKind {
37
    InvalidPromotedLocationKind,
38
    
39
    StructurePLoc,
40
    NamedPropertyPLoc
41
};
42
43
class PromotedLocationDescriptor {
44
public:
45
    PromotedLocationDescriptor(
46
        PromotedLocationKind kind = InvalidPromotedLocationKind, unsigned info = 0)
47
        : m_kind(kind)
48
        , m_info(info)
49
    {
50
    }
51
    
52
    bool operator!() const { return m_kind == InvalidPromotedLocationKind; }
53
    
54
    PromotedLocationKind kind() const { return m_kind; }
55
    unsigned info() const { return m_info; }
56
    
57
    unsigned hash() const
58
    {
59
        return m_kind + m_info;
60
    }
61
    
62
    bool operator==(const PromotedLocationDescriptor& other) const
63
    {
64
        return m_kind == other.m_kind
65
            && m_info == other.m_info;
66
    }
67
    
68
    bool operator!=(const PromotedLocationDescriptor& other) const
69
    {
70
        return !(*this == other);
71
    }
72
73
    bool isHashTableDeletedValue() const
74
    {
75
        return m_kind == InvalidPromotedLocationKind && m_info;
76
    }
77
    
78
    void dump(PrintStream& out) const;
79
80
private:
81
    PromotedLocationKind m_kind;
82
    unsigned m_info;
83
};
84
85
class PromotedHeapLocation {
86
public:
87
    PromotedHeapLocation(
88
        PromotedLocationKind kind = InvalidPromotedLocationKind,
89
        Node* base = nullptr, unsigned info = 0)
90
        : m_base(base)
91
        , m_meta(kind, info)
92
    {
93
    }
94
    
95
    PromotedHeapLocation(
96
        PromotedLocationKind kind, Edge base, unsigned info = 0)
97
        : PromotedHeapLocation(kind, base.node(), info)
98
    {
99
    }
100
    
101
    PromotedHeapLocation(Node* base, PromotedLocationDescriptor meta)
102
        : m_base(base)
103
        , m_meta(meta)
104
    {
105
    }
106
    
107
    PromotedHeapLocation(WTF::HashTableDeletedValueType)
108
        : m_base(nullptr)
109
        , m_meta(InvalidPromotedLocationKind, 1)
110
    {
111
    }
112
    
113
    Node* createHint(Graph&, NodeOrigin, Node* value);
114
    
115
    bool operator!() const { return kind() == InvalidPromotedLocationKind; }
116
    
117
    PromotedLocationKind kind() const { return m_meta.kind(); }
118
    Node* base() const { return m_base; }
119
    unsigned info() const { return m_meta.info(); }
120
    PromotedLocationDescriptor descriptor() const { return m_meta; }
121
    
122
    unsigned hash() const
123
    {
124
        return m_meta.hash() + WTF::PtrHash<Node*>::hash(m_base);
125
    }
126
    
127
    bool operator==(const PromotedHeapLocation& other) const
128
    {
129
        return m_base == other.m_base
130
            && m_meta == other.m_meta;
131
    }
132
    
133
    bool isHashTableDeletedValue() const
134
    {
135
        return m_meta.isHashTableDeletedValue();
136
    }
137
    
138
    void dump(PrintStream& out) const;
139
    
140
private:
141
    Node* m_base;
142
    PromotedLocationDescriptor m_meta;
143
};
144
145
struct PromotedHeapLocationHash {
146
    static unsigned hash(const PromotedHeapLocation& key) { return key.hash(); }
147
    static bool equal(const PromotedHeapLocation& a, const PromotedHeapLocation& b) { return a == b; }
148
    static const bool safeToCompareToEmptyOrDeleted = true;
149
};
150
151
} } // namespace JSC::DFG
152
153
namespace WTF {
154
155
void printInternal(PrintStream&, JSC::DFG::PromotedLocationKind);
156
157
template<typename T> struct DefaultHash;
158
template<> struct DefaultHash<JSC::DFG::PromotedHeapLocation> {
159
    typedef JSC::DFG::PromotedHeapLocationHash Hash;
160
};
161
162
template<typename T> struct HashTraits;
163
template<> struct HashTraits<JSC::DFG::PromotedHeapLocation> : SimpleClassHashTraits<JSC::DFG::PromotedHeapLocation> {
164
    static const bool emptyValueIsZero = false;
165
};
166
167
} // namespace WTF
168
169
#endif // ENABLE(DFG_JIT)
170
171
#endif // DFGPromotedHeapLocation_h
172
- Source/JavaScriptCore/dfg/DFGSSACalculator.cpp +11 lines
Lines 66-71 SSACalculator::~SSACalculator() Source/JavaScriptCore/dfg/DFGSSACalculator.cpp_sec1
66
{
66
{
67
}
67
}
68
68
69
void SSACalculator::reset()
70
{
71
    m_variables.clear();
72
    m_defs.clear();
73
    m_phis.clear();
74
    for (BlockIndex blockIndex = m_data.size(); blockIndex--;) {
75
        m_data[blockIndex].m_defs.clear();
76
        m_data[blockIndex].m_phis.clear();
77
    }
78
}
79
69
SSACalculator::Variable* SSACalculator::newVariable()
80
SSACalculator::Variable* SSACalculator::newVariable()
70
{
81
{
71
    return &m_variables.alloc(Variable(m_variables.size()));
82
    return &m_variables.alloc(Variable(m_variables.size()));
- Source/JavaScriptCore/dfg/DFGSSACalculator.h +2 lines
Lines 105-110 public: Source/JavaScriptCore/dfg/DFGSSACalculator.h_sec1
105
    SSACalculator(Graph&);
105
    SSACalculator(Graph&);
106
    ~SSACalculator();
106
    ~SSACalculator();
107
    
107
    
108
    void reset();
109
    
108
    class Variable {
110
    class Variable {
109
    public:
111
    public:
110
        unsigned index() const { return m_index; }
112
        unsigned index() const { return m_index; }
- Source/JavaScriptCore/dfg/DFGSafeToExecute.h +5 lines
Lines 270-275 bool safeToExecute(AbstractStateType& st Source/JavaScriptCore/dfg/DFGSafeToExecute.h_sec1
270
    case GetGenericPropertyEnumerator:
270
    case GetGenericPropertyEnumerator:
271
    case GetEnumeratorPname:
271
    case GetEnumeratorPname:
272
    case ToIndexString:
272
    case ToIndexString:
273
    case PhantomNewObject:
274
    case PutByOffsetHint:
275
    case CheckStructureImmediate:
276
    case PutStructureHint:
277
    case MaterializeNewObject:
273
        return true;
278
        return true;
274
279
275
    case NativeCall:
280
    case NativeCall:
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp +5 lines
Lines 4912-4917 void SpeculativeJIT::compile(Node* node) Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp_sec1
4912
    case NativeConstruct:
4912
    case NativeConstruct:
4913
    case CheckBadCell:
4913
    case CheckBadCell:
4914
    case BottomValue:
4914
    case BottomValue:
4915
    case PhantomNewObject:
4916
    case PutByOffsetHint:
4917
    case CheckStructureImmediate:
4918
    case PutStructureHint:
4919
    case MaterializeNewObject:
4915
        RELEASE_ASSERT_NOT_REACHED();
4920
        RELEASE_ASSERT_NOT_REACHED();
4916
        break;
4921
        break;
4917
    }
4922
    }
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp +5 lines
Lines 4982-4987 void SpeculativeJIT::compile(Node* node) Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp_sec1
4982
    case FiatInt52:
4982
    case FiatInt52:
4983
    case CheckBadCell:
4983
    case CheckBadCell:
4984
    case BottomValue:
4984
    case BottomValue:
4985
    case PhantomNewObject:
4986
    case PutByOffsetHint:
4987
    case CheckStructureImmediate:
4988
    case PutStructureHint:
4989
    case MaterializeNewObject:
4985
        DFG_CRASH(m_jit.graph(), node, "Unexpected node");
4990
        DFG_CRASH(m_jit.graph(), node, "Unexpected node");
4986
        break;
4991
        break;
4987
    }
4992
    }
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp -3 / +2 lines
Lines 1415-1421 void SpeculativeJIT::compileCurrentBlock Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec1
1415
        else
1415
        else
1416
            m_canExit = mayExit(m_jit.graph(), m_currentNode);
1416
            m_canExit = mayExit(m_jit.graph(), m_currentNode);
1417
        
1417
        
1418
        bool shouldExecuteEffects = m_interpreter.startExecuting(m_currentNode);
1418
        m_interpreter.startExecuting();
1419
        m_jit.setForNode(m_currentNode);
1419
        m_jit.setForNode(m_currentNode);
1420
        m_codeOriginForExitTarget = m_currentNode->origin.forExit;
1420
        m_codeOriginForExitTarget = m_currentNode->origin.forExit;
1421
        m_codeOriginForExitProfile = m_currentNode->origin.semantic;
1421
        m_codeOriginForExitProfile = m_currentNode->origin.semantic;
Lines 1472-1479 void SpeculativeJIT::compileCurrentBlock Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec2
1472
        }
1472
        }
1473
        
1473
        
1474
        // Make sure that the abstract state is rematerialized for the next node.
1474
        // Make sure that the abstract state is rematerialized for the next node.
1475
        if (shouldExecuteEffects)
1475
        m_interpreter.executeEffects(m_indexInBlock);
1476
            m_interpreter.executeEffects(m_indexInBlock);
1477
    }
1476
    }
1478
    
1477
    
1479
    // Perform the most basic verification that children have been used correctly.
1478
    // Perform the most basic verification that children have been used correctly.
- Source/JavaScriptCore/dfg/DFGStructureRegistrationPhase.cpp +1 lines
Lines 47-52 public: Source/JavaScriptCore/dfg/DFGStructureRegistrationPhase.cpp_sec1
47
        // These are pretty dumb, but needed to placate subsequent assertions. We don't actually
47
        // These are pretty dumb, but needed to placate subsequent assertions. We don't actually
48
        // have to watch these because there is no way to transition away from it, but they are
48
        // have to watch these because there is no way to transition away from it, but they are
49
        // watchable and so we will assert if they aren't watched.
49
        // watchable and so we will assert if they aren't watched.
50
        registerStructure(m_graph.m_vm.structureStructure.get());
50
        registerStructure(m_graph.m_vm.stringStructure.get());
51
        registerStructure(m_graph.m_vm.stringStructure.get());
51
        registerStructure(m_graph.m_vm.getterSetterStructure.get());
52
        registerStructure(m_graph.m_vm.getterSetterStructure.get());
52
        
53
        
- Source/JavaScriptCore/dfg/DFGValidate.cpp -2 lines
Lines 187-194 public: Source/JavaScriptCore/dfg/DFGValidate.cpp_sec1
187
                Node* node = block->node(i);
187
                Node* node = block->node(i);
188
                if (m_graph.m_refCountState == ExactRefCount)
188
                if (m_graph.m_refCountState == ExactRefCount)
189
                    V_EQUAL((node), m_myRefCounts.get(node), node->adjustedRefCount());
189
                    V_EQUAL((node), m_myRefCounts.get(node), node->adjustedRefCount());
190
                else
191
                    V_EQUAL((node), node->refCount(), 1);
192
            }
190
            }
193
            
191
            
194
            for (size_t i = 0 ; i < block->size() - 1; ++i) {
192
            for (size_t i = 0 ; i < block->size() - 1; ++i) {
- Source/JavaScriptCore/ftl/FTLCapabilities.cpp +5 lines
Lines 168-173 inline CapabilityLevel canCompile(Node* Source/JavaScriptCore/ftl/FTLCapabilities.cpp_sec1
168
    case GetEnumeratorPname:
168
    case GetEnumeratorPname:
169
    case ToIndexString:
169
    case ToIndexString:
170
    case BottomValue:
170
    case BottomValue:
171
    case PhantomNewObject:
172
    case PutByOffsetHint:
173
    case CheckStructureImmediate:
174
    case PutStructureHint:
175
    case MaterializeNewObject:
171
        // These are OK.
176
        // These are OK.
172
        break;
177
        break;
173
    case ProfiledCall:
178
    case ProfiledCall:
- Source/JavaScriptCore/ftl/FTLExitPropertyValue.cpp +41 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitPropertyValue.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "FTLExitPropertyValue.h"
28
29
#if ENABLE(FTL_JIT)
30
31
namespace JSC { namespace FTL {
32
33
void ExitPropertyValue::dump(PrintStream& out) const
34
{
35
    out.print(m_location, " => ", m_value);
36
}
37
38
} } // namespace JSC::FTL
39
40
#endif // ENABLE(FTL_JIT)
41
- Source/JavaScriptCore/ftl/FTLExitPropertyValue.h +66 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitPropertyValue.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef FTLExitPropertyValue_h
27
#define FTLExitPropertyValue_h
28
29
#if ENABLE(FTL_JIT)
30
31
#include "DFGPromotedHeapLocation.h"
32
#include "FTLExitValue.h"
33
34
namespace JSC { namespace FTL {
35
36
class ExitPropertyValue {
37
public:
38
    ExitPropertyValue()
39
    {
40
    }
41
    
42
    ExitPropertyValue(DFG::PromotedLocationDescriptor location, const ExitValue& value)
43
        : m_location(location)
44
        , m_value(value)
45
    {
46
        ASSERT(!!location == !!value);
47
    }
48
    
49
    bool operator!() const { return !m_location; }
50
    
51
    DFG::PromotedLocationDescriptor location() const { return m_location; }
52
    const ExitValue& value() const { return m_value; }
53
    
54
    void dump(PrintStream& out) const;
55
56
private:
57
    DFG::PromotedLocationDescriptor m_location;
58
    ExitValue m_value;
59
};
60
61
} } // namespace JSC::FTL
62
63
#endif // ENABLE(FTL_JIT)
64
65
#endif // FTLExitPropertyValue_h
66
- Source/JavaScriptCore/ftl/FTLExitTimeObjectMaterialization.cpp +69 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitTimeObjectMaterialization.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "FTLExitTimeObjectMaterialization.h"
28
29
#if ENABLE(FTL_JIT)
30
31
#include "DFGGraph.h"
32
33
namespace JSC { namespace FTL {
34
35
using namespace JSC::DFG;
36
37
ExitTimeObjectMaterialization::ExitTimeObjectMaterialization(NodeType type)
38
    : m_type(type)
39
{
40
}
41
42
ExitTimeObjectMaterialization::~ExitTimeObjectMaterialization()
43
{
44
}
45
46
void ExitTimeObjectMaterialization::add(
47
    PromotedLocationDescriptor location, const ExitValue& value)
48
{
49
    m_properties.append(ExitPropertyValue(location, value));
50
}
51
52
ExitValue ExitTimeObjectMaterialization::get(PromotedLocationDescriptor location) const
53
{
54
    for (ExitPropertyValue value : m_properties) {
55
        if (value.location() == location)
56
            return value.value();
57
    }
58
    return ExitValue();
59
}
60
61
void ExitTimeObjectMaterialization::dump(PrintStream& out) const
62
{
63
    out.print(RawPointer(this), ":", Graph::opName(m_type), "(", listDump(m_properties), ")");
64
}
65
66
} } // namespace JSC::FTL
67
68
#endif // ENABLE(FTL_JIT)
69
- Source/JavaScriptCore/ftl/FTLExitTimeObjectMaterialization.h +63 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitTimeObjectMaterialization.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef FTLExitTimeObjectMaterialization_h
27
#define FTLExitTimeObjectMaterialization_h
28
29
#if ENABLE(FTL_JIT)
30
31
#include "DFGNodeType.h"
32
#include "FTLExitPropertyValue.h"
33
#include "FTLExitValue.h"
34
#include <wtf/Noncopyable.h>
35
36
namespace JSC { namespace FTL {
37
38
class ExitTimeObjectMaterialization {
39
    WTF_MAKE_NONCOPYABLE(ExitTimeObjectMaterialization)
40
public:
41
    ExitTimeObjectMaterialization(DFG::NodeType);
42
    ~ExitTimeObjectMaterialization();
43
    
44
    void add(DFG::PromotedLocationDescriptor, const ExitValue&);
45
    
46
    DFG::NodeType type() const { return m_type; }
47
    
48
    ExitValue get(DFG::PromotedLocationDescriptor) const;
49
    const Vector<ExitPropertyValue>& properties() const { return m_properties; }
50
    
51
    void dump(PrintStream& out) const;
52
    
53
private:
54
    DFG::NodeType m_type;
55
    Vector<ExitPropertyValue> m_properties;
56
};
57
58
} } // namespace JSC::FTL
59
60
#endif // ENABLE(FTL_JIT)
61
62
#endif // FTLExitTimeObjectMaterialization_h
63
- Source/JavaScriptCore/ftl/FTLExitValue.cpp +12 lines
Lines 28-37 Source/JavaScriptCore/ftl/FTLExitValue.cpp_sec1
28
28
29
#if ENABLE(FTL_JIT)
29
#if ENABLE(FTL_JIT)
30
30
31
#include "FTLExitTimeObjectMaterialization.h"
31
#include "JSCInlines.h"
32
#include "JSCInlines.h"
32
33
33
namespace JSC { namespace FTL {
34
namespace JSC { namespace FTL {
34
35
36
ExitValue ExitValue::materializeNewObject(ExitTimeObjectMaterialization* data)
37
{
38
    ExitValue result;
39
    result.m_kind = ExitValueMaterializeNewObject;
40
    result.u.newObjectMaterializationData = data;
41
    return result;
42
}
43
35
void ExitValue::dumpInContext(PrintStream& out, DumpContext* context) const
44
void ExitValue::dumpInContext(PrintStream& out, DumpContext* context) const
36
{
45
{
37
    switch (kind()) {
46
    switch (kind()) {
Lines 65-70 void ExitValue::dumpInContext(PrintStrea Source/JavaScriptCore/ftl/FTLExitValue.cpp_sec2
65
    case ExitValueRecovery:
74
    case ExitValueRecovery:
66
        out.print("Recovery(", recoveryOpcode(), ", arg", leftRecoveryArgument(), ", arg", rightRecoveryArgument(), ", ", recoveryFormat(), ")");
75
        out.print("Recovery(", recoveryOpcode(), ", arg", leftRecoveryArgument(), ", arg", rightRecoveryArgument(), ", ", recoveryFormat(), ")");
67
        return;
76
        return;
77
    case ExitValueMaterializeNewObject:
78
        out.print("Materialize(", pointerDump(objectMaterialization()), ")");
79
        return;
68
    }
80
    }
69
    
81
    
70
    RELEASE_ASSERT_NOT_REACHED();
82
    RELEASE_ASSERT_NOT_REACHED();
- Source/JavaScriptCore/ftl/FTLExitValue.h -3 / +17 lines
Lines 52-60 enum ExitValueKind { Source/JavaScriptCore/ftl/FTLExitValue.h_sec1
52
    ExitValueInJSStackAsInt52,
52
    ExitValueInJSStackAsInt52,
53
    ExitValueInJSStackAsDouble,
53
    ExitValueInJSStackAsDouble,
54
    ExitValueArgumentsObjectThatWasNotCreated,
54
    ExitValueArgumentsObjectThatWasNotCreated,
55
    ExitValueRecovery
55
    ExitValueRecovery,
56
    ExitValueMaterializeNewObject
56
};
57
};
57
58
59
class ExitTimeObjectMaterialization;
60
58
class ExitValue {
61
class ExitValue {
59
public:
62
public:
60
    ExitValue()
63
    ExitValue()
Lines 137-142 public: Source/JavaScriptCore/ftl/FTLExitValue.h_sec2
137
        return result;
140
        return result;
138
    }
141
    }
139
    
142
    
143
    static ExitValue materializeNewObject(ExitTimeObjectMaterialization*);
144
    
140
    ExitValueKind kind() const { return m_kind; }
145
    ExitValueKind kind() const { return m_kind; }
141
    
146
    
142
    bool isDead() const { return kind() == ExitValueDead; }
147
    bool isDead() const { return kind() == ExitValueDead; }
Lines 156-161 public: Source/JavaScriptCore/ftl/FTLExitValue.h_sec3
156
    bool isArgument() const { return kind() == ExitValueArgument; }
161
    bool isArgument() const { return kind() == ExitValueArgument; }
157
    bool isArgumentsObjectThatWasNotCreated() const { return kind() == ExitValueArgumentsObjectThatWasNotCreated; }
162
    bool isArgumentsObjectThatWasNotCreated() const { return kind() == ExitValueArgumentsObjectThatWasNotCreated; }
158
    bool isRecovery() const { return kind() == ExitValueRecovery; }
163
    bool isRecovery() const { return kind() == ExitValueRecovery; }
164
    bool isObjectMaterialization() const { return kind() == ExitValueMaterializeNewObject; }
159
    
165
    
160
    ExitArgument exitArgument() const
166
    ExitArgument exitArgument() const
161
    {
167
    {
Lines 199-205 public: Source/JavaScriptCore/ftl/FTLExitValue.h_sec4
199
        return VirtualRegister(u.virtualRegister);
205
        return VirtualRegister(u.virtualRegister);
200
    }
206
    }
201
    
207
    
202
    ExitValue withVirtualRegister(VirtualRegister virtualRegister)
208
    ExitTimeObjectMaterialization* objectMaterialization() const
209
    {
210
        ASSERT(isObjectMaterialization());
211
        return u.newObjectMaterializationData;
212
    }
213
214
    ExitValue withVirtualRegister(VirtualRegister virtualRegister) const
203
    {
215
    {
204
        ASSERT(isInJSStackSomehow());
216
        ASSERT(isInJSStackSomehow());
205
        ExitValue result;
217
        ExitValue result;
Lines 207-213 public: Source/JavaScriptCore/ftl/FTLExitValue.h_sec5
207
        result.u.virtualRegister = virtualRegister.offset();
219
        result.u.virtualRegister = virtualRegister.offset();
208
        return result;
220
        return result;
209
    }
221
    }
210
222
    
211
    // If it's in the JSStack somehow, this will tell you what format it's in, in a manner
223
    // If it's in the JSStack somehow, this will tell you what format it's in, in a manner
212
    // that is compatible with exitArgument().format(). If it's a constant or it's dead, it
224
    // that is compatible with exitArgument().format(). If it's a constant or it's dead, it
213
    // will claim to be a JSValue. If it's an argument then it will tell you the argument's
225
    // will claim to be a JSValue. If it's an argument then it will tell you the argument's
Lines 223-228 public: Source/JavaScriptCore/ftl/FTLExitValue.h_sec6
223
        case ExitValueConstant:
235
        case ExitValueConstant:
224
        case ExitValueInJSStack:
236
        case ExitValueInJSStack:
225
        case ExitValueArgumentsObjectThatWasNotCreated:
237
        case ExitValueArgumentsObjectThatWasNotCreated:
238
        case ExitValueMaterializeNewObject:
226
            return ValueFormatJSValue;
239
            return ValueFormatJSValue;
227
            
240
            
228
        case ExitValueArgument:
241
        case ExitValueArgument:
Lines 260-265 private: Source/JavaScriptCore/ftl/FTLExitValue.h_sec7
260
            uint16_t opcode;
273
            uint16_t opcode;
261
            uint16_t format;
274
            uint16_t format;
262
        } recovery;
275
        } recovery;
276
        ExitTimeObjectMaterialization* newObjectMaterializationData;
263
    } u;
277
    } u;
264
};
278
};
265
279
- Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp -114 / +307 lines
Lines 38-43 Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec1
38
#include "FTLFormattedValue.h"
38
#include "FTLFormattedValue.h"
39
#include "FTLInlineCacheSize.h"
39
#include "FTLInlineCacheSize.h"
40
#include "FTLLoweredNodeValue.h"
40
#include "FTLLoweredNodeValue.h"
41
#include "FTLOperations.h"
41
#include "FTLOutput.h"
42
#include "FTLOutput.h"
42
#include "FTLThunks.h"
43
#include "FTLThunks.h"
43
#include "FTLWeightedTarget.h"
44
#include "FTLWeightedTarget.h"
Lines 341-347 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec2
341
        
342
        
342
        m_availableRecoveries.resize(0);
343
        m_availableRecoveries.resize(0);
343
        
344
        
344
        bool shouldExecuteEffects = m_interpreter.startExecuting(m_node);
345
        m_interpreter.startExecuting();
345
        
346
        
346
        switch (m_node->op()) {
347
        switch (m_node->op()) {
347
        case Upsilon:
348
        case Upsilon:
Lines 725-730 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec3
725
        case ToIndexString:
726
        case ToIndexString:
726
            compileToIndexString();
727
            compileToIndexString();
727
            break;
728
            break;
729
        case CheckStructureImmediate:
730
            compileCheckStructureImmediate();
731
            break;
732
        case MaterializeNewObject:
733
            compileMaterializeNewObject();
734
            break;
728
735
729
        case PhantomLocal:
736
        case PhantomLocal:
730
        case SetArgument:
737
        case SetArgument:
Lines 735-740 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec4
735
        case AllocationProfileWatchpoint:
742
        case AllocationProfileWatchpoint:
736
        case MovHint:
743
        case MovHint:
737
        case ZombieHint:
744
        case ZombieHint:
745
        case PhantomNewObject:
746
        case PutByOffsetHint:
747
        case PutStructureHint:
748
        case BottomValue:
738
            break;
749
            break;
739
        default:
750
        default:
740
            DFG_CRASH(m_graph, m_node, "Unrecognized node in FTL backend");
751
            DFG_CRASH(m_graph, m_node, "Unrecognized node in FTL backend");
Lines 742-750 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec5
742
        }
753
        }
743
        
754
        
744
        m_availabilityCalculator.executeNode(m_node);
755
        m_availabilityCalculator.executeNode(m_node);
745
        
756
        m_interpreter.executeEffects(nodeIndex);
746
        if (shouldExecuteEffects)
747
            m_interpreter.executeEffects(nodeIndex);
748
        
757
        
749
        return true;
758
        return true;
750
    }
759
    }
Lines 1704-1733 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec6
1704
        
1713
        
1705
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
1714
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
1706
        
1715
        
1707
        if (m_node->structureSet().size() == 1) {
1716
        checkStructure(structureID, jsValueValue(cell), exitKind, m_node->structureSet());
1708
            speculate(
1709
                exitKind, jsValueValue(cell), 0,
1710
                m_out.notEqual(structureID, weakStructure(m_node->structureSet()[0])));
1711
            return;
1712
        }
1713
        
1714
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CheckStructure continuation"));
1715
        
1716
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
1717
        for (unsigned i = 0; i < m_node->structureSet().size() - 1; ++i) {
1718
            LBasicBlock nextStructure = FTL_NEW_BLOCK(m_out, ("CheckStructure nextStructure"));
1719
            m_out.branch(
1720
                m_out.equal(structureID, weakStructure(m_node->structureSet()[i])),
1721
                unsure(continuation), unsure(nextStructure));
1722
            m_out.appendTo(nextStructure);
1723
        }
1724
        
1725
        speculate(
1726
            exitKind, jsValueValue(cell), 0,
1727
            m_out.notEqual(structureID, weakStructure(m_node->structureSet().last())));
1728
        
1729
        m_out.jump(continuation);
1730
        m_out.appendTo(continuation, lastNext);
1731
    }
1717
    }
1732
    
1718
    
1733
    void compileCheckCell()
1719
    void compileCheckCell()
Lines 1762-1768 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec7
1762
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
1748
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
1763
        
1749
        
1764
        m_out.branch(
1750
        m_out.branch(
1765
            m_out.notEqual(structureID, weakStructure(m_node->structure())),
1751
            m_out.notEqual(structureID, weakStructureID(m_node->structure())),
1766
            rarely(unexpectedStructure), usually(continuation));
1752
            rarely(unexpectedStructure), usually(continuation));
1767
        
1753
        
1768
        LBasicBlock lastNext = m_out.appendTo(unexpectedStructure, continuation);
1754
        LBasicBlock lastNext = m_out.appendTo(unexpectedStructure, continuation);
Lines 1806-1812 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec8
1806
        structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
1792
        structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
1807
        speculate(
1793
        speculate(
1808
            BadIndexingType, jsValueValue(cell), 0,
1794
            BadIndexingType, jsValueValue(cell), 0,
1809
            m_out.notEqual(structureID, weakStructure(m_node->structure())));
1795
            m_out.notEqual(structureID, weakStructureID(m_node->structure())));
1810
        m_out.jump(continuation);
1796
        m_out.jump(continuation);
1811
        
1797
        
1812
        m_out.appendTo(continuation, lastNext);
1798
        m_out.appendTo(continuation, lastNext);
Lines 1824-1830 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec9
1824
1810
1825
        LValue cell = lowCell(m_node->child1()); 
1811
        LValue cell = lowCell(m_node->child1()); 
1826
        m_out.store32(
1812
        m_out.store32(
1827
            weakStructure(newStructure),
1813
            weakStructureID(newStructure),
1828
            cell, m_heaps.JSCell_structureID);
1814
            cell, m_heaps.JSCell_structureID);
1829
    }
1815
    }
1830
    
1816
    
Lines 2649-2676 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec10
2649
    
2635
    
2650
    void compileNewObject()
2636
    void compileNewObject()
2651
    {
2637
    {
2652
        Structure* structure = m_node->structure();
2638
        setJSValue(allocateObject(m_node->structure()));
2653
        size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
2654
        MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
2655
        
2656
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("NewObject slow path"));
2657
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewObject continuation"));
2658
        
2659
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
2660
        
2661
        ValueFromBlock fastResult = m_out.anchor(allocateObject(
2662
            m_out.constIntPtr(allocator), structure, m_out.intPtrZero, slowPath));
2663
        
2664
        m_out.jump(continuation);
2665
        
2666
        m_out.appendTo(slowPath, continuation);
2667
        
2668
        ValueFromBlock slowResult = m_out.anchor(vmCall(
2669
            m_out.operation(operationNewObject), m_callFrame, m_out.constIntPtr(structure)));
2670
        m_out.jump(continuation);
2671
        
2672
        m_out.appendTo(continuation, lastNext);
2673
        setJSValue(m_out.phi(m_out.intPtr, fastResult, slowResult));
2674
    }
2639
    }
2675
    
2640
    
2676
    void compileNewArray()
2641
    void compileNewArray()
Lines 3290-3296 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec11
3290
            GetByIdVariant variant = data.variants[i];
3255
            GetByIdVariant variant = data.variants[i];
3291
            for (unsigned j = variant.structureSet().size(); j--;) {
3256
            for (unsigned j = variant.structureSet().size(); j--;) {
3292
                cases.append(SwitchCase(
3257
                cases.append(SwitchCase(
3293
                    weakStructure(variant.structureSet()[j]), blocks[i], Weight(1)));
3258
                    weakStructureID(variant.structureSet()[j]), blocks[i], Weight(1)));
3294
            }
3259
            }
3295
        }
3260
        }
3296
        m_out.switchInstruction(
3261
        m_out.switchInstruction(
Lines 3361-3367 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec12
3361
            PutByIdVariant variant = data.variants[i];
3326
            PutByIdVariant variant = data.variants[i];
3362
            for (unsigned j = variant.oldStructure().size(); j--;) {
3327
            for (unsigned j = variant.oldStructure().size(); j--;) {
3363
                cases.append(
3328
                cases.append(
3364
                    SwitchCase(weakStructure(variant.oldStructure()[j]), blocks[i], Weight(1)));
3329
                    SwitchCase(weakStructureID(variant.oldStructure()[j]), blocks[i], Weight(1)));
3365
            }
3330
            }
3366
        }
3331
        }
3367
        m_out.switchInstruction(
3332
        m_out.switchInstruction(
Lines 3370-3376 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec13
3370
        LBasicBlock lastNext = m_out.m_nextBlock;
3335
        LBasicBlock lastNext = m_out.m_nextBlock;
3371
        
3336
        
3372
        for (unsigned i = data.variants.size(); i--;) {
3337
        for (unsigned i = data.variants.size(); i--;) {
3373
            m_out.appendTo(blocks[i], i  + 1 < data.variants.size() ? blocks[i + 1] : exit);
3338
            m_out.appendTo(blocks[i], i + 1 < data.variants.size() ? blocks[i + 1] : exit);
3374
            
3339
            
3375
            PutByIdVariant variant = data.variants[i];
3340
            PutByIdVariant variant = data.variants[i];
3376
            
3341
            
Lines 3393-3399 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec14
3393
                ASSERT(variant.oldStructureForTransition()->typeInfo().inlineTypeFlags() == variant.newStructure()->typeInfo().inlineTypeFlags());
3358
                ASSERT(variant.oldStructureForTransition()->typeInfo().inlineTypeFlags() == variant.newStructure()->typeInfo().inlineTypeFlags());
3394
                ASSERT(variant.oldStructureForTransition()->typeInfo().type() == variant.newStructure()->typeInfo().type());
3359
                ASSERT(variant.oldStructureForTransition()->typeInfo().type() == variant.newStructure()->typeInfo().type());
3395
                m_out.store32(
3360
                m_out.store32(
3396
                    weakStructure(variant.newStructure()), base, m_heaps.JSCell_structureID);
3361
                    weakStructureID(variant.newStructure()), base, m_heaps.JSCell_structureID);
3397
            }
3362
            }
3398
            
3363
            
3399
            storeProperty(value, storage, data.identifierNumber, variant.offset());
3364
            storeProperty(value, storage, data.identifierNumber, variant.offset());
Lines 3953-3964 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec15
3953
    void compileInvalidationPoint()
3918
    void compileInvalidationPoint()
3954
    {
3919
    {
3955
        if (verboseCompilationEnabled())
3920
        if (verboseCompilationEnabled())
3956
            dataLog("    Invalidation point with availability: ", availability(), "\n");
3921
            dataLog("    Invalidation point with availability: ", availabilityMap(), "\n");
3957
        
3922
        
3958
        m_ftlState.jitCode->osrExit.append(OSRExit(
3923
        m_ftlState.jitCode->osrExit.append(OSRExit(
3959
            UncountableInvalidation, InvalidValueFormat, MethodOfGettingAValueProfile(),
3924
            UncountableInvalidation, InvalidValueFormat, MethodOfGettingAValueProfile(),
3960
            m_codeOriginForExitTarget, m_codeOriginForExitProfile,
3925
            m_codeOriginForExitTarget, m_codeOriginForExitProfile,
3961
            availability().numberOfArguments(), availability().numberOfLocals()));
3926
            availabilityMap().m_locals.numberOfArguments(),
3927
            availabilityMap().m_locals.numberOfLocals()));
3962
        m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo());
3928
        m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo());
3963
        
3929
        
3964
        OSRExit& exit = m_ftlState.jitCode->osrExit.last();
3930
        OSRExit& exit = m_ftlState.jitCode->osrExit.last();
Lines 4360-4365 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec16
4360
        LValue index = lowInt32(m_node->child1());
4326
        LValue index = lowInt32(m_node->child1());
4361
        setJSValue(vmCall(m_out.operation(operationToIndexString), m_callFrame, index));
4327
        setJSValue(vmCall(m_out.operation(operationToIndexString), m_callFrame, index));
4362
    }
4328
    }
4329
    
4330
    void compileCheckStructureImmediate()
4331
    {
4332
        LValue structureID = lowCell(m_node->child1());
4333
        checkStructure(structureID, noValue(), BadCache, m_node->structureSet());
4334
    }
4335
    
4336
    void compileMaterializeNewObject()
4337
    {
4338
        ObjectMaterializationData& data = m_node->objectMaterializationData();
4339
        
4340
        // Lower the values first, to avoid creating values inside a control flow diamond.
4341
        
4342
        Vector<LValue, 8> values;
4343
        for (unsigned i = 0; i < data.m_properties.size(); ++i)
4344
            values.append(lowJSValue(m_graph.varArgChild(m_node, 1 + i)));
4345
        
4346
        StructureSet set;
4347
        m_interpreter.phiChildren()->forAllTransitiveIncomingValues(
4348
            m_graph.varArgChild(m_node, 0).node(),
4349
            [&] (Node* incoming) {
4350
                set.add(incoming->castConstant<Structure*>());
4351
            });
4352
        
4353
        Vector<LBasicBlock, 1> blocks(set.size());
4354
        for (unsigned i = set.size(); i--;)
4355
            blocks[i] = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject case ", i));
4356
        LBasicBlock dummyDefault = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject default case"));
4357
        LBasicBlock outerContinuation = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject continuation"));
4358
        
4359
        Vector<SwitchCase, 1> cases(set.size());
4360
        for (unsigned i = set.size(); i--;)
4361
            cases[i] = SwitchCase(weakStructure(set[i]), blocks[i], Weight(1));
4362
        m_out.switchInstruction(
4363
            lowCell(m_graph.varArgChild(m_node, 0)), cases, dummyDefault, Weight(0));
4364
        
4365
        LBasicBlock outerLastNext = m_out.m_nextBlock;
4366
        
4367
        Vector<ValueFromBlock, 1> results;
4368
        
4369
        for (unsigned i = set.size(); i--;) {
4370
            m_out.appendTo(blocks[i], i + 1 < set.size() ? blocks[i + 1] : dummyDefault);
4371
            
4372
            Structure* structure = set[i];
4373
            
4374
            LValue object;
4375
            LValue butterfly;
4376
            
4377
            if (structure->outOfLineCapacity()) {
4378
                size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
4379
                MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
4380
                
4381
                LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject complex object allocation slow path"));
4382
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject complex object allocation continuation"));
4383
                
4384
                LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
4385
                
4386
                LValue endOfStorage = allocateBasicStorageAndGetEnd(
4387
                    m_out.constIntPtr(structure->outOfLineCapacity() * sizeof(JSValue)),
4388
                    slowPath);
4389
                
4390
                LValue fastButterflyValue = m_out.add(
4391
                    m_out.constIntPtr(sizeof(IndexingHeader)), endOfStorage);
4392
                
4393
                LValue fastObjectValue = allocateObject(
4394
                    m_out.constIntPtr(allocator), structure, fastButterflyValue, slowPath);
4395
4396
                ValueFromBlock fastObject = m_out.anchor(fastObjectValue);
4397
                ValueFromBlock fastButterfly = m_out.anchor(fastButterflyValue);
4398
                m_out.jump(continuation);
4399
                
4400
                m_out.appendTo(slowPath, continuation);
4401
                
4402
                ValueFromBlock slowObject = m_out.anchor(vmCall(
4403
                    m_out.operation(operationNewObjectWithButterfly),
4404
                    m_callFrame, m_out.constIntPtr(structure)));
4405
                ValueFromBlock slowButterfly = m_out.anchor(
4406
                    m_out.loadPtr(slowObject.value(), m_heaps.JSObject_butterfly));
4407
                
4408
                m_out.jump(continuation);
4409
                
4410
                m_out.appendTo(continuation, lastNext);
4411
                
4412
                object = m_out.phi(m_out.intPtr, fastObject, slowObject);
4413
                butterfly = m_out.phi(m_out.intPtr, fastButterfly, slowButterfly);
4414
            } else {
4415
                // In the easy case where we can do a one-shot allocation, we simply allocate the
4416
                // object to directly have the desired structure.
4417
                object = allocateObject(structure);
4418
                butterfly = nullptr; // Don't have one, don't need one.
4419
            }
4420
            
4421
            for (PropertyMapEntry entry : structure->getPropertiesConcurrently()) {
4422
                for (unsigned i = data.m_properties.size(); i--;) {
4423
                    PhantomPropertyValue value = data.m_properties[i];
4424
                    if (m_graph.identifiers()[value.m_identifierNumber] != entry.key)
4425
                        continue;
4426
                    
4427
                    LValue base = isInlineOffset(entry.offset) ? object : butterfly;
4428
                    storeProperty(values[i], base, value.m_identifierNumber, entry.offset);
4429
                    break;
4430
                }
4431
            }
4432
            
4433
            results.append(m_out.anchor(object));
4434
            m_out.jump(outerContinuation);
4435
        }
4436
        
4437
        m_out.appendTo(dummyDefault, outerContinuation);
4438
        m_out.unreachable();
4439
        
4440
        m_out.appendTo(outerContinuation, outerLastNext);
4441
        setJSValue(m_out.phi(m_out.intPtr, results));
4442
    }
4363
4443
4364
#if ENABLE(FTL_NATIVE_CALL_INLINING)
4444
#if ENABLE(FTL_NATIVE_CALL_INLINING)
4365
    LValue getFunctionBySymbol(const CString symbol)
4445
    LValue getFunctionBySymbol(const CString symbol)
Lines 4525-4530 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec17
4525
        return m_out.booleanFalse;
4605
        return m_out.booleanFalse;
4526
    }
4606
    }
4527
    
4607
    
4608
    void checkStructure(
4609
        LValue structureID, const FormattedValue& formattedValue, ExitKind exitKind,
4610
        const StructureSet& set)
4611
    {
4612
        if (set.size() == 1) {
4613
            speculate(
4614
                exitKind, formattedValue, 0,
4615
                m_out.notEqual(structureID, weakStructureID(set[0])));
4616
            return;
4617
        }
4618
        
4619
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("checkStructure continuation"));
4620
        
4621
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
4622
        for (unsigned i = 0; i < set.size() - 1; ++i) {
4623
            LBasicBlock nextStructure = FTL_NEW_BLOCK(m_out, ("checkStructure nextStructure"));
4624
            m_out.branch(
4625
                m_out.equal(structureID, weakStructureID(set[i])),
4626
                unsure(continuation), unsure(nextStructure));
4627
            m_out.appendTo(nextStructure);
4628
        }
4629
        
4630
        speculate(
4631
            exitKind, formattedValue, 0,
4632
            m_out.notEqual(structureID, weakStructureID(set.last())));
4633
        
4634
        m_out.jump(continuation);
4635
        m_out.appendTo(continuation, lastNext);
4636
    }
4637
    
4528
    LValue numberOrNotCellToInt32(Edge edge, LValue value)
4638
    LValue numberOrNotCellToInt32(Edge edge, LValue value)
4529
    {
4639
    {
4530
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 int case"));
4640
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 int case"));
Lines 4831-4837 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec18
4831
        setBoolean(m_out.phi(m_out.boolean, fastResult, slowResult));
4941
        setBoolean(m_out.phi(m_out.boolean, fastResult, slowResult));
4832
    }
4942
    }
4833
4943
4834
    LValue allocateCell(LValue allocator, Structure* structure, LBasicBlock slowPath)
4944
    LValue allocateCell(LValue allocator, LBasicBlock slowPath)
4835
    {
4945
    {
4836
        LBasicBlock success = FTL_NEW_BLOCK(m_out, ("object allocation success"));
4946
        LBasicBlock success = FTL_NEW_BLOCK(m_out, ("object allocation success"));
4837
        
4947
        
Lines 4846-4857 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec19
4846
            m_out.loadPtr(result, m_heaps.JSCell_freeListNext),
4956
            m_out.loadPtr(result, m_heaps.JSCell_freeListNext),
4847
            allocator, m_heaps.MarkedAllocator_freeListHead);
4957
            allocator, m_heaps.MarkedAllocator_freeListHead);
4848
        
4958
        
4849
        m_out.store32(m_out.constInt32(structure->id()), result, m_heaps.JSCell_structureID);
4959
        return result;
4850
        
4960
    }
4961
    
4962
    void storeStructure(LValue object, Structure* structure)
4963
    {
4964
        m_out.store32(m_out.constInt32(structure->id()), object, m_heaps.JSCell_structureID);
4851
        m_out.store32(
4965
        m_out.store32(
4852
            m_out.constInt32(structure->objectInitializationBlob()),
4966
            m_out.constInt32(structure->objectInitializationBlob()),
4853
            result, m_heaps.JSCell_usefulBytes);
4967
            object, m_heaps.JSCell_usefulBytes);
4854
        
4968
    }
4969
4970
    LValue allocateCell(LValue allocator, Structure* structure, LBasicBlock slowPath)
4971
    {
4972
        LValue result = allocateCell(allocator, slowPath);
4973
        storeStructure(result, structure);
4855
        return result;
4974
        return result;
4856
    }
4975
    }
4857
4976
Lines 4898-4903 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec20
4898
            m_out.loadPtr(m_out.absolute(&allocator.m_currentPayloadEnd)), newRemaining);
5017
            m_out.loadPtr(m_out.absolute(&allocator.m_currentPayloadEnd)), newRemaining);
4899
    }
5018
    }
4900
    
5019
    
5020
    LValue allocateObject(Structure* structure)
5021
    {
5022
        size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
5023
        MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
5024
        
5025
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("allocateObject slow path"));
5026
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("allocateObject continuation"));
5027
        
5028
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
5029
        
5030
        ValueFromBlock fastResult = m_out.anchor(allocateObject(
5031
            m_out.constIntPtr(allocator), structure, m_out.intPtrZero, slowPath));
5032
        
5033
        m_out.jump(continuation);
5034
        
5035
        m_out.appendTo(slowPath, continuation);
5036
        
5037
        ValueFromBlock slowResult = m_out.anchor(vmCall(
5038
            m_out.operation(operationNewObject), m_callFrame, m_out.constIntPtr(structure)));
5039
        m_out.jump(continuation);
5040
        
5041
        m_out.appendTo(continuation, lastNext);
5042
        return m_out.phi(m_out.intPtr, fastResult, slowResult);
5043
    }
5044
    
4901
    struct ArrayValues {
5045
    struct ArrayValues {
4902
        ArrayValues()
5046
        ArrayValues()
4903
            : array(0)
5047
            : array(0)
Lines 6107-6113 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec21
6107
        
6251
        
6108
        speculate(
6252
        speculate(
6109
            NotStringObject, noValue(), 0,
6253
            NotStringObject, noValue(), 0,
6110
            m_out.notEqual(structureID, weakStructure(stringObjectStructure)));
6254
            m_out.notEqual(structureID, weakStructureID(stringObjectStructure)));
6111
    }
6255
    }
6112
    
6256
    
6113
    void speculateNonNullObject(Edge edge, LValue cell)
6257
    void speculateNonNullObject(Edge edge, LValue cell)
Lines 6334-6340 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec22
6334
        ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition)
6478
        ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition)
6335
    {
6479
    {
6336
        if (verboseCompilationEnabled()) {
6480
        if (verboseCompilationEnabled()) {
6337
            dataLog("    OSR exit #", m_ftlState.jitCode->osrExit.size(), " with availability: ", availability(), "\n");
6481
            dataLog("    OSR exit #", m_ftlState.jitCode->osrExit.size(), " with availability: ", availabilityMap(), "\n");
6338
            if (!m_availableRecoveries.isEmpty())
6482
            if (!m_availableRecoveries.isEmpty())
6339
                dataLog("        Available recoveries: ", listDump(m_availableRecoveries), "\n");
6483
                dataLog("        Available recoveries: ", listDump(m_availableRecoveries), "\n");
6340
        }
6484
        }
Lines 6344-6350 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec23
6344
        m_ftlState.jitCode->osrExit.append(OSRExit(
6488
        m_ftlState.jitCode->osrExit.append(OSRExit(
6345
            kind, lowValue.format(), m_graph.methodOfGettingAValueProfileFor(highValue),
6489
            kind, lowValue.format(), m_graph.methodOfGettingAValueProfileFor(highValue),
6346
            m_codeOriginForExitTarget, m_codeOriginForExitProfile,
6490
            m_codeOriginForExitTarget, m_codeOriginForExitProfile,
6347
            availability().numberOfArguments(), availability().numberOfLocals()));
6491
            availabilityMap().m_locals.numberOfArguments(),
6492
            availabilityMap().m_locals.numberOfLocals()));
6348
        m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo());
6493
        m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo());
6349
        
6494
        
6350
        OSRExit& exit = m_ftlState.jitCode->osrExit.last();
6495
        OSRExit& exit = m_ftlState.jitCode->osrExit.last();
Lines 6384-6439 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec24
6384
        if (!!lowValue)
6529
        if (!!lowValue)
6385
            arguments.append(lowValue.value());
6530
            arguments.append(lowValue.value());
6386
        
6531
        
6532
        AvailabilityMap availabilityMap = this->availabilityMap();
6533
        
6387
        for (unsigned i = 0; i < exit.m_values.size(); ++i) {
6534
        for (unsigned i = 0; i < exit.m_values.size(); ++i) {
6388
            int operand = exit.m_values.operandForIndex(i);
6535
            int operand = exit.m_values.operandForIndex(i);
6389
            bool isLive = m_graph.isLiveInBytecode(VirtualRegister(operand), codeOrigin);
6536
            bool isLive = m_graph.isLiveInBytecode(VirtualRegister(operand), codeOrigin);
6390
            if (!isLive) {
6537
            if (!isLive)
6391
                exit.m_values[i] = ExitValue::dead();
6538
                availabilityMap.m_locals[i] = Availability();
6392
                continue;
6539
        }
6393
            }
6540
        
6394
            
6541
        availabilityMap.prune();
6395
            Availability availability = this->availability()[i];
6542
        
6396
            FlushedAt flush = availability.flushedAt();
6543
        HashMap<Node*, ExitTimeObjectMaterialization*> map;
6397
            switch (flush.format()) {
6544
        availabilityMap.forEachAvailability(
6398
            case DeadFlush:
6545
            [&] (Availability availability) {
6399
            case ConflictingFlush:
6546
                if (!availability.shouldUseNode())
6400
                if (availability.hasNode()) {
6547
                    return;
6401
                    exit.m_values[i] = exitValueForNode(arguments, availability.node());
6402
                    break;
6403
                }
6404
                
6405
                if (Options::validateFTLOSRExitLiveness())
6406
                    DFG_CRASH(m_graph, m_node, toCString("Expected r", operand, " to be available but it wasn't.").data());
6407
                
6408
                // This means that the DFG's DCE proved that the value is dead in bytecode
6409
                // even though the bytecode liveness analysis thinks it's live. This is
6410
                // acceptable since the DFG's DCE is by design more aggressive while still
6411
                // being sound.
6412
                exit.m_values[i] = ExitValue::dead();
6413
                break;
6414
6415
            case FlushedJSValue:
6416
            case FlushedCell:
6417
            case FlushedBoolean:
6418
                exit.m_values[i] = ExitValue::inJSStack(flush.virtualRegister());
6419
                break;
6420
                
6421
            case FlushedInt32:
6422
                exit.m_values[i] = ExitValue::inJSStackAsInt32(flush.virtualRegister());
6423
                break;
6424
                
6425
            case FlushedInt52:
6426
                exit.m_values[i] = ExitValue::inJSStackAsInt52(flush.virtualRegister());
6427
                break;
6428
                
6548
                
6429
            case FlushedDouble:
6549
                Node* node = availability.node();
6430
                exit.m_values[i] = ExitValue::inJSStackAsDouble(flush.virtualRegister());
6550
                if (!node->isPhantomObjectAllocation())
6431
                break;
6551
                    return;
6432
                
6552
                
6433
            case FlushedArguments:
6553
                auto result = map.add(node, nullptr);
6434
                exit.m_values[i] = ExitValue::argumentsObjectThatWasNotCreated();
6554
                if (result.isNewEntry)
6435
                break;
6555
                    result.iterator->value = exit.m_materializations.add(node->op());
6556
            });
6557
        
6558
        for (unsigned i = 0; i < exit.m_values.size(); ++i) {
6559
            int operand = exit.m_values.operandForIndex(i);
6560
            
6561
            Availability availability = availabilityMap.m_locals[i];
6562
            
6563
            if (Options::validateFTLOSRExitLiveness()) {
6564
                DFG_ASSERT(
6565
                    m_graph, m_node,
6566
                    !(availability.isDead() && m_graph.isLiveInBytecode(VirtualRegister(operand), codeOrigin)));
6436
            }
6567
            }
6568
            
6569
            exit.m_values[i] = exitValueForAvailability(arguments, map, availability);
6570
        }
6571
        
6572
        for (auto heapPair : availabilityMap.m_heap) {
6573
            Node* node = heapPair.key.base();
6574
            ExitTimeObjectMaterialization* materialization = map.get(node);
6575
            materialization->add(
6576
                heapPair.key.descriptor(),
6577
                exitValueForAvailability(arguments, map, heapPair.value));
6437
        }
6578
        }
6438
        
6579
        
6439
        if (verboseCompilationEnabled())
6580
        if (verboseCompilationEnabled())
Lines 6449-6461 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec25
6449
        m_out.call(m_out.stackmapIntrinsic(), arguments);
6590
        m_out.call(m_out.stackmapIntrinsic(), arguments);
6450
    }
6591
    }
6451
    
6592
    
6452
    ExitValue exitValueForNode(ExitArgumentList& arguments, Node* node)
6593
    ExitValue exitValueForAvailability(
6594
        ExitArgumentList& arguments, const HashMap<Node*, ExitTimeObjectMaterialization*>& map,
6595
        Availability availability)
6596
    {
6597
        FlushedAt flush = availability.flushedAt();
6598
        switch (flush.format()) {
6599
        case DeadFlush:
6600
        case ConflictingFlush:
6601
            if (availability.hasNode())
6602
                return exitValueForNode(arguments, map, availability.node());
6603
            
6604
            // This means that the value is dead. It could be dead in bytecode or it could have
6605
            // been killed by our DCE, which can sometimes kill things even if they were live in
6606
            // bytecode.
6607
            return ExitValue::dead();
6608
6609
        case FlushedJSValue:
6610
        case FlushedCell:
6611
        case FlushedBoolean:
6612
            return ExitValue::inJSStack(flush.virtualRegister());
6613
                
6614
        case FlushedInt32:
6615
            return ExitValue::inJSStackAsInt32(flush.virtualRegister());
6616
                
6617
        case FlushedInt52:
6618
            return ExitValue::inJSStackAsInt52(flush.virtualRegister());
6619
                
6620
        case FlushedDouble:
6621
            return ExitValue::inJSStackAsDouble(flush.virtualRegister());
6622
                
6623
        case FlushedArguments:
6624
            return ExitValue::argumentsObjectThatWasNotCreated();
6625
        }
6626
        
6627
        DFG_CRASH(m_graph, m_node, "Invalid flush format");
6628
    }
6629
    
6630
    ExitValue exitValueForNode(
6631
        ExitArgumentList& arguments, const HashMap<Node*, ExitTimeObjectMaterialization*>& map,
6632
        Node* node)
6453
    {
6633
    {
6454
        ASSERT(node->shouldGenerate());
6634
        ASSERT(node->shouldGenerate());
6455
        ASSERT(node->hasResult());
6635
        ASSERT(node->hasResult());
6456
6636
6457
        if (node) {
6637
        if (node) {
6458
            switch (node->op()) {
6638
            switch (node->op()) {
6639
            case BottomValue:
6640
                // This might arise in object materializations. I actually doubt that it would,
6641
                // but it seems worthwhile to be conservative.
6642
                return ExitValue::dead();
6643
                
6459
            case JSConstant:
6644
            case JSConstant:
6460
            case Int52Constant:
6645
            case Int52Constant:
6461
            case DoubleConstant:
6646
            case DoubleConstant:
Lines 6464-6469 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec26
6464
            case PhantomArguments:
6649
            case PhantomArguments:
6465
                return ExitValue::argumentsObjectThatWasNotCreated();
6650
                return ExitValue::argumentsObjectThatWasNotCreated();
6466
                
6651
                
6652
            case PhantomNewObject:
6653
                return ExitValue::materializeNewObject(map.get(node));
6654
                
6467
            default:
6655
            default:
6468
                break;
6656
                break;
6469
            }
6657
            }
Lines 6647-6658 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec27
6647
        return m_out.constIntPtr(pointer);
6835
        return m_out.constIntPtr(pointer);
6648
    }
6836
    }
6649
6837
6650
    LValue weakStructure(Structure* structure)
6838
    LValue weakStructureID(Structure* structure)
6651
    {
6839
    {
6652
        addWeakReference(structure);
6840
        addWeakReference(structure);
6653
        return m_out.constInt32(structure->id());
6841
        return m_out.constInt32(structure->id());
6654
    }
6842
    }
6655
    
6843
    
6844
    LValue weakStructure(Structure* structure)
6845
    {
6846
        return weakPointer(structure);
6847
    }
6848
    
6656
    TypedPointer addressFor(LValue base, int operand, ptrdiff_t offset = 0)
6849
    TypedPointer addressFor(LValue base, int operand, ptrdiff_t offset = 0)
6657
    {
6850
    {
6658
        return m_out.address(base, m_heaps.variables[operand], offset);
6851
        return m_out.address(base, m_heaps.variables[operand], offset);
Lines 6711-6717 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec28
6711
        m_out.unreachable();
6904
        m_out.unreachable();
6712
    }
6905
    }
6713
    
6906
    
6714
    Operands<Availability>& availability() { return m_availabilityCalculator.m_availability; }
6907
    AvailabilityMap& availabilityMap() { return m_availabilityCalculator.m_availability; }
6715
    
6908
    
6716
    VM& vm() { return m_graph.m_vm; }
6909
    VM& vm() { return m_graph.m_vm; }
6717
    CodeBlock* codeBlock() { return m_graph.m_codeBlock; }
6910
    CodeBlock* codeBlock() { return m_graph.m_codeBlock; }
- Source/JavaScriptCore/ftl/FTLOSRExit.h -1 / +3 lines
Lines 1-5 Source/JavaScriptCore/ftl/FTLOSRExit.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2013 Apple Inc. All rights reserved.
2
 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
3
 *
3
 *
4
 * Redistribution and use in source and binary forms, with or without
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
5
 * modification, are permitted provided that the following conditions
Lines 33-38 Source/JavaScriptCore/ftl/FTLOSRExit.h_sec2
33
#include "DFGOSRExitBase.h"
33
#include "DFGOSRExitBase.h"
34
#include "FTLAbbreviations.h"
34
#include "FTLAbbreviations.h"
35
#include "FTLExitArgumentList.h"
35
#include "FTLExitArgumentList.h"
36
#include "FTLExitTimeObjectMaterialization.h"
36
#include "FTLExitValue.h"
37
#include "FTLExitValue.h"
37
#include "FTLFormattedValue.h"
38
#include "FTLFormattedValue.h"
38
#include "MethodOfGettingAValueProfile.h"
39
#include "MethodOfGettingAValueProfile.h"
Lines 160-165 struct OSRExit : public DFG::OSRExitBase Source/JavaScriptCore/ftl/FTLOSRExit.h_sec3
160
    unsigned m_patchableCodeOffset;
161
    unsigned m_patchableCodeOffset;
161
    
162
    
162
    Operands<ExitValue> m_values;
163
    Operands<ExitValue> m_values;
164
    Bag<ExitTimeObjectMaterialization> m_materializations;
163
    
165
    
164
    uint32_t m_stackmapID;
166
    uint32_t m_stackmapID;
165
    
167
    
- Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp -76 / +169 lines
Lines 33-38 Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp_sec1
33
#include "FTLExitArgumentForOperand.h"
33
#include "FTLExitArgumentForOperand.h"
34
#include "FTLJITCode.h"
34
#include "FTLJITCode.h"
35
#include "FTLOSRExit.h"
35
#include "FTLOSRExit.h"
36
#include "FTLOperations.h"
36
#include "FTLState.h"
37
#include "FTLState.h"
37
#include "FTLSaveRestore.h"
38
#include "FTLSaveRestore.h"
38
#include "LinkBuffer.h"
39
#include "LinkBuffer.h"
Lines 46-51 namespace JSC { namespace FTL { Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp_sec2
46
47
47
using namespace DFG;
48
using namespace DFG;
48
49
50
static void compileRecovery(
51
    CCallHelpers& jit, const ExitValue& value, StackMaps::Record* record, StackMaps& stackmaps,
52
    char* registerScratch,
53
    const HashMap<ExitTimeObjectMaterialization*, EncodedJSValue*>& materializationToPointer)
54
{
55
    switch (value.kind()) {
56
    case ExitValueDead:
57
        jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsUndefined())), GPRInfo::regT0);
58
        break;
59
            
60
    case ExitValueConstant:
61
        jit.move(MacroAssembler::TrustedImm64(JSValue::encode(value.constant())), GPRInfo::regT0);
62
        break;
63
            
64
    case ExitValueArgument:
65
        record->locations[value.exitArgument().argument()].restoreInto(
66
            jit, stackmaps, registerScratch, GPRInfo::regT0);
67
        break;
68
            
69
    case ExitValueInJSStack:
70
    case ExitValueInJSStackAsInt32:
71
    case ExitValueInJSStackAsInt52:
72
    case ExitValueInJSStackAsDouble:
73
        jit.load64(AssemblyHelpers::addressFor(value.virtualRegister()), GPRInfo::regT0);
74
        break;
75
            
76
    case ExitValueArgumentsObjectThatWasNotCreated:
77
        // We can't actually recover this yet, but we can make the stack look sane. This is
78
        // a prerequisite to running the actual arguments recovery.
79
        jit.move(MacroAssembler::TrustedImm64(JSValue::encode(JSValue())), GPRInfo::regT0);
80
        break;
81
            
82
    case ExitValueRecovery:
83
        record->locations[value.rightRecoveryArgument()].restoreInto(
84
            jit, stackmaps, registerScratch, GPRInfo::regT1);
85
        record->locations[value.leftRecoveryArgument()].restoreInto(
86
            jit, stackmaps, registerScratch, GPRInfo::regT0);
87
        switch (value.recoveryOpcode()) {
88
        case AddRecovery:
89
            switch (value.recoveryFormat()) {
90
            case ValueFormatInt32:
91
                jit.add32(GPRInfo::regT1, GPRInfo::regT0);
92
                break;
93
            case ValueFormatInt52:
94
                jit.add64(GPRInfo::regT1, GPRInfo::regT0);
95
                break;
96
            default:
97
                RELEASE_ASSERT_NOT_REACHED();
98
                break;
99
            }
100
            break;
101
        case SubRecovery:
102
            switch (value.recoveryFormat()) {
103
            case ValueFormatInt32:
104
                jit.sub32(GPRInfo::regT1, GPRInfo::regT0);
105
                break;
106
            case ValueFormatInt52:
107
                jit.sub64(GPRInfo::regT1, GPRInfo::regT0);
108
                break;
109
            default:
110
                RELEASE_ASSERT_NOT_REACHED();
111
                break;
112
            }
113
            break;
114
        default:
115
            RELEASE_ASSERT_NOT_REACHED();
116
            break;
117
        }
118
        break;
119
        
120
    case ExitValueMaterializeNewObject:
121
        jit.loadPtr(materializationToPointer.get(value.objectMaterialization()), GPRInfo::regT0);
122
        break;
123
            
124
    default:
125
        RELEASE_ASSERT_NOT_REACHED();
126
        break;
127
    }
128
        
129
    reboxAccordingToFormat(
130
        value.valueFormat(), jit, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT2);
131
}
132
49
static void compileStub(
133
static void compileStub(
50
    unsigned exitID, JITCode* jitCode, OSRExit& exit, VM* vm, CodeBlock* codeBlock)
134
    unsigned exitID, JITCode* jitCode, OSRExit& exit, VM* vm, CodeBlock* codeBlock)
51
{
135
{
Lines 64-76 static void compileStub( Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp_sec3
64
148
65
    CCallHelpers jit(vm, codeBlock);
149
    CCallHelpers jit(vm, codeBlock);
66
    
150
    
67
    // We need scratch space to save all registers and to build up the JSStack.
151
    // We need scratch space to save all registers, to build up the JS stack, to deal with unwind
68
    // Use a scratch buffer to transfer all values.
152
    // fixup, pointers to all of the objects we materialize, and the elements inside those objects
69
    ScratchBuffer* scratchBuffer = vm->scratchBufferForSize(sizeof(EncodedJSValue) * exit.m_values.size() + requiredScratchMemorySizeInBytes() + jitCode->unwindInfo.m_registers.size() * sizeof(uint64_t));
153
    // that we materialize.
154
    
155
    // Figure out how much space we need for those object allocations.
156
    unsigned numMaterializations = 0;
157
    size_t maxMaterializationNumArguments = 0;
158
    for (ExitTimeObjectMaterialization* materialization : exit.m_materializations) {
159
        numMaterializations++;
160
        
161
        maxMaterializationNumArguments = std::max(
162
            maxMaterializationNumArguments,
163
            materialization->properties().size());
164
    }
165
    
166
    ScratchBuffer* scratchBuffer = vm->scratchBufferForSize(
167
        sizeof(EncodedJSValue) * (
168
            exit.m_values.size() + numMaterializations + maxMaterializationNumArguments) +
169
        requiredScratchMemorySizeInBytes() +
170
        jitCode->unwindInfo.m_registers.size() * sizeof(uint64_t));
70
    EncodedJSValue* scratch = scratchBuffer ? static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) : 0;
171
    EncodedJSValue* scratch = scratchBuffer ? static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) : 0;
71
    char* registerScratch = bitwise_cast<char*>(scratch + exit.m_values.size());
172
    EncodedJSValue* materializationPointers = scratch + exit.m_values.size();
173
    EncodedJSValue* materializationArguments = materializationPointers + numMaterializations;
174
    char* registerScratch = bitwise_cast<char*>(materializationArguments + maxMaterializationNumArguments);
72
    uint64_t* unwindScratch = bitwise_cast<uint64_t*>(registerScratch + requiredScratchMemorySizeInBytes());
175
    uint64_t* unwindScratch = bitwise_cast<uint64_t*>(registerScratch + requiredScratchMemorySizeInBytes());
73
    
176
    
177
    HashMap<ExitTimeObjectMaterialization*, EncodedJSValue*> materializationToPointer;
178
    unsigned materializationCount = 0;
179
    for (ExitTimeObjectMaterialization* materialization : exit.m_materializations) {
180
        materializationToPointer.add(
181
            materialization, materializationPointers + materializationCount++);
182
    }
183
    
74
    // Note that we come in here, the stack used to be as LLVM left it except that someone called pushToSave().
184
    // Note that we come in here, the stack used to be as LLVM left it except that someone called pushToSave().
75
    // We don't care about the value they saved. But, we do appreciate the fact that they did it, because we use
185
    // We don't care about the value they saved. But, we do appreciate the fact that they did it, because we use
76
    // that slot for saveAllRegisters().
186
    // that slot for saveAllRegisters().
Lines 120-205 static void compileStub( Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp_sec4
120
        if (!!exit.m_valueProfile)
230
        if (!!exit.m_valueProfile)
121
            jit.store64(GPRInfo::regT0, exit.m_valueProfile.getSpecFailBucket(0));
231
            jit.store64(GPRInfo::regT0, exit.m_valueProfile.getSpecFailBucket(0));
122
    }
232
    }
123
124
    // Save all state from wherever the exit data tells us it was, into the appropriate place in
125
    // the scratch buffer. This also does the reboxing.
126
    
233
    
127
    for (unsigned index = exit.m_values.size(); index--;) {
234
    // Materialize all objects. Don't materialize an object until all of the objects it needs
128
        ExitValue value = exit.m_values[index];
235
    // have been materialized.
236
    HashSet<ExitTimeObjectMaterialization*> toMaterialize;
237
    for (ExitTimeObjectMaterialization* materialization : exit.m_materializations)
238
        toMaterialize.add(materialization);
239
    
240
    while (!toMaterialize.isEmpty()) {
241
        int previousToMaterializeSize = toMaterialize.size();
129
        
242
        
130
        switch (value.kind()) {
243
        Vector<ExitTimeObjectMaterialization*> worklist;
131
        case ExitValueDead:
244
        worklist.appendRange(toMaterialize.begin(), toMaterialize.end());
132
            jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsUndefined())), GPRInfo::regT0);
245
        for (ExitTimeObjectMaterialization* materialization : worklist) {
133
            break;
246
            // Check if we can do anything about this right now.
134
            
247
            bool allGood = true;
135
        case ExitValueConstant:
248
            for (ExitPropertyValue value : materialization->properties()) {
136
            jit.move(MacroAssembler::TrustedImm64(JSValue::encode(value.constant())), GPRInfo::regT0);
249
                if (!value.value().isObjectMaterialization())
137
            break;
250
                    continue;
138
            
251
                if (toMaterialize.contains(value.value().objectMaterialization())) {
139
        case ExitValueArgument:
252
                    // Gotta skip this one, since one of its fields points to a materialization
140
            record->locations[value.exitArgument().argument()].restoreInto(
253
                    // that hasn't been materialized.
141
                jit, jitCode->stackmaps, registerScratch, GPRInfo::regT0);
254
                    allGood = false;
142
            break;
143
            
144
        case ExitValueInJSStack:
145
        case ExitValueInJSStackAsInt32:
146
        case ExitValueInJSStackAsInt52:
147
        case ExitValueInJSStackAsDouble:
148
            jit.load64(AssemblyHelpers::addressFor(value.virtualRegister()), GPRInfo::regT0);
149
            break;
150
            
151
        case ExitValueArgumentsObjectThatWasNotCreated:
152
            // We can't actually recover this yet, but we can make the stack look sane. This is
153
            // a prerequisite to running the actual arguments recovery.
154
            jit.move(MacroAssembler::TrustedImm64(JSValue::encode(JSValue())), GPRInfo::regT0);
155
            break;
156
            
157
        case ExitValueRecovery:
158
            record->locations[value.rightRecoveryArgument()].restoreInto(
159
                jit, jitCode->stackmaps, registerScratch, GPRInfo::regT1);
160
            record->locations[value.leftRecoveryArgument()].restoreInto(
161
                jit, jitCode->stackmaps, registerScratch, GPRInfo::regT0);
162
            switch (value.recoveryOpcode()) {
163
            case AddRecovery:
164
                switch (value.recoveryFormat()) {
165
                case ValueFormatInt32:
166
                    jit.add32(GPRInfo::regT1, GPRInfo::regT0);
167
                    break;
168
                case ValueFormatInt52:
169
                    jit.add64(GPRInfo::regT1, GPRInfo::regT0);
170
                    break;
171
                default:
172
                    RELEASE_ASSERT_NOT_REACHED();
173
                    break;
174
                }
175
                break;
176
            case SubRecovery:
177
                switch (value.recoveryFormat()) {
178
                case ValueFormatInt32:
179
                    jit.sub32(GPRInfo::regT1, GPRInfo::regT0);
180
                    break;
181
                case ValueFormatInt52:
182
                    jit.sub64(GPRInfo::regT1, GPRInfo::regT0);
183
                    break;
184
                default:
185
                    RELEASE_ASSERT_NOT_REACHED();
186
                    break;
255
                    break;
187
                }
256
                }
188
                break;
189
            default:
190
                RELEASE_ASSERT_NOT_REACHED();
191
                break;
192
            }
257
            }
193
            break;
258
            if (!allGood)
259
                continue;
194
            
260
            
195
        default:
261
            // All systems go for materializing the object. First we recover the values of all of
196
            RELEASE_ASSERT_NOT_REACHED();
262
            // its fields and then we call a function to actually allocate the beast.
197
            break;
263
            for (unsigned propertyIndex = materialization->properties().size(); propertyIndex--;) {
264
                const ExitValue& value = materialization->properties()[propertyIndex].value();
265
                compileRecovery(
266
                    jit, value, record, jitCode->stackmaps, registerScratch,
267
                    materializationToPointer);
268
                jit.storePtr(GPRInfo::regT0, materializationArguments + propertyIndex);
269
            }
270
            
271
            // This call assumes that we don't pass arguments on the stack.
272
            jit.setupArgumentsWithExecState(
273
                CCallHelpers::TrustedImmPtr(materialization),
274
                CCallHelpers::TrustedImmPtr(materializationArguments));
275
            jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(operationMaterializeObjectInOSR)), GPRInfo::nonArgGPR0);
276
            jit.call(GPRInfo::nonArgGPR0);
277
            jit.storePtr(GPRInfo::returnValueGPR, materializationToPointer.get(materialization));
278
            
279
            // Let everyone know that we're done.
280
            toMaterialize.remove(materialization);
198
        }
281
        }
199
        
282
        
200
        reboxAccordingToFormat(
283
        // We expect progress! This ensures that we crash rather than looping infinitely if there
201
            value.valueFormat(), jit, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT2);
284
        // is something broken about this fixpoint. Or, this could happen if we ever violate the
202
        
285
        // "materializations form a DAG" rule.
286
        RELEASE_ASSERT(toMaterialize.size() < previousToMaterializeSize);
287
    }
288
289
    // Save all state from wherever the exit data tells us it was, into the appropriate place in
290
    // the scratch buffer. This also does the reboxing.
291
    
292
    for (unsigned index = exit.m_values.size(); index--;) {
293
        compileRecovery(
294
            jit, exit.m_values[index], record, jitCode->stackmaps, registerScratch,
295
            materializationToPointer);
203
        jit.store64(GPRInfo::regT0, scratch + index);
296
        jit.store64(GPRInfo::regT0, scratch + index);
204
    }
297
    }
205
    
298
    
- Source/JavaScriptCore/ftl/FTLOperations.cpp +98 lines
Line 0 Source/JavaScriptCore/ftl/FTLOperations.cpp_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "FTLOperations.h"
28
29
#if ENABLE(FTL_JIT)
30
31
#include "JSCInlines.h"
32
33
namespace JSC { namespace FTL {
34
35
using namespace JSC::DFG;
36
37
extern "C" JSCell* JIT_OPERATION operationNewObjectWithButterfly(ExecState* exec, Structure* structure)
38
{
39
    VM& vm = exec->vm();
40
    NativeCallFrameTracer tracer(&vm, exec);
41
    
42
    Butterfly* butterfly = Butterfly::create(
43
        vm, nullptr, 0, structure->outOfLineCapacity(), false, IndexingHeader(), 0);
44
    
45
    return JSFinalObject::create(exec, structure, butterfly);
46
}
47
48
extern "C" JSCell* JIT_OPERATION operationMaterializeObjectInOSR(
49
    ExecState* exec, ExitTimeObjectMaterialization* materialization, EncodedJSValue* values)
50
{
51
    VM& vm = exec->vm();
52
    CodeBlock* codeBlock = exec->codeBlock();
53
54
    // We cannot GC. We've got pointers in evil places.
55
    DeferGCForAWhile deferGC(vm.heap);
56
    
57
    // In the future, we may have many different kinds of materializations. For now we just
58
    // materialize NewObject.
59
    RELEASE_ASSERT(materialization->type() == PhantomNewObject);
60
    
61
    // First figure out what the structure is.
62
    Structure* structure = nullptr;
63
    for (unsigned i = materialization->properties().size(); i--;) {
64
        const ExitPropertyValue& property = materialization->properties()[i];
65
        if (property.location() != PromotedLocationDescriptor(StructurePLoc))
66
            continue;
67
        
68
        structure = jsCast<Structure*>(JSValue::decode(values[i]));
69
    }
70
    RELEASE_ASSERT(structure);
71
    
72
    // Let's create that object!
73
    JSFinalObject* result = JSFinalObject::create(vm, structure);
74
    
75
    // Now figure out what the heck to populate the object with. Use getPropertiesConcurrently()
76
    // because that happens to be lower-level and more convenient. It doesn't change the
77
    // materialization of the property table. We want to have minimal visible effects on the
78
    // system. Also, don't mind that this is O(n^2). It doesn't matter. We only get here from OSR
79
    // exit.
80
    for (PropertyMapEntry entry : structure->getPropertiesConcurrently()) {
81
        for (unsigned i = materialization->properties().size(); i--;) {
82
            const ExitPropertyValue& property = materialization->properties()[i];
83
            if (property.location().kind() != NamedPropertyPLoc)
84
                continue;
85
            if (codeBlock->identifier(property.location().info()).impl() != entry.key)
86
                continue;
87
            
88
            result->putDirect(vm, entry.offset, JSValue::decode(values[i]));
89
        }
90
    }
91
    
92
    return result;
93
}
94
95
} } // namespace JSC::FTL
96
97
#endif // ENABLE(FTL_JIT)
98
- Source/JavaScriptCore/ftl/FTLOperations.h +50 lines
Line 0 Source/JavaScriptCore/ftl/FTLOperations.h_sec1
1
/*
2
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef FTLOperations_h
27
#define FTLOperations_h
28
29
#if ENABLE(FTL_JIT)
30
31
#include "DFGOperations.h"
32
#include "FTLExitTimeObjectMaterialization.h"
33
34
namespace JSC { namespace FTL {
35
36
extern "C" {
37
38
JSCell* JIT_OPERATION operationNewObjectWithButterfly(ExecState*, Structure*) WTF_INTERNAL;
39
40
JSCell* JIT_OPERATION operationMaterializeObjectInOSR(
41
    ExecState*, ExitTimeObjectMaterialization*, EncodedJSValue*) WTF_INTERNAL;
42
43
} // extern "C"
44
45
} } // namespace JSC::DFG
46
47
#endif // ENABLE(FTL_JIT)
48
49
#endif // FTLOperations_h
50
- Source/JavaScriptCore/ftl/FTLSwitchCase.h +6 lines
Lines 35-40 namespace JSC { namespace FTL { Source/JavaScriptCore/ftl/FTLSwitchCase.h_sec1
35
35
36
class SwitchCase {
36
class SwitchCase {
37
public:
37
public:
38
    SwitchCase()
39
        : m_value(nullptr)
40
        , m_target(nullptr)
41
    {
42
    }
43
38
    SwitchCase(LValue value, LBasicBlock target, Weight weight)
44
    SwitchCase(LValue value, LBasicBlock target, Weight weight)
39
        : m_value(value)
45
        : m_value(value)
40
        , m_target(target)
46
        , m_target(target)
- Source/JavaScriptCore/runtime/JSObject.h -7 / +6 lines
Lines 724-731 protected: Source/JavaScriptCore/runtime/JSObject.h_sec1
724
    {
724
    {
725
        Base::finishCreation(vm);
725
        Base::finishCreation(vm);
726
        ASSERT(inherits(info()));
726
        ASSERT(inherits(info()));
727
        ASSERT(!structure()->outOfLineCapacity());
728
        ASSERT(structure()->isEmpty());
729
        ASSERT(prototype().isNull() || Heap::heap(this) == Heap::heap(prototype()));
727
        ASSERT(prototype().isNull() || Heap::heap(this) == Heap::heap(prototype()));
730
        ASSERT(structure()->isObject());
728
        ASSERT(structure()->isObject());
731
        ASSERT(classInfo());
729
        ASSERT(classInfo());
Lines 1052-1058 public: Source/JavaScriptCore/runtime/JSObject.h_sec2
1052
        return (maxSize - allocationSize(0)) / sizeof(WriteBarrier<Unknown>);
1050
        return (maxSize - allocationSize(0)) / sizeof(WriteBarrier<Unknown>);
1053
    }
1051
    }
1054
1052
1055
    static JSFinalObject* create(ExecState*, Structure*);
1053
    static JSFinalObject* create(ExecState*, Structure*, Butterfly* = nullptr);
1056
    static JSFinalObject* create(VM&, Structure*);
1054
    static JSFinalObject* create(VM&, Structure*);
1057
    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype, unsigned inlineCapacity)
1055
    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype, unsigned inlineCapacity)
1058
    {
1056
    {
Lines 1076-1090 protected: Source/JavaScriptCore/runtime/JSObject.h_sec3
1076
private:
1074
private:
1077
    friend class LLIntOffsetsExtractor;
1075
    friend class LLIntOffsetsExtractor;
1078
1076
1079
    explicit JSFinalObject(VM& vm, Structure* structure)
1077
    explicit JSFinalObject(VM& vm, Structure* structure, Butterfly* butterfly = nullptr)
1080
        : JSObject(vm, structure)
1078
        : JSObject(vm, structure, butterfly)
1081
    {
1079
    {
1082
    }
1080
    }
1083
1081
1084
    static const unsigned StructureFlags = JSObject::StructureFlags;
1082
    static const unsigned StructureFlags = JSObject::StructureFlags;
1085
};
1083
};
1086
1084
1087
inline JSFinalObject* JSFinalObject::create(ExecState* exec, Structure* structure)
1085
inline JSFinalObject* JSFinalObject::create(
1086
    ExecState* exec, Structure* structure, Butterfly* butterfly)
1088
{
1087
{
1089
    JSFinalObject* finalObject = new (
1088
    JSFinalObject* finalObject = new (
1090
        NotNull, 
1089
        NotNull, 
Lines 1092-1098 inline JSFinalObject* JSFinalObject::cre Source/JavaScriptCore/runtime/JSObject.h_sec4
1092
            *exec->heap(),
1091
            *exec->heap(),
1093
            allocationSize(structure->inlineCapacity())
1092
            allocationSize(structure->inlineCapacity())
1094
        )
1093
        )
1095
    ) JSFinalObject(exec->vm(), structure);
1094
    ) JSFinalObject(exec->vm(), structure, butterfly);
1096
    finalObject->finishCreation(exec->vm());
1095
    finalObject->finishCreation(exec->vm());
1097
    return finalObject;
1096
    return finalObject;
1098
}
1097
}
- Source/JavaScriptCore/runtime/Structure.cpp +7 lines
Lines 1105-1110 PassRefPtr<StructureShape> Structure::to Source/JavaScriptCore/runtime/Structure.cpp_sec1
1105
    return baseShape.release();
1105
    return baseShape.release();
1106
}
1106
}
1107
1107
1108
bool Structure::canUseForAllocationsOf(Structure* other)
1109
{
1110
    return inlineCapacity() == other->inlineCapacity()
1111
        && storedPrototype() == other->storedPrototype()
1112
        && objectInitializationBlob() == other->objectInitializationBlob();
1113
}
1114
1108
void Structure::dump(PrintStream& out) const
1115
void Structure::dump(PrintStream& out) const
1109
{
1116
{
1110
    out.print(RawPointer(this), ":[", classInfo()->className, ", {");
1117
    out.print(RawPointer(this), ":[", classInfo()->className, ", {");
- Source/JavaScriptCore/runtime/Structure.h +4 lines
Lines 433-438 public: Source/JavaScriptCore/runtime/Structure.h_sec1
433
433
434
    PassRefPtr<StructureShape> toStructureShape(JSValue);
434
    PassRefPtr<StructureShape> toStructureShape(JSValue);
435
    
435
    
436
    // Determines if the two structures match enough that this one could be used for allocations
437
    // of the other one.
438
    bool canUseForAllocationsOf(Structure*);
439
    
436
    void dump(PrintStream&) const;
440
    void dump(PrintStream&) const;
437
    void dumpInContext(PrintStream&, DumpContext*) const;
441
    void dumpInContext(PrintStream&, DumpContext*) const;
438
    void dumpBrief(PrintStream&, const CString&) const;
442
    void dumpBrief(PrintStream&, const CString&) const;
- Source/JavaScriptCore/tests/stress/obviously-elidable-new-object-then-exit.js +23 lines
Line 0 Source/JavaScriptCore/tests/stress/obviously-elidable-new-object-then-exit.js_sec1
1
function sumOfArithSeries(limit) {
2
    return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
var array = [1, "hello"];
8
9
function foo() {
10
    var result = 0;
11
    var q;
12
    for (var i = 0; i < n; ++i) {
13
        var o = {f: i};
14
        var p = {f: i + 1};
15
        q = array[(i >= n - 100) | 0] + 1;
16
        result += o.f + p.f;
17
    }
18
    return q + result;
19
}
20
21
var result = foo();
22
if (result != "hello" + 1 + (sumOfArithSeries(n - 1) + sumOfArithSeries(n)))
23
    throw "Error: bad result: " + result;
- Source/WTF/ChangeLog +14 lines
Lines 1-3 Source/WTF/ChangeLog_sec1
1
2014-09-24  Filip Pizlo  <fpizlo@apple.com>
2
3
        FTL should sink object allocations
4
        https://bugs.webkit.org/show_bug.cgi?id=136330
5
6
        Reviewed by Oliver Hunt.
7
        
8
        Make it possible to reset a Bag.
9
10
        * wtf/Bag.h:
11
        (WTF::Bag::Bag):
12
        (WTF::Bag::~Bag):
13
        (WTF::Bag::clear):
14
1
2014-09-24  Geoffrey Garen  <ggaren@apple.com>
15
2014-09-24  Geoffrey Garen  <ggaren@apple.com>
2
16
3
        Do the bmalloc.
17
        Do the bmalloc.
- Source/WTF/wtf/Bag.h -1 / +7 lines
Lines 46-62 private: Source/WTF/wtf/Bag.h_sec1
46
    
46
    
47
public:
47
public:
48
    Bag()
48
    Bag()
49
        : m_head(0)
49
        : m_head(nullptr)
50
    {
50
    {
51
    }
51
    }
52
    
52
    
53
    ~Bag()
53
    ~Bag()
54
    {
54
    {
55
        clear();
56
    }
57
    
58
    void clear()
59
    {
55
        while (m_head) {
60
        while (m_head) {
56
            Node* current = m_head;
61
            Node* current = m_head;
57
            m_head = current->m_next;
62
            m_head = current->m_next;
58
            delete current;
63
            delete current;
59
        }
64
        }
65
        m_head = nullptr;
60
    }
66
    }
61
    
67
    
62
    template<typename... Args>
68
    template<typename... Args>
- LayoutTests/ChangeLog +43 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2014-09-25  Filip Pizlo  <fpizlo@apple.com>
2
3
        FTL should sink object allocations
4
        https://bugs.webkit.org/show_bug.cgi?id=136330
5
6
        Reviewed by Oliver Hunt.
7
8
        * js/math-denorm.html: Added.
9
        * js/regress/elidable-new-object-tree-expected.txt: Added.
10
        * js/regress/elidable-new-object-tree.html: Added.
11
        * js/regress/obvious-sink-pathology-expected.txt: Added.
12
        * js/regress/obvious-sink-pathology-taken-expected.txt: Added.
13
        * js/regress/obvious-sink-pathology-taken.html: Added.
14
        * js/regress/obvious-sink-pathology.html: Added.
15
        * js/regress/obviously-elidable-new-object-expected.txt: Added.
16
        * js/regress/obviously-elidable-new-object.html: Added.
17
        * js/regress/script-tests/elidable-new-object-tree.js: Added.
18
        (sumOfArithSeries):
19
        (foo):
20
        * js/regress/script-tests/obvious-sink-pathology-taken.js: Added.
21
        (sumOfArithSeries):
22
        (bar):
23
        (foo):
24
        * js/regress/script-tests/obvious-sink-pathology.js: Added.
25
        (sumOfArithSeries):
26
        (bar):
27
        (foo):
28
        * js/regress/script-tests/obviously-elidable-new-object.js: Added.
29
        (sumOfArithSeries):
30
        (foo):
31
        * js/regress/script-tests/sinkable-new-object-taken.js: Added.
32
        (sumOfArithSeries):
33
        (bar):
34
        (foo):
35
        * js/regress/script-tests/sinkable-new-object.js: Added.
36
        (sumOfArithSeries):
37
        (bar):
38
        (foo):
39
        * js/regress/sinkable-new-object-expected.txt: Added.
40
        * js/regress/sinkable-new-object-taken-expected.txt: Added.
41
        * js/regress/sinkable-new-object-taken.html: Added.
42
        * js/regress/sinkable-new-object.html: Added.
43
1
2014-09-25  Javier Fernandez  <jfernandez@igalia.com>
44
2014-09-25  Javier Fernandez  <jfernandez@igalia.com>
2
45
3
        ASSERTION FAILED: columnCount in WebCore::CSSParser::parseGridTemplateAreasRow
46
        ASSERTION FAILED: columnCount in WebCore::CSSParser::parseGridTemplateAreasRow
- LayoutTests/js/math-denorm.html +10 lines
Line 0 LayoutTests/js/math-denorm.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<script src="script-tests/math-denorm.js"></script>
8
<script src="resources/js-test-post.js"></script>
9
</body>
10
</html>
- LayoutTests/js/regress/elidable-new-object-tree-expected.txt +10 lines
Line 0 LayoutTests/js/regress/elidable-new-object-tree-expected.txt_sec1
1
JSRegress/elidable-new-object-tree
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS no exception thrown
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- LayoutTests/js/regress/elidable-new-object-tree.html +12 lines
Line 0 LayoutTests/js/regress/elidable-new-object-tree.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<script src="../../resources/regress-pre.js"></script>
8
<script src="script-tests/elidable-new-object-tree.js"></script>
9
<script src="../../resources/regress-post.js"></script>
10
<script src="../../resources/js-test-post.js"></script>
11
</body>
12
</html>
- LayoutTests/js/regress/obvious-sink-pathology-expected.txt +10 lines
Line 0 LayoutTests/js/regress/obvious-sink-pathology-expected.txt_sec1
1
JSRegress/obvious-sink-pathology
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS no exception thrown
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- LayoutTests/js/regress/obvious-sink-pathology-taken-expected.txt +10 lines
Line 0 LayoutTests/js/regress/obvious-sink-pathology-taken-expected.txt_sec1
1
JSRegress/obvious-sink-pathology-taken
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS no exception thrown
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- LayoutTests/js/regress/obvious-sink-pathology-taken.html +12 lines
Line 0 LayoutTests/js/regress/obvious-sink-pathology-taken.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<script src="../../resources/regress-pre.js"></script>
8
<script src="script-tests/obvious-sink-pathology-taken.js"></script>
9
<script src="../../resources/regress-post.js"></script>
10
<script src="../../resources/js-test-post.js"></script>
11
</body>
12
</html>
- LayoutTests/js/regress/obvious-sink-pathology.html +12 lines
Line 0 LayoutTests/js/regress/obvious-sink-pathology.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<script src="../../resources/regress-pre.js"></script>
8
<script src="script-tests/obvious-sink-pathology.js"></script>
9
<script src="../../resources/regress-post.js"></script>
10
<script src="../../resources/js-test-post.js"></script>
11
</body>
12
</html>
- LayoutTests/js/regress/obviously-elidable-new-object-expected.txt +10 lines
Line 0 LayoutTests/js/regress/obviously-elidable-new-object-expected.txt_sec1
1
JSRegress/obviously-elidable-new-object
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS no exception thrown
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- LayoutTests/js/regress/obviously-elidable-new-object.html +12 lines
Line 0 LayoutTests/js/regress/obviously-elidable-new-object.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<script src="../../resources/regress-pre.js"></script>
8
<script src="script-tests/obviously-elidable-new-object.js"></script>
9
<script src="../../resources/regress-post.js"></script>
10
<script src="../../resources/js-test-post.js"></script>
11
</body>
12
</html>
- LayoutTests/js/regress/sinkable-new-object-expected.txt +10 lines
Line 0 LayoutTests/js/regress/sinkable-new-object-expected.txt_sec1
1
JSRegress/sinkable-new-object
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS no exception thrown
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- LayoutTests/js/regress/sinkable-new-object-taken-expected.txt +10 lines
Line 0 LayoutTests/js/regress/sinkable-new-object-taken-expected.txt_sec1
1
JSRegress/sinkable-new-object-taken
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS no exception thrown
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- LayoutTests/js/regress/sinkable-new-object-taken.html +12 lines
Line 0 LayoutTests/js/regress/sinkable-new-object-taken.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<script src="../../resources/regress-pre.js"></script>
8
<script src="script-tests/sinkable-new-object-taken.js"></script>
9
<script src="../../resources/regress-post.js"></script>
10
<script src="../../resources/js-test-post.js"></script>
11
</body>
12
</html>
- LayoutTests/js/regress/sinkable-new-object.html +12 lines
Line 0 LayoutTests/js/regress/sinkable-new-object.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<script src="../../resources/regress-pre.js"></script>
8
<script src="script-tests/sinkable-new-object.js"></script>
9
<script src="../../resources/regress-post.js"></script>
10
<script src="../../resources/js-test-post.js"></script>
11
</body>
12
</html>
- LayoutTests/js/regress/script-tests/elidable-new-object-tree.js +19 lines
Line 0 LayoutTests/js/regress/script-tests/elidable-new-object-tree.js_sec1
1
function sumOfArithSeries(limit) {
2
    return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
function foo() {
8
    var result = 0;
9
    for (var i = 0; i < n; ++i) {
10
        var o = {f: {f:i}};
11
        var p = {f: {f:i + 1}};
12
        result += o.f.f + p.f.f;
13
    }
14
    return result;
15
}
16
17
var result = foo();
18
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
19
    throw "Error: bad result: " + result;
- LayoutTests/js/regress/script-tests/obvious-sink-pathology-taken.js +26 lines
Line 0 LayoutTests/js/regress/script-tests/obvious-sink-pathology-taken.js_sec1
1
function sumOfArithSeries(limit) {
2
    return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
function bar() { }
8
9
function foo() {
10
    var result = 0;
11
    for (var i = 0; i < n; ++i) {
12
        var o = {f: i};
13
        var p = {f: i + 1};
14
        if (!(i % 100))
15
            bar(o, p);
16
        result += o.f + p.f;
17
    }
18
    return result;
19
}
20
21
noInline(bar);
22
noInline(foo);
23
24
var result = foo();
25
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
26
    throw "Error: bad result: " + result;
- LayoutTests/js/regress/script-tests/obvious-sink-pathology.js +26 lines
Line 0 LayoutTests/js/regress/script-tests/obvious-sink-pathology.js_sec1
1
function sumOfArithSeries(limit) {
2
    return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
function bar() { }
8
9
function foo(b) {
10
    var result = 0;
11
    for (var i = 0; i < n; ++i) {
12
        var o = {f: i};
13
        var p = {f: i + 1};
14
        if (b)
15
            bar(o, p);
16
        result += o.f + p.f;
17
    }
18
    return result;
19
}
20
21
noInline(bar);
22
noInline(foo);
23
24
var result = foo(false);
25
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
26
    throw "Error: bad result: " + result;
- LayoutTests/js/regress/script-tests/obviously-elidable-new-object.js +19 lines
Line 0 LayoutTests/js/regress/script-tests/obviously-elidable-new-object.js_sec1
1
function sumOfArithSeries(limit) {
2
    return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
function foo() {
8
    var result = 0;
9
    for (var i = 0; i < n; ++i) {
10
        var o = {f: i};
11
        var p = {f: i + 1};
12
        result += o.f + p.f;
13
    }
14
    return result;
15
}
16
17
var result = foo();
18
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
19
    throw "Error: bad result: " + result;
- LayoutTests/js/regress/script-tests/sinkable-new-object-taken.js +26 lines
Line 0 LayoutTests/js/regress/script-tests/sinkable-new-object-taken.js_sec1
1
function sumOfArithSeries(limit) {
2
    return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
function bar() { }
8
9
function foo() {
10
    var result = 0;
11
    for (var i = 0; i < n; ++i) {
12
        var o = {f: i};
13
        var p = {f: i + 1};
14
        result += o.f + p.f;
15
        if (!(i % 100))
16
            bar(o, p);
17
    }
18
    return result;
19
}
20
21
noInline(bar);
22
noInline(foo);
23
24
var result = foo();
25
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
26
    throw "Error: bad result: " + result;
- LayoutTests/js/regress/script-tests/sinkable-new-object.js +28 lines
Line 0 LayoutTests/js/regress/script-tests/sinkable-new-object.js_sec1
1
function sumOfArithSeries(limit) {
2
    return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
function bar() { }
8
9
function foo(b) {
10
    var result = 0;
11
    for (var i = 0; i < n; ++i) {
12
        var o = {f: i};
13
        var p = {f: i + 1};
14
        if (b) {
15
            bar(o, p);
16
            return;
17
        }
18
        result += o.f + p.f;
19
    }
20
    return result;
21
}
22
23
noInline(bar);
24
noInline(foo);
25
26
var result = foo(false);
27
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
28
    throw "Error: bad result: " + result;

Return to Bug 136330