ChangeLog 1.87 MB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2012-01-06  Oliver Hunt  <oliver@apple.com>

        GetByteArrayLength is incorrect
        https://bugs.webkit.org/show_bug.cgi?id=75735

        Reviewed by Filip Pizlo.

        Load the byte array length from the correct location.
        This stops an existing test from hanging.

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

fpizlo@apple.com's avatar
fpizlo@apple.com committed
16 17 18 19 20 21
2012-01-06  Filip Pizlo  <fpizlo@apple.com>

        Fix build.

        * JavaScriptCore.xcodeproj/project.pbxproj:

22 23 24 25 26 27 28 29 30 31 32 33 34
2012-01-06  Oliver Hunt  <oliver@apple.com>

        DFG no longer optimises CanvasPixelArray
        https://bugs.webkit.org/show_bug.cgi?id=75729

        Reviewed by Gavin Barraclough.

        Rename ByteArray (in its ClassInfo) to Uint8ClampedArray to match
        the future name when we switch over to the new typed-array based
        ImageData specification.

        * runtime/JSByteArray.cpp:

35 36 37 38 39 40 41 42 43 44 45 46 47
2012-01-06  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>

        Use HashMap<OwnPtr> for SourceProviderCache items
        https://bugs.webkit.org/show_bug.cgi?id=75346

        Reviewed by Daniel Bates.

        * parser/Parser.cpp:
        * parser/SourceProviderCache.cpp:
        (JSC::SourceProviderCache::clear):
        (JSC::SourceProviderCache::add):
        * parser/SourceProviderCache.h:

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
2012-01-06  Sam Weinig  <sam@webkit.org>

        Remove unused OwnFastMallocPtr class.
        https://bugs.webkit.org/show_bug.cgi?id=75722

        Reviewed by Geoffrey Garen.

        * GNUmakefile.list.am:
        * JavaScriptCore.gypi:
        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * wtf/CMakeLists.txt:
        * wtf/OwnFastMallocPtr.h: Removed.
        * wtf/text/StringImpl.h:
        * wtf/wtf.pro:

64 65 66 67 68 69 70 71 72
2012-01-06  Benjamin Poulain  <bpoulain@webkit.org>

        [Mac] Sort the resources of JavaScriptCore.xcodeproj and remove duplicates
        https://bugs.webkit.org/show_bug.cgi?id=75631

        Reviewed by Andreas Kling.

        * JavaScriptCore.xcodeproj/project.pbxproj:

73 74 75 76 77 78 79
2012-01-06  Eric Seidel  <eric@webkit.org> and Gustavo Noronha Silva  <gustavo.noronha@collabora.com>

        Make the new WTF module build on Gtk
        https://bugs.webkit.org/show_bug.cgi?id=75669

        * GNUmakefile.am:

80 81 82 83 84 85 86 87 88
2012-01-06  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>

        [Qt] Remove un-needed VPATHs from project includes

        Reviewed by Simon Hausmann.

        * JavaScriptCore.pri:
        * wtf/wtf.pri:

89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
2012-01-06  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>

        [Qt] Move listing of include paths and libs to pri files in sources

        Includepaths are sometimes modified by non-Qt contributors so keeping
        them in files inside Sources makes it more likely that they are updated
        along with project files for the other ports.

        Using pri files instead of prf files for this also has the benefit that
        the include() from the main target file can be parsed and followed by
        Qt Creator -- something that does not work with load().

        Dependency from a target to a library through the WEBKIT variable are
        handled through forwarding-files in Tools/qmake/mkspecs/modules, which
        set the source root of the module and include the right pri file.

        Ideally we'd use the variant of include() that takes an optional
        namespace to read the variables into, or the fromfile() function,
        but both of these add an overhead of about 40% on the total qmake
        runtime, due to making a deep copy of all the variables in the
        project or re-reading all the prf files from scratch.

        Reviewed by Simon Hausmann.
        Reviewed by Ossy.

        * JavaScriptCore.pri: Renamed from Tools/qmake/mkspecs/features/javascriptcore.prf.
        * Target.pri:
        * wtf/wtf.pri: Renamed from Tools/qmake/mkspecs/features/wtf.prf.
        * wtf/wtf.pro:

119 120 121 122 123 124 125 126 127 128 129 130 131 132
2012-01-06  Hajime Morrita  <morrita@chromium.org>

        WTF::String: Inline method shouldn't have WTF_EXPORT_PRIVATE
        https://bugs.webkit.org/show_bug.cgi?id=75612

        Reviewed by Kevin Ollivier.

        * wtf/text/WTFString.h:
        (WTF::String::findIgnoringCase):
        (WTF::String::append):
        (WTF::String::fromUTF8):
        (WTF::String::fromUTF8WithLatin1Fallback):
        (WTF::String::isHashTableDeletedValue):

133 134 135 136 137 138 139 140
2012-01-05  Dan Bernstein  <mitz@apple.com>

        <rdar://problem/10633760> Update copyright strings

        Reviewed by Mark Rowe.

        * Info.plist:

141 142 143 144 145 146 147 148 149 150 151
2012-01-05  Gavin Barraclough  <barraclough@apple.com>

        Date constructor handles infinite values incorrectly.
        https://bugs.webkit.org/show_bug.cgi?id=70998

        Reviewed by Filip Pizlo.

        * runtime/DateConstructor.cpp:
        (JSC::constructDate):
            - should be checking !finite rather then isnan.

152 153 154 155 156 157 158 159 160 161
2012-01-05  Gavin Barraclough  <barraclough@apple.com>

        date.toISOString produces incorrect results for dates with ms prior to 1970
        https://bugs.webkit.org/show_bug.cgi?id=75684

        Reviewed by Sam Weinig.

        * runtime/DatePrototype.cpp:
        (JSC::dateProtoFuncToISOString):

162 163 164 165 166 167 168 169 170 171 172 173 174
2012-01-05  Gavin Barraclough  <barraclough@apple.com>

        Array.prototype.lastIndexOf ignores undefined fromIndex.
        https://bugs.webkit.org/show_bug.cgi?id=75678

        Reviewed by Sam Weinig.

        array.lastIndexOf(x, undefined) is equivalent to array.lastIndexOf(x, 0), not array.lastIndexOf(x)

        * runtime/ArrayPrototype.cpp:
        (JSC::arrayProtoFuncLastIndexOf):
            - should check argumnet count, rather than checking agument value for undefined.

175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
2012-01-05  Gavin Barraclough  <barraclough@apple.com>

        Date parsing is too restrictive.
        https://bugs.webkit.org/show_bug.cgi?id=75671

        Reviewed by Oliver Hunt.

        ES5 date parsing currently requires all fields to be present, which does not match the spec (ES5.1 15.9.1.15).
        The spec allow a date to be date only, or date + time.

        The date portion on the should match: (pseudocode!:)
            [(+|-)YY]YYYY[-MM[-DD]]
        though we are slightly more liberal (permitted by the spec), allowing:
            [+|-]Y+[-MM[-DD]]
        The time portion should match:
            THH:mm[:ss[.sss]][Z|(+|-)HH:mm]
        again we're slightly more liberal, allowing:
            THH:mm[:ss[.s+]][Z|(+|-)HH:mm]

        * wtf/DateMath.cpp:
        (WTF::parseES5DatePortion):
            - Month/day fields are optional, default to 01.
        (WTF::parseES5TimePortion):
            - Hours/Minutes are requires, seconds/timezone are optional.
        (WTF::parseES5DateFromNullTerminatedCharacters):
            - Dates may be date only, or date + time.

202 203 204 205 206 207 208 209 210 211 212 213 214
2012-01-05  Bruno Dilly  <bdilly@profusion.mobi>

        [EFL] Undefined references to ICU_I18N symbols on WTF
        https://bugs.webkit.org/show_bug.cgi?id=75642

        Unreviewed build fix.

        Add ${ICU_I18N_LIBRARIES} to WTF_LIBRARIES on wtf efl platform cmake.
        Some undefined references were ucol_setAttribute_44, ucol_close_44,
        ucol_getAttribute_44...

        * wtf/PlatformEfl.cmake:

215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
2012-01-05  Geoffrey Garen  <ggaren@apple.com>

        Refined the fast path for StringImpl::hash()
        https://bugs.webkit.org/show_bug.cgi?id=75178

        Reviewed by Darin Adler.

        Moved the hash calculation code into an out-of-line function to clean up
        the hot path.

        No measurable benchmark change, but this knocks some samples off in
        Instruments, and I think this is a step toward removing -fomit-frame-pointer.
        
        * wtf/text/StringImpl.cpp:
        (WTF::StringImpl::hashSlowCase):
        * wtf/text/StringImpl.h:
        (WTF::StringImpl::hash): The patch.

        * wtf/text/StringStatics.cpp:
        (WTF::StringImpl::hashSlowCase): Abide by the cockamamie Windows build
        scheme, which requires all out-of-line StringImpl functions used by
        WebCore be defined in this file instead of StringImpl.cpp. (See http://trac.webkit.org/changeset/59187.)

238 239 240 241 242 243 244 245 246 247 248 249 250
2012-01-05  Gavin Barraclough  <barraclough@apple.com>

        Literal tab in JSONString fails
        https://bugs.webkit.org/show_bug.cgi?id=71772

        Reviewed by Oliver Hunt.

        rfc4627 does not allow literal tab characters in JSON source.

        * runtime/LiteralParser.cpp:
        (JSC::isSafeStringCharacter):
            - do not allow literal tab in StrictJSON mode.

251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
2012-01-05  Gavin Barraclough  <barraclough@apple.com>

        push/shift fifo may consume excessive memory
        https://bugs.webkit.org/show_bug.cgi?id=75610

        Reviewed by Sam Weinig.

        Array object commonly store data in a vector, consisting of a portion that is
        in use, a pre-capacity (m_indexBias) and a post-capacity (the delta between
        m_length and m_vectorLength). Calls to shift with grow the pre-capacity, and
        the current algorithm for increaseVectorLength (used by push, or [[Put]]) will
        never shrink the pre-capacity, so a push/shift fifo may consume an inordinate
        amount of memory, whilst having a relatively small active length.

        * runtime/JSArray.cpp:
        (JSC::JSArray::increaseVectorLength):
            - If m_indexBias is non-zero, decay it over time.

269 270 271 272 273 274 275 276 277 278 279 280
2012-01-05  Csaba Osztrogonác  <ossy@webkit.org>

        unshift/pop fifo may consume excessive memory
        https://bugs.webkit.org/show_bug.cgi?id=75588

        Reviewed by Zoltan Herczeg.

        Buildfix after r104120.

        * runtime/JSArray.cpp: Remove useless asserts, baecause unsigned expression >= 0 is always true
        (JSC::JSArray::unshiftCount):

281 282 283 284 285 286
2012-01-05  Zoltan Herczeg  <zherczeg@webkit.org>

        Unreviewed gardening after r104134.

        * wtf/Assertions.cpp:

287 288 289 290 291 292 293 294
2012-01-05  Zoltan Herczeg  <zherczeg@webkit.org>

        Unreviewed gardening after r75605.

        Rubber stamped by NOBODY Csaba Osztrogonác.

        * wtf/Assertions.cpp:

295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
2012-01-05  Benjamin Poulain  <benjamin@webkit.org>

        Improve charactersAreAllASCII() to compare multiple characters at a time
        https://bugs.webkit.org/show_bug.cgi?id=74063

        Reviewed by Darin Adler.

        A new header ASCIIFastPath.h contains the functions related to
        the detection of ASCII by using machine words. Part of it comes from
        WebCore's TextCodecASCIIFastPath.h.

        The function charactersAreAllASCII() is moved to TextCodecASCIIFastPath.h
        and is implemented with computer word comparison.
        The gain over the previous implementation of charactersAreAllASCII() is of
        the order of how many comparison are avoided (4x, 8x, 16x depending on the
        format and the CPU type).

        * GNUmakefile.list.am:
        * JavaScriptCore.gypi:
        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * wtf/text/ASCIIFastPath.h: Added.
        (WTF::isAlignedToMachineWord):
        (WTF::alignToMachineWord):
        (WTF::isAllASCII):
        (WTF::charactersAreAllASCII):
        * wtf/text/WTFString.h:
        * wtf/wtf.pro:

324 325 326 327 328 329 330 331 332 333 334 335
2012-01-05  Mark Rowe  <mrowe@apple.com>

        <http://webkit.org/b/75606> [Mac] WTF logging functions should output to both stderr and ASL

        We should always log to both ASL and stderr on platforms where this won't result in launchd
        duplicating the messages.

        Reviewed by Dan Bernstein.

        * wtf/Assertions.cpp:
        (vprintf_stderr_common):

336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
2012-01-05  Mark Rowe  <mrowe@apple.com>

        <http://webkit.org/b/75605> WTF logging functions should call vprintf_stderr_common only once per line

        Several of the WTF logging functions make multiple calls to vprintf_stderr_common to output a
        single line of text. This results in strangely formatted output if vprintf_stderr_common is
        retargeted to an output device that is message-oriented (such as ASL) rather than stream-oriented
        like stderr.

        Reviewed by Dan Bernstein.

        * wtf/Assertions.cpp:
        (vprintf_stderr_with_prefix): Helper function to prepend a given prefix on to the given format
        string before handing it off to vprintf_stderr_common. This requires disabling warnings about
        calling a printf-like function with a non-literal format string for this piece of code. It's
        safe in this particular case as vprintf_stderr_with_prefix is only ever given a literal prefix.
        (vprintf_stderr_with_trailing_newline): Helper function to append a trailling newline on to the
        given format string if one does not already exist. It requires the same treatment with regards
        to the non-literal format string warning.
        (WTFReportAssertionFailureWithMessage): Switch to using vprintf_stderr_with_prefix.
        (WTFReportBacktrace): Switch from calling fprintf directly to using fprintf_stderr_common.
        (WTFReportFatalError): Switch to using vprintf_stderr_with_prefix.
        (WTFReportError): Ditto.
        (WTFLog): Switch to using vprintf_stderr_with_trailing_newline.
        (WTFLogVerbose): Ditto.

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
2012-01-04  Gavin Barraclough  <barraclough@apple.com>

        unshift/pop fifo may consume excessive memory
        https://bugs.webkit.org/show_bug.cgi?id=75588

        Reviewed by Sam Weinig.

        The Array object commonly store data in a vector, consisting of a portion that
        is in use, a pre-capacity (m_indexBias) and a post-capacity (the delta between
        m_length and m_vectorLength). Calls to pop with grow the post-capacity, and the
        current algorithm for increasePrefixVectorLength (used by unshift) will never
        stink the post-capacity, so a unshift/pop fifo may consume an inordinate amount
        of memory, whilst having a relatively small active length.

        * runtime/JSArray.cpp:
        (JSC::storageSize):
            - sizeof(JSValue) should be sizeof(WriteBarrier<Unknown>)
        (JSC::SparseArrayValueMap::put):
            - sizeof(JSValue) should be sizeof(WriteBarrier<Unknown>)
        (JSC::JSArray::increaseVectorLength):
            - sizeof(JSValue) should be sizeof(WriteBarrier<Unknown>)
        (JSC::JSArray::unshiftCountSlowCase):
            - renamed from increaseVectorPrefixLength (this was a bad name, since it
              also moved the ArrayStorage header), rewritten.
        (JSC::JSArray::shiftCount):
            - sizeof(JSValue) should be sizeof(WriteBarrier<Unknown>), count should be unsigned
        (JSC::JSArray::unshiftCount):
            - sizeof(JSValue) should be sizeof(WriteBarrier<Unknown>), count should be unsigned,
              increaseVectorPrefixLength renamed to unshiftCountSlowCase
        (JSC::JSArray::sortNumeric):
        * runtime/JSArray.h:
            - Updated function declarations, m_indexBias should be unsigned.

395 396 397 398 399 400 401 402 403 404 405 406 407 408
2012-01-04  Mark Rowe  <mrowe@apple.com>

        <http://webkit.org/b/75604> All instances of JSC::ArgumentsData appear to be leaked by JSC::Arguments

        Since JSC::Arguments has an OwnPtr for a member it needs to override destroy
        to ensure that the correct destructor is invoked. This is necessary because
        JSCell subclasses all intentionally have non-virtual destructors.

        Reviewed by Filip Pizlo.

        * runtime/Arguments.cpp:
        (JSC::Arguments::destroy):
        * runtime/Arguments.h:

409 410 411 412 413 414 415
2012-01-04  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed, accidentally turned off the JIT in previous commit. Turning
        it back on.

        * wtf/Platform.h:

416 417 418 419 420 421 422 423 424 425 426
2012-01-04  Filip Pizlo  <fpizlo@apple.com>

        Changed "return" to "break" in some macrology I introduced in
        http://trac.webkit.org/changeset/104086. This is a benign change, as
        "return" was technically correct for all uses of the macro.

        Reviewed by Oliver Hunt.

        * dfg/DFGGraph.cpp:
        * wtf/Platform.h:

427 428 429 430 431 432 433 434 435 436 437 438
2012-01-04  Michael Saboff  <msaboff@apple.com>

        StructureStubInfo not reset when corresponding MethodCallLinkInfo is reset
        https://bugs.webkit.org/show_bug.cgi?id=75583

        Reviewed by Filip Pizlo.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::finalizeUnconditionally): Find the corresponding
        StructureStubInfo and reset the appropriate JIT and
        the StructureStubInfo itself when reseting a MethodCallLinkInfo.

439 440 441 442 443 444 445 446 447 448
2012-01-04  Michael Saboff  <msaboff@apple.com>

        Invalid ASSERT() in DFGRepatch.cpp near line 385
        https://bugs.webkit.org/show_bug.cgi?id=75584

        Reviewed by Filip Pizlo.

        * dfg/DFGRepatch.cpp:
        (JSC::DFG::tryBuildGetByIDProtoList): Fixed ASSERT to use ==.

449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
2012-01-04  Filip Pizlo  <fpizlo@apple.com>

        Incorrect use of DFG node reference counts when mutating the graph
        https://bugs.webkit.org/show_bug.cgi?id=75580
        <rdar://problem/10644607>

        Reviewed by Oliver Hunt.
        
        Made deref(node) follow the pattern of ref(node), which it should have
        to begin with.

        * dfg/DFGGraph.cpp:
        (JSC::DFG::Graph::refChildren):
        (JSC::DFG::Graph::derefChildren):
        * dfg/DFGGraph.h:
        (JSC::DFG::Graph::deref):
        (JSC::DFG::Graph::clearAndDerefChild1):
        (JSC::DFG::Graph::clearAndDerefChild2):
        (JSC::DFG::Graph::clearAndDerefChild3):
        * dfg/DFGNode.h:
        (JSC::DFG::Node::deref):
        * dfg/DFGPropagator.cpp:
        (JSC::DFG::Propagator::fixupNode):

473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499
2012-01-04  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>

        [Qt] Introduce new qmake variable 'WEBKIT' for signaling dependencies

        The custom qmake variable 'WEBKIT' is used for signaling that a
        target depends in some way on other subproject of the WebKit
        project. For now this is limited to the set of intermediate
        libraries: wtf, javascriptcore, webcore, and webkit2.

        This replaces the previous convension of using load(foo) for
        just include paths, and CONFIG += foo to also link against foo.

        Adding a dependency results in additional include paths being
        available, and potentially linking to the library. This is
        decided by the build system based on conditions such as what
        kind of target is being built and the general build config.

        An advantage to his approach is that it simplifies the individual
        foo.prf files, for example by allowing us to use INCLUDEPATH +=
        and LIBS += as normal instead of prepending.

        Reviewed by Simon Hausmann.

        * Target.pri:
        * jsc.pro:
        * wtf/wtf.pro:

500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
2012-01-03  Filip Pizlo  <fpizlo@apple.com>

        DFG: The assertion that a double-voted variable cannot become double-unvoted is wrong
        https://bugs.webkit.org/show_bug.cgi?id=75516
        <rdar://problem/10640266>

        Reviewed by Gavin Barraclough.
        
        Removed the offending assertion, since it was wrong.  Also hardened the code to make
        this case less likely by first having the propagator fixpoint converge, and then doing
        double voting combined with a second fixpoint.  This is neutral on benchmarks and
        fixes the assertion in a fairly low-risk way (i.e. we won't vote a variable double
        until we've converged to the conclusion that it really is double).

        * dfg/DFGPropagator.cpp:
        (JSC::DFG::Propagator::propagatePredictions):
        * dfg/DFGVariableAccessData.h:
        (JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):

519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
2012-01-03  Filip Pizlo  <fpizlo@apple.com>

        REGRESSION (r98196-98236): Incorrect layout of iGoogle with RSS feeds
        https://bugs.webkit.org/show_bug.cgi?id=75303
        <rdar://problem/10633533>

        Reviewed by Gavin Barraclough.
        
        The this argument was not being kept alive in some cases during inlining and intrinsic
        optimizations.

        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::handleCall):
        (JSC::DFG::ByteCodeParser::emitFunctionCheck):
        (JSC::DFG::ByteCodeParser::handleInlining):

barraclough@apple.com's avatar
barraclough@apple.com committed
535 536 537 538 539 540
2012-01-03  Gavin Barraclough  <barraclough@apple.com>

        Windows build fix.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

barraclough@apple.com's avatar
barraclough@apple.com committed
541 542 543 544 545 546
2012-01-03  Gavin Barraclough  <barraclough@apple.com>

        Windows build fix.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583
2012-01-03  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75140

        Reviewed by Sam Weinig.

        Rewrite JSArray::putSlowCase to be much cleaner & simpler.

        This rewrite only significantly changes behaviour for sparse array, specifically
        in how sparse arrays are reified back to vector form. This does not affect arrays
        with less than 10000 entries (since these always use a vector). The more common
        cases of sparse array behavior (though large sparse arrays are rare) - arrays that
        always remain sparse, and arrays that are filled in reverse sequential order -
        should be just as fast or faster (since reification is simpler & no longer
        requires map lookups) after these changes.

        Simplifying this code allows all cases of putByIndex that need to grow the vector
        to do so via increaseVectorLength, which means that this method can encapsulate
        the policy of determining how the vector should be grown.

        No performance impact.

        * runtime/JSArray.cpp:
        (JSC::isDenseEnoughForVector):
            - any array of length <= MIN_SPARSE_ARRAY_INDEX is dense enough for a vector.
        (JSC::JSArray::putByIndex):
            - simplify & comment.
        (JSC::JSArray::putByIndexBeyondVectorLength):
            - Re-written to be much clearer & simpler.
        (JSC::JSArray::increaseVectorLength):
        (JSC::JSArray::increaseVectorPrefixLength):
            - add explicit checks against MAX_STORAGE_VECTOR_LENGTH, so clients do not need do so.
        (JSC::JSArray::push):
            - simplify & comment.
        * runtime/JSArray.h:
            - removed SparseArrayValueMap::take.

barraclough@apple.com's avatar
barraclough@apple.com committed
584 585 586 587 588 589
2012-01-03  Gavin Barraclough  <barraclough@apple.com>

        Windows build fix.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
2012-01-03  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75140

        Reviewed by Sam Weinig.

        Simplify JSArray creation - remove ArgsList/JSValue* create methods
        (this functionality can be implemented in terms of tryCreateUninitialized).

        * JavaScriptCore.exp:
        * runtime/ArrayConstructor.cpp:
            - use constructArray/constructEmptyArray instead of calling JSArray::create directly
        (JSC::constructArrayWithSizeQuirk):
        * runtime/JSArray.cpp:
        * runtime/JSArray.h:
            - removed ArgsList/JSValue* create methods
        * runtime/JSGlobalObject.h:
        (JSC::constructEmptyArray):
        (JSC::constructArray):
            - changed to be implemented in terms of JSArray::tryCreateUninitialized

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 643 644 645 646 647 648 649 650
2012-01-03  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75429
        ThrowTypeError should be a singleton object

        Reviewed by Sam Weinig.

        Per section 13.2.3 of the spec.
        We could change setAccessorDescriptor to be able to share the global
        GetterSetter object, rather than storing the accessor functions and
        creating a new GetterSetter in defineProperty - but this won't be a
        small change to PropertyDescriptors (and would probably mean making
        GetterSetter objects immutable?) - so I'll leave that for another
        patch.

        * JavaScriptCore.exp:
            - don't export setAccessorDescriptor
        * runtime/Arguments.cpp:
        (JSC::Arguments::createStrictModeCallerIfNecessary):
        (JSC::Arguments::createStrictModeCalleeIfNecessary):
            - call throwTypeErrorGetterSetter instead of createTypeErrorFunction
        * runtime/Error.cpp:
        * runtime/Error.h:
            - remove createTypeErrorFunction
        * runtime/JSFunction.cpp:
        * runtime/JSFunction.h:
            - remove unused createDescriptorForThrowingProperty
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::reset):
        (JSC::JSGlobalObject::visitChildren):
            - removed m_strictModeTypeErrorFunctionStructure.
        * runtime/JSGlobalObject.h:
        (JSC::JSGlobalObject::internalFunctionStructure):
            - removed m_strictModeTypeErrorFunctionStructure.
        * runtime/PropertyDescriptor.cpp:
        (JSC::PropertyDescriptor::setAccessorDescriptor):
            - changed to take a GetterSetter
        * runtime/PropertyDescriptor.h:
            - changed to take a GetterSetter

651 652 653 654 655 656 657
2012-01-02  Gavin Barraclough  <barraclough@apple.com>

        Check in fixes for jsc tests following bug #75455.

        * tests/mozilla/ecma/GlobalObject/15.1.2.2-1.js:
        * tests/mozilla/ecma/GlobalObject/15.1.2.2-2.js:

658 659 660 661 662 663 664 665 666 667 668 669 670
2012-01-02  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75452
        If argument to Error is undefined, message is not set

        Reviewed by Sam Weinig.

        Per section 15.11.1.1 of the spec.

        * runtime/ErrorInstance.h:
        (JSC::ErrorInstance::create):
        (JSC::ErrorInstance::finishCreation):

671 672 673 674 675 676 677 678 679 680 681 682
2012-01-02  Gavin Barraclough  <barraclough@apple.com>

        ES5 prohibits parseInt from supporting octal
        https://bugs.webkit.org/show_bug.cgi?id=75455

        Reviewed by Sam Weinig.

        See sections 15.1.2.2 and annex E.

        * runtime/JSGlobalObjectFunctions.cpp:
        (JSC::parseInt):

683 684 685 686 687 688 689 690 691 692 693
2012-01-02  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=55343
        Global JSON should be configurable but isn't

        Reviewed by Sam Weinig.

        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::reset):
            - make JSON configurable

694 695 696 697 698 699 700 701 702 703 704 705 706
2012-01-01  Filip Pizlo  <fpizlo@apple.com>

        Call instructions should leave room for linking information
        https://bugs.webkit.org/show_bug.cgi?id=75422
        <rdar://problem/10633985>

        Reviewed by Oliver Hunt.

        * bytecode/Opcode.h:
        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::emitCall):
        (JSC::BytecodeGenerator::emitConstruct):

707 708 709 710 711 712
2011-12-31  Dan Bernstein  <mitz@apple.com>

        Continue trying to fix the Windows build after r103823.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

713 714 715 716 717 718
2011-12-31  Dan Bernstein  <mitz@apple.com>

        Start trying to fix the Windows build after r103823.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

719 720 721 722 723 724 725 726 727 728 729 730 731
2011-12-30  Anders Carlsson  <andersca@apple.com>

        Add a ParamStorageTraits specialization for RetainPtr
        https://bugs.webkit.org/show_bug.cgi?id=75392

        Reviewed by Daniel Bates.

        * wtf/Functional.h:
        Add a partial specialization of ParamStorageTraits for RetainPtr<T>.

        * wtf/RetainPtr.h:
        Bring in the retainPtr function template from WTF.

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
2011-12-29  Sam Weinig  <sam@webkit.org>

        It should be easier to iterate a Vector backwards
        https://bugs.webkit.org/show_bug.cgi?id=75359

        Reviewed by Anders Carlsson.

        Adds Vector::rbegin(), Vector::rend(), and Vector::reversed(),
        a new proxy driven way to access a vector backwards. One can use
        reversed() in a range-based for loop like so:

            for (auto val: myVector.reversed())
                doSomething(val)

        * wtf/Vector.h:
        (WTF::Vector::~Vector):
        Fix style.

        (WTF::Vector::rbegin):
        (WTF::Vector::rend):
        Added using standard adaptor std::reverse_iterator.

        (WTF::Vector::reversed):
        (WTF::Vector::VectorReverseProxy::begin):
        (WTF::Vector::VectorReverseProxy::end):
        Add proxy similar to one used in HashMap for keys() and values()
        which allows access to a Vector backwards for use in range-based
        for loops.

761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824
2011-12-29  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75140

        Reviewed by Oliver Hunt.

        Start cleaning up JSArray construction. JSArray has a set of create methods,
        one of which (currently) takes a 'creation mode' enum parameter. Based on that
        parameter, the constructor does one of two completely different things. If the
        parameter is 'CreateInitialized' it creates an array, setting the length, but
        does not eagerly allocate a storage vector of the specified length. A small
        (BASE_VECTOR_LEN sized) initial vector will be allocated, and cleared, property
        access to the vector will read the hole value (return undefined). The alternate
        usage of this method ('CreateCompact') does something very different. It tries
        to create an array of the requested length, and also allocates a storage vector
        large enough to hold all properties. It does not clear the storage vector,
        leaving the memory uninitialized and requiring the user to call a method
        'uncheckedSetIndex' to initialize values in the vector.

        This patch factors out these two behaviours, moving the 'CreateCompact' mode
        into its own method, 'tryCreateUninitialized' (matching the naming for this
        functionality in the string classes). 'tryCreateUninitialized' may return 0 if
        memory allocation fails during construction of the object. The construction
        pattern changes such that values added during initialization will be marked if
        a GC is triggered during array allocation. 'CreateInitialized' no longer need
        be passed to create a normal, fully constructed array with a length, and this
        method is merged with the version of 'create' that does not take an initial
        length (length parameter defaults to 0).

        * JavaScriptCore.exp:
        * runtime/ArrayConstructor.cpp:
        (JSC::constructArrayWithSizeQuirk):
            - removed 'CreateInitialized' argument
        * runtime/ArrayPrototype.cpp:
        (JSC::arrayProtoFuncSplice):
            - changed to call 'tryCreateUninitialized'
        * runtime/FunctionPrototype.cpp:
        (JSC::functionProtoFuncBind):
            - changed to call 'tryCreateUninitialized'
        * runtime/JSArray.cpp:
        (JSC::JSArray::JSArray):
            - initialize m_storage to null; if construction fails, make destruction safe
        (JSC::JSArray::finishCreation):
            - merge versions of this method, takes an initialLength parameter defaulting to zero
        (JSC::JSArray::tryFinishCreationUninitialized):
            - version of 'finishCreation' that tries to eagerly allocate storage; may fail & return 0
        (JSC::JSArray::~JSArray):
            - check for null m_storage, in case array construction failed.
        (JSC::JSArray::increaseVectorPrefixLength):
        * runtime/JSArray.h:
        (JSC::JSArray::create):
            - merge versions of this method, takes an initialLength parameter defaulting to zero
        (JSC::JSArray::tryCreateUninitialized):
            - version of 'create' that tries to eagerly allocate storage; may fail & return 0
        (JSC::JSArray::initializeIndex):
        (JSC::JSArray::completeInitialization):
            - used in conjunction with 'tryCreateUninitialized' to initialize the array
        * runtime/JSGlobalObject.h:
        (JSC::constructEmptyArray):
            - removed 'CreateInitialized' argument
        * runtime/RegExpConstructor.cpp:
        (JSC::RegExpMatchesArray::finishCreation):
            - removed 'CreateInitialized' argument

825 826 827 828 829 830 831 832 833 834 835 836 837
2011-12-29  Anders Carlsson  <andersca@apple.com>

        Add a retainPtr function template
        https://bugs.webkit.org/show_bug.cgi?id=75365

        Reviewed by Dan Bernstein.

        This makes it easier to make a RetainPtr using template argument deduction, which
        is useful when passing RetainPtr objects as function arguments.

        * wtf/RetainPtr.h:
        (WTF::retainPtr):

838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877
2011-12-28  Yuqiang Xian  <yuqiang.xian@intel.com>

        spill unboxed values in DFG 32_64
        https://bugs.webkit.org/show_bug.cgi?id=75291

        Reviewed by Filip Pizlo.

        Currently all the values are spilled as boxed in DFG 32_64, which is
        not necessary and introduces additional stores/loads. Instead we
        can spill them as unboxed if feasible. It can be applied to the
        Integers, Cells and Booleans in DFG 32_64. Doubles are left as is
        because they don't need to be boxed at all. The modifications to the
        spill/fill and the OSR exit are required, as well as a bug fix to the
        "isUnknownJS" logic.

        * bytecode/ValueRecovery.h:
        (JSC::ValueRecovery::displacedInRegisterFile):
        (JSC::ValueRecovery::virtualRegister):
        (JSC::ValueRecovery::dump):
        * dfg/DFGGenerationInfo.h:
        (JSC::DFG::GenerationInfo::isUnknownJS):
        (JSC::DFG::GenerationInfo::spill):
        * dfg/DFGOSRExitCompiler32_64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::isKnownNotBoolean):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::silentFillGPR):
        (JSC::DFG::SpeculativeJIT::spill):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::fillInteger):
        (JSC::DFG::SpeculativeJIT::fillDouble):
        (JSC::DFG::SpeculativeJIT::fillJSValue):
        (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
        (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
        (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
        (JSC::DFG::SpeculativeJIT::compileObjectEquality):
        (JSC::DFG::SpeculativeJIT::compile):

878 879 880 881 882 883 884 885 886 887 888 889 890 891
2011-12-28  Anders Carlsson  <andersca@apple.com>

        Add an implicit block conversion operator to WTF::Function
        https://bugs.webkit.org/show_bug.cgi?id=75325

        Reviewed by Dan Bernstein.

        * wtf/Compiler.h:
        Add a define for COMPILER_SUPPORTS(BLOCKS). It's only defined for clang, since the gcc blocks implementation
        is buggy, especially when it comes to C++.

        * wtf/Functional.h:
        Add a block conversion operator that creates and returns an autoreleased block that will call the function when executed.

892 893 894 895 896 897 898 899 900
2011-12-27  Anders Carlsson  <andersca@apple.com>

        Add a new WTF::bind overload that takes 6 parameters
        https://bugs.webkit.org/show_bug.cgi?id=75287

        Reviewed by Sam Weinig.

        * wtf/Functional.h:

901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921
2011-12-27  Sam Weinig  <sam@webkit.org>

        Continue moving compiler feature checks to use the COMPILER_SUPPORTS() macro
        https://bugs.webkit.org/show_bug.cgi?id=75268

        Reviewed by Anders Carlsson.

        * wtf/Compiler.h:
        Add support for COMPILER_SUPPORTS(CXX_NULLPTR) and COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS).

        * wtf/Noncopyable.h:
        Use COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS).

        * wtf/NullPtr.cpp:
        * wtf/NullPtr.h:
        Use COMPILER_SUPPORTS(CXX_NULLPTR). Remove support for HAVE(NULLPTR).

        * wtf/RefPtr.h:
        * wtf/RetainPtr.h:
        Switch from HAVE(NULLPTR) to COMPILER_SUPPORTS(CXX_NULLPTR).

922 923 924 925 926 927 928 929 930 931 932 933 934 935
2011-12-27  Anders Carlsson  <andersca@apple.com>

        Misc fixes and cleanups in Functional.h
        https://bugs.webkit.org/show_bug.cgi?id=75281

        Reviewed by Andreas Kling.

        - Reformat template declarations so that the class begins on a new line.
        - Change the parameter template parameters to start at P1 instead of P0.
        - Add function wrappers and bind overloads for 4 and 5 parameter functions.
        - Change the Function call operator to be const so const functions can be called.

        * wtf/Functional.h:

936 937 938 939 940 941 942 943 944 945
2011-12-27  Tony Chang  <tony@chromium.org>

        [chromium] Minor cleanup of gyp files.
        https://bugs.webkit.org/show_bug.cgi?id=75269

        Reviewed by Adam Barth.

        * JavaScriptCore.gyp/JavaScriptCore.gyp: msvs_guid is no longer needed
        and vim/emacs specific hooks should be added by the user.

946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961
2011-12-27  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75260
        Null name for host function can result in dereference of uninitialize memory

        Reviewed by Filip Pizlo.

        This is a recent regression in ToT, if the name passed to finishCreation of a host function is null,
        we are currently skipping the putDirect, which leaves memory uninitialized. This patch reverts the
        aspect of the change that introduced the issue.  It might be better if functions that don't have a
        name don't have this property at all, but that's change should be separate from fixing the bug.

        * runtime/JSFunction.cpp:
        (JSC::JSFunction::finishCreation):
            - Always initialize the name property.

962 963 964 965 966 967 968 969 970 971 972 973 974 975 976
2011-12-27  Anders Carlsson  <andersca@apple.com>

        Function should handle wrapping/unwrapping RefPtr and PassRefPtr
        https://bugs.webkit.org/show_bug.cgi?id=75266

        Reviewed by Sam Weinig.

        Add ParamStorageTraits that can be used for deciding how bound parameters should be stored
        and peeked at. For RefPtr we want to use the raw pointer when "peeking" to avoid ref-churn.
        For PassRefPtr, we want to use RefPtr for storage but still use the raw pointer when peeking.

        * wtf/Functional.h:
        (WTF::ParamStorageTraits::wrap):
        (WTF::ParamStorageTraits::unwrap):

977 978 979 980 981 982 983 984 985
2011-12-27  Tony Chang  <tony@chromium.org>

        [chromium] really enable wpo for WebCore libs and for WTF
        https://bugs.webkit.org/show_bug.cgi?id=75264

        Reviewed by Adam Barth.

        * JavaScriptCore.gyp/JavaScriptCore.gyp: Enable WPO for wtf and yarr.

barraclough@apple.com's avatar
barraclough@apple.com committed
986 987 988 989 990 991
2011-12-26  Gavin Barraclough  <barraclough@apple.com>

        Errk! OS X build fix.

        * JavaScriptCore.exp:

barraclough@apple.com's avatar
barraclough@apple.com committed
992 993 994 995 996 997 998
2011-12-26  Gavin Barraclough  <barraclough@apple.com>

        Windows build fix.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
        * runtime/JSObject.h:

999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026
2011-12-26  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75231
        Fail to throw in strict mode on assign to read only static properties

        Reviewed by Filip Pizlo.

        There are three bugs here:
        * symbolTablePut should throw for strict mode accesses.
        * lookupPut should throw for strict mode accesses.
        * NumberConstructor should override put to call lookupPut, to trap assignment to readonly properties.

        * runtime/JSActivation.cpp:
        (JSC::JSActivation::symbolTablePut):
        (JSC::JSActivation::put):
        * runtime/JSActivation.h:
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::put):
        * runtime/JSStaticScopeObject.cpp:
        (JSC::JSStaticScopeObject::put):
        * runtime/JSVariableObject.h:
        (JSC::JSVariableObject::symbolTablePut):
        * runtime/Lookup.h:
        (JSC::lookupPut):
        * runtime/NumberConstructor.cpp:
        (JSC::NumberConstructor::put):
        * runtime/NumberConstructor.h:

1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043
2011-12-26  Gavin Barraclough  <barraclough@apple.com>

        Fix miss-commit of utf8 change.

        Reviewed by Filip Pizlo

        Eeep, patch as landed a while ago had no effect! - acidentally landed
        modified version of patch used for performance testing.

        (This isn't covered by layout tests because layour tests don't use jsc,
        and the tests/mozilla tests use latin1, which was already supported!)

        Landing changes as intended (and as originally reviewed).

        * jsc.cpp:
        (jscSource):

1044 1045 1046 1047 1048 1049 1050 1051
2011-12-26  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed build fix for ARMv7.

        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::load16Signed):
        (JSC::MacroAssemblerARMv7::load8Signed):

1052 1053 1054 1055 1056 1057 1058 1059 1060 1061
2011-12-26  Hajime Morrita  <morrita@google.com>

        Rename WTF_INLINE, JS_INLINE to HIDDEN_INLINE
        https://bugs.webkit.org/show_bug.cgi?id=74990

        Reviewed by Kevin Ollivier.

        * runtime/JSExportMacros.h: Removed JS_INLINE
        * wtf/ExportMacros.h: Renamed WTF_INLINE to HIDDEN_INLINE

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
2011-12-24  Filip Pizlo  <fpizlo@apple.com>

        The ArgumentCount field in the CallFrame should have its tag left blank for other uses
        https://bugs.webkit.org/show_bug.cgi?id=75199
        <rdar://problem/10625105>
        <rdar://problem/10625106>

        Reviewed by Oliver Hunt.

        * dfg/DFGOSRExitCompiler32_64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGOSRExitCompiler64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::argumentPayloadSlot):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::emitCall):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::emitCall):
        * interpreter/CallFrame.h:
        (JSC::ExecState::argumentCountIncludingThis):
        (JSC::ExecState::setArgumentCountIncludingThis):
        * interpreter/Register.h:
        (JSC::Register::unboxedInt32):
        (JSC::Register::unboxedBoolean):
        (JSC::Register::unboxedCell):
        (JSC::Register::payload):
        (JSC::Register::tag):
        * jit/JITCall.cpp:
        (JSC::JIT::compileOpCall):
        * jit/JITCall32_64.cpp:
        (JSC::JIT::compileLoadVarargs):
        (JSC::JIT::compileOpCall):

1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109
2011-12-25  Andreas Kling  <awesomekling@apple.com>

        Yarr: Avoid copying vectors in CharacterClassConstructor.
        <http://webkit.org/b/75206>

        Reviewed by Darin Adler.

        Yarr::CharacterClassConstructor::charClass() was hot when loading twitter
        feeds (1.2%), replace the usage of Vector::append() by swap() since we're
        always clearing the source vector afterwards anyway.

        * yarr/YarrPattern.cpp:
        (JSC::Yarr::CharacterClassConstructor::charClass):

1110 1111 1112 1113 1114 1115 1116 1117 1118
2011-12-24  Darin Adler  <darin@apple.com>

        Specialize HashTraits for RefPtr to use PassRefPtr as "pass type" to reduce reference count churn
        https://bugs.webkit.org/show_bug.cgi?id=72476

        Reviewed by Sam Weinig.

        * wtf/HashTraits.h: Defined PassInType and store function in HashTraits<RefPtr>.

ggaren@apple.com's avatar
ggaren@apple.com committed
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132
2011-12-23  Geoffrey Garen  <ggaren@apple.com>

        Inlined Yarr::execute
        https://bugs.webkit.org/show_bug.cgi?id=75180

        Reviewed reluctantly by Beth Dakin.
        
        Tiny speedup on SunSpider string tests. Removes some samples from
        Instruments. A step toward removing -fomit-frame-pointer.

        * yarr/YarrJIT.cpp:
        * yarr/YarrJIT.h:
        (JSC::Yarr::execute): ONE LINE FUNCTION, Y U NOT INLINED?!

1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156
2011-12-23  Filip Pizlo  <fpizlo@apple.com>

        DFG loads from signed 8-bit and 16-bit typed arrays are broken
        https://bugs.webkit.org/show_bug.cgi?id=75163

        Reviewed by Geoffrey Garen.
        
        Added 8-bit and 16-bit signed loads. Because doing so on ARM is less trivial, I'm
        currently disabling Int8Array and Int16Array optimizations on ARM.

        * assembler/MacroAssemblerX86Common.h:
        (JSC::MacroAssemblerX86Common::load8Signed):
        (JSC::MacroAssemblerX86Common::load16Signed):
        * assembler/X86Assembler.h:
        (JSC::X86Assembler::movswl_mr):
        (JSC::X86Assembler::movsbl_mr):
        * bytecode/PredictedType.h:
        (JSC::isActionableMutableArrayPrediction):
        * dfg/DFGNode.h:
        (JSC::DFG::Node::shouldSpeculateInt8Array):
        (JSC::DFG::Node::shouldSpeculateInt16Array):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):

1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172
2011-12-23  Filip Pizlo  <fpizlo@apple.com>

        DFG does double-to-int conversion incorrectly when storing into int typed arrays
        https://bugs.webkit.org/show_bug.cgi?id=75164
        <rdar://problem/10557547>

        Reviewed by Geoffrey Garen.

        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::branchTruncateDoubleToUint32):
        * assembler/MacroAssemblerX86Common.h:
        (JSC::MacroAssemblerX86Common::branchTruncateDoubleToUint32):
        (JSC::MacroAssemblerX86Common::truncateDoubleToUint32):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):

1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
2011-12-23  Geoffrey Garen  <ggaren@apple.com>

        Refactored String.prototype.replace
        https://bugs.webkit.org/show_bug.cgi?id=75114
        
        Reviewed by Darin Adler.

        No performance difference.
        
        I think this is a step toward removing -fomit-frame-pointer.

        * runtime/JSString.cpp:
        * runtime/JSString.h: Removed the test and special case for a single-character
        search string because the standard path does this test and special case
        for us. (As an aside, if we do come up with a unique single-character
        replace optimization in future, it probably belongs in the replace function,
        and not in JSString.)

        * runtime/StringPrototype.cpp:
        (JSC::stringProtoFuncReplace): Split this mega-sized function into:
        (JSC::replaceUsingStringSearch): - This reasonably sized function, and
        (JSC::replaceUsingRegExpSearch): - This still mega-sized function.

1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207
2011-12-23  Pierre Rossi  <pierre.rossi@gmail.com>

        [Qt] REGRESSION(r103467): It broke fast/images/animated-gif-restored-from-bfcache.html
        https://bugs.webkit.org/show_bug.cgi?id=75087

        monotonicallyIncreasingTime needs to hava a higher resolution than milliseconds.

        Reviewed by Darin Adler.

        * wtf/CurrentTime.cpp:
        (WTF::monotonicallyIncreasingTime):

1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248
2011-12-22  Filip Pizlo  <fpizlo@apple.com>

        DFG should not speculate array even when predictions say that the base is not an array
        https://bugs.webkit.org/show_bug.cgi?id=75160
        <rdar://problem/10622646>
        <rdar://problem/10622649>

        Reviewed by Oliver Hunt.
        
        Added the ability to call slow path when the base is known to not be an array.
        Also rationalized the logic for deciding when the index is not an int, and
        cleaned up the logic for deciding when to speculate typed array.
        
        Neutral for the most part, with odd speed-ups and slow-downs. The slow-downs can
        likely be mitigated by having the notion of a polymorphic array access, where we
        try, but don't speculate, to access the array one way before either trying some
        other ways or calling slow path.

        * bytecode/PredictedType.h:
        (JSC::isActionableMutableArrayPrediction):
        (JSC::isActionableArrayPrediction):
        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::execute):
        * dfg/DFGNode.h:
        (JSC::DFG::Node::shouldSpeculateInt8Array):
        (JSC::DFG::Node::shouldSpeculateInt16Array):
        (JSC::DFG::Node::shouldSpeculateInt32Array):
        (JSC::DFG::Node::shouldSpeculateUint8Array):
        (JSC::DFG::Node::shouldSpeculateUint16Array):
        (JSC::DFG::Node::shouldSpeculateUint32Array):
        (JSC::DFG::Node::shouldSpeculateFloat32Array):
        (JSC::DFG::Node::shouldSpeculateFloat64Array):
        * dfg/DFGPropagator.cpp:
        (JSC::DFG::Propagator::byValIsPure):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

1249 1250 1251 1252 1253 1254 1255
2011-12-22  Gavin Barraclough  <barraclough@apple.com>

        Unreviewed - fix stylebot issues from last patch.

        * runtime/JSArray.cpp:
        (JSC::JSArray::putSlowCase):

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 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
2011-12-22  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=75151
        Add attributes field to JSArray's SparseMap

        Reviewed by Sam Weinig.

        This will be necessary to be able to support non- writable/configurable/enumerable
        properties, and helpful for getters/setters.

        Added a concept of being 'inSparseMode' - this indicates the array has a non-standard

        * runtime/ArrayPrototype.cpp:
        (JSC::arrayProtoFuncSort):
            - JSArray::sort methods not allowed on arrays that are 'inSparseMode'.
              (must fall back to generic sort alogrithm).
        * runtime/JSArray.cpp:
        (JSC::JSArray::finishCreation):
            - moved reportedMapCapacity into the SparseArrayValueMap object.
        (JSC::SparseArrayValueMap::find):
        (JSC::SparseArrayValueMap::put):
        (JSC::SparseArrayValueMap::visitChildren):
            - Added.
        (JSC::JSArray::getOwnPropertySlotByIndex):
        (JSC::JSArray::getOwnPropertyDescriptor):
        (JSC::JSArray::putSlowCase):
        (JSC::JSArray::deletePropertyByIndex):
        (JSC::JSArray::getOwnPropertyNames):
        (JSC::JSArray::setLength):
        (JSC::JSArray::pop):
        (JSC::JSArray::visitChildren):
            - Updated for changes in SparseArrayValueMap.
        (JSC::JSArray::sortNumeric):
        (JSC::JSArray::sort):
        (JSC::JSArray::compactForSorting):
            - Disallow on 'SparseMode' arrays.
        * runtime/JSArray.h:
        (JSC::SparseArrayEntry::SparseArrayEntry):
            - An entry in the sparse array - value (WriteBarrier) + attributes.
        (JSC::SparseArrayValueMap::SparseArrayValueMap):
        (JSC::SparseArrayValueMap::sparseMode):
        (JSC::SparseArrayValueMap::setSparseMode):
            - Flags to track whether an Array is forced into SparseMode.
        (JSC::SparseArrayValueMap::remove):
        (JSC::SparseArrayValueMap::notFound):
        (JSC::SparseArrayValueMap::isEmpty):
        (JSC::SparseArrayValueMap::contains):
        (JSC::SparseArrayValueMap::size):
        (JSC::SparseArrayValueMap::begin):
        (JSC::SparseArrayValueMap::end):
            - accessors to the map
        (JSC::SparseArrayValueMap::take):
            - only for use on non-SpareMode arrays.
        (JSC::JSArray::inSparseMode):
            - Added.

1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322
2011-12-22  Filip Pizlo  <fpizlo@apple.com>

        DFG CFA sometimes generates an incorrect proof that a node is known to be a typed array
        https://bugs.webkit.org/show_bug.cgi?id=75150
        <rdar://problem/10621900>

        Reviewed by Gavin Barraclough.

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::execute):

1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335
2011-12-22  Filip Pizlo  <fpizlo@apple.com>

        DFG JIT does exactly the wrong thing when doing strict equality on two known cells
        https://bugs.webkit.org/show_bug.cgi?id=75138
        <rdar://problem/10621526>

        Reviewed by Oliver Hunt.

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

1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348
2011-12-22  Balazs Kelemen  <kbalazs@webkit.org>

        Fix debug build with assertions disabled
        https://bugs.webkit.org/show_bug.cgi?id=75075

        Reviewed by Darin Adler.

        Check whether assertions are disabled instead of NDEBUG
        where appropriate to avoid "defined but not used" warnings.

        * wtf/DateMath.cpp:
        (WTF::initializeDates):

1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359
2011-12-22  Mariusz Grzegorczyk  <mariusz.g@samsung.com>

        [EFL] Missing plugins support for efl port
        https://bugs.webkit.org/show_bug.cgi?id=44505

        Reviewed by Anders Carlsson.

        Add define of ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for efl port.

        * wtf/Platform.h:

1360 1361 1362 1363 1364 1365 1366 1367 1368
2011-12-22  Wei Charles  <charles.wei@torchmobile.com.cn>

        Remove un-used data member of LiteralParser::Lex::m_string
        https://bugs.webkit.org/show_bug.cgi?id=68216

        Reviewed by George Staikos.

        * runtime/LiteralParser.h:

mitz@apple.com's avatar
mitz@apple.com committed
1369 1370 1371 1372 1373 1374
2011-12-21  Dan Bernstein  <mitz@apple.com>

        OS X build fix after r103488.

        * JavaScriptCore.exp:

1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386
2011-12-21  Konrad Piascik  <kpiascik@rim.com>

        Implement the JavaScriptCore bindings for eventListenerHandlerLocation
        https://bugs.webkit.org/show_bug.cgi?id=74313

        Reviewed by Eric Seidel.

        Updated project files to get Windows and Mac builds working.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
        * JavaScriptCore.xcodeproj/project.pbxproj:

1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408
2011-12-21  Filip Pizlo  <fpizlo@apple.com>

        DFG ConvertThis optimizations do not honor the distinction between the global object and the global this object
        https://bugs.webkit.org/show_bug.cgi?id=75058
        <rdar://problem/10616612>
        <rdar://problem/10617500>

        Reviewed by Oliver Hunt.
        
        Added a call to toThisObject() in the DFG when planting a direct reference to the global this object.
        Instead of adding a separate toThisObject() method on JSCell which does not take ExecState*, I reascribed
        a new contract: if you're calling toThisObject() on JSObject or one of its subtypes, then the ExecState*
        is optional.

        * dfg/DFGAssemblyHelpers.h:
        (JSC::DFG::AssemblyHelpers::globalThisObjectFor):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * runtime/JSObject.h:

1409 1410 1411 1412 1413 1414 1415 1416 1417 1418
2011-12-21  Pierre Rossi  <pierre.rossi@gmail.com>

        Implement montonicallyIncreasingClock() on Qt
        https://bugs.webkit.org/show_bug.cgi?id=62159

        Reviewed by Darin Adler.

        * wtf/CurrentTime.cpp:
        (WTF::monotonicallyIncreasingTime):

1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429
2011-12-20  Filip Pizlo  <fpizlo@apple.com>

        32_64 baseline JIT should attempt to convert division results to integers, and record when that fails
        https://bugs.webkit.org/show_bug.cgi?id=74997
        <rdar://problem/10612389>

        Reviewed by Gavin Barraclough.

        * jit/JITArithmetic32_64.cpp:
        (JSC::JIT::emit_op_div):

1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449
2011-12-20  Filip Pizlo  <fpizlo@apple.com>

        JavaScriptCore should be consistent about how it reads and writes ArgumentCount
        https://bugs.webkit.org/show_bug.cgi?id=74989
        <rdar://problem/10612006>

        Reviewed by Gavin Barraclough.

        * dfg/DFGJITCompiler.cpp:
        (JSC::DFG::JITCompiler::compileFunction):
        * jit/JIT.cpp:
        (JSC::JIT::privateCompile):
        * jit/JITCall32_64.cpp:
        (JSC::JIT::compileLoadVarargs):
        * jit/JITOpcodes32_64.cpp:
        (JSC::JIT::emit_op_get_arguments_length):
        (JSC::JIT::emit_op_get_argument_by_val):
        * jit/SpecializedThunkJIT.h:
        (JSC::SpecializedThunkJIT::SpecializedThunkJIT):

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
2011-12-20  Filip Pizlo  <fpizlo@apple.com>

        Value Profiles for arguments should be more easily accessible to the interpreter
        https://bugs.webkit.org/show_bug.cgi?id=74984
        <rdar://problem/10611364>

        Reviewed by Gavin Barraclough.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::stronglyVisitStrongReferences):
        (JSC::CodeBlock::shouldOptimizeNow):
        (JSC::CodeBlock::dumpValueProfiles):
        * bytecode/CodeBlock.h:
        (JSC::CodeBlock::setArgumentValueProfileSize):
        (JSC::CodeBlock::numberOfArgumentValueProfiles):
        (JSC::CodeBlock::valueProfileForArgument):
        (JSC::CodeBlock::addValueProfile):
        (JSC::CodeBlock::valueProfile):
        (JSC::CodeBlock::valueProfileForBytecodeOffset):
        (JSC::CodeBlock::totalNumberOfValueProfiles):
        (JSC::CodeBlock::getFromAllValueProfiles):
        * bytecode/ValueProfile.h:
        (JSC::ValueProfile::ValueProfile):
        * jit/JIT.cpp:
        (JSC::JIT::privateCompile):
        * jit/JIT.h:
        * jit/JITInlineMethods.h:
        (JSC::JIT::emitValueProfilingSite):

1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492
2011-12-20  Gavin Barraclough  <barraclough@apple.com>

        JSC shell should accept utf8 input.

        Reviewed by Filip Pizlo.

        * jsc.cpp:
        (jscSource):
        (functionRun):
        (functionLoad):
        (functionCheckSyntax):
        (runWithScripts):
        (runInteractive):

1493 1494 1495 1496 1497 1498 1499
2011-12-20  Gavin Barraclough  <barraclough@apple.com>

        Rubber Stamped by Sam Weinig

        * runtime/JSGlobalData.cpp:
            - removed some dead code.

1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518
2011-12-19  Geoffrey Garen  <ggaren@apple.com>

        Tightened up Vector<T>::append
        https://bugs.webkit.org/show_bug.cgi?id=74906

        Reviewed by Sam Weinig.

        Not a measurable speedup, but code inspection shows better code generated,
        and I believe this is a step toward turning off -fomit-frame-pointer.

        * wtf/Vector.h:
        (WTF::::append):
        (WTF::::appendSlowCase): Split out the slow case into a separate function
        to keep unnecessary instructions off the hot path. This means the hot
        path can now be inlined more often.
        
        Removed some old MSVC7 cruft. Hopefully, we don't need to hang on to a
        compiler work-around from 2007.

1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545
2011-12-19  Yuqiang Xian  <yuqiang.xian@intel.com>

        Temporary GPR should not be lazily allocated in DFG JIT on X86
        https://bugs.webkit.org/show_bug.cgi?id=74908

        Reviewed by Filip Pizlo.

        On X86, we used to allocate a temporary GPR lazily when it's really
        used rather than defined. This may cause potential issues of
        allocating registers inside control flow and result in problems in
        subsequent code generation, for example the DFG JIT may think an
        operand already being spilled (to satisfy the allocation request) and
        generate code to read the data from memory, but the allocation and
        spilling are in a branch which is not taken at runtime, so the
        generated code is incorrect.

        Although current DFG JIT code doesn't have this problematic pattern,
        it's better to cut-off the root to avoid any potential issues in the
        future.

        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::GPRTemporary::GPRTemporary):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::GPRTemporary::gpr):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556
2011-12-19  Yuqiang Xian  <yuqiang.xian@intel.com>

        Remove unused code for non-speculative Arith operations from DFG JIT
        https://bugs.webkit.org/show_bug.cgi?id=74905

        Reviewed by Filip Pizlo.

        * dfg/DFGSpeculativeJIT.h:
        * dfg/DFGSpeculativeJIT32_64.cpp:
        * dfg/DFGSpeculativeJIT64.cpp:

1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580
2011-12-19  Gavin Barraclough  <barraclough@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=74903
        Exceptions not thrown correctly from DFG JIT on 32bit

        Reviewed by Oliver Hunt.

        Arguments for lookupExceptionHandler are not setup correctly.
        In the case of ARMv7 we rely on lr being preserved over a call,
        this in invalid. On x86 we don't should be poking the arguments onto the stack!

        * bytecode/CodeBlock.h:
        (JSC::CodeBlock::bytecodeOffsetForCallAtIndex):
        * dfg/DFGAssemblyHelpers.h:
        (JSC::DFG::AssemblyHelpers::restoreReturnAddressBeforeReturn):
        * dfg/DFGGPRInfo.h:
        * dfg/DFGJITCompiler.cpp:
        (JSC::DFG::JITCompiler::compileBody):
        * dfg/DFGJITCompiler.h:
        (JSC::DFG::JITCompiler::addExceptionCheck):
        (JSC::DFG::JITCompiler::addFastExceptionCheck):
        * dfg/DFGOperations.cpp:
        * dfg/DFGOperations.h:

1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598
2011-12-19  Filip Pizlo  <fpizlo@apple.com>

        If we detect that we can use the JIT, don't use computed opcode lookups
        https://bugs.webkit.org/show_bug.cgi?id=74899
        <rdar://problem/10604551>

        Reviewed by Gavin Barraclough.

        * interpreter/Interpreter.cpp:
        (JSC::Interpreter::Interpreter):
        (JSC::Interpreter::initialize):
        (JSC::Interpreter::privateExecute):
        * interpreter/Interpreter.h:
        (JSC::Interpreter::getOpcode):
        (JSC::Interpreter::getOpcodeID):
        * runtime/JSGlobalData.cpp:
        (JSC::JSGlobalData::JSGlobalData):

ggaren@apple.com's avatar
ggaren@apple.com committed
1599 1600 1601 1602 1603 1604 1605 1606
2011-12-19  Geoffrey Garen  <ggaren@apple.com>

        Try to fix the Qt build.

        Unreviewed.

        * wtf/ThreadSpecific.h: #include!

1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617
2011-12-18  Filip Pizlo  <fpizlo@apple.com>

        It should be possible to change the value of an Options variable without recompiling the world
        https://bugs.webkit.org/show_bug.cgi?id=74807

        Reviewed by Gavin Barraclough.

        * runtime/Options.cpp:
        (JSC::Options::initializeOptions):
        * runtime/Options.h:

1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651
2011-12-19  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r103250.
        http://trac.webkit.org/changeset/103250
        https://bugs.webkit.org/show_bug.cgi?id=74877

        it still breaks codegen (Requested by olliej on #webkit).

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::execute):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGNode.h:
        * dfg/DFGPropagator.cpp:
        (JSC::DFG::Propagator::propagateArithNodeFlags):
        (JSC::DFG::Propagator::fixupNode):
        (JSC::DFG::Propagator::byValIsPure):
        (JSC::DFG::Propagator::clobbersWorld):
        (JSC::DFG::Propagator::getByValLoadElimination):
        (JSC::DFG::Propagator::checkStructureLoadElimination):
        (JSC::DFG::Propagator::getByOffsetLoadElimination):
        (JSC::DFG::Propagator::getPropertyStorageLoadElimination):
        (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination):
        (JSC::DFG::Propagator::performNodeCSE):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
        (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
        * dfg/DFGSpeculativeJIT.h:
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694
2011-12-16  Oliver Hunt  <oliver@apple.com>

        Rolling r103120 back in with merge errors corrected.

        PutByVal[Alias] unnecessarily reloads the storage buffer
        https://bugs.webkit.org/show_bug.cgi?id=74747

        Reviewed by Gavin Barraclough.

        Make PutByVal use GetIndexedStorage to load the storage buffer.
        This required switching PutByVal to a vararg node (which is
        responsible for most of the noise in this patch).  This fixes the
        remaining portion of the kraken regression caused by the GetByVal
        storage load elimination, and a 1-5% win on some of the sub tests of
        the typed array benchmark at:
        http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_benchmark.html

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::execute):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGNode.h:
        * dfg/DFGPropagator.cpp:
        (JSC::DFG::Propagator::propagateArithNodeFlags):
        (JSC::DFG::Propagator::fixupNode):
        (JSC::DFG::Propagator::byValIndexIsPure):
        (JSC::DFG::Propagator::clobbersWorld):
        (JSC::DFG::Propagator::getByValLoadElimination):
        (JSC::DFG::Propagator::checkStructureLoadElimination):
        (JSC::DFG::Propagator::getByOffsetLoadElimination):
        (JSC::DFG::Propagator::getPropertyStorageLoadElimination):
        (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination):
        (JSC::DFG::Propagator::performNodeCSE):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
        (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
        * dfg/DFGSpeculativeJIT.h:
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 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 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 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 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 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
2011-12-15  Geoffrey Garen  <ggaren@apple.com>

        Placement new does an unnecessary NULL check
        https://bugs.webkit.org/show_bug.cgi?id=74676

        Reviewed by Sam Weinig.

        We can define our own version, which skips the NULL check.
        
        Not a measurable speedup, but code inspection shows better code generated,
        and I believe this is a step toward turning off -fomit-frame-pointer.

        * API/JSCallbackConstructor.h:
        (JSC::JSCallbackConstructor::create):
        * API/JSCallbackFunction.h:
        (JSC::JSCallbackFunction::create): Use the NotNull version of placement
        new to skip the NULL check.

        * API/JSCallbackObject.h: Removed a conflicting, unnecessaray placement new.

        (JSC::JSCallbackObject::create):
        * debugger/DebuggerActivation.h:
        (JSC::DebuggerActivation::create):
        * heap/HandleHeap.cpp:
        (JSC::HandleHeap::grow):
        * heap/HandleHeap.h:
        (JSC::HandleHeap::allocate):
        * heap/MarkedBlock.cpp:
        (JSC::MarkedBlock::create):
        (JSC::MarkedBlock::recycle):
        * jit/JITCode.h:
        (JSC::JITCode::clear):
        * jsc.cpp:
        (GlobalObject::create):
        * profiler/CallIdentifier.h:
        * runtime/Arguments.h:
        (JSC::Arguments::create):
        * runtime/ArrayConstructor.h:
        (JSC::ArrayConstructor::create):
        * runtime/ArrayPrototype.h:
        (JSC::ArrayPrototype::create):
        * runtime/BooleanConstructor.h:
        (JSC::BooleanConstructor::create):
        * runtime/BooleanObject.h:
        (JSC::BooleanObject::create):
        * runtime/BooleanPrototype.h:
        (JSC::BooleanPrototype::create):
        * runtime/DateConstructor.h:
        (JSC::DateConstructor::create):
        * runtime/DateInstance.h:
        (JSC::DateInstance::create):
        * runtime/DatePrototype.h:
        (JSC::DatePrototype::create):
        * runtime/Error.h:
        (JSC::StrictModeTypeErrorFunction::create):
        * runtime/ErrorConstructor.h:
        (JSC::ErrorConstructor::create):
        * runtime/ErrorInstance.h:
        (JSC::ErrorInstance::create):
        * runtime/ErrorPrototype.h:
        (JSC::ErrorPrototype::create):
        * runtime/ExceptionHelpers.h:
        (JSC::InterruptedExecutionError::create):
        (JSC::TerminatedExecutionError::create):
        * runtime/Executable.h:
        (JSC::NativeExecutable::create):
        (JSC::EvalExecutable::create):
        (JSC::ProgramExecutable::create):
        (JSC::FunctionExecutable::create):
        * runtime/FunctionConstructor.h:
        (JSC::FunctionConstructor::create):
        * runtime/FunctionPrototype.h:
        (JSC::FunctionPrototype::create):
        * runtime/GetterSetter.h:
        (JSC::GetterSetter::create):
        * runtime/JSAPIValueWrapper.h:
        (JSC::JSAPIValueWrapper::create):
        * runtime/JSActivation.h:
        (JSC::JSActivation::create):
        * runtime/JSArray.h:
        (JSC::JSArray::create):
        * runtime/JSBoundFunction.cpp:
        (JSC::JSBoundFunction::create):
        * runtime/JSByteArray.h:
        (JSC::JSByteArray::create): Use the NotNull version of placement
        new to skip the NULL check.

        * runtime/JSCell.h: Removed a conflicting, unnecessaray placement new.

        * runtime/JSFunction.cpp:
        (JSC::JSFunction::create):
        * runtime/JSFunction.h:
        (JSC::JSFunction::create):
        * runtime/JSGlobalObject.h:
        (JSC::JSGlobalObject::create):
        * runtime/JSGlobalThis.h:
        (JSC::JSGlobalThis::create):
        * runtime/JSNotAnObject.h:
        (JSC::JSNotAnObject::create):
        * runtime/JSONObject.h:
        (JSC::JSONObject::create):
        * runtime/JSObject.h:
        (JSC::JSFinalObject::create):
        * runtime/JSPropertyNameIterator.cpp:
        (JSC::JSPropertyNameIterator::create):
        * runtime/JSPropertyNameIterator.h:
        (JSC::JSPropertyNameIterator::create):
        * runtime/JSStaticScopeObject.h:
        (JSC::JSStaticScopeObject::create):
        * runtime/JSString.cpp:
        (JSC::StringObject::create):
        * runtime/JSString.h:
        (JSC::RopeBuilder::createNull):
        (JSC::RopeBuilder::create):
        (JSC::RopeBuilder::createHasOtherOwner):
        * runtime/MathObject.h:
        (JSC::MathObject::create):
        * runtime/NativeErrorConstructor.h:
        (JSC::NativeErrorConstructor::create):
        * runtime/NativeErrorPrototype.h:
        (JSC::NativeErrorPrototype::create):
        * runtime/NumberConstructor.h:
        (JSC::NumberConstructor::create):
        * runtime/NumberObject.h:
        (JSC::NumberObject::create):
        * runtime/NumberPrototype.h:
        (JSC::NumberPrototype::create):
        * runtime/ObjectConstructor.h:
        (JSC::ObjectConstructor::create):
        * runtime/ObjectPrototype.h:
        (JSC::ObjectPrototype::create):
        * runtime/RegExp.cpp:
        (JSC::RegExp::createWithoutCaching):
        * runtime/RegExpConstructor.h:
        (JSC::RegExpConstructor::create):
        * runtime/RegExpMatchesArray.h:
        (JSC::RegExpMatchesArray::create):
        * runtime/RegExpObject.h:
        (JSC::RegExpObject::create):
        * runtime/RegExpPrototype.h:
        (JSC::RegExpPrototype::create):
        * runtime/ScopeChain.h:
        (JSC::ScopeChainNode::create):
        * runtime/StrictEvalActivation.h:
        (JSC::StrictEvalActivation::create):
        * runtime/StringConstructor.h:
        (JSC::StringConstructor::create):
        * runtime/StringObject.h:
        (JSC::StringObject::create):
        * runtime/StringPrototype.h:
        (JSC::StringPrototype::create):
        * runtime/Structure.h:
        (JSC::Structure::create):
        (JSC::Structure::createStructure):
        * runtime/StructureChain.h:
        (JSC::StructureChain::create):
        * testRegExp.cpp:
        (GlobalObject::create):
        * wtf/BitVector.cpp:
        (WTF::BitVector::OutOfLineBits::create): Use the NotNull version of placement
        new to skip the NULL check.

        * wtf/BumpPointerAllocator.h:
        (WTF::BumpPointerPool::create): Standardized spacing to make grep easier.

        * wtf/ByteArray.cpp:
        (WTF::ByteArray::create):
        * wtf/Deque.h:
        (WTF::::append):
        (WTF::::prepend): Use NotNull, as above.

        * wtf/FastAllocBase.h: Added a placement new, since this class would otherwise
        hide the name of the global placement new.

        (WTF::fastNew): Standardized spacing. Most of these functions don't need
        NotNull, since they check for NULL, and the optimizer can see that.

        * wtf/HashTable.h:
        * wtf/HashTraits.h:
        (WTF::SimpleClassHashTraits::constructDeletedValue):
        * wtf/MetaAllocator.cpp:
        (WTF::MetaAllocator::allocFreeSpaceNode): NotNull, as above.

        * wtf/StdLibExtras.h:
        (throw): This is our NotNull placement new. Declaring that we throw is
        the C++ way to say that operator new will not return NULL.

        * wtf/ThreadSpecific.h:
        (WTF::T):
        * wtf/Vector.h:
        (WTF::::append):
        (WTF::::tryAppend):
        (WTF::::uncheckedAppend):
        (WTF::::insert):
        * wtf/text/AtomicStringHash.h:
        * wtf/text/StringImpl.cpp:
        (WTF::StringImpl::createUninitialized):
        (WTF::StringImpl::reallocate):
        * wtf/text/StringImpl.h:
        (WTF::StringImpl::tryCreateUninitialized):
        * wtf/text/StringStatics.cpp:
        (WTF::AtomicString::init): Use NotNull, as above.

        * yarr/YarrInterpreter.cpp:
        (JSC::Yarr::Interpreter::allocDisjunctionContext):
        (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
        (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext): Standardized
        spacing for easy grep.

1904 1905 1906 1907 1908 1909 1910 1911 1912
2011-12-19  Eric Carlson  <eric.carlson@apple.com>

        Enable <track> for Mac build
        https://bugs.webkit.org/show_bug.cgi?id=74838

        Reviewed by Darin Adler.

        * wtf/Platform.h:

1913 1914 1915 1916 1917 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
2011-12-18  Filip Pizlo  <fpizlo@apple.com>

        DFG is too sloppy with register allocation
        https://bugs.webkit.org/show_bug.cgi?id=74835

        Reviewed by Gavin Barraclough.
        
        Added assertions that at the end of a successfully generated basic block,
        all use counts should be zero. This revealed a number of bugs:
        
        - Array length optimizations were turning a must-generate node into one
          that is not must-generate, but failing to change the ref count
          accordingly.
          
        - Indexed property storage optimizations were failing to deref their
          children, or to deref the indexed property storage node itself. Also,
          they used the Phantom node as a replacement. But the Phantom node is
          must-generate, which was causing bizarre issues. So this introduces a
          Nop node, which should be used in cases where you want a node that is
          skipped and has no children.
          
        This does not have any significant performance effect, but it should
        relieve some register pressure. The main thing this patch adds, though,
        are the assertions, which should make it easier to do register allocation
        related changes in the future.

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::execute):
        * dfg/DFGGenerationInfo.h:
        (JSC::DFG::GenerationInfo::initConstant):
        (JSC::DFG::GenerationInfo::initInteger):
        (JSC::DFG::GenerationInfo::initJSValue):
        (JSC::DFG::GenerationInfo::initCell):
        (JSC::DFG::GenerationInfo::initBoolean):
        (JSC::DFG::GenerationInfo::initDouble):
        (JSC::DFG::GenerationInfo::initStorage):
        (JSC::DFG::GenerationInfo::use):
        * dfg/DFGGraph.h:
        (JSC::DFG::Graph::clearAndDerefChild1):
        (JSC::DFG::Graph::clearAndDerefChild2):
        (JSC::DFG::Graph::clearAndDerefChild3):
        * dfg/DFGNode.h:
        (JSC::DFG::Node::deref):
        * dfg/DFGPropagator.cpp:
        (JSC::DFG::Propagator::propagateNodePredictions):
        (JSC::DFG::Propagator::fixupNode):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979
2011-12-18  Benjamin Poulain  <bpoulain@apple.com>

        Remove the duplicated code from ASCIICType.h
        https://bugs.webkit.org/show_bug.cgi?id=74771

        Reviewed by Andreas Kling.

        Use isASCIIDigit() and isASCIIAlpha() instead of copying the code.

        * wtf/ASCIICType.h:
        (WTF::isASCIIDigit):
        (WTF::isASCIIAlphanumeric):
        (WTF::isASCIIHexDigit):

1980 1981 1982 1983 1984 1985 1986 1987 1988
2011-12-18  Anders Carlsson  <andersca@apple.com>

        Set the main frame view scroll position asynchronously
        https://bugs.webkit.org/show_bug.cgi?id=74823

        Reviewed by Sam Weinig.

        * JavaScriptCore.exp:

1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002
2011-12-10  Andreas Kling  <kling@webkit.org>

        OpaqueJSClass: Remove RVCT2 workarounds.
        <http://webkit.org/b/74250>

        Reviewed by Benjamin Poulain.

        We no longer need workarounds for the RVCT2 compiler since it was
        only used for the Symbian port of WebKit which is now defunct.

        * API/JSClassRef.cpp:
        (OpaqueJSClass::OpaqueJSClass):
        (OpaqueJSClassContextData::OpaqueJSClassContextData):

2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029
2011-12-16  Benjamin Poulain  <bpoulain@apple.com>

        Remove the duplicated code from ASCIICType.h
        https://bugs.webkit.org/show_bug.cgi?id=74771

        Reviewed by Andreas Kling.

        The functions were sharing similar code and were defined for the various input types.
        Use templates instead to avoid code duplication.

        * wtf/ASCIICType.h:
        (WTF::isASCII):
        (WTF::isASCIIAlpha):
        (WTF::isASCIIAlphanumeric):
        (WTF::isASCIIDigit):
        (WTF::isASCIIHexDigit):
        (WTF::isASCIILower):
        (WTF::isASCIIOctalDigit):
        (WTF::isASCIIPrintable):
        (WTF::isASCIISpace):
        (WTF::isASCIIUpper):
        (WTF::toASCIILower):
        (WTF::toASCIIUpper):
        (WTF::toASCIIHexValue):
        (WTF::lowerNibbleToASCIIHexDigit):
        (WTF::upperNibbleToASCIIHexDigit):

2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049
2011-12-16  Filip Pizlo  <fpizlo@apple.com>

        DFG OSR exit may get confused about where in the scratch buffer it stored a value
        https://bugs.webkit.org/show_bug.cgi?id=74695

        Reviewed by Oliver Hunt.
        
        The code that reads from the scratch buffer now explicitly knows which locations to
        read from. No new tests, since this patch covers a case so uncommon that I don't know
        how to make a test for it.

        * dfg/DFGOSRExitCompiler.h:
        (JSC::DFG::OSRExitCompiler::badIndex):
        (JSC::DFG::OSRExitCompiler::initializePoisoned):
        (JSC::DFG::OSRExitCompiler::poisonIndex):
        * dfg/DFGOSRExitCompiler32_64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGOSRExitCompiler64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):

2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090
2011-12-16  Oliver Hunt  <oliver@apple.com>

        PutByVal[Alias] unnecessarily reloads the storage buffer
        https://bugs.webkit.org/show_bug.cgi?id=74747

        Reviewed by Gavin Barraclough.

        Make PutByVal use GetIndexedStorage to load the storage buffer.
        This required switching PutByVal to a vararg node (which is
        responsible for most of the noise in this patch).  This fixes the
        remaining portion of the kraken regression caused by the GetByVal
        storage load elimination, and a 1-5% win on some of the sub tests of
        the typed array benchmark at:
        http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_benchmark.html

        * dfg/DFGAbstractState.cpp:
        (JSC::DFG::AbstractState::execute):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGNode.h:
        * dfg/DFGPropagator.cpp:
        (JSC::DFG::Propagator::propagateArithNodeFlags):
        (JSC::DFG::Propagator::fixupNode):
        (JSC::DFG::Propagator::byValIndexIsPure):
        (JSC::DFG::Propagator::clobbersWorld):
        (JSC::DFG::Propagator::getByValLoadElimination):
        (JSC::DFG::Propagator::checkStructureLoadElimination):
        (JSC::DFG::Propagator::getByOffsetLoadElimination):
        (JSC::DFG::Propagator::getPropertyStorageLoadElimination):
        (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination):
        (JSC::DFG::Propagator::performNodeCSE):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
        (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
        * dfg/DFGSpeculativeJIT.h:
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102
2011-12-16  Daniel Bates  <dbates@rim.com>

        Include BlackBerryPlatformLog.h instead of BlackBerryPlatformMisc.h

        Rubber-stamped by Antonio Gomes.

        BlackBerry::Platform::logV() is declared in BlackBerryPlatformLog.h. That is, it isn't
        declared in BlackBerryPlatformMisc.h. Hence, we should include BlackBerryPlatformLog.h
        instead of BlackBerryPlatformMisc.h.

        * wtf/Assertions.cpp:

2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 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 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 2261 2262 2263 2264 2265 2266 2267 2268 2269 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 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421
2011-12-16  Mark Hahnenberg  <mhahnenberg@apple.com>

        De-virtualize destructors
        https://bugs.webkit.org/show_bug.cgi?id=74331

        Reviewed by Geoffrey Garen.

        This is a megapatch which frees us from the chains of virtual destructors.

        In order to remove the virtual destructors, which are the last of the virtual 
        functions, from the JSCell hierarchy, we need to add the ClassInfo pointer to 
        the cell rather than to the structure because in order to be able to lazily call 
        the static destroy() functions that will replace the virtual destructors, we 
        need to be able to access the ClassInfo without the danger of the object's 
        Structure being collected before the object itself.

        After adding the ClassInfo to the cell, we can then begin to remove our use 
        of vptrs for optimizations within the JIT and the GC.  When we have removed 
        all of the stored vptrs from JSGlobalData, we can then also remove all of 
        the related VPtrStealingHack code.

        The replacement for virtual destructors will be to add a static destroy function 
        pointer to the MethodTable stored in ClassInfo.  Any subclass of JSCell that has 
        a non-trivial destructor will require its own static destroy function to static 
        call its corresponding destructor, which will now be non-virtual.  In future 
        patches we will slowly move away from destructors altogether as we make more and 
        more objects backed by GC memory rather than malloc-ed memory.  The GC will now 
        call the static destroy method rather than the virtual destructor.

        As we go through the hierarchy and add static destroy functions to classes, 
        we will also add a new assert, ASSERT_HAS_TRIVIAL_DESTRUCTOR, to those classes 
        to which it applies.  The future goal is to eventually have every class have that assert.

        * API/JSCallbackConstructor.cpp:
        (JSC::JSCallbackConstructor::destroy): Add a destroy function to statically call 
        ~JSCallbackConstructor because it has some extra destruction logic.
        * API/JSCallbackConstructor.h:
        * API/JSCallbackFunction.cpp: Add trivial destructor assert for JSCallbackFunction.
        * API/JSCallbackObject.cpp: Add a destroy function to statically call ~JSCallbackObject 
        because it has a member OwnPtr that needs destruction.
        (JSC::::destroy):
        * API/JSCallbackObject.h:
        * JavaScriptCore.exp: Add/remove necessary symbols for JSC.
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Same for Windows symbols.
        * debugger/DebuggerActivation.cpp: DebuggerActivation, for some strange reason, didn't 
        have its own ClassInfo despite the fact that it overrides a number of MethodTable 
        methods.  Added the ClassInfo, along with an assertion that its destructor is trivial.
        * debugger/DebuggerActivation.h:
        * dfg/DFGOperations.cpp: Remove global data first argument to isJSArray, isJSByteArray, 
        isJSString, as it is no longer necessary.
        (JSC::DFG::putByVal):
        * dfg/DFGRepatch.cpp:  Ditto.  Also remove uses of jsArrayVPtr in favor of using the 
        JSArray ClassInfo pointer.
        (JSC::DFG::tryCacheGetByID):
        * dfg/DFGSpeculativeJIT.cpp:  Replace uses of the old vptrs with new ClassInfo 
        comparisons since we don't have vptrs anymore.
        (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
        (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
        (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
        (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
        (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
        (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
        (JSC::DFG::SpeculativeJIT::compare):
        (JSC::DFG::SpeculativeJIT::compileStrictEq):
        (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
        * dfg/DFGSpeculativeJIT.h: Ditto.
        (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject):
        * dfg/DFGSpeculativeJIT32_64.cpp: Ditto.
        (JSC::DFG::SpeculativeJIT::compileObjectEquality):
        (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
        (JSC::DFG::SpeculativeJIT::compileLogicalNot):
        (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
        (JSC::DFG::SpeculativeJIT::emitBranch):
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp: Ditto.
        (JSC::DFG::SpeculativeJIT::compileObjectEquality):
        (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
        (JSC::DFG::SpeculativeJIT::compileLogicalNot):
        (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
        (JSC::DFG::SpeculativeJIT::emitBranch):
        (JSC::DFG::SpeculativeJIT::compile):
        * heap/Heap.cpp: Remove all uses of vptrs in GC optimizations and replace them with 
        ClassInfo comparisons.
        (JSC::Heap::Heap):
        * heap/MarkStack.cpp: Ditto.
        (JSC::MarkStackThreadSharedData::markingThreadMain):
        (JSC::visitChildren):
        (JSC::SlotVisitor::drain):
        * heap/MarkStack.h: Ditto.
        (JSC::MarkStack::MarkStack):
        * heap/MarkedBlock.cpp: Ditto.
        (JSC::MarkedBlock::callDestructor):
        (JSC::MarkedBlock::specializedSweep):
        * heap/MarkedBlock.h: Ditto.
        * heap/SlotVisitor.h: Ditto.
        (JSC::SlotVisitor::SlotVisitor):
        * heap/VTableSpectrum.cpp: Now that we don't have vptrs, we can't count them.  
        We'll have to rename this class and make it use ClassInfo ptrs in a future patch.
        (JSC::VTableSpectrum::count):
        * interpreter/Interpreter.cpp: Remove all global data arguments from isJSArray, 
        etc. functions.
        (JSC::loadVarargs):
        (JSC::Interpreter::tryCacheGetByID):
        (JSC::Interpreter::privateExecute):
        * jit/JIT.h: Remove vptr argument from emitAllocateBasicJSObject 
        * jit/JITInlineMethods.h: Remove vptr planting, and add ClassInfo planting, 
        remove all vtable related code.
        (JSC::JIT::emitLoadCharacterString):
        (JSC::JIT::emitAllocateBasicJSObject):
        (JSC::JIT::emitAllocateJSFinalObject):
        (JSC::JIT::emitAllocateJSFunction):
        * jit/JITOpcodes.cpp: Replace vptr related branch code with corresponding ClassInfo.
        (JSC::JIT::privateCompileCTIMachineTrampolines):
        (JSC::JIT::emit_op_to_primitive):
        (JSC::JIT::emit_op_convert_this):
        * jit/JITOpcodes32_64.cpp: Ditto.
        (JSC::JIT::privateCompileCTIMachineTrampolines):
        (JSC::JIT::emit_op_to_primitive):
        (JSC::JIT::emitSlow_op_eq):
        (JSC::JIT::emitSlow_op_neq):
        (JSC::JIT::compileOpStrictEq):
        (JSC::JIT::emit_op_convert_this):
        * jit/JITPropertyAccess.cpp: Ditto.
        (JSC::JIT::stringGetByValStubGenerator):
        (JSC::JIT::emit_op_get_by_val):
        (JSC::JIT::emitSlow_op_get_by_val):
        (JSC::JIT::emit_op_put_by_val):
        (JSC::JIT::privateCompilePutByIdTransition):
        (JSC::JIT::privateCompilePatchGetArrayLength):
        * jit/JITPropertyAccess32_64.cpp: Ditto.
        (JSC::JIT::stringGetByValStubGenerator):
        (JSC::JIT::emit_op_get_by_val):
        (JSC::JIT::emitSlow_op_get_by_val):
        (JSC::JIT::emit_op_put_by_val):
        (JSC::JIT::privateCompilePatchGetArrayLength):
        * jit/JITStubs.cpp: Remove global data argument from isJSString, etc.
        (JSC::JITThunks::tryCacheGetByID):
        (JSC::DEFINE_STUB_FUNCTION):
        * jit/SpecializedThunkJIT.h: Replace vptr related stuff with ClassInfo stuff.
        (JSC::SpecializedThunkJIT::loadJSStringArgument):
        * runtime/ArrayConstructor.cpp: Add trivial destructor assert.
        * runtime/ArrayPrototype.cpp: Remove global data argument from isJSArray.
        (JSC::arrayProtoFuncToString):
        (JSC::arrayProtoFuncJoin):
        (JSC::arrayProtoFuncPop):
        (JSC::arrayProtoFuncPush):
        (JSC::arrayProtoFuncShift):
        (JSC::arrayProtoFuncSplice):
        (JSC::arrayProtoFuncUnShift):
        (JSC::arrayProtoFuncFilter):
        (JSC::arrayProtoFuncMap):
        (JSC::arrayProtoFuncEvery):
        (JSC::arrayProtoFuncForEach):
        (JSC::arrayProtoFuncSome):
        (JSC::arrayProtoFuncReduce):
        (JSC::arrayProtoFuncReduceRight):
        * runtime/BooleanConstructor.cpp: Add trivial destructor assert.
        * runtime/BooleanObject.cpp: Ditto.
        * runtime/BooleanPrototype.cpp: Ditto.
        * runtime/ClassInfo.h: Add destroy function pointer to MethodTable.
        * runtime/DateConstructor.cpp: Add trivial destructor assert.
        * runtime/DateInstance.cpp: Add destroy function for DateInstance because it has a RefPtr 
        that needs destruction.
        (JSC::DateInstance::destroy):
        * runtime/DateInstance.h:
        * runtime/Error.cpp: Ditto (because of UString member).
        (JSC::StrictModeTypeErrorFunction::destroy):
        * runtime/Error.h:
        * runtime/ErrorConstructor.cpp: Add trivial destructor assert.
        * runtime/ErrorInstance.cpp: Ditto.
        * runtime/ExceptionHelpers.cpp: Ditto.
        * runtime/Executable.cpp: Add destroy functions for ExecutableBase and subclasses.
        (JSC::ExecutableBase::destroy):
        (JSC::NativeExecutable::destroy):
        (JSC::ScriptExecutable::destroy):
        (JSC::EvalExecutable::destroy):
        (JSC::ProgramExecutable::destroy):
        (JSC::FunctionExecutable::destroy):
        * runtime/Executable.h:
        * runtime/FunctionConstructor.cpp: Add trivial destructor assert.
        * runtime/FunctionPrototype.cpp: Ditto. Also remove global data first arg from isJSArray.
        (JSC::functionProtoFuncApply):
        * runtime/GetterSetter.cpp: Ditto.
        * runtime/InitializeThreading.cpp: Remove call to JSGlobalData::storeVPtrs since it no 
        longer exists.
        (JSC::initializeThreadingOnce):
        * runtime/InternalFunction.cpp: Remove vtableAnchor function, add trivial destructor assert, 
        remove first arg from isJSString.
        (JSC::InternalFunction::displayName):
        * runtime/InternalFunction.h: Remove VPtrStealingHack.
        * runtime/JSAPIValueWrapper.cpp: Add trivial destructor assert.
        * runtime/JSArray.cpp: Add static destroy to call ~JSArray.  Replace vptr checks in 
        destructor with ClassInfo checks.
        (JSC::JSArray::~JSArray):
        (JSC::JSArray::destroy):
        * runtime/JSArray.h: Remove VPtrStealingHack.  Remove globalData argument from isJSArray 
        and change them to check the ClassInfo rather than the vptrs.
        (JSC::isJSArray):
        * runtime/JSBoundFunction.cpp: Add trival destructor assert. Remove first arg from isJSArray.
        (JSC::boundFunctionCall):
        (JSC::boundFunctionConstruct):
        * runtime/JSByteArray.cpp: Add static destroy function, replace vptr checks with ClassInfo checks.
        (JSC::JSByteArray::~JSByteArray):
        (JSC::JSByteArray::destroy):
        * runtime/JSByteArray.h: Remove VPtrStealingHack code.
        (JSC::isJSByteArray):
        * runtime/JSCell.cpp: Add trivial destructor assert.  Add static destroy function.
        (JSC::JSCell::destroy):
        * runtime/JSCell.h: Remove VPtrStealingHack code.  Add function for returning the offset 
        of the ClassInfo pointer in the object for use by the JIT.  Add the ClassInfo pointer to 
        the JSCell itself, and grab it from the Structure.  Remove the vptr and setVPtr functions, 
        as they are no longer used.  Add a validatedClassInfo function to JSCell for any clients 
        that want to verify, while in Debug mode, that the ClassInfo contained in the cell is the 
        same one as that contained in the Structure.  This isn't used too often, because most of 
        the places where we compare the ClassInfo to things can be called during destruction.  
        Since the Structure is unreliable during the phase when destructors are being called, 
        we can't call validatedClassInfo.
        (JSC::JSCell::classInfoOffset):
        (JSC::JSCell::structure):
        (JSC::JSCell::classInfo):
        * runtime/JSFunction.cpp: Remove VPtrStealingHack code.  Add static destroy, remove vtableAnchor, 
        remove first arg from call to isJSString.
        (JSC::JSFunction::destroy):
        (JSC::JSFunction::displayName):
        * runtime/JSFunction.h: 
        * runtime/JSGlobalData.cpp: Remove all VPtr stealing code and storage, including storeVPtrs, 
        as these vptrs are no longer needed in the codebase.
        * runtime/JSGlobalData.h:
        (JSC::TypedArrayDescriptor::TypedArrayDescriptor): Changed the TypedArrayDescriptor to use 
        ClassInfo rather than the vptr.
        * runtime/JSGlobalObject.cpp: Add static destroy function.
        (JSC::JSGlobalObject::destroy):
        * runtime/JSGlobalObject.h:
        * runtime/JSGlobalThis.cpp: Add trivial destructor assert.
        * runtime/JSNotAnObject.cpp: Ditto.
        * runtime/JSONObject.cpp: Ditto. Remove first arg from isJSArray calls.
        (JSC::Stringifier::Holder::appendNextProperty):
        (JSC::Walker::walk):
        * runtime/JSObject.cpp: 
        (JSC::JSFinalObject::destroy):
        (JSC::JSNonFinalObject::destroy):
        (JSC::JSObject::destroy):
        * runtime/JSObject.h: Add trivial destructor assert for JSObject, remove vtableAnchor 
        from JSNonFinalObject and JSFinalObject, add static destroy for JSFinalObject and 
        JSNonFinalObject, add isJSFinalObject utility function similar to isJSArray, remove all VPtrStealingHack code.
        (JSC::JSObject::finishCreation):
        (JSC::JSNonFinalObject::finishCreation):
        (JSC::JSFinalObject::finishCreation):
        (JSC::isJSFinalObject):
        * runtime/JSPropertyNameIterator.cpp: Add static destroy.
        (JSC::JSPropertyNameIterator::destroy):
        * runtime/JSPropertyNameIterator.h:
        * runtime/JSStaticScopeObject.cpp: Ditto.
        (JSC::JSStaticScopeObject::destroy):
        * runtime/JSStaticScopeObject.h: Ditto. 
        * runtime/JSString.cpp:
        (JSC::JSString::destroy):
        * runtime/JSString.h: Ditto. Remove VPtrStealingHack code. Also remove fixupVPtr code, 
        since we no longer need to fixup vptrs.
        (JSC::jsSingleCharacterString):
        (JSC::jsSingleCharacterSubstring):
        (JSC::jsNontrivialString):
        (JSC::jsString):
        (JSC::jsSubstring8):
        (JSC::jsSubstring):
        (JSC::jsOwnedString):
        (JSC::jsStringBuilder):
        (JSC::isJSString):
        * runtime/JSVariableObject.cpp: 
        (JSC::JSVariableObject::destroy):
        * runtime/JSVariableObject.h: Ditto.
        * runtime/JSWrapperObject.cpp:
        * runtime/JSWrapperObject.h: Add trivial destructor assert.
        * runtime/MathObject.cpp: Ditto.
        * runtime/NativeErrorConstructor.cpp: Ditto.
        * runtime/NumberConstructor.cpp: Ditto.
        * runtime/NumberObject.cpp: Ditto.
        * runtime/NumberPrototype.cpp: Ditto.
        * runtime/ObjectConstructor.cpp: Ditto.
        * runtime/ObjectPrototype.cpp: Ditto.
        * runtime/Operations.h: Remove calls to fixupVPtr, remove first arg to isJSString.
        (JSC::jsString):
        (JSC::jsLess):
        (JSC::jsLessEq):
        * runtime/RegExp.cpp: Add static destroy.
        (JSC::RegExp::destroy):
        * runtime/RegExp.h:
        * runtime/RegExpConstructor.cpp: Add static destroy for RegExpConstructor and RegExpMatchesArray.
        (JSC::RegExpConstructor::destroy):
        (JSC::RegExpMatchesArray::destroy):
        * runtime/RegExpConstructor.h:
        * runtime/RegExpMatchesArray.h:
        * runtime/RegExpObject.cpp: Add static destroy.
        (JSC::RegExpObject::destroy):
        * runtime/RegExpObject.h:
        * runtime/ScopeChain.cpp: Add trivial destructor assert.
        * runtime/ScopeChain.h:
        * runtime/StrictEvalActivation.cpp: Ditto.
        * runtime/StringConstructor.cpp:
        * runtime/StringObject.cpp: Ditto. Remove vtableAnchor.
        * runtime/StringObject.h:
        * runtime/StringPrototype.cpp: Ditto.
        * runtime/Structure.cpp: Add static destroy.
        (JSC::Structure::destroy):
        * runtime/Structure.h: Move JSCell::finishCreation and JSCell constructor into Structure.h 
        because they need to have the full Structure type to access the ClassInfo to store in the JSCell.
        (JSC::JSCell::setStructure):
        (JSC::JSCell::validatedClassInfo):
        (JSC::JSCell::JSCell):
        (JSC::JSCell::finishCreation):
        * runtime/StructureChain.cpp: Add static destroy.
        (JSC::StructureChain::destroy):
        * runtime/StructureChain.h:
        * wtf/Assertions.h: Add new assertion ASSERT_HAS_TRIVIAL_DESTRUCTOR, which uses clangs 
        ability to tell us when a class has a trivial destructor. We will use this assert 
        more in future patches as we move toward having all JSC objects backed by GC memory, 
        which means moving away from using destructors/finalizers.

2422 2423 2424 2425 2426 2427
2011-12-15  Martin Robinson  <mrobinson@igalia.com>

        Fix 'make dist' in preparation for the GTK+ release.

        * GNUmakefile.list.am: Add missing header.

2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440
2011-12-15  Sam Weinig  <sam@webkit.org>

        <rdar://problem/10552550> JavaScriptCore uses obsolete 'cpy' mnemonic in ARM assembly

        Reviewed by Gavin Barraclough.

        Original patch by Jim Grosbach.

        * jit/JITStubs.cpp:
        (JSC::ctiTrampoline):
        (JSC::ctiVMThrowTrampoline):
        Replace uses of the 'cpy' mnemonic with 'mov'.

2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457
2011-12-15  Filip Pizlo  <fpizlo@apple.com>

        Value profiling should distinguished between NaN and non-NaN doubles
        https://bugs.webkit.org/show_bug.cgi?id=74682

        Reviewed by Gavin Barraclough.
        
        Added PredictDoubleReal and PredictDoubleNaN. PredictDouble is now the union
        of the two.

        * bytecode/PredictedType.cpp:
        (JSC::predictionToString):
        (JSC::predictionFromValue):
        * bytecode/PredictedType.h:
        (JSC::isDoubleRealPrediction):
        (JSC::isDoublePrediction):

2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471
2011-12-15  Anders Carlsson  <andersca@apple.com>

        Regression (r102866): Navigating away from or closing a page with a plugin crashes
        https://bugs.webkit.org/show_bug.cgi?id=74655
        <rdar://problem/10590024>

        Reviewed by Sam Weinig.

        Rewrite HasRefAndDeref to work if ref and deref are implemented in base classes,
        using a modified version of the technique described here:
        http://groups.google.com/group/comp.lang.c++.moderated/msg/e5fbc9305539f699
        
        * wtf/Functional.h:

2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485
2011-12-15  Andy Wingo  <wingo@igalia.com>