blob: 987ca8ecff78e29bb6cd562a9f163a93e071b8ec [file] [log] [blame]
fpizlo@apple.com7aed8d82012-08-23 03:38:52 +000012012-08-22 Filip Pizlo <fpizlo@apple.com>
2
3 Array accesses should remember what kind of array they are predicted to access
4 https://bugs.webkit.org/show_bug.cgi?id=94448
5
6 Reviewed by Gavin Barraclough.
7
8 Introduced the notion of DFG::Array::Mode, stored in node.arrayMode(), which allows nodes
9 to remember how they decided to access arrays. This permits the bytecode parser to "lock in"
10 the mode of access if it has profiling at its disposal, and it also allows the prediction
11 propagator to do a fixup of the array mode later in the optimization fixpoint.
12
13 This patch adds a healthy amount of new capability (specifically the ability of the parser
14 to lock in an array mode regardless of type predictions) and it also blows away a lot of
15 messy code.
16
17 * CMakeLists.txt:
18 * GNUmakefile.list.am:
19 * JavaScriptCore.xcodeproj/project.pbxproj:
20 * Target.pri:
21 * dfg/DFGAbstractState.cpp:
22 (JSC::DFG::AbstractState::execute):
23 * dfg/DFGArgumentsSimplificationPhase.cpp:
24 (JSC::DFG::ArgumentsSimplificationPhase::run):
25 * dfg/DFGArrayMode.cpp: Added.
26 (DFG):
27 (JSC::DFG::fromObserved):
28 (JSC::DFG::refineArrayMode):
29 (JSC::DFG::modeAlreadyChecked):
30 (JSC::DFG::modeToString):
31 * dfg/DFGArrayMode.h: Added.
32 (DFG):
33 (JSC::DFG::canCSEStorage):
34 (JSC::DFG::modeForPut):
35 (JSC::DFG::modesCompatibleForStorageLoad):
36 (JSC::DFG::modeSupportsLength):
37 * dfg/DFGByteCodeParser.cpp:
38 (ByteCodeParser):
39 (JSC::DFG::ByteCodeParser::getArrayModeWithoutOSRExit):
40 (JSC::DFG::ByteCodeParser::getArrayMode):
41 (JSC::DFG::ByteCodeParser::handleIntrinsic):
42 (JSC::DFG::ByteCodeParser::parseBlock):
43 * dfg/DFGCSEPhase.cpp:
44 (JSC::DFG::CSEPhase::getByValLoadElimination):
45 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
46 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
47 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
48 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
49 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
50 (JSC::DFG::CSEPhase::performNodeCSE):
51 * dfg/DFGFixupPhase.cpp:
52 (JSC::DFG::FixupPhase::fixupNode):
53 * dfg/DFGGraph.cpp:
54 (JSC::DFG::Graph::dump):
55 * dfg/DFGGraph.h:
56 (JSC::DFG::Graph::byValIsPure):
57 (JSC::DFG::Graph::clobbersWorld):
58 * dfg/DFGNode.h:
59 (JSC::DFG::Node::hasArrayMode):
60 (Node):
61 (JSC::DFG::Node::arrayMode):
62 (JSC::DFG::Node::setArrayMode):
63 * dfg/DFGNodeType.h:
64 (DFG):
65 * dfg/DFGPredictionPropagationPhase.cpp:
66 (JSC::DFG::PredictionPropagationPhase::propagate):
67 * dfg/DFGSpeculativeJIT.cpp:
68 (JSC::DFG::SpeculativeJIT::typedArrayDescriptor):
69 (DFG):
70 (JSC::DFG::SpeculativeJIT::speculateArray):
71 (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
72 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
73 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
74 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
75 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
76 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
77 (JSC::DFG::SpeculativeJIT::compileGetArrayLength):
78 * dfg/DFGSpeculativeJIT.h:
79 (SpeculativeJIT):
80 * dfg/DFGSpeculativeJIT32_64.cpp:
81 (JSC::DFG::SpeculativeJIT::compile):
82 * dfg/DFGSpeculativeJIT64.cpp:
83 (JSC::DFG::SpeculativeJIT::compile):
84 * dfg/DFGStructureCheckHoistingPhase.cpp:
85 (JSC::DFG::StructureCheckHoistingPhase::run):
86
ggaren@apple.com93385a52012-08-23 01:33:25 +0000872012-08-22 Geoffrey Garen <ggaren@apple.com>
88
89 ThreadRestrictionVerifier should be opt-in, not opt-out
90 https://bugs.webkit.org/show_bug.cgi?id=94761
91
92 Reviewed by Mark Hahnenberg.
93
94 Removed explicit calls to disable the verifier, since it's off by default now.
95
96 * parser/SourceProvider.h:
97 (JSC::SourceProvider::SourceProvider):
98 (SourceProvider):
99 * runtime/SymbolTable.h:
100 (JSC::SharedSymbolTable::SharedSymbolTable):
101
mhahnenberg@apple.com20f21f32012-08-22 21:49:16 +00001022012-08-22 Mark Hahnenberg <mhahnenberg@apple.com>
103
104 Separate MarkStackThreadSharedData from MarkStack
105 https://bugs.webkit.org/show_bug.cgi?id=94294
106
107 Reviewed by Filip Pizlo.
108
109 MarkStackThreadSharedData is soon going to have data to allow for a parallel copying
110 mode too, so to separate our concerns we should split it out into its own set of files
111 and rename it to GCThreadSharedData. For now this is purely a cosmetic refactoring.
112
113 * CMakeLists.txt:
114 * GNUmakefile.list.am:
115 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
116 * JavaScriptCore.xcodeproj/project.pbxproj:
117 * Target.pri:
118 * heap/GCThreadSharedData.cpp: Added.
119 (JSC):
120 (JSC::GCThreadSharedData::resetChildren):
121 (JSC::GCThreadSharedData::childVisitCount):
122 (JSC::GCThreadSharedData::markingThreadMain):
123 (JSC::GCThreadSharedData::markingThreadStartFunc):
124 (JSC::GCThreadSharedData::GCThreadSharedData):
125 (JSC::GCThreadSharedData::~GCThreadSharedData):
126 (JSC::GCThreadSharedData::reset):
127 * heap/GCThreadSharedData.h: Added.
128 (JSC):
129 (GCThreadSharedData):
130 * heap/Heap.h:
131 (Heap):
132 * heap/ListableHandler.h:
133 (ListableHandler):
134 * heap/MarkStack.cpp:
135 (JSC::MarkStack::MarkStack):
136 (JSC::MarkStack::~MarkStack):
137 * heap/MarkStack.h:
138 (JSC):
139 (MarkStack):
140 (JSC::MarkStack::sharedData):
141 * heap/MarkStackInlineMethods.h: Added.
142 (JSC):
143 (JSC::MarkStack::append):
144 (JSC::MarkStack::appendUnbarrieredPointer):
145 (JSC::MarkStack::appendUnbarrieredValue):
146 (JSC::MarkStack::internalAppend):
147 (JSC::MarkStack::addWeakReferenceHarvester):
148 (JSC::MarkStack::addUnconditionalFinalizer):
149 (JSC::MarkStack::addOpaqueRoot):
150 (JSC::MarkStack::containsOpaqueRoot):
151 (JSC::MarkStack::opaqueRootCount):
152 * heap/SlotVisitor.h:
153 (JSC):
154 (SlotVisitor):
155 (JSC::SlotVisitor::SlotVisitor):
156
commit-queue@webkit.orgaba7ac32012-08-22 13:12:17 +00001572012-08-22 Gabor Ballabas <gaborb@inf.u-szeged.hu>
158
159 Fix JSC build when DFG-JIT is disabled
160 https://bugs.webkit.org/show_bug.cgi?id=94694
161
162 Reviewed by Csaba Osztrogonác.
163
164 Adding an appropriate guard for fixing the build.
165
166 * bytecode/ResolveGlobalStatus.cpp:
167 (JSC):
168
commit-queue@webkit.orga22c4cd2012-08-22 00:11:20 +00001692012-08-21 Mark Lam <mark.lam@apple.com>
170
171 Introducing the VMInspector for VM debugging use.
172 https://bugs.webkit.org/show_bug.cgi?id=94613.
173
174 Reviewed by Filip Pizlo.
175
176 Adding some utility functions for debugging the VM. This code is
177 presently #ifdef'd out by default.
178
179 * CMakeLists.txt:
180 * GNUmakefile.list.am:
181 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
182 * JavaScriptCore.xcodeproj/project.pbxproj:
183 * interpreter/CallFrame.h:
184 (ExecState):
185 * interpreter/VMInspector.cpp: Added.
186 (JSC):
187 (JSC::VMInspector::getTypeName):
188 (JSC::VMInspector::dumpFrame0):
189 (JSC::VMInspector::dumpFrame):
190 (JSC::VMInspector::countFrames):
191 * interpreter/VMInspector.h: Added.
192 (JSC):
193 (VMInspector):
194
fpizlo@apple.com0712be82012-08-21 23:30:19 +00001952012-08-21 Filip Pizlo <fpizlo@apple.com>
196
197 A patchable GetById right after a watchpoint should have the appropriate nop padding
198 https://bugs.webkit.org/show_bug.cgi?id=94635
199
200 Reviewed by Mark Hahnenberg.
201
202 * assembler/AbstractMacroAssembler.h:
203 (JSC::AbstractMacroAssembler::padBeforePatch):
204 (AbstractMacroAssembler):
205 * assembler/MacroAssemblerARMv7.h:
206 (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
207 (JSC::MacroAssemblerARMv7::moveWithPatch):
208 (JSC::MacroAssemblerARMv7::patchableJump):
209 * assembler/MacroAssemblerX86.h:
210 (JSC::MacroAssemblerX86::moveWithPatch):
211 (JSC::MacroAssemblerX86::branchPtrWithPatch):
212 (JSC::MacroAssemblerX86::storePtrWithPatch):
213 * assembler/MacroAssemblerX86Common.h:
214 (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
215 (JSC::MacroAssemblerX86Common::load32WithCompactAddressOffsetPatch):
216 (JSC::MacroAssemblerX86Common::loadCompactWithAddressOffsetPatch):
217 (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
218 * assembler/MacroAssemblerX86_64.h:
219 (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
220 (JSC::MacroAssemblerX86_64::loadPtrWithCompactAddressOffsetPatch):
221 (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
222 (JSC::MacroAssemblerX86_64::moveWithPatch):
223 * jit/JumpReplacementWatchpoint.cpp:
224 (JSC::JumpReplacementWatchpoint::fireInternal):
225
commit-queue@webkit.orgf76b9d52012-08-20 23:48:00 +00002262012-08-20 Mark Lam <mark.lam@apple.com>
227
commit-queue@webkit.orge4c94fa2012-08-21 03:52:40 +0000228 Fix broken non-JIT build.
229 https://bugs.webkit.org/show_bug.cgi?id=94564.
230
231 Reviewed by Filip Pizlo.
232
233 Added some UNUSED_PARAM() macros to make the compiler happy.
234
235 * runtime/Executable.cpp:
236 (JSC::EvalExecutable::compileInternal):
237 (JSC::ProgramExecutable::compileInternal):
238 (JSC::FunctionExecutable::compileForCallInternal):
239 (JSC::FunctionExecutable::compileForConstructInternal):
240
2412012-08-20 Mark Lam <mark.lam@apple.com>
242
commit-queue@webkit.orgf76b9d52012-08-20 23:48:00 +0000243 Fixed erroneous line number for LLint frame when throwing exceptions.
244 https://bugs.webkit.org/show_bug.cgi?id=94051.
245
246 Reviewed by Filip Pizlo.
247
248 For LLInt frames, before throwing an exception, adjust the PC from the
249 return PC back to the call PC if we are indeed at a call site.
250
251 * bytecode/CodeBlock.cpp:
252 (JSC::CodeBlock::adjustPCIfAtCallSite):
253 (JSC):
254 (JSC::CodeBlock::bytecodeOffset):
255 * bytecode/CodeBlock.h:
256 (CodeBlock):
257 * llint/LLIntExceptions.cpp:
258 (JSC::LLInt::fixupPCforExceptionIfNeeded):
259 (LLInt):
260 (JSC::LLInt::interpreterThrowInCaller):
261 (JSC::LLInt::returnToThrow):
262 (JSC::LLInt::callToThrow):
263
fpizlo@apple.comb5e71412012-08-20 22:32:18 +00002642012-08-20 Filip Pizlo <fpizlo@apple.com>
265
fpizlo@apple.com9c330da2012-08-20 22:41:06 +0000266 fast/js/dfg-peephole-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html on 32-bit
267 https://bugs.webkit.org/show_bug.cgi?id=94538
268
269 Reviewed by Mark Hahnenberg.
270
271 * dfg/DFGSpeculativeJIT32_64.cpp:
272 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
273
2742012-08-20 Filip Pizlo <fpizlo@apple.com>
275
fpizlo@apple.comb5e71412012-08-20 22:32:18 +0000276 fast/js/dfg-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html crashes on 32-bit
277 https://bugs.webkit.org/show_bug.cgi?id=94026
278
279 Reviewed by Mark Hahnenberg.
280
281 * dfg/DFGSpeculativeJIT32_64.cpp:
282 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
283
fpizlo@apple.comeb3323d2012-08-20 06:11:24 +00002842012-08-19 Filip Pizlo <fpizlo@apple.com>
285
286 The relationship between abstract values and structure transition watchpoints should be rationalized
287 https://bugs.webkit.org/show_bug.cgi?id=94205
288
289 Reviewed by Geoffrey Garen.
290
291 This patch does a number of things related to the handling of the abstract values
292 arrising from values with structures known to be watchpointable:
293
294 - This rationalizes the relationship between the structure that we know an object
295 to have *right now* based on having executed a check against that structure, and
296 the structure that we know the object could have *in the future* based on a type
297 check executed in the past over a structure that was watchpointable.
298
299 - We use the above to assert that structure transition watchpoints are being used
300 soundly.
301
302 - We use the above to strength reduce CheckStructure into StructureTransitionWatchpoint
303 whenever possible.
304
305 - This rationalizes the handling of CFA over constants that appeared in the bytecode.
306 If at compile-time the constant has a watchpointable structure, then we can prove
307 what structures it may have in the future. The analysis uses this to both assert
308 that structure transition watchpoints are being used correctly, and to find
309 opportunities for using them more aggressively.
310
311 The net effect of all of these changes is that OSR entry should work more smoothly.
312 It may also be a slight win due to strength reductions, though most of those strength
313 reductions would have already been done by the parser and the structure check hoister.
314
315 * GNUmakefile.list.am:
316 * JavaScriptCore.xcodeproj/project.pbxproj:
317 * dfg/DFGAbstractState.cpp:
318 (JSC::DFG::AbstractState::beginBasicBlock):
319 (JSC::DFG::AbstractState::execute):
320 * dfg/DFGAbstractValue.h:
321 (DFG):
322 (JSC::DFG::AbstractValue::clear):
323 (JSC::DFG::AbstractValue::isClear):
324 (JSC::DFG::AbstractValue::makeTop):
325 (JSC::DFG::AbstractValue::clobberStructures):
326 (JSC::DFG::AbstractValue::isTop):
327 (JSC::DFG::AbstractValue::setFuturePossibleStructure):
328 (AbstractValue):
329 (JSC::DFG::AbstractValue::filterFuturePossibleStructure):
330 (JSC::DFG::AbstractValue::setMostSpecific):
331 (JSC::DFG::AbstractValue::set):
332 (JSC::DFG::AbstractValue::operator==):
333 (JSC::DFG::AbstractValue::merge):
334 (JSC::DFG::AbstractValue::filter):
335 (JSC::DFG::AbstractValue::filterValueByType):
336 (JSC::DFG::AbstractValue::validateType):
337 (JSC::DFG::AbstractValue::validate):
338 (JSC::DFG::AbstractValue::checkConsistency):
339 (JSC::DFG::AbstractValue::dump):
340 * dfg/DFGArgumentsSimplificationPhase.cpp:
341 (JSC::DFG::ArgumentsSimplificationPhase::run):
342 * dfg/DFGCSEPhase.cpp:
343 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
344 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
345 (JSC::DFG::CSEPhase::performNodeCSE):
346 * dfg/DFGConstantFoldingPhase.cpp:
347 (JSC::DFG::ConstantFoldingPhase::foldConstants):
348 * dfg/DFGNode.h:
349 (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
350 (Node):
351 (JSC::DFG::Node::hasStructure):
352 * dfg/DFGNodeType.h:
353 (DFG):
354 * dfg/DFGOSREntry.cpp:
355 (JSC::DFG::prepareOSREntry):
356 * dfg/DFGPredictionPropagationPhase.cpp:
357 (JSC::DFG::PredictionPropagationPhase::propagate):
358 * dfg/DFGSpeculativeJIT.cpp:
359 (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
360 (JSC::DFG::SpeculativeJIT::forwardSpeculationWatchpoint):
361 (DFG):
362 (JSC::DFG::SpeculativeJIT::speculationWatchpointWithConditionalDirection):
363 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
364 (JSC::DFG::SpeculativeJIT::speculateArray):
365 * dfg/DFGSpeculativeJIT.h:
366 (SpeculativeJIT):
367 * dfg/DFGSpeculativeJIT32_64.cpp:
368 (JSC::DFG::SpeculativeJIT::compile):
369 * dfg/DFGSpeculativeJIT64.cpp:
370 (JSC::DFG::SpeculativeJIT::compile):
371 * dfg/DFGStructureAbstractValue.h: Added.
372 (DFG):
373 (StructureAbstractValue):
374 (JSC::DFG::StructureAbstractValue::StructureAbstractValue):
375 (JSC::DFG::StructureAbstractValue::clear):
376 (JSC::DFG::StructureAbstractValue::makeTop):
377 (JSC::DFG::StructureAbstractValue::top):
378 (JSC::DFG::StructureAbstractValue::add):
379 (JSC::DFG::StructureAbstractValue::addAll):
380 (JSC::DFG::StructureAbstractValue::contains):
381 (JSC::DFG::StructureAbstractValue::isSubsetOf):
382 (JSC::DFG::StructureAbstractValue::doesNotContainAnyOtherThan):
383 (JSC::DFG::StructureAbstractValue::isSupersetOf):
384 (JSC::DFG::StructureAbstractValue::filter):
385 (JSC::DFG::StructureAbstractValue::isClear):
386 (JSC::DFG::StructureAbstractValue::isTop):
387 (JSC::DFG::StructureAbstractValue::isClearOrTop):
388 (JSC::DFG::StructureAbstractValue::isNeitherClearNorTop):
389 (JSC::DFG::StructureAbstractValue::size):
390 (JSC::DFG::StructureAbstractValue::at):
391 (JSC::DFG::StructureAbstractValue::operator[]):
392 (JSC::DFG::StructureAbstractValue::last):
393 (JSC::DFG::StructureAbstractValue::speculationFromStructures):
394 (JSC::DFG::StructureAbstractValue::hasSingleton):
395 (JSC::DFG::StructureAbstractValue::singleton):
396 (JSC::DFG::StructureAbstractValue::operator==):
397 (JSC::DFG::StructureAbstractValue::dump):
398 (JSC::DFG::StructureAbstractValue::topValue):
399 * dfg/DFGStructureCheckHoistingPhase.cpp:
400 (JSC::DFG::StructureCheckHoistingPhase::run):
401
fpizlo@apple.com6a23c422012-08-18 00:48:38 +00004022012-08-17 Filip Pizlo <fpizlo@apple.com>
403
fpizlo@apple.com0fd7ec92012-08-19 21:59:12 +0000404 The current state of the call frame should be taken into account in the DFG for both predictions and proofs
405 https://bugs.webkit.org/show_bug.cgi?id=94412
406
407 Reviewed by Geoffrey Garen.
408
409 This ensures that no matter how smart the DFG gets, it'll always know through
410 which entrypoint OSR will try to enter, and with which values it will attempt
411 to do so. For prologue OSR, this has no effect other than adding the current
412 arguments to the argument predictions. For loop OSR, this makes our treatment
413 of the loop slightly more conservative - just conservative enough to ensure
414 that OSR succeeds.
415
416 * bytecode/CodeBlock.cpp:
417 (JSC::ProgramCodeBlock::compileOptimized):
418 (JSC::EvalCodeBlock::compileOptimized):
419 (JSC::FunctionCodeBlock::compileOptimized):
420 * bytecode/CodeBlock.h:
421 (CodeBlock):
422 (ProgramCodeBlock):
423 (EvalCodeBlock):
424 (FunctionCodeBlock):
425 * dfg/DFGAbstractState.cpp:
426 (JSC::DFG::AbstractState::initialize):
427 * dfg/DFGAbstractValue.h:
428 (JSC::DFG::AbstractValue::setMostSpecific):
429 (AbstractValue):
430 * dfg/DFGByteCodeParser.cpp:
431 (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
432 (JSC::DFG::ByteCodeParser::parse):
433 * dfg/DFGDriver.cpp:
434 (JSC::DFG::compile):
435 (JSC::DFG::tryCompile):
436 (JSC::DFG::tryCompileFunction):
437 * dfg/DFGDriver.h:
438 (DFG):
439 (JSC::DFG::tryCompile):
440 (JSC::DFG::tryCompileFunction):
441 * dfg/DFGGraph.h:
442 (JSC::DFG::Graph::Graph):
443 (Graph):
444 * jit/JITDriver.h:
445 (JSC::jitCompileIfAppropriate):
446 (JSC::jitCompileFunctionIfAppropriate):
447 * jit/JITStubs.cpp:
448 (JSC::DEFINE_STUB_FUNCTION):
449 * runtime/Executable.cpp:
450 (JSC::EvalExecutable::compileOptimized):
451 (JSC::EvalExecutable::compileInternal):
452 (JSC::ProgramExecutable::compileOptimized):
453 (JSC::ProgramExecutable::compileInternal):
454 (JSC::FunctionExecutable::compileOptimizedForCall):
455 (JSC::FunctionExecutable::compileOptimizedForConstruct):
456 (JSC::FunctionExecutable::compileForCallInternal):
457 (JSC::FunctionExecutable::compileForConstructInternal):
458 * runtime/Executable.h:
459 (EvalExecutable):
460 (ProgramExecutable):
461 (FunctionExecutable):
462 (JSC::FunctionExecutable::compileOptimizedFor):
463 * runtime/ExecutionHarness.h:
464 (JSC::prepareForExecution):
465 (JSC::prepareFunctionForExecution):
466
4672012-08-17 Filip Pizlo <fpizlo@apple.com>
468
fpizlo@apple.comd5d9bae2012-08-18 06:01:33 +0000469 DFG CSE should be more honest about when it changed the IR
470 https://bugs.webkit.org/show_bug.cgi?id=94408
471
472 Reviewed by Geoffrey Garen.
473
474 The CSE phase now always returns true if it changed the IR.
475
476 * dfg/DFGCSEPhase.cpp:
477 (JSC::DFG::CSEPhase::setReplacement):
478 (JSC::DFG::CSEPhase::eliminate):
479 (JSC::DFG::CSEPhase::performNodeCSE):
480
4812012-08-17 Filip Pizlo <fpizlo@apple.com>
482
fpizlo@apple.com6a23c422012-08-18 00:48:38 +0000483 DFG is still too pessimistic about what constitutes a side-effect on array accesses
484 https://bugs.webkit.org/show_bug.cgi?id=94309
485
486 Reviewed by Geoffrey Garen.
487
488 This change means that even if structure transition watchpoints are not used for
489 hoisting of clobbered structure checks, we still retain good performance on the
490 benchmarks we care about. That's important, since butterflies will likely make
491 most array structures not watchpointable.
492
493 * dfg/DFGAbstractState.cpp:
494 (JSC::DFG::AbstractState::execute):
495 * dfg/DFGStructureCheckHoistingPhase.cpp:
496 (JSC::DFG::StructureCheckHoistingPhase::run):
497
commit-queue@webkit.orgb421708a2012-08-17 14:16:23 +00004982012-08-17 Milian Wolff <milian.wolff@kdab.com>
499
500 [Qt] QNX build fails due to ctype usage in system headers
501 https://bugs.webkit.org/show_bug.cgi?id=93849
502
503 Reviewed by Simon Hausmann.
504
505 Move the check for whether DisallowCType should be active or not
506 to the DisallowCType.h header. This way, we can update the list
507 of platforms or OSes which do not work with this header in a
508 central place. All users can now safely include the header
509 and do not need to place custom guards around it.
510
511 * config.h:
512
hausmann@webkit.orgd1aebfb2012-08-17 09:42:31 +00005132012-08-16 Simon Hausmann <simon.hausmann@nokia.com>
514
515 [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
516 https://bugs.webkit.org/show_bug.cgi?id=93872
517
518 Reviewed by Kenneth Rohde Christiansen.
519
520 * Target.pri: Add missing JSWeakObjectMap file to build.
521
fpizlo@apple.comff86f062012-08-16 20:35:12 +00005222012-08-16 Filip Pizlo <fpizlo@apple.com>
523
fpizlo@apple.com00673b32012-08-16 23:17:24 +0000524 Structure check hoisting should be less expensive
525 https://bugs.webkit.org/show_bug.cgi?id=94201
526
527 Reviewed by Mark Hahnenberg.
528
529 This appears like a broad win on short-running programs.
530
531 * dfg/DFGArgumentsSimplificationPhase.cpp:
532 (JSC::DFG::ArgumentsSimplificationPhase::run):
533 * dfg/DFGCSEPhase.cpp:
534 (JSC::DFG::CSEPhase::performNodeCSE):
535 * dfg/DFGDriver.cpp:
536 (JSC::DFG::compile):
537 * dfg/DFGGraph.h:
538 (JSC::DFG::Graph::compareAndSwap):
539 (Graph):
540 (JSC::DFG::Graph::substitute):
541 (JSC::DFG::Graph::substituteGetLocal):
542 * dfg/DFGStructureCheckHoistingPhase.cpp:
543 (JSC::DFG::StructureCheckHoistingPhase::run):
544
5452012-08-16 Filip Pizlo <fpizlo@apple.com>
546
fpizlo@apple.comff86f062012-08-16 20:35:12 +0000547 All op_resolve_global instructions should end up in the list of global resolve instructions
548 https://bugs.webkit.org/show_bug.cgi?id=94247
549 <rdar://problem/12103500>
550
551 Reviewed by Mark Hahnenberg.
552
553 * bytecompiler/BytecodeGenerator.cpp:
554 (JSC::BytecodeGenerator::emitResolveWithBase):
555
commit-queue@webkit.orgb0d27632012-08-15 22:31:26 +00005562012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
557
558 [css3-text] Add CSS3 Text decoration compile flag
559 https://bugs.webkit.org/show_bug.cgi?id=93863
560
561 Reviewed by Julien Chaffraix.
562
563 This patch handles the compile flag implementation, which will come disabled by
564 default, thus not exposing the CSS3 text decoration features to the web, unless
565 when explicitly enabling it with "--css3-text-decoration" build parameter.
566
567 * Configurations/FeatureDefines.xcconfig:
568
commit-queue@webkit.org45974062012-08-15 21:35:55 +00005692012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
570
571 Unreviewed, rolling out r125687.
572 http://trac.webkit.org/changeset/125687
573 https://bugs.webkit.org/show_bug.cgi?id=94147
574
575 It broke the whole world (Requested by Ossy_night on #webkit).
576
577 * API/JSValueRef.cpp:
578 (JSValueToBoolean):
579 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
580 * bytecode/Watchpoint.h:
581 (WatchpointSet):
582 * debugger/DebuggerCallFrame.h:
583 * dfg/DFGAbstractState.cpp:
584 (JSC::DFG::AbstractState::execute):
585 * dfg/DFGCFGSimplificationPhase.cpp:
586 (JSC::DFG::CFGSimplificationPhase::run):
587 * dfg/DFGOperations.cpp:
588 * dfg/DFGOperations.h:
589 * dfg/DFGSpeculativeJIT32_64.cpp:
590 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
591 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
592 (JSC::DFG::SpeculativeJIT::compile):
593 * dfg/DFGSpeculativeJIT64.cpp:
594 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
595 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
596 (JSC::DFG::SpeculativeJIT::compile):
597 * interpreter/Interpreter.cpp:
598 (JSC::Interpreter::privateExecute):
599 * jit/JITOpcodes.cpp:
600 (JSC::JIT::emit_op_is_undefined):
601 (JSC::JIT::emit_op_jeq_null):
602 (JSC::JIT::emit_op_jneq_null):
603 (JSC::JIT::emit_op_eq_null):
604 (JSC::JIT::emit_op_neq_null):
605 * jit/JITOpcodes32_64.cpp:
606 (JSC::JIT::emit_op_is_undefined):
607 (JSC::JIT::emit_op_jeq_null):
608 (JSC::JIT::emit_op_jneq_null):
609 (JSC::JIT::emit_op_eq_null):
610 (JSC::JIT::emit_op_neq_null):
611 * jit/JITStubs.cpp:
612 (JSC::DEFINE_STUB_FUNCTION):
613 * llint/LLIntSlowPaths.cpp:
614 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
615 * llint/LowLevelInterpreter32_64.asm:
616 * llint/LowLevelInterpreter64.asm:
617 * runtime/ArrayPrototype.cpp:
618 (JSC::arrayProtoFuncFilter):
619 (JSC::arrayProtoFuncEvery):
620 (JSC::arrayProtoFuncSome):
621 * runtime/BooleanConstructor.cpp:
622 (JSC::constructBoolean):
623 (JSC::callBooleanConstructor):
624 * runtime/JSCell.h:
625 (JSCell):
626 * runtime/JSGlobalObject.cpp:
627 (JSC::JSGlobalObject::JSGlobalObject):
628 * runtime/JSGlobalObject.h:
629 (JSGlobalObject):
630 * runtime/JSString.h:
631 (JSC::JSCell::toBoolean):
632 (JSC::JSValue::toBoolean):
633 * runtime/JSValue.h:
634 * runtime/ObjectConstructor.cpp:
635 (JSC::toPropertyDescriptor):
636 * runtime/Operations.cpp:
637 (JSC::jsTypeStringForValue):
638 (JSC::jsIsObjectType):
639 * runtime/Operations.h:
640 (JSC):
641 (JSC::JSValue::equalSlowCaseInline):
642 * runtime/RegExpConstructor.cpp:
643 (JSC::setRegExpConstructorMultiline):
644 * runtime/RegExpPrototype.cpp:
645 (JSC::regExpProtoFuncToString):
646 * runtime/Structure.h:
647
commit-queue@webkit.orgb6cc1852012-08-15 21:09:00 +00006482012-08-15 Gabor Ballabas <gaborb@inf.u-szeged.hu>
649
650 Buildfix after r125541
651 https://bugs.webkit.org/show_bug.cgi?id=94097
652
653 Reviewed by Filip Pizlo.
654
655 r125541 has broken the traditional ARM port build of JSC.
656
657 * assembler/MacroAssemblerARM.h:
658 (JSC::MacroAssemblerARM::neg32):
659 (JSC::MacroAssemblerARM::xor32):
660
mhahnenberg@apple.com35d54552012-08-15 18:32:41 +00006612012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
662
663 Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
664 https://bugs.webkit.org/show_bug.cgi?id=93884
665
666 Reviewed by Geoffrey Garen.
667
668 With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
669 MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
670 we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
671 objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
672 For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
673 masquerade as undefined within frame B, but it will continue to masquerade in frame A.
674
675 There are two primary changes that are taking place here. One is to thread the ExecState* through
676 JSValue::toBoolean and JSCell::toBoolean so that JSCell::toBoolean can check the object's
677 JSGlobalObject to compare it to the lexical JSGlobalObject of the currently running code. If the two
678 are distinct, then the object cannot MasqueradeAsUndefined.
679
680 The other change is to perform this comparison of JSGlobalObjects everywhere where the MasqueradesAsUndefined
681 flag in the Structure is checked. For C++ code, this check has been factored into its own function in
682 Structure::masqueradesAsUndefined. We only perform this check in the DFG if the current JSGlobalObject has
683 had a MasqueradesAsUndefined object allocated within its context. This conditional compilation is managed
684 through the use of a WatchpointSet in each JSGlobalObject and alternate create() functions for JS DOM wrappers
685 that are MasqueradesAsUndefined.
686
687 * API/JSValueRef.cpp:
688 (JSValueToBoolean):
689 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
690 * bytecode/Watchpoint.h:
691 (WatchpointSet):
692 * debugger/DebuggerCallFrame.h:
693 (JSC::DebuggerCallFrame::callFrame):
694 * dfg/DFGAbstractState.cpp:
695 (JSC::DFG::AbstractState::execute):
696 * dfg/DFGCFGSimplificationPhase.cpp:
697 (JSC::DFG::CFGSimplificationPhase::run):
698 * dfg/DFGOperations.cpp:
699 * dfg/DFGOperations.h:
700 * dfg/DFGSpeculativeJIT32_64.cpp:
701 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
702 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
703 (JSC::DFG::SpeculativeJIT::compile):
704 * dfg/DFGSpeculativeJIT64.cpp:
705 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
706 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
707 (JSC::DFG::SpeculativeJIT::compile):
708 * interpreter/Interpreter.cpp:
709 (JSC::Interpreter::privateExecute):
710 * jit/JITOpcodes.cpp:
711 (JSC::JIT::emit_op_is_undefined):
712 (JSC::JIT::emit_op_jeq_null):
713 (JSC::JIT::emit_op_jneq_null):
714 (JSC::JIT::emit_op_eq_null):
715 (JSC::JIT::emit_op_neq_null):
716 * jit/JITOpcodes32_64.cpp:
717 (JSC::JIT::emit_op_is_undefined):
718 (JSC::JIT::emit_op_jeq_null):
719 (JSC::JIT::emit_op_jneq_null):
720 (JSC::JIT::emit_op_eq_null):
721 (JSC::JIT::emit_op_neq_null):
722 * jit/JITStubs.cpp:
723 (JSC::DEFINE_STUB_FUNCTION):
724 * llint/LLIntSlowPaths.cpp:
725 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
726 * llint/LowLevelInterpreter32_64.asm:
727 * llint/LowLevelInterpreter64.asm:
728 * runtime/ArrayPrototype.cpp:
729 (JSC::arrayProtoFuncFilter):
730 (JSC::arrayProtoFuncEvery):
731 (JSC::arrayProtoFuncSome):
732 * runtime/BooleanConstructor.cpp:
733 (JSC::constructBoolean):
734 (JSC::callBooleanConstructor):
735 * runtime/JSCell.h:
736 (JSCell):
737 * runtime/JSGlobalObject.cpp:
738 (JSC::JSGlobalObject::JSGlobalObject):
739 * runtime/JSGlobalObject.h:
740 (JSGlobalObject):
741 (JSC::JSGlobalObject::masqueradesAsUndefinedWatchpoint):
742 * runtime/JSString.h:
743 (JSC::JSCell::toBoolean):
744 (JSC::JSValue::toBoolean):
745 * runtime/JSValue.h:
746 * runtime/ObjectConstructor.cpp:
747 (JSC::toPropertyDescriptor):
748 * runtime/Operations.cpp:
749 (JSC::jsTypeStringForValue):
750 (JSC::jsIsObjectType):
751 * runtime/Operations.h:
752 (JSC):
753 (JSC::JSValue::equalSlowCaseInline):
754 * runtime/RegExpConstructor.cpp:
755 (JSC::setRegExpConstructorMultiline):
756 * runtime/RegExpPrototype.cpp:
757 (JSC::regExpProtoFuncToString):
758 * runtime/Structure.h:
759 (Structure):
760 (JSC::Structure::globalObjectOffset):
761 (JSC::Structure::masqueradesAsUndefined):
762 (JSC):
763
fpizlo@apple.coma0c9a0a2012-08-15 03:10:57 +00007642012-08-14 Filip Pizlo <fpizlo@apple.com>
765
766 Unreviewed, build fix for !ENABLE(DFG_JIT)
767
768 * jit/JITPropertyAccess.cpp:
769 (JSC::JIT::emit_op_get_by_val):
770 (JSC::JIT::emit_op_put_by_val):
771 (JSC::JIT::privateCompilePatchGetArrayLength):
772 * jit/JITPropertyAccess32_64.cpp:
773 (JSC::JIT::emit_op_get_by_val):
774 (JSC::JIT::emit_op_put_by_val):
775 (JSC::JIT::privateCompilePatchGetArrayLength):
776 * llint/LowLevelInterpreter32_64.asm:
777 * llint/LowLevelInterpreter64.asm:
778
fpizlo@apple.comf24804c2012-08-15 02:48:35 +00007792012-08-13 Filip Pizlo <fpizlo@apple.com>
780
781 Array checks should use the structure, not the class info
782 https://bugs.webkit.org/show_bug.cgi?id=93150
783
784 Reviewed by Mark Hahnenberg.
785
786 This changes all array checks used in array accesses (get, put, get length,
787 push, pop) to use the structure, not the class info. Additionally, these
788 checks in the LLInt and baseline JIT record the structure in an ArrayProfile,
789 so that the DFG can know exactly what structure to check for.
790
791 * CMakeLists.txt:
792 * GNUmakefile.list.am:
793 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
794 * JavaScriptCore.xcodeproj/project.pbxproj:
795 * Target.pri:
796 * bytecode/ArrayProfile.cpp: Added.
797 (JSC):
798 (JSC::ArrayProfile::computeUpdatedPrediction):
799 * bytecode/ArrayProfile.h: Added.
800 (JSC):
801 (JSC::arrayModeFromStructure):
802 (ArrayProfile):
803 (JSC::ArrayProfile::ArrayProfile):
804 (JSC::ArrayProfile::bytecodeOffset):
805 (JSC::ArrayProfile::addressOfLastSeenStructure):
806 (JSC::ArrayProfile::observeStructure):
807 (JSC::ArrayProfile::expectedStructure):
808 (JSC::ArrayProfile::structureIsPolymorphic):
809 (JSC::ArrayProfile::hasDefiniteStructure):
810 (JSC::ArrayProfile::observedArrayModes):
811 * bytecode/CodeBlock.cpp:
812 (JSC::CodeBlock::dump):
813 (JSC::CodeBlock::getArrayProfile):
814 (JSC):
815 (JSC::CodeBlock::getOrAddArrayProfile):
816 (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
817 * bytecode/CodeBlock.h:
818 (JSC::CodeBlock::executionEntryCount):
819 (JSC::CodeBlock::numberOfArrayProfiles):
820 (JSC::CodeBlock::arrayProfiles):
821 (JSC::CodeBlock::addArrayProfile):
822 (CodeBlock):
823 * bytecode/Instruction.h:
824 (JSC):
825 (JSC::Instruction::Instruction):
826 * bytecode/Opcode.h:
827 (JSC):
828 (JSC::padOpcodeName):
829 * bytecompiler/BytecodeGenerator.cpp:
830 (JSC::BytecodeGenerator::emitGetArgumentByVal):
831 (JSC::BytecodeGenerator::emitGetByVal):
832 (JSC::BytecodeGenerator::emitPutByVal):
833 * dfg/DFGAbstractState.cpp:
834 (JSC::DFG::AbstractState::initialize):
835 (JSC::DFG::AbstractState::execute):
836 * dfg/DFGAbstractValue.h:
837 (JSC::DFG::StructureAbstractValue::hasSingleton):
838 (StructureAbstractValue):
839 (JSC::DFG::StructureAbstractValue::singleton):
840 * dfg/DFGArgumentsSimplificationPhase.cpp:
841 (JSC::DFG::ArgumentsSimplificationPhase::run):
842 * dfg/DFGByteCodeParser.cpp:
843 (JSC::DFG::ByteCodeParser::parseBlock):
844 * dfg/DFGFixupPhase.cpp:
845 (JSC::DFG::FixupPhase::fixupNode):
846 * dfg/DFGSpeculativeJIT.cpp:
847 (JSC::DFG::SpeculativeJIT::speculateArray):
848 (DFG):
849 (JSC::DFG::SpeculativeJIT::compile):
850 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
851 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
852 * dfg/DFGSpeculativeJIT.h:
853 (SpeculativeJIT):
854 * dfg/DFGSpeculativeJIT32_64.cpp:
855 (JSC::DFG::SpeculativeJIT::compile):
856 * dfg/DFGSpeculativeJIT64.cpp:
857 (JSC::DFG::SpeculativeJIT::compile):
858 * dfg/DFGStructureCheckHoistingPhase.cpp:
859 (JSC::DFG::StructureCheckHoistingPhase::run):
860 * jit/JITPropertyAccess.cpp:
861 (JSC::JIT::emit_op_get_by_val):
862 (JSC::JIT::emit_op_put_by_val):
863 (JSC::JIT::privateCompilePatchGetArrayLength):
864 * jit/JITPropertyAccess32_64.cpp:
865 (JSC::JIT::emit_op_get_by_val):
866 (JSC::JIT::emit_op_put_by_val):
867 (JSC::JIT::privateCompilePatchGetArrayLength):
868 * llint/LLIntOffsetsExtractor.cpp:
869 * llint/LowLevelInterpreter32_64.asm:
870 * llint/LowLevelInterpreter64.asm:
871 * runtime/Structure.h:
872 (Structure):
873 (JSC::Structure::classInfoOffset):
874
commit-queue@webkit.orgb1409632012-08-14 11:28:25 +00008752012-08-14 Gabor Ballabas <gaborb@inf.u-szeged.hu>
876
877 Rename functions in the ARM port of DFG-JIT for better code readability.
878 https://bugs.webkit.org/show_bug.cgi?id=93609
879
880 Reviewed by Zoltan Herczeg.
881
882 Rename functions in the ARM port of DFG-JIT for better code
883 readability, and for following the WebKit coding style
884 wherever it is possible.
885
886 * assembler/ARMAssembler.cpp:
887 (JSC::ARMAssembler::genInt):
888 (JSC::ARMAssembler::getImm):
889 (JSC::ARMAssembler::moveImm):
890 (JSC::ARMAssembler::encodeComplexImm):
891 (JSC::ARMAssembler::dataTransfer32):
892 (JSC::ARMAssembler::baseIndexTransfer32):
893 (JSC::ARMAssembler::dataTransfer16):
894 (JSC::ARMAssembler::baseIndexTransfer16):
895 (JSC::ARMAssembler::dataTransferFloat):
896 (JSC::ARMAssembler::baseIndexTransferFloat):
897 * assembler/ARMAssembler.h:
898 (JSC::ARMAssembler::bitAnd):
899 (JSC::ARMAssembler::bitAnds):
900 (JSC::ARMAssembler::eor):
901 (JSC::ARMAssembler::eors):
902 (JSC::ARMAssembler::sub):
903 (JSC::ARMAssembler::subs):
904 (JSC::ARMAssembler::rsb):
905 (JSC::ARMAssembler::rsbs):
906 (JSC::ARMAssembler::add):
907 (JSC::ARMAssembler::adds):
908 (JSC::ARMAssembler::adc):
909 (JSC::ARMAssembler::adcs):
910 (JSC::ARMAssembler::sbc):
911 (JSC::ARMAssembler::sbcs):
912 (JSC::ARMAssembler::rsc):
913 (JSC::ARMAssembler::rscs):
914 (JSC::ARMAssembler::tst):
915 (JSC::ARMAssembler::teq):
916 (JSC::ARMAssembler::cmp):
917 (JSC::ARMAssembler::cmn):
918 (JSC::ARMAssembler::orr):
919 (JSC::ARMAssembler::orrs):
920 (JSC::ARMAssembler::mov):
921 (JSC::ARMAssembler::movw):
922 (JSC::ARMAssembler::movt):
923 (JSC::ARMAssembler::movs):
924 (JSC::ARMAssembler::bic):
925 (JSC::ARMAssembler::bics):
926 (JSC::ARMAssembler::mvn):
927 (JSC::ARMAssembler::mvns):
928 (JSC::ARMAssembler::mul):
929 (JSC::ARMAssembler::muls):
930 (JSC::ARMAssembler::mull):
931 (JSC::ARMAssembler::vmov_f64):
932 (JSC::ARMAssembler::vadd_f64):
933 (JSC::ARMAssembler::vdiv_f64):
934 (JSC::ARMAssembler::vsub_f64):
935 (JSC::ARMAssembler::vmul_f64):
936 (JSC::ARMAssembler::vcmp_f64):
937 (JSC::ARMAssembler::vsqrt_f64):
938 (JSC::ARMAssembler::vabs_f64):
939 (JSC::ARMAssembler::vneg_f64):
940 (JSC::ARMAssembler::ldrImmediate):
941 (JSC::ARMAssembler::ldrUniqueImmediate):
942 (JSC::ARMAssembler::dtrUp):
943 (JSC::ARMAssembler::dtrUpRegister):
944 (JSC::ARMAssembler::dtrDown):
945 (JSC::ARMAssembler::dtrDownRegister):
946 (JSC::ARMAssembler::halfDtrUp):
947 (JSC::ARMAssembler::halfDtrUpRegister):
948 (JSC::ARMAssembler::halfDtrDown):
949 (JSC::ARMAssembler::halfDtrDownRegister):
950 (JSC::ARMAssembler::doubleDtrUp):
951 (JSC::ARMAssembler::doubleDtrDown):
952 (JSC::ARMAssembler::push):
953 (JSC::ARMAssembler::pop):
954 (JSC::ARMAssembler::poke):
955 (JSC::ARMAssembler::peek):
956 (JSC::ARMAssembler::vmov_vfp64):
957 (JSC::ARMAssembler::vmov_arm64):
958 (JSC::ARMAssembler::vmov_vfp32):
959 (JSC::ARMAssembler::vmov_arm32):
960 (JSC::ARMAssembler::vcvt_f64_s32):
961 (JSC::ARMAssembler::vcvt_s32_f64):
962 (JSC::ARMAssembler::vcvt_u32_f64):
963 (JSC::ARMAssembler::vcvt_f64_f32):
964 (JSC::ARMAssembler::vcvt_f32_f64):
965 (JSC::ARMAssembler::clz):
966 (JSC::ARMAssembler::lslRegister):
967 (JSC::ARMAssembler::lsrRegister):
968 (JSC::ARMAssembler::asrRegister):
969 (JSC::ARMAssembler::align):
970 (JSC::ARMAssembler::loadBranchTarget):
971 (JSC::ARMAssembler::vmov):
972 * assembler/MacroAssemblerARM.cpp:
973 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
974 * assembler/MacroAssemblerARM.h:
975 (JSC::MacroAssemblerARM::add32):
976 (JSC::MacroAssemblerARM::and32):
977 (JSC::MacroAssemblerARM::lshift32):
978 (JSC::MacroAssemblerARM::mul32):
979 (JSC::MacroAssemblerARM::or32):
980 (JSC::MacroAssemblerARM::rshift32):
981 (JSC::MacroAssemblerARM::urshift32):
982 (JSC::MacroAssemblerARM::sub32):
983 (JSC::MacroAssemblerARM::xor32):
984 (JSC::MacroAssemblerARM::countLeadingZeros32):
985 (JSC::MacroAssemblerARM::convertibleLoadPtr):
986 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
987 (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
988 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
989 (JSC::MacroAssemblerARM::store32):
990 (JSC::MacroAssemblerARM::pop):
991 (JSC::MacroAssemblerARM::push):
992 (JSC::MacroAssemblerARM::move):
993 (JSC::MacroAssemblerARM::swap):
994 (JSC::MacroAssemblerARM::branch32):
995 (JSC::MacroAssemblerARM::branchTest32):
996 (JSC::MacroAssemblerARM::mull32):
997 (JSC::MacroAssemblerARM::branchSub32):
998 (JSC::MacroAssemblerARM::compare32):
999 (JSC::MacroAssemblerARM::test32):
1000 (JSC::MacroAssemblerARM::load32):
1001 (JSC::MacroAssemblerARM::relativeTableJump):
1002 (JSC::MacroAssemblerARM::moveWithPatch):
1003 (JSC::MacroAssemblerARM::loadDouble):
1004 (JSC::MacroAssemblerARM::moveDouble):
1005 (JSC::MacroAssemblerARM::addDouble):
1006 (JSC::MacroAssemblerARM::divDouble):
1007 (JSC::MacroAssemblerARM::subDouble):
1008 (JSC::MacroAssemblerARM::mulDouble):
1009 (JSC::MacroAssemblerARM::sqrtDouble):
1010 (JSC::MacroAssemblerARM::absDouble):
1011 (JSC::MacroAssemblerARM::negateDouble):
1012 (JSC::MacroAssemblerARM::convertInt32ToDouble):
1013 (JSC::MacroAssemblerARM::convertFloatToDouble):
1014 (JSC::MacroAssemblerARM::convertDoubleToFloat):
1015 (JSC::MacroAssemblerARM::branchDouble):
1016 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
1017 (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
1018 (JSC::MacroAssemblerARM::truncateDoubleToInt32):
1019 (JSC::MacroAssemblerARM::truncateDoubleToUint32):
1020 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
1021 (JSC::MacroAssemblerARM::branchDoubleNonZero):
1022 (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
1023
hausmann@webkit.orge9a69542012-08-13 20:44:33 +000010242012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
1025
hausmann@webkit.org029be3e2012-08-13 21:37:19 +00001026 Unreviewed, rolling out r125444.
1027 http://trac.webkit.org/changeset/125444
1028 https://bugs.webkit.org/show_bug.cgi?id=93872
1029
1030 Broke some tests
1031
1032 * Target.pri:
1033
10342012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
1035
hausmann@webkit.orge9a69542012-08-13 20:44:33 +00001036 [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
1037 https://bugs.webkit.org/show_bug.cgi?id=93872
1038
1039 Reviewed by Kenneth Rohde Christiansen.
1040
1041 * Target.pri: Add missing JSWeakObjectMap file to build.
1042
rakuco@webkit.org56218832012-08-13 20:38:06 +000010432012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
1044
1045 [CMake] Remove glib-related Find modules and write single new one instead.
1046 https://bugs.webkit.org/show_bug.cgi?id=93786
1047
1048 Reviewed by Rob Buis.
1049
1050 * shell/PlatformEfl.cmake: Use GLIB_* instead of Glib_*.
1051
allan.jensen@nokia.com3c6f1522012-08-12 11:47:34 +000010522012-08-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
1053
1054 Doesn't build with ENABLE_JIT=0
1055 https://bugs.webkit.org/show_bug.cgi?id=85042
1056
1057 Reviewed by Eric Seidel.
1058
1059 Include headers without which CallFrame.h does not build, and
1060 fix gcc warning about comparing unsigned int with 0.
1061
1062 * dfg/DFGDriver.cpp:
1063 * interpreter/Interpreter.cpp:
1064 (JSC::Interpreter::isOpcode):
1065
commit-queue@webkit.org2d9f0782012-08-10 16:21:25 +000010662012-08-10 Yong Li <yoli@rim.com>
1067
1068 [BlackBerry] GCActivityCallback should always schedule GC even allocated bytes is a small number
1069 https://bugs.webkit.org/show_bug.cgi?id=93650
1070
1071 Reviewed by Rob Buis.
1072
1073 Even a small number of allocated JS objects could hold expensive resources.
1074
1075 * runtime/GCActivityCallbackBlackBerry.cpp:
1076 (JSC::DefaultGCActivityCallback::didAllocate):
1077
commit-queue@webkit.orgb849db72012-08-09 20:38:56 +000010782012-08-09 Yong Li <yoli@rim.com>
1079
1080 [QNX] Implement getCPUTime() for OS(QNX)
1081 https://bugs.webkit.org/show_bug.cgi?id=93516
1082
1083 Reviewed by George Staikos.
1084
1085 Implement getCPUTime() with CLOCK_THREAD_CPUTIME_ID so it will tell
1086 exactly how long the current thread has spent without being impacted
1087 by other things.
1088
1089 * runtime/TimeoutChecker.cpp:
1090 (JSC::getCPUTime):
1091
commit-queue@webkit.org656e6522012-08-09 02:29:35 +000010922012-08-08 Shane Stephens <shanestephens@google.com>
1093
1094 Compile flag for CSS Hierarchies
1095 https://bugs.webkit.org/show_bug.cgi?id=92433
1096
1097 Reviewed by Tony Chang.
1098
1099 * Configurations/FeatureDefines.xcconfig:
1100
benjamin@webkit.org58ac4792012-08-09 01:29:44 +000011012012-08-08 Benjamin Poulain <bpoulain@apple.com>
1102
1103 Use char* instead of LChar* for the public interface of String construction from literals
1104 https://bugs.webkit.org/show_bug.cgi?id=93402
1105
1106 Reviewed by Michael Saboff.
1107
1108 Update JSC' Identifier to use StringImpl::createFromLiteral with a char*.
1109
1110 * runtime/Identifier.cpp:
1111 (JSC::IdentifierASCIIStringTranslator::translate):
1112
paroga@webkit.orgcb73ac52012-08-08 07:31:12 +000011132012-08-08 Patrick Gansterer <paroga@webkit.org>
1114
paroga@webkit.org34230a82012-08-08 10:43:48 +00001115 Remove ce_time.(cpp|h) from list of source files
1116 https://bugs.webkit.org/show_bug.cgi?id=93446
1117
1118 Reviewed by Simon Hausmann.
1119
1120 r125004 removed the last dependency on functions defined in ce_time.cpp.
1121
1122 * Target.pri:
1123
11242012-08-08 Patrick Gansterer <paroga@webkit.org>
1125
paroga@webkit.orgcb73ac52012-08-08 07:31:12 +00001126 [WIN] Use GetTimeZoneInformation() for getting the timezone name
1127 https://bugs.webkit.org/show_bug.cgi?id=91936
1128
1129 Reviewed by Ryosuke Niwa.
1130
1131 The MS CRT implementation of strftime calls the same functions in the background.
1132 Using them directly avoids the overhead of parsing the format string and removes
1133 the dependency on strftime() for WinCE where this function does not exist.
1134
1135 * runtime/DateConversion.cpp:
1136 (JSC::formatTime):
1137
commit-queue@webkit.org3dfe8ce2012-08-07 22:55:04 +000011382012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
1139
1140 Refactor magic numbers in the ARM port of DFG-JIT
1141 https://bugs.webkit.org/show_bug.cgi?id=93348
1142
1143 Reviewed by Eric Seidel.
1144
1145 Introduce new names for hard-coded magic numbers.
1146 Refactor constant with confusing names to more descriptive ones.
1147
1148 * assembler/ARMAssembler.cpp:
1149 (JSC::ARMAssembler::patchConstantPoolLoad):
1150 (JSC::ARMAssembler::getOp2):
1151 (JSC::ARMAssembler::genInt):
1152 (JSC::ARMAssembler::getImm):
1153 (JSC::ARMAssembler::moveImm):
1154 (JSC::ARMAssembler::encodeComplexImm):
1155 (JSC::ARMAssembler::dataTransfer32):
1156 (JSC::ARMAssembler::dataTransfer16):
1157 (JSC::ARMAssembler::dataTransferFloat):
1158 (JSC::ARMAssembler::executableCopy):
1159 * assembler/ARMAssembler.h:
1160 (JSC::ARMAssembler::emitInstruction):
1161 (JSC::ARMAssembler::ands_r):
1162 (JSC::ARMAssembler::eors_r):
1163 (JSC::ARMAssembler::subs_r):
1164 (JSC::ARMAssembler::rsbs_r):
1165 (JSC::ARMAssembler::adds_r):
1166 (JSC::ARMAssembler::adcs_r):
1167 (JSC::ARMAssembler::sbcs_r):
1168 (JSC::ARMAssembler::rscs_r):
1169 (JSC::ARMAssembler::tst_r):
1170 (JSC::ARMAssembler::teq_r):
1171 (JSC::ARMAssembler::cmp_r):
1172 (JSC::ARMAssembler::cmn_r):
1173 (JSC::ARMAssembler::orrs_r):
1174 (JSC::ARMAssembler::movs_r):
1175 (JSC::ARMAssembler::bics_r):
1176 (JSC::ARMAssembler::mvns_r):
1177 (JSC::ARMAssembler::muls_r):
1178 (JSC::ARMAssembler::ldr_imm):
1179 (JSC::ARMAssembler::ldr_un_imm):
1180 (JSC::ARMAssembler::dtr_u):
1181 (JSC::ARMAssembler::dtr_ur):
1182 (JSC::ARMAssembler::dtr_dr):
1183 (JSC::ARMAssembler::dtrh_u):
1184 (JSC::ARMAssembler::dtrh_ur):
1185 (JSC::ARMAssembler::fdtr_u):
1186 (JSC::ARMAssembler::push_r):
1187 (JSC::ARMAssembler::pop_r):
1188 (JSC::ARMAssembler::getLdrImmAddress):
1189 (JSC::ARMAssembler::getLdrImmAddressOnPool):
1190 (JSC::ARMAssembler::patchConstantPoolLoad):
1191 (JSC::ARMAssembler::repatchCompact):
1192 (JSC::ARMAssembler::replaceWithJump):
1193 (JSC::ARMAssembler::replaceWithLoad):
1194 (JSC::ARMAssembler::replaceWithAddressComputation):
1195 (JSC::ARMAssembler::getOp2Byte):
1196 (JSC::ARMAssembler::getOp2Half):
1197 (JSC::ARMAssembler::getImm16Op2):
1198 (JSC::ARMAssembler::placeConstantPoolBarrier):
1199 (JSC::ARMAssembler::getConditionalField):
1200 * assembler/MacroAssemblerARM.cpp:
1201 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
1202 * assembler/MacroAssemblerARM.h:
1203 (JSC::MacroAssemblerARM::and32):
1204 (JSC::MacroAssemblerARM::branch32):
1205 (JSC::MacroAssemblerARM::branchTest32):
1206 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
1207
benjamin@webkit.orgd02c5572012-08-07 21:46:07 +000012082012-08-07 Benjamin Poulain <benjamin@webkit.org>
1209
1210 Use the initialization from literal for JSC's Identifiers
1211 https://bugs.webkit.org/show_bug.cgi?id=93193
1212
1213 Reviewed by Geoffrey Garen.
1214
1215 This patches modify Identifier ot take advantage of the new initialization from literal.
1216
1217 In addition to the memory savings (~600bytes per instance), this gives us a 2% speed
1218 improvement on CommonIdentifiers on average.
1219
1220 * runtime/CommonIdentifiers.cpp:
1221 (JSC::CommonIdentifiers::CommonIdentifiers):
1222 Null and empty strings are forbidden for literal initialization. Use the most efficient constructors
1223 instead of a literal.
1224
1225 * runtime/Identifier.cpp:
1226 (IdentifierASCIIStringTranslator):
1227 Rename IdentifierCStringTranslator to IdentifierASCIIStringTranslator to make the text encoding
1228 explicit.
1229 (JSC::IdentifierASCIIStringTranslator::hash):
1230 (JSC::IdentifierASCIIStringTranslator::equal):
1231 (JSC::IdentifierASCIIStringTranslator::translate): Use the fast initialization from literal.
1232 (JSC::Identifier::add):
1233 * runtime/Identifier.h:
1234 (JSC::Identifier::Identifier):
1235
hausmann@webkit.orga0580522012-08-07 09:24:21 +000012362012-08-07 Simon Hausmann <simon.hausmann@nokia.com>
1237
1238 [Qt][Win] Remove pthreads linkage
1239
1240 Reviewed by Csaba Osztrogonác.
1241
1242 After r124823 linkage to pthreads is not needed anymore for the Windows
1243 build.
1244
1245 * JavaScriptCore.pri:
1246
commit-queue@webkit.org6c4f9272012-08-07 08:50:43 +000012472012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
1248
1249 Refactor emit*Inst functions and introduce toARMWord functions in DFG-JIT's traditional ARM port
1250 https://bugs.webkit.org/show_bug.cgi?id=93266
1251
1252 Reviewed by Csaba Osztrogonác.
1253
1254 First part of a bigger refactoring issue trying to make traditional
1255 ARM DFG-JIT port easier to read and understand.
1256
1257
1258 * assembler/ARMAssembler.h:
1259 (JSC::ARMAssembler::emitInstruction):
1260 (JSC::ARMAssembler::emitDoublePrecisionInstruction):
1261 (JSC::ARMAssembler::emitSinglePrecisionInstruction):
1262 (JSC::ARMAssembler::and_r):
1263 (JSC::ARMAssembler::ands_r):
1264 (JSC::ARMAssembler::eor_r):
1265 (JSC::ARMAssembler::eors_r):
1266 (JSC::ARMAssembler::sub_r):
1267 (JSC::ARMAssembler::subs_r):
1268 (JSC::ARMAssembler::rsb_r):
1269 (JSC::ARMAssembler::rsbs_r):
1270 (JSC::ARMAssembler::add_r):
1271 (JSC::ARMAssembler::adds_r):
1272 (JSC::ARMAssembler::adc_r):
1273 (JSC::ARMAssembler::adcs_r):
1274 (JSC::ARMAssembler::sbc_r):
1275 (JSC::ARMAssembler::sbcs_r):
1276 (JSC::ARMAssembler::rsc_r):
1277 (JSC::ARMAssembler::rscs_r):
1278 (JSC::ARMAssembler::tst_r):
1279 (JSC::ARMAssembler::teq_r):
1280 (JSC::ARMAssembler::cmp_r):
1281 (JSC::ARMAssembler::cmn_r):
1282 (JSC::ARMAssembler::orr_r):
1283 (JSC::ARMAssembler::orrs_r):
1284 (JSC::ARMAssembler::mov_r):
1285 (JSC::ARMAssembler::movw_r):
1286 (JSC::ARMAssembler::movt_r):
1287 (JSC::ARMAssembler::movs_r):
1288 (JSC::ARMAssembler::bic_r):
1289 (JSC::ARMAssembler::bics_r):
1290 (JSC::ARMAssembler::mvn_r):
1291 (JSC::ARMAssembler::mvns_r):
1292 (JSC::ARMAssembler::mul_r):
1293 (JSC::ARMAssembler::muls_r):
1294 (JSC::ARMAssembler::mull_r):
1295 (JSC::ARMAssembler::vmov_f64_r):
1296 (JSC::ARMAssembler::vadd_f64_r):
1297 (JSC::ARMAssembler::vdiv_f64_r):
1298 (JSC::ARMAssembler::vsub_f64_r):
1299 (JSC::ARMAssembler::vmul_f64_r):
1300 (JSC::ARMAssembler::vcmp_f64_r):
1301 (JSC::ARMAssembler::vsqrt_f64_r):
1302 (JSC::ARMAssembler::vabs_f64_r):
1303 (JSC::ARMAssembler::vneg_f64_r):
1304 (JSC::ARMAssembler::ldr_imm):
1305 (JSC::ARMAssembler::ldr_un_imm):
1306 (JSC::ARMAssembler::dtr_u):
1307 (JSC::ARMAssembler::dtr_ur):
1308 (JSC::ARMAssembler::dtr_d):
1309 (JSC::ARMAssembler::dtr_dr):
1310 (JSC::ARMAssembler::dtrh_u):
1311 (JSC::ARMAssembler::dtrh_ur):
1312 (JSC::ARMAssembler::dtrh_d):
1313 (JSC::ARMAssembler::dtrh_dr):
1314 (JSC::ARMAssembler::fdtr_u):
1315 (JSC::ARMAssembler::fdtr_d):
1316 (JSC::ARMAssembler::push_r):
1317 (JSC::ARMAssembler::pop_r):
1318 (JSC::ARMAssembler::vmov_vfp64_r):
1319 (JSC::ARMAssembler::vmov_arm64_r):
1320 (JSC::ARMAssembler::vmov_vfp32_r):
1321 (JSC::ARMAssembler::vmov_arm32_r):
1322 (JSC::ARMAssembler::vcvt_f64_s32_r):
1323 (JSC::ARMAssembler::vcvt_s32_f64_r):
1324 (JSC::ARMAssembler::vcvt_u32_f64_r):
1325 (JSC::ARMAssembler::vcvt_f64_f32_r):
1326 (JSC::ARMAssembler::vcvt_f32_f64_r):
1327 (JSC::ARMAssembler::vmrs_apsr):
1328 (JSC::ARMAssembler::clz_r):
1329 (JSC::ARMAssembler::bx):
1330 (JSC::ARMAssembler::blx):
1331 (JSC::ARMAssembler::linkJump):
1332 (JSC::ARMAssembler::toARMWord):
1333 (ARMAssembler):
1334
paroga@webkit.orgf5643b92012-08-06 23:46:11 +000013352012-08-06 Patrick Gansterer <paroga@webkit.org>
1336
paroga@webkit.org156fc552012-08-07 00:29:14 +00001337 [WIN] Remove dependency on pthread from MachineStackMarker
1338 https://bugs.webkit.org/show_bug.cgi?id=68429
1339
1340 Reviewed by Geoffrey Garen.
1341
1342 Windows has no support for calling a destructor for thread specific data.
1343 Since we need more control over creating and deleting thread specific keys
1344 we can not simply extend WTF::ThreadSpecific with this functionality.
1345
1346 All thread specific keys created via the new API get stored in a list.
1347 After a thread function finished we iterate over this list and call
1348 the registered destructor for every item if needed.
1349
1350 * heap/MachineStackMarker.cpp: Use the new functions instead of pthread directly.
1351 (JSC::MachineThreads::~MachineThreads):
1352 (JSC::MachineThreads::makeUsableFromMultipleThreads):
1353 (JSC::MachineThreads::addCurrentThread):
1354 * heap/MachineStackMarker.h:
1355 (MachineThreads):
1356
13572012-08-06 Patrick Gansterer <paroga@webkit.org>
1358
paroga@webkit.orgf5643b92012-08-06 23:46:11 +00001359 Unify JSC date and time formating functions
1360 https://bugs.webkit.org/show_bug.cgi?id=92282
1361
1362 Reviewed by Geoffrey Garen.
1363
1364 Replace the existing functions for formating GregorianDateTime
1365 with one single function. This removes some code duplications
1366 in DatePrototype and is a preperation to fix encoding issues,
1367 since we can add UChar* values to the resulting string now.
1368
1369 * runtime/DateConstructor.cpp:
1370 (JSC::callDate):
1371 * runtime/DateConversion.cpp:
1372 (JSC::formatDateTime):
1373 * runtime/DateConversion.h:
1374 (JSC):
1375 * runtime/DatePrototype.cpp:
1376 (JSC::formateDateInstance):
1377 (JSC::dateProtoFuncToString):
1378 (JSC::dateProtoFuncToUTCString):
1379 (JSC::dateProtoFuncToDateString):
1380 (JSC::dateProtoFuncToTimeString):
1381 (JSC::dateProtoFuncToGMTString):
1382
carlosgc@webkit.orga6cd87d2012-08-06 12:35:28 +000013832012-08-06 Carlos Garcia Campos <cgarcia@igalia.com>
1384
1385 Unreviewed. Fix make distcheck.
1386
1387 * GNUmakefile.list.am: Add missing header file.
1388
commit-queue@webkit.org1b331cb2012-08-06 03:16:46 +000013892012-08-05 Peter Wang <peter.wang@torchmobile.com.cn>
1390
1391 Web Inspector: [JSC] implement setting breakpoints by line:column
1392 https://bugs.webkit.org/show_bug.cgi?id=53003
1393
1394 Reviewed by Geoffrey Garen.
1395
1396 Add a counter to Lexer to record the column info of each Token. Add a column parameter to
1397 op_debug, cti_op_debug, and _llint_op_debug byte-code command.
1398
1399 * bytecode/CodeBlock.cpp:
1400 (JSC::CodeBlock::dump):
1401 * bytecode/Opcode.h:
1402 (JSC):
1403 (JSC::padOpcodeName):
1404 * bytecompiler/BytecodeGenerator.cpp:
1405 (JSC::BytecodeGenerator::resolve):
1406 (JSC::BytecodeGenerator::emitDebugHook):
1407 * bytecompiler/BytecodeGenerator.h:
1408 (BytecodeGenerator):
1409 * bytecompiler/NodesCodegen.cpp:
1410 (JSC::ArrayNode::toArgumentList):
1411 (JSC::ApplyFunctionCallDotNode::emitBytecode):
1412 (JSC::ConstStatementNode::emitBytecode):
1413 (JSC::EmptyStatementNode::emitBytecode):
1414 (JSC::DebuggerStatementNode::emitBytecode):
1415 (JSC::ExprStatementNode::emitBytecode):
1416 (JSC::VarStatementNode::emitBytecode):
1417 (JSC::IfNode::emitBytecode):
1418 (JSC::IfElseNode::emitBytecode):
1419 (JSC::DoWhileNode::emitBytecode):
1420 (JSC::WhileNode::emitBytecode):
1421 (JSC::ForNode::emitBytecode):
1422 (JSC::ForInNode::emitBytecode):
1423 (JSC::ContinueNode::emitBytecode):
1424 (JSC::BreakNode::emitBytecode):
1425 (JSC::ReturnNode::emitBytecode):
1426 (JSC::WithNode::emitBytecode):
1427 (JSC::SwitchNode::emitBytecode):
1428 (JSC::LabelNode::emitBytecode):
1429 (JSC::ThrowNode::emitBytecode):
1430 (JSC::TryNode::emitBytecode):
1431 (JSC::ProgramNode::emitBytecode):
1432 (JSC::EvalNode::emitBytecode):
1433 (JSC::FunctionBodyNode::emitBytecode):
1434 * debugger/Debugger.h:
1435 * interpreter/Interpreter.cpp:
1436 (JSC::Interpreter::unwindCallFrame):
1437 (JSC::Interpreter::throwException):
1438 (JSC::Interpreter::debug):
1439 (JSC::Interpreter::privateExecute):
1440 * interpreter/Interpreter.h:
1441 (Interpreter):
1442 * jit/JITOpcodes.cpp:
1443 (JSC::JIT::emit_op_debug):
1444 * jit/JITOpcodes32_64.cpp:
1445 (JSC::JIT::emit_op_debug):
1446 * jit/JITStubs.cpp:
1447 (JSC::DEFINE_STUB_FUNCTION):
1448 * llint/LLIntSlowPaths.cpp:
1449 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1450 * llint/LowLevelInterpreter.asm:
1451 * parser/ASTBuilder.h:
1452 (ASTBuilder):
1453 (JSC::ASTBuilder::createCommaExpr):
1454 (JSC::ASTBuilder::createLogicalNot):
1455 (JSC::ASTBuilder::createUnaryPlus):
1456 (JSC::ASTBuilder::createVoid):
1457 (JSC::ASTBuilder::thisExpr):
1458 (JSC::ASTBuilder::createResolve):
1459 (JSC::ASTBuilder::createObjectLiteral):
1460 (JSC::ASTBuilder::createArray):
1461 (JSC::ASTBuilder::createNumberExpr):
1462 (JSC::ASTBuilder::createString):
1463 (JSC::ASTBuilder::createBoolean):
1464 (JSC::ASTBuilder::createNull):
1465 (JSC::ASTBuilder::createBracketAccess):
1466 (JSC::ASTBuilder::createDotAccess):
1467 (JSC::ASTBuilder::createRegExp):
1468 (JSC::ASTBuilder::createNewExpr):
1469 (JSC::ASTBuilder::createConditionalExpr):
1470 (JSC::ASTBuilder::createAssignResolve):
1471 (JSC::ASTBuilder::createFunctionExpr):
1472 (JSC::ASTBuilder::createFunctionBody):
1473 (JSC::ASTBuilder::createGetterOrSetterProperty):
1474 (JSC::ASTBuilder::createArgumentsList):
1475 (JSC::ASTBuilder::createPropertyList):
1476 (JSC::ASTBuilder::createFuncDeclStatement):
1477 (JSC::ASTBuilder::createBlockStatement):
1478 (JSC::ASTBuilder::createExprStatement):
1479 (JSC::ASTBuilder::createIfStatement):
1480 (JSC::ASTBuilder::createForLoop):
1481 (JSC::ASTBuilder::createForInLoop):
1482 (JSC::ASTBuilder::createEmptyStatement):
1483 (JSC::ASTBuilder::createVarStatement):
1484 (JSC::ASTBuilder::createReturnStatement):
1485 (JSC::ASTBuilder::createBreakStatement):
1486 (JSC::ASTBuilder::createContinueStatement):
1487 (JSC::ASTBuilder::createTryStatement):
1488 (JSC::ASTBuilder::createSwitchStatement):
1489 (JSC::ASTBuilder::createWhileStatement):
1490 (JSC::ASTBuilder::createDoWhileStatement):
1491 (JSC::ASTBuilder::createLabelStatement):
1492 (JSC::ASTBuilder::createWithStatement):
1493 (JSC::ASTBuilder::createThrowStatement):
1494 (JSC::ASTBuilder::createDebugger):
1495 (JSC::ASTBuilder::createConstStatement):
1496 (JSC::ASTBuilder::appendConstDecl):
1497 (JSC::ASTBuilder::combineCommaNodes):
1498 (JSC::ASTBuilder::appendBinaryOperation):
1499 (JSC::ASTBuilder::createAssignment):
1500 (JSC::ASTBuilder::createNumber):
1501 (JSC::ASTBuilder::makeTypeOfNode):
1502 (JSC::ASTBuilder::makeDeleteNode):
1503 (JSC::ASTBuilder::makeNegateNode):
1504 (JSC::ASTBuilder::makeBitwiseNotNode):
1505 (JSC::ASTBuilder::makeMultNode):
1506 (JSC::ASTBuilder::makeDivNode):
1507 (JSC::ASTBuilder::makeModNode):
1508 (JSC::ASTBuilder::makeAddNode):
1509 (JSC::ASTBuilder::makeSubNode):
1510 (JSC::ASTBuilder::makeLeftShiftNode):
1511 (JSC::ASTBuilder::makeRightShiftNode):
1512 (JSC::ASTBuilder::makeURightShiftNode):
1513 (JSC::ASTBuilder::makeBitOrNode):
1514 (JSC::ASTBuilder::makeBitAndNode):
1515 (JSC::ASTBuilder::makeBitXOrNode):
1516 (JSC::ASTBuilder::makeFunctionCallNode):
1517 (JSC::ASTBuilder::makeBinaryNode):
1518 (JSC::ASTBuilder::makeAssignNode):
1519 (JSC::ASTBuilder::makePrefixNode):
1520 (JSC::ASTBuilder::makePostfixNode):
1521 * parser/Lexer.cpp:
1522 (JSC::::setCode):
1523 (JSC::::internalShift):
1524 (JSC::::shift):
1525 (JSC::::lex):
1526 * parser/Lexer.h:
1527 (Lexer):
1528 (JSC::Lexer::currentColumnNumber):
1529 (JSC::::lexExpectIdentifier):
1530 * parser/NodeConstructors.h:
1531 (JSC::Node::Node):
1532 (JSC::ExpressionNode::ExpressionNode):
1533 (JSC::StatementNode::StatementNode):
1534 (JSC::NullNode::NullNode):
1535 (JSC::BooleanNode::BooleanNode):
1536 (JSC::NumberNode::NumberNode):
1537 (JSC::StringNode::StringNode):
1538 (JSC::RegExpNode::RegExpNode):
1539 (JSC::ThisNode::ThisNode):
1540 (JSC::ResolveNode::ResolveNode):
1541 (JSC::ArrayNode::ArrayNode):
1542 (JSC::PropertyListNode::PropertyListNode):
1543 (JSC::ObjectLiteralNode::ObjectLiteralNode):
1544 (JSC::BracketAccessorNode::BracketAccessorNode):
1545 (JSC::DotAccessorNode::DotAccessorNode):
1546 (JSC::ArgumentListNode::ArgumentListNode):
1547 (JSC::NewExprNode::NewExprNode):
1548 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
1549 (JSC::FunctionCallValueNode::FunctionCallValueNode):
1550 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
1551 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
1552 (JSC::FunctionCallDotNode::FunctionCallDotNode):
1553 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
1554 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
1555 (JSC::PrePostResolveNode::PrePostResolveNode):
1556 (JSC::PostfixResolveNode::PostfixResolveNode):
1557 (JSC::PostfixBracketNode::PostfixBracketNode):
1558 (JSC::PostfixDotNode::PostfixDotNode):
1559 (JSC::PostfixErrorNode::PostfixErrorNode):
1560 (JSC::DeleteResolveNode::DeleteResolveNode):
1561 (JSC::DeleteBracketNode::DeleteBracketNode):
1562 (JSC::DeleteDotNode::DeleteDotNode):
1563 (JSC::DeleteValueNode::DeleteValueNode):
1564 (JSC::VoidNode::VoidNode):
1565 (JSC::TypeOfResolveNode::TypeOfResolveNode):
1566 (JSC::TypeOfValueNode::TypeOfValueNode):
1567 (JSC::PrefixResolveNode::PrefixResolveNode):
1568 (JSC::PrefixBracketNode::PrefixBracketNode):
1569 (JSC::PrefixDotNode::PrefixDotNode):
1570 (JSC::PrefixErrorNode::PrefixErrorNode):
1571 (JSC::UnaryOpNode::UnaryOpNode):
1572 (JSC::UnaryPlusNode::UnaryPlusNode):
1573 (JSC::NegateNode::NegateNode):
1574 (JSC::BitwiseNotNode::BitwiseNotNode):
1575 (JSC::LogicalNotNode::LogicalNotNode):
1576 (JSC::BinaryOpNode::BinaryOpNode):
1577 (JSC::MultNode::MultNode):
1578 (JSC::DivNode::DivNode):
1579 (JSC::ModNode::ModNode):
1580 (JSC::AddNode::AddNode):
1581 (JSC::SubNode::SubNode):
1582 (JSC::LeftShiftNode::LeftShiftNode):
1583 (JSC::RightShiftNode::RightShiftNode):
1584 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
1585 (JSC::LessNode::LessNode):
1586 (JSC::GreaterNode::GreaterNode):
1587 (JSC::LessEqNode::LessEqNode):
1588 (JSC::GreaterEqNode::GreaterEqNode):
1589 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
1590 (JSC::InstanceOfNode::InstanceOfNode):
1591 (JSC::InNode::InNode):
1592 (JSC::EqualNode::EqualNode):
1593 (JSC::NotEqualNode::NotEqualNode):
1594 (JSC::StrictEqualNode::StrictEqualNode):
1595 (JSC::NotStrictEqualNode::NotStrictEqualNode):
1596 (JSC::BitAndNode::BitAndNode):
1597 (JSC::BitOrNode::BitOrNode):
1598 (JSC::BitXOrNode::BitXOrNode):
1599 (JSC::LogicalOpNode::LogicalOpNode):
1600 (JSC::ConditionalNode::ConditionalNode):
1601 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
1602 (JSC::AssignResolveNode::AssignResolveNode):
1603 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
1604 (JSC::AssignBracketNode::AssignBracketNode):
1605 (JSC::AssignDotNode::AssignDotNode):
1606 (JSC::ReadModifyDotNode::ReadModifyDotNode):
1607 (JSC::AssignErrorNode::AssignErrorNode):
1608 (JSC::CommaNode::CommaNode):
1609 (JSC::ConstStatementNode::ConstStatementNode):
1610 (JSC::EmptyStatementNode::EmptyStatementNode):
1611 (JSC::DebuggerStatementNode::DebuggerStatementNode):
1612 (JSC::ExprStatementNode::ExprStatementNode):
1613 (JSC::VarStatementNode::VarStatementNode):
1614 (JSC::IfNode::IfNode):
1615 (JSC::IfElseNode::IfElseNode):
1616 (JSC::DoWhileNode::DoWhileNode):
1617 (JSC::WhileNode::WhileNode):
1618 (JSC::ForNode::ForNode):
1619 (JSC::ContinueNode::ContinueNode):
1620 (JSC::BreakNode::BreakNode):
1621 (JSC::ReturnNode::ReturnNode):
1622 (JSC::WithNode::WithNode):
1623 (JSC::LabelNode::LabelNode):
1624 (JSC::ThrowNode::ThrowNode):
1625 (JSC::TryNode::TryNode):
1626 (JSC::FuncExprNode::FuncExprNode):
1627 (JSC::FuncDeclNode::FuncDeclNode):
1628 (JSC::SwitchNode::SwitchNode):
1629 (JSC::ConstDeclNode::ConstDeclNode):
1630 (JSC::BlockNode::BlockNode):
1631 (JSC::ForInNode::ForInNode):
1632 * parser/Nodes.cpp:
1633 (JSC::StatementNode::setLoc):
1634 (JSC):
1635 (JSC::ScopeNode::ScopeNode):
1636 (JSC::ProgramNode::ProgramNode):
1637 (JSC::ProgramNode::create):
1638 (JSC::EvalNode::EvalNode):
1639 (JSC::EvalNode::create):
1640 (JSC::FunctionBodyNode::FunctionBodyNode):
1641 (JSC::FunctionBodyNode::create):
1642 * parser/Nodes.h:
1643 (Node):
1644 (JSC::Node::columnNo):
1645 (ExpressionNode):
1646 (StatementNode):
1647 (JSC::StatementNode::column):
1648 (NullNode):
1649 (BooleanNode):
1650 (NumberNode):
1651 (StringNode):
1652 (RegExpNode):
1653 (ThisNode):
1654 (ResolveNode):
1655 (ArrayNode):
1656 (PropertyListNode):
1657 (ObjectLiteralNode):
1658 (BracketAccessorNode):
1659 (DotAccessorNode):
1660 (ArgumentListNode):
1661 (NewExprNode):
1662 (EvalFunctionCallNode):
1663 (FunctionCallValueNode):
1664 (FunctionCallResolveNode):
1665 (FunctionCallBracketNode):
1666 (FunctionCallDotNode):
1667 (CallFunctionCallDotNode):
1668 (ApplyFunctionCallDotNode):
1669 (PrePostResolveNode):
1670 (PostfixResolveNode):
1671 (PostfixBracketNode):
1672 (PostfixDotNode):
1673 (PostfixErrorNode):
1674 (DeleteResolveNode):
1675 (DeleteBracketNode):
1676 (DeleteDotNode):
1677 (DeleteValueNode):
1678 (VoidNode):
1679 (TypeOfResolveNode):
1680 (TypeOfValueNode):
1681 (PrefixResolveNode):
1682 (PrefixBracketNode):
1683 (PrefixDotNode):
1684 (PrefixErrorNode):
1685 (UnaryOpNode):
1686 (UnaryPlusNode):
1687 (NegateNode):
1688 (BitwiseNotNode):
1689 (LogicalNotNode):
1690 (BinaryOpNode):
1691 (MultNode):
1692 (DivNode):
1693 (ModNode):
1694 (AddNode):
1695 (SubNode):
1696 (LeftShiftNode):
1697 (RightShiftNode):
1698 (UnsignedRightShiftNode):
1699 (LessNode):
1700 (GreaterNode):
1701 (LessEqNode):
1702 (GreaterEqNode):
1703 (ThrowableBinaryOpNode):
1704 (InstanceOfNode):
1705 (InNode):
1706 (EqualNode):
1707 (NotEqualNode):
1708 (StrictEqualNode):
1709 (NotStrictEqualNode):
1710 (BitAndNode):
1711 (BitOrNode):
1712 (BitXOrNode):
1713 (LogicalOpNode):
1714 (ConditionalNode):
1715 (ReadModifyResolveNode):
1716 (AssignResolveNode):
1717 (ReadModifyBracketNode):
1718 (AssignBracketNode):
1719 (AssignDotNode):
1720 (ReadModifyDotNode):
1721 (AssignErrorNode):
1722 (CommaNode):
1723 (ConstDeclNode):
1724 (ConstStatementNode):
1725 (BlockNode):
1726 (EmptyStatementNode):
1727 (DebuggerStatementNode):
1728 (ExprStatementNode):
1729 (VarStatementNode):
1730 (IfNode):
1731 (IfElseNode):
1732 (DoWhileNode):
1733 (WhileNode):
1734 (ForNode):
1735 (ForInNode):
1736 (ContinueNode):
1737 (BreakNode):
1738 (ReturnNode):
1739 (WithNode):
1740 (LabelNode):
1741 (ThrowNode):
1742 (TryNode):
1743 (ScopeNode):
1744 (ProgramNode):
1745 (EvalNode):
1746 (FunctionBodyNode):
1747 (FuncExprNode):
1748 (FuncDeclNode):
1749 (SwitchNode):
1750 * parser/Parser.cpp:
1751 (JSC::::parseSourceElements):
1752 (JSC::::parseVarDeclaration):
1753 (JSC::::parseConstDeclaration):
1754 (JSC::::parseDoWhileStatement):
1755 (JSC::::parseWhileStatement):
1756 (JSC::::parseVarDeclarationList):
1757 (JSC::::parseConstDeclarationList):
1758 (JSC::::parseForStatement):
1759 (JSC::::parseBreakStatement):
1760 (JSC::::parseContinueStatement):
1761 (JSC::::parseReturnStatement):
1762 (JSC::::parseThrowStatement):
1763 (JSC::::parseWithStatement):
1764 (JSC::::parseSwitchStatement):
1765 (JSC::::parseTryStatement):
1766 (JSC::::parseDebuggerStatement):
1767 (JSC::::parseBlockStatement):
1768 (JSC::::parseStatement):
1769 (JSC::::parseFunctionBody):
1770 (JSC::::parseFunctionInfo):
1771 (JSC::::parseFunctionDeclaration):
1772 (JSC::::parseExpressionOrLabelStatement):
1773 (JSC::::parseExpressionStatement):
1774 (JSC::::parseIfStatement):
1775 (JSC::::parseExpression):
1776 (JSC::::parseAssignmentExpression):
1777 (JSC::::parseConditionalExpression):
1778 (JSC::::parseBinaryExpression):
1779 (JSC::::parseProperty):
1780 (JSC::::parseObjectLiteral):
1781 (JSC::::parseStrictObjectLiteral):
1782 (JSC::::parseArrayLiteral):
1783 (JSC::::parsePrimaryExpression):
1784 (JSC::::parseArguments):
1785 (JSC::::parseMemberExpression):
1786 (JSC::::parseUnaryExpression):
1787 * parser/Parser.h:
1788 (JSC::Parser::next):
1789 (JSC::Parser::nextExpectIdentifier):
1790 (JSC::Parser::tokenStart):
1791 (JSC::Parser::tokenLine):
1792 (JSC::Parser::tokenEnd):
1793 (JSC::Parser::tokenLocation):
1794 (Parser):
1795 (JSC::Parser::getTokenName):
1796 (JSC::::parse):
1797 * parser/ParserTokens.h:
1798 (JSC::JSTokenLocation::JSTokenLocation):
1799 (JSTokenLocation):
1800 (JSToken):
1801 * parser/SourceProviderCacheItem.h:
1802 (JSC::SourceProviderCacheItem::closeBraceToken):
1803 * parser/SyntaxChecker.h:
1804 (JSC::SyntaxChecker::makeFunctionCallNode):
1805 (JSC::SyntaxChecker::createCommaExpr):
1806 (JSC::SyntaxChecker::makeAssignNode):
1807 (JSC::SyntaxChecker::makePrefixNode):
1808 (JSC::SyntaxChecker::makePostfixNode):
1809 (JSC::SyntaxChecker::makeTypeOfNode):
1810 (JSC::SyntaxChecker::makeDeleteNode):
1811 (JSC::SyntaxChecker::makeNegateNode):
1812 (JSC::SyntaxChecker::makeBitwiseNotNode):
1813 (JSC::SyntaxChecker::createLogicalNot):
1814 (JSC::SyntaxChecker::createUnaryPlus):
1815 (JSC::SyntaxChecker::createVoid):
1816 (JSC::SyntaxChecker::thisExpr):
1817 (JSC::SyntaxChecker::createResolve):
1818 (JSC::SyntaxChecker::createObjectLiteral):
1819 (JSC::SyntaxChecker::createArray):
1820 (JSC::SyntaxChecker::createNumberExpr):
1821 (JSC::SyntaxChecker::createString):
1822 (JSC::SyntaxChecker::createBoolean):
1823 (JSC::SyntaxChecker::createNull):
1824 (JSC::SyntaxChecker::createBracketAccess):
1825 (JSC::SyntaxChecker::createDotAccess):
1826 (JSC::SyntaxChecker::createRegExp):
1827 (JSC::SyntaxChecker::createNewExpr):
1828 (JSC::SyntaxChecker::createConditionalExpr):
1829 (JSC::SyntaxChecker::createAssignResolve):
1830 (JSC::SyntaxChecker::createFunctionExpr):
1831 (JSC::SyntaxChecker::createFunctionBody):
1832 (JSC::SyntaxChecker::createArgumentsList):
1833 (JSC::SyntaxChecker::createPropertyList):
1834 (JSC::SyntaxChecker::createFuncDeclStatement):
1835 (JSC::SyntaxChecker::createBlockStatement):
1836 (JSC::SyntaxChecker::createExprStatement):
1837 (JSC::SyntaxChecker::createIfStatement):
1838 (JSC::SyntaxChecker::createForLoop):
1839 (JSC::SyntaxChecker::createForInLoop):
1840 (JSC::SyntaxChecker::createEmptyStatement):
1841 (JSC::SyntaxChecker::createVarStatement):
1842 (JSC::SyntaxChecker::createReturnStatement):
1843 (JSC::SyntaxChecker::createBreakStatement):
1844 (JSC::SyntaxChecker::createContinueStatement):
1845 (JSC::SyntaxChecker::createTryStatement):
1846 (JSC::SyntaxChecker::createSwitchStatement):
1847 (JSC::SyntaxChecker::createWhileStatement):
1848 (JSC::SyntaxChecker::createWithStatement):
1849 (JSC::SyntaxChecker::createDoWhileStatement):
1850 (JSC::SyntaxChecker::createLabelStatement):
1851 (JSC::SyntaxChecker::createThrowStatement):
1852 (JSC::SyntaxChecker::createDebugger):
1853 (JSC::SyntaxChecker::createConstStatement):
1854 (JSC::SyntaxChecker::appendConstDecl):
1855 (JSC::SyntaxChecker::createGetterOrSetterProperty):
1856 (JSC::SyntaxChecker::combineCommaNodes):
1857 (JSC::SyntaxChecker::operatorStackPop):
1858
fpizlo@apple.com8ab9c432012-08-03 21:41:05 +000018592012-08-03 Filip Pizlo <fpizlo@apple.com>
1860
fpizlo@apple.com63dda942012-08-04 01:01:27 +00001861 Crashes in dfgBuildPutByIdList when clicking on just about anything on Google Maps
1862 https://bugs.webkit.org/show_bug.cgi?id=92691
1863
1864 Reviewed by Mark Hahnenberg.
1865
1866 The state of the stubs was changing after we determined the type (by virtue of the slow path
1867 function that was called), since the get or put (in this case put) could cause arbitrary
1868 side effects. Perhaps a full-blown fix would be to eliminate our reliance of the slow path
1869 function to determine what to do, but an easier fix for now is to have the slow path give up
1870 if its assumptions were invalidated by a side effect.
1871
1872 * dfg/DFGOperations.cpp:
1873 * jit/JITStubs.cpp:
1874 (JSC::DEFINE_STUB_FUNCTION):
1875
18762012-08-03 Filip Pizlo <fpizlo@apple.com>
1877
fpizlo@apple.come4a4d792012-08-03 22:42:29 +00001878 DFG handling of get_by_id should always inject a ForceOSRExit node if there is no prediction
1879 https://bugs.webkit.org/show_bug.cgi?id=93162
1880
1881 Reviewed by Mark Hahnenberg.
1882
1883 This simplifies the DFG IR by ensuring that all nodes that use value profiles will be preceded
1884 by a ForceOSRExit if the value profile had no data.
1885
1886 * dfg/DFGByteCodeParser.cpp:
1887 (JSC::DFG::ByteCodeParser::parseBlock):
1888
18892012-08-03 Filip Pizlo <fpizlo@apple.com>
1890
fpizlo@apple.com8ab9c432012-08-03 21:41:05 +00001891 DFG::StructureCheckHoistingPhase keeps a Node& around for too long
1892 https://bugs.webkit.org/show_bug.cgi?id=93157
1893
1894 Reviewed by Mark Hahnenberg.
1895
1896 * dfg/DFGStructureCheckHoistingPhase.cpp:
1897 (JSC::DFG::StructureCheckHoistingPhase::run):
1898
paroga@webkit.org438d93a2012-08-03 05:06:38 +000018992012-08-02 Patrick Gansterer <paroga@webkit.org>
1900
1901 Move getLocalTime() as static inline function to DateMath
1902 https://bugs.webkit.org/show_bug.cgi?id=92955
1903
1904 Reviewed by Ryosuke Niwa.
1905
1906 getCurrentLocalTime() and getLocalTime() has been superseded with the
1907 GregorianDateTime class. So we can move it into DateMath.cpp as an static inline
1908 function. This allows us to remove the dependecy on time() and localtime()
1909 for Windows CE, where this functions require the ce_time library to work.
1910
1911 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1912
fpizlo@apple.com3088f182012-08-02 21:10:43 +000019132012-08-02 Filip Pizlo <fpizlo@apple.com>
1914
fpizlo@apple.com978a0eb2012-08-03 03:27:08 +00001915 ASSERTION FAILED: at(m_compileIndex).canExit() || m_isCheckingArgumentTypes
1916 https://bugs.webkit.org/show_bug.cgi?id=91074
1917
1918 Reviewed by Mark Hahnenberg.
1919
1920 Fixes a bug where the speculative JIT was performing an unnecessary speculation that the
1921 CFA had proven shouldn't be performed, leading to asserts that a node should not have
1922 exit sites. This is a debug-only assert with no release symptom - we were just emitting
1923 a check that was not reachable.
1924
1925 Also found, and fixed, a bug where structure check hoisting was slightly confusing the
1926 CFA by inserting GetLocal's into the graph. CSE would clean the GetLocal's up, which
1927 would make the backend happy - but the CFA would produce subtly wrong results.
1928
1929 * bytecode/SpeculatedType.h:
1930 (JSC::isOtherOrEmptySpeculation):
1931 (JSC):
1932 * dfg/DFGDriver.cpp:
1933 (JSC::DFG::compile):
1934 * dfg/DFGGraph.cpp:
1935 (JSC::DFG::Graph::dump):
1936 * dfg/DFGSpeculativeJIT64.cpp:
1937 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1938 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1939
19402012-08-02 Filip Pizlo <fpizlo@apple.com>
1941
fpizlo@apple.com3088f182012-08-02 21:10:43 +00001942 Unreviewed, build fix for DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE).
1943
1944 * dfg/DFGStructureCheckHoistingPhase.cpp:
1945 (JSC::DFG::StructureCheckHoistingPhase::run):
1946
mhahnenberg@apple.com85c200b2012-08-02 17:32:35 +000019472012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
1948
1949 Remove all uses of ClassInfo for JSStrings in JIT code
1950 https://bugs.webkit.org/show_bug.cgi?id=92935
1951
1952 Reviewed by Geoffrey Garen.
1953
1954 This is the first step in removing our dependence on in-object ClassInfo pointers
1955 in JIT code. Most of the changes are to check the Structure, which is unique for
1956 JSString primitives.
1957
1958 * bytecode/SpeculatedType.cpp:
1959 (JSC::speculationFromClassInfo):
1960 (JSC::speculationFromStructure): Changed to check the TypeInfo in the Structure
1961 since there wasn't a JSGlobalData immediately available to grab the JSString
1962 Structure out of.
1963 * dfg/DFGSpeculativeJIT.cpp:
1964 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
1965 * dfg/DFGSpeculativeJIT32_64.cpp:
1966 (JSC::DFG::SpeculativeJIT::compile):
1967 * dfg/DFGSpeculativeJIT64.cpp:
1968 (JSC::DFG::SpeculativeJIT::compile):
1969 * jit/JITInlineMethods.h:
1970 (JSC::JIT::emitLoadCharacterString):
1971 * jit/JITOpcodes.cpp:
1972 (JSC::JIT::privateCompileCTIMachineTrampolines):
1973 (JSC::JIT::emit_op_to_primitive):
1974 (JSC::JIT::emit_op_convert_this):
1975 * jit/JITOpcodes32_64.cpp:
1976 (JSC::JIT::privateCompileCTIMachineTrampolines):
1977 (JSC::JIT::emit_op_to_primitive):
1978 (JSC::JIT::emitSlow_op_eq):
1979 (JSC::JIT::emitSlow_op_neq):
1980 (JSC::JIT::compileOpStrictEq):
1981 (JSC::JIT::emit_op_convert_this):
1982 * jit/JITPropertyAccess.cpp:
1983 (JSC::JIT::stringGetByValStubGenerator):
1984 (JSC::JIT::emitSlow_op_get_by_val):
1985 * jit/JITPropertyAccess32_64.cpp:
1986 (JSC::JIT::stringGetByValStubGenerator):
1987 (JSC::JIT::emitSlow_op_get_by_val):
1988 * jit/SpecializedThunkJIT.h:
1989 (JSC::SpecializedThunkJIT::loadJSStringArgument):
1990 * jit/ThunkGenerators.cpp:
1991 (JSC::stringCharLoad):
1992 (JSC::charCodeAtThunkGenerator):
1993 (JSC::charAtThunkGenerator):
1994
fpizlo@apple.com58ec4b02012-08-02 08:22:57 +000019952012-08-02 Filip Pizlo <fpizlo@apple.com>
1996
fpizlo@apple.com470cde52012-08-02 08:27:48 +00001997 Unreviewed, missed a style goof in the previous patch: "NodeIndex nodeIndex"
1998 in a method signature is painfully redundant.
1999
2000 * dfg/DFGSpeculativeJIT.h:
2001 (SpeculativeJIT):
2002
20032012-08-02 Filip Pizlo <fpizlo@apple.com>
2004
fpizlo@apple.com58ec4b02012-08-02 08:22:57 +00002005 DFGSpeculativeJIT.h has too many inline method bodies
2006 https://bugs.webkit.org/show_bug.cgi?id=92957
2007
2008 Reviewed by Antti Koivisto.
2009
2010 * dfg/DFGSpeculativeJIT.cpp:
2011 (JSC::DFG::SpeculativeJIT::speculationCheck):
2012 (DFG):
2013 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
2014 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
2015 (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
2016 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
2017 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
2018 * dfg/DFGSpeculativeJIT.h:
2019 (SpeculativeJIT):
2020
commit-queue@webkit.org709de8f2012-08-02 06:44:46 +000020212012-08-01 Sheriff Bot <webkit.review.bot@gmail.com>
2022
2023 Unreviewed, rolling out r124406.
2024 http://trac.webkit.org/changeset/124406
2025 https://bugs.webkit.org/show_bug.cgi?id=92951
2026
2027 it set the Mac bots on fire (Requested by pizlo on #webkit).
2028
2029 * bytecode/Opcode.h:
2030 (JSC):
2031 (JSC::padOpcodeName):
2032 * bytecompiler/BytecodeGenerator.cpp:
2033 (JSC::BytecodeGenerator::emitDebugHook):
2034 * bytecompiler/BytecodeGenerator.h:
2035 (BytecodeGenerator):
2036 * bytecompiler/NodesCodegen.cpp:
2037 (JSC::ArrayNode::toArgumentList):
2038 (JSC::ApplyFunctionCallDotNode::emitBytecode):
2039 (JSC::ConditionalNode::emitBytecode):
2040 (JSC::ConstStatementNode::emitBytecode):
2041 (JSC::EmptyStatementNode::emitBytecode):
2042 (JSC::DebuggerStatementNode::emitBytecode):
2043 (JSC::ExprStatementNode::emitBytecode):
2044 (JSC::VarStatementNode::emitBytecode):
2045 (JSC::IfNode::emitBytecode):
2046 (JSC::IfElseNode::emitBytecode):
2047 (JSC::DoWhileNode::emitBytecode):
2048 (JSC::WhileNode::emitBytecode):
2049 (JSC::ForNode::emitBytecode):
2050 (JSC::ForInNode::emitBytecode):
2051 (JSC::ContinueNode::emitBytecode):
2052 (JSC::BreakNode::emitBytecode):
2053 (JSC::ReturnNode::emitBytecode):
2054 (JSC::WithNode::emitBytecode):
2055 (JSC::SwitchNode::emitBytecode):
2056 (JSC::LabelNode::emitBytecode):
2057 (JSC::ThrowNode::emitBytecode):
2058 (JSC::TryNode::emitBytecode):
2059 (JSC::ProgramNode::emitBytecode):
2060 (JSC::EvalNode::emitBytecode):
2061 (JSC::FunctionBodyNode::emitBytecode):
2062 * debugger/Debugger.h:
2063 * interpreter/Interpreter.cpp:
2064 (JSC::Interpreter::unwindCallFrame):
2065 (JSC::Interpreter::throwException):
2066 (JSC::Interpreter::debug):
2067 * interpreter/Interpreter.h:
2068 (Interpreter):
2069 * jit/JITOpcodes.cpp:
2070 (JSC::JIT::emit_op_debug):
2071 * jit/JITOpcodes32_64.cpp:
2072 (JSC::JIT::emit_op_debug):
2073 * jit/JITStubs.cpp:
2074 (JSC::DEFINE_STUB_FUNCTION):
2075 * llint/LLIntSlowPaths.cpp:
2076 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2077 * parser/ASTBuilder.h:
2078 (ASTBuilder):
2079 (JSC::ASTBuilder::createCommaExpr):
2080 (JSC::ASTBuilder::createLogicalNot):
2081 (JSC::ASTBuilder::createUnaryPlus):
2082 (JSC::ASTBuilder::createVoid):
2083 (JSC::ASTBuilder::thisExpr):
2084 (JSC::ASTBuilder::createResolve):
2085 (JSC::ASTBuilder::createObjectLiteral):
2086 (JSC::ASTBuilder::createArray):
2087 (JSC::ASTBuilder::createNumberExpr):
2088 (JSC::ASTBuilder::createString):
2089 (JSC::ASTBuilder::createBoolean):
2090 (JSC::ASTBuilder::createNull):
2091 (JSC::ASTBuilder::createBracketAccess):
2092 (JSC::ASTBuilder::createDotAccess):
2093 (JSC::ASTBuilder::createRegExp):
2094 (JSC::ASTBuilder::createNewExpr):
2095 (JSC::ASTBuilder::createConditionalExpr):
2096 (JSC::ASTBuilder::createAssignResolve):
2097 (JSC::ASTBuilder::createFunctionExpr):
2098 (JSC::ASTBuilder::createFunctionBody):
2099 (JSC::ASTBuilder::createGetterOrSetterProperty):
2100 (JSC::ASTBuilder::createArgumentsList):
2101 (JSC::ASTBuilder::createPropertyList):
2102 (JSC::ASTBuilder::createFuncDeclStatement):
2103 (JSC::ASTBuilder::createBlockStatement):
2104 (JSC::ASTBuilder::createExprStatement):
2105 (JSC::ASTBuilder::createIfStatement):
2106 (JSC::ASTBuilder::createForLoop):
2107 (JSC::ASTBuilder::createForInLoop):
2108 (JSC::ASTBuilder::createEmptyStatement):
2109 (JSC::ASTBuilder::createVarStatement):
2110 (JSC::ASTBuilder::createReturnStatement):
2111 (JSC::ASTBuilder::createBreakStatement):
2112 (JSC::ASTBuilder::createContinueStatement):
2113 (JSC::ASTBuilder::createTryStatement):
2114 (JSC::ASTBuilder::createSwitchStatement):
2115 (JSC::ASTBuilder::createWhileStatement):
2116 (JSC::ASTBuilder::createDoWhileStatement):
2117 (JSC::ASTBuilder::createLabelStatement):
2118 (JSC::ASTBuilder::createWithStatement):
2119 (JSC::ASTBuilder::createThrowStatement):
2120 (JSC::ASTBuilder::createDebugger):
2121 (JSC::ASTBuilder::createConstStatement):
2122 (JSC::ASTBuilder::appendConstDecl):
2123 (JSC::ASTBuilder::combineCommaNodes):
2124 (JSC::ASTBuilder::appendBinaryOperation):
2125 (JSC::ASTBuilder::createAssignment):
2126 (JSC::ASTBuilder::createNumber):
2127 (JSC::ASTBuilder::makeTypeOfNode):
2128 (JSC::ASTBuilder::makeDeleteNode):
2129 (JSC::ASTBuilder::makeNegateNode):
2130 (JSC::ASTBuilder::makeBitwiseNotNode):
2131 (JSC::ASTBuilder::makeMultNode):
2132 (JSC::ASTBuilder::makeDivNode):
2133 (JSC::ASTBuilder::makeModNode):
2134 (JSC::ASTBuilder::makeAddNode):
2135 (JSC::ASTBuilder::makeSubNode):
2136 (JSC::ASTBuilder::makeLeftShiftNode):
2137 (JSC::ASTBuilder::makeRightShiftNode):
2138 (JSC::ASTBuilder::makeURightShiftNode):
2139 (JSC::ASTBuilder::makeBitOrNode):
2140 (JSC::ASTBuilder::makeBitAndNode):
2141 (JSC::ASTBuilder::makeBitXOrNode):
2142 (JSC::ASTBuilder::makeFunctionCallNode):
2143 (JSC::ASTBuilder::makeBinaryNode):
2144 (JSC::ASTBuilder::makeAssignNode):
2145 (JSC::ASTBuilder::makePrefixNode):
2146 (JSC::ASTBuilder::makePostfixNode):
2147 * parser/Lexer.cpp:
2148 (JSC::::setCode):
2149 (JSC::::internalShift):
2150 (JSC::::shift):
2151 (JSC::::lex):
2152 * parser/Lexer.h:
2153 (Lexer):
2154 (JSC::::lexExpectIdentifier):
2155 * parser/NodeConstructors.h:
2156 (JSC::Node::Node):
2157 (JSC::ExpressionNode::ExpressionNode):
2158 (JSC::StatementNode::StatementNode):
2159 (JSC::NullNode::NullNode):
2160 (JSC::BooleanNode::BooleanNode):
2161 (JSC::NumberNode::NumberNode):
2162 (JSC::StringNode::StringNode):
2163 (JSC::RegExpNode::RegExpNode):
2164 (JSC::ThisNode::ThisNode):
2165 (JSC::ResolveNode::ResolveNode):
2166 (JSC::ArrayNode::ArrayNode):
2167 (JSC::PropertyListNode::PropertyListNode):
2168 (JSC::ObjectLiteralNode::ObjectLiteralNode):
2169 (JSC::BracketAccessorNode::BracketAccessorNode):
2170 (JSC::DotAccessorNode::DotAccessorNode):
2171 (JSC::ArgumentListNode::ArgumentListNode):
2172 (JSC::NewExprNode::NewExprNode):
2173 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
2174 (JSC::FunctionCallValueNode::FunctionCallValueNode):
2175 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
2176 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
2177 (JSC::FunctionCallDotNode::FunctionCallDotNode):
2178 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
2179 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
2180 (JSC::PrePostResolveNode::PrePostResolveNode):
2181 (JSC::PostfixResolveNode::PostfixResolveNode):
2182 (JSC::PostfixBracketNode::PostfixBracketNode):
2183 (JSC::PostfixDotNode::PostfixDotNode):
2184 (JSC::PostfixErrorNode::PostfixErrorNode):
2185 (JSC::DeleteResolveNode::DeleteResolveNode):
2186 (JSC::DeleteBracketNode::DeleteBracketNode):
2187 (JSC::DeleteDotNode::DeleteDotNode):
2188 (JSC::DeleteValueNode::DeleteValueNode):
2189 (JSC::VoidNode::VoidNode):
2190 (JSC::TypeOfResolveNode::TypeOfResolveNode):
2191 (JSC::TypeOfValueNode::TypeOfValueNode):
2192 (JSC::PrefixResolveNode::PrefixResolveNode):
2193 (JSC::PrefixBracketNode::PrefixBracketNode):
2194 (JSC::PrefixDotNode::PrefixDotNode):
2195 (JSC::PrefixErrorNode::PrefixErrorNode):
2196 (JSC::UnaryOpNode::UnaryOpNode):
2197 (JSC::UnaryPlusNode::UnaryPlusNode):
2198 (JSC::NegateNode::NegateNode):
2199 (JSC::BitwiseNotNode::BitwiseNotNode):
2200 (JSC::LogicalNotNode::LogicalNotNode):
2201 (JSC::BinaryOpNode::BinaryOpNode):
2202 (JSC::MultNode::MultNode):
2203 (JSC::DivNode::DivNode):
2204 (JSC::ModNode::ModNode):
2205 (JSC::AddNode::AddNode):
2206 (JSC::SubNode::SubNode):
2207 (JSC::LeftShiftNode::LeftShiftNode):
2208 (JSC::RightShiftNode::RightShiftNode):
2209 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
2210 (JSC::LessNode::LessNode):
2211 (JSC::GreaterNode::GreaterNode):
2212 (JSC::LessEqNode::LessEqNode):
2213 (JSC::GreaterEqNode::GreaterEqNode):
2214 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
2215 (JSC::InstanceOfNode::InstanceOfNode):
2216 (JSC::InNode::InNode):
2217 (JSC::EqualNode::EqualNode):
2218 (JSC::NotEqualNode::NotEqualNode):
2219 (JSC::StrictEqualNode::StrictEqualNode):
2220 (JSC::NotStrictEqualNode::NotStrictEqualNode):
2221 (JSC::BitAndNode::BitAndNode):
2222 (JSC::BitOrNode::BitOrNode):
2223 (JSC::BitXOrNode::BitXOrNode):
2224 (JSC::LogicalOpNode::LogicalOpNode):
2225 (JSC::ConditionalNode::ConditionalNode):
2226 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
2227 (JSC::AssignResolveNode::AssignResolveNode):
2228 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
2229 (JSC::AssignBracketNode::AssignBracketNode):
2230 (JSC::AssignDotNode::AssignDotNode):
2231 (JSC::ReadModifyDotNode::ReadModifyDotNode):
2232 (JSC::AssignErrorNode::AssignErrorNode):
2233 (JSC::CommaNode::CommaNode):
2234 (JSC::ConstStatementNode::ConstStatementNode):
2235 (JSC::EmptyStatementNode::EmptyStatementNode):
2236 (JSC::DebuggerStatementNode::DebuggerStatementNode):
2237 (JSC::ExprStatementNode::ExprStatementNode):
2238 (JSC::VarStatementNode::VarStatementNode):
2239 (JSC::IfNode::IfNode):
2240 (JSC::IfElseNode::IfElseNode):
2241 (JSC::DoWhileNode::DoWhileNode):
2242 (JSC::WhileNode::WhileNode):
2243 (JSC::ForNode::ForNode):
2244 (JSC::ContinueNode::ContinueNode):
2245 (JSC::BreakNode::BreakNode):
2246 (JSC::ReturnNode::ReturnNode):
2247 (JSC::WithNode::WithNode):
2248 (JSC::LabelNode::LabelNode):
2249 (JSC::ThrowNode::ThrowNode):
2250 (JSC::TryNode::TryNode):
2251 (JSC::FuncExprNode::FuncExprNode):
2252 (JSC::FuncDeclNode::FuncDeclNode):
2253 (JSC::SwitchNode::SwitchNode):
2254 (JSC::ConstDeclNode::ConstDeclNode):
2255 (JSC::BlockNode::BlockNode):
2256 (JSC::ForInNode::ForInNode):
2257 * parser/Nodes.cpp:
2258 (JSC):
2259 (JSC::StatementNode::setLoc):
2260 (JSC::ScopeNode::ScopeNode):
2261 (JSC::ProgramNode::ProgramNode):
2262 (JSC::ProgramNode::create):
2263 (JSC::EvalNode::EvalNode):
2264 (JSC::EvalNode::create):
2265 (JSC::FunctionBodyNode::FunctionBodyNode):
2266 (JSC::FunctionBodyNode::create):
2267 * parser/Nodes.h:
2268 (Node):
2269 (ExpressionNode):
2270 (StatementNode):
2271 (NullNode):
2272 (BooleanNode):
2273 (NumberNode):
2274 (StringNode):
2275 (RegExpNode):
2276 (ThisNode):
2277 (ResolveNode):
2278 (ArrayNode):
2279 (PropertyListNode):
2280 (ObjectLiteralNode):
2281 (BracketAccessorNode):
2282 (DotAccessorNode):
2283 (ArgumentListNode):
2284 (NewExprNode):
2285 (EvalFunctionCallNode):
2286 (FunctionCallValueNode):
2287 (FunctionCallResolveNode):
2288 (FunctionCallBracketNode):
2289 (FunctionCallDotNode):
2290 (CallFunctionCallDotNode):
2291 (ApplyFunctionCallDotNode):
2292 (PrePostResolveNode):
2293 (PostfixResolveNode):
2294 (PostfixBracketNode):
2295 (PostfixDotNode):
2296 (PostfixErrorNode):
2297 (DeleteResolveNode):
2298 (DeleteBracketNode):
2299 (DeleteDotNode):
2300 (DeleteValueNode):
2301 (VoidNode):
2302 (TypeOfResolveNode):
2303 (TypeOfValueNode):
2304 (PrefixResolveNode):
2305 (PrefixBracketNode):
2306 (PrefixDotNode):
2307 (PrefixErrorNode):
2308 (UnaryOpNode):
2309 (UnaryPlusNode):
2310 (NegateNode):
2311 (BitwiseNotNode):
2312 (LogicalNotNode):
2313 (BinaryOpNode):
2314 (MultNode):
2315 (DivNode):
2316 (ModNode):
2317 (AddNode):
2318 (SubNode):
2319 (LeftShiftNode):
2320 (RightShiftNode):
2321 (UnsignedRightShiftNode):
2322 (LessNode):
2323 (GreaterNode):
2324 (LessEqNode):
2325 (GreaterEqNode):
2326 (ThrowableBinaryOpNode):
2327 (InstanceOfNode):
2328 (InNode):
2329 (EqualNode):
2330 (NotEqualNode):
2331 (StrictEqualNode):
2332 (NotStrictEqualNode):
2333 (BitAndNode):
2334 (BitOrNode):
2335 (BitXOrNode):
2336 (LogicalOpNode):
2337 (ConditionalNode):
2338 (ReadModifyResolveNode):
2339 (AssignResolveNode):
2340 (ReadModifyBracketNode):
2341 (AssignBracketNode):
2342 (AssignDotNode):
2343 (ReadModifyDotNode):
2344 (AssignErrorNode):
2345 (CommaNode):
2346 (ConstDeclNode):
2347 (ConstStatementNode):
2348 (BlockNode):
2349 (EmptyStatementNode):
2350 (DebuggerStatementNode):
2351 (ExprStatementNode):
2352 (VarStatementNode):
2353 (IfNode):
2354 (IfElseNode):
2355 (DoWhileNode):
2356 (WhileNode):
2357 (ForNode):
2358 (ForInNode):
2359 (ContinueNode):
2360 (BreakNode):
2361 (ReturnNode):
2362 (WithNode):
2363 (LabelNode):
2364 (ThrowNode):
2365 (TryNode):
2366 (ScopeNode):
2367 (ProgramNode):
2368 (EvalNode):
2369 (FunctionBodyNode):
2370 (FuncExprNode):
2371 (FuncDeclNode):
2372 (SwitchNode):
2373 * parser/Parser.cpp:
2374 (JSC::::parseSourceElements):
2375 (JSC::::parseVarDeclaration):
2376 (JSC::::parseConstDeclaration):
2377 (JSC::::parseDoWhileStatement):
2378 (JSC::::parseWhileStatement):
2379 (JSC::::parseVarDeclarationList):
2380 (JSC::::parseConstDeclarationList):
2381 (JSC::::parseForStatement):
2382 (JSC::::parseBreakStatement):
2383 (JSC::::parseContinueStatement):
2384 (JSC::::parseReturnStatement):
2385 (JSC::::parseThrowStatement):
2386 (JSC::::parseWithStatement):
2387 (JSC::::parseSwitchStatement):
2388 (JSC::::parseTryStatement):
2389 (JSC::::parseDebuggerStatement):
2390 (JSC::::parseBlockStatement):
2391 (JSC::::parseStatement):
2392 (JSC::::parseFunctionBody):
2393 (JSC::::parseFunctionInfo):
2394 (JSC::::parseFunctionDeclaration):
2395 (JSC::::parseExpressionOrLabelStatement):
2396 (JSC::::parseExpressionStatement):
2397 (JSC::::parseIfStatement):
2398 (JSC::::parseExpression):
2399 (JSC::::parseAssignmentExpression):
2400 (JSC::::parseConditionalExpression):
2401 (JSC::::parseBinaryExpression):
2402 (JSC::::parseProperty):
2403 (JSC::::parseObjectLiteral):
2404 (JSC::::parseStrictObjectLiteral):
2405 (JSC::::parseArrayLiteral):
2406 (JSC::::parsePrimaryExpression):
2407 (JSC::::parseArguments):
2408 (JSC::::parseMemberExpression):
2409 (JSC::::parseUnaryExpression):
2410 * parser/Parser.h:
2411 (JSC::Parser::next):
2412 (JSC::Parser::nextExpectIdentifier):
2413 (JSC::Parser::tokenStart):
2414 (JSC::Parser::tokenLine):
2415 (JSC::Parser::tokenEnd):
2416 (JSC::Parser::getTokenName):
2417 (JSC::::parse):
2418 * parser/ParserTokens.h:
2419 (JSC::JSTokenInfo::JSTokenInfo):
2420 (JSTokenInfo):
2421 (JSToken):
2422 * parser/SourceProviderCacheItem.h:
2423 (JSC::SourceProviderCacheItem::closeBraceToken):
2424 * parser/SyntaxChecker.h:
2425 (JSC::SyntaxChecker::makeFunctionCallNode):
2426 (JSC::SyntaxChecker::createCommaExpr):
2427 (JSC::SyntaxChecker::makeAssignNode):
2428 (JSC::SyntaxChecker::makePrefixNode):
2429 (JSC::SyntaxChecker::makePostfixNode):
2430 (JSC::SyntaxChecker::makeTypeOfNode):
2431 (JSC::SyntaxChecker::makeDeleteNode):
2432 (JSC::SyntaxChecker::makeNegateNode):
2433 (JSC::SyntaxChecker::makeBitwiseNotNode):
2434 (JSC::SyntaxChecker::createLogicalNot):
2435 (JSC::SyntaxChecker::createUnaryPlus):
2436 (JSC::SyntaxChecker::createVoid):
2437 (JSC::SyntaxChecker::thisExpr):
2438 (JSC::SyntaxChecker::createResolve):
2439 (JSC::SyntaxChecker::createObjectLiteral):
2440 (JSC::SyntaxChecker::createArray):
2441 (JSC::SyntaxChecker::createNumberExpr):
2442 (JSC::SyntaxChecker::createString):
2443 (JSC::SyntaxChecker::createBoolean):
2444 (JSC::SyntaxChecker::createNull):
2445 (JSC::SyntaxChecker::createBracketAccess):
2446 (JSC::SyntaxChecker::createDotAccess):
2447 (JSC::SyntaxChecker::createRegExp):
2448 (JSC::SyntaxChecker::createNewExpr):
2449 (JSC::SyntaxChecker::createConditionalExpr):
2450 (JSC::SyntaxChecker::createAssignResolve):
2451 (JSC::SyntaxChecker::createFunctionExpr):
2452 (JSC::SyntaxChecker::createFunctionBody):
2453 (JSC::SyntaxChecker::createArgumentsList):
2454 (JSC::SyntaxChecker::createPropertyList):
2455 (JSC::SyntaxChecker::createFuncDeclStatement):
2456 (JSC::SyntaxChecker::createBlockStatement):
2457 (JSC::SyntaxChecker::createExprStatement):
2458 (JSC::SyntaxChecker::createIfStatement):
2459 (JSC::SyntaxChecker::createForLoop):
2460 (JSC::SyntaxChecker::createForInLoop):
2461 (JSC::SyntaxChecker::createEmptyStatement):
2462 (JSC::SyntaxChecker::createVarStatement):
2463 (JSC::SyntaxChecker::createReturnStatement):
2464 (JSC::SyntaxChecker::createBreakStatement):
2465 (JSC::SyntaxChecker::createContinueStatement):
2466 (JSC::SyntaxChecker::createTryStatement):
2467 (JSC::SyntaxChecker::createSwitchStatement):
2468 (JSC::SyntaxChecker::createWhileStatement):
2469 (JSC::SyntaxChecker::createWithStatement):
2470 (JSC::SyntaxChecker::createDoWhileStatement):
2471 (JSC::SyntaxChecker::createLabelStatement):
2472 (JSC::SyntaxChecker::createThrowStatement):
2473 (JSC::SyntaxChecker::createDebugger):
2474 (JSC::SyntaxChecker::createConstStatement):
2475 (JSC::SyntaxChecker::appendConstDecl):
2476 (JSC::SyntaxChecker::createGetterOrSetterProperty):
2477 (JSC::SyntaxChecker::combineCommaNodes):
2478 (JSC::SyntaxChecker::operatorStackPop):
2479
commit-queue@webkit.org3772d072012-08-02 04:49:25 +000024802012-08-01 Peter Wang <peter.wang@torchmobile.com.cn>
2481
2482 Web Inspector: [JSC] implement setting breakpoints by line:column
2483 https://bugs.webkit.org/show_bug.cgi?id=53003
2484
2485 Reviewed by Geoffrey Garen.
2486
2487 Add a counter in lexer to record the column of each token. Debugger will use column info
2488 in "Pretty Print" debug mode of Inspector.
2489
2490 * bytecode/Opcode.h:
2491 (JSC):
2492 (JSC::padOpcodeName):
2493 * bytecompiler/BytecodeGenerator.cpp:
2494 (JSC::BytecodeGenerator::emitDebugHook):
2495 * bytecompiler/BytecodeGenerator.h:
2496 (BytecodeGenerator):
2497 * bytecompiler/NodesCodegen.cpp:
2498 (JSC::ArrayNode::toArgumentList):
2499 (JSC::ApplyFunctionCallDotNode::emitBytecode):
2500 (JSC::ConditionalNode::emitBytecode):
2501 (JSC::ConstStatementNode::emitBytecode):
2502 (JSC::EmptyStatementNode::emitBytecode):
2503 (JSC::DebuggerStatementNode::emitBytecode):
2504 (JSC::ExprStatementNode::emitBytecode):
2505 (JSC::VarStatementNode::emitBytecode):
2506 (JSC::IfNode::emitBytecode):
2507 (JSC::IfElseNode::emitBytecode):
2508 (JSC::DoWhileNode::emitBytecode):
2509 (JSC::WhileNode::emitBytecode):
2510 (JSC::ForNode::emitBytecode):
2511 (JSC::ForInNode::emitBytecode):
2512 (JSC::ContinueNode::emitBytecode):
2513 (JSC::BreakNode::emitBytecode):
2514 (JSC::ReturnNode::emitBytecode):
2515 (JSC::WithNode::emitBytecode):
2516 (JSC::SwitchNode::emitBytecode):
2517 (JSC::LabelNode::emitBytecode):
2518 (JSC::ThrowNode::emitBytecode):
2519 (JSC::TryNode::emitBytecode):
2520 (JSC::ProgramNode::emitBytecode):
2521 (JSC::EvalNode::emitBytecode):
2522 (JSC::FunctionBodyNode::emitBytecode):
2523 * debugger/Debugger.h:
2524 * interpreter/Interpreter.cpp:
2525 (JSC::Interpreter::unwindCallFrame):
2526 (JSC::Interpreter::throwException):
2527 (JSC::Interpreter::debug):
2528 * interpreter/Interpreter.h:
2529 (Interpreter):
2530 * jit/JITOpcodes.cpp:
2531 (JSC::JIT::emit_op_debug):
2532 * jit/JITOpcodes32_64.cpp:
2533 (JSC::JIT::emit_op_debug):
2534 * jit/JITStubs.cpp:
2535 (JSC::DEFINE_STUB_FUNCTION):
2536 * llint/LLIntSlowPaths.cpp:
2537 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2538 * parser/ASTBuilder.h:
2539 (ASTBuilder):
2540 (JSC::ASTBuilder::createCommaExpr):
2541 (JSC::ASTBuilder::createLogicalNot):
2542 (JSC::ASTBuilder::createUnaryPlus):
2543 (JSC::ASTBuilder::createVoid):
2544 (JSC::ASTBuilder::thisExpr):
2545 (JSC::ASTBuilder::createResolve):
2546 (JSC::ASTBuilder::createObjectLiteral):
2547 (JSC::ASTBuilder::createArray):
2548 (JSC::ASTBuilder::createNumberExpr):
2549 (JSC::ASTBuilder::createString):
2550 (JSC::ASTBuilder::createBoolean):
2551 (JSC::ASTBuilder::createNull):
2552 (JSC::ASTBuilder::createBracketAccess):
2553 (JSC::ASTBuilder::createDotAccess):
2554 (JSC::ASTBuilder::createRegExp):
2555 (JSC::ASTBuilder::createNewExpr):
2556 (JSC::ASTBuilder::createConditionalExpr):
2557 (JSC::ASTBuilder::createAssignResolve):
2558 (JSC::ASTBuilder::createFunctionExpr):
2559 (JSC::ASTBuilder::createFunctionBody):
2560 (JSC::ASTBuilder::createGetterOrSetterProperty):
2561 (JSC::ASTBuilder::createArgumentsList):
2562 (JSC::ASTBuilder::createPropertyList):
2563 (JSC::ASTBuilder::createFuncDeclStatement):
2564 (JSC::ASTBuilder::createBlockStatement):
2565 (JSC::ASTBuilder::createExprStatement):
2566 (JSC::ASTBuilder::createIfStatement):
2567 (JSC::ASTBuilder::createForLoop):
2568 (JSC::ASTBuilder::createForInLoop):
2569 (JSC::ASTBuilder::createEmptyStatement):
2570 (JSC::ASTBuilder::createVarStatement):
2571 (JSC::ASTBuilder::createReturnStatement):
2572 (JSC::ASTBuilder::createBreakStatement):
2573 (JSC::ASTBuilder::createContinueStatement):
2574 (JSC::ASTBuilder::createTryStatement):
2575 (JSC::ASTBuilder::createSwitchStatement):
2576 (JSC::ASTBuilder::createWhileStatement):
2577 (JSC::ASTBuilder::createDoWhileStatement):
2578 (JSC::ASTBuilder::createLabelStatement):
2579 (JSC::ASTBuilder::createWithStatement):
2580 (JSC::ASTBuilder::createThrowStatement):
2581 (JSC::ASTBuilder::createDebugger):
2582 (JSC::ASTBuilder::createConstStatement):
2583 (JSC::ASTBuilder::appendConstDecl):
2584 (JSC::ASTBuilder::combineCommaNodes):
2585 (JSC::ASTBuilder::appendBinaryOperation):
2586 (JSC::ASTBuilder::createAssignment):
2587 (JSC::ASTBuilder::createNumber):
2588 (JSC::ASTBuilder::makeTypeOfNode):
2589 (JSC::ASTBuilder::makeDeleteNode):
2590 (JSC::ASTBuilder::makeNegateNode):
2591 (JSC::ASTBuilder::makeBitwiseNotNode):
2592 (JSC::ASTBuilder::makeMultNode):
2593 (JSC::ASTBuilder::makeDivNode):
2594 (JSC::ASTBuilder::makeModNode):
2595 (JSC::ASTBuilder::makeAddNode):
2596 (JSC::ASTBuilder::makeSubNode):
2597 (JSC::ASTBuilder::makeLeftShiftNode):
2598 (JSC::ASTBuilder::makeRightShiftNode):
2599 (JSC::ASTBuilder::makeURightShiftNode):
2600 (JSC::ASTBuilder::makeBitOrNode):
2601 (JSC::ASTBuilder::makeBitAndNode):
2602 (JSC::ASTBuilder::makeBitXOrNode):
2603 (JSC::ASTBuilder::makeFunctionCallNode):
2604 (JSC::ASTBuilder::makeBinaryNode):
2605 (JSC::ASTBuilder::makeAssignNode):
2606 (JSC::ASTBuilder::makePrefixNode):
2607 (JSC::ASTBuilder::makePostfixNode):
2608 * parser/Lexer.cpp:
2609 (JSC::::setCode):
2610 (JSC::::internalShift):
2611 (JSC::::shift):
2612 (JSC::::lex):
2613 * parser/Lexer.h:
2614 (Lexer):
2615 (JSC::Lexer::currentColumnNumber):
2616 (JSC::::lexExpectIdentifier):
2617 * parser/NodeConstructors.h:
2618 (JSC::Node::Node):
2619 (JSC::ExpressionNode::ExpressionNode):
2620 (JSC::StatementNode::StatementNode):
2621 (JSC::NullNode::NullNode):
2622 (JSC::BooleanNode::BooleanNode):
2623 (JSC::NumberNode::NumberNode):
2624 (JSC::StringNode::StringNode):
2625 (JSC::RegExpNode::RegExpNode):
2626 (JSC::ThisNode::ThisNode):
2627 (JSC::ResolveNode::ResolveNode):
2628 (JSC::ArrayNode::ArrayNode):
2629 (JSC::PropertyListNode::PropertyListNode):
2630 (JSC::ObjectLiteralNode::ObjectLiteralNode):
2631 (JSC::BracketAccessorNode::BracketAccessorNode):
2632 (JSC::DotAccessorNode::DotAccessorNode):
2633 (JSC::ArgumentListNode::ArgumentListNode):
2634 (JSC::NewExprNode::NewExprNode):
2635 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
2636 (JSC::FunctionCallValueNode::FunctionCallValueNode):
2637 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
2638 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
2639 (JSC::FunctionCallDotNode::FunctionCallDotNode):
2640 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
2641 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
2642 (JSC::PrePostResolveNode::PrePostResolveNode):
2643 (JSC::PostfixResolveNode::PostfixResolveNode):
2644 (JSC::PostfixBracketNode::PostfixBracketNode):
2645 (JSC::PostfixDotNode::PostfixDotNode):
2646 (JSC::PostfixErrorNode::PostfixErrorNode):
2647 (JSC::DeleteResolveNode::DeleteResolveNode):
2648 (JSC::DeleteBracketNode::DeleteBracketNode):
2649 (JSC::DeleteDotNode::DeleteDotNode):
2650 (JSC::DeleteValueNode::DeleteValueNode):
2651 (JSC::VoidNode::VoidNode):
2652 (JSC::TypeOfResolveNode::TypeOfResolveNode):
2653 (JSC::TypeOfValueNode::TypeOfValueNode):
2654 (JSC::PrefixResolveNode::PrefixResolveNode):
2655 (JSC::PrefixBracketNode::PrefixBracketNode):
2656 (JSC::PrefixDotNode::PrefixDotNode):
2657 (JSC::PrefixErrorNode::PrefixErrorNode):
2658 (JSC::UnaryOpNode::UnaryOpNode):
2659 (JSC::UnaryPlusNode::UnaryPlusNode):
2660 (JSC::NegateNode::NegateNode):
2661 (JSC::BitwiseNotNode::BitwiseNotNode):
2662 (JSC::LogicalNotNode::LogicalNotNode):
2663 (JSC::BinaryOpNode::BinaryOpNode):
2664 (JSC::MultNode::MultNode):
2665 (JSC::DivNode::DivNode):
2666 (JSC::ModNode::ModNode):
2667 (JSC::AddNode::AddNode):
2668 (JSC::SubNode::SubNode):
2669 (JSC::LeftShiftNode::LeftShiftNode):
2670 (JSC::RightShiftNode::RightShiftNode):
2671 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
2672 (JSC::LessNode::LessNode):
2673 (JSC::GreaterNode::GreaterNode):
2674 (JSC::LessEqNode::LessEqNode):
2675 (JSC::GreaterEqNode::GreaterEqNode):
2676 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
2677 (JSC::InstanceOfNode::InstanceOfNode):
2678 (JSC::InNode::InNode):
2679 (JSC::EqualNode::EqualNode):
2680 (JSC::NotEqualNode::NotEqualNode):
2681 (JSC::StrictEqualNode::StrictEqualNode):
2682 (JSC::NotStrictEqualNode::NotStrictEqualNode):
2683 (JSC::BitAndNode::BitAndNode):
2684 (JSC::BitOrNode::BitOrNode):
2685 (JSC::BitXOrNode::BitXOrNode):
2686 (JSC::LogicalOpNode::LogicalOpNode):
2687 (JSC::ConditionalNode::ConditionalNode):
2688 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
2689 (JSC::AssignResolveNode::AssignResolveNode):
2690 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
2691 (JSC::AssignBracketNode::AssignBracketNode):
2692 (JSC::AssignDotNode::AssignDotNode):
2693 (JSC::ReadModifyDotNode::ReadModifyDotNode):
2694 (JSC::AssignErrorNode::AssignErrorNode):
2695 (JSC::CommaNode::CommaNode):
2696 (JSC::ConstStatementNode::ConstStatementNode):
2697 (JSC::EmptyStatementNode::EmptyStatementNode):
2698 (JSC::DebuggerStatementNode::DebuggerStatementNode):
2699 (JSC::ExprStatementNode::ExprStatementNode):
2700 (JSC::VarStatementNode::VarStatementNode):
2701 (JSC::IfNode::IfNode):
2702 (JSC::IfElseNode::IfElseNode):
2703 (JSC::DoWhileNode::DoWhileNode):
2704 (JSC::WhileNode::WhileNode):
2705 (JSC::ForNode::ForNode):
2706 (JSC::ContinueNode::ContinueNode):
2707 (JSC::BreakNode::BreakNode):
2708 (JSC::ReturnNode::ReturnNode):
2709 (JSC::WithNode::WithNode):
2710 (JSC::LabelNode::LabelNode):
2711 (JSC::ThrowNode::ThrowNode):
2712 (JSC::TryNode::TryNode):
2713 (JSC::FuncExprNode::FuncExprNode):
2714 (JSC::FuncDeclNode::FuncDeclNode):
2715 (JSC::SwitchNode::SwitchNode):
2716 (JSC::ConstDeclNode::ConstDeclNode):
2717 (JSC::BlockNode::BlockNode):
2718 (JSC::ForInNode::ForInNode):
2719 * parser/Nodes.cpp:
2720 (JSC::StatementNode::setLoc):
2721 (JSC):
2722 (JSC::ScopeNode::ScopeNode):
2723 (JSC::ProgramNode::ProgramNode):
2724 (JSC::ProgramNode::create):
2725 (JSC::EvalNode::EvalNode):
2726 (JSC::EvalNode::create):
2727 (JSC::FunctionBodyNode::FunctionBodyNode):
2728 (JSC::FunctionBodyNode::create):
2729 * parser/Nodes.h:
2730 (Node):
2731 (JSC::Node::columnNo):
2732 (ExpressionNode):
2733 (StatementNode):
2734 (JSC::StatementNode::column):
2735 (NullNode):
2736 (BooleanNode):
2737 (NumberNode):
2738 (StringNode):
2739 (RegExpNode):
2740 (ThisNode):
2741 (ResolveNode):
2742 (ArrayNode):
2743 (PropertyListNode):
2744 (ObjectLiteralNode):
2745 (BracketAccessorNode):
2746 (DotAccessorNode):
2747 (ArgumentListNode):
2748 (NewExprNode):
2749 (EvalFunctionCallNode):
2750 (FunctionCallValueNode):
2751 (FunctionCallResolveNode):
2752 (FunctionCallBracketNode):
2753 (FunctionCallDotNode):
2754 (CallFunctionCallDotNode):
2755 (ApplyFunctionCallDotNode):
2756 (PrePostResolveNode):
2757 (PostfixResolveNode):
2758 (PostfixBracketNode):
2759 (PostfixDotNode):
2760 (PostfixErrorNode):
2761 (DeleteResolveNode):
2762 (DeleteBracketNode):
2763 (DeleteDotNode):
2764 (DeleteValueNode):
2765 (VoidNode):
2766 (TypeOfResolveNode):
2767 (TypeOfValueNode):
2768 (PrefixResolveNode):
2769 (PrefixBracketNode):
2770 (PrefixDotNode):
2771 (PrefixErrorNode):
2772 (UnaryOpNode):
2773 (UnaryPlusNode):
2774 (NegateNode):
2775 (BitwiseNotNode):
2776 (LogicalNotNode):
2777 (BinaryOpNode):
2778 (MultNode):
2779 (DivNode):
2780 (ModNode):
2781 (AddNode):
2782 (SubNode):
2783 (LeftShiftNode):
2784 (RightShiftNode):
2785 (UnsignedRightShiftNode):
2786 (LessNode):
2787 (GreaterNode):
2788 (LessEqNode):
2789 (GreaterEqNode):
2790 (ThrowableBinaryOpNode):
2791 (InstanceOfNode):
2792 (InNode):
2793 (EqualNode):
2794 (NotEqualNode):
2795 (StrictEqualNode):
2796 (NotStrictEqualNode):
2797 (BitAndNode):
2798 (BitOrNode):
2799 (BitXOrNode):
2800 (LogicalOpNode):
2801 (ConditionalNode):
2802 (ReadModifyResolveNode):
2803 (AssignResolveNode):
2804 (ReadModifyBracketNode):
2805 (AssignBracketNode):
2806 (AssignDotNode):
2807 (ReadModifyDotNode):
2808 (AssignErrorNode):
2809 (CommaNode):
2810 (ConstDeclNode):
2811 (ConstStatementNode):
2812 (BlockNode):
2813 (EmptyStatementNode):
2814 (DebuggerStatementNode):
2815 (ExprStatementNode):
2816 (VarStatementNode):
2817 (IfNode):
2818 (IfElseNode):
2819 (DoWhileNode):
2820 (WhileNode):
2821 (ForNode):
2822 (ForInNode):
2823 (ContinueNode):
2824 (BreakNode):
2825 (ReturnNode):
2826 (WithNode):
2827 (LabelNode):
2828 (ThrowNode):
2829 (TryNode):
2830 (ScopeNode):
2831 (ProgramNode):
2832 (EvalNode):
2833 (FunctionBodyNode):
2834 (FuncExprNode):
2835 (FuncDeclNode):
2836 (SwitchNode):
2837 * parser/Parser.cpp:
2838 (JSC::::parseSourceElements):
2839 (JSC::::parseVarDeclaration):
2840 (JSC::::parseConstDeclaration):
2841 (JSC::::parseDoWhileStatement):
2842 (JSC::::parseWhileStatement):
2843 (JSC::::parseVarDeclarationList):
2844 (JSC::::parseConstDeclarationList):
2845 (JSC::::parseForStatement):
2846 (JSC::::parseBreakStatement):
2847 (JSC::::parseContinueStatement):
2848 (JSC::::parseReturnStatement):
2849 (JSC::::parseThrowStatement):
2850 (JSC::::parseWithStatement):
2851 (JSC::::parseSwitchStatement):
2852 (JSC::::parseTryStatement):
2853 (JSC::::parseDebuggerStatement):
2854 (JSC::::parseBlockStatement):
2855 (JSC::::parseStatement):
2856 (JSC::::parseFunctionBody):
2857 (JSC::::parseFunctionInfo):
2858 (JSC::::parseFunctionDeclaration):
2859 (JSC::::parseExpressionOrLabelStatement):
2860 (JSC::::parseExpressionStatement):
2861 (JSC::::parseIfStatement):
2862 (JSC::::parseExpression):
2863 (JSC::::parseAssignmentExpression):
2864 (JSC::::parseConditionalExpression):
2865 (JSC::::parseBinaryExpression):
2866 (JSC::::parseProperty):
2867 (JSC::::parseObjectLiteral):
2868 (JSC::::parseStrictObjectLiteral):
2869 (JSC::::parseArrayLiteral):
2870 (JSC::::parsePrimaryExpression):
2871 (JSC::::parseArguments):
2872 (JSC::::parseMemberExpression):
2873 (JSC::::parseUnaryExpression):
2874 * parser/Parser.h:
2875 (JSC::Parser::next):
2876 (JSC::Parser::nextExpectIdentifier):
2877 (JSC::Parser::tokenStart):
2878 (JSC::Parser::tokenLine):
2879 (JSC::Parser::tokenEnd):
2880 (JSC::Parser::tokenLocation):
2881 (Parser):
2882 (JSC::Parser::getTokenName):
2883 (JSC::::parse):
2884 * parser/ParserTokens.h:
2885 (JSC::JSTokenLocation::JSTokenLocation):
2886 (JSTokenLocation):
2887 (JSToken):
2888 * parser/SourceProviderCacheItem.h:
2889 (JSC::SourceProviderCacheItem::closeBraceToken):
2890 * parser/SyntaxChecker.h:
2891 (JSC::SyntaxChecker::makeFunctionCallNode):
2892 (JSC::SyntaxChecker::createCommaExpr):
2893 (JSC::SyntaxChecker::makeAssignNode):
2894 (JSC::SyntaxChecker::makePrefixNode):
2895 (JSC::SyntaxChecker::makePostfixNode):
2896 (JSC::SyntaxChecker::makeTypeOfNode):
2897 (JSC::SyntaxChecker::makeDeleteNode):
2898 (JSC::SyntaxChecker::makeNegateNode):
2899 (JSC::SyntaxChecker::makeBitwiseNotNode):
2900 (JSC::SyntaxChecker::createLogicalNot):
2901 (JSC::SyntaxChecker::createUnaryPlus):
2902 (JSC::SyntaxChecker::createVoid):
2903 (JSC::SyntaxChecker::thisExpr):
2904 (JSC::SyntaxChecker::createResolve):
2905 (JSC::SyntaxChecker::createObjectLiteral):
2906 (JSC::SyntaxChecker::createArray):
2907 (JSC::SyntaxChecker::createNumberExpr):
2908 (JSC::SyntaxChecker::createString):
2909 (JSC::SyntaxChecker::createBoolean):
2910 (JSC::SyntaxChecker::createNull):
2911 (JSC::SyntaxChecker::createBracketAccess):
2912 (JSC::SyntaxChecker::createDotAccess):
2913 (JSC::SyntaxChecker::createRegExp):
2914 (JSC::SyntaxChecker::createNewExpr):
2915 (JSC::SyntaxChecker::createConditionalExpr):
2916 (JSC::SyntaxChecker::createAssignResolve):
2917 (JSC::SyntaxChecker::createFunctionExpr):
2918 (JSC::SyntaxChecker::createFunctionBody):
2919 (JSC::SyntaxChecker::createArgumentsList):
2920 (JSC::SyntaxChecker::createPropertyList):
2921 (JSC::SyntaxChecker::createFuncDeclStatement):
2922 (JSC::SyntaxChecker::createBlockStatement):
2923 (JSC::SyntaxChecker::createExprStatement):
2924 (JSC::SyntaxChecker::createIfStatement):
2925 (JSC::SyntaxChecker::createForLoop):
2926 (JSC::SyntaxChecker::createForInLoop):
2927 (JSC::SyntaxChecker::createEmptyStatement):
2928 (JSC::SyntaxChecker::createVarStatement):
2929 (JSC::SyntaxChecker::createReturnStatement):
2930 (JSC::SyntaxChecker::createBreakStatement):
2931 (JSC::SyntaxChecker::createContinueStatement):
2932 (JSC::SyntaxChecker::createTryStatement):
2933 (JSC::SyntaxChecker::createSwitchStatement):
2934 (JSC::SyntaxChecker::createWhileStatement):
2935 (JSC::SyntaxChecker::createWithStatement):
2936 (JSC::SyntaxChecker::createDoWhileStatement):
2937 (JSC::SyntaxChecker::createLabelStatement):
2938 (JSC::SyntaxChecker::createThrowStatement):
2939 (JSC::SyntaxChecker::createDebugger):
2940 (JSC::SyntaxChecker::createConstStatement):
2941 (JSC::SyntaxChecker::appendConstDecl):
2942 (JSC::SyntaxChecker::createGetterOrSetterProperty):
2943 (JSC::SyntaxChecker::combineCommaNodes):
2944 (JSC::SyntaxChecker::operatorStackPop):
2945
fpizlo@apple.com270a7ad2012-08-02 01:28:10 +000029462012-08-01 Filip Pizlo <fpizlo@apple.com>
2947
fpizlo@apple.comcaa68812012-08-02 04:32:30 +00002948 DFG should hoist structure checks
2949 https://bugs.webkit.org/show_bug.cgi?id=92696
2950
2951 Reviewed by Gavin Barraclough.
2952
2953 This hoists structure checks in the same way that we would hoist array checks, but with added
2954 complexity to cope with the fact that the structure of an object may change. This is handled
2955 by performing a side effects analysis over the region in which the respective variable is
2956 live. If a structure clobbering side effect may happen then we either hoist the structure
2957 checks and fall back on structure transition watchpoints (if the watchpoint set is still
2958 valid), or we avoid hoisting altogether.
2959
2960 Doing this required teaching the CFA that we may have an expectation that an object has a
2961 particular structure even after structure clobbering happens, in the sense that structure
2962 proofs that were cobbered can be revived using watchpoints. CFA must know about this so that
2963 OSR entry may know about it, since we cannot allow entry to happen if the variable has a
2964 clobbered structure proof, will have a watchpoint to revive the proof, and the variable in
2965 the baseline JIT has a completely unrelated structure.
2966
2967 This is mostly performance neutral.
2968
2969 * CMakeLists.txt:
2970 * GNUmakefile.list.am:
2971 * JavaScriptCore.xcodeproj/project.pbxproj:
2972 * Target.pri:
2973 * bytecode/ValueRecovery.h:
2974 (JSC::ValueRecovery::isSet):
2975 (JSC::ValueRecovery::operator!):
2976 (ValueRecovery):
2977 * dfg/DFGAbstractState.cpp:
2978 (JSC::DFG::AbstractState::execute):
2979 (JSC::DFG::AbstractState::clobberWorld):
2980 (DFG):
2981 (JSC::DFG::AbstractState::clobberCapturedVars):
2982 * dfg/DFGAbstractState.h:
2983 (AbstractState):
2984 * dfg/DFGAbstractValue.h:
2985 (JSC::DFG::AbstractValue::clear):
2986 (JSC::DFG::AbstractValue::isClear):
2987 (JSC::DFG::AbstractValue::makeTop):
2988 (JSC::DFG::AbstractValue::isTop):
2989 (JSC::DFG::AbstractValue::set):
2990 (JSC::DFG::AbstractValue::operator==):
2991 (JSC::DFG::AbstractValue::merge):
2992 (JSC::DFG::AbstractValue::filter):
2993 (JSC::DFG::AbstractValue::validate):
2994 (JSC::DFG::AbstractValue::validateForEntry):
2995 (AbstractValue):
2996 (JSC::DFG::AbstractValue::checkConsistency):
2997 (JSC::DFG::AbstractValue::dump):
2998 * dfg/DFGByteCodeParser.cpp:
2999 (JSC::DFG::ByteCodeParser::setLocal):
3000 (JSC::DFG::ByteCodeParser::getArgument):
3001 (JSC::DFG::ByteCodeParser::setArgument):
3002 (JSC::DFG::ByteCodeParser::parseBlock):
3003 (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
3004 * dfg/DFGCSEPhase.cpp:
3005 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
3006 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
3007 (JSC::DFG::CSEPhase::putStructureStoreElimination):
3008 (JSC::DFG::CSEPhase::getLocalLoadElimination):
3009 (JSC::DFG::CSEPhase::performNodeCSE):
3010 * dfg/DFGDriver.cpp:
3011 (JSC::DFG::compile):
3012 * dfg/DFGGraph.cpp:
3013 (JSC::DFG::Graph::dump):
3014 * dfg/DFGGraph.h:
3015 (JSC::DFG::Graph::vote):
3016 (Graph):
3017 * dfg/DFGNode.h:
3018 (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
3019 (Node):
3020 (JSC::DFG::Node::hasStructureSet):
3021 * dfg/DFGNodeType.h:
3022 (DFG):
3023 * dfg/DFGOSREntry.cpp:
3024 (JSC::DFG::prepareOSREntry):
3025 * dfg/DFGPredictionPropagationPhase.cpp:
3026 (JSC::DFG::PredictionPropagationPhase::propagate):
3027 (PredictionPropagationPhase):
3028 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
3029 * dfg/DFGSpeculativeJIT.h:
3030 (SpeculativeJIT):
3031 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
3032 (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
3033 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
3034 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
3035 (JSC::DFG::SpeculateCellOperand::gpr):
3036 (SpeculateCellOperand):
3037 * dfg/DFGSpeculativeJIT32_64.cpp:
3038 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3039 (JSC::DFG::SpeculativeJIT::compile):
3040 * dfg/DFGSpeculativeJIT64.cpp:
3041 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3042 (JSC::DFG::SpeculativeJIT::compile):
3043 * dfg/DFGStructureCheckHoistingPhase.cpp: Added.
3044 (DFG):
3045 (StructureCheckHoistingPhase):
3046 (JSC::DFG::StructureCheckHoistingPhase::StructureCheckHoistingPhase):
3047 (JSC::DFG::StructureCheckHoistingPhase::run):
3048 (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
3049 (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
3050 (JSC::DFG::StructureCheckHoistingPhase::clobber):
3051 (CheckData):
3052 (JSC::DFG::StructureCheckHoistingPhase::CheckData::CheckData):
3053 (JSC::DFG::performStructureCheckHoisting):
3054 * dfg/DFGStructureCheckHoistingPhase.h: Added.
3055 (DFG):
3056 * dfg/DFGVariableAccessData.h:
3057 (VariableAccessData):
3058 (JSC::DFG::VariableAccessData::VariableAccessData):
3059 (JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
3060 (JSC::DFG::VariableAccessData::structureCheckHoistingFailed):
3061 (JSC::DFG::VariableAccessData::clearVotes):
3062 (JSC::DFG::VariableAccessData::vote):
3063 (JSC::DFG::VariableAccessData::voteRatio):
3064 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
3065 * runtime/Options.h:
3066 (JSC):
3067
30682012-08-01 Filip Pizlo <fpizlo@apple.com>
3069
fpizlo@apple.com270a7ad2012-08-02 01:28:10 +00003070 DFG should distinguish between PutByVal's that clobber the world and ones that don't
3071 https://bugs.webkit.org/show_bug.cgi?id=92923
3072
3073 Reviewed by Mark Hahnenberg.
3074
3075 This is performance-neutral. I also confirmed that it's neutral if we make the
3076 clobbering variant (PutByValSafe) clobber all knowledge of what is an array,
3077 which should feed nicely into work on removing uses of ClassInfo.
3078
3079 * bytecode/DFGExitProfile.h:
3080 * dfg/DFGAbstractState.cpp:
3081 (JSC::DFG::AbstractState::execute):
3082 * dfg/DFGByteCodeParser.cpp:
3083 (JSC::DFG::ByteCodeParser::parseBlock):
3084 * dfg/DFGCSEPhase.cpp:
3085 (JSC::DFG::CSEPhase::getByValLoadElimination):
3086 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
3087 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
3088 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
3089 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
3090 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
3091 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
3092 (JSC::DFG::CSEPhase::performNodeCSE):
3093 * dfg/DFGFixupPhase.cpp:
3094 (JSC::DFG::FixupPhase::fixupNode):
3095 * dfg/DFGGraph.h:
3096 (JSC::DFG::Graph::byValIsPure):
3097 (JSC::DFG::Graph::clobbersWorld):
3098 * dfg/DFGNodeType.h:
3099 (DFG):
3100 * dfg/DFGPredictionPropagationPhase.cpp:
3101 (JSC::DFG::PredictionPropagationPhase::propagate):
3102 * dfg/DFGSpeculativeJIT32_64.cpp:
3103 (JSC::DFG::SpeculativeJIT::compile):
3104 * dfg/DFGSpeculativeJIT64.cpp:
3105 (JSC::DFG::SpeculativeJIT::compile):
3106
jianli@chromium.orgf66b5812012-08-02 00:14:28 +000031072012-08-01 Jian Li <jianli@chromium.org>
3108
3109 Add new CSS property "-webkit-widget-region" to expose dashboard region support for other port
3110 https://bugs.webkit.org/show_bug.cgi?id=90298
3111
3112 Reviewed by Adam Barth.
3113
3114 * Configurations/FeatureDefines.xcconfig: Add ENABLE_WIDGET_REGION define.
3115
paroga@webkit.orgf3f2e132012-08-01 20:49:26 +000031162012-08-01 Patrick Gansterer <paroga@webkit.org>
3117
3118 Replace WTF::getCurrentLocalTime() with GregorianDateTime::setToCurrentLocalTime()
3119 https://bugs.webkit.org/show_bug.cgi?id=92286
3120
3121 Reviewed by Geoffrey Garen.
3122
3123 Add a method to GregorianDateTime to set its values to the current locale time.
3124 Replacing all occurrences of getCurrentLocalTime with the new function allows
3125 us to remove getCurrentLocalTime in a next step.
3126
3127 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3128
mhahnenberg@apple.comf19f9352012-08-01 19:24:58 +000031292012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
3130
3131 C++ code should get ClassInfo from the Structure
3132 https://bugs.webkit.org/show_bug.cgi?id=92892
3133
3134 Reviewed by Geoffrey Garen.
3135
3136 In our march to remove ClassInfo from our JSCell object headers, we can switch
3137 C++ code over to grabbing the ClassInfo from the Structure since it is finally
3138 safe to do so now that Structure access is safe during finalization/destruction.
3139 The remaining JIT code changes can be done in a separate patch.
3140
3141 * heap/MarkedBlock.cpp:
3142 (JSC::MarkedBlock::callDestructor): We don't want to clear the Structure any more
3143 since the Structure should still be valid at this point.
3144 * heap/WeakSetInlines.h:
3145 (JSC::WeakBlock::finalize): Ditto.
3146 * runtime/JSCell.h:
3147 (JSC):
3148 * runtime/Structure.h:
3149 (JSC::JSCell::classInfo): Move JSCell's classInfo() to Structure.h so it can be
3150 inline. Use a different method of getting the JSCell's Structure based on
3151 whether we're in GC_VALIDATION mode or not, since always using get() will cause
3152 infinite recursion in GC_VALIDATION mode.
3153 (JSC):
3154
mhahnenberg@apple.com42853a62012-08-01 18:55:03 +000031552012-07-31 Mark Hahnenberg <mhahnenberg@apple.com>
3156
3157 MarkedBlock::sweep() should sweep another block if it can't sweep a Structure block
3158 https://bugs.webkit.org/show_bug.cgi?id=92819
3159
3160 Reviewed by Geoffrey Garen.
3161
3162 If we are forced to allocate a new block for Structures because we are unable to safely
3163 sweep our pre-existing Structure blocks, we should sweep another random block so that we
3164 can start sweeping Structure blocks sooner.
3165
3166 * heap/IncrementalSweeper.cpp:
3167 (JSC::IncrementalSweeper::doSweep): Change to use sweepNextBlock.
3168 (JSC):
3169 (JSC::IncrementalSweeper::sweepNextBlock):
3170 * heap/IncrementalSweeper.h:
3171 (IncrementalSweeper):
3172 * heap/MarkedAllocator.cpp:
3173 (JSC::MarkedAllocator::tryAllocateHelper): When we can't safely sweep
3174 our Structure blocks, call sweepNextBlock instead.
3175
weinig@apple.comd824f452012-07-31 23:50:04 +000031762012-07-31 Sam Weinig <sam@webkit.org>
3177
3178 Fix the Windows build.
3179
3180 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3181
ggaren@apple.come0d70122012-07-31 23:46:53 +000031822012-07-31 Geoffrey Garen <ggaren@apple.com>
3183
3184 Maybe fix the GCC build.
3185
3186 * heap/HeapBlock.h:
3187 (HeapBlock): Accommodate incorrect parsing in GCC.
3188
weinig@apple.com329b8062012-07-31 23:24:31 +000031892012-07-31 Sam Weinig <sam@webkit.org>
3190
3191 Stop masking 8 bits off of the visited link hash. We need all the bits!
3192 https://bugs.webkit.org/show_bug.cgi?id=92799
3193
3194 Reviewed by Anders Carlsson.
3195
3196 * runtime/Identifier.cpp:
3197 (JSC::IdentifierCStringTranslator::hash):
3198 (JSC::IdentifierLCharFromUCharTranslator::hash):
3199 * runtime/Identifier.h:
3200 (JSC::IdentifierCharBufferTranslator::hash):
3201 Update for new function names.
3202
ggaren@apple.comc33983c2012-07-31 23:07:46 +000032032012-07-31 Geoffrey Garen <ggaren@apple.com>
3204
3205 Maybe break the Windows build.
3206
3207 Reviewed by Anders Carlsson.
3208
3209 Formally objected to by Sam Weinig.
3210
3211 * heap/HeapBlock.h:
3212 (HeapBlock): Try to slightly improve this because we don't want Windows to control our lives.
3213
mhahnenberg@apple.com59c64f12012-07-31 23:05:12 +000032142012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
3215
3216 Structures should be swept after all other objects
3217 https://bugs.webkit.org/show_bug.cgi?id=92679
3218
3219 Reviewed by Filip Pizlo.
3220
3221 In order to get rid of ClassInfo from our objects, we need to be able to safely get the
3222 ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
3223 Structure, but currently it is not safe to do so because the order of destruction of objects
3224 is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
3225 sweeping Structures after everything else.
3226
3227 * heap/Heap.cpp:
3228 (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
3229 If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
3230 safe to sweep structures since we'll always do Structures last anyways due to the ordering of
3231 MarkedSpace::forEachBlock.
3232 (JSC):
3233 (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
3234 calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
3235 these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
3236 calls during lastChanceToFinalize().
3237 * heap/Heap.h:
3238 (Heap):
3239 * heap/HeapTimer.h:
3240 (HeapTimer):
3241 * heap/IncrementalSweeper.cpp:
3242 (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
3243 This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
3244 the first time.
3245 (JSC):
3246 (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
3247 make our first pass. We now null out the slots as we sweep them so that we can quickly find the
3248 Structures during the second pass.
3249 (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
3250 (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
3251 the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
3252 assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
3253 iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
3254 (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
3255 * heap/IncrementalSweeper.h: Add declarations for new stuff.
3256 (IncrementalSweeper):
3257 * heap/MarkedAllocator.cpp:
3258 (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
3259 if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
3260 the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
3261 will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
3262 Structure garbage.
3263 (JSC::MarkedAllocator::addBlock):
3264 * heap/MarkedAllocator.h:
3265 (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
3266 longer valid to allocate from, so we set the current block to null.
3267 * heap/MarkedBlock.cpp:
3268 (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
3269 at an unsafe time.
3270 * heap/MarkedSpace.cpp:
3271 (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
3272 (JSC):
3273 * heap/MarkedSpace.h:
3274 (JSC):
3275 * runtime/JSGlobalData.cpp:
3276 (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
3277
ggaren@apple.comdd7793a2012-07-31 21:26:38 +000032782012-07-31 Geoffrey Garen <ggaren@apple.com>
3279
ggaren@apple.com0aa5f2a2012-07-31 23:00:53 +00003280 Fix all the other builds I just broke. Maybe fix the Windows build.
3281
3282 * heap/HeapBlock.h:
3283 (HeapBlock): WTF?
3284
32852012-07-31 Geoffrey Garen <ggaren@apple.com>
3286
ggaren@apple.comeff3a062012-07-31 22:27:38 +00003287 Maybe fix the Windows build.
3288
3289 * heap/HeapBlock.h:
3290 (HeapBlock): WTF?
3291
32922012-07-31 Geoffrey Garen <ggaren@apple.com>
3293
ggaren@apple.comc5be1dd2012-07-31 22:59:49 +00003294 Maybe fix the Windows build.
3295
3296 * heap/HeapBlock.h:
3297 (HeapBlock): WTF?
3298
32992012-07-31 Geoffrey Garen <ggaren@apple.com>
3300
ggaren@apple.comdd7793a2012-07-31 21:26:38 +00003301 Removed some public data and casting from the Heap
3302 https://bugs.webkit.org/show_bug.cgi?id=92777
3303
3304 Reviewed by Oliver Hunt.
3305
3306 * heap/BlockAllocator.cpp:
3307 (JSC::BlockAllocator::releaseFreeBlocks):
3308 (JSC::BlockAllocator::blockFreeingThreadMain): Use the DeadBlock class
3309 since HeapBlock is a template, and not a class, now. Call destroy()
3310 instead of monkeying around with DeadBlock's internal data because
3311 encapsulation is good.
3312
3313 * heap/BlockAllocator.h:
3314 (DeadBlock): Added a class to represent a dead block, since HeapBlock is
3315 a template now, and can't be instantiated directly.
3316
3317 (JSC::DeadBlock::DeadBlock):
3318 (JSC::DeadBlock::create):
3319 (BlockAllocator):
3320 (JSC::BlockAllocator::allocate):
3321 (JSC::BlockAllocator::deallocate): Use the DeadBlock class because
3322 encapsulation is good.
3323
3324 * heap/CopiedBlock.h:
3325 (CopiedBlock::destroy): No need for a destroy() function, since we
3326 inherit one now.
3327
3328 (JSC::CopiedBlock::CopiedBlock):
3329 (JSC::CopiedBlock::payloadEnd):
3330 (JSC::CopiedBlock::capacity): Updated for some encapsulation inside
3331 HeapBlock.
3332
3333 * heap/CopiedSpace.cpp:
3334 (JSC::CopiedSpace::~CopiedSpace):
3335 (JSC::CopiedSpace::doneCopying):
3336 (JSC::CopiedSpace::size):
3337 (JSC::CopiedSpace::capacity):
3338 (JSC::isBlockListPagedOut): Removed a bunch of casting. This is no longer
3339 necessary, now that our list and its nodes have the right type.
3340
3341 * heap/CopiedSpace.h: Use the right type in our data structures because
3342 it improves clarity.
3343
3344 * heap/CopiedSpaceInlineMethods.h:
3345 (JSC::CopiedSpace::startedCopying): Use swap to avoid duplicating it.
3346
3347 * heap/HeapBlock.h:
3348 (HeapBlock): Made this a class template so we can return the right type
3349 in linked list operations. Made our data private because encapsulation
3350 is good.
3351
3352 (JSC::HeapBlock::destroy): Since we know our type, we can also eliminate
3353 duplicate destroy() functions in our subclasses.
3354
3355 (JSC::HeapBlock::allocation): Added an accessor so we can hide our data.
3356 By using const, this accessor prevents clients from accidentally deleting
3357 our allocation.
3358
3359 * heap/MarkedAllocator.cpp:
3360 (JSC::MarkedAllocator::isPagedOut):
3361 (JSC::MarkedAllocator::tryAllocateHelper):
3362 (JSC::MarkedAllocator::removeBlock): Removed a bunch of casting. This is
3363 no longer necessary, now that our list and its nodes have the right type.
3364
3365 * heap/MarkedAllocator.h:
3366 (MarkedAllocator):
3367 (JSC::MarkedAllocator::reset):
3368 (JSC::MarkedAllocator::forEachBlock): Use the right type, do less casting.
3369
3370 * heap/MarkedBlock.cpp:
3371 (JSC::MarkedBlock::destroy): Removed this function because our parent
3372 class provides it for us now.
3373
3374 (JSC::MarkedBlock::MarkedBlock):
3375 * heap/MarkedBlock.h:
3376 (MarkedBlock):
3377 (JSC::MarkedBlock::capacity): Updated for encapsulation.
3378
fpizlo@apple.com46e4e4e2012-07-31 18:48:17 +000033792012-07-31 Filip Pizlo <fpizlo@apple.com>
3380
3381 DFG OSR exit profiling has unusual oversights
3382 https://bugs.webkit.org/show_bug.cgi?id=92728
3383
3384 Reviewed by Geoffrey Garen.
3385
3386 * dfg/DFGOSRExit.cpp:
3387 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
3388 * dfg/DFGSpeculativeJIT.h:
3389 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
3390 * dfg/DFGSpeculativeJIT32_64.cpp:
3391 (JSC::DFG::SpeculativeJIT::compile):
3392 * dfg/DFGSpeculativeJIT64.cpp:
3393 (JSC::DFG::SpeculativeJIT::compile):
3394
commit-queue@webkit.orge03e44a2012-07-31 18:44:03 +000033952012-07-31 Chao-ying Fu <fu@mips.com>
3396
3397 Add MIPS add32 function
3398 https://bugs.webkit.org/show_bug.cgi?id=91522
3399
3400 Reviewed by Oliver Hunt.
3401
3402 Add isCompactPtrAlignedAddressOffset.
3403 Add a new version of add32 that accepts AbsoluteAddress as inputs.
3404
3405 * assembler/MacroAssemblerMIPS.h:
3406 (JSC::MacroAssemblerMIPS::isCompactPtrAlignedAddressOffset): New.
3407 (MacroAssemblerMIPS):
3408 (JSC::MacroAssemblerMIPS::add32): Support AbsoluteAddress as inputs.
3409
commit-queue@webkit.org764c9fb2012-07-31 01:48:18 +000034102012-07-30 Sheriff Bot <webkit.review.bot@gmail.com>
3411
3412 Unreviewed, rolling out r124123.
3413 http://trac.webkit.org/changeset/124123
3414 https://bugs.webkit.org/show_bug.cgi?id=92700
3415
3416 ASSERT crashes terminate webkit Layout tests (Requested by
3417 msaboff on #webkit).
3418
3419 * heap/Heap.cpp:
3420 * heap/Heap.h:
3421 (Heap):
3422 * heap/IncrementalSweeper.cpp:
3423 (JSC::IncrementalSweeper::doSweep):
3424 (JSC::IncrementalSweeper::startSweeping):
3425 (JSC::IncrementalSweeper::IncrementalSweeper):
3426 (JSC):
3427 * heap/IncrementalSweeper.h:
3428 (IncrementalSweeper):
3429 * heap/MarkedAllocator.cpp:
3430 (JSC::MarkedAllocator::tryAllocateHelper):
3431 (JSC::MarkedAllocator::addBlock):
3432 * heap/MarkedAllocator.h:
3433 (JSC::MarkedAllocator::zapFreeList):
3434 * heap/MarkedBlock.cpp:
3435 (JSC::MarkedBlock::sweepHelper):
3436 * heap/MarkedSpace.cpp:
3437 * heap/MarkedSpace.h:
3438 (JSC::MarkedSpace::sweep):
3439 (JSC):
3440 * runtime/JSGlobalData.cpp:
3441 (JSC::JSGlobalData::~JSGlobalData):
3442
mhahnenberg@apple.com3c1699e2012-07-31 00:33:53 +000034432012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
3444
3445 Structures should be swept after all other objects
3446 https://bugs.webkit.org/show_bug.cgi?id=92679
3447
3448 Reviewed by Filip Pizlo.
3449
3450 In order to get rid of ClassInfo from our objects, we need to be able to safely get the
3451 ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
3452 Structure, but currently it is not safe to do so because the order of destruction of objects
3453 is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
3454 sweeping Structures after everything else.
3455
3456 * heap/Heap.cpp:
3457 (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
3458 If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
3459 safe to sweep structures since we'll always do Structures last anyways due to the ordering of
3460 MarkedSpace::forEachBlock.
3461 (JSC):
3462 (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
3463 calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
3464 these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
3465 calls during lastChanceToFinalize().
3466 * heap/Heap.h:
3467 (Heap):
3468 * heap/HeapTimer.h:
3469 (HeapTimer):
3470 * heap/IncrementalSweeper.cpp:
3471 (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
3472 This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
3473 the first time.
3474 (JSC):
3475 (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
3476 make our first pass. We now null out the slots as we sweep them so that we can quickly find the
3477 Structures during the second pass.
3478 (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
3479 (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
3480 the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
3481 assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
3482 iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
3483 (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
3484 * heap/IncrementalSweeper.h: Add declarations for new stuff.
3485 (IncrementalSweeper):
3486 * heap/MarkedAllocator.cpp:
3487 (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
3488 if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
3489 the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
3490 will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
3491 Structure garbage.
3492 (JSC::MarkedAllocator::addBlock):
3493 * heap/MarkedAllocator.h:
3494 (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
3495 longer valid to allocate from, so we set the current block to null.
3496 * heap/MarkedBlock.cpp:
3497 (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
3498 at an unsafe time.
3499 * heap/MarkedSpace.cpp:
3500 (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
3501 (JSC):
3502 * heap/MarkedSpace.h:
3503 (JSC):
3504 * runtime/JSGlobalData.cpp:
3505 (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
3506
fpizlo@apple.com7cc53e02012-07-29 23:15:30 +000035072012-07-29 Filip Pizlo <fpizlo@apple.com>
3508
3509 PropertyNameArray::m_shouldCache is only assigned and never used
3510 https://bugs.webkit.org/show_bug.cgi?id=92598
3511
3512 Reviewed by Dan Bernstein.
3513
3514 * runtime/PropertyNameArray.h:
3515 (JSC::PropertyNameArray::PropertyNameArray):
3516 (PropertyNameArray):
3517
commit-queue@webkit.orgc1c4f122012-07-29 21:59:53 +000035182012-07-29 Rik Cabanier <cabanier@adobe.com>
3519
3520 Add ENABLE_CSS_COMPOSITING flag
3521 https://bugs.webkit.org/show_bug.cgi?id=92553
3522
3523 Reviewed by Dirk Schulze.
3524
3525 Adds compiler flag CSS_COMPOSITING to build systems to enable CSS blending and compositing. See spec https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html
3526
3527 * Configurations/FeatureDefines.xcconfig:
3528
mhahnenberg@apple.comaa1f4ec2012-07-27 19:29:03 +000035292012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
3530
mhahnenberg@apple.com7f5b9592012-07-27 22:59:14 +00003531 Split functionality of MarkedAllocator::m_currentBlock
3532 https://bugs.webkit.org/show_bug.cgi?id=92550
3533
3534 Reviewed by Filip Pizlo.
3535
3536 MarkedAllocator::m_currentBlock serves two purposes right now; it indicates the block that is currently
3537 being used for allocation and the beginning of the list of blocks that need to be swept. We should split
3538 these two functionalities into two separate fields.
3539
3540 * heap/MarkedAllocator.cpp:
3541 (JSC::MarkedAllocator::tryAllocateHelper): Use m_blocksToSweep instead of m_currentBlock as the
3542 initializer/reference of the loop. Only change m_currentBlock when we know what the result will be.
3543 (JSC::MarkedAllocator::addBlock): When we add a new block we know that both m_blocksToSweep and
3544 m_currentBlock are null. In order to preserve the invariant that m_currentBlock <= m_blocksToSweep,
3545 we assign both of them to point to the new block.
3546 (JSC::MarkedAllocator::removeBlock): We need a separate check to see if the block we're removing is
3547 m_blocksToSweep and if so, advance it to the next block in the list.
3548 * heap/MarkedAllocator.h:
3549 (MarkedAllocator): Initialize m_blocksToSweep.
3550 (JSC::MarkedAllocator::MarkedAllocator):
3551 (JSC::MarkedAllocator::reset): We set m_blocksToSweep to be the head of our list. This function is called
3552 at the end of a collection, so all of the blocks in our allocator need to be swept. We need to sweep a
3553 block before we can start allocating, so m_currentBlock is set to null. We also set the freeList to
3554 the empty FreeList to emphasize the fact that we can't start allocating until we do some sweeping.
3555
35562012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
3557
mhahnenberg@apple.comaa1f4ec2012-07-27 19:29:03 +00003558 Increase inline storage for JSFinalObjects by one
3559 https://bugs.webkit.org/show_bug.cgi?id=92526
3560
3561 Reviewed by Geoffrey Garen.
3562
3563 Now that we've removed the inheritorID from objects, we can increase our inline storage for JSFinalObjects on
3564 64-bit platforms by 1.
3565
3566 * llint/LowLevelInterpreter.asm: Change the constant.
3567 * runtime/PropertyOffset.h: Change the constant.
3568 (JSC):
3569
jer.noble@apple.com50ecb282012-07-27 16:31:07 +000035702012-07-27 Jer Noble <jer.noble@apple.com>
3571
3572 Support a rational time class for use by media elements.
3573 https://bugs.webkit.org/show_bug.cgi?id=88787
3574
3575 Re-export WTF::MediaTime from JavaScriptCore.
3576
3577 Reviewed by Eric Carlson.
3578
3579 * JavaScriptCore.order:
3580 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3581
fpizlo@apple.comd510fc22012-07-27 00:11:44 +000035822012-07-26 Filip Pizlo <fpizlo@apple.com>
3583
3584 JSObject::reallocateStorageIfNecessary is neither used nor defined
3585 https://bugs.webkit.org/show_bug.cgi?id=92417
3586
3587 Reviewed by Mark Rowe.
3588
3589 * runtime/JSObject.h:
3590 (JSObject):
3591
mhahnenberg@apple.comb44a7f02012-07-26 23:27:53 +000035922012-07-26 Mark Hahnenberg <mhahnenberg@apple.com>
3593
3594 Allocate Structures in a separate part of the Heap
3595 https://bugs.webkit.org/show_bug.cgi?id=92420
3596
3597 Reviewed by Filip Pizlo.
3598
3599 To fix our issue with destruction/finalization of Structures before their objects, we can move Structures to a separate
3600 part of the Heap that will be swept after all other objects. This first patch will just be separating Structures
3601 out into their own separate MarkedAllocator. Everything else will behave identically.
3602
3603 * heap/Heap.h: New function to allocate Structures in the Heap.
3604 (Heap):
3605 (JSC):
3606 (JSC::Heap::allocateStructure):
3607 * heap/MarkedAllocator.cpp: Pass whether or not we're allocated Structures to the MarkedBlock.
3608 (JSC::MarkedAllocator::allocateBlock):
3609 * heap/MarkedAllocator.h: Add tracking for whether or not we're allocating only Structures.
3610 (JSC::MarkedAllocator::onlyContainsStructures):
3611 (MarkedAllocator):
3612 (JSC::MarkedAllocator::MarkedAllocator):
3613 (JSC::MarkedAllocator::init):
3614 * heap/MarkedBlock.cpp: Add tracking for whether or not we're allocating only Structures. We need this to be able to
3615 distinguish the various MarkedBlock types in MarkedSpace::allocatorFor(MarkedBlock*).
3616 (JSC::MarkedBlock::create):
3617 (JSC::MarkedBlock::MarkedBlock):
3618 * heap/MarkedBlock.h:
3619 (MarkedBlock):
3620 (JSC::MarkedBlock::onlyContainsStructures):
3621 (JSC):
3622 * heap/MarkedSpace.cpp: Include the new Structure allocator in all the places that all the other allocators are used/modified.
3623 (JSC::MarkedSpace::MarkedSpace):
3624 (JSC::MarkedSpace::resetAllocators):
3625 (JSC::MarkedSpace::canonicalizeCellLivenessData):
3626 (JSC::MarkedSpace::isPagedOut):
3627 * heap/MarkedSpace.h: Add new MarkedAllocator just for Structures.
3628 (MarkedSpace):
3629 (JSC::MarkedSpace::allocatorFor):
3630 (JSC::MarkedSpace::allocateStructure):
3631 (JSC):
3632 (JSC::MarkedSpace::forEachBlock):
3633 * runtime/Structure.h: Move all of the functions that call allocateCell<Structure> down below the explicit template specialization
3634 for allocateCell<Structure>. The new inline specialization for allocateCell directly calls the allocateStructure() function in the
3635 Heap.
3636 (Structure):
3637 (JSC::Structure):
3638 (JSC):
3639 (JSC::Structure::create):
3640 (JSC::Structure::createStructure):
3641
fpizlo@apple.com2b1d81e2012-07-26 23:01:05 +000036422012-07-26 Filip Pizlo <fpizlo@apple.com>
3643
3644 JSArray has methods that are neither used nor defined
3645 https://bugs.webkit.org/show_bug.cgi?id=92416
3646
3647 Reviewed by Simon Fraser.
3648
3649 * runtime/JSArray.h:
3650 (JSArray):
3651
zherczeg@webkit.org4a637582012-07-26 12:29:10 +000036522012-07-26 Zoltan Herczeg <zherczeg@webkit.org>
3653
3654 [Qt][ARM]ARMAssembler needs buildfix afert r123417
3655 https://bugs.webkit.org/show_bug.cgi?id=92086
3656
3657 Reviewed by Csaba Osztrogonác.
3658
3659 The ARM implementation of this should be optimized code path
3660 is covered by a non-optimized code path. This patch fixes this,
3661 and adds a new function which returns with the offset range.
3662
3663 * assembler/ARMAssembler.h:
3664 (JSC::ARMAssembler::readPointer):
3665 (ARMAssembler):
3666 (JSC::ARMAssembler::repatchInt32):
3667 (JSC::ARMAssembler::repatchCompact):
3668 * assembler/MacroAssemblerARM.h:
3669 (MacroAssemblerARM):
3670 (JSC::MacroAssemblerARM::isCompactPtrAlignedAddressOffset):
3671 (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
3672
mhahnenberg@apple.com9a75d6f2012-07-26 06:06:25 +000036732012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
3674
3675 Build fix for 32-bit after r123682
3676
3677 * runtime/JSObject.h: Need to pad out JSObjects on 32-bit so that they're the correct size since
3678 we only removed one 4-byte word and we need to be 8-byte aligned.
3679 (JSObject):
3680
fpizlo@apple.com338a70dc2012-07-26 01:22:59 +000036812012-07-25 Filip Pizlo <fpizlo@apple.com>
3682
3683 JSC GC object copying APIs should allow for greater flexibility
3684 https://bugs.webkit.org/show_bug.cgi?id=92316
3685
3686 Reviewed by Mark Hahnenberg.
3687
3688 It's now the case that visitChildren() methods can directly pin and allocate in new space during copying.
3689 They can also do the copying and marking themselves. This new API is only used for JSObjects for now.
3690
3691 * JavaScriptCore.xcodeproj/project.pbxproj:
3692 * heap/MarkStack.cpp:
3693 (JSC::SlotVisitor::allocateNewSpaceSlow):
3694 (JSC::SlotVisitor::allocateNewSpaceOrPin):
3695 (JSC):
3696 (JSC::SlotVisitor::copyAndAppend):
3697 * heap/MarkStack.h:
3698 (MarkStack):
3699 (JSC::MarkStack::appendUnbarrieredValue):
3700 (JSC):
3701 * heap/SlotVisitor.h:
3702 * heap/SlotVisitorInlineMethods.h: Added.
3703 (JSC):
3704 (JSC::SlotVisitor::checkIfShouldCopyAndPinOtherwise):
3705 (JSC::SlotVisitor::allocateNewSpace):
3706 * runtime/JSObject.cpp:
3707 (JSC::JSObject::visitOutOfLineStorage):
3708 (JSC):
3709 (JSC::JSObject::visitChildren):
3710 (JSC::JSFinalObject::visitChildren):
3711 * runtime/JSObject.h:
3712 (JSObject):
3713
mhahnenberg@apple.com0e8fce12012-07-26 00:12:58 +000037142012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
3715
3716 Remove JSObject::m_inheritorID
3717 https://bugs.webkit.org/show_bug.cgi?id=88378
3718
3719 Reviewed by Filip Pizlo.
3720
3721 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
3722 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
3723 Instead use a private named value in the object's property storage.
3724
3725 * dfg/DFGSpeculativeJIT.h:
3726 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
3727 * jit/JITInlineMethods.h:
3728 (JSC::JIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
3729 * llint/LowLevelInterpreter.asm: No need m_inheritorID to initialize!
3730 * runtime/JSGlobalData.h:
3731 (JSGlobalData): Added private name 'm_inheritorIDKey'.
3732 * runtime/JSGlobalThis.cpp:
3733 (JSC::JSGlobalThis::setUnwrappedObject): resetInheritorID is now passed a JSGlobalData&.
3734 * runtime/JSObject.cpp:
3735 (JSC::JSObject::visitChildren): No m_inheritorID to be marked.
3736 (JSC::JSFinalObject::visitChildren): No m_inheritorID to be marked.
3737 (JSC::JSObject::createInheritorID): Store the newly created inheritorID in the property map. Make sure
3738 it's got the DontEnum attribute!!
3739 * runtime/JSObject.h:
3740 (JSObject):
3741 (JSC::JSObject::resetInheritorID): Remove the inheritorID from property storage.
3742 (JSC):
3743 (JSC::JSObject::inheritorID): Read the inheritorID from property storage.
3744
caio.oliveira@openbossa.org947a2282012-07-25 22:15:05 +000037452012-07-25 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
3746
3747 Create a specialized pair for use in HashMap iterators
3748 https://bugs.webkit.org/show_bug.cgi?id=92137
3749
3750 Reviewed by Ryosuke Niwa.
3751
3752 Update a couple of sites that relied on the fact that "contents" of iterators were
3753 std::pairs.
3754
3755 * profiler/Profile.cpp:
3756 (JSC): This code kept a vector of the pairs that were the "contents" of the iterators. This
3757 is changed to use a KeyValuePair. We make use HashCount's ValueType (which represents only
3758 the key) to get the proper key parameter for KeyValuePair.
3759 * tools/ProfileTreeNode.h:
3760 (ProfileTreeNode): Use HashMap::ValueType to declare the type of the contents of the hash
3761 instead of declaring it manually. This will make use of the new KeyValuePair.
3762
paroga@webkit.orgcf6740e2012-07-25 07:42:03 +000037632012-07-25 Patrick Gansterer <paroga@webkit.org>
3764
3765 REGRESSION(r123505): Date.getYear() returns the same as Date.getFullYear()
3766 https://bugs.webkit.org/show_bug.cgi?id=92218
3767
3768 Reviewed by Csaba Osztrogonác.
3769
3770 * runtime/DatePrototype.cpp:
3771 (JSC::dateProtoFuncGetYear): Added the missing offset of 1900 to the return value.
3772
fpizlo@apple.coma7f7dcd2012-07-24 19:47:18 +000037732012-07-24 Filip Pizlo <fpizlo@apple.com>
3774
3775 REGRESSION(r123417): It made tests assert/crash on 32 bit
3776 https://bugs.webkit.org/show_bug.cgi?id=92088
3777
3778 Reviewed by Mark Hahnenberg.
3779
3780 The pointer arithmetic was wrong, because negative numbers are hard to think about.
3781
3782 * dfg/DFGRepatch.cpp:
3783 (JSC::DFG::emitPutTransitionStub):
3784 * dfg/DFGSpeculativeJIT.cpp:
3785 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3786
paroga@webkit.orgf2de22c2012-07-24 19:03:57 +000037872012-07-24 Patrick Gansterer <paroga@webkit.org>
3788
paroga@webkit.org683889f2012-07-24 19:25:30 +00003789 Store the full year in GregorianDateTime
3790 https://bugs.webkit.org/show_bug.cgi?id=92067
3791
3792 Reviewed by Geoffrey Garen.
3793
3794 Use the full year instead of the offset from year 1900
3795 for the year member variable of GregorianDateTime.
3796
3797 * runtime/DateConstructor.cpp:
3798 (JSC::constructDate):
3799 (JSC::dateUTC):
3800 * runtime/DateConversion.cpp:
3801 (JSC::formatDate):
3802 (JSC::formatDateUTCVariant):
3803 * runtime/DatePrototype.cpp:
3804 (JSC::formatLocaleDate):
3805 (JSC::fillStructuresUsingDateArgs):
3806 (JSC::dateProtoFuncToISOString):
3807 (JSC::dateProtoFuncGetFullYear):
3808 (JSC::dateProtoFuncGetUTCFullYear):
3809 (JSC::dateProtoFuncSetYear):
3810 * runtime/JSDateMath.cpp:
3811 (JSC::gregorianDateTimeToMS):
3812 (JSC::msToGregorianDateTime):
3813
38142012-07-24 Patrick Gansterer <paroga@webkit.org>
3815
paroga@webkit.orgf2de22c2012-07-24 19:03:57 +00003816 [WIN] Build fix after r123417.
3817
3818 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3819
paroga@webkit.org175d46f2012-07-24 05:19:55 +000038202012-07-23 Patrick Gansterer <paroga@webkit.org>
3821
3822 Move GregorianDateTime from JSC to WTF namespace
3823 https://bugs.webkit.org/show_bug.cgi?id=91948
3824
3825 Reviewed by Geoffrey Garen.
3826
3827 Moving GregorianDateTime into the WTF namespace allows us to us to
3828 use it in WebCore too. The new class has the same behaviour as the
3829 old struct. Only the unused timeZone member has been removed.
3830
3831 * runtime/DateConstructor.cpp:
3832 * runtime/DateConversion.cpp:
3833 * runtime/DateConversion.h:
3834 * runtime/DateInstance.h:
3835 * runtime/DatePrototype.cpp:
3836 * runtime/JSDateMath.cpp:
3837 * runtime/JSDateMath.h:
3838
fpizlo@apple.com94a9c102012-07-23 22:38:30 +000038392012-07-23 Filip Pizlo <fpizlo@apple.com>
3840
fpizlo@apple.com961a9562012-07-24 02:13:19 +00003841 Property storage should grow in reverse address direction, to support butterflies
3842 https://bugs.webkit.org/show_bug.cgi?id=91788
3843
3844 Reviewed by Geoffrey Garen.
3845
3846 Changes property storage to grow to the left, and changes the property storage pointer to point
3847 one 8-byte word (i.e. JSValue) to the right of the first value in the storage.
3848
3849 Also improved debug support somewhat, by adding a describe() function to the jsc command-line,
3850 and a slow mode of object access in LLInt.
3851
3852 * assembler/ARMv7Assembler.h:
3853 (JSC::ARMv7Assembler::repatchCompact):
3854 * assembler/MacroAssemblerARMv7.h:
3855 (MacroAssemblerARMv7):
3856 (JSC::MacroAssemblerARMv7::isCompactPtrAlignedAddressOffset):
3857 (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
3858 * assembler/MacroAssemblerX86Common.h:
3859 (JSC::MacroAssemblerX86Common::isCompactPtrAlignedAddressOffset):
3860 (JSC::MacroAssemblerX86Common::repatchCompact):
3861 * assembler/X86Assembler.h:
3862 (JSC::X86Assembler::repatchCompact):
3863 * bytecode/CodeBlock.cpp:
3864 (JSC::dumpStructure):
3865 * bytecode/GetByIdStatus.h:
3866 (JSC::GetByIdStatus::GetByIdStatus):
3867 * dfg/DFGOperations.cpp:
3868 * dfg/DFGOperations.h:
3869 * dfg/DFGRepatch.cpp:
3870 (JSC::DFG::tryCacheGetByID):
3871 (JSC::DFG::emitPutTransitionStub):
3872 * dfg/DFGSpeculativeJIT.cpp:
3873 (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
3874 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3875 * dfg/DFGSpeculativeJIT.h:
3876 (JSC::DFG::SpeculativeJIT::callOperation):
3877 * dfg/DFGSpeculativeJIT32_64.cpp:
3878 (JSC::DFG::SpeculativeJIT::compile):
3879 * dfg/DFGSpeculativeJIT64.cpp:
3880 (JSC::DFG::SpeculativeJIT::compile):
3881 * heap/ConservativeRoots.cpp:
3882 (JSC::ConservativeRoots::genericAddPointer):
3883 * heap/CopiedSpace.h:
3884 (CopiedSpace):
3885 * heap/CopiedSpaceInlineMethods.h:
3886 (JSC::CopiedSpace::pinIfNecessary):
3887 (JSC):
3888 * jit/JITPropertyAccess.cpp:
3889 (JSC::JIT::compileGetDirectOffset):
3890 * jit/JITPropertyAccess32_64.cpp:
3891 (JSC::JIT::compileGetDirectOffset):
3892 * jit/JITStubs.cpp:
3893 (JSC::JITThunks::tryCacheGetByID):
3894 * jsc.cpp:
3895 (GlobalObject::finishCreation):
3896 (functionDescribe):
3897 * llint/LLIntCommon.h:
3898 * llint/LLIntSlowPaths.cpp:
3899 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
3900 * llint/LowLevelInterpreter32_64.asm:
3901 * llint/LowLevelInterpreter64.asm:
3902 * runtime/JSObject.cpp:
3903 (JSC::JSObject::visitChildren):
3904 (JSC::JSFinalObject::visitChildren):
3905 (JSC::JSObject::growOutOfLineStorage):
3906 * runtime/JSObject.h:
3907 (JSC::JSObject::getDirectLocation):
3908 (JSC::JSObject::offsetForLocation):
3909 * runtime/JSValue.h:
3910 (JSValue):
3911 * runtime/PropertyOffset.h:
3912 (JSC::offsetInOutOfLineStorage):
3913
39142012-07-23 Filip Pizlo <fpizlo@apple.com>
3915
fpizlo@apple.com5128a712012-07-23 22:46:14 +00003916 DFG is too aggressive in performing the specific value optimization on loads
3917 https://bugs.webkit.org/show_bug.cgi?id=92034
3918
3919 Reviewed by Mark Hahnenberg.
3920
3921 This ensures that we don't do optimizations based on a structure having a specific
3922 value, if there is no way to detect that the value is despecified. This is the
3923 case for dictionaries, since despecifying a value in a dictionary does not lead to
3924 a transition and so cannot be caught by either structure checks or structure
3925 transition watchpoints.
3926
3927 * bytecode/GetByIdStatus.cpp:
3928 (JSC::GetByIdStatus::computeFromLLInt):
3929 (JSC::GetByIdStatus::computeForChain):
3930 (JSC::GetByIdStatus::computeFor):
3931 * bytecode/ResolveGlobalStatus.cpp:
3932 (JSC::computeForStructure):
3933
39342012-07-23 Filip Pizlo <fpizlo@apple.com>
3935
fpizlo@apple.com94a9c102012-07-23 22:38:30 +00003936 REGRESSION(r123169): It made fast/js/dfg-inline-arguments-use-from-uninlined-code.html fail on 32 bit platforms
3937 https://bugs.webkit.org/show_bug.cgi?id=92002
3938
3939 Reviewed by Mark Hahnenberg.
3940
3941 In the process of changing the nature of local variable typing, I forgot to modify one of the places where
3942 we glue the DFG's notion of variable prediction to the runtime's notion of variable tagging.
3943
3944 * dfg/DFGSpeculativeJIT.cpp:
3945 (JSC::DFG::SpeculativeJIT::compile):
3946
simon.fraser@apple.com8b810602012-07-23 21:03:45 +000039472012-07-23 Simon Fraser <simon.fraser@apple.com>
3948
3949 Part 2 of: Implement sticky positioning
3950 https://bugs.webkit.org/show_bug.cgi?id=90046
3951
3952 Reviewed by Ojan Vafai.
3953
3954 Turn on ENABLE_CSS_STICKY_POSITION.
3955
3956 * Configurations/FeatureDefines.xcconfig:
3957
paroga@webkit.orgf4635662012-07-23 20:53:35 +000039582012-07-23 Patrick Gansterer <paroga@webkit.org>
3959
3960 Move JSC::parseDate() from DateConversion to JSDateMath
3961 https://bugs.webkit.org/show_bug.cgi?id=91982
3962
3963 Reviewed by Geoffrey Garen.
3964
3965 Moveing this function into the other files removes the dependency
3966 on JSC spcific classes in DateConversion.{cpp|h}.
3967
3968 * runtime/DateConversion.cpp:
3969 * runtime/DateConversion.h:
3970 (JSC):
3971 * runtime/JSDateMath.cpp:
3972 (JSC::parseDate):
3973 (JSC):
3974 * runtime/JSDateMath.h:
3975 (JSC):
3976
simon.fraser@apple.com5cc8c732012-07-23 17:45:43 +000039772012-07-23 Simon Fraser <simon.fraser@apple.com>
3978
3979 Part 1 of: Implement sticky positioning
3980 https://bugs.webkit.org/show_bug.cgi?id=90046
3981
3982 Reviewed by Ojan Vafai.
3983
3984 Add ENABLE_CSS_STICKY_POSITION, defaulting to off initially.
3985
3986 Sort the ENABLE_CSS lines in the file. Make sure all the flags
3987 are in FEATURE_DEFINES.
3988
3989 * Configurations/FeatureDefines.xcconfig:
3990
commit-queue@webkit.org1f562642012-07-23 15:49:29 +000039912012-07-23 Yong Li <yoli@rim.com>
3992
3993 [BlackBerry] Implement GCActivityCallback with platform timer
3994 https://bugs.webkit.org/show_bug.cgi?id=90175
3995
3996 Reviewed by Rob Buis.
3997
3998 Use JSLock when performing GC to avoid assertions.
3999
4000 * runtime/GCActivityCallbackBlackBerry.cpp:
4001 (JSC::DefaultGCActivityCallback::doWork):
4002
tkent@chromium.orgd89d5452012-07-22 23:23:53 +000040032012-07-23 Kent Tamura <tkent@chromium.org>
4004
4005 Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
4006 https://bugs.webkit.org/show_bug.cgi?id=91941
4007
4008 Reviewed by Kentaro Hara.
4009
4010 A flag name for an elmement should be ENABLE_*_ELEMENT.
4011
4012 * Configurations/FeatureDefines.xcconfig:
4013
tkent@chromium.org43921e62012-07-22 10:59:32 +000040142012-07-22 Kent Tamura <tkent@chromium.org>
4015
4016 Rename ENABLE_DETAILS to ENABLE_DETAILS_ELEMENT
4017 https://bugs.webkit.org/show_bug.cgi?id=91928
4018
4019 Reviewed by Kentaro Hara.
4020
4021 A flag name for an elmement should be ENABLE_*_ELEMENT.
4022
4023 * Configurations/FeatureDefines.xcconfig:
4024
paroga@webkit.org6a026682012-07-21 21:22:28 +000040252012-07-21 Patrick Gansterer <paroga@webkit.org>
4026
4027 [WIN] Use GetDateFormat and GetTimeFormat instead of strftime
4028 https://bugs.webkit.org/show_bug.cgi?id=83436
4029
4030 Reviewed by Brent Fulgham.
4031
4032 The MS CRT implementation of strftime calls the same two functions.
4033 Using them directly avoids the overhead of parsing the format string and removes
4034 the dependency on strftime() for WinCE where this function does not exist.
4035
4036 * runtime/DatePrototype.cpp:
4037 (JSC::formatLocaleDate):
4038
tkent@chromium.org3d897372012-07-21 02:00:46 +000040392012-07-20 Kent Tamura <tkent@chromium.org>
4040
4041 Rename ENABLE_DATALIST to ENABLE_DATALIST_ELEMENT
4042 https://bugs.webkit.org/show_bug.cgi?id=91846
4043
4044 Reviewed by Kentaro Hara.
4045
4046 A flag name for an elmement should be ENABLE_*_ELEMENT.
4047
4048 * Configurations/FeatureDefines.xcconfig:
4049
commit-queue@webkit.org68c202c2012-07-20 20:09:02 +000040502012-07-20 Han Shen <shenhan@google.com>
4051
4052 [Chromium] Compilation fails under gcc 4.7
4053 https://bugs.webkit.org/show_bug.cgi?id=90227
4054
4055 Reviewed by Tony Chang.
4056
4057 Disable warnings about c++0x compatibility in gcc newer than 4.6.
4058
4059 * JavaScriptCore.gyp/JavaScriptCore.gyp:
4060
fpizlo@apple.com00528432012-07-20 03:50:02 +000040612012-07-18 Filip Pizlo <fpizlo@apple.com>
4062
4063 DFG cell checks should be hoisted
4064 https://bugs.webkit.org/show_bug.cgi?id=91717
4065
4066 Reviewed by Geoffrey Garen.
4067
4068 The DFG has always had the policy of hoisting array and integer checks to
4069 the point of variable assignment. Eventually, we added doubles and booleans
4070 to the mix. But cells should really be part of this as well, particularly
4071 for 32-bit where accessing a known-type variable is dramatically cheaper
4072 than accessing a variable whose types is only predicted but otherwise
4073 unproven.
4074
4075 This appears to be a definite speed-up for V8 on 32-bit, a possible speed-up
4076 for Kraken, and a possible slow-down for V8 on 64-bit (around 0.2% if at
4077 all). Any slow-downs can, and should, be addressed by making the hoisting
4078 logic cognizant of variables that are never used in a manner that requires
4079 type checks, and by sinking argument checks to the point(s) of first use.
4080
4081 To make this work I had to change some OSR machinery, and special-case the
4082 type predictions of the 'this' argument for constructors. OSR exit normally
4083 assumes that arguments are boxed, which happens to be true because the
4084 type prediction used for check hoisting is LUB'd with the type of the
4085 argument that was passed in - so either the arguments are always stored to
4086 with the full tag+payload, or if only the payload is stored then the tag
4087 matches whatever the caller would have set. But not so with the 'this'
4088 argument for constructors, which is not initialized by the caller. We
4089 could make this more precise by having argument types for OSR be inferred
4090 using similar machinery to other locals, but I figured that for this patch
4091 I should use the surgical fix.
4092
4093 * assembler/MacroAssemblerX86_64.h:
4094 (JSC::MacroAssemblerX86_64::branchTestPtr):
4095 (MacroAssemblerX86_64):
4096 * assembler/X86Assembler.h:
4097 (JSC::X86Assembler::testq_rm):
4098 (X86Assembler):
4099 * dfg/DFGAbstractState.cpp:
4100 (JSC::DFG::AbstractState::initialize):
4101 (JSC::DFG::AbstractState::execute):
4102 * dfg/DFGDriver.cpp:
4103 (JSC::DFG::compile):
4104 * dfg/DFGGraph.h:
4105 (JSC::DFG::Graph::isCreatedThisArgument):
4106 (Graph):
4107 * dfg/DFGSpeculativeJIT.cpp:
4108 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
4109 * dfg/DFGSpeculativeJIT32_64.cpp:
4110 (JSC::DFG::SpeculativeJIT::compile):
4111 * dfg/DFGSpeculativeJIT64.cpp:
4112 (JSC::DFG::SpeculativeJIT::compile):
4113 * dfg/DFGValueSource.h:
4114 (JSC::DFG::ValueSource::forSpeculation):
4115
fpizlo@apple.com26e27a62012-07-20 00:04:51 +000041162012-07-19 Filip Pizlo <fpizlo@apple.com>
4117
4118 Fast path of storage resize should be removed from property storage reallocation, since it is only useful for arrays
4119 https://bugs.webkit.org/show_bug.cgi?id=91796
4120
4121 Reviewed by Geoffrey Garen.
4122
4123 * dfg/DFGRepatch.cpp:
4124 (JSC::DFG::emitPutTransitionStub):
4125 * dfg/DFGSpeculativeJIT.cpp:
4126 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
4127 * runtime/JSObject.cpp:
4128 (JSC::JSObject::growOutOfLineStorage):
4129
commit-queue@webkit.orge602eca2012-07-19 20:53:22 +000041302012-07-19 Mark Lam <mark.lam@apple.com>
4131
4132 Bug fixes and enhancements for OfflineASM annotation system.
4133 https://bugs.webkit.org/show_bug.cgi?id=91690
4134
4135 Reviewed by Filip Pizlo.
4136
4137 * offlineasm/armv7.rb: added default handling of Instruction lower().
4138 * offlineasm/asm.rb: added more support for annotations and more pretty printing.
4139 * offlineasm/ast.rb: added more support for annotations.
4140 * offlineasm/config.rb: added $preferredCommentStartColumn, simplified $enableInstrAnnotations.
4141 * offlineasm/parser.rb: added more support for annotations.
4142 * offlineasm/transform.rb: added more support for annotations.
4143 * offlineasm/x86.rb: added default handling of Instruction lower().
4144
paroga@webkit.orgcb7c1a12012-07-19 18:20:53 +000041452012-07-19 Patrick Gansterer <paroga@webkit.org>
4146
4147 [WIN] Fix compilation of JSGlobalData.h with ENABLE(DFG_JIT)
4148 https://bugs.webkit.org/show_bug.cgi?id=91243
4149
4150 Reviewed by Geoffrey Garen.
4151
4152 Disable MSVC warning 4200 "zero-sized array in struct/union" for JSC::ScratchBuffer.
4153
4154 * runtime/JSGlobalData.h:
4155 (JSC):
4156
commit-queue@webkit.orgf06140e2012-07-19 15:45:26 +000041572012-07-19 Mark Lam <mark.lam@apple.com>
4158
4159 Fixed broken ENABLE_JIT=0 build.
4160 https://bugs.webkit.org/show_bug.cgi?id=91725
4161
4162 Reviewed by Oliver Hunt.
4163
4164 * bytecode/Watchpoint.cpp:
4165 * heap/JITStubRoutineSet.h:
4166 (JSC):
4167 (JITStubRoutineSet):
4168 (JSC::JITStubRoutineSet::JITStubRoutineSet):
4169 (JSC::JITStubRoutineSet::~JITStubRoutineSet):
4170 (JSC::JITStubRoutineSet::add):
4171 (JSC::JITStubRoutineSet::clearMarks):
4172 (JSC::JITStubRoutineSet::mark):
4173 (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
4174 (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
4175
kkristof@inf.u-szeged.hub203f612012-07-19 13:21:38 +000041762012-07-19 Kristóf Kosztyó <kkristof@inf.u-szeged.hu>
4177
4178 [Qt] Unreviewed buildfix after r123042.
4179
4180 * interpreter/Interpreter.cpp:
4181 (JSC::Interpreter::dumpRegisters):
4182
fpizlo@apple.com1ffdcff2012-07-19 00:30:34 +000041832012-07-18 Filip Pizlo <fpizlo@apple.com>
4184
4185 DFG should emit inline code for property storage (re)allocation
4186 https://bugs.webkit.org/show_bug.cgi?id=91597
4187
4188 Reviewed by Oliver Hunt.
4189
4190 This adds two new ops to the DFG IR: AllocatePropertyStorage and
4191 ReallocatePropertyStorage. It enables these to interact properly with
4192 CSE so that a GetPropertyStorage on something for which we have
4193 obviously done a (Re)AllocatePropertyStorage will result in the
4194 GetPropertyStorage being eliminated. Other than that, the code
4195 emitted for these ops is identical to the code we were emitting in
4196 the corresponding PutById stub.
4197
4198 * dfg/DFGAbstractState.cpp:
4199 (JSC::DFG::AbstractState::execute):
4200 * dfg/DFGByteCodeParser.cpp:
4201 (JSC::DFG::ByteCodeParser::parseBlock):
4202 * dfg/DFGCSEPhase.cpp:
4203 (JSC::DFG::CSEPhase::putStructureStoreElimination):
4204 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
4205 * dfg/DFGNode.h:
4206 (JSC::DFG::Node::hasStructureTransitionData):
4207 * dfg/DFGNodeType.h:
4208 (DFG):
4209 * dfg/DFGOperations.cpp:
4210 * dfg/DFGOperations.h:
4211 * dfg/DFGPredictionPropagationPhase.cpp:
4212 (JSC::DFG::PredictionPropagationPhase::propagate):
4213 * dfg/DFGSpeculativeJIT.cpp:
4214 (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
4215 (DFG):
4216 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
4217 * dfg/DFGSpeculativeJIT.h:
4218 (JSC::DFG::SpeculativeJIT::callOperation):
4219 (SpeculativeJIT):
4220 * dfg/DFGSpeculativeJIT32_64.cpp:
4221 (JSC::DFG::SpeculativeJIT::compile):
4222 * dfg/DFGSpeculativeJIT64.cpp:
4223 (JSC::DFG::SpeculativeJIT::compile):
4224 * runtime/Structure.cpp:
4225 (JSC::nextOutOfLineStorageCapacity):
4226 * runtime/Structure.h:
4227 (JSC):
4228
oliver@apple.coma08210b2012-07-18 23:26:06 +000042292012-07-16 Oliver Hunt <oliver@apple.com>
4230
4231 dumpCallFrame is broken in ToT
4232 https://bugs.webkit.org/show_bug.cgi?id=91444
4233
4234 Reviewed by Gavin Barraclough.
4235
4236 Various changes have been made to the SF calling convention, but
4237 dumpCallFrame has not been updated to reflect these changes.
4238 That resulted in both bogus information, as well as numerous
4239 assertions of sadness.
4240
4241 This patch makes dumpCallFrame actually work again and adds the
4242 wonderful feature of telling you the name of the variable that a
4243 register reflects, or what value it contains.
4244
4245 * bytecode/CodeBlock.cpp:
4246 (JSC::CodeBlock::nameForRegister):
4247 A really innefficient mechanism for finding the name of a local register.
4248 This should only ever be used by debug code so this should be okay.
4249 * bytecode/CodeBlock.h:
4250 (CodeBlock):
4251 * bytecompiler/BytecodeGenerator.cpp:
4252 (JSC::BytecodeGenerator::generate):
4253 Debug builds no longer throw away a functions symbol table, this allows
4254 us to actually perform a register# to name mapping
4255 * dfg/DFGJITCompiler.cpp:
4256 (JSC::DFG::JITCompiler::link):
4257 We weren't propogating the bytecode offset here leading to assertions
4258 in debug builds when dumping bytecode of DFG compiled code.
4259 * interpreter/Interpreter.cpp:
4260 (JSC):
4261 (JSC::Interpreter::dumpRegisters):
4262 Rework to actually be correct.
4263 (JSC::getCallerInfo):
4264 Return the byteocde offset as well now, given we have to determine it
4265 anyway.
4266 (JSC::Interpreter::getStackTrace):
4267 (JSC::Interpreter::retrieveCallerFromVMCode):
4268 * interpreter/Interpreter.h:
4269 (Interpreter):
4270 * jsc.cpp:
4271 (GlobalObject::finishCreation):
4272 (functionDumpCallFrame):
4273 Give debug builds of JSC a method for calling dumpCallFrame so we can
4274 inspect a callframe without requiring us to break in a debugger.
4275
fpizlo@apple.comc6429b82012-07-18 22:17:18 +000042762012-07-18 Filip Pizlo <fpizlo@apple.com>
4277
4278 DFG 32-bit PutById transition stub storage reallocation case copies the first pointer of each JSValue instead of the whole JSValue
4279 https://bugs.webkit.org/show_bug.cgi?id=91599
4280
4281 Reviewed by Geoffrey Garen.
4282
4283 * dfg/DFGRepatch.cpp:
4284 (JSC::DFG::emitPutTransitionStub):
4285
fpizlo@apple.com07669e22012-07-17 23:11:23 +000042862012-07-17 Filip Pizlo <fpizlo@apple.com>
4287
fpizlo@apple.com41c6f1e2012-07-18 04:42:55 +00004288 DFG 32-bit PutById transition stub passes the payload/tag arguments to a DFG operation in the wrong order
4289 https://bugs.webkit.org/show_bug.cgi?id=91576
4290
4291 Reviewed by Gavin Barraclough.
4292
4293 * dfg/DFGRepatch.cpp:
4294 (JSC::DFG::emitPutTransitionStub):
4295
42962012-07-17 Filip Pizlo <fpizlo@apple.com>
4297
fpizlo@apple.com07669e22012-07-17 23:11:23 +00004298 [Qt] REGRESSION(r122768, r122771): They broke jquery/data.html and inspector/elements/edit-dom-actions.html
4299 https://bugs.webkit.org/show_bug.cgi?id=91476
4300
4301 Reviewed by Mark Hahnenberg.
4302
4303 The 32-bit repatching code was not correctly adapted to the new world where there may not always
4304 be an available scratch register. Fixed it by ensuring that the scratch register we select does
4305 not overlap with the value tag.
4306
4307 * dfg/DFGRepatch.cpp:
4308 (JSC::DFG::generateProtoChainAccessStub):
4309 (JSC::DFG::tryCacheGetByID):
4310 (JSC::DFG::tryBuildGetByIDList):
4311 (JSC::DFG::emitPutReplaceStub):
4312
rgabor@webkit.org600a0c12012-07-17 07:59:57 +000043132012-07-17 Gabor Rapcsanyi <rgabor@webkit.org>
4314
4315 Unreviewed buildfix from Zoltan Herczeg after 122768.
4316
4317 * dfg/DFGCCallHelpers.h:
4318 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
4319 (CCallHelpers):
4320
commit-queue@webkit.org7bf73302012-07-17 07:11:52 +000043212012-07-17 David Barr <davidbarr@chromium.org>
4322
4323 Introduce ENABLE_CSS_IMAGE_ORIENTATION compile flag
4324 https://bugs.webkit.org/show_bug.cgi?id=89055
4325
4326 Reviewed by Kent Tamura.
4327
4328 The css3-images module is at candidate recommendation.
4329 http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation
4330
4331 Add a configuration option for CSS image-orientation support, disabling it by default.
4332
4333 * Configurations/FeatureDefines.xcconfig:
4334
fpizlo@apple.com68bef1d2012-07-17 01:43:56 +000043352012-07-16 Filip Pizlo <fpizlo@apple.com>
4336
4337 Unreviewed, roll out 122790 because it broke the Windows build. I'm not
4338 sure what to do with exported symbols that are predicated on NDEBUG.
4339
4340 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4341 * bytecode/CodeBlock.cpp:
4342 (JSC):
4343 * bytecode/CodeBlock.h:
4344 (CodeBlock):
4345 * bytecompiler/BytecodeGenerator.cpp:
4346 (JSC::BytecodeGenerator::generate):
4347 * dfg/DFGJITCompiler.cpp:
4348 (JSC::DFG::JITCompiler::link):
4349 * interpreter/Interpreter.cpp:
4350 (JSC):
4351 (JSC::Interpreter::dumpRegisters):
4352 (JSC::getCallerInfo):
4353 (JSC::Interpreter::getStackTrace):
4354 (JSC::Interpreter::retrieveCallerFromVMCode):
4355 * interpreter/Interpreter.h:
4356 (Interpreter):
4357 * jsc.cpp:
4358 (GlobalObject::finishCreation):
4359
oliver@apple.com0acb42b2012-07-17 01:14:18 +000043602012-07-16 Oliver Hunt <oliver@apple.com>
4361
4362 dumpCallFrame is broken in ToT
4363 https://bugs.webkit.org/show_bug.cgi?id=91444
4364
4365 Reviewed by Gavin Barraclough.
4366
4367 Various changes have been made to the SF calling convention, but
4368 dumpCallFrame has not been updated to reflect these changes.
4369 That resulted in both bogus information, as well as numerous
4370 assertions of sadness.
4371
4372 This patch makes dumpCallFrame actually work again and adds the
4373 wonderful feature of telling you the name of the variable that a
4374 register reflects, or what value it contains.
4375
4376 * bytecode/CodeBlock.cpp:
4377 (JSC::CodeBlock::nameForRegister):
4378 A really innefficient mechanism for finding the name of a local register.
4379 This should only ever be used by debug code so this should be okay.
4380 * bytecode/CodeBlock.h:
4381 (CodeBlock):
4382 * bytecompiler/BytecodeGenerator.cpp:
4383 (JSC::BytecodeGenerator::generate):
4384 Debug builds no longer throw away a functions symbol table, this allows
4385 us to actually perform a register# to name mapping
4386 * dfg/DFGJITCompiler.cpp:
4387 (JSC::DFG::JITCompiler::link):
4388 We weren't propogating the bytecode offset here leading to assertions
4389 in debug builds when dumping bytecode of DFG compiled code.
4390 * interpreter/Interpreter.cpp:
4391 (JSC):
4392 (JSC::Interpreter::dumpRegisters):
4393 Rework to actually be correct.
4394 (JSC::getCallerInfo):
4395 Return the byteocde offset as well now, given we have to determine it
4396 anyway.
4397 (JSC::Interpreter::getStackTrace):
4398 (JSC::Interpreter::retrieveCallerFromVMCode):
4399 * interpreter/Interpreter.h:
4400 (Interpreter):
4401 * jsc.cpp:
4402 (GlobalObject::finishCreation):
4403 (functionDumpCallFrame):
4404 Give debug builds of JSC a method for calling dumpCallFrame so we can
4405 inspect a callframe without requiring us to break in a debugger.
4406
fpizlo@apple.comcd8b6662012-07-16 22:17:29 +000044072012-07-16 Filip Pizlo <fpizlo@apple.com>
4408
4409 Unreviewed, adding forgotten files.
4410
4411 * dfg/DFGRegisterSet.h: Added.
4412 (DFG):
4413 (RegisterSet):
4414 (JSC::DFG::RegisterSet::RegisterSet):
4415 (JSC::DFG::RegisterSet::asPOD):
4416 (JSC::DFG::RegisterSet::copyInfo):
4417 (JSC::DFG::RegisterSet::set):
4418 (JSC::DFG::RegisterSet::setGPRByIndex):
4419 (JSC::DFG::RegisterSet::clear):
4420 (JSC::DFG::RegisterSet::get):
4421 (JSC::DFG::RegisterSet::getGPRByIndex):
4422 (JSC::DFG::RegisterSet::getFreeGPR):
4423 (JSC::DFG::RegisterSet::setFPRByIndex):
4424 (JSC::DFG::RegisterSet::getFPRByIndex):
4425 (JSC::DFG::RegisterSet::setByIndex):
4426 (JSC::DFG::RegisterSet::getByIndex):
4427 (JSC::DFG::RegisterSet::numberOfSetGPRs):
4428 (JSC::DFG::RegisterSet::numberOfSetFPRs):
4429 (JSC::DFG::RegisterSet::numberOfSetRegisters):
4430 (JSC::DFG::RegisterSet::setBit):
4431 (JSC::DFG::RegisterSet::clearBit):
4432 (JSC::DFG::RegisterSet::getBit):
4433 * dfg/DFGScratchRegisterAllocator.h: Added.
4434 (DFG):
4435 (ScratchRegisterAllocator):
4436 (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
4437 (JSC::DFG::ScratchRegisterAllocator::lock):
4438 (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
4439 (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
4440 (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
4441 (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
4442 (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
4443 (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
4444 (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
4445 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
4446 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
4447
fpizlo@apple.com2f2052a2012-07-16 22:08:21 +000044482012-07-15 Filip Pizlo <fpizlo@apple.com>
4449
4450 DFG PutById transition should handle storage allocation, and inline it
4451 https://bugs.webkit.org/show_bug.cgi?id=91337
4452
4453 Reviewed by Oliver Hunt.
4454
4455 This enables the patching of DFG PutById to handle the out-of-line storage
4456 allocation case. Furthermore, it inlines out-of-line storage allocation (and
4457 reallocation) into the generated stubs.
4458
4459 To do this, this patch adds the ability to store the relevant register
4460 allocation state (i.e. the set of in-use registers) in the structure stub
4461 info so that the stub generation code can more flexibly select scratch
4462 registers: sometimes it needs none, sometimes one - or sometimes up to
4463 three. Moreover, to make the stub generation register allocation simple and
4464 maintainable, this patch introduces a reusable scratch register allocator
4465 class. This register allocator understands that some registers are in use by
4466 the main path code and so must be spilled as necessary, other registers are
4467 locked for use in the stub itself and so cannot even be spilled, while still
4468 others may be allocated for scratch purposes. A scratch register that is
4469 used must be spilled. If a register is locked, it cannot be used as a
4470 scratch register. If a register is used, it can be used as a scratch
4471 register so long as it is spilled.
4472
4473 This is a sub-1% speed-up on V8 and neutral elsewhere.
4474
4475 * GNUmakefile.list.am:
4476 * JavaScriptCore.xcodeproj/project.pbxproj:
4477 * assembler/MacroAssemblerCodeRef.h:
4478 (FunctionPtr):
4479 (JSC::FunctionPtr::FunctionPtr):
4480 * bytecode/StructureStubInfo.h:
4481 * dfg/DFGCCallHelpers.h:
4482 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
4483 (CCallHelpers):
4484 * dfg/DFGGPRInfo.h:
4485 * dfg/DFGJITCompiler.cpp:
4486 (JSC::DFG::JITCompiler::link):
4487 * dfg/DFGJITCompiler.h:
4488 (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
4489 (PropertyAccessRecord):
4490 * dfg/DFGOperations.cpp:
4491 * dfg/DFGOperations.h:
4492 * dfg/DFGRegisterBank.h:
4493 (JSC::DFG::RegisterBank::isInUse):
4494 (RegisterBank):
4495 * dfg/DFGRegisterSet.h: Added.
4496 (DFG):
4497 (RegisterSet):
4498 (JSC::DFG::RegisterSet::RegisterSet):
4499 (JSC::DFG::RegisterSet::asPOD):
4500 (JSC::DFG::RegisterSet::copyInfo):
4501 (JSC::DFG::RegisterSet::set):
4502 (JSC::DFG::RegisterSet::setGPRByIndex):
4503 (JSC::DFG::RegisterSet::clear):
4504 (JSC::DFG::RegisterSet::get):
4505 (JSC::DFG::RegisterSet::getGPRByIndex):
4506 (JSC::DFG::RegisterSet::getFreeGPR):
4507 (JSC::DFG::RegisterSet::setFPRByIndex):
4508 (JSC::DFG::RegisterSet::getFPRByIndex):
4509 (JSC::DFG::RegisterSet::setByIndex):
4510 (JSC::DFG::RegisterSet::getByIndex):
4511 (JSC::DFG::RegisterSet::numberOfSetGPRs):
4512 (JSC::DFG::RegisterSet::numberOfSetFPRs):
4513 (JSC::DFG::RegisterSet::numberOfSetRegisters):
4514 (JSC::DFG::RegisterSet::setBit):
4515 (JSC::DFG::RegisterSet::clearBit):
4516 (JSC::DFG::RegisterSet::getBit):
4517 * dfg/DFGRepatch.cpp:
4518 (JSC::DFG::generateProtoChainAccessStub):
4519 (JSC::DFG::tryCacheGetByID):
4520 (JSC::DFG::tryBuildGetByIDList):
4521 (JSC::DFG::emitPutReplaceStub):
4522 (JSC::DFG::emitPutTransitionStub):
4523 (JSC::DFG::tryCachePutByID):
4524 (JSC::DFG::tryBuildPutByIdList):
4525 * dfg/DFGScratchRegisterAllocator.h: Added.
4526 (DFG):
4527 (ScratchRegisterAllocator):
4528 (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
4529 (JSC::DFG::ScratchRegisterAllocator::lock):
4530 (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
4531 (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
4532 (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
4533 (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
4534 (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
4535 (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
4536 (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
4537 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
4538 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
4539 * dfg/DFGSpeculativeJIT.h:
4540 (SpeculativeJIT):
4541 (JSC::DFG::SpeculativeJIT::usedRegisters):
4542 * dfg/DFGSpeculativeJIT32_64.cpp:
4543 (JSC::DFG::SpeculativeJIT::cachedGetById):
4544 (JSC::DFG::SpeculativeJIT::cachedPutById):
4545 (JSC::DFG::SpeculativeJIT::compile):
4546 * dfg/DFGSpeculativeJIT64.cpp:
4547 (JSC::DFG::SpeculativeJIT::cachedGetById):
4548 (JSC::DFG::SpeculativeJIT::cachedPutById):
4549 (JSC::DFG::SpeculativeJIT::compile):
4550 * heap/CopiedAllocator.h:
4551 (CopiedAllocator):
4552 (JSC::CopiedAllocator::fastPathShouldSucceed):
4553 (JSC):
4554
paroga@webkit.org24c86b82012-07-16 20:06:15 +000045552012-07-16 Patrick Gansterer <paroga@webkit.org>
4556
4557 Add dfg switch to create_jit_stubs script
4558 https://bugs.webkit.org/show_bug.cgi?id=91256
4559
4560 Reviewed by Geoffrey Garen.
4561
4562 * create_jit_stubs: Add a switch to enable or disable the generation of
4563 stub functions in #if ENABLE(DFG_JIT) conditions.
4564
rgabor@webkit.org58c69f82012-07-16 15:05:57 +000045652012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
4566
rgabor@webkit.org43ad3e52012-07-16 16:16:03 +00004567 Unreviewed buildfix after r122729. Typo fix.
4568
4569 * assembler/MacroAssemblerARM.h:
4570 (JSC::MacroAssemblerARM::add32):
4571
45722012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
4573
rgabor@webkit.org58c69f82012-07-16 15:05:57 +00004574 Unreviewed buildfix from Zoltan Herczeg after r122677.
4575 Implement missing add32 function to MacroAssemblerARM.
4576
4577 * assembler/MacroAssemblerARM.h:
4578 (JSC::MacroAssemblerARM::add32):
4579 (MacroAssemblerARM):
4580
fpizlo@apple.com327f2372012-07-15 04:02:16 +000045812012-07-14 Filip Pizlo <fpizlo@apple.com>
4582
fpizlo@apple.coma4eaa8a2012-07-15 05:23:58 +00004583 DFG PutByVal opcodes should accept more than 3 operands
4584 https://bugs.webkit.org/show_bug.cgi?id=91332
4585
4586 Reviewed by Oliver Hunt.
4587
4588 Turned PutByVal/PutByValAlias into var-arg nodes, so that we can give them
4589 4 or more operands in the future.
4590
4591 * dfg/DFGAbstractState.cpp:
4592 (JSC::DFG::AbstractState::execute):
4593 * dfg/DFGByteCodeParser.cpp:
4594 (JSC::DFG::ByteCodeParser::parseBlock):
4595 * dfg/DFGCSEPhase.cpp:
4596 (JSC::DFG::CSEPhase::getByValLoadElimination):
4597 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
4598 (JSC::DFG::CSEPhase::performNodeCSE):
4599 * dfg/DFGFixupPhase.cpp:
4600 (JSC::DFG::FixupPhase::fixupNode):
4601 (JSC::DFG::FixupPhase::fixDoubleEdge):
4602 * dfg/DFGGraph.h:
4603 (JSC::DFG::Graph::byValIsPure):
4604 (JSC::DFG::Graph::varArgNumChildren):
4605 (Graph):
4606 (JSC::DFG::Graph::numChildren):
4607 (JSC::DFG::Graph::varArgChild):
4608 (JSC::DFG::Graph::child):
4609 * dfg/DFGNodeType.h:
4610 (DFG):
4611 * dfg/DFGPredictionPropagationPhase.cpp:
4612 (JSC::DFG::PredictionPropagationPhase::propagate):
4613 * dfg/DFGSpeculativeJIT.cpp:
4614 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
4615 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
4616 * dfg/DFGSpeculativeJIT32_64.cpp:
4617 (JSC::DFG::SpeculativeJIT::compile):
4618 * dfg/DFGSpeculativeJIT64.cpp:
4619 (JSC::DFG::SpeculativeJIT::compile):
4620
46212012-07-14 Filip Pizlo <fpizlo@apple.com>
4622
fpizlo@apple.com327f2372012-07-15 04:02:16 +00004623 Rationalize and optimize storage allocation
4624 https://bugs.webkit.org/show_bug.cgi?id=91303
4625
4626 Reviewed by Oliver Hunt.
4627
4628 This implements a backwards bump allocator for copied space storage
4629 allocation, shown in pseudo-code below:
4630
4631 pointer bump(size) {
4632 pointer tmp = allocator->remaining;
4633 tmp -= size;
4634 if (tmp < 0)
4635 fail;
4636 allocator->remaining = tmp;
4637 return allocator->payloadEnd - tmp - size;
4638 }
4639
4640 The advantage of this allocator is that it:
4641
4642 - Only requires one comparison in the common case where size is known to
4643 not be huge, and this comparison can be done by checking the sign bit
4644 of the subtraction.
4645
4646 - Can be implemented even when only one register is available. This
4647 register is reused for both temporary storage during allocation and
4648 for the result.
4649
4650 - Preserves the behavior that memory in a block is filled in from lowest
4651 address to highest address, which allows for a cheap reallocation fast
4652 path.
4653
4654 - Is resilient against the block used for allocation being the last one
4655 in virtual memory, thereby otherwise leading to the risk of overflow
4656 in the bump pointer, despite only doing one branch.
4657
4658 In order to implement this allocator using the smallest possible chunk
4659 of code, I refactored the copied space code so that all of the allocation
4660 logic is in CopiedAllocator, and all of the state is in either
4661 CopiedBlock or CopiedAllocator. This should make changing the allocation
4662 fast path easier in the future.
4663
4664 In order to do this, I needed to add some new assembler support,
4665 particularly for various forms of add(address, register) and negPtr().
4666
4667 This is performance neutral. The purpose of this change is to facilitate
4668 further inlining of storage allocation without having to reserve
4669 additional registers or emit too much code.
4670
4671 * assembler/MacroAssembler.h:
4672 (JSC::MacroAssembler::addPtr):
4673 (MacroAssembler):
4674 (JSC::MacroAssembler::negPtr):
4675 * assembler/MacroAssemblerARMv7.h:
4676 (MacroAssemblerARMv7):
4677 (JSC::MacroAssemblerARMv7::add32):
4678 * assembler/MacroAssemblerX86.h:
4679 (JSC::MacroAssemblerX86::add32):
4680 (MacroAssemblerX86):
4681 * assembler/MacroAssemblerX86_64.h:
4682 (MacroAssemblerX86_64):
4683 (JSC::MacroAssemblerX86_64::addPtr):
4684 (JSC::MacroAssemblerX86_64::negPtr):
4685 * assembler/X86Assembler.h:
4686 (X86Assembler):
4687 (JSC::X86Assembler::addl_mr):
4688 (JSC::X86Assembler::addq_mr):
4689 (JSC::X86Assembler::negq_r):
4690 * heap/CopiedAllocator.h:
4691 (CopiedAllocator):
4692 (JSC::CopiedAllocator::isValid):
4693 (JSC::CopiedAllocator::CopiedAllocator):
4694 (JSC::CopiedAllocator::tryAllocate):
4695 (JSC):
4696 (JSC::CopiedAllocator::tryReallocate):
4697 (JSC::CopiedAllocator::forceAllocate):
4698 (JSC::CopiedAllocator::resetCurrentBlock):
4699 (JSC::CopiedAllocator::setCurrentBlock):
4700 (JSC::CopiedAllocator::currentCapacity):
4701 * heap/CopiedBlock.h:
4702 (CopiedBlock):
4703 (JSC::CopiedBlock::create):
4704 (JSC::CopiedBlock::zeroFillWilderness):
4705 (JSC::CopiedBlock::CopiedBlock):
4706 (JSC::CopiedBlock::payloadEnd):
4707 (JSC):
4708 (JSC::CopiedBlock::payloadCapacity):
4709 (JSC::CopiedBlock::data):
4710 (JSC::CopiedBlock::dataEnd):
4711 (JSC::CopiedBlock::dataSize):
4712 (JSC::CopiedBlock::wilderness):
4713 (JSC::CopiedBlock::wildernessEnd):
4714 (JSC::CopiedBlock::wildernessSize):
4715 (JSC::CopiedBlock::size):
4716 * heap/CopiedSpace.cpp:
4717 (JSC::CopiedSpace::tryAllocateSlowCase):
4718 (JSC::CopiedSpace::tryAllocateOversize):
4719 (JSC::CopiedSpace::tryReallocate):
4720 (JSC::CopiedSpace::doneFillingBlock):
4721 (JSC::CopiedSpace::doneCopying):
4722 * heap/CopiedSpace.h:
4723 (CopiedSpace):
4724 * heap/CopiedSpaceInlineMethods.h:
4725 (JSC::CopiedSpace::startedCopying):
4726 (JSC::CopiedSpace::allocateBlockForCopyingPhase):
4727 (JSC::CopiedSpace::allocateBlock):
4728 (JSC::CopiedSpace::tryAllocate):
4729 (JSC):
4730 * heap/MarkStack.cpp:
4731 (JSC::SlotVisitor::startCopying):
4732 (JSC::SlotVisitor::allocateNewSpace):
4733 (JSC::SlotVisitor::doneCopying):
4734 * heap/SlotVisitor.h:
4735 (JSC::SlotVisitor::SlotVisitor):
4736 * jit/JIT.h:
4737 * jit/JITInlineMethods.h:
4738 (JSC::JIT::emitAllocateBasicStorage):
4739 (JSC::JIT::emitAllocateJSArray):
4740
commit-queue@webkit.org782c20b2012-07-14 00:44:47 +000047412012-07-13 Mark Lam <mark.lam@apple.com>
4742
4743 OfflineASM Pretty printing and commenting enhancements.
4744 https://bugs.webkit.org/show_bug.cgi?id=91281
4745
4746 Reviewed by Filip Pizlo.
4747
4748 Added some minor pretty printing in the OfflineASM.
4749 Also added infrastruture for adding multiple types of comments and
4750 annotations with the ability to enable/disable them in the generated
4751 output as desired.
4752
4753 * GNUmakefile.list.am: add new file config.rb.
4754 * llint/LLIntOfflineAsmConfig.h:
4755 Added OFFLINE_ASM_BEGIN, OFFLINE_ASM_END, and OFFLINE_ASM_LOCAL_LABEL macros.
4756 This will allow us to redefine these for other backends later.
4757 * llint/LowLevelInterpreter32_64.asm:
4758 Add a small example of instruction annotations for now.
4759 * llint/LowLevelInterpreter64.asm:
4760 Add a small example of instruction annotations for now.
4761 * offlineasm/armv7.rb: Added handling of annotations.
4762 * offlineasm/asm.rb:
4763 Added machinery to dump the new comments and annotations.
4764 Also added some indentations to make the output a little prettier.
4765 * offlineasm/ast.rb: Added annotation field in class Instruction.
4766 * offlineasm/backends.rb:
4767 * offlineasm/config.rb: Added.
4768 Currently only contains commenting options. This file is meant to be
4769 a centralized place for build config values much like config.h for
4770 JavaScriptCore.
4771 * offlineasm/generate_offset_extractor.rb:
4772 * offlineasm/instructions.rb:
4773 * offlineasm/offsets.rb:
4774 * offlineasm/opt.rb:
4775 * offlineasm/parser.rb: Parse and record annotations.
4776 * offlineasm/registers.rb:
4777 * offlineasm/self_hash.rb:
4778 * offlineasm/settings.rb:
4779 * offlineasm/transform.rb:
4780 * offlineasm/x86.rb: Added handling of annotations.
4781
fpizlo@apple.com8ff7c5e72012-07-13 23:55:18 +000047822012-07-13 Filip Pizlo <fpizlo@apple.com>
4783
4784 ASSERTION FAILED: use.useKind() != DoubleUse
4785 https://bugs.webkit.org/show_bug.cgi?id=91082
4786
4787 Reviewed by Geoffrey Garen.
4788
4789 The implementation of Branch() was unwisely relying on register allocation state
4790 to decide what speculations to perform. That's never correct.
4791
4792 * dfg/DFGSpeculativeJIT32_64.cpp:
4793 (JSC::DFG::SpeculativeJIT::compile):
4794 * dfg/DFGSpeculativeJIT64.cpp:
4795 (JSC::DFG::SpeculativeJIT::compile):
4796
commit-queue@webkit.org2e002d12012-07-13 23:36:34 +000047972012-07-13 Sheriff Bot <webkit.review.bot@gmail.com>
4798
4799 Unreviewed, rolling out r122640.
4800 http://trac.webkit.org/changeset/122640
4801 https://bugs.webkit.org/show_bug.cgi?id=91298
4802
4803 LLInt apparently does not expect to mark these (Requested by
4804 olliej on #webkit).
4805
4806 * bytecode/CodeBlock.cpp:
4807 (JSC::CodeBlock::visitStructures):
4808 (JSC::CodeBlock::stronglyVisitStrongReferences):
4809
oliver@apple.comca095d52012-07-13 23:12:14 +000048102012-07-13 Oliver Hunt <oliver@apple.com>
4811
4812 LLInt fails to mark structures stored in the bytecode
4813 https://bugs.webkit.org/show_bug.cgi?id=91296
4814
4815 Reviewed by Geoffrey Garen.
4816
4817 LLInt stores structures in the bytecode, so we need to visit the appropriate
4818 instructions as we would if we were running in the classic interpreter.
4819 This requires adding additional checks for the LLInt specific opcodes, and
4820 the lint specific variants of operand ordering.
4821
4822 * bytecode/CodeBlock.cpp:
4823 (JSC::CodeBlock::visitStructures):
4824 (JSC::CodeBlock::stronglyVisitStrongReferences):
4825
commit-queue@webkit.orgf9b0ef22012-07-13 20:12:36 +000048262012-07-13 Yong Li <yoli@rim.com>
4827
4828 [BlackBerry] Implement GCActivityCallback with platform timer
4829 https://bugs.webkit.org/show_bug.cgi?id=90175
4830
4831 Reviewed by Rob Buis.
4832
4833 Implement GCActivityCallback and HeapTimer for BlackBerry port.
4834
4835 * heap/HeapTimer.cpp:
4836 (JSC):
4837 (JSC::HeapTimer::HeapTimer):
4838 (JSC::HeapTimer::~HeapTimer):
4839 (JSC::HeapTimer::timerDidFire):
4840 (JSC::HeapTimer::synchronize):
4841 (JSC::HeapTimer::invalidate):
4842 (JSC::HeapTimer::didStartVMShutdown):
4843 * heap/HeapTimer.h:
4844 (HeapTimer):
4845 * runtime/GCActivityCallbackBlackBerry.cpp:
4846 (JSC):
4847 (JSC::DefaultGCActivityCallback::doWork):
4848 (JSC::DefaultGCActivityCallback::didAllocate):
4849 (JSC::DefaultGCActivityCallback::willCollect):
4850 (JSC::DefaultGCActivityCallback::cancel):
4851
paroga@webkit.orgcc7dc5b2012-07-13 16:35:46 +000048522012-07-13 Patrick Gansterer <paroga@webkit.org>
4853
paroga@webkit.org4a3ecbd2012-07-13 16:53:20 +00004854 [WIN] Fix compilation of DFGRepatch.cpp
4855 https://bugs.webkit.org/show_bug.cgi?id=91241
4856
4857 Reviewed by Geoffrey Garen.
4858
4859 Use intptr_t instead of uintptr_t when calling CodeLocationCommon::dataLabelPtrAtOffset(int)
4860 to fix MSVC "unary minus operator applied to unsigned type, result still unsigned" warning.
4861
4862 * dfg/DFGRepatch.cpp:
4863 (JSC::DFG::dfgResetGetByID):
4864 (JSC::DFG::dfgResetPutByID):
4865
48662012-07-13 Patrick Gansterer <paroga@webkit.org>
4867
paroga@webkit.orgcc7dc5b2012-07-13 16:35:46 +00004868 Fix ARM_TRADITIONAL JIT for COMPILER(MSVC) and COMPILER(RVCT) after r121885
4869 https://bugs.webkit.org/show_bug.cgi?id=91238
4870
4871 Reviewed by Zoltan Herczeg.
4872
4873 r121885 changed the assembler instruction only for COMPILER(GCC).
4874 Use the same instructions for the other compilers too.
4875
4876 * jit/JITStubs.cpp:
4877 (JSC::ctiTrampoline):
4878 (JSC::ctiTrampolineEnd):
4879 (JSC::ctiVMThrowTrampoline):
4880
fpizlo@apple.comedcb7a92012-07-13 05:31:05 +000048812012-07-12 Filip Pizlo <fpizlo@apple.com>
4882
fpizlo@apple.comcf716122012-07-13 06:41:18 +00004883 DFG property access stubs should use structure transition watchpoints
4884 https://bugs.webkit.org/show_bug.cgi?id=91135
4885
4886 Reviewed by Geoffrey Garen.
4887
4888 This adds a Watchpoint subclass that will clear a structure stub (i.e.
4889 a property access stub) when fired. The DFG stub generation code now
4890 uses this optimization.
4891
4892 * CMakeLists.txt:
4893 * GNUmakefile.list.am:
4894 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4895 * JavaScriptCore.xcodeproj/project.pbxproj:
4896 * Target.pri:
4897 * bytecode/CodeBlock.cpp:
4898 (JSC):
4899 (JSC::CodeBlock::finalizeUnconditionally):
4900 (JSC::CodeBlock::resetStub):
4901 (JSC::CodeBlock::resetStubInternal):
4902 * bytecode/CodeBlock.h:
4903 (JSC):
4904 (CodeBlock):
4905 * bytecode/StructureStubClearingWatchpoint.cpp: Added.
4906 (JSC):
4907 (JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint):
4908 (JSC::StructureStubClearingWatchpoint::push):
4909 (JSC::StructureStubClearingWatchpoint::fireInternal):
4910 (JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo):
4911 (JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
4912 (JSC::WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint):
4913 * bytecode/StructureStubClearingWatchpoint.h: Added.
4914 (JSC):
4915 (StructureStubClearingWatchpoint):
4916 (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):
4917 (WatchpointsOnStructureStubInfo):
4918 (JSC::WatchpointsOnStructureStubInfo::WatchpointsOnStructureStubInfo):
4919 (JSC::WatchpointsOnStructureStubInfo::codeBlock):
4920 (JSC::WatchpointsOnStructureStubInfo::stubInfo):
4921 * bytecode/StructureStubInfo.h:
4922 (JSC::StructureStubInfo::reset):
4923 (JSC::StructureStubInfo::addWatchpoint):
4924 (StructureStubInfo):
4925 * dfg/DFGRepatch.cpp:
4926 (JSC::DFG::addStructureTransitionCheck):
4927 (DFG):
4928 (JSC::DFG::generateProtoChainAccessStub):
4929 (JSC::DFG::emitPutTransitionStub):
4930 * jit/JumpReplacementWatchpoint.h:
4931
49322012-07-12 Filip Pizlo <fpizlo@apple.com>
4933
fpizlo@apple.comedcb7a92012-07-13 05:31:05 +00004934 DFG CFA may get overzealous in loops that have code that must exit
4935 https://bugs.webkit.org/show_bug.cgi?id=91188
4936
4937 Reviewed by Gavin Barraclough.
4938
4939 Ensure that if the CFA assumes that an operation must exit, then it will always exit
4940 no matter what happens after. That's necessary to preserve soundness.
4941
4942 Remove a broken fixup done by the DFG simplifier, where it was trying to say that the
4943 variable-at-head was the first access in the second block in the merge, if the first
4944 block did not read the variable. That's totally wrong, if the first block was in fact
4945 doing a phantom read. I removed that fixup and instead hardened the rest of the
4946 compiler.
4947
4948 * dfg/DFGAbstractState.cpp:
4949 (JSC::DFG::AbstractState::endBasicBlock):
4950 * dfg/DFGBasicBlock.h:
4951 (JSC::DFG::BasicBlock::BasicBlock):
4952 (BasicBlock):
4953 * dfg/DFGCFAPhase.cpp:
4954 (JSC::DFG::CFAPhase::performBlockCFA):
4955 * dfg/DFGCFGSimplificationPhase.cpp:
4956 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
4957 * dfg/DFGConstantFoldingPhase.cpp:
4958 (JSC::DFG::ConstantFoldingPhase::ConstantFoldingPhase):
4959 (JSC::DFG::ConstantFoldingPhase::run):
4960 (ConstantFoldingPhase):
4961 (JSC::DFG::ConstantFoldingPhase::foldConstants):
4962 (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
4963 * dfg/DFGVariableEventStream.cpp:
4964 (JSC::DFG::VariableEventStream::reconstruct):
4965
allan.jensen@nokia.comb619bbf22012-07-12 15:34:35 +000049662012-07-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
4967
4968 [Qt] Implement MemoryUsageSupport
4969 https://bugs.webkit.org/show_bug.cgi?id=91094
4970
4971 Reviewed by Adam Barth.
4972
4973 Compile in MemoryStatistics so we can make use of the interface.
4974
4975 * Target.pri:
4976
ossy@webkit.org8db5d862012-07-12 07:53:08 +000049772012-07-12 Csaba Osztrogonác <ossy@webkit.org>
4978
4979 Remove dead code after r122392.
4980 https://bugs.webkit.org/show_bug.cgi?id=91049
4981
4982 Reviewed by Filip Pizlo.
4983
4984 * dfg/DFGSpeculativeJIT64.cpp:
4985 (JSC::DFG::SpeculativeJIT::emitCall):
4986
commit-queue@webkit.org55a950b2012-07-12 02:49:24 +000049872012-07-11 Adenilson Cavalcanti <cavalcantii@gmail.com>
4988
4989 Build fix + remove dead code
4990 https://bugs.webkit.org/show_bug.cgi?id=91039
4991
4992 Reviewed by Filip Pizlo.
4993
4994 An unused variable was breaking compilation (thanks to warnings being treated as errors).
4995
4996 * dfg/DFGSpeculativeJIT32_64.cpp:
4997 (JSC::DFG::SpeculativeJIT::emitCall):
4998
mrowe@apple.comc8887bf2012-07-12 02:01:25 +000049992012-07-11 Mark Rowe <mrowe@apple.com>
5000
5001 <http://webkit.org/b/91024> Build against the latest SDK when targeting older OS X versions.
5002
5003 Reviewed by Dan Bernstein.
5004
5005 The deployment target is already set to the version that we're targeting, and it's that setting
5006 which determines which functionality from the SDK is available to us.
5007
5008 * Configurations/Base.xcconfig:
5009
fpizlo@apple.com3d949152012-07-11 23:12:35 +000050102012-07-11 Filip Pizlo <fpizlo@apple.com>
5011
fpizlo@apple.com5e135772012-07-12 00:12:03 +00005012 DFG should have fast virtual calls
5013 https://bugs.webkit.org/show_bug.cgi?id=90924
5014
5015 Reviewed by Gavin Barraclough.
5016
5017 Implements virtual call support in the style of the old JIT, with the
5018 caveat that we still use the same slow path for both InternalFunction
5019 calls and JSFunction calls. Also rationalized the way that our
5020 CodeOrigin indices tie into exception checks (previously it was a
5021 strange one-to-one mapping with fairly limited assertions; now it's a
5022 one-to-many mapping for CodeOrigins to exception checks, respectively).
5023 I also took the opportunity to clean up
5024 CallLinkInfo::callReturnLocation, which previously was either a Call or
5025 a NearCall. Now it's just a NearCall. As well, exceptions during slow
5026 path call resolution are now handled by returning an exception throwing
5027 thunk rather than returning null. And finally, I made a few things
5028 public that were previously private-with-lots-of-friends, because I
5029 truly despise the thought of listing each thunk generating function as
5030 a friend of JSValue and friends.
5031
5032 * bytecode/CallLinkInfo.cpp:
5033 (JSC::CallLinkInfo::unlink):
5034 * bytecode/CallLinkInfo.h:
5035 (CallLinkInfo):
5036 * bytecode/CodeOrigin.h:
5037 (JSC::CodeOrigin::CodeOrigin):
5038 (JSC::CodeOrigin::isSet):
5039 * dfg/DFGAssemblyHelpers.h:
5040 (JSC::DFG::AssemblyHelpers::AssemblyHelpers):
5041 * dfg/DFGCCallHelpers.h:
5042 (JSC::DFG::CCallHelpers::CCallHelpers):
5043 * dfg/DFGGPRInfo.h:
5044 (GPRInfo):
5045 * dfg/DFGJITCompiler.cpp:
5046 (JSC::DFG::JITCompiler::link):
5047 (JSC::DFG::JITCompiler::compileFunction):
5048 * dfg/DFGJITCompiler.h:
5049 (JSC::DFG::CallBeginToken::CallBeginToken):
5050 (JSC::DFG::CallBeginToken::~CallBeginToken):
5051 (CallBeginToken):
5052 (JSC::DFG::CallBeginToken::set):
5053 (JSC::DFG::CallBeginToken::registerWithExceptionCheck):
5054 (JSC::DFG::CallBeginToken::codeOrigin):
5055 (JSC::DFG::CallExceptionRecord::CallExceptionRecord):
5056 (CallExceptionRecord):
5057 (JSC::DFG::JITCompiler::currentCodeOriginIndex):
5058 (JITCompiler):
5059 (JSC::DFG::JITCompiler::beginCall):
5060 (JSC::DFG::JITCompiler::notifyCall):
5061 (JSC::DFG::JITCompiler::prepareForExceptionCheck):
5062 (JSC::DFG::JITCompiler::addExceptionCheck):
5063 (JSC::DFG::JITCompiler::addFastExceptionCheck):
5064 * dfg/DFGOperations.cpp:
5065 * dfg/DFGRepatch.cpp:
5066 (JSC::DFG::dfgLinkFor):
5067 * dfg/DFGSpeculativeJIT.h:
5068 (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck):
5069 * dfg/DFGSpeculativeJIT32_64.cpp:
5070 (JSC::DFG::SpeculativeJIT::emitCall):
5071 * dfg/DFGSpeculativeJIT64.cpp:
5072 (JSC::DFG::SpeculativeJIT::emitCall):
5073 * dfg/DFGThunks.cpp:
5074 (JSC::DFG::emitPointerValidation):
5075 (DFG):
5076 (JSC::DFG::throwExceptionFromCallSlowPathGenerator):
5077 (JSC::DFG::slowPathFor):
5078 (JSC::DFG::linkForThunkGenerator):
5079 (JSC::DFG::linkCallThunkGenerator):
5080 (JSC::DFG::linkConstructThunkGenerator):
5081 (JSC::DFG::virtualForThunkGenerator):
5082 (JSC::DFG::virtualCallThunkGenerator):
5083 (JSC::DFG::virtualConstructThunkGenerator):
5084 * dfg/DFGThunks.h:
5085 (DFG):
5086 * jit/JIT.cpp:
5087 (JSC::JIT::privateCompile):
5088 (JSC::JIT::linkFor):
5089 * runtime/Executable.h:
5090 (ExecutableBase):
5091 (JSC::ExecutableBase::offsetOfJITCodeFor):
5092 (JSC::ExecutableBase::offsetOfNumParametersFor):
5093 * runtime/JSValue.h:
5094 (JSValue):
5095
50962012-07-11 Filip Pizlo <fpizlo@apple.com>
5097
fpizlo@apple.com3a264a12012-07-11 23:33:20 +00005098 Accidentally used the wrong license (3-clause instead of 2-clause) in some
5099 files I just committed.
5100
5101 Rubber stamped by Oliver Hunt.
5102
5103 * bytecode/Watchpoint.cpp:
5104 * bytecode/Watchpoint.h:
5105 * jit/JumpReplacementWatchpoint.cpp:
5106 * jit/JumpReplacementWatchpoint.h:
5107
51082012-07-11 Filip Pizlo <fpizlo@apple.com>
5109
fpizlo@apple.com3d949152012-07-11 23:12:35 +00005110 Watchpoints and jump replacement should be decoupled
5111 https://bugs.webkit.org/show_bug.cgi?id=91016
5112
5113 Reviewed by Oliver Hunt.
5114
5115 * CMakeLists.txt:
5116 * GNUmakefile.list.am:
5117 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5118 * JavaScriptCore.xcodeproj/project.pbxproj:
5119 * Target.pri:
5120 * assembler/AbstractMacroAssembler.h:
5121 (JSC):
5122 (Label):
5123 * bytecode/CodeBlock.h:
5124 (JSC::CodeBlock::appendWatchpoint):
5125 (JSC::CodeBlock::watchpoint):
5126 (DFGData):
5127 * bytecode/Watchpoint.cpp:
5128 (JSC):
5129 * bytecode/Watchpoint.h:
5130 (JSC::Watchpoint::Watchpoint):
5131 (Watchpoint):
5132 (JSC::Watchpoint::fire):
5133 * dfg/DFGSpeculativeJIT.h:
5134 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
5135 * jit/JumpReplacementWatchpoint.cpp: Added.
5136 (JSC):
5137 (JSC::JumpReplacementWatchpoint::correctLabels):
5138 (JSC::JumpReplacementWatchpoint::fireInternal):
5139 * jit/JumpReplacementWatchpoint.h: Added.
5140 (JSC):
5141 (JumpReplacementWatchpoint):
5142 (JSC::JumpReplacementWatchpoint::JumpReplacementWatchpoint):
5143 (JSC::JumpReplacementWatchpoint::setDestination):
5144
kevino@webkit.org2b81ef22012-07-11 20:23:39 +000051452012-07-11 Kevin Ollivier <kevino@theolliviers.com>
5146
5147 [wx] Unreviewed build fix. Don't try to build udis86_itab.c since it's included by
5148 another file.
5149
5150 * wscript:
5151
commit-queue@webkit.orgd847b5c2012-07-11 19:48:29 +000051522012-07-11 Chao-ying Fu <fu@mips.com>
5153
5154 Add MIPS convertibleLoadPtr and other functions
5155 https://bugs.webkit.org/show_bug.cgi?id=90714
5156
5157 Reviewed by Oliver Hunt.
5158
5159 * assembler/MIPSAssembler.h:
5160 (JSC::MIPSAssembler::labelIgnoringWatchpoints):
5161 (MIPSAssembler):
5162 (JSC::MIPSAssembler::replaceWithLoad):
5163 (JSC::MIPSAssembler::replaceWithAddressComputation):
5164 * assembler/MacroAssemblerMIPS.h:
5165 (JSC::MacroAssemblerMIPS::convertibleLoadPtr):
5166 (MacroAssemblerMIPS):
5167
andersca@apple.come73df4c2012-07-11 19:41:03 +000051682012-07-11 Anders Carlsson <andersca@apple.com>
5169
5170 Add -Wtautological-compare and -Wsign-compare warning flags
5171 https://bugs.webkit.org/show_bug.cgi?id=90994
5172
5173 Reviewed by Mark Rowe.
5174
5175 * Configurations/Base.xcconfig:
5176
benjamin@webkit.orgea8276a2012-07-11 18:15:17 +000051772012-07-11 Benjamin Poulain <bpoulain@apple.com>
5178
5179 Simplify the copying of JSC ARMv7's LinkRecord
5180 https://bugs.webkit.org/show_bug.cgi?id=90930
5181
5182 Reviewed by Filip Pizlo.
5183
5184 The class LinkRecord is used by value everywhere in ARMv7Assembler. The compiler uses
5185 memmove() to move the objects.
5186
5187 The problem is memmove() is overkill for this object, moving the value can be done with
5188 3 load-store. This patch adds an operator= to the class doing more efficient copying.
5189 This reduces the link time by 19%.
5190
5191 * assembler/ARMv7Assembler.h:
5192 (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
5193 (JSC::ARMv7Assembler::LinkRecord::operator=):
5194 (JSC::ARMv7Assembler::LinkRecord::from):
5195 (JSC::ARMv7Assembler::LinkRecord::setFrom):
5196 (JSC::ARMv7Assembler::LinkRecord::to):
5197 (JSC::ARMv7Assembler::LinkRecord::type):
5198 (JSC::ARMv7Assembler::LinkRecord::linkType):
5199 (JSC::ARMv7Assembler::LinkRecord::setLinkType):
5200 (JSC::ARMv7Assembler::LinkRecord::condition):
5201
wingo@igalia.com8d1d0d42012-07-11 17:50:15 +000052022012-07-11 Andy Wingo <wingo@igalia.com>
5203
5204 jsc: Parse options before creating global data
5205 https://bugs.webkit.org/show_bug.cgi?id=90975
5206
5207 Reviewed by Filip Pizlo.
5208
5209 This patch moves the options parsing in "jsc" before the creation
5210 of the JSGlobalData, so that --useJIT=no has a chance to take
5211 effect.
5212
5213 * jsc.cpp:
5214 (CommandLine::parseArguments): Refactor to be a class, and take
5215 argc and argv as constructor arguments.
5216 (jscmain): Move arg parsing before JSGlobalData creation.
5217
fpizlo@apple.com39c94a42012-07-10 09:18:47 +000052182012-07-10 Filip Pizlo <fpizlo@apple.com>
5219
ossy@webkit.orgb626a9e2012-07-10 09:36:13 +00005220 REGRESSION(r122166): It made 170 tests crash on 32 bit platforms
5221 https://bugs.webkit.org/show_bug.cgi?id=90852
5222
5223 Reviewed by Zoltan Herczeg.
5224
5225 If we can't use the range filter, we should still make sure that the
5226 address is remotely sane, otherwise the hashtables will assert.
5227
5228 * jit/JITStubRoutine.h:
5229 (JSC::JITStubRoutine::passesFilter):
5230
52312012-07-10 Filip Pizlo <fpizlo@apple.com>
5232
fpizlo@apple.com39c94a42012-07-10 09:18:47 +00005233 DFG recompilation heuristics should be based on count, not rate
5234 https://bugs.webkit.org/show_bug.cgi?id=90146
5235
5236 Reviewed by Oliver Hunt.
5237
5238 Rolling r121511 back in after fixing the DFG's interpretation of op_div
5239 profiling, with Gavin's rubber stamp.
5240
5241 This removes a bunch of code that was previously trying to prevent spurious
5242 reoptimizations if a large enough majority of executions of a code block did
5243 not result in OSR exit. It turns out that this code was purely harmful. This
5244 patch removes all of that logic and replaces it with a dead-simple
5245 heuristic: if you exit more than N times (where N is an exponential function
5246 of the number of times the code block has already been recompiled) then we
5247 will recompile.
5248
5249 This appears to be a broad ~1% win on many benchmarks large and small.
5250
5251 * bytecode/CodeBlock.cpp:
5252 (JSC::CodeBlock::CodeBlock):
5253 * bytecode/CodeBlock.h:
5254 (JSC::CodeBlock::couldTakeSpecialFastCase):
5255 (CodeBlock):
5256 (JSC::CodeBlock::osrExitCounter):
5257 (JSC::CodeBlock::countOSRExit):
5258 (JSC::CodeBlock::addressOfOSRExitCounter):
5259 (JSC::CodeBlock::offsetOfOSRExitCounter):
5260 (JSC::CodeBlock::adjustedExitCountThreshold):
5261 (JSC::CodeBlock::exitCountThresholdForReoptimization):
5262 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
5263 (JSC::CodeBlock::shouldReoptimizeNow):
5264 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
5265 * bytecode/ExecutionCounter.cpp:
5266 (JSC::ExecutionCounter::setThreshold):
5267 * bytecode/ExecutionCounter.h:
5268 (ExecutionCounter):
5269 (JSC::ExecutionCounter::clippedThreshold):
5270 * dfg/DFGByteCodeParser.cpp:
5271 (JSC::DFG::ByteCodeParser::makeDivSafe):
5272 * dfg/DFGJITCompiler.cpp:
5273 (JSC::DFG::JITCompiler::compileBody):
5274 * dfg/DFGOSRExit.cpp:
5275 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
5276 * dfg/DFGOSRExitCompiler.cpp:
5277 (JSC::DFG::OSRExitCompiler::handleExitCounts):
5278 * dfg/DFGOperations.cpp:
5279 * jit/JITStubs.cpp:
5280 (JSC::DEFINE_STUB_FUNCTION):
5281 * runtime/Options.h:
5282 (JSC):
5283
commit-queue@webkit.orge1bba8e2012-07-10 05:45:21 +000052842012-07-09 Matt Falkenhagen <falken@chromium.org>
5285
5286 Add ENABLE_DIALOG_ELEMENT and skeleton files
5287 https://bugs.webkit.org/show_bug.cgi?id=90521
5288
5289 Reviewed by Kent Tamura.
5290
5291 * Configurations/FeatureDefines.xcconfig:
5292
fpizlo@apple.com746b8c52012-07-09 23:26:54 +000052932012-07-09 Filip Pizlo <fpizlo@apple.com>
5294
fpizlo@apple.com629c1cd2012-07-10 01:50:44 +00005295 Unreviewed, roll out http://trac.webkit.org/changeset/121511
5296 It made in-browser V8v7 10% slower.
5297
5298 * bytecode/CodeBlock.cpp:
5299 (JSC::CodeBlock::CodeBlock):
5300 * bytecode/CodeBlock.h:
5301 (CodeBlock):
5302 (JSC::CodeBlock::countSpeculationSuccess):
5303 (JSC::CodeBlock::countSpeculationFailure):
5304 (JSC::CodeBlock::speculativeSuccessCounter):
5305 (JSC::CodeBlock::speculativeFailCounter):
5306 (JSC::CodeBlock::forcedOSRExitCounter):
5307 (JSC::CodeBlock::addressOfSpeculativeSuccessCounter):
5308 (JSC::CodeBlock::addressOfSpeculativeFailCounter):
5309 (JSC::CodeBlock::addressOfForcedOSRExitCounter):
5310 (JSC::CodeBlock::offsetOfSpeculativeSuccessCounter):
5311 (JSC::CodeBlock::offsetOfSpeculativeFailCounter):
5312 (JSC::CodeBlock::offsetOfForcedOSRExitCounter):
5313 (JSC::CodeBlock::largeFailCountThreshold):
5314 (JSC::CodeBlock::largeFailCountThresholdForLoop):
5315 (JSC::CodeBlock::shouldReoptimizeNow):
5316 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
5317 * bytecode/ExecutionCounter.cpp:
5318 (JSC::ExecutionCounter::setThreshold):
5319 * bytecode/ExecutionCounter.h:
5320 (ExecutionCounter):
5321 * dfg/DFGJITCompiler.cpp:
5322 (JSC::DFG::JITCompiler::compileBody):
5323 * dfg/DFGOSRExit.cpp:
5324 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
5325 * dfg/DFGOSRExitCompiler.cpp:
5326 (JSC::DFG::OSRExitCompiler::handleExitCounts):
5327 * dfg/DFGOperations.cpp:
5328 * jit/JITStubs.cpp:
5329 (JSC::DEFINE_STUB_FUNCTION):
5330 * runtime/Options.h:
5331 (JSC):
5332
53332012-07-09 Filip Pizlo <fpizlo@apple.com>
5334
fpizlo@apple.comcacd7dc2012-07-09 23:28:53 +00005335 DFG may get stuck in an infinite fix point if it constant folds a mispredicted node
5336 https://bugs.webkit.org/show_bug.cgi?id=90829
5337 <rdar://problem/11823843>
5338
5339 Reviewed by Oliver Hunt.
5340
5341 If a node is shown to have been mispredicted during CFA, then don't allow constant
5342 folding to make the graph even more degenerate. Instead, pull back on constant folding
5343 and allow the normal OSR machinery to fix our profiling so that a future recompilation
5344 doesn't see the same mistake.
5345
5346 * dfg/DFGAbstractState.cpp:
5347 (JSC::DFG::AbstractState::execute):
5348 * dfg/DFGAbstractState.h:
5349 (JSC::DFG::AbstractState::trySetConstant):
5350 (AbstractState):
5351 * dfg/DFGPhase.h:
5352 (JSC::DFG::Phase::name):
5353 (Phase):
5354 (JSC::DFG::runAndLog):
5355 (DFG):
5356 (JSC::DFG::runPhase):
5357
53582012-07-09 Filip Pizlo <fpizlo@apple.com>
5359
fpizlo@apple.com746b8c52012-07-09 23:26:54 +00005360 It should be possible to jettison JIT stub routines even if they are currently running
5361 https://bugs.webkit.org/show_bug.cgi?id=90731
5362
5363 Reviewed by Gavin Barraclough.
5364
5365 This gives the GC awareness of all JIT-generated stubs for inline caches. That
5366 means that if you want to delete a JIT-generated stub, you don't have to worry
5367 about whether or not it is currently running: if there is a chance that it might
5368 be, the GC will kindly defer deletion until non-running-ness is proved.
5369
5370 * CMakeLists.txt:
5371 * GNUmakefile.list.am:
5372 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5373 * JavaScriptCore.xcodeproj/project.pbxproj:
5374 * Target.pri:
5375 * bytecode/Instruction.h:
5376 (JSC):
5377 (PolymorphicStubInfo):
5378 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
5379 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
5380 * bytecode/PolymorphicPutByIdList.cpp:
5381 (JSC::PutByIdAccess::fromStructureStubInfo):
5382 * bytecode/PolymorphicPutByIdList.h:
5383 (JSC::PutByIdAccess::transition):
5384 (JSC::PutByIdAccess::replace):
5385 (JSC::PutByIdAccess::stubRoutine):
5386 (PutByIdAccess):
5387 (JSC::PolymorphicPutByIdList::currentSlowPathTarget):
5388 * bytecode/StructureStubInfo.h:
5389 (JSC::StructureStubInfo::reset):
5390 * dfg/DFGRepatch.cpp:
5391 (JSC::DFG::generateProtoChainAccessStub):
5392 (JSC::DFG::tryCacheGetByID):
5393 (JSC::DFG::tryBuildGetByIDList):
5394 (JSC::DFG::tryBuildGetByIDProtoList):
5395 (JSC::DFG::emitPutReplaceStub):
5396 (JSC::DFG::emitPutTransitionStub):
5397 (JSC::DFG::tryCachePutByID):
5398 (JSC::DFG::tryBuildPutByIdList):
5399 * heap/ConservativeRoots.cpp:
5400 (JSC):
5401 (DummyMarkHook):
5402 (JSC::DummyMarkHook::mark):
5403 (JSC::ConservativeRoots::add):
5404 (CompositeMarkHook):
5405 (JSC::CompositeMarkHook::CompositeMarkHook):
5406 (JSC::CompositeMarkHook::mark):
5407 * heap/ConservativeRoots.h:
5408 (JSC):
5409 (ConservativeRoots):
5410 * heap/Heap.cpp:
5411 (JSC::Heap::markRoots):
5412 (JSC::Heap::deleteUnmarkedCompiledCode):
5413 * heap/Heap.h:
5414 (JSC):
5415 (Heap):
5416 * heap/JITStubRoutineSet.cpp: Added.
5417 (JSC):
5418 (JSC::JITStubRoutineSet::JITStubRoutineSet):
5419 (JSC::JITStubRoutineSet::~JITStubRoutineSet):
5420 (JSC::JITStubRoutineSet::add):
5421 (JSC::JITStubRoutineSet::clearMarks):
5422 (JSC::JITStubRoutineSet::markSlow):
5423 (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
5424 (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
5425 * heap/JITStubRoutineSet.h: Added.
5426 (JSC):
5427 (JITStubRoutineSet):
5428 (JSC::JITStubRoutineSet::mark):
5429 * heap/MachineStackMarker.h:
5430 (JSC):
5431 * interpreter/RegisterFile.cpp:
5432 (JSC::RegisterFile::gatherConservativeRoots):
5433 * interpreter/RegisterFile.h:
5434 (JSC):
5435 * jit/ExecutableAllocator.cpp:
5436 (JSC::DemandExecutableAllocator::DemandExecutableAllocator):
5437 * jit/ExecutableAllocator.h:
5438 (JSC):
5439 * jit/ExecutableAllocatorFixedVMPool.cpp:
5440 (JSC):
5441 (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
5442 * jit/GCAwareJITStubRoutine.cpp: Added.
5443 (JSC):
5444 (JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
5445 (JSC::GCAwareJITStubRoutine::~GCAwareJITStubRoutine):
5446 (JSC::GCAwareJITStubRoutine::observeZeroRefCount):
5447 (JSC::GCAwareJITStubRoutine::deleteFromGC):
5448 (JSC::GCAwareJITStubRoutine::markRequiredObjectsInternal):
5449 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::MarkingGCAwareJITStubRoutineWithOneObject):
5450 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::~MarkingGCAwareJITStubRoutineWithOneObject):
5451 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::markRequiredObjectsInternal):
5452 (JSC::createJITStubRoutine):
5453 * jit/GCAwareJITStubRoutine.h: Added.
5454 (JSC):
5455 (GCAwareJITStubRoutine):
5456 (JSC::GCAwareJITStubRoutine::markRequiredObjects):
5457 (MarkingGCAwareJITStubRoutineWithOneObject):
5458 * jit/JITPropertyAccess.cpp:
5459 (JSC::JIT::privateCompilePutByIdTransition):
5460 (JSC::JIT::privateCompilePatchGetArrayLength):
5461 (JSC::JIT::privateCompileGetByIdProto):
5462 (JSC::JIT::privateCompileGetByIdSelfList):
5463 (JSC::JIT::privateCompileGetByIdProtoList):
5464 (JSC::JIT::privateCompileGetByIdChainList):
5465 (JSC::JIT::privateCompileGetByIdChain):
5466 * jit/JITPropertyAccess32_64.cpp:
5467 (JSC::JIT::privateCompilePutByIdTransition):
5468 (JSC::JIT::privateCompilePatchGetArrayLength):
5469 (JSC::JIT::privateCompileGetByIdProto):
5470 (JSC::JIT::privateCompileGetByIdSelfList):
5471 (JSC::JIT::privateCompileGetByIdProtoList):
5472 (JSC::JIT::privateCompileGetByIdChainList):
5473 (JSC::JIT::privateCompileGetByIdChain):
5474 * jit/JITStubRoutine.cpp: Added.
5475 (JSC):
5476 (JSC::JITStubRoutine::~JITStubRoutine):
5477 (JSC::JITStubRoutine::observeZeroRefCount):
5478 * jit/JITStubRoutine.h: Added.
5479 (JSC):
5480 (JITStubRoutine):
5481 (JSC::JITStubRoutine::JITStubRoutine):
5482 (JSC::JITStubRoutine::createSelfManagedRoutine):
5483 (JSC::JITStubRoutine::code):
5484 (JSC::JITStubRoutine::asCodePtr):
5485 (JSC::JITStubRoutine::ref):
5486 (JSC::JITStubRoutine::deref):
5487 (JSC::JITStubRoutine::startAddress):
5488 (JSC::JITStubRoutine::endAddress):
5489 (JSC::JITStubRoutine::addressStep):
5490 (JSC::JITStubRoutine::canPerformRangeFilter):
5491 (JSC::JITStubRoutine::filteringStartAddress):
5492 (JSC::JITStubRoutine::filteringExtentSize):
5493 (JSC::JITStubRoutine::passesFilter):
5494 * jit/JITStubs.cpp:
5495 (JSC::DEFINE_STUB_FUNCTION):
5496 (JSC::getPolymorphicAccessStructureListSlot):
5497
commit-queue@webkit.orgfb3c9682012-07-09 15:39:09 +000054982012-07-09 Sheriff Bot <webkit.review.bot@gmail.com>
5499
5500 Unreviewed, rolling out r122107.
5501 http://trac.webkit.org/changeset/122107
5502 https://bugs.webkit.org/show_bug.cgi?id=90794
5503
5504 Build failure on Mac debug bots (Requested by falken_ on
5505 #webkit).
5506
5507 * Configurations/FeatureDefines.xcconfig:
5508
commit-queue@webkit.orgb46a45d2012-07-09 14:42:00 +000055092012-07-09 Matt Falkenhagen <falken@chromium.org>
5510
5511 Add ENABLE_DIALOG_ELEMENT and skeleton files
5512 https://bugs.webkit.org/show_bug.cgi?id=90521
5513
5514 Reviewed by Kent Tamura.
5515
5516 * Configurations/FeatureDefines.xcconfig:
5517
rniwa@webkit.orga5efe7e2012-07-09 06:19:54 +000055182012-07-08 Ryosuke Niwa <rniwa@webkit.org>
5519
5520 gcc build fix after r121925.
5521
5522 * runtime/JSObject.h:
5523 (JSC::JSFinalObject::finishCreation):
5524
zherczeg@webkit.orgadfdb1f2012-07-08 10:00:04 +000055252012-07-08 Zoltan Herczeg <zherczeg@webkit.org>
5526
5527 [Qt][ARM] Implementing missing macro assembler instructions after r121925
5528 https://bugs.webkit.org/show_bug.cgi?id=90657
5529
5530 Reviewed by Csaba Osztrogonác.
5531
5532 Implementing convertibleLoadPtr, replaceWithLoad and
5533 replaceWithAddressComputation.
5534
5535 * assembler/ARMAssembler.h:
5536 (JSC::ARMAssembler::replaceWithLoad):
5537 (ARMAssembler):
5538 (JSC::ARMAssembler::replaceWithAddressComputation):
5539 * assembler/MacroAssemblerARM.h:
5540 (JSC::MacroAssemblerARM::convertibleLoadPtr):
5541 (MacroAssemblerARM):
5542
fpizlo@apple.com18066da2012-07-07 00:43:21 +000055432012-07-06 Filip Pizlo <fpizlo@apple.com>
5544
5545 WebKit Version 5.1.7 (6534.57.2, r121935): Double-click no longer works on OpenStreetMap
5546 https://bugs.webkit.org/show_bug.cgi?id=90703
5547
5548 Reviewed by Michael Saboff.
5549
5550 It turns out that in my object model refactoring, I managed to fix get_by_pname in all
5551 execution engines except 64-bit baseline JIT.
5552
5553 * jit/JITPropertyAccess.cpp:
5554 (JSC::JIT::emit_op_get_by_pname):
5555
commit-queue@webkit.org650e3e62012-07-06 20:41:09 +000055562012-07-06 Pravin D <pravind.2k4@gmail.com>
5557
5558 Build Error on Qt Linux build
5559 https://bugs.webkit.org/show_bug.cgi?id=90699
5560
5561 Reviewed by Laszlo Gombos.
5562
5563 * parser/Parser.cpp:
5564 (JSC::::parseForStatement):
5565 Removed unused boolean variable as this was causing build error on Qt Linux.
5566
commit-queue@webkit.orgc182dfc2012-07-06 17:39:20 +000055672012-07-06 Nuno Lopes <nlopes@apple.com>
5568
5569 Fix build with recent clang.
5570 https://bugs.webkit.org/show_bug.cgi?id=90634
5571
5572 Reviewed by Oliver Hunt.
5573
5574 * jit/SpecializedThunkJIT.h:
5575 (JSC::SpecializedThunkJIT::SpecializedThunkJIT):
5576 (SpecializedThunkJIT):
5577 * jit/ThunkGenerators.cpp:
5578 (JSC::charCodeAtThunkGenerator):
5579 (JSC::charAtThunkGenerator):
5580 (JSC::fromCharCodeThunkGenerator):
5581 (JSC::sqrtThunkGenerator):
5582 (JSC::floorThunkGenerator):
5583 (JSC::ceilThunkGenerator):
5584 (JSC::roundThunkGenerator):
5585 (JSC::expThunkGenerator):
5586 (JSC::logThunkGenerator):
5587 (JSC::absThunkGenerator):
5588 (JSC::powThunkGenerator):
5589 * parser/ASTBuilder.h:
5590 (JSC::ASTBuilder::createAssignResolve):
5591 (JSC::ASTBuilder::createForLoop):
5592 (JSC::ASTBuilder::createForInLoop):
5593 (JSC::ASTBuilder::makeAssignNode):
5594 (JSC::ASTBuilder::makePrefixNode):
5595 (JSC::ASTBuilder::makePostfixNode):
5596 * parser/NodeConstructors.h:
5597 (JSC::PostfixErrorNode::PostfixErrorNode):
5598 (JSC::PrefixErrorNode::PrefixErrorNode):
5599 (JSC::AssignResolveNode::AssignResolveNode):
5600 (JSC::AssignErrorNode::AssignErrorNode):
5601 (JSC::ForNode::ForNode):
5602 (JSC::ForInNode::ForInNode):
5603 * parser/Nodes.h:
5604 (FunctionCallResolveNode):
5605 (PostfixErrorNode):
5606 (PrefixErrorNode):
5607 (ReadModifyResolveNode):
5608 (AssignResolveNode):
5609 (AssignErrorNode):
5610 (ForNode):
5611 (ForInNode):
5612 * parser/Parser.cpp:
5613 (JSC::::parseVarDeclarationList):
5614 (JSC::::parseForStatement):
5615 * parser/SyntaxChecker.h:
5616 (JSC::SyntaxChecker::createAssignResolve):
5617 (JSC::SyntaxChecker::createForLoop):
5618
zherczeg@webkit.orgb3b18db2012-07-06 08:42:29 +000056192012-07-06 Zoltan Herczeg <zherczeg@webkit.org>
5620
5621 [Qt][ARM] REGRESSION(r121885): It broke 30 jsc tests, 500+ layout tests
5622 https://bugs.webkit.org/show_bug.cgi?id=90656
5623
5624 Reviewed by Csaba Osztrogonác.
5625
5626 Typo fixes.
5627
5628 * assembler/MacroAssemblerARM.cpp:
5629 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
5630 Rename getOp2Byte() -> getOp2Half()
5631 * assembler/MacroAssemblerARMv7.h:
5632 (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
5633 Add a necessary space.
5634 * jit/JITStubs.cpp:
5635 (JSC):
5636 Revert INLINE_ARM_FUNCTION macro.
5637
fpizlo@apple.come26c6d22012-07-06 07:01:35 +000056382012-07-05 Filip Pizlo <fpizlo@apple.com>
5639
5640 REGRESSION(r121925): It broke 5 sputnik tests on x86 platforms
5641 https://bugs.webkit.org/show_bug.cgi?id=90658
5642
5643 Reviewed by Zoltan Herczeg.
5644
5645 Under the new object model, out-of-line property accesses such as those
5646 in ResolveGlobal must account for the fact that the offset to the Kth
5647 property is represented by K + inlineStorageCapacity. Hence, the property
5648 loads in ResolveGlobal must have an additional -inlineStorageCapacity *
5649 sizeof(JSValue) offset.
5650
5651 * dfg/DFGSpeculativeJIT32_64.cpp:
5652 (JSC::DFG::SpeculativeJIT::compile):
5653
ossy@webkit.orgc5b75fd2012-07-06 04:52:26 +000056542012-07-05 Csaba Osztrogonác <ossy@webkit.org>
5655
5656 [Qt] Unreviewed 64 bit buildfix after r121925.
5657
5658 * bytecode/PutByIdStatus.cpp:
5659 (JSC::PutByIdStatus::computeFromLLInt):
5660
msaboff@apple.comb1b64c72012-07-06 00:04:05 +000056612012-07-05 Michael Saboff <msaboff@apple.com>
5662
5663 JSString::tryHashConstLock() fails to get exclusive lock
5664 https://bugs.webkit.org/show_bug.cgi?id=90639
5665
5666 Reviewed by Oliver Hunt.
5667
5668 Added check that the string is already locked even before compare and swap.
5669
5670 * heap/MarkStack.cpp:
5671 (JSC::JSString::tryHashConstLock):
5672
fpizlo@apple.comd68b1f82012-07-05 22:55:51 +000056732012-07-04 Filip Pizlo <fpizlo@apple.com>
5674
5675 Inline property storage should not be wasted when it is exhausted
5676 https://bugs.webkit.org/show_bug.cgi?id=90347
5677
5678 Reviewed by Gavin Barraclough.
5679
5680 Previously, if we switched an object from using inline storage to out-of-line
5681 storage, we would abandon the inline storage. This would have two main implications:
5682 (i) all accesses to the object, even for properties that were previously in inline
5683 storage, must now take an extra indirection; and (ii) we waste a non-trivial amount
5684 of space since we must allocate additional out-of-line storage to hold properties
5685 that would have fit in the inline storage. There's also the copying cost when
5686 switching to out-of-line storage - we must copy all inline properties into ouf-of-line
5687 storage.
5688
5689 This patch changes the way that object property storage works so that we can use both
5690 inline and out-of-line storage concurrently. This is accomplished by introducing a
5691 new notion of property offset. This PropertyOffset is a 32-bit signed integer and it
5692 behaves as follows:
5693
5694 offset == -1: invalid offset, indicating a property that does not exist.
5695
5696 0 <= offset <= inlineStorageCapacity: offset into inline storage.
5697
5698 inlineStorageCapacity < offset: offset into out-of-line storage.
5699
5700 Because non-final objects don't have inline storage, the only valid PropertyOffsets
5701 for those objects' properties are -1 or > inlineStorageCapacity.
5702
5703 This now means that the decision to use inline or out-of-line storage for an access is
5704 made based on the offset, rather than the structure. It also means that any access
5705 where the offset is a variable must have an extra branch, unless the type of the
5706 object is also known (if it's known to be a non-final object then we can just assert
5707 that the offset is >= inlineStorageCapacity).
5708
5709 This looks like a big Kraken speed-up and a slight V8 speed-up.
5710
5711 * GNUmakefile.list.am:
5712 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5713 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5714 * JavaScriptCore.xcodeproj/project.pbxproj:
5715 * assembler/ARMv7Assembler.h:
5716 (ARMv7Assembler):
5717 (JSC::ARMv7Assembler::ldrWide8BitImmediate):
5718 (JSC::ARMv7Assembler::replaceWithLoad):
5719 (JSC::ARMv7Assembler::replaceWithAddressComputation):
5720 * assembler/AbstractMacroAssembler.h:
5721 (AbstractMacroAssembler):
5722 (ConvertibleLoadLabel):
5723 (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::ConvertibleLoadLabel):
5724 (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::isSet):
5725 (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
5726 (JSC::AbstractMacroAssembler::replaceWithLoad):
5727 (JSC::AbstractMacroAssembler::replaceWithAddressComputation):
5728 * assembler/CodeLocation.h:
5729 (JSC):
5730 (CodeLocationCommon):
5731 (CodeLocationConvertibleLoad):
5732 (JSC::CodeLocationConvertibleLoad::CodeLocationConvertibleLoad):
5733 (JSC::CodeLocationCommon::convertibleLoadAtOffset):
5734 * assembler/LinkBuffer.cpp:
5735 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
5736 * assembler/LinkBuffer.h:
5737 (LinkBuffer):
5738 (JSC::LinkBuffer::locationOf):
5739 * assembler/MacroAssemblerARMv7.h:
5740 (MacroAssemblerARMv7):
5741 (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
5742 * assembler/MacroAssemblerX86.h:
5743 (JSC::MacroAssemblerX86::convertibleLoadPtr):
5744 (MacroAssemblerX86):
5745 * assembler/MacroAssemblerX86_64.h:
5746 (JSC::MacroAssemblerX86_64::convertibleLoadPtr):
5747 (MacroAssemblerX86_64):
5748 * assembler/RepatchBuffer.h:
5749 (RepatchBuffer):
5750 (JSC::RepatchBuffer::replaceWithLoad):
5751 (JSC::RepatchBuffer::replaceWithAddressComputation):
5752 (JSC::RepatchBuffer::setLoadInstructionIsActive):
5753 * assembler/X86Assembler.h:
5754 (JSC::X86Assembler::replaceWithLoad):
5755 (X86Assembler):
5756 (JSC::X86Assembler::replaceWithAddressComputation):
5757 * bytecode/CodeBlock.cpp:
5758 (JSC::CodeBlock::printGetByIdOp):
5759 (JSC::CodeBlock::dump):
5760 (JSC::CodeBlock::finalizeUnconditionally):
5761 * bytecode/GetByIdStatus.cpp:
5762 (JSC::GetByIdStatus::computeFromLLInt):
5763 (JSC::GetByIdStatus::computeForChain):
5764 (JSC::GetByIdStatus::computeFor):
5765 * bytecode/GetByIdStatus.h:
5766 (JSC::GetByIdStatus::GetByIdStatus):
5767 (JSC::GetByIdStatus::offset):
5768 (GetByIdStatus):
5769 * bytecode/Opcode.h:
5770 (JSC):
5771 (JSC::padOpcodeName):
5772 * bytecode/PutByIdStatus.cpp:
5773 (JSC::PutByIdStatus::computeFromLLInt):
5774 (JSC::PutByIdStatus::computeFor):
5775 * bytecode/PutByIdStatus.h:
5776 (JSC::PutByIdStatus::PutByIdStatus):
5777 (JSC::PutByIdStatus::offset):
5778 (PutByIdStatus):
5779 * bytecode/ResolveGlobalStatus.cpp:
5780 (JSC):
5781 (JSC::computeForStructure):
5782 * bytecode/ResolveGlobalStatus.h:
5783 (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
5784 (JSC::ResolveGlobalStatus::offset):
5785 (ResolveGlobalStatus):
5786 * bytecode/StructureSet.h:
5787 (StructureSet):
5788 * bytecode/StructureStubInfo.h:
5789 * dfg/DFGByteCodeParser.cpp:
5790 (ByteCodeParser):
5791 (JSC::DFG::ByteCodeParser::handleGetByOffset):
5792 (JSC::DFG::ByteCodeParser::handleGetById):
5793 (JSC::DFG::ByteCodeParser::parseBlock):
5794 * dfg/DFGCapabilities.h:
5795 (JSC::DFG::canCompileOpcode):
5796 * dfg/DFGJITCompiler.cpp:
5797 (JSC::DFG::JITCompiler::link):
5798 * dfg/DFGJITCompiler.h:
5799 (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
5800 (PropertyAccessRecord):
5801 * dfg/DFGRepatch.cpp:
5802 (JSC::DFG::dfgRepatchByIdSelfAccess):
5803 (JSC::DFG::generateProtoChainAccessStub):
5804 (JSC::DFG::tryCacheGetByID):
5805 (JSC::DFG::tryBuildGetByIDList):
5806 (JSC::DFG::tryBuildGetByIDProtoList):
5807 (JSC::DFG::emitPutReplaceStub):
5808 (JSC::DFG::emitPutTransitionStub):
5809 (JSC::DFG::tryCachePutByID):
5810 (JSC::DFG::tryBuildPutByIdList):
5811 * dfg/DFGSpeculativeJIT.h:
5812 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
5813 * dfg/DFGSpeculativeJIT32_64.cpp:
5814 (JSC::DFG::SpeculativeJIT::cachedGetById):
5815 (JSC::DFG::SpeculativeJIT::cachedPutById):
5816 (JSC::DFG::SpeculativeJIT::compile):
5817 * dfg/DFGSpeculativeJIT64.cpp:
5818 (JSC::DFG::SpeculativeJIT::cachedGetById):
5819 (JSC::DFG::SpeculativeJIT::cachedPutById):
5820 (JSC::DFG::SpeculativeJIT::compile):
5821 * heap/MarkStack.cpp:
5822 (JSC::visitChildren):
5823 * interpreter/Interpreter.cpp:
5824 (JSC::Interpreter::tryCacheGetByID):
5825 (JSC::Interpreter::privateExecute):
5826 * jit/JIT.cpp:
5827 (JSC::JIT::privateCompileMainPass):
5828 (JSC::JIT::privateCompileSlowCases):
5829 (JSC::PropertyStubCompilationInfo::copyToStubInfo):
5830 * jit/JIT.h:
5831 (JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
5832 (JSC::JIT::compileGetByIdProto):
5833 (JSC::JIT::compileGetByIdSelfList):
5834 (JSC::JIT::compileGetByIdProtoList):
5835 (JSC::JIT::compileGetByIdChainList):
5836 (JSC::JIT::compileGetByIdChain):
5837 (JSC::JIT::compilePutByIdTransition):
5838 (JIT):
5839 * jit/JITInlineMethods.h:
5840 (JSC::JIT::emitAllocateBasicJSObject):
5841 * jit/JITOpcodes.cpp:
5842 (JSC::JIT::emit_op_resolve_global):
5843 * jit/JITOpcodes32_64.cpp:
5844 (JSC::JIT::emit_op_resolve_global):
5845 * jit/JITPropertyAccess.cpp:
5846 (JSC::JIT::compileGetDirectOffset):
5847 (JSC::JIT::emit_op_method_check):
5848 (JSC::JIT::compileGetByIdHotPath):
5849 (JSC::JIT::emit_op_put_by_id):
5850 (JSC::JIT::compilePutDirectOffset):
5851 (JSC::JIT::privateCompilePutByIdTransition):
5852 (JSC::JIT::patchGetByIdSelf):
5853 (JSC::JIT::patchPutByIdReplace):
5854 (JSC::JIT::privateCompileGetByIdProto):
5855 (JSC::JIT::privateCompileGetByIdSelfList):
5856 (JSC::JIT::privateCompileGetByIdProtoList):
5857 (JSC::JIT::privateCompileGetByIdChainList):
5858 (JSC::JIT::privateCompileGetByIdChain):
5859 * jit/JITPropertyAccess32_64.cpp:
5860 (JSC::JIT::emit_op_method_check):
5861 (JSC::JIT::compileGetByIdHotPath):
5862 (JSC::JIT::emit_op_put_by_id):
5863 (JSC::JIT::compilePutDirectOffset):
5864 (JSC::JIT::compileGetDirectOffset):
5865 (JSC::JIT::privateCompilePutByIdTransition):
5866 (JSC::JIT::patchGetByIdSelf):
5867 (JSC::JIT::patchPutByIdReplace):
5868 (JSC::JIT::privateCompileGetByIdProto):
5869 (JSC::JIT::privateCompileGetByIdSelfList):
5870 (JSC::JIT::privateCompileGetByIdProtoList):
5871 (JSC::JIT::privateCompileGetByIdChainList):
5872 (JSC::JIT::privateCompileGetByIdChain):
5873 (JSC::JIT::emit_op_get_by_pname):
5874 * jit/JITStubs.cpp:
5875 (JSC::JITThunks::tryCacheGetByID):
5876 (JSC::DEFINE_STUB_FUNCTION):
5877 * llint/LLIntSlowPaths.cpp:
5878 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
5879 * llint/LowLevelInterpreter.asm:
5880 * llint/LowLevelInterpreter32_64.asm:
5881 * llint/LowLevelInterpreter64.asm:
5882 * offlineasm/x86.rb:
5883 * runtime/JSGlobalObject.h:
5884 (JSGlobalObject):
5885 (JSC::JSGlobalObject::functionNameOffset):
5886 * runtime/JSObject.cpp:
5887 (JSC::JSObject::visitChildren):
5888 (JSC):
5889 (JSC::JSFinalObject::visitChildren):
5890 (JSC::JSObject::put):
5891 (JSC::JSObject::deleteProperty):
5892 (JSC::JSObject::getPropertySpecificValue):
5893 (JSC::JSObject::removeDirect):
5894 (JSC::JSObject::growOutOfLineStorage):
5895 (JSC::JSObject::getOwnPropertyDescriptor):
5896 * runtime/JSObject.h:
5897 (JSObject):
5898 (JSC::JSObject::getDirect):
5899 (JSC::JSObject::getDirectLocation):
5900 (JSC::JSObject::hasInlineStorage):
5901 (JSC::JSObject::inlineStorageUnsafe):
5902 (JSC::JSObject::inlineStorage):
5903 (JSC::JSObject::outOfLineStorage):
5904 (JSC::JSObject::locationForOffset):
5905 (JSC::JSObject::offsetForLocation):
5906 (JSC::JSObject::getDirectOffset):
5907 (JSC::JSObject::putDirectOffset):
5908 (JSC::JSObject::putUndefinedAtDirectOffset):
5909 (JSC::JSObject::addressOfOutOfLineStorage):
5910 (JSC::JSObject::finishCreation):
5911 (JSC::JSNonFinalObject::JSNonFinalObject):
5912 (JSC::JSNonFinalObject::finishCreation):
5913 (JSFinalObject):
5914 (JSC::JSFinalObject::finishCreation):
5915 (JSC::JSFinalObject::JSFinalObject):
5916 (JSC::JSObject::offsetOfOutOfLineStorage):
5917 (JSC::JSObject::setOutOfLineStorage):
5918 (JSC::JSObject::JSObject):
5919 (JSC):
5920 (JSC::JSCell::fastGetOwnProperty):
5921 (JSC::JSObject::putDirectInternal):
5922 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
5923 (JSC::JSObject::putDirectWithoutTransition):
5924 (JSC::offsetRelativeToPatchedStorage):
5925 (JSC::indexRelativeToBase):
5926 (JSC::offsetRelativeToBase):
5927 * runtime/JSPropertyNameIterator.cpp:
5928 (JSC::JSPropertyNameIterator::create):
5929 * runtime/JSPropertyNameIterator.h:
5930 (JSPropertyNameIterator):
5931 (JSC::JSPropertyNameIterator::getOffset):
5932 (JSC::JSPropertyNameIterator::finishCreation):
5933 * runtime/JSValue.cpp:
5934 (JSC::JSValue::putToPrimitive):
5935 * runtime/Operations.h:
5936 (JSC::normalizePrototypeChain):
5937 * runtime/Options.cpp:
5938 (JSC):
5939 (JSC::Options::initialize):
5940 * runtime/PropertyMapHashTable.h:
5941 (PropertyMapEntry):
5942 (JSC::PropertyMapEntry::PropertyMapEntry):
5943 (PropertyTable):
5944 (JSC::PropertyTable::PropertyTable):
5945 (JSC::PropertyTable::getDeletedOffset):
5946 (JSC::PropertyTable::addDeletedOffset):
5947 (JSC::PropertyTable::nextOffset):
5948 (JSC):
5949 (JSC::PropertyTable::sizeInMemory):
5950 * runtime/PropertyOffset.h: Added.
5951 (JSC):
5952 (JSC::checkOffset):
5953 (JSC::validateOffset):
5954 (JSC::isValidOffset):
5955 (JSC::isInlineOffset):
5956 (JSC::isOutOfLineOffset):
5957 (JSC::offsetInInlineStorage):
5958 (JSC::offsetInOutOfLineStorage):
5959 (JSC::offsetInRespectiveStorage):
5960 (JSC::numberOfOutOfLineSlotsForLastOffset):
5961 (JSC::numberOfSlotsForLastOffset):
5962 (JSC::nextPropertyOffsetFor):
5963 (JSC::firstPropertyOffsetFor):
5964 * runtime/PropertySlot.h:
5965 (JSC::PropertySlot::cachedOffset):
5966 (JSC::PropertySlot::setValue):
5967 (JSC::PropertySlot::setCacheableGetterSlot):
5968 (JSC::PropertySlot::clearOffset):
5969 * runtime/PutPropertySlot.h:
5970 (JSC::PutPropertySlot::setExistingProperty):
5971 (JSC::PutPropertySlot::setNewProperty):
5972 (JSC::PutPropertySlot::cachedOffset):
5973 (PutPropertySlot):
5974 * runtime/Structure.cpp:
5975 (JSC::Structure::Structure):
5976 (JSC::Structure::materializePropertyMap):
5977 (JSC::nextOutOfLineStorageCapacity):
5978 (JSC::Structure::growOutOfLineCapacity):
5979 (JSC::Structure::suggestedNewOutOfLineStorageCapacity):
5980 (JSC::Structure::addPropertyTransitionToExistingStructure):
5981 (JSC::Structure::addPropertyTransition):
5982 (JSC::Structure::removePropertyTransition):
5983 (JSC::Structure::flattenDictionaryStructure):
5984 (JSC::Structure::addPropertyWithoutTransition):
5985 (JSC::Structure::removePropertyWithoutTransition):
5986 (JSC::Structure::copyPropertyTableForPinning):
5987 (JSC::Structure::get):
5988 (JSC::Structure::putSpecificValue):
5989 (JSC::Structure::remove):
5990 * runtime/Structure.h:
5991 (Structure):
5992 (JSC::Structure::putWillGrowOutOfLineStorage):
5993 (JSC::Structure::previousID):
5994 (JSC::Structure::outOfLineCapacity):
5995 (JSC::Structure::outOfLineSizeForKnownFinalObject):
5996 (JSC::Structure::outOfLineSizeForKnownNonFinalObject):
5997 (JSC::Structure::outOfLineSize):
5998 (JSC::Structure::hasInlineStorage):
5999 (JSC::Structure::inlineCapacity):
6000 (JSC::Structure::inlineSizeForKnownFinalObject):
6001 (JSC::Structure::inlineSize):
6002 (JSC::Structure::totalStorageSize):
6003 (JSC::Structure::totalStorageCapacity):
6004 (JSC::Structure::firstValidOffset):
6005 (JSC::Structure::lastValidOffset):
6006 (JSC::Structure::isValidOffset):
6007 (JSC::Structure::isEmpty):
6008 (JSC::Structure::transitionCount):
6009 (JSC::Structure::get):
6010
oliver@apple.com5635b542012-07-05 20:36:37 +000060112012-07-05 Oliver Hunt <oliver@apple.com>
6012
6013 JSObjectCallAsFunction should thisConvert the provided thisObject
6014 https://bugs.webkit.org/show_bug.cgi?id=90628
6015
6016 Reviewed by Gavin Barraclough.
6017
6018 Perform this conversion on the provided this object.
6019
6020 * API/JSObjectRef.cpp:
6021 (JSObjectCallAsFunction):
6022
zherczeg@webkit.orgd6e661f2012-07-05 07:04:16 +000060232012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
6024
zherczeg@webkit.orgda8c37d2012-07-05 07:53:51 +00006025 [Qt] Unreviewed buildfix after r121886. Typo fix.
6026
6027 * assembler/MacroAssemblerARM.cpp:
6028 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
6029
60302012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
6031
zherczeg@webkit.orgd6e661f2012-07-05 07:04:16 +00006032 Port DFG JIT to traditional ARM
6033 https://bugs.webkit.org/show_bug.cgi?id=90198
6034
6035 Reviewed by Filip Pizlo.
6036
6037 This patch contains the macro assembler part of the
6038 DFG JIT support on ARM systems with fixed 32 bit instruction
6039 width. A large amount of old code was refactored, and the ARMv4
6040 or lower support is removed from the macro assembler.
6041
6042 Sunspider is improved by 8%, and V8 is 92%.
6043
6044 * assembler/ARMAssembler.cpp:
6045 (JSC::ARMAssembler::dataTransfer32):
6046 (JSC::ARMAssembler::baseIndexTransfer32):
6047 (JSC):
6048 (JSC::ARMAssembler::dataTransfer16):
6049 (JSC::ARMAssembler::baseIndexTransfer16):
6050 (JSC::ARMAssembler::dataTransferFloat):
6051 (JSC::ARMAssembler::baseIndexTransferFloat):
6052 (JSC::ARMAssembler::executableCopy):
6053 * assembler/ARMAssembler.h:
6054 (JSC::ARMAssembler::ARMAssembler):
6055 (JSC::ARMAssembler::emitInst):
6056 (JSC::ARMAssembler::vmov_f64_r):
6057 (ARMAssembler):
6058 (JSC::ARMAssembler::vabs_f64_r):
6059 (JSC::ARMAssembler::vneg_f64_r):
6060 (JSC::ARMAssembler::ldr_imm):
6061 (JSC::ARMAssembler::ldr_un_imm):
6062 (JSC::ARMAssembler::dtr_u):
6063 (JSC::ARMAssembler::dtr_ur):
6064 (JSC::ARMAssembler::dtr_d):
6065 (JSC::ARMAssembler::dtr_dr):
6066 (JSC::ARMAssembler::dtrh_u):
6067 (JSC::ARMAssembler::dtrh_ur):
6068 (JSC::ARMAssembler::dtrh_d):
6069 (JSC::ARMAssembler::dtrh_dr):
6070 (JSC::ARMAssembler::fdtr_u):
6071 (JSC::ARMAssembler::fdtr_d):
6072 (JSC::ARMAssembler::push_r):
6073 (JSC::ARMAssembler::pop_r):
6074 (JSC::ARMAssembler::poke_r):
6075 (JSC::ARMAssembler::peek_r):
6076 (JSC::ARMAssembler::vmov_vfp64_r):
6077 (JSC::ARMAssembler::vmov_arm64_r):
6078 (JSC::ARMAssembler::vmov_vfp32_r):
6079 (JSC::ARMAssembler::vmov_arm32_r):
6080 (JSC::ARMAssembler::vcvt_u32_f64_r):
6081 (JSC::ARMAssembler::vcvt_f64_f32_r):
6082 (JSC::ARMAssembler::vcvt_f32_f64_r):
6083 (JSC::ARMAssembler::clz_r):
6084 (JSC::ARMAssembler::bkpt):
6085 (JSC::ARMAssembler::bx):
6086 (JSC::ARMAssembler::blx):
6087 (JSC::ARMAssembler::labelIgnoringWatchpoints):
6088 (JSC::ARMAssembler::labelForWatchpoint):
6089 (JSC::ARMAssembler::label):
6090 (JSC::ARMAssembler::getLdrImmAddress):
6091 (JSC::ARMAssembler::replaceWithJump):
6092 (JSC::ARMAssembler::maxJumpReplacementSize):
6093 (JSC::ARMAssembler::getOp2Byte):
6094 (JSC::ARMAssembler::getOp2Half):
6095 (JSC::ARMAssembler::RM):
6096 (JSC::ARMAssembler::RS):
6097 (JSC::ARMAssembler::RD):
6098 (JSC::ARMAssembler::RN):
6099 * assembler/AssemblerBufferWithConstantPool.h:
6100 (JSC::AssemblerBufferWithConstantPool::ensureSpaceForAnyInstruction):
6101 * assembler/MacroAssemblerARM.cpp:
6102 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
6103 * assembler/MacroAssemblerARM.h:
6104 (JSC::MacroAssemblerARM::add32):
6105 (MacroAssemblerARM):
6106 (JSC::MacroAssemblerARM::and32):
6107 (JSC::MacroAssemblerARM::lshift32):
6108 (JSC::MacroAssemblerARM::mul32):
6109 (JSC::MacroAssemblerARM::neg32):
6110 (JSC::MacroAssemblerARM::rshift32):
6111 (JSC::MacroAssemblerARM::urshift32):
6112 (JSC::MacroAssemblerARM::xor32):
6113 (JSC::MacroAssemblerARM::load8):
6114 (JSC::MacroAssemblerARM::load8Signed):
6115 (JSC::MacroAssemblerARM::load16):
6116 (JSC::MacroAssemblerARM::load16Signed):
6117 (JSC::MacroAssemblerARM::load32):
6118 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
6119 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
6120 (JSC::MacroAssemblerARM::store8):
6121 (JSC::MacroAssemblerARM::store16):
6122 (JSC::MacroAssemblerARM::store32):
6123 (JSC::MacroAssemblerARM::move):
6124 (JSC::MacroAssemblerARM::jump):
6125 (JSC::MacroAssemblerARM::branchAdd32):
6126 (JSC::MacroAssemblerARM::mull32):
6127 (JSC::MacroAssemblerARM::branchMul32):
6128 (JSC::MacroAssemblerARM::nearCall):
6129 (JSC::MacroAssemblerARM::compare32):
6130 (JSC::MacroAssemblerARM::test32):
6131 (JSC::MacroAssemblerARM::sub32):
6132 (JSC::MacroAssemblerARM::call):
6133 (JSC::MacroAssemblerARM::loadFloat):
6134 (JSC::MacroAssemblerARM::loadDouble):
6135 (JSC::MacroAssemblerARM::storeFloat):
6136 (JSC::MacroAssemblerARM::storeDouble):
6137 (JSC::MacroAssemblerARM::moveDouble):
6138 (JSC::MacroAssemblerARM::addDouble):
6139 (JSC::MacroAssemblerARM::divDouble):
6140 (JSC::MacroAssemblerARM::subDouble):
6141 (JSC::MacroAssemblerARM::mulDouble):
6142 (JSC::MacroAssemblerARM::absDouble):
6143 (JSC::MacroAssemblerARM::negateDouble):
6144 (JSC::MacroAssemblerARM::convertInt32ToDouble):
6145 (JSC::MacroAssemblerARM::convertFloatToDouble):
6146 (JSC::MacroAssemblerARM::convertDoubleToFloat):
6147 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
6148 (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
6149 (JSC::MacroAssemblerARM::truncateDoubleToInt32):
6150 (JSC::MacroAssemblerARM::truncateDoubleToUint32):
6151 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
6152 (JSC::MacroAssemblerARM::branchDoubleNonZero):
6153 (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
6154 (JSC::MacroAssemblerARM::invert):
6155 (JSC::MacroAssemblerARM::replaceWithJump):
6156 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
6157 (JSC::MacroAssemblerARM::call32):
6158 * assembler/SH4Assembler.h:
6159 (JSC::SH4Assembler::label):
6160 * dfg/DFGAssemblyHelpers.h:
6161 (JSC::DFG::AssemblyHelpers::debugCall):
6162 (JSC::DFG::AssemblyHelpers::boxDouble):
6163 (JSC::DFG::AssemblyHelpers::unboxDouble):
6164 * dfg/DFGCCallHelpers.h:
6165 (CCallHelpers):
6166 (JSC::DFG::CCallHelpers::setupArguments):
6167 * dfg/DFGFPRInfo.h:
6168 (DFG):
6169 * dfg/DFGGPRInfo.h:
6170 (DFG):
6171 (GPRInfo):
6172 * dfg/DFGOperations.cpp:
6173 (JSC):
6174 * dfg/DFGSpeculativeJIT.h:
6175 (SpeculativeJIT):
6176 (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult):
6177 (JSC::DFG::SpeculativeJIT::appendCallSetResult):
6178 * jit/JITStubs.cpp:
6179 (JSC):
6180 * jit/JITStubs.h:
6181 (JITStackFrame):
6182 * jit/JSInterfaceJIT.h:
6183 (JSInterfaceJIT):
6184
commit-queue@webkit.orgd106bf22012-07-04 21:36:52 +000061852012-07-04 Anthony Scian <ascian@rim.com>
6186
6187 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
6188 https://bugs.webkit.org/show_bug.cgi?id=40118
6189
6190 Reviewed by Yong Li.
6191
6192 Added member functions to expose function name, urlString, and line #.
6193 Refactored toString to make use of these member functions to reduce
6194 duplicated code for future maintenance.
6195
6196 Manually tested refactoring of toString by tracing thrown exceptions.
6197
6198 * interpreter/Interpreter.h:
6199 (JSC::StackFrame::toString):
6200 (JSC::StackFrame::friendlySourceURL):
6201 (JSC::StackFrame::friendlyFunctionName):
6202 (JSC::StackFrame::friendlyLineNumber):
6203
wingo@igalia.com17649d82012-07-04 20:32:26 +000062042012-07-04 Andy Wingo <wingo@igalia.com>
6205
6206 [GTK] Enable parallel GC
6207 https://bugs.webkit.org/show_bug.cgi?id=90568
6208
6209 Reviewed by Martin Robinson.
6210
6211 * runtime/Options.cpp: Include <algorithm.h> for std::min.
6212
commit-queue@webkit.org1fcb31a2012-07-04 16:16:01 +000062132012-07-04 John Mellor <johnme@chromium.org>
6214
6215 Text Autosizing: Add compile flag and runtime setting
6216 https://bugs.webkit.org/show_bug.cgi?id=87394
6217
6218 This patch renames Font Boosting to Text Autosizing.
6219
6220 Reviewed by Adam Barth.
6221
6222 * Configurations/FeatureDefines.xcconfig:
6223
msaboff@apple.comd08f3502012-07-03 22:57:00 +000062242012-07-03 Michael Saboff <msaboff@apple.com>
6225
6226 Enh: Hash Const JSString in Backing Stores to Save Memory
6227 https://bugs.webkit.org/show_bug.cgi?id=86024
6228
6229 Reviewed by Oliver Hunt.
6230
6231 During garbage collection, each marking thread keeps a HashMap of
6232 strings. While visiting via MarkStack::copyAndAppend(), we check to
6233 see if the string we are visiting is already in the HashMap. If not
6234 we add it. If so, we change the reference to the current string we're
6235 visiting to the prior string.
6236
6237 To reduce the performance impact of this change, two throttles have
6238 ben added. 1) We only try hash consting if a significant number of new
6239 strings have been created since the last hash const. Currently this is
6240 set at 100 strings. 2) If a string is unique at the end of a marking
6241 it will not be checked during further GC phases. In some cases this
6242 won't catch all duplicates, but we are trying to catch the growth of
6243 duplicate strings.
6244
6245 * heap/Heap.cpp:
6246 (JSC::Heap::markRoots):
6247 * heap/MarkStack.cpp:
6248 (JSC::MarkStackThreadSharedData::resetChildren):
6249 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
6250 (JSC::MarkStackThreadSharedData::reset):
6251 (JSC::MarkStack::setup): Check to see if enough strings have been created
6252 to hash const.
6253 (JSC::MarkStack::reset): Added call to clear m_uniqueStrings.
6254 (JSC::JSString::tryHashConstLock): New method to lock JSString for
6255 hash consting.
6256 (JSC::JSString::releaseHashConstLock): New unlock method.
6257 (JSC::JSString::shouldTryHashConst): Set of checks to see if we should
6258 try to hash const the string.
6259 (JSC::MarkStack::internalAppend): New method that performs the hash consting.
6260 (JSC::SlotVisitor::copyAndAppend): Changed to call the new hash
6261 consting internalAppend().
6262 * heap/MarkStack.h:
6263 (MarkStackThreadSharedData):
6264 (MarkStack):
6265 * runtime/JSGlobalData.cpp:
6266 (JSC::JSGlobalData::JSGlobalData):
6267 * runtime/JSGlobalData.h:
6268 (JSGlobalData):
6269 (JSC::JSGlobalData::haveEnoughNewStringsToHashConst):
6270 (JSC::JSGlobalData::resetNewStringsSinceLastHashConst):
6271 * runtime/JSString.h:
6272 (JSString): Changed from using bool flags to using an unsigned
6273 m_flags field. This works better with the weakCompareAndSwap in
6274 JSString::tryHashConstLock(). Changed the 8bitness setting and
6275 checking to use new accessors.
6276 (JSC::JSString::JSString):
6277 (JSC::JSString::finishCreation):
6278 (JSC::JSString::is8Bit): Updated for new m_flags.
6279 (JSC::JSString::setIs8Bit): New setter.
6280 New hash const flags accessors:
6281 (JSC::JSString::isHashConstSingleton):
6282 (JSC::JSString::clearHashConstSingleton):
6283 (JSC::JSString::setHashConstSingleton):
6284 (JSC::JSRopeString::finishCreation):
6285 (JSC::JSRopeString::append):
6286
tony@chromium.orga47ad862012-07-03 20:26:08 +000062872012-07-03 Tony Chang <tony@chromium.org>
6288
6289 [chromium] Unreviewed, update .gitignore to handle VS2010 files.
6290
6291 * JavaScriptCore.gyp/.gitignore:
6292
commit-queue@webkit.orgfbda60c2012-07-03 19:19:22 +000062932012-07-03 Mark Lam <mark.lam@apple.com>
6294
6295 Add ability to symbolically set and dump JSC VM options.
6296 See comments in runtime/Options.h for details on how the options work.
6297 https://bugs.webkit.org/show_bug.cgi?id=90420
6298
6299 Reviewed by Filip Pizlo.
6300
6301 * assembler/LinkBuffer.cpp:
6302 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
6303 * assembler/LinkBuffer.h:
6304 (JSC):
6305 * bytecode/CodeBlock.cpp:
6306 (JSC::CodeBlock::shouldOptimizeNow):
6307 * bytecode/CodeBlock.h:
6308 (JSC::CodeBlock::likelyToTakeSlowCase):
6309 (JSC::CodeBlock::couldTakeSlowCase):
6310 (JSC::CodeBlock::likelyToTakeSpecialFastCase):
6311 (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
6312 (JSC::CodeBlock::likelyToTakeAnySlowCase):
6313 (JSC::CodeBlock::jitAfterWarmUp):
6314 (JSC::CodeBlock::jitSoon):
6315 (JSC::CodeBlock::reoptimizationRetryCounter):
6316 (JSC::CodeBlock::countReoptimization):
6317 (JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
6318 (JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
6319 (JSC::CodeBlock::optimizeSoon):
6320 (JSC::CodeBlock::exitCountThresholdForReoptimization):
6321 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
6322 * bytecode/ExecutionCounter.h:
6323 (JSC::ExecutionCounter::clippedThreshold):
6324 * dfg/DFGByteCodeParser.cpp:
6325 (JSC::DFG::ByteCodeParser::handleInlining):
6326 * dfg/DFGCapabilities.h:
6327 (JSC::DFG::mightCompileEval):
6328 (JSC::DFG::mightCompileProgram):
6329 (JSC::DFG::mightCompileFunctionForCall):
6330 (JSC::DFG::mightCompileFunctionForConstruct):
6331 (JSC::DFG::mightInlineFunctionForCall):
6332 (JSC::DFG::mightInlineFunctionForConstruct):
6333 * dfg/DFGCommon.h:
6334 (JSC::DFG::shouldShowDisassembly):
6335 * dfg/DFGDriver.cpp:
6336 (JSC::DFG::compile):
6337 * dfg/DFGOSRExit.cpp:
6338 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
6339 * dfg/DFGVariableAccessData.h:
6340 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
6341 * heap/MarkStack.cpp:
6342 (JSC::MarkStackSegmentAllocator::allocate):
6343 (JSC::MarkStackSegmentAllocator::shrinkReserve):
6344 (JSC::MarkStackArray::MarkStackArray):
6345 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
6346 (JSC::SlotVisitor::donateKnownParallel):
6347 (JSC::SlotVisitor::drain):
6348 (JSC::SlotVisitor::drainFromShared):
6349 * heap/MarkStack.h:
6350 (JSC::MarkStack::mergeOpaqueRootsIfProfitable):
6351 (JSC::MarkStack::addOpaqueRoot):
6352 * heap/SlotVisitor.h:
6353 (JSC::SlotVisitor::donate):
6354 * jit/JIT.cpp:
6355 (JSC::JIT::emitOptimizationCheck):
6356 * jsc.cpp:
6357 (printUsageStatement):
6358 (parseArguments):
6359 * runtime/InitializeThreading.cpp:
6360 (JSC::initializeThreadingOnce):
6361 * runtime/JSGlobalData.cpp:
6362 (JSC::enableAssembler):
6363 * runtime/JSGlobalObject.cpp:
6364 (JSC::JSGlobalObject::JSGlobalObject):
6365 * runtime/Options.cpp:
6366 (JSC):
6367 (JSC::overrideOptionWithHeuristic):
6368 (JSC::Options::initialize):
6369 (JSC::Options::setOption):
6370 (JSC::Options::dumpAllOptions):
6371 (JSC::Options::dumpOption):
6372 * runtime/Options.h:
6373 (JSC):
6374 (Options):
6375 (EntryInfo):
6376
commit-queue@webkit.org337179a2012-07-03 13:43:13 +000063772012-07-03 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Joel Dillon <joel.dillon@codethink.co.uk>
6378
6379 [Qt][Win] Fix broken QtWebKit5.lib linking
6380 https://bugs.webkit.org/show_bug.cgi?id=88321
6381
6382 Reviewed by Kenneth Rohde Christiansen.
6383
6384 The goal is to have different ports build systems define STATICALLY_LINKED_WITH_WTF
6385 when building JavaScriptCore, if both are packaged in the same DLL, instead
6386 of relying on the code to handle this.
6387 The effects of BUILDING_* and STATICALLY_LINKED_WITH_* are currently the same
6388 except for a check in Source/JavaScriptCore/config.h.
6389
6390 Keeping the old way for the WX port as requested by the port's contributors.
6391 For non-Windows ports there is no difference between IMPORT and EXPORT, no
6392 change is needed.
6393
6394 * API/JSBase.h:
6395 JS symbols shouldn't be included by WTF objects anymore. Remove the export when BUILDING_WTF.
6396 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
6397 Make sure that JavaScriptCore uses import symbols of WTF for the Win port.
6398 * runtime/JSExportMacros.h:
6399
fpizlo@apple.comaedde2e2012-07-03 00:10:08 +000064002012-07-02 Filip Pizlo <fpizlo@apple.com>
6401
fpizlo@apple.com8618e4b2012-07-03 01:27:16 +00006402 DFG OSR exit value recoveries should be computed lazily
6403 https://bugs.webkit.org/show_bug.cgi?id=82155
6404
6405 Reviewed by Gavin Barraclough.
6406
6407 This change aims to reduce one aspect of DFG compile times: the fact
6408 that we currently compute the value recoveries for each local and
6409 argument on every speculation check. We compile many speculation checks,
6410 so this can add up quick. The strategy that this change takes is to
6411 have the DFG save just enough information about how the compiler is
6412 choosing to represent state, that the DFG::OSRExitCompiler can reify
6413 the value recoveries lazily.
6414
6415 This appears to be an 0.3% SunSpider speed-up and is neutral elsewhere.
6416
6417 I also took the opportunity to fix the sampling regions profiler (it
6418 was missing an export macro) and to put in more sampling regions in
6419 the DFG (which are disabled so long as ENABLE(SAMPLING_REGIONS) is
6420 false).
6421
6422 * CMakeLists.txt:
6423 * GNUmakefile.list.am:
6424 * JavaScriptCore.xcodeproj/project.pbxproj:
6425 * Target.pri:
6426 * bytecode/CodeBlock.cpp:
6427 (JSC):
6428 (JSC::CodeBlock::shrinkDFGDataToFit):
6429 * bytecode/CodeBlock.h:
6430 (CodeBlock):
6431 (JSC::CodeBlock::minifiedDFG):
6432 (JSC::CodeBlock::variableEventStream):
6433 (DFGData):
6434 * bytecode/Operands.h:
6435 (JSC::Operands::hasOperand):
6436 (Operands):
6437 (JSC::Operands::size):
6438 (JSC::Operands::at):
6439 (JSC::Operands::operator[]):
6440 (JSC::Operands::isArgument):
6441 (JSC::Operands::isVariable):
6442 (JSC::Operands::argumentForIndex):
6443 (JSC::Operands::variableForIndex):
6444 (JSC::Operands::operandForIndex):
6445 (JSC):
6446 (JSC::dumpOperands):
6447 * bytecode/SamplingTool.h:
6448 (SamplingRegion):
6449 * dfg/DFGByteCodeParser.cpp:
6450 (JSC::DFG::parse):
6451 * dfg/DFGCFAPhase.cpp:
6452 (JSC::DFG::performCFA):
6453 * dfg/DFGCSEPhase.cpp:
6454 (JSC::DFG::performCSE):
6455 * dfg/DFGFixupPhase.cpp:
6456 (JSC::DFG::performFixup):
6457 * dfg/DFGGenerationInfo.h:
6458 (JSC::DFG::GenerationInfo::GenerationInfo):
6459 (JSC::DFG::GenerationInfo::initConstant):
6460 (JSC::DFG::GenerationInfo::initInteger):
6461 (JSC::DFG::GenerationInfo::initJSValue):
6462 (JSC::DFG::GenerationInfo::initCell):
6463 (JSC::DFG::GenerationInfo::initBoolean):
6464 (JSC::DFG::GenerationInfo::initDouble):
6465 (JSC::DFG::GenerationInfo::initStorage):
6466 (GenerationInfo):
6467 (JSC::DFG::GenerationInfo::noticeOSRBirth):
6468 (JSC::DFG::GenerationInfo::use):
6469 (JSC::DFG::GenerationInfo::spill):
6470 (JSC::DFG::GenerationInfo::setSpilled):
6471 (JSC::DFG::GenerationInfo::fillJSValue):
6472 (JSC::DFG::GenerationInfo::fillCell):
6473 (JSC::DFG::GenerationInfo::fillInteger):
6474 (JSC::DFG::GenerationInfo::fillBoolean):
6475 (JSC::DFG::GenerationInfo::fillDouble):
6476 (JSC::DFG::GenerationInfo::fillStorage):
6477 (JSC::DFG::GenerationInfo::appendFill):
6478 (JSC::DFG::GenerationInfo::appendSpill):
6479 * dfg/DFGJITCompiler.cpp:
6480 (JSC::DFG::JITCompiler::link):
6481 (JSC::DFG::JITCompiler::compile):
6482 (JSC::DFG::JITCompiler::compileFunction):
6483 * dfg/DFGMinifiedGraph.h: Added.
6484 (DFG):
6485 (MinifiedGraph):
6486 (JSC::DFG::MinifiedGraph::MinifiedGraph):
6487 (JSC::DFG::MinifiedGraph::at):
6488 (JSC::DFG::MinifiedGraph::append):
6489 (JSC::DFG::MinifiedGraph::prepareAndShrink):
6490 (JSC::DFG::MinifiedGraph::setOriginalGraphSize):
6491 (JSC::DFG::MinifiedGraph::originalGraphSize):
6492 * dfg/DFGMinifiedNode.cpp: Added.
6493 (DFG):
6494 (JSC::DFG::MinifiedNode::fromNode):
6495 * dfg/DFGMinifiedNode.h: Added.
6496 (DFG):
6497 (JSC::DFG::belongsInMinifiedGraph):
6498 (MinifiedNode):
6499 (JSC::DFG::MinifiedNode::MinifiedNode):
6500 (JSC::DFG::MinifiedNode::index):
6501 (JSC::DFG::MinifiedNode::op):
6502 (JSC::DFG::MinifiedNode::hasChild1):
6503 (JSC::DFG::MinifiedNode::child1):
6504 (JSC::DFG::MinifiedNode::hasConstant):
6505 (JSC::DFG::MinifiedNode::hasConstantNumber):
6506 (JSC::DFG::MinifiedNode::constantNumber):
6507 (JSC::DFG::MinifiedNode::hasWeakConstant):
6508 (JSC::DFG::MinifiedNode::weakConstant):
6509 (JSC::DFG::MinifiedNode::getIndex):
6510 (JSC::DFG::MinifiedNode::compareByNodeIndex):
6511 (JSC::DFG::MinifiedNode::hasChild):
6512 * dfg/DFGNode.h:
6513 (Node):
6514 * dfg/DFGOSRExit.cpp:
6515 (JSC::DFG::OSRExit::OSRExit):
6516 * dfg/DFGOSRExit.h:
6517 (OSRExit):
6518 * dfg/DFGOSRExitCompiler.cpp:
6519 * dfg/DFGOSRExitCompiler.h:
6520 (OSRExitCompiler):
6521 * dfg/DFGOSRExitCompiler32_64.cpp:
6522 (JSC::DFG::OSRExitCompiler::compileExit):
6523 * dfg/DFGOSRExitCompiler64.cpp:
6524 (JSC::DFG::OSRExitCompiler::compileExit):
6525 * dfg/DFGPredictionPropagationPhase.cpp:
6526 (JSC::DFG::performPredictionPropagation):
6527 * dfg/DFGRedundantPhiEliminationPhase.cpp:
6528 (JSC::DFG::performRedundantPhiElimination):
6529 * dfg/DFGSpeculativeJIT.cpp:
6530 (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
6531 (DFG):
6532 (JSC::DFG::SpeculativeJIT::fillStorage):
6533 (JSC::DFG::SpeculativeJIT::noticeOSRBirth):
6534 (JSC::DFG::SpeculativeJIT::compileMovHint):
6535 (JSC::DFG::SpeculativeJIT::compile):
6536 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
6537 * dfg/DFGSpeculativeJIT.h:
6538 (DFG):
6539 (JSC::DFG::SpeculativeJIT::use):
6540 (SpeculativeJIT):
6541 (JSC::DFG::SpeculativeJIT::spill):
6542 (JSC::DFG::SpeculativeJIT::speculationCheck):
6543 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
6544 (JSC::DFG::SpeculativeJIT::recordSetLocal):
6545 * dfg/DFGSpeculativeJIT32_64.cpp:
6546 (JSC::DFG::SpeculativeJIT::fillInteger):
6547 (JSC::DFG::SpeculativeJIT::fillDouble):
6548 (JSC::DFG::SpeculativeJIT::fillJSValue):
6549 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
6550 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
6551 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
6552 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
6553 (JSC::DFG::SpeculativeJIT::compile):
6554 * dfg/DFGSpeculativeJIT64.cpp:
6555 (JSC::DFG::SpeculativeJIT::fillInteger):
6556 (JSC::DFG::SpeculativeJIT::fillDouble):
6557 (JSC::DFG::SpeculativeJIT::fillJSValue):
6558 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
6559 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
6560 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
6561 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
6562 (JSC::DFG::SpeculativeJIT::compile):
6563 * dfg/DFGValueRecoveryOverride.h: Added.
6564 (DFG):
6565 (ValueRecoveryOverride):
6566 (JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):
6567 * dfg/DFGValueSource.cpp: Added.
6568 (DFG):
6569 (JSC::DFG::ValueSource::dump):
6570 * dfg/DFGValueSource.h: Added.
6571 (DFG):
6572 (JSC::DFG::dataFormatToValueSourceKind):
6573 (JSC::DFG::valueSourceKindToDataFormat):
6574 (JSC::DFG::isInRegisterFile):
6575 (ValueSource):
6576 (JSC::DFG::ValueSource::ValueSource):
6577 (JSC::DFG::ValueSource::forPrediction):
6578 (JSC::DFG::ValueSource::forDataFormat):
6579 (JSC::DFG::ValueSource::isSet):
6580 (JSC::DFG::ValueSource::kind):
6581 (JSC::DFG::ValueSource::isInRegisterFile):
6582 (JSC::DFG::ValueSource::dataFormat):
6583 (JSC::DFG::ValueSource::valueRecovery):
6584 (JSC::DFG::ValueSource::nodeIndex):
6585 (JSC::DFG::ValueSource::nodeIndexFromKind):
6586 (JSC::DFG::ValueSource::kindFromNodeIndex):
6587 * dfg/DFGVariableEvent.cpp: Added.
6588 (DFG):
6589 (JSC::DFG::VariableEvent::dump):
6590 (JSC::DFG::VariableEvent::dumpFillInfo):
6591 (JSC::DFG::VariableEvent::dumpSpillInfo):
6592 * dfg/DFGVariableEvent.h: Added.
6593 (DFG):
6594 (VariableEvent):
6595 (JSC::DFG::VariableEvent::VariableEvent):
6596 (JSC::DFG::VariableEvent::reset):
6597 (JSC::DFG::VariableEvent::fillGPR):
6598 (JSC::DFG::VariableEvent::fillPair):
6599 (JSC::DFG::VariableEvent::fillFPR):
6600 (JSC::DFG::VariableEvent::spill):
6601 (JSC::DFG::VariableEvent::death):
6602 (JSC::DFG::VariableEvent::setLocal):
6603 (JSC::DFG::VariableEvent::movHint):
6604 (JSC::DFG::VariableEvent::kind):
6605 (JSC::DFG::VariableEvent::nodeIndex):
6606 (JSC::DFG::VariableEvent::dataFormat):
6607 (JSC::DFG::VariableEvent::gpr):
6608 (JSC::DFG::VariableEvent::tagGPR):
6609 (JSC::DFG::VariableEvent::payloadGPR):
6610 (JSC::DFG::VariableEvent::fpr):
6611 (JSC::DFG::VariableEvent::virtualRegister):
6612 (JSC::DFG::VariableEvent::operand):
6613 (JSC::DFG::VariableEvent::variableRepresentation):
6614 * dfg/DFGVariableEventStream.cpp: Added.
6615 (DFG):
6616 (JSC::DFG::VariableEventStream::logEvent):
6617 (MinifiedGenerationInfo):
6618 (JSC::DFG::MinifiedGenerationInfo::MinifiedGenerationInfo):
6619 (JSC::DFG::MinifiedGenerationInfo::update):
6620 (JSC::DFG::VariableEventStream::reconstruct):
6621 * dfg/DFGVariableEventStream.h: Added.
6622 (DFG):
6623 (VariableEventStream):
6624 (JSC::DFG::VariableEventStream::appendAndLog):
6625 * dfg/DFGVirtualRegisterAllocationPhase.cpp:
6626 (JSC::DFG::performVirtualRegisterAllocation):
6627
66282012-07-02 Filip Pizlo <fpizlo@apple.com>
6629
fpizlo@apple.comaedde2e2012-07-03 00:10:08 +00006630 DFG::ArgumentsSimplificationPhase should assert that the PhantomArguments nodes it creates are not shouldGenerate()
6631 https://bugs.webkit.org/show_bug.cgi?id=90407
6632
6633 Reviewed by Mark Hahnenberg.
6634
6635 * dfg/DFGArgumentsSimplificationPhase.cpp:
6636 (JSC::DFG::ArgumentsSimplificationPhase::run):
6637
barraclough@apple.com15ab3352012-07-02 19:25:59 +000066382012-07-02 Gavin Barraclough <barraclough@apple.com>
6639
6640 Array.prototype.pop should throw if property is not configurable
6641 https://bugs.webkit.org/show_bug.cgi?id=75788
6642
6643 Rubber Stamped by Oliver Hunt.
6644
6645 No real bug here any more, but the error we throw sometimes has a misleading message.
6646
6647 * runtime/JSArray.cpp:
6648 (JSC::JSArray::pop):
6649
fpizlo@apple.com3aef57f2012-06-30 19:28:26 +000066502012-06-29 Filip Pizlo <fpizlo@apple.com>
6651
fpizlo@apple.com604d38a2012-07-01 03:54:49 +00006652 JSObject wastes too much memory on unused property slots
6653 https://bugs.webkit.org/show_bug.cgi?id=90255
6654
6655 Reviewed by Mark Hahnenberg.
6656
6657 Rolling back in after applying a simple fix: it appears that
6658 JSObject::setStructureAndReallocateStorageIfNecessary() was allocating more
6659 property storage than necessary. Fixing this appears to resolve the crash.
6660
6661 This does a few things:
6662
6663 - JSNonFinalObject no longer has inline property storage.
6664
6665 - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
6666 or 2x the inline storage for JSFinalObject.
6667
6668 - Property storage is only reallocated if it needs to be. Previously, we
6669 would reallocate the property storage on any transition where the original
6670 structure said shouldGrowProperyStorage(), but this led to spurious
6671 reallocations when doing transitionless property adds and there are
6672 deleted property slots available. That in turn led to crashes, because we
6673 would switch to out-of-line storage even if the capacity matched the
6674 criteria for inline storage.
6675
6676 - Inline JSFunction allocation is killed off because we don't have a good
6677 way of inlining property storage allocation. This didn't hurt performance.
6678 Killing off code is better than fixing it if that code wasn't doing any
6679 good.
6680
6681 This looks like a 1% progression on V8.
6682
6683 * interpreter/Interpreter.cpp:
6684 (JSC::Interpreter::privateExecute):
6685 * jit/JIT.cpp:
6686 (JSC::JIT::privateCompileSlowCases):
6687 * jit/JIT.h:
6688 * jit/JITInlineMethods.h:
6689 (JSC::JIT::emitAllocateBasicJSObject):
6690 (JSC):
6691 * jit/JITOpcodes.cpp:
6692 (JSC::JIT::emit_op_new_func):
6693 (JSC):
6694 (JSC::JIT::emit_op_new_func_exp):
6695 * runtime/JSFunction.cpp:
6696 (JSC::JSFunction::finishCreation):
6697 * runtime/JSObject.h:
6698 (JSC::JSObject::isUsingInlineStorage):
6699 (JSObject):
6700 (JSC::JSObject::finishCreation):
6701 (JSC):
6702 (JSC::JSNonFinalObject::hasInlineStorage):
6703 (JSNonFinalObject):
6704 (JSC::JSNonFinalObject::JSNonFinalObject):
6705 (JSC::JSNonFinalObject::finishCreation):
6706 (JSC::JSFinalObject::hasInlineStorage):
6707 (JSC::JSFinalObject::finishCreation):
6708 (JSC::JSObject::offsetOfInlineStorage):
6709 (JSC::JSObject::setPropertyStorage):
6710 (JSC::Structure::inlineStorageCapacity):
6711 (JSC::Structure::isUsingInlineStorage):
6712 (JSC::JSObject::putDirectInternal):
6713 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
6714 (JSC::JSObject::putDirectWithoutTransition):
6715 * runtime/Structure.cpp:
6716 (JSC::Structure::Structure):
6717 (JSC::nextPropertyStorageCapacity):
6718 (JSC):
6719 (JSC::Structure::growPropertyStorageCapacity):
6720 (JSC::Structure::suggestedNewPropertyStorageSize):
6721 * runtime/Structure.h:
6722 (JSC::Structure::putWillGrowPropertyStorage):
6723 (Structure):
6724
67252012-06-29 Filip Pizlo <fpizlo@apple.com>
6726
fpizlo@apple.com3aef57f2012-06-30 19:28:26 +00006727 Webkit crashes in DFG on Google Docs when creating a new document
6728 https://bugs.webkit.org/show_bug.cgi?id=90209
6729
6730 Reviewed by Gavin Barraclough.
6731
6732 Don't attempt to short-circuit Phantom(GetLocal) if the GetLocal is for a
6733 captured variable.
6734
6735 * dfg/DFGCFGSimplificationPhase.cpp:
6736 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
6737
zandobersek@gmail.com069a2d32012-06-30 12:09:15 +000067382012-06-30 Zan Dobersek <zandobersek@gmail.com>
6739
6740 Unreviewed, rolling out r121605.
6741 http://trac.webkit.org/changeset/121605
6742 https://bugs.webkit.org/show_bug.cgi?id=90336
6743
6744 Changes caused flaky crashes in sputnik/Unicode tests on Apple
6745 WK1 and GTK Linux builders
6746
6747 * interpreter/Interpreter.cpp:
6748 (JSC::Interpreter::privateExecute):
6749 * jit/JIT.cpp:
6750 (JSC::JIT::privateCompileSlowCases):
6751 * jit/JIT.h:
6752 * jit/JITInlineMethods.h:
6753 (JSC::JIT::emitAllocateBasicJSObject):
6754 (JSC::JIT::emitAllocateJSFinalObject):
6755 (JSC):
6756 (JSC::JIT::emitAllocateJSFunction):
6757 * jit/JITOpcodes.cpp:
6758 (JSC::JIT::emit_op_new_func):
6759 (JSC::JIT::emitSlow_op_new_func):
6760 (JSC):
6761 (JSC::JIT::emit_op_new_func_exp):
6762 (JSC::JIT::emitSlow_op_new_func_exp):
6763 * runtime/JSFunction.cpp:
6764 (JSC::JSFunction::finishCreation):
6765 * runtime/JSObject.h:
6766 (JSC::JSObject::isUsingInlineStorage):
6767 (JSObject):
6768 (JSC::JSObject::finishCreation):
6769 (JSC):
6770 (JSNonFinalObject):
6771 (JSC::JSNonFinalObject::JSNonFinalObject):
6772 (JSC::JSNonFinalObject::finishCreation):
6773 (JSFinalObject):
6774 (JSC::JSFinalObject::finishCreation):
6775 (JSC::JSObject::offsetOfInlineStorage):
6776 (JSC::JSObject::setPropertyStorage):
6777 (JSC::Structure::isUsingInlineStorage):
6778 (JSC::JSObject::putDirectInternal):
6779 (JSC::JSObject::putDirectWithoutTransition):
6780 (JSC::JSObject::transitionTo):
6781 * runtime/Structure.cpp:
6782 (JSC::Structure::Structure):
6783 (JSC):
6784 (JSC::Structure::growPropertyStorageCapacity):
6785 (JSC::Structure::suggestedNewPropertyStorageSize):
6786 * runtime/Structure.h:
6787 (JSC::Structure::shouldGrowPropertyStorage):
6788 (JSC::Structure::propertyStorageSize):
6789
mhahnenberg@apple.com3100b432012-06-30 01:14:09 +000067902012-06-29 Mark Hahnenberg <mhahnenberg@apple.com>
6791
6792 Remove warning about protected values when the Heap is being destroyed
6793 https://bugs.webkit.org/show_bug.cgi?id=90302
6794
6795 Reviewed by Geoffrey Garen.
6796
6797 Having to do book-keeping about whether values allocated from a certain
6798 VM are or are not protected makes the JSC API much more difficult to use
6799 correctly. Clients should be able to throw an entire VM away and not have
6800 to worry about unprotecting all of the values that they protected earlier.
6801
6802 * heap/Heap.cpp:
6803 (JSC::Heap::lastChanceToFinalize):
6804
fpizlo@apple.com9243e792012-06-30 00:25:01 +000068052012-06-29 Filip Pizlo <fpizlo@apple.com>
6806
6807 JSObject wastes too much memory on unused property slots
6808 https://bugs.webkit.org/show_bug.cgi?id=90255
6809
6810 Reviewed by Mark Hahnenberg.
6811
6812 This does a few things:
6813
6814 - JSNonFinalObject no longer has inline property storage.
6815
6816 - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
6817 or 2x the inline storage for JSFinalObject.
6818
6819 - Property storage is only reallocated if it needs to be. Previously, we
6820 would reallocate the property storage on any transition where the original
6821 structure said shouldGrowProperyStorage(), but this led to spurious
6822 reallocations when doing transitionless property adds and there are
6823 deleted property slots available. That in turn led to crashes, because we
6824 would switch to out-of-line storage even if the capacity matched the
6825 criteria for inline storage.
6826
6827 - Inline JSFunction allocation is killed off because we don't have a good
6828 way of inlining property storage allocation. This didn't hurt performance.
6829 Killing off code is better than fixing it if that code wasn't doing any
6830 good.
6831
6832 This looks like a 1% progression on V8.
6833
6834 * interpreter/Interpreter.cpp:
6835 (JSC::Interpreter::privateExecute):
6836 * jit/JIT.cpp:
6837 (JSC::JIT::privateCompileSlowCases):
6838 * jit/JIT.h:
6839 * jit/JITInlineMethods.h:
6840 (JSC::JIT::emitAllocateBasicJSObject):
6841 (JSC):
6842 * jit/JITOpcodes.cpp:
6843 (JSC::JIT::emit_op_new_func):
6844 (JSC):
6845 (JSC::JIT::emit_op_new_func_exp):
6846 * runtime/JSFunction.cpp:
6847 (JSC::JSFunction::finishCreation):
6848 * runtime/JSObject.h:
6849 (JSC::JSObject::isUsingInlineStorage):
6850 (JSObject):
6851 (JSC::JSObject::finishCreation):
6852 (JSC):
6853 (JSC::JSNonFinalObject::hasInlineStorage):
6854 (JSNonFinalObject):
6855 (JSC::JSNonFinalObject::JSNonFinalObject):
6856 (JSC::JSNonFinalObject::finishCreation):
6857 (JSC::JSFinalObject::hasInlineStorage):
6858 (JSC::JSFinalObject::finishCreation):
6859 (JSC::JSObject::offsetOfInlineStorage):
6860 (JSC::JSObject::setPropertyStorage):
6861 (JSC::Structure::inlineStorageCapacity):
6862 (JSC::Structure::isUsingInlineStorage):
6863 (JSC::JSObject::putDirectInternal):
6864 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
6865 (JSC::JSObject::putDirectWithoutTransition):
6866 * runtime/Structure.cpp:
6867 (JSC::Structure::Structure):
6868 (JSC::nextPropertyStorageCapacity):
6869 (JSC):
6870 (JSC::Structure::growPropertyStorageCapacity):
6871 (JSC::Structure::suggestedNewPropertyStorageSize):
6872 * runtime/Structure.h:
6873 (JSC::Structure::putWillGrowPropertyStorage):
6874 (Structure):
6875
fpizlo@apple.com48a964b2012-06-29 02:40:14 +000068762012-06-28 Filip Pizlo <fpizlo@apple.com>
6877
6878 DFG recompilation heuristics should be based on count, not rate
6879 https://bugs.webkit.org/show_bug.cgi?id=90146
6880
6881 Reviewed by Oliver Hunt.
6882
6883 This removes a bunch of code that was previously trying to prevent spurious
6884 reoptimizations if a large enough majority of executions of a code block did
6885 not result in OSR exit. It turns out that this code was purely harmful. This
6886 patch removes all of that logic and replaces it with a dead-simple
6887 heuristic: if you exit more than N times (where N is an exponential function
6888 of the number of times the code block has already been recompiled) then we
6889 will recompile.
6890
6891 This appears to be a broad ~1% win on many benchmarks large and small.
6892
6893 * bytecode/CodeBlock.cpp:
6894 (JSC::CodeBlock::CodeBlock):
6895 * bytecode/CodeBlock.h:
6896 (JSC::CodeBlock::osrExitCounter):
6897 (JSC::CodeBlock::countOSRExit):
6898 (CodeBlock):
6899 (JSC::CodeBlock::addressOfOSRExitCounter):
6900 (JSC::CodeBlock::offsetOfOSRExitCounter):
6901 (JSC::CodeBlock::adjustedExitCountThreshold):
6902 (JSC::CodeBlock::exitCountThresholdForReoptimization):
6903 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
6904 (JSC::CodeBlock::shouldReoptimizeNow):
6905 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
6906 * bytecode/ExecutionCounter.cpp:
6907 (JSC::ExecutionCounter::setThreshold):
6908 * bytecode/ExecutionCounter.h:
6909 (ExecutionCounter):
6910 (JSC::ExecutionCounter::clippedThreshold):
6911 * dfg/DFGJITCompiler.cpp:
6912 (JSC::DFG::JITCompiler::compileBody):
6913 * dfg/DFGOSRExit.cpp:
6914 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
6915 * dfg/DFGOSRExitCompiler.cpp:
6916 (JSC::DFG::OSRExitCompiler::handleExitCounts):
6917 * dfg/DFGOperations.cpp:
6918 * jit/JITStubs.cpp:
6919 (JSC::DEFINE_STUB_FUNCTION):
6920 * runtime/Options.cpp:
6921 (Options):
6922 (JSC::Options::initializeOptions):
6923 * runtime/Options.h:
6924 (Options):
6925
commit-queue@webkit.org97ee82b2012-06-28 23:03:07 +000069262012-06-28 Mark Lam <mark.lam@apple.com>
6927
6928 Adding a commenting utility to record BytecodeGenerator comments
6929 with opcodes that are emitted. Presently, the comments can only
6930 be constant strings. Adding comments for opcodes is optional.
6931 If a comment is added, the comment will be printed following the
6932 opcode when CodeBlock::dump() is called.
6933
6934 This utility is disabled by default, and is only meant for VM
6935 development purposes. It should not be enabled for product builds.
6936
6937 To enable this utility, set ENABLE_BYTECODE_COMMENTS in CodeBlock.h
6938 to 1.
6939
6940 https://bugs.webkit.org/show_bug.cgi?id=90095
6941
6942 Reviewed by Geoffrey Garen.
6943
6944 * GNUmakefile.list.am:
6945 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6946 * JavaScriptCore.xcodeproj/project.pbxproj:
6947 * bytecode/CodeBlock.cpp:
6948 (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): Dumps the comment.
6949 (JSC):
6950 (JSC::CodeBlock::printUnaryOp): Add comment dumps.
6951 (JSC::CodeBlock::printBinaryOp): Add comment dumps.
6952 (JSC::CodeBlock::printConditionalJump): Add comment dumps.
6953 (JSC::CodeBlock::printCallOp): Add comment dumps.
6954 (JSC::CodeBlock::printPutByIdOp): Add comment dumps.
6955 (JSC::CodeBlock::dump): Add comment dumps.
6956 (JSC::CodeBlock::CodeBlock):
6957 (JSC::CodeBlock::commentForBytecodeOffset):
6958 Finds the comment for an opcode if available.
6959 (JSC::CodeBlock::dumpBytecodeComments):
6960 For debugging whether comments are collected.
6961 It is not being called anywhere.
6962 * bytecode/CodeBlock.h:
6963 (CodeBlock):
6964 (JSC::CodeBlock::bytecodeComments):
6965 * bytecode/Comment.h: Added.
6966 (JSC):
6967 (Comment):
6968 * bytecompiler/BytecodeGenerator.cpp:
6969 (JSC::BytecodeGenerator::BytecodeGenerator):
6970 (JSC::BytecodeGenerator::emitOpcode): Calls emitComment().
6971 (JSC):
6972 (JSC::BytecodeGenerator::emitComment): Adds comment to CodeBlock.
6973 (JSC::BytecodeGenerator::prependComment):
6974 Registers a comment for emitComemnt() to use later.
6975 * bytecompiler/BytecodeGenerator.h:
6976 (BytecodeGenerator):
6977 (JSC::BytecodeGenerator::emitComment):
6978 (JSC::BytecodeGenerator::prependComment):
6979 These are inlined versions of these functions that nullify them
6980 when ENABLE_BYTECODE_COMMENTS is 0.
6981 (JSC::BytecodeGenerator::comments):
6982
oliver@apple.com41383bc2012-06-28 20:54:06 +000069832012-06-28 Oliver Hunt <oliver@apple.com>
6984
6985 32bit DFG incorrectly claims an fpr is fillable even if it has not been proven double
6986 https://bugs.webkit.org/show_bug.cgi?id=90127
6987
6988 Reviewed by Filip Pizlo.
6989
6990 The 32-bit version of fillSpeculateDouble doesn't handle Number->fpr loads
6991 correctly. This patch fixes this by killing the fill info in the GenerationInfo
6992 when the spillFormat doesn't guarantee the value is a double.
6993
6994 * dfg/DFGSpeculativeJIT32_64.cpp:
6995 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
6996
tkent@chromium.orgb53db042012-06-28 08:48:20 +000069972012-06-28 Kent Tamura <tkent@chromium.org>
6998
6999 Classify form control states by their owner forms
7000 https://bugs.webkit.org/show_bug.cgi?id=89950
7001
7002 Reviewed by Hajime Morita.
7003
7004 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7005 Expose WTF::StringBuilder::canShrink()
7006
msaboff@apple.comff141582012-06-28 01:14:20 +000070072012-06-27 Michael Saboff <msaboff@apple.com>
7008
7009 [Win] jscore-tests flakey
7010 https://bugs.webkit.org/show_bug.cgi?id=88118
7011
7012 Reviewed by Jessie Berlin.
7013
7014 jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
7015 instead it gets 126. Added a new option to jsc (-x) which prints the exit
7016 code before exiting. jsDriver.pl uses this option on Windows and parses the
7017 exit code output for the exit code, removing it before comparing the actual
7018 and expected outputs. Filed a follow on "FIXME" defect:
7019 [WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
7020 https://bugs.webkit.org/show_bug.cgi?id=90119
7021
7022 * jsc.cpp:
7023 (CommandLine::CommandLine):
7024 (CommandLine):
7025 (printUsageStatement):
7026 (parseArguments):
7027 (jscmain):
7028 * tests/mozilla/jsDriver.pl:
7029 (execute_tests):
7030
commit-queue@webkit.orge12e2f32012-06-28 01:09:22 +000070312012-06-27 Sheriff Bot <webkit.review.bot@gmail.com>
7032
7033 Unreviewed, rolling out r121359.
7034 http://trac.webkit.org/changeset/121359
7035 https://bugs.webkit.org/show_bug.cgi?id=90115
7036
7037 Broke many inspector tests (Requested by jpfau on #webkit).
7038
7039 * interpreter/Interpreter.h:
7040 (JSC::StackFrame::toString):
7041
fpizlo@apple.com12c18392012-06-27 23:16:10 +000070422012-06-27 Filip Pizlo <fpizlo@apple.com>
7043
fpizlo@apple.comc01022e2012-06-28 00:49:55 +00007044 Javascript SHA-512 gives wrong hash on second and subsequent runs unless Web Inspector Javascript Debugging is on
7045 https://bugs.webkit.org/show_bug.cgi?id=90053
7046 <rdar://problem/11764613>
7047
7048 Reviewed by Mark Hahnenberg.
7049
7050 The problem is that the code was assuming that the recovery should be Undefined if the source of
7051 the SetLocal was !shouldGenerate(). But that's wrong, since the DFG optimizer may skip around a
7052 UInt32ToNumber node (hence making it !shouldGenerate()) and keep the source of that node alive.
7053 In that case we should base the recovery on the source of the UInt32ToNumber. The logic for this
7054 was already in place but the fast check for !shouldGenerate() broke it.
7055
7056 * dfg/DFGSpeculativeJIT.cpp:
7057 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
7058
70592012-06-27 Filip Pizlo <fpizlo@apple.com>
7060
fpizlo@apple.com12c18392012-06-27 23:16:10 +00007061 DFG disassembly should be easier to read
7062 https://bugs.webkit.org/show_bug.cgi?id=90106
7063
7064 Reviewed by Mark Hahnenberg.
7065
7066 Did a few things:
7067
7068 - Options::showDFGDisassembly now shows OSR exit disassembly as well.
7069
7070 - Phi node dumping doesn't attempt to do line wrapping since it just made the dump harder
7071 to read.
7072
7073 - DFG graph disassembly view shows a few additional node types that turn out to be
7074 essential for understanding OSR exits.
7075
7076 Put together, these changes reinforce the philosophy that anything needed for computing
7077 OSR exit is just as important as the machine code itself. Of course, we still don't take
7078 that philosophy to its full extreme - for example Phantom nodes are not dumped. We may
7079 revisit that in the future.
7080
7081 * assembler/LinkBuffer.cpp:
7082 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
7083 * assembler/LinkBuffer.h:
7084 (JSC):
7085 * dfg/DFGDisassembler.cpp:
7086 (JSC::DFG::Disassembler::dump):
7087 * dfg/DFGGraph.cpp:
7088 (JSC::DFG::Graph::dumpBlockHeader):
7089 * dfg/DFGNode.h:
7090 (JSC::DFG::Node::willHaveCodeGenOrOSR):
7091 * dfg/DFGOSRExitCompiler.cpp:
7092 * jit/JIT.cpp:
7093 (JSC::JIT::privateCompile):
7094
mhahnenberg@apple.come16f8092012-06-27 23:08:26 +000070952012-06-25 Mark Hahnenberg <mhahnenberg@apple.com>
7096
7097 JSLock should be per-JSGlobalData
7098 https://bugs.webkit.org/show_bug.cgi?id=89123
7099
7100 Reviewed by Geoffrey Garen.
7101
7102 * API/APIShims.h:
7103 (APIEntryShimWithoutLock):
7104 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
7105 determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
7106 HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
7107 JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
7108 its destruction has begun.
7109 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
7110 (JSC::APIEntryShim::APIEntryShim):
7111 (APIEntryShim):
7112 (JSC::APIEntryShim::~APIEntryShim):
7113 (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
7114 Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
7115 and before we've released it, which can only done in APIEntryShim.
7116 (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
7117 * API/JSContextRef.cpp:
7118 (JSGlobalContextCreate):
7119 (JSGlobalContextCreateInGroup):
7120 (JSGlobalContextRelease):
7121 (JSContextCreateBacktrace):
7122 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7123 * heap/CopiedSpace.cpp:
7124 (JSC::CopiedSpace::tryAllocateSlowCase):
7125 * heap/Heap.cpp:
7126 (JSC::Heap::protect):
7127 (JSC::Heap::unprotect):
7128 (JSC::Heap::collect):
7129 (JSC::Heap::setActivityCallback):
7130 (JSC::Heap::activityCallback):
7131 (JSC::Heap::sweeper):
7132 * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
7133 are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
7134 and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
7135 prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
7136 (Heap):
7137 * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
7138 (JSC::HeapTimer::~HeapTimer):
7139 (JSC::HeapTimer::invalidate):
7140 (JSC):
7141 (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
7142 that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
7143 HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
7144 (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
7145 out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
7146 but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
7147 we were interrupted between releasing our mutex and trying to grab the APILock.
7148 * heap/HeapTimer.h:
7149 (HeapTimer):
7150 * heap/IncrementalSweeper.cpp:
7151 (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
7152 all of that for us.
7153 (JSC::IncrementalSweeper::create):
7154 * heap/IncrementalSweeper.h:
7155 (IncrementalSweeper):
7156 * heap/MarkedAllocator.cpp:
7157 (JSC::MarkedAllocator::allocateSlowCase):
7158 * heap/WeakBlock.cpp:
7159 (JSC::WeakBlock::reap):
7160 * jsc.cpp:
7161 (functionGC):
7162 (functionReleaseExecutableMemory):
7163 (jscmain):
7164 * runtime/Completion.cpp:
7165 (JSC::checkSyntax):
7166 (JSC::evaluate):
7167 * runtime/GCActivityCallback.h:
7168 (DefaultGCActivityCallback):
7169 (JSC::DefaultGCActivityCallback::create):
7170 * runtime/JSGlobalData.cpp:
7171 (JSC::JSGlobalData::JSGlobalData):
7172 (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
7173 that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
7174 it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
7175 APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
7176 (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
7177 (JSC::JSGlobalData::sharedInstanceInternal):
7178 * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
7179 de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
7180 (JSGlobalData):
7181 (JSC::JSGlobalData::apiLock):
7182 * runtime/JSGlobalObject.cpp:
7183 (JSC::JSGlobalObject::~JSGlobalObject):
7184 (JSC::JSGlobalObject::init):
7185 * runtime/JSLock.cpp:
7186 (JSC):
7187 (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
7188 (JSC::GlobalJSLock::~GlobalJSLock):
7189 (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
7190 it can successfully unlock it later without it disappearing from underneath it.
7191 (JSC::JSLockHolder::~JSLockHolder):
7192 (JSC::JSLock::JSLock):
7193 (JSC::JSLock::~JSLock):
7194 (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
7195 actually waiting for long periods.
7196 (JSC::JSLock::unlock):
7197 (JSC::JSLock::currentThreadIsHoldingLock):
7198 (JSC::JSLock::dropAllLocks):
7199 (JSC::JSLock::dropAllLocksUnconditionally):
7200 (JSC::JSLock::grabAllLocks):
7201 (JSC::JSLock::DropAllLocks::DropAllLocks):
7202 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7203 * runtime/JSLock.h:
7204 (JSC):
7205 (GlobalJSLock):
7206 (JSLockHolder):
7207 (JSLock):
7208 (DropAllLocks):
7209 * runtime/WeakGCMap.h:
7210 (JSC::WeakGCMap::set):
7211 * testRegExp.cpp:
7212 (realMain):
7213
fpizlo@apple.coma8de6ba2012-06-27 21:25:23 +000072142012-06-27 Filip Pizlo <fpizlo@apple.com>
7215
fpizlo@apple.com4a4978b2012-06-27 21:45:08 +00007216 x86 disassembler confuses immediates with addresses
7217 https://bugs.webkit.org/show_bug.cgi?id=90099
7218
7219 Reviewed by Mark Hahnenberg.
7220
7221 Prepend "$" to immediates to disambiguate between immediates and addresses. This is in
7222 accordance with the gas and AT&T syntax.
7223
7224 * disassembler/udis86/udis86_syn-att.c:
7225 (gen_operand):
7226
72272012-06-27 Filip Pizlo <fpizlo@apple.com>
7228
fpizlo@apple.coma8de6ba2012-06-27 21:25:23 +00007229 Add a comment clarifying Options::showDisassembly versus Options::showDFGDisassembly.
7230
7231 Rubber stamped by Mark Hahnenberg.
7232
7233 * runtime/Options.cpp:
7234 (JSC::Options::initializeOptions):
7235
commit-queue@webkit.org50c978a2012-06-27 19:54:48 +000072362012-06-27 Anthony Scian <ascian@rim.com>
7237
7238 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
7239 https://bugs.webkit.org/show_bug.cgi?id=40118
7240
7241 Reviewed by Yong Li.
7242
7243 Added member functions to expose function name, urlString, and line #.
7244 Refactored toString to make use of these member functions to reduce
7245 duplicated code for future maintenance.
7246
7247 Manually tested refactoring of toString by tracing thrown exceptions.
7248
7249 * interpreter/Interpreter.h:
7250 (StackFrame):
7251 (JSC::StackFrame::toString):
7252 (JSC::StackFrame::friendlySourceURL):
7253 (JSC::StackFrame::friendlyFunctionName):
7254 (JSC::StackFrame::friendlyLineNumber):
7255
vestbo@webkit.org36e47da2012-06-27 13:02:03 +000072562012-06-27 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
7257
7258 [Qt] Remove redundant c++11 warning suppression code
7259
7260 This is already handled in default_post.
7261
7262 Reviewed by Tor Arne Vestbø.
7263
7264 * Target.pri:
7265
vestbo@webkit.orgcaf4d2f2012-06-27 11:30:42 +000072662012-06-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
7267
7268 [Qt] Add missing heades to HEADERS
7269
7270 For JavaScriptCore there aren't any Qt specific files, so we include all
7271 headers for easy editing in Qt Creator.
7272
7273 Reviewed by Simon Hausmann.
7274
7275 * Target.pri:
7276
dominicc@chromium.org5940f722012-06-27 09:44:31 +000072772012-06-26 Dominic Cooney <dominicc@chromium.org>
7278
7279 [Chromium] Remove unused build scripts and empty folders for JavaScriptCore w/ gyp
7280 https://bugs.webkit.org/show_bug.cgi?id=90029
7281
7282 Reviewed by Adam Barth.
7283
7284 * gyp: Removed.
7285 * gyp/generate-derived-sources.sh: Removed.
7286 * gyp/generate-dtrace-header.sh: Removed.
7287 * gyp/run-if-exists.sh: Removed.
7288 * gyp/update-info-plist.sh: Removed.
7289
ggaren@apple.com6b348072012-06-27 03:44:05 +000072902012-06-26 Geoffrey Garen <ggaren@apple.com>
7291
7292 Reduced (but did not eliminate) use of "berzerker GC"
7293 https://bugs.webkit.org/show_bug.cgi?id=89237
7294
7295 Reviewed by Gavin Barraclough.
7296
7297 (PART 2)
7298
7299 This part turns off "berzerker GC" and turns on incremental shrinking.
7300
7301 * heap/IncrementalSweeper.cpp:
7302 (JSC::IncrementalSweeper::doSweep): Free or shrink after sweeping to
7303 maintain the behavior we used to get from the occasional berzerker GC,
7304 which would run all finalizers and then free or shrink all blocks
7305 synchronously.
7306
7307 * heap/MarkedBlock.h:
7308 (JSC::MarkedBlock::needsSweeping): Sweep zapped blocks, too. It's always
7309 safe to sweep a zapped block (that's the point of zapping), and it's
7310 sometimes profitable. For example, consider this case: Block A does some
7311 allocation (transitioning Block A from Marked to FreeListed), then GC
7312 happens (transitioning Block A to Zapped), then all objects in Block A
7313 are free, then the incremental sweeper visits Block A. If we skipped
7314 Zapped blocks, we'd skip Block A, even though it would be profitable to
7315 run its destructors and free its memory.
7316
7317 * runtime/GCActivityCallback.cpp:
7318 (JSC::DefaultGCActivityCallback::doWork): Don't sweep eagerly; we'll do
7319 this incrementally.
7320
fpizlo@apple.com580d9d72012-06-27 01:34:01 +000073212012-06-26 Filip Pizlo <fpizlo@apple.com>
7322
7323 DFG PutByValAlias is too aggressive
7324 https://bugs.webkit.org/show_bug.cgi?id=90026
7325 <rdar://problem/11751830>
7326
7327 Reviewed by Gavin Barraclough.
7328
7329 For CSE on normal arrays, we now treat PutByVal as impure. This does not appear to affect
7330 performance by much.
7331
7332 For CSE on typed arrays, we fix PutByValAlias by making GetByVal speculate that the access
7333 is within bounds. This also has the effect of making our out-of-bounds handling consistent
7334 with WebCore.
7335
7336 * dfg/DFGCSEPhase.cpp:
7337 (JSC::DFG::CSEPhase::performNodeCSE):
7338 * dfg/DFGGraph.h:
7339 (JSC::DFG::Graph::byValIsPure):
7340 (JSC::DFG::Graph::clobbersWorld):
7341 * dfg/DFGNodeType.h:
7342 (DFG):
7343 * dfg/DFGSpeculativeJIT.cpp:
7344 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
7345 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
7346
commit-queue@webkit.org63a25eb2012-06-26 19:55:32 +000073472012-06-26 Yong Li <yoli@rim.com>
7348
7349 [BlackBerry] Add JSC statistics into about:memory
7350 https://bugs.webkit.org/show_bug.cgi?id=89779
7351
7352 Reviewed by Rob Buis.
7353
7354 Fix non-JIT build on BlackBerry broken by r121196.
7355
7356 * runtime/MemoryStatistics.cpp:
7357 (JSC::globalMemoryStatistics):
7358
fpizlo@apple.com6c89cd32012-06-26 19:42:05 +000073592012-06-25 Filip Pizlo <fpizlo@apple.com>
7360
7361 DFG::operationNewArray is unnecessarily slow, and may use the wrong array
7362 prototype when inlined
7363 https://bugs.webkit.org/show_bug.cgi?id=89821
7364
7365 Reviewed by Geoffrey Garen.
7366
7367 Fixes all array allocations to use the right structure, and hence the right prototype. Adds
7368 inlining of new Array(...) with a non-zero number of arguments. Optimizes allocations of
7369 empty arrays.
7370
7371 * dfg/DFGAbstractState.cpp:
7372 (JSC::DFG::AbstractState::execute):
7373 * dfg/DFGByteCodeParser.cpp:
7374 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
7375 * dfg/DFGCCallHelpers.h:
7376 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
7377 (CCallHelpers):
7378 * dfg/DFGNodeType.h:
7379 (DFG):
7380 * dfg/DFGOperations.cpp:
7381 * dfg/DFGOperations.h:
7382 * dfg/DFGPredictionPropagationPhase.cpp:
7383 (JSC::DFG::PredictionPropagationPhase::propagate):
7384 * dfg/DFGSpeculativeJIT.h:
7385 (JSC::DFG::SpeculativeJIT::callOperation):
7386 * dfg/DFGSpeculativeJIT32_64.cpp:
7387 (JSC::DFG::SpeculativeJIT::compile):
7388 * dfg/DFGSpeculativeJIT64.cpp:
7389 (JSC::DFG::SpeculativeJIT::compile):
7390 * runtime/JSArray.h:
7391 (JSC):
7392 (JSC::constructArray):
7393 * runtime/JSGlobalObject.h:
7394 (JSC):
7395 (JSC::constructArray):
7396
fpizlo@apple.com0b6ad50752012-06-26 09:22:45 +000073972012-06-26 Filip Pizlo <fpizlo@apple.com>
7398
7399 New fast/js/dfg-store-unexpected-value-into-argument-and-osr-exit.html fails on 32 bit
7400 https://bugs.webkit.org/show_bug.cgi?id=89953
7401
7402 Reviewed by Zoltan Herczeg.
7403
7404 DFG 32-bit JIT was confused about the difference between a predicted type and a
7405 proven type. This is easy to get confused about, since a local that is predicted int32
7406 almost always means that the local must be an int32 since speculations are hoisted to
7407 stores to locals. But that is less likely to be the case for arguments, where there is
7408 an additional least-upper-bounding step: any store to an argument with a weird type
7409 may force the argument to be any type.
7410
7411 This patch basically duplicates the functionality in DFGSpeculativeJIT64.cpp for
7412 GetLocal: the decision of whether to load a local as an int32 (or as an array, or as
7413 a boolean) is made based on the AbstractValue::m_type, which is a type proof, rather
7414 than the VariableAccessData::prediction(), which is a predicted type.
7415
7416 * dfg/DFGSpeculativeJIT32_64.cpp:
7417 (JSC::DFG::SpeculativeJIT::compile):
7418
fpizlo@apple.com41a1f0e2012-06-26 02:53:39 +000074192012-06-25 Filip Pizlo <fpizlo@apple.com>
7420
7421 JSC should try to make profiling deterministic because otherwise reproducing failures is
7422 nearly impossible
7423 https://bugs.webkit.org/show_bug.cgi?id=89940
7424
7425 Rubber stamped by Gavin Barraclough.
7426
7427 This rolls out the part of http://trac.webkit.org/changeset/121215 that introduced randomness
7428 into the system. Now, instead of randomizing the tier-up threshold, we always set it to an
7429 artificially low (and statically predetermined!) value. This gives most of the benefit of
7430 threshold randomization without actually making the system behave completely differently on
7431 each invocation.
7432
7433 * bytecode/ExecutionCounter.cpp:
7434 (JSC::ExecutionCounter::setThreshold):
7435 * runtime/Options.cpp:
7436 (Options):
7437 (JSC::Options::initializeOptions):
7438 * runtime/Options.h:
7439 (Options):
7440
fpizlo@apple.com3745dbc2012-06-26 02:14:07 +000074412012-06-22 Filip Pizlo <fpizlo@apple.com>
7442
7443 Value profiling should use tier-up threshold randomization to get more coverage
7444 https://bugs.webkit.org/show_bug.cgi?id=89802
7445
7446 Reviewed by Gavin Barraclough.
7447
7448 This patch causes both LLInt and Baseline JIT code to take the OSR slow path several
7449 times before actually doing OSR. If we take the OSR slow path before the execution
7450 count threshold is reached, then we just call CodeBlock::updateAllPredictions() to
7451 compute the current latest least-upper-bound SpecType of all values seen in each
7452 ValueProfile.
7453
7454 * bytecode/CodeBlock.cpp:
7455 (JSC::CodeBlock::stronglyVisitStrongReferences):
7456 (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
7457 (JSC):
7458 (JSC::CodeBlock::updateAllPredictions):
7459 (JSC::CodeBlock::shouldOptimizeNow):
7460 * bytecode/CodeBlock.h:
7461 (JSC::CodeBlock::llintExecuteCounter):
7462 (JSC::CodeBlock::jitExecuteCounter):
7463 (CodeBlock):
7464 (JSC::CodeBlock::updateAllPredictions):
7465 * bytecode/ExecutionCounter.cpp:
7466 (JSC::ExecutionCounter::setThreshold):
7467 (JSC::ExecutionCounter::status):
7468 (JSC):
7469 * bytecode/ExecutionCounter.h:
7470 (JSC::ExecutionCounter::count):
7471 (ExecutionCounter):
7472 * dfg/DFGAbstractState.cpp:
7473 (JSC::DFG::AbstractState::execute):
7474 * dfg/DFGOperations.cpp:
7475 * dfg/DFGSpeculativeJIT.cpp:
7476 (JSC::DFG::SpeculativeJIT::compile):
7477 * jit/JITStubs.cpp:
7478 (JSC::DEFINE_STUB_FUNCTION):
7479 * llint/LLIntSlowPaths.cpp:
7480 (JSC::LLInt::jitCompileAndSetHeuristics):
7481 (JSC::LLInt::entryOSR):
7482 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
7483 * runtime/JSGlobalObject.cpp:
7484 (JSC::JSGlobalObject::JSGlobalObject):
7485 (JSC):
7486 * runtime/JSGlobalObject.h:
7487 (JSGlobalObject):
7488 (JSC::JSGlobalObject::weakRandomInteger):
7489 * runtime/Options.cpp:
7490 (Options):
7491 (JSC::Options::initializeOptions):
7492 * runtime/Options.h:
7493 (Options):
7494 * runtime/WeakRandom.h:
7495 (WeakRandom):
7496 (JSC::WeakRandom::seedUnsafe):
7497
commit-queue@webkit.orgd3790912012-06-26 00:08:19 +000074982012-06-25 Yong Li <yoli@rim.com>
7499
7500 [BlackBerry] Add JSC statistics into about:memory
7501 https://bugs.webkit.org/show_bug.cgi?id=89779
7502
7503 Reviewed by Rob Buis.
7504
7505 Add MemoryStatistics.cpp into build, and fill JITBytes for BlackBerry port.
7506
7507 * PlatformBlackBerry.cmake:
7508 * runtime/MemoryStatistics.cpp:
7509 (JSC::globalMemoryStatistics):
7510
zandobersek@gmail.coma6460e12012-06-23 13:41:40 +000075112012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
7512
7513 Unreviewed, rolling out r121058.
7514 http://trac.webkit.org/changeset/121058
7515 https://bugs.webkit.org/show_bug.cgi?id=89809
7516
7517 Patch causes plugins tests to crash in GTK debug builds
7518 (Requested by zdobersek on #webkit).
7519
7520 * API/APIShims.h:
7521 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
7522 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
7523 (APIEntryShimWithoutLock):
7524 (JSC::APIEntryShim::APIEntryShim):
7525 (APIEntryShim):
7526 (JSC::APICallbackShim::~APICallbackShim):
7527 * API/JSContextRef.cpp:
7528 (JSGlobalContextCreate):
7529 (JSGlobalContextCreateInGroup):
7530 (JSGlobalContextRelease):
7531 (JSContextCreateBacktrace):
7532 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7533 * heap/CopiedSpace.cpp:
7534 (JSC::CopiedSpace::tryAllocateSlowCase):
7535 * heap/Heap.cpp:
7536 (JSC::Heap::protect):
7537 (JSC::Heap::unprotect):
7538 (JSC::Heap::collect):
7539 (JSC::Heap::setActivityCallback):
7540 (JSC::Heap::activityCallback):
7541 (JSC::Heap::sweeper):
7542 * heap/Heap.h:
7543 (Heap):
7544 * heap/HeapTimer.cpp:
7545 (JSC::HeapTimer::~HeapTimer):
7546 (JSC::HeapTimer::invalidate):
7547 (JSC::HeapTimer::timerDidFire):
7548 (JSC):
7549 * heap/HeapTimer.h:
7550 (HeapTimer):
7551 * heap/IncrementalSweeper.cpp:
7552 (JSC::IncrementalSweeper::doWork):
7553 (JSC::IncrementalSweeper::create):
7554 * heap/IncrementalSweeper.h:
7555 (IncrementalSweeper):
7556 * heap/MarkedAllocator.cpp:
7557 (JSC::MarkedAllocator::allocateSlowCase):
7558 * heap/WeakBlock.cpp:
7559 (JSC::WeakBlock::reap):
7560 * jsc.cpp:
7561 (functionGC):
7562 (functionReleaseExecutableMemory):
7563 (jscmain):
7564 * runtime/Completion.cpp:
7565 (JSC::checkSyntax):
7566 (JSC::evaluate):
7567 * runtime/GCActivityCallback.h:
7568 (DefaultGCActivityCallback):
7569 (JSC::DefaultGCActivityCallback::create):
7570 * runtime/JSGlobalData.cpp:
7571 (JSC::JSGlobalData::JSGlobalData):
7572 (JSC::JSGlobalData::~JSGlobalData):
7573 (JSC::JSGlobalData::sharedInstance):
7574 (JSC::JSGlobalData::sharedInstanceInternal):
7575 * runtime/JSGlobalData.h:
7576 (JSGlobalData):
7577 * runtime/JSGlobalObject.cpp:
7578 (JSC::JSGlobalObject::~JSGlobalObject):
7579 (JSC::JSGlobalObject::init):
7580 * runtime/JSLock.cpp:
7581 (JSC):
7582 (JSC::createJSLockCount):
7583 (JSC::JSLock::lockCount):
7584 (JSC::setLockCount):
7585 (JSC::JSLock::JSLock):
7586 (JSC::JSLock::lock):
7587 (JSC::JSLock::unlock):
7588 (JSC::JSLock::currentThreadIsHoldingLock):
7589 (JSC::JSLock::DropAllLocks::DropAllLocks):
7590 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7591 * runtime/JSLock.h:
7592 (JSC):
7593 (JSLock):
7594 (JSC::JSLock::JSLock):
7595 (JSC::JSLock::~JSLock):
7596 (DropAllLocks):
7597 * runtime/WeakGCMap.h:
7598 (JSC::WeakGCMap::set):
7599 * testRegExp.cpp:
7600 (realMain):
7601
achicu@adobe.comcead7612012-06-23 01:23:48 +000076022012-06-22 Alexandru Chiculita <achicu@adobe.com>
7603
7604 [CSS Shaders] Re-enable the CSS Shaders compile time flag on Safari Mac
7605 https://bugs.webkit.org/show_bug.cgi?id=89781
7606
7607 Reviewed by Dean Jackson.
7608
7609 Added ENABLE_CSS_SHADERS flag as enabled by default on Safari for Mac.
7610
7611 * Configurations/FeatureDefines.xcconfig:
7612
fpizlo@apple.com16e2cbf2012-06-22 23:32:59 +000076132012-06-22 Filip Pizlo <fpizlo@apple.com>
7614
7615 DFG tier-up should happen in prologues, not epilogues
7616 https://bugs.webkit.org/show_bug.cgi?id=89752
7617
7618 Reviewed by Geoffrey Garen.
7619
7620 This change has two outcomes:
7621
7622 1) Slightly reduces the likelihood that a function will be optimized both
7623 standalone and via inlining. Previously, if you had a call sequence like foo()
7624 calls bar() exactly once, and nobody else calls bar(), then bar() would get
7625 optimized first (because it returns first) and then foo() gets optimized. If foo()
7626 can inline bar() then that means that bar() gets optimized twice. But now, if we
7627 optimize in prologues, then foo() will be optimized first. If it inlines bar(),
7628 that means that there will no longer be any calls to bar().
7629
7630 2) It lets us kill some code in JITStubs. Epilogue tier-up was very different from
7631 loop tier-up, since epilogue tier-up should not attempt OSR. But prologue tier-up
7632 requires OSR (albeit really easy OSR since it's the top of the compilation unit),
7633 so it becomes just like loop tier-up. As a result, we now have one optimization
7634 hook (cti_optimize) instead of two (cti_optimize_from_loop and
7635 cti_optimize_from_ret).
7636
7637 As a consequence of not having an optimization check in epilogues, the OSR exit
7638 code must now trigger reoptimization itself instead of just signaling the epilogue
7639 check to fire.
7640
7641 This also adds the ability to count the number of DFG compilations, which was
7642 useful for debugging this patch and might be useful for other things in the future.
7643
7644 * bytecode/CodeBlock.cpp:
7645 (JSC::CodeBlock::reoptimize):
7646 (JSC):
7647 * bytecode/CodeBlock.h:
7648 (CodeBlock):
7649 * dfg/DFGByteCodeParser.cpp:
7650 (JSC::DFG::ByteCodeParser::parseCodeBlock):
7651 * dfg/DFGDriver.cpp:
7652 (DFG):
7653 (JSC::DFG::getNumCompilations):
7654 (JSC::DFG::compile):
7655 * dfg/DFGDriver.h:
7656 (DFG):
7657 * dfg/DFGOSRExitCompiler.cpp:
7658 (JSC::DFG::OSRExitCompiler::handleExitCounts):
7659 * dfg/DFGOperations.cpp:
7660 * dfg/DFGOperations.h:
7661 * jit/JIT.cpp:
7662 (JSC::JIT::emitOptimizationCheck):
7663 * jit/JIT.h:
7664 * jit/JITCall32_64.cpp:
7665 (JSC::JIT::emit_op_ret):
7666 (JSC::JIT::emit_op_ret_object_or_this):
7667 * jit/JITOpcodes.cpp:
7668 (JSC::JIT::emit_op_ret):
7669 (JSC::JIT::emit_op_ret_object_or_this):
7670 (JSC::JIT::emit_op_enter):
7671 * jit/JITOpcodes32_64.cpp:
7672 (JSC::JIT::emit_op_enter):
7673 * jit/JITStubs.cpp:
7674 (JSC::DEFINE_STUB_FUNCTION):
7675 * jit/JITStubs.h:
7676
mhahnenberg@apple.com6d9f86d2012-06-22 21:42:46 +000076772012-06-20 Mark Hahnenberg <mhahnenberg@apple.com>
7678
7679 JSLock should be per-JSGlobalData
7680 https://bugs.webkit.org/show_bug.cgi?id=89123
7681
7682 Reviewed by Gavin Barraclough.
7683
7684 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7685 * API/APIShims.h:
7686 (APIEntryShimWithoutLock):
7687 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
7688 determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
7689 HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
7690 JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
7691 its destruction has begun.
7692 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): Now derefs if it also refed.
7693 (JSC::APIEntryShim::APIEntryShim):
7694 (APIEntryShim):
7695 (JSC::APIEntryShim::~APIEntryShim):
7696 (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
7697 Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
7698 and before we've released it, which can only done in APIEntryShim.
7699 (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
7700 * API/JSContextRef.cpp:
7701 (JSGlobalContextCreate):
7702 (JSGlobalContextCreateInGroup):
7703 (JSGlobalContextRelease):
7704 (JSContextCreateBacktrace):
7705 * heap/CopiedSpace.cpp:
7706 (JSC::CopiedSpace::tryAllocateSlowCase):
7707 * heap/Heap.cpp:
7708 (JSC::Heap::protect):
7709 (JSC::Heap::unprotect):
7710 (JSC::Heap::collect):
7711 (JSC::Heap::setActivityCallback):
7712 (JSC::Heap::activityCallback):
7713 (JSC::Heap::sweeper):
7714 * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
7715 are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
7716 and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
7717 prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
7718 (Heap):
7719 * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
7720 (JSC::HeapTimer::~HeapTimer):
7721 (JSC::HeapTimer::invalidate):
7722 (JSC):
7723 (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
7724 that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
7725 HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
7726 (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
7727 out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
7728 but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
7729 we were interrupted between releasing our mutex and trying to grab the APILock.
7730 * heap/HeapTimer.h:
7731 (HeapTimer):
7732 * heap/IncrementalSweeper.cpp:
7733 (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
7734 all of that for us.
7735 (JSC::IncrementalSweeper::create):
7736 * heap/IncrementalSweeper.h:
7737 (IncrementalSweeper):
7738 * heap/MarkedAllocator.cpp:
7739 (JSC::MarkedAllocator::allocateSlowCase):
7740 * heap/WeakBlock.cpp:
7741 (JSC::WeakBlock::reap):
7742 * jsc.cpp:
7743 (functionGC):
7744 (functionReleaseExecutableMemory):
7745 (jscmain):
7746 * runtime/Completion.cpp:
7747 (JSC::checkSyntax):
7748 (JSC::evaluate):
7749 * runtime/GCActivityCallback.h:
7750 (DefaultGCActivityCallback):
7751 (JSC::DefaultGCActivityCallback::create):
7752 * runtime/JSGlobalData.cpp:
7753 (JSC::JSGlobalData::JSGlobalData):
7754 (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
7755 that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
7756 it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
7757 APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
7758 (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
7759 (JSC::JSGlobalData::sharedInstanceInternal):
7760 * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
7761 de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
7762 (JSGlobalData):
7763 (JSC::JSGlobalData::apiLock):
7764 * runtime/JSGlobalObject.cpp:
7765 (JSC::JSGlobalObject::~JSGlobalObject):
7766 (JSC::JSGlobalObject::init):
7767 * runtime/JSLock.cpp:
7768 (JSC):
7769 (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
7770 (JSC::GlobalJSLock::~GlobalJSLock):
7771 (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
7772 it can successfully unlock it later without it disappearing from underneath it.
7773 (JSC::JSLockHolder::~JSLockHolder):
7774 (JSC::JSLock::JSLock):
7775 (JSC::JSLock::~JSLock):
7776 (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
7777 actually waiting for long periods.
7778 (JSC::JSLock::unlock):
7779 (JSC::JSLock::currentThreadIsHoldingLock):
7780 (JSC::JSLock::dropAllLocks):
7781 (JSC::JSLock::dropAllLocksUnconditionally):
7782 (JSC::JSLock::grabAllLocks):
7783 (JSC::JSLock::DropAllLocks::DropAllLocks):
7784 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7785 * runtime/JSLock.h:
7786 (JSC):
7787 (GlobalJSLock):
7788 (JSLockHolder):
7789 (JSLock):
7790 (DropAllLocks):
7791 * runtime/WeakGCMap.h:
7792 (JSC::WeakGCMap::set):
7793 * testRegExp.cpp:
7794 (realMain):
7795
peter@chromium.org166f5bb2012-06-22 16:20:33 +000077962012-06-22 Peter Beverloo <peter@chromium.org>
7797
7798 [Chromium] Disable c++0x compatibility warnings in JavaScriptCore.gyp when building for Android
7799 https://bugs.webkit.org/show_bug.cgi?id=88853
7800
7801 Reviewed by Steve Block.
7802
7803 The Android exclusions were necessary to fix a gyp generation error, as
7804 the gcc_version variable wasn't being defined for Android. Remove these
7805 exceptions when Chromium is able to define the gcc_version variable.
7806
7807 * JavaScriptCore.gyp/JavaScriptCore.gyp:
7808
fpizlo@apple.com90011802012-06-22 01:33:30 +000078092012-06-21 Filip Pizlo <fpizlo@apple.com>
7810
7811 op_resolve_global should not prevent DFG inlining
7812 https://bugs.webkit.org/show_bug.cgi?id=89726
7813
7814 Reviewed by Gavin Barraclough.
7815
7816 * bytecode/CodeBlock.cpp:
7817 (JSC::CodeBlock::CodeBlock):
7818 (JSC::CodeBlock::shrinkToFit):
7819 * bytecode/GlobalResolveInfo.h:
7820 (JSC::GlobalResolveInfo::GlobalResolveInfo):
7821 (GlobalResolveInfo):
7822 * dfg/DFGByteCodeParser.cpp:
7823 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
7824 * dfg/DFGCapabilities.h:
7825 (JSC::DFG::canInlineOpcode):
7826 * dfg/DFGOperations.cpp:
7827 * dfg/DFGOperations.h:
7828 * dfg/DFGSpeculativeJIT.h:
7829 (JSC::DFG::SpeculativeJIT::callOperation):
7830 * dfg/DFGSpeculativeJIT32_64.cpp:
7831 (JSC::DFG::SpeculativeJIT::compile):
7832 * dfg/DFGSpeculativeJIT64.cpp:
7833 (JSC::DFG::SpeculativeJIT::compile):
7834
fpizlo@apple.com618044d2012-06-21 22:55:42 +000078352012-06-20 Filip Pizlo <fpizlo@apple.com>
7836
7837 DFG should inline 'new Array()'
7838 https://bugs.webkit.org/show_bug.cgi?id=89632
7839
7840 Reviewed by Geoffrey Garen.
7841
7842 This adds support for treating InternalFunction like intrinsics. The code
7843 to do so is actually quite clean, so I don't feel bad about perpetuating
7844 the InternalFunction vs. JSFunction-with-NativeExecutable dichotomy.
7845
7846 Currently this newfound power is only used to inline 'new Array()'.
7847
7848 * dfg/DFGByteCodeParser.cpp:
7849 (ByteCodeParser):
7850 (JSC::DFG::ByteCodeParser::handleCall):
7851 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
7852 (DFG):
7853 * dfg/DFGGraph.h:
7854 (JSC::DFG::Graph::isInternalFunctionConstant):
7855 (JSC::DFG::Graph::valueOfInternalFunctionConstant):
7856
mhahnenberg@apple.coma2373032012-06-21 22:38:39 +000078572012-06-21 Mark Hahnenberg <mhahnenberg@apple.com>
7858
7859 Adding copyrights to new files.
7860
7861 * heap/HeapTimer.cpp:
7862 * heap/HeapTimer.h:
7863 * heap/IncrementalSweeper.cpp:
7864 * heap/IncrementalSweeper.h:
7865
commit-queue@webkit.orgc8209e72012-06-21 17:34:26 +000078662012-06-21 Arnaud Renevier <arno@renevier.net>
7867
7868 make sure headers are included only once per file
7869 https://bugs.webkit.org/show_bug.cgi?id=88922
7870
7871 Reviewed by Alexey Proskuryakov.
7872
7873 * bytecode/CodeBlock.h:
7874 * heap/MachineStackMarker.cpp:
7875 * runtime/JSVariableObject.h:
7876
commit-queue@webkit.orgbff9a102012-06-21 15:46:40 +000078772012-06-21 Ryuan Choi <ryuan.choi@gmail.com>
7878
7879 [EFL][WK2] Make WebKit2/Efl headers and resources installable.
7880 https://bugs.webkit.org/show_bug.cgi?id=88207
7881
7882 Reviewed by Chang Shu.
7883
7884 * shell/CMakeLists.txt: Use ${EXEC_INSTALL_DIR} instead of hardcoding "bin"
7885
ggaren@apple.com4b67d0d2012-06-21 02:00:08 +000078862012-06-20 Geoffrey Garen <ggaren@apple.com>
7887
7888 Reduced (but did not eliminate) use of "berzerker GC"
7889 https://bugs.webkit.org/show_bug.cgi?id=89237
7890
7891 Reviewed by Gavin Barraclough.
7892
7893 (PART 1)
7894
7895 This patch turned out to be crashy, so I'm landing the non-crashy bits
7896 first.
7897
7898 This part is pre-requisite refactoring. I didn't actually turn off
7899 "berzerker GC" or turn on incremental shrinking.
7900
7901 * heap/MarkedAllocator.cpp:
7902 (JSC::MarkedAllocator::removeBlock): Make sure to clear the free list when
7903 we throw away the block we're currently allocating out of. Otherwise, we'll
7904 allocate out of a stale free list.
7905
7906 * heap/MarkedSpace.cpp:
7907 (JSC::Free::Free):
7908 (JSC::Free::operator()):
7909 (JSC::Free::returnValue): Refactored this functor to use a shared helper
7910 function, so we can share our implementation with the incremental sweeper.
7911
7912 Also changed to freeing individual blocks immediately instead of linking
7913 them into a list for later freeing. This makes the programming interface
7914 simpler, and it's slightly more efficient to boot.
7915
7916 (JSC::MarkedSpace::~MarkedSpace): Updated for rename.
7917
7918 (JSC::MarkedSpace::freeBlock):
7919 (JSC::MarkedSpace::freeOrShrinkBlock): New helper functions to share behavior
7920 with the incremental sweeper.
7921
7922 (JSC::MarkedSpace::shrink): Updated for new functor behavior.
7923
7924 * heap/MarkedSpace.h: Statically typed languages are awesome.
7925
fpizlo@apple.com8c462122012-06-20 21:07:33 +000079262012-06-20 Filip Pizlo <fpizlo@apple.com>
7927
fpizlo@apple.com3bcb2112012-06-21 01:38:49 +00007928 DFG should optimize ResolveGlobal
7929 https://bugs.webkit.org/show_bug.cgi?id=89617
7930
7931 Reviewed by Oliver Hunt.
7932
7933 This adds inlining of ResolveGlobal accesses that are known monomorphic. It also
7934 adds the specific function optimization to ResolveGlobal, when it is inlined. And,
7935 it makes internal functions act like specific functions, since that will be the
7936 most common use-case of this optimization.
7937
7938 This is only a slighy speed-up (sub 1%), since we don't yet do the obvious thing
7939 with this optimization, which is to completely inline common "globally resolved"
7940 function and constructor calls, like "new Array()".
7941
7942 * CMakeLists.txt:
7943 * GNUmakefile.list.am:
7944 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7945 * JavaScriptCore.xcodeproj/project.pbxproj:
7946 * Target.pri:
7947 * bytecode/CodeBlock.cpp:
7948 (JSC::CodeBlock::globalResolveInfoForBytecodeOffset):
7949 * bytecode/CodeBlock.h:
7950 (CodeBlock):
7951 (JSC::CodeBlock::numberOfGlobalResolveInfos):
7952 * bytecode/GlobalResolveInfo.h:
7953 (JSC::getGlobalResolveInfoBytecodeOffset):
7954 (JSC):
7955 * bytecode/ResolveGlobalStatus.cpp: Added.
7956 (JSC):
7957 (JSC::computeForStructure):
7958 (JSC::computeForLLInt):
7959 (JSC::ResolveGlobalStatus::computeFor):
7960 * bytecode/ResolveGlobalStatus.h: Added.
7961 (JSC):
7962 (ResolveGlobalStatus):
7963 (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
7964 (JSC::ResolveGlobalStatus::state):
7965 (JSC::ResolveGlobalStatus::isSet):
7966 (JSC::ResolveGlobalStatus::operator!):
7967 (JSC::ResolveGlobalStatus::isSimple):
7968 (JSC::ResolveGlobalStatus::takesSlowPath):
7969 (JSC::ResolveGlobalStatus::structure):
7970 (JSC::ResolveGlobalStatus::offset):
7971 (JSC::ResolveGlobalStatus::specificValue):
7972 * dfg/DFGByteCodeParser.cpp:
7973 (ByteCodeParser):
7974 (JSC::DFG::ByteCodeParser::handleGetByOffset):
7975 (DFG):
7976 (JSC::DFG::ByteCodeParser::handleGetById):
7977 (JSC::DFG::ByteCodeParser::parseBlock):
7978 * runtime/JSObject.cpp:
7979 (JSC::getCallableObjectSlow):
7980 (JSC):
7981 (JSC::JSObject::put):
7982 (JSC::JSObject::putDirectVirtual):
7983 (JSC::JSObject::putDirectAccessor):
7984 * runtime/JSObject.h:
7985 (JSC):
7986 (JSC::getCallableObject):
7987 (JSC::JSObject::putOwnDataProperty):
7988 (JSC::JSObject::putDirect):
7989 (JSC::JSObject::putDirectWithoutTransition):
7990
79912012-06-20 Filip Pizlo <fpizlo@apple.com>
7992
fpizlo@apple.com2e368f72012-06-20 23:55:18 +00007993 Functions on global objects should be specializable
7994 https://bugs.webkit.org/show_bug.cgi?id=89615
7995
7996 Reviewed by Oliver Hunt.
7997
7998 I tested to see if this brought back the bug in https://bugs.webkit.org/show_bug.cgi?id=33343,
7999 and it didn't. Bug 33343 was the reason why we disabled global object function specialization
8000 to begin with. So I'm guessing this is safe.
8001
8002 * runtime/JSGlobalObject.cpp:
8003 (JSC::JSGlobalObject::init):
8004
80052012-06-20 Filip Pizlo <fpizlo@apple.com>
8006
fpizlo@apple.com8c462122012-06-20 21:07:33 +00008007 build-webkit failure due to illegal 32-bit integer constants in code
8008 generated by offlineasm
8009 https://bugs.webkit.org/show_bug.cgi?id=89347
8010
8011 Reviewed by Geoffrey Garen.
8012
8013 The offending constants are the magic numbers used by offlineasm to find
8014 offsets in the generated machine code. Added code to turn them into what
8015 the C++ compiler will believe to be valid 32-bit values.
8016
8017 * offlineasm/offsets.rb:
8018
ggaren@apple.com30ef2b32012-06-20 18:24:02 +000080192012-06-19 Geoffrey Garen <ggaren@apple.com>
8020
8021 Made the incremental sweeper more aggressive
8022 https://bugs.webkit.org/show_bug.cgi?id=89527
8023
8024 Reviewed by Oliver Hunt.
8025
8026 This is a pre-requisite to getting rid of "berzerker GC" because we need
8027 the sweeper to reclaim memory in a timely fashion, or we'll see a memory
8028 footprint regression.
8029
8030 * heap/IncrementalSweeper.h:
8031 * heap/IncrementalSweeper.cpp:
8032 (JSC::IncrementalSweeper::scheduleTimer): Since the time slice is predictable,
8033 no need to use a data member to record it.
8034
8035 (JSC::IncrementalSweeper::doSweep): Sweep as many blocks as we can in a
8036 small time slice. This is better than sweeping only one block per timer
8037 fire because that strategy has a heavy timer overhead, and artificially
8038 delays memory reclamation.
8039
fpizlo@apple.com3d517672012-06-20 17:48:23 +000080402012-06-20 Filip Pizlo <fpizlo@apple.com>
8041
8042 DFG should be able to print disassembly interleaved with the IR
8043 https://bugs.webkit.org/show_bug.cgi?id=89551
8044
8045 Reviewed by Geoffrey Garen.
fpizlo@apple.come245b3f2012-06-20 17:51:07 +00008046
8047 This change also removes running Dominators unconditionally on every DFG
8048 compile. Dominators are designed to be computed on-demand, and currently
8049 the only demand is graph dumps.
fpizlo@apple.com3d517672012-06-20 17:48:23 +00008050
8051 * CMakeLists.txt:
8052 * GNUmakefile.list.am:
8053 * JavaScriptCore.xcodeproj/project.pbxproj:
8054 * Target.pri:
8055 * assembler/ARMv7Assembler.h:
8056 (JSC::ARMv7Assembler::labelIgnoringWatchpoints):
8057 (ARMv7Assembler):
8058 * assembler/AbstractMacroAssembler.h:
8059 (AbstractMacroAssembler):
8060 (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
8061 * assembler/X86Assembler.h:
8062 (X86Assembler):
8063 (JSC::X86Assembler::labelIgnoringWatchpoints):
8064 * dfg/DFGCommon.h:
8065 (JSC::DFG::shouldShowDisassembly):
8066 (DFG):
8067 * dfg/DFGDisassembler.cpp: Added.
8068 (DFG):
8069 (JSC::DFG::Disassembler::Disassembler):
8070 (JSC::DFG::Disassembler::dump):
8071 (JSC::DFG::Disassembler::dumpDisassembly):
8072 * dfg/DFGDisassembler.h: Added.
8073 (DFG):
8074 (Disassembler):
8075 (JSC::DFG::Disassembler::setStartOfCode):
8076 (JSC::DFG::Disassembler::setForBlock):
8077 (JSC::DFG::Disassembler::setForNode):
8078 (JSC::DFG::Disassembler::setEndOfMainPath):
8079 (JSC::DFG::Disassembler::setEndOfCode):
8080 * dfg/DFGDriver.cpp:
8081 (JSC::DFG::compile):
8082 * dfg/DFGGraph.cpp:
8083 (JSC::DFG::Graph::dumpCodeOrigin):
8084 (JSC::DFG::Graph::amountOfNodeWhiteSpace):
8085 (DFG):
8086 (JSC::DFG::Graph::printNodeWhiteSpace):
8087 (JSC::DFG::Graph::dump):
8088 (JSC::DFG::Graph::dumpBlockHeader):
8089 * dfg/DFGGraph.h:
8090 * dfg/DFGJITCompiler.cpp:
8091 (JSC::DFG::JITCompiler::JITCompiler):
8092 (DFG):
8093 (JSC::DFG::JITCompiler::compile):
8094 (JSC::DFG::JITCompiler::compileFunction):
8095 * dfg/DFGJITCompiler.h:
8096 (JITCompiler):
8097 (JSC::DFG::JITCompiler::setStartOfCode):
8098 (JSC::DFG::JITCompiler::setForBlock):
8099 (JSC::DFG::JITCompiler::setForNode):
8100 (JSC::DFG::JITCompiler::setEndOfMainPath):
8101 (JSC::DFG::JITCompiler::setEndOfCode):
8102 * dfg/DFGNode.h:
8103 (Node):
8104 (JSC::DFG::Node::willHaveCodeGen):
8105 * dfg/DFGNodeFlags.cpp:
8106 (JSC::DFG::nodeFlagsAsString):
8107 * dfg/DFGSpeculativeJIT.cpp:
8108 (JSC::DFG::SpeculativeJIT::compile):
8109 * dfg/DFGSpeculativeJIT.h:
8110 (SpeculativeJIT):
8111 * runtime/Options.cpp:
8112 (Options):
8113 (JSC::Options::initializeOptions):
8114 * runtime/Options.h:
8115 (Options):
8116
fpizlo@apple.com2adf5272012-06-20 01:33:30 +000081172012-06-19 Filip Pizlo <fpizlo@apple.com>
8118
8119 JSC should be able to show disassembly for all generated JIT code
8120 https://bugs.webkit.org/show_bug.cgi?id=89536
8121
8122 Reviewed by Gavin Barraclough.
8123
8124 Now instead of doing linkBuffer.finalizeCode(), you do
8125 FINALIZE_CODE(linkBuffer, (... explanation ...)). FINALIZE_CODE() then
8126 prints your explanation and the disassembled code, if
8127 Options::showDisassembly is set to true.
8128
8129 * CMakeLists.txt:
8130 * GNUmakefile.list.am:
8131 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8132 * JavaScriptCore.xcodeproj/project.pbxproj:
8133 * Target.pri:
8134 * assembler/LinkBuffer.cpp: Added.
8135 (JSC):
8136 (JSC::LinkBuffer::finalizeCodeWithoutDisassembly):
8137 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
8138 (JSC::LinkBuffer::linkCode):
8139 (JSC::LinkBuffer::performFinalization):
8140 (JSC::LinkBuffer::dumpLinkStatistics):
8141 (JSC::LinkBuffer::dumpCode):
8142 * assembler/LinkBuffer.h:
8143 (LinkBuffer):
8144 (JSC):
8145 * assembler/MacroAssemblerCodeRef.h:
8146 (JSC::MacroAssemblerCodeRef::tryToDisassemble):
8147 (MacroAssemblerCodeRef):
8148 * dfg/DFGJITCompiler.cpp:
8149 (JSC::DFG::JITCompiler::compile):
8150 (JSC::DFG::JITCompiler::compileFunction):
8151 * dfg/DFGOSRExitCompiler.cpp:
8152 * dfg/DFGRepatch.cpp:
8153 (JSC::DFG::generateProtoChainAccessStub):
8154 (JSC::DFG::tryCacheGetByID):
8155 (JSC::DFG::tryBuildGetByIDList):
8156 (JSC::DFG::emitPutReplaceStub):
8157 (JSC::DFG::emitPutTransitionStub):
8158 * dfg/DFGThunks.cpp:
8159 (JSC::DFG::osrExitGenerationThunkGenerator):
8160 * disassembler/Disassembler.h:
8161 (JSC):
8162 (JSC::tryToDisassemble):
8163 * disassembler/UDis86Disassembler.cpp:
8164 (JSC::tryToDisassemble):
8165 * jit/JIT.cpp:
8166 (JSC::JIT::privateCompile):
8167 * jit/JITCode.h:
8168 (JSC::JITCode::tryToDisassemble):
8169 * jit/JITOpcodes.cpp:
8170 (JSC::JIT::privateCompileCTIMachineTrampolines):
8171 * jit/JITOpcodes32_64.cpp:
8172 (JSC::JIT::privateCompileCTIMachineTrampolines):
8173 (JSC::JIT::privateCompileCTINativeCall):
8174 * jit/JITPropertyAccess.cpp:
8175 (JSC::JIT::stringGetByValStubGenerator):
8176 (JSC::JIT::privateCompilePutByIdTransition):
8177 (JSC::JIT::privateCompilePatchGetArrayLength):
8178 (JSC::JIT::privateCompileGetByIdProto):
8179 (JSC::JIT::privateCompileGetByIdSelfList):
8180 (JSC::JIT::privateCompileGetByIdProtoList):
8181 (JSC::JIT::privateCompileGetByIdChainList):
8182 (JSC::JIT::privateCompileGetByIdChain):
8183 * jit/JITPropertyAccess32_64.cpp:
8184 (JSC::JIT::stringGetByValStubGenerator):
8185 (JSC::JIT::privateCompilePutByIdTransition):
8186 (JSC::JIT::privateCompilePatchGetArrayLength):
8187 (JSC::JIT::privateCompileGetByIdProto):
8188 (JSC::JIT::privateCompileGetByIdSelfList):
8189 (JSC::JIT::privateCompileGetByIdProtoList):
8190 (JSC::JIT::privateCompileGetByIdChainList):
8191 (JSC::JIT::privateCompileGetByIdChain):
8192 * jit/SpecializedThunkJIT.h:
8193 (JSC::SpecializedThunkJIT::finalize):
8194 * jit/ThunkGenerators.cpp:
8195 (JSC::charCodeAtThunkGenerator):
8196 (JSC::charAtThunkGenerator):
8197 (JSC::fromCharCodeThunkGenerator):
8198 (JSC::sqrtThunkGenerator):
8199 (JSC::floorThunkGenerator):
8200 (JSC::ceilThunkGenerator):
8201 (JSC::roundThunkGenerator):
8202 (JSC::expThunkGenerator):
8203 (JSC::logThunkGenerator):
8204 (JSC::absThunkGenerator):
8205 (JSC::powThunkGenerator):
8206 * llint/LLIntThunks.cpp:
8207 (JSC::LLInt::generateThunkWithJumpTo):
8208 (JSC::LLInt::functionForCallEntryThunkGenerator):
8209 (JSC::LLInt::functionForConstructEntryThunkGenerator):
8210 (JSC::LLInt::functionForCallArityCheckThunkGenerator):
8211 (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
8212 (JSC::LLInt::evalEntryThunkGenerator):
8213 (JSC::LLInt::programEntryThunkGenerator):
8214 * runtime/Options.cpp:
8215 (Options):
8216 (JSC::Options::initializeOptions):
8217 * runtime/Options.h:
8218 (Options):
8219 * yarr/YarrJIT.cpp:
8220 (JSC::Yarr::YarrGenerator::compile):
8221
mhahnenberg@apple.com7ffd08d2012-06-20 00:20:30 +000082222012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
8223
8224 [Qt][Mac] REGRESSION(r120742): It broke the build
8225 https://bugs.webkit.org/show_bug.cgi?id=89516
8226
8227 Reviewed by Geoffrey Garen.
8228
8229 Removing GCActivityCallbackCF.cpp because it doesn't mesh well with cross-platform
8230 code on Darwin (e.g. Qt). We now use plain ol' vanilla ifdefs to handle platforms
8231 without CF support. These if-defs will probably disappear in the future when we
8232 use cross-platform timers in HeapTimer.
8233
8234 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8235 * JavaScriptCore.xcodeproj/project.pbxproj:
8236 * runtime/GCActivityCallback.cpp:
8237 (JSC):
8238 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8239 (JSC::DefaultGCActivityCallback::doWork):
8240 (JSC::DefaultGCActivityCallback::scheduleTimer):
8241 (JSC::DefaultGCActivityCallback::cancelTimer):
8242 (JSC::DefaultGCActivityCallback::didAllocate):
8243 (JSC::DefaultGCActivityCallback::willCollect):
8244 (JSC::DefaultGCActivityCallback::cancel):
8245 * runtime/GCActivityCallbackCF.cpp: Removed.
8246
fpizlo@apple.com152abff2012-06-19 23:10:12 +000082472012-06-19 Filip Pizlo <fpizlo@apple.com>
8248
8249 DFG CFA forgets to notify subsequent phases of found constants if it proves LogicalNot to be a constant
8250 https://bugs.webkit.org/show_bug.cgi?id=89511
8251 <rdar://problem/11700089>
8252
8253 Reviewed by Geoffrey Garen.
8254
8255 * dfg/DFGAbstractState.cpp:
8256 (JSC::DFG::AbstractState::execute):
8257
commit-queue@webkit.orgb6833002012-06-19 21:06:08 +000082582012-06-19 Mark Lam <mark.lam@apple.com>
8259
8260 CodeBlock::needsCallReturnIndices() is no longer needed.
8261 https://bugs.webkit.org/show_bug.cgi?id=89490
8262
8263 Reviewed by Geoffrey Garen.
8264
8265 * bytecode/CodeBlock.h:
8266 (JSC::CodeBlock::needsCallReturnIndices): removed.
8267 * dfg/DFGJITCompiler.cpp:
8268 (JSC::DFG::JITCompiler::link):
8269 * jit/JIT.cpp:
8270 (JSC::JIT::privateCompile):
8271
fpizlo@apple.com861ea7b2012-06-19 20:05:06 +000082722012-06-19 Filip Pizlo <fpizlo@apple.com>
8273
8274 Unreviewed, try to fix Windows build.
8275
8276 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
8277
fpizlo@apple.com01c2a192012-06-19 19:42:55 +000082782012-06-17 Filip Pizlo <fpizlo@apple.com>
8279
8280 It should be possible to look at disassembly
8281 https://bugs.webkit.org/show_bug.cgi?id=89319
8282
8283 Reviewed by Sam Weinig.
8284
8285 This imports the udis86 disassembler library. The library is placed
8286 behind an abstraction in disassembler/Disassembler.h, so that we can
8287 in the future use other disassemblers (for other platforms) whenever
8288 appropriate. As a first step, the disassembler is being invoked for
8289 DFG verbose dumps.
8290
8291 If we ever want to merge a new version of udis86 in the future, I've
8292 made notes about changes I made to the library in
8293 disassembler/udis86/differences.txt.
8294
8295 * CMakeLists.txt:
8296 * DerivedSources.make:
8297 * GNUmakefile.list.am:
8298 * JavaScriptCore.pri:
8299 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8300 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
8301 * JavaScriptCore.xcodeproj/project.pbxproj:
8302 * dfg/DFGJITCompiler.cpp:
8303 (JSC::DFG::JITCompiler::compile):
8304 (JSC::DFG::JITCompiler::compileFunction):
8305 * disassembler: Added.
8306 * disassembler/Disassembler.h: Added.
8307 (JSC):
8308 (JSC::tryToDisassemble):
8309 * disassembler/UDis86Disassembler.cpp: Added.
8310 (JSC):
8311 (JSC::tryToDisassemble):
8312 * disassembler/udis86: Added.
8313 * disassembler/udis86/differences.txt: Added.
8314 * disassembler/udis86/itab.py: Added.
8315 (UdItabGenerator):
8316 (UdItabGenerator.__init__):
8317 (UdItabGenerator.toGroupId):
8318 (UdItabGenerator.genLookupTable):
8319 (UdItabGenerator.genLookupTableList):
8320 (UdItabGenerator.genInsnTable):
8321 (genItabH):
8322 (genItabH.UD_ITAB_H):
8323 (genItabC):
8324 (genItab):
8325 (main):
8326 * disassembler/udis86/optable.xml: Added.
8327 * disassembler/udis86/ud_opcode.py: Added.
8328 (UdOpcodeTables):
8329 (UdOpcodeTables.sizeOfTable):
8330 (UdOpcodeTables.nameOfTable):
8331 (UdOpcodeTables.updateTable):
8332 (UdOpcodeTables.Insn):
8333 (UdOpcodeTables.Insn.__init__):
8334 (UdOpcodeTables.Insn.__init__.opcode):
8335 (UdOpcodeTables.parse):
8336 (UdOpcodeTables.addInsnDef):
8337 (UdOpcodeTables.print_table):
8338 (UdOpcodeTables.print_tree):
8339 * disassembler/udis86/ud_optable.py: Added.
8340 (UdOptableXmlParser):
8341 (UdOptableXmlParser.parseDef):
8342 (UdOptableXmlParser.parse):
8343 (printFn):
8344 (parse):
8345 (main):
8346 * disassembler/udis86/udis86.c: Added.
8347 (ud_init):
8348 (ud_disassemble):
8349 (ud_set_mode):
8350 (ud_set_vendor):
8351 (ud_set_pc):
8352 (ud):
8353 (ud_insn_asm):
8354 (ud_insn_off):
8355 (ud_insn_hex):
8356 (ud_insn_ptr):
8357 (ud_insn_len):
8358 * disassembler/udis86/udis86.h: Added.
8359 * disassembler/udis86/udis86_decode.c: Added.
8360 (eff_adr_mode):
8361 (ud_lookup_mnemonic):
8362 (decode_prefixes):
8363 (modrm):
8364 (resolve_operand_size):
8365 (resolve_mnemonic):
8366 (decode_a):
8367 (decode_gpr):
8368 (resolve_gpr64):
8369 (resolve_gpr32):
8370 (resolve_reg):
8371 (decode_imm):
8372 (decode_modrm_reg):
8373 (decode_modrm_rm):
8374 (decode_o):
8375 (decode_operand):
8376 (decode_operands):
8377 (clear_insn):
8378 (resolve_mode):
8379 (gen_hex):
8380 (decode_insn):
8381 (decode_3dnow):
8382 (decode_ssepfx):
8383 (decode_ext):
8384 (decode_opcode):
8385 (ud_decode):
8386 * disassembler/udis86/udis86_decode.h: Added.
8387 (ud_itab_entry_operand):
8388 (ud_itab_entry):
8389 (ud_lookup_table_list_entry):
8390 (sse_pfx_idx):
8391 (mode_idx):
8392 (modrm_mod_idx):
8393 (vendor_idx):
8394 (is_group_ptr):
8395 (group_idx):
8396 * disassembler/udis86/udis86_extern.h: Added.
8397 * disassembler/udis86/udis86_input.c: Added.
8398 (inp_buff_hook):
8399 (inp_file_hook):
8400 (ud):
8401 (ud_set_user_opaque_data):
8402 (ud_get_user_opaque_data):
8403 (ud_set_input_buffer):
8404 (ud_set_input_file):
8405 (ud_input_skip):
8406 (ud_input_end):
8407 (ud_inp_next):
8408 (ud_inp_back):
8409 (ud_inp_peek):
8410 (ud_inp_move):
8411 (ud_inp_uint8):
8412 (ud_inp_uint16):
8413 (ud_inp_uint32):
8414 (ud_inp_uint64):
8415 * disassembler/udis86/udis86_input.h: Added.
8416 * disassembler/udis86/udis86_itab_holder.c: Added.
8417 * disassembler/udis86/udis86_syn-att.c: Added.
8418 (opr_cast):
8419 (gen_operand):
8420 (ud_translate_att):
8421 * disassembler/udis86/udis86_syn-intel.c: Added.
8422 (opr_cast):
8423 (gen_operand):
8424 (ud_translate_intel):
8425 * disassembler/udis86/udis86_syn.c: Added.
8426 * disassembler/udis86/udis86_syn.h: Added.
8427 (mkasm):
8428 * disassembler/udis86/udis86_types.h: Added.
8429 (ud_operand):
8430 (ud):
8431 * jit/JITCode.h:
8432 (JITCode):
8433 (JSC::JITCode::tryToDisassemble):
8434
mhahnenberg@apple.coma7ec41b2012-06-19 19:17:31 +000084352012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
8436
8437 GCActivityCallback and IncrementalSweeper should share code
8438 https://bugs.webkit.org/show_bug.cgi?id=89400
8439
8440 Reviewed by Geoffrey Garen.
8441
8442 A lot of functionality is duplicated between GCActivityCallback and IncrementalSweeper.
8443 We should extract the common functionality out into a separate class that both of them
8444 can inherit from. This refactoring will be an even greater boon when we add the ability
8445 to shut these two agents down in a thread-safe fashion
8446
8447 * CMakeLists.txt:
8448 * GNUmakefile.list.am:
8449 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8450 * JavaScriptCore.xcodeproj/project.pbxproj:
8451 * Target.pri:
8452 * heap/Heap.cpp:
8453 (JSC::Heap::Heap): Move initialization down so that the JSGlobalData has a valid Heap when
8454 we're initializing the GCActivityCallback and the IncrementalSweeper.
8455 * heap/Heap.h:
8456 (Heap):
8457 * heap/HeapTimer.cpp: Added.
8458 (JSC):
8459 (JSC::HeapTimer::HeapTimer): Initialize the various base class data that
8460 DefaultGCActivityCallback::commonConstructor() used to do.
8461 (JSC::HeapTimer::~HeapTimer): Call to invalidate().
8462 (JSC::HeapTimer::synchronize): Same functionality as the old DefaultGCActivityCallback::synchronize().
8463 Virtual so that non-CF subclasses can override.
8464 (JSC::HeapTimer::invalidate): Tears down the runloop timer to prevent any future firing.
8465 (JSC::HeapTimer::timerDidFire): Callback to pass to the timer function. Casts and calls the virtual doWork().
8466 * heap/HeapTimer.h: Added. This is the class that serves as the common base class for
8467 both GCActivityCallback and IncrementalSweeper. It handles setting up and tearing down run loops and synchronizing
8468 across threads for its subclasses.
8469 (JSC):
8470 (HeapTimer):
8471 * heap/IncrementalSweeper.cpp: Changes to accomodate the extraction of common functionality
8472 between IncrementalSweeper and GCActivityCallback into a common ancestor.
8473 (JSC):
8474 (JSC::IncrementalSweeper::doWork):
8475 (JSC::IncrementalSweeper::IncrementalSweeper):
8476 (JSC::IncrementalSweeper::cancelTimer):
8477 (JSC::IncrementalSweeper::create):
8478 * heap/IncrementalSweeper.h:
8479 (IncrementalSweeper):
8480 * runtime/GCActivityCallback.cpp:
8481 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8482 (JSC::DefaultGCActivityCallback::doWork):
8483 * runtime/GCActivityCallback.h:
8484 (GCActivityCallback):
8485 (JSC::GCActivityCallback::willCollect):
8486 (JSC::GCActivityCallback::GCActivityCallback):
8487 (JSC):
8488 (DefaultGCActivityCallback): Remove the platform data struct. The platform data should be kept in
8489 the class itself so as to be accessible by doWork(). Most of the platform data for CF is kept in
8490 HeapTimer anyways, so we only need the m_delay field now.
8491 * runtime/GCActivityCallbackBlackBerry.cpp:
8492 (JSC):
8493 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8494 (JSC::DefaultGCActivityCallback::doWork):
8495 (JSC::DefaultGCActivityCallback::didAllocate):
8496 * runtime/GCActivityCallbackCF.cpp:
8497 (JSC):
8498 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8499 (JSC::DefaultGCActivityCallback::doWork):
8500 (JSC::DefaultGCActivityCallback::scheduleTimer):
8501 (JSC::DefaultGCActivityCallback::cancelTimer):
8502 (JSC::DefaultGCActivityCallback::didAllocate):
8503 (JSC::DefaultGCActivityCallback::willCollect):
8504 (JSC::DefaultGCActivityCallback::cancel):
8505
8506
commit-queue@webkit.orgf5584612012-06-19 09:13:52 +000085072012-06-19 Mike West <mkwst@chromium.org>
8508
8509 Introduce ENABLE_CSP_NEXT configuration flag.
8510 https://bugs.webkit.org/show_bug.cgi?id=89300
8511
8512 Reviewed by Adam Barth.
8513
8514 The 1.0 draft of the Content Security Policy spec is just about to
8515 move to Last Call. We'll hide work on the upcoming 1.1 spec behind
8516 this ENABLE flag, disabled by default.
8517
8518 Spec: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html
8519
8520 * Configurations/FeatureDefines.xcconfig:
8521
commit-queue@webkit.org3e0a1a02012-06-19 06:07:28 +000085222012-06-18 Mark Lam <mark.lam@apple.com>
8523
8524 Changed JSC to always record line number information so that error.stack
8525 and window.onerror() can report proper line numbers.
8526 https://bugs.webkit.org/show_bug.cgi?id=89410
8527
8528 Reviewed by Geoffrey Garen.
8529
8530 * bytecode/CodeBlock.cpp:
8531 (JSC::CodeBlock::CodeBlock):
8532 (JSC::CodeBlock::lineNumberForBytecodeOffset):
8533 (JSC::CodeBlock::shrinkToFit): m_lineInfo is now available unconditionally.
8534
8535 * bytecode/CodeBlock.h:
8536 (JSC::CodeBlock::addLineInfo):
8537 (JSC::CodeBlock::hasLineInfo): Unused. Now removed.
8538 (JSC::CodeBlock::needsCallReturnIndices):
8539 (CodeBlock):
8540 (RareData): Hoisted m_lineInfo out of m_rareData. m_lineInfo is now
8541 filled in unconditionally.
8542
8543 * bytecompiler/BytecodeGenerator.h:
8544 (JSC::BytecodeGenerator::addLineInfo):
8545
aestes@apple.comf6d51392012-06-19 03:32:30 +000085462012-06-18 Andy Estes <aestes@apple.com>
8547
aestes@apple.com6cc46942012-06-19 03:34:03 +00008548 Fix r120663, which didn't land the change that was reviewed.
8549
85502012-06-18 Andy Estes <aestes@apple.com>
8551
aestes@apple.comf6d51392012-06-19 03:32:30 +00008552 [JSC] In JSGlobalData.cpp, enableAssembler() sometimes leaks two CF objects
8553 https://bugs.webkit.org/show_bug.cgi?id=89415
8554
8555 Reviewed by Sam Weinig.
8556
8557 In the case where canUseJIT was a non-NULL CFBooleanRef,
8558 enableAssembler() would leak both canUseJITKey and canUseJIT by
8559 returning before calling CFRelease. Fix this by using RetainPtr.
8560
8561 * runtime/JSGlobalData.cpp:
8562 (JSC::enableAssembler):
8563
ggaren@apple.com2318dbc2012-06-18 04:35:21 +000085642012-06-17 Geoffrey Garen <ggaren@apple.com>
8565
8566 GC copy phase spends needless cycles zero-filling blocks
8567 https://bugs.webkit.org/show_bug.cgi?id=89128
8568
8569 Reviewed by Gavin Barraclough.
8570
8571 We only need to zero-fill when we're allocating memory that might not
8572 get fully initialized before GC.
8573
8574 * heap/CopiedBlock.h:
8575 (JSC::CopiedBlock::createNoZeroFill):
8576 (JSC::CopiedBlock::create): Added a way to create without zero-filling.
8577 This is our optimization.
8578
8579 (JSC::CopiedBlock::zeroFillToEnd):
8580 (JSC::CopiedBlock::CopiedBlock): Split zero-filling out from creation,
8581 so we can sometimes create without zero-filling.
8582
8583 * heap/CopiedSpace.cpp:
8584 (JSC::CopiedSpace::init):
8585 (JSC::CopiedSpace::tryAllocateSlowCase):
8586 (JSC::CopiedSpace::doneCopying): Renamed addNewBlock to allocateBlock()
8587 to clarify that the new block is always newly-allocated.
8588
8589 (JSC::CopiedSpace::doneFillingBlock): Make sure to zero-fill to the end
8590 of a block that might be used in the future for allocation. (Most of the
8591 time, this is a no-op, since we've already filled the block completely.)
8592
8593 (JSC::CopiedSpace::getFreshBlock): Removed this function because the
8594 abstraction of "allocation must succeed" is no longer useful.
8595
8596 * heap/CopiedSpace.h: Updated declarations to match.
8597
8598 * heap/CopiedSpaceInlineMethods.h:
8599 (JSC::CopiedSpace::allocateBlockForCopyingPhase): New function, which
8600 knows that it can skip zero-filling.
8601
8602 Added tighter scoping to our lock, to improve parallelism.
8603
8604 (JSC::CopiedSpace::allocateBlock): Folded getFreshBlock functionality
8605 into this function, for simplicity.
8606
8607 * heap/MarkStack.cpp:
8608 (JSC::SlotVisitor::startCopying):
8609 (JSC::SlotVisitor::allocateNewSpace): Use our new zero-fill-free helper
8610 function for great good.
8611
fpizlo@apple.com73df57b2012-06-18 01:59:18 +000086122012-06-17 Filip Pizlo <fpizlo@apple.com>
8613
8614 DFG should attempt to use structure watchpoints for all inlined get_by_id's and put_by_id's
8615 https://bugs.webkit.org/show_bug.cgi?id=89316
8616
8617 Reviewed by Oliver Hunt.
8618
8619 * dfg/DFGByteCodeParser.cpp:
8620 (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
8621 (ByteCodeParser):
8622 (JSC::DFG::ByteCodeParser::handleGetById):
8623 (JSC::DFG::ByteCodeParser::parseBlock):
8624
commit-queue@webkit.orgf8968a72012-06-15 22:24:21 +000086252012-06-15 Yong Li <yoli@rim.com>
8626
8627 [BlackBerry] Put platform-specific GC policy in GCActivityCallback
8628 https://bugs.webkit.org/show_bug.cgi?id=89236
8629
8630 Reviewed by Rob Buis.
8631
8632 Add GCActivityCallbackBlackBerry.cpp and implement platform-specific
8633 low memory GC policy there.
8634
8635 * PlatformBlackBerry.cmake:
8636 * heap/Heap.h:
8637 (JSC::Heap::isSafeToCollect): Added.
8638 * runtime/GCActivityCallbackBlackBerry.cpp: Added.
8639 (JSC):
8640 (JSC::DefaultGCActivityCallbackPlatformData::DefaultGCActivityCallbackPlatformData):
8641 (DefaultGCActivityCallbackPlatformData):
8642 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8643 (JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
8644 (JSC::DefaultGCActivityCallback::didAllocate):
8645 (JSC::DefaultGCActivityCallback::willCollect):
8646 (JSC::DefaultGCActivityCallback::synchronize):
8647 (JSC::DefaultGCActivityCallback::cancel):
8648
fpizlo@apple.com666a2d52012-06-15 22:21:44 +000086492012-06-15 Filip Pizlo <fpizlo@apple.com>
8650
8651 DFG should be able to set watchpoints on structure transitions in the
8652 method check prototype chain
8653 https://bugs.webkit.org/show_bug.cgi?id=89058
8654
8655 Adding the same assertion to 32-bit that I added to 64-bit. This change
8656 does not affect correctness but it's a good thing for assertion coverage.
8657
8658 * dfg/DFGSpeculativeJIT32_64.cpp:
8659 (JSC::DFG::SpeculativeJIT::compile):
8660
fpizlo@apple.comb75911b2012-06-13 20:53:52 +000086612012-06-13 Filip Pizlo <fpizlo@apple.com>
8662
fpizlo@apple.com04e41152012-06-15 22:14:53 +00008663 DFG should be able to set watchpoints on structure transitions in the
8664 method check prototype chain
8665 https://bugs.webkit.org/show_bug.cgi?id=89058
8666
8667 Reviewed by Gavin Barraclough.
8668
8669 This adds the ability to set watchpoints on Structures, and then does
8670 the most modest thing we can do with this ability: the DFG now sets
8671 watchpoints on structure transitions in the prototype chain of method
8672 checks.
8673
8674 This appears to be a >1% speed-up on V8.
8675
8676 * bytecode/PutByIdStatus.cpp:
8677 (JSC::PutByIdStatus::computeFromLLInt):
8678 (JSC::PutByIdStatus::computeFor):
8679 * bytecode/StructureSet.h:
8680 (JSC::StructureSet::containsOnly):
8681 (StructureSet):
8682 * bytecode/Watchpoint.cpp:
8683 (JSC::WatchpointSet::WatchpointSet):
8684 (JSC::InlineWatchpointSet::add):
8685 (JSC):
8686 (JSC::InlineWatchpointSet::inflateSlow):
8687 (JSC::InlineWatchpointSet::freeFat):
8688 * bytecode/Watchpoint.h:
8689 (WatchpointSet):
8690 (JSC):
8691 (InlineWatchpointSet):
8692 (JSC::InlineWatchpointSet::InlineWatchpointSet):
8693 (JSC::InlineWatchpointSet::~InlineWatchpointSet):
8694 (JSC::InlineWatchpointSet::hasBeenInvalidated):
8695 (JSC::InlineWatchpointSet::isStillValid):
8696 (JSC::InlineWatchpointSet::startWatching):
8697 (JSC::InlineWatchpointSet::notifyWrite):
8698 (JSC::InlineWatchpointSet::isFat):
8699 (JSC::InlineWatchpointSet::fat):
8700 (JSC::InlineWatchpointSet::inflate):
8701 * dfg/DFGAbstractState.cpp:
8702 (JSC::DFG::AbstractState::execute):
8703 * dfg/DFGByteCodeParser.cpp:
8704 (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
8705 (ByteCodeParser):
8706 (JSC::DFG::ByteCodeParser::parseBlock):
8707 * dfg/DFGCSEPhase.cpp:
8708 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
8709 (CSEPhase):
8710 (JSC::DFG::CSEPhase::performNodeCSE):
8711 * dfg/DFGCommon.h:
8712 * dfg/DFGGraph.cpp:
8713 (JSC::DFG::Graph::dump):
8714 * dfg/DFGGraph.h:
8715 (JSC::DFG::Graph::isCellConstant):
8716 * dfg/DFGJITCompiler.h:
8717 (JSC::DFG::JITCompiler::addWeakReferences):
8718 (JITCompiler):
8719 * dfg/DFGNode.h:
8720 (JSC::DFG::Node::hasStructure):
8721 (Node):
8722 (JSC::DFG::Node::structure):
8723 * dfg/DFGNodeType.h:
8724 (DFG):
8725 * dfg/DFGPredictionPropagationPhase.cpp:
8726 (JSC::DFG::PredictionPropagationPhase::propagate):
8727 * dfg/DFGRepatch.cpp:
8728 (JSC::DFG::emitPutTransitionStub):
8729 * dfg/DFGSpeculativeJIT64.cpp:
8730 (JSC::DFG::SpeculativeJIT::compile):
8731 * jit/JITStubs.cpp:
8732 (JSC::JITThunks::tryCachePutByID):
8733 * llint/LLIntSlowPaths.cpp:
8734 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
8735 * runtime/Structure.cpp:
8736 (JSC::Structure::Structure):
8737 * runtime/Structure.h:
8738 (JSC::Structure::transitionWatchpointSetHasBeenInvalidated):
8739 (Structure):
8740 (JSC::Structure::transitionWatchpointSetIsStillValid):
8741 (JSC::Structure::addTransitionWatchpoint):
8742 (JSC::Structure::notifyTransitionFromThisStructure):
8743 (JSC::JSCell::setStructure):
8744 * runtime/SymbolTable.cpp:
8745 (JSC::SymbolTableEntry::attemptToWatch):
8746
87472012-06-13 Filip Pizlo <fpizlo@apple.com>
8748
fpizlo@apple.comb75911b2012-06-13 20:53:52 +00008749 DFG should be able to set watchpoints on global variables
8750 https://bugs.webkit.org/show_bug.cgi?id=88692
8751
8752 Reviewed by Geoffrey Garen.
8753
8754 Rolling back in after fixing Windows build issues, and implementing
8755 branchTest8 for the Qt port's strange assemblers.
8756
8757 This implements global variable constant folding by allowing the optimizing
8758 compiler to set a "watchpoint" on globals that it wishes to constant fold.
8759 If the watchpoint fires, then an OSR exit is forced by overwriting the
8760 machine code that the optimizing compiler generated with a jump.
8761
8762 As such, this patch is adding quite a bit of stuff:
8763
8764 - Jump replacement on those hardware targets supported by the optimizing
8765 JIT. It is now possible to patch in a jump instruction over any recorded
8766 watchpoint label. The jump must be "local" in the sense that it must be
8767 within the range of the largest jump distance supported by a one
8768 instruction jump.
8769
8770 - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
8771 that records the location where a jump must be inserted and the
8772 destination to which it should jump. Watchpoints can be added to a
8773 WatchpointSet. The WatchpointSet can be fired all at once, which plants
8774 all jumps. WatchpointSet also remembers if it had ever been invalidated,
8775 which allows for monotonicity: we typically don't want to optimize using
8776 watchpoints on something for which watchpoints had previously fired. The
8777 act of notifying a WatchpointSet has a trivial fast path in case no
8778 Watchpoints are registered (one-byte load+branch).
8779
8780 - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
8781 except that you don't have to emit branches. But, you need to know what
8782 WatchpointSet to add the resulting Watchpoint to. Not everything that
8783 you could write a speculationCheck() for will have a WatchpointSet that
8784 would get notified if the condition you were speculating against became
8785 invalid.
8786
8787 - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
8788 do so without incurring any space overhead for those entries that don't
8789 have WatchpointSets.
8790
8791 - The bytecode generator infers all global function variables to be
8792 watchable, and makes all stores perform the WatchpointSet's write check,
8793 and marks all loads as being potentially watchable (i.e. you can compile
8794 them to a watchpoint and a constant).
8795
8796 Put together, this allows for fully sleazy inlining of calls to globally
8797 declared functions. The inline prologue will no longer contain the load of
8798 the function, or any checks of the function you're calling. I.e. it's
8799 pretty much like the kind of inlining you would see in Java or C++.
8800 Furthermore, the watchpointing functionality is built to be fairly general,
8801 and should allow setting watchpoints on all sorts of interesting things
8802 in the future.
8803
8804 The sleazy inlining means that we will now sometimes inline in code paths
8805 that have never executed. Previously, to inline we would have either had
8806 to have executed the call (to read the call's inline cache) or have
8807 executed the method check (to read the method check's inline cache). Now,
8808 we might inline when the callee is a watched global variable. This
8809 revealed some humorous bugs. First, constant folding disagreed with CFA
8810 over what kinds of operations can clobber (example: code path A is dead
8811 but stores a String into variable X, all other code paths store 0 into
8812 X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
8813 clobbering constant, but constant folding thought it was clobbering
8814 because it saw the String prediction). Second, inlining would crash if
8815 the inline callee had not been compiled. This patch fixes both bugs,
8816 since otherwise run-javascriptcore-tests would report regressions.
8817
8818 * CMakeLists.txt:
8819 * GNUmakefile.list.am:
8820 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8821 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8822 * JavaScriptCore.xcodeproj/project.pbxproj:
8823 * Target.pri:
8824 * assembler/ARMv7Assembler.h:
8825 (ARMv7Assembler):
8826 (JSC::ARMv7Assembler::ARMv7Assembler):
8827 (JSC::ARMv7Assembler::labelForWatchpoint):
8828 (JSC::ARMv7Assembler::label):
8829 (JSC::ARMv7Assembler::replaceWithJump):
8830 (JSC::ARMv7Assembler::maxJumpReplacementSize):
8831 * assembler/AbstractMacroAssembler.h:
8832 (JSC):
8833 (AbstractMacroAssembler):
8834 (Label):
8835 (JSC::AbstractMacroAssembler::watchpointLabel):
8836 (JSC::AbstractMacroAssembler::readPointer):
8837 * assembler/AssemblerBuffer.h:
8838 * assembler/MacroAssemblerARM.h:
8839 (JSC::MacroAssemblerARM::branchTest8):
8840 (MacroAssemblerARM):
8841 (JSC::MacroAssemblerARM::replaceWithJump):
8842 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
8843 * assembler/MacroAssemblerARMv7.h:
8844 (JSC::MacroAssemblerARMv7::load8Signed):
8845 (JSC::MacroAssemblerARMv7::load16Signed):
8846 (MacroAssemblerARMv7):
8847 (JSC::MacroAssemblerARMv7::replaceWithJump):
8848 (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
8849 (JSC::MacroAssemblerARMv7::branchTest8):
8850 (JSC::MacroAssemblerARMv7::jump):
8851 (JSC::MacroAssemblerARMv7::makeBranch):
8852 * assembler/MacroAssemblerMIPS.h:
8853 (JSC::MacroAssemblerMIPS::branchTest8):
8854 (MacroAssemblerMIPS):
8855 (JSC::MacroAssemblerMIPS::replaceWithJump):
8856 (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
8857 * assembler/MacroAssemblerSH4.h:
8858 (JSC::MacroAssemblerSH4::branchTest8):
8859 (MacroAssemblerSH4):
8860 (JSC::MacroAssemblerSH4::replaceWithJump):
8861 (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
8862 * assembler/MacroAssemblerX86.h:
8863 (MacroAssemblerX86):
8864 (JSC::MacroAssemblerX86::branchTest8):
8865 * assembler/MacroAssemblerX86Common.h:
8866 (JSC::MacroAssemblerX86Common::replaceWithJump):
8867 (MacroAssemblerX86Common):
8868 (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
8869 * assembler/MacroAssemblerX86_64.h:
8870 (MacroAssemblerX86_64):
8871 (JSC::MacroAssemblerX86_64::branchTest8):
8872 * assembler/X86Assembler.h:
8873 (JSC::X86Assembler::X86Assembler):
8874 (X86Assembler):
8875 (JSC::X86Assembler::cmpb_im):
8876 (JSC::X86Assembler::testb_im):
8877 (JSC::X86Assembler::labelForWatchpoint):
8878 (JSC::X86Assembler::label):
8879 (JSC::X86Assembler::replaceWithJump):
8880 (JSC::X86Assembler::maxJumpReplacementSize):
8881 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
8882 * bytecode/CodeBlock.cpp:
8883 (JSC):
8884 (JSC::CodeBlock::printGetByIdCacheStatus):
8885 (JSC::CodeBlock::dump):
8886 * bytecode/CodeBlock.h:
8887 (JSC::CodeBlock::appendOSRExit):
8888 (JSC::CodeBlock::appendSpeculationRecovery):
8889 (CodeBlock):
8890 (JSC::CodeBlock::appendWatchpoint):
8891 (JSC::CodeBlock::numberOfWatchpoints):
8892 (JSC::CodeBlock::watchpoint):
8893 (DFGData):
8894 * bytecode/DFGExitProfile.h:
8895 (JSC::DFG::exitKindToString):
8896 (JSC::DFG::exitKindIsCountable):
8897 * bytecode/GetByIdStatus.cpp:
8898 (JSC::GetByIdStatus::computeForChain):
8899 * bytecode/Instruction.h:
8900 (Instruction):
8901 (JSC::Instruction::Instruction):
8902 * bytecode/Opcode.h:
8903 (JSC):
8904 (JSC::padOpcodeName):
8905 * bytecode/Watchpoint.cpp: Added.
8906 (JSC):
8907 (JSC::Watchpoint::~Watchpoint):
8908 (JSC::Watchpoint::correctLabels):
8909 (JSC::Watchpoint::fire):
8910 (JSC::WatchpointSet::WatchpointSet):
8911 (JSC::WatchpointSet::~WatchpointSet):
8912 (JSC::WatchpointSet::add):
8913 (JSC::WatchpointSet::notifyWriteSlow):
8914 (JSC::WatchpointSet::fireAllWatchpoints):
8915 * bytecode/Watchpoint.h: Added.
8916 (JSC):
8917 (Watchpoint):
8918 (JSC::Watchpoint::Watchpoint):
8919 (JSC::Watchpoint::setDestination):
8920 (WatchpointSet):
8921 (JSC::WatchpointSet::isStillValid):
8922 (JSC::WatchpointSet::hasBeenInvalidated):
8923 (JSC::WatchpointSet::startWatching):
8924 (JSC::WatchpointSet::notifyWrite):
8925 (JSC::WatchpointSet::addressOfIsWatched):
8926 * bytecompiler/BytecodeGenerator.cpp:
8927 (JSC::ResolveResult::checkValidity):
8928 (JSC::BytecodeGenerator::addGlobalVar):
8929 (JSC::BytecodeGenerator::BytecodeGenerator):
8930 (JSC::BytecodeGenerator::resolve):
8931 (JSC::BytecodeGenerator::emitResolve):
8932 (JSC::BytecodeGenerator::emitResolveWithBase):
8933 (JSC::BytecodeGenerator::emitResolveWithThis):
8934 (JSC::BytecodeGenerator::emitGetStaticVar):
8935 (JSC::BytecodeGenerator::emitPutStaticVar):
8936 * bytecompiler/BytecodeGenerator.h:
8937 (BytecodeGenerator):
8938 * bytecompiler/NodesCodegen.cpp:
8939 (JSC::FunctionCallResolveNode::emitBytecode):
8940 (JSC::PostfixResolveNode::emitBytecode):
8941 (JSC::PrefixResolveNode::emitBytecode):
8942 (JSC::ReadModifyResolveNode::emitBytecode):
8943 (JSC::AssignResolveNode::emitBytecode):
8944 (JSC::ConstDeclNode::emitCodeSingle):
8945 * dfg/DFGAbstractState.cpp:
8946 (JSC::DFG::AbstractState::execute):
8947 (JSC::DFG::AbstractState::clobberStructures):
8948 * dfg/DFGAbstractState.h:
8949 (AbstractState):
8950 (JSC::DFG::AbstractState::didClobber):
8951 * dfg/DFGByteCodeParser.cpp:
8952 (JSC::DFG::ByteCodeParser::handleInlining):
8953 (JSC::DFG::ByteCodeParser::parseBlock):
8954 * dfg/DFGCCallHelpers.h:
8955 (CCallHelpers):
8956 (JSC::DFG::CCallHelpers::setupArguments):
8957 * dfg/DFGCSEPhase.cpp:
8958 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
8959 (CSEPhase):
8960 (JSC::DFG::CSEPhase::globalVarStoreElimination):
8961 (JSC::DFG::CSEPhase::performNodeCSE):
8962 * dfg/DFGCapabilities.h:
8963 (JSC::DFG::canCompileOpcode):
8964 * dfg/DFGConstantFoldingPhase.cpp:
8965 (JSC::DFG::ConstantFoldingPhase::run):
8966 * dfg/DFGCorrectableJumpPoint.h:
8967 (JSC::DFG::CorrectableJumpPoint::isSet):
8968 (CorrectableJumpPoint):
8969 * dfg/DFGJITCompiler.cpp:
8970 (JSC::DFG::JITCompiler::linkOSRExits):
8971 (JSC::DFG::JITCompiler::link):
8972 * dfg/DFGNode.h:
8973 (JSC::DFG::Node::hasIdentifierNumberForCheck):
8974 (Node):
8975 (JSC::DFG::Node::identifierNumberForCheck):
8976 (JSC::DFG::Node::hasRegisterPointer):
8977 * dfg/DFGNodeType.h:
8978 (DFG):
8979 * dfg/DFGOSRExit.cpp:
8980 (JSC::DFG::OSRExit::OSRExit):
8981 * dfg/DFGOSRExit.h:
8982 (OSRExit):
8983 * dfg/DFGOperations.cpp:
8984 * dfg/DFGOperations.h:
8985 * dfg/DFGPredictionPropagationPhase.cpp:
8986 (JSC::DFG::PredictionPropagationPhase::propagate):
8987 * dfg/DFGSpeculativeJIT.h:
8988 (JSC::DFG::SpeculativeJIT::callOperation):
8989 (JSC::DFG::SpeculativeJIT::appendCall):
8990 (SpeculativeJIT):
8991 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
8992 * dfg/DFGSpeculativeJIT32_64.cpp:
8993 (JSC::DFG::SpeculativeJIT::compile):
8994 * dfg/DFGSpeculativeJIT64.cpp:
8995 (JSC::DFG::SpeculativeJIT::compile):
8996 * interpreter/Interpreter.cpp:
8997 (JSC::Interpreter::privateExecute):
8998 * jit/JIT.cpp:
8999 (JSC::JIT::privateCompileMainPass):
9000 (JSC::JIT::privateCompileSlowCases):
9001 * jit/JIT.h:
9002 * jit/JITPropertyAccess.cpp:
9003 (JSC::JIT::emit_op_put_global_var_check):
9004 (JSC):
9005 (JSC::JIT::emitSlow_op_put_global_var_check):
9006 * jit/JITPropertyAccess32_64.cpp:
9007 (JSC::JIT::emit_op_put_global_var_check):
9008 (JSC):
9009 (JSC::JIT::emitSlow_op_put_global_var_check):
9010 * jit/JITStubs.cpp:
9011 (JSC::DEFINE_STUB_FUNCTION):
9012 (JSC):
9013 * jit/JITStubs.h:
9014 * llint/LLIntSlowPaths.cpp:
9015 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
9016 (LLInt):
9017 * llint/LLIntSlowPaths.h:
9018 (LLInt):
9019 * llint/LowLevelInterpreter32_64.asm:
9020 * llint/LowLevelInterpreter64.asm:
9021 * runtime/JSObject.cpp:
9022 (JSC::JSObject::removeDirect):
9023 * runtime/JSObject.h:
9024 (JSObject):
9025 * runtime/JSSymbolTableObject.h:
9026 (JSC::symbolTableGet):
9027 (JSC::symbolTablePut):
9028 (JSC::symbolTablePutWithAttributes):
9029 * runtime/SymbolTable.cpp: Added.
9030 (JSC):
9031 (JSC::SymbolTableEntry::copySlow):
9032 (JSC::SymbolTableEntry::freeFatEntrySlow):
9033 (JSC::SymbolTableEntry::couldBeWatched):
9034 (JSC::SymbolTableEntry::attemptToWatch):
9035 (JSC::SymbolTableEntry::addressOfIsWatched):
9036 (JSC::SymbolTableEntry::addWatchpoint):
9037 (JSC::SymbolTableEntry::notifyWriteSlow):
9038 (JSC::SymbolTableEntry::inflateSlow):
9039 * runtime/SymbolTable.h:
9040 (JSC):
9041 (SymbolTableEntry):
9042 (Fast):
9043 (JSC::SymbolTableEntry::Fast::Fast):
9044 (JSC::SymbolTableEntry::Fast::isNull):
9045 (JSC::SymbolTableEntry::Fast::getIndex):
9046 (JSC::SymbolTableEntry::Fast::isReadOnly):
9047 (JSC::SymbolTableEntry::Fast::getAttributes):
9048 (JSC::SymbolTableEntry::Fast::isFat):
9049 (JSC::SymbolTableEntry::SymbolTableEntry):
9050 (JSC::SymbolTableEntry::~SymbolTableEntry):
9051 (JSC::SymbolTableEntry::operator=):
9052 (JSC::SymbolTableEntry::isNull):
9053 (JSC::SymbolTableEntry::getIndex):
9054 (JSC::SymbolTableEntry::getFast):
9055 (JSC::SymbolTableEntry::getAttributes):
9056 (JSC::SymbolTableEntry::isReadOnly):
9057 (JSC::SymbolTableEntry::watchpointSet):
9058 (JSC::SymbolTableEntry::notifyWrite):
9059 (FatEntry):
9060 (JSC::SymbolTableEntry::FatEntry::FatEntry):
9061 (JSC::SymbolTableEntry::isFat):
9062 (JSC::SymbolTableEntry::fatEntry):
9063 (JSC::SymbolTableEntry::inflate):
9064 (JSC::SymbolTableEntry::bits):
9065 (JSC::SymbolTableEntry::freeFatEntry):
9066 (JSC::SymbolTableEntry::pack):
9067 (JSC::SymbolTableEntry::isValidIndex):
9068
zandobersek@gmail.com88d53732012-06-13 09:38:42 +000090692012-06-13 Sheriff Bot <webkit.review.bot@gmail.com>
9070
9071 Unreviewed, rolling out r120172.
9072 http://trac.webkit.org/changeset/120172
9073 https://bugs.webkit.org/show_bug.cgi?id=88976
9074
9075 The patch causes compilation failures on Gtk, Qt and Apple Win
9076 bots (Requested by zdobersek on #webkit).
9077
9078 * CMakeLists.txt:
9079 * GNUmakefile.list.am:
9080 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9081 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9082 * JavaScriptCore.xcodeproj/project.pbxproj:
9083 * Target.pri:
9084 * assembler/ARMv7Assembler.h:
9085 (JSC::ARMv7Assembler::nop):
9086 (JSC::ARMv7Assembler::label):
9087 (JSC::ARMv7Assembler::readPointer):
9088 (ARMv7Assembler):
9089 * assembler/AbstractMacroAssembler.h:
9090 (JSC):
9091 (AbstractMacroAssembler):
9092 (Label):
9093 * assembler/AssemblerBuffer.h:
9094 * assembler/MacroAssemblerARM.h:
9095 * assembler/MacroAssemblerARMv7.h:
9096 (JSC::MacroAssemblerARMv7::nop):
9097 (JSC::MacroAssemblerARMv7::jump):
9098 (JSC::MacroAssemblerARMv7::makeBranch):
9099 * assembler/MacroAssemblerMIPS.h:
9100 * assembler/MacroAssemblerSH4.h:
9101 * assembler/MacroAssemblerX86.h:
9102 (MacroAssemblerX86):
9103 (JSC::MacroAssemblerX86::moveWithPatch):
9104 * assembler/MacroAssemblerX86Common.h:
9105 * assembler/MacroAssemblerX86_64.h:
9106 (JSC::MacroAssemblerX86_64::branchTest8):
9107 * assembler/X86Assembler.h:
9108 (JSC::X86Assembler::cmpb_im):
9109 (JSC::X86Assembler::codeSize):
9110 (JSC::X86Assembler::label):
9111 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
9112 * bytecode/CodeBlock.cpp:
9113 (JSC::CodeBlock::dump):
9114 * bytecode/CodeBlock.h:
9115 (JSC::CodeBlock::appendOSRExit):
9116 (JSC::CodeBlock::appendSpeculationRecovery):
9117 (DFGData):
9118 * bytecode/DFGExitProfile.h:
9119 (JSC::DFG::exitKindToString):
9120 (JSC::DFG::exitKindIsCountable):
9121 * bytecode/Instruction.h:
9122 * bytecode/Opcode.h:
9123 (JSC):
9124 (JSC::padOpcodeName):
9125 * bytecode/Watchpoint.cpp: Removed.
9126 * bytecode/Watchpoint.h: Removed.
9127 * bytecompiler/BytecodeGenerator.cpp:
9128 (JSC::ResolveResult::checkValidity):
9129 (JSC::BytecodeGenerator::addGlobalVar):
9130 (JSC::BytecodeGenerator::BytecodeGenerator):
9131 (JSC::BytecodeGenerator::resolve):
9132 (JSC::BytecodeGenerator::emitResolve):
9133 (JSC::BytecodeGenerator::emitResolveWithBase):
9134 (JSC::BytecodeGenerator::emitResolveWithThis):
9135 (JSC::BytecodeGenerator::emitGetStaticVar):
9136 (JSC::BytecodeGenerator::emitPutStaticVar):
9137 * bytecompiler/BytecodeGenerator.h:
9138 (BytecodeGenerator):
9139 * bytecompiler/NodesCodegen.cpp:
9140 (JSC::FunctionCallResolveNode::emitBytecode):
9141 (JSC::PostfixResolveNode::emitBytecode):
9142 (JSC::PrefixResolveNode::emitBytecode):
9143 (JSC::ReadModifyResolveNode::emitBytecode):
9144 (JSC::AssignResolveNode::emitBytecode):
9145 (JSC::ConstDeclNode::emitCodeSingle):
9146 * dfg/DFGAbstractState.cpp:
9147 (JSC::DFG::AbstractState::execute):
9148 (JSC::DFG::AbstractState::clobberStructures):
9149 * dfg/DFGAbstractState.h:
9150 (AbstractState):
9151 * dfg/DFGByteCodeParser.cpp:
9152 (JSC::DFG::ByteCodeParser::handleInlining):
9153 (JSC::DFG::ByteCodeParser::parseBlock):
9154 * dfg/DFGCCallHelpers.h:
9155 (JSC::DFG::CCallHelpers::setupArguments):
9156 * dfg/DFGCSEPhase.cpp:
9157 (JSC::DFG::CSEPhase::globalVarStoreElimination):
9158 (JSC::DFG::CSEPhase::performNodeCSE):
9159 * dfg/DFGCapabilities.h:
9160 (JSC::DFG::canCompileOpcode):
9161 * dfg/DFGConstantFoldingPhase.cpp:
9162 (JSC::DFG::ConstantFoldingPhase::run):
9163 * dfg/DFGCorrectableJumpPoint.h:
9164 * dfg/DFGJITCompiler.cpp:
9165 (JSC::DFG::JITCompiler::linkOSRExits):
9166 (JSC::DFG::JITCompiler::link):
9167 * dfg/DFGNode.h:
9168 (JSC::DFG::Node::hasRegisterPointer):
9169 * dfg/DFGNodeType.h:
9170 (DFG):
9171 * dfg/DFGOSRExit.cpp:
9172 (JSC::DFG::OSRExit::OSRExit):
9173 * dfg/DFGOSRExit.h:
9174 (OSRExit):
9175 * dfg/DFGOperations.cpp:
9176 * dfg/DFGOperations.h:
9177 * dfg/DFGPredictionPropagationPhase.cpp:
9178 (JSC::DFG::PredictionPropagationPhase::propagate):
9179 * dfg/DFGSpeculativeJIT.h:
9180 (JSC::DFG::SpeculativeJIT::callOperation):
9181 (JSC::DFG::SpeculativeJIT::appendCallSetResult):
9182 (JSC::DFG::SpeculativeJIT::speculationCheck):
9183 * dfg/DFGSpeculativeJIT32_64.cpp:
9184 (JSC::DFG::SpeculativeJIT::compile):
9185 * dfg/DFGSpeculativeJIT64.cpp:
9186 (JSC::DFG::SpeculativeJIT::compile):
9187 * jit/JIT.cpp:
9188 (JSC::JIT::privateCompileMainPass):
9189 (JSC::JIT::privateCompileSlowCases):
9190 * jit/JIT.h:
9191 * jit/JITPropertyAccess.cpp:
9192 * jit/JITPropertyAccess32_64.cpp:
9193 * jit/JITStubs.cpp:
9194 * jit/JITStubs.h:
9195 * llint/LLIntSlowPaths.cpp:
9196 * llint/LLIntSlowPaths.h:
9197 (LLInt):
9198 * llint/LowLevelInterpreter32_64.asm:
9199 * llint/LowLevelInterpreter64.asm:
9200 * runtime/JSObject.cpp:
9201 (JSC::JSObject::removeDirect):
9202 * runtime/JSObject.h:
9203 (JSObject):
9204 * runtime/JSSymbolTableObject.h:
9205 (JSC::symbolTableGet):
9206 (JSC::symbolTablePut):
9207 (JSC::symbolTablePutWithAttributes):
9208 * runtime/SymbolTable.cpp: Removed.
9209 * runtime/SymbolTable.h:
9210 (JSC):
9211 (JSC::SymbolTableEntry::isNull):
9212 (JSC::SymbolTableEntry::getIndex):
9213 (SymbolTableEntry):
9214 (JSC::SymbolTableEntry::getAttributes):
9215 (JSC::SymbolTableEntry::isReadOnly):
9216 (JSC::SymbolTableEntry::pack):
9217 (JSC::SymbolTableEntry::isValidIndex):
9218
fpizlo@apple.com3bdd4c92012-06-13 04:56:22 +000092192012-06-12 Filip Pizlo <fpizlo@apple.com>
9220
fpizlo@apple.comb6c5eeb2012-06-13 08:20:39 +00009221 DFG should be able to set watchpoints on global variables
9222 https://bugs.webkit.org/show_bug.cgi?id=88692
9223
9224 Reviewed by Geoffrey Garen.
9225
9226 This implements global variable constant folding by allowing the optimizing
9227 compiler to set a "watchpoint" on globals that it wishes to constant fold.
9228 If the watchpoint fires, then an OSR exit is forced by overwriting the
9229 machine code that the optimizing compiler generated with a jump.
9230
9231 As such, this patch is adding quite a bit of stuff:
9232
9233 - Jump replacement on those hardware targets supported by the optimizing
9234 JIT. It is now possible to patch in a jump instruction over any recorded
9235 watchpoint label. The jump must be "local" in the sense that it must be
9236 within the range of the largest jump distance supported by a one
9237 instruction jump.
9238
9239 - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
9240 that records the location where a jump must be inserted and the
9241 destination to which it should jump. Watchpoints can be added to a
9242 WatchpointSet. The WatchpointSet can be fired all at once, which plants
9243 all jumps. WatchpointSet also remembers if it had ever been invalidated,
9244 which allows for monotonicity: we typically don't want to optimize using
9245 watchpoints on something for which watchpoints had previously fired. The
9246 act of notifying a WatchpointSet has a trivial fast path in case no
9247 Watchpoints are registered (one-byte load+branch).
9248
9249 - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
9250 except that you don't have to emit branches. But, you need to know what
9251 WatchpointSet to add the resulting Watchpoint to. Not everything that
9252 you could write a speculationCheck() for will have a WatchpointSet that
9253 would get notified if the condition you were speculating against became
9254 invalid.
9255
9256 - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
9257 do so without incurring any space overhead for those entries that don't
9258 have WatchpointSets.
9259
9260 - The bytecode generator infers all global function variables to be
9261 watchable, and makes all stores perform the WatchpointSet's write check,
9262 and marks all loads as being potentially watchable (i.e. you can compile
9263 them to a watchpoint and a constant).
9264
9265 Put together, this allows for fully sleazy inlining of calls to globally
9266 declared functions. The inline prologue will no longer contain the load of
9267 the function, or any checks of the function you're calling. I.e. it's
9268 pretty much like the kind of inlining you would see in Java or C++.
9269 Furthermore, the watchpointing functionality is built to be fairly general,
9270 and should allow setting watchpoints on all sorts of interesting things
9271 in the future.
9272
9273 The sleazy inlining means that we will now sometimes inline in code paths
9274 that have never executed. Previously, to inline we would have either had
9275 to have executed the call (to read the call's inline cache) or have
9276 executed the method check (to read the method check's inline cache). Now,
9277 we might inline when the callee is a watched global variable. This
9278 revealed some humorous bugs. First, constant folding disagreed with CFA
9279 over what kinds of operations can clobber (example: code path A is dead
9280 but stores a String into variable X, all other code paths store 0 into
9281 X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
9282 clobbering constant, but constant folding thought it was clobbering
9283 because it saw the String prediction). Second, inlining would crash if
9284 the inline callee had not been compiled. This patch fixes both bugs,
9285 since otherwise run-javascriptcore-tests would report regressions.
9286
9287 * CMakeLists.txt:
9288 * GNUmakefile.list.am:
9289 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9290 * JavaScriptCore.xcodeproj/project.pbxproj:
9291 * Target.pri:
9292 * assembler/ARMv7Assembler.h:
9293 (ARMv7Assembler):
9294 (JSC::ARMv7Assembler::ARMv7Assembler):
9295 (JSC::ARMv7Assembler::labelForWatchpoint):
9296 (JSC::ARMv7Assembler::label):
9297 (JSC::ARMv7Assembler::replaceWithJump):
9298 (JSC::ARMv7Assembler::maxJumpReplacementSize):
9299 * assembler/AbstractMacroAssembler.h:
9300 (JSC):
9301 (AbstractMacroAssembler):
9302 (Label):
9303 (JSC::AbstractMacroAssembler::watchpointLabel):
9304 * assembler/AssemblerBuffer.h:
9305 * assembler/MacroAssemblerARM.h:
9306 (JSC::MacroAssemblerARM::replaceWithJump):
9307 (MacroAssemblerARM):
9308 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
9309 * assembler/MacroAssemblerARMv7.h:
9310 (MacroAssemblerARMv7):
9311 (JSC::MacroAssemblerARMv7::replaceWithJump):
9312 (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
9313 (JSC::MacroAssemblerARMv7::branchTest8):
9314 (JSC::MacroAssemblerARMv7::jump):
9315 (JSC::MacroAssemblerARMv7::makeBranch):
9316 * assembler/MacroAssemblerMIPS.h:
9317 (JSC::MacroAssemblerMIPS::replaceWithJump):
9318 (MacroAssemblerMIPS):
9319 (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
9320 * assembler/MacroAssemblerSH4.h:
9321 (JSC::MacroAssemblerSH4::replaceWithJump):
9322 (MacroAssemblerSH4):
9323 (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
9324 * assembler/MacroAssemblerX86.h:
9325 (MacroAssemblerX86):
9326 (JSC::MacroAssemblerX86::branchTest8):
9327 * assembler/MacroAssemblerX86Common.h:
9328 (JSC::MacroAssemblerX86Common::replaceWithJump):
9329 (MacroAssemblerX86Common):
9330 (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
9331 * assembler/MacroAssemblerX86_64.h:
9332 (MacroAssemblerX86_64):
9333 (JSC::MacroAssemblerX86_64::branchTest8):
9334 * assembler/X86Assembler.h:
9335 (JSC::X86Assembler::X86Assembler):
9336 (X86Assembler):
9337 (JSC::X86Assembler::cmpb_im):
9338 (JSC::X86Assembler::testb_im):
9339 (JSC::X86Assembler::labelForWatchpoint):
9340 (JSC::X86Assembler::label):
9341 (JSC::X86Assembler::replaceWithJump):
9342 (JSC::X86Assembler::maxJumpReplacementSize):
9343 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
9344 * bytecode/CodeBlock.cpp:
9345 (JSC::CodeBlock::dump):
9346 * bytecode/CodeBlock.h:
9347 (JSC::CodeBlock::appendOSRExit):
9348 (JSC::CodeBlock::appendSpeculationRecovery):
9349 (CodeBlock):
9350 (JSC::CodeBlock::appendWatchpoint):
9351 (JSC::CodeBlock::numberOfWatchpoints):
9352 (JSC::CodeBlock::watchpoint):
9353 (DFGData):
9354 * bytecode/DFGExitProfile.h:
9355 (JSC::DFG::exitKindToString):
9356 (JSC::DFG::exitKindIsCountable):
9357 * bytecode/Instruction.h:
9358 (Instruction):
9359 (JSC::Instruction::Instruction):
9360 * bytecode/Opcode.h:
9361 (JSC):
9362 (JSC::padOpcodeName):
9363 * bytecode/Watchpoint.cpp: Added.
9364 (JSC):
9365 (JSC::Watchpoint::~Watchpoint):
9366 (JSC::Watchpoint::correctLabels):
9367 (JSC::Watchpoint::fire):
9368 (JSC::WatchpointSet::WatchpointSet):
9369 (JSC::WatchpointSet::~WatchpointSet):
9370 (JSC::WatchpointSet::add):
9371 (JSC::WatchpointSet::notifyWriteSlow):
9372 (JSC::WatchpointSet::fireAllWatchpoints):
9373 * bytecode/Watchpoint.h: Added.
9374 (JSC):
9375 (Watchpoint):
9376 (JSC::Watchpoint::Watchpoint):
9377 (JSC::Watchpoint::setDestination):
9378 (WatchpointSet):
9379 (JSC::WatchpointSet::isStillValid):
9380 (JSC::WatchpointSet::hasBeenInvalidated):
9381 (JSC::WatchpointSet::startWatching):
9382 (JSC::WatchpointSet::notifyWrite):
9383 (JSC::WatchpointSet::addressOfIsWatched):
9384 * bytecompiler/BytecodeGenerator.cpp:
9385 (JSC::ResolveResult::checkValidity):
9386 (JSC::BytecodeGenerator::addGlobalVar):
9387 (JSC::BytecodeGenerator::BytecodeGenerator):
9388 (JSC::BytecodeGenerator::resolve):
9389 (JSC::BytecodeGenerator::emitResolve):
9390 (JSC::BytecodeGenerator::emitResolveWithBase):
9391 (JSC::BytecodeGenerator::emitResolveWithThis):
9392 (JSC::BytecodeGenerator::emitGetStaticVar):
9393 (JSC::BytecodeGenerator::emitPutStaticVar):
9394 * bytecompiler/BytecodeGenerator.h:
9395 (BytecodeGenerator):
9396 * bytecompiler/NodesCodegen.cpp:
9397 (JSC::FunctionCallResolveNode::emitBytecode):
9398 (JSC::PostfixResolveNode::emitBytecode):
9399 (JSC::PrefixResolveNode::emitBytecode):
9400 (JSC::ReadModifyResolveNode::emitBytecode):
9401 (JSC::AssignResolveNode::emitBytecode):
9402 (JSC::ConstDeclNode::emitCodeSingle):
9403 * dfg/DFGAbstractState.cpp:
9404 (JSC::DFG::AbstractState::execute):
9405 (JSC::DFG::AbstractState::clobberStructures):
9406 * dfg/DFGAbstractState.h:
9407 (AbstractState):
9408 (JSC::DFG::AbstractState::didClobber):
9409 * dfg/DFGByteCodeParser.cpp:
9410 (JSC::DFG::ByteCodeParser::handleInlining):
9411 (JSC::DFG::ByteCodeParser::parseBlock):
9412 * dfg/DFGCCallHelpers.h:
9413 (CCallHelpers):
9414 (JSC::DFG::CCallHelpers::setupArguments):
9415 * dfg/DFGCSEPhase.cpp:
9416 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
9417 (CSEPhase):
9418 (JSC::DFG::CSEPhase::globalVarStoreElimination):
9419 (JSC::DFG::CSEPhase::performNodeCSE):
9420 * dfg/DFGCapabilities.h:
9421 (JSC::DFG::canCompileOpcode):
9422 * dfg/DFGConstantFoldingPhase.cpp:
9423 (JSC::DFG::ConstantFoldingPhase::run):
9424 * dfg/DFGCorrectableJumpPoint.h:
9425 (JSC::DFG::CorrectableJumpPoint::isSet):
9426 (CorrectableJumpPoint):
9427 * dfg/DFGJITCompiler.cpp:
9428 (JSC::DFG::JITCompiler::linkOSRExits):
9429 (JSC::DFG::JITCompiler::link):
9430 * dfg/DFGNode.h:
9431 (JSC::DFG::Node::hasIdentifierNumberForCheck):
9432 (Node):
9433 (JSC::DFG::Node::identifierNumberForCheck):
9434 (JSC::DFG::Node::hasRegisterPointer):
9435 * dfg/DFGNodeType.h:
9436 (DFG):
9437 * dfg/DFGOSRExit.cpp:
9438 (JSC::DFG::OSRExit::OSRExit):
9439 * dfg/DFGOSRExit.h:
9440 (OSRExit):
9441 * dfg/DFGOperations.cpp:
9442 * dfg/DFGOperations.h:
9443 * dfg/DFGPredictionPropagationPhase.cpp:
9444 (JSC::DFG::PredictionPropagationPhase::propagate):
9445 * dfg/DFGSpeculativeJIT.h:
9446 (JSC::DFG::SpeculativeJIT::callOperation):
9447 (JSC::DFG::SpeculativeJIT::appendCall):
9448 (SpeculativeJIT):
9449 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
9450 * dfg/DFGSpeculativeJIT32_64.cpp:
9451 (JSC::DFG::SpeculativeJIT::compile):
9452 * dfg/DFGSpeculativeJIT64.cpp:
9453 (JSC::DFG::SpeculativeJIT::compile):
9454 * jit/JIT.cpp:
9455 (JSC::JIT::privateCompileMainPass):
9456 (JSC::JIT::privateCompileSlowCases):
9457 * jit/JIT.h:
9458 * jit/JITPropertyAccess.cpp:
9459 (JSC::JIT::emit_op_put_global_var_check):
9460 (JSC):
9461 (JSC::JIT::emitSlow_op_put_global_var_check):
9462 * jit/JITPropertyAccess32_64.cpp:
9463 (JSC::JIT::emit_op_put_global_var_check):
9464 (JSC):
9465 (JSC::JIT::emitSlow_op_put_global_var_check):
9466 * jit/JITStubs.cpp:
9467 (JSC::JITThunks::JITThunks):
9468 (JSC::DEFINE_STUB_FUNCTION):
9469 (JSC):
9470 * jit/JITStubs.h:
9471 * llint/LLIntSlowPaths.cpp:
9472 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
9473 (LLInt):
9474 * llint/LLIntSlowPaths.h:
9475 (LLInt):
9476 * llint/LowLevelInterpreter32_64.asm:
9477 * llint/LowLevelInterpreter64.asm:
9478 * runtime/JSObject.cpp:
9479 (JSC::JSObject::removeDirect):
9480 * runtime/JSObject.h:
9481 (JSObject):
9482 * runtime/JSSymbolTableObject.h:
9483 (JSC::symbolTableGet):
9484 (JSC::symbolTablePut):
9485 (JSC::symbolTablePutWithAttributes):
9486 * runtime/SymbolTable.cpp: Added.
9487 (JSC):
9488 (JSC::SymbolTableEntry::copySlow):
9489 (JSC::SymbolTableEntry::freeFatEntrySlow):
9490 (JSC::SymbolTableEntry::couldBeWatched):
9491 (JSC::SymbolTableEntry::attemptToWatch):
9492 (JSC::SymbolTableEntry::addressOfIsWatched):
9493 (JSC::SymbolTableEntry::addWatchpoint):
9494 (JSC::SymbolTableEntry::notifyWriteSlow):
9495 (JSC::SymbolTableEntry::inflateSlow):
9496 * runtime/SymbolTable.h:
9497 (JSC):
9498 (SymbolTableEntry):
9499 (Fast):
9500 (JSC::SymbolTableEntry::Fast::Fast):
9501 (JSC::SymbolTableEntry::Fast::isNull):
9502 (JSC::SymbolTableEntry::Fast::getIndex):
9503 (JSC::SymbolTableEntry::Fast::isReadOnly):
9504 (JSC::SymbolTableEntry::Fast::getAttributes):
9505 (JSC::SymbolTableEntry::Fast::isFat):
9506 (JSC::SymbolTableEntry::SymbolTableEntry):
9507 (JSC::SymbolTableEntry::~SymbolTableEntry):
9508 (JSC::SymbolTableEntry::operator=):
9509 (JSC::SymbolTableEntry::isNull):
9510 (JSC::SymbolTableEntry::getIndex):
9511 (JSC::SymbolTableEntry::getFast):
9512 (JSC::SymbolTableEntry::getAttributes):
9513 (JSC::SymbolTableEntry::isReadOnly):
9514 (JSC::SymbolTableEntry::watchpointSet):
9515 (JSC::SymbolTableEntry::notifyWrite):
9516 (FatEntry):
9517 (JSC::SymbolTableEntry::FatEntry::FatEntry):
9518 (JSC::SymbolTableEntry::isFat):
9519 (JSC::SymbolTableEntry::fatEntry):
9520 (JSC::SymbolTableEntry::inflate):
9521 (JSC::SymbolTableEntry::bits):
9522 (JSC::SymbolTableEntry::freeFatEntry):
9523 (JSC::SymbolTableEntry::pack):
9524 (JSC::SymbolTableEntry::isValidIndex):
9525
95262012-06-12 Filip Pizlo <fpizlo@apple.com>
9527
fpizlo@apple.com3bdd4c92012-06-13 04:56:22 +00009528 Unreviewed build fix for ARMv7 debug builds.
9529
9530 * jit/JITStubs.cpp:
9531 (JSC::JITThunks::JITThunks):
9532
ggaren@apple.com3c89f392012-06-13 02:50:50 +000095332012-06-12 Geoffrey Garen <ggaren@apple.com>
9534
9535 Build fix for case-sensitive file systems: use the right case.
9536
9537 * heap/ListableHandler.h:
9538
ggaren@apple.com639160c2012-06-13 02:06:50 +000095392012-06-11 Geoffrey Garen <ggaren@apple.com>
9540
9541 GC should be 1.7X faster
9542 https://bugs.webkit.org/show_bug.cgi?id=88840
9543
9544 Reviewed by Oliver Hunt.
9545
9546 I profiled, and removed anything that showed up as a concurrency
9547 bottleneck. Then, I added 3 threads to our max thread count, since we
9548 can scale up to more threads now.
9549
9550 * heap/BlockAllocator.cpp:
9551 (JSC::BlockAllocator::BlockAllocator):
9552 (JSC::BlockAllocator::~BlockAllocator):
9553 (JSC::BlockAllocator::releaseFreeBlocks):
9554 (JSC::BlockAllocator::waitForRelativeTimeWhileHoldingLock):
9555 (JSC::BlockAllocator::waitForRelativeTime):
9556 (JSC::BlockAllocator::blockFreeingThreadMain):
9557 * heap/BlockAllocator.h:
9558 (BlockAllocator):
9559 (JSC::BlockAllocator::allocate):
9560 (JSC::BlockAllocator::deallocate): Use a spin lock for the common case
9561 where we're just popping a linked list. (A pthread mutex would sleep our
9562 thread even if the lock were only contended for a microsecond.)
9563
9564 Scope the lock to avoid holding it while allocating VM, since that's a
9565 slow activity and it doesn't modify any of our data structures.
9566
9567 We still use a pthread mutex to handle our condition variable since we
9568 have to, and it's not a hot path.
9569
9570 * heap/CopiedSpace.cpp:
9571 (JSC::CopiedSpace::CopiedSpace):
9572 (JSC::CopiedSpace::doneFillingBlock):
9573 * heap/CopiedSpace.h:
9574 (JSC::CopiedSpace::CopiedSpace): Use a spin lock for the to space lock,
9575 since it just guards linked list and hash table manipulation.
9576
9577 * heap/MarkStack.cpp:
9578 (JSC::MarkStackSegmentAllocator::MarkStackSegmentAllocator):
9579 (JSC::MarkStackSegmentAllocator::allocate):
9580 (JSC::MarkStackSegmentAllocator::release):
9581 (JSC::MarkStackSegmentAllocator::shrinkReserve): Use a spin lock, since
9582 we're just managing a linked list.
9583
9584 (JSC::MarkStackArray::donateSomeCellsTo): Changed donation to be proportional
9585 to our current stack size. This fixes cases where we used to donate too
9586 much. Interestingly, donating too much was starving the donor (when it
9587 ran out of work later) *and* the recipient (since it had to wait on a
9588 long donation operation to complete before it could acquire the lock).
9589
9590 In the worst case, we're still guaranteed to donate N cells in roughly log N time.
9591
9592 This change also fixes cases where we used to donate too little, since
9593 we would always keep a fixed minimum number of cells. In the worst case,
9594 with N marking threads, would could have N large object graph roots in
9595 our stack for the duration of GC, and scale to only 1 thread.
9596
9597 It's an interesting observation that a single object in the mark stack
9598 might represent an arbitrarily large object graph -- and only the act
9599 of marking can find out.
9600
9601 (JSC::MarkStackArray::stealSomeCellsFrom): Steal in proportion to idle
9602 threads. Once again, this fixes cases where constants could cause us
9603 to steal too much or too little.
9604
9605 (JSC::SlotVisitor::donateKnownParallel): Always wake up other threads
9606 if they're idle. We can afford to do this because we're conservative
9607 about when we donate.
9608
9609 (JSC::SlotVisitor::drainFromShared):
9610 * heap/MarkStack.h:
9611 (MarkStackSegmentAllocator):
9612 (MarkStackArray):
9613 (JSC):
9614 * heap/SlotVisitor.h: Merged the "should I donate?" decision into a
9615 single function, for simplicity.
9616
9617 * runtime/Options.cpp:
9618 (minimumNumberOfScansBetweenRebalance): Reduced the delay before donation
9619 a lot. We can afford to do this because, in the common case, donation is
9620 a single branch that decides not to donate.
9621
9622 (cpusToUse): Use more CPUs now, since we scale better now.
9623
9624 * runtime/Options.h:
9625 (Options): Removed now-unused variables.
9626
fpizlo@apple.com53ef1042012-06-13 01:29:07 +000096272012-06-12 Filip Pizlo <fpizlo@apple.com>
9628
9629 REGRESSION(120121): inspector tests crash in DFG
9630 https://bugs.webkit.org/show_bug.cgi?id=88941
9631
9632 Reviewed by Geoffrey Garen.
9633
9634 The CFG simplifier has two different ways of fixing up GetLocal, Phantom, and Flush. If we've
9635 already fixed up the node one way, we shouldn't try the other way. The reason why we shouldn't
9636 is that the second way depends on the node referring to other nodes in the to-be-jettisoned
9637 block. After fixup they potentially will refer to nodes in the block being merged to.
9638
9639 * dfg/DFGCFGSimplificationPhase.cpp:
9640 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
9641 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
9642
leo.yang@torchmobile.com.cneac79cd2012-06-13 00:23:49 +000096432012-06-12 Leo Yang <leo.yang@torchmobile.com.cn>
9644
9645 Dynamic hash table in DOMObjectHashTableMap is wrong in multiple threads
9646 https://bugs.webkit.org/show_bug.cgi?id=87334
9647
9648 Reviewed by Geoffrey Garen.
9649
9650 Add a copy member function to JSC::HasTable. This function will copy all data
9651 members except for *table* which contains thread specific data that prevents
9652 up copying it. When you want to copy a JSC::HashTable that was constructed
9653 on another thread you should call JSC::HashTable::copy().
9654
9655 * runtime/Lookup.h:
9656 (JSC::HashTable::copy):
9657 (HashTable):
9658
fpizlo@apple.comdfd92802012-06-12 21:15:43 +000096592012-06-12 Filip Pizlo <fpizlo@apple.com>
9660
fpizlo@apple.com888325a2012-06-12 23:16:51 +00009661 DFG should not ASSERT if you have a double use of a variable that is not revealed to be a double
9662 until after CFG simplification
9663 https://bugs.webkit.org/show_bug.cgi?id=88927
9664 <rdar://problem/11513971>
9665
9666 Reviewed by Geoffrey Garen.
9667
9668 Speculation fixup needs to run if simplification did things, because simplification can change
9669 predictions - particularly if you had a control flow path that stored weird things into a
9670 variable, but that path got axed by the simplifier.
9671
9672 Running fixup in the fixpoint requires making it idempotent, which it previously wasn't. Only
9673 one place needed to be changed, namely the un-MustGenerate-ion of ValueToInt32.
9674
9675 * dfg/DFGDriver.cpp:
9676 (JSC::DFG::compile):
9677 * dfg/DFGFixupPhase.cpp:
9678 (JSC::DFG::FixupPhase::fixupNode):
9679
96802012-06-12 Filip Pizlo <fpizlo@apple.com>
9681
fpizlo@apple.comdfd92802012-06-12 21:15:43 +00009682 REGRESSION (r119779): Javascript TypeError: 'undefined' is not an object
9683 https://bugs.webkit.org/show_bug.cgi?id=88783
9684 <rdar://problem/11640299>
9685
9686 Reviewed by Geoffrey Garen.
9687
9688 If you don't keep alive the base of an object access over the various checks
9689 you do for the prototype chain, you're going to have a bad time.
9690
9691 * dfg/DFGByteCodeParser.cpp:
9692 (JSC::DFG::ByteCodeParser::handleGetById):
9693
commit-queue@webkit.orgce7e7ef2012-06-12 07:08:14 +000096942012-06-12 Hojong Han <hojong.han@samsung.com>
9695
9696 Property names of the built-in object cannot be retrieved
9697 after trying to delete one of its properties
9698 https://bugs.webkit.org/show_bug.cgi?id=86461
9699
9700 Reviewed by Gavin Barraclough.
9701
9702 * runtime/JSObject.cpp:
9703 (JSC::getClassPropertyNames):
9704 (JSC::JSObject::getOwnPropertyNames):
9705
gyuyoung.kim@samsung.com7a201592012-06-12 00:58:24 +000097062012-06-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
9707
9708 [CMAKE][EFL] Remove duplicated executable output path
9709 https://bugs.webkit.org/show_bug.cgi?id=88765
9710
9711 Reviewed by Daniel Bates.
9712
9713 CMake files for EFL port have redefined executable output path. However, EFL port doesn't
9714 need to define again because it is already defined in top-level CMake file.
9715
9716 * shell/CMakeLists.txt:
9717
carlosgc@webkit.orgf4fbe002012-06-11 15:31:19 +000097182012-06-11 Carlos Garcia Campos <cgarcia@igalia.com>
9719
9720 Unreviewed. Fix make distcheck issues.
9721
9722 * GNUmakefile.list.am: Remove non existent header file.
9723
paroga@webkit.org7a01e282012-06-10 12:25:57 +000097242012-06-10 Patrick Gansterer <paroga@webkit.org>
9725
paroga@webkit.orga601a8b2012-06-10 12:49:32 +00009726 Unreviewed. Build fix for !ENABLE(JIT) after r119844 and r119925.
9727
9728 * runtime/Executable.h:
9729 (ExecutableBase):
9730 (JSC::ExecutableBase::clearCodeVirtual):
9731
97322012-06-10 Patrick Gansterer <paroga@webkit.org>
9733
paroga@webkit.org7a01e282012-06-10 12:25:57 +00009734 Unreviewed. Build fix for !ENABLE(JIT) after r119844.
9735
9736 * runtime/Executable.h:
9737 (ExecutableBase):
9738 (JSC):
9739
dominicc@chromium.org2a95e332012-06-10 06:31:14 +000097402012-06-09 Dominic Cooney <dominicc@chromium.org>
9741
9742 [Chromium] Remove JavaScriptCore dependencies from gyp
9743 https://bugs.webkit.org/show_bug.cgi?id=88510
9744
9745 Reviewed by Adam Barth.
9746
9747 Chromium doesn't support JSC any more and there doesn't seem to be
9748 a strong interest in using GYP as the common build system in other
9749 ports.
9750
9751 * JavaScriptCore.gyp/JavaScriptCore.gyp: WebCore still depends on YARR interpreter.
9752 * JavaScriptCore.gypi: Only include YARR source.
9753 * gyp/JavaScriptCore.gyp: Removed.
9754 * gyp/gtk.gyp: Removed.
9755
ggaren@apple.com642da3e2012-06-09 17:34:30 +000097562012-06-09 Geoffrey Garen <ggaren@apple.com>
9757
9758 Unreviewed, rolling back in part2 of r118646.
9759
9760 This patch removes eager finalization.
9761
9762 Weak pointer finalization should be lazy
9763 https://bugs.webkit.org/show_bug.cgi?id=87599
9764
9765 Reviewed by Sam Weinig.
9766
9767 * heap/Heap.cpp:
9768 (JSC::Heap::collect): Don't finalize eagerly -- we'll do it lazily.
9769
9770 * heap/MarkedBlock.cpp:
9771 (JSC::MarkedBlock::sweep): Do sweep weak sets when sweeping a block,
9772 since we won't get another chance.
9773
9774 * heap/MarkedBlock.h:
9775 (JSC::MarkedBlock::sweepWeakSet):
9776 * heap/MarkedSpace.cpp:
9777 (MarkedSpace::WeakSetSweep):
9778 * heap/MarkedSpace.h:
9779 (JSC::MarkedSpace::sweepWeakSets): Removed now-unused code.
9780
commit-queue@webkit.org5deb7492012-06-09 09:05:22 +000097812012-06-09 Sukolsak Sakshuwong <sukolsak@google.com>
9782
9783 Add UNDO_MANAGER flag
9784 https://bugs.webkit.org/show_bug.cgi?id=87908
9785
9786 Reviewed by Tony Chang.
9787
9788 * Configurations/FeatureDefines.xcconfig:
9789
ggaren@apple.com642da3e2012-06-09 17:34:30 +000097902012-06-08 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com218a16a2012-06-08 23:57:58 +00009791
9792 Unreviewed, rolling back in part1 of r118646.
9793
9794 This patch includes everything necessary for lazy finalization, but
9795 keeps eager finalization enabled for the time being.
9796
9797 Weak pointer finalization should be lazy
9798 https://bugs.webkit.org/show_bug.cgi?id=87599
9799
9800 Reviewed by Sam Weinig.
9801
9802 * heap/MarkedBlock.cpp:
9803 * heap/MarkedBlock.h:
9804 (JSC::MarkedBlock::resetAllocator):
9805 * heap/MarkedSpace.cpp:
9806 (JSC::MarkedSpace::resetAllocators):
9807 * heap/MarkedSpace.h:
9808 (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
9809 It will happen automatically when a weak set is swept. It's simpler to
9810 have only one canonical way for this to happen, and it wasn't buying
9811 us anything to do it eagerly.
9812 * heap/WeakBlock.cpp:
9813 (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
9814 the sweep would be a no-op. If even one finalizer is pending, we need to
9815 run it, since we won't get another chance.
9816 * heap/WeakSet.cpp:
9817 (JSC::WeakSet::sweep): This loop can be simpler now that
9818 WeakBlock::sweep() does what we mean.
9819 Reset our allocator after a sweep because this is the optimal time to
9820 start trying to recycle old weak pointers.
9821 (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
9822 allocator because we've swept already, and forcing a new sweep would be
9823 wasteful.
9824 * heap/WeakSet.h:
9825 (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
9826 because the shrink may have removed the block the allocator was going to
9827 allocate out of.
9828
barraclough@apple.com9dd771c2012-06-08 21:30:35 +000098292012-06-08 Gavin Barraclough <barraclough@apple.com>
9830
9831 Unreviewed roll out r119795.
9832
9833 This broke jquery/core.html
9834
9835 * dfg/DFGSpeculativeJIT.h:
9836 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
9837 * jit/JITInlineMethods.h:
9838 (JSC::JIT::emitAllocateBasicJSObject):
9839 * llint/LowLevelInterpreter.asm:
9840 * runtime/JSGlobalData.h:
9841 (JSGlobalData):
9842 * runtime/JSGlobalThis.cpp:
9843 (JSC::JSGlobalThis::setUnwrappedObject):
9844 * runtime/JSObject.cpp:
9845 (JSC::JSObject::visitChildren):
9846 (JSC::JSObject::createInheritorID):
9847 * runtime/JSObject.h:
9848 (JSObject):
9849 (JSC::JSObject::resetInheritorID):
9850 (JSC):
9851 (JSC::JSObject::offsetOfInheritorID):
9852 (JSC::JSObject::inheritorID):
9853
fpizlo@apple.com0bcbc112012-06-08 20:02:57 +000098542012-06-08 Filip Pizlo <fpizlo@apple.com>
9855
9856 PredictedType should be called SpeculatedType
9857 https://bugs.webkit.org/show_bug.cgi?id=88477
9858
9859 Unreviewed, fix a renaming goof from http://trac.webkit.org/changeset/119660.
9860 I accidentally renamed ByteCodeParser::getPrediction to
9861 ByteCodeParser::getSpeculation. That was not the intent. This changes it
9862 back.
9863
9864 * dfg/DFGByteCodeParser.cpp:
9865 (JSC::DFG::ByteCodeParser::addCall):
9866 (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
9867 (JSC::DFG::ByteCodeParser::getPrediction):
9868 (JSC::DFG::ByteCodeParser::handleCall):
9869 (JSC::DFG::ByteCodeParser::parseBlock):
9870
wingo@igalia.com332e9bf2012-06-08 19:57:40 +000098712012-06-08 Andy Wingo <wingo@igalia.com>
9872
9873 Explictly mark stubs called by JIT as being internal
9874 https://bugs.webkit.org/show_bug.cgi?id=88552
9875
9876 Reviewed by Filip Pizlo.
9877
9878 * dfg/DFGOSRExitCompiler.h:
9879 * dfg/DFGOperations.cpp:
9880 * dfg/DFGOperations.h:
9881 * jit/HostCallReturnValue.h:
9882 * jit/JITStubs.cpp:
9883 * jit/JITStubs.h:
9884 * jit/ThunkGenerators.cpp:
9885 * llint/LLIntSlowPaths.h: Mark a bunch of stubs as being
9886 WTF_INTERNAL. Change most calls to SYMBOL_STRING_RELOCATION to
9887 LOCAL_REFERENCE, or GLOBAL_REFERENCE in the case of the wrappers
9888 to truly global symbols.
9889 * offlineasm/asm.rb: Generate LOCAL_REFERENCE instead of
9890 SYMBOL_STRING_RELOCATION.
9891
fpizlo@apple.comf4a2ac32012-06-08 20:04:47 +000098922012-06-08 Geoffrey Garen <ggaren@apple.com>
9893
ggaren@apple.comd7147572012-06-08 18:17:16 +00009894 Don't rely on weak pointers for eager CodeBlock finalization
9895 https://bugs.webkit.org/show_bug.cgi?id=88465
9896
9897 Reviewed by Gavin Barraclough.
9898
9899 This is incompatible with lazy weak pointer finalization.
9900
9901 I considered just making CodeBlock finalization lazy-friendly, but it
9902 turns out that the heap is already way up in CodeBlock's business when
9903 it comes to finalization, so I decided to finish the job and move full
9904 responsibility for CodeBlock finalization into the heap.
9905
9906 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Maybe this
9907 will build.
9908
9909 * debugger/Debugger.cpp: Updated for rename.
9910
9911 * heap/Heap.cpp:
9912 (JSC::Heap::deleteAllCompiledCode): Renamed for consistency. Fixed a bug
9913 where we would not delete code for a code block that had been previously
9914 jettisoned. I don't know if this happens in practice -- I mostly did
9915 this to improve consistency with deleteUnmarkedCompiledCode.
9916
9917 (JSC::Heap::deleteUnmarkedCompiledCode): New function, responsible for
9918 eager finalization of unmarked code blocks.
9919
9920 (JSC::Heap::collect): Updated for rename. Updated to call
9921 deleteUnmarkedCompiledCode(), which takes care of jettisoned DFG code
9922 blocks too.
9923
9924 (JSC::Heap::addCompiledCode): Renamed, since this points to all code
9925 now, not just functions.
9926
9927 * heap/Heap.h:
9928 (Heap): Keep track of all user code, not just functions. This is a
9929 negligible additional overhead, since most code is function code.
9930
9931 * runtime/Executable.cpp:
9932 (JSC::*::finalize): Removed these functions, since we don't rely on
9933 weak pointer finalization anymore.
9934
9935 (JSC::FunctionExecutable::FunctionExecutable): Moved linked-list stuff
9936 into base class so all executables can be in the list.
9937
9938 (JSC::EvalExecutable::clearCode):
9939 (JSC::ProgramExecutable::clearCode):
9940 (JSC::FunctionExecutable::clearCode): All we need to do is delete our
9941 CodeBlock -- that will delete all of its internal data structures.
9942
9943 (JSC::FunctionExecutable::clearCodeIfNotCompiling): Factored out a helper
9944 function to improve clarity.
9945
9946 * runtime/Executable.h:
9947 (JSC::ExecutableBase): Moved linked-list stuff
9948 into base class so all executables can be in the list.
9949
9950 (JSC::NativeExecutable::create):
9951 (NativeExecutable):
9952 (ScriptExecutable):
9953 (JSC::ScriptExecutable::finishCreation):
9954 (JSC::EvalExecutable::create):
9955 (EvalExecutable):
9956 (JSC::ProgramExecutable::create):
9957 (ProgramExecutable):
9958 (FunctionExecutable):
9959 (JSC::FunctionExecutable::create): Don't use a finalizer -- the heap
9960 will call us back to destroy our code block.
9961
9962 (JSC::FunctionExecutable::discardCode): Renamed to clearCodeIfNotCompiling()
9963 for clarity.
9964
9965 (JSC::FunctionExecutable::isCompiling): New helper function, for clarity.
9966
9967 (JSC::ScriptExecutable::clearCodeVirtual): New helper function, since
9968 the heap needs to make polymorphic calls to clear code.
9969
9970 * runtime/JSGlobalData.cpp:
9971 (JSC::StackPreservingRecompiler::operator()):
9972 * runtime/JSGlobalObject.cpp:
9973 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
9974 renames.
9975
fpizlo@apple.comfd598b92012-06-08 01:31:21 +000099762012-06-07 Filip Pizlo <fpizlo@apple.com>
9977
9978 DFG should inline prototype chain accesses, and do the right things if the
9979 specific function optimization is available
9980 https://bugs.webkit.org/show_bug.cgi?id=88594
9981
9982 Reviewed by Gavin Barraclough.
9983
9984 Looks like a 3% win on V8.
9985
9986 * bytecode/CodeBlock.h:
9987 (JSC::Structure::prototypeForLookup):
9988 (JSC):
9989 * bytecode/GetByIdStatus.cpp:
9990 (JSC::GetByIdStatus::computeFromLLInt):
9991 (JSC):
9992 (JSC::GetByIdStatus::computeForChain):
9993 (JSC::GetByIdStatus::computeFor):
9994 * bytecode/GetByIdStatus.h:
9995 (JSC::GetByIdStatus::GetByIdStatus):
9996 (JSC::GetByIdStatus::isSimple):
9997 (JSC::GetByIdStatus::chain):
9998 (JSC::GetByIdStatus::specificValue):
9999 (GetByIdStatus):
10000 * bytecode/StructureSet.h:
10001 (StructureSet):
10002 (JSC::StructureSet::singletonStructure):
10003 * bytecode/StructureStubInfo.h:
10004 (JSC::StructureStubInfo::initGetByIdProto):
10005 (JSC::StructureStubInfo::initGetByIdChain):
10006 * dfg/DFGByteCodeParser.cpp:
10007 (JSC::DFG::ByteCodeParser::handleGetById):
10008 * dfg/DFGRepatch.cpp:
10009 (JSC::DFG::tryCacheGetByID):
10010 * jit/JITStubs.cpp:
10011 (JSC::JITThunks::tryCacheGetByID):
10012 * runtime/JSGlobalObject.h:
10013 (JSC::Structure::prototypeForLookup):
10014 (JSC):
10015 * runtime/Structure.h:
10016 (Structure):
10017
barraclough@apple.com48386932012-06-08 00:29:27 +0000100182012-06-07 Gavin Barraclough <barraclough@apple.com>
10019
barraclough@apple.com64b74e02012-06-08 04:25:58 +000010020 Remove JSObject::m_inheritorID
10021 https://bugs.webkit.org/show_bug.cgi?id=88378
10022
10023 Reviewed by Geoff Garen.
10024
10025 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
10026 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
10027 Instead use a private named value in the object's property storage.
10028
10029 * dfg/DFGSpeculativeJIT.h:
10030 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
10031 - No need m_inheritorID to initialize!
10032 * jit/JITInlineMethods.h:
10033 (JSC::JIT::emitAllocateBasicJSObject):
10034 - No need m_inheritorID to initialize!
10035 * llint/LowLevelInterpreter.asm:
10036 - No need m_inheritorID to initialize!
10037 * runtime/JSGlobalData.h:
10038 (JSGlobalData):
10039 - Added private name 'm_inheritorIDKey'.
10040 * runtime/JSGlobalThis.cpp:
10041 (JSC::JSGlobalThis::setUnwrappedObject):
10042 - resetInheritorID is now passed a JSGlobalData&.
10043 * runtime/JSObject.cpp:
10044 (JSC::JSObject::visitChildren):
10045 - No m_inheritorID to be marked.
10046 (JSC::JSObject::createInheritorID):
10047 - Store the newly created inheritorID in the property map.
10048 * runtime/JSObject.h:
10049 (JSC::JSObject::resetInheritorID):
10050 - Remove the inheritorID from property storage.
10051 (JSC::JSObject::inheritorID):
10052 - Read the inheritorID from property storage.
10053
100542012-06-07 Gavin Barraclough <barraclough@apple.com>
10055
barraclough@apple.com48386932012-06-08 00:29:27 +000010056 Math.pow on iOS does not support denormal numbers.
10057 https://bugs.webkit.org/show_bug.cgi?id=88592
10058
10059 Reviewed by Filip Pizlo.
10060
10061 Import an implementation from fdlibm, detect cases where it is safe to use the system
10062 implementation & where we should fall back to fdlibm.
10063
10064 * runtime/MathObject.cpp:
10065 (JSC::isDenormal):
10066 (JSC::isEdgeCase):
10067 (JSC::mathPow):
10068 - On iOS, detect cases where denormal support may be required & use fdlibm in these cases.
10069 (JSC::mathProtoFuncPow):
10070 - Changed to use mathPow.
10071 (JSC::fdlibmScalbn):
10072 (JSC::fdlibmPow):
10073 - These functions imported from fdlibm; original style retained to ease future merging.
10074
paroga@webkit.orga334f732012-06-07 23:24:14 +0000100752012-06-07 Patrick Gansterer <paroga@webkit.org>
10076
10077 Unreviewed. Build fix for !ENABLE(JIT) after r119441.
10078
10079 * interpreter/Interpreter.cpp:
10080 (JSC::Interpreter::privateExecute):
10081
wingo@igalia.comb8305a82012-06-07 16:05:19 +0000100822012-06-07 Andy Wingo <wingo@igalia.com>
10083
10084 Unreviewed build fix after r119593.
10085
10086 * llint/LLIntOfflineAsmConfig.h (OFFLINE_ASM_GLOBAL_LABEL): Fix
10087 uses of "name" to be "label", the macro's parameter. Otherwise we
10088 serialize mentions of the literal symbol "name" into the objcode.
10089 Causes a build error using GNU ld (not gold).
10090
rniwa@webkit.org475cf8d2012-06-07 02:47:14 +0000100912012-06-06 Ryosuke Niwa <rniwa@webkit.org>
10092
10093 Chromium build fix attempt. Why do we need to list these files in gyp!?
10094
10095 * JavaScriptCore.gypi:
10096
fpizlo@apple.comd5547492012-06-07 00:23:36 +0000100972012-06-06 Filip Pizlo <fpizlo@apple.com>
10098
fpizlo@apple.com62336162012-06-07 01:35:59 +000010099 PredictedType should be called SpeculatedType
10100 https://bugs.webkit.org/show_bug.cgi?id=88477
10101
10102 Rubber stamped by Gavin Barraclough.
10103
10104 * CMakeLists.txt:
10105 * GNUmakefile.list.am:
10106 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10107 * JavaScriptCore.xcodeproj/project.pbxproj:
10108 * Target.pri:
10109 * bytecode/CodeBlock.cpp:
10110 (JSC::CodeBlock::shouldOptimizeNow):
10111 (JSC::CodeBlock::dumpValueProfiles):
10112 * bytecode/CodeBlock.h:
10113 (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
10114 * bytecode/LazyOperandValueProfile.cpp:
10115 (JSC::LazyOperandValueProfileParser::prediction):
10116 * bytecode/LazyOperandValueProfile.h:
10117 (LazyOperandValueProfileParser):
10118 * bytecode/PredictedType.cpp: Removed.
10119 * bytecode/PredictedType.h: Removed.
10120 * bytecode/SpeculatedType.cpp: Copied from Source/JavaScriptCore/bytecode/PredictedType.cpp.
10121 (JSC::speculationToString):
10122 (JSC::speculationToAbbreviatedString):
10123 (JSC::speculationFromClassInfo):
10124 (JSC::speculationFromStructure):
10125 (JSC::speculationFromCell):
10126 (JSC::speculationFromValue):
10127 * bytecode/SpeculatedType.h: Copied from Source/JavaScriptCore/bytecode/PredictedType.h.
10128 (JSC):
10129 (JSC::isAnySpeculation):
10130 (JSC::isCellSpeculation):
10131 (JSC::isObjectSpeculation):
10132 (JSC::isFinalObjectSpeculation):
10133 (JSC::isFinalObjectOrOtherSpeculation):
10134 (JSC::isFixedIndexedStorageObjectSpeculation):
10135 (JSC::isStringSpeculation):
10136 (JSC::isArraySpeculation):
10137 (JSC::isFunctionSpeculation):
10138 (JSC::isInt8ArraySpeculation):
10139 (JSC::isInt16ArraySpeculation):
10140 (JSC::isInt32ArraySpeculation):
10141 (JSC::isUint8ArraySpeculation):
10142 (JSC::isUint8ClampedArraySpeculation):
10143 (JSC::isUint16ArraySpeculation):
10144 (JSC::isUint32ArraySpeculation):
10145 (JSC::isFloat32ArraySpeculation):
10146 (JSC::isFloat64ArraySpeculation):
10147 (JSC::isArgumentsSpeculation):
10148 (JSC::isActionableIntMutableArraySpeculation):
10149 (JSC::isActionableFloatMutableArraySpeculation):
10150 (JSC::isActionableTypedMutableArraySpeculation):
10151 (JSC::isActionableMutableArraySpeculation):
10152 (JSC::isActionableArraySpeculation):
10153 (JSC::isArrayOrOtherSpeculation):
10154 (JSC::isMyArgumentsSpeculation):
10155 (JSC::isInt32Speculation):
10156 (JSC::isDoubleRealSpeculation):
10157 (JSC::isDoubleSpeculation):
10158 (JSC::isNumberSpeculation):
10159 (JSC::isBooleanSpeculation):
10160 (JSC::isOtherSpeculation):
10161 (JSC::isEmptySpeculation):
10162 (JSC::mergeSpeculations):
10163 (JSC::mergeSpeculation):
10164 * bytecode/StructureSet.h:
10165 (JSC::StructureSet::speculationFromStructures):
10166 * bytecode/ValueProfile.h:
10167 (JSC::ValueProfileBase::ValueProfileBase):
10168 (JSC::ValueProfileBase::dump):
10169 (JSC::ValueProfileBase::computeUpdatedPrediction):
10170 (ValueProfileBase):
10171 * dfg/DFGAbstractState.cpp:
10172 (JSC::DFG::AbstractState::initialize):
10173 (JSC::DFG::AbstractState::execute):
10174 (JSC::DFG::AbstractState::mergeStateAtTail):
10175 * dfg/DFGAbstractState.h:
10176 (JSC::DFG::AbstractState::speculateInt32Unary):
10177 (JSC::DFG::AbstractState::speculateNumberUnary):
10178 (JSC::DFG::AbstractState::speculateBooleanUnary):
10179 (JSC::DFG::AbstractState::speculateInt32Binary):
10180 (JSC::DFG::AbstractState::speculateNumberBinary):
10181 * dfg/DFGAbstractValue.h:
10182 (JSC::DFG::StructureAbstractValue::filter):
10183 (JSC::DFG::StructureAbstractValue::speculationFromStructures):
10184 (JSC::DFG::AbstractValue::AbstractValue):
10185 (JSC::DFG::AbstractValue::clear):
10186 (JSC::DFG::AbstractValue::isClear):
10187 (JSC::DFG::AbstractValue::makeTop):
10188 (JSC::DFG::AbstractValue::clobberStructures):
10189 (JSC::DFG::AbstractValue::isTop):
10190 (JSC::DFG::AbstractValue::set):
10191 (JSC::DFG::AbstractValue::merge):
10192 (JSC::DFG::AbstractValue::filter):
10193 (JSC::DFG::AbstractValue::validateIgnoringValue):
10194 (JSC::DFG::AbstractValue::validate):
10195 (JSC::DFG::AbstractValue::checkConsistency):
10196 (JSC::DFG::AbstractValue::dump):
10197 (AbstractValue):
10198 * dfg/DFGArgumentPosition.h:
10199 (JSC::DFG::ArgumentPosition::ArgumentPosition):
10200 (JSC::DFG::ArgumentPosition::mergeArgumentAwareness):
10201 (JSC::DFG::ArgumentPosition::prediction):
10202 (ArgumentPosition):
10203 * dfg/DFGArgumentsSimplificationPhase.cpp:
10204 (JSC::DFG::ArgumentsSimplificationPhase::run):
10205 * dfg/DFGByteCodeParser.cpp:
10206 (ByteCodeParser):
10207 (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation):
10208 (JSC::DFG::ByteCodeParser::getLocal):
10209 (JSC::DFG::ByteCodeParser::getArgument):
10210 (JSC::DFG::ByteCodeParser::addCall):
10211 (JSC::DFG::ByteCodeParser::getSpeculationWithoutOSRExit):
10212 (JSC::DFG::ByteCodeParser::getSpeculation):
10213 (InlineStackEntry):
10214 (JSC::DFG::ByteCodeParser::handleCall):
10215 (JSC::DFG::ByteCodeParser::handleIntrinsic):
10216 (JSC::DFG::ByteCodeParser::handleGetById):
10217 (JSC::DFG::ByteCodeParser::parseBlock):
10218 (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
10219 (JSC::DFG::ByteCodeParser::parse):
10220 * dfg/DFGCSEPhase.cpp:
10221 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
10222 (JSC::DFG::CSEPhase::performNodeCSE):
10223 * dfg/DFGConstantFoldingPhase.cpp:
10224 (JSC::DFG::ConstantFoldingPhase::run):
10225 * dfg/DFGFixupPhase.cpp:
10226 (JSC::DFG::FixupPhase::fixupNode):
10227 (JSC::DFG::FixupPhase::fixDoubleEdge):
10228 * dfg/DFGGraph.cpp:
10229 (JSC::DFG::Graph::nameOfVariableAccessData):
10230 (JSC::DFG::Graph::dump):
10231 (JSC::DFG::Graph::predictArgumentTypes):
10232 * dfg/DFGGraph.h:
10233 (JSC::DFG::Graph::getJSConstantSpeculation):
10234 (JSC::DFG::Graph::isPredictedNumerical):
10235 (JSC::DFG::Graph::byValIsPure):
10236 * dfg/DFGJITCompiler.h:
10237 (JSC::DFG::JITCompiler::getSpeculation):
10238 * dfg/DFGNode.h:
10239 (JSC::DFG::Node::Node):
10240 (JSC::DFG::Node::getHeapPrediction):
10241 (JSC::DFG::Node::predictHeap):
10242 (JSC::DFG::Node::prediction):
10243 (JSC::DFG::Node::predict):
10244 (JSC::DFG::Node::shouldSpeculateInteger):
10245 (JSC::DFG::Node::shouldSpeculateDouble):
10246 (JSC::DFG::Node::shouldSpeculateNumber):
10247 (JSC::DFG::Node::shouldSpeculateBoolean):
10248 (JSC::DFG::Node::shouldSpeculateFinalObject):
10249 (JSC::DFG::Node::shouldSpeculateFinalObjectOrOther):
10250 (JSC::DFG::Node::shouldSpeculateArray):
10251 (JSC::DFG::Node::shouldSpeculateArguments):
10252 (JSC::DFG::Node::shouldSpeculateInt8Array):
10253 (JSC::DFG::Node::shouldSpeculateInt16Array):
10254 (JSC::DFG::Node::shouldSpeculateInt32Array):
10255 (JSC::DFG::Node::shouldSpeculateUint8Array):
10256 (JSC::DFG::Node::shouldSpeculateUint8ClampedArray):
10257 (JSC::DFG::Node::shouldSpeculateUint16Array):
10258 (JSC::DFG::Node::shouldSpeculateUint32Array):
10259 (JSC::DFG::Node::shouldSpeculateFloat32Array):
10260 (JSC::DFG::Node::shouldSpeculateFloat64Array):
10261 (JSC::DFG::Node::shouldSpeculateArrayOrOther):
10262 (JSC::DFG::Node::shouldSpeculateObject):
10263 (JSC::DFG::Node::shouldSpeculateCell):
10264 (Node):
10265 * dfg/DFGPredictionPropagationPhase.cpp:
10266 (JSC::DFG::PredictionPropagationPhase::setPrediction):
10267 (JSC::DFG::PredictionPropagationPhase::mergePrediction):
10268 (JSC::DFG::PredictionPropagationPhase::propagate):
10269 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
10270 * dfg/DFGSpeculativeJIT.cpp:
10271 (JSC::DFG::SpeculativeJIT::fillStorage):
10272 (JSC::DFG::SpeculativeJIT::writeBarrier):
10273 (JSC::DFG::GPRTemporary::GPRTemporary):
10274 (JSC::DFG::FPRTemporary::FPRTemporary):
10275 (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
10276 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
10277 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
10278 (JSC::DFG::SpeculativeJIT::compile):
10279 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
10280 (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt):
10281 (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
10282 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
10283 (JSC::DFG::SpeculativeJIT::compileDoubleAsInt32):
10284 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
10285 (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
10286 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
10287 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
10288 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
10289 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
10290 (JSC::DFG::SpeculativeJIT::compileInstanceOf):
10291 (JSC::DFG::SpeculativeJIT::compileAdd):
10292 (JSC::DFG::SpeculativeJIT::compileArithSub):
10293 (JSC::DFG::SpeculativeJIT::compileArithNegate):
10294 (JSC::DFG::SpeculativeJIT::compileArithMul):
10295 (JSC::DFG::SpeculativeJIT::compileArithMod):
10296 (JSC::DFG::SpeculativeJIT::compare):
10297 (JSC::DFG::SpeculativeJIT::compileStrictEq):
10298 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
10299 (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
10300 (JSC::DFG::SpeculativeJIT::compileGetArgumentsLength):
10301 (JSC::DFG::SpeculativeJIT::compileRegExpExec):
10302 * dfg/DFGSpeculativeJIT.h:
10303 (DFG):
10304 (JSC::DFG::ValueSource::forSpeculation):
10305 (SpeculativeJIT):
10306 (GPRTemporary):
10307 (FPRTemporary):
10308 (JSC::DFG::SpecDoubleOperand::SpecDoubleOperand):
10309 (JSC::DFG::SpecDoubleOperand::~SpecDoubleOperand):
10310 (JSC::DFG::SpecDoubleOperand::fpr):
10311 (JSC::DFG::SpecCellOperand::SpecCellOperand):
10312 (JSC::DFG::SpecCellOperand::~SpecCellOperand):
10313 (JSC::DFG::SpecCellOperand::gpr):
10314 (JSC::DFG::SpecBooleanOperand::SpecBooleanOperand):
10315 (JSC::DFG::SpecBooleanOperand::~SpecBooleanOperand):
10316 (JSC::DFG::SpecBooleanOperand::gpr):
10317 * dfg/DFGSpeculativeJIT32_64.cpp:
10318 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
10319 (JSC::DFG::SpeculativeJIT::fillSpecDouble):
10320 (JSC::DFG::SpeculativeJIT::fillSpecCell):
10321 (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
10322 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
10323 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
10324 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
10325 (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
10326 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
10327 (JSC::DFG::SpeculativeJIT::emitBranch):
10328 (JSC::DFG::SpeculativeJIT::compile):
10329 * dfg/DFGSpeculativeJIT64.cpp:
10330 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
10331 (JSC::DFG::SpeculativeJIT::fillSpecDouble):
10332 (JSC::DFG::SpeculativeJIT::fillSpecCell):
10333 (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
10334 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
10335 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
10336 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
10337 (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
10338 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
10339 (JSC::DFG::SpeculativeJIT::emitBranch):
10340 (JSC::DFG::SpeculativeJIT::compile):
10341 * dfg/DFGVariableAccessData.h:
10342 (JSC::DFG::VariableAccessData::VariableAccessData):
10343 (JSC::DFG::VariableAccessData::predict):
10344 (JSC::DFG::VariableAccessData::nonUnifiedPrediction):
10345 (JSC::DFG::VariableAccessData::prediction):
10346 (JSC::DFG::VariableAccessData::argumentAwarePrediction):
10347 (JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction):
10348 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
10349 (JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
10350 (VariableAccessData):
10351
103522012-06-06 Filip Pizlo <fpizlo@apple.com>
10353
fpizlo@apple.com26af9b62012-06-07 00:49:34 +000010354 Global object variable accesses should not require an extra load
10355 https://bugs.webkit.org/show_bug.cgi?id=88385
10356
10357 Reviewed by Gavin Barraclough and Geoffrey Garen.
10358
10359 Previously, if you wanted to access a global variable, you'd first have
10360 to load the register array from the appropriate global object and then
10361 either load or store at an offset to the register array. This is because
10362 JSGlobalObject inherited from JSVariableObject, and JSVariableObject is
10363 designed with the pessimistic assumption that its register array may
10364 point into the call stack. This is never the case for global objects.
10365 Hence, even though the global object may add more registers at any time,
10366 it does not need to store them in a contiguous array. It can use a
10367 SegmentedVector or similar.
10368
10369 This patch refactors global objects and variable objects as follows:
10370
10371 - The functionality to track variables in an indexable array using a
10372 SymbolTable to map names to indices is moved into JSSymbolTableObject,
10373 which is now a supertype of JSVariableObject. JSVariableObject is now
10374 just a holder for a registers array and implements the registerAt()
10375 method that is left abstract in JSSymbolTableObject. Because all users
10376 of JSVariableObject know whether they are a JSStaticScopeObject,
10377 JSActivation, or JSGlobalObject, this "abstract" method is not virtual;
10378 instead the utility methods that would call registerAt() are now
10379 template functions that require you to know statically what subtype of
10380 JSSymbolTableObject you're using (JSVariableObject or something else),
10381 so that registerAt() can be statically bound.
10382
10383 - A new class is added called JSSegmentedVariableObject, which only
10384 differs from JSVariableObject in how it allocates registers. It uses a
10385 SegmentedVector instead of manually managing a pointer to a contiguous
10386 slab of registers. This changes the interface somewhat; for example
10387 with JSVariableObject if you wanted to add a register you had to do
10388 it yourself since the JSVariableObject didn't know how the registers
10389 array ought to be allocated. With JSSegmentedVariableObject you can
10390 just call addRegisters(). JSSegmentedVariableObject preserves the
10391 invariant that once you get a pointer into a register, that pointer
10392 will continue to be valid so long as the JSSegmentedVariableObject is
10393 alive. This allows the JITs and interpreters to skip the extra load.
10394
10395 - JSGlobalObject now inherits from JSSegmentedVariableObject. For now
10396 (and possibly forever) it is the only subtype of this new class.
10397
10398 - The bytecode format is changed so that get_global_var and
10399 put_global_var have a pointer to the register directly rather than
10400 having an index. A convenience method is provided in
10401 JSSegmentedVariableObject to get the index given a a pointer, which is
10402 used for assertions and debug dumps.
10403
10404 This appears to be a 1% across the board win.
10405
10406 * CMakeLists.txt:
10407 * GNUmakefile.list.am:
10408 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10409 * JavaScriptCore.xcodeproj/project.pbxproj:
10410 * Target.pri:
10411 * bytecode/CodeBlock.cpp:
10412 (JSC::CodeBlock::dump):
10413 * bytecode/Instruction.h:
10414 (Instruction):
10415 (JSC::Instruction::Instruction):
10416 * bytecompiler/BytecodeGenerator.cpp:
10417 (JSC::ResolveResult::registerPointer):
10418 (JSC):
10419 (JSC::BytecodeGenerator::BytecodeGenerator):
10420 (JSC::BytecodeGenerator::retrieveLastUnaryOp):
10421 (JSC::BytecodeGenerator::resolve):
10422 (JSC::BytecodeGenerator::resolveConstDecl):
10423 (JSC::BytecodeGenerator::emitGetStaticVar):
10424 (JSC::BytecodeGenerator::emitPutStaticVar):
10425 * bytecompiler/BytecodeGenerator.h:
10426 (ResolveResult):
10427 (BytecodeGenerator):
10428 * dfg/DFGAssemblyHelpers.h:
10429 (AssemblyHelpers):
10430 * dfg/DFGByteCodeParser.cpp:
10431 (JSC::DFG::ByteCodeParser::parseBlock):
10432 * dfg/DFGCSEPhase.cpp:
10433 (JSC::DFG::CSEPhase::globalVarLoadElimination):
10434 (JSC::DFG::CSEPhase::globalVarStoreElimination):
10435 (JSC::DFG::CSEPhase::performNodeCSE):
10436 * dfg/DFGGraph.cpp:
10437 (JSC::DFG::Graph::dump):
10438 * dfg/DFGGraph.h:
10439 (JSC::DFG::Graph::globalObjectFor):
10440 (Graph):
10441 * dfg/DFGNode.h:
10442 (JSC::DFG::Node::hasVarNumber):
10443 (Node):
10444 (JSC::DFG::Node::hasRegisterPointer):
10445 (JSC::DFG::Node::registerPointer):
10446 * dfg/DFGSpeculativeJIT32_64.cpp:
10447 (JSC::DFG::SpeculativeJIT::compile):
10448 * dfg/DFGSpeculativeJIT64.cpp:
10449 (JSC::DFG::SpeculativeJIT::compile):
10450 * heap/Heap.h:
10451 (Heap):
10452 (JSC::Heap::isWriteBarrierEnabled):
10453 (JSC):
10454 * interpreter/Interpreter.cpp:
10455 (JSC::Interpreter::execute):
10456 (JSC::Interpreter::privateExecute):
10457 * jit/JITPropertyAccess.cpp:
10458 (JSC::JIT::emit_op_get_global_var):
10459 (JSC::JIT::emit_op_put_global_var):
10460 * jit/JITPropertyAccess32_64.cpp:
10461 (JSC::JIT::emit_op_get_global_var):
10462 (JSC::JIT::emit_op_put_global_var):
10463 * llint/LowLevelInterpreter32_64.asm:
10464 * llint/LowLevelInterpreter64.asm:
10465 * runtime/JSGlobalObject.cpp:
10466 (JSC):
10467 (JSC::JSGlobalObject::put):
10468 (JSC::JSGlobalObject::putDirectVirtual):
10469 (JSC::JSGlobalObject::defineOwnProperty):
10470 (JSC::JSGlobalObject::visitChildren):
10471 (JSC::JSGlobalObject::addStaticGlobals):
10472 (JSC::JSGlobalObject::getOwnPropertySlot):
10473 (JSC::JSGlobalObject::getOwnPropertyDescriptor):
10474 * runtime/JSGlobalObject.h:
10475 (JSGlobalObject):
10476 (JSC::JSGlobalObject::JSGlobalObject):
10477 (JSC):
10478 (JSC::JSGlobalObject::hasOwnPropertyForWrite):
10479 * runtime/JSSegmentedVariableObject.cpp: Added.
10480 (JSC):
10481 (JSC::JSSegmentedVariableObject::findRegisterIndex):
10482 (JSC::JSSegmentedVariableObject::addRegisters):
10483 (JSC::JSSegmentedVariableObject::visitChildren):
10484 * runtime/JSSegmentedVariableObject.h: Added.
10485 (JSC):
10486 (JSSegmentedVariableObject):
10487 (JSC::JSSegmentedVariableObject::registerAt):
10488 (JSC::JSSegmentedVariableObject::assertRegisterIsInThisObject):
10489 (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
10490 (JSC::JSSegmentedVariableObject::finishCreation):
10491 * runtime/JSStaticScopeObject.cpp:
10492 (JSC::JSStaticScopeObject::put):
10493 (JSC::JSStaticScopeObject::putDirectVirtual):
10494 (JSC::JSStaticScopeObject::getOwnPropertySlot):
10495 * runtime/JSSymbolTableObject.cpp: Added.
10496 (JSC):
10497 (JSC::JSSymbolTableObject::destroy):
10498 (JSC::JSSymbolTableObject::deleteProperty):
10499 (JSC::JSSymbolTableObject::getOwnPropertyNames):
10500 (JSC::JSSymbolTableObject::putDirectVirtual):
10501 (JSC::JSSymbolTableObject::isDynamicScope):
10502 * runtime/JSSymbolTableObject.h: Added.
10503 (JSC):
10504 (JSSymbolTableObject):
10505 (JSC::JSSymbolTableObject::symbolTable):
10506 (JSC::JSSymbolTableObject::JSSymbolTableObject):
10507 (JSC::JSSymbolTableObject::finishCreation):
10508 (JSC::symbolTableGet):
10509 (JSC::symbolTablePut):
10510 (JSC::symbolTablePutWithAttributes):
10511 * runtime/JSVariableObject.cpp:
10512 (JSC):
10513 * runtime/JSVariableObject.h:
10514 (JSVariableObject):
10515 (JSC::JSVariableObject::JSVariableObject):
10516 (JSC::JSVariableObject::finishCreation):
10517 (JSC):
10518 * runtime/WriteBarrier.h:
10519
105202012-06-06 Filip Pizlo <fpizlo@apple.com>
10521
fpizlo@apple.comd5547492012-06-07 00:23:36 +000010522 DFG arguments access slow path should not crash if the arguments haven't been created
10523 https://bugs.webkit.org/show_bug.cgi?id=88471
10524
10525 Reviewed by Gavin Barraclough.
10526
10527 * dfg/DFGCCallHelpers.h:
10528 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
10529 (CCallHelpers):
10530 * dfg/DFGOperations.cpp:
10531 * dfg/DFGOperations.h:
10532 * dfg/DFGSpeculativeJIT.h:
10533 (JSC::DFG::SpeculativeJIT::callOperation):
10534 * dfg/DFGSpeculativeJIT32_64.cpp:
10535 (JSC::DFG::SpeculativeJIT::compile):
10536 * dfg/DFGSpeculativeJIT64.cpp:
10537 (JSC::DFG::SpeculativeJIT::compile):
10538
msaboff@apple.com9d9eab62012-06-06 23:11:09 +0000105392012-06-06 Michael Saboff <msaboff@apple.com>
10540
10541 ENH: Add Logging to GC Marking Phase
10542 https://bugs.webkit.org/show_bug.cgi?id=88364
10543
10544 Reviewed by Filip Pizlo.
10545
10546 Log GC marking to stderr or a file. The logging in controlled
10547 with the define ENABLE_OBJECT_MARK_LOGGING in wtf/Platform.h.
10548 If DATA_LOG_TO_FILE in wtf/DataLog.cpp is set to 1, output is
10549 logged to a file otherwise it is logged to stderr.
10550
10551 When logging is enabled, the GC is built single threaded since the
10552 log output from the various threads isn't buffered and output in a
10553 thread safe manner.
10554
10555 * heap/Heap.cpp:
10556 (JSC::Heap::markRoots):
10557 * heap/MarkStack.cpp:
10558 (JSC::MarkStackThreadSharedData::resetChildren):
10559 (JSC::MarkStackThreadSharedData::childVisitCount):
10560 (JSC::MarkStackThreadSharedData::markingThreadMain):
10561 (JSC::MarkStackThreadSharedData::markingThreadStartFunc):
10562 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
10563 (JSC::MarkStackThreadSharedData::reset):
10564 * heap/MarkStack.h:
10565 (MarkStackThreadSharedData):
10566 (MarkStack):
10567 (JSC::MarkStack::sharedData):
10568 (JSC::MarkStack::resetChildCount):
10569 (JSC::MarkStack::childCount):
10570 (JSC::MarkStack::incrementChildCount):
10571 * runtime/JSArray.cpp:
10572 (JSC::JSArray::visitChildren):
10573 * runtime/JSCell.cpp:
10574 (JSC::JSCell::className):
10575 * runtime/JSCell.h:
10576 (JSCell):
10577 (JSC::JSCell::visitChildren):
10578 * runtime/JSString.cpp:
10579 (JSC::JSString::visitChildren):
10580 * runtime/JSString.h:
10581 (JSString):
10582 * runtime/Structure.h:
10583 (JSC::MarkStack::internalAppend):
10584
barraclough@apple.com799e44e2012-06-06 22:09:44 +0000105852012-06-06 Gavin Barraclough <barraclough@apple.com>
10586
10587 Assigning to a static property should not change iteration order
10588 https://bugs.webkit.org/show_bug.cgi?id=88401
10589
10590 Reviewed by Geoff Garen.
10591
10592 A specific iteration order is not defined by the spec, but test-262 somewhat tenuously
10593 requires that it is at least stable, e.g. ch10/10.4/10.4.2/S10.4.2_A1.1_T1.js
10594
10595 Whilst it is not clear that this behavior really arises from the specification, it
10596 would seem like common sense to conform to this.
10597
10598 The problem here is that we allow properties in the structure to shadow those in the
10599 static table, and we iterate the properties in the structure first - which means that
10600 as values of existing properties are modified, their iteration order changes too.
10601
10602 The easy fix is to iterate the properties from the static table first. This has a
10603 further benefit, since it will mean that user added properties will come after those
10604 present in the static table (respected the expected insertion-order).
10605
10606 * runtime/JSObject.cpp:
10607 (JSC::JSObject::getOwnPropertyNames):
10608 - Iterate static properties first.
10609
wingo@igalia.combe8ecb92012-06-06 09:39:04 +0000106102012-06-06 Andy Wingo <wingo@igalia.com>
10611
wingo@igalia.comc2fb5ba2012-06-06 18:59:35 +000010612 Ensure consistent order of evaluation in LLInt slow paths
10613 https://bugs.webkit.org/show_bug.cgi?id=88409
10614
10615 Reviewed by Geoffrey Garen.
10616
10617 * llint/LLIntSlowPaths.cpp:
10618 (slow_path_mul)
10619 (slow_path_sub)
10620 (slow_path_div)
10621 (slow_path_mod)
10622 (slow_path_lshift)
10623 (slow_path_rshift)
10624 (slow_path_urshift)
10625 (slow_path_bitand)
10626 (slow_path_bitor)
10627 (slow_path_bitxor): Avoid calling toNumber, toInt32, or toUInt32
10628 multiple times without intervening sequence points. Fixes
10629 fast/js/exception-sequencing-binops.html with GCC 4.7 on x86-64
10630 Linux, which reordered evaluation of the arguments to fmod.
10631
106322012-06-06 Andy Wingo <wingo@igalia.com>
10633
wingo@igalia.com4990fe82012-06-06 16:00:38 +000010634 [GTK] Enable the LLInt
10635 https://bugs.webkit.org/show_bug.cgi?id=88315
10636
10637 Reviewed by Filip Pizlo.
10638
10639 * GNUmakefile.am: Add rules to generate LLIntDesiredOffsets.h and
10640 LLIntAssembly.h.
10641 * GNUmakefile.list.am: Add offlineasm and llint files to the
10642 dist. Add LLInt source files to the build.
10643 * llint/LowLevelInterpreter.asm (crash): Generate a store of
10644 0xbbadbeef to a register, not to a constant. Otherwise, gas was
10645 failing to assemble result.
10646 * offlineasm/asm.rb (labelReference): Generate a
10647 SYMBOL_STRING_RELOCATION instead of a SYMBOL_STRING, so that we go
10648 through the PLT on ELF systems.
10649
106502012-06-06 Andy Wingo <wingo@igalia.com>
10651
wingo@igalia.combe8ecb92012-06-06 09:39:04 +000010652 REGRESSION (r106478): None of the Paper.js JavaScript examples work
10653 https://bugs.webkit.org/show_bug.cgi?id=87158
10654
10655 Reviewed by Michael Saboff.
10656
10657 * bytecompiler/BytecodeGenerator.cpp:
10658 (JSC::BytecodeGenerator::resolve): If we have to bail out to
10659 dynamicResolve(), only skip static scopes from the head of the
10660 scope chain. Before, we were also skipping activations with
10661 direct eval as well, which was incorrect.
10662
mitz@apple.com115e6642012-06-06 07:37:05 +0000106632012-06-06 Dan Bernstein <mitz@apple.com>
10664
10665 Reverted r119567, the fix for <http://webkit.org/b/88378>, because it broke the 32-bit build.
10666
10667 * dfg/DFGSpeculativeJIT.h:
10668 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
10669 * jit/JITInlineMethods.h:
10670 (JSC::JIT::emitAllocateBasicJSObject):
10671 * llint/LowLevelInterpreter.asm:
10672 * runtime/JSGlobalData.h:
10673 (JSGlobalData):
10674 * runtime/JSGlobalThis.cpp:
10675 (JSC::JSGlobalThis::setUnwrappedObject):
10676 * runtime/JSObject.cpp:
10677 (JSC::JSObject::visitChildren):
10678 (JSC::JSObject::createInheritorID):
10679 * runtime/JSObject.h:
10680 (JSObject):
10681 (JSC::JSObject::resetInheritorID):
10682 (JSC):
10683 (JSC::JSObject::offsetOfInheritorID):
10684 (JSC::JSObject::inheritorID):
10685
yuqiang.xian@intel.come8adde62012-06-06 05:25:54 +0000106862012-06-05 Yuqiang Xian <yuqiang.xian@intel.com>
10687
10688 Improve Math.round and Math.floor intrinsic
10689 https://bugs.webkit.org/show_bug.cgi?id=88314
10690
10691 Reviewed by Filip Pizlo.
10692
10693 Currently we call a native function from the JIT code to complete the
10694 "round" and "floor" operations. We could inline some fast paths
10695 especially for those positive values on the platforms where floating
10696 point truncation is supported.
10697 This brings 3% gain on Kraken, especially 32% on audio-oscillator,
10698 and slight win on SunSpider, measured on IA32.
10699
10700 * jit/ThunkGenerators.cpp:
10701 (JSC::floorThunkGenerator):
10702 (JSC):
10703 (JSC::roundThunkGenerator):
10704
barraclough@apple.comc48fc1b2012-06-06 05:08:45 +0000107052012-06-05 Gavin Barraclough <barraclough@apple.com>
10706
10707 Remove JSObject::m_inheritorID
10708 https://bugs.webkit.org/show_bug.cgi?id=88378
10709
10710 Reviewed by Geoff Garen.
10711
10712 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
10713 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
10714 Instead use a private named value in the object's property storage.
10715
10716 * dfg/DFGSpeculativeJIT.h:
10717 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
10718 - No need m_inheritorID to initialize!
10719 * jit/JITInlineMethods.h:
10720 (JSC::JIT::emitAllocateBasicJSObject):
10721 - No need m_inheritorID to initialize!
10722 * llint/LowLevelInterpreter.asm:
10723 - No need m_inheritorID to initialize!
10724 * runtime/JSGlobalData.h:
10725 (JSGlobalData):
10726 - Added private name 'm_inheritorIDKey'.
10727 * runtime/JSGlobalThis.cpp:
10728 (JSC::JSGlobalThis::setUnwrappedObject):
10729 - resetInheritorID is now passed a JSGlobalData&.
10730 * runtime/JSObject.cpp:
10731 (JSC::JSObject::visitChildren):
10732 - No m_inheritorID to be marked.
10733 (JSC::JSObject::createInheritorID):
10734 - Store the newly created inheritorID in the property map.
10735 * runtime/JSObject.h:
10736 (JSC::JSObject::resetInheritorID):
10737 - Remove the inheritorID from property storage.
10738 (JSC::JSObject::inheritorID):
10739 - Read the inheritorID from property storage.
10740
fpizlo@apple.come7bee132012-06-05 21:32:18 +0000107412012-06-05 Filip Pizlo <fpizlo@apple.com>
10742
10743 DFG CFG simplification should not attempt to deref nodes inside of an unreachable subgraph
10744 https://bugs.webkit.org/show_bug.cgi?id=88362
10745
10746 Reviewed by Gavin Barraclough.
10747
10748 * dfg/DFGCFGSimplificationPhase.cpp:
10749 (JSC::DFG::CFGSimplificationPhase::fixPhis):
10750 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
10751
mhahnenberg@apple.com47c9c532012-06-05 20:38:21 +0000107522012-06-05 Mark Hahnenberg <mhahnenberg@apple.com>
10753
10754 Entry into JSC should CRASH() if the Heap is busy
10755 https://bugs.webkit.org/show_bug.cgi?id=88355
10756
10757 Reviewed by Geoffrey Garen.
10758
10759 Interpreter::execute() returns jsNull() right now if we try to enter it while
10760 the Heap is busy (e.g. with a collection), which is okay, but some code paths
10761 that call Interpreter::execute() allocate objects before checking if the Heap
10762 is busy. Attempting to execute JS code while the Heap is busy should not be
10763 allowed and should be enforced by a release-mode CRASH() to prevent vague,
10764 unhelpful backtraces later on if somebody makes a mistake. Normally, recursively
10765 executing JS code is okay, e.g. for evals, but it should not occur during a
10766 Heap allocation or collection because the Heap is not guaranteed to be in a
10767 consistent state (especially during collections). We are protected from
10768 executing JS on the same Heap concurrently on two separate threads because
10769 they must each take a JSLock first. However, we are not protected from reentrant
10770 execution of JS on the same thread because JSLock allows reentrancy. Therefore,
10771 we should fail early if we detect an entrance into JS code while the Heap is busy.
10772
10773 * heap/Heap.cpp: Changed Heap::collect so that it sets the m_operationInProgress field
10774 at the beginning of collection and then unsets it at the end so that it is set at all
10775 times throughout the duration of a collection rather than sporadically during various
10776 phases. There is no reason to unset during a collection because our collector does
10777 not currently support running additional JS between the phases of a collection.
10778 (JSC::Heap::getConservativeRegisterRoots):
10779 (JSC::Heap::markRoots):
10780 (JSC::Heap::collect):
10781 * interpreter/Interpreter.cpp:
10782 (JSC::Interpreter::execute): Crash if the Heap is busy.
10783 * runtime/Completion.cpp: Crash if the Heap is busy. We do it here before we call
10784 Interpreter::execute() because we do some allocation prior to calling execute() which
10785 could cause Heap corruption if, for example, that allocation caused a collection.
10786 (JSC::evaluate):
10787
commit-queue@webkit.org3401b2d2012-06-05 11:32:22 +0000107882012-06-05 Dongwoo Im <dw.im@samsung.com>
10789
10790 Add 'isProtocolHandlerRegistered' and 'unregisterProtocolHandler'.
10791 https://bugs.webkit.org/show_bug.cgi?id=73176
10792
10793 Reviewed by Adam Barth.
10794
10795 Two more APIs are added in Custom Scheme Handler specification.
10796 http://dev.w3.org/html5/spec/Overview.html#custom-handlers
10797 One is 'isProtocolHandlerRegistered' to query whether the specific URL
10798 is registered or not.
10799 The other is 'unregisterProtocolHandler' to remove the registered URL.
10800
10801 * Configurations/FeatureDefines.xcconfig: Add a macro 'ENABLE_CUSTOM_SCHEME_HANDLER'.
10802
fpizlo@apple.com9cce18d2012-06-05 06:40:48 +0000108032012-06-04 Filip Pizlo <fpizlo@apple.com>
10804
10805 DFG CFG simplification should correct the variables at the head of the predecessor block
10806 https://bugs.webkit.org/show_bug.cgi?id=88284
10807
10808 Reviewed by Geoffrey Garen.
10809
10810 * dfg/DFGCFGSimplificationPhase.cpp:
10811 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
10812
ggaren@apple.com825cc102012-06-05 03:17:15 +0000108132012-06-04 Geoffrey Garen <ggaren@apple.com>
10814
10815 Unreviewed.
10816
10817 Rolled out r119364 because it's still causing crashes (when running
10818 v8-earley in release builds of DRT)
10819
10820 This time for sure!
10821
10822 * heap/Heap.cpp:
10823 (JSC::Heap::collect):
10824 * heap/MarkedBlock.cpp:
10825 (JSC::MarkedBlock::sweep):
10826 * heap/MarkedBlock.h:
10827 (JSC::MarkedBlock::resetAllocator):
10828 (JSC):
10829 * heap/MarkedSpace.cpp:
10830 (JSC::ResetAllocator::operator()):
10831 (JSC):
10832 (JSC::MarkedSpace::resetAllocators):
10833 (JSC::MarkedSpace::sweepWeakSets):
10834 * heap/MarkedSpace.h:
10835 (MarkedSpace):
10836 * heap/WeakBlock.cpp:
10837 (JSC::WeakBlock::sweep):
10838 * heap/WeakSet.cpp:
10839 (JSC::WeakSet::sweep):
10840 (JSC::WeakSet::tryFindAllocator):
10841 * heap/WeakSet.h:
10842 (JSC::WeakSet::shrink):
10843
fpizlo@apple.com9cd38a62012-06-05 00:28:49 +0000108442012-06-04 Filip Pizlo <fpizlo@apple.com>
10845
10846 DFG arguments simplification should have rationalized handling of TearOffArguments
10847 https://bugs.webkit.org/show_bug.cgi?id=88206
10848
10849 Reviewed by Geoffrey Garen.
10850
10851 - Accesses to the unmodified arguments register ought to have the same effect on
10852 alias/escape analysis of arguments as accesses to the mutable arguments register.
10853
10854 - The existence of TearOffArguments should not get in the way of arguments aliasing.
10855
10856 - TearOffArguments should be eliminated if CreateArguments is eliminated.
10857
10858 * dfg/DFGArgumentsSimplificationPhase.cpp:
10859 (JSC::DFG::ArgumentsSimplificationPhase::run):
10860 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
10861
barraclough@apple.com282d26a2012-06-05 00:00:17 +0000108622012-06-04 Gavin Barraclough <barraclough@apple.com>
10863
10864 Remove enabledProfilerReference
10865 https://bugs.webkit.org/show_bug.cgi?id=88258
10866
10867 Reviewed by Michael Saboff.
10868
10869 Make the enabled profiler a member of JSGlobalData, and switch code that accesses it to do so directly
10870 via the JSGlobalData, rather than holding a Profiler** reference to it. Do not pass the Profiler**
10871 reference to JIT code. This patch does not change the stack layout on entry into JIT code (passing an
10872 unused void* instead), since this is an intrusive change better handled in a separate patch.
10873
10874 * interpreter/Interpreter.cpp:
10875 (JSC::Interpreter::throwException):
10876 (JSC::Interpreter::execute):
10877 (JSC::Interpreter::executeCall):
10878 (JSC::Interpreter::executeConstruct):
10879 (JSC::Interpreter::privateExecute):
10880 * jit/JITCode.h:
10881 (JSC::JITCode::execute):
10882 - Don't pass Profiler** to JIT code.
10883 * jit/JITOpcodes.cpp:
10884 (JSC::JIT::emit_op_profile_will_call):
10885 (JSC::JIT::emit_op_profile_did_call):
10886 * jit/JITOpcodes32_64.cpp:
10887 (JSC::JIT::emit_op_profile_will_call):
10888 (JSC::JIT::emit_op_profile_did_call):
10889 * jit/JITStubs.cpp:
10890 (JSC):
10891 (JSC::ctiTrampoline):
10892 (JSC::ctiVMThrowTrampoline):
10893 (JSC::ctiOpThrowNotCaught):
10894 (JSC::JITThunks::JITThunks):
10895 (JSC::DEFINE_STUB_FUNCTION):
10896 - For ARM_THUMB2, rename ENABLE_PROFILER_REFERENCE_OFFSET to FIRST_STACK_ARGUMENT (which is how it is being used).
10897 - For MIPS, remove ENABLE_PROFILER_REFERENCE_OFFSET.
10898 * jit/JITStubs.h:
10899 (JITStackFrame):
10900 (JSC):
10901 - Renamed enabledProfilerReference to unusedX.
10902 * llint/LLIntSlowPaths.cpp:
10903 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
10904 * llint/LowLevelInterpreter.asm:
10905 * profiler/Profiler.cpp:
10906 (JSC):
10907 (JSC::Profiler::startProfiling):
10908 (JSC::Profiler::stopProfiling):
10909 * profiler/Profiler.h:
10910 (Profiler):
10911 - Removed s_sharedEnabledProfilerReference, enabledProfilerReference().
10912 * runtime/JSGlobalData.cpp:
10913 (JSC::JSGlobalData::JSGlobalData):
10914 * runtime/JSGlobalData.h:
10915 (JSC):
10916 (JSC::JSGlobalData::enabledProfiler):
10917 (JSGlobalData):
10918 - Added m_enabledProfiler, enabledProfiler().
10919 * runtime/JSGlobalObject.cpp:
10920 (JSC::JSGlobalObject::~JSGlobalObject):
10921
fpizlo@apple.com3d579cc2012-06-04 23:27:34 +0000109222012-06-04 Filip Pizlo <fpizlo@apple.com>
10923
fpizlo@apple.com477ce382012-06-04 23:32:57 +000010924 get_argument_by_val should be profiled everywhere
10925 https://bugs.webkit.org/show_bug.cgi?id=88205
10926
10927 Reviewed by Geoffrey Garen.
10928
10929 * jit/JITOpcodes32_64.cpp:
10930 (JSC::JIT::emitSlow_op_get_argument_by_val):
10931 * llint/LLIntSlowPaths.cpp:
10932 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
10933
109342012-06-04 Filip Pizlo <fpizlo@apple.com>
10935
fpizlo@apple.com3d579cc2012-06-04 23:27:34 +000010936 DFG arguments simplification takes unkindly to direct accesses to the arguments register
10937 https://bugs.webkit.org/show_bug.cgi?id=88261
10938
10939 Reviewed by Geoffrey Garen.
10940
10941 Fixed arguments simplification for direct accesses to the arguments register, which may
10942 arise if CSE had not run. Fixed CSE so that it does run prior to arguments simplification,
10943 by making it a full-fledged member of the fixpoint. Fixed other issues in arguments
10944 simplification, like realizing that it needs to bail if there is a direct assignment to
10945 the arguments register, and failing to turn CreateArguments into PhantomArguments. Also
10946 fixed CSE's handling of store elimination of captured locals in the presence of a
10947 GetMyArgumentByVal (or one of its friends), and fixed CSE to correctly fixup variables at
10948 tail if the Flush it removes is the last operation on a local in a basic block.
10949
10950 * bytecode/CodeBlock.cpp:
10951 (JSC::CodeBlock::dump):
10952 * dfg/DFGArgumentsSimplificationPhase.cpp:
10953 (JSC::DFG::ArgumentsSimplificationPhase::run):
10954 (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
10955 * dfg/DFGCSEPhase.cpp:
10956 (JSC::DFG::CSEPhase::run):
10957 (JSC::DFG::CSEPhase::setLocalStoreElimination):
10958 (JSC::DFG::CSEPhase::performNodeCSE):
10959 (CSEPhase):
10960 * dfg/DFGDriver.cpp:
10961 (JSC::DFG::compile):
10962
andersca@apple.comea6c6b22012-06-04 21:56:32 +0000109632012-06-04 Anders Carlsson <andersca@apple.com>
10964
10965 Fix a struct/class mismatch.
10966
10967 * heap/Handle.h:
10968 (Handle):
10969
ddkilzer@apple.comba58a612012-06-04 14:55:26 +0000109702012-06-04 David Kilzer <ddkilzer@apple.com>
10971
10972 BUILD FIX: FeatureDefines.xcconfig should match across projects
10973
10974 * Configurations/FeatureDefines.xcconfig:
10975 - Add missing ENABLE_LEGACY_CSS_VENDOR_PREFIXES.
10976
ggaren@apple.com02dec622012-06-03 21:16:55 +0000109772012-06-02 Geoffrey Garen <ggaren@apple.com>
10978
10979 Weak pointer finalization should be lazy
10980 https://bugs.webkit.org/show_bug.cgi?id=87599
10981
10982 Reviewed by Sam Weinig.
10983
10984 This time for sure!
10985
10986 * heap/Heap.cpp:
10987 (JSC::Heap::collect): Don't sweep eagerly -- we'll sweep lazily instead.
10988
10989 * heap/MarkedBlock.cpp:
10990 (JSC::MarkedBlock::sweep): Sweep our weak set before we sweep our other
10991 destructors -- this is our last chance to run weak set finalizers before
10992 we recycle our memory.
10993
10994 * heap/MarkedBlock.h:
10995 (JSC::MarkedBlock::resetAllocator):
10996 * heap/MarkedSpace.cpp:
10997 (JSC::MarkedSpace::resetAllocators):
10998 * heap/MarkedSpace.h:
10999 (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
11000 It will happen automatically when a weak set is swept. It's simpler to
11001 have only one canonical way for this to happen, and it wasn't buying
11002 us anything to do it eagerly.
11003
11004 * heap/WeakBlock.cpp:
11005 (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
11006 the sweep would be a no-op. If even one finalizer is pending, we need to
11007 run it, since we won't get another chance.
11008
11009 * heap/WeakSet.cpp:
11010 (JSC::WeakSet::sweep): This loop can be simpler now that
11011 WeakBlock::sweep() does what we mean.
11012
11013 Reset our allocator after a sweep because this is the optimal time to
11014 start trying to recycle old weak pointers.
11015
11016 (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
11017 allocator because we've swept already, and forcing a new sweep would be
11018 wasteful.
11019
11020 * heap/WeakSet.h:
11021 (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
11022 because the shrink may have removed the block the allocator was going to
11023 allocate out of.
11024
fpizlo@apple.comb80bc2a32012-06-02 22:58:48 +0000110252012-06-02 Filip Pizlo <fpizlo@apple.com>
11026
fpizlo@apple.come0c200c2012-06-03 00:41:08 +000011027 If the DFG bytecode parser detects that op_method_check has gone polymorphic, it
11028 shouldn't revert all the way to GetById/GetByIdFlush
11029 https://bugs.webkit.org/show_bug.cgi?id=88176
11030
11031 Reviewed by Geoffrey Garen.
11032
11033 Refactored the code so that the op_method_check case of the parser gracefully falls
11034 through to all of the goodness of the normal op_get_by_id case.
11035
11036 * dfg/DFGByteCodeParser.cpp:
11037 (ByteCodeParser):
11038 (JSC::DFG::ByteCodeParser::handleGetById):
11039 (DFG):
11040 (JSC::DFG::ByteCodeParser::parseBlock):
11041
110422012-06-02 Filip Pizlo <fpizlo@apple.com>
11043
fpizlo@apple.comb80bc2a32012-06-02 22:58:48 +000011044 DFG CSE should be able to eliminate unnecessary flushes of arguments and captured variables
11045 https://bugs.webkit.org/show_bug.cgi?id=87929
11046
11047 Reviewed by Geoffrey Garen.
11048
11049 Slight speed-up on V8. Big win (up to 50%) on programs that inline very small functions.
11050
11051 This required a bunch of changes:
11052
11053 - The obvious change is making CSE essentially ignore whether or not the set of
11054 operations between the Flush and the SetLocal can exit, and instead focus on whether or
11055 not that set of operations can clobber the world or access local variables. This code
11056 is now refactored to return a set of flags indicating any of these events, and the CSE
11057 decides what to do based on those flags. If the set of operations is non-clobbering
11058 and non-accessing, then the Flush is turned into a Phantom on the child of the
11059 SetLocal. This expands the liveness of the relevant variable but virtually guarantees
11060 that it will be register allocated and not flushed to the stack. So, yeah, this patch
11061 is a lot of work to save a few stores to the stack.
11062
11063 - Previously, CheckArgumentsNotCreated was optimized "lazily" in that you only knew if
11064 it was a no-op if you were holding onto a CFA abstract state. But this would make the
11065 CSE act pessimistically, since it doesn't use the CFA. Hence, this patch changes the
11066 constant folding phase into something more broad; it now fixes up
11067 CheckArgumentsNotCreated nodes by turning them into phantoms if it knows that they are
11068 no-ops.
11069
11070 - Arguments simplification was previously relying on this very strange PhantomArguments
11071 node, which had two different meanings: for normal execution it meant the empty value
11072 but for OSR exit it meant that the arguments should be reified. This produces problems
11073 when set SetLocals to the captured arguments registers are CSE'd away, since we'd be
11074 triggering reification of arguments without having initialized the arguments registers
11075 to empty. The cleanest solution was to fix PhantomArguments to have one meaning:
11076 namely, arguments reification on OSR exit. Hence, this patch changes arguments
11077 simplification to change SetLocal of CreateArguments on the arguments registers to be
11078 a SetLocal of Empty.
11079
11080 - Argument value recoveries were previously derived from the value source of the
11081 arguments at the InlineStart. But that relies on all SetLocals to arguments having
11082 been flushed. It's possible that we could have elided the SetLocal to the arguments
11083 at the callsite because there were subsequent SetLocals to the arguments inside of the
11084 callee, in which case the InlineStart would get the wrong information. Hence, this
11085 patch changes argument value recovery computation to operate over the ArgumentPositions
11086 directly.
11087
11088 - But that doesn't actually work, because previously, there was no way to link an
11089 InlineStart back to the corresponding ArgumentPositions, at least not without some
11090 ugliness. So this patch instates the rule that the m_argumentPositions vector consists
11091 of disjoint subsequences such that each subsequence corresponds to an inline callsite
11092 and can be identified by its first index, and within each subsequence are the
11093 ArgumentPositions of all of the arguments ordered by argument index. This required
11094 flipping the order in which ArgumentPositions are added to the vector, and giving
11095 InlineStart an operand that indicates the start of that inline callsite's
11096 ArgumentPosition subsequence.
11097
11098 - This patch also revealed a nasty bug in the reification of arguments in inline call
11099 frames on OSR exit. Since the reification was happening after the values of virtual
11100 registers were recovered, the value recoveries of the inline arguments were wrong.
11101 Hence using operationCreateInlinedArguments is wrong. For example a value recovery
11102 might say that you have to box a double, but if we had already boxed it then boxing
11103 it a second time will result in garbage. The specific case of this bug was this patch
11104 uncovered was that now it is possible for an inline call frame to not have any valid
11105 value recoveries for any inline arguments, if the optimization elides all argument
11106 flushes, while at the same time optimizing away arguments creation. Then OSR exit
11107 would try to recover the arguments using the inline call frame, which had bogus
11108 information, and humorous crashes would ensue. This patch fixes this issue by moving
11109 arguments reification to after call frame reification, so that arguments reification
11110 can always use operationCreateArguments instead of operationCreateInlinedArguments.
11111
11112 - This patch may turn a Flush into a Phantom. That's kind of the whole point. But that
11113 broke forward speculation checks, which knew to look for a Flush prior to a SetLocal
11114 but didn't know that there could alternatively be a Phantom in place of the Flush.
11115 This patch fixes that by augmenting the forward speculation check logic.
11116
11117 - Finally, in the process of having fun with all of the above, I realized that my DFG
11118 validation was not actually running on every phase like I had originally designed it
11119 to. In fact it was only running just after bytecode parsing. I initially tried to
11120 make it run in every phase but found that this causes some tests to timeout
11121 (specifically the evil fuzzing ones), so I decided on a compromise where: (i) in
11122 release mode validation never runs, (ii) in debug mode validation will run just
11123 after parsing and just before the backend, and (iii) it's possible with a simple
11124 switch to enable validation to run on every phase.
11125
11126 Luckily all of the above issues were already covered by the 77 or so DFG-specific
11127 layout tests. Hence, this patch does not introduce any new tests despite being so
11128 meaty.
11129
11130 * dfg/DFGAbstractState.cpp:
11131 (JSC::DFG::AbstractState::execute):
11132 * dfg/DFGArgumentPosition.h:
11133 (JSC::DFG::ArgumentPosition::prediction):
11134 (JSC::DFG::ArgumentPosition::doubleFormatState):
11135 (JSC::DFG::ArgumentPosition::shouldUseDoubleFormat):
11136 (ArgumentPosition):
11137 * dfg/DFGArgumentsSimplificationPhase.cpp:
11138 (JSC::DFG::ArgumentsSimplificationPhase::run):
11139 * dfg/DFGByteCodeParser.cpp:
11140 (JSC::DFG::ByteCodeParser::handleInlining):
11141 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
11142 * dfg/DFGCSEPhase.cpp:
11143 (JSC::DFG::CSEPhase::SetLocalStoreEliminationResult::SetLocalStoreEliminationResult):
11144 (SetLocalStoreEliminationResult):
11145 (JSC::DFG::CSEPhase::setLocalStoreElimination):
11146 (JSC::DFG::CSEPhase::performNodeCSE):
11147 * dfg/DFGCommon.h:
11148 * dfg/DFGConstantFoldingPhase.cpp:
11149 (JSC::DFG::ConstantFoldingPhase::run):
11150 * dfg/DFGDriver.cpp:
11151 (JSC::DFG::compile):
11152 * dfg/DFGNode.h:
11153 (Node):
11154 (JSC::DFG::Node::hasArgumentPositionStart):
11155 (JSC::DFG::Node::argumentPositionStart):
11156 * dfg/DFGOSRExitCompiler32_64.cpp:
11157 (JSC::DFG::OSRExitCompiler::compileExit):
11158 * dfg/DFGOSRExitCompiler64.cpp:
11159 (JSC::DFG::OSRExitCompiler::compileExit):
11160 * dfg/DFGPhase.cpp:
11161 (DFG):
11162 * dfg/DFGPhase.h:
11163 (Phase):
11164 * dfg/DFGSpeculativeJIT.cpp:
11165 (JSC::DFG::SpeculativeJIT::compile):
11166 * dfg/DFGSpeculativeJIT.h:
11167 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
11168 * dfg/DFGSpeculativeJIT32_64.cpp:
11169 (JSC::DFG::SpeculativeJIT::compile):
11170 * dfg/DFGSpeculativeJIT64.cpp:
11171 (JSC::DFG::SpeculativeJIT::compile):
11172
ggaren@apple.com32eb24b2012-06-02 22:49:05 +0000111732012-06-02 Geoffrey Garen <ggaren@apple.com>
11174
11175 DOM string cache should hash pointers, not characters
11176 https://bugs.webkit.org/show_bug.cgi?id=88175
11177
11178 Reviewed by Phil Pizlo and Sam Weinig.
11179
11180 * heap/Weak.h:
11181 (JSC::weakAdd):
11182 (JSC::weakRemove): Made these function templates slightly more generic
11183 to accommodate new client types.
11184
fpizlo@apple.comcc5b61b2012-06-01 21:32:45 +0000111852012-06-01 Filip Pizlo <fpizlo@apple.com>
11186
fpizlo@apple.coma4754892012-06-02 00:22:31 +000011187 DFG CFA should know that PutByVal can clobber the world
11188 https://bugs.webkit.org/show_bug.cgi?id=88155
11189
11190 Reviewed by Gavin Barraclough.
11191
11192 * dfg/DFGAbstractState.cpp:
11193 (JSC::DFG::AbstractState::execute):
11194
111952012-06-01 Filip Pizlo <fpizlo@apple.com>
11196
fpizlo@apple.com8e537cd2012-06-01 23:54:36 +000011197 DFG CFA should mark basic blocks as having constants if local accesses yield constants
11198 https://bugs.webkit.org/show_bug.cgi?id=88153
11199
11200 Reviewed by Gavin Barraclough.
11201
11202 * dfg/DFGAbstractState.cpp:
11203 (JSC::DFG::AbstractState::execute):
11204
112052012-06-01 Filip Pizlo <fpizlo@apple.com>
11206
fpizlo@apple.comacc9dd22012-06-01 23:47:28 +000011207 DFG arguments simplification phase uses a node.codeOrigin after appending a node
11208 https://bugs.webkit.org/show_bug.cgi?id=88151
11209
11210 Reviewed by Geoffrey Garen.
11211
11212 The right thing to do is to save the CodeOrigin before appending to the graph.
11213
11214 * dfg/DFGArgumentsSimplificationPhase.cpp:
11215 (JSC::DFG::ArgumentsSimplificationPhase::run):
11216
112172012-06-01 Filip Pizlo <fpizlo@apple.com>
11218
fpizlo@apple.com4f337c22012-06-01 23:18:59 +000011219 DFG should not emit unnecessary speculation checks when performing an int32 to double conversion on
11220 a value that is proved to be a number, predicted to be an int32, but not proved to be an int32
11221 https://bugs.webkit.org/show_bug.cgi?id=88146
11222
11223 Reviewed by Gavin Barraclough.
11224
11225 * dfg/DFGSpeculativeJIT.cpp:
11226 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
11227
112282012-06-01 Filip Pizlo <fpizlo@apple.com>
11229
fpizlo@apple.comafc07412012-06-01 22:44:43 +000011230 DFG constant folding search for the last local access skips the immediately previous local access
11231 https://bugs.webkit.org/show_bug.cgi?id=88141
11232
11233 Reviewed by Michael Saboff.
11234
11235 If you use a loop in the style of:
11236
11237 for (i = start; i--;)
11238
11239 then you need to remember that the first value of 'i' that the loop body will see is 'start - 1'.
11240 Hence the following is probably wrong:
11241
11242 for (i = start - 1; i--;)
11243
11244 * dfg/DFGConstantFoldingPhase.cpp:
11245 (JSC::DFG::ConstantFoldingPhase::run):
11246
112472012-06-01 Filip Pizlo <fpizlo@apple.com>
11248
fpizlo@apple.comcc5b61b2012-06-01 21:32:45 +000011249 DFG constant folding should be OK with GetLocal of captured variables having a constant
11250 https://bugs.webkit.org/show_bug.cgi?id=88137
11251
11252 Reviewed by Gavin Barraclough.
11253
11254 * dfg/DFGConstantFoldingPhase.cpp:
11255 (JSC::DFG::ConstantFoldingPhase::run):
11256
mhahnenberg@apple.com016c5782012-06-01 00:02:09 +0000112572012-05-31 Mark Hahnenberg <mhahnenberg@apple.com>
11258
11259 JSGlobalObject does not mark m_privateNameStructure
11260 https://bugs.webkit.org/show_bug.cgi?id=88023
11261
11262 Rubber stamped by Gavin Barraclough.
11263
11264 * runtime/JSGlobalObject.cpp:
11265 (JSC::JSGlobalObject::visitChildren): We need to mark this so it doesn't get
11266 inadvertently garbage collected.
11267
arv@chromium.org31fddbc2012-05-31 18:00:03 +0000112682012-05-31 Erik Arvidsson <arv@chromium.org>
11269
11270 Make DOM Exceptions Errors
11271 https://bugs.webkit.org/show_bug.cgi?id=85078
11272
11273 Reviewed by Oliver Hunt.
11274
11275 WebIDL mandates that exceptions should have Error.prototype on its prototype chain.
11276
11277 For JSC we have access to the Error.prototype from the binding code.
11278
11279 For V8 we set a field in the WrapperTypeInfo and when the constructor function is created we
11280 set the prototype as needed.
11281
11282 Updated test: fast/dom/DOMException/prototype-object.html
11283
11284 * JavaScriptCore.xcodeproj/project.pbxproj:
11285 * runtime/JSGlobalObject.cpp:
11286 (JSC::JSGlobalObject::reset):
11287 * runtime/JSGlobalObject.h:
11288 (JSC):
11289 (JSGlobalObject):
11290 (JSC::JSGlobalObject::errorPrototype):
11291
wingo@igalia.com8de6a8a2012-05-31 17:28:21 +0000112922012-05-31 Andy Wingo <wingo@igalia.com>
11293
11294 Fix reference to unset variable in debug mode
11295 https://bugs.webkit.org/show_bug.cgi?id=87981
11296
11297 Reviewed by Geoffrey Garen.
11298
11299 * runtime/JSONObject.cpp (Stringifier::Holder::Holder):
11300 Initialize m_size in debug mode, as we check it later in an assert.
11301
mhahnenberg@apple.comeb39abc2012-05-31 03:04:00 +0000113022012-05-30 Mark Hahnenberg <mhahnenberg@apple.com>
11303
11304 Heap should sweep incrementally
11305 https://bugs.webkit.org/show_bug.cgi?id=85429
11306
11307 We shouldn't have to wait for the opportunistic GC timer to fire in order
11308 to call object destructors. Instead, we should incrementally sweep some
11309 subset of the blocks requiring sweeping periodically. We tie this sweeping
11310 to a timer rather than to collections because we want to reclaim this memory
11311 even if we stop allocating. This way, our memory usage scales smoothly with
11312 actual use, regardless of whether we've recently done an opportunistic GC or not.
11313
11314 Reviewed by Geoffrey Garen.
11315
11316 * CMakeLists.txt:
11317 * GNUmakefile.list.am:
11318 * JavaScriptCore.gypi:
11319 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
11320 * JavaScriptCore.xcodeproj/project.pbxproj:
11321 * Target.pri:
11322 * heap/Heap.cpp:
11323 (JSC::Heap::Heap):
11324 (JSC::Heap::collect): We no longer sweep during a full sweep. We only shrink now,
11325 which we will switch over to being done during incremental sweeping too as soon as
11326 all finalizers can be run lazily (and, by extension, incrementally).
11327 (JSC::Heap::sweeper):
11328 (JSC):
11329 * heap/Heap.h:
11330 (JSC):
11331 (Heap):
11332 * heap/IncrementalSweeper.cpp: Added.
11333 (JSC):
11334 (JSC::IncrementalSweeper::timerDidFire): The IncrementalSweeper works very similarly to
11335 GCActivityCallback. It is tied to a run-loop based timer that fires periodically based
11336 on how long the previous sweep increment took to run. The IncrementalSweeper doesn't do
11337 anything if the platform doesn't support CoreFoundation.
11338 (JSC::IncrementalSweeper::IncrementalSweeper):
11339 (JSC::IncrementalSweeper::~IncrementalSweeper):
11340 (JSC::IncrementalSweeper::create):
11341 (JSC::IncrementalSweeper::scheduleTimer):
11342 (JSC::IncrementalSweeper::cancelTimer):
11343 (JSC::IncrementalSweeper::doSweep): Iterates over the snapshot of the MarkedSpace taken
11344 during the last collection, checking to see which blocks need sweeping. If it successfully
11345 gets to the end of the blocks that need sweeping then it cancels the timer.
11346 (JSC::IncrementalSweeper::startSweeping): We take a snapshot of the Heap and store it in
11347 a Vector that the incremental sweep will iterate over. We also reset our index into this Vector.
11348 * heap/IncrementalSweeper.h: Added.
11349 (JSC):
11350 (IncrementalSweeper):
11351 * heap/MarkedBlock.h:
11352 (JSC::MarkedBlock::needsSweeping): If a block is in the Marked state it needs sweeping
11353 to be usable and to run any destructors that need to be run.
11354
paroga@webkit.orgecd0fb62012-05-31 01:38:17 +0000113552012-05-30 Patrick Gansterer <paroga@webkit.org>
11356
11357 [WINCE] Fix JSString after r115516.
11358 https://bugs.webkit.org/show_bug.cgi?id=87892
11359
11360 Reviewed by Geoffrey Garen.
11361
11362 r115516 splitted JSString into two classes, with addition nested classes.
11363 Add a workaround for the WinCE compiler since it can't resolve the friend class
11364 declerations corretly and denies the access to protected members of JSString.
11365
11366 * runtime/JSString.h:
11367 (JSC::JSRopeString::RopeBuilder::append):
11368 (JSC::JSRopeString::append):
11369 (JSRopeString):
11370
oliver@apple.com3c996382012-05-30 23:47:27 +0000113712012-05-30 Oliver Hunt <oliver@apple.com>
11372
11373 Really provide error information with the inspector disabled
11374 https://bugs.webkit.org/show_bug.cgi?id=87910
11375
11376 Reviewed by Filip Pizlo.
11377
11378 Don't bother checking for anything other than pre-existing error info.
11379 In the absence of complete line number information you'll only get the
11380 line a function starts on, but at least it's something.
11381
11382 * interpreter/Interpreter.cpp:
11383 (JSC::Interpreter::throwException):
11384
fpizlo@apple.com074918c2012-05-30 20:18:00 +0000113852012-05-30 Filip Pizlo <fpizlo@apple.com>
11386
fpizlo@apple.com5673fe62012-05-30 23:09:45 +000011387 LLInt broken on x86-32 with JIT turned off
11388 https://bugs.webkit.org/show_bug.cgi?id=87906
11389
11390 Reviewed by Geoffrey Garen.
11391
11392 Fixed the code to not clobber registers that contain important things, like the call frame.
11393
11394 * llint/LowLevelInterpreter32_64.asm:
11395
113962012-05-30 Filip Pizlo <fpizlo@apple.com>
11397
fpizlo@apple.com074918c2012-05-30 20:18:00 +000011398 ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
11399 https://bugs.webkit.org/show_bug.cgi?id=87887
11400
fpizlo@apple.comd55e8152012-05-30 21:04:23 +000011401 Reviewed by Darin Adler.
11402
11403 Better fix - we now never call SourceProvider::asID() if SourceProvider* is 0.
11404
11405 * parser/Nodes.h:
11406 (JSC::ScopeNode::sourceID):
11407 * parser/SourceCode.h:
11408 (JSC::SourceCode::providerID):
11409 (SourceCode):
11410 * parser/SourceProvider.h:
11411 (SourceProvider):
11412 (JSC::SourceProvider::asID):
11413 * runtime/Executable.h:
11414 (JSC::ScriptExecutable::sourceID):
11415
114162012-05-30 Filip Pizlo <fpizlo@apple.com>
11417
11418 ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
11419 https://bugs.webkit.org/show_bug.cgi?id=87887
11420
fpizlo@apple.com074918c2012-05-30 20:18:00 +000011421 Reviewed by Geoffrey Garen.
11422
11423 * parser/SourceProvider.h:
11424 (JSC::SourceProvider::asID):
11425
oliver@apple.comc55314a2012-05-30 19:45:20 +0000114262012-05-30 Oliver Hunt <oliver@apple.com>
11427
11428 DFG does not correctly handle exceptions caught in the LLInt
11429 https://bugs.webkit.org/show_bug.cgi?id=87885
11430
11431 Reviewed by Filip Pizlo.
11432
11433 Make the DFG use genericThrow, rather than reimplementing a small portion of it.
11434 Also make the LLInt slow paths validate that their PC is correct.
11435
11436 * dfg/DFGOperations.cpp:
11437 * llint/LLIntSlowPaths.cpp:
11438 (LLInt):
11439
fpizlo@apple.com75824e82012-05-30 17:02:49 +0000114402012-05-29 Filip Pizlo <fpizlo@apple.com>
11441
11442 DFG CFA should infer types and values of captured variables
11443 https://bugs.webkit.org/show_bug.cgi?id=87813
11444
11445 Reviewed by Gavin Barraclough.
11446
11447 Slight speed-up in V8/earley-boyer (~1%).
11448
11449 * bytecode/CodeBlock.h:
11450 (JSC::CodeBlock::argumentsAreCaptured):
11451 (JSC::CodeBlock::argumentIsCaptured):
11452 (CodeBlock):
11453 * dfg/DFGAbstractState.cpp:
11454 (DFG):
11455 (JSC::DFG::AbstractState::beginBasicBlock):
11456 (JSC::DFG::AbstractState::initialize):
11457 (JSC::DFG::AbstractState::endBasicBlock):
11458 (JSC::DFG::AbstractState::execute):
11459 (JSC::DFG::AbstractState::clobberWorld):
11460 (JSC::DFG::AbstractState::clobberStructures):
11461 (JSC::DFG::AbstractState::mergeStateAtTail):
11462 (JSC::DFG::AbstractState::merge):
11463 (JSC::DFG::AbstractState::mergeToSuccessors):
11464 * dfg/DFGAbstractState.h:
11465 (JSC::DFG::AbstractState::variables):
11466 (AbstractState):
11467 * dfg/DFGSpeculativeJIT32_64.cpp:
11468 (JSC::DFG::SpeculativeJIT::compile):
11469 * dfg/DFGSpeculativeJIT64.cpp:
11470 (JSC::DFG::SpeculativeJIT::compile):
11471
paroga@webkit.orge373ab72012-05-30 16:44:03 +0000114722012-05-30 Patrick Gansterer <paroga@webkit.org>
11473
11474 Unreviewed. Build fix for !ENABLE(JIT) after r117823.
11475
11476 * bytecode/CodeBlock.cpp:
11477 (JSC::CodeBlock::dump):
11478
commit-queue@webkit.org4ac40e0d2012-05-30 07:17:05 +0000114792012-05-30 Sheriff Bot <webkit.review.bot@gmail.com>
11480
11481 Unreviewed, rolling out r118868.
11482 http://trac.webkit.org/changeset/118868
11483 https://bugs.webkit.org/show_bug.cgi?id=87828
11484
11485 introduced ~20 crashes on Mac and Qt bots (Requested by pizlo_
11486 on #webkit).
11487
11488 * heap/Heap.cpp:
11489 (JSC::Heap::collect):
11490 * heap/MarkedBlock.cpp:
11491 (JSC::MarkedBlock::sweep):
11492 * heap/MarkedBlock.h:
11493 (JSC::MarkedBlock::sweepWeakSet):
11494 (JSC):
11495 * heap/MarkedSpace.cpp:
11496 (JSC::SweepWeakSet::operator()):
11497 (JSC):
11498 (JSC::MarkedSpace::sweepWeakSets):
11499 * heap/MarkedSpace.h:
11500 (MarkedSpace):
11501
ggaren@apple.com15344ae2012-05-30 01:05:35 +0000115022012-05-29 Geoffrey Garen <ggaren@apple.com>
11503
11504 Rolled back in r118646, now that
11505 https://bugs.webkit.org/show_bug.cgi?id=87784 is fixed.
11506
11507 http://trac.webkit.org/changeset/118646
11508 https://bugs.webkit.org/show_bug.cgi?id=87599
11509
11510 * heap/Heap.cpp:
11511 (JSC::Heap::collect):
11512 * heap/MarkedBlock.cpp:
11513 (JSC::MarkedBlock::sweep):
11514 * heap/MarkedBlock.h:
11515 (JSC):
11516 * heap/MarkedSpace.cpp:
11517 (JSC):
11518 * heap/MarkedSpace.h:
11519 (MarkedSpace):
11520
fpizlo@apple.com4c0875e2012-05-29 23:43:16 +0000115212012-05-29 Filip Pizlo <fpizlo@apple.com>
11522
11523 DFG should keep captured variables alive until the (inline) return.
11524 https://bugs.webkit.org/show_bug.cgi?id=87205
11525
11526 Reviewed by Gavin Barraclough.
11527
11528 Changes the way we do flushing for captured variables and arguments. Instead of flushing
11529 each SetLocal immediately, we flush at kill points. So a SetLocal will cause a Flush of
11530 whatever was live in the variable previously, and a return will cause a Flush of all
11531 captured variables and all arguments.
11532
11533 * dfg/DFGByteCodeParser.cpp:
11534 (JSC::DFG::ByteCodeParser::setDirect):
11535 (JSC::DFG::ByteCodeParser::set):
11536 (JSC::DFG::ByteCodeParser::setLocal):
11537 (JSC::DFG::ByteCodeParser::getArgument):
11538 (JSC::DFG::ByteCodeParser::setArgument):
11539 (JSC::DFG::ByteCodeParser::findArgumentPositionForArgument):
11540 (ByteCodeParser):
11541 (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
11542 (JSC::DFG::ByteCodeParser::findArgumentPosition):
11543 (JSC::DFG::ByteCodeParser::flush):
11544 (JSC::DFG::ByteCodeParser::flushDirect):
11545 (JSC::DFG::ByteCodeParser::flushArgumentsAndCapturedVariables):
11546 (JSC::DFG::ByteCodeParser::handleInlining):
11547 (JSC::DFG::ByteCodeParser::parseBlock):
11548 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
11549 * dfg/DFGCSEPhase.cpp:
11550 (JSC::DFG::CSEPhase::setLocalStoreElimination):
11551 (JSC::DFG::CSEPhase::performNodeCSE):
11552 * dfg/DFGSpeculativeJIT.cpp:
11553 (JSC::DFG::SpeculativeJIT::compile):
11554 * dfg/DFGSpeculativeJIT.h:
11555 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
11556
ggaren@apple.com7cc57362012-05-29 23:40:26 +0000115572012-05-29 Geoffrey Garen <ggaren@apple.com>
11558
11559 WeakGCMap should be lazy-finalization-safe
11560 https://bugs.webkit.org/show_bug.cgi?id=87784
11561
11562 Reviewed by Darin Adler.
11563
11564 * runtime/WeakGCMap.h:
11565 (JSC::WeakGCMap::get): Since this is a map of raw WeakImpl pointers, and
11566 not Weak<T>, we need to verify manually that the WeakImpl is live before
11567 we return its payload.
11568
mhahnenberg@apple.com7ea7e8f2012-05-29 18:38:14 +0000115692012-05-29 Mark Hahnenberg <mhahnenberg@apple.com>
11570
11571 CopiedSpace::doneCopying could start another collection
11572 https://bugs.webkit.org/show_bug.cgi?id=86538
11573
11574 Reviewed by Geoffrey Garen.
11575
11576 It's possible that if we don't have anything at the head of to-space
11577 after a collection and the BlockAllocator doesn't have any fresh blocks
11578 to give us right now we could start another collection while still in
11579 the middle of the first collection when we call CopiedSpace::addNewBlock().
11580
11581 One way to resolve this would be to have Heap::shouldCollect() check that
11582 m_operationInProgress is NoOperation. This would prevent the path in
11583 getFreshBlock() that starts the collection if we're already in the middle of one.
11584
11585 I could not come up with a test case to reproduce this crash on ToT.
11586
11587 * heap/Heap.h:
11588 (JSC::Heap::shouldCollect): We shouldn't collect if we're already in the middle
11589 of a collection, i.e. the current operation should be NoOperation.
11590
commit-queue@webkit.orgd5058402012-05-29 14:44:38 +0000115912012-05-29 David Barr <davidbarr@chromium.org>
11592
11593 Introduce ENABLE_CSS_IMAGE_RESOLUTION compile flag
11594 https://bugs.webkit.org/show_bug.cgi?id=87685
11595
11596 Reviewed by Eric Seidel.
11597
11598 Add a configuration option for CSS image-resolution support, disabling it by default.
11599
11600 * Configurations/FeatureDefines.xcconfig:
11601
commit-queue@webkit.org10c0df22012-05-29 03:24:49 +0000116022012-05-28 Sheriff Bot <webkit.review.bot@gmail.com>
11603
11604 Unreviewed, rolling out r118646.
11605 http://trac.webkit.org/changeset/118646
11606 https://bugs.webkit.org/show_bug.cgi?id=87691
11607
11608 broke V8 raytrace benchmark (Requested by pizlo_ on #webkit).
11609
11610 * heap/Heap.cpp:
11611 (JSC::Heap::collect):
11612 * heap/MarkedBlock.cpp:
11613 (JSC::MarkedBlock::sweep):
11614 * heap/MarkedBlock.h:
11615 (JSC::MarkedBlock::sweepWeakSet):
11616 (JSC):
11617 * heap/MarkedSpace.cpp:
11618 (JSC::SweepWeakSet::operator()):
11619 (JSC):
11620 (JSC::MarkedSpace::sweepWeakSets):
11621 * heap/MarkedSpace.h:
11622 (MarkedSpace):
11623
fpizlo@apple.com26ece8e2012-05-29 02:43:30 +0000116242012-05-28 Filip Pizlo <fpizlo@apple.com>
11625
11626 DFG should not generate code for code that the CFA proves to be unreachable
11627 https://bugs.webkit.org/show_bug.cgi?id=87682
11628
11629 Reviewed by Sam Weinig.
11630
11631 This also fixes a small performance bug where CFA was not marking blocks
11632 as having constants (and hence not triggering constant folding) if the only
11633 constants were on GetLocals.
11634
11635 And fixing that bug revealed another bug: constant folding was assuming that
11636 a GetLocal must be the first access to a local in a basic block. This isn't
11637 true. The first access may be a Flush. This patch fixes that issue using the
11638 safest approach possible, since we don't need to be clever for something that
11639 only happens in one of our benchmarks.
11640
11641 * dfg/DFGAbstractState.cpp:
11642 (JSC::DFG::AbstractState::execute):
11643 * dfg/DFGConstantFoldingPhase.cpp:
11644 (JSC::DFG::ConstantFoldingPhase::run):
11645 * dfg/DFGJITCompiler.h:
11646 (JSC::DFG::JITCompiler::noticeOSREntry):
11647 * dfg/DFGSpeculativeJIT.cpp:
11648 (JSC::DFG::SpeculativeJIT::compile):
11649
carlosgc@webkit.orgb69727c2012-05-28 10:21:31 +0000116502012-05-28 Carlos Garcia Campos <cgarcia@igalia.com>
11651
11652 Unreviewed. Fix make distcheck.
11653
11654 * GNUmakefile.list.am: Add missing header file.
11655
ggaren@apple.comb816d752012-05-28 04:56:01 +0000116562012-05-27 Geoffrey Garen <ggaren@apple.com>
11657
11658 Weak pointer finalization should be lazy
11659 https://bugs.webkit.org/show_bug.cgi?id=87599
11660
11661 Reviewed by Darin Adler.
11662
11663 * heap/Heap.cpp:
11664 (JSC::Heap::collect): Don't force immediate finalization -- it will
11665 happen lazily.
11666
11667 * heap/MarkedBlock.cpp:
11668 (JSC::MarkedBlock::sweep): Sweep a block's weak set when sweeping the
11669 block. The weak set may not have been swept yet, and this is our last
11670 chance to run weak finalizers before we recycle the memory they reference.
11671
11672 * heap/MarkedBlock.h:
11673 * heap/MarkedSpace.cpp:
11674 (JSC::MarkedBlock::sweepWeakSets):
11675 * heap/MarkedSpace.h:
11676 (JSC::MarkedSpace::sweepWeakSets): Nixed sweepWeakSets because it's unused
11677 now.
11678
ggaren@apple.com72da8112012-05-26 22:40:46 +0000116792012-05-26 Geoffrey Garen <ggaren@apple.com>
11680
11681 WebKit should be lazy-finalization-safe (esp. the DOM) v2
11682 https://bugs.webkit.org/show_bug.cgi?id=87581
11683
11684 Reviewed by Oliver Hunt.
11685
11686 * heap/MarkedBlock.cpp:
11687 (JSC::MarkedBlock::callDestructor):
11688 * heap/WeakBlock.h:
11689 * heap/WeakSetInlines.h:
11690 (JSC::WeakBlock::finalize): Since we don't guarantee destruction order,
11691 it's not valid to access GC pointers like the Structure pointer during
11692 finalization. We NULL out the structure pointer in debug builds to try
11693 to make this programming mistake more obvious.
11694
11695 * API/JSCallbackConstructor.cpp:
11696 (JSC::JSCallbackConstructor::destroy):
11697 * API/JSCallbackObject.cpp:
11698 (JSC::::destroy):
11699 (JSC::JSCallbackObjectData::finalize):
11700 * runtime/Arguments.cpp:
11701 (JSC::Arguments::destroy):
11702 * runtime/DateInstance.cpp:
11703 (JSC::DateInstance::destroy):
11704 * runtime/Error.cpp:
11705 (JSC::StrictModeTypeErrorFunction::destroy):
11706 * runtime/Executable.cpp:
11707 (JSC::ExecutableBase::destroy):
11708 (JSC::NativeExecutable::destroy):
11709 (JSC::ScriptExecutable::destroy):
11710 (JSC::EvalExecutable::destroy):
11711 (JSC::ProgramExecutable::destroy):
11712 (JSC::FunctionExecutable::destroy):
11713 * runtime/JSGlobalObject.cpp:
11714 (JSC::JSGlobalObject::destroy):
11715 * runtime/JSPropertyNameIterator.cpp:
11716 (JSC::JSPropertyNameIterator::destroy):
11717 * runtime/JSStaticScopeObject.cpp:
11718 (JSC::JSStaticScopeObject::destroy):
11719 * runtime/JSString.cpp:
11720 (JSC::JSString::destroy):
11721 * runtime/JSVariableObject.cpp:
11722 (JSC::JSVariableObject::destroy):
11723 * runtime/NameInstance.cpp:
11724 (JSC::NameInstance::destroy):
11725 * runtime/RegExp.cpp:
11726 (JSC::RegExp::destroy):
11727 * runtime/RegExpConstructor.cpp:
11728 (JSC::RegExpConstructor::destroy):
11729 * runtime/Structure.cpp:
11730 (JSC::Structure::destroy):
11731 * runtime/StructureChain.cpp:
11732 (JSC::StructureChain::destroy): Use static_cast instead of jsCast because
11733 jsCast does Structure-based validation, and our Structure is not guaranteed
11734 to be alive when we get finalized.
11735
fpizlo@apple.com7e0f6502012-05-25 22:45:57 +0000117362012-05-22 Filip Pizlo <fpizlo@apple.com>
11737
fpizlo@apple.com190f5252012-05-25 23:00:26 +000011738 DFG CSE should eliminate redundant WeakJSConstants
11739 https://bugs.webkit.org/show_bug.cgi?id=87179
11740
11741 Reviewed by Gavin Barraclough.
11742
11743 Merged r118141 from dfgopt.
11744
11745 * dfg/DFGCSEPhase.cpp:
11746 (JSC::DFG::CSEPhase::weakConstantCSE):
11747 (CSEPhase):
11748 (JSC::DFG::CSEPhase::performNodeCSE):
11749 * dfg/DFGNode.h:
11750 (JSC::DFG::Node::weakConstant):
11751
117522012-05-22 Filip Pizlo <fpizlo@apple.com>
11753
fpizlo@apple.com7e0f6502012-05-25 22:45:57 +000011754 DFG CSE should do redundant store elimination
11755 https://bugs.webkit.org/show_bug.cgi?id=87161
11756
11757 Reviewed by Oliver Hunt.
11758
11759 Merge r118138 from dfgopt.
11760
11761 This patch adds redundant store elimination. For example, consider this
11762 code:
11763
11764 o.x = 42;
11765 o.x = 84;
11766
11767 If o.x is speculated to be a well-behaved field, the first assignment is
11768 unnecessary, since the second just overwrites it. We would like to
11769 eliminate the first assignment in these cases. The need for this
11770 optimization arises mostly from stores that our runtime requires. For
11771 example:
11772
11773 o = {f:1, g:2, h:3};
11774
11775 This will have four assignments to the structure for the newly created
11776 object - one assignment for the empty structure, one for {f}, one for
11777 {f, g}, and one for {f, g, h}. We would like to only have the last of
11778 those assigments in this case.
11779
11780 Intriguingly, doing so for captured variables breaks the way arguments
11781 simplification used to work. Consider that prior to either arguments
11782 simplification or store elimination we will have IR that looks like:
11783
11784 a: SetLocal(r0, Empty)
11785 b: SetLocal(r1, Empty)
11786 c: GetLocal(r0)
11787 d: CreateArguments(@c)
11788 e: SetLocal(r0, @d)
11789 f: SetLocal(r1, @d)
11790
11791 Then redundant store elimination will eliminate the stores that
11792 initialize the arguments registers to Empty, but then arguments
11793 simplification eliminates the stores that initialize the arguments to
11794 the newly created arguments - and at this point we no longer have any
11795 stores to the arguments register, leading to hilarious crashes. This
11796 patch therefore changes arguments simplification to replace
11797 CreateArguments with JSConstant(Empty) rather than eliminating the
11798 SetLocals. But this revealed bugs where arguments simplification was
11799 being overzealous, so I fixed those bugs.
11800
11801 This is a minor speed-up on V8/early and a handful of other tests.
11802
11803 * bytecode/CodeBlock.h:
11804 (JSC::CodeBlock::uncheckedActivationRegister):
11805 * dfg/DFGAbstractState.cpp:
11806 (JSC::DFG::AbstractState::execute):
11807 * dfg/DFGArgumentsSimplificationPhase.cpp:
11808 (JSC::DFG::ArgumentsSimplificationPhase::run):
11809 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
11810 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
11811 (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
11812 * dfg/DFGCSEPhase.cpp:
11813 (JSC::DFG::CSEPhase::globalVarStoreElimination):
11814 (CSEPhase):
11815 (JSC::DFG::CSEPhase::putStructureStoreElimination):
11816 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
11817 (JSC::DFG::CSEPhase::setLocalStoreElimination):
11818 (JSC::DFG::CSEPhase::setReplacement):
11819 (JSC::DFG::CSEPhase::eliminate):
11820 (JSC::DFG::CSEPhase::performNodeCSE):
11821 * dfg/DFGGraph.h:
11822 (JSC::DFG::Graph::uncheckedActivationRegisterFor):
11823 (Graph):
11824 * dfg/DFGNode.h:
11825 (JSC::DFG::Node::isPhantomArguments):
11826 (Node):
11827 (JSC::DFG::Node::hasConstant):
11828 (JSC::DFG::Node::valueOfJSConstant):
11829 (JSC::DFG::Node::hasStructureTransitionData):
11830 * dfg/DFGNodeType.h:
11831 (DFG):
11832 * dfg/DFGPredictionPropagationPhase.cpp:
11833 (JSC::DFG::PredictionPropagationPhase::propagate):
11834 * dfg/DFGSpeculativeJIT.cpp:
11835 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
11836 * dfg/DFGSpeculativeJIT32_64.cpp:
11837 (JSC::DFG::SpeculativeJIT::compile):
11838 * dfg/DFGSpeculativeJIT64.cpp:
11839 (JSC::DFG::SpeculativeJIT::compile):
11840
fpizlo@apple.com016fd682012-05-25 20:19:55 +0000118412012-05-21 Filip Pizlo <fpizlo@apple.com>
11842
11843 DFG ConvertThis should just be a CheckStructure if the structure is known
11844 https://bugs.webkit.org/show_bug.cgi?id=87057
11845
11846 Reviewed by Gavin Barraclough.
11847
11848 Merged r118021 from dfgopt.
11849
11850 This gives ValueProfile the ability to track singleton values - i.e. profiling
11851 sites that always see the same value.
11852
11853 That is then used to profile the structure in op_convert_this.
11854
11855 This is then used to optimize op_convert_this into a CheckStructure if the
11856 structure is always the same.
11857
11858 That then results in better CSE in inlined code that uses 'this', since
11859 previously we couldn't CSE accesses on 'this' from different inline call frames.
11860
11861 Also fixed a bug where we were unnecessarily flushing 'this'.
11862
11863 * bytecode/CodeBlock.cpp:
11864 (JSC::CodeBlock::dump):
11865 (JSC::CodeBlock::stronglyVisitStrongReferences):
11866 * bytecode/LazyOperandValueProfile.cpp:
11867 (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):
11868 * bytecode/LazyOperandValueProfile.h:
11869 (CompressedLazyOperandValueProfileHolder):
11870 * bytecode/Opcode.h:
11871 (JSC):
11872 (JSC::padOpcodeName):
11873 * bytecode/ValueProfile.h:
11874 (JSC::ValueProfileBase::ValueProfileBase):
11875 (JSC::ValueProfileBase::dump):
11876 (JSC::ValueProfileBase::computeUpdatedPrediction):
11877 (ValueProfileBase):
11878 * bytecompiler/BytecodeGenerator.cpp:
11879 (JSC::BytecodeGenerator::BytecodeGenerator):
11880 * dfg/DFGByteCodeParser.cpp:
11881 (JSC::DFG::ByteCodeParser::setArgument):
11882 (JSC::DFG::ByteCodeParser::parseBlock):
11883 * jit/JITOpcodes.cpp:
11884 (JSC::JIT::emit_op_convert_this):
11885 (JSC::JIT::emitSlow_op_convert_this):
11886 * jit/JITOpcodes32_64.cpp:
11887 (JSC::JIT::emit_op_convert_this):
11888 (JSC::JIT::emitSlow_op_convert_this):
11889 * llint/LLIntSlowPaths.cpp:
11890 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
11891 * llint/LowLevelInterpreter32_64.asm:
11892 * llint/LowLevelInterpreter64.asm:
11893 * runtime/JSValue.h:
11894 (JSValue):
11895 * runtime/Structure.h:
11896 (JSC::JSValue::structureOrUndefined):
11897 (JSC):
11898
timothy_horton@apple.com3f03ac12012-05-25 06:53:27 +0000118992012-05-24 Tim Horton <timothy_horton@apple.com>
11900
11901 Add feature defines for web-facing parts of CSS Regions and Exclusions
11902 https://bugs.webkit.org/show_bug.cgi?id=87442
11903 <rdar://problem/10887709>
11904
11905 Reviewed by Dan Bernstein.
11906
11907 * Configurations/FeatureDefines.xcconfig:
11908
ggaren@apple.com9e1789f2012-05-25 06:52:00 +0000119092012-05-24 Geoffrey Garen <ggaren@apple.com>
11910
11911 WebKit should be lazy-finalization-safe (esp. the DOM)
11912 https://bugs.webkit.org/show_bug.cgi?id=87456
11913
11914 Reviewed by Filip Pizlo.
11915
11916 Lazy finalization adds one twist to weak pointer use:
11917
11918 A HashMap of weak pointers may contain logically null entries.
11919 (Weak pointers behave as-if null once their payloads die.)
11920 Insertion must not assume that a pre-existing entry is
11921 necessarily valid, and iteration must not assume that all
11922 entries can be dereferenced.
11923
11924 (Previously, I thought that it also added a second twist:
11925
11926 A demand-allocated weak pointer may replace a dead payload
11927 before the payload's finalizer runs. In that case, when the
11928 payload's finalizer runs, the payload has already been
11929 overwritten, and the finalizer should not clear the payload,
11930 which now points to something new.
11931
11932 But that's not the case here, since we cancel the old payload's
11933 finalizer when we over-write it. I've added ASSERTs to verify this
11934 assumption, in case it ever changes.)
11935
11936 * API/JSClassRef.cpp:
11937 (OpaqueJSClass::prototype): No need to specify null; that's the default.
11938
11939 * API/JSWeakObjectMapRefPrivate.cpp: Use remove, since take() is gone.
11940
11941 * heap/PassWeak.h:
11942 (WeakImplAccessor::was): This is no longer a debug-only function, since
11943 it's required to reason about lazily finalized pointers.
11944
11945 * heap/Weak.h:
11946 (JSC::weakAdd):
11947 (JSC::weakRemove):
11948 (JSC::weakClear): Added these helper functions for the common idioms of
11949 what clients want to do in their weak pointer finalizers.
11950
11951 * jit/JITStubs.cpp:
11952 (JSC::JITThunks::hostFunctionStub): Use the new idioms. Otherwise, we
11953 would return NULL for a "zombie" executable weak pointer that was waiting
11954 for finalization (item (2)), and finalizing a dead executable weak pointer
11955 would potentially destroy a new, live one (item (1)).
11956
11957 * runtime/RegExpCache.cpp:
11958 (JSC::RegExpCache::lookupOrCreate):
11959 (JSC::RegExpCache::finalize): Ditto.
11960
11961 (JSC::RegExpCache::invalidateCode): Check for null while iterating. (See
11962 item (2).)
11963
11964 * runtime/Structure.cpp:
11965 (JSC::StructureTransitionTable::contains):
11966 (JSC::StructureTransitionTable::add): Use get and set instead of add and
11967 contains, since add and contains are not compatible with lazy finalization.
11968
11969 * runtime/WeakGCMap.h:
11970 (WeakGCMap):
11971 (JSC::WeakGCMap::clear):
11972 (JSC::WeakGCMap::remove): Removed a bunch of code that was incompatible with
11973 lazy finalization because I didn't feel like making it compatible, and I had
11974 no way to test it.
11975
fpizlo@apple.com0b9b37a2012-05-25 03:29:18 +0000119762012-05-24 Filip Pizlo <fpizlo@apple.com>
11977
fpizlo@apple.com9d899a42012-05-25 05:41:03 +000011978 REGRESSION (r118013-r118031): Loops/Reloads under www.yahoo.com, quits after three tries with error
11979 https://bugs.webkit.org/show_bug.cgi?id=87327
11980
11981 Reviewed by Geoffrey Garen.
11982
11983 If you use AbstractValue::filter(StructureSet) to test subset relationships between TOP and a
11984 set containing >=2 elements, you're going to have a bad time.
11985
11986 That's because AbstractValue considers a set with >=2 elements to be equivalent to TOP, in order
11987 to save space and speed up convergence. So filtering has no effect in this case, which made
11988 the code think that the abstract value was proving that the structure check was unnecessary.
11989 The correct thing to do is to use isSubsetOf() on the StructureAbstractValue, which does the
11990 right thingies for TOP and >=2 elements.
11991
11992 * dfg/DFGAbstractState.cpp:
11993 (JSC::DFG::AbstractState::execute):
11994 * dfg/DFGSpeculativeJIT32_64.cpp:
11995 (JSC::DFG::SpeculativeJIT::compile):
11996 * dfg/DFGSpeculativeJIT64.cpp:
11997 (JSC::DFG::SpeculativeJIT::compile):
11998
119992012-05-24 Filip Pizlo <fpizlo@apple.com>
12000
fpizlo@apple.com0b9b37a2012-05-25 03:29:18 +000012001 new test fast/js/dfg-arguments-mixed-alias.html fails on JSVALUE32_64
12002 https://bugs.webkit.org/show_bug.cgi?id=87378
12003
12004 Reviewed by Gavin Barraclough.
12005
12006 - Captured variable tracking forgot did not consistently handle arguments, leading to OSR
12007 badness.
12008
12009 - Nodes capable of exiting were tracked in a non-monotonic way, leading to compiler errors.
12010
12011 * dfg/DFGByteCodeParser.cpp:
12012 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12013 * dfg/DFGCSEPhase.cpp:
12014 (JSC::DFG::CSEPhase::CSEPhase):
12015 (CSEPhase):
12016 (JSC::DFG::performCSE):
12017 * dfg/DFGCSEPhase.h:
12018 (DFG):
12019 * dfg/DFGCommon.h:
12020 * dfg/DFGDriver.cpp:
12021 (JSC::DFG::compile):
12022 * dfg/DFGGraph.cpp:
12023 (JSC::DFG::Graph::resetExitStates):
12024 (DFG):
12025 * dfg/DFGGraph.h:
12026 (Graph):
12027 * dfg/DFGPhase.h:
12028 (DFG):
12029 (JSC::DFG::runPhase):
12030
ggaren@apple.com39281e22012-05-24 21:18:10 +0000120312012-05-24 Geoffrey Garen <ggaren@apple.com>
12032
12033 Made WeakSet per-block instead of per-heap
12034 https://bugs.webkit.org/show_bug.cgi?id=87401
12035
12036 Reviewed by Oliver Hunt.
12037
12038 This allows us fast access to the set of all weak pointers for a block,
12039 which is a step toward lazy finalization.
12040
12041 No performance change.
12042
12043 * heap/Heap.cpp:
12044 (JSC::Heap::Heap):
12045 (JSC::Heap::lastChanceToFinalize): Removed the per-heap weak set, since
12046 it's per-block now.
12047
12048 (JSC::Heap::markRoots): Delegate weak set visiting to the marked space,
12049 since it knows how to iterate all blocks.
12050
12051 (JSC::Heap::collect): Moved the reaping outside of markRoots, since it
12052 doesn't mark anything.
12053
12054 Make sure to reset allocators after shrinking, since shrinking may
12055 deallocate the current allocator.
12056
12057 * heap/Heap.h:
12058 (Heap): No more per-heap weak set, since it's per-block now.
12059
12060 * heap/MarkedBlock.cpp:
12061 (JSC::MarkedBlock::MarkedBlock):
12062 * heap/MarkedBlock.h:
12063 (MarkedBlock):
12064 (JSC::MarkedBlock::lastChanceToFinalize): Migrated finalization logic
12065 here from the heap, so the heap doesn't need to know about our internal
12066 data structures like our weak set.
12067
12068 (JSC::MarkedBlock::heap):
12069 (JSC::MarkedBlock::weakSet):
12070 (JSC::MarkedBlock::shrink):
12071 (JSC::MarkedBlock::resetAllocator):
12072 (JSC::MarkedBlock::visitWeakSet):
12073 (JSC::MarkedBlock::reapWeakSet):
12074 (JSC::MarkedBlock::sweepWeakSet):
12075 * heap/MarkedSpace.cpp:
12076 (JSC::VisitWeakSet::VisitWeakSet):
12077 (JSC::VisitWeakSet::operator()):
12078 (VisitWeakSet):
12079 (JSC):
12080 (JSC::ReapWeakSet::operator()):
12081 (JSC::SweepWeakSet::operator()):
12082 (JSC::LastChanceToFinalize::operator()):
12083 (JSC::MarkedSpace::lastChanceToFinalize):
12084 (JSC::ResetAllocator::operator()):
12085 (JSC::MarkedSpace::resetAllocators):
12086 (JSC::MarkedSpace::visitWeakSets):
12087 (JSC::MarkedSpace::reapWeakSets):
12088 (JSC::MarkedSpace::sweepWeakSets):
12089 (JSC::Shrink::operator()):
12090 (JSC::MarkedSpace::shrink):
12091 * heap/MarkedSpace.h:
12092 (MarkedSpace): Make sure to account for our weak sets when sweeping,
12093 shrinking, etc.
12094
12095 * heap/WeakSet.cpp:
12096 (JSC):
12097 * heap/WeakSet.h:
12098 (WeakSet):
12099 (JSC::WeakSet::heap):
12100 (JSC):
12101 (JSC::WeakSet::lastChanceToFinalize):
12102 (JSC::WeakSet::visit):
12103 (JSC::WeakSet::reap):
12104 (JSC::WeakSet::shrink):
12105 (JSC::WeakSet::resetAllocator): Inlined some things since they're called
12106 once per block now instead of once per heap.
12107
12108 * heap/WeakSetInlines.h:
12109 (JSC::WeakSet::allocate): Use the per-block weak set since there is no
12110 per-heap weak set anymore.
12111
barraclough@apple.comefdbf472012-05-24 21:14:07 +0000121122012-05-24 Gavin Barraclough <barraclough@apple.com>
12113
barraclough@apple.com8ca6a7a2012-05-24 21:17:38 +000012114 Fix arm build
12115
12116 Rubber stamped by Geoff Garen
12117
12118 * dfg/DFGGPRInfo.h:
12119 (GPRInfo):
12120
121212012-05-24 Gavin Barraclough <barraclough@apple.com>
12122
barraclough@apple.comefdbf472012-05-24 21:14:07 +000012123 Move cacheFlush from ExecutableAllocator to Assembler classes
12124 https://bugs.webkit.org/show_bug.cgi?id=87420
12125
12126 Reviewed by Oliver Hunt.
12127
12128 Makes more sense there, & remove a pile of #ifdefs.
12129
12130 * assembler/ARMAssembler.cpp:
12131 (JSC):
12132 (JSC::ARMAssembler::cacheFlush):
12133 * assembler/ARMAssembler.h:
12134 (ARMAssembler):
12135 (JSC::ARMAssembler::cacheFlush):
12136 * assembler/ARMv7Assembler.h:
12137 (JSC::ARMv7Assembler::relinkJump):
12138 (JSC::ARMv7Assembler::cacheFlush):
12139 (ARMv7Assembler):
12140 (JSC::ARMv7Assembler::setInt32):
12141 (JSC::ARMv7Assembler::setUInt7ForLoad):
12142 * assembler/AbstractMacroAssembler.h:
12143 (JSC::AbstractMacroAssembler::cacheFlush):
12144 * assembler/LinkBuffer.h:
12145 (JSC::LinkBuffer::performFinalization):
12146 * assembler/MIPSAssembler.h:
12147 (JSC::MIPSAssembler::relinkJump):
12148 (JSC::MIPSAssembler::relinkCall):
12149 (JSC::MIPSAssembler::repatchInt32):
12150 (JSC::MIPSAssembler::cacheFlush):
12151 (MIPSAssembler):
12152 * assembler/SH4Assembler.h:
12153 (JSC::SH4Assembler::repatchCompact):
12154 (JSC::SH4Assembler::cacheFlush):
12155 (SH4Assembler):
12156 * assembler/X86Assembler.h:
12157 (X86Assembler):
12158 (JSC::X86Assembler::cacheFlush):
12159 * jit/ExecutableAllocator.cpp:
12160 (JSC):
12161 * jit/ExecutableAllocator.h:
12162 (ExecutableAllocator):
12163
commit-queue@webkit.org2c8bcde2012-05-24 20:01:53 +0000121642012-05-24 John Mellor <johnme@chromium.org>
12165
12166 Font Boosting: Add compile flag and runtime setting
12167 https://bugs.webkit.org/show_bug.cgi?id=87394
12168
12169 Reviewed by Adam Barth.
12170
12171 Add ENABLE_FONT_BOOSTING.
12172
12173 * Configurations/FeatureDefines.xcconfig:
12174
commit-queue@webkit.orgd553c622012-05-24 10:50:40 +0000121752012-05-24 Allan Sandfeld Jensen <allan.jensen@nokia.com>
12176
12177 cti_vm_throw gets kicked out by gcc 4.6 -flto
12178 https://bugs.webkit.org/show_bug.cgi?id=56088
12179
12180 Reviewed by Darin Adler.
12181
12182 Add REFERENCED_FROM_ASM to functions only referenced from assembler.
12183
12184 * dfg/DFGOperations.cpp:
12185 * jit/HostCallReturnValue.h:
12186 * jit/JITStubs.h:
12187 * jit/ThunkGenerators.cpp:
12188
fpizlo@apple.com36f14462012-05-24 07:35:05 +0000121892012-05-24 Filip Pizlo <fpizlo@apple.com>
12190
12191 Incorrect merge of r117542 from dfg opt branch in r118323 is leading to fast/js/dfg-arguments-osr-exit.html failing
12192 https://bugs.webkit.org/show_bug.cgi?id=87350
12193
12194 Reviewed by Maciej Stachowiak.
12195
12196 The dfgopt branch introduced the notion of a local variable being killed because it was aliased
12197 to the Arguments object as in cases like:
12198
12199 var a = arguments;
12200 return a.length;
12201
12202 This required changes to OSR exit handling - if the variable is dead but aliased to arguments, then
12203 OSR exit should reify the arguments. But meanwhile, in tip of tree we introduced special handling for
12204 dead variables on OSR exit. When the two were merged in r118323, the structure of the if/else branches
12205 ended up being such that we would treat dead arguments variables as totally dead as opposed to treating
12206 them as variables that need arguments reification.
12207
12208 This fixes the structure of the relevant if/else block so that variables that are dead-but-arguments
12209 end up being treated as reified arguments objects, while variables that are dead but not aliased to
12210 arguments are treated as tip of tree would have treated them (initialize to Undefined).
12211
12212 * dfg/DFGSpeculativeJIT.cpp:
12213 (JSC::DFG::SpeculativeJIT::compile):
12214
ossy@webkit.orgbc0d6372012-05-24 07:05:31 +0000122152012-05-24 Csaba Osztrogonác <ossy@webkit.org>
12216
12217 Unreviewed 32 bit buildfix after r118325.
12218
12219 * dfg/DFGSpeculativeJIT32_64.cpp:
12220 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): Use ASSERT_UNUSED instead ASSERT.
12221
fpizlo@apple.comd96eb4e2012-05-24 06:58:52 +0000122222012-05-23 Filip Pizlo <fpizlo@apple.com>
12223
fpizlo@apple.comb3ac2422012-05-24 07:00:24 +000012224 DFG operationTearOffActivation should return after handling the null activation case
12225 https://bugs.webkit.org/show_bug.cgi?id=87348
12226 <rdar://problem/11522295>
12227
12228 Reviewed by Oliver Hunt.
12229
12230 * dfg/DFGOperations.cpp:
12231
122322012-05-23 Filip Pizlo <fpizlo@apple.com>
12233
fpizlo@apple.comd96eb4e2012-05-24 06:58:52 +000012234 Unreviewed, merge the arguments fix in r118138 to get bots green.
12235
12236 * dfg/DFGArgumentsSimplificationPhase.cpp:
12237 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
12238
fpizlo@apple.comb9c94622012-05-24 05:51:05 +0000122392012-05-20 Filip Pizlo <fpizlo@apple.com>
12240
fpizlo@apple.com91b2c682012-05-24 06:24:36 +000012241 DFG CFA should record if a node can OSR exit
12242 https://bugs.webkit.org/show_bug.cgi?id=86905
12243
12244 Reviewed by Oliver Hunt.
12245
12246 Merged r117931 from dfgopt.
12247
12248 Adds a NodeFlag that denotes nodes that are known to not have OSR exits.
12249 This ought to aid any backwards analyses that need to know when a
12250 backward flow merge might happen due to a side exit.
12251
12252 Also added assertions into speculationCheck() that ensure that we did not
12253 mark a node as non-exiting and then promptly compile in an exit. This
12254 helped catch some minor bugs where we were doing unnecessary speculation
12255 checks.
12256
12257 This is a perf-neutral change. The speculation checks that this removes
12258 were not on hot paths of major benchmarks.
12259
12260 * bytecode/PredictedType.h:
12261 (JSC):
12262 (JSC::isAnyPrediction):
12263 * dfg/DFGAbstractState.cpp:
12264 (JSC::DFG::AbstractState::execute):
12265 * dfg/DFGAbstractState.h:
12266 (JSC::DFG::AbstractState::speculateInt32Unary):
12267 (AbstractState):
12268 (JSC::DFG::AbstractState::speculateNumberUnary):
12269 (JSC::DFG::AbstractState::speculateBooleanUnary):
12270 (JSC::DFG::AbstractState::speculateInt32Binary):
12271 (JSC::DFG::AbstractState::speculateNumberBinary):
12272 * dfg/DFGNode.h:
12273 (JSC::DFG::Node::mergeFlags):
12274 (JSC::DFG::Node::filterFlags):
12275 (Node):
12276 (JSC::DFG::Node::setCanExit):
12277 (JSC::DFG::Node::canExit):
12278 * dfg/DFGNodeFlags.cpp:
12279 (JSC::DFG::nodeFlagsAsString):
12280 * dfg/DFGNodeFlags.h:
12281 (DFG):
12282 * dfg/DFGSpeculativeJIT.cpp:
12283 (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
12284 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
12285 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
12286 * dfg/DFGSpeculativeJIT.h:
12287 (JSC::DFG::SpeculativeJIT::speculationCheck):
12288 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
12289 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
12290 (SpeculativeJIT):
12291 * dfg/DFGSpeculativeJIT32_64.cpp:
12292 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
12293 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
12294 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
12295 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
12296 (JSC::DFG::SpeculativeJIT::compile):
12297 * dfg/DFGSpeculativeJIT64.cpp:
12298 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
12299 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
12300 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
12301 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
12302 (JSC::DFG::SpeculativeJIT::compile):
12303
123042012-05-20 Filip Pizlo <fpizlo@apple.com>
12305
fpizlo@apple.comb9c94622012-05-24 05:51:05 +000012306 DFG should not do unnecessary indirections when storing to objects
12307 https://bugs.webkit.org/show_bug.cgi?id=86959
12308
12309 Reviewed by Oliver Hunt.
12310
12311 Merged r117819 from dfgopt.
12312
12313 * dfg/DFGByteCodeParser.cpp:
12314 (JSC::DFG::ByteCodeParser::parseBlock):
12315 * dfg/DFGCSEPhase.cpp:
12316 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
12317 * dfg/DFGSpeculativeJIT32_64.cpp:
12318 (JSC::DFG::SpeculativeJIT::compile):
12319 * dfg/DFGSpeculativeJIT64.cpp:
12320 (JSC::DFG::SpeculativeJIT::compile):
12321
fpizlo@apple.com9a548f12012-05-24 05:33:09 +0000123222012-05-17 Filip Pizlo <fpizlo@apple.com>
12323
12324 DFG should optimize aliased uses of the Arguments object of the current call frame
12325 https://bugs.webkit.org/show_bug.cgi?id=86552
12326
12327 Reviewed by Geoff Garen.
12328
12329 Merged r117542 and r117543 from dfgopt.
12330
12331 Performs must-alias and escape analysis on uses of CreateArguments, and if
12332 a variable is must-aliased to CreateArguments and does not escape, then we
12333 turn all uses of that variable into direct arguments accesses.
12334
12335 36% speed-up on V8/earley leading to a 2.3% speed-up overall in V8.
12336
12337 * bytecode/CodeBlock.h:
12338 (JSC::CodeBlock::uncheckedArgumentsRegister):
12339 * bytecode/ValueRecovery.h:
12340 (JSC::ValueRecovery::argumentsThatWereNotCreated):
12341 (ValueRecovery):
12342 (JSC::ValueRecovery::dump):
12343 * dfg/DFGAbstractState.cpp:
12344 (JSC::DFG::AbstractState::execute):
12345 * dfg/DFGAdjacencyList.h:
12346 (AdjacencyList):
12347 (JSC::DFG::AdjacencyList::removeEdgeFromBag):
12348 * dfg/DFGArgumentsSimplificationPhase.cpp:
12349 (JSC::DFG::ArgumentsSimplificationPhase::run):
12350 (ArgumentsSimplificationPhase):
12351 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
12352 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
12353 (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
12354 (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
12355 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
12356 * dfg/DFGAssemblyHelpers.h:
12357 (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
12358 (AssemblyHelpers):
12359 * dfg/DFGByteCodeParser.cpp:
12360 (JSC::DFG::ByteCodeParser::parseBlock):
12361 * dfg/DFGCFGSimplificationPhase.cpp:
12362 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
12363 * dfg/DFGGPRInfo.h:
12364 (GPRInfo):
12365 * dfg/DFGGraph.cpp:
12366 (JSC::DFG::Graph::collectGarbage):
12367 (DFG):
12368 * dfg/DFGGraph.h:
12369 (Graph):
12370 (JSC::DFG::Graph::executableFor):
12371 (JSC::DFG::Graph::argumentsRegisterFor):
12372 (JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
12373 (JSC::DFG::Graph::clobbersWorld):
12374 * dfg/DFGNode.h:
12375 (JSC::DFG::Node::hasHeapPrediction):
12376 * dfg/DFGNodeType.h:
12377 (DFG):
12378 * dfg/DFGOSRExitCompiler.cpp:
12379 * dfg/DFGOSRExitCompiler.h:
12380 (JSC::DFG::OSRExitCompiler::OSRExitCompiler):
12381 (OSRExitCompiler):
12382 * dfg/DFGOSRExitCompiler32_64.cpp:
12383 (JSC::DFG::OSRExitCompiler::compileExit):
12384 * dfg/DFGOSRExitCompiler64.cpp:
12385 (JSC::DFG::OSRExitCompiler::compileExit):
12386 * dfg/DFGOperations.cpp:
12387 * dfg/DFGPredictionPropagationPhase.cpp:
12388 (JSC::DFG::PredictionPropagationPhase::propagate):
12389 * dfg/DFGSpeculativeJIT.cpp:
12390 (JSC::DFG::ValueSource::dump):
12391 (JSC::DFG::SpeculativeJIT::compile):
12392 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
12393 * dfg/DFGSpeculativeJIT.h:
12394 * dfg/DFGSpeculativeJIT32_64.cpp:
12395 (JSC::DFG::SpeculativeJIT::compile):
12396 * dfg/DFGSpeculativeJIT64.cpp:
12397 (JSC::DFG::SpeculativeJIT::compile):
12398 * dfg/DFGVariableAccessData.h:
12399 (JSC::DFG::VariableAccessData::VariableAccessData):
12400 (JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
12401 (VariableAccessData):
12402 (JSC::DFG::VariableAccessData::isArgumentsAlias):
12403 * jit/JITOpcodes.cpp:
12404 (JSC::JIT::emitSlow_op_get_argument_by_val):
12405
fpizlo@apple.comdb7ba192012-05-24 02:28:52 +0000124062012-05-23 Filip Pizlo <fpizlo@apple.com>
12407
fpizlo@apple.comae3413b2012-05-24 02:34:09 +000012408 DFGCapabilities should not try to get an arguments register from code blocks that don't have one
12409 https://bugs.webkit.org/show_bug.cgi?id=87332
12410
12411 Reviewed by Andy Estes.
12412
12413 * dfg/DFGCapabilities.h:
12414 (JSC::DFG::canInlineOpcode):
12415
124162012-05-23 Filip Pizlo <fpizlo@apple.com>
12417
fpizlo@apple.comdb7ba192012-05-24 02:28:52 +000012418 DFG should have sparse conditional constant propagation
12419 https://bugs.webkit.org/show_bug.cgi?id=86580
12420
12421 Reviewed by Oliver Hunt.
12422
12423 Merged r117370 from dfgopt.
12424
12425 This enhances CFA so that if it suspects at any point during the fixpoint that a
12426 branch will only go one way, then it only propagates in that one way.
12427
12428 This vastly increases the opportunities for CFG simplification. For example, it
12429 enables us to evaporate this loop:
12430
12431 for (var i = 0; i < 1; ++i) doThings(i);
12432
12433 As a result, it uncovered loads of bugs in the CFG simplifier. In particular:
12434
12435 - Phi fixup was assuming that all Phis worth fixing up are shouldGenerate().
12436 That's not true; we also fixup Phis that are dead.
12437
12438 - GetLocal fixup was assuming that it's only necessary to rewire links to a
12439 GetLocal, and that the GetLocal's own links don't need to be rewired. Untrue,
12440 because the GetLocal may not be rewirable (first block has no GetLocal for r42
12441 but second block does have a GetLocal), in which case it will refer to a Phi
12442 in the second block. We need it to refer to a Phi from the first block to
12443 ensure that subsequent transformations work.
12444
12445 - Tail operand fixup was ignoring the fact that Phis in successors may contain
12446 references to the children of our tail variables. Hence, successor Phi child
12447 substitution needs to use the original second block variable table as its
12448 prior, rather than trying to reconstruct the prior later (since by that point
12449 the children of the second block's tail variables will have been fixed up, so
12450 we will not know what the prior would have been).
12451
12452 * dfg/DFGAbstractState.cpp:
12453 (JSC::DFG::AbstractState::beginBasicBlock):
12454 (JSC::DFG::AbstractState::endBasicBlock):
12455 (JSC::DFG::AbstractState::reset):
12456 (JSC::DFG::AbstractState::execute):
12457 (JSC::DFG::AbstractState::mergeToSuccessors):
12458 * dfg/DFGAbstractState.h:
12459 (JSC::DFG::AbstractState::branchDirectionToString):
12460 (AbstractState):
12461 * dfg/DFGCFGSimplificationPhase.cpp:
12462 (JSC::DFG::CFGSimplificationPhase::run):
12463 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
12464 (JSC::DFG::CFGSimplificationPhase::OperandSubstitution::OperandSubstitution):
12465 (OperandSubstitution):
12466 (JSC::DFG::CFGSimplificationPhase::skipGetLocal):
12467 (JSC::DFG::CFGSimplificationPhase::recordPossibleIncomingReference):
12468 (CFGSimplificationPhase):
12469 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12470 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
12471 * dfg/DFGGraph.h:
12472 (JSC::DFG::Graph::changeEdge):
12473
ojan@chromium.org959e4a22012-05-24 02:03:04 +0000124742012-05-23 Ojan Vafai <ojan@chromium.org>
12475
12476 add back the ability to disable flexbox
12477 https://bugs.webkit.org/show_bug.cgi?id=87147
12478
12479 Reviewed by Tony Chang.
12480
12481 * Configurations/FeatureDefines.xcconfig:
12482
fpizlo@apple.com9b928722012-05-24 00:18:55 +0000124832012-05-23 Filip Pizlo <fpizlo@apple.com>
12484
fpizlo@apple.com16faaea2012-05-24 01:04:55 +000012485 Unreviewed, fix Windows build.
12486
12487 * bytecode/CodeBlock.h:
12488 * dfg/DFGCapabilities.h:
12489 (JSC::DFG::canCompileOpcode):
12490 (JSC::DFG::canCompileOpcodes):
12491 * dfg/DFGCommon.h:
12492 (DFG):
12493
124942012-05-23 Filip Pizlo <fpizlo@apple.com>
12495
fpizlo@apple.com9b928722012-05-24 00:18:55 +000012496 DFG should optimize inlined uses of arguments.length and arguments[i]
12497 https://bugs.webkit.org/show_bug.cgi?id=86327
12498
12499 Reviewed by Gavin Barraclough.
12500
12501 Merged r117017 from dfgopt.
12502
12503 Turns inlined uses of arguments.length into a constant.
12504
12505 Turns inlined uses of arguments[constant] into a direct reference to the
12506 argument.
12507
12508 Big win on micro-benchmarks. Not yet a win on V8 because the hot uses of
12509 arguments.length and arguments[i] are aliased. I'll leave the aliasing
12510 optimizations to a later patch.
12511
12512 * CMakeLists.txt:
12513 * GNUmakefile.list.am:
12514 * JavaScriptCore.xcodeproj/project.pbxproj:
12515 * Target.pri:
12516 * bytecode/DFGExitProfile.h:
12517 (FrequentExitSite):
12518 (JSC::DFG::FrequentExitSite::FrequentExitSite):
12519 (JSC::DFG::QueryableExitProfile::hasExitSite):
12520 (QueryableExitProfile):
12521 * dfg/DFGAbstractState.cpp:
12522 (JSC::DFG::AbstractState::execute):
12523 * dfg/DFGArgumentsSimplificationPhase.cpp: Added.
12524 (DFG):
12525 (ArgumentsSimplificationPhase):
12526 (JSC::DFG::ArgumentsSimplificationPhase::ArgumentsSimplificationPhase):
12527 (JSC::DFG::ArgumentsSimplificationPhase::run):
12528 (JSC::DFG::performArgumentsSimplification):
12529 * dfg/DFGArgumentsSimplificationPhase.h: Added.
12530 (DFG):
12531 * dfg/DFGAssemblyHelpers.cpp:
12532 (JSC::DFG::AssemblyHelpers::executableFor):
12533 (DFG):
12534 * dfg/DFGAssemblyHelpers.h:
12535 (AssemblyHelpers):
12536 * dfg/DFGByteCodeParser.cpp:
12537 (JSC::DFG::ByteCodeParser::parseBlock):
12538 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12539 * dfg/DFGCSEPhase.cpp:
12540 (JSC::DFG::CSEPhase::getLocalLoadElimination):
12541 (JSC::DFG::CSEPhase::performNodeCSE):
12542 * dfg/DFGDriver.cpp:
12543 (JSC::DFG::compile):
12544 * dfg/DFGGraph.h:
12545 (JSC::DFG::Graph::Graph):
12546 (JSC::DFG::Graph::executableFor):
12547 (Graph):
12548 (JSC::DFG::Graph::clobbersWorld):
12549 * dfg/DFGNode.h:
12550 (JSC::DFG::Node::convertToConstant):
12551 (JSC::DFG::Node::convertToGetLocalUnlinked):
12552 (Node):
12553 (JSC::DFG::Node::unlinkedLocal):
12554 * dfg/DFGNodeType.h:
12555 (DFG):
12556 * dfg/DFGOSRExit.cpp:
12557 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
12558 * dfg/DFGPredictionPropagationPhase.cpp:
12559 (JSC::DFG::PredictionPropagationPhase::propagate):
12560 * dfg/DFGSpeculativeJIT32_64.cpp:
12561 (JSC::DFG::SpeculativeJIT::compile):
12562 * dfg/DFGSpeculativeJIT64.cpp:
12563 (JSC::DFG::SpeculativeJIT::compile):
12564
fpizlo@apple.com5e3852d2012-05-24 00:05:21 +0000125652012-05-13 Filip Pizlo <fpizlo@apple.com>
12566
12567 DFG should be able to optimize foo.apply(bar, arguments)
12568 https://bugs.webkit.org/show_bug.cgi?id=86306
12569
12570 Reviewed by Gavin Barraclough.
12571
12572 Merge r116912 from dfgopt.
12573
12574 Enables compilation of op_jneq_ptr and some forms of op_call_varargs.
12575
12576 Also includes a bunch of bug fixes that were made necessary by the increased
12577 pressure on the CFG simplifier.
12578
12579 This is a 1-2% win on V8.
12580
12581 * bytecode/CodeBlock.cpp:
12582 (JSC::CodeBlock::printCallOp):
12583 (JSC::CodeBlock::CodeBlock):
12584 (JSC::ProgramCodeBlock::canCompileWithDFGInternal):
12585 (JSC::EvalCodeBlock::canCompileWithDFGInternal):
12586 (JSC::FunctionCodeBlock::canCompileWithDFGInternal):
12587 * bytecode/CodeBlock.h:
12588 (CodeBlock):
12589 (JSC::CodeBlock::canCompileWithDFG):
12590 (JSC::CodeBlock::canCompileWithDFGState):
12591 (ProgramCodeBlock):
12592 (EvalCodeBlock):
12593 (FunctionCodeBlock):
12594 * dfg/DFGAbstractState.cpp:
12595 (JSC::DFG::AbstractState::execute):
12596 * dfg/DFGByteCodeParser.cpp:
12597 (JSC::DFG::ByteCodeParser::parseBlock):
12598 (JSC::DFG::ByteCodeParser::processPhiStack):
12599 (JSC::DFG::ByteCodeParser::parse):
12600 * dfg/DFGCFGSimplificationPhase.cpp:
12601 (JSC::DFG::CFGSimplificationPhase::run):
12602 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
12603 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12604 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
12605 * dfg/DFGCSEPhase.cpp:
12606 (JSC::DFG::CSEPhase::getLocalLoadElimination):
12607 (CSEPhase):
12608 (JSC::DFG::CSEPhase::setReplacement):
12609 (JSC::DFG::CSEPhase::performNodeCSE):
12610 * dfg/DFGCapabilities.cpp:
12611 (JSC::DFG::debugFail):
12612 (DFG):
12613 (JSC::DFG::canHandleOpcodes):
12614 (JSC::DFG::canCompileOpcodes):
12615 (JSC::DFG::canInlineOpcodes):
12616 * dfg/DFGCapabilities.h:
12617 (JSC::DFG::canCompileOpcode):
12618 (JSC::DFG::canInlineOpcode):
12619 (DFG):
12620 (JSC::DFG::canCompileOpcodes):
12621 (JSC::DFG::canCompileEval):
12622 (JSC::DFG::canCompileProgram):
12623 (JSC::DFG::canCompileFunctionForCall):
12624 (JSC::DFG::canCompileFunctionForConstruct):
12625 * dfg/DFGCommon.h:
12626 * dfg/DFGGraph.cpp:
12627 (JSC::DFG::Graph::dump):
12628 * dfg/DFGNodeType.h:
12629 (DFG):
12630 * dfg/DFGPredictionPropagationPhase.cpp:
12631 (JSC::DFG::PredictionPropagationPhase::propagate):
12632 * dfg/DFGSpeculativeJIT32_64.cpp:
12633 (JSC::DFG::SpeculativeJIT::compile):
12634 * dfg/DFGSpeculativeJIT64.cpp:
12635 (JSC::DFG::SpeculativeJIT::emitCall):
12636 (JSC::DFG::SpeculativeJIT::compile):
12637 * dfg/DFGValidate.cpp:
12638 (Validate):
12639 (JSC::DFG::Validate::validate):
12640 (JSC::DFG::Validate::checkOperand):
12641 (JSC::DFG::Validate::reportValidationContext):
12642 * jit/JIT.cpp:
12643 (JSC::JIT::emitOptimizationCheck):
12644 (JSC::JIT::privateCompileSlowCases):
12645 (JSC::JIT::privateCompile):
12646 * jit/JIT.h:
12647 * jit/JITArithmetic.cpp:
12648 (JSC::JIT::compileBinaryArithOp):
12649 * jit/JITPropertyAccess.cpp:
12650 (JSC::JIT::privateCompilePutByIdTransition):
12651 * jit/JITPropertyAccess32_64.cpp:
12652 (JSC::JIT::privateCompilePutByIdTransition):
12653 * tools/CodeProfile.cpp:
12654 (JSC::CodeProfile::sample):
12655
ggaren@apple.com7070d422012-05-23 23:55:27 +0000126562012-05-23 Geoffrey Garen <ggaren@apple.com>
12657
12658 Refactored WeakBlock to use malloc, clarify behavior
12659 https://bugs.webkit.org/show_bug.cgi?id=87318
12660
12661 Reviewed by Filip Pizlo.
12662
12663 We want to use malloc so we can make these smaller than 4KB,
12664 since an individual MarkedBlock will usually have fewer than
12665 4KB worth of weak pointers.
12666
12667 * heap/Heap.cpp:
12668 (JSC::Heap::markRoots): Renamed visitLiveWeakImpls to visit, since
12669 we no longer need to distinguish from "visitDeadWeakImpls".
12670
12671 Renamed "visitDeadWeakImpls" to "reap" because we're not actually
12672 doing any visiting -- we're just tagging things as dead.
12673
12674 * heap/WeakBlock.cpp:
12675 (JSC::WeakBlock::create):
12676 (JSC::WeakBlock::destroy):
12677 (JSC::WeakBlock::WeakBlock): Malloc!
12678
12679 (JSC::WeakBlock::visit):
12680 (JSC::WeakBlock::reap): Renamed as above.
12681
12682 * heap/WeakBlock.h:
12683 (WeakBlock): Reduced to 3KB, as explained above.
12684
12685 * heap/WeakSet.cpp:
12686 (JSC::WeakSet::visit):
12687 (JSC::WeakSet::reap):
12688 * heap/WeakSet.h:
12689 (WeakSet): Updated for renames, and to match WebKit style.
12690
fpizlo@apple.com11e2f372012-05-23 22:25:21 +0000126912012-05-23 Filip Pizlo <fpizlo@apple.com>
12692
fpizlo@apple.combc96e8f2012-05-23 23:12:59 +000012693 Use after free in JSC::DFG::ByteCodeParser::processPhiStack
12694 https://bugs.webkit.org/show_bug.cgi?id=87312
12695 <rdar://problem/11518848>
12696
12697 Reviewed by Oliver Hunt.
12698
12699 * dfg/DFGByteCodeParser.cpp:
12700 (JSC::DFG::ByteCodeParser::processPhiStack):
12701 (JSC::DFG::ByteCodeParser::parse):
12702
127032012-05-23 Filip Pizlo <fpizlo@apple.com>
12704
fpizlo@apple.com11e2f372012-05-23 22:25:21 +000012705 It should be possible to make C function calls from DFG code on ARM in debug mode
12706 https://bugs.webkit.org/show_bug.cgi?id=87313
12707
12708 Reviewed by Gavin Barraclough.
12709
12710 * dfg/DFGSpeculativeJIT.h:
12711 (SpeculativeJIT):
12712
fpizlo@apple.comc6446112012-05-23 20:52:42 +0000127132012-05-11 Filip Pizlo <fpizlo@apple.com>
12714
12715 DFG should be able to inline functions that use arguments reflectively
12716 https://bugs.webkit.org/show_bug.cgi?id=86132
12717
12718 Reviewed by Oliver Hunt.
12719
12720 Merged r116838 from dfgopt.
12721
12722 This turns on inlining of functions that use arguments reflectively, but it
12723 does not do any of the obvious optimizations that this exposes. I'll save that
12724 for another patch - the important thing for now is that this contains all of
12725 the plumbing necessary to make this kind of inlining sound even in bizarro
12726 cases like an inline callee escaping the arguments object to parts of the
12727 inline caller where the arguments are otherwise dead. Or even more fun cases
12728 like where you've inlined to an inline stack that is three-deep, and the
12729 function on top of the inline stack reflectively accesses the arguments of a
12730 function that is in the middle of the inline stack. Any subsequent
12731 optimizations that we do for the obvious cases of arguments usage in inline
12732 functions will have to take care not to break the baseline functionality that
12733 this patch plumbs together.
12734
12735 * bytecode/CodeBlock.cpp:
12736 (JSC::CodeBlock::printCallOp):
12737 (JSC::CodeBlock::dump):
12738 * bytecode/CodeBlock.h:
12739 * dfg/DFGAssemblyHelpers.h:
12740 (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
12741 (AssemblyHelpers):
12742 * dfg/DFGByteCodeParser.cpp:
12743 (InlineStackEntry):
12744 (JSC::DFG::ByteCodeParser::handleCall):
12745 (JSC::DFG::ByteCodeParser::handleInlining):
12746 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12747 (JSC::DFG::ByteCodeParser::parse):
12748 * dfg/DFGCCallHelpers.h:
12749 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
12750 (CCallHelpers):
12751 * dfg/DFGCapabilities.h:
12752 (JSC::DFG::canInlineOpcode):
12753 * dfg/DFGDriver.cpp:
12754 (JSC::DFG::compile):
12755 * dfg/DFGFixupPhase.cpp:
12756 (JSC::DFG::FixupPhase::fixupNode):
12757 * dfg/DFGOperations.cpp:
12758 * dfg/DFGOperations.h:
12759 * dfg/DFGSpeculativeJIT.h:
12760 (JSC::DFG::SpeculativeJIT::callOperation):
12761 * dfg/DFGSpeculativeJIT32_64.cpp:
12762 (JSC::DFG::SpeculativeJIT::compile):
12763 * dfg/DFGSpeculativeJIT64.cpp:
12764 (JSC::DFG::SpeculativeJIT::compile):
12765 * interpreter/CallFrame.cpp:
12766 (JSC):
12767 (JSC::CallFrame::someCodeBlockForPossiblyInlinedCode):
12768 * interpreter/CallFrame.h:
12769 (ExecState):
12770 (JSC::ExecState::someCodeBlockForPossiblyInlinedCode):
12771 * interpreter/Interpreter.cpp:
12772 (JSC::Interpreter::retrieveArgumentsFromVMCode):
12773 * runtime/Arguments.cpp:
12774 (JSC::Arguments::tearOff):
12775 (JSC):
12776 (JSC::Arguments::tearOffForInlineCallFrame):
12777 * runtime/Arguments.h:
12778 (Arguments):
12779 (JSC::Arguments::create):
12780 (JSC::Arguments::finishCreation):
12781 (JSC):
12782
fpizlo@apple.comfe244b02012-05-23 20:51:21 +0000127832012-05-23 Filip Pizlo <fpizlo@apple.com>
12784
12785 Every OSR exit on ARM results in a crash
12786 https://bugs.webkit.org/show_bug.cgi?id=87307
12787
12788 Reviewed by Geoffrey Garen.
12789
12790 * dfg/DFGThunks.cpp:
12791 (JSC::DFG::osrExitGenerationThunkGenerator):
12792
ggaren@apple.com96fa0e72012-05-23 20:47:46 +0000127932012-05-23 Geoffrey Garen <ggaren@apple.com>
12794
12795 Refactored heap tear-down to use normal value semantics (i.e., destructors)
12796 https://bugs.webkit.org/show_bug.cgi?id=87302
12797
12798 Reviewed by Oliver Hunt.
12799
12800 This is a step toward incremental DOM finalization.
12801
12802 * heap/CopiedSpace.cpp:
12803 (JSC::CopiedSpace::~CopiedSpace):
12804 * heap/CopiedSpace.h:
12805 (CopiedSpace): Just use our destructor, instead of relying on the heap
12806 to send us a special message at a special time.
12807
12808 * heap/Heap.cpp:
12809 (JSC::Heap::Heap): Use OwnPtr for m_markListSet because this is not Sparta.
12810
12811 (JSC::Heap::~Heap): No need for delete or freeAllBlocks because normal
12812 destructors do this work automatically now.
12813
12814 (JSC::Heap::lastChanceToFinalize): Just call lastChanceToFinalize on our
12815 sub-objects, and assume it does the right thing. This improves encapsulation,
12816 so we can add items requiring finalization to our sub-objects.
12817
12818 * heap/Heap.h: Moved m_blockAllocator to get the right destruction order.
12819
12820 * heap/MarkedSpace.cpp:
12821 (Take):
12822 (JSC):
12823 (JSC::Take::Take):
12824 (JSC::Take::operator()):
12825 (JSC::Take::returnValue): Moved to the top of the file so it can be used
12826 in another function.
12827
12828 (JSC::MarkedSpace::~MarkedSpace): Delete all outstanding memory, like a good
12829 destructor should.
12830
12831 (JSC::MarkedSpace::lastChanceToFinalize): Moved some code here from the heap,
12832 since it pertains to our internal implementation details.
12833
12834 * heap/MarkedSpace.h:
12835 (MarkedSpace):
12836 * heap/WeakBlock.cpp:
12837 (JSC::WeakBlock::lastChanceToFinalize):
12838 * heap/WeakBlock.h:
12839 (WeakBlock):
12840 * heap/WeakSet.cpp:
12841 (JSC::WeakSet::lastChanceToFinalize):
12842 * heap/WeakSet.h:
12843 (WeakSet): Stop using a special freeAllBlocks() callback and just implement
12844 lastChanceToFinalize.
12845
ggaren@apple.comd6376d22012-05-23 18:29:55 +0000128462011-05-22 Geoffrey Garen <ggaren@apple.com>
12847
12848 Encapsulated some calculations for whether portions of the heap are empty
12849 https://bugs.webkit.org/show_bug.cgi?id=87210
12850
12851 Reviewed by Gavin Barraclough.
12852
12853 This is a step toward incremental DOM finalization.
12854
12855 * heap/Heap.cpp:
12856 (JSC::Heap::~Heap): Explicitly call freeAllBlocks() instead of relying
12857 implicitly on all blocks thinking they're empty. In future, we may
12858 choose to tear down the heap without first setting all data structures
12859 to "empty".
12860
12861 * heap/MarkedBlock.h:
12862 (JSC::MarkedBlock::isEmpty):
12863 (JSC::MarkedBlock::gatherDirtyCells): Renamed markCountIsZero to isEmpty,
12864 in preparation for making it check for outstanding finalizers in addition
12865 to marked cells.
12866
12867 * heap/MarkedSpace.cpp:
12868 (Take):
12869 (JSC::Take::Take):
12870 (JSC::Take::operator()):
12871 (JSC::Take::returnValue):
12872 (JSC::MarkedSpace::shrink):
12873 (JSC::MarkedSpace::freeAllBlocks): Refactored the "Take" functor to support
12874 a conditional isEmpty check, so it dould be shared by shrink() and freeAllBlocks().
12875
12876 * heap/WeakBlock.cpp:
12877 (JSC::WeakBlock::WeakBlock):
12878 (JSC::WeakBlock::visitLiveWeakImpls):
12879 (JSC::WeakBlock::visitDeadWeakImpls):
12880 * heap/WeakBlock.h:
12881 (WeakBlock):
12882 (JSC::WeakBlock::isEmpty):
12883 * heap/WeakSet.cpp:
12884 (JSC::WeakSet::sweep):
12885 (JSC::WeakSet::shrink): Use isEmpty(), in preparation for changes in
12886 its implementation.
12887
vestbo@webkit.orgb1f6e922012-05-23 10:50:53 +0000128882012-05-23 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12889
12890 [Qt] Remove references to $$QT_SOURCE_TREE
12891
12892 With a modularized Qt, it's ambigious. What we really want is qtbase,
12893 which qtcore is a proxy for (we assume it will always live in qtbase).
12894
12895 Reviewed by Tor Arne Vestbø.
12896
12897 * JavaScriptCore.pri:
12898 * Target.pri:
12899
fpizlo@apple.comb6b454cd2012-05-23 07:53:44 +0000129002012-05-09 Filip Pizlo <fpizlo@apple.com>
12901
12902 DFG should allow inlining in case of certain arity mismatches
12903 https://bugs.webkit.org/show_bug.cgi?id=86059
12904
12905 Reviewed by Geoff Garen.
fpizlo@apple.comb92907c2012-05-23 07:55:12 +000012906
12907 Merge r116620 from dfgopt.
fpizlo@apple.comb6b454cd2012-05-23 07:53:44 +000012908
12909 * dfg/DFGByteCodeParser.cpp:
12910 (JSC::DFG::ByteCodeParser::handleInlining):
12911
fpizlo@apple.com6d4456e2012-05-23 03:48:52 +0000129122012-05-08 Filip Pizlo <fpizlo@apple.com>
12913
fpizlo@apple.com1688cc12012-05-23 07:29:02 +000012914 DFG variable capture analysis should work even if the variables arose through inlining
12915 https://bugs.webkit.org/show_bug.cgi?id=85945
12916
12917 Reviewed by Oliver Hunt.
12918
12919 Merged r116555 from dfgopt.
12920
12921 This just changes how the DFG queries whether a variable is captured. It does not
12922 change any user-visible behavior.
12923
12924 As part of this change, I further solidified the policy that the CFA behaves in an
12925 undefined way for captured locals and queries about their values will not yield
12926 reliable results. This will likely be changed in the future, but for now it makes
12927 sense.
12928
12929 One fun part about this change is that it recognizes that the same variable may
12930 be both captured and not, at the same time, because their live interval spans
12931 inlining boundaries. This only happens in the case of arguments to functions that
12932 capture their arguments, and this change treats them with just the right touch of
12933 conservatism: they will be treated as if captured by the caller as well as the
12934 callee.
12935
12936 Finally, this also adds captured variable reasoning to the InlineCallFrame, which
12937 I thought might be useful for later tooling.
12938
12939 This is perf-neutral, since it does it does not make the DFG take advantage of this
12940 new functionality in any way. In particular, it is still the case that the DFG will
12941 not inline functions that use arguments reflectively or that create activations.
12942
12943 * bytecode/CodeBlock.h:
12944 (CodeBlock):
12945 (JSC::CodeBlock::needsActivation):
12946 (JSC::CodeBlock::argumentIsCaptured):
12947 (JSC::CodeBlock::localIsCaptured):
12948 (JSC::CodeBlock::isCaptured):
12949 * bytecode/CodeOrigin.h:
12950 (InlineCallFrame):
12951 * dfg/DFGAbstractState.cpp:
12952 (JSC::DFG::AbstractState::initialize):
12953 (JSC::DFG::AbstractState::endBasicBlock):
12954 (JSC::DFG::AbstractState::execute):
12955 (JSC::DFG::AbstractState::merge):
12956 * dfg/DFGByteCodeParser.cpp:
12957 (JSC::DFG::ByteCodeParser::newVariableAccessData):
12958 (JSC::DFG::ByteCodeParser::getLocal):
12959 (JSC::DFG::ByteCodeParser::setLocal):
12960 (JSC::DFG::ByteCodeParser::getArgument):
12961 (JSC::DFG::ByteCodeParser::setArgument):
12962 (JSC::DFG::ByteCodeParser::flushArgument):
12963 (JSC::DFG::ByteCodeParser::parseBlock):
12964 (JSC::DFG::ByteCodeParser::processPhiStack):
12965 (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
12966 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12967 * dfg/DFGCFGSimplificationPhase.cpp:
12968 (CFGSimplificationPhase):
12969 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
12970 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
12971 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12972 * dfg/DFGCommon.h:
12973 * dfg/DFGFixupPhase.cpp:
12974 (JSC::DFG::FixupPhase::fixupNode):
12975 * dfg/DFGGraph.cpp:
12976 (JSC::DFG::Graph::nameOfVariableAccessData):
12977 * dfg/DFGGraph.h:
12978 (JSC::DFG::Graph::needsActivation):
12979 (JSC::DFG::Graph::usesArguments):
12980 * dfg/DFGPredictionPropagationPhase.cpp:
12981 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
12982 * dfg/DFGSpeculativeJIT.cpp:
12983 (JSC::DFG::SpeculativeJIT::compile):
12984 * dfg/DFGSpeculativeJIT32_64.cpp:
12985 (JSC::DFG::SpeculativeJIT::compile):
12986 * dfg/DFGSpeculativeJIT64.cpp:
12987 (JSC::DFG::SpeculativeJIT::compile):
12988 * dfg/DFGVariableAccessData.h:
12989 (JSC::DFG::VariableAccessData::VariableAccessData):
12990 (JSC::DFG::VariableAccessData::mergeIsCaptured):
12991 (VariableAccessData):
12992 (JSC::DFG::VariableAccessData::isCaptured):
12993
129942012-05-08 Filip Pizlo <fpizlo@apple.com>
12995
fpizlo@apple.com6d4456e2012-05-23 03:48:52 +000012996 DFG should support op_get_argument_by_val and op_get_arguments_length
12997 https://bugs.webkit.org/show_bug.cgi?id=85911
12998
12999 Reviewed by Oliver Hunt.
13000
13001 Merged r116467 from dfgopt.
13002
13003 This adds a simple and relatively conservative implementation of op_get_argument_by_val
13004 and op_get_arguments_length. We can optimize these later. For now it's great to have
13005 the additional coverage.
13006
13007 This patch appears to be perf-neutral.
13008
13009 * dfg/DFGAbstractState.cpp:
13010 (JSC::DFG::AbstractState::execute):
13011 * dfg/DFGAssemblyHelpers.h:
13012 (JSC::DFG::AssemblyHelpers::addressFor):
13013 (JSC::DFG::AssemblyHelpers::tagFor):
13014 (JSC::DFG::AssemblyHelpers::payloadFor):
13015 * dfg/DFGByteCodeParser.cpp:
13016 (JSC::DFG::ByteCodeParser::parseBlock):
13017 * dfg/DFGCapabilities.h:
13018 (JSC::DFG::canCompileOpcode):
13019 (JSC::DFG::canInlineOpcode):
13020 * dfg/DFGNode.h:
13021 (JSC::DFG::Node::hasHeapPrediction):
13022 * dfg/DFGNodeType.h:
13023 (DFG):
13024 * dfg/DFGOperations.cpp:
13025 * dfg/DFGOperations.h:
13026 * dfg/DFGPredictionPropagationPhase.cpp:
13027 (JSC::DFG::PredictionPropagationPhase::propagate):
13028 * dfg/DFGSpeculativeJIT.h:
13029 (JSC::DFG::SpeculativeJIT::callOperation):
13030 (SpeculativeJIT):
13031 * dfg/DFGSpeculativeJIT32_64.cpp:
13032 (JSC::DFG::SpeculativeJIT::compile):
13033 * dfg/DFGSpeculativeJIT64.cpp:
13034 (JSC::DFG::SpeculativeJIT::compile):
13035 * jit/JITOpcodes.cpp:
13036 (JSC::JIT::emit_op_get_argument_by_val):
13037 * jit/JITOpcodes32_64.cpp:
13038 (JSC::JIT::emit_op_get_argument_by_val):
13039 * llint/LowLevelInterpreter32_64.asm:
13040 * llint/LowLevelInterpreter64.asm:
13041
fpizlo@apple.com15c03c72012-05-23 02:34:13 +0000130422012-05-07 Filip Pizlo <fpizlo@apple.com>
13043
13044 DFG should support op_tear_off_arguments
13045 https://bugs.webkit.org/show_bug.cgi?id=85847
13046
13047 Reviewed by Michael Saboff.
13048
13049 Merged r116378 from dfgopt.
13050
13051 * dfg/DFGAbstractState.cpp:
13052 (JSC::DFG::AbstractState::execute):
13053 * dfg/DFGByteCodeParser.cpp:
13054 (JSC::DFG::ByteCodeParser::parseBlock):
13055 * dfg/DFGCapabilities.h:
13056 (JSC::DFG::canCompileOpcode):
13057 (JSC::DFG::canInlineOpcode):
13058 * dfg/DFGNodeType.h:
13059 (DFG):
13060 * dfg/DFGOperations.cpp:
13061 * dfg/DFGOperations.h:
13062 * dfg/DFGPredictionPropagationPhase.cpp:
13063 (JSC::DFG::PredictionPropagationPhase::propagate):
13064 * dfg/DFGSpeculativeJIT.h:
13065 (SpeculativeJIT):
13066 (JSC::DFG::SpeculativeJIT::callOperation):
13067 * dfg/DFGSpeculativeJIT32_64.cpp:
13068 (JSC::DFG::SpeculativeJIT::compile):
13069 * dfg/DFGSpeculativeJIT64.cpp:
13070 (JSC::DFG::SpeculativeJIT::compile):
13071
mhahnenberg@apple.com3041bc12012-05-23 01:28:03 +0000130722012-05-22 Mark Hahnenberg <mhahnenberg@apple.com>
13073
13074 CopiedSpace::contains doesn't check for oversize blocks
13075 https://bugs.webkit.org/show_bug.cgi?id=87180
13076
13077 Reviewed by Geoffrey Garen.
13078
13079 When doing a conservative scan we use CopiedSpace::contains to determine if a particular
13080 address points into the CopiedSpace. Currently contains() only checks if the address
13081 points to a block in to-space, which means that pointers to oversize blocks may not get scanned.
13082
13083 * heap/CopiedSpace.cpp:
13084 (JSC::CopiedSpace::tryAllocateOversize):
13085 (JSC::CopiedSpace::tryReallocateOversize):
13086 (JSC::CopiedSpace::doneFillingBlock):
13087 (JSC::CopiedSpace::doneCopying):
13088 * heap/CopiedSpace.h: Refactored CopiedSpace so that all blocks (oversize and to-space) are
13089 in a single hash set and bloom filter for membership testing.
13090 (CopiedSpace):
13091 * heap/CopiedSpaceInlineMethods.h:
13092 (JSC::CopiedSpace::contains): We check for the normal block first. Since the oversize blocks are
13093 only page aligned, rather than block aligned, we have to re-mask the ptr to check if it's in
13094 CopiedSpace. Also added a helper function of the same name that takes a CopiedBlock* and checks
13095 if it's in CopiedSpace so that check isn't typed out twice.
13096 (JSC):
13097 (JSC::CopiedSpace::startedCopying):
13098 (JSC::CopiedSpace::addNewBlock):
13099
ggaren@apple.coma68a6502012-05-22 23:59:51 +0000131002012-05-22 Geoffrey Garen <ggaren@apple.com>
13101
13102 CopiedBlock and MarkedBlock should have proper value semantics (i.e., destructors)
13103 https://bugs.webkit.org/show_bug.cgi?id=87172
13104
13105 Reviewed by Oliver Hunt and Phil Pizlo.
13106
13107 This enables MarkedBlock to own non-trivial sub-objects that require
13108 destruction. It also fixes a FIXME about casting a CopiedBlock to a
13109 MarkedBlock at destroy time.
13110
13111 CopiedBlock and MarkedBlock now accept an allocation chunk at create
13112 time and return it at destroy time. Their client is expected to
13113 allocate, recycle, and destroy these chunks.
13114
13115 * heap/BlockAllocator.cpp:
13116 (JSC::BlockAllocator::releaseFreeBlocks):
13117 (JSC::BlockAllocator::blockFreeingThreadMain): Don't call MarkedBlock::destroy
13118 because we expect that to be called before a block is put on our free
13119 list now. Do manually deallocate our allocation chunk because that's
13120 our job now.
13121
13122 * heap/BlockAllocator.h:
13123 (BlockAllocator):
13124 (JSC::BlockAllocator::allocate): Allocate never fails now. This is a
13125 cleaner abstraction because only one object does all the VM allocation
13126 and deallocation. Caching is an implementation detail.
13127
13128 (JSC::BlockAllocator::deallocate): We take an allocation chunk argument
13129 instead of a block because we now expect the block to have been destroyed
13130 before we recycle its memory. For convenience, we still use the HeapBlock
13131 class as our linked list node. This is OK because HeapBlock is a POD type.
13132
13133 * heap/CopiedBlock.h:
13134 (CopiedBlock):
13135 (JSC::CopiedBlock::create):
13136 (JSC::CopiedBlock::destroy):
13137 (JSC::CopiedBlock::CopiedBlock): Added proper create and destroy functions,
13138 to match MarkedBlock.
13139
13140 * heap/CopiedSpace.cpp:
13141 (JSC::CopiedSpace::tryAllocateOversize):
13142 (JSC::CopiedSpace::tryReallocateOversize):
13143 (JSC::CopiedSpace::doneCopying):
13144 (JSC::CopiedSpace::getFreshBlock):
13145 (JSC::CopiedSpace::freeAllBlocks):
13146 * heap/CopiedSpaceInlineMethods.h:
13147 (JSC::CopiedSpace::recycleBlock): Make sure to call destroy before
13148 returning a block to the BlockAllocator. Otherwise, our destructors
13149 won't run. (If we get this wrong now, we'll get a compile error.)
13150
13151 * heap/HeapBlock.h:
13152 (JSC::HeapBlock::HeapBlock): const!
13153
13154 * heap/MarkedAllocator.cpp:
13155 (JSC::MarkedAllocator::allocateBlock): No need to distinguish between
13156 create and recycle -- MarkedBlock always accepts memory allocated by
13157 its client now.
13158
13159 * heap/MarkedBlock.cpp:
13160 (JSC::MarkedBlock::create): Don't allocate memory -- we assume that we're
13161 passed already-allocated memory, to clarify the responsibility for VM
13162 recycling.
13163
13164 (JSC::MarkedBlock::destroy): Do run our destructor before giving back
13165 our VM -- that is the whole point of this patch.
13166
13167 (JSC::MarkedBlock::MarkedBlock):
13168 * heap/MarkedBlock.h:
13169 (MarkedBlock):
13170 * heap/MarkedSpace.cpp: const!
13171
13172 (JSC::MarkedSpace::freeBlocks): Make sure to call destroy before
13173 returning a block to the BlockAllocator. Otherwise, our destructors
13174 won't run. (If we get this wrong now, we'll get a compile error.)
13175
simon.fraser@apple.com9bd2c702012-05-22 20:37:14 +000013176== Rolled over to ChangeLog-2012-05-22 ==