1 2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
3 testLeakingPrototypesAcrossContexts added in r146682 doesn't compile on Win and fails on Mac
4 https://bugs.webkit.org/show_bug.cgi?id=113125
6 Reviewed by Mark Hahnenberg
8 Remove the test added in r146682 as it's now failing on Mac.
9 This is the test that was causing a compilation failure on Windows.
11 * API/tests/testapi.c:
14 2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
16 Fix the typo: WIN -> WINDOWS.
18 * API/tests/testapi.c:
21 2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
23 I really can't figure out what's wrong with this one.
24 Temporarily disable the test added by r146682 on Windows since it doesn't compile.
26 * API/tests/testapi.c:
29 2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
31 Another build fix (after r146693) for r146682.
33 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
34 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
36 2013-03-22 Roger Fong <roger_fong@apple.com>
38 Unreviewed. AppleWin build fix.
40 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
41 * JavaScriptCore.vcxproj/copy-files.cmd:
43 2013-03-22 Mark Hahnenberg <mhahnenberg@apple.com>
45 -[TinyDOMNode dealloc] should call [super dealloc] when ARC is not enabled
46 https://bugs.webkit.org/show_bug.cgi?id=113054
48 Reviewed by Geoffrey Garen.
50 * API/tests/testapi.mm:
51 (-[TinyDOMNode dealloc]):
53 2013-03-22 Mark Hahnenberg <mhahnenberg@apple.com>
55 opaqueJSClassData should be cached on JSGlobalObject, not the JSGlobalData
56 https://bugs.webkit.org/show_bug.cgi?id=113086
58 Reviewed by Geoffrey Garen.
60 opaqueJSClassData stores cached prototypes for JSClassRefs in the C API. It doesn't make sense to
61 share these prototypes within a JSGlobalData across JSGlobalObjects, and in fact doing so will cause
62 a leak of the original JSGlobalObject that these prototypes were created in. Therefore we should move
63 this cache to JSGlobalObject where it belongs and where it won't cause memory leaks.
65 * API/JSBase.cpp: Needed to add an extern "C" so that testapi.c can use the super secret GC function.
66 * API/JSClassRef.cpp: We now grab the cached context data from the global object rather than the global data.
67 (OpaqueJSClass::contextData):
68 * API/JSClassRef.h: Remove this header because it's unnecessary and causes circular dependencies.
69 * API/tests/testapi.c: Added a new test that makes sure that using the same JSClassRef in two different contexts
70 doesn't cause leaks of the original global object.
72 (nestedAllocateObject): This is a hack to bypass the conservative scan of the GC, which was unnecessarily marking
73 objects and keeping them alive, ruining the test result.
74 (testLeakingPrototypesAcrossContexts):
76 * API/tests/testapi.mm: extern "C" this so we can continue using it here.
77 * runtime/JSGlobalData.cpp: Remove JSClassRef related stuff.
78 (JSC::JSGlobalData::~JSGlobalData):
79 * runtime/JSGlobalData.h:
81 * runtime/JSGlobalObject.h: Add the stuff that JSGlobalData had. We add it to JSGlobalObjectRareData so that
82 clients who don't use the C API don't have to pay the memory cost of this extra HashMap.
84 (JSGlobalObjectRareData):
85 (JSC::JSGlobalObject::opaqueJSClassData):
87 2013-03-19 Martin Robinson <mrobinson@igalia.com>
89 [GTK] Add support for building the WebCore bindings to the gyp build
90 https://bugs.webkit.org/show_bug.cgi?id=112638
92 Reviewed by Nico Weber.
94 * JavaScriptCore.gyp/JavaScriptCoreGTK.gyp: Export all include directories to direct
95 dependents and fix the indentation of the libjavascriptcore target.
97 2013-03-21 Filip Pizlo <fpizlo@apple.com>
99 Fix some minor issues in the DFG's profiling of heap accesses
100 https://bugs.webkit.org/show_bug.cgi?id=113010
102 Reviewed by Goeffrey Garen.
104 1) If a CodeBlock gets jettisoned by GC, we should count the exit sites.
106 2) If a CodeBlock clears a structure stub during GC, it should record this, and
107 the DFG should prefer to not inline that access (i.e. treat it as if it had an
110 3) If a PutById was seen by the baseline JIT, and the JIT attempted to cache it,
111 but it chose not to, then assume that it will take slow path.
113 4) If we frequently exited because of a structure check on a weak constant,
114 don't try to inline that access in the future.
116 5) Treat all exits that were counted as being frequent.
118 81% speed-up on Octane/gbemu. Small speed-ups elsewhere, and no regressions.
120 * bytecode/CodeBlock.cpp:
121 (JSC::CodeBlock::finalizeUnconditionally):
123 (JSC::CodeBlock::resetStubDuringGCInternal):
124 (JSC::CodeBlock::reoptimize):
125 (JSC::CodeBlock::jettison):
126 (JSC::ProgramCodeBlock::jettisonImpl):
127 (JSC::EvalCodeBlock::jettisonImpl):
128 (JSC::FunctionCodeBlock::jettisonImpl):
129 (JSC::CodeBlock::tallyFrequentExitSites):
130 * bytecode/CodeBlock.h:
132 (JSC::CodeBlock::tallyFrequentExitSites):
136 * bytecode/GetByIdStatus.cpp:
137 (JSC::GetByIdStatus::computeFor):
138 * bytecode/PutByIdStatus.cpp:
139 (JSC::PutByIdStatus::computeFor):
140 * bytecode/StructureStubInfo.h:
141 (JSC::StructureStubInfo::StructureStubInfo):
143 * dfg/DFGByteCodeParser.cpp:
144 (JSC::DFG::ByteCodeParser::handleGetById):
145 (JSC::DFG::ByteCodeParser::parseBlock):
146 * dfg/DFGOSRExit.cpp:
147 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
149 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSite):
152 (JSC::DEFINE_STUB_FUNCTION):
156 2013-03-22 Filip Pizlo <fpizlo@apple.com>
158 DFG folding of PutById to SimpleReplace should consider the specialized function case
159 https://bugs.webkit.org/show_bug.cgi?id=113093
161 Reviewed by Geoffrey Garen and Mark Hahnenberg.
163 * bytecode/PutByIdStatus.cpp:
164 (JSC::PutByIdStatus::computeFor):
166 2013-03-22 David Kilzer <ddkilzer@apple.com>
168 BUILD FIX (r146558): Build testapi.mm with ARC enabled for armv7s
169 <http://webkit.org/b/112608>
171 Fixes the following build failure:
173 Source/JavaScriptCore/API/tests/testapi.mm:205:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
178 * Configurations/ToolExecutable.xcconfig: Enable ARC for armv7s
181 2013-03-22 David Kilzer <ddkilzer@apple.com>
183 Revert "BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]"
185 This fixes a build failure introduced by this change:
187 Source/JavaScriptCore/API/tests/testapi.mm:206:6: error: ARC forbids explicit message send of 'dealloc'
192 Not sure why this didn't fail locally on my Mac Pro.
194 * API/tests/testapi.mm:
195 (-[TinyDOMNode dealloc]): Remove call to [super dealloc].
197 2013-03-22 David Kilzer <ddkilzer@apple.com>
199 BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]
200 <http://webkit.org/b/112608>
202 Fixes the following build failure:
204 Source/JavaScriptCore/API/tests/testapi.mm:205:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
209 * API/tests/testapi.mm:
210 (-[TinyDOMNode dealloc]): Call [super dealloc].
212 2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
214 Leak bots erroneously report JSC::WatchpointSet as leaking
215 https://bugs.webkit.org/show_bug.cgi?id=107781
217 Reviewed by Filip Pizlo.
219 Since leaks doesn't support tagged pointers, avoid using it by flipping the bit flag to indicate
220 the entry is "fat". We set the flag when the entry is NOT fat; i.e. slim.
222 Replaced FatFlag by SlimFlag and initialized m_bits with this flag to indicate that the entry is
225 * runtime/SymbolTable.cpp:
226 (JSC::SymbolTableEntry::copySlow): Don't set FatFlag since it has been replaced by SlimFlag.
227 (JSC::SymbolTableEntry::inflateSlow): Ditto.
229 * runtime/SymbolTable.h:
230 (JSC::SymbolTableEntry::Fast::Fast): Set SlimFlag by default.
231 (JSC::SymbolTableEntry::Fast::isNull): Ignore SlimFlag.
232 (JSC::SymbolTableEntry::Fast::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag
235 (JSC::SymbolTableEntry::SymbolTableEntry): Set SlimFlag by default.
236 (JSC::SymbolTableEntry::SymbolTableEntry::getFast): Set SlimFlag when creating Fast from a fat entry.
237 (JSC::SymbolTableEntry::isNull): Ignore SlimFlag.
238 (JSC::SymbolTableEntry::FatEntry::FatEntry): Strip SlimFlag.
239 (JSC::SymbolTableEntry::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag is unset.
240 (JSC::SymbolTableEntry::fatEntry): Don't strip FatFlag as this flag doesn't exist anymore.
241 (JSC::SymbolTableEntry::pack): Preserve SlimFlag.
243 (JSC::SymbolTableIndexHashTraits): empty value is no longer zero so don't set emptyValueIsZero true.
245 2013-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
247 Objective-C API: Need a good way to preserve custom properties on JS wrappers
248 https://bugs.webkit.org/show_bug.cgi?id=112608
250 Reviewed by Geoffrey Garen.
252 Currently, we just use a weak map, which means that garbage collection can cause a wrapper to
253 disappear if it isn't directly exported to JavaScript.
255 The most straightforward and safe way (with respect to garbage collection and concurrency) is to have
256 clients add and remove their external references along with their owners. Effectively, the client is
257 recording the structure of the external object graph so that the garbage collector can make sure to
258 mark any wrappers that are reachable through either the JS object graph of the external Obj-C object
259 graph. By keeping these wrappers alive, this has the effect that custom properties on these wrappers
260 will also remain alive.
262 The rule for if an object needs to be tracked by the runtime (and therefore whether the client should report it) is as follows:
263 For a particular object, its references to its children should be added if:
264 1. The child is referenced from JavaScript.
265 2. The child contains references to other objects for which (1) or (2) are true.
267 * API/JSAPIWrapperObject.mm:
268 (JSAPIWrapperObjectHandleOwner::finalize):
269 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): A wrapper object is kept alive only if its JSGlobalObject
270 is marked and its corresponding Objective-C object was added to the set of opaque roots.
271 (JSC::JSAPIWrapperObject::visitChildren): We now call out to scanExternalObjectGraph, which handles adding all Objective-C
272 objects to the set of opaque roots.
273 * API/JSAPIWrapperObject.h:
274 (JSAPIWrapperObject):
275 * API/JSContext.mm: Moved dealloc to its proper place in the main implementation.
276 (-[JSContext dealloc]):
277 * API/JSVirtualMachine.h:
278 * API/JSVirtualMachine.mm:
279 (-[JSVirtualMachine initWithContextGroupRef:]):
280 (-[JSVirtualMachine dealloc]):
281 (getInternalObjcObject): Helper funciton to get the Objective-C object out of JSManagedValues or JSValues if there is one.
282 (-[JSVirtualMachine addManagedReference:withOwner:]): Adds the Objective-C object to the set of objects
283 owned by the owner object in that particular virtual machine.
284 (-[JSVirtualMachine removeManagedReference:withOwner:]): Removes the relationship between the two objects.
285 (-[JSVirtualMachine externalObjectGraph]):
286 (scanExternalObjectGraph): Does a depth-first search of the external object graph in a particular virtual machine starting at
287 the specified root. Each new object it encounters it adds to the set of opaque roots. These opaque roots will keep their
288 corresponding wrapper objects alive if they have them.
289 * API/JSManagedReferenceInternal.h: Added.
290 * API/JSVirtualMachine.mm: Added the per-JSVirtualMachine map between objects and the objects they own, which is more formally
291 known as that virtual machine's external object graph.
292 * API/JSWrapperMap.mm:
293 (-[JSWrapperMap dealloc]): We were leaking this before :-(
294 (-[JSVirtualMachine initWithContextGroupRef:]):
295 (-[JSVirtualMachine dealloc]):
296 (-[JSVirtualMachine externalObjectGraph]):
297 * API/JSVirtualMachineInternal.h:
298 * API/tests/testapi.mm: Added two new tests using the TinyDOMNode class. The first tests that a custom property added to a wrapper
299 doesn't vanish after GC, even though that wrapper isn't directly accessible to the JS garbage collector but is accessible through
300 the external Objective-C object graph. The second test makes sure that adding an object to the external object graph with the same
301 owner doesn't cause any sort of problems.
302 (+[TinyDOMNode sharedVirtualMachine]):
303 (-[TinyDOMNode init]):
304 (-[TinyDOMNode dealloc]):
305 (-[TinyDOMNode appendChild:]):
306 (-[TinyDOMNode numberOfChildren]):
307 (-[TinyDOMNode childAtIndex:]):
308 (-[TinyDOMNode removeChildAtIndex:]):
309 * JavaScriptCore.xcodeproj/project.pbxproj:
310 * heap/SlotVisitor.h:
312 * heap/SlotVisitorInlines.h:
313 (JSC::SlotVisitor::containsOpaqueRootTriState): Added a new method to SlotVisitor to allow scanExternalObjectGraph to have a
314 thread-safe view of opaque roots during parallel marking. The set of opaque roots available to any one SlotVisitor isn't guaranteed
315 to be 100% correct, but that just results in a small duplication of work in scanExternalObjectGraph. To indicate this change for
316 false negatives we return a TriState that's either true or mixed, but never false.
318 2013-03-21 Mark Lam <mark.lam@apple.com>
320 Fix O(n^2) op_debug bytecode charPosition to column computation.
321 https://bugs.webkit.org/show_bug.cgi?id=112957.
323 Reviewed by Geoffrey Garen.
325 The previous algorithm does a linear reverse scan of the source string
326 to find the line start for any given char position. This results in a
327 O(n^2) algortithm when the source string has no line breaks.
329 The new algorithm computes a line start column table for a
330 SourceProvider on first use. This line start table is used to fix up
331 op_debug's charPosition operand into a column operand when an
332 UnlinkedCodeBlock is linked into a CodeBlock. The initialization of
333 the line start table is O(n), and the CodeBlock column fix up is
336 * bytecode/CodeBlock.cpp:
337 (JSC::CodeBlock::dumpBytecode):
338 (JSC::CodeBlock::CodeBlock): - do column fix up.
339 * interpreter/Interpreter.cpp:
340 (JSC::Interpreter::debug): - no need to do column fixup anymore.
341 * interpreter/Interpreter.h:
343 (JSC::DEFINE_STUB_FUNCTION):
344 * llint/LLIntSlowPaths.cpp:
345 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
346 * parser/SourceProvider.cpp:
347 (JSC::SourceProvider::lineStarts):
348 (JSC::charPositionExtractor):
349 (JSC::SourceProvider::charPositionToColumnNumber):
350 - initialize line start column table if needed.
351 - look up line start for the given char position.
352 * parser/SourceProvider.h:
354 2013-03-21 Filip Pizlo <fpizlo@apple.com>
356 JSC profiler should have an at-a-glance report of the success of DFG optimization
357 https://bugs.webkit.org/show_bug.cgi?id=112988
359 Reviewed by Geoffrey Garen.
361 * dfg/DFGByteCodeParser.cpp:
362 (JSC::DFG::ByteCodeParser::handleCall):
363 (JSC::DFG::ByteCodeParser::handleGetById):
364 (JSC::DFG::ByteCodeParser::parseBlock):
365 * profiler/ProfilerCompilation.cpp:
366 (JSC::Profiler::Compilation::Compilation):
367 (JSC::Profiler::Compilation::toJS):
368 * profiler/ProfilerCompilation.h:
369 (JSC::Profiler::Compilation::noticeInlinedGetById):
370 (JSC::Profiler::Compilation::noticeInlinedPutById):
371 (JSC::Profiler::Compilation::noticeInlinedCall):
373 * runtime/CommonIdentifiers.h:
375 2013-03-21 Mark Lam <mark.lam@apple.com>
377 Fix lexer charPosition computation when "rewind"ing the lexer.
378 https://bugs.webkit.org/show_bug.cgi?id=112952.
380 Reviewed by Michael Saboff.
382 Changed the Lexer to no longer keep a m_charPosition. Instead, we compute
383 currentCharPosition() from m_code and m_codeStartPlusOffset, where
384 m_codeStartPlusOffset is the SourceProvider m_codeStart + the SourceCode
385 start offset. This ensures that the charPosition is always in sync with
390 (JSC::::internalShift):
394 (JSC::Lexer::currentCharPosition):
395 (JSC::::lexExpectIdentifier):
397 2013-03-21 Alberto Garcia <agarcia@igalia.com>
399 [BlackBerry] GCActivityCallback: replace JSLock with JSLockHolder
400 https://bugs.webkit.org/show_bug.cgi?id=112448
402 Reviewed by Xan Lopez.
404 This changed in r121381.
406 * runtime/GCActivityCallbackBlackBerry.cpp:
407 (JSC::DefaultGCActivityCallback::doWork):
409 2013-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
411 Objective-C API: wrapperClass holds a static JSClassRef, which causes JSGlobalObjects to leak
412 https://bugs.webkit.org/show_bug.cgi?id=112856
414 Reviewed by Geoffrey Garen.
416 Through a very convoluted path that involves the caching of prototypes on the JSClassRef, we can leak
417 JSGlobalObjects when inserting an Objective-C object into multiple independent JSContexts.
419 * API/JSAPIWrapperObject.cpp: Removed.
420 * API/JSAPIWrapperObject.h:
421 (JSAPIWrapperObject):
422 * API/JSAPIWrapperObject.mm: Copied from Source/JavaScriptCore/API/JSAPIWrapperObject.cpp. Made this an
423 Objective-C++ file so that we can call release on the wrappedObject. Also added a WeakHandleOwner for
424 JSAPIWrapperObjects. This will also be used in a future patch for https://bugs.webkit.org/show_bug.cgi?id=112608.
425 (JSAPIWrapperObjectHandleOwner):
426 (jsAPIWrapperObjectHandleOwner):
427 (JSAPIWrapperObjectHandleOwner::finalize): This finalize replaces the old finalize that was done through
429 (JSC::JSAPIWrapperObject::finishCreation): Allocate the WeakImpl. Balanced in finalize.
430 (JSC::JSAPIWrapperObject::setWrappedObject): We now do the retain of the wrappedObject here rather than in random
431 places scattered around JSWrapperMap.mm
432 * API/JSObjectRef.cpp: Added some ifdefs for platforms that don't support the Obj-C API.
433 (JSObjectGetPrivate): Ditto.
434 (JSObjectSetPrivate): Ditto.
435 (JSObjectGetPrivateProperty): Ditto.
436 (JSObjectSetPrivateProperty): Ditto.
437 (JSObjectDeletePrivateProperty): Ditto.
438 * API/JSValueRef.cpp: Ditto.
439 (JSValueIsObjectOfClass): Ditto.
440 * API/JSWrapperMap.mm: Remove wrapperClass().
441 (objectWithCustomBrand): Change to no longer use a parent class, which was only used to give the ability to
442 finalize wrapper objects.
443 (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]): Change to no longer use wrapperClass().
444 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): Ditto.
445 (tryUnwrapObjcObject): We now check if the object inherits from JSAPIWrapperObject.
446 * API/tests/testapi.mm: Added a test that exports an Objective-C object to two different JSContexts and makes
447 sure that the first one is collected properly by using a weak JSManagedValue for the wrapper in the first JSContext.
448 * CMakeLists.txt: Build file modifications.
449 * GNUmakefile.list.am: Ditto.
450 * JavaScriptCore.gypi: Ditto.
451 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
452 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Ditto.
453 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.
454 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
455 * runtime/JSGlobalObject.cpp: More ifdefs for unsupported platforms.
456 (JSC::JSGlobalObject::reset): Ditto.
457 (JSC::JSGlobalObject::visitChildren): Ditto.
458 * runtime/JSGlobalObject.h: Ditto.
459 (JSGlobalObject): Ditto.
460 (JSC::JSGlobalObject::objcCallbackFunctionStructure): Ditto.
462 2013-03-21 Anton Muhin <antonm@chromium.org>
464 Unreviewed, rolling out r146483.
465 http://trac.webkit.org/changeset/146483
466 https://bugs.webkit.org/show_bug.cgi?id=111695
470 * bytecode/GlobalResolveInfo.h: Removed property svn:mergeinfo.
472 2013-03-21 Gabor Rapcsanyi <rgabor@webkit.org>
474 Implement LLInt for CPU(ARM_TRADITIONAL)
475 https://bugs.webkit.org/show_bug.cgi?id=97589
477 Reviewed by Zoltan Herczeg.
479 Enable LLInt for ARMv5 and ARMv7 traditional as well.
481 * llint/LLIntOfflineAsmConfig.h:
482 * llint/LowLevelInterpreter.asm:
483 * llint/LowLevelInterpreter32_64.asm:
485 * offlineasm/backends.rb:
486 * offlineasm/instructions.rb:
488 2013-03-20 Cosmin Truta <ctruta@blackberry.com>
490 [QNX][ARM] REGRESSION(r135330): Various failures in Octane
491 https://bugs.webkit.org/show_bug.cgi?id=112863
495 This was fixed in http://trac.webkit.org/changeset/146396 on Linux only.
496 Enable this fix on QNX.
498 * assembler/ARMv7Assembler.h:
500 (JSC::ARMv7Assembler::replaceWithJump):
501 (JSC::ARMv7Assembler::maxJumpReplacementSize):
502 * assembler/MacroAssemblerARMv7.h:
503 (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):
505 2013-03-20 Filip Pizlo <fpizlo@apple.com>
507 Fix indentation of JSString.h
509 Rubber stamped by Mark Hahnenberg.
511 * runtime/JSString.h:
513 2013-03-20 Filip Pizlo <fpizlo@apple.com>
515 "" + x where x is not a string should be optimized by the DFG to some manner of ToString conversion
516 https://bugs.webkit.org/show_bug.cgi?id=112845
518 Reviewed by Mark Hahnenberg.
520 I like to do "" + x. So I decided to make DFG recognize it, and related idioms.
522 * dfg/DFGFixupPhase.cpp:
523 (JSC::DFG::FixupPhase::fixupNode):
524 (JSC::DFG::FixupPhase::fixupToPrimitive):
526 (JSC::DFG::FixupPhase::fixupToString):
527 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
528 * dfg/DFGPredictionPropagationPhase.cpp:
529 (JSC::DFG::resultOfToPrimitive):
531 (JSC::DFG::PredictionPropagationPhase::propagate):
532 * dfg/DFGPredictionPropagationPhase.h:
535 2013-03-20 Zoltan Herczeg <zherczeg@webkit.org>
537 ARMv7 replaceWithJump ASSERT failure after r135330.
538 https://bugs.webkit.org/show_bug.cgi?id=103146
540 Reviewed by Filip Pizlo.
542 On Linux, the 24 bit distance range of jumps sometimes does not
543 enough to cover all targets addresses. This patch supports jumps
544 outside of this range using a mov/movt/bx 10 byte long sequence.
546 * assembler/ARMv7Assembler.h:
548 (JSC::ARMv7Assembler::revertJumpTo_movT3movtcmpT2):
549 (JSC::ARMv7Assembler::nopw):
550 (JSC::ARMv7Assembler::label):
551 (JSC::ARMv7Assembler::replaceWithJump):
552 (JSC::ARMv7Assembler::maxJumpReplacementSize):
553 * assembler/MacroAssemblerARMv7.h:
554 (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):
556 2013-03-20 Mark Hahnenberg <mhahnenberg@apple.com>
558 Objective-C API: Fix over-releasing in allocateConstructorAndPrototypeWithSuperClassInfo:
559 https://bugs.webkit.org/show_bug.cgi?id=112832
561 Reviewed by Geoffrey Garen.
563 If either the m_constructor or m_prototype (but not both) is collected, we will call
564 allocateConstructorAndPrototypeWithSuperClassInfo, which will create a new object to replace the one
565 that was collected, but at the end of the method we call release on both of them.
566 This is incorrect since we autorelease the JSValue in the case that the object doesn't need to be
567 reallocated. Thus we'll end up overreleasing later during the drain of the autorelease pool.
569 * API/JSWrapperMap.mm:
570 (objectWithCustomBrand): We no longer alloc here. We instead call the JSValue valueWithValue class method,
571 which autoreleases for us.
572 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): We no longer call release on the
573 constructor or prototype JSValues.
574 * API/tests/testapi.mm: Added a new test that crashes on ToT due to over-releasing.
576 2013-03-19 Filip Pizlo <fpizlo@apple.com>
578 It's called "Hash Consing" not "Hash Consting"
579 https://bugs.webkit.org/show_bug.cgi?id=112768
581 Rubber stamped by Mark Hahnenberg.
583 See http://en.wikipedia.org/wiki/Hash_consing
585 * heap/GCThreadSharedData.cpp:
586 (JSC::GCThreadSharedData::GCThreadSharedData):
587 (JSC::GCThreadSharedData::reset):
588 * heap/GCThreadSharedData.h:
589 (GCThreadSharedData):
590 * heap/SlotVisitor.cpp:
591 (JSC::SlotVisitor::SlotVisitor):
592 (JSC::SlotVisitor::setup):
593 (JSC::SlotVisitor::reset):
594 (JSC::JSString::tryHashConsLock):
595 (JSC::JSString::releaseHashConsLock):
596 (JSC::JSString::shouldTryHashCons):
597 (JSC::SlotVisitor::internalAppend):
598 * heap/SlotVisitor.h:
600 * runtime/JSGlobalData.cpp:
601 (JSC::JSGlobalData::JSGlobalData):
602 * runtime/JSGlobalData.h:
604 (JSC::JSGlobalData::haveEnoughNewStringsToHashCons):
605 (JSC::JSGlobalData::resetNewStringsSinceLastHashCons):
606 * runtime/JSString.h:
607 (JSC::JSString::finishCreation):
609 (JSC::JSString::isHashConsSingleton):
610 (JSC::JSString::clearHashConsSingleton):
611 (JSC::JSString::setHashConsSingleton):
613 2013-03-20 Filip Pizlo <fpizlo@apple.com>
615 DFG implementation of op_strcat should inline rope allocations
616 https://bugs.webkit.org/show_bug.cgi?id=112780
618 Reviewed by Oliver Hunt.
620 This gets rid of the StrCat node and adds a MakeRope node. The MakeRope node can
621 take either two or three operands, and allocates a rope string with either two or
622 three fibers. (The magic choice of three children for non-VarArg nodes happens to
623 match exactly with the magic choice of three fibers for rope strings.)
625 ValueAdd on KnownString is replaced with MakeRope with two children.
627 StrCat gets replaced by an appropriate sequence of MakeRope's.
629 MakeRope does not do the dynamic check to see if its children are empty strings.
630 This is replaced by a static check, instead. The downside is that we may use more
631 memory if the strings passed to MakeRope turn out to dynamically be empty. The
632 upside is that we do fewer checks in the cases where either the strings are not
633 empty, or where the strings are statically known to be empty. I suspect both of
634 those cases are more common, than the case where the string is dynamically empty.
636 This also results in some badness for X86. MakeRope needs six registers if it is
637 allocating a three-rope. We don't have six registers to spare on X86. Currently,
638 the code side-steps this problem by just never usign three-ropes in optimized
639 code on X86. All other architectures, including X86_64, don't have this problem.
641 This is a shocking speed-up. 9% progressions on both V8/splay and
642 SunSpider/date-format-xparb. 1% progression on V8v7 overall, and ~0.5% progression
643 on SunSpider. 2x speed-up on microbenchmarks that test op_strcat.
645 * dfg/DFGAbstractState.cpp:
646 (JSC::DFG::AbstractState::executeEffects):
647 * dfg/DFGAdjacencyList.h:
649 (JSC::DFG::AdjacencyList::removeEdge):
650 * dfg/DFGArgumentsSimplificationPhase.cpp:
651 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
652 * dfg/DFGBackwardsPropagationPhase.cpp:
653 (JSC::DFG::BackwardsPropagationPhase::propagate):
654 * dfg/DFGByteCodeParser.cpp:
655 (JSC::DFG::ByteCodeParser::parseBlock):
656 * dfg/DFGCSEPhase.cpp:
657 (JSC::DFG::CSEPhase::putStructureStoreElimination):
658 (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
659 (JSC::DFG::CSEPhase::performNodeCSE):
660 * dfg/DFGDCEPhase.cpp:
661 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
662 * dfg/DFGFixupPhase.cpp:
663 (JSC::DFG::FixupPhase::fixupNode):
664 (JSC::DFG::FixupPhase::createToString):
665 (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
666 (JSC::DFG::FixupPhase::convertStringAddUse):
668 (JSC::DFG::FixupPhase::convertToMakeRope):
669 (JSC::DFG::FixupPhase::fixupMakeRope):
670 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
673 * dfg/DFGOperations.cpp:
674 * dfg/DFGOperations.h:
675 * dfg/DFGPredictionPropagationPhase.cpp:
676 (JSC::DFG::PredictionPropagationPhase::propagate):
677 * dfg/DFGSpeculativeJIT.cpp:
678 (JSC::DFG::SpeculativeJIT::compileAdd):
679 (JSC::DFG::SpeculativeJIT::compileMakeRope):
681 * dfg/DFGSpeculativeJIT.h:
682 (JSC::DFG::SpeculativeJIT::callOperation):
684 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
685 (JSC::DFG::SpeculateCellOperand::~SpeculateCellOperand):
686 (JSC::DFG::SpeculateCellOperand::gpr):
687 (JSC::DFG::SpeculateCellOperand::use):
688 * dfg/DFGSpeculativeJIT32_64.cpp:
689 (JSC::DFG::SpeculativeJIT::compile):
690 * dfg/DFGSpeculativeJIT64.cpp:
691 (JSC::DFG::SpeculativeJIT::compile):
692 * runtime/JSString.h:
695 2013-03-20 Peter Gal <galpeter@inf.u-szeged.hu>
697 Implement and32 on MIPS platform
698 https://bugs.webkit.org/show_bug.cgi?id=112665
700 Reviewed by Zoltan Herczeg.
702 * assembler/MacroAssemblerMIPS.h:
703 (JSC::MacroAssemblerMIPS::and32): Added missing method.
704 (MacroAssemblerMIPS):
706 2013-03-20 Mark Lam <mark.lam@apple.com>
708 Fix incorrect debugger column number value.
709 https://bugs.webkit.org/show_bug.cgi?id=112741.
711 Reviewed by Oliver Hunt.
713 1. In lexer, parser, and debugger code, renamed column to charPosition.
714 2. Convert the charPosition to the equivalent column number before
715 passing it to the debugger.
716 3. Changed ScopeNodes to take both a startLocation and an endLocation.
717 This allows FunctionBodyNodes, ProgramNodes, and EvalNodess to emit
718 correct debug hooks with correct starting line and column numbers.
719 4. Fixed the Lexer to not reset the charPosition (previously
720 columnNumber) in Lexer::lex().
722 * JavaScriptCore.order:
723 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
724 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
725 * bytecode/CodeBlock.cpp:
726 (JSC::CodeBlock::dumpBytecode):
727 * bytecompiler/BytecodeGenerator.cpp:
728 (JSC::BytecodeGenerator::emitDebugHook):
729 * bytecompiler/BytecodeGenerator.h:
730 (JSC::BytecodeGenerator::emitExpressionInfo):
731 * bytecompiler/NodesCodegen.cpp:
732 (JSC::ArrayNode::toArgumentList):
733 (JSC::ConstStatementNode::emitBytecode):
734 (JSC::EmptyStatementNode::emitBytecode):
735 (JSC::DebuggerStatementNode::emitBytecode):
736 (JSC::ExprStatementNode::emitBytecode):
737 (JSC::VarStatementNode::emitBytecode):
738 (JSC::IfNode::emitBytecode):
739 (JSC::IfElseNode::emitBytecode):
740 (JSC::DoWhileNode::emitBytecode):
741 (JSC::WhileNode::emitBytecode):
742 (JSC::ForNode::emitBytecode):
743 (JSC::ForInNode::emitBytecode):
744 (JSC::ContinueNode::emitBytecode):
745 (JSC::BreakNode::emitBytecode):
746 (JSC::ReturnNode::emitBytecode):
747 (JSC::WithNode::emitBytecode):
748 (JSC::SwitchNode::emitBytecode):
749 (JSC::LabelNode::emitBytecode):
750 (JSC::ThrowNode::emitBytecode):
751 (JSC::TryNode::emitBytecode):
752 (JSC::ProgramNode::emitBytecode):
753 (JSC::EvalNode::emitBytecode):
754 (JSC::FunctionBodyNode::emitBytecode):
755 * interpreter/Interpreter.cpp:
756 (JSC::Interpreter::debug):
757 - convert charPosition to column for the debugger.
758 * interpreter/Interpreter.h:
760 (DEFINE_STUB_FUNCTION(void, op_debug)):
761 * llint/LLIntSlowPaths.cpp:
762 (LLINT_SLOW_PATH_DECL(slow_op_debug)):
763 * parser/ASTBuilder.h:
764 (JSC::ASTBuilder::createFunctionExpr):
765 (JSC::ASTBuilder::createFunctionBody):
766 (JSC::ASTBuilder::createGetterOrSetterProperty):
767 (JSC::ASTBuilder::createFuncDeclStatement):
768 (JSC::ASTBuilder::createBlockStatement):
769 (JSC::ASTBuilder::createExprStatement):
770 (JSC::ASTBuilder::createIfStatement):
771 (JSC::ASTBuilder::createForLoop):
772 (JSC::ASTBuilder::createForInLoop):
773 (JSC::ASTBuilder::createVarStatement):
774 (JSC::ASTBuilder::createReturnStatement):
775 (JSC::ASTBuilder::createBreakStatement):
776 (JSC::ASTBuilder::createContinueStatement):
777 (JSC::ASTBuilder::createTryStatement):
778 (JSC::ASTBuilder::createSwitchStatement):
779 (JSC::ASTBuilder::createWhileStatement):
780 (JSC::ASTBuilder::createDoWhileStatement):
781 (JSC::ASTBuilder::createWithStatement):
782 (JSC::ASTBuilder::createThrowStatement):
783 (JSC::ASTBuilder::createDebugger):
784 (JSC::ASTBuilder::createConstStatement):
787 (JSC::::internalShift):
791 (JSC::Lexer::currentCharPosition):
793 (JSC::::lexExpectIdentifier):
794 * parser/NodeConstructors.h:
797 (JSC::StatementNode::setLoc):
798 (JSC::ScopeNode::ScopeNode):
799 (JSC::ProgramNode::ProgramNode):
800 (JSC::ProgramNode::create):
801 (JSC::EvalNode::EvalNode):
802 (JSC::EvalNode::create):
803 (JSC::FunctionBodyNode::FunctionBodyNode):
804 (JSC::FunctionBodyNode::create):
806 (JSC::Node::charPosition):
809 (JSC::StatementNode::lastLine):
811 (JSC::ScopeNode::startLine):
812 (JSC::ScopeNode::startCharPosition):
818 (JSC::::parseFunctionBody):
819 (JSC::::parseFunctionInfo):
822 * parser/ParserTokens.h:
823 (JSC::JSTokenLocation::JSTokenLocation):
825 * parser/SyntaxChecker.h:
826 (JSC::SyntaxChecker::createFunctionBody):
828 2013-03-20 Csaba Osztrogonác <ossy@webkit.org>
830 REGRESSION(r146089): It broke 20 sputnik tests on ARM traditional and Thumb2
831 https://bugs.webkit.org/show_bug.cgi?id=112676
833 Rubber-stamped by Filip Pizlo.
835 Add one more EABI_32BIT_DUMMY_ARG to make DFG JIT ARM EABI compatible
836 again after r146089 similar to https://bugs.webkit.org/show_bug.cgi?id=84449
838 * dfg/DFGSpeculativeJIT.h:
839 (JSC::DFG::SpeculativeJIT::callOperation):
841 2013-03-19 Michael Saboff <msaboff@apple.com>
843 Crash when loading http://www.jqchart.com/jquery/gauges/RadialGauge/LiveData
844 https://bugs.webkit.org/show_bug.cgi?id=112694
846 Reviewed by Filip Pizlo.
848 We were trying to convert an NewArray to a Phantom, but convertToPhantom doesn't handle
849 nodes with variable arguments. Added code to insert a Phantom node in front of all the
850 live children of a var args node. Added ASSERT not var args for convertToPhantom to
851 catch any other similar cases. Added a new convertToPhantomUnchecked() for converting
854 * dfg/DFGDCEPhase.cpp:
855 (JSC::DFG::DCEPhase::run):
858 (JSC::DFG::Node::setOpAndDefaultNonExitFlags): Added ASSERT(!(m_flags & NodeHasVarArgs))
859 (JSC::DFG::Node::setOpAndDefaultNonExitFlagsUnchecked):
860 (JSC::DFG::Node::convertToPhantomUnchecked):
862 2013-03-19 Mark Hahnenberg <mhahnenberg@apple.com>
864 Crash in SpeculativeJIT::fillSpeculateIntInternal<false> on http://bellard.org/jslinux
865 https://bugs.webkit.org/show_bug.cgi?id=112738
867 Reviewed by Filip Pizlo.
869 * dfg/DFGFixupPhase.cpp:
870 (JSC::DFG::FixupPhase::fixIntEdge): We shouldn't be killing this node because it could be
871 referenced by other people.
873 2013-03-19 Oliver Hunt <oliver@apple.com>
875 RELEASE_ASSERT fires in exception handler lookup
879 Temporarily switch this RELEASE_ASSERT into a regular ASSERT
880 as currently this is producing fairly bad crashiness.
882 * bytecode/CodeBlock.cpp:
883 (JSC::CodeBlock::handlerForBytecodeOffset):
885 2013-03-18 Filip Pizlo <fpizlo@apple.com>
887 DFG should optimize StringObject.length and StringOrStringObject.length
888 https://bugs.webkit.org/show_bug.cgi?id=112658
890 Reviewed by Mark Hahnenberg.
892 Implemented by injecting a ToString(StringObject:@a) or ToString(StringOrStringObject:@a) prior
893 to GetArrayLength with ArrayMode(Array::String) if @a is predicted StringObject or
894 StringOrStringObject.
896 * dfg/DFGFixupPhase.cpp:
897 (JSC::DFG::FixupPhase::fixupNode):
898 (JSC::DFG::FixupPhase::createToString):
900 (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
901 (JSC::DFG::FixupPhase::convertStringAddUse):
903 2013-03-19 Gabor Rapcsanyi <rgabor@webkit.org>
905 Implement and32 on ARMv7 and ARM traditional platforms
906 https://bugs.webkit.org/show_bug.cgi?id=112663
908 Reviewed by Zoltan Herczeg.
910 * assembler/MacroAssemblerARM.h:
911 (JSC::MacroAssemblerARM::and32): Add missing method.
913 * assembler/MacroAssemblerARMv7.h:
914 (JSC::MacroAssemblerARMv7::and32): Add missing method.
915 (MacroAssemblerARMv7):
917 2013-03-18 Filip Pizlo <fpizlo@apple.com>
919 DFG ToString generic cases should work correctly
920 https://bugs.webkit.org/show_bug.cgi?id=112654
921 <rdar://problem/13447250>
923 Reviewed by Geoffrey Garen.
925 * dfg/DFGSpeculativeJIT.cpp:
926 (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
927 * dfg/DFGSpeculativeJIT32_64.cpp:
928 (JSC::DFG::SpeculativeJIT::compile):
929 * dfg/DFGSpeculativeJIT64.cpp:
930 (JSC::DFG::SpeculativeJIT::compile):
932 2013-03-18 Michael Saboff <msaboff@apple.com>
934 Unreviewed build fix for 32 bit builds.
936 * dfg/DFGSpeculativeJIT32_64.cpp:
937 (JSC::DFG::SpeculativeJIT::compile):
939 2013-03-18 Michael Saboff <msaboff@apple.com>
941 EFL: Unsafe branch detected in compilePutByValForFloatTypedArray()
942 https://bugs.webkit.org/show_bug.cgi?id=112609
944 Reviewed by Geoffrey Garen.
946 Created local valueFPR and scratchFPR and filled them with valueOp.fpr() and scratch.fpr()
947 respectively so that if valueOp.fpr() causes a spill during allocation, it occurs before the
948 branch and also to follow convention. Added register allocation checks to FPRTemporary.
949 Cleaned up a couple of other places to follow the "AllocatVirtualRegType foo, get machine
950 reg from foo" pattern.
952 * dfg/DFGSpeculativeJIT.cpp:
953 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
954 * dfg/DFGSpeculativeJIT.h:
955 (JSC::DFG::SpeculativeJIT::fprAllocate):
956 * dfg/DFGSpeculativeJIT32_64.cpp:
957 (JSC::DFG::SpeculativeJIT::convertToDouble):
958 (JSC::DFG::SpeculativeJIT::compile):
959 * dfg/DFGSpeculativeJIT64.cpp:
960 (JSC::DFG::SpeculativeJIT::compile):
962 2013-03-18 Filip Pizlo <fpizlo@apple.com>
964 DFG should inline binary string concatenations (i.e. ValueAdd with string children)
965 https://bugs.webkit.org/show_bug.cgi?id=112599
967 Reviewed by Oliver Hunt.
969 This does as advertised: if you do x + y where x and y are strings, you'll get
970 a fast inlined JSRopeString allocation (along with whatever checks are necessary).
971 It also does good things if either x or y (or both) are StringObjects, or some
972 other thing like StringOrStringObject. It also lays the groundwork for making this
973 fast if either x or y are numbers, or some other reasonably-cheap-to-convert
976 * dfg/DFGAbstractState.cpp:
977 (JSC::DFG::AbstractState::executeEffects):
978 * dfg/DFGFixupPhase.cpp:
979 (JSC::DFG::FixupPhase::fixupNode):
981 (JSC::DFG::FixupPhase::isStringObjectUse):
982 (JSC::DFG::FixupPhase::convertStringAddUse):
983 (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
984 * dfg/DFGOperations.cpp:
985 * dfg/DFGOperations.h:
986 * dfg/DFGSpeculativeJIT.cpp:
987 (JSC::DFG::SpeculativeJIT::compileAdd):
988 * dfg/DFGSpeculativeJIT.h:
989 (JSC::DFG::SpeculativeJIT::callOperation):
991 (JSC::DFG::SpeculativeJIT::emitAllocateJSCell):
992 (JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
993 * runtime/JSString.h:
994 (JSC::JSString::offsetOfFlags):
997 (JSC::JSRopeString::offsetOfFibers):
999 2013-03-18 Filip Pizlo <fpizlo@apple.com>
1001 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
1002 https://bugs.webkit.org/show_bug.cgi?id=112639
1004 Reviewed by Michael Saboff.
1006 Change it to take a string instead.
1008 * runtime/JSObject.h:
1010 * runtime/ObjectPrototype.cpp:
1011 (JSC::ObjectPrototype::finishCreation):
1012 * runtime/StringPrototype.cpp:
1013 (JSC::StringPrototype::finishCreation):
1015 2013-03-18 Brent Fulgham <bfulgham@webkit.org>
1017 [WinCairo] Get build working under VS2010.
1018 https://bugs.webkit.org/show_bug.cgi?id=112604
1020 Reviewed by Tim Horton.
1022 * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Use CFLite-specific
1023 build target (standard version links against CoreFoundation.lib
1024 instead of CFLite.lib).
1025 * JavaScriptCore.vcxproj/testapi/testapiCommonCFLite.props: Added.
1026 * JavaScriptCore.vcxproj/testapi/testapiDebugCFLite.props: Added.
1027 * JavaScriptCore.vcxproj/testapi/testapiReleaseCFLite.props: Added.
1029 2013-03-18 Roger Fong <roger_fong@apple.com>
1031 AppleWin VS2010 Debug configuration build fix..
1033 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
1035 2013-03-18 Brent Fulgham <bfulgham@webkit.org>
1037 [WinCairo] Get build working under VS2010.
1038 https://bugs.webkit.org/show_bug.cgi?id=112604
1040 Reviewed by Tim Horton.
1042 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Add build targets for
1043 Debug_WinCairo and Release_WinCairo using CFLite.
1044 * JavaScriptCore.vcxproj/JavaScriptCoreCFLite.props: Added.
1045 * JavaScriptCore.vcxproj/JavaScriptCoreDebugCFLite.props: Added.
1046 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj:
1047 Add Debug_WinCairo and Release_WinCairo build targets to
1048 make sure headers are copied to proper build folder.
1049 * JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj: Ditto.
1050 * JavaScriptCore.vcxproj/JavaScriptCoreReleaseCFLite.props: Added.
1051 * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj:
1052 Add Debug_WinCairo and Release_WinCairo build targets to
1053 make sure headers are copied to proper build folder.
1054 * JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj:
1056 * JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcxproj:
1058 * JavaScriptCore.vcxproj/jsc/jsc.vcxproj: Ditto.
1059 * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj: Ditto.
1060 * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Ditto.
1062 2013-03-18 Michael Saboff <msaboff@apple.com>
1064 Potentially unsafe register allocations in DFG code generation
1065 https://bugs.webkit.org/show_bug.cgi?id=112477
1067 Reviewed by Geoffrey Garen.
1069 Moved allocation of temporary GPRs to be before any generated branches in the functions below.
1071 * dfg/DFGSpeculativeJIT32_64.cpp:
1072 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1073 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1074 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
1075 * dfg/DFGSpeculativeJIT64.cpp:
1076 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1077 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1078 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
1080 2013-03-15 Filip Pizlo <fpizlo@apple.com>
1082 DFG string conversions and allocations should be inlined
1083 https://bugs.webkit.org/show_bug.cgi?id=112376
1085 Reviewed by Geoffrey Garen.
1087 This turns new String(), String(), String.prototype.valueOf(), and
1088 String.prototype.toString() into intrinsics. It gives the DFG the ability to handle
1089 conversions from StringObject to JSString and vice-versa, and also gives it the
1090 ability to handle cases where a variable may be either a StringObject or a JSString.
1091 To do this, I added StringObject to value profiling (and removed the stale
1092 distinction between Myarguments and Foreignarguments). I also cleaned up ToPrimitive
1093 handling, using some of the new functionality but also taking advantage of the
1094 existence of Identity(String:@a).
1096 This is a 2% SunSpider speed-up. Also there are some speed-ups on V8v7 and Kraken.
1097 On microbenchmarks that stress new String() this is a 14x speed-up.
1100 * DerivedSources.make:
1101 * DerivedSources.pri:
1102 * GNUmakefile.list.am:
1103 * bytecode/CodeBlock.h:
1105 (JSC::CodeBlock::hasExitSite):
1107 * bytecode/DFGExitProfile.cpp:
1108 (JSC::DFG::ExitProfile::hasExitSite):
1110 * bytecode/DFGExitProfile.h:
1112 (JSC::DFG::ExitProfile::hasExitSite):
1113 * bytecode/ExitKind.cpp:
1114 (JSC::exitKindToString):
1115 * bytecode/ExitKind.h:
1116 * bytecode/SpeculatedType.cpp:
1117 (JSC::dumpSpeculation):
1118 (JSC::speculationToAbbreviatedString):
1119 (JSC::speculationFromClassInfo):
1120 * bytecode/SpeculatedType.h:
1122 (JSC::isStringObjectSpeculation):
1123 (JSC::isStringOrStringObjectSpeculation):
1124 * create_hash_table:
1125 * dfg/DFGAbstractState.cpp:
1126 (JSC::DFG::AbstractState::executeEffects):
1127 * dfg/DFGAbstractState.h:
1128 (JSC::DFG::AbstractState::filterEdgeByUse):
1129 * dfg/DFGByteCodeParser.cpp:
1131 (JSC::DFG::ByteCodeParser::handleCall):
1132 (JSC::DFG::ByteCodeParser::emitArgumentPhantoms):
1134 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
1135 * dfg/DFGCSEPhase.cpp:
1136 (JSC::DFG::CSEPhase::putStructureStoreElimination):
1138 (JSC::DFG::Edge::shift):
1139 * dfg/DFGFixupPhase.cpp:
1140 (JSC::DFG::FixupPhase::fixupNode):
1141 (JSC::DFG::FixupPhase::isStringPrototypeMethodSane):
1143 (JSC::DFG::FixupPhase::canOptimizeStringObjectAccess):
1144 (JSC::DFG::FixupPhase::observeUseKindOnNode):
1146 (JSC::DFG::Graph::hasGlobalExitSite):
1148 (JSC::DFG::Graph::hasExitSite):
1149 (JSC::DFG::Graph::clobbersWorld):
1151 (JSC::DFG::Node::convertToToString):
1153 (JSC::DFG::Node::hasStructure):
1154 (JSC::DFG::Node::shouldSpeculateStringObject):
1155 (JSC::DFG::Node::shouldSpeculateStringOrStringObject):
1156 * dfg/DFGNodeType.h:
1158 * dfg/DFGOperations.cpp:
1159 * dfg/DFGOperations.h:
1160 * dfg/DFGPredictionPropagationPhase.cpp:
1161 (JSC::DFG::PredictionPropagationPhase::propagate):
1162 * dfg/DFGSpeculativeJIT.cpp:
1163 (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
1165 (JSC::DFG::SpeculativeJIT::compileNewStringObject):
1166 (JSC::DFG::SpeculativeJIT::speculateObject):
1167 (JSC::DFG::SpeculativeJIT::speculateObjectOrOther):
1168 (JSC::DFG::SpeculativeJIT::speculateString):
1169 (JSC::DFG::SpeculativeJIT::speculateStringObject):
1170 (JSC::DFG::SpeculativeJIT::speculateStringOrStringObject):
1171 (JSC::DFG::SpeculativeJIT::speculate):
1172 * dfg/DFGSpeculativeJIT.h:
1173 (JSC::DFG::SpeculativeJIT::callOperation):
1175 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
1177 (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure):
1178 * dfg/DFGSpeculativeJIT32_64.cpp:
1179 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1180 (JSC::DFG::SpeculativeJIT::compile):
1181 * dfg/DFGSpeculativeJIT64.cpp:
1182 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1183 (JSC::DFG::SpeculativeJIT::compile):
1184 * dfg/DFGUseKind.cpp:
1185 (WTF::printInternal):
1187 (JSC::DFG::typeFilterFor):
1188 * interpreter/CallFrame.h:
1189 (JSC::ExecState::regExpPrototypeTable):
1190 * runtime/CommonIdentifiers.h:
1191 * runtime/Intrinsic.h:
1192 * runtime/JSDestructibleObject.h:
1193 (JSDestructibleObject):
1194 (JSC::JSDestructibleObject::classInfoOffset):
1195 * runtime/JSGlobalData.cpp:
1197 (JSC::JSGlobalData::JSGlobalData):
1198 (JSC::JSGlobalData::~JSGlobalData):
1199 * runtime/JSGlobalData.h:
1201 * runtime/JSObject.cpp:
1202 * runtime/JSObject.h:
1204 * runtime/JSWrapperObject.h:
1205 (JSC::JSWrapperObject::allocationSize):
1207 (JSC::JSWrapperObject::internalValueOffset):
1208 (JSC::JSWrapperObject::internalValueCellOffset):
1209 * runtime/StringPrototype.cpp:
1211 (JSC::StringPrototype::finishCreation):
1212 (JSC::StringPrototype::create):
1213 * runtime/StringPrototype.h:
1216 2013-03-18 Filip Pizlo <fpizlo@apple.com>
1218 ObjectPrototype properties should be eagerly created rather than lazily via static tables
1219 https://bugs.webkit.org/show_bug.cgi?id=112539
1221 Reviewed by Oliver Hunt.
1223 This is the first part of https://bugs.webkit.org/show_bug.cgi?id=112233. Rolling this
1224 in first since it's the less-likely-to-be-broken part.
1227 * DerivedSources.make:
1228 * DerivedSources.pri:
1229 * GNUmakefile.list.am:
1230 * interpreter/CallFrame.h:
1231 (JSC::ExecState::objectConstructorTable):
1232 * runtime/CommonIdentifiers.h:
1233 * runtime/JSGlobalData.cpp:
1235 (JSC::JSGlobalData::JSGlobalData):
1236 (JSC::JSGlobalData::~JSGlobalData):
1237 * runtime/JSGlobalData.h:
1239 * runtime/JSObject.cpp:
1240 (JSC::JSObject::putDirectNativeFunction):
1242 * runtime/JSObject.h:
1245 * runtime/Lookup.cpp:
1246 (JSC::setUpStaticFunctionSlot):
1247 * runtime/ObjectPrototype.cpp:
1249 (JSC::ObjectPrototype::finishCreation):
1250 (JSC::ObjectPrototype::create):
1251 * runtime/ObjectPrototype.h:
1254 2013-03-16 Pratik Solanki <psolanki@apple.com>
1256 Disable High DPI Canvas on iOS
1257 https://bugs.webkit.org/show_bug.cgi?id=112511
1259 Reviewed by Joseph Pecoraro.
1261 * Configurations/FeatureDefines.xcconfig:
1263 2013-03-15 Andreas Kling <akling@apple.com>
1265 Don't also clone StructureRareData when cloning Structure.
1266 <http://webkit.org/b/111672>
1268 Reviewed by Mark Hahnenberg.
1270 We were cloning a lot of StructureRareData with only the previousID pointer set since
1271 the enumerationCache is not shared between clones.
1273 Let the Structure copy constructor decide whether it wants to clone the rare data.
1274 The decision is made by StructureRareData::needsCloning() and will currently always
1275 return false, since StructureRareData only holds on to caches at present.
1276 This may change in the future as more members are added to StructureRareData.
1278 * runtime/Structure.cpp:
1279 (JSC::Structure::Structure):
1280 (JSC::Structure::cloneRareDataFrom):
1281 * runtime/StructureInlines.h:
1282 (JSC::Structure::create):
1284 2013-03-15 Mark Hahnenberg <mhahnenberg@apple.com>
1287 https://bugs.webkit.org/show_bug.cgi?id=112458
1289 Unreviewed. Requested by Filip Pizlo.
1292 * DerivedSources.make:
1293 * DerivedSources.pri:
1294 * GNUmakefile.list.am:
1295 * dfg/DFGOperations.cpp:
1296 * interpreter/CallFrame.h:
1297 (JSC::ExecState::objectPrototypeTable):
1300 * llint/LLIntSlowPaths.cpp:
1301 (JSC::LLInt::getByVal):
1302 * runtime/CommonIdentifiers.h:
1303 * runtime/JSCell.cpp:
1307 * runtime/JSCellInlines.h:
1309 (JSC::JSCell::fastGetOwnProperty):
1310 * runtime/JSGlobalData.cpp:
1312 (JSC::JSGlobalData::JSGlobalData):
1313 (JSC::JSGlobalData::~JSGlobalData):
1314 * runtime/JSGlobalData.h:
1316 * runtime/JSObject.cpp:
1318 * runtime/JSObject.h:
1321 * runtime/Lookup.cpp:
1322 (JSC::setUpStaticFunctionSlot):
1323 * runtime/ObjectPrototype.cpp:
1325 (JSC::ObjectPrototype::finishCreation):
1326 (JSC::ObjectPrototype::getOwnPropertySlot):
1327 (JSC::ObjectPrototype::getOwnPropertyDescriptor):
1328 * runtime/ObjectPrototype.h:
1329 (JSC::ObjectPrototype::create):
1331 * runtime/PropertyMapHashTable.h:
1332 (JSC::PropertyTable::findWithString):
1333 * runtime/Structure.h:
1335 * runtime/StructureInlines.h:
1336 (JSC::Structure::get):
1338 2013-03-15 Michael Saboff <msaboff@apple.com>
1340 Cleanup of DFG and Baseline JIT debugging code
1341 https://bugs.webkit.org/show_bug.cgi?id=111871
1343 Reviewed by Geoffrey Garen.
1345 Fixed various debug related issue in baseline and DFG JITs. See below.
1347 * dfg/DFGRepatch.cpp:
1348 (JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1349 * dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
1350 pointer to scratch register length.
1351 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
1352 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
1353 * dfg/DFGSpeculativeJIT.cpp:
1354 (JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
1355 DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
1357 (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1358 * jit/JITCall32_64.cpp:
1359 (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
1360 * runtime/JSGlobalData.h:
1361 (JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
1362 be on a double boundary.
1363 (JSC::ScratchBuffer::setActiveLength):
1364 (JSC::ScratchBuffer::activeLength):
1365 (JSC::ScratchBuffer::activeLengthPtr):
1367 2013-03-15 Michael Saboff <msaboff@apple.com>
1369 Add runtime check for improper register allocations in DFG
1370 https://bugs.webkit.org/show_bug.cgi?id=112380
1372 Reviewed by Geoffrey Garen.
1374 Added framework to check for register allocation within a branch source - target range. All register allocations
1375 are saved using the offset in the code stream where the allocation occurred. Later when a jump is linked, the
1376 currently saved register allocations are checked to make sure that they didn't occur in the range of code that was
1377 jumped over. This protects against the case where an allocation could have spilled register contents to free up
1378 a register and that spill only occurs on one path of a many through the code. A subsequent fill of the spilled
1379 register may load garbage. See https://bugs.webkit.org/show_bug.cgi?id=111777 for one such bug.
1380 This code is protected by the compile time check of #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION).
1381 The check is only done during the processing of SpeculativeJIT::compile(Node* node) and its callees.
1383 * assembler/AbstractMacroAssembler.h:
1384 (JSC::AbstractMacroAssembler::Jump::link): Invoke register allocation checks using source and target of link.
1385 (JSC::AbstractMacroAssembler::Jump::linkTo): Invoke register allocation checks using source and target of link.
1386 (AbstractMacroAssembler):
1387 (RegisterAllocationOffset): New helper class to store the instruction stream offset and compare against a
1389 (JSC::AbstractMacroAssembler::RegisterAllocationOffset::RegisterAllocationOffset):
1390 (JSC::AbstractMacroAssembler::RegisterAllocationOffset::check):
1391 (JSC::AbstractMacroAssembler::addRegisterAllocationAtOffset):
1392 (JSC::AbstractMacroAssembler::clearRegisterAllocationOffsets):
1393 (JSC::AbstractMacroAssembler::checkRegisterAllocationAgainstBranchRange):
1394 * dfg/DFGSpeculativeJIT.h:
1395 (JSC::DFG::SpeculativeJIT::allocate):
1396 * dfg/DFGSpeculativeJIT32_64.cpp:
1397 (JSC::DFG::SpeculativeJIT::compile):
1398 * dfg/DFGSpeculativeJIT64.cpp:
1399 (JSC::DFG::SpeculativeJIT::compile):
1401 2013-03-14 Oliver Hunt <oliver@apple.com>
1403 REGRESSION(r145000): Crash loading arstechnica.com when Safari Web Inspector is open
1404 https://bugs.webkit.org/show_bug.cgi?id=111868
1406 Reviewed by Antti Koivisto.
1408 Don't allow non-local property lookup when the debugger is enabled.
1410 * bytecompiler/BytecodeGenerator.cpp:
1411 (JSC::BytecodeGenerator::resolve):
1413 2013-03-11 Mark Hahnenberg <mhahnenberg@apple.com>
1415 Objective-C API: Objective-C functions exposed to JavaScript have the wrong type (object instead of function)
1416 https://bugs.webkit.org/show_bug.cgi?id=105892
1418 Reviewed by Geoffrey Garen.
1420 Changed ObjCCallbackFunction to subclass JSCallbackFunction which already has all of the machinery to call
1421 functions using the C API. Since ObjCCallbackFunction is now a JSCell, we changed the old implementation of
1422 ObjCCallbackFunction to be the internal implementation and keep track of all the proper data so that we
1423 don't have to put all of that in the header, which will now be included from C++ files (e.g. JSGlobalObject.cpp).
1425 * API/JSCallbackFunction.cpp: Change JSCallbackFunction to allow subclassing. Originally it was internally
1426 passing its own Structure up the chain of constructors, but we now want to be able to pass other Structures as well.
1427 (JSC::JSCallbackFunction::JSCallbackFunction):
1428 (JSC::JSCallbackFunction::create):
1429 * API/JSCallbackFunction.h:
1430 (JSCallbackFunction):
1431 * API/JSWrapperMap.mm: Changed interface to tryUnwrapBlock.
1432 (tryUnwrapObjcObject):
1433 * API/ObjCCallbackFunction.h:
1434 (ObjCCallbackFunction): Moved into the JSC namespace, just like JSCallbackFunction.
1435 (JSC::ObjCCallbackFunction::createStructure): Overridden so that the correct ClassInfo gets used since we have
1437 (JSC::ObjCCallbackFunction::impl): Getter for the internal impl.
1438 * API/ObjCCallbackFunction.mm:
1439 (JSC::ObjCCallbackFunctionImpl::ObjCCallbackFunctionImpl): What used to be ObjCCallbackFunction is now
1440 ObjCCallbackFunctionImpl. It handles the Objective-C specific parts of managing callback functions.
1441 (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl):
1442 (JSC::objCCallbackFunctionCallAsFunction): Same as the old one, but now it casts to ObjCCallbackFunction and grabs the impl
1443 rather than using JSObjectGetPrivate.
1444 (JSC::ObjCCallbackFunction::ObjCCallbackFunction): New bits to allow being part of the JSCell hierarchy.
1445 (JSC::ObjCCallbackFunction::create):
1446 (JSC::ObjCCallbackFunction::destroy):
1447 (JSC::ObjCCallbackFunctionImpl::call): Handles the actual invocation, just like it used to.
1448 (objCCallbackFunctionForInvocation):
1449 (tryUnwrapBlock): Changed to check the ClassInfo for inheritance directly, rather than going through the C API call.
1450 * API/tests/testapi.mm: Added new test to make sure that doing Function.prototype.toString.call(f) won't result in
1451 an error when f is an Objective-C method or block underneath the covers.
1452 * runtime/JSGlobalObject.cpp: Added new Structure for ObjCCallbackFunction.
1453 (JSC::JSGlobalObject::reset):
1454 (JSC::JSGlobalObject::visitChildren):
1455 * runtime/JSGlobalObject.h:
1457 (JSC::JSGlobalObject::objcCallbackFunctionStructure):
1459 2013-03-14 Mark Hahnenberg <mhahnenberg@apple.com>
1461 Objective-C API: Nested dictionaries are not converted properly in the Objective-C binding
1462 https://bugs.webkit.org/show_bug.cgi?id=112377
1464 Reviewed by Oliver Hunt.
1466 Accidental reassignment of the root task in the container conversion logic was causing the last
1467 array or dictionary processed to be returned in the case of nested containers.
1470 (containerValueToObject):
1471 * API/tests/testapi.mm:
1473 2013-03-13 Filip Pizlo <fpizlo@apple.com>
1475 JSObject fast by-string access optimizations should work even on the prototype chain, and even when the result is undefined
1476 https://bugs.webkit.org/show_bug.cgi?id=112233
1478 Reviewed by Oliver Hunt.
1480 Extended the existing fast access path for String keys to work over the entire prototype chain,
1481 not just the self access case. This will fail as soon as it sees an object that intercepts
1482 getOwnPropertySlot, so this patch also ensures that ObjectPrototype does not fall into that
1483 category. This is accomplished by making ObjectPrototype eagerly reify all of its properties.
1484 This is safe for ObjectPrototype because it's so common and we expect all of its properties to
1485 be reified for any interesting programs anyway. A new idiom for adding native functions to
1486 prototypes is introduced, which ought to work well for any other prototypes that we wish to do
1487 this conversion for.
1489 This is a >60% speed-up in the case that you frequently do by-string lookups that "miss", i.e.
1490 they don't turn up anything.
1493 * DerivedSources.make:
1494 * DerivedSources.pri:
1495 * GNUmakefile.list.am:
1496 * dfg/DFGOperations.cpp:
1497 * interpreter/CallFrame.h:
1498 (JSC::ExecState::objectConstructorTable):
1501 * llint/LLIntSlowPaths.cpp:
1502 (JSC::LLInt::getByVal):
1503 * runtime/CommonIdentifiers.h:
1504 * runtime/JSCell.cpp:
1505 (JSC::JSCell::getByStringSlow):
1509 * runtime/JSCellInlines.h:
1511 (JSC::JSCell::getByStringAndKey):
1512 (JSC::JSCell::getByString):
1513 * runtime/JSGlobalData.cpp:
1515 (JSC::JSGlobalData::JSGlobalData):
1516 (JSC::JSGlobalData::~JSGlobalData):
1517 * runtime/JSGlobalData.h:
1519 * runtime/JSObject.cpp:
1520 (JSC::JSObject::putDirectNativeFunction):
1522 * runtime/JSObject.h:
1525 * runtime/Lookup.cpp:
1526 (JSC::setUpStaticFunctionSlot):
1527 * runtime/ObjectPrototype.cpp:
1529 (JSC::ObjectPrototype::finishCreation):
1530 (JSC::ObjectPrototype::create):
1531 * runtime/ObjectPrototype.h:
1533 * runtime/PropertyMapHashTable.h:
1534 (JSC::PropertyTable::findWithString):
1535 * runtime/Structure.h:
1537 * runtime/StructureInlines.h:
1538 (JSC::Structure::get):
1541 2013-03-13 Filip Pizlo <fpizlo@apple.com>
1543 DFG bytecode parser is too aggressive about getting rid of GetLocals on captured variables
1544 https://bugs.webkit.org/show_bug.cgi?id=112287
1545 <rdar://problem/13342340>
1547 Reviewed by Oliver Hunt.
1549 * bytecode/CodeBlock.cpp:
1550 (JSC::CodeBlock::dumpBytecode):
1551 (JSC::CodeBlock::finalizeUnconditionally):
1552 * dfg/DFGByteCodeParser.cpp:
1553 (JSC::DFG::ByteCodeParser::getLocal):
1555 2013-03-13 Ryosuke Niwa <rniwa@webkit.org>
1557 Threaded HTML Parser is missing feature define flags in all but Chromium port's build files
1558 https://bugs.webkit.org/show_bug.cgi?id=112277
1560 Reviewed by Adam Barth.
1562 * Configurations/FeatureDefines.xcconfig:
1564 2013-03-13 Csaba Osztrogonác <ossy@webkit.org>
1566 LLINT C loop warning fix for GCC
1567 https://bugs.webkit.org/show_bug.cgi?id=112145
1569 Reviewed by Filip Pizlo.
1571 * llint/LowLevelInterpreter.cpp:
1572 (JSC::CLoop::execute):
1574 2013-02-13 Simon Hausmann <simon.hausmann@digia.com>
1576 Add support for convenient conversion from JSStringRef to QString
1577 https://bugs.webkit.org/show_bug.cgi?id=109694
1579 Reviewed by Allan Sandfeld Jensen.
1581 Add JSStringCopyQString helper function that allows for the convenient
1582 extraction of a QString out of a JSStringRef.
1584 * API/JSStringRefQt.cpp: Added.
1585 (JSStringCopyQString):
1586 * API/JSStringRefQt.h: Added.
1587 * API/OpaqueJSString.h:
1589 (OpaqueJSString::qString):
1590 (OpaqueJSString::OpaqueJSString):
1593 2013-03-13 Peter Gal <galpeter@inf.u-szeged.hu>
1595 Token 'not' is ignored in the offlineasm.
1596 https://bugs.webkit.org/show_bug.cgi?id=111568
1598 Reviewed by Filip Pizlo.
1600 * offlineasm/parser.rb: Build the Not AST node if the 'not' token is found.
1602 2013-03-12 Tim Horton <timothy_horton@apple.com>
1604 WTF uses macros for exports. Try to fix the Windows build. Unreviewed.
1606 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
1607 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
1609 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1611 Array.prototype.sort should at least try to be PTIME even when the array is in some bizarre mode
1612 https://bugs.webkit.org/show_bug.cgi?id=112187
1613 <rdar://problem/13393550>
1615 Reviewed by Michael Saboff and Gavin Barraclough.
1617 If we have an array-like object in crazy mode passed into Array.prototype.sort, and its length is large,
1618 then first copy all elements into a separate, compact, un-holy array and sort that. Then copy back.
1619 This means that sorting will be at worst O(n^2) in the actual number of things in the array, rather than
1620 O(n^2) in the array's length.
1622 * runtime/ArrayPrototype.cpp:
1623 (JSC::attemptFastSort):
1624 (JSC::performSlowSort):
1626 (JSC::arrayProtoFuncSort):
1628 2013-03-12 Tim Horton <timothy_horton@apple.com>
1630 Try to fix the Windows build.
1634 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
1636 2013-03-12 Geoffrey Garen <ggaren@apple.com>
1638 Try to fix the Windows build.
1642 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
1645 2013-03-11 Oliver Hunt <oliver@apple.com>
1647 Harden JSStringJoiner
1648 https://bugs.webkit.org/show_bug.cgi?id=112093
1650 Reviewed by Filip Pizlo.
1652 Harden JSStringJoiner, make it use our CheckedArithmetic
1653 class to simplify everything.
1655 * runtime/JSStringJoiner.cpp:
1656 (JSC::JSStringJoiner::build):
1657 * runtime/JSStringJoiner.h:
1659 (JSC::JSStringJoiner::JSStringJoiner):
1660 (JSC::JSStringJoiner::append):
1662 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1664 DFG generic array access cases should not be guarded by CheckStructure even of the profiling tells us that it could be
1665 https://bugs.webkit.org/show_bug.cgi?id=112183
1667 Reviewed by Oliver Hunt.
1669 Slight speed-up on string-unpack-code.
1671 * dfg/DFGFixupPhase.cpp:
1672 (JSC::DFG::FixupPhase::findAndRemoveUnnecessaryStructureCheck):
1674 (JSC::DFG::FixupPhase::checkArray):
1675 (JSC::DFG::FixupPhase::blessArrayOperation):
1677 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1679 https://bugs.webkit.org/show_bug.cgi?id=112141
1680 LLInt CLoop backend misses Double2Ints() on 32bit architectures
1682 Reviewed by Filip Pizlo.
1684 Implement Double2Ints() in CLoop backend of LLInt on 32bit architectures.
1686 * llint/LowLevelInterpreter.cpp:
1688 (JSC::LLInt::Double2Ints):
1689 * offlineasm/cloop.rb:
1691 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1693 Making more sophisticated cache flush on ARM Linux platform
1694 https://bugs.webkit.org/show_bug.cgi?id=111854
1696 Reviewed by Zoltan Herczeg.
1698 The cache flush on ARM Linux invalidates whole pages
1699 instead of just the required area.
1701 * assembler/ARMAssembler.h:
1703 (JSC::ARMAssembler::linuxPageFlush):
1704 (JSC::ARMAssembler::cacheFlush):
1705 * assembler/ARMv7Assembler.h:
1707 (JSC::ARMv7Assembler::linuxPageFlush):
1708 (JSC::ARMv7Assembler::cacheFlush):
1710 2013-03-12 Gabor Rapcsanyi <rgabor@webkit.org>
1712 Renaming the armv7.rb LLINT backend to arm.rb
1713 https://bugs.webkit.org/show_bug.cgi?id=110565
1715 Reviewed by Zoltan Herczeg.
1717 This is the first step of a unified ARM backend for
1718 all ARM 32 bit architectures in LLInt.
1721 * GNUmakefile.list.am:
1722 * JavaScriptCore.gypi:
1723 * LLIntOffsetsExtractor.pro:
1724 * offlineasm/arm.rb: Copied from Source/JavaScriptCore/offlineasm/armv7.rb.
1725 * offlineasm/armv7.rb: Removed.
1726 * offlineasm/backends.rb:
1727 * offlineasm/risc.rb:
1729 2013-03-12 Csaba Osztrogonác <ossy@webkit.org>
1731 REGRESSION(r145482): It broke 33 jsc tests and zillion layout tests on all platform
1732 https://bugs.webkit.org/show_bug.cgi?id=112112
1734 Reviewed by Oliver Hunt.
1736 Rolling out https://trac.webkit.org/changeset/145482 to unbreak the bots.
1738 * runtime/JSStringJoiner.cpp:
1739 (JSC::JSStringJoiner::build):
1740 * runtime/JSStringJoiner.h:
1742 (JSC::JSStringJoiner::JSStringJoiner):
1743 (JSC::JSStringJoiner::append):
1745 2013-03-12 Filip Pizlo <fpizlo@apple.com>
1747 DFG prediction propagation phase should not rerun forward propagation if double voting has already converged
1748 https://bugs.webkit.org/show_bug.cgi?id=111920
1750 Reviewed by Oliver Hunt.
1752 I don't know why we weren't exiting early after double voting if !m_changed.
1754 This change also removes backwards propagation from the voting fixpoint, since at that
1755 point short-circuiting loops is probably not particularly profitable. Profiling shows
1756 that this reduces the time spent in prediction propagation even further.
1758 This change appears to be a 1% SunSpider speed-up.
1760 * dfg/DFGPredictionPropagationPhase.cpp:
1761 (JSC::DFG::PredictionPropagationPhase::run):
1763 2013-03-11 Filip Pizlo <fpizlo@apple.com>
1765 DFG overflow check elimination is too smart for its own good
1766 https://bugs.webkit.org/show_bug.cgi?id=111832
1768 Reviewed by Oliver Hunt and Gavin Barraclough.
1770 Rolling this back in after fixing accidental misuse of JSValue. The code was doing value < someInt
1771 rather than value.asInt32() < someInt. This "worked" when isWithinPowerOfTwo wasn't templatized.
1772 It worked by always being false and always disabling the relvant optimization.
1774 This improves overflow check elimination in three ways:
1776 1) It reduces the amount of time the compiler will spend doing it.
1778 2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
1779 over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
1780 are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
1781 that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
1782 @b->children are int32's and that hence @b might produce a large enough result that doubles would
1783 start chopping low bits. The specific implication of this is that for a binary operation to not
1784 propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
1785 of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
1786 operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
1787 latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
1788 large won't even make it into the DFG currently.
1790 3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
1791 are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
1792 NodeUsedAsNumber to either @a or @b.
1794 This is neutral on V8v7 and a slight speed-up on compile time benchmarks.
1797 * GNUmakefile.list.am:
1798 * JavaScriptCore.xcodeproj/project.pbxproj:
1800 * dfg/DFGArrayMode.cpp:
1801 (JSC::DFG::ArrayMode::refine):
1802 * dfg/DFGBackwardsPropagationPhase.cpp: Added.
1804 (BackwardsPropagationPhase):
1805 (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
1806 (JSC::DFG::BackwardsPropagationPhase::run):
1807 (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
1808 (JSC::DFG::BackwardsPropagationPhase::isNotZero):
1809 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
1810 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
1811 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
1812 (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
1813 (JSC::DFG::BackwardsPropagationPhase::propagate):
1814 (JSC::DFG::performBackwardsPropagation):
1815 * dfg/DFGBackwardsPropagationPhase.h: Added.
1817 * dfg/DFGCPSRethreadingPhase.cpp:
1818 (JSC::DFG::CPSRethreadingPhase::run):
1819 (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
1820 (CPSRethreadingPhase):
1821 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1822 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1823 * dfg/DFGDriver.cpp:
1824 (JSC::DFG::compile):
1826 (JSC::DFG::Graph::dump):
1827 * dfg/DFGNodeFlags.cpp:
1828 (JSC::DFG::dumpNodeFlags):
1830 * dfg/DFGNodeFlags.h:
1832 * dfg/DFGPredictionPropagationPhase.cpp:
1833 (PredictionPropagationPhase):
1834 (JSC::DFG::PredictionPropagationPhase::propagate):
1835 * dfg/DFGUnificationPhase.cpp:
1836 (JSC::DFG::UnificationPhase::run):
1837 * dfg/DFGVariableAccessData.h:
1838 (JSC::DFG::VariableAccessData::VariableAccessData):
1839 (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
1840 (VariableAccessData):
1841 (JSC::DFG::VariableAccessData::setIsLoadedFrom):
1842 (JSC::DFG::VariableAccessData::isLoadedFrom):
1844 2013-03-11 Oliver Hunt <oliver@apple.com>
1846 Harden JSStringJoiner
1847 https://bugs.webkit.org/show_bug.cgi?id=112093
1849 Reviewed by Filip Pizlo.
1851 Harden JSStringJoiner, make it use our CheckedArithmetic
1852 class to simplify everything.
1854 * runtime/JSStringJoiner.cpp:
1855 (JSC::JSStringJoiner::build):
1856 * runtime/JSStringJoiner.h:
1858 (JSC::JSStringJoiner::JSStringJoiner):
1859 (JSC::JSStringJoiner::append):
1861 2013-03-11 Michael Saboff <msaboff@apple.com>
1863 Crash beneath operationCreateInlinedArguments running fast/js/dfg-create-inlined-arguments-in-closure-inline.html (32-bit only)
1864 https://bugs.webkit.org/show_bug.cgi?id=112067
1866 Reviewed by Geoffrey Garen.
1868 We weren't setting the tag in SetCallee. Therefore set it to CellTag.
1870 * dfg/DFGSpeculativeJIT32_64.cpp:
1871 (JSC::DFG::SpeculativeJIT::compile):
1873 2013-03-11 Oliver Hunt <oliver@apple.com>
1875 Make SegmentedVector Noncopyable
1876 https://bugs.webkit.org/show_bug.cgi?id=112059
1878 Reviewed by Geoffrey Garen.
1880 Copying a SegmentedVector is very expensive, and really shouldn't
1881 be necessary. So I've taken the one place where we currently copy
1882 and replaced it with a regular Vector, and replaced the address
1883 dependent logic with a indexing ref instead.
1885 * bytecompiler/BytecodeGenerator.cpp:
1886 (JSC::BytecodeGenerator::newLabelScope):
1887 (JSC::BytecodeGenerator::emitComplexJumpScopes):
1888 * bytecompiler/BytecodeGenerator.h:
1889 (BytecodeGenerator):
1890 * bytecompiler/LabelScope.h:
1892 (JSC::LabelScopePtr::LabelScopePtr):
1894 (JSC::LabelScopePtr::operator=):
1895 (JSC::LabelScopePtr::~LabelScopePtr):
1896 (JSC::LabelScopePtr::operator*):
1897 (JSC::LabelScopePtr::operator->):
1898 * bytecompiler/NodesCodegen.cpp:
1899 (JSC::DoWhileNode::emitBytecode):
1900 (JSC::WhileNode::emitBytecode):
1901 (JSC::ForNode::emitBytecode):
1902 (JSC::ForInNode::emitBytecode):
1903 (JSC::SwitchNode::emitBytecode):
1904 (JSC::LabelNode::emitBytecode):
1906 2013-03-10 Andreas Kling <akling@apple.com>
1908 SpeculativeJIT should use OwnPtr<SlowPathGenerator>.
1909 <http://webkit.org/b/111942>
1911 Reviewed by Anders Carlsson.
1913 There's no need to include DFGSlowPathGenerator.h from the header as long as the destructor is out-of-line,
1914 so let's use OwnPtr instead of raw pointers + deleteAllValues().
1916 * dfg/DFGSpeculativeJIT.cpp:
1917 (JSC::DFG::SpeculativeJIT::~SpeculativeJIT):
1918 (JSC::DFG::SpeculativeJIT::addSlowPathGenerator):
1919 * dfg/DFGSpeculativeJIT.h:
1922 2013-03-09 Sheriff Bot <webkit.review.bot@gmail.com>
1924 Unreviewed, rolling out r145299.
1925 http://trac.webkit.org/changeset/145299
1926 https://bugs.webkit.org/show_bug.cgi?id=111928
1928 compilation failure with recent clang
1929 (DFGBackwardsPropagationPhase.cpp:132:35: error: comparison of
1930 constant 10 with expression of type 'bool' is always false)
1931 (Requested by thorton on #webkit).
1934 * GNUmakefile.list.am:
1935 * JavaScriptCore.xcodeproj/project.pbxproj:
1937 * dfg/DFGArrayMode.cpp:
1938 (JSC::DFG::ArrayMode::refine):
1939 * dfg/DFGBackwardsPropagationPhase.cpp: Removed.
1940 * dfg/DFGBackwardsPropagationPhase.h: Removed.
1941 * dfg/DFGCPSRethreadingPhase.cpp:
1942 (JSC::DFG::CPSRethreadingPhase::run):
1943 (CPSRethreadingPhase):
1944 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
1945 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
1946 * dfg/DFGDriver.cpp:
1947 (JSC::DFG::compile):
1949 (JSC::DFG::Graph::dump):
1950 * dfg/DFGNodeFlags.cpp:
1951 (JSC::DFG::nodeFlagsAsString):
1953 * dfg/DFGNodeFlags.h:
1955 * dfg/DFGPredictionPropagationPhase.cpp:
1956 (JSC::DFG::PredictionPropagationPhase::isNotNegZero):
1957 (PredictionPropagationPhase):
1958 (JSC::DFG::PredictionPropagationPhase::isNotZero):
1959 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoForConstant):
1960 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoNonRecursive):
1961 (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwo):
1962 (JSC::DFG::PredictionPropagationPhase::propagate):
1963 (JSC::DFG::PredictionPropagationPhase::mergeDefaultFlags):
1964 * dfg/DFGUnificationPhase.cpp:
1965 (JSC::DFG::UnificationPhase::run):
1966 * dfg/DFGVariableAccessData.h:
1967 (JSC::DFG::VariableAccessData::VariableAccessData):
1968 (VariableAccessData):
1970 2013-03-08 Filip Pizlo <fpizlo@apple.com>
1972 DFG overflow check elimination is too smart for its own good
1973 https://bugs.webkit.org/show_bug.cgi?id=111832
1975 Reviewed by Oliver Hunt and Gavin Barraclough.
1977 This improves overflow check elimination in three ways:
1979 1) It reduces the amount of time the compiler will spend doing it.
1981 2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
1982 over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
1983 are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
1984 that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
1985 @b->children are int32's and that hence @b might produce a large enough result that doubles would
1986 start chopping low bits. The specific implication of this is that for a binary operation to not
1987 propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
1988 of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
1989 operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
1990 latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
1991 large won't even make it into the DFG currently.
1993 3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
1994 are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
1995 NodeUsedAsNumber to either @a or @b.
1997 This is neutral on V8v7 and a slight speed-up on compile time benchmarks.
2000 * GNUmakefile.list.am:
2001 * JavaScriptCore.xcodeproj/project.pbxproj:
2003 * dfg/DFGArrayMode.cpp:
2004 (JSC::DFG::ArrayMode::refine):
2005 * dfg/DFGBackwardsPropagationPhase.cpp: Added.
2007 (BackwardsPropagationPhase):
2008 (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
2009 (JSC::DFG::BackwardsPropagationPhase::run):
2010 (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
2011 (JSC::DFG::BackwardsPropagationPhase::isNotZero):
2012 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
2013 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
2014 (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
2015 (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
2016 (JSC::DFG::BackwardsPropagationPhase::propagate):
2017 (JSC::DFG::performBackwardsPropagation):
2018 * dfg/DFGBackwardsPropagationPhase.h: Added.
2020 * dfg/DFGCPSRethreadingPhase.cpp:
2021 (JSC::DFG::CPSRethreadingPhase::run):
2022 (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
2023 (CPSRethreadingPhase):
2024 (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
2025 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
2026 * dfg/DFGDriver.cpp:
2027 (JSC::DFG::compile):
2029 (JSC::DFG::Graph::dump):
2030 * dfg/DFGNodeFlags.cpp:
2031 (JSC::DFG::dumpNodeFlags):
2033 * dfg/DFGNodeFlags.h:
2035 * dfg/DFGPredictionPropagationPhase.cpp:
2036 (PredictionPropagationPhase):
2037 (JSC::DFG::PredictionPropagationPhase::propagate):
2038 * dfg/DFGUnificationPhase.cpp:
2039 (JSC::DFG::UnificationPhase::run):
2040 * dfg/DFGVariableAccessData.h:
2041 (JSC::DFG::VariableAccessData::VariableAccessData):
2042 (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
2043 (VariableAccessData):
2044 (JSC::DFG::VariableAccessData::setIsLoadedFrom):
2045 (JSC::DFG::VariableAccessData::isLoadedFrom):
2047 2013-03-08 Roger Fong <roger_fong@apple.com>
2051 * JavaScriptCore.vcxproj/JavaScriptCore.make:
2053 2013-03-08 Gabor Rapcsanyi <rgabor@webkit.org>
2055 Cache flush problem on ARMv7 JSC
2056 https://bugs.webkit.org/show_bug.cgi?id=111441
2058 Reviewed by Zoltan Herczeg.
2060 Not proper cache flush causing random crashes on ARMv7 Linux with V8 tests.
2061 The problem is similar to https://bugs.webkit.org/show_bug.cgi?id=77712.
2062 Change the cache fulsh mechanism similar to ARM traditinal and revert the
2065 * assembler/ARMv7Assembler.h:
2066 (JSC::ARMv7Assembler::cacheFlush):
2068 2013-03-07 Geoffrey Garen <ggaren@apple.com>
2070 REGRESSION (r143759): 40% JSBench regression, 20% Octane/closure regression, 40% Octane/jquery regression, 2% Octane regression
2071 https://bugs.webkit.org/show_bug.cgi?id=111797
2073 Reviewed by Oliver Hunt.
2075 The bot's testing configuration stresses the cache's starting guess
2078 This patch removes any starting guess, and just uses wall clock time
2079 to discover the initial working set size of an app, in code size.
2081 * runtime/CodeCache.cpp:
2082 (JSC::CodeCacheMap::pruneSlowCase): Update our timer as we go.
2084 Also fixed a bug where pruning from 0 to 0 would hang -- that case is
2085 a possibility now that we start with a capacity of 0.
2087 * runtime/CodeCache.h:
2089 (JSC::CodeCacheMap::CodeCacheMap):
2090 (JSC::CodeCacheMap::add):
2091 (JSC::CodeCacheMap::prune): Don't prune if we're in the middle of
2092 discovering the working set size of an app, in code size.
2094 2013-03-07 Michael Saboff <msaboff@apple.com>
2096 Crash when updating predictions below JSC::arrayProtoFuncForEach on tuaw.com article
2097 https://bugs.webkit.org/show_bug.cgi?id=111777
2099 Reviewed by Filip Pizlo.
2101 Moved register allocations to be above any generated control flow so that any
2102 resulting spill would be visible to all subsequently generated code.
2104 * dfg/DFGSpeculativeJIT32_64.cpp:
2105 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
2106 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
2107 (JSC::DFG::SpeculativeJIT::compile):
2108 * dfg/DFGSpeculativeJIT64.cpp:
2109 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
2110 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
2111 (JSC::DFG::SpeculativeJIT::compile):
2113 2013-03-07 Filip Pizlo <fpizlo@apple.com>
2115 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
2116 https://bugs.webkit.org/show_bug.cgi?id=111783
2118 Reviewed by Mark Hahnenberg.
2120 Unreachable code is not touched by CFA and so thinks that even untyped uses are checked.
2121 But dead untyped uses don't need checks and hence don't need to be Phantom'd. The DCE knew
2122 this in findTypeCheckRoot() but not in eliminateIrrelevantPhantomChildren(), leading to a
2123 Phantom node that had another Phantom node as one of its kids.
2125 * dfg/DFGDCEPhase.cpp:
2126 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
2128 2013-03-07 Filip Pizlo <fpizlo@apple.com>
2130 The DFG fixpoint is not strictly profitable, and should be straight-lined
2131 https://bugs.webkit.org/show_bug.cgi?id=111764
2133 Reviewed by Oliver Hunt and Geoffrey Garen.
2135 The DFG previously ran optimizations to fixpoint because there exists a circular dependency:
2137 CSE depends on CFG simplification: CFG simplification merges blocks, and CSE is block-local.
2139 CFG simplification depends on CFA and constant folding: constant folding reveals branches on
2142 CFA depends on CSE: CSE reveals must-alias relationships by proving that two operations
2143 always produce identical values.
2145 Arguments simplification also depends on CSE, but it ought not depend on anything else.
2147 Hence we get a cycle like: CFA -> folding -> CFG -> CSE -> CFA.
2149 Note that before we had sparse conditional CFA, we also had CFA depending on CFG. This ought
2150 not be the case anymore: CFG simplification should not by itself lead to better CFA results.
2152 My guess is that the weakest link in this cycle is CFG -> CSE. CSE cuts both ways: if you
2153 CSE too much then you increase register pressure. Hence it's not clear that you always want
2154 to CSE after simplifying control flow. This leads to an order of optimization as follows:
2156 CSE -> arguments -> CFA -> folding -> CFG
2158 This is a 2.5% speed-up on SunSpider, a 4% speed-up on V8Spider, a possible 0.3% slow-down
2159 on V8v7, nothing on Kraken, and 1.2% speed-up in the JSRegress geomean. I'll take a 2.5%
2160 speed-up over a 0.3% V8v7 speed-up.
2162 * dfg/DFGDriver.cpp:
2163 (JSC::DFG::compile):
2165 2013-03-07 Roger Fong <roger_fong@apple.com>
2167 Build fix for AppleWin VS2010.
2169 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2170 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
2172 2013-03-05 Mark Hahnenberg <mhahnenberg@apple.com>
2174 Objective-C API: Need a good way to reference event handlers without causing cycles
2175 https://bugs.webkit.org/show_bug.cgi?id=111088
2177 Reviewed by Geoffrey Garen.
2179 JSManagedValue is like a special kind of weak value. When you create a JSManagedValue, you can
2180 supply an Objective-C object as its "owner". As long as the Objective-C owner object remains
2181 alive and its wrapper remains accessible to the JSC garbage collector (e.g. by being marked by
2182 the global object), the reference to the JavaScript value is strong. As soon as the Objective-C
2183 owner is deallocated or its wrapper becomes inaccessible to the garbage collector, the reference
2186 If you do not supply an owner or you use the weakValueWithValue: convenience class method, the
2187 returned JSManagedValue behaves as a normal weak reference.
2189 This new class allows clients to maintain references to JavaScript values in the Objective-C
2190 heap without creating reference cycles/leaking memory.
2192 * API/JSAPIWrapperObject.cpp: Added.
2194 (JSC::::createStructure):
2195 (JSC::JSAPIWrapperObject::JSAPIWrapperObject): This is a special JSObject for the Objective-C API that knows
2196 for the purposes of garbage collection/marking that it wraps an opaque Objective-C object.
2197 (JSC::JSAPIWrapperObject::visitChildren): We add the pointer to the wrapped Objective-C object to the set of
2198 opaque roots so that the weak handle owner for JSManagedValues can find it later.
2199 * API/JSAPIWrapperObject.h: Added.
2201 (JSAPIWrapperObject):
2202 (JSC::JSAPIWrapperObject::wrappedObject):
2203 (JSC::JSAPIWrapperObject::setWrappedObject):
2205 (JSSynchronousGarbageCollect):
2206 * API/JSBasePrivate.h:
2207 * API/JSCallbackObject.cpp:
2209 * API/JSCallbackObject.h:
2210 (JSC::JSCallbackObject::destroy): Moved this to the header so that we don't get link errors with JSAPIWrapperObject.
2212 (-[JSContext initWithVirtualMachine:]): We weren't adding manually allocated/initialized JSVirtualMachine objects to
2213 the global cache of virtual machines. The init methods handle this now rather than contextWithGlobalContextRef, since
2214 not everyone is guaranteed to use the latter.
2215 (-[JSContext initWithGlobalContextRef:]):
2216 (+[JSContext contextWithGlobalContextRef:]):
2217 * API/JSManagedValue.h: Added.
2218 * API/JSManagedValue.mm: Added.
2219 (JSManagedValueHandleOwner):
2220 (managedValueHandleOwner):
2221 (+[JSManagedValue weakValueWithValue:]):
2222 (+[JSManagedValue managedValueWithValue:owner:]):
2223 (-[JSManagedValue init]): We explicitly call the ARC entrypoints to initialize/get the weak owner field since we don't
2224 use ARC when building our framework.
2225 (-[JSManagedValue initWithValue:]):
2226 (-[JSManagedValue initWithValue:owner:]):
2227 (-[JSManagedValue dealloc]):
2228 (-[JSManagedValue value]):
2229 (-[JSManagedValue weakOwner]):
2230 (JSManagedValueHandleOwner::isReachableFromOpaqueRoots): If the Objective-C owner is still alive (i.e. loading the weak field
2231 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
2232 JSObject to which the JSManagedObject refers is still alive.
2233 * API/JSObjectRef.cpp: We have to add explicit checks for the JSAPIWrapperObject, just like the other types of JSCallbackObjects.
2234 (JSObjectGetPrivate):
2235 (JSObjectSetPrivate):
2236 (JSObjectGetPrivateProperty):
2237 (JSObjectSetPrivateProperty):
2238 (JSObjectDeletePrivateProperty):
2240 (objectToValueWithoutCopy):
2241 * API/JSValueRef.cpp:
2242 (JSValueIsObjectOfClass):
2243 * API/JSVirtualMachine.mm:
2244 (-[JSVirtualMachine initWithContextGroupRef:]):
2245 (+[JSVirtualMachine virtualMachineWithContextGroupRef:]):
2246 * API/JSWrapperMap.mm:
2248 (makeWrapper): This is our own internal version of JSObjectMake which creates JSAPIWrapperObjects, the Obj-C API
2249 version of JSCallbackObjects.
2250 (createObjectWithCustomBrand):
2251 (-[JSObjCClassInfo wrapperForObject:]):
2252 (tryUnwrapObjcObject):
2253 * API/JavaScriptCore.h:
2254 * API/tests/testapi.mm: Added new tests for the strong and weak uses of JSManagedValue in the context of an
2255 onclick handler for an Objective-C object inserted into a JSContext.
2256 (-[TextXYZ setWeakOnclick:]):
2257 (-[TextXYZ setOnclick:]):
2258 (-[TextXYZ weakOnclick]):
2259 (-[TextXYZ onclick]):
2261 * CMakeLists.txt: Various build system additions.
2262 * GNUmakefile.list.am:
2263 * JavaScriptCore.gypi:
2264 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2265 * JavaScriptCore.xcodeproj/project.pbxproj:
2266 * runtime/JSGlobalObject.cpp: Added the new canonical Structure for the JSAPIWrapperObject class.
2267 (JSC::JSGlobalObject::reset):
2269 (JSC::JSGlobalObject::visitChildren):
2270 * runtime/JSGlobalObject.h:
2272 (JSC::JSGlobalObject::objcWrapperObjectStructure):
2274 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2276 ConvertThis should be turned into Identity based on predictions in Fixup, rather than based on proofs in ConstantFolding
2277 https://bugs.webkit.org/show_bug.cgi?id=111674
2279 Reviewed by Oliver Hunt.
2281 This gets rid of the speculated forms of ConvertThis in the backend, and has Fixup
2282 convert them to either Identity(Object:@child) if the child is predicted object, or
2283 Phantom(Other:@child) ; WeakJSConstant(global this object) if it's predicted Other.
2285 The goal of this is to ensure that the optimization fixpoint doesn't create
2286 Identity's, since doing so requires a rerun of CSE. So far this isn't a speed-up
2287 but I'm hoping this will be a step towards reducing the need to rerun the fixpoint
2288 so as to ultimately reduce compile times.
2290 * dfg/DFGAbstractState.cpp:
2291 (JSC::DFG::AbstractState::executeEffects):
2292 * dfg/DFGAssemblyHelpers.h:
2294 * dfg/DFGConstantFoldingPhase.cpp:
2295 (JSC::DFG::ConstantFoldingPhase::foldConstants):
2296 * dfg/DFGFixupPhase.cpp:
2297 (JSC::DFG::FixupPhase::fixupNode):
2299 (JSC::DFG::FixupPhase::observeUseKindOnNode):
2300 (JSC::DFG::FixupPhase::setUseKindAndUnboxIfProfitable):
2302 (JSC::DFG::Graph::globalThisObjectFor):
2306 (JSC::DFG::Node::convertToIdentity):
2307 (JSC::DFG::Node::convertToWeakConstant):
2308 * dfg/DFGSpeculativeJIT32_64.cpp:
2309 (JSC::DFG::SpeculativeJIT::compile):
2310 * dfg/DFGSpeculativeJIT64.cpp:
2311 (JSC::DFG::SpeculativeJIT::compile):
2313 2013-03-07 Peter Gal <galpeter@inf.u-szeged.hu>
2315 Children method in LLINT AST Not class should return [@child]
2316 https://bugs.webkit.org/show_bug.cgi?id=90740
2318 Reviewed by Filip Pizlo.
2320 * offlineasm/ast.rb: Fixed the return value of the children method in the Not AST class.
2322 2013-03-05 Oliver Hunt <oliver@apple.com>
2324 Bring back eager resolution of function scoped variables
2325 https://bugs.webkit.org/show_bug.cgi?id=111497
2327 Reviewed by Geoffrey Garen.
2329 This reverts the get/put_scoped_var part of the great non-local
2330 variable resolution refactoring. This still leaves all the lazy
2331 variable resolution logic as it's necessary for global property
2332 resolution, and i don't want to make the patch bigger than it
2335 * bytecode/CodeBlock.cpp:
2336 (JSC::CodeBlock::dumpBytecode):
2337 (JSC::CodeBlock::CodeBlock):
2338 * bytecode/CodeBlock.h:
2340 * bytecode/Opcode.h:
2342 (JSC::padOpcodeName):
2343 * bytecode/UnlinkedCodeBlock.cpp:
2344 (JSC::generateFunctionCodeBlock):
2345 (JSC::UnlinkedFunctionExecutable::codeBlockFor):
2346 (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
2347 * bytecode/UnlinkedCodeBlock.h:
2349 (UnlinkedFunctionExecutable):
2350 (UnlinkedCodeBlock):
2351 (JSC::UnlinkedCodeBlock::usesGlobalObject):
2352 (JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
2353 (JSC::UnlinkedCodeBlock::globalObjectRegister):
2354 * bytecompiler/BytecodeGenerator.cpp:
2355 (JSC::ResolveResult::checkValidity):
2356 (JSC::BytecodeGenerator::BytecodeGenerator):
2357 (JSC::BytecodeGenerator::emitLoadGlobalObject):
2359 (JSC::BytecodeGenerator::resolve):
2360 (JSC::BytecodeGenerator::resolveConstDecl):
2361 (JSC::BytecodeGenerator::emitResolve):
2362 (JSC::BytecodeGenerator::emitResolveBase):
2363 (JSC::BytecodeGenerator::emitResolveBaseForPut):
2364 (JSC::BytecodeGenerator::emitResolveWithBaseForPut):
2365 (JSC::BytecodeGenerator::emitResolveWithThis):
2366 (JSC::BytecodeGenerator::emitGetStaticVar):
2367 (JSC::BytecodeGenerator::emitPutStaticVar):
2368 * bytecompiler/BytecodeGenerator.h:
2369 (JSC::ResolveResult::lexicalResolve):
2370 (JSC::ResolveResult::isStatic):
2371 (JSC::ResolveResult::depth):
2372 (JSC::ResolveResult::index):
2374 (JSC::ResolveResult::ResolveResult):
2375 (BytecodeGenerator):
2376 * bytecompiler/NodesCodegen.cpp:
2377 (JSC::ResolveNode::isPure):
2378 (JSC::FunctionCallResolveNode::emitBytecode):
2379 (JSC::PostfixNode::emitResolve):
2380 (JSC::TypeOfResolveNode::emitBytecode):
2381 (JSC::PrefixNode::emitResolve):
2382 (JSC::ReadModifyResolveNode::emitBytecode):
2383 (JSC::AssignResolveNode::emitBytecode):
2384 (JSC::ConstDeclNode::emitCodeSingle):
2385 * dfg/DFGByteCodeParser.cpp:
2386 (JSC::DFG::ByteCodeParser::parseBlock):
2387 * dfg/DFGCapabilities.cpp:
2388 (JSC::DFG::debugFail):
2389 * dfg/DFGCapabilities.h:
2390 (JSC::DFG::canCompileOpcode):
2391 (JSC::DFG::canInlineOpcode):
2393 (JSC::JIT::privateCompileMainPass):
2396 * jit/JITPropertyAccess.cpp:
2397 (JSC::JIT::emit_op_get_scoped_var):
2399 (JSC::JIT::emit_op_put_scoped_var):
2400 * jit/JITPropertyAccess32_64.cpp:
2401 (JSC::JIT::emit_op_get_scoped_var):
2403 (JSC::JIT::emit_op_put_scoped_var):
2404 * llint/LowLevelInterpreter32_64.asm:
2405 * llint/LowLevelInterpreter64.asm:
2406 * runtime/CodeCache.cpp:
2407 (JSC::CodeCache::getCodeBlock):
2408 (JSC::CodeCache::getProgramCodeBlock):
2409 (JSC::CodeCache::getEvalCodeBlock):
2410 * runtime/CodeCache.h:
2413 * runtime/Executable.cpp:
2414 (JSC::EvalExecutable::compileInternal):
2415 (JSC::FunctionExecutable::produceCodeBlockFor):
2416 * runtime/JSGlobalObject.cpp:
2417 (JSC::JSGlobalObject::createEvalCodeBlock):
2418 * runtime/JSGlobalObject.h:
2420 * runtime/Options.cpp:
2421 (JSC::Options::initialize):
2423 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2425 Unreviewed, roll out http://trac.webkit.org/changeset/144989
2427 I think we want the assertion that I removed.
2429 * dfg/DFGAbstractState.cpp:
2430 (JSC::DFG::AbstractState::merge):
2431 (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
2432 * dfg/DFGAbstractState.h:
2435 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2437 DFG::AbstractState::merge() is still more complicated than it needs to be
2438 https://bugs.webkit.org/show_bug.cgi?id=111619
2440 Reviewed by Mark Hahnenberg.
2442 This method is the one place where we still do some minimal amount of liveness pruning, but the style with
2443 which it is written is awkward, and it makes an assertion about variablesAtTail that will be invalidated
2444 by https://bugs.webkit.org/show_bug.cgi?id=111539.
2446 * dfg/DFGAbstractState.cpp:
2447 (JSC::DFG::AbstractState::merge):
2448 (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
2449 * dfg/DFGAbstractState.h:
2452 2013-03-06 Filip Pizlo <fpizlo@apple.com>
2454 DFG should not run full CSE after the optimization fixpoint, since it really just wants store elimination
2455 https://bugs.webkit.org/show_bug.cgi?id=111536
2457 Reviewed by Oliver Hunt and Mark Hahnenberg.
2459 The fixpoint will do aggressive load elimination and pure CSE. There's no need to do it after the fixpoint.
2460 On the other hand, the fixpoint does not profit from doing store elimination (except for SetLocal/Flush).
2461 Previously we had CSE do both, and had it avoid doing some store elimination during the fixpoint by querying
2462 the fixpoint state. This changes CSE to be templated on mode - either NormalCSE or StoreElimination - so
2463 that we explicitly put it into one of those modes depending on where we call it from. The goal is to reduce
2464 time spent doing load elimination after the fixpoint, since that is just wasted cycles.
2466 * dfg/DFGCSEPhase.cpp:
2467 (JSC::DFG::CSEPhase::CSEPhase):
2468 (JSC::DFG::CSEPhase::run):
2469 (JSC::DFG::CSEPhase::performNodeCSE):
2470 (JSC::DFG::CSEPhase::performBlockCSE):
2471 (JSC::DFG::performCSE):
2473 (JSC::DFG::performStoreElimination):
2474 * dfg/DFGCSEPhase.h:
2476 * dfg/DFGDriver.cpp:
2477 (JSC::DFG::compile):
2479 2013-03-06 Andreas Kling <akling@apple.com>
2481 Pack Structure members better.
2482 <http://webkit.org/b/111593>
2483 <rdar://problem/13359200>
2485 Reviewed by Mark Hahnenberg.
2487 Shrink Structure by 8 bytes (now at 104 bytes) on 64-bit by packing the members better.
2489 * runtime/Structure.cpp:
2490 (JSC::Structure::Structure):
2491 * runtime/Structure.h:
2494 2013-03-06 Andreas Kling <akling@apple.com>
2496 Unreviewed, fix Windows build after r144910.
2498 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2500 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2502 DFG should not check if nodes are shouldGenerate prior to DCE
2503 https://bugs.webkit.org/show_bug.cgi?id=111520
2505 Reviewed by Geoffrey Garen.
2507 All nodes are live before DCE. We don't need to check that they aren't, because they
2510 * dfg/DFGArgumentsSimplificationPhase.cpp:
2511 (JSC::DFG::ArgumentsSimplificationPhase::run):
2512 * dfg/DFGCFAPhase.cpp:
2513 (JSC::DFG::CFAPhase::performBlockCFA):
2514 * dfg/DFGCFGSimplificationPhase.cpp:
2515 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
2516 * dfg/DFGCSEPhase.cpp:
2517 (JSC::DFG::CSEPhase::pureCSE):
2518 (JSC::DFG::CSEPhase::int32ToDoubleCSE):
2519 (JSC::DFG::CSEPhase::constantCSE):
2520 (JSC::DFG::CSEPhase::weakConstantCSE):
2521 (JSC::DFG::CSEPhase::getCalleeLoadElimination):
2522 (JSC::DFG::CSEPhase::getArrayLengthElimination):
2523 (JSC::DFG::CSEPhase::globalVarLoadElimination):
2524 (JSC::DFG::CSEPhase::scopedVarLoadElimination):
2525 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
2526 (JSC::DFG::CSEPhase::globalVarStoreElimination):
2527 (JSC::DFG::CSEPhase::scopedVarStoreElimination):
2528 (JSC::DFG::CSEPhase::getByValLoadElimination):
2529 (JSC::DFG::CSEPhase::checkStructureElimination):
2530 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
2531 (JSC::DFG::CSEPhase::putStructureStoreElimination):
2532 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
2533 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
2534 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
2535 (JSC::DFG::CSEPhase::checkArrayElimination):
2536 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
2537 (JSC::DFG::CSEPhase::getMyScopeLoadElimination):
2538 (JSC::DFG::CSEPhase::getLocalLoadElimination):
2539 (JSC::DFG::CSEPhase::setLocalStoreElimination):
2540 (JSC::DFG::CSEPhase::performNodeCSE):
2541 * dfg/DFGFixupPhase.cpp:
2542 (JSC::DFG::FixupPhase::fixupNode):
2543 (JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
2544 * dfg/DFGPredictionPropagationPhase.cpp:
2545 (JSC::DFG::PredictionPropagationPhase::propagate):
2546 * dfg/DFGStructureCheckHoistingPhase.cpp:
2547 (JSC::DFG::StructureCheckHoistingPhase::run):
2549 2013-03-06 Csaba Osztrogonác <ossy@webkit.org>
2551 Fix unused parameter warnings in ARM assembler
2552 https://bugs.webkit.org/show_bug.cgi?id=111433
2554 Reviewed by Kentaro Hara.
2556 * assembler/ARMAssembler.h: Remove unreachable revertJump() after r143346.
2557 * assembler/MacroAssemblerARM.h:
2558 (JSC::MacroAssemblerARM::moveIntsToDouble): Remove unused scratch parameter instead of UNUSED_PARAM.
2559 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): Remove unused fpTemp parameter.
2560 (JSC::MacroAssemblerARM::revertJumpReplacementToPatchableBranchPtrWithPatch): Remove unused parameters.
2562 2013-03-06 Andreas Kling <akling@apple.com>
2564 Unused Structure property tables waste 14MB on Membuster.
2565 <http://webkit.org/b/110854>
2566 <rdar://problem/13292104>
2568 Reviewed by Geoffrey Garen.
2570 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
2571 14 MB progression on Membuster3.
2573 This time it should stick; I've been through all the tests with COLLECT_ON_EVERY_ALLOCATION.
2574 The issue with the last version was that Structure::m_offset could be used uninitialized
2575 when re-materializing a previously GC'd property table, causing some sanity checks to fail.
2578 * GNUmakefile.list.am:
2579 * JavaScriptCore.gypi:
2580 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2581 * JavaScriptCore.xcodeproj/project.pbxproj:
2584 Added PropertyTable.cpp.
2586 * runtime/PropertyTable.cpp: Added.
2587 (JSC::PropertyTable::create):
2588 (JSC::PropertyTable::clone):
2589 (JSC::PropertyTable::PropertyTable):
2590 (JSC::PropertyTable::destroy):
2591 (JSC::PropertyTable::~PropertyTable):
2592 (JSC::PropertyTable::visitChildren):
2594 Moved marking of property table values here from Structure::visitChildren().
2596 * runtime/WriteBarrier.h:
2597 (JSC::WriteBarrierBase::get):
2599 Move m_cell to a local before using it multiple times. This avoids a multiple-access race when
2600 Structure::checkOffsetConsistency() is used in assertions on the main thread while a marking thread
2601 zaps the property table.
2603 * runtime/Structure.h:
2604 (JSC::Structure::materializePropertyMapIfNecessary):
2605 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2606 * runtime/StructureInlines.h:
2607 (JSC::Structure::propertyTable):
2609 Added a getter for the Structure's PropertyTable that ASSERTs GC currently isn't active.
2610 Because GC can zap an unpinned property table at any time, it's not entirely safe to access it.
2611 Renamed the variable itself to m_propertyTableUnsafe to force call sites into explaining themselves.
2613 (JSC::Structure::putWillGrowOutOfLineStorage):
2614 (JSC::Structure::checkOffsetConsistency):
2616 Moved these out of Structure.h to break header dependency cycle between Structure/PropertyTable.
2618 * runtime/Structure.cpp:
2619 (JSC::Structure::visitChildren):
2621 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
2623 (JSC::Structure::takePropertyTableOrCloneIfPinned):
2625 Added for setting up the property table in a new transition, this code is now shared between
2626 addPropertyTransition() and nonPropertyTransition().
2628 * runtime/JSGlobalData.h:
2629 * runtime/JSGlobalData.cpp:
2630 (JSC::JSGlobalData::JSGlobalData):
2632 Add a global propertyTableStructure.
2634 * runtime/PropertyMapHashTable.h:
2636 (JSC::PropertyTable::createStructure):
2637 (JSC::PropertyTable::copy):
2639 Make PropertyTable a GC object.
2641 * runtime/Structure.cpp:
2642 (JSC::Structure::dumpStatistics):
2643 (JSC::Structure::materializePropertyMap):
2644 (JSC::Structure::despecifyDictionaryFunction):
2645 (JSC::Structure::addPropertyTransition):
2646 (JSC::Structure::changePrototypeTransition):
2647 (JSC::Structure::despecifyFunctionTransition):
2648 (JSC::Structure::attributeChangeTransition):
2649 (JSC::Structure::toDictionaryTransition):
2650 (JSC::Structure::sealTransition):
2651 (JSC::Structure::freezeTransition):
2652 (JSC::Structure::preventExtensionsTransition):
2653 (JSC::Structure::nonPropertyTransition):
2654 (JSC::Structure::isSealed):
2655 (JSC::Structure::isFrozen):
2656 (JSC::Structure::flattenDictionaryStructure):
2657 (JSC::Structure::pin):
2658 (JSC::Structure::copyPropertyTable):
2659 (JSC::Structure::copyPropertyTableForPinning):
2660 (JSC::Structure::get):
2661 (JSC::Structure::despecifyFunction):
2662 (JSC::Structure::despecifyAllFunctions):
2663 (JSC::Structure::putSpecificValue):
2664 (JSC::Structure::remove):
2665 (JSC::Structure::createPropertyMap):
2666 (JSC::Structure::getPropertyNamesFromStructure):
2667 (JSC::Structure::checkConsistency):
2669 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2671 Get rid of the invert argument to SpeculativeJIT::jumpSlowForUnwantedArrayMode
2672 https://bugs.webkit.org/show_bug.cgi?id=105624
2674 Reviewed by Oliver Hunt.
2676 All callers pass invert = false, which is the default value of the argument. So, get
2677 rid of the argument and fold away all code that checks it.
2679 * dfg/DFGSpeculativeJIT.cpp:
2680 (JSC::DFG::SpeculativeJIT::jumpSlowForUnwantedArrayMode):
2681 * dfg/DFGSpeculativeJIT.h:
2684 2013-03-05 Filip Pizlo <fpizlo@apple.com>
2686 Unreviewed, fix an incorrect comment. The comment was a holdover from a work-in-progress version of this code.
2688 * dfg/DFGDCEPhase.cpp:
2689 (JSC::DFG::DCEPhase::run):
2691 2013-03-04 Filip Pizlo <fpizlo@apple.com>
2693 DFG DCE might eliminate checks unsoundly
2694 https://bugs.webkit.org/show_bug.cgi?id=109389
2696 Reviewed by Oliver Hunt.
2698 This gets rid of all eager reference counting, and does all dead code elimination
2699 in one phase - the DCEPhase. This phase also sets up the node reference counts,
2700 which are then used not just for DCE but also register allocation and stack slot
2703 Doing this required a number of surgical changes in places that previously relied
2704 on always having liveness information. For example, the structure check hoisting
2705 phase must now consult whether a VariableAccessData is profitable for unboxing to
2706 make sure that it doesn't try to do hoisting on set SetLocals. The arguments
2707 simplification phase employs its own light-weight liveness analysis. Both phases
2708 previously just used reference counts.
2710 The largest change is that now, dead nodes get turned into Phantoms. Those
2711 Phantoms will retain those child edges that are not proven. This ensures that any
2712 type checks performed by a dead node remain even after the node is killed. On the
2713 other hand, this Phantom conversion means that we need special handling for
2714 SetLocal. I decided to make the four forms of SetLocal explicit:
2716 MovHint(@a, rK): Just indicates that node @a contains the value that would have
2717 now been placed into virtual register rK. Does not actually cause @a to be
2718 stored into rK. This would have previously been a dead SetLocal with @a
2719 being live. MovHints are always dead.
2721 ZombieHint(rK): Indicates that at this point, register rK will contain a dead
2722 value and OSR should put Undefined into it. This would have previously been
2723 a dead SetLocal with @a being dead also. ZombieHints are always dead.
2725 MovHintAndCheck(@a, rK): Identical to MovHint except @a is also type checked,
2726 according to whatever UseKind the edge to @a has. The type check is always a
2727 forward exit. MovHintAndChecks are always live, since they are
2728 NodeMustGenerate. Previously this would have been a dead SetLocal with a
2729 live @a, and the check would have disappeared. This is one of the bugs that
2732 SetLocal(@a, rK): This still does exactly what it does now, if the SetLocal is
2735 Basically this patch makes it so that dead SetLocals eventually decay to MovHint,
2736 ZombieHint, or MovHintAndCheck depending on the situation. If the child @a is
2737 also dead, then you get a ZombieHint. If the child @a is live but the SetLocal
2738 has a type check and @a's type hasn't been proven to have that type then you get
2739 a MovHintAndCheck. Otherwise you get a MovHint.
2741 This is performance neutral.
2744 * GNUmakefile.list.am:
2745 * JavaScriptCore.xcodeproj/project.pbxproj:
2747 * dfg/DFGAbstractState.cpp:
2748 (JSC::DFG::AbstractState::executeEffects):
2749 (JSC::DFG::AbstractState::mergeStateAtTail):
2750 * dfg/DFGArgumentsSimplificationPhase.cpp:
2751 (JSC::DFG::ArgumentsSimplificationPhase::run):
2752 (ArgumentsSimplificationPhase):
2753 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
2754 * dfg/DFGBasicBlock.h:
2756 * dfg/DFGBasicBlockInlines.h:
2758 * dfg/DFGByteCodeParser.cpp:
2759 (JSC::DFG::ByteCodeParser::addToGraph):
2760 (JSC::DFG::ByteCodeParser::insertPhiNode):
2761 (JSC::DFG::ByteCodeParser::emitFunctionChecks):
2762 * dfg/DFGCFAPhase.cpp:
2763 (JSC::DFG::CFAPhase::run):
2764 * dfg/DFGCFGSimplificationPhase.cpp:
2765 (JSC::DFG::CFGSimplificationPhase::run):
2766 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
2767 * dfg/DFGCPSRethreadingPhase.cpp:
2768 (JSC::DFG::CPSRethreadingPhase::run):
2769 (JSC::DFG::CPSRethreadingPhase::addPhiSilently):
2770 * dfg/DFGCSEPhase.cpp:
2771 (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
2772 (JSC::DFG::CSEPhase::setReplacement):
2773 (JSC::DFG::CSEPhase::performNodeCSE):
2774 * dfg/DFGCommon.cpp:
2775 (WTF::printInternal):
2779 * dfg/DFGConstantFoldingPhase.cpp:
2780 (JSC::DFG::ConstantFoldingPhase::foldConstants):
2781 (JSC::DFG::ConstantFoldingPhase::addStructureTransitionCheck):
2782 (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
2783 * dfg/DFGDCEPhase.cpp: Added.
2786 (JSC::DFG::DCEPhase::DCEPhase):
2787 (JSC::DFG::DCEPhase::run):
2788 (JSC::DFG::DCEPhase::findTypeCheckRoot):
2789 (JSC::DFG::DCEPhase::countEdge):
2790 (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
2791 (JSC::DFG::performDCE):
2792 * dfg/DFGDCEPhase.h: Added.
2794 * dfg/DFGDriver.cpp:
2795 (JSC::DFG::compile):
2796 * dfg/DFGFixupPhase.cpp:
2797 (JSC::DFG::FixupPhase::fixupNode):
2798 (JSC::DFG::FixupPhase::checkArray):
2799 (JSC::DFG::FixupPhase::blessArrayOperation):
2800 (JSC::DFG::FixupPhase::fixIntEdge):
2801 (JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
2802 (JSC::DFG::FixupPhase::truncateConstantToInt32):
2804 (JSC::DFG::Graph::Graph):
2805 (JSC::DFG::Graph::dump):
2808 (JSC::DFG::Graph::changeChild):
2809 (JSC::DFG::Graph::changeEdge):
2810 (JSC::DFG::Graph::compareAndSwap):
2811 (JSC::DFG::Graph::clearAndDerefChild):
2812 (JSC::DFG::Graph::performSubstitution):
2813 (JSC::DFG::Graph::performSubstitutionForEdge):
2815 (JSC::DFG::Graph::substitute):
2816 * dfg/DFGInsertionSet.h:
2819 (JSC::DFG::Node::Node):
2820 (JSC::DFG::Node::convertToConstant):
2821 (JSC::DFG::Node::convertToGetLocalUnlinked):
2822 (JSC::DFG::Node::containsMovHint):
2824 (JSC::DFG::Node::hasVariableAccessData):
2825 (JSC::DFG::Node::willHaveCodeGenOrOSR):
2826 * dfg/DFGNodeType.h:
2828 * dfg/DFGPredictionPropagationPhase.cpp:
2829 (JSC::DFG::PredictionPropagationPhase::propagate):
2830 * dfg/DFGSpeculativeJIT.cpp:
2831 (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
2832 (JSC::DFG::SpeculativeJIT::compileMovHint):
2833 (JSC::DFG::SpeculativeJIT::compileMovHintAndCheck):
2835 (JSC::DFG::SpeculativeJIT::compileInlineStart):
2836 (JSC::DFG::SpeculativeJIT::compile):
2837 * dfg/DFGSpeculativeJIT.h:
2839 * dfg/DFGSpeculativeJIT32_64.cpp:
2840 (JSC::DFG::SpeculativeJIT::compile):
2841 * dfg/DFGSpeculativeJIT64.cpp:
2842 (JSC::DFG::SpeculativeJIT::compile):
2843 * dfg/DFGStructureCheckHoistingPhase.cpp:
2844 (JSC::DFG::StructureCheckHoistingPhase::run):
2845 (JSC::DFG::StructureCheckHoistingPhase::shouldConsiderForHoisting):
2846 (StructureCheckHoistingPhase):
2847 * dfg/DFGValidate.cpp:
2848 (JSC::DFG::Validate::validate):
2850 2013-03-05 Mark Hahnenberg <mhahnenberg@apple.com>
2852 Objective-C API: JSValue should implement init and return nil in exceptional cases
2853 https://bugs.webkit.org/show_bug.cgi?id=111487
2855 Reviewed by Darin Adler.
2858 (-[JSValue init]): We return nil here because there is no way to get the instance into a coherent state
2859 without a JSContext.
2860 (-[JSValue initWithValue:inContext:]): Similarly, we should also return nil here if either of the arguments is 0.
2862 2013-03-05 Sheriff Bot <webkit.review.bot@gmail.com>
2864 Unreviewed, rolling out r144708.
2865 http://trac.webkit.org/changeset/144708
2866 https://bugs.webkit.org/show_bug.cgi?id=111447
2868 random assertion crashes in inspector tests on qt+mac bots
2869 (Requested by kling on #webkit).
2872 * GNUmakefile.list.am:
2873 * JavaScriptCore.gypi:
2874 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2875 * JavaScriptCore.xcodeproj/project.pbxproj:
2877 * runtime/JSGlobalData.cpp:
2878 (JSC::JSGlobalData::JSGlobalData):
2879 * runtime/JSGlobalData.h:
2881 * runtime/PropertyMapHashTable.h:
2883 (JSC::PropertyTable::PropertyTable):
2885 (JSC::PropertyTable::~PropertyTable):
2886 (JSC::PropertyTable::copy):
2887 * runtime/PropertyTable.cpp: Removed.
2888 * runtime/Structure.cpp:
2889 (JSC::Structure::dumpStatistics):
2890 (JSC::Structure::materializePropertyMap):
2891 (JSC::Structure::despecifyDictionaryFunction):
2892 (JSC::Structure::addPropertyTransition):
2893 (JSC::Structure::changePrototypeTransition):
2894 (JSC::Structure::despecifyFunctionTransition):
2895 (JSC::Structure::attributeChangeTransition):
2896 (JSC::Structure::toDictionaryTransition):
2897 (JSC::Structure::sealTransition):
2898 (JSC::Structure::freezeTransition):
2899 (JSC::Structure::preventExtensionsTransition):
2900 (JSC::Structure::nonPropertyTransition):
2901 (JSC::Structure::isSealed):
2902 (JSC::Structure::isFrozen):
2903 (JSC::Structure::flattenDictionaryStructure):
2904 (JSC::Structure::pin):
2905 (JSC::Structure::copyPropertyTable):
2906 (JSC::Structure::copyPropertyTableForPinning):
2907 (JSC::Structure::get):
2908 (JSC::Structure::despecifyFunction):
2909 (JSC::Structure::despecifyAllFunctions):
2910 (JSC::Structure::putSpecificValue):
2911 (JSC::Structure::remove):
2912 (JSC::Structure::createPropertyMap):
2913 (JSC::Structure::getPropertyNamesFromStructure):
2914 (JSC::Structure::visitChildren):
2915 (JSC::Structure::checkConsistency):
2916 * runtime/Structure.h:
2918 (JSC::Structure::putWillGrowOutOfLineStorage):
2919 (JSC::Structure::materializePropertyMapIfNecessary):
2920 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2921 (JSC::Structure::checkOffsetConsistency):
2923 * runtime/StructureInlines.h:
2924 (JSC::Structure::get):
2925 * runtime/WriteBarrier.h:
2926 (JSC::WriteBarrierBase::get):
2928 2013-03-05 David Kilzer <ddkilzer@apple.com>
2930 BUILD FIX (r144698): Only enable SPEECH_SYNTHESIS for Mac
2931 <http://webkit.org/b/106742>
2933 Fixes the following build failures:
2935 Undefined symbols for architecture i386:
2936 "__ZTVN7WebCore25PlatformSpeechSynthesizerE", referenced from:
2937 __ZN7WebCore25PlatformSpeechSynthesizerC2EPNS_31PlatformSpeechSynthesizerClientE in PlatformSpeechSynthesizer.o
2938 NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
2939 "__ZN7WebCore25PlatformSpeechSynthesizer19initializeVoiceListEv", referenced from:
2940 __ZN7WebCore25PlatformSpeechSynthesizerC2EPNS_31PlatformSpeechSynthesizerClientE in PlatformSpeechSynthesizer.o
2941 ld: symbol(s) not found for architecture i386
2943 * Configurations/FeatureDefines.xcconfig:
2944 - Fix definition of ENABLE_ENCRYPTED_MEDIA_V2_macosx to match
2945 other FeatureDefines.xcconfig files.
2946 - Only set ENABLE_SPEECH_SYNTHESIS for the macosx platform.
2948 2013-03-04 Andreas Kling <akling@apple.com>
2950 Unused Structure property tables waste 14MB on Membuster.
2951 <http://webkit.org/b/110854>
2952 <rdar://problem/13292104>
2954 Reviewed by Geoffrey Garen.
2956 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
2957 14 MB progression on Membuster3.
2960 * GNUmakefile.list.am:
2961 * JavaScriptCore.gypi:
2962 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2963 * JavaScriptCore.xcodeproj/project.pbxproj:
2966 Added PropertyTable.cpp.
2968 * runtime/PropertyTable.cpp: Added.
2969 (JSC::PropertyTable::create):
2970 (JSC::PropertyTable::clone):
2971 (JSC::PropertyTable::PropertyTable):
2972 (JSC::PropertyTable::destroy):
2973 (JSC::PropertyTable::~PropertyTable):
2974 (JSC::PropertyTable::visitChildren):
2976 Moved marking of property table values here from Structure::visitChildren().
2978 * runtime/WriteBarrier.h:
2979 (JSC::WriteBarrierBase::get):
2981 Move m_cell to a local before using it multiple times. This avoids a multiple-access race when
2982 Structure::checkOffsetConsistency() is used in assertions on the main thread while a marking thread
2983 zaps the property table.
2985 * runtime/Structure.h:
2986 (JSC::Structure::materializePropertyMapIfNecessary):
2987 (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
2988 * runtime/StructureInlines.h:
2989 (JSC::Structure::propertyTable):
2991 Added a getter for the Structure's PropertyTable that ASSERTs GC currently isn't active.
2992 Because GC can zap an unpinned property table at any time, it's not entirely safe to access it.
2993 Renamed the variable itself to m_propertyTableUnsafe to force call sites into explaining themselves.
2995 (JSC::Structure::putWillGrowOutOfLineStorage):
2996 (JSC::Structure::checkOffsetConsistency):
2998 Moved these out of Structure.h to break header dependency cycle between Structure/PropertyTable.
3000 * runtime/Structure.cpp:
3001 (JSC::Structure::visitChildren):
3003 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
3005 * runtime/JSGlobalData.h:
3006 * runtime/JSGlobalData.cpp:
3007 (JSC::JSGlobalData::JSGlobalData):
3009 Add a global propertyTableStructure.
3011 * runtime/PropertyMapHashTable.h:
3013 (JSC::PropertyTable::createStructure):
3014 (JSC::PropertyTable::copy):
3016 Make PropertyTable a GC object.
3018 * runtime/Structure.cpp:
3019 (JSC::Structure::dumpStatistics):
3020 (JSC::Structure::materializePropertyMap):
3021 (JSC::Structure::despecifyDictionaryFunction):
3022 (JSC::Structure::addPropertyTransition):
3023 (JSC::Structure::changePrototypeTransition):
3024 (JSC::Structure::despecifyFunctionTransition):
3025 (JSC::Structure::attributeChangeTransition):
3026 (JSC::Structure::toDictionaryTransition):
3027 (JSC::Structure::sealTransition):
3028 (JSC::Structure::freezeTransition):
3029 (JSC::Structure::preventExtensionsTransition):
3030 (JSC::Structure::nonPropertyTransition):
3031 (JSC::Structure::isSealed):
3032 (JSC::Structure::isFrozen):
3033 (JSC::Structure::flattenDictionaryStructure):
3034 (JSC::Structure::pin):
3035 (JSC::Structure::copyPropertyTable):
3036 (JSC::Structure::copyPropertyTableForPinning):
3037 (JSC::Structure::get):
3038 (JSC::Structure::despecifyFunction):
3039 (JSC::Structure::despecifyAllFunctions):
3040 (JSC::Structure::putSpecificValue):
3041 (JSC::Structure::remove):
3042 (JSC::Structure::createPropertyMap):
3043 (JSC::Structure::getPropertyNamesFromStructure):
3044 (JSC::Structure::checkConsistency):
3046 2013-03-04 Chris Fleizach <cfleizach@apple.com>
3048 Support WebSpeech - Speech Synthesis
3049 https://bugs.webkit.org/show_bug.cgi?id=106742
3051 Reviewed by Simon Fraser.
3053 Enable speech synthesis for the Mac.
3055 * Configurations/FeatureDefines.xcconfig:
3057 2013-03-04 Mark Hahnenberg <mhahnenberg@apple.com>
3059 Remove contextInternalContext from JSContextInternal.h
3060 https://bugs.webkit.org/show_bug.cgi?id=111356
3062 Reviewed by Geoffrey Garen.
3064 We don't need it any more since we have globalContextRef in JSContext.
3067 * API/JSContextInternal.h:
3069 (+[JSValue valueWithBool:inContext:]):
3070 (+[JSValue valueWithDouble:inContext:]):
3071 (+[JSValue valueWithInt32:inContext:]):
3072 (+[JSValue valueWithUInt32:inContext:]):
3073 (+[JSValue valueWithNewObjectInContext:]):
3074 (+[JSValue valueWithNewArrayInContext:]):
3075 (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]):
3076 (+[JSValue valueWithNewErrorFromMessage:inContext:]):
3077 (+[JSValue valueWithNullInContext:]):
3078 (+[JSValue valueWithUndefinedInContext:]):
3079 (-[JSValue toBool]):
3080 (-[JSValue toDouble]):
3081 (-[JSValue toNumber]):
3082 (-[JSValue toString]):
3083 (-[JSValue toDate]):
3084 (-[JSValue toArray]):
3085 (-[JSValue toDictionary]):
3086 (-[JSValue valueForProperty:]):
3087 (-[JSValue setValue:forProperty:]):
3088 (-[JSValue deleteProperty:]):
3089 (-[JSValue hasProperty:]):
3090 (-[JSValue valueAtIndex:]):
3091 (-[JSValue setValue:atIndex:]):
3092 (-[JSValue isUndefined]):
3093 (-[JSValue isNull]):
3094 (-[JSValue isBoolean]):
3095 (-[JSValue isNumber]):
3096 (-[JSValue isString]):
3097 (-[JSValue isObject]):
3098 (-[JSValue isEqualToObject:]):
3099 (-[JSValue isEqualWithTypeCoercionToObject:]):
3100 (-[JSValue isInstanceOf:]):
3101 (-[JSValue callWithArguments:]):
3102 (-[JSValue constructWithArguments:]):
3103 (-[JSValue invokeMethod:withArguments:]):
3105 (objectToValueWithoutCopy):
3107 (-[JSValue initWithValue:inContext:]):
3108 (-[JSValue dealloc]):
3109 (-[JSValue description]):
3110 * API/JSWrapperMap.mm:
3111 (createObjectWithCustomBrand):
3112 (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]):
3113 (-[JSObjCClassInfo wrapperForObject:]):
3114 (-[JSWrapperMap jsWrapperForObject:]):
3115 * API/ObjCCallbackFunction.mm:
3116 (ObjCCallbackFunction::call):
3117 (objCCallbackFunctionForInvocation):
3119 2013-03-04 Andreas Kling <akling@apple.com>
3121 Add simple vector traits for JSC::Identifier.
3122 <http://webkit.org/b/111323>
3124 Reviewed by Geoffrey Garen.
3126 Identifiers are really just Strings, giving them simple vector traits makes
3127 Vector move them with memcpy() instead of churning the refcounts.
3129 * runtime/Identifier.h:
3132 2013-03-04 Kunihiko Sakamoto <ksakamoto@chromium.org>
3134 Add build flag for FontLoader
3135 https://bugs.webkit.org/show_bug.cgi?id=111289
3137 Reviewed by Benjamin Poulain.
3139 Add ENABLE_FONT_LOAD_EVENTS build flag (disabled by default).
3141 * Configurations/FeatureDefines.xcconfig:
3143 2013-03-03 Andreas Kling <akling@apple.com>
3145 Shrink JSC::HashTable entries.
3146 <http://webkit.org/b/111275>
3147 <rdar://problem/13333511>
3149 Reviewed by Anders Carlsson.
3151 Move the Intrinsic value out of the function-specific part of the union,
3152 and store it next to m_attributes. Reduces the size of HashEntry by 8 bytes.
3154 990 kB progression on Membuster3. (PTUS: 797 kB)
3157 (JSC::HashEntry::initialize):
3158 (JSC::HashEntry::intrinsic):
3161 2013-03-01 David Kilzer <ddkilzer@apple.com>
3163 BUILD FIX: testapi should link to Foundation, not CoreFoundation
3165 * JavaScriptCore.xcodeproj/project.pbxproj: Change testapi to
3166 link to Foundation.framework instead of CoreFoundation.framework
3167 since it uses NS types.
3169 2013-03-01 Mark Hahnenberg <mhahnenberg@apple.com>
3171 Objective-C API: Passing JS functions to Objective-C callbacks causes JSValue to leak
3172 https://bugs.webkit.org/show_bug.cgi?id=107836
3174 Reviewed by Oliver Hunt.
3176 We've decided to remove support for this feature from the API because there's no way to automatically manage
3177 the memory for clients in a satisfactory manner. Clients can still pass JS functions to Objective-C methods,
3178 but the methods must accept plain JSValues instead of Objective-C blocks.
3180 We now ignore functions that are part of a protocol that inherits from JSExport that accept blocks as arguments.
3182 * API/JSBlockAdaptor.h: Removed.
3183 * API/JSBlockAdaptor.mm: Removed.
3184 * API/ObjCCallbackFunction.mm:
3185 (ArgumentTypeDelegate::typeBlock): Return nil to signal that we want to ignore this function when copying it
3186 to the object from the protocol.
3187 * API/tests/testapi.mm: Added a test to make sure that we ignore methods declared as part of a JSExport-ed protocol
3188 that have block arguments.
3189 (-[TestObject bogusCallback:]):
3190 * JavaScriptCore.gypi: Updated build files.
3191 * JavaScriptCore.xcodeproj/project.pbxproj:
3193 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3195 DFG Branch(LogicalNot) peephole should not try to optimize and work-around the case where LogicalNot may be otherwise live
3196 https://bugs.webkit.org/show_bug.cgi?id=111209
3198 Reviewed by Oliver Hunt.
3200 Even if it is then everything will work just fine. It's not necessary to check the ref count here.
3202 * dfg/DFGFixupPhase.cpp:
3203 (JSC::DFG::FixupPhase::fixupNode):
3205 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3207 DFG CSE phase shouldn't rely on ref count of nodes, since it doesn't have to
3208 https://bugs.webkit.org/show_bug.cgi?id=111205
3210 Reviewed by Oliver Hunt.
3212 I don't understand the intuition behind setLocalStoreElimination() validating that the SetLocal's ref count
3213 is 1. I believe this is a hold-over from when setLocalStoreElimination() would match one SetLocal to another,
3214 and then try to eliminate the first SetLocal. But that's not how it works now. Now, setLocalStoreElimination()
3215 is actually Flush elimination: it eliminates any Flush that anchors a SetLocal if it proves that every path
3216 from the SetLocal to the Flush is devoid of operations that may observe the local. It doesn't actually kill
3217 the SetLocal itself: if the SetLocal is live because of other things (other Flushes or GetLocals in other
3218 basic blocks), then the SetLocal will naturally still be alive because th Flush was only keeping the SetLocal
3219 alive by one count rather than being solely responsible for its liveness.
3221 * dfg/DFGCSEPhase.cpp:
3222 (JSC::DFG::CSEPhase::setLocalStoreElimination):
3223 (JSC::DFG::CSEPhase::eliminate):
3224 (JSC::DFG::CSEPhase::performNodeCSE):
3226 2013-03-01 Filip Pizlo <fpizlo@apple.com>
3228 Rename MovHint to MovHintEvent so I can create a NodeType called MovHint
3230 Rubber stamped by Mark Hahnenberg.
3232 This is similar to the SetLocal/SetLocalEvent naming scheme, where SetLocal is the
3233 NodeType and SetLocalEvent is the VariableEventKind.
3235 * dfg/DFGVariableEvent.cpp:
3236 (JSC::DFG::VariableEvent::dump):
3237 * dfg/DFGVariableEvent.h:
3238 (JSC::DFG::VariableEvent::movHint):
3239 (JSC::DFG::VariableEvent::id):
3240 (JSC::DFG::VariableEvent::operand):
3242 * dfg/DFGVariableEventStream.cpp:
3243 (JSC::DFG::VariableEventStream::reconstruct):
3245 2013-03-01 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
3247 [JSC] Fix sign comparison warning/error after r144340.
3248 https://bugs.webkit.org/show_bug.cgi?id=111164
3250 Reviewed by Mark Hahnenberg.
3252 gcc (both 4.2.1 and 4.7.2) complain about comparing signed and
3253 unsigned terms (clang accepts it just fine).
3255 Work around that by casting the 1 to an uintptr_t as well.
3258 (JSC::DFG::Edge::makeWord):
3260 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3262 DFG CFA should not do liveness pruning
3263 https://bugs.webkit.org/show_bug.cgi?id=111119
3265 Reviewed by Mark Hahnenberg.
3267 It adds complexity and probably buys nothing. Moreover, I'm transitioning to having
3268 liveness only available at the bitter end of compilation, so this will stop working
3269 after https://bugs.webkit.org/show_bug.cgi?id=109389 anyway.
3271 * dfg/DFGAbstractState.cpp:
3272 (JSC::DFG::AbstractState::initialize):
3273 (JSC::DFG::AbstractState::mergeStateAtTail):
3275 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3277 Don't try to emit profiling if you don't have the DFG JIT.
3279 Rubber stamped by Mark Hahnenberg.
3282 (JSC::JIT::shouldEmitProfiling):
3284 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3286 DFG Phantom node should be honest about the fact that it can exit
3287 https://bugs.webkit.org/show_bug.cgi?id=111115
3289 Reviewed by Mark Hahnenberg.
3291 The chances of this having cause serious issues are low, since most clients of the
3292 NodeDoesNotExit flag run after CFA and CFA updates this properly. But one possible
3293 case of badness is if the ByteCodeParser inserted a Phantom with a type check in
3294 between a LogicalNot and a Branch; then that peephole optimization in Fixup might
3297 * dfg/DFGNodeType.h:
3300 2013-02-28 Mark Hahnenberg <mhahnenberg@apple.com>
3302 Add casts in DFGGPRInfo.h to suppress warnings
3303 https://bugs.webkit.org/show_bug.cgi?id=111104
3305 Reviewed by Filip Pizlo.
3307 With certain flags on, we get compiler warnings on ARM. We should do the proper casts to make these warnings go away.
3310 (JSC::DFG::GPRInfo::toIndex):
3311 (JSC::DFG::GPRInfo::debugName):
3313 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3315 It should be easy to determine if a DFG node exits forward or backward when doing type checks
3316 https://bugs.webkit.org/show_bug.cgi?id=111102
3318 Reviewed by Mark Hahnenberg.
3320 This adds a NodeExitsForward flag, which tells you the exit directionality of
3321 type checks performed by the node. Even if you convert the node to a Phantom
3322 and use the Edge UseKind for type checks, you'll still get the same exit
3323 directionality that the original node would have wanted.
3325 * dfg/DFGArgumentsSimplificationPhase.cpp:
3326 (JSC::DFG::ArgumentsSimplificationPhase::run):
3327 * dfg/DFGArrayifySlowPathGenerator.h:
3328 (JSC::DFG::ArrayifySlowPathGenerator::ArrayifySlowPathGenerator):
3329 * dfg/DFGCFGSimplificationPhase.cpp:
3330 (JSC::DFG::CFGSimplificationPhase::run):
3331 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
3332 * dfg/DFGCPSRethreadingPhase.cpp:
3333 (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
3334 * dfg/DFGCSEPhase.cpp:
3335 (JSC::DFG::CSEPhase::setReplacement):
3336 (JSC::DFG::CSEPhase::eliminate):
3337 (JSC::DFG::CSEPhase::performNodeCSE):
3338 * dfg/DFGConstantFoldingPhase.cpp:
3339 (JSC::DFG::ConstantFoldingPhase::foldConstants):
3340 * dfg/DFGFixupPhase.cpp:
3341 (JSC::DFG::FixupPhase::checkArray):
3344 (JSC::DFG::Node::setOpAndDefaultNonExitFlags):
3345 (JSC::DFG::Node::convertToPhantom):
3346 * dfg/DFGNodeFlags.cpp:
3347 (JSC::DFG::nodeFlagsAsString):
3348 * dfg/DFGNodeFlags.h:
3350 * dfg/DFGNodeType.h:
3352 * dfg/DFGSpeculativeJIT.cpp:
3353 (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck):
3355 (JSC::DFG::SpeculativeJIT::speculationCheck):
3356 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
3357 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
3358 (JSC::DFG::SpeculativeJIT::backwardTypeCheck):
3359 (JSC::DFG::SpeculativeJIT::typeCheck):
3360 (JSC::DFG::SpeculativeJIT::forwardTypeCheck):
3361 (JSC::DFG::SpeculativeJIT::fillStorage):
3362 (JSC::DFG::SpeculativeJIT::compile):
3363 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
3364 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
3365 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
3366 * dfg/DFGSpeculativeJIT.h:
3368 (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand):
3369 (JSC::DFG::SpeculateIntegerOperand::gpr):
3370 (SpeculateIntegerOperand):
3371 (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand):
3372 (JSC::DFG::SpeculateDoubleOperand::fpr):
3373 (SpeculateDoubleOperand):
3374 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
3375 (JSC::DFG::SpeculateCellOperand::gpr):
3376 (SpeculateCellOperand):
3377 (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand):
3378 (JSC::DFG::SpeculateBooleanOperand::gpr):
3379 (SpeculateBooleanOperand):
3380 * dfg/DFGSpeculativeJIT32_64.cpp:
3381 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
3382 (JSC::DFG::SpeculativeJIT::fillSpeculateInt):
3383 (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
3384 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
3385 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3386 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
3387 (JSC::DFG::SpeculativeJIT::compile):
3388 * dfg/DFGSpeculativeJIT64.cpp:
3389 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
3390 (JSC::DFG::SpeculativeJIT::fillSpeculateInt):
3391 (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
3392 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
3393 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3394 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
3395 (JSC::DFG::SpeculativeJIT::compile):
3397 2013-02-28 Filip Pizlo <fpizlo@apple.com>
3399 CodeBlock::valueProfile() has a bogus assertion
3400 https://bugs.webkit.org/show_bug.cgi?id=111106
3401 <rdar://problem/13131427>
3403 Reviewed by Mark Hahnenberg.
3405 This was just a bad assertion: m_bytecodeOffset == -1 means that the value profile is constructed but not initialized.
3406 ValueProfile constructs itself in a safe way; you can call any method you want on a constructed but not initialized
3407 ValueProfile. CodeBlock first constructs all ValueProfiles (by growing the ValueProfile vector) and then initializes
3408 their m_bytecodeOffset later. This is necessary because the initialization is linking bytecode instructions to their
3409 ValueProfiles, so at that point we don't want the ValueProfile vector to resize, which implies that we want all of
3410 them to already be constructed. A GC can happen during this phase, and the GC may want to walk all ValueProfiles.
3411 This is safe, but one of the ValueProfile getters (CodeBlock::valueProfile()) was asserting that any value profile
3412 you get has had its m_bytecodeOffset initialized. This need not be the case and nothing will go wrong if it isn't.
3414 The solution is to remove the assertion, which I believe was put there to ensure that my m_valueProfiles refactoring
3415 a long time ago was sound: it used to be that a ValueProfile with m_bytecodeOffset == -1 was an argument profile; now
3416 all argument profiles are in m_argumentValueProfiles instead. I think it's safe to say that this refactoring was done
3417 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
3418 sound with respect to the GC-during-CodeBlock-construction issue, and I don't believe that the assertion is buying us
3419 anything at this point.
3421 * bytecode/CodeBlock.h:
3422 (JSC::CodeBlock::valueProfile):
3424 2013-02-27 Filip Pizlo <fpizlo@apple.com>
3426 DFG CFA should leave behind information in Edge that says if the Edge's type check is proven to succeed
3427 https://bugs.webkit.org/show_bug.cgi?id=110840
3429 Reviewed by Mark Hahnenberg.
3431 This doesn't add any observable functionality to the compiler, yet. But it does give
3432 every phase that runs after CFA the ability to know, in O(1) time, whether an edge
3433 will need to execute a type check.
3435 * dfg/DFGAbstractState.h:
3436 (JSC::DFG::AbstractState::filterEdgeByUse):
3437 (JSC::DFG::AbstractState::filterByType):
3438 * dfg/DFGCommon.cpp:
3440 (WTF::printInternal):
3442 (JSC::DFG::isProved):
3444 (JSC::DFG::proofStatusForIsProved):
3447 (JSC::DFG::Edge::dump):
3449 (JSC::DFG::Edge::Edge):
3450 (JSC::DFG::Edge::setNode):
3451 (JSC::DFG::Edge::useKindUnchecked):
3452 (JSC::DFG::Edge::setUseKind):
3454 (JSC::DFG::Edge::proofStatusUnchecked):
3455 (JSC::DFG::Edge::proofStatus):
3456 (JSC::DFG::Edge::setProofStatus):
3457 (JSC::DFG::Edge::isProved):
3458 (JSC::DFG::Edge::needsCheck):
3459 (JSC::DFG::Edge::shift):
3460 (JSC::DFG::Edge::makeWord):
3462 2013-02-28 Simon Hausmann <simon.hausmann@digia.com>
3464 [Qt][Mac] Fix massive parallel builds
3466 Reviewed by Tor Arne Vestbø.
3468 There exists a race condition that LLIntDesiredOffsets.h is written to
3469 by two parllel instances of the ruby script. This patch ensures that similar to the output file,
3470 the generated file is also prefixed according to the build configuration.
3472 * LLIntOffsetsExtractor.pro:
3474 2013-02-27 Sheriff Bot <webkit.review.bot@gmail.com>
3476 Unreviewed, rolling out r144168.
3477 http://trac.webkit.org/changeset/144168
3478 https://bugs.webkit.org/show_bug.cgi?id=111019
3480 It broke the build and tronical is unavailable (Requested by
3481 Ossy_night on #webkit).
3483 * LLIntOffsetsExtractor.pro:
3485 2013-02-26 Filip Pizlo <fpizlo@apple.com>
3487 Disable some unsound DFG DCE
3488 https://bugs.webkit.org/show_bug.cgi?id=110948
3490 Reviewed by Michael Saboff.
3492 DCE of bitops is not sound since the bitops might call some variant of valueOf.
3494 This used to work right because ValueToInt32 was MustGenerate. From the DFG IR
3495 standpoint it feels weird to make ValueToInt32 be MustGenerate since that node is
3496 implemented entirely as a pure conversion. If we ever gave the DFG the ability to
3497 do effectful bitops, we would most likely implement them as special nodes not
3498 related to the ValueToInt32 and bitop nodes we have now.
3500 This change is performance neutral.
3502 * dfg/DFGNodeType.h:
3505 2013-02-27 Glenn Adams <glenn@skynav.com>
3507 Add ENABLE_CSS3_TEXT_LINE_BREAK flag.
3508 https://bugs.webkit.org/show_bug.cgi?id=110944
3510 Reviewed by Dean Jackson.
3512 * Configurations/FeatureDefines.xcconfig:
3514 2013-02-27 Julien Brianceau <jbrianceau@nds.com>
3516 Fix build when DFG_JIT is not enabled
3517 https://bugs.webkit.org/show_bug.cgi?id=110991
3519 Reviewed by Csaba Osztrogonác.
3522 (JSC::JIT::canBeOptimizedOrInlined):
3524 2013-02-27 Simon Hausmann <simon.hausmann@digia.com>
3526 [Qt][Mac] Fix massive parallel builds
3528 Reviewed by Tor Arne Vestbø.
3530 There exists a race condition that LLIntDesiredOffsets.h is written to
3531 by two parllel instances of the ruby script. This patch ensures that similar to the output file,
3532 the generated file is also prefixed according to the build configuration.
3534 * LLIntOffsetsExtractor.pro:
3536 2013-02-26 Filip Pizlo <fpizlo@apple.com>
3538 DFG OSR exit doesn't know which virtual register to use for the last result register for post_inc and post_dec
3539 https://bugs.webkit.org/show_bug.cgi?id=109036
3540 <rdar://problem/13292139>
3542 Reviewed by Gavin Barraclough.
3544 This was a two-fold problem:
3546 1) post_inc/dec has two results - the new value of the variable, and the old value of the variable. DFG OSR exit
3547 assumed that the "last result" used for the Baseline JIT's register allocation would be the new value. It was
3548 wrong in this assumption.
3550 2) The Baseline JIT knew to disable its last result optimization in cases where it might confuse the DFG. But it
3551 was doing this only for code blocks that could be totally optimized, but not code blocks that could only be
3552 optimized when inlined.
3554 This patch introduces a more rigorous notion of when the Baseline JIT emits profiling, when it does extra work
3555 to account for the possibility of OSR exit, and when it does extra work to account for the possibility of OSR
3556 entry. These notions are called shouldEmitProfiling(), canBeOptimizedOrInlined(), and canBeOptimized(),
3559 This is performance-neutral and fixes the reported bug. It probably fixes other bugs as well, since previously
3560 we for example weren't doing the more conservative implementation of op_mov in the Baseline JIT for code blocks
3561 that could be inlined but not optimized. So, if such a code block OSR exited at just the right point, you'd get
3562 symptoms similar to this bug.
3564 * dfg/DFGCapabilities.h:
3565 (JSC::DFG::canCompileOpcode):
3568 (JSC::JIT::privateCompile):
3570 (JSC::JIT::compilePatchGetArrayLength):
3571 (JSC::JIT::canBeOptimizedOrInlined):
3573 * jit/JITArithmetic.cpp:
3574 (JSC::JIT::emit_op_post_inc):
3575 (JSC::JIT::emit_op_post_dec):
3576 * jit/JITArithmetic32_64.cpp:
3577 (JSC::JIT::emit_op_post_inc):
3578 (JSC::JIT::emit_op_post_dec):
3580 (JSC::JIT::emit_op_call_put_result):
3581 (JSC::JIT::compileOpCall):
3582 * jit/JITCall32_64.cpp:
3583 (JSC::JIT::compileOpCall):
3585 (JSC::JIT::emitArrayProfilingSite):
3587 * jit/JITOpcodes.cpp:
3588 (JSC::JIT::emit_op_mov):
3589 * jit/JITPropertyAccess.cpp:
3590 (JSC::JIT::compileGetByIdHotPath):
3591 (JSC::JIT::privateCompilePutByIdTransition):
3592 * jit/JITPropertyAccess32_64.cpp:
3593 (JSC::JIT::compileGetByIdHotPath):
3594 (JSC::JIT::privateCompilePutByIdTransition):
3596 2013-02-26 Roger Fong <roger_fong@apple.com>
3598 Unreviewed. AppleWin VS2010 build fix.
3600 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
3602 2013-02-25 Filip Pizlo <fpizlo@apple.com>
3604 The DFG backend's and OSR's decision to unbox a variable should be based on whether it's used in a typed context
3605 https://bugs.webkit.org/show_bug.cgi?id=110433
3607 Reviewed by Oliver Hunt and Mark Hahnenberg.
3609 This introduces the equivalent of a liveness analysis, except for type checking.
3610 A variable is said to be "profitable for unboxing" (i.e. live at a type check)
3611 if there exists a type check on a GetLocal of that variable, and the type check
3612 is consistent with the variable's prediction. Variables that are not profitable
3613 for unboxing aren't unboxed. Previously they would have been.
3615 This is a slight speed-up on some things but mostly neutral.
3617 * dfg/DFGArgumentPosition.h:
3618 (JSC::DFG::ArgumentPosition::ArgumentPosition):
3619 (JSC::DFG::ArgumentPosition::mergeShouldNeverUnbox):
3620 (JSC::DFG::ArgumentPosition::mergeArgumentPredictionAwareness):
3621 (JSC::DFG::ArgumentPosition::mergeArgumentUnboxingAwareness):
3623 (JSC::DFG::ArgumentPosition::isProfitableToUnbox):
3624 (JSC::DFG::ArgumentPosition::shouldUseDoubleFormat):
3626 (JSC::DFG::checkAndSet):
3628 * dfg/DFGFixupPhase.cpp:
3629 (JSC::DFG::FixupPhase::run):
3630 (JSC::DFG::FixupPhase::fixupNode):
3631 (JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
3633 (JSC::DFG::FixupPhase::alwaysUnboxSimplePrimitives):
3634 (JSC::DFG::FixupPhase::setUseKindAndUnboxIfProfitable):
3635 * dfg/DFGPredictionPropagationPhase.cpp:
3636 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
3637 * dfg/DFGSpeculativeJIT.cpp:
3638 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
3639 * dfg/DFGVariableAccessData.h:
3640 (JSC::DFG::VariableAccessData::VariableAccessData):
3641 (JSC::DFG::VariableAccessData::mergeIsCaptured):
3642 (JSC::DFG::VariableAccessData::mergeIsProfitableToUnbox):
3643 (VariableAccessData):
3644 (JSC::DFG::VariableAccessData::isProfitableToUnbox):
3645 (JSC::DFG::VariableAccessData::shouldUnboxIfPossible):
3646 (JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
3647 (JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
3648 (JSC::DFG::VariableAccessData::shouldUseDoubleFormat):
3649 (JSC::DFG::VariableAccessData::mergeFlags):
3651 2013-02-26 Oliver Hunt <oliver@apple.com>
3655 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
3657 2013-02-26 Oliver Hunt <oliver@apple.com>
3659 Web Inspector: REGRESSION: [JSC] SourceProvider reuses IDs
3660 https://bugs.webkit.org/show_bug.cgi?id=99674
3662 Reviewed by Gavin Barraclough.
3664 Simple incrementing counter for SourceProvider IDs. Uses a
3665 lock to incrementing the counter so we don't increment reuse
3666 counter values or reassign the ID for a given SourceProvider.
3668 * parser/SourceProvider.cpp:
3669 (JSC::SourceProvider::SourceProvider):
3671 (JSC::SourceProvider::getID):
3672 * parser/SourceProvider.h:
3673 (JSC::SourceProvider::asID):
3676 2013-02-26 Sheriff Bot <webkit.review.bot@gmail.com>
3678 Unreviewed, rolling out r144074.
3679 http://trac.webkit.org/changeset/144074
3680 https://bugs.webkit.org/show_bug.cgi?id=110897
3682 Causing 20+ crashes on Mac (Requested by bradee-oh on
3686 * GNUmakefile.list.am:
3687 * JavaScriptCore.gypi:
3688 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3689 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3690 * JavaScriptCore.xcodeproj/project.pbxproj:
3692 * runtime/JSGlobalData.cpp:
3693 (JSC::JSGlobalData::JSGlobalData):
3694 * runtime/JSGlobalData.h:
3696 * runtime/PropertyMapHashTable.h:
3698 (JSC::PropertyTable::PropertyTable):
3700 (JSC::PropertyTable::~PropertyTable):
3701 (JSC::PropertyTable::copy):
3702 * runtime/PropertyTable.cpp: Removed.
3703 * runtime/Structure.cpp:
3704 (JSC::Structure::materializePropertyMap):
3705 (JSC::Structure::addPropertyTransition):
3706 (JSC::Structure::changePrototypeTransition):
3707 (JSC::Structure::despecifyFunctionTransition):
3708 (JSC::Structure::attributeChangeTransition):
3709 (JSC::Structure::toDictionaryTransition):
3710 (JSC::Structure::preventExtensionsTransition):
3711 (JSC::Structure::nonPropertyTransition):
3712 (JSC::Structure::copyPropertyTable):
3713 (JSC::Structure::copyPropertyTableForPinning):
3714 (JSC::Structure::putSpecificValue):
3715 (JSC::Structure::createPropertyMap):
3716 (JSC::Structure::visitChildren):
3717 * runtime/Structure.h:
3719 (JSC::Structure::putWillGrowOutOfLineStorage):
3720 (JSC::Structure::checkOffsetConsistency):
3722 * runtime/StructureInlines.h:
3724 2013-02-26 Roger Fong <roger_fong@apple.com>
3726 Unreviewed. AppleWin VS2010 build fix.
3728 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorCommon.props:
3730 2013-02-26 Jer Noble <jer.noble@apple.com>
3732 Unreviewed build fix; use correct macro for platform name in FeatureDefines.xcconfig.
3734 * Configurations/FeatureDefines.xcconfig:
3736 2013-02-26 Michael Saboff <msaboff@apple.com>
3738 Potential crash in YARR JIT generated code when building 64 bit
3739 https://bugs.webkit.org/show_bug.cgi?id=110893
3741 Reviewed by Gavin Barraclough.
3743 The ABI doesn't define the behavior for the upper bits of a value that takes less than 64 bits.
3744 Therefore, we zero extend both the count and length registers to assure that these unsigned values
3745 don't have garbage upper bits.
3748 (JSC::Yarr::YarrGenerator::generateEnter):
3750 2013-02-26 Andreas Kling <akling@apple.com>
3752 Unused Structure property tables waste 14MB on Membuster.
3753 <http://webkit.org/b/110854>
3754 <rdar://problem/13292104>
3756 Reviewed by Filip Pizlo.
3758 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
3759 14 MB progression on Membuster3.
3762 * GNUmakefile.list.am:
3763 * JavaScriptCore.gypi:
3764 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3765 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3766 * JavaScriptCore.xcodeproj/project.pbxproj:
3769 Added PropertyTable.cpp.
3771 * runtime/PropertyTable.cpp: Added.
3772 (JSC::PropertyTable::create):
3773 (JSC::PropertyTable::clone):
3774 (JSC::PropertyTable::PropertyTable):
3775 (JSC::PropertyTable::destroy):
3776 (JSC::PropertyTable::~PropertyTable):
3777 (JSC::PropertyTable::visitChildren):
3779 Moved marking of property table values here from Structure::visitChildren().
3781 * runtime/StructureInlines.h:
3782 (JSC::Structure::putWillGrowOutOfLineStorage):
3783 (JSC::Structure::checkOffsetConsistency):
3785 Moved these to StructureInlines.h to break header dependency cycle between Structure/PropertyTable.
3787 * runtime/Structure.cpp:
3788 (JSC::Structure::visitChildren):
3790 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
3792 (JSC::Structure::materializePropertyMap):
3793 (JSC::Structure::addPropertyTransition):
3794 (JSC::Structure::changePrototypeTransition):
3795 (JSC::Structure::despecifyFunctionTransition):
3796 (JSC::Structure::attributeChangeTransition):
3797 (JSC::Structure::toDictionaryTransition):
3798 (JSC::Structure::preventExtensionsTransition):
3799 (JSC::Structure::nonPropertyTransition):
3800 (JSC::Structure::copyPropertyTable):
3801 (JSC::Structure::copyPropertyTableForPinning):
3802 (JSC::Structure::putSpecificValue):
3803 (JSC::Structure::createPropertyMap):
3804 * runtime/Structure.h:
3806 * runtime/JSGlobalData.cpp:
3807 (JSC::JSGlobalData::JSGlobalData):
3808 * runtime/JSGlobalData.h:
3810 * runtime/PropertyMapHashTable.h:
3812 (JSC::PropertyTable::createStructure):
3813 (JSC::PropertyTable::copy):
3815 2013-02-26 Andreas Kling <akling@apple.com>
3817 Unreviewed, rolling out r144054.
3818 http://trac.webkit.org/changeset/144054
3819 https://bugs.webkit.org/show_bug.cgi?id=110854
3824 * GNUmakefile.list.am:
3825 * JavaScriptCore.gypi:
3826 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3827 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3828 * JavaScriptCore.xcodeproj/project.pbxproj:
3830 * runtime/JSGlobalData.cpp:
3831 (JSC::JSGlobalData::JSGlobalData):
3832 * runtime/JSGlobalData.h:
3834 * runtime/PropertyMapHashTable.h:
3836 (JSC::PropertyTable::PropertyTable):
3838 (JSC::PropertyTable::~PropertyTable):
3839 (JSC::PropertyTable::copy):
3840 * runtime/PropertyTable.cpp: Removed.
3841 * runtime/Structure.cpp:
3842 (JSC::Structure::materializePropertyMap):
3843 (JSC::Structure::addPropertyTransition):
3844 (JSC::Structure::changePrototypeTransition):
3845 (JSC::Structure::despecifyFunctionTransition):
3846 (JSC::Structure::attributeChangeTransition):
3847 (JSC::Structure::toDictionaryTransition):
3848 (JSC::Structure::preventExtensionsTransition):
3849 (JSC::Structure::nonPropertyTransition):
3850 (JSC::Structure::copyPropertyTable):
3851 (JSC::Structure::copyPropertyTableForPinning):
3852 (JSC::Structure::putSpecificValue):
3853 (JSC::Structure::createPropertyMap):
3854 (JSC::Structure::visitChildren):
3855 * runtime/Structure.h:
3857 (JSC::Structure::putWillGrowOutOfLineStorage):
3858 (JSC::Structure::checkOffsetConsistency):
3860 * runtime/StructureInlines.h:
3862 2013-02-26 Andreas Kling <akling@apple.com>
3864 Unused Structure property tables waste 14MB on Membuster.
3865 <http://webkit.org/b/110854>
3866 <rdar://problem/13292104>
3868 Reviewed by Filip Pizlo.
3870 Turn PropertyTable into a GC object and have Structure drop unpinned tables when marking.
3871 14 MB progression on Membuster3.
3874 * GNUmakefile.list.am:
3875 * JavaScriptCore.gypi:
3876 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3877 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3878 * JavaScriptCore.xcodeproj/project.pbxproj:
3881 Added PropertyTable.cpp.
3883 * runtime/PropertyTable.cpp: Added.
3884 (JSC::PropertyTable::create):
3885 (JSC::PropertyTable::clone):
3886 (JSC::PropertyTable::PropertyTable):
3887 (JSC::PropertyTable::destroy):
3888 (JSC::PropertyTable::~PropertyTable):
3889 (JSC::PropertyTable::visitChildren):
3891 Moved marking of property table values here from Structure::visitChildren().
3893 * runtime/StructureInlines.h:
3894 (JSC::Structure::putWillGrowOutOfLineStorage):
3895 (JSC::Structure::checkOffsetConsistency):
3897 Moved these to StructureInlines.h to break header dependency cycle between Structure/PropertyTable.
3899 * runtime/Structure.cpp:
3900 (JSC::Structure::visitChildren):
3902 Null out m_propertyTable if the table is unpinned. This'll cause the table to get GC'd.
3904 (JSC::Structure::materializePropertyMap):
3905 (JSC::Structure::addPropertyTransition):
3906 (JSC::Structure::changePrototypeTransition):
3907 (JSC::Structure::despecifyFunctionTransition):
3908 (JSC::Structure::attributeChangeTransition):
3909 (JSC::Structure::toDictionaryTransition):
3910 (JSC::Structure::preventExtensionsTransition):
3911 (JSC::Structure::nonPropertyTransition):
3912 (JSC::Structure::copyPropertyTable):
3913 (JSC::Structure::copyPropertyTableForPinning):
3914 (JSC::Structure::putSpecificValue):
3915 (JSC::Structure::createPropertyMap):
3916 * runtime/Structure.h:
3918 * runtime/JSGlobalData.cpp:
3919 (JSC::JSGlobalData::JSGlobalData):
3920 * runtime/JSGlobalData.h:
3922 * runtime/PropertyMapHashTable.h:
3924 (JSC::PropertyTable::createStructure):
3925 (JSC::PropertyTable::copy):
3927 2013-02-26 Jocelyn Turcotte <jocelyn.turcotte@digia.com>