blob: 53b07e2b3c372e9726c59cf1ad4eac035c44704c [file] [log] [blame]
mhahnenberg@apple.com20f21f32012-08-22 21:49:16 +000012012-08-22 Mark Hahnenberg <mhahnenberg@apple.com>
2
3 Separate MarkStackThreadSharedData from MarkStack
4 https://bugs.webkit.org/show_bug.cgi?id=94294
5
6 Reviewed by Filip Pizlo.
7
8 MarkStackThreadSharedData is soon going to have data to allow for a parallel copying
9 mode too, so to separate our concerns we should split it out into its own set of files
10 and rename it to GCThreadSharedData. For now this is purely a cosmetic refactoring.
11
12 * CMakeLists.txt:
13 * GNUmakefile.list.am:
14 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
15 * JavaScriptCore.xcodeproj/project.pbxproj:
16 * Target.pri:
17 * heap/GCThreadSharedData.cpp: Added.
18 (JSC):
19 (JSC::GCThreadSharedData::resetChildren):
20 (JSC::GCThreadSharedData::childVisitCount):
21 (JSC::GCThreadSharedData::markingThreadMain):
22 (JSC::GCThreadSharedData::markingThreadStartFunc):
23 (JSC::GCThreadSharedData::GCThreadSharedData):
24 (JSC::GCThreadSharedData::~GCThreadSharedData):
25 (JSC::GCThreadSharedData::reset):
26 * heap/GCThreadSharedData.h: Added.
27 (JSC):
28 (GCThreadSharedData):
29 * heap/Heap.h:
30 (Heap):
31 * heap/ListableHandler.h:
32 (ListableHandler):
33 * heap/MarkStack.cpp:
34 (JSC::MarkStack::MarkStack):
35 (JSC::MarkStack::~MarkStack):
36 * heap/MarkStack.h:
37 (JSC):
38 (MarkStack):
39 (JSC::MarkStack::sharedData):
40 * heap/MarkStackInlineMethods.h: Added.
41 (JSC):
42 (JSC::MarkStack::append):
43 (JSC::MarkStack::appendUnbarrieredPointer):
44 (JSC::MarkStack::appendUnbarrieredValue):
45 (JSC::MarkStack::internalAppend):
46 (JSC::MarkStack::addWeakReferenceHarvester):
47 (JSC::MarkStack::addUnconditionalFinalizer):
48 (JSC::MarkStack::addOpaqueRoot):
49 (JSC::MarkStack::containsOpaqueRoot):
50 (JSC::MarkStack::opaqueRootCount):
51 * heap/SlotVisitor.h:
52 (JSC):
53 (SlotVisitor):
54 (JSC::SlotVisitor::SlotVisitor):
55
commit-queue@webkit.orgaba7ac32012-08-22 13:12:17 +0000562012-08-22 Gabor Ballabas <gaborb@inf.u-szeged.hu>
57
58 Fix JSC build when DFG-JIT is disabled
59 https://bugs.webkit.org/show_bug.cgi?id=94694
60
61 Reviewed by Csaba Osztrogonác.
62
63 Adding an appropriate guard for fixing the build.
64
65 * bytecode/ResolveGlobalStatus.cpp:
66 (JSC):
67
commit-queue@webkit.orga22c4cd2012-08-22 00:11:20 +0000682012-08-21 Mark Lam <mark.lam@apple.com>
69
70 Introducing the VMInspector for VM debugging use.
71 https://bugs.webkit.org/show_bug.cgi?id=94613.
72
73 Reviewed by Filip Pizlo.
74
75 Adding some utility functions for debugging the VM. This code is
76 presently #ifdef'd out by default.
77
78 * CMakeLists.txt:
79 * GNUmakefile.list.am:
80 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
81 * JavaScriptCore.xcodeproj/project.pbxproj:
82 * interpreter/CallFrame.h:
83 (ExecState):
84 * interpreter/VMInspector.cpp: Added.
85 (JSC):
86 (JSC::VMInspector::getTypeName):
87 (JSC::VMInspector::dumpFrame0):
88 (JSC::VMInspector::dumpFrame):
89 (JSC::VMInspector::countFrames):
90 * interpreter/VMInspector.h: Added.
91 (JSC):
92 (VMInspector):
93
fpizlo@apple.com0712be82012-08-21 23:30:19 +0000942012-08-21 Filip Pizlo <fpizlo@apple.com>
95
96 A patchable GetById right after a watchpoint should have the appropriate nop padding
97 https://bugs.webkit.org/show_bug.cgi?id=94635
98
99 Reviewed by Mark Hahnenberg.
100
101 * assembler/AbstractMacroAssembler.h:
102 (JSC::AbstractMacroAssembler::padBeforePatch):
103 (AbstractMacroAssembler):
104 * assembler/MacroAssemblerARMv7.h:
105 (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
106 (JSC::MacroAssemblerARMv7::moveWithPatch):
107 (JSC::MacroAssemblerARMv7::patchableJump):
108 * assembler/MacroAssemblerX86.h:
109 (JSC::MacroAssemblerX86::moveWithPatch):
110 (JSC::MacroAssemblerX86::branchPtrWithPatch):
111 (JSC::MacroAssemblerX86::storePtrWithPatch):
112 * assembler/MacroAssemblerX86Common.h:
113 (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
114 (JSC::MacroAssemblerX86Common::load32WithCompactAddressOffsetPatch):
115 (JSC::MacroAssemblerX86Common::loadCompactWithAddressOffsetPatch):
116 (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
117 * assembler/MacroAssemblerX86_64.h:
118 (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
119 (JSC::MacroAssemblerX86_64::loadPtrWithCompactAddressOffsetPatch):
120 (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
121 (JSC::MacroAssemblerX86_64::moveWithPatch):
122 * jit/JumpReplacementWatchpoint.cpp:
123 (JSC::JumpReplacementWatchpoint::fireInternal):
124
commit-queue@webkit.orgf76b9d52012-08-20 23:48:00 +00001252012-08-20 Mark Lam <mark.lam@apple.com>
126
commit-queue@webkit.orge4c94fa2012-08-21 03:52:40 +0000127 Fix broken non-JIT build.
128 https://bugs.webkit.org/show_bug.cgi?id=94564.
129
130 Reviewed by Filip Pizlo.
131
132 Added some UNUSED_PARAM() macros to make the compiler happy.
133
134 * runtime/Executable.cpp:
135 (JSC::EvalExecutable::compileInternal):
136 (JSC::ProgramExecutable::compileInternal):
137 (JSC::FunctionExecutable::compileForCallInternal):
138 (JSC::FunctionExecutable::compileForConstructInternal):
139
1402012-08-20 Mark Lam <mark.lam@apple.com>
141
commit-queue@webkit.orgf76b9d52012-08-20 23:48:00 +0000142 Fixed erroneous line number for LLint frame when throwing exceptions.
143 https://bugs.webkit.org/show_bug.cgi?id=94051.
144
145 Reviewed by Filip Pizlo.
146
147 For LLInt frames, before throwing an exception, adjust the PC from the
148 return PC back to the call PC if we are indeed at a call site.
149
150 * bytecode/CodeBlock.cpp:
151 (JSC::CodeBlock::adjustPCIfAtCallSite):
152 (JSC):
153 (JSC::CodeBlock::bytecodeOffset):
154 * bytecode/CodeBlock.h:
155 (CodeBlock):
156 * llint/LLIntExceptions.cpp:
157 (JSC::LLInt::fixupPCforExceptionIfNeeded):
158 (LLInt):
159 (JSC::LLInt::interpreterThrowInCaller):
160 (JSC::LLInt::returnToThrow):
161 (JSC::LLInt::callToThrow):
162
fpizlo@apple.comb5e71412012-08-20 22:32:18 +00001632012-08-20 Filip Pizlo <fpizlo@apple.com>
164
fpizlo@apple.com9c330da2012-08-20 22:41:06 +0000165 fast/js/dfg-peephole-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html on 32-bit
166 https://bugs.webkit.org/show_bug.cgi?id=94538
167
168 Reviewed by Mark Hahnenberg.
169
170 * dfg/DFGSpeculativeJIT32_64.cpp:
171 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
172
1732012-08-20 Filip Pizlo <fpizlo@apple.com>
174
fpizlo@apple.comb5e71412012-08-20 22:32:18 +0000175 fast/js/dfg-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html crashes on 32-bit
176 https://bugs.webkit.org/show_bug.cgi?id=94026
177
178 Reviewed by Mark Hahnenberg.
179
180 * dfg/DFGSpeculativeJIT32_64.cpp:
181 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
182
fpizlo@apple.comeb3323d2012-08-20 06:11:24 +00001832012-08-19 Filip Pizlo <fpizlo@apple.com>
184
185 The relationship between abstract values and structure transition watchpoints should be rationalized
186 https://bugs.webkit.org/show_bug.cgi?id=94205
187
188 Reviewed by Geoffrey Garen.
189
190 This patch does a number of things related to the handling of the abstract values
191 arrising from values with structures known to be watchpointable:
192
193 - This rationalizes the relationship between the structure that we know an object
194 to have *right now* based on having executed a check against that structure, and
195 the structure that we know the object could have *in the future* based on a type
196 check executed in the past over a structure that was watchpointable.
197
198 - We use the above to assert that structure transition watchpoints are being used
199 soundly.
200
201 - We use the above to strength reduce CheckStructure into StructureTransitionWatchpoint
202 whenever possible.
203
204 - This rationalizes the handling of CFA over constants that appeared in the bytecode.
205 If at compile-time the constant has a watchpointable structure, then we can prove
206 what structures it may have in the future. The analysis uses this to both assert
207 that structure transition watchpoints are being used correctly, and to find
208 opportunities for using them more aggressively.
209
210 The net effect of all of these changes is that OSR entry should work more smoothly.
211 It may also be a slight win due to strength reductions, though most of those strength
212 reductions would have already been done by the parser and the structure check hoister.
213
214 * GNUmakefile.list.am:
215 * JavaScriptCore.xcodeproj/project.pbxproj:
216 * dfg/DFGAbstractState.cpp:
217 (JSC::DFG::AbstractState::beginBasicBlock):
218 (JSC::DFG::AbstractState::execute):
219 * dfg/DFGAbstractValue.h:
220 (DFG):
221 (JSC::DFG::AbstractValue::clear):
222 (JSC::DFG::AbstractValue::isClear):
223 (JSC::DFG::AbstractValue::makeTop):
224 (JSC::DFG::AbstractValue::clobberStructures):
225 (JSC::DFG::AbstractValue::isTop):
226 (JSC::DFG::AbstractValue::setFuturePossibleStructure):
227 (AbstractValue):
228 (JSC::DFG::AbstractValue::filterFuturePossibleStructure):
229 (JSC::DFG::AbstractValue::setMostSpecific):
230 (JSC::DFG::AbstractValue::set):
231 (JSC::DFG::AbstractValue::operator==):
232 (JSC::DFG::AbstractValue::merge):
233 (JSC::DFG::AbstractValue::filter):
234 (JSC::DFG::AbstractValue::filterValueByType):
235 (JSC::DFG::AbstractValue::validateType):
236 (JSC::DFG::AbstractValue::validate):
237 (JSC::DFG::AbstractValue::checkConsistency):
238 (JSC::DFG::AbstractValue::dump):
239 * dfg/DFGArgumentsSimplificationPhase.cpp:
240 (JSC::DFG::ArgumentsSimplificationPhase::run):
241 * dfg/DFGCSEPhase.cpp:
242 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
243 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
244 (JSC::DFG::CSEPhase::performNodeCSE):
245 * dfg/DFGConstantFoldingPhase.cpp:
246 (JSC::DFG::ConstantFoldingPhase::foldConstants):
247 * dfg/DFGNode.h:
248 (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
249 (Node):
250 (JSC::DFG::Node::hasStructure):
251 * dfg/DFGNodeType.h:
252 (DFG):
253 * dfg/DFGOSREntry.cpp:
254 (JSC::DFG::prepareOSREntry):
255 * dfg/DFGPredictionPropagationPhase.cpp:
256 (JSC::DFG::PredictionPropagationPhase::propagate):
257 * dfg/DFGSpeculativeJIT.cpp:
258 (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
259 (JSC::DFG::SpeculativeJIT::forwardSpeculationWatchpoint):
260 (DFG):
261 (JSC::DFG::SpeculativeJIT::speculationWatchpointWithConditionalDirection):
262 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
263 (JSC::DFG::SpeculativeJIT::speculateArray):
264 * dfg/DFGSpeculativeJIT.h:
265 (SpeculativeJIT):
266 * dfg/DFGSpeculativeJIT32_64.cpp:
267 (JSC::DFG::SpeculativeJIT::compile):
268 * dfg/DFGSpeculativeJIT64.cpp:
269 (JSC::DFG::SpeculativeJIT::compile):
270 * dfg/DFGStructureAbstractValue.h: Added.
271 (DFG):
272 (StructureAbstractValue):
273 (JSC::DFG::StructureAbstractValue::StructureAbstractValue):
274 (JSC::DFG::StructureAbstractValue::clear):
275 (JSC::DFG::StructureAbstractValue::makeTop):
276 (JSC::DFG::StructureAbstractValue::top):
277 (JSC::DFG::StructureAbstractValue::add):
278 (JSC::DFG::StructureAbstractValue::addAll):
279 (JSC::DFG::StructureAbstractValue::contains):
280 (JSC::DFG::StructureAbstractValue::isSubsetOf):
281 (JSC::DFG::StructureAbstractValue::doesNotContainAnyOtherThan):
282 (JSC::DFG::StructureAbstractValue::isSupersetOf):
283 (JSC::DFG::StructureAbstractValue::filter):
284 (JSC::DFG::StructureAbstractValue::isClear):
285 (JSC::DFG::StructureAbstractValue::isTop):
286 (JSC::DFG::StructureAbstractValue::isClearOrTop):
287 (JSC::DFG::StructureAbstractValue::isNeitherClearNorTop):
288 (JSC::DFG::StructureAbstractValue::size):
289 (JSC::DFG::StructureAbstractValue::at):
290 (JSC::DFG::StructureAbstractValue::operator[]):
291 (JSC::DFG::StructureAbstractValue::last):
292 (JSC::DFG::StructureAbstractValue::speculationFromStructures):
293 (JSC::DFG::StructureAbstractValue::hasSingleton):
294 (JSC::DFG::StructureAbstractValue::singleton):
295 (JSC::DFG::StructureAbstractValue::operator==):
296 (JSC::DFG::StructureAbstractValue::dump):
297 (JSC::DFG::StructureAbstractValue::topValue):
298 * dfg/DFGStructureCheckHoistingPhase.cpp:
299 (JSC::DFG::StructureCheckHoistingPhase::run):
300
fpizlo@apple.com6a23c422012-08-18 00:48:38 +00003012012-08-17 Filip Pizlo <fpizlo@apple.com>
302
fpizlo@apple.com0fd7ec92012-08-19 21:59:12 +0000303 The current state of the call frame should be taken into account in the DFG for both predictions and proofs
304 https://bugs.webkit.org/show_bug.cgi?id=94412
305
306 Reviewed by Geoffrey Garen.
307
308 This ensures that no matter how smart the DFG gets, it'll always know through
309 which entrypoint OSR will try to enter, and with which values it will attempt
310 to do so. For prologue OSR, this has no effect other than adding the current
311 arguments to the argument predictions. For loop OSR, this makes our treatment
312 of the loop slightly more conservative - just conservative enough to ensure
313 that OSR succeeds.
314
315 * bytecode/CodeBlock.cpp:
316 (JSC::ProgramCodeBlock::compileOptimized):
317 (JSC::EvalCodeBlock::compileOptimized):
318 (JSC::FunctionCodeBlock::compileOptimized):
319 * bytecode/CodeBlock.h:
320 (CodeBlock):
321 (ProgramCodeBlock):
322 (EvalCodeBlock):
323 (FunctionCodeBlock):
324 * dfg/DFGAbstractState.cpp:
325 (JSC::DFG::AbstractState::initialize):
326 * dfg/DFGAbstractValue.h:
327 (JSC::DFG::AbstractValue::setMostSpecific):
328 (AbstractValue):
329 * dfg/DFGByteCodeParser.cpp:
330 (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
331 (JSC::DFG::ByteCodeParser::parse):
332 * dfg/DFGDriver.cpp:
333 (JSC::DFG::compile):
334 (JSC::DFG::tryCompile):
335 (JSC::DFG::tryCompileFunction):
336 * dfg/DFGDriver.h:
337 (DFG):
338 (JSC::DFG::tryCompile):
339 (JSC::DFG::tryCompileFunction):
340 * dfg/DFGGraph.h:
341 (JSC::DFG::Graph::Graph):
342 (Graph):
343 * jit/JITDriver.h:
344 (JSC::jitCompileIfAppropriate):
345 (JSC::jitCompileFunctionIfAppropriate):
346 * jit/JITStubs.cpp:
347 (JSC::DEFINE_STUB_FUNCTION):
348 * runtime/Executable.cpp:
349 (JSC::EvalExecutable::compileOptimized):
350 (JSC::EvalExecutable::compileInternal):
351 (JSC::ProgramExecutable::compileOptimized):
352 (JSC::ProgramExecutable::compileInternal):
353 (JSC::FunctionExecutable::compileOptimizedForCall):
354 (JSC::FunctionExecutable::compileOptimizedForConstruct):
355 (JSC::FunctionExecutable::compileForCallInternal):
356 (JSC::FunctionExecutable::compileForConstructInternal):
357 * runtime/Executable.h:
358 (EvalExecutable):
359 (ProgramExecutable):
360 (FunctionExecutable):
361 (JSC::FunctionExecutable::compileOptimizedFor):
362 * runtime/ExecutionHarness.h:
363 (JSC::prepareForExecution):
364 (JSC::prepareFunctionForExecution):
365
3662012-08-17 Filip Pizlo <fpizlo@apple.com>
367
fpizlo@apple.comd5d9bae2012-08-18 06:01:33 +0000368 DFG CSE should be more honest about when it changed the IR
369 https://bugs.webkit.org/show_bug.cgi?id=94408
370
371 Reviewed by Geoffrey Garen.
372
373 The CSE phase now always returns true if it changed the IR.
374
375 * dfg/DFGCSEPhase.cpp:
376 (JSC::DFG::CSEPhase::setReplacement):
377 (JSC::DFG::CSEPhase::eliminate):
378 (JSC::DFG::CSEPhase::performNodeCSE):
379
3802012-08-17 Filip Pizlo <fpizlo@apple.com>
381
fpizlo@apple.com6a23c422012-08-18 00:48:38 +0000382 DFG is still too pessimistic about what constitutes a side-effect on array accesses
383 https://bugs.webkit.org/show_bug.cgi?id=94309
384
385 Reviewed by Geoffrey Garen.
386
387 This change means that even if structure transition watchpoints are not used for
388 hoisting of clobbered structure checks, we still retain good performance on the
389 benchmarks we care about. That's important, since butterflies will likely make
390 most array structures not watchpointable.
391
392 * dfg/DFGAbstractState.cpp:
393 (JSC::DFG::AbstractState::execute):
394 * dfg/DFGStructureCheckHoistingPhase.cpp:
395 (JSC::DFG::StructureCheckHoistingPhase::run):
396
commit-queue@webkit.orgb421708a2012-08-17 14:16:23 +00003972012-08-17 Milian Wolff <milian.wolff@kdab.com>
398
399 [Qt] QNX build fails due to ctype usage in system headers
400 https://bugs.webkit.org/show_bug.cgi?id=93849
401
402 Reviewed by Simon Hausmann.
403
404 Move the check for whether DisallowCType should be active or not
405 to the DisallowCType.h header. This way, we can update the list
406 of platforms or OSes which do not work with this header in a
407 central place. All users can now safely include the header
408 and do not need to place custom guards around it.
409
410 * config.h:
411
hausmann@webkit.orgd1aebfb2012-08-17 09:42:31 +00004122012-08-16 Simon Hausmann <simon.hausmann@nokia.com>
413
414 [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
415 https://bugs.webkit.org/show_bug.cgi?id=93872
416
417 Reviewed by Kenneth Rohde Christiansen.
418
419 * Target.pri: Add missing JSWeakObjectMap file to build.
420
fpizlo@apple.comff86f062012-08-16 20:35:12 +00004212012-08-16 Filip Pizlo <fpizlo@apple.com>
422
fpizlo@apple.com00673b32012-08-16 23:17:24 +0000423 Structure check hoisting should be less expensive
424 https://bugs.webkit.org/show_bug.cgi?id=94201
425
426 Reviewed by Mark Hahnenberg.
427
428 This appears like a broad win on short-running programs.
429
430 * dfg/DFGArgumentsSimplificationPhase.cpp:
431 (JSC::DFG::ArgumentsSimplificationPhase::run):
432 * dfg/DFGCSEPhase.cpp:
433 (JSC::DFG::CSEPhase::performNodeCSE):
434 * dfg/DFGDriver.cpp:
435 (JSC::DFG::compile):
436 * dfg/DFGGraph.h:
437 (JSC::DFG::Graph::compareAndSwap):
438 (Graph):
439 (JSC::DFG::Graph::substitute):
440 (JSC::DFG::Graph::substituteGetLocal):
441 * dfg/DFGStructureCheckHoistingPhase.cpp:
442 (JSC::DFG::StructureCheckHoistingPhase::run):
443
4442012-08-16 Filip Pizlo <fpizlo@apple.com>
445
fpizlo@apple.comff86f062012-08-16 20:35:12 +0000446 All op_resolve_global instructions should end up in the list of global resolve instructions
447 https://bugs.webkit.org/show_bug.cgi?id=94247
448 <rdar://problem/12103500>
449
450 Reviewed by Mark Hahnenberg.
451
452 * bytecompiler/BytecodeGenerator.cpp:
453 (JSC::BytecodeGenerator::emitResolveWithBase):
454
commit-queue@webkit.orgb0d27632012-08-15 22:31:26 +00004552012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
456
457 [css3-text] Add CSS3 Text decoration compile flag
458 https://bugs.webkit.org/show_bug.cgi?id=93863
459
460 Reviewed by Julien Chaffraix.
461
462 This patch handles the compile flag implementation, which will come disabled by
463 default, thus not exposing the CSS3 text decoration features to the web, unless
464 when explicitly enabling it with "--css3-text-decoration" build parameter.
465
466 * Configurations/FeatureDefines.xcconfig:
467
commit-queue@webkit.org45974062012-08-15 21:35:55 +00004682012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
469
470 Unreviewed, rolling out r125687.
471 http://trac.webkit.org/changeset/125687
472 https://bugs.webkit.org/show_bug.cgi?id=94147
473
474 It broke the whole world (Requested by Ossy_night on #webkit).
475
476 * API/JSValueRef.cpp:
477 (JSValueToBoolean):
478 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
479 * bytecode/Watchpoint.h:
480 (WatchpointSet):
481 * debugger/DebuggerCallFrame.h:
482 * dfg/DFGAbstractState.cpp:
483 (JSC::DFG::AbstractState::execute):
484 * dfg/DFGCFGSimplificationPhase.cpp:
485 (JSC::DFG::CFGSimplificationPhase::run):
486 * dfg/DFGOperations.cpp:
487 * dfg/DFGOperations.h:
488 * dfg/DFGSpeculativeJIT32_64.cpp:
489 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
490 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
491 (JSC::DFG::SpeculativeJIT::compile):
492 * dfg/DFGSpeculativeJIT64.cpp:
493 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
494 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
495 (JSC::DFG::SpeculativeJIT::compile):
496 * interpreter/Interpreter.cpp:
497 (JSC::Interpreter::privateExecute):
498 * jit/JITOpcodes.cpp:
499 (JSC::JIT::emit_op_is_undefined):
500 (JSC::JIT::emit_op_jeq_null):
501 (JSC::JIT::emit_op_jneq_null):
502 (JSC::JIT::emit_op_eq_null):
503 (JSC::JIT::emit_op_neq_null):
504 * jit/JITOpcodes32_64.cpp:
505 (JSC::JIT::emit_op_is_undefined):
506 (JSC::JIT::emit_op_jeq_null):
507 (JSC::JIT::emit_op_jneq_null):
508 (JSC::JIT::emit_op_eq_null):
509 (JSC::JIT::emit_op_neq_null):
510 * jit/JITStubs.cpp:
511 (JSC::DEFINE_STUB_FUNCTION):
512 * llint/LLIntSlowPaths.cpp:
513 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
514 * llint/LowLevelInterpreter32_64.asm:
515 * llint/LowLevelInterpreter64.asm:
516 * runtime/ArrayPrototype.cpp:
517 (JSC::arrayProtoFuncFilter):
518 (JSC::arrayProtoFuncEvery):
519 (JSC::arrayProtoFuncSome):
520 * runtime/BooleanConstructor.cpp:
521 (JSC::constructBoolean):
522 (JSC::callBooleanConstructor):
523 * runtime/JSCell.h:
524 (JSCell):
525 * runtime/JSGlobalObject.cpp:
526 (JSC::JSGlobalObject::JSGlobalObject):
527 * runtime/JSGlobalObject.h:
528 (JSGlobalObject):
529 * runtime/JSString.h:
530 (JSC::JSCell::toBoolean):
531 (JSC::JSValue::toBoolean):
532 * runtime/JSValue.h:
533 * runtime/ObjectConstructor.cpp:
534 (JSC::toPropertyDescriptor):
535 * runtime/Operations.cpp:
536 (JSC::jsTypeStringForValue):
537 (JSC::jsIsObjectType):
538 * runtime/Operations.h:
539 (JSC):
540 (JSC::JSValue::equalSlowCaseInline):
541 * runtime/RegExpConstructor.cpp:
542 (JSC::setRegExpConstructorMultiline):
543 * runtime/RegExpPrototype.cpp:
544 (JSC::regExpProtoFuncToString):
545 * runtime/Structure.h:
546
commit-queue@webkit.orgb6cc1852012-08-15 21:09:00 +00005472012-08-15 Gabor Ballabas <gaborb@inf.u-szeged.hu>
548
549 Buildfix after r125541
550 https://bugs.webkit.org/show_bug.cgi?id=94097
551
552 Reviewed by Filip Pizlo.
553
554 r125541 has broken the traditional ARM port build of JSC.
555
556 * assembler/MacroAssemblerARM.h:
557 (JSC::MacroAssemblerARM::neg32):
558 (JSC::MacroAssemblerARM::xor32):
559
mhahnenberg@apple.com35d54552012-08-15 18:32:41 +00005602012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
561
562 Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
563 https://bugs.webkit.org/show_bug.cgi?id=93884
564
565 Reviewed by Geoffrey Garen.
566
567 With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
568 MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
569 we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
570 objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
571 For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
572 masquerade as undefined within frame B, but it will continue to masquerade in frame A.
573
574 There are two primary changes that are taking place here. One is to thread the ExecState* through
575 JSValue::toBoolean and JSCell::toBoolean so that JSCell::toBoolean can check the object's
576 JSGlobalObject to compare it to the lexical JSGlobalObject of the currently running code. If the two
577 are distinct, then the object cannot MasqueradeAsUndefined.
578
579 The other change is to perform this comparison of JSGlobalObjects everywhere where the MasqueradesAsUndefined
580 flag in the Structure is checked. For C++ code, this check has been factored into its own function in
581 Structure::masqueradesAsUndefined. We only perform this check in the DFG if the current JSGlobalObject has
582 had a MasqueradesAsUndefined object allocated within its context. This conditional compilation is managed
583 through the use of a WatchpointSet in each JSGlobalObject and alternate create() functions for JS DOM wrappers
584 that are MasqueradesAsUndefined.
585
586 * API/JSValueRef.cpp:
587 (JSValueToBoolean):
588 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
589 * bytecode/Watchpoint.h:
590 (WatchpointSet):
591 * debugger/DebuggerCallFrame.h:
592 (JSC::DebuggerCallFrame::callFrame):
593 * dfg/DFGAbstractState.cpp:
594 (JSC::DFG::AbstractState::execute):
595 * dfg/DFGCFGSimplificationPhase.cpp:
596 (JSC::DFG::CFGSimplificationPhase::run):
597 * dfg/DFGOperations.cpp:
598 * dfg/DFGOperations.h:
599 * dfg/DFGSpeculativeJIT32_64.cpp:
600 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
601 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
602 (JSC::DFG::SpeculativeJIT::compile):
603 * dfg/DFGSpeculativeJIT64.cpp:
604 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
605 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
606 (JSC::DFG::SpeculativeJIT::compile):
607 * interpreter/Interpreter.cpp:
608 (JSC::Interpreter::privateExecute):
609 * jit/JITOpcodes.cpp:
610 (JSC::JIT::emit_op_is_undefined):
611 (JSC::JIT::emit_op_jeq_null):
612 (JSC::JIT::emit_op_jneq_null):
613 (JSC::JIT::emit_op_eq_null):
614 (JSC::JIT::emit_op_neq_null):
615 * jit/JITOpcodes32_64.cpp:
616 (JSC::JIT::emit_op_is_undefined):
617 (JSC::JIT::emit_op_jeq_null):
618 (JSC::JIT::emit_op_jneq_null):
619 (JSC::JIT::emit_op_eq_null):
620 (JSC::JIT::emit_op_neq_null):
621 * jit/JITStubs.cpp:
622 (JSC::DEFINE_STUB_FUNCTION):
623 * llint/LLIntSlowPaths.cpp:
624 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
625 * llint/LowLevelInterpreter32_64.asm:
626 * llint/LowLevelInterpreter64.asm:
627 * runtime/ArrayPrototype.cpp:
628 (JSC::arrayProtoFuncFilter):
629 (JSC::arrayProtoFuncEvery):
630 (JSC::arrayProtoFuncSome):
631 * runtime/BooleanConstructor.cpp:
632 (JSC::constructBoolean):
633 (JSC::callBooleanConstructor):
634 * runtime/JSCell.h:
635 (JSCell):
636 * runtime/JSGlobalObject.cpp:
637 (JSC::JSGlobalObject::JSGlobalObject):
638 * runtime/JSGlobalObject.h:
639 (JSGlobalObject):
640 (JSC::JSGlobalObject::masqueradesAsUndefinedWatchpoint):
641 * runtime/JSString.h:
642 (JSC::JSCell::toBoolean):
643 (JSC::JSValue::toBoolean):
644 * runtime/JSValue.h:
645 * runtime/ObjectConstructor.cpp:
646 (JSC::toPropertyDescriptor):
647 * runtime/Operations.cpp:
648 (JSC::jsTypeStringForValue):
649 (JSC::jsIsObjectType):
650 * runtime/Operations.h:
651 (JSC):
652 (JSC::JSValue::equalSlowCaseInline):
653 * runtime/RegExpConstructor.cpp:
654 (JSC::setRegExpConstructorMultiline):
655 * runtime/RegExpPrototype.cpp:
656 (JSC::regExpProtoFuncToString):
657 * runtime/Structure.h:
658 (Structure):
659 (JSC::Structure::globalObjectOffset):
660 (JSC::Structure::masqueradesAsUndefined):
661 (JSC):
662
fpizlo@apple.coma0c9a0a2012-08-15 03:10:57 +00006632012-08-14 Filip Pizlo <fpizlo@apple.com>
664
665 Unreviewed, build fix for !ENABLE(DFG_JIT)
666
667 * jit/JITPropertyAccess.cpp:
668 (JSC::JIT::emit_op_get_by_val):
669 (JSC::JIT::emit_op_put_by_val):
670 (JSC::JIT::privateCompilePatchGetArrayLength):
671 * jit/JITPropertyAccess32_64.cpp:
672 (JSC::JIT::emit_op_get_by_val):
673 (JSC::JIT::emit_op_put_by_val):
674 (JSC::JIT::privateCompilePatchGetArrayLength):
675 * llint/LowLevelInterpreter32_64.asm:
676 * llint/LowLevelInterpreter64.asm:
677
fpizlo@apple.comf24804c2012-08-15 02:48:35 +00006782012-08-13 Filip Pizlo <fpizlo@apple.com>
679
680 Array checks should use the structure, not the class info
681 https://bugs.webkit.org/show_bug.cgi?id=93150
682
683 Reviewed by Mark Hahnenberg.
684
685 This changes all array checks used in array accesses (get, put, get length,
686 push, pop) to use the structure, not the class info. Additionally, these
687 checks in the LLInt and baseline JIT record the structure in an ArrayProfile,
688 so that the DFG can know exactly what structure to check for.
689
690 * CMakeLists.txt:
691 * GNUmakefile.list.am:
692 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
693 * JavaScriptCore.xcodeproj/project.pbxproj:
694 * Target.pri:
695 * bytecode/ArrayProfile.cpp: Added.
696 (JSC):
697 (JSC::ArrayProfile::computeUpdatedPrediction):
698 * bytecode/ArrayProfile.h: Added.
699 (JSC):
700 (JSC::arrayModeFromStructure):
701 (ArrayProfile):
702 (JSC::ArrayProfile::ArrayProfile):
703 (JSC::ArrayProfile::bytecodeOffset):
704 (JSC::ArrayProfile::addressOfLastSeenStructure):
705 (JSC::ArrayProfile::observeStructure):
706 (JSC::ArrayProfile::expectedStructure):
707 (JSC::ArrayProfile::structureIsPolymorphic):
708 (JSC::ArrayProfile::hasDefiniteStructure):
709 (JSC::ArrayProfile::observedArrayModes):
710 * bytecode/CodeBlock.cpp:
711 (JSC::CodeBlock::dump):
712 (JSC::CodeBlock::getArrayProfile):
713 (JSC):
714 (JSC::CodeBlock::getOrAddArrayProfile):
715 (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
716 * bytecode/CodeBlock.h:
717 (JSC::CodeBlock::executionEntryCount):
718 (JSC::CodeBlock::numberOfArrayProfiles):
719 (JSC::CodeBlock::arrayProfiles):
720 (JSC::CodeBlock::addArrayProfile):
721 (CodeBlock):
722 * bytecode/Instruction.h:
723 (JSC):
724 (JSC::Instruction::Instruction):
725 * bytecode/Opcode.h:
726 (JSC):
727 (JSC::padOpcodeName):
728 * bytecompiler/BytecodeGenerator.cpp:
729 (JSC::BytecodeGenerator::emitGetArgumentByVal):
730 (JSC::BytecodeGenerator::emitGetByVal):
731 (JSC::BytecodeGenerator::emitPutByVal):
732 * dfg/DFGAbstractState.cpp:
733 (JSC::DFG::AbstractState::initialize):
734 (JSC::DFG::AbstractState::execute):
735 * dfg/DFGAbstractValue.h:
736 (JSC::DFG::StructureAbstractValue::hasSingleton):
737 (StructureAbstractValue):
738 (JSC::DFG::StructureAbstractValue::singleton):
739 * dfg/DFGArgumentsSimplificationPhase.cpp:
740 (JSC::DFG::ArgumentsSimplificationPhase::run):
741 * dfg/DFGByteCodeParser.cpp:
742 (JSC::DFG::ByteCodeParser::parseBlock):
743 * dfg/DFGFixupPhase.cpp:
744 (JSC::DFG::FixupPhase::fixupNode):
745 * dfg/DFGSpeculativeJIT.cpp:
746 (JSC::DFG::SpeculativeJIT::speculateArray):
747 (DFG):
748 (JSC::DFG::SpeculativeJIT::compile):
749 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
750 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
751 * dfg/DFGSpeculativeJIT.h:
752 (SpeculativeJIT):
753 * dfg/DFGSpeculativeJIT32_64.cpp:
754 (JSC::DFG::SpeculativeJIT::compile):
755 * dfg/DFGSpeculativeJIT64.cpp:
756 (JSC::DFG::SpeculativeJIT::compile):
757 * dfg/DFGStructureCheckHoistingPhase.cpp:
758 (JSC::DFG::StructureCheckHoistingPhase::run):
759 * jit/JITPropertyAccess.cpp:
760 (JSC::JIT::emit_op_get_by_val):
761 (JSC::JIT::emit_op_put_by_val):
762 (JSC::JIT::privateCompilePatchGetArrayLength):
763 * jit/JITPropertyAccess32_64.cpp:
764 (JSC::JIT::emit_op_get_by_val):
765 (JSC::JIT::emit_op_put_by_val):
766 (JSC::JIT::privateCompilePatchGetArrayLength):
767 * llint/LLIntOffsetsExtractor.cpp:
768 * llint/LowLevelInterpreter32_64.asm:
769 * llint/LowLevelInterpreter64.asm:
770 * runtime/Structure.h:
771 (Structure):
772 (JSC::Structure::classInfoOffset):
773
commit-queue@webkit.orgb1409632012-08-14 11:28:25 +00007742012-08-14 Gabor Ballabas <gaborb@inf.u-szeged.hu>
775
776 Rename functions in the ARM port of DFG-JIT for better code readability.
777 https://bugs.webkit.org/show_bug.cgi?id=93609
778
779 Reviewed by Zoltan Herczeg.
780
781 Rename functions in the ARM port of DFG-JIT for better code
782 readability, and for following the WebKit coding style
783 wherever it is possible.
784
785 * assembler/ARMAssembler.cpp:
786 (JSC::ARMAssembler::genInt):
787 (JSC::ARMAssembler::getImm):
788 (JSC::ARMAssembler::moveImm):
789 (JSC::ARMAssembler::encodeComplexImm):
790 (JSC::ARMAssembler::dataTransfer32):
791 (JSC::ARMAssembler::baseIndexTransfer32):
792 (JSC::ARMAssembler::dataTransfer16):
793 (JSC::ARMAssembler::baseIndexTransfer16):
794 (JSC::ARMAssembler::dataTransferFloat):
795 (JSC::ARMAssembler::baseIndexTransferFloat):
796 * assembler/ARMAssembler.h:
797 (JSC::ARMAssembler::bitAnd):
798 (JSC::ARMAssembler::bitAnds):
799 (JSC::ARMAssembler::eor):
800 (JSC::ARMAssembler::eors):
801 (JSC::ARMAssembler::sub):
802 (JSC::ARMAssembler::subs):
803 (JSC::ARMAssembler::rsb):
804 (JSC::ARMAssembler::rsbs):
805 (JSC::ARMAssembler::add):
806 (JSC::ARMAssembler::adds):
807 (JSC::ARMAssembler::adc):
808 (JSC::ARMAssembler::adcs):
809 (JSC::ARMAssembler::sbc):
810 (JSC::ARMAssembler::sbcs):
811 (JSC::ARMAssembler::rsc):
812 (JSC::ARMAssembler::rscs):
813 (JSC::ARMAssembler::tst):
814 (JSC::ARMAssembler::teq):
815 (JSC::ARMAssembler::cmp):
816 (JSC::ARMAssembler::cmn):
817 (JSC::ARMAssembler::orr):
818 (JSC::ARMAssembler::orrs):
819 (JSC::ARMAssembler::mov):
820 (JSC::ARMAssembler::movw):
821 (JSC::ARMAssembler::movt):
822 (JSC::ARMAssembler::movs):
823 (JSC::ARMAssembler::bic):
824 (JSC::ARMAssembler::bics):
825 (JSC::ARMAssembler::mvn):
826 (JSC::ARMAssembler::mvns):
827 (JSC::ARMAssembler::mul):
828 (JSC::ARMAssembler::muls):
829 (JSC::ARMAssembler::mull):
830 (JSC::ARMAssembler::vmov_f64):
831 (JSC::ARMAssembler::vadd_f64):
832 (JSC::ARMAssembler::vdiv_f64):
833 (JSC::ARMAssembler::vsub_f64):
834 (JSC::ARMAssembler::vmul_f64):
835 (JSC::ARMAssembler::vcmp_f64):
836 (JSC::ARMAssembler::vsqrt_f64):
837 (JSC::ARMAssembler::vabs_f64):
838 (JSC::ARMAssembler::vneg_f64):
839 (JSC::ARMAssembler::ldrImmediate):
840 (JSC::ARMAssembler::ldrUniqueImmediate):
841 (JSC::ARMAssembler::dtrUp):
842 (JSC::ARMAssembler::dtrUpRegister):
843 (JSC::ARMAssembler::dtrDown):
844 (JSC::ARMAssembler::dtrDownRegister):
845 (JSC::ARMAssembler::halfDtrUp):
846 (JSC::ARMAssembler::halfDtrUpRegister):
847 (JSC::ARMAssembler::halfDtrDown):
848 (JSC::ARMAssembler::halfDtrDownRegister):
849 (JSC::ARMAssembler::doubleDtrUp):
850 (JSC::ARMAssembler::doubleDtrDown):
851 (JSC::ARMAssembler::push):
852 (JSC::ARMAssembler::pop):
853 (JSC::ARMAssembler::poke):
854 (JSC::ARMAssembler::peek):
855 (JSC::ARMAssembler::vmov_vfp64):
856 (JSC::ARMAssembler::vmov_arm64):
857 (JSC::ARMAssembler::vmov_vfp32):
858 (JSC::ARMAssembler::vmov_arm32):
859 (JSC::ARMAssembler::vcvt_f64_s32):
860 (JSC::ARMAssembler::vcvt_s32_f64):
861 (JSC::ARMAssembler::vcvt_u32_f64):
862 (JSC::ARMAssembler::vcvt_f64_f32):
863 (JSC::ARMAssembler::vcvt_f32_f64):
864 (JSC::ARMAssembler::clz):
865 (JSC::ARMAssembler::lslRegister):
866 (JSC::ARMAssembler::lsrRegister):
867 (JSC::ARMAssembler::asrRegister):
868 (JSC::ARMAssembler::align):
869 (JSC::ARMAssembler::loadBranchTarget):
870 (JSC::ARMAssembler::vmov):
871 * assembler/MacroAssemblerARM.cpp:
872 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
873 * assembler/MacroAssemblerARM.h:
874 (JSC::MacroAssemblerARM::add32):
875 (JSC::MacroAssemblerARM::and32):
876 (JSC::MacroAssemblerARM::lshift32):
877 (JSC::MacroAssemblerARM::mul32):
878 (JSC::MacroAssemblerARM::or32):
879 (JSC::MacroAssemblerARM::rshift32):
880 (JSC::MacroAssemblerARM::urshift32):
881 (JSC::MacroAssemblerARM::sub32):
882 (JSC::MacroAssemblerARM::xor32):
883 (JSC::MacroAssemblerARM::countLeadingZeros32):
884 (JSC::MacroAssemblerARM::convertibleLoadPtr):
885 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
886 (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
887 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
888 (JSC::MacroAssemblerARM::store32):
889 (JSC::MacroAssemblerARM::pop):
890 (JSC::MacroAssemblerARM::push):
891 (JSC::MacroAssemblerARM::move):
892 (JSC::MacroAssemblerARM::swap):
893 (JSC::MacroAssemblerARM::branch32):
894 (JSC::MacroAssemblerARM::branchTest32):
895 (JSC::MacroAssemblerARM::mull32):
896 (JSC::MacroAssemblerARM::branchSub32):
897 (JSC::MacroAssemblerARM::compare32):
898 (JSC::MacroAssemblerARM::test32):
899 (JSC::MacroAssemblerARM::load32):
900 (JSC::MacroAssemblerARM::relativeTableJump):
901 (JSC::MacroAssemblerARM::moveWithPatch):
902 (JSC::MacroAssemblerARM::loadDouble):
903 (JSC::MacroAssemblerARM::moveDouble):
904 (JSC::MacroAssemblerARM::addDouble):
905 (JSC::MacroAssemblerARM::divDouble):
906 (JSC::MacroAssemblerARM::subDouble):
907 (JSC::MacroAssemblerARM::mulDouble):
908 (JSC::MacroAssemblerARM::sqrtDouble):
909 (JSC::MacroAssemblerARM::absDouble):
910 (JSC::MacroAssemblerARM::negateDouble):
911 (JSC::MacroAssemblerARM::convertInt32ToDouble):
912 (JSC::MacroAssemblerARM::convertFloatToDouble):
913 (JSC::MacroAssemblerARM::convertDoubleToFloat):
914 (JSC::MacroAssemblerARM::branchDouble):
915 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
916 (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
917 (JSC::MacroAssemblerARM::truncateDoubleToInt32):
918 (JSC::MacroAssemblerARM::truncateDoubleToUint32):
919 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
920 (JSC::MacroAssemblerARM::branchDoubleNonZero):
921 (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
922
hausmann@webkit.orge9a69542012-08-13 20:44:33 +00009232012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
924
hausmann@webkit.org029be3e2012-08-13 21:37:19 +0000925 Unreviewed, rolling out r125444.
926 http://trac.webkit.org/changeset/125444
927 https://bugs.webkit.org/show_bug.cgi?id=93872
928
929 Broke some tests
930
931 * Target.pri:
932
9332012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
934
hausmann@webkit.orge9a69542012-08-13 20:44:33 +0000935 [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
936 https://bugs.webkit.org/show_bug.cgi?id=93872
937
938 Reviewed by Kenneth Rohde Christiansen.
939
940 * Target.pri: Add missing JSWeakObjectMap file to build.
941
rakuco@webkit.org56218832012-08-13 20:38:06 +00009422012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
943
944 [CMake] Remove glib-related Find modules and write single new one instead.
945 https://bugs.webkit.org/show_bug.cgi?id=93786
946
947 Reviewed by Rob Buis.
948
949 * shell/PlatformEfl.cmake: Use GLIB_* instead of Glib_*.
950
allan.jensen@nokia.com3c6f1522012-08-12 11:47:34 +00009512012-08-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
952
953 Doesn't build with ENABLE_JIT=0
954 https://bugs.webkit.org/show_bug.cgi?id=85042
955
956 Reviewed by Eric Seidel.
957
958 Include headers without which CallFrame.h does not build, and
959 fix gcc warning about comparing unsigned int with 0.
960
961 * dfg/DFGDriver.cpp:
962 * interpreter/Interpreter.cpp:
963 (JSC::Interpreter::isOpcode):
964
commit-queue@webkit.org2d9f0782012-08-10 16:21:25 +00009652012-08-10 Yong Li <yoli@rim.com>
966
967 [BlackBerry] GCActivityCallback should always schedule GC even allocated bytes is a small number
968 https://bugs.webkit.org/show_bug.cgi?id=93650
969
970 Reviewed by Rob Buis.
971
972 Even a small number of allocated JS objects could hold expensive resources.
973
974 * runtime/GCActivityCallbackBlackBerry.cpp:
975 (JSC::DefaultGCActivityCallback::didAllocate):
976
commit-queue@webkit.orgb849db72012-08-09 20:38:56 +00009772012-08-09 Yong Li <yoli@rim.com>
978
979 [QNX] Implement getCPUTime() for OS(QNX)
980 https://bugs.webkit.org/show_bug.cgi?id=93516
981
982 Reviewed by George Staikos.
983
984 Implement getCPUTime() with CLOCK_THREAD_CPUTIME_ID so it will tell
985 exactly how long the current thread has spent without being impacted
986 by other things.
987
988 * runtime/TimeoutChecker.cpp:
989 (JSC::getCPUTime):
990
commit-queue@webkit.org656e6522012-08-09 02:29:35 +00009912012-08-08 Shane Stephens <shanestephens@google.com>
992
993 Compile flag for CSS Hierarchies
994 https://bugs.webkit.org/show_bug.cgi?id=92433
995
996 Reviewed by Tony Chang.
997
998 * Configurations/FeatureDefines.xcconfig:
999
benjamin@webkit.org58ac4792012-08-09 01:29:44 +000010002012-08-08 Benjamin Poulain <bpoulain@apple.com>
1001
1002 Use char* instead of LChar* for the public interface of String construction from literals
1003 https://bugs.webkit.org/show_bug.cgi?id=93402
1004
1005 Reviewed by Michael Saboff.
1006
1007 Update JSC' Identifier to use StringImpl::createFromLiteral with a char*.
1008
1009 * runtime/Identifier.cpp:
1010 (JSC::IdentifierASCIIStringTranslator::translate):
1011
paroga@webkit.orgcb73ac52012-08-08 07:31:12 +000010122012-08-08 Patrick Gansterer <paroga@webkit.org>
1013
paroga@webkit.org34230a82012-08-08 10:43:48 +00001014 Remove ce_time.(cpp|h) from list of source files
1015 https://bugs.webkit.org/show_bug.cgi?id=93446
1016
1017 Reviewed by Simon Hausmann.
1018
1019 r125004 removed the last dependency on functions defined in ce_time.cpp.
1020
1021 * Target.pri:
1022
10232012-08-08 Patrick Gansterer <paroga@webkit.org>
1024
paroga@webkit.orgcb73ac52012-08-08 07:31:12 +00001025 [WIN] Use GetTimeZoneInformation() for getting the timezone name
1026 https://bugs.webkit.org/show_bug.cgi?id=91936
1027
1028 Reviewed by Ryosuke Niwa.
1029
1030 The MS CRT implementation of strftime calls the same functions in the background.
1031 Using them directly avoids the overhead of parsing the format string and removes
1032 the dependency on strftime() for WinCE where this function does not exist.
1033
1034 * runtime/DateConversion.cpp:
1035 (JSC::formatTime):
1036
commit-queue@webkit.org3dfe8ce2012-08-07 22:55:04 +000010372012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
1038
1039 Refactor magic numbers in the ARM port of DFG-JIT
1040 https://bugs.webkit.org/show_bug.cgi?id=93348
1041
1042 Reviewed by Eric Seidel.
1043
1044 Introduce new names for hard-coded magic numbers.
1045 Refactor constant with confusing names to more descriptive ones.
1046
1047 * assembler/ARMAssembler.cpp:
1048 (JSC::ARMAssembler::patchConstantPoolLoad):
1049 (JSC::ARMAssembler::getOp2):
1050 (JSC::ARMAssembler::genInt):
1051 (JSC::ARMAssembler::getImm):
1052 (JSC::ARMAssembler::moveImm):
1053 (JSC::ARMAssembler::encodeComplexImm):
1054 (JSC::ARMAssembler::dataTransfer32):
1055 (JSC::ARMAssembler::dataTransfer16):
1056 (JSC::ARMAssembler::dataTransferFloat):
1057 (JSC::ARMAssembler::executableCopy):
1058 * assembler/ARMAssembler.h:
1059 (JSC::ARMAssembler::emitInstruction):
1060 (JSC::ARMAssembler::ands_r):
1061 (JSC::ARMAssembler::eors_r):
1062 (JSC::ARMAssembler::subs_r):
1063 (JSC::ARMAssembler::rsbs_r):
1064 (JSC::ARMAssembler::adds_r):
1065 (JSC::ARMAssembler::adcs_r):
1066 (JSC::ARMAssembler::sbcs_r):
1067 (JSC::ARMAssembler::rscs_r):
1068 (JSC::ARMAssembler::tst_r):
1069 (JSC::ARMAssembler::teq_r):
1070 (JSC::ARMAssembler::cmp_r):
1071 (JSC::ARMAssembler::cmn_r):
1072 (JSC::ARMAssembler::orrs_r):
1073 (JSC::ARMAssembler::movs_r):
1074 (JSC::ARMAssembler::bics_r):
1075 (JSC::ARMAssembler::mvns_r):
1076 (JSC::ARMAssembler::muls_r):
1077 (JSC::ARMAssembler::ldr_imm):
1078 (JSC::ARMAssembler::ldr_un_imm):
1079 (JSC::ARMAssembler::dtr_u):
1080 (JSC::ARMAssembler::dtr_ur):
1081 (JSC::ARMAssembler::dtr_dr):
1082 (JSC::ARMAssembler::dtrh_u):
1083 (JSC::ARMAssembler::dtrh_ur):
1084 (JSC::ARMAssembler::fdtr_u):
1085 (JSC::ARMAssembler::push_r):
1086 (JSC::ARMAssembler::pop_r):
1087 (JSC::ARMAssembler::getLdrImmAddress):
1088 (JSC::ARMAssembler::getLdrImmAddressOnPool):
1089 (JSC::ARMAssembler::patchConstantPoolLoad):
1090 (JSC::ARMAssembler::repatchCompact):
1091 (JSC::ARMAssembler::replaceWithJump):
1092 (JSC::ARMAssembler::replaceWithLoad):
1093 (JSC::ARMAssembler::replaceWithAddressComputation):
1094 (JSC::ARMAssembler::getOp2Byte):
1095 (JSC::ARMAssembler::getOp2Half):
1096 (JSC::ARMAssembler::getImm16Op2):
1097 (JSC::ARMAssembler::placeConstantPoolBarrier):
1098 (JSC::ARMAssembler::getConditionalField):
1099 * assembler/MacroAssemblerARM.cpp:
1100 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
1101 * assembler/MacroAssemblerARM.h:
1102 (JSC::MacroAssemblerARM::and32):
1103 (JSC::MacroAssemblerARM::branch32):
1104 (JSC::MacroAssemblerARM::branchTest32):
1105 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
1106
benjamin@webkit.orgd02c5572012-08-07 21:46:07 +000011072012-08-07 Benjamin Poulain <benjamin@webkit.org>
1108
1109 Use the initialization from literal for JSC's Identifiers
1110 https://bugs.webkit.org/show_bug.cgi?id=93193
1111
1112 Reviewed by Geoffrey Garen.
1113
1114 This patches modify Identifier ot take advantage of the new initialization from literal.
1115
1116 In addition to the memory savings (~600bytes per instance), this gives us a 2% speed
1117 improvement on CommonIdentifiers on average.
1118
1119 * runtime/CommonIdentifiers.cpp:
1120 (JSC::CommonIdentifiers::CommonIdentifiers):
1121 Null and empty strings are forbidden for literal initialization. Use the most efficient constructors
1122 instead of a literal.
1123
1124 * runtime/Identifier.cpp:
1125 (IdentifierASCIIStringTranslator):
1126 Rename IdentifierCStringTranslator to IdentifierASCIIStringTranslator to make the text encoding
1127 explicit.
1128 (JSC::IdentifierASCIIStringTranslator::hash):
1129 (JSC::IdentifierASCIIStringTranslator::equal):
1130 (JSC::IdentifierASCIIStringTranslator::translate): Use the fast initialization from literal.
1131 (JSC::Identifier::add):
1132 * runtime/Identifier.h:
1133 (JSC::Identifier::Identifier):
1134
hausmann@webkit.orga0580522012-08-07 09:24:21 +000011352012-08-07 Simon Hausmann <simon.hausmann@nokia.com>
1136
1137 [Qt][Win] Remove pthreads linkage
1138
1139 Reviewed by Csaba Osztrogonác.
1140
1141 After r124823 linkage to pthreads is not needed anymore for the Windows
1142 build.
1143
1144 * JavaScriptCore.pri:
1145
commit-queue@webkit.org6c4f9272012-08-07 08:50:43 +000011462012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
1147
1148 Refactor emit*Inst functions and introduce toARMWord functions in DFG-JIT's traditional ARM port
1149 https://bugs.webkit.org/show_bug.cgi?id=93266
1150
1151 Reviewed by Csaba Osztrogonác.
1152
1153 First part of a bigger refactoring issue trying to make traditional
1154 ARM DFG-JIT port easier to read and understand.
1155
1156
1157 * assembler/ARMAssembler.h:
1158 (JSC::ARMAssembler::emitInstruction):
1159 (JSC::ARMAssembler::emitDoublePrecisionInstruction):
1160 (JSC::ARMAssembler::emitSinglePrecisionInstruction):
1161 (JSC::ARMAssembler::and_r):
1162 (JSC::ARMAssembler::ands_r):
1163 (JSC::ARMAssembler::eor_r):
1164 (JSC::ARMAssembler::eors_r):
1165 (JSC::ARMAssembler::sub_r):
1166 (JSC::ARMAssembler::subs_r):
1167 (JSC::ARMAssembler::rsb_r):
1168 (JSC::ARMAssembler::rsbs_r):
1169 (JSC::ARMAssembler::add_r):
1170 (JSC::ARMAssembler::adds_r):
1171 (JSC::ARMAssembler::adc_r):
1172 (JSC::ARMAssembler::adcs_r):
1173 (JSC::ARMAssembler::sbc_r):
1174 (JSC::ARMAssembler::sbcs_r):
1175 (JSC::ARMAssembler::rsc_r):
1176 (JSC::ARMAssembler::rscs_r):
1177 (JSC::ARMAssembler::tst_r):
1178 (JSC::ARMAssembler::teq_r):
1179 (JSC::ARMAssembler::cmp_r):
1180 (JSC::ARMAssembler::cmn_r):
1181 (JSC::ARMAssembler::orr_r):
1182 (JSC::ARMAssembler::orrs_r):
1183 (JSC::ARMAssembler::mov_r):
1184 (JSC::ARMAssembler::movw_r):
1185 (JSC::ARMAssembler::movt_r):
1186 (JSC::ARMAssembler::movs_r):
1187 (JSC::ARMAssembler::bic_r):
1188 (JSC::ARMAssembler::bics_r):
1189 (JSC::ARMAssembler::mvn_r):
1190 (JSC::ARMAssembler::mvns_r):
1191 (JSC::ARMAssembler::mul_r):
1192 (JSC::ARMAssembler::muls_r):
1193 (JSC::ARMAssembler::mull_r):
1194 (JSC::ARMAssembler::vmov_f64_r):
1195 (JSC::ARMAssembler::vadd_f64_r):
1196 (JSC::ARMAssembler::vdiv_f64_r):
1197 (JSC::ARMAssembler::vsub_f64_r):
1198 (JSC::ARMAssembler::vmul_f64_r):
1199 (JSC::ARMAssembler::vcmp_f64_r):
1200 (JSC::ARMAssembler::vsqrt_f64_r):
1201 (JSC::ARMAssembler::vabs_f64_r):
1202 (JSC::ARMAssembler::vneg_f64_r):
1203 (JSC::ARMAssembler::ldr_imm):
1204 (JSC::ARMAssembler::ldr_un_imm):
1205 (JSC::ARMAssembler::dtr_u):
1206 (JSC::ARMAssembler::dtr_ur):
1207 (JSC::ARMAssembler::dtr_d):
1208 (JSC::ARMAssembler::dtr_dr):
1209 (JSC::ARMAssembler::dtrh_u):
1210 (JSC::ARMAssembler::dtrh_ur):
1211 (JSC::ARMAssembler::dtrh_d):
1212 (JSC::ARMAssembler::dtrh_dr):
1213 (JSC::ARMAssembler::fdtr_u):
1214 (JSC::ARMAssembler::fdtr_d):
1215 (JSC::ARMAssembler::push_r):
1216 (JSC::ARMAssembler::pop_r):
1217 (JSC::ARMAssembler::vmov_vfp64_r):
1218 (JSC::ARMAssembler::vmov_arm64_r):
1219 (JSC::ARMAssembler::vmov_vfp32_r):
1220 (JSC::ARMAssembler::vmov_arm32_r):
1221 (JSC::ARMAssembler::vcvt_f64_s32_r):
1222 (JSC::ARMAssembler::vcvt_s32_f64_r):
1223 (JSC::ARMAssembler::vcvt_u32_f64_r):
1224 (JSC::ARMAssembler::vcvt_f64_f32_r):
1225 (JSC::ARMAssembler::vcvt_f32_f64_r):
1226 (JSC::ARMAssembler::vmrs_apsr):
1227 (JSC::ARMAssembler::clz_r):
1228 (JSC::ARMAssembler::bx):
1229 (JSC::ARMAssembler::blx):
1230 (JSC::ARMAssembler::linkJump):
1231 (JSC::ARMAssembler::toARMWord):
1232 (ARMAssembler):
1233
paroga@webkit.orgf5643b92012-08-06 23:46:11 +000012342012-08-06 Patrick Gansterer <paroga@webkit.org>
1235
paroga@webkit.org156fc552012-08-07 00:29:14 +00001236 [WIN] Remove dependency on pthread from MachineStackMarker
1237 https://bugs.webkit.org/show_bug.cgi?id=68429
1238
1239 Reviewed by Geoffrey Garen.
1240
1241 Windows has no support for calling a destructor for thread specific data.
1242 Since we need more control over creating and deleting thread specific keys
1243 we can not simply extend WTF::ThreadSpecific with this functionality.
1244
1245 All thread specific keys created via the new API get stored in a list.
1246 After a thread function finished we iterate over this list and call
1247 the registered destructor for every item if needed.
1248
1249 * heap/MachineStackMarker.cpp: Use the new functions instead of pthread directly.
1250 (JSC::MachineThreads::~MachineThreads):
1251 (JSC::MachineThreads::makeUsableFromMultipleThreads):
1252 (JSC::MachineThreads::addCurrentThread):
1253 * heap/MachineStackMarker.h:
1254 (MachineThreads):
1255
12562012-08-06 Patrick Gansterer <paroga@webkit.org>
1257
paroga@webkit.orgf5643b92012-08-06 23:46:11 +00001258 Unify JSC date and time formating functions
1259 https://bugs.webkit.org/show_bug.cgi?id=92282
1260
1261 Reviewed by Geoffrey Garen.
1262
1263 Replace the existing functions for formating GregorianDateTime
1264 with one single function. This removes some code duplications
1265 in DatePrototype and is a preperation to fix encoding issues,
1266 since we can add UChar* values to the resulting string now.
1267
1268 * runtime/DateConstructor.cpp:
1269 (JSC::callDate):
1270 * runtime/DateConversion.cpp:
1271 (JSC::formatDateTime):
1272 * runtime/DateConversion.h:
1273 (JSC):
1274 * runtime/DatePrototype.cpp:
1275 (JSC::formateDateInstance):
1276 (JSC::dateProtoFuncToString):
1277 (JSC::dateProtoFuncToUTCString):
1278 (JSC::dateProtoFuncToDateString):
1279 (JSC::dateProtoFuncToTimeString):
1280 (JSC::dateProtoFuncToGMTString):
1281
carlosgc@webkit.orga6cd87d2012-08-06 12:35:28 +000012822012-08-06 Carlos Garcia Campos <cgarcia@igalia.com>
1283
1284 Unreviewed. Fix make distcheck.
1285
1286 * GNUmakefile.list.am: Add missing header file.
1287
commit-queue@webkit.org1b331cb2012-08-06 03:16:46 +000012882012-08-05 Peter Wang <peter.wang@torchmobile.com.cn>
1289
1290 Web Inspector: [JSC] implement setting breakpoints by line:column
1291 https://bugs.webkit.org/show_bug.cgi?id=53003
1292
1293 Reviewed by Geoffrey Garen.
1294
1295 Add a counter to Lexer to record the column info of each Token. Add a column parameter to
1296 op_debug, cti_op_debug, and _llint_op_debug byte-code command.
1297
1298 * bytecode/CodeBlock.cpp:
1299 (JSC::CodeBlock::dump):
1300 * bytecode/Opcode.h:
1301 (JSC):
1302 (JSC::padOpcodeName):
1303 * bytecompiler/BytecodeGenerator.cpp:
1304 (JSC::BytecodeGenerator::resolve):
1305 (JSC::BytecodeGenerator::emitDebugHook):
1306 * bytecompiler/BytecodeGenerator.h:
1307 (BytecodeGenerator):
1308 * bytecompiler/NodesCodegen.cpp:
1309 (JSC::ArrayNode::toArgumentList):
1310 (JSC::ApplyFunctionCallDotNode::emitBytecode):
1311 (JSC::ConstStatementNode::emitBytecode):
1312 (JSC::EmptyStatementNode::emitBytecode):
1313 (JSC::DebuggerStatementNode::emitBytecode):
1314 (JSC::ExprStatementNode::emitBytecode):
1315 (JSC::VarStatementNode::emitBytecode):
1316 (JSC::IfNode::emitBytecode):
1317 (JSC::IfElseNode::emitBytecode):
1318 (JSC::DoWhileNode::emitBytecode):
1319 (JSC::WhileNode::emitBytecode):
1320 (JSC::ForNode::emitBytecode):
1321 (JSC::ForInNode::emitBytecode):
1322 (JSC::ContinueNode::emitBytecode):
1323 (JSC::BreakNode::emitBytecode):
1324 (JSC::ReturnNode::emitBytecode):
1325 (JSC::WithNode::emitBytecode):
1326 (JSC::SwitchNode::emitBytecode):
1327 (JSC::LabelNode::emitBytecode):
1328 (JSC::ThrowNode::emitBytecode):
1329 (JSC::TryNode::emitBytecode):
1330 (JSC::ProgramNode::emitBytecode):
1331 (JSC::EvalNode::emitBytecode):
1332 (JSC::FunctionBodyNode::emitBytecode):
1333 * debugger/Debugger.h:
1334 * interpreter/Interpreter.cpp:
1335 (JSC::Interpreter::unwindCallFrame):
1336 (JSC::Interpreter::throwException):
1337 (JSC::Interpreter::debug):
1338 (JSC::Interpreter::privateExecute):
1339 * interpreter/Interpreter.h:
1340 (Interpreter):
1341 * jit/JITOpcodes.cpp:
1342 (JSC::JIT::emit_op_debug):
1343 * jit/JITOpcodes32_64.cpp:
1344 (JSC::JIT::emit_op_debug):
1345 * jit/JITStubs.cpp:
1346 (JSC::DEFINE_STUB_FUNCTION):
1347 * llint/LLIntSlowPaths.cpp:
1348 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1349 * llint/LowLevelInterpreter.asm:
1350 * parser/ASTBuilder.h:
1351 (ASTBuilder):
1352 (JSC::ASTBuilder::createCommaExpr):
1353 (JSC::ASTBuilder::createLogicalNot):
1354 (JSC::ASTBuilder::createUnaryPlus):
1355 (JSC::ASTBuilder::createVoid):
1356 (JSC::ASTBuilder::thisExpr):
1357 (JSC::ASTBuilder::createResolve):
1358 (JSC::ASTBuilder::createObjectLiteral):
1359 (JSC::ASTBuilder::createArray):
1360 (JSC::ASTBuilder::createNumberExpr):
1361 (JSC::ASTBuilder::createString):
1362 (JSC::ASTBuilder::createBoolean):
1363 (JSC::ASTBuilder::createNull):
1364 (JSC::ASTBuilder::createBracketAccess):
1365 (JSC::ASTBuilder::createDotAccess):
1366 (JSC::ASTBuilder::createRegExp):
1367 (JSC::ASTBuilder::createNewExpr):
1368 (JSC::ASTBuilder::createConditionalExpr):
1369 (JSC::ASTBuilder::createAssignResolve):
1370 (JSC::ASTBuilder::createFunctionExpr):
1371 (JSC::ASTBuilder::createFunctionBody):
1372 (JSC::ASTBuilder::createGetterOrSetterProperty):
1373 (JSC::ASTBuilder::createArgumentsList):
1374 (JSC::ASTBuilder::createPropertyList):
1375 (JSC::ASTBuilder::createFuncDeclStatement):
1376 (JSC::ASTBuilder::createBlockStatement):
1377 (JSC::ASTBuilder::createExprStatement):
1378 (JSC::ASTBuilder::createIfStatement):
1379 (JSC::ASTBuilder::createForLoop):
1380 (JSC::ASTBuilder::createForInLoop):
1381 (JSC::ASTBuilder::createEmptyStatement):
1382 (JSC::ASTBuilder::createVarStatement):
1383 (JSC::ASTBuilder::createReturnStatement):
1384 (JSC::ASTBuilder::createBreakStatement):
1385 (JSC::ASTBuilder::createContinueStatement):
1386 (JSC::ASTBuilder::createTryStatement):
1387 (JSC::ASTBuilder::createSwitchStatement):
1388 (JSC::ASTBuilder::createWhileStatement):
1389 (JSC::ASTBuilder::createDoWhileStatement):
1390 (JSC::ASTBuilder::createLabelStatement):
1391 (JSC::ASTBuilder::createWithStatement):
1392 (JSC::ASTBuilder::createThrowStatement):
1393 (JSC::ASTBuilder::createDebugger):
1394 (JSC::ASTBuilder::createConstStatement):
1395 (JSC::ASTBuilder::appendConstDecl):
1396 (JSC::ASTBuilder::combineCommaNodes):
1397 (JSC::ASTBuilder::appendBinaryOperation):
1398 (JSC::ASTBuilder::createAssignment):
1399 (JSC::ASTBuilder::createNumber):
1400 (JSC::ASTBuilder::makeTypeOfNode):
1401 (JSC::ASTBuilder::makeDeleteNode):
1402 (JSC::ASTBuilder::makeNegateNode):
1403 (JSC::ASTBuilder::makeBitwiseNotNode):
1404 (JSC::ASTBuilder::makeMultNode):
1405 (JSC::ASTBuilder::makeDivNode):
1406 (JSC::ASTBuilder::makeModNode):
1407 (JSC::ASTBuilder::makeAddNode):
1408 (JSC::ASTBuilder::makeSubNode):
1409 (JSC::ASTBuilder::makeLeftShiftNode):
1410 (JSC::ASTBuilder::makeRightShiftNode):
1411 (JSC::ASTBuilder::makeURightShiftNode):
1412 (JSC::ASTBuilder::makeBitOrNode):
1413 (JSC::ASTBuilder::makeBitAndNode):
1414 (JSC::ASTBuilder::makeBitXOrNode):
1415 (JSC::ASTBuilder::makeFunctionCallNode):
1416 (JSC::ASTBuilder::makeBinaryNode):
1417 (JSC::ASTBuilder::makeAssignNode):
1418 (JSC::ASTBuilder::makePrefixNode):
1419 (JSC::ASTBuilder::makePostfixNode):
1420 * parser/Lexer.cpp:
1421 (JSC::::setCode):
1422 (JSC::::internalShift):
1423 (JSC::::shift):
1424 (JSC::::lex):
1425 * parser/Lexer.h:
1426 (Lexer):
1427 (JSC::Lexer::currentColumnNumber):
1428 (JSC::::lexExpectIdentifier):
1429 * parser/NodeConstructors.h:
1430 (JSC::Node::Node):
1431 (JSC::ExpressionNode::ExpressionNode):
1432 (JSC::StatementNode::StatementNode):
1433 (JSC::NullNode::NullNode):
1434 (JSC::BooleanNode::BooleanNode):
1435 (JSC::NumberNode::NumberNode):
1436 (JSC::StringNode::StringNode):
1437 (JSC::RegExpNode::RegExpNode):
1438 (JSC::ThisNode::ThisNode):
1439 (JSC::ResolveNode::ResolveNode):
1440 (JSC::ArrayNode::ArrayNode):
1441 (JSC::PropertyListNode::PropertyListNode):
1442 (JSC::ObjectLiteralNode::ObjectLiteralNode):
1443 (JSC::BracketAccessorNode::BracketAccessorNode):
1444 (JSC::DotAccessorNode::DotAccessorNode):
1445 (JSC::ArgumentListNode::ArgumentListNode):
1446 (JSC::NewExprNode::NewExprNode):
1447 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
1448 (JSC::FunctionCallValueNode::FunctionCallValueNode):
1449 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
1450 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
1451 (JSC::FunctionCallDotNode::FunctionCallDotNode):
1452 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
1453 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
1454 (JSC::PrePostResolveNode::PrePostResolveNode):
1455 (JSC::PostfixResolveNode::PostfixResolveNode):
1456 (JSC::PostfixBracketNode::PostfixBracketNode):
1457 (JSC::PostfixDotNode::PostfixDotNode):
1458 (JSC::PostfixErrorNode::PostfixErrorNode):
1459 (JSC::DeleteResolveNode::DeleteResolveNode):
1460 (JSC::DeleteBracketNode::DeleteBracketNode):
1461 (JSC::DeleteDotNode::DeleteDotNode):
1462 (JSC::DeleteValueNode::DeleteValueNode):
1463 (JSC::VoidNode::VoidNode):
1464 (JSC::TypeOfResolveNode::TypeOfResolveNode):
1465 (JSC::TypeOfValueNode::TypeOfValueNode):
1466 (JSC::PrefixResolveNode::PrefixResolveNode):
1467 (JSC::PrefixBracketNode::PrefixBracketNode):
1468 (JSC::PrefixDotNode::PrefixDotNode):
1469 (JSC::PrefixErrorNode::PrefixErrorNode):
1470 (JSC::UnaryOpNode::UnaryOpNode):
1471 (JSC::UnaryPlusNode::UnaryPlusNode):
1472 (JSC::NegateNode::NegateNode):
1473 (JSC::BitwiseNotNode::BitwiseNotNode):
1474 (JSC::LogicalNotNode::LogicalNotNode):
1475 (JSC::BinaryOpNode::BinaryOpNode):
1476 (JSC::MultNode::MultNode):
1477 (JSC::DivNode::DivNode):
1478 (JSC::ModNode::ModNode):
1479 (JSC::AddNode::AddNode):
1480 (JSC::SubNode::SubNode):
1481 (JSC::LeftShiftNode::LeftShiftNode):
1482 (JSC::RightShiftNode::RightShiftNode):
1483 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
1484 (JSC::LessNode::LessNode):
1485 (JSC::GreaterNode::GreaterNode):
1486 (JSC::LessEqNode::LessEqNode):
1487 (JSC::GreaterEqNode::GreaterEqNode):
1488 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
1489 (JSC::InstanceOfNode::InstanceOfNode):
1490 (JSC::InNode::InNode):
1491 (JSC::EqualNode::EqualNode):
1492 (JSC::NotEqualNode::NotEqualNode):
1493 (JSC::StrictEqualNode::StrictEqualNode):
1494 (JSC::NotStrictEqualNode::NotStrictEqualNode):
1495 (JSC::BitAndNode::BitAndNode):
1496 (JSC::BitOrNode::BitOrNode):
1497 (JSC::BitXOrNode::BitXOrNode):
1498 (JSC::LogicalOpNode::LogicalOpNode):
1499 (JSC::ConditionalNode::ConditionalNode):
1500 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
1501 (JSC::AssignResolveNode::AssignResolveNode):
1502 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
1503 (JSC::AssignBracketNode::AssignBracketNode):
1504 (JSC::AssignDotNode::AssignDotNode):
1505 (JSC::ReadModifyDotNode::ReadModifyDotNode):
1506 (JSC::AssignErrorNode::AssignErrorNode):
1507 (JSC::CommaNode::CommaNode):
1508 (JSC::ConstStatementNode::ConstStatementNode):
1509 (JSC::EmptyStatementNode::EmptyStatementNode):
1510 (JSC::DebuggerStatementNode::DebuggerStatementNode):
1511 (JSC::ExprStatementNode::ExprStatementNode):
1512 (JSC::VarStatementNode::VarStatementNode):
1513 (JSC::IfNode::IfNode):
1514 (JSC::IfElseNode::IfElseNode):
1515 (JSC::DoWhileNode::DoWhileNode):
1516 (JSC::WhileNode::WhileNode):
1517 (JSC::ForNode::ForNode):
1518 (JSC::ContinueNode::ContinueNode):
1519 (JSC::BreakNode::BreakNode):
1520 (JSC::ReturnNode::ReturnNode):
1521 (JSC::WithNode::WithNode):
1522 (JSC::LabelNode::LabelNode):
1523 (JSC::ThrowNode::ThrowNode):
1524 (JSC::TryNode::TryNode):
1525 (JSC::FuncExprNode::FuncExprNode):
1526 (JSC::FuncDeclNode::FuncDeclNode):
1527 (JSC::SwitchNode::SwitchNode):
1528 (JSC::ConstDeclNode::ConstDeclNode):
1529 (JSC::BlockNode::BlockNode):
1530 (JSC::ForInNode::ForInNode):
1531 * parser/Nodes.cpp:
1532 (JSC::StatementNode::setLoc):
1533 (JSC):
1534 (JSC::ScopeNode::ScopeNode):
1535 (JSC::ProgramNode::ProgramNode):
1536 (JSC::ProgramNode::create):
1537 (JSC::EvalNode::EvalNode):
1538 (JSC::EvalNode::create):
1539 (JSC::FunctionBodyNode::FunctionBodyNode):
1540 (JSC::FunctionBodyNode::create):
1541 * parser/Nodes.h:
1542 (Node):
1543 (JSC::Node::columnNo):
1544 (ExpressionNode):
1545 (StatementNode):
1546 (JSC::StatementNode::column):
1547 (NullNode):
1548 (BooleanNode):
1549 (NumberNode):
1550 (StringNode):
1551 (RegExpNode):
1552 (ThisNode):
1553 (ResolveNode):
1554 (ArrayNode):
1555 (PropertyListNode):
1556 (ObjectLiteralNode):
1557 (BracketAccessorNode):
1558 (DotAccessorNode):
1559 (ArgumentListNode):
1560 (NewExprNode):
1561 (EvalFunctionCallNode):
1562 (FunctionCallValueNode):
1563 (FunctionCallResolveNode):
1564 (FunctionCallBracketNode):
1565 (FunctionCallDotNode):
1566 (CallFunctionCallDotNode):
1567 (ApplyFunctionCallDotNode):
1568 (PrePostResolveNode):
1569 (PostfixResolveNode):
1570 (PostfixBracketNode):
1571 (PostfixDotNode):
1572 (PostfixErrorNode):
1573 (DeleteResolveNode):
1574 (DeleteBracketNode):
1575 (DeleteDotNode):
1576 (DeleteValueNode):
1577 (VoidNode):
1578 (TypeOfResolveNode):
1579 (TypeOfValueNode):
1580 (PrefixResolveNode):
1581 (PrefixBracketNode):
1582 (PrefixDotNode):
1583 (PrefixErrorNode):
1584 (UnaryOpNode):
1585 (UnaryPlusNode):
1586 (NegateNode):
1587 (BitwiseNotNode):
1588 (LogicalNotNode):
1589 (BinaryOpNode):
1590 (MultNode):
1591 (DivNode):
1592 (ModNode):
1593 (AddNode):
1594 (SubNode):
1595 (LeftShiftNode):
1596 (RightShiftNode):
1597 (UnsignedRightShiftNode):
1598 (LessNode):
1599 (GreaterNode):
1600 (LessEqNode):
1601 (GreaterEqNode):
1602 (ThrowableBinaryOpNode):
1603 (InstanceOfNode):
1604 (InNode):
1605 (EqualNode):
1606 (NotEqualNode):
1607 (StrictEqualNode):
1608 (NotStrictEqualNode):
1609 (BitAndNode):
1610 (BitOrNode):
1611 (BitXOrNode):
1612 (LogicalOpNode):
1613 (ConditionalNode):
1614 (ReadModifyResolveNode):
1615 (AssignResolveNode):
1616 (ReadModifyBracketNode):
1617 (AssignBracketNode):
1618 (AssignDotNode):
1619 (ReadModifyDotNode):
1620 (AssignErrorNode):
1621 (CommaNode):
1622 (ConstDeclNode):
1623 (ConstStatementNode):
1624 (BlockNode):
1625 (EmptyStatementNode):
1626 (DebuggerStatementNode):
1627 (ExprStatementNode):
1628 (VarStatementNode):
1629 (IfNode):
1630 (IfElseNode):
1631 (DoWhileNode):
1632 (WhileNode):
1633 (ForNode):
1634 (ForInNode):
1635 (ContinueNode):
1636 (BreakNode):
1637 (ReturnNode):
1638 (WithNode):
1639 (LabelNode):
1640 (ThrowNode):
1641 (TryNode):
1642 (ScopeNode):
1643 (ProgramNode):
1644 (EvalNode):
1645 (FunctionBodyNode):
1646 (FuncExprNode):
1647 (FuncDeclNode):
1648 (SwitchNode):
1649 * parser/Parser.cpp:
1650 (JSC::::parseSourceElements):
1651 (JSC::::parseVarDeclaration):
1652 (JSC::::parseConstDeclaration):
1653 (JSC::::parseDoWhileStatement):
1654 (JSC::::parseWhileStatement):
1655 (JSC::::parseVarDeclarationList):
1656 (JSC::::parseConstDeclarationList):
1657 (JSC::::parseForStatement):
1658 (JSC::::parseBreakStatement):
1659 (JSC::::parseContinueStatement):
1660 (JSC::::parseReturnStatement):
1661 (JSC::::parseThrowStatement):
1662 (JSC::::parseWithStatement):
1663 (JSC::::parseSwitchStatement):
1664 (JSC::::parseTryStatement):
1665 (JSC::::parseDebuggerStatement):
1666 (JSC::::parseBlockStatement):
1667 (JSC::::parseStatement):
1668 (JSC::::parseFunctionBody):
1669 (JSC::::parseFunctionInfo):
1670 (JSC::::parseFunctionDeclaration):
1671 (JSC::::parseExpressionOrLabelStatement):
1672 (JSC::::parseExpressionStatement):
1673 (JSC::::parseIfStatement):
1674 (JSC::::parseExpression):
1675 (JSC::::parseAssignmentExpression):
1676 (JSC::::parseConditionalExpression):
1677 (JSC::::parseBinaryExpression):
1678 (JSC::::parseProperty):
1679 (JSC::::parseObjectLiteral):
1680 (JSC::::parseStrictObjectLiteral):
1681 (JSC::::parseArrayLiteral):
1682 (JSC::::parsePrimaryExpression):
1683 (JSC::::parseArguments):
1684 (JSC::::parseMemberExpression):
1685 (JSC::::parseUnaryExpression):
1686 * parser/Parser.h:
1687 (JSC::Parser::next):
1688 (JSC::Parser::nextExpectIdentifier):
1689 (JSC::Parser::tokenStart):
1690 (JSC::Parser::tokenLine):
1691 (JSC::Parser::tokenEnd):
1692 (JSC::Parser::tokenLocation):
1693 (Parser):
1694 (JSC::Parser::getTokenName):
1695 (JSC::::parse):
1696 * parser/ParserTokens.h:
1697 (JSC::JSTokenLocation::JSTokenLocation):
1698 (JSTokenLocation):
1699 (JSToken):
1700 * parser/SourceProviderCacheItem.h:
1701 (JSC::SourceProviderCacheItem::closeBraceToken):
1702 * parser/SyntaxChecker.h:
1703 (JSC::SyntaxChecker::makeFunctionCallNode):
1704 (JSC::SyntaxChecker::createCommaExpr):
1705 (JSC::SyntaxChecker::makeAssignNode):
1706 (JSC::SyntaxChecker::makePrefixNode):
1707 (JSC::SyntaxChecker::makePostfixNode):
1708 (JSC::SyntaxChecker::makeTypeOfNode):
1709 (JSC::SyntaxChecker::makeDeleteNode):
1710 (JSC::SyntaxChecker::makeNegateNode):
1711 (JSC::SyntaxChecker::makeBitwiseNotNode):
1712 (JSC::SyntaxChecker::createLogicalNot):
1713 (JSC::SyntaxChecker::createUnaryPlus):
1714 (JSC::SyntaxChecker::createVoid):
1715 (JSC::SyntaxChecker::thisExpr):
1716 (JSC::SyntaxChecker::createResolve):
1717 (JSC::SyntaxChecker::createObjectLiteral):
1718 (JSC::SyntaxChecker::createArray):
1719 (JSC::SyntaxChecker::createNumberExpr):
1720 (JSC::SyntaxChecker::createString):
1721 (JSC::SyntaxChecker::createBoolean):
1722 (JSC::SyntaxChecker::createNull):
1723 (JSC::SyntaxChecker::createBracketAccess):
1724 (JSC::SyntaxChecker::createDotAccess):
1725 (JSC::SyntaxChecker::createRegExp):
1726 (JSC::SyntaxChecker::createNewExpr):
1727 (JSC::SyntaxChecker::createConditionalExpr):
1728 (JSC::SyntaxChecker::createAssignResolve):
1729 (JSC::SyntaxChecker::createFunctionExpr):
1730 (JSC::SyntaxChecker::createFunctionBody):
1731 (JSC::SyntaxChecker::createArgumentsList):
1732 (JSC::SyntaxChecker::createPropertyList):
1733 (JSC::SyntaxChecker::createFuncDeclStatement):
1734 (JSC::SyntaxChecker::createBlockStatement):
1735 (JSC::SyntaxChecker::createExprStatement):
1736 (JSC::SyntaxChecker::createIfStatement):
1737 (JSC::SyntaxChecker::createForLoop):
1738 (JSC::SyntaxChecker::createForInLoop):
1739 (JSC::SyntaxChecker::createEmptyStatement):
1740 (JSC::SyntaxChecker::createVarStatement):
1741 (JSC::SyntaxChecker::createReturnStatement):
1742 (JSC::SyntaxChecker::createBreakStatement):
1743 (JSC::SyntaxChecker::createContinueStatement):
1744 (JSC::SyntaxChecker::createTryStatement):
1745 (JSC::SyntaxChecker::createSwitchStatement):
1746 (JSC::SyntaxChecker::createWhileStatement):
1747 (JSC::SyntaxChecker::createWithStatement):
1748 (JSC::SyntaxChecker::createDoWhileStatement):
1749 (JSC::SyntaxChecker::createLabelStatement):
1750 (JSC::SyntaxChecker::createThrowStatement):
1751 (JSC::SyntaxChecker::createDebugger):
1752 (JSC::SyntaxChecker::createConstStatement):
1753 (JSC::SyntaxChecker::appendConstDecl):
1754 (JSC::SyntaxChecker::createGetterOrSetterProperty):
1755 (JSC::SyntaxChecker::combineCommaNodes):
1756 (JSC::SyntaxChecker::operatorStackPop):
1757
fpizlo@apple.com8ab9c432012-08-03 21:41:05 +000017582012-08-03 Filip Pizlo <fpizlo@apple.com>
1759
fpizlo@apple.com63dda942012-08-04 01:01:27 +00001760 Crashes in dfgBuildPutByIdList when clicking on just about anything on Google Maps
1761 https://bugs.webkit.org/show_bug.cgi?id=92691
1762
1763 Reviewed by Mark Hahnenberg.
1764
1765 The state of the stubs was changing after we determined the type (by virtue of the slow path
1766 function that was called), since the get or put (in this case put) could cause arbitrary
1767 side effects. Perhaps a full-blown fix would be to eliminate our reliance of the slow path
1768 function to determine what to do, but an easier fix for now is to have the slow path give up
1769 if its assumptions were invalidated by a side effect.
1770
1771 * dfg/DFGOperations.cpp:
1772 * jit/JITStubs.cpp:
1773 (JSC::DEFINE_STUB_FUNCTION):
1774
17752012-08-03 Filip Pizlo <fpizlo@apple.com>
1776
fpizlo@apple.come4a4d792012-08-03 22:42:29 +00001777 DFG handling of get_by_id should always inject a ForceOSRExit node if there is no prediction
1778 https://bugs.webkit.org/show_bug.cgi?id=93162
1779
1780 Reviewed by Mark Hahnenberg.
1781
1782 This simplifies the DFG IR by ensuring that all nodes that use value profiles will be preceded
1783 by a ForceOSRExit if the value profile had no data.
1784
1785 * dfg/DFGByteCodeParser.cpp:
1786 (JSC::DFG::ByteCodeParser::parseBlock):
1787
17882012-08-03 Filip Pizlo <fpizlo@apple.com>
1789
fpizlo@apple.com8ab9c432012-08-03 21:41:05 +00001790 DFG::StructureCheckHoistingPhase keeps a Node& around for too long
1791 https://bugs.webkit.org/show_bug.cgi?id=93157
1792
1793 Reviewed by Mark Hahnenberg.
1794
1795 * dfg/DFGStructureCheckHoistingPhase.cpp:
1796 (JSC::DFG::StructureCheckHoistingPhase::run):
1797
paroga@webkit.org438d93a2012-08-03 05:06:38 +000017982012-08-02 Patrick Gansterer <paroga@webkit.org>
1799
1800 Move getLocalTime() as static inline function to DateMath
1801 https://bugs.webkit.org/show_bug.cgi?id=92955
1802
1803 Reviewed by Ryosuke Niwa.
1804
1805 getCurrentLocalTime() and getLocalTime() has been superseded with the
1806 GregorianDateTime class. So we can move it into DateMath.cpp as an static inline
1807 function. This allows us to remove the dependecy on time() and localtime()
1808 for Windows CE, where this functions require the ce_time library to work.
1809
1810 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1811
fpizlo@apple.com3088f182012-08-02 21:10:43 +000018122012-08-02 Filip Pizlo <fpizlo@apple.com>
1813
fpizlo@apple.com978a0eb2012-08-03 03:27:08 +00001814 ASSERTION FAILED: at(m_compileIndex).canExit() || m_isCheckingArgumentTypes
1815 https://bugs.webkit.org/show_bug.cgi?id=91074
1816
1817 Reviewed by Mark Hahnenberg.
1818
1819 Fixes a bug where the speculative JIT was performing an unnecessary speculation that the
1820 CFA had proven shouldn't be performed, leading to asserts that a node should not have
1821 exit sites. This is a debug-only assert with no release symptom - we were just emitting
1822 a check that was not reachable.
1823
1824 Also found, and fixed, a bug where structure check hoisting was slightly confusing the
1825 CFA by inserting GetLocal's into the graph. CSE would clean the GetLocal's up, which
1826 would make the backend happy - but the CFA would produce subtly wrong results.
1827
1828 * bytecode/SpeculatedType.h:
1829 (JSC::isOtherOrEmptySpeculation):
1830 (JSC):
1831 * dfg/DFGDriver.cpp:
1832 (JSC::DFG::compile):
1833 * dfg/DFGGraph.cpp:
1834 (JSC::DFG::Graph::dump):
1835 * dfg/DFGSpeculativeJIT64.cpp:
1836 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1837 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1838
18392012-08-02 Filip Pizlo <fpizlo@apple.com>
1840
fpizlo@apple.com3088f182012-08-02 21:10:43 +00001841 Unreviewed, build fix for DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE).
1842
1843 * dfg/DFGStructureCheckHoistingPhase.cpp:
1844 (JSC::DFG::StructureCheckHoistingPhase::run):
1845
mhahnenberg@apple.com85c200b2012-08-02 17:32:35 +000018462012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
1847
1848 Remove all uses of ClassInfo for JSStrings in JIT code
1849 https://bugs.webkit.org/show_bug.cgi?id=92935
1850
1851 Reviewed by Geoffrey Garen.
1852
1853 This is the first step in removing our dependence on in-object ClassInfo pointers
1854 in JIT code. Most of the changes are to check the Structure, which is unique for
1855 JSString primitives.
1856
1857 * bytecode/SpeculatedType.cpp:
1858 (JSC::speculationFromClassInfo):
1859 (JSC::speculationFromStructure): Changed to check the TypeInfo in the Structure
1860 since there wasn't a JSGlobalData immediately available to grab the JSString
1861 Structure out of.
1862 * dfg/DFGSpeculativeJIT.cpp:
1863 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
1864 * dfg/DFGSpeculativeJIT32_64.cpp:
1865 (JSC::DFG::SpeculativeJIT::compile):
1866 * dfg/DFGSpeculativeJIT64.cpp:
1867 (JSC::DFG::SpeculativeJIT::compile):
1868 * jit/JITInlineMethods.h:
1869 (JSC::JIT::emitLoadCharacterString):
1870 * jit/JITOpcodes.cpp:
1871 (JSC::JIT::privateCompileCTIMachineTrampolines):
1872 (JSC::JIT::emit_op_to_primitive):
1873 (JSC::JIT::emit_op_convert_this):
1874 * jit/JITOpcodes32_64.cpp:
1875 (JSC::JIT::privateCompileCTIMachineTrampolines):
1876 (JSC::JIT::emit_op_to_primitive):
1877 (JSC::JIT::emitSlow_op_eq):
1878 (JSC::JIT::emitSlow_op_neq):
1879 (JSC::JIT::compileOpStrictEq):
1880 (JSC::JIT::emit_op_convert_this):
1881 * jit/JITPropertyAccess.cpp:
1882 (JSC::JIT::stringGetByValStubGenerator):
1883 (JSC::JIT::emitSlow_op_get_by_val):
1884 * jit/JITPropertyAccess32_64.cpp:
1885 (JSC::JIT::stringGetByValStubGenerator):
1886 (JSC::JIT::emitSlow_op_get_by_val):
1887 * jit/SpecializedThunkJIT.h:
1888 (JSC::SpecializedThunkJIT::loadJSStringArgument):
1889 * jit/ThunkGenerators.cpp:
1890 (JSC::stringCharLoad):
1891 (JSC::charCodeAtThunkGenerator):
1892 (JSC::charAtThunkGenerator):
1893
fpizlo@apple.com58ec4b02012-08-02 08:22:57 +000018942012-08-02 Filip Pizlo <fpizlo@apple.com>
1895
fpizlo@apple.com470cde52012-08-02 08:27:48 +00001896 Unreviewed, missed a style goof in the previous patch: "NodeIndex nodeIndex"
1897 in a method signature is painfully redundant.
1898
1899 * dfg/DFGSpeculativeJIT.h:
1900 (SpeculativeJIT):
1901
19022012-08-02 Filip Pizlo <fpizlo@apple.com>
1903
fpizlo@apple.com58ec4b02012-08-02 08:22:57 +00001904 DFGSpeculativeJIT.h has too many inline method bodies
1905 https://bugs.webkit.org/show_bug.cgi?id=92957
1906
1907 Reviewed by Antti Koivisto.
1908
1909 * dfg/DFGSpeculativeJIT.cpp:
1910 (JSC::DFG::SpeculativeJIT::speculationCheck):
1911 (DFG):
1912 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
1913 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
1914 (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
1915 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
1916 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
1917 * dfg/DFGSpeculativeJIT.h:
1918 (SpeculativeJIT):
1919
commit-queue@webkit.org709de8f2012-08-02 06:44:46 +000019202012-08-01 Sheriff Bot <webkit.review.bot@gmail.com>
1921
1922 Unreviewed, rolling out r124406.
1923 http://trac.webkit.org/changeset/124406
1924 https://bugs.webkit.org/show_bug.cgi?id=92951
1925
1926 it set the Mac bots on fire (Requested by pizlo on #webkit).
1927
1928 * bytecode/Opcode.h:
1929 (JSC):
1930 (JSC::padOpcodeName):
1931 * bytecompiler/BytecodeGenerator.cpp:
1932 (JSC::BytecodeGenerator::emitDebugHook):
1933 * bytecompiler/BytecodeGenerator.h:
1934 (BytecodeGenerator):
1935 * bytecompiler/NodesCodegen.cpp:
1936 (JSC::ArrayNode::toArgumentList):
1937 (JSC::ApplyFunctionCallDotNode::emitBytecode):
1938 (JSC::ConditionalNode::emitBytecode):
1939 (JSC::ConstStatementNode::emitBytecode):
1940 (JSC::EmptyStatementNode::emitBytecode):
1941 (JSC::DebuggerStatementNode::emitBytecode):
1942 (JSC::ExprStatementNode::emitBytecode):
1943 (JSC::VarStatementNode::emitBytecode):
1944 (JSC::IfNode::emitBytecode):
1945 (JSC::IfElseNode::emitBytecode):
1946 (JSC::DoWhileNode::emitBytecode):
1947 (JSC::WhileNode::emitBytecode):
1948 (JSC::ForNode::emitBytecode):
1949 (JSC::ForInNode::emitBytecode):
1950 (JSC::ContinueNode::emitBytecode):
1951 (JSC::BreakNode::emitBytecode):
1952 (JSC::ReturnNode::emitBytecode):
1953 (JSC::WithNode::emitBytecode):
1954 (JSC::SwitchNode::emitBytecode):
1955 (JSC::LabelNode::emitBytecode):
1956 (JSC::ThrowNode::emitBytecode):
1957 (JSC::TryNode::emitBytecode):
1958 (JSC::ProgramNode::emitBytecode):
1959 (JSC::EvalNode::emitBytecode):
1960 (JSC::FunctionBodyNode::emitBytecode):
1961 * debugger/Debugger.h:
1962 * interpreter/Interpreter.cpp:
1963 (JSC::Interpreter::unwindCallFrame):
1964 (JSC::Interpreter::throwException):
1965 (JSC::Interpreter::debug):
1966 * interpreter/Interpreter.h:
1967 (Interpreter):
1968 * jit/JITOpcodes.cpp:
1969 (JSC::JIT::emit_op_debug):
1970 * jit/JITOpcodes32_64.cpp:
1971 (JSC::JIT::emit_op_debug):
1972 * jit/JITStubs.cpp:
1973 (JSC::DEFINE_STUB_FUNCTION):
1974 * llint/LLIntSlowPaths.cpp:
1975 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1976 * parser/ASTBuilder.h:
1977 (ASTBuilder):
1978 (JSC::ASTBuilder::createCommaExpr):
1979 (JSC::ASTBuilder::createLogicalNot):
1980 (JSC::ASTBuilder::createUnaryPlus):
1981 (JSC::ASTBuilder::createVoid):
1982 (JSC::ASTBuilder::thisExpr):
1983 (JSC::ASTBuilder::createResolve):
1984 (JSC::ASTBuilder::createObjectLiteral):
1985 (JSC::ASTBuilder::createArray):
1986 (JSC::ASTBuilder::createNumberExpr):
1987 (JSC::ASTBuilder::createString):
1988 (JSC::ASTBuilder::createBoolean):
1989 (JSC::ASTBuilder::createNull):
1990 (JSC::ASTBuilder::createBracketAccess):
1991 (JSC::ASTBuilder::createDotAccess):
1992 (JSC::ASTBuilder::createRegExp):
1993 (JSC::ASTBuilder::createNewExpr):
1994 (JSC::ASTBuilder::createConditionalExpr):
1995 (JSC::ASTBuilder::createAssignResolve):
1996 (JSC::ASTBuilder::createFunctionExpr):
1997 (JSC::ASTBuilder::createFunctionBody):
1998 (JSC::ASTBuilder::createGetterOrSetterProperty):
1999 (JSC::ASTBuilder::createArgumentsList):
2000 (JSC::ASTBuilder::createPropertyList):
2001 (JSC::ASTBuilder::createFuncDeclStatement):
2002 (JSC::ASTBuilder::createBlockStatement):
2003 (JSC::ASTBuilder::createExprStatement):
2004 (JSC::ASTBuilder::createIfStatement):
2005 (JSC::ASTBuilder::createForLoop):
2006 (JSC::ASTBuilder::createForInLoop):
2007 (JSC::ASTBuilder::createEmptyStatement):
2008 (JSC::ASTBuilder::createVarStatement):
2009 (JSC::ASTBuilder::createReturnStatement):
2010 (JSC::ASTBuilder::createBreakStatement):
2011 (JSC::ASTBuilder::createContinueStatement):
2012 (JSC::ASTBuilder::createTryStatement):
2013 (JSC::ASTBuilder::createSwitchStatement):
2014 (JSC::ASTBuilder::createWhileStatement):
2015 (JSC::ASTBuilder::createDoWhileStatement):
2016 (JSC::ASTBuilder::createLabelStatement):
2017 (JSC::ASTBuilder::createWithStatement):
2018 (JSC::ASTBuilder::createThrowStatement):
2019 (JSC::ASTBuilder::createDebugger):
2020 (JSC::ASTBuilder::createConstStatement):
2021 (JSC::ASTBuilder::appendConstDecl):
2022 (JSC::ASTBuilder::combineCommaNodes):
2023 (JSC::ASTBuilder::appendBinaryOperation):
2024 (JSC::ASTBuilder::createAssignment):
2025 (JSC::ASTBuilder::createNumber):
2026 (JSC::ASTBuilder::makeTypeOfNode):
2027 (JSC::ASTBuilder::makeDeleteNode):
2028 (JSC::ASTBuilder::makeNegateNode):
2029 (JSC::ASTBuilder::makeBitwiseNotNode):
2030 (JSC::ASTBuilder::makeMultNode):
2031 (JSC::ASTBuilder::makeDivNode):
2032 (JSC::ASTBuilder::makeModNode):
2033 (JSC::ASTBuilder::makeAddNode):
2034 (JSC::ASTBuilder::makeSubNode):
2035 (JSC::ASTBuilder::makeLeftShiftNode):
2036 (JSC::ASTBuilder::makeRightShiftNode):
2037 (JSC::ASTBuilder::makeURightShiftNode):
2038 (JSC::ASTBuilder::makeBitOrNode):
2039 (JSC::ASTBuilder::makeBitAndNode):
2040 (JSC::ASTBuilder::makeBitXOrNode):
2041 (JSC::ASTBuilder::makeFunctionCallNode):
2042 (JSC::ASTBuilder::makeBinaryNode):
2043 (JSC::ASTBuilder::makeAssignNode):
2044 (JSC::ASTBuilder::makePrefixNode):
2045 (JSC::ASTBuilder::makePostfixNode):
2046 * parser/Lexer.cpp:
2047 (JSC::::setCode):
2048 (JSC::::internalShift):
2049 (JSC::::shift):
2050 (JSC::::lex):
2051 * parser/Lexer.h:
2052 (Lexer):
2053 (JSC::::lexExpectIdentifier):
2054 * parser/NodeConstructors.h:
2055 (JSC::Node::Node):
2056 (JSC::ExpressionNode::ExpressionNode):
2057 (JSC::StatementNode::StatementNode):
2058 (JSC::NullNode::NullNode):
2059 (JSC::BooleanNode::BooleanNode):
2060 (JSC::NumberNode::NumberNode):
2061 (JSC::StringNode::StringNode):
2062 (JSC::RegExpNode::RegExpNode):
2063 (JSC::ThisNode::ThisNode):
2064 (JSC::ResolveNode::ResolveNode):
2065 (JSC::ArrayNode::ArrayNode):
2066 (JSC::PropertyListNode::PropertyListNode):
2067 (JSC::ObjectLiteralNode::ObjectLiteralNode):
2068 (JSC::BracketAccessorNode::BracketAccessorNode):
2069 (JSC::DotAccessorNode::DotAccessorNode):
2070 (JSC::ArgumentListNode::ArgumentListNode):
2071 (JSC::NewExprNode::NewExprNode):
2072 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
2073 (JSC::FunctionCallValueNode::FunctionCallValueNode):
2074 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
2075 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
2076 (JSC::FunctionCallDotNode::FunctionCallDotNode):
2077 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
2078 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
2079 (JSC::PrePostResolveNode::PrePostResolveNode):
2080 (JSC::PostfixResolveNode::PostfixResolveNode):
2081 (JSC::PostfixBracketNode::PostfixBracketNode):
2082 (JSC::PostfixDotNode::PostfixDotNode):
2083 (JSC::PostfixErrorNode::PostfixErrorNode):
2084 (JSC::DeleteResolveNode::DeleteResolveNode):
2085 (JSC::DeleteBracketNode::DeleteBracketNode):
2086 (JSC::DeleteDotNode::DeleteDotNode):
2087 (JSC::DeleteValueNode::DeleteValueNode):
2088 (JSC::VoidNode::VoidNode):
2089 (JSC::TypeOfResolveNode::TypeOfResolveNode):
2090 (JSC::TypeOfValueNode::TypeOfValueNode):
2091 (JSC::PrefixResolveNode::PrefixResolveNode):
2092 (JSC::PrefixBracketNode::PrefixBracketNode):
2093 (JSC::PrefixDotNode::PrefixDotNode):
2094 (JSC::PrefixErrorNode::PrefixErrorNode):
2095 (JSC::UnaryOpNode::UnaryOpNode):
2096 (JSC::UnaryPlusNode::UnaryPlusNode):
2097 (JSC::NegateNode::NegateNode):
2098 (JSC::BitwiseNotNode::BitwiseNotNode):
2099 (JSC::LogicalNotNode::LogicalNotNode):
2100 (JSC::BinaryOpNode::BinaryOpNode):
2101 (JSC::MultNode::MultNode):
2102 (JSC::DivNode::DivNode):
2103 (JSC::ModNode::ModNode):
2104 (JSC::AddNode::AddNode):
2105 (JSC::SubNode::SubNode):
2106 (JSC::LeftShiftNode::LeftShiftNode):
2107 (JSC::RightShiftNode::RightShiftNode):
2108 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
2109 (JSC::LessNode::LessNode):
2110 (JSC::GreaterNode::GreaterNode):
2111 (JSC::LessEqNode::LessEqNode):
2112 (JSC::GreaterEqNode::GreaterEqNode):
2113 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
2114 (JSC::InstanceOfNode::InstanceOfNode):
2115 (JSC::InNode::InNode):
2116 (JSC::EqualNode::EqualNode):
2117 (JSC::NotEqualNode::NotEqualNode):
2118 (JSC::StrictEqualNode::StrictEqualNode):
2119 (JSC::NotStrictEqualNode::NotStrictEqualNode):
2120 (JSC::BitAndNode::BitAndNode):
2121 (JSC::BitOrNode::BitOrNode):
2122 (JSC::BitXOrNode::BitXOrNode):
2123 (JSC::LogicalOpNode::LogicalOpNode):
2124 (JSC::ConditionalNode::ConditionalNode):
2125 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
2126 (JSC::AssignResolveNode::AssignResolveNode):
2127 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
2128 (JSC::AssignBracketNode::AssignBracketNode):
2129 (JSC::AssignDotNode::AssignDotNode):
2130 (JSC::ReadModifyDotNode::ReadModifyDotNode):
2131 (JSC::AssignErrorNode::AssignErrorNode):
2132 (JSC::CommaNode::CommaNode):
2133 (JSC::ConstStatementNode::ConstStatementNode):
2134 (JSC::EmptyStatementNode::EmptyStatementNode):
2135 (JSC::DebuggerStatementNode::DebuggerStatementNode):
2136 (JSC::ExprStatementNode::ExprStatementNode):
2137 (JSC::VarStatementNode::VarStatementNode):
2138 (JSC::IfNode::IfNode):
2139 (JSC::IfElseNode::IfElseNode):
2140 (JSC::DoWhileNode::DoWhileNode):
2141 (JSC::WhileNode::WhileNode):
2142 (JSC::ForNode::ForNode):
2143 (JSC::ContinueNode::ContinueNode):
2144 (JSC::BreakNode::BreakNode):
2145 (JSC::ReturnNode::ReturnNode):
2146 (JSC::WithNode::WithNode):
2147 (JSC::LabelNode::LabelNode):
2148 (JSC::ThrowNode::ThrowNode):
2149 (JSC::TryNode::TryNode):
2150 (JSC::FuncExprNode::FuncExprNode):
2151 (JSC::FuncDeclNode::FuncDeclNode):
2152 (JSC::SwitchNode::SwitchNode):
2153 (JSC::ConstDeclNode::ConstDeclNode):
2154 (JSC::BlockNode::BlockNode):
2155 (JSC::ForInNode::ForInNode):
2156 * parser/Nodes.cpp:
2157 (JSC):
2158 (JSC::StatementNode::setLoc):
2159 (JSC::ScopeNode::ScopeNode):
2160 (JSC::ProgramNode::ProgramNode):
2161 (JSC::ProgramNode::create):
2162 (JSC::EvalNode::EvalNode):
2163 (JSC::EvalNode::create):
2164 (JSC::FunctionBodyNode::FunctionBodyNode):
2165 (JSC::FunctionBodyNode::create):
2166 * parser/Nodes.h:
2167 (Node):
2168 (ExpressionNode):
2169 (StatementNode):
2170 (NullNode):
2171 (BooleanNode):
2172 (NumberNode):
2173 (StringNode):
2174 (RegExpNode):
2175 (ThisNode):
2176 (ResolveNode):
2177 (ArrayNode):
2178 (PropertyListNode):
2179 (ObjectLiteralNode):
2180 (BracketAccessorNode):
2181 (DotAccessorNode):
2182 (ArgumentListNode):
2183 (NewExprNode):
2184 (EvalFunctionCallNode):
2185 (FunctionCallValueNode):
2186 (FunctionCallResolveNode):
2187 (FunctionCallBracketNode):
2188 (FunctionCallDotNode):
2189 (CallFunctionCallDotNode):
2190 (ApplyFunctionCallDotNode):
2191 (PrePostResolveNode):
2192 (PostfixResolveNode):
2193 (PostfixBracketNode):
2194 (PostfixDotNode):
2195 (PostfixErrorNode):
2196 (DeleteResolveNode):
2197 (DeleteBracketNode):
2198 (DeleteDotNode):
2199 (DeleteValueNode):
2200 (VoidNode):
2201 (TypeOfResolveNode):
2202 (TypeOfValueNode):
2203 (PrefixResolveNode):
2204 (PrefixBracketNode):
2205 (PrefixDotNode):
2206 (PrefixErrorNode):
2207 (UnaryOpNode):
2208 (UnaryPlusNode):
2209 (NegateNode):
2210 (BitwiseNotNode):
2211 (LogicalNotNode):
2212 (BinaryOpNode):
2213 (MultNode):
2214 (DivNode):
2215 (ModNode):
2216 (AddNode):
2217 (SubNode):
2218 (LeftShiftNode):
2219 (RightShiftNode):
2220 (UnsignedRightShiftNode):
2221 (LessNode):
2222 (GreaterNode):
2223 (LessEqNode):
2224 (GreaterEqNode):
2225 (ThrowableBinaryOpNode):
2226 (InstanceOfNode):
2227 (InNode):
2228 (EqualNode):
2229 (NotEqualNode):
2230 (StrictEqualNode):
2231 (NotStrictEqualNode):
2232 (BitAndNode):
2233 (BitOrNode):
2234 (BitXOrNode):
2235 (LogicalOpNode):
2236 (ConditionalNode):
2237 (ReadModifyResolveNode):
2238 (AssignResolveNode):
2239 (ReadModifyBracketNode):
2240 (AssignBracketNode):
2241 (AssignDotNode):
2242 (ReadModifyDotNode):
2243 (AssignErrorNode):
2244 (CommaNode):
2245 (ConstDeclNode):
2246 (ConstStatementNode):
2247 (BlockNode):
2248 (EmptyStatementNode):
2249 (DebuggerStatementNode):
2250 (ExprStatementNode):
2251 (VarStatementNode):
2252 (IfNode):
2253 (IfElseNode):
2254 (DoWhileNode):
2255 (WhileNode):
2256 (ForNode):
2257 (ForInNode):
2258 (ContinueNode):
2259 (BreakNode):
2260 (ReturnNode):
2261 (WithNode):
2262 (LabelNode):
2263 (ThrowNode):
2264 (TryNode):
2265 (ScopeNode):
2266 (ProgramNode):
2267 (EvalNode):
2268 (FunctionBodyNode):
2269 (FuncExprNode):
2270 (FuncDeclNode):
2271 (SwitchNode):
2272 * parser/Parser.cpp:
2273 (JSC::::parseSourceElements):
2274 (JSC::::parseVarDeclaration):
2275 (JSC::::parseConstDeclaration):
2276 (JSC::::parseDoWhileStatement):
2277 (JSC::::parseWhileStatement):
2278 (JSC::::parseVarDeclarationList):
2279 (JSC::::parseConstDeclarationList):
2280 (JSC::::parseForStatement):
2281 (JSC::::parseBreakStatement):
2282 (JSC::::parseContinueStatement):
2283 (JSC::::parseReturnStatement):
2284 (JSC::::parseThrowStatement):
2285 (JSC::::parseWithStatement):
2286 (JSC::::parseSwitchStatement):
2287 (JSC::::parseTryStatement):
2288 (JSC::::parseDebuggerStatement):
2289 (JSC::::parseBlockStatement):
2290 (JSC::::parseStatement):
2291 (JSC::::parseFunctionBody):
2292 (JSC::::parseFunctionInfo):
2293 (JSC::::parseFunctionDeclaration):
2294 (JSC::::parseExpressionOrLabelStatement):
2295 (JSC::::parseExpressionStatement):
2296 (JSC::::parseIfStatement):
2297 (JSC::::parseExpression):
2298 (JSC::::parseAssignmentExpression):
2299 (JSC::::parseConditionalExpression):
2300 (JSC::::parseBinaryExpression):
2301 (JSC::::parseProperty):
2302 (JSC::::parseObjectLiteral):
2303 (JSC::::parseStrictObjectLiteral):
2304 (JSC::::parseArrayLiteral):
2305 (JSC::::parsePrimaryExpression):
2306 (JSC::::parseArguments):
2307 (JSC::::parseMemberExpression):
2308 (JSC::::parseUnaryExpression):
2309 * parser/Parser.h:
2310 (JSC::Parser::next):
2311 (JSC::Parser::nextExpectIdentifier):
2312 (JSC::Parser::tokenStart):
2313 (JSC::Parser::tokenLine):
2314 (JSC::Parser::tokenEnd):
2315 (JSC::Parser::getTokenName):
2316 (JSC::::parse):
2317 * parser/ParserTokens.h:
2318 (JSC::JSTokenInfo::JSTokenInfo):
2319 (JSTokenInfo):
2320 (JSToken):
2321 * parser/SourceProviderCacheItem.h:
2322 (JSC::SourceProviderCacheItem::closeBraceToken):
2323 * parser/SyntaxChecker.h:
2324 (JSC::SyntaxChecker::makeFunctionCallNode):
2325 (JSC::SyntaxChecker::createCommaExpr):
2326 (JSC::SyntaxChecker::makeAssignNode):
2327 (JSC::SyntaxChecker::makePrefixNode):
2328 (JSC::SyntaxChecker::makePostfixNode):
2329 (JSC::SyntaxChecker::makeTypeOfNode):
2330 (JSC::SyntaxChecker::makeDeleteNode):
2331 (JSC::SyntaxChecker::makeNegateNode):
2332 (JSC::SyntaxChecker::makeBitwiseNotNode):
2333 (JSC::SyntaxChecker::createLogicalNot):
2334 (JSC::SyntaxChecker::createUnaryPlus):
2335 (JSC::SyntaxChecker::createVoid):
2336 (JSC::SyntaxChecker::thisExpr):
2337 (JSC::SyntaxChecker::createResolve):
2338 (JSC::SyntaxChecker::createObjectLiteral):
2339 (JSC::SyntaxChecker::createArray):
2340 (JSC::SyntaxChecker::createNumberExpr):
2341 (JSC::SyntaxChecker::createString):
2342 (JSC::SyntaxChecker::createBoolean):
2343 (JSC::SyntaxChecker::createNull):
2344 (JSC::SyntaxChecker::createBracketAccess):
2345 (JSC::SyntaxChecker::createDotAccess):
2346 (JSC::SyntaxChecker::createRegExp):
2347 (JSC::SyntaxChecker::createNewExpr):
2348 (JSC::SyntaxChecker::createConditionalExpr):
2349 (JSC::SyntaxChecker::createAssignResolve):
2350 (JSC::SyntaxChecker::createFunctionExpr):
2351 (JSC::SyntaxChecker::createFunctionBody):
2352 (JSC::SyntaxChecker::createArgumentsList):
2353 (JSC::SyntaxChecker::createPropertyList):
2354 (JSC::SyntaxChecker::createFuncDeclStatement):
2355 (JSC::SyntaxChecker::createBlockStatement):
2356 (JSC::SyntaxChecker::createExprStatement):
2357 (JSC::SyntaxChecker::createIfStatement):
2358 (JSC::SyntaxChecker::createForLoop):
2359 (JSC::SyntaxChecker::createForInLoop):
2360 (JSC::SyntaxChecker::createEmptyStatement):
2361 (JSC::SyntaxChecker::createVarStatement):
2362 (JSC::SyntaxChecker::createReturnStatement):
2363 (JSC::SyntaxChecker::createBreakStatement):
2364 (JSC::SyntaxChecker::createContinueStatement):
2365 (JSC::SyntaxChecker::createTryStatement):
2366 (JSC::SyntaxChecker::createSwitchStatement):
2367 (JSC::SyntaxChecker::createWhileStatement):
2368 (JSC::SyntaxChecker::createWithStatement):
2369 (JSC::SyntaxChecker::createDoWhileStatement):
2370 (JSC::SyntaxChecker::createLabelStatement):
2371 (JSC::SyntaxChecker::createThrowStatement):
2372 (JSC::SyntaxChecker::createDebugger):
2373 (JSC::SyntaxChecker::createConstStatement):
2374 (JSC::SyntaxChecker::appendConstDecl):
2375 (JSC::SyntaxChecker::createGetterOrSetterProperty):
2376 (JSC::SyntaxChecker::combineCommaNodes):
2377 (JSC::SyntaxChecker::operatorStackPop):
2378
commit-queue@webkit.org3772d072012-08-02 04:49:25 +000023792012-08-01 Peter Wang <peter.wang@torchmobile.com.cn>
2380
2381 Web Inspector: [JSC] implement setting breakpoints by line:column
2382 https://bugs.webkit.org/show_bug.cgi?id=53003
2383
2384 Reviewed by Geoffrey Garen.
2385
2386 Add a counter in lexer to record the column of each token. Debugger will use column info
2387 in "Pretty Print" debug mode of Inspector.
2388
2389 * bytecode/Opcode.h:
2390 (JSC):
2391 (JSC::padOpcodeName):
2392 * bytecompiler/BytecodeGenerator.cpp:
2393 (JSC::BytecodeGenerator::emitDebugHook):
2394 * bytecompiler/BytecodeGenerator.h:
2395 (BytecodeGenerator):
2396 * bytecompiler/NodesCodegen.cpp:
2397 (JSC::ArrayNode::toArgumentList):
2398 (JSC::ApplyFunctionCallDotNode::emitBytecode):
2399 (JSC::ConditionalNode::emitBytecode):
2400 (JSC::ConstStatementNode::emitBytecode):
2401 (JSC::EmptyStatementNode::emitBytecode):
2402 (JSC::DebuggerStatementNode::emitBytecode):
2403 (JSC::ExprStatementNode::emitBytecode):
2404 (JSC::VarStatementNode::emitBytecode):
2405 (JSC::IfNode::emitBytecode):
2406 (JSC::IfElseNode::emitBytecode):
2407 (JSC::DoWhileNode::emitBytecode):
2408 (JSC::WhileNode::emitBytecode):
2409 (JSC::ForNode::emitBytecode):
2410 (JSC::ForInNode::emitBytecode):
2411 (JSC::ContinueNode::emitBytecode):
2412 (JSC::BreakNode::emitBytecode):
2413 (JSC::ReturnNode::emitBytecode):
2414 (JSC::WithNode::emitBytecode):
2415 (JSC::SwitchNode::emitBytecode):
2416 (JSC::LabelNode::emitBytecode):
2417 (JSC::ThrowNode::emitBytecode):
2418 (JSC::TryNode::emitBytecode):
2419 (JSC::ProgramNode::emitBytecode):
2420 (JSC::EvalNode::emitBytecode):
2421 (JSC::FunctionBodyNode::emitBytecode):
2422 * debugger/Debugger.h:
2423 * interpreter/Interpreter.cpp:
2424 (JSC::Interpreter::unwindCallFrame):
2425 (JSC::Interpreter::throwException):
2426 (JSC::Interpreter::debug):
2427 * interpreter/Interpreter.h:
2428 (Interpreter):
2429 * jit/JITOpcodes.cpp:
2430 (JSC::JIT::emit_op_debug):
2431 * jit/JITOpcodes32_64.cpp:
2432 (JSC::JIT::emit_op_debug):
2433 * jit/JITStubs.cpp:
2434 (JSC::DEFINE_STUB_FUNCTION):
2435 * llint/LLIntSlowPaths.cpp:
2436 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2437 * parser/ASTBuilder.h:
2438 (ASTBuilder):
2439 (JSC::ASTBuilder::createCommaExpr):
2440 (JSC::ASTBuilder::createLogicalNot):
2441 (JSC::ASTBuilder::createUnaryPlus):
2442 (JSC::ASTBuilder::createVoid):
2443 (JSC::ASTBuilder::thisExpr):
2444 (JSC::ASTBuilder::createResolve):
2445 (JSC::ASTBuilder::createObjectLiteral):
2446 (JSC::ASTBuilder::createArray):
2447 (JSC::ASTBuilder::createNumberExpr):
2448 (JSC::ASTBuilder::createString):
2449 (JSC::ASTBuilder::createBoolean):
2450 (JSC::ASTBuilder::createNull):
2451 (JSC::ASTBuilder::createBracketAccess):
2452 (JSC::ASTBuilder::createDotAccess):
2453 (JSC::ASTBuilder::createRegExp):
2454 (JSC::ASTBuilder::createNewExpr):
2455 (JSC::ASTBuilder::createConditionalExpr):
2456 (JSC::ASTBuilder::createAssignResolve):
2457 (JSC::ASTBuilder::createFunctionExpr):
2458 (JSC::ASTBuilder::createFunctionBody):
2459 (JSC::ASTBuilder::createGetterOrSetterProperty):
2460 (JSC::ASTBuilder::createArgumentsList):
2461 (JSC::ASTBuilder::createPropertyList):
2462 (JSC::ASTBuilder::createFuncDeclStatement):
2463 (JSC::ASTBuilder::createBlockStatement):
2464 (JSC::ASTBuilder::createExprStatement):
2465 (JSC::ASTBuilder::createIfStatement):
2466 (JSC::ASTBuilder::createForLoop):
2467 (JSC::ASTBuilder::createForInLoop):
2468 (JSC::ASTBuilder::createEmptyStatement):
2469 (JSC::ASTBuilder::createVarStatement):
2470 (JSC::ASTBuilder::createReturnStatement):
2471 (JSC::ASTBuilder::createBreakStatement):
2472 (JSC::ASTBuilder::createContinueStatement):
2473 (JSC::ASTBuilder::createTryStatement):
2474 (JSC::ASTBuilder::createSwitchStatement):
2475 (JSC::ASTBuilder::createWhileStatement):
2476 (JSC::ASTBuilder::createDoWhileStatement):
2477 (JSC::ASTBuilder::createLabelStatement):
2478 (JSC::ASTBuilder::createWithStatement):
2479 (JSC::ASTBuilder::createThrowStatement):
2480 (JSC::ASTBuilder::createDebugger):
2481 (JSC::ASTBuilder::createConstStatement):
2482 (JSC::ASTBuilder::appendConstDecl):
2483 (JSC::ASTBuilder::combineCommaNodes):
2484 (JSC::ASTBuilder::appendBinaryOperation):
2485 (JSC::ASTBuilder::createAssignment):
2486 (JSC::ASTBuilder::createNumber):
2487 (JSC::ASTBuilder::makeTypeOfNode):
2488 (JSC::ASTBuilder::makeDeleteNode):
2489 (JSC::ASTBuilder::makeNegateNode):
2490 (JSC::ASTBuilder::makeBitwiseNotNode):
2491 (JSC::ASTBuilder::makeMultNode):
2492 (JSC::ASTBuilder::makeDivNode):
2493 (JSC::ASTBuilder::makeModNode):
2494 (JSC::ASTBuilder::makeAddNode):
2495 (JSC::ASTBuilder::makeSubNode):
2496 (JSC::ASTBuilder::makeLeftShiftNode):
2497 (JSC::ASTBuilder::makeRightShiftNode):
2498 (JSC::ASTBuilder::makeURightShiftNode):
2499 (JSC::ASTBuilder::makeBitOrNode):
2500 (JSC::ASTBuilder::makeBitAndNode):
2501 (JSC::ASTBuilder::makeBitXOrNode):
2502 (JSC::ASTBuilder::makeFunctionCallNode):
2503 (JSC::ASTBuilder::makeBinaryNode):
2504 (JSC::ASTBuilder::makeAssignNode):
2505 (JSC::ASTBuilder::makePrefixNode):
2506 (JSC::ASTBuilder::makePostfixNode):
2507 * parser/Lexer.cpp:
2508 (JSC::::setCode):
2509 (JSC::::internalShift):
2510 (JSC::::shift):
2511 (JSC::::lex):
2512 * parser/Lexer.h:
2513 (Lexer):
2514 (JSC::Lexer::currentColumnNumber):
2515 (JSC::::lexExpectIdentifier):
2516 * parser/NodeConstructors.h:
2517 (JSC::Node::Node):
2518 (JSC::ExpressionNode::ExpressionNode):
2519 (JSC::StatementNode::StatementNode):
2520 (JSC::NullNode::NullNode):
2521 (JSC::BooleanNode::BooleanNode):
2522 (JSC::NumberNode::NumberNode):
2523 (JSC::StringNode::StringNode):
2524 (JSC::RegExpNode::RegExpNode):
2525 (JSC::ThisNode::ThisNode):
2526 (JSC::ResolveNode::ResolveNode):
2527 (JSC::ArrayNode::ArrayNode):
2528 (JSC::PropertyListNode::PropertyListNode):
2529 (JSC::ObjectLiteralNode::ObjectLiteralNode):
2530 (JSC::BracketAccessorNode::BracketAccessorNode):
2531 (JSC::DotAccessorNode::DotAccessorNode):
2532 (JSC::ArgumentListNode::ArgumentListNode):
2533 (JSC::NewExprNode::NewExprNode):
2534 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
2535 (JSC::FunctionCallValueNode::FunctionCallValueNode):
2536 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
2537 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
2538 (JSC::FunctionCallDotNode::FunctionCallDotNode):
2539 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
2540 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
2541 (JSC::PrePostResolveNode::PrePostResolveNode):
2542 (JSC::PostfixResolveNode::PostfixResolveNode):
2543 (JSC::PostfixBracketNode::PostfixBracketNode):
2544 (JSC::PostfixDotNode::PostfixDotNode):
2545 (JSC::PostfixErrorNode::PostfixErrorNode):
2546 (JSC::DeleteResolveNode::DeleteResolveNode):
2547 (JSC::DeleteBracketNode::DeleteBracketNode):
2548 (JSC::DeleteDotNode::DeleteDotNode):
2549 (JSC::DeleteValueNode::DeleteValueNode):
2550 (JSC::VoidNode::VoidNode):
2551 (JSC::TypeOfResolveNode::TypeOfResolveNode):
2552 (JSC::TypeOfValueNode::TypeOfValueNode):
2553 (JSC::PrefixResolveNode::PrefixResolveNode):
2554 (JSC::PrefixBracketNode::PrefixBracketNode):
2555 (JSC::PrefixDotNode::PrefixDotNode):
2556 (JSC::PrefixErrorNode::PrefixErrorNode):
2557 (JSC::UnaryOpNode::UnaryOpNode):
2558 (JSC::UnaryPlusNode::UnaryPlusNode):
2559 (JSC::NegateNode::NegateNode):
2560 (JSC::BitwiseNotNode::BitwiseNotNode):
2561 (JSC::LogicalNotNode::LogicalNotNode):
2562 (JSC::BinaryOpNode::BinaryOpNode):
2563 (JSC::MultNode::MultNode):
2564 (JSC::DivNode::DivNode):
2565 (JSC::ModNode::ModNode):
2566 (JSC::AddNode::AddNode):
2567 (JSC::SubNode::SubNode):
2568 (JSC::LeftShiftNode::LeftShiftNode):
2569 (JSC::RightShiftNode::RightShiftNode):
2570 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
2571 (JSC::LessNode::LessNode):
2572 (JSC::GreaterNode::GreaterNode):
2573 (JSC::LessEqNode::LessEqNode):
2574 (JSC::GreaterEqNode::GreaterEqNode):
2575 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
2576 (JSC::InstanceOfNode::InstanceOfNode):
2577 (JSC::InNode::InNode):
2578 (JSC::EqualNode::EqualNode):
2579 (JSC::NotEqualNode::NotEqualNode):
2580 (JSC::StrictEqualNode::StrictEqualNode):
2581 (JSC::NotStrictEqualNode::NotStrictEqualNode):
2582 (JSC::BitAndNode::BitAndNode):
2583 (JSC::BitOrNode::BitOrNode):
2584 (JSC::BitXOrNode::BitXOrNode):
2585 (JSC::LogicalOpNode::LogicalOpNode):
2586 (JSC::ConditionalNode::ConditionalNode):
2587 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
2588 (JSC::AssignResolveNode::AssignResolveNode):
2589 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
2590 (JSC::AssignBracketNode::AssignBracketNode):
2591 (JSC::AssignDotNode::AssignDotNode):
2592 (JSC::ReadModifyDotNode::ReadModifyDotNode):
2593 (JSC::AssignErrorNode::AssignErrorNode):
2594 (JSC::CommaNode::CommaNode):
2595 (JSC::ConstStatementNode::ConstStatementNode):
2596 (JSC::EmptyStatementNode::EmptyStatementNode):
2597 (JSC::DebuggerStatementNode::DebuggerStatementNode):
2598 (JSC::ExprStatementNode::ExprStatementNode):
2599 (JSC::VarStatementNode::VarStatementNode):
2600 (JSC::IfNode::IfNode):
2601 (JSC::IfElseNode::IfElseNode):
2602 (JSC::DoWhileNode::DoWhileNode):
2603 (JSC::WhileNode::WhileNode):
2604 (JSC::ForNode::ForNode):
2605 (JSC::ContinueNode::ContinueNode):
2606 (JSC::BreakNode::BreakNode):
2607 (JSC::ReturnNode::ReturnNode):
2608 (JSC::WithNode::WithNode):
2609 (JSC::LabelNode::LabelNode):
2610 (JSC::ThrowNode::ThrowNode):
2611 (JSC::TryNode::TryNode):
2612 (JSC::FuncExprNode::FuncExprNode):
2613 (JSC::FuncDeclNode::FuncDeclNode):
2614 (JSC::SwitchNode::SwitchNode):
2615 (JSC::ConstDeclNode::ConstDeclNode):
2616 (JSC::BlockNode::BlockNode):
2617 (JSC::ForInNode::ForInNode):
2618 * parser/Nodes.cpp:
2619 (JSC::StatementNode::setLoc):
2620 (JSC):
2621 (JSC::ScopeNode::ScopeNode):
2622 (JSC::ProgramNode::ProgramNode):
2623 (JSC::ProgramNode::create):
2624 (JSC::EvalNode::EvalNode):
2625 (JSC::EvalNode::create):
2626 (JSC::FunctionBodyNode::FunctionBodyNode):
2627 (JSC::FunctionBodyNode::create):
2628 * parser/Nodes.h:
2629 (Node):
2630 (JSC::Node::columnNo):
2631 (ExpressionNode):
2632 (StatementNode):
2633 (JSC::StatementNode::column):
2634 (NullNode):
2635 (BooleanNode):
2636 (NumberNode):
2637 (StringNode):
2638 (RegExpNode):
2639 (ThisNode):
2640 (ResolveNode):
2641 (ArrayNode):
2642 (PropertyListNode):
2643 (ObjectLiteralNode):
2644 (BracketAccessorNode):
2645 (DotAccessorNode):
2646 (ArgumentListNode):
2647 (NewExprNode):
2648 (EvalFunctionCallNode):
2649 (FunctionCallValueNode):
2650 (FunctionCallResolveNode):
2651 (FunctionCallBracketNode):
2652 (FunctionCallDotNode):
2653 (CallFunctionCallDotNode):
2654 (ApplyFunctionCallDotNode):
2655 (PrePostResolveNode):
2656 (PostfixResolveNode):
2657 (PostfixBracketNode):
2658 (PostfixDotNode):
2659 (PostfixErrorNode):
2660 (DeleteResolveNode):
2661 (DeleteBracketNode):
2662 (DeleteDotNode):
2663 (DeleteValueNode):
2664 (VoidNode):
2665 (TypeOfResolveNode):
2666 (TypeOfValueNode):
2667 (PrefixResolveNode):
2668 (PrefixBracketNode):
2669 (PrefixDotNode):
2670 (PrefixErrorNode):
2671 (UnaryOpNode):
2672 (UnaryPlusNode):
2673 (NegateNode):
2674 (BitwiseNotNode):
2675 (LogicalNotNode):
2676 (BinaryOpNode):
2677 (MultNode):
2678 (DivNode):
2679 (ModNode):
2680 (AddNode):
2681 (SubNode):
2682 (LeftShiftNode):
2683 (RightShiftNode):
2684 (UnsignedRightShiftNode):
2685 (LessNode):
2686 (GreaterNode):
2687 (LessEqNode):
2688 (GreaterEqNode):
2689 (ThrowableBinaryOpNode):
2690 (InstanceOfNode):
2691 (InNode):
2692 (EqualNode):
2693 (NotEqualNode):
2694 (StrictEqualNode):
2695 (NotStrictEqualNode):
2696 (BitAndNode):
2697 (BitOrNode):
2698 (BitXOrNode):
2699 (LogicalOpNode):
2700 (ConditionalNode):
2701 (ReadModifyResolveNode):
2702 (AssignResolveNode):
2703 (ReadModifyBracketNode):
2704 (AssignBracketNode):
2705 (AssignDotNode):
2706 (ReadModifyDotNode):
2707 (AssignErrorNode):
2708 (CommaNode):
2709 (ConstDeclNode):
2710 (ConstStatementNode):
2711 (BlockNode):
2712 (EmptyStatementNode):
2713 (DebuggerStatementNode):
2714 (ExprStatementNode):
2715 (VarStatementNode):
2716 (IfNode):
2717 (IfElseNode):
2718 (DoWhileNode):
2719 (WhileNode):
2720 (ForNode):
2721 (ForInNode):
2722 (ContinueNode):
2723 (BreakNode):
2724 (ReturnNode):
2725 (WithNode):
2726 (LabelNode):
2727 (ThrowNode):
2728 (TryNode):
2729 (ScopeNode):
2730 (ProgramNode):
2731 (EvalNode):
2732 (FunctionBodyNode):
2733 (FuncExprNode):
2734 (FuncDeclNode):
2735 (SwitchNode):
2736 * parser/Parser.cpp:
2737 (JSC::::parseSourceElements):
2738 (JSC::::parseVarDeclaration):
2739 (JSC::::parseConstDeclaration):
2740 (JSC::::parseDoWhileStatement):
2741 (JSC::::parseWhileStatement):
2742 (JSC::::parseVarDeclarationList):
2743 (JSC::::parseConstDeclarationList):
2744 (JSC::::parseForStatement):
2745 (JSC::::parseBreakStatement):
2746 (JSC::::parseContinueStatement):
2747 (JSC::::parseReturnStatement):
2748 (JSC::::parseThrowStatement):
2749 (JSC::::parseWithStatement):
2750 (JSC::::parseSwitchStatement):
2751 (JSC::::parseTryStatement):
2752 (JSC::::parseDebuggerStatement):
2753 (JSC::::parseBlockStatement):
2754 (JSC::::parseStatement):
2755 (JSC::::parseFunctionBody):
2756 (JSC::::parseFunctionInfo):
2757 (JSC::::parseFunctionDeclaration):
2758 (JSC::::parseExpressionOrLabelStatement):
2759 (JSC::::parseExpressionStatement):
2760 (JSC::::parseIfStatement):
2761 (JSC::::parseExpression):
2762 (JSC::::parseAssignmentExpression):
2763 (JSC::::parseConditionalExpression):
2764 (JSC::::parseBinaryExpression):
2765 (JSC::::parseProperty):
2766 (JSC::::parseObjectLiteral):
2767 (JSC::::parseStrictObjectLiteral):
2768 (JSC::::parseArrayLiteral):
2769 (JSC::::parsePrimaryExpression):
2770 (JSC::::parseArguments):
2771 (JSC::::parseMemberExpression):
2772 (JSC::::parseUnaryExpression):
2773 * parser/Parser.h:
2774 (JSC::Parser::next):
2775 (JSC::Parser::nextExpectIdentifier):
2776 (JSC::Parser::tokenStart):
2777 (JSC::Parser::tokenLine):
2778 (JSC::Parser::tokenEnd):
2779 (JSC::Parser::tokenLocation):
2780 (Parser):
2781 (JSC::Parser::getTokenName):
2782 (JSC::::parse):
2783 * parser/ParserTokens.h:
2784 (JSC::JSTokenLocation::JSTokenLocation):
2785 (JSTokenLocation):
2786 (JSToken):
2787 * parser/SourceProviderCacheItem.h:
2788 (JSC::SourceProviderCacheItem::closeBraceToken):
2789 * parser/SyntaxChecker.h:
2790 (JSC::SyntaxChecker::makeFunctionCallNode):
2791 (JSC::SyntaxChecker::createCommaExpr):
2792 (JSC::SyntaxChecker::makeAssignNode):
2793 (JSC::SyntaxChecker::makePrefixNode):
2794 (JSC::SyntaxChecker::makePostfixNode):
2795 (JSC::SyntaxChecker::makeTypeOfNode):
2796 (JSC::SyntaxChecker::makeDeleteNode):
2797 (JSC::SyntaxChecker::makeNegateNode):
2798 (JSC::SyntaxChecker::makeBitwiseNotNode):
2799 (JSC::SyntaxChecker::createLogicalNot):
2800 (JSC::SyntaxChecker::createUnaryPlus):
2801 (JSC::SyntaxChecker::createVoid):
2802 (JSC::SyntaxChecker::thisExpr):
2803 (JSC::SyntaxChecker::createResolve):
2804 (JSC::SyntaxChecker::createObjectLiteral):
2805 (JSC::SyntaxChecker::createArray):
2806 (JSC::SyntaxChecker::createNumberExpr):
2807 (JSC::SyntaxChecker::createString):
2808 (JSC::SyntaxChecker::createBoolean):
2809 (JSC::SyntaxChecker::createNull):
2810 (JSC::SyntaxChecker::createBracketAccess):
2811 (JSC::SyntaxChecker::createDotAccess):
2812 (JSC::SyntaxChecker::createRegExp):
2813 (JSC::SyntaxChecker::createNewExpr):
2814 (JSC::SyntaxChecker::createConditionalExpr):
2815 (JSC::SyntaxChecker::createAssignResolve):
2816 (JSC::SyntaxChecker::createFunctionExpr):
2817 (JSC::SyntaxChecker::createFunctionBody):
2818 (JSC::SyntaxChecker::createArgumentsList):
2819 (JSC::SyntaxChecker::createPropertyList):
2820 (JSC::SyntaxChecker::createFuncDeclStatement):
2821 (JSC::SyntaxChecker::createBlockStatement):
2822 (JSC::SyntaxChecker::createExprStatement):
2823 (JSC::SyntaxChecker::createIfStatement):
2824 (JSC::SyntaxChecker::createForLoop):
2825 (JSC::SyntaxChecker::createForInLoop):
2826 (JSC::SyntaxChecker::createEmptyStatement):
2827 (JSC::SyntaxChecker::createVarStatement):
2828 (JSC::SyntaxChecker::createReturnStatement):
2829 (JSC::SyntaxChecker::createBreakStatement):
2830 (JSC::SyntaxChecker::createContinueStatement):
2831 (JSC::SyntaxChecker::createTryStatement):
2832 (JSC::SyntaxChecker::createSwitchStatement):
2833 (JSC::SyntaxChecker::createWhileStatement):
2834 (JSC::SyntaxChecker::createWithStatement):
2835 (JSC::SyntaxChecker::createDoWhileStatement):
2836 (JSC::SyntaxChecker::createLabelStatement):
2837 (JSC::SyntaxChecker::createThrowStatement):
2838 (JSC::SyntaxChecker::createDebugger):
2839 (JSC::SyntaxChecker::createConstStatement):
2840 (JSC::SyntaxChecker::appendConstDecl):
2841 (JSC::SyntaxChecker::createGetterOrSetterProperty):
2842 (JSC::SyntaxChecker::combineCommaNodes):
2843 (JSC::SyntaxChecker::operatorStackPop):
2844
fpizlo@apple.com270a7ad2012-08-02 01:28:10 +000028452012-08-01 Filip Pizlo <fpizlo@apple.com>
2846
fpizlo@apple.comcaa68812012-08-02 04:32:30 +00002847 DFG should hoist structure checks
2848 https://bugs.webkit.org/show_bug.cgi?id=92696
2849
2850 Reviewed by Gavin Barraclough.
2851
2852 This hoists structure checks in the same way that we would hoist array checks, but with added
2853 complexity to cope with the fact that the structure of an object may change. This is handled
2854 by performing a side effects analysis over the region in which the respective variable is
2855 live. If a structure clobbering side effect may happen then we either hoist the structure
2856 checks and fall back on structure transition watchpoints (if the watchpoint set is still
2857 valid), or we avoid hoisting altogether.
2858
2859 Doing this required teaching the CFA that we may have an expectation that an object has a
2860 particular structure even after structure clobbering happens, in the sense that structure
2861 proofs that were cobbered can be revived using watchpoints. CFA must know about this so that
2862 OSR entry may know about it, since we cannot allow entry to happen if the variable has a
2863 clobbered structure proof, will have a watchpoint to revive the proof, and the variable in
2864 the baseline JIT has a completely unrelated structure.
2865
2866 This is mostly performance neutral.
2867
2868 * CMakeLists.txt:
2869 * GNUmakefile.list.am:
2870 * JavaScriptCore.xcodeproj/project.pbxproj:
2871 * Target.pri:
2872 * bytecode/ValueRecovery.h:
2873 (JSC::ValueRecovery::isSet):
2874 (JSC::ValueRecovery::operator!):
2875 (ValueRecovery):
2876 * dfg/DFGAbstractState.cpp:
2877 (JSC::DFG::AbstractState::execute):
2878 (JSC::DFG::AbstractState::clobberWorld):
2879 (DFG):
2880 (JSC::DFG::AbstractState::clobberCapturedVars):
2881 * dfg/DFGAbstractState.h:
2882 (AbstractState):
2883 * dfg/DFGAbstractValue.h:
2884 (JSC::DFG::AbstractValue::clear):
2885 (JSC::DFG::AbstractValue::isClear):
2886 (JSC::DFG::AbstractValue::makeTop):
2887 (JSC::DFG::AbstractValue::isTop):
2888 (JSC::DFG::AbstractValue::set):
2889 (JSC::DFG::AbstractValue::operator==):
2890 (JSC::DFG::AbstractValue::merge):
2891 (JSC::DFG::AbstractValue::filter):
2892 (JSC::DFG::AbstractValue::validate):
2893 (JSC::DFG::AbstractValue::validateForEntry):
2894 (AbstractValue):
2895 (JSC::DFG::AbstractValue::checkConsistency):
2896 (JSC::DFG::AbstractValue::dump):
2897 * dfg/DFGByteCodeParser.cpp:
2898 (JSC::DFG::ByteCodeParser::setLocal):
2899 (JSC::DFG::ByteCodeParser::getArgument):
2900 (JSC::DFG::ByteCodeParser::setArgument):
2901 (JSC::DFG::ByteCodeParser::parseBlock):
2902 (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
2903 * dfg/DFGCSEPhase.cpp:
2904 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
2905 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
2906 (JSC::DFG::CSEPhase::putStructureStoreElimination):
2907 (JSC::DFG::CSEPhase::getLocalLoadElimination):
2908 (JSC::DFG::CSEPhase::performNodeCSE):
2909 * dfg/DFGDriver.cpp:
2910 (JSC::DFG::compile):
2911 * dfg/DFGGraph.cpp:
2912 (JSC::DFG::Graph::dump):
2913 * dfg/DFGGraph.h:
2914 (JSC::DFG::Graph::vote):
2915 (Graph):
2916 * dfg/DFGNode.h:
2917 (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
2918 (Node):
2919 (JSC::DFG::Node::hasStructureSet):
2920 * dfg/DFGNodeType.h:
2921 (DFG):
2922 * dfg/DFGOSREntry.cpp:
2923 (JSC::DFG::prepareOSREntry):
2924 * dfg/DFGPredictionPropagationPhase.cpp:
2925 (JSC::DFG::PredictionPropagationPhase::propagate):
2926 (PredictionPropagationPhase):
2927 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
2928 * dfg/DFGSpeculativeJIT.h:
2929 (SpeculativeJIT):
2930 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
2931 (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
2932 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
2933 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
2934 (JSC::DFG::SpeculateCellOperand::gpr):
2935 (SpeculateCellOperand):
2936 * dfg/DFGSpeculativeJIT32_64.cpp:
2937 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
2938 (JSC::DFG::SpeculativeJIT::compile):
2939 * dfg/DFGSpeculativeJIT64.cpp:
2940 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
2941 (JSC::DFG::SpeculativeJIT::compile):
2942 * dfg/DFGStructureCheckHoistingPhase.cpp: Added.
2943 (DFG):
2944 (StructureCheckHoistingPhase):
2945 (JSC::DFG::StructureCheckHoistingPhase::StructureCheckHoistingPhase):
2946 (JSC::DFG::StructureCheckHoistingPhase::run):
2947 (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
2948 (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
2949 (JSC::DFG::StructureCheckHoistingPhase::clobber):
2950 (CheckData):
2951 (JSC::DFG::StructureCheckHoistingPhase::CheckData::CheckData):
2952 (JSC::DFG::performStructureCheckHoisting):
2953 * dfg/DFGStructureCheckHoistingPhase.h: Added.
2954 (DFG):
2955 * dfg/DFGVariableAccessData.h:
2956 (VariableAccessData):
2957 (JSC::DFG::VariableAccessData::VariableAccessData):
2958 (JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
2959 (JSC::DFG::VariableAccessData::structureCheckHoistingFailed):
2960 (JSC::DFG::VariableAccessData::clearVotes):
2961 (JSC::DFG::VariableAccessData::vote):
2962 (JSC::DFG::VariableAccessData::voteRatio):
2963 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
2964 * runtime/Options.h:
2965 (JSC):
2966
29672012-08-01 Filip Pizlo <fpizlo@apple.com>
2968
fpizlo@apple.com270a7ad2012-08-02 01:28:10 +00002969 DFG should distinguish between PutByVal's that clobber the world and ones that don't
2970 https://bugs.webkit.org/show_bug.cgi?id=92923
2971
2972 Reviewed by Mark Hahnenberg.
2973
2974 This is performance-neutral. I also confirmed that it's neutral if we make the
2975 clobbering variant (PutByValSafe) clobber all knowledge of what is an array,
2976 which should feed nicely into work on removing uses of ClassInfo.
2977
2978 * bytecode/DFGExitProfile.h:
2979 * dfg/DFGAbstractState.cpp:
2980 (JSC::DFG::AbstractState::execute):
2981 * dfg/DFGByteCodeParser.cpp:
2982 (JSC::DFG::ByteCodeParser::parseBlock):
2983 * dfg/DFGCSEPhase.cpp:
2984 (JSC::DFG::CSEPhase::getByValLoadElimination):
2985 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
2986 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
2987 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
2988 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
2989 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
2990 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
2991 (JSC::DFG::CSEPhase::performNodeCSE):
2992 * dfg/DFGFixupPhase.cpp:
2993 (JSC::DFG::FixupPhase::fixupNode):
2994 * dfg/DFGGraph.h:
2995 (JSC::DFG::Graph::byValIsPure):
2996 (JSC::DFG::Graph::clobbersWorld):
2997 * dfg/DFGNodeType.h:
2998 (DFG):
2999 * dfg/DFGPredictionPropagationPhase.cpp:
3000 (JSC::DFG::PredictionPropagationPhase::propagate):
3001 * dfg/DFGSpeculativeJIT32_64.cpp:
3002 (JSC::DFG::SpeculativeJIT::compile):
3003 * dfg/DFGSpeculativeJIT64.cpp:
3004 (JSC::DFG::SpeculativeJIT::compile):
3005
jianli@chromium.orgf66b5812012-08-02 00:14:28 +000030062012-08-01 Jian Li <jianli@chromium.org>
3007
3008 Add new CSS property "-webkit-widget-region" to expose dashboard region support for other port
3009 https://bugs.webkit.org/show_bug.cgi?id=90298
3010
3011 Reviewed by Adam Barth.
3012
3013 * Configurations/FeatureDefines.xcconfig: Add ENABLE_WIDGET_REGION define.
3014
paroga@webkit.orgf3f2e132012-08-01 20:49:26 +000030152012-08-01 Patrick Gansterer <paroga@webkit.org>
3016
3017 Replace WTF::getCurrentLocalTime() with GregorianDateTime::setToCurrentLocalTime()
3018 https://bugs.webkit.org/show_bug.cgi?id=92286
3019
3020 Reviewed by Geoffrey Garen.
3021
3022 Add a method to GregorianDateTime to set its values to the current locale time.
3023 Replacing all occurrences of getCurrentLocalTime with the new function allows
3024 us to remove getCurrentLocalTime in a next step.
3025
3026 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3027
mhahnenberg@apple.comf19f9352012-08-01 19:24:58 +000030282012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
3029
3030 C++ code should get ClassInfo from the Structure
3031 https://bugs.webkit.org/show_bug.cgi?id=92892
3032
3033 Reviewed by Geoffrey Garen.
3034
3035 In our march to remove ClassInfo from our JSCell object headers, we can switch
3036 C++ code over to grabbing the ClassInfo from the Structure since it is finally
3037 safe to do so now that Structure access is safe during finalization/destruction.
3038 The remaining JIT code changes can be done in a separate patch.
3039
3040 * heap/MarkedBlock.cpp:
3041 (JSC::MarkedBlock::callDestructor): We don't want to clear the Structure any more
3042 since the Structure should still be valid at this point.
3043 * heap/WeakSetInlines.h:
3044 (JSC::WeakBlock::finalize): Ditto.
3045 * runtime/JSCell.h:
3046 (JSC):
3047 * runtime/Structure.h:
3048 (JSC::JSCell::classInfo): Move JSCell's classInfo() to Structure.h so it can be
3049 inline. Use a different method of getting the JSCell's Structure based on
3050 whether we're in GC_VALIDATION mode or not, since always using get() will cause
3051 infinite recursion in GC_VALIDATION mode.
3052 (JSC):
3053
mhahnenberg@apple.com42853a62012-08-01 18:55:03 +000030542012-07-31 Mark Hahnenberg <mhahnenberg@apple.com>
3055
3056 MarkedBlock::sweep() should sweep another block if it can't sweep a Structure block
3057 https://bugs.webkit.org/show_bug.cgi?id=92819
3058
3059 Reviewed by Geoffrey Garen.
3060
3061 If we are forced to allocate a new block for Structures because we are unable to safely
3062 sweep our pre-existing Structure blocks, we should sweep another random block so that we
3063 can start sweeping Structure blocks sooner.
3064
3065 * heap/IncrementalSweeper.cpp:
3066 (JSC::IncrementalSweeper::doSweep): Change to use sweepNextBlock.
3067 (JSC):
3068 (JSC::IncrementalSweeper::sweepNextBlock):
3069 * heap/IncrementalSweeper.h:
3070 (IncrementalSweeper):
3071 * heap/MarkedAllocator.cpp:
3072 (JSC::MarkedAllocator::tryAllocateHelper): When we can't safely sweep
3073 our Structure blocks, call sweepNextBlock instead.
3074
weinig@apple.comd824f452012-07-31 23:50:04 +000030752012-07-31 Sam Weinig <sam@webkit.org>
3076
3077 Fix the Windows build.
3078
3079 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3080
ggaren@apple.come0d70122012-07-31 23:46:53 +000030812012-07-31 Geoffrey Garen <ggaren@apple.com>
3082
3083 Maybe fix the GCC build.
3084
3085 * heap/HeapBlock.h:
3086 (HeapBlock): Accommodate incorrect parsing in GCC.
3087
weinig@apple.com329b8062012-07-31 23:24:31 +000030882012-07-31 Sam Weinig <sam@webkit.org>
3089
3090 Stop masking 8 bits off of the visited link hash. We need all the bits!
3091 https://bugs.webkit.org/show_bug.cgi?id=92799
3092
3093 Reviewed by Anders Carlsson.
3094
3095 * runtime/Identifier.cpp:
3096 (JSC::IdentifierCStringTranslator::hash):
3097 (JSC::IdentifierLCharFromUCharTranslator::hash):
3098 * runtime/Identifier.h:
3099 (JSC::IdentifierCharBufferTranslator::hash):
3100 Update for new function names.
3101
ggaren@apple.comc33983c2012-07-31 23:07:46 +000031022012-07-31 Geoffrey Garen <ggaren@apple.com>
3103
3104 Maybe break the Windows build.
3105
3106 Reviewed by Anders Carlsson.
3107
3108 Formally objected to by Sam Weinig.
3109
3110 * heap/HeapBlock.h:
3111 (HeapBlock): Try to slightly improve this because we don't want Windows to control our lives.
3112
mhahnenberg@apple.com59c64f12012-07-31 23:05:12 +000031132012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
3114
3115 Structures should be swept after all other objects
3116 https://bugs.webkit.org/show_bug.cgi?id=92679
3117
3118 Reviewed by Filip Pizlo.
3119
3120 In order to get rid of ClassInfo from our objects, we need to be able to safely get the
3121 ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
3122 Structure, but currently it is not safe to do so because the order of destruction of objects
3123 is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
3124 sweeping Structures after everything else.
3125
3126 * heap/Heap.cpp:
3127 (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
3128 If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
3129 safe to sweep structures since we'll always do Structures last anyways due to the ordering of
3130 MarkedSpace::forEachBlock.
3131 (JSC):
3132 (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
3133 calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
3134 these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
3135 calls during lastChanceToFinalize().
3136 * heap/Heap.h:
3137 (Heap):
3138 * heap/HeapTimer.h:
3139 (HeapTimer):
3140 * heap/IncrementalSweeper.cpp:
3141 (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
3142 This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
3143 the first time.
3144 (JSC):
3145 (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
3146 make our first pass. We now null out the slots as we sweep them so that we can quickly find the
3147 Structures during the second pass.
3148 (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
3149 (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
3150 the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
3151 assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
3152 iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
3153 (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
3154 * heap/IncrementalSweeper.h: Add declarations for new stuff.
3155 (IncrementalSweeper):
3156 * heap/MarkedAllocator.cpp:
3157 (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
3158 if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
3159 the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
3160 will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
3161 Structure garbage.
3162 (JSC::MarkedAllocator::addBlock):
3163 * heap/MarkedAllocator.h:
3164 (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
3165 longer valid to allocate from, so we set the current block to null.
3166 * heap/MarkedBlock.cpp:
3167 (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
3168 at an unsafe time.
3169 * heap/MarkedSpace.cpp:
3170 (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
3171 (JSC):
3172 * heap/MarkedSpace.h:
3173 (JSC):
3174 * runtime/JSGlobalData.cpp:
3175 (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
3176
ggaren@apple.comdd7793a2012-07-31 21:26:38 +000031772012-07-31 Geoffrey Garen <ggaren@apple.com>
3178
ggaren@apple.com0aa5f2a2012-07-31 23:00:53 +00003179 Fix all the other builds I just broke. Maybe fix the Windows build.
3180
3181 * heap/HeapBlock.h:
3182 (HeapBlock): WTF?
3183
31842012-07-31 Geoffrey Garen <ggaren@apple.com>
3185
ggaren@apple.comeff3a062012-07-31 22:27:38 +00003186 Maybe fix the Windows build.
3187
3188 * heap/HeapBlock.h:
3189 (HeapBlock): WTF?
3190
31912012-07-31 Geoffrey Garen <ggaren@apple.com>
3192
ggaren@apple.comc5be1dd2012-07-31 22:59:49 +00003193 Maybe fix the Windows build.
3194
3195 * heap/HeapBlock.h:
3196 (HeapBlock): WTF?
3197
31982012-07-31 Geoffrey Garen <ggaren@apple.com>
3199
ggaren@apple.comdd7793a2012-07-31 21:26:38 +00003200 Removed some public data and casting from the Heap
3201 https://bugs.webkit.org/show_bug.cgi?id=92777
3202
3203 Reviewed by Oliver Hunt.
3204
3205 * heap/BlockAllocator.cpp:
3206 (JSC::BlockAllocator::releaseFreeBlocks):
3207 (JSC::BlockAllocator::blockFreeingThreadMain): Use the DeadBlock class
3208 since HeapBlock is a template, and not a class, now. Call destroy()
3209 instead of monkeying around with DeadBlock's internal data because
3210 encapsulation is good.
3211
3212 * heap/BlockAllocator.h:
3213 (DeadBlock): Added a class to represent a dead block, since HeapBlock is
3214 a template now, and can't be instantiated directly.
3215
3216 (JSC::DeadBlock::DeadBlock):
3217 (JSC::DeadBlock::create):
3218 (BlockAllocator):
3219 (JSC::BlockAllocator::allocate):
3220 (JSC::BlockAllocator::deallocate): Use the DeadBlock class because
3221 encapsulation is good.
3222
3223 * heap/CopiedBlock.h:
3224 (CopiedBlock::destroy): No need for a destroy() function, since we
3225 inherit one now.
3226
3227 (JSC::CopiedBlock::CopiedBlock):
3228 (JSC::CopiedBlock::payloadEnd):
3229 (JSC::CopiedBlock::capacity): Updated for some encapsulation inside
3230 HeapBlock.
3231
3232 * heap/CopiedSpace.cpp:
3233 (JSC::CopiedSpace::~CopiedSpace):
3234 (JSC::CopiedSpace::doneCopying):
3235 (JSC::CopiedSpace::size):
3236 (JSC::CopiedSpace::capacity):
3237 (JSC::isBlockListPagedOut): Removed a bunch of casting. This is no longer
3238 necessary, now that our list and its nodes have the right type.
3239
3240 * heap/CopiedSpace.h: Use the right type in our data structures because
3241 it improves clarity.
3242
3243 * heap/CopiedSpaceInlineMethods.h:
3244 (JSC::CopiedSpace::startedCopying): Use swap to avoid duplicating it.
3245
3246 * heap/HeapBlock.h:
3247 (HeapBlock): Made this a class template so we can return the right type
3248 in linked list operations. Made our data private because encapsulation
3249 is good.
3250
3251 (JSC::HeapBlock::destroy): Since we know our type, we can also eliminate
3252 duplicate destroy() functions in our subclasses.
3253
3254 (JSC::HeapBlock::allocation): Added an accessor so we can hide our data.
3255 By using const, this accessor prevents clients from accidentally deleting
3256 our allocation.
3257
3258 * heap/MarkedAllocator.cpp:
3259 (JSC::MarkedAllocator::isPagedOut):
3260 (JSC::MarkedAllocator::tryAllocateHelper):
3261 (JSC::MarkedAllocator::removeBlock): Removed a bunch of casting. This is
3262 no longer necessary, now that our list and its nodes have the right type.
3263
3264 * heap/MarkedAllocator.h:
3265 (MarkedAllocator):
3266 (JSC::MarkedAllocator::reset):
3267 (JSC::MarkedAllocator::forEachBlock): Use the right type, do less casting.
3268
3269 * heap/MarkedBlock.cpp:
3270 (JSC::MarkedBlock::destroy): Removed this function because our parent
3271 class provides it for us now.
3272
3273 (JSC::MarkedBlock::MarkedBlock):
3274 * heap/MarkedBlock.h:
3275 (MarkedBlock):
3276 (JSC::MarkedBlock::capacity): Updated for encapsulation.
3277
fpizlo@apple.com46e4e4e2012-07-31 18:48:17 +000032782012-07-31 Filip Pizlo <fpizlo@apple.com>
3279
3280 DFG OSR exit profiling has unusual oversights
3281 https://bugs.webkit.org/show_bug.cgi?id=92728
3282
3283 Reviewed by Geoffrey Garen.
3284
3285 * dfg/DFGOSRExit.cpp:
3286 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
3287 * dfg/DFGSpeculativeJIT.h:
3288 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
3289 * dfg/DFGSpeculativeJIT32_64.cpp:
3290 (JSC::DFG::SpeculativeJIT::compile):
3291 * dfg/DFGSpeculativeJIT64.cpp:
3292 (JSC::DFG::SpeculativeJIT::compile):
3293
commit-queue@webkit.orge03e44a2012-07-31 18:44:03 +000032942012-07-31 Chao-ying Fu <fu@mips.com>
3295
3296 Add MIPS add32 function
3297 https://bugs.webkit.org/show_bug.cgi?id=91522
3298
3299 Reviewed by Oliver Hunt.
3300
3301 Add isCompactPtrAlignedAddressOffset.
3302 Add a new version of add32 that accepts AbsoluteAddress as inputs.
3303
3304 * assembler/MacroAssemblerMIPS.h:
3305 (JSC::MacroAssemblerMIPS::isCompactPtrAlignedAddressOffset): New.
3306 (MacroAssemblerMIPS):
3307 (JSC::MacroAssemblerMIPS::add32): Support AbsoluteAddress as inputs.
3308
commit-queue@webkit.org764c9fb2012-07-31 01:48:18 +000033092012-07-30 Sheriff Bot <webkit.review.bot@gmail.com>
3310
3311 Unreviewed, rolling out r124123.
3312 http://trac.webkit.org/changeset/124123
3313 https://bugs.webkit.org/show_bug.cgi?id=92700
3314
3315 ASSERT crashes terminate webkit Layout tests (Requested by
3316 msaboff on #webkit).
3317
3318 * heap/Heap.cpp:
3319 * heap/Heap.h:
3320 (Heap):
3321 * heap/IncrementalSweeper.cpp:
3322 (JSC::IncrementalSweeper::doSweep):
3323 (JSC::IncrementalSweeper::startSweeping):
3324 (JSC::IncrementalSweeper::IncrementalSweeper):
3325 (JSC):
3326 * heap/IncrementalSweeper.h:
3327 (IncrementalSweeper):
3328 * heap/MarkedAllocator.cpp:
3329 (JSC::MarkedAllocator::tryAllocateHelper):
3330 (JSC::MarkedAllocator::addBlock):
3331 * heap/MarkedAllocator.h:
3332 (JSC::MarkedAllocator::zapFreeList):
3333 * heap/MarkedBlock.cpp:
3334 (JSC::MarkedBlock::sweepHelper):
3335 * heap/MarkedSpace.cpp:
3336 * heap/MarkedSpace.h:
3337 (JSC::MarkedSpace::sweep):
3338 (JSC):
3339 * runtime/JSGlobalData.cpp:
3340 (JSC::JSGlobalData::~JSGlobalData):
3341
mhahnenberg@apple.com3c1699e2012-07-31 00:33:53 +000033422012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
3343
3344 Structures should be swept after all other objects
3345 https://bugs.webkit.org/show_bug.cgi?id=92679
3346
3347 Reviewed by Filip Pizlo.
3348
3349 In order to get rid of ClassInfo from our objects, we need to be able to safely get the
3350 ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
3351 Structure, but currently it is not safe to do so because the order of destruction of objects
3352 is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
3353 sweeping Structures after everything else.
3354
3355 * heap/Heap.cpp:
3356 (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
3357 If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
3358 safe to sweep structures since we'll always do Structures last anyways due to the ordering of
3359 MarkedSpace::forEachBlock.
3360 (JSC):
3361 (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
3362 calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
3363 these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
3364 calls during lastChanceToFinalize().
3365 * heap/Heap.h:
3366 (Heap):
3367 * heap/HeapTimer.h:
3368 (HeapTimer):
3369 * heap/IncrementalSweeper.cpp:
3370 (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
3371 This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
3372 the first time.
3373 (JSC):
3374 (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
3375 make our first pass. We now null out the slots as we sweep them so that we can quickly find the
3376 Structures during the second pass.
3377 (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
3378 (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
3379 the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
3380 assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
3381 iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
3382 (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
3383 * heap/IncrementalSweeper.h: Add declarations for new stuff.
3384 (IncrementalSweeper):
3385 * heap/MarkedAllocator.cpp:
3386 (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
3387 if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
3388 the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
3389 will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
3390 Structure garbage.
3391 (JSC::MarkedAllocator::addBlock):
3392 * heap/MarkedAllocator.h:
3393 (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
3394 longer valid to allocate from, so we set the current block to null.
3395 * heap/MarkedBlock.cpp:
3396 (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
3397 at an unsafe time.
3398 * heap/MarkedSpace.cpp:
3399 (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
3400 (JSC):
3401 * heap/MarkedSpace.h:
3402 (JSC):
3403 * runtime/JSGlobalData.cpp:
3404 (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
3405
fpizlo@apple.com7cc53e02012-07-29 23:15:30 +000034062012-07-29 Filip Pizlo <fpizlo@apple.com>
3407
3408 PropertyNameArray::m_shouldCache is only assigned and never used
3409 https://bugs.webkit.org/show_bug.cgi?id=92598
3410
3411 Reviewed by Dan Bernstein.
3412
3413 * runtime/PropertyNameArray.h:
3414 (JSC::PropertyNameArray::PropertyNameArray):
3415 (PropertyNameArray):
3416
commit-queue@webkit.orgc1c4f122012-07-29 21:59:53 +000034172012-07-29 Rik Cabanier <cabanier@adobe.com>
3418
3419 Add ENABLE_CSS_COMPOSITING flag
3420 https://bugs.webkit.org/show_bug.cgi?id=92553
3421
3422 Reviewed by Dirk Schulze.
3423
3424 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
3425
3426 * Configurations/FeatureDefines.xcconfig:
3427
mhahnenberg@apple.comaa1f4ec2012-07-27 19:29:03 +000034282012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
3429
mhahnenberg@apple.com7f5b9592012-07-27 22:59:14 +00003430 Split functionality of MarkedAllocator::m_currentBlock
3431 https://bugs.webkit.org/show_bug.cgi?id=92550
3432
3433 Reviewed by Filip Pizlo.
3434
3435 MarkedAllocator::m_currentBlock serves two purposes right now; it indicates the block that is currently
3436 being used for allocation and the beginning of the list of blocks that need to be swept. We should split
3437 these two functionalities into two separate fields.
3438
3439 * heap/MarkedAllocator.cpp:
3440 (JSC::MarkedAllocator::tryAllocateHelper): Use m_blocksToSweep instead of m_currentBlock as the
3441 initializer/reference of the loop. Only change m_currentBlock when we know what the result will be.
3442 (JSC::MarkedAllocator::addBlock): When we add a new block we know that both m_blocksToSweep and
3443 m_currentBlock are null. In order to preserve the invariant that m_currentBlock <= m_blocksToSweep,
3444 we assign both of them to point to the new block.
3445 (JSC::MarkedAllocator::removeBlock): We need a separate check to see if the block we're removing is
3446 m_blocksToSweep and if so, advance it to the next block in the list.
3447 * heap/MarkedAllocator.h:
3448 (MarkedAllocator): Initialize m_blocksToSweep.
3449 (JSC::MarkedAllocator::MarkedAllocator):
3450 (JSC::MarkedAllocator::reset): We set m_blocksToSweep to be the head of our list. This function is called
3451 at the end of a collection, so all of the blocks in our allocator need to be swept. We need to sweep a
3452 block before we can start allocating, so m_currentBlock is set to null. We also set the freeList to
3453 the empty FreeList to emphasize the fact that we can't start allocating until we do some sweeping.
3454
34552012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
3456
mhahnenberg@apple.comaa1f4ec2012-07-27 19:29:03 +00003457 Increase inline storage for JSFinalObjects by one
3458 https://bugs.webkit.org/show_bug.cgi?id=92526
3459
3460 Reviewed by Geoffrey Garen.
3461
3462 Now that we've removed the inheritorID from objects, we can increase our inline storage for JSFinalObjects on
3463 64-bit platforms by 1.
3464
3465 * llint/LowLevelInterpreter.asm: Change the constant.
3466 * runtime/PropertyOffset.h: Change the constant.
3467 (JSC):
3468
jer.noble@apple.com50ecb282012-07-27 16:31:07 +000034692012-07-27 Jer Noble <jer.noble@apple.com>
3470
3471 Support a rational time class for use by media elements.
3472 https://bugs.webkit.org/show_bug.cgi?id=88787
3473
3474 Re-export WTF::MediaTime from JavaScriptCore.
3475
3476 Reviewed by Eric Carlson.
3477
3478 * JavaScriptCore.order:
3479 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3480
fpizlo@apple.comd510fc22012-07-27 00:11:44 +000034812012-07-26 Filip Pizlo <fpizlo@apple.com>
3482
3483 JSObject::reallocateStorageIfNecessary is neither used nor defined
3484 https://bugs.webkit.org/show_bug.cgi?id=92417
3485
3486 Reviewed by Mark Rowe.
3487
3488 * runtime/JSObject.h:
3489 (JSObject):
3490
mhahnenberg@apple.comb44a7f02012-07-26 23:27:53 +000034912012-07-26 Mark Hahnenberg <mhahnenberg@apple.com>
3492
3493 Allocate Structures in a separate part of the Heap
3494 https://bugs.webkit.org/show_bug.cgi?id=92420
3495
3496 Reviewed by Filip Pizlo.
3497
3498 To fix our issue with destruction/finalization of Structures before their objects, we can move Structures to a separate
3499 part of the Heap that will be swept after all other objects. This first patch will just be separating Structures
3500 out into their own separate MarkedAllocator. Everything else will behave identically.
3501
3502 * heap/Heap.h: New function to allocate Structures in the Heap.
3503 (Heap):
3504 (JSC):
3505 (JSC::Heap::allocateStructure):
3506 * heap/MarkedAllocator.cpp: Pass whether or not we're allocated Structures to the MarkedBlock.
3507 (JSC::MarkedAllocator::allocateBlock):
3508 * heap/MarkedAllocator.h: Add tracking for whether or not we're allocating only Structures.
3509 (JSC::MarkedAllocator::onlyContainsStructures):
3510 (MarkedAllocator):
3511 (JSC::MarkedAllocator::MarkedAllocator):
3512 (JSC::MarkedAllocator::init):
3513 * heap/MarkedBlock.cpp: Add tracking for whether or not we're allocating only Structures. We need this to be able to
3514 distinguish the various MarkedBlock types in MarkedSpace::allocatorFor(MarkedBlock*).
3515 (JSC::MarkedBlock::create):
3516 (JSC::MarkedBlock::MarkedBlock):
3517 * heap/MarkedBlock.h:
3518 (MarkedBlock):
3519 (JSC::MarkedBlock::onlyContainsStructures):
3520 (JSC):
3521 * heap/MarkedSpace.cpp: Include the new Structure allocator in all the places that all the other allocators are used/modified.
3522 (JSC::MarkedSpace::MarkedSpace):
3523 (JSC::MarkedSpace::resetAllocators):
3524 (JSC::MarkedSpace::canonicalizeCellLivenessData):
3525 (JSC::MarkedSpace::isPagedOut):
3526 * heap/MarkedSpace.h: Add new MarkedAllocator just for Structures.
3527 (MarkedSpace):
3528 (JSC::MarkedSpace::allocatorFor):
3529 (JSC::MarkedSpace::allocateStructure):
3530 (JSC):
3531 (JSC::MarkedSpace::forEachBlock):
3532 * runtime/Structure.h: Move all of the functions that call allocateCell<Structure> down below the explicit template specialization
3533 for allocateCell<Structure>. The new inline specialization for allocateCell directly calls the allocateStructure() function in the
3534 Heap.
3535 (Structure):
3536 (JSC::Structure):
3537 (JSC):
3538 (JSC::Structure::create):
3539 (JSC::Structure::createStructure):
3540
fpizlo@apple.com2b1d81e2012-07-26 23:01:05 +000035412012-07-26 Filip Pizlo <fpizlo@apple.com>
3542
3543 JSArray has methods that are neither used nor defined
3544 https://bugs.webkit.org/show_bug.cgi?id=92416
3545
3546 Reviewed by Simon Fraser.
3547
3548 * runtime/JSArray.h:
3549 (JSArray):
3550
zherczeg@webkit.org4a637582012-07-26 12:29:10 +000035512012-07-26 Zoltan Herczeg <zherczeg@webkit.org>
3552
3553 [Qt][ARM]ARMAssembler needs buildfix afert r123417
3554 https://bugs.webkit.org/show_bug.cgi?id=92086
3555
3556 Reviewed by Csaba Osztrogonác.
3557
3558 The ARM implementation of this should be optimized code path
3559 is covered by a non-optimized code path. This patch fixes this,
3560 and adds a new function which returns with the offset range.
3561
3562 * assembler/ARMAssembler.h:
3563 (JSC::ARMAssembler::readPointer):
3564 (ARMAssembler):
3565 (JSC::ARMAssembler::repatchInt32):
3566 (JSC::ARMAssembler::repatchCompact):
3567 * assembler/MacroAssemblerARM.h:
3568 (MacroAssemblerARM):
3569 (JSC::MacroAssemblerARM::isCompactPtrAlignedAddressOffset):
3570 (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
3571
mhahnenberg@apple.com9a75d6f2012-07-26 06:06:25 +000035722012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
3573
3574 Build fix for 32-bit after r123682
3575
3576 * runtime/JSObject.h: Need to pad out JSObjects on 32-bit so that they're the correct size since
3577 we only removed one 4-byte word and we need to be 8-byte aligned.
3578 (JSObject):
3579
fpizlo@apple.com338a70dc2012-07-26 01:22:59 +000035802012-07-25 Filip Pizlo <fpizlo@apple.com>
3581
3582 JSC GC object copying APIs should allow for greater flexibility
3583 https://bugs.webkit.org/show_bug.cgi?id=92316
3584
3585 Reviewed by Mark Hahnenberg.
3586
3587 It's now the case that visitChildren() methods can directly pin and allocate in new space during copying.
3588 They can also do the copying and marking themselves. This new API is only used for JSObjects for now.
3589
3590 * JavaScriptCore.xcodeproj/project.pbxproj:
3591 * heap/MarkStack.cpp:
3592 (JSC::SlotVisitor::allocateNewSpaceSlow):
3593 (JSC::SlotVisitor::allocateNewSpaceOrPin):
3594 (JSC):
3595 (JSC::SlotVisitor::copyAndAppend):
3596 * heap/MarkStack.h:
3597 (MarkStack):
3598 (JSC::MarkStack::appendUnbarrieredValue):
3599 (JSC):
3600 * heap/SlotVisitor.h:
3601 * heap/SlotVisitorInlineMethods.h: Added.
3602 (JSC):
3603 (JSC::SlotVisitor::checkIfShouldCopyAndPinOtherwise):
3604 (JSC::SlotVisitor::allocateNewSpace):
3605 * runtime/JSObject.cpp:
3606 (JSC::JSObject::visitOutOfLineStorage):
3607 (JSC):
3608 (JSC::JSObject::visitChildren):
3609 (JSC::JSFinalObject::visitChildren):
3610 * runtime/JSObject.h:
3611 (JSObject):
3612
mhahnenberg@apple.com0e8fce12012-07-26 00:12:58 +000036132012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
3614
3615 Remove JSObject::m_inheritorID
3616 https://bugs.webkit.org/show_bug.cgi?id=88378
3617
3618 Reviewed by Filip Pizlo.
3619
3620 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
3621 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
3622 Instead use a private named value in the object's property storage.
3623
3624 * dfg/DFGSpeculativeJIT.h:
3625 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
3626 * jit/JITInlineMethods.h:
3627 (JSC::JIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
3628 * llint/LowLevelInterpreter.asm: No need m_inheritorID to initialize!
3629 * runtime/JSGlobalData.h:
3630 (JSGlobalData): Added private name 'm_inheritorIDKey'.
3631 * runtime/JSGlobalThis.cpp:
3632 (JSC::JSGlobalThis::setUnwrappedObject): resetInheritorID is now passed a JSGlobalData&.
3633 * runtime/JSObject.cpp:
3634 (JSC::JSObject::visitChildren): No m_inheritorID to be marked.
3635 (JSC::JSFinalObject::visitChildren): No m_inheritorID to be marked.
3636 (JSC::JSObject::createInheritorID): Store the newly created inheritorID in the property map. Make sure
3637 it's got the DontEnum attribute!!
3638 * runtime/JSObject.h:
3639 (JSObject):
3640 (JSC::JSObject::resetInheritorID): Remove the inheritorID from property storage.
3641 (JSC):
3642 (JSC::JSObject::inheritorID): Read the inheritorID from property storage.
3643
caio.oliveira@openbossa.org947a2282012-07-25 22:15:05 +000036442012-07-25 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
3645
3646 Create a specialized pair for use in HashMap iterators
3647 https://bugs.webkit.org/show_bug.cgi?id=92137
3648
3649 Reviewed by Ryosuke Niwa.
3650
3651 Update a couple of sites that relied on the fact that "contents" of iterators were
3652 std::pairs.
3653
3654 * profiler/Profile.cpp:
3655 (JSC): This code kept a vector of the pairs that were the "contents" of the iterators. This
3656 is changed to use a KeyValuePair. We make use HashCount's ValueType (which represents only
3657 the key) to get the proper key parameter for KeyValuePair.
3658 * tools/ProfileTreeNode.h:
3659 (ProfileTreeNode): Use HashMap::ValueType to declare the type of the contents of the hash
3660 instead of declaring it manually. This will make use of the new KeyValuePair.
3661
paroga@webkit.orgcf6740e2012-07-25 07:42:03 +000036622012-07-25 Patrick Gansterer <paroga@webkit.org>
3663
3664 REGRESSION(r123505): Date.getYear() returns the same as Date.getFullYear()
3665 https://bugs.webkit.org/show_bug.cgi?id=92218
3666
3667 Reviewed by Csaba Osztrogonác.
3668
3669 * runtime/DatePrototype.cpp:
3670 (JSC::dateProtoFuncGetYear): Added the missing offset of 1900 to the return value.
3671
fpizlo@apple.coma7f7dcd2012-07-24 19:47:18 +000036722012-07-24 Filip Pizlo <fpizlo@apple.com>
3673
3674 REGRESSION(r123417): It made tests assert/crash on 32 bit
3675 https://bugs.webkit.org/show_bug.cgi?id=92088
3676
3677 Reviewed by Mark Hahnenberg.
3678
3679 The pointer arithmetic was wrong, because negative numbers are hard to think about.
3680
3681 * dfg/DFGRepatch.cpp:
3682 (JSC::DFG::emitPutTransitionStub):
3683 * dfg/DFGSpeculativeJIT.cpp:
3684 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3685
paroga@webkit.orgf2de22c2012-07-24 19:03:57 +000036862012-07-24 Patrick Gansterer <paroga@webkit.org>
3687
paroga@webkit.org683889f2012-07-24 19:25:30 +00003688 Store the full year in GregorianDateTime
3689 https://bugs.webkit.org/show_bug.cgi?id=92067
3690
3691 Reviewed by Geoffrey Garen.
3692
3693 Use the full year instead of the offset from year 1900
3694 for the year member variable of GregorianDateTime.
3695
3696 * runtime/DateConstructor.cpp:
3697 (JSC::constructDate):
3698 (JSC::dateUTC):
3699 * runtime/DateConversion.cpp:
3700 (JSC::formatDate):
3701 (JSC::formatDateUTCVariant):
3702 * runtime/DatePrototype.cpp:
3703 (JSC::formatLocaleDate):
3704 (JSC::fillStructuresUsingDateArgs):
3705 (JSC::dateProtoFuncToISOString):
3706 (JSC::dateProtoFuncGetFullYear):
3707 (JSC::dateProtoFuncGetUTCFullYear):
3708 (JSC::dateProtoFuncSetYear):
3709 * runtime/JSDateMath.cpp:
3710 (JSC::gregorianDateTimeToMS):
3711 (JSC::msToGregorianDateTime):
3712
37132012-07-24 Patrick Gansterer <paroga@webkit.org>
3714
paroga@webkit.orgf2de22c2012-07-24 19:03:57 +00003715 [WIN] Build fix after r123417.
3716
3717 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3718
paroga@webkit.org175d46f2012-07-24 05:19:55 +000037192012-07-23 Patrick Gansterer <paroga@webkit.org>
3720
3721 Move GregorianDateTime from JSC to WTF namespace
3722 https://bugs.webkit.org/show_bug.cgi?id=91948
3723
3724 Reviewed by Geoffrey Garen.
3725
3726 Moving GregorianDateTime into the WTF namespace allows us to us to
3727 use it in WebCore too. The new class has the same behaviour as the
3728 old struct. Only the unused timeZone member has been removed.
3729
3730 * runtime/DateConstructor.cpp:
3731 * runtime/DateConversion.cpp:
3732 * runtime/DateConversion.h:
3733 * runtime/DateInstance.h:
3734 * runtime/DatePrototype.cpp:
3735 * runtime/JSDateMath.cpp:
3736 * runtime/JSDateMath.h:
3737
fpizlo@apple.com94a9c102012-07-23 22:38:30 +000037382012-07-23 Filip Pizlo <fpizlo@apple.com>
3739
fpizlo@apple.com961a9562012-07-24 02:13:19 +00003740 Property storage should grow in reverse address direction, to support butterflies
3741 https://bugs.webkit.org/show_bug.cgi?id=91788
3742
3743 Reviewed by Geoffrey Garen.
3744
3745 Changes property storage to grow to the left, and changes the property storage pointer to point
3746 one 8-byte word (i.e. JSValue) to the right of the first value in the storage.
3747
3748 Also improved debug support somewhat, by adding a describe() function to the jsc command-line,
3749 and a slow mode of object access in LLInt.
3750
3751 * assembler/ARMv7Assembler.h:
3752 (JSC::ARMv7Assembler::repatchCompact):
3753 * assembler/MacroAssemblerARMv7.h:
3754 (MacroAssemblerARMv7):
3755 (JSC::MacroAssemblerARMv7::isCompactPtrAlignedAddressOffset):
3756 (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
3757 * assembler/MacroAssemblerX86Common.h:
3758 (JSC::MacroAssemblerX86Common::isCompactPtrAlignedAddressOffset):
3759 (JSC::MacroAssemblerX86Common::repatchCompact):
3760 * assembler/X86Assembler.h:
3761 (JSC::X86Assembler::repatchCompact):
3762 * bytecode/CodeBlock.cpp:
3763 (JSC::dumpStructure):
3764 * bytecode/GetByIdStatus.h:
3765 (JSC::GetByIdStatus::GetByIdStatus):
3766 * dfg/DFGOperations.cpp:
3767 * dfg/DFGOperations.h:
3768 * dfg/DFGRepatch.cpp:
3769 (JSC::DFG::tryCacheGetByID):
3770 (JSC::DFG::emitPutTransitionStub):
3771 * dfg/DFGSpeculativeJIT.cpp:
3772 (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
3773 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3774 * dfg/DFGSpeculativeJIT.h:
3775 (JSC::DFG::SpeculativeJIT::callOperation):
3776 * dfg/DFGSpeculativeJIT32_64.cpp:
3777 (JSC::DFG::SpeculativeJIT::compile):
3778 * dfg/DFGSpeculativeJIT64.cpp:
3779 (JSC::DFG::SpeculativeJIT::compile):
3780 * heap/ConservativeRoots.cpp:
3781 (JSC::ConservativeRoots::genericAddPointer):
3782 * heap/CopiedSpace.h:
3783 (CopiedSpace):
3784 * heap/CopiedSpaceInlineMethods.h:
3785 (JSC::CopiedSpace::pinIfNecessary):
3786 (JSC):
3787 * jit/JITPropertyAccess.cpp:
3788 (JSC::JIT::compileGetDirectOffset):
3789 * jit/JITPropertyAccess32_64.cpp:
3790 (JSC::JIT::compileGetDirectOffset):
3791 * jit/JITStubs.cpp:
3792 (JSC::JITThunks::tryCacheGetByID):
3793 * jsc.cpp:
3794 (GlobalObject::finishCreation):
3795 (functionDescribe):
3796 * llint/LLIntCommon.h:
3797 * llint/LLIntSlowPaths.cpp:
3798 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
3799 * llint/LowLevelInterpreter32_64.asm:
3800 * llint/LowLevelInterpreter64.asm:
3801 * runtime/JSObject.cpp:
3802 (JSC::JSObject::visitChildren):
3803 (JSC::JSFinalObject::visitChildren):
3804 (JSC::JSObject::growOutOfLineStorage):
3805 * runtime/JSObject.h:
3806 (JSC::JSObject::getDirectLocation):
3807 (JSC::JSObject::offsetForLocation):
3808 * runtime/JSValue.h:
3809 (JSValue):
3810 * runtime/PropertyOffset.h:
3811 (JSC::offsetInOutOfLineStorage):
3812
38132012-07-23 Filip Pizlo <fpizlo@apple.com>
3814
fpizlo@apple.com5128a712012-07-23 22:46:14 +00003815 DFG is too aggressive in performing the specific value optimization on loads
3816 https://bugs.webkit.org/show_bug.cgi?id=92034
3817
3818 Reviewed by Mark Hahnenberg.
3819
3820 This ensures that we don't do optimizations based on a structure having a specific
3821 value, if there is no way to detect that the value is despecified. This is the
3822 case for dictionaries, since despecifying a value in a dictionary does not lead to
3823 a transition and so cannot be caught by either structure checks or structure
3824 transition watchpoints.
3825
3826 * bytecode/GetByIdStatus.cpp:
3827 (JSC::GetByIdStatus::computeFromLLInt):
3828 (JSC::GetByIdStatus::computeForChain):
3829 (JSC::GetByIdStatus::computeFor):
3830 * bytecode/ResolveGlobalStatus.cpp:
3831 (JSC::computeForStructure):
3832
38332012-07-23 Filip Pizlo <fpizlo@apple.com>
3834
fpizlo@apple.com94a9c102012-07-23 22:38:30 +00003835 REGRESSION(r123169): It made fast/js/dfg-inline-arguments-use-from-uninlined-code.html fail on 32 bit platforms
3836 https://bugs.webkit.org/show_bug.cgi?id=92002
3837
3838 Reviewed by Mark Hahnenberg.
3839
3840 In the process of changing the nature of local variable typing, I forgot to modify one of the places where
3841 we glue the DFG's notion of variable prediction to the runtime's notion of variable tagging.
3842
3843 * dfg/DFGSpeculativeJIT.cpp:
3844 (JSC::DFG::SpeculativeJIT::compile):
3845
simon.fraser@apple.com8b810602012-07-23 21:03:45 +000038462012-07-23 Simon Fraser <simon.fraser@apple.com>
3847
3848 Part 2 of: Implement sticky positioning
3849 https://bugs.webkit.org/show_bug.cgi?id=90046
3850
3851 Reviewed by Ojan Vafai.
3852
3853 Turn on ENABLE_CSS_STICKY_POSITION.
3854
3855 * Configurations/FeatureDefines.xcconfig:
3856
paroga@webkit.orgf4635662012-07-23 20:53:35 +000038572012-07-23 Patrick Gansterer <paroga@webkit.org>
3858
3859 Move JSC::parseDate() from DateConversion to JSDateMath
3860 https://bugs.webkit.org/show_bug.cgi?id=91982
3861
3862 Reviewed by Geoffrey Garen.
3863
3864 Moveing this function into the other files removes the dependency
3865 on JSC spcific classes in DateConversion.{cpp|h}.
3866
3867 * runtime/DateConversion.cpp:
3868 * runtime/DateConversion.h:
3869 (JSC):
3870 * runtime/JSDateMath.cpp:
3871 (JSC::parseDate):
3872 (JSC):
3873 * runtime/JSDateMath.h:
3874 (JSC):
3875
simon.fraser@apple.com5cc8c732012-07-23 17:45:43 +000038762012-07-23 Simon Fraser <simon.fraser@apple.com>
3877
3878 Part 1 of: Implement sticky positioning
3879 https://bugs.webkit.org/show_bug.cgi?id=90046
3880
3881 Reviewed by Ojan Vafai.
3882
3883 Add ENABLE_CSS_STICKY_POSITION, defaulting to off initially.
3884
3885 Sort the ENABLE_CSS lines in the file. Make sure all the flags
3886 are in FEATURE_DEFINES.
3887
3888 * Configurations/FeatureDefines.xcconfig:
3889
commit-queue@webkit.org1f562642012-07-23 15:49:29 +000038902012-07-23 Yong Li <yoli@rim.com>
3891
3892 [BlackBerry] Implement GCActivityCallback with platform timer
3893 https://bugs.webkit.org/show_bug.cgi?id=90175
3894
3895 Reviewed by Rob Buis.
3896
3897 Use JSLock when performing GC to avoid assertions.
3898
3899 * runtime/GCActivityCallbackBlackBerry.cpp:
3900 (JSC::DefaultGCActivityCallback::doWork):
3901
tkent@chromium.orgd89d5452012-07-22 23:23:53 +000039022012-07-23 Kent Tamura <tkent@chromium.org>
3903
3904 Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
3905 https://bugs.webkit.org/show_bug.cgi?id=91941
3906
3907 Reviewed by Kentaro Hara.
3908
3909 A flag name for an elmement should be ENABLE_*_ELEMENT.
3910
3911 * Configurations/FeatureDefines.xcconfig:
3912
tkent@chromium.org43921e62012-07-22 10:59:32 +000039132012-07-22 Kent Tamura <tkent@chromium.org>
3914
3915 Rename ENABLE_DETAILS to ENABLE_DETAILS_ELEMENT
3916 https://bugs.webkit.org/show_bug.cgi?id=91928
3917
3918 Reviewed by Kentaro Hara.
3919
3920 A flag name for an elmement should be ENABLE_*_ELEMENT.
3921
3922 * Configurations/FeatureDefines.xcconfig:
3923
paroga@webkit.org6a026682012-07-21 21:22:28 +000039242012-07-21 Patrick Gansterer <paroga@webkit.org>
3925
3926 [WIN] Use GetDateFormat and GetTimeFormat instead of strftime
3927 https://bugs.webkit.org/show_bug.cgi?id=83436
3928
3929 Reviewed by Brent Fulgham.
3930
3931 The MS CRT implementation of strftime calls the same two functions.
3932 Using them directly avoids the overhead of parsing the format string and removes
3933 the dependency on strftime() for WinCE where this function does not exist.
3934
3935 * runtime/DatePrototype.cpp:
3936 (JSC::formatLocaleDate):
3937
tkent@chromium.org3d897372012-07-21 02:00:46 +000039382012-07-20 Kent Tamura <tkent@chromium.org>
3939
3940 Rename ENABLE_DATALIST to ENABLE_DATALIST_ELEMENT
3941 https://bugs.webkit.org/show_bug.cgi?id=91846
3942
3943 Reviewed by Kentaro Hara.
3944
3945 A flag name for an elmement should be ENABLE_*_ELEMENT.
3946
3947 * Configurations/FeatureDefines.xcconfig:
3948
commit-queue@webkit.org68c202c2012-07-20 20:09:02 +000039492012-07-20 Han Shen <shenhan@google.com>
3950
3951 [Chromium] Compilation fails under gcc 4.7
3952 https://bugs.webkit.org/show_bug.cgi?id=90227
3953
3954 Reviewed by Tony Chang.
3955
3956 Disable warnings about c++0x compatibility in gcc newer than 4.6.
3957
3958 * JavaScriptCore.gyp/JavaScriptCore.gyp:
3959
fpizlo@apple.com00528432012-07-20 03:50:02 +000039602012-07-18 Filip Pizlo <fpizlo@apple.com>
3961
3962 DFG cell checks should be hoisted
3963 https://bugs.webkit.org/show_bug.cgi?id=91717
3964
3965 Reviewed by Geoffrey Garen.
3966
3967 The DFG has always had the policy of hoisting array and integer checks to
3968 the point of variable assignment. Eventually, we added doubles and booleans
3969 to the mix. But cells should really be part of this as well, particularly
3970 for 32-bit where accessing a known-type variable is dramatically cheaper
3971 than accessing a variable whose types is only predicted but otherwise
3972 unproven.
3973
3974 This appears to be a definite speed-up for V8 on 32-bit, a possible speed-up
3975 for Kraken, and a possible slow-down for V8 on 64-bit (around 0.2% if at
3976 all). Any slow-downs can, and should, be addressed by making the hoisting
3977 logic cognizant of variables that are never used in a manner that requires
3978 type checks, and by sinking argument checks to the point(s) of first use.
3979
3980 To make this work I had to change some OSR machinery, and special-case the
3981 type predictions of the 'this' argument for constructors. OSR exit normally
3982 assumes that arguments are boxed, which happens to be true because the
3983 type prediction used for check hoisting is LUB'd with the type of the
3984 argument that was passed in - so either the arguments are always stored to
3985 with the full tag+payload, or if only the payload is stored then the tag
3986 matches whatever the caller would have set. But not so with the 'this'
3987 argument for constructors, which is not initialized by the caller. We
3988 could make this more precise by having argument types for OSR be inferred
3989 using similar machinery to other locals, but I figured that for this patch
3990 I should use the surgical fix.
3991
3992 * assembler/MacroAssemblerX86_64.h:
3993 (JSC::MacroAssemblerX86_64::branchTestPtr):
3994 (MacroAssemblerX86_64):
3995 * assembler/X86Assembler.h:
3996 (JSC::X86Assembler::testq_rm):
3997 (X86Assembler):
3998 * dfg/DFGAbstractState.cpp:
3999 (JSC::DFG::AbstractState::initialize):
4000 (JSC::DFG::AbstractState::execute):
4001 * dfg/DFGDriver.cpp:
4002 (JSC::DFG::compile):
4003 * dfg/DFGGraph.h:
4004 (JSC::DFG::Graph::isCreatedThisArgument):
4005 (Graph):
4006 * dfg/DFGSpeculativeJIT.cpp:
4007 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
4008 * dfg/DFGSpeculativeJIT32_64.cpp:
4009 (JSC::DFG::SpeculativeJIT::compile):
4010 * dfg/DFGSpeculativeJIT64.cpp:
4011 (JSC::DFG::SpeculativeJIT::compile):
4012 * dfg/DFGValueSource.h:
4013 (JSC::DFG::ValueSource::forSpeculation):
4014
fpizlo@apple.com26e27a62012-07-20 00:04:51 +000040152012-07-19 Filip Pizlo <fpizlo@apple.com>
4016
4017 Fast path of storage resize should be removed from property storage reallocation, since it is only useful for arrays
4018 https://bugs.webkit.org/show_bug.cgi?id=91796
4019
4020 Reviewed by Geoffrey Garen.
4021
4022 * dfg/DFGRepatch.cpp:
4023 (JSC::DFG::emitPutTransitionStub):
4024 * dfg/DFGSpeculativeJIT.cpp:
4025 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
4026 * runtime/JSObject.cpp:
4027 (JSC::JSObject::growOutOfLineStorage):
4028
commit-queue@webkit.orge602eca2012-07-19 20:53:22 +000040292012-07-19 Mark Lam <mark.lam@apple.com>
4030
4031 Bug fixes and enhancements for OfflineASM annotation system.
4032 https://bugs.webkit.org/show_bug.cgi?id=91690
4033
4034 Reviewed by Filip Pizlo.
4035
4036 * offlineasm/armv7.rb: added default handling of Instruction lower().
4037 * offlineasm/asm.rb: added more support for annotations and more pretty printing.
4038 * offlineasm/ast.rb: added more support for annotations.
4039 * offlineasm/config.rb: added $preferredCommentStartColumn, simplified $enableInstrAnnotations.
4040 * offlineasm/parser.rb: added more support for annotations.
4041 * offlineasm/transform.rb: added more support for annotations.
4042 * offlineasm/x86.rb: added default handling of Instruction lower().
4043
paroga@webkit.orgcb7c1a12012-07-19 18:20:53 +000040442012-07-19 Patrick Gansterer <paroga@webkit.org>
4045
4046 [WIN] Fix compilation of JSGlobalData.h with ENABLE(DFG_JIT)
4047 https://bugs.webkit.org/show_bug.cgi?id=91243
4048
4049 Reviewed by Geoffrey Garen.
4050
4051 Disable MSVC warning 4200 "zero-sized array in struct/union" for JSC::ScratchBuffer.
4052
4053 * runtime/JSGlobalData.h:
4054 (JSC):
4055
commit-queue@webkit.orgf06140e2012-07-19 15:45:26 +000040562012-07-19 Mark Lam <mark.lam@apple.com>
4057
4058 Fixed broken ENABLE_JIT=0 build.
4059 https://bugs.webkit.org/show_bug.cgi?id=91725
4060
4061 Reviewed by Oliver Hunt.
4062
4063 * bytecode/Watchpoint.cpp:
4064 * heap/JITStubRoutineSet.h:
4065 (JSC):
4066 (JITStubRoutineSet):
4067 (JSC::JITStubRoutineSet::JITStubRoutineSet):
4068 (JSC::JITStubRoutineSet::~JITStubRoutineSet):
4069 (JSC::JITStubRoutineSet::add):
4070 (JSC::JITStubRoutineSet::clearMarks):
4071 (JSC::JITStubRoutineSet::mark):
4072 (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
4073 (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
4074
kkristof@inf.u-szeged.hub203f612012-07-19 13:21:38 +000040752012-07-19 Kristóf Kosztyó <kkristof@inf.u-szeged.hu>
4076
4077 [Qt] Unreviewed buildfix after r123042.
4078
4079 * interpreter/Interpreter.cpp:
4080 (JSC::Interpreter::dumpRegisters):
4081
fpizlo@apple.com1ffdcff2012-07-19 00:30:34 +000040822012-07-18 Filip Pizlo <fpizlo@apple.com>
4083
4084 DFG should emit inline code for property storage (re)allocation
4085 https://bugs.webkit.org/show_bug.cgi?id=91597
4086
4087 Reviewed by Oliver Hunt.
4088
4089 This adds two new ops to the DFG IR: AllocatePropertyStorage and
4090 ReallocatePropertyStorage. It enables these to interact properly with
4091 CSE so that a GetPropertyStorage on something for which we have
4092 obviously done a (Re)AllocatePropertyStorage will result in the
4093 GetPropertyStorage being eliminated. Other than that, the code
4094 emitted for these ops is identical to the code we were emitting in
4095 the corresponding PutById stub.
4096
4097 * dfg/DFGAbstractState.cpp:
4098 (JSC::DFG::AbstractState::execute):
4099 * dfg/DFGByteCodeParser.cpp:
4100 (JSC::DFG::ByteCodeParser::parseBlock):
4101 * dfg/DFGCSEPhase.cpp:
4102 (JSC::DFG::CSEPhase::putStructureStoreElimination):
4103 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
4104 * dfg/DFGNode.h:
4105 (JSC::DFG::Node::hasStructureTransitionData):
4106 * dfg/DFGNodeType.h:
4107 (DFG):
4108 * dfg/DFGOperations.cpp:
4109 * dfg/DFGOperations.h:
4110 * dfg/DFGPredictionPropagationPhase.cpp:
4111 (JSC::DFG::PredictionPropagationPhase::propagate):
4112 * dfg/DFGSpeculativeJIT.cpp:
4113 (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
4114 (DFG):
4115 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
4116 * dfg/DFGSpeculativeJIT.h:
4117 (JSC::DFG::SpeculativeJIT::callOperation):
4118 (SpeculativeJIT):
4119 * dfg/DFGSpeculativeJIT32_64.cpp:
4120 (JSC::DFG::SpeculativeJIT::compile):
4121 * dfg/DFGSpeculativeJIT64.cpp:
4122 (JSC::DFG::SpeculativeJIT::compile):
4123 * runtime/Structure.cpp:
4124 (JSC::nextOutOfLineStorageCapacity):
4125 * runtime/Structure.h:
4126 (JSC):
4127
oliver@apple.coma08210b2012-07-18 23:26:06 +000041282012-07-16 Oliver Hunt <oliver@apple.com>
4129
4130 dumpCallFrame is broken in ToT
4131 https://bugs.webkit.org/show_bug.cgi?id=91444
4132
4133 Reviewed by Gavin Barraclough.
4134
4135 Various changes have been made to the SF calling convention, but
4136 dumpCallFrame has not been updated to reflect these changes.
4137 That resulted in both bogus information, as well as numerous
4138 assertions of sadness.
4139
4140 This patch makes dumpCallFrame actually work again and adds the
4141 wonderful feature of telling you the name of the variable that a
4142 register reflects, or what value it contains.
4143
4144 * bytecode/CodeBlock.cpp:
4145 (JSC::CodeBlock::nameForRegister):
4146 A really innefficient mechanism for finding the name of a local register.
4147 This should only ever be used by debug code so this should be okay.
4148 * bytecode/CodeBlock.h:
4149 (CodeBlock):
4150 * bytecompiler/BytecodeGenerator.cpp:
4151 (JSC::BytecodeGenerator::generate):
4152 Debug builds no longer throw away a functions symbol table, this allows
4153 us to actually perform a register# to name mapping
4154 * dfg/DFGJITCompiler.cpp:
4155 (JSC::DFG::JITCompiler::link):
4156 We weren't propogating the bytecode offset here leading to assertions
4157 in debug builds when dumping bytecode of DFG compiled code.
4158 * interpreter/Interpreter.cpp:
4159 (JSC):
4160 (JSC::Interpreter::dumpRegisters):
4161 Rework to actually be correct.
4162 (JSC::getCallerInfo):
4163 Return the byteocde offset as well now, given we have to determine it
4164 anyway.
4165 (JSC::Interpreter::getStackTrace):
4166 (JSC::Interpreter::retrieveCallerFromVMCode):
4167 * interpreter/Interpreter.h:
4168 (Interpreter):
4169 * jsc.cpp:
4170 (GlobalObject::finishCreation):
4171 (functionDumpCallFrame):
4172 Give debug builds of JSC a method for calling dumpCallFrame so we can
4173 inspect a callframe without requiring us to break in a debugger.
4174
fpizlo@apple.comc6429b82012-07-18 22:17:18 +000041752012-07-18 Filip Pizlo <fpizlo@apple.com>
4176
4177 DFG 32-bit PutById transition stub storage reallocation case copies the first pointer of each JSValue instead of the whole JSValue
4178 https://bugs.webkit.org/show_bug.cgi?id=91599
4179
4180 Reviewed by Geoffrey Garen.
4181
4182 * dfg/DFGRepatch.cpp:
4183 (JSC::DFG::emitPutTransitionStub):
4184
fpizlo@apple.com07669e22012-07-17 23:11:23 +000041852012-07-17 Filip Pizlo <fpizlo@apple.com>
4186
fpizlo@apple.com41c6f1e2012-07-18 04:42:55 +00004187 DFG 32-bit PutById transition stub passes the payload/tag arguments to a DFG operation in the wrong order
4188 https://bugs.webkit.org/show_bug.cgi?id=91576
4189
4190 Reviewed by Gavin Barraclough.
4191
4192 * dfg/DFGRepatch.cpp:
4193 (JSC::DFG::emitPutTransitionStub):
4194
41952012-07-17 Filip Pizlo <fpizlo@apple.com>
4196
fpizlo@apple.com07669e22012-07-17 23:11:23 +00004197 [Qt] REGRESSION(r122768, r122771): They broke jquery/data.html and inspector/elements/edit-dom-actions.html
4198 https://bugs.webkit.org/show_bug.cgi?id=91476
4199
4200 Reviewed by Mark Hahnenberg.
4201
4202 The 32-bit repatching code was not correctly adapted to the new world where there may not always
4203 be an available scratch register. Fixed it by ensuring that the scratch register we select does
4204 not overlap with the value tag.
4205
4206 * dfg/DFGRepatch.cpp:
4207 (JSC::DFG::generateProtoChainAccessStub):
4208 (JSC::DFG::tryCacheGetByID):
4209 (JSC::DFG::tryBuildGetByIDList):
4210 (JSC::DFG::emitPutReplaceStub):
4211
rgabor@webkit.org600a0c12012-07-17 07:59:57 +000042122012-07-17 Gabor Rapcsanyi <rgabor@webkit.org>
4213
4214 Unreviewed buildfix from Zoltan Herczeg after 122768.
4215
4216 * dfg/DFGCCallHelpers.h:
4217 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
4218 (CCallHelpers):
4219
commit-queue@webkit.org7bf73302012-07-17 07:11:52 +000042202012-07-17 David Barr <davidbarr@chromium.org>
4221
4222 Introduce ENABLE_CSS_IMAGE_ORIENTATION compile flag
4223 https://bugs.webkit.org/show_bug.cgi?id=89055
4224
4225 Reviewed by Kent Tamura.
4226
4227 The css3-images module is at candidate recommendation.
4228 http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation
4229
4230 Add a configuration option for CSS image-orientation support, disabling it by default.
4231
4232 * Configurations/FeatureDefines.xcconfig:
4233
fpizlo@apple.com68bef1d2012-07-17 01:43:56 +000042342012-07-16 Filip Pizlo <fpizlo@apple.com>
4235
4236 Unreviewed, roll out 122790 because it broke the Windows build. I'm not
4237 sure what to do with exported symbols that are predicated on NDEBUG.
4238
4239 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4240 * bytecode/CodeBlock.cpp:
4241 (JSC):
4242 * bytecode/CodeBlock.h:
4243 (CodeBlock):
4244 * bytecompiler/BytecodeGenerator.cpp:
4245 (JSC::BytecodeGenerator::generate):
4246 * dfg/DFGJITCompiler.cpp:
4247 (JSC::DFG::JITCompiler::link):
4248 * interpreter/Interpreter.cpp:
4249 (JSC):
4250 (JSC::Interpreter::dumpRegisters):
4251 (JSC::getCallerInfo):
4252 (JSC::Interpreter::getStackTrace):
4253 (JSC::Interpreter::retrieveCallerFromVMCode):
4254 * interpreter/Interpreter.h:
4255 (Interpreter):
4256 * jsc.cpp:
4257 (GlobalObject::finishCreation):
4258
oliver@apple.com0acb42b2012-07-17 01:14:18 +000042592012-07-16 Oliver Hunt <oliver@apple.com>
4260
4261 dumpCallFrame is broken in ToT
4262 https://bugs.webkit.org/show_bug.cgi?id=91444
4263
4264 Reviewed by Gavin Barraclough.
4265
4266 Various changes have been made to the SF calling convention, but
4267 dumpCallFrame has not been updated to reflect these changes.
4268 That resulted in both bogus information, as well as numerous
4269 assertions of sadness.
4270
4271 This patch makes dumpCallFrame actually work again and adds the
4272 wonderful feature of telling you the name of the variable that a
4273 register reflects, or what value it contains.
4274
4275 * bytecode/CodeBlock.cpp:
4276 (JSC::CodeBlock::nameForRegister):
4277 A really innefficient mechanism for finding the name of a local register.
4278 This should only ever be used by debug code so this should be okay.
4279 * bytecode/CodeBlock.h:
4280 (CodeBlock):
4281 * bytecompiler/BytecodeGenerator.cpp:
4282 (JSC::BytecodeGenerator::generate):
4283 Debug builds no longer throw away a functions symbol table, this allows
4284 us to actually perform a register# to name mapping
4285 * dfg/DFGJITCompiler.cpp:
4286 (JSC::DFG::JITCompiler::link):
4287 We weren't propogating the bytecode offset here leading to assertions
4288 in debug builds when dumping bytecode of DFG compiled code.
4289 * interpreter/Interpreter.cpp:
4290 (JSC):
4291 (JSC::Interpreter::dumpRegisters):
4292 Rework to actually be correct.
4293 (JSC::getCallerInfo):
4294 Return the byteocde offset as well now, given we have to determine it
4295 anyway.
4296 (JSC::Interpreter::getStackTrace):
4297 (JSC::Interpreter::retrieveCallerFromVMCode):
4298 * interpreter/Interpreter.h:
4299 (Interpreter):
4300 * jsc.cpp:
4301 (GlobalObject::finishCreation):
4302 (functionDumpCallFrame):
4303 Give debug builds of JSC a method for calling dumpCallFrame so we can
4304 inspect a callframe without requiring us to break in a debugger.
4305
fpizlo@apple.comcd8b6662012-07-16 22:17:29 +000043062012-07-16 Filip Pizlo <fpizlo@apple.com>
4307
4308 Unreviewed, adding forgotten files.
4309
4310 * dfg/DFGRegisterSet.h: Added.
4311 (DFG):
4312 (RegisterSet):
4313 (JSC::DFG::RegisterSet::RegisterSet):
4314 (JSC::DFG::RegisterSet::asPOD):
4315 (JSC::DFG::RegisterSet::copyInfo):
4316 (JSC::DFG::RegisterSet::set):
4317 (JSC::DFG::RegisterSet::setGPRByIndex):
4318 (JSC::DFG::RegisterSet::clear):
4319 (JSC::DFG::RegisterSet::get):
4320 (JSC::DFG::RegisterSet::getGPRByIndex):
4321 (JSC::DFG::RegisterSet::getFreeGPR):
4322 (JSC::DFG::RegisterSet::setFPRByIndex):
4323 (JSC::DFG::RegisterSet::getFPRByIndex):
4324 (JSC::DFG::RegisterSet::setByIndex):
4325 (JSC::DFG::RegisterSet::getByIndex):
4326 (JSC::DFG::RegisterSet::numberOfSetGPRs):
4327 (JSC::DFG::RegisterSet::numberOfSetFPRs):
4328 (JSC::DFG::RegisterSet::numberOfSetRegisters):
4329 (JSC::DFG::RegisterSet::setBit):
4330 (JSC::DFG::RegisterSet::clearBit):
4331 (JSC::DFG::RegisterSet::getBit):
4332 * dfg/DFGScratchRegisterAllocator.h: Added.
4333 (DFG):
4334 (ScratchRegisterAllocator):
4335 (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
4336 (JSC::DFG::ScratchRegisterAllocator::lock):
4337 (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
4338 (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
4339 (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
4340 (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
4341 (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
4342 (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
4343 (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
4344 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
4345 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
4346
fpizlo@apple.com2f2052a2012-07-16 22:08:21 +000043472012-07-15 Filip Pizlo <fpizlo@apple.com>
4348
4349 DFG PutById transition should handle storage allocation, and inline it
4350 https://bugs.webkit.org/show_bug.cgi?id=91337
4351
4352 Reviewed by Oliver Hunt.
4353
4354 This enables the patching of DFG PutById to handle the out-of-line storage
4355 allocation case. Furthermore, it inlines out-of-line storage allocation (and
4356 reallocation) into the generated stubs.
4357
4358 To do this, this patch adds the ability to store the relevant register
4359 allocation state (i.e. the set of in-use registers) in the structure stub
4360 info so that the stub generation code can more flexibly select scratch
4361 registers: sometimes it needs none, sometimes one - or sometimes up to
4362 three. Moreover, to make the stub generation register allocation simple and
4363 maintainable, this patch introduces a reusable scratch register allocator
4364 class. This register allocator understands that some registers are in use by
4365 the main path code and so must be spilled as necessary, other registers are
4366 locked for use in the stub itself and so cannot even be spilled, while still
4367 others may be allocated for scratch purposes. A scratch register that is
4368 used must be spilled. If a register is locked, it cannot be used as a
4369 scratch register. If a register is used, it can be used as a scratch
4370 register so long as it is spilled.
4371
4372 This is a sub-1% speed-up on V8 and neutral elsewhere.
4373
4374 * GNUmakefile.list.am:
4375 * JavaScriptCore.xcodeproj/project.pbxproj:
4376 * assembler/MacroAssemblerCodeRef.h:
4377 (FunctionPtr):
4378 (JSC::FunctionPtr::FunctionPtr):
4379 * bytecode/StructureStubInfo.h:
4380 * dfg/DFGCCallHelpers.h:
4381 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
4382 (CCallHelpers):
4383 * dfg/DFGGPRInfo.h:
4384 * dfg/DFGJITCompiler.cpp:
4385 (JSC::DFG::JITCompiler::link):
4386 * dfg/DFGJITCompiler.h:
4387 (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
4388 (PropertyAccessRecord):
4389 * dfg/DFGOperations.cpp:
4390 * dfg/DFGOperations.h:
4391 * dfg/DFGRegisterBank.h:
4392 (JSC::DFG::RegisterBank::isInUse):
4393 (RegisterBank):
4394 * dfg/DFGRegisterSet.h: Added.
4395 (DFG):
4396 (RegisterSet):
4397 (JSC::DFG::RegisterSet::RegisterSet):
4398 (JSC::DFG::RegisterSet::asPOD):
4399 (JSC::DFG::RegisterSet::copyInfo):
4400 (JSC::DFG::RegisterSet::set):
4401 (JSC::DFG::RegisterSet::setGPRByIndex):
4402 (JSC::DFG::RegisterSet::clear):
4403 (JSC::DFG::RegisterSet::get):
4404 (JSC::DFG::RegisterSet::getGPRByIndex):
4405 (JSC::DFG::RegisterSet::getFreeGPR):
4406 (JSC::DFG::RegisterSet::setFPRByIndex):
4407 (JSC::DFG::RegisterSet::getFPRByIndex):
4408 (JSC::DFG::RegisterSet::setByIndex):
4409 (JSC::DFG::RegisterSet::getByIndex):
4410 (JSC::DFG::RegisterSet::numberOfSetGPRs):
4411 (JSC::DFG::RegisterSet::numberOfSetFPRs):
4412 (JSC::DFG::RegisterSet::numberOfSetRegisters):
4413 (JSC::DFG::RegisterSet::setBit):
4414 (JSC::DFG::RegisterSet::clearBit):
4415 (JSC::DFG::RegisterSet::getBit):
4416 * dfg/DFGRepatch.cpp:
4417 (JSC::DFG::generateProtoChainAccessStub):
4418 (JSC::DFG::tryCacheGetByID):
4419 (JSC::DFG::tryBuildGetByIDList):
4420 (JSC::DFG::emitPutReplaceStub):
4421 (JSC::DFG::emitPutTransitionStub):
4422 (JSC::DFG::tryCachePutByID):
4423 (JSC::DFG::tryBuildPutByIdList):
4424 * dfg/DFGScratchRegisterAllocator.h: Added.
4425 (DFG):
4426 (ScratchRegisterAllocator):
4427 (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
4428 (JSC::DFG::ScratchRegisterAllocator::lock):
4429 (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
4430 (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
4431 (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
4432 (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
4433 (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
4434 (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
4435 (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
4436 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
4437 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
4438 * dfg/DFGSpeculativeJIT.h:
4439 (SpeculativeJIT):
4440 (JSC::DFG::SpeculativeJIT::usedRegisters):
4441 * dfg/DFGSpeculativeJIT32_64.cpp:
4442 (JSC::DFG::SpeculativeJIT::cachedGetById):
4443 (JSC::DFG::SpeculativeJIT::cachedPutById):
4444 (JSC::DFG::SpeculativeJIT::compile):
4445 * dfg/DFGSpeculativeJIT64.cpp:
4446 (JSC::DFG::SpeculativeJIT::cachedGetById):
4447 (JSC::DFG::SpeculativeJIT::cachedPutById):
4448 (JSC::DFG::SpeculativeJIT::compile):
4449 * heap/CopiedAllocator.h:
4450 (CopiedAllocator):
4451 (JSC::CopiedAllocator::fastPathShouldSucceed):
4452 (JSC):
4453
paroga@webkit.org24c86b82012-07-16 20:06:15 +000044542012-07-16 Patrick Gansterer <paroga@webkit.org>
4455
4456 Add dfg switch to create_jit_stubs script
4457 https://bugs.webkit.org/show_bug.cgi?id=91256
4458
4459 Reviewed by Geoffrey Garen.
4460
4461 * create_jit_stubs: Add a switch to enable or disable the generation of
4462 stub functions in #if ENABLE(DFG_JIT) conditions.
4463
rgabor@webkit.org58c69f82012-07-16 15:05:57 +000044642012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
4465
rgabor@webkit.org43ad3e52012-07-16 16:16:03 +00004466 Unreviewed buildfix after r122729. Typo fix.
4467
4468 * assembler/MacroAssemblerARM.h:
4469 (JSC::MacroAssemblerARM::add32):
4470
44712012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
4472
rgabor@webkit.org58c69f82012-07-16 15:05:57 +00004473 Unreviewed buildfix from Zoltan Herczeg after r122677.
4474 Implement missing add32 function to MacroAssemblerARM.
4475
4476 * assembler/MacroAssemblerARM.h:
4477 (JSC::MacroAssemblerARM::add32):
4478 (MacroAssemblerARM):
4479
fpizlo@apple.com327f2372012-07-15 04:02:16 +000044802012-07-14 Filip Pizlo <fpizlo@apple.com>
4481
fpizlo@apple.coma4eaa8a2012-07-15 05:23:58 +00004482 DFG PutByVal opcodes should accept more than 3 operands
4483 https://bugs.webkit.org/show_bug.cgi?id=91332
4484
4485 Reviewed by Oliver Hunt.
4486
4487 Turned PutByVal/PutByValAlias into var-arg nodes, so that we can give them
4488 4 or more operands in the future.
4489
4490 * dfg/DFGAbstractState.cpp:
4491 (JSC::DFG::AbstractState::execute):
4492 * dfg/DFGByteCodeParser.cpp:
4493 (JSC::DFG::ByteCodeParser::parseBlock):
4494 * dfg/DFGCSEPhase.cpp:
4495 (JSC::DFG::CSEPhase::getByValLoadElimination):
4496 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
4497 (JSC::DFG::CSEPhase::performNodeCSE):
4498 * dfg/DFGFixupPhase.cpp:
4499 (JSC::DFG::FixupPhase::fixupNode):
4500 (JSC::DFG::FixupPhase::fixDoubleEdge):
4501 * dfg/DFGGraph.h:
4502 (JSC::DFG::Graph::byValIsPure):
4503 (JSC::DFG::Graph::varArgNumChildren):
4504 (Graph):
4505 (JSC::DFG::Graph::numChildren):
4506 (JSC::DFG::Graph::varArgChild):
4507 (JSC::DFG::Graph::child):
4508 * dfg/DFGNodeType.h:
4509 (DFG):
4510 * dfg/DFGPredictionPropagationPhase.cpp:
4511 (JSC::DFG::PredictionPropagationPhase::propagate):
4512 * dfg/DFGSpeculativeJIT.cpp:
4513 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
4514 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
4515 * dfg/DFGSpeculativeJIT32_64.cpp:
4516 (JSC::DFG::SpeculativeJIT::compile):
4517 * dfg/DFGSpeculativeJIT64.cpp:
4518 (JSC::DFG::SpeculativeJIT::compile):
4519
45202012-07-14 Filip Pizlo <fpizlo@apple.com>
4521
fpizlo@apple.com327f2372012-07-15 04:02:16 +00004522 Rationalize and optimize storage allocation
4523 https://bugs.webkit.org/show_bug.cgi?id=91303
4524
4525 Reviewed by Oliver Hunt.
4526
4527 This implements a backwards bump allocator for copied space storage
4528 allocation, shown in pseudo-code below:
4529
4530 pointer bump(size) {
4531 pointer tmp = allocator->remaining;
4532 tmp -= size;
4533 if (tmp < 0)
4534 fail;
4535 allocator->remaining = tmp;
4536 return allocator->payloadEnd - tmp - size;
4537 }
4538
4539 The advantage of this allocator is that it:
4540
4541 - Only requires one comparison in the common case where size is known to
4542 not be huge, and this comparison can be done by checking the sign bit
4543 of the subtraction.
4544
4545 - Can be implemented even when only one register is available. This
4546 register is reused for both temporary storage during allocation and
4547 for the result.
4548
4549 - Preserves the behavior that memory in a block is filled in from lowest
4550 address to highest address, which allows for a cheap reallocation fast
4551 path.
4552
4553 - Is resilient against the block used for allocation being the last one
4554 in virtual memory, thereby otherwise leading to the risk of overflow
4555 in the bump pointer, despite only doing one branch.
4556
4557 In order to implement this allocator using the smallest possible chunk
4558 of code, I refactored the copied space code so that all of the allocation
4559 logic is in CopiedAllocator, and all of the state is in either
4560 CopiedBlock or CopiedAllocator. This should make changing the allocation
4561 fast path easier in the future.
4562
4563 In order to do this, I needed to add some new assembler support,
4564 particularly for various forms of add(address, register) and negPtr().
4565
4566 This is performance neutral. The purpose of this change is to facilitate
4567 further inlining of storage allocation without having to reserve
4568 additional registers or emit too much code.
4569
4570 * assembler/MacroAssembler.h:
4571 (JSC::MacroAssembler::addPtr):
4572 (MacroAssembler):
4573 (JSC::MacroAssembler::negPtr):
4574 * assembler/MacroAssemblerARMv7.h:
4575 (MacroAssemblerARMv7):
4576 (JSC::MacroAssemblerARMv7::add32):
4577 * assembler/MacroAssemblerX86.h:
4578 (JSC::MacroAssemblerX86::add32):
4579 (MacroAssemblerX86):
4580 * assembler/MacroAssemblerX86_64.h:
4581 (MacroAssemblerX86_64):
4582 (JSC::MacroAssemblerX86_64::addPtr):
4583 (JSC::MacroAssemblerX86_64::negPtr):
4584 * assembler/X86Assembler.h:
4585 (X86Assembler):
4586 (JSC::X86Assembler::addl_mr):
4587 (JSC::X86Assembler::addq_mr):
4588 (JSC::X86Assembler::negq_r):
4589 * heap/CopiedAllocator.h:
4590 (CopiedAllocator):
4591 (JSC::CopiedAllocator::isValid):
4592 (JSC::CopiedAllocator::CopiedAllocator):
4593 (JSC::CopiedAllocator::tryAllocate):
4594 (JSC):
4595 (JSC::CopiedAllocator::tryReallocate):
4596 (JSC::CopiedAllocator::forceAllocate):
4597 (JSC::CopiedAllocator::resetCurrentBlock):
4598 (JSC::CopiedAllocator::setCurrentBlock):
4599 (JSC::CopiedAllocator::currentCapacity):
4600 * heap/CopiedBlock.h:
4601 (CopiedBlock):
4602 (JSC::CopiedBlock::create):
4603 (JSC::CopiedBlock::zeroFillWilderness):
4604 (JSC::CopiedBlock::CopiedBlock):
4605 (JSC::CopiedBlock::payloadEnd):
4606 (JSC):
4607 (JSC::CopiedBlock::payloadCapacity):
4608 (JSC::CopiedBlock::data):
4609 (JSC::CopiedBlock::dataEnd):
4610 (JSC::CopiedBlock::dataSize):
4611 (JSC::CopiedBlock::wilderness):
4612 (JSC::CopiedBlock::wildernessEnd):
4613 (JSC::CopiedBlock::wildernessSize):
4614 (JSC::CopiedBlock::size):
4615 * heap/CopiedSpace.cpp:
4616 (JSC::CopiedSpace::tryAllocateSlowCase):
4617 (JSC::CopiedSpace::tryAllocateOversize):
4618 (JSC::CopiedSpace::tryReallocate):
4619 (JSC::CopiedSpace::doneFillingBlock):
4620 (JSC::CopiedSpace::doneCopying):
4621 * heap/CopiedSpace.h:
4622 (CopiedSpace):
4623 * heap/CopiedSpaceInlineMethods.h:
4624 (JSC::CopiedSpace::startedCopying):
4625 (JSC::CopiedSpace::allocateBlockForCopyingPhase):
4626 (JSC::CopiedSpace::allocateBlock):
4627 (JSC::CopiedSpace::tryAllocate):
4628 (JSC):
4629 * heap/MarkStack.cpp:
4630 (JSC::SlotVisitor::startCopying):
4631 (JSC::SlotVisitor::allocateNewSpace):
4632 (JSC::SlotVisitor::doneCopying):
4633 * heap/SlotVisitor.h:
4634 (JSC::SlotVisitor::SlotVisitor):
4635 * jit/JIT.h:
4636 * jit/JITInlineMethods.h:
4637 (JSC::JIT::emitAllocateBasicStorage):
4638 (JSC::JIT::emitAllocateJSArray):
4639
commit-queue@webkit.org782c20b2012-07-14 00:44:47 +000046402012-07-13 Mark Lam <mark.lam@apple.com>
4641
4642 OfflineASM Pretty printing and commenting enhancements.
4643 https://bugs.webkit.org/show_bug.cgi?id=91281
4644
4645 Reviewed by Filip Pizlo.
4646
4647 Added some minor pretty printing in the OfflineASM.
4648 Also added infrastruture for adding multiple types of comments and
4649 annotations with the ability to enable/disable them in the generated
4650 output as desired.
4651
4652 * GNUmakefile.list.am: add new file config.rb.
4653 * llint/LLIntOfflineAsmConfig.h:
4654 Added OFFLINE_ASM_BEGIN, OFFLINE_ASM_END, and OFFLINE_ASM_LOCAL_LABEL macros.
4655 This will allow us to redefine these for other backends later.
4656 * llint/LowLevelInterpreter32_64.asm:
4657 Add a small example of instruction annotations for now.
4658 * llint/LowLevelInterpreter64.asm:
4659 Add a small example of instruction annotations for now.
4660 * offlineasm/armv7.rb: Added handling of annotations.
4661 * offlineasm/asm.rb:
4662 Added machinery to dump the new comments and annotations.
4663 Also added some indentations to make the output a little prettier.
4664 * offlineasm/ast.rb: Added annotation field in class Instruction.
4665 * offlineasm/backends.rb:
4666 * offlineasm/config.rb: Added.
4667 Currently only contains commenting options. This file is meant to be
4668 a centralized place for build config values much like config.h for
4669 JavaScriptCore.
4670 * offlineasm/generate_offset_extractor.rb:
4671 * offlineasm/instructions.rb:
4672 * offlineasm/offsets.rb:
4673 * offlineasm/opt.rb:
4674 * offlineasm/parser.rb: Parse and record annotations.
4675 * offlineasm/registers.rb:
4676 * offlineasm/self_hash.rb:
4677 * offlineasm/settings.rb:
4678 * offlineasm/transform.rb:
4679 * offlineasm/x86.rb: Added handling of annotations.
4680
fpizlo@apple.com8ff7c5e72012-07-13 23:55:18 +000046812012-07-13 Filip Pizlo <fpizlo@apple.com>
4682
4683 ASSERTION FAILED: use.useKind() != DoubleUse
4684 https://bugs.webkit.org/show_bug.cgi?id=91082
4685
4686 Reviewed by Geoffrey Garen.
4687
4688 The implementation of Branch() was unwisely relying on register allocation state
4689 to decide what speculations to perform. That's never correct.
4690
4691 * dfg/DFGSpeculativeJIT32_64.cpp:
4692 (JSC::DFG::SpeculativeJIT::compile):
4693 * dfg/DFGSpeculativeJIT64.cpp:
4694 (JSC::DFG::SpeculativeJIT::compile):
4695
commit-queue@webkit.org2e002d12012-07-13 23:36:34 +000046962012-07-13 Sheriff Bot <webkit.review.bot@gmail.com>
4697
4698 Unreviewed, rolling out r122640.
4699 http://trac.webkit.org/changeset/122640
4700 https://bugs.webkit.org/show_bug.cgi?id=91298
4701
4702 LLInt apparently does not expect to mark these (Requested by
4703 olliej on #webkit).
4704
4705 * bytecode/CodeBlock.cpp:
4706 (JSC::CodeBlock::visitStructures):
4707 (JSC::CodeBlock::stronglyVisitStrongReferences):
4708
oliver@apple.comca095d52012-07-13 23:12:14 +000047092012-07-13 Oliver Hunt <oliver@apple.com>
4710
4711 LLInt fails to mark structures stored in the bytecode
4712 https://bugs.webkit.org/show_bug.cgi?id=91296
4713
4714 Reviewed by Geoffrey Garen.
4715
4716 LLInt stores structures in the bytecode, so we need to visit the appropriate
4717 instructions as we would if we were running in the classic interpreter.
4718 This requires adding additional checks for the LLInt specific opcodes, and
4719 the lint specific variants of operand ordering.
4720
4721 * bytecode/CodeBlock.cpp:
4722 (JSC::CodeBlock::visitStructures):
4723 (JSC::CodeBlock::stronglyVisitStrongReferences):
4724
commit-queue@webkit.orgf9b0ef22012-07-13 20:12:36 +000047252012-07-13 Yong Li <yoli@rim.com>
4726
4727 [BlackBerry] Implement GCActivityCallback with platform timer
4728 https://bugs.webkit.org/show_bug.cgi?id=90175
4729
4730 Reviewed by Rob Buis.
4731
4732 Implement GCActivityCallback and HeapTimer for BlackBerry port.
4733
4734 * heap/HeapTimer.cpp:
4735 (JSC):
4736 (JSC::HeapTimer::HeapTimer):
4737 (JSC::HeapTimer::~HeapTimer):
4738 (JSC::HeapTimer::timerDidFire):
4739 (JSC::HeapTimer::synchronize):
4740 (JSC::HeapTimer::invalidate):
4741 (JSC::HeapTimer::didStartVMShutdown):
4742 * heap/HeapTimer.h:
4743 (HeapTimer):
4744 * runtime/GCActivityCallbackBlackBerry.cpp:
4745 (JSC):
4746 (JSC::DefaultGCActivityCallback::doWork):
4747 (JSC::DefaultGCActivityCallback::didAllocate):
4748 (JSC::DefaultGCActivityCallback::willCollect):
4749 (JSC::DefaultGCActivityCallback::cancel):
4750
paroga@webkit.orgcc7dc5b2012-07-13 16:35:46 +000047512012-07-13 Patrick Gansterer <paroga@webkit.org>
4752
paroga@webkit.org4a3ecbd2012-07-13 16:53:20 +00004753 [WIN] Fix compilation of DFGRepatch.cpp
4754 https://bugs.webkit.org/show_bug.cgi?id=91241
4755
4756 Reviewed by Geoffrey Garen.
4757
4758 Use intptr_t instead of uintptr_t when calling CodeLocationCommon::dataLabelPtrAtOffset(int)
4759 to fix MSVC "unary minus operator applied to unsigned type, result still unsigned" warning.
4760
4761 * dfg/DFGRepatch.cpp:
4762 (JSC::DFG::dfgResetGetByID):
4763 (JSC::DFG::dfgResetPutByID):
4764
47652012-07-13 Patrick Gansterer <paroga@webkit.org>
4766
paroga@webkit.orgcc7dc5b2012-07-13 16:35:46 +00004767 Fix ARM_TRADITIONAL JIT for COMPILER(MSVC) and COMPILER(RVCT) after r121885
4768 https://bugs.webkit.org/show_bug.cgi?id=91238
4769
4770 Reviewed by Zoltan Herczeg.
4771
4772 r121885 changed the assembler instruction only for COMPILER(GCC).
4773 Use the same instructions for the other compilers too.
4774
4775 * jit/JITStubs.cpp:
4776 (JSC::ctiTrampoline):
4777 (JSC::ctiTrampolineEnd):
4778 (JSC::ctiVMThrowTrampoline):
4779
fpizlo@apple.comedcb7a92012-07-13 05:31:05 +000047802012-07-12 Filip Pizlo <fpizlo@apple.com>
4781
fpizlo@apple.comcf716122012-07-13 06:41:18 +00004782 DFG property access stubs should use structure transition watchpoints
4783 https://bugs.webkit.org/show_bug.cgi?id=91135
4784
4785 Reviewed by Geoffrey Garen.
4786
4787 This adds a Watchpoint subclass that will clear a structure stub (i.e.
4788 a property access stub) when fired. The DFG stub generation code now
4789 uses this optimization.
4790
4791 * CMakeLists.txt:
4792 * GNUmakefile.list.am:
4793 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4794 * JavaScriptCore.xcodeproj/project.pbxproj:
4795 * Target.pri:
4796 * bytecode/CodeBlock.cpp:
4797 (JSC):
4798 (JSC::CodeBlock::finalizeUnconditionally):
4799 (JSC::CodeBlock::resetStub):
4800 (JSC::CodeBlock::resetStubInternal):
4801 * bytecode/CodeBlock.h:
4802 (JSC):
4803 (CodeBlock):
4804 * bytecode/StructureStubClearingWatchpoint.cpp: Added.
4805 (JSC):
4806 (JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint):
4807 (JSC::StructureStubClearingWatchpoint::push):
4808 (JSC::StructureStubClearingWatchpoint::fireInternal):
4809 (JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo):
4810 (JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
4811 (JSC::WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint):
4812 * bytecode/StructureStubClearingWatchpoint.h: Added.
4813 (JSC):
4814 (StructureStubClearingWatchpoint):
4815 (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):
4816 (WatchpointsOnStructureStubInfo):
4817 (JSC::WatchpointsOnStructureStubInfo::WatchpointsOnStructureStubInfo):
4818 (JSC::WatchpointsOnStructureStubInfo::codeBlock):
4819 (JSC::WatchpointsOnStructureStubInfo::stubInfo):
4820 * bytecode/StructureStubInfo.h:
4821 (JSC::StructureStubInfo::reset):
4822 (JSC::StructureStubInfo::addWatchpoint):
4823 (StructureStubInfo):
4824 * dfg/DFGRepatch.cpp:
4825 (JSC::DFG::addStructureTransitionCheck):
4826 (DFG):
4827 (JSC::DFG::generateProtoChainAccessStub):
4828 (JSC::DFG::emitPutTransitionStub):
4829 * jit/JumpReplacementWatchpoint.h:
4830
48312012-07-12 Filip Pizlo <fpizlo@apple.com>
4832
fpizlo@apple.comedcb7a92012-07-13 05:31:05 +00004833 DFG CFA may get overzealous in loops that have code that must exit
4834 https://bugs.webkit.org/show_bug.cgi?id=91188
4835
4836 Reviewed by Gavin Barraclough.
4837
4838 Ensure that if the CFA assumes that an operation must exit, then it will always exit
4839 no matter what happens after. That's necessary to preserve soundness.
4840
4841 Remove a broken fixup done by the DFG simplifier, where it was trying to say that the
4842 variable-at-head was the first access in the second block in the merge, if the first
4843 block did not read the variable. That's totally wrong, if the first block was in fact
4844 doing a phantom read. I removed that fixup and instead hardened the rest of the
4845 compiler.
4846
4847 * dfg/DFGAbstractState.cpp:
4848 (JSC::DFG::AbstractState::endBasicBlock):
4849 * dfg/DFGBasicBlock.h:
4850 (JSC::DFG::BasicBlock::BasicBlock):
4851 (BasicBlock):
4852 * dfg/DFGCFAPhase.cpp:
4853 (JSC::DFG::CFAPhase::performBlockCFA):
4854 * dfg/DFGCFGSimplificationPhase.cpp:
4855 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
4856 * dfg/DFGConstantFoldingPhase.cpp:
4857 (JSC::DFG::ConstantFoldingPhase::ConstantFoldingPhase):
4858 (JSC::DFG::ConstantFoldingPhase::run):
4859 (ConstantFoldingPhase):
4860 (JSC::DFG::ConstantFoldingPhase::foldConstants):
4861 (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
4862 * dfg/DFGVariableEventStream.cpp:
4863 (JSC::DFG::VariableEventStream::reconstruct):
4864
allan.jensen@nokia.comb619bbf22012-07-12 15:34:35 +000048652012-07-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
4866
4867 [Qt] Implement MemoryUsageSupport
4868 https://bugs.webkit.org/show_bug.cgi?id=91094
4869
4870 Reviewed by Adam Barth.
4871
4872 Compile in MemoryStatistics so we can make use of the interface.
4873
4874 * Target.pri:
4875
ossy@webkit.org8db5d862012-07-12 07:53:08 +000048762012-07-12 Csaba Osztrogonác <ossy@webkit.org>
4877
4878 Remove dead code after r122392.
4879 https://bugs.webkit.org/show_bug.cgi?id=91049
4880
4881 Reviewed by Filip Pizlo.
4882
4883 * dfg/DFGSpeculativeJIT64.cpp:
4884 (JSC::DFG::SpeculativeJIT::emitCall):
4885
commit-queue@webkit.org55a950b2012-07-12 02:49:24 +000048862012-07-11 Adenilson Cavalcanti <cavalcantii@gmail.com>
4887
4888 Build fix + remove dead code
4889 https://bugs.webkit.org/show_bug.cgi?id=91039
4890
4891 Reviewed by Filip Pizlo.
4892
4893 An unused variable was breaking compilation (thanks to warnings being treated as errors).
4894
4895 * dfg/DFGSpeculativeJIT32_64.cpp:
4896 (JSC::DFG::SpeculativeJIT::emitCall):
4897
mrowe@apple.comc8887bf2012-07-12 02:01:25 +000048982012-07-11 Mark Rowe <mrowe@apple.com>
4899
4900 <http://webkit.org/b/91024> Build against the latest SDK when targeting older OS X versions.
4901
4902 Reviewed by Dan Bernstein.
4903
4904 The deployment target is already set to the version that we're targeting, and it's that setting
4905 which determines which functionality from the SDK is available to us.
4906
4907 * Configurations/Base.xcconfig:
4908
fpizlo@apple.com3d949152012-07-11 23:12:35 +000049092012-07-11 Filip Pizlo <fpizlo@apple.com>
4910
fpizlo@apple.com5e135772012-07-12 00:12:03 +00004911 DFG should have fast virtual calls
4912 https://bugs.webkit.org/show_bug.cgi?id=90924
4913
4914 Reviewed by Gavin Barraclough.
4915
4916 Implements virtual call support in the style of the old JIT, with the
4917 caveat that we still use the same slow path for both InternalFunction
4918 calls and JSFunction calls. Also rationalized the way that our
4919 CodeOrigin indices tie into exception checks (previously it was a
4920 strange one-to-one mapping with fairly limited assertions; now it's a
4921 one-to-many mapping for CodeOrigins to exception checks, respectively).
4922 I also took the opportunity to clean up
4923 CallLinkInfo::callReturnLocation, which previously was either a Call or
4924 a NearCall. Now it's just a NearCall. As well, exceptions during slow
4925 path call resolution are now handled by returning an exception throwing
4926 thunk rather than returning null. And finally, I made a few things
4927 public that were previously private-with-lots-of-friends, because I
4928 truly despise the thought of listing each thunk generating function as
4929 a friend of JSValue and friends.
4930
4931 * bytecode/CallLinkInfo.cpp:
4932 (JSC::CallLinkInfo::unlink):
4933 * bytecode/CallLinkInfo.h:
4934 (CallLinkInfo):
4935 * bytecode/CodeOrigin.h:
4936 (JSC::CodeOrigin::CodeOrigin):
4937 (JSC::CodeOrigin::isSet):
4938 * dfg/DFGAssemblyHelpers.h:
4939 (JSC::DFG::AssemblyHelpers::AssemblyHelpers):
4940 * dfg/DFGCCallHelpers.h:
4941 (JSC::DFG::CCallHelpers::CCallHelpers):
4942 * dfg/DFGGPRInfo.h:
4943 (GPRInfo):
4944 * dfg/DFGJITCompiler.cpp:
4945 (JSC::DFG::JITCompiler::link):
4946 (JSC::DFG::JITCompiler::compileFunction):
4947 * dfg/DFGJITCompiler.h:
4948 (JSC::DFG::CallBeginToken::CallBeginToken):
4949 (JSC::DFG::CallBeginToken::~CallBeginToken):
4950 (CallBeginToken):
4951 (JSC::DFG::CallBeginToken::set):
4952 (JSC::DFG::CallBeginToken::registerWithExceptionCheck):
4953 (JSC::DFG::CallBeginToken::codeOrigin):
4954 (JSC::DFG::CallExceptionRecord::CallExceptionRecord):
4955 (CallExceptionRecord):
4956 (JSC::DFG::JITCompiler::currentCodeOriginIndex):
4957 (JITCompiler):
4958 (JSC::DFG::JITCompiler::beginCall):
4959 (JSC::DFG::JITCompiler::notifyCall):
4960 (JSC::DFG::JITCompiler::prepareForExceptionCheck):
4961 (JSC::DFG::JITCompiler::addExceptionCheck):
4962 (JSC::DFG::JITCompiler::addFastExceptionCheck):
4963 * dfg/DFGOperations.cpp:
4964 * dfg/DFGRepatch.cpp:
4965 (JSC::DFG::dfgLinkFor):
4966 * dfg/DFGSpeculativeJIT.h:
4967 (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck):
4968 * dfg/DFGSpeculativeJIT32_64.cpp:
4969 (JSC::DFG::SpeculativeJIT::emitCall):
4970 * dfg/DFGSpeculativeJIT64.cpp:
4971 (JSC::DFG::SpeculativeJIT::emitCall):
4972 * dfg/DFGThunks.cpp:
4973 (JSC::DFG::emitPointerValidation):
4974 (DFG):
4975 (JSC::DFG::throwExceptionFromCallSlowPathGenerator):
4976 (JSC::DFG::slowPathFor):
4977 (JSC::DFG::linkForThunkGenerator):
4978 (JSC::DFG::linkCallThunkGenerator):
4979 (JSC::DFG::linkConstructThunkGenerator):
4980 (JSC::DFG::virtualForThunkGenerator):
4981 (JSC::DFG::virtualCallThunkGenerator):
4982 (JSC::DFG::virtualConstructThunkGenerator):
4983 * dfg/DFGThunks.h:
4984 (DFG):
4985 * jit/JIT.cpp:
4986 (JSC::JIT::privateCompile):
4987 (JSC::JIT::linkFor):
4988 * runtime/Executable.h:
4989 (ExecutableBase):
4990 (JSC::ExecutableBase::offsetOfJITCodeFor):
4991 (JSC::ExecutableBase::offsetOfNumParametersFor):
4992 * runtime/JSValue.h:
4993 (JSValue):
4994
49952012-07-11 Filip Pizlo <fpizlo@apple.com>
4996
fpizlo@apple.com3a264a12012-07-11 23:33:20 +00004997 Accidentally used the wrong license (3-clause instead of 2-clause) in some
4998 files I just committed.
4999
5000 Rubber stamped by Oliver Hunt.
5001
5002 * bytecode/Watchpoint.cpp:
5003 * bytecode/Watchpoint.h:
5004 * jit/JumpReplacementWatchpoint.cpp:
5005 * jit/JumpReplacementWatchpoint.h:
5006
50072012-07-11 Filip Pizlo <fpizlo@apple.com>
5008
fpizlo@apple.com3d949152012-07-11 23:12:35 +00005009 Watchpoints and jump replacement should be decoupled
5010 https://bugs.webkit.org/show_bug.cgi?id=91016
5011
5012 Reviewed by Oliver Hunt.
5013
5014 * CMakeLists.txt:
5015 * GNUmakefile.list.am:
5016 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5017 * JavaScriptCore.xcodeproj/project.pbxproj:
5018 * Target.pri:
5019 * assembler/AbstractMacroAssembler.h:
5020 (JSC):
5021 (Label):
5022 * bytecode/CodeBlock.h:
5023 (JSC::CodeBlock::appendWatchpoint):
5024 (JSC::CodeBlock::watchpoint):
5025 (DFGData):
5026 * bytecode/Watchpoint.cpp:
5027 (JSC):
5028 * bytecode/Watchpoint.h:
5029 (JSC::Watchpoint::Watchpoint):
5030 (Watchpoint):
5031 (JSC::Watchpoint::fire):
5032 * dfg/DFGSpeculativeJIT.h:
5033 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
5034 * jit/JumpReplacementWatchpoint.cpp: Added.
5035 (JSC):
5036 (JSC::JumpReplacementWatchpoint::correctLabels):
5037 (JSC::JumpReplacementWatchpoint::fireInternal):
5038 * jit/JumpReplacementWatchpoint.h: Added.
5039 (JSC):
5040 (JumpReplacementWatchpoint):
5041 (JSC::JumpReplacementWatchpoint::JumpReplacementWatchpoint):
5042 (JSC::JumpReplacementWatchpoint::setDestination):
5043
kevino@webkit.org2b81ef22012-07-11 20:23:39 +000050442012-07-11 Kevin Ollivier <kevino@theolliviers.com>
5045
5046 [wx] Unreviewed build fix. Don't try to build udis86_itab.c since it's included by
5047 another file.
5048
5049 * wscript:
5050
commit-queue@webkit.orgd847b5c2012-07-11 19:48:29 +000050512012-07-11 Chao-ying Fu <fu@mips.com>
5052
5053 Add MIPS convertibleLoadPtr and other functions
5054 https://bugs.webkit.org/show_bug.cgi?id=90714
5055
5056 Reviewed by Oliver Hunt.
5057
5058 * assembler/MIPSAssembler.h:
5059 (JSC::MIPSAssembler::labelIgnoringWatchpoints):
5060 (MIPSAssembler):
5061 (JSC::MIPSAssembler::replaceWithLoad):
5062 (JSC::MIPSAssembler::replaceWithAddressComputation):
5063 * assembler/MacroAssemblerMIPS.h:
5064 (JSC::MacroAssemblerMIPS::convertibleLoadPtr):
5065 (MacroAssemblerMIPS):
5066
andersca@apple.come73df4c2012-07-11 19:41:03 +000050672012-07-11 Anders Carlsson <andersca@apple.com>
5068
5069 Add -Wtautological-compare and -Wsign-compare warning flags
5070 https://bugs.webkit.org/show_bug.cgi?id=90994
5071
5072 Reviewed by Mark Rowe.
5073
5074 * Configurations/Base.xcconfig:
5075
benjamin@webkit.orgea8276a2012-07-11 18:15:17 +000050762012-07-11 Benjamin Poulain <bpoulain@apple.com>
5077
5078 Simplify the copying of JSC ARMv7's LinkRecord
5079 https://bugs.webkit.org/show_bug.cgi?id=90930
5080
5081 Reviewed by Filip Pizlo.
5082
5083 The class LinkRecord is used by value everywhere in ARMv7Assembler. The compiler uses
5084 memmove() to move the objects.
5085
5086 The problem is memmove() is overkill for this object, moving the value can be done with
5087 3 load-store. This patch adds an operator= to the class doing more efficient copying.
5088 This reduces the link time by 19%.
5089
5090 * assembler/ARMv7Assembler.h:
5091 (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
5092 (JSC::ARMv7Assembler::LinkRecord::operator=):
5093 (JSC::ARMv7Assembler::LinkRecord::from):
5094 (JSC::ARMv7Assembler::LinkRecord::setFrom):
5095 (JSC::ARMv7Assembler::LinkRecord::to):
5096 (JSC::ARMv7Assembler::LinkRecord::type):
5097 (JSC::ARMv7Assembler::LinkRecord::linkType):
5098 (JSC::ARMv7Assembler::LinkRecord::setLinkType):
5099 (JSC::ARMv7Assembler::LinkRecord::condition):
5100
wingo@igalia.com8d1d0d42012-07-11 17:50:15 +000051012012-07-11 Andy Wingo <wingo@igalia.com>
5102
5103 jsc: Parse options before creating global data
5104 https://bugs.webkit.org/show_bug.cgi?id=90975
5105
5106 Reviewed by Filip Pizlo.
5107
5108 This patch moves the options parsing in "jsc" before the creation
5109 of the JSGlobalData, so that --useJIT=no has a chance to take
5110 effect.
5111
5112 * jsc.cpp:
5113 (CommandLine::parseArguments): Refactor to be a class, and take
5114 argc and argv as constructor arguments.
5115 (jscmain): Move arg parsing before JSGlobalData creation.
5116
fpizlo@apple.com39c94a42012-07-10 09:18:47 +000051172012-07-10 Filip Pizlo <fpizlo@apple.com>
5118
ossy@webkit.orgb626a9e2012-07-10 09:36:13 +00005119 REGRESSION(r122166): It made 170 tests crash on 32 bit platforms
5120 https://bugs.webkit.org/show_bug.cgi?id=90852
5121
5122 Reviewed by Zoltan Herczeg.
5123
5124 If we can't use the range filter, we should still make sure that the
5125 address is remotely sane, otherwise the hashtables will assert.
5126
5127 * jit/JITStubRoutine.h:
5128 (JSC::JITStubRoutine::passesFilter):
5129
51302012-07-10 Filip Pizlo <fpizlo@apple.com>
5131
fpizlo@apple.com39c94a42012-07-10 09:18:47 +00005132 DFG recompilation heuristics should be based on count, not rate
5133 https://bugs.webkit.org/show_bug.cgi?id=90146
5134
5135 Reviewed by Oliver Hunt.
5136
5137 Rolling r121511 back in after fixing the DFG's interpretation of op_div
5138 profiling, with Gavin's rubber stamp.
5139
5140 This removes a bunch of code that was previously trying to prevent spurious
5141 reoptimizations if a large enough majority of executions of a code block did
5142 not result in OSR exit. It turns out that this code was purely harmful. This
5143 patch removes all of that logic and replaces it with a dead-simple
5144 heuristic: if you exit more than N times (where N is an exponential function
5145 of the number of times the code block has already been recompiled) then we
5146 will recompile.
5147
5148 This appears to be a broad ~1% win on many benchmarks large and small.
5149
5150 * bytecode/CodeBlock.cpp:
5151 (JSC::CodeBlock::CodeBlock):
5152 * bytecode/CodeBlock.h:
5153 (JSC::CodeBlock::couldTakeSpecialFastCase):
5154 (CodeBlock):
5155 (JSC::CodeBlock::osrExitCounter):
5156 (JSC::CodeBlock::countOSRExit):
5157 (JSC::CodeBlock::addressOfOSRExitCounter):
5158 (JSC::CodeBlock::offsetOfOSRExitCounter):
5159 (JSC::CodeBlock::adjustedExitCountThreshold):
5160 (JSC::CodeBlock::exitCountThresholdForReoptimization):
5161 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
5162 (JSC::CodeBlock::shouldReoptimizeNow):
5163 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
5164 * bytecode/ExecutionCounter.cpp:
5165 (JSC::ExecutionCounter::setThreshold):
5166 * bytecode/ExecutionCounter.h:
5167 (ExecutionCounter):
5168 (JSC::ExecutionCounter::clippedThreshold):
5169 * dfg/DFGByteCodeParser.cpp:
5170 (JSC::DFG::ByteCodeParser::makeDivSafe):
5171 * dfg/DFGJITCompiler.cpp:
5172 (JSC::DFG::JITCompiler::compileBody):
5173 * dfg/DFGOSRExit.cpp:
5174 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
5175 * dfg/DFGOSRExitCompiler.cpp:
5176 (JSC::DFG::OSRExitCompiler::handleExitCounts):
5177 * dfg/DFGOperations.cpp:
5178 * jit/JITStubs.cpp:
5179 (JSC::DEFINE_STUB_FUNCTION):
5180 * runtime/Options.h:
5181 (JSC):
5182
commit-queue@webkit.orge1bba8e2012-07-10 05:45:21 +000051832012-07-09 Matt Falkenhagen <falken@chromium.org>
5184
5185 Add ENABLE_DIALOG_ELEMENT and skeleton files
5186 https://bugs.webkit.org/show_bug.cgi?id=90521
5187
5188 Reviewed by Kent Tamura.
5189
5190 * Configurations/FeatureDefines.xcconfig:
5191
fpizlo@apple.com746b8c52012-07-09 23:26:54 +000051922012-07-09 Filip Pizlo <fpizlo@apple.com>
5193
fpizlo@apple.com629c1cd2012-07-10 01:50:44 +00005194 Unreviewed, roll out http://trac.webkit.org/changeset/121511
5195 It made in-browser V8v7 10% slower.
5196
5197 * bytecode/CodeBlock.cpp:
5198 (JSC::CodeBlock::CodeBlock):
5199 * bytecode/CodeBlock.h:
5200 (CodeBlock):
5201 (JSC::CodeBlock::countSpeculationSuccess):
5202 (JSC::CodeBlock::countSpeculationFailure):
5203 (JSC::CodeBlock::speculativeSuccessCounter):
5204 (JSC::CodeBlock::speculativeFailCounter):
5205 (JSC::CodeBlock::forcedOSRExitCounter):
5206 (JSC::CodeBlock::addressOfSpeculativeSuccessCounter):
5207 (JSC::CodeBlock::addressOfSpeculativeFailCounter):
5208 (JSC::CodeBlock::addressOfForcedOSRExitCounter):
5209 (JSC::CodeBlock::offsetOfSpeculativeSuccessCounter):
5210 (JSC::CodeBlock::offsetOfSpeculativeFailCounter):
5211 (JSC::CodeBlock::offsetOfForcedOSRExitCounter):
5212 (JSC::CodeBlock::largeFailCountThreshold):
5213 (JSC::CodeBlock::largeFailCountThresholdForLoop):
5214 (JSC::CodeBlock::shouldReoptimizeNow):
5215 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
5216 * bytecode/ExecutionCounter.cpp:
5217 (JSC::ExecutionCounter::setThreshold):
5218 * bytecode/ExecutionCounter.h:
5219 (ExecutionCounter):
5220 * dfg/DFGJITCompiler.cpp:
5221 (JSC::DFG::JITCompiler::compileBody):
5222 * dfg/DFGOSRExit.cpp:
5223 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
5224 * dfg/DFGOSRExitCompiler.cpp:
5225 (JSC::DFG::OSRExitCompiler::handleExitCounts):
5226 * dfg/DFGOperations.cpp:
5227 * jit/JITStubs.cpp:
5228 (JSC::DEFINE_STUB_FUNCTION):
5229 * runtime/Options.h:
5230 (JSC):
5231
52322012-07-09 Filip Pizlo <fpizlo@apple.com>
5233
fpizlo@apple.comcacd7dc2012-07-09 23:28:53 +00005234 DFG may get stuck in an infinite fix point if it constant folds a mispredicted node
5235 https://bugs.webkit.org/show_bug.cgi?id=90829
5236 <rdar://problem/11823843>
5237
5238 Reviewed by Oliver Hunt.
5239
5240 If a node is shown to have been mispredicted during CFA, then don't allow constant
5241 folding to make the graph even more degenerate. Instead, pull back on constant folding
5242 and allow the normal OSR machinery to fix our profiling so that a future recompilation
5243 doesn't see the same mistake.
5244
5245 * dfg/DFGAbstractState.cpp:
5246 (JSC::DFG::AbstractState::execute):
5247 * dfg/DFGAbstractState.h:
5248 (JSC::DFG::AbstractState::trySetConstant):
5249 (AbstractState):
5250 * dfg/DFGPhase.h:
5251 (JSC::DFG::Phase::name):
5252 (Phase):
5253 (JSC::DFG::runAndLog):
5254 (DFG):
5255 (JSC::DFG::runPhase):
5256
52572012-07-09 Filip Pizlo <fpizlo@apple.com>
5258
fpizlo@apple.com746b8c52012-07-09 23:26:54 +00005259 It should be possible to jettison JIT stub routines even if they are currently running
5260 https://bugs.webkit.org/show_bug.cgi?id=90731
5261
5262 Reviewed by Gavin Barraclough.
5263
5264 This gives the GC awareness of all JIT-generated stubs for inline caches. That
5265 means that if you want to delete a JIT-generated stub, you don't have to worry
5266 about whether or not it is currently running: if there is a chance that it might
5267 be, the GC will kindly defer deletion until non-running-ness is proved.
5268
5269 * CMakeLists.txt:
5270 * GNUmakefile.list.am:
5271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5272 * JavaScriptCore.xcodeproj/project.pbxproj:
5273 * Target.pri:
5274 * bytecode/Instruction.h:
5275 (JSC):
5276 (PolymorphicStubInfo):
5277 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
5278 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
5279 * bytecode/PolymorphicPutByIdList.cpp:
5280 (JSC::PutByIdAccess::fromStructureStubInfo):
5281 * bytecode/PolymorphicPutByIdList.h:
5282 (JSC::PutByIdAccess::transition):
5283 (JSC::PutByIdAccess::replace):
5284 (JSC::PutByIdAccess::stubRoutine):
5285 (PutByIdAccess):
5286 (JSC::PolymorphicPutByIdList::currentSlowPathTarget):
5287 * bytecode/StructureStubInfo.h:
5288 (JSC::StructureStubInfo::reset):
5289 * dfg/DFGRepatch.cpp:
5290 (JSC::DFG::generateProtoChainAccessStub):
5291 (JSC::DFG::tryCacheGetByID):
5292 (JSC::DFG::tryBuildGetByIDList):
5293 (JSC::DFG::tryBuildGetByIDProtoList):
5294 (JSC::DFG::emitPutReplaceStub):
5295 (JSC::DFG::emitPutTransitionStub):
5296 (JSC::DFG::tryCachePutByID):
5297 (JSC::DFG::tryBuildPutByIdList):
5298 * heap/ConservativeRoots.cpp:
5299 (JSC):
5300 (DummyMarkHook):
5301 (JSC::DummyMarkHook::mark):
5302 (JSC::ConservativeRoots::add):
5303 (CompositeMarkHook):
5304 (JSC::CompositeMarkHook::CompositeMarkHook):
5305 (JSC::CompositeMarkHook::mark):
5306 * heap/ConservativeRoots.h:
5307 (JSC):
5308 (ConservativeRoots):
5309 * heap/Heap.cpp:
5310 (JSC::Heap::markRoots):
5311 (JSC::Heap::deleteUnmarkedCompiledCode):
5312 * heap/Heap.h:
5313 (JSC):
5314 (Heap):
5315 * heap/JITStubRoutineSet.cpp: Added.
5316 (JSC):
5317 (JSC::JITStubRoutineSet::JITStubRoutineSet):
5318 (JSC::JITStubRoutineSet::~JITStubRoutineSet):
5319 (JSC::JITStubRoutineSet::add):
5320 (JSC::JITStubRoutineSet::clearMarks):
5321 (JSC::JITStubRoutineSet::markSlow):
5322 (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
5323 (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
5324 * heap/JITStubRoutineSet.h: Added.
5325 (JSC):
5326 (JITStubRoutineSet):
5327 (JSC::JITStubRoutineSet::mark):
5328 * heap/MachineStackMarker.h:
5329 (JSC):
5330 * interpreter/RegisterFile.cpp:
5331 (JSC::RegisterFile::gatherConservativeRoots):
5332 * interpreter/RegisterFile.h:
5333 (JSC):
5334 * jit/ExecutableAllocator.cpp:
5335 (JSC::DemandExecutableAllocator::DemandExecutableAllocator):
5336 * jit/ExecutableAllocator.h:
5337 (JSC):
5338 * jit/ExecutableAllocatorFixedVMPool.cpp:
5339 (JSC):
5340 (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
5341 * jit/GCAwareJITStubRoutine.cpp: Added.
5342 (JSC):
5343 (JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
5344 (JSC::GCAwareJITStubRoutine::~GCAwareJITStubRoutine):
5345 (JSC::GCAwareJITStubRoutine::observeZeroRefCount):
5346 (JSC::GCAwareJITStubRoutine::deleteFromGC):
5347 (JSC::GCAwareJITStubRoutine::markRequiredObjectsInternal):
5348 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::MarkingGCAwareJITStubRoutineWithOneObject):
5349 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::~MarkingGCAwareJITStubRoutineWithOneObject):
5350 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::markRequiredObjectsInternal):
5351 (JSC::createJITStubRoutine):
5352 * jit/GCAwareJITStubRoutine.h: Added.
5353 (JSC):
5354 (GCAwareJITStubRoutine):
5355 (JSC::GCAwareJITStubRoutine::markRequiredObjects):
5356 (MarkingGCAwareJITStubRoutineWithOneObject):
5357 * jit/JITPropertyAccess.cpp:
5358 (JSC::JIT::privateCompilePutByIdTransition):
5359 (JSC::JIT::privateCompilePatchGetArrayLength):
5360 (JSC::JIT::privateCompileGetByIdProto):
5361 (JSC::JIT::privateCompileGetByIdSelfList):
5362 (JSC::JIT::privateCompileGetByIdProtoList):
5363 (JSC::JIT::privateCompileGetByIdChainList):
5364 (JSC::JIT::privateCompileGetByIdChain):
5365 * jit/JITPropertyAccess32_64.cpp:
5366 (JSC::JIT::privateCompilePutByIdTransition):
5367 (JSC::JIT::privateCompilePatchGetArrayLength):
5368 (JSC::JIT::privateCompileGetByIdProto):
5369 (JSC::JIT::privateCompileGetByIdSelfList):
5370 (JSC::JIT::privateCompileGetByIdProtoList):
5371 (JSC::JIT::privateCompileGetByIdChainList):
5372 (JSC::JIT::privateCompileGetByIdChain):
5373 * jit/JITStubRoutine.cpp: Added.
5374 (JSC):
5375 (JSC::JITStubRoutine::~JITStubRoutine):
5376 (JSC::JITStubRoutine::observeZeroRefCount):
5377 * jit/JITStubRoutine.h: Added.
5378 (JSC):
5379 (JITStubRoutine):
5380 (JSC::JITStubRoutine::JITStubRoutine):
5381 (JSC::JITStubRoutine::createSelfManagedRoutine):
5382 (JSC::JITStubRoutine::code):
5383 (JSC::JITStubRoutine::asCodePtr):
5384 (JSC::JITStubRoutine::ref):
5385 (JSC::JITStubRoutine::deref):
5386 (JSC::JITStubRoutine::startAddress):
5387 (JSC::JITStubRoutine::endAddress):
5388 (JSC::JITStubRoutine::addressStep):
5389 (JSC::JITStubRoutine::canPerformRangeFilter):
5390 (JSC::JITStubRoutine::filteringStartAddress):
5391 (JSC::JITStubRoutine::filteringExtentSize):
5392 (JSC::JITStubRoutine::passesFilter):
5393 * jit/JITStubs.cpp:
5394 (JSC::DEFINE_STUB_FUNCTION):
5395 (JSC::getPolymorphicAccessStructureListSlot):
5396
commit-queue@webkit.orgfb3c9682012-07-09 15:39:09 +000053972012-07-09 Sheriff Bot <webkit.review.bot@gmail.com>
5398
5399 Unreviewed, rolling out r122107.
5400 http://trac.webkit.org/changeset/122107
5401 https://bugs.webkit.org/show_bug.cgi?id=90794
5402
5403 Build failure on Mac debug bots (Requested by falken_ on
5404 #webkit).
5405
5406 * Configurations/FeatureDefines.xcconfig:
5407
commit-queue@webkit.orgb46a45d2012-07-09 14:42:00 +000054082012-07-09 Matt Falkenhagen <falken@chromium.org>
5409
5410 Add ENABLE_DIALOG_ELEMENT and skeleton files
5411 https://bugs.webkit.org/show_bug.cgi?id=90521
5412
5413 Reviewed by Kent Tamura.
5414
5415 * Configurations/FeatureDefines.xcconfig:
5416
rniwa@webkit.orga5efe7e2012-07-09 06:19:54 +000054172012-07-08 Ryosuke Niwa <rniwa@webkit.org>
5418
5419 gcc build fix after r121925.
5420
5421 * runtime/JSObject.h:
5422 (JSC::JSFinalObject::finishCreation):
5423
zherczeg@webkit.orgadfdb1f2012-07-08 10:00:04 +000054242012-07-08 Zoltan Herczeg <zherczeg@webkit.org>
5425
5426 [Qt][ARM] Implementing missing macro assembler instructions after r121925
5427 https://bugs.webkit.org/show_bug.cgi?id=90657
5428
5429 Reviewed by Csaba Osztrogonác.
5430
5431 Implementing convertibleLoadPtr, replaceWithLoad and
5432 replaceWithAddressComputation.
5433
5434 * assembler/ARMAssembler.h:
5435 (JSC::ARMAssembler::replaceWithLoad):
5436 (ARMAssembler):
5437 (JSC::ARMAssembler::replaceWithAddressComputation):
5438 * assembler/MacroAssemblerARM.h:
5439 (JSC::MacroAssemblerARM::convertibleLoadPtr):
5440 (MacroAssemblerARM):
5441
fpizlo@apple.com18066da2012-07-07 00:43:21 +000054422012-07-06 Filip Pizlo <fpizlo@apple.com>
5443
5444 WebKit Version 5.1.7 (6534.57.2, r121935): Double-click no longer works on OpenStreetMap
5445 https://bugs.webkit.org/show_bug.cgi?id=90703
5446
5447 Reviewed by Michael Saboff.
5448
5449 It turns out that in my object model refactoring, I managed to fix get_by_pname in all
5450 execution engines except 64-bit baseline JIT.
5451
5452 * jit/JITPropertyAccess.cpp:
5453 (JSC::JIT::emit_op_get_by_pname):
5454
commit-queue@webkit.org650e3e62012-07-06 20:41:09 +000054552012-07-06 Pravin D <pravind.2k4@gmail.com>
5456
5457 Build Error on Qt Linux build
5458 https://bugs.webkit.org/show_bug.cgi?id=90699
5459
5460 Reviewed by Laszlo Gombos.
5461
5462 * parser/Parser.cpp:
5463 (JSC::::parseForStatement):
5464 Removed unused boolean variable as this was causing build error on Qt Linux.
5465
commit-queue@webkit.orgc182dfc2012-07-06 17:39:20 +000054662012-07-06 Nuno Lopes <nlopes@apple.com>
5467
5468 Fix build with recent clang.
5469 https://bugs.webkit.org/show_bug.cgi?id=90634
5470
5471 Reviewed by Oliver Hunt.
5472
5473 * jit/SpecializedThunkJIT.h:
5474 (JSC::SpecializedThunkJIT::SpecializedThunkJIT):
5475 (SpecializedThunkJIT):
5476 * jit/ThunkGenerators.cpp:
5477 (JSC::charCodeAtThunkGenerator):
5478 (JSC::charAtThunkGenerator):
5479 (JSC::fromCharCodeThunkGenerator):
5480 (JSC::sqrtThunkGenerator):
5481 (JSC::floorThunkGenerator):
5482 (JSC::ceilThunkGenerator):
5483 (JSC::roundThunkGenerator):
5484 (JSC::expThunkGenerator):
5485 (JSC::logThunkGenerator):
5486 (JSC::absThunkGenerator):
5487 (JSC::powThunkGenerator):
5488 * parser/ASTBuilder.h:
5489 (JSC::ASTBuilder::createAssignResolve):
5490 (JSC::ASTBuilder::createForLoop):
5491 (JSC::ASTBuilder::createForInLoop):
5492 (JSC::ASTBuilder::makeAssignNode):
5493 (JSC::ASTBuilder::makePrefixNode):
5494 (JSC::ASTBuilder::makePostfixNode):
5495 * parser/NodeConstructors.h:
5496 (JSC::PostfixErrorNode::PostfixErrorNode):
5497 (JSC::PrefixErrorNode::PrefixErrorNode):
5498 (JSC::AssignResolveNode::AssignResolveNode):
5499 (JSC::AssignErrorNode::AssignErrorNode):
5500 (JSC::ForNode::ForNode):
5501 (JSC::ForInNode::ForInNode):
5502 * parser/Nodes.h:
5503 (FunctionCallResolveNode):
5504 (PostfixErrorNode):
5505 (PrefixErrorNode):
5506 (ReadModifyResolveNode):
5507 (AssignResolveNode):
5508 (AssignErrorNode):
5509 (ForNode):
5510 (ForInNode):
5511 * parser/Parser.cpp:
5512 (JSC::::parseVarDeclarationList):
5513 (JSC::::parseForStatement):
5514 * parser/SyntaxChecker.h:
5515 (JSC::SyntaxChecker::createAssignResolve):
5516 (JSC::SyntaxChecker::createForLoop):
5517
zherczeg@webkit.orgb3b18db2012-07-06 08:42:29 +000055182012-07-06 Zoltan Herczeg <zherczeg@webkit.org>
5519
5520 [Qt][ARM] REGRESSION(r121885): It broke 30 jsc tests, 500+ layout tests
5521 https://bugs.webkit.org/show_bug.cgi?id=90656
5522
5523 Reviewed by Csaba Osztrogonác.
5524
5525 Typo fixes.
5526
5527 * assembler/MacroAssemblerARM.cpp:
5528 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
5529 Rename getOp2Byte() -> getOp2Half()
5530 * assembler/MacroAssemblerARMv7.h:
5531 (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
5532 Add a necessary space.
5533 * jit/JITStubs.cpp:
5534 (JSC):
5535 Revert INLINE_ARM_FUNCTION macro.
5536
fpizlo@apple.come26c6d22012-07-06 07:01:35 +000055372012-07-05 Filip Pizlo <fpizlo@apple.com>
5538
5539 REGRESSION(r121925): It broke 5 sputnik tests on x86 platforms
5540 https://bugs.webkit.org/show_bug.cgi?id=90658
5541
5542 Reviewed by Zoltan Herczeg.
5543
5544 Under the new object model, out-of-line property accesses such as those
5545 in ResolveGlobal must account for the fact that the offset to the Kth
5546 property is represented by K + inlineStorageCapacity. Hence, the property
5547 loads in ResolveGlobal must have an additional -inlineStorageCapacity *
5548 sizeof(JSValue) offset.
5549
5550 * dfg/DFGSpeculativeJIT32_64.cpp:
5551 (JSC::DFG::SpeculativeJIT::compile):
5552
ossy@webkit.orgc5b75fd2012-07-06 04:52:26 +000055532012-07-05 Csaba Osztrogonác <ossy@webkit.org>
5554
5555 [Qt] Unreviewed 64 bit buildfix after r121925.
5556
5557 * bytecode/PutByIdStatus.cpp:
5558 (JSC::PutByIdStatus::computeFromLLInt):
5559
msaboff@apple.comb1b64c72012-07-06 00:04:05 +000055602012-07-05 Michael Saboff <msaboff@apple.com>
5561
5562 JSString::tryHashConstLock() fails to get exclusive lock
5563 https://bugs.webkit.org/show_bug.cgi?id=90639
5564
5565 Reviewed by Oliver Hunt.
5566
5567 Added check that the string is already locked even before compare and swap.
5568
5569 * heap/MarkStack.cpp:
5570 (JSC::JSString::tryHashConstLock):
5571
fpizlo@apple.comd68b1f82012-07-05 22:55:51 +000055722012-07-04 Filip Pizlo <fpizlo@apple.com>
5573
5574 Inline property storage should not be wasted when it is exhausted
5575 https://bugs.webkit.org/show_bug.cgi?id=90347
5576
5577 Reviewed by Gavin Barraclough.
5578
5579 Previously, if we switched an object from using inline storage to out-of-line
5580 storage, we would abandon the inline storage. This would have two main implications:
5581 (i) all accesses to the object, even for properties that were previously in inline
5582 storage, must now take an extra indirection; and (ii) we waste a non-trivial amount
5583 of space since we must allocate additional out-of-line storage to hold properties
5584 that would have fit in the inline storage. There's also the copying cost when
5585 switching to out-of-line storage - we must copy all inline properties into ouf-of-line
5586 storage.
5587
5588 This patch changes the way that object property storage works so that we can use both
5589 inline and out-of-line storage concurrently. This is accomplished by introducing a
5590 new notion of property offset. This PropertyOffset is a 32-bit signed integer and it
5591 behaves as follows:
5592
5593 offset == -1: invalid offset, indicating a property that does not exist.
5594
5595 0 <= offset <= inlineStorageCapacity: offset into inline storage.
5596
5597 inlineStorageCapacity < offset: offset into out-of-line storage.
5598
5599 Because non-final objects don't have inline storage, the only valid PropertyOffsets
5600 for those objects' properties are -1 or > inlineStorageCapacity.
5601
5602 This now means that the decision to use inline or out-of-line storage for an access is
5603 made based on the offset, rather than the structure. It also means that any access
5604 where the offset is a variable must have an extra branch, unless the type of the
5605 object is also known (if it's known to be a non-final object then we can just assert
5606 that the offset is >= inlineStorageCapacity).
5607
5608 This looks like a big Kraken speed-up and a slight V8 speed-up.
5609
5610 * GNUmakefile.list.am:
5611 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5612 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5613 * JavaScriptCore.xcodeproj/project.pbxproj:
5614 * assembler/ARMv7Assembler.h:
5615 (ARMv7Assembler):
5616 (JSC::ARMv7Assembler::ldrWide8BitImmediate):
5617 (JSC::ARMv7Assembler::replaceWithLoad):
5618 (JSC::ARMv7Assembler::replaceWithAddressComputation):
5619 * assembler/AbstractMacroAssembler.h:
5620 (AbstractMacroAssembler):
5621 (ConvertibleLoadLabel):
5622 (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::ConvertibleLoadLabel):
5623 (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::isSet):
5624 (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
5625 (JSC::AbstractMacroAssembler::replaceWithLoad):
5626 (JSC::AbstractMacroAssembler::replaceWithAddressComputation):
5627 * assembler/CodeLocation.h:
5628 (JSC):
5629 (CodeLocationCommon):
5630 (CodeLocationConvertibleLoad):
5631 (JSC::CodeLocationConvertibleLoad::CodeLocationConvertibleLoad):
5632 (JSC::CodeLocationCommon::convertibleLoadAtOffset):
5633 * assembler/LinkBuffer.cpp:
5634 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
5635 * assembler/LinkBuffer.h:
5636 (LinkBuffer):
5637 (JSC::LinkBuffer::locationOf):
5638 * assembler/MacroAssemblerARMv7.h:
5639 (MacroAssemblerARMv7):
5640 (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
5641 * assembler/MacroAssemblerX86.h:
5642 (JSC::MacroAssemblerX86::convertibleLoadPtr):
5643 (MacroAssemblerX86):
5644 * assembler/MacroAssemblerX86_64.h:
5645 (JSC::MacroAssemblerX86_64::convertibleLoadPtr):
5646 (MacroAssemblerX86_64):
5647 * assembler/RepatchBuffer.h:
5648 (RepatchBuffer):
5649 (JSC::RepatchBuffer::replaceWithLoad):
5650 (JSC::RepatchBuffer::replaceWithAddressComputation):
5651 (JSC::RepatchBuffer::setLoadInstructionIsActive):
5652 * assembler/X86Assembler.h:
5653 (JSC::X86Assembler::replaceWithLoad):
5654 (X86Assembler):
5655 (JSC::X86Assembler::replaceWithAddressComputation):
5656 * bytecode/CodeBlock.cpp:
5657 (JSC::CodeBlock::printGetByIdOp):
5658 (JSC::CodeBlock::dump):
5659 (JSC::CodeBlock::finalizeUnconditionally):
5660 * bytecode/GetByIdStatus.cpp:
5661 (JSC::GetByIdStatus::computeFromLLInt):
5662 (JSC::GetByIdStatus::computeForChain):
5663 (JSC::GetByIdStatus::computeFor):
5664 * bytecode/GetByIdStatus.h:
5665 (JSC::GetByIdStatus::GetByIdStatus):
5666 (JSC::GetByIdStatus::offset):
5667 (GetByIdStatus):
5668 * bytecode/Opcode.h:
5669 (JSC):
5670 (JSC::padOpcodeName):
5671 * bytecode/PutByIdStatus.cpp:
5672 (JSC::PutByIdStatus::computeFromLLInt):
5673 (JSC::PutByIdStatus::computeFor):
5674 * bytecode/PutByIdStatus.h:
5675 (JSC::PutByIdStatus::PutByIdStatus):
5676 (JSC::PutByIdStatus::offset):
5677 (PutByIdStatus):
5678 * bytecode/ResolveGlobalStatus.cpp:
5679 (JSC):
5680 (JSC::computeForStructure):
5681 * bytecode/ResolveGlobalStatus.h:
5682 (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
5683 (JSC::ResolveGlobalStatus::offset):
5684 (ResolveGlobalStatus):
5685 * bytecode/StructureSet.h:
5686 (StructureSet):
5687 * bytecode/StructureStubInfo.h:
5688 * dfg/DFGByteCodeParser.cpp:
5689 (ByteCodeParser):
5690 (JSC::DFG::ByteCodeParser::handleGetByOffset):
5691 (JSC::DFG::ByteCodeParser::handleGetById):
5692 (JSC::DFG::ByteCodeParser::parseBlock):
5693 * dfg/DFGCapabilities.h:
5694 (JSC::DFG::canCompileOpcode):
5695 * dfg/DFGJITCompiler.cpp:
5696 (JSC::DFG::JITCompiler::link):
5697 * dfg/DFGJITCompiler.h:
5698 (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
5699 (PropertyAccessRecord):
5700 * dfg/DFGRepatch.cpp:
5701 (JSC::DFG::dfgRepatchByIdSelfAccess):
5702 (JSC::DFG::generateProtoChainAccessStub):
5703 (JSC::DFG::tryCacheGetByID):
5704 (JSC::DFG::tryBuildGetByIDList):
5705 (JSC::DFG::tryBuildGetByIDProtoList):
5706 (JSC::DFG::emitPutReplaceStub):
5707 (JSC::DFG::emitPutTransitionStub):
5708 (JSC::DFG::tryCachePutByID):
5709 (JSC::DFG::tryBuildPutByIdList):
5710 * dfg/DFGSpeculativeJIT.h:
5711 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
5712 * dfg/DFGSpeculativeJIT32_64.cpp:
5713 (JSC::DFG::SpeculativeJIT::cachedGetById):
5714 (JSC::DFG::SpeculativeJIT::cachedPutById):
5715 (JSC::DFG::SpeculativeJIT::compile):
5716 * dfg/DFGSpeculativeJIT64.cpp:
5717 (JSC::DFG::SpeculativeJIT::cachedGetById):
5718 (JSC::DFG::SpeculativeJIT::cachedPutById):
5719 (JSC::DFG::SpeculativeJIT::compile):
5720 * heap/MarkStack.cpp:
5721 (JSC::visitChildren):
5722 * interpreter/Interpreter.cpp:
5723 (JSC::Interpreter::tryCacheGetByID):
5724 (JSC::Interpreter::privateExecute):
5725 * jit/JIT.cpp:
5726 (JSC::JIT::privateCompileMainPass):
5727 (JSC::JIT::privateCompileSlowCases):
5728 (JSC::PropertyStubCompilationInfo::copyToStubInfo):
5729 * jit/JIT.h:
5730 (JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
5731 (JSC::JIT::compileGetByIdProto):
5732 (JSC::JIT::compileGetByIdSelfList):
5733 (JSC::JIT::compileGetByIdProtoList):
5734 (JSC::JIT::compileGetByIdChainList):
5735 (JSC::JIT::compileGetByIdChain):
5736 (JSC::JIT::compilePutByIdTransition):
5737 (JIT):
5738 * jit/JITInlineMethods.h:
5739 (JSC::JIT::emitAllocateBasicJSObject):
5740 * jit/JITOpcodes.cpp:
5741 (JSC::JIT::emit_op_resolve_global):
5742 * jit/JITOpcodes32_64.cpp:
5743 (JSC::JIT::emit_op_resolve_global):
5744 * jit/JITPropertyAccess.cpp:
5745 (JSC::JIT::compileGetDirectOffset):
5746 (JSC::JIT::emit_op_method_check):
5747 (JSC::JIT::compileGetByIdHotPath):
5748 (JSC::JIT::emit_op_put_by_id):
5749 (JSC::JIT::compilePutDirectOffset):
5750 (JSC::JIT::privateCompilePutByIdTransition):
5751 (JSC::JIT::patchGetByIdSelf):
5752 (JSC::JIT::patchPutByIdReplace):
5753 (JSC::JIT::privateCompileGetByIdProto):
5754 (JSC::JIT::privateCompileGetByIdSelfList):
5755 (JSC::JIT::privateCompileGetByIdProtoList):
5756 (JSC::JIT::privateCompileGetByIdChainList):
5757 (JSC::JIT::privateCompileGetByIdChain):
5758 * jit/JITPropertyAccess32_64.cpp:
5759 (JSC::JIT::emit_op_method_check):
5760 (JSC::JIT::compileGetByIdHotPath):
5761 (JSC::JIT::emit_op_put_by_id):
5762 (JSC::JIT::compilePutDirectOffset):
5763 (JSC::JIT::compileGetDirectOffset):
5764 (JSC::JIT::privateCompilePutByIdTransition):
5765 (JSC::JIT::patchGetByIdSelf):
5766 (JSC::JIT::patchPutByIdReplace):
5767 (JSC::JIT::privateCompileGetByIdProto):
5768 (JSC::JIT::privateCompileGetByIdSelfList):
5769 (JSC::JIT::privateCompileGetByIdProtoList):
5770 (JSC::JIT::privateCompileGetByIdChainList):
5771 (JSC::JIT::privateCompileGetByIdChain):
5772 (JSC::JIT::emit_op_get_by_pname):
5773 * jit/JITStubs.cpp:
5774 (JSC::JITThunks::tryCacheGetByID):
5775 (JSC::DEFINE_STUB_FUNCTION):
5776 * llint/LLIntSlowPaths.cpp:
5777 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
5778 * llint/LowLevelInterpreter.asm:
5779 * llint/LowLevelInterpreter32_64.asm:
5780 * llint/LowLevelInterpreter64.asm:
5781 * offlineasm/x86.rb:
5782 * runtime/JSGlobalObject.h:
5783 (JSGlobalObject):
5784 (JSC::JSGlobalObject::functionNameOffset):
5785 * runtime/JSObject.cpp:
5786 (JSC::JSObject::visitChildren):
5787 (JSC):
5788 (JSC::JSFinalObject::visitChildren):
5789 (JSC::JSObject::put):
5790 (JSC::JSObject::deleteProperty):
5791 (JSC::JSObject::getPropertySpecificValue):
5792 (JSC::JSObject::removeDirect):
5793 (JSC::JSObject::growOutOfLineStorage):
5794 (JSC::JSObject::getOwnPropertyDescriptor):
5795 * runtime/JSObject.h:
5796 (JSObject):
5797 (JSC::JSObject::getDirect):
5798 (JSC::JSObject::getDirectLocation):
5799 (JSC::JSObject::hasInlineStorage):
5800 (JSC::JSObject::inlineStorageUnsafe):
5801 (JSC::JSObject::inlineStorage):
5802 (JSC::JSObject::outOfLineStorage):
5803 (JSC::JSObject::locationForOffset):
5804 (JSC::JSObject::offsetForLocation):
5805 (JSC::JSObject::getDirectOffset):
5806 (JSC::JSObject::putDirectOffset):
5807 (JSC::JSObject::putUndefinedAtDirectOffset):
5808 (JSC::JSObject::addressOfOutOfLineStorage):
5809 (JSC::JSObject::finishCreation):
5810 (JSC::JSNonFinalObject::JSNonFinalObject):
5811 (JSC::JSNonFinalObject::finishCreation):
5812 (JSFinalObject):
5813 (JSC::JSFinalObject::finishCreation):
5814 (JSC::JSFinalObject::JSFinalObject):
5815 (JSC::JSObject::offsetOfOutOfLineStorage):
5816 (JSC::JSObject::setOutOfLineStorage):
5817 (JSC::JSObject::JSObject):
5818 (JSC):
5819 (JSC::JSCell::fastGetOwnProperty):
5820 (JSC::JSObject::putDirectInternal):
5821 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
5822 (JSC::JSObject::putDirectWithoutTransition):
5823 (JSC::offsetRelativeToPatchedStorage):
5824 (JSC::indexRelativeToBase):
5825 (JSC::offsetRelativeToBase):
5826 * runtime/JSPropertyNameIterator.cpp:
5827 (JSC::JSPropertyNameIterator::create):
5828 * runtime/JSPropertyNameIterator.h:
5829 (JSPropertyNameIterator):
5830 (JSC::JSPropertyNameIterator::getOffset):
5831 (JSC::JSPropertyNameIterator::finishCreation):
5832 * runtime/JSValue.cpp:
5833 (JSC::JSValue::putToPrimitive):
5834 * runtime/Operations.h:
5835 (JSC::normalizePrototypeChain):
5836 * runtime/Options.cpp:
5837 (JSC):
5838 (JSC::Options::initialize):
5839 * runtime/PropertyMapHashTable.h:
5840 (PropertyMapEntry):
5841 (JSC::PropertyMapEntry::PropertyMapEntry):
5842 (PropertyTable):
5843 (JSC::PropertyTable::PropertyTable):
5844 (JSC::PropertyTable::getDeletedOffset):
5845 (JSC::PropertyTable::addDeletedOffset):
5846 (JSC::PropertyTable::nextOffset):
5847 (JSC):
5848 (JSC::PropertyTable::sizeInMemory):
5849 * runtime/PropertyOffset.h: Added.
5850 (JSC):
5851 (JSC::checkOffset):
5852 (JSC::validateOffset):
5853 (JSC::isValidOffset):
5854 (JSC::isInlineOffset):
5855 (JSC::isOutOfLineOffset):
5856 (JSC::offsetInInlineStorage):
5857 (JSC::offsetInOutOfLineStorage):
5858 (JSC::offsetInRespectiveStorage):
5859 (JSC::numberOfOutOfLineSlotsForLastOffset):
5860 (JSC::numberOfSlotsForLastOffset):
5861 (JSC::nextPropertyOffsetFor):
5862 (JSC::firstPropertyOffsetFor):
5863 * runtime/PropertySlot.h:
5864 (JSC::PropertySlot::cachedOffset):
5865 (JSC::PropertySlot::setValue):
5866 (JSC::PropertySlot::setCacheableGetterSlot):
5867 (JSC::PropertySlot::clearOffset):
5868 * runtime/PutPropertySlot.h:
5869 (JSC::PutPropertySlot::setExistingProperty):
5870 (JSC::PutPropertySlot::setNewProperty):
5871 (JSC::PutPropertySlot::cachedOffset):
5872 (PutPropertySlot):
5873 * runtime/Structure.cpp:
5874 (JSC::Structure::Structure):
5875 (JSC::Structure::materializePropertyMap):
5876 (JSC::nextOutOfLineStorageCapacity):
5877 (JSC::Structure::growOutOfLineCapacity):
5878 (JSC::Structure::suggestedNewOutOfLineStorageCapacity):
5879 (JSC::Structure::addPropertyTransitionToExistingStructure):
5880 (JSC::Structure::addPropertyTransition):
5881 (JSC::Structure::removePropertyTransition):
5882 (JSC::Structure::flattenDictionaryStructure):
5883 (JSC::Structure::addPropertyWithoutTransition):
5884 (JSC::Structure::removePropertyWithoutTransition):
5885 (JSC::Structure::copyPropertyTableForPinning):
5886 (JSC::Structure::get):
5887 (JSC::Structure::putSpecificValue):
5888 (JSC::Structure::remove):
5889 * runtime/Structure.h:
5890 (Structure):
5891 (JSC::Structure::putWillGrowOutOfLineStorage):
5892 (JSC::Structure::previousID):
5893 (JSC::Structure::outOfLineCapacity):
5894 (JSC::Structure::outOfLineSizeForKnownFinalObject):
5895 (JSC::Structure::outOfLineSizeForKnownNonFinalObject):
5896 (JSC::Structure::outOfLineSize):
5897 (JSC::Structure::hasInlineStorage):
5898 (JSC::Structure::inlineCapacity):
5899 (JSC::Structure::inlineSizeForKnownFinalObject):
5900 (JSC::Structure::inlineSize):
5901 (JSC::Structure::totalStorageSize):
5902 (JSC::Structure::totalStorageCapacity):
5903 (JSC::Structure::firstValidOffset):
5904 (JSC::Structure::lastValidOffset):
5905 (JSC::Structure::isValidOffset):
5906 (JSC::Structure::isEmpty):
5907 (JSC::Structure::transitionCount):
5908 (JSC::Structure::get):
5909
oliver@apple.com5635b542012-07-05 20:36:37 +000059102012-07-05 Oliver Hunt <oliver@apple.com>
5911
5912 JSObjectCallAsFunction should thisConvert the provided thisObject
5913 https://bugs.webkit.org/show_bug.cgi?id=90628
5914
5915 Reviewed by Gavin Barraclough.
5916
5917 Perform this conversion on the provided this object.
5918
5919 * API/JSObjectRef.cpp:
5920 (JSObjectCallAsFunction):
5921
zherczeg@webkit.orgd6e661f2012-07-05 07:04:16 +000059222012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
5923
zherczeg@webkit.orgda8c37d2012-07-05 07:53:51 +00005924 [Qt] Unreviewed buildfix after r121886. Typo fix.
5925
5926 * assembler/MacroAssemblerARM.cpp:
5927 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
5928
59292012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
5930
zherczeg@webkit.orgd6e661f2012-07-05 07:04:16 +00005931 Port DFG JIT to traditional ARM
5932 https://bugs.webkit.org/show_bug.cgi?id=90198
5933
5934 Reviewed by Filip Pizlo.
5935
5936 This patch contains the macro assembler part of the
5937 DFG JIT support on ARM systems with fixed 32 bit instruction
5938 width. A large amount of old code was refactored, and the ARMv4
5939 or lower support is removed from the macro assembler.
5940
5941 Sunspider is improved by 8%, and V8 is 92%.
5942
5943 * assembler/ARMAssembler.cpp:
5944 (JSC::ARMAssembler::dataTransfer32):
5945 (JSC::ARMAssembler::baseIndexTransfer32):
5946 (JSC):
5947 (JSC::ARMAssembler::dataTransfer16):
5948 (JSC::ARMAssembler::baseIndexTransfer16):
5949 (JSC::ARMAssembler::dataTransferFloat):
5950 (JSC::ARMAssembler::baseIndexTransferFloat):
5951 (JSC::ARMAssembler::executableCopy):
5952 * assembler/ARMAssembler.h:
5953 (JSC::ARMAssembler::ARMAssembler):
5954 (JSC::ARMAssembler::emitInst):
5955 (JSC::ARMAssembler::vmov_f64_r):
5956 (ARMAssembler):
5957 (JSC::ARMAssembler::vabs_f64_r):
5958 (JSC::ARMAssembler::vneg_f64_r):
5959 (JSC::ARMAssembler::ldr_imm):
5960 (JSC::ARMAssembler::ldr_un_imm):
5961 (JSC::ARMAssembler::dtr_u):
5962 (JSC::ARMAssembler::dtr_ur):
5963 (JSC::ARMAssembler::dtr_d):
5964 (JSC::ARMAssembler::dtr_dr):
5965 (JSC::ARMAssembler::dtrh_u):
5966 (JSC::ARMAssembler::dtrh_ur):
5967 (JSC::ARMAssembler::dtrh_d):
5968 (JSC::ARMAssembler::dtrh_dr):
5969 (JSC::ARMAssembler::fdtr_u):
5970 (JSC::ARMAssembler::fdtr_d):
5971 (JSC::ARMAssembler::push_r):
5972 (JSC::ARMAssembler::pop_r):
5973 (JSC::ARMAssembler::poke_r):
5974 (JSC::ARMAssembler::peek_r):
5975 (JSC::ARMAssembler::vmov_vfp64_r):
5976 (JSC::ARMAssembler::vmov_arm64_r):
5977 (JSC::ARMAssembler::vmov_vfp32_r):
5978 (JSC::ARMAssembler::vmov_arm32_r):
5979 (JSC::ARMAssembler::vcvt_u32_f64_r):
5980 (JSC::ARMAssembler::vcvt_f64_f32_r):
5981 (JSC::ARMAssembler::vcvt_f32_f64_r):
5982 (JSC::ARMAssembler::clz_r):
5983 (JSC::ARMAssembler::bkpt):
5984 (JSC::ARMAssembler::bx):
5985 (JSC::ARMAssembler::blx):
5986 (JSC::ARMAssembler::labelIgnoringWatchpoints):
5987 (JSC::ARMAssembler::labelForWatchpoint):
5988 (JSC::ARMAssembler::label):
5989 (JSC::ARMAssembler::getLdrImmAddress):
5990 (JSC::ARMAssembler::replaceWithJump):
5991 (JSC::ARMAssembler::maxJumpReplacementSize):
5992 (JSC::ARMAssembler::getOp2Byte):
5993 (JSC::ARMAssembler::getOp2Half):
5994 (JSC::ARMAssembler::RM):
5995 (JSC::ARMAssembler::RS):
5996 (JSC::ARMAssembler::RD):
5997 (JSC::ARMAssembler::RN):
5998 * assembler/AssemblerBufferWithConstantPool.h:
5999 (JSC::AssemblerBufferWithConstantPool::ensureSpaceForAnyInstruction):
6000 * assembler/MacroAssemblerARM.cpp:
6001 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
6002 * assembler/MacroAssemblerARM.h:
6003 (JSC::MacroAssemblerARM::add32):
6004 (MacroAssemblerARM):
6005 (JSC::MacroAssemblerARM::and32):
6006 (JSC::MacroAssemblerARM::lshift32):
6007 (JSC::MacroAssemblerARM::mul32):
6008 (JSC::MacroAssemblerARM::neg32):
6009 (JSC::MacroAssemblerARM::rshift32):
6010 (JSC::MacroAssemblerARM::urshift32):
6011 (JSC::MacroAssemblerARM::xor32):
6012 (JSC::MacroAssemblerARM::load8):
6013 (JSC::MacroAssemblerARM::load8Signed):
6014 (JSC::MacroAssemblerARM::load16):
6015 (JSC::MacroAssemblerARM::load16Signed):
6016 (JSC::MacroAssemblerARM::load32):
6017 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
6018 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
6019 (JSC::MacroAssemblerARM::store8):
6020 (JSC::MacroAssemblerARM::store16):
6021 (JSC::MacroAssemblerARM::store32):
6022 (JSC::MacroAssemblerARM::move):
6023 (JSC::MacroAssemblerARM::jump):
6024 (JSC::MacroAssemblerARM::branchAdd32):
6025 (JSC::MacroAssemblerARM::mull32):
6026 (JSC::MacroAssemblerARM::branchMul32):
6027 (JSC::MacroAssemblerARM::nearCall):
6028 (JSC::MacroAssemblerARM::compare32):
6029 (JSC::MacroAssemblerARM::test32):
6030 (JSC::MacroAssemblerARM::sub32):
6031 (JSC::MacroAssemblerARM::call):
6032 (JSC::MacroAssemblerARM::loadFloat):
6033 (JSC::MacroAssemblerARM::loadDouble):
6034 (JSC::MacroAssemblerARM::storeFloat):
6035 (JSC::MacroAssemblerARM::storeDouble):
6036 (JSC::MacroAssemblerARM::moveDouble):
6037 (JSC::MacroAssemblerARM::addDouble):
6038 (JSC::MacroAssemblerARM::divDouble):
6039 (JSC::MacroAssemblerARM::subDouble):
6040 (JSC::MacroAssemblerARM::mulDouble):
6041 (JSC::MacroAssemblerARM::absDouble):
6042 (JSC::MacroAssemblerARM::negateDouble):
6043 (JSC::MacroAssemblerARM::convertInt32ToDouble):
6044 (JSC::MacroAssemblerARM::convertFloatToDouble):
6045 (JSC::MacroAssemblerARM::convertDoubleToFloat):
6046 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
6047 (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
6048 (JSC::MacroAssemblerARM::truncateDoubleToInt32):
6049 (JSC::MacroAssemblerARM::truncateDoubleToUint32):
6050 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
6051 (JSC::MacroAssemblerARM::branchDoubleNonZero):
6052 (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
6053 (JSC::MacroAssemblerARM::invert):
6054 (JSC::MacroAssemblerARM::replaceWithJump):
6055 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
6056 (JSC::MacroAssemblerARM::call32):
6057 * assembler/SH4Assembler.h:
6058 (JSC::SH4Assembler::label):
6059 * dfg/DFGAssemblyHelpers.h:
6060 (JSC::DFG::AssemblyHelpers::debugCall):
6061 (JSC::DFG::AssemblyHelpers::boxDouble):
6062 (JSC::DFG::AssemblyHelpers::unboxDouble):
6063 * dfg/DFGCCallHelpers.h:
6064 (CCallHelpers):
6065 (JSC::DFG::CCallHelpers::setupArguments):
6066 * dfg/DFGFPRInfo.h:
6067 (DFG):
6068 * dfg/DFGGPRInfo.h:
6069 (DFG):
6070 (GPRInfo):
6071 * dfg/DFGOperations.cpp:
6072 (JSC):
6073 * dfg/DFGSpeculativeJIT.h:
6074 (SpeculativeJIT):
6075 (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult):
6076 (JSC::DFG::SpeculativeJIT::appendCallSetResult):
6077 * jit/JITStubs.cpp:
6078 (JSC):
6079 * jit/JITStubs.h:
6080 (JITStackFrame):
6081 * jit/JSInterfaceJIT.h:
6082 (JSInterfaceJIT):
6083
commit-queue@webkit.orgd106bf22012-07-04 21:36:52 +000060842012-07-04 Anthony Scian <ascian@rim.com>
6085
6086 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
6087 https://bugs.webkit.org/show_bug.cgi?id=40118
6088
6089 Reviewed by Yong Li.
6090
6091 Added member functions to expose function name, urlString, and line #.
6092 Refactored toString to make use of these member functions to reduce
6093 duplicated code for future maintenance.
6094
6095 Manually tested refactoring of toString by tracing thrown exceptions.
6096
6097 * interpreter/Interpreter.h:
6098 (JSC::StackFrame::toString):
6099 (JSC::StackFrame::friendlySourceURL):
6100 (JSC::StackFrame::friendlyFunctionName):
6101 (JSC::StackFrame::friendlyLineNumber):
6102
wingo@igalia.com17649d82012-07-04 20:32:26 +000061032012-07-04 Andy Wingo <wingo@igalia.com>
6104
6105 [GTK] Enable parallel GC
6106 https://bugs.webkit.org/show_bug.cgi?id=90568
6107
6108 Reviewed by Martin Robinson.
6109
6110 * runtime/Options.cpp: Include <algorithm.h> for std::min.
6111
commit-queue@webkit.org1fcb31a2012-07-04 16:16:01 +000061122012-07-04 John Mellor <johnme@chromium.org>
6113
6114 Text Autosizing: Add compile flag and runtime setting
6115 https://bugs.webkit.org/show_bug.cgi?id=87394
6116
6117 This patch renames Font Boosting to Text Autosizing.
6118
6119 Reviewed by Adam Barth.
6120
6121 * Configurations/FeatureDefines.xcconfig:
6122
msaboff@apple.comd08f3502012-07-03 22:57:00 +000061232012-07-03 Michael Saboff <msaboff@apple.com>
6124
6125 Enh: Hash Const JSString in Backing Stores to Save Memory
6126 https://bugs.webkit.org/show_bug.cgi?id=86024
6127
6128 Reviewed by Oliver Hunt.
6129
6130 During garbage collection, each marking thread keeps a HashMap of
6131 strings. While visiting via MarkStack::copyAndAppend(), we check to
6132 see if the string we are visiting is already in the HashMap. If not
6133 we add it. If so, we change the reference to the current string we're
6134 visiting to the prior string.
6135
6136 To reduce the performance impact of this change, two throttles have
6137 ben added. 1) We only try hash consting if a significant number of new
6138 strings have been created since the last hash const. Currently this is
6139 set at 100 strings. 2) If a string is unique at the end of a marking
6140 it will not be checked during further GC phases. In some cases this
6141 won't catch all duplicates, but we are trying to catch the growth of
6142 duplicate strings.
6143
6144 * heap/Heap.cpp:
6145 (JSC::Heap::markRoots):
6146 * heap/MarkStack.cpp:
6147 (JSC::MarkStackThreadSharedData::resetChildren):
6148 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
6149 (JSC::MarkStackThreadSharedData::reset):
6150 (JSC::MarkStack::setup): Check to see if enough strings have been created
6151 to hash const.
6152 (JSC::MarkStack::reset): Added call to clear m_uniqueStrings.
6153 (JSC::JSString::tryHashConstLock): New method to lock JSString for
6154 hash consting.
6155 (JSC::JSString::releaseHashConstLock): New unlock method.
6156 (JSC::JSString::shouldTryHashConst): Set of checks to see if we should
6157 try to hash const the string.
6158 (JSC::MarkStack::internalAppend): New method that performs the hash consting.
6159 (JSC::SlotVisitor::copyAndAppend): Changed to call the new hash
6160 consting internalAppend().
6161 * heap/MarkStack.h:
6162 (MarkStackThreadSharedData):
6163 (MarkStack):
6164 * runtime/JSGlobalData.cpp:
6165 (JSC::JSGlobalData::JSGlobalData):
6166 * runtime/JSGlobalData.h:
6167 (JSGlobalData):
6168 (JSC::JSGlobalData::haveEnoughNewStringsToHashConst):
6169 (JSC::JSGlobalData::resetNewStringsSinceLastHashConst):
6170 * runtime/JSString.h:
6171 (JSString): Changed from using bool flags to using an unsigned
6172 m_flags field. This works better with the weakCompareAndSwap in
6173 JSString::tryHashConstLock(). Changed the 8bitness setting and
6174 checking to use new accessors.
6175 (JSC::JSString::JSString):
6176 (JSC::JSString::finishCreation):
6177 (JSC::JSString::is8Bit): Updated for new m_flags.
6178 (JSC::JSString::setIs8Bit): New setter.
6179 New hash const flags accessors:
6180 (JSC::JSString::isHashConstSingleton):
6181 (JSC::JSString::clearHashConstSingleton):
6182 (JSC::JSString::setHashConstSingleton):
6183 (JSC::JSRopeString::finishCreation):
6184 (JSC::JSRopeString::append):
6185
tony@chromium.orga47ad862012-07-03 20:26:08 +000061862012-07-03 Tony Chang <tony@chromium.org>
6187
6188 [chromium] Unreviewed, update .gitignore to handle VS2010 files.
6189
6190 * JavaScriptCore.gyp/.gitignore:
6191
commit-queue@webkit.orgfbda60c2012-07-03 19:19:22 +000061922012-07-03 Mark Lam <mark.lam@apple.com>
6193
6194 Add ability to symbolically set and dump JSC VM options.
6195 See comments in runtime/Options.h for details on how the options work.
6196 https://bugs.webkit.org/show_bug.cgi?id=90420
6197
6198 Reviewed by Filip Pizlo.
6199
6200 * assembler/LinkBuffer.cpp:
6201 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
6202 * assembler/LinkBuffer.h:
6203 (JSC):
6204 * bytecode/CodeBlock.cpp:
6205 (JSC::CodeBlock::shouldOptimizeNow):
6206 * bytecode/CodeBlock.h:
6207 (JSC::CodeBlock::likelyToTakeSlowCase):
6208 (JSC::CodeBlock::couldTakeSlowCase):
6209 (JSC::CodeBlock::likelyToTakeSpecialFastCase):
6210 (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
6211 (JSC::CodeBlock::likelyToTakeAnySlowCase):
6212 (JSC::CodeBlock::jitAfterWarmUp):
6213 (JSC::CodeBlock::jitSoon):
6214 (JSC::CodeBlock::reoptimizationRetryCounter):
6215 (JSC::CodeBlock::countReoptimization):
6216 (JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
6217 (JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
6218 (JSC::CodeBlock::optimizeSoon):
6219 (JSC::CodeBlock::exitCountThresholdForReoptimization):
6220 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
6221 * bytecode/ExecutionCounter.h:
6222 (JSC::ExecutionCounter::clippedThreshold):
6223 * dfg/DFGByteCodeParser.cpp:
6224 (JSC::DFG::ByteCodeParser::handleInlining):
6225 * dfg/DFGCapabilities.h:
6226 (JSC::DFG::mightCompileEval):
6227 (JSC::DFG::mightCompileProgram):
6228 (JSC::DFG::mightCompileFunctionForCall):
6229 (JSC::DFG::mightCompileFunctionForConstruct):
6230 (JSC::DFG::mightInlineFunctionForCall):
6231 (JSC::DFG::mightInlineFunctionForConstruct):
6232 * dfg/DFGCommon.h:
6233 (JSC::DFG::shouldShowDisassembly):
6234 * dfg/DFGDriver.cpp:
6235 (JSC::DFG::compile):
6236 * dfg/DFGOSRExit.cpp:
6237 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
6238 * dfg/DFGVariableAccessData.h:
6239 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
6240 * heap/MarkStack.cpp:
6241 (JSC::MarkStackSegmentAllocator::allocate):
6242 (JSC::MarkStackSegmentAllocator::shrinkReserve):
6243 (JSC::MarkStackArray::MarkStackArray):
6244 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
6245 (JSC::SlotVisitor::donateKnownParallel):
6246 (JSC::SlotVisitor::drain):
6247 (JSC::SlotVisitor::drainFromShared):
6248 * heap/MarkStack.h:
6249 (JSC::MarkStack::mergeOpaqueRootsIfProfitable):
6250 (JSC::MarkStack::addOpaqueRoot):
6251 * heap/SlotVisitor.h:
6252 (JSC::SlotVisitor::donate):
6253 * jit/JIT.cpp:
6254 (JSC::JIT::emitOptimizationCheck):
6255 * jsc.cpp:
6256 (printUsageStatement):
6257 (parseArguments):
6258 * runtime/InitializeThreading.cpp:
6259 (JSC::initializeThreadingOnce):
6260 * runtime/JSGlobalData.cpp:
6261 (JSC::enableAssembler):
6262 * runtime/JSGlobalObject.cpp:
6263 (JSC::JSGlobalObject::JSGlobalObject):
6264 * runtime/Options.cpp:
6265 (JSC):
6266 (JSC::overrideOptionWithHeuristic):
6267 (JSC::Options::initialize):
6268 (JSC::Options::setOption):
6269 (JSC::Options::dumpAllOptions):
6270 (JSC::Options::dumpOption):
6271 * runtime/Options.h:
6272 (JSC):
6273 (Options):
6274 (EntryInfo):
6275
commit-queue@webkit.org337179a2012-07-03 13:43:13 +000062762012-07-03 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Joel Dillon <joel.dillon@codethink.co.uk>
6277
6278 [Qt][Win] Fix broken QtWebKit5.lib linking
6279 https://bugs.webkit.org/show_bug.cgi?id=88321
6280
6281 Reviewed by Kenneth Rohde Christiansen.
6282
6283 The goal is to have different ports build systems define STATICALLY_LINKED_WITH_WTF
6284 when building JavaScriptCore, if both are packaged in the same DLL, instead
6285 of relying on the code to handle this.
6286 The effects of BUILDING_* and STATICALLY_LINKED_WITH_* are currently the same
6287 except for a check in Source/JavaScriptCore/config.h.
6288
6289 Keeping the old way for the WX port as requested by the port's contributors.
6290 For non-Windows ports there is no difference between IMPORT and EXPORT, no
6291 change is needed.
6292
6293 * API/JSBase.h:
6294 JS symbols shouldn't be included by WTF objects anymore. Remove the export when BUILDING_WTF.
6295 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
6296 Make sure that JavaScriptCore uses import symbols of WTF for the Win port.
6297 * runtime/JSExportMacros.h:
6298
fpizlo@apple.comaedde2e2012-07-03 00:10:08 +000062992012-07-02 Filip Pizlo <fpizlo@apple.com>
6300
fpizlo@apple.com8618e4b2012-07-03 01:27:16 +00006301 DFG OSR exit value recoveries should be computed lazily
6302 https://bugs.webkit.org/show_bug.cgi?id=82155
6303
6304 Reviewed by Gavin Barraclough.
6305
6306 This change aims to reduce one aspect of DFG compile times: the fact
6307 that we currently compute the value recoveries for each local and
6308 argument on every speculation check. We compile many speculation checks,
6309 so this can add up quick. The strategy that this change takes is to
6310 have the DFG save just enough information about how the compiler is
6311 choosing to represent state, that the DFG::OSRExitCompiler can reify
6312 the value recoveries lazily.
6313
6314 This appears to be an 0.3% SunSpider speed-up and is neutral elsewhere.
6315
6316 I also took the opportunity to fix the sampling regions profiler (it
6317 was missing an export macro) and to put in more sampling regions in
6318 the DFG (which are disabled so long as ENABLE(SAMPLING_REGIONS) is
6319 false).
6320
6321 * CMakeLists.txt:
6322 * GNUmakefile.list.am:
6323 * JavaScriptCore.xcodeproj/project.pbxproj:
6324 * Target.pri:
6325 * bytecode/CodeBlock.cpp:
6326 (JSC):
6327 (JSC::CodeBlock::shrinkDFGDataToFit):
6328 * bytecode/CodeBlock.h:
6329 (CodeBlock):
6330 (JSC::CodeBlock::minifiedDFG):
6331 (JSC::CodeBlock::variableEventStream):
6332 (DFGData):
6333 * bytecode/Operands.h:
6334 (JSC::Operands::hasOperand):
6335 (Operands):
6336 (JSC::Operands::size):
6337 (JSC::Operands::at):
6338 (JSC::Operands::operator[]):
6339 (JSC::Operands::isArgument):
6340 (JSC::Operands::isVariable):
6341 (JSC::Operands::argumentForIndex):
6342 (JSC::Operands::variableForIndex):
6343 (JSC::Operands::operandForIndex):
6344 (JSC):
6345 (JSC::dumpOperands):
6346 * bytecode/SamplingTool.h:
6347 (SamplingRegion):
6348 * dfg/DFGByteCodeParser.cpp:
6349 (JSC::DFG::parse):
6350 * dfg/DFGCFAPhase.cpp:
6351 (JSC::DFG::performCFA):
6352 * dfg/DFGCSEPhase.cpp:
6353 (JSC::DFG::performCSE):
6354 * dfg/DFGFixupPhase.cpp:
6355 (JSC::DFG::performFixup):
6356 * dfg/DFGGenerationInfo.h:
6357 (JSC::DFG::GenerationInfo::GenerationInfo):
6358 (JSC::DFG::GenerationInfo::initConstant):
6359 (JSC::DFG::GenerationInfo::initInteger):
6360 (JSC::DFG::GenerationInfo::initJSValue):
6361 (JSC::DFG::GenerationInfo::initCell):
6362 (JSC::DFG::GenerationInfo::initBoolean):
6363 (JSC::DFG::GenerationInfo::initDouble):
6364 (JSC::DFG::GenerationInfo::initStorage):
6365 (GenerationInfo):
6366 (JSC::DFG::GenerationInfo::noticeOSRBirth):
6367 (JSC::DFG::GenerationInfo::use):
6368 (JSC::DFG::GenerationInfo::spill):
6369 (JSC::DFG::GenerationInfo::setSpilled):
6370 (JSC::DFG::GenerationInfo::fillJSValue):
6371 (JSC::DFG::GenerationInfo::fillCell):
6372 (JSC::DFG::GenerationInfo::fillInteger):
6373 (JSC::DFG::GenerationInfo::fillBoolean):
6374 (JSC::DFG::GenerationInfo::fillDouble):
6375 (JSC::DFG::GenerationInfo::fillStorage):
6376 (JSC::DFG::GenerationInfo::appendFill):
6377 (JSC::DFG::GenerationInfo::appendSpill):
6378 * dfg/DFGJITCompiler.cpp:
6379 (JSC::DFG::JITCompiler::link):
6380 (JSC::DFG::JITCompiler::compile):
6381 (JSC::DFG::JITCompiler::compileFunction):
6382 * dfg/DFGMinifiedGraph.h: Added.
6383 (DFG):
6384 (MinifiedGraph):
6385 (JSC::DFG::MinifiedGraph::MinifiedGraph):
6386 (JSC::DFG::MinifiedGraph::at):
6387 (JSC::DFG::MinifiedGraph::append):
6388 (JSC::DFG::MinifiedGraph::prepareAndShrink):
6389 (JSC::DFG::MinifiedGraph::setOriginalGraphSize):
6390 (JSC::DFG::MinifiedGraph::originalGraphSize):
6391 * dfg/DFGMinifiedNode.cpp: Added.
6392 (DFG):
6393 (JSC::DFG::MinifiedNode::fromNode):
6394 * dfg/DFGMinifiedNode.h: Added.
6395 (DFG):
6396 (JSC::DFG::belongsInMinifiedGraph):
6397 (MinifiedNode):
6398 (JSC::DFG::MinifiedNode::MinifiedNode):
6399 (JSC::DFG::MinifiedNode::index):
6400 (JSC::DFG::MinifiedNode::op):
6401 (JSC::DFG::MinifiedNode::hasChild1):
6402 (JSC::DFG::MinifiedNode::child1):
6403 (JSC::DFG::MinifiedNode::hasConstant):
6404 (JSC::DFG::MinifiedNode::hasConstantNumber):
6405 (JSC::DFG::MinifiedNode::constantNumber):
6406 (JSC::DFG::MinifiedNode::hasWeakConstant):
6407 (JSC::DFG::MinifiedNode::weakConstant):
6408 (JSC::DFG::MinifiedNode::getIndex):
6409 (JSC::DFG::MinifiedNode::compareByNodeIndex):
6410 (JSC::DFG::MinifiedNode::hasChild):
6411 * dfg/DFGNode.h:
6412 (Node):
6413 * dfg/DFGOSRExit.cpp:
6414 (JSC::DFG::OSRExit::OSRExit):
6415 * dfg/DFGOSRExit.h:
6416 (OSRExit):
6417 * dfg/DFGOSRExitCompiler.cpp:
6418 * dfg/DFGOSRExitCompiler.h:
6419 (OSRExitCompiler):
6420 * dfg/DFGOSRExitCompiler32_64.cpp:
6421 (JSC::DFG::OSRExitCompiler::compileExit):
6422 * dfg/DFGOSRExitCompiler64.cpp:
6423 (JSC::DFG::OSRExitCompiler::compileExit):
6424 * dfg/DFGPredictionPropagationPhase.cpp:
6425 (JSC::DFG::performPredictionPropagation):
6426 * dfg/DFGRedundantPhiEliminationPhase.cpp:
6427 (JSC::DFG::performRedundantPhiElimination):
6428 * dfg/DFGSpeculativeJIT.cpp:
6429 (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
6430 (DFG):
6431 (JSC::DFG::SpeculativeJIT::fillStorage):
6432 (JSC::DFG::SpeculativeJIT::noticeOSRBirth):
6433 (JSC::DFG::SpeculativeJIT::compileMovHint):
6434 (JSC::DFG::SpeculativeJIT::compile):
6435 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
6436 * dfg/DFGSpeculativeJIT.h:
6437 (DFG):
6438 (JSC::DFG::SpeculativeJIT::use):
6439 (SpeculativeJIT):
6440 (JSC::DFG::SpeculativeJIT::spill):
6441 (JSC::DFG::SpeculativeJIT::speculationCheck):
6442 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
6443 (JSC::DFG::SpeculativeJIT::recordSetLocal):
6444 * dfg/DFGSpeculativeJIT32_64.cpp:
6445 (JSC::DFG::SpeculativeJIT::fillInteger):
6446 (JSC::DFG::SpeculativeJIT::fillDouble):
6447 (JSC::DFG::SpeculativeJIT::fillJSValue):
6448 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
6449 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
6450 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
6451 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
6452 (JSC::DFG::SpeculativeJIT::compile):
6453 * dfg/DFGSpeculativeJIT64.cpp:
6454 (JSC::DFG::SpeculativeJIT::fillInteger):
6455 (JSC::DFG::SpeculativeJIT::fillDouble):
6456 (JSC::DFG::SpeculativeJIT::fillJSValue):
6457 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
6458 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
6459 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
6460 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
6461 (JSC::DFG::SpeculativeJIT::compile):
6462 * dfg/DFGValueRecoveryOverride.h: Added.
6463 (DFG):
6464 (ValueRecoveryOverride):
6465 (JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):
6466 * dfg/DFGValueSource.cpp: Added.
6467 (DFG):
6468 (JSC::DFG::ValueSource::dump):
6469 * dfg/DFGValueSource.h: Added.
6470 (DFG):
6471 (JSC::DFG::dataFormatToValueSourceKind):
6472 (JSC::DFG::valueSourceKindToDataFormat):
6473 (JSC::DFG::isInRegisterFile):
6474 (ValueSource):
6475 (JSC::DFG::ValueSource::ValueSource):
6476 (JSC::DFG::ValueSource::forPrediction):
6477 (JSC::DFG::ValueSource::forDataFormat):
6478 (JSC::DFG::ValueSource::isSet):
6479 (JSC::DFG::ValueSource::kind):
6480 (JSC::DFG::ValueSource::isInRegisterFile):
6481 (JSC::DFG::ValueSource::dataFormat):
6482 (JSC::DFG::ValueSource::valueRecovery):
6483 (JSC::DFG::ValueSource::nodeIndex):
6484 (JSC::DFG::ValueSource::nodeIndexFromKind):
6485 (JSC::DFG::ValueSource::kindFromNodeIndex):
6486 * dfg/DFGVariableEvent.cpp: Added.
6487 (DFG):
6488 (JSC::DFG::VariableEvent::dump):
6489 (JSC::DFG::VariableEvent::dumpFillInfo):
6490 (JSC::DFG::VariableEvent::dumpSpillInfo):
6491 * dfg/DFGVariableEvent.h: Added.
6492 (DFG):
6493 (VariableEvent):
6494 (JSC::DFG::VariableEvent::VariableEvent):
6495 (JSC::DFG::VariableEvent::reset):
6496 (JSC::DFG::VariableEvent::fillGPR):
6497 (JSC::DFG::VariableEvent::fillPair):
6498 (JSC::DFG::VariableEvent::fillFPR):
6499 (JSC::DFG::VariableEvent::spill):
6500 (JSC::DFG::VariableEvent::death):
6501 (JSC::DFG::VariableEvent::setLocal):
6502 (JSC::DFG::VariableEvent::movHint):
6503 (JSC::DFG::VariableEvent::kind):
6504 (JSC::DFG::VariableEvent::nodeIndex):
6505 (JSC::DFG::VariableEvent::dataFormat):
6506 (JSC::DFG::VariableEvent::gpr):
6507 (JSC::DFG::VariableEvent::tagGPR):
6508 (JSC::DFG::VariableEvent::payloadGPR):
6509 (JSC::DFG::VariableEvent::fpr):
6510 (JSC::DFG::VariableEvent::virtualRegister):
6511 (JSC::DFG::VariableEvent::operand):
6512 (JSC::DFG::VariableEvent::variableRepresentation):
6513 * dfg/DFGVariableEventStream.cpp: Added.
6514 (DFG):
6515 (JSC::DFG::VariableEventStream::logEvent):
6516 (MinifiedGenerationInfo):
6517 (JSC::DFG::MinifiedGenerationInfo::MinifiedGenerationInfo):
6518 (JSC::DFG::MinifiedGenerationInfo::update):
6519 (JSC::DFG::VariableEventStream::reconstruct):
6520 * dfg/DFGVariableEventStream.h: Added.
6521 (DFG):
6522 (VariableEventStream):
6523 (JSC::DFG::VariableEventStream::appendAndLog):
6524 * dfg/DFGVirtualRegisterAllocationPhase.cpp:
6525 (JSC::DFG::performVirtualRegisterAllocation):
6526
65272012-07-02 Filip Pizlo <fpizlo@apple.com>
6528
fpizlo@apple.comaedde2e2012-07-03 00:10:08 +00006529 DFG::ArgumentsSimplificationPhase should assert that the PhantomArguments nodes it creates are not shouldGenerate()
6530 https://bugs.webkit.org/show_bug.cgi?id=90407
6531
6532 Reviewed by Mark Hahnenberg.
6533
6534 * dfg/DFGArgumentsSimplificationPhase.cpp:
6535 (JSC::DFG::ArgumentsSimplificationPhase::run):
6536
barraclough@apple.com15ab3352012-07-02 19:25:59 +000065372012-07-02 Gavin Barraclough <barraclough@apple.com>
6538
6539 Array.prototype.pop should throw if property is not configurable
6540 https://bugs.webkit.org/show_bug.cgi?id=75788
6541
6542 Rubber Stamped by Oliver Hunt.
6543
6544 No real bug here any more, but the error we throw sometimes has a misleading message.
6545
6546 * runtime/JSArray.cpp:
6547 (JSC::JSArray::pop):
6548
fpizlo@apple.com3aef57f2012-06-30 19:28:26 +000065492012-06-29 Filip Pizlo <fpizlo@apple.com>
6550
fpizlo@apple.com604d38a2012-07-01 03:54:49 +00006551 JSObject wastes too much memory on unused property slots
6552 https://bugs.webkit.org/show_bug.cgi?id=90255
6553
6554 Reviewed by Mark Hahnenberg.
6555
6556 Rolling back in after applying a simple fix: it appears that
6557 JSObject::setStructureAndReallocateStorageIfNecessary() was allocating more
6558 property storage than necessary. Fixing this appears to resolve the crash.
6559
6560 This does a few things:
6561
6562 - JSNonFinalObject no longer has inline property storage.
6563
6564 - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
6565 or 2x the inline storage for JSFinalObject.
6566
6567 - Property storage is only reallocated if it needs to be. Previously, we
6568 would reallocate the property storage on any transition where the original
6569 structure said shouldGrowProperyStorage(), but this led to spurious
6570 reallocations when doing transitionless property adds and there are
6571 deleted property slots available. That in turn led to crashes, because we
6572 would switch to out-of-line storage even if the capacity matched the
6573 criteria for inline storage.
6574
6575 - Inline JSFunction allocation is killed off because we don't have a good
6576 way of inlining property storage allocation. This didn't hurt performance.
6577 Killing off code is better than fixing it if that code wasn't doing any
6578 good.
6579
6580 This looks like a 1% progression on V8.
6581
6582 * interpreter/Interpreter.cpp:
6583 (JSC::Interpreter::privateExecute):
6584 * jit/JIT.cpp:
6585 (JSC::JIT::privateCompileSlowCases):
6586 * jit/JIT.h:
6587 * jit/JITInlineMethods.h:
6588 (JSC::JIT::emitAllocateBasicJSObject):
6589 (JSC):
6590 * jit/JITOpcodes.cpp:
6591 (JSC::JIT::emit_op_new_func):
6592 (JSC):
6593 (JSC::JIT::emit_op_new_func_exp):
6594 * runtime/JSFunction.cpp:
6595 (JSC::JSFunction::finishCreation):
6596 * runtime/JSObject.h:
6597 (JSC::JSObject::isUsingInlineStorage):
6598 (JSObject):
6599 (JSC::JSObject::finishCreation):
6600 (JSC):
6601 (JSC::JSNonFinalObject::hasInlineStorage):
6602 (JSNonFinalObject):
6603 (JSC::JSNonFinalObject::JSNonFinalObject):
6604 (JSC::JSNonFinalObject::finishCreation):
6605 (JSC::JSFinalObject::hasInlineStorage):
6606 (JSC::JSFinalObject::finishCreation):
6607 (JSC::JSObject::offsetOfInlineStorage):
6608 (JSC::JSObject::setPropertyStorage):
6609 (JSC::Structure::inlineStorageCapacity):
6610 (JSC::Structure::isUsingInlineStorage):
6611 (JSC::JSObject::putDirectInternal):
6612 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
6613 (JSC::JSObject::putDirectWithoutTransition):
6614 * runtime/Structure.cpp:
6615 (JSC::Structure::Structure):
6616 (JSC::nextPropertyStorageCapacity):
6617 (JSC):
6618 (JSC::Structure::growPropertyStorageCapacity):
6619 (JSC::Structure::suggestedNewPropertyStorageSize):
6620 * runtime/Structure.h:
6621 (JSC::Structure::putWillGrowPropertyStorage):
6622 (Structure):
6623
66242012-06-29 Filip Pizlo <fpizlo@apple.com>
6625
fpizlo@apple.com3aef57f2012-06-30 19:28:26 +00006626 Webkit crashes in DFG on Google Docs when creating a new document
6627 https://bugs.webkit.org/show_bug.cgi?id=90209
6628
6629 Reviewed by Gavin Barraclough.
6630
6631 Don't attempt to short-circuit Phantom(GetLocal) if the GetLocal is for a
6632 captured variable.
6633
6634 * dfg/DFGCFGSimplificationPhase.cpp:
6635 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
6636
zandobersek@gmail.com069a2d32012-06-30 12:09:15 +000066372012-06-30 Zan Dobersek <zandobersek@gmail.com>
6638
6639 Unreviewed, rolling out r121605.
6640 http://trac.webkit.org/changeset/121605
6641 https://bugs.webkit.org/show_bug.cgi?id=90336
6642
6643 Changes caused flaky crashes in sputnik/Unicode tests on Apple
6644 WK1 and GTK Linux builders
6645
6646 * interpreter/Interpreter.cpp:
6647 (JSC::Interpreter::privateExecute):
6648 * jit/JIT.cpp:
6649 (JSC::JIT::privateCompileSlowCases):
6650 * jit/JIT.h:
6651 * jit/JITInlineMethods.h:
6652 (JSC::JIT::emitAllocateBasicJSObject):
6653 (JSC::JIT::emitAllocateJSFinalObject):
6654 (JSC):
6655 (JSC::JIT::emitAllocateJSFunction):
6656 * jit/JITOpcodes.cpp:
6657 (JSC::JIT::emit_op_new_func):
6658 (JSC::JIT::emitSlow_op_new_func):
6659 (JSC):
6660 (JSC::JIT::emit_op_new_func_exp):
6661 (JSC::JIT::emitSlow_op_new_func_exp):
6662 * runtime/JSFunction.cpp:
6663 (JSC::JSFunction::finishCreation):
6664 * runtime/JSObject.h:
6665 (JSC::JSObject::isUsingInlineStorage):
6666 (JSObject):
6667 (JSC::JSObject::finishCreation):
6668 (JSC):
6669 (JSNonFinalObject):
6670 (JSC::JSNonFinalObject::JSNonFinalObject):
6671 (JSC::JSNonFinalObject::finishCreation):
6672 (JSFinalObject):
6673 (JSC::JSFinalObject::finishCreation):
6674 (JSC::JSObject::offsetOfInlineStorage):
6675 (JSC::JSObject::setPropertyStorage):
6676 (JSC::Structure::isUsingInlineStorage):
6677 (JSC::JSObject::putDirectInternal):
6678 (JSC::JSObject::putDirectWithoutTransition):
6679 (JSC::JSObject::transitionTo):
6680 * runtime/Structure.cpp:
6681 (JSC::Structure::Structure):
6682 (JSC):
6683 (JSC::Structure::growPropertyStorageCapacity):
6684 (JSC::Structure::suggestedNewPropertyStorageSize):
6685 * runtime/Structure.h:
6686 (JSC::Structure::shouldGrowPropertyStorage):
6687 (JSC::Structure::propertyStorageSize):
6688
mhahnenberg@apple.com3100b432012-06-30 01:14:09 +000066892012-06-29 Mark Hahnenberg <mhahnenberg@apple.com>
6690
6691 Remove warning about protected values when the Heap is being destroyed
6692 https://bugs.webkit.org/show_bug.cgi?id=90302
6693
6694 Reviewed by Geoffrey Garen.
6695
6696 Having to do book-keeping about whether values allocated from a certain
6697 VM are or are not protected makes the JSC API much more difficult to use
6698 correctly. Clients should be able to throw an entire VM away and not have
6699 to worry about unprotecting all of the values that they protected earlier.
6700
6701 * heap/Heap.cpp:
6702 (JSC::Heap::lastChanceToFinalize):
6703
fpizlo@apple.com9243e792012-06-30 00:25:01 +000067042012-06-29 Filip Pizlo <fpizlo@apple.com>
6705
6706 JSObject wastes too much memory on unused property slots
6707 https://bugs.webkit.org/show_bug.cgi?id=90255
6708
6709 Reviewed by Mark Hahnenberg.
6710
6711 This does a few things:
6712
6713 - JSNonFinalObject no longer has inline property storage.
6714
6715 - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
6716 or 2x the inline storage for JSFinalObject.
6717
6718 - Property storage is only reallocated if it needs to be. Previously, we
6719 would reallocate the property storage on any transition where the original
6720 structure said shouldGrowProperyStorage(), but this led to spurious
6721 reallocations when doing transitionless property adds and there are
6722 deleted property slots available. That in turn led to crashes, because we
6723 would switch to out-of-line storage even if the capacity matched the
6724 criteria for inline storage.
6725
6726 - Inline JSFunction allocation is killed off because we don't have a good
6727 way of inlining property storage allocation. This didn't hurt performance.
6728 Killing off code is better than fixing it if that code wasn't doing any
6729 good.
6730
6731 This looks like a 1% progression on V8.
6732
6733 * interpreter/Interpreter.cpp:
6734 (JSC::Interpreter::privateExecute):
6735 * jit/JIT.cpp:
6736 (JSC::JIT::privateCompileSlowCases):
6737 * jit/JIT.h:
6738 * jit/JITInlineMethods.h:
6739 (JSC::JIT::emitAllocateBasicJSObject):
6740 (JSC):
6741 * jit/JITOpcodes.cpp:
6742 (JSC::JIT::emit_op_new_func):
6743 (JSC):
6744 (JSC::JIT::emit_op_new_func_exp):
6745 * runtime/JSFunction.cpp:
6746 (JSC::JSFunction::finishCreation):
6747 * runtime/JSObject.h:
6748 (JSC::JSObject::isUsingInlineStorage):
6749 (JSObject):
6750 (JSC::JSObject::finishCreation):
6751 (JSC):
6752 (JSC::JSNonFinalObject::hasInlineStorage):
6753 (JSNonFinalObject):
6754 (JSC::JSNonFinalObject::JSNonFinalObject):
6755 (JSC::JSNonFinalObject::finishCreation):
6756 (JSC::JSFinalObject::hasInlineStorage):
6757 (JSC::JSFinalObject::finishCreation):
6758 (JSC::JSObject::offsetOfInlineStorage):
6759 (JSC::JSObject::setPropertyStorage):
6760 (JSC::Structure::inlineStorageCapacity):
6761 (JSC::Structure::isUsingInlineStorage):
6762 (JSC::JSObject::putDirectInternal):
6763 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
6764 (JSC::JSObject::putDirectWithoutTransition):
6765 * runtime/Structure.cpp:
6766 (JSC::Structure::Structure):
6767 (JSC::nextPropertyStorageCapacity):
6768 (JSC):
6769 (JSC::Structure::growPropertyStorageCapacity):
6770 (JSC::Structure::suggestedNewPropertyStorageSize):
6771 * runtime/Structure.h:
6772 (JSC::Structure::putWillGrowPropertyStorage):
6773 (Structure):
6774
fpizlo@apple.com48a964b2012-06-29 02:40:14 +000067752012-06-28 Filip Pizlo <fpizlo@apple.com>
6776
6777 DFG recompilation heuristics should be based on count, not rate
6778 https://bugs.webkit.org/show_bug.cgi?id=90146
6779
6780 Reviewed by Oliver Hunt.
6781
6782 This removes a bunch of code that was previously trying to prevent spurious
6783 reoptimizations if a large enough majority of executions of a code block did
6784 not result in OSR exit. It turns out that this code was purely harmful. This
6785 patch removes all of that logic and replaces it with a dead-simple
6786 heuristic: if you exit more than N times (where N is an exponential function
6787 of the number of times the code block has already been recompiled) then we
6788 will recompile.
6789
6790 This appears to be a broad ~1% win on many benchmarks large and small.
6791
6792 * bytecode/CodeBlock.cpp:
6793 (JSC::CodeBlock::CodeBlock):
6794 * bytecode/CodeBlock.h:
6795 (JSC::CodeBlock::osrExitCounter):
6796 (JSC::CodeBlock::countOSRExit):
6797 (CodeBlock):
6798 (JSC::CodeBlock::addressOfOSRExitCounter):
6799 (JSC::CodeBlock::offsetOfOSRExitCounter):
6800 (JSC::CodeBlock::adjustedExitCountThreshold):
6801 (JSC::CodeBlock::exitCountThresholdForReoptimization):
6802 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
6803 (JSC::CodeBlock::shouldReoptimizeNow):
6804 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
6805 * bytecode/ExecutionCounter.cpp:
6806 (JSC::ExecutionCounter::setThreshold):
6807 * bytecode/ExecutionCounter.h:
6808 (ExecutionCounter):
6809 (JSC::ExecutionCounter::clippedThreshold):
6810 * dfg/DFGJITCompiler.cpp:
6811 (JSC::DFG::JITCompiler::compileBody):
6812 * dfg/DFGOSRExit.cpp:
6813 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
6814 * dfg/DFGOSRExitCompiler.cpp:
6815 (JSC::DFG::OSRExitCompiler::handleExitCounts):
6816 * dfg/DFGOperations.cpp:
6817 * jit/JITStubs.cpp:
6818 (JSC::DEFINE_STUB_FUNCTION):
6819 * runtime/Options.cpp:
6820 (Options):
6821 (JSC::Options::initializeOptions):
6822 * runtime/Options.h:
6823 (Options):
6824
commit-queue@webkit.org97ee82b2012-06-28 23:03:07 +000068252012-06-28 Mark Lam <mark.lam@apple.com>
6826
6827 Adding a commenting utility to record BytecodeGenerator comments
6828 with opcodes that are emitted. Presently, the comments can only
6829 be constant strings. Adding comments for opcodes is optional.
6830 If a comment is added, the comment will be printed following the
6831 opcode when CodeBlock::dump() is called.
6832
6833 This utility is disabled by default, and is only meant for VM
6834 development purposes. It should not be enabled for product builds.
6835
6836 To enable this utility, set ENABLE_BYTECODE_COMMENTS in CodeBlock.h
6837 to 1.
6838
6839 https://bugs.webkit.org/show_bug.cgi?id=90095
6840
6841 Reviewed by Geoffrey Garen.
6842
6843 * GNUmakefile.list.am:
6844 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6845 * JavaScriptCore.xcodeproj/project.pbxproj:
6846 * bytecode/CodeBlock.cpp:
6847 (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): Dumps the comment.
6848 (JSC):
6849 (JSC::CodeBlock::printUnaryOp): Add comment dumps.
6850 (JSC::CodeBlock::printBinaryOp): Add comment dumps.
6851 (JSC::CodeBlock::printConditionalJump): Add comment dumps.
6852 (JSC::CodeBlock::printCallOp): Add comment dumps.
6853 (JSC::CodeBlock::printPutByIdOp): Add comment dumps.
6854 (JSC::CodeBlock::dump): Add comment dumps.
6855 (JSC::CodeBlock::CodeBlock):
6856 (JSC::CodeBlock::commentForBytecodeOffset):
6857 Finds the comment for an opcode if available.
6858 (JSC::CodeBlock::dumpBytecodeComments):
6859 For debugging whether comments are collected.
6860 It is not being called anywhere.
6861 * bytecode/CodeBlock.h:
6862 (CodeBlock):
6863 (JSC::CodeBlock::bytecodeComments):
6864 * bytecode/Comment.h: Added.
6865 (JSC):
6866 (Comment):
6867 * bytecompiler/BytecodeGenerator.cpp:
6868 (JSC::BytecodeGenerator::BytecodeGenerator):
6869 (JSC::BytecodeGenerator::emitOpcode): Calls emitComment().
6870 (JSC):
6871 (JSC::BytecodeGenerator::emitComment): Adds comment to CodeBlock.
6872 (JSC::BytecodeGenerator::prependComment):
6873 Registers a comment for emitComemnt() to use later.
6874 * bytecompiler/BytecodeGenerator.h:
6875 (BytecodeGenerator):
6876 (JSC::BytecodeGenerator::emitComment):
6877 (JSC::BytecodeGenerator::prependComment):
6878 These are inlined versions of these functions that nullify them
6879 when ENABLE_BYTECODE_COMMENTS is 0.
6880 (JSC::BytecodeGenerator::comments):
6881
oliver@apple.com41383bc2012-06-28 20:54:06 +000068822012-06-28 Oliver Hunt <oliver@apple.com>
6883
6884 32bit DFG incorrectly claims an fpr is fillable even if it has not been proven double
6885 https://bugs.webkit.org/show_bug.cgi?id=90127
6886
6887 Reviewed by Filip Pizlo.
6888
6889 The 32-bit version of fillSpeculateDouble doesn't handle Number->fpr loads
6890 correctly. This patch fixes this by killing the fill info in the GenerationInfo
6891 when the spillFormat doesn't guarantee the value is a double.
6892
6893 * dfg/DFGSpeculativeJIT32_64.cpp:
6894 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
6895
tkent@chromium.orgb53db042012-06-28 08:48:20 +000068962012-06-28 Kent Tamura <tkent@chromium.org>
6897
6898 Classify form control states by their owner forms
6899 https://bugs.webkit.org/show_bug.cgi?id=89950
6900
6901 Reviewed by Hajime Morita.
6902
6903 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6904 Expose WTF::StringBuilder::canShrink()
6905
msaboff@apple.comff141582012-06-28 01:14:20 +000069062012-06-27 Michael Saboff <msaboff@apple.com>
6907
6908 [Win] jscore-tests flakey
6909 https://bugs.webkit.org/show_bug.cgi?id=88118
6910
6911 Reviewed by Jessie Berlin.
6912
6913 jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
6914 instead it gets 126. Added a new option to jsc (-x) which prints the exit
6915 code before exiting. jsDriver.pl uses this option on Windows and parses the
6916 exit code output for the exit code, removing it before comparing the actual
6917 and expected outputs. Filed a follow on "FIXME" defect:
6918 [WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
6919 https://bugs.webkit.org/show_bug.cgi?id=90119
6920
6921 * jsc.cpp:
6922 (CommandLine::CommandLine):
6923 (CommandLine):
6924 (printUsageStatement):
6925 (parseArguments):
6926 (jscmain):
6927 * tests/mozilla/jsDriver.pl:
6928 (execute_tests):
6929
commit-queue@webkit.orge12e2f32012-06-28 01:09:22 +000069302012-06-27 Sheriff Bot <webkit.review.bot@gmail.com>
6931
6932 Unreviewed, rolling out r121359.
6933 http://trac.webkit.org/changeset/121359
6934 https://bugs.webkit.org/show_bug.cgi?id=90115
6935
6936 Broke many inspector tests (Requested by jpfau on #webkit).
6937
6938 * interpreter/Interpreter.h:
6939 (JSC::StackFrame::toString):
6940
fpizlo@apple.com12c18392012-06-27 23:16:10 +000069412012-06-27 Filip Pizlo <fpizlo@apple.com>
6942
fpizlo@apple.comc01022e2012-06-28 00:49:55 +00006943 Javascript SHA-512 gives wrong hash on second and subsequent runs unless Web Inspector Javascript Debugging is on
6944 https://bugs.webkit.org/show_bug.cgi?id=90053
6945 <rdar://problem/11764613>
6946
6947 Reviewed by Mark Hahnenberg.
6948
6949 The problem is that the code was assuming that the recovery should be Undefined if the source of
6950 the SetLocal was !shouldGenerate(). But that's wrong, since the DFG optimizer may skip around a
6951 UInt32ToNumber node (hence making it !shouldGenerate()) and keep the source of that node alive.
6952 In that case we should base the recovery on the source of the UInt32ToNumber. The logic for this
6953 was already in place but the fast check for !shouldGenerate() broke it.
6954
6955 * dfg/DFGSpeculativeJIT.cpp:
6956 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
6957
69582012-06-27 Filip Pizlo <fpizlo@apple.com>
6959
fpizlo@apple.com12c18392012-06-27 23:16:10 +00006960 DFG disassembly should be easier to read
6961 https://bugs.webkit.org/show_bug.cgi?id=90106
6962
6963 Reviewed by Mark Hahnenberg.
6964
6965 Did a few things:
6966
6967 - Options::showDFGDisassembly now shows OSR exit disassembly as well.
6968
6969 - Phi node dumping doesn't attempt to do line wrapping since it just made the dump harder
6970 to read.
6971
6972 - DFG graph disassembly view shows a few additional node types that turn out to be
6973 essential for understanding OSR exits.
6974
6975 Put together, these changes reinforce the philosophy that anything needed for computing
6976 OSR exit is just as important as the machine code itself. Of course, we still don't take
6977 that philosophy to its full extreme - for example Phantom nodes are not dumped. We may
6978 revisit that in the future.
6979
6980 * assembler/LinkBuffer.cpp:
6981 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
6982 * assembler/LinkBuffer.h:
6983 (JSC):
6984 * dfg/DFGDisassembler.cpp:
6985 (JSC::DFG::Disassembler::dump):
6986 * dfg/DFGGraph.cpp:
6987 (JSC::DFG::Graph::dumpBlockHeader):
6988 * dfg/DFGNode.h:
6989 (JSC::DFG::Node::willHaveCodeGenOrOSR):
6990 * dfg/DFGOSRExitCompiler.cpp:
6991 * jit/JIT.cpp:
6992 (JSC::JIT::privateCompile):
6993
mhahnenberg@apple.come16f8092012-06-27 23:08:26 +000069942012-06-25 Mark Hahnenberg <mhahnenberg@apple.com>
6995
6996 JSLock should be per-JSGlobalData
6997 https://bugs.webkit.org/show_bug.cgi?id=89123
6998
6999 Reviewed by Geoffrey Garen.
7000
7001 * API/APIShims.h:
7002 (APIEntryShimWithoutLock):
7003 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
7004 determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
7005 HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
7006 JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
7007 its destruction has begun.
7008 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
7009 (JSC::APIEntryShim::APIEntryShim):
7010 (APIEntryShim):
7011 (JSC::APIEntryShim::~APIEntryShim):
7012 (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
7013 Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
7014 and before we've released it, which can only done in APIEntryShim.
7015 (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
7016 * API/JSContextRef.cpp:
7017 (JSGlobalContextCreate):
7018 (JSGlobalContextCreateInGroup):
7019 (JSGlobalContextRelease):
7020 (JSContextCreateBacktrace):
7021 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7022 * heap/CopiedSpace.cpp:
7023 (JSC::CopiedSpace::tryAllocateSlowCase):
7024 * heap/Heap.cpp:
7025 (JSC::Heap::protect):
7026 (JSC::Heap::unprotect):
7027 (JSC::Heap::collect):
7028 (JSC::Heap::setActivityCallback):
7029 (JSC::Heap::activityCallback):
7030 (JSC::Heap::sweeper):
7031 * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
7032 are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
7033 and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
7034 prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
7035 (Heap):
7036 * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
7037 (JSC::HeapTimer::~HeapTimer):
7038 (JSC::HeapTimer::invalidate):
7039 (JSC):
7040 (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
7041 that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
7042 HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
7043 (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
7044 out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
7045 but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
7046 we were interrupted between releasing our mutex and trying to grab the APILock.
7047 * heap/HeapTimer.h:
7048 (HeapTimer):
7049 * heap/IncrementalSweeper.cpp:
7050 (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
7051 all of that for us.
7052 (JSC::IncrementalSweeper::create):
7053 * heap/IncrementalSweeper.h:
7054 (IncrementalSweeper):
7055 * heap/MarkedAllocator.cpp:
7056 (JSC::MarkedAllocator::allocateSlowCase):
7057 * heap/WeakBlock.cpp:
7058 (JSC::WeakBlock::reap):
7059 * jsc.cpp:
7060 (functionGC):
7061 (functionReleaseExecutableMemory):
7062 (jscmain):
7063 * runtime/Completion.cpp:
7064 (JSC::checkSyntax):
7065 (JSC::evaluate):
7066 * runtime/GCActivityCallback.h:
7067 (DefaultGCActivityCallback):
7068 (JSC::DefaultGCActivityCallback::create):
7069 * runtime/JSGlobalData.cpp:
7070 (JSC::JSGlobalData::JSGlobalData):
7071 (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
7072 that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
7073 it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
7074 APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
7075 (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
7076 (JSC::JSGlobalData::sharedInstanceInternal):
7077 * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
7078 de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
7079 (JSGlobalData):
7080 (JSC::JSGlobalData::apiLock):
7081 * runtime/JSGlobalObject.cpp:
7082 (JSC::JSGlobalObject::~JSGlobalObject):
7083 (JSC::JSGlobalObject::init):
7084 * runtime/JSLock.cpp:
7085 (JSC):
7086 (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
7087 (JSC::GlobalJSLock::~GlobalJSLock):
7088 (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
7089 it can successfully unlock it later without it disappearing from underneath it.
7090 (JSC::JSLockHolder::~JSLockHolder):
7091 (JSC::JSLock::JSLock):
7092 (JSC::JSLock::~JSLock):
7093 (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
7094 actually waiting for long periods.
7095 (JSC::JSLock::unlock):
7096 (JSC::JSLock::currentThreadIsHoldingLock):
7097 (JSC::JSLock::dropAllLocks):
7098 (JSC::JSLock::dropAllLocksUnconditionally):
7099 (JSC::JSLock::grabAllLocks):
7100 (JSC::JSLock::DropAllLocks::DropAllLocks):
7101 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7102 * runtime/JSLock.h:
7103 (JSC):
7104 (GlobalJSLock):
7105 (JSLockHolder):
7106 (JSLock):
7107 (DropAllLocks):
7108 * runtime/WeakGCMap.h:
7109 (JSC::WeakGCMap::set):
7110 * testRegExp.cpp:
7111 (realMain):
7112
fpizlo@apple.coma8de6ba2012-06-27 21:25:23 +000071132012-06-27 Filip Pizlo <fpizlo@apple.com>
7114
fpizlo@apple.com4a4978b2012-06-27 21:45:08 +00007115 x86 disassembler confuses immediates with addresses
7116 https://bugs.webkit.org/show_bug.cgi?id=90099
7117
7118 Reviewed by Mark Hahnenberg.
7119
7120 Prepend "$" to immediates to disambiguate between immediates and addresses. This is in
7121 accordance with the gas and AT&T syntax.
7122
7123 * disassembler/udis86/udis86_syn-att.c:
7124 (gen_operand):
7125
71262012-06-27 Filip Pizlo <fpizlo@apple.com>
7127
fpizlo@apple.coma8de6ba2012-06-27 21:25:23 +00007128 Add a comment clarifying Options::showDisassembly versus Options::showDFGDisassembly.
7129
7130 Rubber stamped by Mark Hahnenberg.
7131
7132 * runtime/Options.cpp:
7133 (JSC::Options::initializeOptions):
7134
commit-queue@webkit.org50c978a2012-06-27 19:54:48 +000071352012-06-27 Anthony Scian <ascian@rim.com>
7136
7137 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
7138 https://bugs.webkit.org/show_bug.cgi?id=40118
7139
7140 Reviewed by Yong Li.
7141
7142 Added member functions to expose function name, urlString, and line #.
7143 Refactored toString to make use of these member functions to reduce
7144 duplicated code for future maintenance.
7145
7146 Manually tested refactoring of toString by tracing thrown exceptions.
7147
7148 * interpreter/Interpreter.h:
7149 (StackFrame):
7150 (JSC::StackFrame::toString):
7151 (JSC::StackFrame::friendlySourceURL):
7152 (JSC::StackFrame::friendlyFunctionName):
7153 (JSC::StackFrame::friendlyLineNumber):
7154
vestbo@webkit.org36e47da2012-06-27 13:02:03 +000071552012-06-27 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
7156
7157 [Qt] Remove redundant c++11 warning suppression code
7158
7159 This is already handled in default_post.
7160
7161 Reviewed by Tor Arne Vestbø.
7162
7163 * Target.pri:
7164
vestbo@webkit.orgcaf4d2f2012-06-27 11:30:42 +000071652012-06-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
7166
7167 [Qt] Add missing heades to HEADERS
7168
7169 For JavaScriptCore there aren't any Qt specific files, so we include all
7170 headers for easy editing in Qt Creator.
7171
7172 Reviewed by Simon Hausmann.
7173
7174 * Target.pri:
7175
dominicc@chromium.org5940f722012-06-27 09:44:31 +000071762012-06-26 Dominic Cooney <dominicc@chromium.org>
7177
7178 [Chromium] Remove unused build scripts and empty folders for JavaScriptCore w/ gyp
7179 https://bugs.webkit.org/show_bug.cgi?id=90029
7180
7181 Reviewed by Adam Barth.
7182
7183 * gyp: Removed.
7184 * gyp/generate-derived-sources.sh: Removed.
7185 * gyp/generate-dtrace-header.sh: Removed.
7186 * gyp/run-if-exists.sh: Removed.
7187 * gyp/update-info-plist.sh: Removed.
7188
ggaren@apple.com6b348072012-06-27 03:44:05 +000071892012-06-26 Geoffrey Garen <ggaren@apple.com>
7190
7191 Reduced (but did not eliminate) use of "berzerker GC"
7192 https://bugs.webkit.org/show_bug.cgi?id=89237
7193
7194 Reviewed by Gavin Barraclough.
7195
7196 (PART 2)
7197
7198 This part turns off "berzerker GC" and turns on incremental shrinking.
7199
7200 * heap/IncrementalSweeper.cpp:
7201 (JSC::IncrementalSweeper::doSweep): Free or shrink after sweeping to
7202 maintain the behavior we used to get from the occasional berzerker GC,
7203 which would run all finalizers and then free or shrink all blocks
7204 synchronously.
7205
7206 * heap/MarkedBlock.h:
7207 (JSC::MarkedBlock::needsSweeping): Sweep zapped blocks, too. It's always
7208 safe to sweep a zapped block (that's the point of zapping), and it's
7209 sometimes profitable. For example, consider this case: Block A does some
7210 allocation (transitioning Block A from Marked to FreeListed), then GC
7211 happens (transitioning Block A to Zapped), then all objects in Block A
7212 are free, then the incremental sweeper visits Block A. If we skipped
7213 Zapped blocks, we'd skip Block A, even though it would be profitable to
7214 run its destructors and free its memory.
7215
7216 * runtime/GCActivityCallback.cpp:
7217 (JSC::DefaultGCActivityCallback::doWork): Don't sweep eagerly; we'll do
7218 this incrementally.
7219
fpizlo@apple.com580d9d72012-06-27 01:34:01 +000072202012-06-26 Filip Pizlo <fpizlo@apple.com>
7221
7222 DFG PutByValAlias is too aggressive
7223 https://bugs.webkit.org/show_bug.cgi?id=90026
7224 <rdar://problem/11751830>
7225
7226 Reviewed by Gavin Barraclough.
7227
7228 For CSE on normal arrays, we now treat PutByVal as impure. This does not appear to affect
7229 performance by much.
7230
7231 For CSE on typed arrays, we fix PutByValAlias by making GetByVal speculate that the access
7232 is within bounds. This also has the effect of making our out-of-bounds handling consistent
7233 with WebCore.
7234
7235 * dfg/DFGCSEPhase.cpp:
7236 (JSC::DFG::CSEPhase::performNodeCSE):
7237 * dfg/DFGGraph.h:
7238 (JSC::DFG::Graph::byValIsPure):
7239 (JSC::DFG::Graph::clobbersWorld):
7240 * dfg/DFGNodeType.h:
7241 (DFG):
7242 * dfg/DFGSpeculativeJIT.cpp:
7243 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
7244 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
7245
commit-queue@webkit.org63a25eb2012-06-26 19:55:32 +000072462012-06-26 Yong Li <yoli@rim.com>
7247
7248 [BlackBerry] Add JSC statistics into about:memory
7249 https://bugs.webkit.org/show_bug.cgi?id=89779
7250
7251 Reviewed by Rob Buis.
7252
7253 Fix non-JIT build on BlackBerry broken by r121196.
7254
7255 * runtime/MemoryStatistics.cpp:
7256 (JSC::globalMemoryStatistics):
7257
fpizlo@apple.com6c89cd32012-06-26 19:42:05 +000072582012-06-25 Filip Pizlo <fpizlo@apple.com>
7259
7260 DFG::operationNewArray is unnecessarily slow, and may use the wrong array
7261 prototype when inlined
7262 https://bugs.webkit.org/show_bug.cgi?id=89821
7263
7264 Reviewed by Geoffrey Garen.
7265
7266 Fixes all array allocations to use the right structure, and hence the right prototype. Adds
7267 inlining of new Array(...) with a non-zero number of arguments. Optimizes allocations of
7268 empty arrays.
7269
7270 * dfg/DFGAbstractState.cpp:
7271 (JSC::DFG::AbstractState::execute):
7272 * dfg/DFGByteCodeParser.cpp:
7273 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
7274 * dfg/DFGCCallHelpers.h:
7275 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
7276 (CCallHelpers):
7277 * dfg/DFGNodeType.h:
7278 (DFG):
7279 * dfg/DFGOperations.cpp:
7280 * dfg/DFGOperations.h:
7281 * dfg/DFGPredictionPropagationPhase.cpp:
7282 (JSC::DFG::PredictionPropagationPhase::propagate):
7283 * dfg/DFGSpeculativeJIT.h:
7284 (JSC::DFG::SpeculativeJIT::callOperation):
7285 * dfg/DFGSpeculativeJIT32_64.cpp:
7286 (JSC::DFG::SpeculativeJIT::compile):
7287 * dfg/DFGSpeculativeJIT64.cpp:
7288 (JSC::DFG::SpeculativeJIT::compile):
7289 * runtime/JSArray.h:
7290 (JSC):
7291 (JSC::constructArray):
7292 * runtime/JSGlobalObject.h:
7293 (JSC):
7294 (JSC::constructArray):
7295
fpizlo@apple.com0b6ad50752012-06-26 09:22:45 +000072962012-06-26 Filip Pizlo <fpizlo@apple.com>
7297
7298 New fast/js/dfg-store-unexpected-value-into-argument-and-osr-exit.html fails on 32 bit
7299 https://bugs.webkit.org/show_bug.cgi?id=89953
7300
7301 Reviewed by Zoltan Herczeg.
7302
7303 DFG 32-bit JIT was confused about the difference between a predicted type and a
7304 proven type. This is easy to get confused about, since a local that is predicted int32
7305 almost always means that the local must be an int32 since speculations are hoisted to
7306 stores to locals. But that is less likely to be the case for arguments, where there is
7307 an additional least-upper-bounding step: any store to an argument with a weird type
7308 may force the argument to be any type.
7309
7310 This patch basically duplicates the functionality in DFGSpeculativeJIT64.cpp for
7311 GetLocal: the decision of whether to load a local as an int32 (or as an array, or as
7312 a boolean) is made based on the AbstractValue::m_type, which is a type proof, rather
7313 than the VariableAccessData::prediction(), which is a predicted type.
7314
7315 * dfg/DFGSpeculativeJIT32_64.cpp:
7316 (JSC::DFG::SpeculativeJIT::compile):
7317
fpizlo@apple.com41a1f0e2012-06-26 02:53:39 +000073182012-06-25 Filip Pizlo <fpizlo@apple.com>
7319
7320 JSC should try to make profiling deterministic because otherwise reproducing failures is
7321 nearly impossible
7322 https://bugs.webkit.org/show_bug.cgi?id=89940
7323
7324 Rubber stamped by Gavin Barraclough.
7325
7326 This rolls out the part of http://trac.webkit.org/changeset/121215 that introduced randomness
7327 into the system. Now, instead of randomizing the tier-up threshold, we always set it to an
7328 artificially low (and statically predetermined!) value. This gives most of the benefit of
7329 threshold randomization without actually making the system behave completely differently on
7330 each invocation.
7331
7332 * bytecode/ExecutionCounter.cpp:
7333 (JSC::ExecutionCounter::setThreshold):
7334 * runtime/Options.cpp:
7335 (Options):
7336 (JSC::Options::initializeOptions):
7337 * runtime/Options.h:
7338 (Options):
7339
fpizlo@apple.com3745dbc2012-06-26 02:14:07 +000073402012-06-22 Filip Pizlo <fpizlo@apple.com>
7341
7342 Value profiling should use tier-up threshold randomization to get more coverage
7343 https://bugs.webkit.org/show_bug.cgi?id=89802
7344
7345 Reviewed by Gavin Barraclough.
7346
7347 This patch causes both LLInt and Baseline JIT code to take the OSR slow path several
7348 times before actually doing OSR. If we take the OSR slow path before the execution
7349 count threshold is reached, then we just call CodeBlock::updateAllPredictions() to
7350 compute the current latest least-upper-bound SpecType of all values seen in each
7351 ValueProfile.
7352
7353 * bytecode/CodeBlock.cpp:
7354 (JSC::CodeBlock::stronglyVisitStrongReferences):
7355 (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
7356 (JSC):
7357 (JSC::CodeBlock::updateAllPredictions):
7358 (JSC::CodeBlock::shouldOptimizeNow):
7359 * bytecode/CodeBlock.h:
7360 (JSC::CodeBlock::llintExecuteCounter):
7361 (JSC::CodeBlock::jitExecuteCounter):
7362 (CodeBlock):
7363 (JSC::CodeBlock::updateAllPredictions):
7364 * bytecode/ExecutionCounter.cpp:
7365 (JSC::ExecutionCounter::setThreshold):
7366 (JSC::ExecutionCounter::status):
7367 (JSC):
7368 * bytecode/ExecutionCounter.h:
7369 (JSC::ExecutionCounter::count):
7370 (ExecutionCounter):
7371 * dfg/DFGAbstractState.cpp:
7372 (JSC::DFG::AbstractState::execute):
7373 * dfg/DFGOperations.cpp:
7374 * dfg/DFGSpeculativeJIT.cpp:
7375 (JSC::DFG::SpeculativeJIT::compile):
7376 * jit/JITStubs.cpp:
7377 (JSC::DEFINE_STUB_FUNCTION):
7378 * llint/LLIntSlowPaths.cpp:
7379 (JSC::LLInt::jitCompileAndSetHeuristics):
7380 (JSC::LLInt::entryOSR):
7381 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
7382 * runtime/JSGlobalObject.cpp:
7383 (JSC::JSGlobalObject::JSGlobalObject):
7384 (JSC):
7385 * runtime/JSGlobalObject.h:
7386 (JSGlobalObject):
7387 (JSC::JSGlobalObject::weakRandomInteger):
7388 * runtime/Options.cpp:
7389 (Options):
7390 (JSC::Options::initializeOptions):
7391 * runtime/Options.h:
7392 (Options):
7393 * runtime/WeakRandom.h:
7394 (WeakRandom):
7395 (JSC::WeakRandom::seedUnsafe):
7396
commit-queue@webkit.orgd3790912012-06-26 00:08:19 +000073972012-06-25 Yong Li <yoli@rim.com>
7398
7399 [BlackBerry] Add JSC statistics into about:memory
7400 https://bugs.webkit.org/show_bug.cgi?id=89779
7401
7402 Reviewed by Rob Buis.
7403
7404 Add MemoryStatistics.cpp into build, and fill JITBytes for BlackBerry port.
7405
7406 * PlatformBlackBerry.cmake:
7407 * runtime/MemoryStatistics.cpp:
7408 (JSC::globalMemoryStatistics):
7409
zandobersek@gmail.coma6460e12012-06-23 13:41:40 +000074102012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
7411
7412 Unreviewed, rolling out r121058.
7413 http://trac.webkit.org/changeset/121058
7414 https://bugs.webkit.org/show_bug.cgi?id=89809
7415
7416 Patch causes plugins tests to crash in GTK debug builds
7417 (Requested by zdobersek on #webkit).
7418
7419 * API/APIShims.h:
7420 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
7421 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
7422 (APIEntryShimWithoutLock):
7423 (JSC::APIEntryShim::APIEntryShim):
7424 (APIEntryShim):
7425 (JSC::APICallbackShim::~APICallbackShim):
7426 * API/JSContextRef.cpp:
7427 (JSGlobalContextCreate):
7428 (JSGlobalContextCreateInGroup):
7429 (JSGlobalContextRelease):
7430 (JSContextCreateBacktrace):
7431 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7432 * heap/CopiedSpace.cpp:
7433 (JSC::CopiedSpace::tryAllocateSlowCase):
7434 * heap/Heap.cpp:
7435 (JSC::Heap::protect):
7436 (JSC::Heap::unprotect):
7437 (JSC::Heap::collect):
7438 (JSC::Heap::setActivityCallback):
7439 (JSC::Heap::activityCallback):
7440 (JSC::Heap::sweeper):
7441 * heap/Heap.h:
7442 (Heap):
7443 * heap/HeapTimer.cpp:
7444 (JSC::HeapTimer::~HeapTimer):
7445 (JSC::HeapTimer::invalidate):
7446 (JSC::HeapTimer::timerDidFire):
7447 (JSC):
7448 * heap/HeapTimer.h:
7449 (HeapTimer):
7450 * heap/IncrementalSweeper.cpp:
7451 (JSC::IncrementalSweeper::doWork):
7452 (JSC::IncrementalSweeper::create):
7453 * heap/IncrementalSweeper.h:
7454 (IncrementalSweeper):
7455 * heap/MarkedAllocator.cpp:
7456 (JSC::MarkedAllocator::allocateSlowCase):
7457 * heap/WeakBlock.cpp:
7458 (JSC::WeakBlock::reap):
7459 * jsc.cpp:
7460 (functionGC):
7461 (functionReleaseExecutableMemory):
7462 (jscmain):
7463 * runtime/Completion.cpp:
7464 (JSC::checkSyntax):
7465 (JSC::evaluate):
7466 * runtime/GCActivityCallback.h:
7467 (DefaultGCActivityCallback):
7468 (JSC::DefaultGCActivityCallback::create):
7469 * runtime/JSGlobalData.cpp:
7470 (JSC::JSGlobalData::JSGlobalData):
7471 (JSC::JSGlobalData::~JSGlobalData):
7472 (JSC::JSGlobalData::sharedInstance):
7473 (JSC::JSGlobalData::sharedInstanceInternal):
7474 * runtime/JSGlobalData.h:
7475 (JSGlobalData):
7476 * runtime/JSGlobalObject.cpp:
7477 (JSC::JSGlobalObject::~JSGlobalObject):
7478 (JSC::JSGlobalObject::init):
7479 * runtime/JSLock.cpp:
7480 (JSC):
7481 (JSC::createJSLockCount):
7482 (JSC::JSLock::lockCount):
7483 (JSC::setLockCount):
7484 (JSC::JSLock::JSLock):
7485 (JSC::JSLock::lock):
7486 (JSC::JSLock::unlock):
7487 (JSC::JSLock::currentThreadIsHoldingLock):
7488 (JSC::JSLock::DropAllLocks::DropAllLocks):
7489 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7490 * runtime/JSLock.h:
7491 (JSC):
7492 (JSLock):
7493 (JSC::JSLock::JSLock):
7494 (JSC::JSLock::~JSLock):
7495 (DropAllLocks):
7496 * runtime/WeakGCMap.h:
7497 (JSC::WeakGCMap::set):
7498 * testRegExp.cpp:
7499 (realMain):
7500
achicu@adobe.comcead7612012-06-23 01:23:48 +000075012012-06-22 Alexandru Chiculita <achicu@adobe.com>
7502
7503 [CSS Shaders] Re-enable the CSS Shaders compile time flag on Safari Mac
7504 https://bugs.webkit.org/show_bug.cgi?id=89781
7505
7506 Reviewed by Dean Jackson.
7507
7508 Added ENABLE_CSS_SHADERS flag as enabled by default on Safari for Mac.
7509
7510 * Configurations/FeatureDefines.xcconfig:
7511
fpizlo@apple.com16e2cbf2012-06-22 23:32:59 +000075122012-06-22 Filip Pizlo <fpizlo@apple.com>
7513
7514 DFG tier-up should happen in prologues, not epilogues
7515 https://bugs.webkit.org/show_bug.cgi?id=89752
7516
7517 Reviewed by Geoffrey Garen.
7518
7519 This change has two outcomes:
7520
7521 1) Slightly reduces the likelihood that a function will be optimized both
7522 standalone and via inlining. Previously, if you had a call sequence like foo()
7523 calls bar() exactly once, and nobody else calls bar(), then bar() would get
7524 optimized first (because it returns first) and then foo() gets optimized. If foo()
7525 can inline bar() then that means that bar() gets optimized twice. But now, if we
7526 optimize in prologues, then foo() will be optimized first. If it inlines bar(),
7527 that means that there will no longer be any calls to bar().
7528
7529 2) It lets us kill some code in JITStubs. Epilogue tier-up was very different from
7530 loop tier-up, since epilogue tier-up should not attempt OSR. But prologue tier-up
7531 requires OSR (albeit really easy OSR since it's the top of the compilation unit),
7532 so it becomes just like loop tier-up. As a result, we now have one optimization
7533 hook (cti_optimize) instead of two (cti_optimize_from_loop and
7534 cti_optimize_from_ret).
7535
7536 As a consequence of not having an optimization check in epilogues, the OSR exit
7537 code must now trigger reoptimization itself instead of just signaling the epilogue
7538 check to fire.
7539
7540 This also adds the ability to count the number of DFG compilations, which was
7541 useful for debugging this patch and might be useful for other things in the future.
7542
7543 * bytecode/CodeBlock.cpp:
7544 (JSC::CodeBlock::reoptimize):
7545 (JSC):
7546 * bytecode/CodeBlock.h:
7547 (CodeBlock):
7548 * dfg/DFGByteCodeParser.cpp:
7549 (JSC::DFG::ByteCodeParser::parseCodeBlock):
7550 * dfg/DFGDriver.cpp:
7551 (DFG):
7552 (JSC::DFG::getNumCompilations):
7553 (JSC::DFG::compile):
7554 * dfg/DFGDriver.h:
7555 (DFG):
7556 * dfg/DFGOSRExitCompiler.cpp:
7557 (JSC::DFG::OSRExitCompiler::handleExitCounts):
7558 * dfg/DFGOperations.cpp:
7559 * dfg/DFGOperations.h:
7560 * jit/JIT.cpp:
7561 (JSC::JIT::emitOptimizationCheck):
7562 * jit/JIT.h:
7563 * jit/JITCall32_64.cpp:
7564 (JSC::JIT::emit_op_ret):
7565 (JSC::JIT::emit_op_ret_object_or_this):
7566 * jit/JITOpcodes.cpp:
7567 (JSC::JIT::emit_op_ret):
7568 (JSC::JIT::emit_op_ret_object_or_this):
7569 (JSC::JIT::emit_op_enter):
7570 * jit/JITOpcodes32_64.cpp:
7571 (JSC::JIT::emit_op_enter):
7572 * jit/JITStubs.cpp:
7573 (JSC::DEFINE_STUB_FUNCTION):
7574 * jit/JITStubs.h:
7575
mhahnenberg@apple.com6d9f86d2012-06-22 21:42:46 +000075762012-06-20 Mark Hahnenberg <mhahnenberg@apple.com>
7577
7578 JSLock should be per-JSGlobalData
7579 https://bugs.webkit.org/show_bug.cgi?id=89123
7580
7581 Reviewed by Gavin Barraclough.
7582
7583 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7584 * API/APIShims.h:
7585 (APIEntryShimWithoutLock):
7586 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
7587 determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
7588 HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
7589 JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
7590 its destruction has begun.
7591 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): Now derefs if it also refed.
7592 (JSC::APIEntryShim::APIEntryShim):
7593 (APIEntryShim):
7594 (JSC::APIEntryShim::~APIEntryShim):
7595 (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
7596 Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
7597 and before we've released it, which can only done in APIEntryShim.
7598 (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
7599 * API/JSContextRef.cpp:
7600 (JSGlobalContextCreate):
7601 (JSGlobalContextCreateInGroup):
7602 (JSGlobalContextRelease):
7603 (JSContextCreateBacktrace):
7604 * heap/CopiedSpace.cpp:
7605 (JSC::CopiedSpace::tryAllocateSlowCase):
7606 * heap/Heap.cpp:
7607 (JSC::Heap::protect):
7608 (JSC::Heap::unprotect):
7609 (JSC::Heap::collect):
7610 (JSC::Heap::setActivityCallback):
7611 (JSC::Heap::activityCallback):
7612 (JSC::Heap::sweeper):
7613 * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
7614 are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
7615 and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
7616 prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
7617 (Heap):
7618 * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
7619 (JSC::HeapTimer::~HeapTimer):
7620 (JSC::HeapTimer::invalidate):
7621 (JSC):
7622 (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
7623 that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
7624 HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
7625 (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
7626 out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
7627 but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
7628 we were interrupted between releasing our mutex and trying to grab the APILock.
7629 * heap/HeapTimer.h:
7630 (HeapTimer):
7631 * heap/IncrementalSweeper.cpp:
7632 (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
7633 all of that for us.
7634 (JSC::IncrementalSweeper::create):
7635 * heap/IncrementalSweeper.h:
7636 (IncrementalSweeper):
7637 * heap/MarkedAllocator.cpp:
7638 (JSC::MarkedAllocator::allocateSlowCase):
7639 * heap/WeakBlock.cpp:
7640 (JSC::WeakBlock::reap):
7641 * jsc.cpp:
7642 (functionGC):
7643 (functionReleaseExecutableMemory):
7644 (jscmain):
7645 * runtime/Completion.cpp:
7646 (JSC::checkSyntax):
7647 (JSC::evaluate):
7648 * runtime/GCActivityCallback.h:
7649 (DefaultGCActivityCallback):
7650 (JSC::DefaultGCActivityCallback::create):
7651 * runtime/JSGlobalData.cpp:
7652 (JSC::JSGlobalData::JSGlobalData):
7653 (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
7654 that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
7655 it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
7656 APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
7657 (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
7658 (JSC::JSGlobalData::sharedInstanceInternal):
7659 * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
7660 de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
7661 (JSGlobalData):
7662 (JSC::JSGlobalData::apiLock):
7663 * runtime/JSGlobalObject.cpp:
7664 (JSC::JSGlobalObject::~JSGlobalObject):
7665 (JSC::JSGlobalObject::init):
7666 * runtime/JSLock.cpp:
7667 (JSC):
7668 (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
7669 (JSC::GlobalJSLock::~GlobalJSLock):
7670 (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
7671 it can successfully unlock it later without it disappearing from underneath it.
7672 (JSC::JSLockHolder::~JSLockHolder):
7673 (JSC::JSLock::JSLock):
7674 (JSC::JSLock::~JSLock):
7675 (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
7676 actually waiting for long periods.
7677 (JSC::JSLock::unlock):
7678 (JSC::JSLock::currentThreadIsHoldingLock):
7679 (JSC::JSLock::dropAllLocks):
7680 (JSC::JSLock::dropAllLocksUnconditionally):
7681 (JSC::JSLock::grabAllLocks):
7682 (JSC::JSLock::DropAllLocks::DropAllLocks):
7683 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7684 * runtime/JSLock.h:
7685 (JSC):
7686 (GlobalJSLock):
7687 (JSLockHolder):
7688 (JSLock):
7689 (DropAllLocks):
7690 * runtime/WeakGCMap.h:
7691 (JSC::WeakGCMap::set):
7692 * testRegExp.cpp:
7693 (realMain):
7694
peter@chromium.org166f5bb2012-06-22 16:20:33 +000076952012-06-22 Peter Beverloo <peter@chromium.org>
7696
7697 [Chromium] Disable c++0x compatibility warnings in JavaScriptCore.gyp when building for Android
7698 https://bugs.webkit.org/show_bug.cgi?id=88853
7699
7700 Reviewed by Steve Block.
7701
7702 The Android exclusions were necessary to fix a gyp generation error, as
7703 the gcc_version variable wasn't being defined for Android. Remove these
7704 exceptions when Chromium is able to define the gcc_version variable.
7705
7706 * JavaScriptCore.gyp/JavaScriptCore.gyp:
7707
fpizlo@apple.com90011802012-06-22 01:33:30 +000077082012-06-21 Filip Pizlo <fpizlo@apple.com>
7709
7710 op_resolve_global should not prevent DFG inlining
7711 https://bugs.webkit.org/show_bug.cgi?id=89726
7712
7713 Reviewed by Gavin Barraclough.
7714
7715 * bytecode/CodeBlock.cpp:
7716 (JSC::CodeBlock::CodeBlock):
7717 (JSC::CodeBlock::shrinkToFit):
7718 * bytecode/GlobalResolveInfo.h:
7719 (JSC::GlobalResolveInfo::GlobalResolveInfo):
7720 (GlobalResolveInfo):
7721 * dfg/DFGByteCodeParser.cpp:
7722 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
7723 * dfg/DFGCapabilities.h:
7724 (JSC::DFG::canInlineOpcode):
7725 * dfg/DFGOperations.cpp:
7726 * dfg/DFGOperations.h:
7727 * dfg/DFGSpeculativeJIT.h:
7728 (JSC::DFG::SpeculativeJIT::callOperation):
7729 * dfg/DFGSpeculativeJIT32_64.cpp:
7730 (JSC::DFG::SpeculativeJIT::compile):
7731 * dfg/DFGSpeculativeJIT64.cpp:
7732 (JSC::DFG::SpeculativeJIT::compile):
7733
fpizlo@apple.com618044d2012-06-21 22:55:42 +000077342012-06-20 Filip Pizlo <fpizlo@apple.com>
7735
7736 DFG should inline 'new Array()'
7737 https://bugs.webkit.org/show_bug.cgi?id=89632
7738
7739 Reviewed by Geoffrey Garen.
7740
7741 This adds support for treating InternalFunction like intrinsics. The code
7742 to do so is actually quite clean, so I don't feel bad about perpetuating
7743 the InternalFunction vs. JSFunction-with-NativeExecutable dichotomy.
7744
7745 Currently this newfound power is only used to inline 'new Array()'.
7746
7747 * dfg/DFGByteCodeParser.cpp:
7748 (ByteCodeParser):
7749 (JSC::DFG::ByteCodeParser::handleCall):
7750 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
7751 (DFG):
7752 * dfg/DFGGraph.h:
7753 (JSC::DFG::Graph::isInternalFunctionConstant):
7754 (JSC::DFG::Graph::valueOfInternalFunctionConstant):
7755
mhahnenberg@apple.coma2373032012-06-21 22:38:39 +000077562012-06-21 Mark Hahnenberg <mhahnenberg@apple.com>
7757
7758 Adding copyrights to new files.
7759
7760 * heap/HeapTimer.cpp:
7761 * heap/HeapTimer.h:
7762 * heap/IncrementalSweeper.cpp:
7763 * heap/IncrementalSweeper.h:
7764
commit-queue@webkit.orgc8209e72012-06-21 17:34:26 +000077652012-06-21 Arnaud Renevier <arno@renevier.net>
7766
7767 make sure headers are included only once per file
7768 https://bugs.webkit.org/show_bug.cgi?id=88922
7769
7770 Reviewed by Alexey Proskuryakov.
7771
7772 * bytecode/CodeBlock.h:
7773 * heap/MachineStackMarker.cpp:
7774 * runtime/JSVariableObject.h:
7775
commit-queue@webkit.orgbff9a102012-06-21 15:46:40 +000077762012-06-21 Ryuan Choi <ryuan.choi@gmail.com>
7777
7778 [EFL][WK2] Make WebKit2/Efl headers and resources installable.
7779 https://bugs.webkit.org/show_bug.cgi?id=88207
7780
7781 Reviewed by Chang Shu.
7782
7783 * shell/CMakeLists.txt: Use ${EXEC_INSTALL_DIR} instead of hardcoding "bin"
7784
ggaren@apple.com4b67d0d2012-06-21 02:00:08 +000077852012-06-20 Geoffrey Garen <ggaren@apple.com>
7786
7787 Reduced (but did not eliminate) use of "berzerker GC"
7788 https://bugs.webkit.org/show_bug.cgi?id=89237
7789
7790 Reviewed by Gavin Barraclough.
7791
7792 (PART 1)
7793
7794 This patch turned out to be crashy, so I'm landing the non-crashy bits
7795 first.
7796
7797 This part is pre-requisite refactoring. I didn't actually turn off
7798 "berzerker GC" or turn on incremental shrinking.
7799
7800 * heap/MarkedAllocator.cpp:
7801 (JSC::MarkedAllocator::removeBlock): Make sure to clear the free list when
7802 we throw away the block we're currently allocating out of. Otherwise, we'll
7803 allocate out of a stale free list.
7804
7805 * heap/MarkedSpace.cpp:
7806 (JSC::Free::Free):
7807 (JSC::Free::operator()):
7808 (JSC::Free::returnValue): Refactored this functor to use a shared helper
7809 function, so we can share our implementation with the incremental sweeper.
7810
7811 Also changed to freeing individual blocks immediately instead of linking
7812 them into a list for later freeing. This makes the programming interface
7813 simpler, and it's slightly more efficient to boot.
7814
7815 (JSC::MarkedSpace::~MarkedSpace): Updated for rename.
7816
7817 (JSC::MarkedSpace::freeBlock):
7818 (JSC::MarkedSpace::freeOrShrinkBlock): New helper functions to share behavior
7819 with the incremental sweeper.
7820
7821 (JSC::MarkedSpace::shrink): Updated for new functor behavior.
7822
7823 * heap/MarkedSpace.h: Statically typed languages are awesome.
7824
fpizlo@apple.com8c462122012-06-20 21:07:33 +000078252012-06-20 Filip Pizlo <fpizlo@apple.com>
7826
fpizlo@apple.com3bcb2112012-06-21 01:38:49 +00007827 DFG should optimize ResolveGlobal
7828 https://bugs.webkit.org/show_bug.cgi?id=89617
7829
7830 Reviewed by Oliver Hunt.
7831
7832 This adds inlining of ResolveGlobal accesses that are known monomorphic. It also
7833 adds the specific function optimization to ResolveGlobal, when it is inlined. And,
7834 it makes internal functions act like specific functions, since that will be the
7835 most common use-case of this optimization.
7836
7837 This is only a slighy speed-up (sub 1%), since we don't yet do the obvious thing
7838 with this optimization, which is to completely inline common "globally resolved"
7839 function and constructor calls, like "new Array()".
7840
7841 * CMakeLists.txt:
7842 * GNUmakefile.list.am:
7843 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7844 * JavaScriptCore.xcodeproj/project.pbxproj:
7845 * Target.pri:
7846 * bytecode/CodeBlock.cpp:
7847 (JSC::CodeBlock::globalResolveInfoForBytecodeOffset):
7848 * bytecode/CodeBlock.h:
7849 (CodeBlock):
7850 (JSC::CodeBlock::numberOfGlobalResolveInfos):
7851 * bytecode/GlobalResolveInfo.h:
7852 (JSC::getGlobalResolveInfoBytecodeOffset):
7853 (JSC):
7854 * bytecode/ResolveGlobalStatus.cpp: Added.
7855 (JSC):
7856 (JSC::computeForStructure):
7857 (JSC::computeForLLInt):
7858 (JSC::ResolveGlobalStatus::computeFor):
7859 * bytecode/ResolveGlobalStatus.h: Added.
7860 (JSC):
7861 (ResolveGlobalStatus):
7862 (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
7863 (JSC::ResolveGlobalStatus::state):
7864 (JSC::ResolveGlobalStatus::isSet):
7865 (JSC::ResolveGlobalStatus::operator!):
7866 (JSC::ResolveGlobalStatus::isSimple):
7867 (JSC::ResolveGlobalStatus::takesSlowPath):
7868 (JSC::ResolveGlobalStatus::structure):
7869 (JSC::ResolveGlobalStatus::offset):
7870 (JSC::ResolveGlobalStatus::specificValue):
7871 * dfg/DFGByteCodeParser.cpp:
7872 (ByteCodeParser):
7873 (JSC::DFG::ByteCodeParser::handleGetByOffset):
7874 (DFG):
7875 (JSC::DFG::ByteCodeParser::handleGetById):
7876 (JSC::DFG::ByteCodeParser::parseBlock):
7877 * runtime/JSObject.cpp:
7878 (JSC::getCallableObjectSlow):
7879 (JSC):
7880 (JSC::JSObject::put):
7881 (JSC::JSObject::putDirectVirtual):
7882 (JSC::JSObject::putDirectAccessor):
7883 * runtime/JSObject.h:
7884 (JSC):
7885 (JSC::getCallableObject):
7886 (JSC::JSObject::putOwnDataProperty):
7887 (JSC::JSObject::putDirect):
7888 (JSC::JSObject::putDirectWithoutTransition):
7889
78902012-06-20 Filip Pizlo <fpizlo@apple.com>
7891
fpizlo@apple.com2e368f72012-06-20 23:55:18 +00007892 Functions on global objects should be specializable
7893 https://bugs.webkit.org/show_bug.cgi?id=89615
7894
7895 Reviewed by Oliver Hunt.
7896
7897 I tested to see if this brought back the bug in https://bugs.webkit.org/show_bug.cgi?id=33343,
7898 and it didn't. Bug 33343 was the reason why we disabled global object function specialization
7899 to begin with. So I'm guessing this is safe.
7900
7901 * runtime/JSGlobalObject.cpp:
7902 (JSC::JSGlobalObject::init):
7903
79042012-06-20 Filip Pizlo <fpizlo@apple.com>
7905
fpizlo@apple.com8c462122012-06-20 21:07:33 +00007906 build-webkit failure due to illegal 32-bit integer constants in code
7907 generated by offlineasm
7908 https://bugs.webkit.org/show_bug.cgi?id=89347
7909
7910 Reviewed by Geoffrey Garen.
7911
7912 The offending constants are the magic numbers used by offlineasm to find
7913 offsets in the generated machine code. Added code to turn them into what
7914 the C++ compiler will believe to be valid 32-bit values.
7915
7916 * offlineasm/offsets.rb:
7917
ggaren@apple.com30ef2b32012-06-20 18:24:02 +000079182012-06-19 Geoffrey Garen <ggaren@apple.com>
7919
7920 Made the incremental sweeper more aggressive
7921 https://bugs.webkit.org/show_bug.cgi?id=89527
7922
7923 Reviewed by Oliver Hunt.
7924
7925 This is a pre-requisite to getting rid of "berzerker GC" because we need
7926 the sweeper to reclaim memory in a timely fashion, or we'll see a memory
7927 footprint regression.
7928
7929 * heap/IncrementalSweeper.h:
7930 * heap/IncrementalSweeper.cpp:
7931 (JSC::IncrementalSweeper::scheduleTimer): Since the time slice is predictable,
7932 no need to use a data member to record it.
7933
7934 (JSC::IncrementalSweeper::doSweep): Sweep as many blocks as we can in a
7935 small time slice. This is better than sweeping only one block per timer
7936 fire because that strategy has a heavy timer overhead, and artificially
7937 delays memory reclamation.
7938
fpizlo@apple.com3d517672012-06-20 17:48:23 +000079392012-06-20 Filip Pizlo <fpizlo@apple.com>
7940
7941 DFG should be able to print disassembly interleaved with the IR
7942 https://bugs.webkit.org/show_bug.cgi?id=89551
7943
7944 Reviewed by Geoffrey Garen.
fpizlo@apple.come245b3f2012-06-20 17:51:07 +00007945
7946 This change also removes running Dominators unconditionally on every DFG
7947 compile. Dominators are designed to be computed on-demand, and currently
7948 the only demand is graph dumps.
fpizlo@apple.com3d517672012-06-20 17:48:23 +00007949
7950 * CMakeLists.txt:
7951 * GNUmakefile.list.am:
7952 * JavaScriptCore.xcodeproj/project.pbxproj:
7953 * Target.pri:
7954 * assembler/ARMv7Assembler.h:
7955 (JSC::ARMv7Assembler::labelIgnoringWatchpoints):
7956 (ARMv7Assembler):
7957 * assembler/AbstractMacroAssembler.h:
7958 (AbstractMacroAssembler):
7959 (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
7960 * assembler/X86Assembler.h:
7961 (X86Assembler):
7962 (JSC::X86Assembler::labelIgnoringWatchpoints):
7963 * dfg/DFGCommon.h:
7964 (JSC::DFG::shouldShowDisassembly):
7965 (DFG):
7966 * dfg/DFGDisassembler.cpp: Added.
7967 (DFG):
7968 (JSC::DFG::Disassembler::Disassembler):
7969 (JSC::DFG::Disassembler::dump):
7970 (JSC::DFG::Disassembler::dumpDisassembly):
7971 * dfg/DFGDisassembler.h: Added.
7972 (DFG):
7973 (Disassembler):
7974 (JSC::DFG::Disassembler::setStartOfCode):
7975 (JSC::DFG::Disassembler::setForBlock):
7976 (JSC::DFG::Disassembler::setForNode):
7977 (JSC::DFG::Disassembler::setEndOfMainPath):
7978 (JSC::DFG::Disassembler::setEndOfCode):
7979 * dfg/DFGDriver.cpp:
7980 (JSC::DFG::compile):
7981 * dfg/DFGGraph.cpp:
7982 (JSC::DFG::Graph::dumpCodeOrigin):
7983 (JSC::DFG::Graph::amountOfNodeWhiteSpace):
7984 (DFG):
7985 (JSC::DFG::Graph::printNodeWhiteSpace):
7986 (JSC::DFG::Graph::dump):
7987 (JSC::DFG::Graph::dumpBlockHeader):
7988 * dfg/DFGGraph.h:
7989 * dfg/DFGJITCompiler.cpp:
7990 (JSC::DFG::JITCompiler::JITCompiler):
7991 (DFG):
7992 (JSC::DFG::JITCompiler::compile):
7993 (JSC::DFG::JITCompiler::compileFunction):
7994 * dfg/DFGJITCompiler.h:
7995 (JITCompiler):
7996 (JSC::DFG::JITCompiler::setStartOfCode):
7997 (JSC::DFG::JITCompiler::setForBlock):
7998 (JSC::DFG::JITCompiler::setForNode):
7999 (JSC::DFG::JITCompiler::setEndOfMainPath):
8000 (JSC::DFG::JITCompiler::setEndOfCode):
8001 * dfg/DFGNode.h:
8002 (Node):
8003 (JSC::DFG::Node::willHaveCodeGen):
8004 * dfg/DFGNodeFlags.cpp:
8005 (JSC::DFG::nodeFlagsAsString):
8006 * dfg/DFGSpeculativeJIT.cpp:
8007 (JSC::DFG::SpeculativeJIT::compile):
8008 * dfg/DFGSpeculativeJIT.h:
8009 (SpeculativeJIT):
8010 * runtime/Options.cpp:
8011 (Options):
8012 (JSC::Options::initializeOptions):
8013 * runtime/Options.h:
8014 (Options):
8015
fpizlo@apple.com2adf5272012-06-20 01:33:30 +000080162012-06-19 Filip Pizlo <fpizlo@apple.com>
8017
8018 JSC should be able to show disassembly for all generated JIT code
8019 https://bugs.webkit.org/show_bug.cgi?id=89536
8020
8021 Reviewed by Gavin Barraclough.
8022
8023 Now instead of doing linkBuffer.finalizeCode(), you do
8024 FINALIZE_CODE(linkBuffer, (... explanation ...)). FINALIZE_CODE() then
8025 prints your explanation and the disassembled code, if
8026 Options::showDisassembly is set to true.
8027
8028 * CMakeLists.txt:
8029 * GNUmakefile.list.am:
8030 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8031 * JavaScriptCore.xcodeproj/project.pbxproj:
8032 * Target.pri:
8033 * assembler/LinkBuffer.cpp: Added.
8034 (JSC):
8035 (JSC::LinkBuffer::finalizeCodeWithoutDisassembly):
8036 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
8037 (JSC::LinkBuffer::linkCode):
8038 (JSC::LinkBuffer::performFinalization):
8039 (JSC::LinkBuffer::dumpLinkStatistics):
8040 (JSC::LinkBuffer::dumpCode):
8041 * assembler/LinkBuffer.h:
8042 (LinkBuffer):
8043 (JSC):
8044 * assembler/MacroAssemblerCodeRef.h:
8045 (JSC::MacroAssemblerCodeRef::tryToDisassemble):
8046 (MacroAssemblerCodeRef):
8047 * dfg/DFGJITCompiler.cpp:
8048 (JSC::DFG::JITCompiler::compile):
8049 (JSC::DFG::JITCompiler::compileFunction):
8050 * dfg/DFGOSRExitCompiler.cpp:
8051 * dfg/DFGRepatch.cpp:
8052 (JSC::DFG::generateProtoChainAccessStub):
8053 (JSC::DFG::tryCacheGetByID):
8054 (JSC::DFG::tryBuildGetByIDList):
8055 (JSC::DFG::emitPutReplaceStub):
8056 (JSC::DFG::emitPutTransitionStub):
8057 * dfg/DFGThunks.cpp:
8058 (JSC::DFG::osrExitGenerationThunkGenerator):
8059 * disassembler/Disassembler.h:
8060 (JSC):
8061 (JSC::tryToDisassemble):
8062 * disassembler/UDis86Disassembler.cpp:
8063 (JSC::tryToDisassemble):
8064 * jit/JIT.cpp:
8065 (JSC::JIT::privateCompile):
8066 * jit/JITCode.h:
8067 (JSC::JITCode::tryToDisassemble):
8068 * jit/JITOpcodes.cpp:
8069 (JSC::JIT::privateCompileCTIMachineTrampolines):
8070 * jit/JITOpcodes32_64.cpp:
8071 (JSC::JIT::privateCompileCTIMachineTrampolines):
8072 (JSC::JIT::privateCompileCTINativeCall):
8073 * jit/JITPropertyAccess.cpp:
8074 (JSC::JIT::stringGetByValStubGenerator):
8075 (JSC::JIT::privateCompilePutByIdTransition):
8076 (JSC::JIT::privateCompilePatchGetArrayLength):
8077 (JSC::JIT::privateCompileGetByIdProto):
8078 (JSC::JIT::privateCompileGetByIdSelfList):
8079 (JSC::JIT::privateCompileGetByIdProtoList):
8080 (JSC::JIT::privateCompileGetByIdChainList):
8081 (JSC::JIT::privateCompileGetByIdChain):
8082 * jit/JITPropertyAccess32_64.cpp:
8083 (JSC::JIT::stringGetByValStubGenerator):
8084 (JSC::JIT::privateCompilePutByIdTransition):
8085 (JSC::JIT::privateCompilePatchGetArrayLength):
8086 (JSC::JIT::privateCompileGetByIdProto):
8087 (JSC::JIT::privateCompileGetByIdSelfList):
8088 (JSC::JIT::privateCompileGetByIdProtoList):
8089 (JSC::JIT::privateCompileGetByIdChainList):
8090 (JSC::JIT::privateCompileGetByIdChain):
8091 * jit/SpecializedThunkJIT.h:
8092 (JSC::SpecializedThunkJIT::finalize):
8093 * jit/ThunkGenerators.cpp:
8094 (JSC::charCodeAtThunkGenerator):
8095 (JSC::charAtThunkGenerator):
8096 (JSC::fromCharCodeThunkGenerator):
8097 (JSC::sqrtThunkGenerator):
8098 (JSC::floorThunkGenerator):
8099 (JSC::ceilThunkGenerator):
8100 (JSC::roundThunkGenerator):
8101 (JSC::expThunkGenerator):
8102 (JSC::logThunkGenerator):
8103 (JSC::absThunkGenerator):
8104 (JSC::powThunkGenerator):
8105 * llint/LLIntThunks.cpp:
8106 (JSC::LLInt::generateThunkWithJumpTo):
8107 (JSC::LLInt::functionForCallEntryThunkGenerator):
8108 (JSC::LLInt::functionForConstructEntryThunkGenerator):
8109 (JSC::LLInt::functionForCallArityCheckThunkGenerator):
8110 (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
8111 (JSC::LLInt::evalEntryThunkGenerator):
8112 (JSC::LLInt::programEntryThunkGenerator):
8113 * runtime/Options.cpp:
8114 (Options):
8115 (JSC::Options::initializeOptions):
8116 * runtime/Options.h:
8117 (Options):
8118 * yarr/YarrJIT.cpp:
8119 (JSC::Yarr::YarrGenerator::compile):
8120
mhahnenberg@apple.com7ffd08d2012-06-20 00:20:30 +000081212012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
8122
8123 [Qt][Mac] REGRESSION(r120742): It broke the build
8124 https://bugs.webkit.org/show_bug.cgi?id=89516
8125
8126 Reviewed by Geoffrey Garen.
8127
8128 Removing GCActivityCallbackCF.cpp because it doesn't mesh well with cross-platform
8129 code on Darwin (e.g. Qt). We now use plain ol' vanilla ifdefs to handle platforms
8130 without CF support. These if-defs will probably disappear in the future when we
8131 use cross-platform timers in HeapTimer.
8132
8133 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8134 * JavaScriptCore.xcodeproj/project.pbxproj:
8135 * runtime/GCActivityCallback.cpp:
8136 (JSC):
8137 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8138 (JSC::DefaultGCActivityCallback::doWork):
8139 (JSC::DefaultGCActivityCallback::scheduleTimer):
8140 (JSC::DefaultGCActivityCallback::cancelTimer):
8141 (JSC::DefaultGCActivityCallback::didAllocate):
8142 (JSC::DefaultGCActivityCallback::willCollect):
8143 (JSC::DefaultGCActivityCallback::cancel):
8144 * runtime/GCActivityCallbackCF.cpp: Removed.
8145
fpizlo@apple.com152abff2012-06-19 23:10:12 +000081462012-06-19 Filip Pizlo <fpizlo@apple.com>
8147
8148 DFG CFA forgets to notify subsequent phases of found constants if it proves LogicalNot to be a constant
8149 https://bugs.webkit.org/show_bug.cgi?id=89511
8150 <rdar://problem/11700089>
8151
8152 Reviewed by Geoffrey Garen.
8153
8154 * dfg/DFGAbstractState.cpp:
8155 (JSC::DFG::AbstractState::execute):
8156
commit-queue@webkit.orgb6833002012-06-19 21:06:08 +000081572012-06-19 Mark Lam <mark.lam@apple.com>
8158
8159 CodeBlock::needsCallReturnIndices() is no longer needed.
8160 https://bugs.webkit.org/show_bug.cgi?id=89490
8161
8162 Reviewed by Geoffrey Garen.
8163
8164 * bytecode/CodeBlock.h:
8165 (JSC::CodeBlock::needsCallReturnIndices): removed.
8166 * dfg/DFGJITCompiler.cpp:
8167 (JSC::DFG::JITCompiler::link):
8168 * jit/JIT.cpp:
8169 (JSC::JIT::privateCompile):
8170
fpizlo@apple.com861ea7b2012-06-19 20:05:06 +000081712012-06-19 Filip Pizlo <fpizlo@apple.com>
8172
8173 Unreviewed, try to fix Windows build.
8174
8175 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
8176
fpizlo@apple.com01c2a192012-06-19 19:42:55 +000081772012-06-17 Filip Pizlo <fpizlo@apple.com>
8178
8179 It should be possible to look at disassembly
8180 https://bugs.webkit.org/show_bug.cgi?id=89319
8181
8182 Reviewed by Sam Weinig.
8183
8184 This imports the udis86 disassembler library. The library is placed
8185 behind an abstraction in disassembler/Disassembler.h, so that we can
8186 in the future use other disassemblers (for other platforms) whenever
8187 appropriate. As a first step, the disassembler is being invoked for
8188 DFG verbose dumps.
8189
8190 If we ever want to merge a new version of udis86 in the future, I've
8191 made notes about changes I made to the library in
8192 disassembler/udis86/differences.txt.
8193
8194 * CMakeLists.txt:
8195 * DerivedSources.make:
8196 * GNUmakefile.list.am:
8197 * JavaScriptCore.pri:
8198 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8199 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
8200 * JavaScriptCore.xcodeproj/project.pbxproj:
8201 * dfg/DFGJITCompiler.cpp:
8202 (JSC::DFG::JITCompiler::compile):
8203 (JSC::DFG::JITCompiler::compileFunction):
8204 * disassembler: Added.
8205 * disassembler/Disassembler.h: Added.
8206 (JSC):
8207 (JSC::tryToDisassemble):
8208 * disassembler/UDis86Disassembler.cpp: Added.
8209 (JSC):
8210 (JSC::tryToDisassemble):
8211 * disassembler/udis86: Added.
8212 * disassembler/udis86/differences.txt: Added.
8213 * disassembler/udis86/itab.py: Added.
8214 (UdItabGenerator):
8215 (UdItabGenerator.__init__):
8216 (UdItabGenerator.toGroupId):
8217 (UdItabGenerator.genLookupTable):
8218 (UdItabGenerator.genLookupTableList):
8219 (UdItabGenerator.genInsnTable):
8220 (genItabH):
8221 (genItabH.UD_ITAB_H):
8222 (genItabC):
8223 (genItab):
8224 (main):
8225 * disassembler/udis86/optable.xml: Added.
8226 * disassembler/udis86/ud_opcode.py: Added.
8227 (UdOpcodeTables):
8228 (UdOpcodeTables.sizeOfTable):
8229 (UdOpcodeTables.nameOfTable):
8230 (UdOpcodeTables.updateTable):
8231 (UdOpcodeTables.Insn):
8232 (UdOpcodeTables.Insn.__init__):
8233 (UdOpcodeTables.Insn.__init__.opcode):
8234 (UdOpcodeTables.parse):
8235 (UdOpcodeTables.addInsnDef):
8236 (UdOpcodeTables.print_table):
8237 (UdOpcodeTables.print_tree):
8238 * disassembler/udis86/ud_optable.py: Added.
8239 (UdOptableXmlParser):
8240 (UdOptableXmlParser.parseDef):
8241 (UdOptableXmlParser.parse):
8242 (printFn):
8243 (parse):
8244 (main):
8245 * disassembler/udis86/udis86.c: Added.
8246 (ud_init):
8247 (ud_disassemble):
8248 (ud_set_mode):
8249 (ud_set_vendor):
8250 (ud_set_pc):
8251 (ud):
8252 (ud_insn_asm):
8253 (ud_insn_off):
8254 (ud_insn_hex):
8255 (ud_insn_ptr):
8256 (ud_insn_len):
8257 * disassembler/udis86/udis86.h: Added.
8258 * disassembler/udis86/udis86_decode.c: Added.
8259 (eff_adr_mode):
8260 (ud_lookup_mnemonic):
8261 (decode_prefixes):
8262 (modrm):
8263 (resolve_operand_size):
8264 (resolve_mnemonic):
8265 (decode_a):
8266 (decode_gpr):
8267 (resolve_gpr64):
8268 (resolve_gpr32):
8269 (resolve_reg):
8270 (decode_imm):
8271 (decode_modrm_reg):
8272 (decode_modrm_rm):
8273 (decode_o):
8274 (decode_operand):
8275 (decode_operands):
8276 (clear_insn):
8277 (resolve_mode):
8278 (gen_hex):
8279 (decode_insn):
8280 (decode_3dnow):
8281 (decode_ssepfx):
8282 (decode_ext):
8283 (decode_opcode):
8284 (ud_decode):
8285 * disassembler/udis86/udis86_decode.h: Added.
8286 (ud_itab_entry_operand):
8287 (ud_itab_entry):
8288 (ud_lookup_table_list_entry):
8289 (sse_pfx_idx):
8290 (mode_idx):
8291 (modrm_mod_idx):
8292 (vendor_idx):
8293 (is_group_ptr):
8294 (group_idx):
8295 * disassembler/udis86/udis86_extern.h: Added.
8296 * disassembler/udis86/udis86_input.c: Added.
8297 (inp_buff_hook):
8298 (inp_file_hook):
8299 (ud):
8300 (ud_set_user_opaque_data):
8301 (ud_get_user_opaque_data):
8302 (ud_set_input_buffer):
8303 (ud_set_input_file):
8304 (ud_input_skip):
8305 (ud_input_end):
8306 (ud_inp_next):
8307 (ud_inp_back):
8308 (ud_inp_peek):
8309 (ud_inp_move):
8310 (ud_inp_uint8):
8311 (ud_inp_uint16):
8312 (ud_inp_uint32):
8313 (ud_inp_uint64):
8314 * disassembler/udis86/udis86_input.h: Added.
8315 * disassembler/udis86/udis86_itab_holder.c: Added.
8316 * disassembler/udis86/udis86_syn-att.c: Added.
8317 (opr_cast):
8318 (gen_operand):
8319 (ud_translate_att):
8320 * disassembler/udis86/udis86_syn-intel.c: Added.
8321 (opr_cast):
8322 (gen_operand):
8323 (ud_translate_intel):
8324 * disassembler/udis86/udis86_syn.c: Added.
8325 * disassembler/udis86/udis86_syn.h: Added.
8326 (mkasm):
8327 * disassembler/udis86/udis86_types.h: Added.
8328 (ud_operand):
8329 (ud):
8330 * jit/JITCode.h:
8331 (JITCode):
8332 (JSC::JITCode::tryToDisassemble):
8333
mhahnenberg@apple.coma7ec41b2012-06-19 19:17:31 +000083342012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
8335
8336 GCActivityCallback and IncrementalSweeper should share code
8337 https://bugs.webkit.org/show_bug.cgi?id=89400
8338
8339 Reviewed by Geoffrey Garen.
8340
8341 A lot of functionality is duplicated between GCActivityCallback and IncrementalSweeper.
8342 We should extract the common functionality out into a separate class that both of them
8343 can inherit from. This refactoring will be an even greater boon when we add the ability
8344 to shut these two agents down in a thread-safe fashion
8345
8346 * CMakeLists.txt:
8347 * GNUmakefile.list.am:
8348 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8349 * JavaScriptCore.xcodeproj/project.pbxproj:
8350 * Target.pri:
8351 * heap/Heap.cpp:
8352 (JSC::Heap::Heap): Move initialization down so that the JSGlobalData has a valid Heap when
8353 we're initializing the GCActivityCallback and the IncrementalSweeper.
8354 * heap/Heap.h:
8355 (Heap):
8356 * heap/HeapTimer.cpp: Added.
8357 (JSC):
8358 (JSC::HeapTimer::HeapTimer): Initialize the various base class data that
8359 DefaultGCActivityCallback::commonConstructor() used to do.
8360 (JSC::HeapTimer::~HeapTimer): Call to invalidate().
8361 (JSC::HeapTimer::synchronize): Same functionality as the old DefaultGCActivityCallback::synchronize().
8362 Virtual so that non-CF subclasses can override.
8363 (JSC::HeapTimer::invalidate): Tears down the runloop timer to prevent any future firing.
8364 (JSC::HeapTimer::timerDidFire): Callback to pass to the timer function. Casts and calls the virtual doWork().
8365 * heap/HeapTimer.h: Added. This is the class that serves as the common base class for
8366 both GCActivityCallback and IncrementalSweeper. It handles setting up and tearing down run loops and synchronizing
8367 across threads for its subclasses.
8368 (JSC):
8369 (HeapTimer):
8370 * heap/IncrementalSweeper.cpp: Changes to accomodate the extraction of common functionality
8371 between IncrementalSweeper and GCActivityCallback into a common ancestor.
8372 (JSC):
8373 (JSC::IncrementalSweeper::doWork):
8374 (JSC::IncrementalSweeper::IncrementalSweeper):
8375 (JSC::IncrementalSweeper::cancelTimer):
8376 (JSC::IncrementalSweeper::create):
8377 * heap/IncrementalSweeper.h:
8378 (IncrementalSweeper):
8379 * runtime/GCActivityCallback.cpp:
8380 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8381 (JSC::DefaultGCActivityCallback::doWork):
8382 * runtime/GCActivityCallback.h:
8383 (GCActivityCallback):
8384 (JSC::GCActivityCallback::willCollect):
8385 (JSC::GCActivityCallback::GCActivityCallback):
8386 (JSC):
8387 (DefaultGCActivityCallback): Remove the platform data struct. The platform data should be kept in
8388 the class itself so as to be accessible by doWork(). Most of the platform data for CF is kept in
8389 HeapTimer anyways, so we only need the m_delay field now.
8390 * runtime/GCActivityCallbackBlackBerry.cpp:
8391 (JSC):
8392 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8393 (JSC::DefaultGCActivityCallback::doWork):
8394 (JSC::DefaultGCActivityCallback::didAllocate):
8395 * runtime/GCActivityCallbackCF.cpp:
8396 (JSC):
8397 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8398 (JSC::DefaultGCActivityCallback::doWork):
8399 (JSC::DefaultGCActivityCallback::scheduleTimer):
8400 (JSC::DefaultGCActivityCallback::cancelTimer):
8401 (JSC::DefaultGCActivityCallback::didAllocate):
8402 (JSC::DefaultGCActivityCallback::willCollect):
8403 (JSC::DefaultGCActivityCallback::cancel):
8404
8405
commit-queue@webkit.orgf5584612012-06-19 09:13:52 +000084062012-06-19 Mike West <mkwst@chromium.org>
8407
8408 Introduce ENABLE_CSP_NEXT configuration flag.
8409 https://bugs.webkit.org/show_bug.cgi?id=89300
8410
8411 Reviewed by Adam Barth.
8412
8413 The 1.0 draft of the Content Security Policy spec is just about to
8414 move to Last Call. We'll hide work on the upcoming 1.1 spec behind
8415 this ENABLE flag, disabled by default.
8416
8417 Spec: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html
8418
8419 * Configurations/FeatureDefines.xcconfig:
8420
commit-queue@webkit.org3e0a1a02012-06-19 06:07:28 +000084212012-06-18 Mark Lam <mark.lam@apple.com>
8422
8423 Changed JSC to always record line number information so that error.stack
8424 and window.onerror() can report proper line numbers.
8425 https://bugs.webkit.org/show_bug.cgi?id=89410
8426
8427 Reviewed by Geoffrey Garen.
8428
8429 * bytecode/CodeBlock.cpp:
8430 (JSC::CodeBlock::CodeBlock):
8431 (JSC::CodeBlock::lineNumberForBytecodeOffset):
8432 (JSC::CodeBlock::shrinkToFit): m_lineInfo is now available unconditionally.
8433
8434 * bytecode/CodeBlock.h:
8435 (JSC::CodeBlock::addLineInfo):
8436 (JSC::CodeBlock::hasLineInfo): Unused. Now removed.
8437 (JSC::CodeBlock::needsCallReturnIndices):
8438 (CodeBlock):
8439 (RareData): Hoisted m_lineInfo out of m_rareData. m_lineInfo is now
8440 filled in unconditionally.
8441
8442 * bytecompiler/BytecodeGenerator.h:
8443 (JSC::BytecodeGenerator::addLineInfo):
8444
aestes@apple.comf6d51392012-06-19 03:32:30 +000084452012-06-18 Andy Estes <aestes@apple.com>
8446
aestes@apple.com6cc46942012-06-19 03:34:03 +00008447 Fix r120663, which didn't land the change that was reviewed.
8448
84492012-06-18 Andy Estes <aestes@apple.com>
8450
aestes@apple.comf6d51392012-06-19 03:32:30 +00008451 [JSC] In JSGlobalData.cpp, enableAssembler() sometimes leaks two CF objects
8452 https://bugs.webkit.org/show_bug.cgi?id=89415
8453
8454 Reviewed by Sam Weinig.
8455
8456 In the case where canUseJIT was a non-NULL CFBooleanRef,
8457 enableAssembler() would leak both canUseJITKey and canUseJIT by
8458 returning before calling CFRelease. Fix this by using RetainPtr.
8459
8460 * runtime/JSGlobalData.cpp:
8461 (JSC::enableAssembler):
8462
ggaren@apple.com2318dbc2012-06-18 04:35:21 +000084632012-06-17 Geoffrey Garen <ggaren@apple.com>
8464
8465 GC copy phase spends needless cycles zero-filling blocks
8466 https://bugs.webkit.org/show_bug.cgi?id=89128
8467
8468 Reviewed by Gavin Barraclough.
8469
8470 We only need to zero-fill when we're allocating memory that might not
8471 get fully initialized before GC.
8472
8473 * heap/CopiedBlock.h:
8474 (JSC::CopiedBlock::createNoZeroFill):
8475 (JSC::CopiedBlock::create): Added a way to create without zero-filling.
8476 This is our optimization.
8477
8478 (JSC::CopiedBlock::zeroFillToEnd):
8479 (JSC::CopiedBlock::CopiedBlock): Split zero-filling out from creation,
8480 so we can sometimes create without zero-filling.
8481
8482 * heap/CopiedSpace.cpp:
8483 (JSC::CopiedSpace::init):
8484 (JSC::CopiedSpace::tryAllocateSlowCase):
8485 (JSC::CopiedSpace::doneCopying): Renamed addNewBlock to allocateBlock()
8486 to clarify that the new block is always newly-allocated.
8487
8488 (JSC::CopiedSpace::doneFillingBlock): Make sure to zero-fill to the end
8489 of a block that might be used in the future for allocation. (Most of the
8490 time, this is a no-op, since we've already filled the block completely.)
8491
8492 (JSC::CopiedSpace::getFreshBlock): Removed this function because the
8493 abstraction of "allocation must succeed" is no longer useful.
8494
8495 * heap/CopiedSpace.h: Updated declarations to match.
8496
8497 * heap/CopiedSpaceInlineMethods.h:
8498 (JSC::CopiedSpace::allocateBlockForCopyingPhase): New function, which
8499 knows that it can skip zero-filling.
8500
8501 Added tighter scoping to our lock, to improve parallelism.
8502
8503 (JSC::CopiedSpace::allocateBlock): Folded getFreshBlock functionality
8504 into this function, for simplicity.
8505
8506 * heap/MarkStack.cpp:
8507 (JSC::SlotVisitor::startCopying):
8508 (JSC::SlotVisitor::allocateNewSpace): Use our new zero-fill-free helper
8509 function for great good.
8510
fpizlo@apple.com73df57b2012-06-18 01:59:18 +000085112012-06-17 Filip Pizlo <fpizlo@apple.com>
8512
8513 DFG should attempt to use structure watchpoints for all inlined get_by_id's and put_by_id's
8514 https://bugs.webkit.org/show_bug.cgi?id=89316
8515
8516 Reviewed by Oliver Hunt.
8517
8518 * dfg/DFGByteCodeParser.cpp:
8519 (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
8520 (ByteCodeParser):
8521 (JSC::DFG::ByteCodeParser::handleGetById):
8522 (JSC::DFG::ByteCodeParser::parseBlock):
8523
commit-queue@webkit.orgf8968a72012-06-15 22:24:21 +000085242012-06-15 Yong Li <yoli@rim.com>
8525
8526 [BlackBerry] Put platform-specific GC policy in GCActivityCallback
8527 https://bugs.webkit.org/show_bug.cgi?id=89236
8528
8529 Reviewed by Rob Buis.
8530
8531 Add GCActivityCallbackBlackBerry.cpp and implement platform-specific
8532 low memory GC policy there.
8533
8534 * PlatformBlackBerry.cmake:
8535 * heap/Heap.h:
8536 (JSC::Heap::isSafeToCollect): Added.
8537 * runtime/GCActivityCallbackBlackBerry.cpp: Added.
8538 (JSC):
8539 (JSC::DefaultGCActivityCallbackPlatformData::DefaultGCActivityCallbackPlatformData):
8540 (DefaultGCActivityCallbackPlatformData):
8541 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8542 (JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
8543 (JSC::DefaultGCActivityCallback::didAllocate):
8544 (JSC::DefaultGCActivityCallback::willCollect):
8545 (JSC::DefaultGCActivityCallback::synchronize):
8546 (JSC::DefaultGCActivityCallback::cancel):
8547
fpizlo@apple.com666a2d52012-06-15 22:21:44 +000085482012-06-15 Filip Pizlo <fpizlo@apple.com>
8549
8550 DFG should be able to set watchpoints on structure transitions in the
8551 method check prototype chain
8552 https://bugs.webkit.org/show_bug.cgi?id=89058
8553
8554 Adding the same assertion to 32-bit that I added to 64-bit. This change
8555 does not affect correctness but it's a good thing for assertion coverage.
8556
8557 * dfg/DFGSpeculativeJIT32_64.cpp:
8558 (JSC::DFG::SpeculativeJIT::compile):
8559
fpizlo@apple.comb75911b2012-06-13 20:53:52 +000085602012-06-13 Filip Pizlo <fpizlo@apple.com>
8561
fpizlo@apple.com04e41152012-06-15 22:14:53 +00008562 DFG should be able to set watchpoints on structure transitions in the
8563 method check prototype chain
8564 https://bugs.webkit.org/show_bug.cgi?id=89058
8565
8566 Reviewed by Gavin Barraclough.
8567
8568 This adds the ability to set watchpoints on Structures, and then does
8569 the most modest thing we can do with this ability: the DFG now sets
8570 watchpoints on structure transitions in the prototype chain of method
8571 checks.
8572
8573 This appears to be a >1% speed-up on V8.
8574
8575 * bytecode/PutByIdStatus.cpp:
8576 (JSC::PutByIdStatus::computeFromLLInt):
8577 (JSC::PutByIdStatus::computeFor):
8578 * bytecode/StructureSet.h:
8579 (JSC::StructureSet::containsOnly):
8580 (StructureSet):
8581 * bytecode/Watchpoint.cpp:
8582 (JSC::WatchpointSet::WatchpointSet):
8583 (JSC::InlineWatchpointSet::add):
8584 (JSC):
8585 (JSC::InlineWatchpointSet::inflateSlow):
8586 (JSC::InlineWatchpointSet::freeFat):
8587 * bytecode/Watchpoint.h:
8588 (WatchpointSet):
8589 (JSC):
8590 (InlineWatchpointSet):
8591 (JSC::InlineWatchpointSet::InlineWatchpointSet):
8592 (JSC::InlineWatchpointSet::~InlineWatchpointSet):
8593 (JSC::InlineWatchpointSet::hasBeenInvalidated):
8594 (JSC::InlineWatchpointSet::isStillValid):
8595 (JSC::InlineWatchpointSet::startWatching):
8596 (JSC::InlineWatchpointSet::notifyWrite):
8597 (JSC::InlineWatchpointSet::isFat):
8598 (JSC::InlineWatchpointSet::fat):
8599 (JSC::InlineWatchpointSet::inflate):
8600 * dfg/DFGAbstractState.cpp:
8601 (JSC::DFG::AbstractState::execute):
8602 * dfg/DFGByteCodeParser.cpp:
8603 (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
8604 (ByteCodeParser):
8605 (JSC::DFG::ByteCodeParser::parseBlock):
8606 * dfg/DFGCSEPhase.cpp:
8607 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
8608 (CSEPhase):
8609 (JSC::DFG::CSEPhase::performNodeCSE):
8610 * dfg/DFGCommon.h:
8611 * dfg/DFGGraph.cpp:
8612 (JSC::DFG::Graph::dump):
8613 * dfg/DFGGraph.h:
8614 (JSC::DFG::Graph::isCellConstant):
8615 * dfg/DFGJITCompiler.h:
8616 (JSC::DFG::JITCompiler::addWeakReferences):
8617 (JITCompiler):
8618 * dfg/DFGNode.h:
8619 (JSC::DFG::Node::hasStructure):
8620 (Node):
8621 (JSC::DFG::Node::structure):
8622 * dfg/DFGNodeType.h:
8623 (DFG):
8624 * dfg/DFGPredictionPropagationPhase.cpp:
8625 (JSC::DFG::PredictionPropagationPhase::propagate):
8626 * dfg/DFGRepatch.cpp:
8627 (JSC::DFG::emitPutTransitionStub):
8628 * dfg/DFGSpeculativeJIT64.cpp:
8629 (JSC::DFG::SpeculativeJIT::compile):
8630 * jit/JITStubs.cpp:
8631 (JSC::JITThunks::tryCachePutByID):
8632 * llint/LLIntSlowPaths.cpp:
8633 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
8634 * runtime/Structure.cpp:
8635 (JSC::Structure::Structure):
8636 * runtime/Structure.h:
8637 (JSC::Structure::transitionWatchpointSetHasBeenInvalidated):
8638 (Structure):
8639 (JSC::Structure::transitionWatchpointSetIsStillValid):
8640 (JSC::Structure::addTransitionWatchpoint):
8641 (JSC::Structure::notifyTransitionFromThisStructure):
8642 (JSC::JSCell::setStructure):
8643 * runtime/SymbolTable.cpp:
8644 (JSC::SymbolTableEntry::attemptToWatch):
8645
86462012-06-13 Filip Pizlo <fpizlo@apple.com>
8647
fpizlo@apple.comb75911b2012-06-13 20:53:52 +00008648 DFG should be able to set watchpoints on global variables
8649 https://bugs.webkit.org/show_bug.cgi?id=88692
8650
8651 Reviewed by Geoffrey Garen.
8652
8653 Rolling back in after fixing Windows build issues, and implementing
8654 branchTest8 for the Qt port's strange assemblers.
8655
8656 This implements global variable constant folding by allowing the optimizing
8657 compiler to set a "watchpoint" on globals that it wishes to constant fold.
8658 If the watchpoint fires, then an OSR exit is forced by overwriting the
8659 machine code that the optimizing compiler generated with a jump.
8660
8661 As such, this patch is adding quite a bit of stuff:
8662
8663 - Jump replacement on those hardware targets supported by the optimizing
8664 JIT. It is now possible to patch in a jump instruction over any recorded
8665 watchpoint label. The jump must be "local" in the sense that it must be
8666 within the range of the largest jump distance supported by a one
8667 instruction jump.
8668
8669 - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
8670 that records the location where a jump must be inserted and the
8671 destination to which it should jump. Watchpoints can be added to a
8672 WatchpointSet. The WatchpointSet can be fired all at once, which plants
8673 all jumps. WatchpointSet also remembers if it had ever been invalidated,
8674 which allows for monotonicity: we typically don't want to optimize using
8675 watchpoints on something for which watchpoints had previously fired. The
8676 act of notifying a WatchpointSet has a trivial fast path in case no
8677 Watchpoints are registered (one-byte load+branch).
8678
8679 - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
8680 except that you don't have to emit branches. But, you need to know what
8681 WatchpointSet to add the resulting Watchpoint to. Not everything that
8682 you could write a speculationCheck() for will have a WatchpointSet that
8683 would get notified if the condition you were speculating against became
8684 invalid.
8685
8686 - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
8687 do so without incurring any space overhead for those entries that don't
8688 have WatchpointSets.
8689
8690 - The bytecode generator infers all global function variables to be
8691 watchable, and makes all stores perform the WatchpointSet's write check,
8692 and marks all loads as being potentially watchable (i.e. you can compile
8693 them to a watchpoint and a constant).
8694
8695 Put together, this allows for fully sleazy inlining of calls to globally
8696 declared functions. The inline prologue will no longer contain the load of
8697 the function, or any checks of the function you're calling. I.e. it's
8698 pretty much like the kind of inlining you would see in Java or C++.
8699 Furthermore, the watchpointing functionality is built to be fairly general,
8700 and should allow setting watchpoints on all sorts of interesting things
8701 in the future.
8702
8703 The sleazy inlining means that we will now sometimes inline in code paths
8704 that have never executed. Previously, to inline we would have either had
8705 to have executed the call (to read the call's inline cache) or have
8706 executed the method check (to read the method check's inline cache). Now,
8707 we might inline when the callee is a watched global variable. This
8708 revealed some humorous bugs. First, constant folding disagreed with CFA
8709 over what kinds of operations can clobber (example: code path A is dead
8710 but stores a String into variable X, all other code paths store 0 into
8711 X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
8712 clobbering constant, but constant folding thought it was clobbering
8713 because it saw the String prediction). Second, inlining would crash if
8714 the inline callee had not been compiled. This patch fixes both bugs,
8715 since otherwise run-javascriptcore-tests would report regressions.
8716
8717 * CMakeLists.txt:
8718 * GNUmakefile.list.am:
8719 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8720 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8721 * JavaScriptCore.xcodeproj/project.pbxproj:
8722 * Target.pri:
8723 * assembler/ARMv7Assembler.h:
8724 (ARMv7Assembler):
8725 (JSC::ARMv7Assembler::ARMv7Assembler):
8726 (JSC::ARMv7Assembler::labelForWatchpoint):
8727 (JSC::ARMv7Assembler::label):
8728 (JSC::ARMv7Assembler::replaceWithJump):
8729 (JSC::ARMv7Assembler::maxJumpReplacementSize):
8730 * assembler/AbstractMacroAssembler.h:
8731 (JSC):
8732 (AbstractMacroAssembler):
8733 (Label):
8734 (JSC::AbstractMacroAssembler::watchpointLabel):
8735 (JSC::AbstractMacroAssembler::readPointer):
8736 * assembler/AssemblerBuffer.h:
8737 * assembler/MacroAssemblerARM.h:
8738 (JSC::MacroAssemblerARM::branchTest8):
8739 (MacroAssemblerARM):
8740 (JSC::MacroAssemblerARM::replaceWithJump):
8741 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
8742 * assembler/MacroAssemblerARMv7.h:
8743 (JSC::MacroAssemblerARMv7::load8Signed):
8744 (JSC::MacroAssemblerARMv7::load16Signed):
8745 (MacroAssemblerARMv7):
8746 (JSC::MacroAssemblerARMv7::replaceWithJump):
8747 (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
8748 (JSC::MacroAssemblerARMv7::branchTest8):
8749 (JSC::MacroAssemblerARMv7::jump):
8750 (JSC::MacroAssemblerARMv7::makeBranch):
8751 * assembler/MacroAssemblerMIPS.h:
8752 (JSC::MacroAssemblerMIPS::branchTest8):
8753 (MacroAssemblerMIPS):
8754 (JSC::MacroAssemblerMIPS::replaceWithJump):
8755 (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
8756 * assembler/MacroAssemblerSH4.h:
8757 (JSC::MacroAssemblerSH4::branchTest8):
8758 (MacroAssemblerSH4):
8759 (JSC::MacroAssemblerSH4::replaceWithJump):
8760 (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
8761 * assembler/MacroAssemblerX86.h:
8762 (MacroAssemblerX86):
8763 (JSC::MacroAssemblerX86::branchTest8):
8764 * assembler/MacroAssemblerX86Common.h:
8765 (JSC::MacroAssemblerX86Common::replaceWithJump):
8766 (MacroAssemblerX86Common):
8767 (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
8768 * assembler/MacroAssemblerX86_64.h:
8769 (MacroAssemblerX86_64):
8770 (JSC::MacroAssemblerX86_64::branchTest8):
8771 * assembler/X86Assembler.h:
8772 (JSC::X86Assembler::X86Assembler):
8773 (X86Assembler):
8774 (JSC::X86Assembler::cmpb_im):
8775 (JSC::X86Assembler::testb_im):
8776 (JSC::X86Assembler::labelForWatchpoint):
8777 (JSC::X86Assembler::label):
8778 (JSC::X86Assembler::replaceWithJump):
8779 (JSC::X86Assembler::maxJumpReplacementSize):
8780 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
8781 * bytecode/CodeBlock.cpp:
8782 (JSC):
8783 (JSC::CodeBlock::printGetByIdCacheStatus):
8784 (JSC::CodeBlock::dump):
8785 * bytecode/CodeBlock.h:
8786 (JSC::CodeBlock::appendOSRExit):
8787 (JSC::CodeBlock::appendSpeculationRecovery):
8788 (CodeBlock):
8789 (JSC::CodeBlock::appendWatchpoint):
8790 (JSC::CodeBlock::numberOfWatchpoints):
8791 (JSC::CodeBlock::watchpoint):
8792 (DFGData):
8793 * bytecode/DFGExitProfile.h:
8794 (JSC::DFG::exitKindToString):
8795 (JSC::DFG::exitKindIsCountable):
8796 * bytecode/GetByIdStatus.cpp:
8797 (JSC::GetByIdStatus::computeForChain):
8798 * bytecode/Instruction.h:
8799 (Instruction):
8800 (JSC::Instruction::Instruction):
8801 * bytecode/Opcode.h:
8802 (JSC):
8803 (JSC::padOpcodeName):
8804 * bytecode/Watchpoint.cpp: Added.
8805 (JSC):
8806 (JSC::Watchpoint::~Watchpoint):
8807 (JSC::Watchpoint::correctLabels):
8808 (JSC::Watchpoint::fire):
8809 (JSC::WatchpointSet::WatchpointSet):
8810 (JSC::WatchpointSet::~WatchpointSet):
8811 (JSC::WatchpointSet::add):
8812 (JSC::WatchpointSet::notifyWriteSlow):
8813 (JSC::WatchpointSet::fireAllWatchpoints):
8814 * bytecode/Watchpoint.h: Added.
8815 (JSC):
8816 (Watchpoint):
8817 (JSC::Watchpoint::Watchpoint):
8818 (JSC::Watchpoint::setDestination):
8819 (WatchpointSet):
8820 (JSC::WatchpointSet::isStillValid):
8821 (JSC::WatchpointSet::hasBeenInvalidated):
8822 (JSC::WatchpointSet::startWatching):
8823 (JSC::WatchpointSet::notifyWrite):
8824 (JSC::WatchpointSet::addressOfIsWatched):
8825 * bytecompiler/BytecodeGenerator.cpp:
8826 (JSC::ResolveResult::checkValidity):
8827 (JSC::BytecodeGenerator::addGlobalVar):
8828 (JSC::BytecodeGenerator::BytecodeGenerator):
8829 (JSC::BytecodeGenerator::resolve):
8830 (JSC::BytecodeGenerator::emitResolve):
8831 (JSC::BytecodeGenerator::emitResolveWithBase):
8832 (JSC::BytecodeGenerator::emitResolveWithThis):
8833 (JSC::BytecodeGenerator::emitGetStaticVar):
8834 (JSC::BytecodeGenerator::emitPutStaticVar):
8835 * bytecompiler/BytecodeGenerator.h:
8836 (BytecodeGenerator):
8837 * bytecompiler/NodesCodegen.cpp:
8838 (JSC::FunctionCallResolveNode::emitBytecode):
8839 (JSC::PostfixResolveNode::emitBytecode):
8840 (JSC::PrefixResolveNode::emitBytecode):
8841 (JSC::ReadModifyResolveNode::emitBytecode):
8842 (JSC::AssignResolveNode::emitBytecode):
8843 (JSC::ConstDeclNode::emitCodeSingle):
8844 * dfg/DFGAbstractState.cpp:
8845 (JSC::DFG::AbstractState::execute):
8846 (JSC::DFG::AbstractState::clobberStructures):
8847 * dfg/DFGAbstractState.h:
8848 (AbstractState):
8849 (JSC::DFG::AbstractState::didClobber):
8850 * dfg/DFGByteCodeParser.cpp:
8851 (JSC::DFG::ByteCodeParser::handleInlining):
8852 (JSC::DFG::ByteCodeParser::parseBlock):
8853 * dfg/DFGCCallHelpers.h:
8854 (CCallHelpers):
8855 (JSC::DFG::CCallHelpers::setupArguments):
8856 * dfg/DFGCSEPhase.cpp:
8857 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
8858 (CSEPhase):
8859 (JSC::DFG::CSEPhase::globalVarStoreElimination):
8860 (JSC::DFG::CSEPhase::performNodeCSE):
8861 * dfg/DFGCapabilities.h:
8862 (JSC::DFG::canCompileOpcode):
8863 * dfg/DFGConstantFoldingPhase.cpp:
8864 (JSC::DFG::ConstantFoldingPhase::run):
8865 * dfg/DFGCorrectableJumpPoint.h:
8866 (JSC::DFG::CorrectableJumpPoint::isSet):
8867 (CorrectableJumpPoint):
8868 * dfg/DFGJITCompiler.cpp:
8869 (JSC::DFG::JITCompiler::linkOSRExits):
8870 (JSC::DFG::JITCompiler::link):
8871 * dfg/DFGNode.h:
8872 (JSC::DFG::Node::hasIdentifierNumberForCheck):
8873 (Node):
8874 (JSC::DFG::Node::identifierNumberForCheck):
8875 (JSC::DFG::Node::hasRegisterPointer):
8876 * dfg/DFGNodeType.h:
8877 (DFG):
8878 * dfg/DFGOSRExit.cpp:
8879 (JSC::DFG::OSRExit::OSRExit):
8880 * dfg/DFGOSRExit.h:
8881 (OSRExit):
8882 * dfg/DFGOperations.cpp:
8883 * dfg/DFGOperations.h:
8884 * dfg/DFGPredictionPropagationPhase.cpp:
8885 (JSC::DFG::PredictionPropagationPhase::propagate):
8886 * dfg/DFGSpeculativeJIT.h:
8887 (JSC::DFG::SpeculativeJIT::callOperation):
8888 (JSC::DFG::SpeculativeJIT::appendCall):
8889 (SpeculativeJIT):
8890 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
8891 * dfg/DFGSpeculativeJIT32_64.cpp:
8892 (JSC::DFG::SpeculativeJIT::compile):
8893 * dfg/DFGSpeculativeJIT64.cpp:
8894 (JSC::DFG::SpeculativeJIT::compile):
8895 * interpreter/Interpreter.cpp:
8896 (JSC::Interpreter::privateExecute):
8897 * jit/JIT.cpp:
8898 (JSC::JIT::privateCompileMainPass):
8899 (JSC::JIT::privateCompileSlowCases):
8900 * jit/JIT.h:
8901 * jit/JITPropertyAccess.cpp:
8902 (JSC::JIT::emit_op_put_global_var_check):
8903 (JSC):
8904 (JSC::JIT::emitSlow_op_put_global_var_check):
8905 * jit/JITPropertyAccess32_64.cpp:
8906 (JSC::JIT::emit_op_put_global_var_check):
8907 (JSC):
8908 (JSC::JIT::emitSlow_op_put_global_var_check):
8909 * jit/JITStubs.cpp:
8910 (JSC::DEFINE_STUB_FUNCTION):
8911 (JSC):
8912 * jit/JITStubs.h:
8913 * llint/LLIntSlowPaths.cpp:
8914 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
8915 (LLInt):
8916 * llint/LLIntSlowPaths.h:
8917 (LLInt):
8918 * llint/LowLevelInterpreter32_64.asm:
8919 * llint/LowLevelInterpreter64.asm:
8920 * runtime/JSObject.cpp:
8921 (JSC::JSObject::removeDirect):
8922 * runtime/JSObject.h:
8923 (JSObject):
8924 * runtime/JSSymbolTableObject.h:
8925 (JSC::symbolTableGet):
8926 (JSC::symbolTablePut):
8927 (JSC::symbolTablePutWithAttributes):
8928 * runtime/SymbolTable.cpp: Added.
8929 (JSC):
8930 (JSC::SymbolTableEntry::copySlow):
8931 (JSC::SymbolTableEntry::freeFatEntrySlow):
8932 (JSC::SymbolTableEntry::couldBeWatched):
8933 (JSC::SymbolTableEntry::attemptToWatch):
8934 (JSC::SymbolTableEntry::addressOfIsWatched):
8935 (JSC::SymbolTableEntry::addWatchpoint):
8936 (JSC::SymbolTableEntry::notifyWriteSlow):
8937 (JSC::SymbolTableEntry::inflateSlow):
8938 * runtime/SymbolTable.h:
8939 (JSC):
8940 (SymbolTableEntry):
8941 (Fast):
8942 (JSC::SymbolTableEntry::Fast::Fast):
8943 (JSC::SymbolTableEntry::Fast::isNull):
8944 (JSC::SymbolTableEntry::Fast::getIndex):
8945 (JSC::SymbolTableEntry::Fast::isReadOnly):
8946 (JSC::SymbolTableEntry::Fast::getAttributes):
8947 (JSC::SymbolTableEntry::Fast::isFat):
8948 (JSC::SymbolTableEntry::SymbolTableEntry):
8949 (JSC::SymbolTableEntry::~SymbolTableEntry):
8950 (JSC::SymbolTableEntry::operator=):
8951 (JSC::SymbolTableEntry::isNull):
8952 (JSC::SymbolTableEntry::getIndex):
8953 (JSC::SymbolTableEntry::getFast):
8954 (JSC::SymbolTableEntry::getAttributes):
8955 (JSC::SymbolTableEntry::isReadOnly):
8956 (JSC::SymbolTableEntry::watchpointSet):
8957 (JSC::SymbolTableEntry::notifyWrite):
8958 (FatEntry):
8959 (JSC::SymbolTableEntry::FatEntry::FatEntry):
8960 (JSC::SymbolTableEntry::isFat):
8961 (JSC::SymbolTableEntry::fatEntry):
8962 (JSC::SymbolTableEntry::inflate):
8963 (JSC::SymbolTableEntry::bits):
8964 (JSC::SymbolTableEntry::freeFatEntry):
8965 (JSC::SymbolTableEntry::pack):
8966 (JSC::SymbolTableEntry::isValidIndex):
8967
zandobersek@gmail.com88d53732012-06-13 09:38:42 +000089682012-06-13 Sheriff Bot <webkit.review.bot@gmail.com>
8969
8970 Unreviewed, rolling out r120172.
8971 http://trac.webkit.org/changeset/120172
8972 https://bugs.webkit.org/show_bug.cgi?id=88976
8973
8974 The patch causes compilation failures on Gtk, Qt and Apple Win
8975 bots (Requested by zdobersek on #webkit).
8976
8977 * CMakeLists.txt:
8978 * GNUmakefile.list.am:
8979 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8980 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8981 * JavaScriptCore.xcodeproj/project.pbxproj:
8982 * Target.pri:
8983 * assembler/ARMv7Assembler.h:
8984 (JSC::ARMv7Assembler::nop):
8985 (JSC::ARMv7Assembler::label):
8986 (JSC::ARMv7Assembler::readPointer):
8987 (ARMv7Assembler):
8988 * assembler/AbstractMacroAssembler.h:
8989 (JSC):
8990 (AbstractMacroAssembler):
8991 (Label):
8992 * assembler/AssemblerBuffer.h:
8993 * assembler/MacroAssemblerARM.h:
8994 * assembler/MacroAssemblerARMv7.h:
8995 (JSC::MacroAssemblerARMv7::nop):
8996 (JSC::MacroAssemblerARMv7::jump):
8997 (JSC::MacroAssemblerARMv7::makeBranch):
8998 * assembler/MacroAssemblerMIPS.h:
8999 * assembler/MacroAssemblerSH4.h:
9000 * assembler/MacroAssemblerX86.h:
9001 (MacroAssemblerX86):
9002 (JSC::MacroAssemblerX86::moveWithPatch):
9003 * assembler/MacroAssemblerX86Common.h:
9004 * assembler/MacroAssemblerX86_64.h:
9005 (JSC::MacroAssemblerX86_64::branchTest8):
9006 * assembler/X86Assembler.h:
9007 (JSC::X86Assembler::cmpb_im):
9008 (JSC::X86Assembler::codeSize):
9009 (JSC::X86Assembler::label):
9010 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
9011 * bytecode/CodeBlock.cpp:
9012 (JSC::CodeBlock::dump):
9013 * bytecode/CodeBlock.h:
9014 (JSC::CodeBlock::appendOSRExit):
9015 (JSC::CodeBlock::appendSpeculationRecovery):
9016 (DFGData):
9017 * bytecode/DFGExitProfile.h:
9018 (JSC::DFG::exitKindToString):
9019 (JSC::DFG::exitKindIsCountable):
9020 * bytecode/Instruction.h:
9021 * bytecode/Opcode.h:
9022 (JSC):
9023 (JSC::padOpcodeName):
9024 * bytecode/Watchpoint.cpp: Removed.
9025 * bytecode/Watchpoint.h: Removed.
9026 * bytecompiler/BytecodeGenerator.cpp:
9027 (JSC::ResolveResult::checkValidity):
9028 (JSC::BytecodeGenerator::addGlobalVar):
9029 (JSC::BytecodeGenerator::BytecodeGenerator):
9030 (JSC::BytecodeGenerator::resolve):
9031 (JSC::BytecodeGenerator::emitResolve):
9032 (JSC::BytecodeGenerator::emitResolveWithBase):
9033 (JSC::BytecodeGenerator::emitResolveWithThis):
9034 (JSC::BytecodeGenerator::emitGetStaticVar):
9035 (JSC::BytecodeGenerator::emitPutStaticVar):
9036 * bytecompiler/BytecodeGenerator.h:
9037 (BytecodeGenerator):
9038 * bytecompiler/NodesCodegen.cpp:
9039 (JSC::FunctionCallResolveNode::emitBytecode):
9040 (JSC::PostfixResolveNode::emitBytecode):
9041 (JSC::PrefixResolveNode::emitBytecode):
9042 (JSC::ReadModifyResolveNode::emitBytecode):
9043 (JSC::AssignResolveNode::emitBytecode):
9044 (JSC::ConstDeclNode::emitCodeSingle):
9045 * dfg/DFGAbstractState.cpp:
9046 (JSC::DFG::AbstractState::execute):
9047 (JSC::DFG::AbstractState::clobberStructures):
9048 * dfg/DFGAbstractState.h:
9049 (AbstractState):
9050 * dfg/DFGByteCodeParser.cpp:
9051 (JSC::DFG::ByteCodeParser::handleInlining):
9052 (JSC::DFG::ByteCodeParser::parseBlock):
9053 * dfg/DFGCCallHelpers.h:
9054 (JSC::DFG::CCallHelpers::setupArguments):
9055 * dfg/DFGCSEPhase.cpp:
9056 (JSC::DFG::CSEPhase::globalVarStoreElimination):
9057 (JSC::DFG::CSEPhase::performNodeCSE):
9058 * dfg/DFGCapabilities.h:
9059 (JSC::DFG::canCompileOpcode):
9060 * dfg/DFGConstantFoldingPhase.cpp:
9061 (JSC::DFG::ConstantFoldingPhase::run):
9062 * dfg/DFGCorrectableJumpPoint.h:
9063 * dfg/DFGJITCompiler.cpp:
9064 (JSC::DFG::JITCompiler::linkOSRExits):
9065 (JSC::DFG::JITCompiler::link):
9066 * dfg/DFGNode.h:
9067 (JSC::DFG::Node::hasRegisterPointer):
9068 * dfg/DFGNodeType.h:
9069 (DFG):
9070 * dfg/DFGOSRExit.cpp:
9071 (JSC::DFG::OSRExit::OSRExit):
9072 * dfg/DFGOSRExit.h:
9073 (OSRExit):
9074 * dfg/DFGOperations.cpp:
9075 * dfg/DFGOperations.h:
9076 * dfg/DFGPredictionPropagationPhase.cpp:
9077 (JSC::DFG::PredictionPropagationPhase::propagate):
9078 * dfg/DFGSpeculativeJIT.h:
9079 (JSC::DFG::SpeculativeJIT::callOperation):
9080 (JSC::DFG::SpeculativeJIT::appendCallSetResult):
9081 (JSC::DFG::SpeculativeJIT::speculationCheck):
9082 * dfg/DFGSpeculativeJIT32_64.cpp:
9083 (JSC::DFG::SpeculativeJIT::compile):
9084 * dfg/DFGSpeculativeJIT64.cpp:
9085 (JSC::DFG::SpeculativeJIT::compile):
9086 * jit/JIT.cpp:
9087 (JSC::JIT::privateCompileMainPass):
9088 (JSC::JIT::privateCompileSlowCases):
9089 * jit/JIT.h:
9090 * jit/JITPropertyAccess.cpp:
9091 * jit/JITPropertyAccess32_64.cpp:
9092 * jit/JITStubs.cpp:
9093 * jit/JITStubs.h:
9094 * llint/LLIntSlowPaths.cpp:
9095 * llint/LLIntSlowPaths.h:
9096 (LLInt):
9097 * llint/LowLevelInterpreter32_64.asm:
9098 * llint/LowLevelInterpreter64.asm:
9099 * runtime/JSObject.cpp:
9100 (JSC::JSObject::removeDirect):
9101 * runtime/JSObject.h:
9102 (JSObject):
9103 * runtime/JSSymbolTableObject.h:
9104 (JSC::symbolTableGet):
9105 (JSC::symbolTablePut):
9106 (JSC::symbolTablePutWithAttributes):
9107 * runtime/SymbolTable.cpp: Removed.
9108 * runtime/SymbolTable.h:
9109 (JSC):
9110 (JSC::SymbolTableEntry::isNull):
9111 (JSC::SymbolTableEntry::getIndex):
9112 (SymbolTableEntry):
9113 (JSC::SymbolTableEntry::getAttributes):
9114 (JSC::SymbolTableEntry::isReadOnly):
9115 (JSC::SymbolTableEntry::pack):
9116 (JSC::SymbolTableEntry::isValidIndex):
9117
fpizlo@apple.com3bdd4c92012-06-13 04:56:22 +000091182012-06-12 Filip Pizlo <fpizlo@apple.com>
9119
fpizlo@apple.comb6c5eeb2012-06-13 08:20:39 +00009120 DFG should be able to set watchpoints on global variables
9121 https://bugs.webkit.org/show_bug.cgi?id=88692
9122
9123 Reviewed by Geoffrey Garen.
9124
9125 This implements global variable constant folding by allowing the optimizing
9126 compiler to set a "watchpoint" on globals that it wishes to constant fold.
9127 If the watchpoint fires, then an OSR exit is forced by overwriting the
9128 machine code that the optimizing compiler generated with a jump.
9129
9130 As such, this patch is adding quite a bit of stuff:
9131
9132 - Jump replacement on those hardware targets supported by the optimizing
9133 JIT. It is now possible to patch in a jump instruction over any recorded
9134 watchpoint label. The jump must be "local" in the sense that it must be
9135 within the range of the largest jump distance supported by a one
9136 instruction jump.
9137
9138 - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
9139 that records the location where a jump must be inserted and the
9140 destination to which it should jump. Watchpoints can be added to a
9141 WatchpointSet. The WatchpointSet can be fired all at once, which plants
9142 all jumps. WatchpointSet also remembers if it had ever been invalidated,
9143 which allows for monotonicity: we typically don't want to optimize using
9144 watchpoints on something for which watchpoints had previously fired. The
9145 act of notifying a WatchpointSet has a trivial fast path in case no
9146 Watchpoints are registered (one-byte load+branch).
9147
9148 - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
9149 except that you don't have to emit branches. But, you need to know what
9150 WatchpointSet to add the resulting Watchpoint to. Not everything that
9151 you could write a speculationCheck() for will have a WatchpointSet that
9152 would get notified if the condition you were speculating against became
9153 invalid.
9154
9155 - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
9156 do so without incurring any space overhead for those entries that don't
9157 have WatchpointSets.
9158
9159 - The bytecode generator infers all global function variables to be
9160 watchable, and makes all stores perform the WatchpointSet's write check,
9161 and marks all loads as being potentially watchable (i.e. you can compile
9162 them to a watchpoint and a constant).
9163
9164 Put together, this allows for fully sleazy inlining of calls to globally
9165 declared functions. The inline prologue will no longer contain the load of
9166 the function, or any checks of the function you're calling. I.e. it's
9167 pretty much like the kind of inlining you would see in Java or C++.
9168 Furthermore, the watchpointing functionality is built to be fairly general,
9169 and should allow setting watchpoints on all sorts of interesting things
9170 in the future.
9171
9172 The sleazy inlining means that we will now sometimes inline in code paths
9173 that have never executed. Previously, to inline we would have either had
9174 to have executed the call (to read the call's inline cache) or have
9175 executed the method check (to read the method check's inline cache). Now,
9176 we might inline when the callee is a watched global variable. This
9177 revealed some humorous bugs. First, constant folding disagreed with CFA
9178 over what kinds of operations can clobber (example: code path A is dead
9179 but stores a String into variable X, all other code paths store 0 into
9180 X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
9181 clobbering constant, but constant folding thought it was clobbering
9182 because it saw the String prediction). Second, inlining would crash if
9183 the inline callee had not been compiled. This patch fixes both bugs,
9184 since otherwise run-javascriptcore-tests would report regressions.
9185
9186 * CMakeLists.txt:
9187 * GNUmakefile.list.am:
9188 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9189 * JavaScriptCore.xcodeproj/project.pbxproj:
9190 * Target.pri:
9191 * assembler/ARMv7Assembler.h:
9192 (ARMv7Assembler):
9193 (JSC::ARMv7Assembler::ARMv7Assembler):
9194 (JSC::ARMv7Assembler::labelForWatchpoint):
9195 (JSC::ARMv7Assembler::label):
9196 (JSC::ARMv7Assembler::replaceWithJump):
9197 (JSC::ARMv7Assembler::maxJumpReplacementSize):
9198 * assembler/AbstractMacroAssembler.h:
9199 (JSC):
9200 (AbstractMacroAssembler):
9201 (Label):
9202 (JSC::AbstractMacroAssembler::watchpointLabel):
9203 * assembler/AssemblerBuffer.h:
9204 * assembler/MacroAssemblerARM.h:
9205 (JSC::MacroAssemblerARM::replaceWithJump):
9206 (MacroAssemblerARM):
9207 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
9208 * assembler/MacroAssemblerARMv7.h:
9209 (MacroAssemblerARMv7):
9210 (JSC::MacroAssemblerARMv7::replaceWithJump):
9211 (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
9212 (JSC::MacroAssemblerARMv7::branchTest8):
9213 (JSC::MacroAssemblerARMv7::jump):
9214 (JSC::MacroAssemblerARMv7::makeBranch):
9215 * assembler/MacroAssemblerMIPS.h:
9216 (JSC::MacroAssemblerMIPS::replaceWithJump):
9217 (MacroAssemblerMIPS):
9218 (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
9219 * assembler/MacroAssemblerSH4.h:
9220 (JSC::MacroAssemblerSH4::replaceWithJump):
9221 (MacroAssemblerSH4):
9222 (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
9223 * assembler/MacroAssemblerX86.h:
9224 (MacroAssemblerX86):
9225 (JSC::MacroAssemblerX86::branchTest8):
9226 * assembler/MacroAssemblerX86Common.h:
9227 (JSC::MacroAssemblerX86Common::replaceWithJump):
9228 (MacroAssemblerX86Common):
9229 (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
9230 * assembler/MacroAssemblerX86_64.h:
9231 (MacroAssemblerX86_64):
9232 (JSC::MacroAssemblerX86_64::branchTest8):
9233 * assembler/X86Assembler.h:
9234 (JSC::X86Assembler::X86Assembler):
9235 (X86Assembler):
9236 (JSC::X86Assembler::cmpb_im):
9237 (JSC::X86Assembler::testb_im):
9238 (JSC::X86Assembler::labelForWatchpoint):
9239 (JSC::X86Assembler::label):
9240 (JSC::X86Assembler::replaceWithJump):
9241 (JSC::X86Assembler::maxJumpReplacementSize):
9242 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
9243 * bytecode/CodeBlock.cpp:
9244 (JSC::CodeBlock::dump):
9245 * bytecode/CodeBlock.h:
9246 (JSC::CodeBlock::appendOSRExit):
9247 (JSC::CodeBlock::appendSpeculationRecovery):
9248 (CodeBlock):
9249 (JSC::CodeBlock::appendWatchpoint):
9250 (JSC::CodeBlock::numberOfWatchpoints):
9251 (JSC::CodeBlock::watchpoint):
9252 (DFGData):
9253 * bytecode/DFGExitProfile.h:
9254 (JSC::DFG::exitKindToString):
9255 (JSC::DFG::exitKindIsCountable):
9256 * bytecode/Instruction.h:
9257 (Instruction):
9258 (JSC::Instruction::Instruction):
9259 * bytecode/Opcode.h:
9260 (JSC):
9261 (JSC::padOpcodeName):
9262 * bytecode/Watchpoint.cpp: Added.
9263 (JSC):
9264 (JSC::Watchpoint::~Watchpoint):
9265 (JSC::Watchpoint::correctLabels):
9266 (JSC::Watchpoint::fire):
9267 (JSC::WatchpointSet::WatchpointSet):
9268 (JSC::WatchpointSet::~WatchpointSet):
9269 (JSC::WatchpointSet::add):
9270 (JSC::WatchpointSet::notifyWriteSlow):
9271 (JSC::WatchpointSet::fireAllWatchpoints):
9272 * bytecode/Watchpoint.h: Added.
9273 (JSC):
9274 (Watchpoint):
9275 (JSC::Watchpoint::Watchpoint):
9276 (JSC::Watchpoint::setDestination):
9277 (WatchpointSet):
9278 (JSC::WatchpointSet::isStillValid):
9279 (JSC::WatchpointSet::hasBeenInvalidated):
9280 (JSC::WatchpointSet::startWatching):
9281 (JSC::WatchpointSet::notifyWrite):
9282 (JSC::WatchpointSet::addressOfIsWatched):
9283 * bytecompiler/BytecodeGenerator.cpp:
9284 (JSC::ResolveResult::checkValidity):
9285 (JSC::BytecodeGenerator::addGlobalVar):
9286 (JSC::BytecodeGenerator::BytecodeGenerator):
9287 (JSC::BytecodeGenerator::resolve):
9288 (JSC::BytecodeGenerator::emitResolve):
9289 (JSC::BytecodeGenerator::emitResolveWithBase):
9290 (JSC::BytecodeGenerator::emitResolveWithThis):
9291 (JSC::BytecodeGenerator::emitGetStaticVar):
9292 (JSC::BytecodeGenerator::emitPutStaticVar):
9293 * bytecompiler/BytecodeGenerator.h:
9294 (BytecodeGenerator):
9295 * bytecompiler/NodesCodegen.cpp:
9296 (JSC::FunctionCallResolveNode::emitBytecode):
9297 (JSC::PostfixResolveNode::emitBytecode):
9298 (JSC::PrefixResolveNode::emitBytecode):
9299 (JSC::ReadModifyResolveNode::emitBytecode):
9300 (JSC::AssignResolveNode::emitBytecode):
9301 (JSC::ConstDeclNode::emitCodeSingle):
9302 * dfg/DFGAbstractState.cpp:
9303 (JSC::DFG::AbstractState::execute):
9304 (JSC::DFG::AbstractState::clobberStructures):
9305 * dfg/DFGAbstractState.h:
9306 (AbstractState):
9307 (JSC::DFG::AbstractState::didClobber):
9308 * dfg/DFGByteCodeParser.cpp:
9309 (JSC::DFG::ByteCodeParser::handleInlining):
9310 (JSC::DFG::ByteCodeParser::parseBlock):
9311 * dfg/DFGCCallHelpers.h:
9312 (CCallHelpers):
9313 (JSC::DFG::CCallHelpers::setupArguments):
9314 * dfg/DFGCSEPhase.cpp:
9315 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
9316 (CSEPhase):
9317 (JSC::DFG::CSEPhase::globalVarStoreElimination):
9318 (JSC::DFG::CSEPhase::performNodeCSE):
9319 * dfg/DFGCapabilities.h:
9320 (JSC::DFG::canCompileOpcode):
9321 * dfg/DFGConstantFoldingPhase.cpp:
9322 (JSC::DFG::ConstantFoldingPhase::run):
9323 * dfg/DFGCorrectableJumpPoint.h:
9324 (JSC::DFG::CorrectableJumpPoint::isSet):
9325 (CorrectableJumpPoint):
9326 * dfg/DFGJITCompiler.cpp:
9327 (JSC::DFG::JITCompiler::linkOSRExits):
9328 (JSC::DFG::JITCompiler::link):
9329 * dfg/DFGNode.h:
9330 (JSC::DFG::Node::hasIdentifierNumberForCheck):
9331 (Node):
9332 (JSC::DFG::Node::identifierNumberForCheck):
9333 (JSC::DFG::Node::hasRegisterPointer):
9334 * dfg/DFGNodeType.h:
9335 (DFG):
9336 * dfg/DFGOSRExit.cpp:
9337 (JSC::DFG::OSRExit::OSRExit):
9338 * dfg/DFGOSRExit.h:
9339 (OSRExit):
9340 * dfg/DFGOperations.cpp:
9341 * dfg/DFGOperations.h:
9342 * dfg/DFGPredictionPropagationPhase.cpp:
9343 (JSC::DFG::PredictionPropagationPhase::propagate):
9344 * dfg/DFGSpeculativeJIT.h:
9345 (JSC::DFG::SpeculativeJIT::callOperation):
9346 (JSC::DFG::SpeculativeJIT::appendCall):
9347 (SpeculativeJIT):
9348 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
9349 * dfg/DFGSpeculativeJIT32_64.cpp:
9350 (JSC::DFG::SpeculativeJIT::compile):
9351 * dfg/DFGSpeculativeJIT64.cpp:
9352 (JSC::DFG::SpeculativeJIT::compile):
9353 * jit/JIT.cpp:
9354 (JSC::JIT::privateCompileMainPass):
9355 (JSC::JIT::privateCompileSlowCases):
9356 * jit/JIT.h:
9357 * jit/JITPropertyAccess.cpp:
9358 (JSC::JIT::emit_op_put_global_var_check):
9359 (JSC):
9360 (JSC::JIT::emitSlow_op_put_global_var_check):
9361 * jit/JITPropertyAccess32_64.cpp:
9362 (JSC::JIT::emit_op_put_global_var_check):
9363 (JSC):
9364 (JSC::JIT::emitSlow_op_put_global_var_check):
9365 * jit/JITStubs.cpp:
9366 (JSC::JITThunks::JITThunks):
9367 (JSC::DEFINE_STUB_FUNCTION):
9368 (JSC):
9369 * jit/JITStubs.h:
9370 * llint/LLIntSlowPaths.cpp:
9371 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
9372 (LLInt):
9373 * llint/LLIntSlowPaths.h:
9374 (LLInt):
9375 * llint/LowLevelInterpreter32_64.asm:
9376 * llint/LowLevelInterpreter64.asm:
9377 * runtime/JSObject.cpp:
9378 (JSC::JSObject::removeDirect):
9379 * runtime/JSObject.h:
9380 (JSObject):
9381 * runtime/JSSymbolTableObject.h:
9382 (JSC::symbolTableGet):
9383 (JSC::symbolTablePut):
9384 (JSC::symbolTablePutWithAttributes):
9385 * runtime/SymbolTable.cpp: Added.
9386 (JSC):
9387 (JSC::SymbolTableEntry::copySlow):
9388 (JSC::SymbolTableEntry::freeFatEntrySlow):
9389 (JSC::SymbolTableEntry::couldBeWatched):
9390 (JSC::SymbolTableEntry::attemptToWatch):
9391 (JSC::SymbolTableEntry::addressOfIsWatched):
9392 (JSC::SymbolTableEntry::addWatchpoint):
9393 (JSC::SymbolTableEntry::notifyWriteSlow):
9394 (JSC::SymbolTableEntry::inflateSlow):
9395 * runtime/SymbolTable.h:
9396 (JSC):
9397 (SymbolTableEntry):
9398 (Fast):
9399 (JSC::SymbolTableEntry::Fast::Fast):
9400 (JSC::SymbolTableEntry::Fast::isNull):
9401 (JSC::SymbolTableEntry::Fast::getIndex):
9402 (JSC::SymbolTableEntry::Fast::isReadOnly):
9403 (JSC::SymbolTableEntry::Fast::getAttributes):
9404 (JSC::SymbolTableEntry::Fast::isFat):
9405 (JSC::SymbolTableEntry::SymbolTableEntry):
9406 (JSC::SymbolTableEntry::~SymbolTableEntry):
9407 (JSC::SymbolTableEntry::operator=):
9408 (JSC::SymbolTableEntry::isNull):
9409 (JSC::SymbolTableEntry::getIndex):
9410 (JSC::SymbolTableEntry::getFast):
9411 (JSC::SymbolTableEntry::getAttributes):
9412 (JSC::SymbolTableEntry::isReadOnly):
9413 (JSC::SymbolTableEntry::watchpointSet):
9414 (JSC::SymbolTableEntry::notifyWrite):
9415 (FatEntry):
9416 (JSC::SymbolTableEntry::FatEntry::FatEntry):
9417 (JSC::SymbolTableEntry::isFat):
9418 (JSC::SymbolTableEntry::fatEntry):
9419 (JSC::SymbolTableEntry::inflate):
9420 (JSC::SymbolTableEntry::bits):
9421 (JSC::SymbolTableEntry::freeFatEntry):
9422 (JSC::SymbolTableEntry::pack):
9423 (JSC::SymbolTableEntry::isValidIndex):
9424
94252012-06-12 Filip Pizlo <fpizlo@apple.com>
9426
fpizlo@apple.com3bdd4c92012-06-13 04:56:22 +00009427 Unreviewed build fix for ARMv7 debug builds.
9428
9429 * jit/JITStubs.cpp:
9430 (JSC::JITThunks::JITThunks):
9431
ggaren@apple.com3c89f392012-06-13 02:50:50 +000094322012-06-12 Geoffrey Garen <ggaren@apple.com>
9433
9434 Build fix for case-sensitive file systems: use the right case.
9435
9436 * heap/ListableHandler.h:
9437
ggaren@apple.com639160c2012-06-13 02:06:50 +000094382012-06-11 Geoffrey Garen <ggaren@apple.com>
9439
9440 GC should be 1.7X faster
9441 https://bugs.webkit.org/show_bug.cgi?id=88840
9442
9443 Reviewed by Oliver Hunt.
9444
9445 I profiled, and removed anything that showed up as a concurrency
9446 bottleneck. Then, I added 3 threads to our max thread count, since we
9447 can scale up to more threads now.
9448
9449 * heap/BlockAllocator.cpp:
9450 (JSC::BlockAllocator::BlockAllocator):
9451 (JSC::BlockAllocator::~BlockAllocator):
9452 (JSC::BlockAllocator::releaseFreeBlocks):
9453 (JSC::BlockAllocator::waitForRelativeTimeWhileHoldingLock):
9454 (JSC::BlockAllocator::waitForRelativeTime):
9455 (JSC::BlockAllocator::blockFreeingThreadMain):
9456 * heap/BlockAllocator.h:
9457 (BlockAllocator):
9458 (JSC::BlockAllocator::allocate):
9459 (JSC::BlockAllocator::deallocate): Use a spin lock for the common case
9460 where we're just popping a linked list. (A pthread mutex would sleep our
9461 thread even if the lock were only contended for a microsecond.)
9462
9463 Scope the lock to avoid holding it while allocating VM, since that's a
9464 slow activity and it doesn't modify any of our data structures.
9465
9466 We still use a pthread mutex to handle our condition variable since we
9467 have to, and it's not a hot path.
9468
9469 * heap/CopiedSpace.cpp:
9470 (JSC::CopiedSpace::CopiedSpace):
9471 (JSC::CopiedSpace::doneFillingBlock):
9472 * heap/CopiedSpace.h:
9473 (JSC::CopiedSpace::CopiedSpace): Use a spin lock for the to space lock,
9474 since it just guards linked list and hash table manipulation.
9475
9476 * heap/MarkStack.cpp:
9477 (JSC::MarkStackSegmentAllocator::MarkStackSegmentAllocator):
9478 (JSC::MarkStackSegmentAllocator::allocate):
9479 (JSC::MarkStackSegmentAllocator::release):
9480 (JSC::MarkStackSegmentAllocator::shrinkReserve): Use a spin lock, since
9481 we're just managing a linked list.
9482
9483 (JSC::MarkStackArray::donateSomeCellsTo): Changed donation to be proportional
9484 to our current stack size. This fixes cases where we used to donate too
9485 much. Interestingly, donating too much was starving the donor (when it
9486 ran out of work later) *and* the recipient (since it had to wait on a
9487 long donation operation to complete before it could acquire the lock).
9488
9489 In the worst case, we're still guaranteed to donate N cells in roughly log N time.
9490
9491 This change also fixes cases where we used to donate too little, since
9492 we would always keep a fixed minimum number of cells. In the worst case,
9493 with N marking threads, would could have N large object graph roots in
9494 our stack for the duration of GC, and scale to only 1 thread.
9495
9496 It's an interesting observation that a single object in the mark stack
9497 might represent an arbitrarily large object graph -- and only the act
9498 of marking can find out.
9499
9500 (JSC::MarkStackArray::stealSomeCellsFrom): Steal in proportion to idle
9501 threads. Once again, this fixes cases where constants could cause us
9502 to steal too much or too little.
9503
9504 (JSC::SlotVisitor::donateKnownParallel): Always wake up other threads
9505 if they're idle. We can afford to do this because we're conservative
9506 about when we donate.
9507
9508 (JSC::SlotVisitor::drainFromShared):
9509 * heap/MarkStack.h:
9510 (MarkStackSegmentAllocator):
9511 (MarkStackArray):
9512 (JSC):
9513 * heap/SlotVisitor.h: Merged the "should I donate?" decision into a
9514 single function, for simplicity.
9515
9516 * runtime/Options.cpp:
9517 (minimumNumberOfScansBetweenRebalance): Reduced the delay before donation
9518 a lot. We can afford to do this because, in the common case, donation is
9519 a single branch that decides not to donate.
9520
9521 (cpusToUse): Use more CPUs now, since we scale better now.
9522
9523 * runtime/Options.h:
9524 (Options): Removed now-unused variables.
9525
fpizlo@apple.com53ef1042012-06-13 01:29:07 +000095262012-06-12 Filip Pizlo <fpizlo@apple.com>
9527
9528 REGRESSION(120121): inspector tests crash in DFG
9529 https://bugs.webkit.org/show_bug.cgi?id=88941
9530
9531 Reviewed by Geoffrey Garen.
9532
9533 The CFG simplifier has two different ways of fixing up GetLocal, Phantom, and Flush. If we've
9534 already fixed up the node one way, we shouldn't try the other way. The reason why we shouldn't
9535 is that the second way depends on the node referring to other nodes in the to-be-jettisoned
9536 block. After fixup they potentially will refer to nodes in the block being merged to.
9537
9538 * dfg/DFGCFGSimplificationPhase.cpp:
9539 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
9540 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
9541
leo.yang@torchmobile.com.cneac79cd2012-06-13 00:23:49 +000095422012-06-12 Leo Yang <leo.yang@torchmobile.com.cn>
9543
9544 Dynamic hash table in DOMObjectHashTableMap is wrong in multiple threads
9545 https://bugs.webkit.org/show_bug.cgi?id=87334
9546
9547 Reviewed by Geoffrey Garen.
9548
9549 Add a copy member function to JSC::HasTable. This function will copy all data
9550 members except for *table* which contains thread specific data that prevents
9551 up copying it. When you want to copy a JSC::HashTable that was constructed
9552 on another thread you should call JSC::HashTable::copy().
9553
9554 * runtime/Lookup.h:
9555 (JSC::HashTable::copy):
9556 (HashTable):
9557
fpizlo@apple.comdfd92802012-06-12 21:15:43 +000095582012-06-12 Filip Pizlo <fpizlo@apple.com>
9559
fpizlo@apple.com888325a2012-06-12 23:16:51 +00009560 DFG should not ASSERT if you have a double use of a variable that is not revealed to be a double
9561 until after CFG simplification
9562 https://bugs.webkit.org/show_bug.cgi?id=88927
9563 <rdar://problem/11513971>
9564
9565 Reviewed by Geoffrey Garen.
9566
9567 Speculation fixup needs to run if simplification did things, because simplification can change
9568 predictions - particularly if you had a control flow path that stored weird things into a
9569 variable, but that path got axed by the simplifier.
9570
9571 Running fixup in the fixpoint requires making it idempotent, which it previously wasn't. Only
9572 one place needed to be changed, namely the un-MustGenerate-ion of ValueToInt32.
9573
9574 * dfg/DFGDriver.cpp:
9575 (JSC::DFG::compile):
9576 * dfg/DFGFixupPhase.cpp:
9577 (JSC::DFG::FixupPhase::fixupNode):
9578
95792012-06-12 Filip Pizlo <fpizlo@apple.com>
9580
fpizlo@apple.comdfd92802012-06-12 21:15:43 +00009581 REGRESSION (r119779): Javascript TypeError: 'undefined' is not an object
9582 https://bugs.webkit.org/show_bug.cgi?id=88783
9583 <rdar://problem/11640299>
9584
9585 Reviewed by Geoffrey Garen.
9586
9587 If you don't keep alive the base of an object access over the various checks
9588 you do for the prototype chain, you're going to have a bad time.
9589
9590 * dfg/DFGByteCodeParser.cpp:
9591 (JSC::DFG::ByteCodeParser::handleGetById):
9592
commit-queue@webkit.orgce7e7ef2012-06-12 07:08:14 +000095932012-06-12 Hojong Han <hojong.han@samsung.com>
9594
9595 Property names of the built-in object cannot be retrieved
9596 after trying to delete one of its properties
9597 https://bugs.webkit.org/show_bug.cgi?id=86461
9598
9599 Reviewed by Gavin Barraclough.
9600
9601 * runtime/JSObject.cpp:
9602 (JSC::getClassPropertyNames):
9603 (JSC::JSObject::getOwnPropertyNames):
9604
gyuyoung.kim@samsung.com7a201592012-06-12 00:58:24 +000096052012-06-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
9606
9607 [CMAKE][EFL] Remove duplicated executable output path
9608 https://bugs.webkit.org/show_bug.cgi?id=88765
9609
9610 Reviewed by Daniel Bates.
9611
9612 CMake files for EFL port have redefined executable output path. However, EFL port doesn't
9613 need to define again because it is already defined in top-level CMake file.
9614
9615 * shell/CMakeLists.txt:
9616
carlosgc@webkit.orgf4fbe002012-06-11 15:31:19 +000096172012-06-11 Carlos Garcia Campos <cgarcia@igalia.com>
9618
9619 Unreviewed. Fix make distcheck issues.
9620
9621 * GNUmakefile.list.am: Remove non existent header file.
9622
paroga@webkit.org7a01e282012-06-10 12:25:57 +000096232012-06-10 Patrick Gansterer <paroga@webkit.org>
9624
paroga@webkit.orga601a8b2012-06-10 12:49:32 +00009625 Unreviewed. Build fix for !ENABLE(JIT) after r119844 and r119925.
9626
9627 * runtime/Executable.h:
9628 (ExecutableBase):
9629 (JSC::ExecutableBase::clearCodeVirtual):
9630
96312012-06-10 Patrick Gansterer <paroga@webkit.org>
9632
paroga@webkit.org7a01e282012-06-10 12:25:57 +00009633 Unreviewed. Build fix for !ENABLE(JIT) after r119844.
9634
9635 * runtime/Executable.h:
9636 (ExecutableBase):
9637 (JSC):
9638
dominicc@chromium.org2a95e332012-06-10 06:31:14 +000096392012-06-09 Dominic Cooney <dominicc@chromium.org>
9640
9641 [Chromium] Remove JavaScriptCore dependencies from gyp
9642 https://bugs.webkit.org/show_bug.cgi?id=88510
9643
9644 Reviewed by Adam Barth.
9645
9646 Chromium doesn't support JSC any more and there doesn't seem to be
9647 a strong interest in using GYP as the common build system in other
9648 ports.
9649
9650 * JavaScriptCore.gyp/JavaScriptCore.gyp: WebCore still depends on YARR interpreter.
9651 * JavaScriptCore.gypi: Only include YARR source.
9652 * gyp/JavaScriptCore.gyp: Removed.
9653 * gyp/gtk.gyp: Removed.
9654
ggaren@apple.com642da3e2012-06-09 17:34:30 +000096552012-06-09 Geoffrey Garen <ggaren@apple.com>
9656
9657 Unreviewed, rolling back in part2 of r118646.
9658
9659 This patch removes eager finalization.
9660
9661 Weak pointer finalization should be lazy
9662 https://bugs.webkit.org/show_bug.cgi?id=87599
9663
9664 Reviewed by Sam Weinig.
9665
9666 * heap/Heap.cpp:
9667 (JSC::Heap::collect): Don't finalize eagerly -- we'll do it lazily.
9668
9669 * heap/MarkedBlock.cpp:
9670 (JSC::MarkedBlock::sweep): Do sweep weak sets when sweeping a block,
9671 since we won't get another chance.
9672
9673 * heap/MarkedBlock.h:
9674 (JSC::MarkedBlock::sweepWeakSet):
9675 * heap/MarkedSpace.cpp:
9676 (MarkedSpace::WeakSetSweep):
9677 * heap/MarkedSpace.h:
9678 (JSC::MarkedSpace::sweepWeakSets): Removed now-unused code.
9679
commit-queue@webkit.org5deb7492012-06-09 09:05:22 +000096802012-06-09 Sukolsak Sakshuwong <sukolsak@google.com>
9681
9682 Add UNDO_MANAGER flag
9683 https://bugs.webkit.org/show_bug.cgi?id=87908
9684
9685 Reviewed by Tony Chang.
9686
9687 * Configurations/FeatureDefines.xcconfig:
9688
ggaren@apple.com642da3e2012-06-09 17:34:30 +000096892012-06-08 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com218a16a2012-06-08 23:57:58 +00009690
9691 Unreviewed, rolling back in part1 of r118646.
9692
9693 This patch includes everything necessary for lazy finalization, but
9694 keeps eager finalization enabled for the time being.
9695
9696 Weak pointer finalization should be lazy
9697 https://bugs.webkit.org/show_bug.cgi?id=87599
9698
9699 Reviewed by Sam Weinig.
9700
9701 * heap/MarkedBlock.cpp:
9702 * heap/MarkedBlock.h:
9703 (JSC::MarkedBlock::resetAllocator):
9704 * heap/MarkedSpace.cpp:
9705 (JSC::MarkedSpace::resetAllocators):
9706 * heap/MarkedSpace.h:
9707 (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
9708 It will happen automatically when a weak set is swept. It's simpler to
9709 have only one canonical way for this to happen, and it wasn't buying
9710 us anything to do it eagerly.
9711 * heap/WeakBlock.cpp:
9712 (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
9713 the sweep would be a no-op. If even one finalizer is pending, we need to
9714 run it, since we won't get another chance.
9715 * heap/WeakSet.cpp:
9716 (JSC::WeakSet::sweep): This loop can be simpler now that
9717 WeakBlock::sweep() does what we mean.
9718 Reset our allocator after a sweep because this is the optimal time to
9719 start trying to recycle old weak pointers.
9720 (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
9721 allocator because we've swept already, and forcing a new sweep would be
9722 wasteful.
9723 * heap/WeakSet.h:
9724 (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
9725 because the shrink may have removed the block the allocator was going to
9726 allocate out of.
9727
barraclough@apple.com9dd771c2012-06-08 21:30:35 +000097282012-06-08 Gavin Barraclough <barraclough@apple.com>
9729
9730 Unreviewed roll out r119795.
9731
9732 This broke jquery/core.html
9733
9734 * dfg/DFGSpeculativeJIT.h:
9735 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
9736 * jit/JITInlineMethods.h:
9737 (JSC::JIT::emitAllocateBasicJSObject):
9738 * llint/LowLevelInterpreter.asm:
9739 * runtime/JSGlobalData.h:
9740 (JSGlobalData):
9741 * runtime/JSGlobalThis.cpp:
9742 (JSC::JSGlobalThis::setUnwrappedObject):
9743 * runtime/JSObject.cpp:
9744 (JSC::JSObject::visitChildren):
9745 (JSC::JSObject::createInheritorID):
9746 * runtime/JSObject.h:
9747 (JSObject):
9748 (JSC::JSObject::resetInheritorID):
9749 (JSC):
9750 (JSC::JSObject::offsetOfInheritorID):
9751 (JSC::JSObject::inheritorID):
9752
fpizlo@apple.com0bcbc112012-06-08 20:02:57 +000097532012-06-08 Filip Pizlo <fpizlo@apple.com>
9754
9755 PredictedType should be called SpeculatedType
9756 https://bugs.webkit.org/show_bug.cgi?id=88477
9757
9758 Unreviewed, fix a renaming goof from http://trac.webkit.org/changeset/119660.
9759 I accidentally renamed ByteCodeParser::getPrediction to
9760 ByteCodeParser::getSpeculation. That was not the intent. This changes it
9761 back.
9762
9763 * dfg/DFGByteCodeParser.cpp:
9764 (JSC::DFG::ByteCodeParser::addCall):
9765 (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
9766 (JSC::DFG::ByteCodeParser::getPrediction):
9767 (JSC::DFG::ByteCodeParser::handleCall):
9768 (JSC::DFG::ByteCodeParser::parseBlock):
9769
wingo@igalia.com332e9bf2012-06-08 19:57:40 +000097702012-06-08 Andy Wingo <wingo@igalia.com>
9771
9772 Explictly mark stubs called by JIT as being internal
9773 https://bugs.webkit.org/show_bug.cgi?id=88552
9774
9775 Reviewed by Filip Pizlo.
9776
9777 * dfg/DFGOSRExitCompiler.h:
9778 * dfg/DFGOperations.cpp:
9779 * dfg/DFGOperations.h:
9780 * jit/HostCallReturnValue.h:
9781 * jit/JITStubs.cpp:
9782 * jit/JITStubs.h:
9783 * jit/ThunkGenerators.cpp:
9784 * llint/LLIntSlowPaths.h: Mark a bunch of stubs as being
9785 WTF_INTERNAL. Change most calls to SYMBOL_STRING_RELOCATION to
9786 LOCAL_REFERENCE, or GLOBAL_REFERENCE in the case of the wrappers
9787 to truly global symbols.
9788 * offlineasm/asm.rb: Generate LOCAL_REFERENCE instead of
9789 SYMBOL_STRING_RELOCATION.
9790
fpizlo@apple.comf4a2ac32012-06-08 20:04:47 +000097912012-06-08 Geoffrey Garen <ggaren@apple.com>
9792
ggaren@apple.comd7147572012-06-08 18:17:16 +00009793 Don't rely on weak pointers for eager CodeBlock finalization
9794 https://bugs.webkit.org/show_bug.cgi?id=88465
9795
9796 Reviewed by Gavin Barraclough.
9797
9798 This is incompatible with lazy weak pointer finalization.
9799
9800 I considered just making CodeBlock finalization lazy-friendly, but it
9801 turns out that the heap is already way up in CodeBlock's business when
9802 it comes to finalization, so I decided to finish the job and move full
9803 responsibility for CodeBlock finalization into the heap.
9804
9805 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Maybe this
9806 will build.
9807
9808 * debugger/Debugger.cpp: Updated for rename.
9809
9810 * heap/Heap.cpp:
9811 (JSC::Heap::deleteAllCompiledCode): Renamed for consistency. Fixed a bug
9812 where we would not delete code for a code block that had been previously
9813 jettisoned. I don't know if this happens in practice -- I mostly did
9814 this to improve consistency with deleteUnmarkedCompiledCode.
9815
9816 (JSC::Heap::deleteUnmarkedCompiledCode): New function, responsible for
9817 eager finalization of unmarked code blocks.
9818
9819 (JSC::Heap::collect): Updated for rename. Updated to call
9820 deleteUnmarkedCompiledCode(), which takes care of jettisoned DFG code
9821 blocks too.
9822
9823 (JSC::Heap::addCompiledCode): Renamed, since this points to all code
9824 now, not just functions.
9825
9826 * heap/Heap.h:
9827 (Heap): Keep track of all user code, not just functions. This is a
9828 negligible additional overhead, since most code is function code.
9829
9830 * runtime/Executable.cpp:
9831 (JSC::*::finalize): Removed these functions, since we don't rely on
9832 weak pointer finalization anymore.
9833
9834 (JSC::FunctionExecutable::FunctionExecutable): Moved linked-list stuff
9835 into base class so all executables can be in the list.
9836
9837 (JSC::EvalExecutable::clearCode):
9838 (JSC::ProgramExecutable::clearCode):
9839 (JSC::FunctionExecutable::clearCode): All we need to do is delete our
9840 CodeBlock -- that will delete all of its internal data structures.
9841
9842 (JSC::FunctionExecutable::clearCodeIfNotCompiling): Factored out a helper
9843 function to improve clarity.
9844
9845 * runtime/Executable.h:
9846 (JSC::ExecutableBase): Moved linked-list stuff
9847 into base class so all executables can be in the list.
9848
9849 (JSC::NativeExecutable::create):
9850 (NativeExecutable):
9851 (ScriptExecutable):
9852 (JSC::ScriptExecutable::finishCreation):
9853 (JSC::EvalExecutable::create):
9854 (EvalExecutable):
9855 (JSC::ProgramExecutable::create):
9856 (ProgramExecutable):
9857 (FunctionExecutable):
9858 (JSC::FunctionExecutable::create): Don't use a finalizer -- the heap
9859 will call us back to destroy our code block.
9860
9861 (JSC::FunctionExecutable::discardCode): Renamed to clearCodeIfNotCompiling()
9862 for clarity.
9863
9864 (JSC::FunctionExecutable::isCompiling): New helper function, for clarity.
9865
9866 (JSC::ScriptExecutable::clearCodeVirtual): New helper function, since
9867 the heap needs to make polymorphic calls to clear code.
9868
9869 * runtime/JSGlobalData.cpp:
9870 (JSC::StackPreservingRecompiler::operator()):
9871 * runtime/JSGlobalObject.cpp:
9872 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
9873 renames.
9874
fpizlo@apple.comfd598b92012-06-08 01:31:21 +000098752012-06-07 Filip Pizlo <fpizlo@apple.com>
9876
9877 DFG should inline prototype chain accesses, and do the right things if the
9878 specific function optimization is available
9879 https://bugs.webkit.org/show_bug.cgi?id=88594
9880
9881 Reviewed by Gavin Barraclough.
9882
9883 Looks like a 3% win on V8.
9884
9885 * bytecode/CodeBlock.h:
9886 (JSC::Structure::prototypeForLookup):
9887 (JSC):
9888 * bytecode/GetByIdStatus.cpp:
9889 (JSC::GetByIdStatus::computeFromLLInt):
9890 (JSC):
9891 (JSC::GetByIdStatus::computeForChain):
9892 (JSC::GetByIdStatus::computeFor):
9893 * bytecode/GetByIdStatus.h:
9894 (JSC::GetByIdStatus::GetByIdStatus):
9895 (JSC::GetByIdStatus::isSimple):
9896 (JSC::GetByIdStatus::chain):
9897 (JSC::GetByIdStatus::specificValue):
9898 (GetByIdStatus):
9899 * bytecode/StructureSet.h:
9900 (StructureSet):
9901 (JSC::StructureSet::singletonStructure):
9902 * bytecode/StructureStubInfo.h:
9903 (JSC::StructureStubInfo::initGetByIdProto):
9904 (JSC::StructureStubInfo::initGetByIdChain):
9905 * dfg/DFGByteCodeParser.cpp:
9906 (JSC::DFG::ByteCodeParser::handleGetById):
9907 * dfg/DFGRepatch.cpp:
9908 (JSC::DFG::tryCacheGetByID):
9909 * jit/JITStubs.cpp:
9910 (JSC::JITThunks::tryCacheGetByID):
9911 * runtime/JSGlobalObject.h:
9912 (JSC::Structure::prototypeForLookup):
9913 (JSC):
9914 * runtime/Structure.h:
9915 (Structure):
9916
barraclough@apple.com48386932012-06-08 00:29:27 +000099172012-06-07 Gavin Barraclough <barraclough@apple.com>
9918
barraclough@apple.com64b74e02012-06-08 04:25:58 +00009919 Remove JSObject::m_inheritorID
9920 https://bugs.webkit.org/show_bug.cgi?id=88378
9921
9922 Reviewed by Geoff Garen.
9923
9924 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
9925 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
9926 Instead use a private named value in the object's property storage.
9927
9928 * dfg/DFGSpeculativeJIT.h:
9929 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
9930 - No need m_inheritorID to initialize!
9931 * jit/JITInlineMethods.h:
9932 (JSC::JIT::emitAllocateBasicJSObject):
9933 - No need m_inheritorID to initialize!
9934 * llint/LowLevelInterpreter.asm:
9935 - No need m_inheritorID to initialize!
9936 * runtime/JSGlobalData.h:
9937 (JSGlobalData):
9938 - Added private name 'm_inheritorIDKey'.
9939 * runtime/JSGlobalThis.cpp:
9940 (JSC::JSGlobalThis::setUnwrappedObject):
9941 - resetInheritorID is now passed a JSGlobalData&.
9942 * runtime/JSObject.cpp:
9943 (JSC::JSObject::visitChildren):
9944 - No m_inheritorID to be marked.
9945 (JSC::JSObject::createInheritorID):
9946 - Store the newly created inheritorID in the property map.
9947 * runtime/JSObject.h:
9948 (JSC::JSObject::resetInheritorID):
9949 - Remove the inheritorID from property storage.
9950 (JSC::JSObject::inheritorID):
9951 - Read the inheritorID from property storage.
9952
99532012-06-07 Gavin Barraclough <barraclough@apple.com>
9954
barraclough@apple.com48386932012-06-08 00:29:27 +00009955 Math.pow on iOS does not support denormal numbers.
9956 https://bugs.webkit.org/show_bug.cgi?id=88592
9957
9958 Reviewed by Filip Pizlo.
9959
9960 Import an implementation from fdlibm, detect cases where it is safe to use the system
9961 implementation & where we should fall back to fdlibm.
9962
9963 * runtime/MathObject.cpp:
9964 (JSC::isDenormal):
9965 (JSC::isEdgeCase):
9966 (JSC::mathPow):
9967 - On iOS, detect cases where denormal support may be required & use fdlibm in these cases.
9968 (JSC::mathProtoFuncPow):
9969 - Changed to use mathPow.
9970 (JSC::fdlibmScalbn):
9971 (JSC::fdlibmPow):
9972 - These functions imported from fdlibm; original style retained to ease future merging.
9973
paroga@webkit.orga334f732012-06-07 23:24:14 +000099742012-06-07 Patrick Gansterer <paroga@webkit.org>
9975
9976 Unreviewed. Build fix for !ENABLE(JIT) after r119441.
9977
9978 * interpreter/Interpreter.cpp:
9979 (JSC::Interpreter::privateExecute):
9980
wingo@igalia.comb8305a82012-06-07 16:05:19 +000099812012-06-07 Andy Wingo <wingo@igalia.com>
9982
9983 Unreviewed build fix after r119593.
9984
9985 * llint/LLIntOfflineAsmConfig.h (OFFLINE_ASM_GLOBAL_LABEL): Fix
9986 uses of "name" to be "label", the macro's parameter. Otherwise we
9987 serialize mentions of the literal symbol "name" into the objcode.
9988 Causes a build error using GNU ld (not gold).
9989
rniwa@webkit.org475cf8d2012-06-07 02:47:14 +000099902012-06-06 Ryosuke Niwa <rniwa@webkit.org>
9991
9992 Chromium build fix attempt. Why do we need to list these files in gyp!?
9993
9994 * JavaScriptCore.gypi:
9995
fpizlo@apple.comd5547492012-06-07 00:23:36 +000099962012-06-06 Filip Pizlo <fpizlo@apple.com>
9997
fpizlo@apple.com62336162012-06-07 01:35:59 +00009998 PredictedType should be called SpeculatedType
9999 https://bugs.webkit.org/show_bug.cgi?id=88477
10000
10001 Rubber stamped by Gavin Barraclough.
10002
10003 * CMakeLists.txt:
10004 * GNUmakefile.list.am:
10005 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10006 * JavaScriptCore.xcodeproj/project.pbxproj:
10007 * Target.pri:
10008 * bytecode/CodeBlock.cpp:
10009 (JSC::CodeBlock::shouldOptimizeNow):
10010 (JSC::CodeBlock::dumpValueProfiles):
10011 * bytecode/CodeBlock.h:
10012 (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
10013 * bytecode/LazyOperandValueProfile.cpp:
10014 (JSC::LazyOperandValueProfileParser::prediction):
10015 * bytecode/LazyOperandValueProfile.h:
10016 (LazyOperandValueProfileParser):
10017 * bytecode/PredictedType.cpp: Removed.
10018 * bytecode/PredictedType.h: Removed.
10019 * bytecode/SpeculatedType.cpp: Copied from Source/JavaScriptCore/bytecode/PredictedType.cpp.
10020 (JSC::speculationToString):
10021 (JSC::speculationToAbbreviatedString):
10022 (JSC::speculationFromClassInfo):
10023 (JSC::speculationFromStructure):
10024 (JSC::speculationFromCell):
10025 (JSC::speculationFromValue):
10026 * bytecode/SpeculatedType.h: Copied from Source/JavaScriptCore/bytecode/PredictedType.h.
10027 (JSC):
10028 (JSC::isAnySpeculation):
10029 (JSC::isCellSpeculation):
10030 (JSC::isObjectSpeculation):
10031 (JSC::isFinalObjectSpeculation):
10032 (JSC::isFinalObjectOrOtherSpeculation):
10033 (JSC::isFixedIndexedStorageObjectSpeculation):
10034 (JSC::isStringSpeculation):
10035 (JSC::isArraySpeculation):
10036 (JSC::isFunctionSpeculation):
10037 (JSC::isInt8ArraySpeculation):
10038 (JSC::isInt16ArraySpeculation):
10039 (JSC::isInt32ArraySpeculation):
10040 (JSC::isUint8ArraySpeculation):
10041 (JSC::isUint8ClampedArraySpeculation):
10042 (JSC::isUint16ArraySpeculation):
10043 (JSC::isUint32ArraySpeculation):
10044 (JSC::isFloat32ArraySpeculation):
10045 (JSC::isFloat64ArraySpeculation):
10046 (JSC::isArgumentsSpeculation):
10047 (JSC::isActionableIntMutableArraySpeculation):
10048 (JSC::isActionableFloatMutableArraySpeculation):
10049 (JSC::isActionableTypedMutableArraySpeculation):
10050 (JSC::isActionableMutableArraySpeculation):
10051 (JSC::isActionableArraySpeculation):
10052 (JSC::isArrayOrOtherSpeculation):
10053 (JSC::isMyArgumentsSpeculation):
10054 (JSC::isInt32Speculation):
10055 (JSC::isDoubleRealSpeculation):
10056 (JSC::isDoubleSpeculation):
10057 (JSC::isNumberSpeculation):
10058 (JSC::isBooleanSpeculation):
10059 (JSC::isOtherSpeculation):
10060 (JSC::isEmptySpeculation):
10061 (JSC::mergeSpeculations):
10062 (JSC::mergeSpeculation):
10063 * bytecode/StructureSet.h:
10064 (JSC::StructureSet::speculationFromStructures):
10065 * bytecode/ValueProfile.h:
10066 (JSC::ValueProfileBase::ValueProfileBase):
10067 (JSC::ValueProfileBase::dump):
10068 (JSC::ValueProfileBase::computeUpdatedPrediction):
10069 (ValueProfileBase):
10070 * dfg/DFGAbstractState.cpp:
10071 (JSC::DFG::AbstractState::initialize):
10072 (JSC::DFG::AbstractState::execute):
10073 (JSC::DFG::AbstractState::mergeStateAtTail):
10074 * dfg/DFGAbstractState.h:
10075 (JSC::DFG::AbstractState::speculateInt32Unary):
10076 (JSC::DFG::AbstractState::speculateNumberUnary):
10077 (JSC::DFG::AbstractState::speculateBooleanUnary):
10078 (JSC::DFG::AbstractState::speculateInt32Binary):
10079 (JSC::DFG::AbstractState::speculateNumberBinary):
10080 * dfg/DFGAbstractValue.h:
10081 (JSC::DFG::StructureAbstractValue::filter):
10082 (JSC::DFG::StructureAbstractValue::speculationFromStructures):
10083 (JSC::DFG::AbstractValue::AbstractValue):
10084 (JSC::DFG::AbstractValue::clear):
10085 (JSC::DFG::AbstractValue::isClear):
10086 (JSC::DFG::AbstractValue::makeTop):
10087 (JSC::DFG::AbstractValue::clobberStructures):
10088 (JSC::DFG::AbstractValue::isTop):
10089 (JSC::DFG::AbstractValue::set):
10090 (JSC::DFG::AbstractValue::merge):
10091 (JSC::DFG::AbstractValue::filter):
10092 (JSC::DFG::AbstractValue::validateIgnoringValue):
10093 (JSC::DFG::AbstractValue::validate):
10094 (JSC::DFG::AbstractValue::checkConsistency):
10095 (JSC::DFG::AbstractValue::dump):
10096 (AbstractValue):
10097 * dfg/DFGArgumentPosition.h:
10098 (JSC::DFG::ArgumentPosition::ArgumentPosition):
10099 (JSC::DFG::ArgumentPosition::mergeArgumentAwareness):
10100 (JSC::DFG::ArgumentPosition::prediction):
10101 (ArgumentPosition):
10102 * dfg/DFGArgumentsSimplificationPhase.cpp:
10103 (JSC::DFG::ArgumentsSimplificationPhase::run):
10104 * dfg/DFGByteCodeParser.cpp:
10105 (ByteCodeParser):
10106 (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation):
10107 (JSC::DFG::ByteCodeParser::getLocal):
10108 (JSC::DFG::ByteCodeParser::getArgument):
10109 (JSC::DFG::ByteCodeParser::addCall):
10110 (JSC::DFG::ByteCodeParser::getSpeculationWithoutOSRExit):
10111 (JSC::DFG::ByteCodeParser::getSpeculation):
10112 (InlineStackEntry):
10113 (JSC::DFG::ByteCodeParser::handleCall):
10114 (JSC::DFG::ByteCodeParser::handleIntrinsic):
10115 (JSC::DFG::ByteCodeParser::handleGetById):
10116 (JSC::DFG::ByteCodeParser::parseBlock):
10117 (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
10118 (JSC::DFG::ByteCodeParser::parse):
10119 * dfg/DFGCSEPhase.cpp:
10120 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
10121 (JSC::DFG::CSEPhase::performNodeCSE):
10122 * dfg/DFGConstantFoldingPhase.cpp:
10123 (JSC::DFG::ConstantFoldingPhase::run):
10124 * dfg/DFGFixupPhase.cpp:
10125 (JSC::DFG::FixupPhase::fixupNode):
10126 (JSC::DFG::FixupPhase::fixDoubleEdge):
10127 * dfg/DFGGraph.cpp:
10128 (JSC::DFG::Graph::nameOfVariableAccessData):
10129 (JSC::DFG::Graph::dump):
10130 (JSC::DFG::Graph::predictArgumentTypes):
10131 * dfg/DFGGraph.h:
10132 (JSC::DFG::Graph::getJSConstantSpeculation):
10133 (JSC::DFG::Graph::isPredictedNumerical):
10134 (JSC::DFG::Graph::byValIsPure):
10135 * dfg/DFGJITCompiler.h:
10136 (JSC::DFG::JITCompiler::getSpeculation):
10137 * dfg/DFGNode.h:
10138 (JSC::DFG::Node::Node):
10139 (JSC::DFG::Node::getHeapPrediction):
10140 (JSC::DFG::Node::predictHeap):
10141 (JSC::DFG::Node::prediction):
10142 (JSC::DFG::Node::predict):
10143 (JSC::DFG::Node::shouldSpeculateInteger):
10144 (JSC::DFG::Node::shouldSpeculateDouble):
10145 (JSC::DFG::Node::shouldSpeculateNumber):
10146 (JSC::DFG::Node::shouldSpeculateBoolean):
10147 (JSC::DFG::Node::shouldSpeculateFinalObject):
10148 (JSC::DFG::Node::shouldSpeculateFinalObjectOrOther):
10149 (JSC::DFG::Node::shouldSpeculateArray):
10150 (JSC::DFG::Node::shouldSpeculateArguments):
10151 (JSC::DFG::Node::shouldSpeculateInt8Array):
10152 (JSC::DFG::Node::shouldSpeculateInt16Array):
10153 (JSC::DFG::Node::shouldSpeculateInt32Array):
10154 (JSC::DFG::Node::shouldSpeculateUint8Array):
10155 (JSC::DFG::Node::shouldSpeculateUint8ClampedArray):
10156 (JSC::DFG::Node::shouldSpeculateUint16Array):
10157 (JSC::DFG::Node::shouldSpeculateUint32Array):
10158 (JSC::DFG::Node::shouldSpeculateFloat32Array):
10159 (JSC::DFG::Node::shouldSpeculateFloat64Array):
10160 (JSC::DFG::Node::shouldSpeculateArrayOrOther):
10161 (JSC::DFG::Node::shouldSpeculateObject):
10162 (JSC::DFG::Node::shouldSpeculateCell):
10163 (Node):
10164 * dfg/DFGPredictionPropagationPhase.cpp:
10165 (JSC::DFG::PredictionPropagationPhase::setPrediction):
10166 (JSC::DFG::PredictionPropagationPhase::mergePrediction):
10167 (JSC::DFG::PredictionPropagationPhase::propagate):
10168 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
10169 * dfg/DFGSpeculativeJIT.cpp:
10170 (JSC::DFG::SpeculativeJIT::fillStorage):
10171 (JSC::DFG::SpeculativeJIT::writeBarrier):
10172 (JSC::DFG::GPRTemporary::GPRTemporary):
10173 (JSC::DFG::FPRTemporary::FPRTemporary):
10174 (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
10175 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
10176 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
10177 (JSC::DFG::SpeculativeJIT::compile):
10178 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
10179 (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt):
10180 (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
10181 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
10182 (JSC::DFG::SpeculativeJIT::compileDoubleAsInt32):
10183 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
10184 (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
10185 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
10186 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
10187 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
10188 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
10189 (JSC::DFG::SpeculativeJIT::compileInstanceOf):
10190 (JSC::DFG::SpeculativeJIT::compileAdd):
10191 (JSC::DFG::SpeculativeJIT::compileArithSub):
10192 (JSC::DFG::SpeculativeJIT::compileArithNegate):
10193 (JSC::DFG::SpeculativeJIT::compileArithMul):
10194 (JSC::DFG::SpeculativeJIT::compileArithMod):
10195 (JSC::DFG::SpeculativeJIT::compare):
10196 (JSC::DFG::SpeculativeJIT::compileStrictEq):
10197 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
10198 (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
10199 (JSC::DFG::SpeculativeJIT::compileGetArgumentsLength):
10200 (JSC::DFG::SpeculativeJIT::compileRegExpExec):
10201 * dfg/DFGSpeculativeJIT.h:
10202 (DFG):
10203 (JSC::DFG::ValueSource::forSpeculation):
10204 (SpeculativeJIT):
10205 (GPRTemporary):
10206 (FPRTemporary):
10207 (JSC::DFG::SpecDoubleOperand::SpecDoubleOperand):
10208 (JSC::DFG::SpecDoubleOperand::~SpecDoubleOperand):
10209 (JSC::DFG::SpecDoubleOperand::fpr):
10210 (JSC::DFG::SpecCellOperand::SpecCellOperand):
10211 (JSC::DFG::SpecCellOperand::~SpecCellOperand):
10212 (JSC::DFG::SpecCellOperand::gpr):
10213 (JSC::DFG::SpecBooleanOperand::SpecBooleanOperand):
10214 (JSC::DFG::SpecBooleanOperand::~SpecBooleanOperand):
10215 (JSC::DFG::SpecBooleanOperand::gpr):
10216 * dfg/DFGSpeculativeJIT32_64.cpp:
10217 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
10218 (JSC::DFG::SpeculativeJIT::fillSpecDouble):
10219 (JSC::DFG::SpeculativeJIT::fillSpecCell):
10220 (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
10221 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
10222 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
10223 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
10224 (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
10225 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
10226 (JSC::DFG::SpeculativeJIT::emitBranch):
10227 (JSC::DFG::SpeculativeJIT::compile):
10228 * dfg/DFGSpeculativeJIT64.cpp:
10229 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
10230 (JSC::DFG::SpeculativeJIT::fillSpecDouble):
10231 (JSC::DFG::SpeculativeJIT::fillSpecCell):
10232 (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
10233 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
10234 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
10235 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
10236 (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
10237 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
10238 (JSC::DFG::SpeculativeJIT::emitBranch):
10239 (JSC::DFG::SpeculativeJIT::compile):
10240 * dfg/DFGVariableAccessData.h:
10241 (JSC::DFG::VariableAccessData::VariableAccessData):
10242 (JSC::DFG::VariableAccessData::predict):
10243 (JSC::DFG::VariableAccessData::nonUnifiedPrediction):
10244 (JSC::DFG::VariableAccessData::prediction):
10245 (JSC::DFG::VariableAccessData::argumentAwarePrediction):
10246 (JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction):
10247 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
10248 (JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
10249 (VariableAccessData):
10250
102512012-06-06 Filip Pizlo <fpizlo@apple.com>
10252
fpizlo@apple.com26af9b62012-06-07 00:49:34 +000010253 Global object variable accesses should not require an extra load
10254 https://bugs.webkit.org/show_bug.cgi?id=88385
10255
10256 Reviewed by Gavin Barraclough and Geoffrey Garen.
10257
10258 Previously, if you wanted to access a global variable, you'd first have
10259 to load the register array from the appropriate global object and then
10260 either load or store at an offset to the register array. This is because
10261 JSGlobalObject inherited from JSVariableObject, and JSVariableObject is
10262 designed with the pessimistic assumption that its register array may
10263 point into the call stack. This is never the case for global objects.
10264 Hence, even though the global object may add more registers at any time,
10265 it does not need to store them in a contiguous array. It can use a
10266 SegmentedVector or similar.
10267
10268 This patch refactors global objects and variable objects as follows:
10269
10270 - The functionality to track variables in an indexable array using a
10271 SymbolTable to map names to indices is moved into JSSymbolTableObject,
10272 which is now a supertype of JSVariableObject. JSVariableObject is now
10273 just a holder for a registers array and implements the registerAt()
10274 method that is left abstract in JSSymbolTableObject. Because all users
10275 of JSVariableObject know whether they are a JSStaticScopeObject,
10276 JSActivation, or JSGlobalObject, this "abstract" method is not virtual;
10277 instead the utility methods that would call registerAt() are now
10278 template functions that require you to know statically what subtype of
10279 JSSymbolTableObject you're using (JSVariableObject or something else),
10280 so that registerAt() can be statically bound.
10281
10282 - A new class is added called JSSegmentedVariableObject, which only
10283 differs from JSVariableObject in how it allocates registers. It uses a
10284 SegmentedVector instead of manually managing a pointer to a contiguous
10285 slab of registers. This changes the interface somewhat; for example
10286 with JSVariableObject if you wanted to add a register you had to do
10287 it yourself since the JSVariableObject didn't know how the registers
10288 array ought to be allocated. With JSSegmentedVariableObject you can
10289 just call addRegisters(). JSSegmentedVariableObject preserves the
10290 invariant that once you get a pointer into a register, that pointer
10291 will continue to be valid so long as the JSSegmentedVariableObject is
10292 alive. This allows the JITs and interpreters to skip the extra load.
10293
10294 - JSGlobalObject now inherits from JSSegmentedVariableObject. For now
10295 (and possibly forever) it is the only subtype of this new class.
10296
10297 - The bytecode format is changed so that get_global_var and
10298 put_global_var have a pointer to the register directly rather than
10299 having an index. A convenience method is provided in
10300 JSSegmentedVariableObject to get the index given a a pointer, which is
10301 used for assertions and debug dumps.
10302
10303 This appears to be a 1% across the board win.
10304
10305 * CMakeLists.txt:
10306 * GNUmakefile.list.am:
10307 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10308 * JavaScriptCore.xcodeproj/project.pbxproj:
10309 * Target.pri:
10310 * bytecode/CodeBlock.cpp:
10311 (JSC::CodeBlock::dump):
10312 * bytecode/Instruction.h:
10313 (Instruction):
10314 (JSC::Instruction::Instruction):
10315 * bytecompiler/BytecodeGenerator.cpp:
10316 (JSC::ResolveResult::registerPointer):
10317 (JSC):
10318 (JSC::BytecodeGenerator::BytecodeGenerator):
10319 (JSC::BytecodeGenerator::retrieveLastUnaryOp):
10320 (JSC::BytecodeGenerator::resolve):
10321 (JSC::BytecodeGenerator::resolveConstDecl):
10322 (JSC::BytecodeGenerator::emitGetStaticVar):
10323 (JSC::BytecodeGenerator::emitPutStaticVar):
10324 * bytecompiler/BytecodeGenerator.h:
10325 (ResolveResult):
10326 (BytecodeGenerator):
10327 * dfg/DFGAssemblyHelpers.h:
10328 (AssemblyHelpers):
10329 * dfg/DFGByteCodeParser.cpp:
10330 (JSC::DFG::ByteCodeParser::parseBlock):
10331 * dfg/DFGCSEPhase.cpp:
10332 (JSC::DFG::CSEPhase::globalVarLoadElimination):
10333 (JSC::DFG::CSEPhase::globalVarStoreElimination):
10334 (JSC::DFG::CSEPhase::performNodeCSE):
10335 * dfg/DFGGraph.cpp:
10336 (JSC::DFG::Graph::dump):
10337 * dfg/DFGGraph.h:
10338 (JSC::DFG::Graph::globalObjectFor):
10339 (Graph):
10340 * dfg/DFGNode.h:
10341 (JSC::DFG::Node::hasVarNumber):
10342 (Node):
10343 (JSC::DFG::Node::hasRegisterPointer):
10344 (JSC::DFG::Node::registerPointer):
10345 * dfg/DFGSpeculativeJIT32_64.cpp:
10346 (JSC::DFG::SpeculativeJIT::compile):
10347 * dfg/DFGSpeculativeJIT64.cpp:
10348 (JSC::DFG::SpeculativeJIT::compile):
10349 * heap/Heap.h:
10350 (Heap):
10351 (JSC::Heap::isWriteBarrierEnabled):
10352 (JSC):
10353 * interpreter/Interpreter.cpp:
10354 (JSC::Interpreter::execute):
10355 (JSC::Interpreter::privateExecute):
10356 * jit/JITPropertyAccess.cpp:
10357 (JSC::JIT::emit_op_get_global_var):
10358 (JSC::JIT::emit_op_put_global_var):
10359 * jit/JITPropertyAccess32_64.cpp:
10360 (JSC::JIT::emit_op_get_global_var):
10361 (JSC::JIT::emit_op_put_global_var):
10362 * llint/LowLevelInterpreter32_64.asm:
10363 * llint/LowLevelInterpreter64.asm:
10364 * runtime/JSGlobalObject.cpp:
10365 (JSC):
10366 (JSC::JSGlobalObject::put):
10367 (JSC::JSGlobalObject::putDirectVirtual):
10368 (JSC::JSGlobalObject::defineOwnProperty):
10369 (JSC::JSGlobalObject::visitChildren):
10370 (JSC::JSGlobalObject::addStaticGlobals):
10371 (JSC::JSGlobalObject::getOwnPropertySlot):
10372 (JSC::JSGlobalObject::getOwnPropertyDescriptor):
10373 * runtime/JSGlobalObject.h:
10374 (JSGlobalObject):
10375 (JSC::JSGlobalObject::JSGlobalObject):
10376 (JSC):
10377 (JSC::JSGlobalObject::hasOwnPropertyForWrite):
10378 * runtime/JSSegmentedVariableObject.cpp: Added.
10379 (JSC):
10380 (JSC::JSSegmentedVariableObject::findRegisterIndex):
10381 (JSC::JSSegmentedVariableObject::addRegisters):
10382 (JSC::JSSegmentedVariableObject::visitChildren):
10383 * runtime/JSSegmentedVariableObject.h: Added.
10384 (JSC):
10385 (JSSegmentedVariableObject):
10386 (JSC::JSSegmentedVariableObject::registerAt):
10387 (JSC::JSSegmentedVariableObject::assertRegisterIsInThisObject):
10388 (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
10389 (JSC::JSSegmentedVariableObject::finishCreation):
10390 * runtime/JSStaticScopeObject.cpp:
10391 (JSC::JSStaticScopeObject::put):
10392 (JSC::JSStaticScopeObject::putDirectVirtual):
10393 (JSC::JSStaticScopeObject::getOwnPropertySlot):
10394 * runtime/JSSymbolTableObject.cpp: Added.
10395 (JSC):
10396 (JSC::JSSymbolTableObject::destroy):
10397 (JSC::JSSymbolTableObject::deleteProperty):
10398 (JSC::JSSymbolTableObject::getOwnPropertyNames):
10399 (JSC::JSSymbolTableObject::putDirectVirtual):
10400 (JSC::JSSymbolTableObject::isDynamicScope):
10401 * runtime/JSSymbolTableObject.h: Added.
10402 (JSC):
10403 (JSSymbolTableObject):
10404 (JSC::JSSymbolTableObject::symbolTable):
10405 (JSC::JSSymbolTableObject::JSSymbolTableObject):
10406 (JSC::JSSymbolTableObject::finishCreation):
10407 (JSC::symbolTableGet):
10408 (JSC::symbolTablePut):
10409 (JSC::symbolTablePutWithAttributes):
10410 * runtime/JSVariableObject.cpp:
10411 (JSC):
10412 * runtime/JSVariableObject.h:
10413 (JSVariableObject):
10414 (JSC::JSVariableObject::JSVariableObject):
10415 (JSC::JSVariableObject::finishCreation):
10416 (JSC):
10417 * runtime/WriteBarrier.h:
10418
104192012-06-06 Filip Pizlo <fpizlo@apple.com>
10420
fpizlo@apple.comd5547492012-06-07 00:23:36 +000010421 DFG arguments access slow path should not crash if the arguments haven't been created
10422 https://bugs.webkit.org/show_bug.cgi?id=88471
10423
10424 Reviewed by Gavin Barraclough.
10425
10426 * dfg/DFGCCallHelpers.h:
10427 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
10428 (CCallHelpers):
10429 * dfg/DFGOperations.cpp:
10430 * dfg/DFGOperations.h:
10431 * dfg/DFGSpeculativeJIT.h:
10432 (JSC::DFG::SpeculativeJIT::callOperation):
10433 * dfg/DFGSpeculativeJIT32_64.cpp:
10434 (JSC::DFG::SpeculativeJIT::compile):
10435 * dfg/DFGSpeculativeJIT64.cpp:
10436 (JSC::DFG::SpeculativeJIT::compile):
10437
msaboff@apple.com9d9eab62012-06-06 23:11:09 +0000104382012-06-06 Michael Saboff <msaboff@apple.com>
10439
10440 ENH: Add Logging to GC Marking Phase
10441 https://bugs.webkit.org/show_bug.cgi?id=88364
10442
10443 Reviewed by Filip Pizlo.
10444
10445 Log GC marking to stderr or a file. The logging in controlled
10446 with the define ENABLE_OBJECT_MARK_LOGGING in wtf/Platform.h.
10447 If DATA_LOG_TO_FILE in wtf/DataLog.cpp is set to 1, output is
10448 logged to a file otherwise it is logged to stderr.
10449
10450 When logging is enabled, the GC is built single threaded since the
10451 log output from the various threads isn't buffered and output in a
10452 thread safe manner.
10453
10454 * heap/Heap.cpp:
10455 (JSC::Heap::markRoots):
10456 * heap/MarkStack.cpp:
10457 (JSC::MarkStackThreadSharedData::resetChildren):
10458 (JSC::MarkStackThreadSharedData::childVisitCount):
10459 (JSC::MarkStackThreadSharedData::markingThreadMain):
10460 (JSC::MarkStackThreadSharedData::markingThreadStartFunc):
10461 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
10462 (JSC::MarkStackThreadSharedData::reset):
10463 * heap/MarkStack.h:
10464 (MarkStackThreadSharedData):
10465 (MarkStack):
10466 (JSC::MarkStack::sharedData):
10467 (JSC::MarkStack::resetChildCount):
10468 (JSC::MarkStack::childCount):
10469 (JSC::MarkStack::incrementChildCount):
10470 * runtime/JSArray.cpp:
10471 (JSC::JSArray::visitChildren):
10472 * runtime/JSCell.cpp:
10473 (JSC::JSCell::className):
10474 * runtime/JSCell.h:
10475 (JSCell):
10476 (JSC::JSCell::visitChildren):
10477 * runtime/JSString.cpp:
10478 (JSC::JSString::visitChildren):
10479 * runtime/JSString.h:
10480 (JSString):
10481 * runtime/Structure.h:
10482 (JSC::MarkStack::internalAppend):
10483
barraclough@apple.com799e44e2012-06-06 22:09:44 +0000104842012-06-06 Gavin Barraclough <barraclough@apple.com>
10485
10486 Assigning to a static property should not change iteration order
10487 https://bugs.webkit.org/show_bug.cgi?id=88401
10488
10489 Reviewed by Geoff Garen.
10490
10491 A specific iteration order is not defined by the spec, but test-262 somewhat tenuously
10492 requires that it is at least stable, e.g. ch10/10.4/10.4.2/S10.4.2_A1.1_T1.js
10493
10494 Whilst it is not clear that this behavior really arises from the specification, it
10495 would seem like common sense to conform to this.
10496
10497 The problem here is that we allow properties in the structure to shadow those in the
10498 static table, and we iterate the properties in the structure first - which means that
10499 as values of existing properties are modified, their iteration order changes too.
10500
10501 The easy fix is to iterate the properties from the static table first. This has a
10502 further benefit, since it will mean that user added properties will come after those
10503 present in the static table (respected the expected insertion-order).
10504
10505 * runtime/JSObject.cpp:
10506 (JSC::JSObject::getOwnPropertyNames):
10507 - Iterate static properties first.
10508
wingo@igalia.combe8ecb92012-06-06 09:39:04 +0000105092012-06-06 Andy Wingo <wingo@igalia.com>
10510
wingo@igalia.comc2fb5ba2012-06-06 18:59:35 +000010511 Ensure consistent order of evaluation in LLInt slow paths
10512 https://bugs.webkit.org/show_bug.cgi?id=88409
10513
10514 Reviewed by Geoffrey Garen.
10515
10516 * llint/LLIntSlowPaths.cpp:
10517 (slow_path_mul)
10518 (slow_path_sub)
10519 (slow_path_div)
10520 (slow_path_mod)
10521 (slow_path_lshift)
10522 (slow_path_rshift)
10523 (slow_path_urshift)
10524 (slow_path_bitand)
10525 (slow_path_bitor)
10526 (slow_path_bitxor): Avoid calling toNumber, toInt32, or toUInt32
10527 multiple times without intervening sequence points. Fixes
10528 fast/js/exception-sequencing-binops.html with GCC 4.7 on x86-64
10529 Linux, which reordered evaluation of the arguments to fmod.
10530
105312012-06-06 Andy Wingo <wingo@igalia.com>
10532
wingo@igalia.com4990fe82012-06-06 16:00:38 +000010533 [GTK] Enable the LLInt
10534 https://bugs.webkit.org/show_bug.cgi?id=88315
10535
10536 Reviewed by Filip Pizlo.
10537
10538 * GNUmakefile.am: Add rules to generate LLIntDesiredOffsets.h and
10539 LLIntAssembly.h.
10540 * GNUmakefile.list.am: Add offlineasm and llint files to the
10541 dist. Add LLInt source files to the build.
10542 * llint/LowLevelInterpreter.asm (crash): Generate a store of
10543 0xbbadbeef to a register, not to a constant. Otherwise, gas was
10544 failing to assemble result.
10545 * offlineasm/asm.rb (labelReference): Generate a
10546 SYMBOL_STRING_RELOCATION instead of a SYMBOL_STRING, so that we go
10547 through the PLT on ELF systems.
10548
105492012-06-06 Andy Wingo <wingo@igalia.com>
10550
wingo@igalia.combe8ecb92012-06-06 09:39:04 +000010551 REGRESSION (r106478): None of the Paper.js JavaScript examples work
10552 https://bugs.webkit.org/show_bug.cgi?id=87158
10553
10554 Reviewed by Michael Saboff.
10555
10556 * bytecompiler/BytecodeGenerator.cpp:
10557 (JSC::BytecodeGenerator::resolve): If we have to bail out to
10558 dynamicResolve(), only skip static scopes from the head of the
10559 scope chain. Before, we were also skipping activations with
10560 direct eval as well, which was incorrect.
10561
mitz@apple.com115e6642012-06-06 07:37:05 +0000105622012-06-06 Dan Bernstein <mitz@apple.com>
10563
10564 Reverted r119567, the fix for <http://webkit.org/b/88378>, because it broke the 32-bit build.
10565
10566 * dfg/DFGSpeculativeJIT.h:
10567 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
10568 * jit/JITInlineMethods.h:
10569 (JSC::JIT::emitAllocateBasicJSObject):
10570 * llint/LowLevelInterpreter.asm:
10571 * runtime/JSGlobalData.h:
10572 (JSGlobalData):
10573 * runtime/JSGlobalThis.cpp:
10574 (JSC::JSGlobalThis::setUnwrappedObject):
10575 * runtime/JSObject.cpp:
10576 (JSC::JSObject::visitChildren):
10577 (JSC::JSObject::createInheritorID):
10578 * runtime/JSObject.h:
10579 (JSObject):
10580 (JSC::JSObject::resetInheritorID):
10581 (JSC):
10582 (JSC::JSObject::offsetOfInheritorID):
10583 (JSC::JSObject::inheritorID):
10584
yuqiang.xian@intel.come8adde62012-06-06 05:25:54 +0000105852012-06-05 Yuqiang Xian <yuqiang.xian@intel.com>
10586
10587 Improve Math.round and Math.floor intrinsic
10588 https://bugs.webkit.org/show_bug.cgi?id=88314
10589
10590 Reviewed by Filip Pizlo.
10591
10592 Currently we call a native function from the JIT code to complete the
10593 "round" and "floor" operations. We could inline some fast paths
10594 especially for those positive values on the platforms where floating
10595 point truncation is supported.
10596 This brings 3% gain on Kraken, especially 32% on audio-oscillator,
10597 and slight win on SunSpider, measured on IA32.
10598
10599 * jit/ThunkGenerators.cpp:
10600 (JSC::floorThunkGenerator):
10601 (JSC):
10602 (JSC::roundThunkGenerator):
10603
barraclough@apple.comc48fc1b2012-06-06 05:08:45 +0000106042012-06-05 Gavin Barraclough <barraclough@apple.com>
10605
10606 Remove JSObject::m_inheritorID
10607 https://bugs.webkit.org/show_bug.cgi?id=88378
10608
10609 Reviewed by Geoff Garen.
10610
10611 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
10612 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
10613 Instead use a private named value in the object's property storage.
10614
10615 * dfg/DFGSpeculativeJIT.h:
10616 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
10617 - No need m_inheritorID to initialize!
10618 * jit/JITInlineMethods.h:
10619 (JSC::JIT::emitAllocateBasicJSObject):
10620 - No need m_inheritorID to initialize!
10621 * llint/LowLevelInterpreter.asm:
10622 - No need m_inheritorID to initialize!
10623 * runtime/JSGlobalData.h:
10624 (JSGlobalData):
10625 - Added private name 'm_inheritorIDKey'.
10626 * runtime/JSGlobalThis.cpp:
10627 (JSC::JSGlobalThis::setUnwrappedObject):
10628 - resetInheritorID is now passed a JSGlobalData&.
10629 * runtime/JSObject.cpp:
10630 (JSC::JSObject::visitChildren):
10631 - No m_inheritorID to be marked.
10632 (JSC::JSObject::createInheritorID):
10633 - Store the newly created inheritorID in the property map.
10634 * runtime/JSObject.h:
10635 (JSC::JSObject::resetInheritorID):
10636 - Remove the inheritorID from property storage.
10637 (JSC::JSObject::inheritorID):
10638 - Read the inheritorID from property storage.
10639
fpizlo@apple.come7bee132012-06-05 21:32:18 +0000106402012-06-05 Filip Pizlo <fpizlo@apple.com>
10641
10642 DFG CFG simplification should not attempt to deref nodes inside of an unreachable subgraph
10643 https://bugs.webkit.org/show_bug.cgi?id=88362
10644
10645 Reviewed by Gavin Barraclough.
10646
10647 * dfg/DFGCFGSimplificationPhase.cpp:
10648 (JSC::DFG::CFGSimplificationPhase::fixPhis):
10649 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
10650
mhahnenberg@apple.com47c9c532012-06-05 20:38:21 +0000106512012-06-05 Mark Hahnenberg <mhahnenberg@apple.com>
10652
10653 Entry into JSC should CRASH() if the Heap is busy
10654 https://bugs.webkit.org/show_bug.cgi?id=88355
10655
10656 Reviewed by Geoffrey Garen.
10657
10658 Interpreter::execute() returns jsNull() right now if we try to enter it while
10659 the Heap is busy (e.g. with a collection), which is okay, but some code paths
10660 that call Interpreter::execute() allocate objects before checking if the Heap
10661 is busy. Attempting to execute JS code while the Heap is busy should not be
10662 allowed and should be enforced by a release-mode CRASH() to prevent vague,
10663 unhelpful backtraces later on if somebody makes a mistake. Normally, recursively
10664 executing JS code is okay, e.g. for evals, but it should not occur during a
10665 Heap allocation or collection because the Heap is not guaranteed to be in a
10666 consistent state (especially during collections). We are protected from
10667 executing JS on the same Heap concurrently on two separate threads because
10668 they must each take a JSLock first. However, we are not protected from reentrant
10669 execution of JS on the same thread because JSLock allows reentrancy. Therefore,
10670 we should fail early if we detect an entrance into JS code while the Heap is busy.
10671
10672 * heap/Heap.cpp: Changed Heap::collect so that it sets the m_operationInProgress field
10673 at the beginning of collection and then unsets it at the end so that it is set at all
10674 times throughout the duration of a collection rather than sporadically during various
10675 phases. There is no reason to unset during a collection because our collector does
10676 not currently support running additional JS between the phases of a collection.
10677 (JSC::Heap::getConservativeRegisterRoots):
10678 (JSC::Heap::markRoots):
10679 (JSC::Heap::collect):
10680 * interpreter/Interpreter.cpp:
10681 (JSC::Interpreter::execute): Crash if the Heap is busy.
10682 * runtime/Completion.cpp: Crash if the Heap is busy. We do it here before we call
10683 Interpreter::execute() because we do some allocation prior to calling execute() which
10684 could cause Heap corruption if, for example, that allocation caused a collection.
10685 (JSC::evaluate):
10686
commit-queue@webkit.org3401b2d2012-06-05 11:32:22 +0000106872012-06-05 Dongwoo Im <dw.im@samsung.com>
10688
10689 Add 'isProtocolHandlerRegistered' and 'unregisterProtocolHandler'.
10690 https://bugs.webkit.org/show_bug.cgi?id=73176
10691
10692 Reviewed by Adam Barth.
10693
10694 Two more APIs are added in Custom Scheme Handler specification.
10695 http://dev.w3.org/html5/spec/Overview.html#custom-handlers
10696 One is 'isProtocolHandlerRegistered' to query whether the specific URL
10697 is registered or not.
10698 The other is 'unregisterProtocolHandler' to remove the registered URL.
10699
10700 * Configurations/FeatureDefines.xcconfig: Add a macro 'ENABLE_CUSTOM_SCHEME_HANDLER'.
10701
fpizlo@apple.com9cce18d2012-06-05 06:40:48 +0000107022012-06-04 Filip Pizlo <fpizlo@apple.com>
10703
10704 DFG CFG simplification should correct the variables at the head of the predecessor block
10705 https://bugs.webkit.org/show_bug.cgi?id=88284
10706
10707 Reviewed by Geoffrey Garen.
10708
10709 * dfg/DFGCFGSimplificationPhase.cpp:
10710 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
10711
ggaren@apple.com825cc102012-06-05 03:17:15 +0000107122012-06-04 Geoffrey Garen <ggaren@apple.com>
10713
10714 Unreviewed.
10715
10716 Rolled out r119364 because it's still causing crashes (when running
10717 v8-earley in release builds of DRT)
10718
10719 This time for sure!
10720
10721 * heap/Heap.cpp:
10722 (JSC::Heap::collect):
10723 * heap/MarkedBlock.cpp:
10724 (JSC::MarkedBlock::sweep):
10725 * heap/MarkedBlock.h:
10726 (JSC::MarkedBlock::resetAllocator):
10727 (JSC):
10728 * heap/MarkedSpace.cpp:
10729 (JSC::ResetAllocator::operator()):
10730 (JSC):
10731 (JSC::MarkedSpace::resetAllocators):
10732 (JSC::MarkedSpace::sweepWeakSets):
10733 * heap/MarkedSpace.h:
10734 (MarkedSpace):
10735 * heap/WeakBlock.cpp:
10736 (JSC::WeakBlock::sweep):
10737 * heap/WeakSet.cpp:
10738 (JSC::WeakSet::sweep):
10739 (JSC::WeakSet::tryFindAllocator):
10740 * heap/WeakSet.h:
10741 (JSC::WeakSet::shrink):
10742
fpizlo@apple.com9cd38a62012-06-05 00:28:49 +0000107432012-06-04 Filip Pizlo <fpizlo@apple.com>
10744
10745 DFG arguments simplification should have rationalized handling of TearOffArguments
10746 https://bugs.webkit.org/show_bug.cgi?id=88206
10747
10748 Reviewed by Geoffrey Garen.
10749
10750 - Accesses to the unmodified arguments register ought to have the same effect on
10751 alias/escape analysis of arguments as accesses to the mutable arguments register.
10752
10753 - The existence of TearOffArguments should not get in the way of arguments aliasing.
10754
10755 - TearOffArguments should be eliminated if CreateArguments is eliminated.
10756
10757 * dfg/DFGArgumentsSimplificationPhase.cpp:
10758 (JSC::DFG::ArgumentsSimplificationPhase::run):
10759 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
10760
barraclough@apple.com282d26a2012-06-05 00:00:17 +0000107612012-06-04 Gavin Barraclough <barraclough@apple.com>
10762
10763 Remove enabledProfilerReference
10764 https://bugs.webkit.org/show_bug.cgi?id=88258
10765
10766 Reviewed by Michael Saboff.
10767
10768 Make the enabled profiler a member of JSGlobalData, and switch code that accesses it to do so directly
10769 via the JSGlobalData, rather than holding a Profiler** reference to it. Do not pass the Profiler**
10770 reference to JIT code. This patch does not change the stack layout on entry into JIT code (passing an
10771 unused void* instead), since this is an intrusive change better handled in a separate patch.
10772
10773 * interpreter/Interpreter.cpp:
10774 (JSC::Interpreter::throwException):
10775 (JSC::Interpreter::execute):
10776 (JSC::Interpreter::executeCall):
10777 (JSC::Interpreter::executeConstruct):
10778 (JSC::Interpreter::privateExecute):
10779 * jit/JITCode.h:
10780 (JSC::JITCode::execute):
10781 - Don't pass Profiler** to JIT code.
10782 * jit/JITOpcodes.cpp:
10783 (JSC::JIT::emit_op_profile_will_call):
10784 (JSC::JIT::emit_op_profile_did_call):
10785 * jit/JITOpcodes32_64.cpp:
10786 (JSC::JIT::emit_op_profile_will_call):
10787 (JSC::JIT::emit_op_profile_did_call):
10788 * jit/JITStubs.cpp:
10789 (JSC):
10790 (JSC::ctiTrampoline):
10791 (JSC::ctiVMThrowTrampoline):
10792 (JSC::ctiOpThrowNotCaught):
10793 (JSC::JITThunks::JITThunks):
10794 (JSC::DEFINE_STUB_FUNCTION):
10795 - For ARM_THUMB2, rename ENABLE_PROFILER_REFERENCE_OFFSET to FIRST_STACK_ARGUMENT (which is how it is being used).
10796 - For MIPS, remove ENABLE_PROFILER_REFERENCE_OFFSET.
10797 * jit/JITStubs.h:
10798 (JITStackFrame):
10799 (JSC):
10800 - Renamed enabledProfilerReference to unusedX.
10801 * llint/LLIntSlowPaths.cpp:
10802 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
10803 * llint/LowLevelInterpreter.asm:
10804 * profiler/Profiler.cpp:
10805 (JSC):
10806 (JSC::Profiler::startProfiling):
10807 (JSC::Profiler::stopProfiling):
10808 * profiler/Profiler.h:
10809 (Profiler):
10810 - Removed s_sharedEnabledProfilerReference, enabledProfilerReference().
10811 * runtime/JSGlobalData.cpp:
10812 (JSC::JSGlobalData::JSGlobalData):
10813 * runtime/JSGlobalData.h:
10814 (JSC):
10815 (JSC::JSGlobalData::enabledProfiler):
10816 (JSGlobalData):
10817 - Added m_enabledProfiler, enabledProfiler().
10818 * runtime/JSGlobalObject.cpp:
10819 (JSC::JSGlobalObject::~JSGlobalObject):
10820
fpizlo@apple.com3d579cc2012-06-04 23:27:34 +0000108212012-06-04 Filip Pizlo <fpizlo@apple.com>
10822
fpizlo@apple.com477ce382012-06-04 23:32:57 +000010823 get_argument_by_val should be profiled everywhere
10824 https://bugs.webkit.org/show_bug.cgi?id=88205
10825
10826 Reviewed by Geoffrey Garen.
10827
10828 * jit/JITOpcodes32_64.cpp:
10829 (JSC::JIT::emitSlow_op_get_argument_by_val):
10830 * llint/LLIntSlowPaths.cpp:
10831 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
10832
108332012-06-04 Filip Pizlo <fpizlo@apple.com>
10834
fpizlo@apple.com3d579cc2012-06-04 23:27:34 +000010835 DFG arguments simplification takes unkindly to direct accesses to the arguments register
10836 https://bugs.webkit.org/show_bug.cgi?id=88261
10837
10838 Reviewed by Geoffrey Garen.
10839
10840 Fixed arguments simplification for direct accesses to the arguments register, which may
10841 arise if CSE had not run. Fixed CSE so that it does run prior to arguments simplification,
10842 by making it a full-fledged member of the fixpoint. Fixed other issues in arguments
10843 simplification, like realizing that it needs to bail if there is a direct assignment to
10844 the arguments register, and failing to turn CreateArguments into PhantomArguments. Also
10845 fixed CSE's handling of store elimination of captured locals in the presence of a
10846 GetMyArgumentByVal (or one of its friends), and fixed CSE to correctly fixup variables at
10847 tail if the Flush it removes is the last operation on a local in a basic block.
10848
10849 * bytecode/CodeBlock.cpp:
10850 (JSC::CodeBlock::dump):
10851 * dfg/DFGArgumentsSimplificationPhase.cpp:
10852 (JSC::DFG::ArgumentsSimplificationPhase::run):
10853 (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
10854 * dfg/DFGCSEPhase.cpp:
10855 (JSC::DFG::CSEPhase::run):
10856 (JSC::DFG::CSEPhase::setLocalStoreElimination):
10857 (JSC::DFG::CSEPhase::performNodeCSE):
10858 (CSEPhase):
10859 * dfg/DFGDriver.cpp:
10860 (JSC::DFG::compile):
10861
andersca@apple.comea6c6b22012-06-04 21:56:32 +0000108622012-06-04 Anders Carlsson <andersca@apple.com>
10863
10864 Fix a struct/class mismatch.
10865
10866 * heap/Handle.h:
10867 (Handle):
10868
ddkilzer@apple.comba58a612012-06-04 14:55:26 +0000108692012-06-04 David Kilzer <ddkilzer@apple.com>
10870
10871 BUILD FIX: FeatureDefines.xcconfig should match across projects
10872
10873 * Configurations/FeatureDefines.xcconfig:
10874 - Add missing ENABLE_LEGACY_CSS_VENDOR_PREFIXES.
10875
ggaren@apple.com02dec622012-06-03 21:16:55 +0000108762012-06-02 Geoffrey Garen <ggaren@apple.com>
10877
10878 Weak pointer finalization should be lazy
10879 https://bugs.webkit.org/show_bug.cgi?id=87599
10880
10881 Reviewed by Sam Weinig.
10882
10883 This time for sure!
10884
10885 * heap/Heap.cpp:
10886 (JSC::Heap::collect): Don't sweep eagerly -- we'll sweep lazily instead.
10887
10888 * heap/MarkedBlock.cpp:
10889 (JSC::MarkedBlock::sweep): Sweep our weak set before we sweep our other
10890 destructors -- this is our last chance to run weak set finalizers before
10891 we recycle our memory.
10892
10893 * heap/MarkedBlock.h:
10894 (JSC::MarkedBlock::resetAllocator):
10895 * heap/MarkedSpace.cpp:
10896 (JSC::MarkedSpace::resetAllocators):
10897 * heap/MarkedSpace.h:
10898 (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
10899 It will happen automatically when a weak set is swept. It's simpler to
10900 have only one canonical way for this to happen, and it wasn't buying
10901 us anything to do it eagerly.
10902
10903 * heap/WeakBlock.cpp:
10904 (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
10905 the sweep would be a no-op. If even one finalizer is pending, we need to
10906 run it, since we won't get another chance.
10907
10908 * heap/WeakSet.cpp:
10909 (JSC::WeakSet::sweep): This loop can be simpler now that
10910 WeakBlock::sweep() does what we mean.
10911
10912 Reset our allocator after a sweep because this is the optimal time to
10913 start trying to recycle old weak pointers.
10914
10915 (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
10916 allocator because we've swept already, and forcing a new sweep would be
10917 wasteful.
10918
10919 * heap/WeakSet.h:
10920 (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
10921 because the shrink may have removed the block the allocator was going to
10922 allocate out of.
10923
fpizlo@apple.comb80bc2a32012-06-02 22:58:48 +0000109242012-06-02 Filip Pizlo <fpizlo@apple.com>
10925
fpizlo@apple.come0c200c2012-06-03 00:41:08 +000010926 If the DFG bytecode parser detects that op_method_check has gone polymorphic, it
10927 shouldn't revert all the way to GetById/GetByIdFlush
10928 https://bugs.webkit.org/show_bug.cgi?id=88176
10929
10930 Reviewed by Geoffrey Garen.
10931
10932 Refactored the code so that the op_method_check case of the parser gracefully falls
10933 through to all of the goodness of the normal op_get_by_id case.
10934
10935 * dfg/DFGByteCodeParser.cpp:
10936 (ByteCodeParser):
10937 (JSC::DFG::ByteCodeParser::handleGetById):
10938 (DFG):
10939 (JSC::DFG::ByteCodeParser::parseBlock):
10940
109412012-06-02 Filip Pizlo <fpizlo@apple.com>
10942
fpizlo@apple.comb80bc2a32012-06-02 22:58:48 +000010943 DFG CSE should be able to eliminate unnecessary flushes of arguments and captured variables
10944 https://bugs.webkit.org/show_bug.cgi?id=87929
10945
10946 Reviewed by Geoffrey Garen.
10947
10948 Slight speed-up on V8. Big win (up to 50%) on programs that inline very small functions.
10949
10950 This required a bunch of changes:
10951
10952 - The obvious change is making CSE essentially ignore whether or not the set of
10953 operations between the Flush and the SetLocal can exit, and instead focus on whether or
10954 not that set of operations can clobber the world or access local variables. This code
10955 is now refactored to return a set of flags indicating any of these events, and the CSE
10956 decides what to do based on those flags. If the set of operations is non-clobbering
10957 and non-accessing, then the Flush is turned into a Phantom on the child of the
10958 SetLocal. This expands the liveness of the relevant variable but virtually guarantees
10959 that it will be register allocated and not flushed to the stack. So, yeah, this patch
10960 is a lot of work to save a few stores to the stack.
10961
10962 - Previously, CheckArgumentsNotCreated was optimized "lazily" in that you only knew if
10963 it was a no-op if you were holding onto a CFA abstract state. But this would make the
10964 CSE act pessimistically, since it doesn't use the CFA. Hence, this patch changes the
10965 constant folding phase into something more broad; it now fixes up
10966 CheckArgumentsNotCreated nodes by turning them into phantoms if it knows that they are
10967 no-ops.
10968
10969 - Arguments simplification was previously relying on this very strange PhantomArguments
10970 node, which had two different meanings: for normal execution it meant the empty value
10971 but for OSR exit it meant that the arguments should be reified. This produces problems
10972 when set SetLocals to the captured arguments registers are CSE'd away, since we'd be
10973 triggering reification of arguments without having initialized the arguments registers
10974 to empty. The cleanest solution was to fix PhantomArguments to have one meaning:
10975 namely, arguments reification on OSR exit. Hence, this patch changes arguments
10976 simplification to change SetLocal of CreateArguments on the arguments registers to be
10977 a SetLocal of Empty.
10978
10979 - Argument value recoveries were previously derived from the value source of the
10980 arguments at the InlineStart. But that relies on all SetLocals to arguments having
10981 been flushed. It's possible that we could have elided the SetLocal to the arguments
10982 at the callsite because there were subsequent SetLocals to the arguments inside of the
10983 callee, in which case the InlineStart would get the wrong information. Hence, this
10984 patch changes argument value recovery computation to operate over the ArgumentPositions
10985 directly.
10986
10987 - But that doesn't actually work, because previously, there was no way to link an
10988 InlineStart back to the corresponding ArgumentPositions, at least not without some
10989 ugliness. So this patch instates the rule that the m_argumentPositions vector consists
10990 of disjoint subsequences such that each subsequence corresponds to an inline callsite
10991 and can be identified by its first index, and within each subsequence are the
10992 ArgumentPositions of all of the arguments ordered by argument index. This required
10993 flipping the order in which ArgumentPositions are added to the vector, and giving
10994 InlineStart an operand that indicates the start of that inline callsite's
10995 ArgumentPosition subsequence.
10996
10997 - This patch also revealed a nasty bug in the reification of arguments in inline call
10998 frames on OSR exit. Since the reification was happening after the values of virtual
10999 registers were recovered, the value recoveries of the inline arguments were wrong.
11000 Hence using operationCreateInlinedArguments is wrong. For example a value recovery
11001 might say that you have to box a double, but if we had already boxed it then boxing
11002 it a second time will result in garbage. The specific case of this bug was this patch
11003 uncovered was that now it is possible for an inline call frame to not have any valid
11004 value recoveries for any inline arguments, if the optimization elides all argument
11005 flushes, while at the same time optimizing away arguments creation. Then OSR exit
11006 would try to recover the arguments using the inline call frame, which had bogus
11007 information, and humorous crashes would ensue. This patch fixes this issue by moving
11008 arguments reification to after call frame reification, so that arguments reification
11009 can always use operationCreateArguments instead of operationCreateInlinedArguments.
11010
11011 - This patch may turn a Flush into a Phantom. That's kind of the whole point. But that
11012 broke forward speculation checks, which knew to look for a Flush prior to a SetLocal
11013 but didn't know that there could alternatively be a Phantom in place of the Flush.
11014 This patch fixes that by augmenting the forward speculation check logic.
11015
11016 - Finally, in the process of having fun with all of the above, I realized that my DFG
11017 validation was not actually running on every phase like I had originally designed it
11018 to. In fact it was only running just after bytecode parsing. I initially tried to
11019 make it run in every phase but found that this causes some tests to timeout
11020 (specifically the evil fuzzing ones), so I decided on a compromise where: (i) in
11021 release mode validation never runs, (ii) in debug mode validation will run just
11022 after parsing and just before the backend, and (iii) it's possible with a simple
11023 switch to enable validation to run on every phase.
11024
11025 Luckily all of the above issues were already covered by the 77 or so DFG-specific
11026 layout tests. Hence, this patch does not introduce any new tests despite being so
11027 meaty.
11028
11029 * dfg/DFGAbstractState.cpp:
11030 (JSC::DFG::AbstractState::execute):
11031 * dfg/DFGArgumentPosition.h:
11032 (JSC::DFG::ArgumentPosition::prediction):
11033 (JSC::DFG::ArgumentPosition::doubleFormatState):
11034 (JSC::DFG::ArgumentPosition::shouldUseDoubleFormat):
11035 (ArgumentPosition):
11036 * dfg/DFGArgumentsSimplificationPhase.cpp:
11037 (JSC::DFG::ArgumentsSimplificationPhase::run):
11038 * dfg/DFGByteCodeParser.cpp:
11039 (JSC::DFG::ByteCodeParser::handleInlining):
11040 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
11041 * dfg/DFGCSEPhase.cpp:
11042 (JSC::DFG::CSEPhase::SetLocalStoreEliminationResult::SetLocalStoreEliminationResult):
11043 (SetLocalStoreEliminationResult):
11044 (JSC::DFG::CSEPhase::setLocalStoreElimination):
11045 (JSC::DFG::CSEPhase::performNodeCSE):
11046 * dfg/DFGCommon.h:
11047 * dfg/DFGConstantFoldingPhase.cpp:
11048 (JSC::DFG::ConstantFoldingPhase::run):
11049 * dfg/DFGDriver.cpp:
11050 (JSC::DFG::compile):
11051 * dfg/DFGNode.h:
11052 (Node):
11053 (JSC::DFG::Node::hasArgumentPositionStart):
11054 (JSC::DFG::Node::argumentPositionStart):
11055 * dfg/DFGOSRExitCompiler32_64.cpp:
11056 (JSC::DFG::OSRExitCompiler::compileExit):
11057 * dfg/DFGOSRExitCompiler64.cpp:
11058 (JSC::DFG::OSRExitCompiler::compileExit):
11059 * dfg/DFGPhase.cpp:
11060 (DFG):
11061 * dfg/DFGPhase.h:
11062 (Phase):
11063 * dfg/DFGSpeculativeJIT.cpp:
11064 (JSC::DFG::SpeculativeJIT::compile):
11065 * dfg/DFGSpeculativeJIT.h:
11066 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
11067 * dfg/DFGSpeculativeJIT32_64.cpp:
11068 (JSC::DFG::SpeculativeJIT::compile):
11069 * dfg/DFGSpeculativeJIT64.cpp:
11070 (JSC::DFG::SpeculativeJIT::compile):
11071
ggaren@apple.com32eb24b2012-06-02 22:49:05 +0000110722012-06-02 Geoffrey Garen <ggaren@apple.com>
11073
11074 DOM string cache should hash pointers, not characters
11075 https://bugs.webkit.org/show_bug.cgi?id=88175
11076
11077 Reviewed by Phil Pizlo and Sam Weinig.
11078
11079 * heap/Weak.h:
11080 (JSC::weakAdd):
11081 (JSC::weakRemove): Made these function templates slightly more generic
11082 to accommodate new client types.
11083
fpizlo@apple.comcc5b61b2012-06-01 21:32:45 +0000110842012-06-01 Filip Pizlo <fpizlo@apple.com>
11085
fpizlo@apple.coma4754892012-06-02 00:22:31 +000011086 DFG CFA should know that PutByVal can clobber the world
11087 https://bugs.webkit.org/show_bug.cgi?id=88155
11088
11089 Reviewed by Gavin Barraclough.
11090
11091 * dfg/DFGAbstractState.cpp:
11092 (JSC::DFG::AbstractState::execute):
11093
110942012-06-01 Filip Pizlo <fpizlo@apple.com>
11095
fpizlo@apple.com8e537cd2012-06-01 23:54:36 +000011096 DFG CFA should mark basic blocks as having constants if local accesses yield constants
11097 https://bugs.webkit.org/show_bug.cgi?id=88153
11098
11099 Reviewed by Gavin Barraclough.
11100
11101 * dfg/DFGAbstractState.cpp:
11102 (JSC::DFG::AbstractState::execute):
11103
111042012-06-01 Filip Pizlo <fpizlo@apple.com>
11105
fpizlo@apple.comacc9dd22012-06-01 23:47:28 +000011106 DFG arguments simplification phase uses a node.codeOrigin after appending a node
11107 https://bugs.webkit.org/show_bug.cgi?id=88151
11108
11109 Reviewed by Geoffrey Garen.
11110
11111 The right thing to do is to save the CodeOrigin before appending to the graph.
11112
11113 * dfg/DFGArgumentsSimplificationPhase.cpp:
11114 (JSC::DFG::ArgumentsSimplificationPhase::run):
11115
111162012-06-01 Filip Pizlo <fpizlo@apple.com>
11117
fpizlo@apple.com4f337c22012-06-01 23:18:59 +000011118 DFG should not emit unnecessary speculation checks when performing an int32 to double conversion on
11119 a value that is proved to be a number, predicted to be an int32, but not proved to be an int32
11120 https://bugs.webkit.org/show_bug.cgi?id=88146
11121
11122 Reviewed by Gavin Barraclough.
11123
11124 * dfg/DFGSpeculativeJIT.cpp:
11125 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
11126
111272012-06-01 Filip Pizlo <fpizlo@apple.com>
11128
fpizlo@apple.comafc07412012-06-01 22:44:43 +000011129 DFG constant folding search for the last local access skips the immediately previous local access
11130 https://bugs.webkit.org/show_bug.cgi?id=88141
11131
11132 Reviewed by Michael Saboff.
11133
11134 If you use a loop in the style of:
11135
11136 for (i = start; i--;)
11137
11138 then you need to remember that the first value of 'i' that the loop body will see is 'start - 1'.
11139 Hence the following is probably wrong:
11140
11141 for (i = start - 1; i--;)
11142
11143 * dfg/DFGConstantFoldingPhase.cpp:
11144 (JSC::DFG::ConstantFoldingPhase::run):
11145
111462012-06-01 Filip Pizlo <fpizlo@apple.com>
11147
fpizlo@apple.comcc5b61b2012-06-01 21:32:45 +000011148 DFG constant folding should be OK with GetLocal of captured variables having a constant
11149 https://bugs.webkit.org/show_bug.cgi?id=88137
11150
11151 Reviewed by Gavin Barraclough.
11152
11153 * dfg/DFGConstantFoldingPhase.cpp:
11154 (JSC::DFG::ConstantFoldingPhase::run):
11155
mhahnenberg@apple.com016c5782012-06-01 00:02:09 +0000111562012-05-31 Mark Hahnenberg <mhahnenberg@apple.com>
11157
11158 JSGlobalObject does not mark m_privateNameStructure
11159 https://bugs.webkit.org/show_bug.cgi?id=88023
11160
11161 Rubber stamped by Gavin Barraclough.
11162
11163 * runtime/JSGlobalObject.cpp:
11164 (JSC::JSGlobalObject::visitChildren): We need to mark this so it doesn't get
11165 inadvertently garbage collected.
11166
arv@chromium.org31fddbc2012-05-31 18:00:03 +0000111672012-05-31 Erik Arvidsson <arv@chromium.org>
11168
11169 Make DOM Exceptions Errors
11170 https://bugs.webkit.org/show_bug.cgi?id=85078
11171
11172 Reviewed by Oliver Hunt.
11173
11174 WebIDL mandates that exceptions should have Error.prototype on its prototype chain.
11175
11176 For JSC we have access to the Error.prototype from the binding code.
11177
11178 For V8 we set a field in the WrapperTypeInfo and when the constructor function is created we
11179 set the prototype as needed.
11180
11181 Updated test: fast/dom/DOMException/prototype-object.html
11182
11183 * JavaScriptCore.xcodeproj/project.pbxproj:
11184 * runtime/JSGlobalObject.cpp:
11185 (JSC::JSGlobalObject::reset):
11186 * runtime/JSGlobalObject.h:
11187 (JSC):
11188 (JSGlobalObject):
11189 (JSC::JSGlobalObject::errorPrototype):
11190
wingo@igalia.com8de6a8a2012-05-31 17:28:21 +0000111912012-05-31 Andy Wingo <wingo@igalia.com>
11192
11193 Fix reference to unset variable in debug mode
11194 https://bugs.webkit.org/show_bug.cgi?id=87981
11195
11196 Reviewed by Geoffrey Garen.
11197
11198 * runtime/JSONObject.cpp (Stringifier::Holder::Holder):
11199 Initialize m_size in debug mode, as we check it later in an assert.
11200
mhahnenberg@apple.comeb39abc2012-05-31 03:04:00 +0000112012012-05-30 Mark Hahnenberg <mhahnenberg@apple.com>
11202
11203 Heap should sweep incrementally
11204 https://bugs.webkit.org/show_bug.cgi?id=85429
11205
11206 We shouldn't have to wait for the opportunistic GC timer to fire in order
11207 to call object destructors. Instead, we should incrementally sweep some
11208 subset of the blocks requiring sweeping periodically. We tie this sweeping
11209 to a timer rather than to collections because we want to reclaim this memory
11210 even if we stop allocating. This way, our memory usage scales smoothly with
11211 actual use, regardless of whether we've recently done an opportunistic GC or not.
11212
11213 Reviewed by Geoffrey Garen.
11214
11215 * CMakeLists.txt:
11216 * GNUmakefile.list.am:
11217 * JavaScriptCore.gypi:
11218 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
11219 * JavaScriptCore.xcodeproj/project.pbxproj:
11220 * Target.pri:
11221 * heap/Heap.cpp:
11222 (JSC::Heap::Heap):
11223 (JSC::Heap::collect): We no longer sweep during a full sweep. We only shrink now,
11224 which we will switch over to being done during incremental sweeping too as soon as
11225 all finalizers can be run lazily (and, by extension, incrementally).
11226 (JSC::Heap::sweeper):
11227 (JSC):
11228 * heap/Heap.h:
11229 (JSC):
11230 (Heap):
11231 * heap/IncrementalSweeper.cpp: Added.
11232 (JSC):
11233 (JSC::IncrementalSweeper::timerDidFire): The IncrementalSweeper works very similarly to
11234 GCActivityCallback. It is tied to a run-loop based timer that fires periodically based
11235 on how long the previous sweep increment took to run. The IncrementalSweeper doesn't do
11236 anything if the platform doesn't support CoreFoundation.
11237 (JSC::IncrementalSweeper::IncrementalSweeper):
11238 (JSC::IncrementalSweeper::~IncrementalSweeper):
11239 (JSC::IncrementalSweeper::create):
11240 (JSC::IncrementalSweeper::scheduleTimer):
11241 (JSC::IncrementalSweeper::cancelTimer):
11242 (JSC::IncrementalSweeper::doSweep): Iterates over the snapshot of the MarkedSpace taken
11243 during the last collection, checking to see which blocks need sweeping. If it successfully
11244 gets to the end of the blocks that need sweeping then it cancels the timer.
11245 (JSC::IncrementalSweeper::startSweeping): We take a snapshot of the Heap and store it in
11246 a Vector that the incremental sweep will iterate over. We also reset our index into this Vector.
11247 * heap/IncrementalSweeper.h: Added.
11248 (JSC):
11249 (IncrementalSweeper):
11250 * heap/MarkedBlock.h:
11251 (JSC::MarkedBlock::needsSweeping): If a block is in the Marked state it needs sweeping
11252 to be usable and to run any destructors that need to be run.
11253
paroga@webkit.orgecd0fb62012-05-31 01:38:17 +0000112542012-05-30 Patrick Gansterer <paroga@webkit.org>
11255
11256 [WINCE] Fix JSString after r115516.
11257 https://bugs.webkit.org/show_bug.cgi?id=87892
11258
11259 Reviewed by Geoffrey Garen.
11260
11261 r115516 splitted JSString into two classes, with addition nested classes.
11262 Add a workaround for the WinCE compiler since it can't resolve the friend class
11263 declerations corretly and denies the access to protected members of JSString.
11264
11265 * runtime/JSString.h:
11266 (JSC::JSRopeString::RopeBuilder::append):
11267 (JSC::JSRopeString::append):
11268 (JSRopeString):
11269
oliver@apple.com3c996382012-05-30 23:47:27 +0000112702012-05-30 Oliver Hunt <oliver@apple.com>
11271
11272 Really provide error information with the inspector disabled
11273 https://bugs.webkit.org/show_bug.cgi?id=87910
11274
11275 Reviewed by Filip Pizlo.
11276
11277 Don't bother checking for anything other than pre-existing error info.
11278 In the absence of complete line number information you'll only get the
11279 line a function starts on, but at least it's something.
11280
11281 * interpreter/Interpreter.cpp:
11282 (JSC::Interpreter::throwException):
11283
fpizlo@apple.com074918c2012-05-30 20:18:00 +0000112842012-05-30 Filip Pizlo <fpizlo@apple.com>
11285
fpizlo@apple.com5673fe62012-05-30 23:09:45 +000011286 LLInt broken on x86-32 with JIT turned off
11287 https://bugs.webkit.org/show_bug.cgi?id=87906
11288
11289 Reviewed by Geoffrey Garen.
11290
11291 Fixed the code to not clobber registers that contain important things, like the call frame.
11292
11293 * llint/LowLevelInterpreter32_64.asm:
11294
112952012-05-30 Filip Pizlo <fpizlo@apple.com>
11296
fpizlo@apple.com074918c2012-05-30 20:18:00 +000011297 ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
11298 https://bugs.webkit.org/show_bug.cgi?id=87887
11299
fpizlo@apple.comd55e8152012-05-30 21:04:23 +000011300 Reviewed by Darin Adler.
11301
11302 Better fix - we now never call SourceProvider::asID() if SourceProvider* is 0.
11303
11304 * parser/Nodes.h:
11305 (JSC::ScopeNode::sourceID):
11306 * parser/SourceCode.h:
11307 (JSC::SourceCode::providerID):
11308 (SourceCode):
11309 * parser/SourceProvider.h:
11310 (SourceProvider):
11311 (JSC::SourceProvider::asID):
11312 * runtime/Executable.h:
11313 (JSC::ScriptExecutable::sourceID):
11314
113152012-05-30 Filip Pizlo <fpizlo@apple.com>
11316
11317 ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
11318 https://bugs.webkit.org/show_bug.cgi?id=87887
11319
fpizlo@apple.com074918c2012-05-30 20:18:00 +000011320 Reviewed by Geoffrey Garen.
11321
11322 * parser/SourceProvider.h:
11323 (JSC::SourceProvider::asID):
11324
oliver@apple.comc55314a2012-05-30 19:45:20 +0000113252012-05-30 Oliver Hunt <oliver@apple.com>
11326
11327 DFG does not correctly handle exceptions caught in the LLInt
11328 https://bugs.webkit.org/show_bug.cgi?id=87885
11329
11330 Reviewed by Filip Pizlo.
11331
11332 Make the DFG use genericThrow, rather than reimplementing a small portion of it.
11333 Also make the LLInt slow paths validate that their PC is correct.
11334
11335 * dfg/DFGOperations.cpp:
11336 * llint/LLIntSlowPaths.cpp:
11337 (LLInt):
11338
fpizlo@apple.com75824e82012-05-30 17:02:49 +0000113392012-05-29 Filip Pizlo <fpizlo@apple.com>
11340
11341 DFG CFA should infer types and values of captured variables
11342 https://bugs.webkit.org/show_bug.cgi?id=87813
11343
11344 Reviewed by Gavin Barraclough.
11345
11346 Slight speed-up in V8/earley-boyer (~1%).
11347
11348 * bytecode/CodeBlock.h:
11349 (JSC::CodeBlock::argumentsAreCaptured):
11350 (JSC::CodeBlock::argumentIsCaptured):
11351 (CodeBlock):
11352 * dfg/DFGAbstractState.cpp:
11353 (DFG):
11354 (JSC::DFG::AbstractState::beginBasicBlock):
11355 (JSC::DFG::AbstractState::initialize):
11356 (JSC::DFG::AbstractState::endBasicBlock):
11357 (JSC::DFG::AbstractState::execute):
11358 (JSC::DFG::AbstractState::clobberWorld):
11359 (JSC::DFG::AbstractState::clobberStructures):
11360 (JSC::DFG::AbstractState::mergeStateAtTail):
11361 (JSC::DFG::AbstractState::merge):
11362 (JSC::DFG::AbstractState::mergeToSuccessors):
11363 * dfg/DFGAbstractState.h:
11364 (JSC::DFG::AbstractState::variables):
11365 (AbstractState):
11366 * dfg/DFGSpeculativeJIT32_64.cpp:
11367 (JSC::DFG::SpeculativeJIT::compile):
11368 * dfg/DFGSpeculativeJIT64.cpp:
11369 (JSC::DFG::SpeculativeJIT::compile):
11370
paroga@webkit.orge373ab72012-05-30 16:44:03 +0000113712012-05-30 Patrick Gansterer <paroga@webkit.org>
11372
11373 Unreviewed. Build fix for !ENABLE(JIT) after r117823.
11374
11375 * bytecode/CodeBlock.cpp:
11376 (JSC::CodeBlock::dump):
11377
commit-queue@webkit.org4ac40e0d2012-05-30 07:17:05 +0000113782012-05-30 Sheriff Bot <webkit.review.bot@gmail.com>
11379
11380 Unreviewed, rolling out r118868.
11381 http://trac.webkit.org/changeset/118868
11382 https://bugs.webkit.org/show_bug.cgi?id=87828
11383
11384 introduced ~20 crashes on Mac and Qt bots (Requested by pizlo_
11385 on #webkit).
11386
11387 * heap/Heap.cpp:
11388 (JSC::Heap::collect):
11389 * heap/MarkedBlock.cpp:
11390 (JSC::MarkedBlock::sweep):
11391 * heap/MarkedBlock.h:
11392 (JSC::MarkedBlock::sweepWeakSet):
11393 (JSC):
11394 * heap/MarkedSpace.cpp:
11395 (JSC::SweepWeakSet::operator()):
11396 (JSC):
11397 (JSC::MarkedSpace::sweepWeakSets):
11398 * heap/MarkedSpace.h:
11399 (MarkedSpace):
11400
ggaren@apple.com15344ae2012-05-30 01:05:35 +0000114012012-05-29 Geoffrey Garen <ggaren@apple.com>
11402
11403 Rolled back in r118646, now that
11404 https://bugs.webkit.org/show_bug.cgi?id=87784 is fixed.
11405
11406 http://trac.webkit.org/changeset/118646
11407 https://bugs.webkit.org/show_bug.cgi?id=87599
11408
11409 * heap/Heap.cpp:
11410 (JSC::Heap::collect):
11411 * heap/MarkedBlock.cpp:
11412 (JSC::MarkedBlock::sweep):
11413 * heap/MarkedBlock.h:
11414 (JSC):
11415 * heap/MarkedSpace.cpp:
11416 (JSC):
11417 * heap/MarkedSpace.h:
11418 (MarkedSpace):
11419
fpizlo@apple.com4c0875e2012-05-29 23:43:16 +0000114202012-05-29 Filip Pizlo <fpizlo@apple.com>
11421
11422 DFG should keep captured variables alive until the (inline) return.
11423 https://bugs.webkit.org/show_bug.cgi?id=87205
11424
11425 Reviewed by Gavin Barraclough.
11426
11427 Changes the way we do flushing for captured variables and arguments. Instead of flushing
11428 each SetLocal immediately, we flush at kill points. So a SetLocal will cause a Flush of
11429 whatever was live in the variable previously, and a return will cause a Flush of all
11430 captured variables and all arguments.
11431
11432 * dfg/DFGByteCodeParser.cpp:
11433 (JSC::DFG::ByteCodeParser::setDirect):
11434 (JSC::DFG::ByteCodeParser::set):
11435 (JSC::DFG::ByteCodeParser::setLocal):
11436 (JSC::DFG::ByteCodeParser::getArgument):
11437 (JSC::DFG::ByteCodeParser::setArgument):
11438 (JSC::DFG::ByteCodeParser::findArgumentPositionForArgument):
11439 (ByteCodeParser):
11440 (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
11441 (JSC::DFG::ByteCodeParser::findArgumentPosition):
11442 (JSC::DFG::ByteCodeParser::flush):
11443 (JSC::DFG::ByteCodeParser::flushDirect):
11444 (JSC::DFG::ByteCodeParser::flushArgumentsAndCapturedVariables):
11445 (JSC::DFG::ByteCodeParser::handleInlining):
11446 (JSC::DFG::ByteCodeParser::parseBlock):
11447 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
11448 * dfg/DFGCSEPhase.cpp:
11449 (JSC::DFG::CSEPhase::setLocalStoreElimination):
11450 (JSC::DFG::CSEPhase::performNodeCSE):
11451 * dfg/DFGSpeculativeJIT.cpp:
11452 (JSC::DFG::SpeculativeJIT::compile):
11453 * dfg/DFGSpeculativeJIT.h:
11454 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
11455
ggaren@apple.com7cc57362012-05-29 23:40:26 +0000114562012-05-29 Geoffrey Garen <ggaren@apple.com>
11457
11458 WeakGCMap should be lazy-finalization-safe
11459 https://bugs.webkit.org/show_bug.cgi?id=87784
11460
11461 Reviewed by Darin Adler.
11462
11463 * runtime/WeakGCMap.h:
11464 (JSC::WeakGCMap::get): Since this is a map of raw WeakImpl pointers, and
11465 not Weak<T>, we need to verify manually that the WeakImpl is live before
11466 we return its payload.
11467
mhahnenberg@apple.com7ea7e8f2012-05-29 18:38:14 +0000114682012-05-29 Mark Hahnenberg <mhahnenberg@apple.com>
11469
11470 CopiedSpace::doneCopying could start another collection
11471 https://bugs.webkit.org/show_bug.cgi?id=86538
11472
11473 Reviewed by Geoffrey Garen.
11474
11475 It's possible that if we don't have anything at the head of to-space
11476 after a collection and the BlockAllocator doesn't have any fresh blocks
11477 to give us right now we could start another collection while still in
11478 the middle of the first collection when we call CopiedSpace::addNewBlock().
11479
11480 One way to resolve this would be to have Heap::shouldCollect() check that
11481 m_operationInProgress is NoOperation. This would prevent the path in
11482 getFreshBlock() that starts the collection if we're already in the middle of one.
11483
11484 I could not come up with a test case to reproduce this crash on ToT.
11485
11486 * heap/Heap.h:
11487 (JSC::Heap::shouldCollect): We shouldn't collect if we're already in the middle
11488 of a collection, i.e. the current operation should be NoOperation.
11489
commit-queue@webkit.orgd5058402012-05-29 14:44:38 +0000114902012-05-29 David Barr <davidbarr@chromium.org>
11491
11492 Introduce ENABLE_CSS_IMAGE_RESOLUTION compile flag
11493 https://bugs.webkit.org/show_bug.cgi?id=87685
11494
11495 Reviewed by Eric Seidel.
11496
11497 Add a configuration option for CSS image-resolution support, disabling it by default.
11498
11499 * Configurations/FeatureDefines.xcconfig:
11500
commit-queue@webkit.org10c0df22012-05-29 03:24:49 +0000115012012-05-28 Sheriff Bot <webkit.review.bot@gmail.com>
11502
11503 Unreviewed, rolling out r118646.
11504 http://trac.webkit.org/changeset/118646
11505 https://bugs.webkit.org/show_bug.cgi?id=87691
11506
11507 broke V8 raytrace benchmark (Requested by pizlo_ on #webkit).
11508
11509 * heap/Heap.cpp:
11510 (JSC::Heap::collect):
11511 * heap/MarkedBlock.cpp:
11512 (JSC::MarkedBlock::sweep):
11513 * heap/MarkedBlock.h:
11514 (JSC::MarkedBlock::sweepWeakSet):
11515 (JSC):
11516 * heap/MarkedSpace.cpp:
11517 (JSC::SweepWeakSet::operator()):
11518 (JSC):
11519 (JSC::MarkedSpace::sweepWeakSets):
11520 * heap/MarkedSpace.h:
11521 (MarkedSpace):
11522
fpizlo@apple.com26ece8e2012-05-29 02:43:30 +0000115232012-05-28 Filip Pizlo <fpizlo@apple.com>
11524
11525 DFG should not generate code for code that the CFA proves to be unreachable
11526 https://bugs.webkit.org/show_bug.cgi?id=87682
11527
11528 Reviewed by Sam Weinig.
11529
11530 This also fixes a small performance bug where CFA was not marking blocks
11531 as having constants (and hence not triggering constant folding) if the only
11532 constants were on GetLocals.
11533
11534 And fixing that bug revealed another bug: constant folding was assuming that
11535 a GetLocal must be the first access to a local in a basic block. This isn't
11536 true. The first access may be a Flush. This patch fixes that issue using the
11537 safest approach possible, since we don't need to be clever for something that
11538 only happens in one of our benchmarks.
11539
11540 * dfg/DFGAbstractState.cpp:
11541 (JSC::DFG::AbstractState::execute):
11542 * dfg/DFGConstantFoldingPhase.cpp:
11543 (JSC::DFG::ConstantFoldingPhase::run):
11544 * dfg/DFGJITCompiler.h:
11545 (JSC::DFG::JITCompiler::noticeOSREntry):
11546 * dfg/DFGSpeculativeJIT.cpp:
11547 (JSC::DFG::SpeculativeJIT::compile):
11548
carlosgc@webkit.orgb69727c2012-05-28 10:21:31 +0000115492012-05-28 Carlos Garcia Campos <cgarcia@igalia.com>
11550
11551 Unreviewed. Fix make distcheck.
11552
11553 * GNUmakefile.list.am: Add missing header file.
11554
ggaren@apple.comb816d752012-05-28 04:56:01 +0000115552012-05-27 Geoffrey Garen <ggaren@apple.com>
11556
11557 Weak pointer finalization should be lazy
11558 https://bugs.webkit.org/show_bug.cgi?id=87599
11559
11560 Reviewed by Darin Adler.
11561
11562 * heap/Heap.cpp:
11563 (JSC::Heap::collect): Don't force immediate finalization -- it will
11564 happen lazily.
11565
11566 * heap/MarkedBlock.cpp:
11567 (JSC::MarkedBlock::sweep): Sweep a block's weak set when sweeping the
11568 block. The weak set may not have been swept yet, and this is our last
11569 chance to run weak finalizers before we recycle the memory they reference.
11570
11571 * heap/MarkedBlock.h:
11572 * heap/MarkedSpace.cpp:
11573 (JSC::MarkedBlock::sweepWeakSets):
11574 * heap/MarkedSpace.h:
11575 (JSC::MarkedSpace::sweepWeakSets): Nixed sweepWeakSets because it's unused
11576 now.
11577
ggaren@apple.com72da8112012-05-26 22:40:46 +0000115782012-05-26 Geoffrey Garen <ggaren@apple.com>
11579
11580 WebKit should be lazy-finalization-safe (esp. the DOM) v2
11581 https://bugs.webkit.org/show_bug.cgi?id=87581
11582
11583 Reviewed by Oliver Hunt.
11584
11585 * heap/MarkedBlock.cpp:
11586 (JSC::MarkedBlock::callDestructor):
11587 * heap/WeakBlock.h:
11588 * heap/WeakSetInlines.h:
11589 (JSC::WeakBlock::finalize): Since we don't guarantee destruction order,
11590 it's not valid to access GC pointers like the Structure pointer during
11591 finalization. We NULL out the structure pointer in debug builds to try
11592 to make this programming mistake more obvious.
11593
11594 * API/JSCallbackConstructor.cpp:
11595 (JSC::JSCallbackConstructor::destroy):
11596 * API/JSCallbackObject.cpp:
11597 (JSC::::destroy):
11598 (JSC::JSCallbackObjectData::finalize):
11599 * runtime/Arguments.cpp:
11600 (JSC::Arguments::destroy):
11601 * runtime/DateInstance.cpp:
11602 (JSC::DateInstance::destroy):
11603 * runtime/Error.cpp:
11604 (JSC::StrictModeTypeErrorFunction::destroy):
11605 * runtime/Executable.cpp:
11606 (JSC::ExecutableBase::destroy):
11607 (JSC::NativeExecutable::destroy):
11608 (JSC::ScriptExecutable::destroy):
11609 (JSC::EvalExecutable::destroy):
11610 (JSC::ProgramExecutable::destroy):
11611 (JSC::FunctionExecutable::destroy):
11612 * runtime/JSGlobalObject.cpp:
11613 (JSC::JSGlobalObject::destroy):
11614 * runtime/JSPropertyNameIterator.cpp:
11615 (JSC::JSPropertyNameIterator::destroy):
11616 * runtime/JSStaticScopeObject.cpp:
11617 (JSC::JSStaticScopeObject::destroy):
11618 * runtime/JSString.cpp:
11619 (JSC::JSString::destroy):
11620 * runtime/JSVariableObject.cpp:
11621 (JSC::JSVariableObject::destroy):
11622 * runtime/NameInstance.cpp:
11623 (JSC::NameInstance::destroy):
11624 * runtime/RegExp.cpp:
11625 (JSC::RegExp::destroy):
11626 * runtime/RegExpConstructor.cpp:
11627 (JSC::RegExpConstructor::destroy):
11628 * runtime/Structure.cpp:
11629 (JSC::Structure::destroy):
11630 * runtime/StructureChain.cpp:
11631 (JSC::StructureChain::destroy): Use static_cast instead of jsCast because
11632 jsCast does Structure-based validation, and our Structure is not guaranteed
11633 to be alive when we get finalized.
11634
fpizlo@apple.com7e0f6502012-05-25 22:45:57 +0000116352012-05-22 Filip Pizlo <fpizlo@apple.com>
11636
fpizlo@apple.com190f5252012-05-25 23:00:26 +000011637 DFG CSE should eliminate redundant WeakJSConstants
11638 https://bugs.webkit.org/show_bug.cgi?id=87179
11639
11640 Reviewed by Gavin Barraclough.
11641
11642 Merged r118141 from dfgopt.
11643
11644 * dfg/DFGCSEPhase.cpp:
11645 (JSC::DFG::CSEPhase::weakConstantCSE):
11646 (CSEPhase):
11647 (JSC::DFG::CSEPhase::performNodeCSE):
11648 * dfg/DFGNode.h:
11649 (JSC::DFG::Node::weakConstant):
11650
116512012-05-22 Filip Pizlo <fpizlo@apple.com>
11652
fpizlo@apple.com7e0f6502012-05-25 22:45:57 +000011653 DFG CSE should do redundant store elimination
11654 https://bugs.webkit.org/show_bug.cgi?id=87161
11655
11656 Reviewed by Oliver Hunt.
11657
11658 Merge r118138 from dfgopt.
11659
11660 This patch adds redundant store elimination. For example, consider this
11661 code:
11662
11663 o.x = 42;
11664 o.x = 84;
11665
11666 If o.x is speculated to be a well-behaved field, the first assignment is
11667 unnecessary, since the second just overwrites it. We would like to
11668 eliminate the first assignment in these cases. The need for this
11669 optimization arises mostly from stores that our runtime requires. For
11670 example:
11671
11672 o = {f:1, g:2, h:3};
11673
11674 This will have four assignments to the structure for the newly created
11675 object - one assignment for the empty structure, one for {f}, one for
11676 {f, g}, and one for {f, g, h}. We would like to only have the last of
11677 those assigments in this case.
11678
11679 Intriguingly, doing so for captured variables breaks the way arguments
11680 simplification used to work. Consider that prior to either arguments
11681 simplification or store elimination we will have IR that looks like:
11682
11683 a: SetLocal(r0, Empty)
11684 b: SetLocal(r1, Empty)
11685 c: GetLocal(r0)
11686 d: CreateArguments(@c)
11687 e: SetLocal(r0, @d)
11688 f: SetLocal(r1, @d)
11689
11690 Then redundant store elimination will eliminate the stores that
11691 initialize the arguments registers to Empty, but then arguments
11692 simplification eliminates the stores that initialize the arguments to
11693 the newly created arguments - and at this point we no longer have any
11694 stores to the arguments register, leading to hilarious crashes. This
11695 patch therefore changes arguments simplification to replace
11696 CreateArguments with JSConstant(Empty) rather than eliminating the
11697 SetLocals. But this revealed bugs where arguments simplification was
11698 being overzealous, so I fixed those bugs.
11699
11700 This is a minor speed-up on V8/early and a handful of other tests.
11701
11702 * bytecode/CodeBlock.h:
11703 (JSC::CodeBlock::uncheckedActivationRegister):
11704 * dfg/DFGAbstractState.cpp:
11705 (JSC::DFG::AbstractState::execute):
11706 * dfg/DFGArgumentsSimplificationPhase.cpp:
11707 (JSC::DFG::ArgumentsSimplificationPhase::run):
11708 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
11709 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
11710 (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
11711 * dfg/DFGCSEPhase.cpp:
11712 (JSC::DFG::CSEPhase::globalVarStoreElimination):
11713 (CSEPhase):
11714 (JSC::DFG::CSEPhase::putStructureStoreElimination):
11715 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
11716 (JSC::DFG::CSEPhase::setLocalStoreElimination):
11717 (JSC::DFG::CSEPhase::setReplacement):
11718 (JSC::DFG::CSEPhase::eliminate):
11719 (JSC::DFG::CSEPhase::performNodeCSE):
11720 * dfg/DFGGraph.h:
11721 (JSC::DFG::Graph::uncheckedActivationRegisterFor):
11722 (Graph):
11723 * dfg/DFGNode.h:
11724 (JSC::DFG::Node::isPhantomArguments):
11725 (Node):
11726 (JSC::DFG::Node::hasConstant):
11727 (JSC::DFG::Node::valueOfJSConstant):
11728 (JSC::DFG::Node::hasStructureTransitionData):
11729 * dfg/DFGNodeType.h:
11730 (DFG):
11731 * dfg/DFGPredictionPropagationPhase.cpp:
11732 (JSC::DFG::PredictionPropagationPhase::propagate):
11733 * dfg/DFGSpeculativeJIT.cpp:
11734 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
11735 * dfg/DFGSpeculativeJIT32_64.cpp:
11736 (JSC::DFG::SpeculativeJIT::compile):
11737 * dfg/DFGSpeculativeJIT64.cpp:
11738 (JSC::DFG::SpeculativeJIT::compile):
11739
fpizlo@apple.com016fd682012-05-25 20:19:55 +0000117402012-05-21 Filip Pizlo <fpizlo@apple.com>
11741
11742 DFG ConvertThis should just be a CheckStructure if the structure is known
11743 https://bugs.webkit.org/show_bug.cgi?id=87057
11744
11745 Reviewed by Gavin Barraclough.
11746
11747 Merged r118021 from dfgopt.
11748
11749 This gives ValueProfile the ability to track singleton values - i.e. profiling
11750 sites that always see the same value.
11751
11752 That is then used to profile the structure in op_convert_this.
11753
11754 This is then used to optimize op_convert_this into a CheckStructure if the
11755 structure is always the same.
11756
11757 That then results in better CSE in inlined code that uses 'this', since
11758 previously we couldn't CSE accesses on 'this' from different inline call frames.
11759
11760 Also fixed a bug where we were unnecessarily flushing 'this'.
11761
11762 * bytecode/CodeBlock.cpp:
11763 (JSC::CodeBlock::dump):
11764 (JSC::CodeBlock::stronglyVisitStrongReferences):
11765 * bytecode/LazyOperandValueProfile.cpp:
11766 (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):
11767 * bytecode/LazyOperandValueProfile.h:
11768 (CompressedLazyOperandValueProfileHolder):
11769 * bytecode/Opcode.h:
11770 (JSC):
11771 (JSC::padOpcodeName):
11772 * bytecode/ValueProfile.h:
11773 (JSC::ValueProfileBase::ValueProfileBase):
11774 (JSC::ValueProfileBase::dump):
11775 (JSC::ValueProfileBase::computeUpdatedPrediction):
11776 (ValueProfileBase):
11777 * bytecompiler/BytecodeGenerator.cpp:
11778 (JSC::BytecodeGenerator::BytecodeGenerator):
11779 * dfg/DFGByteCodeParser.cpp:
11780 (JSC::DFG::ByteCodeParser::setArgument):
11781 (JSC::DFG::ByteCodeParser::parseBlock):
11782 * jit/JITOpcodes.cpp:
11783 (JSC::JIT::emit_op_convert_this):
11784 (JSC::JIT::emitSlow_op_convert_this):
11785 * jit/JITOpcodes32_64.cpp:
11786 (JSC::JIT::emit_op_convert_this):
11787 (JSC::JIT::emitSlow_op_convert_this):
11788 * llint/LLIntSlowPaths.cpp:
11789 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
11790 * llint/LowLevelInterpreter32_64.asm:
11791 * llint/LowLevelInterpreter64.asm:
11792 * runtime/JSValue.h:
11793 (JSValue):
11794 * runtime/Structure.h:
11795 (JSC::JSValue::structureOrUndefined):
11796 (JSC):
11797
timothy_horton@apple.com3f03ac12012-05-25 06:53:27 +0000117982012-05-24 Tim Horton <timothy_horton@apple.com>
11799
11800 Add feature defines for web-facing parts of CSS Regions and Exclusions
11801 https://bugs.webkit.org/show_bug.cgi?id=87442
11802 <rdar://problem/10887709>
11803
11804 Reviewed by Dan Bernstein.
11805
11806 * Configurations/FeatureDefines.xcconfig:
11807
ggaren@apple.com9e1789f2012-05-25 06:52:00 +0000118082012-05-24 Geoffrey Garen <ggaren@apple.com>
11809
11810 WebKit should be lazy-finalization-safe (esp. the DOM)
11811 https://bugs.webkit.org/show_bug.cgi?id=87456
11812
11813 Reviewed by Filip Pizlo.
11814
11815 Lazy finalization adds one twist to weak pointer use:
11816
11817 A HashMap of weak pointers may contain logically null entries.
11818 (Weak pointers behave as-if null once their payloads die.)
11819 Insertion must not assume that a pre-existing entry is
11820 necessarily valid, and iteration must not assume that all
11821 entries can be dereferenced.
11822
11823 (Previously, I thought that it also added a second twist:
11824
11825 A demand-allocated weak pointer may replace a dead payload
11826 before the payload's finalizer runs. In that case, when the
11827 payload's finalizer runs, the payload has already been
11828 overwritten, and the finalizer should not clear the payload,
11829 which now points to something new.
11830
11831 But that's not the case here, since we cancel the old payload's
11832 finalizer when we over-write it. I've added ASSERTs to verify this
11833 assumption, in case it ever changes.)
11834
11835 * API/JSClassRef.cpp:
11836 (OpaqueJSClass::prototype): No need to specify null; that's the default.
11837
11838 * API/JSWeakObjectMapRefPrivate.cpp: Use remove, since take() is gone.
11839
11840 * heap/PassWeak.h:
11841 (WeakImplAccessor::was): This is no longer a debug-only function, since
11842 it's required to reason about lazily finalized pointers.
11843
11844 * heap/Weak.h:
11845 (JSC::weakAdd):
11846 (JSC::weakRemove):
11847 (JSC::weakClear): Added these helper functions for the common idioms of
11848 what clients want to do in their weak pointer finalizers.
11849
11850 * jit/JITStubs.cpp:
11851 (JSC::JITThunks::hostFunctionStub): Use the new idioms. Otherwise, we
11852 would return NULL for a "zombie" executable weak pointer that was waiting
11853 for finalization (item (2)), and finalizing a dead executable weak pointer
11854 would potentially destroy a new, live one (item (1)).
11855
11856 * runtime/RegExpCache.cpp:
11857 (JSC::RegExpCache::lookupOrCreate):
11858 (JSC::RegExpCache::finalize): Ditto.
11859
11860 (JSC::RegExpCache::invalidateCode): Check for null while iterating. (See
11861 item (2).)
11862
11863 * runtime/Structure.cpp:
11864 (JSC::StructureTransitionTable::contains):
11865 (JSC::StructureTransitionTable::add): Use get and set instead of add and
11866 contains, since add and contains are not compatible with lazy finalization.
11867
11868 * runtime/WeakGCMap.h:
11869 (WeakGCMap):
11870 (JSC::WeakGCMap::clear):
11871 (JSC::WeakGCMap::remove): Removed a bunch of code that was incompatible with
11872 lazy finalization because I didn't feel like making it compatible, and I had
11873 no way to test it.
11874
fpizlo@apple.com0b9b37a2012-05-25 03:29:18 +0000118752012-05-24 Filip Pizlo <fpizlo@apple.com>
11876
fpizlo@apple.com9d899a42012-05-25 05:41:03 +000011877 REGRESSION (r118013-r118031): Loops/Reloads under www.yahoo.com, quits after three tries with error
11878 https://bugs.webkit.org/show_bug.cgi?id=87327
11879
11880 Reviewed by Geoffrey Garen.
11881
11882 If you use AbstractValue::filter(StructureSet) to test subset relationships between TOP and a
11883 set containing >=2 elements, you're going to have a bad time.
11884
11885 That's because AbstractValue considers a set with >=2 elements to be equivalent to TOP, in order
11886 to save space and speed up convergence. So filtering has no effect in this case, which made
11887 the code think that the abstract value was proving that the structure check was unnecessary.
11888 The correct thing to do is to use isSubsetOf() on the StructureAbstractValue, which does the
11889 right thingies for TOP and >=2 elements.
11890
11891 * dfg/DFGAbstractState.cpp:
11892 (JSC::DFG::AbstractState::execute):
11893 * dfg/DFGSpeculativeJIT32_64.cpp:
11894 (JSC::DFG::SpeculativeJIT::compile):
11895 * dfg/DFGSpeculativeJIT64.cpp:
11896 (JSC::DFG::SpeculativeJIT::compile):
11897
118982012-05-24 Filip Pizlo <fpizlo@apple.com>
11899
fpizlo@apple.com0b9b37a2012-05-25 03:29:18 +000011900 new test fast/js/dfg-arguments-mixed-alias.html fails on JSVALUE32_64
11901 https://bugs.webkit.org/show_bug.cgi?id=87378
11902
11903 Reviewed by Gavin Barraclough.
11904
11905 - Captured variable tracking forgot did not consistently handle arguments, leading to OSR
11906 badness.
11907
11908 - Nodes capable of exiting were tracked in a non-monotonic way, leading to compiler errors.
11909
11910 * dfg/DFGByteCodeParser.cpp:
11911 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
11912 * dfg/DFGCSEPhase.cpp:
11913 (JSC::DFG::CSEPhase::CSEPhase):
11914 (CSEPhase):
11915 (JSC::DFG::performCSE):
11916 * dfg/DFGCSEPhase.h:
11917 (DFG):
11918 * dfg/DFGCommon.h:
11919 * dfg/DFGDriver.cpp:
11920 (JSC::DFG::compile):
11921 * dfg/DFGGraph.cpp:
11922 (JSC::DFG::Graph::resetExitStates):
11923 (DFG):
11924 * dfg/DFGGraph.h:
11925 (Graph):
11926 * dfg/DFGPhase.h:
11927 (DFG):
11928 (JSC::DFG::runPhase):
11929
ggaren@apple.com39281e22012-05-24 21:18:10 +0000119302012-05-24 Geoffrey Garen <ggaren@apple.com>
11931
11932 Made WeakSet per-block instead of per-heap
11933 https://bugs.webkit.org/show_bug.cgi?id=87401
11934
11935 Reviewed by Oliver Hunt.
11936
11937 This allows us fast access to the set of all weak pointers for a block,
11938 which is a step toward lazy finalization.
11939
11940 No performance change.
11941
11942 * heap/Heap.cpp:
11943 (JSC::Heap::Heap):
11944 (JSC::Heap::lastChanceToFinalize): Removed the per-heap weak set, since
11945 it's per-block now.
11946
11947 (JSC::Heap::markRoots): Delegate weak set visiting to the marked space,
11948 since it knows how to iterate all blocks.
11949
11950 (JSC::Heap::collect): Moved the reaping outside of markRoots, since it
11951 doesn't mark anything.
11952
11953 Make sure to reset allocators after shrinking, since shrinking may
11954 deallocate the current allocator.
11955
11956 * heap/Heap.h:
11957 (Heap): No more per-heap weak set, since it's per-block now.
11958
11959 * heap/MarkedBlock.cpp:
11960 (JSC::MarkedBlock::MarkedBlock):
11961 * heap/MarkedBlock.h:
11962 (MarkedBlock):
11963 (JSC::MarkedBlock::lastChanceToFinalize): Migrated finalization logic
11964 here from the heap, so the heap doesn't need to know about our internal
11965 data structures like our weak set.
11966
11967 (JSC::MarkedBlock::heap):
11968 (JSC::MarkedBlock::weakSet):
11969 (JSC::MarkedBlock::shrink):
11970 (JSC::MarkedBlock::resetAllocator):
11971 (JSC::MarkedBlock::visitWeakSet):
11972 (JSC::MarkedBlock::reapWeakSet):
11973 (JSC::MarkedBlock::sweepWeakSet):
11974 * heap/MarkedSpace.cpp:
11975 (JSC::VisitWeakSet::VisitWeakSet):
11976 (JSC::VisitWeakSet::operator()):
11977 (VisitWeakSet):
11978 (JSC):
11979 (JSC::ReapWeakSet::operator()):
11980 (JSC::SweepWeakSet::operator()):
11981 (JSC::LastChanceToFinalize::operator()):
11982 (JSC::MarkedSpace::lastChanceToFinalize):
11983 (JSC::ResetAllocator::operator()):
11984 (JSC::MarkedSpace::resetAllocators):
11985 (JSC::MarkedSpace::visitWeakSets):
11986 (JSC::MarkedSpace::reapWeakSets):
11987 (JSC::MarkedSpace::sweepWeakSets):
11988 (JSC::Shrink::operator()):
11989 (JSC::MarkedSpace::shrink):
11990 * heap/MarkedSpace.h:
11991 (MarkedSpace): Make sure to account for our weak sets when sweeping,
11992 shrinking, etc.
11993
11994 * heap/WeakSet.cpp:
11995 (JSC):
11996 * heap/WeakSet.h:
11997 (WeakSet):
11998 (JSC::WeakSet::heap):
11999 (JSC):
12000 (JSC::WeakSet::lastChanceToFinalize):
12001 (JSC::WeakSet::visit):
12002 (JSC::WeakSet::reap):
12003 (JSC::WeakSet::shrink):
12004 (JSC::WeakSet::resetAllocator): Inlined some things since they're called
12005 once per block now instead of once per heap.
12006
12007 * heap/WeakSetInlines.h:
12008 (JSC::WeakSet::allocate): Use the per-block weak set since there is no
12009 per-heap weak set anymore.
12010
barraclough@apple.comefdbf472012-05-24 21:14:07 +0000120112012-05-24 Gavin Barraclough <barraclough@apple.com>
12012
barraclough@apple.com8ca6a7a2012-05-24 21:17:38 +000012013 Fix arm build
12014
12015 Rubber stamped by Geoff Garen
12016
12017 * dfg/DFGGPRInfo.h:
12018 (GPRInfo):
12019
120202012-05-24 Gavin Barraclough <barraclough@apple.com>
12021
barraclough@apple.comefdbf472012-05-24 21:14:07 +000012022 Move cacheFlush from ExecutableAllocator to Assembler classes
12023 https://bugs.webkit.org/show_bug.cgi?id=87420
12024
12025 Reviewed by Oliver Hunt.
12026
12027 Makes more sense there, & remove a pile of #ifdefs.
12028
12029 * assembler/ARMAssembler.cpp:
12030 (JSC):
12031 (JSC::ARMAssembler::cacheFlush):
12032 * assembler/ARMAssembler.h:
12033 (ARMAssembler):
12034 (JSC::ARMAssembler::cacheFlush):
12035 * assembler/ARMv7Assembler.h:
12036 (JSC::ARMv7Assembler::relinkJump):
12037 (JSC::ARMv7Assembler::cacheFlush):
12038 (ARMv7Assembler):
12039 (JSC::ARMv7Assembler::setInt32):
12040 (JSC::ARMv7Assembler::setUInt7ForLoad):
12041 * assembler/AbstractMacroAssembler.h:
12042 (JSC::AbstractMacroAssembler::cacheFlush):
12043 * assembler/LinkBuffer.h:
12044 (JSC::LinkBuffer::performFinalization):
12045 * assembler/MIPSAssembler.h:
12046 (JSC::MIPSAssembler::relinkJump):
12047 (JSC::MIPSAssembler::relinkCall):
12048 (JSC::MIPSAssembler::repatchInt32):
12049 (JSC::MIPSAssembler::cacheFlush):
12050 (MIPSAssembler):
12051 * assembler/SH4Assembler.h:
12052 (JSC::SH4Assembler::repatchCompact):
12053 (JSC::SH4Assembler::cacheFlush):
12054 (SH4Assembler):
12055 * assembler/X86Assembler.h:
12056 (X86Assembler):
12057 (JSC::X86Assembler::cacheFlush):
12058 * jit/ExecutableAllocator.cpp:
12059 (JSC):
12060 * jit/ExecutableAllocator.h:
12061 (ExecutableAllocator):
12062
commit-queue@webkit.org2c8bcde2012-05-24 20:01:53 +0000120632012-05-24 John Mellor <johnme@chromium.org>
12064
12065 Font Boosting: Add compile flag and runtime setting
12066 https://bugs.webkit.org/show_bug.cgi?id=87394
12067
12068 Reviewed by Adam Barth.
12069
12070 Add ENABLE_FONT_BOOSTING.
12071
12072 * Configurations/FeatureDefines.xcconfig:
12073
commit-queue@webkit.orgd553c622012-05-24 10:50:40 +0000120742012-05-24 Allan Sandfeld Jensen <allan.jensen@nokia.com>
12075
12076 cti_vm_throw gets kicked out by gcc 4.6 -flto
12077 https://bugs.webkit.org/show_bug.cgi?id=56088
12078
12079 Reviewed by Darin Adler.
12080
12081 Add REFERENCED_FROM_ASM to functions only referenced from assembler.
12082
12083 * dfg/DFGOperations.cpp:
12084 * jit/HostCallReturnValue.h:
12085 * jit/JITStubs.h:
12086 * jit/ThunkGenerators.cpp:
12087
fpizlo@apple.com36f14462012-05-24 07:35:05 +0000120882012-05-24 Filip Pizlo <fpizlo@apple.com>
12089
12090 Incorrect merge of r117542 from dfg opt branch in r118323 is leading to fast/js/dfg-arguments-osr-exit.html failing
12091 https://bugs.webkit.org/show_bug.cgi?id=87350
12092
12093 Reviewed by Maciej Stachowiak.
12094
12095 The dfgopt branch introduced the notion of a local variable being killed because it was aliased
12096 to the Arguments object as in cases like:
12097
12098 var a = arguments;
12099 return a.length;
12100
12101 This required changes to OSR exit handling - if the variable is dead but aliased to arguments, then
12102 OSR exit should reify the arguments. But meanwhile, in tip of tree we introduced special handling for
12103 dead variables on OSR exit. When the two were merged in r118323, the structure of the if/else branches
12104 ended up being such that we would treat dead arguments variables as totally dead as opposed to treating
12105 them as variables that need arguments reification.
12106
12107 This fixes the structure of the relevant if/else block so that variables that are dead-but-arguments
12108 end up being treated as reified arguments objects, while variables that are dead but not aliased to
12109 arguments are treated as tip of tree would have treated them (initialize to Undefined).
12110
12111 * dfg/DFGSpeculativeJIT.cpp:
12112 (JSC::DFG::SpeculativeJIT::compile):
12113
ossy@webkit.orgbc0d6372012-05-24 07:05:31 +0000121142012-05-24 Csaba Osztrogonác <ossy@webkit.org>
12115
12116 Unreviewed 32 bit buildfix after r118325.
12117
12118 * dfg/DFGSpeculativeJIT32_64.cpp:
12119 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): Use ASSERT_UNUSED instead ASSERT.
12120
fpizlo@apple.comd96eb4e2012-05-24 06:58:52 +0000121212012-05-23 Filip Pizlo <fpizlo@apple.com>
12122
fpizlo@apple.comb3ac2422012-05-24 07:00:24 +000012123 DFG operationTearOffActivation should return after handling the null activation case
12124 https://bugs.webkit.org/show_bug.cgi?id=87348
12125 <rdar://problem/11522295>
12126
12127 Reviewed by Oliver Hunt.
12128
12129 * dfg/DFGOperations.cpp:
12130
121312012-05-23 Filip Pizlo <fpizlo@apple.com>
12132
fpizlo@apple.comd96eb4e2012-05-24 06:58:52 +000012133 Unreviewed, merge the arguments fix in r118138 to get bots green.
12134
12135 * dfg/DFGArgumentsSimplificationPhase.cpp:
12136 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
12137
fpizlo@apple.comb9c94622012-05-24 05:51:05 +0000121382012-05-20 Filip Pizlo <fpizlo@apple.com>
12139
fpizlo@apple.com91b2c682012-05-24 06:24:36 +000012140 DFG CFA should record if a node can OSR exit
12141 https://bugs.webkit.org/show_bug.cgi?id=86905
12142
12143 Reviewed by Oliver Hunt.
12144
12145 Merged r117931 from dfgopt.
12146
12147 Adds a NodeFlag that denotes nodes that are known to not have OSR exits.
12148 This ought to aid any backwards analyses that need to know when a
12149 backward flow merge might happen due to a side exit.
12150
12151 Also added assertions into speculationCheck() that ensure that we did not
12152 mark a node as non-exiting and then promptly compile in an exit. This
12153 helped catch some minor bugs where we were doing unnecessary speculation
12154 checks.
12155
12156 This is a perf-neutral change. The speculation checks that this removes
12157 were not on hot paths of major benchmarks.
12158
12159 * bytecode/PredictedType.h:
12160 (JSC):
12161 (JSC::isAnyPrediction):
12162 * dfg/DFGAbstractState.cpp:
12163 (JSC::DFG::AbstractState::execute):
12164 * dfg/DFGAbstractState.h:
12165 (JSC::DFG::AbstractState::speculateInt32Unary):
12166 (AbstractState):
12167 (JSC::DFG::AbstractState::speculateNumberUnary):
12168 (JSC::DFG::AbstractState::speculateBooleanUnary):
12169 (JSC::DFG::AbstractState::speculateInt32Binary):
12170 (JSC::DFG::AbstractState::speculateNumberBinary):
12171 * dfg/DFGNode.h:
12172 (JSC::DFG::Node::mergeFlags):
12173 (JSC::DFG::Node::filterFlags):
12174 (Node):
12175 (JSC::DFG::Node::setCanExit):
12176 (JSC::DFG::Node::canExit):
12177 * dfg/DFGNodeFlags.cpp:
12178 (JSC::DFG::nodeFlagsAsString):
12179 * dfg/DFGNodeFlags.h:
12180 (DFG):
12181 * dfg/DFGSpeculativeJIT.cpp:
12182 (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
12183 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
12184 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
12185 * dfg/DFGSpeculativeJIT.h:
12186 (JSC::DFG::SpeculativeJIT::speculationCheck):
12187 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
12188 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
12189 (SpeculativeJIT):
12190 * dfg/DFGSpeculativeJIT32_64.cpp:
12191 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
12192 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
12193 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
12194 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
12195 (JSC::DFG::SpeculativeJIT::compile):
12196 * dfg/DFGSpeculativeJIT64.cpp:
12197 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
12198 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
12199 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
12200 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
12201 (JSC::DFG::SpeculativeJIT::compile):
12202
122032012-05-20 Filip Pizlo <fpizlo@apple.com>
12204
fpizlo@apple.comb9c94622012-05-24 05:51:05 +000012205 DFG should not do unnecessary indirections when storing to objects
12206 https://bugs.webkit.org/show_bug.cgi?id=86959
12207
12208 Reviewed by Oliver Hunt.
12209
12210 Merged r117819 from dfgopt.
12211
12212 * dfg/DFGByteCodeParser.cpp:
12213 (JSC::DFG::ByteCodeParser::parseBlock):
12214 * dfg/DFGCSEPhase.cpp:
12215 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
12216 * dfg/DFGSpeculativeJIT32_64.cpp:
12217 (JSC::DFG::SpeculativeJIT::compile):
12218 * dfg/DFGSpeculativeJIT64.cpp:
12219 (JSC::DFG::SpeculativeJIT::compile):
12220
fpizlo@apple.com9a548f12012-05-24 05:33:09 +0000122212012-05-17 Filip Pizlo <fpizlo@apple.com>
12222
12223 DFG should optimize aliased uses of the Arguments object of the current call frame
12224 https://bugs.webkit.org/show_bug.cgi?id=86552
12225
12226 Reviewed by Geoff Garen.
12227
12228 Merged r117542 and r117543 from dfgopt.
12229
12230 Performs must-alias and escape analysis on uses of CreateArguments, and if
12231 a variable is must-aliased to CreateArguments and does not escape, then we
12232 turn all uses of that variable into direct arguments accesses.
12233
12234 36% speed-up on V8/earley leading to a 2.3% speed-up overall in V8.
12235
12236 * bytecode/CodeBlock.h:
12237 (JSC::CodeBlock::uncheckedArgumentsRegister):
12238 * bytecode/ValueRecovery.h:
12239 (JSC::ValueRecovery::argumentsThatWereNotCreated):
12240 (ValueRecovery):
12241 (JSC::ValueRecovery::dump):
12242 * dfg/DFGAbstractState.cpp:
12243 (JSC::DFG::AbstractState::execute):
12244 * dfg/DFGAdjacencyList.h:
12245 (AdjacencyList):
12246 (JSC::DFG::AdjacencyList::removeEdgeFromBag):
12247 * dfg/DFGArgumentsSimplificationPhase.cpp:
12248 (JSC::DFG::ArgumentsSimplificationPhase::run):
12249 (ArgumentsSimplificationPhase):
12250 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
12251 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
12252 (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
12253 (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
12254 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
12255 * dfg/DFGAssemblyHelpers.h:
12256 (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
12257 (AssemblyHelpers):
12258 * dfg/DFGByteCodeParser.cpp:
12259 (JSC::DFG::ByteCodeParser::parseBlock):
12260 * dfg/DFGCFGSimplificationPhase.cpp:
12261 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
12262 * dfg/DFGGPRInfo.h:
12263 (GPRInfo):
12264 * dfg/DFGGraph.cpp:
12265 (JSC::DFG::Graph::collectGarbage):
12266 (DFG):
12267 * dfg/DFGGraph.h:
12268 (Graph):
12269 (JSC::DFG::Graph::executableFor):
12270 (JSC::DFG::Graph::argumentsRegisterFor):
12271 (JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
12272 (JSC::DFG::Graph::clobbersWorld):
12273 * dfg/DFGNode.h:
12274 (JSC::DFG::Node::hasHeapPrediction):
12275 * dfg/DFGNodeType.h:
12276 (DFG):
12277 * dfg/DFGOSRExitCompiler.cpp:
12278 * dfg/DFGOSRExitCompiler.h:
12279 (JSC::DFG::OSRExitCompiler::OSRExitCompiler):
12280 (OSRExitCompiler):
12281 * dfg/DFGOSRExitCompiler32_64.cpp:
12282 (JSC::DFG::OSRExitCompiler::compileExit):
12283 * dfg/DFGOSRExitCompiler64.cpp:
12284 (JSC::DFG::OSRExitCompiler::compileExit):
12285 * dfg/DFGOperations.cpp:
12286 * dfg/DFGPredictionPropagationPhase.cpp:
12287 (JSC::DFG::PredictionPropagationPhase::propagate):
12288 * dfg/DFGSpeculativeJIT.cpp:
12289 (JSC::DFG::ValueSource::dump):
12290 (JSC::DFG::SpeculativeJIT::compile):
12291 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
12292 * dfg/DFGSpeculativeJIT.h:
12293 * dfg/DFGSpeculativeJIT32_64.cpp:
12294 (JSC::DFG::SpeculativeJIT::compile):
12295 * dfg/DFGSpeculativeJIT64.cpp:
12296 (JSC::DFG::SpeculativeJIT::compile):
12297 * dfg/DFGVariableAccessData.h:
12298 (JSC::DFG::VariableAccessData::VariableAccessData):
12299 (JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
12300 (VariableAccessData):
12301 (JSC::DFG::VariableAccessData::isArgumentsAlias):
12302 * jit/JITOpcodes.cpp:
12303 (JSC::JIT::emitSlow_op_get_argument_by_val):
12304
fpizlo@apple.comdb7ba192012-05-24 02:28:52 +0000123052012-05-23 Filip Pizlo <fpizlo@apple.com>
12306
fpizlo@apple.comae3413b2012-05-24 02:34:09 +000012307 DFGCapabilities should not try to get an arguments register from code blocks that don't have one
12308 https://bugs.webkit.org/show_bug.cgi?id=87332
12309
12310 Reviewed by Andy Estes.
12311
12312 * dfg/DFGCapabilities.h:
12313 (JSC::DFG::canInlineOpcode):
12314
123152012-05-23 Filip Pizlo <fpizlo@apple.com>
12316
fpizlo@apple.comdb7ba192012-05-24 02:28:52 +000012317 DFG should have sparse conditional constant propagation
12318 https://bugs.webkit.org/show_bug.cgi?id=86580
12319
12320 Reviewed by Oliver Hunt.
12321
12322 Merged r117370 from dfgopt.
12323
12324 This enhances CFA so that if it suspects at any point during the fixpoint that a
12325 branch will only go one way, then it only propagates in that one way.
12326
12327 This vastly increases the opportunities for CFG simplification. For example, it
12328 enables us to evaporate this loop:
12329
12330 for (var i = 0; i < 1; ++i) doThings(i);
12331
12332 As a result, it uncovered loads of bugs in the CFG simplifier. In particular:
12333
12334 - Phi fixup was assuming that all Phis worth fixing up are shouldGenerate().
12335 That's not true; we also fixup Phis that are dead.
12336
12337 - GetLocal fixup was assuming that it's only necessary to rewire links to a
12338 GetLocal, and that the GetLocal's own links don't need to be rewired. Untrue,
12339 because the GetLocal may not be rewirable (first block has no GetLocal for r42
12340 but second block does have a GetLocal), in which case it will refer to a Phi
12341 in the second block. We need it to refer to a Phi from the first block to
12342 ensure that subsequent transformations work.
12343
12344 - Tail operand fixup was ignoring the fact that Phis in successors may contain
12345 references to the children of our tail variables. Hence, successor Phi child
12346 substitution needs to use the original second block variable table as its
12347 prior, rather than trying to reconstruct the prior later (since by that point
12348 the children of the second block's tail variables will have been fixed up, so
12349 we will not know what the prior would have been).
12350
12351 * dfg/DFGAbstractState.cpp:
12352 (JSC::DFG::AbstractState::beginBasicBlock):
12353 (JSC::DFG::AbstractState::endBasicBlock):
12354 (JSC::DFG::AbstractState::reset):
12355 (JSC::DFG::AbstractState::execute):
12356 (JSC::DFG::AbstractState::mergeToSuccessors):
12357 * dfg/DFGAbstractState.h:
12358 (JSC::DFG::AbstractState::branchDirectionToString):
12359 (AbstractState):
12360 * dfg/DFGCFGSimplificationPhase.cpp:
12361 (JSC::DFG::CFGSimplificationPhase::run):
12362 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
12363 (JSC::DFG::CFGSimplificationPhase::OperandSubstitution::OperandSubstitution):
12364 (OperandSubstitution):
12365 (JSC::DFG::CFGSimplificationPhase::skipGetLocal):
12366 (JSC::DFG::CFGSimplificationPhase::recordPossibleIncomingReference):
12367 (CFGSimplificationPhase):
12368 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12369 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
12370 * dfg/DFGGraph.h:
12371 (JSC::DFG::Graph::changeEdge):
12372
ojan@chromium.org959e4a22012-05-24 02:03:04 +0000123732012-05-23 Ojan Vafai <ojan@chromium.org>
12374
12375 add back the ability to disable flexbox
12376 https://bugs.webkit.org/show_bug.cgi?id=87147
12377
12378 Reviewed by Tony Chang.
12379
12380 * Configurations/FeatureDefines.xcconfig:
12381
fpizlo@apple.com9b928722012-05-24 00:18:55 +0000123822012-05-23 Filip Pizlo <fpizlo@apple.com>
12383
fpizlo@apple.com16faaea2012-05-24 01:04:55 +000012384 Unreviewed, fix Windows build.
12385
12386 * bytecode/CodeBlock.h:
12387 * dfg/DFGCapabilities.h:
12388 (JSC::DFG::canCompileOpcode):
12389 (JSC::DFG::canCompileOpcodes):
12390 * dfg/DFGCommon.h:
12391 (DFG):
12392
123932012-05-23 Filip Pizlo <fpizlo@apple.com>
12394
fpizlo@apple.com9b928722012-05-24 00:18:55 +000012395 DFG should optimize inlined uses of arguments.length and arguments[i]
12396 https://bugs.webkit.org/show_bug.cgi?id=86327
12397
12398 Reviewed by Gavin Barraclough.
12399
12400 Merged r117017 from dfgopt.
12401
12402 Turns inlined uses of arguments.length into a constant.
12403
12404 Turns inlined uses of arguments[constant] into a direct reference to the
12405 argument.
12406
12407 Big win on micro-benchmarks. Not yet a win on V8 because the hot uses of
12408 arguments.length and arguments[i] are aliased. I'll leave the aliasing
12409 optimizations to a later patch.
12410
12411 * CMakeLists.txt:
12412 * GNUmakefile.list.am:
12413 * JavaScriptCore.xcodeproj/project.pbxproj:
12414 * Target.pri:
12415 * bytecode/DFGExitProfile.h:
12416 (FrequentExitSite):
12417 (JSC::DFG::FrequentExitSite::FrequentExitSite):
12418 (JSC::DFG::QueryableExitProfile::hasExitSite):
12419 (QueryableExitProfile):
12420 * dfg/DFGAbstractState.cpp:
12421 (JSC::DFG::AbstractState::execute):
12422 * dfg/DFGArgumentsSimplificationPhase.cpp: Added.
12423 (DFG):
12424 (ArgumentsSimplificationPhase):
12425 (JSC::DFG::ArgumentsSimplificationPhase::ArgumentsSimplificationPhase):
12426 (JSC::DFG::ArgumentsSimplificationPhase::run):
12427 (JSC::DFG::performArgumentsSimplification):
12428 * dfg/DFGArgumentsSimplificationPhase.h: Added.
12429 (DFG):
12430 * dfg/DFGAssemblyHelpers.cpp:
12431 (JSC::DFG::AssemblyHelpers::executableFor):
12432 (DFG):
12433 * dfg/DFGAssemblyHelpers.h:
12434 (AssemblyHelpers):
12435 * dfg/DFGByteCodeParser.cpp:
12436 (JSC::DFG::ByteCodeParser::parseBlock):
12437 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12438 * dfg/DFGCSEPhase.cpp:
12439 (JSC::DFG::CSEPhase::getLocalLoadElimination):
12440 (JSC::DFG::CSEPhase::performNodeCSE):
12441 * dfg/DFGDriver.cpp:
12442 (JSC::DFG::compile):
12443 * dfg/DFGGraph.h:
12444 (JSC::DFG::Graph::Graph):
12445 (JSC::DFG::Graph::executableFor):
12446 (Graph):
12447 (JSC::DFG::Graph::clobbersWorld):
12448 * dfg/DFGNode.h:
12449 (JSC::DFG::Node::convertToConstant):
12450 (JSC::DFG::Node::convertToGetLocalUnlinked):
12451 (Node):
12452 (JSC::DFG::Node::unlinkedLocal):
12453 * dfg/DFGNodeType.h:
12454 (DFG):
12455 * dfg/DFGOSRExit.cpp:
12456 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
12457 * dfg/DFGPredictionPropagationPhase.cpp:
12458 (JSC::DFG::PredictionPropagationPhase::propagate):
12459 * dfg/DFGSpeculativeJIT32_64.cpp:
12460 (JSC::DFG::SpeculativeJIT::compile):
12461 * dfg/DFGSpeculativeJIT64.cpp:
12462 (JSC::DFG::SpeculativeJIT::compile):
12463
fpizlo@apple.com5e3852d2012-05-24 00:05:21 +0000124642012-05-13 Filip Pizlo <fpizlo@apple.com>
12465
12466 DFG should be able to optimize foo.apply(bar, arguments)
12467 https://bugs.webkit.org/show_bug.cgi?id=86306
12468
12469 Reviewed by Gavin Barraclough.
12470
12471 Merge r116912 from dfgopt.
12472
12473 Enables compilation of op_jneq_ptr and some forms of op_call_varargs.
12474
12475 Also includes a bunch of bug fixes that were made necessary by the increased
12476 pressure on the CFG simplifier.
12477
12478 This is a 1-2% win on V8.
12479
12480 * bytecode/CodeBlock.cpp:
12481 (JSC::CodeBlock::printCallOp):
12482 (JSC::CodeBlock::CodeBlock):
12483 (JSC::ProgramCodeBlock::canCompileWithDFGInternal):
12484 (JSC::EvalCodeBlock::canCompileWithDFGInternal):
12485 (JSC::FunctionCodeBlock::canCompileWithDFGInternal):
12486 * bytecode/CodeBlock.h:
12487 (CodeBlock):
12488 (JSC::CodeBlock::canCompileWithDFG):
12489 (JSC::CodeBlock::canCompileWithDFGState):
12490 (ProgramCodeBlock):
12491 (EvalCodeBlock):
12492 (FunctionCodeBlock):
12493 * dfg/DFGAbstractState.cpp:
12494 (JSC::DFG::AbstractState::execute):
12495 * dfg/DFGByteCodeParser.cpp:
12496 (JSC::DFG::ByteCodeParser::parseBlock):
12497 (JSC::DFG::ByteCodeParser::processPhiStack):
12498 (JSC::DFG::ByteCodeParser::parse):
12499 * dfg/DFGCFGSimplificationPhase.cpp:
12500 (JSC::DFG::CFGSimplificationPhase::run):
12501 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
12502 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12503 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
12504 * dfg/DFGCSEPhase.cpp:
12505 (JSC::DFG::CSEPhase::getLocalLoadElimination):
12506 (CSEPhase):
12507 (JSC::DFG::CSEPhase::setReplacement):
12508 (JSC::DFG::CSEPhase::performNodeCSE):
12509 * dfg/DFGCapabilities.cpp:
12510 (JSC::DFG::debugFail):
12511 (DFG):
12512 (JSC::DFG::canHandleOpcodes):
12513 (JSC::DFG::canCompileOpcodes):
12514 (JSC::DFG::canInlineOpcodes):
12515 * dfg/DFGCapabilities.h:
12516 (JSC::DFG::canCompileOpcode):
12517 (JSC::DFG::canInlineOpcode):
12518 (DFG):
12519 (JSC::DFG::canCompileOpcodes):
12520 (JSC::DFG::canCompileEval):
12521 (JSC::DFG::canCompileProgram):
12522 (JSC::DFG::canCompileFunctionForCall):
12523 (JSC::DFG::canCompileFunctionForConstruct):
12524 * dfg/DFGCommon.h:
12525 * dfg/DFGGraph.cpp:
12526 (JSC::DFG::Graph::dump):
12527 * dfg/DFGNodeType.h:
12528 (DFG):
12529 * dfg/DFGPredictionPropagationPhase.cpp:
12530 (JSC::DFG::PredictionPropagationPhase::propagate):
12531 * dfg/DFGSpeculativeJIT32_64.cpp:
12532 (JSC::DFG::SpeculativeJIT::compile):
12533 * dfg/DFGSpeculativeJIT64.cpp:
12534 (JSC::DFG::SpeculativeJIT::emitCall):
12535 (JSC::DFG::SpeculativeJIT::compile):
12536 * dfg/DFGValidate.cpp:
12537 (Validate):
12538 (JSC::DFG::Validate::validate):
12539 (JSC::DFG::Validate::checkOperand):
12540 (JSC::DFG::Validate::reportValidationContext):
12541 * jit/JIT.cpp:
12542 (JSC::JIT::emitOptimizationCheck):
12543 (JSC::JIT::privateCompileSlowCases):
12544 (JSC::JIT::privateCompile):
12545 * jit/JIT.h:
12546 * jit/JITArithmetic.cpp:
12547 (JSC::JIT::compileBinaryArithOp):
12548 * jit/JITPropertyAccess.cpp:
12549 (JSC::JIT::privateCompilePutByIdTransition):
12550 * jit/JITPropertyAccess32_64.cpp:
12551 (JSC::JIT::privateCompilePutByIdTransition):
12552 * tools/CodeProfile.cpp:
12553 (JSC::CodeProfile::sample):
12554
ggaren@apple.com7070d422012-05-23 23:55:27 +0000125552012-05-23 Geoffrey Garen <ggaren@apple.com>
12556
12557 Refactored WeakBlock to use malloc, clarify behavior
12558 https://bugs.webkit.org/show_bug.cgi?id=87318
12559
12560 Reviewed by Filip Pizlo.
12561
12562 We want to use malloc so we can make these smaller than 4KB,
12563 since an individual MarkedBlock will usually have fewer than
12564 4KB worth of weak pointers.
12565
12566 * heap/Heap.cpp:
12567 (JSC::Heap::markRoots): Renamed visitLiveWeakImpls to visit, since
12568 we no longer need to distinguish from "visitDeadWeakImpls".
12569
12570 Renamed "visitDeadWeakImpls" to "reap" because we're not actually
12571 doing any visiting -- we're just tagging things as dead.
12572
12573 * heap/WeakBlock.cpp:
12574 (JSC::WeakBlock::create):
12575 (JSC::WeakBlock::destroy):
12576 (JSC::WeakBlock::WeakBlock): Malloc!
12577
12578 (JSC::WeakBlock::visit):
12579 (JSC::WeakBlock::reap): Renamed as above.
12580
12581 * heap/WeakBlock.h:
12582 (WeakBlock): Reduced to 3KB, as explained above.
12583
12584 * heap/WeakSet.cpp:
12585 (JSC::WeakSet::visit):
12586 (JSC::WeakSet::reap):
12587 * heap/WeakSet.h:
12588 (WeakSet): Updated for renames, and to match WebKit style.
12589
fpizlo@apple.com11e2f372012-05-23 22:25:21 +0000125902012-05-23 Filip Pizlo <fpizlo@apple.com>
12591
fpizlo@apple.combc96e8f2012-05-23 23:12:59 +000012592 Use after free in JSC::DFG::ByteCodeParser::processPhiStack
12593 https://bugs.webkit.org/show_bug.cgi?id=87312
12594 <rdar://problem/11518848>
12595
12596 Reviewed by Oliver Hunt.
12597
12598 * dfg/DFGByteCodeParser.cpp:
12599 (JSC::DFG::ByteCodeParser::processPhiStack):
12600 (JSC::DFG::ByteCodeParser::parse):
12601
126022012-05-23 Filip Pizlo <fpizlo@apple.com>
12603
fpizlo@apple.com11e2f372012-05-23 22:25:21 +000012604 It should be possible to make C function calls from DFG code on ARM in debug mode
12605 https://bugs.webkit.org/show_bug.cgi?id=87313
12606
12607 Reviewed by Gavin Barraclough.
12608
12609 * dfg/DFGSpeculativeJIT.h:
12610 (SpeculativeJIT):
12611
fpizlo@apple.comc6446112012-05-23 20:52:42 +0000126122012-05-11 Filip Pizlo <fpizlo@apple.com>
12613
12614 DFG should be able to inline functions that use arguments reflectively
12615 https://bugs.webkit.org/show_bug.cgi?id=86132
12616
12617 Reviewed by Oliver Hunt.
12618
12619 Merged r116838 from dfgopt.
12620
12621 This turns on inlining of functions that use arguments reflectively, but it
12622 does not do any of the obvious optimizations that this exposes. I'll save that
12623 for another patch - the important thing for now is that this contains all of
12624 the plumbing necessary to make this kind of inlining sound even in bizarro
12625 cases like an inline callee escaping the arguments object to parts of the
12626 inline caller where the arguments are otherwise dead. Or even more fun cases
12627 like where you've inlined to an inline stack that is three-deep, and the
12628 function on top of the inline stack reflectively accesses the arguments of a
12629 function that is in the middle of the inline stack. Any subsequent
12630 optimizations that we do for the obvious cases of arguments usage in inline
12631 functions will have to take care not to break the baseline functionality that
12632 this patch plumbs together.
12633
12634 * bytecode/CodeBlock.cpp:
12635 (JSC::CodeBlock::printCallOp):
12636 (JSC::CodeBlock::dump):
12637 * bytecode/CodeBlock.h:
12638 * dfg/DFGAssemblyHelpers.h:
12639 (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
12640 (AssemblyHelpers):
12641 * dfg/DFGByteCodeParser.cpp:
12642 (InlineStackEntry):
12643 (JSC::DFG::ByteCodeParser::handleCall):
12644 (JSC::DFG::ByteCodeParser::handleInlining):
12645 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12646 (JSC::DFG::ByteCodeParser::parse):
12647 * dfg/DFGCCallHelpers.h:
12648 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
12649 (CCallHelpers):
12650 * dfg/DFGCapabilities.h:
12651 (JSC::DFG::canInlineOpcode):
12652 * dfg/DFGDriver.cpp:
12653 (JSC::DFG::compile):
12654 * dfg/DFGFixupPhase.cpp:
12655 (JSC::DFG::FixupPhase::fixupNode):
12656 * dfg/DFGOperations.cpp:
12657 * dfg/DFGOperations.h:
12658 * dfg/DFGSpeculativeJIT.h:
12659 (JSC::DFG::SpeculativeJIT::callOperation):
12660 * dfg/DFGSpeculativeJIT32_64.cpp:
12661 (JSC::DFG::SpeculativeJIT::compile):
12662 * dfg/DFGSpeculativeJIT64.cpp:
12663 (JSC::DFG::SpeculativeJIT::compile):
12664 * interpreter/CallFrame.cpp:
12665 (JSC):
12666 (JSC::CallFrame::someCodeBlockForPossiblyInlinedCode):
12667 * interpreter/CallFrame.h:
12668 (ExecState):
12669 (JSC::ExecState::someCodeBlockForPossiblyInlinedCode):
12670 * interpreter/Interpreter.cpp:
12671 (JSC::Interpreter::retrieveArgumentsFromVMCode):
12672 * runtime/Arguments.cpp:
12673 (JSC::Arguments::tearOff):
12674 (JSC):
12675 (JSC::Arguments::tearOffForInlineCallFrame):
12676 * runtime/Arguments.h:
12677 (Arguments):
12678 (JSC::Arguments::create):
12679 (JSC::Arguments::finishCreation):
12680 (JSC):
12681
fpizlo@apple.comfe244b02012-05-23 20:51:21 +0000126822012-05-23 Filip Pizlo <fpizlo@apple.com>
12683
12684 Every OSR exit on ARM results in a crash
12685 https://bugs.webkit.org/show_bug.cgi?id=87307
12686
12687 Reviewed by Geoffrey Garen.
12688
12689 * dfg/DFGThunks.cpp:
12690 (JSC::DFG::osrExitGenerationThunkGenerator):
12691
ggaren@apple.com96fa0e72012-05-23 20:47:46 +0000126922012-05-23 Geoffrey Garen <ggaren@apple.com>
12693
12694 Refactored heap tear-down to use normal value semantics (i.e., destructors)
12695 https://bugs.webkit.org/show_bug.cgi?id=87302
12696
12697 Reviewed by Oliver Hunt.
12698
12699 This is a step toward incremental DOM finalization.
12700
12701 * heap/CopiedSpace.cpp:
12702 (JSC::CopiedSpace::~CopiedSpace):
12703 * heap/CopiedSpace.h:
12704 (CopiedSpace): Just use our destructor, instead of relying on the heap
12705 to send us a special message at a special time.
12706
12707 * heap/Heap.cpp:
12708 (JSC::Heap::Heap): Use OwnPtr for m_markListSet because this is not Sparta.
12709
12710 (JSC::Heap::~Heap): No need for delete or freeAllBlocks because normal
12711 destructors do this work automatically now.
12712
12713 (JSC::Heap::lastChanceToFinalize): Just call lastChanceToFinalize on our
12714 sub-objects, and assume it does the right thing. This improves encapsulation,
12715 so we can add items requiring finalization to our sub-objects.
12716
12717 * heap/Heap.h: Moved m_blockAllocator to get the right destruction order.
12718
12719 * heap/MarkedSpace.cpp:
12720 (Take):
12721 (JSC):
12722 (JSC::Take::Take):
12723 (JSC::Take::operator()):
12724 (JSC::Take::returnValue): Moved to the top of the file so it can be used
12725 in another function.
12726
12727 (JSC::MarkedSpace::~MarkedSpace): Delete all outstanding memory, like a good
12728 destructor should.
12729
12730 (JSC::MarkedSpace::lastChanceToFinalize): Moved some code here from the heap,
12731 since it pertains to our internal implementation details.
12732
12733 * heap/MarkedSpace.h:
12734 (MarkedSpace):
12735 * heap/WeakBlock.cpp:
12736 (JSC::WeakBlock::lastChanceToFinalize):
12737 * heap/WeakBlock.h:
12738 (WeakBlock):
12739 * heap/WeakSet.cpp:
12740 (JSC::WeakSet::lastChanceToFinalize):
12741 * heap/WeakSet.h:
12742 (WeakSet): Stop using a special freeAllBlocks() callback and just implement
12743 lastChanceToFinalize.
12744
ggaren@apple.comd6376d22012-05-23 18:29:55 +0000127452011-05-22 Geoffrey Garen <ggaren@apple.com>
12746
12747 Encapsulated some calculations for whether portions of the heap are empty
12748 https://bugs.webkit.org/show_bug.cgi?id=87210
12749
12750 Reviewed by Gavin Barraclough.
12751
12752 This is a step toward incremental DOM finalization.
12753
12754 * heap/Heap.cpp:
12755 (JSC::Heap::~Heap): Explicitly call freeAllBlocks() instead of relying
12756 implicitly on all blocks thinking they're empty. In future, we may
12757 choose to tear down the heap without first setting all data structures
12758 to "empty".
12759
12760 * heap/MarkedBlock.h:
12761 (JSC::MarkedBlock::isEmpty):
12762 (JSC::MarkedBlock::gatherDirtyCells): Renamed markCountIsZero to isEmpty,
12763 in preparation for making it check for outstanding finalizers in addition
12764 to marked cells.
12765
12766 * heap/MarkedSpace.cpp:
12767 (Take):
12768 (JSC::Take::Take):
12769 (JSC::Take::operator()):
12770 (JSC::Take::returnValue):
12771 (JSC::MarkedSpace::shrink):
12772 (JSC::MarkedSpace::freeAllBlocks): Refactored the "Take" functor to support
12773 a conditional isEmpty check, so it dould be shared by shrink() and freeAllBlocks().
12774
12775 * heap/WeakBlock.cpp:
12776 (JSC::WeakBlock::WeakBlock):
12777 (JSC::WeakBlock::visitLiveWeakImpls):
12778 (JSC::WeakBlock::visitDeadWeakImpls):
12779 * heap/WeakBlock.h:
12780 (WeakBlock):
12781 (JSC::WeakBlock::isEmpty):
12782 * heap/WeakSet.cpp:
12783 (JSC::WeakSet::sweep):
12784 (JSC::WeakSet::shrink): Use isEmpty(), in preparation for changes in
12785 its implementation.
12786
vestbo@webkit.orgb1f6e922012-05-23 10:50:53 +0000127872012-05-23 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12788
12789 [Qt] Remove references to $$QT_SOURCE_TREE
12790
12791 With a modularized Qt, it's ambigious. What we really want is qtbase,
12792 which qtcore is a proxy for (we assume it will always live in qtbase).
12793
12794 Reviewed by Tor Arne Vestbø.
12795
12796 * JavaScriptCore.pri:
12797 * Target.pri:
12798
fpizlo@apple.comb6b454cd2012-05-23 07:53:44 +0000127992012-05-09 Filip Pizlo <fpizlo@apple.com>
12800
12801 DFG should allow inlining in case of certain arity mismatches
12802 https://bugs.webkit.org/show_bug.cgi?id=86059
12803
12804 Reviewed by Geoff Garen.
fpizlo@apple.comb92907c2012-05-23 07:55:12 +000012805
12806 Merge r116620 from dfgopt.
fpizlo@apple.comb6b454cd2012-05-23 07:53:44 +000012807
12808 * dfg/DFGByteCodeParser.cpp:
12809 (JSC::DFG::ByteCodeParser::handleInlining):
12810
fpizlo@apple.com6d4456e2012-05-23 03:48:52 +0000128112012-05-08 Filip Pizlo <fpizlo@apple.com>
12812
fpizlo@apple.com1688cc12012-05-23 07:29:02 +000012813 DFG variable capture analysis should work even if the variables arose through inlining
12814 https://bugs.webkit.org/show_bug.cgi?id=85945
12815
12816 Reviewed by Oliver Hunt.
12817
12818 Merged r116555 from dfgopt.
12819
12820 This just changes how the DFG queries whether a variable is captured. It does not
12821 change any user-visible behavior.
12822
12823 As part of this change, I further solidified the policy that the CFA behaves in an
12824 undefined way for captured locals and queries about their values will not yield
12825 reliable results. This will likely be changed in the future, but for now it makes
12826 sense.
12827
12828 One fun part about this change is that it recognizes that the same variable may
12829 be both captured and not, at the same time, because their live interval spans
12830 inlining boundaries. This only happens in the case of arguments to functions that
12831 capture their arguments, and this change treats them with just the right touch of
12832 conservatism: they will be treated as if captured by the caller as well as the
12833 callee.
12834
12835 Finally, this also adds captured variable reasoning to the InlineCallFrame, which
12836 I thought might be useful for later tooling.
12837
12838 This is perf-neutral, since it does it does not make the DFG take advantage of this
12839 new functionality in any way. In particular, it is still the case that the DFG will
12840 not inline functions that use arguments reflectively or that create activations.
12841
12842 * bytecode/CodeBlock.h:
12843 (CodeBlock):
12844 (JSC::CodeBlock::needsActivation):
12845 (JSC::CodeBlock::argumentIsCaptured):
12846 (JSC::CodeBlock::localIsCaptured):
12847 (JSC::CodeBlock::isCaptured):
12848 * bytecode/CodeOrigin.h:
12849 (InlineCallFrame):
12850 * dfg/DFGAbstractState.cpp:
12851 (JSC::DFG::AbstractState::initialize):
12852 (JSC::DFG::AbstractState::endBasicBlock):
12853 (JSC::DFG::AbstractState::execute):
12854 (JSC::DFG::AbstractState::merge):
12855 * dfg/DFGByteCodeParser.cpp:
12856 (JSC::DFG::ByteCodeParser::newVariableAccessData):
12857 (JSC::DFG::ByteCodeParser::getLocal):
12858 (JSC::DFG::ByteCodeParser::setLocal):
12859 (JSC::DFG::ByteCodeParser::getArgument):
12860 (JSC::DFG::ByteCodeParser::setArgument):
12861 (JSC::DFG::ByteCodeParser::flushArgument):
12862 (JSC::DFG::ByteCodeParser::parseBlock):
12863 (JSC::DFG::ByteCodeParser::processPhiStack):
12864 (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
12865 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12866 * dfg/DFGCFGSimplificationPhase.cpp:
12867 (CFGSimplificationPhase):
12868 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
12869 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
12870 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12871 * dfg/DFGCommon.h:
12872 * dfg/DFGFixupPhase.cpp:
12873 (JSC::DFG::FixupPhase::fixupNode):
12874 * dfg/DFGGraph.cpp:
12875 (JSC::DFG::Graph::nameOfVariableAccessData):
12876 * dfg/DFGGraph.h:
12877 (JSC::DFG::Graph::needsActivation):
12878 (JSC::DFG::Graph::usesArguments):
12879 * dfg/DFGPredictionPropagationPhase.cpp:
12880 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
12881 * dfg/DFGSpeculativeJIT.cpp:
12882 (JSC::DFG::SpeculativeJIT::compile):
12883 * dfg/DFGSpeculativeJIT32_64.cpp:
12884 (JSC::DFG::SpeculativeJIT::compile):
12885 * dfg/DFGSpeculativeJIT64.cpp:
12886 (JSC::DFG::SpeculativeJIT::compile):
12887 * dfg/DFGVariableAccessData.h:
12888 (JSC::DFG::VariableAccessData::VariableAccessData):
12889 (JSC::DFG::VariableAccessData::mergeIsCaptured):
12890 (VariableAccessData):
12891 (JSC::DFG::VariableAccessData::isCaptured):
12892
128932012-05-08 Filip Pizlo <fpizlo@apple.com>
12894
fpizlo@apple.com6d4456e2012-05-23 03:48:52 +000012895 DFG should support op_get_argument_by_val and op_get_arguments_length
12896 https://bugs.webkit.org/show_bug.cgi?id=85911
12897
12898 Reviewed by Oliver Hunt.
12899
12900 Merged r116467 from dfgopt.
12901
12902 This adds a simple and relatively conservative implementation of op_get_argument_by_val
12903 and op_get_arguments_length. We can optimize these later. For now it's great to have
12904 the additional coverage.
12905
12906 This patch appears to be perf-neutral.
12907
12908 * dfg/DFGAbstractState.cpp:
12909 (JSC::DFG::AbstractState::execute):
12910 * dfg/DFGAssemblyHelpers.h:
12911 (JSC::DFG::AssemblyHelpers::addressFor):
12912 (JSC::DFG::AssemblyHelpers::tagFor):
12913 (JSC::DFG::AssemblyHelpers::payloadFor):
12914 * dfg/DFGByteCodeParser.cpp:
12915 (JSC::DFG::ByteCodeParser::parseBlock):
12916 * dfg/DFGCapabilities.h:
12917 (JSC::DFG::canCompileOpcode):
12918 (JSC::DFG::canInlineOpcode):
12919 * dfg/DFGNode.h:
12920 (JSC::DFG::Node::hasHeapPrediction):
12921 * dfg/DFGNodeType.h:
12922 (DFG):
12923 * dfg/DFGOperations.cpp:
12924 * dfg/DFGOperations.h:
12925 * dfg/DFGPredictionPropagationPhase.cpp:
12926 (JSC::DFG::PredictionPropagationPhase::propagate):
12927 * dfg/DFGSpeculativeJIT.h:
12928 (JSC::DFG::SpeculativeJIT::callOperation):
12929 (SpeculativeJIT):
12930 * dfg/DFGSpeculativeJIT32_64.cpp:
12931 (JSC::DFG::SpeculativeJIT::compile):
12932 * dfg/DFGSpeculativeJIT64.cpp:
12933 (JSC::DFG::SpeculativeJIT::compile):
12934 * jit/JITOpcodes.cpp:
12935 (JSC::JIT::emit_op_get_argument_by_val):
12936 * jit/JITOpcodes32_64.cpp:
12937 (JSC::JIT::emit_op_get_argument_by_val):
12938 * llint/LowLevelInterpreter32_64.asm:
12939 * llint/LowLevelInterpreter64.asm:
12940
fpizlo@apple.com15c03c72012-05-23 02:34:13 +0000129412012-05-07 Filip Pizlo <fpizlo@apple.com>
12942
12943 DFG should support op_tear_off_arguments
12944 https://bugs.webkit.org/show_bug.cgi?id=85847
12945
12946 Reviewed by Michael Saboff.
12947
12948 Merged r116378 from dfgopt.
12949
12950 * dfg/DFGAbstractState.cpp:
12951 (JSC::DFG::AbstractState::execute):
12952 * dfg/DFGByteCodeParser.cpp:
12953 (JSC::DFG::ByteCodeParser::parseBlock):
12954 * dfg/DFGCapabilities.h:
12955 (JSC::DFG::canCompileOpcode):
12956 (JSC::DFG::canInlineOpcode):
12957 * dfg/DFGNodeType.h:
12958 (DFG):
12959 * dfg/DFGOperations.cpp:
12960 * dfg/DFGOperations.h:
12961 * dfg/DFGPredictionPropagationPhase.cpp:
12962 (JSC::DFG::PredictionPropagationPhase::propagate):
12963 * dfg/DFGSpeculativeJIT.h:
12964 (SpeculativeJIT):
12965 (JSC::DFG::SpeculativeJIT::callOperation):
12966 * dfg/DFGSpeculativeJIT32_64.cpp:
12967 (JSC::DFG::SpeculativeJIT::compile):
12968 * dfg/DFGSpeculativeJIT64.cpp:
12969 (JSC::DFG::SpeculativeJIT::compile):
12970
mhahnenberg@apple.com3041bc12012-05-23 01:28:03 +0000129712012-05-22 Mark Hahnenberg <mhahnenberg@apple.com>
12972
12973 CopiedSpace::contains doesn't check for oversize blocks
12974 https://bugs.webkit.org/show_bug.cgi?id=87180
12975
12976 Reviewed by Geoffrey Garen.
12977
12978 When doing a conservative scan we use CopiedSpace::contains to determine if a particular
12979 address points into the CopiedSpace. Currently contains() only checks if the address
12980 points to a block in to-space, which means that pointers to oversize blocks may not get scanned.
12981
12982 * heap/CopiedSpace.cpp:
12983 (JSC::CopiedSpace::tryAllocateOversize):
12984 (JSC::CopiedSpace::tryReallocateOversize):
12985 (JSC::CopiedSpace::doneFillingBlock):
12986 (JSC::CopiedSpace::doneCopying):
12987 * heap/CopiedSpace.h: Refactored CopiedSpace so that all blocks (oversize and to-space) are
12988 in a single hash set and bloom filter for membership testing.
12989 (CopiedSpace):
12990 * heap/CopiedSpaceInlineMethods.h:
12991 (JSC::CopiedSpace::contains): We check for the normal block first. Since the oversize blocks are
12992 only page aligned, rather than block aligned, we have to re-mask the ptr to check if it's in
12993 CopiedSpace. Also added a helper function of the same name that takes a CopiedBlock* and checks
12994 if it's in CopiedSpace so that check isn't typed out twice.
12995 (JSC):
12996 (JSC::CopiedSpace::startedCopying):
12997 (JSC::CopiedSpace::addNewBlock):
12998
ggaren@apple.coma68a6502012-05-22 23:59:51 +0000129992012-05-22 Geoffrey Garen <ggaren@apple.com>
13000
13001 CopiedBlock and MarkedBlock should have proper value semantics (i.e., destructors)
13002 https://bugs.webkit.org/show_bug.cgi?id=87172
13003
13004 Reviewed by Oliver Hunt and Phil Pizlo.
13005
13006 This enables MarkedBlock to own non-trivial sub-objects that require
13007 destruction. It also fixes a FIXME about casting a CopiedBlock to a
13008 MarkedBlock at destroy time.
13009
13010 CopiedBlock and MarkedBlock now accept an allocation chunk at create
13011 time and return it at destroy time. Their client is expected to
13012 allocate, recycle, and destroy these chunks.
13013
13014 * heap/BlockAllocator.cpp:
13015 (JSC::BlockAllocator::releaseFreeBlocks):
13016 (JSC::BlockAllocator::blockFreeingThreadMain): Don't call MarkedBlock::destroy
13017 because we expect that to be called before a block is put on our free
13018 list now. Do manually deallocate our allocation chunk because that's
13019 our job now.
13020
13021 * heap/BlockAllocator.h:
13022 (BlockAllocator):
13023 (JSC::BlockAllocator::allocate): Allocate never fails now. This is a
13024 cleaner abstraction because only one object does all the VM allocation
13025 and deallocation. Caching is an implementation detail.
13026
13027 (JSC::BlockAllocator::deallocate): We take an allocation chunk argument
13028 instead of a block because we now expect the block to have been destroyed
13029 before we recycle its memory. For convenience, we still use the HeapBlock
13030 class as our linked list node. This is OK because HeapBlock is a POD type.
13031
13032 * heap/CopiedBlock.h:
13033 (CopiedBlock):
13034 (JSC::CopiedBlock::create):
13035 (JSC::CopiedBlock::destroy):
13036 (JSC::CopiedBlock::CopiedBlock): Added proper create and destroy functions,
13037 to match MarkedBlock.
13038
13039 * heap/CopiedSpace.cpp:
13040 (JSC::CopiedSpace::tryAllocateOversize):
13041 (JSC::CopiedSpace::tryReallocateOversize):
13042 (JSC::CopiedSpace::doneCopying):
13043 (JSC::CopiedSpace::getFreshBlock):
13044 (JSC::CopiedSpace::freeAllBlocks):
13045 * heap/CopiedSpaceInlineMethods.h:
13046 (JSC::CopiedSpace::recycleBlock): Make sure to call destroy before
13047 returning a block to the BlockAllocator. Otherwise, our destructors
13048 won't run. (If we get this wrong now, we'll get a compile error.)
13049
13050 * heap/HeapBlock.h:
13051 (JSC::HeapBlock::HeapBlock): const!
13052
13053 * heap/MarkedAllocator.cpp:
13054 (JSC::MarkedAllocator::allocateBlock): No need to distinguish between
13055 create and recycle -- MarkedBlock always accepts memory allocated by
13056 its client now.
13057
13058 * heap/MarkedBlock.cpp:
13059 (JSC::MarkedBlock::create): Don't allocate memory -- we assume that we're
13060 passed already-allocated memory, to clarify the responsibility for VM
13061 recycling.
13062
13063 (JSC::MarkedBlock::destroy): Do run our destructor before giving back
13064 our VM -- that is the whole point of this patch.
13065
13066 (JSC::MarkedBlock::MarkedBlock):
13067 * heap/MarkedBlock.h:
13068 (MarkedBlock):
13069 * heap/MarkedSpace.cpp: const!
13070
13071 (JSC::MarkedSpace::freeBlocks): Make sure to call destroy before
13072 returning a block to the BlockAllocator. Otherwise, our destructors
13073 won't run. (If we get this wrong now, we'll get a compile error.)
13074
simon.fraser@apple.com9bd2c702012-05-22 20:37:14 +000013075== Rolled over to ChangeLog-2012-05-22 ==