ChangeLog 987 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
2013-03-22  Mark Hahnenberg  <mhahnenberg@apple.com>

        opaqueJSClassData should be cached on JSGlobalObject, not the JSGlobalData
        https://bugs.webkit.org/show_bug.cgi?id=113086

        Reviewed by Geoffrey Garen.

        opaqueJSClassData stores cached prototypes for JSClassRefs in the C API. It doesn't make sense to 
        share these prototypes within a JSGlobalData across JSGlobalObjects, and in fact doing so will cause 
        a leak of the original JSGlobalObject that these prototypes were created in. Therefore we should move 
        this cache to JSGlobalObject where it belongs and where it won't cause memory leaks.

        * API/JSBase.cpp: Needed to add an extern "C" so that testapi.c can use the super secret GC function.
        * API/JSClassRef.cpp: We now grab the cached context data from the global object rather than the global data.
        (OpaqueJSClass::contextData):
        * API/JSClassRef.h: Remove this header because it's unnecessary and causes circular dependencies.
        * API/tests/testapi.c: Added a new test that makes sure that using the same JSClassRef in two different contexts
        doesn't cause leaks of the original global object.
        (leakFinalize):
        (nestedAllocateObject): This is a hack to bypass the conservative scan of the GC, which was unnecessarily marking
        objects and keeping them alive, ruining the test result.
        (testLeakingPrototypesAcrossContexts):
        (main):
        * API/tests/testapi.mm: extern "C" this so we can continue using it here.
        * runtime/JSGlobalData.cpp: Remove JSClassRef related stuff.
        (JSC::JSGlobalData::~JSGlobalData):
        * runtime/JSGlobalData.h:
        (JSGlobalData):
        * runtime/JSGlobalObject.h: Add the stuff that JSGlobalData had. We add it to JSGlobalObjectRareData so that 
        clients who don't use the C API don't have to pay the memory cost of this extra HashMap.
        (JSGlobalObject):
        (JSGlobalObjectRareData):
        (JSC::JSGlobalObject::opaqueJSClassData):

35 36 37 38 39 40 41 42 43 44
2013-03-19  Martin Robinson  <mrobinson@igalia.com>

        [GTK] Add support for building the WebCore bindings to the gyp build
        https://bugs.webkit.org/show_bug.cgi?id=112638

        Reviewed by Nico Weber.

        * JavaScriptCore.gyp/JavaScriptCoreGTK.gyp: Export all include directories to direct
        dependents and fix the indentation of the libjavascriptcore target.

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
2013-03-21  Filip Pizlo  <fpizlo@apple.com>

        Fix some minor issues in the DFG's profiling of heap accesses
        https://bugs.webkit.org/show_bug.cgi?id=113010

        Reviewed by Goeffrey Garen.
        
        1) If a CodeBlock gets jettisoned by GC, we should count the exit sites.

        2) If a CodeBlock clears a structure stub during GC, it should record this, and
        the DFG should prefer to not inline that access (i.e. treat it as if it had an
        exit site).

        3) If a PutById was seen by the baseline JIT, and the JIT attempted to cache it,
        but it chose not to, then assume that it will take slow path.

        4) If we frequently exited because of a structure check on a weak constant,
        don't try to inline that access in the future.

        5) Treat all exits that were counted as being frequent.
        
        81% speed-up on Octane/gbemu. Small speed-ups elsewhere, and no regressions.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::finalizeUnconditionally):
        (JSC):
        (JSC::CodeBlock::resetStubDuringGCInternal):
        (JSC::CodeBlock::reoptimize):
        (JSC::CodeBlock::jettison):
        (JSC::ProgramCodeBlock::jettisonImpl):
        (JSC::EvalCodeBlock::jettisonImpl):
        (JSC::FunctionCodeBlock::jettisonImpl):
        (JSC::CodeBlock::tallyFrequentExitSites):
        * bytecode/CodeBlock.h:
        (CodeBlock):
        (JSC::CodeBlock::tallyFrequentExitSites):
        (ProgramCodeBlock):
        (EvalCodeBlock):
        (FunctionCodeBlock):
        * bytecode/GetByIdStatus.cpp:
        (JSC::GetByIdStatus::computeFor):
        * bytecode/PutByIdStatus.cpp:
        (JSC::PutByIdStatus::computeFor):
        * bytecode/StructureStubInfo.h:
        (JSC::StructureStubInfo::StructureStubInfo):
        (StructureStubInfo):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::handleGetById):
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGOSRExit.cpp:
        (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
        * dfg/DFGOSRExit.h:
        (JSC::DFG::OSRExit::considerAddingAsFrequentExitSite):
        (OSRExit):
        * jit/JITStubs.cpp:
        (JSC::DEFINE_STUB_FUNCTION):
        * runtime/Options.h:
        (JSC):

104 105 106 107 108 109 110 111 112 113
2013-03-22  Filip Pizlo  <fpizlo@apple.com>

        DFG folding of PutById to SimpleReplace should consider the specialized function case
        https://bugs.webkit.org/show_bug.cgi?id=113093

        Reviewed by Geoffrey Garen and Mark Hahnenberg.

        * bytecode/PutByIdStatus.cpp:
        (JSC::PutByIdStatus::computeFor):

114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
2013-03-22  David Kilzer  <ddkilzer@apple.com>

        BUILD FIX (r146558): Build testapi.mm with ARC enabled for armv7s
        <http://webkit.org/b/112608>

        Fixes the following build failure:

            Source/JavaScriptCore/API/tests/testapi.mm:205:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
            }
            ^
            1 error generated.

        * Configurations/ToolExecutable.xcconfig: Enable ARC for armv7s
        architecture.

129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
2013-03-22  David Kilzer  <ddkilzer@apple.com>

        Revert "BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]"

        This fixes a build failure introduced by this change:

            Source/JavaScriptCore/API/tests/testapi.mm:206:6: error: ARC forbids explicit message send of 'dealloc'
                [super dealloc];
                 ^     ~~~~~~~
            1 error generated.

        Not sure why this didn't fail locally on my Mac Pro.

        * API/tests/testapi.mm:
        (-[TinyDOMNode dealloc]): Remove call to [super dealloc].

145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
2013-03-22  David Kilzer  <ddkilzer@apple.com>

        BUILD FIX (r146558): Call [super dealloc] from -[TinyDOMNode dealloc]
        <http://webkit.org/b/112608>

        Fixes the following build failure:

            Source/JavaScriptCore/API/tests/testapi.mm:205:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
            }
            ^
            1 error generated.

        * API/tests/testapi.mm:
        (-[TinyDOMNode dealloc]): Call [super dealloc].

160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
2013-03-22  Ryosuke Niwa  <rniwa@webkit.org>

        Leak bots erroneously report JSC::WatchpointSet as leaking
        https://bugs.webkit.org/show_bug.cgi?id=107781

        Reviewed by Filip Pizlo.

        Since leaks doesn't support tagged pointers, avoid using it by flipping the bit flag to indicate
        the entry is "fat". We set the flag when the entry is NOT fat; i.e. slim.

        Replaced FatFlag by SlimFlag and initialized m_bits with this flag to indicate that the entry is
        initially "slim".

        * runtime/SymbolTable.cpp:
        (JSC::SymbolTableEntry::copySlow): Don't set FatFlag since it has been replaced by SlimFlag.
        (JSC::SymbolTableEntry::inflateSlow): Ditto.

        * runtime/SymbolTable.h:
        (JSC::SymbolTableEntry::Fast::Fast): Set SlimFlag by default.
        (JSC::SymbolTableEntry::Fast::isNull): Ignore SlimFlag.
        (JSC::SymbolTableEntry::Fast::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag
        is not set.

        (JSC::SymbolTableEntry::SymbolTableEntry): Set SlimFlag by default.
        (JSC::SymbolTableEntry::SymbolTableEntry::getFast): Set SlimFlag when creating Fast from a fat entry.
        (JSC::SymbolTableEntry::isNull): Ignore SlimFlag.
        (JSC::SymbolTableEntry::FatEntry::FatEntry): Strip SlimFlag.
        (JSC::SymbolTableEntry::isFat): An entry is fat when m_bits is not entirely zero and SlimFlag is unset.
        (JSC::SymbolTableEntry::fatEntry): Don't strip FatFlag as this flag doesn't exist anymore.
        (JSC::SymbolTableEntry::pack): Preserve SlimFlag.

        (JSC::SymbolTableIndexHashTraits): empty value is no longer zero so don't set emptyValueIsZero true.

193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
2013-03-21  Mark Hahnenberg  <mhahnenberg@apple.com>

        Objective-C API: Need a good way to preserve custom properties on JS wrappers
        https://bugs.webkit.org/show_bug.cgi?id=112608

        Reviewed by Geoffrey Garen.

        Currently, we just use a weak map, which means that garbage collection can cause a wrapper to 
        disappear if it isn't directly exported to JavaScript.

        The most straightforward and safe way (with respect to garbage collection and concurrency) is to have 
        clients add and remove their external references along with their owners. Effectively, the client is 
        recording the structure of the external object graph so that the garbage collector can make sure to 
        mark any wrappers that are reachable through either the JS object graph of the external Obj-C object 
        graph. By keeping these wrappers alive, this has the effect that custom properties on these wrappers 
        will also remain alive.

        The rule for if an object needs to be tracked by the runtime (and therefore whether the client should report it) is as follows:
        For a particular object, its references to its children should be added if:
        1. The child is referenced from JavaScript.
        2. The child contains references to other objects for which (1) or (2) are true.

        * API/JSAPIWrapperObject.mm:
        (JSAPIWrapperObjectHandleOwner::finalize):
        (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): A wrapper object is kept alive only if its JSGlobalObject
        is marked and its corresponding Objective-C object was added to the set of opaque roots.
        (JSC::JSAPIWrapperObject::visitChildren): We now call out to scanExternalObjectGraph, which handles adding all Objective-C
        objects to the set of opaque roots.
        * API/JSAPIWrapperObject.h:
        (JSAPIWrapperObject):
        * API/JSContext.mm: Moved dealloc to its proper place in the main implementation.
        (-[JSContext dealloc]):
        * API/JSVirtualMachine.h:
        * API/JSVirtualMachine.mm:
        (-[JSVirtualMachine initWithContextGroupRef:]):
        (-[JSVirtualMachine dealloc]):
        (getInternalObjcObject): Helper funciton to get the Objective-C object out of JSManagedValues or JSValues if there is one.
        (-[JSVirtualMachine addManagedReference:withOwner:]): Adds the Objective-C object to the set of objects 
        owned by the owner object in that particular virtual machine.
        (-[JSVirtualMachine removeManagedReference:withOwner:]): Removes the relationship between the two objects.
        (-[JSVirtualMachine externalObjectGraph]):
        (scanExternalObjectGraph): Does a depth-first search of the external object graph in a particular virtual machine starting at
        the specified root. Each new object it encounters it adds to the set of opaque roots. These opaque roots will keep their 
        corresponding wrapper objects alive if they have them. 
        * API/JSManagedReferenceInternal.h: Added.
        * API/JSVirtualMachine.mm: Added the per-JSVirtualMachine map between objects and the objects they own, which is more formally
        known as that virtual machine's external object graph.
        * API/JSWrapperMap.mm:
        (-[JSWrapperMap dealloc]): We were leaking this before :-(
        (-[JSVirtualMachine initWithContextGroupRef:]):
        (-[JSVirtualMachine dealloc]):
        (-[JSVirtualMachine externalObjectGraph]):
        * API/JSVirtualMachineInternal.h:
        * API/tests/testapi.mm: Added two new tests using the TinyDOMNode class. The first tests that a custom property added to a wrapper 
        doesn't vanish after GC, even though that wrapper isn't directly accessible to the JS garbage collector but is accessible through 
        the external Objective-C object graph. The second test makes sure that adding an object to the external object graph with the same 
        owner doesn't cause any sort of problems.
        (+[TinyDOMNode sharedVirtualMachine]):
        (-[TinyDOMNode init]):
        (-[TinyDOMNode dealloc]):
        (-[TinyDOMNode appendChild:]):
        (-[TinyDOMNode numberOfChildren]):
        (-[TinyDOMNode childAtIndex:]):
        (-[TinyDOMNode removeChildAtIndex:]):
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * heap/SlotVisitor.h:
        (SlotVisitor):
        * heap/SlotVisitorInlines.h:
        (JSC::SlotVisitor::containsOpaqueRootTriState): Added a new method to SlotVisitor to allow scanExternalObjectGraph to have a 
        thread-safe view of opaque roots during parallel marking. The set of opaque roots available to any one SlotVisitor isn't guaranteed
        to be 100% correct, but that just results in a small duplication of work in scanExternalObjectGraph. To indicate this change for
        false negatives we return a TriState that's either true or mixed, but never false.

266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
2013-03-21  Mark Lam  <mark.lam@apple.com>

        Fix O(n^2) op_debug bytecode charPosition to column computation.
        https://bugs.webkit.org/show_bug.cgi?id=112957.

        Reviewed by Geoffrey Garen.

        The previous algorithm does a linear reverse scan of the source string
        to find the line start for any given char position. This results in a
        O(n^2) algortithm when the source string has no line breaks.

        The new algorithm computes a line start column table for a
        SourceProvider on first use. This line start table is used to fix up
        op_debug's charPosition operand into a column operand when an
        UnlinkedCodeBlock is linked into a CodeBlock. The initialization of
        the line start table is O(n), and the CodeBlock column fix up is
        O(log(n)).

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::dumpBytecode): 
        (JSC::CodeBlock::CodeBlock): - do column fix up.
        * interpreter/Interpreter.cpp:
        (JSC::Interpreter::debug): - no need to do column fixup anymore.
        * interpreter/Interpreter.h:
        * jit/JITStubs.cpp:
        (JSC::DEFINE_STUB_FUNCTION):
        * llint/LLIntSlowPaths.cpp:
        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
        * parser/SourceProvider.cpp:
        (JSC::SourceProvider::lineStarts):
        (JSC::charPositionExtractor):
        (JSC::SourceProvider::charPositionToColumnNumber):
        - initialize line start column table if needed.
        - look up line start for the given char position.
        * parser/SourceProvider.h:

302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
2013-03-21  Filip Pizlo  <fpizlo@apple.com>

        JSC profiler should have an at-a-glance report of the success of DFG optimization
        https://bugs.webkit.org/show_bug.cgi?id=112988

        Reviewed by Geoffrey Garen.

        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::handleCall):
        (JSC::DFG::ByteCodeParser::handleGetById):
        (JSC::DFG::ByteCodeParser::parseBlock):
        * profiler/ProfilerCompilation.cpp:
        (JSC::Profiler::Compilation::Compilation):
        (JSC::Profiler::Compilation::toJS):
        * profiler/ProfilerCompilation.h:
        (JSC::Profiler::Compilation::noticeInlinedGetById):
        (JSC::Profiler::Compilation::noticeInlinedPutById):
        (JSC::Profiler::Compilation::noticeInlinedCall):
        (Compilation):
        * runtime/CommonIdentifiers.h:

323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
2013-03-21  Mark Lam  <mark.lam@apple.com>

        Fix lexer charPosition computation when "rewind"ing the lexer.
        https://bugs.webkit.org/show_bug.cgi?id=112952.

        Reviewed by Michael Saboff.

        Changed the Lexer to no longer keep a m_charPosition. Instead, we compute
        currentCharPosition() from m_code and m_codeStartPlusOffset, where
        m_codeStartPlusOffset is the SourceProvider m_codeStart + the SourceCode
        start offset. This ensures that the charPosition is always in sync with
        m_code.

        * parser/Lexer.cpp:
        (JSC::::setCode):
        (JSC::::internalShift):
        (JSC::::shift):
        (JSC::::lex):
        * parser/Lexer.h:
        (JSC::Lexer::currentCharPosition):
        (JSC::::lexExpectIdentifier):

345 346 347 348 349 350 351 352 353 354 355 356
2013-03-21  Alberto Garcia  <agarcia@igalia.com>

        [BlackBerry] GCActivityCallback: replace JSLock with JSLockHolder
        https://bugs.webkit.org/show_bug.cgi?id=112448

        Reviewed by Xan Lopez.

        This changed in r121381.

        * runtime/GCActivityCallbackBlackBerry.cpp:
        (JSC::DefaultGCActivityCallback::doWork):

357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
2013-03-21  Mark Hahnenberg  <mhahnenberg@apple.com>

        Objective-C API: wrapperClass holds a static JSClassRef, which causes JSGlobalObjects to leak
        https://bugs.webkit.org/show_bug.cgi?id=112856

        Reviewed by Geoffrey Garen.

        Through a very convoluted path that involves the caching of prototypes on the JSClassRef, we can leak 
        JSGlobalObjects when inserting an Objective-C object into multiple independent JSContexts.

        * API/JSAPIWrapperObject.cpp: Removed.
        * API/JSAPIWrapperObject.h:
        (JSAPIWrapperObject):
        * API/JSAPIWrapperObject.mm: Copied from Source/JavaScriptCore/API/JSAPIWrapperObject.cpp. Made this an
        Objective-C++ file so that we can call release on the wrappedObject. Also added a WeakHandleOwner for 
        JSAPIWrapperObjects. This will also be used in a future patch for https://bugs.webkit.org/show_bug.cgi?id=112608.
        (JSAPIWrapperObjectHandleOwner):
        (jsAPIWrapperObjectHandleOwner):
        (JSAPIWrapperObjectHandleOwner::finalize): This finalize replaces the old finalize that was done through
        the C API.
        (JSC::JSAPIWrapperObject::finishCreation): Allocate the WeakImpl. Balanced in finalize.
        (JSC::JSAPIWrapperObject::setWrappedObject): We now do the retain of the wrappedObject here rather than in random
        places scattered around JSWrapperMap.mm
        * API/JSObjectRef.cpp: Added some ifdefs for platforms that don't support the Obj-C API.
        (JSObjectGetPrivate): Ditto.
        (JSObjectSetPrivate): Ditto.
        (JSObjectGetPrivateProperty): Ditto.
        (JSObjectSetPrivateProperty): Ditto.
        (JSObjectDeletePrivateProperty): Ditto.
        * API/JSValueRef.cpp: Ditto.
        (JSValueIsObjectOfClass): Ditto.
        * API/JSWrapperMap.mm: Remove wrapperClass().
        (objectWithCustomBrand): Change to no longer use a parent class, which was only used to give the ability to 
        finalize wrapper objects.
        (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]): Change to no longer use wrapperClass(). 
        (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): Ditto.
        (tryUnwrapObjcObject): We now check if the object inherits from JSAPIWrapperObject.
        * API/tests/testapi.mm: Added a test that exports an Objective-C object to two different JSContexts and makes 
        sure that the first one is collected properly by using a weak JSManagedValue for the wrapper in the first JSContext.
        * CMakeLists.txt: Build file modifications.
        * GNUmakefile.list.am: Ditto.
        * JavaScriptCore.gypi: Ditto.
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Ditto.
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.
        * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
        * runtime/JSGlobalObject.cpp: More ifdefs for unsupported platforms.
        (JSC::JSGlobalObject::reset): Ditto.
        (JSC::JSGlobalObject::visitChildren): Ditto.
        * runtime/JSGlobalObject.h: Ditto.
        (JSGlobalObject): Ditto.
        (JSC::JSGlobalObject::objcCallbackFunctionStructure): Ditto.

410 411 412 413 414 415 416 417 418 419
2013-03-21  Anton Muhin  <antonm@chromium.org>

        Unreviewed, rolling out r146483.
        http://trac.webkit.org/changeset/146483
        https://bugs.webkit.org/show_bug.cgi?id=111695

        Breaks debug builds.

        * bytecode/GlobalResolveInfo.h: Removed property svn:mergeinfo.

420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
2013-03-21  Gabor Rapcsanyi  <rgabor@webkit.org>

        Implement LLInt for CPU(ARM_TRADITIONAL)
        https://bugs.webkit.org/show_bug.cgi?id=97589

        Reviewed by Zoltan Herczeg.

        Enable LLInt for ARMv5 and ARMv7 traditional as well.

        * llint/LLIntOfflineAsmConfig.h:
        * llint/LowLevelInterpreter.asm:
        * llint/LowLevelInterpreter32_64.asm:
        * offlineasm/arm.rb:
        * offlineasm/backends.rb:
        * offlineasm/instructions.rb:

436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452
2013-03-20  Cosmin Truta  <ctruta@blackberry.com>

        [QNX][ARM] REGRESSION(r135330): Various failures in Octane
        https://bugs.webkit.org/show_bug.cgi?id=112863

        Reviewed by Yong Li.

        This was fixed in http://trac.webkit.org/changeset/146396 on Linux only.
        Enable this fix on QNX.

        * assembler/ARMv7Assembler.h:
        (ARMv7Assembler):
        (JSC::ARMv7Assembler::replaceWithJump):
        (JSC::ARMv7Assembler::maxJumpReplacementSize):
        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):

453 454 455 456 457 458 459 460
2013-03-20  Filip Pizlo  <fpizlo@apple.com>

        Fix indentation of JSString.h

        Rubber stamped by Mark Hahnenberg.

        * runtime/JSString.h:

461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
2013-03-20  Filip Pizlo  <fpizlo@apple.com>

        "" + x where x is not a string should be optimized by the DFG to some manner of ToString conversion
        https://bugs.webkit.org/show_bug.cgi?id=112845

        Reviewed by Mark Hahnenberg.
        
        I like to do "" + x. So I decided to make DFG recognize it, and related idioms.

        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (JSC::DFG::FixupPhase::fixupToPrimitive):
        (FixupPhase):
        (JSC::DFG::FixupPhase::fixupToString):
        (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::resultOfToPrimitive):
        (DFG):
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGPredictionPropagationPhase.h:
        (DFG):

483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
2013-03-20  Zoltan Herczeg  <zherczeg@webkit.org>

        ARMv7 replaceWithJump ASSERT failure after r135330.
        https://bugs.webkit.org/show_bug.cgi?id=103146

        Reviewed by Filip Pizlo.

        On Linux, the 24 bit distance range of jumps sometimes does not
        enough to cover all targets addresses. This patch supports jumps
        outside of this range using a mov/movt/bx 10 byte long sequence.

        * assembler/ARMv7Assembler.h:
        (ARMv7Assembler):
        (JSC::ARMv7Assembler::revertJumpTo_movT3movtcmpT2):
        (JSC::ARMv7Assembler::nopw):
        (JSC::ARMv7Assembler::label):
        (JSC::ARMv7Assembler::replaceWithJump):
        (JSC::ARMv7Assembler::maxJumpReplacementSize):
        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):

504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
2013-03-20  Mark Hahnenberg  <mhahnenberg@apple.com>

        Objective-C API: Fix over-releasing in allocateConstructorAndPrototypeWithSuperClassInfo:
        https://bugs.webkit.org/show_bug.cgi?id=112832

        Reviewed by Geoffrey Garen.

        If either the m_constructor or m_prototype (but not both) is collected, we will call 
        allocateConstructorAndPrototypeWithSuperClassInfo, which will create a new object to replace the one 
        that was collected, but at the end of the method we call release on both of them. 
        This is incorrect since we autorelease the JSValue in the case that the object doesn't need to be 
        reallocated. Thus we'll end up overreleasing later during the drain of the autorelease pool.

        * API/JSWrapperMap.mm:
        (objectWithCustomBrand): We no longer alloc here. We instead call the JSValue valueWithValue class method,
        which autoreleases for us.
        (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): We no longer call release on the 
        constructor or prototype JSValues.
        * API/tests/testapi.mm: Added a new test that crashes on ToT due to over-releasing.

524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560
2013-03-19  Filip Pizlo  <fpizlo@apple.com>

        It's called "Hash Consing" not "Hash Consting"
        https://bugs.webkit.org/show_bug.cgi?id=112768

        Rubber stamped by Mark Hahnenberg.
        
        See http://en.wikipedia.org/wiki/Hash_consing

        * heap/GCThreadSharedData.cpp:
        (JSC::GCThreadSharedData::GCThreadSharedData):
        (JSC::GCThreadSharedData::reset):
        * heap/GCThreadSharedData.h:
        (GCThreadSharedData):
        * heap/SlotVisitor.cpp:
        (JSC::SlotVisitor::SlotVisitor):
        (JSC::SlotVisitor::setup):
        (JSC::SlotVisitor::reset):
        (JSC::JSString::tryHashConsLock):
        (JSC::JSString::releaseHashConsLock):
        (JSC::JSString::shouldTryHashCons):
        (JSC::SlotVisitor::internalAppend):
        * heap/SlotVisitor.h:
        (SlotVisitor):
        * runtime/JSGlobalData.cpp:
        (JSC::JSGlobalData::JSGlobalData):
        * runtime/JSGlobalData.h:
        (JSGlobalData):
        (JSC::JSGlobalData::haveEnoughNewStringsToHashCons):
        (JSC::JSGlobalData::resetNewStringsSinceLastHashCons):
        * runtime/JSString.h:
        (JSC::JSString::finishCreation):
        (JSString):
        (JSC::JSString::isHashConsSingleton):
        (JSC::JSString::clearHashConsSingleton):
        (JSC::JSString::setHashConsSingleton):

561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642
2013-03-20  Filip Pizlo  <fpizlo@apple.com>

        DFG implementation of op_strcat should inline rope allocations
        https://bugs.webkit.org/show_bug.cgi?id=112780

        Reviewed by Oliver Hunt.
        
        This gets rid of the StrCat node and adds a MakeRope node. The MakeRope node can
        take either two or three operands, and allocates a rope string with either two or
        three fibers. (The magic choice of three children for non-VarArg nodes happens to
        match exactly with the magic choice of three fibers for rope strings.)
        
        ValueAdd on KnownString is replaced with MakeRope with two children.
        
        StrCat gets replaced by an appropriate sequence of MakeRope's.
        
        MakeRope does not do the dynamic check to see if its children are empty strings.
        This is replaced by a static check, instead. The downside is that we may use more
        memory if the strings passed to MakeRope turn out to dynamically be empty. The
        upside is that we do fewer checks in the cases where either the strings are not
        empty, or where the strings are statically known to be empty. I suspect both of
        those cases are more common, than the case where the string is dynamically empty.
        
        This also results in some badness for X86. MakeRope needs six registers if it is
        allocating a three-rope. We don't have six registers to spare on X86. Currently,
        the code side-steps this problem by just never usign three-ropes in optimized
        code on X86. All other architectures, including X86_64, don't have this problem.
        
        This is a shocking speed-up. 9% progressions on both V8/splay and
        SunSpider/date-format-xparb. 1% progression on V8v7 overall, and ~0.5% progression
        on SunSpider. 2x speed-up on microbenchmarks that test op_strcat.

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::executeEffects):
        * dfg/DFGAdjacencyList.h:
        (AdjacencyList):
        (JSC::DFG::AdjacencyList::removeEdge):
        * dfg/DFGArgumentsSimplificationPhase.cpp:
        (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
        * dfg/DFGBackwardsPropagationPhase.cpp:
        (JSC::DFG::BackwardsPropagationPhase::propagate):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGCSEPhase.cpp:
        (JSC::DFG::CSEPhase::putStructureStoreElimination):
        (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
        (JSC::DFG::CSEPhase::performNodeCSE):
        * dfg/DFGDCEPhase.cpp:
        (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (JSC::DFG::FixupPhase::createToString):
        (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
        (JSC::DFG::FixupPhase::convertStringAddUse):
        (FixupPhase):
        (JSC::DFG::FixupPhase::convertToMakeRope):
        (JSC::DFG::FixupPhase::fixupMakeRope):
        (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
        * dfg/DFGNodeType.h:
        (DFG):
        * dfg/DFGOperations.cpp:
        * dfg/DFGOperations.h:
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileAdd):
        (JSC::DFG::SpeculativeJIT::compileMakeRope):
        (DFG):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::callOperation):
        (SpeculativeJIT):
        (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
        (JSC::DFG::SpeculateCellOperand::~SpeculateCellOperand):
        (JSC::DFG::SpeculateCellOperand::gpr):
        (JSC::DFG::SpeculateCellOperand::use):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * runtime/JSString.h:
        (JSRopeString):

643 644 645 646 647 648 649 650 651 652 653
2013-03-20  Peter Gal  <galpeter@inf.u-szeged.hu>

        Implement and32 on MIPS platform
        https://bugs.webkit.org/show_bug.cgi?id=112665

        Reviewed by Zoltan Herczeg.

        * assembler/MacroAssemblerMIPS.h:
        (JSC::MacroAssemblerMIPS::and32): Added missing method.
        (MacroAssemblerMIPS):

654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
2013-03-20  Mark Lam  <mark.lam@apple.com>

        Fix incorrect debugger column number value.
        https://bugs.webkit.org/show_bug.cgi?id=112741.

        Reviewed by Oliver Hunt.

        1. In lexer, parser, and debugger code, renamed column to charPosition.
        2. Convert the charPosition to the equivalent column number before
           passing it to the debugger.
        3. Changed ScopeNodes to take both a startLocation and an endLocation.
           This allows FunctionBodyNodes, ProgramNodes, and EvalNodess to emit
           correct debug hooks with correct starting line and column numbers.
        4. Fixed the Lexer to not reset the charPosition (previously
           columnNumber) in Lexer::lex().

        * JavaScriptCore.order:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
        * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::dumpBytecode):
        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::emitDebugHook):
        * bytecompiler/BytecodeGenerator.h:
        (JSC::BytecodeGenerator::emitExpressionInfo):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::ArrayNode::toArgumentList):
        (JSC::ConstStatementNode::emitBytecode):
        (JSC::EmptyStatementNode::emitBytecode):
        (JSC::DebuggerStatementNode::emitBytecode):
        (JSC::ExprStatementNode::emitBytecode):
        (JSC::VarStatementNode::emitBytecode):
        (JSC::IfNode::emitBytecode):
        (JSC::IfElseNode::emitBytecode):
        (JSC::DoWhileNode::emitBytecode):
        (JSC::WhileNode::emitBytecode):
        (JSC::ForNode::emitBytecode):
        (JSC::ForInNode::emitBytecode):
        (JSC::ContinueNode::emitBytecode):
        (JSC::BreakNode::emitBytecode):
        (JSC::ReturnNode::emitBytecode):
        (JSC::WithNode::emitBytecode):
        (JSC::SwitchNode::emitBytecode):
        (JSC::LabelNode::emitBytecode):
        (JSC::ThrowNode::emitBytecode):
        (JSC::TryNode::emitBytecode):
        (JSC::ProgramNode::emitBytecode):
        (JSC::EvalNode::emitBytecode):
        (JSC::FunctionBodyNode::emitBytecode):
        * interpreter/Interpreter.cpp:
        (JSC::Interpreter::debug):
        - convert charPosition to column for the debugger.
        * interpreter/Interpreter.h:
        * jit/JITStubs.cpp:
        (DEFINE_STUB_FUNCTION(void, op_debug)):
        * llint/LLIntSlowPaths.cpp:
        (LLINT_SLOW_PATH_DECL(slow_op_debug)):
        * parser/ASTBuilder.h:
        (JSC::ASTBuilder::createFunctionExpr):
        (JSC::ASTBuilder::createFunctionBody):
        (JSC::ASTBuilder::createGetterOrSetterProperty):
        (JSC::ASTBuilder::createFuncDeclStatement):
        (JSC::ASTBuilder::createBlockStatement):
        (JSC::ASTBuilder::createExprStatement):
        (JSC::ASTBuilder::createIfStatement):
        (JSC::ASTBuilder::createForLoop):
        (JSC::ASTBuilder::createForInLoop):
        (JSC::ASTBuilder::createVarStatement):
        (JSC::ASTBuilder::createReturnStatement):
        (JSC::ASTBuilder::createBreakStatement):
        (JSC::ASTBuilder::createContinueStatement):
        (JSC::ASTBuilder::createTryStatement):
        (JSC::ASTBuilder::createSwitchStatement):
        (JSC::ASTBuilder::createWhileStatement):
        (JSC::ASTBuilder::createDoWhileStatement):
        (JSC::ASTBuilder::createWithStatement):
        (JSC::ASTBuilder::createThrowStatement):
        (JSC::ASTBuilder::createDebugger):
        (JSC::ASTBuilder::createConstStatement):
        * parser/Lexer.cpp:
        (JSC::::setCode):
        (JSC::::internalShift):
        (JSC::::shift):
        (JSC::::lex):
        * parser/Lexer.h:
        (JSC::Lexer::currentCharPosition):
        (Lexer):
        (JSC::::lexExpectIdentifier):
        * parser/NodeConstructors.h:
        (JSC::Node::Node):
        * parser/Nodes.cpp:
        (JSC::StatementNode::setLoc):
        (JSC::ScopeNode::ScopeNode):
        (JSC::ProgramNode::ProgramNode):
        (JSC::ProgramNode::create):
        (JSC::EvalNode::EvalNode):
        (JSC::EvalNode::create):
        (JSC::FunctionBodyNode::FunctionBodyNode):
        (JSC::FunctionBodyNode::create):
        * parser/Nodes.h:
        (JSC::Node::charPosition):
        (Node):
        (StatementNode):
        (JSC::StatementNode::lastLine):
        (ScopeNode):
        (JSC::ScopeNode::startLine):
        (JSC::ScopeNode::startCharPosition):
        (ProgramNode):
        (EvalNode):
        (FunctionBodyNode):
        * parser/Parser.cpp:
        (JSC::::Parser):
        (JSC::::parseFunctionBody):
        (JSC::::parseFunctionInfo):
        * parser/Parser.h:
        (JSC::::parse):
        * parser/ParserTokens.h:
        (JSC::JSTokenLocation::JSTokenLocation):
        (JSTokenLocation):
        * parser/SyntaxChecker.h:
        (JSC::SyntaxChecker::createFunctionBody):

776 777 778 779 780 781 782 783 784 785 786 787 788
2013-03-20  Csaba Osztrogonác  <ossy@webkit.org>

        REGRESSION(r146089): It broke 20 sputnik tests on ARM traditional and Thumb2
        https://bugs.webkit.org/show_bug.cgi?id=112676

        Rubber-stamped by Filip Pizlo.

        Add one more EABI_32BIT_DUMMY_ARG to make DFG JIT ARM EABI compatible
        again after r146089 similar to https://bugs.webkit.org/show_bug.cgi?id=84449

        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::callOperation):

789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809
2013-03-19  Michael Saboff  <msaboff@apple.com>

        Crash when loading http://www.jqchart.com/jquery/gauges/RadialGauge/LiveData
        https://bugs.webkit.org/show_bug.cgi?id=112694

        Reviewed by Filip Pizlo.

        We were trying to convert an NewArray to a Phantom, but convertToPhantom doesn't handle
        nodes with variable arguments.  Added code to insert a Phantom node in front of all the
        live children of a var args node.  Added ASSERT not var args for convertToPhantom to
        catch any other similar cases.  Added a new convertToPhantomUnchecked() for converting 
        var arg nodes.

        * dfg/DFGDCEPhase.cpp:
        (JSC::DFG::DCEPhase::run):
        * dfg/DFGNode.h:
        (Node):
        (JSC::DFG::Node::setOpAndDefaultNonExitFlags): Added ASSERT(!(m_flags & NodeHasVarArgs))
        (JSC::DFG::Node::setOpAndDefaultNonExitFlagsUnchecked):
        (JSC::DFG::Node::convertToPhantomUnchecked):

810 811 812 813 814 815 816 817 818 819 820
2013-03-19  Mark Hahnenberg  <mhahnenberg@apple.com>

        Crash in SpeculativeJIT::fillSpeculateIntInternal<false> on http://bellard.org/jslinux
        https://bugs.webkit.org/show_bug.cgi?id=112738

        Reviewed by Filip Pizlo.

        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixIntEdge): We shouldn't be killing this node because it could be
        referenced by other people.

821 822 823 824 825 826 827 828 829 830 831 832
2013-03-19  Oliver Hunt  <oliver@apple.com>

        RELEASE_ASSERT fires in exception handler lookup

        RS=Geoff Garen.

        Temporarily switch this RELEASE_ASSERT into a regular ASSERT 
        as currently this is producing fairly bad crashiness.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::handlerForBytecodeOffset):

833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850
2013-03-18  Filip Pizlo  <fpizlo@apple.com>

        DFG should optimize StringObject.length and StringOrStringObject.length
        https://bugs.webkit.org/show_bug.cgi?id=112658

        Reviewed by Mark Hahnenberg.
        
        Implemented by injecting a ToString(StringObject:@a) or ToString(StringOrStringObject:@a) prior
        to GetArrayLength with ArrayMode(Array::String) if @a is predicted StringObject or
        StringOrStringObject.

        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (JSC::DFG::FixupPhase::createToString):
        (FixupPhase):
        (JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
        (JSC::DFG::FixupPhase::convertStringAddUse):

851 852 853 854 855 856 857 858 859 860 861 862 863 864
2013-03-19  Gabor Rapcsanyi  <rgabor@webkit.org>

        Implement and32 on ARMv7 and ARM traditional platforms
        https://bugs.webkit.org/show_bug.cgi?id=112663

        Reviewed by Zoltan Herczeg.

        * assembler/MacroAssemblerARM.h:
        (JSC::MacroAssemblerARM::and32): Add missing method.
        (MacroAssemblerARM):
        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::and32): Add missing method.
        (MacroAssemblerARMv7):

865 866 867 868 869 870 871 872 873 874 875 876 877 878 879
2013-03-18  Filip Pizlo  <fpizlo@apple.com>

        DFG ToString generic cases should work correctly
        https://bugs.webkit.org/show_bug.cgi?id=112654
        <rdar://problem/13447250>

        Reviewed by Geoffrey Garen.

        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

880 881 882 883 884 885 886
2013-03-18  Michael Saboff  <msaboff@apple.com>

        Unreviewed build fix for 32 bit builds.

        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
2013-03-18  Michael Saboff  <msaboff@apple.com>

        EFL: Unsafe branch detected in compilePutByValForFloatTypedArray()
        https://bugs.webkit.org/show_bug.cgi?id=112609

        Reviewed by Geoffrey Garen.

        Created local valueFPR and scratchFPR and filled them with valueOp.fpr() and scratch.fpr()
        respectively so that if valueOp.fpr() causes a spill during allocation, it occurs before the
        branch and also to follow convention.  Added register allocation checks to FPRTemporary.
        Cleaned up a couple of other places to follow the "AllocatVirtualRegType foo, get machine
        reg from foo" pattern.

        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::fprAllocate):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::convertToDouble):
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946
2013-03-18  Filip Pizlo  <fpizlo@apple.com>

        DFG should inline binary string concatenations (i.e. ValueAdd with string children)
        https://bugs.webkit.org/show_bug.cgi?id=112599

        Reviewed by Oliver Hunt.
        
        This does as advertised: if you do x + y where x and y are strings, you'll get
        a fast inlined JSRopeString allocation (along with whatever checks are necessary).
        It also does good things if either x or y (or both) are StringObjects, or some
        other thing like StringOrStringObject. It also lays the groundwork for making this
        fast if either x or y are numbers, or some other reasonably-cheap-to-convert
        value.

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::executeEffects):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (FixupPhase):
        (JSC::DFG::FixupPhase::isStringObjectUse):
        (JSC::DFG::FixupPhase::convertStringAddUse):
        (JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
        * dfg/DFGOperations.cpp:
        * dfg/DFGOperations.h:
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileAdd):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::callOperation):
        (SpeculativeJIT):
        (JSC::DFG::SpeculativeJIT::emitAllocateJSCell):
        (JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
        * runtime/JSString.h:
        (JSC::JSString::offsetOfFlags):
        (JSString):
        (JSRopeString):
        (JSC::JSRopeString::offsetOfFibers):

947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962
2013-03-18  Filip Pizlo  <fpizlo@apple.com>

        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
        https://bugs.webkit.org/show_bug.cgi?id=112639

        Reviewed by Michael Saboff.
        
        Change it to take a string instead.

        * runtime/JSObject.h:
        (JSC):
        * runtime/ObjectPrototype.cpp:
        (JSC::ObjectPrototype::finishCreation):
        * runtime/StringPrototype.cpp:
        (JSC::StringPrototype::finishCreation):

963 964 965 966 967 968 969 970 971 972 973 974 975 976
2013-03-18  Brent Fulgham  <bfulgham@webkit.org>

        [WinCairo] Get build working under VS2010.
        https://bugs.webkit.org/show_bug.cgi?id=112604

        Reviewed by Tim Horton.

        * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Use CFLite-specific
        build target (standard version links against CoreFoundation.lib
        instead of CFLite.lib).
        * JavaScriptCore.vcxproj/testapi/testapiCommonCFLite.props: Added.
        * JavaScriptCore.vcxproj/testapi/testapiDebugCFLite.props: Added.
        * JavaScriptCore.vcxproj/testapi/testapiReleaseCFLite.props: Added.

977 978 979 980 981 982
2013-03-18  Roger Fong  <roger_fong@apple.com>

        AppleWin VS2010 Debug configuration build fix..

        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:

983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009
2013-03-18  Brent Fulgham  <bfulgham@webkit.org>

        [WinCairo] Get build working under VS2010.
        https://bugs.webkit.org/show_bug.cgi?id=112604

        Reviewed by Tim Horton.

        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Add build targets for
        Debug_WinCairo and Release_WinCairo using CFLite.
        * JavaScriptCore.vcxproj/JavaScriptCoreCFLite.props: Added.
        * JavaScriptCore.vcxproj/JavaScriptCoreDebugCFLite.props: Added.
        * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj:
        Add Debug_WinCairo and Release_WinCairo build targets to
        make sure headers are copied to proper build folder.
        * JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj: Ditto.
        * JavaScriptCore.vcxproj/JavaScriptCoreReleaseCFLite.props: Added.
        * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj:
        Add Debug_WinCairo and Release_WinCairo build targets to
        make sure headers are copied to proper build folder.
        * JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj:
        Ditto.
        * JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcxproj:
        Ditto.
        * JavaScriptCore.vcxproj/jsc/jsc.vcxproj: Ditto.
        * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj: Ditto.
        * JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Ditto.

1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027
2013-03-18  Michael Saboff  <msaboff@apple.com>

        Potentially unsafe register allocations in DFG code generation
        https://bugs.webkit.org/show_bug.cgi?id=112477

        Reviewed by Geoffrey Garen.

        Moved allocation of temporary GPRs to be before any generated branches in the functions below.

        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
        (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
        (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
        (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
        (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):

1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
2013-03-15  Filip Pizlo  <fpizlo@apple.com>

        DFG string conversions and allocations should be inlined
        https://bugs.webkit.org/show_bug.cgi?id=112376

        Reviewed by Geoffrey Garen.
        
        This turns new String(), String(), String.prototype.valueOf(), and
        String.prototype.toString() into intrinsics. It gives the DFG the ability to handle
        conversions from StringObject to JSString and vice-versa, and also gives it the
        ability to handle cases where a variable may be either a StringObject or a JSString.
        To do this, I added StringObject to value profiling (and removed the stale
        distinction between Myarguments and Foreignarguments). I also cleaned up ToPrimitive
        handling, using some of the new functionality but also taking advantage of the
        existence of Identity(String:@a).
        
        This is a 2% SunSpider speed-up. Also there are some speed-ups on V8v7 and Kraken.
        On microbenchmarks that stress new String() this is a 14x speed-up.

        * CMakeLists.txt:
        * DerivedSources.make:
        * DerivedSources.pri:
        * GNUmakefile.list.am:
        * bytecode/CodeBlock.h:
        (CodeBlock):
        (JSC::CodeBlock::hasExitSite):
        (JSC):
        * bytecode/DFGExitProfile.cpp:
        (JSC::DFG::ExitProfile::hasExitSite):
        (DFG):
        * bytecode/DFGExitProfile.h:
        (ExitProfile):
        (JSC::DFG::ExitProfile::hasExitSite):
        * bytecode/ExitKind.cpp:
        (JSC::exitKindToString):
        * bytecode/ExitKind.h:
        * bytecode/SpeculatedType.cpp:
        (JSC::dumpSpeculation):
        (JSC::speculationToAbbreviatedString):
        (JSC::speculationFromClassInfo):
        * bytecode/SpeculatedType.h:
        (JSC):
        (JSC::isStringObjectSpeculation):
        (JSC::isStringOrStringObjectSpeculation):
        * create_hash_table:
        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::executeEffects):
        * dfg/DFGAbstractState.h:
        (JSC::DFG::AbstractState::filterEdgeByUse):
        * dfg/DFGByteCodeParser.cpp:
        (ByteCodeParser):
        (JSC::DFG::ByteCodeParser::handleCall):
        (JSC::DFG::ByteCodeParser::emitArgumentPhantoms):
        (DFG):
        (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
        * dfg/DFGCSEPhase.cpp:
        (JSC::DFG::CSEPhase::putStructureStoreElimination):
        * dfg/DFGEdge.h:
        (JSC::DFG::Edge::shift):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (JSC::DFG::FixupPhase::isStringPrototypeMethodSane):
        (FixupPhase):
        (JSC::DFG::FixupPhase::canOptimizeStringObjectAccess):
        (JSC::DFG::FixupPhase::observeUseKindOnNode):
        * dfg/DFGGraph.h:
        (JSC::DFG::Graph::hasGlobalExitSite):
        (Graph):
        (JSC::DFG::Graph::hasExitSite):
        (JSC::DFG::Graph::clobbersWorld):
        * dfg/DFGNode.h:
        (JSC::DFG::Node::convertToToString):
        (Node):
        (JSC::DFG::Node::hasStructure):
        (JSC::DFG::Node::shouldSpeculateStringObject):
        (JSC::DFG::Node::shouldSpeculateStringOrStringObject):
        * dfg/DFGNodeType.h:
        (DFG):
        * dfg/DFGOperations.cpp:
        * dfg/DFGOperations.h:
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileToStringOnCell):
        (DFG):
        (JSC::DFG::SpeculativeJIT::compileNewStringObject):
        (JSC::DFG::SpeculativeJIT::speculateObject):
        (JSC::DFG::SpeculativeJIT::speculateObjectOrOther):
        (JSC::DFG::SpeculativeJIT::speculateString):
        (JSC::DFG::SpeculativeJIT::speculateStringObject):
        (JSC::DFG::SpeculativeJIT::speculateStringOrStringObject):
        (JSC::DFG::SpeculativeJIT::speculate):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::callOperation):
        (SpeculativeJIT):
        (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
        (DFG):
        (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGUseKind.cpp:
        (WTF::printInternal):
        * dfg/DFGUseKind.h:
        (JSC::DFG::typeFilterFor):
        * interpreter/CallFrame.h:
        (JSC::ExecState::regExpPrototypeTable):
        * runtime/CommonIdentifiers.h:
        * runtime/Intrinsic.h:
        * runtime/JSDestructibleObject.h:
        (JSDestructibleObject):
        (JSC::JSDestructibleObject::classInfoOffset):
        * runtime/JSGlobalData.cpp:
        (JSC):
        (JSC::JSGlobalData::JSGlobalData):
        (JSC::JSGlobalData::~JSGlobalData):
        * runtime/JSGlobalData.h:
        (JSGlobalData):
        * runtime/JSObject.cpp:
        * runtime/JSObject.h:
        (JSC):
        * runtime/JSWrapperObject.h:
        (JSC::JSWrapperObject::allocationSize):
        (JSWrapperObject):
        (JSC::JSWrapperObject::internalValueOffset):
        (JSC::JSWrapperObject::internalValueCellOffset):
        * runtime/StringPrototype.cpp:
        (JSC):
        (JSC::StringPrototype::finishCreation):
        (JSC::StringPrototype::create):
        * runtime/StringPrototype.h:
        (StringPrototype):

1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201
2013-03-18  Filip Pizlo  <fpizlo@apple.com>

        ObjectPrototype properties should be eagerly created rather than lazily via static tables
        https://bugs.webkit.org/show_bug.cgi?id=112539

        Reviewed by Oliver Hunt.
        
        This is the first part of https://bugs.webkit.org/show_bug.cgi?id=112233. Rolling this
        in first since it's the less-likely-to-be-broken part.

        * CMakeLists.txt:
        * DerivedSources.make:
        * DerivedSources.pri:
        * GNUmakefile.list.am:
        * interpreter/CallFrame.h:
        (JSC::ExecState::objectConstructorTable):
        * runtime/CommonIdentifiers.h:
        * runtime/JSGlobalData.cpp:
        (JSC):
        (JSC::JSGlobalData::JSGlobalData):
        (JSC::JSGlobalData::~JSGlobalData):
        * runtime/JSGlobalData.h:
        (JSGlobalData):
        * runtime/JSObject.cpp:
        (JSC::JSObject::putDirectNativeFunction):
        (JSC):
        * runtime/JSObject.h:
        (JSObject):
        (JSC):
        * runtime/Lookup.cpp:
        (JSC::setUpStaticFunctionSlot):
        * runtime/ObjectPrototype.cpp:
        (JSC):
        (JSC::ObjectPrototype::finishCreation):
        (JSC::ObjectPrototype::create):
        * runtime/ObjectPrototype.h:
        (ObjectPrototype):

1202 1203 1204 1205 1206 1207 1208 1209 1210
2013-03-16  Pratik Solanki  <psolanki@apple.com>

        Disable High DPI Canvas on iOS
        https://bugs.webkit.org/show_bug.cgi?id=112511

        Reviewed by Joseph Pecoraro.

        * Configurations/FeatureDefines.xcconfig:

1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
2013-03-15  Andreas Kling  <akling@apple.com>

        Don't also clone StructureRareData when cloning Structure.
        <http://webkit.org/b/111672>

        Reviewed by Mark Hahnenberg.

        We were cloning a lot of StructureRareData with only the previousID pointer set since
        the enumerationCache is not shared between clones.

        Let the Structure copy constructor decide whether it wants to clone the rare data.
        The decision is made by StructureRareData::needsCloning() and will currently always
        return false, since StructureRareData only holds on to caches at present.
        This may change in the future as more members are added to StructureRareData.

        * runtime/Structure.cpp:
        (JSC::Structure::Structure):
        (JSC::Structure::cloneRareDataFrom):
        * runtime/StructureInlines.h:
        (JSC::Structure::create):

mhahnenberg@apple.com's avatar
mhahnenberg@apple.com committed
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285
2013-03-15  Mark Hahnenberg  <mhahnenberg@apple.com>

        Roll out r145838
        https://bugs.webkit.org/show_bug.cgi?id=112458

        Unreviewed. Requested by Filip Pizlo.

        * CMakeLists.txt:
        * DerivedSources.make:
        * DerivedSources.pri:
        * GNUmakefile.list.am:
        * dfg/DFGOperations.cpp:
        * interpreter/CallFrame.h:
        (JSC::ExecState::objectPrototypeTable):
        * jit/JITStubs.cpp:
        (JSC::getByVal):
        * llint/LLIntSlowPaths.cpp:
        (JSC::LLInt::getByVal):
        * runtime/CommonIdentifiers.h:
        * runtime/JSCell.cpp:
        (JSC):
        * runtime/JSCell.h:
        (JSCell):
        * runtime/JSCellInlines.h:
        (JSC):
        (JSC::JSCell::fastGetOwnProperty):
        * runtime/JSGlobalData.cpp:
        (JSC):
        (JSC::JSGlobalData::JSGlobalData):
        (JSC::JSGlobalData::~JSGlobalData):
        * runtime/JSGlobalData.h:
        (JSGlobalData):
        * runtime/JSObject.cpp:
        (JSC):
        * runtime/JSObject.h:
        (JSObject):
        (JSC):
        * runtime/Lookup.cpp:
        (JSC::setUpStaticFunctionSlot):
        * runtime/ObjectPrototype.cpp:
        (JSC):
        (JSC::ObjectPrototype::finishCreation):
        (JSC::ObjectPrototype::getOwnPropertySlot):
        (JSC::ObjectPrototype::getOwnPropertyDescriptor):
        * runtime/ObjectPrototype.h:
        (JSC::ObjectPrototype::create):
        (ObjectPrototype):
        * runtime/PropertyMapHashTable.h:
        (JSC::PropertyTable::findWithString):
        * runtime/Structure.h:
        (Structure):
        * runtime/StructureInlines.h:
        (JSC::Structure::get):

1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314
2013-03-15  Michael Saboff  <msaboff@apple.com>

        Cleanup of DFG and Baseline JIT debugging code
        https://bugs.webkit.org/show_bug.cgi?id=111871

        Reviewed by Geoffrey Garen.

        Fixed various debug related issue in baseline and DFG JITs. See below.

        * dfg/DFGRepatch.cpp:
        (JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
        * dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
        pointer to scratch register length.
        (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
        (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
        DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
        * jit/JITCall.cpp:
        (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
        * jit/JITCall32_64.cpp:
        (JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
        * runtime/JSGlobalData.h:
        (JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
        be on a double boundary.
        (JSC::ScratchBuffer::setActiveLength):
        (JSC::ScratchBuffer::activeLength):
        (JSC::ScratchBuffer::activeLengthPtr):

1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348
2013-03-15  Michael Saboff  <msaboff@apple.com>

        Add runtime check for improper register allocations in DFG
        https://bugs.webkit.org/show_bug.cgi?id=112380

        Reviewed by Geoffrey Garen.

        Added framework to check for register allocation within a branch source - target range.  All register allocations
        are saved using the offset in the code stream where the allocation occurred.  Later when a jump is linked, the
        currently saved register allocations are checked to make sure that they didn't occur in the range of code that was
        jumped over.  This protects against the case where an allocation could have spilled register contents to free up 
        a register and that spill only occurs on one path of a many through the code.  A subsequent fill of the spilled
        register may load garbage.  See https://bugs.webkit.org/show_bug.cgi?id=111777 for one such bug.
        This code is protected by the compile time check of #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION).
        The check is only done during the processing of SpeculativeJIT::compile(Node* node) and its callees.
 
        * assembler/AbstractMacroAssembler.h:
        (JSC::AbstractMacroAssembler::Jump::link): Invoke register allocation checks using source and target of link.
        (JSC::AbstractMacroAssembler::Jump::linkTo): Invoke register allocation checks using source and target of link.
        (AbstractMacroAssembler):
        (RegisterAllocationOffset): New helper class to store the instruction stream offset and compare against a 
        jump range.
        (JSC::AbstractMacroAssembler::RegisterAllocationOffset::RegisterAllocationOffset):
        (JSC::AbstractMacroAssembler::RegisterAllocationOffset::check):
        (JSC::AbstractMacroAssembler::addRegisterAllocationAtOffset):
        (JSC::AbstractMacroAssembler::clearRegisterAllocationOffsets): 
        (JSC::AbstractMacroAssembler::checkRegisterAllocationAgainstBranchRange):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::allocate):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360
2013-03-14  Oliver Hunt  <oliver@apple.com>

        REGRESSION(r145000): Crash loading arstechnica.com when Safari Web Inspector is open
        https://bugs.webkit.org/show_bug.cgi?id=111868

        Reviewed by Antti Koivisto.

        Don't allow non-local property lookup when the debugger is enabled.

        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::resolve):

1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406
2013-03-11  Mark Hahnenberg  <mhahnenberg@apple.com>

        Objective-C API: Objective-C functions exposed to JavaScript have the wrong type (object instead of function)
        https://bugs.webkit.org/show_bug.cgi?id=105892

        Reviewed by Geoffrey Garen.

        Changed ObjCCallbackFunction to subclass JSCallbackFunction which already has all of the machinery to call
        functions using the C API. Since ObjCCallbackFunction is now a JSCell, we changed the old implementation of
        ObjCCallbackFunction to be the internal implementation and keep track of all the proper data so that we 
        don't have to put all of that in the header, which will now be included from C++ files (e.g. JSGlobalObject.cpp).

        * API/JSCallbackFunction.cpp: Change JSCallbackFunction to allow subclassing. Originally it was internally
        passing its own Structure up the chain of constructors, but we now want to be able to pass other Structures as well.
        (JSC::JSCallbackFunction::JSCallbackFunction):
        (JSC::JSCallbackFunction::create):
        * API/JSCallbackFunction.h:
        (JSCallbackFunction):
        * API/JSWrapperMap.mm: Changed interface to tryUnwrapBlock.
        (tryUnwrapObjcObject):
        * API/ObjCCallbackFunction.h:
        (ObjCCallbackFunction): Moved into the JSC namespace, just like JSCallbackFunction.
        (JSC::ObjCCallbackFunction::createStructure): Overridden so that the correct ClassInfo gets used since we have 
        a destructor.
        (JSC::ObjCCallbackFunction::impl): Getter for the internal impl.
        * API/ObjCCallbackFunction.mm:
        (JSC::ObjCCallbackFunctionImpl::ObjCCallbackFunctionImpl): What used to be ObjCCallbackFunction is now 
        ObjCCallbackFunctionImpl. It handles the Objective-C specific parts of managing callback functions.
        (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl):
        (JSC::objCCallbackFunctionCallAsFunction): Same as the old one, but now it casts to ObjCCallbackFunction and grabs the impl 
        rather than using JSObjectGetPrivate.
        (JSC::ObjCCallbackFunction::ObjCCallbackFunction): New bits to allow being part of the JSCell hierarchy.
        (JSC::ObjCCallbackFunction::create):
        (JSC::ObjCCallbackFunction::destroy):
        (JSC::ObjCCallbackFunctionImpl::call): Handles the actual invocation, just like it used to.
        (objCCallbackFunctionForInvocation):
        (tryUnwrapBlock): Changed to check the ClassInfo for inheritance directly, rather than going through the C API call.
        * API/tests/testapi.mm: Added new test to make sure that doing Function.prototype.toString.call(f) won't result in 
        an error when f is an Objective-C method or block underneath the covers.
        * runtime/JSGlobalObject.cpp: Added new Structure for ObjCCallbackFunction.
        (JSC::JSGlobalObject::reset):
        (JSC::JSGlobalObject::visitChildren):
        * runtime/JSGlobalObject.h:
        (JSGlobalObject):
        (JSC::JSGlobalObject::objcCallbackFunctionStructure):

1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
2013-03-14  Mark Hahnenberg  <mhahnenberg@apple.com>

        Objective-C API: Nested dictionaries are not converted properly in the Objective-C binding
        https://bugs.webkit.org/show_bug.cgi?id=112377

        Reviewed by Oliver Hunt.

        Accidental reassignment of the root task in the container conversion logic was causing the last 
        array or dictionary processed to be returned in the case of nested containers.

        * API/JSValue.mm:
        (containerValueToObject):
        * API/tests/testapi.mm:

1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488
2013-03-13  Filip Pizlo  <fpizlo@apple.com>

        JSObject fast by-string access optimizations should work even on the prototype chain, and even when the result is undefined
        https://bugs.webkit.org/show_bug.cgi?id=112233

        Reviewed by Oliver Hunt.
        
        Extended the existing fast access path for String keys to work over the entire prototype chain,
        not just the self access case. This will fail as soon as it sees an object that intercepts
        getOwnPropertySlot, so this patch also ensures that ObjectPrototype does not fall into that
        category. This is accomplished by making ObjectPrototype eagerly reify all of its properties.
        This is safe for ObjectPrototype because it's so common and we expect all of its properties to
        be reified for any interesting programs anyway. A new idiom for adding native functions to
        prototypes is introduced, which ought to work well for any other prototypes that we wish to do
        this conversion for.
        
        This is a >60% speed-up in the case that you frequently do by-string lookups that "miss", i.e.
        they don't turn up anything.

        * CMakeLists.txt:
        * DerivedSources.make:
        * DerivedSources.pri:
        * GNUmakefile.list.am:
        * dfg/DFGOperations.cpp:
        * interpreter/CallFrame.h:
        (JSC::ExecState::objectConstructorTable):
        * jit/JITStubs.cpp:
        (JSC::getByVal):
        * llint/LLIntSlowPaths.cpp:
        (JSC::LLInt::getByVal):
        * runtime/CommonIdentifiers.h:
        * runtime/JSCell.cpp:
        (JSC::JSCell::getByStringSlow):
        (JSC):
        * runtime/JSCell.h:
        (JSCell):
        * runtime/JSCellInlines.h:
        (JSC):
        (JSC::JSCell::getByStringAndKey):
        (JSC::JSCell::getByString):
        * runtime/JSGlobalData.cpp:
        (JSC):
        (JSC::JSGlobalData::JSGlobalData):
        (JSC::JSGlobalData::~JSGlobalData):
        * runtime/JSGlobalData.h:
        (JSGlobalData):
        * runtime/JSObject.cpp:
        (JSC::JSObject::putDirectNativeFunction):
        (JSC):
        * runtime/JSObject.h:
        (JSObject):
        (JSC):
        * runtime/Lookup.cpp:
        (JSC::setUpStaticFunctionSlot):
        * runtime/ObjectPrototype.cpp:
        (JSC):
        (JSC::ObjectPrototype::finishCreation):
        (JSC::ObjectPrototype::create):
        * runtime/ObjectPrototype.h:
        (ObjectPrototype):
        * runtime/PropertyMapHashTable.h:
        (JSC::PropertyTable::findWithString):
        * runtime/Structure.h:
        (Structure):
        * runtime/StructureInlines.h:
        (JSC::Structure::get):
        (JSC):

1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502
2013-03-13  Filip Pizlo  <fpizlo@apple.com>

        DFG bytecode parser is too aggressive about getting rid of GetLocals on captured variables
        https://bugs.webkit.org/show_bug.cgi?id=112287
        <rdar://problem/13342340>

        Reviewed by Oliver Hunt.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::dumpBytecode):
        (JSC::CodeBlock::finalizeUnconditionally):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::getLocal):

1503 1504 1505 1506 1507 1508 1509 1510 1511
2013-03-13  Ryosuke Niwa  <rniwa@webkit.org>

        Threaded HTML Parser is missing feature define flags in all but Chromium port's build files
        https://bugs.webkit.org/show_bug.cgi?id=112277

        Reviewed by Adam Barth.

        * Configurations/FeatureDefines.xcconfig:

1512 1513 1514 1515 1516 1517 1518 1519 1520 1521
2013-03-13  Csaba Osztrogonác  <ossy@webkit.org>

        LLINT C loop warning fix for GCC
        https://bugs.webkit.org/show_bug.cgi?id=112145

        Reviewed by Filip Pizlo.

        * llint/LowLevelInterpreter.cpp:
        (JSC::CLoop::execute):

1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540
2013-02-13  Simon Hausmann  <simon.hausmann@digia.com>

        Add support for convenient conversion from JSStringRef to QString
        https://bugs.webkit.org/show_bug.cgi?id=109694

        Reviewed by Allan Sandfeld Jensen.

        Add JSStringCopyQString helper function that allows for the convenient
        extraction of a QString out of a JSStringRef.

        * API/JSStringRefQt.cpp: Added.
        (JSStringCopyQString):
        * API/JSStringRefQt.h: Added.
        * API/OpaqueJSString.h:
        (OpaqueJSString):
        (OpaqueJSString::qString):
        (OpaqueJSString::OpaqueJSString):
        * Target.pri:

1541 1542 1543 1544 1545 1546 1547 1548 1549
2013-03-13  Peter Gal  <galpeter@inf.u-szeged.hu>

        Token 'not' is ignored in the offlineasm.
        https://bugs.webkit.org/show_bug.cgi?id=111568

        Reviewed by Filip Pizlo.

        * offlineasm/parser.rb: Build the Not AST node if the 'not' token is found.

1550 1551 1552 1553 1554 1555 1556
2013-03-12  Tim Horton  <timothy_horton@apple.com>

        WTF uses macros for exports. Try to fix the Windows build. Unreviewed.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
        * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:

1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575
2013-03-12  Filip Pizlo  <fpizlo@apple.com>

        Array.prototype.sort should at least try to be PTIME even when the array is in some bizarre mode
        https://bugs.webkit.org/show_bug.cgi?id=112187
        <rdar://problem/13393550>

        Reviewed by Michael Saboff and Gavin Barraclough.
        
        If we have an array-like object in crazy mode passed into Array.prototype.sort, and its length is large,
        then first copy all elements into a separate, compact, un-holy array and sort that. Then copy back.
        This means that sorting will be at worst O(n^2) in the actual number of things in the array, rather than
        O(n^2) in the array's length.

        * runtime/ArrayPrototype.cpp:
        (JSC::attemptFastSort):
        (JSC::performSlowSort):
        (JSC):
        (JSC::arrayProtoFuncSort):

1576 1577 1578 1579 1580 1581 1582 1583
2013-03-12  Tim Horton  <timothy_horton@apple.com>

        Try to fix the Windows build.

        Not reviewed.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:

1584 1585 1586 1587 1588 1589 1590 1591 1592
2013-03-12  Geoffrey Garen  <ggaren@apple.com>

        Try to fix the Windows build.

        Not reviewed.

        * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
        Export a thing.

oliver@apple.com's avatar
oliver@apple.com committed
1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609
2013-03-11  Oliver Hunt  <oliver@apple.com>

        Harden JSStringJoiner
        https://bugs.webkit.org/show_bug.cgi?id=112093

        Reviewed by Filip Pizlo.

        Harden JSStringJoiner, make it use our CheckedArithmetic
        class to simplify everything.

        * runtime/JSStringJoiner.cpp:
        (JSC::JSStringJoiner::build):
        * runtime/JSStringJoiner.h:
        (JSStringJoiner):
        (JSC::JSStringJoiner::JSStringJoiner):
        (JSC::JSStringJoiner::append):

1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624
2013-03-12  Filip Pizlo  <fpizlo@apple.com>

        DFG generic array access cases should not be guarded by CheckStructure even of the profiling tells us that it could be
        https://bugs.webkit.org/show_bug.cgi?id=112183

        Reviewed by Oliver Hunt.
        
        Slight speed-up on string-unpack-code.

        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::findAndRemoveUnnecessaryStructureCheck):
        (FixupPhase):
        (JSC::DFG::FixupPhase::checkArray):
        (JSC::DFG::FixupPhase::blessArrayOperation):

1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638
2013-03-12  Gabor Rapcsanyi  <rgabor@webkit.org>

        https://bugs.webkit.org/show_bug.cgi?id=112141
        LLInt CLoop backend misses Double2Ints() on 32bit architectures

        Reviewed by Filip Pizlo.

        Implement Double2Ints() in CLoop backend of LLInt on 32bit architectures.

        * llint/LowLevelInterpreter.cpp:
        (LLInt):
        (JSC::LLInt::Double2Ints):
        * offlineasm/cloop.rb:

1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657
2013-03-12  Gabor Rapcsanyi  <rgabor@webkit.org>

        Making more sophisticated cache flush on ARM Linux platform
        https://bugs.webkit.org/show_bug.cgi?id=111854

        Reviewed by Zoltan Herczeg.

        The cache flush on ARM Linux invalidates whole pages
        instead of just the required area.

        * assembler/ARMAssembler.h:
        (ARMAssembler):
        (JSC::ARMAssembler::linuxPageFlush):
        (JSC::ARMAssembler::cacheFlush):
        * assembler/ARMv7Assembler.h:
        (ARMv7Assembler):
        (JSC::ARMv7Assembler::linuxPageFlush):
        (JSC::ARMv7Assembler::cacheFlush):

1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676
2013-03-12  Gabor Rapcsanyi  <rgabor@webkit.org>

        Renaming the armv7.rb LLINT backend to arm.rb
        https://bugs.webkit.org/show_bug.cgi?id=110565

        Reviewed by Zoltan Herczeg.

        This is the first step of a unified ARM backend for
        all ARM 32 bit architectures in LLInt.

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * JavaScriptCore.gypi:
        * LLIntOffsetsExtractor.pro:
        * offlineasm/arm.rb: Copied from Source/JavaScriptCore/offlineasm/armv7.rb.
        * offlineasm/armv7.rb: Removed.
        * offlineasm/backends.rb:
        * offlineasm/risc.rb:

1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692
2013-03-12  Csaba Osztrogonác  <ossy@webkit.org>

        REGRESSION(r145482): It broke 33 jsc tests and zillion layout tests on all platform
        https://bugs.webkit.org/show_bug.cgi?id=112112

        Reviewed by Oliver Hunt.

        Rolling out https://trac.webkit.org/changeset/145482 to unbreak the bots.

        * runtime/JSStringJoiner.cpp:
        (JSC::JSStringJoiner::build):
        * runtime/JSStringJoiner.h:
        (JSStringJoiner):
        (JSC::JSStringJoiner::JSStringJoiner):
        (JSC::JSStringJoiner::append):

1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710
2013-03-12  Filip Pizlo  <fpizlo@apple.com>

        DFG prediction propagation phase should not rerun forward propagation if double voting has already converged
        https://bugs.webkit.org/show_bug.cgi?id=111920

        Reviewed by Oliver Hunt.
        
        I don't know why we weren't exiting early after double voting if !m_changed.
        
        This change also removes backwards propagation from the voting fixpoint, since at that
        point short-circuiting loops is probably not particularly profitable. Profiling shows
        that this reduces the time spent in prediction propagation even further.
        
        This change appears to be a 1% SunSpider speed-up.

        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::run):

1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791
2013-03-11  Filip Pizlo  <fpizlo@apple.com>

        DFG overflow check elimination is too smart for its own good
        https://bugs.webkit.org/show_bug.cgi?id=111832

        Reviewed by Oliver Hunt and Gavin Barraclough.
        
        Rolling this back in after fixing accidental misuse of JSValue. The code was doing value < someInt
        rather than value.asInt32() < someInt. This "worked" when isWithinPowerOfTwo wasn't templatized.
        It worked by always being false and always disabling the relvant optimization.
        
        This improves overflow check elimination in three ways:
        
        1) It reduces the amount of time the compiler will spend doing it.
        
        2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
           over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
           are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
           that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
           @b->children are int32's and that hence @b might produce a large enough result that doubles would
           start chopping low bits. The specific implication of this is that for a binary operation to not
           propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
           of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
           operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
           latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
           large won't even make it into the DFG currently.
        
        3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
           are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
           NodeUsedAsNumber to either @a or @b.
        
        This is neutral on V8v7 and a slight speed-up on compile time benchmarks.

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * Target.pri:
        * dfg/DFGArrayMode.cpp:
        (JSC::DFG::ArrayMode::refine):
        * dfg/DFGBackwardsPropagationPhase.cpp: Added.
        (DFG):
        (BackwardsPropagationPhase):
        (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
        (JSC::DFG::BackwardsPropagationPhase::run):
        (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
        (JSC::DFG::BackwardsPropagationPhase::isNotZero):
        (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
        (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
        (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
        (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
        (JSC::DFG::BackwardsPropagationPhase::propagate):
        (JSC::DFG::performBackwardsPropagation):
        * dfg/DFGBackwardsPropagationPhase.h: Added.
        (DFG):
        * dfg/DFGCPSRethreadingPhase.cpp:
        (JSC::DFG::CPSRethreadingPhase::run):
        (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
        (CPSRethreadingPhase):
        (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
        (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
        * dfg/DFGDriver.cpp:
        (JSC::DFG::compile):
        * dfg/DFGGraph.cpp:
        (JSC::DFG::Graph::dump):
        * dfg/DFGNodeFlags.cpp:
        (JSC::DFG::dumpNodeFlags):
        (DFG):
        * dfg/DFGNodeFlags.h:
        (DFG):
        * dfg/DFGPredictionPropagationPhase.cpp:
        (PredictionPropagationPhase):
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGUnificationPhase.cpp:
        (JSC::DFG::UnificationPhase::run):
        * dfg/DFGVariableAccessData.h:
        (JSC::DFG::VariableAccessData::VariableAccessData):
        (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
        (VariableAccessData):
        (JSC::DFG::VariableAccessData::setIsLoadedFrom):
        (JSC::DFG::VariableAccessData::isLoadedFrom):

oliver@apple.com's avatar
oliver@apple.com committed
1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808
2013-03-11  Oliver Hunt  <oliver@apple.com>

        Harden JSStringJoiner
        https://bugs.webkit.org/show_bug.cgi?id=112093

        Reviewed by Filip Pizlo.

        Harden JSStringJoiner, make it use our CheckedArithmetic
        class to simplify everything.

        * runtime/JSStringJoiner.cpp:
        (JSC::JSStringJoiner::build):
        * runtime/JSStringJoiner.h:
        (JSStringJoiner):
        (JSC::JSStringJoiner::JSStringJoiner):
        (JSC::JSStringJoiner::append):

1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820
2013-03-11  Michael Saboff  <msaboff@apple.com>

        Crash beneath operationCreateInlinedArguments running fast/js/dfg-create-inlined-arguments-in-closure-inline.html (32-bit only)
        https://bugs.webkit.org/show_bug.cgi?id=112067

        Reviewed by Geoffrey Garen.

        We weren't setting the tag in SetCallee.  Therefore set it to CellTag.

        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853
2013-03-11  Oliver Hunt  <oliver@apple.com>

        Make SegmentedVector Noncopyable
        https://bugs.webkit.org/show_bug.cgi?id=112059

        Reviewed by Geoffrey Garen.

        Copying a SegmentedVector is very expensive, and really shouldn't
        be necessary.  So I've taken the one place where we currently copy
        and replaced it with a regular Vector, and replaced the address
        dependent logic with a indexing ref instead.

        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::newLabelScope):
        (JSC::BytecodeGenerator::emitComplexJumpScopes):
        * bytecompiler/BytecodeGenerator.h:
        (BytecodeGenerator):
        * bytecompiler/LabelScope.h:
        (JSC):
        (JSC::LabelScopePtr::LabelScopePtr):
        (LabelScopePtr):
        (JSC::LabelScopePtr::operator=):
        (JSC::LabelScopePtr::~LabelScopePtr):
        (JSC::LabelScopePtr::operator*):
        (JSC::LabelScopePtr::operator->):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::DoWhileNode::emitBytecode):
        (JSC::WhileNode::emitBytecode):
        (JSC::ForNode::emitBytecode):
        (JSC::ForInNode::emitBytecode):
        (JSC::SwitchNode::emitBytecode):
        (JSC::LabelNode::emitBytecode):

1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869
2013-03-10  Andreas Kling  <akling@apple.com>

        SpeculativeJIT should use OwnPtr<SlowPathGenerator>.
        <http://webkit.org/b/111942>

        Reviewed by Anders Carlsson.

        There's no need to include DFGSlowPathGenerator.h from the header as long as the destructor is out-of-line,
        so let's use OwnPtr instead of raw pointers + deleteAllValues().

        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::~SpeculativeJIT):
        (JSC::DFG::SpeculativeJIT::addSlowPathGenerator):
        * dfg/DFGSpeculativeJIT.h:
        (SpeculativeJIT):

1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917
2013-03-09  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r145299.
        http://trac.webkit.org/changeset/145299
        https://bugs.webkit.org/show_bug.cgi?id=111928

        compilation failure with recent clang
        (DFGBackwardsPropagationPhase.cpp:132:35: error: comparison of
        constant 10 with expression of type 'bool' is always false)
        (Requested by thorton on #webkit).

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * Target.pri:
        * dfg/DFGArrayMode.cpp:
        (JSC::DFG::ArrayMode::refine):
        * dfg/DFGBackwardsPropagationPhase.cpp: Removed.
        * dfg/DFGBackwardsPropagationPhase.h: Removed.
        * dfg/DFGCPSRethreadingPhase.cpp:
        (JSC::DFG::CPSRethreadingPhase::run):
        (CPSRethreadingPhase):
        (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
        (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
        * dfg/DFGDriver.cpp:
        (JSC::DFG::compile):
        * dfg/DFGGraph.cpp:
        (JSC::DFG::Graph::dump):
        * dfg/DFGNodeFlags.cpp:
        (JSC::DFG::nodeFlagsAsString):
        (DFG):
        * dfg/DFGNodeFlags.h:
        (DFG):
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::isNotNegZero):
        (PredictionPropagationPhase):
        (JSC::DFG::PredictionPropagationPhase::isNotZero):
        (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoForConstant):
        (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwoNonRecursive):
        (JSC::DFG::PredictionPropagationPhase::isWithinPowerOfTwo):
        (JSC::DFG::PredictionPropagationPhase::propagate):
        (JSC::DFG::PredictionPropagationPhase::mergeDefaultFlags):
        * dfg/DFGUnificationPhase.cpp:
        (JSC::DFG::UnificationPhase::run):
        * dfg/DFGVariableAccessData.h:
        (JSC::DFG::VariableAccessData::VariableAccessData):
        (VariableAccessData):

1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994
2013-03-08  Filip Pizlo  <fpizlo@apple.com>

        DFG overflow check elimination is too smart for its own good
        https://bugs.webkit.org/show_bug.cgi?id=111832

        Reviewed by Oliver Hunt and Gavin Barraclough.
        
        This improves overflow check elimination in three ways:
        
        1) It reduces the amount of time the compiler will spend doing it.
        
        2) It fixes bugs where overflow check elimination was overzealous. Precisely, for a binary operation
           over @a and @b where both @a and @b will type check that their inputs (@a->children, @b->children)
           are int32's and then perform a possibly-overflowing operation, we must be careful not to assume
           that @a's non-int32 parts don't matter if at the point that @a runs we have as yet not proved that
           @b->children are int32's and that hence @b might produce a large enough result that doubles would
           start chopping low bits. The specific implication of this is that for a binary operation to not
           propagate that it cares about non-int32 parts (NodeUsedAsNumber), we must prove that at least one
           of the inputs is guaranteed to produce a result within 2^32 and that there won't be a tower of such
           operations large enough to ultimately produce a double greater than 2^52 (roughly). We achieve the
           latter by disabling this optimization for very large basic blocks. It's noteworthy that blocks that
           large won't even make it into the DFG currently.
        
        3) It makes the overflow check elimination more precise for cases where the inputs to an Add or Sub
           are the outputs of a bit-op. For example in (@a + (@b | 0)) | 0, we don't need to propagate
           NodeUsedAsNumber to either @a or @b.
        
        This is neutral on V8v7 and a slight speed-up on compile time benchmarks.

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * Target.pri:
        * dfg/DFGArrayMode.cpp:
        (JSC::DFG::ArrayMode::refine):
        * dfg/DFGBackwardsPropagationPhase.cpp: Added.
        (DFG):
        (BackwardsPropagationPhase):
        (JSC::DFG::BackwardsPropagationPhase::BackwardsPropagationPhase):
        (JSC::DFG::BackwardsPropagationPhase::run):
        (JSC::DFG::BackwardsPropagationPhase::isNotNegZero):
        (JSC::DFG::BackwardsPropagationPhase::isNotZero):
        (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoForConstant):
        (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwoNonRecursive):
        (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
        (JSC::DFG::BackwardsPropagationPhase::mergeDefaultFlags):
        (JSC::DFG::BackwardsPropagationPhase::propagate):
        (JSC::DFG::performBackwardsPropagation):
        * dfg/DFGBackwardsPropagationPhase.h: Added.
        (DFG):
        * dfg/DFGCPSRethreadingPhase.cpp:
        (JSC::DFG::CPSRethreadingPhase::run):
        (JSC::DFG::CPSRethreadingPhase::clearIsLoadedFrom):
        (CPSRethreadingPhase):
        (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
        (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
        * dfg/DFGDriver.cpp:
        (JSC::DFG::compile):
        * dfg/DFGGraph.cpp:
        (JSC::DFG::Graph::dump):
        * dfg/DFGNodeFlags.cpp:
        (JSC::DFG::dumpNodeFlags):
        (DFG):
        * dfg/DFGNodeFlags.h:
        (DFG):
        * dfg/DFGPredictionPropagationPhase.cpp:
        (PredictionPropagationPhase):
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGUnificationPhase.cpp:
        (JSC::DFG::UnificationPhase::run):
        * dfg/DFGVariableAccessData.h:
        (JSC::DFG::VariableAccessData::VariableAccessData):
        (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
        (VariableAccessData):
        (JSC::DFG::VariableAccessData::setIsLoadedFrom):
        (JSC::DFG::VariableAccessData::isLoadedFrom):

roger_fong@apple.com's avatar
roger_fong@apple.com committed
1995 1996 1997 1998 1999 2000
2013-03-08  Roger Fong  <roger_fong@apple.com>

        Makefile fixes.

        * JavaScriptCore.vcxproj/JavaScriptCore.make:

2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
2013-03-08  Gabor Rapcsanyi  <rgabor@webkit.org>

        Cache flush problem on ARMv7 JSC
        https://bugs.webkit.org/show_bug.cgi?id=111441

        Reviewed by Zoltan Herczeg.

        Not proper cache flush causing random crashes on ARMv7 Linux with V8 tests.
        The problem is similar to https://bugs.webkit.org/show_bug.cgi?id=77712.
        Change the cache fulsh mechanism similar to ARM traditinal and revert the
        temporary fix.

        * assembler/ARMv7Assembler.h:
        (JSC::ARMv7Assembler::cacheFlush):

2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041
2013-03-07  Geoffrey Garen  <ggaren@apple.com>

        REGRESSION (r143759): 40% JSBench regression, 20% Octane/closure regression, 40% Octane/jquery regression, 2% Octane regression
        https://bugs.webkit.org/show_bug.cgi?id=111797

        Reviewed by Oliver Hunt.

        The bot's testing configuration stresses the cache's starting guess
        of 1MB.

        This patch removes any starting guess, and just uses wall clock time
        to discover the initial working set size of an app, in code size.

        * runtime/CodeCache.cpp:
        (JSC::CodeCacheMap::pruneSlowCase): Update our timer as we go.

        Also fixed a bug where pruning from 0 to 0 would hang -- that case is
        a possibility now that we start with a capacity of 0.

        * runtime/CodeCache.h:
        (CodeCacheMap):
        (JSC::CodeCacheMap::CodeCacheMap):
        (JSC::CodeCacheMap::add):
        (JSC::CodeCacheMap::prune): Don't prune if we're in the middle of
        discovering the working set size of an app, in code size.

2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060
2013-03-07  Michael Saboff  <msaboff@apple.com>

        Crash when updating predictions below JSC::arrayProtoFuncForEach on tuaw.com article
        https://bugs.webkit.org/show_bug.cgi?id=111777

        Reviewed by Filip Pizlo.

        Moved register allocations to be above any generated control flow so that any
        resulting spill would be visible to all subsequently generated code.

        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
        (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
        (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
        (JSC::DFG::SpeculativeJIT::compile):

2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075
2013-03-07  Filip Pizlo  <fpizlo@apple.com>

        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
        https://bugs.webkit.org/show_bug.cgi?id=111783

        Reviewed by Mark Hahnenberg.
        
        Unreachable code is not touched by CFA and so thinks that even untyped uses are checked.
        But dead untyped uses don't need checks and hence don't need to be Phantom'd. The DCE knew
        this in findTypeCheckRoot() but not in eliminateIrrelevantPhantomChildren(), leading to a
        Phantom node that had another Phantom node as one of its kids.

        * dfg/DFGDCEPhase.cpp:
        (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):

2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112
2013-03-07  Filip Pizlo  <fpizlo@apple.com>

        The DFG fixpoint is not strictly profitable, and should be straight-lined
        https://bugs.webkit.org/show_bug.cgi?id=111764

        Reviewed by Oliver Hunt and Geoffrey Garen.
        
        The DFG previously ran optimizations to fixpoint because there exists a circular dependency:
        
        CSE depends on CFG simplification: CFG simplification merges blocks, and CSE is block-local.
        
        CFG simplification depends on CFA and constant folding: constant folding reveals branches on
        constants.
        
        CFA depends on CSE: CSE reveals must-alias relationships by proving that two operations
        always produce identical values.
        
        Arguments simplification also depends on CSE, but it ought not depend on anything else.
        
        Hence we get a cycle like: CFA -> folding -> CFG -> CSE -> CFA.
        
        Note that before we had sparse conditional CFA, we also had CFA depending on CFG. This ought
        not be the case anymore: CFG simplification should not by itself lead to better CFA results.
        
        My guess is that the weakest link in this cycle is CFG -> CSE. CSE cuts both ways: if you
        CSE too much then you increase register pressure. Hence it's not clear that you always want
        to CSE after simplifying control flow. This leads to an order of optimization as follows:
        
        CSE -> arguments -> CFA -> folding -> CFG
        
        This is a 2.5% speed-up on SunSpider, a 4% speed-up on V8Spider, a possible 0.3% slow-down
        on V8v7, nothing on Kraken, and 1.2% speed-up in the JSRegress geomean. I'll take a 2.5%
        speed-up over a 0.3% V8v7 speed-up.

        * dfg/DFGDriver.cpp:
        (JSC::DFG::compile):

2113 2114 2115 2116 2117 2118 2119
2013-03-07  Roger Fong  <roger_fong@apple.com>

        Build fix for AppleWin VS2010.

        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:

2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221
2013-03-05  Mark Hahnenberg  <mhahnenberg@apple.com>

        Objective-C API: Need a good way to reference event handlers without causing cycles
        https://bugs.webkit.org/show_bug.cgi?id=111088

        Reviewed by Geoffrey Garen.

        JSManagedValue is like a special kind of weak value. When you create a JSManagedValue, you can
        supply an Objective-C object as its "owner". As long as the Objective-C owner object remains
        alive and its wrapper remains accessible to the JSC garbage collector (e.g. by being marked by 
        the global object), the reference to the JavaScript value is strong. As soon as the Objective-C
        owner is deallocated or its wrapper becomes inaccessible to the garbage collector, the reference
        becomes weak.

        If you do not supply an owner or you use the weakValueWithValue: convenience class method, the
        returned JSManagedValue behaves as a normal weak reference.

        This new class allows clients to maintain references to JavaScript values in the Objective-C
        heap without creating reference cycles/leaking memory.

        * API/JSAPIWrapperObject.cpp: Added.
        (JSC):
        (JSC::::createStructure):
        (JSC::JSAPIWrapperObject::JSAPIWrapperObject): This is a special JSObject for the Objective-C API that knows
        for the purposes of garbage collection/marking that it wraps an opaque Objective-C object.
        (JSC::JSAPIWrapperObject::visitChildren): We add the pointer to the wrapped Objective-C object to the set of
        opaque roots so that the weak handle owner for JSManagedValues can find it later.
        * API/JSAPIWrapperObject.h: Added.
        (JSC):
        (JSAPIWrapperObject):
        (JSC::JSAPIWrapperObject::wrappedObject):
        (JSC::JSAPIWrapperObject::setWrappedObject):
        * API/JSBase.cpp:
        (JSSynchronousGarbageCollect):
        * API/JSBasePrivate.h:
        * API/JSCallbackObject.cpp:
        (JSC):
        * API/JSCallbackObject.h:
        (JSC::JSCallbackObject::destroy): Moved this to the header so that we don't get link errors with JSAPIWrapperObject.
        * API/JSContext.mm:
        (-[JSContext initWithVirtualMachine:]): We weren't adding manually allocated/initialized JSVirtualMachine objects to 
        the global cache of virtual machines. The init methods handle this now rather than contextWithGlobalContextRef, since 
        not everyone is guaranteed to use the latter.
        (-[JSContext initWithGlobalContextRef:]):
        (+[JSContext contextWithGlobalContextRef:]):
        * API/JSManagedValue.h: Added.
        * API/JSManagedValue.mm: Added.
        (JSManagedValueHandleOwner):
        (managedValueHandleOwner):
        (+[JSManagedValue weakValueWithValue:]):
        (+[JSManagedValue managedValueWithValue:owner:]):
        (-[JSManagedValue init]): We explicitly call the ARC entrypoints to initialize/get the weak owner field since we don't 
        use ARC when building our framework.
        (-[JSManagedValue initWithValue:]):
        (-[JSManagedValue initWithValue:owner:]):
        (-[JSManagedValue dealloc]):
        (-[JSManagedValue value]):
        (-[JSManagedValue weakOwner]):
        (JSManagedValueHandleOwner::isReachableFromOpaqueRoots): If the Objective-C owner is still alive (i.e. loading the weak field
        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 
        JSObject to which the JSManagedObject refers is still alive.
        * API/JSObjectRef.cpp: We have to add explicit checks for the JSAPIWrapperObject, just like the other types of JSCallbackObjects.
        (JSObjectGetPrivate):
        (JSObjectSetPrivate):
        (JSObjectGetPrivateProperty):
        (JSObjectSetPrivateProperty):
        (JSObjectDeletePrivateProperty):
        * API/JSValue.mm:
        (objectToValueWithoutCopy):
        * API/JSValueRef.cpp:
        (JSValueIsObjectOfClass):
        * API/JSVirtualMachine.mm:
        (-[JSVirtualMachine initWithContextGroupRef:]):
        (+[JSVirtualMachine virtualMachineWithContextGroupRef:]):
        * API/JSWrapperMap.mm:
        (wrapperFinalize):
        (makeWrapper): This is our own internal version of JSObjectMake which creates JSAPIWrapperObjects, the Obj-C API 
        version of JSCallbackObjects.
        (createObjectWithCustomBrand):
        (-[JSObjCClassInfo wrapperForObject:]):
        (tryUnwrapObjcObject):
        * API/JavaScriptCore.h:
        * API/tests/testapi.mm: Added new tests for the strong and weak uses of JSManagedValue in the context of an 
        onclick handler for an Objective-C object inserted into a JSContext.
        (-[TextXYZ setWeakOnclick:]):
        (-[TextXYZ setOnclick:]):
        (-[TextXYZ weakOnclick]):
        (-[TextXYZ onclick]):
        (-[TextXYZ click]):
        * CMakeLists.txt: Various build system additions.
        * GNUmakefile.list.am:
        * JavaScriptCore.gypi:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * runtime/JSGlobalObject.cpp: Added the new canonical Structure for the JSAPIWrapperObject class.
        (JSC::JSGlobalObject::reset):
        (JSC):
        (JSC::JSGlobalObject::visitChildren):
        * runtime/JSGlobalObject.h:
        (JSGlobalObject):
        (JSC::JSGlobalObject::objcWrapperObjectStructure):

2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260
2013-03-06  Filip Pizlo  <fpizlo@apple.com>

        ConvertThis should be turned into Identity based on predictions in Fixup, rather than based on proofs in ConstantFolding
        https://bugs.webkit.org/show_bug.cgi?id=111674

        Reviewed by Oliver Hunt.
        
        This gets rid of the speculated forms of ConvertThis in the backend, and has Fixup
        convert them to either Identity(Object:@child) if the child is predicted object, or
        Phantom(Other:@child) ; WeakJSConstant(global this object) if it's predicted Other.
        
        The goal of this is to ensure that the optimization fixpoint doesn't create
        Identity's, since doing so requires a rerun of CSE. So far this isn't a speed-up
        but I'm hoping this will be a step towards reducing the need to rerun the fixpoint
        so as to ultimately reduce compile times.

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::executeEffects):
        * dfg/DFGAssemblyHelpers.h:
        (AssemblyHelpers):
        * dfg/DFGConstantFoldingPhase.cpp:
        (JSC::DFG::ConstantFoldingPhase::foldConstants):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (FixupPhase):
        (JSC::DFG::FixupPhase::observeUseKindOnNode):
        (JSC::DFG::FixupPhase::setUseKindAndUnboxIfProfitable):
        * dfg/DFGGraph.h:
        (JSC::DFG::Graph::globalThisObjectFor):
        (Graph):
        * dfg/DFGNode.h:
        (Node):
        (JSC::DFG::Node::convertToIdentity):
        (JSC::DFG::Node::convertToWeakConstant):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

2261 2262 2263 2264 2265 2266 2267 2268 2269
2013-03-07  Peter Gal  <galpeter@inf.u-szeged.hu>

        Children method in LLINT AST Not class should return [@child]
        https://bugs.webkit.org/show_bug.cgi?id=90740

        Reviewed by Filip Pizlo.

        * offlineasm/ast.rb: Fixed the return value of the children method in the Not AST class.

2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370
2013-03-05  Oliver Hunt  <oliver@apple.com>

        Bring back eager resolution of function scoped variables
        https://bugs.webkit.org/show_bug.cgi?id=111497

        Reviewed by Geoffrey Garen.

        This reverts the get/put_scoped_var part of the great non-local
        variable resolution refactoring.  This still leaves all the lazy
        variable resolution logic as it's necessary for global property
        resolution, and i don't want to make the patch bigger than it
        already is.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::dumpBytecode):
        (JSC::CodeBlock::CodeBlock):
        * bytecode/CodeBlock.h:
        (CodeBlock):
        * bytecode/Opcode.h:
        (JSC):
        (JSC::padOpcodeName):
        * bytecode/UnlinkedCodeBlock.cpp:
        (JSC::generateFunctionCodeBlock):
        (JSC::UnlinkedFunctionExecutable::codeBlockFor):
        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
        * bytecode/UnlinkedCodeBlock.h:
        (JSC):
        (UnlinkedFunctionExecutable):
        (UnlinkedCodeBlock):
        (JSC::UnlinkedCodeBlock::usesGlobalObject):
        (JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
        (JSC::UnlinkedCodeBlock::globalObjectRegister):
        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::ResolveResult::checkValidity):
        (JSC::BytecodeGenerator::BytecodeGenerator):
        (JSC::BytecodeGenerator::emitLoadGlobalObject):
        (JSC):
        (JSC::BytecodeGenerator::resolve):
        (JSC::BytecodeGenerator::resolveConstDecl):
        (JSC::BytecodeGenerator::emitResolve):
        (JSC::BytecodeGenerator::emitResolveBase):
        (JSC::BytecodeGenerator::emitResolveBaseForPut):
        (JSC::BytecodeGenerator::emitResolveWithBaseForPut):
        (JSC::BytecodeGenerator::emitResolveWithThis):
        (JSC::BytecodeGenerator::emitGetStaticVar):
        (JSC::BytecodeGenerator::emitPutStaticVar):
        * bytecompiler/BytecodeGenerator.h:
        (JSC::ResolveResult::lexicalResolve):
        (JSC::ResolveResult::isStatic):
        (JSC::ResolveResult::depth):
        (JSC::ResolveResult::index):
        (ResolveResult):
        (JSC::ResolveResult::ResolveResult):
        (BytecodeGenerator):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::ResolveNode::isPure):
        (JSC::FunctionCallResolveNode::emitBytecode):
        (JSC::PostfixNode::emitResolve):
        (JSC::TypeOfResolveNode::emitBytecode):
        (JSC::PrefixNode::emitResolve):
        (JSC::ReadModifyResolveNode::emitBytecode):
        (JSC::AssignResolveNode::emitBytecode):
        (JSC::ConstDeclNode::emitCodeSingle):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGCapabilities.cpp:
        (JSC::DFG::debugFail):
        * dfg/DFGCapabilities.h:
        (JSC::DFG::canCompileOpcode):
        (JSC::DFG::canInlineOpcode):
        * jit/JIT.cpp:
        (JSC::JIT::privateCompileMainPass):
        * jit/JIT.h:
        (JIT):
        * jit/JITPropertyAccess.cpp:
        (JSC::JIT::emit_op_get_scoped_var):
        (JSC):
        (JSC::JIT::emit_op_put_scoped_var):
        * jit/JITPropertyAccess32_64.cpp:
        (JSC::JIT::emit_op_get_scoped_var):
        (JSC):
        (JSC::JIT::emit_op_put_scoped_var):
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:
        * runtime/CodeCache.cpp:
        (JSC::CodeCache::getCodeBlock):
        (JSC::CodeCache::getProgramCodeBlock):
        (JSC::CodeCache::getEvalCodeBlock):
        * runtime/CodeCache.h:
        (JSC):
        (CodeCache):
        * runtime/Executable.cpp:
        (JSC::EvalExecutable::compileInternal):
        (JSC::FunctionExecutable::produceCodeBlockFor):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::createEvalCodeBlock):
        * runtime/JSGlobalObject.h:
        (JSGlobalObject):
        * runtime/Options.cpp:
        (JSC::Options::initialize):

2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382
2013-03-06  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed, roll out http://trac.webkit.org/changeset/144989
        
        I think we want the assertion that I removed.

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::merge):
        (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
        * dfg/DFGAbstractState.h:
        (AbstractState):

2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399
2013-03-06  Filip Pizlo  <fpizlo@apple.com>

        DFG::AbstractState::merge() is still more complicated than it needs to be
        https://bugs.webkit.org/show_bug.cgi?id=111619

        Reviewed by Mark Hahnenberg.
        
        This method is the one place where we still do some minimal amount of liveness pruning, but the style with
        which it is written is awkward, and it makes an assertion about variablesAtTail that will be invalidated
        by https://bugs.webkit.org/show_bug.cgi?id=111539.

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::merge):
        (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
        * dfg/DFGAbstractState.h:
        (AbstractState):

2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426
2013-03-06  Filip Pizlo  <fpizlo@apple.com>

        DFG should not run full CSE after the optimization fixpoint, since it really just wants store elimination
        https://bugs.webkit.org/show_bug.cgi?id=111536

        Reviewed by Oliver Hunt and Mark Hahnenberg.
        
        The fixpoint will do aggressive load elimination and pure CSE. There's no need to do it after the fixpoint.
        On the other hand, the fixpoint does not profit from doing store elimination (except for SetLocal/Flush).
        Previously we had CSE do both, and had it avoid doing some store elimination during the fixpoint by querying
        the fixpoint state. This changes CSE to be templated on mode - either NormalCSE or StoreElimination - so
        that we explicitly put it into one of those modes depending on where we call it from. The goal is to reduce
        time spent doing load elimination after the fixpoint, since that is just wasted cycles.

        * dfg/DFGCSEPhase.cpp:
        (JSC::DFG::CSEPhase::CSEPhase):
        (JSC::DFG::CSEPhase::run):
        (JSC::DFG::CSEPhase::performNodeCSE):
        (JSC::DFG::CSEPhase::performBlockCSE):
        (JSC::DFG::performCSE):
        (DFG):
        (JSC::DFG::performStoreElimination):
        * dfg/DFGCSEPhase.h:
        (DFG):
        * dfg/DFGDriver.cpp:
        (JSC::DFG::compile):

2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441
2013-03-06  Andreas Kling  <akling@apple.com>

        Pack Structure members better.
        <http://webkit.org/b/111593>
        <rdar://problem/13359200>

        Reviewed by Mark Hahnenberg.

        Shrink Structure by 8 bytes (now at 104 bytes) on 64-bit by packing the members better.

        * runtime/Structure.cpp:
        (JSC::Structure::Structure):
        * runtime/Structure.h:
        (Structure):

2442 2443 2444 2445 2446 2447
2013-03-06  Andreas Kling  <akling@apple.com>

        Unreviewed, fix Windows build after r144910.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496
2013-03-05  Filip Pizlo  <fpizlo@apple.com>

        DFG should not check if nodes are shouldGenerate prior to DCE
        https://bugs.webkit.org/show_bug.cgi?id=111520

        Reviewed by Geoffrey Garen.
        
        All nodes are live before DCE. We don't need to check that they aren't, because they
        definitely will be.

        * dfg/DFGArgumentsSimplificationPhase.cpp:
        (JSC::DFG::ArgumentsSimplificationPhase::run):
        * dfg/DFGCFAPhase.cpp:
        (JSC::DFG::CFAPhase::performBlockCFA):
        * dfg/DFGCFGSimplificationPhase.cpp:
        (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
        * dfg/DFGCSEPhase.cpp:
        (JSC::DFG::CSEPhase::pureCSE):
        (JSC::DFG::CSEPhase::int32ToDoubleCSE):
        (JSC::DFG::CSEPhase::constantCSE):
        (JSC::DFG::CSEPhase::weakConstantCSE):
        (JSC::DFG::CSEPhase::getCalleeLoadElimination):
        (JSC::DFG::CSEPhase::getArrayLengthElimination):
        (JSC::DFG::CSEPhase::globalVarLoadElimination):
        (JSC::DFG::CSEPhase::scopedVarLoadElimination):
        (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
        (JSC::DFG::CSEPhase::globalVarStoreElimination):
        (JSC::DFG::CSEPhase::scopedVarStoreElimination):
        (JSC::DFG::CSEPhase::getByValLoadElimination):
        (JSC::DFG::CSEPhase::checkStructureElimination):
        (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
        (JSC::DFG::CSEPhase::putStructureStoreElimination):
        (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
        (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
        (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
        (JSC::DFG::CSEPhase::checkArrayElimination):
        (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
        (JSC::DFG::CSEPhase::getMyScopeLoadElimination):
        (JSC::DFG::CSEPhase::getLocalLoadElimination):
        (JSC::DFG::CSEPhase::setLocalStoreElimination):
        (JSC::DFG::CSEPhase::performNodeCSE):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGStructureCheckHoistingPhase.cpp:
        (JSC::DFG::StructureCheckHoistingPhase::run):

2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509
2013-03-06  Csaba Osztrogonác  <ossy@webkit.org>

        Fix unused parameter warnings in ARM assembler
        https://bugs.webkit.org/show_bug.cgi?id=111433

        Reviewed by Kentaro Hara.

        * assembler/ARMAssembler.h: Remove unreachable revertJump() after r143346.
        * assembler/MacroAssemblerARM.h:
        (JSC::MacroAssemblerARM::moveIntsToDouble): Remove unused scratch parameter instead of UNUSED_PARAM.
        (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): Remove unused fpTemp parameter.
        (JSC::MacroAssemblerARM::revertJumpReplacementToPatchableBranchPtrWithPatch): Remove unused parameters.

2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594