1 2013-03-22 David Kilzer <ddkilzer@apple.com>
3 Revert "BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]"
5 This fixes a build failure introduced by this change:
7 Source/JavaScriptCore/API/tests/testapi.mm:206:6: error: ARC forbids explicit message send of 'dealloc'
12 Not sure why this didn't fail locally on my Mac Pro.
14 * API/tests/testapi.mm:
15 (-[TinyDOMNode dealloc]): Remove call to [super dealloc].
17 2013-03-22 David Kilzer <ddkilzer@apple.com>
19 BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]
20 <http://webkit.org/b/112608>
22 Fixes the following build failure:
24 Source/JavaScriptCore/API/tests/testapi.mm:205:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
29 * API/tests/testapi.mm:
30 (-[TinyDOMNode dealloc]): Call [super dealloc].
32 2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
34 Leak bots erroneously report JSC::WatchpointSet as leaking
35 https://bugs.webkit.org/show_bug.cgi?id=107781
37 Reviewed by Filip Pizlo.
39 Since leaks doesn't support tagged pointers, avoid using it by flipping the bit flag to indicate
40 the entry is "fat". We set the flag when the entry is NOT fat; i.e. slim.
42 Replaced FatFlag by SlimFlag and initialized m_bits with this flag to indicate that the entry is
45 * runtime/SymbolTable.cpp:
46 (JSC::SymbolTableEntry::copySlow): Don't set FatFlag since it has been replaced by SlimFlag.
47 (JSC::SymbolTableEntry::inflateSlow): Ditto.
49 * runtime/SymbolTable.h:
50 (JSC::SymbolTableEntry::Fast::Fast): Set SlimFlag by default.
51 (JSC::SymbolTableEntry::Fast::isNull): Ignore SlimFlag.
52 (JSC::SymbolTableEntry::Fast::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag
55 (JSC::SymbolTableEntry::SymbolTableEntry): Set SlimFlag by default.
56 (JSC::SymbolTableEntry::SymbolTableEntry::getFast): Set SlimFlag when creating Fast from a fat entry.
57 (JSC::SymbolTableEntry::isNull): Ignore SlimFlag.
58 (JSC::SymbolTableEntry::FatEntry::FatEntry): Strip SlimFlag.
59 (JSC::SymbolTableEntry::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag is unset.
60 (JSC::SymbolTableEntry::fatEntry): Don't strip FatFlag as this flag doesn't exist anymore.
61 (JSC::SymbolTableEntry::pack): Preserve SlimFlag.
63 (JSC::SymbolTableIndexHashTraits): empty value is no longer zero so don't set emptyValueIsZero true.
65 2013-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
67 Objective-C API: Need a good way to preserve custom properties on JS wrappers
68 https://bugs.webkit.org/show_bug.cgi?id=112608
70 Reviewed by Geoffrey Garen.
72 Currently, we just use a weak map, which means that garbage collection can cause a wrapper to
73 disappear if it isn't directly exported to JavaScript.
75 The most straightforward and safe way (with respect to garbage collection and concurrency) is to have
76 clients add and remove their external references along with their owners. Effectively, the client is
77 recording the structure of the external object graph so that the garbage collector can make sure to
78 mark any wrappers that are reachable through either the JS object graph of the external Obj-C object
79 graph. By keeping these wrappers alive, this has the effect that custom properties on these wrappers
80 will also remain alive.
82 The rule for if an object needs to be tracked by the runtime (and therefore whether the client should report it) is as follows:
83 For a particular object, its references to its children should be added if:
84 1. The child is referenced from JavaScript.
85 2. The child contains references to other objects for which (1) or (2) are true.
87 * API/JSAPIWrapperObject.mm:
88 (JSAPIWrapperObjectHandleOwner::finalize):
89 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): A wrapper object is kept alive only if its JSGlobalObject
90 is marked and its corresponding Objective-C object was added to the set of opaque roots.
91 (JSC::JSAPIWrapperObject::visitChildren): We now call out to scanExternalObjectGraph, which handles adding all Objective-C
92 objects to the set of opaque roots.
93 * API/JSAPIWrapperObject.h:
95 * API/JSContext.mm: Moved dealloc to its proper place in the main implementation.
96 (-[JSContext dealloc]):
97 * API/JSVirtualMachine.h:
98 * API/JSVirtualMachine.mm:
99 (-[JSVirtualMachine initWithContextGroupRef:]):
100 (-[JSVirtualMachine dealloc]):
101 (getInternalObjcObject): Helper funciton to get the Objective-C object out of JSManagedValues or JSValues if there is one.
102 (-[JSVirtualMachine addManagedReference:withOwner:]): Adds the Objective-C object to the set of objects
103 owned by the owner object in that particular virtual machine.
104 (-[JSVirtualMachine removeManagedReference:withOwner:]): Removes the relationship between the two objects.
105 (-[JSVirtualMachine externalObjectGraph]):
106 (scanExternalObjectGraph): Does a depth-first search of the external object graph in a particular virtual machine starting at
107 the specified root. Each new object it encounters it adds to the set of opaque roots. These opaque roots will keep their
108 corresponding wrapper objects alive if they have them.
109 * API/JSManagedReferenceInternal.h: Added.
110 * API/JSVirtualMachine.mm: Added the per-JSVirtualMachine map between objects and the objects they own, which is more formally
111 known as that virtual machine's external object graph.
112 * API/JSWrapperMap.mm:
113 (-[JSWrapperMap dealloc]): We were leaking this before :-(
114 (-[JSVirtualMachine initWithContextGroupRef:]):
115 (-[JSVirtualMachine dealloc]):
116 (-[JSVirtualMachine externalObjectGraph]):
117 * API/JSVirtualMachineInternal.h:
118 * API/tests/testapi.mm: Added two new tests using the TinyDOMNode class. The first tests that a custom property added to a wrapper
119 doesn't vanish after GC, even though that wrapper isn't directly accessible to the JS garbage collector but is accessible through
120 the external Objective-C object graph. The second test makes sure that adding an object to the external object graph with the same
121 owner doesn't cause any sort of problems.
122 (+[TinyDOMNode sharedVirtualMachine]):
123 (-[TinyDOMNode init]):
124 (-[TinyDOMNode dealloc]):
125 (-[TinyDOMNode appendChild:]):
126 (-[TinyDOMNode numberOfChildren]):
127 (-[TinyDOMNode childAtIndex:]):
128 (-[TinyDOMNode removeChildAtIndex:]):
129 * JavaScriptCore.xcodeproj/project.pbxproj:
130 * heap/SlotVisitor.h:
132 * heap/SlotVisitorInlines.h:
133 (JSC::SlotVisitor::containsOpaqueRootTriState): Added a new method to SlotVisitor to allow scanExternalObjectGraph to have a
134 thread-safe view of opaque roots during parallel marking. The set of opaque roots available to any one SlotVisitor isn't guaranteed
135 to be 100% correct, but that just results in a small duplication of work in scanExternalObjectGraph. To indicate this change for
136 false negatives we return a TriState that's either true or mixed, but never false.
138 2013-03-21 Mark Lam <mark.lam@apple.com>
140 Fix O(n^2) op_debug bytecode charPosition to column computation.
141 https://bugs.webkit.org/show_bug.cgi?id=112957.
143 Reviewed by Geoffrey Garen.
145 The previous algorithm does a linear reverse scan of the source string
146 to find the line start for any given char position. This results in a
147 O(n^2) algortithm when the source string has no line breaks.
149 The new algorithm computes a line start column table for a
150 SourceProvider on first use. This line start table is used to fix up
151 op_debug's charPosition operand into a column operand when an
152 UnlinkedCodeBlock is linked into a CodeBlock. The initialization of
153 the line start table is O(n), and the CodeBlock column fix up is
156 * bytecode/CodeBlock.cpp:
157 (JSC::CodeBlock::dumpBytecode):
158 (JSC::CodeBlock::CodeBlock): - do column fix up.
159 * interpreter/Interpreter.cpp:
160 (JSC::Interpreter::debug): - no need to do column fixup anymore.
161 * interpreter/Interpreter.h:
163 (JSC::DEFINE_STUB_FUNCTION):
164 * llint/LLIntSlowPaths.cpp:
165 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
166 * parser/SourceProvider.cpp:
167 (JSC::SourceProvider::lineStarts):
168 (JSC::charPositionExtractor):
169 (JSC::SourceProvider::charPositionToColumnNumber):
170 - initialize line start column table if needed.
171 - look up line start for the given char position.
172 * parser/SourceProvider.h:
174 2013-03-21 Filip Pizlo <fpizlo@apple.com>
176 JSC profiler should have an at-a-glance report of the success of DFG optimization
177 https://bugs.webkit.org/show_bug.cgi?id=112988
179 Reviewed by Geoffrey Garen.
181 * dfg/DFGByteCodeParser.cpp:
182 (JSC::DFG::ByteCodeParser::handleCall):
183 (JSC::DFG::ByteCodeParser::handleGetById):
184 (JSC::DFG::ByteCodeParser::parseBlock):
185 * profiler/ProfilerCompilation.cpp:
186 (JSC::Profiler::Compilation::Compilation):
187 (JSC::Profiler::Compilation::toJS):
188 * profiler/ProfilerCompilation.h:
189 (JSC::Profiler::Compilation::noticeInlinedGetById):
190 (JSC::Profiler::Compilation::noticeInlinedPutById):
191 (JSC::Profiler::Compilation::noticeInlinedCall):
193 * runtime/CommonIdentifiers.h:
195 2013-03-21 Mark Lam <mark.lam@apple.com>
197 Fix lexer charPosition computation when "rewind"ing the lexer.
198 https://bugs.webkit.org/show_bug.cgi?id=112952.
200 Reviewed by Michael Saboff.
202 Changed the Lexer to no longer keep a m_charPosition. Instead, we compute
203 currentCharPosition() from m_code and m_codeStartPlusOffset, where
204 m_codeStartPlusOffset is the SourceProvider m_codeStart + the SourceCode
205 start offset. This ensures that the charPosition is always in sync with
210 (JSC::::internalShift):
214 (JSC::Lexer::currentCharPosition):
215 (JSC::::lexExpectIdentifier):
217 2013-03-21 Alberto Garcia <agarcia@igalia.com>
219 [BlackBerry] GCActivityCallback: replace JSLock with JSLockHolder
220 https://bugs.webkit.org/show_bug.cgi?id=112448
222 Reviewed by Xan Lopez.
224 This changed in r121381.
226 * runtime/GCActivityCallbackBlackBerry.cpp:
227 (JSC::DefaultGCActivityCallback::doWork):
229 2013-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
231 Objective-C API: wrapperClass holds a static JSClassRef, which causes JSGlobalObjects to leak
232 https://bugs.webkit.org/show_bug.cgi?id=112856
234 Reviewed by Geoffrey Garen.
236 Through a very convoluted path that involves the caching of prototypes on the JSClassRef, we can leak
237 JSGlobalObjects when inserting an Objective-C object into multiple independent JSContexts.
239 * API/JSAPIWrapperObject.cpp: Removed.
240 * API/JSAPIWrapperObject.h:
241 (JSAPIWrapperObject):
242 * API/JSAPIWrapperObject.mm: Copied from Source/JavaScriptCore/API/JSAPIWrapperObject.cpp. Made this an
243 Objective-C++ file so that we can call release on the wrappedObject. Also added a WeakHandleOwner for
244 JSAPIWrapperObjects. This will also be used in a future patch for https://bugs.webkit.org/show_bug.cgi?id=112608.
245 (JSAPIWrapperObjectHandleOwner):
246 (jsAPIWrapperObjectHandleOwner):
247 (JSAPIWrapperObjectHandleOwner::finalize): This finalize replaces the old finalize that was done through
249 (JSC::JSAPIWrapperObject::finishCreation): Allocate the WeakImpl. Balanced in finalize.
250 (JSC::JSAPIWrapperObject::setWrappedObject): We now do the retain of the wrappedObject here rather than in random
251 places scattered around JSWrapperMap.mm
252 * API/JSObjectRef.cpp: Added some ifdefs for platforms that don't support the Obj-C API.
253 (JSObjectGetPrivate): Ditto.
254 (JSObjectSetPrivate): Ditto.
255 (JSObjectGetPrivateProperty): Ditto.
256 (JSObjectSetPrivateProperty): Ditto.
257 (JSObjectDeletePrivateProperty): Ditto.
258 * API/JSValueRef.cpp: Ditto.
259 (JSValueIsObjectOfClass): Ditto.
260 * API/JSWrapperMap.mm: Remove wrapperClass().
261 (objectWithCustomBrand): Change to no longer use a parent class, which was only used to give the ability to
262 finalize wrapper objects.
263 (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]): Change to no longer use wrapperClass().
264 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): Ditto.
265 (tryUnwrapObjcObject): We now check if the object inherits from JSAPIWrapperObject.
266 * API/tests/testapi.mm: Added a test that exports an Objective-C object to two different JSContexts and makes
267 sure that the first one is collected properly by using a weak JSManagedValue for the wrapper in the first JSContext.
268 * CMakeLists.txt: Build file modifications.
269 * GNUmakefile.list.am: Ditto.
270 * JavaScriptCore.gypi: Ditto.
271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
272 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Ditto.
273 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.
274 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
275 * runtime/JSGlobalObject.cpp: More ifdefs for unsupported platforms.
276 (JSC::JSGlobalObject::reset): Ditto.
277 (JSC::JSGlobalObject::visitChildren): Ditto.
278 * runtime/JSGlobalObject.h: Ditto.
279 (JSGlobalObject): Ditto.
280 (JSC::JSGlobalObject::objcCallbackFunctionStructure): Ditto.
282 2013-03-21 Anton Muhin <antonm@chromium.org>
284 Unreviewed, rolling out r146483.
285 http://trac.webkit.org/changeset/146483
286 https://bugs.webkit.org/show_bug.cgi?id=111695
290 * bytecode/GlobalResolveInfo.h: Removed property svn:mergeinfo.
292 2013-03-21 Gabor Rapcsanyi <rgabor@webkit.org>
294 Implement LLInt for CPU(ARM_TRADITIONAL)
295 https://bugs.webkit.org/show_bug.cgi?id=97589
297 Reviewed by Zoltan Herczeg.
299 Enable LLInt for ARMv5 and ARMv7 traditional as well.
301 * llint/LLIntOfflineAsmConfig.h:
302 * llint/LowLevelInterpreter.asm:
303 * llint/LowLevelInterpreter32_64.asm:
305 * offlineasm/backends.rb:
306 * offlineasm/instructions.rb:
308 2013-03-20 Cosmin Truta <ctruta@blackberry.com>
310 [QNX][ARM] REGRESSION(r135330): Various failures in Octane
311 https://bugs.webkit.org/show_bug.cgi?id=112863
315 This was fixed in http://trac.webkit.org/changeset/146396 on Linux only.
316 Enable this fix on QNX.
318 * assembler/ARMv7Assembler.h:
320 (JSC::ARMv7Assembler::replaceWithJump):
321 (JSC::ARMv7Assembler::maxJumpReplacementSize):
322 * assembler/MacroAssemblerARMv7.h:
323 (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):
325 2013-03-20 Filip Pizlo <fpizlo@apple.com>
327 Fix indentation of JSString.h
329 Rubber stamped by Mark Hahnenberg.
331 * runtime/JSString.h:
333 2013-03-20 Filip Pizlo <fpizlo@apple.com>
335 "" + x where x is not a string should be optimized by the DFG to some manner of ToString conversion
336 https://bugs.webkit.org/show_bug.cgi?id=112845
338 Reviewed by Mark Hahnenberg.
340 I like to do "" + x. So I decided to make DFG recognize it, and related idioms.
342 * dfg/DFGFixupPhase.cpp:
343 (JSC::DFG::FixupPhase::fixupNode):
344 (JSC::DFG::FixupPhase::fixupToPrimitive):
346 (JSC::DFG::FixupPhase::fixupToString):
347 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
348 * dfg/DFGPredictionPropagationPhase.cpp:
349 (JSC::DFG::resultOfToPrimitive):
351 (JSC::DFG::PredictionPropagationPhase::propagate):
352 * dfg/DFGPredictionPropagationPhase.h:
355 2013-03-20 Zoltan Herczeg <zherczeg@webkit.org>
357 ARMv7 replaceWithJump ASSERT failure after r135330.
358 https://bugs.webkit.org/show_bug.cgi?id=103146
360 Reviewed by Filip Pizlo.
362 On Linux, the 24 bit distance range of jumps sometimes does not
363 enough to cover all targets addresses. This patch supports jumps
364 outside of this range using a mov/movt/bx 10 byte long sequence.
366 * assembler/ARMv7Assembler.h:
368 (JSC::ARMv7Assembler::revertJumpTo_movT3movtcmpT2):
369 (JSC::ARMv7Assembler::nopw):
370 (JSC::ARMv7Assembler::label):
371 (JSC::ARMv7Assembler::replaceWithJump):
372 (JSC::ARMv7Assembler::maxJumpReplacementSize):
373 * assembler/MacroAssemblerARMv7.h:
374 (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):
376 2013-03-20 Mark Hahnenberg <mhahnenberg@apple.com>
378 Objective-C API: Fix over-releasing in allocateConstructorAndPrototypeWithSuperClassInfo:
379 https://bugs.webkit.org/show_bug.cgi?id=112832
381 Reviewed by Geoffrey Garen.
383 If either the m_constructor or m_prototype (but not both) is collected, we will call
384 allocateConstructorAndPrototypeWithSuperClassInfo, which will create a new object to replace the one
385 that was collected, but at the end of the method we call release on both of them.
386 This is incorrect since we autorelease the JSValue in the case that the object doesn't need to be
387 reallocated. Thus we'll end up overreleasing later during the drain of the autorelease pool.
389 * API/JSWrapperMap.mm:
390 (objectWithCustomBrand): We no longer alloc here. We instead call the JSValue valueWithValue class method,
391 which autoreleases for us.
392 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): We no longer call release on the
393 constructor or prototype JSValues.
394 * API/tests/testapi.mm: Added a new test that crashes on ToT due to over-releasing.
396 2013-03-19 Filip Pizlo <fpizlo@apple.com>
398 It's called "Hash Consing" not "Hash Consting"
399 https://bugs.webkit.org/show_bug.cgi?id=112768
401 Rubber stamped by Mark Hahnenberg.
403 See http://en.wikipedia.org/wiki/Hash_consing
405 * heap/GCThreadSharedData.cpp:
406 (JSC::GCThreadSharedData::GCThreadSharedData):
407 (JSC::GCThreadSharedData::reset):
408 * heap/GCThreadSharedData.h:
409 (GCThreadSharedData):
410 * heap/SlotVisitor.cpp:
411 (JSC::SlotVisitor::SlotVisitor):
412 (JSC::SlotVisitor::setup):
413 (JSC::SlotVisitor::reset):
414 (JSC::JSString::tryHashConsLock):
415 (JSC::JSString::releaseHashConsLock):
416 (JSC::JSString::shouldTryHashCons):
417 (JSC::SlotVisitor::internalAppend):
418 * heap/SlotVisitor.h:
420 * runtime/JSGlobalData.cpp:
421 (JSC::JSGlobalData::JSGlobalData):
422 * runtime/JSGlobalData.h:
424 (JSC::JSGlobalData::haveEnoughNewStringsToHashCons):
425 (JSC::JSGlobalData::resetNewStringsSinceLastHashCons):
426 * runtime/JSString.h:
427 (JSC::JSString::finishCreation):
429 (JSC::JSString::isHashConsSingleton):
430 (JSC::JSString::clearHashConsSingleton):
431 (JSC::JSString::setHashConsSingleton):
433 2013-03-20 Filip Pizlo <fpizlo@apple.com>
435 DFG implementation of op_strcat should inline rope allocations
436 https://bugs.webkit.org/show_bug.cgi?id=112780
438 Reviewed by Oliver Hunt.
440 This gets rid of the StrCat node and adds a MakeRope node. The MakeRope node can
441 take either two or three operands, and allocates a rope string with either two or
442 three fibers. (The magic choice of three children for non-VarArg nodes happens to
443 match exactly with the magic choice of three fibers for rope strings.)
445 ValueAdd on KnownString is replaced with MakeRope with two children.
447 StrCat gets replaced by an appropriate sequence of MakeRope's.
449 MakeRope does not do the dynamic check to see if its children are empty strings.
450 This is replaced by a static check, instead. The downside is that we may use more
451 memory if the strings passed to MakeRope turn out to dynamically be empty. The
452 upside is that we do fewer checks in the cases where either the strings are not
453 empty, or where the strings are statically known to be empty. I suspect both of
454 those cases are more common, than the case where the string is dynamically empty.
456 This also results in some badness for X86. MakeRope needs six registers if it is
457 allocating a three-rope. We don't have six registers to spare on X86. Currently,
458 the code side-steps this problem by just never usign three-ropes in optimized
459 code on X86. All other architectures, including X86_64, don't have this problem.
461 This is a shocking speed-up. 9% progressions on both V8/splay and
462 SunSpider/date-format-xparb. 1% progression on V8v7 overall, and ~0.5% progression
463 on SunSpider. 2x speed-up on microbenchmarks that test op_strcat.
465 * dfg/DFGAbstractState.cpp:
466 (JSC::DFG::AbstractState::executeEffects):
467 * dfg/DFGAdjacencyList.h:
469 (JSC::DFG::AdjacencyList::removeEdge):
470 * dfg/DFGArgumentsSimplificationPhase.cpp:
471 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
472 * dfg/DFGBackwardsPropagationPhase.cpp:
473 (JSC::DFG::BackwardsPropagationPhase::propagate):
474 * dfg/DFGByteCodeParser.cpp:
475 (JSC::DFG::ByteCodeParser::parseBlock):
476 * dfg/DFGCSEPhase.cpp:
477 (JSC::DFG::CSEPhase::putStructureStoreElimination):
478 (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
479 (JSC::DFG::CSEPhase::performNodeCSE):
480 * dfg/DFGDCEPhase.cpp:
481 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
482 * dfg/DFGFixupPhase.cpp:
483 (JSC::DFG::FixupPhase::fixupNode):
484 (JSC::DFG::FixupPhase::createToString):
485 (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
486 (JSC::DFG::FixupPhase::convertStringAddUse):
488 (JSC::DFG::FixupPhase::convertToMakeRope):
489 (JSC::DFG::FixupPhase::fixupMakeRope):
490 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
493 * dfg/DFGOperations.cpp:
494 * dfg/DFGOperations.h:
495 * dfg/DFGPredictionPropagationPhase.cpp:
496 (JSC::DFG::PredictionPropagationPhase::propagate):
497 * dfg/DFGSpeculativeJIT.cpp:
498 (JSC::DFG::SpeculativeJIT::compileAdd):
499 (JSC::DFG::SpeculativeJIT::compileMakeRope):
501 * dfg/DFGSpeculativeJIT.h:
502 (JSC::DFG::SpeculativeJIT::callOperation):
504 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
505 (JSC::DFG::SpeculateCellOperand::~SpeculateCellOperand):
506 (JSC::DFG::SpeculateCellOperand::gpr):
507 (JSC::DFG::SpeculateCellOperand::use):
508 * dfg/DFGSpeculativeJIT32_64.cpp:
509 (JSC::DFG::SpeculativeJIT::compile):
510 * dfg/DFGSpeculativeJIT64.cpp:
511 (JSC::DFG::SpeculativeJIT::compile):
512 * runtime/JSString.h:
515 2013-03-20 Peter Gal <galpeter@inf.u-szeged.hu>
517 Implement and32 on MIPS platform
518 https://bugs.webkit.org/show_bug.cgi?id=112665
520 Reviewed by Zoltan Herczeg.
522 * assembler/MacroAssemblerMIPS.h:
523 (JSC::MacroAssemblerMIPS::and32): Added missing method.
524 (MacroAssemblerMIPS):
526 2013-03-20 Mark Lam <mark.lam@apple.com>
528 Fix incorrect debugger column number value.
529 https://bugs.webkit.org/show_bug.cgi?id=112741.
531 Reviewed by Oliver Hunt.
533 1. In lexer, parser, and debugger code, renamed column to charPosition.
534 2. Convert the charPosition to the equivalent column number before
535 passing it to the debugger.
536 3. Changed ScopeNodes to take both a startLocation and an endLocation.
537 This allows FunctionBodyNodes, ProgramNodes, and EvalNodess to emit
538 correct debug hooks with correct starting line and column numbers.
539 4. Fixed the Lexer to not reset the charPosition (previously
540 columnNumber) in Lexer::lex().
542 * JavaScriptCore.order:
543 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
544 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
545 * bytecode/CodeBlock.cpp:
546 (JSC::CodeBlock::dumpBytecode):
547 * bytecompiler/BytecodeGenerator.cpp:
548 (JSC::BytecodeGenerator::emitDebugHook):
549 * bytecompiler/BytecodeGenerator.h:
550 (JSC::BytecodeGenerator::emitExpressionInfo):
551 * bytecompiler/NodesCodegen.cpp:
552 (JSC::ArrayNode::toArgumentList):
553 (JSC::ConstStatementNode::emitBytecode):
554 (JSC::EmptyStatementNode::emitBytecode):
555 (JSC::DebuggerStatementNode::emitBytecode):
556 (JSC::ExprStatementNode::emitBytecode):
557 (JSC::VarStatementNode::emitBytecode):
558 (JSC::IfNode::emitBytecode):
559 (JSC::IfElseNode::emitBytecode):
560 (JSC::DoWhileNode::emitBytecode):
561 (JSC::WhileNode::emitBytecode):
562 (JSC::ForNode::emitBytecode):
563 (JSC::ForInNode::emitBytecode):
564 (JSC::ContinueNode::emitBytecode):
565 (JSC::BreakNode::emitBytecode):
566 (JSC::ReturnNode::emitBytecode):
567 (JSC::WithNode::emitBytecode):
568 (JSC::SwitchNode::emitBytecode):
569 (JSC::LabelNode::emitBytecode):
570 (JSC::ThrowNode::emitBytecode):
571 (JSC::TryNode::emitBytecode):
572 (JSC::ProgramNode::emitBytecode):
573 (JSC::EvalNode::emitBytecode):
574 (JSC::FunctionBodyNode::emitBytecode):
575 * interpreter/Interpreter.cpp:
576 (JSC::Interpreter::debug):
577 - convert charPosition to column for the debugger.
578 * interpreter/Interpreter.h:
580 (DEFINE_STUB_FUNCTION(void, op_debug)):
581 * llint/LLIntSlowPaths.cpp:
582 (LLINT_SLOW_PATH_DECL(slow_op_debug)):
583 * parser/ASTBuilder.h:
584 (JSC::ASTBuilder::createFunctionExpr):
585 (JSC::ASTBuilder::createFunctionBody):
586 (JSC::ASTBuilder::createGetterOrSetterProperty):
587 (JSC::ASTBuilder::createFuncDeclStatement):
588 (JSC::ASTBuilder::createBlockStatement):
589 (JSC::ASTBuilder::createExprStatement):
590 (JSC::ASTBuilder::createIfStatement):
591 (JSC::ASTBuilder::createForLoop):
592 (JSC::ASTBuilder::createForInLoop):
593 (JSC::ASTBuilder::createVarStatement):
594 (JSC::ASTBuilder::createReturnStatement):
595 (JSC::ASTBuilder::createBreakStatement):
596 (JSC::ASTBuilder::createContinueStatement):
597 (JSC::ASTBuilder::createTryStatement):
598 (JSC::ASTBuilder::createSwitchStatement):
599 (JSC::ASTBuilder::createWhileStatement):
600 (JSC::ASTBuilder::createDoWhileStatement):
601 (JSC::ASTBuilder::createWithStatement):
602 (JSC::ASTBuilder::createThrowStatement):
603 (JSC::ASTBuilder::createDebugger):
604 (JSC::ASTBuilder::createConstStatement):
607 (JSC::::internalShift):
611 (JSC::Lexer::currentCharPosition):
613 (JSC::::lexExpectIdentifier):
614 * parser/NodeConstructors.h:
617 (JSC::StatementNode::setLoc):
618 (JSC::ScopeNode::ScopeNode):
619 (JSC::ProgramNode::ProgramNode):
620 (JSC::ProgramNode::create):
621 (JSC::EvalNode::EvalNode):
622 (JSC::EvalNode::create):
623 (JSC::FunctionBodyNode::FunctionBodyNode):
624 (JSC::FunctionBodyNode::create):
626 (JSC::Node::charPosition):
629 (JSC::StatementNode::lastLine):
631 (JSC::ScopeNode::startLine):
632 (JSC::ScopeNode::startCharPosition):
638 (JSC::::parseFunctionBody):
639 (JSC::::parseFunctionInfo):
642 * parser/ParserTokens.h:
643 (JSC::JSTokenLocation::JSTokenLocation):
645 * parser/SyntaxChecker.h:
646 (JSC::SyntaxChecker::createFunctionBody):
648 2013-03-20 Csaba Osztrogonác <ossy@webkit.org>
650 REGRESSION(r146089): It broke 20 sputnik tests on ARM traditional and Thumb2
651 https://bugs.webkit.org/show_bug.cgi?id=112676
653 Rubber-stamped by Filip Pizlo.
655 Add one more EABI_32BIT_DUMMY_ARG to make DFG JIT ARM EABI compatible
656 again after r146089 similar to https://bugs.webkit.org/show_bug.cgi?id=84449
658 * dfg/DFGSpeculativeJIT.h:
659 (JSC::DFG::SpeculativeJIT::callOperation):
661 2013-03-19 Michael Saboff <msaboff@apple.com>
663 Crash when loading http://www.jqchart.com/jquery/gauges/RadialGauge/LiveData
664 https://bugs.webkit.org/show_bug.cgi?id=112694
666 Reviewed by Filip Pizlo.
668 We were trying to convert an NewArray to a Phantom, but convertToPhantom doesn't handle
669 nodes with variable arguments. Added code to insert a Phantom node in front of all the
670 live children of a var args node. Added ASSERT not var args for convertToPhantom to
671 catch any other similar cases. Added a new convertToPhantomUnchecked() for converting
674 * dfg/DFGDCEPhase.cpp:
675 (JSC::DFG::DCEPhase::run):
678 (JSC::DFG::Node::setOpAndDefaultNonExitFlags): Added ASSERT(!(m_flags & NodeHasVarArgs))
679 (JSC::DFG::Node::setOpAndDefaultNonExitFlagsUnchecked):
680 (JSC::DFG::Node::convertToPhantomUnchecked):
682 2013-03-19 Mark Hahnenberg <mhahnenberg@apple.com>
684 Crash in SpeculativeJIT::fillSpeculateIntInternal<false> on http://bellard.org/jslinux
685 https://bugs.webkit.org/show_bug.cgi?id=112738
687 Reviewed by Filip Pizlo.
689 * dfg/DFGFixupPhase.cpp:
690 (JSC::DFG::FixupPhase::fixIntEdge): We shouldn't be killing this node because it could be
691 referenced by other people.
693 2013-03-19 Oliver Hunt <oliver@apple.com>
695 RELEASE_ASSERT fires in exception handler lookup
699 Temporarily switch this RELEASE_ASSERT into a regular ASSERT
700 as currently this is producing fairly bad crashiness.
702 * bytecode/CodeBlock.cpp:
703 (JSC::CodeBlock::handlerForBytecodeOffset):
705 2013-03-18 Filip Pizlo <fpizlo@apple.com>
707 DFG should optimize StringObject.length and StringOrStringObject.length
708 https://bugs.webkit.org/show_bug.cgi?id=112658
710 Reviewed by Mark Hahnenberg.
712 Implemented by injecting a ToString(StringObject:@a) or ToString(StringOrStringObject:@a) prior
713 to GetArrayLength with ArrayMode(Array::String) if @a is predicted StringObject or
714 StringOrStringObject.
716 * dfg/DFGFixupPhase.cpp:
717 (JSC::DFG::FixupPhase::fixupNode):
718 (JSC::DFG::FixupPhase::createToString):
720 (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
721 (JSC::DFG::FixupPhase::convertStringAddUse):
723 2013-03-19 Gabor Rapcsanyi <rgabor@webkit.org>
725 Implement and32 on ARMv7 and ARM traditional platforms
726 https://bugs.webkit.org/show_bug.cgi?id=112663
728 Reviewed by Zoltan Herczeg.
730 * assembler/MacroAssemblerARM.h:
731 (JSC::MacroAssemblerARM::and32): Add missing method.
733 * assembler/MacroAssemblerARMv7.h:
734 (JSC::MacroAssemblerARMv7::and32): Add missing method.
735 (MacroAssemblerARMv7):
737 2013-03-18 Filip Pizlo <fpizlo@apple.com>
739 DFG ToString generic cases should work correctly
740 https://bugs.webkit.org/show_bug.cgi?id=112654
741 <rdar://problem/13447250>
743 Reviewed by Geoffrey Garen.
745 * dfg/DFGSpeculativeJIT.cpp:
746 (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
747 * dfg/DFGSpeculativeJIT32_64.cpp:
748 (JSC::DFG::SpeculativeJIT::compile):
749 * dfg/DFGSpeculativeJIT64.cpp:
750 (JSC::DFG::SpeculativeJIT::compile):
752 2013-03-18 Michael Saboff <msaboff@apple.com>
754 Unreviewed build fix for 32 bit builds.
756 * dfg/DFGSpeculativeJIT32_64.cpp:
757 (JSC::DFG::SpeculativeJIT::compile):
759 2013-03-18 Michael Saboff <msaboff@apple.com>
761 EFL: Unsafe branch detected in compilePutByValForFloatTypedArray()
762 https://bugs.webkit.org/show_bug.cgi?id=112609
764 Reviewed by Geoffrey Garen.
766 Created local valueFPR and scratchFPR and filled them with valueOp.fpr() and scratch.fpr()
767 respectively so that if valueOp.fpr() causes a spill during allocation, it occurs before the
768 branch and also to follow convention. Added register allocation checks to FPRTemporary.
769 Cleaned up a couple of other places to follow the "AllocatVirtualRegType foo, get machine
770 reg from foo" pattern.
772 * dfg/DFGSpeculativeJIT.cpp:
773 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
774 * dfg/DFGSpeculativeJIT.h:
775 (JSC::DFG::SpeculativeJIT::fprAllocate):
776 * dfg/DFGSpeculativeJIT32_64.cpp:
777 (JSC::DFG::SpeculativeJIT::convertToDouble):
778 (JSC::DFG::SpeculativeJIT::compile):
779 * dfg/DFGSpeculativeJIT64.cpp:
780 (JSC::DFG::SpeculativeJIT::compile):
782 2013-03-18 Filip Pizlo <fpizlo@apple.com>
784 DFG should inline binary string concatenations (i.e. ValueAdd with string children)
785 https://bugs.webkit.org/show_bug.cgi?id=112599
787 Reviewed by Oliver Hunt.
789 This does as advertised: if you do x + y where x and y are strings, you'll get
790 a fast inlined JSRopeString allocation (along with whatever checks are necessary).
791 It also does good things if either x or y (or both) are StringObjects, or some
792 other thing like StringOrStringObject. It also lays the groundwork for making this
793 fast if either x or y are numbers, or some other reasonably-cheap-to-convert
796 * dfg/DFGAbstractState.cpp:
797 (JSC::DFG::AbstractState::executeEffects):
798 * dfg/DFGFixupPhase.cpp:
799 (JSC::DFG::FixupPhase::fixupNode):
801 (JSC::DFG::FixupPhase::isStringObjectUse):
802 (JSC::DFG::FixupPhase::convertStringAddUse):
803 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
804 * dfg/DFGOperations.cpp:
805 * dfg/DFGOperations.h:
806 * dfg/DFGSpeculativeJIT.cpp:
807 (JSC::DFG::SpeculativeJIT::compileAdd):
808 * dfg/DFGSpeculativeJIT.h:
809 (JSC::DFG::SpeculativeJIT::callOperation):
811 (JSC::DFG::SpeculativeJIT::emitAllocateJSCell):
812 (JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
813 * runtime/JSString.h:
814 (JSC::JSString::offsetOfFlags):
817 (JSC::JSRopeString::offsetOfFibers):
819 2013-03-18 Filip Pizlo <fpizlo@apple.com>
821 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
822 https://bugs.webkit.org/show_bug.cgi?id=112639
824 Reviewed by Michael Saboff.
826 Change it to take a string instead.
828 * runtime/JSObject.h:
830 * runtime/ObjectPrototype.cpp:
831 (JSC::ObjectPrototype::finishCreation):
832 * runtime/StringPrototype.cpp:
833 (JSC::StringPrototype::finishCreation):
835 2013-03-18 Brent Fulgham <bfulgham@webkit.org>
837 [WinCairo] Get build working under VS2010.
838 https://bugs.webkit.org/show_bug.cgi?id=112604
840 Reviewed by Tim Horton.
842 * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Use CFLite-specific
843 build target (standard version links against CoreFoundation.lib
844 instead of CFLite.lib).
845 * JavaScriptCore.vcxproj/testapi/testapiCommonCFLite.props: Added.
846 * JavaScriptCore.vcxproj/testapi/testapiDebugCFLite.props: Added.
847 * JavaScriptCore.vcxproj/testapi/testapiReleaseCFLite.props: Added.
849 2013-03-18 Roger Fong <roger_fong@apple.com>
851 AppleWin VS2010 Debug configuration build fix..
853 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
855 2013-03-18 Brent Fulgham <bfulgham@webkit.org>
857 [WinCairo] Get build working under VS2010.
858 https://bugs.webkit.org/show_bug.cgi?id=112604
860 Reviewed by Tim Horton.
862 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Add build targets for
863 Debug_WinCairo and Release_WinCairo using CFLite.
864 * JavaScriptCore.vcxproj/JavaScriptCoreCFLite.props: Added.
865 * JavaScriptCore.vcxproj/JavaScriptCoreDebugCFLite.props: Added.
866 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj:
867 Add Debug_WinCairo and Release_WinCairo build targets to
868 make sure headers are copied to proper build folder.
869 * JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj: Ditto.
870 * JavaScriptCore.vcxproj/JavaScriptCoreReleaseCFLite.props: Added.
871 * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj:
872 Add Debug_WinCairo and Release_WinCairo build targets to
873 make sure headers are copied to proper build folder.
874 * JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj:
876 * JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcxproj:
878 * JavaScriptCore.vcxproj/jsc/jsc.vcxproj: Ditto.
879 * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj: Ditto.
880 * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Ditto.
882 2013-03-18 Michael Saboff <msaboff@apple.com>
884 Potentially unsafe register allocations in DFG code generation
885 https://bugs.webkit.org/show_bug.cgi?id=112477
887 Reviewed by Geoffrey Garen.
889 Moved allocation of temporary GPRs to be before any generated branches in the functions below.
891 * dfg/DFGSpeculativeJIT32_64.cpp:
892 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
893 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
894 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
895 * dfg/DFGSpeculativeJIT64.cpp:
896 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
897 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
898 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
900 2013-03-15 Filip Pizlo <fpizlo@apple.com>
902 DFG string conversions and allocations should be inlined
903 https://bugs.webkit.org/show_bug.cgi?id=112376
905 Reviewed by Geoffrey Garen.
907 This turns new String(), String(), String.prototype.valueOf(), and
908 String.prototype.toString() into intrinsics. It gives the DFG the ability to handle
909 conversions from StringObject to JSString and vice-versa, and also gives it the
910 ability to handle cases where a variable may be either a StringObject or a JSString.
911 To do this, I added StringObject to value profiling (and removed the stale
912 distinction between Myarguments and Foreignarguments). I also cleaned up ToPrimitive
913 handling, using some of the new functionality but also taking advantage of the
914 existence of Identity(String:@a).
916 This is a 2% SunSpider speed-up. Also there are some speed-ups on V8v7 and Kraken.
917 On microbenchmarks that stress new String() this is a 14x speed-up.
920 * DerivedSources.make:
921 * DerivedSources.pri:
922 * GNUmakefile.list.am:
923 * bytecode/CodeBlock.h:
925 (JSC::CodeBlock::hasExitSite):
927 * bytecode/DFGExitProfile.cpp:
928 (JSC::DFG::ExitProfile::hasExitSite):
930 * bytecode/DFGExitProfile.h:
932 (JSC::DFG::ExitProfile::hasExitSite):
933 * bytecode/ExitKind.cpp:
934 (JSC::exitKindToString):
935 * bytecode/ExitKind.h:
936 * bytecode/SpeculatedType.cpp:
937 (JSC::dumpSpeculation):
938 (JSC::speculationToAbbreviatedString):
939 (JSC::speculationFromClassInfo):
940 * bytecode/SpeculatedType.h:
942 (JSC::isStringObjectSpeculation):
943 (JSC::isStringOrStringObjectSpeculation):
945 * dfg/DFGAbstractState.cpp:
946 (JSC::DFG::AbstractState::executeEffects):
947 * dfg/DFGAbstractState.h:
948 (JSC::DFG::AbstractState::filterEdgeByUse):
949 * dfg/DFGByteCodeParser.cpp:
951 (JSC::DFG::ByteCodeParser::handleCall):
952 (JSC::DFG::ByteCodeParser::emitArgumentPhantoms):
954 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
955 * dfg/DFGCSEPhase.cpp:
956 (JSC::DFG::CSEPhase::putStructureStoreElimination):
958 (JSC::DFG::Edge::shift):
959 * dfg/DFGFixupPhase.cpp:
960 (JSC::DFG::FixupPhase::fixupNode):
961 (JSC::DFG::FixupPhase::isStringPrototypeMethodSane):
963 (JSC::DFG::FixupPhase::canOptimizeStringObjectAccess):
964 (JSC::DFG::FixupPhase::observeUseKindOnNode):
966 (JSC::DFG::Graph::hasGlobalExitSite):
968 (JSC::DFG::Graph::hasExitSite):
969 (JSC::DFG::Graph::clobbersWorld):
971 (JSC::DFG::Node::convertToToString):
973 (JSC::DFG::Node::hasStructure):
974 (JSC::DFG::Node::shouldSpeculateStringObject):
975 (JSC::DFG::Node::shouldSpeculateStringOrStringObject):
978 * dfg/DFGOperations.cpp:
979 * dfg/DFGOperations.h:
980 * dfg/DFGPredictionPropagationPhase.cpp:
981 (JSC::DFG::PredictionPropagationPhase::propagate):
982 * dfg/DFGSpeculativeJIT.cpp:
983 (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
985 (JSC::DFG::SpeculativeJIT::compileNewStringObject):
986 (JSC::DFG::SpeculativeJIT::speculateObject):
987 (JSC::DFG::SpeculativeJIT::speculateObjectOrOther):
988 (JSC::DFG::SpeculativeJIT::speculateString):
989 (JSC::DFG::SpeculativeJIT::speculateStringObject):
990 (JSC::DFG::SpeculativeJIT::speculateStringOrStringObject):
991 (JSC::DFG::SpeculativeJIT::speculate):
992 * dfg/DFGSpeculativeJIT.h:
993 (JSC::DFG::SpeculativeJIT::callOperation):
995 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
997 (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure):
998 * dfg/DFGSpeculativeJIT32_64.cpp:
999 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1000 (JSC::DFG::SpeculativeJIT::compile):
1001 * dfg/DFGSpeculativeJIT64.cpp:
1002 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1003 (JSC::DFG::SpeculativeJIT::compile):
1004 * dfg/DFGUseKind.cpp:
1005 (WTF::printInternal):
1007 (JSC::DFG::typeFilterFor):
1008 * interpreter/CallFrame.h:
1009 (JSC::ExecState::regExpPrototypeTable):
1010 * runtime/CommonIdentifiers.h:
1011 * runtime/Intrinsic.h:
1012 * runtime/JSDestructibleObject.h:
1013 (JSDestructibleObject):
1014 (JSC::JSDestructibleObject::classInfoOffset):
1015 * runtime/JSGlobalData.cpp:
1017 (JSC::JSGlobalData::JSGlobalData):
1018 (JSC::JSGlobalData::~JSGlobalData):
1019 * runtime/JSGlobalData.h:
1021 * runtime/JSObject.cpp:
1022 * runtime/JSObject.h:
1024 * runtime/JSWrapperObject.h:
1025 (JSC::JSWrapperObject::allocationSize):
1027 (JSC::JSWrapperObject::internalValueOffset):
1028 (JSC::JSWrapperObject::internalValueCellOffset):
1029 * runtime/StringPrototype.cpp:
1031 (JSC::StringPrototype::finishCreation):
1032 (JSC::StringPrototype::create):
1033 * runtime/StringPrototype.h:
1036 2013-03-18 Filip Pizlo <fpizlo@apple.com>
1038 ObjectPrototype properties should be eagerly created rather than lazily via static tables
1039 https://bugs.webkit.org/show_bug.cgi?id=112539
1041 Reviewed by Oliver Hunt.
1043 This is the first part of https://bugs.webkit.org/show_bug.cgi?id=112233. Rolling this
1044 in first since it's the less-likely-to-be-broken part.
1047 * DerivedSources.make:
1048 * DerivedSources.pri:
1049 * GNUmakefile.list.am:
1050 * interpreter/CallFrame.h:
1051 (JSC::ExecState::objectConstructorTable):
1052 * runtime/CommonIdentifiers.h:
1053 * runtime/JSGlobalData.cpp:
1055 (JSC::JSGlobalData::JSGlobalData):
1056 (JSC::JSGlobalData::~JSGlobalData):
1057 * runtime/JSGlobalData.h:
1059 * runtime/JSObject.cpp:
1060 (JSC::JSObject::putDirectNativeFunction):
1062 * runtime/JSObject.h:
1065 * runtime/Lookup.cpp:
1066 (JSC::setUpStaticFunctionSlot):
1067 * runtime/ObjectPrototype.cpp:
1069 (JSC::ObjectPrototype::finishCreation):
1070 (JSC::ObjectPrototype::create):
1071 * runtime/ObjectPrototype.h:
1074 2013-03-16 Pratik Solanki <psolanki@apple.com>
1076 Disable High DPI Canvas on iOS
1077 https://bugs.webkit.org/show_bug.cgi?id=112511
1079 Reviewed by Joseph Pecoraro.
1081 * Configurations/FeatureDefines.xcconfig:
1083 2013-03-15 Andreas Kling <akling@apple.com>
1085 Don't also clone StructureRareData when cloning Structure.
1086 <http://webkit.org/b/111672>
1088 Reviewed by Mark Hahnenberg.
1090 We were cloning a lot of StructureRareData with only the previousID pointer set since
1091 the enumerationCache is not shared between clones.
1093 Let the Structure copy constructor decide whether it wants to clone the rare data.
1094 The decision is made by StructureRareData::needsCloning() and will currently always
1095 return false, since StructureRareData only holds on to caches at present.
1096 This may change in the future as more members are added to StructureRareData.
1098 * runtime/Structure.cpp:
1099 (JSC::Structure::Structure):
1100 (JSC::Structure::cloneRareDataFrom):
1101 * runtime/StructureInlines.h:
1102 (JSC::Structure::create):
1104 2013-03-15 Mark Hahnenberg <mhahnenberg@apple.com>
1107 https://bugs.webkit.org/show_bug.cgi?id=112458
1109 Unreviewed. Requested by Filip Pizlo.
1112 * DerivedSources.make:
1113 * DerivedSources.pri:
1114 * GNUmakefile.list.am:
1115 * dfg/DFGOperations.cpp:
1116 * interpreter/CallFrame.h:
1117 (JSC::ExecState::objectPrototypeTable):
1120 * llint/LLIntSlowPaths.cpp:
1121 (JSC::LLInt::getByVal):
1122 * runtime/CommonIdentifiers.h:
1123 * runtime/JSCell.cpp:
1127 * runtime/JSCellInlines.h:
1129 (JSC::JSCell::fastGetOwnProperty):
1130 * runtime/JSGlobalData.cpp:
1132 (JSC::JSGlobalData::JSGlobalData):
1133 (JSC::JSGlobalData::~JSGlobalData):
1134 * runtime/JSGlobalData.h:
1136 * runtime/JSObject.cpp:
1138 * runtime/JSObject.h:
1141 * runtime/Lookup.cpp:
1142 (JSC::setUpStaticFunctionSlot):
1143 * runtime/ObjectPrototype.cpp:
1145 (JSC::ObjectPrototype::finishCreation):
1146 (JSC::ObjectPrototype::getOwnPropertySlot):
1147 (JSC::ObjectPrototype::getOwnPropertyDescriptor):
1148 * runtime/ObjectPrototype.h:
1149 (JSC::ObjectPrototype::create):
1151 * runtime/PropertyMapHashTable.h:
1152 (JSC::PropertyTable::findWithString):
1153 * runtime/Structure.h:
1155 * runtime/StructureInlines.h:
1156 (JSC::Structure::get):
1158 2013-03-15 Michael Saboff <msaboff@apple.com>
1160 Cleanup of DFG and Baseline JIT debugging code
1161 https://bugs.webkit.org/show_bug.cgi?id=111871
1163 Reviewed by Geoffrey Garen.
1165 Fixed various debug related issue in baseline and DFG JITs. See below.
1167 * dfg/DFGRepatch.cpp:
1168 (JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1169 * dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
1170 pointer to scratch register length.
1171 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
1172 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
1173 * dfg/DFGSpeculativeJIT.cpp:
1174 (JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
1175 DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
1177 (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1178 * jit/JITCall32_64.cpp:
1179 (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1180 * runtime/JSGlobalData.h:
1181 (JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
1182 be on a double boundary.
1183 (JSC::ScratchBuffer::setActiveLength):
1184 (JSC::ScratchBuffer::activeLength):
1185 (JSC::ScratchBuffer::activeLengthPtr):
1187 2013-03-15 Michael Saboff <msaboff@apple.com>
1189 Add runtime check for improper register allocations in DFG
1190 https://bugs.webkit.org/show_bug.cgi?id=112380
1192 Reviewed by Geoffrey Garen.
1194 Added framework to check for register allocation within a branch source - target range. All register allocations
1195 are saved using the offset in the code stream where the allocation occurred. Later when a jump is linked, the
1196 currently saved register allocations are checked to make sure that they didn't occur in the range of code that was
1197 jumped over. This protects against the case where an allocation could have spilled register contents to free up
1198 a register and that spill only occurs on one path of a many through the code. A subsequent fill of the spilled
1199 register may load garbage. See https://bugs.webkit.org/show_bug.cgi?id=111777 for one such bug.
1200 This code is protected by the compile time check of #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION).
1201 The check is only done during the processing of SpeculativeJIT::compile(Node* node) and its callees.
1203 * assembler/AbstractMacroAssembler.h:
1204 (JSC::AbstractMacroAssembler::Jump::link): Invoke register allocation checks using source and target of link.
1205 (JSC::AbstractMacroAssembler::Jump::linkTo): Invoke register allocation checks using source and target of link.
1206 (AbstractMacroAssembler):
1207 (RegisterAllocationOffset): New helper class to store the instruction stream offset and compare against a
1209 (JSC::AbstractMacroAssembler::RegisterAllocationOffset::RegisterAllocationOffset):
1210 (JSC::AbstractMacroAssembler::RegisterAllocationOffset::check):
1211 (JSC::AbstractMacroAssembler::addRegisterAllocationAtOffset):
1212 (JSC::AbstractMacroAssembler::clearRegisterAllocationOffsets):
1213 (JSC::AbstractMacroAssembler::checkRegisterAllocationAgainstBranchRange):
1214 * dfg/DFGSpeculativeJIT.h:
1215 (JSC::DFG::SpeculativeJIT::allocate):
1216 * dfg/DFGSpeculativeJIT32_64.cpp:
1217 (JSC::DFG::SpeculativeJIT::compile):
1218 * dfg/DFGSpeculativeJIT64.cpp:
1219 (JSC::DFG::SpeculativeJIT::compile):
1221 2013-03-14 Oliver Hunt <oliver@apple.com>
1223 REGRESSION(r145000): Crash loading arstechnica.com when Safari Web Inspector is open
1224 https://bugs.webkit.org/show_bug.cgi?id=111868
1226 Reviewed by Antti Koivisto.
1228 Don't allow non-local property lookup when the debugger is enabled.
1230 * bytecompiler/BytecodeGenerator.cpp:
1231 (JSC::BytecodeGenerator::resolve):
1233 2013-03-11 Mark Hahnenberg <mhahnenberg@apple.com>
1235 Objective-C API: Objective-C functions exposed to JavaScript have the wrong type (object instead of function)
1236 https://bugs.webkit.org/show_bug.cgi?id=105892
1238 Reviewed by Geoffrey Garen.
1240 Changed ObjCCallbackFunction to subclass JSCallbackFunction which already has all of the machinery to call
1241 functions using the C API. Since ObjCCallbackFunction is now a JSCell, we changed the old implementation of
1242 ObjCCallbackFunction to be the internal implementation and keep track of all the proper data so that we
1243 don't have to put all of that in the header, which will now be included from C++ files (e.g. JSGlobalObject.cpp).
1245 * API/JSCallbackFunction.cpp: Change JSCallbackFunction to allow subclassing. Originally it was internally
1246 passing its own Structure up the chain of constructors, but we now want to be able to pass other Structures as well.
1247 (JSC::JSCallbackFunction::JSCallbackFunction):
1248 (JSC::JSCallbackFunction::create):
1249 * API/JSCallbackFunction.h:
1250 (JSCallbackFunction):
1251 * API/JSWrapperMap.mm: Changed interface to tryUnwrapBlock.
1252 (tryUnwrapObjcObject):
1253 * API/ObjCCallbackFunction.h:
1254 (ObjCCallbackFunction): Moved into the JSC namespace, just like JSCallbackFunction.
1255 (JSC::ObjCCallbackFunction::createStructure): Overridden so that the correct ClassInfo gets used since we have
1257 (JSC::ObjCCallbackFunction::impl): Getter for the internal impl.
1258 * API/ObjCCallbackFunction.mm:
1259 (JSC::ObjCCallbackFunctionImpl::ObjCCallbackFunctionImpl): What used to be ObjCCallbackFunction is now
1260 ObjCCallbackFunctionImpl. It handles the Objective-C specific parts of managing callback functions.
1261 (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl):
1262 (JSC::objCCallbackFunctionCallAsFunction): Same as the old one, but now it casts to ObjCCallbackFunction and grabs the impl
1263 rather than using JSObjectGetPrivate.
1264 (JSC::ObjCCallbackFunction::ObjCCallbackFunction): New bits to allow being part of the JSCell hierarchy.
1265 (JSC::ObjCCallbackFunction::create):
1266 (JSC::ObjCCallbackFunction::destroy):
1267 (JSC::ObjCCallbackFunctionImpl::call): Handles the actual invocation, just like it used to.
1268 (objCCallbackFunctionForInvocation):
1269 (tryUnwrapBlock): Changed to check the ClassInfo for inheritance directly, rather than going through the C API call.
1270 * API/tests/testapi.mm: Added new test to make sure that doing Function.prototype.toString.call(f) won't result in
1271 an error when f is an Objective-C method or block underneath the covers.
1272 * runtime/JSGlobalObject.cpp: Added new Structure for ObjCCallbackFunction.
1273 (JSC::JSGlobalObject::reset):
1274 (JSC::JSGlobalObject::visitChildren):
1275 * runtime/JSGlobalObject.h:
1277 (JSC::JSGlobalObject::objcCallbackFunctionStructure):
1279 2013-03-14 Mark Hahnenberg <mhahnenberg@apple.com>
1281 Objective-C API: Nested dictionaries are not converted properly in the Objective-C binding
1282 https://bugs.webkit.org/show_bug.cgi?id=112377
1284 Reviewed by Oliver Hunt.
1286 Accidental reassignment of the root task in the container conversion logic was causing the last
1287 array or dictionary processed to be returned in the case of nested containers.
1290 (containerValueToObject):
1291 * API/tests/testapi.mm:
1293 2013-03-13 Filip Pizlo <fpizlo@apple.com>
1295 JSObject fast by-string access optimizations should work even on the prototype chain, and even when the result is undefined
1296 https://bugs.webkit.org/show_bug.cgi?id=112233
1298 Reviewed by Oliver Hunt.
1300 Extended the existing fast access path for String keys to work over the entire prototype chain,
1301 not just the self access case. This will fail as soon as it sees an object that intercepts
1302 getOwnPropertySlot, so this patch also ensures that ObjectPrototype does not fall into that
1303 category. This is accomplished by making ObjectPrototype eagerly reify all of its properties.
1304 This is safe for ObjectPrototype because it's so common and we expect all of its properties to
1305 be reified for any interesting programs anyway. A new idiom for adding native functions to
1306 prototypes is introduced, which ought to work well for any other prototypes that we wish to do
1307 this conversion for.
1309 This is a >60% speed-up in the case that you frequently do by-string lookups that "miss", i.e.
1310 they don't turn up anything.
1313 * DerivedSources.make:
1314 * DerivedSources.pri:
1315 * GNUmakefile.list.am:
1316 * dfg/DFGOperations.cpp:
1317 * interpreter/CallFrame.h:
1318 (JSC::ExecState::objectConstructorTable):
1321 * llint/LLIntSlowPaths.cpp:
1322 (JSC::LLInt::getByVal):
1323 * runtime/CommonIdentifiers.h:
1324 * runtime/JSCell.cpp:
1325 (JSC::JSCell::getByStringSlow):
1329 * runtime/JSCellInlines.h:
1331 (JSC::JSCell::getByStringAndKey):
1332 (JSC::JSCell::getByString):
1333 * runtime/JSGlobalData.cpp:
1335 (JSC::JSGlobalData::JSGlobalData):
1336 (JSC::JSGlobalData::~JSGlobalData):
1337 * runtime/JSGlobalData.h:
1339 * runtime/JSObject.cpp:
1340 (JSC::JSObject::putDirectNativeFunction):
1342 * runtime/JSObject.h:
1345 * runtime/Lookup.cpp:
1346 (JSC::setUpStaticFunctionSlot):
1347 * runtime/ObjectPrototype.cpp:
1349 (JSC::ObjectPrototype::finishCreation):
1350 (JSC::ObjectPrototype::create):
1351 * runtime/ObjectPrototype.h:
1353 * runtime/PropertyMapHashTable.h:
1354 (JSC::PropertyTable::findWithString):
1355 * runtime/Structure.h:
1357 * runtime/StructureInlines.h:
1358 (JSC::Structure::get):
1361 2013-03-13 Filip Pizlo <fpizlo@apple.com>
1363 DFG bytecode parser is too aggressive about getting rid of GetLocals on captured variables
1364 https://bugs.webkit.org/show_bug.cgi?id=112287
1365 <rdar://problem/13342340>
1367 Reviewed by Oliver Hunt.
1369 * bytecode/CodeBlock.cpp:
1370 (JSC::CodeBlock::dumpBytecode):
1371 (JSC::CodeBlock::finalizeUnconditionally):
1372 * dfg/DFGByteCodeParser.cpp:
1373 (JSC::DFG::ByteCodeParser::getLocal):
1375 2013-03-13 Ryosuke Niwa <rniwa@webkit.org>
1377 Threaded HTML Parser is missing feature define flags in all but Chromium port's build files
1378 https://bugs.webkit.org/show_bug.cgi?id=112277
1380 Reviewed by Adam Barth.
1382 * Configurations/FeatureDefines.xcconfig:
1384 2013-03-13 Csaba Osztrogonác <ossy@webkit.org>
1386 LLINT C loop warning fix for GCC
1387 https://bugs.webkit.org/show_bug.cgi?id=112145
1389 Reviewed by Filip Pizlo.
1391 * llint/LowLevelInterpreter.cpp:
1392 (JSC::CLoop::execute):
1394 2013-02-13 Simon Hausmann <simon.hausmann@digia.com>
1396 Add support for convenient conversion from JSStringRef to QString
1397 https://bugs.webkit.org/show_bug.cgi?id=109694
1399 Reviewed by Allan Sandfeld Jensen.
1401 Add JSStringCopyQString helper function that allows for the convenient
1402 extraction of a QString out of a JSStringRef.
1404 * API/JSStringRefQt.cpp: Added.
1405 (JSStringCopyQString):
1406 * API/JSStringRefQt.h: Added.
1407 * API/OpaqueJSString.h:
1409 (OpaqueJSString::qString):
1410 (OpaqueJSString::OpaqueJSString):
1413 2013-03-13 Peter Gal <galpeter@inf.u-szeged.hu>
1415 Token 'not' is ignored in the offlineasm.
1416 https://bugs.webkit.org/show_bug.cgi?id=111568
1418 Reviewed by Filip Pizlo.
1420 * offlineasm/parser.rb: Build the Not AST node if the 'not' token is found.
1422 2013-03-12 Tim Horton <timothy_horton@apple.com>
1424 WTF uses macros for exports. Try to fix the Windows build. Unreviewed.
1426 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
1427 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
1429 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1431 Array.prototype.sort should at least try to be PTIME even when the array is in some bizarre mode
1432 https://bugs.webkit.org/show_bug.cgi?id=112187
1433 <rdar://problem/13393550>
1435 Reviewed by Michael Saboff and Gavin Barraclough.
1437 If we have an array-like object in crazy mode passed into Array.prototype.sort, and its length is large,
1438 then first copy all elements into a separate, compact, un-holy array and sort that. Then copy back.
1439 This means that sorting will be at worst O(n^2) in the actual number of things in the array, rather than
1440 O(n^2) in the array's length.
1442 * runtime/ArrayPrototype.cpp:
1443 (JSC::attemptFastSort):
1444 (JSC::performSlowSort):
1446 (JSC::arrayProtoFuncSort):
1448 2013-03-12 Tim Horton <timothy_horton@apple.com>
1450 Try to fix the Windows build.
1454 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
1456 2013-03-12 Geoffrey Garen <ggaren@apple.com>
1458 Try to fix the Windows build.
1462 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
1465 2013-03-11 Oliver Hunt <oliver@apple.com>
1467 Harden JSStringJoiner
1468 https://bugs.webkit.org/show_bug.cgi?id=112093
1470 Reviewed by Filip Pizlo.
1472 Harden JSStringJoiner, make it use our CheckedArithmetic
1473 class to simplify everything.
1475 * runtime/JSStringJoiner.cpp:
1476 (JSC::JSStringJoiner::build):
1477 * runtime/JSStringJoiner.h:
1479 (JSC::JSStringJoiner::JSStringJoiner):
1480 (JSC::JSStringJoiner::append):
1482 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1484 DFG generic array access cases should not be guarded by CheckStructure even of the profiling tells us that it could be
1485 https://bugs.webkit.org/show_bug.cgi?id=112183
1487 Reviewed by Oliver Hunt.
1489 Slight speed-up on string-unpack-code.
1491 * dfg/DFGFixupPhase.cpp:
1492 (JSC::DFG::FixupPhase::findAndRemoveUnnecessaryStructureCheck):
1494 (JSC::DFG::FixupPhase::checkArray):
1495 (JSC::DFG::FixupPhase::blessArrayOperation):
1497 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1499 https://bugs.webkit.org/show_bug.cgi?id=112141
1500 LLInt CLoop backend misses Double2Ints() on 32bit architectures
1502 Reviewed by Filip Pizlo.
1504 Implement Double2Ints() in CLoop backend of LLInt on 32bit architectures.
1506 * llint/LowLevelInterpreter.cpp:
1508 (JSC::LLInt::Double2Ints):
1509 * offlineasm/cloop.rb:
1511 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1513 Making more sophisticated cache flush on ARM Linux platform
1514 https://bugs.webkit.org/show_bug.cgi?id=111854
1516 Reviewed by Zoltan Herczeg.
1518 The cache flush on ARM Linux invalidates whole pages
1519 instead of just the required area.
1521 * assembler/ARMAssembler.h:
1523 (JSC::ARMAssembler::linuxPageFlush):
1524 (JSC::ARMAssembler::cacheFlush):
1525 * assembler/ARMv7Assembler.h:
1527 (JSC::ARMv7Assembler::linuxPageFlush):
1528 (JSC::ARMv7Assembler::cacheFlush):
1530 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1532 Renaming the armv7.rb LLINT backend to arm.rb
1533 https://bugs.webkit.org/show_bug.cgi?id=110565
1535 Reviewed by Zoltan Herczeg.
1537 This is the first step of a unified ARM backend for
1538 all ARM 32 bit architectures in LLInt.
1541 * GNUmakefile.list.am:
1542 * JavaScriptCore.gypi:
1543 * LLIntOffsetsExtractor.pro:
1544 * offlineasm/arm.rb: Copied from Source/JavaScriptCore/offlineasm/armv7.rb.
1545 * offlineasm/armv7.rb: Removed.
1546 * offlineasm/backends.rb:
1547 * offlineasm/risc.rb:
1549 2013-03-12 Csaba Osztrogonác <ossy@webkit.org>
1551 REGRESSION(r145482): It broke 33 jsc tests and zillion layout tests on all platform
1552 https://bugs.webkit.org/show_bug.cgi?id=112112
1554 Reviewed by Oliver Hunt.
1556 Rolling out https://trac.webkit.org/changeset/145482 to unbreak the bots.
1558 * runtime/JSStringJoiner.cpp:
1559 (JSC::JSStringJoiner::build):
1560 * runtime/JSStringJoiner.h:
1562 (JSC::JSStringJoiner::JSStringJoiner):
1563 (JSC::JSStringJoiner::append):
1565 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1567 DFG prediction propagation phase should not rerun forward propagation if double voting has already converged
1568 https://bugs.webkit.org/show_bug.cgi?id=111920
1570 Reviewed by Oliver Hunt.
1572 I don't know why we weren't exiting early after double voting if !m_changed.
1574 This change also removes backwards propagation from the voting fixpoint, since at that
1575 point short-circuiting loops is probably not particularly profitable. Profiling shows
1576 that this reduces the time spent in prediction propagation even further.
1578 This change appears to be a 1% SunSpider speed-up.
1580 * dfg/DFGPredictionPropagationPhase.cpp:
1581 (JSC::DFG::PredictionPropagationPhase::run):
1583 2013-03-11 Filip Pizlo <fpizlo@apple.com>
1585 DFG overflow check elimination is too smart for its own good
1586 https://bugs.webkit.org/show_bug.cgi?id=111832
1588 Reviewed by Oliver Hunt and Gavin Barraclough.
1590 Rolling this back in after fixing accidental misuse of JSValue. The code was doing value < someInt
1591 rather than value.asInt32() < someInt. This "worked" when isWithinPowerOfTwo wasn't templatized.
1592 It worked by always being false and always disabling the relvant optimization.
1594 This improves overflow check elimination in three ways:
1596 1) It reduces the amount of time the compiler will spend doing it.
1598 2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
1599 over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
1600 are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
1601 that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
1602 @b->children are int32's and that hence @b might produce a large enough result that doubles would
1603 start chopping low bits. The specific implication of this is that for a binary operation to not
1604 propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
1605 of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
1606 operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
1607 latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
1608 large won't even make it into the DFG currently.
1610 3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
1611 are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
1612 NodeUsedAsNumber to either @a or @b.
1614 This is neutral on V8v7 and a slight speed-up on compile time benchmarks.
1617 * GNUmakefile.list.am:
1618 * JavaScriptCore.xcodeproj/project.pbxproj:
1620 * dfg/DFGArrayMode.cpp:
1621 (JSC::DFG::ArrayMode::refine):
1622 * dfg/DFGBackwardsPropagationPhase.cpp: Added.
1624 (BackwardsPropagationPhase):
1625 (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
1626 (JSC::DFG::BackwardsPropagationPhase::run):
1627 (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
1628 (JSC::DFG::BackwardsPropagationPhase::isNotZero):
1629 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
1630 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
1631 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
1632 (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
1633 (JSC::DFG::BackwardsPropagationPhase::propagate):
1634 (JSC::DFG::performBackwardsPropagation):
1635 * dfg/DFGBackwardsPropagationPhase.h: Added.
1637 * dfg/DFGCPSRethreadingPhase.cpp:
1638 (JSC::DFG::CPSRethreadingPhase::run):
1639 (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
1640 (CPSRethreadingPhase):
1641 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1642 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1643 * dfg/DFGDriver.cpp:
1644 (JSC::DFG::compile):
1646 (JSC::DFG::Graph::dump):
1647 * dfg/DFGNodeFlags.cpp:
1648 (JSC::DFG::dumpNodeFlags):
1650 * dfg/DFGNodeFlags.h:
1652 * dfg/DFGPredictionPropagationPhase.cpp:
1653 (PredictionPropagationPhase):
1654 (JSC::DFG::PredictionPropagationPhase::propagate):
1655 * dfg/DFGUnificationPhase.cpp:
1656 (JSC::DFG::UnificationPhase::run):
1657 * dfg/DFGVariableAccessData.h:
1658 (JSC::DFG::VariableAccessData::VariableAccessData):
1659 (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
1660 (VariableAccessData):
1661 (JSC::DFG::VariableAccessData::setIsLoadedFrom):
1662 (JSC::DFG::VariableAccessData::isLoadedFrom):
1664 2013-03-11 Oliver Hunt <oliver@apple.com>
1666 Harden JSStringJoiner
1667 https://bugs.webkit.org/show_bug.cgi?id=112093
1669 Reviewed by Filip Pizlo.
1671 Harden JSStringJoiner, make it use our CheckedArithmetic
1672 class to simplify everything.
1674 * runtime/JSStringJoiner.cpp:
1675 (JSC::JSStringJoiner::build):
1676 * runtime/JSStringJoiner.h:
1678 (JSC::JSStringJoiner::JSStringJoiner):
1679 (JSC::JSStringJoiner::append):
1681 2013-03-11 Michael Saboff <msaboff@apple.com>
1683 Crash beneath operationCreateInlinedArguments running fast/js/dfg-create-inlined-arguments-in-closure-inline.html (32-bit only)
1684 https://bugs.webkit.org/show_bug.cgi?id=112067
1686 Reviewed by Geoffrey Garen.
1688 We weren't setting the tag in SetCallee. Therefore set it to CellTag.
1690 * dfg/DFGSpeculativeJIT32_64.cpp:
1691 (JSC::DFG::SpeculativeJIT::compile):
1693 2013-03-11 Oliver Hunt <oliver@apple.com>
1695 Make SegmentedVector Noncopyable
1696 https://bugs.webkit.org/show_bug.cgi?id=112059
1698 Reviewed by Geoffrey Garen.
1700 Copying a SegmentedVector is very expensive, and really shouldn't
1701 be necessary. So I've taken the one place where we currently copy
1702 and replaced it with a regular Vector, and replaced the address
1703 dependent logic with a indexing ref instead.
1705 * bytecompiler/BytecodeGenerator.cpp:
1706 (JSC::BytecodeGenerator::newLabelScope):
1707 (JSC::BytecodeGenerator::emitComplexJumpScopes):
1708 * bytecompiler/BytecodeGenerator.h:
1709 (BytecodeGenerator):
1710 * bytecompiler/LabelScope.h:
1712 (JSC::LabelScopePtr::LabelScopePtr):
1714 (JSC::LabelScopePtr::operator=):
1715 (JSC::LabelScopePtr::~LabelScopePtr):
1716 (JSC::LabelScopePtr::operator*):
1717 (JSC::LabelScopePtr::operator->):
1718 * bytecompiler/NodesCodegen.cpp:
1719 (JSC::DoWhileNode::emitBytecode):
1720 (JSC::WhileNode::emitBytecode):
1721 (JSC::ForNode::emitBytecode):
1722 (JSC::ForInNode::emitBytecode):
1723 (JSC::SwitchNode::emitBytecode):
1724 (JSC::LabelNode::emitBytecode):
1726 2013-03-10 Andreas Kling <akling@apple.com>
1728 SpeculativeJIT should use OwnPtr<SlowPathGenerator>.
1729 <http://webkit.org/b/111942>
1731 Reviewed by Anders Carlsson.
1733 There's no need to include DFGSlowPathGenerator.h from the header as long as the destructor is out-of-line,
1734 so let's use OwnPtr instead of raw pointers + deleteAllValues().
1736 * dfg/DFGSpeculativeJIT.cpp:
1737 (JSC::DFG::SpeculativeJIT::~SpeculativeJIT):
1738 (JSC::DFG::SpeculativeJIT::addSlowPathGenerator):
1739 * dfg/DFGSpeculativeJIT.h:
1742 2013-03-09 Sheriff Bot <webkit.review.bot@gmail.com>
1744 Unreviewed, rolling out r145299.
1745 http://trac.webkit.org/changeset/145299
1746 https://bugs.webkit.org/show_bug.cgi?id=111928
1748 compilation failure with recent clang
1749 (DFGBackwardsPropagationPhase.cpp:132:35: error: comparison of
1750 constant 10 with expression of type 'bool' is always false)
1751 (Requested by thorton on #webkit).
1754 * GNUmakefile.list.am:
1755 * JavaScriptCore.xcodeproj/project.pbxproj:
1757 * dfg/DFGArrayMode.cpp:
1758 (JSC::DFG::ArrayMode::refine):
1759 * dfg/DFGBackwardsPropagationPhase.cpp: Removed.
1760 * dfg/DFGBackwardsPropagationPhase.h: Removed.
1761 * dfg/DFGCPSRethreadingPhase.cpp:
1762 (JSC::DFG::CPSRethreadingPhase::run):
1763 (CPSRethreadingPhase):
1764 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1765 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1766 * dfg/DFGDriver.cpp:
1767 (JSC::DFG::compile):
1769 (JSC::DFG::Graph::dump):
1770 * dfg/DFGNodeFlags.cpp:
1771 (JSC::DFG::nodeFlagsAsString):
1773 * dfg/DFGNodeFlags.h:
1775 * dfg/DFGPredictionPropagationPhase.cpp:
1776 (JSC::DFG::PredictionPropagationPhase::isNotNegZero):
1777 (PredictionPropagationPhase):
1778 (JSC::DFG::PredictionPropagationPhase::isNotZero):
1779 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoForConstant):
1780 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoNonRecursive):
1781 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwo):
1782 (JSC::DFG::PredictionPropagationPhase::propagate):
1783 (JSC::DFG::PredictionPropagationPhase::mergeDefaultFlags):
1784 * dfg/DFGUnificationPhase.cpp:
1785 (JSC::DFG::UnificationPhase::run):
1786 * dfg/DFGVariableAccessData.h:
1787 (JSC::DFG::VariableAccessData::VariableAccessData):
1788 (VariableAccessData):
1790 2013-03-08 Filip Pizlo <fpizlo@apple.com>
1792 DFG overflow check elimination is too smart for its own good
1793 https://bugs.webkit.org/show_bug.cgi?id=111832
1795 Reviewed by Oliver Hunt and Gavin Barraclough.
1797 This improves overflow check elimination in three ways:
1799 1) It reduces the amount of time the compiler will spend doing it.
1801 2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
1802 over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
1803 are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
1804 that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
1805 @b->children are int32's and that hence @b might produce a large enough result that doubles would
1806 start chopping low bits. The specific implication of this is that for a binary operation to not
1807 propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
1808 of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
1809 operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
1810 latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
1811 large won't even make it into the DFG currently.
1813 3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
1814 are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
1815 NodeUsedAsNumber to either @a or @b.
1817 This is neutral on V8v7 and a slight speed-up on compile time benchmarks.
1820 * GNUmakefile.list.am:
1821 * JavaScriptCore.xcodeproj/project.pbxproj:
1823 * dfg/DFGArrayMode.cpp:
1824 (JSC::DFG::ArrayMode::refine):
1825 * dfg/DFGBackwardsPropagationPhase.cpp: Added.
1827 (BackwardsPropagationPhase):
1828 (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
1829 (JSC::DFG::BackwardsPropagationPhase::run):
1830 (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
1831 (JSC::DFG::BackwardsPropagationPhase::isNotZero):
1832 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
1833 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
1834 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
1835 (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
1836 (JSC::DFG::BackwardsPropagationPhase::propagate):
1837 (JSC::DFG::performBackwardsPropagation):
1838 * dfg/DFGBackwardsPropagationPhase.h: Added.
1840 * dfg/DFGCPSRethreadingPhase.cpp:
1841 (JSC::DFG::CPSRethreadingPhase::run):
1842 (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
1843 (CPSRethreadingPhase):
1844 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1845 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1846 * dfg/DFGDriver.cpp:
1847 (JSC::DFG::compile):
1849 (JSC::DFG::Graph::dump):
1850 * dfg/DFGNodeFlags.cpp:
1851 (JSC::DFG::dumpNodeFlags):
1853 * dfg/DFGNodeFlags.h:
1855 * dfg/DFGPredictionPropagationPhase.cpp:
1856 (PredictionPropagationPhase):
1857 (JSC::DFG::PredictionPropagationPhase::propagate):
1858 * dfg/DFGUnificationPhase.cpp:
1859 (JSC::DFG::UnificationPhase::run):
1860 * dfg/DFGVariableAccessData.h:
1861 (JSC::DFG::VariableAccessData::VariableAccessData):
1862 (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
1863 (VariableAccessData):
1864 (JSC::DFG::VariableAccessData::setIsLoadedFrom):
1865 (JSC::DFG::VariableAccessData::isLoadedFrom):
1867 2013-03-08 Roger Fong <roger_fong@apple.com>
1871 * JavaScriptCore.vcxproj/JavaScriptCore.make:
1873 2013-03-08 Gabor Rapcsanyi <rgabor@webkit.org>
1875 Cache flush problem on ARMv7 JSC
1876 https://bugs.webkit.org/show_bug.cgi?id=111441
1878 Reviewed by Zoltan Herczeg.
1880 Not proper cache flush causing random crashes on ARMv7 Linux with V8 tests.
1881 The problem is similar to https://bugs.webkit.org/show_bug.cgi?id=77712.
1882 Change the cache fulsh mechanism similar to ARM traditinal and revert the
1885 * assembler/ARMv7Assembler.h:
1886 (JSC::ARMv7Assembler::cacheFlush):
1888 2013-03-07 Geoffrey Garen <ggaren@apple.com>
1890 REGRESSION (r143759): 40% JSBench regression, 20% Octane/closure regression, 40% Octane/jquery regression, 2% Octane regression
1891 https://bugs.webkit.org/show_bug.cgi?id=111797
1893 Reviewed by Oliver Hunt.
1895 The bot's testing configuration stresses the cache's starting guess
1898 This patch removes any starting guess, and just uses wall clock time
1899 to discover the initial working set size of an app, in code size.
1901 * runtime/CodeCache.cpp:
1902 (JSC::CodeCacheMap::pruneSlowCase): Update our timer as we go.
1904 Also fixed a bug where pruning from 0 to 0 would hang -- that case is
1905 a possibility now that we start with a capacity of 0.
1907 * runtime/CodeCache.h:
1909 (JSC::CodeCacheMap::CodeCacheMap):
1910 (JSC::CodeCacheMap::add):
1911 (JSC::CodeCacheMap::prune): Don't prune if we're in the middle of
1912 discovering the working set size of an app, in code size.
1914 2013-03-07 Michael Saboff <msaboff@apple.com>
1916 Crash when updating predictions below JSC::arrayProtoFuncForEach on tuaw.com article
1917 https://bugs.webkit.org/show_bug.cgi?id=111777
1919 Reviewed by Filip Pizlo.
1921 Moved register allocations to be above any generated control flow so that any
1922 resulting spill would be visible to all subsequently generated code.
1924 * dfg/DFGSpeculativeJIT32_64.cpp:
1925 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
1926 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
1927 (JSC::DFG::SpeculativeJIT::compile):
1928 * dfg/DFGSpeculativeJIT64.cpp:
1929 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
1930 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
1931 (JSC::DFG::SpeculativeJIT::compile):
1933 2013-03-07 Filip Pizlo <fpizlo@apple.com>
1935 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
1936 https://bugs.webkit.org/show_bug.cgi?id=111783
1938 Reviewed by Mark Hahnenberg.
1940 Unreachable code is not touched by CFA and so thinks that even untyped uses are checked.
1941 But dead untyped uses don't need checks and hence don't need to be Phantom'd. The DCE knew
1942 this in findTypeCheckRoot() but not in eliminateIrrelevantPhantomChildren(), leading to a
1943 Phantom node that had another Phantom node as one of its kids.
1945 * dfg/DFGDCEPhase.cpp:
1946 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
1948 2013-03-07 Filip Pizlo <fpizlo@apple.com>
1950 The DFG fixpoint is not strictly profitable, and should be straight-lined
1951 https://bugs.webkit.org/show_bug.cgi?id=111764
1953 Reviewed by Oliver Hunt and Geoffrey Garen.
1955 The DFG previously ran optimizations to fixpoint because there exists a circular dependency:
1957 CSE depends on CFG simplification: CFG simplification merges blocks, and CSE is block-local.
1959 CFG simplification depends on CFA and constant folding: constant folding reveals branches on
1962 CFA depends on CSE: CSE reveals must-alias relationships by proving that two operations
1963 always produce identical values.
1965 Arguments simplification also depends on CSE, but it ought not depend on anything else.
1967 Hence we get a cycle like: CFA -> folding -> CFG -> CSE -> CFA.
1969 Note that before we had sparse conditional CFA, we also had CFA depending on CFG. This ought
1970 not be the case anymore: CFG simplification should not by itself lead to better CFA results.
1972 My guess is that the weakest link in this cycle is CFG -> CSE. CSE cuts both ways: if you
1973 CSE too much then you increase register pressure. Hence it's not clear that you always want
1974 to CSE after simplifying control flow. This leads to an order of optimization as follows:
1976 CSE -> arguments -> CFA -> folding -> CFG
1978 This is a 2.5% speed-up on SunSpider, a 4% speed-up on V8Spider, a possible 0.3% slow-down
1979 on V8v7, nothing on Kraken, and 1.2% speed-up in the JSRegress geomean. I'll take a 2.5%
1980 speed-up over a 0.3% V8v7 speed-up.
1982 * dfg/DFGDriver.cpp:
1983 (JSC::DFG::compile):
1985 2013-03-07 Roger Fong <roger_fong@apple.com>
1987 Build fix for AppleWin VS2010.
1989 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
1990 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
1992 2013-03-05 Mark Hahnenberg <mhahnenberg@apple.com>
1994 Objective-C API: Need a good way to reference event handlers without causing cycles
1995 https://bugs.webkit.org/show_bug.cgi?id=111088
1997 Reviewed by Geoffrey Garen.
1999 JSManagedValue is like a special kind of weak value. When you create a JSManagedValue, you can
2000 supply an Objective-C object as its "owner". As long as the Objective-C owner object remains
2001 alive and its wrapper remains accessible to the JSC garbage collector (e.g. by being marked by
2002 the global object), the reference to the JavaScript value is strong. As soon as the Objective-C
2003 owner is deallocated or its wrapper becomes inaccessible to the garbage collector, the reference
2006 If you do not supply an owner or you use the weakValueWithValue: convenience class method, the
2007 returned JSManagedValue behaves as a normal weak reference.
2009 This new class allows clients to maintain references to JavaScript values in the Objective-C
2010 heap without creating reference cycles/leaking memory.
2012 * API/JSAPIWrapperObject.cpp: Added.
2014 (JSC::::createStructure):
2015 (JSC::JSAPIWrapperObject::JSAPIWrapperObject): This is a special JSObject for the Objective-C API that knows
2016 for the purposes of garbage collection/marking that it wraps an opaque Objective-C object.
2017 (JSC::JSAPIWrapperObject::visitChildren): We add the pointer to the wrapped Objective-C object to the set of
2018 opaque roots so that the weak handle owner for JSManagedValues can find it later.
2019 * API/JSAPIWrapperObject.h: Added.
2021 (JSAPIWrapperObject):
2022 (JSC::JSAPIWrapperObject::wrappedObject):
2023 (JSC::JSAPIWrapperObject::setWrappedObject):
2025 (JSSynchronousGarbageCollect):
2026 * API/JSBasePrivate.h:
2027 * API/JSCallbackObject.cpp:
2029 * API/JSCallbackObject.h:
2030 (JSC::JSCallbackObject::destroy): Moved this to the header so that we don't get link errors with JSAPIWrapperObject.
2032 (-[JSContext initWithVirtualMachine:]): We weren't adding manually allocated/initialized JSVirtualMachine objects to
2033 the global cache of virtual machines. The init methods handle this now rather than contextWithGlobalContextRef, since
2034 not everyone is guaranteed to use the latter.
2035 (-[JSContext initWithGlobalContextRef:]):
2036 (+[JSContext contextWithGlobalContextRef:]):
2037 * API/JSManagedValue.h: Added.
2038 * API/JSManagedValue.mm: Added.
2039 (JSManagedValueHandleOwner):
2040 (managedValueHandleOwner):
2041 (+[JSManagedValue weakValueWithValue:]):
2042 (+[JSManagedValue managedValueWithValue:owner:]):
2043 (-[JSManagedValue init]): We explicitly call the ARC entrypoints to initialize/get the weak owner field since we don't
2044 use ARC when building our framework.
2045 (-[JSManagedValue initWithValue:]):
2046 (-[JSManagedValue initWithValue:owner:]):
2047 (-[JSManagedValue dealloc]):
2048 (-[JSManagedValue value]):
2049 (-[JSManagedValue weakOwner]):
2050 (JSManagedValueHandleOwner::isReachableFromOpaqueRoots): If the Objective-C owner is still alive (i.e. loading the weak field
2051 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
2052 JSObject to which the JSManagedObject refers is still alive.
2053 * API/JSObjectRef.cpp: We have to add explicit checks for the JSAPIWrapperObject, just like the other types of JSCallbackObjects.
2054 (JSObjectGetPrivate):
2055 (JSObjectSetPrivate):
2056 (JSObjectGetPrivateProperty):
2057 (JSObjectSetPrivateProperty):
2058 (JSObjectDeletePrivateProperty):
2060 (objectToValueWithoutCopy):
2061 * API/JSValueRef.cpp:
2062 (JSValueIsObjectOfClass):
2063 * API/JSVirtualMachine.mm:
2064 (-[JSVirtualMachine initWithContextGroupRef:]):
2065 (+[JSVirtualMachine virtualMachineWithContextGroupRef:]):
2066 * API/JSWrapperMap.mm:
2068 (makeWrapper): This is our own internal version of JSObjectMake which creates JSAPIWrapperObjects, the Obj-C API
2069 version of JSCallbackObjects.
2070 (createObjectWithCustomBrand):
2071 (-[JSObjCClassInfo wrapperForObject:]):
2072 (tryUnwrapObjcObject):
2073 * API/JavaScriptCore.h:
2074 * API/tests/testapi.mm: Added new tests for the strong and weak uses of JSManagedValue in the context of an
2075 onclick handler for an Objective-C object inserted into a JSContext.
2076 (-[TextXYZ setWeakOnclick:]):
2077 (-[TextXYZ setOnclick:]):
2078 (-[TextXYZ weakOnclick]):
2079 (-[TextXYZ onclick]):
2081 * CMakeLists.txt: Various build system additions.
2082 * GNUmakefile.list.am:
2083 * JavaScriptCore.gypi:
2084 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2085 * JavaScriptCore.xcodeproj/project.pbxproj:
2086 * runtime/JSGlobalObject.cpp: Added the new canonical Structure for the JSAPIWrapperObject class.
2087 (JSC::JSGlobalObject::reset):
2089 (JSC::JSGlobalObject::visitChildren):
2090 * runtime/JSGlobalObject.h:
2092 (JSC::JSGlobalObject::objcWrapperObjectStructure):
2094 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2096 ConvertThis should be turned into Identity based on predictions in Fixup, rather than based on proofs in ConstantFolding
2097 https://bugs.webkit.org/show_bug.cgi?id=111674
2099 Reviewed by Oliver Hunt.
2101 This gets rid of the speculated forms of ConvertThis in the backend, and has Fixup
2102 convert them to either Identity(Object:@child) if the child is predicted object, or
2103 Phantom(Other:@child) ; WeakJSConstant(global this object) if it's predicted Other.
2105 The goal of this is to ensure that the optimization fixpoint doesn't create
2106 Identity's, since doing so requires a rerun of CSE. So far this isn't a speed-up
2107 but I'm hoping this will be a step towards reducing the need to rerun the fixpoint
2108 so as to ultimately reduce compile times.
2110 * dfg/DFGAbstractState.cpp:
2111 (JSC::DFG::AbstractState::executeEffects):
2112 * dfg/DFGAssemblyHelpers.h:
2114 * dfg/DFGConstantFoldingPhase.cpp:
2115 (JSC::DFG::ConstantFoldingPhase::foldConstants):
2116 * dfg/DFGFixupPhase.cpp:
2117 (JSC::DFG::FixupPhase::fixupNode):
2119 (JSC::DFG::FixupPhase::observeUseKindOnNode):
2120 (JSC::DFG::FixupPhase::setUseKindAndUnboxIfProfitable):
2122 (JSC::DFG::Graph::globalThisObjectFor):
2126 (JSC::DFG::Node::convertToIdentity):
2127 (JSC::DFG::Node::convertToWeakConstant):
2128 * dfg/DFGSpeculativeJIT32_64.cpp:
2129 (JSC::DFG::SpeculativeJIT::compile):
2130 * dfg/DFGSpeculativeJIT64.cpp:
2131 (JSC::DFG::SpeculativeJIT::compile):
2133 2013-03-07 Peter Gal <galpeter@inf.u-szeged.hu>
2135 Children method in LLINT AST Not class should return [@child]
2136 https://bugs.webkit.org/show_bug.cgi?id=90740
2138 Reviewed by Filip Pizlo.
2140 * offlineasm/ast.rb: Fixed the return value of the children method in the Not AST class.
2142 2013-03-05 Oliver Hunt <oliver@apple.com>
2144 Bring back eager resolution of function scoped variables
2145 https://bugs.webkit.org/show_bug.cgi?id=111497
2147 Reviewed by Geoffrey Garen.
2149 This reverts the get/put_scoped_var part of the great non-local
2150 variable resolution refactoring. This still leaves all the lazy
2151 variable resolution logic as it's necessary for global property
2152 resolution, and i don't want to make the patch bigger than it
2155 * bytecode/CodeBlock.cpp:
2156 (JSC::CodeBlock::dumpBytecode):
2157 (JSC::CodeBlock::CodeBlock):
2158 * bytecode/CodeBlock.h:
2160 * bytecode/Opcode.h:
2162 (JSC::padOpcodeName):
2163 * bytecode/UnlinkedCodeBlock.cpp:
2164 (JSC::generateFunctionCodeBlock):
2165 (JSC::UnlinkedFunctionExecutable::codeBlockFor):
2166 (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
2167 * bytecode/UnlinkedCodeBlock.h:
2169 (UnlinkedFunctionExecutable):
2170 (UnlinkedCodeBlock):
2171 (JSC::UnlinkedCodeBlock::usesGlobalObject):
2172 (JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
2173 (JSC::UnlinkedCodeBlock::globalObjectRegister):
2174 * bytecompiler/BytecodeGenerator.cpp:
2175 (JSC::ResolveResult::checkValidity):
2176 (JSC::BytecodeGenerator::BytecodeGenerator):
2177 (JSC::BytecodeGenerator::emitLoadGlobalObject):
2179 (JSC::BytecodeGenerator::resolve):
2180 (JSC::BytecodeGenerator::resolveConstDecl):
2181 (JSC::BytecodeGenerator::emitResolve):
2182 (JSC::BytecodeGenerator::emitResolveBase):
2183 (JSC::BytecodeGenerator::emitResolveBaseForPut):
2184 (JSC::BytecodeGenerator::emitResolveWithBaseForPut):
2185 (JSC::BytecodeGenerator::emitResolveWithThis):
2186 (JSC::BytecodeGenerator::emitGetStaticVar):
2187 (JSC::BytecodeGenerator::emitPutStaticVar):
2188 * bytecompiler/BytecodeGenerator.h:
2189 (JSC::ResolveResult::lexicalResolve):
2190 (JSC::ResolveResult::isStatic):
2191 (JSC::ResolveResult::depth):
2192 (JSC::ResolveResult::index):
2194 (JSC::ResolveResult::ResolveResult):
2195 (BytecodeGenerator):
2196 * bytecompiler/NodesCodegen.cpp:
2197 (JSC::ResolveNode::isPure):
2198 (JSC::FunctionCallResolveNode::emitBytecode):
2199 (JSC::PostfixNode::emitResolve):
2200 (JSC::TypeOfResolveNode::emitBytecode):
2201 (JSC::PrefixNode::emitResolve):
2202 (JSC::ReadModifyResolveNode::emitBytecode):
2203 (JSC::AssignResolveNode::emitBytecode):
2204 (JSC::ConstDeclNode::emitCodeSingle):
2205 * dfg/DFGByteCodeParser.cpp:
2206 (JSC::DFG::ByteCodeParser::parseBlock):
2207 * dfg/DFGCapabilities.cpp:
2208 (JSC::DFG::debugFail):
2209 * dfg/DFGCapabilities.h:
2210 (JSC::DFG::canCompileOpcode):
2211 (JSC::DFG::canInlineOpcode):
2213 (JSC::JIT::privateCompileMainPass):
2216 * jit/JITPropertyAccess.cpp:
2217 (JSC::JIT::emit_op_get_scoped_var):
2219 (JSC::JIT::emit_op_put_scoped_var):
2220 * jit/JITPropertyAccess32_64.cpp:
2221 (JSC::JIT::emit_op_get_scoped_var):
2223 (JSC::JIT::emit_op_put_scoped_var):
2224 * llint/LowLevelInterpreter32_64.asm:
2225 * llint/LowLevelInterpreter64.asm:
2226 * runtime/CodeCache.cpp:
2227 (JSC::CodeCache::getCodeBlock):
2228 (JSC::CodeCache::getProgramCodeBlock):
2229 (JSC::CodeCache::getEvalCodeBlock):
2230 * runtime/CodeCache.h:
2233 * runtime/Executable.cpp:
2234 (JSC::EvalExecutable::compileInternal):
2235 (JSC::FunctionExecutable::produceCodeBlockFor):
2236 * runtime/JSGlobalObject.cpp:
2237 (JSC::JSGlobalObject::createEvalCodeBlock):
2238 * runtime/JSGlobalObject.h:
2240 * runtime/Options.cpp:
2241 (JSC::Options::initialize):
2243 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2245 Unreviewed, roll out http://trac.webkit.org/changeset/144989
2247 I think we want the assertion that I removed.
2249 * dfg/DFGAbstractState.cpp:
2250 (JSC::DFG::AbstractState::merge):
2251 (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
2252 * dfg/DFGAbstractState.h:
2255 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2257 DFG::AbstractState::merge() is still more complicated than it needs to be
2258 https://bugs.webkit.org/show_bug.cgi?id=111619
2260 Reviewed by Mark Hahnenberg.
2262 This method is the one place where we still do some minimal amount of liveness pruning, but the style with
2263 which it is written is awkward, and it makes an assertion about variablesAtTail that will be invalidated
2264 by https://bugs.webkit.org/show_bug.cgi?id=111539.
2266 * dfg/DFGAbstractState.cpp:
2267 (JSC::DFG::AbstractState::merge):
2268 (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
2269 * dfg/DFGAbstractState.h:
2272 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2274 DFG should not run full CSE after the optimization fixpoint, since it really just wants store elimination
2275 https://bugs.webkit.org/show_bug.cgi?id=111536
2277 Reviewed by Oliver Hunt and Mark Hahnenberg.
2279 The fixpoint will do aggressive load elimination and pure CSE. There's no need to do it after the fixpoint.
2280 On the other hand, the fixpoint does not profit from doing store elimination (except for SetLocal/Flush).
2281 Previously we had CSE do both, and had it avoid doing some store elimination during the fixpoint by querying
2282 the fixpoint state. This changes CSE to be templated on mode - either NormalCSE or StoreElimination - so
2283 that we explicitly put it into one of those modes depending on where we call it from. The goal is to reduce
2284 time spent doing load elimination after the fixpoint, since that is just wasted cycles.
2286 * dfg/DFGCSEPhase.cpp:
2287 (JSC::DFG::CSEPhase::CSEPhase):
2288 (JSC::DFG::CSEPhase::run):
2289 (JSC::DFG::CSEPhase::performNodeCSE):
2290 (JSC::DFG::CSEPhase::performBlockCSE):
2291 (JSC::DFG::performCSE):
2293 (JSC::DFG::performStoreElimination):
2294 * dfg/DFGCSEPhase.h:
2296 * dfg/DFGDriver.cpp:
2297 (JSC::DFG::compile):
2299 2013-03-06 Andreas Kling <akling@apple.com>
2301 Pack Structure members better.
2302 <http://webkit.org/b/111593>
2303 <rdar://problem/13359200>
2305 Reviewed by Mark Hahnenberg.
2307 Shrink Structure by 8 bytes (now at 104 bytes) on 64-bit by packing the members better.
2309 * runtime/Structure.cpp:
2310 (JSC::Structure::Structure):
2311 * runtime/Structure.h:
2314 2013-03-06 Andreas Kling <akling@apple.com>
2316 Unreviewed, fix Windows build after r144910.
2318 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2320 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2322 DFG should not check if nodes are shouldGenerate prior to DCE
2323 https://bugs.webkit.org/show_bug.cgi?id=111520
2325 Reviewed by Geoffrey Garen.
2327 All nodes are live before DCE. We don't need to check that they aren't, because they
2330 * dfg/DFGArgumentsSimplificationPhase.cpp:
2331 (JSC::DFG::ArgumentsSimplificationPhase::run):
2332 * dfg/DFGCFAPhase.cpp:
2333 (JSC::DFG::CFAPhase::performBlockCFA):
2334 * dfg/DFGCFGSimplificationPhase.cpp:
2335 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
2336 * dfg/DFGCSEPhase.cpp:
2337 (JSC::DFG::CSEPhase::pureCSE):
2338 (JSC::DFG::CSEPhase::int32ToDoubleCSE):
2339 (JSC::DFG::CSEPhase::constantCSE):
2340 (JSC::DFG::CSEPhase::weakConstantCSE):
2341 (JSC::DFG::CSEPhase::getCalleeLoadElimination):
2342 (JSC::DFG::CSEPhase::getArrayLengthElimination):
2343 (JSC::DFG::CSEPhase::globalVarLoadElimination):
2344 (JSC::DFG::CSEPhase::scopedVarLoadElimination):
2345 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
2346 (JSC::DFG::CSEPhase::globalVarStoreElimination):
2347 (JSC::DFG::CSEPhase::scopedVarStoreElimination):
2348 (JSC::DFG::CSEPhase::getByValLoadElimination):
2349 (JSC::DFG::CSEPhase::checkStructureElimination):
2350 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
2351 (JSC::DFG::CSEPhase::putStructureStoreElimination):
2352 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
2353 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
2354 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
2355 (JSC::DFG::CSEPhase::checkArrayElimination):
2356 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
2357 (JSC::DFG::CSEPhase::getMyScopeLoadElimination):
2358 (JSC::DFG::CSEPhase::getLocalLoadElimination):
2359 (JSC::DFG::CSEPhase::setLocalStoreElimination):
2360 (JSC::DFG::CSEPhase::performNodeCSE):
2361 * dfg/DFGFixupPhase.cpp:
2362 (JSC::DFG::FixupPhase::fixupNode):
2363 (JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
2364 * dfg/DFGPredictionPropagationPhase.cpp:
2365 (JSC::DFG::PredictionPropagationPhase::propagate):
2366 * dfg/DFGStructureCheckHoistingPhase.cpp:
2367 (JSC::DFG::StructureCheckHoistingPhase::run):
2369 2013-03-06 Csaba Osztrogonác <ossy@webkit.org>
2371 Fix unused parameter warnings in ARM assembler
2372 https://bugs.webkit.org/show_bug.cgi?id=111433
2374 Reviewed by Kentaro Hara.
2376 * assembler/ARMAssembler.h: Remove unreachable revertJump() after r143346.
2377 * assembler/MacroAssemblerARM.h:
2378 (JSC::MacroAssemblerARM::moveIntsToDouble): Remove unused scratch parameter instead of UNUSED_PARAM.
2379 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): Remove unused fpTemp parameter.
2380 (JSC::MacroAssemblerARM::revertJumpReplacementToPatchableBranchPtrWithPatch): Remove unused parameters.
2382 2013-03-06 Andreas Kling <akling@apple.com>
2384 Unused Structure property tables waste 14MB on Membuster.
2385 <http://webkit.org/b/110854>
2386 <rdar://problem/13292104>
2388 Reviewed by Geoffrey Garen.
2390 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
2391 14 MB progression on Membuster3.
2393 This time it should stick; I've been through all the tests with COLLECT_ON_EVERY_ALLOCATION.
2394 The issue with the last version was that Structure::m_offset could be used uninitialized
2395 when re-materializing a previously GC'd property table, causing some sanity checks to fail.
2398 * GNUmakefile.list.am:
2399 * JavaScriptCore.gypi:
2400 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2401 * JavaScriptCore.xcodeproj/project.pbxproj:
2404 Added PropertyTable.cpp.
2406 * runtime/PropertyTable.cpp: Added.
2407 (JSC::PropertyTable::create):
2408 (JSC::PropertyTable::clone):
2409 (JSC::PropertyTable::PropertyTable):
2410 (JSC::PropertyTable::destroy):
2411 (JSC::PropertyTable::~PropertyTable):
2412 (JSC::PropertyTable::visitChildren):
2414 Moved marking of property table values here from Structure::visitChildren().
2416 * runtime/WriteBarrier.h:
2417 (JSC::WriteBarrierBase::get):
2419 Move m_cell to a local before using it multiple times. This avoids a multiple-access race when
2420 Structure::checkOffsetConsistency() is used in assertions on the main thread while a marking thread
2421 zaps the property table.
2423 * runtime/Structure.h:
2424 (JSC::Structure::materializePropertyMapIfNecessary):
2425 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2426 * runtime/StructureInlines.h:
2427 (JSC::Structure::propertyTable):
2429 Added a getter for the Structure's PropertyTable that ASSERTs GC currently isn't active.
2430 Because GC can zap an unpinned property table at any time, it's not entirely safe to access it.
2431 Renamed the variable itself to m_propertyTableUnsafe to force call sites into explaining themselves.
2433 (JSC::Structure::putWillGrowOutOfLineStorage):
2434 (JSC::Structure::checkOffsetConsistency):
2436 Moved these out of Structure.h to break header dependency cycle between Structure/PropertyTable.
2438 * runtime/Structure.cpp:
2439 (JSC::Structure::visitChildren):
2441 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
2443 (JSC::Structure::takePropertyTableOrCloneIfPinned):
2445 Added for setting up the property table in a new transition, this code is now shared between
2446 addPropertyTransition() and nonPropertyTransition().
2448 * runtime/JSGlobalData.h:
2449 * runtime/JSGlobalData.cpp:
2450 (JSC::JSGlobalData::JSGlobalData):
2452 Add a global propertyTableStructure.
2454 * runtime/PropertyMapHashTable.h:
2456 (JSC::PropertyTable::createStructure):
2457 (JSC::PropertyTable::copy):
2459 Make PropertyTable a GC object.
2461 * runtime/Structure.cpp:
2462 (JSC::Structure::dumpStatistics):
2463 (JSC::Structure::materializePropertyMap):
2464 (JSC::Structure::despecifyDictionaryFunction):
2465 (JSC::Structure::addPropertyTransition):
2466 (JSC::Structure::changePrototypeTransition):
2467 (JSC::Structure::despecifyFunctionTransition):
2468 (JSC::Structure::attributeChangeTransition):
2469 (JSC::Structure::toDictionaryTransition):
2470 (JSC::Structure::sealTransition):
2471 (JSC::Structure::freezeTransition):
2472 (JSC::Structure::preventExtensionsTransition):
2473 (JSC::Structure::nonPropertyTransition):
2474 (JSC::Structure::isSealed):
2475 (JSC::Structure::isFrozen):
2476 (JSC::Structure::flattenDictionaryStructure):
2477 (JSC::Structure::pin):
2478 (JSC::Structure::copyPropertyTable):
2479 (JSC::Structure::copyPropertyTableForPinning):
2480 (JSC::Structure::get):
2481 (JSC::Structure::despecifyFunction):
2482 (JSC::Structure::despecifyAllFunctions):
2483 (JSC::Structure::putSpecificValue):
2484 (JSC::Structure::remove):
2485 (JSC::Structure::createPropertyMap):
2486 (JSC::Structure::getPropertyNamesFromStructure):
2487 (JSC::Structure::checkConsistency):
2489 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2491 Get rid of the invert argument to SpeculativeJIT::jumpSlowForUnwantedArrayMode
2492 https://bugs.webkit.org/show_bug.cgi?id=105624
2494 Reviewed by Oliver Hunt.
2496 All callers pass invert = false, which is the default value of the argument. So, get
2497 rid of the argument and fold away all code that checks it.
2499 * dfg/DFGSpeculativeJIT.cpp:
2500 (JSC::DFG::SpeculativeJIT::jumpSlowForUnwantedArrayMode):
2501 * dfg/DFGSpeculativeJIT.h:
2504 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2506 Unreviewed, fix an incorrect comment. The comment was a holdover from a work-in-progress version of this code.
2508 * dfg/DFGDCEPhase.cpp:
2509 (JSC::DFG::DCEPhase::run):
2511 2013-03-04 Filip Pizlo <fpizlo@apple.com>
2513 DFG DCE might eliminate checks unsoundly
2514 https://bugs.webkit.org/show_bug.cgi?id=109389
2516 Reviewed by Oliver Hunt.
2518 This gets rid of all eager reference counting, and does all dead code elimination
2519 in one phase - the DCEPhase. This phase also sets up the node reference counts,
2520 which are then used not just for DCE but also register allocation and stack slot
2523 Doing this required a number of surgical changes in places that previously relied
2524 on always having liveness information. For example, the structure check hoisting
2525 phase must now consult whether a VariableAccessData is profitable for unboxing to
2526 make sure that it doesn't try to do hoisting on set SetLocals. The arguments
2527 simplification phase employs its own light-weight liveness analysis. Both phases
2528 previously just used reference counts.
2530 The largest change is that now, dead nodes get turned into Phantoms. Those
2531 Phantoms will retain those child edges that are not proven. This ensures that any
2532 type checks performed by a dead node remain even after the node is killed. On the
2533 other hand, this Phantom conversion means that we need special handling for
2534 SetLocal. I decided to make the four forms of SetLocal explicit:
2536 MovHint(@a, rK): Just indicates that node @a contains the value that would have
2537 now been placed into virtual register rK. Does not actually cause @a to be
2538 stored into rK. This would have previously been a dead SetLocal with @a
2539 being live. MovHints are always dead.
2541 ZombieHint(rK): Indicates that at this point, register rK will contain a dead
2542 value and OSR should put Undefined into it. This would have previously been
2543 a dead SetLocal with @a being dead also. ZombieHints are always dead.
2545 MovHintAndCheck(@a, rK): Identical to MovHint except @a is also type checked,
2546 according to whatever UseKind the edge to @a has. The type check is always a
2547 forward exit. MovHintAndChecks are always live, since they are
2548 NodeMustGenerate. Previously this would have been a dead SetLocal with a
2549 live @a, and the check would have disappeared. This is one of the bugs that
2552 SetLocal(@a, rK): This still does exactly what it does now, if the SetLocal is
2555 Basically this patch makes it so that dead SetLocals eventually decay to MovHint,
2556 ZombieHint, or MovHintAndCheck depending on the situation. If the child @a is
2557 also dead, then you get a ZombieHint. If the child @a is live but the SetLocal
2558 has a type check and @a's type hasn't been proven to have that type then you get
2559 a MovHintAndCheck. Otherwise you get a MovHint.
2561 This is performance neutral.
2564 * GNUmakefile.list.am:
2565 * JavaScriptCore.xcodeproj/project.pbxproj:
2567 * dfg/DFGAbstractState.cpp:
2568 (JSC::DFG::AbstractState::executeEffects):
2569 (JSC::DFG::AbstractState::mergeStateAtTail):
2570 * dfg/DFGArgumentsSimplificationPhase.cpp:
2571 (JSC::DFG::ArgumentsSimplificationPhase::run):
2572 (ArgumentsSimplificationPhase):
2573 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
2574 * dfg/DFGBasicBlock.h:
2576 * dfg/DFGBasicBlockInlines.h:
2578 * dfg/DFGByteCodeParser.cpp:
2579 (JSC::DFG::ByteCodeParser::addToGraph):
2580 (JSC::DFG::ByteCodeParser::insertPhiNode):
2581 (JSC::DFG::ByteCodeParser::emitFunctionChecks):
2582 * dfg/DFGCFAPhase.cpp:
2583 (JSC::DFG::CFAPhase::run):
2584 * dfg/DFGCFGSimplificationPhase.cpp:
2585 (JSC::DFG::CFGSimplificationPhase::run):
2586 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
2587 * dfg/DFGCPSRethreadingPhase.cpp:
2588 (JSC::DFG::CPSRethreadingPhase::run):
2589 (JSC::DFG::CPSRethreadingPhase::addPhiSilently):
2590 * dfg/DFGCSEPhase.cpp:
2591 (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
2592 (JSC::DFG::CSEPhase::setReplacement):
2593 (JSC::DFG::CSEPhase::performNodeCSE):
2594 * dfg/DFGCommon.cpp:
2595 (WTF::printInternal):
2599 * dfg/DFGConstantFoldingPhase.cpp:
2600 (JSC::DFG::ConstantFoldingPhase::foldConstants):
2601 (JSC::DFG::ConstantFoldingPhase::addStructureTransitionCheck):
2602 (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
2603 * dfg/DFGDCEPhase.cpp: Added.
2606 (JSC::DFG::DCEPhase::DCEPhase):
2607 (JSC::DFG::DCEPhase::run):
2608 (JSC::DFG::DCEPhase::findTypeCheckRoot):
2609 (JSC::DFG::DCEPhase::countEdge):
2610 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
2611 (JSC::DFG::performDCE):
2612 * dfg/DFGDCEPhase.h: Added.
2614 * dfg/DFGDriver.cpp:
2615 (JSC::DFG::compile):
2616 * dfg/DFGFixupPhase.cpp:
2617 (JSC::DFG::FixupPhase::fixupNode):
2618 (JSC::DFG::FixupPhase::checkArray):
2619 (JSC::DFG::FixupPhase::blessArrayOperation):
2620 (JSC::DFG::FixupPhase::fixIntEdge):
2621 (JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
2622 (JSC::DFG::FixupPhase::truncateConstantToInt32):
2624 (JSC::DFG::Graph::Graph):
2625 (JSC::DFG::Graph::dump):
2628 (JSC::DFG::Graph::changeChild):
2629 (JSC::DFG::Graph::changeEdge):
2630 (JSC::DFG::Graph::compareAndSwap):
2631 (JSC::DFG::Graph::clearAndDerefChild):
2632 (JSC::DFG::Graph::performSubstitution):
2633 (JSC::DFG::Graph::performSubstitutionForEdge):
2635 (JSC::DFG::Graph::substitute):
2636 * dfg/DFGInsertionSet.h:
2639 (JSC::DFG::Node::Node):
2640 (JSC::DFG::Node::convertToConstant):
2641 (JSC::DFG::Node::convertToGetLocalUnlinked):
2642 (JSC::DFG::Node::containsMovHint):
2644 (JSC::DFG::Node::hasVariableAccessData):
2645 (JSC::DFG::Node::willHaveCodeGenOrOSR):
2646 * dfg/DFGNodeType.h:
2648 * dfg/DFGPredictionPropagationPhase.cpp:
2649 (JSC::DFG::PredictionPropagationPhase::propagate):
2650 * dfg/DFGSpeculativeJIT.cpp:
2651 (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
2652 (JSC::DFG::SpeculativeJIT::compileMovHint):
2653 (JSC::DFG::SpeculativeJIT::compileMovHintAndCheck):
2655 (JSC::DFG::SpeculativeJIT::compileInlineStart):
2656 (JSC::DFG::SpeculativeJIT::compile):
2657 * dfg/DFGSpeculativeJIT.h:
2659 * dfg/DFGSpeculativeJIT32_64.cpp:
2660 (JSC::DFG::SpeculativeJIT::compile):
2661 * dfg/DFGSpeculativeJIT64.cpp:
2662 (JSC::DFG::SpeculativeJIT::compile):
2663 * dfg/DFGStructureCheckHoistingPhase.cpp:
2664 (JSC::DFG::StructureCheckHoistingPhase::run):
2665 (JSC::DFG::StructureCheckHoistingPhase::shouldConsiderForHoisting):
2666 (StructureCheckHoistingPhase):
2667 * dfg/DFGValidate.cpp:
2668 (JSC::DFG::Validate::validate):
2670 2013-03-05 Mark Hahnenberg <mhahnenberg@apple.com>
2672 Objective-C API: JSValue should implement init and return nil in exceptional cases
2673 https://bugs.webkit.org/show_bug.cgi?id=111487
2675 Reviewed by Darin Adler.
2678 (-[JSValue init]): We return nil here because there is no way to get the instance into a coherent state
2679 without a JSContext.
2680 (-[JSValue initWithValue:inContext:]): Similarly, we should also return nil here if either of the arguments is 0.
2682 2013-03-05 Sheriff Bot <webkit.review.bot@gmail.com>
2684 Unreviewed, rolling out r144708.
2685 http://trac.webkit.org/changeset/144708
2686 https://bugs.webkit.org/show_bug.cgi?id=111447
2688 random assertion crashes in inspector tests on qt+mac bots
2689 (Requested by kling on #webkit).
2692 * GNUmakefile.list.am:
2693 * JavaScriptCore.gypi:
2694 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2695 * JavaScriptCore.xcodeproj/project.pbxproj:
2697 * runtime/JSGlobalData.cpp:
2698 (JSC::JSGlobalData::JSGlobalData):
2699 * runtime/JSGlobalData.h:
2701 * runtime/PropertyMapHashTable.h:
2703 (JSC::PropertyTable::PropertyTable):
2705 (JSC::PropertyTable::~PropertyTable):
2706 (JSC::PropertyTable::copy):
2707 * runtime/PropertyTable.cpp: Removed.
2708 * runtime/Structure.cpp:
2709 (JSC::Structure::dumpStatistics):
2710 (JSC::Structure::materializePropertyMap):
2711 (JSC::Structure::despecifyDictionaryFunction):
2712 (JSC::Structure::addPropertyTransition):
2713 (JSC::Structure::changePrototypeTransition):
2714 (JSC::Structure::despecifyFunctionTransition):
2715 (JSC::Structure::attributeChangeTransition):
2716 (JSC::Structure::toDictionaryTransition):
2717 (JSC::Structure::sealTransition):
2718 (JSC::Structure::freezeTransition):
2719 (JSC::Structure::preventExtensionsTransition):
2720 (JSC::Structure::nonPropertyTransition):
2721 (JSC::Structure::isSealed):
2722 (JSC::Structure::isFrozen):
2723 (JSC::Structure::flattenDictionaryStructure):
2724 (JSC::Structure::pin):
2725 (JSC::Structure::copyPropertyTable):
2726 (JSC::Structure::copyPropertyTableForPinning):
2727 (JSC::Structure::get):
2728 (JSC::Structure::despecifyFunction):
2729 (JSC::Structure::despecifyAllFunctions):
2730 (JSC::Structure::putSpecificValue):
2731 (JSC::Structure::remove):
2732 (JSC::Structure::createPropertyMap):
2733 (JSC::Structure::getPropertyNamesFromStructure):
2734 (JSC::Structure::visitChildren):
2735 (JSC::Structure::checkConsistency):
2736 * runtime/Structure.h:
2738 (JSC::Structure::putWillGrowOutOfLineStorage):
2739 (JSC::Structure::materializePropertyMapIfNecessary):
2740 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2741 (JSC::Structure::checkOffsetConsistency):
2743 * runtime/StructureInlines.h:
2744 (JSC::Structure::get):
2745 * runtime/WriteBarrier.h:
2746 (JSC::WriteBarrierBase::get):
2748 2013-03-05 David Kilzer <ddkilzer@apple.com>
2750 BUILD FIX (r144698): Only enable SPEECH_SYNTHESIS for Mac
2751 <http://webkit.org/b/106742>
2753 Fixes the following build failures:
2755 Undefined symbols for architecture i386:
2756 "__ZTVN7WebCore25PlatformSpeechSynthesizerE", referenced from:
2757 __ZN7WebCore25PlatformSpeechSynthesizerC2EPNS_31PlatformSpeechSynthesizerClientE in PlatformSpeechSynthesizer.o
2758 NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
2759 "__ZN7WebCore25PlatformSpeechSynthesizer19initializeVoiceListEv", referenced from:
2760 __ZN7WebCore25PlatformSpeechSynthesizerC2EPNS_31PlatformSpeechSynthesizerClientE in PlatformSpeechSynthesizer.o
2761 ld: symbol(s) not found for architecture i386
2763 * Configurations/FeatureDefines.xcconfig:
2764 - Fix definition of ENABLE_ENCRYPTED_MEDIA_V2_macosx to match
2765 other FeatureDefines.xcconfig files.
2766 - Only set ENABLE_SPEECH_SYNTHESIS for the macosx platform.
2768 2013-03-04 Andreas Kling <akling@apple.com>
2770 Unused Structure property tables waste 14MB on Membuster.
2771 <http://webkit.org/b/110854>
2772 <rdar://problem/13292104>
2774 Reviewed by Geoffrey Garen.
2776 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
2777 14 MB progression on Membuster3.
2780 * GNUmakefile.list.am:
2781 * JavaScriptCore.gypi:
2782 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2783 * JavaScriptCore.xcodeproj/project.pbxproj:
2786 Added PropertyTable.cpp.
2788 * runtime/PropertyTable.cpp: Added.
2789 (JSC::PropertyTable::create):
2790 (JSC::PropertyTable::clone):
2791 (JSC::PropertyTable::PropertyTable):
2792 (JSC::PropertyTable::destroy):
2793 (JSC::PropertyTable::~PropertyTable):
2794 (JSC::PropertyTable::visitChildren):
2796 Moved marking of property table values here from Structure::visitChildren().
2798 * runtime/WriteBarrier.h:
2799 (JSC::WriteBarrierBase::get):
2801 Move m_cell to a local before using it multiple times. This avoids a multiple-access race when
2802 Structure::checkOffsetConsistency() is used in assertions on the main thread while a marking thread
2803 zaps the property table.
2805 * runtime/Structure.h:
2806 (JSC::Structure::materializePropertyMapIfNecessary):
2807 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2808 * runtime/StructureInlines.h:
2809 (JSC::Structure::propertyTable):
2811 Added a getter for the Structure's PropertyTable that ASSERTs GC currently isn't active.
2812 Because GC can zap an unpinned property table at any time, it's not entirely safe to access it.
2813 Renamed the variable itself to m_propertyTableUnsafe to force call sites into explaining themselves.
2815 (JSC::Structure::putWillGrowOutOfLineStorage):
2816 (JSC::Structure::checkOffsetConsistency):
2818 Moved these out of Structure.h to break header dependency cycle between Structure/PropertyTable.
2820 * runtime/Structure.cpp:
2821 (JSC::Structure::visitChildren):
2823 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
2825 * runtime/JSGlobalData.h:
2826 * runtime/JSGlobalData.cpp:
2827 (JSC::JSGlobalData::JSGlobalData):
2829 Add a global propertyTableStructure.
2831 * runtime/PropertyMapHashTable.h:
2833 (JSC::PropertyTable::createStructure):
2834 (JSC::PropertyTable::copy):
2836 Make PropertyTable a GC object.
2838 * runtime/Structure.cpp:
2839 (JSC::Structure::dumpStatistics):
2840 (JSC::Structure::materializePropertyMap):
2841 (JSC::Structure::despecifyDictionaryFunction):
2842 (JSC::Structure::addPropertyTransition):
2843 (JSC::Structure::changePrototypeTransition):
2844 (JSC::Structure::despecifyFunctionTransition):
2845 (JSC::Structure::attributeChangeTransition):
2846 (JSC::Structure::toDictionaryTransition):
2847 (JSC::Structure::sealTransition):
2848 (JSC::Structure::freezeTransition):
2849 (JSC::Structure::preventExtensionsTransition):
2850 (JSC::Structure::nonPropertyTransition):
2851 (JSC::Structure::isSealed):
2852 (JSC::Structure::isFrozen):
2853 (JSC::Structure::flattenDictionaryStructure):
2854 (JSC::Structure::pin):
2855 (JSC::Structure::copyPropertyTable):
2856 (JSC::Structure::copyPropertyTableForPinning):
2857 (JSC::Structure::get):
2858 (JSC::Structure::despecifyFunction):
2859 (JSC::Structure::despecifyAllFunctions):
2860 (JSC::Structure::putSpecificValue):
2861 (JSC::Structure::remove):
2862 (JSC::Structure::createPropertyMap):
2863 (JSC::Structure::getPropertyNamesFromStructure):
2864 (JSC::Structure::checkConsistency):
2866 2013-03-04 Chris Fleizach <cfleizach@apple.com>
2868 Support WebSpeech - Speech Synthesis
2869 https://bugs.webkit.org/show_bug.cgi?id=106742
2871 Reviewed by Simon Fraser.
2873 Enable speech synthesis for the Mac.
2875 * Configurations/FeatureDefines.xcconfig:
2877 2013-03-04 Mark Hahnenberg <mhahnenberg@apple.com>
2879 Remove contextInternalContext from JSContextInternal.h
2880 https://bugs.webkit.org/show_bug.cgi?id=111356
2882 Reviewed by Geoffrey Garen.
2884 We don't need it any more since we have globalContextRef in JSContext.
2887 * API/JSContextInternal.h:
2889 (+[JSValue valueWithBool:inContext:]):
2890 (+[JSValue valueWithDouble:inContext:]):
2891 (+[JSValue valueWithInt32:inContext:]):
2892 (+[JSValue valueWithUInt32:inContext:]):
2893 (+[JSValue valueWithNewObjectInContext:]):
2894 (+[JSValue valueWithNewArrayInContext:]):
2895 (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]):
2896 (+[JSValue valueWithNewErrorFromMessage:inContext:]):
2897 (+[JSValue valueWithNullInContext:]):
2898 (+[JSValue valueWithUndefinedInContext:]):
2899 (-[JSValue toBool]):
2900 (-[JSValue toDouble]):
2901 (-[JSValue toNumber]):
2902 (-[JSValue toString]):
2903 (-[JSValue toDate]):
2904 (-[JSValue toArray]):
2905 (-[JSValue toDictionary]):
2906 (-[JSValue valueForProperty:]):
2907 (-[JSValue setValue:forProperty:]):
2908 (-[JSValue deleteProperty:]):
2909 (-[JSValue hasProperty:]):
2910 (-[JSValue valueAtIndex:]):
2911 (-[JSValue setValue:atIndex:]):
2912 (-[JSValue isUndefined]):
2913 (-[JSValue isNull]):
2914 (-[JSValue isBoolean]):
2915 (-[JSValue isNumber]):
2916 (-[JSValue isString]):
2917 (-[JSValue isObject]):
2918 (-[JSValue isEqualToObject:]):
2919 (-[JSValue isEqualWithTypeCoercionToObject:]):
2920 (-[JSValue isInstanceOf:]):
2921 (-[JSValue callWithArguments:]):
2922 (-[JSValue constructWithArguments:]):
2923 (-[JSValue invokeMethod:withArguments:]):
2925 (objectToValueWithoutCopy):
2927 (-[JSValue initWithValue:inContext:]):
2928 (-[JSValue dealloc]):
2929 (-[JSValue description]):
2930 * API/JSWrapperMap.mm:
2931 (createObjectWithCustomBrand):
2932 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]):
2933 (-[JSObjCClassInfo wrapperForObject:]):
2934 (-[JSWrapperMap jsWrapperForObject:]):
2935 * API/ObjCCallbackFunction.mm:
2936 (ObjCCallbackFunction::call):
2937 (objCCallbackFunctionForInvocation):
2939 2013-03-04 Andreas Kling <akling@apple.com>
2941 Add simple vector traits for JSC::Identifier.
2942 <http://webkit.org/b/111323>
2944 Reviewed by Geoffrey Garen.
2946 Identifiers are really just Strings, giving them simple vector traits makes
2947 Vector move them with memcpy() instead of churning the refcounts.
2949 * runtime/Identifier.h:
2952 2013-03-04 Kunihiko Sakamoto <ksakamoto@chromium.org>
2954 Add build flag for FontLoader
2955 https://bugs.webkit.org/show_bug.cgi?id=111289
2957 Reviewed by Benjamin Poulain.
2959 Add ENABLE_FONT_LOAD_EVENTS build flag (disabled by default).
2961 * Configurations/FeatureDefines.xcconfig:
2963 2013-03-03 Andreas Kling <akling@apple.com>
2965 Shrink JSC::HashTable entries.
2966 <http://webkit.org/b/111275>
2967 <rdar://problem/13333511>
2969 Reviewed by Anders Carlsson.
2971 Move the Intrinsic value out of the function-specific part of the union,
2972 and store it next to m_attributes. Reduces the size of HashEntry by 8 bytes.
2974 990 kB progression on Membuster3. (PTUS: 797 kB)
2977 (JSC::HashEntry::initialize):
2978 (JSC::HashEntry::intrinsic):
2981 2013-03-01 David Kilzer <ddkilzer@apple.com>
2983 BUILD FIX: testapi should link to Foundation, not CoreFoundation
2985 * JavaScriptCore.xcodeproj/project.pbxproj: Change testapi to
2986 link to Foundation.framework instead of CoreFoundation.framework
2987 since it uses NS types.
2989 2013-03-01 Mark Hahnenberg <mhahnenberg@apple.com>
2991 Objective-C API: Passing JS functions to Objective-C callbacks causes JSValue to leak
2992 https://bugs.webkit.org/show_bug.cgi?id=107836
2994 Reviewed by Oliver Hunt.
2996 We've decided to remove support for this feature from the API because there's no way to automatically manage
2997 the memory for clients in a satisfactory manner. Clients can still pass JS functions to Objective-C methods,
2998 but the methods must accept plain JSValues instead of Objective-C blocks.
3000 We now ignore functions that are part of a protocol that inherits from JSExport that accept blocks as arguments.
3002 * API/JSBlockAdaptor.h: Removed.
3003 * API/JSBlockAdaptor.mm: Removed.
3004 * API/ObjCCallbackFunction.mm:
3005 (ArgumentTypeDelegate::typeBlock): Return nil to signal that we want to ignore this function when copying it
3006 to the object from the protocol.
3007 * API/tests/testapi.mm: Added a test to make sure that we ignore methods declared as part of a JSExport-ed protocol
3008 that have block arguments.
3009 (-[TestObject bogusCallback:]):
3010 * JavaScriptCore.gypi: Updated build files.
3011 * JavaScriptCore.xcodeproj/project.pbxproj:
3013 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3015 DFG Branch(LogicalNot) peephole should not try to optimize and work-around the case where LogicalNot may be otherwise live
3016 https://bugs.webkit.org/show_bug.cgi?id=111209
3018 Reviewed by Oliver Hunt.
3020 Even if it is then everything will work just fine. It's not necessary to check the ref count here.
3022 * dfg/DFGFixupPhase.cpp:
3023 (JSC::DFG::FixupPhase::fixupNode):
3025 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3027 DFG CSE phase shouldn't rely on ref count of nodes, since it doesn't have to
3028 https://bugs.webkit.org/show_bug.cgi?id=111205
3030 Reviewed by Oliver Hunt.
3032 I don't understand the intuition behind setLocalStoreElimination() validating that the SetLocal's ref count
3033 is 1. I believe this is a hold-over from when setLocalStoreElimination() would match one SetLocal to another,
3034 and then try to eliminate the first SetLocal. But that's not how it works now. Now, setLocalStoreElimination()
3035 is actually Flush elimination: it eliminates any Flush that anchors a SetLocal if it proves that every path
3036 from the SetLocal to the Flush is devoid of operations that may observe the local. It doesn't actually kill
3037 the SetLocal itself: if the SetLocal is live because of other things (other Flushes or GetLocals in other
3038 basic blocks), then the SetLocal will naturally still be alive because th Flush was only keeping the SetLocal
3039 alive by one count rather than being solely responsible for its liveness.
3041 * dfg/DFGCSEPhase.cpp:
3042 (JSC::DFG::CSEPhase::setLocalStoreElimination):
3043 (JSC::DFG::CSEPhase::eliminate):
3044 (JSC::DFG::CSEPhase::performNodeCSE):
3046 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3048 Rename MovHint to MovHintEvent so I can create a NodeType called MovHint
3050 Rubber stamped by Mark Hahnenberg.
3052 This is similar to the SetLocal/SetLocalEvent naming scheme, where SetLocal is the
3053 NodeType and SetLocalEvent is the VariableEventKind.
3055 * dfg/DFGVariableEvent.cpp:
3056 (JSC::DFG::VariableEvent::dump):
3057 * dfg/DFGVariableEvent.h:
3058 (JSC::DFG::VariableEvent::movHint):
3059 (JSC::DFG::VariableEvent::id):
3060 (JSC::DFG::VariableEvent::operand):
3062 * dfg/DFGVariableEventStream.cpp:
3063 (JSC::DFG::VariableEventStream::reconstruct):
3065 2013-03-01 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
3067 [JSC] Fix sign comparison warning/error after r144340.
3068 https://bugs.webkit.org/show_bug.cgi?id=111164
3070 Reviewed by Mark Hahnenberg.
3072 gcc (both 4.2.1 and 4.7.2) complain about comparing signed and
3073 unsigned terms (clang accepts it just fine).
3075 Work around that by casting the 1 to an uintptr_t as well.
3078 (JSC::DFG::Edge::makeWord):
3080 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3082 DFG CFA should not do liveness pruning
3083 https://bugs.webkit.org/show_bug.cgi?id=111119
3085 Reviewed by Mark Hahnenberg.
3087 It adds complexity and probably buys nothing. Moreover, I'm transitioning to having
3088 liveness only available at the bitter end of compilation, so this will stop working
3089 after https://bugs.webkit.org/show_bug.cgi?id=109389 anyway.
3091 * dfg/DFGAbstractState.cpp:
3092 (JSC::DFG::AbstractState::initialize):
3093 (JSC::DFG::AbstractState::mergeStateAtTail):
3095 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3097 Don't try to emit profiling if you don't have the DFG JIT.
3099 Rubber stamped by Mark Hahnenberg.
3102 (JSC::JIT::shouldEmitProfiling):
3104 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3106 DFG Phantom node should be honest about the fact that it can exit
3107 https://bugs.webkit.org/show_bug.cgi?id=111115
3109 Reviewed by Mark Hahnenberg.
3111 The chances of this having cause serious issues are low, since most clients of the
3112 NodeDoesNotExit flag run after CFA and CFA updates this properly. But one possible
3113 case of badness is if the ByteCodeParser inserted a Phantom with a type check in
3114 between a LogicalNot and a Branch; then that peephole optimization in Fixup might
3117 * dfg/DFGNodeType.h:
3120 2013-02-28 Mark Hahnenberg <mhahnenberg@apple.com>
3122 Add casts in DFGGPRInfo.h to suppress warnings
3123 https://bugs.webkit.org/show_bug.cgi?id=111104
3125 Reviewed by Filip Pizlo.
3127 With certain flags on, we get compiler warnings on ARM. We should do the proper casts to make these warnings go away.
3130 (JSC::DFG::GPRInfo::toIndex):
3131 (JSC::DFG::GPRInfo::debugName):
3133 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3135 It should be easy to determine if a DFG node exits forward or backward when doing type checks
3136 https://bugs.webkit.org/show_bug.cgi?id=111102
3138 Reviewed by Mark Hahnenberg.
3140 This adds a NodeExitsForward flag, which tells you the exit directionality of
3141 type checks performed by the node. Even if you convert the node to a Phantom
3142 and use the Edge UseKind for type checks, you'll still get the same exit
3143 directionality that the original node would have wanted.
3145 * dfg/DFGArgumentsSimplificationPhase.cpp:
3146 (JSC::DFG::ArgumentsSimplificationPhase::run):
3147 * dfg/DFGArrayifySlowPathGenerator.h:
3148 (JSC::DFG::ArrayifySlowPathGenerator::ArrayifySlowPathGenerator):
3149 * dfg/DFGCFGSimplificationPhase.cpp:
3150 (JSC::DFG::CFGSimplificationPhase::run):
3151 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
3152 * dfg/DFGCPSRethreadingPhase.cpp:
3153 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
3154 * dfg/DFGCSEPhase.cpp:
3155 (JSC::DFG::CSEPhase::setReplacement):
3156 (JSC::DFG::CSEPhase::eliminate):
3157 (JSC::DFG::CSEPhase::performNodeCSE):
3158 * dfg/DFGConstantFoldingPhase.cpp:
3159 (JSC::DFG::ConstantFoldingPhase::foldConstants):
3160 * dfg/DFGFixupPhase.cpp:
3161 (JSC::DFG::FixupPhase::checkArray):
3164 (JSC::DFG::Node::setOpAndDefaultNonExitFlags):
3165 (JSC::DFG::Node::convertToPhantom):
3166 * dfg/DFGNodeFlags.cpp:
3167 (JSC::DFG::nodeFlagsAsString):
3168 * dfg/DFGNodeFlags.h:
3170 * dfg/DFGNodeType.h:
3172 * dfg/DFGSpeculativeJIT.cpp:
3173 (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck):
3175 (JSC::DFG::SpeculativeJIT::speculationCheck):
3176 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
3177 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
3178 (JSC::DFG::SpeculativeJIT::backwardTypeCheck):
3179 (JSC::DFG::SpeculativeJIT::typeCheck):
3180 (JSC::DFG::SpeculativeJIT::forwardTypeCheck):
3181 (JSC::DFG::SpeculativeJIT::fillStorage):
3182 (JSC::DFG::SpeculativeJIT::compile):
3183 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
3184 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
3185 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
3186 * dfg/DFGSpeculativeJIT.h:
3188 (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand):
3189 (JSC::DFG::SpeculateIntegerOperand::gpr):
3190 (SpeculateIntegerOperand):
3191 (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand):
3192 (JSC::DFG::SpeculateDoubleOperand::fpr):
3193 (SpeculateDoubleOperand):
3194 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
3195 (JSC::DFG::SpeculateCellOperand::gpr):
3196 (SpeculateCellOperand):
3197 (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand):
3198 (JSC::DFG::SpeculateBooleanOperand::gpr):
3199 (SpeculateBooleanOperand):
3200 * dfg/DFGSpeculativeJIT32_64.cpp:
3201 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
3202 (JSC::DFG::SpeculativeJIT::fillSpeculateInt):
3203 (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
3204 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
3205 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3206 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
3207 (JSC::DFG::SpeculativeJIT::compile):
3208 * dfg/DFGSpeculativeJIT64.cpp:
3209 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
3210 (JSC::DFG::SpeculativeJIT::fillSpeculateInt):
3211 (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
3212 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
3213 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3214 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
3215 (JSC::DFG::SpeculativeJIT::compile):
3217 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3219 CodeBlock::valueProfile() has a bogus assertion
3220 https://bugs.webkit.org/show_bug.cgi?id=111106
3221 <rdar://problem/13131427>
3223 Reviewed by Mark Hahnenberg.
3225 This was just a bad assertion: m_bytecodeOffset == -1 means that the value profile is constructed but not initialized.
3226 ValueProfile constructs itself in a safe way; you can call any method you want on a constructed but not initialized
3227 ValueProfile. CodeBlock first constructs all ValueProfiles (by growing the ValueProfile vector) and then initializes
3228 their m_bytecodeOffset later. This is necessary because the initialization is linking bytecode instructions to their
3229 ValueProfiles, so at that point we don't want the ValueProfile vector to resize, which implies that we want all of
3230 them to already be constructed. A GC can happen during this phase, and the GC may want to walk all ValueProfiles.
3231 This is safe, but one of the ValueProfile getters (CodeBlock::valueProfile()) was asserting that any value profile
3232 you get has had its m_bytecodeOffset initialized. This need not be the case and nothing will go wrong if it isn't.
3234 The solution is to remove the assertion, which I believe was put there to ensure that my m_valueProfiles refactoring
3235 a long time ago was sound: it used to be that a ValueProfile with m_bytecodeOffset == -1 was an argument profile; now
3236 all argument profiles are in m_argumentValueProfiles instead. I think it's safe to say that this refactoring was done
3237 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
3238 sound with respect to the GC-during-CodeBlock-construction issue, and I don't believe that the assertion is buying us
3239 anything at this point.
3241 * bytecode/CodeBlock.h:
3242 (JSC::CodeBlock::valueProfile):
3244 2013-02-27 Filip Pizlo <fpizlo@apple.com>
3246 DFG CFA should leave behind information in Edge that says if the Edge's type check is proven to succeed
3247 https://bugs.webkit.org/show_bug.cgi?id=110840
3249 Reviewed by Mark Hahnenberg.
3251 This doesn't add any observable functionality to the compiler, yet. But it does give
3252 every phase that runs after CFA the ability to know, in O(1) time, whether an edge
3253 will need to execute a type check.
3255 * dfg/DFGAbstractState.h:
3256 (JSC::DFG::AbstractState::filterEdgeByUse):
3257 (JSC::DFG::AbstractState::filterByType):
3258 * dfg/DFGCommon.cpp:
3260 (WTF::printInternal):
3262 (JSC::DFG::isProved):
3264 (JSC::DFG::proofStatusForIsProved):
3267 (JSC::DFG::Edge::dump):
3269 (JSC::DFG::Edge::Edge):
3270 (JSC::DFG::Edge::setNode):
3271 (JSC::DFG::Edge::useKindUnchecked):
3272 (JSC::DFG::Edge::setUseKind):
3274 (JSC::DFG::Edge::proofStatusUnchecked):
3275 (JSC::DFG::Edge::proofStatus):
3276 (JSC::DFG::Edge::setProofStatus):
3277 (JSC::DFG::Edge::isProved):
3278 (JSC::DFG::Edge::needsCheck):
3279 (JSC::DFG::Edge::shift):
3280 (JSC::DFG::Edge::makeWord):
3282 2013-02-28 Simon Hausmann <simon.hausmann@digia.com>
3284 [Qt][Mac] Fix massive parallel builds
3286 Reviewed by Tor Arne Vestbø.
3288 There exists a race condition that LLIntDesiredOffsets.h is written to
3289 by two parllel instances of the ruby script. This patch ensures that similar to the output file,
3290 the generated file is also prefixed according to the build configuration.
3292 * LLIntOffsetsExtractor.pro:
3294 2013-02-27 Sheriff Bot <webkit.review.bot@gmail.com>
3296 Unreviewed, rolling out r144168.
3297 http://trac.webkit.org/changeset/144168
3298 https://bugs.webkit.org/show_bug.cgi?id=111019
3300 It broke the build and tronical is unavailable (Requested by
3301 Ossy_night on #webkit).
3303 * LLIntOffsetsExtractor.pro:
3305 2013-02-26 Filip Pizlo <fpizlo@apple.com>
3307 Disable some unsound DFG DCE
3308 https://bugs.webkit.org/show_bug.cgi?id=110948
3310 Reviewed by Michael Saboff.
3312 DCE of bitops is not sound since the bitops might call some variant of valueOf.
3314 This used to work right because ValueToInt32 was MustGenerate. From the DFG IR
3315 standpoint it feels weird to make ValueToInt32 be MustGenerate since that node is
3316 implemented entirely as a pure conversion. If we ever gave the DFG the ability to
3317 do effectful bitops, we would most likely implement them as special nodes not
3318 related to the ValueToInt32 and bitop nodes we have now.
3320 This change is performance neutral.
3322 * dfg/DFGNodeType.h:
3325 2013-02-27 Glenn Adams <glenn@skynav.com>
3327 Add ENABLE_CSS3_TEXT_LINE_BREAK flag.
3328 https://bugs.webkit.org/show_bug.cgi?id=110944
3330 Reviewed by Dean Jackson.
3332 * Configurations/FeatureDefines.xcconfig:
3334 2013-02-27 Julien Brianceau <jbrianceau@nds.com>
3336 Fix build when DFG_JIT is not enabled
3337 https://bugs.webkit.org/show_bug.cgi?id=110991
3339 Reviewed by Csaba Osztrogonác.
3342 (JSC::JIT::canBeOptimizedOrInlined):
3344 2013-02-27 Simon Hausmann <simon.hausmann@digia.com>
3346 [Qt][Mac] Fix massive parallel builds
3348 Reviewed by Tor Arne Vestbø.
3350 There exists a race condition that LLIntDesiredOffsets.h is written to
3351 by two parllel instances of the ruby script. This patch ensures that similar to the output file,
3352 the generated file is also prefixed according to the build configuration.
3354 * LLIntOffsetsExtractor.pro:
3356 2013-02-26 Filip Pizlo <fpizlo@apple.com>
3358 DFG OSR exit doesn't know which virtual register to use for the last result register for post_inc and post_dec
3359 https://bugs.webkit.org/show_bug.cgi?id=109036
3360 <rdar://problem/13292139>