| Differences between
and this patch
- Source/JavaScriptCore/ChangeLog +235 lines
Lines 1-3 Source/JavaScriptCore/ChangeLog_sec1
1
2013-04-10  Filip Pizlo  <fpizlo@apple.com>
2
3
        fourthTier: FTL should have OSR exit
4
        https://bugs.webkit.org/show_bug.cgi?id=113623
5
6
        Reviewed by NOBODY (OOPS!).
7
        
8
        Work in progress.
9
10
        * assembler/AbstractMacroAssembler.h:
11
        (Address):
12
        (JSC::AbstractMacroAssembler::Address::withOffset):
13
        * assembler/LinkBuffer.h:
14
        (JSC::LinkBuffer::offsetOf):
15
        (LinkBuffer):
16
        * dfg/DFGAbstractState.cpp:
17
        (JSC::DFG::AbstractState::initialize):
18
        * dfg/DFGGPRInfo.h:
19
        (GPRInfo):
20
        * dfg/DFGMinifiedNode.h:
21
        (JSC::DFG::belongsInMinifiedGraph):
22
        * dfg/DFGNodeType.h:
23
        (JSC::DFG::needsOSRBackwardRewiring):
24
        (DFG):
25
        (JSC::DFG::needsOSRForwardRewiring):
26
        * dfg/DFGOSRExit.cpp:
27
        (JSC::DFG::OSRExit::OSRExit):
28
        (DFG):
29
        (JSC::DFG::OSRExit::convertToForward):
30
        * dfg/DFGOSRExit.h:
31
        (OSRExit):
32
        * dfg/DFGOSRExitBase.cpp: Added.
33
        (DFG):
34
        (JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSiteSlow):
35
        (JSC::DFG::OSRExitBase::doSearchForForwardConversion):
36
        * dfg/DFGOSRExitBase.h: Added.
37
        (DFG):
38
        (JSC::DFG::OSRExitBase::OSRExitBase):
39
        (OSRExitBase):
40
        (JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSite):
41
        * dfg/DFGOSRExitCompiler.cpp:
42
        * dfg/DFGOSRExitCompilerCommon.cpp:
43
        (JSC::DFG::handleExitCounts):
44
        (JSC::DFG::reifyInlinedCallFrames):
45
        (JSC::DFG::adjustAndJumpToTarget):
46
        * dfg/DFGOSRExitCompilerCommon.h:
47
        (DFG):
48
        * dfg/DFGOSRExitPreparation.cpp: Added.
49
        (DFG):
50
        (JSC::DFG::prepareCodeOriginForOSRExit):
51
        * dfg/DFGOSRExitPreparation.h: Added.
52
        (DFG):
53
        * dfg/DFGSpeculativeJIT.cpp:
54
        (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
55
        * dfg/DFGValueSource.h:
56
        (JSC::DFG::ValueSource::forSpeculation):
57
        * dfg/DFGVariableEventStream.cpp:
58
        (JSC::DFG::VariableEventStream::reconstruct):
59
        * ftl/FTLAbbreviations.h:
60
        (FTL):
61
        (JSC::FTL::functionType):
62
        (JSC::FTL::typeOf):
63
        (JSC::FTL::buildCall):
64
        (JSC::FTL::setTailCall):
65
        * ftl/FTLCArgumentGetter.cpp: Added.
66
        (FTL):
67
        (JSC::FTL::CArgumentGetter::loadNextAndBox):
68
        * ftl/FTLCArgumentGetter.h: Added.
69
        (FTL):
70
        (JSC::FTL::isArgumentRegister):
71
        (CArgumentGetter):
72
        (JSC::FTL::CArgumentGetter::CArgumentGetter):
73
        (JSC::FTL::CArgumentGetter::loadNext8):
74
        (JSC::FTL::CArgumentGetter::loadNext32):
75
        (JSC::FTL::CArgumentGetter::loadNext64):
76
        (JSC::FTL::CArgumentGetter::loadNextPtr):
77
        (JSC::FTL::CArgumentGetter::loadNextDouble):
78
        (JSC::FTL::CArgumentGetter::nextAddress):
79
        * ftl/FTLExitArgument.cpp: Added.
80
        (FTL):
81
        (JSC::FTL::ExitArgument::dump):
82
        * ftl/FTLExitArgument.h: Added.
83
        (FTL):
84
        (ExitArgumentRepresentation):
85
        (ExitArgument):
86
        (JSC::FTL::ExitArgument::ExitArgument):
87
        (JSC::FTL::ExitArgument::operator!):
88
        (JSC::FTL::ExitArgument::format):
89
        (JSC::FTL::ExitArgument::argument):
90
        (JSC::FTL::ExitArgument::withFormat):
91
        (JSC::FTL::ExitArgument::representation):
92
        * ftl/FTLExitArgumentForOperand.cpp: Added.
93
        (FTL):
94
        (JSC::FTL::ExitArgumentForOperand::dump):
95
        * ftl/FTLExitArgumentForOperand.h: Added.
96
        (FTL):
97
        (ExitArgumentForOperand):
98
        (JSC::FTL::ExitArgumentForOperand::ExitArgumentForOperand):
99
        (JSC::FTL::ExitArgumentForOperand::operator!):
100
        (JSC::FTL::ExitArgumentForOperand::exitArgument):
101
        (JSC::FTL::ExitArgumentForOperand::operand):
102
        (JSC::FTL::lesserArgumentIndex):
103
        * ftl/FTLExitArgumentList.h: Added.
104
        (FTL):
105
        * ftl/FTLExitThunkGenerator.cpp: Added.
106
        (FTL):
107
        (JSC::FTL::ExitThunkGenerator::ExitThunkGenerator):
108
        (JSC::FTL::ExitThunkGenerator::~ExitThunkGenerator):
109
        (JSC::FTL::ExitThunkGenerator::emitThunk):
110
        * ftl/FTLExitThunkGenerator.h: Added.
111
        (FTL):
112
        (ExitThunkGenerator):
113
        * ftl/FTLExitValue.cpp: Added.
114
        (FTL):
115
        (JSC::FTL::ExitValue::dump):
116
        * ftl/FTLExitValue.h: Added.
117
        (FTL):
118
        (ExitValue):
119
        (JSC::FTL::ExitValue::ExitValue):
120
        (JSC::FTL::ExitValue::operator!):
121
        (JSC::FTL::ExitValue::dead):
122
        (JSC::FTL::ExitValue::inJSStack):
123
        (JSC::FTL::ExitValue::inJSStackAsInt32):
124
        (JSC::FTL::ExitValue::inJSStackAsDouble):
125
        (JSC::FTL::ExitValue::constant):
126
        (JSC::FTL::ExitValue::exitArgument):
127
        (JSC::FTL::ExitValue::kind):
128
        (JSC::FTL::ExitValue::isDead):
129
        (JSC::FTL::ExitValue::isInJSStackSomehow):
130
        (JSC::FTL::ExitValue::isConstant):
131
        (JSC::FTL::ExitValue::isArgument):
132
        * ftl/FTLFormattedValue.h:
133
        (FTL):
134
        (JSC::FTL::noValue):
135
        (JSC::FTL::int32Value):
136
        (JSC::FTL::uInt32Value):
137
        (JSC::FTL::booleanValue):
138
        (JSC::FTL::jsValueValue):
139
        (JSC::FTL::doubleValue):
140
        * ftl/FTLJITCode.cpp:
141
        (JSC::FTL::JITCode::initializeExitThunks):
142
        (FTL):
143
        (JSC::FTL::JITCode::exitThunks):
144
        * ftl/FTLJITCode.h:
145
        (JITCode):
146
        * ftl/FTLLowerDFGToLLVM.cpp:
147
        (FTL):
148
        (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
149
        (JSC::FTL::LowerDFGToLLVM::lower):
150
        (JSC::FTL::LowerDFGToLLVM::transferAndCheckArguments):
151
        (JSC::FTL::LowerDFGToLLVM::compileBlock):
152
        (JSC::FTL::LowerDFGToLLVM::compileNode):
153
        (JSC::FTL::LowerDFGToLLVM::compileGetLocal):
154
        (JSC::FTL::LowerDFGToLLVM::compileSetLocal):
155
        (LowerDFGToLLVM):
156
        (JSC::FTL::LowerDFGToLLVM::compileMovHint):
157
        (JSC::FTL::LowerDFGToLLVM::compileZombieHint):
158
        (JSC::FTL::LowerDFGToLLVM::compileMovHintAndCheck):
159
        (JSC::FTL::LowerDFGToLLVM::compileAdd):
160
        (JSC::FTL::LowerDFGToLLVM::compileArithSub):
161
        (JSC::FTL::LowerDFGToLLVM::compileArithMul):
162
        (JSC::FTL::LowerDFGToLLVM::compileArithNegate):
163
        (JSC::FTL::LowerDFGToLLVM::compileUInt32ToNumber):
164
        (JSC::FTL::LowerDFGToLLVM::compileCheckStructure):
165
        (JSC::FTL::LowerDFGToLLVM::compileGetByVal):
166
        (JSC::FTL::LowerDFGToLLVM::speculateBackward):
167
        (JSC::FTL::LowerDFGToLLVM::speculateForward):
168
        (JSC::FTL::LowerDFGToLLVM::speculate):
169
        (JSC::FTL::LowerDFGToLLVM::backwardTypeCheck):
170
        (JSC::FTL::LowerDFGToLLVM::forwardTypeCheck):
171
        (JSC::FTL::LowerDFGToLLVM::typeCheck):
172
        (JSC::FTL::LowerDFGToLLVM::appendTypeCheck):
173
        (JSC::FTL::LowerDFGToLLVM::lowInt32):
174
        (JSC::FTL::LowerDFGToLLVM::lowCell):
175
        (JSC::FTL::LowerDFGToLLVM::lowBoolean):
176
        (JSC::FTL::LowerDFGToLLVM::speculateObject):
177
        (JSC::FTL::LowerDFGToLLVM::isLive):
178
        (JSC::FTL::LowerDFGToLLVM::use):
179
        (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock):
180
        (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
181
        (JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode):
182
        (JSC::FTL::LowerDFGToLLVM::tryToSetConstantExitArgument):
183
        (JSC::FTL::LowerDFGToLLVM::addExitArgument):
184
        (JSC::FTL::LowerDFGToLLVM::linkOSRExitsAndCompleteInitializationBlock):
185
        (JSC::FTL::LowerDFGToLLVM::observeMovHint):
186
        * ftl/FTLOSRExit.cpp: Added.
187
        (FTL):
188
        (JSC::FTL::OSRExit::OSRExit):
189
        (JSC::FTL::OSRExit::codeLocationForRepatch):
190
        (JSC::FTL::OSRExit::convertToForward):
191
        * ftl/FTLOSRExit.h: Added.
192
        (FTL):
193
        (OSRExit):
194
        * ftl/FTLOSRExitCompilationInfo.h: Added.
195
        (FTL):
196
        (JSC::FTL::OSRExitCompilationInfo::OSRExitCompilationInfo):
197
        (OSRExitCompilationInfo):
198
        * ftl/FTLOSRExitCompiler.cpp: Added.
199
        (FTL):
200
        (JSC::FTL::compileStub):
201
        (JSC::FTL::compileFTLOSRExit):
202
        * ftl/FTLOSRExitCompiler.h: Added.
203
        (FTL):
204
        * ftl/FTLOutput.h:
205
        (JSC::FTL::Output::intToPtr):
206
        (JSC::FTL::Output::load):
207
        (JSC::FTL::Output::store):
208
        (Output):
209
        (JSC::FTL::Output::call):
210
        (JSC::FTL::Output::convertToTailCall):
211
        * ftl/FTLState.h:
212
        (State):
213
        * ftl/FTLThunks.cpp: Added.
214
        (FTL):
215
        (JSC::FTL::osrExitGenerationThunkGenerator):
216
        * ftl/FTLThunks.h: Added.
217
        (JSC):
218
        (FTL):
219
        * ftl/FTLValueFormat.cpp: Added.
220
        (WTF):
221
        (WTF::printInternal):
222
        * ftl/FTLValueFormat.h: Added.
223
        (FTL):
224
        (WTF):
225
        * ftl/FTLValueSource.cpp: Added.
226
        (FTL):
227
        (JSC::FTL::ValueSource::dump):
228
        * ftl/FTLValueSource.h: Added.
229
        (FTL):
230
        (ValueSource):
231
        (JSC::FTL::ValueSource::ValueSource):
232
        (JSC::FTL::ValueSource::kind):
233
        (JSC::FTL::ValueSource::operator!):
234
        (JSC::FTL::ValueSource::node):
235
1
2013-04-09  Filip Pizlo  <fpizlo@apple.com>
236
2013-04-09  Filip Pizlo  <fpizlo@apple.com>
2
237
3
        fourthTier: DFG should provide utilities for common OSR exit tasks
238
        fourthTier: DFG should provide utilities for common OSR exit tasks
- Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj -1 / +105 lines
Lines 89-94 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec1
89
		0F21C27C14BE727600ADC64B /* ExecutionHarness.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27A14BE727300ADC64B /* ExecutionHarness.h */; settings = {ATTRIBUTES = (Private, ); }; };
89
		0F21C27C14BE727600ADC64B /* ExecutionHarness.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27A14BE727300ADC64B /* ExecutionHarness.h */; settings = {ATTRIBUTES = (Private, ); }; };
90
		0F21C27D14BE727A00ADC64B /* CodeSpecializationKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27914BE727300ADC64B /* CodeSpecializationKind.h */; settings = {ATTRIBUTES = (Private, ); }; };
90
		0F21C27D14BE727A00ADC64B /* CodeSpecializationKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27914BE727300ADC64B /* CodeSpecializationKind.h */; settings = {ATTRIBUTES = (Private, ); }; };
91
		0F21C27F14BEAA8200ADC64B /* BytecodeConventions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27E14BEAA8000ADC64B /* BytecodeConventions.h */; settings = {ATTRIBUTES = (Private, ); }; };
91
		0F21C27F14BEAA8200ADC64B /* BytecodeConventions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27E14BEAA8000ADC64B /* BytecodeConventions.h */; settings = {ATTRIBUTES = (Private, ); }; };
92
		0F235BD117178E1C00690C7F /* FTLCArgumentGetter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BBB17178E1C00690C7F /* FTLCArgumentGetter.cpp */; };
93
		0F235BD217178E1C00690C7F /* FTLCArgumentGetter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BBC17178E1C00690C7F /* FTLCArgumentGetter.h */; settings = {ATTRIBUTES = (Private, ); }; };
94
		0F235BD317178E1C00690C7F /* FTLExitArgument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BBD17178E1C00690C7F /* FTLExitArgument.cpp */; };
95
		0F235BD417178E1C00690C7F /* FTLExitArgument.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BBE17178E1C00690C7F /* FTLExitArgument.h */; settings = {ATTRIBUTES = (Private, ); }; };
96
		0F235BD517178E1C00690C7F /* FTLExitArgumentForOperand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BBF17178E1C00690C7F /* FTLExitArgumentForOperand.cpp */; };
97
		0F235BD617178E1C00690C7F /* FTLExitArgumentForOperand.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC017178E1C00690C7F /* FTLExitArgumentForOperand.h */; settings = {ATTRIBUTES = (Private, ); }; };
98
		0F235BD717178E1C00690C7F /* FTLExitArgumentList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC117178E1C00690C7F /* FTLExitArgumentList.h */; settings = {ATTRIBUTES = (Private, ); }; };
99
		0F235BD817178E1C00690C7F /* FTLExitThunkGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC217178E1C00690C7F /* FTLExitThunkGenerator.cpp */; };
100
		0F235BD917178E1C00690C7F /* FTLExitThunkGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC317178E1C00690C7F /* FTLExitThunkGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
101
		0F235BDA17178E1C00690C7F /* FTLExitValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC417178E1C00690C7F /* FTLExitValue.cpp */; };
102
		0F235BDB17178E1C00690C7F /* FTLExitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC517178E1C00690C7F /* FTLExitValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
103
		0F235BDC17178E1C00690C7F /* FTLOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC617178E1C00690C7F /* FTLOSRExit.cpp */; };
104
		0F235BDD17178E1C00690C7F /* FTLOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC717178E1C00690C7F /* FTLOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; };
105
		0F235BDE17178E1C00690C7F /* FTLOSRExitCompilationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC817178E1C00690C7F /* FTLOSRExitCompilationInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
106
		0F235BDF17178E1C00690C7F /* FTLOSRExitCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC917178E1C00690C7F /* FTLOSRExitCompiler.cpp */; };
107
		0F235BE017178E1C00690C7F /* FTLOSRExitCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCA17178E1C00690C7F /* FTLOSRExitCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
108
		0F235BE117178E1C00690C7F /* FTLThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BCB17178E1C00690C7F /* FTLThunks.cpp */; };
109
		0F235BE217178E1C00690C7F /* FTLThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCC17178E1C00690C7F /* FTLThunks.h */; settings = {ATTRIBUTES = (Private, ); }; };
110
		0F235BE317178E1C00690C7F /* FTLValueFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BCD17178E1C00690C7F /* FTLValueFormat.cpp */; };
111
		0F235BE417178E1C00690C7F /* FTLValueFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCE17178E1C00690C7F /* FTLValueFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
112
		0F235BE517178E1C00690C7F /* FTLValueSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BCF17178E1C00690C7F /* FTLValueSource.cpp */; };
113
		0F235BE617178E1C00690C7F /* FTLValueSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BD017178E1C00690C7F /* FTLValueSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
114
		0F235BEB17178E7300690C7F /* DFGOSRExitBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BE717178E7300690C7F /* DFGOSRExitBase.cpp */; };
115
		0F235BEC17178E7300690C7F /* DFGOSRExitBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BE817178E7300690C7F /* DFGOSRExitBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
116
		0F235BED17178E7300690C7F /* DFGOSRExitPreparation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BE917178E7300690C7F /* DFGOSRExitPreparation.cpp */; };
117
		0F235BEE17178E7300690C7F /* DFGOSRExitPreparation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */; settings = {ATTRIBUTES = (Private, ); }; };
92
		0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; };
118
		0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; };
93
		0F256C361627B0AD007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F256C341627B0AA007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
119
		0F256C361627B0AD007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F256C341627B0AA007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
94
		0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */; };
120
		0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */; };
Lines 1022-1027 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec2
1022
		0F21C27914BE727300ADC64B /* CodeSpecializationKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeSpecializationKind.h; sourceTree = "<group>"; };
1048
		0F21C27914BE727300ADC64B /* CodeSpecializationKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeSpecializationKind.h; sourceTree = "<group>"; };
1023
		0F21C27A14BE727300ADC64B /* ExecutionHarness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutionHarness.h; sourceTree = "<group>"; };
1049
		0F21C27A14BE727300ADC64B /* ExecutionHarness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutionHarness.h; sourceTree = "<group>"; };
1024
		0F21C27E14BEAA8000ADC64B /* BytecodeConventions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeConventions.h; sourceTree = "<group>"; };
1050
		0F21C27E14BEAA8000ADC64B /* BytecodeConventions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeConventions.h; sourceTree = "<group>"; };
1051
		0F235BBB17178E1C00690C7F /* FTLCArgumentGetter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLCArgumentGetter.cpp; path = ftl/FTLCArgumentGetter.cpp; sourceTree = "<group>"; };
1052
		0F235BBC17178E1C00690C7F /* FTLCArgumentGetter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLCArgumentGetter.h; path = ftl/FTLCArgumentGetter.h; sourceTree = "<group>"; };
1053
		0F235BBD17178E1C00690C7F /* FTLExitArgument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLExitArgument.cpp; path = ftl/FTLExitArgument.cpp; sourceTree = "<group>"; };
1054
		0F235BBE17178E1C00690C7F /* FTLExitArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLExitArgument.h; path = ftl/FTLExitArgument.h; sourceTree = "<group>"; };
1055
		0F235BBF17178E1C00690C7F /* FTLExitArgumentForOperand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLExitArgumentForOperand.cpp; path = ftl/FTLExitArgumentForOperand.cpp; sourceTree = "<group>"; };
1056
		0F235BC017178E1C00690C7F /* FTLExitArgumentForOperand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLExitArgumentForOperand.h; path = ftl/FTLExitArgumentForOperand.h; sourceTree = "<group>"; };
1057
		0F235BC117178E1C00690C7F /* FTLExitArgumentList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLExitArgumentList.h; path = ftl/FTLExitArgumentList.h; sourceTree = "<group>"; };
1058
		0F235BC217178E1C00690C7F /* FTLExitThunkGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLExitThunkGenerator.cpp; path = ftl/FTLExitThunkGenerator.cpp; sourceTree = "<group>"; };
1059
		0F235BC317178E1C00690C7F /* FTLExitThunkGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLExitThunkGenerator.h; path = ftl/FTLExitThunkGenerator.h; sourceTree = "<group>"; };
1060
		0F235BC417178E1C00690C7F /* FTLExitValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLExitValue.cpp; path = ftl/FTLExitValue.cpp; sourceTree = "<group>"; };
1061
		0F235BC517178E1C00690C7F /* FTLExitValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLExitValue.h; path = ftl/FTLExitValue.h; sourceTree = "<group>"; };
1062
		0F235BC617178E1C00690C7F /* FTLOSRExit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLOSRExit.cpp; path = ftl/FTLOSRExit.cpp; sourceTree = "<group>"; };
1063
		0F235BC717178E1C00690C7F /* FTLOSRExit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLOSRExit.h; path = ftl/FTLOSRExit.h; sourceTree = "<group>"; };
1064
		0F235BC817178E1C00690C7F /* FTLOSRExitCompilationInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLOSRExitCompilationInfo.h; path = ftl/FTLOSRExitCompilationInfo.h; sourceTree = "<group>"; };
1065
		0F235BC917178E1C00690C7F /* FTLOSRExitCompiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLOSRExitCompiler.cpp; path = ftl/FTLOSRExitCompiler.cpp; sourceTree = "<group>"; };
1066
		0F235BCA17178E1C00690C7F /* FTLOSRExitCompiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLOSRExitCompiler.h; path = ftl/FTLOSRExitCompiler.h; sourceTree = "<group>"; };
1067
		0F235BCB17178E1C00690C7F /* FTLThunks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLThunks.cpp; path = ftl/FTLThunks.cpp; sourceTree = "<group>"; };
1068
		0F235BCC17178E1C00690C7F /* FTLThunks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLThunks.h; path = ftl/FTLThunks.h; sourceTree = "<group>"; };
1069
		0F235BCD17178E1C00690C7F /* FTLValueFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLValueFormat.cpp; path = ftl/FTLValueFormat.cpp; sourceTree = "<group>"; };
1070
		0F235BCE17178E1C00690C7F /* FTLValueFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLValueFormat.h; path = ftl/FTLValueFormat.h; sourceTree = "<group>"; };
1071
		0F235BCF17178E1C00690C7F /* FTLValueSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLValueSource.cpp; path = ftl/FTLValueSource.cpp; sourceTree = "<group>"; };
1072
		0F235BD017178E1C00690C7F /* FTLValueSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLValueSource.h; path = ftl/FTLValueSource.h; sourceTree = "<group>"; };
1073
		0F235BE717178E7300690C7F /* DFGOSRExitBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGOSRExitBase.cpp; path = dfg/DFGOSRExitBase.cpp; sourceTree = "<group>"; };
1074
		0F235BE817178E7300690C7F /* DFGOSRExitBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExitBase.h; path = dfg/DFGOSRExitBase.h; sourceTree = "<group>"; };
1075
		0F235BE917178E7300690C7F /* DFGOSRExitPreparation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGOSRExitPreparation.cpp; path = dfg/DFGOSRExitPreparation.cpp; sourceTree = "<group>"; };
1076
		0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExitPreparation.h; path = dfg/DFGOSRExitPreparation.h; sourceTree = "<group>"; };
1025
		0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakReferenceHarvester.h; sourceTree = "<group>"; };
1077
		0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakReferenceHarvester.h; sourceTree = "<group>"; };
1026
		0F256C341627B0AA007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGCallArrayAllocatorSlowPathGenerator.h; path = dfg/DFGCallArrayAllocatorSlowPathGenerator.h; sourceTree = "<group>"; };
1078
		0F256C341627B0AA007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGCallArrayAllocatorSlowPathGenerator.h; path = dfg/DFGCallArrayAllocatorSlowPathGenerator.h; sourceTree = "<group>"; };
1027
		0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGFixupPhase.cpp; path = dfg/DFGFixupPhase.cpp; sourceTree = "<group>"; };
1079
		0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGFixupPhase.cpp; path = dfg/DFGFixupPhase.cpp; sourceTree = "<group>"; };
Lines 2025-2041 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec3
2025
		0FEA09FC1705137F00BB722C /* ftl */ = {
2077
		0FEA09FC1705137F00BB722C /* ftl */ = {
2026
			isa = PBXGroup;
2078
			isa = PBXGroup;
2027
			children = (
2079
			children = (
2080
				0FEA09FD170513DB00BB722C /* FTLAbbreviations.h */,
2028
				0FEA0A171708B00700BB722C /* FTLAbstractHeap.cpp */,
2081
				0FEA0A171708B00700BB722C /* FTLAbstractHeap.cpp */,
2029
				0FEA0A181708B00700BB722C /* FTLAbstractHeap.h */,
2082
				0FEA0A181708B00700BB722C /* FTLAbstractHeap.h */,
2030
				0FEA0A191708B00700BB722C /* FTLAbstractHeapRepository.cpp */,
2083
				0FEA0A191708B00700BB722C /* FTLAbstractHeapRepository.cpp */,
2031
				0FEA0A1A1708B00700BB722C /* FTLAbstractHeapRepository.h */,
2084
				0FEA0A1A1708B00700BB722C /* FTLAbstractHeapRepository.h */,
2032
				0FEA09FD170513DB00BB722C /* FTLAbbreviations.h */,
2033
				0FEA09FE170513DB00BB722C /* FTLCapabilities.cpp */,
2085
				0FEA09FE170513DB00BB722C /* FTLCapabilities.cpp */,
2034
				0FEA09FF170513DB00BB722C /* FTLCapabilities.h */,
2086
				0FEA09FF170513DB00BB722C /* FTLCapabilities.h */,
2087
				0F235BBB17178E1C00690C7F /* FTLCArgumentGetter.cpp */,
2088
				0F235BBC17178E1C00690C7F /* FTLCArgumentGetter.h */,
2035
				0FEA0A251709623B00BB722C /* FTLCommonValues.cpp */,
2089
				0FEA0A251709623B00BB722C /* FTLCommonValues.cpp */,
2036
				0FEA0A211709606900BB722C /* FTLCommonValues.h */,
2090
				0FEA0A211709606900BB722C /* FTLCommonValues.h */,
2037
				0FEA0A00170513DB00BB722C /* FTLCompile.cpp */,
2091
				0FEA0A00170513DB00BB722C /* FTLCompile.cpp */,
2038
				0FEA0A01170513DB00BB722C /* FTLCompile.h */,
2092
				0FEA0A01170513DB00BB722C /* FTLCompile.h */,
2093
				0F235BBD17178E1C00690C7F /* FTLExitArgument.cpp */,
2094
				0F235BBE17178E1C00690C7F /* FTLExitArgument.h */,
2095
				0F235BBF17178E1C00690C7F /* FTLExitArgumentForOperand.cpp */,
2096
				0F235BC017178E1C00690C7F /* FTLExitArgumentForOperand.h */,
2097
				0F235BC117178E1C00690C7F /* FTLExitArgumentList.h */,
2098
				0F235BC217178E1C00690C7F /* FTLExitThunkGenerator.cpp */,
2099
				0F235BC317178E1C00690C7F /* FTLExitThunkGenerator.h */,
2100
				0F235BC417178E1C00690C7F /* FTLExitValue.cpp */,
2101
				0F235BC517178E1C00690C7F /* FTLExitValue.h */,
2039
				0FEA0A2B170B661900BB722C /* FTLFormattedValue.h */,
2102
				0FEA0A2B170B661900BB722C /* FTLFormattedValue.h */,
2040
				0FEA0A261709623B00BB722C /* FTLIntrinsicRepository.cpp */,
2103
				0FEA0A261709623B00BB722C /* FTLIntrinsicRepository.cpp */,
2041
				0FEA0A221709606900BB722C /* FTLIntrinsicRepository.h */,
2104
				0FEA0A221709606900BB722C /* FTLIntrinsicRepository.h */,
Lines 2044-2054 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec4
2044
				0FEA0A131706363600BB722C /* FTLLLVMHeaders.h */,
2107
				0FEA0A131706363600BB722C /* FTLLLVMHeaders.h */,
2045
				0FEA0A04170513DB00BB722C /* FTLLowerDFGToLLVM.cpp */,
2108
				0FEA0A04170513DB00BB722C /* FTLLowerDFGToLLVM.cpp */,
2046
				0FEA0A05170513DB00BB722C /* FTLLowerDFGToLLVM.h */,
2109
				0FEA0A05170513DB00BB722C /* FTLLowerDFGToLLVM.h */,
2110
				0F235BC617178E1C00690C7F /* FTLOSRExit.cpp */,
2111
				0F235BC717178E1C00690C7F /* FTLOSRExit.h */,
2112
				0F235BC817178E1C00690C7F /* FTLOSRExitCompilationInfo.h */,
2113
				0F235BC917178E1C00690C7F /* FTLOSRExitCompiler.cpp */,
2114
				0F235BCA17178E1C00690C7F /* FTLOSRExitCompiler.h */,
2047
				0FEA0A291709629600BB722C /* FTLOutput.cpp */,
2115
				0FEA0A291709629600BB722C /* FTLOutput.cpp */,
2048
				0FEA0A06170513DB00BB722C /* FTLOutput.h */,
2116
				0FEA0A06170513DB00BB722C /* FTLOutput.h */,
2049
				0FEA0A151706BB9000BB722C /* FTLState.cpp */,
2117
				0FEA0A151706BB9000BB722C /* FTLState.cpp */,
2050
				0FEA0A07170513DB00BB722C /* FTLState.h */,
2118
				0FEA0A07170513DB00BB722C /* FTLState.h */,
2119
				0F235BCB17178E1C00690C7F /* FTLThunks.cpp */,
2120
				0F235BCC17178E1C00690C7F /* FTLThunks.h */,
2051
				0FEA0A1B1708B00700BB722C /* FTLTypedPointer.h */,
2121
				0FEA0A1B1708B00700BB722C /* FTLTypedPointer.h */,
2122
				0F235BCD17178E1C00690C7F /* FTLValueFormat.cpp */,
2123
				0F235BCE17178E1C00690C7F /* FTLValueFormat.h */,
2124
				0F235BCF17178E1C00690C7F /* FTLValueSource.cpp */,
2125
				0F235BD017178E1C00690C7F /* FTLValueSource.h */,
2052
			);
2126
			);
2053
			name = ftl;
2127
			name = ftl;
2054
			sourceTree = "<group>";
2128
			sourceTree = "<group>";
Lines 2798-2803 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec5
2798
				0FD82E53141DAEDE00179C94 /* DFGOSREntry.h */,
2872
				0FD82E53141DAEDE00179C94 /* DFGOSREntry.h */,
2799
				0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */,
2873
				0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */,
2800
				0FC097681468A6EF00CF2442 /* DFGOSRExit.h */,
2874
				0FC097681468A6EF00CF2442 /* DFGOSRExit.h */,
2875
				0F235BE717178E7300690C7F /* DFGOSRExitBase.cpp */,
2876
				0F235BE817178E7300690C7F /* DFGOSRExitBase.h */,
2801
				65987F2C167FE84B003C2F8D /* DFGOSRExitCompilationInfo.h */,
2877
				65987F2C167FE84B003C2F8D /* DFGOSRExitCompilationInfo.h */,
2802
				0FC0978F146A6F6300CF2442 /* DFGOSRExitCompiler.cpp */,
2878
				0FC0978F146A6F6300CF2442 /* DFGOSRExitCompiler.cpp */,
2803
				0FC0976F14693AEF00CF2442 /* DFGOSRExitCompiler.h */,
2879
				0FC0976F14693AEF00CF2442 /* DFGOSRExitCompiler.h */,
Lines 2807-2812 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec6
2807
				0F7025A81714B0F800382C0E /* DFGOSRExitCompilerCommon.h */,
2883
				0F7025A81714B0F800382C0E /* DFGOSRExitCompilerCommon.h */,
2808
				0FEFC9A71681A3B000567F53 /* DFGOSRExitJumpPlaceholder.cpp */,
2884
				0FEFC9A71681A3B000567F53 /* DFGOSRExitJumpPlaceholder.cpp */,
2809
				0FEFC9A81681A3B000567F53 /* DFGOSRExitJumpPlaceholder.h */,
2885
				0FEFC9A81681A3B000567F53 /* DFGOSRExitJumpPlaceholder.h */,
2886
				0F235BE917178E7300690C7F /* DFGOSRExitPreparation.cpp */,
2887
				0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */,
2810
				0FFFC94F14EF909500C72532 /* DFGPhase.cpp */,
2888
				0FFFC94F14EF909500C72532 /* DFGPhase.cpp */,
2811
				0FFFC95014EF909500C72532 /* DFGPhase.h */,
2889
				0FFFC95014EF909500C72532 /* DFGPhase.h */,
2812
				0FBE0F6D16C1DB010082C5E8 /* DFGPredictionInjectionPhase.cpp */,
2890
				0FBE0F6D16C1DB010082C5E8 /* DFGPredictionInjectionPhase.cpp */,
Lines 3183-3188 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec7
3183
				0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
3261
				0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
3184
				0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */,
3262
				0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */,
3185
				0F2BDC491522809600CD8910 /* DFGVariableEvent.h in Headers */,
3263
				0F2BDC491522809600CD8910 /* DFGVariableEvent.h in Headers */,
3264
				0F235BD217178E1C00690C7F /* FTLCArgumentGetter.h in Headers */,
3186
				0F2BDC4B1522809D00CD8910 /* DFGVariableEventStream.h in Headers */,
3265
				0F2BDC4B1522809D00CD8910 /* DFGVariableEventStream.h in Headers */,
3187
				0FEA0A241709606900BB722C /* FTLIntrinsicRepository.h in Headers */,
3266
				0FEA0A241709606900BB722C /* FTLIntrinsicRepository.h in Headers */,
3188
				0FEA0A32170D40BF00BB722C /* DFGCommonData.h in Headers */,
3267
				0FEA0A32170D40BF00BB722C /* DFGCommonData.h in Headers */,
Lines 3207-3212 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec8
3207
				BCBE2CAE14E985AA000593AD /* GCAssertions.h in Headers */,
3286
				BCBE2CAE14E985AA000593AD /* GCAssertions.h in Headers */,
3208
				0F766D3015A8DCE2008F363E /* GCAwareJITStubRoutine.h in Headers */,
3287
				0F766D3015A8DCE2008F363E /* GCAwareJITStubRoutine.h in Headers */,
3209
				C2239D1B16262BDD005AC5FD /* GCThread.h in Headers */,
3288
				C2239D1B16262BDD005AC5FD /* GCThread.h in Headers */,
3289
				0F235BE217178E1C00690C7F /* FTLThunks.h in Headers */,
3210
				C21122E215DD9AB300790E3A /* GCThreadSharedData.h in Headers */,
3290
				C21122E215DD9AB300790E3A /* GCThreadSharedData.h in Headers */,
3211
				0F9332A014CA7DCD0085F3C6 /* GetByIdStatus.h in Headers */,
3291
				0F9332A014CA7DCD0085F3C6 /* GetByIdStatus.h in Headers */,
3212
				142E3134134FF0A600AFADB5 /* Handle.h in Headers */,
3292
				142E3134134FF0A600AFADB5 /* Handle.h in Headers */,
Lines 3237-3242 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec9
3237
				BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
3317
				BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
3238
				BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */,
3318
				BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */,
3239
				1429D9300ED22D7000B89619 /* JIT.h in Headers */,
3319
				1429D9300ED22D7000B89619 /* JIT.h in Headers */,
3320
				0F235BD417178E1C00690C7F /* FTLExitArgument.h in Headers */,
3240
				86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */,
3321
				86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */,
3241
				0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */,
3322
				0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */,
3242
				0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */,
3323
				0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */,
Lines 3251-3256 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec10
3251
				A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
3332
				A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
3252
				BC18C4160E16F5CD00B34460 /* JSActivation.h in Headers */,
3333
				BC18C4160E16F5CD00B34460 /* JSActivation.h in Headers */,
3253
				840480131021A1D9008E7F01 /* JSAPIValueWrapper.h in Headers */,
3334
				840480131021A1D9008E7F01 /* JSAPIValueWrapper.h in Headers */,
3335
				0F235BE417178E1C00690C7F /* FTLValueFormat.h in Headers */,
3254
				BC18C4170E16F5CD00B34460 /* JSArray.h in Headers */,
3336
				BC18C4170E16F5CD00B34460 /* JSArray.h in Headers */,
3255
				BC18C4180E16F5CD00B34460 /* JSBase.h in Headers */,
3337
				BC18C4180E16F5CD00B34460 /* JSBase.h in Headers */,
3256
				140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */,
3338
				140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */,
Lines 3308-3316 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec11
3308
				C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */,
3390
				C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */,
3309
				A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */,
3391
				A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */,
3310
				1442566215EDE98D0066A49B /* JSWithScope.h in Headers */,
3392
				1442566215EDE98D0066A49B /* JSWithScope.h in Headers */,
3393
				0F235BD617178E1C00690C7F /* FTLExitArgumentForOperand.h in Headers */,
3311
				86E3C619167BABEE006D760A /* JSWrapperMap.h in Headers */,
3394
				86E3C619167BABEE006D760A /* JSWrapperMap.h in Headers */,
3312
				BC18C42E0E16F5CD00B34460 /* JSWrapperObject.h in Headers */,
3395
				BC18C42E0E16F5CD00B34460 /* JSWrapperObject.h in Headers */,
3313
				0F766D3515AE253B008F363E /* JumpReplacementWatchpoint.h in Headers */,
3396
				0F766D3515AE253B008F363E /* JumpReplacementWatchpoint.h in Headers */,
3397
				0F235BEC17178E7300690C7F /* DFGOSRExitBase.h in Headers */,
3314
				BCFD8C930EEB2EE700283848 /* JumpTable.h in Headers */,
3398
				BCFD8C930EEB2EE700283848 /* JumpTable.h in Headers */,
3315
				A72FFD64139985A800E5365A /* KeywordLookup.h in Headers */,
3399
				A72FFD64139985A800E5365A /* KeywordLookup.h in Headers */,
3316
				969A072A0ED1CE6900F1F681 /* Label.h in Headers */,
3400
				969A072A0ED1CE6900F1F681 /* Label.h in Headers */,
Lines 3341-3346 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec12
3341
				86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */,
3425
				86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */,
3342
				86D3B2C610156BDE002865E7 /* MacroAssemblerARM.h in Headers */,
3426
				86D3B2C610156BDE002865E7 /* MacroAssemblerARM.h in Headers */,
3343
				86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */,
3427
				86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */,
3428
				0F235BDE17178E1C00690C7F /* FTLOSRExitCompilationInfo.h in Headers */,
3344
				0F34B14C16D43E0D001CDA5A /* PolymorphicAccessStructureList.h in Headers */,
3429
				0F34B14C16D43E0D001CDA5A /* PolymorphicAccessStructureList.h in Headers */,
3345
				863B23E00FC6118900703AA4 /* MacroAssemblerCodeRef.h in Headers */,
3430
				863B23E00FC6118900703AA4 /* MacroAssemblerCodeRef.h in Headers */,
3346
				86C568E111A213EE0007F7F0 /* MacroAssemblerMIPS.h in Headers */,
3431
				86C568E111A213EE0007F7F0 /* MacroAssemblerMIPS.h in Headers */,
Lines 3381-3388 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec13
3381
				BC18C4450E16F5CD00B34460 /* ObjectConstructor.h in Headers */,
3466
				BC18C4450E16F5CD00B34460 /* ObjectConstructor.h in Headers */,
3382
				BC18C4460E16F5CD00B34460 /* ObjectPrototype.h in Headers */,
3467
				BC18C4460E16F5CD00B34460 /* ObjectPrototype.h in Headers */,
3383
				E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */,
3468
				E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */,
3469
				0F235BD917178E1C00690C7F /* FTLExitThunkGenerator.h in Headers */,
3384
				969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */,
3470
				969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */,
3385
				0F2BDC2C151FDE9100CD8910 /* Operands.h in Headers */,
3471
				0F2BDC2C151FDE9100CD8910 /* Operands.h in Headers */,
3472
				0F235BD717178E1C00690C7F /* FTLExitArgumentList.h in Headers */,
3386
				BC18C4480E16F5CD00B34460 /* Operations.h in Headers */,
3473
				BC18C4480E16F5CD00B34460 /* Operations.h in Headers */,
3387
				0FE228ED1436AB2700196C48 /* Options.h in Headers */,
3474
				0FE228ED1436AB2700196C48 /* Options.h in Headers */,
3388
				BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */,
3475
				BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */,
Lines 3408-3413 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec14
3408
				0FF729C0166AD360000F5BA3 /* ProfilerOriginStack.h in Headers */,
3495
				0FF729C0166AD360000F5BA3 /* ProfilerOriginStack.h in Headers */,
3409
				0FB1058C1675483300F8AB6E /* ProfilerOSRExit.h in Headers */,
3496
				0FB1058C1675483300F8AB6E /* ProfilerOSRExit.h in Headers */,
3410
				0FB1058E1675483A00F8AB6E /* ProfilerOSRExitSite.h in Headers */,
3497
				0FB1058E1675483A00F8AB6E /* ProfilerOSRExitSite.h in Headers */,
3498
				0F235BE617178E1C00690C7F /* FTLValueSource.h in Headers */,
3411
				0F13912C16771C3D009CCB07 /* ProfilerProfiledBytecodes.h in Headers */,
3499
				0F13912C16771C3D009CCB07 /* ProfilerProfiledBytecodes.h in Headers */,
3412
				A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */,
3500
				A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */,
3413
				BC95437D0EBA70FD0072B6D3 /* PropertyMapHashTable.h in Headers */,
3501
				BC95437D0EBA70FD0072B6D3 /* PropertyMapHashTable.h in Headers */,
Lines 3420-3425 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec15
3420
				1474C33B16AA2D950062F01D /* PrototypeMap.h in Headers */,
3508
				1474C33B16AA2D950062F01D /* PrototypeMap.h in Headers */,
3421
				0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */,
3509
				0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */,
3422
				0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */,
3510
				0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */,
3511
				0F235BDB17178E1C00690C7F /* FTLExitValue.h in Headers */,
3423
				0F9FC8C514E1B60400D52AE0 /* PutKind.h in Headers */,
3512
				0F9FC8C514E1B60400D52AE0 /* PutKind.h in Headers */,
3424
				147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
3513
				147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
3425
				0FF60AC216740F8300029779 /* ReduceWhitespace.h in Headers */,
3514
				0FF60AC216740F8300029779 /* ReduceWhitespace.h in Headers */,
Lines 3445-3450 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec16
3445
				C2160FE715F7E95E00942DFC /* SlotVisitorInlines.h in Headers */,
3534
				C2160FE715F7E95E00942DFC /* SlotVisitorInlines.h in Headers */,
3446
				933040040E6A749400786E6A /* SmallStrings.h in Headers */,
3535
				933040040E6A749400786E6A /* SmallStrings.h in Headers */,
3447
				BC18C4640E16F5CD00B34460 /* SourceCode.h in Headers */,
3536
				BC18C4640E16F5CD00B34460 /* SourceCode.h in Headers */,
3537
				0F235BE017178E1C00690C7F /* FTLOSRExitCompiler.h in Headers */,
3448
				BC18C4630E16F5CD00B34460 /* SourceProvider.h in Headers */,
3538
				BC18C4630E16F5CD00B34460 /* SourceProvider.h in Headers */,
3449
				E49DC16C12EF294E00184A1F /* SourceProviderCache.h in Headers */,
3539
				E49DC16C12EF294E00184A1F /* SourceProviderCache.h in Headers */,
3450
				E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */,
3540
				E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */,
Lines 3519-3529 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec17
3519
				0FBE0F7716C1DB120082C5E8 /* DFGUnificationPhase.h in Headers */,
3609
				0FBE0F7716C1DB120082C5E8 /* DFGUnificationPhase.h in Headers */,
3520
				0FD2C92416D01EE900C7803F /* StructureInlines.h in Headers */,
3610
				0FD2C92416D01EE900C7803F /* StructureInlines.h in Headers */,
3521
				0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */,
3611
				0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */,
3612
				0F235BDD17178E1C00690C7F /* FTLOSRExit.h in Headers */,
3522
				0F2E892D16D02BAF009E4FD2 /* DFGMinifiedID.h in Headers */,
3613
				0F2E892D16D02BAF009E4FD2 /* DFGMinifiedID.h in Headers */,
3523
				0FFB921816D02EB20055A5DB /* DFGAllocator.h in Headers */,
3614
				0FFB921816D02EB20055A5DB /* DFGAllocator.h in Headers */,
3524
				0FFB921A16D02EC50055A5DB /* DFGBasicBlockInlines.h in Headers */,
3615
				0FFB921A16D02EC50055A5DB /* DFGBasicBlockInlines.h in Headers */,
3525
				0FFB921B16D02F010055A5DB /* DFGNodeAllocator.h in Headers */,
3616
				0FFB921B16D02F010055A5DB /* DFGNodeAllocator.h in Headers */,
3526
				0FFB921C16D02F110055A5DB /* DFGOSRExitCompilationInfo.h in Headers */,
3617
				0FFB921C16D02F110055A5DB /* DFGOSRExitCompilationInfo.h in Headers */,
3618
				0F235BEE17178E7300690C7F /* DFGOSRExitPreparation.h in Headers */,
3527
				0FFB921D16D02F300055A5DB /* DFGSlowPathGenerator.h in Headers */,
3619
				0FFB921D16D02F300055A5DB /* DFGSlowPathGenerator.h in Headers */,
3528
				0FFB921E16D02F470055A5DB /* DFGVariadicFunction.h in Headers */,
3620
				0FFB921E16D02F470055A5DB /* DFGVariadicFunction.h in Headers */,
3529
				0FFB921F16D033050055A5DB /* (null) in Headers */,
3621
				0FFB921F16D033050055A5DB /* (null) in Headers */,
Lines 3917-3927 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec18
3917
				0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */,
4009
				0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */,
3918
				0F16015D156198C900C2587C /* DFGArgumentsSimplificationPhase.cpp in Sources */,
4010
				0F16015D156198C900C2587C /* DFGArgumentsSimplificationPhase.cpp in Sources */,
3919
				0F63948415E48118006A597C /* DFGArrayMode.cpp in Sources */,
4011
				0F63948415E48118006A597C /* DFGArrayMode.cpp in Sources */,
4012
				0F235BD517178E1C00690C7F /* FTLExitArgumentForOperand.cpp in Sources */,
3920
				0FC0976E1468AB5100CF2442 /* DFGAssemblyHelpers.cpp in Sources */,
4013
				0FC0976E1468AB5100CF2442 /* DFGAssemblyHelpers.cpp in Sources */,
3921
				86EC9DC41328DF82002B2AD7 /* DFGByteCodeParser.cpp in Sources */,
4014
				86EC9DC41328DF82002B2AD7 /* DFGByteCodeParser.cpp in Sources */,
4015
				0F235BD817178E1C00690C7F /* FTLExitThunkGenerator.cpp in Sources */,
3922
				0FD82E2114172CE300179C94 /* DFGCapabilities.cpp in Sources */,
4016
				0FD82E2114172CE300179C94 /* DFGCapabilities.cpp in Sources */,
3923
				0FFFC95714EF90A000C72532 /* DFGCFAPhase.cpp in Sources */,
4017
				0FFFC95714EF90A000C72532 /* DFGCFAPhase.cpp in Sources */,
3924
				0F3B3A271544C995003ED0FF /* DFGCFGSimplificationPhase.cpp in Sources */,
4018
				0F3B3A271544C995003ED0FF /* DFGCFGSimplificationPhase.cpp in Sources */,
4019
				0F235BD117178E1C00690C7F /* FTLCArgumentGetter.cpp in Sources */,
3925
				0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */,
4020
				0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */,
3926
				0FF0F19D16B72A08005DF95B /* DFGCommon.cpp in Sources */,
4021
				0FF0F19D16B72A08005DF95B /* DFGCommon.cpp in Sources */,
3927
				0F3B3A1A153E68F2003ED0FF /* DFGConstantFoldingPhase.cpp in Sources */,
4022
				0F3B3A1A153E68F2003ED0FF /* DFGConstantFoldingPhase.cpp in Sources */,
Lines 3933-3944 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec19
3933
				0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */,
4028
				0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */,
3934
				C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.cpp in Sources */,
4029
				C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.cpp in Sources */,
3935
				0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */,
4030
				0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */,
4031
				0F235BDA17178E1C00690C7F /* FTLExitValue.cpp in Sources */,
3936
				86EC9DC71328DF82002B2AD7 /* DFGGraph.cpp in Sources */,
4032
				86EC9DC71328DF82002B2AD7 /* DFGGraph.cpp in Sources */,
3937
				0FEA0A271709623B00BB722C /* FTLCommonValues.cpp in Sources */,
4033
				0FEA0A271709623B00BB722C /* FTLCommonValues.cpp in Sources */,
3938
				86EC9DCB1328DF82002B2AD7 /* DFGJITCompiler.cpp in Sources */,
4034
				86EC9DCB1328DF82002B2AD7 /* DFGJITCompiler.cpp in Sources */,
3939
				0FF0F19916B729F6005DF95B /* DFGLongLivedState.cpp in Sources */,
4035
				0FF0F19916B729F6005DF95B /* DFGLongLivedState.cpp in Sources */,
3940
				0F2BDC4D1522818600CD8910 /* DFGMinifiedNode.cpp in Sources */,
4036
				0F2BDC4D1522818600CD8910 /* DFGMinifiedNode.cpp in Sources */,
3941
				0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
4037
				0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
4038
				0F235BED17178E7300690C7F /* DFGOSRExitPreparation.cpp in Sources */,
3942
				0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */,
4039
				0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */,
3943
				86EC9DCF1328DF82002B2AD7 /* DFGOperations.cpp in Sources */,
4040
				86EC9DCF1328DF82002B2AD7 /* DFGOperations.cpp in Sources */,
3944
				0FD82E56141DAF0800179C94 /* DFGOSREntry.cpp in Sources */,
4041
				0FD82E56141DAF0800179C94 /* DFGOSREntry.cpp in Sources */,
Lines 3998-4003 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec20
3998
				1429D92F0ED22D7000B89619 /* JIT.cpp in Sources */,
4095
				1429D92F0ED22D7000B89619 /* JIT.cpp in Sources */,
3999
				86A90ED00EE7D51F00AB350D /* JITArithmetic.cpp in Sources */,
4096
				86A90ED00EE7D51F00AB350D /* JITArithmetic.cpp in Sources */,
4000
				A75706DE118A2BCF0057F88F /* JITArithmetic32_64.cpp in Sources */,
4097
				A75706DE118A2BCF0057F88F /* JITArithmetic32_64.cpp in Sources */,
4098
				0F235BEB17178E7300690C7F /* DFGOSRExitBase.cpp in Sources */,
4001
				86CC85A30EE79B7400288682 /* JITCall.cpp in Sources */,
4099
				86CC85A30EE79B7400288682 /* JITCall.cpp in Sources */,
4002
				146FE51211A710430087AE66 /* JITCall32_64.cpp in Sources */,
4100
				146FE51211A710430087AE66 /* JITCall32_64.cpp in Sources */,
4003
				0F8F94441667635400D61971 /* JITCode.cpp in Sources */,
4101
				0F8F94441667635400D61971 /* JITCode.cpp in Sources */,
Lines 4016-4021 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec21
4016
				140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */,
4114
				140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */,
4017
				147F39D0107EC37600427A48 /* JSArray.cpp in Sources */,
4115
				147F39D0107EC37600427A48 /* JSArray.cpp in Sources */,
4018
				1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */,
4116
				1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */,
4117
				0F235BE517178E1C00690C7F /* FTLValueSource.cpp in Sources */,
4019
				86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */,
4118
				86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */,
4020
				1440F8AF0A508D200005F061 /* JSCallbackConstructor.cpp in Sources */,
4119
				1440F8AF0A508D200005F061 /* JSCallbackConstructor.cpp in Sources */,
4021
				1440F8920A508B100005F061 /* JSCallbackFunction.cpp in Sources */,
4120
				1440F8920A508B100005F061 /* JSCallbackFunction.cpp in Sources */,
Lines 4037-4042 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec22
4037
				147F39D4107EC37600427A48 /* JSObject.cpp in Sources */,
4136
				147F39D4107EC37600427A48 /* JSObject.cpp in Sources */,
4038
				1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */,
4137
				1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */,
4039
				A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */,
4138
				A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */,
4139
				0F235BDF17178E1C00690C7F /* FTLOSRExitCompiler.cpp in Sources */,
4040
				95F6E6950E5B5F970091E860 /* JSProfilerPrivate.cpp in Sources */,
4140
				95F6E6950E5B5F970091E860 /* JSProfilerPrivate.cpp in Sources */,
4041
				A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */,
4141
				A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */,
4042
				862553D116136DA9009F17D0 /* JSProxy.cpp in Sources */,
4142
				862553D116136DA9009F17D0 /* JSProxy.cpp in Sources */,
Lines 4105-4115 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec23
4105
				0F9FC8C314E1B5FE00D52AE0 /* PolymorphicPutByIdList.cpp in Sources */,
4205
				0F9FC8C314E1B5FE00D52AE0 /* PolymorphicPutByIdList.cpp in Sources */,
4106
				95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
4206
				95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
4107
				95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
4207
				95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
4208
				0F235BE317178E1C00690C7F /* FTLValueFormat.cpp in Sources */,
4108
				95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
4209
				95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
4109
				0FF729AD166AD35C000F5BA3 /* ProfilerBytecode.cpp in Sources */,
4210
				0FF729AD166AD35C000F5BA3 /* ProfilerBytecode.cpp in Sources */,
4110
				0FF729AE166AD35C000F5BA3 /* ProfilerBytecodes.cpp in Sources */,
4211
				0FF729AE166AD35C000F5BA3 /* ProfilerBytecodes.cpp in Sources */,
4212
				0F235BDC17178E1C00690C7F /* FTLOSRExit.cpp in Sources */,
4111
				0F13912916771C33009CCB07 /* ProfilerBytecodeSequence.cpp in Sources */,
4213
				0F13912916771C33009CCB07 /* ProfilerBytecodeSequence.cpp in Sources */,
4112
				0FF729AF166AD35C000F5BA3 /* ProfilerCompilation.cpp in Sources */,
4214
				0FF729AF166AD35C000F5BA3 /* ProfilerCompilation.cpp in Sources */,
4215
				0F235BE117178E1C00690C7F /* FTLThunks.cpp in Sources */,
4113
				0FF729B0166AD35C000F5BA3 /* ProfilerCompilationKind.cpp in Sources */,
4216
				0FF729B0166AD35C000F5BA3 /* ProfilerCompilationKind.cpp in Sources */,
4114
				0FEA0A33170D40BF00BB722C /* DFGJITCode.cpp in Sources */,
4217
				0FEA0A33170D40BF00BB722C /* DFGJITCode.cpp in Sources */,
4115
				0FF729B1166AD35C000F5BA3 /* ProfilerCompiledBytecode.cpp in Sources */,
4218
				0FF729B1166AD35C000F5BA3 /* ProfilerCompiledBytecode.cpp in Sources */,
Lines 4131-4136 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec24
4131
				A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
4234
				A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
4132
				8642C510151C06A90046D4EF /* RegExpCachedResult.cpp in Sources */,
4235
				8642C510151C06A90046D4EF /* RegExpCachedResult.cpp in Sources */,
4133
				14280842107EC0930013E7B2 /* RegExpConstructor.cpp in Sources */,
4236
				14280842107EC0930013E7B2 /* RegExpConstructor.cpp in Sources */,
4237
				0F235BD317178E1C00690C7F /* FTLExitArgument.cpp in Sources */,
4134
				8642C512151C083D0046D4EF /* RegExpMatchesArray.cpp in Sources */,
4238
				8642C512151C083D0046D4EF /* RegExpMatchesArray.cpp in Sources */,
4135
				14280843107EC0930013E7B2 /* RegExpObject.cpp in Sources */,
4239
				14280843107EC0930013E7B2 /* RegExpObject.cpp in Sources */,
4136
				14280844107EC0930013E7B2 /* RegExpPrototype.cpp in Sources */,
4240
				14280844107EC0930013E7B2 /* RegExpPrototype.cpp in Sources */,
- Source/JavaScriptCore/assembler/AbstractMacroAssembler.h +5 lines
Lines 88-93 public: Source/JavaScriptCore/assembler/AbstractMacroAssembler.h_sec1
88
            , offset(offset)
88
            , offset(offset)
89
        {
89
        {
90
        }
90
        }
91
        
92
        Address withOffset(int32_t additionalOffset)
93
        {
94
            return Address(base, offset + additionalOffset);
95
        }
91
96
92
        RegisterID base;
97
        RegisterID base;
93
        int32_t offset;
98
        int32_t offset;
- Source/JavaScriptCore/assembler/LinkBuffer.h +5 lines
Lines 199-204 public: Source/JavaScriptCore/assembler/LinkBuffer.h_sec1
199
        return applyOffset(label.m_label).m_offset;
199
        return applyOffset(label.m_label).m_offset;
200
    }
200
    }
201
201
202
    unsigned offsetOf(PatchableJump jump)
203
    {
204
        return applyOffset(jump.m_jump.m_label).m_offset;
205
    }
206
202
    // Upon completion of all patching 'FINALIZE_CODE()' should be called once to
207
    // Upon completion of all patching 'FINALIZE_CODE()' should be called once to
203
    // complete generation of the code. Alternatively, call
208
    // complete generation of the code. Alternatively, call
204
    // finalizeCodeWithoutDisassembly() directly if you have your own way of
209
    // finalizeCodeWithoutDisassembly() directly if you have your own way of
- Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h +1 lines
Lines 93-98 public: Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h_sec1
93
        DoubleConditionBits_should_not_interfere_with_X86Assembler_Condition_codes);
93
        DoubleConditionBits_should_not_interfere_with_X86Assembler_Condition_codes);
94
94
95
    static const RegisterID stackPointerRegister = X86Registers::esp;
95
    static const RegisterID stackPointerRegister = X86Registers::esp;
96
    static const RegisterID framePointerRegister = X86Registers::ebp;
96
97
97
#if ENABLE(JIT_CONSTANT_BLINDING)
98
#if ENABLE(JIT_CONSTANT_BLINDING)
98
    static bool shouldBlindForSpecificArch(uint32_t value) { return value >= 0x00ffffff; }
99
    static bool shouldBlindForSpecificArch(uint32_t value) { return value >= 0x00ffffff; }
- Source/JavaScriptCore/dfg/DFGAbstractState.cpp -1 / +2 lines
Lines 95-101 void AbstractState::initialize(Graph& gr Source/JavaScriptCore/dfg/DFGAbstractState.cpp_sec1
95
            continue;
95
            continue;
96
        }
96
        }
97
        
97
        
98
        SpeculatedType prediction = node->variableAccessData()->prediction();
98
        SpeculatedType prediction =
99
            node->variableAccessData()->argumentAwarePrediction();
99
        if (isInt32Speculation(prediction))
100
        if (isInt32Speculation(prediction))
100
            root->valuesAtHead.argument(i).set(SpecInt32);
101
            root->valuesAtHead.argument(i).set(SpecInt32);
101
        else if (isBooleanSpeculation(prediction))
102
        else if (isBooleanSpeculation(prediction))
- Source/JavaScriptCore/dfg/DFGGPRInfo.h -2 / +2 lines
Lines 36-42 Source/JavaScriptCore/dfg/DFGGPRInfo.h_sec1
36
namespace JSC { namespace DFG {
36
namespace JSC { namespace DFG {
37
37
38
typedef MacroAssembler::RegisterID GPRReg;
38
typedef MacroAssembler::RegisterID GPRReg;
39
#define InvalidGPRReg ((GPRReg)-1)
39
#define InvalidGPRReg ((::JSC::DFG::GPRReg)-1)
40
40
41
#if USE(JSVALUE64)
41
#if USE(JSVALUE64)
42
class JSValueRegs {
42
class JSValueRegs {
Lines 367-373 public: Source/JavaScriptCore/dfg/DFGGPRInfo.h_sec2
367
        static const GPRReg registerForIndex[numberOfArgumentRegisters] = { argumentGPR0, argumentGPR1, argumentGPR2, argumentGPR3, argumentGPR4, argumentGPR5 };
367
        static const GPRReg registerForIndex[numberOfArgumentRegisters] = { argumentGPR0, argumentGPR1, argumentGPR2, argumentGPR3, argumentGPR4, argumentGPR5 };
368
        return registerForIndex[index];
368
        return registerForIndex[index];
369
    }
369
    }
370
370
    
371
    static unsigned toIndex(GPRReg reg)
371
    static unsigned toIndex(GPRReg reg)
372
    {
372
    {
373
        ASSERT(reg != InvalidGPRReg);
373
        ASSERT(reg != InvalidGPRReg);
- Source/JavaScriptCore/dfg/DFGMinifiedNode.h +1 lines
Lines 51-56 inline bool belongsInMinifiedGraph(NodeT Source/JavaScriptCore/dfg/DFGMinifiedNode.h_sec1
51
    case PhantomArguments:
51
    case PhantomArguments:
52
        return true;
52
        return true;
53
    default:
53
    default:
54
        ASSERT(!needsOSRBackwardRewiring(type) && !needsOSRForwardRewiring(type));
54
        return false;
55
        return false;
55
    }
56
    }
56
}
57
}
- Source/JavaScriptCore/dfg/DFGNodeType.h +19 lines
Lines 287-292 inline NodeFlags defaultFlags(NodeType o Source/JavaScriptCore/dfg/DFGNodeType.h_sec1
287
    }
287
    }
288
}
288
}
289
289
290
inline bool needsOSRBackwardRewiring(NodeType op)
291
{
292
    return op == UInt32ToNumber;
293
}
294
295
inline bool needsOSRForwardRewiring(NodeType op)
296
{
297
    switch (op) {
298
    case Int32ToDouble:
299
    case ForwardInt32ToDouble:
300
    case ValueToInt32:
301
    case UInt32ToNumber:
302
    case DoubleAsInt32:
303
        return true;
304
    default:
305
        return false;
306
    }
307
}
308
290
} } // namespace JSC::DFG
309
} } // namespace JSC::DFG
291
310
292
#endif // ENABLE(DFG_JIT)
311
#endif // ENABLE(DFG_JIT)
- Source/JavaScriptCore/dfg/DFGOSRExit.cpp -53 / +8 lines
Lines 36-50 Source/JavaScriptCore/dfg/DFGOSRExit.cpp_sec1
36
namespace JSC { namespace DFG {
36
namespace JSC { namespace DFG {
37
37
38
OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAValueProfile valueProfile, SpeculativeJIT* jit, unsigned streamIndex, unsigned recoveryIndex)
38
OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAValueProfile valueProfile, SpeculativeJIT* jit, unsigned streamIndex, unsigned recoveryIndex)
39
    : m_jsValueSource(jsValueSource)
39
    : OSRExitBase(kind, jit->m_codeOriginForOSR)
40
    , m_jsValueSource(jsValueSource)
40
    , m_valueProfile(valueProfile)
41
    , m_valueProfile(valueProfile)
41
    , m_patchableCodeOffset(0)
42
    , m_patchableCodeOffset(0)
42
    , m_codeOrigin(jit->m_codeOriginForOSR)
43
    , m_codeOriginForExitProfile(m_codeOrigin)
44
    , m_recoveryIndex(recoveryIndex)
43
    , m_recoveryIndex(recoveryIndex)
45
    , m_watchpointIndex(std::numeric_limits<unsigned>::max())
44
    , m_watchpointIndex(std::numeric_limits<unsigned>::max())
46
    , m_kind(kind)
47
    , m_count(0)
48
    , m_streamIndex(streamIndex)
45
    , m_streamIndex(streamIndex)
49
    , m_lastSetOperand(jit->m_lastSetOperand)
46
    , m_lastSetOperand(jit->m_lastSetOperand)
50
{
47
{
Lines 73-129 void OSRExit::correctJump(LinkBuffer& li Source/JavaScriptCore/dfg/DFGOSRExit.cpp_sec2
73
    m_patchableCodeOffset = linkBuffer.offsetOf(label);
70
    m_patchableCodeOffset = linkBuffer.offsetOf(label);
74
}
71
}
75
72
76
bool OSRExit::considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock)
77
{
78
    if (static_cast<double>(m_count) / dfgCodeBlock->osrExitCounter() <= Options::osrExitProminenceForFrequentExitSite())
79
        return false;
80
    
81
    FrequentExitSite exitSite;
82
    
83
    if (m_kind == ArgumentsEscaped) {
84
        // Count this one globally. It doesn't matter where in the code block the arguments excaped;
85
        // the fact that they did is not associated with any particular instruction.
86
        exitSite = FrequentExitSite(m_kind);
87
    } else
88
        exitSite = FrequentExitSite(m_codeOriginForExitProfile.bytecodeIndex, m_kind);
89
    
90
    return baselineCodeBlockForOriginAndBaselineCodeBlock(m_codeOriginForExitProfile, profiledCodeBlock)->addFrequentExitSite(exitSite);
91
}
92
93
void OSRExit::convertToForward(BasicBlock* block, Node* currentNode, unsigned nodeIndex, const ValueRecovery& valueRecovery)
73
void OSRExit::convertToForward(BasicBlock* block, Node* currentNode, unsigned nodeIndex, const ValueRecovery& valueRecovery)
94
{
74
{
95
    // Check that either the current node is a SetLocal, or the preceding node was a
75
    Node* node;
96
    // SetLocal with the same code origin, or that we've provided a valueRecovery.
76
    Node* lastMovHint;
97
    if (!ASSERT_DISABLED
77
    if (!doSearchForForwardConversion(block, currentNode, nodeIndex, !!valueRecovery, node, lastMovHint))
98
        && !valueRecovery
78
        return;
99
        && !currentNode->containsMovHint()) {
79
100
        Node* setLocal = block->at(nodeIndex - 1);
101
        ASSERT_UNUSED(setLocal, setLocal->containsMovHint());
102
        ASSERT_UNUSED(setLocal, setLocal->codeOrigin == currentNode->codeOrigin);
103
    }
104
    
105
    // Find the first node for the next bytecode instruction. Also track the last mov hint
106
    // on this node.
107
    unsigned indexInBlock = nodeIndex + 1;
108
    Node* node = 0;
109
    Node* lastMovHint = 0;
110
    for (;;) {
111
        if (indexInBlock == block->size()) {
112
            // This is an inline return. Give up and do a backwards speculation. This is safe
113
            // because an inline return has its own bytecode index and it's always safe to
114
            // reexecute that bytecode.
115
            ASSERT(node->op() == Jump);
116
            return;
117
        }
118
        node = block->at(indexInBlock);
119
        if (node->containsMovHint() && node->child1() == currentNode)
120
            lastMovHint = node;
121
        if (node->codeOrigin != currentNode->codeOrigin)
122
            break;
123
        indexInBlock++;
124
    }
125
    
126
    ASSERT(node->codeOrigin != currentNode->codeOrigin);
80
    ASSERT(node->codeOrigin != currentNode->codeOrigin);
81
    
127
    m_codeOrigin = node->codeOrigin;
82
    m_codeOrigin = node->codeOrigin;
128
    
83
    
129
    if (!valueRecovery)
84
    if (!valueRecovery)
- Source/JavaScriptCore/dfg/DFGOSRExit.h -17 / +3 lines
Lines 1-5 Source/JavaScriptCore/dfg/DFGOSRExit.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2011 Apple Inc. All rights reserved.
2
 * Copyright (C) 2011, 2013 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 34-39 Source/JavaScriptCore/dfg/DFGOSRExit.h_sec2
34
#include "DFGCommon.h"
34
#include "DFGCommon.h"
35
#include "DFGExitProfile.h"
35
#include "DFGExitProfile.h"
36
#include "DFGGPRInfo.h"
36
#include "DFGGPRInfo.h"
37
#include "DFGOSRExitBase.h"
37
#include "DFGValueRecoveryOverride.h"
38
#include "DFGValueRecoveryOverride.h"
38
#include "MacroAssembler.h"
39
#include "MacroAssembler.h"
39
#include "MethodOfGettingAValueProfile.h"
40
#include "MethodOfGettingAValueProfile.h"
Lines 84-90 private: Source/JavaScriptCore/dfg/DFGOSRExit.h_sec3
84
//
85
//
85
// This structure describes how to exit the speculative path by
86
// This structure describes how to exit the speculative path by
86
// going into baseline code.
87
// going into baseline code.
87
struct OSRExit {
88
struct OSRExit : public OSRExitBase {
88
    OSRExit(ExitKind, JSValueSource, MethodOfGettingAValueProfile, SpeculativeJIT*, unsigned streamIndex, unsigned recoveryIndex = UINT_MAX);
89
    OSRExit(ExitKind, JSValueSource, MethodOfGettingAValueProfile, SpeculativeJIT*, unsigned streamIndex, unsigned recoveryIndex = UINT_MAX);
89
    
90
    
90
    MacroAssemblerCodeRef m_code;
91
    MacroAssemblerCodeRef m_code;
Lines 93-114 struct OSRExit { Source/JavaScriptCore/dfg/DFGOSRExit.h_sec4
93
    MethodOfGettingAValueProfile m_valueProfile;
94
    MethodOfGettingAValueProfile m_valueProfile;
94
95
95
    unsigned m_patchableCodeOffset;
96
    unsigned m_patchableCodeOffset;
96
    CodeOrigin m_codeOrigin;
97
    CodeOrigin m_codeOriginForExitProfile;
98
    
97
    
99
    unsigned m_recoveryIndex;
98
    unsigned m_recoveryIndex;
100
    unsigned m_watchpointIndex;
99
    unsigned m_watchpointIndex;
101
    
100
    
102
    ExitKind m_kind;
103
    uint32_t m_count;
104
    
105
    bool considerAddingAsFrequentExitSite(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock)
106
    {
107
        if (!m_count || !exitKindIsCountable(m_kind))
108
            return false;
109
        return considerAddingAsFrequentExitSiteSlow(dfgCodeBlock, profiledCodeBlock);
110
    }
111
112
    void setPatchableCodeOffset(MacroAssembler::PatchableJump);
101
    void setPatchableCodeOffset(MacroAssembler::PatchableJump);
113
    MacroAssembler::Jump getPatchableCodeOffsetAsJump() const;
102
    MacroAssembler::Jump getPatchableCodeOffsetAsJump() const;
114
    CodeLocationJump codeLocationForRepatch(CodeBlock*) const;
103
    CodeLocationJump codeLocationForRepatch(CodeBlock*) const;
Lines 120-128 struct OSRExit { Source/JavaScriptCore/dfg/DFGOSRExit.h_sec5
120
    int m_lastSetOperand;
109
    int m_lastSetOperand;
121
    
110
    
122
    RefPtr<ValueRecoveryOverride> m_valueRecoveryOverride;
111
    RefPtr<ValueRecoveryOverride> m_valueRecoveryOverride;
123
124
private:
125
    bool considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock);
126
};
112
};
127
113
128
struct SpeculationFailureDebugInfo {
114
struct SpeculationFailureDebugInfo {
- Source/JavaScriptCore/dfg/DFGOSRExitBase.cpp +97 lines
Line 0 Source/JavaScriptCore/dfg/DFGOSRExitBase.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "DFGOSRExitBase.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "CodeBlock.h"
32
#include "DFGBasicBlock.h"
33
#include "DFGNode.h"
34
#include "Operations.h"
35
36
namespace JSC { namespace DFG {
37
38
bool OSRExitBase::considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock)
39
{
40
    if (static_cast<double>(m_count) / dfgCodeBlock->osrExitCounter() <= Options::osrExitProminenceForFrequentExitSite())
41
        return false;
42
    
43
    FrequentExitSite exitSite;
44
    
45
    if (m_kind == ArgumentsEscaped) {
46
        // Count this one globally. It doesn't matter where in the code block the arguments excaped;
47
        // the fact that they did is not associated with any particular instruction.
48
        exitSite = FrequentExitSite(m_kind);
49
    } else
50
        exitSite = FrequentExitSite(m_codeOriginForExitProfile.bytecodeIndex, m_kind);
51
    
52
    return baselineCodeBlockForOriginAndBaselineCodeBlock(m_codeOriginForExitProfile, profiledCodeBlock)->addFrequentExitSite(exitSite);
53
}
54
55
bool OSRExitBase::doSearchForForwardConversion(
56
    BasicBlock* block, Node* currentNode, unsigned nodeIndex, bool hasValueRecovery,
57
    Node*& node, Node*& lastMovHint)
58
{
59
    // Check that either the current node is a SetLocal, or the preceding node was a
60
    // SetLocal with the same code origin, or that we've provided a valueRecovery.
61
    if (!ASSERT_DISABLED
62
        && !hasValueRecovery
63
        && !currentNode->containsMovHint()) {
64
        Node* setLocal = block->at(nodeIndex - 1);
65
        ASSERT_UNUSED(setLocal, setLocal->containsMovHint());
66
        ASSERT_UNUSED(setLocal, setLocal->codeOrigin == currentNode->codeOrigin);
67
    }
68
    
69
    // Find the first node for the next bytecode instruction. Also track the last mov hint
70
    // on this node.
71
    unsigned indexInBlock = nodeIndex + 1;
72
    node = 0;
73
    lastMovHint = 0;
74
    for (;;) {
75
        if (indexInBlock == block->size()) {
76
            // This is an inline return. Give up and do a backwards speculation. This is safe
77
            // because an inline return has its own bytecode index and it's always safe to
78
            // reexecute that bytecode.
79
            ASSERT(node->op() == Jump);
80
            return false;
81
        }
82
        node = block->at(indexInBlock);
83
        if (node->containsMovHint() && node->child1() == currentNode)
84
            lastMovHint = node;
85
        if (node->codeOrigin != currentNode->codeOrigin)
86
            break;
87
        indexInBlock++;
88
    }
89
    
90
    ASSERT(node->codeOrigin != currentNode->codeOrigin);
91
    return true;
92
}
93
94
} } // namespace JSC::DFG
95
96
#endif // ENABLE(DFG_JIT)
97
- Source/JavaScriptCore/dfg/DFGOSRExitBase.h +80 lines
Line 0 Source/JavaScriptCore/dfg/DFGOSRExitBase.h_sec1
1
/*
2
 * Copyright (C) 2013 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 DFGOSRExitBase_h
27
#define DFGOSRExitBase_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(DFG_JIT)
32
33
#include "CodeOrigin.h"
34
#include "DFGExitProfile.h"
35
36
namespace JSC { namespace DFG {
37
38
struct BasicBlock;
39
struct Node;
40
41
// Provides for the OSR exit profiling functionality that is common between the DFG
42
// and the FTL.
43
44
struct OSRExitBase {
45
    OSRExitBase(ExitKind kind, CodeOrigin origin)
46
        : m_kind(kind)
47
        , m_count(0)
48
        , m_codeOrigin(origin)
49
        , m_codeOriginForExitProfile(origin)
50
    {
51
    }
52
    
53
    ExitKind m_kind;
54
    uint32_t m_count;
55
    
56
    CodeOrigin m_codeOrigin;
57
    CodeOrigin m_codeOriginForExitProfile;
58
59
    bool considerAddingAsFrequentExitSite(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock)
60
    {
61
        if (!m_count || !exitKindIsCountable(m_kind))
62
            return false;
63
        return considerAddingAsFrequentExitSiteSlow(dfgCodeBlock, profiledCodeBlock);
64
    }
65
    
66
    // Returns true if the forward conversion is really needed.
67
    bool doSearchForForwardConversion(
68
        BasicBlock*, Node* currentNode, unsigned nodeIndex, bool hasValueRecovery,
69
        Node*& nextBCNode, Node*& lastMovHint);
70
71
private:
72
    bool considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock);
73
};
74
75
} } // namespace JSC::DFG
76
77
#endif // ENABLE(DFG_JIT)
78
79
#endif // DFGOSRExitBase_h
80
- Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp -1 / +1 lines
Lines 653-659 void OSRExitCompiler::compileExit(const Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp_sec1
653
    // 16) Load the result of the last bytecode operation into regT0.
653
    // 16) Load the result of the last bytecode operation into regT0.
654
    
654
    
655
    if (exit.m_lastSetOperand != std::numeric_limits<int>::max())
655
    if (exit.m_lastSetOperand != std::numeric_limits<int>::max())
656
        m_jit.load64(AssemblyHelpers::addressFor((VirtualRegister)exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
656
        m_jit.load64(AssemblyHelpers::addressFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
657
    
657
    
658
    // 17) And finish.
658
    // 17) And finish.
659
    
659
    
- Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp -14 / +2 lines
Lines 31-36 Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp_sec1
31
#include "CallFrame.h"
31
#include "CallFrame.h"
32
#include "DFGCommon.h"
32
#include "DFGCommon.h"
33
#include "DFGJITCode.h"
33
#include "DFGJITCode.h"
34
#include "DFGOSRExitPreparation.h"
34
#include "LinkBuffer.h"
35
#include "LinkBuffer.h"
35
#include "Operations.h"
36
#include "Operations.h"
36
#include "RepatchBuffer.h"
37
#include "RepatchBuffer.h"
Lines 54-73 void compileOSRExit(ExecState* exec) Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp_sec2
54
    uint32_t exitIndex = globalData->osrExitIndex;
55
    uint32_t exitIndex = globalData->osrExitIndex;
55
    OSRExit& exit = codeBlock->getJITCode()->dfg()->osrExit[exitIndex];
56
    OSRExit& exit = codeBlock->getJITCode()->dfg()->osrExit[exitIndex];
56
    
57
    
57
    // Make sure all code on our inline stack is JIT compiled. This is necessary since
58
    prepareCodeOriginForOSRExit(exec, exit.m_codeOrigin);
58
    // we may opt to inline a code block even before it had ever been compiled by the
59
    // JIT, but our OSR exit infrastructure currently only works if the target of the
60
    // OSR exit is JIT code. This could be changed since there is nothing particularly
61
    // hard about doing an OSR exit into the interpreter, but for now this seems to make
62
    // sense in that if we're OSR exiting from inlined code of a DFG code block, then
63
    // probably it's a good sign that the thing we're exiting into is hot. Even more
64
    // interestingly, since the code was inlined, it may never otherwise get JIT
65
    // compiled since the act of inlining it may ensure that it otherwise never runs.
66
    for (CodeOrigin codeOrigin = exit.m_codeOrigin; codeOrigin.inlineCallFrame; codeOrigin = codeOrigin.inlineCallFrame->caller) {
67
        static_cast<FunctionExecutable*>(codeOrigin.inlineCallFrame->executable.get())
68
            ->baselineCodeBlockFor(codeOrigin.inlineCallFrame->isCall ? CodeForCall : CodeForConstruct)
69
            ->jitCompile(exec);
70
    }
71
    
59
    
72
    // Compute the value recoveries.
60
    // Compute the value recoveries.
73
    Operands<ValueRecovery> operands;
61
    Operands<ValueRecovery> operands;
- Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp -3 / +3 lines
Lines 32-38 Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp_sec1
32
32
33
namespace JSC { namespace DFG {
33
namespace JSC { namespace DFG {
34
34
35
void handleExitCounts(CCallHelpers& jit, const OSRExit& exit)
35
void handleExitCounts(CCallHelpers& jit, const OSRExitBase& exit)
36
{
36
{
37
    jit.add32(AssemblyHelpers::TrustedImm32(1), AssemblyHelpers::AbsoluteAddress(&exit.m_count));
37
    jit.add32(AssemblyHelpers::TrustedImm32(1), AssemblyHelpers::AbsoluteAddress(&exit.m_count));
38
    
38
    
Lines 73-79 void handleExitCounts(CCallHelpers& jit, Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp_sec2
73
    doneAdjusting.link(&jit);
73
    doneAdjusting.link(&jit);
74
}
74
}
75
75
76
void reifyInlinedCallFrames(CCallHelpers& jit, const OSRExit& exit)
76
void reifyInlinedCallFrames(CCallHelpers& jit, const OSRExitBase& exit)
77
{
77
{
78
#if USE(JSVALUE64)
78
#if USE(JSVALUE64)
79
    ASSERT(jit.baselineCodeBlock()->getJITType() == JITCode::BaselineJIT);
79
    ASSERT(jit.baselineCodeBlock()->getJITType() == JITCode::BaselineJIT);
Lines 147-153 void reifyInlinedCallFrames(CCallHelpers Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp_sec3
147
#endif // USE(JSVALUE64) // ending the #else part, so directly above is the 32-bit part
147
#endif // USE(JSVALUE64) // ending the #else part, so directly above is the 32-bit part
148
}
148
}
149
149
150
void adjustAndJumpToTarget(CCallHelpers& jit, const OSRExit& exit)
150
void adjustAndJumpToTarget(CCallHelpers& jit, const OSRExitBase& exit)
151
{
151
{
152
    if (exit.m_codeOrigin.inlineCallFrame)
152
    if (exit.m_codeOrigin.inlineCallFrame)
153
        jit.addPtr(AssemblyHelpers::TrustedImm32(exit.m_codeOrigin.inlineCallFrame->stackOffset * sizeof(EncodedJSValue)), GPRInfo::callFrameRegister);
153
        jit.addPtr(AssemblyHelpers::TrustedImm32(exit.m_codeOrigin.inlineCallFrame->stackOffset * sizeof(EncodedJSValue)), GPRInfo::callFrameRegister);
- Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h -3 / +3 lines
Lines 35-43 Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h_sec1
35
35
36
namespace JSC { namespace DFG {
36
namespace JSC { namespace DFG {
37
37
38
void handleExitCounts(CCallHelpers&, const OSRExit&);
38
void handleExitCounts(CCallHelpers&, const OSRExitBase&);
39
void reifyInlinedCallFrames(CCallHelpers&, const OSRExit&);
39
void reifyInlinedCallFrames(CCallHelpers&, const OSRExitBase&);
40
void adjustAndJumpToTarget(CCallHelpers&, const OSRExit&);
40
void adjustAndJumpToTarget(CCallHelpers&, const OSRExitBase&);
41
41
42
} } // namespace JSC::DFG
42
} } // namespace JSC::DFG
43
43
- Source/JavaScriptCore/dfg/DFGOSRExitPreparation.cpp +49 lines
Line 0 Source/JavaScriptCore/dfg/DFGOSRExitPreparation.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "DFGOSRExitPreparation.h"
28
29
#if ENABLE(DFG_JIT)
30
31
#include "CodeBlock.h"
32
#include "Executable.h"
33
#include "Operations.h"
34
35
namespace JSC { namespace DFG {
36
37
void prepareCodeOriginForOSRExit(ExecState* exec, CodeOrigin codeOrigin)
38
{
39
    for (; codeOrigin.inlineCallFrame; codeOrigin = codeOrigin.inlineCallFrame->caller) {
40
        static_cast<FunctionExecutable*>(codeOrigin.inlineCallFrame->executable.get())
41
            ->baselineCodeBlockFor(codeOrigin.inlineCallFrame->isCall ? CodeForCall : CodeForConstruct)
42
            ->jitCompile(exec);
43
    }
44
}
45
46
} } // namespace JSC::DFG
47
48
#endif // ENABLE(DFG_JIT)
49
- Source/JavaScriptCore/dfg/DFGOSRExitPreparation.h +53 lines
Line 0 Source/JavaScriptCore/dfg/DFGOSRExitPreparation.h_sec1
1
/*
2
 * Copyright (C) 2013 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 DFGOSRExitPreparation_h
27
#define DFGOSRExitPreparation_h
28
29
#if ENABLE(DFG_JIT)
30
31
#include "CallFrame.h"
32
#include "CodeOrigin.h"
33
34
namespace JSC { namespace DFG {
35
36
// Make sure all code on our inline stack is JIT compiled. This is necessary since
37
// we may opt to inline a code block even before it had ever been compiled by the
38
// JIT, but our OSR exit infrastructure currently only works if the target of the
39
// OSR exit is JIT code. This could be changed since there is nothing particularly
40
// hard about doing an OSR exit into the interpreter, but for now this seems to make
41
// sense in that if we're OSR exiting from inlined code of a DFG code block, then
42
// probably it's a good sign that the thing we're exiting into is hot. Even more
43
// interestingly, since the code was inlined, it may never otherwise get JIT
44
// compiled since the act of inlining it may ensure that it otherwise never runs.
45
void prepareCodeOriginForOSRExit(ExecState*, CodeOrigin);
46
47
} } // namespace JSC::DFG
48
49
#endif // ENABLE(DFG_JIT)
50
51
#endif // DFGOSRExitPreparation_h
52
53
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp -1 / +1 lines
Lines 1777-1783 void SpeculativeJIT::checkArgumentTypes( Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec1
1777
            continue;
1777
            continue;
1778
        
1778
        
1779
        VirtualRegister virtualRegister = variableAccessData->local();
1779
        VirtualRegister virtualRegister = variableAccessData->local();
1780
        SpeculatedType predictedType = variableAccessData->prediction();
1780
        SpeculatedType predictedType = variableAccessData->argumentAwarePrediction();
1781
1781
1782
        JSValueSource valueSource = JSValueSource(JITCompiler::addressFor(virtualRegister));
1782
        JSValueSource valueSource = JSValueSource(JITCompiler::addressFor(virtualRegister));
1783
        
1783
        
- Source/JavaScriptCore/dfg/DFGValueSource.h -1 / +1 lines
Lines 131-137 public: Source/JavaScriptCore/dfg/DFGValueSource.h_sec1
131
    {
131
    {
132
        if (isInt32Speculation(prediction))
132
        if (isInt32Speculation(prediction))
133
            return ValueSource(Int32InJSStack);
133
            return ValueSource(Int32InJSStack);
134
        if (isArraySpeculation(prediction) || isCellSpeculation(prediction))
134
        if (isCellSpeculation(prediction))
135
            return ValueSource(CellInJSStack);
135
            return ValueSource(CellInJSStack);
136
        if (isBooleanSpeculation(prediction))
136
        if (isBooleanSpeculation(prediction))
137
            return ValueSource(BooleanInJSStack);
137
            return ValueSource(BooleanInJSStack);
- Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp -1 / +2 lines
Lines 214-220 void VariableEventStream::reconstruct( Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp_sec1
214
            
214
            
215
            bool found = false;
215
            bool found = false;
216
            
216
            
217
            if (node && node->op() == UInt32ToNumber) {
217
            if (node && needsOSRBackwardRewiring(node->op())) {
218
                MinifiedID id = node->child1();
218
                MinifiedID id = node->child1();
219
                if (tryToSetConstantRecovery(valueRecoveries[i], codeBlock, graph.at(id)))
219
                if (tryToSetConstantRecovery(valueRecoveries[i], codeBlock, graph.at(id)))
220
                    continue;
220
                    continue;
Lines 257-262 void VariableEventStream::reconstruct( Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp_sec2
257
                        doubleAsInt32ID = id;
257
                        doubleAsInt32ID = id;
258
                        break;
258
                        break;
259
                    default:
259
                    default:
260
                        ASSERT(!needsOSRForwardRewiring(node->op()));
260
                        break;
261
                        break;
261
                    }
262
                    }
262
                }
263
                }
- Source/JavaScriptCore/ftl/FTLAbbreviations.h -4 / +18 lines
Lines 80-88 static inline LType structType(LType ele Source/JavaScriptCore/ftl/FTLAbbreviations.h_sec1
80
}
80
}
81
81
82
enum Variadicity { NotVariadic, Variadic };
82
enum Variadicity { NotVariadic, Variadic };
83
static inline LType functionType(LType returnType, LType* paramTypes, unsigned paramCount, Variadicity variadicity)
83
static inline LType functionType(LType returnType, const LType* paramTypes, unsigned paramCount, Variadicity variadicity)
84
{
84
{
85
    return LLVMFunctionType(returnType, paramTypes, paramCount, variadicity == Variadic);
85
    return LLVMFunctionType(returnType, const_cast<LType*>(paramTypes), paramCount, variadicity == Variadic);
86
}
87
template<typename VectorType>
88
inline LType functionType(LType returnType, const VectorType& vector, Variadicity variadicity = NotVariadic)
89
{
90
    return functionType(returnType, vector.begin(), vector.size(), variadicity);
86
}
91
}
87
static inline LType functionType(LType returnType, Variadicity variadicity = NotVariadic)
92
static inline LType functionType(LType returnType, Variadicity variadicity = NotVariadic)
88
{
93
{
Lines 98-103 static inline LType functionType(LType r Source/JavaScriptCore/ftl/FTLAbbreviations.h_sec2
98
    return functionType(returnType, paramTypes, 2, variadicity);
103
    return functionType(returnType, paramTypes, 2, variadicity);
99
}
104
}
100
105
106
static inline LType typeOf(LValue value) { return LLVMTypeOf(value); }
107
101
static inline unsigned mdKindID(const char* string) { return LLVMGetMDKindID(string, strlen(string)); }
108
static inline unsigned mdKindID(const char* string) { return LLVMGetMDKindID(string, strlen(string)); }
102
static inline LValue mdString(const char* string, unsigned length) { return LLVMMDString(string, length); }
109
static inline LValue mdString(const char* string, unsigned length) { return LLVMMDString(string, length); }
103
static inline LValue mdString(const char* string) { return mdString(string, strlen(string)); }
110
static inline LValue mdString(const char* string) { return mdString(string, strlen(string)); }
Lines 151-159 static inline LValue buildIntCast(LBuild Source/JavaScriptCore/ftl/FTLAbbreviations.h_sec3
151
static inline LValue buildIntToPtr(LBuilder builder, LValue value, LType type) { return LLVMBuildIntToPtr(builder, value, type, ""); }
158
static inline LValue buildIntToPtr(LBuilder builder, LValue value, LType type) { return LLVMBuildIntToPtr(builder, value, type, ""); }
152
static inline LValue buildPtrToInt(LBuilder builder, LValue value, LType type) { return LLVMBuildPtrToInt(builder, value, type, ""); }
159
static inline LValue buildPtrToInt(LBuilder builder, LValue value, LType type) { return LLVMBuildPtrToInt(builder, value, type, ""); }
153
static inline LValue buildICmp(LBuilder builder, LIntPredicate cond, LValue left, LValue right) { return LLVMBuildICmp(builder, cond, left, right, ""); }
160
static inline LValue buildICmp(LBuilder builder, LIntPredicate cond, LValue left, LValue right) { return LLVMBuildICmp(builder, cond, left, right, ""); }
154
static inline LValue buildCall(LBuilder builder, LValue function, LValue* args, unsigned numArgs)
161
static inline LValue buildCall(LBuilder builder, LValue function, const LValue* args, unsigned numArgs)
162
{
163
    return LLVMBuildCall(builder, function, const_cast<LValue*>(args), numArgs, "");
164
}
165
template<typename VectorType>
166
inline LValue buildCall(LBuilder builder, LValue function, const VectorType& vector)
155
{
167
{
156
    return LLVMBuildCall(builder, function, args, numArgs, "");
168
    return buildCall(builder, function, vector.begin(), vector.size());
157
}
169
}
158
static inline LValue buildCall(LBuilder builder, LValue function)
170
static inline LValue buildCall(LBuilder builder, LValue function)
159
{
171
{
Lines 168-173 static inline LValue buildCall(LBuilder Source/JavaScriptCore/ftl/FTLAbbreviations.h_sec4
168
    LValue args[] = { arg1, arg2 };
180
    LValue args[] = { arg1, arg2 };
169
    return buildCall(builder, function, args, 2);
181
    return buildCall(builder, function, args, 2);
170
}
182
}
183
enum TailCallMode { IsNotTailCall, IsTailCall };
184
static inline void setTailCall(LValue call, TailCallMode mode) { LLVMSetTailCall(call, mode == IsTailCall); }
171
static inline LValue buildExtractValue(LBuilder builder, LValue aggVal, unsigned index) { return LLVMBuildExtractValue(builder, aggVal, index, ""); }
185
static inline LValue buildExtractValue(LBuilder builder, LValue aggVal, unsigned index) { return LLVMBuildExtractValue(builder, aggVal, index, ""); }
172
static inline LValue buildSelect(LBuilder builder, LValue condition, LValue taken, LValue notTaken) { return LLVMBuildSelect(builder, condition, taken, notTaken, ""); }
186
static inline LValue buildSelect(LBuilder builder, LValue condition, LValue taken, LValue notTaken) { return LLVMBuildSelect(builder, condition, taken, notTaken, ""); }
173
static inline LValue buildBr(LBuilder builder, LBasicBlock destination) { return LLVMBuildBr(builder, destination); }
187
static inline LValue buildBr(LBuilder builder, LBasicBlock destination) { return LLVMBuildBr(builder, destination); }
- Source/JavaScriptCore/ftl/FTLCArgumentGetter.cpp +99 lines
Line 0 Source/JavaScriptCore/ftl/FTLCArgumentGetter.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLCArgumentGetter.h"
28
29
#if ENABLE(FTL_JIT)
30
31
namespace JSC { namespace FTL {
32
33
using namespace DFG;
34
35
void CArgumentGetter::loadNextAndBox(ValueFormat format, GPRReg destination, GPRReg scratch)
36
{
37
    if (scratch == InvalidGPRReg) {
38
        if (destination == GPRInfo::nonArgGPR0)
39
            scratch = GPRInfo::nonArgGPR1;
40
        else
41
            scratch = GPRInfo::nonArgGPR0;
42
    }
43
    
44
    switch (format) {
45
    case ValueFormatInt32: {
46
        loadNext32(destination);
47
        m_jit.or64(GPRInfo::tagTypeNumberRegister, destination);
48
        break;
49
    }
50
            
51
    case ValueFormatUInt32: {
52
        loadNext32(destination);
53
        MacroAssembler::Jump isInt = m_jit.branch32(
54
            MacroAssembler::GreaterThanOrEqual,
55
            destination, MacroAssembler::TrustedImm32(0));
56
            
57
        m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch);
58
        m_jit.convertInt32ToDouble(destination, FPRInfo::fpRegT0);
59
        m_jit.boxDouble(FPRInfo::fpRegT0, destination);
60
        m_jit.move64ToDouble(scratch, FPRInfo::fpRegT0);
61
            
62
        MacroAssembler::Jump done = m_jit.jump();
63
            
64
        isInt.link(&m_jit);
65
        m_jit.or64(GPRInfo::tagTypeNumberRegister, destination);
66
            
67
        done.link(&m_jit);
68
        break;
69
    }
70
            
71
    case ValueFormatBoolean: {
72
        loadNext8(destination);
73
        m_jit.or32(MacroAssembler::TrustedImm32(ValueFalse), destination);
74
        break;
75
    }
76
            
77
    case ValueFormatJSValue: {
78
        loadNext64(destination);
79
        break;
80
    }
81
            
82
    case ValueFormatDouble: {
83
        m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch);
84
        loadNextDouble(FPRInfo::fpRegT0);
85
        m_jit.boxDouble(FPRInfo::fpRegT0, destination);
86
        m_jit.move64ToDouble(scratch, FPRInfo::fpRegT0);
87
        break;
88
    }
89
            
90
    default:
91
        RELEASE_ASSERT_NOT_REACHED();
92
        break;
93
    }
94
}
95
96
} } // namespace JSC::FTL
97
98
#endif // ENABLE(FTL_JIT)
99
- Source/JavaScriptCore/ftl/FTLCArgumentGetter.h +140 lines
Line 0 Source/JavaScriptCore/ftl/FTLCArgumentGetter.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLCArgumentGetter_h
27
#define FTLCArgumentGetter_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "DFGAssemblyHelpers.h"
34
#include "FTLValueFormat.h"
35
36
namespace JSC { namespace FTL {
37
38
// This currently only understands how to get arguments on X86-64 cdecl. This is also
39
// not particularly efficient. It will generate some redundant moves.
40
41
template<typename RegisterKind>
42
bool isArgumentRegister(typename RegisterKind::RegisterType reg)
43
{
44
    for (unsigned i = 0; i < RegisterKind::numberOfArgumentRegisters; ++i) {
45
        if (RegisterKind::toArgumentRegister(i) == reg)
46
            return true;
47
    }
48
    return false;
49
}
50
51
class CArgumentGetter {
52
public:
53
    // Peek offset is the number of things on the stack below the first argument.
54
    // It will be 1 if you haven't pushed or popped after the call; i.e. the only
55
    // thing is the return address.
56
    CArgumentGetter(DFG::AssemblyHelpers& jit, int peekOffset = 1)
57
        : m_jit(jit)
58
        , m_peekOffset(peekOffset)
59
        , m_gprArgumentIndex(0)
60
        , m_fprArgumentIndex(0)
61
        , m_stackArgumentIndex(0)
62
    {
63
    }
64
    
65
    void loadNext8(DFG::GPRReg destination)
66
    {
67
        ASSERT(!isArgumentRegister<DFG::GPRInfo>(destination));
68
        if (m_gprArgumentIndex < DFG::GPRInfo::numberOfArgumentRegisters) {
69
            m_jit.move(DFG::GPRInfo::toArgumentRegister(m_gprArgumentIndex++), destination);
70
            return;
71
        }
72
        
73
        m_jit.load8(nextAddress(), destination);
74
    }
75
    
76
    void loadNext32(DFG::GPRReg destination)
77
    {
78
        ASSERT(!isArgumentRegister<DFG::GPRInfo>(destination));
79
        if (m_gprArgumentIndex < DFG::GPRInfo::numberOfArgumentRegisters) {
80
            m_jit.move(DFG::GPRInfo::toArgumentRegister(m_gprArgumentIndex++), destination);
81
            return;
82
        }
83
        
84
        m_jit.load32(nextAddress(), destination);
85
    }
86
    
87
    void loadNext64(DFG::GPRReg destination)
88
    {
89
        ASSERT(!isArgumentRegister<DFG::GPRInfo>(destination));
90
        if (m_gprArgumentIndex < DFG::GPRInfo::numberOfArgumentRegisters) {
91
            m_jit.move(DFG::GPRInfo::toArgumentRegister(m_gprArgumentIndex++), destination);
92
            return;
93
        }
94
        
95
        m_jit.load64(nextAddress(), destination);
96
    }
97
    
98
    void loadNextPtr(DFG::GPRReg destination)
99
    {
100
        loadNext64(destination);
101
    }
102
    
103
    void loadNextDouble(DFG::FPRReg destination)
104
    {
105
        ASSERT(
106
            !isArgumentRegister<DFG::FPRInfo>(destination)
107
            || destination == DFG::FPRInfo::argumentFPR0);
108
        
109
        if (m_fprArgumentIndex < DFG::FPRInfo::numberOfArgumentRegisters) {
110
            m_jit.moveDouble(DFG::FPRInfo::toArgumentRegister(m_fprArgumentIndex++), destination);
111
            return;
112
        }
113
        
114
        m_jit.loadDouble(nextAddress(), destination);
115
    }
116
    
117
    void loadNextAndBox(
118
        ValueFormat format, DFG::GPRReg destination, DFG::GPRReg scratch = InvalidGPRReg);
119
120
private:
121
    MacroAssembler::Address nextAddress()
122
    {
123
        return MacroAssembler::Address(
124
            MacroAssembler::stackPointerRegister,
125
            (m_peekOffset + m_stackArgumentIndex++) * sizeof(void*));
126
    }
127
            
128
    DFG::AssemblyHelpers& m_jit;
129
    unsigned m_peekOffset;
130
    unsigned m_gprArgumentIndex;
131
    unsigned m_fprArgumentIndex;
132
    unsigned m_stackArgumentIndex;
133
};
134
135
} } // namespace JSC::FTL
136
137
#endif // ENABLE(FTL_JIT)
138
139
#endif // FTLCArgumentGetter_h
140
- Source/JavaScriptCore/ftl/FTLExitArgument.cpp +41 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitArgument.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLExitArgument.h"
28
29
#if ENABLE(FTL_JIT)
30
31
namespace JSC { namespace FTL {
32
33
void ExitArgument::dump(PrintStream& out) const
34
{
35
    out.print("arg", argument(), " as ", format());
36
}
37
38
} } // namespace JSC::FTL
39
40
#endif // ENABLE(FTL_JIT)
41
- Source/JavaScriptCore/ftl/FTLExitArgument.h +93 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitArgument.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLExitArgument_h
27
#define FTLExitArgument_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "FTLValueFormat.h"
34
#include <wtf/PrintStream.h>
35
36
namespace JSC { namespace FTL {
37
38
struct ExitArgumentRepresentation {
39
    ValueFormat format;
40
    unsigned argument;
41
};
42
43
class ExitArgument {
44
public:
45
    ExitArgument()
46
    {
47
        m_representation.format = InvalidValueFormat;
48
    }
49
    
50
    ExitArgument(ValueFormat format, unsigned argument)
51
    {
52
        m_representation.format = format;
53
        m_representation.argument = argument;
54
    }
55
    
56
    explicit ExitArgument(ExitArgumentRepresentation representation)
57
    {
58
        m_representation = representation;
59
    }
60
    
61
    bool operator!() const { return m_representation.format == InvalidValueFormat; }
62
    
63
    ValueFormat format() const
64
    {
65
        ASSERT(*this);
66
        return m_representation.format;
67
    }
68
    
69
    unsigned argument() const
70
    {
71
        ASSERT(*this);
72
        return m_representation.argument;
73
    }
74
    
75
    ExitArgument withFormat(ValueFormat format)
76
    {
77
        return ExitArgument(format, argument());
78
    }
79
    
80
    ExitArgumentRepresentation representation() const { return m_representation; }
81
    
82
    void dump(PrintStream&) const;
83
    
84
private:
85
    ExitArgumentRepresentation m_representation;
86
};
87
88
} } // namespace JSC::FTL
89
90
#endif // ENABLE(FTL_JIT)
91
92
#endif // FTLExitArgument_h
93
- Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.cpp +41 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLExitArgumentForOperand.h"
28
29
#if ENABLE(FTL_JIT)
30
31
namespace JSC { namespace FTL {
32
33
void ExitArgumentForOperand::dump(PrintStream& out) const
34
{
35
    out.print(m_exitArgument, " for r", m_operand);
36
}
37
38
} } // namespace JSC::FTL
39
40
#endif // ENABLE(FTL_JIT)
41
- Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.h +73 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLExitArgumentForOperand_h
27
#define FTLExitArgumentForOperand_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "FTLExitArgument.h"
34
35
namespace JSC { namespace FTL {
36
37
class ExitArgumentForOperand {
38
public:
39
    ExitArgumentForOperand()
40
        : m_operand(-1)
41
    {
42
    }
43
    
44
    ExitArgumentForOperand(ExitArgument exitArgument, int operand)
45
        : m_exitArgument(exitArgument)
46
        , m_operand(operand)
47
    {
48
    }
49
    
50
    bool operator!() const { return !m_exitArgument; }
51
    
52
    const ExitArgument& exitArgument() const { return m_exitArgument; }
53
    int operand() const { return m_operand; }
54
    
55
    void dump(PrintStream&) const;
56
    
57
private:
58
    ExitArgument m_exitArgument;
59
    int m_operand;
60
};
61
62
inline bool lesserArgumentIndex(
63
    const ExitArgumentForOperand& a, const ExitArgumentForOperand& b)
64
{
65
    return a.exitArgument().argument() < b.exitArgument().argument();
66
}
67
68
} } // namespace JSC::FTL
69
70
#endif // ENABLE(FTL_JIT)
71
72
#endif // FTLExitArgumentForOperand_h
73
- Source/JavaScriptCore/ftl/FTLExitArgumentList.h +45 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitArgumentList.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLExitArgumentList_h
27
#define FTLExitArgumentList_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "FTLAbbreviations.h"
34
#include <wtf/Vector.h>
35
36
namespace JSC { namespace FTL {
37
38
typedef Vector<LValue, 16> ExitArgumentList;
39
40
} } // namespace JSC::FTL
41
42
#endif // ENABLE(FTL_JIT)
43
44
#endif // FTLExitArgumentList_h
45
- Source/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp +57 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLExitThunkGenerator.h"
28
29
#if ENABLE(FTL_JIT)
30
31
#include "FTLOSRExitCompilationInfo.h"
32
#include "FTLState.h"
33
34
namespace JSC { namespace FTL {
35
36
using namespace JSC::DFG;
37
38
ExitThunkGenerator::ExitThunkGenerator(State& state)
39
    : CCallHelpers(&state.graph.m_globalData, state.graph.m_codeBlock)
40
{
41
}
42
43
ExitThunkGenerator::~ExitThunkGenerator()
44
{
45
}
46
47
void ExitThunkGenerator::emitThunk(unsigned index, OSRExitCompilationInfo& info)
48
{
49
    info.m_thunkLabel = label();
50
    move(TrustedImm32(index), GPRInfo::nonArgGPR0);
51
    info.m_thunkJump = patchableJump();
52
}
53
54
} } // namespace JSC::FTL
55
56
#endif // ENABLE(FTL_JIT)
57
- Source/JavaScriptCore/ftl/FTLExitThunkGenerator.h +53 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitThunkGenerator.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLExitThunkGenerator_h
27
#define FTLExitThunkGenerator_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "DFGCCallHelpers.h"
34
35
namespace JSC { namespace FTL {
36
37
class State;
38
struct OSRExitCompilationInfo;
39
40
class ExitThunkGenerator : public DFG::CCallHelpers {
41
public:
42
    ExitThunkGenerator(State& state);
43
    ~ExitThunkGenerator();
44
    
45
    void emitThunk(unsigned index, OSRExitCompilationInfo&);
46
};
47
48
} } // namespace JSC::FTL
49
50
#endif // ENABLE(FTL_JIT)
51
52
#endif // FTLExitThunkGenerator_h
53
- Source/JavaScriptCore/ftl/FTLExitValue.cpp +65 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitValue.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLExitValue.h"
28
29
#if ENABLE(FTL_JIT)
30
31
namespace JSC { namespace FTL {
32
33
void ExitValue::dump(PrintStream& out) const
34
{
35
    switch (kind()) {
36
    case InvalidExitValue:
37
        out.print("Invalid");
38
        return;
39
    case ExitValueDead:
40
        out.print("Dead");
41
        return;
42
    case ExitValueArgument:
43
        out.print("Argument(", exitArgument(), ")");
44
        return;
45
    case ExitValueConstant:
46
        out.print("Constant(", constant(), ")");
47
        return;
48
    case ExitValueInJSStack:
49
        out.print("InJSStack");
50
        return;
51
    case ExitValueInJSStackAsInt32:
52
        out.print("InJSStackAsInt32");
53
        return;
54
    case ExitValueInJSStackAsDouble:
55
        out.print("InJSStackAsDouble");
56
        return;
57
    }
58
    
59
    RELEASE_ASSERT_NOT_REACHED();
60
}
61
62
} } // namespace JSC::FTL
63
64
#endif // ENABLE(FTL_JIT)
65
- Source/JavaScriptCore/ftl/FTLExitValue.h +151 lines
Line 0 Source/JavaScriptCore/ftl/FTLExitValue.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLExitValue_h
27
#define FTLExitValue_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "FTLExitArgument.h"
34
#include "JSCJSValue.h"
35
#include <wtf/PrintStream.h>
36
37
namespace JSC { namespace FTL {
38
39
// This is like ValueRecovery, but respects the way that the FTL does OSR
40
// exit: the live non-constant non-flushed values are passed as arguments
41
// to a noreturn tail call. ExitValue is hence mostly responsible for
42
// telling us the mapping between operands in bytecode and the arguments to
43
// the call.
44
45
enum ExitValueKind {
46
    InvalidExitValue,
47
    ExitValueDead,
48
    ExitValueArgument,
49
    ExitValueConstant,
50
    ExitValueInJSStack,
51
    ExitValueInJSStackAsInt32,
52
    ExitValueInJSStackAsDouble
53
};
54
55
class ExitValue {
56
public:
57
    ExitValue()
58
        : m_kind(InvalidExitValue)
59
    {
60
    }
61
    
62
    bool operator!() const { return m_kind == InvalidExitValue; }
63
    
64
    static ExitValue dead()
65
    {
66
        ExitValue result;
67
        result.m_kind = ExitValueDead;
68
        return result;
69
    }
70
    
71
    static ExitValue inJSStack()
72
    {
73
        ExitValue result;
74
        result.m_kind = ExitValueInJSStack;
75
        return result;
76
    }
77
    
78
    static ExitValue inJSStackAsInt32()
79
    {
80
        ExitValue result;
81
        result.m_kind = ExitValueInJSStackAsInt32;
82
        return result;
83
    }
84
    
85
    static ExitValue inJSStackAsDouble()
86
    {
87
        ExitValue result;
88
        result.m_kind = ExitValueInJSStackAsDouble;
89
        return result;
90
    }
91
    
92
    static ExitValue constant(JSValue value)
93
    {
94
        ExitValue result;
95
        result.m_kind = ExitValueConstant;
96
        result.u.constant = JSValue::encode(value);
97
        return result;
98
    }
99
    
100
    static ExitValue exitArgument(const ExitArgument& argument)
101
    {
102
        ExitValue result;
103
        result.m_kind = ExitValueArgument;
104
        result.u.argument = argument.representation();
105
        return result;
106
    }
107
    
108
    ExitValueKind kind() const { return m_kind; }
109
    
110
    bool isDead() const { return kind() == ExitValueDead; }
111
    bool isInJSStackSomehow() const
112
    {
113
        switch (kind()) {
114
        case ExitValueInJSStack:
115
        case ExitValueInJSStackAsInt32:
116
        case ExitValueInJSStackAsDouble:
117
            return true;
118
        default:
119
            return false;
120
        }
121
    }
122
    bool isConstant() const { return kind() == ExitValueConstant; }
123
    bool isArgument() const { return kind() == ExitValueArgument; }
124
    
125
    ExitArgument exitArgument() const
126
    {
127
        ASSERT(isArgument());
128
        return ExitArgument(u.argument);
129
    }
130
    
131
    JSValue constant() const
132
    {
133
        ASSERT(isConstant());
134
        return JSValue::decode(u.constant);
135
    }
136
    
137
    void dump(PrintStream&) const;
138
    
139
private:
140
    ExitValueKind m_kind;
141
    union {
142
        ExitArgumentRepresentation argument;
143
        EncodedJSValue constant;
144
    } u;
145
};
146
147
} } // namespace JSC::FTL
148
149
#endif // ENABLE(FTL_JIT)
150
151
#endif // FTLExitValue_h
- Source/JavaScriptCore/ftl/FTLFormattedValue.h -12 / +8 lines
Lines 31-36 Source/JavaScriptCore/ftl/FTLFormattedValue.h_sec1
31
#if ENABLE(FTL_JIT)
31
#if ENABLE(FTL_JIT)
32
32
33
#include "FTLAbbreviations.h"
33
#include "FTLAbbreviations.h"
34
#include "FTLValueFormat.h"
34
35
35
namespace JSC { namespace FTL {
36
namespace JSC { namespace FTL {
36
37
Lines 41-58 namespace JSC { namespace FTL { Source/JavaScriptCore/ftl/FTLFormattedValue.h_sec2
41
// use this in situations where there is no good way to say what node the value came
42
// use this in situations where there is no good way to say what node the value came
42
// from.
43
// from.
43
44
44
// Note that this is awkwardly similar to DataFormat in other parts of JSC, except that
45
// unlike DataFormat and like ValueRecovery, it distinguishes between UInt32 and Int32.
46
47
enum ValueFormat {
48
    InvalidValueFormat,
49
    ValueFormatInt32,
50
    ValueFormatUInt32,
51
    ValueFormatBoolean,
52
    ValueFormatJSValue,
53
    ValueFormatDouble
54
};
55
56
class FormattedValue {
45
class FormattedValue {
57
public:
46
public:
58
    FormattedValue()
47
    FormattedValue()
Lines 81-86 private: Source/JavaScriptCore/ftl/FTLFormattedValue.h_sec3
81
    LValue m_value;
70
    LValue m_value;
82
};
71
};
83
72
73
static inline FormattedValue noValue() { return FormattedValue(); }
74
static inline FormattedValue int32Value(LValue value) { return FormattedValue(ValueFormatInt32, value); }
75
static inline FormattedValue uInt32Value(LValue value) { return FormattedValue(ValueFormatUInt32, value); }
76
static inline FormattedValue booleanValue(LValue value) { return FormattedValue(ValueFormatBoolean, value); }
77
static inline FormattedValue jsValueValue(LValue value) { return FormattedValue(ValueFormatJSValue, value); }
78
static inline FormattedValue doubleValue(LValue value) { return FormattedValue(ValueFormatDouble, value); }
79
84
} } // namespace JSC::FTL
80
} } // namespace JSC::FTL
85
81
86
#endif // ENABLE(FTL_JIT)
82
#endif // ENABLE(FTL_JIT)
- Source/JavaScriptCore/ftl/FTLJITCode.cpp +10 lines
Lines 42-47 JITCode::~JITCode() Source/JavaScriptCore/ftl/FTLJITCode.cpp_sec1
42
        LLVMDisposeExecutionEngine(m_engine);
42
        LLVMDisposeExecutionEngine(m_engine);
43
}
43
}
44
44
45
void JITCode::initializeExitThunks(CodeRef exitThunks)
46
{
47
    m_exitThunks = exitThunks;
48
}
49
45
void JITCode::initializeCode(LLVMExecutionEngineRef engine, CodeRef entrypoint)
50
void JITCode::initializeCode(LLVMExecutionEngineRef engine, CodeRef entrypoint)
46
{
51
{
47
    m_engine = engine;
52
    m_engine = engine;
Lines 97-102 bool JITCode::contains(void*) Source/JavaScriptCore/ftl/FTLJITCode.cpp_sec2
97
    return false;
102
    return false;
98
}
103
}
99
104
105
JITCode::CodePtr JITCode::exitThunks()
106
{
107
    return m_exitThunks.code();
108
}
109
100
JITCode* JITCode::ftl()
110
JITCode* JITCode::ftl()
101
{
111
{
102
    return this;
112
    return this;
- Source/JavaScriptCore/ftl/FTLJITCode.h +6 lines
Lines 32-37 Source/JavaScriptCore/ftl/FTLJITCode.h_sec1
32
32
33
#include "DFGCommonData.h"
33
#include "DFGCommonData.h"
34
#include "FTLLLVMHeaders.h"
34
#include "FTLLLVMHeaders.h"
35
#include "FTLOSRExit.h"
35
#include "JITCode.h"
36
#include "JITCode.h"
36
37
37
namespace JSC { namespace FTL {
38
namespace JSC { namespace FTL {
Lines 48-59 public: Source/JavaScriptCore/ftl/FTLJITCode.h_sec2
48
    size_t size();
49
    size_t size();
49
    bool contains(void*);
50
    bool contains(void*);
50
    
51
    
52
    void initializeExitThunks(CodeRef);
51
    void initializeCode(LLVMExecutionEngineRef, CodeRef entrypoint);
53
    void initializeCode(LLVMExecutionEngineRef, CodeRef entrypoint);
52
    
54
    
55
    CodePtr exitThunks();
56
    
53
    JITCode* ftl();
57
    JITCode* ftl();
54
    DFG::CommonData* dfgCommon();
58
    DFG::CommonData* dfgCommon();
55
    
59
    
56
    DFG::CommonData common;
60
    DFG::CommonData common;
61
    SegmentedVector<OSRExit, 8> osrExit;
57
    
62
    
58
private:
63
private:
59
    // FIXME: LLVM should use our own JIT memory allocator, and we shouldn't have to
64
    // FIXME: LLVM should use our own JIT memory allocator, and we shouldn't have to
Lines 61-66 private: Source/JavaScriptCore/ftl/FTLJITCode.h_sec3
61
    // https://bugs.webkit.org/show_bug.cgi?id=113619
66
    // https://bugs.webkit.org/show_bug.cgi?id=113619
62
    LLVMExecutionEngineRef m_engine;
67
    LLVMExecutionEngineRef m_engine;
63
    CodeRef m_entrypoint;
68
    CodeRef m_entrypoint;
69
    CodeRef m_exitThunks;
64
};
70
};
65
71
66
} } // namespace JSC::FTL
72
} } // namespace JSC::FTL
- Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp -81 / +493 lines
Lines 28-37 Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec1
28
28
29
#if ENABLE(FTL_JIT)
29
#if ENABLE(FTL_JIT)
30
30
31
#include "CodeBlockWithJITType.h"
31
#include "DFGAbstractState.h"
32
#include "DFGAbstractState.h"
32
#include "FTLAbstractHeapRepository.h"
33
#include "FTLAbstractHeapRepository.h"
34
#include "FTLExitThunkGenerator.h"
33
#include "FTLFormattedValue.h"
35
#include "FTLFormattedValue.h"
34
#include "FTLOutput.h"
36
#include "FTLOutput.h"
37
#include "FTLThunks.h"
38
#include "FTLValueSource.h"
39
#include "LinkBuffer.h"
35
#include "Operations.h"
40
#include "Operations.h"
36
41
37
namespace JSC { namespace FTL {
42
namespace JSC { namespace FTL {
Lines 41-47 using namespace DFG; Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec2
41
// Using this instead of typeCheck() helps to reduce the load on LLVM, by creating
46
// Using this instead of typeCheck() helps to reduce the load on LLVM, by creating
42
// significantly less dead code.
47
// significantly less dead code.
43
#define FTL_TYPE_CHECK(lowValue, highValue, typesPassedThrough, failCondition) do { \
48
#define FTL_TYPE_CHECK(lowValue, highValue, typesPassedThrough, failCondition) do { \
44
        LValue _ftc_lowValue = (lowValue);                              \
49
        FormattedValue _ftc_lowValue = (lowValue);                      \
45
        Edge _ftc_highValue = (highValue);                              \
50
        Edge _ftc_highValue = (highValue);                              \
46
        SpeculatedType _ftc_typesPassedThrough = (typesPassedThrough);  \
51
        SpeculatedType _ftc_typesPassedThrough = (typesPassedThrough);  \
47
        if (!m_state.needsTypeCheck(_ftc_highValue, _ftc_typesPassedThrough)) \
52
        if (!m_state.needsTypeCheck(_ftc_highValue, _ftc_typesPassedThrough)) \
Lines 57-62 public: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec3
57
        , m_localsBoolean(OperandsLike, state.graph.m_blocks[0]->variablesAtHead)
62
        , m_localsBoolean(OperandsLike, state.graph.m_blocks[0]->variablesAtHead)
58
        , m_locals32(OperandsLike, state.graph.m_blocks[0]->variablesAtHead)
63
        , m_locals32(OperandsLike, state.graph.m_blocks[0]->variablesAtHead)
59
        , m_locals64(OperandsLike, state.graph.m_blocks[0]->variablesAtHead)
64
        , m_locals64(OperandsLike, state.graph.m_blocks[0]->variablesAtHead)
65
        , m_valueSources(OperandsLike, state.graph.m_blocks[0]->variablesAtHead)
66
        , m_lastSetOperand(std::numeric_limits<int>::max())
67
        , m_exitThunkGenerator(state)
60
        , m_state(state.graph)
68
        , m_state(state.graph)
61
    {
69
    {
62
    }
70
    }
Lines 80-93 public: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec4
80
            m_locals64[index] = buildAlloca(m_out.m_builder, m_out.int64);
88
            m_locals64[index] = buildAlloca(m_out.m_builder, m_out.int64);
81
        }
89
        }
82
        
90
        
91
        m_initialization = appendBasicBlock(m_ftlState.function);
92
        m_out.jump(m_initialization);
93
        m_out.appendTo(m_initialization);
94
        
83
        m_callFrame = m_out.param(0);
95
        m_callFrame = m_out.param(0);
84
        m_tagTypeNumber = m_out.constInt64(TagTypeNumber);
96
        m_tagTypeNumber = m_out.constInt64(TagTypeNumber);
85
        m_tagMask = m_out.constInt64(TagMask);
97
        m_tagMask = m_out.constInt64(TagMask);
86
        
98
        
87
        m_abortFunction = constIntToPtr(
88
            m_out.constIntPtr(abort),
89
            pointerType(functionType(m_out.voidType)));
90
        
91
        for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex) {
99
        for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex) {
92
            m_highBlock = m_graph.m_blocks[blockIndex].get();
100
            m_highBlock = m_graph.m_blocks[blockIndex].get();
93
            if (!m_highBlock)
101
            if (!m_highBlock)
Lines 98-111 public: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec5
98
        
106
        
99
        closeOverFlushedLocalOps();
107
        closeOverFlushedLocalOps();
100
108
101
        m_out.appendTo(m_prologue, m_blocks.get(m_graph.m_blocks[0].get()));
109
        m_out.appendTo(m_initialization, m_blocks.get(m_graph.m_blocks[0].get()));
102
110
103
        transferAndCheckArguments();
111
        transferAndCheckArguments();
104
        
112
        
105
        m_out.jump(m_blocks.get(m_graph.m_blocks[0].get()));
113
        // Leave the initialization block hanging, since we will add to it later.
106
        
114
        
107
        for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex)
115
        for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex)
108
            compileBlock(blockIndex);
116
            compileBlock(blockIndex);
117
        
118
        // And now complete the initialization block.
119
        linkOSRExitsAndCompleteInitializationBlock();
109
120
110
        if (verboseCompilationEnabled())
121
        if (verboseCompilationEnabled())
111
            m_ftlState.dumpState("after lowering");
122
            m_ftlState.dumpState("after lowering");
Lines 151-158 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec6
151
    
162
    
152
    void transferAndCheckArguments()
163
    void transferAndCheckArguments()
153
    {
164
    {
154
        // FIXME: Set up the OSR story here.
165
        // While checking arguments, everything is in the stack.
155
        // https://bugs.webkit.org/show_bug.cgi?id=113623
166
        for (unsigned i = m_valueSources.size(); i--;)
167
            m_valueSources[i] = ValueSource(ValueInJSStack);
156
        
168
        
157
        for (int i = 0; i < m_graph.m_codeBlock->numParameters(); ++i) {
169
        for (int i = 0; i < m_graph.m_codeBlock->numParameters(); ++i) {
158
            Node* node = m_graph.m_arguments[i];
170
            Node* node = m_graph.m_arguments[i];
Lines 170-190 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec7
170
            if (variable->shouldUnboxIfPossible()) {
182
            if (variable->shouldUnboxIfPossible()) {
171
                RELEASE_ASSERT(!variable->shouldUseDoubleFormat());
183
                RELEASE_ASSERT(!variable->shouldUseDoubleFormat());
172
                
184
                
173
                SpeculatedType prediction = variable->prediction();
185
                SpeculatedType prediction = variable->argumentAwarePrediction();
174
                
186
                
175
                if (isInt32Speculation(prediction)) {
187
                if (isInt32Speculation(prediction)) {
176
                    speculateBackward(BadType, jsValue, node, isNotInt32(jsValue));
188
                    speculateBackward(BadType, jsValueValue(jsValue), node, isNotInt32(jsValue));
177
                    m_out.set(unboxInt32(jsValue), m_locals32.operand(variable->local()));
189
                    m_out.set(unboxInt32(jsValue), m_locals32.operand(variable->local()));
178
                    continue;
190
                    continue;
179
                }
191
                }
180
                
192
                
181
                if (isCellSpeculation(prediction)) {
193
                if (isCellSpeculation(prediction)) {
182
                    speculateBackward(BadType, jsValue, node, isNotCell(jsValue));
194
                    speculateBackward(BadType, jsValueValue(jsValue), node, isNotCell(jsValue));
183
                    m_out.set(jsValue, m_locals64.operand(variable->local()));
195
                    m_out.set(jsValue, m_locals64.operand(variable->local()));
184
                    continue;
196
                    continue;
185
                }
197
                }
186
                if (isBooleanSpeculation(prediction)) {
198
                if (isBooleanSpeculation(prediction)) {
187
                    speculateBackward(BadType, jsValue, node, isNotBoolean(jsValue));
199
                    speculateBackward(BadType, jsValueValue(jsValue), node, isNotBoolean(jsValue));
188
                    m_out.set(unboxBoolean(jsValue), m_localsBoolean.operand(variable->local()));
200
                    m_out.set(unboxBoolean(jsValue), m_localsBoolean.operand(variable->local()));
189
                    continue;
201
                    continue;
190
                }
202
                }
Lines 216-234 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec8
216
        // make IR dumps easier to read.
228
        // make IR dumps easier to read.
217
        m_out.appendTo(lowBlock, m_nextLowBlock);
229
        m_out.appendTo(lowBlock, m_nextLowBlock);
218
        
230
        
219
        // FIXME: We should track the OSR situation here.
231
        initializeOSRExitStateForBlock();
220
        // https://bugs.webkit.org/show_bug.cgi?id=113623
221
        
232
        
222
        m_int32Values.clear();
233
        m_int32Values.clear();
223
        m_jsValueValues.clear();
234
        m_jsValueValues.clear();
224
        m_booleanValues.clear();
235
        m_booleanValues.clear();
225
        m_storageValues.clear();
236
        m_storageValues.clear();
237
        m_timeToLive.clear();
226
        
238
        
227
        m_state.reset();
239
        m_state.reset();
228
        m_state.beginBasicBlock(m_highBlock);
240
        m_state.beginBasicBlock(m_highBlock);
229
        
241
        
230
        for (unsigned nodeIndex = 0; nodeIndex < m_highBlock->size(); ++nodeIndex)
242
        for (m_nodeIndex = 0; m_nodeIndex < m_highBlock->size(); ++m_nodeIndex)
231
            compileNode(nodeIndex);
243
            compileNode(m_nodeIndex);
232
    }
244
    }
233
    
245
    
234
    void compileNode(unsigned nodeIndex)
246
    void compileNode(unsigned nodeIndex)
Lines 240-248 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec9
240
        
252
        
241
        bool shouldExecuteEffects = m_state.startExecuting(m_node);
253
        bool shouldExecuteEffects = m_state.startExecuting(m_node);
242
        
254
        
243
        if (!m_node->shouldGenerate())
244
            return; // FIXME: Implement OSR magic here. https://bugs.webkit.org/show_bug.cgi?id=113623
245
        
246
        m_direction = (m_node->flags() & NodeExitsForward) ? ForwardSpeculation : BackwardSpeculation;
255
        m_direction = (m_node->flags() & NodeExitsForward) ? ForwardSpeculation : BackwardSpeculation;
247
        
256
        
248
        switch (m_node->op()) {
257
        switch (m_node->op()) {
Lines 258-263 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec10
258
        case SetLocal:
267
        case SetLocal:
259
            compileSetLocal();
268
            compileSetLocal();
260
            break;
269
            break;
270
        case MovHint:
271
            compileMovHint();
272
            break;
273
        case ZombieHint:
274
            compileZombieHint();
275
            break;
261
        case MovHintAndCheck:
276
        case MovHintAndCheck:
262
            compileMovHintAndCheck();
277
            compileMovHintAndCheck();
263
            break;
278
            break;
Lines 352-357 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec11
352
            break;
367
            break;
353
        }
368
        }
354
        
369
        
370
        DFG_NODE_DO_TO_CHILDREN(m_graph, m_node, use);
371
        
372
        if (m_node->hasResult())
373
            m_timeToLive.add(m_node, m_node->adjustedRefCount());
374
        
355
        if (shouldExecuteEffects)
375
        if (shouldExecuteEffects)
356
            m_state.executeEffects(nodeIndex);
376
            m_state.executeEffects(nodeIndex);
357
    }
377
    }
Lines 368-375 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec12
368
    
388
    
369
    void compileGetLocal()
389
    void compileGetLocal()
370
    {
390
    {
391
        // GetLocal is one of the few nodes that may be left behind, with !shouldGenerate().
392
        if (!m_node->shouldGenerate())
393
            return;
394
        
371
        VariableAccessData* variable = m_node->variableAccessData();
395
        VariableAccessData* variable = m_node->variableAccessData();
372
        SpeculatedType prediction = variable->prediction();
396
        SpeculatedType prediction = variable->argumentAwarePrediction();
373
        AbstractValue& value = m_state.variables().operand(variable->local());
397
        AbstractValue& value = m_state.variables().operand(variable->local());
374
        
398
        
375
        if (prediction == SpecNone) {
399
        if (prediction == SpecNone) {
Lines 420-432 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec13
420
    
444
    
421
    void compileSetLocal()
445
    void compileSetLocal()
422
    {
446
    {
447
        observeMovHint(m_node);
448
        
423
        VariableAccessData* variable = m_node->variableAccessData();
449
        VariableAccessData* variable = m_node->variableAccessData();
424
        SpeculatedType prediction = variable->prediction();
450
        SpeculatedType prediction = variable->argumentAwarePrediction();
425
        bool needsFlushing = m_flushedLocalOps.contains(m_node);
451
        bool needsFlushing = m_flushedLocalOps.contains(m_node);
426
        
452
        
427
        // FIXME: Handle the MovHint for OSR.
428
        // https://bugs.webkit.org/show_bug.cgi?id=113623
429
        
430
        if (variable->shouldUnboxIfPossible()) {
453
        if (variable->shouldUnboxIfPossible()) {
431
            if (variable->shouldUseDoubleFormat()) {
454
            if (variable->shouldUseDoubleFormat()) {
432
                // FIXME: implement doubles in FTL.
455
                // FIXME: implement doubles in FTL.
Lines 438-458 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec14
438
            if (isInt32Speculation(prediction)) {
461
            if (isInt32Speculation(prediction)) {
439
                LValue value = lowInt32(m_node->child1());
462
                LValue value = lowInt32(m_node->child1());
440
                m_out.set(value, m_locals32.operand(variable->local()));
463
                m_out.set(value, m_locals32.operand(variable->local()));
441
                if (needsFlushing)
464
                if (needsFlushing) {
442
                    m_out.store32(value, payloadFor(variable->local()));
465
                    m_out.store32(value, payloadFor(variable->local()));
466
                    m_valueSources[variable->local()] = ValueSource(Int32InJSStack);
467
                }
443
                return;
468
                return;
444
            }
469
            }
445
            if (isCellSpeculation(prediction)) {
470
            if (isCellSpeculation(prediction)) {
446
                LValue value = lowCell(m_node->child1());
471
                LValue value = lowCell(m_node->child1());
447
                m_out.set(value, m_locals64.operand(variable->local()));
472
                m_out.set(value, m_locals64.operand(variable->local()));
448
                if (needsFlushing)
473
                if (needsFlushing) {
449
                    m_out.store64(value, addressFor(variable->local()));
474
                    m_out.store64(value, addressFor(variable->local()));
475
                    m_valueSources[variable->local()] = ValueSource(ValueInJSStack);
476
                }
450
                return;
477
                return;
451
            }
478
            }
452
            if (isBooleanSpeculation(prediction)) {
479
            if (isBooleanSpeculation(prediction)) {
453
                m_out.set(lowBoolean(m_node->child1()), m_localsBoolean.operand(variable->local()));
480
                m_out.set(lowBoolean(m_node->child1()), m_localsBoolean.operand(variable->local()));
454
                if (needsFlushing)
481
                if (needsFlushing) {
455
                    m_out.store64(lowJSValue(m_node->child1()), addressFor(variable->local()));
482
                    m_out.store64(lowJSValue(m_node->child1()), addressFor(variable->local()));
483
                    m_valueSources[variable->local()] = ValueSource(ValueInJSStack);
484
                }
456
                return;
485
                return;
457
            }
486
            }
458
        }
487
        }
Lines 460-477 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec15
460
        LValue value = lowJSValue(m_node->child1());
489
        LValue value = lowJSValue(m_node->child1());
461
        if (variable->isCaptured()) {
490
        if (variable->isCaptured()) {
462
            m_out.store64(value, addressFor(variable->local()));
491
            m_out.store64(value, addressFor(variable->local()));
492
            m_valueSources[variable->local()] = ValueSource(ValueInJSStack);
463
            return;
493
            return;
464
        }
494
        }
465
        
495
        
466
        m_out.set(value, m_locals64.operand(variable->local()));
496
        m_out.set(value, m_locals64.operand(variable->local()));
467
        if (needsFlushing)
497
        if (needsFlushing) {
468
            m_out.store64(value, addressFor(variable->local()));
498
            m_out.store64(value, addressFor(variable->local()));
499
            m_valueSources[variable->local()] = ValueSource(ValueInJSStack);
500
        }
501
    }
502
    
503
    void compileMovHint()
504
    {
505
        observeMovHint(m_node);
506
    }
507
    
508
    void compileZombieHint()
509
    {
510
        VariableAccessData* data = m_node->variableAccessData();
511
        m_lastSetOperand = data->local();
512
        m_valueSources[data->local()] = ValueSource(SourceIsDead);
469
    }
513
    }
470
    
514
    
471
    void compileMovHintAndCheck()
515
    void compileMovHintAndCheck()
472
    {
516
    {
473
        // FIXME: Handle the MovHint for OSR.
517
        observeMovHint(m_node);
474
        // https://bugs.webkit.org/show_bug.cgi?id=113623
475
        speculate(m_node->child1());
518
        speculate(m_node->child1());
476
    }
519
    }
477
    
520
    
Lines 500-506 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec16
500
            }
543
            }
501
            
544
            
502
            LValue result = m_out.addWithOverflow32(left, right);
545
            LValue result = m_out.addWithOverflow32(left, right);
503
            speculate(Overflow, 0, 0, m_out.extractValue(result, 1));
546
            speculate(Overflow, noValue(), 0, m_out.extractValue(result, 1));
504
            m_int32Values.add(m_node, m_out.extractValue(result, 0));
547
            m_int32Values.add(m_node, m_out.extractValue(result, 0));
505
            break;
548
            break;
506
        }
549
        }
Lines 524-530 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec17
524
            }
567
            }
525
            
568
            
526
            LValue result = m_out.subWithOverflow32(left, right);
569
            LValue result = m_out.subWithOverflow32(left, right);
527
            speculate(Overflow, 0, 0, m_out.extractValue(result, 1));
570
            speculate(Overflow, noValue(), 0, m_out.extractValue(result, 1));
528
            m_int32Values.add(m_node, m_out.extractValue(result, 0));
571
            m_int32Values.add(m_node, m_out.extractValue(result, 0));
529
            break;
572
            break;
530
        }
573
        }
Lines 547-553 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec18
547
                result = m_out.mul(left, right);
590
                result = m_out.mul(left, right);
548
            else {
591
            else {
549
                LValue overflowResult = m_out.mulWithOverflow32(left, right);
592
                LValue overflowResult = m_out.mulWithOverflow32(left, right);
550
                speculate(Overflow, 0, 0, m_out.extractValue(overflowResult, 1));
593
                speculate(Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1));
551
                result = m_out.extractValue(overflowResult, 0);
594
                result = m_out.extractValue(overflowResult, 0);
552
            }
595
            }
553
            
596
            
Lines 556-563 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec19
556
                LBasicBlock continuation = m_out.newBlock();
599
                LBasicBlock continuation = m_out.newBlock();
557
                
600
                
558
                LBasicBlock lastNext = m_out.appendTo(slowCase, continuation);
601
                LBasicBlock lastNext = m_out.appendTo(slowCase, continuation);
559
                speculate(NegativeZero, 0, 0, m_out.lessThan(left, m_out.int32Zero));
602
                speculate(NegativeZero, noValue(), 0, m_out.lessThan(left, m_out.int32Zero));
560
                speculate(NegativeZero, 0, 0, m_out.lessThan(right, m_out.int32Zero));
603
                speculate(NegativeZero, noValue(), 0, m_out.lessThan(right, m_out.int32Zero));
561
                m_out.jump(continuation);
604
                m_out.jump(continuation);
562
                m_out.appendTo(continuation, lastNext);
605
                m_out.appendTo(continuation, lastNext);
563
            }
606
            }
Lines 585-591 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec20
585
                // We don't have a negate-with-overflow intrinsic. Hopefully this
628
                // We don't have a negate-with-overflow intrinsic. Hopefully this
586
                // does the trick, though.
629
                // does the trick, though.
587
                LValue overflowResult = m_out.subWithOverflow32(m_out.int32Zero, value);
630
                LValue overflowResult = m_out.subWithOverflow32(m_out.int32Zero, value);
588
                speculate(Overflow, 0, 0, m_out.extractValue(overflowResult, 1));
631
                speculate(Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1));
589
                result = m_out.extractValue(overflowResult, 0);
632
                result = m_out.extractValue(overflowResult, 0);
590
            }
633
            }
591
            
634
            
Lines 656-662 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec21
656
        
699
        
657
        LValue value = lowInt32(m_node->child1());
700
        LValue value = lowInt32(m_node->child1());
658
        speculateForward(
701
        speculateForward(
659
            Overflow, 0, 0, m_out.lessThan(value, m_out.int32Zero),
702
            Overflow, noValue(), 0, m_out.lessThan(value, m_out.int32Zero),
660
            FormattedValue(ValueFormatUInt32, value));
703
            FormattedValue(ValueFormatUInt32, value));
661
        m_int32Values.add(m_node, value);
704
        m_int32Values.add(m_node, value);
662
    }
705
    }
Lines 675-681 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec22
675
        
718
        
676
        if (m_node->structureSet().size() == 1) {
719
        if (m_node->structureSet().size() == 1) {
677
            speculate(
720
            speculate(
678
                exitKind, cell, 0,
721
                exitKind, jsValueValue(cell), 0,
679
                m_out.notEqual(structure, weakPointer(m_node->structureSet()[0])));
722
                m_out.notEqual(structure, weakPointer(m_node->structureSet()[0])));
680
            return;
723
            return;
681
        }
724
        }
Lines 692-698 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec23
692
        }
735
        }
693
        
736
        
694
        speculate(
737
        speculate(
695
            exitKind, cell, 0,
738
            exitKind, jsValueValue(cell), 0,
696
            m_out.notEqual(structure, weakPointer(m_node->structureSet().last())));
739
            m_out.notEqual(structure, weakPointer(m_node->structureSet().last())));
697
        
740
        
698
        m_out.appendTo(continuation, lastNext);
741
        m_out.appendTo(continuation, lastNext);
Lines 755-761 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec24
755
        case Array::Contiguous: {
798
        case Array::Contiguous: {
756
            if (m_node->arrayMode().isInBounds()) {
799
            if (m_node->arrayMode().isInBounds()) {
757
                speculate(
800
                speculate(
758
                    OutOfBounds, 0, 0,
801
                    OutOfBounds, noValue(), 0,
759
                    m_out.aboveOrEqual(
802
                    m_out.aboveOrEqual(
760
                        index, m_out.load32(storage, m_heaps.Butterfly_publicLength)));
803
                        index, m_out.load32(storage, m_heaps.Butterfly_publicLength)));
761
                
804
                
Lines 764-770 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec25
764
                        m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties,
807
                        m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties,
765
                    storage, m_out.zeroExt(index, m_out.intPtr),
808
                    storage, m_out.zeroExt(index, m_out.intPtr),
766
                    m_state.forNode(m_node->child2()).m_value));
809
                    m_state.forNode(m_node->child2()).m_value));
767
                speculate(LoadFromHole, 0, 0, m_out.isZero64(result));
810
                speculate(LoadFromHole, noValue(), 0, m_out.isZero64(result));
768
                m_jsValueValues.add(m_node, result);
811
                m_jsValueValues.add(m_node, result);
769
                break;
812
                break;
770
            }
813
            }
Lines 865-924 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec26
865
        }
908
        }
866
    }
909
    }
867
    
910
    
868
    void speculateBackward(ExitKind, LValue, Node*, LValue failCondition)
911
    void speculateBackward(
912
        ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition)
869
    {
913
    {
870
        LBasicBlock failCase = m_out.newBlock();
914
        appendOSRExit(
871
        LBasicBlock continuation = m_out.newBlock();
915
            kind, lowValue, highValue, failCondition, BackwardSpeculation, FormattedValue());
872
        
873
        m_out.branch(failCondition, failCase, continuation);
874
        LBasicBlock lastNext = m_out.appendTo(failCase, continuation);
875
        // FIXME: Implement OSR exit.
876
        // https://bugs.webkit.org/show_bug.cgi?id=113623
877
        m_out.call(m_abortFunction);
878
        m_out.unreachable();
879
        m_out.appendTo(continuation, lastNext);
880
    }
916
    }
881
    
917
    
882
    void speculateForward(ExitKind kind, LValue lowValue, Node* highValue, LValue failCondition, const FormattedValue&)
918
    void speculateForward(
919
        ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition,
920
        const FormattedValue& recovery)
883
    {
921
    {
884
        speculateBackward(kind, lowValue, highValue, failCondition);
922
        appendOSRExit(
885
        // FIXME: Implement rewiring of OSR exit to forward.
923
            kind, lowValue, highValue, failCondition, ForwardSpeculation, recovery);
886
        // https://bugs.webkit.org/show_bug.cgi?id=113623
887
    }
924
    }
888
    
925
    
889
    void speculate(ExitKind kind, LValue lowValue, Node* highValue, LValue failCondition)
926
    void speculate(
927
        ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition)
890
    {
928
    {
891
        speculateBackward(kind, lowValue, highValue, failCondition);
929
        appendOSRExit(
892
        // FIXME: Implement rewiring the OSR exit to forward, if m_direction == ForwardDirection.
930
            kind, lowValue, highValue, failCondition, m_direction, FormattedValue());
893
        // https://bugs.webkit.org/show_bug.cgi?id=113623
894
    }
931
    }
895
    
932
    
896
    void terminate(ExitKind kind)
933
    void terminate(ExitKind kind)
897
    {
934
    {
898
        speculate(kind, 0, 0, m_out.booleanTrue);
935
        speculate(kind, noValue(), 0, m_out.booleanTrue);
899
    }
936
    }
900
    
937
    
901
    void backwardTypeCheck(LValue lowValue, Edge highValue, SpeculatedType typesPassedThrough, LValue failCondition)
938
    void backwardTypeCheck(
939
        FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough,
940
        LValue failCondition)
902
    {
941
    {
903
        if (!m_state.needsTypeCheck(highValue, typesPassedThrough))
942
        appendTypeCheck(
904
            return;
943
            lowValue, highValue, typesPassedThrough, failCondition, BackwardSpeculation,
905
        ASSERT(mayHaveTypeCheck(highValue.useKind()));
944
            FormattedValue());
906
        speculateBackward(BadType, lowValue, highValue.node(), failCondition);
907
        m_state.forNode(highValue).filter(typesPassedThrough);
908
    }
945
    }
909
    
946
    
910
    void forwardTypeCheck(LValue lowValue, Edge highValue, SpeculatedType typesPassedThrough, LValue failCondition)
947
    void forwardTypeCheck(
948
        FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough,
949
        LValue failCondition)
911
    {
950
    {
912
        backwardTypeCheck(lowValue, highValue, typesPassedThrough, failCondition);
951
        appendTypeCheck(
913
        // FIXME: Implement rewiring of OSR exit to forward.
952
            lowValue, highValue, typesPassedThrough, failCondition, ForwardSpeculation,
914
        // https://bugs.webkit.org/show_bug.cgi?id=113623
953
            FormattedValue());
915
    }
954
    }
916
    
955
    
917
    void typeCheck(LValue lowValue, Edge highValue, SpeculatedType typesPassedThrough, LValue failCondition)
956
    void typeCheck(
957
        FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough,
958
        LValue failCondition)
918
    {
959
    {
919
        backwardTypeCheck(lowValue, highValue, typesPassedThrough, failCondition);
960
        appendTypeCheck(
920
        // FIXME: Implement rewiring of OSR exit to forward, if m_direction == ForwardDirection.
961
            lowValue, highValue, typesPassedThrough, failCondition, m_direction,
921
        // https://bugs.webkit.org/show_bug.cgi?id=113623
962
            FormattedValue());
963
    }
964
    
965
    void appendTypeCheck(
966
        FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough,
967
        LValue failCondition, SpeculationDirection direction, FormattedValue recovery)
968
    {
969
        if (!m_state.needsTypeCheck(highValue, typesPassedThrough))
970
            return;
971
        ASSERT(mayHaveTypeCheck(highValue.useKind()));
972
        appendOSRExit(BadType, lowValue, highValue.node(), failCondition, direction, recovery);
973
        m_state.forNode(highValue).filter(typesPassedThrough);
922
    }
974
    }
923
    
975
    
924
    LValue lowInt32(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
976
    LValue lowInt32(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
Lines 929-935 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec27
929
            return result;
981
            return result;
930
        
982
        
931
        if (LValue boxedResult = m_jsValueValues.get(edge.node())) {
983
        if (LValue boxedResult = m_jsValueValues.get(edge.node())) {
932
            FTL_TYPE_CHECK(boxedResult, edge, SpecInt32, isNotInt32(boxedResult));
984
            FTL_TYPE_CHECK(
985
                jsValueValue(boxedResult), edge, SpecInt32, isNotInt32(boxedResult));
933
            LValue result = unboxInt32(boxedResult);
986
            LValue result = unboxInt32(boxedResult);
934
            m_int32Values.add(edge.node(), result);
987
            m_int32Values.add(edge.node(), result);
935
            return result;
988
            return result;
Lines 945-951 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec28
945
        ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || isCell(edge.useKind()));
998
        ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || isCell(edge.useKind()));
946
        
999
        
947
        if (LValue uncheckedResult = m_jsValueValues.get(edge.node())) {
1000
        if (LValue uncheckedResult = m_jsValueValues.get(edge.node())) {
948
            FTL_TYPE_CHECK(uncheckedResult, edge, SpecCell, isNotCell(uncheckedResult));
1001
            FTL_TYPE_CHECK(
1002
                jsValueValue(uncheckedResult), edge, SpecCell, isNotCell(uncheckedResult));
949
            return uncheckedResult;
1003
            return uncheckedResult;
950
        }
1004
        }
951
        
1005
        
Lines 971-977 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec29
971
            return result;
1025
            return result;
972
        
1026
        
973
        if (LValue unboxedResult = m_jsValueValues.get(edge.node())) {
1027
        if (LValue unboxedResult = m_jsValueValues.get(edge.node())) {
974
            FTL_TYPE_CHECK(unboxedResult, edge, SpecBoolean, isNotBoolean(unboxedResult));
1028
            FTL_TYPE_CHECK(
1029
                jsValueValue(unboxedResult), edge, SpecBoolean, isNotBoolean(unboxedResult));
975
            LValue result = unboxBoolean(unboxedResult);
1030
            LValue result = unboxBoolean(unboxedResult);
976
            m_booleanValues.add(edge.node(), result);
1031
            m_booleanValues.add(edge.node(), result);
977
            return result;
1032
            return result;
Lines 1094-1100 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec30
1094
    void speculateObject(Edge edge, LValue cell)
1149
    void speculateObject(Edge edge, LValue cell)
1095
    {
1150
    {
1096
        FTL_TYPE_CHECK(
1151
        FTL_TYPE_CHECK(
1097
            cell, edge, SpecObject,
1152
            jsValueValue(cell), edge, SpecObject,
1098
            m_out.equal(
1153
            m_out.equal(
1099
                m_out.loadPtr(cell, m_heaps.JSCell_structure),
1154
                m_out.loadPtr(cell, m_heaps.JSCell_structure),
1100
                m_out.constIntPtr(globalData().stringStructure.get())));
1155
                m_out.constIntPtr(globalData().stringStructure.get())));
Lines 1105-1110 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec31
1105
        speculateObject(edge, lowCell(edge));
1160
        speculateObject(edge, lowCell(edge));
1106
    }
1161
    }
1107
    
1162
    
1163
    bool isLive(Node* node)
1164
    {
1165
        HashMap<Node*, unsigned>::iterator iter = m_timeToLive.find(node);
1166
        ASSERT(iter != m_timeToLive.end());
1167
        return !!iter->value;
1168
    }
1169
    
1170
    void use(Edge edge)
1171
    {
1172
        HashMap<Node*, unsigned>::iterator iter = m_timeToLive.find(edge.node());
1173
        ASSERT(iter != m_timeToLive.end());
1174
        ASSERT(iter->value);
1175
        iter->value--;
1176
    }
1177
    
1178
    // Wrapper used only for DFG_NODE_DO_TO_CHILDREN
1179
    void use(Node*, Edge edge)
1180
    {
1181
        use(edge);
1182
    }
1183
    
1184
    void initializeOSRExitStateForBlock()
1185
    {
1186
        for (unsigned i = m_valueSources.size(); i--;) {
1187
            Node* node = m_highBlock->variablesAtHead[i];
1188
            if (!node) {
1189
                m_valueSources[i] = ValueSource(SourceIsDead);
1190
                continue;
1191
            }
1192
            
1193
            VariableAccessData* variable = node->variableAccessData();
1194
            SpeculatedType prediction = variable->argumentAwarePrediction();
1195
            
1196
            if (variable->isArgumentsAlias()) {
1197
                m_valueSources[i] = ValueSource(ArgumentsSource);
1198
                continue;
1199
            }
1200
            
1201
            if (!node->shouldGenerate()) {
1202
                m_valueSources[i] = ValueSource(SourceIsDead);
1203
                continue;
1204
            }
1205
            
1206
            if (m_flushedLocalOps.contains(node)) {
1207
                // This value will have been flushed to the JSStack in some form or
1208
                // another.
1209
                
1210
                if (variable->shouldUnboxIfPossible()) {
1211
                    if (variable->shouldUseDoubleFormat()) {
1212
                        m_valueSources[i] = ValueSource(DoubleInJSStack);
1213
                        continue;
1214
                    }
1215
                    
1216
                    if (isInt32Speculation(prediction)) {
1217
                        m_valueSources[i] = ValueSource(Int32InJSStack);
1218
                        continue;
1219
                    }
1220
                }
1221
                
1222
                m_valueSources[i] = ValueSource(ValueInJSStack);
1223
                continue;
1224
            }
1225
            
1226
            if (variable->shouldUnboxIfPossible()) {
1227
                if (variable->shouldUseDoubleFormat()) {
1228
                    m_valueSources[i] = ValueSource(ValueInLocals);
1229
                    continue;
1230
                }
1231
                
1232
                if (isInt32Speculation(prediction)) {
1233
                    m_valueSources[i] = ValueSource(Int32InLocals);
1234
                    continue;
1235
                }
1236
                
1237
                if (isBooleanSpeculation(prediction)) {
1238
                    m_valueSources[i] = ValueSource(BooleanInLocals);
1239
                    continue;
1240
                }
1241
            }
1242
            
1243
            m_valueSources[i] = ValueSource(ValueInLocals);
1244
        }
1245
    }
1246
    
1247
    void appendOSRExit(
1248
        ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition,
1249
        SpeculationDirection direction, FormattedValue recovery)
1250
    {
1251
        m_ftlState.jitCode->osrExit.append(
1252
            OSRExit(
1253
                kind, lowValue.format(), m_graph.methodOfGettingAValueProfileFor(highValue),
1254
                m_node->codeOrigin, m_lastSetOperand, m_valueSources.numberOfArguments(),
1255
                m_valueSources.numberOfLocals()));
1256
        m_ftlState.osrExit.append(OSRExitCompilationInfo());
1257
        
1258
        OSRExit& exit = m_ftlState.jitCode->osrExit.last();
1259
        OSRExitCompilationInfo& info = m_ftlState.osrExit.last();
1260
1261
        LBasicBlock failCase = m_out.newBlock();
1262
        LBasicBlock continuation = m_out.newBlock();
1263
        
1264
        m_out.branch(failCondition, failCase, continuation);
1265
        
1266
        m_out.appendTo(m_prologue);
1267
        info.m_thunkAddress = buildAlloca(m_out.m_builder, m_out.intPtr);
1268
        
1269
        LBasicBlock lastNext = m_out.appendTo(failCase, continuation);
1270
        
1271
        ExitArgumentList arguments;
1272
        arguments.append(m_callFrame);
1273
        if (!!lowValue)
1274
            arguments.append(lowValue.value());
1275
        
1276
        for (unsigned i = 0; i < exit.m_values.size(); ++i) {
1277
            ValueSource source = m_valueSources[i];
1278
            
1279
            switch (source.kind()) {
1280
            case ValueInJSStack:
1281
                exit.m_values[i] = ExitValue::inJSStack();
1282
                break;
1283
            case Int32InJSStack:
1284
                exit.m_values[i] = ExitValue::inJSStackAsInt32();
1285
                break;
1286
            case DoubleInJSStack:
1287
                exit.m_values[i] = ExitValue::inJSStackAsDouble();
1288
                break;
1289
            case ValueInLocals:
1290
                addExitArgument(
1291
                    exit, arguments, i, ValueFormatJSValue, m_out.get(m_locals64[i]));
1292
                break;
1293
            case Int32InLocals:
1294
                addExitArgument(
1295
                    exit, arguments, i, ValueFormatInt32, m_out.get(m_locals32[i]));
1296
                break;
1297
            case BooleanInLocals:
1298
                addExitArgument(
1299
                    exit, arguments, i, ValueFormatBoolean, m_out.get(m_localsBoolean[i]));
1300
                break;
1301
            case DoubleInLocals:
1302
                // FIXME: implement doubles in FTL.
1303
                // https://bugs.webkit.org/show_bug.cgi?id=113624
1304
                RELEASE_ASSERT_NOT_REACHED();
1305
                break;
1306
            case ArgumentsSource:
1307
                // FIXME: implement PhantomArguments.
1308
                // https://bugs.webkit.org/show_bug.cgi?id=113986
1309
                RELEASE_ASSERT_NOT_REACHED();
1310
                break;
1311
            case SourceIsDead:
1312
                exit.m_values[i] = ExitValue::dead();
1313
                break;
1314
            case HaveNode:
1315
                addExitArgumentForNode(exit, arguments, i, source.node());
1316
                break;
1317
            default:
1318
                RELEASE_ASSERT_NOT_REACHED();
1319
                break;
1320
            }
1321
        }
1322
        
1323
        if (direction == ForwardSpeculation)
1324
            exit.convertToForward(m_highBlock, m_node, m_nodeIndex, recovery, arguments);
1325
        
1326
        // So, the really lame thing here is that we have to build an LLVM function type.
1327
        // Booo.
1328
        Vector<LType, 16> argumentTypes;
1329
        for (unsigned i = 0; i < arguments.size(); ++i)
1330
            argumentTypes.append(typeOf(arguments[i]));
1331
        
1332
        m_out.call(
1333
            m_out.intToPtr(
1334
                m_out.get(info.m_thunkAddress),
1335
                pointerType(functionType(m_out.voidType, argumentTypes))),
1336
            arguments);
1337
        m_out.unreachable();
1338
        
1339
        m_out.appendTo(continuation, lastNext);
1340
    }
1341
    
1342
    void addExitArgumentForNode(
1343
        OSRExit& exit, ExitArgumentList& arguments, unsigned index, Node* node)
1344
    {
1345
        ASSERT(node->shouldGenerate());
1346
        ASSERT(node->hasResult());
1347
1348
        if (tryToSetConstantExitArgument(exit, index, node))
1349
            return;
1350
        
1351
        if (!isLive(node)) {
1352
            bool found = false;
1353
            
1354
            if (needsOSRBackwardRewiring(node->op())) {
1355
                node = node->child1().node();
1356
                if (tryToSetConstantExitArgument(exit, index, node))
1357
                    return;
1358
                if (isLive(node))
1359
                    found = true;
1360
            }
1361
            
1362
            if (!found) {
1363
                Node* int32ToDouble = 0;
1364
                Node* valueToInt32 = 0;
1365
                Node* uint32ToNumber = 0;
1366
                Node* doubleAsInt32 = 0;
1367
                
1368
                HashMap<Node*, unsigned>::iterator iter = m_timeToLive.begin();
1369
                HashMap<Node*, unsigned>::iterator end = m_timeToLive.end();
1370
                for (; iter != end; ++iter) {
1371
                    if (!iter->value)
1372
                        continue;
1373
                    Node* candidate = iter->key;
1374
                    if (!candidate->child1())
1375
                        continue;
1376
                    if (candidate->child1() != node)
1377
                        continue;
1378
                    switch (candidate->op()) {
1379
                    case Int32ToDouble:
1380
                    case ForwardInt32ToDouble:
1381
                        int32ToDouble = candidate;
1382
                        break;
1383
                    case ValueToInt32:
1384
                        valueToInt32 = candidate;
1385
                        break;
1386
                    case UInt32ToNumber:
1387
                        uint32ToNumber = candidate;
1388
                        break;
1389
                    case DoubleAsInt32:
1390
                        uint32ToNumber = candidate;
1391
                        break;
1392
                    default:
1393
                        ASSERT(!needsOSRForwardRewiring(candidate->op()));
1394
                        break;
1395
                    }
1396
                }
1397
                
1398
                if (doubleAsInt32)
1399
                    node = doubleAsInt32;
1400
                else if (int32ToDouble)
1401
                    node = int32ToDouble;
1402
                else if (valueToInt32)
1403
                    node = valueToInt32;
1404
                else if (uint32ToNumber)
1405
                    node = uint32ToNumber;
1406
                
1407
                if (isLive(node))
1408
                    found = true;
1409
            }
1410
            
1411
            if (!found) {
1412
                exit.m_values[index] = ExitValue::dead();
1413
                return;
1414
            }
1415
        }
1416
        
1417
        ASSERT(isLive(node));
1418
        
1419
        if (LValue result = m_int32Values.get(node)) {
1420
            addExitArgument(exit, arguments, index, ValueFormatInt32, result);
1421
            return;
1422
        }
1423
        
1424
        if (LValue result = m_booleanValues.get(node)) {
1425
            addExitArgument(exit, arguments, index, ValueFormatBoolean, result);
1426
            return;
1427
        }
1428
        
1429
        if (LValue result = m_jsValueValues.get(node)) {
1430
            addExitArgument(exit, arguments, index, ValueFormatJSValue, result);
1431
            return;
1432
        }
1433
        
1434
        // FIXME: Implement doubles in the FTL.
1435
        // https://bugs.webkit.org/show_bug.cgi?id=113624
1436
        RELEASE_ASSERT_NOT_REACHED();
1437
    }
1438
    
1439
    bool tryToSetConstantExitArgument(OSRExit& exit, unsigned index, Node* node)
1440
    {
1441
        if (!node)
1442
            return false;
1443
        
1444
        switch (node->op()) {
1445
        case JSConstant:
1446
        case WeakJSConstant:
1447
            exit.m_values[index] = ExitValue::constant(m_graph.valueOfJSConstant(node));
1448
            return true;
1449
        case PhantomArguments:
1450
            // FIXME: implement PhantomArguments.
1451
            // https://bugs.webkit.org/show_bug.cgi?id=113986
1452
            RELEASE_ASSERT_NOT_REACHED();
1453
            return true;
1454
        default:
1455
            return false;
1456
        }
1457
    }
1458
    
1459
    void addExitArgument(
1460
        OSRExit& exit, ExitArgumentList& arguments, unsigned index, ValueFormat format,
1461
        LValue value)
1462
    {
1463
        exit.m_values[index] = ExitValue::exitArgument(ExitArgument(format, arguments.size()));
1464
        arguments.append(value);
1465
    }
1466
    
1467
    void linkOSRExitsAndCompleteInitializationBlock()
1468
    {
1469
        MacroAssemblerCodeRef osrExitThunk =
1470
            globalData().getCTIStub(osrExitGenerationThunkGenerator);
1471
        CodeLocationLabel target = CodeLocationLabel(osrExitThunk.code());
1472
        
1473
        m_out.appendTo(m_initialization);
1474
        
1475
        LinkBuffer linkBuffer(
1476
            globalData(), &m_exitThunkGenerator, m_ftlState.graph.m_codeBlock,
1477
            JITCompilationMustSucceed);
1478
        
1479
        ASSERT(m_ftlState.osrExit.size() == m_ftlState.jitCode->osrExit.size());
1480
        
1481
        for (unsigned i = 0; i < m_ftlState.osrExit.size(); ++i) {
1482
            OSRExitCompilationInfo& info = m_ftlState.osrExit[i];
1483
            OSRExit& exit = m_ftlState.jitCode->osrExit[i];
1484
            
1485
            linkBuffer.link(info.m_thunkJump, target);
1486
            
1487
            m_out.set(
1488
                m_out.constIntPtr(
1489
                    linkBuffer.locationOf(info.m_thunkLabel).executableAddress()),
1490
                info.m_thunkAddress);
1491
            
1492
            exit.m_patchableCodeOffset = linkBuffer.offsetOf(info.m_thunkJump);
1493
        }
1494
        
1495
        m_ftlState.jitCode->initializeExitThunks(
1496
            FINALIZE_DFG_CODE(
1497
                linkBuffer,
1498
                ("FTL exit thunks for %s", toCString(CodeBlockWithJITType(m_ftlState.graph.m_codeBlock,JITCode::FTLJIT)).data())));
1499
1500
        m_out.jump(m_blocks.get(m_graph.m_blocks[0].get()));
1501
    }
1502
    
1503
    void observeMovHint(Node* node)
1504
    {
1505
        ASSERT(node->containsMovHint());
1506
        ASSERT(node->op() != ZombieHint);
1507
        
1508
        int operand = node->local();
1509
        
1510
        m_lastSetOperand = operand;
1511
        m_valueSources[operand] = ValueSource(node->child1().node());
1512
    }
1513
    
1108
    void addWeakReference(JSCell* target)
1514
    void addWeakReference(JSCell* target)
1109
    {
1515
    {
1110
        m_ftlState.jitCode->common.weakReferences.append(
1516
        m_ftlState.jitCode->common.weakReferences.append(
Lines 1151-1162 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec32
1151
    Output m_out;
1557
    Output m_out;
1152
    
1558
    
1153
    LBasicBlock m_prologue;
1559
    LBasicBlock m_prologue;
1560
    LBasicBlock m_initialization;
1154
    HashMap<BasicBlock*, LBasicBlock> m_blocks;
1561
    HashMap<BasicBlock*, LBasicBlock> m_blocks;
1155
    
1562
    
1156
    LValue m_callFrame;
1563
    LValue m_callFrame;
1157
    LValue m_tagTypeNumber;
1564
    LValue m_tagTypeNumber;
1158
    LValue m_tagMask;
1565
    LValue m_tagMask;
1159
    LValue m_abortFunction;
1160
    
1566
    
1161
    HashSet<Node*> m_flushedLocalOps;
1567
    HashSet<Node*> m_flushedLocalOps;
1162
    Vector<Node*> m_flushedLocalOpWorklist;
1568
    Vector<Node*> m_flushedLocalOpWorklist;
Lines 1165-1179 private: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp_sec33
1165
    HashMap<Node*, LValue> m_jsValueValues;
1571
    HashMap<Node*, LValue> m_jsValueValues;
1166
    HashMap<Node*, LValue> m_booleanValues;
1572
    HashMap<Node*, LValue> m_booleanValues;
1167
    HashMap<Node*, LValue> m_storageValues;
1573
    HashMap<Node*, LValue> m_storageValues;
1574
    HashMap<Node*, unsigned> m_timeToLive;
1168
    
1575
    
1169
    Operands<LValue> m_localsBoolean;
1576
    Operands<LValue> m_localsBoolean;
1170
    Operands<LValue> m_locals32;
1577
    Operands<LValue> m_locals32;
1171
    Operands<LValue> m_locals64;
1578
    Operands<LValue> m_locals64;
1172
    
1579
    
1580
    Operands<ValueSource> m_valueSources;
1581
    int m_lastSetOperand;
1582
    ExitThunkGenerator m_exitThunkGenerator;
1583
    
1173
    AbstractState m_state;
1584
    AbstractState m_state;
1174
    BasicBlock* m_highBlock;
1585
    BasicBlock* m_highBlock;
1175
    BasicBlock* m_nextHighBlock;
1586
    BasicBlock* m_nextHighBlock;
1176
    LBasicBlock m_nextLowBlock;
1587
    LBasicBlock m_nextLowBlock;
1588
    unsigned m_nodeIndex;
1177
    Node* m_node;
1589
    Node* m_node;
1178
    SpeculationDirection m_direction;
1590
    SpeculationDirection m_direction;
1179
};
1591
};
- Source/JavaScriptCore/ftl/FTLOSRExit.cpp +103 lines
Line 0 Source/JavaScriptCore/ftl/FTLOSRExit.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLOSRExit.h"
28
29
#if ENABLE(FTL_JIT)
30
31
#include "CodeBlock.h"
32
#include "DFGBasicBlock.h"
33
#include "DFGNode.h"
34
#include "FTLExitArgument.h"
35
#include "FTLExitArgumentList.h"
36
#include "FTLJITCode.h"
37
#include "Operations.h"
38
39
namespace JSC { namespace FTL {
40
41
using namespace DFG;
42
43
OSRExit::OSRExit(
44
    ExitKind exitKind, ValueFormat profileValueFormat,
45
    MethodOfGettingAValueProfile valueProfile, CodeOrigin codeOrigin,
46
    int lastSetOperand, unsigned numberOfArguments, unsigned numberOfLocals)
47
    : OSRExitBase(exitKind, codeOrigin)
48
    , m_profileValueFormat(profileValueFormat)
49
    , m_valueProfile(valueProfile)
50
    , m_patchableCodeOffset(0)
51
    , m_lastSetOperand(lastSetOperand)
52
    , m_values(numberOfArguments, numberOfLocals)
53
{
54
}
55
56
CodeLocationJump OSRExit::codeLocationForRepatch(CodeBlock* ftlCodeBlock) const
57
{
58
    return CodeLocationJump(
59
        reinterpret_cast<char*>(
60
            ftlCodeBlock->getJITCode()->ftl()->exitThunks().dataLocation()) +
61
        m_patchableCodeOffset);
62
}
63
64
void OSRExit::convertToForward(
65
    BasicBlock* block, Node* currentNode, unsigned nodeIndex,
66
    const FormattedValue &value, ExitArgumentList& arguments)
67
{
68
    Node* node;
69
    Node* lastMovHint;
70
    if (!doSearchForForwardConversion(block, currentNode, nodeIndex, !!value, node, lastMovHint))
71
        return;
72
73
    ASSERT(node->codeOrigin != currentNode->codeOrigin);
74
    
75
    m_codeOrigin = node->codeOrigin;
76
    
77
    if (!value)
78
        return;
79
    
80
    int overriddenOperand = lastMovHint->local();
81
    m_lastSetOperand = overriddenOperand;
82
    
83
    // Is the value for this operand being passed as an argument to the exit, or is
84
    // it something else? If it's an argument already, then replace that argument;
85
    // otherwise add another argument.
86
    if (m_values[overriddenOperand].isArgument()) {
87
        ExitArgument exitArgument = m_values[overriddenOperand].exitArgument();
88
        arguments[exitArgument.argument()] = value.value();
89
        m_values[overriddenOperand] = ExitValue::exitArgument(
90
            exitArgument.withFormat(value.format()));
91
        return;
92
    }
93
    
94
    unsigned argument = arguments.size();
95
    arguments.append(value.value());
96
    m_values[m_lastSetOperand] = ExitValue::exitArgument(
97
        ExitArgument(value.format(), argument));
98
}
99
100
} } // namespace JSC::FTL
101
102
#endif // ENABLE(FTL_JIT)
103
- Source/JavaScriptCore/ftl/FTLOSRExit.h +179 lines
Line 0 Source/JavaScriptCore/ftl/FTLOSRExit.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLOSRExit_h
27
#define FTLOSRExit_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "CodeOrigin.h"
34
#include "DFGExitProfile.h"
35
#include "DFGOSRExitBase.h"
36
#include "FTLAbbreviations.h"
37
#include "FTLExitArgumentList.h"
38
#include "FTLExitValue.h"
39
#include "FTLFormattedValue.h"
40
#include "MethodOfGettingAValueProfile.h"
41
#include "Operands.h"
42
#include "ValueProfile.h"
43
44
namespace JSC { namespace FTL {
45
46
// Tracks one OSR exit site within the FTL JIT. OSR exit in FTL works by deconstructing
47
// the crazy that is OSR down to simple SSA CFG primitives that any compiler backend
48
// (including of course LLVM) can grok and do meaningful things to. Except for
49
// watchpoint-based exits, which haven't yet been implemented (see webkit.org/b/113647),
50
// an exit is just a conditional branch in the emitted code where one destination is the
51
// continuation and the other is a basic block that performs a no-return tail-call to an
52
// exit thunk. This thunk takes as its arguments the live non-constant
53
// not-already-accounted-for bytecode state. To appreciate how this works consider the
54
// following JavaScript program, and its lowering down to LLVM IR including the relevant
55
// exits:
56
//
57
// function foo(o) {
58
//     var a = o.a; // predicted int
59
//     var b = o.b;
60
//     var c = o.c; // NB this is dead
61
//     a = a | 5; // our example OSR exit: need to check if a is an int
62
//     return a + b;
63
// }
64
//
65
// Just consider the "a | 5". In the DFG IR, this looks like:
66
//
67
// BitOr(Check:Int32:@a, Int32:5)
68
//
69
// Where @a is the node for the GetLocal node that gets the value of the 'a' variable.
70
// Conceptually, this node can be further broken down to the following (note that this
71
// particular lowering never actually happens - we skip this step and go straight to
72
// LLVM IR - but it's still useful to see this):
73
//
74
// exitIf(@a is not int32);
75
// continuation;
76
//
77
// Where 'exitIf()' is a function that will exit if the argument is true, and
78
// 'continuation' is the stuff that we will do after the exitIf() check. (Note that
79
// FTL refers to 'exitIf()' as 'speculate()', which is in line with DFG terminology.)
80
// This then gets broken down to the following LLVM IR, assuming that %0 is the LLVM
81
// value corresponding to variable 'a', and %1 is the LLVM value for variable 'b':
82
//
83
//   %2 = ... // the predictate corresponding to '@a is not int32'
84
//   br i1 %2, label %3, label %4
85
// ; <label>:3
86
//   call void exitThunk1(%0, %1) // pass 'a' and 'b', since they're both live-in-bytecode
87
//   unreachable
88
// ; <label>:4
89
//   ... // code for the continuation
90
//
91
// Where 'exitThunk1' is the IR to get the exit thunk for *this* OSR exit. Each OSR
92
// exit will appear to LLVM to have a distinct exit thunk.
93
//
94
// Note that this didn't have to pass '5', 'o', or 'c' to the exit thunk. 5 is a
95
// constant and the DFG already knows that, and can already tell the OSR exit machinery
96
// what that contant is and which bytecode variables (if any) it needs to be dropped
97
// into. This is conveyed to the exit statically, via the OSRExit data structure below.
98
// See the code for ExitValue for details. 'o' is an argument, and arguments are always
99
// "flushed" - if you never assign them then their values are still in the argument
100
// stack slots, and if you do assign them then we eagerly store them into those slots.
101
// 'c' is dead in bytecode, and the DFG knows this; we statically tell the exit thunk
102
// that it's dead and don't have to pass anything. The exit thunk will "initialize" its
103
// value to Undefined.
104
//
105
// This approach to OSR exit has a number of virtues:
106
//
107
// - It is an entirely unsurprising representation for a compiler that already groks
108
//   CFG-like IRs for C-like languages. All existing analyses and transformations just
109
//   work.
110
//
111
// - It lends itself naturally to modern approaches to code motion. For example, you
112
//   could sink operations from above the exit to below it, if you just duplicate the
113
//   operation into the OSR exit block. This is both legal and desirable. It works
114
//   because the backend sees the OSR exit block as being no different than any other,
115
//   and LLVM already supports sinking if it sees that a value is only partially used.
116
//   Hence there exists a value that dominates the exit but is only used by the exit
117
//   thunk and not by the continuation, sinking ought to kick in for that value.
118
//   Hoisting operations from below it to above it is also possible, for similar
119
//   reasons.
120
//
121
// - The no-return tail-call to the OSR exit thunk can be subjected to specialized
122
//   code-size reduction optimizations, though this is optional. For example, instead
123
//   of actually emitting a call along with all that goes with it (like placing the
124
//   arguments into argument position), the backend could choose to simply inform us
125
//   where it had placed the arguments and expect the callee (i.e. the exit thunk) to
126
//   figure it out from there. It could also tell us what we need to do to pop stack,
127
//   although again, it doesn't have to; it could just emit that code normally. Though
128
//   we don't support this yet, we could; the only thing that would change on our end
129
//   is that we'd need feedback from the backend about the location of the arguments
130
//   and a description of the things that need to be done to pop stack. This would
131
//   involve switching the m_values array to use something more akin to ValueRecovery
132
//   rather than the current ExitValue, albeit possibly with some hacks to better
133
//   understand the kinds of places where the LLVM backend would put values.
134
//
135
// - It could be extended to allow the backend to do its own exit hoisting, by using
136
//   intrinsics (or meta-data, or something) to inform the backend that it's safe to
137
//   make the predicate passed to 'exitIf()' more truthy.
138
//
139
// - It could be extended to support watchpoints (see webkit.org/b/113647) by making
140
//   the predicate passed to 'exitIf()' be an intrinsic that the backend knows to be
141
//   true at compile-time. The backend could then turn the conditional branch into a
142
//   replaceable jump, much like the DFG does.
143
144
struct OSRExit : public DFG::OSRExitBase {
145
    OSRExit(
146
        ExitKind, ValueFormat profileValueFormat, MethodOfGettingAValueProfile,
147
        CodeOrigin, int lastSetOperand, unsigned numberOfArguments,
148
        unsigned numberOfLocals);
149
    
150
    MacroAssemblerCodeRef m_code;
151
    
152
    // The first argument to the exit call may be a value we wish to profile.
153
    // If that's the case, the format will be not Invalid and we'll have a
154
    // method of getting a value profile. Note that all of the ExitArgument's
155
    // are already aware of this possible off-by-one, so there is no need to
156
    // correct them.
157
    ValueFormat m_profileValueFormat;
158
    MethodOfGettingAValueProfile m_valueProfile;
159
    
160
    // Offset within the exit stubs of the stub for this exit.
161
    unsigned m_patchableCodeOffset;
162
    
163
    int m_lastSetOperand;
164
    
165
    Operands<ExitValue> m_values;
166
    
167
    CodeLocationJump codeLocationForRepatch(CodeBlock* ftlCodeBlock) const;
168
    
169
    void convertToForward(
170
        DFG::BasicBlock*, DFG::Node* currentNode, unsigned nodeIndex,
171
        const FormattedValue&, ExitArgumentList& arguments);
172
};
173
174
} } // namespace JSC::FTL
175
176
#endif // ENABLE(FTL_JIT)
177
178
#endif // FTLOSRExit_h
179
- Source/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h +54 lines
Line 0 Source/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLOSRExitCompilationInfo_h
27
#define FTLOSRExitCompilationInfo_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "FTLAbbreviations.h"
34
#include "MacroAssembler.h"
35
36
namespace JSC { namespace FTL {
37
38
struct OSRExitCompilationInfo {
39
    OSRExitCompilationInfo()
40
        : m_thunkAddress(0)
41
    {
42
    }
43
    
44
    MacroAssembler::Label m_thunkLabel;
45
    MacroAssembler::PatchableJump m_thunkJump;
46
    LValue m_thunkAddress;
47
};
48
49
} } // namespace JSC::FTL
50
51
#endif // ENABLE(FTL_JIT)
52
53
#endif // FTLOSRExitCompilationInfo_h
54
- Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp +192 lines
Line 0 Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLOSRExitCompiler.h"
28
29
#if ENABLE(FTL_JIT)
30
31
#include "DFGOSRExitCompilerCommon.h"
32
#include "DFGOSRExitPreparation.h"
33
#include "FTLCArgumentGetter.h"
34
#include "FTLExitArgumentForOperand.h"
35
#include "FTLJITCode.h"
36
#include "FTLOSRExit.h"
37
#include "RepatchBuffer.h"
38
39
namespace JSC { namespace FTL {
40
41
using namespace DFG;
42
43
static void compileStub(
44
    unsigned exitID, OSRExit& exit, JSGlobalData* globalData, CodeBlock* codeBlock)
45
{
46
    CCallHelpers jit(globalData, codeBlock);
47
    
48
    // This is actually fairly easy, even though it is horribly gross. We know that
49
    // LLVM would have passes us all of the state via arguments. We know how to get
50
    // the arguments. And, we know how to pop stack back to the JIT stack frame, sort
51
    // of: we know that it's two frames beneath us. This is terrible and I feel
52
    // ashamed of it, but it will work for now.
53
    
54
    CArgumentGetter arguments(jit);
55
    
56
    // First recover our call frame and tag thingies.
57
    arguments.loadNextPtr(GPRInfo::callFrameRegister);
58
    jit.move(MacroAssembler::TrustedImm64(TagTypeNumber), GPRInfo::tagTypeNumberRegister);
59
    jit.move(MacroAssembler::TrustedImm64(TagMask), GPRInfo::tagMaskRegister);
60
    
61
    // Do some value profiling.
62
    if (exit.m_profileValueFormat != InvalidValueFormat) {
63
        arguments.loadNextAndBox(exit.m_profileValueFormat, GPRInfo::nonArgGPR0);
64
        
65
        if (exit.m_kind == BadCache || exit.m_kind == BadIndexingType) {
66
            CodeOrigin codeOrigin = exit.m_codeOriginForExitProfile;
67
            if (ArrayProfile* arrayProfile = jit.baselineCodeBlockFor(codeOrigin)->getArrayProfile(codeOrigin.bytecodeIndex)) {
68
                jit.loadPtr(MacroAssembler::Address(GPRInfo::nonArgGPR0, JSCell::structureOffset()), GPRInfo::nonArgGPR1);
69
                jit.storePtr(GPRInfo::nonArgGPR1, arrayProfile->addressOfLastSeenStructure());
70
                jit.load8(MacroAssembler::Address(GPRInfo::nonArgGPR1, Structure::indexingTypeOffset()), GPRInfo::nonArgGPR1);
71
                jit.move(MacroAssembler::TrustedImm32(1), GPRInfo::nonArgGPR2);
72
                jit.lshift32(GPRInfo::nonArgGPR1, GPRInfo::nonArgGPR2);
73
                jit.or32(GPRInfo::nonArgGPR2, MacroAssembler::AbsoluteAddress(arrayProfile->addressOfArrayModes()));
74
            }
75
        }
76
        
77
        if (!!exit.m_valueProfile)
78
            jit.store64(GPRInfo::nonArgGPR0, exit.m_valueProfile.getSpecFailBucket(0));
79
    }
80
    
81
    // Start by dumping all argument exit values to the stack.
82
    
83
    Vector<ExitArgumentForOperand, 16> sortedArguments;
84
    for (unsigned i = exit.m_values.size(); i--;) {
85
        ExitValue value = exit.m_values[i];
86
        int operand = exit.m_values.operandForIndex(i);
87
        
88
        if (!value.isArgument())
89
            continue;
90
        
91
        sortedArguments.append(ExitArgumentForOperand(value.exitArgument(), operand));
92
    }
93
    std::sort(sortedArguments.begin(), sortedArguments.end(), lesserArgumentIndex);
94
    
95
    for (unsigned i = 0; i < sortedArguments.size(); ++i) {
96
        ExitArgumentForOperand argument = sortedArguments[i];
97
        
98
        arguments.loadNextAndBox(argument.exitArgument().format(), GPRInfo::nonArgGPR0);
99
        jit.store64(GPRInfo::nonArgGPR0, AssemblyHelpers::addressFor(argument.operand()));
100
    }
101
    
102
    // Box anything that is already on the stack, or that is a constant.
103
    
104
    for (unsigned i = exit.m_values.size(); i--;) {
105
        ExitValue value = exit.m_values[i];
106
        int operand = exit.m_values.operandForIndex(i);
107
        
108
        MacroAssembler::Address address = AssemblyHelpers::addressFor(operand);
109
        
110
        switch (value.kind()) {
111
        case ExitValueDead:
112
            jit.store64(MacroAssembler::TrustedImm64(JSValue::encode(jsUndefined())), address);
113
            break;
114
        case ExitValueConstant:
115
            jit.store64(MacroAssembler::TrustedImm64(JSValue::encode(value.constant())), address);
116
            break;
117
        case ExitValueInJSStack:
118
            break;
119
        case ExitValueInJSStackAsInt32:
120
            jit.load32(
121
                address.withOffset(OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)),
122
                GPRInfo::regT0);
123
            jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
124
            jit.store64(GPRInfo::regT0, address);
125
            break;
126
        case ExitValueInJSStackAsDouble:
127
            jit.loadDouble(address, FPRInfo::fpRegT0);
128
            jit.boxDouble(FPRInfo::fpRegT0, GPRInfo::regT0);
129
            jit.store64(GPRInfo::regT0, address);
130
            break;
131
        case ExitValueArgument:
132
            break;
133
        default:
134
            RELEASE_ASSERT_NOT_REACHED();
135
            break;
136
        }
137
    }
138
    
139
    handleExitCounts(jit, exit);
140
    reifyInlinedCallFrames(jit, exit);
141
    
142
    // Adjust the C stack. The frame pointer should at this point still hold the pointer
143
    // to the frame of the LLVM-generated code.
144
    
145
    jit.move(MacroAssembler::framePointerRegister, MacroAssembler::stackPointerRegister);
146
    jit.pop(MacroAssembler::framePointerRegister);
147
    jit.pop(GPRInfo::nonArgGPR0); // ignore the result.
148
    
149
    if (exit.m_lastSetOperand != std::numeric_limits<int>::max()) {
150
        jit.load64(
151
            AssemblyHelpers::addressFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
152
    }
153
    
154
    adjustAndJumpToTarget(jit, exit);
155
    
156
    LinkBuffer patchBuffer(*globalData, &jit, codeBlock);
157
    exit.m_code = FINALIZE_CODE_IF(
158
        shouldShowDisassembly(),
159
        patchBuffer,
160
        ("FTL OSR exit #%u (bc#%u, %s) from %s",
161
            exitID, exit.m_codeOrigin.bytecodeIndex,
162
            exitKindToString(exit.m_kind), toCString(*codeBlock).data()));
163
}
164
165
extern "C" void* compileFTLOSRExit(ExecState* exec, unsigned exitID)
166
{
167
    SamplingRegion samplingRegion("FTL OSR Exit Compilation");
168
    
169
    CodeBlock* codeBlock = exec->codeBlock();
170
    
171
    ASSERT(codeBlock);
172
    ASSERT(codeBlock->getJITType() == JITCode::FTLJIT);
173
    
174
    JSGlobalData* globalData = &exec->globalData();
175
    
176
    OSRExit& exit = codeBlock->getJITCode()->ftl()->osrExit[exitID];
177
    
178
    prepareCodeOriginForOSRExit(exec, exit.m_codeOrigin);
179
    
180
    compileStub(exitID, exit, globalData, codeBlock);
181
    
182
    RepatchBuffer repatchBuffer(codeBlock);
183
    repatchBuffer.relink(
184
        exit.codeLocationForRepatch(codeBlock), CodeLocationLabel(exit.m_code.code()));
185
    
186
    return exit.m_code.code().executableAddress();
187
}
188
189
} } // namespace JSC::FTL
190
191
#endif // ENABLE(FTL_JIT)
192
- Source/JavaScriptCore/ftl/FTLOSRExitCompiler.h +48 lines
Line 0 Source/JavaScriptCore/ftl/FTLOSRExitCompiler.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLOSRExitCompiler_h
27
#define FTLOSRExitCompiler_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "DFGOperations.h"
34
35
namespace JSC { namespace FTL {
36
37
// Takes the call frame and the index of the exit, and returns the address to
38
// jump to.
39
extern "C" {
40
void* DFG_OPERATION compileFTLOSRExit(ExecState*, unsigned exitID) WTF_INTERNAL;
41
}
42
43
} } // namespace JSC::FTL
44
45
#endif // ENABLE(FTL_JIT)
46
47
#endif // FTLOSRExitCompiler_h
48
- Source/JavaScriptCore/ftl/FTLOutput.h -2 / +11 lines
Lines 135-153 public: Source/JavaScriptCore/ftl/FTLOutput.h_sec1
135
    LValue zeroExt(LValue value, LType type) { return buildZExt(m_builder, value, type); }
135
    LValue zeroExt(LValue value, LType type) { return buildZExt(m_builder, value, type); }
136
    LValue intCast(LValue value, LType type) { return buildIntCast(m_builder, value, type); }
136
    LValue intCast(LValue value, LType type) { return buildIntCast(m_builder, value, type); }
137
    LValue castToInt32(LValue value) { return intCast(value, int32); }
137
    LValue castToInt32(LValue value) { return intCast(value, int32); }
138
    LValue intToPtr(LValue value, LType type) { return buildIntToPtr(m_builder, value, type); }
138
    
139
    
139
    LValue get(LValue reference) { return buildLoad(m_builder, reference); }
140
    LValue get(LValue reference) { return buildLoad(m_builder, reference); }
140
    LValue set(LValue value, LValue reference) { return buildStore(m_builder, value, reference); }
141
    LValue set(LValue value, LValue reference) { return buildStore(m_builder, value, reference); }
141
    
142
    
142
    LValue load(TypedPointer pointer, LType refType)
143
    LValue load(TypedPointer pointer, LType refType)
143
    {
144
    {
144
        LValue result = get(buildIntToPtr(m_builder, pointer.value(), refType));
145
        LValue result = get(intToPtr(pointer.value(), refType));
145
        pointer.heap().decorateInstruction(result, *m_heaps);
146
        pointer.heap().decorateInstruction(result, *m_heaps);
146
        return result;
147
        return result;
147
    }
148
    }
148
    void store(LValue value, TypedPointer pointer, LType refType)
149
    void store(LValue value, TypedPointer pointer, LType refType)
149
    {
150
    {
150
        LValue result = set(value, buildIntToPtr(m_builder, pointer.value(), refType));
151
        LValue result = set(value, intToPtr(pointer.value(), refType));
151
        pointer.heap().decorateInstruction(result, *m_heaps);
152
        pointer.heap().decorateInstruction(result, *m_heaps);
152
    }
153
    }
153
    
154
    
Lines 244-253 public: Source/JavaScriptCore/ftl/FTLOutput.h_sec2
244
    LValue select(LValue value, LValue taken, LValue notTaken) { return buildSelect(m_builder, value, taken, notTaken); }
245
    LValue select(LValue value, LValue taken, LValue notTaken) { return buildSelect(m_builder, value, taken, notTaken); }
245
    LValue extractValue(LValue aggVal, unsigned index) { return buildExtractValue(m_builder, aggVal, index); }
246
    LValue extractValue(LValue aggVal, unsigned index) { return buildExtractValue(m_builder, aggVal, index); }
246
    
247
    
248
    template<typename VectorType>
249
    LValue call(LValue function, const VectorType& vector) { return buildCall(m_builder, function, vector); }
247
    LValue call(LValue function) { return buildCall(m_builder, function); }
250
    LValue call(LValue function) { return buildCall(m_builder, function); }
248
    LValue call(LValue function, LValue arg1) { return buildCall(m_builder, function, arg1); }
251
    LValue call(LValue function, LValue arg1) { return buildCall(m_builder, function, arg1); }
249
    LValue call(LValue function, LValue arg1, LValue arg2) { return buildCall(m_builder, function, arg1, arg2); }
252
    LValue call(LValue function, LValue arg1, LValue arg2) { return buildCall(m_builder, function, arg1, arg2); }
250
    
253
    
254
    LValue convertToTailCall(LValue call)
255
    {
256
        setTailCall(call, IsTailCall);
257
        return call;
258
    }
259
    
251
    void jump(LBasicBlock destination) { buildBr(m_builder, destination); }
260
    void jump(LBasicBlock destination) { buildBr(m_builder, destination); }
252
    void branch(LValue condition, LBasicBlock taken, LBasicBlock notTaken) { buildCondBr(m_builder, condition, taken, notTaken); }
261
    void branch(LValue condition, LBasicBlock taken, LBasicBlock notTaken) { buildCondBr(m_builder, condition, taken, notTaken); }
253
    void ret(LValue value) { buildRet(m_builder, value); }
262
    void ret(LValue value) { buildRet(m_builder, value); }
- Source/JavaScriptCore/ftl/FTLState.h +2 lines
Lines 33-38 Source/JavaScriptCore/ftl/FTLState.h_sec1
33
#include "DFGGraph.h"
33
#include "DFGGraph.h"
34
#include "FTLAbbreviations.h"
34
#include "FTLAbbreviations.h"
35
#include "FTLJITCode.h"
35
#include "FTLJITCode.h"
36
#include "FTLOSRExitCompilationInfo.h"
36
#include <wtf/Noncopyable.h>
37
#include <wtf/Noncopyable.h>
37
38
38
namespace JSC { namespace FTL {
39
namespace JSC { namespace FTL {
Lines 49-54 public: Source/JavaScriptCore/ftl/FTLState.h_sec2
49
    LModule module;
50
    LModule module;
50
    LValue function;
51
    LValue function;
51
    RefPtr<JITCode> jitCode;
52
    RefPtr<JITCode> jitCode;
53
    Vector<OSRExitCompilationInfo> osrExit;
52
    
54
    
53
    void dumpState(const char* when);
55
    void dumpState(const char* when);
54
};
56
};
- Source/JavaScriptCore/ftl/FTLThunks.cpp +84 lines
Line 0 Source/JavaScriptCore/ftl/FTLThunks.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLThunks.h"
28
29
#if ENABLE(FTL_JIT)
30
31
#include "DFGGPRInfo.h"
32
#include "DFGFPRInfo.h"
33
#include "FTLOSRExitCompiler.h"
34
#include "LinkBuffer.h"
35
#include "MacroAssembler.h"
36
37
namespace JSC { namespace FTL {
38
39
using namespace DFG;
40
41
MacroAssemblerCodeRef osrExitGenerationThunkGenerator(JSGlobalData* globalData)
42
{
43
    MacroAssembler jit;
44
    
45
    size_t scratchSize = sizeof(EncodedJSValue) * (GPRInfo::numberOfArgumentRegisters + FPRInfo::numberOfArgumentRegisters);
46
    ScratchBuffer* scratchBuffer = globalData->scratchBufferForSize(scratchSize);
47
    EncodedJSValue* buffer = static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer());
48
    
49
    for (unsigned i = 0; i < GPRInfo::numberOfArgumentRegisters; ++i)
50
        jit.store64(GPRInfo::toArgumentRegister(i), buffer + i);
51
    for (unsigned i = 0; i < FPRInfo::numberOfArgumentRegisters; ++i) {
52
        jit.move(MacroAssembler::TrustedImmPtr(buffer + GPRInfo::numberOfArgumentRegisters + i), GPRInfo::nonArgGPR1);
53
        jit.storeDouble(FPRInfo::toArgumentRegister(i), GPRInfo::nonArgGPR1);
54
    }
55
    
56
    // Tell GC mark phase how much of the scratch buffer is active during call.
57
    jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), GPRInfo::nonArgGPR1);
58
    jit.storePtr(MacroAssembler::TrustedImmPtr(scratchSize), GPRInfo::nonArgGPR1);
59
60
    // argument 0 is already the call frame.
61
    jit.move(GPRInfo::nonArgGPR0, GPRInfo::argumentGPR1);
62
    MacroAssembler::Call functionCall = jit.call();
63
    
64
    jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), GPRInfo::nonPreservedNonReturnGPR);
65
    jit.storePtr(MacroAssembler::TrustedImmPtr(0), GPRInfo::nonPreservedNonReturnGPR);
66
    
67
    for (unsigned i = 0; i < FPRInfo::numberOfArgumentRegisters; ++i) {
68
        jit.move(MacroAssembler::TrustedImmPtr(buffer + GPRInfo::numberOfArgumentRegisters + i), GPRInfo::nonPreservedNonReturnGPR);
69
        jit.loadDouble(GPRInfo::nonPreservedNonReturnGPR, FPRInfo::toArgumentRegister(i));
70
    }
71
    for (unsigned i = 0; i < GPRInfo::numberOfArgumentRegisters; ++i)
72
        jit.load64(buffer + i, GPRInfo::toArgumentRegister(i));
73
    
74
    jit.jump(GPRInfo::returnValueGPR);
75
    
76
    LinkBuffer patchBuffer(*globalData, &jit, GLOBAL_THUNK_ID);
77
    patchBuffer.link(functionCall, compileFTLOSRExit);
78
    return FINALIZE_CODE(patchBuffer, ("FTL OSR exit generation thunk"));
79
}
80
81
} } // namespace JSC::FTL
82
83
#endif // ENABLE(FTL_JIT)
84
- Source/JavaScriptCore/ftl/FTLThunks.h +47 lines
Line 0 Source/JavaScriptCore/ftl/FTLThunks.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLThunks_h
27
#define FTLThunks_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "MacroAssemblerCodeRef.h"
34
35
namespace JSC {
36
37
class JSGlobalData;
38
39
namespace FTL {
40
41
MacroAssemblerCodeRef osrExitGenerationThunkGenerator(JSGlobalData*);
42
43
} } // namespace JSC::FTL
44
45
#endif // ENABLE(FTL_JIT)
46
47
#endif // FTLTHunks_h
- Source/JavaScriptCore/ftl/FTLValueFormat.cpp +64 lines
Line 0 Source/JavaScriptCore/ftl/FTLValueFormat.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLValueFormat.h"
28
29
#if ENABLE(FTL_JIT)
30
31
namespace WTF {
32
33
using namespace JSC::FTL;
34
35
void printInternal(PrintStream& out, ValueFormat format)
36
{
37
    switch (format) {
38
    case InvalidValueFormat:
39
        out.print("Invalid");
40
        return;
41
    case ValueFormatInt32:
42
        out.print("Int32");
43
        return;
44
    case ValueFormatUInt32:
45
        out.print("UInt32");
46
        return;
47
    case ValueFormatBoolean:
48
        out.print("Boolean");
49
        return;
50
    case ValueFormatJSValue:
51
        out.print("JSValue");
52
        return;
53
    case ValueFormatDouble:
54
        out.print("Double");
55
        return;
56
    }
57
    
58
    RELEASE_ASSERT_NOT_REACHED();
59
}
60
61
} // namespace WTF
62
63
#endif // ENABLE(FTL_JIT)
64
- Source/JavaScriptCore/ftl/FTLValueFormat.h +60 lines
Line 0 Source/JavaScriptCore/ftl/FTLValueFormat.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLValueFormat_h
27
#define FTLValueFormat_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include <wtf/PrintStream.h>
34
35
namespace JSC { namespace FTL {
36
37
// Note that this is awkwardly similar to DataFormat in other parts of JSC, except that
38
// unlike DataFormat and like ValueRecovery, it distinguishes between UInt32 and Int32.
39
40
enum ValueFormat {
41
    InvalidValueFormat,
42
    ValueFormatInt32,
43
    ValueFormatUInt32,
44
    ValueFormatBoolean,
45
    ValueFormatJSValue,
46
    ValueFormatDouble
47
};
48
49
} } // namespace JSC::FTL
50
51
namespace WTF {
52
53
void printInternal(PrintStream&, JSC::FTL::ValueFormat);
54
55
} // namespace WTF
56
57
#endif // ENABLE(FTL_JIT)
58
59
#endif // FTLValueFormat_h
60
- Source/JavaScriptCore/ftl/FTLValueSource.cpp +77 lines
Line 0 Source/JavaScriptCore/ftl/FTLValueSource.cpp_sec1
1
/*
2
 * Copyright (C) 2013 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 "FTLValueSource.h"
28
29
#if ENABLE(FTL_JIT)
30
31
namespace JSC { namespace FTL {
32
33
void ValueSource::dump(PrintStream& out) const
34
{
35
    switch (kind()) {
36
    case SourceNotSet:
37
        out.print("SourceNotSet");
38
        return;
39
    case ValueInJSStack:
40
        out.print("ValueInJSStack");
41
        return;
42
    case Int32InJSStack:
43
        out.print("Int32InJSStack");
44
        return;
45
    case DoubleInJSStack:
46
        out.print("DoubleInJSStack");
47
        return;
48
    case ValueInLocals:
49
        out.print("ValueInLocals");
50
        return;
51
    case Int32InLocals:
52
        out.print("Int32InLocals");
53
        return;
54
    case BooleanInLocals:
55
        out.print("BooleanInLocals");
56
        return;
57
    case DoubleInLocals:
58
        out.print("DoubleInLocals");
59
        return;
60
    case ArgumentsSource:
61
        out.print("ArgumentsSource");
62
        return;
63
    case SourceIsDead:
64
        out.print("SourceIsDead");
65
        return;
66
    case HaveNode:
67
        out.print("Node(", node(), ")");
68
        return;
69
    }
70
    
71
    RELEASE_ASSERT_NOT_REACHED();
72
}
73
74
} } // namespace JSC::FTL
75
76
#endif // ENABLE(FTL_JIT)
77
- Source/JavaScriptCore/ftl/FTLValueSource.h +96 lines
Line 0 Source/JavaScriptCore/ftl/FTLValueSource.h_sec1
1
/*
2
 * Copyright (C) 2013 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 FTLValueSource_h
27
#define FTLValueSource_h
28
29
#include <wtf/Platform.h>
30
31
#if ENABLE(FTL_JIT)
32
33
#include "DFGNode.h"
34
#include <wtf/PrintStream.h>
35
#include <wtf/StdLibExtras.h>
36
37
namespace JSC { namespace FTL {
38
39
enum ValueSourceKind {
40
    SourceNotSet,
41
    ValueInJSStack,
42
    Int32InJSStack,
43
    DoubleInJSStack,
44
    ValueInLocals,
45
    Int32InLocals,
46
    BooleanInLocals,
47
    DoubleInLocals,
48
    ArgumentsSource,
49
    SourceIsDead,
50
    HaveNode
51
};
52
53
class ValueSource {
54
public:
55
    ValueSource()
56
        : m_value(SourceNotSet)
57
    {
58
    }
59
    
60
    explicit ValueSource(ValueSourceKind kind)
61
        : m_value(kind)
62
    {
63
    }
64
    
65
    explicit ValueSource(DFG::Node* node)
66
        : m_value(bitwise_cast<uintptr_t>(node))
67
    {
68
    }
69
    
70
    ValueSourceKind kind() const
71
    {
72
        if (m_value < static_cast<uintptr_t>(HaveNode))
73
            return static_cast<ValueSourceKind>(m_value);
74
        return HaveNode;
75
    }
76
    
77
    bool operator!() const { return kind() != SourceNotSet; }
78
    
79
    DFG::Node* node() const
80
    {
81
        ASSERT(kind() == HaveNode);
82
        return bitwise_cast<DFG::Node*>(m_value);
83
    }
84
    
85
    void dump(PrintStream&) const;
86
87
private:
88
    uintptr_t m_value;
89
};
90
91
} } // namespace JSC::FTL
92
93
#endif // ENABLE(FTL_JIT)
94
95
#endif // FTLValueSource_h
96

Return to Bug 113623