12010-07-08 Gavin Barraclough <barraclough@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=41641 6 7 Update compile flags to allow use of ExecutableAllocatorFixedVMPool on platforms 8 other than x86-64 (this may be useful on 32-bit platforms, too). 9 10 Simplify ifdefs by dividing into thwo broad allocation strategies 11 (ENABLE_EXECUTABLE_ALLOCATOR_FIXED & ENABLE_EXECUTABLE_ALLOCATOR_DEMAND). 12 13 Rename constant used in the code to have names descriptive of their purpose, 14 rather than their specific value on a given platform. 15 16 * jit/ExecutableAllocator.cpp: 17 (JSC::ExecutableAllocator::reprotectRegion): 18 (JSC::ExecutableAllocator::cacheFlush): 19 * jit/ExecutableAllocatorFixedVMPool.cpp: 20 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): 21 (JSC::FixedVMPoolAllocator::free): 22 (JSC::ExecutablePool::systemAlloc): 23 * jit/ExecutableAllocatorPosix.cpp: 24 * jit/ExecutableAllocatorSymbian.cpp: 25 * jit/ExecutableAllocatorWin.cpp: 26 * wtf/Platform.h: 27 282010-08-24 Oliver Hunt <oliver@apple.com> 29 30 Reviewed by Geoff Garen. 31 32 Don't seed the JS random number generator from time() 33 https://bugs.webkit.org/show_bug.cgi?id=41868 34 <rdar://problem/8171025> 35 36 Switch to using the secure random number generator to 37 seed the fast random generator, and make the generator 38 be per global object. 39 40 * runtime/JSGlobalData.cpp: 41 (JSC::JSGlobalData::JSGlobalData): 42 * runtime/JSGlobalData.h: 43 * runtime/JSGlobalObject.h: 44 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): 45 (JSC::JSGlobalObject::weakRandomNumber): 46 * runtime/MathObject.cpp: 47 (JSC::mathProtoFuncRandom): 48 492010-06-18 Tucker Jay <jay.tucker@nokia.com> 50 51 Reviewed by NOBODY (OOPS!). 52 53 [Symbian] Lazy commit of memory required in JSC register file 54 https://bugs.webkit.org/show_bug.cgi?id=34349 55 56 * JavaScriptCore.pro: Added 1 new Symbian source file 57 * interpreter/RegisterFile.cpp: 58 (JSC::RegisterFile::~RegisterFile): 59 * interpreter/RegisterFile.h: 60 (JSC::RegisterFile::): 61 (JSC::RegisterFile::start): 62 (JSC::RegisterFile::end): 63 (JSC::RegisterFile::size): 64 (JSC::RegisterFile::setNumGlobals): 65 (JSC::RegisterFile::numGlobals): 66 (JSC::RegisterFile::maxGlobals): 67 (JSC::RegisterFile::lastGlobal): 68 (JSC::RegisterFile::markGlobals): 69 (JSC::RegisterFile::markCallFrames): 70 (JSC::isPageAligned): 71 (JSC::RegisterFile::RegisterFile): 72 (JSC::RegisterFile::shrink): 73 (JSC::RegisterFile::grow): 74 * wtf/symbian/RegisterFileAllocatorSymbian.cpp: Added. 75 (WTF::RegisterFileAllocator::RegisterFileAllocator): 76 Helper class to allocate memory required by RegisterFile 77 more efficiently. 78 (WTF::RegisterFileAllocator::~RegisterFileAllocator): 79 (WTF::RegisterFileAllocator::buffer): 80 (WTF::RegisterFileAllocator::grow): 81 (WTF::RegisterFileAllocator::shrink): 82 * wtf/symbian/RegisterFileAllocatorSymbian.h: Added. 83 * wtf/symbian/SymbianDefines.h: Added. 84 852010-06-19 Thiago Macieira <thiago.macieira@nokia.com> 86 87 Reviewed by Kenneth Rohde Christiansen. 88 89 Don't use __attribute__((may_alias)) with the Intel compiler, 90 as it doesn't understand it. 91 92 * wtf/Vector.h: 93 942010-06-19 Thiago Macieira <thiago.macieira@nokia.com> 95 96 Reviewed by Kenneth Rohde Christiansen. 97 98 Fix compilation with the Intel C++ compiler (11.1.072). 99 100 Like RVCT, label pointers must be void*, not const void*. 101 102 * bytecode/Opcode.h: 103 1042010-06-19 Thiago Macieira <thiago.macieira@nokia.com> 105 106 Reviewed by Kenneth Rohde Christiansen. 107 108 Add the WTF_COMPILER_INTEL for when the Intel compiler is used 109 for building. Usually, the Intel compiler masquerades as 110 another compiler in the system and gets away with it, but some 111 times specific fixes are required (such as when using language 112 extensions). 113 114 * wtf/Platform.h: 115 1162010-06-07 Benjamin Poulain <benjamin.poulain@nokia.com> 117 118 Reviewed by Simon Hausmann. 119 120 [Qt] Crash when compiling on Snow Leopard and running on Leopard 121 https://bugs.webkit.org/show_bug.cgi?id=31403 122 123 Disable the use of pthread_setname_np and other symbols 124 when targetting Leopard. 125 126 Use the defines TARGETING_XX instead of BUILDING_ON_XX 127 for features that cannot be used before Snow Leopard. 128 129 * wtf/Platform.h: 130 1312010-05-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> 132 133 Reviewed by Darin Adler. 134 135 [Qt] Disable JIT support for mingw-w64 136 https://bugs.webkit.org/show_bug.cgi?id=38747 137 138 Disale JIT for mingw-w64 as it is reportedly 139 unstable. 140 141 Thanks for Vanboxem Rruben for the investigation. 142 143 * wtf/Platform.h: 144 1452010-05-06 Fumitoshi Ukai <ukai@chromium.org> 146 147 Reviewed by Alexey Proskuryakov. 148 149 JavaScriptCore/wtf/RandomNumber.h should provide using WTF::* 150 https://bugs.webkit.org/show_bug.cgi?id=38719 151 152 * wtf/RandomNumber.h: 153 Add using directives. 154 1552010-04-28 Simon Hausmann <simon.hausmann@nokia.com>, Kent Hansen <kent.hansen@nokia.com> 156 157 Reviewed by Darin Adler. 158 159 JSC's currentThreadStackBase is not reentrant on some platforms 160 https://bugs.webkit.org/show_bug.cgi?id=37195 161 162 This function needs to be reentrant to avoid memory corruption on platforms where 163 the implementation uses global variables. 164 165 This patch adds a mutex lock where necessary and makes the Symbian implementation 166 reentrant. 167 168 * runtime/Collector.cpp: 169 (JSC::currentThreadStackBaseMutex): 170 (JSC::currentThreadStackBase): 171 1722010-04-14 Kent Hansen <kent.hansen@nokia.com> 173 174 Reviewed by Maciej Stachowiak. 175 176 Mac OS X: Use deployment target to determine whether memory tagging should be enabled 177 https://bugs.webkit.org/show_bug.cgi?id=34888 178 179 When building on (Snow) Leopard but targeting Tiger 180 (TARGETING_TIGER defined, BUILDING_ON_TIGER not defined), 181 WebKit would crash on Tiger because the tags passed to mmap 182 caused those function calls to fail. 183 184 Conversely, when building on Tiger but targeting Leopard 185 (BUILDING_ON_TIGER defined, TARGETING_LEOPARD defined), WebKit 186 would crash on Leopard because the tags passed to vm_map and 187 vm_allocate caused those function calls to fail. 188 189 Solution: Use TARGETING_TIGER rather than BUILDING_ON_TIGER to 190 govern the tag definitions. Use the same tags for vm_map and 191 vm_allocate regardless of target, since they work on 192 both. Fall back to the mmap tags that work on Tiger (that is, 193 "no tags") if targeting Tiger, since those tags also work on 194 Leopard. 195 196 * wtf/VMTags.h: 197 1982010-04-02 Ruben Van Boxem <vanboxem.ruben@gmail.com> 199 200 Reviewed by Eric Seidel. 201 202 Mingw-w64 fixes for JavaScriptCore 203 https://bugs.webkit.org/show_bug.cgi?id=35607 204 205 * runtime/Collector.cpp: use the msvc code for mingw-w64 (but not mingw-w32) 206 (JSC::Heap::allocateBlock): 207 (JSC::Heap::freeBlockPtr): 208 (JSC::currentThreadStackBase): 209 (JSC::currentThreadStackBase): 210 * wtf/Platform.h: added COMPILER(MINGW64) check to differentiate between mingw.org and mingw-w64 functions 211 2122010-03-29 Patrick Gansterer <paroga@paroga.com> 213 214 Reviewed by Darin Adler. 215 216 Corrected name of (u)int64_t compile time assert. 217 https://bugs.webkit.org/show_bug.cgi?id=36739 218 219 int64_t_is_four_bytes -> int64_t_is_eight_bytes 220 221 * os-win32/stdint.h: 222 2232010-03-29 Thomas Zander <t.zander@nokia.com> 224 225 Reviewed by Simon Hausmann. 226 227 https://bugs.webkit.org/show_bug.cgi?id=36742 228 229 gcc for Symbian doesn't support gcc extensions like atomicity.h - disable 230 231 * wtf/Threading.h: also detect os symbian 232 2332010-03-23 Mark Rowe <mrowe@apple.com> 234 235 Build fix. 236 237 * runtime/ArrayPrototype.cpp: 238 (JSC::arrayProtoFuncSplice): Some versions of GCC emit a warning about the implicit 64- to 32-bit truncation 239 that takes place here. An explicit cast is sufficient to silence it. 240 2412010-03-23 Alexey Proskuryakov <ap@apple.com> 242 243 Build fix. 244 245 * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): Fixed a typo - length doesn't 246 need to be converted with toInteger(). 247 2482010-03-23 Alexey Proskuryakov <ap@apple.com> 249 250 Reviewed by Geoff Garen. 251 252 https://bugs.webkit.org/show_bug.cgi?id=36511 253 <rdar://problem/7753498> Safari freezes when using SPUTNIK JavaScript conformance check 254 255 Test: fast/js/sputnik-S15.4.4.12_A3_T3.html 256 257 * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): We were incorrectly computing 258 the start offset, and iterated over (almost) all integers. Note that this can be fixed 259 without using doubles, but the code would be much more complicated, and there is no important 260 reason to stick to integers here. 261 2622010-03-22 Siddharth Mathur <siddharth.mathur@nokia.com> 263 264 Reviewed by Laszlo Gombos. 265 266 [Symbian] More efficient aligned memory allocation for JSC Collector 267 https://bugs.webkit.org/show_bug.cgi?id=34350 268 269 * JavaScriptCore.pri: Added 2 new Symbian source files and HAL linkage 270 271 * runtime/Collector.cpp: Reduced port-specific code and added private data member 272 (JSC::Heap::Heap): 273 (JSC::Heap::~Heap): 274 (JSC::Heap::destroy): 275 (JSC::Heap::allocateBlock): 276 (JSC::Heap::freeBlockPtr): 277 278 * runtime/Collector.h: Added private data member 279 280 * wtf/symbian: Added. 281 * wtf/symbian/BlockAllocatorSymbian.cpp: Added. 282 (WTF::AlignedBlockAllocator::AlignedBlockAllocator): Helper class to allocate 283 aligned blocks more efficiently as required by Collector 284 (WTF::AlignedBlockAllocator::alloc): 285 (WTF::AlignedBlockAllocator::free): 286 (WTF::AlignedBlockAllocator::destroy): 287 (WTF::AlignedBlockAllocator::~AlignedBlockAllocator): 288 * wtf/symbian/BlockAllocatorSymbian.h: Added. 289 2902010-03-22 Geoffrey Garen <ggaren@apple.com> 291 292 Reviewed by Sam Weinig. 293 294 Fixed <rdar://problem/7728196> REGRESSION (r46701): -(-2147483648) 295 evaluates to -2147483648 on 32 bit (35842) 296 297 Two ways to fix the same bug: 298 299 1. Check for overflow when negating, since negating the largest negative 300 int causes overflow. 301 302 2. Constant-fold even when negating a negative, since, like they say in 303 high school, "math works." 304 305 * assembler/MacroAssemblerARM.h: 306 (JSC::MacroAssemblerARM::branchNeg32): 307 * assembler/MacroAssemblerX86Common.h: 308 (JSC::MacroAssemblerX86Common::branchNeg32): Added a branching version 309 of the negate operator. 310 311 * jit/JITArithmetic.cpp: 312 (JSC::JIT::emit_op_negate): Use the branching version of the negate 313 operator to check for overflow. 314 315 (JSC::JIT::emitSlow_op_negate): Link the check for overflow to a slow case. 316 (We could emit inline code for this, since we know what the result would 317 be, but that's probably just a waste of generated code.) 318 319 * parser/Grammar.y: Constant fold even when negating a negative. 320 3212010-03-17 Mike Homey <glandium@debian.org> 322 323 Reviewed by Gustavo Noronha. 324 325 Build fix for SPARC. Fix missing macro value. 326 327 * wtf/Platform.h: 328 3292010-03-03 Mark Rowe <mrowe@apple.com> 330 331 Reviewed by Geoff Garen. 332 333 Add virtual memory tags for TCMalloc and WebCore's purgeable buffers. 334 335 * wtf/TCSystemAlloc.cpp: 336 (TryMmap): Use the VM tag. 337 * wtf/VMTags.h: Make use of VM_MEMORY_TCMALLOC and VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS. 338 3392010-03-01 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 340 341 Reviewed by Simon Hausmann. 342 343 Fix the Qt build on Mac OS X/Cocoa 64-bit 344 345 * JavaScriptCore.pri: Add missing implementation file to resolve JSC symbols 346 3472010-02-26 Janne Koskinen <janne.p.koskinen@digia.com> 348 349 Reviewed by Simon Hausmann. 350 351 [Qt] Symbian specific getCPUTime implemetation 352 https://bugs.webkit.org/show_bug.cgi?id=34742 353 354 Default implementation doesn't work on Symbian devices. 355 This change adds a proper implementation by 356 asking thread execution time from the current thread. 357 358 * runtime/TimeoutChecker.cpp: 359 (JSC::getCPUTime): 360 3612010-02-15 Gabor Loki <loki@webkit.org> 362 363 Reviewed by Gavin Barraclough. 364 365 Fix the SP at ctiOpThrowNotCaught on Thumb2 (JSVALUE32) 366 https://bugs.webkit.org/show_bug.cgi?id=34939 367 368 * jit/JITStubs.cpp: 369 3702010-02-15 Gavin Barraclough <barraclough@apple.com> 371 372 Reviewed by NOBODY (Build fix). 373 374 Add missing cast for !YARR (PPC) builds. 375 376 * runtime/RegExp.cpp: 377 (JSC::RegExp::match): 378 3792010-02-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> 380 381 Reviewed by Adam Barth. 382 383 Implement NEVER_INLINE and NO_RETURN for RVCT 384 https://bugs.webkit.org/show_bug.cgi?id=34740 385 386 * wtf/AlwaysInline.h: 387 3882010-02-12 Gavin Barraclough <barraclough@apple.com> 389 390 Reviewed by Darin Adler. 391 392 https://bugs.webkit.org/show_bug.cgi?id=33731 393 Many false leaks in release builds due to PtrAndFlags 394 395 Remove UntypedPtrAndBitfield (similar to PtrAndFlags) in UStringImpl, 396 and steal bits from the refCount instead. 397 398 * runtime/UStringImpl.cpp: 399 (JSC::UStringImpl::baseSharedBuffer): 400 (JSC::UStringImpl::~UStringImpl): 401 * runtime/UStringImpl.h: 402 (JSC::UStringImpl::cost): 403 (JSC::UStringImpl::isIdentifier): 404 (JSC::UStringImpl::setIsIdentifier): 405 (JSC::UStringImpl::ref): 406 (JSC::UStringImpl::deref): 407 (JSC::UStringImpl::UStringImpl): 408 (JSC::UStringImpl::bufferOwnerString): 409 (JSC::UStringImpl::bufferOwnership): 410 (JSC::UStringImpl::isStatic): 411 (JSC::UStringImpl::): 412 4132010-02-12 Kwang Yul Seo <skyul@company100.net> 414 415 Reviewed by Adam Barth. 416 417 Typedef both JSChar and UChar to wchar_t in RVCT. 418 https://bugs.webkit.org/show_bug.cgi?id=34560 419 420 Define both JSChar and UChar to wchar_t as the size 421 of wchar_t is 2 bytes in RVCT. 422 423 * API/JSStringRef.h: 424 * wtf/unicode/qt4/UnicodeQt4.h: 425 4262009-10-06 Yongjun Zhang <yongjun.zhang@nokia.com> 427 428 Reviewed by Simon Hausmann. 429 430 Get rid of WINSCW hack for UnSpecifiedBoolType 431 432 Add parenthesis around (RefPtr::*UnspecifiedBoolType) to make the WINSCW 433 compiler work with the default UnSpecifiedBoolType() operator. 434 435 https://bugs.webkit.org/show_bug.cgi?id=28054 436 437 * wtf/RefPtr.h: 438 4392010-02-09 Janne Koskinen <janne.p.koskinen@digia.com> 440 441 Reviewed by Laszlo Gombos. 442 443 [Qt] use nanval() for Symbian as nonInlineNaN 444 https://bugs.webkit.org/show_bug.cgi?id=34170 445 446 numeric_limits<double>::quiet_NaN is broken in Symbian 447 causing NaN to be evaluated as a number. 448 449 * runtime/JSValue.cpp: 450 (JSC::nonInlineNaN): 451 4522010-02-01 Kent Tamura <tkent@chromium.org> 453 454 Reviewed by Darin Adler. 455 456 Date.UTC() should apply TimeClip operation. 457 https://bugs.webkit.org/show_bug.cgi?id=34461 458 459 ECMAScript 5 15.9.4.3: 460 > 9 Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))). 461 462 * runtime/DateConstructor.cpp: 463 (JSC::dateUTC): Calls WTF::timeClip(). 464 4652010-02-01 Kent Tamura <tkent@chromium.org> 466 467 Reviewed by Darin Adler. 468 469 Fix a bug that Math.round() retunrs incorrect results for huge integers 470 https://bugs.webkit.org/show_bug.cgi?id=34462 471 472 * runtime/MathObject.cpp: 473 (JSC::mathProtoFuncRound): Avoid "arg + 0.5". 474 4752010-02-01 Patrick Gansterer <paroga@paroga.com> 476 477 Reviewed by Darin Adler. 478 479 [Qt] WinCE buildfix after r52729 and fix for Q_BIG_ENDIAN typo. 480 https://bugs.webkit.org/show_bug.cgi?id=34378 481 482 * wtf/Platform.h: 483 4842010-01-31 Patrick Gansterer <paroga@paroga.com> 485 486 Reviewed by Darin Adler. 487 488 Buildfix for WinCE + style fixes (TLS_OUT_OF_INDEXES is not defined). 489 https://bugs.webkit.org/show_bug.cgi?id=34380 490 491 * wtf/ThreadSpecific.h: 492 4932010-01-31 Kent Tamura <tkent@chromium.org> 494 495 Reviewed by Darin Adler. 496 497 [Windows] Fix a bug of round() with huge integral numbers 498 https://bugs.webkit.org/show_bug.cgi?id=34297 499 500 Fix a bug that round() for huge integral numbers returns incorrect 501 results. For example, round(8639999913600001) returns 502 8639999913600002 without this change though the double type can 503 represent 8639999913600001 precisely. 504 505 Math.round() of JavaScript has a similar problem. But this change 506 doesn't fix it because Math.round() doesn't use round() of 507 MathExtra.h. 508 509 * wtf/MathExtras.h: 510 (round): Avoid to do "num + 0.5" or "num - 0.5". 511 (roundf): Fixed similarly. 512 (llround): Calls round(). 513 (llroundf): Calls roundf(). 514 (lround): Calls round(). 515 (lroundf): Calls roundf(). 516 5172010-01-27 Anton Muhin <antonm@chromium.org> 518 519 Reviewed by Darin Adler. 520 521 Remove trailing \ from inline function code 522 https://bugs.webkit.org/show_bug.cgi?id=34223 523 524 * assembler/ARMv7Assembler.h: 525 (JSC::ARMThumbImmediate::countLeadingZerosPartial): 526 5272010-01-27 Kwang Yul Seo <skyul@company100.net> 528 529 Reviewed by Oliver Hunt. 530 531 [BREWMP] Add MarkStack fastMalloc implementation for platforms without VirtualAlloc or mmap. 532 https://bugs.webkit.org/show_bug.cgi?id=33582 533 534 Use fastMalloc and fastFree to implement MarkStack::allocateStack and 535 MarkStack::releaseStack for platforms without page level allocation. 536 537 * runtime/MarkStack.h: 538 (JSC::MarkStack::MarkStackArray::shrinkAllocation): 539 * runtime/MarkStackNone.cpp: Added. 540 (JSC::MarkStack::initializePagesize): 541 (JSC::MarkStack::allocateStack): 542 (JSC::MarkStack::releaseStack): 543 5442010-01-27 Kwang Yul Seo <skyul@company100.net> 545 546 Reviewed by Eric Seidel. 547 548 [BREWMP] Don't use time function 549 https://bugs.webkit.org/show_bug.cgi?id=33577 550 551 Calling time(0) in BREW devices causes a crash because time 552 is not properly ported in most devices. Cast currentTime() to 553 time_t to get the same result as time(0). 554 555 * wtf/DateMath.cpp: 556 (WTF::calculateUTCOffset): 557 5582010-01-27 Alexey Proskuryakov <ap@apple.com> 559 560 Revert r53899 (HashMap<AtomicStringImpl*, Value> key checks) and subsequent build fixes, 561 because they make SVG tests crash in release builds. 562 563 * wtf/HashMap.h: 564 (WTF::::remove): 565 * wtf/HashSet.h: 566 (WTF::::remove): 567 * wtf/HashTable.h: 568 (WTF::::add): 569 (WTF::::addPassingHashCode): 570 (WTF::::removeAndInvalidate): 571 (WTF::::remove): 572 (WTF::::rehash): 573 (WTF::::checkTableConsistency): 574 (WTF::::checkTableConsistencyExceptSize): 575 * wtf/HashTraits.h: 576 (WTF::GenericHashTraits::emptyValue): 577 (WTF::): 578 * wtf/RefPtrHashMap.h: 579 (WTF::::remove): 580 5812010-01-26 Alexey Proskuryakov <ap@apple.com> 582 583 More Windows build fixing. 584 585 * wtf/HashTraits.h: _msize takes void*, remove const qualifier from type. 586 5872010-01-26 Alexey Proskuryakov <ap@apple.com> 588 589 Windows build fix. 590 591 * wtf/HashTraits.h: Include malloc.h for _msize(). 592 5932010-01-26 Alexey Proskuryakov <ap@apple.com> 594 595 Build fix. 596 597 * wtf/HashTable.h: (WTF::HashTable::checkTableConsistencyExceptSize): Remove const from a 598 static (empty) version of this function. 599 6002010-01-26 Alexey Proskuryakov <ap@apple.com> 601 602 Reviewed by Darin Adler. 603 604 https://bugs.webkit.org/show_bug.cgi?id=34150 605 WebKit needs a mechanism to catch stale HashMap entries 606 607 It is very difficult to catch stale pointers that are HashMap keys - since a pointer's hash 608 is just its value, it is very unlikely that any observable problem is reproducible. 609 610 This extends hash table consistency checks to check that pointers are referencing allocated 611 memory blocks, and makes it possible to invoke the checks explicitly (it is not feasible 612 to enable CHECK_HASHTABLE_CONSISTENCY by default, because that affects performance too much). 613 614 * wtf/HashMap.h: (WTF::::checkConsistency): Call through to HashTable implementation. We can 615 add similar calls to HashSet and HashCountedSet, but I haven't seen hard to debug problems 616 with those yet. 617 618 * wtf/HashSet.h: (WTF::::remove): The version of checkTableConsistency that's guarded by 619 CHECK_HASHTABLE_CONSISTENCY is now called internalCheckTableConsistency(). 620 621 * wtf/HashTable.h: 622 (WTF::HashTable::internalCheckTableConsistency): 623 (WTF::HashTable::internalCheckTableConsistencyExceptSize): 624 (WTF::HashTable::checkTableConsistencyExceptSize): 625 Expose checkTableConsistency() even if CHECK_HASHTABLE_CONSISTENCY is off. 626 (WTF::::add): Updated for checkTableConsistency renaming. 627 (WTF::::addPassingHashCode): Ditto. 628 (WTF::::removeAndInvalidate): Ditto. 629 (WTF::::remove): Ditto. 630 (WTF::::rehash): Ditto. 631 (WTF::::checkTableConsistency): The assertion for !shouldExpand() was not correct - this 632 function returns true for tables with m_table == 0. 633 (WTF::::checkTableConsistencyExceptSize): Call checkValueConsistency for key. Potentially, 634 we could do the same for values. 635 636 * wtf/HashTraits.h: 637 (WTF::GenericHashTraits::checkValueConsistency): An empty function that can be overridden 638 to add checks. Currently, the only override is for pointer hashes. 639 640 * wtf/RefPtrHashMap.h: (WTF::::remove): Updated for checkTableConsistency renaming. 641 6422010-01-26 Lyon Chen <liachen@rim.com> 643 644 Reviewed by Maciej Stachowiak. 645 646 Opcode.h use const void* for Opcode cause error #1211 for RVCT compiler 647 https://bugs.webkit.org/show_bug.cgi?id=33902 648 649 * bytecode/Opcode.h: 650 6512010-01-26 Steve Falkenburg <sfalken@apple.com> 652 653 Reviewed by Oliver Hunt. 654 655 Windows build references non-existent include paths 656 https://bugs.webkit.org/show_bug.cgi?id=34175 657 658 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 659 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: 660 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: 661 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: 662 * JavaScriptCore.vcproj/testapi/testapi.vcproj: 663 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: 664 6652010-01-26 Oliver Hunt <oliver@apple.com> 666 667 Reviewed by Geoffrey Garen. 668 669 Using JavaScriptCore API with a webkit vended context can result in slow script dialog 670 https://bugs.webkit.org/show_bug.cgi?id=34172 671 672 Make the APIShim correctly increment and decrement the timeout 673 entry counter. 674 675 * API/APIShims.h: 676 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): 677 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): 678 (JSC::APICallbackShim::APICallbackShim): 679 (JSC::APICallbackShim::~APICallbackShim): 680 6812010-01-26 Simon Hausmann <simon.hausmann@nokia.com> 682 683 [Qt] Fix compilation of QtScript with non-gcc compilers 684 685 Variable length stack arrays are a gcc extension. Use QVarLengthArray 686 as a more portable solution that still tries to allocate on the stack 687 first. 688 689 * qt/api/qscriptvalue_p.h: 690 (QScriptValuePrivate::call): 691 6922010-01-26 Simon Hausmann <simon.hausmann@nokia.com> 693 694 Reviewed by Tor Arne Vestbø. 695 696 [Qt] Fix the build on platforms without JIT support. 697 698 The JIT support should be determined at compile-time via wtf/Platform.h 699 700 * qt/api/QtScript.pro: 701 7022010-01-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 703 704 Reviewed by Simon Hausmann. 705 706 First steps of the QtScript API. 707 708 Two new classes were created; QScriptEngine and QScriptValue. 709 The first should encapsulate a javascript context and the second a script 710 value. 711 712 This API is still in development, so it isn't compiled by default. 713 To trigger compilation, pass --qmakearg="CONFIG+=build-qtscript" to 714 build-webkit. 715 716 https://bugs.webkit.org/show_bug.cgi?id=32565 717 718 * qt/api/QtScript.pro: Added. 719 * qt/api/qscriptconverter_p.h: Added. 720 (QScriptConverter::toString): 721 * qt/api/qscriptengine.cpp: Added. 722 (QScriptEngine::QScriptEngine): 723 (QScriptEngine::~QScriptEngine): 724 (QScriptEngine::evaluate): 725 (QScriptEngine::collectGarbage): 726 * qt/api/qscriptengine.h: Added. 727 * qt/api/qscriptengine_p.cpp: Added. 728 (QScriptEnginePrivate::QScriptEnginePrivate): 729 (QScriptEnginePrivate::~QScriptEnginePrivate): 730 (QScriptEnginePrivate::evaluate): 731 * qt/api/qscriptengine_p.h: Added. 732 (QScriptEnginePrivate::get): 733 (QScriptEnginePrivate::collectGarbage): 734 (QScriptEnginePrivate::makeJSValue): 735 (QScriptEnginePrivate::context): 736 * qt/api/qscriptvalue.cpp: Added. 737 (QScriptValue::QScriptValue): 738 (QScriptValue::~QScriptValue): 739 (QScriptValue::isValid): 740 (QScriptValue::isBool): 741 (QScriptValue::isBoolean): 742 (QScriptValue::isNumber): 743 (QScriptValue::isNull): 744 (QScriptValue::isString): 745 (QScriptValue::isUndefined): 746 (QScriptValue::isError): 747 (QScriptValue::isObject): 748 (QScriptValue::isFunction): 749 (QScriptValue::toString): 750 (QScriptValue::toNumber): 751 (QScriptValue::toBool): 752 (QScriptValue::toBoolean): 753 (QScriptValue::toInteger): 754 (QScriptValue::toInt32): 755 (QScriptValue::toUInt32): 756 (QScriptValue::toUInt16): 757 (QScriptValue::call): 758 (QScriptValue::engine): 759 (QScriptValue::operator=): 760 (QScriptValue::equals): 761 (QScriptValue::strictlyEquals): 762 * qt/api/qscriptvalue.h: Added. 763 (QScriptValue::): 764 * qt/api/qscriptvalue_p.h: Added. 765 (QScriptValuePrivate::): 766 (QScriptValuePrivate::get): 767 (QScriptValuePrivate::QScriptValuePrivate): 768 (QScriptValuePrivate::isValid): 769 (QScriptValuePrivate::isBool): 770 (QScriptValuePrivate::isNumber): 771 (QScriptValuePrivate::isNull): 772 (QScriptValuePrivate::isString): 773 (QScriptValuePrivate::isUndefined): 774 (QScriptValuePrivate::isError): 775 (QScriptValuePrivate::isObject): 776 (QScriptValuePrivate::isFunction): 777 (QScriptValuePrivate::toString): 778 (QScriptValuePrivate::toNumber): 779 (QScriptValuePrivate::toBool): 780 (QScriptValuePrivate::toInteger): 781 (QScriptValuePrivate::toInt32): 782 (QScriptValuePrivate::toUInt32): 783 (QScriptValuePrivate::toUInt16): 784 (QScriptValuePrivate::equals): 785 (QScriptValuePrivate::strictlyEquals): 786 (QScriptValuePrivate::assignEngine): 787 (QScriptValuePrivate::call): 788 (QScriptValuePrivate::engine): 789 (QScriptValuePrivate::context): 790 (QScriptValuePrivate::value): 791 (QScriptValuePrivate::object): 792 (QScriptValuePrivate::inherits): 793 (QScriptValuePrivate::isJSBased): 794 (QScriptValuePrivate::isNumberBased): 795 (QScriptValuePrivate::isStringBased): 796 * qt/api/qtscriptglobal.h: Added. 797 * qt/tests/qscriptengine/qscriptengine.pro: Added. 798 * qt/tests/qscriptengine/tst_qscriptengine.cpp: Added. 799 (tst_QScriptEngine::tst_QScriptEngine): 800 (tst_QScriptEngine::~tst_QScriptEngine): 801 (tst_QScriptEngine::init): 802 (tst_QScriptEngine::cleanup): 803 (tst_QScriptEngine::collectGarbage): 804 (tst_QScriptEngine::evaluate): 805 * qt/tests/qscriptvalue/qscriptvalue.pro: Added. 806 * qt/tests/qscriptvalue/tst_qscriptvalue.cpp: Added. 807 (tst_QScriptValue::tst_QScriptValue): 808 (tst_QScriptValue::~tst_QScriptValue): 809 (tst_QScriptValue::init): 810 (tst_QScriptValue::cleanup): 811 (tst_QScriptValue::ctor): 812 (tst_QScriptValue::toString_data): 813 (tst_QScriptValue::toString): 814 (tst_QScriptValue::copyConstructor_data): 815 (tst_QScriptValue::copyConstructor): 816 (tst_QScriptValue::assignOperator_data): 817 (tst_QScriptValue::assignOperator): 818 (tst_QScriptValue::dataSharing): 819 (tst_QScriptValue::constructors_data): 820 (tst_QScriptValue::constructors): 821 (tst_QScriptValue::call): 822 * qt/tests/tests.pri: Added. 823 * qt/tests/tests.pro: Added. 824 8252010-01-25 Dmitry Titov <dimich@chromium.org> 826 827 Reviewed by David Levin. 828 829 Fix Chromium Linux tests: the pthread functions on Linux produce segfault if they receive 0 thread handle. 830 After r53714, we can have 0 thread handles passed to pthread_join and pthread_detach if corresponding threads 831 were already terminated and their threadMap entries cleared. 832 Add a 0 check. 833 834 * wtf/ThreadingPthreads.cpp: 835 (WTF::waitForThreadCompletion): 836 (WTF::detachThread): 837 8382010-01-24 Laszlo Gombos <laszlo.1.gombos@nokia.com> 839 840 Reviewed by Maciej Stachowiak. 841 842 Refactor JITStubs.cpp so that DEFINE_STUB_FUNCTION is only used once for each function 843 https://bugs.webkit.org/show_bug.cgi?id=33866 844 845 Place the guard USE(JSVALUE32_64) inside the body of the DEFINE_STUB_FUNCTION 846 macro for those functions that are always present. 847 848 * jit/JITStubs.cpp: 849 (JSC::DEFINE_STUB_FUNCTION): 850 8512010-01-22 Kevin Watters <kevinwatters@gmail.com> 852 853 Reviewed by Kevin Ollivier. 854 855 [wx] Remove the Bakefile build system, which is no longer being used. 856 857 https://bugs.webkit.org/show_bug.cgi?id=34022 858 859 * JavaScriptCoreSources.bkl: Removed. 860 * jscore.bkl: Removed. 861 8622010-01-22 Steve Falkenburg <sfalken@apple.com> 863 864 Reviewed by Darin Adler. 865 866 https://bugs.webkit.org/show_bug.cgi?id=34025 867 Enable client-based Geolocation abstraction for Mac, Windows AppleWebKit targets. 868 869 * Configurations/FeatureDefines.xcconfig: 870 8712010-01-22 Dmitry Titov <dimich@chromium.org> 872 873 Not reviewed, attempted Snow Leopard build fix. 874 875 * wtf/ThreadingPthreads.cpp: Add a forward declaration of a function which is not 'static'. 876 8772009-01-22 Dmitry Titov <dimich@chromium.org> 878 879 Reviewed by Maciej Stachowiak. 880 881 Fix the leak of ThreadIdentifiers in threadMap across threads. 882 https://bugs.webkit.org/show_bug.cgi?id=32689 883 884 Test is added to DumpRenderTree.mm. 885 886 * Android.mk: Added file ThreadIdentifierDataPthreads.(h|cpp) to build. 887 * Android.v8.wtf.mk: Ditto. 888 * GNUmakefile.am: Ditto. 889 * JavaScriptCore.gyp/JavaScriptCore.gyp: Ditto. 890 * JavaScriptCore.gypi: Ditto. 891 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. 892 893 * wtf/ThreadIdentifierDataPthreads.cpp: Added. Contains custom implementation of thread-specific data that uses custom destructor. 894 (WTF::ThreadIdentifierData::~ThreadIdentifierData): Removes the ThreadIdentifier from the threadMap. 895 (WTF::ThreadIdentifierData::identifier): 896 (WTF::ThreadIdentifierData::initialize): 897 (WTF::ThreadIdentifierData::destruct): Custom thread-specific destructor. Resets the value for the key again to cause second invoke. 898 (WTF::ThreadIdentifierData::initializeKeyOnceHelper): 899 (WTF::ThreadIdentifierData::initializeKeyOnce): Need to use pthread_once since initialization may come on any thread(s). 900 * wtf/ThreadIdentifierDataPthreads.h: Added. 901 (WTF::ThreadIdentifierData::ThreadIdentifierData): 902 903 * wtf/Threading.cpp: 904 (WTF::threadEntryPoint): Move initializeCurrentThreadInternal to after the lock to make 905 sure it is invoked when ThreadIdentifier is already established. 906 907 * wtf/Threading.h: Rename setThreadNameInternal -> initializeCurrentThreadInternal since it does more then only set the name now. 908 * wtf/ThreadingNone.cpp: 909 (WTF::initializeCurrentThreadInternal): Ditto. 910 * wtf/ThreadingWin.cpp: 911 (WTF::initializeCurrentThreadInternal): Ditto. 912 (WTF::initializeThreading): Ditto. 913 * wtf/gtk/ThreadingGtk.cpp: 914 (WTF::initializeCurrentThreadInternal): Ditto. 915 * wtf/qt/ThreadingQt.cpp: 916 (WTF::initializeCurrentThreadInternal): Ditto. 917 918 * wtf/ThreadingPthreads.cpp: 919 (WTF::establishIdentifierForPthreadHandle): 920 (WTF::clearPthreadHandleForIdentifier): Make it not 'static' so the ~ThreadIdentifierData() in another file can call it. 921 (WTF::initializeCurrentThreadInternal): Set the thread-specific data. The ThreadIdentifier is already established by creating thread. 922 (WTF::waitForThreadCompletion): Remove call to clearPthreadHandleForIdentifier(threadID) since it is now done in ~ThreadIdentifierData(). 923 (WTF::detachThread): Ditto. 924 (WTF::currentThread): Use the thread-specific data to get the ThreadIdentifier. It's many times faster then Mutex-protected iteration through the map. 925 Also, set the thread-specific data if called first time on the thread. 926 9272010-01-21 Kwang Yul Seo <skyul@company100.net> 928 929 Reviewed by Alexey Proskuryakov. 930 931 Add ThreadSpecific for ENABLE(SINGLE_THREADED) 932 https://bugs.webkit.org/show_bug.cgi?id=33878 933 934 Implement ThreadSpecific with a simple getter/setter 935 when ENABLE(SINGLE_THREADED) is true. 936 937 Due to the change in https://bugs.webkit.org/show_bug.cgi?id=33236, 938 an implementation of ThreadSpecific must be available to build WebKit. 939 This causes a build failure for platforms without a proper 940 ThreadSpecific implementation. 941 942 * wtf/ThreadSpecific.h: 943 (WTF::::ThreadSpecific): 944 (WTF::::~ThreadSpecific): 945 (WTF::::get): 946 (WTF::::set): 947 (WTF::::destroy): 948 9492010-01-21 Kwang Yul Seo <skyul@company100.net> 950 951 Reviewed by Maciej Stachowiak. 952 953 Add fastStrDup to FastMalloc 954 https://bugs.webkit.org/show_bug.cgi?id=33937 955 956 The new string returned by fastStrDup is obtained with fastMalloc, 957 and can be freed with fastFree. This makes the memory management 958 more consistent because we don't need to keep strdup allocated pointers 959 and free them with free(). Instead we can use fastFree everywhere. 960 961 * wtf/FastMalloc.cpp: 962 (WTF::fastStrDup): 963 * wtf/FastMalloc.h: 964 9652010-01-21 Brady Eidson <beidson@apple.com> 966 967 Reviewed by Maciej Stachowiak. 968 969 history.back() for same-document history traversals isn't synchronous as the specification states. 970 <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538 971 972 * wtf/Platform.h: Add a "HISTORY_ALWAYS_ASYNC" enable and turn it on for Chromium. 973 9742010-01-21 Geoffrey Garen <ggaren@apple.com> 975 976 Reviewed by Oliver Hunt. 977 978 Always create a prototype for automatically managed classes. 979 980 This fixes some errors where prototype chains were not correctly hooked 981 up, and also ensures that API classes work correctly with features like 982 instanceof. 983 984 * API/JSClassRef.cpp: 985 (OpaqueJSClass::create): Cleaned up some of this code. Also changed it 986 to always create a prototype class. 987 988 * API/tests/testapi.c: 989 (Derived2_class): 990 (main): Fixed a null value crash in the exception checking code. 991 * API/tests/testapi.js: Added some tests for the case where a prototype 992 chain would not be hooked up correctly. 993 9942010-01-21 Oliver Hunt <oliver@apple.com> 995 996 Reviewed by Geoff Garen. 997 998 Force JSC to create a prototype chain for API classes with a 999 parent class but no static functions. 1000 1001 * API/JSClassRef.cpp: 1002 (OpaqueJSClass::create): 1003 10042010-01-21 Kent Hansen <kent.hansen@nokia.com> 1005 1006 Reviewed by Geoffrey Garen. 1007 1008 Object.getOwnPropertyDescriptor always returns undefined for JS API objects 1009 https://bugs.webkit.org/show_bug.cgi?id=33946 1010 1011 Ideally the getOwnPropertyDescriptor() reimplementation should return an 1012 access descriptor that wraps the property getter and setter callbacks, but 1013 that approach is much more involved than returning a value descriptor. 1014 Keep it simple for now. 1015 1016 * API/JSCallbackObject.h: 1017 * API/JSCallbackObjectFunctions.h: 1018 (JSC::::getOwnPropertyDescriptor): 1019 * API/tests/testapi.js: 1020 10212010-01-20 Mark Rowe <mrowe@apple.com> 1022 1023 Build fix. 1024 1025 * wtf/FastMalloc.cpp: 1026 (WTF::TCMalloc_PageHeap::initializeScavenger): Remove unnecessary function call. 1027 10282010-01-20 Mark Rowe <mrowe@apple.com> 1029 1030 Reviewed by Oliver Hunt. 1031 1032 Use the inline i386 assembly for x86_64 as well rather than falling back to using pthread mutexes. 1033 1034 * wtf/TCSpinLock.h: 1035 (TCMalloc_SpinLock::Lock): 1036 (TCMalloc_SpinLock::Unlock): 1037 (TCMalloc_SlowLock): 1038 10392010-01-20 Mark Rowe <mrowe@apple.com> 1040 1041 Reviewed by Oliver Hunt. 1042 1043 <rdar://problem/7215063> Use GCD instead of an extra thread for FastMalloc scavenging on platforms where it is supported 1044 1045 Abstract the background scavenging slightly so that an alternate implementation that uses GCD can be used on platforms 1046 where it is supported. 1047 1048 * wtf/FastMalloc.cpp: 1049 (WTF::TCMalloc_PageHeap::init): 1050 (WTF::TCMalloc_PageHeap::initializeScavenger): 1051 (WTF::TCMalloc_PageHeap::signalScavenger): 1052 (WTF::TCMalloc_PageHeap::shouldContinueScavenging): 1053 (WTF::TCMalloc_PageHeap::Delete): 1054 (WTF::TCMalloc_PageHeap::periodicScavenge): 1055 * wtf/Platform.h: 1056 10572010-01-20 Geoffrey Garen <ggaren@apple.com> 1058 1059 Reviewed by Oliver Hunt. 1060 1061 <rdar://problem/7562708> REGRESSION(53460): Heap::destroy may not run 1062 all destructors 1063 1064 * runtime/Collector.cpp: 1065 (JSC::Heap::freeBlocks): Instead of fully marking protected objects, 1066 just set their mark bits. This prevents protected objects from keeping 1067 unprotected objects alive. Destructor order is not guaranteed, so it's 1068 OK to destroy objects pointed to by protected objects before destroying 1069 protected objects. 1070 10712010-01-19 David Levin <levin@chromium.org> 1072 1073 Reviewed by Oliver Hunt. 1074 1075 CrossThreadCopier needs to support ThreadSafeShared better. 1076 https://bugs.webkit.org/show_bug.cgi?id=33698 1077 1078 * wtf/TypeTraits.cpp: Added tests for the new type traits. 1079 * wtf/TypeTraits.h: 1080 (WTF::IsSubclass): Determines if a class is a derived from another class. 1081 (WTF::IsSubclassOfTemplate): Determines if a class is a derived from a 1082 template class (with one parameter that is unknown). 1083 (WTF::RemoveTemplate): Reveals the type for a template parameter. 1084 10852010-01-20 Steve Falkenburg <sfalken@apple.com> 1086 1087 Reviewed by Darin Adler and Adam Roben. 1088 1089 Feature defines are difficult to maintain on Windows builds 1090 https://bugs.webkit.org/show_bug.cgi?id=33883 1091 1092 FeatureDefines.vsprops are now maintained in a way similar to 1093 Configurations/FeatureDefines.xcconfig, with the added advantage 1094 of having a single FeatureDefines file across all projects. 1095 1096 * Configurations/FeatureDefines.xcconfig: Add comments about keeping feature definitions in sync. 1097 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add FeatureDefines.vsprops inherited property sheet. 1098 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add FeatureDefines.vsprops inherited property sheet. 1099 11002010-01-20 Csaba Osztrogonác <ossy@webkit.org> 1101 1102 [Qt] Unreviewed buildfix for r53547. 1103 1104 * DerivedSources.pro: 1105 11062010-01-20 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 1107 1108 Reviewed by Simon Hausmann. 1109 1110 [Qt] Make extraCompilers for generated sources depend on their scripts 1111 1112 * DerivedSources.pro: 1113 11142010-01-19 Brian Weinstein <bweinstein@apple.com> 1115 1116 Reviewed by Tim Hatcher. 1117 1118 When JavaScriptCore calls Debugger::Exception, have it pass a 1119 hasHandler variable that represents if exception is being handled 1120 in the same function (not in a parent on the call stack). 1121 1122 This just adds a new parameter, no behavior is changed. 1123 1124 * debugger/Debugger.h: 1125 * interpreter/Interpreter.cpp: 1126 (JSC::Interpreter::throwException): 1127 11282010-01-18 Maciej Stachowiak <mjs@apple.com> 1129 1130 Reviewed by Adam Barth. 1131 1132 Inline functions that are hot in DOM manipulation 1133 https://bugs.webkit.org/show_bug.cgi?id=33820 1134 1135 (3% speedup on Dromaeo DOM Core tests) 1136 1137 * runtime/WeakGCMap.h: 1138 (JSC::::get): inline 1139 11402010-01-19 Laszlo Gombos <laszlo.1.gombos@nokia.com> 1141 1142 Unreviewed build fix for JIT with RVCT. 1143 1144 Remove IMPORT statement; cti_vm_throw is already defined in JITStubs.h. 1145 Remove extra ')'. 1146 1147 * jit/JITStubs.cpp: 1148 (JSC::ctiVMThrowTrampoline): 1149 11502010-01-19 Geoffrey Garen <ggaren@apple.com> 1151 1152 Reviewed by Oliver Hunt. 1153 1154 REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/ 1155 https://bugs.webkit.org/show_bug.cgi?id=33826 1156 1157 This bug was caused by a GC-protected object being destroyed early by 1158 Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers 1159 to GC-protected memory to be valid. 1160 1161 The solution is to do two passes of tear-down in Heap::destroy. The first 1162 pass tears down all unprotected objects. The second pass ASSERTs that all 1163 previously protected objects are now unprotected, and then tears down 1164 all perviously protected objects. These two passes simulate the two passes 1165 that would have been required to free a protected object during normal GC. 1166 1167 * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap. 1168 1169 * runtime/Collector.cpp: 1170 (JSC::Heap::destroy): Moved ASSERTs to here. 1171 (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its 1172 setter to the function that does the shrinking. 1173 (JSC::Heap::freeBlocks): Implemented above algorithm. 1174 (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink. 1175 11762010-01-19 Gavin Barraclough <barraclough@apple.com> 1177 1178 Reviewed by NOBODY (build fix). 1179 1180 Reverting r53455, breaks 2 javascriptcore tests. 1181 1182 * API/JSContextRef.cpp: 1183 * runtime/Collector.cpp: 1184 (JSC::Heap::destroy): 1185 (JSC::Heap::freeBlock): 1186 (JSC::Heap::freeBlocks): 1187 (JSC::Heap::shrinkBlocks): 1188 11892010-01-18 Gavin Barraclough <barraclough@apple.com> 1190 1191 Reviewed by NOBODY (build fix). 1192 1193 Revert r53454, since it causes much sadness in this world. 1194 1195 * runtime/UString.cpp: 1196 (JSC::UString::spliceSubstringsWithSeparators): 1197 (JSC::UString::replaceRange): 1198 * runtime/UStringImpl.cpp: 1199 (JSC::UStringImpl::baseSharedBuffer): 1200 (JSC::UStringImpl::sharedBuffer): 1201 (JSC::UStringImpl::~UStringImpl): 1202 * runtime/UStringImpl.h: 1203 (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): 1204 (JSC::UntypedPtrAndBitfield::asPtr): 1205 (JSC::UntypedPtrAndBitfield::operator&=): 1206 (JSC::UntypedPtrAndBitfield::operator|=): 1207 (JSC::UntypedPtrAndBitfield::operator&): 1208 (JSC::UStringImpl::create): 1209 (JSC::UStringImpl::cost): 1210 (JSC::UStringImpl::isIdentifier): 1211 (JSC::UStringImpl::setIsIdentifier): 1212 (JSC::UStringImpl::ref): 1213 (JSC::UStringImpl::deref): 1214 (JSC::UStringImpl::checkConsistency): 1215 (JSC::UStringImpl::UStringImpl): 1216 (JSC::UStringImpl::bufferOwnerString): 1217 (JSC::UStringImpl::bufferOwnership): 1218 (JSC::UStringImpl::isStatic): 1219 * wtf/StringHashFunctions.h: 1220 (WTF::stringHash): 1221 12222010-01-18 Geoffrey Garen <ggaren@apple.com> 1223 1224 Reviewed by Oliver Hunt. 1225 1226 REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/ 1227 https://bugs.webkit.org/show_bug.cgi?id=33826 1228 1229 This bug was caused by a GC-protected object being destroyed early by 1230 Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers 1231 to GC-protected memory to be valid. 1232 1233 The solution is to do two passes of tear-down in Heap::destroy. The first 1234 pass tears down all unprotected objects. The second pass ASSERTs that all 1235 previously protected objects are now unprotected, and then tears down 1236 all perviously protected objects. These two passes simulate the two passes 1237 that would have been required to free a protected object during normal GC. 1238 1239 * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap. 1240 1241 * runtime/Collector.cpp: 1242 (JSC::Heap::destroy): Moved ASSERTs to here. 1243 (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its 1244 setter to the function that does the shrinking. 1245 (JSC::Heap::freeBlocks): Implemented above algorithm. 1246 (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink. 1247 12482010-01-18 Gavin Barraclough <barraclough@apple.com> 1249 1250 Reviewed by Oliver Hunt. 1251 1252 https://bugs.webkit.org/show_bug.cgi?id=33731 1253 Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags). 1254 1255 This break the OS X Leaks tool. Instead, free up some more bits from the refCount. 1256 1257 * runtime/UStringImpl.cpp: 1258 (JSC::UStringImpl::sharedBuffer): 1259 (JSC::UStringImpl::~UStringImpl): 1260 * runtime/UStringImpl.h: 1261 (JSC::UStringImpl::cost): 1262 (JSC::UStringImpl::checkConsistency): 1263 (JSC::UStringImpl::UStringImpl): 1264 (JSC::UStringImpl::bufferOwnerString): 1265 (JSC::UStringImpl::): 1266 * wtf/StringHashFunctions.h: 1267 (WTF::stringHash): 1268 12692010-01-18 Kent Tamura <tkent@chromium.org> 1270 1271 Reviewed by Darin Adler. 1272 1273 HTMLInputElement::valueAsDate setter support for type=month. 1274 https://bugs.webkit.org/show_bug.cgi?id=33021 1275 1276 Expose the following functions to be used by WebCore: 1277 - WTF::msToyear() 1278 - WTF::dayInYear() 1279 - WTF::monthFromDayInYear() 1280 - WTF::dayInMonthFromDayInYear() 1281 1282 * JavaScriptCore.exp: 1283 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 1284 * wtf/DateMath.cpp: 1285 (WTF::msToYear): Remove "static inline". 1286 (WTF::dayInYear): Remove "static inline". 1287 (WTF::monthFromDayInYear): Remove "static inline". 1288 (WTF::dayInMonthFromDayInYear): Remove "static inline". 1289 * wtf/DateMath.h: Declare the above functions. 1290 12912010-01-18 Darin Adler <darin@apple.com> 1292 1293 Fix build by reverting the previous change. 1294 1295 * runtime/UString.h: Rolled out the FastAllocBase base class. 1296 It was making UString larger, and therefore JSString larger, 1297 and too big for a garbage collection cell. 1298 1299 This raises the unpleasant possibility that many classes became 1300 larger because we added the FastAllocBase base class. I am 1301 worried about this, and it needs to be investigated. 1302 13032010-01-18 Zoltan Horvath <zoltan@webkit.org> 1304 1305 Reviewed by Darin Adler. 1306 1307 Allow custom memory allocation control for UString class 1308 https://bugs.webkit.org/show_bug.cgi?id=27831 1309 1310 Inherits the following class from FastAllocBase because it is 1311 instantiated by 'new' and no need to be copyable: 1312 1313 class name - instantiated at: 1314 classs UString - JavaScriptCore/runtime/UString.cpp:160 1315 1316 * runtime/UString.h: 1317 13182010-01-18 Evan Cheng <evan.cheng@apple.com> 1319 1320 Reviewed by Darin Adler. 1321 1322 Add some ALWAYS_INLINE for key functions not inlined by some versions of GCC. 1323 rdar://problem/7553780 1324 1325 * runtime/JSObject.h: 1326 (JSC::JSObject::getPropertySlot): ALWAYS_INLINE both overloads. 1327 * runtime/JSString.h: 1328 (JSC::JSString::JSString): ALWAYS_INLINE the version that takes a UString. 1329 * runtime/UString.h: 1330 (JSC::operator==): ALWAYS_INLINE the version that compares two UString objects. 1331 13322010-01-18 Csaba Osztrogonác <ossy@webkit.org> 1333 1334 Reviewed by Darin Adler. 1335 1336 Delete dftables-xxxxxxxx.in files automatically. 1337 https://bugs.webkit.org/show_bug.cgi?id=33796 1338 1339 * pcre/dftables: unlink unnecessary temporary file. 1340 13412010-01-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 1342 1343 Reviewed by Simon Hausmann. 1344 1345 [Qt] Force qmake to generate a single makefile for DerivedSources.pro 1346 1347 * DerivedSources.pro: 1348 13492010-01-18 Csaba Osztrogonác <ossy@webkit.org> 1350 1351 Rubber-stamped by Gustavo Noronha Silva. 1352 1353 Rolling out r53391 and r53392 because of random crashes on buildbots. 1354 https://bugs.webkit.org/show_bug.cgi?id=33731 1355 1356 * bytecode/CodeBlock.h: 1357 (JSC::CallLinkInfo::seenOnce): 1358 (JSC::CallLinkInfo::setSeen): 1359 (JSC::MethodCallLinkInfo::MethodCallLinkInfo): 1360 (JSC::MethodCallLinkInfo::seenOnce): 1361 (JSC::MethodCallLinkInfo::setSeen): 1362 * jit/JIT.cpp: 1363 (JSC::JIT::unlinkCall): 1364 * jit/JITPropertyAccess.cpp: 1365 (JSC::JIT::patchMethodCallProto): 1366 * runtime/UString.cpp: 1367 (JSC::UString::spliceSubstringsWithSeparators): 1368 (JSC::UString::replaceRange): 1369 * runtime/UString.h: 1370 * runtime/UStringImpl.cpp: 1371 (JSC::UStringImpl::baseSharedBuffer): 1372 (JSC::UStringImpl::sharedBuffer): 1373 (JSC::UStringImpl::~UStringImpl): 1374 * runtime/UStringImpl.h: 1375 (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): 1376 (JSC::UntypedPtrAndBitfield::asPtr): 1377 (JSC::UntypedPtrAndBitfield::operator&=): 1378 (JSC::UntypedPtrAndBitfield::operator|=): 1379 (JSC::UntypedPtrAndBitfield::operator&): 1380 (JSC::UStringImpl::create): 1381 (JSC::UStringImpl::cost): 1382 (JSC::UStringImpl::isIdentifier): 1383 (JSC::UStringImpl::setIsIdentifier): 1384 (JSC::UStringImpl::ref): 1385 (JSC::UStringImpl::deref): 1386 (JSC::UStringImpl::checkConsistency): 1387 (JSC::UStringImpl::UStringImpl): 1388 (JSC::UStringImpl::bufferOwnerString): 1389 (JSC::UStringImpl::bufferOwnership): 1390 (JSC::UStringImpl::isStatic): 1391 * wtf/StringHashFunctions.h: 1392 (WTF::stringHash): 1393 13942010-01-18 Simon Hausmann <simon.hausmann@nokia.com> 1395 1396 Reviewed by Kenneth Rohde Christiansen. 1397 1398 Fix the build with strict gcc and RVCT versions: It's not legal to cast a 1399 pointer to a function to a void* without an intermediate cast to a non-pointer 1400 type. A cast to a ptrdiff_t inbetween fixes it. 1401 1402 * runtime/JSString.h: 1403 (JSC::Fiber::JSString): 1404 14052010-01-15 Gavin Barraclough <barraclough@apple.com> 1406 1407 Reviewed by Oliver Hunt. 1408 1409 https://bugs.webkit.org/show_bug.cgi?id=33731 1410 Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags). 1411 1412 This break the OS X Leaks tool. Instead, free up some more bits from the refCount. 1413 1414 * runtime/UStringImpl.cpp: 1415 (JSC::UStringImpl::sharedBuffer): 1416 (JSC::UStringImpl::~UStringImpl): 1417 * runtime/UStringImpl.h: 1418 (JSC::UStringImpl::cost): 1419 (JSC::UStringImpl::checkConsistency): 1420 (JSC::UStringImpl::UStringImpl): 1421 (JSC::UStringImpl::bufferOwnerString): 1422 (JSC::UStringImpl::): 1423 * wtf/StringHashFunctions.h: 1424 (WTF::stringHash): 1425 14262010-01-15 Gavin Barraclough <barraclough@apple.com> 1427 1428 Reviewed by Oliver Hunt. 1429 1430 https://bugs.webkit.org/show_bug.cgi?id=33731 1431 Remove uses of PtrAndFlags from JIT data stuctures. 1432 1433 These break the OS X Leaks tool. Free up a bit in CallLinkInfo, and invalid 1434 permutation of pointer states in MethodCallLinkInfo to represent the removed bits. 1435 1436 * bytecode/CodeBlock.h: 1437 (JSC::CallLinkInfo::seenOnce): 1438 (JSC::CallLinkInfo::setSeen): 1439 (JSC::MethodCallLinkInfo::MethodCallLinkInfo): 1440 (JSC::MethodCallLinkInfo::seenOnce): 1441 (JSC::MethodCallLinkInfo::setSeen): 1442 * jit/JIT.cpp: 1443 (JSC::JIT::unlinkCall): 1444 * jit/JITPropertyAccess.cpp: 1445 (JSC::JIT::patchMethodCallProto): 1446 * runtime/UString.h: 1447 14482010-01-16 Maciej Stachowiak <mjs@apple.com> 1449 1450 Reviewed by Oliver Hunt. 1451 1452 Cache JS string values made from DOM strings (Dromaeo speedup) 1453 https://bugs.webkit.org/show_bug.cgi?id=33768 1454 <rdar://problem/7353576> 1455 1456 * runtime/JSString.h: 1457 (JSC::jsStringWithFinalizer): Added new mechanism for a string to have an optional 1458 finalizer callback, for the benefit of weak-referencing caches. 1459 (JSC::): 1460 (JSC::Fiber::JSString): 1461 (JSC::Fiber::~JSString): 1462 * runtime/JSString.cpp: 1463 (JSC::JSString::resolveRope): Clear fibers so this doesn't look like a string with a finalizer. 1464 * runtime/WeakGCMap.h: Include "Collector.h" to make this header includable by itself. 1465 14662010-01-15 Sam Weinig <sam@webkit.org> 1467 1468 Reviewed by Maciej Stachowiak. 1469 1470 Fix for <rdar://problem/7548432> 1471 Add ALWAYS_INLINE to jsLess for a 1% speedup on llvm-gcc. 1472 1473 * runtime/Operations.h: 1474 (JSC::jsLess): 1475 14762010-01-14 Geoffrey Garen <ggaren@apple.com> 1477 1478 Reviewed by Oliver Hunt. 1479 1480 REGRESISON: Google maps buttons not working properly 1481 https://bugs.webkit.org/show_bug.cgi?id=31871 1482 1483 REGRESSION(r52948): JavaScript exceptions thrown on Google Maps when 1484 getting directions for a second time 1485 https://bugs.webkit.org/show_bug.cgi?id=33446 1486 1487 SunSpider and v8 report no change. 1488 1489 * interpreter/Interpreter.cpp: 1490 (JSC::Interpreter::tryCacheGetByID): Update our cached offset in case 1491 flattening the dictionary changed any of its offsets. 1492 1493 * jit/JITStubs.cpp: 1494 (JSC::JITThunks::tryCacheGetByID): 1495 (JSC::DEFINE_STUB_FUNCTION): 1496 * runtime/Operations.h: 1497 (JSC::normalizePrototypeChain): ditto 1498 14992010-01-14 Gavin Barraclough <barraclough@apple.com> 1500 1501 Reviewed by Oliver Hunt. 1502 1503 https://bugs.webkit.org/show_bug.cgi?id=33705 1504 UStringImpl::create() should use internal storage 1505 1506 When creating a UStringImpl copying of a UChar*, we can use an internal buffer, 1507 by calling UStringImpl::tryCreateUninitialized(). 1508 1509 Also, remove duplicate of copyChars from JSString, call UStringImpl's version. 1510 1511 Small (max 0.5%) progression on Sunspidey. 1512 1513 * runtime/JSString.cpp: 1514 (JSC::JSString::resolveRope): 1515 * runtime/UStringImpl.h: 1516 (JSC::UStringImpl::create): 1517 15182010-01-14 Gavin Barraclough <barraclough@apple.com> 1519 1520 Reviewed by Sam Weinig. 1521 1522 Make naming & behaviour of UString[Impl] methods more consistent. 1523 https://bugs.webkit.org/show_bug.cgi?id=33702 1524 1525 UString::create() creates a copy of the UChar* passed, but UStringImpl::create() assumes 1526 that it should assume ownership of the provided buffer (with UString::createNonCopying() 1527 and UStringImpl::createCopying() providing the alternate behaviours). Unify on create() 1528 taking a copy of the provided buffer. For non-copying cases, use the name 'adopt', and 1529 make this method take a Vector<UChar>&. For cases where non-copying construction was being 1530 used, other than from a Vector<UChar>, change the code to allocate the storage along with 1531 the UStringImpl using UStringImpl::createUninitialized(). (The adopt() method also more 1532 closely matches that of WebCore::StringImpl). 1533 1534 Also, UString::createUninitialized() and UStringImpl::createUninitialized() have incompatible 1535 behaviours, in that the UString form sets the provided UChar* to a null or non-null value to 1536 indicate success or failure, but UStringImpl uses the returned PassRefPtr<UStringImpl> to 1537 indicate when allocation has failed (potentially leaving the output Char* uninitialized). 1538 This is also incompatible with WebCore::StringImpl's behaviour, in that 1539 StringImpl::createUninitialized() will CRASH() if unable to allocate. Some uses of 1540 createUninitialized() in JSC are unsafe, since they do not test the result for null. 1541 UStringImpl's indication is preferable, since we may want a successful call to set the result 1542 buffer to 0 (specifically, StringImpl returns 0 for the buffer where createUninitialized() 1543 returns the empty string, which seems reasonable to catch bugs early). UString's method 1544 cannot support UStringImpl's behaviour directly, since it returns an object rather than a 1545 pointer. 1546 - remove UString::createUninitialized(), replace with calls to UStringImpl::createUninitialized() 1547 - create a UStringImpl::tryCreateUninitialized() form UStringImpl::createUninitialized(), 1548 with current behaviour, make createUninitialized() crash on failure to allocate. 1549 - make cases in JSC that do not check the result call createUninitialized(), and cases that do 1550 check call tryCreateUninitialized(). 1551 1552 Rename computedHash() to existingHash(), to bring this in line wih WebCore::StringImpl. 1553 1554 * API/JSClassRef.cpp: 1555 (OpaqueJSClassContextData::OpaqueJSClassContextData): 1556 * JavaScriptCore.exp: 1557 * runtime/ArrayPrototype.cpp: 1558 (JSC::arrayProtoFuncToString): 1559 * runtime/Identifier.cpp: 1560 (JSC::CStringTranslator::translate): 1561 (JSC::UCharBufferTranslator::translate): 1562 * runtime/JSString.cpp: 1563 (JSC::JSString::resolveRope): 1564 * runtime/Lookup.cpp: 1565 (JSC::HashTable::createTable): 1566 * runtime/Lookup.h: 1567 (JSC::HashTable::entry): 1568 * runtime/StringBuilder.h: 1569 (JSC::StringBuilder::release): 1570 * runtime/StringConstructor.cpp: 1571 (JSC::stringFromCharCodeSlowCase): 1572 * runtime/StringPrototype.cpp: 1573 (JSC::substituteBackreferencesSlow): 1574 (JSC::stringProtoFuncToLowerCase): 1575 (JSC::stringProtoFuncToUpperCase): 1576 (JSC::stringProtoFuncFontsize): 1577 (JSC::stringProtoFuncLink): 1578 * runtime/Structure.cpp: 1579 (JSC::Structure::despecifyDictionaryFunction): 1580 (JSC::Structure::get): 1581 (JSC::Structure::despecifyFunction): 1582 (JSC::Structure::put): 1583 (JSC::Structure::remove): 1584 (JSC::Structure::insertIntoPropertyMapHashTable): 1585 (JSC::Structure::checkConsistency): 1586 * runtime/Structure.h: 1587 (JSC::Structure::get): 1588 * runtime/StructureTransitionTable.h: 1589 (JSC::StructureTransitionTableHash::hash): 1590 * runtime/UString.cpp: 1591 (JSC::createRep): 1592 (JSC::UString::UString): 1593 (JSC::UString::spliceSubstringsWithSeparators): 1594 (JSC::UString::replaceRange): 1595 (JSC::UString::operator=): 1596 * runtime/UString.h: 1597 (JSC::UString::adopt): 1598 (JSC::IdentifierRepHash::hash): 1599 (JSC::makeString): 1600 * runtime/UStringImpl.h: 1601 (JSC::UStringImpl::adopt): 1602 (JSC::UStringImpl::create): 1603 (JSC::UStringImpl::createUninitialized): 1604 (JSC::UStringImpl::tryCreateUninitialized): 1605 (JSC::UStringImpl::existingHash): 1606 16072010-01-13 Kent Hansen <kent.hansen@nokia.com> 1608 1609 Reviewed by Oliver Hunt. 1610 1611 JSON.stringify and JSON.parse needlessly process properties in the prototype chain 1612 https://bugs.webkit.org/show_bug.cgi?id=33053 1613 1614 * runtime/JSONObject.cpp: 1615 (JSC::Stringifier::Holder::appendNextProperty): 1616 (JSC::Walker::walk): 1617 16182010-01-13 Gavin Barraclough <barraclough@apple.com> 1619 1620 Reviewed by NOBODY (buildfix). 1621 1622 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 1623 16242010-01-13 Alexey Proskuryakov <ap@apple.com> 1625 1626 Reviewed by Darin Adler. 1627 1628 https://bugs.webkit.org/show_bug.cgi?id=33641 1629 Assertion failure in Lexer.cpp if input stream ends while in string escape 1630 1631 Test: fast/js/end-in-string-escape.html 1632 1633 * parser/Lexer.cpp: (JSC::Lexer::lex): Bail out quickly on end of stream, not giving the 1634 assertion a chance to fire. 1635 16362010-01-13 Gavin Barraclough <barraclough@apple.com> 1637 1638 Reviewed by NOBODY (buildfix). 1639 1640 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 1641 16422010-01-13 Gavin Barraclough <barraclough@apple.com> 1643 1644 Rubber stamped by Sam Weinig & Darin Adler. 1645 1646 Three quick fixes to UStringImpl. 1647 - The destroy() method can be switched back to a normal destructor; since we've switched 1648 the way we protect static strings to be using an odd ref-count the destroy() won't abort. 1649 - The cost() calculation logic was wrong. If you have multiple JSStrings wrapping substrings 1650 of a base string, they would each report the full cost of the base string to the heap. 1651 Instead we should only be reporting once for the base string. 1652 - Remove the overloaded new operator calling fastMalloc, replace this with a 'using' to pick 1653 up the implementation from the parent class. 1654 1655 * JavaScriptCore.exp: 1656 * runtime/UStringImpl.cpp: 1657 (JSC::UStringImpl::~UStringImpl): 1658 * runtime/UStringImpl.h: 1659 (JSC::UStringImpl::cost): 1660 (JSC::UStringImpl::deref): 1661 16622010-01-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 1663 1664 Reviewed by Simon Hausmann. 1665 1666 [Qt] Split the build process in two different .pro files. 1667 This allows qmake to be run once all source files are available. 1668 1669 * DerivedSources.pro: Added. 1670 * JavaScriptCore.pri: Moved source generation to DerivedSources.pro 1671 * pcre/pcre.pri: Moved source generation to DerivedSources.pro 1672 16732010-01-12 Kent Hansen <kent.hansen@nokia.com> 1674 1675 Reviewed by Geoffrey Garen. 1676 1677 [ES5] Implement Object.getOwnPropertyNames 1678 https://bugs.webkit.org/show_bug.cgi?id=32242 1679 1680 Add an extra argument to getPropertyNames() and getOwnPropertyNames() 1681 (and all reimplementations thereof) that indicates whether non-enumerable 1682 properties should be added. 1683 1684 * API/JSCallbackObject.h: 1685 * API/JSCallbackObjectFunctions.h: 1686 (JSC::::getOwnPropertyNames): 1687 * JavaScriptCore.exp: 1688 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 1689 * debugger/DebuggerActivation.cpp: 1690 (JSC::DebuggerActivation::getOwnPropertyNames): 1691 * debugger/DebuggerActivation.h: 1692 * runtime/Arguments.cpp: 1693 (JSC::Arguments::getOwnPropertyNames): 1694 * runtime/Arguments.h: 1695 * runtime/CommonIdentifiers.h: 1696 * runtime/JSArray.cpp: 1697 (JSC::JSArray::getOwnPropertyNames): 1698 * runtime/JSArray.h: 1699 * runtime/JSByteArray.cpp: 1700 (JSC::JSByteArray::getOwnPropertyNames): 1701 * runtime/JSByteArray.h: 1702 * runtime/JSFunction.cpp: 1703 (JSC::JSFunction::getOwnPropertyNames): 1704 * runtime/JSFunction.h: 1705 * runtime/JSNotAnObject.cpp: 1706 (JSC::JSNotAnObject::getOwnPropertyNames): 1707 * runtime/JSNotAnObject.h: 1708 * runtime/JSObject.cpp: 1709 (JSC::getClassPropertyNames): 1710 (JSC::JSObject::getPropertyNames): 1711 (JSC::JSObject::getOwnPropertyNames): 1712 * runtime/JSObject.h: 1713 * runtime/JSVariableObject.cpp: 1714 (JSC::JSVariableObject::getOwnPropertyNames): 1715 * runtime/JSVariableObject.h: 1716 * runtime/ObjectConstructor.cpp: 1717 (JSC::ObjectConstructor::ObjectConstructor): 1718 (JSC::objectConstructorGetOwnPropertyNames): 1719 * runtime/RegExpMatchesArray.h: 1720 (JSC::RegExpMatchesArray::getOwnPropertyNames): 1721 * runtime/StringObject.cpp: 1722 (JSC::StringObject::getOwnPropertyNames): 1723 * runtime/StringObject.h: 1724 * runtime/Structure.cpp: Rename getEnumerablePropertyNames() to getPropertyNames(), which takes an extra argument. 1725 (JSC::Structure::getPropertyNames): 1726 * runtime/Structure.h: 1727 (JSC::): 1728 17292010-01-12 Alexey Proskuryakov <ap@apple.com> 1730 1731 Reviewed by Darin Adler. 1732 1733 https://bugs.webkit.org/show_bug.cgi?id=33540 1734 Make it possible to build in debug mode with assertions disabled 1735 1736 * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): 1737 * runtime/Identifier.cpp: (JSC::Identifier::checkSameIdentifierTable): 1738 * wtf/FastMalloc.cpp: 1739 * wtf/HashTable.h: (WTF::HashTableConstIterator::checkValidity): 1740 * yarr/RegexCompiler.cpp: (JSC::Yarr::compileRegex): 1741 17422009-11-23 Yong Li <yoli@rim.com> 1743 1744 Reviewed by Adam Treat. 1745 1746 Make GIF decoder support down-sampling 1747 https://bugs.webkit.org/show_bug.cgi?id=31806 1748 1749 * platform/image-decoders/ImageDecoder.cpp: 1750 (WebCore::ImageDecoder::upperBoundScaledY): 1751 (WebCore::ImageDecoder::lowerBoundScaledY): 1752 * platform/image-decoders/ImageDecoder.h: 1753 (WebCore::RGBA32Buffer::scaledRect): 1754 (WebCore::RGBA32Buffer::setScaledRect): 1755 (WebCore::ImageDecoder::scaledSize): 1756 * platform/image-decoders/gif/GIFImageDecoder.cpp: 1757 (WebCore::GIFImageDecoder::sizeNowAvailable): 1758 (WebCore::GIFImageDecoder::initFrameBuffer): 1759 (WebCore::copyOnePixel): 1760 (WebCore::GIFImageDecoder::haveDecodedRow): 1761 (WebCore::GIFImageDecoder::frameComplete): 1762 17632010-01-12 Adam Barth <abarth@webkit.org> 1764 1765 Reviewed by Eric Seidel. 1766 1767 ecma/Date/15.9.5.12-1.js fails every night at midnight 1768 https://bugs.webkit.org/show_bug.cgi?id=28041 1769 1770 Change the test to use a concrete time instead of "now". 1771 1772 * tests/mozilla/ecma/Date/15.9.5.10-1.js: 1773 * tests/mozilla/ecma/Date/15.9.5.12-1.js: 1774 17752010-01-11 Csaba Osztrogonác <ossy@webkit.org> 1776 1777 Reviewed by Ariya Hidayat. 1778 1779 [Qt] Enable JIT and YARR_JIT if (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) 1780 1781 * wtf/Platform.h: 1782 17832010-01-11 Geoffrey Garen <ggaren@apple.com> 1784 1785 Reviewed by Alexey Proskuryakov. 1786 1787 https://bugs.webkit.org/show_bug.cgi?id=33481 1788 Uninitialized data members in ArrayStorage 1789 1790 SunSpider reports no change. 1791 1792 * runtime/JSArray.cpp: 1793 (JSC::JSArray::JSArray): Initialize missing data members in the two cases 1794 where we don't use fastZeroedMalloc, so it doesn't happen automatically. 1795 17962010-01-11 Steve Falkenburg <sfalken@apple.com> 1797 1798 Reviewed by Sam Weinig. 1799 1800 https://bugs.webkit.org/show_bug.cgi?id=33480 1801 1802 Improve debugging reliability for WTF on Windows. 1803 Store WTF static library's PDB file into a better location. 1804 1805 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 1806 18072010-01-11 Steve Falkenburg <sfalken@apple.com> 1808 1809 Windows build fix. 1810 Remove extraneous entries from def file causing build warning. 1811 1812 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 1813 18142010-01-10 Kent Hansen <kent.hansen@nokia.com> 1815 1816 Reviewed by Darin Adler. 1817 1818 RegExp.prototype.toString returns "//" for empty regular expressions 1819 https://bugs.webkit.org/show_bug.cgi?id=33319 1820 1821 "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA. 1822 1823 * runtime/RegExpPrototype.cpp: 1824 (JSC::regExpProtoFuncToString): 1825 1826 * tests/mozilla/ecma_2/RegExp/properties-001.js: 1827 (AddRegExpCases): 1828 * tests/mozilla/js1_2/regexp/toString.js: 1829 Update relevant Mozilla tests (Mozilla has had this behavior since November 2003). 1830 18312010-01-10 Darin Adler <darin@apple.com> 1832 1833 * tests/mozilla/ecma/Array/15.4.1.1.js: Added property allow-tabs. 1834 * tests/mozilla/ecma/Array/15.4.1.2.js: Added property allow-tabs. 1835 * tests/mozilla/ecma/Array/15.4.2.1-1.js: Added property allow-tabs. 1836 * tests/mozilla/ecma/Array/15.4.2.2-1.js: Added property allow-tabs. 1837 * tests/mozilla/ecma/Array/15.4.2.2-2.js: Added property allow-tabs. 1838 * tests/mozilla/ecma/Array/15.4.2.3.js: Added property allow-tabs. 1839 * tests/mozilla/ecma/Array/15.4.3.2.js: Added property allow-tabs. 1840 * tests/mozilla/ecma/Array/15.4.3.js: Added property allow-tabs. 1841 * tests/mozilla/ecma/Array/15.4.4.1.js: Added property allow-tabs. 1842 * tests/mozilla/ecma/Array/15.4.4.js: Added property allow-tabs. 1843 * tests/mozilla/ecma/LexicalConventions/7.7.4.js: Added property allow-tabs. 1844 * tests/mozilla/ecma/Math/15.8.2.13.js: Added property allow-tabs. 1845 * tests/mozilla/ecma/Math/15.8.2.16.js: Added property allow-tabs. 1846 * tests/mozilla/ecma/Math/15.8.2.18.js: Added property allow-tabs. 1847 * tests/mozilla/ecma/Math/15.8.2.2.js: Added property allow-tabs. 1848 * tests/mozilla/ecma/Math/15.8.2.4.js: Added property allow-tabs. 1849 * tests/mozilla/ecma/Math/15.8.2.5.js: Added property allow-tabs. 1850 * tests/mozilla/ecma/Math/15.8.2.7.js: Added property allow-tabs. 1851 * tests/mozilla/ecma/String/15.5.1.js: Added property allow-tabs. 1852 * tests/mozilla/ecma/String/15.5.2.js: Added property allow-tabs. 1853 * tests/mozilla/ecma/String/15.5.3.1-3.js: Added property allow-tabs. 1854 * tests/mozilla/ecma/String/15.5.3.1-4.js: Added property allow-tabs. 1855 * tests/mozilla/ecma/String/15.5.3.js: Added property allow-tabs. 1856 * tests/mozilla/ecma/TypeConversion/9.5-2.js: Added property allow-tabs. 1857 * tests/mozilla/ecma/jsref.js: Modified property allow-tabs. 1858 * tests/mozilla/ecma/shell.js: Modified property allow-tabs. 1859 * tests/mozilla/ecma_2/LexicalConventions/keywords-001.js: Added property allow-tabs. 1860 * tests/mozilla/ecma_2/RegExp/exec-001.js: Added property allow-tabs. 1861 * tests/mozilla/ecma_2/String/match-004.js: Added property allow-tabs. 1862 * tests/mozilla/ecma_2/String/replace-001.js: Added property allow-tabs. 1863 * tests/mozilla/ecma_2/String/split-002.js: Added property allow-tabs. 1864 * tests/mozilla/ecma_2/jsref.js: Modified property allow-tabs. 1865 * tests/mozilla/ecma_2/shell.js: Added property allow-tabs. 1866 * tests/mozilla/ecma_3/Date/shell.js: Modified property allow-tabs. 1867 * tests/mozilla/ecma_3/Exceptions/regress-181654.js: Added property allow-tabs. 1868 * tests/mozilla/ecma_3/RegExp/regress-209067.js: Added property allow-tabs. 1869 * tests/mozilla/ecma_3/RegExp/regress-85721.js: Added property allow-tabs. 1870 * tests/mozilla/importList.html: Added property allow-tabs. 1871 * tests/mozilla/js1_1/shell.js: Added property allow-tabs. 1872 * tests/mozilla/js1_2/Array/general1.js: Added property allow-tabs. 1873 * tests/mozilla/js1_2/Array/general2.js: Added property allow-tabs. 1874 * tests/mozilla/js1_2/Array/slice.js: Added property allow-tabs. 1875 * tests/mozilla/js1_2/Array/splice1.js: Added property allow-tabs. 1876 * tests/mozilla/js1_2/Array/splice2.js: Added property allow-tabs. 1877 * tests/mozilla/js1_2/Objects/toString-001.js: Added property allow-tabs. 1878 * tests/mozilla/js1_2/String/charCodeAt.js: Added property allow-tabs. 1879 * tests/mozilla/js1_2/String/concat.js: Modified property allow-tabs. 1880 * tests/mozilla/js1_2/String/match.js: Added property allow-tabs. 1881 * tests/mozilla/js1_2/String/slice.js: Added property allow-tabs. 1882 * tests/mozilla/js1_2/function/Function_object.js: Added property allow-tabs. 1883 * tests/mozilla/js1_2/function/Number.js: Modified property allow-tabs. 1884 * tests/mozilla/js1_2/function/String.js: Modified property allow-tabs. 1885 * tests/mozilla/js1_2/function/nesting.js: Added property allow-tabs. 1886 * tests/mozilla/js1_2/function/regexparg-1.js: Added property allow-tabs. 1887 * tests/mozilla/js1_2/function/regexparg-2-n.js: Added property allow-tabs. 1888 * tests/mozilla/js1_2/jsref.js: Added property allow-tabs. 1889 * tests/mozilla/js1_2/operator/equality.js: Added property allow-tabs. 1890 * tests/mozilla/js1_2/operator/strictEquality.js: Added property allow-tabs. 1891 * tests/mozilla/js1_2/regexp/RegExp_dollar_number.js: Added property allow-tabs. 1892 * tests/mozilla/js1_2/regexp/RegExp_input.js: Added property allow-tabs. 1893 * tests/mozilla/js1_2/regexp/RegExp_input_as_array.js: Added property allow-tabs. 1894 * tests/mozilla/js1_2/regexp/RegExp_lastIndex.js: Added property allow-tabs. 1895 * tests/mozilla/js1_2/regexp/RegExp_lastMatch.js: Added property allow-tabs. 1896 * tests/mozilla/js1_2/regexp/RegExp_lastMatch_as_array.js: Added property allow-tabs. 1897 * tests/mozilla/js1_2/regexp/RegExp_lastParen.js: Added property allow-tabs. 1898 * tests/mozilla/js1_2/regexp/RegExp_lastParen_as_array.js: Added property allow-tabs. 1899 * tests/mozilla/js1_2/regexp/RegExp_leftContext.js: Added property allow-tabs. 1900 * tests/mozilla/js1_2/regexp/RegExp_leftContext_as_array.js: Added property allow-tabs. 1901 * tests/mozilla/js1_2/regexp/RegExp_multiline.js: Added property allow-tabs. 1902 * tests/mozilla/js1_2/regexp/RegExp_multiline_as_array.js: Added property allow-tabs. 1903 * tests/mozilla/js1_2/regexp/RegExp_object.js: Added property allow-tabs. 1904 * tests/mozilla/js1_2/regexp/RegExp_rightContext.js: Added property allow-tabs. 1905 * tests/mozilla/js1_2/regexp/RegExp_rightContext_as_array.js: Added property allow-tabs. 1906 * tests/mozilla/js1_2/regexp/alphanumeric.js: Added property allow-tabs. 1907 * tests/mozilla/js1_2/regexp/asterisk.js: Added property allow-tabs. 1908 * tests/mozilla/js1_2/regexp/backslash.js: Added property allow-tabs. 1909 * tests/mozilla/js1_2/regexp/backspace.js: Added property allow-tabs. 1910 * tests/mozilla/js1_2/regexp/beginLine.js: Added property allow-tabs. 1911 * tests/mozilla/js1_2/regexp/character_class.js: Added property allow-tabs. 1912 * tests/mozilla/js1_2/regexp/compile.js: Added property allow-tabs. 1913 * tests/mozilla/js1_2/regexp/control_characters.js: Added property allow-tabs. 1914 * tests/mozilla/js1_2/regexp/digit.js: Added property allow-tabs. 1915 * tests/mozilla/js1_2/regexp/dot.js: Added property allow-tabs. 1916 * tests/mozilla/js1_2/regexp/endLine.js: Added property allow-tabs. 1917 * tests/mozilla/js1_2/regexp/everything.js: Added property allow-tabs. 1918 * tests/mozilla/js1_2/regexp/exec.js: Added property allow-tabs. 1919 * tests/mozilla/js1_2/regexp/flags.js: Added property allow-tabs. 1920 * tests/mozilla/js1_2/regexp/global.js: Added property allow-tabs. 1921 * tests/mozilla/js1_2/regexp/hexadecimal.js: Added property allow-tabs. 1922 * tests/mozilla/js1_2/regexp/ignoreCase.js: Added property allow-tabs. 1923 * tests/mozilla/js1_2/regexp/interval.js: Added property allow-tabs. 1924 * tests/mozilla/js1_2/regexp/octal.js: Added property allow-tabs. 1925 * tests/mozilla/js1_2/regexp/parentheses.js: Added property allow-tabs. 1926 * tests/mozilla/js1_2/regexp/plus.js: Added property allow-tabs. 1927 * tests/mozilla/js1_2/regexp/question_mark.js: Added property allow-tabs. 1928 * tests/mozilla/js1_2/regexp/simple_form.js: Added property allow-tabs. 1929 * tests/mozilla/js1_2/regexp/source.js: Added property allow-tabs. 1930 * tests/mozilla/js1_2/regexp/special_characters.js: Added property allow-tabs. 1931 * tests/mozilla/js1_2/regexp/string_replace.js: Added property allow-tabs. 1932 * tests/mozilla/js1_2/regexp/string_search.js: Added property allow-tabs. 1933 * tests/mozilla/js1_2/regexp/string_split.js: Added property allow-tabs. 1934 * tests/mozilla/js1_2/regexp/test.js: Added property allow-tabs. 1935 * tests/mozilla/js1_2/regexp/toString.js: Added property allow-tabs. 1936 * tests/mozilla/js1_2/regexp/vertical_bar.js: Added property allow-tabs. 1937 * tests/mozilla/js1_2/regexp/whitespace.js: Added property allow-tabs. 1938 * tests/mozilla/js1_2/regexp/word_boundary.js: Added property allow-tabs. 1939 * tests/mozilla/js1_2/shell.js: Added property allow-tabs. 1940 * tests/mozilla/js1_2/statements/break.js: Added property allow-tabs. 1941 * tests/mozilla/js1_2/statements/continue.js: Added property allow-tabs. 1942 * tests/mozilla/js1_2/statements/do_while.js: Added property allow-tabs. 1943 * tests/mozilla/js1_2/statements/switch.js: Added property allow-tabs. 1944 * tests/mozilla/js1_2/statements/switch2.js: Added property allow-tabs. 1945 * tests/mozilla/js1_3/shell.js: Added property allow-tabs. 1946 * tests/mozilla/js1_4/shell.js: Added property allow-tabs. 1947 * tests/mozilla/js1_5/Regress/regress-111557.js: Added property allow-tabs. 1948 * tests/mozilla/js1_5/Regress/regress-216320.js: Added property allow-tabs. 1949 * tests/mozilla/menuhead.html: Added property allow-tabs. 1950 * tests/mozilla/mklistpage.pl: Added property allow-tabs. 1951 * tests/mozilla/runtests.pl: Added property allow-tabs. 1952 19532010-01-08 Daniel Bates <dbates@webkit.org> 1954 1955 Reviewed by Adam Barth. 1956 1957 https://bugs.webkit.org/show_bug.cgi?id=33417 1958 1959 Cleans up style errors exposed by the patch for bug #33198. 1960 Moreover, fixes all "Weird number of spaces at line-start. Are you using a 4-space indent?" 1961 errors reported by check-webkit-style. 1962 1963 No functionality was changed. So, no new tests. 1964 1965 * wtf/Platform.h: 1966 19672010-01-08 Kent Hansen <kent.hansen@nokia.com> 1968 1969 Reviewed by Eric Seidel. 1970 1971 Don't store RegExp flags string representation 1972 https://bugs.webkit.org/show_bug.cgi?id=33321 1973 1974 It's unused; the string representation is reconstructed from flags. 1975 1976 * runtime/RegExp.cpp: 1977 (JSC::RegExp::RegExp): 1978 * runtime/RegExp.h: 1979 19802010-01-08 Geoffrey Garen <ggaren@apple.com> 1981 1982 Reviewed by Oliver Hunt. 1983 1984 Memory use grows grows possibly unbounded in this JavaScript Array test case 1985 https://bugs.webkit.org/show_bug.cgi?id=31675 1986 1987 This fixes one observed bug in this test case, which is that 1988 arrays don't report extra cost for the sparse value maps. 1989 1990 SunSpider reports a small speedup. 1991 1992 * runtime/JSArray.cpp: 1993 (JSC::JSArray::putSlowCase): Report extra memory cost for 1994 the sparse value map. 1995 * runtime/JSArray.h: 1996 19972010-01-08 Yong Li <yoli@rim.com> 1998 1999 Reviewed by Darin Adler. 2000 2001 Remove unnecessary #include from FastMalloc.cpp 2002 https://bugs.webkit.org/show_bug.cgi?id=33393 2003 2004 * wtf/FastMalloc.cpp: 2005 20062010-01-08 Eric Seidel <eric@webkit.org> 2007 2008 No review, rolling out r52983. 2009 http://trac.webkit.org/changeset/52983 2010 https://bugs.webkit.org/show_bug.cgi?id=33321 2011 2012 Broke 59 JavaScriptCore tests. I don't think Kent knew about 2013 run-javascriptcore-tests. Sadly neither does the commit-bot, 2014 yet. 2015 2016 * runtime/RegExp.cpp: 2017 (JSC::RegExp::RegExp): 2018 * runtime/RegExp.h: 2019 (JSC::RegExp::flags): 2020 20212010-01-08 Eric Seidel <eric@webkit.org> 2022 2023 No review, rolling out r52981. 2024 http://trac.webkit.org/changeset/52981 2025 https://bugs.webkit.org/show_bug.cgi?id=33319 2026 2027 Caused two JS tests to start failing: 2028 ecma_2/RegExp/properties-001.js and js1_2/regexp/toString.js 2029 2030 * runtime/RegExpPrototype.cpp: 2031 (JSC::regExpProtoFuncToString): 2032 20332010-01-08 Kent Hansen <kent.hansen@nokia.com> 2034 2035 Reviewed by Darin Adler. 2036 2037 Don't store RegExp flags string representation 2038 https://bugs.webkit.org/show_bug.cgi?id=33321 2039 2040 It's unused; the string representation is reconstructed from flags. 2041 2042 * runtime/RegExp.cpp: 2043 (JSC::RegExp::RegExp): 2044 * runtime/RegExp.h: 2045 20462010-01-08 Kent Hansen <kent.hansen@nokia.com> 2047 2048 Reviewed by Darin Adler. 2049 2050 RegExp.prototype.toString returns "//" for empty regular expressions 2051 https://bugs.webkit.org/show_bug.cgi?id=33319 2052 2053 "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA. 2054 2055 * runtime/RegExpPrototype.cpp: 2056 (JSC::regExpProtoFuncToString): 2057 20582010-01-08 Norbert Leser <norbert.leser@nokia.com> 2059 2060 Reviewed by Darin Adler. 2061 2062 RVCT compiler with "-Otime -O3" optimization tries to optimize out 2063 inline new'ed pointers that are passed as arguments. 2064 Proposed patch assigns new'ed pointer explicitly outside function call. 2065 2066 https://bugs.webkit.org/show_bug.cgi?id=33084 2067 2068 * API/JSClassRef.cpp: 2069 (OpaqueJSClass::OpaqueJSClass): 2070 (OpaqueJSClassContextData::OpaqueJSClassContextData): 2071 20722010-01-08 Gabor Loki <loki@webkit.org> 2073 2074 Reviewed by Gavin Barraclough. 2075 2076 Remove an unnecessary cacheFlush from ARM_TRADITIONAL JIT 2077 https://bugs.webkit.org/show_bug.cgi?id=33203 2078 2079 * assembler/ARMAssembler.cpp: Remove obsolete linkBranch function. 2080 (JSC::ARMAssembler::executableCopy): Inline a clean linkBranch code. 2081 * assembler/ARMAssembler.h: 2082 (JSC::ARMAssembler::getLdrImmAddress): Use inline function. 2083 (JSC::ARMAssembler::getLdrImmAddressOnPool): Ditto. 2084 (JSC::ARMAssembler::patchPointerInternal): Remove an unnecessary cacheFlush. 2085 (JSC::ARMAssembler::linkJump): Use patchPointerInternal instead of linkBranch. 2086 (JSC::ARMAssembler::linkCall): Ditto. 2087 (JSC::ARMAssembler::relinkCall): Ditto. 2088 20892010-01-07 Gabor Loki <loki@webkit.org> 2090 2091 Reviewed by Gavin Barraclough. 2092 2093 Build fix for JSVALUE32 when ENABLE_JIT_OPTIMIZE* are disabled 2094 https://bugs.webkit.org/show_bug.cgi?id=33311 2095 2096 Move compileGetDirectOffset function to common part of JSVALUE32 2097 2098 * jit/JITPropertyAccess.cpp: 2099 (JSC::JIT::compileGetDirectOffset): 2100 21012010-01-07 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2102 2103 Reviewed by Maciej Stachowiak. 2104 2105 Allow call sites to determine if ASSERT_* and LOG_* macros are operational 2106 https://bugs.webkit.org/show_bug.cgi?id=33020 2107 2108 * wtf/Assertions.h: Set ASSERT_MSG_DISABLED, FATAL_DISABLED, 2109 ERROR_DISABLED, LOG_DISABLED to 1 if the compiler does not support 2110 variadic macros. Refactor for better readibility. 2111 21122010-01-07 Daniel Bates <dbates@rim.com> 2113 2114 Reviewed by Eric Seidel. 2115 2116 https://bugs.webkit.org/show_bug.cgi?id=32987 2117 2118 Added ENABLE_XHTMLMP flag. Disabled by default. 2119 2120 * Configurations/FeatureDefines.xcconfig: 2121 21222010-01-07 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2123 2124 Reviewed by Gavin Barraclough. 2125 2126 [Symbian] Port ARM traditional JIT Trampolines to RVCT 2127 https://bugs.webkit.org/show_bug.cgi?id=30552 2128 2129 Take the GCC implementation and mechanically convert 2130 it to RVCT syntax. 2131 2132 Use 'bx rX' instead of 'mov pc, rX' when it is available. 2133 2134 Developed in cooperation with Iain Campbell and Gabor Loki. 2135 2136 * JavaScriptCore.pri: Extra step to generate RVCT stubs. The 2137 script generation intentionally executed all the time not just 2138 for RVCT targets. 2139 2140 * create_rvct_stubs: Added. Perl script to expand precompiler macros 2141 for RVCT assembler - the template is defined in JITStubs.cpp. 2142 2143 * jit/JITStubs.cpp: 2144 (JSC::ctiTrampoline): 2145 (JSC::ctiVMThrowTrampoline): 2146 (JSC::ctiOpThrowNotCaught): 2147 21482010-01-07 Geoffrey Garen <ggaren@apple.com> 2149 2150 Reviewed by Sam Weinig. 2151 2152 Fix a crash seen on the buildbots. 2153 2154 * runtime/JSGlobalObject.cpp: 2155 (JSC::JSGlobalObject::init): Disable specific function tracking here, 2156 instead of in WebCore, to ensure that the disabling happens before a 2157 specific function can be registered. 2158 21592010-01-07 Alexey Proskuryakov <ap@apple.com> 2160 2161 Mac build fix. 2162 2163 * JavaScriptCore.exp: Export new JSGlobalData static data members. 2164 21652010-01-07 Alexey Proskuryakov <ap@apple.com> 2166 2167 Reviewed by Geoffrey Garen. 2168 2169 https://bugs.webkit.org/show_bug.cgi?id=33057 2170 REGRESSION(r49365): typeof(xhr.responseText) != "string" in Windows 2171 2172 <rdar://problem/7296920> REGRESSION: WebKit fails to start PeaceKeeper benchmark 2173 2174 Test: fast/js/webcore-string-comparison.html 2175 2176 In r49365, some code was moved from JSString.cpp to JSString.h, and as a result, WebCore 2177 got a way to directly instantiate JSStrings over DLL borders. Since vftable for JSString was 2178 not exported, objects created from WebCore got a different vptr, and JavaScriptCore 2179 optimizations that relied on vptr of all JSString objects being equal failed. 2180 2181 * config.h: Added a JS_EXPORTCLASS macro for exporting classes. It's currently the same as 2182 JS_EXPORTDATA, but it clearly needed a new name. 2183 2184 * runtime/InitializeThreading.cpp: 2185 (JSC::initializeThreadingOnce): 2186 * runtime/JSGlobalData.cpp: 2187 (JSC::JSGlobalData::storeVPtrs): 2188 (JSC::JSGlobalData::JSGlobalData): 2189 (JSC::JSGlobalData::createNonDefault): 2190 (JSC::JSGlobalData::create): 2191 (JSC::JSGlobalData::sharedInstance): 2192 * runtime/JSGlobalData.h: 2193 Store vptrs just once, no need to repeatedly pick and copy them. This makes it possible to 2194 assert vptr correctness in object destructors (which don't have access to JSGlobalData, 2195 and even Heap::heap(this) will fail for fake objects created from storeVPtrs()). 2196 2197 * runtime/JSArray.cpp: (JSC::JSArray::~JSArray): Assert that vptr is what we expect it to be. 2198 It's important to assert in destructor, because MSVC changes the vptr after constructor 2199 is invoked. 2200 * runtime/JSByteArray.cpp: (JSC::JSByteArray::~JSByteArray): Ditto. 2201 * runtime/JSByteArray.h: Ditto. 2202 * runtime/JSFunction.h: Ditto. 2203 * runtime/JSFunction.cpp: (JSC::JSFunction::~JSFunction): Ditto. 2204 2205 * runtime/JSCell.h: (JSC::JSCell::setVPtr): Added a method to substitute vptr for another 2206 one. 2207 2208 * runtime/JSString.h: Export JSString class together with its vftable, and tell other 2209 libraries tp import it. This is needed on platforms that have a separate JavaScriptCore 2210 dynamic library - and on Mac, we already did the export via JavaScriptCore.exp. 2211 (JSC::JSString::~JSString): Assert tha vptr is what we expect it to be. 2212 (JSC::fixupVPtr): Store a previously saved primary vftable pointer (do nothing if building 2213 JavaScriptCore itself). 2214 (JSC::jsSingleCharacterString): Call fixupVPtr in case this is call across DLL boundary. 2215 (JSC::jsSingleCharacterSubstring): Ditto. 2216 (JSC::jsNontrivialString): Ditto. 2217 (JSC::jsString): Ditto. 2218 (JSC::jsSubstring): Ditto. 2219 (JSC::jsOwnedString): Ditto. 2220 2221 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export the new static 2222 JSGlobalData members that are used in WebCore via inline functions. 2223 22242010-01-07 Geoffrey Garen <ggaren@apple.com> 2225 2226 Reviewed by Sam Weinig. 2227 2228 Safari memory usage skyrockets using new Google AdWords interface 2229 https://bugs.webkit.org/show_bug.cgi?id=33343 2230 2231 The memory use was caused by the global object creating too many structures 2232 as it thrashed between different specific functions. 2233 2234 * runtime/Structure.cpp: 2235 (JSC::Structure::Structure): 2236 (JSC::Structure::addPropertyTransition): 2237 (JSC::Structure::changePrototypeTransition): 2238 (JSC::Structure::despecifyFunctionTransition): 2239 (JSC::Structure::addAnonymousSlotsTransition): 2240 (JSC::Structure::getterSetterTransition): 2241 (JSC::Structure::toDictionaryTransition): 2242 (JSC::Structure::addPropertyWithoutTransition): 2243 (JSC::Structure::despecifyAllFunctions): 2244 * runtime/Structure.h: 2245 (JSC::Structure::disableSpecificFunctionTracking): Track a thrash count 2246 for specific functions. Disable specific function tracking once the 2247 thrash count has been hit. 2248 22492010-01-07 Csaba Osztrogonác <ossy@webkit.org> 2250 2251 Reviewed by Simon Hausmann. 2252 2253 [Qt] Enable JIT in debug mode on win32 after r51141 fixed the crashes. 2254 2255 * JavaScriptCore.pri: 2256 22572010-01-07 Zoltan Horvath <zoltan@webkit.org> 2258 2259 Reviewed by Holger Freyther. 2260 2261 [Mac] Build fix when FAST_MALLOC_MATCH_VALIDATION=1 2262 https://bugs.webkit.org/show_bug.cgi?id=33312 2263 2264 Using of operator += cause compile error on Mac, so it is changed to 2265 "= static_cast<AllocAlignmentInteger*>(old_ptr) + 1". 2266 2267 * wtf/FastMalloc.cpp: 2268 (WTF::TCMallocStats::realloc): 2269 22702010-01-07 Zoltan Horvath <zoltan@webkit.org> 2271 2272 Reviewed by Holger Freyther. 2273 2274 [Qt] Build fix when FAST_MALLOC_MATCH_VALIDATION=1 2275 https://bugs.webkit.org/show_bug.cgi?id=33312 2276 2277 Remove pByte (committed in r42344 from #20422), because pByte doesn't 2278 exist and it is unnecessary. 2279 2280 * wtf/FastMalloc.cpp: 2281 (WTF::TCMallocStats::realloc): 2282 22832010-01-06 Gavin Barraclough <barraclough@apple.com> 2284 2285 QT build fix. 2286 2287 * runtime/Identifier.cpp: 2288 (JSC::createIdentifierTableSpecific): 2289 22902010-01-06 Gavin Barraclough <barraclough@apple.com> 2291 2292 Windows build fix part I. 2293 2294 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 2295 22962010-01-06 Dan Bernstein <mitz@apple.com> 2297 2298 Build fix 2299 2300 * runtime/Identifier.cpp: 2301 (JSC::createIdentifierTableSpecificCallback): 2302 23032010-01-05 Gavin Barraclough <barraclough@apple.com> 2304 2305 Reviewed by Sam Weinig. 2306 2307 https://bugs.webkit.org/show_bug.cgi?id=33236 2308 Remove m_identifierTable pointer from UString 2309 2310 Currently every string holds a pointer so that during destruction, 2311 if a string has been used as an identifier, it can remove itself 2312 from the table. By instead accessing the identifierTable via a 2313 thread specific tracking the table associated with the current 2314 globaldata, we can save the memory cost of this pointer. 2315 2316 * API/APIShims.h: 2317 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): 2318 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): 2319 (JSC::APICallbackShim::APICallbackShim): 2320 (JSC::APICallbackShim::~APICallbackShim): 2321 2322 - change the API shims to track the identifierTable of the current JSGlobalData. 2323 2324 * API/JSContextRef.cpp: 2325 (JSContextGroupCreate): 2326 2327 - update creation of JSGlobalData for API usage to use new create method. 2328 - fix shim instanciation bug in JSGlobalContextCreateInGroup. 2329 2330 * JavaScriptCore.exp: 2331 * runtime/Completion.cpp: 2332 (JSC::checkSyntax): 2333 (JSC::evaluate): 2334 2335 - add asserts to check the identifierTable is being tracked correctly. 2336 2337 * runtime/Identifier.cpp: 2338 (JSC::IdentifierTable::~IdentifierTable): 2339 (JSC::IdentifierTable::add): 2340 (JSC::Identifier::remove): 2341 (JSC::Identifier::checkSameIdentifierTable): 2342 (JSC::createIdentifierTableSpecificCallback): 2343 (JSC::createIdentifierTableSpecific): 2344 (JSC::createDefaultDataSpecific): 2345 2346 - Use currentIdentifierTable() instead of UStringImpl::m_identifierTable. 2347 - Define methods to access the thread specific identifier tables. 2348 2349 * runtime/Identifier.h: 2350 (JSC::ThreadIdentifierTableData::ThreadIdentifierTableData): 2351 (JSC::defaultIdentifierTable): 2352 (JSC::setDefaultIdentifierTable): 2353 (JSC::currentIdentifierTable): 2354 (JSC::setCurrentIdentifierTable): 2355 (JSC::resetCurrentIdentifierTable): 2356 2357 - Declare methods to access the thread specific identifier tables. 2358 2359 * runtime/JSGlobalData.cpp: 2360 (JSC::JSGlobalData::createNonDefault): 2361 (JSC::JSGlobalData::create): 2362 (JSC::JSGlobalData::sharedInstance): 2363 2364 - creation of JSGlobalData objects, other than for API usage, associate themselves with the current thread. 2365 2366 * runtime/JSGlobalData.h: 2367 * runtime/UStringImpl.cpp: 2368 (JSC::UStringImpl::destroy): 2369 2370 - destroy() method should be using isIdentifier(). 2371 2372 * runtime/UStringImpl.h: 2373 (JSC::UStringImpl::isIdentifier): 2374 (JSC::UStringImpl::setIsIdentifier): 2375 (JSC::UStringImpl::checkConsistency): 2376 (JSC::UStringImpl::UStringImpl): 2377 2378 - replace m_identifierTable with a single m_isIdentifier bit. 2379 2380 * wtf/StringHashFunctions.h: 2381 (WTF::stringHash): 2382 2383 - change string hash result from 32-bit to 31-bit, to free a bit in UStringImpl for m_isIdentifier. 2384 23852009-12-25 Patrick Gansterer <paroga@paroga.com> 2386 2387 Reviewed by Eric Seidel. 2388 2389 Buildfix for WinCE + style fixes. 2390 https://bugs.webkit.org/show_bug.cgi?id=32939 2391 2392 * jsc.cpp: 2393 (functionPrint): 2394 (functionQuit): 2395 (parseArguments): 2396 (fillBufferWithContentsOfFile): 2397 23982010-01-05 Patrick Gansterer <paroga@paroga.com> 2399 2400 Reviewed by Eric Seidel. 2401 2402 WinCE buildfix after r52791 (renamed PLATFORM(WINCE) to OS(WINCE)). 2403 https://bugs.webkit.org/show_bug.cgi?id=33205 2404 2405 * jit/ExecutableAllocator.h: 2406 24072010-01-05 Patrick Gansterer <paroga@paroga.com> 2408 2409 Reviewed by Darin Adler. 2410 2411 Added compiler error for unsupported platforms. 2412 https://bugs.webkit.org/show_bug.cgi?id=33112 2413 2414 * jit/JITStubs.cpp: 2415 24162010-01-05 Gabor Loki <loki@webkit.org> 2417 2418 Reviewed by Maciej Stachowiak. 2419 2420 Follow r52729 in ARMAssembler. 2421 https://bugs.webkit.org/show_bug.cgi?id=33208 2422 2423 Use WTF_ARM_ARCH_AT_LEAST instead of ARM_ARCH_VERSION 2424 2425 * assembler/ARMAssembler.cpp: 2426 (JSC::ARMAssembler::encodeComplexImm): Move tmp declaration to ARMv7 2427 * assembler/ARMAssembler.h: 2428 (JSC::ARMAssembler::): 2429 (JSC::ARMAssembler::bkpt): 2430 24312010-01-05 Maciej Stachowiak <mjs@apple.com> 2432 2433 Unreviewed build fix for Gtk+ 2434 2435 Don't use // comments in Platform.h, at least some of them seem to make the version of GCC 2436 used on the Gtk buildbot unhappy. 2437 2438 * wtf/Platform.h: 2439 24402010-01-04 Maciej Stachowiak <mjs@apple.com> 2441 2442 Reviewed by Darin Fisher. 2443 2444 Reorganize, document and rename OS() platform macros. 2445 https://bugs.webkit.org/show_bug.cgi?id=33198 2446 2447 * wtf/Platform.h: Rename, reorganize and document OS() macros. 2448 2449 Adapt to name changes. Also fixed a few incorrect OS checks. 2450 2451 * API/JSContextRef.cpp: 2452 * assembler/MacroAssemblerARM.cpp: 2453 (JSC::isVFPPresent): 2454 * assembler/MacroAssemblerX86Common.h: 2455 * bytecode/SamplingTool.cpp: 2456 * config.h: 2457 * interpreter/RegisterFile.cpp: 2458 (JSC::RegisterFile::~RegisterFile): 2459 * interpreter/RegisterFile.h: 2460 (JSC::RegisterFile::RegisterFile): 2461 (JSC::RegisterFile::grow): 2462 * jit/ExecutableAllocator.h: 2463 * jit/ExecutableAllocatorFixedVMPool.cpp: 2464 * jit/ExecutableAllocatorPosix.cpp: 2465 * jit/ExecutableAllocatorSymbian.cpp: 2466 * jit/ExecutableAllocatorWin.cpp: 2467 * jit/JITOpcodes.cpp: 2468 (JSC::JIT::privateCompileCTIMachineTrampolines): 2469 * jit/JITStubs.cpp: 2470 * jsc.cpp: 2471 (main): 2472 * parser/Grammar.y: 2473 * profiler/ProfileNode.cpp: 2474 (JSC::getCount): 2475 * runtime/Collector.cpp: 2476 (JSC::Heap::Heap): 2477 (JSC::Heap::allocateBlock): 2478 (JSC::Heap::freeBlockPtr): 2479 (JSC::currentThreadStackBase): 2480 (JSC::getCurrentPlatformThread): 2481 (JSC::suspendThread): 2482 (JSC::resumeThread): 2483 (JSC::getPlatformThreadRegisters): 2484 (JSC::otherThreadStackPointer): 2485 * runtime/Collector.h: 2486 * runtime/DateConstructor.cpp: 2487 * runtime/DatePrototype.cpp: 2488 (JSC::formatLocaleDate): 2489 * runtime/InitializeThreading.cpp: 2490 (JSC::initializeThreading): 2491 * runtime/MarkStack.h: 2492 (JSC::MarkStack::MarkStackArray::shrinkAllocation): 2493 * runtime/MarkStackPosix.cpp: 2494 * runtime/MarkStackSymbian.cpp: 2495 * runtime/MarkStackWin.cpp: 2496 * runtime/StringPrototype.cpp: 2497 (JSC::stringProtoFuncLastIndexOf): 2498 * runtime/TimeoutChecker.cpp: 2499 (JSC::getCPUTime): 2500 * runtime/UString.cpp: 2501 (JSC::UString::from): 2502 * wtf/Assertions.cpp: 2503 * wtf/Assertions.h: 2504 * wtf/CurrentTime.cpp: 2505 (WTF::lowResUTCTime): 2506 * wtf/CurrentTime.h: 2507 (WTF::getLocalTime): 2508 * wtf/DateMath.cpp: 2509 * wtf/FastMalloc.cpp: 2510 (WTF::TCMalloc_ThreadCache::InitModule): 2511 (WTF::TCMallocStats::): 2512 * wtf/FastMalloc.h: 2513 * wtf/MathExtras.h: 2514 * wtf/RandomNumber.cpp: 2515 (WTF::randomNumber): 2516 * wtf/RandomNumberSeed.h: 2517 (WTF::initializeRandomNumberGenerator): 2518 * wtf/StringExtras.h: 2519 * wtf/TCSpinLock.h: 2520 (TCMalloc_SpinLock::Unlock): 2521 (TCMalloc_SlowLock): 2522 * wtf/TCSystemAlloc.cpp: 2523 * wtf/ThreadSpecific.h: 2524 (WTF::::destroy): 2525 * wtf/Threading.h: 2526 * wtf/ThreadingPthreads.cpp: 2527 (WTF::initializeThreading): 2528 (WTF::isMainThread): 2529 * wtf/ThreadingWin.cpp: 2530 (WTF::wtfThreadEntryPoint): 2531 (WTF::createThreadInternal): 2532 * wtf/VMTags.h: 2533 * wtf/unicode/icu/CollatorICU.cpp: 2534 (WTF::Collator::userDefault): 2535 * wtf/win/MainThreadWin.cpp: 2536 (WTF::initializeMainThreadPlatform): 2537 25382010-01-04 Gustavo Noronha Silva <gns@gnome.org> 2539 2540 Add missing files to the build system - make distcheck build fix. 2541 2542 * GNUmakefile.am: 2543 25442010-01-04 Gavin Barraclough <barraclough@apple.com> 2545 2546 Reviewed by Sam Weinig, additional coding by Mark Rowe. 2547 2548 https://bugs.webkit.org/show_bug.cgi?id=33163 2549 Add string hashing functions to WTF. 2550 Use WTF's string hashing functions from UStringImpl. 2551 2552 * GNUmakefile.am: 2553 * JavaScriptCore.exp: 2554 * JavaScriptCore.gypi: 2555 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 2556 * JavaScriptCore.xcodeproj/project.pbxproj: 2557 * runtime/UStringImpl.cpp: 2558 * runtime/UStringImpl.h: 2559 (JSC::UStringImpl::computeHash): 2560 * wtf/HashFunctions.h: 2561 * wtf/StringHashFunctions.h: Added. 2562 (WTF::stringHash): 2563 25642010-01-04 Dmitry Titov <dimich@chromium.org> 2565 2566 Not reviewed, attempt to fix ARM bulid. 2567 2568 * wtf/Platform.h: 2569 25702010-01-04 Gavin Barraclough <barraclough@apple.com> 2571 2572 Rubber stamped by Geoff Garen. 2573 2574 Add an 'isIdentifier' to UStringImpl, use this where appropriate 2575 (where previously 'identifierTable' was being tested). 2576 2577 * API/JSClassRef.cpp: 2578 (OpaqueJSClass::~OpaqueJSClass): 2579 (OpaqueJSClassContextData::OpaqueJSClassContextData): 2580 * runtime/Identifier.cpp: 2581 (JSC::Identifier::addSlowCase): 2582 * runtime/Identifier.h: 2583 (JSC::Identifier::add): 2584 * runtime/PropertyNameArray.cpp: 2585 (JSC::PropertyNameArray::add): 2586 * runtime/UStringImpl.h: 2587 (JSC::UStringImpl::isIdentifier): 2588 25892010-01-04 Gavin Barraclough <barraclough@apple.com> 2590 2591 Reviewed by Sam "Shimmey Shimmey" Weinig. 2592 2593 https://bugs.webkit.org/show_bug.cgi?id=33158 2594 Refactor JSC API entry/exit to use RAII instead of copy/pasting code. 2595 Make it easier to change set of actions taken when passing across the API boundary. 2596 2597 * API/APIShims.h: Added. 2598 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): 2599 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): 2600 (JSC::APIEntryShim::APIEntryShim): 2601 (JSC::APICallbackShim::APICallbackShim): 2602 (JSC::APICallbackShim::~APICallbackShim): 2603 * API/JSBase.cpp: 2604 (JSEvaluateScript): 2605 (JSCheckScriptSyntax): 2606 (JSGarbageCollect): 2607 (JSReportExtraMemoryCost): 2608 * API/JSCallbackConstructor.cpp: 2609 (JSC::constructJSCallback): 2610 * API/JSCallbackFunction.cpp: 2611 (JSC::JSCallbackFunction::call): 2612 * API/JSCallbackObjectFunctions.h: 2613 (JSC::::init): 2614 (JSC::::getOwnPropertySlot): 2615 (JSC::::put): 2616 (JSC::::deleteProperty): 2617 (JSC::::construct): 2618 (JSC::::hasInstance): 2619 (JSC::::call): 2620 (JSC::::getOwnPropertyNames): 2621 (JSC::::toNumber): 2622 (JSC::::toString): 2623 (JSC::::staticValueGetter): 2624 (JSC::::callbackGetter): 2625 * API/JSContextRef.cpp: 2626 * API/JSObjectRef.cpp: 2627 (JSObjectMake): 2628 (JSObjectMakeFunctionWithCallback): 2629 (JSObjectMakeConstructor): 2630 (JSObjectMakeFunction): 2631 (JSObjectMakeArray): 2632 (JSObjectMakeDate): 2633 (JSObjectMakeError): 2634 (JSObjectMakeRegExp): 2635 (JSObjectGetPrototype): 2636 (JSObjectSetPrototype): 2637 (JSObjectHasProperty): 2638 (JSObjectGetProperty): 2639 (JSObjectSetProperty): 2640 (JSObjectGetPropertyAtIndex): 2641 (JSObjectSetPropertyAtIndex): 2642 (JSObjectDeleteProperty): 2643 (JSObjectCallAsFunction): 2644 (JSObjectCallAsConstructor): 2645 (JSObjectCopyPropertyNames): 2646 (JSPropertyNameArrayRelease): 2647 (JSPropertyNameAccumulatorAddName): 2648 * API/JSValueRef.cpp: 2649 (JSValueGetType): 2650 (JSValueIsUndefined): 2651 (JSValueIsNull): 2652 (JSValueIsBoolean): 2653 (JSValueIsNumber): 2654 (JSValueIsString): 2655 (JSValueIsObject): 2656 (JSValueIsObjectOfClass): 2657 (JSValueIsEqual): 2658 (JSValueIsStrictEqual): 2659 (JSValueIsInstanceOfConstructor): 2660 (JSValueMakeUndefined): 2661 (JSValueMakeNull): 2662 (JSValueMakeBoolean): 2663 (JSValueMakeNumber): 2664 (JSValueMakeString): 2665 (JSValueToBoolean): 2666 (JSValueToNumber): 2667 (JSValueToStringCopy): 2668 (JSValueToObject): 2669 (JSValueProtect): 2670 (JSValueUnprotect): 2671 * JavaScriptCore.xcodeproj/project.pbxproj: 2672 26732010-01-04 Dan Bernstein <mitz@apple.com> 2674 2675 Reviewed by Ada Chan and Mark Rowe. 2676 2677 Updated copyright string 2678 2679 * Info.plist: 2680 * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist: 2681 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: 2682 26832010-01-04 Adam Roben <aroben@apple.com> 2684 2685 No review, rolling out r52741. 2686 http://trac.webkit.org/changeset/52741 2687 https://bugs.webkit.org/show_bug.cgi?id=33056 2688 2689 * wtf/AlwaysInline.h: 2690 26912010-01-04 Patrick Gansterer <paroga@paroga.com> 2692 2693 Reviewed by Darin Adler. 2694 2695 Add cacheFlush support for WinCE 2696 https://bugs.webkit.org/show_bug.cgi?id=33110 2697 2698 * jit/ExecutableAllocator.h: 2699 (JSC::ExecutableAllocator::cacheFlush): 2700 27012010-01-04 Patrick Gansterer <paroga@paroga.com> 2702 2703 Reviewed by Adam Roben. 2704 2705 Implement NO_RETURN for COMPILER(MSVC). 2706 https://bugs.webkit.org/show_bug.cgi?id=33056 2707 2708 * wtf/AlwaysInline.h: 2709 27102010-01-04 Maciej Stachowiak <mjs@apple.com> 2711 2712 Reviewed by Simon Hausmann. 2713 2714 Fix some PLATFORM(*_ENDIAN) uses to CPU() 2715 https://bugs.webkit.org/show_bug.cgi?id=33148 2716 2717 * runtime/JSCell.cpp: 2718 (JSC::): 2719 * runtime/JSValue.h: 2720 (JSC::JSValue::): 2721 27222010-01-04 Maciej Stachowiak <mjs@apple.com> 2723 2724 Reviewed by Adam Barth. 2725 2726 Document CPU() macros in comments. 2727 https://bugs.webkit.org/show_bug.cgi?id=33147 2728 2729 * wtf/Platform.h: 2730 27312010-01-04 Maciej Stachowiak <mjs@apple.com> 2732 2733 Reviewed by Adam Barth. 2734 2735 Reorganize, document and rename CPU() platform macros. 2736 https://bugs.webkit.org/show_bug.cgi?id=33145 2737 ExecutableAllocatorSymbian appears to have buggy ARM version check 2738 https://bugs.webkit.org/show_bug.cgi?id=33138 2739 2740 * wtf/Platform.h: 2741 Rename all macros related to detection of particular CPUs or 2742 classes of CPUs to CPU(), reorganize and document them. 2743 2744 All remaining changes are adapting to the renames, plus fixing the 2745 second bug cited above. 2746 2747 * assembler/ARMAssembler.cpp: 2748 * assembler/ARMAssembler.h: 2749 * assembler/ARMv7Assembler.h: 2750 * assembler/AbstractMacroAssembler.h: 2751 (JSC::AbstractMacroAssembler::Imm32::Imm32): 2752 * assembler/MacroAssembler.h: 2753 * assembler/MacroAssemblerARM.cpp: 2754 * assembler/MacroAssemblerARM.h: 2755 * assembler/MacroAssemblerCodeRef.h: 2756 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): 2757 * assembler/MacroAssemblerX86.h: 2758 * assembler/MacroAssemblerX86Common.h: 2759 * assembler/MacroAssemblerX86_64.h: 2760 * assembler/X86Assembler.h: 2761 (JSC::X86Registers::): 2762 (JSC::X86Assembler::): 2763 (JSC::X86Assembler::movl_mEAX): 2764 (JSC::X86Assembler::movl_EAXm): 2765 (JSC::X86Assembler::repatchLoadPtrToLEA): 2766 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM): 2767 * jit/ExecutableAllocator.h: 2768 * jit/ExecutableAllocatorFixedVMPool.cpp: 2769 * jit/ExecutableAllocatorPosix.cpp: 2770 * jit/ExecutableAllocatorSymbian.cpp: 2771 (JSC::ExecutableAllocator::intializePageSize): 2772 * jit/JIT.cpp: 2773 * jit/JIT.h: 2774 * jit/JITArithmetic.cpp: 2775 * jit/JITInlineMethods.h: 2776 (JSC::JIT::beginUninterruptedSequence): 2777 (JSC::JIT::restoreArgumentReferenceForTrampoline): 2778 (JSC::JIT::emitCount): 2779 * jit/JITOpcodes.cpp: 2780 (JSC::JIT::privateCompileCTIMachineTrampolines): 2781 * jit/JITPropertyAccess.cpp: 2782 (JSC::JIT::privateCompileGetByIdProto): 2783 (JSC::JIT::privateCompileGetByIdProtoList): 2784 (JSC::JIT::privateCompileGetByIdChainList): 2785 (JSC::JIT::privateCompileGetByIdChain): 2786 * jit/JITStubs.cpp: 2787 (JSC::JITThunks::JITThunks): 2788 * jit/JITStubs.h: 2789 * runtime/Collector.cpp: 2790 (JSC::currentThreadStackBase): 2791 (JSC::getPlatformThreadRegisters): 2792 (JSC::otherThreadStackPointer): 2793 * wrec/WREC.h: 2794 * wrec/WRECGenerator.cpp: 2795 (JSC::WREC::Generator::generateEnter): 2796 (JSC::WREC::Generator::generateReturnSuccess): 2797 (JSC::WREC::Generator::generateReturnFailure): 2798 * wrec/WRECGenerator.h: 2799 * wtf/FastMalloc.cpp: 2800 * wtf/TCSpinLock.h: 2801 (TCMalloc_SpinLock::Lock): 2802 (TCMalloc_SpinLock::Unlock): 2803 (TCMalloc_SlowLock): 2804 * wtf/Threading.h: 2805 * wtf/dtoa.cpp: 2806 * yarr/RegexJIT.cpp: 2807 (JSC::Yarr::RegexGenerator::generateEnter): 2808 (JSC::Yarr::RegexGenerator::generateReturn): 2809 * yarr/RegexJIT.h: 2810 28112010-01-04 Maciej Stachowiak <mjs@apple.com> 2812 2813 Reviewed by Adam Barth. 2814 2815 Clean up COMPILER macros and remove unused ones. 2816 https://bugs.webkit.org/show_bug.cgi?id=33132 2817 2818 Removed values are COMPILER(BORLAND) and COMPILER(CYGWIN) - they were 2819 not used anywhere. 2820 2821 * wtf/Platform.h: 2822 28232010-01-03 Maciej Stachowiak <mjs@apple.com> 2824 2825 Reviewed by Eric Seidel. 2826 2827 Update wtf/Platform.h to document the new system for porting macros. 2828 https://bugs.webkit.org/show_bug.cgi?id=33130 2829 2830 * wtf/Platform.h: 2831 28322009-12-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2833 2834 Reviewed by Maciej Stachowiak. 2835 2836 PLATFORM(CAIRO) should be defined by WIN_CAIRO define 2837 https://bugs.webkit.org/show_bug.cgi?id=22250 2838 2839 * wtf/Platform.h: Define WTF_PLATFORM_CAIRO for GTK port only 2840 For the WinCairo port WTF_PLATFORM_CAIRO is already defined in config.h 2841 28422009-12-28 Shu Chang <Chang.Shu@nokia.com> 2843 2844 Reviewed by Laszlo Gombos. 2845 2846 [Qt] Delete ThreadPrivate instance after it is finished. 2847 https://bugs.webkit.org/show_bug.cgi?id=32614 2848 2849 * wtf/qt/ThreadingQt.cpp: 2850 (WTF::ThreadMonitor::instance): 2851 (WTF::ThreadMonitor::threadFinished): 2852 (WTF::createThreadInternal): 2853 (WTF::detachThread): 2854 28552009-12-28 Patrick Gansterer <paroga@paroga.com> 2856 2857 Reviewed by Maciej Stachowiak. 2858 2859 Cleanup of #define JS_EXPORT. 2860 2861 * API/JSBase.h: 2862 28632009-12-27 Patrick Gansterer <paroga@paroga.com> 2864 2865 Reviewed by Adam Barth. 2866 2867 WinCE buildfix (HWND_MESSAGE isn't supported there) 2868 2869 * wtf/win/MainThreadWin.cpp: 2870 (WTF::initializeMainThreadPlatform): 2871 28722009-12-27 Patrick Gansterer <paroga@paroga.com> 2873 2874 Reviewed by Adam Barth. 2875 2876 Added a file with WinMain function to link agains in WinCE. 2877 2878 * os-win32/WinMain.cpp: Added. 2879 (convertToUtf8): 2880 (WinMain): 2881 28822009-12-24 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2883 2884 Unreviewed; revert of r52550. 2885 2886 The change regressed the following LayoutTests for QtWebKit. 2887 2888 fast/workers/worker-call.html -> crashed 2889 fast/workers/worker-close.html -> crashed 2890 2891 * wtf/qt/ThreadingQt.cpp: 2892 (WTF::waitForThreadCompletion): 2893 (WTF::detachThread): 2894 28952009-12-24 Shu Chang <Chang.Shu@nokia.com> 2896 2897 Reviewed by Laszlo Gombos. 2898 2899 [Qt] Fix memory leak by deleting instance of ThreadPrivate 2900 in function waitForThreadCompletion(), synchronously, or in 2901 detachThread(), asynchronously. 2902 https://bugs.webkit.org/show_bug.cgi?id=32614 2903 2904 * wtf/qt/ThreadingQt.cpp: 2905 (WTF::waitForThreadCompletion): 2906 (WTF::detachThread): 2907 29082009-12-23 Kwang Yul Seo <skyul@company100.net> 2909 2910 Reviewed by Laszlo Gombos. 2911 2912 Include stddef.h for ptrdiff_t 2913 https://bugs.webkit.org/show_bug.cgi?id=32891 2914 2915 ptrdiff_t is typedef-ed in stddef.h. 2916 Include stddef.h in jit/ExecutableAllocator.h. 2917 2918 * jit/ExecutableAllocator.h: 2919 29202009-12-23 Patrick Gansterer <paroga@paroga.com> 2921 2922 Reviewed by Eric Seidel. 2923 2924 Buildfix after r47092. 2925 2926 * wtf/wince/MemoryManager.cpp: 2927 (WTF::tryFastMalloc): 2928 (WTF::tryFastZeroedMalloc): 2929 (WTF::tryFastCalloc): 2930 (WTF::tryFastRealloc): 2931 29322009-12-23 Kent Tamura <tkent@chromium.org> 2933 2934 Reviewed by Darin Adler. 2935 2936 HTMLInputElement::valueAsDate getter support. 2937 https://bugs.webkit.org/show_bug.cgi?id=32876 2938 2939 Expose dateToDaysFrom1970(). 2940 2941 * JavaScriptCore.exp: 2942 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 2943 * wtf/DateMath.cpp: 2944 (WTF::dateToDaysFrom1970): 2945 * wtf/DateMath.h: 2946 29472009-12-22 Darin Adler <darin@apple.com> 2948 2949 Reviewed by Mark Rowe. 2950 2951 Turn off datagrid by default, at least for all platforms Apple ships. 2952 The datagrid implementation isn't ready for general web use yet. 2953 2954 * Configurations/FeatureDefines.xcconfig: Turn off datagrid by default. 2955 29562009-12-22 Steve Block <steveblock@google.com> 2957 2958 Reviewed by David Levin. 2959 2960 Updates Android's scheduleDispatchFunctionsOnMainThread() to use new 2961 AndroidThreading class, rather than using JavaSharedClient directly. 2962 This fixes the current layering violation. 2963 https://bugs.webkit.org/show_bug.cgi?id=32651 2964 2965 The pattern is copied from Chromium, which uses the ChromiumThreading 2966 class. This patch also fixes the style in ChromiumThreading.h. 2967 2968 * wtf/android/AndroidThreading.h: Added. Declares AndroidThreading. 2969 * wtf/android/MainThreadAndroid.cpp: Modified 2970 (WTF::scheduleDispatchFunctionsOnMainThread): Uses AndroidThreading. 2971 * wtf/chromium/ChromiumThreading.h: Modified. Fixes style. 2972 29732009-12-22 Gavin Barraclough <barraclough@apple.com> 2974 2975 Reviewed by Sam Weinig. 2976 2977 Fix a couple of problems with UntypedPtrAndBitfield. 2978 2979 Add a m_leaksPtr to reduce false positives from leaks in debug builds 2980 (this isn't perfect because we'd like a solution for release builds, 2981 but this is now at least as good as a PtrAndFlags would be). 2982 2983 Switch SmallStringsto use a regular string for the base, rather than 2984 a static one. UntypedPtrAndBitfield assumes all strings are at least 2985 8 byte aligned; this migt not be true of static strings. Shared buffers 2986 are heap allocated, as are all UStringImpls other than static strings. 2987 Static strings cannot end up being the owner string of substrings, 2988 since the only static strings are length 0. 2989 2990 * runtime/SmallStrings.cpp: 2991 (JSC::SmallStringsStorage::SmallStringsStorage): 2992 * runtime/UStringImpl.h: 2993 (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): 2994 (JSC::UStringImpl::UStringImpl): 2995 29962009-12-22 Kwang Yul Seo <skyul@company100.net> 2997 2998 Reviewed by Darin Adler. 2999 3000 RVCT (__ARMCC_VERSION < 400000) does not provide strcasecmp and strncasecmp 3001 https://bugs.webkit.org/show_bug.cgi?id=32857 3002 3003 Add implementation of strcasecmp and strncasecmp for RVCT < 4.0 3004 because earlier versions of RVCT 4.0 does not provide these functions. 3005 3006 * wtf/StringExtras.cpp: Added. 3007 (strcasecmp): 3008 (strncasecmp): 3009 * wtf/StringExtras.h: 3010 30112009-12-22 Kwang Yul Seo <skyul@company100.net> 3012 3013 Reviewed by Darin Adler. 3014 3015 Define ALWAYS_INLINE and WTF_PRIVATE_INLINE to __forceinline for RVCT 3016 https://bugs.webkit.org/show_bug.cgi?id=32853 3017 3018 Use __forceinline forces RVCT to compile a C or C++ function 3019 inline. The compiler attempts to inline the function, regardless of 3020 the characteristics of the function. 3021 3022 * wtf/AlwaysInline.h: 3023 * wtf/FastMalloc.h: 3024 30252009-12-21 Simon Hausmann <simon.hausmann@nokia.com> 3026 3027 Prospective GTK build fix: Add UStringImpl.cpp/h to the build. 3028 3029 * GNUmakefile.am: 3030 30312009-12-21 Simon Hausmann <simon.hausmann@nokia.com> 3032 3033 Fix the Qt build, add UStringImpl.cpp to the build. 3034 3035 * JavaScriptCore.pri: 3036 30372009-12-21 Gavin Barraclough <barraclough@apple.com> 3038 3039 Windows Build fix part 5. 3040 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 3041 30422009-12-21 Gavin Barraclough <barraclough@apple.com> 3043 3044 Reviewed by NOBODY (build fix). 3045 Fix breakage of world introduced in build fix to r52463. 3046 3047 * runtime/UStringImpl.h: 3048 30492009-12-21 Gavin Barraclough <barraclough@apple.com> 3050 3051 Reviewed by Darin Adler. 3052 3053 https://bugs.webkit.org/show_bug.cgi?id=32831 3054 Replace UString::Rep implementation, following introduction of ropes to JSC. 3055 3056 * Remove redundant overcapacity mechanisms. 3057 * Reduce memory cost of Rep's. 3058 * Add an inline storage mechanism akin to that in WebCore's StringImpl. 3059 3060 ~1% Sunspider progression. 3061 3062 * JavaScriptCore.exp: 3063 * JavaScriptCore.xcodeproj/project.pbxproj: 3064 * runtime/JSString.cpp: 3065 (JSC::JSString::resolveRope): 3066 * runtime/SmallStrings.cpp: 3067 (JSC::SmallStringsStorage::SmallStringsStorage): 3068 * runtime/UString.cpp: 3069 (JSC::initializeUString): 3070 (JSC::createRep): 3071 (JSC::UString::createFromUTF8): 3072 (JSC::UString::createUninitialized): 3073 (JSC::UString::spliceSubstringsWithSeparators): 3074 (JSC::UString::replaceRange): 3075 (JSC::UString::ascii): 3076 (JSC::UString::operator=): 3077 (JSC::UString::toStrictUInt32): 3078 (JSC::equal): 3079 * runtime/UString.h: 3080 (JSC::UString::isEmpty): 3081 (JSC::UString::cost): 3082 (JSC::makeString): 3083 * runtime/UStringImpl.cpp: Added. 3084 (JSC::UStringImpl::baseSharedBuffer): 3085 (JSC::UStringImpl::sharedBuffer): 3086 (JSC::UStringImpl::destroy): 3087 (JSC::UStringImpl::computeHash): 3088 * runtime/UStringImpl.h: Added. 3089 (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): 3090 (JSC::UntypedPtrAndBitfield::asPtr): 3091 (JSC::UntypedPtrAndBitfield::operator&=): 3092 (JSC::UntypedPtrAndBitfield::operator|=): 3093 (JSC::UntypedPtrAndBitfield::operator&): 3094 (JSC::UStringImpl::create): 3095 (JSC::UStringImpl::createCopying): 3096 (JSC::UStringImpl::createUninitialized): 3097 (JSC::UStringImpl::data): 3098 (JSC::UStringImpl::size): 3099 (JSC::UStringImpl::cost): 3100 (JSC::UStringImpl::hash): 3101 (JSC::UStringImpl::computedHash): 3102 (JSC::UStringImpl::setHash): 3103 (JSC::UStringImpl::identifierTable): 3104 (JSC::UStringImpl::setIdentifierTable): 3105 (JSC::UStringImpl::ref): 3106 (JSC::UStringImpl::deref): 3107 (JSC::UStringImpl::allocChars): 3108 (JSC::UStringImpl::copyChars): 3109 (JSC::UStringImpl::computeHash): 3110 (JSC::UStringImpl::null): 3111 (JSC::UStringImpl::empty): 3112 (JSC::UStringImpl::checkConsistency): 3113 (JSC::UStringImpl::): 3114 (JSC::UStringImpl::UStringImpl): 3115 (JSC::UStringImpl::operator new): 3116 (JSC::UStringImpl::bufferOwnerString): 3117 (JSC::UStringImpl::bufferOwnership): 3118 (JSC::UStringImpl::isStatic): 3119 31202009-12-18 Laszlo Gombos <laszlo.1.gombos@nokia.com> 3121 3122 Reviewed by Kenneth Rohde Christiansen. 3123 3124 Move some build decisions from Qt build system into source files 3125 https://bugs.webkit.org/show_bug.cgi?id=31956 3126 3127 * JavaScriptCore.pri: Compile files unconditionally 3128 * jit/ExecutableAllocatorPosix.cpp: Guard with PLATFORM(UNIX) && !PLATFORM(SYMBIAN) 3129 * jit/ExecutableAllocatorWin.cpp: Guard with PLATFORM(WIN_OS) 3130 * runtime/MarkStackPosix.cpp: Guard with PLATFORM(UNIX) && !PLATFORM(SYMBIAN) 3131 * runtime/MarkStackSymbian.cpp: Guard with PLATFORM(SYMBIAN) 3132 * runtime/MarkStackWin.cpp: Guard with PLATFORM(WIN_OS) 3133 * wtf/Platform.h: Guard ENABLE_JSC_MULTIPLE_THREADS with ENABLE_SINGLE_THREADED for the Qt port 3134 * wtf/ThreadingNone.cpp: Guard with ENABLE(SINGLE_THREADED) 3135 * wtf/qt/ThreadingQt.cpp: Guard with !ENABLE(SINGLE_THREADED) 3136 31372009-12-18 Gavin Barraclough <barraclough@apple.com> 3138 3139 Reviewed by Sam Weinig. 3140 3141 Add createNonCopying method to UString to make replace constructor passed bool, 3142 to make behaviour more explicit. Add createFromUTF8 to UString (wrapping method 3143 on UString::Rep), since other cases of transliteration (e.g. from ascii) are 3144 performed in UString constructors. Add/use setHash & size() accessors on Rep, 3145 rather than accessing _hash/len directly. 3146 3147 * API/JSClassRef.cpp: 3148 (OpaqueJSClass::OpaqueJSClass): 3149 * API/OpaqueJSString.cpp: 3150 (OpaqueJSString::ustring): 3151 * JavaScriptCore.exp: 3152 * runtime/ArrayPrototype.cpp: 3153 (JSC::arrayProtoFuncToString): 3154 * runtime/Identifier.cpp: 3155 (JSC::Identifier::equal): 3156 (JSC::CStringTranslator::translate): 3157 (JSC::UCharBufferTranslator::translate): 3158 (JSC::Identifier::addSlowCase): 3159 * runtime/JSString.cpp: 3160 (JSC::JSString::resolveRope): 3161 * runtime/JSString.h: 3162 (JSC::JSString::Rope::Fiber::refAndGetLength): 3163 (JSC::JSString::Rope::append): 3164 * runtime/StringBuilder.h: 3165 (JSC::StringBuilder::release): 3166 * runtime/StringConstructor.cpp: 3167 (JSC::stringFromCharCodeSlowCase): 3168 * runtime/StringPrototype.cpp: 3169 (JSC::substituteBackreferencesSlow): 3170 (JSC::stringProtoFuncToLowerCase): 3171 (JSC::stringProtoFuncToUpperCase): 3172 (JSC::stringProtoFuncFontsize): 3173 (JSC::stringProtoFuncLink): 3174 * runtime/UString.cpp: 3175 (JSC::UString::UString): 3176 (JSC::UString::createNonCopying): 3177 (JSC::UString::createFromUTF8): 3178 * runtime/UString.h: 3179 (JSC::UString::Rep::setHash): 3180 (JSC::UString::~UString): 3181 (JSC::makeString): 3182 31832009-12-18 Geoffrey Garen <ggaren@apple.com> 3184 3185 Reviewed by Cameron Zwarich and Gavin Barraclough. 3186 3187 Changed Register constructors to assignment operators, to streamline 3188 moving values into registers. (In theory, there's no difference between 3189 the two, since the constructor should just inline away, but there seems 3190 to be a big difference in the addled mind of the GCC optimizer.) 3191 3192 In the interpreter, this is a 3.5% SunSpider speedup and a 1K-2K 3193 reduction in stack usage per privateExecute stack frame. 3194 3195 * interpreter/CallFrame.h: 3196 (JSC::ExecState::setCalleeArguments): 3197 (JSC::ExecState::setCallerFrame): 3198 (JSC::ExecState::setScopeChain): 3199 (JSC::ExecState::init): 3200 (JSC::ExecState::setArgumentCount): 3201 (JSC::ExecState::setCallee): 3202 (JSC::ExecState::setCodeBlock): Added a little bit of casting so these 3203 functions could use the new Register assignment operators. 3204 3205 * interpreter/Register.h: 3206 (JSC::Register::withInt): 3207 (JSC::Register::Register): 3208 (JSC::Register::operator=): Swapped in assignment operators for constructors. 3209 32102009-12-18 Yongjun Zhang <yongjun.zhang@nokia.com> 3211 3212 Reviewed by Simon Hausmann. 3213 3214 https://bugs.webkit.org/show_bug.cgi?id=32713 3215 [Qt] make wtf/Assertions.h compile in winscw compiler. 3216 3217 Add string arg before ellipsis to help winscw compiler resolve variadic 3218 macro definitions in wtf/Assertions.h. 3219 3220 * wtf/Assertions.h: 3221 32222009-12-18 Geoffrey Garen <ggaren@apple.com> 3223 3224 Reviewed by Adam Roben. 3225 3226 Fixed intermittent failure seen on Windows buildbot, and in other JSC 3227 API clients. 3228 3229 Added a WeakGCPtr class and changed OpaqueJSClass::cachedPrototype to 3230 use it, to avoid vending a stale object as a prototype. 3231 3232 * API/JSClassRef.cpp: 3233 (OpaqueJSClassContextData::OpaqueJSClassContextData): 3234 (OpaqueJSClass::prototype): 3235 * API/JSClassRef.h: Use WeakGCPtr. 3236 3237 * JavaScriptCore.xcodeproj/project.pbxproj: 3238 * runtime/WeakGCPtr.h: Added. 3239 (JSC::WeakGCPtr::WeakGCPtr): 3240 (JSC::WeakGCPtr::get): 3241 (JSC::WeakGCPtr::clear): 3242 (JSC::WeakGCPtr::operator*): 3243 (JSC::WeakGCPtr::operator->): 3244 (JSC::WeakGCPtr::operator!): 3245 (JSC::WeakGCPtr::operator bool): 3246 (JSC::WeakGCPtr::operator UnspecifiedBoolType): 3247 (JSC::WeakGCPtr::assign): 3248 (JSC::::operator): 3249 (JSC::operator==): 3250 (JSC::operator!=): 3251 (JSC::static_pointer_cast): 3252 (JSC::const_pointer_cast): 3253 (JSC::getPtr): Added WeakGCPtr to the project. 3254 32552009-12-18 Gavin Barraclough <barraclough@apple.com> 3256 3257 Reviewed by Sam Weinig. 3258 3259 https://bugs.webkit.org/show_bug.cgi?id=32720 3260 3261 * JavaScriptCore.exp: 3262 - Remove exports for UString::append 3263 * JavaScriptCore.xcodeproj/project.pbxproj: 3264 - Make StringBuilder a private header (was project). 3265 32662009-12-18 Martin Robinson <martin.james.robinson@gmail.com> 3267 3268 Reviewed by Gustavo Noronha Silva. 3269 3270 [GTK] GRefPtr does not take a reference when assigned a raw pointer 3271 https://bugs.webkit.org/show_bug.cgi?id=32709 3272 3273 Ensure that when assigning a raw pointer to a GRefPtr, the reference 3274 count is incremented. Also remove the GRefPtr conversion overload as 3275 GRefPtr types have necessarily incompatible reference counting. 3276 3277 * wtf/gtk/GRefPtr.h: 3278 (WTF::GRefPtr::operator=): 3279 32802009-12-18 Simon Hausmann <simon.hausmann@nokia.com> 3281 3282 Reviewed by Tor Arne Vestbø. 3283 3284 [Qt] Clean up the qmake build system to distinguish between trunk builds and package builds 3285 3286 https://bugs.webkit.org/show_bug.cgi?id=32716 3287 3288 * pcre/pcre.pri: Use standalone_package instead of QTDIR_build 3289 32902009-12-18 Martin Robinson <martin.james.robinson@gmail.com> 3291 3292 Reviewed by Gustavo Noronha Silva. 3293 3294 [GTK] Compile warning from line 29 of GRefPtr.cpp 3295 https://bugs.webkit.org/show_bug.cgi?id=32703 3296 3297 Fix memory leak and compiler warning in GRefPtr GHashTable template 3298 specialization. 3299 3300 * wtf/gtk/GRefPtr.cpp: 3301 (WTF::refGPtr): 3302 33032009-12-17 Sam Weinig <sam@webkit.org> 3304 3305 Reviewed by Mark Rowe. 3306 3307 Add BUILDING_ON_SNOW_LEOPARD and TARGETING_SNOW_LEOPARD #defines. 3308 3309 * wtf/Platform.h: 3310 33112009-12-17 Adam Roben <aroben@apple.com> 3312 3313 Sync JavaScriptCore.vcproj with JavaScriptCore.xcodeproj and the 3314 source tree 3315 3316 Fixes <http://webkit.org/b/32665>. 3317 3318 Reviewed by Ada Chan. 3319 3320 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Moved 3321 around files and filters so that the structure matches 3322 JavaScriptCore.xcodeproj and the source tree. A few headers that were 3323 previously omitted have been added, as well as JSZombie.{cpp,h}. 3324 33252009-12-17 Adam Roben <aroben@apple.com> 3326 3327 Remove HeavyProfile and TreeProfile completely 3328 3329 These were mostly removed in r42808, but the empty files were left in 3330 place. 3331 3332 Fixes <http://webkit.org/b/32664>. 3333 3334 Reviewed by John Sullivan. 3335 3336 * Android.mk: 3337 * GNUmakefile.am: 3338 * JavaScriptCore.gypi: 3339 * JavaScriptCore.pri: 3340 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 3341 * JavaScriptCoreSources.bkl: 3342 Removed HeavyProfile/TreeProfile source files. 3343 3344 * profiler/HeavyProfile.cpp: Removed. 3345 * profiler/HeavyProfile.h: Removed. 3346 * profiler/TreeProfile.cpp: Removed. 3347 * profiler/TreeProfile.h: Removed. 3348 33492009-12-17 Martin Robinson <martin.james.robinson@gmail.com> 3350 3351 Reviewed by Gustavo Noronha Silva. 3352 3353 [GTK] WebKit GTK needs a wrapper for ref counted glib/gobject structs 3354 https://bugs.webkit.org/show_bug.cgi?id=21599 3355 3356 Implement GRefPtr, a smart pointer for reference counted GObject types. 3357 3358 * GNUmakefile.am: 3359 * wtf/gtk/GOwnPtr.cpp: 3360 (WTF::GDir): 3361 * wtf/gtk/GRefPtr.h: Added. 3362 (WTF::): 3363 (WTF::GRefPtr::GRefPtr): 3364 (WTF::GRefPtr::~GRefPtr): 3365 (WTF::GRefPtr::clear): 3366 (WTF::GRefPtr::get): 3367 (WTF::GRefPtr::operator*): 3368 (WTF::GRefPtr::operator->): 3369 (WTF::GRefPtr::operator!): 3370 (WTF::GRefPtr::operator UnspecifiedBoolType): 3371 (WTF::GRefPtr::hashTableDeletedValue): 3372 (WTF::::operator): 3373 (WTF::::swap): 3374 (WTF::swap): 3375 (WTF::operator==): 3376 (WTF::operator!=): 3377 (WTF::static_pointer_cast): 3378 (WTF::const_pointer_cast): 3379 (WTF::getPtr): 3380 (WTF::adoptGRef): 3381 (WTF::refGPtr): 3382 (WTF::derefGPtr): 3383 33842009-12-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 3385 3386 Unreviewed. Build fixes for make distcheck. 3387 3388 * GNUmakefile.am: 3389 33902009-12-16 Geoffrey Garen <ggaren@apple.com> 3391 3392 Reviewed by Oliver Hunt. 3393 3394 Fixed <rdar://problem/7355025> Interpreter::privateExecute macro generates 3395 bloated code 3396 3397 This patch cuts Interpreter stack use by about a third. 3398 3399 * bytecode/Opcode.h: Changed Opcode to const void* to work with the 3400 const static initiliazation we want to do in Interpreter::privateExecute. 3401 3402 * interpreter/Interpreter.cpp: 3403 (JSC::Interpreter::Interpreter): Moved hashtable initialization here to 3404 avoid polluting Interpreter::privateExecute's stack, and changed it from a 3405 series of add() calls to one add() call in a loop, to cut down on code size. 3406 3407 (JSC::Interpreter::privateExecute): Changed a series of label computations 3408 to a copy of a compile-time constant array to cut down on code size. 3409 34102009-12-16 Mark Rowe <mrowe@apple.com> 3411 3412 Build fix. Disable debug variants of WebKit frameworks. 3413 3414 * JavaScriptCore.xcodeproj/project.pbxproj: 3415 34162009-12-15 Geoffrey Garen <ggaren@apple.com> 3417 3418 Reviewed by Sam "r=me" Weinig. 3419 3420 https://bugs.webkit.org/show_bug.cgi?id=32498 3421 <rdar://problem/7471495> 3422 REGRESSION(r51978-r52039): AJAX "Mark This Forum Read" function no longer 3423 works 3424 3425 Fixed a tyop. 3426 3427 * runtime/Operations.h: 3428 (JSC::jsAdd): Use the '&&' operator, not the ',' operator. 3429 34302009-12-15 Geoffrey Garen <ggaren@apple.com> 3431 3432 Try to fix the windows build: don't export this inlined function. 3433 3434 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 3435 34362009-12-15 Geoffrey Garen <ggaren@apple.com> 3437 3438 Reviewed by Beth Dakin. 3439 3440 Inlined JSCell's operator new. 3441 3442 3.7% speedup on bench-allocate-nonretained.js. 3443 3444 * JavaScriptCore.exp: 3445 * runtime/JSCell.cpp: 3446 * runtime/JSCell.h: 3447 (JSC::JSCell::operator new): 3448 34492009-12-15 Geoffrey Garen <ggaren@apple.com> 3450 3451 Reviewed by Oliver Hunt. 3452 3453 Removed the number heap, replacing it with a one-item free list for 3454 numbers, taking advantage of the fact that two number cells fit inside 3455 the space for one regular cell, and number cells don't require destruction. 3456 3457 SunSpider says 1.6% faster in JSVALUE32 mode (the only mode that 3458 heap-allocates numbers). 3459 3460 SunSpider says 1.1% faster in JSVALUE32_64 mode. v8 says 0.8% faster 3461 in JSVALUE32_64 mode. 10% speedup on bench-alloc-nonretained.js. 6% 3462 speedup on bench-alloc-retained.js. 3463 3464 There's a lot of formulaic change in this patch, but not much substance. 3465 3466 * JavaScriptCore.exp: 3467 * debugger/Debugger.cpp: 3468 (JSC::Debugger::recompileAllJSFunctions): 3469 * runtime/Collector.cpp: 3470 (JSC::Heap::Heap): 3471 (JSC::Heap::destroy): 3472 (JSC::Heap::allocateBlock): 3473 (JSC::Heap::freeBlock): 3474 (JSC::Heap::freeBlockPtr): 3475 (JSC::Heap::freeBlocks): 3476 (JSC::Heap::recordExtraCost): 3477 (JSC::Heap::allocate): 3478 (JSC::Heap::resizeBlocks): 3479 (JSC::Heap::growBlocks): 3480 (JSC::Heap::shrinkBlocks): 3481 (JSC::Heap::markConservatively): 3482 (JSC::Heap::clearMarkBits): 3483 (JSC::Heap::markedCells): 3484 (JSC::Heap::sweep): 3485 (JSC::Heap::markRoots): 3486 (JSC::Heap::objectCount): 3487 (JSC::Heap::addToStatistics): 3488 (JSC::Heap::statistics): 3489 (JSC::Heap::isBusy): 3490 (JSC::Heap::reset): 3491 (JSC::Heap::collectAllGarbage): 3492 (JSC::Heap::primaryHeapBegin): 3493 (JSC::Heap::primaryHeapEnd): 3494 * runtime/Collector.h: 3495 (JSC::): Removed all code pertaining to the number heap, and changed all 3496 heap template functions and classes to non-template functions and classes. 3497 3498 (JSC::Heap::allocateNumber): A new optimization to replace the number 3499 heap: allocate half-sized number cells in pairs, returning the first 3500 cell and caching the second cell for the next allocation. 3501 3502 * runtime/CollectorHeapIterator.h: 3503 (JSC::LiveObjectIterator::LiveObjectIterator): 3504 (JSC::LiveObjectIterator::operator++): 3505 (JSC::DeadObjectIterator::DeadObjectIterator): 3506 (JSC::DeadObjectIterator::operator++): 3507 (JSC::ObjectIterator::ObjectIterator): 3508 (JSC::ObjectIterator::operator++): 3509 * runtime/JSCell.h: 3510 (JSC::JSCell::isNumber): Removed all code pertaining to the number heap, 3511 and changed all heap template functions and classes to non-template functions 3512 and classes. 3513 35142009-12-15 Zoltan Horvath <zoltan@webkit.org> 3515 3516 Reviewed by Darin Adler. 3517 3518 Allow custom memory allocation control for WeakGCMap class 3519 https://bugs.webkit.org/show_bug.cgi?id=32547 3520 3521 Inherits WeakGCMap from FastAllocBase because it is instantiated by 3522 'new' at: WebCore/dom/Document.cpp:512. 3523 3524 * runtime/WeakGCMap.h: 3525 35262009-12-15 Zoltan Horvath <zoltan@webkit.org> 3527 3528 Reviewed by Darin Adler. 3529 3530 Allow custom memory allocation control for dtoa's P5Node struct 3531 https://bugs.webkit.org/show_bug.cgi?id=32544 3532 3533 Inherits P5Node struct from Noncopyable because it is instantiated by 3534 'new' at wtf/dtoa.cpp:588 and don't need to be copyable. 3535 3536 * wtf/dtoa.cpp: 3537 35382009-12-14 Geoffrey Garen <ggaren@apple.com> 3539 3540 Reviewed by Simon Fraser. 3541 3542 https://bugs.webkit.org/show_bug.cgi?id=32524 3543 REGRESSION(52084): fast/dom/prototypes.html failing two CSS tests 3544 3545 * wtf/StdLibExtras.h: 3546 (WTF::bitCount): The original patch put the parentheses in the wrong 3547 place, completely changing the calculation and making it almost always 3548 wrong. Moved the parentheses around the '+' operation, like the original 3549 compiler warning suggested. 3550 35512009-12-14 Gabor Loki <loki@inf.u-szeged.hu> 3552 3553 Unreviewed trivial buildfix. 3554 3555 Fix crosses initialization of usedPrimaryBlocks for JSValue32 3556 3557 * runtime/Collector.cpp: 3558 (JSC::Heap::markConservatively): 3559 35602009-12-14 Csaba Osztrogonác <ossy@webkit.org> 3561 3562 Reviewed by Simon Hausmann. 3563 3564 GCC 4.3.x warning fixed. Suggested parantheses added. 3565 warning: ../../../JavaScriptCore/wtf/StdLibExtras.h:77: warning: suggest parentheses around + or - in operand of & 3566 3567 * wtf/StdLibExtras.h: 3568 (WTF::bitCount): 3569 35702009-12-13 Geoffrey Garen <ggaren@apple.com> 3571 3572 Reviewed by Sam Weinig. 3573 3574 Changed GC from mark-sweep to mark-allocate. 3575 3576 Added WeakGCMap to keep WebCore blissfully ignorant about objects that 3577 have become garbage but haven't run their destructors yet. 3578 3579 1% SunSpider speedup. 3580 7.6% v8 speedup (37% splay speedup). 3581 17% speedup on bench-alloc-nonretained.js. 3582 18% speedup on bench-alloc-retained.js. 3583 3584 * API/JSBase.cpp: 3585 (JSGarbageCollect): 3586 * API/JSContextRef.cpp: 3587 * JavaScriptCore.exp: 3588 * JavaScriptCore.xcodeproj/project.pbxproj: Updated for renames and new 3589 files. 3590 3591 * debugger/Debugger.cpp: 3592 (JSC::Debugger::recompileAllJSFunctions): Updated to use the Collector 3593 iterator abstraction. 3594 3595 * jsc.cpp: 3596 (functionGC): Updated for rename. 3597 3598 * runtime/Collector.cpp: Slightly reduced the number of allocations per 3599 collection, so that small workloads only allocate on collector block, 3600 rather than two. 3601 3602 (JSC::Heap::Heap): Updated to use the new allocateBlock function. 3603 3604 (JSC::Heap::destroy): Updated to use the new freeBlocks function. 3605 3606 (JSC::Heap::allocateBlock): New function to initialize a block when 3607 allocating it. 3608 3609 (JSC::Heap::freeBlock): Consolidated the responsibility for running 3610 destructors into this function. 3611 3612 (JSC::Heap::freeBlocks): Updated to use freeBlock. 3613 3614 (JSC::Heap::recordExtraCost): Sweep the heap in this reporting function, 3615 so that allocation, which is more common, doesn't have to check extraCost. 3616 3617 (JSC::Heap::heapAllocate): Run destructors right before recycling a 3618 garbage cell. This has better cache utilization than a separate sweep phase. 3619 3620 (JSC::Heap::resizeBlocks): 3621 (JSC::Heap::growBlocks): 3622 (JSC::Heap::shrinkBlocks): New set of functions for managing the size of 3623 the heap, now that the heap doesn't maintain any information about its 3624 size. 3625 3626 (JSC::isPointerAligned): 3627 (JSC::isHalfCellAligned): 3628 (JSC::isPossibleCell): 3629 (JSC::isCellAligned): 3630 (JSC::Heap::markConservatively): Cleaned up this code a bit. 3631 3632 (JSC::Heap::clearMarkBits): 3633 (JSC::Heap::markedCells): Some helper functions for examining the the mark 3634 bitmap. 3635 3636 (JSC::Heap::sweep): Simplified this function by using a DeadObjectIterator. 3637 3638 (JSC::Heap::markRoots): Reordered some operations for clarity. 3639 3640 (JSC::Heap::objectCount): 3641 (JSC::Heap::addToStatistics): 3642 (JSC::Heap::statistics): Rewrote these functions to calculate an object 3643 count on demand, since the heap doesn't maintain this information by 3644 itself. 3645 3646 (JSC::Heap::reset): New function for resetting the heap once we've 3647 exhausted heap space. 3648 3649 (JSC::Heap::collectAllGarbage): This function matches the old collect() 3650 behavior, but it's now an uncommon function used only by API. 3651 3652 * runtime/Collector.h: 3653 (JSC::CollectorBitmap::count): 3654 (JSC::CollectorBitmap::isEmpty): Added some helper functions for managing 3655 the collector mark bitmap. 3656 3657 (JSC::Heap::reportExtraMemoryCost): Changed reporting from cell equivalents 3658 to bytes, so it's easier to understand. 3659 3660 * runtime/CollectorHeapIterator.h: 3661 (JSC::CollectorHeapIterator::CollectorHeapIterator): 3662 (JSC::CollectorHeapIterator::operator!=): 3663 (JSC::CollectorHeapIterator::operator*): 3664 (JSC::CollectorHeapIterator::advance): 3665 (JSC::::LiveObjectIterator): 3666 (JSC::::operator): 3667 (JSC::::DeadObjectIterator): 3668 (JSC::::ObjectIterator): New iterators for encapsulating details about 3669 heap layout, and what's live and dead on the heap. 3670 3671 * runtime/JSArray.cpp: 3672 (JSC::JSArray::putSlowCase): 3673 (JSC::JSArray::increaseVectorLength): Delay reporting extra cost until 3674 we're fully constructed, so the heap mark phase won't visit us in an 3675 invalid state. 3676 3677 * runtime/JSCell.h: 3678 (JSC::JSCell::): 3679 (JSC::JSCell::createDummyStructure): 3680 (JSC::JSCell::JSCell): 3681 * runtime/JSGlobalData.cpp: 3682 (JSC::JSGlobalData::JSGlobalData): 3683 * runtime/JSGlobalData.h: Added a dummy cell to simplify allocation logic. 3684 3685 * runtime/JSString.h: 3686 (JSC::jsSubstring): Don't report extra cost for substrings, since they 3687 share a buffer that's already reported extra cost. 3688 3689 * runtime/Tracing.d: 3690 * runtime/Tracing.h: Changed these dtrace hooks not to report object 3691 counts, since they're no longer cheap to compute. 3692 3693 * runtime/UString.h: Updated for renames. 3694 3695 * runtime/WeakGCMap.h: Added. 3696 (JSC::WeakGCMap::isEmpty): 3697 (JSC::WeakGCMap::uncheckedGet): 3698 (JSC::WeakGCMap::uncheckedBegin): 3699 (JSC::WeakGCMap::uncheckedEnd): 3700 (JSC::::get): 3701 (JSC::::take): 3702 (JSC::::set): 3703 (JSC::::uncheckedRemove): Mentioned above. 3704 3705 * wtf/StdLibExtras.h: 3706 (WTF::bitCount): Added a bit population count function, so the heap can 3707 count live objects to fulfill statistics questions. 3708 3709The very last cell in the block is not allocated -- should not be marked. 3710 37112009-12-13 Geoffrey Garen <ggaren@apple.com> 3712 3713 Windows build fix: Export some new symbols. 3714 3715 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 3716 37172009-12-13 Geoffrey Garen <ggaren@apple.com> 3718 3719 Windows build fix: Removed some old exports. 3720 3721 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 3722 37232009-12-13 Geoffrey Garen <ggaren@apple.com> 3724 3725 Windows build fix: Use unsigned instead of uint32_t to avoid dependencies. 3726 3727 * wtf/StdLibExtras.h: 3728 (WTF::bitCount): 3729 37302009-12-13 Gavin Barraclough <barraclough@apple.com> 3731 3732 Reviewed by NOBODY (speculative Windows build fix). 3733 3734 * runtime/JSGlobalObjectFunctions.cpp: 3735 37362009-12-13 Gavin Barraclough <barraclough@apple.com> 3737 3738 Reviewed by Sam Weinig. 3739 3740 https://bugs.webkit.org/show_bug.cgi?id=32496 3741 Switch remaining cases of string construction to use StringBuilder. 3742 Builds strings using a vector rather than using string append / addition. 3743 3744 * JavaScriptCore.exp: 3745 * JavaScriptCore.xcodeproj/project.pbxproj: 3746 * runtime/Executable.cpp: 3747 (JSC::FunctionExecutable::paramString): 3748 * runtime/FunctionConstructor.cpp: 3749 (JSC::constructFunction): 3750 * runtime/JSGlobalObjectFunctions.cpp: 3751 (JSC::encode): 3752 (JSC::decode): 3753 (JSC::globalFuncEscape): 3754 (JSC::globalFuncUnescape): 3755 * runtime/JSONObject.cpp: 3756 (JSC::Stringifier::stringify): 3757 (JSC::Stringifier::indent): 3758 * runtime/JSString.h: 3759 * runtime/LiteralParser.cpp: 3760 (JSC::LiteralParser::Lexer::lexString): 3761 * runtime/NumberPrototype.cpp: 3762 (JSC::integerPartNoExp): 3763 (JSC::numberProtoFuncToFixed): 3764 (JSC::numberProtoFuncToPrecision): 3765 * runtime/Operations.h: 3766 (JSC::jsString): 3767 * runtime/StringPrototype.cpp: 3768 (JSC::substituteBackreferencesSlow): 3769 (JSC::substituteBackreferences): 3770 (JSC::stringProtoFuncConcat): 3771 37722009-12-08 Jeremy Moskovich <jeremy@chromium.org> 3773 3774 Reviewed by Eric Seidel. 3775 3776 Add code to allow toggling ATSUI/Core Text rendering at runtime in ComplexTextController. 3777 https://bugs.webkit.org/show_bug.cgi?id=31802 3778 3779 The goal here is to allow for a zero runtime hit for ports that decide to select 3780 the API at compile time. 3781 When both USE(ATSUI) and USE(CORE_TEXT) are true, the API is toggled 3782 at runtime. Core Text is used for OS Versions >= 10.6. 3783 3784 * wtf/Platform.h: #define USE_CORE_TEXT and USE_ATSUI on Chrome/Mac. 3785 37862009-12-11 Maciej Stachowiak <mjs@apple.com> 3787 3788 Reviewed by Oliver Hunt. 3789 3790 Unify codegen for forward and backward variants of branches 3791 https://bugs.webkit.org/show_bug.cgi?id=32463 3792 3793 * jit/JIT.h: 3794 (JSC::JIT::emit_op_loop): Implemented in terms of forward variant. 3795 (JSC::JIT::emit_op_loop_if_true): ditto 3796 (JSC::JIT::emitSlow_op_loop_if_true): ditto 3797 (JSC::JIT::emit_op_loop_if_false): ditto 3798 (JSC::JIT::emitSlow_op_loop_if_false): ditto 3799 (JSC::JIT::emit_op_loop_if_less): ditto 3800 (JSC::JIT::emitSlow_op_loop_if_less): ditto 3801 * jit/JITOpcodes.cpp: 3802 38032009-12-11 Sam Weinig <sam@webkit.org> 3804 3805 Reviewed by Anders Carlsson. 3806 3807 Allow WTFs concept of the main thread to differ from pthreads when necessary. 3808 3809 * wtf/ThreadingPthreads.cpp: 3810 (WTF::initializeThreading): 3811 (WTF::isMainThread): 3812 * wtf/mac/MainThreadMac.mm: 3813 (WTF::initializeMainThreadPlatform): 3814 (WTF::scheduleDispatchFunctionsOnMainThread): 3815 38162009-12-11 Gavin Barraclough <barraclough@apple.com> 3817 3818 Reviewed by Oliver Hunt. 3819 3820 https://bugs.webkit.org/show_bug.cgi?id=32454 3821 Refactor construction of simple strings to avoid string concatenation. 3822 3823 Building strings through concatenation has a memory and performance cost - 3824 a memory cost since we must over-allocate the buffer to leave space to append 3825 into, and performance in that the string may still require reallocation (and 3826 thus copying during construction). Instead move the full construction to 3827 within a single function call (makeString), so that the arguments' lengths 3828 can be calculated and an appropriate sized buffer allocated before copying 3829 any characters. 3830 3831 ~No performance change (~2% progression on date tests). 3832 3833 * bytecode/CodeBlock.cpp: 3834 (JSC::escapeQuotes): 3835 (JSC::valueToSourceString): 3836 (JSC::constantName): 3837 (JSC::idName): 3838 (JSC::CodeBlock::registerName): 3839 (JSC::regexpToSourceString): 3840 (JSC::regexpName): 3841 * bytecompiler/NodesCodegen.cpp: 3842 (JSC::substitute): 3843 * profiler/Profiler.cpp: 3844 (JSC::Profiler::createCallIdentifier): 3845 * runtime/DateConstructor.cpp: 3846 (JSC::callDate): 3847 * runtime/DateConversion.cpp: 3848 (JSC::formatDate): 3849 (JSC::formatDateUTCVariant): 3850 (JSC::formatTime): 3851 (JSC::formatTimeUTC): 3852 * runtime/DateConversion.h: 3853 (JSC::): 3854 * runtime/DatePrototype.cpp: 3855 (JSC::dateProtoFuncToString): 3856 (JSC::dateProtoFuncToUTCString): 3857 (JSC::dateProtoFuncToDateString): 3858 (JSC::dateProtoFuncToTimeString): 3859 (JSC::dateProtoFuncToGMTString): 3860 * runtime/ErrorPrototype.cpp: 3861 (JSC::errorProtoFuncToString): 3862 * runtime/ExceptionHelpers.cpp: 3863 (JSC::createUndefinedVariableError): 3864 (JSC::createErrorMessage): 3865 (JSC::createInvalidParamError): 3866 * runtime/FunctionPrototype.cpp: 3867 (JSC::insertSemicolonIfNeeded): 3868 (JSC::functionProtoFuncToString): 3869 * runtime/ObjectPrototype.cpp: 3870 (JSC::objectProtoFuncToString): 3871 * runtime/RegExpConstructor.cpp: 3872 (JSC::constructRegExp): 3873 * runtime/RegExpObject.cpp: 3874 (JSC::RegExpObject::match): 3875 * runtime/RegExpPrototype.cpp: 3876 (JSC::regExpProtoFuncCompile): 3877 (JSC::regExpProtoFuncToString): 3878 * runtime/StringPrototype.cpp: 3879 (JSC::stringProtoFuncBig): 3880 (JSC::stringProtoFuncSmall): 3881 (JSC::stringProtoFuncBlink): 3882 (JSC::stringProtoFuncBold): 3883 (JSC::stringProtoFuncFixed): 3884 (JSC::stringProtoFuncItalics): 3885 (JSC::stringProtoFuncStrike): 3886 (JSC::stringProtoFuncSub): 3887 (JSC::stringProtoFuncSup): 3888 (JSC::stringProtoFuncFontcolor): 3889 (JSC::stringProtoFuncFontsize): 3890 (JSC::stringProtoFuncAnchor): 3891 * runtime/UString.h: 3892 (JSC::): 3893 (JSC::makeString): 3894 38952009-12-10 Gavin Barraclough <barraclough@apple.com> 3896 3897 Reviewed by Oliver Hunt. 3898 3899 https://bugs.webkit.org/show_bug.cgi?id=32400 3900 Switch remaining cases of string addition to use ropes. 3901 3902 Re-landing r51975 - added toPrimitiveString method, 3903 performs toPrimitive then subsequent toString operations. 3904 3905 ~1% progression on Sunspidey. 3906 3907 * jit/JITStubs.cpp: 3908 (JSC::DEFINE_STUB_FUNCTION): 3909 * runtime/JSString.h: 3910 (JSC::JSString::JSString): 3911 (JSC::JSString::appendStringInConstruct): 3912 * runtime/Operations.cpp: 3913 (JSC::jsAddSlowCase): 3914 * runtime/Operations.h: 3915 (JSC::jsString): 3916 (JSC::jsAdd): 3917 39182009-12-11 Adam Roben <aroben@apple.com> 3919 3920 Windows build fix 3921 3922 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added 3923 $(WebKitOutputDir)/include/private to the include path. 3924 39252009-12-11 Adam Roben <aroben@apple.com> 3926 3927 Move QuartzCorePresent.h to include/private 3928 3929 This fixes other projects that use wtf/Platform.h 3930 3931 Rubber-stamped by Steve Falkenburg. 3932 3933 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Let VS do its thang. 3934 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Write 3935 QuartzCorePresent.h to $(WebKitOutputDir)/include/private. 3936 3937 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: 3938 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: 3939 Added $(WebKitOutputDir)/include/private to the include path. 3940 39412009-12-11 Adam Roben <aroben@apple.com> 3942 3943 Fix clean builds and everything rebuilding on every build 3944 3945 Reviewed by Sam Weinig. 3946 3947 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Don't 3948 write out QuartzCorePresent.h if it exists but is older than 3949 QuartzCore.h. Also, create the directory we write QuartzCorePresent.h 3950 into first. 3951 39522009-12-11 Adam Roben <aroben@apple.com> 3953 3954 Windows build fix for systems with spaces in their paths 3955 3956 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Quote some paths. 3957 39582009-12-11 Chris Marrin <cmarrin@apple.com> 3959 3960 Reviewed by Adam Roben. 3961 3962 Add check for presence of QuartzCore headers 3963 https://bugs.webkit.org/show_bug.cgi?id=31856 3964 3965 The script now checks for the presence of QuartzCore.h. If present 3966 it will turn on ACCELERATED_COMPOSITING and 3D_RENDERING to enable 3967 HW compositing on Windows. The script writes QuartzCorePresent.h to 3968 the build directory which has a define telling whether QuartzCore is 3969 present. 3970 3971 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: 3972 * wtf/Platform.h: 3973 39742009-12-11 Kent Tamura <tkent@chromium.org> 3975 3976 Reviewed by Darin Adler. 3977 3978 Fix a problem that JSC::gregorianDateTimeToMS() returns a negative 3979 value for a huge year value. 3980 https://bugs.webkit.org/show_bug.cgi?id=32304 3981 3982 * wtf/DateMath.cpp: 3983 (WTF::dateToDaysFrom1970): Renamed from dateToDayInYear, and changed the return type to double. 3984 (WTF::calculateDSTOffset): Follow the dateToDaysFrom1970() change. 3985 (WTF::timeClip): Use maxECMAScriptTime. 3986 (JSC::gregorianDateTimeToMS): Follow the dateToDaysFrom1970() change. 3987 39882009-12-10 Adam Barth <abarth@webkit.org> 3989 3990 No review, rolling out r51975. 3991 http://trac.webkit.org/changeset/51975 3992 3993 * jit/JITStubs.cpp: 3994 (JSC::DEFINE_STUB_FUNCTION): 3995 * runtime/JSString.h: 3996 (JSC::JSString::JSString): 3997 (JSC::JSString::appendStringInConstruct): 3998 * runtime/Operations.cpp: 3999 (JSC::jsAddSlowCase): 4000 * runtime/Operations.h: 4001 (JSC::jsString): 4002 (JSC::jsAdd): 4003 40042009-12-10 Oliver Hunt <oliver@apple.com> 4005 4006 Reviewed by Gavin Barraclough. 4007 4008 Incorrect caching of prototype lookup with dictionary base 4009 https://bugs.webkit.org/show_bug.cgi?id=32402 4010 4011 Make sure we don't add cached prototype lookup to the proto_list 4012 lookup chain if the top level object is a dictionary. 4013 4014 * jit/JITStubs.cpp: 4015 (JSC::JITThunks::tryCacheGetByID): 4016 40172009-12-10 Gavin Barraclough <barraclough@apple.com> 4018 4019 Reviewed by Oliver Hunt. 4020 4021 https://bugs.webkit.org/show_bug.cgi?id=32400 4022 Switch remaining cases of string addition to use ropes. 4023 4024 ~1% progression on Sunspidey. 4025 4026 * jit/JITStubs.cpp: 4027 (JSC::DEFINE_STUB_FUNCTION): 4028 * runtime/JSString.h: 4029 (JSC::JSString::JSString): 4030 (JSC::JSString::appendStringInConstruct): 4031 * runtime/Operations.cpp: 4032 (JSC::jsAddSlowCase): 4033 * runtime/Operations.h: 4034 (JSC::jsString): 4035 (JSC::jsAdd): 4036 40372009-12-10 Kent Hansen <kent.hansen@nokia.com> 4038 4039 Reviewed by Geoffrey Garen. 4040 4041 Remove JSObject::getPropertyAttributes() and all usage of it. 4042 https://bugs.webkit.org/show_bug.cgi?id=31933 4043 4044 getOwnPropertyDescriptor() should be used instead. 4045 4046 * JavaScriptCore.exp: 4047 * JavaScriptCore.order: 4048 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 4049 * debugger/DebuggerActivation.cpp: 4050 (JSC::DebuggerActivation::getOwnPropertyDescriptor): 4051 * debugger/DebuggerActivation.h: 4052 * runtime/JSObject.cpp: 4053 (JSC::JSObject::propertyIsEnumerable): 4054 * runtime/JSObject.h: 4055 * runtime/JSVariableObject.cpp: 4056 * runtime/JSVariableObject.h: 4057 40582009-12-10 Gavin Barraclough <barraclough@apple.com> 4059 4060 Reviewed by Oliver Hunt & Mark Rowe. 4061 4062 https://bugs.webkit.org/show_bug.cgi?id=32367 4063 Add support for short Ropes (up to 3 entries) inline within JSString. 4064 (rather than externally allocating an object to hold the rope). 4065 Switch jsAdd of (JSString* + JSString*) to now make use of Ropes. 4066 4067 ~1% progression on Sunspidey. 4068 4069 * interpreter/Interpreter.cpp: 4070 (JSC::Interpreter::privateExecute): 4071 * jit/JITOpcodes.cpp: 4072 (JSC::JIT::privateCompileCTIMachineTrampolines): 4073 * jit/JITStubs.cpp: 4074 (JSC::DEFINE_STUB_FUNCTION): 4075 * runtime/JSString.cpp: 4076 (JSC::JSString::resolveRope): 4077 (JSC::JSString::toBoolean): 4078 (JSC::JSString::getStringPropertyDescriptor): 4079 * runtime/JSString.h: 4080 (JSC::JSString::Rope::Fiber::deref): 4081 (JSC::JSString::Rope::Fiber::ref): 4082 (JSC::JSString::Rope::Fiber::refAndGetLength): 4083 (JSC::JSString::Rope::append): 4084 (JSC::JSString::JSString): 4085 (JSC::JSString::~JSString): 4086 (JSC::JSString::value): 4087 (JSC::JSString::tryGetValue): 4088 (JSC::JSString::length): 4089 (JSC::JSString::canGetIndex): 4090 (JSC::JSString::appendStringInConstruct): 4091 (JSC::JSString::appendValueInConstructAndIncrementLength): 4092 (JSC::JSString::isRope): 4093 (JSC::JSString::string): 4094 (JSC::JSString::ropeLength): 4095 (JSC::JSString::getStringPropertySlot): 4096 * runtime/Operations.h: 4097 (JSC::jsString): 4098 (JSC::jsAdd): 4099 (JSC::resolveBase): 4100 41012009-12-09 Anders Carlsson <andersca@apple.com> 4102 4103 Reviewed by Geoffrey Garen. 4104 4105 Fix three more things found by compiling with clang++. 4106 4107 * runtime/Structure.h: 4108 (JSC::StructureTransitionTable::reifySingleTransition): 4109 Add the 'std' qualifier to the call to make_pair. 4110 4111 * wtf/DateMath.cpp: 4112 (WTF::initializeDates): 4113 Incrementing a bool is deprecated according to the C++ specification. 4114 4115 * wtf/PtrAndFlags.h: 4116 (WTF::PtrAndFlags::PtrAndFlags): 4117 Name lookup should not be done in dependent bases, so explicitly qualify the call to set. 4118 41192009-12-09 Maciej Stachowiak <mjs@apple.com> 4120 4121 Reviewed by Oliver Hunt. 4122 4123 Google reader gets stuck in the "Loading..." state and does not complete 4124 https://bugs.webkit.org/show_bug.cgi?id=32256 4125 <rdar://problem/7456388> 4126 4127 * jit/JITArithmetic.cpp: 4128 (JSC::JIT::emitSlow_op_jless): Fix some backward branches. 4129 41302009-12-09 Gavin Barraclough <barraclough@apple.com> 4131 4132 Reviewed by Oliver Hunt. 4133 4134 https://bugs.webkit.org/show_bug.cgi?id=32228 4135 Make destruction of ropes non-recursive to prevent stack exhaustion. 4136 Also, pass a UString& into initializeFiber rather than a Ustring::Rep*, 4137 since the Rep is not being ref counted this could result in usage of a 4138 Rep with refcount zero (where the Rep comes from a temporary UString 4139 returned from a function). 4140 4141 * runtime/JSString.cpp: 4142 (JSC::JSString::Rope::destructNonRecursive): 4143 (JSC::JSString::Rope::~Rope): 4144 * runtime/JSString.h: 4145 (JSC::JSString::Rope::initializeFiber): 4146 * runtime/Operations.h: 4147 (JSC::concatenateStrings): 4148 41492009-12-09 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 4150 4151 Reviewed by Eric Seidel. 4152 4153 https://bugs.webkit.org/show_bug.cgi?id=31930 4154 4155 Update to r51457. ASSERTs changed to COMPILE_ASSERTs. 4156 The speedup is 25%. 4157 4158 * runtime/JSGlobalData.cpp: 4159 (JSC::VPtrSet::VPtrSet): 4160 41612009-12-09 Steve Block <steveblock@google.com> 4162 4163 Reviewed by Adam Barth. 4164 4165 Updates Android Makefiles with latest additions. 4166 https://bugs.webkit.org/show_bug.cgi?id=32278 4167 4168 * Android.mk: Modified. 4169 * Android.v8.wtf.mk: Modified. 4170 41712009-12-09 Sam Weinig <sam@webkit.org> 4172 4173 Reviewed by Gavin Barraclough. 4174 4175 Fix a bug found while trying to compile JavaScriptCore with clang++. 4176 4177 * yarr/RegexPattern.h: 4178 (JSC::Yarr::PatternTerm::PatternTerm): Don't self assign here. Use false instead. 4179 41802009-12-09 Anders Carlsson <andersca@apple.com> 4181 4182 Reviewed by Sam Weinig. 4183 4184 Attempt to fix the Windows build. 4185 4186 * wtf/FastMalloc.h: 4187 41882009-12-09 Anders Carlsson <andersca@apple.com> 4189 4190 Reviewed by Sam Weinig. 4191 4192 Fix some things found while trying to compile JavaScriptCore with clang++. 4193 4194 * wtf/FastMalloc.h: 4195 Add correct exception specifications for the allocation/deallocation operators. 4196 4197 * wtf/Vector.h: 4198 * wtf/VectorTraits.h: 4199 Fix a bunch of struct/class mismatches. 4200 42012009-12-08 Maciej Stachowiak <mjs@apple.com> 4202 4203 Reviewed by Darin Adler. 4204 4205 move code generation portions of Nodes.cpp to bytecompiler directory 4206 https://bugs.webkit.org/show_bug.cgi?id=32284 4207 4208 * bytecompiler/NodesCodegen.cpp: Copied from parser/Nodes.cpp. Removed parts that 4209 are not about codegen. 4210 * parser/Nodes.cpp: Removed everything that is about codegen. 4211 4212 Update build systems: 4213 4214 * Android.mk: 4215 * GNUmakefile.am: 4216 * JavaScriptCore.gypi: 4217 * JavaScriptCore.pri: 4218 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 4219 * JavaScriptCore.xcodeproj/project.pbxproj: 4220 * JavaScriptCoreSources.bkl: 4221 42222009-12-08 Kevin Watters <kevinwatters@gmail.com> 4223 4224 Reviewed by Kevin Ollivier. 4225 4226 [wx] Mac plugins support. 4227 4228 https://bugs.webkit.org/show_bug.cgi?id=32236 4229 4230 * wtf/Platform.h: 4231 42322009-12-08 Dmitry Titov <dimich@chromium.org> 4233 4234 Rubber-stamped by David Levin. 4235 4236 Revert and reopen "Add asserts to RefCounted to make sure ref/deref happens on the right thread." 4237 It may have caused massive increase of reported leaks on the bots. 4238 https://bugs.webkit.org/show_bug.cgi?id=31639 4239 4240 * GNUmakefile.am: 4241 * JavaScriptCore.gypi: 4242 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 4243 * JavaScriptCore.xcodeproj/project.pbxproj: 4244 * runtime/Structure.cpp: 4245 (JSC::Structure::Structure): 4246 * wtf/RefCounted.h: 4247 (WTF::RefCountedBase::ref): 4248 (WTF::RefCountedBase::hasOneRef): 4249 (WTF::RefCountedBase::refCount): 4250 (WTF::RefCountedBase::derefBase): 4251 * wtf/ThreadVerifier.h: Removed. 4252 42532009-12-08 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 4254 4255 Reviewed by Darin Adler. 4256 4257 Make WebKit build correctly on FreeBSD, IA64, and Alpha. 4258 Based on work by Petr Salinger <Petr.Salinger@seznam.cz>, 4259 and Colin Watson <cjwatson@ubuntu.com>. 4260 4261 * wtf/Platform.h: 4262 42632009-12-08 Dmitry Titov <dimich@chromium.org> 4264 4265 Reviewed by Darin Adler. 4266 4267 Add asserts to RefCounted to make sure ref/deref happens on the right thread. 4268 https://bugs.webkit.org/show_bug.cgi?id=31639 4269 4270 * runtime/Structure.cpp: 4271 (JSC::Structure::Structure): Disable thread verification on this class since it uses addressOfCount(). 4272 * wtf/RefCounted.h: 4273 (WTF::RefCountedBase::ref): Add ASSERT. 4274 (WTF::RefCountedBase::hasOneRef): Ditto. 4275 (WTF::RefCountedBase::refCount): Ditto. 4276 (WTF::RefCountedBase::derefBase): Ditto. 4277 (WTF::RefCountedBase::disableThreadVerification): delegate to ThreadVerifier method. 4278 * wtf/ThreadVerifier.h: Added. 4279 (WTF::ThreadVerifier::ThreadVerifier): New Debug-only class to verify that ref/deref of RefCounted is done on the same thread. 4280 (WTF::ThreadVerifier::activate): Activates checks. Called when ref count becomes above 2. 4281 (WTF::ThreadVerifier::deactivate): Deactivates checks. Called when ref count drops below 2. 4282 (WTF::ThreadVerifier::disableThreadVerification): used on objects that should not be checked (StringImpl etc) 4283 (WTF::ThreadVerifier::verifyThread): 4284 * GNUmakefile.am: Add ThreadVerifier.h to the build file. 4285 * JavaScriptCore.gypi: Ditto. 4286 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto. 4287 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. 4288 42892009-12-08 Steve Block <steveblock@google.com> 4290 4291 Reviewed by Adam Barth. 4292 4293 [Android] Adds Makefiles for Android port. 4294 https://bugs.webkit.org/show_bug.cgi?id=31325 4295 4296 * Android.mk: Added. 4297 * Android.v8.wtf.mk: Added. 4298 42992009-12-07 Dmitry Titov <dimich@chromium.org> 4300 4301 Rubber-stamped by Darin Adler. 4302 4303 Remove ENABLE_SHARED_SCRIPT flags 4304 https://bugs.webkit.org/show_bug.cgi?id=32245 4305 This patch was obtained by "git revert" command and then un-reverting of ChangeLog files. 4306 4307 * Configurations/FeatureDefines.xcconfig: 4308 * wtf/Platform.h: 4309 43102009-12-07 Gavin Barraclough <barraclough@apple.com> 4311 4312 Reviewed by NOBODY (Windows build fixage part I). 4313 4314 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 4315 43162009-12-05 Gavin Barraclough <barraclough@apple.com> 4317 4318 Reviewed by Oliver Hunt. 4319 4320 https://bugs.webkit.org/show_bug.cgi?id=32184 4321 Handle out-of-memory conditions with JSC Ropes with a JS exception, rather than crashing. 4322 Switch from using fastMalloc to tryFastMalloc, pass an ExecState to record the exception on. 4323 4324 * API/JSCallbackObjectFunctions.h: 4325 (JSC::::toString): 4326 * API/JSValueRef.cpp: 4327 (JSValueIsStrictEqual): 4328 * JavaScriptCore.exp: 4329 * bytecompiler/BytecodeGenerator.cpp: 4330 (JSC::BytecodeGenerator::emitEqualityOp): 4331 * debugger/DebuggerCallFrame.cpp: 4332 (JSC::DebuggerCallFrame::functionName): 4333 (JSC::DebuggerCallFrame::calculatedFunctionName): 4334 * interpreter/Interpreter.cpp: 4335 (JSC::Interpreter::callEval): 4336 (JSC::Interpreter::privateExecute): 4337 * jit/JITStubs.cpp: 4338 (JSC::DEFINE_STUB_FUNCTION): 4339 * profiler/ProfileGenerator.cpp: 4340 (JSC::ProfileGenerator::addParentForConsoleStart): 4341 * profiler/Profiler.cpp: 4342 (JSC::Profiler::willExecute): 4343 (JSC::Profiler::didExecute): 4344 (JSC::Profiler::createCallIdentifier): 4345 (JSC::createCallIdentifierFromFunctionImp): 4346 * profiler/Profiler.h: 4347 * runtime/ArrayPrototype.cpp: 4348 (JSC::arrayProtoFuncIndexOf): 4349 (JSC::arrayProtoFuncLastIndexOf): 4350 * runtime/DateConstructor.cpp: 4351 (JSC::constructDate): 4352 * runtime/FunctionPrototype.cpp: 4353 (JSC::functionProtoFuncToString): 4354 * runtime/InternalFunction.cpp: 4355 (JSC::InternalFunction::name): 4356 (JSC::InternalFunction::displayName): 4357 (JSC::InternalFunction::calculatedDisplayName): 4358 * runtime/InternalFunction.h: 4359 * runtime/JSCell.cpp: 4360 (JSC::JSCell::getString): 4361 * runtime/JSCell.h: 4362 (JSC::JSValue::getString): 4363 * runtime/JSONObject.cpp: 4364 (JSC::gap): 4365 (JSC::Stringifier::Stringifier): 4366 (JSC::Stringifier::appendStringifiedValue): 4367 * runtime/JSObject.cpp: 4368 (JSC::JSObject::putDirectFunction): 4369 (JSC::JSObject::putDirectFunctionWithoutTransition): 4370 (JSC::JSObject::defineOwnProperty): 4371 * runtime/JSObject.h: 4372 * runtime/JSPropertyNameIterator.cpp: 4373 (JSC::JSPropertyNameIterator::get): 4374 * runtime/JSString.cpp: 4375 (JSC::JSString::Rope::~Rope): 4376 (JSC::JSString::resolveRope): 4377 (JSC::JSString::getPrimitiveNumber): 4378 (JSC::JSString::toNumber): 4379 (JSC::JSString::toString): 4380 (JSC::JSString::toThisString): 4381 (JSC::JSString::getStringPropertyDescriptor): 4382 * runtime/JSString.h: 4383 (JSC::JSString::Rope::createOrNull): 4384 (JSC::JSString::Rope::operator new): 4385 (JSC::JSString::value): 4386 (JSC::JSString::tryGetValue): 4387 (JSC::JSString::getIndex): 4388 (JSC::JSString::getStringPropertySlot): 4389 (JSC::JSValue::toString): 4390 * runtime/JSValue.h: 4391 * runtime/NativeErrorConstructor.cpp: 4392 (JSC::NativeErrorConstructor::NativeErrorConstructor): 4393 * runtime/Operations.cpp: 4394 (JSC::JSValue::strictEqualSlowCase): 4395 * runtime/Operations.h: 4396 (JSC::JSValue::equalSlowCaseInline): 4397 (JSC::JSValue::strictEqualSlowCaseInline): 4398 (JSC::JSValue::strictEqual): 4399 (JSC::jsLess): 4400 (JSC::jsLessEq): 4401 (JSC::jsAdd): 4402 (JSC::concatenateStrings): 4403 * runtime/PropertyDescriptor.cpp: 4404 (JSC::PropertyDescriptor::equalTo): 4405 * runtime/PropertyDescriptor.h: 4406 * runtime/StringPrototype.cpp: 4407 (JSC::stringProtoFuncReplace): 4408 (JSC::stringProtoFuncToLowerCase): 4409 (JSC::stringProtoFuncToUpperCase): 4410 44112009-12-07 Nikolas Zimmermann <nzimmermann@rim.com> 4412 4413 Reviewed by Holger Freyther. 4414 4415 Turn on (SVG) Filters support, by default. 4416 https://bugs.webkit.org/show_bug.cgi?id=32224 4417 4418 * Configurations/FeatureDefines.xcconfig: Enable FILTERS build flag. 4419 44202009-12-07 Steve Falkenburg <sfalken@apple.com> 4421 4422 Build fix. Be flexible about which version of ICU is used on Windows. 4423 4424 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Add optional xcopy commands to copy ICU 4.2. 4425 44262009-12-07 Maciej Stachowiak <mjs@apple.com> 4427 4428 Reviewed by Oliver Hunt. 4429 4430 op_loop_if_less JIT codegen is broken for 64-bit 4431 https://bugs.webkit.org/show_bug.cgi?id=32221 4432 4433 * jit/JITOpcodes.cpp: 4434 (JSC::JIT::emit_op_loop_if_false): Fix codegen in this version - test was backwards. 4435 44362009-12-07 Oliver Hunt <oliver@apple.com> 4437 4438 Reviewed by Maciej Stachowiak. 4439 4440 Object.create fails if properties on the descriptor are getters 4441 https://bugs.webkit.org/show_bug.cgi?id=32219 4442 4443 Correctly initialise the PropertySlots with the descriptor object. 4444 4445 * runtime/ObjectConstructor.cpp: 4446 (JSC::toPropertyDescriptor): 4447 44482009-12-06 Maciej Stachowiak <mjs@apple.com> 4449 4450 Not reviewed, build fix. 4451 4452 Actually tested 64-bit *and* 32-bit build this time. 4453 4454 * jit/JITOpcodes.cpp: 4455 (JSC::JIT::emit_op_loop_if_false): 4456 44572009-12-06 Maciej Stachowiak <mjs@apple.com> 4458 4459 Not reviewed, build fix. 4460 4461 Really really fix 64-bit build for prior patch (actually tested this time). 4462 4463 * jit/JITOpcodes.cpp: 4464 (JSC::JIT::emit_op_loop_if_false): 4465 (JSC::JIT::emitSlow_op_loop_if_false): 4466 44672009-12-06 Maciej Stachowiak <mjs@apple.com> 4468 4469 Not reviewed, build fix. 4470 4471 Really fix 64-bit build for prior patch. 4472 4473 * jit/JITArithmetic.cpp: 4474 (JSC::JIT::emitSlow_op_jless): 4475 44762009-12-06 Maciej Stachowiak <mjs@apple.com> 4477 4478 Not reviewed, build fix. 4479 4480 Fix 64-bit build for prior patch. 4481 4482 * jit/JITOpcodes.cpp: 4483 (JSC::JIT::emitSlow_op_loop_if_less): 4484 44852009-12-05 Maciej Stachowiak <mjs@apple.com> 4486 4487 Reviewed by Oliver Hunt. 4488 4489 conway benchmark spends half it's time in op_less (jump fusion fails) 4490 https://bugs.webkit.org/show_bug.cgi?id=32190 4491 4492 <1% speedup on SunSpider and V8 4493 2x speedup on "conway" benchmark 4494 4495 Two optimizations: 4496 1) Improve codegen for logical operators &&, || and ! in a condition context 4497 4498 When generating code for combinations of &&, || and !, in a 4499 condition context (i.e. in an if statement or loop condition), we 4500 used to produce a value, and then separately jump based on its 4501 truthiness. Now we pass the false and true targets in, and let the 4502 logical operators generate jumps directly. This helps in four 4503 ways: 4504 4505 a) Individual clauses of a short-circuit logical operator can now 4506 jump directly to the then or else clause of an if statement (or to 4507 the top or exit of a loop) instead of jumping to a jump. 4508 4509 b) It used to be that jump fusion with the condition of the first 4510 clause of a logical operator was inhibited, because the register 4511 was ref'd to be used later, in the actual condition jump; this no 4512 longer happens since a jump straight to the final target is 4513 generated directly. 4514 4515 c) It used to be that jump fusion with the condition of the second 4516 clause of a logical operator was inhibited, because there was a 4517 jump target right after the second clause and before the actual 4518 condition jump. But now it's no longer necessary for the first 4519 clause to jump there so jump fusion is not blocked. 4520 4521 d) We avoid generating excess mov statements in some cases. 4522 4523 As a concrete example this source: 4524 4525 if (!((x < q && y < q) || (t < q && z < q))) { 4526 // ... 4527 } 4528 4529 Used to generate this bytecode: 4530 4531 [ 34] less r1, r-15, r-19 4532 [ 38] jfalse r1, 7(->45) 4533 [ 41] less r1, r-16, r-19 4534 [ 45] jtrue r1, 14(->59) 4535 [ 48] less r1, r-17, r-19 4536 [ 52] jfalse r1, 7(->59) 4537 [ 55] less r1, r-18, r-19 4538 [ 59] jtrue r1, 17(->76) 4539 4540 And now generates this bytecode (also taking advantage of the second optimization below): 4541 4542 [ 34] jnless r-15, r-19, 8(->42) 4543 [ 38] jless r-16, r-19, 26(->64) 4544 [ 42] jnless r-17, r-19, 8(->50) 4545 [ 46] jless r-18, r-19, 18(->64) 4546 4547 Note the jump fusion and the fact that there's less jump 4548 indirection - three of the four jumps go straight to the target 4549 clause instead of indirecting through another jump. 4550 4551 2) Implement jless opcode to take advantage of the above, since we'll now often generate 4552 a less followed by a jtrue where fusion is not forbidden. 4553 4554 * parser/Nodes.h: 4555 (JSC::ExpressionNode::hasConditionContextCodegen): Helper function to determine 4556 whether a node supports special conditional codegen. Return false as this is the default. 4557 (JSC::ExpressionNode::emitBytecodeInConditionContext): Assert not reached - only really 4558 defined for nodes that do have conditional codegen. 4559 (JSC::UnaryOpNode::expr): Add const version. 4560 (JSC::LogicalNotNode::hasConditionContextCodegen): Returne true only if subexpression 4561 supports it. 4562 (JSC::LogicalOpNode::hasConditionContextCodegen): Return true. 4563 * parser/Nodes.cpp: 4564 (JSC::LogicalNotNode::emitBytecodeInConditionContext): Implemented - just swap 4565 the true and false targets for the child node. 4566 (JSC::LogicalOpNode::emitBytecodeInConditionContext): Implemented - handle jumps 4567 directly, improving codegen quality. Also handles further nested conditional codegen. 4568 (JSC::ConditionalNode::emitBytecode): Use condition context codegen when available. 4569 (JSC::IfNode::emitBytecode): ditto 4570 (JSC::IfElseNode::emitBytecode): ditto 4571 (JSC::DoWhileNode::emitBytecode): ditto 4572 (JSC::WhileNode::emitBytecode): ditto 4573 (JSC::ForNode::emitBytecode): ditto 4574 4575 * bytecode/Opcode.h: 4576 - Added loop_if_false opcode - needed now that falsey jumps can be backwards. 4577 - Added jless opcode to take advantage of new fusion opportunities. 4578 * bytecode/CodeBlock.cpp: 4579 (JSC::CodeBlock::dump): Handle above. 4580 * bytecompiler/BytecodeGenerator.cpp: 4581 (JSC::BytecodeGenerator::emitJumpIfTrue): Add peephole for less + jtrue ==> jless. 4582 (JSC::BytecodeGenerator::emitJumpIfFalse): Add handling of backwrds falsey jumps. 4583 * bytecompiler/BytecodeGenerator.h: 4584 (JSC::BytecodeGenerator::emitNodeInConditionContext): Wrapper to handle tracking of 4585 overly deep expressions etc. 4586 * interpreter/Interpreter.cpp: 4587 (JSC::Interpreter::privateExecute): Implement the two new opcodes (loop_if_false, jless). 4588 * jit/JIT.cpp: 4589 (JSC::JIT::privateCompileMainPass): Implement JIT support for the two new opcodes. 4590 (JSC::JIT::privateCompileSlowCases): ditto 4591 * jit/JIT.h: 4592 * jit/JITArithmetic.cpp: 4593 (JSC::JIT::emit_op_jless): 4594 (JSC::JIT::emitSlow_op_jless): ditto 4595 (JSC::JIT::emitBinaryDoubleOp): ditto 4596 * jit/JITOpcodes.cpp: 4597 (JSC::JIT::emitSlow_op_loop_if_less): ditto 4598 (JSC::JIT::emit_op_loop_if_false): ditto 4599 (JSC::JIT::emitSlow_op_loop_if_false): ditto 4600 * jit/JITStubs.cpp: 4601 * jit/JITStubs.h: 4602 (JSC::): 4603 46042009-12-04 Kent Hansen <kent.hansen@nokia.com> 4605 4606 Reviewed by Darin Adler. 4607 4608 JavaScript delete operator should return false for string properties 4609 https://bugs.webkit.org/show_bug.cgi?id=32012 4610 4611 * runtime/StringObject.cpp: 4612 (JSC::StringObject::deleteProperty): 4613 46142009-12-03 Drew Wilson <atwilson@chromium.org> 4615 4616 Rolled back r51633 because it causes a perf regression in Chromium. 4617 4618 * wtf/Platform.h: 4619 46202009-12-03 Gavin Barraclough <barraclough@apple.com> 4621 4622 Try and fix the Windows build. 4623 4624 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a symbol that should be exported. 4625 46262009-12-03 Mark Rowe <mrowe@apple.com> 4627 4628 Try and fix the Mac build. 4629 4630 * JavaScriptCore.exp: Export a symbol that should be exported. 4631 46322009-12-03 Oliver Hunt <oliver@apple.com> 4633 4634 Reviewed by Gavin Barraclough. 4635 4636 REGRESSION(4.0.3-48777): Crash in JSC::ExecState::propertyNames() (Debug-only?) 4637 https://bugs.webkit.org/show_bug.cgi?id=32133 4638 4639 Work around odd GCC-ism and correct the scopechain for use by 4640 calls made while a cachedcall is active on the callstack. 4641 4642 * interpreter/CachedCall.h: 4643 (JSC::CachedCall::newCallFrame): 4644 * runtime/JSArray.cpp: 4645 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key): 4646 * runtime/StringPrototype.cpp: 4647 (JSC::stringProtoFuncReplace): 4648 46492009-12-03 Gavin Barraclough <barraclough@apple.com> 4650 4651 Reviewed by Oliver "Brraaaaiiiinnnnnzzzzzzzz" Hunt. 4652 4653 https://bugs.webkit.org/show_bug.cgi?id=32136 4654 Add a rope representation to JSString. Presently JSString always holds its data in UString form. 4655 Instead, allow the result of a string concatenation to be represented in a tree form - with a 4656 variable sized, reference-counted rope node retaining a set of UString::Reps (or other rope nopes). 4657 4658 Strings must still currently be resolved down to a flat UString representation before being used, 4659 but by holding the string in a rope representation during construction we can avoid copying data 4660 until we know the final size of the string. 4661 4662 ~2% progression on SunSpider (~25% on date-format-xparb, ~20% on string-validate-input). 4663 4664 * JavaScriptCore.exp: 4665 4666 - Update exports. 4667 4668 * interpreter/Interpreter.cpp: 4669 (JSC::Interpreter::privateExecute): 4670 4671 - Make use of new JSString::length() method to avoid prematurely resolving ropes. 4672 4673 * jit/JITOpcodes.cpp: 4674 (JSC::JIT::privateCompileCTIMachineTrampolines): 4675 4676 - Switch the string length trampoline to read the length directly from JSString::m_length, 4677 rather than from the JSString's UString::Rep's 'len' property. 4678 4679 * jit/JITStubs.cpp: 4680 (JSC::DEFINE_STUB_FUNCTION): 4681 4682 - Modify op_add such that addition of two strings, where either or both strings are already 4683 in rope representation, produces a rope as a result. 4684 4685 * runtime/JSString.cpp: 4686 (JSC::JSString::Rope::~Rope): 4687 (JSC::copyChars): 4688 (JSC::JSString::resolveRope): 4689 (JSC::JSString::getPrimitiveNumber): 4690 (JSC::JSString::toBoolean): 4691 (JSC::JSString::toNumber): 4692 (JSC::JSString::toString): 4693 (JSC::JSString::toThisString): 4694 (JSC::JSString::getStringPropertyDescriptor): 4695 * runtime/JSString.h: 4696 (JSC::JSString::Rope::Fiber::Fiber): 4697 (JSC::JSString::Rope::Fiber::destroy): 4698 (JSC::JSString::Rope::Fiber::isRope): 4699 (JSC::JSString::Rope::Fiber::rope): 4700 (JSC::JSString::Rope::Fiber::string): 4701 (JSC::JSString::Rope::create): 4702 (JSC::JSString::Rope::initializeFiber): 4703 (JSC::JSString::Rope::ropeLength): 4704 (JSC::JSString::Rope::stringLength): 4705 (JSC::JSString::Rope::fibers): 4706 (JSC::JSString::Rope::Rope): 4707 (JSC::JSString::Rope::operator new): 4708 (JSC::JSString::JSString): 4709 (JSC::JSString::value): 4710 (JSC::JSString::length): 4711 (JSC::JSString::isRope): 4712 (JSC::JSString::rope): 4713 (JSC::JSString::string): 4714 (JSC::JSString::canGetIndex): 4715 (JSC::jsSingleCharacterSubstring): 4716 (JSC::JSString::getIndex): 4717 (JSC::jsSubstring): 4718 (JSC::JSString::getStringPropertySlot): 4719 4720 - Add rope form. 4721 4722 * runtime/Operations.h: 4723 (JSC::jsAdd): 4724 (JSC::concatenateStrings): 4725 4726 - Update string concatenation, and addition of ropes, to produce ropes. 4727 4728 * runtime/StringObject.cpp: 4729 (JSC::StringObject::getOwnPropertyNames): 4730 4731 - Make use of new JSString::length() method to avoid prematurely resolving ropes. 4732 47332009-11-23 Jeremy Moskovich <jeremy@chromium.org> 4734 4735 Reviewed by Eric Seidel. 4736 4737 Switch Chrome/Mac to use Core Text APIs rather than ATSUI APIs. 4738 https://bugs.webkit.org/show_bug.cgi?id=31802 4739 4740 No test since this is already covered by existing pixel tests. 4741 4742 * wtf/Platform.h: #define USE_CORE_TEXT for Chrome/Mac. 4743 47442009-12-02 Oliver Hunt <oliver@apple.com> 4745 4746 Reviewed by Gavin Barraclough. 4747 4748 Add files missed in prior patch. 4749 4750 * runtime/JSZombie.cpp: 4751 (JSC::): 4752 (JSC::JSZombie::leakedZombieStructure): 4753 * runtime/JSZombie.h: Added. 4754 (JSC::JSZombie::JSZombie): 4755 (JSC::JSZombie::isZombie): 4756 (JSC::JSZombie::classInfo): 4757 (JSC::JSZombie::isGetterSetter): 4758 (JSC::JSZombie::isAPIValueWrapper): 4759 (JSC::JSZombie::isPropertyNameIterator): 4760 (JSC::JSZombie::getCallData): 4761 (JSC::JSZombie::getConstructData): 4762 (JSC::JSZombie::getUInt32): 4763 (JSC::JSZombie::toPrimitive): 4764 (JSC::JSZombie::getPrimitiveNumber): 4765 (JSC::JSZombie::toBoolean): 4766 (JSC::JSZombie::toNumber): 4767 (JSC::JSZombie::toString): 4768 (JSC::JSZombie::toObject): 4769 (JSC::JSZombie::markChildren): 4770 (JSC::JSZombie::put): 4771 (JSC::JSZombie::deleteProperty): 4772 (JSC::JSZombie::toThisObject): 4773 (JSC::JSZombie::toThisString): 4774 (JSC::JSZombie::toThisJSString): 4775 (JSC::JSZombie::getJSNumber): 4776 (JSC::JSZombie::getOwnPropertySlot): 4777 47782009-12-02 Oliver Hunt <oliver@apple.com> 4779 4780 Reviewed by Gavin Barraclough. 4781 4782 Add zombies to JSC 4783 https://bugs.webkit.org/show_bug.cgi?id=32103 4784 4785 Add a compile time flag to make the JSC collector replace "unreachable" 4786 objects with zombie objects. The zombie object is a JSCell subclass that 4787 ASSERTs on any attempt to use the JSCell methods. In addition there are 4788 a number of additional assertions in bottleneck code to catch zombie usage 4789 as quickly as possible. 4790 4791 Grrr. Argh. Brains. 4792 4793 * JavaScriptCore.xcodeproj/project.pbxproj: 4794 * interpreter/Register.h: 4795 (JSC::Register::Register): 4796 * runtime/ArgList.h: 4797 (JSC::MarkedArgumentBuffer::append): 4798 (JSC::ArgList::ArgList): 4799 * runtime/Collector.cpp: 4800 (JSC::Heap::destroy): 4801 (JSC::Heap::sweep): 4802 * runtime/Collector.h: 4803 * runtime/JSCell.h: 4804 (JSC::JSCell::isZombie): 4805 (JSC::JSValue::isZombie): 4806 * runtime/JSValue.h: 4807 (JSC::JSValue::decode): 4808 (JSC::JSValue::JSValue): 4809 * wtf/Platform.h: 4810 48112009-12-01 Jens Alfke <snej@chromium.org> 4812 4813 Reviewed by Darin Adler. 4814 4815 Added variants of find/contains/add that allow a foreign key type to be used. 4816 This will allow AtomicString-keyed maps to be queried by C string without 4817 having to create a temporary AtomicString (see HTTPHeaderMap.) 4818 The code for this is adapted from the equivalent in HashSet.h. 4819 4820 * wtf/HashMap.h: 4821 (WTF::HashMap::find): 4822 (WTF::HashMap::contains): 4823 (WTF::HashMap::add): 4824 * wtf/HashSet.h: Changed "method" to "function member" in a comment. 4825 48262009-12-01 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 4827 4828 Revert 51551 because it broke GTK+. 4829 4830 * wtf/Platform.h: 4831 48322009-11-30 Gavin Barraclough <barraclough@apple.com> 4833 4834 Windows Build fix. Reviewed by NOBODY. 4835 4836 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 4837 48382009-11-24 Gavin Barraclough <barraclough@apple.com> 4839 4840 Reviewed by Geoff Garen. 4841 4842 Bug 31859 - Make world selection for JSC IsolatedWorlds automagical. 4843 4844 WebCore presently has to explicitly specify the world before entering into JSC, 4845 which is a little fragile (particularly since property access via a 4846 getter/setter might invoke execution). Instead derive the current world from 4847 the lexical global object. 4848 4849 Remove the temporary duct tape of willExecute/didExecute virtual hooks on the JSGlobalData::ClientData - these are no longer necessary. 4850 4851 * API/JSBase.cpp: 4852 (JSEvaluateScript): 4853 * API/JSObjectRef.cpp: 4854 (JSObjectCallAsFunction): 4855 * JavaScriptCore.exp: 4856 * runtime/JSGlobalData.cpp: 4857 * runtime/JSGlobalData.h: 4858 48592009-11-30 Laszlo Gombos <laszlo.1.gombos@nokia.com> 4860 4861 Reviewed by Kenneth Rohde Christiansen. 4862 4863 [Qt] Remove obsolete PLATFORM(KDE) code 4864 https://bugs.webkit.org/show_bug.cgi?id=31958 4865 4866 KDE is now using unpatched QtWebKit. 4867 4868 * parser/Lexer.cpp: Remove obsolete KDE_USE_FINAL guard 4869 * wtf/Platform.h: Remove PLATFORM(KDE) definition and code 4870 section that is guarded with it. 4871 48722009-11-30 Jan-Arve Sæther <jan-arve.saether@nokia.com> 4873 4874 Reviewed by Simon Hausmann. 4875 4876 [Qt] Fix compilation with win32-icc 4877 4878 The Intel compiler does not support the __has_trivial_constructor type 4879 trait. The Intel Compiler can report itself as _MSC_VER >= 1400. The 4880 reason for that is that the Intel Compiler depends on the Microsoft 4881 Platform SDK, and in order to try to be "fully" MS compatible it will 4882 "pretend" to be the same MS compiler as was shipped with the MS PSDK. 4883 (Thus, compiling with win32-icc with VC8 SDK will make the source code 4884 "think" the compiler at hand supports this type trait). 4885 4886 * wtf/TypeTraits.h: 4887 48882009-11-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> 4889 4890 Reviewed by Eric Seidel. 4891 4892 [Qt] Mac build has JIT disabled 4893 https://bugs.webkit.org/show_bug.cgi?id=31828 4894 4895 * wtf/Platform.h: Enable JIT for Qt Mac builds 4896 48972009-11-28 Laszlo Gombos <laszlo.1.gombos@nokia.com> 4898 4899 Reviewed by Eric Seidel. 4900 4901 Apply workaround for the limitation of VirtualFree with MEM_RELEASE to all ports running on Windows 4902 https://bugs.webkit.org/show_bug.cgi?id=31943 4903 4904 * runtime/MarkStack.h: 4905 (JSC::MarkStack::MarkStackArray::shrinkAllocation): 4906 49072009-11-28 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 4908 4909 Reviewed by Gavin Barraclough. 4910 4911 https://bugs.webkit.org/show_bug.cgi?id=31930 4912 4913 Seems a typo. We don't need ~270k memory to determine the vptrs. 4914 4915 * runtime/JSGlobalData.cpp: 4916 (JSC::VPtrSet::VPtrSet): 4917 49182009-11-27 Shinichiro Hamaji <hamaji@chromium.org> 4919 4920 Unreviewed. 4921 4922 Move GOwnPtr* from wtf to wtf/gtk 4923 https://bugs.webkit.org/show_bug.cgi?id=31793 4924 4925 Build fix for chromium after r51423. 4926 Exclude gtk directory from chromium build. 4927 4928 * JavaScriptCore.gyp/JavaScriptCore.gyp: 4929 49302009-11-25 Oliver Hunt <oliver@apple.com> 4931 4932 Reviewed by Gavin Barraclough. 4933 4934 Incorrect behaviour of jneq_null in the interpreter 4935 https://bugs.webkit.org/show_bug.cgi?id=31901 4936 4937 Correct the logic of jneq_null. This is already covered by existing tests. 4938 4939 * interpreter/Interpreter.cpp: 4940 (JSC::Interpreter::privateExecute): 4941 49422009-11-26 Laszlo Gombos <laszlo.1.gombos@nokia.com> 4943 4944 Reviewed by Oliver Hunt. 4945 4946 Move GOwnPtr* from wtf to wtf/gtk 4947 https://bugs.webkit.org/show_bug.cgi?id=31793 4948 4949 * GNUmakefile.am: Change the path for GOwnPtr.*. 4950 * JavaScriptCore.gyp/JavaScriptCore.gyp: Remove 4951 GOwnPtr.cpp from the exclude list. 4952 * JavaScriptCore.gypi: Change the path for GOwnPtr.*. 4953 * wscript: Remove GOwnPtr.cpp from the exclude list. 4954 * wtf/GOwnPtr.cpp: Removed. 4955 * wtf/GOwnPtr.h: Removed. 4956 * wtf/Threading.h: Change the path for GOwnPtr.h. 4957 * wtf/gtk/GOwnPtr.cpp: Copied from JavaScriptCore/wtf/GOwnPtr.cpp. 4958 * wtf/gtk/GOwnPtr.h: Copied from JavaScriptCore/wtf/GOwnPtr.h. 4959 * wtf/unicode/glib/UnicodeGLib.h: Change the path for GOwnPtr.h. 4960 49612009-11-24 Dmitry Titov <dimich@chromium.org> 4962 4963 Reviewed by Eric Seidel. 4964 4965 Add ENABLE_SHARED_SCRIPT feature define and flag for build-webkit 4966 https://bugs.webkit.org/show_bug.cgi?id=31444 4967 4968 * Configurations/FeatureDefines.xcconfig: 4969 * wtf/Platform.h: 4970 49712009-11-24 Chris Marrin <cmarrin@apple.com> 4972 4973 Reviewed by Simon Fraser. 4974 4975 Add ability to enable ACCELERATED_COMPOSITING on Windows (currently disabled) 4976 https://bugs.webkit.org/show_bug.cgi?id=27314 4977 4978 * wtf/Platform.h: 4979 49802009-11-24 Jason Smith <dark.panda@gmail.com> 4981 4982 Reviewed by Alexey Proskuryakov. 4983 4984 RegExp#exec's returned Array-like object behaves differently from 4985 regular Arrays 4986 https://bugs.webkit.org/show_bug.cgi?id=31689 4987 4988 * JavaScriptCore/runtime/RegExpConstructor.cpp: ensure that undefined 4989 values are added to the returned RegExpMatchesArray 4990 49912009-11-24 Oliver Hunt <oliver@apple.com> 4992 4993 Reviewed by Alexey Proskuryakov. 4994 4995 JSON.stringify performance on undefined is very poor 4996 https://bugs.webkit.org/show_bug.cgi?id=31839 4997 4998 Switch from a UString to a Vector<UChar> when building 4999 the JSON string, allowing us to safely remove the substr-copy 5000 we otherwise did when unwinding an undefined property. 5001 5002 Also turns out to be a ~5% speedup on stringification. 5003 5004 * runtime/JSONObject.cpp: 5005 (JSC::Stringifier::StringBuilder::append): 5006 (JSC::Stringifier::stringify): 5007 (JSC::Stringifier::Holder::appendNextProperty): 5008 50092009-11-24 Mark Rowe <mrowe@apple.com> 5010 5011 Fix production builds where the source tree may be read-only. 5012 5013 * JavaScriptCore.xcodeproj/project.pbxproj: 5014 50152009-11-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5016 5017 Reviewed by Kenneth Rohde Christiansen. 5018 5019 Include "config.h" to meet Coding Style Guidelines 5020 https://bugs.webkit.org/show_bug.cgi?id=31792 5021 5022 * wtf/unicode/UTF8.cpp: 5023 * wtf/unicode/glib/UnicodeGLib.cpp: 5024 * wtf/unicode/wince/UnicodeWince.cpp: 5025 50262009-11-23 Geoffrey Garen <ggaren@apple.com> 5027 5028 Reviewed by Oliver Hunt. 5029 5030 Streamlined some Math functions where we expect or know the result not 5031 to be representable as an int. 5032 5033 SunSpider says 0.6% faster. 5034 5035 * runtime/JSNumberCell.h: 5036 (JSC::JSValue::JSValue): 5037 * runtime/JSValue.h: 5038 (JSC::JSValue::): 5039 (JSC::jsDoubleNumber): 5040 (JSC::JSValue::JSValue): Added a function for making a numeric JSValue 5041 and skipping the "can I encode this as an int?" check, avoiding the 5042 overhead of int <-> double roundtripping and double <-> double comparison 5043 and branching. 5044 5045 * runtime/MathObject.cpp: 5046 (JSC::mathProtoFuncACos): 5047 (JSC::mathProtoFuncASin): 5048 (JSC::mathProtoFuncATan): 5049 (JSC::mathProtoFuncATan2): 5050 (JSC::mathProtoFuncCos): 5051 (JSC::mathProtoFuncExp): 5052 (JSC::mathProtoFuncLog): 5053 (JSC::mathProtoFuncRandom): 5054 (JSC::mathProtoFuncSin): 5055 (JSC::mathProtoFuncSqrt): 5056 (JSC::mathProtoFuncTan): For these functions, which we expect or know 5057 to produce results not representable as ints, call jsDoubleNumber instead 5058 of jsNumber. 5059 50602009-11-23 Mark Rowe <mrowe@apple.com> 5061 5062 Unreviewed. Unbreak the regression tests after r51329. 5063 5064 * API/JSBase.cpp: 5065 (JSEvaluateScript): Null-check clientData before dereferencing it. 5066 * API/JSObjectRef.cpp: 5067 (JSObjectCallAsFunction): Ditto. 5068 50692009-11-23 Gavin Barraclough <barraclough@apple.com> 5070 5071 Reviewed by Geoff Garen. 5072 5073 Part 1/3 of <rdar://problem/7377477> REGRESSION: Many web pages fail to render after interesting script runs in isolated world 5074 5075 Some clients of the JavaScriptCore API expect to be able to make callbacks over the JSC API, 5076 and for this to automagically cause execution to take place in the world associated with the 5077 global object associated with the ExecState (JSContextRef) passed. However this is not how 5078 things work - the world must be explicitly set within WebCore. 5079 5080 Making this work just for API calls to evaluate & call will be a far from perfect solution, 5081 since direct (non-API) use of JSC still relies on WebCore setting the current world correctly. 5082 A better solution would be to make this all work automagically all throughout WebCore, but this 5083 will require more refactoring. 5084 5085 Since the API is in JSC but worlds only exist in WebCore, add callbacks on the JSGlobalData::ClientData 5086 to allow it to update the current world on entry/exit via the JSC API. This is temporary duck 5087 tape, and should be removed once the current world no longer needs to be explicitly tracked. 5088 5089 * API/JSBase.cpp: 5090 (JSEvaluateScript): 5091 * API/JSObjectRef.cpp: 5092 (JSObjectCallAsFunction): 5093 * JavaScriptCore.exp: 5094 * runtime/JSGlobalData.cpp: 5095 (JSC::JSGlobalData::ClientData::beginningExecution): 5096 (JSC::JSGlobalData::ClientData::completedExecution): 5097 * runtime/JSGlobalData.h: 5098 50992009-11-23 Steve Block <steveblock@google.com> 5100 5101 Reviewed by Dmitry Titov. 5102 5103 Adds MainThreadAndroid.cpp with Android-specific WTF threading functions. 5104 https://bugs.webkit.org/show_bug.cgi?id=31807 5105 5106 * wtf/android: Added. 5107 * wtf/android/MainThreadAndroid.cpp: Added. 5108 (WTF::timeoutFired): 5109 (WTF::initializeMainThreadPlatform): 5110 (WTF::scheduleDispatchFunctionsOnMainThread): 5111 51122009-11-23 Alexey Proskuryakov <ap@apple.com> 5113 5114 Reviewed by Brady Eidson. 5115 5116 https://bugs.webkit.org/show_bug.cgi?id=31748 5117 Make WebSocketHandleCFNet respect proxy auto-configuration files via CFProxySupport 5118 5119 * JavaScriptCore.exp: Export callOnMainThreadAndWait. 5120 51212009-11-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5122 5123 Reviewed by Kenneth Rohde Christiansen. 5124 5125 [Symbian] Fix lastIndexOf() for Symbian 5126 https://bugs.webkit.org/show_bug.cgi?id=31773 5127 5128 Symbian soft floating point library has problems with operators 5129 comparing NaN to numbers. Without a workaround lastIndexOf() 5130 function does not work. 5131 5132 Patch developed by David Leong. 5133 5134 * runtime/StringPrototype.cpp: 5135 (JSC::stringProtoFuncLastIndexOf):Add an extra test 5136 to check for NaN for Symbian. 5137 51382009-11-23 Steve Block <steveblock@google.com> 5139 5140 Reviewed by Eric Seidel. 5141 5142 Android port lacks implementation of atomicIncrement and atomicDecrement. 5143 https://bugs.webkit.org/show_bug.cgi?id=31715 5144 5145 * wtf/Threading.h: Modified. 5146 (WTF::atomicIncrement): Added Android implementation. 5147 (WTF::atomicDecrement): Added Android implementation. 5148 51492009-11-22 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5150 5151 Unreviewed. 5152 5153 [Qt] Sort source lists and remove obsolete comments 5154 from the build system. 5155 5156 * JavaScriptCore.pri: 5157 51582009-11-21 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5159 5160 Reviewed by Eric Seidel. 5161 5162 [Qt][Mac] Turn on multiple JavaScript threads for QtWebkit on Mac 5163 https://bugs.webkit.org/show_bug.cgi?id=31753 5164 5165 * wtf/Platform.h: 5166 51672009-11-19 Steve Block <steveblock@google.com> 5168 5169 Android port lacks configuration in Platform.h and config.h. 5170 https://bugs.webkit.org/show_bug.cgi?id=31671 5171 5172 * wtf/Platform.h: Modified. Added Android-specific configuration. 5173 51742009-11-19 Alexey Proskuryakov <ap@apple.com> 5175 5176 Reviewed by Darin Adler. 5177 5178 https://bugs.webkit.org/show_bug.cgi?id=31690 5179 Make SocketStreamHandleCFNet work on Windows 5180 5181 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 5182 * wtf/MainThread.cpp: 5183 (WTF::FunctionWithContext::FunctionWithContext): 5184 (WTF::dispatchFunctionsFromMainThread): 5185 (WTF::callOnMainThreadAndWait): 5186 * wtf/MainThread.h: 5187 Re-add callOnMainThreadAndWait(), which was removed in bug 23926. 5188 51892009-11-19 Dmitry Titov <dimich@chromium.org> 5190 5191 Reviewed by David Levin. 5192 5193 isMainThread() on Chromium (Mac and Linux) is so slow it timeouts LayoutTests.. 5194 https://bugs.webkit.org/show_bug.cgi?id=31693 5195 5196 * wtf/ThreadingPthreads.cpp: 5197 (WTF::initializeThreading): grab and use the pthread_t of the main thread instead of ThreadIdentifier. 5198 (WTF::isMainThread): Ditto. 5199 52002009-11-19 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5201 5202 Reviewed by Darin Adler. 5203 5204 Remove HAVE(STRING_H) guard from JavaScriptCore 5205 https://bugs.webkit.org/show_bug.cgi?id=31668 5206 5207 * config.h: 5208 * runtime/UString.cpp: 5209 52102009-11-19 Dumitru Daniliuc <dumi@chromium.org> 5211 5212 Reviewed by Dmitry Titov. 5213 5214 Fixing a bug in MessageQueue::removeIf() that leads to an 5215 assertion failure. 5216 5217 https://bugs.webkit.org/show_bug.cgi?id=31657 5218 5219 * wtf/MessageQueue.h: 5220 (WTF::MessageQueue::removeIf): 5221 52222009-11-19 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5223 5224 Reviewed by Darin Adler. 5225 5226 Remove HAVE(FLOAT_H) guard 5227 https://bugs.webkit.org/show_bug.cgi?id=31661 5228 5229 JavaScriptCore has a dependency on float.h, there is 5230 no need to guard float.h. 5231 5232 * runtime/DatePrototype.cpp: Remove include directive 5233 for float.h as it is included in MathExtras.h already. 5234 * runtime/Operations.cpp: Ditto. 5235 * runtime/UString.cpp: Ditto. 5236 * wtf/dtoa.cpp: Ditto. 5237 * wtf/MathExtras.h: Remove HAVE(FLOAT_H) guard. 5238 * wtf/Platform.h: Ditto. 5239 52402009-11-19 Thiago Macieira <thiago.macieira@nokia.com> 5241 5242 Reviewed by Simon Hausmann. 5243 5244 Build fix for 32-bit Sparc machines: these machines are big-endian. 5245 5246 * wtf/Platform.h: 5247 52482009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5249 5250 Reviewed by Kenneth Rohde Christiansen. 5251 5252 [Qt] Remove support for Qt v4.3 or older versions 5253 https://bugs.webkit.org/show_bug.cgi?id=29469 5254 5255 * JavaScriptCore.pro: 5256 * jsc.pro: 5257 * wtf/unicode/qt4/UnicodeQt4.h: 5258 52592009-11-18 Kent Tamura <tkent@chromium.org> 5260 5261 Reviewed by Darin Adler. 5262 5263 Move UString::from(double) implementation to new 5264 WTF::doubleToStringInJavaScriptFormat(), and expose it because WebCore 5265 code will use it. 5266 https://bugs.webkit.org/show_bug.cgi?id=31330 5267 5268 - Introduce new function createRep(const char*, unsigned) and 5269 UString::UString(const char*, unsigned) to reduce 2 calls to strlen(). 5270 - Fix a bug that dtoa() doesn't update *rve if the input value is NaN 5271 or Infinity. 5272 5273 No new tests because this doesn't change the behavior. 5274 5275 * JavaScriptCore.exp: 5276 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 5277 * runtime/UString.cpp: 5278 (JSC::createRep): 5279 (JSC::UString::UString): 5280 (JSC::UString::from): Move the code to doubleToStringInJavaScriptFormat(). 5281 * runtime/UString.h: 5282 * wtf/dtoa.cpp: 5283 (WTF::dtoa): Fix a bug about rve. 5284 (WTF::append): A helper for doubleToStringInJavaScriptFormat(). 5285 (WTF::doubleToStringInJavaScriptFormat): Move the code from UString::from(double). 5286 * wtf/dtoa.h: 5287 52882009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5289 5290 Reviewed by Kenneth Rohde Christiansen. 5291 5292 [Qt] Remove WTF_USE_JAVASCRIPTCORE_BINDINGS as it is no longer used 5293 https://bugs.webkit.org/show_bug.cgi?id=31643 5294 5295 * JavaScriptCore.pro: 5296 52972009-11-18 Nate Chapin <japhet@chromium.org> 5298 5299 Reviewed by Darin Fisher. 5300 5301 Remove Chromium's unnecessary dependency on wtf's tcmalloc files. 5302 5303 https://bugs.webkit.org/show_bug.cgi?id=31648 5304 5305 * JavaScriptCore.gyp/JavaScriptCore.gyp: 5306 53072009-11-18 Thiago Macieira <thiago.macieira@nokia.com> 5308 5309 Reviewed by Gavin Barraclough. 5310 5311 [Qt] Implement symbol hiding for JSC's JIT functions. 5312 5313 These functions are implemented directly in assembly, so they need the 5314 proper directives to enable/disable visibility. On ELF systems, it's 5315 .hidden, whereas on Mach-O systems (Mac) it's .private_extern. On 5316 Windows, it's not necessary since you have to explicitly export. I 5317 also implemented the AIX idiom, though it's unlikely anyone will 5318 implement AIX/POWER JIT. 5319 https://bugs.webkit.org/show_bug.cgi?id=30864 5320 5321 * jit/JITStubs.cpp: 5322 53232009-11-18 Oliver Hunt <oliver@apple.com> 5324 5325 Reviewed by Alexey Proskuryakov. 5326 5327 Interpreter may do an out of range access when throwing an exception in the profiler. 5328 https://bugs.webkit.org/show_bug.cgi?id=31635 5329 5330 Add bounds check. 5331 5332 * interpreter/Interpreter.cpp: 5333 (JSC::Interpreter::throwException): 5334 53352009-11-18 Gabor Loki <loki@inf.u-szeged.hu> 5336 5337 Reviewed by Darin Adler. 5338 5339 Fix the clobber list of cacheFlush for ARM and Thumb2 on Linux 5340 https://bugs.webkit.org/show_bug.cgi?id=31631 5341 5342 * jit/ExecutableAllocator.h: 5343 (JSC::ExecutableAllocator::cacheFlush): 5344 53452009-11-18 Harald Fernengel <harald.fernengel@nokia.com> 5346 5347 Reviewed by Simon Hausmann. 5348 5349 [Qt] Fix detection of linux-g++ 5350 5351 Never use "linux-g++*" to check for linux-g++, since this will break embedded 5352 builds which use linux-arm-g++ and friends. Use 'linux*-g++*' to check for any 5353 g++ on linux mkspec. 5354 5355 * JavaScriptCore.pri: 5356 53572009-11-17 Jon Honeycutt <jhoneycutt@apple.com> 5358 5359 Add JSContextRefPrivate.h to list of copied files. 5360 5361 Reviewed by Mark Rowe. 5362 5363 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: 5364 53652009-11-17 Martin Robinson <martin.james.robinson@gmail.com> 5366 5367 Reviewed by Adam Barth. 5368 5369 [GTK] Style cleanup for GOwnPtr 5370 https://bugs.webkit.org/show_bug.cgi?id=31506 5371 5372 Remove forward declaration in GOwnPtr and do some style cleanup. 5373 5374 * wtf/GOwnPtr.cpp: 5375 * wtf/GOwnPtr.h: 5376 (WTF::GOwnPtr::GOwnPtr): 5377 (WTF::GOwnPtr::~GOwnPtr): 5378 (WTF::GOwnPtr::get): 5379 (WTF::GOwnPtr::release): 5380 (WTF::GOwnPtr::outPtr): 5381 (WTF::GOwnPtr::set): 5382 (WTF::GOwnPtr::clear): 5383 (WTF::GOwnPtr::operator*): 5384 (WTF::GOwnPtr::operator->): 5385 (WTF::GOwnPtr::operator!): 5386 (WTF::GOwnPtr::operator UnspecifiedBoolType): 5387 (WTF::GOwnPtr::swap): 5388 (WTF::swap): 5389 (WTF::operator==): 5390 (WTF::operator!=): 5391 (WTF::getPtr): 5392 (WTF::freeOwnedGPtr): 5393 53942009-11-17 Oliver Hunt <oliver@apple.com> 5395 5396 Reviewed by Maciej Stachowiak. 5397 5398 Incorrect use of JavaScriptCore API in DumpRenderTree 5399 https://bugs.webkit.org/show_bug.cgi?id=31577 5400 5401 Add assertions to the 'toJS' functions to catch mistakes like 5402 this early. Restructure existing code which blindly passed potentially 5403 null values to toJS when forwarding exceptions so that a null check is 5404 performed first. 5405 5406 * API/APICast.h: 5407 (toJS): 5408 (toJSForGC): 5409 * API/JSCallbackObjectFunctions.h: 5410 (JSC::::getOwnPropertySlot): 5411 (JSC::::put): 5412 (JSC::::deleteProperty): 5413 (JSC::::construct): 5414 (JSC::::hasInstance): 5415 (JSC::::call): 5416 (JSC::::toNumber): 5417 (JSC::::toString): 5418 (JSC::::staticValueGetter): 5419 (JSC::::callbackGetter): 5420 * API/tests/testapi.c: Fix errors in the API tester. 5421 (MyObject_getProperty): 5422 (MyObject_convertToType): 5423 (EvilExceptionObject_convertToType): 5424 54252009-11-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 5426 5427 Reviewed by Gavin Barraclough. 5428 5429 https://bugs.webkit.org/show_bug.cgi?id=31050 5430 5431 Minor fixes for JSVALUE32_64: branchConvertDoubleToInt32 5432 failed on a CortexA8 CPU, but not on a simulator; and 5433 JITCall.cpp modifications was somehow not committed to mainline. 5434 5435 * assembler/ARMAssembler.h: 5436 (JSC::ARMAssembler::fmrs_r): 5437 * assembler/MacroAssemblerARM.h: 5438 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): 5439 * jit/JITCall.cpp: 5440 (JSC::JIT::compileOpCall): 5441 54422009-11-16 Joerg Bornemann <joerg.bornemann@trolltech.com> 5443 5444 Reviewed by Simon Hausmann. 5445 5446 Fix Qt build on Windows CE 6. 5447 5448 * JavaScriptCore.pri: Add missing include path. 5449 * wtf/Platform.h: Include ce_time.h for Windows CE 6. 5450 54512009-11-13 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 5452 5453 Reviewed by Gavin Barraclough. 5454 5455 https://bugs.webkit.org/show_bug.cgi?id=31050 5456 5457 Adding optimization support for mode JSVALUE32_64 5458 on ARM systems. 5459 5460 * jit/JIT.h: 5461 * jit/JITCall.cpp: 5462 (JSC::JIT::compileOpCall): 5463 * jit/JITPropertyAccess.cpp: 5464 (JSC::JIT::emit_op_method_check): 5465 (JSC::JIT::compileGetByIdHotPath): 5466 (JSC::JIT::compileGetByIdSlowCase): 5467 (JSC::JIT::emit_op_put_by_id): 5468 54692009-11-14 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 5470 5471 Reviewed by Gavin Barraclough. 5472 5473 https://bugs.webkit.org/show_bug.cgi?id=31050 5474 5475 Adding JSVALUE32_64 support for ARM (but not turning it 5476 on by default). All optimizations must be disabled, since 5477 this patch is only the first of a series of patches. 5478 5479 During the work, a lot of x86 specific code revealed and 5480 made platform independent. 5481 See revisions: 50531 50541 50593 50594 50595 5482 5483 * assembler/ARMAssembler.h: 5484 (JSC::ARMAssembler::): 5485 (JSC::ARMAssembler::fdivd_r): 5486 * assembler/MacroAssemblerARM.h: 5487 (JSC::MacroAssemblerARM::lshift32): 5488 (JSC::MacroAssemblerARM::neg32): 5489 (JSC::MacroAssemblerARM::rshift32): 5490 (JSC::MacroAssemblerARM::branchOr32): 5491 (JSC::MacroAssemblerARM::set8): 5492 (JSC::MacroAssemblerARM::setTest8): 5493 (JSC::MacroAssemblerARM::loadDouble): 5494 (JSC::MacroAssemblerARM::divDouble): 5495 (JSC::MacroAssemblerARM::convertInt32ToDouble): 5496 (JSC::MacroAssemblerARM::zeroDouble): 5497 * jit/JIT.cpp: 5498 * jit/JIT.h: 5499 * jit/JITOpcodes.cpp: 5500 (JSC::JIT::privateCompileCTIMachineTrampolines): 5501 * jit/JITStubs.cpp: 5502 * wtf/StdLibExtras.h: 5503 55042009-11-13 Dominik Röttsches <dominik.roettsches@access-company.com> 5505 5506 Reviewed by Eric Seidel. 5507 5508 Unify TextBoundaries implementations by only relying on WTF Unicode abstractions 5509 https://bugs.webkit.org/show_bug.cgi?id=31468 5510 5511 Adding isAlphanumeric abstraction, required 5512 by TextBoundaries.cpp. 5513 5514 * wtf/unicode/glib/UnicodeGLib.h: 5515 (WTF::Unicode::isAlphanumeric): 5516 * wtf/unicode/icu/UnicodeIcu.h: 5517 (WTF::Unicode::isAlphanumeric): 5518 55192009-11-13 Norbert Leser <norbert.leser&nokia.com> 5520 5521 Reviewed by Eric Seidel. 5522 5523 Added macros for USERINCLUDE paths within symbian blocks 5524 to guarantee inclusion of respective header files from local path 5525 first (to avoid clashes with same names of header files in system include path). 5526 5527 * JavaScriptCore.pri: 5528 55292009-11-13 Oliver Hunt <oliver@apple.com> 5530 5531 Reviewed by Geoff Garen. 5532 5533 JSValueProtect and JSValueUnprotect don't protect API wrapper values 5534 https://bugs.webkit.org/show_bug.cgi?id=31485 5535 5536 Make JSValueProtect/Unprotect use a new 'toJS' function, 'toJSForGC' that 5537 does not attempt to to strip out API wrapper objects. 5538 5539 * API/APICast.h: 5540 (toJSForGC): 5541 * API/JSValueRef.cpp: 5542 (JSValueProtect): 5543 (JSValueUnprotect): 5544 * API/tests/testapi.c: 5545 (makeGlobalNumberValue): 5546 (main): 5547 55482009-11-13 İsmail Dönmez <ismail@namtrac.org> 5549 5550 Reviewed by Antti Koivisto. 5551 5552 Fix typo, ce_time.cpp should be ce_time.c 5553 5554 * JavaScriptCore.pri: 5555 55562009-11-12 Steve VanDeBogart <vandebo@chromium.org> 5557 5558 Reviewed by Adam Barth. 5559 5560 Calculate the time offset only if we were able to parse 5561 the date string. This saves an IPC in Chromium for 5562 invalid date strings. 5563 https://bugs.webkit.org/show_bug.cgi?id=31416 5564 5565 * wtf/DateMath.cpp: 5566 (WTF::parseDateFromNullTerminatedCharacters): 5567 (JSC::parseDateFromNullTerminatedCharacters): 5568 55692009-11-12 Oliver Hunt <oliver@apple.com> 5570 5571 Rollout r50896 until i can work out why it causes failures. 5572 5573 * bytecompiler/BytecodeGenerator.cpp: 5574 (JSC::BytecodeGenerator::emitReturn): 5575 * interpreter/Interpreter.cpp: 5576 (JSC::Interpreter::execute): 5577 * parser/Nodes.cpp: 5578 (JSC::EvalNode::emitBytecode): 5579 55802009-11-12 Steve Falkenburg <sfalken@apple.com> 5581 5582 Reviewed by Stephanie Lewis. 5583 5584 Remove LIBRARY directive from def file to fix Debug_All target. 5585 5586 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 5587 55882009-11-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 5589 5590 Rubber-stamped by Holger Freyther. 5591 5592 Revert r50204, since it makes DRT crash on 32 bits release builds 5593 for GTK+. 5594 5595 * wtf/FastMalloc.h: 5596 55972009-11-12 Oliver Hunt <oliver@apple.com> 5598 5599 Reviewed by Gavin Barraclough. 5600 5601 Start unifying entry logic for function and eval code. 5602 5603 Eval now uses a ret instruction to end execution, and sets up 5604 a callframe more in line with what we do for function entry. 5605 5606 * bytecompiler/BytecodeGenerator.cpp: 5607 (JSC::BytecodeGenerator::emitReturn): 5608 * interpreter/Interpreter.cpp: 5609 (JSC::Interpreter::execute): 5610 * parser/Nodes.cpp: 5611 (JSC::EvalNode::emitBytecode): 5612 56132009-11-12 Richard Moe Gustavsen <richard.gustavsen@nokia.com> 5614 5615 Reviewed by Kenneth Rohde Christiansen. 5616 5617 [Qt] Disable pthread_setname_np. 5618 5619 This allows Qt builds on Mac from 10.6 to run on earlier version 5620 where this symbol is not present. 5621 https://bugs.webkit.org/show_bug.cgi?id=31403 5622 5623 * wtf/Platform.h: 5624 56252009-11-12 Thiago Macieira <thiago.macieira@nokia.com> 5626 5627 Reviewed by Kenneth Rohde Christiansen. 5628 5629 [Qt] Fix linking on Linux 32-bit. 5630 5631 It was missing the ".text" directive at the top of the file, 5632 indicating that code would follow. Without it, the assembler created 5633 "NOTYPE" symbols, which would result in linker errors. 5634 https://bugs.webkit.org/show_bug.cgi?id=30863 5635 5636 * jit/JITStubs.cpp: 5637 56382009-11-11 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5639 5640 Reviewed by Alexey Proskuryakov. 5641 5642 Refactor multiple JavaScriptCore threads 5643 https://bugs.webkit.org/show_bug.cgi?id=31328 5644 5645 Remove the id field from the PlatformThread structure 5646 as it is not used. 5647 5648 * runtime/Collector.cpp: 5649 (JSC::getCurrentPlatformThread): 5650 (JSC::suspendThread): 5651 (JSC::resumeThread): 5652 (JSC::getPlatformThreadRegisters): 5653 56542009-11-10 Geoffrey Garen <ggaren@apple.com> 5655 5656 Linux build fix: Added an #include for UINT_MAX. 5657 5658 * runtime/WeakRandom.h: 5659 56602009-11-10 Geoffrey Garen <ggaren@apple.com> 5661 5662 JavaScriptGlue build fix: Marked a file 'private' instead of 'project'. 5663 5664 * JavaScriptCore.xcodeproj/project.pbxproj: 5665 56662009-11-10 Geoffrey Garen <ggaren@apple.com> 5667 5668 Reviewed by Gavin "avGni arBalroguch" Barraclough. 5669 5670 Faster Math.random, based on GameRand. 5671 5672 SunSpider says 1.4% faster. 5673 5674 * GNUmakefile.am: 5675 * JavaScriptCore.gypi: 5676 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 5677 * JavaScriptCore.xcodeproj/project.pbxproj: Added the header to the project. 5678 5679 * runtime/JSGlobalData.cpp: 5680 (JSC::JSGlobalData::JSGlobalData): 5681 * runtime/JSGlobalData.h: Use an object to track random number generation 5682 state, initialized to the current time. 5683 5684 * runtime/MathObject.cpp: 5685 (JSC::MathObject::MathObject): 5686 (JSC::mathProtoFuncRandom): Use the new hotness. 5687 5688 * runtime/WeakRandom.h: Added. 5689 (JSC::WeakRandom::WeakRandom): 5690 (JSC::WeakRandom::get): 5691 (JSC::WeakRandom::advance): The new hotness. 5692 56932009-11-09 Geoffrey Garen <ggaren@apple.com> 5694 5695 Reviewed by Oliver Hunt. 5696 5697 Imported the v8 DST cache. 5698 5699 SunSpider says 1.5% faster. 5700 5701 * runtime/JSGlobalData.cpp: 5702 (JSC::JSGlobalData::resetDateCache): Reset the DST cache when resetting 5703 other date data. 5704 5705 * runtime/JSGlobalData.h: 5706 (JSC::DSTOffsetCache::DSTOffsetCache): 5707 (JSC::DSTOffsetCache::reset): Added a struct for the DST cache. 5708 5709 * wtf/DateMath.cpp: 5710 (WTF::calculateDSTOffsetSimple): 5711 (WTF::calculateDSTOffset): 5712 (WTF::parseDateFromNullTerminatedCharacters): 5713 (JSC::getDSTOffset): 5714 (JSC::gregorianDateTimeToMS): 5715 (JSC::msToGregorianDateTime): 5716 (JSC::parseDateFromNullTerminatedCharacters): 5717 * wtf/DateMath.h: The imported code for probing and updating the cache. 5718 57192009-11-09 Geoffrey Garen <ggaren@apple.com> 5720 5721 Reviewed by Oliver Hunt. 5722 5723 Fixed an edge case that could cause the engine not to notice a timezone 5724 change. 5725 5726 No test because this case would require manual intervention to change 5727 the timezone during the test. 5728 5729 SunSpider reports no change. 5730 5731 * runtime/DateInstanceCache.h: 5732 (JSC::DateInstanceCache::DateInstanceCache): 5733 (JSC::DateInstanceCache::reset): Added a helper function for resetting 5734 this cache. Also, shrank the cache, since we'll be resetting it often. 5735 5736 * runtime/JSGlobalData.cpp: 5737 (JSC::JSGlobalData::resetDateCache): Include resetting the DateInstanceCache 5738 in resetting Date data. (Otherwise, a cache hit could bypass a necessary 5739 timezone update check.) 5740 57412009-11-09 Geoffrey Garen <ggaren@apple.com> 5742 5743 Reviewed by Sam Weinig. 5744 5745 Some manual inlining and constant propogation in Date code. 5746 5747 SunSpider reports a 0.4% speedup on date-*, no overall speedup. Shark 5748 says some previously evident stalls are now gone. 5749 5750 * runtime/DateConstructor.cpp: 5751 (JSC::callDate): 5752 * runtime/DateConversion.cpp: 5753 (JSC::formatTime): 5754 (JSC::formatTimeUTC): Split formatTime into UTC and non-UTC variants. 5755 5756 * runtime/DateConversion.h: 5757 * runtime/DateInstance.cpp: 5758 (JSC::DateInstance::calculateGregorianDateTime): 5759 (JSC::DateInstance::calculateGregorianDateTimeUTC): 5760 * runtime/DateInstance.h: 5761 (JSC::DateInstance::gregorianDateTime): 5762 (JSC::DateInstance::gregorianDateTimeUTC): Split gregorianDateTime into 5763 a UTC and non-UTC variant, and split each variant into a fast inline 5764 case and a slow out-of-line case. 5765 5766 * runtime/DatePrototype.cpp: 5767 (JSC::formatLocaleDate): 5768 (JSC::dateProtoFuncToString): 5769 (JSC::dateProtoFuncToUTCString): 5770 (JSC::dateProtoFuncToISOString): 5771 (JSC::dateProtoFuncToDateString): 5772 (JSC::dateProtoFuncToTimeString): 5773 (JSC::dateProtoFuncGetFullYear): 5774 (JSC::dateProtoFuncGetUTCFullYear): 5775 (JSC::dateProtoFuncToGMTString): 5776 (JSC::dateProtoFuncGetMonth): 5777 (JSC::dateProtoFuncGetUTCMonth): 5778 (JSC::dateProtoFuncGetDate): 5779 (JSC::dateProtoFuncGetUTCDate): 5780 (JSC::dateProtoFuncGetDay): 5781 (JSC::dateProtoFuncGetUTCDay): 5782 (JSC::dateProtoFuncGetHours): 5783 (JSC::dateProtoFuncGetUTCHours): 5784 (JSC::dateProtoFuncGetMinutes): 5785 (JSC::dateProtoFuncGetUTCMinutes): 5786 (JSC::dateProtoFuncGetSeconds): 5787 (JSC::dateProtoFuncGetUTCSeconds): 5788 (JSC::dateProtoFuncGetTimezoneOffset): 5789 (JSC::setNewValueFromTimeArgs): 5790 (JSC::setNewValueFromDateArgs): 5791 (JSC::dateProtoFuncSetYear): 5792 (JSC::dateProtoFuncGetYear): Updated for the gregorianDateTime change above. 5793 57942009-11-09 Geoffrey Garen <ggaren@apple.com> 5795 5796 Build fix: export a new symbol. 5797 5798 * JavaScriptCore.exp: 5799 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 5800 58012009-11-09 Geoffrey Garen <ggaren@apple.com> 5802 5803 Reviewed by Sam "Home Wrecker" Weinig. 5804 5805 Added a tiny cache for Date parsing. 5806 5807 SunSpider says 1.2% faster. 5808 5809 * runtime/DateConversion.cpp: 5810 (JSC::parseDate): Try to reuse the last parsed Date, if present. 5811 5812 * runtime/JSGlobalData.cpp: 5813 (JSC::JSGlobalData::resetDateCache): 5814 * runtime/JSGlobalData.h: Added storage for last parsed Date. Refactored 5815 this code to make resetting the date cache easier. 5816 5817 * runtime/JSGlobalObject.h: 5818 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for 5819 refactoring. 5820 5821 * wtf/DateMath.cpp: 5822 (JSC::parseDateFromNullTerminatedCharacters): 5823 * wtf/DateMath.h: Changed ExecState to be first parameter, as is the JSC custom. 5824 58252009-11-09 Oliver Hunt <oliver@apple.com> 5826 5827 Reviewed by Gavin Barraclough. 5828 5829 Can cache prototype lookups on uncacheable dictionaries. 5830 https://bugs.webkit.org/show_bug.cgi?id=31198 5831 5832 Replace fromDictionaryTransition with flattenDictionaryObject and 5833 flattenDictionaryStructure. This change is necessary as we need to 5834 guarantee that our attempt to convert away from a dictionary structure 5835 will definitely succeed, and in some cases this requires mutating the 5836 object storage itself. 5837 5838 * interpreter/Interpreter.cpp: 5839 (JSC::Interpreter::tryCacheGetByID): 5840 * jit/JITStubs.cpp: 5841 (JSC::JITThunks::tryCacheGetByID): 5842 (JSC::DEFINE_STUB_FUNCTION): 5843 * runtime/BatchedTransitionOptimizer.h: 5844 (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer): 5845 * runtime/JSObject.h: 5846 (JSC::JSObject::flattenDictionaryObject): 5847 * runtime/Operations.h: 5848 (JSC::normalizePrototypeChain): 5849 * runtime/Structure.cpp: 5850 (JSC::Structure::flattenDictionaryStructure): 5851 (JSC::comparePropertyMapEntryIndices): 5852 * runtime/Structure.h: 5853 58542009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5855 5856 Not reviewed, build fix. 5857 5858 Remove extra character from r50701. 5859 5860 * JavaScriptCore.pri: 5861 58622009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5863 5864 Not reviewed, build fix. 5865 5866 Revert r50695 because it broke QtWebKit (clean builds). 5867 5868 * JavaScriptCore.pri: 5869 58702009-11-09 Norbert Leser <norbert.leser@nokia.com> 5871 5872 Reviewed by Kenneth Rohde Christiansen. 5873 5874 Prepended $$PWD to GENERATED_SOURCES_DIR to avoid potential ambiguities when included from WebCore.pro. 5875 Some preprocessors consider this GENERATED_SOURCES_DIR relative to current invoking dir (e.g., ./WebCore), 5876 and not the working dir of JavaCriptCore.pri (i.e., ../JavaScriptCore/). 5877 5878 * JavaScriptCore.pri: 5879 58802009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5881 5882 Reviewed by Kenneth Rohde Christiansen. 5883 5884 Use explicit parentheses to silence gcc 4.4 -Wparentheses warnings 5885 https://bugs.webkit.org/show_bug.cgi?id=31040 5886 5887 * interpreter/Interpreter.cpp: 5888 (JSC::Interpreter::privateExecute): 5889 58902009-11-08 David Levin <levin@chromium.org> 5891 5892 Reviewed by NOBODY (speculative snow leopard and windows build fixes). 5893 5894 * wtf/DateMath.cpp: 5895 (WTF::parseDateFromNullTerminatedCharacters): 5896 (JSC::gregorianDateTimeToMS): 5897 (JSC::msToGregorianDateTime): 5898 (JSC::parseDateFromNullTerminatedCharacters): 5899 * wtf/DateMath.h: 5900 (JSC::GregorianDateTime::GregorianDateTime): 5901 59022009-11-08 David Levin <levin@chromium.org> 5903 5904 Reviewed by NOBODY (chromium build fix). 5905 5906 Hopefully, the last build fix. 5907 5908 Create better separation in DateMath about the JSC 5909 and non-JSC portions. Also, only expose the non-JSC 5910 version in the exports. 5911 5912 * JavaScriptCore.exp: 5913 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 5914 * wtf/DateMath.cpp: 5915 (WTF::parseDateFromNullTerminatedCharacters): 5916 (JSC::getUTCOffset): 5917 (JSC::gregorianDateTimeToMS): 5918 (JSC::msToGregorianDateTime): 5919 (JSC::parseDateFromNullTerminatedCharacters): 5920 * wtf/DateMath.h: 5921 (JSC::gmtoffset): 5922 59232009-11-08 David Levin <levin@chromium.org> 5924 5925 Reviewed by NOBODY (chromium build fix). 5926 5927 For the change in DateMath. 5928 5929 * config.h: 5930 * wtf/DateMath.cpp: 5931 59322009-11-06 Geoffrey Garen <ggaren@apple.com> 5933 5934 Windows build fix: export some symbols. 5935 5936 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 5937 59382009-11-06 Geoffrey Garen <ggaren@apple.com> 5939 5940 Build fix: updated export file. 5941 5942 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 5943 59442009-11-06 Geoffrey Garen <ggaren@apple.com> 5945 5946 Build fix: added some #includes. 5947 5948 * wtf/CurrentTime.h: 5949 * wtf/DateMath.h: 5950 59512009-11-06 Geoffrey Garen <ggaren@apple.com> 5952 5953 Reviewed by Oliver Hunt. 5954 5955 https://bugs.webkit.org/show_bug.cgi?id=31197 5956 Implemented a timezone cache not based on Mac OS X's notify_check API. 5957 5958 If the VM calculates the local timezone offset from UTC, it caches the 5959 result until the end of the current VM invocation. (We don't want to cache 5960 forever, because the user's timezone may change over time.) 5961 5962 This removes notify_* overhead on Mac, and, more significantly, removes 5963 OS time and date call overhead on non-Mac platforms. 5964 5965 ~8% speedup on Date microbenchmark on Mac. SunSpider reports maybe a tiny 5966 speedup on Mac. (Speedup on non-Mac platforms should be even more noticeable.) 5967 5968 * JavaScriptCore.exp: 5969 5970 * interpreter/CachedCall.h: 5971 (JSC::CachedCall::CachedCall): 5972 * interpreter/Interpreter.cpp: 5973 (JSC::Interpreter::execute): 5974 * runtime/JSGlobalObject.h: 5975 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Made the 5976 DynamicGlobalObjectScope constructor responsible for checking whether a 5977 dynamicGlobalObject has already been set. This eliminated some duplicate 5978 client code, and allowed me to avoid adding even more duplicate client 5979 code. Made DynamicGlobalObjectScope responsible for resetting the 5980 local timezone cache upon first entry to the VM. 5981 5982 * runtime/DateConstructor.cpp: 5983 (JSC::constructDate): 5984 (JSC::callDate): 5985 (JSC::dateParse): 5986 (JSC::dateUTC): 5987 * runtime/DateConversion.cpp: 5988 (JSC::parseDate): 5989 * runtime/DateConversion.h: 5990 * runtime/DateInstance.cpp: 5991 (JSC::DateInstance::gregorianDateTime): 5992 * runtime/DateInstance.h: 5993 * runtime/DateInstanceCache.h: 5994 * runtime/DatePrototype.cpp: 5995 (JSC::setNewValueFromTimeArgs): 5996 (JSC::setNewValueFromDateArgs): 5997 (JSC::dateProtoFuncSetYear): 5998 * runtime/InitializeThreading.cpp: 5999 (JSC::initializeThreadingOnce): 6000 * runtime/JSGlobalData.cpp: 6001 (JSC::JSGlobalData::JSGlobalData): 6002 * runtime/JSGlobalData.h: 6003 * wtf/DateMath.cpp: 6004 (WTF::getCurrentUTCTime): 6005 (WTF::getCurrentUTCTimeWithMicroseconds): 6006 (WTF::getLocalTime): 6007 (JSC::getUTCOffset): Use the new cache. Also, see below. 6008 (JSC::gregorianDateTimeToMS): 6009 (JSC::msToGregorianDateTime): 6010 (JSC::initializeDates): 6011 (JSC::parseDateFromNullTerminatedCharacters): Simplified the way this function 6012 accounts for the local timezone offset, to accomodate our new caching API, 6013 and a (possibly misguided) caller in WebCore. Also, see below. 6014 * wtf/DateMath.h: 6015 (JSC::GregorianDateTime::GregorianDateTime): Moved most of the code in 6016 DateMath.* into the JSC namespace. The code needed to move so it could 6017 naturally interact with ExecState and JSGlobalData to support caching. 6018 Logically, it seemed right to move it, too, since this code is not really 6019 as low-level as the WTF namespace might imply -- it implements a set of 6020 date parsing and conversion quirks that are finely tuned to the JavaScript 6021 language. Also removed the Mac OS X notify_* infrastructure. 6022 6023 * wtf/CurrentTime.h: 6024 (WTF::currentTimeMS): 6025 (WTF::getLocalTime): Moved the rest of the DateMath code here, and renamed 6026 it to make it consistent with WTF's currentTime function. 6027 60282009-11-06 Gabor Loki <loki@inf.u-szeged.hu> 6029 6030 Unreviewed trivial buildfix after r50595. 6031 6032 Rename the remaining rshiftPtr calls to rshift32 6033 6034 * jit/JITArithmetic.cpp: 6035 (JSC::JIT::emit_op_rshift): 6036 * jit/JITInlineMethods.h: 6037 (JSC::JIT::emitFastArithImmToInt): 6038 60392009-11-06 Gavin Barraclough <barraclough@apple.com> 6040 6041 Reviewed by Oliver Hunt. 6042 6043 Tidy up the shift methods on the macro-assembler interface. 6044 6045 Currently behaviour of shifts of a magnitude > 0x1f is undefined. 6046 Instead defined that all shifts are masked to this range. This makes a lot of 6047 practical sense, both since having undefined behaviour is not particularly 6048 desirable, and because this behaviour is commonly required (particularly since 6049 it is required bt ECMA-262 for shifts). 6050 6051 Update the ARM assemblers to provide this behaviour. Remove (now) redundant 6052 masks from JITArithmetic, and remove rshiftPtr (this was used in case that 6053 could be rewritten in a simpler form using rshift32, only optimized JSVALUE32 6054 on x86-64, which uses JSVALUE64!) 6055 6056 * assembler/MacroAssembler.h: 6057 * assembler/MacroAssemblerARM.h: 6058 (JSC::MacroAssemblerARM::lshift32): 6059 (JSC::MacroAssemblerARM::rshift32): 6060 * assembler/MacroAssemblerARMv7.h: 6061 (JSC::MacroAssemblerARMv7::lshift32): 6062 (JSC::MacroAssemblerARMv7::rshift32): 6063 * assembler/MacroAssemblerX86_64.h: 6064 * jit/JITArithmetic.cpp: 6065 (JSC::JIT::emit_op_lshift): 6066 (JSC::JIT::emit_op_rshift): 6067 60682009-11-05 Gavin Barraclough <barraclough@apple.com> 6069 6070 Rubber Stamped by Oliver Hunt. 6071 6072 Remove a magic number (1) from the JIT, instead compute the value with OBJECT_OFFSET. 6073 6074 * jit/JITInlineMethods.h: 6075 (JSC::JIT::emitPutJITStubArg): 6076 (JSC::JIT::emitPutJITStubArgConstant): 6077 (JSC::JIT::emitGetJITStubArg): 6078 (JSC::JIT::emitPutJITStubArgFromVirtualRegister): 6079 * jit/JITStubCall.h: 6080 (JSC::JITStubCall::JITStubCall): 6081 (JSC::JITStubCall::getArgument): 6082 * jit/JITStubs.h: 6083 60842009-11-05 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 6085 6086 Reviewed by Gavin Barraclough. 6087 6088 https://bugs.webkit.org/show_bug.cgi?id=31159 6089 Fix branchDouble behaviour on ARM THUMB2 JIT. 6090 6091 The x86 branchDouble behaviour is reworked, and all JIT 6092 ports should follow the x86 port. See bug 31104 and 31151 6093 6094 This patch contains a fix for the traditional ARM port 6095 6096 * assembler/ARMAssembler.h: 6097 (JSC::ARMAssembler::): 6098 (JSC::ARMAssembler::fmrs_r): 6099 (JSC::ARMAssembler::ftosid_r): 6100 * assembler/MacroAssemblerARM.h: 6101 (JSC::MacroAssemblerARM::): 6102 (JSC::MacroAssemblerARM::branchDouble): 6103 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): 6104 61052009-11-05 Chris Jerdonek <chris.jerdonek@gmail.com> 6106 6107 Reviewed by Eric Seidel. 6108 6109 Removed the "this is part of the KDE project" comments from 6110 all *.h, *.cpp, *.idl, and *.pm files. 6111 6112 https://bugs.webkit.org/show_bug.cgi?id=31167 6113 6114 The maintenance and architecture page in the project wiki lists 6115 this as a task. 6116 6117 This change includes no changes or additions to test cases 6118 since the change affects only comments. 6119 6120 * wtf/wince/FastMallocWince.h: 6121 61222009-11-05 Gabor Loki <loki@inf.u-szeged.hu> 6123 6124 Reviewed by Gavin Barraclough. 6125 6126 Use ARMv7 specific encoding for immediate constants on ARMv7 target 6127 https://bugs.webkit.org/show_bug.cgi?id=31060 6128 6129 * assembler/ARMAssembler.cpp: 6130 (JSC::ARMAssembler::getOp2): Use INVALID_IMM 6131 (JSC::ARMAssembler::getImm): Use encodeComplexImm for complex immediate 6132 (JSC::ARMAssembler::moveImm): Ditto. 6133 (JSC::ARMAssembler::encodeComplexImm): Encode a constant by one or two 6134 instructions or a PC relative load. 6135 * assembler/ARMAssembler.h: Use INVALID_IMM if a constant cannot be 6136 encoded as an immediate constant. 6137 (JSC::ARMAssembler::): 6138 (JSC::ARMAssembler::movw_r): 16-bit immediate load 6139 (JSC::ARMAssembler::movt_r): High halfword 16-bit immediate load 6140 (JSC::ARMAssembler::getImm16Op2): Encode immediate constant for 6141 movw_r and mowt_r 6142 61432009-11-04 Mark Mentovai <mark@chromium.org> 6144 6145 Reviewed by Mark Rowe. 6146 6147 Provide TARGETING_TIGER and TARGETING_LEOPARD as analogues to 6148 BUILDING_ON_TIGER and BUILDING_ON_LEOPARD. The TARGETING_ macros 6149 consider the deployment target; the BUILDING_ON_ macros consider the 6150 headers being built against. 6151 6152 * wtf/Platform.h: 6153 61542009-11-04 Gavin Barraclough <barraclough@apple.com> 6155 6156 Reviewed by Oliver Hunt. 6157 6158 https://bugs.webkit.org/show_bug.cgi?id=31151 6159 Fix branchDouble behaviour on ARM THUMB2 JIT. 6160 6161 The ARMv7 JIT is currently using ARMv7Assembler::ConditionEQ to branch 6162 for DoubleEqualOrUnordered, however this is incorrect – ConditionEQ won't 6163 branch on unordered operands. Similarly, DoubleLessThanOrUnordered & 6164 DoubleLessThanOrEqualOrUnordered use ARMv7Assembler::ConditionLO & 6165 ARMv7Assembler::ConditionLS, whereas they should be using 6166 ARMv7Assembler::ConditionLT & ARMv7Assembler::ConditionLE. 6167 6168 Fix these, and fill out the missing DoubleConditions. 6169 6170 * assembler/MacroAssemblerARMv7.h: 6171 (JSC::MacroAssemblerARMv7::): 6172 (JSC::MacroAssemblerARMv7::branchDouble): 6173 61742009-11-04 Gavin Barraclough <barraclough@apple.com> 6175 6176 Rubber Stamped by Oliver Hunt. 6177 6178 Enable native call optimizations on ARMv7. (Existing ARM_TRADITIONAL 6179 implementation was generic, worked perfectly, just needed turning on). 6180 6181 * jit/JITOpcodes.cpp: 6182 * wtf/Platform.h: 6183 61842009-11-04 Gavin Barraclough <barraclough@apple.com> 6185 6186 Rubber Stamped by Mark Rowe, Oliver Hunt, and Sam Weinig. 6187 6188 Add a missing assert to the ARMv7 JIT. 6189 6190 * assembler/ARMv7Assembler.h: 6191 (JSC::ARMThumbImmediate::ARMThumbImmediate): 6192 61932009-11-04 Mark Rowe <mrowe@apple.com> 6194 6195 Rubber-stamped by Oliver Hunt. 6196 6197 Remove bogus op_ prefix on dumped version of three opcodes. 6198 6199 * bytecode/CodeBlock.cpp: 6200 (JSC::CodeBlock::dump): 6201 62022009-11-04 Mark Rowe <mrowe@apple.com> 6203 6204 Reviewed by Sam Weinig. 6205 6206 Fix dumping of constants in bytecode so that they aren't printed as large positive register numbers. 6207 6208 We do this by having the registerName function return information about the constant if the register 6209 number corresponds to a constant. This requires that registerName, and several functions that call it, 6210 be converted to member functions of CodeBlock so that the constant value can be retrieved. The 6211 ExecState also needs to be threaded down through these functions so that it can be passed on to 6212 constantName when needed. 6213 6214 * bytecode/CodeBlock.cpp: 6215 (JSC::constantName): 6216 (JSC::CodeBlock::registerName): 6217 (JSC::CodeBlock::printUnaryOp): 6218 (JSC::CodeBlock::printBinaryOp): 6219 (JSC::CodeBlock::printConditionalJump): 6220 (JSC::CodeBlock::printGetByIdOp): 6221 (JSC::CodeBlock::printPutByIdOp): 6222 (JSC::CodeBlock::dump): 6223 * bytecode/CodeBlock.h: 6224 (JSC::CodeBlock::isConstantRegisterIndex): 6225 62262009-11-04 Pavel Heimlich <tropikhajma@gmail.com> 6227 6228 Reviewed by Alexey Proskuryakov. 6229 6230 https://bugs.webkit.org/show_bug.cgi?id=30647 6231 Solaris build failure due to strnstr. 6232 6233 * wtf/StringExtras.h: Enable strnstr on Solaris, too. 6234 62352009-11-04 Gavin Barraclough <barraclough@apple.com> 6236 6237 Reviewed by Oliver Hunt. 6238 6239 https://bugs.webkit.org/show_bug.cgi?id=31104 6240 Refactor x86-specific behaviour out of the JIT. 6241 6242 - Add explicit double branch conditions for ordered and unordered comparisons (presently the brehaviour is a mix). 6243 - Refactor double to int conversion out into the MacroAssembler. 6244 - Remove broken double to int conversion for !JSVALUE32_64 builds - this code was broken and slowing us down, fixing it showed it not to be an improvement. 6245 - Remove exclusion of double to int conversion from (1 % X) cases in JSVALUE32_64 builds - if this was of benefit this is no longer the case; simplify. 6246 6247 * assembler/MacroAssemblerARM.h: 6248 (JSC::MacroAssemblerARM::): 6249 * assembler/MacroAssemblerARMv7.h: 6250 (JSC::MacroAssemblerARMv7::): 6251 * assembler/MacroAssemblerX86Common.h: 6252 (JSC::MacroAssemblerX86Common::): 6253 (JSC::MacroAssemblerX86Common::convertInt32ToDouble): 6254 (JSC::MacroAssemblerX86Common::branchDouble): 6255 (JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32): 6256 * jit/JITArithmetic.cpp: 6257 (JSC::JIT::emitBinaryDoubleOp): 6258 (JSC::JIT::emit_op_div): 6259 (JSC::JIT::emitSlow_op_jnless): 6260 (JSC::JIT::emitSlow_op_jnlesseq): 6261 * jit/JITOpcodes.cpp: 6262 (JSC::JIT::emit_op_jfalse): 6263 62642009-11-04 Mark Mentovai <mark@chromium.org> 6265 6266 Reviewed by Eric Seidel. 6267 6268 Remove BUILDING_ON_LEOPARD from JavaScriptCore.gyp. This is supposed 6269 to be set as needed only in wtf/Platform.h. 6270 6271 * JavaScriptCore.gyp/JavaScriptCore.gyp: 6272 62732009-11-02 Oliver Hunt <oliver@apple.com> 6274 6275 Reviewed by Gavin Barraclough. 6276 6277 REGRESSION (r48573): JSC may incorrectly cache chain lookups with a dictionary at the head of the chain 6278 https://bugs.webkit.org/show_bug.cgi?id=31045 6279 6280 Add guards to prevent caching of prototype chain lookups with dictionaries at the 6281 head of the chain. Also add a few tighter assertions to cached prototype lookups 6282 to catch this in future. 6283 6284 * interpreter/Interpreter.cpp: 6285 (JSC::Interpreter::tryCacheGetByID): 6286 (JSC::Interpreter::privateExecute): 6287 * jit/JITStubs.cpp: 6288 (JSC::JITThunks::tryCacheGetByID): 6289 62902009-11-02 Laszlo Gombos <laszlo.1.gombos@nokia.com> 6291 6292 Reviewed by Darin Adler. 6293 6294 PLATFORM(CF) should be set when building for Qt on Darwin 6295 https://bugs.webkit.org/show_bug.cgi?id=23671 6296 6297 * wtf/Platform.h: Turn on CF support if both QT and DARWIN 6298 platforms are defined. 6299 63002009-11-02 Dmitry Titov <dimich@chromium.org> 6301 6302 Reviewed by David Levin. 6303 6304 Remove threadsafe refcounting from tasks used with WTF::MessageQueue. 6305 https://bugs.webkit.org/show_bug.cgi?id=30612 6306 6307 * wtf/MessageQueue.h: 6308 (WTF::MessageQueue::alwaysTruePredicate): 6309 (WTF::MessageQueue::~MessageQueue): 6310 (WTF::MessageQueue::append): 6311 (WTF::MessageQueue::appendAndCheckEmpty): 6312 (WTF::MessageQueue::prepend): 6313 (WTF::MessageQueue::waitForMessage): 6314 (WTF::MessageQueue::waitForMessageFilteredWithTimeout): 6315 (WTF::MessageQueue::tryGetMessage): 6316 (WTF::MessageQueue::removeIf): 6317 The MessageQueue is changed to act as a queue of OwnPtr<DataType>. It takes ownership 6318 of posted tasks and passes it to the new owner (in another thread) when the task is fetched. 6319 All methods have arguments of type PassOwnPtr<DataType> and return the same type. 6320 6321 * wtf/Threading.cpp: 6322 (WTF::createThread): 6323 Superficial change to trigger rebuild of JSC project on Windows, 6324 workaround for https://bugs.webkit.org/show_bug.cgi?id=30890 6325 63262009-10-30 Geoffrey Garen <ggaren@apple.com> 6327 6328 Reviewed by Oliver Hunt. 6329 6330 Fixed failing layout test: restore a special case I accidentally deleted. 6331 6332 * runtime/DatePrototype.cpp: 6333 (JSC::setNewValueFromDateArgs): In the case of applying a change to a date 6334 that is NaN, reset the date to 0 *and* then apply the change; don't just 6335 reset the date to 0. 6336 63372009-10-30 Geoffrey Garen <ggaren@apple.com> 6338 6339 Windows build fix: update for object-to-pointer change. 6340 6341 * runtime/DatePrototype.cpp: 6342 (JSC::formatLocaleDate): 6343 63442009-10-29 Geoffrey Garen <ggaren@apple.com> 6345 6346 Reviewed by Darin Adler. 6347 6348 https://bugs.webkit.org/show_bug.cgi?id=30942 6349 Use pointers instead of copies to pass GregorianDateTime objects around. 6350 6351 SunSpider reports a shocking 4.5% speedup on date-format-xparb, and 1.3% 6352 speedup on date-format-tofte. 6353 6354 * runtime/DateInstance.cpp: 6355 (JSC::DateInstance::gregorianDateTime): 6356 * runtime/DateInstance.h: 6357 * runtime/DatePrototype.cpp: 6358 (JSC::formatLocaleDate): 6359 (JSC::dateProtoFuncToString): 6360 (JSC::dateProtoFuncToUTCString): 6361 (JSC::dateProtoFuncToISOString): 6362 (JSC::dateProtoFuncToDateString): 6363 (JSC::dateProtoFuncToTimeString): 6364 (JSC::dateProtoFuncGetFullYear): 6365 (JSC::dateProtoFuncGetUTCFullYear): 6366 (JSC::dateProtoFuncToGMTString): 6367 (JSC::dateProtoFuncGetMonth): 6368 (JSC::dateProtoFuncGetUTCMonth): 6369 (JSC::dateProtoFuncGetDate): 6370 (JSC::dateProtoFuncGetUTCDate): 6371 (JSC::dateProtoFuncGetDay): 6372 (JSC::dateProtoFuncGetUTCDay): 6373 (JSC::dateProtoFuncGetHours): 6374 (JSC::dateProtoFuncGetUTCHours): 6375 (JSC::dateProtoFuncGetMinutes): 6376 (JSC::dateProtoFuncGetUTCMinutes): 6377 (JSC::dateProtoFuncGetSeconds): 6378 (JSC::dateProtoFuncGetUTCSeconds): 6379 (JSC::dateProtoFuncGetTimezoneOffset): 6380 (JSC::setNewValueFromTimeArgs): 6381 (JSC::setNewValueFromDateArgs): 6382 (JSC::dateProtoFuncSetYear): 6383 (JSC::dateProtoFuncGetYear): Renamed getGregorianDateTime to gregorianDateTime, 6384 since it no longer has an out parameter. Uses 0 to indicate invalid dates. 6385 63862009-10-30 Zoltan Horvath <zoltan@webkit.org> 6387 6388 Reviewed by Darin Adler. 6389 6390 Allow custom memory allocation control for JavaScriptCore's ListHashSet 6391 https://bugs.webkit.org/show_bug.cgi?id=30853 6392 6393 Inherits ListHashSet class from FastAllocBase because it is 6394 instantiated by 'new' in WebCore/rendering/RenderBlock.cpp:1813. 6395 6396 * wtf/ListHashSet.h: 6397 63982009-10-30 Oliver Hunt <oliver@apple.com> 6399 6400 Reviewed by Gavin Barraclough. 6401 6402 Regression: crash enumerating properties of an object with getters or setters 6403 https://bugs.webkit.org/show_bug.cgi?id=30948 6404 6405 Add a guard to prevent us trying to cache property enumeration on 6406 objects with getters or setters. 6407 6408 * runtime/JSPropertyNameIterator.cpp: 6409 (JSC::JSPropertyNameIterator::create): 6410 64112009-10-30 Roland Steiner <rolandsteiner@chromium.org> 6412 6413 Reviewed by Eric Seidel. 6414 6415 Remove ENABLE_RUBY guards as discussed with Dave Hyatt and Maciej Stachowiak. 6416 6417 Bug 28420 - Implement HTML5 <ruby> rendering 6418 (https://bugs.webkit.org/show_bug.cgi?id=28420) 6419 6420 No new tests (no functional change). 6421 6422 * Configurations/FeatureDefines.xcconfig: 6423 64242009-10-29 Oliver Hunt <oliver@apple.com> 6425 6426 Reviewed by Maciej Stachowiak. 6427 6428 REGRESSION (r50218-r50262): E*TRADE accounts page is missing content 6429 https://bugs.webkit.org/show_bug.cgi?id=30947 6430 <rdar://problem/7348833> 6431 6432 The logic for flagging that a structure has non-enumerable properties 6433 was in addPropertyWithoutTransition, rather than in the core Structure::put 6434 method. Despite this I was unable to produce a testcase that caused 6435 the failure that etrade was experiencing, but the new assertion in 6436 getEnumerablePropertyNames triggers on numerous layout tests without 6437 the fix, so in effecti all for..in enumeration in any test ends up 6438 doing the required consistency check. 6439 6440 * runtime/Structure.cpp: 6441 (JSC::Structure::addPropertyWithoutTransition): 6442 (JSC::Structure::put): 6443 (JSC::Structure::getEnumerablePropertyNames): 6444 (JSC::Structure::checkConsistency): 6445 64462009-10-29 Gabor Loki <loki@inf.u-szeged.hu> 6447 6448 Reviewed by Gavin Barraclough. 6449 6450 Add cacheFlush support for Thumb-2 on Linux 6451 https://bugs.webkit.org/show_bug.cgi?id=30865 6452 6453 * jit/ExecutableAllocator.h: 6454 (JSC::ExecutableAllocator::cacheFlush): 6455 64562009-10-28 Gavin Barraclough <barraclough@apple.com> 6457 6458 Reviewed by Oliver Hunt. 6459 6460 JSC JIT on ARMv7 cannot link jumps >16Mb range 6461 https://bugs.webkit.org/show_bug.cgi?id=30891 6462 6463 Start planing all relative jumps as move-32-bit-immediate-to-register-BX. 6464 In the cases where the jump would fall within a relative jump range, use a relative jump. 6465 6466 * JavaScriptCore.xcodeproj/project.pbxproj: 6467 * assembler/ARMv7Assembler.h: 6468 (JSC::ARMv7Assembler::~ARMv7Assembler): 6469 (JSC::ARMv7Assembler::LinkRecord::LinkRecord): 6470 (JSC::ARMv7Assembler::): 6471 (JSC::ARMv7Assembler::executableCopy): 6472 (JSC::ARMv7Assembler::linkJump): 6473 (JSC::ARMv7Assembler::relinkJump): 6474 (JSC::ARMv7Assembler::setInt32): 6475 (JSC::ARMv7Assembler::isB): 6476 (JSC::ARMv7Assembler::isBX): 6477 (JSC::ARMv7Assembler::isMOV_imm_T3): 6478 (JSC::ARMv7Assembler::isMOVT): 6479 (JSC::ARMv7Assembler::isNOP_T1): 6480 (JSC::ARMv7Assembler::isNOP_T2): 6481 (JSC::ARMv7Assembler::linkJumpAbsolute): 6482 (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst): 6483 (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond): 6484 (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp5i6Imm4Reg4EncodedImm): 6485 * assembler/MacroAssemblerARMv7.h: 6486 (JSC::MacroAssemblerARMv7::makeJump): 6487 (JSC::MacroAssemblerARMv7::makeBranch): 6488 * jit/JIT.h: 6489 * wtf/Platform.h: 6490 64912009-10-28 Oliver Hunt <oliver@apple.com> 6492 6493 Reviewed by Geoff Garen. 6494 6495 Improve for..in enumeration performance 6496 https://bugs.webkit.org/show_bug.cgi?id=30887 6497 6498 Improve indexing of an object with a for..in iterator by 6499 identifying cases where get_by_val is being used with a iterator 6500 as the subscript and replace it with a new get_by_pname 6501 bytecode. get_by_pname then optimizes lookups that directly access 6502 the base object. 6503 6504 * bytecode/CodeBlock.cpp: 6505 (JSC::CodeBlock::dump): 6506 * bytecode/Opcode.h: 6507 * bytecompiler/BytecodeGenerator.cpp: 6508 (JSC::BytecodeGenerator::emitGetByVal): 6509 * bytecompiler/BytecodeGenerator.h: 6510 (JSC::BytecodeGenerator::pushOptimisedForIn): 6511 (JSC::BytecodeGenerator::popOptimisedForIn): 6512 * interpreter/Interpreter.cpp: 6513 (JSC::Interpreter::privateExecute): 6514 * jit/JIT.cpp: 6515 (JSC::JIT::privateCompileMainPass): 6516 (JSC::JIT::privateCompileSlowCases): 6517 * jit/JIT.h: 6518 * jit/JITPropertyAccess.cpp: 6519 (JSC::JIT::compileGetDirectOffset): 6520 (JSC::JIT::emit_op_get_by_pname): 6521 (JSC::JIT::emitSlow_op_get_by_pname): 6522 * parser/Nodes.cpp: 6523 (JSC::ForInNode::emitBytecode): 6524 * runtime/JSObject.h: 6525 * runtime/JSPropertyNameIterator.cpp: 6526 (JSC::JSPropertyNameIterator::create): 6527 * runtime/JSPropertyNameIterator.h: 6528 (JSC::JSPropertyNameIterator::getOffset): 6529 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 6530 * runtime/JSValue.h: 6531 (JSC::JSValue::): 6532 * runtime/Structure.cpp: 6533 (JSC::Structure::addPropertyTransition): 6534 (JSC::Structure::changePrototypeTransition): 6535 (JSC::Structure::despecifyFunctionTransition): 6536 (JSC::Structure::addAnonymousSlotsTransition): 6537 (JSC::Structure::getterSetterTransition): 6538 (JSC::Structure::toDictionaryTransition): 6539 (JSC::Structure::addPropertyWithoutTransition): 6540 Track the existence (or not) of non-enumerable properties. 6541 * runtime/Structure.h: 6542 (JSC::Structure::propertyStorageCapacity): 6543 (JSC::Structure::propertyStorageSize): 6544 (JSC::Structure::hasNonEnumerableProperties): 6545 (JSC::Structure::hasAnonymousSlots): 6546 65472009-10-28 Dmitry Titov <dimich@chromium.org> 6548 6549 Not reviewed, attemp to fix Windows build. 6550 6551 Touch the cpp file to cause recompile. 6552 6553 * wtf/Threading.cpp: 6554 (WTF::threadEntryPoint): 6555 65562009-10-28 Dmitry Titov <dimich@chromium.org> 6557 6558 Reviewed by David Levin. 6559 6560 https://bugs.webkit.org/show_bug.cgi?id=30805 6561 Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue. 6562 Existing Database tests cover this since Database removes tasks when it is stopped. 6563 6564 * wtf/MessageQueue.h: 6565 (WTF::::removeIf): 6566 65672009-10-28 Afonso R. Costa Jr. <afonso.costa@openbossa.org> 6568 6569 Reviewed by Oliver Hunt. 6570 6571 [Qt] Enable YARR when YARR_JIT is enabled 6572 https://bugs.webkit.org/show_bug.cgi?id=30730 6573 6574 When enabling or disabling JIT using JAVASCRIPTCORE_JIT, the ENABLE_YARR should 6575 be toggled also. 6576 6577 * JavaScriptCore.pri: 6578 65792009-10-24 Martin Robinson <martin.james.robinson@gmail.com> 6580 6581 Reviewed by Oliver Hunt. 6582 6583 Fix strict aliasing warning by switching reinterpret_cast to bitwise_cast. 6584 6585 strict-aliasing warnings in JSFunction.h 6586 https://bugs.webkit.org/show_bug.cgi?id=27869 6587 6588 * runtime/JSFunction.h: 6589 (JSC::JSFunction::nativeFunction): 6590 (JSC::JSFunction::scopeChain): 6591 (JSC::JSFunction::setScopeChain): 6592 (JSC::JSFunction::setNativeFunction): 6593 65942009-10-28 Jan-Arve Sæther <jan-arve.saether@nokia.com> 6595 6596 Reviewed by Tor Arne Vestbø. 6597 6598 Build-fix for 64-bit Windows 6599 6600 * wtf/Platform.h: Make sure to use WTF_USE_JSVALUE64 6601 66022009-10-28 Gavin Barraclough <barraclough@apple.com> 6603 6604 Reviewed by NOBODY (build fix!). 6605 6606 * jit/JIT.h: 6607 66082009-10-26 Holger Hans Peter Freyther <zecke@selfish.org> 6609 6610 Rubber-stamped by Darin Adler. 6611 6612 Export fastMalloc, fastCalloc, fastRealloc and fastFree on GCC/Unix 6613 https://bugs.webkit.org/show_bug.cgi?id=30769 6614 6615 When using -fvisibility=hidden to hide all internal symbols by default 6616 the malloc symbols will be hidden as well. For memory instrumentation 6617 it is needed to provide an instrumented version of these symbols and 6618 override the normal routines and by changing the visibility back to 6619 default this becomes possible. 6620 6621 The only other solution would be to use system malloc instead of the 6622 TCmalloc implementation but this will not allow to analyze memory 6623 behavior with the default allocator. 6624 6625 * wtf/FastMalloc.h: Define WTF_FAST_MALLOC_EXPORT for GCC and !darwin 6626 66272009-10-27 Gavin Barraclough <barraclough@apple.com> 6628 6629 Rubber Stamped by Samuel Q. Weinig. 6630 6631 Make the asserts protecting the offsets in the JIT more descriptive. 6632 6633 * jit/JIT.h: 6634 * jit/JITCall.cpp: 6635 (JSC::JIT::compileOpCall): 6636 * jit/JITPropertyAccess.cpp: 6637 (JSC::JIT::emit_op_method_check): 6638 (JSC::JIT::compileGetByIdHotPath): 6639 (JSC::JIT::compileGetByIdSlowCase): 6640 (JSC::JIT::emit_op_put_by_id): 6641 66422009-10-27 Geoffrey Garen <ggaren@apple.com> 6643 6644 Reviewed by Sam Weinig. 6645 6646 A little bit of refactoring in the date code. 6647 6648 * JavaScriptCore.exp: Don't export this unused symbol. 6649 6650 * runtime/DateConstructor.cpp: 6651 (JSC::constructDate): 6652 6653 * runtime/DateInstance.cpp: 6654 (JSC::DateInstance::DateInstance): 6655 * runtime/DateInstance.h: Removed some unused functions. Changed the default 6656 constructor to ensure that a DateInstance is always initialized. 6657 6658 * runtime/DatePrototype.cpp: 6659 (JSC::DatePrototype::DatePrototype): Pass an initializer to our constructor, 6660 since it now requires one. 6661 6662 * wtf/DateMath.cpp: 6663 (WTF::msToGregorianDateTime): Only compute our offset from UTC if our 6664 output will require it. Otherwise, our offset is 0. 6665 66662009-10-27 Geoffrey Garen <ggaren@apple.com> 6667 6668 Build fix: Mark DateInstaceCache.h private, so other frameworks can see it. 6669 6670 * JavaScriptCore.xcodeproj/project.pbxproj: 6671 66722009-10-27 Geoffrey Garen <ggaren@apple.com> 6673 6674 Build fix: re-readded this file. 6675 6676 * runtime/DateInstanceCache.h: Added. 6677 (JSC::DateInstanceData::create): 6678 (JSC::DateInstanceData::DateInstanceData): 6679 (JSC::DateInstanceCache::DateInstanceCache): 6680 (JSC::DateInstanceCache::add): 6681 (JSC::DateInstanceCache::lookup): 6682 66832009-10-27 Geoffrey Garen <ggaren@apple.com> 6684 6685 Reviewed by Darin Adler and Oliver Hunt. 6686 6687 https://bugs.webkit.org/show_bug.cgi?id=30800 6688 Cache recently computed date data. 6689 6690 SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js. 6691 6692 * GNUmakefile.am: 6693 * JavaScriptCore.gypi: 6694 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 6695 * JavaScriptCore.xcodeproj/project.pbxproj: Added new file. 6696 6697 * runtime/DateInstance.cpp: 6698 (JSC::DateInstance::DateInstance): 6699 (JSC::DateInstance::getGregorianDateTime): Use the shared cache. 6700 6701 * runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion 6702 of a "cache cache". 6703 6704 * runtime/DatePrototype.cpp: 6705 (JSC::formatLocaleDate): 6706 (JSC::dateProtoFuncToString): 6707 (JSC::dateProtoFuncToUTCString): 6708 (JSC::dateProtoFuncToISOString): 6709 (JSC::dateProtoFuncToDateString): 6710 (JSC::dateProtoFuncToTimeString): 6711 (JSC::dateProtoFuncGetFullYear): 6712 (JSC::dateProtoFuncGetUTCFullYear): 6713 (JSC::dateProtoFuncToGMTString): 6714 (JSC::dateProtoFuncGetMonth): 6715 (JSC::dateProtoFuncGetUTCMonth): 6716 (JSC::dateProtoFuncGetDate): 6717 (JSC::dateProtoFuncGetUTCDate): 6718 (JSC::dateProtoFuncGetDay): 6719 (JSC::dateProtoFuncGetUTCDay): 6720 (JSC::dateProtoFuncGetHours): 6721 (JSC::dateProtoFuncGetUTCHours): 6722 (JSC::dateProtoFuncGetMinutes): 6723 (JSC::dateProtoFuncGetUTCMinutes): 6724 (JSC::dateProtoFuncGetSeconds): 6725 (JSC::dateProtoFuncGetUTCSeconds): 6726 (JSC::dateProtoFuncGetTimezoneOffset): 6727 (JSC::setNewValueFromTimeArgs): 6728 (JSC::setNewValueFromDateArgs): 6729 (JSC::dateProtoFuncSetYear): 6730 (JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they 6731 can access the DateInstanceCache. 6732 6733 * runtime/JSGlobalData.h: Keep a DateInstanceCache. 6734 67352009-10-27 James Robinson <jamesr@chromium.org> 6736 6737 Reviewed by Darin Fisher. 6738 6739 Ensures that JavaScriptCore/wtf/CurrentTime.cpp is not built in PLATFORM(CHROMIUM) builds. 6740 6741 Chromium uses a different method to calculate the current time than is used in 6742 JavaScriptCore/wtf/CurrentTime.cpp. This can lead to time skew when calls to currentTime() and Chromium's time 6743 function are mixed. In particular, timers can get scheduled in the past which leads to 100% CPU use. 6744 See http://code.google.com/p/chromium/issues/detail?id=25892 for an example. 6745 6746 https://bugs.webkit.org/show_bug.cgi?id=30833 6747 6748 * JavaScriptCore.gyp/JavaScriptCore.gyp: 6749 * wtf/CurrentTime.cpp: 6750 67512009-10-27 Peter Varga <pvarga@inf.u-szeged.hu> 6752 6753 Rubber-stamped by Tor Arne Vestbø. 6754 6755 Fix typo in RegexInterpreter.cpp and RegexJIT.cpp alterantive to 6756 alternative. 6757 6758 * yarr/RegexInterpreter.cpp: 6759 (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction): 6760 (JSC::Yarr::ByteCompiler::alternativeDisjunction): 6761 (JSC::Yarr::ByteCompiler::emitDisjunction): 6762 * yarr/RegexJIT.cpp: 6763 (JSC::Yarr::RegexGenerator::generateDisjunction): 6764 67652009-10-26 Laszlo Gombos <laszlo.1.gombos@nokia.com> 6766 6767 Reviewed by Darin Adler. 6768 6769 Make .rc files compile on Windows without depending on MFC headers 6770 https://bugs.webkit.org/show_bug.cgi?id=30750 6771 6772 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Use 6773 winresrc.h because it exists even when MFC is not installed, and is 6774 all that's needed here. 6775 67762009-10-26 Gabor Loki <loki@inf.u-szeged.hu> 6777 6778 Reviewed by Gavin Barraclough. 6779 6780 The thunkReturnAddress is on JITStackFrame on ARM JIT as well 6781 https://bugs.webkit.org/show_bug.cgi?id=30782 6782 6783 Move the thunkReturnAddress from top of the stack into the JITStackFrame 6784 structure. This is a requirement for JSValue32_64 support on ARM. 6785 6786 * assembler/MacroAssemblerARM.h: 6787 (JSC::MacroAssemblerARM::ret): Return with link register 6788 (JSC::MacroAssemblerARM::prepareCall): Store the return address in link register 6789 * jit/JIT.h: Remove unused ctiReturnRegister 6790 * jit/JITInlineMethods.h: Same as ARMv7 6791 (JSC::JIT::restoreArgumentReference): Ditto. 6792 (JSC::JIT::restoreArgumentReferenceForTrampoline): Ditto. 6793 * jit/JITOpcodes.cpp: Remove ctiReturnRegister related instruction 6794 * jit/JITStubs.cpp: Store thunkReturnAddress on JITStackFrame. Use 6795 small trampoline functions which handle return addresses for each 6796 CTI_STUB_FUNCTION. 6797 * jit/JITStubs.h: Store thunkReturnAddress on JITStackFrame 6798 (JSC::JITStackFrame::returnAddressSlot): Return with the address of thunkReturnAddress 6799 * yarr/RegexJIT.cpp: 6800 (JSC::Yarr::RegexGenerator::generateEnter): Remove the unnecessary instruction 6801 68022009-10-26 Steve Block <steveblock@google.com> 6803 6804 Reviewed by Darin Adler. 6805 6806 Adds ability to disable ReadWriteLock on platforms (eg Android) that use pthreads but do not support pthread_rwlock. 6807 https://bugs.webkit.org/show_bug.cgi?id=30713 6808 6809 * wtf/Platform.h: Modified. Defines HAVE_PTHREAD_RWLOCK for all platforms currently using pthreads. 6810 * wtf/Threading.h: Modified. Use pthread_rwlock_t only when HAVE_PTHREAD_RWLOCK is defined. 6811 * wtf/ThreadingPthreads.cpp: Modified. Build ReadWriteLock methods only when HAVE_PTHREAD_RWLOCK is defined. 6812 68132009-10-24 Laszlo Gombos <laszlo.1.gombos@nokia.com> 6814 6815 Reviewed by Holger Freyther. 6816 6817 [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian 6818 https://bugs.webkit.org/show_bug.cgi?id=30476 6819 6820 Assign ReadUserData WriteUserData NetworkServices Symbian capabilities 6821 to jsc.exe. 6822 6823 * jsc.pro: 6824 68252009-10-23 Steve Block <steveblock@google.com> 6826 6827 Reviewed by Dmitry Titov. 6828 6829 Fixes a leak in createThreadInternal on Android. 6830 https://bugs.webkit.org/show_bug.cgi?id=30698 6831 6832 * wtf/ThreadingPthreads.cpp: Modified. 6833 (WTF::createThreadInternal): Avoid leaking a ThreadData object on failure. 6834 68352009-10-22 Geoffrey Garen <ggaren@apple.com> 6836 6837 Reviewed by Alexey Proskuryakov. 6838 6839 Fixed ASSERT when opening Safari's Caches window while the Web Inspector 6840 is open. 6841 6842 * runtime/Collector.cpp: 6843 (JSC::typeName): Added two new types to the type name list in the Collector. 6844 These types have been around for a while, but nobody remembered to consider them here. 6845 6846 * runtime/JSCell.h: 6847 (JSC::JSCell::isPropertyNameIterator): 6848 * runtime/JSPropertyNameIterator.h: 6849 (JSC::JSPropertyNameIterator::isPropertyNameIterator): Give the Collector 6850 a way to tell if a cell is a JSPropertyNameIterator. 6851 68522009-10-22 Steve Falkenburg <sfalken@apple.com> 6853 6854 Reviewed by Jon Honeycutt. 6855 6856 https://bugs.webkit.org/show_bug.cgi?id=30686 6857 Remove debug-specific def file. 6858 Only Debug_All target uses JavaScriptCore_debug.dll naming, and since 6859 that target is only used internally, maintaining two files just to 6860 suppress a single link warning isn't worthwhile. 6861 6862 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: 6863 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Removed. 6864 68652009-10-21 Jon Honeycutt <jhoneycutt@apple.com> 6866 6867 <rdar://problem/7270320> Screenshots of off-screen plug-ins are blank 6868 <rdar://problem/7270314> After halting a transparent PluginView on 6869 Windows, the transparency is applied twice 6870 6871 Reviewed by Dan Bernstein. 6872 6873 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 6874 Export WTF::deleteOwnedPtr(HDC). 6875 6876 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 6877 Ditto. 6878 68792009-10-20 Geoffrey Garen <ggaren@apple.com> 6880 6881 Windows build fix: updated variable name. 6882 6883 * runtime/DatePrototype.cpp: 6884 (JSC::formatLocaleDate): 6885 68862009-10-20 Geoffrey Garen <ggaren@apple.com> 6887 6888 Reviewed by Mark Rowe. 6889 6890 * jit/JITOpcodes.cpp: 6891 (JSC::JIT::emit_op_next_pname): Slightly tweaked this #ifdef to match the 6892 size of a JSValue because m_jsStrings is an array of JSValues. 6893 68942009-10-20 Geoffrey Garen <ggaren@apple.com> 6895 6896 Reviewed by Mark Rowe. 6897 6898 Fixed a 64-bit regression caused by the fix for 6899 https://bugs.webkit.org/show_bug.cgi?id=30570. 6900 6901 * jit/JITOpcodes.cpp: 6902 (JSC::JIT::emit_op_next_pname): Use TimesEight stepping on 64-bit, since 6903 64-bit pointers are eight bytes long. 6904 69052009-10-20 Geoffrey Garen <ggaren@apple.com> 6906 6907 Reviewed by Sam Weinig. 6908 6909 Refactored DateInstance::msToGregorianDateTime so that a DateInstance's 6910 caller doesn't need to supply the DateInstance's own internal value to 6911 the DateInstance. 6912 6913 * runtime/DateInstance.cpp: 6914 (JSC::DateInstance::getGregorianDateTime): Renamed from "msToGregorianDateTime". 6915 6916 * runtime/DateInstance.h: 6917 * runtime/DatePrototype.cpp: 6918 (JSC::formatLocaleDate): 6919 (JSC::dateProtoFuncToString): 6920 (JSC::dateProtoFuncToUTCString): 6921 (JSC::dateProtoFuncToISOString): 6922 (JSC::dateProtoFuncToDateString): 6923 (JSC::dateProtoFuncToTimeString): 6924 (JSC::dateProtoFuncToLocaleString): 6925 (JSC::dateProtoFuncToLocaleDateString): 6926 (JSC::dateProtoFuncToLocaleTimeString): 6927 (JSC::dateProtoFuncGetTime): 6928 (JSC::dateProtoFuncGetFullYear): 6929 (JSC::dateProtoFuncGetUTCFullYear): 6930 (JSC::dateProtoFuncToGMTString): 6931 (JSC::dateProtoFuncGetMonth): 6932 (JSC::dateProtoFuncGetUTCMonth): 6933 (JSC::dateProtoFuncGetDate): 6934 (JSC::dateProtoFuncGetUTCDate): 6935 (JSC::dateProtoFuncGetDay): 6936 (JSC::dateProtoFuncGetUTCDay): 6937 (JSC::dateProtoFuncGetHours): 6938 (JSC::dateProtoFuncGetUTCHours): 6939 (JSC::dateProtoFuncGetMinutes): 6940 (JSC::dateProtoFuncGetUTCMinutes): 6941 (JSC::dateProtoFuncGetSeconds): 6942 (JSC::dateProtoFuncGetUTCSeconds): 6943 (JSC::dateProtoFuncGetTimezoneOffset): 6944 (JSC::setNewValueFromTimeArgs): 6945 (JSC::setNewValueFromDateArgs): 6946 (JSC::dateProtoFuncSetYear): 6947 (JSC::dateProtoFuncGetYear): Also renamed "utc" to "outputIsUTC", for clarity. 6948 69492009-10-20 Gabor Loki <loki@inf.u-szeged.hu> 6950 6951 Reviewed by Geoffrey Garen. 6952 6953 The op_next_pname should use 4 bytes addressing mode in case of JSValue32 6954 https://bugs.webkit.org/show_bug.cgi?id=30570 6955 6956 * jit/JITOpcodes.cpp: 6957 (JSC::JIT::emit_op_next_pname): 6958 69592009-10-20 Gabor Loki <loki@inf.u-szeged.hu> 6960 6961 Reviewed by Oliver Hunt. 6962 6963 Move OverridesMarkChildren flag from DatePrototype to its parent class 6964 https://bugs.webkit.org/show_bug.cgi?id=30372 6965 6966 * runtime/DateInstance.h: 6967 (JSC::DateInstance::createStructure): 6968 * runtime/DatePrototype.h: 6969 69702009-10-19 Geoffrey Garen <ggaren@apple.com> 6971 6972 Reviewed by Oliver Hunt. 6973 6974 Tightened up some put_by_id_transition code generation. 6975 https://bugs.webkit.org/show_bug.cgi?id=30539 6976 6977 * jit/JIT.h: 6978 * jit/JITPropertyAccess.cpp: 6979 (JSC::JIT::testPrototype): 6980 (JSC::JIT::privateCompilePutByIdTransition): No need to do object type 6981 checks or read Structures and prototypes from objects: they're all known 6982 constants at compile time. 6983 69842009-10-19 Geoffrey Garen <ggaren@apple.com> 6985 6986 Reviewed by Sam Weinig. 6987 6988 Added a private API for getting a global context from a context, for 6989 clients who want to preserve a context for a later callback. 6990 6991 * API/APICast.h: 6992 (toGlobalRef): Added an ASSERT, since this function is used more often 6993 than before. 6994 6995 * API/JSContextRef.cpp: 6996 * API/JSContextRefPrivate.h: Added. The new API. 6997 6998 * API/tests/testapi.c: 6999 (print_callAsFunction): 7000 (main): Test the new API. 7001 7002 * JavaScriptCore.exp: 7003 * JavaScriptCore.xcodeproj/project.pbxproj: Build and export the new API. 7004 70052009-10-17 Geoffrey Garen <ggaren@apple.com> 7006 7007 Reviewed by Oliver Hunt. 7008 7009 Tightened up some instanceof code generation. 7010 https://bugs.webkit.org/show_bug.cgi?id=30488 7011 7012 * jit/JITOpcodes.cpp: 7013 (JSC::JIT::emit_op_instanceof): 7014 (JSC::JIT::emitSlow_op_instanceof): No need to do object type checks - 7015 cell type checks and ImplementsDefaultHasIntance checks implicitly 7016 supersede object type checks. 7017 70182009-10-18 Kwang Yul Seo <skyul@company100.net> 7019 7020 Reviewed by Darin Adler. 7021 7022 Use _stricmp and _strnicmp instead of deprecated stricmp and strnicmp. 7023 https://bugs.webkit.org/show_bug.cgi?id=30474 7024 7025 stricmp and strnicmp are deprecated beginning in Visual 7026 C++ 2005. Use _stricmp and _strnicmp instead in StringExtras.h. 7027 7028 * wtf/StringExtras.h: 7029 (strncasecmp): 7030 (strcasecmp): 7031 70322009-10-16 Geoffrey Garen <ggaren@apple.com> 7033 7034 Build fix: apparently we shouldn't export those symbols? 7035 7036 * JavaScriptCore.exp: 7037 70382009-10-16 Geoffrey Garen <ggaren@apple.com> 7039 7040 Build fix: export some symbols. 7041 7042 * JavaScriptCore.exp: 7043 70442009-10-16 Oliver Hunt <oliver@apple.com> 7045 7046 Reviewed by Gavin Barraclough. 7047 7048 structure typeinfo flags should be inherited. 7049 https://bugs.webkit.org/show_bug.cgi?id=30468 7050 7051 Add StructureFlag constant to the various JSC classes and use 7052 it for the TypeInfo construction. This allows us to simply 7053 accumulate flags by basing each classes StructureInfo on its parents. 7054 7055 * API/JSCallbackConstructor.h: 7056 (JSC::JSCallbackConstructor::createStructure): 7057 * API/JSCallbackFunction.h: 7058 (JSC::JSCallbackFunction::createStructure): 7059 * API/JSCallbackObject.h: 7060 (JSC::JSCallbackObject::createStructure): 7061 * debugger/DebuggerActivation.h: 7062 (JSC::DebuggerActivation::createStructure): 7063 * runtime/Arguments.h: 7064 (JSC::Arguments::createStructure): 7065 * runtime/BooleanObject.h: 7066 (JSC::BooleanObject::createStructure): 7067 * runtime/DatePrototype.h: 7068 (JSC::DatePrototype::createStructure): 7069 * runtime/FunctionPrototype.h: 7070 (JSC::FunctionPrototype::createStructure): 7071 * runtime/GlobalEvalFunction.h: 7072 (JSC::GlobalEvalFunction::createStructure): 7073 * runtime/InternalFunction.h: 7074 (JSC::InternalFunction::createStructure): 7075 * runtime/JSActivation.h: 7076 (JSC::JSActivation::createStructure): 7077 * runtime/JSArray.h: 7078 (JSC::JSArray::createStructure): 7079 * runtime/JSByteArray.cpp: 7080 (JSC::JSByteArray::createStructure): 7081 * runtime/JSByteArray.h: 7082 * runtime/JSFunction.h: 7083 (JSC::JSFunction::createStructure): 7084 * runtime/JSGlobalObject.h: 7085 (JSC::JSGlobalObject::createStructure): 7086 * runtime/JSNotAnObject.h: 7087 (JSC::JSNotAnObject::createStructure): 7088 * runtime/JSONObject.h: 7089 (JSC::JSONObject::createStructure): 7090 * runtime/JSObject.h: 7091 (JSC::JSObject::createStructure): 7092 * runtime/JSStaticScopeObject.h: 7093 (JSC::JSStaticScopeObject::createStructure): 7094 * runtime/JSVariableObject.h: 7095 (JSC::JSVariableObject::createStructure): 7096 * runtime/JSWrapperObject.h: 7097 (JSC::JSWrapperObject::createStructure): 7098 * runtime/MathObject.h: 7099 (JSC::MathObject::createStructure): 7100 * runtime/NumberConstructor.h: 7101 (JSC::NumberConstructor::createStructure): 7102 * runtime/NumberObject.h: 7103 (JSC::NumberObject::createStructure): 7104 * runtime/RegExpConstructor.h: 7105 (JSC::RegExpConstructor::createStructure): 7106 * runtime/RegExpObject.h: 7107 (JSC::RegExpObject::createStructure): 7108 * runtime/StringObject.h: 7109 (JSC::StringObject::createStructure): 7110 * runtime/StringObjectThatMasqueradesAsUndefined.h: 7111 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 7112 71132009-10-16 Geoffrey Garen <ggaren@apple.com> 7114 7115 Reviewed by Oliver Hunt. 7116 7117 Fast for-in enumeration: Cache JSPropertyNameIterator; cache JSStrings 7118 in JSPropertyNameIterator; inline more code. 7119 7120 1.024x as fast on SunSpider (fasta: 1.43x as fast). 7121 7122 * bytecode/CodeBlock.cpp: 7123 (JSC::CodeBlock::dump): 7124 * bytecode/Opcode.h: 7125 * bytecompiler/BytecodeGenerator.cpp: 7126 (JSC::BytecodeGenerator::emitGetPropertyNames): 7127 (JSC::BytecodeGenerator::emitNextPropertyName): 7128 * bytecompiler/BytecodeGenerator.h: Added a few extra operands to 7129 op_get_pnames and op_next_pname so that we can track iteration state 7130 in the register file instead of in the JSPropertyNameIterator. (To be 7131 cacheable, the JSPropertyNameIterator must be stateless.) 7132 7133 * interpreter/Interpreter.cpp: 7134 (JSC::Interpreter::tryCachePutByID): 7135 (JSC::Interpreter::tryCacheGetByID): Updated for rename to 7136 "normalizePrototypeChain" and removal of "isCacheable". 7137 7138 (JSC::Interpreter::privateExecute): Updated for in-RegisterFile 7139 iteration state tracking. 7140 7141 * jit/JIT.cpp: 7142 (JSC::JIT::privateCompileMainPass): 7143 * jit/JIT.h: 7144 * jit/JITOpcodes.cpp: 7145 (JSC::JIT::emit_op_get_pnames): Updated for in-RegisterFile 7146 iteration state tracking. 7147 7148 (JSC::JIT::emit_op_next_pname): Inlined code generation for op_next_pname. 7149 7150 * jit/JITStubs.cpp: 7151 (JSC::JITThunks::tryCachePutByID): 7152 (JSC::JITThunks::tryCacheGetByID): Updated for rename to 7153 "normalizePrototypeChain" and removal of "isCacheable". 7154 7155 (JSC::DEFINE_STUB_FUNCTION): 7156 * jit/JITStubs.h: 7157 (JSC::): Added has_property and to_object stubs. Removed op_next_pname 7158 stub, since has_property is all we need anymore. 7159 7160 * parser/Nodes.cpp: 7161 (JSC::ForInNode::emitBytecode): Updated for in-RegisterFile 7162 iteration state tracking. 7163 7164 * runtime/JSCell.h: 7165 * runtime/JSObject.cpp: 7166 (JSC::JSObject::getPropertyNames): Don't do caching at this layer 7167 anymore, since we don't create a JSPropertyNameIterator at this layer. 7168 7169 * runtime/JSPropertyNameIterator.cpp: 7170 (JSC::JSPropertyNameIterator::create): Do do caching at this layer. 7171 (JSC::JSPropertyNameIterator::get): Updated for in-RegisterFile 7172 iteration state tracking. 7173 (JSC::JSPropertyNameIterator::markChildren): Mark our JSStrings. 7174 7175 * runtime/JSPropertyNameIterator.h: 7176 (JSC::JSPropertyNameIterator::size): 7177 (JSC::JSPropertyNameIterator::setCachedStructure): 7178 (JSC::JSPropertyNameIterator::cachedStructure): 7179 (JSC::JSPropertyNameIterator::setCachedPrototypeChain): 7180 (JSC::JSPropertyNameIterator::cachedPrototypeChain): 7181 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 7182 (JSC::Structure::setEnumerationCache): Don't store iteration state in 7183 a JSPropertyNameIterator. Do cache a JSPropertyNameIterator in a 7184 Structure. 7185 7186 * runtime/JSValue.h: 7187 (JSC::asCell): 7188 * runtime/MarkStack.h: Make those mischievous #include gods happy. 7189 7190 * runtime/ObjectConstructor.cpp: 7191 7192 * runtime/Operations.h: 7193 (JSC::normalizePrototypeChain): Renamed countPrototypeChainEntriesAndCheckForProxies 7194 to normalizePrototypeChain, since it changes dictionary prototypes to 7195 non-dictionary objects. 7196 7197 * runtime/PropertyNameArray.cpp: 7198 (JSC::PropertyNameArray::add): 7199 * runtime/PropertyNameArray.h: 7200 (JSC::PropertyNameArrayData::PropertyNameArrayData): 7201 (JSC::PropertyNameArray::data): 7202 (JSC::PropertyNameArray::size): 7203 (JSC::PropertyNameArray::begin): 7204 (JSC::PropertyNameArray::end): Simplified some code here to help with 7205 current and future refactoring. 7206 7207 * runtime/Protect.h: 7208 * runtime/Structure.cpp: 7209 (JSC::Structure::~Structure): 7210 (JSC::Structure::addPropertyWithoutTransition): 7211 (JSC::Structure::removePropertyWithoutTransition): No need to clear 7212 the enumeration cache with adding / removing properties without 7213 transition. It is an error to add / remove properties without transition 7214 once an object has been observed, and we can ASSERT to catch that. 7215 7216 * runtime/Structure.h: 7217 (JSC::Structure::enumerationCache): Changed the enumeration cache to 7218 hold a JSPropertyNameIterator. 7219 7220 * runtime/StructureChain.cpp: 7221 * runtime/StructureChain.h: 7222 (JSC::StructureChain::head): Removed StructureChain::isCacheable because 7223 it was wrong-headed in two ways: (1) It gave up when a prototype was a 7224 dictionary, but instead we want un-dictionary heavily accessed 7225 prototypes; (2) It folded a test for hasDefaultGetPropertyNames() into 7226 a generic test for "cacheable-ness", but hasDefaultGetPropertyNames() 7227 is only releavant to for-in caching. 7228 72292009-10-16 Steve Falkenburg <sfalken@apple.com> 7230 7231 Reviewed by Adam Roben. 7232 7233 Add a Debug_All configuration to build entire stack as debug. 7234 Change Debug_Internal to: 7235 - stop using _debug suffix for all WebKit/Safari binaries 7236 - not use _debug as a DLL naming suffix 7237 - use non-debug C runtime lib. 7238 7239 * JavaScriptCore.vcproj/JavaScriptCore.make: Debug build in makefile should build Debug_All. 7240 * JavaScriptCore.vcproj/JavaScriptCore.sln: Add Debug_All configuration. 7241 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add Debug_All configuration. 7242 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Renamed single configuration from "Release" to "all". 7243 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Add Debug_All configuration. 7244 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add Debug_All configuration. 7245 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_All configuration. 7246 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_All configuration. 7247 72482009-10-16 Oliver Hunt <oliver@apple.com> 7249 7250 Reviewed by Gavin Barraclough. 7251 7252 Make typeinfo flags default to false 7253 https://bugs.webkit.org/show_bug.cgi?id=30372 7254 7255 Last part -- replace HasDefaultGetPropertyNames with OverridesGetPropertyNames 7256 flag. 7257 7258 * API/JSCallbackConstructor.h: 7259 (JSC::JSCallbackConstructor::createStructure): 7260 * API/JSCallbackObject.h: 7261 (JSC::JSCallbackObject::createStructure): 7262 * debugger/DebuggerActivation.h: 7263 (JSC::DebuggerActivation::createStructure): 7264 * runtime/Arguments.h: 7265 (JSC::Arguments::createStructure): 7266 * runtime/BooleanObject.h: 7267 (JSC::BooleanObject::createStructure): 7268 * runtime/DatePrototype.h: 7269 (JSC::DatePrototype::createStructure): 7270 * runtime/FunctionPrototype.h: 7271 (JSC::FunctionPrototype::createStructure): 7272 * runtime/GlobalEvalFunction.h: 7273 (JSC::GlobalEvalFunction::createStructure): 7274 * runtime/JSAPIValueWrapper.h: 7275 (JSC::JSAPIValueWrapper::createStructure): 7276 * runtime/JSActivation.h: 7277 (JSC::JSActivation::createStructure): 7278 * runtime/JSArray.h: 7279 (JSC::JSArray::createStructure): 7280 * runtime/JSByteArray.cpp: 7281 (JSC::JSByteArray::createStructure): 7282 * runtime/JSFunction.h: 7283 (JSC::JSFunction::createStructure): 7284 * runtime/JSGlobalObject.h: 7285 (JSC::JSGlobalObject::createStructure): 7286 * runtime/JSNotAnObject.h: 7287 (JSC::JSNotAnObject::createStructure): 7288 * runtime/JSONObject.h: 7289 (JSC::JSONObject::createStructure): 7290 * runtime/JSObject.cpp: 7291 (JSC::JSObject::getPropertyNames): 7292 * runtime/JSObject.h: 7293 (JSC::JSObject::createStructure): 7294 * runtime/JSStaticScopeObject.h: 7295 (JSC::JSStaticScopeObject::createStructure): 7296 * runtime/JSTypeInfo.h: 7297 (JSC::TypeInfo::overridesGetPropertyNames): 7298 * runtime/JSVariableObject.h: 7299 (JSC::JSVariableObject::createStructure): 7300 * runtime/JSWrapperObject.h: 7301 (JSC::JSWrapperObject::createStructure): 7302 * runtime/MathObject.h: 7303 (JSC::MathObject::createStructure): 7304 * runtime/NumberConstructor.h: 7305 (JSC::NumberConstructor::createStructure): 7306 * runtime/NumberObject.h: 7307 (JSC::NumberObject::createStructure): 7308 * runtime/RegExpConstructor.h: 7309 (JSC::RegExpConstructor::createStructure): 7310 * runtime/RegExpObject.h: 7311 (JSC::RegExpObject::createStructure): 7312 * runtime/StringObject.h: 7313 (JSC::StringObject::createStructure): 7314 * runtime/StringObjectThatMasqueradesAsUndefined.h: 7315 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 7316 * runtime/StructureChain.cpp: 7317 (JSC::StructureChain::isCacheable): 7318 73192009-10-16 Kevin Ollivier <kevino@theolliviers.com> 7320 7321 wxMSW build fix, we can't use the simple hash there because the PlatformModuleVersion 7322 structure differs. 7323 7324 * wtf/Platform.h: 7325 73262009-10-16 Laszlo Gombos <laszlo.1.gombos@nokia.com> 7327 7328 Reviewed by Simon Hausmann. 7329 7330 [Qt] Implement ExecutableAllocator for Symbian 7331 https://bugs.webkit.org/show_bug.cgi?id=29946 7332 7333 Tested with YARR JIT enabled for Symbian; 7334 This patch does not (yet) enable YARR JIT by default. 7335 7336 * JavaScriptCore.pri: 7337 * jit/ExecutableAllocator.h: 7338 * jit/ExecutableAllocatorSymbian.cpp: Added. 7339 (JSC::ExecutableAllocator::intializePageSize): 7340 (JSC::ExecutablePool::systemAlloc): 7341 (JSC::ExecutablePool::systemRelease): 7342 73432009-10-15 Oliver Hunt <oliver@apple.com> 7344 7345 Reviewed by Darin Adler. 7346 7347 Make typeinfo flags default to false 7348 https://bugs.webkit.org/show_bug.cgi?id=30372 7349 7350 Part 2 -- Reverse the TypeInfo HasDefaultMark flag to OverridesMarkChildren, etc 7351 7352 * API/JSCallbackConstructor.h: 7353 (JSC::JSCallbackConstructor::createStructure): 7354 * API/JSCallbackFunction.h: 7355 (JSC::JSCallbackFunction::createStructure): 7356 * API/JSCallbackObject.h: 7357 (JSC::JSCallbackObject::createStructure): 7358 * debugger/DebuggerActivation.h: 7359 (JSC::DebuggerActivation::createStructure): 7360 * runtime/Arguments.h: 7361 (JSC::Arguments::createStructure): 7362 * runtime/BooleanObject.h: 7363 (JSC::BooleanObject::createStructure): 7364 * runtime/DatePrototype.h: 7365 (JSC::DatePrototype::createStructure): 7366 * runtime/FunctionPrototype.h: 7367 (JSC::FunctionPrototype::createStructure): 7368 * runtime/GetterSetter.h: 7369 (JSC::GetterSetter::createStructure): 7370 * runtime/GlobalEvalFunction.h: 7371 (JSC::GlobalEvalFunction::createStructure): 7372 * runtime/InternalFunction.h: 7373 (JSC::InternalFunction::createStructure): 7374 * runtime/JSAPIValueWrapper.h: 7375 (JSC::JSAPIValueWrapper::createStructure): 7376 * runtime/JSActivation.h: 7377 (JSC::JSActivation::createStructure): 7378 * runtime/JSArray.h: 7379 (JSC::JSArray::createStructure): 7380 (JSC::MarkStack::markChildren): 7381 * runtime/JSByteArray.cpp: 7382 (JSC::JSByteArray::createStructure): 7383 * runtime/JSFunction.h: 7384 (JSC::JSFunction::createStructure): 7385 * runtime/JSGlobalObject.h: 7386 (JSC::JSGlobalObject::createStructure): 7387 * runtime/JSNotAnObject.h: 7388 (JSC::JSNotAnObject::createStructure): 7389 * runtime/JSNumberCell.h: 7390 (JSC::JSNumberCell::createStructure): 7391 * runtime/JSONObject.h: 7392 (JSC::JSONObject::createStructure): 7393 * runtime/JSObject.h: 7394 (JSC::JSObject::createStructure): 7395 * runtime/JSPropertyNameIterator.h: 7396 (JSC::JSPropertyNameIterator::createStructure): 7397 * runtime/JSStaticScopeObject.h: 7398 (JSC::JSStaticScopeObject::createStructure): 7399 * runtime/JSString.h: 7400 (JSC::JSString::createStructure): 7401 * runtime/JSTypeInfo.h: 7402 (JSC::TypeInfo::overridesMarkChildren): 7403 * runtime/JSVariableObject.h: 7404 (JSC::JSVariableObject::createStructure): 7405 * runtime/JSWrapperObject.h: 7406 (JSC::JSWrapperObject::createStructure): 7407 * runtime/MathObject.h: 7408 (JSC::MathObject::createStructure): 7409 * runtime/NumberConstructor.h: 7410 (JSC::NumberConstructor::createStructure): 7411 * runtime/NumberObject.h: 7412 (JSC::NumberObject::createStructure): 7413 * runtime/RegExpConstructor.h: 7414 (JSC::RegExpConstructor::createStructure): 7415 * runtime/RegExpObject.h: 7416 (JSC::RegExpObject::createStructure): 7417 * runtime/StringObject.h: 7418 (JSC::StringObject::createStructure): 7419 * runtime/StringObjectThatMasqueradesAsUndefined.h: 7420 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 7421 74222009-10-14 Oliver Hunt <oliver@apple.com> 7423 7424 Reviewed by Geoff Garen. 7425 7426 Make typeinfo flags default to false 7427 https://bugs.webkit.org/show_bug.cgi?id=30372 7428 7429 Part 1. Reverse the HasStandardGetOwnPropertySlot flag. 7430 7431 * API/JSCallbackConstructor.h: 7432 (JSC::JSCallbackConstructor::createStructure): 7433 * API/JSCallbackFunction.h: 7434 (JSC::JSCallbackFunction::createStructure): 7435 * API/JSCallbackObject.h: 7436 (JSC::JSCallbackObject::createStructure): 7437 * debugger/DebuggerActivation.h: 7438 (JSC::DebuggerActivation::createStructure): 7439 * jit/JITStubs.cpp: 7440 (JSC::DEFINE_STUB_FUNCTION): 7441 * runtime/Arguments.h: 7442 (JSC::Arguments::createStructure): 7443 * runtime/BooleanObject.h: 7444 (JSC::BooleanObject::createStructure): 7445 * runtime/DatePrototype.h: 7446 (JSC::DatePrototype::createStructure): 7447 * runtime/FunctionPrototype.h: 7448 (JSC::FunctionPrototype::createStructure): 7449 * runtime/GlobalEvalFunction.h: 7450 (JSC::GlobalEvalFunction::createStructure): 7451 * runtime/InternalFunction.h: 7452 (JSC::InternalFunction::createStructure): 7453 * runtime/JSActivation.h: 7454 (JSC::JSActivation::createStructure): 7455 * runtime/JSArray.h: 7456 (JSC::JSArray::createStructure): 7457 * runtime/JSByteArray.cpp: 7458 (JSC::JSByteArray::createStructure): 7459 * runtime/JSFunction.h: 7460 (JSC::JSFunction::createStructure): 7461 * runtime/JSGlobalObject.h: 7462 (JSC::JSGlobalObject::createStructure): 7463 * runtime/JSNumberCell.h: 7464 (JSC::JSNumberCell::createStructure): 7465 * runtime/JSONObject.h: 7466 (JSC::JSONObject::createStructure): 7467 * runtime/JSObject.h: 7468 (JSC::JSObject::createStructure): 7469 (JSC::JSCell::fastGetOwnPropertySlot): 7470 * runtime/JSStaticScopeObject.h: 7471 (JSC::JSStaticScopeObject::createStructure): 7472 * runtime/JSString.h: 7473 (JSC::JSString::createStructure): 7474 * runtime/JSTypeInfo.h: 7475 (JSC::TypeInfo::overridesGetOwnPropertySlot): 7476 * runtime/JSVariableObject.h: 7477 (JSC::JSVariableObject::createStructure): 7478 * runtime/JSWrapperObject.h: 7479 (JSC::JSWrapperObject::createStructure): 7480 * runtime/MathObject.h: 7481 (JSC::MathObject::createStructure): 7482 * runtime/NumberConstructor.h: 7483 (JSC::NumberConstructor::createStructure): 7484 * runtime/NumberObject.h: 7485 (JSC::NumberObject::createStructure): 7486 * runtime/RegExpConstructor.h: 7487 (JSC::RegExpConstructor::createStructure): 7488 * runtime/RegExpObject.h: 7489 (JSC::RegExpObject::createStructure): 7490 * runtime/StringObject.h: 7491 (JSC::StringObject::createStructure): 7492 * runtime/StringObjectThatMasqueradesAsUndefined.h: 7493 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 7494 74952009-10-14 Kevin Ollivier <kevino@theolliviers.com> 74962009-10-14 Darin Adler <darin@apple.com> 7497 7498 Additions so fix for https://bugs.webkit.org/show_bug.cgi?id=18994 7499 can build on Windows. 7500 7501 * wtf/MathExtras.h: Added llround and llroundf for Windows. 7502 75032009-10-14 Kevin Ollivier <kevino@theolliviers.com> 7504 7505 wx build fix. Set ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for plugins while we're still building stubs. 7506 7507 * wtf/Platform.h: 7508 75092009-10-13 Laszlo Gombos <laszlo.1.gombos@nokia.com> 7510 7511 Reviewed by Simon Hausmann. 7512 7513 Refactor ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 7514 https://bugs.webkit.org/show_bug.cgi?id=30278 7515 7516 Move the definition of ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 7517 from the make system into common code. 7518 7519 * wtf/Platform.h: 7520 75212009-10-13 Laszlo Gombos <laszlo.1.gombos@nokia.com> 7522 7523 Reviewed by Darin Adler. 7524 7525 ARM compiler does not understand reinterpret_cast<void*> 7526 https://bugs.webkit.org/show_bug.cgi?id=29034 7527 7528 Change reinterpret_cast<void*> to regular C style (void*) cast 7529 for the ARM RVCT compiler. 7530 7531 * assembler/MacroAssemblerCodeRef.h: 7532 (JSC::FunctionPtr::FunctionPtr): 7533 * jit/JITOpcodes.cpp: Cast to FunctionPtr first 7534 instead of directly casting to reinterpret_cast 7535 * jit/JITStubCall.h: Ditto + change the type of m_stub 7536 from void* to FunctionPtr. 7537 (JSC::JITStubCall::JITStubCall): 7538 (JSC::JITStubCall::call): 7539 * jit/JITStubs.cpp: Ditto. 7540 (JSC::DEFINE_STUB_FUNCTION(EncodedJSValue, op_throw)): 7541 75422009-10-11 Oliver Hunt <oliver@apple.com> 7543 7544 Re-enable the JIT. 7545 7546 * wtf/Platform.h: 7547 75482009-10-10 Oliver Hunt <oliver@apple.com> 7549 7550 Reviewed by Maciej Stachowiak. 7551 7552 Support for String.trim(), String.trimLeft() and String.trimRight() methods 7553 https://bugs.webkit.org/show_bug.cgi?id=26590 7554 7555 Implement trim, trimLeft, and trimRight 7556 7557 * runtime/StringPrototype.cpp: 7558 (JSC::isTrimWhitespace): 7559 Our normal string whitespace function does not include U+200B which 7560 is needed for compatibility with mozilla's implementation of trim. 7561 U+200B does not appear to be expected according to spec, however I am 7562 choosing to be lax, and match mozilla behavior so have added this 7563 exception. 7564 (JSC::trimString): 7565 75662009-10-09 Geoffrey Garen <ggaren@apple.com> 7567 7568 Reviewed by Oliver Hunt. 7569 7570 Eliminated some legacy bytecode weirdness. 7571 7572 Use vPC[x] subscripting instead of ++vPC to access instruction operands. 7573 This is simpler, and often more efficient. 7574 7575 To support this, and to remove use of hard-coded offsets in bytecode and 7576 JIT code generation and dumping, calculate jump offsets from the beginning 7577 of an instruction, rather than the middle or end. 7578 7579 Also, use OPCODE_LENGTH instead of hard-coded constants for the sizes of 7580 opcodes. 7581 7582 SunSpider reports no change in JIT mode, and a 1.01x speedup in Interpreter 7583 mode. 7584 7585 * bytecode/CodeBlock.cpp: 7586 (JSC::printConditionalJump): 7587 (JSC::CodeBlock::dump): 7588 * bytecompiler/BytecodeGenerator.cpp: 7589 (JSC::BytecodeGenerator::emitJump): 7590 (JSC::BytecodeGenerator::emitJumpIfTrue): 7591 (JSC::BytecodeGenerator::emitJumpIfFalse): 7592 (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall): 7593 (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply): 7594 (JSC::BytecodeGenerator::emitComplexJumpScopes): 7595 (JSC::BytecodeGenerator::emitJumpScopes): 7596 (JSC::BytecodeGenerator::emitNextPropertyName): 7597 (JSC::BytecodeGenerator::emitCatch): 7598 (JSC::BytecodeGenerator::emitJumpSubroutine): 7599 (JSC::prepareJumpTableForImmediateSwitch): 7600 (JSC::prepareJumpTableForCharacterSwitch): 7601 (JSC::prepareJumpTableForStringSwitch): 7602 (JSC::BytecodeGenerator::endSwitch): 7603 * bytecompiler/Label.h: 7604 (JSC::Label::setLocation): 7605 (JSC::Label::bind): 7606 * interpreter/Interpreter.cpp: 7607 (JSC::Interpreter::resolve): 7608 (JSC::Interpreter::resolveSkip): 7609 (JSC::Interpreter::resolveGlobal): 7610 (JSC::Interpreter::resolveBase): 7611 (JSC::Interpreter::resolveBaseAndProperty): 7612 (JSC::Interpreter::createExceptionScope): 7613 (JSC::Interpreter::privateExecute): 7614 * interpreter/Interpreter.h: 7615 * jit/JIT.cpp: 7616 (JSC::JIT::privateCompile): 7617 * jit/JITArithmetic.cpp: 7618 (JSC::JIT::emit_op_jnless): 7619 (JSC::JIT::emitSlow_op_jnless): 7620 (JSC::JIT::emit_op_jnlesseq): 7621 (JSC::JIT::emitSlow_op_jnlesseq): 7622 (JSC::JIT::emitBinaryDoubleOp): 7623 * jit/JITOpcodes.cpp: 7624 (JSC::JIT::emit_op_jmp): 7625 (JSC::JIT::emit_op_loop): 7626 (JSC::JIT::emit_op_loop_if_less): 7627 (JSC::JIT::emitSlow_op_loop_if_less): 7628 (JSC::JIT::emit_op_loop_if_lesseq): 7629 (JSC::JIT::emitSlow_op_loop_if_lesseq): 7630 (JSC::JIT::emit_op_loop_if_true): 7631 (JSC::JIT::emitSlow_op_loop_if_true): 7632 (JSC::JIT::emit_op_jfalse): 7633 (JSC::JIT::emitSlow_op_jfalse): 7634 (JSC::JIT::emit_op_jtrue): 7635 (JSC::JIT::emitSlow_op_jtrue): 7636 (JSC::JIT::emit_op_jeq_null): 7637 (JSC::JIT::emit_op_jneq_null): 7638 (JSC::JIT::emit_op_jneq_ptr): 7639 (JSC::JIT::emit_op_jsr): 7640 (JSC::JIT::emit_op_next_pname): 7641 (JSC::JIT::emit_op_jmp_scopes): 7642 76432009-10-09 Geoffrey Garen <ggaren@apple.com> 7644 7645 Reviewed by Sam Weinig. 7646 7647 Migrated some code that didn't belong out of Structure. 7648 7649 SunSpider says maybe 1.03x faster. 7650 7651 * runtime/JSCell.h: Nixed Structure::markAggregate, and made marking of 7652 a Structure's prototype the direct responsility of the object using it. 7653 (Giving Structure a mark function was misleading because it implied that 7654 all live structures get marked during GC, when they don't.) 7655 7656 * runtime/JSGlobalObject.cpp: 7657 (JSC::markIfNeeded): 7658 (JSC::JSGlobalObject::markChildren): Added code to mark prototypes stored 7659 on the global object. Maybe this wasn't necessary, but now we don't have 7660 to wonder. 7661 7662 * runtime/JSObject.cpp: 7663 (JSC::JSObject::getPropertyNames): 7664 (JSC::JSObject::getOwnPropertyNames): 7665 (JSC::JSObject::getEnumerableNamesFromClassInfoTable): 7666 * runtime/JSObject.h: 7667 (JSC::JSObject::markChildrenDirect): 7668 * runtime/PropertyNameArray.h: 7669 * runtime/Structure.cpp: 7670 * runtime/Structure.h: 7671 (JSC::Structure::setEnumerationCache): 7672 (JSC::Structure::enumerationCache): Moved property name gathering code 7673 from Structure to JSObject because having a Structure iterate its JSObject 7674 was a layering violation. A JSObject is implemented using a Structure; not 7675 the other way around. 7676 76772009-10-09 Mark Rowe <mrowe@apple.com> 7678 7679 Attempt to fix the GTK release build. 7680 7681 * GNUmakefile.am: Include Grammar.cpp in release builds now that 7682 AllInOneFile.cpp is gone. 7683 76842009-10-09 Gabor Loki <loki@inf.u-szeged.hu> 7685 7686 Rubber-stamped by Eric Seidel. 7687 7688 Add ARM JIT support for Gtk port (disabled by default) 7689 https://bugs.webkit.org/show_bug.cgi?id=30228 7690 7691 * GNUmakefile.am: 7692 76932009-10-08 Geoffrey Garen <ggaren@apple.com> 7694 7695 Tiger build fix: added a few more variable initializations. 7696 7697 * runtime/StringPrototype.cpp: 7698 (JSC::stringProtoFuncReplace): 7699 (JSC::stringProtoFuncSearch): 7700 77012009-10-08 Geoffrey Garen <ggaren@apple.com> 7702 7703 Qt build fix: added missing #include. 7704 7705 * jsc.cpp: 7706 77072009-10-08 Geoffrey Garen <ggaren@apple.com> 7708 7709 Tiger build fix: initialize variable whose initialization the compiler 7710 can't otherwise figure out. 7711 7712 * runtime/RegExpObject.cpp: 7713 (JSC::RegExpObject::match): 7714 77152009-10-08 Geoffrey Garen <ggaren@apple.com> 7716 7717 Windows build fix: updated exports. 7718 7719 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 7720 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 7721 77222009-10-08 Geoffrey Garen <ggaren@apple.com> 7723 7724 Tiger build fix: fixed file name case. 7725 7726 * JavaScriptCore.xcodeproj/project.pbxproj: 7727 77282009-10-08 Geoffrey Garen <ggaren@apple.com> 7729 7730 Reviewed by Maciej Stachowiak. 7731 7732 At long last, I pronounce the death of AllInOneFile.cpp. 7733 7734 SunSpider reports a 1.01x speedup. 7735 7736 * AllInOneFile.cpp: Removed. 7737 * GNUmakefile.am: 7738 * JavaScriptCore.exp: 7739 * JavaScriptCore.gypi: 7740 * JavaScriptCore.xcodeproj/project.pbxproj: Added missing project files 7741 to compilation stages. 7742 7743 * parser/Grammar.y: 7744 * parser/Lexer.cpp: 7745 * parser/Lexer.h: 7746 (JSC::jscyylex): 7747 * runtime/ArrayConstructor.cpp: 7748 (JSC::constructArrayWithSizeQuirk): 7749 * runtime/Collector.h: 7750 * runtime/JSCell.cpp: 7751 (JSC::JSCell::operator new): 7752 * runtime/JSCell.h: 7753 (JSC::JSCell::operator new): 7754 * runtime/JSGlobalObject.cpp: 7755 (JSC::JSGlobalObject::operator new): 7756 * runtime/JSNumberCell.h: 7757 (JSC::JSNumberCell::operator new): 7758 * runtime/JSString.cpp: 7759 * runtime/JSString.h: 7760 (JSC::jsString): 7761 (JSC::jsSubstring): 7762 (JSC::jsOwnedString): 7763 * runtime/RegExpConstructor.cpp: 7764 * runtime/RegExpConstructor.h: 7765 (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate): 7766 (JSC::RegExpConstructorPrivate::lastOvector): 7767 (JSC::RegExpConstructorPrivate::tempOvector): 7768 (JSC::RegExpConstructorPrivate::changeLastOvector): 7769 (JSC::RegExpConstructor::performMatch): 7770 * runtime/StringPrototype.cpp: 7771 (JSC::stringProtoFuncMatch): 7772 * yarr/RegexJIT.cpp: 7773 * yarr/RegexJIT.h: 7774 (JSC::Yarr::executeRegex): Inlined a few things that Shark said 7775 were hot, on the presumption that AllInOneFile.cpp used to inline them 7776 automatically. 7777 77782009-10-08 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 7779 7780 Reviewed by Gavin Barraclough. 7781 7782 Fix for JIT'ed op_call instructions (evals, constructs, etc.) 7783 when !ENABLE(JIT_OPTIMIZE_CALL) && USE(JSVALUE32_64) 7784 7785 https://bugs.webkit.org/show_bug.cgi?id=30201 7786 7787 * jit/JITCall.cpp: 7788 (JSC::JIT::compileOpCall): 7789 77902009-10-07 Geoffrey Garen <ggaren@apple.com> 7791 7792 Windows build fix: removed no longer exported symbol. 7793 7794 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 7795 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 7796 77972009-10-07 Geoffrey Garen <ggaren@apple.com> 7798 7799 Reviewed by Oliver Hunt. 7800 7801 Fixed <rdar://problem/5751979> Database code takes JSLock on secondary 7802 thread, permanently slowing down JavaScript 7803 7804 Removed the optional lock from Heap::protect, Heap::unprotect, and friends, 7805 since WebCore no longer uses it. 7806 7807 * JavaScriptCore.exp: 7808 * runtime/Collector.cpp: 7809 (JSC::Heap::protect): 7810 (JSC::Heap::unprotect): 7811 (JSC::Heap::markProtectedObjects): 7812 (JSC::Heap::protectedGlobalObjectCount): 7813 (JSC::Heap::protectedObjectCount): 7814 (JSC::Heap::protectedObjectTypeCounts): 7815 * runtime/Collector.h: 7816 78172009-10-07 Zoltan Horvath <zoltan@webkit.org> 7818 7819 Reviewed by Darin Adler. 7820 7821 Allow custom memory allocation control for JavaScriptCore's IdentifierArena 7822 https://bugs.webkit.org/show_bug.cgi?id=30158 7823 7824 Inherits IdentifierArena class from FastAllocBase because it has been 7825 instantiated by 'new' in JavaScriptCore/parser/ParserArena.cpp:36. 7826 7827 * parser/ParserArena.h: 7828 78292009-10-07 Adam Roben <aroben@apple.com> 7830 7831 Export DateInstance::info in a way that works on Windows 7832 7833 Fixes <http://webkit.org/b/30171> 7834 fast/dom/Window/window-postmessage-clone.html fails on Windows 7835 7836 Reviewed by Anders Carlsson. 7837 7838 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 7839 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 7840 Removed the export of DateInstance::info from here. 7841 7842 * runtime/DateInstance.h: Use JS_EXPORTDATA to export 7843 DateInstance::info, which is the required way of exporting data on 7844 Windows. 7845 78462009-10-07 Jørgen Lind <jorgen.lind@nokia.com> 7847 7848 Reviewed by Simon Hausmann. 7849 7850 When enabling or disabling the JIT through .qmake.cache, make sure 7851 to also toggle ENABLE_YARR_JIT. 7852 7853 * JavaScriptCore.pri: 7854 78552009-10-06 Priit Laes <plaes@plaes.org> 7856 7857 Reviewed by Gavin Barraclough. 7858 7859 Linking fails with "relocation R_X86_64_PC32 against symbol 7860 `cti_vm_throw'" 7861 https://bugs.webkit.org/show_bug.cgi?id=28422 7862 7863 * jit/JITStubs.cpp: 7864 Mark cti_vm_throw symbol as PLT-indirect symbol, so it doesn't end up 7865 in text segment causing relocation errors on amd64 architecture. 7866 Introduced new define SYMBOL_STRING_RELOCATION for such symbols. 7867 78682009-10-06 Oliver Hunt <oliver@apple.com> 7869 7870 Windows linking fix 7871 7872 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 7873 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 7874 78752009-10-06 Oliver Hunt <oliver@apple.com> 7876 7877 Reviewed by NOBODY (build fix). 7878 7879 Windows build fix. 7880 7881 * runtime/DateInstance.cpp: 7882 78832009-10-05 Oliver Hunt <oliver@apple.com> 7884 7885 Reviewed by Gavin Barraclough. 7886 7887 It should be possible to post (clone) built-in JS objects to Workers 7888 https://bugs.webkit.org/show_bug.cgi?id=22878 7889 7890 Expose helpers to throw correct exceptions during object graph walk 7891 used for cloning and add a helper function to create Date instances 7892 without going through the JS Date constructor function. 7893 7894 * JavaScriptCore.exp: 7895 * JavaScriptCore.xcodeproj/project.pbxproj: 7896 * runtime/DateInstance.cpp: 7897 (JSC::DateInstance::DateInstance): 7898 * runtime/DateInstance.h: 7899 * runtime/ExceptionHelpers.cpp: 7900 (JSC::createTypeError): 7901 * runtime/ExceptionHelpers.h: 7902 79032009-10-06 David Levin <levin@chromium.org> 7904 7905 Reviewed by Oliver Hunt. 7906 7907 StringImpl needs a method to get an instance for another thread which doesn't copy the underlying buffer. 7908 https://bugs.webkit.org/show_bug.cgi?id=30095 7909 7910 * wtf/CrossThreadRefCounted.h: 7911 Removed an unused function and assert improvement. 7912 (WTF::CrossThreadRefCounted::isOwnedByCurrentThread): Moved out common code from asserts. 7913 (WTF::CrossThreadRefCounted::ref): Changed assert to use the common method. 7914 (WTF::CrossThreadRefCounted::deref): Changed assert to use the common method. 7915 (WTF::CrossThreadRefCounted::crossThreadCopy): Since this includes a potentially 7916 non-threadsafe operation, add an assert that the class is owned by the current thread. 7917 79182009-10-05 Kevin Ollivier <kevino@theolliviers.com> 7919 7920 wx build fix. Add Symbian files to the list of excludes. 7921 7922 * wscript: 7923 79242009-10-05 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 7925 7926 Reviewed by Simon Hausmann. 7927 7928 [Qt] Remove precompiled header from JavaScriptCore compilation to 7929 prevent qmake warning during autonomous compilation. 7930 https://bugs.webkit.org/show_bug.cgi?id=30069 7931 7932 * JavaScriptCore.pro: 7933 79342009-10-02 Geoffrey Garen <ggaren@apple.com> 7935 7936 Reviewed by Sam Weinig. 7937 7938 Removed the concept of a "fast access cutoff" in arrays, because it 7939 punished some patterns of array access too much, and made things too 7940 complex for inlining in some cases. 7941 7942 1.3% speedup on SunSpider. 7943 7944 * jit/JITOpcodes.cpp: 7945 (JSC::JIT::emitSlow_op_get_by_val): 7946 (JSC::JIT::emitSlow_op_put_by_val): 7947 * jit/JITPropertyAccess.cpp: 7948 (JSC::JIT::emit_op_get_by_val): 7949 (JSC::JIT::emitSlow_op_get_by_val): 7950 (JSC::JIT::emit_op_put_by_val): 7951 (JSC::JIT::emitSlow_op_put_by_val): 7952 * jit/JITStubs.cpp: 7953 * jit/JITStubs.h: 7954 (JSC::): Check m_vectorLength instead of m_fastAccessCutoff when 7955 getting / putting from / to an array. Inline putting past the end of 7956 the array. 7957 7958 * runtime/JSArray.cpp: 7959 (JSC::JSArray::JSArray): 7960 (JSC::JSArray::getOwnPropertySlot): 7961 (JSC::JSArray::getOwnPropertyDescriptor): 7962 (JSC::JSArray::put): 7963 (JSC::JSArray::putSlowCase): 7964 (JSC::JSArray::deleteProperty): 7965 (JSC::JSArray::getOwnPropertyNames): 7966 (JSC::JSArray::increaseVectorLength): 7967 (JSC::JSArray::setLength): 7968 (JSC::JSArray::pop): 7969 (JSC::JSArray::push): 7970 (JSC::JSArray::sort): 7971 (JSC::JSArray::fillArgList): 7972 (JSC::JSArray::copyToRegisters): 7973 (JSC::JSArray::compactForSorting): 7974 (JSC::JSArray::checkConsistency): 7975 * runtime/JSArray.h: 7976 (JSC::JSArray::canGetIndex): 7977 (JSC::JSArray::canSetIndex): 7978 (JSC::JSArray::setIndex): 7979 (JSC::JSArray::markChildrenDirect): Removed m_fastAccessCutoff, and 7980 replaced with checks for JSValue() to detect reads and writes from / to 7981 uninitialized parts of the array. 7982 79832009-10-02 Jonni Rainisto <jonni.rainisto@nokia.com> 7984 7985 Reviewed by Darin Adler. 7986 7987 Math.random() gives too low values on Win32 when _CRT_RAND_S is not defined 7988 https://bugs.webkit.org/show_bug.cgi?id=29956 7989 7990 * wtf/RandomNumber.cpp: 7991 (WTF::randomNumber): Added PLATFORM(WIN_OS) to handle 15bit rand() 7992 79932009-10-02 Geoffrey Garen <ggaren@apple.com> 7994 7995 Reviewed by Sam Weinig. 7996 7997 Take one branch instead of two to test for JSValue(). 7998 7999 1.1% SunSpider speedup. 8000 8001 * jit/JITCall.cpp: 8002 (JSC::JIT::compileOpCall): 8003 * jit/JITOpcodes.cpp: 8004 (JSC::JIT::emit_op_to_jsnumber): 8005 (JSC::JIT::emit_op_create_arguments): 8006 * jit/JITPropertyAccess.cpp: 8007 (JSC::JIT::emitSlow_op_get_by_val): 8008 (JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead 8009 of testing for the cell tag with a 0 payload. 8010 8011 * runtime/JSValue.cpp: 8012 (JSC::JSValue::description): Added support for dumping the new empty value, 8013 and deleted values, in debug builds. 8014 8015 * runtime/JSValue.h: 8016 (JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag. 8017 8018 (JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value 8019 tag, to avoid having two different c++ versions of null / empty. 8020 8021 (JSC::JSValue::operator bool): Test for the empty value tag, instead 8022 of testing for the cell tag with a 0 payload. 8023 80242009-10-02 Steve Falkenburg <sfalken@apple.com> 8025 8026 Reviewed by Mark Rowe. 8027 8028 <https://bugs.webkit.org/show_bug.cgi?id=29989> 8029 Safari version number shouldn't be exposed in WebKit code 8030 8031 For a WebKit version of 532.3.4: 8032 Product version is: 5.32.3.4 (was 4.0.3.0) 8033 File version is: 5.32.3.4 (was 4.532.3.4) 8034 8035 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: 8036 80372009-10-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 8038 8039 Rubber-stamped by Simon Hausmann. 8040 8041 Fix the Qt on Mac OS X build. 8042 8043 * wtf/FastMalloc.cpp: 8044 80452009-10-02 Jørgen Lind <jorgen.lind@nokia.com> 8046 8047 Reviewed by Simon Hausmann. 8048 8049 Allow enabling and disabling of the JIT through a qmake variable. 8050 8051 Qt's configure may set this variable through .qmake.cache if a 8052 commandline option is given and/or the compile test for hwcap.h 8053 failed/succeeded. 8054 8055 * JavaScriptCore.pri: 8056 80572009-10-01 Mark Rowe <mrowe@apple.com> 8058 8059 Fix the Tiger build. Don't unconditionally enable 3D canvas as it is not supported on Tiger. 8060 8061 * Configurations/FeatureDefines.xcconfig: 8062 80632009-10-01 Yongjun Zhang <yongjun.zhang@nokia.com> 8064 8065 Reviewed by Darin Adler. 8066 8067 https://bugs.webkit.org/show_bug.cgi?id=29187 8068 8069 Don't inline ~ListRefPtr() to work around winscw compiler forward declaration 8070 bug regarding templated classes. 8071 8072 The compiler bug is reported at: 8073 https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812 8074 8075 The change will be reverted when the above bug is fixed in winscw compiler. 8076 8077 * wtf/ListRefPtr.h: 8078 (WTF::::~ListRefPtr): 8079 80802009-10-01 Zoltan Horvath <zoltan@webkit.org> 8081 8082 Reviewed by Simon Hausmann. 8083 8084 [Qt] Allow custom memory allocation control for the whole JavaScriptCore 8085 https://bugs.webkit.org/show_bug.cgi?id=27029 8086 8087 Since in JavaScriptCore almost every class which has been instantiated by operator new is 8088 inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port 8089 when USE_SYSTEM_MALLOC=0. 8090 8091 Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread(). 8092 (It's needed for the functionality of TCmalloc.) 8093 8094 Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled. 8095 8096 * JavaScriptCore.pri: 8097 * wtf/FastMalloc.cpp: 8098 (WTF::sleep): 8099 * wtf/FastMalloc.h: 8100 81012009-09-30 Gabor Loki <loki@inf.u-szeged.hu> 8102 8103 Reviewed by George Staikos. 8104 8105 Defines two pseudo-platforms for ARM and Thumb-2 instruction set. 8106 https://bugs.webkit.org/show_bug.cgi?id=29122 8107 8108 Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2 8109 macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used 8110 when Thumb-2 instruction set is the required target. The 8111 PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In 8112 case where the code is common the PLATFORM(ARM) have to be used. 8113 8114 Modified by George Wright <gwright@rim.com> to correctly work 8115 with the RVCT-defined __TARGET_ARCH_ARM and __TARGET_ARCH_THUMB 8116 compiler macros, as well as adding readability changes. 8117 8118 * wtf/Platform.h: 8119 81202009-09-30 Oliver Hunt <oliver@apple.com> 8121 8122 Reviewed by Geoff Garen. 8123 8124 Devirtualise array toString conversion 8125 8126 Tweak the implementation of Array.prototype.toString to have a fast path 8127 when acting on a true JSArray. 8128 8129 * runtime/ArrayPrototype.cpp: 8130 (JSC::arrayProtoFuncToString): 8131 81322009-09-30 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 8133 8134 Reviewed by Geoffrey Garen. 8135 8136 Buildfix for platforms using JSVALUE32. 8137 https://bugs.webkit.org/show_bug.cgi?id=29915 8138 8139 After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case. 8140 Also removed unreachable code. 8141 8142 * jit/JITArithmetic.cpp: 8143 (JSC::JIT::emit_op_add): 8144 - Declaration of "OperandTypes types" moved before first use. 8145 - Typos fixed: dst modified to result, regT2 added. 8146 - Unreachable code removed. 8147 (JSC::JIT::emitSlow_op_add): 8148 - Missing declaration of "OperandTypes types" added. 8149 81502009-09-30 Janne Koskinen <janne.p.koskinen@digia.com> 8151 8152 Reviewed by Simon Hausmann. 8153 8154 Reduce heap size on Symbian from 64MB to 8MB. 8155 8156 This is not a perfect fix, it requires more fine tuning. 8157 But this makes it possible again to debug in the emulator, 8158 which is more important in order to be able to fix other 8159 run-time issues. 8160 8161 * runtime/Collector.h: 8162 81632009-09-30 Janne Koskinen <janne.p.koskinen@digia.com> 8164 8165 Reviewed by Simon Hausmann. 8166 8167 Fix CRASH() macro for Symbian build. 8168 8169 * wtf/Assertions.h: Added missing } 8170 81712009-09-29 Geoffrey Garen <ggaren@apple.com> 8172 8173 Reviewed by Gavin Barraclough. 8174 8175 Inlined a few math operations. 8176 8177 ~1% SunSpider speedup. 8178 8179 * jit/JIT.h: 8180 * jit/JITArithmetic.cpp: 8181 (JSC::JIT::compileBinaryArithOpSlowCase): 8182 (JSC::JIT::emitSlow_op_add): 8183 (JSC::JIT::emitSlow_op_mul): 8184 (JSC::JIT::emit_op_sub): 8185 (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on 8186 a constant int and a double. 8187 81882009-09-28 Oliver Hunt <oliver@apple.com> 8189 8190 Reviewed by Gavin Barraclough. 8191 8192 Tidy up codeblock sampler 8193 https://bugs.webkit.org/show_bug.cgi?id=29836 8194 8195 Some rather simple refactoring of codeblock sampler so that 8196 it's easier for us to use it to find problems in non-jsc 8197 environments 8198 8199 * JavaScriptCore.exp: 8200 * bytecode/SamplingTool.h: 8201 * debugger/Debugger.cpp: 8202 (JSC::evaluateInGlobalCallFrame): 8203 * debugger/DebuggerCallFrame.cpp: 8204 (JSC::DebuggerCallFrame::evaluate): 8205 * interpreter/Interpreter.cpp: 8206 (JSC::Interpreter::Interpreter): 8207 (JSC::Interpreter::execute): 8208 (JSC::Interpreter::privateExecute): 8209 (JSC::Interpreter::enableSampler): 8210 (JSC::Interpreter::dumpSampleData): 8211 (JSC::Interpreter::startSampling): 8212 (JSC::Interpreter::stopSampling): 8213 * interpreter/Interpreter.h: 8214 (JSC::Interpreter::sampler): 8215 * jit/JIT.h: 8216 * jsc.cpp: 8217 (runWithScripts): 8218 * runtime/Completion.cpp: 8219 (JSC::checkSyntax): 8220 (JSC::evaluate): 8221 * runtime/Executable.h: 8222 (JSC::EvalExecutable::EvalExecutable): 8223 (JSC::ProgramExecutable::create): 8224 (JSC::ProgramExecutable::ProgramExecutable): 8225 * runtime/JSGlobalData.cpp: 8226 (JSC::JSGlobalData::startSampling): 8227 (JSC::JSGlobalData::stopSampling): 8228 (JSC::JSGlobalData::dumpSampleData): 8229 * runtime/JSGlobalData.h: 8230 * runtime/JSGlobalObjectFunctions.cpp: 8231 (JSC::globalFuncEval): 8232 82332009-09-29 Jeremy Orlow <jorlow@chromium.org> 8234 8235 Reviewed by Dimitri Glazkov. 8236 8237 Add GYP generated files to svn:ignore 8238 https://bugs.webkit.org/show_bug.cgi?id=29895 8239 8240 The following files are generated by JavaScriptCore's GYP file and should be ignored: 8241 8242 pcre.mk 8243 wtf.scons 8244 wtf.mk 8245 SConstruct 8246 wtf_config.scons 8247 wtf_config.mk 8248 pcre.scons 8249 8250 * JavaScriptCore.gyp: Changed property svn:ignore. 8251 82522009-09-29 Geoffrey Garen <ggaren@apple.com> 8253 8254 Reviewed by Sam Weinig. 8255 8256 Standardized an optimization for adding non-numbers. 8257 8258 SunSpider says maybe a tiny speedup. 8259 8260 * jit/JITArithmetic.cpp: 8261 (JSC::JIT::emit_op_add): 8262 (JSC::JIT::emitSlow_op_add): 8263 82642009-09-29 Geoffrey Garen <ggaren@apple.com> 8265 8266 Windows build fix: export a new symbol. 8267 8268 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 8269 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 8270 82712009-09-28 Geoffrey Garen <ggaren@apple.com> 8272 8273 Reviewed by Sam Weinig. 8274 8275 Removed virtual destructor from JSGlobalObjectData to eliminate pointer 8276 fix-ups when accessing JSGlobalObject::d. 8277 8278 Replaced with an explicit destructor function pointer. 8279 8280 6% speedup on bench-alloc-nonretained.js. 8281 8282 * JavaScriptCore.exp: 8283 * runtime/JSGlobalObject.cpp: 8284 (JSC::JSGlobalObject::~JSGlobalObject): 8285 (JSC::JSGlobalObject::destroyJSGlobalObjectData): 8286 * runtime/JSGlobalObject.h: 8287 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): 8288 (JSC::JSGlobalObject::JSGlobalObject): 8289 82902009-09-29 Janne Koskinen <janne.p.koskinen@digia.com> 8291 8292 Reviewed by David Kilzer. 8293 8294 [Qt] Assert messages prints visible in Symbian 8295 https://bugs.webkit.org/show_bug.cgi?id=29808 8296 8297 Asserts use vprintf to print the messages to stderr. 8298 In Symbian Open C it is not possible to see stderr so 8299 I routed the messages to stdout instead. 8300 8301 * wtf/Assertions.cpp: 8302 83032009-09-29 Janne Koskinen <janne.p.koskinen@digia.com> 8304 8305 Reviewed by Darin Adler. 8306 8307 [Qt] Symbian CRASH macro implementation 8308 8309 Added Symbian specific crash macro that 8310 stops to crash line if JIT debugging is used. 8311 Additional differentiation of access violation 8312 (KERN-EXEC 3) and CRASH panic. 8313 8314 * wtf/Assertions.h: 8315 83162009-09-28 Mark Rowe <mrowe@apple.com> 8317 8318 Fix the PowerPC build. 8319 8320 * JavaScriptCore.exp: 8321 83222009-09-28 Mark Rowe <mrowe@apple.com> 8323 8324 Reviewed by Gavin Barraclough. 8325 8326 <rdar://problem/7195704> JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC. 8327 8328 * runtime/Collector.cpp: 8329 (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer 8330 to ensure that we correctly interpret the contents of registers during marking. 8331 83322009-09-28 Geoffrey Garen <ggaren@apple.com> 8333 8334 Windows build fix: added new exports. 8335 8336 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 8337 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 8338 83392009-09-28 Geoffrey Garen <ggaren@apple.com> 8340 8341 Windows build fix: removed exports that no longer exist. 8342 8343 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 8344 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 8345 83462009-09-28 Geoffrey Garen <ggaren@apple.com> 8347 8348 Reviewed by Darin Adler. 8349 8350 NotNullPassRefPtr: smart pointer optimized for passing references that are not null 8351 https://bugs.webkit.org/show_bug.cgi?id=29822 8352 8353 Added NotNullPassRefPtr, and deployed it in all places that initialize 8354 JavaScript objects. 8355 8356 2.2% speedup on bench-allocate-nonretained.js. 8357 8358 * API/JSCallbackConstructor.cpp: 8359 (JSC::JSCallbackConstructor::JSCallbackConstructor): 8360 * API/JSCallbackConstructor.h: 8361 * API/JSCallbackObject.h: 8362 * API/JSCallbackObjectFunctions.h: 8363 (JSC::JSCallbackObject::JSCallbackObject): 8364 * JavaScriptCore.exp: 8365 * bytecode/CodeBlock.h: 8366 (JSC::CodeBlock::addFunctionDecl): 8367 (JSC::CodeBlock::addFunctionExpr): 8368 * runtime/ArrayConstructor.cpp: 8369 (JSC::ArrayConstructor::ArrayConstructor): 8370 * runtime/ArrayConstructor.h: 8371 * runtime/ArrayPrototype.cpp: 8372 (JSC::ArrayPrototype::ArrayPrototype): 8373 * runtime/ArrayPrototype.h: 8374 * runtime/BooleanConstructor.cpp: 8375 (JSC::BooleanConstructor::BooleanConstructor): 8376 * runtime/BooleanConstructor.h: 8377 * runtime/BooleanObject.cpp: 8378 (JSC::BooleanObject::BooleanObject): 8379 * runtime/BooleanObject.h: 8380 * runtime/BooleanPrototype.cpp: 8381 (JSC::BooleanPrototype::BooleanPrototype): 8382 * runtime/BooleanPrototype.h: 8383 * runtime/DateConstructor.cpp: 8384 (JSC::DateConstructor::DateConstructor): 8385 * runtime/DateConstructor.h: 8386 * runtime/DateInstance.cpp: 8387 (JSC::DateInstance::DateInstance): 8388 * runtime/DateInstance.h: 8389 * runtime/DatePrototype.cpp: 8390 (JSC::DatePrototype::DatePrototype): 8391 * runtime/DatePrototype.h: 8392 * runtime/ErrorConstructor.cpp: 8393 (JSC::ErrorConstructor::ErrorConstructor): 8394 * runtime/ErrorConstructor.h: 8395 * runtime/ErrorInstance.cpp: 8396 (JSC::ErrorInstance::ErrorInstance): 8397 * runtime/ErrorInstance.h: 8398 * runtime/ErrorPrototype.cpp: 8399 (JSC::ErrorPrototype::ErrorPrototype): 8400 * runtime/ErrorPrototype.h: 8401 * runtime/FunctionConstructor.cpp: 8402 (JSC::FunctionConstructor::FunctionConstructor): 8403 * runtime/FunctionConstructor.h: 8404 * runtime/FunctionPrototype.cpp: 8405 (JSC::FunctionPrototype::FunctionPrototype): 8406 * runtime/FunctionPrototype.h: 8407 * runtime/GlobalEvalFunction.cpp: 8408 (JSC::GlobalEvalFunction::GlobalEvalFunction): 8409 * runtime/GlobalEvalFunction.h: 8410 * runtime/InternalFunction.cpp: 8411 (JSC::InternalFunction::InternalFunction): 8412 * runtime/InternalFunction.h: 8413 (JSC::InternalFunction::InternalFunction): 8414 * runtime/JSActivation.cpp: 8415 (JSC::JSActivation::JSActivation): 8416 * runtime/JSActivation.h: 8417 (JSC::JSActivation::JSActivationData::JSActivationData): 8418 * runtime/JSArray.cpp: 8419 (JSC::JSArray::JSArray): 8420 * runtime/JSArray.h: 8421 * runtime/JSByteArray.cpp: 8422 (JSC::JSByteArray::JSByteArray): 8423 * runtime/JSByteArray.h: 8424 * runtime/JSFunction.cpp: 8425 (JSC::JSFunction::JSFunction): 8426 * runtime/JSFunction.h: 8427 * runtime/JSGlobalObject.h: 8428 (JSC::JSGlobalObject::JSGlobalObject): 8429 * runtime/JSONObject.h: 8430 (JSC::JSONObject::JSONObject): 8431 * runtime/JSObject.h: 8432 (JSC::JSObject::JSObject): 8433 (JSC::JSObject::setStructure): 8434 * runtime/JSVariableObject.h: 8435 (JSC::JSVariableObject::JSVariableObject): 8436 * runtime/JSWrapperObject.h: 8437 (JSC::JSWrapperObject::JSWrapperObject): 8438 * runtime/MathObject.cpp: 8439 (JSC::MathObject::MathObject): 8440 * runtime/MathObject.h: 8441 * runtime/NativeErrorConstructor.cpp: 8442 (JSC::NativeErrorConstructor::NativeErrorConstructor): 8443 * runtime/NativeErrorConstructor.h: 8444 * runtime/NativeErrorPrototype.cpp: 8445 (JSC::NativeErrorPrototype::NativeErrorPrototype): 8446 * runtime/NativeErrorPrototype.h: 8447 * runtime/NumberConstructor.cpp: 8448 (JSC::NumberConstructor::NumberConstructor): 8449 * runtime/NumberConstructor.h: 8450 * runtime/NumberObject.cpp: 8451 (JSC::NumberObject::NumberObject): 8452 * runtime/NumberObject.h: 8453 * runtime/NumberPrototype.cpp: 8454 (JSC::NumberPrototype::NumberPrototype): 8455 * runtime/NumberPrototype.h: 8456 * runtime/ObjectConstructor.cpp: 8457 (JSC::ObjectConstructor::ObjectConstructor): 8458 * runtime/ObjectConstructor.h: 8459 * runtime/ObjectPrototype.cpp: 8460 (JSC::ObjectPrototype::ObjectPrototype): 8461 * runtime/ObjectPrototype.h: 8462 * runtime/PropertyNameArray.h: 8463 (JSC::PropertyNameArrayData::setCachedPrototypeChain): 8464 * runtime/PrototypeFunction.cpp: 8465 (JSC::PrototypeFunction::PrototypeFunction): 8466 * runtime/PrototypeFunction.h: 8467 * runtime/RegExpConstructor.cpp: 8468 (JSC::RegExpConstructor::RegExpConstructor): 8469 * runtime/RegExpConstructor.h: 8470 * runtime/RegExpObject.cpp: 8471 (JSC::RegExpObject::RegExpObject): 8472 * runtime/RegExpObject.h: 8473 (JSC::RegExpObject::RegExpObjectData::RegExpObjectData): 8474 * runtime/RegExpPrototype.cpp: 8475 (JSC::RegExpPrototype::RegExpPrototype): 8476 * runtime/RegExpPrototype.h: 8477 * runtime/StringConstructor.cpp: 8478 (JSC::StringConstructor::StringConstructor): 8479 * runtime/StringConstructor.h: 8480 * runtime/StringObject.cpp: 8481 (JSC::StringObject::StringObject): 8482 * runtime/StringObject.h: 8483 * runtime/StringObjectThatMasqueradesAsUndefined.h: 8484 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): 8485 * runtime/StringPrototype.cpp: 8486 (JSC::StringPrototype::StringPrototype): 8487 * runtime/StringPrototype.h: 8488 * wtf/PassRefPtr.h: 8489 (WTF::NotNullPassRefPtr::NotNullPassRefPtr): 8490 (WTF::NotNullPassRefPtr::~NotNullPassRefPtr): 8491 (WTF::NotNullPassRefPtr::get): 8492 (WTF::NotNullPassRefPtr::clear): 8493 (WTF::NotNullPassRefPtr::releaseRef): 8494 (WTF::NotNullPassRefPtr::operator*): 8495 (WTF::NotNullPassRefPtr::operator->): 8496 (WTF::NotNullPassRefPtr::operator!): 8497 (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType): 8498 * wtf/RefPtr.h: 8499 (WTF::RefPtr::RefPtr): 8500 (WTF::operator==): 8501 85022009-09-28 Oliver Hunt <oliver@apple.com> 8503 8504 Reviewed by Geoff Garen. 8505 8506 Hard dependency on SSE2 instruction set with JIT 8507 https://bugs.webkit.org/show_bug.cgi?id=29779 8508 8509 Add floating point support checks to op_jfalse and op_jtrue, and 8510 fix the logic for the slow case of op_add 8511 8512 * jit/JITArithmetic.cpp: 8513 (JSC::JIT::emitSlow_op_add): 8514 * jit/JITOpcodes.cpp: 8515 (JSC::JIT::emit_op_jfalse): 8516 (JSC::JIT::emit_op_jtrue): 8517 85182009-09-28 Yaar Schnitman <yaar@chromium.org> 8519 8520 Reviewed by Dimitri Glazkov. 8521 8522 Chromium port - recognize we are being built independently 8523 of chromium and look for dependencies under webkit/chromium rather 8524 than chromium/src. 8525 8526 https://bugs.webkit.org/show_bug.cgi?id=29722 8527 8528 * JavaScriptCore.gyp/JavaScriptCore.gyp: 8529 85302009-09-28 Jakub Wieczorek <faw217@gmail.com> 8531 8532 Reviewed by Simon Hausmann. 8533 8534 [Qt] Implement XSLT support with QtXmlPatterns. 8535 https://bugs.webkit.org/show_bug.cgi?id=28303 8536 8537 * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define. 8538 85392009-09-28 Gabor Loki <loki@inf.u-szeged.hu> 8540 8541 Reviewed by Simon Hausmann. 8542 8543 Remove __clear_cache which is an internal function of GCC 8544 https://bugs.webkit.org/show_bug.cgi?id=28886 8545 8546 Although __clear_cache is exported from GCC, this is an internal 8547 function. GCC makes no promises about it. 8548 8549 * jit/ExecutableAllocator.h: 8550 (JSC::ExecutableAllocator::cacheFlush): 8551 85522009-09-28 Sam Weinig <sam@webkit.org> 8553 8554 Reviewed by Oliver Hunt. 8555 8556 Fix an absolute path to somewhere in Oliver's machine to a relative path 8557 for derived JSONObject.lut.h. 8558 8559 * JavaScriptCore.xcodeproj/project.pbxproj: 8560 85612009-09-28 Joerg Bornemann <joerg.bornemann@nokia.com> 8562 8563 Reviewed by Simon Hausmann. 8564 8565 Add ARM version detection for Windows CE. 8566 8567 * wtf/Platform.h: 8568 85692009-09-26 Yongjun Zhang <yongjun.zhang@nokia.com> 8570 8571 Reviewed by Simon Hausmann. 8572 8573 Add MarkStackSymbian.cpp to build JavascriptCore for Symbian. 8574 8575 Re-use Windows shrinkAllocation implementation because Symbian doesn't 8576 support releasing part of memory region. 8577 8578 Use fastMalloc and fastFree to implement allocateStack and releaseStack 8579 for Symbian port. 8580 8581 * JavaScriptCore.pri: 8582 * runtime/MarkStack.h: 8583 (JSC::MarkStack::MarkStackArray::shrinkAllocation): 8584 * runtime/MarkStackSymbian.cpp: Added. 8585 (JSC::MarkStack::initializePagesize): 8586 (JSC::MarkStack::allocateStack): 8587 (JSC::MarkStack::releaseStack): 8588 85892009-09-25 Gabor Loki <loki@inf.u-szeged.hu> 8590 8591 Reviewed by Gavin Barraclough. 8592 8593 Fix unaligned data access in YARR_JIT on ARMv5 and below. 8594 https://bugs.webkit.org/show_bug.cgi?id=29695 8595 8596 On ARMv5 and below all data access should be naturally aligned. 8597 In the YARR_JIT there is a case when character pairs are 8598 loaded from the input string, but this data access is not 8599 naturally aligned. This fix introduces load32WithUnalignedHalfWords 8600 and branch32WithUnalignedHalfWords functions which contain 8601 naturally aligned memory loads - half word loads - on ARMv5 and below. 8602 8603 * assembler/MacroAssemblerARM.cpp: 8604 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords): 8605 * assembler/MacroAssemblerARM.h: 8606 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords): 8607 (JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords): 8608 * assembler/MacroAssemblerARMv7.h: 8609 (JSC::MacroAssemblerARMv7::load32WithUnalignedHalfWords): 8610 (JSC::MacroAssemblerARMv7::branch32): 8611 (JSC::MacroAssemblerARMv7::branch32WithUnalignedHalfWords): 8612 * assembler/MacroAssemblerX86Common.h: 8613 (JSC::MacroAssemblerX86Common::load32WithUnalignedHalfWords): 8614 (JSC::MacroAssemblerX86Common::branch32WithUnalignedHalfWords): 8615 * wtf/Platform.h: 8616 * yarr/RegexJIT.cpp: 8617 (JSC::Yarr::RegexGenerator::generatePatternCharacterPair): 8618 86192009-09-25 Jeremy Orlow <jorlow@chromium.org> 8620 8621 This is breaking Chromium try bots, so I'm counting this as a build fix. 8622 8623 Add more svn:ignore exceptions. On different platforms, these files are 8624 generated with different case for JavaScriptCore. Also there are some 8625 wtf project files that get built apparently. 8626 8627 * JavaScriptCore.gyp: Changed property svn:ignore. 8628 86292009-09-25 Ada Chan <adachan@apple.com> 8630 8631 Build fix. 8632 8633 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 8634 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 8635 86362009-09-25 Geoffrey Garen <ggaren@apple.com> 8637 8638 Reviewed by Darin Adler. 8639 8640 Inlined some object creation code, including lexicalGlobalObject access 8641 https://bugs.webkit.org/show_bug.cgi?id=29750 8642 8643 SunSpider says 0.5% faster. 8644 8645 0.8% speedup on bench-alloc-nonretained.js. 8646 2.5% speedup on v8-splay.js. 8647 8648 * interpreter/CachedCall.h: 8649 (JSC::CachedCall::CachedCall): 8650 * interpreter/CallFrame.h: 8651 (JSC::ExecState::lexicalGlobalObject): 8652 (JSC::ExecState::globalThisValue): 8653 * interpreter/Interpreter.cpp: 8654 (JSC::Interpreter::dumpRegisters): 8655 (JSC::Interpreter::execute): 8656 (JSC::Interpreter::privateExecute): 8657 * jit/JITStubs.cpp: 8658 (JSC::DEFINE_STUB_FUNCTION): 8659 * runtime/FunctionConstructor.cpp: 8660 (JSC::constructFunction): 8661 * runtime/ScopeChain.cpp: 8662 (JSC::ScopeChainNode::print): 8663 * runtime/ScopeChain.h: 8664 (JSC::ScopeChainNode::ScopeChainNode): 8665 (JSC::ScopeChainNode::~ScopeChainNode): 8666 (JSC::ScopeChainNode::push): 8667 (JSC::ScopeChain::ScopeChain): 8668 (JSC::ScopeChain::globalObject): Added a globalObject data member to ScopeChainNode. 8669 Replaced accessor function for globalObject() with data member. Replaced 8670 globalThisObject() accessor with direct access to globalThis, to match. 8671 8672 * runtime/JSGlobalObject.cpp: 8673 (JSC::JSGlobalObject::init): 8674 * runtime/JSGlobalObject.h: Inlined array and object construction. 8675 86762009-09-25 Laszlo Gombos <laszlo.1.gombos@nokia.com> 8677 8678 Reviewed by Gavin Barraclough. 8679 8680 Add ARM version detection rules for Symbian 8681 https://bugs.webkit.org/show_bug.cgi?id=29715 8682 8683 * wtf/Platform.h: 8684 86852009-09-24 Xan Lopez <xlopez@igalia.com> 8686 8687 Reviewed by Mark "Do It!" Rowe. 8688 8689 Some GCC versions don't like C++-style comments in preprocessor 8690 directives, change to C-style to shut them up. 8691 8692 * wtf/Platform.h: 8693 86942009-09-24 Oliver Hunt <oliver@apple.com> 8695 8696 Reviewed by Gavin Barraclough. 8697 8698 Division is needlessly slow in 64-bit 8699 https://bugs.webkit.org/show_bug.cgi?id=29723 8700 8701 Add codegen for op_div on x86-64 8702 8703 * jit/JIT.cpp: 8704 (JSC::JIT::privateCompileMainPass): 8705 (JSC::JIT::privateCompileSlowCases): 8706 * jit/JIT.h: 8707 * jit/JITArithmetic.cpp: 8708 (JSC::JIT::compileBinaryArithOpSlowCase): 8709 (JSC::JIT::emit_op_div): 8710 (JSC::JIT::emitSlow_op_div): 8711 * jit/JITInlineMethods.h: 8712 (JSC::JIT::isOperandConstantImmediateDouble): 8713 (JSC::JIT::addressFor): 8714 (JSC::JIT::emitLoadDouble): 8715 (JSC::JIT::emitLoadInt32ToDouble): 8716 (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber): 8717 87182009-09-24 Jeremy Orlow <jorlow@chromium.org> 8719 8720 Reviewed by Dimitri Glazkov. 8721 8722 Add GYP generated files to svn:ignore 8723 https://bugs.webkit.org/show_bug.cgi?id=29724 8724 8725 Adding the following files to the svn:ignore list (all in the 8726 JavaScriptCore/JavaScriptCore.gyp directory) 8727 8728 JavaScriptCore.xcodeproj 8729 JavaScriptCore.sln 8730 JavaScriptCore.vcproj 8731 JavaScriptCore_Debug.rules 8732 JavaScriptCore_Release.rules 8733 JavaScriptCore_Release - no tcmalloc.rules 8734 JavaScriptCore_Purify.rules 8735 JavaScriptCore.mk 8736 JavaScriptCore_Debug_rules.mk 8737 JavaScriptCore_Release_rules.mk 8738 JavaScriptCore_Release - no tcmalloc_rules.mk 8739 JavaScriptCore_Purify_rules.mk 8740 JavaScriptCore.scons 8741 JavaScriptCore_main.scons 8742 8743 * JavaScriptCore.gyp: Changed property svn:ignore. 8744 87452009-09-24 Yong Li <yong.li@torchmobile.com> 8746 8747 Reviewed by Adam Barth. 8748 8749 Replace platform-dependent code with WTF::currentTime() 8750 https://bugs.webkit.org/show_bug.cgi?id=29148 8751 8752 * jsc.cpp: 8753 (StopWatch::start): 8754 (StopWatch::stop): 8755 (StopWatch::getElapsedMS): 8756 * runtime/TimeoutChecker.cpp: 8757 (JSC::getCPUTime): 8758 87592009-09-24 Mark Rowe <mrowe@apple.com> 8760 8761 Reviewed by Sam Weinig. 8762 8763 <rdar://problem/7215058> FastMalloc scavenging thread should be named 8764 8765 * wtf/FastMalloc.cpp: 8766 (WTF::TCMalloc_PageHeap::scavengerThread): Set the thread name. 8767 * wtf/Platform.h: Move the knowledge of whether pthread_setname_np exists to here as HAVE(PTHREAD_SETNAME_NP). 8768 * wtf/ThreadingPthreads.cpp: 8769 (WTF::setThreadNameInternal): Use HAVE(PTHREAD_SETNAME_NP). 8770 87712009-09-24 Geoffrey Garen <ggaren@apple.com> 8772 8773 Reviewed by Sam Weinig. 8774 8775 Renamed clear to removeAll, as suggested by Darin Adler. 8776 8777 * wtf/HashCountedSet.h: 8778 (WTF::::removeAll): 8779 87802009-09-24 Mark Rowe <mrowe@apple.com> 8781 8782 Reviewed by Gavin Barraclough. 8783 8784 Fix FastMalloc to build with assertions enabled. 8785 8786 * wtf/FastMalloc.cpp: 8787 (WTF::TCMalloc_Central_FreeList::ReleaseToSpans): 8788 * wtf/TCSpinLock.h: 8789 (TCMalloc_SpinLock::IsHeld): 8790 87912009-09-24 Geoffrey Garen <ggaren@apple.com> 8792 8793 Suggested by Darin Adler. 8794 8795 Removed some unnecessary parameter names. 8796 8797 * wtf/HashCountedSet.h: 8798 87992009-09-24 Janne Koskinen <janne.p.koskinen@digia.com> 8800 8801 Reviewed by Simon Hausmann. 8802 8803 On Windows JSChar is typedef'ed to wchar_t. 8804 8805 When building with WINSCW for Symbian we need to do the 8806 same typedef. 8807 8808 * API/JSStringRef.h: 8809 88102009-09-23 Geoffrey Garen <ggaren@apple.com> 8811 8812 A piece of my last patch that I forgot. 8813 8814 * wtf/HashCountedSet.h: 8815 (WTF::::clear): Added HashCountedSet::clear. 8816 88172009-09-24 Gabor Loki <loki@inf.u-szeged.hu> 8818 8819 Reviewed by Gavin Barraclough. 8820 8821 Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set 8822 https://bugs.webkit.org/show_bug.cgi?id=28886 8823 8824 There are some GCC packages (for example GCC-2006q3 from CodeSourcery) 8825 which contain __clear_cache built-in function only for C while the C++ 8826 version of __clear_cache is missing on ARM architectures. 8827 8828 Fixed a small bug in the inline assembly of cacheFlush function on 8829 ARM_TRADITIONAL. 8830 8831 * jit/ExecutableAllocator.h: 8832 (JSC::ExecutableAllocator::cacheFlush): 8833 88342009-09-23 Geoffrey Garen <ggaren@apple.com> 8835 8836 Reviewed by Sam Weinig. 8837 8838 Added the ability to swap vectors with inline capacities, so you can 8839 store a vector with inline capacity in a hash table. 8840 8841 * wtf/Vector.h: 8842 (WTF::swap): 8843 (WTF::VectorBuffer::swap): 8844 88452009-09-23 David Kilzer <ddkilzer@apple.com> 8846 8847 Move definition of USE(PLUGIN_HOST_PROCESS) from WebKitPrefix.h to Platform.h 8848 8849 Reviewed by Mark Rowe. 8850 8851 * wtf/Platform.h: Define WTF_USE_PLUGIN_HOST_PROCESS to 1 when 8852 building on 64-bit SnowLeopard. Define to 0 elsewhere. 8853 88542009-09-22 Oliver Hunt <oliver@apple.com> 8855 8856 Reviewed by Geoff Garen. 8857 8858 Code sampling builds are broken. 8859 https://bugs.webkit.org/show_bug.cgi?id=29662 8860 8861 Fix build. 8862 8863 * bytecode/EvalCodeCache.h: 8864 (JSC::EvalCodeCache::get): 8865 * bytecode/SamplingTool.cpp: 8866 (JSC::ScriptSampleRecord::sample): 8867 (JSC::SamplingTool::doRun): 8868 (JSC::SamplingTool::notifyOfScope): 8869 (JSC::compareScriptSampleRecords): 8870 (JSC::SamplingTool::dump): 8871 * bytecode/SamplingTool.h: 8872 (JSC::ScriptSampleRecord::ScriptSampleRecord): 8873 (JSC::ScriptSampleRecord::~ScriptSampleRecord): 8874 (JSC::SamplingTool::SamplingTool): 8875 * bytecompiler/BytecodeGenerator.cpp: 8876 (JSC::BytecodeGenerator::BytecodeGenerator): 8877 (JSC::BytecodeGenerator::emitNewFunction): 8878 (JSC::BytecodeGenerator::emitNewFunctionExpression): 8879 * bytecompiler/BytecodeGenerator.h: 8880 (JSC::BytecodeGenerator::makeFunction): 8881 * debugger/Debugger.cpp: 8882 (JSC::evaluateInGlobalCallFrame): 8883 * debugger/DebuggerCallFrame.cpp: 8884 (JSC::DebuggerCallFrame::evaluate): 8885 * parser/Nodes.cpp: 8886 (JSC::ScopeNode::ScopeNode): 8887 * runtime/Completion.cpp: 8888 (JSC::checkSyntax): 8889 (JSC::evaluate): 8890 * runtime/Executable.cpp: 8891 (JSC::FunctionExecutable::fromGlobalCode): 8892 * runtime/Executable.h: 8893 (JSC::ScriptExecutable::ScriptExecutable): 8894 (JSC::EvalExecutable::EvalExecutable): 8895 (JSC::EvalExecutable::create): 8896 (JSC::ProgramExecutable::ProgramExecutable): 8897 (JSC::FunctionExecutable::create): 8898 (JSC::FunctionExecutable::FunctionExecutable): 8899 * runtime/JSGlobalObjectFunctions.cpp: 8900 (JSC::globalFuncEval): 8901 89022009-09-22 Darin Adler <darin@apple.com> 8903 8904 Reviewed by Sam Weinig. 8905 8906 * wtf/Forward.h: Added PassOwnPtr. 8907 89082009-09-22 Yaar Schnitman <yaar@chromium.org> 8909 8910 Reviewed by David Levin. 8911 8912 Ported chromium.org's javascriptcore.gyp for the webkit chromium port. 8913 8914 https://bugs.webkit.org/show_bug.cgi?id=29617 8915 8916 * JavaScriptCore.gyp/JavaScriptCore.gyp: Added. 8917 89182009-09-22 Thiago Macieira <thiago.macieira@nokia.com> 8919 8920 Reviewed by Simon Hausmann. 8921 8922 Fix compilation with WINSCW: no varargs macros 8923 8924 Disable variadic arguments for WINSCW just like we do 8925 for MSVC7. 8926 8927 * wtf/Assertions.h: 8928 89292009-09-22 Kent Hansen <khansen@trolltech.com> 8930 8931 Reviewed by Simon Hausmann. 8932 8933 Disable variadic macros on MSVC7. 8934 8935 This was originally added in r26589 but not extended 8936 when LOG_DISABLED/ASSERT_DISABLED was introduced. 8937 8938 * wtf/Assertions.h: 8939 89402009-09-22 Simon Hausmann <simon.hausmann@nokia.com> 8941 8942 Unreviewed build fix for Windows CE < 5 8943 8944 Define WINCEBASIC to disable the IsDebuggerPresent() code in 8945 wtf/Assertions.cpp. 8946 8947 * JavaScriptCore.pri: 8948 89492009-09-22 Joerg Bornemann <joerg.bornemann@nokia.com> 8950 8951 Reviewed by Simon Hausmann. 8952 8953 Fix major memory leak in JavaScriptCore RegisterFile on Windows CE 8954 8955 https://bugs.webkit.org/show_bug.cgi?id=29367 8956 8957 On Widows CE we must decommit all committed pages before we release 8958 them. See VirtualFree documentation. 8959 Desktop Windows behaves much smoother in this situation. 8960 8961 * interpreter/RegisterFile.cpp: 8962 (JSC::RegisterFile::~RegisterFile): 8963 89642009-09-21 Greg Bolsinga <bolsinga@apple.com> 8965 8966 Reviewed by Simon Fraser & Sam Weinig. 8967 8968 Add ENABLE(ORIENTATION_EVENTS) 8969 https://bugs.webkit.org/show_bug.cgi?id=29508 8970 8971 * wtf/Platform.h: Also sort PLATFORM(IPHONE) #defines. 8972 89732009-09-21 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 8974 8975 Reviewed by Eric Seidel. 8976 8977 [Fix] SourceCode's uninitialized member 8978 8979 Potential source of crashes and bugs was fixed. Default constructor 8980 didn't initialized m_provider member. 8981 8982 https://bugs.webkit.org/show_bug.cgi?id=29364 8983 8984 * parser/SourceCode.h: 8985 (JSC::SourceCode::SourceCode): 8986 89872009-09-21 Oliver Hunt <oliver@apple.com> 8988 8989 Reviewed by Geoff Garen. 8990 8991 REGRESSION (r48582): Crash in StructureStubInfo::initPutByIdTransition when reloading trac.webkit.org 8992 https://bugs.webkit.org/show_bug.cgi?id=29599 8993 8994 It is unsafe to attempt to cache new property transitions on 8995 dictionaries of any type. 8996 8997 * interpreter/Interpreter.cpp: 8998 (JSC::Interpreter::tryCachePutByID): 8999 * jit/JITStubs.cpp: 9000 (JSC::JITThunks::tryCachePutByID): 9001 90022009-09-21 Oliver Hunt <oliver@apple.com> 9003 9004 RS=Maciej Stachowiak. 9005 9006 Re-land SNES fix with corrected assertion. 9007 9008 * interpreter/Interpreter.cpp: 9009 (JSC::Interpreter::resolveGlobal): 9010 (JSC::Interpreter::tryCachePutByID): 9011 (JSC::Interpreter::tryCacheGetByID): 9012 * jit/JITStubs.cpp: 9013 (JSC::JITThunks::tryCachePutByID): 9014 (JSC::JITThunks::tryCacheGetByID): 9015 (JSC::DEFINE_STUB_FUNCTION): 9016 * runtime/BatchedTransitionOptimizer.h: 9017 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer): 9018 * runtime/JSObject.cpp: 9019 (JSC::JSObject::removeDirect): 9020 * runtime/Structure.cpp: 9021 (JSC::Structure::Structure): 9022 (JSC::Structure::getEnumerablePropertyNames): 9023 (JSC::Structure::despecifyDictionaryFunction): 9024 (JSC::Structure::addPropertyTransitionToExistingStructure): 9025 (JSC::Structure::addPropertyTransition): 9026 (JSC::Structure::removePropertyTransition): 9027 (JSC::Structure::toDictionaryTransition): 9028 (JSC::Structure::toCacheableDictionaryTransition): 9029 (JSC::Structure::toUncacheableDictionaryTransition): 9030 (JSC::Structure::fromDictionaryTransition): 9031 (JSC::Structure::removePropertyWithoutTransition): 9032 * runtime/Structure.h: 9033 (JSC::Structure::isDictionary): 9034 (JSC::Structure::isUncacheableDictionary): 9035 (JSC::Structure::): 9036 * runtime/StructureChain.cpp: 9037 (JSC::StructureChain::isCacheable): 9038 90392009-09-21 Adam Roben <aroben@apple.com> 9040 9041 Revert r48573, as it caused many assertion failures 9042 9043 * interpreter/Interpreter.cpp: 9044 * jit/JITStubs.cpp: 9045 * runtime/BatchedTransitionOptimizer.h: 9046 * runtime/JSObject.cpp: 9047 * runtime/Structure.cpp: 9048 * runtime/Structure.h: 9049 * runtime/StructureChain.cpp: 9050 90512009-09-21 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 9052 9053 Unreviewed make dist build fix. Missing files. 9054 9055 * GNUmakefile.am: 9056 90572009-09-19 Gavin Barraclough <barraclough@apple.com> 9058 9059 Reviewed by Sam 'Cabin Boy' Weinig. 9060 9061 Fix stack alignment with ARM THUMB2 JIT. 9062 https://bugs.webkit.org/show_bug.cgi?id=29526 9063 9064 Stack is currently being decremented by 0x3c, bump this to 0x40 to make this a 9065 multiple of 16 bytes. 9066 9067 * jit/JITStubs.cpp: 9068 (JSC::JITThunks::JITThunks): 9069 * jit/JITStubs.h: 9070 90712009-09-20 Oliver Hunt <oliver@apple.com> 9072 9073 Reviewed by Maciej Stachowiak. 9074 9075 SNES is too slow 9076 https://bugs.webkit.org/show_bug.cgi?id=29534 9077 9078 The problem was that the emulator used multiple classes with 9079 more properties than our dictionary cutoff allowed, this resulted 9080 in more or less all critical logic inside the emulator requiring 9081 uncached property access. 9082 9083 Rather than simply bumping the dictionary cutoff, this patch 9084 recognises that there are two ways to create a "dictionary" 9085 structure. Either by adding a large number of properties, or 9086 by removing a property. In the case of adding properties we 9087 know all the existing properties will maintain their existing 9088 offsets, so we could cache access to those properties, if we 9089 know they won't be removed. 9090 9091 To make this possible, this patch adds the logic required to 9092 distinguish a dictionary created by addition from one created 9093 by removal. With this logic in place we can now cache access 9094 to objects with large numbers of properties. 9095 9096 SNES performance improved by more than 6x. 9097 9098 * interpreter/Interpreter.cpp: 9099 (JSC::Interpreter::resolveGlobal): 9100 (JSC::Interpreter::tryCachePutByID): 9101 (JSC::Interpreter::tryCacheGetByID): 9102 * jit/JITStubs.cpp: 9103 (JSC::JITThunks::tryCachePutByID): 9104 (JSC::JITThunks::tryCacheGetByID): 9105 (JSC::DEFINE_STUB_FUNCTION): 9106 * runtime/BatchedTransitionOptimizer.h: 9107 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer): 9108 * runtime/JSObject.cpp: 9109 (JSC::JSObject::removeDirect): 9110 * runtime/Structure.cpp: 9111 (JSC::Structure::Structure): 9112 (JSC::Structure::getEnumerablePropertyNames): 9113 (JSC::Structure::despecifyDictionaryFunction): 9114 (JSC::Structure::addPropertyTransitionToExistingStructure): 9115 (JSC::Structure::addPropertyTransition): 9116 (JSC::Structure::removePropertyTransition): 9117 (JSC::Structure::toDictionaryTransition): 9118 (JSC::Structure::toCacheableDictionaryTransition): 9119 (JSC::Structure::toUncacheableDictionaryTransition): 9120 (JSC::Structure::fromDictionaryTransition): 9121 (JSC::Structure::removePropertyWithoutTransition): 9122 * runtime/Structure.h: 9123 (JSC::Structure::isDictionary): 9124 (JSC::Structure::isUncacheableDictionary): 9125 (JSC::Structure::): 9126 * runtime/StructureChain.cpp: 9127 (JSC::StructureChain::isCacheable): 9128 91292009-09-19 Oliver Hunt <oliver@apple.com> 9130 9131 Reviewed by Maciej Stachowiak. 9132 9133 Implement ES5 Object.create function 9134 https://bugs.webkit.org/show_bug.cgi?id=29524 9135 9136 Implement Object.create. Very simple patch, effectively Object.defineProperties 9137 only creating the target object itself. 9138 9139 * runtime/CommonIdentifiers.h: 9140 * runtime/ObjectConstructor.cpp: 9141 (JSC::ObjectConstructor::ObjectConstructor): 9142 (JSC::objectConstructorCreate): 9143 91442009-09-19 Dan Bernstein <mitz@apple.com> 9145 9146 Fix clean debug builds. 9147 9148 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 9149 91502009-09-19 Joerg Bornemann <joerg.bornemann@nokia.com> 9151 9152 Reviewed by George Staikos. 9153 9154 QtWebKit Windows CE compile fix 9155 9156 https://bugs.webkit.org/show_bug.cgi?id=29379 9157 9158 There is no _aligned_alloc or _aligned_free on Windows CE. 9159 We just use the Windows code that was there before and use VirtualAlloc. 9160 But that also means that the BLOCK_SIZE must be 64K as this function 9161 allocates on 64K boundaries. 9162 9163 * runtime/Collector.cpp: 9164 (JSC::Heap::allocateBlock): 9165 (JSC::Heap::freeBlock): 9166 * runtime/Collector.h: 9167 91682009-09-19 Oliver Hunt <oliver@apple.com> 9169 9170 Reviewed by Sam Weinig. 9171 9172 Implement ES5 Object.defineProperties function 9173 https://bugs.webkit.org/show_bug.cgi?id=29522 9174 9175 Implement Object.defineProperties. Fairly simple patch, simply makes use of 9176 existing functionality used for defineProperty. 9177 9178 * runtime/CommonIdentifiers.h: 9179 * runtime/ObjectConstructor.cpp: 9180 (JSC::ObjectConstructor::ObjectConstructor): 9181 (JSC::defineProperties): 9182 (JSC::objectConstructorDefineProperties): 9183 91842009-09-19 Oliver Hunt <oliver@apple.com> 9185 9186 Reviewed by NOBODY (Build fix). 9187 9188 Windows build fix part2 9189 9190 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 9191 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 9192 91932009-09-19 Oliver Hunt <oliver@apple.com> 9194 9195 Reviewed by NOBODY (Buildfix). 9196 9197 Windows build fix part 1. 9198 9199 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 9200 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 9201 92022009-09-18 Oliver Hunt <oliver@apple.com> 9203 9204 Reviewed by Geoff Garen. 9205 9206 Implement ES5 Object.defineProperty function 9207 https://bugs.webkit.org/show_bug.cgi?id=29503 9208 9209 Implement Object.defineProperty. This requires adding the API to 9210 ObjectConstructor, along with a helper function that implements the 9211 ES5 internal [[ToPropertyDescriptor]] function. It then adds 9212 JSObject::defineOwnProperty that implements the appropriate ES5 semantics. 9213 Currently defineOwnProperty uses a delete followed by a put to redefine 9214 attributes of a property, clearly this is less efficient than it could be 9215 but we can improve this if it needs to be possible in future. 9216 9217 * JavaScriptCore.exp: 9218 * debugger/DebuggerActivation.cpp: 9219 (JSC::DebuggerActivation::defineGetter): 9220 (JSC::DebuggerActivation::defineSetter): 9221 * debugger/DebuggerActivation.h: 9222 * interpreter/Interpreter.cpp: 9223 (JSC::Interpreter::privateExecute): 9224 * jit/JITStubs.cpp: 9225 Update defineGetter/Setter calls 9226 * runtime/CommonIdentifiers.h: 9227 * runtime/JSArray.cpp: 9228 (JSC::JSArray::getOwnPropertySlot): 9229 * runtime/JSGlobalObject.cpp: 9230 (JSC::JSGlobalObject::defineGetter): 9231 (JSC::JSGlobalObject::defineSetter): 9232 * runtime/JSGlobalObject.h: 9233 * runtime/JSObject.cpp: 9234 (JSC::JSObject::defineGetter): 9235 (JSC::JSObject::defineSetter): 9236 (JSC::putDescriptor): 9237 (JSC::JSObject::defineOwnProperty): 9238 * runtime/JSObject.h: 9239 * runtime/ObjectConstructor.cpp: 9240 (JSC::ObjectConstructor::ObjectConstructor): 9241 (JSC::objectConstructorGetOwnPropertyDescriptor): 9242 (JSC::toPropertyDescriptor): 9243 (JSC::objectConstructorDefineProperty): 9244 * runtime/ObjectPrototype.cpp: 9245 (JSC::objectProtoFuncDefineGetter): 9246 (JSC::objectProtoFuncDefineSetter): 9247 * runtime/PropertyDescriptor.cpp: 9248 (JSC::PropertyDescriptor::writable): 9249 (JSC::PropertyDescriptor::enumerable): 9250 (JSC::PropertyDescriptor::configurable): 9251 (JSC::PropertyDescriptor::isDataDescriptor): 9252 (JSC::PropertyDescriptor::isGenericDescriptor): 9253 (JSC::PropertyDescriptor::isAccessorDescriptor): 9254 (JSC::PropertyDescriptor::getter): 9255 (JSC::PropertyDescriptor::setter): 9256 (JSC::PropertyDescriptor::setDescriptor): 9257 (JSC::PropertyDescriptor::setAccessorDescriptor): 9258 (JSC::PropertyDescriptor::setWritable): 9259 (JSC::PropertyDescriptor::setEnumerable): 9260 (JSC::PropertyDescriptor::setConfigurable): 9261 (JSC::PropertyDescriptor::setSetter): 9262 (JSC::PropertyDescriptor::setGetter): 9263 (JSC::PropertyDescriptor::equalTo): 9264 (JSC::PropertyDescriptor::attributesEqual): 9265 (JSC::PropertyDescriptor::attributesWithOverride): 9266 * runtime/PropertyDescriptor.h: 9267 (JSC::PropertyDescriptor::PropertyDescriptor): 9268 (JSC::PropertyDescriptor::value): 9269 (JSC::PropertyDescriptor::setValue): 9270 (JSC::PropertyDescriptor::isEmpty): 9271 (JSC::PropertyDescriptor::writablePresent): 9272 (JSC::PropertyDescriptor::enumerablePresent): 9273 (JSC::PropertyDescriptor::configurablePresent): 9274 (JSC::PropertyDescriptor::setterPresent): 9275 (JSC::PropertyDescriptor::getterPresent): 9276 (JSC::PropertyDescriptor::operator==): 9277 (JSC::PropertyDescriptor::): 9278 92792009-09-18 Gabor Loki <loki@inf.u-szeged.hu> 9280 9281 Reviewed by Gavin Barraclough. 9282 9283 Build fix to enable ARM_THUMB2 on Linux 9284 https://bugs.webkit.org/show_bug.cgi?id= 9285 9286 * jit/ExecutableAllocator.h: 9287 (JSC::ExecutableAllocator::cacheFlush): 9288 * jit/JITStubs.cpp: 9289 * wtf/Platform.h: 9290 92912009-09-18 Gabor Loki <loki@inf.u-szeged.hu> 9292 9293 Reviewed by Gavin Barraclough. 9294 9295 Defines two pseudo-platforms for ARM and Thumb-2 instruction set. 9296 https://bugs.webkit.org/show_bug.cgi?id=29122 9297 9298 Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2 9299 macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used 9300 when Thumb-2 instruction set is the required target. The 9301 PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In 9302 case where the code is common the PLATFORM(ARM) have to be used. 9303 9304 * assembler/ARMAssembler.cpp: 9305 * assembler/ARMAssembler.h: 9306 * assembler/ARMv7Assembler.h: 9307 * assembler/MacroAssembler.h: 9308 * assembler/MacroAssemblerARM.cpp: 9309 * assembler/MacroAssemblerARM.h: 9310 * assembler/MacroAssemblerCodeRef.h: 9311 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): 9312 * jit/ExecutableAllocator.h: 9313 * jit/JIT.h: 9314 * jit/JITInlineMethods.h: 9315 (JSC::JIT::beginUninterruptedSequence): 9316 (JSC::JIT::preserveReturnAddressAfterCall): 9317 (JSC::JIT::restoreReturnAddressBeforeReturn): 9318 (JSC::JIT::restoreArgumentReference): 9319 (JSC::JIT::restoreArgumentReferenceForTrampoline): 9320 * jit/JITOpcodes.cpp: 9321 * jit/JITStubs.cpp: 9322 (JSC::JITThunks::JITThunks): 9323 * jit/JITStubs.h: 9324 * wtf/Platform.h: 9325 * yarr/RegexJIT.cpp: 9326 (JSC::Yarr::RegexGenerator::generateEnter): 9327 93282009-09-18 Joerg Bornemann <joerg.bornemann@nokia.com> 9329 9330 Reviewed by Simon Hausmann. 9331 9332 Fix the Qt/Windows CE build. 9333 9334 * JavaScriptCore.pri: Build the ce_time.cpp functions from 9335 within Qt externally. 9336 * wtf/DateMath.cpp: Removed unnecessary Qt #ifdef, for the 9337 Qt build these functions are no external, too. 9338 93392009-09-17 Janne Koskinen <janne.p.koskinen@digia.com> 9340 9341 Reviewed by Simon Hausmann. 9342 9343 Symbian/WINSCW build fox. 9344 9345 Repeat Q_OS_WIN wchar_t hack for WINSCW, similar to 9346 revision 24774. 9347 9348 WINSCW defines wchar_t, thus UChar has to be wchar_t 9349 9350 * wtf/unicode/qt4/UnicodeQt4.h: 9351 93522009-09-17 Janne Koskinen <janne.p.koskinen@digia.com> 9353 9354 Reviewed by Simon Hausmann. 9355 9356 Symbian/WINSCW build fix. 9357 9358 https://bugs.webkit.org/show_bug.cgi?id=29186 9359 9360 WINSCW Template specialisation name in declaration must the be the same as in implementation. 9361 9362 * runtime/LiteralParser.h: 9363 93642009-09-15 Norbert Leser <norbert.leser@nokia.com> 9365 9366 Reviewed by Darin Adler. 9367 9368 https://bugs.webkit.org/show_bug.cgi?id=27060 9369 9370 Symbian compiler for emulator target (WINSCW) fails with 9371 "illegal operand" for m_attributesInPrevious in structure.ccp 9372 (when calling make_pair functions). 9373 This error is apparently due to the compiler not properly 9374 resolving the unsigned type of the declared bitfield. 9375 9376 Initial patch explicitly casted m_attributesInPrevious 9377 to unsigned, but since bitfield optimization is not critical for 9378 the emulator target, this conditional change in header file 9379 appears to be least intrusive. 9380 9381 * runtime/Structure.h: 9382 93832009-09-16 Gabor Loki <loki@inf.u-szeged.hu> 9384 9385 Reviewed by Darin Adler. 9386 9387 Fix GCC warnings on ARM_THUMB2 platform 9388 9389 * assembler/ARMv7Assembler.h: 9390 (JSC::ARMThumbImmediate::countLeadingZerosPartial): 9391 * assembler/MacroAssemblerARMv7.h: 9392 (JSC::MacroAssemblerARMv7::branchTruncateDoubleToInt32): 9393 (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding): 9394 93952009-09-16 Greg Bolsinga <bolsinga@apple.com> 9396 9397 Add ENABLE(INSPECTOR) 9398 https://bugs.webkit.org/show_bug.cgi?id=29260 9399 9400 Reviewed by David Kilzer. 9401 9402 * wtf/Platform.h: 9403 94042009-09-16 Greg Bolsinga <bolsinga@apple.com> 9405 9406 Add ENABLE(CONTEXT_MENUS) 9407 https://bugs.webkit.org/show_bug.cgi?id=29225 9408 9409 Reviewed by David Kilzer. 9410 9411 * wtf/Platform.h: 9412 94132009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 9414 9415 Reviewed by Eric Seidel. 9416 9417 The webkit stdint and stdbool headers exists because 9418 the compiler MSVC doesn't include them. The check 9419 should not check for PLATFORM(WIN_OS) but for MSVC. 9420 9421 * os-win32/stdbool.h: 9422 * os-win32/stdint.h: 9423 94242009-09-16 Greg Bolsinga <bolsinga@apple.com> 9425 9426 Add ENABLE(DRAG_SUPPORT) 9427 https://bugs.webkit.org/show_bug.cgi?id=29233 9428 9429 Reviewed by David Kilzer. 9430 9431 * wtf/Platform.h: 9432 94332009-09-16 Kevin Ollivier <kevino@theolliviers.com> 9434 9435 waf build fix after flag was moved to correct place. 9436 9437 * wscript: 9438 94392009-09-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 9440 9441 Reviewed by Simon Hausmann. 9442 9443 [Qt] Build fix for 64-bit Qt on Mac OS X 9444 9445 * wtf/Platform.h: Use JSVALUE64 on DARWIN, not only on MAC 9446 94472009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 9448 9449 Reviewed by Simon Hausmann. 9450 9451 [Qt] Fix wtf/ThreadSpecific.h under Qt to free thread local objects. 9452 https://bugs.webkit.org/show_bug.cgi?id=29295 9453 9454 This is an important fix when JavaScript workers are in use, since 9455 unfreed ThreadGlobalDatas leak a big amount of memory (50-100k each). 9456 QThreadStorage calls the destructor of a given object, which is the 9457 ThreadSpecific::Data. Unlike pthread, Qt is object oriented, and does 9458 not support the calling of a static utility function when the thread 9459 is about to close. In this patch we call the ThreadSpecific::destroy() 9460 utility function from the destructor of ThreadSpecific::Data. Moreover, 9461 since Qt resets all thread local values to 0 before the calling of the 9462 appropriate destructors, we set back the pointer to its original value. 9463 This is necessary because the get() method of the ThreadSpecific 9464 object may be called during the exuction of the destructor. 9465 9466 * wtf/ThreadSpecific.h: 9467 (WTF::ThreadSpecific::Data::~Data): 9468 (WTF::::~ThreadSpecific): 9469 (WTF::::set): 9470 (WTF::::destroy): 9471 94722009-09-10 Oliver Hunt <oliver@apple.com> 9473 9474 Reviewed by Geoff Garen. 9475 9476 Allow anonymous storage inside JSObject 9477 https://bugs.webkit.org/show_bug.cgi?id=29168 9478 9479 Add the concept of anonymous slots to Structures so that it is 9480 possible to store references to values that need marking in the 9481 standard JSObject storage buffer. This allows us to reduce the 9482 malloc overhead of some objects (by allowing them to store JS 9483 values in the inline storage of the object) and reduce the 9484 dependence of custom mark functions (if all an objects children 9485 are in the standard object property storage there's no need to 9486 mark them manually). 9487 9488 * JavaScriptCore.exp: 9489 * runtime/JSObject.h: 9490 (JSC::JSObject::putAnonymousValue): 9491 (JSC::JSObject::getAnonymousValue): 9492 (JSC::JSObject::addAnonymousSlots): 9493 * runtime/JSWrapperObject.h: 9494 (JSC::JSWrapperObject::createStructure): 9495 (JSC::JSWrapperObject::JSWrapperObject): 9496 (JSC::JSWrapperObject::setInternalValue): 9497 * runtime/PropertyMapHashTable.h: 9498 * runtime/Structure.cpp: 9499 (JSC::Structure::~Structure): 9500 (JSC::Structure::materializePropertyMap): 9501 (JSC::Structure::addAnonymousSlotsTransition): 9502 (JSC::Structure::copyPropertyTable): 9503 (JSC::Structure::put): 9504 (JSC::Structure::rehashPropertyMapHashTable): 9505 * runtime/Structure.h: 9506 (JSC::Structure::propertyStorageSize): 9507 (JSC::StructureTransitionTable::reifySingleTransition): 9508 * runtime/StructureTransitionTable.h: 9509 (JSC::StructureTransitionTable::TransitionTable::addSlotTransition): 9510 (JSC::StructureTransitionTable::TransitionTable::removeSlotTransition): 9511 (JSC::StructureTransitionTable::TransitionTable::getSlotTransition): 9512 (JSC::StructureTransitionTable::getAnonymousSlotTransition): 9513 (JSC::StructureTransitionTable::addAnonymousSlotTransition): 9514 (JSC::StructureTransitionTable::removeAnonymousSlotTransition): 9515 95162009-09-15 Alex Milowski <alex@milowski.com> 9517 9518 Reviewed by Tor Arne Vestbø. 9519 9520 Added the ENABLE_MATHML define to the features 9521 9522 * Configurations/FeatureDefines.xcconfig: 9523 95242009-09-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 9525 9526 Reviewed by Tor Arne Vestbø. 9527 9528 [Qt] Build fix for windows. 9529 9530 After http://trac.webkit.org/changeset/47795 the MinGW build broke, 9531 because MinGW has __mingw_aligned_malloc instead of _aligned_malloc. 9532 9533 * runtime/Collector.cpp: 9534 (JSC::Heap::allocateBlock): MinGW case added. 9535 (JSC::Heap::freeBlock): MinGW case added. 9536 95372009-09-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 9538 9539 Reviewed by Tor Arne Vestbø. 9540 9541 [Qt] Build fix for Windows/MinGW 9542 9543 https://bugs.webkit.org/show_bug.cgi?id=29268 9544 9545 * wtf/Platform.h: JSVALUE32_64 temporarily disabled on PLATFORM(WIN_OS) with COMPILER(MINGW) 9546 95472009-09-14 Gabor Loki <loki@inf.u-szeged.hu> 9548 9549 Reviewed by Gavin Barraclough. 9550 9551 Detect VFP at runtime in generic ARM port on Linux platform. 9552 https://bugs.webkit.org/show_bug.cgi?id=29076 9553 9554 * JavaScriptCore.pri: 9555 * assembler/MacroAssemblerARM.cpp: Added. 9556 (JSC::isVFPPresent): 9557 * assembler/MacroAssemblerARM.h: 9558 (JSC::MacroAssemblerARM::supportsFloatingPoint): 9559 95602009-09-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 9561 9562 Reviewed by Tor Arne Vestbø. 9563 9564 [Qt] Build fix for windows build. 9565 9566 * JavaScriptCore.pri: Correct a logic error. 9567 * pcre/dftables: Add missing paranthesis for tmpdir function. 9568 95692009-09-12 Oliver Hunt <oliver@apple.com> 9570 9571 Reviewed by NOBODY (Build fix). 9572 9573 Build fix for windows exports (again). 9574 9575 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 9576 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 9577 95782009-09-12 Oliver Hunt <oliver@apple.com> 9579 9580 Reviewed by NOBODY (Build fix). 9581 9582 Build fix for windows exports. 9583 9584 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 9585 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 9586 95872009-09-12 Oliver Hunt <oliver@apple.com> 9588 9589 Reviewed by NOBODY (Build fix). 9590 9591 Correct fix for non-allinonefile builds 9592 9593 * runtime/ObjectConstructor.cpp: 9594 95952009-09-12 Oliver Hunt <oliver@apple.com> 9596 9597 Reviewed by NOBODY (Build fix). 9598 9599 Fix non-allinonefile builds 9600 9601 * runtime/ObjectConstructor.cpp: 9602 96032009-09-12 Oliver Hunt <oliver@apple.com> 9604 9605 Reviewed by Maciej Stachowiak. 9606 9607 [ES5] Implement Object.keys 9608 https://bugs.webkit.org/show_bug.cgi?id=29170 9609 9610 This patch basically requires two separate steps, the first is to split getPropertyNames 9611 into two functions -- getOwnPropertyNames and getPropertyNames, basically making them behave 9612 in the same way as getOwnPropertySlot and getPropertySlot. In essence getOwnPropertyNames 9613 produces the list of properties on an object excluding its prototype chain and getPropertyNames 9614 just iterates the the object and its prototype chain calling getOwnPropertyNames at each level. 9615 9616 * API/JSCallbackObject.h: 9617 * API/JSCallbackObjectFunctions.h: 9618 (JSC::::getOwnPropertyNames): 9619 * JavaScriptCore.exp: 9620 * debugger/DebuggerActivation.cpp: 9621 (JSC::DebuggerActivation::getOwnPropertyNames): 9622 * debugger/DebuggerActivation.h: 9623 * runtime/CommonIdentifiers.h: 9624 * runtime/JSArray.cpp: 9625 (JSC::JSArray::getOwnPropertyNames): 9626 * runtime/JSArray.h: 9627 * runtime/JSByteArray.cpp: 9628 (JSC::JSByteArray::getOwnPropertyNames): 9629 * runtime/JSByteArray.h: 9630 * runtime/JSNotAnObject.cpp: 9631 (JSC::JSNotAnObject::getOwnPropertyNames): 9632 * runtime/JSNotAnObject.h: 9633 * runtime/JSObject.cpp: 9634 (JSC::JSObject::getOwnPropertyNames): 9635 * runtime/JSObject.h: 9636 * runtime/JSVariableObject.cpp: 9637 (JSC::JSVariableObject::getOwnPropertyNames): 9638 * runtime/JSVariableObject.h: 9639 * runtime/ObjectConstructor.cpp: 9640 (JSC::ObjectConstructor::ObjectConstructor): 9641 (JSC::objectConstructorKeys): 9642 * runtime/RegExpMatchesArray.h: 9643 (JSC::RegExpMatchesArray::getOwnPropertyNames): 9644 * runtime/StringObject.cpp: 9645 (JSC::StringObject::getOwnPropertyNames): 9646 * runtime/StringObject.h: 9647 * runtime/Structure.cpp: 9648 (JSC::Structure::getOwnEnumerablePropertyNames): 9649 (JSC::Structure::getEnumerablePropertyNames): 9650 * runtime/Structure.h: 9651 96522009-09-11 Oliver Hunt <oliver@apple.com> 9653 9654 Reviewed by Sam Weinig. 9655 9656 getPropertyNames caching is invalid when the prototype chain contains objects with custom getPropertyNames 9657 https://bugs.webkit.org/show_bug.cgi?id=29214 9658 9659 Add a flag to TypeInfo to indicate whether a type overrides getPropertyNames. 9660 This flag is used to make sure that caching of the property name data is safe. 9661 9662 * API/JSCallbackConstructor.h: 9663 (JSC::JSCallbackConstructor::createStructure): 9664 * debugger/DebuggerActivation.h: 9665 (JSC::DebuggerActivation::createStructure): 9666 * runtime/BooleanObject.h: 9667 (JSC::BooleanObject::createStructure): 9668 * runtime/DatePrototype.h: 9669 (JSC::DatePrototype::createStructure): 9670 * runtime/FunctionPrototype.h: 9671 (JSC::FunctionPrototype::createStructure): 9672 * runtime/JSONObject.h: 9673 (JSC::JSONObject::createStructure): 9674 * runtime/JSObject.h: 9675 (JSC::JSObject::createStructure): 9676 * runtime/JSTypeInfo.h: 9677 (JSC::TypeInfo::hasDefaultGetPropertyNames): 9678 * runtime/JSVariableObject.h: 9679 (JSC::JSVariableObject::createStructure): 9680 * runtime/JSWrapperObject.h: 9681 (JSC::JSWrapperObject::createStructure): 9682 * runtime/MathObject.h: 9683 (JSC::MathObject::createStructure): 9684 * runtime/NumberConstructor.h: 9685 (JSC::NumberConstructor::createStructure): 9686 * runtime/NumberObject.h: 9687 (JSC::NumberObject::createStructure): 9688 * runtime/RegExpConstructor.h: 9689 (JSC::RegExpConstructor::createStructure): 9690 * runtime/RegExpObject.h: 9691 (JSC::RegExpObject::createStructure): 9692 * runtime/StructureChain.cpp: 9693 (JSC::StructureChain::isCacheable): 9694 96952009-09-11 Alexey Proskuryakov <ap@webkit.org> 9696 9697 Reviewed by Geoff Garen. 9698 9699 https://bugs.webkit.org/show_bug.cgi?id=29207 9700 Add checks for using WebCore JS context on secondary threads 9701 9702 * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): 9703 * runtime/JSGlobalData.h: 9704 Added a new mainThreadOnly flag that WebCore would set. 9705 9706 * runtime/Collector.cpp: (JSC::Heap::registerThread): JSC API methods always call this, 9707 so this is a good place to check that the API isn't used form a wrong thread. 9708 97092009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 9710 9711 Reviewed by Simon Hausmann. 9712 9713 Compiling JavaScriptCore on sparc 64 with gcc fails. 9714 9715 ThreadSafeShared uses the atomic __gnu_cxx::__exchange_and_add with an int, 9716 however on sparc 64 the _Atomic_word argument is typedefed to long (8 bytes). 9717 9718 The patch disables WTF_USE_LOCKFREE_THREADSAFESHARED in ThreadSafeShared to use 9719 a mutex instead when compiling for sparc 64 with gcc. 9720 9721 https://bugs.webkit.org/show_bug.cgi?id=29175 9722 9723 * wtf/Platform.h: 9724 __sparc64__ is not defined on all OS. 9725 Uses instead: __sparc__ && __arch64__ || __sparcv9 9726 * wtf/Threading.h: 9727 97282009-09-11 Prasanth Ullattil <prasanth.ullattil@nokia.com> 9729 9730 Reviewed by Simon Hausmann. 9731 9732 Fix compile error on Windows7(64Bit) with latest SDK. 9733 9734 Added the missing include file. 9735 9736 * runtime/UString.cpp: 9737 97382009-09-11 Joerg Bornemann <joerg.bornemann@trolltech.com> 9739 9740 Reviewed by Simon Hausmann. 9741 9742 Qt/Windows CE compile fix, include the executable allocator and 9743 markstack implementation in the windows build. 9744 9745 * JavaScriptCore.pri: 9746 97472009-09-08 John Abd-El-Malek <jam@chromium.org> 9748 9749 Reviewed by Dimitri Glazkov. 9750 9751 Remove unneeded define for ActiveX. 9752 https://bugs.webkit.org/show_bug.cgi?id=29054 9753 9754 * wtf/Platform.h: 9755 97562009-09-10 Mark Rowe <mrowe@apple.com> 9757 9758 Rubber-stamped by Sam Weinig. 9759 9760 Update JavaScriptCore and WebKit's FeatureDefines.xcconfig so that they are in sync with WebCore as they need to be. 9761 9762 * Configurations/FeatureDefines.xcconfig: 9763 97642009-09-10 Fumitoshi Ukai <ukai@chromium.org> 9765 9766 Reviewed by Alexey Proskuryakov. 9767 9768 Export WTF::tryFastMalloc used in WebSocketChannel. 9769 https://bugs.webkit.org/show_bug.cgi?id=28038 9770 9771 * JavaScriptCore.exp: 9772 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 9773 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 9774 97752009-09-10 Oliver Hunt <oliver@apple.com> 9776 9777 Reviewed by NOBODY (Build fix). 9778 9779 Make StructureTransitionTable use an enum for the PtrAndFlags member 9780 used for the single transition slot optimisation. 9781 9782 * runtime/StructureTransitionTable.h: 9783 (JSC::StructureTransitionTable::StructureTransitionTable): 9784 (JSC::StructureTransitionTable::usingSingleTransitionSlot): 9785 (JSC::StructureTransitionTable::): 9786 97872009-09-10 Oliver Hunt <oliver@apple.com> 9788 9789 Reviewed by Geoff Garen. 9790 9791 Refactor StructureTransitionTable and Structure to unify handling of the single slot optimization 9792 https://bugs.webkit.org/show_bug.cgi?id=29141 9793 9794 Make StructureTransitionTable encapsulate the single transition slot optimization. 9795 9796 * runtime/Structure.cpp: 9797 (JSC::Structure::Structure): 9798 (JSC::Structure::~Structure): 9799 (JSC::Structure::addPropertyTransitionToExistingStructure): 9800 (JSC::Structure::addPropertyTransition): 9801 (JSC::Structure::addPropertyWithoutTransition): 9802 (JSC::Structure::removePropertyWithoutTransition): 9803 (JSC::Structure::hasTransition): 9804 * runtime/Structure.h: 9805 (JSC::StructureTransitionTable::contains): 9806 (JSC::StructureTransitionTable::get): 9807 (JSC::StructureTransitionTable::hasTransition): 9808 (JSC::StructureTransitionTable::reifySingleTransition): 9809 * runtime/StructureTransitionTable.h: 9810 (JSC::StructureTransitionTable::StructureTransitionTable): 9811 (JSC::StructureTransitionTable::~StructureTransitionTable): 9812 (JSC::StructureTransitionTable::remove): 9813 (JSC::StructureTransitionTable::add): 9814 (JSC::StructureTransitionTable::table): 9815 (JSC::StructureTransitionTable::singleTransition): 9816 (JSC::StructureTransitionTable::usingSingleTransitionSlot): 9817 (JSC::StructureTransitionTable::setSingleTransition): 9818 (JSC::StructureTransitionTable::setTransitionTable): 9819 (JSC::StructureTransitionTable::): 9820 * wtf/PtrAndFlags.h: 9821 (WTF::PtrAndFlags::PtrAndFlags): 9822 98232009-09-10 Zoltan Horvath <zoltan@webkit.org> 9824 9825 Reviewed by Darin Adler. 9826 9827 Implement fastDeleteSkippingDestructor for FastAllocBase and fastDeleteAllValues for HashSet 9828 https://bugs.webkit.org/show_bug.cgi?id=25930 9829 9830 FastAllocBase has been extended with fastDeleteSkippingDestructor function which 9831 releases memory without destructor call. fastDeleteAllValues has been implemented 9832 similar as deleteAllValues but it uses fastDelete function to release memory. 9833 9834 * wtf/FastAllocBase.h: 9835 (WTF::fastDeleteSkippingDestructor): 9836 * wtf/HashSet.h: 9837 (WTF::fastDeleteAllValues): 9838 98392009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> 9840 9841 Reviewed by Darin Adler. 9842 9843 ARM compiler does not understand GCC visibility attribute 9844 https://bugs.webkit.org/show_bug.cgi?id=29079 9845 9846 * API/JSBase.h: Make the test more specific to hit only 9847 the GCC compiler 9848 98492009-09-10 Adam Barth <abarth@webkit.org> 9850 9851 Unreviewed revert of the previous change. It broke the tests. 9852 9853 * wtf/dtoa.cpp: 9854 (WTF::dtoa): 9855 98562009-09-10 Ben Laurie <benl@google.com> 9857 9858 Reviewed by Adam Barth. 9859 9860 <https://bugs.webkit.org/show_bug.cgi?id=26836> 9861 9862 If dtoa was given a small buffer and the number was either infinite or 9863 NaN, then the buffer would be overflowed. 9864 9865 * wtf/dtoa.cpp: 9866 98672009-09-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 9868 9869 Reviewed by Darin Adler. 9870 9871 Change reinterpret_cast to static_cast in r48212. 9872 9873 * jit/ExecutableAllocator.h: 9874 (JSC::ExecutableAllocator::cacheFlush): 9875 98762009-09-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 9877 9878 Reviewed by Darin Adler. 9879 9880 Remove WTF_PLATFORM_FORCE_PACK as it is no longer used 9881 https://bugs.webkit.org/show_bug.cgi?id=29066 9882 9883 * wtf/Platform.h: 9884 98852009-09-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 9886 9887 Reviewed by Ariya Hidayat. 9888 9889 Implement flushing the instruction cache for Symbian 9890 https://bugs.webkit.org/show_bug.cgi?id=29075 9891 9892 * jit/ExecutableAllocator.h: 9893 (JSC::ExecutableAllocator::cacheFlush): Call IMB_Range to flush 9894 the instruction cache on Symbian 9895 98962009-09-09 Kent Hansen <khansen@trolltech.com> 9897 9898 Reviewed by Darin Adler. 9899 9900 https://bugs.webkit.org/show_bug.cgi?id=29024 9901 Make JavaScriptCore compile on platforms with case-insensitive file systems and typeinfo.h in STL 9902 9903 These platforms include Microsoft Visual Studio 2003, and Symbian with Metrowerks compiler. 9904 9905 * JavaScriptCore.gypi: 9906 * JavaScriptCore.xcodeproj/project.pbxproj: 9907 * runtime/JSTypeInfo.h: Copied from JavaScriptCore/runtime/TypeInfo.h. 9908 * runtime/Structure.h: 9909 * runtime/TypeInfo.h: Removed. 9910 99112009-09-08 Oliver Hunt <oliver@apple.com> 9912 9913 Reviewed by Maciej Stachowiak. 9914 9915 JSON.stringify(Date) loses the milliseconds information 9916 https://bugs.webkit.org/show_bug.cgi?id=29063 9917 9918 Make sure we include milliseconds in the output of toISOString. 9919 9920 * runtime/DatePrototype.cpp: 9921 (JSC::dateProtoFuncToISOString): 9922 99232009-09-08 Kevin Ollivier <kevino@theolliviers.com> 9924 9925 wx build fix, generate derived sources earlier in order to make sure 9926 they're found by the build system when generating the list of sources to build. 9927 9928 * wscript: 9929 99302009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> 9931 9932 Reviewed by Simon Hausmann. 9933 9934 Build fix when USE(LOCKFREE_THREADSAFESHARED) is not defined 9935 https://bugs.webkit.org/show_bug.cgi?id=29011 9936 9937 * wtf/Threading.h: Use LOCKFREE_THREADSAFESHARED guard for 9938 atomicIncrement and atomicDecrement 9939 99402009-09-07 Zoltan Horvath <zoltan@webkit.org> 9941 9942 Reviewed by Darin Adler. 9943 9944 Allow custom memory allocation control in Yarr's RegexInterpreter 9945 https://bugs.webkit.org/show_bug.cgi?id=29025 9946 9947 Inherits RegexInterpreter classes from FastAllocBase (bug #20422), which has 9948 been instantiated by 'new': 9949 9950 class ByteDisjunction 9951 -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1462 9952 9953 struct BytecodePattern 9954 -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1279 9955 9956 * yarr/RegexInterpreter.h: 9957 99582009-09-07 Drew Wilson <atwilson@google.com> 9959 9960 Reverting r48121 to fix Windows build errors. 9961 9962 * JavaScriptCore.exp: 9963 99642009-09-07 Drew Wilson <atwilson@google.com> 9965 9966 Reviewed by David Levin. 9967 9968 Enable SHARED_WORKERS by default 9969 https://bugs.webkit.org/show_bug.cgi?id=28959 9970 9971 * Configurations/FeatureDefines.xcconfig: 9972 99732009-09-07 Fumitoshi Ukai <ukai@chromium.org> 9974 9975 Reviewed by Alexey Proskuryakov. 9976 9977 Export WTF::tryFastMalloc used in WebSocketChannel. 9978 https://bugs.webkit.org/show_bug.cgi?id=28038 9979 9980 * JavaScriptCore.exp: 9981 99822009-09-04 Oliver Hunt <oliver@apple.com> 9983 9984 Reviewed by NOBODY (Build fix). 9985 9986 Fix windows export files 9987 9988 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 9989 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 9990 99912009-09-04 Oliver Hunt <oliver@apple.com> 9992 9993 Reviewed by Gavin Barraclough. 9994 9995 [[ToString]] conversion should use the actual toString function for String objects. 9996 9997 Remove incorrect specialisations of toString conversions on StringObject. 9998 9999 * JavaScriptCore.exp: 10000 * runtime/StringObject.cpp: 10001 * runtime/StringObject.h: 10002 100032009-09-04 Steve Falkenburg <sfalken@apple.com> 10004 10005 Windows build fix. 10006 10007 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Add new export. 10008 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Add new export. 10009 100102009-09-04 Steve Falkenburg <sfalken@apple.com> 10011 10012 Windows build fix. 10013 10014 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove unneeded export. 10015 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Remove unneeded export. 10016 100172009-09-04 Darin Adler <darin@apple.com> 10018 10019 Reviewed by Geoff Garen. 10020 10021 DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32) 10022 https://bugs.webkit.org/show_bug.cgi?id=28909 10023 10024 Part two. 10025 10026 Make some improvements to garbage collection code: 10027 10028 1) Create a runtime assertion that catches any classes that 10029 override markChildren but have the HasDefaultMark bit set. 10030 2) Remove checks of the mark bit outside the MarkStack::append 10031 function; they are redundant. 10032 3) Improve the efficiency of the asObject and asArray functions 10033 when called on JSCell* to avoid a round trip to JSValue. 10034 4) Make more callers use the checked asCell and asObject 10035 casting functions rather than unchecked casts. 10036 5) Removed the JSCell::marked function and other GC-related 10037 functions because these operations are no longer things that 10038 code other than the core GC code needs to do directly. Fixed 10039 callers that were calling them. 10040 10041 * runtime/Collector.cpp: 10042 (JSC::Heap::markConservatively): Removed unneeded call to MarkStack::drain. 10043 (JSC::Heap::markProtectedObjects): Removed unneeded check of the mark 10044 bit and call to MarkStack::drain. 10045 (JSC::Heap::collect): Removed unneeded checks of the mark bit and also 10046 changed call to SmallStrings::mark to call markChildren instead to match 10047 the rest of the objects. 10048 (JSC::typeName): Removed unneeded cast to JSObject*. 10049 10050 * runtime/JSArray.h: 10051 (JSC::asArray): Added an overload for JSCell* and changed the JSValue 10052 version to call it. Removed some unneeded casts. 10053 (JSC::JSArray::markChildrenDirect): Marked this function inline. It's in 10054 a header, and if not marked inline this could lead to linking problems. 10055 (JSC::MarkStack::markChildren): Added. This helper function is used by 10056 the drain function to avoid repating code. Also added the code here to 10057 check fro default mark violations in debug code. If a markChildren 10058 function adds something to the mark stack, but the type info claimed 10059 hasDefaultMark was true, then we will get an assertion now. Also fixed 10060 the assertion about the mark bit to use the Heap function directly 10061 because we don't have a JSCell::marked function any more. 10062 (JSC::MarkStack::drain): Changed a local variable from "v" to "value", 10063 and from "currentCell" to "cell". Changed to call markChildren in two 10064 places instead of repeating a chain of if statements twice. Changed 10065 code that reads and writes the mark bit to use Heap::isCellMarked and 10066 Heap::markCell so we can eliminate the JSCell::marked and 10067 JSCell::markCellDirect functions. 10068 10069 * runtime/JSCell.h: Removed JSCell's markCellDirect and marked member 10070 functions. Added a comment explaining that asCell should be deprecated 10071 in favor of the JSValue asCell member function. 10072 (JSC::MarkStack::append): Added the assertion that catches callers 10073 that have set the HasDefaultMark bit incorrectly. Changed 10074 code that reads and writes the mark bit to use Heap::isCellMarked and 10075 Heap::markCell so we can eliminate the JSCell::marked and 10076 JSCell::markCellDirect functions. Moved the overload of 10077 MarkStack::append for JSValue here so it can call through to the cell 10078 version. The old version had a copy of all the code instead, but that 10079 repeated the conversion from JSValue to JSCell* and the check for 10080 whether a value is a cell multiple times. 10081 (JSC::Structure::markAggregate): Moved this function here to avoid 10082 dependencies for Structure.h, since this calls MarkStack::append. 10083 10084 * runtime/JSObject.cpp: 10085 (JSC::JSObject::markChildren): Added code to clear 10086 m_isCheckingForDefaultMarkViolation so the marking done by JSObject 10087 doesn't trigger the assertion. 10088 10089 * runtime/JSValue.h: Moved some stray includes that were outside the 10090 header guard inside it. Not sure how that happened! Removed the 10091 GC-related member functions markChildren, hasChildren, marked, and 10092 markDirect. 10093 10094 * runtime/JSWrapperObject.h: Made markChildren private. 10095 (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the 10096 HasDefaultMark bit was set. 10097 10098 * runtime/MarkStack.h: Added m_isCheckingForDefaultMarkViolation and 10099 initialized it to false. Moved the append function body from here to 10100 JSCell.h. Added a declaration of a private markChildren function used 10101 inside the drain function. 10102 10103 * runtime/SmallStrings.cpp: 10104 (JSC::SmallStrings::markChildren): Changed the name and style of this 10105 function to match other functions. This allows us to share the normal 10106 mark stack code path. 10107 10108 * runtime/SmallStrings.h: Changed the name and interface of mark to 10109 the more-normal markChildren style. 10110 10111 * runtime/Structure.h: Moved the body of markAggregate into the 10112 JSCell.h to avoid a circular dependency with JSCell.h. 10113 101142009-09-04 Darin Adler <darin@apple.com> 10115 10116 Reviewed by Geoff Garen. 10117 10118 DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32) 10119 https://bugs.webkit.org/show_bug.cgi?id=28909 10120 10121 Part one. 10122 10123 Make some improvements to garbage collection code: 10124 10125 1) Fix the two classes that had the default mark bit set but 10126 should not. 10127 2) Remove checks of the mark bit outside the MarkStack::append 10128 function; they are redundant. 10129 3) Make more callers use the checked asCell and asObject 10130 casting functions rather than unchecked casts. 10131 4) Removed some GC-related functions because these operations are 10132 no longer things that code other than the core GC code needs 10133 to do directly. Fixed callers that were calling them. 10134 10135 * bytecode/CodeBlock.cpp: 10136 (JSC::CodeBlock::markAggregate): Removed unneeded check of the mark 10137 bit before calling MarkStack::append. 10138 10139 * interpreter/Register.h: Removed unneeded marked and markChildren 10140 functions. 10141 10142 * jit/JITStubs.cpp: 10143 (op_eq): Removed unneeded assertions, instead using checked casting 10144 functions such as asObject. 10145 10146 * runtime/ArgList.h: Added now-needed forward declaration of MarkStack. 10147 10148 * runtime/GetterSetter.cpp: 10149 (JSC::GetterSetter::markChildren): Remmoved unneeded check of the mark bit. 10150 10151 * runtime/GlobalEvalFunction.h: 10152 (JSC::GlobalEvalFunction::createStructure): Added. Fixes a bug where the 10153 HasDefaultMark bit was set. 10154 10155 * runtime/JSCell.cpp: 10156 (JSC::JSCell::getObject): Use asObject to avoid a direct static_cast. 10157 10158 * runtime/JSObject.h: 10159 (JSC::asObject): Added an overload for JSCell* and changed the JSValue 10160 version to call it. 10161 (JSC::JSValue::get): Use asObject to avoid a direct static_cast. 10162 10163 * runtime/JSWrapperObject.h: Made markChildren private. 10164 (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the 10165 HasDefaultMark bit was set. Later we may want to optimize this for 10166 wrapper types that never have cells in their internal values, but there 10167 is no measured performance regression in SunSpider or V8 doing this 10168 all the time. 10169 10170 * runtime/MarkStack.cpp: Tweaked formatting. 10171 101722009-09-04 Kevin Ollivier <kevino@theolliviers.com> 10173 10174 wx build fix. Switch USE_ defines over to the compiler so that they can be 10175 checked by files not including config.h (like WebCorePrefix.h). 10176 10177 * wtf/Platform.h: 10178 101792009-09-03 Yong Li <yong.li@torchmobile.com> 10180 10181 Reviewed by David Levin. 10182 10183 Remove unnecessary dependency on unistd.h 10184 https://bugs.webkit.org/show_bug.cgi?id=28962 10185 10186 * runtime/Completion.cpp: 10187 101882009-09-03 Fumitoshi Ukai <ukai@chromium.org> 10189 10190 Reviewed by Eric Seidel. 10191 10192 Add strnstr for Linux and Windows in StringExtras.h 10193 https://bugs.webkit.org/show_bug.cgi?id=28901 10194 10195 * wtf/StringExtras.h: 10196 (strnstr): 10197 101982009-09-03 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 10199 10200 Reviewed by Darin Adler. 10201 10202 Allow custom memory allocation control for JavaScriptCore's HashEntry class 10203 https://bugs.webkit.org/show_bug.cgi?id=27830 10204 10205 Inherits HashEntry class from FastAllocBase because it has been 10206 instantiated by 'new' JavaScriptCore/runtime/Lookup.cpp:32. 10207 10208 * runtime/Lookup.h: 10209 102102009-09-02 Gavin Barraclough <barraclough@apple.com> 10211 10212 Should crash if JIT code buffer allocation fails. 10213 10214 https://bugs.webkit.org/show_bug.cgi?id=28926 10215 <rdar://problem/7031922> 10216 10217 * jit/ExecutableAllocatorPosix.cpp: 10218 (JSC::ExecutablePool::systemAlloc): 10219 * jit/ExecutableAllocatorWin.cpp: 10220 (JSC::ExecutablePool::systemAlloc): 10221 102222009-09-02 Kevin Ollivier <kevino@theolliviers.com> 10223 10224 waf build fixes for Windows/MSVC. 10225 10226 * wscript: 10227 102282009-09-02 Kevin Ollivier <kevino@theolliviers.com> 10229 10230 Build fix for building on Windows. 10231 10232 * wtf/ThreadingPthreads.cpp: 10233 102342009-09-02 Norbert Leser <norbert.leser@nokia.com> 10235 10236 Reviewed by Eric Seidel. 10237 10238 Use fastMalloc when neither MMAP nor VIRTUALALLOC are enabled 10239 10240 RegisterFile constructor currently throws #error when both 10241 MMAP and VIRTUALALLOC conditions fail. 10242 On any platform that does not provide these features 10243 (for instance, Symbian), 10244 the fallback should be regular malloc (or fastMalloc). 10245 It is functionally equivalent in this case, even though it may 10246 have certain drawbacks such as lack of dynamic pre-allocation. 10247 10248 * interpreter/RegisterFile.cpp: 10249 (JSC::RegisterFile::~RegisterFile): 10250 * interpreter/RegisterFile.h: 10251 (JSC::RegisterFile::RegisterFile): 10252 102532009-08-31 Robert Agoston <Agoston.Robert@stud.u-szeged.hu> 10254 10255 Reviewed by Gavin Barraclough. 10256 10257 Fixed typo. 10258 https://bugs.webkit.org/show_bug.cgi?id=28691 10259 10260 * parser/Parser.h: 10261 (JSC::Parser::parse): 10262 102632009-08-27 Oliver Hunt <oliver@apple.com> 10264 10265 Reviewed by Maciej Stachowiak. 10266 10267 JSON Stringifier does not follow ES5 spec for handling of Number, String and Boolean objects 10268 https://bugs.webkit.org/show_bug.cgi?id=28797 10269 10270 Fixed unwrapBoxedPrimitive to do the right thing, which necessitated a couple of new exception 10271 checks, and corrected the logic in gap to correctly convert Number and String objects. 10272 10273 * runtime/JSONObject.cpp: 10274 (JSC::unwrapBoxedPrimitive): 10275 (JSC::gap): 10276 (JSC::Stringifier::Stringifier): 10277 (JSC::Stringifier::appendStringifiedValue): 10278 102792009-08-27 Oliver Hunt <oliver@apple.com> 10280 10281 Reviewed by Adam Roben. 10282 10283 JSON.stringify replacer array does not accept values that are not string primitives. 10284 https://bugs.webkit.org/show_bug.cgi?id=28788 10285 10286 Update the JSON stringifier to initialise its replacer array according to the most 10287 recent version of the spec. 10288 10289 * runtime/Identifier.h: 10290 (JSC::Identifier::from): 10291 * runtime/JSONObject.cpp: 10292 (JSC::Stringifier::Stringifier): 10293 102942009-08-27 Alexey Proskuryakov <ap@apple.com> 10295 10296 Reviewed by Oliver Hunt. 10297 10298 https://bugs.webkit.org/show_bug.cgi?id=28753 10299 <rdar://problem/7173448> Excessive number of threads (and a crash) 10300 10301 * wtf/Threading.h: (WTF::atomicIncrement): Changed atomicIncrement to match decrement 10302 and return the new value. Also added using directives for these functions, to match 10303 te rest of WTF. 10304 103052009-08-27 Brent Fulgham <bfulgham@webkit.org> 10306 10307 Reviewed by Adam Roben. 10308 10309 Link the testapi against CFLite when building the WinCairo port. 10310 10311 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add new Release_CFLite 10312 target. Update all targets to inherit from either the 10313 JavaScriptCF.vsprops (Apple target) or the JavaScriptCFLite.vsprops 10314 file (WinCairo target). 10315 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Remove 10316 input file CoreFoundation.lib. This is provided by either the 10317 JavaScriptCF.vsprops or JavaScriptCFLite.vsprops file. 10318 103192009-08-27 Steve Falkenburg <sfalken@apple.com> 10320 10321 Reviewed by Geoff Garen. 10322 10323 Fix Windows-specific crash due to missing memory clearing call. 10324 10325 * runtime/Collector.cpp: 10326 (JSC::Heap::allocateBlock): 10327 103282009-08-27 Brent Fulgham <bfulgham@webkit.org> 10329 10330 Build fix: JavaScriptCore_debug.def missing some exports. Apple 10331 Windows build does not use this file, so it was not noticed previously. 10332 10333 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 10334 103352009-08-27 Gavin Barraclough <barraclough@apple.com> 10336 10337 Reviewed by Oliver Hunt. 10338 10339 x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates. 10340 https://bugs.webkit.org/show_bug.cgi?id=28317 10341 10342 Missed one, fix part II. 10343 10344 * assembler/MacroAssemblerX86Common.h: 10345 (JSC::MacroAssemblerX86Common::move): 10346 * assembler/X86Assembler.h: 10347 (JSC::CAN_SIGN_EXTEND_8_32): 10348 103492009-08-27 Oliver Hunt <oliver@apple.com> 10350 10351 Reviewed by Adam Roben. 10352 10353 JSON.stringify replacer array does not accept values that are not string primitives. 10354 https://bugs.webkit.org/show_bug.cgi?id=28788 10355 10356 Update the JSON stringifier to initialise its replacer array according to the most 10357 recent version of the spec. 10358 10359 * runtime/Identifier.h: 10360 (JSC::Identifier::from): 10361 * runtime/JSONObject.cpp: 10362 (JSC::Stringifier::Stringifier): 10363 103642009-08-27 Oliver Hunt <oliver@apple.com> 10365 10366 Reviewed by Alexey Proskuryakov. 10367 10368 JSON parser accepts trailing comma in array literals 10369 https://bugs.webkit.org/show_bug.cgi?id=28779 10370 10371 Update parser to correctly fail if there's a trailing comma. 10372 10373 * runtime/LiteralParser.cpp: 10374 (JSC::LiteralParser::parse): 10375 103762009-08-26 Oliver Hunt <oliver@apple.com> 10377 10378 Reviewed by Gavin Barraclough. 10379 10380 'this' in JSON.parse reviver is the global object 10381 https://bugs.webkit.org/show_bug.cgi?id=28752 10382 10383 This is a technically simple change, we merely update the code for calling 10384 the reviver function to pass the correct this object. Doing so however 10385 exposes the holder to arbitrary mutation by the reviver function so it is 10386 necessary for us to now guard all property accesses against the possibility 10387 of failure. 10388 10389 * runtime/JSArray.h: 10390 JSON needs to delete a property from the array, so we friend its 10391 Walker class so that we can make a non-virtual call to the arrays 10392 delete and getOwnPropertySlot methods. 10393 * runtime/JSONObject.cpp: 10394 (JSC::Walker::callReviver): 10395 We need to pass the correct this object 10396 (JSC::Walker::walk): 10397 Update calls to callReviver, and update property logic logic 10398 to correctly handle the holder being mutated by the reviver 10399 function. 10400 104012009-08-26 Alice Liu <alice.liu@apple.com> 10402 10403 Windows build fix: added some exported symbols 10404 10405 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 10406 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 10407 104082009-08-26 Geoffrey Garen <ggaren@apple.com> 10409 10410 Windows build fix: Removed some exported symbols that no longer exist. 10411 10412 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 10413 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 10414 104152009-08-26 Gavin Barraclough <barraclough@apple.com> 10416 10417 Reviewed by Olliejver Hunt. 10418 10419 x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates. 10420 https://bugs.webkit.org/show_bug.cgi?id=28317 10421 10422 We rely on a slightly OS X specific behaviour, that x86-64 applications have a 4Gb zero page, 10423 so pointers are never representable as a 32-bit integer, and always have to be represented by 10424 a separate immediate load instruction, rather than within the immediate field of an arithmetic 10425 or memory operation. 10426 10427 We explicitly check for a couple of cases where a value might be representable in 32-bit, but 10428 these probably never kick in on Mac OS, and only kick in to hose GTK. Deleting these does not 10429 show a performance degradation on SunSpider. Remove. 10430 10431 * assembler/MacroAssemblerX86_64.h: 10432 (JSC::MacroAssemblerX86_64::storePtr): 10433 (JSC::MacroAssemblerX86_64::branchPtr): 10434 104352009-08-26 Geoffrey Garen <ggaren@apple.com> 10436 10437 Reviewed by Oliver Hunt. 10438 10439 A bit of Collector refatoring. 10440 10441 SunSpider says no change. v8 says 1.003x faster (1.02x faster on splay). 10442 10443 * JavaScriptCore.exp: 10444 10445 * runtime/JSCell.cpp: 10446 (JSC::JSCell::toPrimitive): 10447 (JSC::JSCell::getPrimitiveNumber): 10448 (JSC::JSCell::toBoolean): 10449 (JSC::JSCell::toNumber): 10450 (JSC::JSCell::toString): 10451 (JSC::JSCell::toObject): Removed pure virtual functions from 10452 JSCell, so the collector can construct one. This allowed 10453 me to remove a bunch of ASSERT_NOT_REACHED throughout the 10454 code, too. 10455 10456 * runtime/JSCell.h: 10457 (JSC::JSCell::JSCell): ditto 10458 (JSC::Heap::heap): Inlined this function because it's trivial. 10459 10460 * JavaScriptCore.exp: 10461 10462 * runtime/Collector.cpp: 10463 (JSC::Heap::destroy): 10464 (JSC::Heap::allocateBlock): 10465 (JSC::Heap::freeBlock): 10466 (JSC::Heap::freeBlocks): Renamed freeHeap to freeBlocks, since 10467 it doesn't actually free the Heap object. 10468 (JSC::Heap::heapAllocate): 10469 (JSC::Heap::sweep): 10470 * runtime/Collector.h: Refactored block allocation and destruction 10471 into helper functions. 10472 10473 * runtime/GetterSetter.cpp: 10474 * runtime/JSAPIValueWrapper.cpp: 10475 * runtime/JSPropertyNameIterator.cpp: Removed dummy implementations 10476 of pure virtual functions. (See above.) 10477 10478=== End re-roll-in of r47738:47740 with Windows crash fixed === 10479 104802009-08-26 Geoffrey Garen <ggaren@apple.com> 10481 10482 Build fix: start out with a 32-bit value to avoid a shortening warning. 10483 10484 * runtime/Collector.cpp: 10485 (JSC::Heap::sweep): 10486 104872009-08-24 Geoffrey Garen <ggaren@apple.com> 10488 10489 Reviewed by Oliver Hunt. 10490 10491 Substantially reduced VM thrash in the GC heap. 10492 10493 1.08x faster on v8 (1.60x faster on v8-splay). 10494 10495 1.40x faster on bench-alloc-nonretained. 10496 10497 1.90x faster on bench-alloc-retained. 10498 10499 SunSpider says no change. 10500 10501 * runtime/Collector.cpp: 10502 (JSC::Heap::heapAllocate): Fixed a long-standing bug: update a few local 10503 variables unconditionally after calling collect(), since they may be used 10504 even if we don't "goto scan". (In the bug I saw, usedBlocks got out of 10505 sync with heap.usedBlocks). 10506 (JSC::Heap::sweep): Keep enough free heap space to accomodate 10507 the number of objects we'll allocate before the next GC, plus 25%, for 10508 good measure. 10509 * runtime/Collector.h: Bumped the block size to 256k. This seems to give 10510 the best cache performance, and it prevents us from initiating lots of 10511 VM traffic to recover very small chunks of memory. 10512 10513=== Begin re-roll-in of r47738:47740 with Windows crash fixed === 10514 105152009-08-25 Drew Wilson <atwilson@google.com> 10516 10517 Reviewed by David Levin. 10518 10519 postMessage() spec now supports sending arrays of ports 10520 https://bugs.webkit.org/show_bug.cgi?id=26902 10521 10522 Added OwnPtr to VectorTraits so we can store OwnPtrs in Vectors. 10523 10524 * wtf/VectorTraits.h: 10525 105262009-08-26 Xan Lopez <xlopez@igalia.com> 10527 10528 Rubber-stamped by Gustavo Noronha. 10529 10530 Remove duplicated files from file list. 10531 10532 * GNUmakefile.am: 10533 105342009-08-26 Oliver Hunt <oliver@apple.com> 10535 10536 Reviewed by NOBODY (Build fix). 10537 10538 More export fixes. 10539 10540 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 10541 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 10542 105432009-08-26 Oliver Hunt <oliver@apple.com> 10544 10545 Reviewed by NOBODY (Build fix). 10546 10547 Hopefully fix all the exports from JSC on windows 10548 10549 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 10550 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 10551 105522009-08-26 Oliver Hunt <oliver@apple.com> 10553 10554 Reviewed by NOBODY (Build fixes). 10555 10556 Forgot I added files to JavaScriptCore. 10557 10558 * GNUmakefile.am: 10559 * JavaScriptCore.gypi: 10560 * JavaScriptCore.pri: 10561 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 10562 * JavaScriptCoreSources.bkl: 10563 105642009-08-25 Oliver Hunt <oliver@apple.com> 10565 10566 Reviewed by Gavin Barraclough. 10567 10568 [ES5] Implement getOwnPropertyDescriptor 10569 https://bugs.webkit.org/show_bug.cgi?id=28724 10570 10571 Implement the core runtime support for getOwnPropertyDescriptor. 10572 This adds a virtual getOwnPropertyDescriptor method to every class 10573 that implements getOwnPropertySlot that shadows the behaviour of 10574 getOwnPropertySlot. The alternative would be to make getOwnPropertySlot 10575 (or PropertySlots in general) provide property attribute information, 10576 but quick testing showed this to be a regression. 10577 10578 * JavaScriptCore.exp: 10579 * JavaScriptCore.xcodeproj/project.pbxproj: 10580 * runtime/Arguments.cpp: 10581 (JSC::Arguments::getOwnPropertyDescriptor): 10582 * runtime/Arguments.h: 10583 * runtime/ArrayPrototype.cpp: 10584 (JSC::ArrayPrototype::getOwnPropertyDescriptor): 10585 * runtime/ArrayPrototype.h: 10586 * runtime/CommonIdentifiers.h: 10587 * runtime/DatePrototype.cpp: 10588 (JSC::DatePrototype::getOwnPropertyDescriptor): 10589 * runtime/DatePrototype.h: 10590 * runtime/JSArray.cpp: 10591 (JSC::JSArray::getOwnPropertyDescriptor): 10592 * runtime/JSArray.h: 10593 * runtime/JSByteArray.cpp: 10594 (JSC::JSByteArray::getOwnPropertyDescriptor): 10595 * runtime/JSByteArray.h: 10596 * runtime/JSFunction.cpp: 10597 (JSC::JSFunction::getOwnPropertyDescriptor): 10598 * runtime/JSFunction.h: 10599 * runtime/JSGlobalObject.h: 10600 (JSC::JSGlobalObject::getOwnPropertyDescriptor): 10601 * runtime/JSNotAnObject.cpp: 10602 (JSC::JSNotAnObject::getOwnPropertyDescriptor): 10603 * runtime/JSNotAnObject.h: 10604 * runtime/JSONObject.cpp: 10605 (JSC::JSONObject::getOwnPropertySlot): 10606 (JSC::JSONObject::getOwnPropertyDescriptor): 10607 * runtime/JSONObject.h: 10608 * runtime/JSObject.cpp: 10609 (JSC::JSObject::getOwnPropertyDescriptor): 10610 (JSC::JSObject::getPropertyDescriptor): 10611 * runtime/JSObject.h: 10612 * runtime/JSString.cpp: 10613 (JSC::JSString::getStringPropertyDescriptor): 10614 (JSC::JSString::getOwnPropertyDescriptor): 10615 * runtime/JSString.h: 10616 * runtime/JSVariableObject.cpp: 10617 (JSC::JSVariableObject::symbolTableGet): 10618 * runtime/JSVariableObject.h: 10619 * runtime/Lookup.h: 10620 (JSC::getStaticPropertyDescriptor): 10621 (JSC::getStaticFunctionDescriptor): 10622 (JSC::getStaticValueDescriptor): 10623 Add property descriptor equivalents of the lookup 10624 table access functions 10625 10626 * runtime/MathObject.cpp: 10627 (JSC::MathObject::getOwnPropertySlot): 10628 (JSC::MathObject::getOwnPropertyDescriptor): 10629 * runtime/MathObject.h: 10630 * runtime/NumberConstructor.cpp: 10631 (JSC::NumberConstructor::getOwnPropertyDescriptor): 10632 * runtime/NumberConstructor.h: 10633 * runtime/ObjectConstructor.cpp: 10634 (JSC::ObjectConstructor::ObjectConstructor): 10635 (JSC::objectConstructorGetOwnPropertyDescriptor): 10636 * runtime/PropertyDescriptor.cpp: Added. 10637 (JSC::PropertyDescriptor::writable): 10638 (JSC::PropertyDescriptor::enumerable): 10639 (JSC::PropertyDescriptor::configurable): 10640 (JSC::PropertyDescriptor::hasAccessors): 10641 (JSC::PropertyDescriptor::setUndefined): 10642 (JSC::PropertyDescriptor::getter): 10643 (JSC::PropertyDescriptor::setter): 10644 (JSC::PropertyDescriptor::setDescriptor): 10645 (JSC::PropertyDescriptor::setAccessorDescriptor): 10646 * runtime/PropertyDescriptor.h: Added. 10647 (JSC::PropertyDescriptor::PropertyDescriptor): 10648 (JSC::PropertyDescriptor::attributes): 10649 (JSC::PropertyDescriptor::isValid): 10650 (JSC::PropertyDescriptor::value): 10651 * runtime/RegExpConstructor.cpp: 10652 (JSC::RegExpConstructor::getOwnPropertyDescriptor): 10653 * runtime/RegExpConstructor.h: 10654 * runtime/RegExpMatchesArray.h: 10655 (JSC::RegExpMatchesArray::getOwnPropertyDescriptor): 10656 * runtime/RegExpObject.cpp: 10657 (JSC::RegExpObject::getOwnPropertyDescriptor): 10658 * runtime/RegExpObject.h: 10659 * runtime/StringObject.cpp: 10660 (JSC::StringObject::getOwnPropertyDescriptor): 10661 * runtime/StringObject.h: 10662 * runtime/StringPrototype.cpp: 10663 (JSC::StringPrototype::getOwnPropertyDescriptor): 10664 * runtime/StringPrototype.h: 10665 106662009-08-24 Gavin Barraclough <barraclough@apple.com> 10667 10668 Reviewed by Darin Adler. 10669 10670 How many copies of the parameters do you need? 10671 https://bugs.webkit.org/show_bug.cgi?id=28701 10672 10673 The function parameters in JSC get copied a lot - and unnecessarily so. 10674 10675 Originally this happened due to duplicating FunctionBodyNodes on recompilation, 10676 though the problem has been exacerbated by copying the parameters from the 10677 original function body onto the executable, then back onto the real body that 10678 will be generated (this happens on every function). And this is all made worse 10679 since the data structures in question are a little ugly - C style arrays of C++ 10680 objects containing ref counts, so they need a full copy-construct (rather than 10681 a simple memcpy). 10682 10683 This can all be greatly simplified by just punting the parameters off into 10684 their own ref-counted object, and forgoing all the copying. 10685 10686 ~no performance change, possible slight progression. 10687 10688 * bytecompiler/BytecodeGenerator.cpp: 10689 (JSC::BytecodeGenerator::BytecodeGenerator): 10690 * bytecompiler/BytecodeGenerator.h: 10691 (JSC::BytecodeGenerator::makeFunction): 10692 * parser/Nodes.cpp: 10693 (JSC::FunctionParameters::FunctionParameters): 10694 (JSC::FunctionBodyNode::FunctionBodyNode): 10695 (JSC::FunctionBodyNode::finishParsing): 10696 * parser/Nodes.h: 10697 (JSC::FunctionBodyNode::parameters): 10698 (JSC::FunctionBodyNode::parameterCount): 10699 * runtime/Executable.cpp: 10700 (JSC::FunctionExecutable::~FunctionExecutable): 10701 (JSC::FunctionExecutable::compile): 10702 (JSC::FunctionExecutable::reparseExceptionInfo): 10703 (JSC::FunctionExecutable::fromGlobalCode): 10704 (JSC::FunctionExecutable::paramString): 10705 * runtime/Executable.h: 10706 (JSC::FunctionExecutable::FunctionExecutable): 10707 (JSC::FunctionExecutable::parameterCount): 10708 107092009-08-25 Brent Fulgham <bfulgham@webkit.org> 10710 10711 Reviewed by NOBODY (Buildfix). 10712 10713 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_CFLite target 10714 that inherits from the debug_wincairo property sheet and therefore 10715 links to the proper debug library. 10716 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_CFLite target 10717 that inherits from the debug_wincairo property sheet and therefore 10718 links to the proper debug library. 10719 107202009-08-25 Chris Marrin <cmarrin@apple.com> 10721 10722 Reviewed by Simon Fraser. 10723 10724 Export tryFastMalloc for Canvas3D work 10725 https://bugs.webkit.org/show_bug.cgi?id=28018 10726 10727 * JavaScriptCore.exp: 10728 107292009-08-25 David Levin <levin@chromium.org> 10730 10731 Reviewed by Adam Roben. 10732 10733 PLATFORM(CFNETWORK) should be USE(CFNETWORK). 10734 https://bugs.webkit.org/show_bug.cgi?id=28713 10735 10736 * wtf/Platform.h: Added a #define to catch this issue in the 10737 future. The define would generate an error on gcc without the 10738 space in the expansion, but Visual C++ needs the space to cause an error. 10739 107402009-08-24 Brent Fulgham <bfulgham@webkit.org> 10741 10742 Reviewed by Steve Falkenburg. 10743 10744 Revise CFLite Debug build to emit DLL's with _debug label. 10745 https://bugs.webkit.org/show_bug.cgi?id=28695. 10746 10747 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modify 10748 Cairo debug build to inherit from new debug_cairo property sheet. 10749 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops: 10750 Modify to look for debug CFLite when in debug build. 10751 107522009-08-24 Gavin Barraclough <barraclough@apple.com> 10753 10754 Reviewed by Oliver Adler & Darin Hunt. 10755 10756 https://bugs.webkit.org/show_bug.cgi?id=28691 10757 Do not retain ScopeNodes outside of parsing 10758 10759 There is now no need for these to exist outside of parsing - their use in the runtime is replaced by Executable types. 10760 10761 * bytecode/EvalCodeCache.h: 10762 (JSC::EvalCodeCache::get): 10763 * bytecompiler/BytecodeGenerator.cpp: 10764 (JSC::BytecodeGenerator::BytecodeGenerator): 10765 (JSC::BytecodeGenerator::emitNewFunction): 10766 (JSC::BytecodeGenerator::emitNewFunctionExpression): 10767 * bytecompiler/BytecodeGenerator.h: 10768 (JSC::BytecodeGenerator::makeFunction): 10769 * debugger/Debugger.cpp: 10770 (JSC::Debugger::recompileAllJSFunctions): 10771 (JSC::evaluateInGlobalCallFrame): 10772 * debugger/DebuggerCallFrame.cpp: 10773 (JSC::DebuggerCallFrame::evaluate): 10774 * interpreter/Interpreter.cpp: 10775 (JSC::Interpreter::execute): 10776 (JSC::Interpreter::prepareForRepeatCall): 10777 (JSC::Interpreter::privateExecute): 10778 * jit/JITStubs.cpp: 10779 (JSC::DEFINE_STUB_FUNCTION): 10780 * parser/Nodes.cpp: 10781 (JSC::ScopeNodeData::ScopeNodeData): 10782 (JSC::ProgramNode::create): 10783 (JSC::EvalNode::create): 10784 (JSC::FunctionBodyNode::create): 10785 * parser/Nodes.h: 10786 (JSC::ScopeNode::adoptData): 10787 (JSC::FunctionBodyNode::parameterCount): 10788 * parser/Parser.cpp: 10789 * parser/Parser.h: 10790 (JSC::Parser::arena): 10791 (JSC::Parser::Parser): 10792 (JSC::Parser::parse): 10793 * runtime/ArrayPrototype.cpp: 10794 (JSC::isNumericCompareFunction): 10795 (JSC::arrayProtoFuncSort): 10796 * runtime/Completion.cpp: 10797 (JSC::checkSyntax): 10798 (JSC::evaluate): 10799 * runtime/Executable.cpp: 10800 (JSC::FunctionExecutable::~FunctionExecutable): 10801 (JSC::EvalExecutable::compile): 10802 (JSC::ProgramExecutable::checkSyntax): 10803 (JSC::ProgramExecutable::compile): 10804 (JSC::FunctionExecutable::compile): 10805 (JSC::EvalExecutable::generateJITCode): 10806 (JSC::ProgramExecutable::generateJITCode): 10807 (JSC::FunctionExecutable::generateJITCode): 10808 (JSC::FunctionExecutable::reparseExceptionInfo): 10809 (JSC::EvalExecutable::reparseExceptionInfo): 10810 (JSC::FunctionExecutable::recompile): 10811 (JSC::FunctionExecutable::fromGlobalCode): 10812 (JSC::FunctionExecutable::copyParameters): 10813 (JSC::FunctionExecutable::paramString): 10814 * runtime/Executable.h: 10815 (JSC::ScriptExecutable::ScriptExecutable): 10816 (JSC::ScriptExecutable::sourceID): 10817 (JSC::ScriptExecutable::sourceURL): 10818 (JSC::ScriptExecutable::lineNo): 10819 (JSC::ScriptExecutable::lastLine): 10820 (JSC::ScriptExecutable::usesEval): 10821 (JSC::ScriptExecutable::usesArguments): 10822 (JSC::ScriptExecutable::needsActivation): 10823 (JSC::ScriptExecutable::recordParse): 10824 (JSC::EvalExecutable::bytecode): 10825 (JSC::EvalExecutable::jitCode): 10826 (JSC::ProgramExecutable::bytecode): 10827 (JSC::ProgramExecutable::reparseExceptionInfo): 10828 (JSC::ProgramExecutable::jitCode): 10829 (JSC::FunctionExecutable::FunctionExecutable): 10830 (JSC::FunctionExecutable::make): 10831 (JSC::FunctionExecutable::bytecode): 10832 (JSC::FunctionExecutable::isGenerated): 10833 (JSC::FunctionExecutable::name): 10834 (JSC::FunctionExecutable::parameterCount): 10835 (JSC::FunctionExecutable::jitCode): 10836 * runtime/FunctionConstructor.cpp: 10837 (JSC::constructFunction): 10838 * runtime/JSGlobalData.cpp: 10839 (JSC::JSGlobalData::numericCompareFunction): 10840 * runtime/JSGlobalObjectFunctions.cpp: 10841 (JSC::globalFuncEval): 10842 108432009-08-24 Darin Adler <darin@apple.com> 10844 10845 * runtime/ObjectPrototype.cpp: 10846 (JSC::ObjectPrototype::put): Landed revised version I had tested but forgot 10847 to land. Leave out the branch, since we don't need one. 10848 108492009-08-24 Darin Adler <darin@apple.com> 10850 10851 Reviewed by Geoff Garen. 10852 10853 Array index miss case creates a string every time 10854 https://bugs.webkit.org/show_bug.cgi?id=28664 10855 10856 SunSpider test results I saw: 10857 10858 0.5% faster overall 10859 1% faster on crypto-aes 10860 20% faster on crypto-md5 10861 13% faster on crypto-sha1 10862 10863 * runtime/ObjectPrototype.cpp: 10864 (JSC::ObjectPrototype::ObjectPrototype): Initialize m_hasNoPropertiesWithUInt32Names 10865 to true. 10866 (JSC::ObjectPrototype::put): Clearly m_hasNoPropertiesWithUInt32Names if the new 10867 property has a name that is the string form of a UInt32. 10868 (JSC::ObjectPrototype::getOwnPropertySlot): Don't call JSObject::getOwnPropertySlot 10869 if m_hasNoPropertiesWithUInt32Names is true, and it is highly likely to be true. 10870 10871 * runtime/ObjectPrototype.h: Added declarations for the above. 10872 108732009-08-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 10874 10875 Unreviewed. Fix a typo in my distcheck build fix. 10876 10877 * GNUmakefile.am: 10878 108792009-08-23 Gustavo Noronha Silva <gns@gnome.org> 10880 10881 Unreviewed build fix for make distcheck. 10882 10883 * GNUmakefile.am: Added files required for the build. 10884 108852009-08-22 Maciej Stachowiak <mjs@apple.com> 10886 10887 Reviewed by Mark Rowe. 10888 10889 REGRESSION(r47639-r47660): Webkit crashes on launch on PowerPC 10890 https://bugs.webkit.org/show_bug.cgi?id=28655 10891 10892 * runtime/JSFunction.cpp: 10893 (JSC::JSFunction::JSFunction): Initialize properly with a VPtrHackExecutable. 10894 * wtf/Platform.h: 10895 108962009-08-22 Darin Adler <darin@apple.com> 10897 10898 Fix storage leak from syntax tree arena allocation patch. 10899 10900 * parser/Nodes.h: CommaNode needs to inherit from ParserArenaDeletable 10901 because it has a vector. 10902 109032009-08-21 Darin Adler <darin@apple.com> 10904 10905 Fix Qt build. 10906 10907 * parser/Nodes.cpp: 10908 (JSC::ScopeNodeData::ScopeNodeData): Made non-inline again. 10909 This is used outside Nodes.cpp so can't be inline unless 10910 it is in the header. 10911 109122009-08-21 Darin Adler <darin@apple.com> 10913 10914 Two loose ends from the last commit. 10915 10916 * JavaScriptCore.xcodeproj/project.pbxproj: Made ParserArena.h 10917 and create_hash_table project-internal instead of "private". 10918 * runtime/Executable.h: Removed accidentally-added constructor. 10919 109202009-08-21 Darin Adler <darin@apple.com> 10921 10922 Reviewed by Gavin Barraclough. 10923 10924 Syntax tree nodes should use arena allocation 10925 https://bugs.webkit.org/show_bug.cgi?id=25674 10926 10927 Use an actual arena now. 0.6% speedup on SunSpider. 10928 10929 New and improved with 100% less leaking of the universe. 10930 10931 * JavaScriptCore.exp: 10932 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 10933 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 10934 Removed all exports involving the class FunctionBodyNode, which no 10935 longer needs to be used outside JavaScriptCore. 10936 10937 * JavaScriptCore.xcodeproj/project.pbxproj: Made Nodes.h and 10938 Executable.h project-internal instead of "private". 10939 10940 * bytecompiler/BytecodeGenerator.cpp: 10941 (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack 10942 contains const Identifier* now. 10943 10944 * parser/Grammar.y: Made identifiers from the lexer be const 10945 Identifier* and updated since VarStack contains const Identifier* now. 10946 10947 * parser/Lexer.cpp: 10948 (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers. 10949 (JSC::Lexer::makeIdentifier): Changed return type to const Identifier* 10950 and changed to call ParserArena. 10951 (JSC::Lexer::clear): Removed the code to manage m_identifiers and 10952 added code to set m_arena to 0. 10953 * parser/Lexer.h: Updated for changes above. 10954 10955 * parser/NodeConstructors.h: 10956 (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable 10957 on the arena. 10958 (JSC::ParserArenaDeletable::operator new): Changed to call the 10959 allocateDeletable function on the arena instead of deleteWithArena. 10960 (JSC::PropertyNode::PropertyNode): Added new constructor that makes 10961 numeric identifiers. Some day we might want to optimize this for 10962 integers so it doesn't create a string for each one. 10963 (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier 10964 since it's now a const Identifier& so it can't be left uninitialized. 10965 (JSC::BreakNode::BreakNode): Ditto. 10966 (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements* 10967 to keep track of the statements rather than a separate statement vector. 10968 (JSC::BlockNode::BlockNode): Ditto. 10969 (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier. 10970 10971 * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here. 10972 It seemed strangely out of place in the header. 10973 (JSC::ThrowableExpressionData::emitThrowError): Added an overload for 10974 UString as well as Identifier. 10975 (JSC::SourceElements::singleStatement): Added. 10976 (JSC::SourceElements::lastStatement): Added. 10977 (JSC::RegExpNode::emitBytecode): Changed the throwError code to use 10978 the substitution mechanism instead of doing a string append. 10979 (JSC::SourceElements::emitBytecode): Added. Replaces the old 10980 statementListEmitCode function, since we now keep the SourceElements 10981 objects around. 10982 (JSC::BlockNode::lastStatement): Added. 10983 (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of 10984 statementListEmitCode. 10985 (JSC::CaseClauseNode::emitBytecode): Added. 10986 (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode 10987 instead of statementListEmitCode. 10988 (JSC::ScopeNodeData::ScopeNodeData): Changed to store the 10989 SourceElements* instead of using releaseContentsIntoVector. 10990 (JSC::ScopeNode::emitStatementsBytecode): Added. 10991 (JSC::ScopeNode::singleStatement): Added. 10992 (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead 10993 of statementListEmitCode. 10994 (JSC::EvalNode::emitBytecode): Ditto. 10995 (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode 10996 insetad of statementListEmitCode and check for the return node using 10997 the new functions. 10998 10999 * parser/Nodes.h: Changed VarStack to store const Identifier* instead 11000 of Identifier and rely on the arena to control lifetime. Added a new 11001 ParserArenaFreeable class. Made ParserArenaDeletable inherit from 11002 FastAllocBase instead of having its own operator new. Base the Node 11003 class on ParserArenaFreeable. Changed the various Node classes 11004 to use const Identifier& instead of Identifier to avoid the need to 11005 call their destructors and allow them to function as "freeable" in the 11006 arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions. 11007 Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode, 11008 CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable 11009 as a base class since they do not descend from Node. Eliminated the 11010 StatementVector type and instead have various classes use SourceElements* 11011 instead of StatementVector. This prevents those classes from having to 11012 use ParserArenaDeletable to make sure the vector destructor is called. 11013 11014 * parser/Parser.cpp: 11015 (JSC::Parser::parse): Pass the arena to the lexer. 11016 11017 * parser/Parser.h: Added an include of ParserArena.h, which is no longer 11018 included by Nodes.h. 11019 (JSC::Parser::parseFunctionFromGlobalCode): Changed to use the 11020 singleStatement function, since there is no longer any children function. 11021 Removed some unneeded use of RefPtr. 11022 11023 * parser/ParserArena.cpp: 11024 (JSC::ParserArena::ParserArena): Added. Initializes the new members, 11025 m_freeableMemory, m_freeablePoolEnd, and m_identifiers. 11026 (JSC::ParserArena::freeablePool): Added. Computes the pool pointer, 11027 since we store only the current pointer and the end of pool pointer. 11028 (JSC::ParserArena::deallocateObjects): Added. Contains the common 11029 memory-deallocation logic used by both the destructor and the 11030 reset function. 11031 (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects. 11032 (JSC::ParserArena::reset): Ditto. Also added code to zero out the 11033 new structures, and switched to use clear() instead of shrink(0) since 11034 we don't really reuse arenas. 11035 (JSC::ParserArena::makeNumericIdentifier): Added. 11036 (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool 11037 is empty. 11038 (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine 11039 since this is used only for assertions at the moment. 11040 (JSC::ParserArena::derefWithArena): Make non-inline. 11041 11042 * parser/ParserArena.h: Added an actual arena of "freeable" objects, 11043 ones that don't need destructors to be called. Also added a separate 11044 IdentifierArena object, a segmented vector of identifiers that used 11045 to be in the Lexer. 11046 11047 * runtime/Executable.h: Moved the definition of the 11048 FunctionExecutable::make function here. It can't go in JSFunction.h 11049 since that header has to be used outside JavaScriptCore and so can't 11050 include this, which includes Nodes.h. The function could be moved 11051 elswhere if we don't want to include JSFunction.h in this header, but 11052 for now this seems to be the best place. 11053 11054 * runtime/JSFunction.h: Removed the include of Executable.h and 11055 definition of the FunctionExecutable::make function. 11056 11057 * wtf/FastMalloc.cpp: Fixed an incorrect comment. 11058 110592009-08-21 Mark Rowe <mrowe@apple.com> 11060 11061 Fix the non-JIT build. 11062 11063 * runtime/Executable.cpp: 11064 * runtime/Executable.h: 11065 110662009-08-21 Gavin Barraclough <barraclough@apple.com> 11067 11068 Speculative QuickTime build fix. 11069 11070 * runtime/JSArray.cpp: 11071 110722009-08-21 Gavin Barraclough <barraclough@apple.com> 11073 11074 Speculative QT build fix. 11075 11076 * runtime/StringPrototype.cpp: 11077 110782009-08-21 Gavin Barraclough <barraclough@apple.com> 11079 11080 Reviewed by Oliver Hunt. 11081 11082 Restructure Executable types so that host functions do not hold a FunctionExecutable. 11083 https://bugs.webkit.org/show_bug.cgi?id=28621 11084 11085 All JSFunction objects have a pointer to an Executable*. This is currently always a 11086 FunctionExecutable, however this has a couple of drawbacks. Host functions do not 11087 store a range of information that the FunctionExecutable provides (source, name, 11088 CodeBlock & information presently held on the FunctionBodyNode). 11089 11090 [ * nearly all... see below! ] 11091 11092 Instead, make JSFunctions hold a pointer to an ExecutableBase, move fields specific 11093 to JS sourced executable types (source, node) into a new subclass (ScriptExecutable), 11094 and create a new NativeExecutable type. We now provide a new method in JSFunction 11095 to access & downcast to FunctionExecutable, but in doing so we can make an early 11096 check (with an ASSERT) to ensure that the Executable read from a function will only 11097 be treated as a FunctionExecutable (and thus the JS sepcific fields will only be 11098 accessed) if the JSFunction is not a host function. 11099 11100 There is one JSFunction that currently does not have an Executable, which is the 11101 object created to allow us to read out the vtable pointer. By making this change 11102 we can also add a new Executable type fror this object (VPtrHackExecutable). 11103 Since this means that really all JSFunctions have an Executable we no longer have 11104 to null-check m_executable before us it - particularly in isHostFunction(). 11105 11106 This patch removes CacheableEvalExecutable, since all subclasses of ExecutableBase 11107 can now be ref-counted - since both JSFunction holds (and ref-counts) an ExecutableBase 11108 that might be a FunctionExecutable or a NativeExecutable. This does now mean that all 11109 ProgramExecutables and EvalExecutables (unnecessarily) provide an interface to be 11110 ref-counted, however this seems less-bad than host functions unnecessarily providing 11111 interface to access non-host specific information. 11112 11113 The class hierarcy has changed from this: 11114 11115 - ExecutableBase 11116 - ProgramExecutable 11117 - EvalExecutable 11118 - CacheableEvalExecutable (also RefCounted by multiple-inheritance) 11119 - FunctionExecutable (also RefCounted by multiple-inheritance, 'special' FunctionExecutable also used for host functions) 11120 11121 To this: 11122 11123 - RefCounted 11124 - ExecutableBase 11125 - NativeExecutable 11126 - VPtrHackExecutable 11127 - ScriptExecutable 11128 - ProgramExecutable 11129 - EvalExecutable 11130 - FunctionExecutable 11131 11132 This patch speeds up sunspidey by a couple of ms (presumably due to the changes to isHostFunction()). 11133 11134 * bytecode/CodeBlock.cpp: 11135 (JSC::CodeBlock::CodeBlock): 11136 * bytecode/CodeBlock.h: 11137 (JSC::CodeBlock::ownerExecutable): 11138 (JSC::GlobalCodeBlock::GlobalCodeBlock): 11139 * bytecode/EvalCodeCache.h: 11140 (JSC::EvalCodeCache::get): 11141 * debugger/Debugger.cpp: 11142 (JSC::Debugger::recompileAllJSFunctions): 11143 * interpreter/CachedCall.h: 11144 (JSC::CachedCall::CachedCall): 11145 * interpreter/Interpreter.cpp: 11146 (JSC::Interpreter::callEval): 11147 (JSC::Interpreter::privateExecute): 11148 * jit/JITStubs.cpp: 11149 (JSC::DEFINE_STUB_FUNCTION): 11150 * profiler/Profiler.cpp: 11151 (JSC::createCallIdentifierFromFunctionImp): 11152 * runtime/Arguments.h: 11153 (JSC::Arguments::getArgumentsData): 11154 (JSC::Arguments::Arguments): 11155 * runtime/Executable.cpp: 11156 (JSC::NativeExecutable::~NativeExecutable): 11157 (JSC::VPtrHackExecutable::~VPtrHackExecutable): 11158 * runtime/Executable.h: 11159 (JSC::ExecutableBase::ExecutableBase): 11160 (JSC::ExecutableBase::~ExecutableBase): 11161 (JSC::ExecutableBase::isHostFunction): 11162 (JSC::NativeExecutable::NativeExecutable): 11163 (JSC::VPtrHackExecutable::VPtrHackExecutable): 11164 (JSC::ScriptExecutable::ScriptExecutable): 11165 (JSC::ScriptExecutable::source): 11166 (JSC::ScriptExecutable::sourceID): 11167 (JSC::ScriptExecutable::sourceURL): 11168 (JSC::ScriptExecutable::lineNo): 11169 (JSC::ScriptExecutable::lastLine): 11170 (JSC::ScriptExecutable::usesEval): 11171 (JSC::ScriptExecutable::usesArguments): 11172 (JSC::ScriptExecutable::needsActivation): 11173 (JSC::EvalExecutable::EvalExecutable): 11174 (JSC::EvalExecutable::create): 11175 (JSC::ProgramExecutable::ProgramExecutable): 11176 (JSC::FunctionExecutable::FunctionExecutable): 11177 * runtime/FunctionPrototype.cpp: 11178 (JSC::functionProtoFuncToString): 11179 * runtime/JSFunction.cpp: 11180 (JSC::JSFunction::JSFunction): 11181 (JSC::JSFunction::~JSFunction): 11182 (JSC::JSFunction::markChildren): 11183 (JSC::JSFunction::getCallData): 11184 (JSC::JSFunction::call): 11185 (JSC::JSFunction::lengthGetter): 11186 (JSC::JSFunction::getConstructData): 11187 (JSC::JSFunction::construct): 11188 * runtime/JSFunction.h: 11189 (JSC::JSFunction::executable): 11190 (JSC::JSFunction::jsExecutable): 11191 (JSC::JSFunction::isHostFunction): 11192 111932009-08-20 Oliver Hunt <oliver@apple.com> 11194 11195 Reviewed by Maciej Stachowiak. 11196 11197 Browser hangs on opening Web Inspector. 11198 https://bugs.webkit.org/show_bug.cgi?id=28438 11199 11200 Code generation needs to be able to walk the entire scopechain in some 11201 cases, however the symbol table used by activations was a member of the 11202 codeblock. Following recompilation this may no longer exist, leading 11203 to a crash or hang on lookup. 11204 11205 We fix this by introducing a refcounted SymbolTable subclass, SharedSymbolTable, 11206 for the CodeBlocks used by function code. This allows activations to 11207 maintain ownership of a copy of the symbol table even after recompilation so 11208 they can continue to work. 11209 11210 * bytecode/CodeBlock.cpp: 11211 (JSC::CodeBlock::CodeBlock): 11212 * bytecode/CodeBlock.h: 11213 (JSC::CodeBlock::symbolTable): 11214 (JSC::CodeBlock::sharedSymbolTable): 11215 (JSC::GlobalCodeBlock::GlobalCodeBlock): 11216 (JSC::FunctionCodeBlock::FunctionCodeBlock): 11217 (JSC::FunctionCodeBlock::~FunctionCodeBlock): 11218 * interpreter/Interpreter.cpp: 11219 (JSC::Interpreter::retrieveArguments): 11220 * runtime/Executable.cpp: 11221 (JSC::EvalExecutable::generateBytecode): 11222 (JSC::FunctionExecutable::generateBytecode): 11223 (JSC::FunctionExecutable::reparseExceptionInfo): 11224 (JSC::EvalExecutable::reparseExceptionInfo): 11225 * runtime/JSActivation.h: 11226 (JSC::JSActivation::JSActivationData::JSActivationData): 11227 (JSC::JSActivation::JSActivationData::~JSActivationData): 11228 * runtime/SymbolTable.h: 11229 112302009-08-20 Xan Lopez <xlopez@igalia.com> 11231 11232 Add new file to GTK+ build. 11233 11234 * GNUmakefile.am: 11235 112362009-08-20 Geoffrey Garen <ggaren@apple.com> 11237 11238 Reviewed by Maciej Stachowiak. 11239 11240 Added a number => string cache. 11241 11242 1.07x faster on v8 (1.7x faster on v8-splay). 11243 1.004x faster on SunSpider. 11244 11245 * runtime/JSCell.h: Moved JSValue::toString to JSString.h. 11246 * runtime/JSGlobalData.h: Holds the cache. 11247 * runtime/JSNumberCell.cpp: 11248 (JSC::JSNumberCell::toString): 11249 (JSC::JSNumberCell::toThisString): Removed -0 special case. 11250 UString handles this now, since too many clients were 11251 special-casing it. 11252 11253 * runtime/JSString.h: 11254 (JSC::JSValue::toString): Use the cache when converting 11255 an int or double to string. 11256 11257 * runtime/Operations.h: 11258 (JSC::concatenateStrings): Call toString to take advantage 11259 of the cache. 11260 11261 * runtime/SmallStrings.h: 11262 (JSC::NumericStrings::add): 11263 (JSC::NumericStrings::lookup): The cache. 11264 11265 * runtime/UString.cpp: 11266 (JSC::UString::from): Added -0 special case mentioned above. 11267 Removed appendNumeric because it's mutually exclusive with the 11268 cache. 11269 112702009-08-20 Oliver Hunt <oliver@apple.com> 11271 11272 Reviewed by Gavin Barraclough. 11273 11274 REGRESSION: fast/profiler/call.html is crashing occasionally 11275 https://bugs.webkit.org/show_bug.cgi?id=28476 11276 11277 Using the codeblock for information about how many parameters and 11278 locals a function has is unsafe in certain circumstances. The 11279 basic scenario is all function code being cleared in response to 11280 the debugger or profiler being enabled, and then an activation is 11281 marked before its associated function is re-executed. 11282 11283 To deal with this scenario we store the variable count of a function 11284 directly in the FunctionExecutable, and then use that information. 11285 11286 * runtime/Arguments.h: 11287 (JSC::Arguments::getArgumentsData): 11288 * runtime/Executable.cpp: 11289 (JSC::FunctionExecutable::generateBytecode): 11290 * runtime/Executable.h: 11291 (JSC::FunctionExecutable::FunctionExecutable): 11292 (JSC::FunctionExecutable::variableCount): 11293 * runtime/JSActivation.cpp: 11294 (JSC::JSActivation::markChildren): 11295 112962009-08-20 Gavin Barraclough <barraclough@apple.com> 11297 11298 Reviewed by Oliver Hunt. 11299 11300 Numbering of arguments to emitGetJITStubArg/emitPutJITStubArg incorrect 11301 <bug lost in the great bug disasteroony of 08/20/09!> 11302 11303 The argumentNumber argument to emitGetJITStubArg/emitPutJITStubArg should match 11304 the argument number used within the stub functions in JITStubs.cpp, but it doesn't. 11305 11306 Firstly, all the numbers changed when we added a void* 'reserved' as the first slot 11307 (rather than leaving argument 0 unused), and secondly in 32_64 builds the index to 11308 peek/poke needs to be multiplies by 2 (since the argument to peek/poke is a number 11309 of machine words, and on 32_64 build the argument slots to stub functions are two 11310 words wide). 11311 11312 * jit/JIT.h: 11313 * jit/JITCall.cpp: 11314 (JSC::JIT::compileOpCallSetupArgs): 11315 (JSC::JIT::compileOpConstructSetupArgs): 11316 (JSC::JIT::compileOpCallVarargsSetupArgs): 11317 (JSC::JIT::compileOpCall): 11318 * jit/JITInlineMethods.h: 11319 (JSC::JIT::emitPutJITStubArg): 11320 (JSC::JIT::emitPutJITStubArgConstant): 11321 (JSC::JIT::emitGetJITStubArg): 11322 (JSC::JIT::emitPutJITStubArgFromVirtualRegister): 11323 * jit/JITOpcodes.cpp: 11324 (JSC::JIT::privateCompileCTIMachineTrampolines): 11325 * jit/JITPropertyAccess.cpp: 11326 (JSC::JIT::privateCompilePutByIdTransition): 11327 113282009-08-20 Oliver Hunt <oliver@apple.com> 11329 11330 Reviewed by Geoff Garen. 11331 11332 REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest 11333 https://bugs.webkit.org/show_bug.cgi?id=28332 11334 11335 Follow up style fixes that were missed in review. 11336 11337 * runtime/Structure.cpp: 11338 (JSC::Structure::hasTransition): 11339 * runtime/Structure.h: 11340 (JSC::Structure::get): 11341 (JSC::StructureTransitionTable::contains): 11342 * runtime/StructureTransitionTable.h: 11343 (JSC::StructureTransitionTable::add): 11344 113452009-08-20 Oliver Hunt <oliver@apple.com> 11346 11347 Add new exports to windows jsc build 11348 11349 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 11350 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 11351 113522009-08-20 Oliver Hunt <oliver@apple.com> 11353 11354 Reviewed by Gavin Barraclough. 11355 11356 REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest 11357 https://bugs.webkit.org/show_bug.cgi?id=28332 11358 11359 The method check optimisation made transitions aware of the value being 11360 assigned when a transition was assigning a function. This had the side 11361 effect of making every assignment of a function expression result in a 11362 new transition, and thus a new Structure. The net result of this is that 11363 the common JS idiom of 11364 11365 function MyObject() { 11366 this.myFunction = function(...){...}; 11367 } 11368 new MyObject(); 11369 11370 Will produce a unique structure on every iteration, meaning that all 11371 caching is defeated and there is a significant amount of structure churn. 11372 11373 The fix is to return the transition to its original form where it is 11374 keyed off a property name + attributes tuple, but have each transition 11375 support an optional transition on a specific value. 11376 11377 * JavaScriptCore.exp: 11378 * runtime/JSObject.h: 11379 (JSC::JSObject::putDirectInternal): 11380 * runtime/Structure.cpp: 11381 (JSC::Structure::~Structure): 11382 (JSC::Structure::addPropertyTransitionToExistingStructure): 11383 (JSC::Structure::addPropertyTransition): 11384 (JSC::Structure::hasTransition): 11385 * runtime/Structure.h: 11386 (JSC::Structure::transitionedFor): 11387 (JSC::Structure::hasTransition): 11388 (JSC::Structure::): 11389 (JSC::StructureTransitionTable::contains): 11390 (JSC::StructureTransitionTable::get): 11391 * runtime/StructureTransitionTable.h: 11392 (JSC::StructureTransitionTableHashTraits::emptyValue): 11393 (JSC::StructureTransitionTable::hasTransition): 11394 (JSC::StructureTransitionTable::remove): 11395 (JSC::StructureTransitionTable::add): 11396 113972009-08-20 Gavin Barraclough <barraclough@apple.com> 11398 11399 Reviewed by Oliver Hunt. 11400 11401 Remove FunctionCodeBlock. 11402 https://bugs.webkit.org/show_bug.cgi?id=28502 11403 11404 These only exist to allow JIT code to dereference properties off the 11405 CodeBlock for any callee, regardless of whether it is a host function. 11406 11407 Instead just use the FunctionExecutable. Copy the m_parameters field 11408 from the CodeBlock into the Executable, and use this to distinguish 11409 between host functions, functions that have been bytecompiled, and 11410 functions that have not. 11411 11412 m_parameters is moved to ExecutableBase rather than FunctionExecutable 11413 so that (as a separate change) we can move make a separate class of 11414 executable for host code, which is not devived from FunctionExecutable 11415 (host code does not feature any of the properties that normal executable 11416 do and will provide, such as source, attributes, and a parsed name). 11417 11418 1% win on v8 tests, 0.5% on sunspider. 11419 11420 * bytecode/CodeBlock.cpp: 11421 (JSC::CodeBlock::derefStructures): 11422 (JSC::CodeBlock::refStructures): 11423 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): 11424 (JSC::CodeBlock::handlerForBytecodeOffset): 11425 (JSC::CodeBlock::lineNumberForBytecodeOffset): 11426 (JSC::CodeBlock::expressionRangeForBytecodeOffset): 11427 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): 11428 (JSC::CodeBlock::functionRegisterForBytecodeOffset): 11429 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset): 11430 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset): 11431 * bytecode/CodeBlock.h: 11432 (JSC::): 11433 (JSC::CodeBlock::source): 11434 (JSC::CodeBlock::sourceOffset): 11435 (JSC::CodeBlock::evalCodeCache): 11436 (JSC::CodeBlock::createRareDataIfNecessary): 11437 11438 remove NativeCodeBlocks and the NativeCode code type. 11439 11440 * jit/JIT.cpp: 11441 (JSC::JIT::linkCall): 11442 11443 Revert to previous behaviour (as currently still commented!) that Hhost functions have a null codeblock. 11444 11445 * jit/JITCall.cpp: 11446 (JSC::JIT::compileOpCallInitializeCallFrame): 11447 (JSC::JIT::compileOpCallSetupArgs): 11448 (JSC::JIT::compileOpCallVarargsSetupArgs): 11449 (JSC::JIT::compileOpConstructSetupArgs): 11450 (JSC::JIT::compileOpCallVarargs): 11451 (JSC::JIT::compileOpCall): 11452 (JSC::JIT::compileOpCallSlowCase): 11453 11454 Bring the 32_64 & non-32_64 JITs into line with each other, callee in regT0. 11455 11456 * jit/JITOpcodes.cpp: 11457 (JSC::JIT::privateCompileCTIMachineTrampolines): 11458 11459 Rewrite call trampolines to not use the CodeBlock. 11460 11461 * jit/JITStubs.cpp: 11462 (JSC::DEFINE_STUB_FUNCTION): 11463 11464 Make call_JSFunction & call_arityCheck return the callee, don't expect to be passed the CodeBlock. 11465 11466 * runtime/Executable.cpp: 11467 (JSC::FunctionExecutable::generateBytecode): 11468 (JSC::FunctionExecutable::recompile): 11469 (JSC::FunctionExecutable::FunctionExecutable): 11470 * runtime/Executable.h: 11471 (JSC::ExecutableBase::): 11472 (JSC::ExecutableBase::ExecutableBase): 11473 (JSC::FunctionExecutable::isHostFunction): 11474 11475 Add m_numParameters. 11476 11477 * runtime/JSFunction.cpp: 11478 (JSC::JSFunction::~JSFunction): 11479 11480 Only call generatedBytecode() on JSFunctions non-host FunctionExecutables. 11481 114822009-08-20 Yongjun Zhang <yongjun.zhang@nokia.com> 11483 11484 Reviewed by Eric Seidel. 11485 11486 https://bugs.webkit.org/show_bug.cgi?id=28054 11487 11488 Use a helper function to work around winscw compiler forward declaration bug 11489 regarding templated classes. 11490 11491 Add parenthesis around (PassRefPtr::*UnspecifiedBoolType) to make winscw compiler 11492 work with the default UnSpecifiedBoolType() operator, which removes the winscw 11493 specific bool cast hack. 11494 11495 * wtf/PassRefPtr.h: 11496 (WTF::derefIfNotNull): 11497 (WTF::PassRefPtr::~PassRefPtr): 11498 114992009-08-19 Yong Li <yong.li@torchmobile.com> 11500 11501 Reviewed by Gavin Barraclough. 11502 11503 Change namespace ARM to ARMRegisters 11504 X86 to X86Registers to avoid conflict with macros 11505 https://bugs.webkit.org/show_bug.cgi?id=28428 11506 11507 * assembler/ARMAssembler.cpp: 11508 * assembler/ARMAssembler.h: 11509 * assembler/ARMv7Assembler.h: 11510 * assembler/MacroAssemblerARM.h: 11511 * assembler/MacroAssemblerARMv7.h: 11512 * assembler/MacroAssemblerX86Common.h: 11513 * assembler/MacroAssemblerX86_64.h: 11514 * assembler/X86Assembler.h: 11515 * jit/JIT.h: 11516 * jit/JITArithmetic.cpp: 11517 * jit/JITInlineMethods.h: 11518 * jit/JITOpcodes.cpp: 11519 * wrec/WRECGenerator.cpp: 11520 * wrec/WRECGenerator.h: 11521 * yarr/RegexJIT.cpp: 11522 115232009-08-19 Oliver Hunt <oliver@apple.com> 11524 11525 Reviewed by Gavin Barraclough. 11526 11527 Devirtualise marking 11528 https://bugs.webkit.org/show_bug.cgi?id=28294 11529 11530 We actually need to mark the value in a number object if we're using the 11531 32bit number representation. 11532 11533 * runtime/NumberObject.h: 11534 (JSC::NumberObject::createStructure): 11535 115362009-08-19 Gavin Barraclough <barraclough@apple.com> 11537 11538 Reviewed by Darin Adler. 11539 11540 We probably shouldn't be keeping the AST for eval nodes around forevar. 11541 https://bugs.webkit.org/show_bug.cgi?id=28469 11542 11543 EvalNodes don't destroyData() (delete their parser data) since they need to hold onto 11544 their varStack. Copy a list of variable onto EvalCodeBlock, and this can go away. 11545 11546 * bytecode/CodeBlock.h: 11547 (JSC::EvalCodeBlock::variable): 11548 (JSC::EvalCodeBlock::numVariables): 11549 (JSC::EvalCodeBlock::adoptVariables): 11550 * bytecompiler/BytecodeGenerator.cpp: 11551 (JSC::BytecodeGenerator::BytecodeGenerator): 11552 * interpreter/Interpreter.cpp: 11553 (JSC::Interpreter::execute): 11554 * parser/Nodes.h: 11555 * runtime/Executable.cpp: 11556 (JSC::EvalExecutable::generateBytecode): 11557 * runtime/Executable.h: 11558 115592009-08-19 Jungshik Shin <jshin@chromium.org> 11560 11561 Reviewed by Darin Adler. 11562 11563 http://bugs.webkit.org/show_bug.cgi?id=28441 11564 11565 Fix a build issue with ICU 4.2 or later on Windows with Visual C++. 11566 Instead of defining all isXXX and toupper/tolower as 11567 WTF_Please_use_ASCIICType_instead_of_ctype_see_comment_in_ASCIICType_h, 11568 #define them to be different by prepending 'WTF_...ASCIIType_h' with 11569 the originial names like 'toupper_WTF_...ASCIIType_h'. 11570 11571 * wtf/DisallowCType.h: 11572 115732009-08-18 Oliver Hunt <oliver@apple.com> 11574 11575 Reviewed by Gavin Barraclough. 11576 11577 Assigning a function to an object should always use the existing transition, even if the transition is not specialized 11578 https://bugs.webkit.org/show_bug.cgi?id=28442 11579 11580 Check for an unspecialized transition as an alternative to always failing if specialisation does not match. 11581 11582 * runtime/Structure.cpp: 11583 (JSC::Structure::addPropertyTransitionToExistingStructure): 11584 115852009-08-18 Dirk Schulze <krit@webkit.org> 11586 11587 Reviewed by Oliver Hunt. 11588 11589 Added additional getter to ByteArray with an unsigned char as return. 11590 ByteArray can take unsigned char directly now. 11591 11592 * wtf/ByteArray.h: 11593 (WTF::ByteArray::set): 11594 (WTF::ByteArray::get): 11595 115962009-08-18 Peter Kasting <pkasting@google.com> 11597 11598 Reviewed by Eric Seidel. 11599 11600 https://bugs.webkit.org/show_bug.cgi?id=28415 11601 Set svn:eol-style CRLF on all .sln and .vcproj files that don't already 11602 have it. 11603 11604 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: 11605 * JavaScriptCore.vcproj/testapi/testapi.vcproj: 11606 116072009-08-18 Xan Lopez <xlopez@igalia.com> 11608 11609 Try to fix the GTK+ build. 11610 11611 * GNUmakefile.am: 11612 116132009-08-17 Gavin Barraclough <barraclough@apple.com> 11614 11615 Reviewed by Sam Weinig. 11616 11617 No, silly runtime, AST nodes are not for you. 11618 11619 We still use AST nodes (ScopeNodes, particularly FunctionBodyNodes) within 11620 the runtime, which means that these nodes must be persisted outside of the 11621 arena, contain both parser & runtime data, etc. This is all a bit of a mess. 11622 11623 Move functionality into a new FunctionExecutable class. 11624 11625 * API/JSCallbackFunction.cpp: 11626 * API/JSObjectRef.cpp: 11627 * JavaScriptCore.exp: 11628 * JavaScriptCore.xcodeproj/project.pbxproj: 11629 * bytecode/CodeBlock.cpp: 11630 (JSC::CodeBlock::CodeBlock): 11631 (JSC::CodeBlock::markAggregate): 11632 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): 11633 (JSC::CodeBlock::lineNumberForBytecodeOffset): 11634 (JSC::CodeBlock::shrinkToFit): 11635 * bytecode/CodeBlock.h: 11636 (JSC::CodeBlock::getBytecodeIndex): 11637 (JSC::CodeBlock::discardBytecode): 11638 (JSC::CodeBlock::instructionCount): 11639 (JSC::CodeBlock::getJITCode): 11640 (JSC::CodeBlock::executablePool): 11641 (JSC::CodeBlock::ownerExecutable): 11642 (JSC::CodeBlock::extractExceptionInfo): 11643 (JSC::CodeBlock::addFunctionDecl): 11644 (JSC::CodeBlock::functionDecl): 11645 (JSC::CodeBlock::numberOfFunctionDecls): 11646 (JSC::CodeBlock::addFunctionExpr): 11647 (JSC::CodeBlock::functionExpr): 11648 (JSC::GlobalCodeBlock::GlobalCodeBlock): 11649 (JSC::ProgramCodeBlock::ProgramCodeBlock): 11650 (JSC::EvalCodeBlock::EvalCodeBlock): 11651 (JSC::FunctionCodeBlock::FunctionCodeBlock): 11652 (JSC::NativeCodeBlock::NativeCodeBlock): 11653 * bytecode/EvalCodeCache.h: 11654 * bytecode/SamplingTool.cpp: 11655 (JSC::SamplingTool::doRun): 11656 * bytecompiler/BytecodeGenerator.cpp: 11657 (JSC::BytecodeGenerator::BytecodeGenerator): 11658 (JSC::BytecodeGenerator::emitNewFunction): 11659 (JSC::BytecodeGenerator::emitNewFunctionExpression): 11660 * bytecompiler/BytecodeGenerator.h: 11661 * debugger/Debugger.cpp: 11662 (JSC::Debugger::recompileAllJSFunctions): 11663 * interpreter/CachedCall.h: 11664 (JSC::CachedCall::CachedCall): 11665 * interpreter/CallFrameClosure.h: 11666 * interpreter/Interpreter.cpp: 11667 (JSC::Interpreter::unwindCallFrame): 11668 (JSC::Interpreter::throwException): 11669 (JSC::Interpreter::execute): 11670 (JSC::Interpreter::prepareForRepeatCall): 11671 (JSC::Interpreter::debug): 11672 (JSC::Interpreter::privateExecute): 11673 (JSC::Interpreter::retrieveLastCaller): 11674 * interpreter/Interpreter.h: 11675 * jit/JIT.cpp: 11676 (JSC::JIT::privateCompile): 11677 * jit/JIT.h: 11678 (JSC::JIT::compile): 11679 * jit/JITOpcodes.cpp: 11680 (JSC::JIT::privateCompileCTIMachineTrampolines): 11681 (JSC::JIT::emit_op_new_func): 11682 (JSC::JIT::emit_op_new_func_exp): 11683 * jit/JITStubs.cpp: 11684 (JSC::DEFINE_STUB_FUNCTION): 11685 * jit/JITStubs.h: 11686 (JSC::): 11687 * parser/Nodes.cpp: 11688 (JSC::FunctionBodyNode::reparseDataIfNecessary): 11689 * parser/Nodes.h: 11690 (JSC::EvalNode::partialDestroyData): 11691 * parser/Parser.h: 11692 * profiler/ProfileGenerator.cpp: 11693 * profiler/Profiler.cpp: 11694 (JSC::Profiler::createCallIdentifier): 11695 (JSC::createCallIdentifierFromFunctionImp): 11696 * runtime/Arguments.h: 11697 (JSC::Arguments::getArgumentsData): 11698 (JSC::Arguments::Arguments): 11699 (JSC::JSActivation::copyRegisters): 11700 * runtime/ArrayPrototype.cpp: 11701 (JSC::isNumericCompareFunction): 11702 * runtime/CallData.h: 11703 (JSC::): 11704 * runtime/Collector.cpp: 11705 (JSC::Heap::collect): 11706 * runtime/ConstructData.h: 11707 (JSC::): 11708 * runtime/ExceptionHelpers.cpp: 11709 (JSC::createUndefinedVariableError): 11710 (JSC::createInvalidParamError): 11711 (JSC::createNotAConstructorError): 11712 (JSC::createNotAFunctionError): 11713 (JSC::createNotAnObjectError): 11714 * runtime/Executable.cpp: Added. 11715 (JSC::EvalExecutable::generateBytecode): 11716 (JSC::ProgramExecutable::generateBytecode): 11717 (JSC::FunctionExecutable::generateBytecode): 11718 (JSC::EvalExecutable::generateJITCode): 11719 (JSC::ProgramExecutable::generateJITCode): 11720 (JSC::FunctionExecutable::generateJITCode): 11721 (JSC::FunctionExecutable::isHostFunction): 11722 (JSC::FunctionExecutable::markAggregate): 11723 (JSC::FunctionExecutable::reparseExceptionInfo): 11724 (JSC::EvalExecutable::reparseExceptionInfo): 11725 (JSC::FunctionExecutable::recompile): 11726 (JSC::FunctionExecutable::FunctionExecutable): 11727 * runtime/Executable.h: 11728 (JSC::ExecutableBase::~ExecutableBase): 11729 (JSC::ExecutableBase::ExecutableBase): 11730 (JSC::ExecutableBase::source): 11731 (JSC::ExecutableBase::sourceID): 11732 (JSC::ExecutableBase::lastLine): 11733 (JSC::ExecutableBase::usesEval): 11734 (JSC::ExecutableBase::usesArguments): 11735 (JSC::ExecutableBase::needsActivation): 11736 (JSC::ExecutableBase::astNode): 11737 (JSC::ExecutableBase::generatedJITCode): 11738 (JSC::ExecutableBase::getExecutablePool): 11739 (JSC::EvalExecutable::EvalExecutable): 11740 (JSC::EvalExecutable::bytecode): 11741 (JSC::EvalExecutable::varStack): 11742 (JSC::EvalExecutable::evalNode): 11743 (JSC::EvalExecutable::jitCode): 11744 (JSC::ProgramExecutable::ProgramExecutable): 11745 (JSC::ProgramExecutable::reparseExceptionInfo): 11746 (JSC::ProgramExecutable::bytecode): 11747 (JSC::ProgramExecutable::programNode): 11748 (JSC::ProgramExecutable::jitCode): 11749 (JSC::FunctionExecutable::FunctionExecutable): 11750 (JSC::FunctionExecutable::name): 11751 (JSC::FunctionExecutable::bytecode): 11752 (JSC::FunctionExecutable::generatedBytecode): 11753 (JSC::FunctionExecutable::usesEval): 11754 (JSC::FunctionExecutable::usesArguments): 11755 (JSC::FunctionExecutable::parameterCount): 11756 (JSC::FunctionExecutable::paramString): 11757 (JSC::FunctionExecutable::isGenerated): 11758 (JSC::FunctionExecutable::body): 11759 (JSC::FunctionExecutable::jitCode): 11760 (JSC::FunctionExecutable::createNativeThunk): 11761 * runtime/FunctionConstructor.cpp: 11762 (JSC::constructFunction): 11763 * runtime/FunctionPrototype.cpp: 11764 (JSC::functionProtoFuncToString): 11765 * runtime/JSActivation.cpp: 11766 (JSC::JSActivation::JSActivation): 11767 (JSC::JSActivation::markChildren): 11768 (JSC::JSActivation::isDynamicScope): 11769 (JSC::JSActivation::argumentsGetter): 11770 * runtime/JSActivation.h: 11771 (JSC::JSActivation::JSActivationData::JSActivationData): 11772 * runtime/JSFunction.cpp: 11773 (JSC::JSFunction::isHostFunction): 11774 (JSC::JSFunction::JSFunction): 11775 (JSC::JSFunction::~JSFunction): 11776 (JSC::JSFunction::markChildren): 11777 (JSC::JSFunction::getCallData): 11778 (JSC::JSFunction::call): 11779 (JSC::JSFunction::lengthGetter): 11780 (JSC::JSFunction::getConstructData): 11781 (JSC::JSFunction::construct): 11782 * runtime/JSFunction.h: 11783 (JSC::JSFunction::executable): 11784 (JSC::FunctionExecutable::make): 11785 * runtime/JSGlobalData.cpp: 11786 (JSC::JSGlobalData::JSGlobalData): 11787 (JSC::JSGlobalData::numericCompareFunction): 11788 * runtime/JSGlobalData.h: 11789 117902009-08-17 Mark Rowe <mrowe@apple.com> 11791 11792 Reviewed by Darin Adler. 11793 11794 Fix 300,000+ leaks seen during the regression tests. 11795 11796 EvalCodeCache::get was heap-allocating an EvalExecutable instance without adopting the initial reference. 11797 While fixing this we noticed that EvalExecutable was a RefCounted type that was sometimes stack allocated. 11798 To make this cleaner and to prevent clients from attempting to ref a stack-allocated instance, we move the 11799 refcounting down to a new CacheableEvalExecutable class that derives from EvalExecutable. EvalCodeCache::get 11800 now uses CacheableEvalExecutable::create and avoids the leak. 11801 11802 * bytecode/EvalCodeCache.h: 11803 (JSC::EvalCodeCache::get): 11804 * interpreter/Interpreter.cpp: 11805 (JSC::Interpreter::callEval): 11806 * runtime/Executable.h: 11807 (JSC::CacheableEvalExecutable::create): 11808 (JSC::CacheableEvalExecutable::CacheableEvalExecutable): 11809 118102009-08-17 Oliver Hunt <oliver@apple.com> 11811 11812 RS=Mark Rowe. 11813 11814 REGRESSION (r47292): Prototype.js is broken by ES5 Arguments changes 11815 https://bugs.webkit.org/show_bug.cgi?id=28341 11816 <rdar://problem/7145615> 11817 11818 Reverting r47292. Alas Prototype.js breaks with Arguments inheriting 11819 from Array as ES5 attempted. Prototype.js defines $A in terms of a 11820 function it places on (among other global objects) the Array prototype, 11821 thus breaking $A for arrays. 11822 11823 * runtime/Arguments.h: 11824 (JSC::Arguments::Arguments): 11825 * runtime/JSGlobalObject.cpp: 11826 (JSC::JSGlobalObject::reset): 11827 (JSC::JSGlobalObject::markChildren): 11828 * runtime/JSGlobalObject.h: 11829 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): 11830 * runtime/ObjectPrototype.cpp: 11831 (JSC::ObjectPrototype::ObjectPrototype): 11832 * runtime/ObjectPrototype.h: 11833 * tests/mozilla/ecma_3/Function/arguments-001.js: 11834 118352009-08-17 Peter Kasting <pkasting@google.com> 11836 11837 Reviewed by Steve Falkenburg. 11838 11839 https://bugs.webkit.org/show_bug.cgi?id=27323 11840 Only add Cygwin to the path when it isn't already there. This avoids 11841 causing problems for people who purposefully have non-Cygwin versions of 11842 executables like svn in front of the Cygwin ones in their paths. 11843 11844 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: 11845 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: 11846 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: 11847 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: 11848 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: 11849 118502009-08-17 Xan Lopez <xlopez@igalia.com> 11851 11852 Reviewed by Mark Rowe. 11853 11854 Fix build with FAST_MALLOC_MATCH_VALIDATION enabled. 11855 11856 * wtf/FastMalloc.cpp: 11857 (WTF::fastMalloc): 11858 (WTF::fastCalloc): 11859 (WTF::fastRealloc): 11860 118612009-08-16 Holger Hans Peter Freyther <zecke@selfish.org> 11862 11863 Reviewed by Mark Rowe. 11864 11865 Fix crash on ./ecma_2/RegExp/exec-002.js. 11866 https://bugs.webkit.org/show_bug.cgi?id=28353 11867 11868 Change the order of freeParenthesesDisjunctionContext and 11869 popParenthesesDisjunctionContext on all call sites as the pop 11870 method is accessing backTrack->lastContext which is the context 11871 that is about to be freed. 11872 11873 * yarr/RegexInterpreter.cpp: 11874 (JSC::Yarr::Interpreter::parenthesesDoBacktrack): 11875 (JSC::Yarr::Interpreter::backtrackParentheses): 11876 118772009-08-16 Holger Hans Peter Freyther <zecke@selfish.org> 11878 11879 Reviewed by Mark Rowe. 11880 11881 https://bugs.webkit.org/show_bug.cgi?id=28352 11882 11883 Fix coding style violations. Use m_ for C++ class members. Remove 11884 trailing whitespace on empty lines. 11885 11886 * yarr/RegexInterpreter.cpp: 11887 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext): 11888 (JSC::Yarr::Interpreter::tryConsumeCharacter): 11889 (JSC::Yarr::Interpreter::tryConsumeBackReference): 11890 (JSC::Yarr::Interpreter::parenthesesDoBacktrack): 11891 (JSC::Yarr::Interpreter::backtrackParentheses): 11892 (JSC::Yarr::ByteCompiler::ByteCompiler): 11893 (JSC::Yarr::ByteCompiler::compile): 11894 (JSC::Yarr::ByteCompiler::checkInput): 11895 (JSC::Yarr::ByteCompiler::assertionBOL): 11896 (JSC::Yarr::ByteCompiler::assertionEOL): 11897 (JSC::Yarr::ByteCompiler::assertionWordBoundary): 11898 (JSC::Yarr::ByteCompiler::atomPatternCharacter): 11899 (JSC::Yarr::ByteCompiler::atomCharacterClass): 11900 (JSC::Yarr::ByteCompiler::atomBackReference): 11901 (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin): 11902 (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin): 11903 (JSC::Yarr::ByteCompiler::popParenthesesStack): 11904 (JSC::Yarr::ByteCompiler::closeAlternative): 11905 (JSC::Yarr::ByteCompiler::closeBodyAlternative): 11906 (JSC::Yarr::ByteCompiler::atomParenthesesEnd): 11907 (JSC::Yarr::ByteCompiler::regexBegin): 11908 (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction): 11909 (JSC::Yarr::ByteCompiler::alterantiveDisjunction): 11910 (JSC::Yarr::ByteCompiler::emitDisjunction): 11911 119122009-08-15 Mark Rowe <mrowe@apple.com> 11913 11914 Fix the build with JIT disabled. 11915 11916 * runtime/Arguments.h: Only compile the jitCode method when the JIT is enabled. 11917 * runtime/Executable.h: Include PrototypeFunction.h so the compiler knows what 11918 NativeFunctionWrapper is when the JIT is disabled. 11919 119202009-08-15 Adam Bergkvist <adam.bergkvist@ericsson.com> 11921 11922 Reviewed by Sam Weinig. 11923 11924 Added ENABLE_EVENTSOURCE flag. 11925 https://bugs.webkit.org/show_bug.cgi?id=14997 11926 11927 * Configurations/FeatureDefines.xcconfig: 11928 119292009-08-14 Gavin Barraclough <barraclough@apple.com> 11930 11931 * parser/Parser.h: 11932 (JSC::EvalExecutable::parse): 11933 (JSC::ProgramExecutable::parse): 11934 * runtime/Executable.h: 11935 119362009-08-14 Gavin Barraclough <barraclough@apple.com> 11937 11938 Reviewed by Oliver Hunt. 11939 11940 Remove AST nodes from use within the Runtime (outside of parsing), stage 1 11941 https://bugs.webkit.org/show_bug.cgi?id=28330 11942 11943 Remove the EvalNode and ProgramNode from use in the runtime. They still exist 11944 after this patch, but are hidden behind EvalExecutable and FunctionExecutable, 11945 and are also still reachable behind CodeBlock::m_ownerNode. 11946 11947 The next step will be to beat back FunctionBodyNode in the same fashion. 11948 Then remove the usage via CodeBlock, then only construct these nodes only on 11949 demand during bytecode generation. 11950 11951 * JavaScriptCore.xcodeproj/project.pbxproj: 11952 * bytecode/CodeBlock.h: 11953 (JSC::GlobalCodeBlock::GlobalCodeBlock): 11954 (JSC::GlobalCodeBlock::~GlobalCodeBlock): 11955 (JSC::ProgramCodeBlock::ProgramCodeBlock): 11956 (JSC::EvalCodeBlock::EvalCodeBlock): 11957 (JSC::FunctionCodeBlock::FunctionCodeBlock): 11958 (JSC::NativeCodeBlock::NativeCodeBlock): 11959 * bytecode/EvalCodeCache.h: 11960 (JSC::EvalCodeCache::get): 11961 * debugger/Debugger.cpp: 11962 (JSC::evaluateInGlobalCallFrame): 11963 * debugger/DebuggerCallFrame.cpp: 11964 (JSC::DebuggerCallFrame::evaluate): 11965 * interpreter/Interpreter.cpp: 11966 (JSC::Interpreter::callEval): 11967 (JSC::Interpreter::execute): 11968 * interpreter/Interpreter.h: 11969 * parser/Nodes.cpp: 11970 (JSC::FunctionBodyNode::createNativeThunk): 11971 (JSC::FunctionBodyNode::generateBytecode): 11972 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): 11973 * parser/Parser.h: 11974 (JSC::Parser::parse): 11975 (JSC::Parser::reparse): 11976 (JSC::Parser::parseFunctionFromGlobalCode): 11977 (JSC::::parse): 11978 * runtime/Completion.cpp: 11979 (JSC::checkSyntax): 11980 (JSC::evaluate): 11981 * runtime/Error.cpp: 11982 (JSC::throwError): 11983 * runtime/Error.h: 11984 * runtime/Executable.h: Added. 11985 (JSC::TemplateExecutable::TemplateExecutable): 11986 (JSC::TemplateExecutable::markAggregate): 11987 (JSC::TemplateExecutable::sourceURL): 11988 (JSC::TemplateExecutable::lineNo): 11989 (JSC::TemplateExecutable::bytecode): 11990 (JSC::TemplateExecutable::jitCode): 11991 (JSC::EvalExecutable::EvalExecutable): 11992 (JSC::ProgramExecutable::ProgramExecutable): 11993 * runtime/FunctionConstructor.cpp: 11994 (JSC::constructFunction): 11995 * runtime/FunctionConstructor.h: 11996 * runtime/JSGlobalData.cpp: 11997 (JSC::JSGlobalData::numericCompareFunction): 11998 * runtime/JSGlobalObject.cpp: 11999 (JSC::JSGlobalObject::~JSGlobalObject): 12000 (JSC::JSGlobalObject::markChildren): 12001 * runtime/JSGlobalObject.h: 12002 (JSC::JSGlobalObject::codeBlocks): 12003 * runtime/JSGlobalObjectFunctions.cpp: 12004 (JSC::globalFuncEval): 12005 120062009-08-14 Darin Adler <darin@apple.com> 12007 12008 Reviewed by Sam Weinig. 12009 12010 Rename the confusing isObject(<class>) to inherits(<class>). 12011 It still works on non-objects, returning false. 12012 12013 * runtime/ArrayConstructor.cpp: 12014 (JSC::arrayConstructorIsArray): Removed unneeded isObject call 12015 and updated remaining isObject call to new name, inherits. 12016 12017 * runtime/JSCell.h: Renamed isObject(<class>) to inherits(<class>) 12018 but more importantly, made it non-virtual (it was already inline) 12019 so it is now as fast as JSObject::inherits was. 12020 12021 * runtime/JSObject.h: Removed inherits function since the one 12022 in the base class is fine as-is. Also made various JSCell functions 12023 that should not be called on JSObject uncallable by making them 12024 both private and not implemented. 12025 (JSC::JSCell::inherits): Updated name. 12026 (JSC::JSValue::inherits): Ditto. 12027 12028 * debugger/Debugger.cpp: 12029 (JSC::Debugger::recompileAllJSFunctions): 12030 * interpreter/Interpreter.cpp: 12031 (JSC::Interpreter::unwindCallFrame): 12032 * runtime/ArrayPrototype.cpp: 12033 (JSC::arrayProtoFuncToString): 12034 (JSC::arrayProtoFuncToLocaleString): 12035 (JSC::arrayProtoFuncConcat): 12036 * runtime/BooleanPrototype.cpp: 12037 (JSC::booleanProtoFuncToString): 12038 (JSC::booleanProtoFuncValueOf): 12039 * runtime/DateConstructor.cpp: 12040 (JSC::constructDate): 12041 * runtime/DatePrototype.cpp: 12042 (JSC::dateProtoFuncToString): 12043 (JSC::dateProtoFuncToUTCString): 12044 (JSC::dateProtoFuncToISOString): 12045 (JSC::dateProtoFuncToDateString): 12046 (JSC::dateProtoFuncToTimeString): 12047 (JSC::dateProtoFuncToLocaleString): 12048 (JSC::dateProtoFuncToLocaleDateString): 12049 (JSC::dateProtoFuncToLocaleTimeString): 12050 (JSC::dateProtoFuncGetTime): 12051 (JSC::dateProtoFuncGetFullYear): 12052 (JSC::dateProtoFuncGetUTCFullYear): 12053 (JSC::dateProtoFuncToGMTString): 12054 (JSC::dateProtoFuncGetMonth): 12055 (JSC::dateProtoFuncGetUTCMonth): 12056 (JSC::dateProtoFuncGetDate): 12057 (JSC::dateProtoFuncGetUTCDate): 12058 (JSC::dateProtoFuncGetDay): 12059 (JSC::dateProtoFuncGetUTCDay): 12060 (JSC::dateProtoFuncGetHours): 12061 (JSC::dateProtoFuncGetUTCHours): 12062 (JSC::dateProtoFuncGetMinutes): 12063 (JSC::dateProtoFuncGetUTCMinutes): 12064 (JSC::dateProtoFuncGetSeconds): 12065 (JSC::dateProtoFuncGetUTCSeconds): 12066 (JSC::dateProtoFuncGetMilliSeconds): 12067 (JSC::dateProtoFuncGetUTCMilliseconds): 12068 (JSC::dateProtoFuncGetTimezoneOffset): 12069 (JSC::dateProtoFuncSetTime): 12070 (JSC::setNewValueFromTimeArgs): 12071 (JSC::setNewValueFromDateArgs): 12072 (JSC::dateProtoFuncSetYear): 12073 (JSC::dateProtoFuncGetYear): 12074 * runtime/FunctionPrototype.cpp: 12075 (JSC::functionProtoFuncToString): 12076 * runtime/JSActivation.cpp: 12077 (JSC::JSActivation::argumentsGetter): 12078 * runtime/JSValue.h: 12079 * runtime/RegExpConstructor.cpp: 12080 (JSC::constructRegExp): 12081 * runtime/RegExpPrototype.cpp: 12082 (JSC::regExpProtoFuncTest): 12083 (JSC::regExpProtoFuncExec): 12084 (JSC::regExpProtoFuncCompile): 12085 (JSC::regExpProtoFuncToString): 12086 * runtime/ScopeChain.cpp: 12087 (JSC::ScopeChain::localDepth): 12088 * runtime/StringPrototype.cpp: 12089 (JSC::stringProtoFuncReplace): 12090 (JSC::stringProtoFuncToString): 12091 (JSC::stringProtoFuncMatch): 12092 (JSC::stringProtoFuncSearch): 12093 (JSC::stringProtoFuncSplit): 12094 Updated to new name, inherits, from old name, isObject. 12095 120962009-07-31 Harald Fernengel <harald.fernengel@nokia.com> 12097 12098 Reviewed by Simon Hausmann. 12099 12100 Adding QNX as a platform. Currently only tested with Qt. 12101 12102 https://bugs.webkit.org/show_bug.cgi?id=27885 12103 12104 * JavaScriptCore/runtime/Collector.cpp: Added retrieving of stack base 12105 since QNX doesn't have the pthread _nt functions 12106 * JavaScriptCore/wtf/Platform.h: Added WTF_PLATFORM_QNX and corresponding 12107 defines 12108 * WebCore/bridge/npapi.h: Build fix for missing typedefs on QNX 12109 121102009-08-14 Gabor Loki <loki@inf.u-szeged.hu> 12111 12112 Reviewed by Simon Hausmann. 12113 12114 Currently generic ARM and ARMv7 platforms work only with JSVALUE32 12115 https://bugs.webkit.org/show_bug.cgi?id=28300 12116 12117 * wtf/Platform.h: 12118 121192009-08-14 Gabor Loki <loki@inf.u-szeged.hu> 12120 12121 Reviewed by Simon Hausmann. 12122 12123 Enable JIT on ARM for QT by default 12124 https://bugs.webkit.org/show_bug.cgi?id=28259 12125 12126 * wtf/Platform.h: 12127 121282009-08-14 Gabor Loki <loki@inf.u-szeged.hu> 12129 12130 Reviewed by Simon Hausmann. 12131 12132 Enable YARR_JIT on ARM for QT by default 12133 https://bugs.webkit.org/show_bug.cgi?id=28259 12134 12135 * wtf/Platform.h: 12136 121372009-08-14 Oliver Hunt <oliver@apple.com> 12138 12139 Reviewed by Gavin Barraclough. 12140 12141 [ES5] Arguments object should inherit from Array 12142 https://bugs.webkit.org/show_bug.cgi?id=28298 12143 12144 Make the Arguments object conform to the behaviour specified in ES5. 12145 The simple portion of this is to make Arguments use Array.prototype 12146 as its prototype rather than Object.prototype. 12147 12148 The spec then requires us to set instance.constructor to the pristine 12149 Object constructor, and instance.toString and instance.toLocaleString 12150 to the pristine versions from Object.prototype. To do this we now 12151 make the ObjectPrototype constructor return its toString and 12152 toLocaleString functions (similar to the call and apply functions 12153 from FunctionPrototype). 12154 12155 Oddly enough this reports itself as a slight win, but given the code 12156 isn't hit in the tests that claim to have improved I put this down to 12157 code motion. 12158 12159 * runtime/Arguments.h: 12160 (JSC::Arguments::Arguments): 12161 (JSC::Arguments::initializeStandardProperties): 12162 * runtime/JSGlobalObject.cpp: 12163 (JSC::JSGlobalObject::reset): 12164 (JSC::JSGlobalObject::markChildren): 12165 * runtime/JSGlobalObject.h: 12166 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): 12167 (JSC::JSGlobalObject::objectConstructor): 12168 (JSC::JSGlobalObject::objectToStringFunction): 12169 (JSC::JSGlobalObject::objectToLocaleStringFunction): 12170 * runtime/ObjectPrototype.cpp: 12171 (JSC::ObjectPrototype::ObjectPrototype): 12172 * runtime/ObjectPrototype.h: 12173 * tests/mozilla/ecma_3/Function/arguments-001.js: 12174 Update test to new es5 behaviour 12175 121762009-08-14 Oliver Hunt <oliver@apple.com> 12177 12178 Remove MarkStack::drain from the JSC exports file 12179 12180 MarkStack::drain is now marked inline, the including it in the exports file 12181 produces an ld warning 12182 12183 * JavaScriptCore.exp: 12184 121852009-08-13 Sam Weinig <sam@webkit.org> 12186 12187 Reviewed by Oliver Hunt. 12188 12189 Remove accidentally left in debugging statement. 12190 12191 * runtime/JSArray.h: 12192 (JSC::MarkStack::drain): 12193 121942009-08-13 Oliver Hunt <oliver@apple.com> 12195 12196 Reviewed by Maciej Stachowiak. 12197 12198 [ES5] Implement Array.isArray 12199 https://bugs.webkit.org/show_bug.cgi?id=28296 12200 12201 Add support for Array.isArray to the Array constructor 12202 12203 * runtime/ArrayConstructor.cpp: 12204 (JSC::ArrayConstructor::ArrayConstructor): 12205 (JSC::arrayConstructorIsArray): 12206 * runtime/ArrayConstructor.h: 12207 * runtime/CommonIdentifiers.h: 12208 * runtime/JSArray.h: 12209 (JSC::MarkStack::drain): 12210 * runtime/JSGlobalObject.cpp: 12211 (JSC::JSGlobalObject::reset): 12212 122132009-08-13 Oliver Hunt <oliver@apple.com> 12214 12215 Reviewed by NOBODY (Buildfix). 12216 12217 Attempt to fix windows build 12218 12219 * runtime/Collector.cpp: 12220 122212009-08-13 Oliver Hunt <oliver@apple.com> 12222 12223 Reviewed by Maciej Stachowiak. 12224 12225 Devirtualise marking 12226 https://bugs.webkit.org/show_bug.cgi?id=28294 12227 12228 Add a bit to TypeInfo to indicate that an object uses the standard 12229 JSObject::markChildren method. This allows us to devirtualise marking 12230 of most objects (though a branch is still needed). We also add a branch 12231 to identify arrays thus devirtualising marking in that case as well. 12232 12233 In order to make the best use of this devirtualisation I've also reworked 12234 the MarkStack::drain() logic to make the iteration more efficient. 12235 12236 * API/JSCallbackConstructor.h: 12237 (JSC::JSCallbackConstructor::createStructure): 12238 * API/JSCallbackFunction.h: 12239 (JSC::JSCallbackFunction::createStructure): 12240 * JavaScriptCore.exp: 12241 * runtime/BooleanObject.h: 12242 (JSC::BooleanObject::createStructure): 12243 * runtime/FunctionPrototype.h: 12244 (JSC::FunctionPrototype::createStructure): 12245 * runtime/InternalFunction.h: 12246 (JSC::InternalFunction::createStructure): 12247 * runtime/JSAPIValueWrapper.h: 12248 (JSC::JSAPIValueWrapper::JSAPIValueWrapper): 12249 * runtime/JSArray.cpp: 12250 (JSC::JSArray::markChildren): 12251 * runtime/JSArray.h: 12252 (JSC::JSArray::markChildrenDirect): 12253 (JSC::MarkStack::drain): 12254 * runtime/JSByteArray.cpp: 12255 (JSC::JSByteArray::createStructure): 12256 * runtime/JSCell.h: 12257 (JSC::MarkStack::append): 12258 * runtime/JSGlobalData.cpp: 12259 (JSC::JSGlobalData::JSGlobalData): 12260 * runtime/JSNumberCell.h: 12261 (JSC::JSNumberCell::createStructure): 12262 * runtime/JSONObject.h: 12263 (JSC::JSONObject::createStructure): 12264 * runtime/JSObject.cpp: 12265 (JSC::JSObject::markChildren): 12266 * runtime/JSObject.h: 12267 (JSC::JSObject::markChildrenDirect): 12268 (JSC::JSObject::createStructure): 12269 * runtime/JSString.h: 12270 (JSC::JSString::createStructure): 12271 * runtime/JSType.h: 12272 (JSC::): 12273 * runtime/MarkStack.h: 12274 (JSC::MarkStack::MarkStack): 12275 (JSC::MarkStack::MarkSet::MarkSet): 12276 (JSC::MarkStack::MarkStackArray::last): 12277 * runtime/MathObject.h: 12278 (JSC::MathObject::createStructure): 12279 * runtime/NumberConstructor.h: 12280 (JSC::NumberConstructor::createStructure): 12281 * runtime/NumberObject.h: 12282 (JSC::NumberObject::createStructure): 12283 * runtime/RegExpConstructor.h: 12284 (JSC::RegExpConstructor::createStructure): 12285 * runtime/RegExpObject.h: 12286 (JSC::RegExpObject::createStructure): 12287 * runtime/StringObjectThatMasqueradesAsUndefined.h: 12288 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 12289 * runtime/TypeInfo.h: 12290 (JSC::TypeInfo::hasDefaultMark): 12291 122922009-08-13 Darin Adler <darin@apple.com> 12293 12294 Reviewed by Mark Rowe. 12295 12296 Some small bits of housekeeping. 12297 12298 * JavaScriptCore.xcodeproj/project.pbxproj: Make Parser.h 12299 project instead of private. Remove JSONObject.lut.h. 12300 12301 * assembler/ARMAssembler.h: Remove unneeded WTF prefix. 12302 * assembler/AssemblerBufferWithConstantPool.h: Ditto. 12303 * bytecompiler/BytecodeGenerator.h: Ditto. 12304 12305 * wtf/SegmentedVector.h: Add a "using" statement as we do 12306 with the other WTF headers. 12307 123082009-08-13 Darin Adler <darin@apple.com> 12309 12310 Fix Tiger build. 12311 12312 * parser/Grammar.y: Use a template function so we can compile 12313 setStatementLocation even if it comes before YYLTYPE is defined. 12314 123152009-08-13 Darin Adler <darin@apple.com> 12316 12317 Reviewed by George Staikos. 12318 12319 Too much use of void* in Grammar.y 12320 https://bugs.webkit.org/show_bug.cgi?id=28287 12321 12322 * parser/Grammar.y: Changed all the helper functions to 12323 take a JSGlobalData* instead of a void*. A couple formatting 12324 tweaks that I missed when breaking this into pieces. 12325 123262009-08-13 Darin Adler <darin@apple.com> 12327 12328 Reviewed by George Staikos. 12329 12330 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 12331 12332 * parser/Grammar.y: Reduced and sorted includes. Tweaked comment 12333 format. Marked a few more functions inline. 12334 123352009-08-13 Darin Adler <darin@apple.com> 12336 12337 Reviewed by George Staikos. 12338 12339 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 12340 12341 * parser/Grammar.y: Pass the number to the PropertyNode instead of 12342 first turning it into an Identifier. 12343 12344 * parser/NodeConstructors.h: 12345 (JSC::PropertyNode::PropertyNode): Add an overload that takes a double 12346 so the code to convert to a string can be here instead of Grammar.y. 12347 * parser/Nodes.h: Ditto. 12348 123492009-08-13 Darin Adler <darin@apple.com> 12350 12351 Reviewed by George Staikos. 12352 12353 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 12354 12355 * parser/Grammar.y: Eliminate the DBG macro. 12356 123572009-08-13 Darin Adler <darin@apple.com> 12358 12359 Reviewed by George Staikos. 12360 12361 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 12362 12363 * parser/Grammar.y: Eliminate the SET_EXCEPTION_LOCATION macro. 12364 123652009-08-13 Darin Adler <darin@apple.com> 12366 12367 Reviewed by George Staikos. 12368 12369 George asked me to break the patch from 12370 https://bugs.webkit.org/show_bug.cgi?id=28287 12371 into smaller pieces and land it in stages. 12372 12373 * parser/Grammar.y: Eliminate the LEXER macro. 12374 123752009-08-13 Mark Rowe <mrowe@apple.com> 12376 12377 Try some more to fix the Windows build. 12378 12379 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol. 12380 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto. 12381 123822009-08-13 Mark Rowe <mrowe@apple.com> 12383 12384 Try and fix the Windows build. 12385 12386 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol. 12387 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto. 12388 123892009-08-13 Darin Adler <darin@apple.com> 12390 12391 Reviewed by David Levin. 12392 12393 JavaScriptCore tweaks to get ready for the parser arena 12394 https://bugs.webkit.org/show_bug.cgi?id=28243 12395 12396 Eliminate dependencies on Nodes.h outside JavaScriptCore, 12397 and cut down on them inside JavaScriptCore. 12398 12399 Change regular expression parsing to use identifiers as 12400 with other strings we parse. 12401 12402 Fix a couple things that are needed to use const Identifier 12403 more, which will be part of the parser arena work. 12404 12405 * JavaScriptCore.exp: Resorted and updated. 12406 12407 * JavaScriptCore.xcodeproj/project.pbxproj: Changed 12408 CollectorHeapIterator.h to be project-internal. 12409 12410 * bytecompiler/BytecodeGenerator.cpp: 12411 (JSC::BytecodeGenerator::emitPushNewScope): Added const. 12412 * bytecompiler/BytecodeGenerator.h: Ditto. 12413 12414 * debugger/Debugger.cpp: 12415 (JSC::Debugger::recompileAllJSFunctions): Moved this function 12416 here from WebCore. Here is better since it uses so many internals. 12417 Removed unimportant optimization for the no listener case. 12418 * debugger/Debugger.h: Ditto. Also removed unneeded include 12419 and tweaked formatting and comments. 12420 12421 * debugger/DebuggerCallFrame.cpp: 12422 (JSC::DebuggerCallFrame::functionName): Call asFunction instead 12423 of doing the unchecked static_cast. 12424 (JSC::DebuggerCallFrame::calculatedFunctionName): Ditto. 12425 12426 * jit/JITStubs.cpp: 12427 (JSC::op_call_JSFunction): Call isHostFunction on the body rather 12428 than on the JSFunction. 12429 (JSC::vm_lazyLinkCall): Ditto. 12430 (JSC::op_construct_JSConstruct): Ditto. 12431 12432 * parser/Grammar.y: Changed callers to use new scanRegExp with 12433 out arguments instead of relying on state in the Lexer. And 12434 callers that just want to skip a regular expression to use 12435 skipRegExp. 12436 12437 * parser/Lexer.cpp: 12438 (JSC::Lexer::scanRegExp): Changed to use out arguments, and to 12439 add a prefix argument so we can add in the "=" character as needed. 12440 Also rewrote to streamline the logic a bit inspired by suggestions 12441 by David Levin. 12442 (JSC::Lexer::skipRegExp): Added. Version of the function above that 12443 does not actually put the regular expression into a string. 12444 (JSC::Lexer::clear): Removed code to clear m_pattern and m_flags. 12445 * parser/Lexer.h: Changed scanRegExp to have out arguments. Added 12446 skipRegExp. Eliminated pattern, flags, m_pattern, and m_flags. 12447 12448 * parser/NodeConstructors.h: 12449 (JSC::RegExpNode::RegExpNode): Changed to take const Identifier&. 12450 * parser/Nodes.cpp: 12451 (JSC::RegExpNode::emitBytecode): Changed since m_pattern and 12452 m_flags are now Identifier instead of UString. 12453 (JSC::FunctionBodyNode::make): Moved this function here instead 12454 of putting it in the JSFunction.h header. 12455 * parser/Nodes.h: Changed RegExpNode to use Identifier. 12456 12457 * profiler/Profiler.cpp: 12458 (JSC::Profiler::createCallIdentifier): Changed to use isHostFunction 12459 on the body instead of on the JSFunction object. 12460 * runtime/FunctionPrototype.cpp: 12461 (JSC::functionProtoFuncToString): Ditto. 12462 12463 * runtime/JSFunction.cpp: 12464 (JSC::JSFunction::isHostFunction): Moved here from header. 12465 (JSC::JSFunction::isHostFunctionNonInline): Added. 12466 (JSC::JSFunction::JSFunction): Removed unneeded initialization of 12467 m_body to 0. 12468 (JSC::JSFunction::setBody): Moved here from header. 12469 12470 * runtime/JSFunction.h: Removed unneeded includes. Moved private 12471 constructor down to the private section. Made virtual functions 12472 private. Removed unneeded overload of setBody and moved the body 12473 of the function into the .cpp file. Changed assertions to use 12474 the non-inline version of isHostFunction. 12475 12476 * runtime/PropertySlot.cpp: 12477 (JSC::PropertySlot::functionGetter): Use asFunction instead 12478 of doing the unchecked static_cast. 12479 12480 * wtf/SegmentedVector.h: 12481 (WTF::SegmentedVector::isEmpty): Added. 12482 124832009-08-13 Mark Rowe <mrowe@apple.com> 12484 12485 Rubber-stamped by Darin Adler. 12486 12487 Use the version of operator new that takes a JSGlobalData when allocating FuncDeclNode and FuncExprNode 12488 from within the grammar to prevent these nodes from being leaked. 12489 12490 * parser/Grammar.y: 12491 124922009-08-13 Simon Hausmann <simon.hausmann@nokia.com> 12493 12494 Reviewed by Ariya Hidayat. 12495 12496 Remove the special-case for Qt wrt JSVALUE_32 introduced in 12497 r46709. It must've been a dependency issue on the bot, as 12498 after a manual build all the tests pass on amd64 and ia32. 12499 12500 * wtf/Platform.h: 12501 125022009-08-12 Gabor Loki <loki@inf.u-szeged.hu> 12503 12504 Reviewed by Gavin Barraclough. 12505 12506 Add optimize call and property access support for ARM JIT. 12507 https://bugs.webkit.org/show_bug.cgi?id=24986 12508 12509 For tightly coupled sequences the BEGIN_UNINTERRUPTED_SEQUENCE and 12510 END_UNINTERRUPTED_SEQUENCE macros have been introduced which ensure 12511 space for instructions and constants of the named sequence. This 12512 method is vital for those architecture which are using constant pool. 12513 12514 The 'latePatch' method - which was linked to JmpSrc - is replaced with 12515 a port specific solution (each calls are marked to place their address 12516 on the constant pool). 12517 12518 * assembler/ARMAssembler.cpp: 12519 (JSC::ARMAssembler::linkBranch): 12520 (JSC::ARMAssembler::executableCopy): Add extra align for constant pool. 12521 * assembler/ARMAssembler.h: 12522 (JSC::ARMAssembler::JmpSrc::JmpSrc): 12523 (JSC::ARMAssembler::sizeOfConstantPool): 12524 (JSC::ARMAssembler::jmp): 12525 (JSC::ARMAssembler::linkCall): 12526 * assembler/ARMv7Assembler.h: 12527 * assembler/AbstractMacroAssembler.h: 12528 * assembler/AssemblerBufferWithConstantPool.h: 12529 (JSC::AssemblerBufferWithConstantPool::flushIfNoSpaceFor): Fix the 12530 computation of the remaining space. 12531 * assembler/MacroAssemblerARM.h: 12532 (JSC::MacroAssemblerARM::branch32): 12533 (JSC::MacroAssemblerARM::nearCall): 12534 (JSC::MacroAssemblerARM::call): 12535 (JSC::MacroAssemblerARM::branchPtrWithPatch): 12536 (JSC::MacroAssemblerARM::ensureSpace): 12537 (JSC::MacroAssemblerARM::sizeOfConstantPool): 12538 (JSC::MacroAssemblerARM::prepareCall): 12539 * assembler/X86Assembler.h: 12540 * jit/JIT.h: 12541 * jit/JITCall.cpp: 12542 (JSC::JIT::compileOpCall): 12543 * jit/JITInlineMethods.h: 12544 (JSC::JIT::beginUninterruptedSequence): 12545 (JSC::JIT::endUninterruptedSequence): 12546 * jit/JITPropertyAccess.cpp: 12547 (JSC::JIT::emit_op_method_check): 12548 (JSC::JIT::compileGetByIdHotPath): 12549 (JSC::JIT::compileGetByIdSlowCase): 12550 (JSC::JIT::emit_op_put_by_id): 12551 125522009-08-12 Gavin Barraclough <barraclough@apple.com> 12553 12554 Rubber Stamped by Dave Kilzer. 12555 12556 Disable WTF_USE_JSVALUE32_64 on iPhone for now (support not yet added for ARMv7). 12557 12558 * wtf/Platform.h: 12559 125602009-08-12 Gavin Barraclough <barraclough@apple.com> 12561 12562 Reviewed by Maciej Stachoviak. 12563 12564 Ooops - moved code that had been accidentally added to op_new_func instead of 12565 op_new_func_exp, to where it shoulds be. 12566 12567 * interpreter/Interpreter.cpp: 12568 (JSC::Interpreter::privateExecute): 12569 * wtf/Platform.h: 12570 125712009-08-12 Ada Chan <adachan@apple.com> 12572 12573 Added workaround for the limitation that VirtualFree with MEM_RELEASE 12574 can only accept the base address returned by VirtualAlloc when the region 12575 was reserved and it can only free the entire region, and not a part of it. 12576 12577 Reviewed by Oliver Hunt. 12578 12579 * runtime/MarkStack.h: 12580 (JSC::MarkStack::MarkStackArray::shrinkAllocation): 12581 * runtime/MarkStackWin.cpp: 12582 (JSC::MarkStack::releaseStack): 12583 125842009-08-12 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> 12585 12586 Reviewed by Ariya Hidayat. 12587 12588 Build fix: use std::numeric_limits<long long>::min() instead of LLONG_MIN 12589 since LLONG_MIN is not defined in standard c++. 12590 12591 * runtime/UString.cpp: 12592 (JSC::UString::from): 12593 125942009-08-12 Benjamin Otte <otte@gnome.org> 12595 12596 Reviewed by Jan Alonzo. 12597 12598 Buildfix for Gtk platforms debug builds. 12599 12600 * GNUmakefile.am: Choose MarkStackPosix.cpp or MarkStackWin.cpp 12601 depending on platform. 12602 126032009-08-12 Simon Hausmann <simon.hausmann@nokia.com> 12604 12605 Prospective build fix for Mac and 32-bit Windows. 12606 12607 * runtime/UString.cpp: Include wtf/StringExtras.h for snprintf. 12608 (JSC::UString::from): Use %lld instead of %I64d for snprintf 12609 on non-windows platforms. 12610 126112009-08-12 Prasanth Ullattil <prasanth.ullattil@nokia.com> 12612 12613 Reviewed by Simon Hausmann. 12614 12615 Fix compile error on 64Bit Windows, when UString::from 12616 is called with an intptr_t. 12617 12618 Added new UString::From overload with long long parameter. 12619 12620 Thanks to Holger for the long long idea. 12621 12622 * runtime/UString.cpp: 12623 (JSC::UString::from): 12624 * runtime/UString.h: 12625 126262009-08-11 Oliver Hunt <oliver@apple.com> 12627 12628 Reviewed by Mark Rowe. 12629 12630 Minor style fixes. 12631 12632 * runtime/UString.h: 12633 (JSC::UString::Rep::createEmptyBuffer): 12634 * wtf/FastMalloc.h: 12635 (WTF::TryMallocReturnValue::getValue): 12636 126372009-08-11 Oliver Hunt <oliver@apple.com> 12638 12639 Reviewed by Gavin Barraclough. 12640 12641 Make it harder to misuse try* allocation routines 12642 https://bugs.webkit.org/show_bug.cgi?id=27469 12643 12644 Jump through a few hoops to make it much harder to accidentally 12645 miss null-checking of values returned by the try-* allocation 12646 routines. 12647 12648 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 12649 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 12650 * JavaScriptCore.xcodeproj/project.pbxproj: 12651 * runtime/JSArray.cpp: 12652 (JSC::JSArray::putSlowCase): 12653 (JSC::JSArray::increaseVectorLength): 12654 * runtime/StringPrototype.cpp: 12655 (JSC::stringProtoFuncFontsize): 12656 (JSC::stringProtoFuncLink): 12657 * runtime/UString.cpp: 12658 (JSC::allocChars): 12659 (JSC::reallocChars): 12660 (JSC::expandCapacity): 12661 (JSC::UString::Rep::reserveCapacity): 12662 (JSC::UString::expandPreCapacity): 12663 (JSC::createRep): 12664 (JSC::concatenate): 12665 (JSC::UString::spliceSubstringsWithSeparators): 12666 (JSC::UString::replaceRange): 12667 (JSC::UString::append): 12668 (JSC::UString::operator=): 12669 * runtime/UString.h: 12670 (JSC::UString::Rep::createEmptyBuffer): 12671 * wtf/FastMalloc.cpp: 12672 (WTF::tryFastZeroedMalloc): 12673 (WTF::tryFastMalloc): 12674 (WTF::tryFastCalloc): 12675 (WTF::tryFastRealloc): 12676 (WTF::TCMallocStats::tryFastMalloc): 12677 (WTF::TCMallocStats::tryFastCalloc): 12678 (WTF::TCMallocStats::tryFastRealloc): 12679 * wtf/FastMalloc.h: 12680 (WTF::TryMallocReturnValue::TryMallocReturnValue): 12681 (WTF::TryMallocReturnValue::~TryMallocReturnValue): 12682 (WTF::TryMallocReturnValue::operator PossiblyNull<T>): 12683 (WTF::TryMallocReturnValue::getValue): 12684 * wtf/Platform.h: 12685 * wtf/PossiblyNull.h: Added. 12686 (WTF::PossiblyNull::PossiblyNull): 12687 (WTF::PossiblyNull::~PossiblyNull): 12688 (WTF::::getValue): 12689 126902009-08-11 Gavin Barraclough <barraclough@apple.com> 12691 12692 Reviewed by NOBODY (build fix part deux). 12693 12694 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 12695 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 12696 126972009-08-11 Gavin Barraclough <barraclough@apple.com> 12698 12699 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 12700 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 12701 127022009-08-11 Gavin Barraclough <barraclough@apple.com> 12703 12704 Reviewed by Oliver Hunt. 12705 12706 Restrict use of FuncDeclNode & FuncExprNode to the parser. 12707 https://bugs.webkit.org/show_bug.cgi?id=28209 12708 12709 These objects were also being referenced from the CodeBlock. By changing this 12710 to just retain pointers to FunctionBodyNodes these classes can be restricted to 12711 use during parsing. 12712 12713 No performance impact (or sub-percent progression). 12714 12715 * JavaScriptCore.exp: 12716 Update symbols. 12717 12718 * bytecode/CodeBlock.cpp: 12719 (JSC::CodeBlock::mark): 12720 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): 12721 (JSC::CodeBlock::shrinkToFit): 12722 * bytecode/CodeBlock.h: 12723 (JSC::CodeBlock::addFunction): 12724 (JSC::CodeBlock::function): 12725 Unify m_functions & m_functionExpressions into a single Vector<RefPtr<FuncExprNode> >. 12726 12727 * bytecompiler/BytecodeGenerator.cpp: 12728 (JSC::BytecodeGenerator::BytecodeGenerator): 12729 (JSC::BytecodeGenerator::addConstant): 12730 (JSC::BytecodeGenerator::emitNewFunction): 12731 (JSC::BytecodeGenerator::emitNewFunctionExpression): 12732 * bytecompiler/BytecodeGenerator.h: 12733 FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes. 12734 12735 * interpreter/Interpreter.cpp: 12736 (JSC::Interpreter::execute): 12737 (JSC::Interpreter::privateExecute): 12738 Update to reflect chnages in CodeBlock. 12739 12740 * jit/JITOpcodes.cpp: 12741 (JSC::JIT::emit_op_new_func_exp): 12742 * jit/JITStubs.cpp: 12743 (JSC::DEFINE_STUB_FUNCTION): 12744 * jit/JITStubs.h: 12745 (JSC::): 12746 Update to reflect chnages in CodeBlock. 12747 12748 * parser/Grammar.y: 12749 FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes. 12750 12751 * parser/NodeConstructors.h: 12752 (JSC::FuncExprNode::FuncExprNode): 12753 (JSC::FuncDeclNode::FuncDeclNode): 12754 * parser/Nodes.cpp: 12755 (JSC::ScopeNodeData::mark): 12756 (JSC::FunctionBodyNode::finishParsing): 12757 * parser/Nodes.h: 12758 (JSC::FunctionBodyNode::ident): 12759 Move m_ident & make methods from FuncDeclNode & FuncExprNode to FunctionBodyNode. 12760 12761 * runtime/JSFunction.h: 12762 (JSC::FunctionBodyNode::make): 12763 Make this method inline (was FuncDeclNode::makeFunction). 12764 127652009-08-11 Oliver Hunt <oliver@apple.com> 12766 12767 Reviewed by Gavin Barraclough. 12768 12769 Native JSON.stringify does not omit functions 12770 https://bugs.webkit.org/show_bug.cgi?id=28117 12771 12772 Objects that are callable should be treated as undefined when 12773 serialising to JSON. 12774 12775 * runtime/JSONObject.cpp: 12776 (JSC::Stringifier::appendStringifiedValue): 12777 127782009-08-11 Oliver Hunt <oliver@apple.com> 12779 12780 Reviewed by Geoff Garen. 12781 12782 REGRESSION: Hang/crash in BytecodeGenerator::constRegisterFor loading simple page 12783 https://bugs.webkit.org/show_bug.cgi?id=28169 12784 12785 Handle the case where someone has attempted to shadow a property 12786 on the global object with a constant. 12787 12788 * bytecompiler/BytecodeGenerator.cpp: 12789 (JSC::BytecodeGenerator::constRegisterFor): 12790 * parser/Nodes.cpp: 12791 (JSC::ConstDeclNode::emitCodeSingle): 12792 127932009-08-11 John Gregg <johnnyg@google.com> 12794 12795 Reviewed by Maciej Stachowiak. 12796 12797 Desktop Notifications API 12798 https://bugs.webkit.org/show_bug.cgi?id=25463 12799 12800 Adds ENABLE_NOTIFICATION flag. 12801 12802 * Configurations/FeatureDefines.xcconfig: 12803 * wtf/Platform.h: 12804 128052009-08-11 Maxime Simon <simon.maxime@gmail.com> 12806 12807 Reviewed by Eric Seidel. 12808 12809 Modifications on JavaScriptCore to allow Haiku port. 12810 https://bugs.webkit.org/show_bug.cgi?id=28121 12811 12812 * runtime/Collector.cpp: Haiku doesn't have sys/mman.h, using OS.h instead. 12813 (JSC::currentThreadStackBase): Haiku uses its own threading system. 12814 * wtf/Platform.h: Defining all Haiku platform values. 12815 * wtf/haiku/MainThreadHaiku.cpp: Adding a missing header (NotImplemented.h). 12816 128172009-08-11 Jessie Berlin <jberlin@apple.com> 12818 12819 Reviewed by Adam Roben. 12820 12821 Fix windows build. 12822 12823 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 12824 128252009-08-11 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 12826 12827 Reviewed by Tor Arne Vestbø. 12828 12829 Buildfix for Qt-win platforms. 12830 12831 * JavaScriptCore.pri: Choose MarkStackPosix.cpp or MarkStackWin.cpp depend on platform. 12832 128332009-08-10 Oliver Hunt <oliver@apple.com> 12834 12835 Reviewed by NOBODY (And another build fix). 12836 12837 Add new exports for MSVC 12838 12839 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 12840 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 12841 * JavaScriptCore.xcodeproj/project.pbxproj: 12842 128432009-08-10 Oliver Hunt <oliver@apple.com> 12844 12845 Reviewed by NOBODY (yet another build fix). 12846 12847 Remove obsolete entries from MSVC exports file 12848 12849 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 12850 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 12851 128522009-08-10 Oliver Hunt <oliver@apple.com> 12853 12854 Add includes needed for non-allinonefile builds 12855 12856 * runtime/GetterSetter.h: 12857 * runtime/ScopeChain.h: 12858 128592009-08-10 Oliver Hunt <oliver@apple.com> 12860 12861 Fix export file for last build fix 12862 12863 * JavaScriptCore.exp: 12864 128652009-08-10 Oliver Hunt <oliver@apple.com> 12866 12867 Hoist page size initialization into platform specific code. 12868 12869 * jit/ExecutableAllocatorPosix.cpp: 12870 * jit/ExecutableAllocatorWin.cpp: 12871 * runtime/MarkStack.h: 12872 (JSC::MarkStack::pageSize): 12873 * runtime/MarkStackPosix.cpp: 12874 (JSC::MarkStack::initializePagesize): 12875 * runtime/MarkStackWin.cpp: 12876 (JSC::MarkStack::initializePagesize): 12877 128782009-08-07 Oliver Hunt <oliver@apple.com> 12879 12880 Reviewed by Gavin Barraclough. 12881 12882 Stack overflow crash in JavaScript garbage collector mark pass 12883 https://bugs.webkit.org/show_bug.cgi?id=12216 12884 12885 Make the GC mark phase iterative by using an explicit mark stack. 12886 To do this marking any single object is performed in multiple stages 12887 * The object is appended to the MarkStack, this sets the marked 12888 bit for the object using the new markDirect() function, and then 12889 returns 12890 * When the MarkStack is drain()ed the object is popped off the stack 12891 and markChildren(MarkStack&) is called on the object to collect 12892 all of its children. drain() then repeats until the stack is empty. 12893 12894 Additionally I renamed a number of methods from 'mark' to 'markAggregate' 12895 in order to make it more clear that marking of those object was not 12896 going to result in an actual recursive mark. 12897 12898 * GNUmakefile.am 12899 * JavaScriptCore.exp: 12900 * JavaScriptCore.gypi: 12901 * JavaScriptCore.pri: 12902 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 12903 * JavaScriptCore.xcodeproj/project.pbxproj: 12904 * bytecode/CodeBlock.cpp: 12905 (JSC::CodeBlock::markAggregate): 12906 * bytecode/CodeBlock.h: 12907 * bytecode/EvalCodeCache.h: 12908 (JSC::EvalCodeCache::markAggregate): 12909 * debugger/DebuggerActivation.cpp: 12910 (JSC::DebuggerActivation::markChildren): 12911 * debugger/DebuggerActivation.h: 12912 * interpreter/Register.h: 12913 * interpreter/RegisterFile.h: 12914 (JSC::RegisterFile::markGlobals): 12915 (JSC::RegisterFile::markCallFrames): 12916 * parser/Nodes.cpp: 12917 (JSC::ScopeNodeData::markAggregate): 12918 (JSC::EvalNode::markAggregate): 12919 (JSC::FunctionBodyNode::markAggregate): 12920 * parser/Nodes.h: 12921 (JSC::ScopeNode::markAggregate): 12922 * runtime/ArgList.cpp: 12923 (JSC::MarkedArgumentBuffer::markLists): 12924 * runtime/ArgList.h: 12925 * runtime/Arguments.cpp: 12926 (JSC::Arguments::markChildren): 12927 * runtime/Arguments.h: 12928 * runtime/Collector.cpp: 12929 (JSC::Heap::markConservatively): 12930 (JSC::Heap::markCurrentThreadConservativelyInternal): 12931 (JSC::Heap::markCurrentThreadConservatively): 12932 (JSC::Heap::markOtherThreadConservatively): 12933 (JSC::Heap::markStackObjectsConservatively): 12934 (JSC::Heap::markProtectedObjects): 12935 (JSC::Heap::collect): 12936 * runtime/Collector.h: 12937 * runtime/GetterSetter.cpp: 12938 (JSC::GetterSetter::markChildren): 12939 * runtime/GetterSetter.h: 12940 (JSC::GetterSetter::GetterSetter): 12941 (JSC::GetterSetter::createStructure): 12942 * runtime/GlobalEvalFunction.cpp: 12943 (JSC::GlobalEvalFunction::markChildren): 12944 * runtime/GlobalEvalFunction.h: 12945 * runtime/JSActivation.cpp: 12946 (JSC::JSActivation::markChildren): 12947 * runtime/JSActivation.h: 12948 * runtime/JSArray.cpp: 12949 (JSC::JSArray::markChildren): 12950 * runtime/JSArray.h: 12951 * runtime/JSCell.h: 12952 (JSC::JSCell::markCellDirect): 12953 (JSC::JSCell::markChildren): 12954 (JSC::JSValue::markDirect): 12955 (JSC::JSValue::markChildren): 12956 (JSC::JSValue::hasChildren): 12957 (JSC::MarkStack::append): 12958 (JSC::MarkStack::drain): 12959 * runtime/JSFunction.cpp: 12960 (JSC::JSFunction::markChildren): 12961 * runtime/JSFunction.h: 12962 * runtime/JSGlobalData.cpp: 12963 (JSC::JSGlobalData::JSGlobalData): 12964 * runtime/JSGlobalData.h: 12965 * runtime/JSGlobalObject.cpp: 12966 (JSC::markIfNeeded): 12967 (JSC::JSGlobalObject::markChildren): 12968 * runtime/JSGlobalObject.h: 12969 * runtime/JSNotAnObject.cpp: 12970 (JSC::JSNotAnObject::markChildren): 12971 * runtime/JSNotAnObject.h: 12972 * runtime/JSONObject.cpp: 12973 (JSC::Stringifier::markAggregate): 12974 (JSC::JSONObject::markStringifiers): 12975 * runtime/JSONObject.h: 12976 * runtime/JSObject.cpp: 12977 (JSC::JSObject::markChildren): 12978 (JSC::JSObject::defineGetter): 12979 (JSC::JSObject::defineSetter): 12980 * runtime/JSObject.h: 12981 * runtime/JSPropertyNameIterator.cpp: 12982 (JSC::JSPropertyNameIterator::markChildren): 12983 * runtime/JSPropertyNameIterator.h: 12984 (JSC::JSPropertyNameIterator::createStructure): 12985 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 12986 (JSC::JSPropertyNameIterator::create): 12987 * runtime/JSStaticScopeObject.cpp: 12988 (JSC::JSStaticScopeObject::markChildren): 12989 * runtime/JSStaticScopeObject.h: 12990 * runtime/JSType.h: 12991 (JSC::): 12992 * runtime/JSValue.h: 12993 * runtime/JSWrapperObject.cpp: 12994 (JSC::JSWrapperObject::markChildren): 12995 * runtime/JSWrapperObject.h: 12996 * runtime/MarkStack.cpp: Added. 12997 (JSC::MarkStack::compact): 12998 * runtime/MarkStack.h: Added. 12999 (JSC::): 13000 (JSC::MarkStack::MarkStack): 13001 (JSC::MarkStack::append): 13002 (JSC::MarkStack::appendValues): 13003 (JSC::MarkStack::~MarkStack): 13004 (JSC::MarkStack::MarkSet::MarkSet): 13005 (JSC::MarkStack::pageSize): 13006 13007 MarkStackArray is a non-shrinking, mmap-based vector type 13008 used for storing objects to be marked. 13009 (JSC::MarkStack::MarkStackArray::MarkStackArray): 13010 (JSC::MarkStack::MarkStackArray::~MarkStackArray): 13011 (JSC::MarkStack::MarkStackArray::expand): 13012 (JSC::MarkStack::MarkStackArray::append): 13013 (JSC::MarkStack::MarkStackArray::removeLast): 13014 (JSC::MarkStack::MarkStackArray::isEmpty): 13015 (JSC::MarkStack::MarkStackArray::size): 13016 (JSC::MarkStack::MarkStackArray::shrinkAllocation): 13017 * runtime/MarkStackPosix.cpp: Added. 13018 (JSC::MarkStack::allocateStack): 13019 (JSC::MarkStack::releaseStack): 13020 * runtime/MarkStackWin.cpp: Added. 13021 (JSC::MarkStack::allocateStack): 13022 (JSC::MarkStack::releaseStack): 13023 13024 * runtime/ScopeChain.h: 13025 * runtime/ScopeChainMark.h: 13026 (JSC::ScopeChain::markAggregate): 13027 * runtime/SmallStrings.cpp: 13028 (JSC::SmallStrings::mark): 13029 * runtime/Structure.h: 13030 (JSC::Structure::markAggregate): 13031 130322009-08-10 Mark Rowe <mrowe@apple.com> 13033 13034 Reviewed by Darin Adler. 13035 13036 Fix hundreds of "pointer being freed was not allocated" errors seen on the build bot. 13037 13038 * wtf/FastMalloc.h: Implement nothrow variants of the delete and delete[] operators since 13039 we implement the nothrow variants of new and new[]. The nothrow variant of delete is called 13040 explicitly in the implementation of std::sort which was resulting in FastMalloc-allocated 13041 memory being passed to the system allocator to free. 13042 130432009-08-10 Jan Michael Alonzo <jmalonzo@webkit.org> 13044 13045 [Gtk] Unreviewed build fix. Move JSAPIValueWrapper.cpp/.h in the debug 13046 section. This file is already part of AllInOneFile in Release builds. 13047 13048 * GNUmakefile.am: 13049 130502009-08-10 Darin Adler <darin@apple.com> 13051 13052 * wtf/FastMalloc.h: Fix build. 13053 130542009-08-10 Darin Adler <darin@apple.com> 13055 13056 Reviewed by Mark Rowe. 13057 13058 FastMalloc.h has cross-platform code but marked as WinCE-only 13059 https://bugs.webkit.org/show_bug.cgi?id=28160 13060 13061 1) The support for nothrow was inside #if PLATFORM(WINCE) even though it is 13062 not platform-specific. 13063 2) The code tried to override operator delete nothrow, which does not exist. 13064 3) The code in the header checks the value of USE_SYSTEM_MALLOC, but the code 13065 in FastMalloc.cpp checks only if the macro is defined. 13066 13067 * wtf/FastMalloc.h: See above. 13068 * wtf/FastMalloc.cpp: Ditto. 13069 130702009-08-10 Sam Weinig <sam@webkit.org> 13071 13072 Reviewed by Anders Carlsson. 13073 13074 Fix an annoying indentation issue. 13075 13076 * runtime/DateConstructor.cpp: 13077 (JSC::constructDate): 13078 130792009-08-10 Xan Lopez <xlopez@igalia.com> 13080 13081 Unreviewed build fix. 13082 13083 Add new files to makefile. 13084 13085 * GNUmakefile.am: 13086 130872009-08-10 Simon Hausmann <simon.hausmann@nokia.com> 13088 13089 Fix compilation with the interpreter instead of the JIT by including 13090 PrototypeFunction.h as forward-declared through NativeFunctionWrapper.h. 13091 13092 * runtime/ObjectConstructor.cpp: 13093 130942009-08-09 Oliver Hunt <oliver@apple.com> 13095 13096 Reviewed by George Staikos. 13097 13098 JSON.stringify replacer returning undefined does not omit object properties 13099 https://bugs.webkit.org/show_bug.cgi?id=28118 13100 13101 Correct behaviour of stringify when using a replacer function that returns 13102 undefined. This is a simple change to move the undefined value check to 13103 after the replacer function is called. This means that the replacer function 13104 is now called for properties with the value undefined, however i've confirmed 13105 that this behaviour is correct. 13106 13107 In addition I've made the cyclic object exception have a more useful error 13108 message. 13109 13110 * runtime/JSONObject.cpp: 13111 (JSC::Stringifier::appendStringifiedValue): 13112 131132009-08-08 Oliver Hunt <oliver@apple.com> 13114 13115 Reviewed by Eric Seidel and Sam Weinig. 13116 13117 [ES5] Implement Object.getPrototypeOf 13118 https://bugs.webkit.org/show_bug.cgi?id=28114 13119 13120 Implement getPrototypeOf 13121 13122 * runtime/CommonIdentifiers.h: 13123 * runtime/JSGlobalObject.cpp: 13124 (JSC::JSGlobalObject::reset): 13125 * runtime/ObjectConstructor.cpp: 13126 (JSC::ObjectConstructor::ObjectConstructor): 13127 (JSC::objectConsGetPrototypeOf): 13128 * runtime/ObjectConstructor.h: 13129 131302009-08-07 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13131 13132 Reviewed by Eric Seidel. 13133 13134 Allow custom memory allocation control for Noncopyable class 13135 https://bugs.webkit.org/show_bug.cgi?id=27879 13136 13137 Several classes which are inherited from Noncopyable are instantiated by 13138 operator new, so Noncopyable class has been inherited from FastAllocBase. 13139 13140 * wtf/Noncopyable.h: 13141 131422009-08-07 George Staikos <george.staikos@torchmobile.com> 13143 13144 Reviewed by Eric Seidel. 13145 13146 https://bugs.webkit.org/show_bug.cgi?id=27305 13147 Implement WinCE-specific unicode layer. 13148 Written by George Staikos <george.staikos@torchmobile.com> 13149 with bug fixes by Yong Li <yong.li@torchmobile.com> 13150 refactored by Joe Mason <joe.mason@torchmobile.com> 13151 13152 * wtf/Platform.h: 13153 * wtf/unicode/Unicode.h: 13154 * wtf/unicode/wince/UnicodeWince.cpp: Added. 13155 (WTF::Unicode::toLower): 13156 (WTF::Unicode::toUpper): 13157 (WTF::Unicode::foldCase): 13158 (WTF::Unicode::isPrintableChar): 13159 (WTF::Unicode::isSpace): 13160 (WTF::Unicode::isLetter): 13161 (WTF::Unicode::isUpper): 13162 (WTF::Unicode::isLower): 13163 (WTF::Unicode::isDigit): 13164 (WTF::Unicode::isPunct): 13165 (WTF::Unicode::toTitleCase): 13166 (WTF::Unicode::direction): 13167 (WTF::Unicode::category): 13168 (WTF::Unicode::decompositionType): 13169 (WTF::Unicode::combiningClass): 13170 (WTF::Unicode::mirroredChar): 13171 (WTF::Unicode::digitValue): 13172 * wtf/unicode/wince/UnicodeWince.h: Added. 13173 (WTF::Unicode::): 13174 (WTF::Unicode::isSeparatorSpace): 13175 (WTF::Unicode::isHighSurrogate): 13176 (WTF::Unicode::isLowSurrogate): 13177 (WTF::Unicode::isArabicChar): 13178 (WTF::Unicode::hasLineBreakingPropertyComplexContext): 13179 (WTF::Unicode::umemcasecmp): 13180 (WTF::Unicode::surrogateToUcs4): 13181 131822009-08-07 Yongjun Zhang <yongjun.zhang@nokia.com> 13183 13184 Reviewed by Eric Seidel. 13185 13186 https://bugs.webkit.org/show_bug.cgi?id=28069 13187 13188 Add inline to help winscw compiler resolve specialized argument in 13189 templated functions. 13190 13191 * runtime/LiteralParser.cpp: 13192 (JSC::LiteralParser::Lexer::lexString): 13193 131942009-08-07 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13195 13196 Reviewed by Eric Seidel. 13197 13198 Allow custom memory allocation control for RegExpObjectData struct 13199 http://bugs.webkit.org/show_bug.cgi?id=26750 13200 13201 Inherits RegExpObjectData struct from FastAllocBase because 13202 it has been instantiated by 'new' in JavaScriptCore/runtime/RegExpObject.cpp:62 13203 13204 * runtime/RegExpObject.h: 13205 132062009-08-06 Norbert Leser <norbert.leser@nokia.com> 13207 13208 Reviewed by Darin Adler. 13209 13210 Updated patch for bug #27059: 13211 Symbian platform always uses little endian encoding, 13212 regardless of compiler. 13213 We need to make sure that we correctly detect EABI architecture 13214 for armv5 targets on Symbian, 13215 where __EABI__ is set but not __ARM_EABI__ 13216 13217 * wtf/Platform.h: 13218 132192009-08-06 Adam Barth <abarth@webkit.org> 13220 13221 Unreviewed revert. 13222 13223 http://bugs.webkit.org/show_bug.cgi?id=27879 13224 13225 Revert 46877 because it broke GTK. 13226 13227 * wtf/Noncopyable.h: 13228 132292009-08-06 Gavin Barraclough <barraclough@apple.com> 13230 13231 Reviewed by Oliver Hunt. 13232 13233 Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification. 13234 ( https://bugs.webkit.org/show_bug.cgi?id=27635 ) 13235 13236 This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%. 13237 (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled). 13238 13239 * bytecode/CodeBlock.cpp: 13240 (JSC::printStructureStubInfo): 13241 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID. 13242 13243 * bytecode/CodeBlock.h: 13244 (JSC::): 13245 (JSC::CallLinkInfo::seenOnce): 13246 (JSC::CallLinkInfo::setSeen): 13247 (JSC::MethodCallLinkInfo::seenOnce): 13248 (JSC::MethodCallLinkInfo::setSeen): 13249 - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once. 13250 13251 * bytecode/StructureStubInfo.cpp: 13252 (JSC::StructureStubInfo::deref): 13253 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID. 13254 13255 * bytecode/StructureStubInfo.h: 13256 (JSC::StructureStubInfo::StructureStubInfo): 13257 (JSC::StructureStubInfo::initGetByIdSelf): 13258 (JSC::StructureStubInfo::initGetByIdProto): 13259 (JSC::StructureStubInfo::initGetByIdChain): 13260 (JSC::StructureStubInfo::initGetByIdSelfList): 13261 (JSC::StructureStubInfo::initGetByIdProtoList): 13262 (JSC::StructureStubInfo::initPutByIdTransition): 13263 (JSC::StructureStubInfo::initPutByIdReplace): 13264 (JSC::StructureStubInfo::seenOnce): 13265 (JSC::StructureStubInfo::setSeen): 13266 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once. 13267 13268 * bytecompiler/BytecodeGenerator.cpp: 13269 (JSC::BytecodeGenerator::emitGetById): 13270 (JSC::BytecodeGenerator::emitPutById): 13271 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID. 13272 13273 * jit/JIT.cpp: 13274 (JSC::JIT::privateCompileCTIMachineTrampolines): 13275 (JSC::JIT::unlinkCall): 13276 - Remove the "don't lazy link" stage of calls. 13277 13278 * jit/JIT.h: 13279 (JSC::JIT::compileCTIMachineTrampolines): 13280 - Remove the "don't lazy link" stage of calls. 13281 13282 * jit/JITCall.cpp: 13283 (JSC::JIT::compileOpCallSlowCase): 13284 - Remove the "don't lazy link" stage of calls. 13285 13286 * jit/JITStubs.cpp: 13287 (JSC::JITThunks::JITThunks): 13288 (JSC::JITThunks::tryCachePutByID): 13289 (JSC::JITThunks::tryCacheGetByID): 13290 (JSC::JITStubs::DEFINE_STUB_FUNCTION): 13291 (JSC::JITStubs::getPolymorphicAccessStructureListSlot): 13292 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check. 13293 13294 * jit/JITStubs.h: 13295 (JSC::JITThunks::ctiStringLengthTrampoline): 13296 (JSC::JITStubs::): 13297 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check. 13298 13299 * wtf/PtrAndFlags.h: 13300 (WTF::PtrAndFlags::PtrAndFlags): 13301 (WTF::PtrAndFlags::operator!): 13302 (WTF::PtrAndFlags::operator->): 13303 - Add ! and -> operators, add constuctor with pointer argument. 13304 133052009-08-06 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13306 13307 Reviewed by Adam Barth. 13308 13309 Allow custom memory allocation control for Noncopyable class 13310 https://bugs.webkit.org/show_bug.cgi?id=27879 13311 13312 Several classes which inherited from Noncopyable are instantiated by 13313 operator new, so Noncopyable class has been inherited from FastAllocBase. 13314 13315 * wtf/Noncopyable.h: 13316 133172009-08-06 Mark Rowe <mrowe@apple.com> 13318 13319 Rubber-stamped by Sam Weinig. 13320 13321 Add explicit dependencies for our build verification scripts to ensure that they always run after linking has completed. 13322 13323 * JavaScriptCore.xcodeproj/project.pbxproj: 13324 133252009-08-06 Mark Rowe <mrowe@apple.com> 13326 13327 Bring a little order to our otherwise out of control lives. 13328 13329 * JavaScriptCore.xcodeproj/project.pbxproj: 13330 133312009-08-06 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13332 13333 Reviewed by Darin Adler. 13334 13335 Allow custom memory allocation control for JavaScriptCore's PolymorphicAccessStructureList struct 13336 https://bugs.webkit.org/show_bug.cgi?id=27877 13337 13338 Inherits PolymorphicAccessStructureList struct from FastAllocBase because it has been instantiated by 13339 'new' in JavaScriptCore/jit/JITStubs.cpp:1229. 13340 13341 * bytecode/Instruction.h: 13342 133432009-08-05 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13344 13345 Reviewed by Darin Adler. 13346 13347 Allow custom memory allocation control for JavaScriptCore's ScopeNodeData struct 13348 https://bugs.webkit.org/show_bug.cgi?id=27875 13349 13350 Inherits ScopeNodeData struct from FastAllocBase because it has been instantiated by 13351 'new' in JavaScriptCore/parser/Nodes.cpp:1848. 13352 13353 * parser/Nodes.h: 13354 133552009-08-05 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 13356 13357 Reviewed by Gavin Barraclough. 13358 13359 Add floating point support for generic ARM port. 13360 https://bugs.webkit.org/show_bug.cgi?id=24986 13361 13362 * assembler/ARMAssembler.cpp: 13363 (JSC::ARMAssembler::doubleTransfer): 13364 * assembler/ARMAssembler.h: 13365 (JSC::ARM::): 13366 (JSC::ARMAssembler::): 13367 (JSC::ARMAssembler::faddd_r): 13368 (JSC::ARMAssembler::fsubd_r): 13369 (JSC::ARMAssembler::fmuld_r): 13370 (JSC::ARMAssembler::fcmpd_r): 13371 (JSC::ARMAssembler::fdtr_u): 13372 (JSC::ARMAssembler::fdtr_d): 13373 (JSC::ARMAssembler::fmsr_r): 13374 (JSC::ARMAssembler::fsitod_r): 13375 (JSC::ARMAssembler::fmstat): 13376 * assembler/MacroAssemblerARM.h: 13377 (JSC::MacroAssemblerARM::): 13378 (JSC::MacroAssemblerARM::supportsFloatingPoint): 13379 (JSC::MacroAssemblerARM::loadDouble): 13380 (JSC::MacroAssemblerARM::storeDouble): 13381 (JSC::MacroAssemblerARM::addDouble): 13382 (JSC::MacroAssemblerARM::subDouble): 13383 (JSC::MacroAssemblerARM::mulDouble): 13384 (JSC::MacroAssemblerARM::convertInt32ToDouble): 13385 (JSC::MacroAssemblerARM::branchDouble): 13386 * jit/JIT.h: 13387 133882009-08-05 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 13389 13390 Reviewed by Gavin Barraclough. 13391 13392 Add JIT support for generic ARM port without optimizations. 13393 https://bugs.webkit.org/show_bug.cgi?id=24986 13394 13395 All JIT optimizations are disabled. 13396 13397 Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 13398 Signed off by Gabor Loki <loki@inf.u-szeged.hu> 13399 13400 * assembler/ARMAssembler.cpp: 13401 (JSC::ARMAssembler::baseIndexTransfer32): 13402 * assembler/AbstractMacroAssembler.h: 13403 (JSC::AbstractMacroAssembler::Imm32::Imm32): 13404 * assembler/MacroAssemblerARM.h: 13405 (JSC::MacroAssemblerARM::store32): 13406 (JSC::MacroAssemblerARM::move): 13407 (JSC::MacroAssemblerARM::branch32): 13408 (JSC::MacroAssemblerARM::add32): 13409 (JSC::MacroAssemblerARM::sub32): 13410 (JSC::MacroAssemblerARM::load32): 13411 * bytecode/CodeBlock.h: 13412 (JSC::CodeBlock::getBytecodeIndex): 13413 * jit/JIT.h: 13414 * jit/JITInlineMethods.h: 13415 (JSC::JIT::restoreArgumentReference): 13416 * jit/JITOpcodes.cpp: 13417 * jit/JITStubs.cpp: 13418 * jit/JITStubs.h: 13419 (JSC::JITStackFrame::returnAddressSlot): 13420 * wtf/Platform.h: 13421 134222009-08-04 Gavin Barraclough <barraclough@apple.com> 13423 13424 Rubber Stamped by Oiver Hunt. 13425 13426 Revert r46643 since this breaks the Yarr::Interpreter running the v8 tests. 13427 https://bugs.webkit.org/show_bug.cgi?id=27874 13428 13429 * yarr/RegexInterpreter.cpp: 13430 (JSC::Yarr::Interpreter::allocDisjunctionContext): 13431 (JSC::Yarr::Interpreter::freeDisjunctionContext): 13432 (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext): 13433 (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext): 13434 134352009-08-04 Oliver Hunt <oliver@apple.com> 13436 13437 PPC64 Build fix 13438 13439 * wtf/Platform.h: 13440 134412009-08-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 13442 13443 Reviewed by Adam Treat 13444 13445 Explicitly include limits.h header when using INT_MAX and INT_MIN 13446 13447 * interpreter/Interpreter.cpp 13448 134492009-08-03 Harald Fernengel <harald.fernengel@nokia.com> 13450 13451 Reviewed by Darin Adler. 13452 13453 Fix compile error for ambigous call to abs() 13454 https://bugs.webkit.org/show_bug.cgi?id=27873 13455 13456 Fix ambiguity in abs(long int) call by calling labs() instead 13457 13458 * wtf/DateMath.cpp: replace call to abs() with labs() 13459 134602009-08-03 Laszlo Gombos <laszlo.1.gombos@nokia.com> 13461 13462 Reviewed by Eric Seidel. 13463 13464 [Qt] Consolidate common gcc flags to WebKit.pri 13465 https://bugs.webkit.org/show_bug.cgi?id=27934 13466 13467 * JavaScriptCore.pro: 13468 134692009-08-03 Ada Chan <adachan@apple.com> 13470 13471 Fixed the Tiger build. 13472 13473 * wtf/FastMalloc.cpp: 13474 134752009-08-03 Ada Chan <adachan@apple.com> 13476 13477 Reviewed by Darin Adler. 13478 13479 Don't use background thread to scavenge memory on Tiger until we figure out why it causes a crash. 13480 https://bugs.webkit.org/show_bug.cgi?id=27900 13481 13482 * wtf/FastMalloc.cpp: 13483 134842009-08-03 Fumitoshi Ukai <ukai@chromium.org> 13485 13486 Reviewed by Jan Alonzo. 13487 13488 Fix build break on Gtk/x86_64. 13489 https://bugs.webkit.org/show_bug.cgi?id=27936 13490 13491 Use JSVALUE64 for X86_64 LINUX, except Qt. 13492 13493 * wtf/Platform.h: 13494 134952009-08-02 Xan Lopez <xlopez@igalia.com> 13496 13497 Fix the GTK+ build. 13498 13499 * wtf/Platform.h: 13500 135012009-08-02 Geoffrey Garen <ggaren@apple.com> 13502 13503 Reviewed by Sam Weinig. 13504 13505 Disabled JSVALUE32_64 on Qt builds, since all layout tests mysteriously 13506 crash with it enabled. 13507 13508 * wtf/Platform.h: 13509 135102009-08-02 Geoffrey Garen <ggaren@apple.com> 13511 13512 Qt build fix. 13513 13514 Added JSAPIValueWrapper.cpp to the build. 13515 13516 * JavaScriptCore.pri: 13517 135182009-08-02 Geoffrey Garen <ggaren@apple.com> 13519 13520 Windows build fix. 13521 13522 Exported symbols for JSAPIValueWrapper. 13523 13524 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 13525 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 13526 135272009-08-02 Geoffrey Garen <ggaren@apple.com> 13528 13529 GTK build fix. 13530 13531 * jit/JITStubs.cpp: #include <stdarg.h>, for a definition of va_start. 13532 135332009-08-02 Geoffrey Garen <ggaren@apple.com> 13534 13535 Qt build fix. 13536 13537 * runtime/Collector.cpp: #include <limits.h>, for a definition of ULONG_MAX. 13538 135392009-08-02 Geoffrey Garen <ggaren@apple.com> 13540 13541 Windows build fix: Nixed JSImmediate::prototype, JSImmediate::toObject, 13542 and JSImmediate::toThisObject, and removed their exported symbols. 13543 13544 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 13545 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 13546 * runtime/JSImmediate.cpp: 13547 * runtime/JSImmediate.h: 13548 135492009-08-02 Geoffrey Garen <ggaren@apple.com> 13550 13551 Reviewed by Mark Rowe. 13552 13553 Enabled JSVALUE32_64 by default on all platforms other than x86_64 (which uses JSVALUE64). 13554 13555 * wtf/Platform.h: 13556 135572009-08-02 Kevin Ollivier <kevino@theolliviers.com> 13558 13559 Reviewed by Jan Alonzo. 13560 13561 Script for building the JavaScriptCore library for wx. 13562 https://bugs.webkit.org/show_bug.cgi?id=27619 13563 13564 * wscript: Added. 13565 135662009-08-02 Yong Li <yong.li@torchmobile.com> 13567 13568 Reviewed by George Staikos. 13569 13570 DateMath depends on strftime and localtime, which need to be imported manually on WinCE 13571 https://bugs.webkit.org/show_bug.cgi?id=26558 13572 13573 * wtf/DateMath.cpp: 13574 135752009-08-01 David Kilzer <ddkilzer@apple.com> 13576 13577 wtf/Threading.h: added include of Platform.h 13578 13579 Reviewed by Mark Rowe. 13580 13581 * wtf/Threading.h: Added #include "Platform.h" since this header 13582 uses PLATFORM() and other macros. 13583 135842009-08-01 Mark Rowe <mrowe@apple.com> 13585 13586 Rubber-stamped by Oliver Hunt. 13587 13588 Roll out r46668 as it was misinformed. ScopeChain is only used with placement new. 13589 13590 * runtime/ScopeChain.h: 13591 135922009-08-01 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13593 13594 Allow custom memory allocation control for JavaScriptCore's HashMap class 13595 http://bugs.webkit.org/show_bug.cgi?id=27871 13596 13597 Inherits HashMap class from FastAllocBase because it has been 13598 instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:148. 13599 13600 * wtf/RefPtrHashMap.h: 13601 (WTF::): 13602 136032009-08-01 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13604 13605 Allow custom memory allocation control for JavaScriptCore's ScopeChain class 13606 https://bugs.webkit.org/show_bug.cgi?id=27834 13607 13608 Inherits ScopeChain class from FastAllocBase because it has been 13609 instantiated by 'new' in JavaScriptCore/runtime/JSFunction.h:109. 13610 13611 * runtime/ScopeChain.h: 13612 136132009-08-01 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13614 13615 Reviewed by Darin Adler. 13616 13617 Allow custom memory allocation control for JavaScriptCore's RegExpConstructorPrivate struct 13618 https://bugs.webkit.org/show_bug.cgi?id=27833 13619 13620 Inherits RegExpConstructorPrivate class from FastAllocBase because it has been 13621 instantiated by 'new' in JavaScriptCore/runtime/RegExpConstructor.cpp:152. 13622 13623 * runtime/RegExpConstructor.cpp: 13624 136252009-07-31 Yong Li <yong.li@torchmobile.com> 13626 13627 Reviewed by George Staikos. 13628 13629 Resurrect the old GetTickCount implementation of currentTime, controlled by WTF_USE_QUERY_PERFORMANCE_COUNTER 13630 currentSystemTime taken from older WebKit; currentTime written by Yong Li <yong.li@torchmobile.com>; cleanup by Joe Mason <joe.mason@torchmobile.com> 13631 https://bugs.webkit.org/show_bug.cgi?id=27848 13632 13633 * wtf/CurrentTime.cpp: 13634 (WTF::currentSystemTime): get current time with GetCurrentFT 13635 (WTF::currentTime): track msec elapsed since first currentSystemTime call using GetTickCount 13636 * wtf/Platform.h: 13637 136382009-07-31 Ada Chan <adachan@apple.com> 13639 13640 Fixes the Windows release-PGO build. 13641 13642 Reviewed by Jon Honeycutt. 13643 13644 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Suppresses the warning about unreachable code that we get by adding "return 0" to WTF::TCMalloc_PageHeap::runScavengerThread(). 13645 * wtf/FastMalloc.cpp: 13646 (WTF::TCMalloc_PageHeap::runScavengerThread): Fixes the error about the method not returning a value in the release-PGO build. 13647 136482009-07-31 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 13649 13650 Change malloc to fastMalloc and free to fastFree in Yarr's RegexInterpreter.cpp 13651 https://bugs.webkit.org/show_bug.cgi?id=27874 13652 13653 Use fastMalloc and fastFree instead of malloc and free in RegexInterpreter.cpp's methods. 13654 13655 * yarr/RegexInterpreter.cpp: 13656 (JSC::Yarr::Interpreter::allocDisjunctionContext): 13657 (JSC::Yarr::Interpreter::freeDisjunctionContext): 13658 (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext): 13659 (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext): 13660 136612009-07-30 Xan Lopez <xlopez@igalia.com> 13662 13663 Reviewed by Jan Alonzo. 13664 13665 Fix compiler warning. 13666 13667 GCC does not like C++-style comments in preprocessor directives. 13668 13669 * wtf/Platform.h: 13670 136712009-07-30 John McCall <rjmccall@apple.com> 13672 13673 Reviewed by Gavin Barraclough. 13674 13675 Optimize the X86_64 trampolines: avoid the need for filler arguments 13676 and move the stub-args area closer to the stack pointer. 13677 13678 * jit/JIT.h: adjust patch offsets because of slight code-size change 13679 * jit/JITCode.h: 13680 (JSC::JITCode::execute): don't pass filler args 13681 * jit/JITStubs.cpp: 13682 (ctiTrampoline): (X86_64): push args onto stack, use args directly 13683 (ctiVMThrowTrampoline): (X86_64): adjust %rsp by correct displacement 13684 (ctiOpThrowNotCaught): (X86_64): adjust %rsp by correct displacement 13685 * jit/JITStubs.h: 13686 (JITStackFrame): (X86_64): move args area earlier 13687 (ctiTrampoline): remove filler args from prototype 13688 136892009-07-30 Gavin Barraclough <barraclough@apple.com> 13690 13691 Temporarily revert r46618 since this is b0rking on Linux. 13692 136932009-07-23 Gavin Barraclough <barraclough@apple.com> 13694 13695 Reviewed by Oliver Hunt. 13696 13697 Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification. 13698 ( https://bugs.webkit.org/show_bug.cgi?id=27635 ) 13699 13700 This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%. 13701 (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled). 13702 13703 * bytecode/CodeBlock.cpp: 13704 (JSC::printStructureStubInfo): 13705 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID. 13706 13707 * bytecode/CodeBlock.h: 13708 (JSC::): 13709 (JSC::CallLinkInfo::seenOnce): 13710 (JSC::CallLinkInfo::setSeen): 13711 (JSC::MethodCallLinkInfo::seenOnce): 13712 (JSC::MethodCallLinkInfo::setSeen): 13713 - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once. 13714 13715 * bytecode/StructureStubInfo.cpp: 13716 (JSC::StructureStubInfo::deref): 13717 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID. 13718 13719 * bytecode/StructureStubInfo.h: 13720 (JSC::StructureStubInfo::StructureStubInfo): 13721 (JSC::StructureStubInfo::initGetByIdSelf): 13722 (JSC::StructureStubInfo::initGetByIdProto): 13723 (JSC::StructureStubInfo::initGetByIdChain): 13724 (JSC::StructureStubInfo::initGetByIdSelfList): 13725 (JSC::StructureStubInfo::initGetByIdProtoList): 13726 (JSC::StructureStubInfo::initPutByIdTransition): 13727 (JSC::StructureStubInfo::initPutByIdReplace): 13728 (JSC::StructureStubInfo::seenOnce): 13729 (JSC::StructureStubInfo::setSeen): 13730 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once. 13731 13732 * bytecompiler/BytecodeGenerator.cpp: 13733 (JSC::BytecodeGenerator::emitGetById): 13734 (JSC::BytecodeGenerator::emitPutById): 13735 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID. 13736 13737 * jit/JIT.cpp: 13738 (JSC::JIT::privateCompileCTIMachineTrampolines): 13739 (JSC::JIT::unlinkCall): 13740 - Remove the "don't lazy link" stage of calls. 13741 13742 * jit/JIT.h: 13743 (JSC::JIT::compileCTIMachineTrampolines): 13744 - Remove the "don't lazy link" stage of calls. 13745 13746 * jit/JITCall.cpp: 13747 (JSC::JIT::compileOpCallSlowCase): 13748 - Remove the "don't lazy link" stage of calls. 13749 13750 * jit/JITStubs.cpp: 13751 (JSC::JITThunks::JITThunks): 13752 (JSC::JITThunks::tryCachePutByID): 13753 (JSC::JITThunks::tryCacheGetByID): 13754 (JSC::JITStubs::DEFINE_STUB_FUNCTION): 13755 (JSC::JITStubs::getPolymorphicAccessStructureListSlot): 13756 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check. 13757 13758 * jit/JITStubs.h: 13759 (JSC::JITThunks::ctiStringLengthTrampoline): 13760 (JSC::JITStubs::): 13761 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check. 13762 13763 * wtf/PtrAndFlags.h: 13764 (WTF::PtrAndFlags::PtrAndFlags): 13765 (WTF::PtrAndFlags::operator!): 13766 (WTF::PtrAndFlags::operator->): 13767 - Add ! and -> operators, add constuctor with pointer argument. 13768 137692009-07-30 Geoffrey Garen <ggaren@apple.com> 13770 13771 Reviewed by Gavin Barraclough. 13772 13773 Fixed failing tests seen on Windows buildbot. 13774 13775 * jit/JITStubs.cpp: 13776 (JSC::DEFINE_STUB_FUNCTION): 13777 * jit/JITStubs.h: 13778 (JSC::): Use "int" instead of "bool" to guarantee a 32-bit result, 13779 regardless of compiler. gcc on mac uses 32-bit values for bool, 13780 but gcc on linux and MSVC on Windows use 8-bit values. 13781 137822009-07-30 Geoffrey Garen <ggaren@apple.com> 13783 13784 Windows build fix: added missing symbols on Windows. 13785 13786 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 13787 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 13788 137892009-07-30 Geoffrey Garen <ggaren@apple.com> 13790 13791 Windows build fix: removed stale symbols on Windows. 13792 13793 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 13794 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 13795 13796=== End merge of nitro-extreme branch 2009-07-30 === 13797 137982009-07-20 Geoffrey Garen <ggaren@apple.com> 13799 13800 Fixed a post-review typo in r46066 that caused tons of test failures. 13801 13802 SunSpider reports no change. 13803 13804 * runtime/JSArray.cpp: 13805 (JSC::JSArray::JSArray): Initialize the full vector capacity, to avoid 13806 uninitialized members at the end. 13807 138082009-07-20 Geoffrey Garen <ggaren@apple.com> 13809 13810 Windows WebKit build fix: Added some missing exports. 13811 13812 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 13813 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 13814 138152009-07-17 Geoffrey Garen <ggaren@apple.com> 13816 13817 Reviewed by Sam Weinig. 13818 13819 Get the branch working on windows. 13820 https://bugs.webkit.org/show_bug.cgi?id=27391 13821 13822 SunSpider says 0.3% faster. 13823 13824 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 13825 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Updated 13826 MSVC export lists to fix linker errors. 13827 13828 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added / removed 13829 new / old project files. 13830 13831 * jit/JIT.cpp: 13832 (JSC::JIT::privateCompileCTIMachineTrampolines): Used #pragma pack to tell 13833 MSVC that these structures represent actual memory layout, and should not be 13834 automatically aligned. Changed the return value load to load a 64bit quantity 13835 into the canonical registers. 13836 13837 * jit/JIT.h: Moved OBJECT_OFFSETOF definition to StdLibExtras.h because 13838 it's needed by more than just the JIT, and it supplements a standard library 13839 macro (offsetof). 13840 13841 * jit/JITCall.cpp: 13842 (JSC::JIT::compileOpCallInitializeCallFrame): Fixed an incorrectly signed 13843 cast to resolve an MSVC warning. 13844 13845 * jit/JITStubs.h: Used #pragma pack to tell MSVC that these structures 13846 represent actual memory layout, and should not be automatically aligned. 13847 13848 * runtime/JSArray.cpp: 13849 (JSC::JSArray::JSArray): Replaced memset_pattern8 with a for loop, since 13850 memset_pattern8 is not portable. (I verified that this version of the loop 13851 gives the best performance / generated code in GCC.) 13852 13853 * runtime/JSObject.h: 13854 (JSC::JSObject::JSObject): Removed accidental usage of FIELD_OFFSET -- 13855 OBJECT_OFFSETOF is our new macro name. (FIELD_OFFSET conflicts with a 13856 definition in winnt.h.) 13857 13858 * runtime/JSValue.cpp: Added some headers needed by non-all-in-one builds. 13859 13860 * runtime/JSValue.h: 13861 (JSC::JSValue::): Made the tag signed, to match MSVC's signed enum values. 13862 (GCC doesn't seem to care one way or the other.) 13863 13864 * wtf/MainThread.cpp: Moved the StdLibExtras.h #include -- I did this a 13865 while ago to resolve a conflict with winnt.h. I can't remember if it's truly 13866 still needed, but what the heck. 13867 13868 * wtf/StdLibExtras.h: Moved OBJECT_OFFSETOF definition here. 13869 138702009-07-06 Geoffrey Garen <ggaren@apple.com> 13871 13872 Reviewed by Sam Weinig (?). 13873 13874 Fixed an assertion seen during the stress test. 13875 13876 Don't assume that, if op1 is constant, op2 is not, and vice versa. Sadly, 13877 not all constants get folded. 13878 13879 * jit/JITArithmetic.cpp: 13880 (JSC::JIT::emit_op_jnless): 13881 (JSC::JIT::emitSlow_op_jnless): 13882 (JSC::JIT::emit_op_jnlesseq): 13883 (JSC::JIT::emitSlow_op_jnlesseq): 13884 138852009-07-06 Geoffrey Garen <ggaren@apple.com> 13886 13887 Reviewed by Sam Weinig. 13888 13889 Include op_convert_this in result caching. 13890 13891 No change on SunSpider or v8. 13892 13893 * jit/JITOpcodes.cpp: 13894 (JSC::JIT::emit_op_convert_this): 13895 13896 * jit/JITStubs.cpp: 13897 (JSC::DEFINE_STUB_FUNCTION): 13898 * jit/JITStubs.h: 13899 (JSC::): Made the op_convert_this JIT stub return an EncodedJSValue, so 13900 to maintain the result caching contract that { tag, payload } can be 13901 found in { regT1, regT0 }. 13902 139032009-07-06 Geoffrey Garen <ggaren@apple.com> 13904 13905 Reviewed by Sam Weinig. 13906 13907 Implemented result chaining. 13908 13909 1% faster on SunSpider. 4%-5% faster on v8. 13910 13911 * assembler/MacroAssemblerX86Common.h: 13912 (JSC::MacroAssemblerX86Common::move): 13913 * assembler/X86Assembler.h: 13914 (JSC::X86Assembler::movl_rr): Added an optimization to eliminate 13915 no-op mov instructions, to simplify chaining. 13916 13917 * jit/JIT.cpp: 13918 (JSC::JIT::JIT): 13919 * jit/JIT.h: Added data members and helper functions for recording 13920 chained results. We record both a mapping from virtual to machine register 13921 and the opcode for which the mapping is valid, to help ensure that the 13922 mapping isn't used after the mapped register has been stomped by other 13923 instructions. 13924 13925 * jit/JITCall.cpp: 13926 (JSC::JIT::compileOpCallVarargs): 13927 (JSC::JIT::compileOpCallVarargsSlowCase): 13928 (JSC::JIT::emit_op_ret): 13929 (JSC::JIT::emit_op_construct_verify): 13930 (JSC::JIT::compileOpCall): 13931 (JSC::JIT::compileOpCallSlowCase): Chain function call results. 13932 13933 * jit/JITInlineMethods.h: 13934 (JSC::JIT::emitLoadTag): 13935 (JSC::JIT::emitLoadPayload): 13936 (JSC::JIT::emitLoad): 13937 (JSC::JIT::emitLoad2): 13938 (JSC::JIT::isLabeled): 13939 (JSC::JIT::map): 13940 (JSC::JIT::unmap): 13941 (JSC::JIT::isMapped): 13942 (JSC::JIT::getMappedPayload): 13943 (JSC::JIT::getMappedTag): Use helper functions when loading virtual 13944 registers into machine registers, in case the loads can be eliminated 13945 by chaining. 13946 13947 * jit/JITOpcodes.cpp: 13948 (JSC::JIT::emit_op_mov): 13949 (JSC::JIT::emit_op_end): 13950 (JSC::JIT::emit_op_instanceof): 13951 (JSC::JIT::emit_op_get_global_var): 13952 (JSC::JIT::emit_op_put_global_var): 13953 (JSC::JIT::emit_op_get_scoped_var): 13954 (JSC::JIT::emit_op_put_scoped_var): 13955 (JSC::JIT::emit_op_to_primitive): 13956 (JSC::JIT::emit_op_resolve_global): 13957 (JSC::JIT::emit_op_jneq_ptr): 13958 (JSC::JIT::emit_op_next_pname): 13959 (JSC::JIT::emit_op_to_jsnumber): 13960 (JSC::JIT::emit_op_catch): Chain results from these opcodes. 13961 13962 (JSC::JIT::emit_op_profile_will_call): 13963 (JSC::JIT::emit_op_profile_did_call): Load the profiler into regT2 to 13964 avoid stomping a chained result. 13965 13966 * jit/JITPropertyAccess.cpp: 13967 (JSC::JIT::emit_op_method_check): 13968 (JSC::JIT::emit_op_get_by_val): 13969 (JSC::JIT::emit_op_get_by_id): Chain results from these opcodes. 13970 13971 * jit/JITStubCall.h: 13972 (JSC::JITStubCall::addArgument): Always use { regT1, regT0 }, to facilitate 13973 chaining. 13974 13975 (JSC::JITStubCall::call): Unmap all mapped registers, since our callee 13976 stub might stomp them. 13977 139782009-07-01 Sam Weinig <sam@webkit.org> 13979 13980 Reviewed by Gavin Barraclough. 13981 13982 Don't reload values in emitBinaryDoubleOp. 13983 13984 SunSpider reports a 0.6% progression. 13985 13986 * jit/JIT.h: 13987 * jit/JITArithmetic.cpp: 13988 (JSC::JIT::emit_op_jnless): 13989 (JSC::JIT::emit_op_jnlesseq): 13990 (JSC::JIT::emitBinaryDoubleOp): 13991 139922009-07-01 Sam Weinig <sam@webkit.org> 13993 13994 Reviewed by Geoffrey Garen. 13995 13996 Convert op_div to load op1 and op2 up front. 13997 13998 * jit/JITArithmetic.cpp: 13999 (JSC::JIT::emit_op_div): 14000 140012009-07-01 Sam Weinig <sam@webkit.org> 14002 14003 Reviewed by Geoffrey Garen. 14004 14005 Don't emit code in emitBinaryDoubleOp if code is unreachable, observable 14006 via an empty (unlinked) jumplist passed in. This only effects op_jnless 14007 and op_jnlesseq at present. 14008 14009 * jit/JITArithmetic.cpp: 14010 (JSC::JIT::emitSlow_op_jnless): 14011 (JSC::JIT::emitSlow_op_jnlesseq): 14012 (JSC::JIT::emitBinaryDoubleOp): 14013 140142009-07-01 Geoffrey Garen <ggaren@apple.com> 14015 14016 Reviewed by Sam Weinig. 14017 14018 Converted op_mod to put { tag, payload } in { regT1, regT0 }, and 14019 tidied up its constant case. 14020 14021 SunSpider reports a 0.2% regression, but a micro-benchmark of op_mod 14022 shows a 12% speedup, and the SunSpider test that uses op_mod most should 14023 benefit a lot from result caching in the end, since it almost always 14024 performs (expression) % constant. 14025 14026 * jit/JITArithmetic.cpp: 14027 (JSC::JIT::emit_op_mod): 14028 (JSC::JIT::emitSlow_op_mod): 14029 140302009-06-30 Sam Weinig <sam@webkit.org> 14031 14032 Reviewed by Geoffrey Garen. 14033 14034 Converted some more arithmetic ops to put { tag, payload } in 14035 { regT1, regT0 }. 14036 14037 * jit/JITArithmetic.cpp: 14038 (JSC::JIT::emit_op_mul): 14039 (JSC::JIT::emitSlow_op_mul): 14040 140412009-06-30 Geoffrey Garen <ggaren@apple.com> 14042 14043 Reviewed by Sam Weinig. 14044 14045 Converted some more arithmetic ops to put { tag, payload } in 14046 { regT1, regT0 }, and added a case for subtract constant. 14047 14048 SunSpider says no change. v8 says 0.3% slower. 14049 14050 * jit/JIT.h: 14051 * jit/JITArithmetic.cpp: 14052 (JSC::JIT::emit_op_add): 14053 (JSC::JIT::emitAdd32Constant): 14054 (JSC::JIT::emitSlow_op_add): 14055 (JSC::JIT::emit_op_sub): 14056 (JSC::JIT::emitSub32Constant): 14057 (JSC::JIT::emitSlow_op_sub): 14058 140592009-06-30 Gavin Barraclough <barraclough@apple.com> 14060 14061 Reviewed by Sam Weinig. 14062 14063 Remove more uses of addressFor(), load double constants directly from 14064 the constantpool in the CodeBlock, rather than from the register file. 14065 14066 * jit/JITArithmetic.cpp: 14067 (JSC::JIT::emitAdd32Constant): 14068 (JSC::JIT::emitBinaryDoubleOp): 14069 140702009-06-30 Geoffrey Garen <ggaren@apple.com> 14071 14072 Reviewed by Sam Weinig. 14073 14074 Fixed a bug in postfix ops, where we would treat x = x++ and x = x-- 14075 as a no-op, even if x were not an int, and the ++/-- could have side-effects. 14076 14077 * jit/JITArithmetic.cpp: 14078 (JSC::JIT::emit_op_post_inc): 14079 (JSC::JIT::emitSlow_op_post_inc): 14080 (JSC::JIT::emit_op_post_dec): 14081 (JSC::JIT::emitSlow_op_post_dec): 14082 140832009-06-30 Geoffrey Garen <ggaren@apple.com> 14084 14085 Reviewed by Sam Weinig. 14086 14087 Converted some arithmetic ops to put { tag, payload } in 14088 { regT1, regT0 }. 14089 14090 SunSpider says 0.7% faster. v8 says no change. 14091 14092 * jit/JIT.h: 14093 * jit/JITArithmetic.cpp: 14094 (JSC::JIT::emit_op_jnless): 14095 (JSC::JIT::emit_op_jnlesseq): 14096 (JSC::JIT::emit_op_lshift): 14097 (JSC::JIT::emit_op_rshift): 14098 (JSC::JIT::emit_op_bitand): 14099 (JSC::JIT::emit_op_bitor): 14100 (JSC::JIT::emit_op_bitxor): 14101 * jit/JITInlineMethods.h: 14102 (JSC::JIT::isOperandConstantImmediateInt): 14103 (JSC::JIT::getOperandConstantImmediateInt): 14104 141052009-06-30 Gavin Barraclough <barraclough@apple.com> 14106 14107 Reviewed by Sam Weinig. 14108 14109 Start removing cases of addressFor(). 14110 14111 * jit/JIT.h: 14112 * jit/JITArithmetic.cpp: 14113 (JSC::JIT::emitAdd32Constant): 14114 (JSC::JIT::emitBinaryDoubleOp): 14115 (JSC::JIT::emit_op_div): 14116 * jit/JITInlineMethods.h: 14117 (JSC::JIT::emitLoadDouble): 14118 (JSC::JIT::emitLoadInt32ToDouble): 14119 (JSC::JIT::emitStoreDouble): 14120 * jit/JITOpcodes.cpp: 14121 (JSC::JIT::emit_op_jfalse): 14122 (JSC::JIT::emit_op_jtrue): 14123 141242009-06-30 Geoffrey Garen <ggaren@apple.com> 14125 14126 Rolled back in my last patch with regression fixed. 14127 14128 * jit/JIT.cpp: 14129 (JSC::JIT::privateCompileSlowCases): 14130 * jit/JIT.h: 14131 * jit/JITOpcodes.cpp: 14132 (JSC::JIT::emit_op_loop_if_less): 14133 (JSC::JIT::emit_op_loop_if_lesseq): 14134 (JSC::JIT::emit_op_resolve_global): 14135 (JSC::JIT::emitSlow_op_resolve_global): 14136 (JSC::JIT::emit_op_eq): 14137 (JSC::JIT::emitSlow_op_eq): 14138 (JSC::JIT::emit_op_neq): 14139 (JSC::JIT::emitSlow_op_neq): 14140 141412009-06-30 Geoffrey Garen <ggaren@apple.com> 14142 14143 Rolled out my last patch because it was a 2% SunSpider regression. 14144 14145 * jit/JIT.cpp: 14146 (JSC::JIT::privateCompileSlowCases): 14147 * jit/JIT.h: 14148 * jit/JITOpcodes.cpp: 14149 (JSC::JIT::emit_op_loop_if_less): 14150 (JSC::JIT::emit_op_loop_if_lesseq): 14151 (JSC::JIT::emit_op_resolve_global): 14152 (JSC::JIT::emit_op_eq): 14153 (JSC::JIT::emitSlow_op_eq): 14154 (JSC::JIT::emit_op_neq): 14155 (JSC::JIT::emitSlow_op_neq): 14156 141572009-06-30 Geoffrey Garen <ggaren@apple.com> 14158 14159 Reviewed by Gavin "Sam Weinig" Barraclough. 14160 14161 Standardized the rest of our opcodes to put { tag, payload } in 14162 { regT1, regT0 } where possible. 14163 14164 * jit/JIT.cpp: 14165 (JSC::JIT::privateCompileSlowCases): 14166 * jit/JIT.h: 14167 * jit/JITOpcodes.cpp: 14168 (JSC::JIT::emit_op_loop_if_less): 14169 (JSC::JIT::emit_op_loop_if_lesseq): 14170 (JSC::JIT::emit_op_resolve_global): 14171 (JSC::JIT::emitSlow_op_resolve_global): 14172 (JSC::JIT::emit_op_eq): 14173 (JSC::JIT::emitSlow_op_eq): 14174 (JSC::JIT::emit_op_neq): 14175 (JSC::JIT::emitSlow_op_neq): 14176 141772009-06-30 Gavin Barraclough <barraclough@apple.com> 14178 14179 Reviewed by Geoffrey Garen. 14180 14181 Replace calls to store32(tagFor()) and store32(payloadFor()) 14182 with emitStoreInt32(), emitStoreBool(), and emitStoreCell(). 14183 14184 * jit/JIT.h: 14185 * jit/JITArithmetic.cpp: 14186 (JSC::JIT::emit_op_negate): 14187 (JSC::JIT::emit_op_lshift): 14188 (JSC::JIT::emit_op_rshift): 14189 (JSC::JIT::emit_op_bitand): 14190 (JSC::JIT::emitBitAnd32Constant): 14191 (JSC::JIT::emit_op_bitor): 14192 (JSC::JIT::emitBitOr32Constant): 14193 (JSC::JIT::emit_op_bitxor): 14194 (JSC::JIT::emitBitXor32Constant): 14195 (JSC::JIT::emit_op_bitnot): 14196 (JSC::JIT::emit_op_post_inc): 14197 (JSC::JIT::emit_op_post_dec): 14198 (JSC::JIT::emit_op_pre_inc): 14199 (JSC::JIT::emit_op_pre_dec): 14200 (JSC::JIT::emit_op_add): 14201 (JSC::JIT::emitAdd32Constant): 14202 (JSC::JIT::emit_op_sub): 14203 (JSC::JIT::emitSub32ConstantLeft): 14204 (JSC::JIT::emitSub32ConstantRight): 14205 (JSC::JIT::emit_op_mul): 14206 (JSC::JIT::emitSlow_op_mul): 14207 (JSC::JIT::emit_op_div): 14208 (JSC::JIT::emit_op_mod): 14209 * jit/JITCall.cpp: 14210 (JSC::JIT::emit_op_load_varargs): 14211 * jit/JITInlineMethods.h: 14212 (JSC::JIT::emitStoreInt32): 14213 (JSC::JIT::emitStoreCell): 14214 (JSC::JIT::emitStoreBool): 14215 (JSC::JIT::emitStore): 14216 * jit/JITOpcodes.cpp: 14217 (JSC::JIT::emit_op_instanceof): 14218 (JSC::JIT::emit_op_not): 14219 (JSC::JIT::emit_op_eq): 14220 (JSC::JIT::emitSlow_op_eq): 14221 (JSC::JIT::emit_op_neq): 14222 (JSC::JIT::emitSlow_op_neq): 14223 (JSC::JIT::compileOpStrictEq): 14224 (JSC::JIT::emit_op_eq_null): 14225 (JSC::JIT::emit_op_neq_null): 14226 * jit/JITStubCall.h: 14227 (JSC::JITStubCall::call): 14228 142292009-06-30 Geoffrey Garen <ggaren@apple.com> 14230 14231 Reviewed by Sam Weinig. 14232 14233 Standardized the rest of the property access instructions to put { tag, 14234 payload } in { regT1, regT0 }. 14235 14236 Small v8 speedup, 0.2% SunSpider slowdown. 14237 14238 * jit/JIT.h: 14239 * jit/JITInlineMethods.h: 14240 (JSC::JIT::emitLoad): 14241 (JSC::JIT::emitLoad2): 14242 * jit/JITPropertyAccess.cpp: 14243 (JSC::JIT::emit_op_get_by_val): 14244 (JSC::JIT::emitSlow_op_get_by_val): 14245 (JSC::JIT::emit_op_put_by_val): 14246 (JSC::JIT::emitSlow_op_put_by_val): 14247 (JSC::JIT::emit_op_put_by_id): 14248 (JSC::JIT::emitSlow_op_put_by_id): 14249 (JSC::JIT::patchPutByIdReplace): 14250 142512009-06-29 Sam Weinig <sam@webkit.org> 14252 14253 Reviewed by Gavin Barraclough. 14254 14255 Various cleanups. 14256 - Use fpRegT* instead of X86::xmm*. 14257 - Use a switch statement in emitBinaryDoubleOp instead of a bunch of 14258 if/elses. 14259 14260 * jit/JITArithmetic.cpp: 14261 (JSC::JIT::emitAdd32Constant): 14262 (JSC::JIT::emitBinaryDoubleOp): 14263 (JSC::JIT::emit_op_div): 14264 142652009-06-29 Sam Weinig <sam@webkit.org> 14266 14267 Reviewed by Geoffrey Garen. 14268 14269 Add inline code dealing with doubles for op_jfalse and op_jtrue. 14270 14271 * assembler/MacroAssemblerX86Common.h: 14272 (JSC::MacroAssemblerX86Common::): 14273 (JSC::MacroAssemblerX86Common::zeroDouble): 14274 * jit/JITOpcodes.cpp: 14275 (JSC::JIT::emit_op_jfalse): 14276 (JSC::JIT::emit_op_jtrue): 14277 142782009-06-28 Geoffrey Garen <ggaren@apple.com> 14279 14280 Reviewed by Sam Weinig. 14281 14282 Standardized op_get_by_id to put { tag, payload } in { regT1, regT0 }. 14283 14284 SunSpider and v8 report maybe 0.2%-0.4% regressions, but the optimization 14285 this enables will win much more than that back. 14286 14287 * jit/JIT.cpp: 14288 (JSC::JIT::privateCompileCTIMachineTrampolines): 14289 * jit/JIT.h: 14290 * jit/JITPropertyAccess.cpp: 14291 (JSC::JIT::emit_op_method_check): 14292 (JSC::JIT::emit_op_get_by_id): 14293 (JSC::JIT::compileGetByIdHotPath): 14294 (JSC::JIT::compileGetByIdSlowCase): 14295 (JSC::JIT::patchGetByIdSelf): 14296 (JSC::JIT::privateCompilePatchGetArrayLength): 14297 (JSC::JIT::privateCompileGetByIdProto): 14298 (JSC::JIT::privateCompileGetByIdSelfList): 14299 (JSC::JIT::privateCompileGetByIdProtoList): 14300 (JSC::JIT::privateCompileGetByIdChainList): 14301 (JSC::JIT::privateCompileGetByIdChain): 14302 143032009-06-26 Geoffrey Garen <ggaren@apple.com> 14304 14305 Reviewed by Maciej Stachowiak. 14306 14307 Standardized op_call to put { tag, payload } in { regT1, regT0 }. 14308 14309 SunSpider and v8 report no change. 14310 14311 * jit/JIT.cpp: 14312 (JSC::JIT::privateCompileCTIMachineTrampolines): 14313 * jit/JITCall.cpp: 14314 (JSC::JIT::compileOpCallInitializeCallFrame): 14315 (JSC::JIT::compileOpCallSetupArgs): 14316 (JSC::JIT::compileOpConstructSetupArgs): 14317 (JSC::JIT::compileOpCallVarargsSetupArgs): 14318 (JSC::JIT::compileOpCallVarargs): 14319 (JSC::JIT::compileOpCall): 14320 (JSC::JIT::compileOpCallSlowCase): 14321 143222009-06-26 Sam Weinig <sam@webkit.org> 14323 14324 Reviewed by Geoffrey Garen. 14325 14326 Handle multiplying by zero a little better by 14327 inlining the case that both operands are non-negative 14328 into the slowpath. 14329 14330 * assembler/MacroAssemblerX86Common.h: 14331 (JSC::MacroAssemblerX86Common::branchOr32): 14332 * jit/JITArithmetic.cpp: 14333 (JSC::JIT::emit_op_mul): 14334 (JSC::JIT::emitSlow_op_mul): 14335 143362009-06-25 Geoffrey Garen <ggaren@apple.com> 14337 14338 Reviewed by Sam Weinig. 14339 14340 Optimize x++ to ++x inside for loops. 14341 14342 Sadly, no measurable speedup, but this should help with result chaining. 14343 14344 * parser/Nodes.cpp: 14345 (JSC::ForNode::emitBytecode): 14346 143472009-06-25 Geoffrey Garen <ggaren@apple.com> 14348 14349 Reviewed by Sam Weinig. 14350 14351 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }. 14352 14353 * jit/JITArithmetic.cpp: 14354 (JSC::JIT::emitSlow_op_bitnot): 14355 (JSC::JIT::emit_op_post_inc): 14356 143572009-06-25 Geoffrey Garen <ggaren@apple.com> 14358 14359 Reviewed by Sam Weinig. 14360 14361 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }. 14362 14363 * jit/JITArithmetic.cpp: 14364 (JSC::JIT::emit_op_bitnot): 14365 (JSC::JIT::emit_op_post_dec): 14366 (JSC::JIT::emit_op_pre_inc): 14367 (JSC::JIT::emitSlow_op_pre_inc): 14368 (JSC::JIT::emit_op_pre_dec): 14369 (JSC::JIT::emitSlow_op_pre_dec): 14370 143712009-06-25 Geoffrey Garen <ggaren@apple.com> 14372 14373 Reviewed by Sam Weinig. 14374 14375 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }. 14376 14377 * jit/JITArithmetic.cpp: 14378 (JSC::JIT::emit_op_negate): 14379 (JSC::JIT::emitSlow_op_negate): 14380 * jit/JITCall.cpp: 14381 (JSC::JIT::emit_op_construct_verify): 14382 (JSC::JIT::emitSlow_op_construct_verify): 14383 143842009-06-25 Geoffrey Garen <ggaren@apple.com> 14385 14386 Reviewed by Sam Weinig. 14387 14388 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }. 14389 14390 * jit/JITOpcodes.cpp: 14391 (JSC::JIT::emit_op_loop_if_true): 14392 (JSC::JIT::emit_op_jfalse): 14393 (JSC::JIT::emit_op_jtrue): 14394 (JSC::JIT::emit_op_jeq_null): 14395 (JSC::JIT::emit_op_jneq_null): 14396 (JSC::JIT::emit_op_eq_null): 14397 (JSC::JIT::emit_op_neq_null): 14398 143992009-06-25 Geoffrey Garen <ggaren@apple.com> 14400 14401 Reviewed by Sam Weinig (sort of, maybe). 14402 14403 Fixed some ASSERTs in http/tests/security. 14404 14405 These ASSERTs were introduced by http://trac.webkit.org/changeset/45057, 14406 but the underlying problem was actually older. http://trac.webkit.org/changeset/45057 14407 just exposed the problem by enabling optimization in more cases. 14408 14409 The ASSERTs fired because we tested PropertySlot::slotBase() for validity, 14410 but slotBase() ASSERTs if it's invalid, so we would ASSERT before 14411 the test could happen. Solution: Remove the ASSERT. Maybe it was valid 14412 once, but it clearly goes against a pattern we've deployed of late. 14413 14414 The underlying problem was that WebCore would re-use a PropertySlot in 14415 the case of a forwarding access, and the second use would not completely 14416 overwrite the first use. Solution: Make sure to overwrite m_offset when 14417 setting a value on a PropertySlot. (Other values already get implicitly 14418 overwritten during reuse.) 14419 14420 * runtime/PropertySlot.h: 14421 (JSC::PropertySlot::PropertySlot): 14422 (JSC::PropertySlot::setValueSlot): 14423 (JSC::PropertySlot::setValue): 14424 (JSC::PropertySlot::setRegisterSlot): 14425 (JSC::PropertySlot::setUndefined): 14426 (JSC::PropertySlot::slotBase): 14427 (JSC::PropertySlot::clearOffset): 14428 144292009-06-24 Gavin Barraclough <barraclough@apple.com> 14430 14431 Reviewed by Geoff Garen. 14432 14433 Enable JIT_OPTIMIZE_METHOD_CALLS on the branch, implementation matches current implemenatation in ToT. 14434 14435 * jit/JIT.h: 14436 * jit/JITPropertyAccess.cpp: 14437 (JSC::JIT::emit_op_method_check): 14438 (JSC::JIT::emitSlow_op_method_check): 14439 (JSC::JIT::emit_op_get_by_id): 14440 (JSC::JIT::compileGetByIdHotPath): 14441 (JSC::JIT::emitSlow_op_get_by_id): 14442 (JSC::JIT::compileGetByIdSlowCase): 14443 144442009-06-23 Geoffrey Garen <ggaren@apple.com> 14445 14446 Reviewed by Sam Weinig. 14447 14448 Bit off a tiny bit more of standardizing opcode behavior to help with result 14449 caching. 14450 14451 SunSpider reports no change, v8 maybe a tiny speedup. 14452 14453 * jit/JITOpcodes.cpp: 14454 (JSC::JIT::emit_op_to_jsnumber): 14455 (JSC::JIT::emitSlow_op_to_jsnumber): 14456 (JSC::JIT::emit_op_convert_this): 14457 (JSC::JIT::emitSlow_op_convert_this): 14458 144592009-06-23 Geoffrey Garen <ggaren@apple.com> 14460 14461 Reviewed by Sam Weinig. 14462 14463 Bit off a tiny bit more of standardizing opcode behavior to help with result 14464 caching -- including removing my old enemy, op_resolve_function, because 14465 it was non-standard, and removing it felt better than helping it limp along. 14466 14467 SunSpider reports no change, v8 maybe a tiny speedup. 14468 14469 * bytecode/CodeBlock.cpp: 14470 (JSC::CodeBlock::dump): 14471 * bytecode/Opcode.h: 14472 * bytecompiler/BytecodeGenerator.cpp: 14473 * bytecompiler/BytecodeGenerator.h: 14474 * interpreter/Interpreter.cpp: 14475 (JSC::Interpreter::privateExecute): 14476 * jit/JIT.cpp: 14477 (JSC::JIT::privateCompileMainPass): 14478 * jit/JIT.h: 14479 * jit/JITOpcodes.cpp: 14480 (JSC::JIT::emit_op_get_scoped_var): 14481 (JSC::JIT::emit_op_put_scoped_var): 14482 (JSC::JIT::emit_op_to_primitive): 14483 (JSC::JIT::emitSlow_op_to_primitive): 14484 * jit/JITStubs.cpp: 14485 * jit/JITStubs.h: 14486 * parser/Nodes.cpp: 14487 (JSC::FunctionCallResolveNode::emitBytecode): 14488 144892009-06-23 Geoffrey Garen <ggaren@apple.com> 14490 14491 Reviewed by Sam Weinig. 14492 14493 Bit off a tiny bit of standardizing opcode behavior to help with result 14494 caching. 14495 14496 0.6% SunSpider speedup. 0.3% v8 speedup. 14497 14498 * jit/JITInlineMethods.h: 14499 (JSC::JIT::emitLoad): Accomodate a base register that overlaps with payload 14500 by loading tag before payload, to avoid stomping base/payload. 14501 14502 * jit/JITOpcodes.cpp: 14503 (JSC::JIT::emit_op_mov): Abide by the standard "tag in regT1, payload in 14504 regT0" semantics. 14505 14506 (JSC::JIT::emit_op_get_global_var): 14507 (JSC::JIT::emit_op_put_global_var): Ditto. Also, removed some irrelevent 14508 loads while I was at it. The global object's "d" pointer never changes 14509 after construction. 14510 145112009-06-23 Gavin Barraclough <barraclough@apple.com> 14512 14513 Reviewed by Sam Weinig. 14514 14515 Remove 'arguments' field from Register union (again). 14516 This time do so without breaking tests (radical, I know). 14517 14518 * interpreter/CallFrame.h: 14519 (JSC::ExecState::optionalCalleeArguments): 14520 (JSC::ExecState::setArgumentCount): 14521 (JSC::ExecState::init): 14522 * interpreter/Interpreter.cpp: 14523 (JSC::Interpreter::dumpRegisters): 14524 (JSC::Interpreter::unwindCallFrame): 14525 (JSC::Interpreter::privateExecute): 14526 (JSC::Interpreter::retrieveArguments): 14527 * interpreter/Register.h: 14528 (JSC::Register::withInt): 14529 (JSC::Register::): 14530 (JSC::Register::Register): 14531 (JSC::Register::i): 14532 * jit/JITStubs.cpp: 14533 (JSC::JITStubs::cti_op_tear_off_arguments): 14534 * runtime/Arguments.h: 14535 (JSC::JSActivation::copyRegisters): 14536 (JSC::Register::arguments): 14537 * runtime/JSActivation.cpp: 14538 (JSC::JSActivation::argumentsGetter): 14539 * runtime/JSActivation.h: 14540 145412009-06-23 Geoffrey Garen <ggaren@apple.com> 14542 14543 Reviewed by Sam Weinig. 14544 14545 Removed some result register tracking cruft in preparation for a new 14546 result tracking mechanism. 14547 14548 SunSpider reports no change. 14549 14550 * assembler/AbstractMacroAssembler.h: 14551 * assembler/X86Assembler.h: 14552 (JSC::X86Assembler::JmpDst::JmpDst): No need to track jump targets in 14553 machine code; we already do this in bytecode. 14554 14555 * jit/JIT.cpp: 14556 (JSC::JIT::JIT): 14557 (JSC::JIT::emitTimeoutCheck): Make sure to save and restore the result 14558 registers, so an opcode with a timeout check can still benefit from result 14559 register caching. 14560 14561 (JSC::JIT::privateCompileMainPass): 14562 (JSC::JIT::privateCompileSlowCases): Removed calls to killLastResultRegister() 14563 in preparation for something new. 14564 14565 * jit/JIT.h: 14566 * jit/JITArithmetic.cpp: 14567 (JSC::JIT::emit_op_jnless): 14568 (JSC::JIT::emit_op_jnlesseq): 14569 * jit/JITInlineMethods.h: 14570 (JSC::JIT::emitGetFromCallFrameHeaderPtr): 14571 (JSC::JIT::emitGetFromCallFrameHeader32): 14572 * jit/JITOpcodes.cpp: 14573 (JSC::JIT::emit_op_jmp): 14574 (JSC::JIT::emit_op_jfalse): 14575 (JSC::JIT::emit_op_jtrue): 14576 (JSC::JIT::emit_op_jeq_null): 14577 (JSC::JIT::emit_op_jneq_null): 14578 (JSC::JIT::emit_op_jneq_ptr): 14579 (JSC::JIT::emit_op_jsr): 14580 (JSC::JIT::emit_op_sret): 14581 (JSC::JIT::emit_op_jmp_scopes): ditto 14582 14583 * jit/JITStubCall.h: 14584 (JSC::JITStubCall::JITStubCall): 14585 (JSC::JITStubCall::getArgument): added a mechanism for reloading an argument 14586 you passed to a JIT stub, for use in emitTimeoutCheck. 14587 145882009-06-23 Sam Weinig <sam@webkit.org> 14589 14590 Reviewed by Geoffrey Garen. 14591 14592 Remove now-useless inplace variants of binary ops. 14593 14594 * jit/JIT.h: 14595 * jit/JITArithmetic.cpp: 14596 (JSC::JIT::emit_op_bitand): 14597 (JSC::JIT::emit_op_bitor): 14598 (JSC::JIT::emit_op_bitxor): 14599 (JSC::JIT::emit_op_add): 14600 (JSC::JIT::emit_op_sub): 14601 (JSC::JIT::emit_op_mul): 14602 146032009-06-23 Sam Weinig <sam@webkit.org> 14604 14605 Reviewed by Geoffrey Garen. 14606 14607 Move off memory operands to aid in re-enabling result caching. 14608 14609 - No regression measured. 14610 14611 * jit/JIT.h: 14612 * jit/JITArithmetic.cpp: 14613 (JSC::JIT::emit_op_negate): 14614 (JSC::JIT::emit_op_jnless): 14615 (JSC::JIT::emit_op_jnlesseq): 14616 (JSC::JIT::emit_op_lshift): 14617 (JSC::JIT::emit_op_rshift): 14618 (JSC::JIT::emit_op_bitand): 14619 (JSC::JIT::emitBitAnd32Constant): 14620 (JSC::JIT::emitBitAnd32InPlace): 14621 (JSC::JIT::emit_op_bitor): 14622 (JSC::JIT::emitBitOr32Constant): 14623 (JSC::JIT::emitBitOr32InPlace): 14624 (JSC::JIT::emit_op_bitxor): 14625 (JSC::JIT::emitBitXor32Constant): 14626 (JSC::JIT::emitBitXor32InPlace): 14627 (JSC::JIT::emit_op_bitnot): 14628 (JSC::JIT::emit_op_post_inc): 14629 (JSC::JIT::emit_op_post_dec): 14630 (JSC::JIT::emit_op_pre_inc): 14631 (JSC::JIT::emitSlow_op_pre_inc): 14632 (JSC::JIT::emit_op_pre_dec): 14633 (JSC::JIT::emitSlow_op_pre_dec): 14634 (JSC::JIT::emit_op_add): 14635 (JSC::JIT::emitAdd32Constant): 14636 (JSC::JIT::emitAdd32InPlace): 14637 (JSC::JIT::emitSlow_op_add): 14638 (JSC::JIT::emitSlowAdd32Constant): 14639 (JSC::JIT::emit_op_sub): 14640 (JSC::JIT::emitSlow_op_sub): 14641 (JSC::JIT::emitSub32ConstantLeft): 14642 (JSC::JIT::emitSub32ConstantRight): 14643 (JSC::JIT::emitSub32InPlaceLeft): 14644 (JSC::JIT::emitSub32InPlaceRight): 14645 (JSC::JIT::emitBinaryDoubleOp): 14646 (JSC::JIT::emit_op_mul): 14647 (JSC::JIT::emitMul32InPlace): 14648 (JSC::JIT::emit_op_div): 14649 (JSC::JIT::emit_op_mod): 14650 * jit/JITCall.cpp: 14651 (JSC::JIT::compileOpCallVarargs): 14652 * jit/JITOpcodes.cpp: 14653 (JSC::JIT::emit_op_loop_if_less): 14654 (JSC::JIT::emit_op_loop_if_lesseq): 14655 (JSC::JIT::emit_op_instanceof): 14656 (JSC::JIT::emit_op_to_primitive): 14657 (JSC::JIT::emit_op_not): 14658 (JSC::JIT::emit_op_jneq_ptr): 14659 (JSC::JIT::emit_op_eq): 14660 (JSC::JIT::emit_op_neq): 14661 (JSC::JIT::emit_op_to_jsnumber): 14662 * jit/JITPropertyAccess.cpp: 14663 (JSC::JIT::emit_op_get_by_val): 14664 (JSC::JIT::emit_op_put_by_val): 14665 146662009-06-23 Geoffrey Garen <ggaren@apple.com> 14667 14668 Reviewed by Sam Weinig. 14669 14670 Fixed some missing and/or misplaced labels in bytecode generation, so 14671 we don't have to work around them in JIT code generation. 14672 14673 * bytecompiler/BytecodeGenerator.cpp: 14674 (JSC::BytecodeGenerator::emitJumpSubroutine): 14675 * parser/Nodes.cpp: 14676 (JSC::TryNode::emitBytecode): 14677 146782009-06-22 Geoffrey Garen <ggaren@apple.com> 14679 14680 Reviewed by Sam Weinig. 14681 14682 For member function calls, emit "this" directly into the "this" slot 14683 for the function call, instead of moving it there later. This reduces 14684 time spent in op_mov during certain calls, like "a.b.c()". 14685 14686 1%-2% speedup on v8, mostly richards and delta-blue. 14687 14688 * parser/Nodes.cpp: 14689 (JSC::FunctionCallDotNode::emitBytecode): 14690 146912009-06-22 Gavin Barraclough <barraclough@apple.com> 14692 14693 Reviewed by Sam Weinig. 14694 14695 Remove 'arguments' field from Register union. Having JSCell derived types in the union is 14696 dangerous since it opens the possibility for the field to be written as a raw pointer but 14697 then read as a JSValue. This will lead to statle data being read for the tag, which may 14698 be dangerous. Having removed Arguments* types form Register, all arguments objects must 14699 always explicitly be stored in the register file as JSValues. 14700 14701 * interpreter/CallFrame.h: 14702 (JSC::ExecState::optionalCalleeArguments): 14703 * interpreter/Interpreter.cpp: 14704 (JSC::Interpreter::unwindCallFrame): 14705 (JSC::Interpreter::privateExecute): 14706 (JSC::Interpreter::retrieveArguments): 14707 * interpreter/Register.h: 14708 (JSC::Register::): 14709 * jit/JITStubs.cpp: 14710 (JSC::JITStubs::cti_op_tear_off_arguments): 14711 * runtime/Arguments.h: 14712 (JSC::JSActivation::copyRegisters): 14713 * runtime/JSActivation.cpp: 14714 (JSC::JSActivation::argumentsGetter): 14715 * runtime/JSActivation.h: 14716 147172009-06-03 Sam Weinig <sam@webkit.org> 14718 14719 Reviewed by Geoffrey Garen. 14720 14721 Add back known this value optimization by abstracting 14722 slow case if not JSCell jumps. 14723 14724 * jit/JIT.h: 14725 * jit/JITCall.cpp: 14726 (JSC::JIT::compileOpCallVarargs): 14727 (JSC::JIT::compileOpCallVarargsSlowCase): 14728 (JSC::JIT::compileOpCall): 14729 (JSC::JIT::compileOpCallSlowCase): 14730 * jit/JITInlineMethods.h: 14731 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 14732 (JSC::JIT::linkSlowCaseIfNotJSCell): 14733 * jit/JITOpcodes.cpp: 14734 (JSC::JIT::emit_op_instanceof): 14735 (JSC::JIT::emitSlow_op_instanceof): 14736 * jit/JITPropertyAccess.cpp: 14737 (JSC::JIT::emit_op_get_by_val): 14738 (JSC::JIT::emitSlow_op_get_by_val): 14739 (JSC::JIT::emit_op_put_by_val): 14740 (JSC::JIT::emitSlow_op_put_by_val): 14741 (JSC::JIT::emit_op_get_by_id): 14742 (JSC::JIT::emitSlow_op_get_by_id): 14743 (JSC::JIT::emit_op_put_by_id): 14744 (JSC::JIT::emitSlow_op_put_by_id): 14745 147462009-06-01 Geoffrey Garen <ggaren@apple.com> 14747 14748 Reviewed by Sam Weinig. 14749 14750 Fixed some of the regression in crypto-aes.js. (8.5% speedup in 14751 crypto-aes.js.) 14752 14753 SunSpider reports no change overall. 14754 14755 Division was producing double results, which took the slow path through 14756 array access code. 14757 14758 Strangely, all my attempts at versions of this patch that modified array 14759 access code to accept ints encoded as doubles along the fast or slow paths 14760 were regressions. So I did this instead. 14761 14762 * jit/JITArithmetic.cpp: 14763 (JSC::JIT::emit_op_div): When dividing an int by an int, go ahead and try 14764 to turn the result into an int. Don't just do int division, though, because 14765 testing shows it to be slower than SSE double division, and the corner 14766 cases are pretty complicated / lengthy on top of that. Also, don't try 14767 to canonicalize division of known tiny numerators into ints, since that's a 14768 waste of time. 14769 147702009-05-26 Geoffrey Garen <ggaren@apple.com> 14771 14772 Reviewed by Oliver Hunt. 14773 14774 Fixed a regression caused by my recent fix for NaN. 14775 14776 * jit/JITArithmetic.cpp: 14777 (JSC::JIT::emitBinaryDoubleOp): Actually do the comparison in reverse 14778 order, like the ChangeLog said we would, bokay? 14779 147802009-05-26 Geoffrey Garen <ggaren@apple.com> 14781 14782 Reviewed by Sam Weinig and Oliver Hunt. 14783 14784 Fixed two edge cases in %: 14785 14786 - Don't do -2147483648 % x as a fast case, since you might do -2147483648 % -1, 14787 which will signal a hardware exception due to overflow. 14788 14789 - In the case of a zero remainder, be sure to store negative zero if the 14790 dividend was zero. 14791 14792 SunSpider reports no change. 14793 14794 * jit/JITArithmetic.cpp: 14795 (JSC::JIT::emit_op_mod): 14796 (JSC::JIT::emitSlow_op_mod): 14797 147982009-05-25 Geoffrey Garen <ggaren@apple.com> 14799 14800 Reviewed by Maciej Stachowiak. 14801 14802 Fixed a regression when comparing to NaN. 14803 14804 * jit/JITArithmetic.cpp: 14805 (JSC::JIT::emitBinaryDoubleOp): For op_jnless and op_jnless_eq, do the 14806 comparison in reverse order, and jump if the result is below or 14807 below-or-equal. This ensures that we do jump in the case of NaN. 14808 148092009-05-25 Geoffrey Garen <ggaren@apple.com> 14810 14811 Reviewed by Oliver Hunt. 14812 14813 SunSpider says no change. 14814 14815 Fixed regressions in fast/js/var-declarations-shadowing.html and 14816 fast/js/equality.html, caused by recent == and != optimizations. 14817 14818 * jit/JITStubs.cpp: 14819 (JSC::JITStubs::cti_op_eq): Don't treat "compare to string" as always 14820 numeric or string comparison. If the second operand is an object, you 14821 need to ToPrimitive it, and start all over again. Also, I wrote out each 14822 of the possible cases explicitly, to cut down on redundant branching. 14823 148242009-05-25 Sam Weinig <sam@webkit.org> 14825 14826 Reviewed by Mark Rowe. 14827 14828 Fix bug in fast/js/constant-folding.html where we were not negating 14829 -0 properly. 14830 14831 * jit/JITArithmetic.cpp: 14832 (JSC::JIT::emit_op_negate): 14833 148342009-05-23 Geoffrey Garen <ggaren@apple.com> 14835 14836 Reviewed by Oliver Hunt. 14837 14838 Refactored new slow case codegen for == and !=. 14839 14840 SunSpider reports no change, maybe a tiny speedup. 14841 14842 * jit/JITOpcodes.cpp: 14843 (JSC::JIT::emitSlow_op_eq): 14844 (JSC::JIT::emitSlow_op_neq): Made a vptr comparison a *Ptr operation, 14845 instead of *32, to make it portable to 64bit. Reorganized the string 14846 and generic cases to make their control flow a little clearer. 14847 148482009-05-23 Geoffrey Garen <ggaren@apple.com> 14849 14850 Reviewed by Maciej Stachowiak. 14851 14852 Optimized == and != for our new value representation -- especially for strings. 14853 14854 14% speedup on date-format-tofte. 14855 14856 * jit/JITOpcodes.cpp: 14857 (JSC::JIT::emit_op_eq): 14858 (JSC::JIT::emitSlow_op_eq): 14859 (JSC::JIT::emit_op_neq): 14860 (JSC::JIT::emitSlow_op_neq): 14861 * jit/JITStubCall.h: 14862 (JSC::JITStubCall::JITStubCall): 14863 * jit/JITStubs.cpp: 14864 (JSC::JITStubs::cti_op_eq): 14865 (JSC::JITStubs::cti_op_eq_strings): 14866 (JSC::JITStubs::cti_op_call_eval): 14867 * jit/JITStubs.h: 14868 (JSC::): 14869 * runtime/JSValue.h: 14870 148712009-05-22 Sam Weinig <sam@webkit.org> 14872 14873 Reviewed by Gavin Barraclough. 14874 14875 Fix non-SSE enabled builds. 14876 14877 * jit/JITArithmetic.cpp: 14878 (JSC::JIT::emitSlow_op_add): Don't early return here, we still need to call the JIT stub. 14879 (JSC::JIT::emitSlow_op_sub): Ditto. 14880 148812009-05-22 Geoffrey Garen <ggaren@apple.com> 14882 14883 Reviewed by Sam Weinig. 14884 14885 Here's a thought: let's not take a jit stub call just to multiply by 1, 14886 bokay? 14887 14888 imul doesn't set the zero flag, so to test for a zero result, we need 14889 an explicit instruction. (Luckily, it does set the overflow flag, so 14890 we can still use that.) 14891 14892 * jit/JIT.h: 14893 * jit/JITArithmetic.cpp: 14894 (JSC::JIT::emit_op_mul): 14895 (JSC::JIT::emitSlow_op_mul): 14896 (JSC::JIT::emitMul32InPlace): 14897 148982009-05-22 Sam Weinig <sam@webkit.org> 14899 14900 Reviewed by Geoffrey "Premature Commit" Garen. 14901 14902 Add back constant integer cases for op_add. 14903 14904 * jit/JIT.h: 14905 * jit/JITArithmetic.cpp: 14906 (JSC::JIT::emit_op_add): 14907 (JSC::JIT::emitAdd32Constant): 14908 (JSC::JIT::emitSlow_op_add): 14909 (JSC::JIT::emitSlowAdd32Constant): 14910 * jit/JITInlineMethods.h: 14911 (JSC::JIT::getConstantOperandImmediateDouble): 14912 (JSC::JIT::isOperandConstantImmediateDouble): 14913 149142009-05-22 Geoffrey Garen <ggaren@apple.com> 14915 14916 Reviewed by Sam Weinig. 14917 14918 Added fast double cases for op_jnless and op_jnlesseq. 14919 14920 * assembler/AbstractMacroAssembler.h: 14921 (JSC::AbstractMacroAssembler::JumpList::jumps): New accesor, used by 14922 addSlowCase. 14923 14924 * assembler/X86Assembler.h: 14925 (JSC::X86Assembler::ucomisd_rm): New method for comparing register to 14926 memory. 14927 14928 * jit/JIT.h: 14929 * jit/JITArithmetic.cpp: 14930 (JSC::JIT::emit_op_jnless): 14931 (JSC::JIT::emitSlow_op_jnless): 14932 (JSC::JIT::emit_op_jnlesseq): 14933 (JSC::JIT::emitSlow_op_jnlesseq): 14934 (JSC::JIT::emit_op_add): 14935 (JSC::JIT::emit_op_sub): 14936 (JSC::JIT::emitBinaryDoubleOp): 14937 (JSC::JIT::emit_op_mul): 14938 (JSC::JIT::emit_op_div): Modified emitBinaryDoubleOp to accept comparison/jump 14939 operations in addition to operations with explicit result registers. 14940 14941 * jit/JITInlineMethods.h: 14942 (JSC::JIT::addSlowCase): Added an "addSlowCase" for JumpLists, so clients 14943 can track multiple jumps to the same slow case condition together. 14944 149452009-05-21 Sam Weinig <sam@webkit.org> 14946 14947 Reviewed by Gavin Barraclough. 14948 14949 Implement op_negate inline fast cases. 14950 14951 * assembler/MacroAssemblerX86Common.h: 14952 (JSC::MacroAssemblerX86Common::neg32): 14953 * assembler/X86Assembler.h: 14954 (JSC::X86Assembler::): 14955 (JSC::X86Assembler::negl_m): 14956 (JSC::X86Assembler::xorpd_rr): 14957 * jit/JIT.cpp: 14958 (JSC::JIT::privateCompileMainPass): 14959 (JSC::JIT::privateCompileSlowCases): 14960 * jit/JIT.h: 14961 * jit/JITArithmetic.cpp: 14962 (JSC::JIT::emit_op_negate): 14963 (JSC::JIT::emitSlow_op_negate): 14964 149652009-05-20 Sam Weinig <sam@webkit.org> 14966 14967 Reviewed by Gavin Barraclough. 14968 14969 Update the patchOffsetGetByIdSlowCaseCall constant for the 14970 case that OPCODE_SAMPLING is enabled. 14971 14972 * jit/JIT.h: 14973 149742009-05-20 Geoffrey Garen <ggaren@apple.com> 14975 14976 Reviewed by Sam Weinig. 14977 14978 Added support for inline subtraction of doubles. 14979 14980 * jit/JITArithmetic.cpp: 14981 (JSC::JIT::emit_op_sub): 14982 (JSC::JIT::emitSlow_op_sub): 14983 (JSC::JIT::emitSlowSub32InPlaceLeft): 14984 (JSC::JIT::emitBinaryDoubleOp): 14985 149862009-05-20 Sam Weinig <sam@webkit.org> 14987 14988 Reviewed by Geoffrey Garen. 14989 14990 Added support for inline division. 14991 14992 * assembler/X86Assembler.h: 14993 (JSC::X86Assembler::): 14994 (JSC::X86Assembler::divsd_rr): 14995 (JSC::X86Assembler::divsd_mr): 14996 * bytecode/CodeBlock.cpp: 14997 (JSC::CodeBlock::dump): 14998 * bytecode/Opcode.h: 14999 * bytecompiler/BytecodeGenerator.cpp: 15000 (JSC::BytecodeGenerator::emitBinaryOp): 15001 * interpreter/Interpreter.cpp: 15002 (JSC::Interpreter::privateExecute): 15003 * jit/JIT.cpp: 15004 (JSC::JIT::privateCompileMainPass): 15005 (JSC::JIT::privateCompileSlowCases): 15006 * jit/JIT.h: 15007 * jit/JITArithmetic.cpp: 15008 (JSC::JIT::emitBinaryDoubleOp): 15009 (JSC::JIT::emit_op_div): 15010 (JSC::JIT::emitSlow_op_div): 15011 150122009-05-20 Geoffrey Garen <ggaren@apple.com> 15013 15014 Reviewed by Sam Weinig. 15015 15016 Added support for inline addition of doubles. 15017 15018 * jit/JITArithmetic.cpp: 15019 (JSC::JIT::emit_op_add): 15020 (JSC::JIT::emitSlow_op_add): 15021 (JSC::JIT::emitSlowAdd32InPlace): 15022 (JSC::JIT::emitBinaryDoubleOp): 15023 (JSC::JIT::emit_op_mul): 15024 (JSC::JIT::emitSlow_op_mul): 15025 150262009-05-20 Geoffrey Garen <ggaren@apple.com> 15027 15028 Reviewed by Sam Weinig. 15029 15030 Factored inline double operations into a helper function, so that we 15031 can reuse this code for other math operations. 15032 15033 * jit/JIT.h: 15034 * jit/JITArithmetic.cpp: 15035 (JSC::JIT::emitBinaryDoubleOp): 15036 (JSC::JIT::emit_op_mul): 15037 * jit/JITCall.cpp: 15038 (JSC::JIT::compileOpCallInitializeCallFrame): 15039 150402009-05-20 Geoffrey Garen <ggaren@apple.com> 15041 15042 Reviewed by Sam Weinig. 15043 15044 Added support for inline multiplication of doubles. 15045 15046 * assembler/X86Assembler.h: 15047 (JSC::X86Assembler::cvtsi2sd_mr): New function, useful for loading an 15048 int32 into a double register. 15049 15050 * jit/JITArithmetic.cpp: 15051 (JSC::JIT::emit_op_mul): 15052 (JSC::JIT::emitSlow_op_mul): Filled out these cases for double arithmetic. 15053 15054 * jit/JIT.h: 15055 * jit/JITInlineMethods.h: 15056 (JSC::JIT::addressFor): New function, useful for addressing a JSValue's 15057 full 64bits as a double. 15058 150592009-05-19 Sam Weinig <sam@webkit.org> 15060 15061 Reviewed by Geoffrey Garen. 15062 15063 Implement and enable optimized calls. 15064 15065 * jit/JIT.cpp: 15066 (JSC::JIT::privateCompileCTIMachineTrampolines): Add ENABLE(JIT_OPTIMIZE_CALL) guards 15067 around the the optimize call only trampolines (virtualCallPreLink and virtualCallLink). 15068 Update the trampolines to account for the new JSValue representation. 15069 (JSC::JIT::unlinkCall): Use NULL instead of JSValue noValue. 15070 15071 * jit/JITCall.cpp: 15072 (JSC::JIT::compileOpCall): Update to account for the new JSValue representation 15073 (JSC::JIT::compileOpCallSlowCase): Ditto. 15074 15075 * jit/JITStubs.h: Remove incorrect !ENABLE(JIT_OPTIMIZE_CALL) guard. 15076 15077 * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_CALL. 15078 150792009-05-19 Sam Weinig <sam@webkit.org> 15080 15081 Reviewed by Geoffrey Garen. 15082 15083 Implement and enable optimized property access. 15084 15085 * assembler/AbstractMacroAssembler.h: Fix comment. 15086 * jit/JIT.cpp: 15087 (JSC::JIT::privateCompileCTIMachineTrampolines): Remove array length trampoline 15088 and implement the string length trampoline. 15089 * jit/JIT.h: Add new constants for patch offsets. 15090 * jit/JITInlineMethods.h: Remove FIELD_OFFSET which is now in StdLibExtras.h. 15091 * jit/JITPropertyAccess.cpp: 15092 (JSC::JIT::emit_op_get_by_id): 15093 (JSC::JIT::emitSlow_op_get_by_id): 15094 (JSC::JIT::emit_op_put_by_id): 15095 (JSC::JIT::emitSlow_op_put_by_id): 15096 (JSC::JIT::compilePutDirectOffset): 15097 (JSC::JIT::compileGetDirectOffset): 15098 (JSC::JIT::privateCompilePutByIdTransition): 15099 (JSC::JIT::patchGetByIdSelf): 15100 (JSC::JIT::patchPutByIdReplace): 15101 (JSC::JIT::privateCompilePatchGetArrayLength): 15102 (JSC::JIT::privateCompileGetByIdProto): 15103 (JSC::JIT::privateCompileGetByIdSelfList): 15104 (JSC::JIT::privateCompileGetByIdProtoList): 15105 (JSC::JIT::privateCompileGetByIdChainList): 15106 (JSC::JIT::privateCompileGetByIdChain): 15107 * jit/JITStubCall.h: 15108 (JSC::JITStubCall::addArgument): Add version of addArgument that takes 15109 two registers for the tag and payload. 15110 * jit/JITStubs.cpp: 15111 (JSC::JITStubs::JITStubs): Remove array length trampoline pointer. 15112 (JSC::JITStubs::cti_op_get_by_id_self_fail): 15113 * jit/JITStubs.h: 15114 * runtime/JSObject.h: 15115 (JSC::JSObject::JSObject): Move m_inheritorID below the property storage 15116 to align it to a 16 byte boundary. 15117 * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 15118 * wtf/StdLibExtras.h: Move FIELD_OFFSET here. 15119 151202009-05-17 Sam Weinig <sam@webkit.org> 15121 15122 Reviewed by Geoffrey Garen. 15123 15124 Remove unneeded ExecState parameter from the number JSValue constructors. 15125 15126 * runtime/JSValue.h: 15127 (JSC::jsNumber): 15128 (JSC::jsNaN): 15129 (JSC::JSValue::JSValue): 15130 151312009-05-15 Sam Weinig <sam@webkit.org> 15132 15133 Reviewed by Geoffrey Garen. 15134 15135 Implemented fast path for op_put_by_val when putting to arrays. 15136 15137 * jit/JITPropertyAccess.cpp: 15138 (JSC::JIT::emit_op_put_by_val): 15139 (JSC::JIT::emitSlow_op_put_by_val): 15140 151412009-05-15 Geoffrey Garen <ggaren@apple.com> (Mostly by Sam) 15142 15143 Reviewed by Sam Weinig. 15144 15145 Implemented fast path for op_get_by_val when accessing array. 15146 15147 * jit/JIT.cpp: 15148 * jit/JITPropertyAccess.cpp: 15149 (JSC::JIT::emit_op_get_by_val): 15150 (JSC::JIT::emitSlow_op_get_by_val): 15151 151522009-05-14 Geoffrey Garen <ggaren@apple.com> 15153 15154 Reviewed by Sam Weinig. 15155 15156 Fixed a failure in fast/js/math-transforms.html caused by failing to 15157 preserve -0 in multiplication. 15158 15159 * assembler/X86Assembler.h: 15160 (JSC::X86Assembler::jz): 15161 * jit/JITArithmetic.cpp: 15162 (JSC::JIT::emit_op_mul): 15163 (JSC::JIT::emitSlow_op_mul): 15164 (JSC::JIT::emitMul32Constant): 15165 (JSC::JIT::emitMul32InPlace): Check both for overflow and for zero when 15166 doing multiplication. Use a slow case to get these right. 15167 151682009-05-14 Geoffrey Garen <ggaren@apple.com> 15169 15170 Reviewed by Sam Weinig. 15171 15172 Fixed a bug in the varargs calling convention. 15173 15174 * jit/JITCall.cpp: 15175 (JSC::JIT::compileOpCallVarargs): Move the argument count into regT1, 15176 since that's where ctiVirtualCall expects it to be. 15177 151782009-05-14 Geoffrey Garen <ggaren@apple.com> 15179 15180 Reviewed by Sam Weinig. 15181 15182 Fixed a small bug in instanceof's looping code. 15183 15184 * jit/JITOpcodes.cpp: 15185 (JSC::JIT::emit_op_instanceof): NULL means the object has no prototype, 15186 so only loop when *not* equal to NULL. 15187 151882009-05-14 Geoffrey Garen <ggaren@apple.com> 15189 15190 Reviewed by Sam Weinig. 15191 15192 Fixed a small bug in instanceof's result writing code. 15193 15194 * jit/JITOpcodes.cpp: 15195 (JSC::JIT::emit_op_instanceof): Make sure to fill out the payload bits 15196 in all cases. 15197 151982009-05-14 Sam Weinig <sam@webkit.org> 15199 15200 Reviewed by Geoffrey Garen. 15201 15202 Removed an invalid assertion in cti_op_urshift which 15203 depended on a fast path for op_urshift which has 15204 never existed. 15205 15206 * jit/JITStubs.cpp: 15207 (JSC::JITStubs::cti_op_urshift): 15208 152092009-05-14 Geoffrey Garen <ggaren@apple.com> 15210 15211 Reviewed by Sam Weinig. 15212 15213 Fixed loop_if_true, which had the same reversed test that jtrue had. 15214 15215 * jit/JITOpcodes.cpp: 15216 (JSC::JIT::emit_op_loop_if_true): 15217 152182009-05-14 Sam Weinig <sam@webkit.org> 15219 15220 Reviewed by Geoffrey Garen. 15221 15222 In op_neq, we apparently want to check that one value 15223 does *not* equal another. Go figure. 15224 15225 * jit/JITOpcodes.cpp: 15226 (JSC::JIT::emit_op_neq): 15227 152282009-05-14 Sam Weinig <sam@webkit.org> 15229 15230 Reviewed by Geoffrey Garen. 15231 15232 The slow case of op_mod should call op_mod's jit stub, 15233 not op_mul. That would be dumb. 15234 15235 * jit/JITArithmetic.cpp: 15236 (JSC::JIT::emitSlow_op_mod): 15237 152382009-05-14 Geoffrey Garen <ggaren@apple.com> 15239 15240 Reviewed by Sam Weinig. 15241 15242 Fixed problems when using 'arguments' due to a half-initialized register. 15243 15244 * interpreter/CallFrame.h: 15245 (JSC::ExecState::setCalleeArguments): 15246 (JSC::ExecState::init): Require a full JSValue when setting up the 15247 'arguments' virtual register, since this register is accessible from JIT 15248 code and bytecode, and needs to be a true JSValue. 15249 15250 * interpreter/CallFrameClosure.h: 15251 (JSC::CallFrameClosure::resetCallFrame): ditto 15252 15253 * interpreter/Interpreter.cpp: 15254 (JSC::Interpreter::privateExecute): ditto 15255 15256 * interpreter/Register.h: Removed the constructor that allowed assignment 15257 of a JSArguments* to a register. That is not safe. See above. 15258 15259 * jit/JITStubs.cpp: 15260 (JSC::JITStubs::cti_op_create_arguments): 15261 (JSC::JITStubs::cti_op_create_arguments_no_params): ditto 15262 152632009-05-14 Sam Weinig <sam@webkit.org> 15264 15265 Reviewed by Geoffrey Garen. 15266 15267 We really want to go to the slow case in op_jfalse and 15268 op_jtrue if the value is *not* boolean. 15269 15270 * jit/JITOpcodes.cpp: 15271 (JSC::JIT::emit_op_jfalse): 15272 (JSC::JIT::emit_op_jtrue): 15273 152742009-05-14 Sam Weinig <sam@webkit.org> 15275 15276 Reviewed by Geoffrey Garen. 15277 15278 Flipped the condition when emitting a an op_loop_if_less or op_loop_if_lesseq 15279 if the first operand is a constant. 15280 15281 * jit/JITOpcodes.cpp: 15282 (JSC::JIT::emit_op_loop_if_less): 15283 (JSC::JIT::emit_op_loop_if_lesseq): 15284 152852009-05-14 Sam Weinig <sam@webkit.org> 15286 15287 Reviewed by Geoffrey Garen. 15288 15289 Added missing return in op_jnless and op_jnlesseq. 15290 15291 * jit/JITArithmetic.cpp: 15292 (JSC::JIT::emit_op_jnless): 15293 (JSC::JIT::emit_op_jnlesseq): 15294 152952009-05-14 Sam Weinig <sam@webkit.org> 15296 15297 Reviewed by Geoffrey Garen. 15298 15299 Load constants into the the register file as a temporary measure to 15300 aid bring up. This allows us to use to treat constants like any 15301 other virtual register. 15302 15303 * jit/JITOpcodes.cpp: 15304 (JSC::JIT::emit_op_enter): 15305 (JSC::JIT::emit_op_enter_with_activation): 15306 153072009-05-14 Geoffrey Garen <ggaren@apple.com> 15308 15309 Reviewed by Sam Weinig. 15310 15311 Implemented op_strict_eq. Original patch by Snowy, by way of Sam and Gavin. 15312 15313 * assembler/MacroAssemblerX86Common.h: 15314 (JSC::MacroAssemblerX86Common::set8): Added set8, since it's slightly 15315 faster than set32, and the new value representation usually doesn't 15316 need set32. 15317 15318 * jit/JIT.cpp: 15319 * jit/JIT.h: 15320 * jit/JITInlineMethods.h: 15321 (JSC::JIT::emitLoadTag): 15322 (JSC::JIT::emitLoadPayload): Added helper functions for dealing with 15323 constants. Eventually, we should write special cases for all constants, 15324 but these are helpful in the short term. 15325 15326 * jit/JITOpcodes.cpp: 15327 (JSC::JIT::compileOpStrictEq): 15328 (JSC::JIT::emitSlow_op_stricteq): 15329 (JSC::JIT::emitSlow_op_nstricteq): teh opcodez. 15330 15331 * runtime/JSValue.h: 15332 (JSC::JSValue::): 15333 (JSC::JSValue::isDouble): Added a LowestTag for clarity. 15334 153352009-05-13 Geoffrey Garen <ggaren@apple.com> 15336 15337 Reviewed by Sam Weinig. 15338 15339 Fixed some bugs in host function calls. 15340 15341 testapi now passes! 15342 15343 * jit/JIT.cpp: Changed some registers around to avoid overwriting edx:eax, 15344 which is how JSValues are now returned. Also changed the code that 15345 passes thisValue to pass the full 64bits of the value. Also added 15346 an #error compiler directive to other platform builds, since the JSValue 15347 return signature probably won't return in edx:eax on those platforms, 15348 and we'll have to investigate a solution. 15349 153502009-05-13 Geoffrey Garen <ggaren@apple.com> 15351 15352 Reviewed by Sam Weinig. 15353 15354 Removed parameters from functions that are intended never to use their 15355 parameters. 15356 15357 * jit/JITPropertyAccess.cpp: 15358 (JSC::JIT::emitSlow_op_get_by_val): 15359 (JSC::JIT::emitSlow_op_put_by_val): 15360 153612009-05-13 Geoffrey Garen <ggaren@apple.com> 15362 15363 Reviewed by Sam Weinig. 15364 15365 Ported op_instance_of from TOT. It's basically the same, but some register 15366 stuff changed to memory stuff. 15367 15368 * jit/JITInlineMethods.h: 15369 (JSC::JIT::emitPutJITStubArgFromVirtualRegister): 15370 (JSC::JIT::emitStore): Changed to use helper functions. 15371 15372 * jit/JITOpcodes.cpp: 15373 (JSC::JIT::emit_op_instanceof): 15374 (JSC::JIT::emitSlow_op_instanceof): Ported from TOT. 15375 153762009-05-13 Geoffrey Garen <ggaren@apple.com> 15377 15378 Reviewed by Gavin Barraclough. 15379 15380 Added a comment to explain an exception-handling subtelty that we found 15381 hard to remember when reviewing my last patch. 15382 15383 * jit/JITOpcodes.cpp: 15384 (JSC::JIT::emit_op_catch): 15385 153862009-05-13 Geoffrey Garen <ggaren@apple.com> 15387 15388 Reviewed by Sam Weinig. 15389 15390 Implemented try/catch. 15391 15392 * jit/JITOpcodes.cpp: 15393 (JSC::JIT::emit_op_throw): Updated to use JITStackFrame abstraction. 15394 (JSC::JIT::emit_op_catch): Filled out. 15395 153962009-05-13 Sam Weinig <sam@webkit.org> 15397 15398 Reviewed by Geoffrey Garen. 15399 15400 Implemented op_loop_if_true, op_jfalse, op_jtrue, op_jeq_null and op_jneq_null 15401 15402 * jit/JITOpcodes.cpp: 15403 (JSC::JIT::emitSlow_op_instanceof): Moved from below to be next to its 15404 fast brother. 15405 15406 (JSC::JIT::emit_op_loop_if_true): Similar to the old version 15407 in that it tries to do the integer case first and reduce the 15408 number of jumps you might need to take. 15409 (JSC::JIT::emitSlow_op_loop_if_true): 15410 15411 (JSC::JIT::emit_op_jfalse): Very similar to op_loop_if_true, only 15412 the inverse and without a timeout check. 15413 (JSC::JIT::emitSlow_op_jfalse): 15414 15415 (JSC::JIT::emit_op_jtrue): Very similar to op_loop_if_true except 15416 without the timeout check. 15417 (JSC::JIT::emitSlow_op_jtrue): 15418 15419 (JSC::JIT::emit_op_jeq_null): Very similar to the implementation 15420 of op_eq, except it takes jumps instead of copying the condition 15421 to a dst. 15422 (JSC::JIT::emit_op_jneq_null): Ditto but for op_neq. 15423 154242009-05-13 Geoffrey Garen <ggaren@apple.com> 15425 15426 Reviewed by Sam Weinig. 15427 15428 Implemented op_call_varargs. 15429 15430 * jit/JITCall.cpp: 15431 (JSC::JIT::compileOpCallVarargsSetupArgs): 15432 (JSC::JIT::compileOpCallVarargs): 15433 (JSC::JIT::emit_op_call): 15434 (JSC::JIT::emit_op_call_eval): 15435 (JSC::JIT::emit_op_load_varargs): 15436 (JSC::JIT::emit_op_call_varargs): 15437 (JSC::JIT::emit_op_construct): 15438 * jit/JITOpcodes.cpp: 15439 (JSC::JIT::emit_op_jneq_ptr): 15440 154412009-05-13 Geoffrey Garen <ggaren@apple.com> 15442 15443 Reviewed by Sam Weinig. 15444 15445 Implemented op_call_eval. 15446 15447 * jit/JITCall.cpp: 15448 (JSC::JIT::compileOpCallVarargsSetupArgs): 15449 (JSC::JIT::compileOpCall): 15450 * jit/JITStubCall.h: 15451 (JSC::CallEvalJITStub::CallEvalJITStub): 15452 154532009-05-13 Sam Weinig <sam@webkit.org> 15454 15455 Reviewed by Gavin Barraclough. 15456 15457 Implemented op_not. (Gavin did most of the work!) 15458 15459 * jit/JITOpcodes.cpp: 15460 (JSC::JIT::emit_op_not): 15461 (JSC::JIT::emitSlow_op_not): 15462 154632009-05-13 Geoffrey Garen <ggaren@apple.com> 15464 15465 Reviewed by Sam Weinig. 15466 15467 Implemented op_global_resolve. 15468 15469 * jit/JITOpcodes.cpp: 15470 (JSC::JIT::emit_op_loop_if_less): 15471 (JSC::JIT::emit_op_loop_if_lesseq): Added back accidentally removed 15472 early returns. 15473 15474 (JSC::JIT::emit_op_resolve_global): 15475 * jit/JITStubs.cpp: 15476 (JSC::JITStubs::cti_op_resolve_global): Pretty similar to the old code, 15477 but we need two reads and a TimesEight step in order to account for the 15478 64bit value size. 15479 15480 * jit/JITStubs.h: 15481 (JSC::): Slightly tweaked this code to specialize for a JSGlobalObject*, 15482 to avoid having to pass an irrelevant tag pointer to the stub. 15483 154842009-05-13 Sam Weinig <sam@webkit.org> 15485 15486 Reviewed by Geoffrey Garen. 15487 15488 Implemented op_to_jsnumber. 15489 15490 * jit/JITOpcodes.cpp: 15491 (JSC::JIT::emit_op_to_jsnumber): 15492 (JSC::JIT::emitSlow_op_to_jsnumber): 15493 154942009-05-13 Sam Weinig <sam@webkit.org> 15495 15496 Reviewed by Geoffrey Garen. 15497 15498 Implemented op_convert_this. 15499 15500 * jit/JITOpcodes.cpp: 15501 (JSC::JIT::emit_op_convert_this): 15502 (JSC::JIT::emitSlow_op_convert_this): 15503 155042009-05-13 Geoffrey Garen <ggaren@apple.com> 15505 15506 Reviewed by Sam Weinig. 15507 15508 Got basic JS function and constructor calls working. 15509 15510 * jit/JIT.cpp: 15511 (JSC::JIT::privateCompileCTIMachineTrampolines): 15512 * jit/JIT.h: 15513 * jit/JITCall.cpp: 15514 (JSC::JIT::compileOpCallSetupArgs): 15515 (JSC::JIT::compileOpCallVarargsSetupArgs): 15516 (JSC::JIT::compileOpConstructSetupArgs): 15517 (JSC::JIT::emit_op_ret): 15518 (JSC::JIT::emit_op_construct_verify): 15519 (JSC::JIT::emitSlow_op_construct_verify): 15520 (JSC::JIT::emitSlow_op_call): 15521 (JSC::JIT::emitSlow_op_call_eval): 15522 (JSC::JIT::emitSlow_op_call_varargs): 15523 (JSC::JIT::emitSlow_op_construct): 15524 (JSC::JIT::compileOpCall): Filled out these cases, with call_eval #if'd out. 15525 15526 * jit/JITInlineMethods.h: 15527 (JSC::JIT::emitPutJITStubArgFromVirtualRegister): 15528 (JSC::JIT::emitLoad): Restored some legacy "*CTIArg*" functions, 15529 since I wanted to avoid the complexity of revamping the API here while 15530 trying to bring it up. Eventually, we should re-remove all of these functions. 15531 15532 (JSC::JIT::recordJumpTarget): Removed unnecessary macro cruft. You will 15533 not silence me, Sam Weinig! The world will know that you are a crufty, 15534 crufty, crufty programmer!!! 15535 15536 * jit/JITOpcodes.cpp: 15537 * jit/JITStubs.cpp: 15538 (JSC::): 15539 * jit/JITStubs.h: Changed up some offsets in the JITStackFrame class, since 15540 and off-by-one error was causing stack misalignment. 15541 155422009-05-13 Sam Weinig <sam@webkit.org> 15543 15544 Reviewed by Geoffrey Garen. 15545 15546 Implement op_eq_null and op_neq_null. 15547 15548 * assembler/MacroAssemblerX86Common.h: 15549 (JSC::MacroAssemblerX86Common::set8): 15550 (JSC::MacroAssemblerX86Common::setTest8): 15551 * jit/JITOpcodes.cpp: 15552 (JSC::JIT::emit_op_stricteq): 15553 (JSC::JIT::emitSlow_op_stricteq): 15554 (JSC::JIT::emit_op_nstricteq): 15555 (JSC::JIT::emitSlow_op_nstricteq): 15556 (JSC::JIT::emit_op_eq_null): 15557 (JSC::JIT::emit_op_neq_null): 15558 * jsc.cpp: 15559 155602009-05-12 Sam Weinig <sam@webkit.org> 15561 15562 Reviewed by Geoffrey Garen. 15563 15564 Implement op_new_error. 15565 15566 * jit/JITOpcodes.cpp: 15567 (JSC::JIT::emit_op_new_error): 15568 * jit/JITStubCall.h: 15569 (JSC::JITStubCall::addArgument): Add a version of addArgument 15570 that takes a constant JSValue. 15571 155722009-05-12 Sam Weinig <sam@webkit.org> 15573 15574 Reviewed by Geoffrey Garen. 15575 15576 Remove now unused emitGetVariableObjectRegister and emitPutVariableObjectRegister. 15577 15578 * jit/JIT.cpp: 15579 * jit/JIT.h: 15580 155812009-05-12 Sam Weinig <sam@webkit.org> 15582 15583 Reviewed by Geoffrey Garen. 15584 15585 Implement op_to_primitive and op_next_pname. 15586 15587 * jit/JITOpcodes.cpp: 15588 (JSC::JIT::emitSlow_op_construct_verify): 15589 (JSC::JIT::emit_op_to_primitive): 15590 (JSC::JIT::emitSlow_op_to_primitive): 15591 (JSC::JIT::emitSlow_op_loop_if_true): 15592 (JSC::JIT::emit_op_jtrue): 15593 (JSC::JIT::emit_op_next_pname): 15594 155952009-05-12 Sam Weinig <sam@webkit.org> 15596 15597 Reviewed by Geoffrey Garen. 15598 15599 Add op_get_global_var, op_put_global_var, emit_op_get_scoped_var, emit_op_put_scoped_var and 15600 op_unexpected_load. 15601 15602 * jit/JIT.h: 15603 * jit/JITInlineMethods.h: 15604 (JSC::JIT::tagFor): 15605 (JSC::JIT::payloadFor): 15606 (JSC::JIT::emitLoad): 15607 (JSC::JIT::emitStore): 15608 (JSC::JIT::emitLoadReturnValue): 15609 * jit/JITOpcodes.cpp: 15610 (JSC::JIT::emit_op_get_global_var): 15611 (JSC::JIT::emit_op_put_global_var): 15612 (JSC::JIT::emit_op_get_scoped_var): 15613 (JSC::JIT::emit_op_put_scoped_var): 15614 (JSC::JIT::emit_op_unexpected_load): 15615 156162009-05-12 Geoffrey Garen <ggaren@apple.com> 15617 15618 Reviewed by Sam Weinig. 15619 15620 Added overflow handling to op_sub. 15621 15622 * jit/JIT.h: 15623 * jit/JITArithmetic.cpp: 15624 (JSC::JIT::emitSlow_op_sub): 15625 (JSC::JIT::emitSlowSub32InPlaceLeft): 15626 156272009-05-12 Sam Weinig <sam@webkit.org> 15628 15629 Reviewed by Geoffrey Garen. 15630 15631 Remove a function call by folding op_get_by_id and op_put_by_id into 15632 their respective compile functions. 15633 15634 * jit/JIT.h: 15635 * jit/JITPropertyAccess.cpp: 15636 (JSC::JIT::emit_op_get_by_id): 15637 (JSC::JIT::emitSlow_op_get_by_id): 15638 (JSC::JIT::emit_op_put_by_id): 15639 (JSC::JIT::emitSlow_op_put_by_id): 15640 156412009-05-12 Sam Weinig <sam@webkit.org> 15642 15643 Reviewed by Geoffrey Garen. 15644 15645 Make JITStubCall work in 64bit by making the stack index 15646 step dependent on the size of void*. 15647 15648 * jit/JITStubCall.h: 15649 (JSC::JITStubCall::JITStubCall): 15650 (JSC::JITStubCall::addArgument): 15651 156522009-05-12 Sam Weinig <sam@webkit.org> 15653 15654 Reviewed by Geoffrey Garen. 15655 15656 Implement simple version of property access opcodes 15657 which just call a stub functions. 15658 15659 * jit/JITOpcodes.cpp: 15660 * jit/JITPropertyAccess.cpp: 15661 (JSC::JIT::emitSlow_op_put_by_id): 15662 (JSC::JIT::emitSlow_op_get_by_id): 15663 (JSC::JIT::emit_op_get_by_val): 15664 (JSC::JIT::emitSlow_op_get_by_val): 15665 (JSC::JIT::emit_op_put_by_val): 15666 (JSC::JIT::emitSlow_op_put_by_val): 15667 (JSC::JIT::emit_op_put_by_index): 15668 (JSC::JIT::emit_op_put_getter): 15669 (JSC::JIT::emit_op_put_setter): 15670 (JSC::JIT::emit_op_del_by_id): 15671 (JSC::JIT::compileGetByIdHotPath): 15672 (JSC::JIT::compilePutByIdHotPath): 15673 * jit/JITStubCall.h: 15674 (JSC::JITStubCall::addArgument): 15675 * jsc.cpp: 15676 156772009-05-12 Geoffrey Garen <ggaren@apple.com> 15678 15679 Reviewed by Sam Weinig. 15680 15681 Added work-around for XCode debugging echo problem. 15682 15683 * jsc.cpp: 15684 (runInteractive): 15685 156862009-05-12 Geoffrey Garen <ggaren@apple.com> 15687 15688 Reviewed by Sam Weinig. 15689 15690 Added overflow handling to op_add. 15691 15692 * jit/JIT.h: 15693 * jit/JITArithmetic.cpp: 15694 (JSC::JIT::emitSlow_op_add): 15695 (JSC::JIT::emitSlowAdd32InPlace): 15696 156972009-05-12 Sam Weinig <sam@webkit.org> 15698 15699 Reviewed by Geoffrey Garen. 15700 15701 Add slow cases for op_jnless or emit_op_jnlesseq. 15702 15703 * jit/JITArithmetic.cpp: 15704 (JSC::JIT::emitSlow_op_jnless): 15705 (JSC::JIT::emitSlow_op_jnlesseq): 15706 157072009-05-12 Sam Weinig <sam@webkit.org> 15708 15709 Reviewed by Geoffrey Garen. 15710 15711 Add implementations for op_jnless, emit_op_jnlesseq, op_loop_if_less and op_loop_if_lesseq. 15712 No slow cases for op_jnless or emit_op_jnlesseq yet. 15713 15714 * jit/JITArithmetic.cpp: 15715 (JSC::JIT::emit_op_jnless): 15716 (JSC::JIT::emitSlow_op_jnless): 15717 (JSC::JIT::emit_op_jnlesseq): 15718 (JSC::JIT::emitSlow_op_jnlesseq): 15719 * jit/JITOpcodes.cpp: 15720 (JSC::JIT::emit_op_loop_if_less): 15721 (JSC::JIT::emitSlow_op_loop_if_less): 15722 (JSC::JIT::emit_op_loop_if_lesseq): 15723 (JSC::JIT::emitSlow_op_loop_if_lesseq): 15724 157252009-05-12 Sam Weinig <sam@webkit.org> 15726 15727 Reviewed by Geoffrey Garen. 15728 15729 Turn the RECORD_JUMP_TARGET macro into an inline function. 15730 15731 * jit/JIT.h: 15732 * jit/JITInlineMethods.h: 15733 (JSC::JIT::recordJumpTarget): 15734 * jit/JITOpcodes.cpp: 15735 (JSC::JIT::emit_op_jmp): 15736 (JSC::JIT::emit_op_jsr): 15737 (JSC::JIT::emit_op_jmp_scopes): 15738 157392009-05-12 Sam Weinig <sam@webkit.org> 15740 15741 Add MacroAssemblerX86Common::set8 to fix the build. 15742 15743 * assembler/MacroAssemblerX86Common.h: 15744 (JSC::MacroAssemblerX86Common::set8): 15745 157462009-05-12 Geoffrey Garen <ggaren@apple.com> 15747 15748 Reviewed by Sam Weinig. 15749 15750 Added overflow recovery for pre_inc and pre_dec. 15751 15752 Turned some short-circuit code into early returns, as is the WebKit style. 15753 15754 * jit/JITArithmetic.cpp: 15755 (JSC::JIT::emit_op_post_inc): 15756 (JSC::JIT::emitSlow_op_post_inc): 15757 (JSC::JIT::emit_op_post_dec): 15758 (JSC::JIT::emitSlow_op_post_dec): 15759 (JSC::JIT::emitSlow_op_pre_inc): 15760 (JSC::JIT::emitSlow_op_pre_dec): 15761 157622009-05-12 Sam Weinig <sam@webkit.org> 15763 15764 Reviewed by Geoffrey Garen. 15765 15766 Implement op_jmp, op_loop, op_eq and op_neq. 15767 15768 * jit/JITOpcodes.cpp: 15769 (JSC::JIT::emit_op_jmp): 15770 (JSC::JIT::emit_op_loop): 15771 (JSC::JIT::emit_op_eq): 15772 (JSC::JIT::emitSlow_op_eq): 15773 (JSC::JIT::emit_op_neq): 15774 (JSC::JIT::emitSlow_op_neq): 15775 (JSC::JIT::emit_op_enter): 15776 (JSC::JIT::emit_op_enter_with_activation): 15777 157782009-05-12 Sam Weinig <sam@webkit.org> 15779 15780 Reviewed by Geoffrey Garen. 15781 15782 Implement the slow cases for arithmetic opcodes. 15783 15784 * jit/JITArithmetic.cpp: 15785 (JSC::JIT::emitSlow_op_lshift): 15786 (JSC::JIT::emitSlow_op_rshift): 15787 (JSC::JIT::emitSlow_op_bitand): 15788 (JSC::JIT::emitSlow_op_bitor): 15789 (JSC::JIT::emitSlow_op_bitxor): 15790 (JSC::JIT::emitSlow_op_bitnot): 15791 (JSC::JIT::emitSlow_op_sub): 15792 (JSC::JIT::emitSlow_op_mul): 15793 (JSC::JIT::emitSlow_op_mod): 15794 (JSC::JIT::emit_op_mod): 15795 157962009-05-12 Sam Weinig <sam@webkit.org> 15797 15798 Reviewed by Geoffrey Garen. 15799 15800 Implement op_bitnot. 15801 15802 * assembler/MacroAssemblerX86Common.h: 15803 (JSC::MacroAssemblerX86Common::not32): 15804 * assembler/X86Assembler.h: 15805 (JSC::X86Assembler::notl_m): 15806 * jit/JITArithmetic.cpp: 15807 (JSC::JIT::emit_op_bitnot): 15808 158092009-05-12 Sam Weinig <sam@webkit.org> 15810 15811 Reviewed by Geoffrey Garen. 15812 15813 Add arithmetic opcode implementations from the old nitro-extreme branch. 15814 15815 * jit/JIT.h: 15816 * jit/JITArithmetic.cpp: 15817 (JSC::JIT::emit_op_jnless): 15818 (JSC::JIT::emitSlow_op_jnless): 15819 (JSC::JIT::emit_op_jnlesseq): 15820 (JSC::JIT::emitSlow_op_jnlesseq): 15821 (JSC::JIT::emit_op_lshift): 15822 (JSC::JIT::emitSlow_op_lshift): 15823 (JSC::JIT::emit_op_rshift): 15824 (JSC::JIT::emitSlow_op_rshift): 15825 (JSC::JIT::emit_op_bitand): 15826 (JSC::JIT::emitBitAnd32Constant): 15827 (JSC::JIT::emitBitAnd32InPlace): 15828 (JSC::JIT::emit_op_bitor): 15829 (JSC::JIT::emitSlow_op_bitor): 15830 (JSC::JIT::emitBitOr32Constant): 15831 (JSC::JIT::emitBitOr32InPlace): 15832 (JSC::JIT::emit_op_bitxor): 15833 (JSC::JIT::emitSlow_op_bitxor): 15834 (JSC::JIT::emitBitXor32Constant): 15835 (JSC::JIT::emitBitXor32InPlace): 15836 (JSC::JIT::emit_op_bitnot): 15837 (JSC::JIT::emitSlow_op_bitnot): 15838 (JSC::JIT::emit_op_post_inc): 15839 (JSC::JIT::emitSlow_op_post_inc): 15840 (JSC::JIT::emit_op_post_dec): 15841 (JSC::JIT::emitSlow_op_post_dec): 15842 (JSC::JIT::emit_op_pre_inc): 15843 (JSC::JIT::emitSlow_op_pre_inc): 15844 (JSC::JIT::emit_op_pre_dec): 15845 (JSC::JIT::emitSlow_op_pre_dec): 15846 (JSC::JIT::emit_op_add): 15847 (JSC::JIT::emitAdd32Constant): 15848 (JSC::JIT::emitAdd32InPlace): 15849 (JSC::JIT::emitSlow_op_add): 15850 (JSC::JIT::emit_op_sub): 15851 (JSC::JIT::emitSlow_op_sub): 15852 (JSC::JIT::emitSub32ConstantLeft): 15853 (JSC::JIT::emitSub32ConstantRight): 15854 (JSC::JIT::emitSub32InPlaceLeft): 15855 (JSC::JIT::emitSub32InPlaceRight): 15856 (JSC::JIT::emit_op_mul): 15857 (JSC::JIT::emitSlow_op_mul): 15858 (JSC::JIT::emitMul32Constant): 15859 (JSC::JIT::emitMul32InPlace): 15860 (JSC::JIT::emit_op_mod): 15861 (JSC::JIT::emitSlow_op_mod): 15862 * jit/JITOpcodes.cpp: 15863 158642009-05-12 Geoffrey Garen <ggaren@apple.com> 15865 15866 Removed JIT_OPTIMIZE_ARITHMETIC setting, since it was all about 32bit 15867 value representations. 15868 15869 Added JSAPIValueWrapper to the repository. 15870 15871 * jit/JIT.h: 15872 * jit/JITArithmetic.cpp: 15873 * runtime/JSAPIValueWrapper.cpp: Added. 15874 (JSC::JSAPIValueWrapper::toPrimitive): 15875 (JSC::JSAPIValueWrapper::getPrimitiveNumber): 15876 (JSC::JSAPIValueWrapper::toBoolean): 15877 (JSC::JSAPIValueWrapper::toNumber): 15878 (JSC::JSAPIValueWrapper::toString): 15879 (JSC::JSAPIValueWrapper::toObject): 15880 * runtime/JSAPIValueWrapper.h: Added. 15881 (JSC::JSAPIValueWrapper::value): 15882 (JSC::JSAPIValueWrapper::isAPIValueWrapper): 15883 (JSC::JSAPIValueWrapper::JSAPIValueWrapper): 15884 (JSC::jsAPIValueWrapper): 15885 * wtf/Platform.h: 15886 158872009-05-12 Geoffrey Garen <ggaren@apple.com> 15888 15889 Turned on the JIT and got it building and running the most trivial of 15890 programs. 15891 15892 All configurable optimizations are turned off, and a few opcodes are ad 15893 hoc #if'd out. 15894 15895 So far, I've only merged op_mov and op_end, but some stub-reliant 15896 opcodes work as-is from TOT. 15897 15898 * bytecode/CodeBlock.cpp: 15899 (JSC::CodeBlock::~CodeBlock): 15900 * bytecode/CodeBlock.h: 15901 * jit/JIT.cpp: 15902 (JSC::JIT::compileOpStrictEq): 15903 * jit/JIT.h: 15904 * jit/JITArithmetic.cpp: 15905 (JSC::JIT::emit_op_lshift): 15906 (JSC::JIT::emitSlow_op_lshift): 15907 (JSC::JIT::emit_op_rshift): 15908 (JSC::JIT::emitSlow_op_rshift): 15909 (JSC::JIT::emit_op_jnless): 15910 (JSC::JIT::emitSlow_op_jnless): 15911 (JSC::JIT::emit_op_jnlesseq): 15912 (JSC::JIT::emitSlow_op_jnlesseq): 15913 (JSC::JIT::emit_op_bitand): 15914 (JSC::JIT::emitSlow_op_bitand): 15915 (JSC::JIT::emit_op_post_inc): 15916 (JSC::JIT::emitSlow_op_post_inc): 15917 (JSC::JIT::emit_op_post_dec): 15918 (JSC::JIT::emitSlow_op_post_dec): 15919 (JSC::JIT::emit_op_pre_inc): 15920 (JSC::JIT::emitSlow_op_pre_inc): 15921 (JSC::JIT::emit_op_pre_dec): 15922 (JSC::JIT::emitSlow_op_pre_dec): 15923 (JSC::JIT::emit_op_mod): 15924 (JSC::JIT::emitSlow_op_mod): 15925 (JSC::JIT::emit_op_add): 15926 (JSC::JIT::emit_op_mul): 15927 (JSC::JIT::emit_op_sub): 15928 (JSC::JIT::compileBinaryArithOpSlowCase): 15929 (JSC::JIT::emitSlow_op_add): 15930 (JSC::JIT::emitSlow_op_mul): 15931 * jit/JITCall.cpp: 15932 (JSC::JIT::compileOpCallInitializeCallFrame): 15933 (JSC::JIT::compileOpConstructSetupArgs): 15934 (JSC::JIT::compileOpCallVarargs): 15935 (JSC::JIT::compileOpCall): 15936 (JSC::JIT::compileOpCallSlowCase): 15937 * jit/JITInlineMethods.h: 15938 (JSC::JIT::getConstantOperandImmediateInt): 15939 (JSC::JIT::isOperandConstantImmediateInt): 15940 (JSC::JIT::emitInitRegister): 15941 (JSC::JIT::addSlowCase): 15942 (JSC::JIT::addJump): 15943 (JSC::JIT::emitJumpSlowToHot): 15944 (JSC::JIT::tagFor): 15945 (JSC::JIT::payloadFor): 15946 (JSC::JIT::emitLoad): 15947 (JSC::JIT::emitLoadReturnValue): 15948 (JSC::JIT::emitStore): 15949 (JSC::JIT::emitStoreReturnValue): 15950 * jit/JITOpcodes.cpp: 15951 (JSC::JIT::emit_op_mov): 15952 (JSC::JIT::emit_op_end): 15953 (JSC::JIT::emit_op_jmp): 15954 (JSC::JIT::emit_op_loop): 15955 (JSC::JIT::emit_op_loop_if_less): 15956 (JSC::JIT::emit_op_loop_if_lesseq): 15957 (JSC::JIT::emit_op_instanceof): 15958 (JSC::JIT::emit_op_get_global_var): 15959 (JSC::JIT::emit_op_put_global_var): 15960 (JSC::JIT::emit_op_get_scoped_var): 15961 (JSC::JIT::emit_op_put_scoped_var): 15962 (JSC::JIT::emit_op_tear_off_activation): 15963 (JSC::JIT::emit_op_ret): 15964 (JSC::JIT::emit_op_construct_verify): 15965 (JSC::JIT::emit_op_to_primitive): 15966 (JSC::JIT::emit_op_loop_if_true): 15967 (JSC::JIT::emit_op_resolve_global): 15968 (JSC::JIT::emit_op_not): 15969 (JSC::JIT::emit_op_jfalse): 15970 (JSC::JIT::emit_op_jeq_null): 15971 (JSC::JIT::emit_op_jneq_null): 15972 (JSC::JIT::emit_op_jneq_ptr): 15973 (JSC::JIT::emit_op_unexpected_load): 15974 (JSC::JIT::emit_op_eq): 15975 (JSC::JIT::emit_op_bitnot): 15976 (JSC::JIT::emit_op_jtrue): 15977 (JSC::JIT::emit_op_neq): 15978 (JSC::JIT::emit_op_bitxor): 15979 (JSC::JIT::emit_op_bitor): 15980 (JSC::JIT::emit_op_throw): 15981 (JSC::JIT::emit_op_next_pname): 15982 (JSC::JIT::emit_op_push_scope): 15983 (JSC::JIT::emit_op_to_jsnumber): 15984 (JSC::JIT::emit_op_push_new_scope): 15985 (JSC::JIT::emit_op_catch): 15986 (JSC::JIT::emit_op_switch_imm): 15987 (JSC::JIT::emit_op_switch_char): 15988 (JSC::JIT::emit_op_switch_string): 15989 (JSC::JIT::emit_op_new_error): 15990 (JSC::JIT::emit_op_eq_null): 15991 (JSC::JIT::emit_op_neq_null): 15992 (JSC::JIT::emit_op_convert_this): 15993 (JSC::JIT::emit_op_profile_will_call): 15994 (JSC::JIT::emit_op_profile_did_call): 15995 (JSC::JIT::emitSlow_op_construct_verify): 15996 (JSC::JIT::emitSlow_op_get_by_val): 15997 (JSC::JIT::emitSlow_op_loop_if_less): 15998 (JSC::JIT::emitSlow_op_loop_if_lesseq): 15999 (JSC::JIT::emitSlow_op_put_by_val): 16000 (JSC::JIT::emitSlow_op_not): 16001 (JSC::JIT::emitSlow_op_instanceof): 16002 * jit/JITPropertyAccess.cpp: 16003 (JSC::JIT::emit_op_get_by_val): 16004 (JSC::JIT::emit_op_put_by_val): 16005 (JSC::JIT::emit_op_put_by_index): 16006 (JSC::JIT::emit_op_put_getter): 16007 (JSC::JIT::emit_op_put_setter): 16008 (JSC::JIT::emit_op_del_by_id): 16009 (JSC::JIT::compileGetByIdHotPath): 16010 (JSC::JIT::compilePutByIdHotPath): 16011 * jit/JITStubCall.h: 16012 (JSC::JITStubCall::JITStubCall): 16013 (JSC::JITStubCall::addArgument): 16014 (JSC::JITStubCall::call): 16015 (JSC::JITStubCall::): 16016 (JSC::CallEvalJITStub::CallEvalJITStub): 16017 * jit/JITStubs.cpp: 16018 (JSC::): 16019 (JSC::JITStubs::cti_op_add): 16020 (JSC::JITStubs::cti_op_pre_inc): 16021 (JSC::JITStubs::cti_op_mul): 16022 (JSC::JITStubs::cti_op_get_by_val): 16023 (JSC::JITStubs::cti_op_get_by_val_string): 16024 (JSC::JITStubs::cti_op_get_by_val_byte_array): 16025 (JSC::JITStubs::cti_op_sub): 16026 (JSC::JITStubs::cti_op_put_by_val): 16027 (JSC::JITStubs::cti_op_put_by_val_array): 16028 (JSC::JITStubs::cti_op_put_by_val_byte_array): 16029 (JSC::JITStubs::cti_op_negate): 16030 (JSC::JITStubs::cti_op_div): 16031 (JSC::JITStubs::cti_op_pre_dec): 16032 (JSC::JITStubs::cti_op_post_inc): 16033 (JSC::JITStubs::cti_op_eq): 16034 (JSC::JITStubs::cti_op_lshift): 16035 (JSC::JITStubs::cti_op_bitand): 16036 (JSC::JITStubs::cti_op_rshift): 16037 (JSC::JITStubs::cti_op_bitnot): 16038 (JSC::JITStubs::cti_op_mod): 16039 (JSC::JITStubs::cti_op_neq): 16040 (JSC::JITStubs::cti_op_post_dec): 16041 (JSC::JITStubs::cti_op_urshift): 16042 (JSC::JITStubs::cti_op_bitxor): 16043 (JSC::JITStubs::cti_op_bitor): 16044 (JSC::JITStubs::cti_op_switch_imm): 16045 * jit/JITStubs.h: 16046 * runtime/JSArray.cpp: 16047 (JSC::JSArray::JSArray): 16048 * runtime/JSFunction.cpp: 16049 (JSC::JSFunction::~JSFunction): 16050 * runtime/JSValue.h: 16051 (JSC::JSValue::payload): 16052 * wtf/Platform.h: 16053 160542009-05-07 Sam Weinig <sam@webkit.org> 16055 16056 Reviewed by Geoffrey Garen. 16057 16058 Add some new MacroAssembler and assembler functions that will be needed shortly. 16059 16060 * assembler/MacroAssemblerX86Common.h: 16061 (JSC::MacroAssemblerX86Common::add32): 16062 (JSC::MacroAssemblerX86Common::and32): 16063 (JSC::MacroAssemblerX86Common::mul32): 16064 (JSC::MacroAssemblerX86Common::neg32): 16065 (JSC::MacroAssemblerX86Common::or32): 16066 (JSC::MacroAssemblerX86Common::sub32): 16067 (JSC::MacroAssemblerX86Common::xor32): 16068 (JSC::MacroAssemblerX86Common::branchAdd32): 16069 (JSC::MacroAssemblerX86Common::branchMul32): 16070 (JSC::MacroAssemblerX86Common::branchSub32): 16071 * assembler/X86Assembler.h: 16072 (JSC::X86Assembler::): 16073 (JSC::X86Assembler::addl_rm): 16074 (JSC::X86Assembler::andl_mr): 16075 (JSC::X86Assembler::andl_rm): 16076 (JSC::X86Assembler::andl_im): 16077 (JSC::X86Assembler::negl_r): 16078 (JSC::X86Assembler::notl_r): 16079 (JSC::X86Assembler::orl_rm): 16080 (JSC::X86Assembler::orl_im): 16081 (JSC::X86Assembler::subl_rm): 16082 (JSC::X86Assembler::xorl_mr): 16083 (JSC::X86Assembler::xorl_rm): 16084 (JSC::X86Assembler::xorl_im): 16085 (JSC::X86Assembler::imull_mr): 16086 160872009-05-11 Sam Weinig <sam@webkit.org> 16088 16089 Reviewed by Cameron Zwarich. 16090 16091 Remove the NumberHeap. 16092 16093 * JavaScriptCore.exp: 16094 * runtime/Collector.cpp: 16095 (JSC::Heap::Heap): 16096 (JSC::Heap::destroy): 16097 (JSC::Heap::recordExtraCost): 16098 (JSC::Heap::heapAllocate): 16099 (JSC::Heap::markConservatively): 16100 (JSC::Heap::sweep): 16101 (JSC::Heap::collect): 16102 (JSC::Heap::objectCount): 16103 (JSC::Heap::statistics): 16104 (JSC::typeName): 16105 (JSC::Heap::isBusy): 16106 * runtime/Collector.h: 16107 (JSC::Heap::globalData): 16108 * runtime/JSCell.h: 16109 161102009-05-11 Geoffrey Garen <ggaren@apple.com> 16111 16112 Reviewed by Sam Weinig. 16113 16114 Land initial commit of new number representation for 32 bit platforms, 16115 with JIT disabled. 16116 16117 * API/APICast.h: 16118 (toJS): 16119 (toRef): 16120 * API/JSCallbackObjectFunctions.h: 16121 (JSC::::hasInstance): 16122 (JSC::::toNumber): 16123 (JSC::::toString): 16124 * API/tests/testapi.c: 16125 (EvilExceptionObject_convertToType): 16126 * AllInOneFile.cpp: 16127 * JavaScriptCore.exp: 16128 * JavaScriptCore.xcodeproj/project.pbxproj: 16129 * bytecode/CodeBlock.cpp: 16130 (JSC::valueToSourceString): 16131 * bytecompiler/BytecodeGenerator.cpp: 16132 (JSC::BytecodeGenerator::emitLoad): 16133 (JSC::BytecodeGenerator::emitUnexpectedLoad): 16134 (JSC::keyForImmediateSwitch): 16135 * bytecompiler/BytecodeGenerator.h: 16136 * interpreter/Interpreter.cpp: 16137 (JSC::Interpreter::dumpRegisters): 16138 (JSC::Interpreter::privateExecute): 16139 * parser/Nodes.cpp: 16140 (JSC::ArrayNode::emitBytecode): 16141 (JSC::processClauseList): 16142 * runtime/ArgList.h: 16143 * runtime/Collector.h: 16144 (JSC::sizeof): 16145 * runtime/DateMath.cpp: 16146 * runtime/ExceptionHelpers.h: 16147 * runtime/InitializeThreading.cpp: 16148 * runtime/JSArray.cpp: 16149 (JSC::JSArray::JSArray): 16150 * runtime/JSCell.cpp: 16151 * runtime/JSCell.h: 16152 (JSC::JSCell::isAPIValueWrapper): 16153 (JSC::JSValue::isString): 16154 (JSC::JSValue::isGetterSetter): 16155 (JSC::JSValue::isObject): 16156 (JSC::JSValue::getString): 16157 (JSC::JSValue::getObject): 16158 (JSC::JSValue::getCallData): 16159 (JSC::JSValue::getConstructData): 16160 (JSC::JSValue::getUInt32): 16161 (JSC::JSValue::marked): 16162 (JSC::JSValue::toPrimitive): 16163 (JSC::JSValue::getPrimitiveNumber): 16164 (JSC::JSValue::toBoolean): 16165 (JSC::JSValue::toNumber): 16166 (JSC::JSValue::toString): 16167 (JSC::JSValue::needsThisConversion): 16168 (JSC::JSValue::toThisString): 16169 (JSC::JSValue::getJSNumber): 16170 (JSC::JSValue::toObject): 16171 (JSC::JSValue::toThisObject): 16172 * runtime/JSGlobalData.cpp: 16173 (JSC::JSGlobalData::JSGlobalData): 16174 * runtime/JSGlobalData.h: 16175 * runtime/JSGlobalObject.h: 16176 (JSC::Structure::prototypeForLookup): 16177 * runtime/JSGlobalObjectFunctions.cpp: 16178 (JSC::globalFuncParseInt): 16179 * runtime/JSImmediate.h: 16180 * runtime/JSNumberCell.cpp: Removed. 16181 * runtime/JSNumberCell.h: Removed. 16182 * runtime/JSObject.h: 16183 (JSC::JSValue::get): 16184 (JSC::JSValue::put): 16185 * runtime/JSString.h: 16186 (JSC::JSValue::toThisJSString): 16187 * runtime/JSValue.cpp: 16188 (JSC::JSValue::toInteger): 16189 (JSC::JSValue::toIntegerPreserveNaN): 16190 (JSC::JSValue::toObjectSlowCase): 16191 (JSC::JSValue::toThisObjectSlowCase): 16192 (JSC::JSValue::synthesizeObject): 16193 (JSC::JSValue::synthesizePrototype): 16194 (JSC::JSValue::description): 16195 (JSC::nonInlineNaN): 16196 * runtime/JSValue.h: 16197 (JSC::JSValue::): 16198 (JSC::EncodedJSValueHashTraits::emptyValue): 16199 (JSC::jsNaN): 16200 (JSC::operator==): 16201 (JSC::operator!=): 16202 (JSC::toInt32): 16203 (JSC::toUInt32): 16204 (JSC::JSValue::encode): 16205 (JSC::JSValue::decode): 16206 (JSC::JSValue::JSValue): 16207 (JSC::JSValue::operator bool): 16208 (JSC::JSValue::operator==): 16209 (JSC::JSValue::operator!=): 16210 (JSC::JSValue::isUndefined): 16211 (JSC::JSValue::isNull): 16212 (JSC::JSValue::isUndefinedOrNull): 16213 (JSC::JSValue::isCell): 16214 (JSC::JSValue::isInt32): 16215 (JSC::JSValue::isUInt32): 16216 (JSC::JSValue::isDouble): 16217 (JSC::JSValue::isTrue): 16218 (JSC::JSValue::isFalse): 16219 (JSC::JSValue::tag): 16220 (JSC::JSValue::asInt32): 16221 (JSC::JSValue::asUInt32): 16222 (JSC::JSValue::asDouble): 16223 (JSC::JSValue::asCell): 16224 (JSC::JSValue::isNumber): 16225 (JSC::JSValue::isBoolean): 16226 (JSC::JSValue::getBoolean): 16227 (JSC::JSValue::uncheckedGetNumber): 16228 (JSC::JSValue::toJSNumber): 16229 (JSC::JSValue::getNumber): 16230 (JSC::JSValue::toInt32): 16231 (JSC::JSValue::toUInt32): 16232 * runtime/Operations.h: 16233 (JSC::JSValue::equal): 16234 (JSC::JSValue::equalSlowCaseInline): 16235 (JSC::JSValue::strictEqual): 16236 (JSC::JSValue::strictEqualSlowCaseInline): 16237 (JSC::jsLess): 16238 (JSC::jsLessEq): 16239 (JSC::jsAdd): 16240 * runtime/PropertySlot.h: 16241 * runtime/StringPrototype.cpp: 16242 (JSC::stringProtoFuncCharAt): 16243 (JSC::stringProtoFuncCharCodeAt): 16244 (JSC::stringProtoFuncIndexOf): 16245 * wtf/Platform.h: 16246 16247=== Start merge of nitro-extreme branch 2009-07-30 === 16248 162492009-07-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> 16250 16251 Reviewed by George Staikos. 16252 16253 Resolve class/struct mixup in forward declarations 16254 https://bugs.webkit.org/show_bug.cgi?id=27708 16255 16256 * API/JSClassRef.h: 16257 * bytecode/SamplingTool.h: 16258 * interpreter/Interpreter.h: 16259 * jit/JIT.h: 16260 * profiler/ProfileGenerator.h: 16261 * profiler/Profiler.h: 16262 * runtime/ClassInfo.h: 16263 * runtime/ExceptionHelpers.h: 16264 * runtime/JSByteArray.h: 16265 * runtime/JSCell.h: 16266 * runtime/JSFunction.h: 16267 * runtime/JSGlobalData.h: 16268 * runtime/JSObject.h: 16269 * runtime/JSString.h: 16270 162712009-07-28 Ada Chan <adachan@apple.com> 16272 16273 Reviewed by Darin Adler. 16274 16275 https://bugs.webkit.org/show_bug.cgi?id=27236 16276 - Implement TCMalloc_SystemRelease and TCMalloc_SystemCommit for Windows. 16277 - Use a background thread to periodically scavenge memory to release back to the system. 16278 16279 * wtf/FastMalloc.cpp: 16280 (WTF::TCMalloc_PageHeap::init): 16281 (WTF::TCMalloc_PageHeap::runScavengerThread): 16282 (WTF::TCMalloc_PageHeap::scavenge): 16283 (WTF::TCMalloc_PageHeap::shouldContinueScavenging): 16284 (WTF::TCMalloc_PageHeap::New): 16285 (WTF::TCMalloc_PageHeap::AllocLarge): 16286 (WTF::TCMalloc_PageHeap::Delete): 16287 (WTF::TCMalloc_PageHeap::GrowHeap): 16288 (WTF::sleep): 16289 (WTF::TCMalloc_PageHeap::scavengerThread): 16290 * wtf/TCSystemAlloc.cpp: 16291 (TCMalloc_SystemRelease): 16292 (TCMalloc_SystemCommit): 16293 * wtf/TCSystemAlloc.h: 16294 162952009-07-28 Xan Lopez <xlopez@igalia.com> 16296 16297 Add new files, fixes distcheck. 16298 16299 * GNUmakefile.am: 16300 163012009-07-28 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 16302 16303 Reviewed by Simon Hausmann. 16304 16305 [Qt] Determining whether to use JIT or interpreter 16306 moved from JavaScriptCore.pri to Platform.h 16307 16308 * JavaScriptCore.pri: 16309 * wtf/Platform.h: 16310 163112009-07-27 Brian Weinstein <bweinstein@apple.com> 16312 16313 Fix of misuse of sort command. 16314 16315 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 16316 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 16317 163182009-07-27 Brian Weinstein <bweinstein@apple.com> 16319 16320 Build fix for Windows. 16321 16322 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 16323 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 16324 163252009-07-27 Gavin Barraclough <barraclough@apple.com> 16326 16327 Rubber stamped by Oliver Hunt. 16328 16329 Fix tyop in JIT, renamed preverveReturnAddressAfterCall -> preserveReturnAddressAfterCall. 16330 16331 * jit/JIT.cpp: 16332 (JSC::JIT::privateCompile): 16333 (JSC::JIT::privateCompileCTIMachineTrampolines): 16334 * jit/JIT.h: 16335 * jit/JITInlineMethods.h: 16336 (JSC::JIT::preserveReturnAddressAfterCall): 16337 * jit/JITPropertyAccess.cpp: 16338 (JSC::JIT::privateCompilePutByIdTransition): 16339 163402009-07-27 Alexey Proskuryakov <ap@webkit.org> 16341 16342 Gtk build fix. 16343 16344 * runtime/JSLock.cpp: (JSC::JSLock::JSLock): Fix "no threading" case. 16345 163462009-07-27 Alexey Proskuryakov <ap@webkit.org> 16347 16348 Release build fix. 16349 16350 * runtime/JSLock.h: (JSC::JSLock::~JSLock): 16351 163522009-07-27 Alexey Proskuryakov <ap@webkit.org> 16353 16354 Reviewed by Darin Adler. 16355 16356 https://bugs.webkit.org/show_bug.cgi?id=27735 16357 Give a helpful name to JSLock constructor argument 16358 16359 * API/JSBase.cpp: 16360 (JSGarbageCollect): 16361 * API/JSContextRef.cpp: 16362 * API/JSObjectRef.cpp: 16363 (JSPropertyNameArrayRelease): 16364 (JSPropertyNameAccumulatorAddName): 16365 * JavaScriptCore.exp: 16366 * jsc.cpp: 16367 (functionGC): 16368 (cleanupGlobalData): 16369 (jscmain): 16370 * runtime/Collector.cpp: 16371 (JSC::Heap::destroy): 16372 * runtime/JSLock.cpp: 16373 (JSC::JSLock::JSLock): 16374 (JSC::JSLock::lock): 16375 (JSC::JSLock::unlock): 16376 (JSC::JSLock::DropAllLocks::DropAllLocks): 16377 (JSC::JSLock::DropAllLocks::~DropAllLocks): 16378 * runtime/JSLock.h: 16379 (JSC::): 16380 (JSC::JSLock::JSLock): 16381 (JSC::JSLock::~JSLock): 16382 163832009-07-25 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 16384 16385 Reviewed by Eric Seidel. 16386 16387 Allow custom memory allocation control for OpaqueJSPropertyNameArray struct 16388 https://bugs.webkit.org/show_bug.cgi?id=27342 16389 16390 Inherits OpaqueJSPropertyNameArray struct from FastAllocBase because it has been 16391 instantiated by 'new' JavaScriptCore/API/JSObjectRef.cpp:473. 16392 16393 * API/JSObjectRef.cpp: 16394 163952009-07-24 Ada Chan <adachan@apple.com> 16396 16397 In preparation for https://bugs.webkit.org/show_bug.cgi?id=27236: 16398 Remove TCMALLOC_TRACK_DECOMMITED_SPANS. We'll always track decommitted spans. 16399 We have tested this and show it has little impact on performance. 16400 16401 Reviewed by Mark Rowe. 16402 16403 * wtf/FastMalloc.cpp: 16404 (WTF::TCMalloc_PageHeap::New): 16405 (WTF::TCMalloc_PageHeap::AllocLarge): 16406 (WTF::propagateDecommittedState): 16407 (WTF::mergeDecommittedStates): 16408 (WTF::TCMalloc_PageHeap::Delete): 16409 (WTF::TCMalloc_PageHeap::IncrementalScavenge): 16410 164112009-07-24 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 16412 16413 Reviewed by Darin Adler and Adam Barth. 16414 16415 Build fix for x86 platforms. 16416 https://bugs.webkit.org/show_bug.cgi?id=27602 16417 16418 * jit/JIT.cpp: 16419 164202009-07-23 Kevin Ollivier <kevino@theolliviers.com> 16421 16422 wx build fix, adding missing header. 16423 16424 * jit/JIT.cpp: 16425 164262009-07-22 Yong Li <yong.li@torchmobile.com> 16427 16428 Reviewed by George Staikos. 16429 16430 Add wince specific memory files into wtf/wince 16431 https://bugs.webkit.org/show_bug.cgi?id=27550 16432 16433 * wtf/wince/FastMallocWince.h: Added. 16434 * wtf/wince/MemoryManager.cpp: Added. 16435 * wtf/wince/MemoryManager.h: Added. 16436 164372009-07-23 Norbert Leser <norbert.leser@nokia.com> 16438 16439 Reviewed by Simon Hausmann. 16440 16441 Fix for missing mmap features in Symbian 16442 https://bugs.webkit.org/show_bug.cgi?id=24540 16443 16444 Fix, conditionally for PLATFORM(SYMBIAN), as an alternative 16445 to missing support for the MAP_ANON property flag in mmap. 16446 It utilizes Symbian specific memory allocation features. 16447 16448 * runtime/Collector.cpp 16449 164502009-07-22 Gavin Barraclough <barraclough@apple.com> 16451 16452 Reviewed by Sam Weinig. 16453 16454 With ENABLE(ASSEMBLER_WX_EXCLUSIVE), only change permissions once per repatch event. 16455 ( https://bugs.webkit.org/show_bug.cgi?id=27564 ) 16456 16457 Currently we change permissions forwards and backwards for each instruction modified, 16458 instead we should only change permissions once per complete repatching event. 16459 16460 2.5% progression running with ENABLE(ASSEMBLER_WX_EXCLUSIVE) enabled, 16461 which recoups 1/3 of the penalty of running with this mode enabled. 16462 16463 * assembler/ARMAssembler.cpp: 16464 (JSC::ARMAssembler::linkBranch): 16465 - Replace usage of MakeWritable with cacheFlush. 16466 16467 * assembler/ARMAssembler.h: 16468 (JSC::ARMAssembler::patchPointerInternal): 16469 (JSC::ARMAssembler::repatchLoadPtrToLEA): 16470 - Replace usage of MakeWritable with cacheFlush. 16471 16472 * assembler/ARMv7Assembler.h: 16473 (JSC::ARMv7Assembler::relinkJump): 16474 (JSC::ARMv7Assembler::relinkCall): 16475 (JSC::ARMv7Assembler::repatchInt32): 16476 (JSC::ARMv7Assembler::repatchPointer): 16477 (JSC::ARMv7Assembler::repatchLoadPtrToLEA): 16478 (JSC::ARMv7Assembler::setInt32): 16479 - Replace usage of MakeWritable with cacheFlush. 16480 16481 * assembler/LinkBuffer.h: 16482 (JSC::LinkBuffer::performFinalization): 16483 - Make explicit call to cacheFlush. 16484 16485 * assembler/MacroAssemblerCodeRef.h: 16486 (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): 16487 - Make size always available. 16488 16489 * assembler/RepatchBuffer.h: 16490 (JSC::RepatchBuffer::RepatchBuffer): 16491 (JSC::RepatchBuffer::~RepatchBuffer): 16492 - Add calls to MakeWritable & makeExecutable. 16493 16494 * assembler/X86Assembler.h: 16495 (JSC::X86Assembler::relinkJump): 16496 (JSC::X86Assembler::relinkCall): 16497 (JSC::X86Assembler::repatchInt32): 16498 (JSC::X86Assembler::repatchPointer): 16499 (JSC::X86Assembler::repatchLoadPtrToLEA): 16500 - Remove usage of MakeWritable. 16501 16502 * bytecode/CodeBlock.h: 16503 (JSC::CodeBlock::getJITCode): 16504 - Provide access to CodeBlock's JITCode. 16505 16506 * jit/ExecutableAllocator.h: 16507 (JSC::ExecutableAllocator::makeExecutable): 16508 (JSC::ExecutableAllocator::cacheFlush): 16509 - Remove MakeWritable, make cacheFlush public. 16510 16511 * jit/JIT.cpp: 16512 (JSC::ctiPatchNearCallByReturnAddress): 16513 (JSC::ctiPatchCallByReturnAddress): 16514 (JSC::JIT::privateCompile): 16515 (JSC::JIT::unlinkCall): 16516 (JSC::JIT::linkCall): 16517 - Add CodeBlock argument to RepatchBuffer. 16518 16519 * jit/JIT.h: 16520 - Pass CodeBlock argument for use by RepatchBuffer. 16521 16522 * jit/JITCode.h: 16523 (JSC::JITCode::start): 16524 (JSC::JITCode::size): 16525 - Provide access to code start & size. 16526 16527 * jit/JITPropertyAccess.cpp: 16528 (JSC::JIT::privateCompilePutByIdTransition): 16529 (JSC::JIT::patchGetByIdSelf): 16530 (JSC::JIT::patchMethodCallProto): 16531 (JSC::JIT::patchPutByIdReplace): 16532 (JSC::JIT::privateCompilePatchGetArrayLength): 16533 (JSC::JIT::privateCompileGetByIdProto): 16534 (JSC::JIT::privateCompileGetByIdSelfList): 16535 (JSC::JIT::privateCompileGetByIdProtoList): 16536 (JSC::JIT::privateCompileGetByIdChainList): 16537 (JSC::JIT::privateCompileGetByIdChain): 16538 - Add CodeBlock argument to RepatchBuffer. 16539 16540 * jit/JITStubs.cpp: 16541 (JSC::JITThunks::tryCachePutByID): 16542 (JSC::JITThunks::tryCacheGetByID): 16543 (JSC::JITStubs::DEFINE_STUB_FUNCTION): 16544 - Pass CodeBlock argument for use by RepatchBuffer. 16545 165462009-07-21 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 16547 16548 Reviewed by Gavin Barraclough. 16549 16550 Cache not only the structure of the method, but the 16551 structure of its prototype as well. 16552 https://bugs.webkit.org/show_bug.cgi?id=27077 16553 16554 * bytecode/CodeBlock.cpp: 16555 (JSC::CodeBlock::~CodeBlock): 16556 * bytecode/CodeBlock.h: 16557 (JSC::MethodCallLinkInfo::MethodCallLinkInfo): 16558 * jit/JITPropertyAccess.cpp: 16559 (JSC::JIT::patchMethodCallProto): 16560 165612009-07-21 Gavin Barraclough <barraclough@apple.com> 16562 16563 Reviewed by Sam Weinig. 16564 16565 Move call linking / repatching down from AbstractMacroAssembler into MacroAssemblerARCH classes. 16566 ( https://bugs.webkit.org/show_bug.cgi?id=27527 ) 16567 16568 This allows the implementation to be defined per architecture. Specifically this addresses the 16569 fact that x86-64 MacroAssembler implements far calls as a load to register, followed by a call 16570 to register. Patching the call actually requires the pointer load to be patched, rather than 16571 the call to be patched. This is implementation detail specific to MacroAssemblerX86_64, and as 16572 such is best handled there. 16573 16574 * assembler/AbstractMacroAssembler.h: 16575 * assembler/MacroAssemblerARM.h: 16576 (JSC::MacroAssemblerARM::linkCall): 16577 (JSC::MacroAssemblerARM::repatchCall): 16578 * assembler/MacroAssemblerARMv7.h: 16579 (JSC::MacroAssemblerARMv7::linkCall): 16580 (JSC::MacroAssemblerARMv7::repatchCall): 16581 * assembler/MacroAssemblerX86.h: 16582 (JSC::MacroAssemblerX86::linkCall): 16583 (JSC::MacroAssemblerX86::repatchCall): 16584 * assembler/MacroAssemblerX86_64.h: 16585 (JSC::MacroAssemblerX86_64::linkCall): 16586 (JSC::MacroAssemblerX86_64::repatchCall): 16587 165882009-07-21 Adam Treat <adam.treat@torchmobile.com> 16589 16590 Reviewed by George Staikos. 16591 16592 Every wtf file includes other wtf files with <> style includes 16593 except this one. Fix the exception. 16594 16595 * wtf/ByteArray.h: 16596 165972009-07-21 Gavin Barraclough <barraclough@apple.com> 16598 16599 Reviewed by Oliver Hunt. 16600 16601 Move LinkBuffer/RepatchBuffer out of AbstractMacroAssembler. 16602 ( https://bugs.webkit.org/show_bug.cgi?id=27485 ) 16603 16604 This change is the first step in a process to move code that should be in 16605 the architecture-specific MacroAssembler classes up out of Assmbler and 16606 AbstractMacroAssembler. 16607 16608 * JavaScriptCore.xcodeproj/project.pbxproj: 16609 - added new files 16610 16611 * assembler/ARMAssembler.h: 16612 (JSC::ARMAssembler::linkPointer): 16613 - rename patchPointer to bring it in line with the current link/repatch naming scheme 16614 16615 * assembler/ARMv7Assembler.h: 16616 (JSC::ARMv7Assembler::linkCall): 16617 (JSC::ARMv7Assembler::linkPointer): 16618 (JSC::ARMv7Assembler::relinkCall): 16619 (JSC::ARMv7Assembler::repatchInt32): 16620 (JSC::ARMv7Assembler::repatchPointer): 16621 (JSC::ARMv7Assembler::setInt32): 16622 (JSC::ARMv7Assembler::setPointer): 16623 - rename patchPointer to bring it in line with the current link/repatch naming scheme 16624 16625 * assembler/AbstractMacroAssembler.h: 16626 (JSC::AbstractMacroAssembler::linkJump): 16627 (JSC::AbstractMacroAssembler::linkCall): 16628 (JSC::AbstractMacroAssembler::linkPointer): 16629 (JSC::AbstractMacroAssembler::getLinkerAddress): 16630 (JSC::AbstractMacroAssembler::getLinkerCallReturnOffset): 16631 (JSC::AbstractMacroAssembler::repatchJump): 16632 (JSC::AbstractMacroAssembler::repatchCall): 16633 (JSC::AbstractMacroAssembler::repatchNearCall): 16634 (JSC::AbstractMacroAssembler::repatchInt32): 16635 (JSC::AbstractMacroAssembler::repatchPointer): 16636 (JSC::AbstractMacroAssembler::repatchLoadPtrToLEA): 16637 - remove the LinkBuffer/RepatchBuffer classes, but leave a set of (private, friended) methods to interface to the Assembler 16638 16639 * assembler/LinkBuffer.h: Added. 16640 (JSC::LinkBuffer::LinkBuffer): 16641 (JSC::LinkBuffer::~LinkBuffer): 16642 (JSC::LinkBuffer::link): 16643 (JSC::LinkBuffer::patch): 16644 (JSC::LinkBuffer::locationOf): 16645 (JSC::LinkBuffer::locationOfNearCall): 16646 (JSC::LinkBuffer::returnAddressOffset): 16647 (JSC::LinkBuffer::finalizeCode): 16648 (JSC::LinkBuffer::finalizeCodeAddendum): 16649 (JSC::LinkBuffer::code): 16650 (JSC::LinkBuffer::performFinalization): 16651 - new file containing the LinkBuffer class, previously a member of AbstractMacroAssembler 16652 16653 * assembler/RepatchBuffer.h: Added. 16654 (JSC::RepatchBuffer::RepatchBuffer): 16655 (JSC::RepatchBuffer::relink): 16656 (JSC::RepatchBuffer::repatch): 16657 (JSC::RepatchBuffer::repatchLoadPtrToLEA): 16658 (JSC::RepatchBuffer::relinkCallerToTrampoline): 16659 (JSC::RepatchBuffer::relinkCallerToFunction): 16660 (JSC::RepatchBuffer::relinkNearCallerToTrampoline): 16661 - new file containing the RepatchBuffer class, previously a member of AbstractMacroAssembler 16662 16663 * assembler/X86Assembler.h: 16664 (JSC::X86Assembler::linkJump): 16665 (JSC::X86Assembler::linkCall): 16666 (JSC::X86Assembler::linkPointerForCall): 16667 (JSC::X86Assembler::linkPointer): 16668 (JSC::X86Assembler::relinkJump): 16669 (JSC::X86Assembler::relinkCall): 16670 (JSC::X86Assembler::repatchInt32): 16671 (JSC::X86Assembler::repatchPointer): 16672 (JSC::X86Assembler::setPointer): 16673 (JSC::X86Assembler::setInt32): 16674 (JSC::X86Assembler::setRel32): 16675 - rename patchPointer to bring it in line with the current link/repatch naming scheme 16676 16677 * jit/JIT.cpp: 16678 (JSC::ctiPatchNearCallByReturnAddress): 16679 (JSC::ctiPatchCallByReturnAddress): 16680 - include new headers 16681 - remove MacroAssembler:: specification from RepatchBuffer usage 16682 16683 * jit/JITPropertyAccess.cpp: 16684 * yarr/RegexJIT.cpp: 16685 - include new headers 16686 166872009-07-21 Robert Agoston <Agoston.Robert@stud.u-szeged.hu> 16688 16689 Reviewed by David Levin. 16690 16691 Fixed #undef typo. 16692 https://bugs.webkit.org/show_bug.cgi?id=27506 16693 16694 * bytecode/Opcode.h: 16695 166962009-07-21 Adam Roben <aroben@apple.com> 16697 16698 Roll out r46153, r46154, and r46155 16699 16700 These changes were causing build failures and assertion failures on 16701 Windows. 16702 16703 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 16704 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 16705 * JavaScriptCore.xcodeproj/project.pbxproj: 16706 * runtime/JSArray.cpp: 16707 * runtime/StringPrototype.cpp: 16708 * runtime/UString.cpp: 16709 * runtime/UString.h: 16710 * wtf/FastMalloc.cpp: 16711 * wtf/FastMalloc.h: 16712 * wtf/Platform.h: 16713 * wtf/PossiblyNull.h: Removed. 16714 167152009-07-21 Roland Steiner <rolandsteiner@google.com> 16716 16717 Reviewed by David Levin. 16718 16719 Add ENABLE_RUBY to list of build options 16720 https://bugs.webkit.org/show_bug.cgi?id=27324 16721 16722 * Configurations/FeatureDefines.xcconfig: Added flag ENABLE_RUBY. 16723 167242009-07-20 Oliver Hunt <oliver@apple.com> 16725 16726 Build fix attempt #2 16727 16728 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 16729 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 16730 167312009-07-20 Oliver Hunt <oliver@apple.com> 16732 16733 Build fix attempt #1 16734 16735 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 16736 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 16737 167382009-07-20 Oliver Hunt <oliver@apple.com> 16739 16740 Reviewed by Gavin Barraclough. 16741 16742 Make it harder to misuse try* allocation routines 16743 https://bugs.webkit.org/show_bug.cgi?id=27469 16744 16745 Jump through a few hoops to make it much harder to accidentally 16746 miss null-checking of values returned by the try-* allocation 16747 routines. 16748 16749 * JavaScriptCore.xcodeproj/project.pbxproj: 16750 * runtime/JSArray.cpp: 16751 (JSC::JSArray::putSlowCase): 16752 (JSC::JSArray::increaseVectorLength): 16753 * runtime/StringPrototype.cpp: 16754 (JSC::stringProtoFuncFontsize): 16755 (JSC::stringProtoFuncLink): 16756 * runtime/UString.cpp: 16757 (JSC::allocChars): 16758 (JSC::reallocChars): 16759 (JSC::expandCapacity): 16760 (JSC::UString::Rep::reserveCapacity): 16761 (JSC::UString::expandPreCapacity): 16762 (JSC::createRep): 16763 (JSC::concatenate): 16764 (JSC::UString::spliceSubstringsWithSeparators): 16765 (JSC::UString::replaceRange): 16766 (JSC::UString::append): 16767 (JSC::UString::operator=): 16768 * runtime/UString.h: 16769 (JSC::UString::Rep::createEmptyBuffer): 16770 * wtf/FastMalloc.cpp: 16771 (WTF::tryFastZeroedMalloc): 16772 (WTF::tryFastMalloc): 16773 (WTF::tryFastCalloc): 16774 (WTF::tryFastRealloc): 16775 (WTF::TCMallocStats::tryFastMalloc): 16776 (WTF::TCMallocStats::tryFastCalloc): 16777 (WTF::TCMallocStats::tryFastRealloc): 16778 * wtf/FastMalloc.h: 16779 (WTF::TryMallocReturnValue::TryMallocReturnValue): 16780 (WTF::TryMallocReturnValue::~TryMallocReturnValue): 16781 (WTF::TryMallocReturnValue::operator Maybe<T>): 16782 (WTF::TryMallocReturnValue::getValue): 16783 * wtf/PossiblyNull.h: 16784 (WTF::PossiblyNull::PossiblyNull): 16785 (WTF::PossiblyNull::~PossiblyNull): 16786 (WTF::PossiblyNull::getValue): 16787 * wtf/Platform.h: 16788 167892009-07-20 Gavin Barraclough <barraclough@apple.com> 16790 16791 RS Oliver Hunt. 16792 16793 Add ARM assembler files to xcodeproj, for convenience editing. 16794 16795 * JavaScriptCore.xcodeproj/project.pbxproj: 16796 167972009-07-20 Jessie Berlin <jberlin@apple.com> 16798 16799 Reviewed by David Levin. 16800 16801 Fix an incorrect assertion in Vector::remove. 16802 16803 https://bugs.webkit.org/show_bug.cgi?id=27477 16804 16805 * wtf/Vector.h: 16806 (WTF::::remove): 16807 Assert that the position at which to start removing elements + the 16808 length (the number of elements to remove) is less than or equal to the 16809 size of the entire Vector. 16810 168112009-07-20 Peter Kasting <pkasting@google.com> 16812 16813 Reviewed by Mark Rowe. 16814 16815 https://bugs.webkit.org/show_bug.cgi?id=27468 16816 Back out r46060, which caused problems for some Apple developers. 16817 16818 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: 16819 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: 16820 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: 16821 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: 16822 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: 16823 168242009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 16825 16826 Reviewed by Oliver Hunt. 16827 16828 Allow custom memory allocation control in NewThreadContext 16829 https://bugs.webkit.org/show_bug.cgi?id=27338 16830 16831 Inherits NewThreadContext struct from FastAllocBase because it 16832 has been instantiated by 'new' JavaScriptCore/wtf/Threading.cpp:76. 16833 16834 * wtf/Threading.cpp: 16835 168362009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 16837 16838 Reviewed by Oliver Hunt. 16839 16840 Allow custom memory allocation control in JavaScriptCore's JSClassRef.h 16841 https://bugs.webkit.org/show_bug.cgi?id=27340 16842 16843 Inherit StaticValueEntry and StaticFunctionEntry struct from FastAllocBase because these 16844 have been instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:153 16845 and in JavaScriptCore/API/JSClassRef.cpp:166. 16846 16847 * API/JSClassRef.h: 16848 168492009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 16850 16851 Reviewed by Darin Adler. 16852 16853 Allow custom memory allocation control in JavaScriptCore's RegexPattern.h 16854 https://bugs.webkit.org/show_bug.cgi?id=27343 16855 16856 Inherits RegexPattern.h's structs (which have been instantiated by operator new) from FastAllocBase: 16857 16858 CharacterClass (new call: JavaScriptCore/yarr/RegexCompiler.cpp:144) 16859 PatternAlternative (new call: JavaScriptCore/yarr/RegexPattern.h:221) 16860 PatternDisjunction (new call: JavaScriptCore/yarr/RegexCompiler.cpp:446) 16861 16862 * yarr/RegexPattern.h: 16863 168642009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 16865 16866 Reviewed by Darin Adler. 16867 16868 Allow custom memory allocation control for JavaScriptCore's MatchFrame struct 16869 https://bugs.webkit.org/show_bug.cgi?id=27344 16870 16871 Inherits MatchFrame struct from FastAllocBase because it has 16872 been instantiated by 'new' JavaScriptCore/pcre/pcre_exec.cpp:359. 16873 16874 * pcre/pcre_exec.cpp: 16875 168762009-07-20 Laszlo Gombos <laszlo.1.gombos@nokia.com> 16877 16878 Reviewed by Holger Freyther. 16879 16880 Remove some outdated S60 platform specific code 16881 https://bugs.webkit.org/show_bug.cgi?id=27423 16882 16883 * wtf/Platform.h: 16884 168852009-07-20 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 16886 16887 Reviewed by Simon Hausmann. 16888 16889 Qt build fix with MSVC and MinGW. 16890 16891 * jsc.pro: Make sure jsc is a console application, and turn off 16892 exceptions and stl support to fix the build. 16893 168942009-07-20 Xan Lopez <xlopez@igalia.com> 16895 16896 Reviewed by Gustavo Noronha. 16897 16898 Do not use C++-style comments in preprocessor directives. 16899 16900 GCC does not like this in some configurations, using C-style 16901 comments is safer. 16902 16903 * wtf/Platform.h: 16904 169052009-07-17 Peter Kasting <pkasting@google.com> 16906 16907 Reviewed by Steve Falkenburg. 16908 16909 https://bugs.webkit.org/show_bug.cgi?id=27323 16910 Only add Cygwin to the path when it isn't already there. This avoids 16911 causing problems for people who purposefully have non-Cygwin versions of 16912 executables like svn in front of the Cygwin ones in their paths. 16913 16914 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: 16915 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: 16916 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: 16917 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: 16918 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: 16919 169202009-07-17 Gabor Loki <loki@inf.u-szeged.hu> 16921 16922 Reviewed by Gavin Barraclough. 16923 16924 Add YARR support for generic ARM platforms (disabled by default). 16925 https://bugs.webkit.org/show_bug.cgi?id=24986 16926 16927 Add generic ARM port for MacroAssembler. It supports the whole 16928 MacroAssembler functionality except floating point. 16929 16930 The class JmpSrc is extended with a flag which enables to patch 16931 the jump destination offset during execution. This feature is 16932 required for generic ARM port. 16933 16934 Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 16935 Signed off by Gabor Loki <loki@inf.u-szeged.hu> 16936 16937 * JavaScriptCore.pri: 16938 * assembler/ARMAssembler.cpp: Added. 16939 (JSC::ARMAssembler::getLdrImmAddress): 16940 (JSC::ARMAssembler::linkBranch): 16941 (JSC::ARMAssembler::patchConstantPoolLoad): 16942 (JSC::ARMAssembler::getOp2): 16943 (JSC::ARMAssembler::genInt): 16944 (JSC::ARMAssembler::getImm): 16945 (JSC::ARMAssembler::moveImm): 16946 (JSC::ARMAssembler::dataTransfer32): 16947 (JSC::ARMAssembler::baseIndexTransfer32): 16948 (JSC::ARMAssembler::executableCopy): 16949 * assembler/ARMAssembler.h: Added. 16950 (JSC::ARM::): 16951 (JSC::ARMAssembler::ARMAssembler): 16952 (JSC::ARMAssembler::): 16953 (JSC::ARMAssembler::JmpSrc::JmpSrc): 16954 (JSC::ARMAssembler::JmpSrc::enableLatePatch): 16955 (JSC::ARMAssembler::JmpDst::JmpDst): 16956 (JSC::ARMAssembler::JmpDst::isUsed): 16957 (JSC::ARMAssembler::JmpDst::used): 16958 (JSC::ARMAssembler::emitInst): 16959 (JSC::ARMAssembler::and_r): 16960 (JSC::ARMAssembler::ands_r): 16961 (JSC::ARMAssembler::eor_r): 16962 (JSC::ARMAssembler::eors_r): 16963 (JSC::ARMAssembler::sub_r): 16964 (JSC::ARMAssembler::subs_r): 16965 (JSC::ARMAssembler::rsb_r): 16966 (JSC::ARMAssembler::rsbs_r): 16967 (JSC::ARMAssembler::add_r): 16968 (JSC::ARMAssembler::adds_r): 16969 (JSC::ARMAssembler::adc_r): 16970 (JSC::ARMAssembler::adcs_r): 16971 (JSC::ARMAssembler::sbc_r): 16972 (JSC::ARMAssembler::sbcs_r): 16973 (JSC::ARMAssembler::rsc_r): 16974 (JSC::ARMAssembler::rscs_r): 16975 (JSC::ARMAssembler::tst_r): 16976 (JSC::ARMAssembler::teq_r): 16977 (JSC::ARMAssembler::cmp_r): 16978 (JSC::ARMAssembler::orr_r): 16979 (JSC::ARMAssembler::orrs_r): 16980 (JSC::ARMAssembler::mov_r): 16981 (JSC::ARMAssembler::movs_r): 16982 (JSC::ARMAssembler::bic_r): 16983 (JSC::ARMAssembler::bics_r): 16984 (JSC::ARMAssembler::mvn_r): 16985 (JSC::ARMAssembler::mvns_r): 16986 (JSC::ARMAssembler::mul_r): 16987 (JSC::ARMAssembler::muls_r): 16988 (JSC::ARMAssembler::mull_r): 16989 (JSC::ARMAssembler::ldr_imm): 16990 (JSC::ARMAssembler::ldr_un_imm): 16991 (JSC::ARMAssembler::dtr_u): 16992 (JSC::ARMAssembler::dtr_ur): 16993 (JSC::ARMAssembler::dtr_d): 16994 (JSC::ARMAssembler::dtr_dr): 16995 (JSC::ARMAssembler::ldrh_r): 16996 (JSC::ARMAssembler::ldrh_d): 16997 (JSC::ARMAssembler::ldrh_u): 16998 (JSC::ARMAssembler::strh_r): 16999 (JSC::ARMAssembler::push_r): 17000 (JSC::ARMAssembler::pop_r): 17001 (JSC::ARMAssembler::poke_r): 17002 (JSC::ARMAssembler::peek_r): 17003 (JSC::ARMAssembler::clz_r): 17004 (JSC::ARMAssembler::bkpt): 17005 (JSC::ARMAssembler::lsl): 17006 (JSC::ARMAssembler::lsr): 17007 (JSC::ARMAssembler::asr): 17008 (JSC::ARMAssembler::lsl_r): 17009 (JSC::ARMAssembler::lsr_r): 17010 (JSC::ARMAssembler::asr_r): 17011 (JSC::ARMAssembler::size): 17012 (JSC::ARMAssembler::ensureSpace): 17013 (JSC::ARMAssembler::label): 17014 (JSC::ARMAssembler::align): 17015 (JSC::ARMAssembler::jmp): 17016 (JSC::ARMAssembler::patchPointerInternal): 17017 (JSC::ARMAssembler::patchConstantPoolLoad): 17018 (JSC::ARMAssembler::patchPointer): 17019 (JSC::ARMAssembler::repatchInt32): 17020 (JSC::ARMAssembler::repatchPointer): 17021 (JSC::ARMAssembler::repatchLoadPtrToLEA): 17022 (JSC::ARMAssembler::linkJump): 17023 (JSC::ARMAssembler::relinkJump): 17024 (JSC::ARMAssembler::linkCall): 17025 (JSC::ARMAssembler::relinkCall): 17026 (JSC::ARMAssembler::getRelocatedAddress): 17027 (JSC::ARMAssembler::getDifferenceBetweenLabels): 17028 (JSC::ARMAssembler::getCallReturnOffset): 17029 (JSC::ARMAssembler::getOp2Byte): 17030 (JSC::ARMAssembler::placeConstantPoolBarrier): 17031 (JSC::ARMAssembler::RM): 17032 (JSC::ARMAssembler::RS): 17033 (JSC::ARMAssembler::RD): 17034 (JSC::ARMAssembler::RN): 17035 (JSC::ARMAssembler::getConditionalField): 17036 * assembler/ARMv7Assembler.h: 17037 (JSC::ARMv7Assembler::JmpSrc::enableLatePatch): 17038 * assembler/AbstractMacroAssembler.h: 17039 (JSC::AbstractMacroAssembler::Call::enableLatePatch): 17040 (JSC::AbstractMacroAssembler::Jump::enableLatePatch): 17041 * assembler/MacroAssembler.h: 17042 * assembler/MacroAssemblerARM.h: Added. 17043 (JSC::MacroAssemblerARM::): 17044 (JSC::MacroAssemblerARM::add32): 17045 (JSC::MacroAssemblerARM::and32): 17046 (JSC::MacroAssemblerARM::lshift32): 17047 (JSC::MacroAssemblerARM::mul32): 17048 (JSC::MacroAssemblerARM::not32): 17049 (JSC::MacroAssemblerARM::or32): 17050 (JSC::MacroAssemblerARM::rshift32): 17051 (JSC::MacroAssemblerARM::sub32): 17052 (JSC::MacroAssemblerARM::xor32): 17053 (JSC::MacroAssemblerARM::load32): 17054 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch): 17055 (JSC::MacroAssemblerARM::loadPtrWithPatchToLEA): 17056 (JSC::MacroAssemblerARM::load16): 17057 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch): 17058 (JSC::MacroAssemblerARM::store32): 17059 (JSC::MacroAssemblerARM::pop): 17060 (JSC::MacroAssemblerARM::push): 17061 (JSC::MacroAssemblerARM::move): 17062 (JSC::MacroAssemblerARM::swap): 17063 (JSC::MacroAssemblerARM::signExtend32ToPtr): 17064 (JSC::MacroAssemblerARM::zeroExtend32ToPtr): 17065 (JSC::MacroAssemblerARM::branch32): 17066 (JSC::MacroAssemblerARM::branch16): 17067 (JSC::MacroAssemblerARM::branchTest32): 17068 (JSC::MacroAssemblerARM::jump): 17069 (JSC::MacroAssemblerARM::branchAdd32): 17070 (JSC::MacroAssemblerARM::mull32): 17071 (JSC::MacroAssemblerARM::branchMul32): 17072 (JSC::MacroAssemblerARM::branchSub32): 17073 (JSC::MacroAssemblerARM::breakpoint): 17074 (JSC::MacroAssemblerARM::nearCall): 17075 (JSC::MacroAssemblerARM::call): 17076 (JSC::MacroAssemblerARM::ret): 17077 (JSC::MacroAssemblerARM::set32): 17078 (JSC::MacroAssemblerARM::setTest32): 17079 (JSC::MacroAssemblerARM::tailRecursiveCall): 17080 (JSC::MacroAssemblerARM::makeTailRecursiveCall): 17081 (JSC::MacroAssemblerARM::moveWithPatch): 17082 (JSC::MacroAssemblerARM::branchPtrWithPatch): 17083 (JSC::MacroAssemblerARM::storePtrWithPatch): 17084 (JSC::MacroAssemblerARM::supportsFloatingPoint): 17085 (JSC::MacroAssemblerARM::supportsFloatingPointTruncate): 17086 (JSC::MacroAssemblerARM::loadDouble): 17087 (JSC::MacroAssemblerARM::storeDouble): 17088 (JSC::MacroAssemblerARM::addDouble): 17089 (JSC::MacroAssemblerARM::subDouble): 17090 (JSC::MacroAssemblerARM::mulDouble): 17091 (JSC::MacroAssemblerARM::convertInt32ToDouble): 17092 (JSC::MacroAssemblerARM::branchDouble): 17093 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32): 17094 (JSC::MacroAssemblerARM::ARMCondition): 17095 (JSC::MacroAssemblerARM::prepareCall): 17096 (JSC::MacroAssemblerARM::call32): 17097 * assembler/X86Assembler.h: 17098 (JSC::X86Assembler::JmpSrc::enableLatePatch): 17099 * jit/ExecutableAllocator.h: 17100 (JSC::ExecutableAllocator::cacheFlush): 17101 * wtf/Platform.h: 17102 * yarr/RegexJIT.cpp: 17103 (JSC::Yarr::RegexGenerator::generateEnter): 17104 (JSC::Yarr::RegexGenerator::generateReturn): 17105 171062009-07-17 Gabor Loki <loki@inf.u-szeged.hu> 17107 17108 Reviewed by Gavin Barraclough. 17109 17110 Extend AssemblerBuffer with constant pool handling mechanism. 17111 https://bugs.webkit.org/show_bug.cgi?id=24986 17112 17113 Add a platform independed constant pool framework. 17114 This pool can store 32 or 64 bits values which is enough to hold 17115 any integer, pointer or double constant. 17116 17117 * assembler/AssemblerBuffer.h: 17118 (JSC::AssemblerBuffer::putIntUnchecked): 17119 (JSC::AssemblerBuffer::putInt64Unchecked): 17120 (JSC::AssemblerBuffer::append): 17121 (JSC::AssemblerBuffer::grow): 17122 * assembler/AssemblerBufferWithConstantPool.h: Added. 17123 (JSC::): 17124 171252009-07-17 Eric Roman <eroman@chromium.org> 17126 17127 Reviewed by Darin Adler. 17128 17129 Build fix for non-Darwin. 17130 Add a guard for inclusion of RetainPtr.h which includes CoreFoundation.h 17131 17132 https://bugs.webkit.org/show_bug.cgi?id=27382 17133 17134 * wtf/unicode/icu/CollatorICU.cpp: 17135 171362009-07-17 Alexey Proskuryakov <ap@webkit.org> 17137 17138 Reviewed by John Sullivan. 17139 17140 Get user default collation order via a CFLocale API when available. 17141 17142 * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault): 17143 171442009-07-17 Laszlo Gombos <laszlo.1.gombos@nokia.com> 17145 17146 Reviewed by Simon Hausmann. 17147 17148 [Qt] Fix the include path for the Symbian port 17149 https://bugs.webkit.org/show_bug.cgi?id=27358 17150 17151 * JavaScriptCore.pri: 17152 171532009-07-17 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 17154 17155 Reviewed by David Levin. 17156 17157 Build fix on platforms don't have MMAP. 17158 https://bugs.webkit.org/show_bug.cgi?id=27365 17159 17160 * interpreter/RegisterFile.h: Including stdio.h irrespectively of HAVE(MMAP) 17161 171622009-07-16 Fumitoshi Ukai <ukai@chromium.org> 17163 17164 Reviewed by David Levin. 17165 17166 Add --web-sockets flag and ENABLE_WEB_SOCKETS define. 17167 https://bugs.webkit.org/show_bug.cgi?id=27206 17168 17169 Add ENABLE_WEB_SOCKETS 17170 17171 * Configurations/FeatureDefines.xcconfig: add ENABLE_WEB_SOCKETS 17172 171732009-07-16 Maxime Simon <simon.maxime@gmail.com> 17174 17175 Reviewed by Eric Seidel. 17176 17177 Added Haiku-specific files for JavaScriptCore. 17178 https://bugs.webkit.org/show_bug.cgi?id=26620 17179 17180 * wtf/haiku/MainThreadHaiku.cpp: Added. 17181 (WTF::initializeMainThreadPlatform): 17182 (WTF::scheduleDispatchFunctionsOnMainThread): 17183 171842009-07-16 Gavin Barraclough <barraclough@apple.com> 17185 17186 RS by Oliver Hunt. 17187 17188 Revert r45969, this fix does not appear to be valid. 17189 https://bugs.webkit.org/show_bug.cgi?id=27077 17190 17191 * bytecode/CodeBlock.cpp: 17192 (JSC::CodeBlock::~CodeBlock): 17193 (JSC::CodeBlock::unlinkCallers): 17194 * jit/JIT.cpp: 17195 * jit/JIT.h: 17196 171972009-07-16 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17198 17199 Reviewed by Oliver Hunt. 17200 17201 Allow custom memory allocation control in ExceptionInfo and RareData struct 17202 https://bugs.webkit.org/show_bug.cgi?id=27336 17203 17204 Inherits ExceptionInfo and RareData struct from FastAllocBase because these 17205 have been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.cpp:1289 and 17206 in JavaScriptCore/bytecode/CodeBlock.h:453. 17207 17208 Remove unnecessary WTF:: namespace from CodeBlock inheritance. 17209 17210 * bytecode/CodeBlock.h: 17211 172122009-07-16 Mark Rowe <mrowe@apple.com> 17213 17214 Rubber-stamped by Geoff Garen. 17215 17216 Fix FeatureDefines.xcconfig to not be out of sync with the rest of the world. 17217 17218 * Configurations/FeatureDefines.xcconfig: 17219 172202009-07-16 Yong Li <yong.li@torchmobile.com> 17221 17222 Reviewed by George Staikos. 17223 17224 https://bugs.webkit.org/show_bug.cgi?id=27320 17225 _countof is only included in CE6; for CE5 we need to define it ourself 17226 17227 * wtf/Platform.h: 17228 172292009-07-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 17230 17231 Reviewed by Oliver Hunt. 17232 17233 Workers + garbage collector: weird crashes 17234 https://bugs.webkit.org/show_bug.cgi?id=27077 17235 17236 We need to unlink cached method call sites when a function is destroyed. 17237 17238 * JavaScriptCore.xcodeproj/project.pbxproj: 17239 * bytecode/CodeBlock.cpp: 17240 (JSC::CodeBlock::~CodeBlock): 17241 (JSC::CodeBlock::unlinkCallers): 17242 * jit/JIT.cpp: 17243 (JSC::JIT::unlinkMethodCall): 17244 * jit/JIT.h: 17245 172462009-07-15 Steve Falkenburg <sfalken@apple.com> 17247 17248 Windows Build fix. 17249 17250 Visual Studio reset our intermediate directory on us. 17251 This sets it back. 17252 17253 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 17254 * JavaScriptCore.vcproj/testapi/testapi.vcproj: 17255 172562009-07-15 Kwang Yul Seo <skyul@company100.net> 17257 17258 Reviewed by Eric Seidel. 17259 17260 https://bugs.webkit.org/show_bug.cgi?id=26794 17261 Make Yacc-generated parsers to use fastMalloc/fastFree. 17262 17263 Define YYMALLOC and YYFREE to fastMalloc and fastFree 17264 respectively. 17265 17266 * parser/Grammar.y: 17267 172682009-07-15 Darin Adler <darin@apple.com> 17269 17270 Fix a build for a particular Apple configuration. 17271 17272 * wtf/FastAllocBase.h: Change include to use "" style for 17273 including another wtf header. This is the style we use for 17274 including other public headers in the same directory. 17275 172762009-07-15 George Staikos <george.staikos@torchmobile.com> 17277 17278 Reviewed by Adam Treat. 17279 17280 https://bugs.webkit.org/show_bug.cgi?id=27303 17281 Implement createThreadInternal for WinCE. 17282 Contains changes by George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com> 17283 17284 * wtf/ThreadingWin.cpp: 17285 (WTF::createThreadInternal): 17286 172872009-07-15 Joe Mason <joe.mason@torchmobile.com> 17288 17289 Reviewed by George Staikos. 17290 17291 https://bugs.webkit.org/show_bug.cgi?id=27298 17292 Platform defines for WINCE. 17293 Contains changes by Yong Li <yong.li@torchmobile.com>, 17294 George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com> 17295 17296 * wtf/Platform.h: 17297 172982009-07-15 Yong Li <yong.li@torchmobile.com> 17299 17300 Reviewed by Adam Treat. 17301 17302 https://bugs.webkit.org/show_bug.cgi?id=27306 17303 Use RegisterClass instead of RegisterClassEx on WinCE. 17304 17305 * wtf/win/MainThreadWin.cpp: 17306 (WTF::initializeMainThreadPlatform): 17307 173082009-07-15 Yong Li <yong.li@torchmobile.com> 17309 17310 Reviewed by George Staikos. 17311 17312 https://bugs.webkit.org/show_bug.cgi?id=27301 17313 Use OutputDebugStringW on WinCE since OutputDebugStringA is not supported 17314 Originally written by Yong Li <yong.li@torchmobile.com> and refactored by 17315 Joe Mason <joe.mason@torchmobile.com> 17316 17317 * wtf/Assertions.cpp: vprintf_stderr_common 17318 173192009-07-15 Yong Li <yong.li@torchmobile.com> 17320 17321 Reviewed by George Staikos. 17322 17323 https://bugs.webkit.org/show_bug.cgi?id=27020 17324 msToGregorianDateTime should set utcOffset to 0 when outputIsUTC is false 17325 17326 * wtf/DateMath.cpp: 17327 (WTF::gregorianDateTimeToMS): 17328 173292009-07-15 Laszlo Gombos <laszlo.1.gombos@nokia.com> 17330 17331 Reviewed by Simon Hausmann. 17332 17333 [Qt] Cleanup - Remove obsolete code from the make system 17334 https://bugs.webkit.org/show_bug.cgi?id=27299 17335 17336 * JavaScriptCore.pro: 17337 * jsc.pro: 17338 173392009-07-07 Norbert Leser <norbert.leser@nokia.com> 17340 17341 Reviewed by Simon Hausmann. 17342 17343 https://bugs.webkit.org/show_bug.cgi?id=27056 17344 17345 Alternate bool operator for codewarrior compiler (WINSCW). 17346 Compiler (latest b482) reports error for UnspecifiedBoolType construct: 17347 "illegal explicit conversion from 'WTF::OwnArrayPtr<JSC::Register>' to 'bool'" 17348 17349 Same fix as in r38391. 17350 17351 * JavaScriptCore/wtf/OwnArrayPtr.h: 17352 173532009-07-15 Norbert Leser <norbert.leser@nokia.com> 17354 17355 Reviewed by Darin Adler. 17356 17357 Qualify include path with wtf to fix compilation 17358 on Symbian. 17359 https://bugs.webkit.org/show_bug.cgi?id=27055 17360 17361 * interpreter/Interpreter.h: 17362 173632009-07-15 Laszlo Gombos <laszlo.1.gombos@nokia.com> 17364 17365 Reviewed by Dave Kilzer. 17366 17367 Turn off non-portable date manipulations for SYMBIAN 17368 https://bugs.webkit.org/show_bug.cgi?id=27064 17369 17370 Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards 17371 and place the rules for controlling the guards in Platform.h. 17372 Turn off these newly introduced guards for SYMBIAN. 17373 17374 * wtf/DateMath.cpp: 17375 (WTF::calculateUTCOffset): 17376 * wtf/DateMath.h: 17377 (WTF::GregorianDateTime::GregorianDateTime): 17378 (WTF::GregorianDateTime::operator tm): 17379 * wtf/Platform.h: 17380 173812009-07-15 Norbert Leser <norbert.leser@nokia.com> 17382 17383 Reviewed by Simon Hausmann. 17384 17385 Undef ASSERT on Symbian, to avoid excessive warnings 17386 https://bugs.webkit.org/show_bug.cgi?id=27052 17387 17388 * wtf/Assertions.h: 17389 173902009-07-15 Oliver Hunt <oliver@apple.com> 17391 17392 Reviewed by Simon Hausmann. 17393 17394 REGRESSION: fast/js/postfix-syntax.html fails with interpreter 17395 https://bugs.webkit.org/show_bug.cgi?id=27294 17396 17397 When postfix operators operating on locals assign to the same local 17398 the order of operations has to be to store the incremented value, then 17399 store the unmodified number. Rather than implementing this subtle 17400 semantic in the interpreter I've just made the logic explicit in the 17401 bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a 17402 local var x). 17403 17404 * parser/Nodes.cpp: 17405 (JSC::emitPostIncOrDec): 17406 174072009-07-15 Oliver Hunt <oliver@apple.com> 17408 17409 Reviewed by Simon Hausmann. 17410 17411 REGRESSION(43559): fast/js/kde/arguments-scope.html fails with interpreter 17412 https://bugs.webkit.org/show_bug.cgi?id=27259 17413 17414 The interpreter was incorrectly basing its need to create the arguments object 17415 based on the presence of the callframe's argument reference rather than the local 17416 arguments reference. Based on this it then overrode the local variable reference. 17417 17418 * interpreter/Interpreter.cpp: 17419 (JSC::Interpreter::privateExecute): 17420 174212009-07-14 Steve Falkenburg <sfalken@apple.com> 17422 17423 Reorganize JavaScriptCore headers into: 17424 API: include/JavaScriptCore/ 17425 Private: include/private/JavaScriptCore/ 17426 17427 Reviewed by Darin Adler. 17428 17429 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 17430 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: 17431 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: 17432 * JavaScriptCore.vcproj/testapi/testapi.vcproj: 17433 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: 17434 174352009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17436 17437 Reviewed by Darin Adler. 17438 17439 Change JSCell's superclass to NoncopyableCustomAllocated 17440 https://bugs.webkit.org/show_bug.cgi?id=27248 17441 17442 JSCell class customizes operator new, since Noncopyable will be 17443 inherited from FastAllocBase, NoncopyableCustomAllocated has 17444 to be used. 17445 17446 * runtime/JSCell.h: 17447 174482009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17449 17450 Reviewed by Darin Adler. 17451 17452 Change all Noncopyable inheriting visibility to public. 17453 https://bugs.webkit.org/show_bug.cgi?id=27225 17454 17455 Change all Noncopyable inheriting visibility to public because 17456 it is needed to the custom allocation framework (bug #20422). 17457 17458 * bytecode/SamplingTool.h: 17459 * bytecompiler/RegisterID.h: 17460 * interpreter/CachedCall.h: 17461 * interpreter/RegisterFile.h: 17462 * parser/Lexer.h: 17463 * parser/Parser.h: 17464 * runtime/ArgList.h: 17465 * runtime/BatchedTransitionOptimizer.h: 17466 * runtime/Collector.h: 17467 * runtime/CommonIdentifiers.h: 17468 * runtime/JSCell.h: 17469 * runtime/JSGlobalObject.h: 17470 * runtime/JSLock.h: 17471 * runtime/JSONObject.cpp: 17472 * runtime/SmallStrings.cpp: 17473 * runtime/SmallStrings.h: 17474 * wtf/CrossThreadRefCounted.h: 17475 * wtf/GOwnPtr.h: 17476 * wtf/Locker.h: 17477 * wtf/MessageQueue.h: 17478 * wtf/OwnArrayPtr.h: 17479 * wtf/OwnFastMallocPtr.h: 17480 * wtf/OwnPtr.h: 17481 * wtf/RefCounted.h: 17482 * wtf/ThreadSpecific.h: 17483 * wtf/Threading.h: 17484 * wtf/Vector.h: 17485 * wtf/unicode/Collator.h: 17486 174872009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17488 17489 Reviewed by Darin Adler. 17490 17491 Change ParserArenaRefCounted's superclass to RefCountedCustomAllocated 17492 https://bugs.webkit.org/show_bug.cgi?id=27249 17493 17494 ParserArenaDeletable customizes operator new, to avoid double inheritance 17495 ParserArenaDeletable's superclass has been changed to RefCountedCustomAllocated. 17496 17497 * parser/Nodes.h: 17498 174992009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17500 17501 Reviewed by Darin Adler. 17502 17503 Add RefCountedCustomAllocated to RefCounted.h 17504 https://bugs.webkit.org/show_bug.cgi?id=27232 17505 17506 Some class which are inherited from RefCounted customize 17507 operator new, but RefCounted is inherited from Noncopyable 17508 which will be inherited from FastAllocBase. To avoid 17509 conflicts Noncopyable inheriting was moved down to RefCounted 17510 and to avoid double inheritance this class has been added. 17511 17512 * wtf/RefCounted.h: 17513 (WTF::RefCountedCustomAllocated::deref): 17514 (WTF::RefCountedCustomAllocated::~RefCountedCustomAllocated): 17515 175162009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17517 17518 Reviewed by Darin Adler. 17519 17520 Add NoncopyableCustomAllocated to Noncopyable.h. 17521 https://bugs.webkit.org/show_bug.cgi?id=27228 17522 17523 Some classes which inherited from Noncopyable overrides operator new 17524 since Noncopyable'll be inherited from FastAllocBase, Noncopyable.h 17525 needs to be extended with this new class to support the overriding. 17526 17527 * wtf/Noncopyable.h: 17528 (WTFNoncopyable::NoncopyableCustomAllocated::NoncopyableCustomAllocated): 17529 (WTFNoncopyable::NoncopyableCustomAllocated::~NoncopyableCustomAllocated): 17530 175312009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17532 17533 Reviewed by Darin Adler. 17534 17535 Allow custom memory allocation control for JavaScriptCore's IdentifierTable class 17536 https://bugs.webkit.org/show_bug.cgi?id=27260 17537 17538 Inherits IdentifierTable class from FastAllocBase because it has been 17539 instantiated by 'new' in JavaScriptCore/runtime/Identifier.cpp:70. 17540 17541 * runtime/Identifier.cpp: 17542 175432009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 17544 17545 Reviewed by Darin Adler. 17546 17547 Allow custom memory allocation control for JavaScriptCore's Profiler class 17548 https://bugs.webkit.org/show_bug.cgi?id=27253 17549 17550 Inherits Profiler class from FastAllocBase because it has been instantiated by 17551 'new' in JavaScriptCore/profiler/Profiler.cpp:56. 17552 17553 * profiler/Profiler.h: 17554 175552009-07-06 George Staikos <george.staikos@torchmobile.com> 17556 17557 Reviewed by Adam Treat. 17558 17559 Authors: George Staikos <george.staikos@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>, Makoto Matsumoto <matumoto@math.keio.ac.jp>, Takuji Nishimura 17560 17561 https://bugs.webkit.org/show_bug.cgi?id=27030 17562 Implement custom RNG for WinCE using Mersenne Twister 17563 17564 * wtf/RandomNumber.cpp: 17565 (WTF::randomNumber): 17566 * wtf/RandomNumberSeed.h: 17567 (WTF::initializeRandomNumberGenerator): 17568 * wtf/wince/mt19937ar.c: Added. 17569 (init_genrand): 17570 (init_by_array): 17571 (genrand_int32): 17572 (genrand_int31): 17573 (genrand_real1): 17574 (genrand_real2): 17575 (genrand_real3): 17576 (genrand_res53): 17577 175782009-07-13 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 17579 17580 Unreviewed make dist build fix. 17581 17582 * GNUmakefile.am: 17583 175842009-07-13 Drew Wilson <atwilson@google.com> 17585 17586 Reviewed by David Levin. 17587 17588 Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs 17589 https://bugs.webkit.org/show_bug.cgi?id=26932 17590 17591 Added ENABLE(SHARED_WORKERS) flag (off by default). 17592 17593 * Configurations/FeatureDefines.xcconfig: 17594 175952009-07-07 Norbert Leser <norbert.leser@nokia.com> 17596 17597 Reviewed by Maciej Stachoviak. 17598 17599 https://bugs.webkit.org/show_bug.cgi?id=27058 17600 17601 Removed superfluous parenthesis around single expression. 17602 Compilers on Symbian platform fail to properly parse and compile. 17603 17604 * JavaScriptCore/wtf/Platform.h: 17605 176062009-07-13 Norbert Leser <norbert.leser@nokia.com> 17607 17608 Reviewed by Maciej Stachoviak. 17609 17610 https://bugs.webkit.org/show_bug.cgi?id=27054 17611 17612 Renamed Translator to HashTranslator 17613 17614 Codewarrior compiler (WINSCW) latest b482 cannot resolve typename 17615 mismatch between template declaration and definition 17616 (HashTranslator / Translator) 17617 17618 * wtf/HashSet.h: 17619 176202009-07-13 Norbert Leser <norbert.leser@nokia.com> 17621 17622 Reviewed by Eric Seidel. 17623 17624 https://bugs.webkit.org/show_bug.cgi?id=27053 17625 17626 Ambiguity in LabelScope initialization 17627 17628 Codewarrior compiler (WINSCW) latest b482 on Symbian cannot resolve 17629 type of "0" unambiguously. Set expression explicitly to 17630 PassRefPtr<Label>::PassRefPtr() 17631 17632 * bytecompiler/BytecodeGenerator.cpp 17633 176342009-07-11 Simon Fraser <simon.fraser@apple.com> 17635 17636 Enable support for accelerated compositing and 3d transforms on Leopard. 17637 <https://bugs.webkit.org/show_bug.cgi?id=20166> 17638 <rdar://problem/6120614> 17639 17640 Reviewed by Oliver Hunt. 17641 17642 * Configurations/FeatureDefines.xcconfig: 17643 * wtf/Platform.h: 17644 176452009-07-10 Mark Rowe <mrowe@apple.com> 17646 17647 Second part of the "make Windows happier" dance. 17648 17649 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 17650 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 17651 176522009-07-10 Mark Rowe <mrowe@apple.com> 17653 17654 Try and make the Windows build happy. 17655 17656 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 17657 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 17658 176592009-07-10 Kevin McCullough <kmccullough@apple.com> 17660 17661 Reviewed by Geoffrey Garen. 17662 17663 * debugger/Debugger.h: Made this function virtual for use in WebCore's 17664 WebInspector. 17665 176662009-07-10 Kwang Yul Seo <skyul@company100.net> 17667 17668 Reviewed by Darin Adler. 17669 17670 ParserArenaDeletable should override delete 17671 https://bugs.webkit.org/show_bug.cgi?id=26790 17672 17673 ParserArenaDeletable overrides new, but it does not override delete. 17674 ParserArenaDeletable must be freed by fastFree 17675 because it is allocated by fastMalloc. 17676 17677 * parser/NodeConstructors.h: 17678 (JSC::ParserArenaDeletable::operator delete): 17679 * parser/Nodes.h: 17680 176812009-07-10 Adam Roben <aroben@apple.com> 17682 17683 Sort all our Xcode projects 17684 17685 Accomplished using sort-Xcode-project-file. 17686 17687 Requested by Dave Kilzer. 17688 17689 * JavaScriptCore.xcodeproj/project.pbxproj: 17690 176912009-07-09 Maciej Stachowiak <mjs@apple.com> 17692 17693 Not reviewed, build fix. 17694 17695 Windows build fix for the last change. 17696 17697 * wtf/dtoa.cpp: Forgot to include Vector.h 17698 176992009-07-09 Maciej Stachowiak <mjs@apple.com> 17700 17701 Reviewed by Darin Adler. 17702 17703 REGRESSION: crash in edge cases of floating point parsing. 17704 https://bugs.webkit.org/show_bug.cgi?id=27110 17705 <rdar://problem/7044458> 17706 17707 Tests: fast/css/number-parsing-crash.html 17708 fast/css/number-parsing-crash.html 17709 fast/js/number-parsing-crash.html 17710 17711 * wtf/dtoa.cpp: 17712 (WTF::BigInt::BigInt): Converted this to more a proper class, using a Vector 17713 with inline capacity 17714 17715 (WTF::lshift): Rearranged logic somewhat nontrivially to deal with the new way of sizing BigInts. 17716 Added an assertion to verify that invariants are maintained. 17717 17718 All other functions are adapted fairly mechanically to the above changes. 17719 (WTF::BigInt::clear): 17720 (WTF::BigInt::size): 17721 (WTF::BigInt::resize): 17722 (WTF::BigInt::words): 17723 (WTF::BigInt::append): 17724 (WTF::multadd): 17725 (WTF::s2b): 17726 (WTF::i2b): 17727 (WTF::mult): 17728 (WTF::cmp): 17729 (WTF::diff): 17730 (WTF::b2d): 17731 (WTF::d2b): 17732 (WTF::ratio): 17733 (WTF::strtod): 17734 (WTF::quorem): 17735 (WTF::dtoa): 17736 177372009-07-09 Drew Wilson <atwilson@google.com> 17738 17739 Reviewed by Alexey Proskuryakov. 17740 17741 Turned on CHANNEL_MESSAGING by default because the MessageChannel API 17742 can now be implemented for Web Workers and is reasonably stable. 17743 17744 * Configurations/FeatureDefines.xcconfig: 17745 177462009-07-09 Oliver Hunt <oliver@apple.com> 17747 17748 * interpreter/Interpreter.cpp: 17749 (JSC::Interpreter::privateExecute): 17750 177512009-07-09 Oliver Hunt <oliver@apple.com> 17752 17753 Reviewed by Darin Adler. 17754 17755 Bug 27016 - Interpreter crashes due to invalid array indexes 17756 <https://bugs.webkit.org/show_bug.cgi?id=27016> 17757 17758 Unsigned vs signed conversions results in incorrect behaviour in 17759 64bit interpreter builds. 17760 17761 * interpreter/Interpreter.cpp: 17762 (JSC::Interpreter::privateExecute): 17763 177642009-07-09 Dimitri Glazkov <dglazkov@chromium.org> 17765 17766 Reviewed by Darin Fisher. 17767 17768 [Chromium] Upstream JavaScriptCore.gypi, the project file for Chromium build. 17769 https://bugs.webkit.org/show_bug.cgi?id=27135 17770 17771 * JavaScriptCore.gypi: Added. 17772 177732009-07-09 Joe Mason <joe.mason@torchmobile.com> 17774 17775 Reviewed by George Staikos. 17776 17777 Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com> 17778 17779 https://bugs.webkit.org/show_bug.cgi?id=27031 17780 Add an override for deleteOwnedPtr(HDC) on Windows 17781 17782 * wtf/OwnPtrCommon.h: 17783 * wtf/OwnPtrWin.cpp: 17784 (WTF::deleteOwnedPtr): 17785 177862009-07-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 17787 17788 Reviewed by Darin Adler. 17789 17790 Guard singal.h dependency with HAVE(SIGNAL_H) to enable building jsc 17791 on SYMBIAN. 17792 17793 https://bugs.webkit.org/show_bug.cgi?id=27026 17794 17795 Based on Norbert Leser's work. 17796 17797 * jsc.cpp: 17798 (printUsageStatement): 17799 (parseArguments): 17800 * wtf/Platform.h: 17801 178022009-07-07 Gavin Barraclough <barraclough@apple.com> 17803 17804 Reviewed by Sam Weinig. 17805 17806 Stop loading constants into the register file. 17807 17808 Instead, use high register values (highest bit bar the sign bit set) to indicate 17809 constants in the instruction stream, and when we encounter such a value load it 17810 directly from the CodeBlock. 17811 17812 Since constants are no longer copied into the register file, this patch renders 17813 the 'unexpected constant' mechanism redundant, and removes it. 17814 17815 2% improvement, thanks to Sam Weinig. 17816 17817 * bytecode/CodeBlock.cpp: 17818 (JSC::CodeBlock::dump): 17819 (JSC::CodeBlock::CodeBlock): 17820 (JSC::CodeBlock::mark): 17821 (JSC::CodeBlock::shrinkToFit): 17822 * bytecode/CodeBlock.h: 17823 (JSC::CodeBlock::isTemporaryRegisterIndex): 17824 (JSC::CodeBlock::constantRegister): 17825 (JSC::CodeBlock::isConstantRegisterIndex): 17826 (JSC::CodeBlock::getConstant): 17827 (JSC::ExecState::r): 17828 * bytecode/Opcode.h: 17829 * bytecompiler/BytecodeGenerator.cpp: 17830 (JSC::BytecodeGenerator::preserveLastVar): 17831 (JSC::BytecodeGenerator::BytecodeGenerator): 17832 (JSC::BytecodeGenerator::addConstantValue): 17833 (JSC::BytecodeGenerator::emitEqualityOp): 17834 (JSC::BytecodeGenerator::emitLoad): 17835 (JSC::BytecodeGenerator::emitResolveBase): 17836 (JSC::BytecodeGenerator::emitResolveWithBase): 17837 (JSC::BytecodeGenerator::emitNewError): 17838 * bytecompiler/BytecodeGenerator.h: 17839 (JSC::BytecodeGenerator::emitNode): 17840 * interpreter/CallFrame.h: 17841 (JSC::ExecState::noCaller): 17842 (JSC::ExecState::hasHostCallFrameFlag): 17843 (JSC::ExecState::addHostCallFrameFlag): 17844 (JSC::ExecState::removeHostCallFrameFlag): 17845 * interpreter/Interpreter.cpp: 17846 (JSC::Interpreter::resolve): 17847 (JSC::Interpreter::resolveSkip): 17848 (JSC::Interpreter::resolveGlobal): 17849 (JSC::Interpreter::resolveBase): 17850 (JSC::Interpreter::resolveBaseAndProperty): 17851 (JSC::Interpreter::resolveBaseAndFunc): 17852 (JSC::Interpreter::dumpRegisters): 17853 (JSC::Interpreter::throwException): 17854 (JSC::Interpreter::createExceptionScope): 17855 (JSC::Interpreter::privateExecute): 17856 (JSC::Interpreter::retrieveArguments): 17857 * jit/JIT.cpp: 17858 (JSC::JIT::privateCompileMainPass): 17859 * jit/JITInlineMethods.h: 17860 (JSC::JIT::emitLoadDouble): 17861 (JSC::JIT::emitLoadInt32ToDouble): 17862 * jit/JITOpcodes.cpp: 17863 (JSC::JIT::emit_op_new_error): 17864 (JSC::JIT::emit_op_enter): 17865 (JSC::JIT::emit_op_enter_with_activation): 17866 * parser/Nodes.cpp: 17867 (JSC::DeleteResolveNode::emitBytecode): 17868 (JSC::DeleteValueNode::emitBytecode): 17869 (JSC::PrefixResolveNode::emitBytecode): 17870 * runtime/JSActivation.cpp: 17871 (JSC::JSActivation::JSActivation): 17872 * wtf/Platform.h: 17873 178742009-07-07 Mark Rowe <mrowe@apple.com> 17875 17876 Reviewed by Darin Adler. 17877 17878 Fix <https://bugs.webkit.org/show_bug.cgi?id=27025> / <rdar://problem/7033448>. 17879 Bug 27025: Crashes and regression test failures related to regexps in 64-bit 17880 17881 For x86_64 RegexGenerator uses rbx, a callee-save register, as a scratch register but 17882 neglects to save and restore it. The change in handling of the output vector in r45545 17883 altered code generation so that the RegExp::match was now storing important data in rbx, 17884 which caused crashes and bogus results when it was clobbered. 17885 17886 * yarr/RegexJIT.cpp: 17887 (JSC::Yarr::RegexGenerator::generateEnter): Save rbx. 17888 (JSC::Yarr::RegexGenerator::generateReturn): Restore rbx. 17889 178902009-07-06 Ada Chan <adachan@apple.com> 17891 17892 Reviewed by Darin Adler and Mark Rowe. 17893 17894 Decommitted spans are added to the list of normal spans rather than 17895 the returned spans in TCMalloc_PageHeap::Delete(). 17896 https://bugs.webkit.org/show_bug.cgi?id=26998 17897 17898 In TCMalloc_PageHeap::Delete(), the deleted span can be decommitted in 17899 the process of merging with neighboring spans that are also decommitted. 17900 The merged span needs to be placed in the list of returned spans (spans 17901 whose memory has been returned to the system). Right now it's always added 17902 to the list of the normal spans which can theoretically cause thrashing. 17903 17904 * wtf/FastMalloc.cpp: 17905 (WTF::TCMalloc_PageHeap::Delete): 17906 179072009-07-05 Lars Knoll <lars.knoll@nokia.com> 17908 17909 Reviewed by Maciej Stachowiak. 17910 17911 https://bugs.webkit.org/show_bug.cgi?id=26843 17912 17913 Fix run-time crashes in JavaScriptCore with the Metrowerks compiler on Symbian. 17914 17915 The Metrowerks compiler on the Symbian platform moves the globally 17916 defined Hashtables into read-only memory, despite one of the members 17917 being mutable. This causes crashes at run-time due to write access to 17918 read-only memory. 17919 17920 Avoid the use of const with this compiler by introducing the 17921 JSC_CONST_HASHTABLE macro. 17922 17923 Based on idea by Norbert Leser. 17924 17925 * runtime/Lookup.h: Define JSC_CONST_HASHTABLE as const for !WINSCW. 17926 * create_hash_table: Use JSC_CONST_HASHTABLE for hashtables. 17927 * runtime/JSGlobalData.cpp: Import various global hashtables via the macro. 17928 179292009-07-04 Dan Bernstein <mitz@apple.com> 17930 17931 - debug build fix 17932 17933 * runtime/RegExpConstructor.cpp: 17934 (JSC::RegExpConstructor::getLastParen): 17935 179362009-07-03 Yong Li <yong.li@torchmobile.com> 17937 17938 Reviewed by Maciej Stachowiak (and revised slightly) 17939 17940 RegExp::match to be optimized 17941 https://bugs.webkit.org/show_bug.cgi?id=26957 17942 17943 Allow regexp matching to use Vectors with inline capacity instead of 17944 allocating a new ovector buffer every time. 17945 17946 ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall. 17947 17948 * runtime/RegExp.cpp: 17949 (JSC::RegExp::match): 17950 * runtime/RegExp.h: 17951 * runtime/RegExpConstructor.cpp: 17952 (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate): 17953 (JSC::RegExpConstructorPrivate::lastOvector): 17954 (JSC::RegExpConstructorPrivate::tempOvector): 17955 (JSC::RegExpConstructorPrivate::changeLastOvector): 17956 (JSC::RegExpConstructor::performMatch): 17957 (JSC::RegExpMatchesArray::RegExpMatchesArray): 17958 (JSC::RegExpMatchesArray::fillArrayInstance): 17959 (JSC::RegExpConstructor::getBackref): 17960 (JSC::RegExpConstructor::getLastParen): 17961 (JSC::RegExpConstructor::getLeftContext): 17962 (JSC::RegExpConstructor::getRightContext): 17963 * runtime/StringPrototype.cpp: 17964 (JSC::stringProtoFuncSplit): 17965 179662009-06-30 Kwang Yul Seo <skyul@company100.net> 17967 17968 Reviewed by Eric Seidel. 17969 17970 Override operator new/delete with const std::nothrow_t& as the second 17971 argument. 17972 https://bugs.webkit.org/show_bug.cgi?id=26792 17973 17974 On Windows CE, operator new/delete, new[]/delete[] with const 17975 std::nothrow_t& must be overrided because some standard template 17976 libraries use these operators. 17977 17978 The problem occurs when memory allocated by new(size_t s, const 17979 std::nothrow_t&) is freed by delete(void* p). This causes the umatched 17980 malloc/free problem. 17981 17982 The patch overrides all new, delete, new[] and delete[] to use 17983 fastMaloc and fastFree consistently. 17984 17985 * wtf/FastMalloc.h: 17986 (throw): 17987 179882009-06-30 Gabor Loki <loki@inf.u-szeged.hu> 17989 17990 Reviewed by Sam Weinig. 17991 17992 <https://bugs.webkit.org/show_bug.cgi?id=24986> 17993 17994 Remove unnecessary references to AssemblerBuffer. 17995 17996 * interpreter/Interpreter.cpp: 17997 * interpreter/Interpreter.h: 17998 179992009-06-29 David Levin <levin@chromium.org> 18000 18001 Reviewed by Oliver Hunt. 18002 18003 Still seeing occasional leaks from UString::sharedBuffer code 18004 https://bugs.webkit.org/show_bug.cgi?id=26420 18005 18006 The problem is that the pointer to the memory allocation isn't visible 18007 by "leaks" due to the lower bits being used as flags. The fix is to 18008 make the pointer visible in memory (in debug only). The downside of 18009 this fix that the memory allocated by sharedBuffer will still look like 18010 a leak in non-debug builds when any flags are set. 18011 18012 * wtf/PtrAndFlags.h: 18013 (WTF::PtrAndFlags::set): 18014 180152009-06-29 Sam Weinig <sam@webkit.org> 18016 18017 Reviewed by Mark Rowe. 18018 18019 Remove more unused scons support. 18020 18021 * SConstruct: Removed. 18022 180232009-06-29 Oliver Hunt <oliver@apple.com> 18024 18025 Reviewed by Gavin Barraclough. 18026 18027 <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters 18028 <https://bugs.webkit.org/show_bug.cgi?id=26802> 18029 18030 In the original JSON.parse patch unicode was handled correctly, however in some last 18031 minute "clean up" I oversimplified isSafeStringCharacter. This patch corrects this bug. 18032 18033 * runtime/LiteralParser.cpp: 18034 (JSC::isSafeStringCharacter): 18035 (JSC::LiteralParser::Lexer::lexString): 18036 180372009-06-26 Oliver Hunt <oliver@apple.com> 18038 18039 Reviewed by Dan Bernstein. 18040 18041 <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746) 18042 <https://bugs.webkit.org/show_bug.cgi?id=26746> 18043 18044 Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id. Clearly this 18045 is less than correct. This patch corrects that error. 18046 18047 * interpreter/Interpreter.cpp: 18048 (JSC::Interpreter::tryCacheGetByID): 18049 180502009-06-26 Eric Seidel <eric@webkit.org> 18051 18052 No review, only rolling out r45259. 18053 18054 Roll out r45259 after crash appeared on the bots: 18055 plugins/undefined-property-crash.html 18056 ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize 18057 (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278 18058 void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap]) 18059 18060 * runtime/DateInstance.cpp: 18061 * runtime/Identifier.cpp: 18062 * runtime/Lookup.h: 18063 * runtime/RegExpConstructor.cpp: 18064 * runtime/RegExpObject.h: 18065 * runtime/ScopeChain.h: 18066 * runtime/UString.h: 18067 180682009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 18069 18070 Reviewed by Simon Hausmann. 18071 18072 Add support for QDataStream operators to Vector. 18073 18074 * wtf/Vector.h: 18075 (WTF::operator<<): 18076 (WTF::operator>>): 18077 180782009-06-24 Sam Weinig <sam@webkit.org> 18079 18080 Reviewed by Gavin Barraclough. 18081 18082 Make the opcode sampler work once again. 18083 18084 * jit/JIT.h: 18085 (JSC::JIT::compileGetByIdProto): 18086 (JSC::JIT::compileGetByIdSelfList): 18087 (JSC::JIT::compileGetByIdProtoList): 18088 (JSC::JIT::compileGetByIdChainList): 18089 (JSC::JIT::compileGetByIdChain): 18090 (JSC::JIT::compilePutByIdTransition): 18091 (JSC::JIT::compileCTIMachineTrampolines): 18092 (JSC::JIT::compilePatchGetArrayLength): 18093 * jit/JITStubCall.h: 18094 (JSC::JITStubCall::call): 18095 180962009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18097 18098 Reviewed by Maciej Stachowiak. 18099 18100 Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid 18101 unnecessary WTF:: usings. 18102 Remove existing unnecessary WTF:: usings. 18103 18104 * interpreter/Interpreter.h: 18105 * profiler/CallIdentifier.h: 18106 * runtime/ScopeChain.h: 18107 * wtf/FastAllocBase.h: 18108 181092009-06-24 David Levin <levin@chromium.org> 18110 18111 Fix all builds. 18112 18113 * bytecode/CodeBlock.h: 18114 * bytecompiler/BytecodeGenerator.h: 18115 * interpreter/Register.h: 18116 181172009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18118 18119 Reviewed by Maciej Stachowiak. 18120 18121 https://bugs.webkit.org/show_bug.cgi?id=26677 18122 18123 Inherits CodeBlock class from FastAllocBase because it 18124 has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217. 18125 18126 * bytecode/CodeBlock.h: 18127 181282009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18129 18130 Reviewed by Maciej Stachowiak. 18131 18132 https://bugs.webkit.org/show_bug.cgi?id=26676 18133 18134 Inherits BytecodeGenerator class from FastAllocBase because it has been 18135 instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892. 18136 18137 * bytecompiler/BytecodeGenerator.h: 18138 181392009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18140 18141 Reviewed by Maciej Stachowiak. 18142 18143 https://bugs.webkit.org/show_bug.cgi?id=26675 18144 18145 Inherits Register class from FastAllocBase because it has been 18146 instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149. 18147 18148 * interpreter/Register.h: 18149 181502009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18151 18152 Reviewed by Darin Adler. 18153 18154 https://bugs.webkit.org/show_bug.cgi?id=26674 18155 18156 Inherits HashMap class from FastAllocBase because it has been 18157 instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458. 18158 18159 * wtf/HashMap.h: 18160 181612009-06-24 Oliver Hunt <oliver@apple.com> 18162 18163 Reviewed by Darin Adler. 18164 18165 <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research' 18166 18167 The problem was caused by the page returned with a function using a 18168 var declaration list containing around ~3000 variables. The solution 18169 to this is to flatten the comma expression representation and make 18170 codegen comma expressions and initializer lists iterative rather than 18171 recursive. 18172 18173 * parser/Grammar.y: 18174 * parser/NodeConstructors.h: 18175 (JSC::CommaNode::CommaNode): 18176 * parser/Nodes.cpp: 18177 (JSC::CommaNode::emitBytecode): 18178 * parser/Nodes.h: 18179 (JSC::ExpressionNode::isCommaNode): 18180 (JSC::CommaNode::isCommaNode): 18181 (JSC::CommaNode::append): 18182 181832009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18184 18185 Reviewed by Maciej Stachowiak. 18186 18187 https://bugs.webkit.org/show_bug.cgi?id=26645 18188 18189 Inherits ScopeChainNode class from FastAllocBase because it has been 18190 instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95. 18191 18192 * wtf/RefPtr.h: 18193 181942009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18195 18196 Reviewed by Darin Adler. 18197 18198 https://bugs.webkit.org/show_bug.cgi?id=26648 18199 18200 Inherits Deque class from FastAllocBase because it has been 18201 instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 18202 JavaScriptCore/wtf/MainThread.cpp:62. 18203 18204 * wtf/Deque.h: 18205 182062009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18207 18208 Reviewed by Darin Adler. 18209 18210 https://bugs.webkit.org/show_bug.cgi?id=26644 18211 18212 Inherits RefPtr class from FastAllocBase because it has been 18213 instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41. 18214 18215 * wtf/RefPtr.h: 18216 182172009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18218 18219 Reviewed by Darin Adler. 18220 18221 Inherits HashSet class from FastAllocBase, because it has been 18222 instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116. 18223 18224 * wtf/HashSet.h: 18225 182262009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18227 18228 Reviewed by Darin Adler. 18229 18230 Inherits Vector class from FastAllocBase because it has been 18231 instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633. 18232 18233 * wtf/Vector.h: 18234 182352009-06-24 Norbert Leser <norbert.leser@nokia.com> 18236 18237 Reviewed by Maciej Stachoviak. 18238 18239 The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance 18240 (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.). 18241 Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode), 18242 the stack overflows immediately on Symbian hardware (max. 80 kB). 18243 Proposed change allocates generator objects on heap. 18244 Performance impact (if any) should be negligible and change is proposed as general fix, 18245 rather than ifdef'd for SYMBIAN. 18246 18247 * parser/Nodes.cpp: 18248 (JSC::ProgramNode::generateBytecode): 18249 (JSC::EvalNode::generateBytecode): 18250 (JSC::EvalNode::bytecodeForExceptionInfoReparse): 18251 (JSC::FunctionBodyNode::generateBytecode): 18252 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): 18253 182542009-06-23 Oliver Hunt <oliver@apple.com> 18255 18256 Reviewed by Gavin Barraclough. 18257 18258 <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593) 18259 <https://bugs.webkit.org/show_bug.cgi?id=26593> 18260 18261 Do not attempt to cache structure chains if they contain a dictionary at any level. 18262 18263 * interpreter/Interpreter.cpp: 18264 (JSC::Interpreter::tryCachePutByID): 18265 (JSC::Interpreter::tryCacheGetByID): 18266 * jit/JITStubs.cpp: 18267 (JSC::JITThunks::tryCachePutByID): 18268 * runtime/Structure.cpp: 18269 (JSC::Structure::getEnumerablePropertyNames): 18270 (JSC::Structure::addPropertyTransition): 18271 * runtime/StructureChain.cpp: 18272 (JSC::StructureChain::isCacheable): 18273 * runtime/StructureChain.h: 18274 182752009-06-23 Yong Li <yong.li@torchmobile.com> 18276 18277 Reviewed by George Staikos. 18278 18279 https://bugs.webkit.org/show_bug.cgi?id=26654 18280 Add the proper export define for the JavaScriptCore API when building for WINCE. 18281 18282 * API/JSBase.h: 18283 182842009-06-23 Joe Mason <joe.mason@torchmobile.com> 18285 18286 Reviewed by Adam Treat. 18287 18288 Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com> 18289 18290 https://bugs.webkit.org/show_bug.cgi?id=26611 18291 Implement currentThreadStackBase on WINCE by adding a global, 18292 g_stackBase, which must be set to the address of a local variable 18293 by the caller before calling any WebKit function that invokes JSC. 18294 18295 * runtime/Collector.cpp: 18296 (JSC::isPageWritable): 18297 (JSC::getStackBase): 18298 Starts at the top of the stack and returns the entire range of 18299 consecutive writable pages as an estimate of the actual stack. 18300 This will be much bigger than the actual stack range, so some 18301 dead objects can't be collected, but it guarantees live objects 18302 aren't collected prematurely. 18303 18304 (JSC::currentThreadStackBase): 18305 On WinCE, returns g_stackBase if set or call getStackBase as a 18306 fallback if not. 18307 183082009-06-23 Oliver Hunt <oliver@apple.com> 18309 18310 Reviewed by Alexey Proskuryakov. 18311 18312 Fix stupid performance problem in the LiteralParser 18313 18314 The LiteralParser was making a new UString in order to use 18315 toDouble, however UString's toDouble allows a much wider range 18316 of numberic strings than the LiteralParser accepts, and requires 18317 an additional heap allocation or two for the construciton of the 18318 UString. To rectify this we just call WTF::dtoa directly using 18319 a stack allocated buffer to hold the validated numeric literal. 18320 18321 * runtime/LiteralParser.cpp: 18322 (JSC::LiteralParser::Lexer::lexNumber): 18323 (JSC::LiteralParser::parse): 18324 * runtime/LiteralParser.h: 18325 183262009-06-22 Oliver Hunt <oliver@apple.com> 18327 18328 Reviewed by Alexey Proskuryakov. 18329 18330 Bug 26640: JSON.stringify needs to special case Boolean objects 18331 <https://bugs.webkit.org/show_bug.cgi?id=26640> 18332 18333 Add special case handling of the Boolean object so we match current 18334 ES5 errata. 18335 18336 * runtime/JSONObject.cpp: 18337 (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString 18338 (JSC::gap): 18339 (JSC::Stringifier::appendStringifiedValue): 18340 183412009-06-22 Oliver Hunt <oliver@apple.com> 18342 18343 Reviewed by Darin Adler. 18344 18345 Bug 26591: Support revivers in JSON.parse 18346 <https://bugs.webkit.org/show_bug.cgi?id=26591> 18347 18348 Add reviver support to JSON.parse. This completes the JSON object. 18349 18350 * runtime/JSONObject.cpp: 18351 (JSC::Walker::Walker): 18352 (JSC::Walker::callReviver): 18353 (JSC::Walker::walk): 18354 (JSC::JSONProtoFuncParse): 18355 183562009-06-21 Oliver Hunt <oliver@apple.com> 18357 18358 Reviewed by Darin Adler. 18359 18360 Bug 26592: Support standard toJSON functions 18361 <https://bugs.webkit.org/show_bug.cgi?id=26592> 18362 18363 Add support for the standard Date.toJSON function. 18364 18365 * runtime/DatePrototype.cpp: 18366 (JSC::dateProtoFuncToJSON): 18367 183682009-06-21 Oliver Hunt <oliver@apple.com> 18369 18370 Reviewed by Sam Weinig. 18371 18372 Bug 26594: JSC needs to support Date.toISOString 18373 <https://bugs.webkit.org/show_bug.cgi?id=26594> 18374 18375 Add support for Date.toISOString. 18376 18377 * runtime/DatePrototype.cpp: 18378 (JSC::dateProtoFuncToISOString): 18379 183802009-06-21 Oliver Hunt <oliver@apple.com> 18381 18382 Remove dead code. 18383 18384 * runtime/LiteralParser.cpp: 18385 (JSC::LiteralParser::parse): 18386 183872009-06-21 Oliver Hunt <oliver@apple.com> 18388 18389 Reviewed by Darin Adler and Cameron Zwarich. 18390 18391 Bug 26587: Support JSON.parse 18392 <https://bugs.webkit.org/show_bug.cgi?id=26587> 18393 18394 Extend the LiteralParser to support the full strict JSON 18395 grammar, fix a few places where the grammar was incorrectly 18396 lenient. Doesn't yet support the JSON.parse reviver function 18397 but that does not block the JSON.parse functionality itself. 18398 18399 * interpreter/Interpreter.cpp: 18400 (JSC::Interpreter::callEval): 18401 * runtime/JSGlobalObjectFunctions.cpp: 18402 (JSC::globalFuncEval): 18403 * runtime/JSONObject.cpp: 18404 (JSC::JSONProtoFuncParse): 18405 * runtime/LiteralParser.cpp: 18406 (JSC::LiteralParser::Lexer::lex): 18407 (JSC::isSafeStringCharacter): 18408 (JSC::LiteralParser::Lexer::lexString): 18409 (JSC::LiteralParser::parse): 18410 * runtime/LiteralParser.h: 18411 (JSC::LiteralParser::LiteralParser): 18412 (JSC::LiteralParser::tryJSONParse): 18413 (JSC::LiteralParser::): 18414 (JSC::LiteralParser::Lexer::Lexer): 18415 184162009-06-21 David Levin <levin@chromium.org> 18417 18418 Reviewed by NOBODY (speculative build fix for windows). 18419 18420 Simply removed some whitespace form this file to make windows build wtf and 18421 hopefully copy the new MessageQueque.h so that WebCore picks it up. 18422 18423 * wtf/Assertions.cpp: 18424 184252009-06-21 Drew Wilson <atwilson@google.com> 18426 18427 Reviewed by David Levin. 18428 18429 <https://bugs.webkit.org/show_bug.cgi?id=25043> 18430 Added support for multi-threaded MessagePorts. 18431 18432 * wtf/MessageQueue.h: 18433 (WTF::::appendAndCheckEmpty): 18434 Added API to test whether the queue was empty before adding an element. 18435 184362009-06-20 David D. Kilzer <ddkilzer@webkit.org> 18437 18438 Fix namespace comment in SegmentedVector.h 18439 18440 * wtf/SegmentedVector.h: Updated namespace comment to reflect 18441 new namespace after r44897. 18442 184432009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 18444 18445 Bug 24986: ARM JIT port 18446 <https://bugs.webkit.org/show_bug.cgi?id=24986> 18447 18448 Reviewed by Oliver Hunt. 18449 18450 An Iterator added for SegmentedVector. Currently 18451 only the pre ++ operator is supported. 18452 18453 * wtf/SegmentedVector.h: 18454 (WTF::SegmentedVectorIterator::~SegmentedVectorIterator): 18455 (WTF::SegmentedVectorIterator::operator*): 18456 (WTF::SegmentedVectorIterator::operator->): 18457 (WTF::SegmentedVectorIterator::operator++): 18458 (WTF::SegmentedVectorIterator::operator==): 18459 (WTF::SegmentedVectorIterator::operator!=): 18460 (WTF::SegmentedVectorIterator::operator=): 18461 (WTF::SegmentedVectorIterator::SegmentedVectorIterator): 18462 (WTF::SegmentedVector::alloc): 18463 (WTF::SegmentedVector::begin): 18464 (WTF::SegmentedVector::end): 18465 184662009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 18467 18468 Bug 24986: ARM JIT port 18469 <https://bugs.webkit.org/show_bug.cgi?id=24986> 18470 18471 Reviewed by Oliver Hunt. 18472 18473 Move SegmentedVector to /wtf subdirectory 18474 and change "namespace JSC" to "namespace WTF" 18475 18476 Additional build file updates by David Kilzer. 18477 18478 * GNUmakefile.am: Updated path to SegmentedVector.h. 18479 * JavaScriptCore.order: Updated SegmentedVector namespace from 18480 JSC to WTF in mangled C++ method name. 18481 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 18482 Removed reference to bytecompiler\SegmentedVector.h. 18483 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to 18484 wtf\SegmentedVector.h. 18485 * JavaScriptCore.xcodeproj/project.pbxproj: Moved 18486 SegmentedVector.h definition from bytecompiler subdirectory to 18487 wtf subdirectory. 18488 * bytecompiler/BytecodeGenerator.h: Updated #include path to 18489 SegmentedVector.h and prepended WTF:: namespace to its use. 18490 * parser/Lexer.h: Ditto. 18491 * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h. 18492 (WTF::SegmentedVector::SegmentedVector): 18493 (WTF::SegmentedVector::~SegmentedVector): 18494 (WTF::SegmentedVector::size): 18495 (WTF::SegmentedVector::at): 18496 (WTF::SegmentedVector::operator[]): 18497 (WTF::SegmentedVector::last): 18498 (WTF::SegmentedVector::append): 18499 (WTF::SegmentedVector::removeLast): 18500 (WTF::SegmentedVector::grow): 18501 (WTF::SegmentedVector::clear): 18502 (WTF::SegmentedVector::deleteAllSegments): 18503 (WTF::SegmentedVector::segmentExistsFor): 18504 (WTF::SegmentedVector::segmentFor): 18505 (WTF::SegmentedVector::subscriptFor): 18506 (WTF::SegmentedVector::ensureSegmentsFor): 18507 (WTF::SegmentedVector::ensureSegment): 18508 185092009-06-19 Gavin Barraclough <barraclough@apple.com> 18510 18511 Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h). 18512 18513 * jit/JIT.cpp: 18514 (JSC::JIT::privateCompile): 18515 (JSC::JIT::privateCompileCTIMachineTrampolines): 18516 (JSC::JIT::emitGetVariableObjectRegister): 18517 (JSC::JIT::emitPutVariableObjectRegister): 18518 * jit/JIT.h: 18519 * jit/JITArithmetic.cpp: 18520 (JSC::JIT::emit_op_rshift): 18521 (JSC::JIT::emitSlow_op_jnless): 18522 (JSC::JIT::emitSlow_op_jnlesseq): 18523 (JSC::JIT::compileBinaryArithOp): 18524 * jit/JITCall.cpp: 18525 (JSC::JIT::compileOpCallInitializeCallFrame): 18526 (JSC::JIT::compileOpCall): 18527 * jit/JITInlineMethods.h: 18528 (JSC::JIT::restoreArgumentReference): 18529 (JSC::JIT::checkStructure): 18530 * jit/JITOpcodes.cpp: 18531 (JSC::JIT::emit_op_instanceof): 18532 (JSC::JIT::emit_op_get_scoped_var): 18533 (JSC::JIT::emit_op_put_scoped_var): 18534 (JSC::JIT::emit_op_construct_verify): 18535 (JSC::JIT::emit_op_resolve_global): 18536 (JSC::JIT::emit_op_jeq_null): 18537 (JSC::JIT::emit_op_jneq_null): 18538 (JSC::JIT::emit_op_to_jsnumber): 18539 (JSC::JIT::emit_op_catch): 18540 (JSC::JIT::emit_op_eq_null): 18541 (JSC::JIT::emit_op_neq_null): 18542 (JSC::JIT::emit_op_convert_this): 18543 (JSC::JIT::emit_op_profile_will_call): 18544 (JSC::JIT::emit_op_profile_did_call): 18545 (JSC::JIT::emitSlow_op_get_by_val): 18546 * jit/JITPropertyAccess.cpp: 18547 (JSC::JIT::emit_op_get_by_val): 18548 (JSC::JIT::emit_op_put_by_val): 18549 (JSC::JIT::emit_op_method_check): 18550 (JSC::JIT::compileGetByIdHotPath): 18551 (JSC::JIT::emit_op_put_by_id): 18552 (JSC::JIT::compilePutDirectOffset): 18553 (JSC::JIT::compileGetDirectOffset): 18554 (JSC::JIT::privateCompilePutByIdTransition): 18555 (JSC::JIT::privateCompilePatchGetArrayLength): 18556 * jit/JITStubs.cpp: 18557 (JSC::JITThunks::JITThunks): 18558 185592009-06-19 Gavin Barraclough <barraclough@apple.com> 18560 18561 Reviewed by NOBODY (Windows build fix). 18562 18563 * jit/JIT.h: 18564 * jit/JITInlineMethods.h: 18565 185662009-06-19 Gabor Loki <loki@inf.u-szeged.hu> 18567 18568 Reviewed by Gavin Barraclough. 18569 18570 Reorganize ARM architecture specific macros. 18571 Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7). 18572 18573 Bug 24986: ARM JIT port 18574 <https://bugs.webkit.org/show_bug.cgi?id=24986> 18575 18576 * assembler/ARMv7Assembler.h: 18577 * assembler/AbstractMacroAssembler.h: 18578 (JSC::AbstractMacroAssembler::Imm32::Imm32): 18579 * assembler/MacroAssembler.h: 18580 * assembler/MacroAssemblerCodeRef.h: 18581 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): 18582 * jit/ExecutableAllocator.h: 18583 (JSC::ExecutableAllocator::cacheFlush): 18584 * jit/JIT.h: 18585 * jit/JITInlineMethods.h: 18586 (JSC::JIT::restoreArgumentReferenceForTrampoline): 18587 * jit/JITStubs.cpp: 18588 * jit/JITStubs.h: 18589 * wtf/Platform.h: 18590 * yarr/RegexJIT.cpp: 18591 (JSC::Yarr::RegexGenerator::generateEnter): 18592 (JSC::Yarr::RegexGenerator::generateReturn): 18593 185942009-06-19 Gavin Barraclough <barraclough@apple.com> 18595 18596 Reviewed by Oliver Hunt. 18597 18598 Fix armv7 JIT build issues. 18599 18600 Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types), 18601 and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros. 18602 18603 * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects). 18604 * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor. 18605 18606 * jit/JIT.cpp: 18607 * jit/JIT.h: 18608 * jit/JITInlineMethods.h: 18609 (JSC::JIT::restoreArgumentReference): 18610 * jit/JITOpcodes.cpp: 18611 (JSC::JIT::emit_op_catch): 18612 * jit/JITStubs.cpp: 18613 (JSC::JITThunks::JITThunks): 18614 186152009-06-19 Adam Treat <adam.treat@torchmobile.com> 18616 18617 Blind attempt at build fix. 18618 18619 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 18620 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 18621 186222009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18623 18624 Reviewed by Oliver Hunt. 18625 18626 Inherits CallIdentifier struct from FastAllocBase because it has been 18627 instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86. 18628 18629 * wtf/HashCountedSet.h: 18630 186312009-06-19 Adam Treat <adam.treat@torchmobile.com> 18632 18633 Reviewed by Oliver Hunt. 18634 18635 https://bugs.webkit.org/show_bug.cgi?id=26540 18636 Modify the test shell to add a new function 'checkSyntax' that will 18637 only parse the source instead of executing it. In this way we can test 18638 pure parsing performance against some of the larger scripts in the wild. 18639 18640 * jsc.cpp: 18641 (GlobalObject::GlobalObject): 18642 (functionCheckSyntax): 18643 186442009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu> 18645 18646 Reviewed by Darin Adler. 18647 18648 Inherits HashCountedSet class from FastAllocBase because it has been 18649 instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095. 18650 18651 * wtf/HashCountedSet.h: 18652 186532009-06-19 Yong Li <yong.li@torchmobile.com> 18654 18655 Reviewed by George Staikos. 18656 18657 https://bugs.webkit.org/show_bug.cgi?id=26558 18658 Declare these symbols extern for WINCE as they are provided by libce. 18659 18660 * runtime/DateConstructor.cpp: 18661 * runtime/DatePrototype.cpp: 18662 (JSC::formatLocaleDate): 18663 186642009-06-19 Oliver Hunt <oliver@apple.com> 18665 18666 Reviewed by Maciej Stachowiak. 18667 18668 <rdar://problem/6988973> ScopeChain leak in interpreter builds 18669 18670 Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT) 18671 path. 18672 18673 * runtime/JSFunction.cpp: 18674 (JSC::JSFunction::~JSFunction): 18675 * wtf/Platform.h: 18676 186772009-06-19 Yong Li <yong.li@torchmobile.com> 18678 18679 Reviewed by George Staikos. 18680 18681 https://bugs.webkit.org/show_bug.cgi?id=26543 18682 Windows CE uses 'GetLastError' instead of 'errno.' 18683 18684 * interpreter/RegisterFile.h: 18685 (JSC::RegisterFile::RegisterFile): 18686 (JSC::RegisterFile::grow): 18687 186882009-06-19 David Levin <levin@chromium.org> 18689 18690 Reviewed by NOBODY (Windows build fix). 18691 18692 Add export for Windows corresponding to OSX export done in r44844. 18693 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 18694 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: 18695 186962009-06-18 Oliver Hunt <oliver@apple.com> 18697 18698 Reviewed by Gavin "Viceroy of Venezuela" Barraclough. 18699 18700 Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected 18701 <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385> 18702 18703 We need to make sure that each native function instance correctly unlinks any references to it 18704 when it is collected. Allowing this to happen required a few changes: 18705 * Every native function needs a codeblock to track the link information 18706 * To have this codeblock, every function now also needs its own functionbodynode 18707 so we no longer get to have a single shared instance. 18708 * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode 18709 18710 * JavaScriptCore.exp: 18711 * bytecode/CodeBlock.cpp: 18712 (JSC::CodeBlock::CodeBlock): 18713 Constructor for NativeCode CodeBlock 18714 (JSC::CodeBlock::derefStructures): 18715 (JSC::CodeBlock::refStructures): 18716 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): 18717 (JSC::CodeBlock::handlerForBytecodeOffset): 18718 (JSC::CodeBlock::lineNumberForBytecodeOffset): 18719 (JSC::CodeBlock::expressionRangeForBytecodeOffset): 18720 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): 18721 (JSC::CodeBlock::functionRegisterForBytecodeOffset): 18722 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset): 18723 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset): 18724 (JSC::CodeBlock::setJITCode): 18725 Add assertions to ensure we don't try and use NativeCode CodeBlocks as 18726 a normal codeblock. 18727 18728 * bytecode/CodeBlock.h: 18729 (JSC::): 18730 (JSC::CodeBlock::source): 18731 (JSC::CodeBlock::sourceOffset): 18732 (JSC::CodeBlock::evalCodeCache): 18733 (JSC::CodeBlock::createRareDataIfNecessary): 18734 More assertions. 18735 18736 * jit/JIT.cpp: 18737 (JSC::JIT::privateCompileCTIMachineTrampolines): 18738 (JSC::JIT::linkCall): 18739 Update logic to allow native function caching 18740 18741 * jit/JITStubs.cpp: 18742 * parser/Nodes.cpp: 18743 (JSC::FunctionBodyNode::createNativeThunk): 18744 (JSC::FunctionBodyNode::isHostFunction): 18745 * parser/Nodes.h: 18746 * runtime/JSFunction.cpp: 18747 (JSC::JSFunction::JSFunction): 18748 (JSC::JSFunction::~JSFunction): 18749 (JSC::JSFunction::mark): 18750 * runtime/JSGlobalData.cpp: 18751 (JSC::JSGlobalData::~JSGlobalData): 18752 * runtime/JSGlobalData.h: 18753 187542009-06-18 Gavin Barraclough <barraclough@apple.com> 18755 18756 Reviewed by NOBODY (Windows build fix). 18757 18758 * wtf/DateMath.cpp: 18759 (WTF::calculateUTCOffset): 18760 187612009-06-18 Gavin Barraclough <barraclough@apple.com> 18762 18763 Reviewed by Geoff Garen. 18764 18765 Timezone calculation incorrect in Venezuela. 18766 18767 https://bugs.webkit.org/show_bug.cgi?id=26531 18768 <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3 18769 18770 The problem is that we're calculating the timezone relative to 01/01/2000, 18771 but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007. 18772 According to the spec, section 15.9.1.9 states "the time since the beginning 18773 of the year", presumably meaning the *current* year. Change the calculation 18774 to be based on whatever the current year is, rather than a canned date. 18775 18776 No performance impact. 18777 18778 * wtf/DateMath.cpp: 18779 (WTF::calculateUTCOffset): 18780 187812009-06-18 Gavin Barraclough <barraclough@apple.com> 18782 18783 Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig). 18784 18785 (Reintroducing patch added in r44492, and reverted in r44796.) 18786 18787 Change the implementation of op_throw so the stub function always modifies its 18788 return address - if it doesn't find a 'catch' it will switch to a trampoline 18789 to force a return from JIT execution. This saves memory, by avoiding the need 18790 for a unique return for every op_throw. 18791 18792 * jit/JITOpcodes.cpp: 18793 (JSC::JIT::emit_op_throw): 18794 JITStubs::cti_op_throw now always changes its return address, 18795 remove return code generated after the stub call (this is now 18796 handled by ctiOpThrowNotCaught). 18797 * jit/JITStubs.cpp: 18798 (JSC::): 18799 Add ctiOpThrowNotCaught definitions. 18800 (JSC::JITStubs::DEFINE_STUB_FUNCTION): 18801 Change cti_op_throw to always change its return address. 18802 * jit/JITStubs.h: 18803 Add ctiOpThrowNotCaught declaration. 18804 188052009-06-18 Kevin McCullough <kmccullough@apple.com> 18806 18807 Reviewed by Oliver Hunt. 18808 18809 <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit 18810 18811 - Exposed functions now needed by WebCore. 18812 18813 * JavaScriptCore.exp: 18814 188152009-06-17 Darin Adler <darin@apple.com> 18816 18817 Reviewed by Oliver Hunt. 18818 18819 Bug 26429: Make JSON.stringify non-recursive so it can handle objects 18820 of arbitrary complexity 18821 https://bugs.webkit.org/show_bug.cgi?id=26429 18822 18823 For marking I decided not to use gcProtect, because this is inside the engine 18824 so it's easy enough to just do marking. And that darned gcProtect does locking! 18825 Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor 18826 for that class says "FIXME: Remove all clients of this API, then remove this API." 18827 18828 * runtime/Collector.cpp: 18829 (JSC::Heap::collect): Add a call to JSONObject::markStringifiers. 18830 18831 * runtime/CommonIdentifiers.cpp: 18832 (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier. 18833 * runtime/CommonIdentifiers.h: Ditto. 18834 18835 * runtime/JSGlobalData.cpp: 18836 (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0. 18837 * runtime/JSGlobalData.h: Added firstStringifierToMark. 18838 18839 * runtime/JSONObject.cpp: Cut down the includes to the needed ones only. 18840 (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string 18841 objects to get their number and string values. 18842 (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used 18843 to wrap an identifier or integer so we don't have to do any work unless we 18844 actually call a replacer. 18845 (JSC::ReplacerPropertyName::value): Added. 18846 (JSC::gap): Added. Helper function for the Stringifier constructor. 18847 (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added. 18848 The class is used to wrap an identifier or integer so we don't have to 18849 allocate a number or string until we actually call toJSON or a replacer. 18850 (JSC::PropertyNameForFunctionCall::asJSValue): Added. 18851 (JSC::Stringifier::Stringifier): Updated and moved out of the class 18852 definition. Added code to hook this into a singly linked list for marking. 18853 (JSC::Stringifier::~Stringifier): Remove from the singly linked list. 18854 (JSC::Stringifier::mark): Mark all the objects in the holder stacks. 18855 (JSC::Stringifier::stringify): Updated. 18856 (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit. 18857 (JSC::Stringifier::toJSON): Renamed from toJSONValue. 18858 (JSC::Stringifier::appendStringifiedValue): Renamed from stringify. 18859 Added code to use the m_holderStack to do non-recursive stringify of 18860 objects and arrays. This code also uses the timeout checker since in 18861 pathological cases it could be slow even without calling into the 18862 JavaScript virtual machine. 18863 (JSC::Stringifier::willIndent): Added. 18864 (JSC::Stringifier::indent): Added. 18865 (JSC::Stringifier::unindent): Added. 18866 (JSC::Stringifier::startNewLine): Added. 18867 (JSC::Stringifier::Holder::Holder): Added. 18868 (JSC::Stringifier::Holder::appendNextProperty): Added. This is the 18869 function that handles the format of arrays and objects. 18870 (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom 18871 of the file so the JSONObject class is not interleaved with the 18872 Stringifier class. 18873 (JSC::JSONObject::markStringifiers): Added. Calls mark. 18874 (JSC::JSONProtoFuncStringify): Streamlined the code here. The code 18875 to compute the gap string is now a separate function. 18876 18877 * runtime/JSONObject.h: Made everything private. Added markStringifiers. 18878 188792009-06-17 Oliver Hunt <oliver@apple.com> 18880 18881 Reviewed by Gavin Barraclough. 18882 18883 <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com 18884 18885 Roll out r43849 as it appears that we cannot rely on the address of 18886 an objects property storage being constant even if the structure is 18887 unchanged. 18888 18889 * jit/JIT.h: 18890 * jit/JITPropertyAccess.cpp: 18891 (JSC::JIT::compileGetDirectOffset): 18892 (JSC::JIT::privateCompileGetByIdProto): 18893 (JSC::JIT::privateCompileGetByIdProtoList): 18894 (JSC::JIT::privateCompileGetByIdChainList): 18895 (JSC::JIT::privateCompileGetByIdChain): 18896 188972009-06-17 Gavin Barraclough <barraclough@apple.com> 18898 18899 Rubber Stamped by Mark Rowe. 18900 18901 Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>. 18902 18903 * jit/JITOpcodes.cpp: 18904 (JSC::JIT::emit_op_throw): 18905 * jit/JITStubs.cpp: 18906 (JSC::): 18907 (JSC::JITStubs::DEFINE_STUB_FUNCTION): 18908 * jit/JITStubs.h: 18909 189102009-06-17 Gavin Barraclough <barraclough@apple.com> 18911 18912 Reviewed by Mark Rowe. 18913 18914 <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit 18915 18916 On 64-bit, NaN-encoded values must be detagged before they can be used in rshift. 18917 18918 No performance impact. 18919 18920 * jit/JITArithmetic.cpp: 18921 (JSC::JIT::emit_op_rshift): 18922 189232009-06-17 Adam Treat <adam.treat@torchmobile.com> 18924 18925 Reviewed by George Staikos. 18926 18927 https://bugs.webkit.org/show_bug.cgi?id=23155 18928 Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks. 18929 18930 * jsc.cpp: 18931 (main): 18932 189332009-06-17 George Staikos <george.staikos@torchmobile.com> 18934 18935 Reviewed by Adam Treat. 18936 18937 https://bugs.webkit.org/show_bug.cgi?id=23155 18938 Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks. 18939 18940 * config.h: 18941 * jsc.cpp: 18942 * wtf/Assertions.cpp: 18943 * wtf/Assertions.h: 18944 * wtf/CurrentTime.cpp: 18945 (WTF::lowResUTCTime): 18946 * wtf/DateMath.cpp: 18947 (WTF::getLocalTime): 18948 * wtf/MathExtras.h: 18949 * wtf/Platform.h: 18950 * wtf/StringExtras.h: 18951 * wtf/Threading.h: 18952 * wtf/win/MainThreadWin.cpp: 18953 189542009-06-17 Gavin Barraclough <barraclough@apple.com> 18955 18956 Reviewed by Oliver Hunt. 18957 18958 <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com 18959 18960 Remove PropertySlot::putValue - PropertySlots should only be used for getting, 18961 not putting. Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite, 18962 which is what it really was being used to ask, and remove some other getOwnPropertySlot 18963 & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion. 18964 18965 * runtime/JSGlobalObject.h: 18966 (JSC::JSGlobalObject::hasOwnPropertyForWrite): 18967 * runtime/JSObject.h: 18968 * runtime/JSStaticScopeObject.cpp: 18969 * runtime/JSStaticScopeObject.h: 18970 * runtime/PropertySlot.h: 18971 189722009-06-16 Gavin Barraclough <barraclough@apple.com> 18973 18974 Reviewed by Oliver hunt. 18975 18976 Temporarily partially disable r44492, since this is causing some problems on internal builds. 18977 18978 * jit/JITOpcodes.cpp: 18979 (JSC::JIT::emit_op_throw): 18980 * jit/JITStubs.cpp: 18981 (JSC::JITStubs::DEFINE_STUB_FUNCTION): 18982 189832009-06-16 Sam Weinig <sam@webkit.org> 18984 18985 Fix windows build. 18986 18987 * jit/JIT.cpp: 18988 (JSC::JIT::JIT): 18989 189902009-06-16 Sam Weinig <sam@webkit.org> 18991 18992 Reviewed by Oliver Hunt. 18993 18994 Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize 18995 it for each type of stub using the return address to find the correct 18996 offset. 18997 18998 * jit/JIT.cpp: 18999 (JSC::JIT::JIT): 19000 * jit/JIT.h: 19001 (JSC::JIT::compileGetByIdProto): 19002 (JSC::JIT::compileGetByIdSelfList): 19003 (JSC::JIT::compileGetByIdProtoList): 19004 (JSC::JIT::compileGetByIdChainList): 19005 (JSC::JIT::compileGetByIdChain): 19006 (JSC::JIT::compilePutByIdTransition): 19007 (JSC::JIT::compileCTIMachineTrampolines): 19008 (JSC::JIT::compilePatchGetArrayLength): 19009 * jit/JITStubCall.h: 19010 (JSC::JITStubCall::call): 19011 19012== Rolled over to ChangeLog-2009-06-16 == 19013