1 2013-03-22 David Kilzer <ddkilzer@apple.com>
3 BUILD FIX (r146558): Build testapi.mm with ARC enabled for armv7s
4 <http://webkit.org/b/112608>
6 Fixes the following build failure:
8 Source/JavaScriptCore/API/tests/testapi.mm:205:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
13 * Configurations/ToolExecutable.xcconfig: Enable ARC for armv7s
16 2013-03-22 David Kilzer <ddkilzer@apple.com>
18 Revert "BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]"
20 This fixes a build failure introduced by this change:
22 Source/JavaScriptCore/API/tests/testapi.mm:206:6: error: ARC forbids explicit message send of 'dealloc'
27 Not sure why this didn't fail locally on my Mac Pro.
29 * API/tests/testapi.mm:
30 (-[TinyDOMNode dealloc]): Remove call to [super dealloc].
32 2013-03-22 David Kilzer <ddkilzer@apple.com>
34 BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]
35 <http://webkit.org/b/112608>
37 Fixes the following build failure:
39 Source/JavaScriptCore/API/tests/testapi.mm:205:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
44 * API/tests/testapi.mm:
45 (-[TinyDOMNode dealloc]): Call [super dealloc].
47 2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
49 Leak bots erroneously report JSC::WatchpointSet as leaking
50 https://bugs.webkit.org/show_bug.cgi?id=107781
52 Reviewed by Filip Pizlo.
54 Since leaks doesn't support tagged pointers, avoid using it by flipping the bit flag to indicate
55 the entry is "fat". We set the flag when the entry is NOT fat; i.e. slim.
57 Replaced FatFlag by SlimFlag and initialized m_bits with this flag to indicate that the entry is
60 * runtime/SymbolTable.cpp:
61 (JSC::SymbolTableEntry::copySlow): Don't set FatFlag since it has been replaced by SlimFlag.
62 (JSC::SymbolTableEntry::inflateSlow): Ditto.
64 * runtime/SymbolTable.h:
65 (JSC::SymbolTableEntry::Fast::Fast): Set SlimFlag by default.
66 (JSC::SymbolTableEntry::Fast::isNull): Ignore SlimFlag.
67 (JSC::SymbolTableEntry::Fast::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag
70 (JSC::SymbolTableEntry::SymbolTableEntry): Set SlimFlag by default.
71 (JSC::SymbolTableEntry::SymbolTableEntry::getFast): Set SlimFlag when creating Fast from a fat entry.
72 (JSC::SymbolTableEntry::isNull): Ignore SlimFlag.
73 (JSC::SymbolTableEntry::FatEntry::FatEntry): Strip SlimFlag.
74 (JSC::SymbolTableEntry::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag is unset.
75 (JSC::SymbolTableEntry::fatEntry): Don't strip FatFlag as this flag doesn't exist anymore.
76 (JSC::SymbolTableEntry::pack): Preserve SlimFlag.
78 (JSC::SymbolTableIndexHashTraits): empty value is no longer zero so don't set emptyValueIsZero true.
80 2013-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
82 Objective-C API: Need a good way to preserve custom properties on JS wrappers
83 https://bugs.webkit.org/show_bug.cgi?id=112608
85 Reviewed by Geoffrey Garen.
87 Currently, we just use a weak map, which means that garbage collection can cause a wrapper to
88 disappear if it isn't directly exported to JavaScript.
90 The most straightforward and safe way (with respect to garbage collection and concurrency) is to have
91 clients add and remove their external references along with their owners. Effectively, the client is
92 recording the structure of the external object graph so that the garbage collector can make sure to
93 mark any wrappers that are reachable through either the JS object graph of the external Obj-C object
94 graph. By keeping these wrappers alive, this has the effect that custom properties on these wrappers
95 will also remain alive.
97 The rule for if an object needs to be tracked by the runtime (and therefore whether the client should report it) is as follows:
98 For a particular object, its references to its children should be added if:
99 1. The child is referenced from JavaScript.
100 2. The child contains references to other objects for which (1) or (2) are true.
102 * API/JSAPIWrapperObject.mm:
103 (JSAPIWrapperObjectHandleOwner::finalize):
104 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): A wrapper object is kept alive only if its JSGlobalObject
105 is marked and its corresponding Objective-C object was added to the set of opaque roots.
106 (JSC::JSAPIWrapperObject::visitChildren): We now call out to scanExternalObjectGraph, which handles adding all Objective-C
107 objects to the set of opaque roots.
108 * API/JSAPIWrapperObject.h:
109 (JSAPIWrapperObject):
110 * API/JSContext.mm: Moved dealloc to its proper place in the main implementation.
111 (-[JSContext dealloc]):
112 * API/JSVirtualMachine.h:
113 * API/JSVirtualMachine.mm:
114 (-[JSVirtualMachine initWithContextGroupRef:]):
115 (-[JSVirtualMachine dealloc]):
116 (getInternalObjcObject): Helper funciton to get the Objective-C object out of JSManagedValues or JSValues if there is one.
117 (-[JSVirtualMachine addManagedReference:withOwner:]): Adds the Objective-C object to the set of objects
118 owned by the owner object in that particular virtual machine.
119 (-[JSVirtualMachine removeManagedReference:withOwner:]): Removes the relationship between the two objects.
120 (-[JSVirtualMachine externalObjectGraph]):
121 (scanExternalObjectGraph): Does a depth-first search of the external object graph in a particular virtual machine starting at
122 the specified root. Each new object it encounters it adds to the set of opaque roots. These opaque roots will keep their
123 corresponding wrapper objects alive if they have them.
124 * API/JSManagedReferenceInternal.h: Added.
125 * API/JSVirtualMachine.mm: Added the per-JSVirtualMachine map between objects and the objects they own, which is more formally
126 known as that virtual machine's external object graph.
127 * API/JSWrapperMap.mm:
128 (-[JSWrapperMap dealloc]): We were leaking this before :-(
129 (-[JSVirtualMachine initWithContextGroupRef:]):
130 (-[JSVirtualMachine dealloc]):
131 (-[JSVirtualMachine externalObjectGraph]):
132 * API/JSVirtualMachineInternal.h:
133 * API/tests/testapi.mm: Added two new tests using the TinyDOMNode class. The first tests that a custom property added to a wrapper
134 doesn't vanish after GC, even though that wrapper isn't directly accessible to the JS garbage collector but is accessible through
135 the external Objective-C object graph. The second test makes sure that adding an object to the external object graph with the same
136 owner doesn't cause any sort of problems.
137 (+[TinyDOMNode sharedVirtualMachine]):
138 (-[TinyDOMNode init]):
139 (-[TinyDOMNode dealloc]):
140 (-[TinyDOMNode appendChild:]):
141 (-[TinyDOMNode numberOfChildren]):
142 (-[TinyDOMNode childAtIndex:]):
143 (-[TinyDOMNode removeChildAtIndex:]):
144 * JavaScriptCore.xcodeproj/project.pbxproj:
145 * heap/SlotVisitor.h:
147 * heap/SlotVisitorInlines.h:
148 (JSC::SlotVisitor::containsOpaqueRootTriState): Added a new method to SlotVisitor to allow scanExternalObjectGraph to have a
149 thread-safe view of opaque roots during parallel marking. The set of opaque roots available to any one SlotVisitor isn't guaranteed
150 to be 100% correct, but that just results in a small duplication of work in scanExternalObjectGraph. To indicate this change for
151 false negatives we return a TriState that's either true or mixed, but never false.
153 2013-03-21 Mark Lam <mark.lam@apple.com>
155 Fix O(n^2) op_debug bytecode charPosition to column computation.
156 https://bugs.webkit.org/show_bug.cgi?id=112957.
158 Reviewed by Geoffrey Garen.
160 The previous algorithm does a linear reverse scan of the source string
161 to find the line start for any given char position. This results in a
162 O(n^2) algortithm when the source string has no line breaks.
164 The new algorithm computes a line start column table for a
165 SourceProvider on first use. This line start table is used to fix up
166 op_debug's charPosition operand into a column operand when an
167 UnlinkedCodeBlock is linked into a CodeBlock. The initialization of
168 the line start table is O(n), and the CodeBlock column fix up is
171 * bytecode/CodeBlock.cpp:
172 (JSC::CodeBlock::dumpBytecode):
173 (JSC::CodeBlock::CodeBlock): - do column fix up.
174 * interpreter/Interpreter.cpp:
175 (JSC::Interpreter::debug): - no need to do column fixup anymore.
176 * interpreter/Interpreter.h:
178 (JSC::DEFINE_STUB_FUNCTION):
179 * llint/LLIntSlowPaths.cpp:
180 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
181 * parser/SourceProvider.cpp:
182 (JSC::SourceProvider::lineStarts):
183 (JSC::charPositionExtractor):
184 (JSC::SourceProvider::charPositionToColumnNumber):
185 - initialize line start column table if needed.
186 - look up line start for the given char position.
187 * parser/SourceProvider.h:
189 2013-03-21 Filip Pizlo <fpizlo@apple.com>
191 JSC profiler should have an at-a-glance report of the success of DFG optimization
192 https://bugs.webkit.org/show_bug.cgi?id=112988
194 Reviewed by Geoffrey Garen.
196 * dfg/DFGByteCodeParser.cpp:
197 (JSC::DFG::ByteCodeParser::handleCall):
198 (JSC::DFG::ByteCodeParser::handleGetById):
199 (JSC::DFG::ByteCodeParser::parseBlock):
200 * profiler/ProfilerCompilation.cpp:
201 (JSC::Profiler::Compilation::Compilation):
202 (JSC::Profiler::Compilation::toJS):
203 * profiler/ProfilerCompilation.h:
204 (JSC::Profiler::Compilation::noticeInlinedGetById):
205 (JSC::Profiler::Compilation::noticeInlinedPutById):
206 (JSC::Profiler::Compilation::noticeInlinedCall):
208 * runtime/CommonIdentifiers.h:
210 2013-03-21 Mark Lam <mark.lam@apple.com>
212 Fix lexer charPosition computation when "rewind"ing the lexer.
213 https://bugs.webkit.org/show_bug.cgi?id=112952.
215 Reviewed by Michael Saboff.
217 Changed the Lexer to no longer keep a m_charPosition. Instead, we compute
218 currentCharPosition() from m_code and m_codeStartPlusOffset, where
219 m_codeStartPlusOffset is the SourceProvider m_codeStart + the SourceCode
220 start offset. This ensures that the charPosition is always in sync with
225 (JSC::::internalShift):
229 (JSC::Lexer::currentCharPosition):
230 (JSC::::lexExpectIdentifier):
232 2013-03-21 Alberto Garcia <agarcia@igalia.com>
234 [BlackBerry] GCActivityCallback: replace JSLock with JSLockHolder
235 https://bugs.webkit.org/show_bug.cgi?id=112448
237 Reviewed by Xan Lopez.
239 This changed in r121381.
241 * runtime/GCActivityCallbackBlackBerry.cpp:
242 (JSC::DefaultGCActivityCallback::doWork):
244 2013-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
246 Objective-C API: wrapperClass holds a static JSClassRef, which causes JSGlobalObjects to leak
247 https://bugs.webkit.org/show_bug.cgi?id=112856
249 Reviewed by Geoffrey Garen.
251 Through a very convoluted path that involves the caching of prototypes on the JSClassRef, we can leak
252 JSGlobalObjects when inserting an Objective-C object into multiple independent JSContexts.
254 * API/JSAPIWrapperObject.cpp: Removed.
255 * API/JSAPIWrapperObject.h:
256 (JSAPIWrapperObject):
257 * API/JSAPIWrapperObject.mm: Copied from Source/JavaScriptCore/API/JSAPIWrapperObject.cpp. Made this an
258 Objective-C++ file so that we can call release on the wrappedObject. Also added a WeakHandleOwner for
259 JSAPIWrapperObjects. This will also be used in a future patch for https://bugs.webkit.org/show_bug.cgi?id=112608.
260 (JSAPIWrapperObjectHandleOwner):
261 (jsAPIWrapperObjectHandleOwner):
262 (JSAPIWrapperObjectHandleOwner::finalize): This finalize replaces the old finalize that was done through
264 (JSC::JSAPIWrapperObject::finishCreation): Allocate the WeakImpl. Balanced in finalize.
265 (JSC::JSAPIWrapperObject::setWrappedObject): We now do the retain of the wrappedObject here rather than in random
266 places scattered around JSWrapperMap.mm
267 * API/JSObjectRef.cpp: Added some ifdefs for platforms that don't support the Obj-C API.
268 (JSObjectGetPrivate): Ditto.
269 (JSObjectSetPrivate): Ditto.
270 (JSObjectGetPrivateProperty): Ditto.
271 (JSObjectSetPrivateProperty): Ditto.
272 (JSObjectDeletePrivateProperty): Ditto.
273 * API/JSValueRef.cpp: Ditto.
274 (JSValueIsObjectOfClass): Ditto.
275 * API/JSWrapperMap.mm: Remove wrapperClass().
276 (objectWithCustomBrand): Change to no longer use a parent class, which was only used to give the ability to
277 finalize wrapper objects.
278 (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]): Change to no longer use wrapperClass().
279 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): Ditto.
280 (tryUnwrapObjcObject): We now check if the object inherits from JSAPIWrapperObject.
281 * API/tests/testapi.mm: Added a test that exports an Objective-C object to two different JSContexts and makes
282 sure that the first one is collected properly by using a weak JSManagedValue for the wrapper in the first JSContext.
283 * CMakeLists.txt: Build file modifications.
284 * GNUmakefile.list.am: Ditto.
285 * JavaScriptCore.gypi: Ditto.
286 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
287 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Ditto.
288 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.
289 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
290 * runtime/JSGlobalObject.cpp: More ifdefs for unsupported platforms.
291 (JSC::JSGlobalObject::reset): Ditto.
292 (JSC::JSGlobalObject::visitChildren): Ditto.
293 * runtime/JSGlobalObject.h: Ditto.
294 (JSGlobalObject): Ditto.
295 (JSC::JSGlobalObject::objcCallbackFunctionStructure): Ditto.
297 2013-03-21 Anton Muhin <antonm@chromium.org>
299 Unreviewed, rolling out r146483.
300 http://trac.webkit.org/changeset/146483
301 https://bugs.webkit.org/show_bug.cgi?id=111695
305 * bytecode/GlobalResolveInfo.h: Removed property svn:mergeinfo.
307 2013-03-21 Gabor Rapcsanyi <rgabor@webkit.org>
309 Implement LLInt for CPU(ARM_TRADITIONAL)
310 https://bugs.webkit.org/show_bug.cgi?id=97589
312 Reviewed by Zoltan Herczeg.
314 Enable LLInt for ARMv5 and ARMv7 traditional as well.
316 * llint/LLIntOfflineAsmConfig.h:
317 * llint/LowLevelInterpreter.asm:
318 * llint/LowLevelInterpreter32_64.asm:
320 * offlineasm/backends.rb:
321 * offlineasm/instructions.rb:
323 2013-03-20 Cosmin Truta <ctruta@blackberry.com>
325 [QNX][ARM] REGRESSION(r135330): Various failures in Octane
326 https://bugs.webkit.org/show_bug.cgi?id=112863
330 This was fixed in http://trac.webkit.org/changeset/146396 on Linux only.
331 Enable this fix on QNX.
333 * assembler/ARMv7Assembler.h:
335 (JSC::ARMv7Assembler::replaceWithJump):
336 (JSC::ARMv7Assembler::maxJumpReplacementSize):
337 * assembler/MacroAssemblerARMv7.h:
338 (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):
340 2013-03-20 Filip Pizlo <fpizlo@apple.com>
342 Fix indentation of JSString.h
344 Rubber stamped by Mark Hahnenberg.
346 * runtime/JSString.h:
348 2013-03-20 Filip Pizlo <fpizlo@apple.com>
350 "" + x where x is not a string should be optimized by the DFG to some manner of ToString conversion
351 https://bugs.webkit.org/show_bug.cgi?id=112845
353 Reviewed by Mark Hahnenberg.
355 I like to do "" + x. So I decided to make DFG recognize it, and related idioms.
357 * dfg/DFGFixupPhase.cpp:
358 (JSC::DFG::FixupPhase::fixupNode):
359 (JSC::DFG::FixupPhase::fixupToPrimitive):
361 (JSC::DFG::FixupPhase::fixupToString):
362 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
363 * dfg/DFGPredictionPropagationPhase.cpp:
364 (JSC::DFG::resultOfToPrimitive):
366 (JSC::DFG::PredictionPropagationPhase::propagate):
367 * dfg/DFGPredictionPropagationPhase.h:
370 2013-03-20 Zoltan Herczeg <zherczeg@webkit.org>
372 ARMv7 replaceWithJump ASSERT failure after r135330.
373 https://bugs.webkit.org/show_bug.cgi?id=103146
375 Reviewed by Filip Pizlo.
377 On Linux, the 24 bit distance range of jumps sometimes does not
378 enough to cover all targets addresses. This patch supports jumps
379 outside of this range using a mov/movt/bx 10 byte long sequence.
381 * assembler/ARMv7Assembler.h:
383 (JSC::ARMv7Assembler::revertJumpTo_movT3movtcmpT2):
384 (JSC::ARMv7Assembler::nopw):
385 (JSC::ARMv7Assembler::label):
386 (JSC::ARMv7Assembler::replaceWithJump):
387 (JSC::ARMv7Assembler::maxJumpReplacementSize):
388 * assembler/MacroAssemblerARMv7.h:
389 (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):
391 2013-03-20 Mark Hahnenberg <mhahnenberg@apple.com>
393 Objective-C API: Fix over-releasing in allocateConstructorAndPrototypeWithSuperClassInfo:
394 https://bugs.webkit.org/show_bug.cgi?id=112832
396 Reviewed by Geoffrey Garen.
398 If either the m_constructor or m_prototype (but not both) is collected, we will call
399 allocateConstructorAndPrototypeWithSuperClassInfo, which will create a new object to replace the one
400 that was collected, but at the end of the method we call release on both of them.
401 This is incorrect since we autorelease the JSValue in the case that the object doesn't need to be
402 reallocated. Thus we'll end up overreleasing later during the drain of the autorelease pool.
404 * API/JSWrapperMap.mm:
405 (objectWithCustomBrand): We no longer alloc here. We instead call the JSValue valueWithValue class method,
406 which autoreleases for us.
407 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): We no longer call release on the
408 constructor or prototype JSValues.
409 * API/tests/testapi.mm: Added a new test that crashes on ToT due to over-releasing.
411 2013-03-19 Filip Pizlo <fpizlo@apple.com>
413 It's called "Hash Consing" not "Hash Consting"
414 https://bugs.webkit.org/show_bug.cgi?id=112768
416 Rubber stamped by Mark Hahnenberg.
418 See http://en.wikipedia.org/wiki/Hash_consing
420 * heap/GCThreadSharedData.cpp:
421 (JSC::GCThreadSharedData::GCThreadSharedData):
422 (JSC::GCThreadSharedData::reset):
423 * heap/GCThreadSharedData.h:
424 (GCThreadSharedData):
425 * heap/SlotVisitor.cpp:
426 (JSC::SlotVisitor::SlotVisitor):
427 (JSC::SlotVisitor::setup):
428 (JSC::SlotVisitor::reset):
429 (JSC::JSString::tryHashConsLock):
430 (JSC::JSString::releaseHashConsLock):
431 (JSC::JSString::shouldTryHashCons):
432 (JSC::SlotVisitor::internalAppend):
433 * heap/SlotVisitor.h:
435 * runtime/JSGlobalData.cpp:
436 (JSC::JSGlobalData::JSGlobalData):
437 * runtime/JSGlobalData.h:
439 (JSC::JSGlobalData::haveEnoughNewStringsToHashCons):
440 (JSC::JSGlobalData::resetNewStringsSinceLastHashCons):
441 * runtime/JSString.h:
442 (JSC::JSString::finishCreation):
444 (JSC::JSString::isHashConsSingleton):
445 (JSC::JSString::clearHashConsSingleton):
446 (JSC::JSString::setHashConsSingleton):
448 2013-03-20 Filip Pizlo <fpizlo@apple.com>
450 DFG implementation of op_strcat should inline rope allocations
451 https://bugs.webkit.org/show_bug.cgi?id=112780
453 Reviewed by Oliver Hunt.
455 This gets rid of the StrCat node and adds a MakeRope node. The MakeRope node can
456 take either two or three operands, and allocates a rope string with either two or
457 three fibers. (The magic choice of three children for non-VarArg nodes happens to
458 match exactly with the magic choice of three fibers for rope strings.)
460 ValueAdd on KnownString is replaced with MakeRope with two children.
462 StrCat gets replaced by an appropriate sequence of MakeRope's.
464 MakeRope does not do the dynamic check to see if its children are empty strings.
465 This is replaced by a static check, instead. The downside is that we may use more
466 memory if the strings passed to MakeRope turn out to dynamically be empty. The
467 upside is that we do fewer checks in the cases where either the strings are not
468 empty, or where the strings are statically known to be empty. I suspect both of
469 those cases are more common, than the case where the string is dynamically empty.
471 This also results in some badness for X86. MakeRope needs six registers if it is
472 allocating a three-rope. We don't have six registers to spare on X86. Currently,
473 the code side-steps this problem by just never usign three-ropes in optimized
474 code on X86. All other architectures, including X86_64, don't have this problem.
476 This is a shocking speed-up. 9% progressions on both V8/splay and
477 SunSpider/date-format-xparb. 1% progression on V8v7 overall, and ~0.5% progression
478 on SunSpider. 2x speed-up on microbenchmarks that test op_strcat.
480 * dfg/DFGAbstractState.cpp:
481 (JSC::DFG::AbstractState::executeEffects):
482 * dfg/DFGAdjacencyList.h:
484 (JSC::DFG::AdjacencyList::removeEdge):
485 * dfg/DFGArgumentsSimplificationPhase.cpp:
486 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
487 * dfg/DFGBackwardsPropagationPhase.cpp:
488 (JSC::DFG::BackwardsPropagationPhase::propagate):
489 * dfg/DFGByteCodeParser.cpp:
490 (JSC::DFG::ByteCodeParser::parseBlock):
491 * dfg/DFGCSEPhase.cpp:
492 (JSC::DFG::CSEPhase::putStructureStoreElimination):
493 (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
494 (JSC::DFG::CSEPhase::performNodeCSE):
495 * dfg/DFGDCEPhase.cpp:
496 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
497 * dfg/DFGFixupPhase.cpp:
498 (JSC::DFG::FixupPhase::fixupNode):
499 (JSC::DFG::FixupPhase::createToString):
500 (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
501 (JSC::DFG::FixupPhase::convertStringAddUse):
503 (JSC::DFG::FixupPhase::convertToMakeRope):
504 (JSC::DFG::FixupPhase::fixupMakeRope):
505 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
508 * dfg/DFGOperations.cpp:
509 * dfg/DFGOperations.h:
510 * dfg/DFGPredictionPropagationPhase.cpp:
511 (JSC::DFG::PredictionPropagationPhase::propagate):
512 * dfg/DFGSpeculativeJIT.cpp:
513 (JSC::DFG::SpeculativeJIT::compileAdd):
514 (JSC::DFG::SpeculativeJIT::compileMakeRope):
516 * dfg/DFGSpeculativeJIT.h:
517 (JSC::DFG::SpeculativeJIT::callOperation):
519 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
520 (JSC::DFG::SpeculateCellOperand::~SpeculateCellOperand):
521 (JSC::DFG::SpeculateCellOperand::gpr):
522 (JSC::DFG::SpeculateCellOperand::use):
523 * dfg/DFGSpeculativeJIT32_64.cpp:
524 (JSC::DFG::SpeculativeJIT::compile):
525 * dfg/DFGSpeculativeJIT64.cpp:
526 (JSC::DFG::SpeculativeJIT::compile):
527 * runtime/JSString.h:
530 2013-03-20 Peter Gal <galpeter@inf.u-szeged.hu>
532 Implement and32 on MIPS platform
533 https://bugs.webkit.org/show_bug.cgi?id=112665
535 Reviewed by Zoltan Herczeg.
537 * assembler/MacroAssemblerMIPS.h:
538 (JSC::MacroAssemblerMIPS::and32): Added missing method.
539 (MacroAssemblerMIPS):
541 2013-03-20 Mark Lam <mark.lam@apple.com>
543 Fix incorrect debugger column number value.
544 https://bugs.webkit.org/show_bug.cgi?id=112741.
546 Reviewed by Oliver Hunt.
548 1. In lexer, parser, and debugger code, renamed column to charPosition.
549 2. Convert the charPosition to the equivalent column number before
550 passing it to the debugger.
551 3. Changed ScopeNodes to take both a startLocation and an endLocation.
552 This allows FunctionBodyNodes, ProgramNodes, and EvalNodess to emit
553 correct debug hooks with correct starting line and column numbers.
554 4. Fixed the Lexer to not reset the charPosition (previously
555 columnNumber) in Lexer::lex().
557 * JavaScriptCore.order:
558 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
559 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
560 * bytecode/CodeBlock.cpp:
561 (JSC::CodeBlock::dumpBytecode):
562 * bytecompiler/BytecodeGenerator.cpp:
563 (JSC::BytecodeGenerator::emitDebugHook):
564 * bytecompiler/BytecodeGenerator.h:
565 (JSC::BytecodeGenerator::emitExpressionInfo):
566 * bytecompiler/NodesCodegen.cpp:
567 (JSC::ArrayNode::toArgumentList):
568 (JSC::ConstStatementNode::emitBytecode):
569 (JSC::EmptyStatementNode::emitBytecode):
570 (JSC::DebuggerStatementNode::emitBytecode):
571 (JSC::ExprStatementNode::emitBytecode):
572 (JSC::VarStatementNode::emitBytecode):
573 (JSC::IfNode::emitBytecode):
574 (JSC::IfElseNode::emitBytecode):
575 (JSC::DoWhileNode::emitBytecode):
576 (JSC::WhileNode::emitBytecode):
577 (JSC::ForNode::emitBytecode):
578 (JSC::ForInNode::emitBytecode):
579 (JSC::ContinueNode::emitBytecode):
580 (JSC::BreakNode::emitBytecode):
581 (JSC::ReturnNode::emitBytecode):
582 (JSC::WithNode::emitBytecode):
583 (JSC::SwitchNode::emitBytecode):
584 (JSC::LabelNode::emitBytecode):
585 (JSC::ThrowNode::emitBytecode):
586 (JSC::TryNode::emitBytecode):
587 (JSC::ProgramNode::emitBytecode):
588 (JSC::EvalNode::emitBytecode):
589 (JSC::FunctionBodyNode::emitBytecode):
590 * interpreter/Interpreter.cpp:
591 (JSC::Interpreter::debug):
592 - convert charPosition to column for the debugger.
593 * interpreter/Interpreter.h:
595 (DEFINE_STUB_FUNCTION(void, op_debug)):
596 * llint/LLIntSlowPaths.cpp:
597 (LLINT_SLOW_PATH_DECL(slow_op_debug)):
598 * parser/ASTBuilder.h:
599 (JSC::ASTBuilder::createFunctionExpr):
600 (JSC::ASTBuilder::createFunctionBody):
601 (JSC::ASTBuilder::createGetterOrSetterProperty):
602 (JSC::ASTBuilder::createFuncDeclStatement):
603 (JSC::ASTBuilder::createBlockStatement):
604 (JSC::ASTBuilder::createExprStatement):
605 (JSC::ASTBuilder::createIfStatement):
606 (JSC::ASTBuilder::createForLoop):
607 (JSC::ASTBuilder::createForInLoop):
608 (JSC::ASTBuilder::createVarStatement):
609 (JSC::ASTBuilder::createReturnStatement):
610 (JSC::ASTBuilder::createBreakStatement):
611 (JSC::ASTBuilder::createContinueStatement):
612 (JSC::ASTBuilder::createTryStatement):
613 (JSC::ASTBuilder::createSwitchStatement):
614 (JSC::ASTBuilder::createWhileStatement):
615 (JSC::ASTBuilder::createDoWhileStatement):
616 (JSC::ASTBuilder::createWithStatement):
617 (JSC::ASTBuilder::createThrowStatement):
618 (JSC::ASTBuilder::createDebugger):
619 (JSC::ASTBuilder::createConstStatement):
622 (JSC::::internalShift):
626 (JSC::Lexer::currentCharPosition):
628 (JSC::::lexExpectIdentifier):
629 * parser/NodeConstructors.h:
632 (JSC::StatementNode::setLoc):
633 (JSC::ScopeNode::ScopeNode):
634 (JSC::ProgramNode::ProgramNode):
635 (JSC::ProgramNode::create):
636 (JSC::EvalNode::EvalNode):
637 (JSC::EvalNode::create):
638 (JSC::FunctionBodyNode::FunctionBodyNode):
639 (JSC::FunctionBodyNode::create):
641 (JSC::Node::charPosition):
644 (JSC::StatementNode::lastLine):
646 (JSC::ScopeNode::startLine):
647 (JSC::ScopeNode::startCharPosition):
653 (JSC::::parseFunctionBody):
654 (JSC::::parseFunctionInfo):
657 * parser/ParserTokens.h:
658 (JSC::JSTokenLocation::JSTokenLocation):
660 * parser/SyntaxChecker.h:
661 (JSC::SyntaxChecker::createFunctionBody):
663 2013-03-20 Csaba Osztrogonác <ossy@webkit.org>
665 REGRESSION(r146089): It broke 20 sputnik tests on ARM traditional and Thumb2
666 https://bugs.webkit.org/show_bug.cgi?id=112676
668 Rubber-stamped by Filip Pizlo.
670 Add one more EABI_32BIT_DUMMY_ARG to make DFG JIT ARM EABI compatible
671 again after r146089 similar to https://bugs.webkit.org/show_bug.cgi?id=84449
673 * dfg/DFGSpeculativeJIT.h:
674 (JSC::DFG::SpeculativeJIT::callOperation):
676 2013-03-19 Michael Saboff <msaboff@apple.com>
678 Crash when loading http://www.jqchart.com/jquery/gauges/RadialGauge/LiveData
679 https://bugs.webkit.org/show_bug.cgi?id=112694
681 Reviewed by Filip Pizlo.
683 We were trying to convert an NewArray to a Phantom, but convertToPhantom doesn't handle
684 nodes with variable arguments. Added code to insert a Phantom node in front of all the
685 live children of a var args node. Added ASSERT not var args for convertToPhantom to
686 catch any other similar cases. Added a new convertToPhantomUnchecked() for converting
689 * dfg/DFGDCEPhase.cpp:
690 (JSC::DFG::DCEPhase::run):
693 (JSC::DFG::Node::setOpAndDefaultNonExitFlags): Added ASSERT(!(m_flags & NodeHasVarArgs))
694 (JSC::DFG::Node::setOpAndDefaultNonExitFlagsUnchecked):
695 (JSC::DFG::Node::convertToPhantomUnchecked):
697 2013-03-19 Mark Hahnenberg <mhahnenberg@apple.com>
699 Crash in SpeculativeJIT::fillSpeculateIntInternal<false> on http://bellard.org/jslinux
700 https://bugs.webkit.org/show_bug.cgi?id=112738
702 Reviewed by Filip Pizlo.
704 * dfg/DFGFixupPhase.cpp:
705 (JSC::DFG::FixupPhase::fixIntEdge): We shouldn't be killing this node because it could be
706 referenced by other people.
708 2013-03-19 Oliver Hunt <oliver@apple.com>
710 RELEASE_ASSERT fires in exception handler lookup
714 Temporarily switch this RELEASE_ASSERT into a regular ASSERT
715 as currently this is producing fairly bad crashiness.
717 * bytecode/CodeBlock.cpp:
718 (JSC::CodeBlock::handlerForBytecodeOffset):
720 2013-03-18 Filip Pizlo <fpizlo@apple.com>
722 DFG should optimize StringObject.length and StringOrStringObject.length
723 https://bugs.webkit.org/show_bug.cgi?id=112658
725 Reviewed by Mark Hahnenberg.
727 Implemented by injecting a ToString(StringObject:@a) or ToString(StringOrStringObject:@a) prior
728 to GetArrayLength with ArrayMode(Array::String) if @a is predicted StringObject or
729 StringOrStringObject.
731 * dfg/DFGFixupPhase.cpp:
732 (JSC::DFG::FixupPhase::fixupNode):
733 (JSC::DFG::FixupPhase::createToString):
735 (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
736 (JSC::DFG::FixupPhase::convertStringAddUse):
738 2013-03-19 Gabor Rapcsanyi <rgabor@webkit.org>
740 Implement and32 on ARMv7 and ARM traditional platforms
741 https://bugs.webkit.org/show_bug.cgi?id=112663
743 Reviewed by Zoltan Herczeg.
745 * assembler/MacroAssemblerARM.h:
746 (JSC::MacroAssemblerARM::and32): Add missing method.
748 * assembler/MacroAssemblerARMv7.h:
749 (JSC::MacroAssemblerARMv7::and32): Add missing method.
750 (MacroAssemblerARMv7):
752 2013-03-18 Filip Pizlo <fpizlo@apple.com>
754 DFG ToString generic cases should work correctly
755 https://bugs.webkit.org/show_bug.cgi?id=112654
756 <rdar://problem/13447250>
758 Reviewed by Geoffrey Garen.
760 * dfg/DFGSpeculativeJIT.cpp:
761 (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
762 * dfg/DFGSpeculativeJIT32_64.cpp:
763 (JSC::DFG::SpeculativeJIT::compile):
764 * dfg/DFGSpeculativeJIT64.cpp:
765 (JSC::DFG::SpeculativeJIT::compile):
767 2013-03-18 Michael Saboff <msaboff@apple.com>
769 Unreviewed build fix for 32 bit builds.
771 * dfg/DFGSpeculativeJIT32_64.cpp:
772 (JSC::DFG::SpeculativeJIT::compile):
774 2013-03-18 Michael Saboff <msaboff@apple.com>
776 EFL: Unsafe branch detected in compilePutByValForFloatTypedArray()
777 https://bugs.webkit.org/show_bug.cgi?id=112609
779 Reviewed by Geoffrey Garen.
781 Created local valueFPR and scratchFPR and filled them with valueOp.fpr() and scratch.fpr()
782 respectively so that if valueOp.fpr() causes a spill during allocation, it occurs before the
783 branch and also to follow convention. Added register allocation checks to FPRTemporary.
784 Cleaned up a couple of other places to follow the "AllocatVirtualRegType foo, get machine
785 reg from foo" pattern.
787 * dfg/DFGSpeculativeJIT.cpp:
788 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
789 * dfg/DFGSpeculativeJIT.h:
790 (JSC::DFG::SpeculativeJIT::fprAllocate):
791 * dfg/DFGSpeculativeJIT32_64.cpp:
792 (JSC::DFG::SpeculativeJIT::convertToDouble):
793 (JSC::DFG::SpeculativeJIT::compile):
794 * dfg/DFGSpeculativeJIT64.cpp:
795 (JSC::DFG::SpeculativeJIT::compile):
797 2013-03-18 Filip Pizlo <fpizlo@apple.com>
799 DFG should inline binary string concatenations (i.e. ValueAdd with string children)
800 https://bugs.webkit.org/show_bug.cgi?id=112599
802 Reviewed by Oliver Hunt.
804 This does as advertised: if you do x + y where x and y are strings, you'll get
805 a fast inlined JSRopeString allocation (along with whatever checks are necessary).
806 It also does good things if either x or y (or both) are StringObjects, or some
807 other thing like StringOrStringObject. It also lays the groundwork for making this
808 fast if either x or y are numbers, or some other reasonably-cheap-to-convert
811 * dfg/DFGAbstractState.cpp:
812 (JSC::DFG::AbstractState::executeEffects):
813 * dfg/DFGFixupPhase.cpp:
814 (JSC::DFG::FixupPhase::fixupNode):
816 (JSC::DFG::FixupPhase::isStringObjectUse):
817 (JSC::DFG::FixupPhase::convertStringAddUse):
818 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
819 * dfg/DFGOperations.cpp:
820 * dfg/DFGOperations.h:
821 * dfg/DFGSpeculativeJIT.cpp:
822 (JSC::DFG::SpeculativeJIT::compileAdd):
823 * dfg/DFGSpeculativeJIT.h:
824 (JSC::DFG::SpeculativeJIT::callOperation):
826 (JSC::DFG::SpeculativeJIT::emitAllocateJSCell):
827 (JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
828 * runtime/JSString.h:
829 (JSC::JSString::offsetOfFlags):
832 (JSC::JSRopeString::offsetOfFibers):
834 2013-03-18 Filip Pizlo <fpizlo@apple.com>
836 JSC_NATIVE_FUNCTION() takes an identifier for the name and then uses #name, which is unsafe if name was already #define'd to something else
837 https://bugs.webkit.org/show_bug.cgi?id=112639
839 Reviewed by Michael Saboff.
841 Change it to take a string instead.
843 * runtime/JSObject.h:
845 * runtime/ObjectPrototype.cpp:
846 (JSC::ObjectPrototype::finishCreation):
847 * runtime/StringPrototype.cpp:
848 (JSC::StringPrototype::finishCreation):
850 2013-03-18 Brent Fulgham <bfulgham@webkit.org>
852 [WinCairo] Get build working under VS2010.
853 https://bugs.webkit.org/show_bug.cgi?id=112604
855 Reviewed by Tim Horton.
857 * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Use CFLite-specific
858 build target (standard version links against CoreFoundation.lib
859 instead of CFLite.lib).
860 * JavaScriptCore.vcxproj/testapi/testapiCommonCFLite.props: Added.
861 * JavaScriptCore.vcxproj/testapi/testapiDebugCFLite.props: Added.
862 * JavaScriptCore.vcxproj/testapi/testapiReleaseCFLite.props: Added.
864 2013-03-18 Roger Fong <roger_fong@apple.com>
866 AppleWin VS2010 Debug configuration build fix..
868 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
870 2013-03-18 Brent Fulgham <bfulgham@webkit.org>
872 [WinCairo] Get build working under VS2010.
873 https://bugs.webkit.org/show_bug.cgi?id=112604
875 Reviewed by Tim Horton.
877 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Add build targets for
878 Debug_WinCairo and Release_WinCairo using CFLite.
879 * JavaScriptCore.vcxproj/JavaScriptCoreCFLite.props: Added.
880 * JavaScriptCore.vcxproj/JavaScriptCoreDebugCFLite.props: Added.
881 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj:
882 Add Debug_WinCairo and Release_WinCairo build targets to
883 make sure headers are copied to proper build folder.
884 * JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj: Ditto.
885 * JavaScriptCore.vcxproj/JavaScriptCoreReleaseCFLite.props: Added.
886 * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj:
887 Add Debug_WinCairo and Release_WinCairo build targets to
888 make sure headers are copied to proper build folder.
889 * JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj:
891 * JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcxproj:
893 * JavaScriptCore.vcxproj/jsc/jsc.vcxproj: Ditto.
894 * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj: Ditto.
895 * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Ditto.
897 2013-03-18 Michael Saboff <msaboff@apple.com>
899 Potentially unsafe register allocations in DFG code generation
900 https://bugs.webkit.org/show_bug.cgi?id=112477
902 Reviewed by Geoffrey Garen.
904 Moved allocation of temporary GPRs to be before any generated branches in the functions below.
906 * dfg/DFGSpeculativeJIT32_64.cpp:
907 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
908 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
909 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
910 * dfg/DFGSpeculativeJIT64.cpp:
911 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
912 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
913 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
915 2013-03-15 Filip Pizlo <fpizlo@apple.com>
917 DFG string conversions and allocations should be inlined
918 https://bugs.webkit.org/show_bug.cgi?id=112376
920 Reviewed by Geoffrey Garen.
922 This turns new String(), String(), String.prototype.valueOf(), and
923 String.prototype.toString() into intrinsics. It gives the DFG the ability to handle
924 conversions from StringObject to JSString and vice-versa, and also gives it the
925 ability to handle cases where a variable may be either a StringObject or a JSString.
926 To do this, I added StringObject to value profiling (and removed the stale
927 distinction between Myarguments and Foreignarguments). I also cleaned up ToPrimitive
928 handling, using some of the new functionality but also taking advantage of the
929 existence of Identity(String:@a).
931 This is a 2% SunSpider speed-up. Also there are some speed-ups on V8v7 and Kraken.
932 On microbenchmarks that stress new String() this is a 14x speed-up.
935 * DerivedSources.make:
936 * DerivedSources.pri:
937 * GNUmakefile.list.am:
938 * bytecode/CodeBlock.h:
940 (JSC::CodeBlock::hasExitSite):
942 * bytecode/DFGExitProfile.cpp:
943 (JSC::DFG::ExitProfile::hasExitSite):
945 * bytecode/DFGExitProfile.h:
947 (JSC::DFG::ExitProfile::hasExitSite):
948 * bytecode/ExitKind.cpp:
949 (JSC::exitKindToString):
950 * bytecode/ExitKind.h:
951 * bytecode/SpeculatedType.cpp:
952 (JSC::dumpSpeculation):
953 (JSC::speculationToAbbreviatedString):
954 (JSC::speculationFromClassInfo):
955 * bytecode/SpeculatedType.h:
957 (JSC::isStringObjectSpeculation):
958 (JSC::isStringOrStringObjectSpeculation):
960 * dfg/DFGAbstractState.cpp:
961 (JSC::DFG::AbstractState::executeEffects):
962 * dfg/DFGAbstractState.h:
963 (JSC::DFG::AbstractState::filterEdgeByUse):
964 * dfg/DFGByteCodeParser.cpp:
966 (JSC::DFG::ByteCodeParser::handleCall):
967 (JSC::DFG::ByteCodeParser::emitArgumentPhantoms):
969 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
970 * dfg/DFGCSEPhase.cpp:
971 (JSC::DFG::CSEPhase::putStructureStoreElimination):
973 (JSC::DFG::Edge::shift):
974 * dfg/DFGFixupPhase.cpp:
975 (JSC::DFG::FixupPhase::fixupNode):
976 (JSC::DFG::FixupPhase::isStringPrototypeMethodSane):
978 (JSC::DFG::FixupPhase::canOptimizeStringObjectAccess):
979 (JSC::DFG::FixupPhase::observeUseKindOnNode):
981 (JSC::DFG::Graph::hasGlobalExitSite):
983 (JSC::DFG::Graph::hasExitSite):
984 (JSC::DFG::Graph::clobbersWorld):
986 (JSC::DFG::Node::convertToToString):
988 (JSC::DFG::Node::hasStructure):
989 (JSC::DFG::Node::shouldSpeculateStringObject):
990 (JSC::DFG::Node::shouldSpeculateStringOrStringObject):
993 * dfg/DFGOperations.cpp:
994 * dfg/DFGOperations.h:
995 * dfg/DFGPredictionPropagationPhase.cpp:
996 (JSC::DFG::PredictionPropagationPhase::propagate):
997 * dfg/DFGSpeculativeJIT.cpp:
998 (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
1000 (JSC::DFG::SpeculativeJIT::compileNewStringObject):
1001 (JSC::DFG::SpeculativeJIT::speculateObject):
1002 (JSC::DFG::SpeculativeJIT::speculateObjectOrOther):
1003 (JSC::DFG::SpeculativeJIT::speculateString):
1004 (JSC::DFG::SpeculativeJIT::speculateStringObject):
1005 (JSC::DFG::SpeculativeJIT::speculateStringOrStringObject):
1006 (JSC::DFG::SpeculativeJIT::speculate):
1007 * dfg/DFGSpeculativeJIT.h:
1008 (JSC::DFG::SpeculativeJIT::callOperation):
1010 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
1012 (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure):
1013 * dfg/DFGSpeculativeJIT32_64.cpp:
1014 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1015 (JSC::DFG::SpeculativeJIT::compile):
1016 * dfg/DFGSpeculativeJIT64.cpp:
1017 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1018 (JSC::DFG::SpeculativeJIT::compile):
1019 * dfg/DFGUseKind.cpp:
1020 (WTF::printInternal):
1022 (JSC::DFG::typeFilterFor):
1023 * interpreter/CallFrame.h:
1024 (JSC::ExecState::regExpPrototypeTable):
1025 * runtime/CommonIdentifiers.h:
1026 * runtime/Intrinsic.h:
1027 * runtime/JSDestructibleObject.h:
1028 (JSDestructibleObject):
1029 (JSC::JSDestructibleObject::classInfoOffset):
1030 * runtime/JSGlobalData.cpp:
1032 (JSC::JSGlobalData::JSGlobalData):
1033 (JSC::JSGlobalData::~JSGlobalData):
1034 * runtime/JSGlobalData.h:
1036 * runtime/JSObject.cpp:
1037 * runtime/JSObject.h:
1039 * runtime/JSWrapperObject.h:
1040 (JSC::JSWrapperObject::allocationSize):
1042 (JSC::JSWrapperObject::internalValueOffset):
1043 (JSC::JSWrapperObject::internalValueCellOffset):
1044 * runtime/StringPrototype.cpp:
1046 (JSC::StringPrototype::finishCreation):
1047 (JSC::StringPrototype::create):
1048 * runtime/StringPrototype.h:
1051 2013-03-18 Filip Pizlo <fpizlo@apple.com>
1053 ObjectPrototype properties should be eagerly created rather than lazily via static tables
1054 https://bugs.webkit.org/show_bug.cgi?id=112539
1056 Reviewed by Oliver Hunt.
1058 This is the first part of https://bugs.webkit.org/show_bug.cgi?id=112233. Rolling this
1059 in first since it's the less-likely-to-be-broken part.
1062 * DerivedSources.make:
1063 * DerivedSources.pri:
1064 * GNUmakefile.list.am:
1065 * interpreter/CallFrame.h:
1066 (JSC::ExecState::objectConstructorTable):
1067 * runtime/CommonIdentifiers.h:
1068 * runtime/JSGlobalData.cpp:
1070 (JSC::JSGlobalData::JSGlobalData):
1071 (JSC::JSGlobalData::~JSGlobalData):
1072 * runtime/JSGlobalData.h:
1074 * runtime/JSObject.cpp:
1075 (JSC::JSObject::putDirectNativeFunction):
1077 * runtime/JSObject.h:
1080 * runtime/Lookup.cpp:
1081 (JSC::setUpStaticFunctionSlot):
1082 * runtime/ObjectPrototype.cpp:
1084 (JSC::ObjectPrototype::finishCreation):
1085 (JSC::ObjectPrototype::create):
1086 * runtime/ObjectPrototype.h:
1089 2013-03-16 Pratik Solanki <psolanki@apple.com>
1091 Disable High DPI Canvas on iOS
1092 https://bugs.webkit.org/show_bug.cgi?id=112511
1094 Reviewed by Joseph Pecoraro.
1096 * Configurations/FeatureDefines.xcconfig:
1098 2013-03-15 Andreas Kling <akling@apple.com>
1100 Don't also clone StructureRareData when cloning Structure.
1101 <http://webkit.org/b/111672>
1103 Reviewed by Mark Hahnenberg.
1105 We were cloning a lot of StructureRareData with only the previousID pointer set since
1106 the enumerationCache is not shared between clones.
1108 Let the Structure copy constructor decide whether it wants to clone the rare data.
1109 The decision is made by StructureRareData::needsCloning() and will currently always
1110 return false, since StructureRareData only holds on to caches at present.
1111 This may change in the future as more members are added to StructureRareData.
1113 * runtime/Structure.cpp:
1114 (JSC::Structure::Structure):
1115 (JSC::Structure::cloneRareDataFrom):
1116 * runtime/StructureInlines.h:
1117 (JSC::Structure::create):
1119 2013-03-15 Mark Hahnenberg <mhahnenberg@apple.com>
1122 https://bugs.webkit.org/show_bug.cgi?id=112458
1124 Unreviewed. Requested by Filip Pizlo.
1127 * DerivedSources.make:
1128 * DerivedSources.pri:
1129 * GNUmakefile.list.am:
1130 * dfg/DFGOperations.cpp:
1131 * interpreter/CallFrame.h:
1132 (JSC::ExecState::objectPrototypeTable):
1135 * llint/LLIntSlowPaths.cpp:
1136 (JSC::LLInt::getByVal):
1137 * runtime/CommonIdentifiers.h:
1138 * runtime/JSCell.cpp:
1142 * runtime/JSCellInlines.h:
1144 (JSC::JSCell::fastGetOwnProperty):
1145 * runtime/JSGlobalData.cpp:
1147 (JSC::JSGlobalData::JSGlobalData):
1148 (JSC::JSGlobalData::~JSGlobalData):
1149 * runtime/JSGlobalData.h:
1151 * runtime/JSObject.cpp:
1153 * runtime/JSObject.h:
1156 * runtime/Lookup.cpp:
1157 (JSC::setUpStaticFunctionSlot):
1158 * runtime/ObjectPrototype.cpp:
1160 (JSC::ObjectPrototype::finishCreation):
1161 (JSC::ObjectPrototype::getOwnPropertySlot):
1162 (JSC::ObjectPrototype::getOwnPropertyDescriptor):
1163 * runtime/ObjectPrototype.h:
1164 (JSC::ObjectPrototype::create):
1166 * runtime/PropertyMapHashTable.h:
1167 (JSC::PropertyTable::findWithString):
1168 * runtime/Structure.h:
1170 * runtime/StructureInlines.h:
1171 (JSC::Structure::get):
1173 2013-03-15 Michael Saboff <msaboff@apple.com>
1175 Cleanup of DFG and Baseline JIT debugging code
1176 https://bugs.webkit.org/show_bug.cgi?id=111871
1178 Reviewed by Geoffrey Garen.
1180 Fixed various debug related issue in baseline and DFG JITs. See below.
1182 * dfg/DFGRepatch.cpp:
1183 (JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1184 * dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
1185 pointer to scratch register length.
1186 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
1187 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
1188 * dfg/DFGSpeculativeJIT.cpp:
1189 (JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
1190 DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
1192 (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1193 * jit/JITCall32_64.cpp:
1194 (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1195 * runtime/JSGlobalData.h:
1196 (JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
1197 be on a double boundary.
1198 (JSC::ScratchBuffer::setActiveLength):
1199 (JSC::ScratchBuffer::activeLength):
1200 (JSC::ScratchBuffer::activeLengthPtr):
1202 2013-03-15 Michael Saboff <msaboff@apple.com>
1204 Add runtime check for improper register allocations in DFG
1205 https://bugs.webkit.org/show_bug.cgi?id=112380
1207 Reviewed by Geoffrey Garen.
1209 Added framework to check for register allocation within a branch source - target range. All register allocations
1210 are saved using the offset in the code stream where the allocation occurred. Later when a jump is linked, the
1211 currently saved register allocations are checked to make sure that they didn't occur in the range of code that was
1212 jumped over. This protects against the case where an allocation could have spilled register contents to free up
1213 a register and that spill only occurs on one path of a many through the code. A subsequent fill of the spilled
1214 register may load garbage. See https://bugs.webkit.org/show_bug.cgi?id=111777 for one such bug.
1215 This code is protected by the compile time check of #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION).
1216 The check is only done during the processing of SpeculativeJIT::compile(Node* node) and its callees.
1218 * assembler/AbstractMacroAssembler.h:
1219 (JSC::AbstractMacroAssembler::Jump::link): Invoke register allocation checks using source and target of link.
1220 (JSC::AbstractMacroAssembler::Jump::linkTo): Invoke register allocation checks using source and target of link.
1221 (AbstractMacroAssembler):
1222 (RegisterAllocationOffset): New helper class to store the instruction stream offset and compare against a
1224 (JSC::AbstractMacroAssembler::RegisterAllocationOffset::RegisterAllocationOffset):
1225 (JSC::AbstractMacroAssembler::RegisterAllocationOffset::check):
1226 (JSC::AbstractMacroAssembler::addRegisterAllocationAtOffset):
1227 (JSC::AbstractMacroAssembler::clearRegisterAllocationOffsets):
1228 (JSC::AbstractMacroAssembler::checkRegisterAllocationAgainstBranchRange):
1229 * dfg/DFGSpeculativeJIT.h:
1230 (JSC::DFG::SpeculativeJIT::allocate):
1231 * dfg/DFGSpeculativeJIT32_64.cpp:
1232 (JSC::DFG::SpeculativeJIT::compile):
1233 * dfg/DFGSpeculativeJIT64.cpp:
1234 (JSC::DFG::SpeculativeJIT::compile):
1236 2013-03-14 Oliver Hunt <oliver@apple.com>
1238 REGRESSION(r145000): Crash loading arstechnica.com when Safari Web Inspector is open
1239 https://bugs.webkit.org/show_bug.cgi?id=111868
1241 Reviewed by Antti Koivisto.
1243 Don't allow non-local property lookup when the debugger is enabled.
1245 * bytecompiler/BytecodeGenerator.cpp:
1246 (JSC::BytecodeGenerator::resolve):
1248 2013-03-11 Mark Hahnenberg <mhahnenberg@apple.com>
1250 Objective-C API: Objective-C functions exposed to JavaScript have the wrong type (object instead of function)
1251 https://bugs.webkit.org/show_bug.cgi?id=105892
1253 Reviewed by Geoffrey Garen.
1255 Changed ObjCCallbackFunction to subclass JSCallbackFunction which already has all of the machinery to call
1256 functions using the C API. Since ObjCCallbackFunction is now a JSCell, we changed the old implementation of
1257 ObjCCallbackFunction to be the internal implementation and keep track of all the proper data so that we
1258 don't have to put all of that in the header, which will now be included from C++ files (e.g. JSGlobalObject.cpp).
1260 * API/JSCallbackFunction.cpp: Change JSCallbackFunction to allow subclassing. Originally it was internally
1261 passing its own Structure up the chain of constructors, but we now want to be able to pass other Structures as well.
1262 (JSC::JSCallbackFunction::JSCallbackFunction):
1263 (JSC::JSCallbackFunction::create):
1264 * API/JSCallbackFunction.h:
1265 (JSCallbackFunction):
1266 * API/JSWrapperMap.mm: Changed interface to tryUnwrapBlock.
1267 (tryUnwrapObjcObject):
1268 * API/ObjCCallbackFunction.h:
1269 (ObjCCallbackFunction): Moved into the JSC namespace, just like JSCallbackFunction.
1270 (JSC::ObjCCallbackFunction::createStructure): Overridden so that the correct ClassInfo gets used since we have
1272 (JSC::ObjCCallbackFunction::impl): Getter for the internal impl.
1273 * API/ObjCCallbackFunction.mm:
1274 (JSC::ObjCCallbackFunctionImpl::ObjCCallbackFunctionImpl): What used to be ObjCCallbackFunction is now
1275 ObjCCallbackFunctionImpl. It handles the Objective-C specific parts of managing callback functions.
1276 (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl):
1277 (JSC::objCCallbackFunctionCallAsFunction): Same as the old one, but now it casts to ObjCCallbackFunction and grabs the impl
1278 rather than using JSObjectGetPrivate.
1279 (JSC::ObjCCallbackFunction::ObjCCallbackFunction): New bits to allow being part of the JSCell hierarchy.
1280 (JSC::ObjCCallbackFunction::create):
1281 (JSC::ObjCCallbackFunction::destroy):
1282 (JSC::ObjCCallbackFunctionImpl::call): Handles the actual invocation, just like it used to.
1283 (objCCallbackFunctionForInvocation):
1284 (tryUnwrapBlock): Changed to check the ClassInfo for inheritance directly, rather than going through the C API call.
1285 * API/tests/testapi.mm: Added new test to make sure that doing Function.prototype.toString.call(f) won't result in
1286 an error when f is an Objective-C method or block underneath the covers.
1287 * runtime/JSGlobalObject.cpp: Added new Structure for ObjCCallbackFunction.
1288 (JSC::JSGlobalObject::reset):
1289 (JSC::JSGlobalObject::visitChildren):
1290 * runtime/JSGlobalObject.h:
1292 (JSC::JSGlobalObject::objcCallbackFunctionStructure):
1294 2013-03-14 Mark Hahnenberg <mhahnenberg@apple.com>
1296 Objective-C API: Nested dictionaries are not converted properly in the Objective-C binding
1297 https://bugs.webkit.org/show_bug.cgi?id=112377
1299 Reviewed by Oliver Hunt.
1301 Accidental reassignment of the root task in the container conversion logic was causing the last
1302 array or dictionary processed to be returned in the case of nested containers.
1305 (containerValueToObject):
1306 * API/tests/testapi.mm:
1308 2013-03-13 Filip Pizlo <fpizlo@apple.com>
1310 JSObject fast by-string access optimizations should work even on the prototype chain, and even when the result is undefined
1311 https://bugs.webkit.org/show_bug.cgi?id=112233
1313 Reviewed by Oliver Hunt.
1315 Extended the existing fast access path for String keys to work over the entire prototype chain,
1316 not just the self access case. This will fail as soon as it sees an object that intercepts
1317 getOwnPropertySlot, so this patch also ensures that ObjectPrototype does not fall into that
1318 category. This is accomplished by making ObjectPrototype eagerly reify all of its properties.
1319 This is safe for ObjectPrototype because it's so common and we expect all of its properties to
1320 be reified for any interesting programs anyway. A new idiom for adding native functions to
1321 prototypes is introduced, which ought to work well for any other prototypes that we wish to do
1322 this conversion for.
1324 This is a >60% speed-up in the case that you frequently do by-string lookups that "miss", i.e.
1325 they don't turn up anything.
1328 * DerivedSources.make:
1329 * DerivedSources.pri:
1330 * GNUmakefile.list.am:
1331 * dfg/DFGOperations.cpp:
1332 * interpreter/CallFrame.h:
1333 (JSC::ExecState::objectConstructorTable):
1336 * llint/LLIntSlowPaths.cpp:
1337 (JSC::LLInt::getByVal):
1338 * runtime/CommonIdentifiers.h:
1339 * runtime/JSCell.cpp:
1340 (JSC::JSCell::getByStringSlow):
1344 * runtime/JSCellInlines.h:
1346 (JSC::JSCell::getByStringAndKey):
1347 (JSC::JSCell::getByString):
1348 * runtime/JSGlobalData.cpp:
1350 (JSC::JSGlobalData::JSGlobalData):
1351 (JSC::JSGlobalData::~JSGlobalData):
1352 * runtime/JSGlobalData.h:
1354 * runtime/JSObject.cpp:
1355 (JSC::JSObject::putDirectNativeFunction):
1357 * runtime/JSObject.h:
1360 * runtime/Lookup.cpp:
1361 (JSC::setUpStaticFunctionSlot):
1362 * runtime/ObjectPrototype.cpp:
1364 (JSC::ObjectPrototype::finishCreation):
1365 (JSC::ObjectPrototype::create):
1366 * runtime/ObjectPrototype.h:
1368 * runtime/PropertyMapHashTable.h:
1369 (JSC::PropertyTable::findWithString):
1370 * runtime/Structure.h:
1372 * runtime/StructureInlines.h:
1373 (JSC::Structure::get):
1376 2013-03-13 Filip Pizlo <fpizlo@apple.com>
1378 DFG bytecode parser is too aggressive about getting rid of GetLocals on captured variables
1379 https://bugs.webkit.org/show_bug.cgi?id=112287
1380 <rdar://problem/13342340>
1382 Reviewed by Oliver Hunt.
1384 * bytecode/CodeBlock.cpp:
1385 (JSC::CodeBlock::dumpBytecode):
1386 (JSC::CodeBlock::finalizeUnconditionally):
1387 * dfg/DFGByteCodeParser.cpp:
1388 (JSC::DFG::ByteCodeParser::getLocal):
1390 2013-03-13 Ryosuke Niwa <rniwa@webkit.org>
1392 Threaded HTML Parser is missing feature define flags in all but Chromium port's build files
1393 https://bugs.webkit.org/show_bug.cgi?id=112277
1395 Reviewed by Adam Barth.
1397 * Configurations/FeatureDefines.xcconfig:
1399 2013-03-13 Csaba Osztrogonác <ossy@webkit.org>
1401 LLINT C loop warning fix for GCC
1402 https://bugs.webkit.org/show_bug.cgi?id=112145
1404 Reviewed by Filip Pizlo.
1406 * llint/LowLevelInterpreter.cpp:
1407 (JSC::CLoop::execute):
1409 2013-02-13 Simon Hausmann <simon.hausmann@digia.com>
1411 Add support for convenient conversion from JSStringRef to QString
1412 https://bugs.webkit.org/show_bug.cgi?id=109694
1414 Reviewed by Allan Sandfeld Jensen.
1416 Add JSStringCopyQString helper function that allows for the convenient
1417 extraction of a QString out of a JSStringRef.
1419 * API/JSStringRefQt.cpp: Added.
1420 (JSStringCopyQString):
1421 * API/JSStringRefQt.h: Added.
1422 * API/OpaqueJSString.h:
1424 (OpaqueJSString::qString):
1425 (OpaqueJSString::OpaqueJSString):
1428 2013-03-13 Peter Gal <galpeter@inf.u-szeged.hu>
1430 Token 'not' is ignored in the offlineasm.
1431 https://bugs.webkit.org/show_bug.cgi?id=111568
1433 Reviewed by Filip Pizlo.
1435 * offlineasm/parser.rb: Build the Not AST node if the 'not' token is found.
1437 2013-03-12 Tim Horton <timothy_horton@apple.com>
1439 WTF uses macros for exports. Try to fix the Windows build. Unreviewed.
1441 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
1442 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
1444 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1446 Array.prototype.sort should at least try to be PTIME even when the array is in some bizarre mode
1447 https://bugs.webkit.org/show_bug.cgi?id=112187
1448 <rdar://problem/13393550>
1450 Reviewed by Michael Saboff and Gavin Barraclough.
1452 If we have an array-like object in crazy mode passed into Array.prototype.sort, and its length is large,
1453 then first copy all elements into a separate, compact, un-holy array and sort that. Then copy back.
1454 This means that sorting will be at worst O(n^2) in the actual number of things in the array, rather than
1455 O(n^2) in the array's length.
1457 * runtime/ArrayPrototype.cpp:
1458 (JSC::attemptFastSort):
1459 (JSC::performSlowSort):
1461 (JSC::arrayProtoFuncSort):
1463 2013-03-12 Tim Horton <timothy_horton@apple.com>
1465 Try to fix the Windows build.
1469 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
1471 2013-03-12 Geoffrey Garen <ggaren@apple.com>
1473 Try to fix the Windows build.
1477 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
1480 2013-03-11 Oliver Hunt <oliver@apple.com>
1482 Harden JSStringJoiner
1483 https://bugs.webkit.org/show_bug.cgi?id=112093
1485 Reviewed by Filip Pizlo.
1487 Harden JSStringJoiner, make it use our CheckedArithmetic
1488 class to simplify everything.
1490 * runtime/JSStringJoiner.cpp:
1491 (JSC::JSStringJoiner::build):
1492 * runtime/JSStringJoiner.h:
1494 (JSC::JSStringJoiner::JSStringJoiner):
1495 (JSC::JSStringJoiner::append):
1497 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1499 DFG generic array access cases should not be guarded by CheckStructure even of the profiling tells us that it could be
1500 https://bugs.webkit.org/show_bug.cgi?id=112183
1502 Reviewed by Oliver Hunt.
1504 Slight speed-up on string-unpack-code.
1506 * dfg/DFGFixupPhase.cpp:
1507 (JSC::DFG::FixupPhase::findAndRemoveUnnecessaryStructureCheck):
1509 (JSC::DFG::FixupPhase::checkArray):
1510 (JSC::DFG::FixupPhase::blessArrayOperation):
1512 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1514 https://bugs.webkit.org/show_bug.cgi?id=112141
1515 LLInt CLoop backend misses Double2Ints() on 32bit architectures
1517 Reviewed by Filip Pizlo.
1519 Implement Double2Ints() in CLoop backend of LLInt on 32bit architectures.
1521 * llint/LowLevelInterpreter.cpp:
1523 (JSC::LLInt::Double2Ints):
1524 * offlineasm/cloop.rb:
1526 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1528 Making more sophisticated cache flush on ARM Linux platform
1529 https://bugs.webkit.org/show_bug.cgi?id=111854
1531 Reviewed by Zoltan Herczeg.
1533 The cache flush on ARM Linux invalidates whole pages
1534 instead of just the required area.
1536 * assembler/ARMAssembler.h:
1538 (JSC::ARMAssembler::linuxPageFlush):
1539 (JSC::ARMAssembler::cacheFlush):
1540 * assembler/ARMv7Assembler.h:
1542 (JSC::ARMv7Assembler::linuxPageFlush):
1543 (JSC::ARMv7Assembler::cacheFlush):
1545 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1547 Renaming the armv7.rb LLINT backend to arm.rb
1548 https://bugs.webkit.org/show_bug.cgi?id=110565
1550 Reviewed by Zoltan Herczeg.
1552 This is the first step of a unified ARM backend for
1553 all ARM 32 bit architectures in LLInt.
1556 * GNUmakefile.list.am:
1557 * JavaScriptCore.gypi:
1558 * LLIntOffsetsExtractor.pro:
1559 * offlineasm/arm.rb: Copied from Source/JavaScriptCore/offlineasm/armv7.rb.
1560 * offlineasm/armv7.rb: Removed.
1561 * offlineasm/backends.rb:
1562 * offlineasm/risc.rb:
1564 2013-03-12 Csaba Osztrogonác <ossy@webkit.org>
1566 REGRESSION(r145482): It broke 33 jsc tests and zillion layout tests on all platform
1567 https://bugs.webkit.org/show_bug.cgi?id=112112
1569 Reviewed by Oliver Hunt.
1571 Rolling out https://trac.webkit.org/changeset/145482 to unbreak the bots.
1573 * runtime/JSStringJoiner.cpp:
1574 (JSC::JSStringJoiner::build):
1575 * runtime/JSStringJoiner.h:
1577 (JSC::JSStringJoiner::JSStringJoiner):
1578 (JSC::JSStringJoiner::append):
1580 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1582 DFG prediction propagation phase should not rerun forward propagation if double voting has already converged
1583 https://bugs.webkit.org/show_bug.cgi?id=111920
1585 Reviewed by Oliver Hunt.
1587 I don't know why we weren't exiting early after double voting if !m_changed.
1589 This change also removes backwards propagation from the voting fixpoint, since at that
1590 point short-circuiting loops is probably not particularly profitable. Profiling shows
1591 that this reduces the time spent in prediction propagation even further.
1593 This change appears to be a 1% SunSpider speed-up.
1595 * dfg/DFGPredictionPropagationPhase.cpp:
1596 (JSC::DFG::PredictionPropagationPhase::run):
1598 2013-03-11 Filip Pizlo <fpizlo@apple.com>
1600 DFG overflow check elimination is too smart for its own good
1601 https://bugs.webkit.org/show_bug.cgi?id=111832
1603 Reviewed by Oliver Hunt and Gavin Barraclough.
1605 Rolling this back in after fixing accidental misuse of JSValue. The code was doing value < someInt
1606 rather than value.asInt32() < someInt. This "worked" when isWithinPowerOfTwo wasn't templatized.
1607 It worked by always being false and always disabling the relvant optimization.
1609 This improves overflow check elimination in three ways:
1611 1) It reduces the amount of time the compiler will spend doing it.
1613 2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
1614 over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
1615 are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
1616 that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
1617 @b->children are int32's and that hence @b might produce a large enough result that doubles would
1618 start chopping low bits. The specific implication of this is that for a binary operation to not
1619 propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
1620 of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
1621 operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
1622 latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
1623 large won't even make it into the DFG currently.
1625 3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
1626 are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
1627 NodeUsedAsNumber to either @a or @b.
1629 This is neutral on V8v7 and a slight speed-up on compile time benchmarks.
1632 * GNUmakefile.list.am:
1633 * JavaScriptCore.xcodeproj/project.pbxproj:
1635 * dfg/DFGArrayMode.cpp:
1636 (JSC::DFG::ArrayMode::refine):
1637 * dfg/DFGBackwardsPropagationPhase.cpp: Added.
1639 (BackwardsPropagationPhase):
1640 (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
1641 (JSC::DFG::BackwardsPropagationPhase::run):
1642 (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
1643 (JSC::DFG::BackwardsPropagationPhase::isNotZero):
1644 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
1645 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
1646 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
1647 (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
1648 (JSC::DFG::BackwardsPropagationPhase::propagate):
1649 (JSC::DFG::performBackwardsPropagation):
1650 * dfg/DFGBackwardsPropagationPhase.h: Added.
1652 * dfg/DFGCPSRethreadingPhase.cpp:
1653 (JSC::DFG::CPSRethreadingPhase::run):
1654 (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
1655 (CPSRethreadingPhase):
1656 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1657 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1658 * dfg/DFGDriver.cpp:
1659 (JSC::DFG::compile):
1661 (JSC::DFG::Graph::dump):
1662 * dfg/DFGNodeFlags.cpp:
1663 (JSC::DFG::dumpNodeFlags):
1665 * dfg/DFGNodeFlags.h:
1667 * dfg/DFGPredictionPropagationPhase.cpp:
1668 (PredictionPropagationPhase):
1669 (JSC::DFG::PredictionPropagationPhase::propagate):
1670 * dfg/DFGUnificationPhase.cpp:
1671 (JSC::DFG::UnificationPhase::run):
1672 * dfg/DFGVariableAccessData.h:
1673 (JSC::DFG::VariableAccessData::VariableAccessData):
1674 (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
1675 (VariableAccessData):
1676 (JSC::DFG::VariableAccessData::setIsLoadedFrom):
1677 (JSC::DFG::VariableAccessData::isLoadedFrom):
1679 2013-03-11 Oliver Hunt <oliver@apple.com>
1681 Harden JSStringJoiner
1682 https://bugs.webkit.org/show_bug.cgi?id=112093
1684 Reviewed by Filip Pizlo.
1686 Harden JSStringJoiner, make it use our CheckedArithmetic
1687 class to simplify everything.
1689 * runtime/JSStringJoiner.cpp:
1690 (JSC::JSStringJoiner::build):
1691 * runtime/JSStringJoiner.h:
1693 (JSC::JSStringJoiner::JSStringJoiner):
1694 (JSC::JSStringJoiner::append):
1696 2013-03-11 Michael Saboff <msaboff@apple.com>
1698 Crash beneath operationCreateInlinedArguments running fast/js/dfg-create-inlined-arguments-in-closure-inline.html (32-bit only)
1699 https://bugs.webkit.org/show_bug.cgi?id=112067
1701 Reviewed by Geoffrey Garen.
1703 We weren't setting the tag in SetCallee. Therefore set it to CellTag.
1705 * dfg/DFGSpeculativeJIT32_64.cpp:
1706 (JSC::DFG::SpeculativeJIT::compile):
1708 2013-03-11 Oliver Hunt <oliver@apple.com>
1710 Make SegmentedVector Noncopyable
1711 https://bugs.webkit.org/show_bug.cgi?id=112059
1713 Reviewed by Geoffrey Garen.
1715 Copying a SegmentedVector is very expensive, and really shouldn't
1716 be necessary. So I've taken the one place where we currently copy
1717 and replaced it with a regular Vector, and replaced the address
1718 dependent logic with a indexing ref instead.
1720 * bytecompiler/BytecodeGenerator.cpp:
1721 (JSC::BytecodeGenerator::newLabelScope):
1722 (JSC::BytecodeGenerator::emitComplexJumpScopes):
1723 * bytecompiler/BytecodeGenerator.h:
1724 (BytecodeGenerator):
1725 * bytecompiler/LabelScope.h:
1727 (JSC::LabelScopePtr::LabelScopePtr):
1729 (JSC::LabelScopePtr::operator=):
1730 (JSC::LabelScopePtr::~LabelScopePtr):
1731 (JSC::LabelScopePtr::operator*):
1732 (JSC::LabelScopePtr::operator->):
1733 * bytecompiler/NodesCodegen.cpp:
1734 (JSC::DoWhileNode::emitBytecode):
1735 (JSC::WhileNode::emitBytecode):
1736 (JSC::ForNode::emitBytecode):
1737 (JSC::ForInNode::emitBytecode):
1738 (JSC::SwitchNode::emitBytecode):
1739 (JSC::LabelNode::emitBytecode):
1741 2013-03-10 Andreas Kling <akling@apple.com>
1743 SpeculativeJIT should use OwnPtr<SlowPathGenerator>.
1744 <http://webkit.org/b/111942>
1746 Reviewed by Anders Carlsson.
1748 There's no need to include DFGSlowPathGenerator.h from the header as long as the destructor is out-of-line,
1749 so let's use OwnPtr instead of raw pointers + deleteAllValues().
1751 * dfg/DFGSpeculativeJIT.cpp:
1752 (JSC::DFG::SpeculativeJIT::~SpeculativeJIT):
1753 (JSC::DFG::SpeculativeJIT::addSlowPathGenerator):
1754 * dfg/DFGSpeculativeJIT.h:
1757 2013-03-09 Sheriff Bot <webkit.review.bot@gmail.com>
1759 Unreviewed, rolling out r145299.
1760 http://trac.webkit.org/changeset/145299
1761 https://bugs.webkit.org/show_bug.cgi?id=111928
1763 compilation failure with recent clang
1764 (DFGBackwardsPropagationPhase.cpp:132:35: error: comparison of
1765 constant 10 with expression of type 'bool' is always false)
1766 (Requested by thorton on #webkit).
1769 * GNUmakefile.list.am:
1770 * JavaScriptCore.xcodeproj/project.pbxproj:
1772 * dfg/DFGArrayMode.cpp:
1773 (JSC::DFG::ArrayMode::refine):
1774 * dfg/DFGBackwardsPropagationPhase.cpp: Removed.
1775 * dfg/DFGBackwardsPropagationPhase.h: Removed.
1776 * dfg/DFGCPSRethreadingPhase.cpp:
1777 (JSC::DFG::CPSRethreadingPhase::run):
1778 (CPSRethreadingPhase):
1779 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1780 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1781 * dfg/DFGDriver.cpp:
1782 (JSC::DFG::compile):
1784 (JSC::DFG::Graph::dump):
1785 * dfg/DFGNodeFlags.cpp:
1786 (JSC::DFG::nodeFlagsAsString):
1788 * dfg/DFGNodeFlags.h:
1790 * dfg/DFGPredictionPropagationPhase.cpp:
1791 (JSC::DFG::PredictionPropagationPhase::isNotNegZero):
1792 (PredictionPropagationPhase):
1793 (JSC::DFG::PredictionPropagationPhase::isNotZero):
1794 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoForConstant):
1795 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoNonRecursive):
1796 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwo):
1797 (JSC::DFG::PredictionPropagationPhase::propagate):
1798 (JSC::DFG::PredictionPropagationPhase::mergeDefaultFlags):
1799 * dfg/DFGUnificationPhase.cpp:
1800 (JSC::DFG::UnificationPhase::run):
1801 * dfg/DFGVariableAccessData.h:
1802 (JSC::DFG::VariableAccessData::VariableAccessData):
1803 (VariableAccessData):
1805 2013-03-08 Filip Pizlo <fpizlo@apple.com>
1807 DFG overflow check elimination is too smart for its own good
1808 https://bugs.webkit.org/show_bug.cgi?id=111832
1810 Reviewed by Oliver Hunt and Gavin Barraclough.
1812 This improves overflow check elimination in three ways:
1814 1) It reduces the amount of time the compiler will spend doing it.
1816 2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
1817 over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
1818 are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
1819 that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
1820 @b->children are int32's and that hence @b might produce a large enough result that doubles would
1821 start chopping low bits. The specific implication of this is that for a binary operation to not
1822 propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
1823 of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
1824 operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
1825 latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
1826 large won't even make it into the DFG currently.
1828 3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
1829 are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
1830 NodeUsedAsNumber to either @a or @b.
1832 This is neutral on V8v7 and a slight speed-up on compile time benchmarks.
1835 * GNUmakefile.list.am:
1836 * JavaScriptCore.xcodeproj/project.pbxproj:
1838 * dfg/DFGArrayMode.cpp:
1839 (JSC::DFG::ArrayMode::refine):
1840 * dfg/DFGBackwardsPropagationPhase.cpp: Added.
1842 (BackwardsPropagationPhase):
1843 (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
1844 (JSC::DFG::BackwardsPropagationPhase::run):
1845 (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
1846 (JSC::DFG::BackwardsPropagationPhase::isNotZero):
1847 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
1848 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
1849 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
1850 (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
1851 (JSC::DFG::BackwardsPropagationPhase::propagate):
1852 (JSC::DFG::performBackwardsPropagation):
1853 * dfg/DFGBackwardsPropagationPhase.h: Added.
1855 * dfg/DFGCPSRethreadingPhase.cpp:
1856 (JSC::DFG::CPSRethreadingPhase::run):
1857 (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
1858 (CPSRethreadingPhase):
1859 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1860 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1861 * dfg/DFGDriver.cpp:
1862 (JSC::DFG::compile):
1864 (JSC::DFG::Graph::dump):
1865 * dfg/DFGNodeFlags.cpp:
1866 (JSC::DFG::dumpNodeFlags):
1868 * dfg/DFGNodeFlags.h:
1870 * dfg/DFGPredictionPropagationPhase.cpp:
1871 (PredictionPropagationPhase):
1872 (JSC::DFG::PredictionPropagationPhase::propagate):
1873 * dfg/DFGUnificationPhase.cpp:
1874 (JSC::DFG::UnificationPhase::run):
1875 * dfg/DFGVariableAccessData.h:
1876 (JSC::DFG::VariableAccessData::VariableAccessData):
1877 (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
1878 (VariableAccessData):
1879 (JSC::DFG::VariableAccessData::setIsLoadedFrom):
1880 (JSC::DFG::VariableAccessData::isLoadedFrom):
1882 2013-03-08 Roger Fong <roger_fong@apple.com>
1886 * JavaScriptCore.vcxproj/JavaScriptCore.make:
1888 2013-03-08 Gabor Rapcsanyi <rgabor@webkit.org>
1890 Cache flush problem on ARMv7 JSC
1891 https://bugs.webkit.org/show_bug.cgi?id=111441
1893 Reviewed by Zoltan Herczeg.
1895 Not proper cache flush causing random crashes on ARMv7 Linux with V8 tests.
1896 The problem is similar to https://bugs.webkit.org/show_bug.cgi?id=77712.
1897 Change the cache fulsh mechanism similar to ARM traditinal and revert the
1900 * assembler/ARMv7Assembler.h:
1901 (JSC::ARMv7Assembler::cacheFlush):
1903 2013-03-07 Geoffrey Garen <ggaren@apple.com>
1905 REGRESSION (r143759): 40% JSBench regression, 20% Octane/closure regression, 40% Octane/jquery regression, 2% Octane regression
1906 https://bugs.webkit.org/show_bug.cgi?id=111797
1908 Reviewed by Oliver Hunt.
1910 The bot's testing configuration stresses the cache's starting guess
1913 This patch removes any starting guess, and just uses wall clock time
1914 to discover the initial working set size of an app, in code size.
1916 * runtime/CodeCache.cpp:
1917 (JSC::CodeCacheMap::pruneSlowCase): Update our timer as we go.
1919 Also fixed a bug where pruning from 0 to 0 would hang -- that case is
1920 a possibility now that we start with a capacity of 0.
1922 * runtime/CodeCache.h:
1924 (JSC::CodeCacheMap::CodeCacheMap):
1925 (JSC::CodeCacheMap::add):
1926 (JSC::CodeCacheMap::prune): Don't prune if we're in the middle of
1927 discovering the working set size of an app, in code size.
1929 2013-03-07 Michael Saboff <msaboff@apple.com>
1931 Crash when updating predictions below JSC::arrayProtoFuncForEach on tuaw.com article
1932 https://bugs.webkit.org/show_bug.cgi?id=111777
1934 Reviewed by Filip Pizlo.
1936 Moved register allocations to be above any generated control flow so that any
1937 resulting spill would be visible to all subsequently generated code.
1939 * dfg/DFGSpeculativeJIT32_64.cpp:
1940 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
1941 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
1942 (JSC::DFG::SpeculativeJIT::compile):
1943 * dfg/DFGSpeculativeJIT64.cpp:
1944 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
1945 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
1946 (JSC::DFG::SpeculativeJIT::compile):
1948 2013-03-07 Filip Pizlo <fpizlo@apple.com>
1950 DFG should not get corrupted IR in the case of code that is dead, unreachable, and contains a chain of nodes that use each other in an untyped way
1951 https://bugs.webkit.org/show_bug.cgi?id=111783
1953 Reviewed by Mark Hahnenberg.
1955 Unreachable code is not touched by CFA and so thinks that even untyped uses are checked.
1956 But dead untyped uses don't need checks and hence don't need to be Phantom'd. The DCE knew
1957 this in findTypeCheckRoot() but not in eliminateIrrelevantPhantomChildren(), leading to a
1958 Phantom node that had another Phantom node as one of its kids.
1960 * dfg/DFGDCEPhase.cpp:
1961 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
1963 2013-03-07 Filip Pizlo <fpizlo@apple.com>
1965 The DFG fixpoint is not strictly profitable, and should be straight-lined
1966 https://bugs.webkit.org/show_bug.cgi?id=111764
1968 Reviewed by Oliver Hunt and Geoffrey Garen.
1970 The DFG previously ran optimizations to fixpoint because there exists a circular dependency:
1972 CSE depends on CFG simplification: CFG simplification merges blocks, and CSE is block-local.
1974 CFG simplification depends on CFA and constant folding: constant folding reveals branches on
1977 CFA depends on CSE: CSE reveals must-alias relationships by proving that two operations
1978 always produce identical values.
1980 Arguments simplification also depends on CSE, but it ought not depend on anything else.
1982 Hence we get a cycle like: CFA -> folding -> CFG -> CSE -> CFA.
1984 Note that before we had sparse conditional CFA, we also had CFA depending on CFG. This ought
1985 not be the case anymore: CFG simplification should not by itself lead to better CFA results.
1987 My guess is that the weakest link in this cycle is CFG -> CSE. CSE cuts both ways: if you
1988 CSE too much then you increase register pressure. Hence it's not clear that you always want
1989 to CSE after simplifying control flow. This leads to an order of optimization as follows:
1991 CSE -> arguments -> CFA -> folding -> CFG
1993 This is a 2.5% speed-up on SunSpider, a 4% speed-up on V8Spider, a possible 0.3% slow-down
1994 on V8v7, nothing on Kraken, and 1.2% speed-up in the JSRegress geomean. I'll take a 2.5%
1995 speed-up over a 0.3% V8v7 speed-up.
1997 * dfg/DFGDriver.cpp:
1998 (JSC::DFG::compile):
2000 2013-03-07 Roger Fong <roger_fong@apple.com>
2002 Build fix for AppleWin VS2010.
2004 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2005 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
2007 2013-03-05 Mark Hahnenberg <mhahnenberg@apple.com>
2009 Objective-C API: Need a good way to reference event handlers without causing cycles
2010 https://bugs.webkit.org/show_bug.cgi?id=111088
2012 Reviewed by Geoffrey Garen.
2014 JSManagedValue is like a special kind of weak value. When you create a JSManagedValue, you can
2015 supply an Objective-C object as its "owner". As long as the Objective-C owner object remains
2016 alive and its wrapper remains accessible to the JSC garbage collector (e.g. by being marked by
2017 the global object), the reference to the JavaScript value is strong. As soon as the Objective-C
2018 owner is deallocated or its wrapper becomes inaccessible to the garbage collector, the reference
2021 If you do not supply an owner or you use the weakValueWithValue: convenience class method, the
2022 returned JSManagedValue behaves as a normal weak reference.
2024 This new class allows clients to maintain references to JavaScript values in the Objective-C
2025 heap without creating reference cycles/leaking memory.
2027 * API/JSAPIWrapperObject.cpp: Added.
2029 (JSC::::createStructure):
2030 (JSC::JSAPIWrapperObject::JSAPIWrapperObject): This is a special JSObject for the Objective-C API that knows
2031 for the purposes of garbage collection/marking that it wraps an opaque Objective-C object.
2032 (JSC::JSAPIWrapperObject::visitChildren): We add the pointer to the wrapped Objective-C object to the set of
2033 opaque roots so that the weak handle owner for JSManagedValues can find it later.
2034 * API/JSAPIWrapperObject.h: Added.
2036 (JSAPIWrapperObject):
2037 (JSC::JSAPIWrapperObject::wrappedObject):
2038 (JSC::JSAPIWrapperObject::setWrappedObject):
2040 (JSSynchronousGarbageCollect):
2041 * API/JSBasePrivate.h:
2042 * API/JSCallbackObject.cpp:
2044 * API/JSCallbackObject.h:
2045 (JSC::JSCallbackObject::destroy): Moved this to the header so that we don't get link errors with JSAPIWrapperObject.
2047 (-[JSContext initWithVirtualMachine:]): We weren't adding manually allocated/initialized JSVirtualMachine objects to
2048 the global cache of virtual machines. The init methods handle this now rather than contextWithGlobalContextRef, since
2049 not everyone is guaranteed to use the latter.
2050 (-[JSContext initWithGlobalContextRef:]):
2051 (+[JSContext contextWithGlobalContextRef:]):
2052 * API/JSManagedValue.h: Added.
2053 * API/JSManagedValue.mm: Added.
2054 (JSManagedValueHandleOwner):
2055 (managedValueHandleOwner):
2056 (+[JSManagedValue weakValueWithValue:]):
2057 (+[JSManagedValue managedValueWithValue:owner:]):
2058 (-[JSManagedValue init]): We explicitly call the ARC entrypoints to initialize/get the weak owner field since we don't
2059 use ARC when building our framework.
2060 (-[JSManagedValue initWithValue:]):
2061 (-[JSManagedValue initWithValue:owner:]):
2062 (-[JSManagedValue dealloc]):
2063 (-[JSManagedValue value]):
2064 (-[JSManagedValue weakOwner]):
2065 (JSManagedValueHandleOwner::isReachableFromOpaqueRoots): If the Objective-C owner is still alive (i.e. loading the weak field
2066 returns non-nil) and that value was added to the set of opaque roots by the wrapper for that Objective-C owner, then the the
2067 JSObject to which the JSManagedObject refers is still alive.
2068 * API/JSObjectRef.cpp: We have to add explicit checks for the JSAPIWrapperObject, just like the other types of JSCallbackObjects.
2069 (JSObjectGetPrivate):
2070 (JSObjectSetPrivate):
2071 (JSObjectGetPrivateProperty):
2072 (JSObjectSetPrivateProperty):
2073 (JSObjectDeletePrivateProperty):
2075 (objectToValueWithoutCopy):
2076 * API/JSValueRef.cpp:
2077 (JSValueIsObjectOfClass):
2078 * API/JSVirtualMachine.mm:
2079 (-[JSVirtualMachine initWithContextGroupRef:]):
2080 (+[JSVirtualMachine virtualMachineWithContextGroupRef:]):
2081 * API/JSWrapperMap.mm:
2083 (makeWrapper): This is our own internal version of JSObjectMake which creates JSAPIWrapperObjects, the Obj-C API
2084 version of JSCallbackObjects.
2085 (createObjectWithCustomBrand):
2086 (-[JSObjCClassInfo wrapperForObject:]):
2087 (tryUnwrapObjcObject):
2088 * API/JavaScriptCore.h:
2089 * API/tests/testapi.mm: Added new tests for the strong and weak uses of JSManagedValue in the context of an
2090 onclick handler for an Objective-C object inserted into a JSContext.
2091 (-[TextXYZ setWeakOnclick:]):
2092 (-[TextXYZ setOnclick:]):
2093 (-[TextXYZ weakOnclick]):
2094 (-[TextXYZ onclick]):
2096 * CMakeLists.txt: Various build system additions.
2097 * GNUmakefile.list.am:
2098 * JavaScriptCore.gypi:
2099 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2100 * JavaScriptCore.xcodeproj/project.pbxproj:
2101 * runtime/JSGlobalObject.cpp: Added the new canonical Structure for the JSAPIWrapperObject class.
2102 (JSC::JSGlobalObject::reset):
2104 (JSC::JSGlobalObject::visitChildren):
2105 * runtime/JSGlobalObject.h:
2107 (JSC::JSGlobalObject::objcWrapperObjectStructure):
2109 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2111 ConvertThis should be turned into Identity based on predictions in Fixup, rather than based on proofs in ConstantFolding
2112 https://bugs.webkit.org/show_bug.cgi?id=111674
2114 Reviewed by Oliver Hunt.
2116 This gets rid of the speculated forms of ConvertThis in the backend, and has Fixup
2117 convert them to either Identity(Object:@child) if the child is predicted object, or
2118 Phantom(Other:@child) ; WeakJSConstant(global this object) if it's predicted Other.
2120 The goal of this is to ensure that the optimization fixpoint doesn't create
2121 Identity's, since doing so requires a rerun of CSE. So far this isn't a speed-up
2122 but I'm hoping this will be a step towards reducing the need to rerun the fixpoint
2123 so as to ultimately reduce compile times.
2125 * dfg/DFGAbstractState.cpp:
2126 (JSC::DFG::AbstractState::executeEffects):
2127 * dfg/DFGAssemblyHelpers.h:
2129 * dfg/DFGConstantFoldingPhase.cpp:
2130 (JSC::DFG::ConstantFoldingPhase::foldConstants):
2131 * dfg/DFGFixupPhase.cpp:
2132 (JSC::DFG::FixupPhase::fixupNode):
2134 (JSC::DFG::FixupPhase::observeUseKindOnNode):
2135 (JSC::DFG::FixupPhase::setUseKindAndUnboxIfProfitable):
2137 (JSC::DFG::Graph::globalThisObjectFor):
2141 (JSC::DFG::Node::convertToIdentity):
2142 (JSC::DFG::Node::convertToWeakConstant):
2143 * dfg/DFGSpeculativeJIT32_64.cpp:
2144 (JSC::DFG::SpeculativeJIT::compile):
2145 * dfg/DFGSpeculativeJIT64.cpp:
2146 (JSC::DFG::SpeculativeJIT::compile):
2148 2013-03-07 Peter Gal <galpeter@inf.u-szeged.hu>
2150 Children method in LLINT AST Not class should return [@child]
2151 https://bugs.webkit.org/show_bug.cgi?id=90740
2153 Reviewed by Filip Pizlo.
2155 * offlineasm/ast.rb: Fixed the return value of the children method in the Not AST class.
2157 2013-03-05 Oliver Hunt <oliver@apple.com>
2159 Bring back eager resolution of function scoped variables
2160 https://bugs.webkit.org/show_bug.cgi?id=111497
2162 Reviewed by Geoffrey Garen.
2164 This reverts the get/put_scoped_var part of the great non-local
2165 variable resolution refactoring. This still leaves all the lazy
2166 variable resolution logic as it's necessary for global property
2167 resolution, and i don't want to make the patch bigger than it
2170 * bytecode/CodeBlock.cpp:
2171 (JSC::CodeBlock::dumpBytecode):
2172 (JSC::CodeBlock::CodeBlock):
2173 * bytecode/CodeBlock.h:
2175 * bytecode/Opcode.h:
2177 (JSC::padOpcodeName):
2178 * bytecode/UnlinkedCodeBlock.cpp:
2179 (JSC::generateFunctionCodeBlock):
2180 (JSC::UnlinkedFunctionExecutable::codeBlockFor):
2181 (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
2182 * bytecode/UnlinkedCodeBlock.h:
2184 (UnlinkedFunctionExecutable):
2185 (UnlinkedCodeBlock):
2186 (JSC::UnlinkedCodeBlock::usesGlobalObject):
2187 (JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
2188 (JSC::UnlinkedCodeBlock::globalObjectRegister):
2189 * bytecompiler/BytecodeGenerator.cpp:
2190 (JSC::ResolveResult::checkValidity):
2191 (JSC::BytecodeGenerator::BytecodeGenerator):
2192 (JSC::BytecodeGenerator::emitLoadGlobalObject):
2194 (JSC::BytecodeGenerator::resolve):
2195 (JSC::BytecodeGenerator::resolveConstDecl):
2196 (JSC::BytecodeGenerator::emitResolve):
2197 (JSC::BytecodeGenerator::emitResolveBase):
2198 (JSC::BytecodeGenerator::emitResolveBaseForPut):
2199 (JSC::BytecodeGenerator::emitResolveWithBaseForPut):
2200 (JSC::BytecodeGenerator::emitResolveWithThis):
2201 (JSC::BytecodeGenerator::emitGetStaticVar):
2202 (JSC::BytecodeGenerator::emitPutStaticVar):
2203 * bytecompiler/BytecodeGenerator.h:
2204 (JSC::ResolveResult::lexicalResolve):
2205 (JSC::ResolveResult::isStatic):
2206 (JSC::ResolveResult::depth):
2207 (JSC::ResolveResult::index):
2209 (JSC::ResolveResult::ResolveResult):
2210 (BytecodeGenerator):
2211 * bytecompiler/NodesCodegen.cpp:
2212 (JSC::ResolveNode::isPure):
2213 (JSC::FunctionCallResolveNode::emitBytecode):
2214 (JSC::PostfixNode::emitResolve):
2215 (JSC::TypeOfResolveNode::emitBytecode):
2216 (JSC::PrefixNode::emitResolve):
2217 (JSC::ReadModifyResolveNode::emitBytecode):
2218 (JSC::AssignResolveNode::emitBytecode):
2219 (JSC::ConstDeclNode::emitCodeSingle):
2220 * dfg/DFGByteCodeParser.cpp:
2221 (JSC::DFG::ByteCodeParser::parseBlock):
2222 * dfg/DFGCapabilities.cpp:
2223 (JSC::DFG::debugFail):
2224 * dfg/DFGCapabilities.h:
2225 (JSC::DFG::canCompileOpcode):
2226 (JSC::DFG::canInlineOpcode):
2228 (JSC::JIT::privateCompileMainPass):
2231 * jit/JITPropertyAccess.cpp:
2232 (JSC::JIT::emit_op_get_scoped_var):
2234 (JSC::JIT::emit_op_put_scoped_var):
2235 * jit/JITPropertyAccess32_64.cpp:
2236 (JSC::JIT::emit_op_get_scoped_var):
2238 (JSC::JIT::emit_op_put_scoped_var):
2239 * llint/LowLevelInterpreter32_64.asm:
2240 * llint/LowLevelInterpreter64.asm:
2241 * runtime/CodeCache.cpp:
2242 (JSC::CodeCache::getCodeBlock):
2243 (JSC::CodeCache::getProgramCodeBlock):
2244 (JSC::CodeCache::getEvalCodeBlock):
2245 * runtime/CodeCache.h:
2248 * runtime/Executable.cpp:
2249 (JSC::EvalExecutable::compileInternal):
2250 (JSC::FunctionExecutable::produceCodeBlockFor):
2251 * runtime/JSGlobalObject.cpp:
2252 (JSC::JSGlobalObject::createEvalCodeBlock):
2253 * runtime/JSGlobalObject.h:
2255 * runtime/Options.cpp:
2256 (JSC::Options::initialize):
2258 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2260 Unreviewed, roll out http://trac.webkit.org/changeset/144989
2262 I think we want the assertion that I removed.
2264 * dfg/DFGAbstractState.cpp:
2265 (JSC::DFG::AbstractState::merge):
2266 (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
2267 * dfg/DFGAbstractState.h:
2270 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2272 DFG::AbstractState::merge() is still more complicated than it needs to be
2273 https://bugs.webkit.org/show_bug.cgi?id=111619
2275 Reviewed by Mark Hahnenberg.
2277 This method is the one place where we still do some minimal amount of liveness pruning, but the style with
2278 which it is written is awkward, and it makes an assertion about variablesAtTail that will be invalidated
2279 by https://bugs.webkit.org/show_bug.cgi?id=111539.
2281 * dfg/DFGAbstractState.cpp:
2282 (JSC::DFG::AbstractState::merge):
2283 (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
2284 * dfg/DFGAbstractState.h:
2287 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2289 DFG should not run full CSE after the optimization fixpoint, since it really just wants store elimination
2290 https://bugs.webkit.org/show_bug.cgi?id=111536
2292 Reviewed by Oliver Hunt and Mark Hahnenberg.
2294 The fixpoint will do aggressive load elimination and pure CSE. There's no need to do it after the fixpoint.
2295 On the other hand, the fixpoint does not profit from doing store elimination (except for SetLocal/Flush).
2296 Previously we had CSE do both, and had it avoid doing some store elimination during the fixpoint by querying
2297 the fixpoint state. This changes CSE to be templated on mode - either NormalCSE or StoreElimination - so
2298 that we explicitly put it into one of those modes depending on where we call it from. The goal is to reduce
2299 time spent doing load elimination after the fixpoint, since that is just wasted cycles.
2301 * dfg/DFGCSEPhase.cpp:
2302 (JSC::DFG::CSEPhase::CSEPhase):
2303 (JSC::DFG::CSEPhase::run):
2304 (JSC::DFG::CSEPhase::performNodeCSE):
2305 (JSC::DFG::CSEPhase::performBlockCSE):
2306 (JSC::DFG::performCSE):
2308 (JSC::DFG::performStoreElimination):
2309 * dfg/DFGCSEPhase.h:
2311 * dfg/DFGDriver.cpp:
2312 (JSC::DFG::compile):
2314 2013-03-06 Andreas Kling <akling@apple.com>
2316 Pack Structure members better.
2317 <http://webkit.org/b/111593>
2318 <rdar://problem/13359200>
2320 Reviewed by Mark Hahnenberg.
2322 Shrink Structure by 8 bytes (now at 104 bytes) on 64-bit by packing the members better.
2324 * runtime/Structure.cpp:
2325 (JSC::Structure::Structure):
2326 * runtime/Structure.h:
2329 2013-03-06 Andreas Kling <akling@apple.com>
2331 Unreviewed, fix Windows build after r144910.
2333 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2335 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2337 DFG should not check if nodes are shouldGenerate prior to DCE
2338 https://bugs.webkit.org/show_bug.cgi?id=111520
2340 Reviewed by Geoffrey Garen.
2342 All nodes are live before DCE. We don't need to check that they aren't, because they
2345 * dfg/DFGArgumentsSimplificationPhase.cpp:
2346 (JSC::DFG::ArgumentsSimplificationPhase::run):
2347 * dfg/DFGCFAPhase.cpp:
2348 (JSC::DFG::CFAPhase::performBlockCFA):
2349 * dfg/DFGCFGSimplificationPhase.cpp:
2350 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
2351 * dfg/DFGCSEPhase.cpp:
2352 (JSC::DFG::CSEPhase::pureCSE):
2353 (JSC::DFG::CSEPhase::int32ToDoubleCSE):
2354 (JSC::DFG::CSEPhase::constantCSE):
2355 (JSC::DFG::CSEPhase::weakConstantCSE):
2356 (JSC::DFG::CSEPhase::getCalleeLoadElimination):
2357 (JSC::DFG::CSEPhase::getArrayLengthElimination):
2358 (JSC::DFG::CSEPhase::globalVarLoadElimination):
2359 (JSC::DFG::CSEPhase::scopedVarLoadElimination):
2360 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
2361 (JSC::DFG::CSEPhase::globalVarStoreElimination):
2362 (JSC::DFG::CSEPhase::scopedVarStoreElimination):
2363 (JSC::DFG::CSEPhase::getByValLoadElimination):
2364 (JSC::DFG::CSEPhase::checkStructureElimination):
2365 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
2366 (JSC::DFG::CSEPhase::putStructureStoreElimination):
2367 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
2368 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
2369 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
2370 (JSC::DFG::CSEPhase::checkArrayElimination):
2371 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
2372 (JSC::DFG::CSEPhase::getMyScopeLoadElimination):
2373 (JSC::DFG::CSEPhase::getLocalLoadElimination):
2374 (JSC::DFG::CSEPhase::setLocalStoreElimination):
2375 (JSC::DFG::CSEPhase::performNodeCSE):
2376 * dfg/DFGFixupPhase.cpp:
2377 (JSC::DFG::FixupPhase::fixupNode):
2378 (JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
2379 * dfg/DFGPredictionPropagationPhase.cpp:
2380 (JSC::DFG::PredictionPropagationPhase::propagate):
2381 * dfg/DFGStructureCheckHoistingPhase.cpp:
2382 (JSC::DFG::StructureCheckHoistingPhase::run):
2384 2013-03-06 Csaba Osztrogonác <ossy@webkit.org>
2386 Fix unused parameter warnings in ARM assembler
2387 https://bugs.webkit.org/show_bug.cgi?id=111433
2389 Reviewed by Kentaro Hara.
2391 * assembler/ARMAssembler.h: Remove unreachable revertJump() after r143346.
2392 * assembler/MacroAssemblerARM.h:
2393 (JSC::MacroAssemblerARM::moveIntsToDouble): Remove unused scratch parameter instead of UNUSED_PARAM.
2394 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): Remove unused fpTemp parameter.
2395 (JSC::MacroAssemblerARM::revertJumpReplacementToPatchableBranchPtrWithPatch): Remove unused parameters.
2397 2013-03-06 Andreas Kling <akling@apple.com>
2399 Unused Structure property tables waste 14MB on Membuster.
2400 <http://webkit.org/b/110854>
2401 <rdar://problem/13292104>
2403 Reviewed by Geoffrey Garen.
2405 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
2406 14 MB progression on Membuster3.
2408 This time it should stick; I've been through all the tests with COLLECT_ON_EVERY_ALLOCATION.
2409 The issue with the last version was that Structure::m_offset could be used uninitialized
2410 when re-materializing a previously GC'd property table, causing some sanity checks to fail.
2413 * GNUmakefile.list.am:
2414 * JavaScriptCore.gypi:
2415 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2416 * JavaScriptCore.xcodeproj/project.pbxproj:
2419 Added PropertyTable.cpp.
2421 * runtime/PropertyTable.cpp: Added.
2422 (JSC::PropertyTable::create):
2423 (JSC::PropertyTable::clone):
2424 (JSC::PropertyTable::PropertyTable):
2425 (JSC::PropertyTable::destroy):
2426 (JSC::PropertyTable::~PropertyTable):
2427 (JSC::PropertyTable::visitChildren):
2429 Moved marking of property table values here from Structure::visitChildren().
2431 * runtime/WriteBarrier.h:
2432 (JSC::WriteBarrierBase::get):
2434 Move m_cell to a local before using it multiple times. This avoids a multiple-access race when
2435 Structure::checkOffsetConsistency() is used in assertions on the main thread while a marking thread
2436 zaps the property table.
2438 * runtime/Structure.h:
2439 (JSC::Structure::materializePropertyMapIfNecessary):
2440 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2441 * runtime/StructureInlines.h:
2442 (JSC::Structure::propertyTable):
2444 Added a getter for the Structure's PropertyTable that ASSERTs GC currently isn't active.
2445 Because GC can zap an unpinned property table at any time, it's not entirely safe to access it.
2446 Renamed the variable itself to m_propertyTableUnsafe to force call sites into explaining themselves.
2448 (JSC::Structure::putWillGrowOutOfLineStorage):
2449 (JSC::Structure::checkOffsetConsistency):
2451 Moved these out of Structure.h to break header dependency cycle between Structure/PropertyTable.
2453 * runtime/Structure.cpp:
2454 (JSC::Structure::visitChildren):
2456 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
2458 (JSC::Structure::takePropertyTableOrCloneIfPinned):
2460 Added for setting up the property table in a new transition, this code is now shared between
2461 addPropertyTransition() and nonPropertyTransition().
2463 * runtime/JSGlobalData.h:
2464 * runtime/JSGlobalData.cpp:
2465 (JSC::JSGlobalData::JSGlobalData):
2467 Add a global propertyTableStructure.
2469 * runtime/PropertyMapHashTable.h:
2471 (JSC::PropertyTable::createStructure):
2472 (JSC::PropertyTable::copy):
2474 Make PropertyTable a GC object.
2476 * runtime/Structure.cpp:
2477 (JSC::Structure::dumpStatistics):
2478 (JSC::Structure::materializePropertyMap):
2479 (JSC::Structure::despecifyDictionaryFunction):
2480 (JSC::Structure::addPropertyTransition):
2481 (JSC::Structure::changePrototypeTransition):
2482 (JSC::Structure::despecifyFunctionTransition):
2483 (JSC::Structure::attributeChangeTransition):
2484 (JSC::Structure::toDictionaryTransition):
2485 (JSC::Structure::sealTransition):
2486 (JSC::Structure::freezeTransition):
2487 (JSC::Structure::preventExtensionsTransition):
2488 (JSC::Structure::nonPropertyTransition):
2489 (JSC::Structure::isSealed):
2490 (JSC::Structure::isFrozen):
2491 (JSC::Structure::flattenDictionaryStructure):
2492 (JSC::Structure::pin):
2493 (JSC::Structure::copyPropertyTable):
2494 (JSC::Structure::copyPropertyTableForPinning):
2495 (JSC::Structure::get):
2496 (JSC::Structure::despecifyFunction):
2497 (JSC::Structure::despecifyAllFunctions):
2498 (JSC::Structure::putSpecificValue):
2499 (JSC::Structure::remove):
2500 (JSC::Structure::createPropertyMap):
2501 (JSC::Structure::getPropertyNamesFromStructure):
2502 (JSC::Structure::checkConsistency):
2504 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2506 Get rid of the invert argument to SpeculativeJIT::jumpSlowForUnwantedArrayMode
2507 https://bugs.webkit.org/show_bug.cgi?id=105624
2509 Reviewed by Oliver Hunt.
2511 All callers pass invert = false, which is the default value of the argument. So, get
2512 rid of the argument and fold away all code that checks it.
2514 * dfg/DFGSpeculativeJIT.cpp:
2515 (JSC::DFG::SpeculativeJIT::jumpSlowForUnwantedArrayMode):
2516 * dfg/DFGSpeculativeJIT.h:
2519 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2521 Unreviewed, fix an incorrect comment. The comment was a holdover from a work-in-progress version of this code.
2523 * dfg/DFGDCEPhase.cpp:
2524 (JSC::DFG::DCEPhase::run):
2526 2013-03-04 Filip Pizlo <fpizlo@apple.com>
2528 DFG DCE might eliminate checks unsoundly
2529 https://bugs.webkit.org/show_bug.cgi?id=109389
2531 Reviewed by Oliver Hunt.
2533 This gets rid of all eager reference counting, and does all dead code elimination
2534 in one phase - the DCEPhase. This phase also sets up the node reference counts,
2535 which are then used not just for DCE but also register allocation and stack slot
2538 Doing this required a number of surgical changes in places that previously relied
2539 on always having liveness information. For example, the structure check hoisting
2540 phase must now consult whether a VariableAccessData is profitable for unboxing to
2541 make sure that it doesn't try to do hoisting on set SetLocals. The arguments
2542 simplification phase employs its own light-weight liveness analysis. Both phases
2543 previously just used reference counts.
2545 The largest change is that now, dead nodes get turned into Phantoms. Those
2546 Phantoms will retain those child edges that are not proven. This ensures that any
2547 type checks performed by a dead node remain even after the node is killed. On the
2548 other hand, this Phantom conversion means that we need special handling for
2549 SetLocal. I decided to make the four forms of SetLocal explicit:
2551 MovHint(@a, rK): Just indicates that node @a contains the value that would have
2552 now been placed into virtual register rK. Does not actually cause @a to be
2553 stored into rK. This would have previously been a dead SetLocal with @a
2554 being live. MovHints are always dead.
2556 ZombieHint(rK): Indicates that at this point, register rK will contain a dead
2557 value and OSR should put Undefined into it. This would have previously been
2558 a dead SetLocal with @a being dead also. ZombieHints are always dead.
2560 MovHintAndCheck(@a, rK): Identical to MovHint except @a is also type checked,
2561 according to whatever UseKind the edge to @a has. The type check is always a
2562 forward exit. MovHintAndChecks are always live, since they are
2563 NodeMustGenerate. Previously this would have been a dead SetLocal with a
2564 live @a, and the check would have disappeared. This is one of the bugs that
2567 SetLocal(@a, rK): This still does exactly what it does now, if the SetLocal is
2570 Basically this patch makes it so that dead SetLocals eventually decay to MovHint,
2571 ZombieHint, or MovHintAndCheck depending on the situation. If the child @a is
2572 also dead, then you get a ZombieHint. If the child @a is live but the SetLocal
2573 has a type check and @a's type hasn't been proven to have that type then you get
2574 a MovHintAndCheck. Otherwise you get a MovHint.
2576 This is performance neutral.
2579 * GNUmakefile.list.am:
2580 * JavaScriptCore.xcodeproj/project.pbxproj:
2582 * dfg/DFGAbstractState.cpp:
2583 (JSC::DFG::AbstractState::executeEffects):
2584 (JSC::DFG::AbstractState::mergeStateAtTail):
2585 * dfg/DFGArgumentsSimplificationPhase.cpp:
2586 (JSC::DFG::ArgumentsSimplificationPhase::run):
2587 (ArgumentsSimplificationPhase):
2588 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
2589 * dfg/DFGBasicBlock.h:
2591 * dfg/DFGBasicBlockInlines.h:
2593 * dfg/DFGByteCodeParser.cpp:
2594 (JSC::DFG::ByteCodeParser::addToGraph):
2595 (JSC::DFG::ByteCodeParser::insertPhiNode):
2596 (JSC::DFG::ByteCodeParser::emitFunctionChecks):
2597 * dfg/DFGCFAPhase.cpp:
2598 (JSC::DFG::CFAPhase::run):
2599 * dfg/DFGCFGSimplificationPhase.cpp:
2600 (JSC::DFG::CFGSimplificationPhase::run):
2601 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
2602 * dfg/DFGCPSRethreadingPhase.cpp:
2603 (JSC::DFG::CPSRethreadingPhase::run):
2604 (JSC::DFG::CPSRethreadingPhase::addPhiSilently):
2605 * dfg/DFGCSEPhase.cpp:
2606 (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
2607 (JSC::DFG::CSEPhase::setReplacement):
2608 (JSC::DFG::CSEPhase::performNodeCSE):
2609 * dfg/DFGCommon.cpp:
2610 (WTF::printInternal):
2614 * dfg/DFGConstantFoldingPhase.cpp:
2615 (JSC::DFG::ConstantFoldingPhase::foldConstants):
2616 (JSC::DFG::ConstantFoldingPhase::addStructureTransitionCheck):
2617 (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
2618 * dfg/DFGDCEPhase.cpp: Added.
2621 (JSC::DFG::DCEPhase::DCEPhase):
2622 (JSC::DFG::DCEPhase::run):
2623 (JSC::DFG::DCEPhase::findTypeCheckRoot):
2624 (JSC::DFG::DCEPhase::countEdge):
2625 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
2626 (JSC::DFG::performDCE):
2627 * dfg/DFGDCEPhase.h: Added.
2629 * dfg/DFGDriver.cpp:
2630 (JSC::DFG::compile):
2631 * dfg/DFGFixupPhase.cpp:
2632 (JSC::DFG::FixupPhase::fixupNode):
2633 (JSC::DFG::FixupPhase::checkArray):
2634 (JSC::DFG::FixupPhase::blessArrayOperation):
2635 (JSC::DFG::FixupPhase::fixIntEdge):
2636 (JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
2637 (JSC::DFG::FixupPhase::truncateConstantToInt32):
2639 (JSC::DFG::Graph::Graph):
2640 (JSC::DFG::Graph::dump):
2643 (JSC::DFG::Graph::changeChild):
2644 (JSC::DFG::Graph::changeEdge):
2645 (JSC::DFG::Graph::compareAndSwap):
2646 (JSC::DFG::Graph::clearAndDerefChild):
2647 (JSC::DFG::Graph::performSubstitution):
2648 (JSC::DFG::Graph::performSubstitutionForEdge):
2650 (JSC::DFG::Graph::substitute):
2651 * dfg/DFGInsertionSet.h:
2654 (JSC::DFG::Node::Node):
2655 (JSC::DFG::Node::convertToConstant):
2656 (JSC::DFG::Node::convertToGetLocalUnlinked):
2657 (JSC::DFG::Node::containsMovHint):
2659 (JSC::DFG::Node::hasVariableAccessData):
2660 (JSC::DFG::Node::willHaveCodeGenOrOSR):
2661 * dfg/DFGNodeType.h:
2663 * dfg/DFGPredictionPropagationPhase.cpp:
2664 (JSC::DFG::PredictionPropagationPhase::propagate):
2665 * dfg/DFGSpeculativeJIT.cpp:
2666 (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
2667 (JSC::DFG::SpeculativeJIT::compileMovHint):
2668 (JSC::DFG::SpeculativeJIT::compileMovHintAndCheck):
2670 (JSC::DFG::SpeculativeJIT::compileInlineStart):
2671 (JSC::DFG::SpeculativeJIT::compile):
2672 * dfg/DFGSpeculativeJIT.h:
2674 * dfg/DFGSpeculativeJIT32_64.cpp:
2675 (JSC::DFG::SpeculativeJIT::compile):
2676 * dfg/DFGSpeculativeJIT64.cpp:
2677 (JSC::DFG::SpeculativeJIT::compile):
2678 * dfg/DFGStructureCheckHoistingPhase.cpp:
2679 (JSC::DFG::StructureCheckHoistingPhase::run):
2680 (JSC::DFG::StructureCheckHoistingPhase::shouldConsiderForHoisting):
2681 (StructureCheckHoistingPhase):
2682 * dfg/DFGValidate.cpp:
2683 (JSC::DFG::Validate::validate):
2685 2013-03-05 Mark Hahnenberg <mhahnenberg@apple.com>
2687 Objective-C API: JSValue should implement init and return nil in exceptional cases
2688 https://bugs.webkit.org/show_bug.cgi?id=111487
2690 Reviewed by Darin Adler.
2693 (-[JSValue init]): We return nil here because there is no way to get the instance into a coherent state
2694 without a JSContext.
2695 (-[JSValue initWithValue:inContext:]): Similarly, we should also return nil here if either of the arguments is 0.
2697 2013-03-05 Sheriff Bot <webkit.review.bot@gmail.com>
2699 Unreviewed, rolling out r144708.
2700 http://trac.webkit.org/changeset/144708
2701 https://bugs.webkit.org/show_bug.cgi?id=111447
2703 random assertion crashes in inspector tests on qt+mac bots
2704 (Requested by kling on #webkit).
2707 * GNUmakefile.list.am:
2708 * JavaScriptCore.gypi:
2709 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2710 * JavaScriptCore.xcodeproj/project.pbxproj:
2712 * runtime/JSGlobalData.cpp:
2713 (JSC::JSGlobalData::JSGlobalData):
2714 * runtime/JSGlobalData.h:
2716 * runtime/PropertyMapHashTable.h:
2718 (JSC::PropertyTable::PropertyTable):
2720 (JSC::PropertyTable::~PropertyTable):
2721 (JSC::PropertyTable::copy):
2722 * runtime/PropertyTable.cpp: Removed.
2723 * runtime/Structure.cpp:
2724 (JSC::Structure::dumpStatistics):
2725 (JSC::Structure::materializePropertyMap):
2726 (JSC::Structure::despecifyDictionaryFunction):
2727 (JSC::Structure::addPropertyTransition):
2728 (JSC::Structure::changePrototypeTransition):
2729 (JSC::Structure::despecifyFunctionTransition):
2730 (JSC::Structure::attributeChangeTransition):
2731 (JSC::Structure::toDictionaryTransition):
2732 (JSC::Structure::sealTransition):
2733 (JSC::Structure::freezeTransition):
2734 (JSC::Structure::preventExtensionsTransition):
2735 (JSC::Structure::nonPropertyTransition):
2736 (JSC::Structure::isSealed):
2737 (JSC::Structure::isFrozen):
2738 (JSC::Structure::flattenDictionaryStructure):
2739 (JSC::Structure::pin):
2740 (JSC::Structure::copyPropertyTable):
2741 (JSC::Structure::copyPropertyTableForPinning):
2742 (JSC::Structure::get):
2743 (JSC::Structure::despecifyFunction):
2744 (JSC::Structure::despecifyAllFunctions):
2745 (JSC::Structure::putSpecificValue):
2746 (JSC::Structure::remove):
2747 (JSC::Structure::createPropertyMap):
2748 (JSC::Structure::getPropertyNamesFromStructure):
2749 (JSC::Structure::visitChildren):
2750 (JSC::Structure::checkConsistency):
2751 * runtime/Structure.h:
2753 (JSC::Structure::putWillGrowOutOfLineStorage):
2754 (JSC::Structure::materializePropertyMapIfNecessary):
2755 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2756 (JSC::Structure::checkOffsetConsistency):
2758 * runtime/StructureInlines.h:
2759 (JSC::Structure::get):
2760 * runtime/WriteBarrier.h:
2761 (JSC::WriteBarrierBase::get):
2763 2013-03-05 David Kilzer <ddkilzer@apple.com>
2765 BUILD FIX (r144698): Only enable SPEECH_SYNTHESIS for Mac
2766 <http://webkit.org/b/106742>
2768 Fixes the following build failures:
2770 Undefined symbols for architecture i386:
2771 "__ZTVN7WebCore25PlatformSpeechSynthesizerE", referenced from:
2772 __ZN7WebCore25PlatformSpeechSynthesizerC2EPNS_31PlatformSpeechSynthesizerClientE in PlatformSpeechSynthesizer.o
2773 NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
2774 "__ZN7WebCore25PlatformSpeechSynthesizer19initializeVoiceListEv", referenced from:
2775 __ZN7WebCore25PlatformSpeechSynthesizerC2EPNS_31PlatformSpeechSynthesizerClientE in PlatformSpeechSynthesizer.o
2776 ld: symbol(s) not found for architecture i386
2778 * Configurations/FeatureDefines.xcconfig:
2779 - Fix definition of ENABLE_ENCRYPTED_MEDIA_V2_macosx to match
2780 other FeatureDefines.xcconfig files.
2781 - Only set ENABLE_SPEECH_SYNTHESIS for the macosx platform.
2783 2013-03-04 Andreas Kling <akling@apple.com>
2785 Unused Structure property tables waste 14MB on Membuster.
2786 <http://webkit.org/b/110854>
2787 <rdar://problem/13292104>
2789 Reviewed by Geoffrey Garen.
2791 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
2792 14 MB progression on Membuster3.
2795 * GNUmakefile.list.am:
2796 * JavaScriptCore.gypi:
2797 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2798 * JavaScriptCore.xcodeproj/project.pbxproj:
2801 Added PropertyTable.cpp.
2803 * runtime/PropertyTable.cpp: Added.
2804 (JSC::PropertyTable::create):
2805 (JSC::PropertyTable::clone):
2806 (JSC::PropertyTable::PropertyTable):
2807 (JSC::PropertyTable::destroy):
2808 (JSC::PropertyTable::~PropertyTable):
2809 (JSC::PropertyTable::visitChildren):
2811 Moved marking of property table values here from Structure::visitChildren().
2813 * runtime/WriteBarrier.h:
2814 (JSC::WriteBarrierBase::get):
2816 Move m_cell to a local before using it multiple times. This avoids a multiple-access race when
2817 Structure::checkOffsetConsistency() is used in assertions on the main thread while a marking thread
2818 zaps the property table.
2820 * runtime/Structure.h:
2821 (JSC::Structure::materializePropertyMapIfNecessary):
2822 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2823 * runtime/StructureInlines.h:
2824 (JSC::Structure::propertyTable):
2826 Added a getter for the Structure's PropertyTable that ASSERTs GC currently isn't active.
2827 Because GC can zap an unpinned property table at any time, it's not entirely safe to access it.
2828 Renamed the variable itself to m_propertyTableUnsafe to force call sites into explaining themselves.
2830 (JSC::Structure::putWillGrowOutOfLineStorage):
2831 (JSC::Structure::checkOffsetConsistency):
2833 Moved these out of Structure.h to break header dependency cycle between Structure/PropertyTable.
2835 * runtime/Structure.cpp:
2836 (JSC::Structure::visitChildren):
2838 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
2840 * runtime/JSGlobalData.h:
2841 * runtime/JSGlobalData.cpp:
2842 (JSC::JSGlobalData::JSGlobalData):
2844 Add a global propertyTableStructure.
2846 * runtime/PropertyMapHashTable.h:
2848 (JSC::PropertyTable::createStructure):
2849 (JSC::PropertyTable::copy):
2851 Make PropertyTable a GC object.
2853 * runtime/Structure.cpp:
2854 (JSC::Structure::dumpStatistics):
2855 (JSC::Structure::materializePropertyMap):
2856 (JSC::Structure::despecifyDictionaryFunction):
2857 (JSC::Structure::addPropertyTransition):
2858 (JSC::Structure::changePrototypeTransition):
2859 (JSC::Structure::despecifyFunctionTransition):
2860 (JSC::Structure::attributeChangeTransition):
2861 (JSC::Structure::toDictionaryTransition):
2862 (JSC::Structure::sealTransition):
2863 (JSC::Structure::freezeTransition):
2864 (JSC::Structure::preventExtensionsTransition):
2865 (JSC::Structure::nonPropertyTransition):
2866 (JSC::Structure::isSealed):
2867 (JSC::Structure::isFrozen):
2868 (JSC::Structure::flattenDictionaryStructure):
2869 (JSC::Structure::pin):
2870 (JSC::Structure::copyPropertyTable):
2871 (JSC::Structure::copyPropertyTableForPinning):
2872 (JSC::Structure::get):
2873 (JSC::Structure::despecifyFunction):
2874 (JSC::Structure::despecifyAllFunctions):
2875 (JSC::Structure::putSpecificValue):
2876 (JSC::Structure::remove):
2877 (JSC::Structure::createPropertyMap):
2878 (JSC::Structure::getPropertyNamesFromStructure):
2879 (JSC::Structure::checkConsistency):
2881 2013-03-04 Chris Fleizach <cfleizach@apple.com>
2883 Support WebSpeech - Speech Synthesis
2884 https://bugs.webkit.org/show_bug.cgi?id=106742
2886 Reviewed by Simon Fraser.
2888 Enable speech synthesis for the Mac.
2890 * Configurations/FeatureDefines.xcconfig:
2892 2013-03-04 Mark Hahnenberg <mhahnenberg@apple.com>
2894 Remove contextInternalContext from JSContextInternal.h
2895 https://bugs.webkit.org/show_bug.cgi?id=111356
2897 Reviewed by Geoffrey Garen.
2899 We don't need it any more since we have globalContextRef in JSContext.
2902 * API/JSContextInternal.h:
2904 (+[JSValue valueWithBool:inContext:]):
2905 (+[JSValue valueWithDouble:inContext:]):
2906 (+[JSValue valueWithInt32:inContext:]):
2907 (+[JSValue valueWithUInt32:inContext:]):
2908 (+[JSValue valueWithNewObjectInContext:]):
2909 (+[JSValue valueWithNewArrayInContext:]):
2910 (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]):
2911 (+[JSValue valueWithNewErrorFromMessage:inContext:]):
2912 (+[JSValue valueWithNullInContext:]):
2913 (+[JSValue valueWithUndefinedInContext:]):
2914 (-[JSValue toBool]):
2915 (-[JSValue toDouble]):
2916 (-[JSValue toNumber]):
2917 (-[JSValue toString]):
2918 (-[JSValue toDate]):
2919 (-[JSValue toArray]):
2920 (-[JSValue toDictionary]):
2921 (-[JSValue valueForProperty:]):
2922 (-[JSValue setValue:forProperty:]):
2923 (-[JSValue deleteProperty:]):
2924 (-[JSValue hasProperty:]):
2925 (-[JSValue valueAtIndex:]):
2926 (-[JSValue setValue:atIndex:]):
2927 (-[JSValue isUndefined]):
2928 (-[JSValue isNull]):
2929 (-[JSValue isBoolean]):
2930 (-[JSValue isNumber]):
2931 (-[JSValue isString]):
2932 (-[JSValue isObject]):
2933 (-[JSValue isEqualToObject:]):
2934 (-[JSValue isEqualWithTypeCoercionToObject:]):
2935 (-[JSValue isInstanceOf:]):
2936 (-[JSValue callWithArguments:]):
2937 (-[JSValue constructWithArguments:]):
2938 (-[JSValue invokeMethod:withArguments:]):
2940 (objectToValueWithoutCopy):
2942 (-[JSValue initWithValue:inContext:]):
2943 (-[JSValue dealloc]):
2944 (-[JSValue description]):
2945 * API/JSWrapperMap.mm:
2946 (createObjectWithCustomBrand):
2947 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]):
2948 (-[JSObjCClassInfo wrapperForObject:]):
2949 (-[JSWrapperMap jsWrapperForObject:]):
2950 * API/ObjCCallbackFunction.mm:
2951 (ObjCCallbackFunction::call):
2952 (objCCallbackFunctionForInvocation):
2954 2013-03-04 Andreas Kling <akling@apple.com>
2956 Add simple vector traits for JSC::Identifier.
2957 <http://webkit.org/b/111323>
2959 Reviewed by Geoffrey Garen.
2961 Identifiers are really just Strings, giving them simple vector traits makes
2962 Vector move them with memcpy() instead of churning the refcounts.
2964 * runtime/Identifier.h:
2967 2013-03-04 Kunihiko Sakamoto <ksakamoto@chromium.org>
2969 Add build flag for FontLoader
2970 https://bugs.webkit.org/show_bug.cgi?id=111289
2972 Reviewed by Benjamin Poulain.
2974 Add ENABLE_FONT_LOAD_EVENTS build flag (disabled by default).
2976 * Configurations/FeatureDefines.xcconfig:
2978 2013-03-03 Andreas Kling <akling@apple.com>
2980 Shrink JSC::HashTable entries.
2981 <http://webkit.org/b/111275>
2982 <rdar://problem/13333511>
2984 Reviewed by Anders Carlsson.
2986 Move the Intrinsic value out of the function-specific part of the union,
2987 and store it next to m_attributes. Reduces the size of HashEntry by 8 bytes.
2989 990 kB progression on Membuster3. (PTUS: 797 kB)
2992 (JSC::HashEntry::initialize):
2993 (JSC::HashEntry::intrinsic):
2996 2013-03-01 David Kilzer <ddkilzer@apple.com>
2998 BUILD FIX: testapi should link to Foundation, not CoreFoundation
3000 * JavaScriptCore.xcodeproj/project.pbxproj: Change testapi to
3001 link to Foundation.framework instead of CoreFoundation.framework
3002 since it uses NS types.
3004 2013-03-01 Mark Hahnenberg <mhahnenberg@apple.com>
3006 Objective-C API: Passing JS functions to Objective-C callbacks causes JSValue to leak
3007 https://bugs.webkit.org/show_bug.cgi?id=107836
3009 Reviewed by Oliver Hunt.
3011 We've decided to remove support for this feature from the API because there's no way to automatically manage
3012 the memory for clients in a satisfactory manner. Clients can still pass JS functions to Objective-C methods,
3013 but the methods must accept plain JSValues instead of Objective-C blocks.
3015 We now ignore functions that are part of a protocol that inherits from JSExport that accept blocks as arguments.
3017 * API/JSBlockAdaptor.h: Removed.
3018 * API/JSBlockAdaptor.mm: Removed.
3019 * API/ObjCCallbackFunction.mm:
3020 (ArgumentTypeDelegate::typeBlock): Return nil to signal that we want to ignore this function when copying it
3021 to the object from the protocol.
3022 * API/tests/testapi.mm: Added a test to make sure that we ignore methods declared as part of a JSExport-ed protocol
3023 that have block arguments.
3024 (-[TestObject bogusCallback:]):
3025 * JavaScriptCore.gypi: Updated build files.
3026 * JavaScriptCore.xcodeproj/project.pbxproj:
3028 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3030 DFG Branch(LogicalNot) peephole should not try to optimize and work-around the case where LogicalNot may be otherwise live
3031 https://bugs.webkit.org/show_bug.cgi?id=111209
3033 Reviewed by Oliver Hunt.
3035 Even if it is then everything will work just fine. It's not necessary to check the ref count here.
3037 * dfg/DFGFixupPhase.cpp:
3038 (JSC::DFG::FixupPhase::fixupNode):
3040 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3042 DFG CSE phase shouldn't rely on ref count of nodes, since it doesn't have to
3043 https://bugs.webkit.org/show_bug.cgi?id=111205
3045 Reviewed by Oliver Hunt.
3047 I don't understand the intuition behind setLocalStoreElimination() validating that the SetLocal's ref count
3048 is 1. I believe this is a hold-over from when setLocalStoreElimination() would match one SetLocal to another,
3049 and then try to eliminate the first SetLocal. But that's not how it works now. Now, setLocalStoreElimination()
3050 is actually Flush elimination: it eliminates any Flush that anchors a SetLocal if it proves that every path
3051 from the SetLocal to the Flush is devoid of operations that may observe the local. It doesn't actually kill
3052 the SetLocal itself: if the SetLocal is live because of other things (other Flushes or GetLocals in other
3053 basic blocks), then the SetLocal will naturally still be alive because th Flush was only keeping the SetLocal
3054 alive by one count rather than being solely responsible for its liveness.
3056 * dfg/DFGCSEPhase.cpp:
3057 (JSC::DFG::CSEPhase::setLocalStoreElimination):
3058 (JSC::DFG::CSEPhase::eliminate):
3059 (JSC::DFG::CSEPhase::performNodeCSE):
3061 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3063 Rename MovHint to MovHintEvent so I can create a NodeType called MovHint
3065 Rubber stamped by Mark Hahnenberg.
3067 This is similar to the SetLocal/SetLocalEvent naming scheme, where SetLocal is the
3068 NodeType and SetLocalEvent is the VariableEventKind.
3070 * dfg/DFGVariableEvent.cpp:
3071 (JSC::DFG::VariableEvent::dump):
3072 * dfg/DFGVariableEvent.h:
3073 (JSC::DFG::VariableEvent::movHint):
3074 (JSC::DFG::VariableEvent::id):
3075 (JSC::DFG::VariableEvent::operand):
3077 * dfg/DFGVariableEventStream.cpp:
3078 (JSC::DFG::VariableEventStream::reconstruct):
3080 2013-03-01 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
3082 [JSC] Fix sign comparison warning/error after r144340.
3083 https://bugs.webkit.org/show_bug.cgi?id=111164
3085 Reviewed by Mark Hahnenberg.
3087 gcc (both 4.2.1 and 4.7.2) complain about comparing signed and
3088 unsigned terms (clang accepts it just fine).
3090 Work around that by casting the 1 to an uintptr_t as well.
3093 (JSC::DFG::Edge::makeWord):
3095 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3097 DFG CFA should not do liveness pruning
3098 https://bugs.webkit.org/show_bug.cgi?id=111119
3100 Reviewed by Mark Hahnenberg.
3102 It adds complexity and probably buys nothing. Moreover, I'm transitioning to having
3103 liveness only available at the bitter end of compilation, so this will stop working
3104 after https://bugs.webkit.org/show_bug.cgi?id=109389 anyway.
3106 * dfg/DFGAbstractState.cpp:
3107 (JSC::DFG::AbstractState::initialize):
3108 (JSC::DFG::AbstractState::mergeStateAtTail):
3110 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3112 Don't try to emit profiling if you don't have the DFG JIT.
3114 Rubber stamped by Mark Hahnenberg.
3117 (JSC::JIT::shouldEmitProfiling):
3119 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3121 DFG Phantom node should be honest about the fact that it can exit
3122 https://bugs.webkit.org/show_bug.cgi?id=111115
3124 Reviewed by Mark Hahnenberg.
3126 The chances of this having cause serious issues are low, since most clients of the
3127 NodeDoesNotExit flag run after CFA and CFA updates this properly. But one possible
3128 case of badness is if the ByteCodeParser inserted a Phantom with a type check in
3129 between a LogicalNot and a Branch; then that peephole optimization in Fixup might
3132 * dfg/DFGNodeType.h:
3135 2013-02-28 Mark Hahnenberg <mhahnenberg@apple.com>
3137 Add casts in DFGGPRInfo.h to suppress warnings
3138 https://bugs.webkit.org/show_bug.cgi?id=111104
3140 Reviewed by Filip Pizlo.
3142 With certain flags on, we get compiler warnings on ARM. We should do the proper casts to make these warnings go away.
3145 (JSC::DFG::GPRInfo::toIndex):
3146 (JSC::DFG::GPRInfo::debugName):
3148 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3150 It should be easy to determine if a DFG node exits forward or backward when doing type checks
3151 https://bugs.webkit.org/show_bug.cgi?id=111102
3153 Reviewed by Mark Hahnenberg.
3155 This adds a NodeExitsForward flag, which tells you the exit directionality of
3156 type checks performed by the node. Even if you convert the node to a Phantom
3157 and use the Edge UseKind for type checks, you'll still get the same exit
3158 directionality that the original node would have wanted.
3160 * dfg/DFGArgumentsSimplificationPhase.cpp:
3161 (JSC::DFG::ArgumentsSimplificationPhase::run):
3162 * dfg/DFGArrayifySlowPathGenerator.h:
3163 (JSC::DFG::ArrayifySlowPathGenerator::ArrayifySlowPathGenerator):
3164 * dfg/DFGCFGSimplificationPhase.cpp:
3165 (JSC::DFG::CFGSimplificationPhase::run):
3166 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
3167 * dfg/DFGCPSRethreadingPhase.cpp:
3168 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
3169 * dfg/DFGCSEPhase.cpp:
3170 (JSC::DFG::CSEPhase::setReplacement):
3171 (JSC::DFG::CSEPhase::eliminate):
3172 (JSC::DFG::CSEPhase::performNodeCSE):
3173 * dfg/DFGConstantFoldingPhase.cpp:
3174 (JSC::DFG::ConstantFoldingPhase::foldConstants):
3175 * dfg/DFGFixupPhase.cpp:
3176 (JSC::DFG::FixupPhase::checkArray):
3179 (JSC::DFG::Node::setOpAndDefaultNonExitFlags):
3180 (JSC::DFG::Node::convertToPhantom):
3181 * dfg/DFGNodeFlags.cpp:
3182 (JSC::DFG::nodeFlagsAsString):
3183 * dfg/DFGNodeFlags.h:
3185 * dfg/DFGNodeType.h:
3187 * dfg/DFGSpeculativeJIT.cpp:
3188 (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck):
3190 (JSC::DFG::SpeculativeJIT::speculationCheck):
3191 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
3192 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
3193 (JSC::DFG::SpeculativeJIT::backwardTypeCheck):
3194 (JSC::DFG::SpeculativeJIT::typeCheck):
3195 (JSC::DFG::SpeculativeJIT::forwardTypeCheck):
3196 (JSC::DFG::SpeculativeJIT::fillStorage):
3197 (JSC::DFG::SpeculativeJIT::compile):
3198 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
3199 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
3200 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
3201 * dfg/DFGSpeculativeJIT.h:
3203 (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand):
3204 (JSC::DFG::SpeculateIntegerOperand::gpr):
3205 (SpeculateIntegerOperand):
3206 (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand):
3207 (JSC::DFG::SpeculateDoubleOperand::fpr):
3208 (SpeculateDoubleOperand):
3209 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
3210 (JSC::DFG::SpeculateCellOperand::gpr):
3211 (SpeculateCellOperand):
3212 (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand):
3213 (JSC::DFG::SpeculateBooleanOperand::gpr):
3214 (SpeculateBooleanOperand):
3215 * dfg/DFGSpeculativeJIT32_64.cpp:
3216 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
3217 (JSC::DFG::SpeculativeJIT::fillSpeculateInt):
3218 (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
3219 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
3220 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3221 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
3222 (JSC::DFG::SpeculativeJIT::compile):
3223 * dfg/DFGSpeculativeJIT64.cpp:
3224 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
3225 (JSC::DFG::SpeculativeJIT::fillSpeculateInt):
3226 (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
3227 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
3228 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3229 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
3230 (JSC::DFG::SpeculativeJIT::compile):
3232 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3234 CodeBlock::valueProfile() has a bogus assertion
3235 https://bugs.webkit.org/show_bug.cgi?id=111106
3236 <rdar://problem/13131427>
3238 Reviewed by Mark Hahnenberg.
3240 This was just a bad assertion: m_bytecodeOffset == -1 means that the value profile is constructed but not initialized.
3241 ValueProfile constructs itself in a safe way; you can call any method you want on a constructed but not initialized
3242 ValueProfile. CodeBlock first constructs all ValueProfiles (by growing the ValueProfile vector) and then initializes
3243 their m_bytecodeOffset later. This is necessary because the initialization is linking bytecode instructions to their
3244 ValueProfiles, so at that point we don't want the ValueProfile vector to resize, which implies that we want all of
3245 them to already be constructed. A GC can happen during this phase, and the GC may want to walk all ValueProfiles.
3246 This is safe, but one of the ValueProfile getters (CodeBlock::valueProfile()) was asserting that any value profile
3247 you get has had its m_bytecodeOffset initialized. This need not be the case and nothing will go wrong if it isn't.
3249 The solution is to remove the assertion, which I believe was put there to ensure that my m_valueProfiles refactoring
3250 a long time ago was sound: it used to be that a ValueProfile with m_bytecodeOffset == -1 was an argument profile; now
3251 all argument profiles are in m_argumentValueProfiles instead. I think it's safe to say that this refactoring was done
3252 soundly since it was a long time ago. So we should kill the assertion - I don't see an easy way to make the assertion
3253 sound with respect to the GC-during-CodeBlock-construction issue, and I don't believe that the assertion is buying us
3254 anything at this point.
3256 * bytecode/CodeBlock.h:
3257 (JSC::CodeBlock::valueProfile):
3259 2013-02-27 Filip Pizlo <fpizlo@apple.com>
3261 DFG CFA should leave behind information in Edge that says if the Edge's type check is proven to succeed
3262 https://bugs.webkit.org/show_bug.cgi?id=110840
3264 Reviewed by Mark Hahnenberg.
3266 This doesn't add any observable functionality to the compiler, yet. But it does give
3267 every phase that runs after CFA the ability to know, in O(1) time, whether an edge
3268 will need to execute a type check.
3270 * dfg/DFGAbstractState.h:
3271 (JSC::DFG::AbstractState::filterEdgeByUse):
3272 (JSC::DFG::AbstractState::filterByType):
3273 * dfg/DFGCommon.cpp:
3275 (WTF::printInternal):
3277 (JSC::DFG::isProved):
3279 (JSC::DFG::proofStatusForIsProved):
3282 (JSC::DFG::Edge::dump):
3284 (JSC::DFG::Edge::Edge):
3285 (JSC::DFG::Edge::setNode):
3286 (JSC::DFG::Edge::useKindUnchecked):
3287 (JSC::DFG::Edge::setUseKind):
3289 (JSC::DFG::Edge::proofStatusUnchecked):
3290 (JSC::DFG::Edge::proofStatus):
3291 (JSC::DFG::Edge::setProofStatus):
3292 (JSC::DFG::Edge::isProved):
3293 (JSC::DFG::Edge::needsCheck):
3294 (JSC::DFG::Edge::shift):
3295 (JSC::DFG::Edge::makeWord):
3297 2013-02-28 Simon Hausmann <simon.hausmann@digia.com>
3299 [Qt][Mac] Fix massive parallel builds
3301 Reviewed by Tor Arne Vestbø.
3303 There exists a race condition that LLIntDesiredOffsets.h is written to
3304 by two parllel instances of the ruby script. This patch ensures that similar to the output file,
3305 the generated file is also prefixed according to the build configuration.
3307 * LLIntOffsetsExtractor.pro:
3309 2013-02-27 Sheriff Bot <webkit.review.bot@gmail.com>
3311 Unreviewed, rolling out r144168.
3312 http://trac.webkit.org/changeset/144168
3313 https://bugs.webkit.org/show_bug.cgi?id=111019
3315 It broke the build and tronical is unavailable (Requested by
3316 Ossy_night on #webkit).
3318 * LLIntOffsetsExtractor.pro:
3320 2013-02-26 Filip Pizlo <fpizlo@apple.com>
3322 Disable some unsound DFG DCE
3323 https://bugs.webkit.org/show_bug.cgi?id=110948
3325 Reviewed by Michael Saboff.
3327 DCE of bitops is not sound since the bitops might call some variant of valueOf.
3329 This used to work right because ValueToInt32 was MustGenerate. From the DFG IR
3330 standpoint it feels weird to make ValueToInt32 be MustGenerate since that node is
3331 implemented entirely as a pure conversion. If we ever gave the DFG the ability to
3332 do effectful bitops, we would most likely implement them as special nodes not
3333 related to the ValueToInt32 and bitop nodes we have now.
3335 This change is performance neutral.
3337 * dfg/DFGNodeType.h:
3340 2013-02-27 Glenn Adams <glenn@skynav.com>
3342 Add ENABLE_CSS3_TEXT_LINE_BREAK flag.
3343 https://bugs.webkit.org/show_bug.cgi?id=110944
3345 Reviewed by Dean Jackson.
3347 * Configurations/FeatureDefines.xcconfig:
3349 2013-02-27 Julien Brianceau <jbrianceau@nds.com>
3351 Fix build when DFG_JIT is not enabled
3352 https://bugs.webkit.org/show_bug.cgi?id=110991
3354 Reviewed by Csaba Osztrogonác.
3357 (JSC::JIT::canBeOptimizedOrInlined):