12009-02-13 Mark Rowe <mrowe@apple.com> 2 3 Merge r40975. 4 5 2009-02-12 Darin Adler <darin@apple.com> 6 7 Reviewed by Oliver Hunt and Alexey Proskuryakov. 8 9 Speed up a couple string functions. 10 11 * runtime/StringPrototype.cpp: 12 (JSC::stringProtoFuncIndexOf): Added a fast path for cases where the second 13 argument is either missing or an integer. 14 (JSC::stringProtoFuncBig): Use jsNontrivialString since the string is guaranteed 15 to be 2 or more characters long. 16 (JSC::stringProtoFuncSmall): Ditto. 17 (JSC::stringProtoFuncBlink): Ditto. 18 (JSC::stringProtoFuncBold): Ditto. 19 (JSC::stringProtoFuncItalics): Ditto. 20 (JSC::stringProtoFuncStrike): Ditto. 21 (JSC::stringProtoFuncSub): Ditto. 22 (JSC::stringProtoFuncSup): Ditto. 23 (JSC::stringProtoFuncFontcolor): Ditto. 24 (JSC::stringProtoFuncFontsize): Make the fast path Sam recently added even faster 25 by avoiding all but the minimum memory allocation. 26 (JSC::stringProtoFuncAnchor): Use jsNontrivialString. 27 (JSC::stringProtoFuncLink): Added a fast path. 28 29 * runtime/UString.cpp: 30 (JSC::UString::find): Added a fast path for single-character search strings. 31 322009-02-13 Mark Rowe <mrowe@apple.com> 33 34 Merge r40945. 35 36 2009-02-12 Sam Weinig <sam@webkit.org> 37 38 Reviewed by Geoffrey Garen. 39 40 Speed up String.prototype.fontsize. 41 42 * runtime/StringPrototype.cpp: 43 (JSC::stringProtoFuncFontsize): Specialize for defined/commonly used values. 44 452009-02-13 Mark Rowe <mrowe@apple.com> 46 47 Merge r41000. 48 49 2009-02-13 Gavin Barraclough <barraclough@apple.com> 50 51 Reviewed by Darin Adler. 52 53 Some data in the instruction stream is potentially uninitialized - fix this. 54 55 Change the OperandTypes constructor so that uninitialized memory in the int 56 is zeroed, and modify the Instruction constructor taking an Opcode so that 57 if !HAVE(COMPUTED_GOTO) (i.e. when Opcode is an enum, and is potentially only 58 a byte) it zeros the Instruction first before writing the opcode. 59 60 * bytecode/Instruction.h: 61 (JSC::Instruction::Instruction): 62 * parser/ResultType.h: 63 (JSC::OperandTypes::OperandTypes): 64 652009-02-13 Mark Rowe <mrowe@apple.com> 66 67 Merge r40995. 68 69 2009-02-13 Geoffrey Garen <ggaren@apple.com> 70 71 Build fix for non_JIT platforms. 72 73 * bytecode/CodeBlock.h: 74 (JSC::CodeBlock::setIsNumericCompareFunction): 75 (JSC::CodeBlock::isNumericCompareFunction): 76 772009-02-13 Mark Rowe <mrowe@apple.com> 78 79 Merge r40993. 80 81 2009-02-13 Geoffrey Garen <ggaren@apple.com> 82 83 Reviewed by Darin Adler. 84 85 Fixed <rdar://problem/6584057> Optimize sort by JS numeric comparison 86 function not to run the comparison function 87 88 * bytecode/CodeBlock.cpp: 89 (JSC::CodeBlock::CodeBlock): 90 * bytecode/CodeBlock.h: 91 (JSC::CodeBlock::setIsNumericCompareFunction): 92 (JSC::CodeBlock::isNumericCompareFunction): Added the ability to track 93 whether a CodeBlock performs a sort-like numeric comparison. 94 95 * bytecompiler/BytecodeGenerator.cpp: 96 (JSC::BytecodeGenerator::generate): Set the isNumericCompareFunction bit 97 after compiling. 98 99 * parser/Nodes.cpp: 100 (JSC::FunctionBodyNode::emitBytecode): Fixed a bug that caused us to 101 codegen an extra return at the end of all functions (eek!), since this 102 made it harder / weirder to detect the numeric comparison pattern in 103 bytecode. 104 105 * runtime/ArrayPrototype.cpp: 106 (JSC::arrayProtoFuncSort): Use the isNumericCompareFunction bit to do 107 a faster sort if we can. 108 109 * runtime/FunctionConstructor.cpp: 110 (JSC::extractFunctionBody): 111 (JSC::constructFunction): 112 * runtime/FunctionConstructor.h: Renamed and exported extractFunctionBody for 113 use in initializing lazyNumericCompareFunction. 114 115 * runtime/JSArray.cpp: 116 (JSC::compareNumbersForQSort): 117 (JSC::compareByStringPairForQSort): 118 (JSC::JSArray::sortNumeric): 119 (JSC::JSArray::sort): 120 * runtime/JSArray.h: Added a fast numeric sort. Renamed ArrayQSortPair 121 to be more specific since we do different kinds of qsort now. 122 123 * runtime/JSGlobalData.cpp: 124 (JSC::JSGlobalData::JSGlobalData): 125 (JSC::JSGlobalData::numericCompareFunction): 126 (JSC::JSGlobalData::ClientData::~ClientData): 127 * runtime/JSGlobalData.h: Added helper data for computing the 128 isNumericCompareFunction bit. 129 1302009-02-13 Mark Rowe <mrowe@apple.com> 131 132 Merge r40968. 133 134 2009-02-13 Oliver Hunt <oliver@apple.com> 135 136 Reviewed by Jon Honeycutt. 137 138 Math.random is really slow on windows. 139 140 Math.random calls WTF::randomNumber which is implemented as 141 the secure rand_s on windows. Unfortunately rand_s is an order 142 of magnitude slower than arc4random. For this reason I've 143 added "weakRandomNumber" for use by JavaScript's Math Object. 144 In the long term we should look at using our own secure PRNG 145 in place of the system, but this will do for now. 146 147 30% win on SunSpider on Windows, resolving most of the remaining 148 disparity vs. Mac. 149 150 * runtime/MathObject.cpp: 151 (JSC::MathObject::MathObject): 152 (JSC::mathProtoFuncRandom): 153 * wtf/RandomNumber.cpp: 154 (WTF::weakRandomNumber): 155 (WTF::randomNumber): 156 * wtf/RandomNumber.h: 157 * wtf/RandomNumberSeed.h: 158 (WTF::initializeWeakRandomNumberGenerator): 159 1602009-02-13 Mark Rowe <mrowe@apple.com> 161 162 Merge r40967. 163 164 2009-02-12 Mark Rowe <mrowe@apple.com> 165 166 Fix the build for other platforms. 167 168 * wtf/RandomNumber.cpp: 169 (WTF::randomNumber): 170 1712009-02-13 Mark Rowe <mrowe@apple.com> 172 173 Merge r40937. 174 175 2009-02-12 Geoffrey Garen <ggaren@apple.com> 176 177 Reviewed by Sam Weinig. 178 179 Correctness fix. 180 181 * wtf/RandomNumber.cpp: 182 (WTF::randomNumber): Divide by the maximum representable value, which 183 is different on each platform now, to get values between 0 and 1. 184 1852009-02-13 Mark Rowe <mrowe@apple.com> 186 187 Merge r40935. 188 189 2009-02-12 Geoffrey Garen <ggaren@apple.com> 190 191 Build fix. 192 193 * wtf/RandomNumber.cpp: 194 (WTF::randomNumber): 195 1962009-02-13 Mark Rowe <mrowe@apple.com> 197 198 Merge r40932. 199 200 2009-02-12 Geoffrey Garen <ggaren@apple.com> 201 202 Reviewed by Sam Weinig. 203 204 Fixed <rdar://problem/6582048>. 205 206 * wtf/RandomNumber.cpp: 207 (WTF::randomNumber): Make only one call to the random number generator 208 on platforms where the generator is cryptographically secure. The value 209 of randomness over and above cryptographically secure randomness is not 210 clear, and it caused some performance problems. 211 2122009-02-03 Mark Rowe <mrowe@apple.com> 213 214 Merge r40522. 215 216 2009-02-02 Oliver Hunt <oliver@apple.com> 217 218 Reviewed by Gavin Barraclough. 219 220 <https://bugs.webkit.org/show_bug.cgi?id=21414> REGRESSION: Regular Expressions and character classes, shorthands and ranges 221 <rdar://problem/6543487> 222 223 In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes 224 itself recursively, it will incorrectly emit (and thus consume) the next single character 225 match in the current character class. As WREC uses a binary search this out of sequence 226 codegen could result in a character match being missed and so cause the regex to produce 227 incorrect results. 228 229 * wrec/WRECGenerator.cpp: 230 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 231 2322009-02-03 Mark Rowe <mrowe@apple.com> 233 234 Merge r40397. 235 236 2009-01-29 Stephanie Lewis <slewis@apple.com> 237 238 RS by Oliver Hunt. 239 240 Update the order files. 241 242 * JavaScriptCore.order: 243 2442009-02-03 Mark Rowe <mrowe@apple.com> 245 246 Merge r40396. 247 248 2009-01-29 Cameron Zwarich <cwzwarich@uwaterloo.ca> 249 250 Reviewed by Oliver Hunt. 251 252 Bug 23551: Crash on page load with profiler enabled and running 253 <https://bugs.webkit.org/show_bug.cgi?id=23551> 254 <rdar://problem/6529521> 255 256 Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute() 257 with a stale CallFrame. If some part of the scope chain has already been 258 freed, Profiler::didExecute() will crash when attempting to get the lexical 259 global object. The fix is to make the didExecute() call use the caller's 260 CallFrame, not the one made for the function call. In this case, the 261 willExecute() call should also be changed to match. 262 263 Since this occurs in the actual inspector JS, it is difficult to reduce. 264 I couldn't make a layout test. 265 266 * interpreter/Interpreter.cpp: 267 (JSC::Interpreter::execute): 268 2692009-02-03 Mark Rowe <mrowe@apple.com> 270 271 Merge r40345. 272 273 2009-01-28 Sam Weinig <sam@webkit.org> 274 275 Reviewed by Gavin Barraclough. 276 277 Fix for <rdar://problem/6525537> 278 Hang occurs when closing Installer window (iTunes, Aperture) 279 280 * JavaScriptCore.exp: Export JSGlobalData::sharedInstance. 281 2822009-02-03 Mark Rowe <mrowe@apple.com> 283 284 Merge r40339. 285 286 2009-01-28 Sam Weinig <sam@webkit.org> 287 288 Reviewed by Geoff Garen. 289 290 Initial patch by Mark Rowe. 291 292 <rdar://problem/6519356> 293 REGRESSION (r36006): "out of memory" alert running dromaeo on Windows 294 295 Report the cost of the ArrayStorage vector more accurately/often. 296 297 * runtime/JSArray.cpp: 298 (JSC::JSArray::JSArray): Report the extra cost even for a filled array 299 because JSString using the single character optimization and immediates 300 wont increase the cost themselves. 301 (JSC::JSArray::putSlowCase): Update the cost when increasing the size of 302 the array. 303 (JSC::JSArray::increaseVectorLength): Ditto. 304 3052009-02-03 Mark Rowe <mrowe@apple.com> 306 307 Merge r40332. 308 309 2009-01-28 Sam Weinig <sam@webkit.org> 310 311 Reviewed by Geoff Garen. 312 313 Fix for <rdar://problem/6129678> 314 REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view 315 316 Iterating the properties of activation objects accessed through the WebKit debugging 317 APIs was broken by forced conversion of JSActivation to the global object. To fix this, 318 we use a proxy activation object that acts more like a normal JSObject. 319 320 * debugger/DebuggerActivation.cpp: Added. 321 (JSC::DebuggerActivation::DebuggerActivation): 322 (JSC::DebuggerActivation::mark): 323 (JSC::DebuggerActivation::className): 324 (JSC::DebuggerActivation::getOwnPropertySlot): 325 (JSC::DebuggerActivation::put): 326 (JSC::DebuggerActivation::putWithAttributes): 327 (JSC::DebuggerActivation::deleteProperty): 328 (JSC::DebuggerActivation::getPropertyNames): 329 (JSC::DebuggerActivation::getPropertyAttributes): 330 (JSC::DebuggerActivation::defineGetter): 331 (JSC::DebuggerActivation::defineSetter): 332 (JSC::DebuggerActivation::lookupGetter): 333 (JSC::DebuggerActivation::lookupSetter): 334 * debugger/DebuggerActivation.h: Added. 335 Proxy JSActivation object for Debugging. 336 337 * runtime/JSActivation.h: 338 (JSC::JSActivation::isActivationObject): Added. 339 * runtime/JSObject.h: 340 (JSC::JSObject::isActivationObject): Added. 341 3422009-01-26 Adele Peterson <adele@apple.com> 343 344 Build fix. 345 346 * debugger/Debugger.cpp: 347 3482009-01-26 Gavin Barraclough <barraclough@apple.com> 349 350 Reviewed by Darin Adler. 351 352 Fixes for eq null & neq null, on 64-bit JIT. 353 https://bugs.webkit.org/show_bug.cgi?id=23559 354 355 This patch degrades 64-bit JIT performance on some benchmarks, 356 due to the whole not-being-incorrect thing. 357 358 * jit/JIT.cpp: 359 (JSC::JIT::privateCompileMainPass): 360 3612009-01-26 Cameron Zwarich <cwzwarich@uwaterloo.ca> 362 363 Reviewed by Gavin Barraclough. 364 365 Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames 366 <https://bugs.webkit.org/show_bug.cgi?id=23552> 367 <rdar://problem/6398839> 368 369 * JavaScriptCore.exp: 370 * debugger/Debugger.cpp: 371 (JSC::evaluateInGlobalCallFrame): Added so that WebScriptCallFrame can 372 evaluate JS starting from a global call frame. 373 * debugger/Debugger.h: 374 3752009-01-25 Mark Rowe <mrowe@apple.com> 376 377 Rubber-stamped by Dan Bernstein. 378 379 Improve the consistency of settings in our .xcconfig files. 380 381 * Configurations/Base.xcconfig: Enable GCC_OBJC_CALL_CXX_CDTORS to match other projects. 382 3832009-01-25 Darin Adler <darin@apple.com> 384 385 Reviewed by Mark Rowe. 386 387 Bug 23352: Turn on more compiler warnings in the Mac build 388 https://bugs.webkit.org/show_bug.cgi?id=23352 389 390 Turn on the following warnings: 391 392 -Wcast-qual 393 -Wextra-tokens 394 -Wformat=2 395 -Winit-self 396 -Wmissing-noreturn 397 -Wpacked 398 -Wrendundant-decls 399 400 * Configurations/Base.xcconfig: Added the new warnings. Switched to -Wextra instead of 401 -W for clarity since we don't have to support the older versions of gcc that require the 402 old -W syntax. Since we now use -Wformat=2, removed -Wformat-security. Also removed 403 -Wno-format-y2k since we can have that one on now. 404 4052009-01-25 Judit Jasz <jasy@inf.u-szeged.hu> 406 407 Reviewed by Darin Adler. 408 409 Compilation problem fixing 410 http://bugs.webkit.org/show_bug.cgi?id=23497 411 412 * jit/JITCall.cpp: 413 (JSC::JIT::compileOpCall): Use JSValuePtr::encode. 414 4152009-01-25 Darin Adler <darin@apple.com> 416 417 Reviewed by Sam Weinig. 418 419 Bug 23352: Turn on more compiler warnings in the Mac build 420 https://bugs.webkit.org/show_bug.cgi?id=23352 421 422 Fourth patch: Deal with the last few stray warnings. 423 424 * parser/Parser.cpp: Only declare jscyyparse if it's not already declared. 425 This makes both separate compilation and all-in-one compilation work with the 426 -Wredundant-decls warning. 427 4282009-01-25 Darin Adler <darin@apple.com> 429 430 Reviewed by Sam Weinig. 431 432 Bug 23352: Turn on more compiler warnings in the Mac build 433 https://bugs.webkit.org/show_bug.cgi?id=23352 434 435 Third patch: Use the noreturn attribute on functions that don't 436 return to prepare for the use of the -Wmissing-noreturn warning. 437 438 * jit/JITCall.cpp: 439 (JSC::unreachable): Added NO_RETURN. 440 * jsc.cpp: 441 (functionQuit): Ditto. 442 (printUsageStatement): Ditto. 443 * wtf/AlwaysInline.h: Added definition of NO_RETURN. 444 4452009-01-24 Oliver Hunt <oliver@apple.com> 446 447 Reviewed by Maciej Stachowiak. 448 449 Force inlining of Lexer::matchPunctuator 450 451 2.2% win when parsing jQuery, Mootools, Prototype, etc 452 453 * parser/Lexer.h: 454 4552009-01-23 Gavin Barraclough <barraclough@apple.com> 456 457 Reviewed by Geoff Garen. 458 459 Fix for <rdar://problem/6126212> 460 Ensure that callbacks out from the JSC interface are only allowed 461 to return in reverse-chronological order to that in which they were 462 made. If we allow earlier callbacks to return first, then this may 463 result in setions of the RegisterFile in use by another thread 464 being trampled. 465 466 See uber-comment in JSLock.h for details. 467 468 * runtime/JSLock.cpp: 469 (JSC::JSLock::DropAllLocks::DropAllLocks): 470 (JSC::JSLock::DropAllLocks::~DropAllLocks): 471 4722009-01-23 Darin Adler <darin@apple.com> 473 474 Try to fix WX build. 475 476 * runtime/JSGlobalObjectFunctions.h: Include <wtf/unicode/Unicode.h> 477 for the definition of UChar. 478 4792009-01-23 Anders Carlsson <andersca@apple.com> 480 481 * Configurations/Base.xcconfig: 482 GCC 4.0 build fix. 483 484 * runtime/JSNumberCell.h: 485 64-bit build fix. 486 4872009-01-23 Anders Carlsson <andersca@apple.com> 488 489 Reviewed by Sam Weinig. 490 491 Turn on -Wmissing-prototypes and fix the warnings. 492 493 * API/JSClassRef.cpp: 494 (clearReferenceToPrototype): 495 * Configurations/Base.xcconfig: 496 * runtime/Collector.cpp: 497 (JSC::getPlatformThreadRegisters): 498 * runtime/ExceptionHelpers.cpp: 499 (JSC::createError): 500 * runtime/JSGlobalObjectFunctions.h: 501 * runtime/JSNumberCell.h: 502 * runtime/UString.cpp: 503 (JSC::initializeStaticBaseString): 504 (JSC::createRep): 505 * wtf/FastMalloc.cpp: 506 * wtf/Threading.cpp: 507 5082009-01-22 Mark Rowe <mrowe@apple.com> 509 510 Rubber-stamped by Anders Carlsson. 511 512 Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily. 513 514 Current versions of Xcode only respect it for C and Objective-C files, 515 and our code doesn't currently compile if it is applied to C++ and 516 Objective-C++ files. 517 518 * Configurations/Base.xcconfig: 519 5202009-01-22 Steve Falkenburg <sfalken@apple.com> 521 522 https://bugs.webkit.org/show_bug.cgi?id=23489 523 524 Return currentTime() in correct units for the two early return cases. 525 526 Reviewed by Mark Rowe. 527 528 * wtf/CurrentTime.cpp: 529 (WTF::currentTime): 530 5312009-01-22 Sam Weinig <sam@webkit.org> 532 533 Reviewed by Mark Rowe. 534 535 Fix for <rdar://problem/6439247> 536 FastMalloc allocating an extra 4MB of meta-data on 64-bit 537 538 Rely on the fact that on all known x86-64 platforms only use 48 bits of 539 address space to shrink the initial size of the PageMap from ~4MB to 120K. 540 For 64-bit we still use a 3-level radix tree, but now each level is only 12 541 bits wide. 542 543 No performance change. 544 545 * wtf/FastMalloc.cpp: 546 (WTF::MapSelector): Add specialization for 64 bit that takes into account the 547 16 bits of unused address space on x86-64. 548 5492009-01-22 Beth Dakin <bdakin@apple.com> 550 551 Reviewed by Sam Weinig. 552 553 Fix for https://bugs.webkit.org/show_bug.cgi?id=23461 LayoutTests/ 554 fast/js/numeric-conversion.html is broken, and corresponding 555 <rdar://problem/6514842> 556 557 The basic problem here is that parseInt(Infinity) should be NaN, 558 but we were returning 0. NaN matches Safari 3.2.1 and Firefox. 559 560 * runtime/JSGlobalObjectFunctions.cpp: 561 (JSC::globalFuncParseInt): 562 5632009-01-22 Oliver Hunt <oliver@apple.com> 564 565 Reviewed by Geoff Garen. 566 567 <rdar://problem/6516853> (r39682-r39736) JSFunFuzz: crash on "(function(){({ x2: x }), })()" 568 <https://bugs.webkit.org/show_bug.cgi?id=23479> 569 570 Automatic semicolon insertion was resulting in this being accepted in the initial 571 nodeless parsing, but subsequent reparsing for code generation would fail, leading 572 to a crash. The solution is to ensure that reparsing a function performs parsing 573 in the same state as the initial parse. We do this by modifying the saved source 574 ranges to include rather than exclude the opening and closing braces. 575 576 * bytecode/CodeBlock.cpp: 577 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): add an assertion for successful recompile 578 * parser/Lexer.h: 579 (JSC::Lexer::sourceCode): include rather than exclude braces. 580 * parser/Nodes.h: 581 (JSC::FunctionBodyNode::toSourceString): No need to append braces anymore. 582 5832009-01-22 Dmitry Titov <dimich@chromium.org> 584 585 Reviewed by Alexey Proskuryakov. 586 587 https://bugs.webkit.org/show_bug.cgi?id=23373 588 589 Implement ThreadCondition::timedWait(). 590 Since we borrow the code for condition variables from other sources, 591 I did the same for timedWait(). See comments in ThreadingWin.cpp for 592 rationale and more info. 593 594 * wtf/CONTRIBUTORS.pthreads-win32: 595 Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself 596 is included into wtf/ThreadingWin32.cpp. 597 598 * wtf/Threading.h: 599 * wtf/ThreadingWin.cpp: 600 Additional info and Pthreads-win32 license at the beginning. 601 (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32. 602 (WTF::PlatformCondition::signal): same 603 (WTF::ThreadCondition::ThreadCondition): 604 (WTF::ThreadCondition::~ThreadCondition): 605 (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait. 606 (WTF::ThreadCondition::timedWait): same 607 (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal. 608 (WTF::ThreadCondition::broadcast): same 609 6102009-01-21 Gavin Barraclough <barraclough@apple.com> 611 612 Reviewed by Oliver Hunt. 613 614 Fix for https://bugs.webkit.org/show_bug.cgi?id=23469. 615 616 We need to check all numbers in integer switches, not just those 617 represented as integer JSImmediates. 618 619 * interpreter/Interpreter.cpp: 620 (JSC::Interpreter::privateExecute): 621 (JSC::Interpreter::cti_op_switch_imm): 622 6232009-01-21 Gavin Barraclough <barraclough@apple.com> 624 625 Reviewed by Geoff Garen. 626 627 Fix for https://bugs.webkit.org/show_bug.cgi?id=23468. 628 629 * interpreter/Interpreter.cpp: 630 (JSC::Interpreter::privateExecute): 631 6322009-01-21 Alexey Proskuryakov <ap@webkit.org> 633 634 Suggested by Oliver Hunt. Reviewed by Oliver Hunt. 635 636 https://bugs.webkit.org/show_bug.cgi?id=23456 637 Function argument names leak 638 639 * parser/Nodes.cpp: (JSC::FunctionBodyNode::~FunctionBodyNode): Destruct parameter names. 640 6412009-01-20 Oliver Hunt <oliver@apple.com> 642 643 Reviewed by NOBODY (Build fix). 644 645 Windows build fix 646 647 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 648 6492009-01-20 Gavin Barraclough <barraclough@apple.com> 650 651 Reviewed by Mark Rowe. 652 653 Structure property table deleted offset maps are being leaked. 654 Probably shouldn't be doing that. 655 656 https://bugs.webkit.org/show_bug.cgi?id=23442 657 658 * runtime/Structure.cpp: 659 (JSC::Structure::~Structure): 660 6612009-01-20 Oliver Hunt <oliver@apple.com> 662 663 Reviewed by NOBODY (build fix). 664 665 Attempt to fix gtk build 666 667 * GNUmakefile.am: 668 6692009-01-20 Darin Adler <darin@apple.com> 670 671 * runtime/StringPrototype.cpp: 672 (JSC::substituteBackreferences): Add back the initialization to fix the build. 673 6742009-01-20 Darin Adler <darin@apple.com> 675 676 Reviewed by Mark Rowe. 677 678 Bug 23352: Turn on more compiler warnings in the Mac build 679 https://bugs.webkit.org/show_bug.cgi?id=23352 680 681 First patch: Fix some simple cases of various warnings. 682 683 * pcre/pcre_compile.cpp: 684 (jsRegExpCompile): Use const_cast to change const-ness. 685 686 * runtime/StringPrototype.cpp: 687 (JSC::substituteBackreferences): Remove unneeded initialization and 688 use UChar instead of unsigned short for UTF-16 values. 689 690 * wtf/dtoa.cpp: 691 (WTF::strtod): Use const_cast to change const-ness. 692 6932009-01-20 Oliver Hunt <oliver@apple.com> 694 695 Reviewed by NOBODY (build fix). 696 697 Whoops, remove runtime/ByteArray references from .pri and .scons builds, update .bkl 698 699 * JavaScriptCore.pri: 700 * JavaScriptCore.scons: 701 * JavaScriptCoreSources.bkl: 702 7032009-01-20 Oliver Hunt <oliver@apple.com> 704 705 RS=Dan Bernstein. 706 707 Move runtime/ByteArray to wtf/ByteArray 708 709 * GNUmakefile.am: 710 * JavaScriptCore.exp: 711 * JavaScriptCore.pri: 712 * JavaScriptCore.scons: 713 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 714 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 715 * JavaScriptCore.xcodeproj/project.pbxproj: 716 * runtime/JSByteArray.cpp: 717 * runtime/JSByteArray.h: 718 * wtf/ByteArray.cpp: Renamed from JavaScriptCore/runtime/ByteArray.cpp. 719 (WTF::ByteArray::create): 720 * wtf/ByteArray.h: Renamed from JavaScriptCore/runtime/ByteArray.h. 721 (WTF::ByteArray::length): 722 (WTF::ByteArray::set): 723 (WTF::ByteArray::get): 724 (WTF::ByteArray::data): 725 (WTF::ByteArray::deref): 726 (WTF::ByteArray::ByteArray): 727 7282009-01-19 Sam Weinig <sam@webkit.org> 729 730 Rubber-stamped by Gavin Barraclough. 731 732 Remove temporary operator-> from JSValuePtr. 733 734 * API/JSCallbackFunction.cpp: 735 (JSC::JSCallbackFunction::call): 736 * API/JSCallbackObjectFunctions.h: 737 (JSC::::call): 738 (JSC::::toNumber): 739 (JSC::::toString): 740 * API/JSObjectRef.cpp: 741 (JSObjectSetPrototype): 742 * API/JSValueRef.cpp: 743 (JSValueGetType): 744 (JSValueIsUndefined): 745 (JSValueIsNull): 746 (JSValueIsBoolean): 747 (JSValueIsNumber): 748 (JSValueIsString): 749 (JSValueIsObject): 750 (JSValueIsObjectOfClass): 751 (JSValueToBoolean): 752 (JSValueToNumber): 753 (JSValueToStringCopy): 754 (JSValueToObject): 755 * bytecode/CodeBlock.cpp: 756 (JSC::valueToSourceString): 757 (JSC::CodeBlock::mark): 758 * bytecode/CodeBlock.h: 759 (JSC::CodeBlock::isKnownNotImmediate): 760 * bytecompiler/BytecodeGenerator.cpp: 761 (JSC::BytecodeGenerator::emitEqualityOp): 762 (JSC::keyForImmediateSwitch): 763 * interpreter/Interpreter.cpp: 764 (JSC::jsLess): 765 (JSC::jsLessEq): 766 (JSC::jsAddSlowCase): 767 (JSC::jsAdd): 768 (JSC::jsTypeStringForValue): 769 (JSC::jsIsObjectType): 770 (JSC::jsIsFunctionType): 771 (JSC::isNotObject): 772 (JSC::Interpreter::callEval): 773 (JSC::Interpreter::throwException): 774 (JSC::cachePrototypeChain): 775 (JSC::Interpreter::tryCachePutByID): 776 (JSC::countPrototypeChainEntriesAndCheckForProxies): 777 (JSC::Interpreter::tryCacheGetByID): 778 (JSC::Interpreter::privateExecute): 779 (JSC::Interpreter::tryCTICachePutByID): 780 (JSC::Interpreter::tryCTICacheGetByID): 781 (JSC::Interpreter::cti_op_convert_this): 782 (JSC::Interpreter::cti_op_add): 783 (JSC::Interpreter::cti_op_pre_inc): 784 (JSC::Interpreter::cti_op_put_by_id_generic): 785 (JSC::Interpreter::cti_op_get_by_id_generic): 786 (JSC::Interpreter::cti_op_put_by_id): 787 (JSC::Interpreter::cti_op_put_by_id_second): 788 (JSC::Interpreter::cti_op_put_by_id_fail): 789 (JSC::Interpreter::cti_op_get_by_id): 790 (JSC::Interpreter::cti_op_get_by_id_second): 791 (JSC::Interpreter::cti_op_get_by_id_self_fail): 792 (JSC::Interpreter::cti_op_get_by_id_proto_list): 793 (JSC::Interpreter::cti_op_get_by_id_proto_list_full): 794 (JSC::Interpreter::cti_op_get_by_id_proto_fail): 795 (JSC::Interpreter::cti_op_get_by_id_array_fail): 796 (JSC::Interpreter::cti_op_get_by_id_string_fail): 797 (JSC::Interpreter::cti_op_instanceof): 798 (JSC::Interpreter::cti_op_del_by_id): 799 (JSC::Interpreter::cti_op_mul): 800 (JSC::Interpreter::cti_op_call_JSFunction): 801 (JSC::Interpreter::cti_op_call_NotJSFunction): 802 (JSC::Interpreter::cti_op_construct_JSConstruct): 803 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 804 (JSC::Interpreter::cti_op_get_by_val): 805 (JSC::Interpreter::cti_op_get_by_val_byte_array): 806 (JSC::Interpreter::cti_op_sub): 807 (JSC::Interpreter::cti_op_put_by_val): 808 (JSC::Interpreter::cti_op_put_by_val_array): 809 (JSC::Interpreter::cti_op_put_by_val_byte_array): 810 (JSC::Interpreter::cti_op_loop_if_true): 811 (JSC::Interpreter::cti_op_negate): 812 (JSC::Interpreter::cti_op_div): 813 (JSC::Interpreter::cti_op_pre_dec): 814 (JSC::Interpreter::cti_op_not): 815 (JSC::Interpreter::cti_op_jtrue): 816 (JSC::Interpreter::cti_op_post_inc): 817 (JSC::Interpreter::cti_op_lshift): 818 (JSC::Interpreter::cti_op_bitand): 819 (JSC::Interpreter::cti_op_rshift): 820 (JSC::Interpreter::cti_op_bitnot): 821 (JSC::Interpreter::cti_op_mod): 822 (JSC::Interpreter::cti_op_post_dec): 823 (JSC::Interpreter::cti_op_urshift): 824 (JSC::Interpreter::cti_op_bitxor): 825 (JSC::Interpreter::cti_op_bitor): 826 (JSC::Interpreter::cti_op_push_scope): 827 (JSC::Interpreter::cti_op_is_undefined): 828 (JSC::Interpreter::cti_op_is_boolean): 829 (JSC::Interpreter::cti_op_is_number): 830 (JSC::Interpreter::cti_op_to_jsnumber): 831 (JSC::Interpreter::cti_op_in): 832 (JSC::Interpreter::cti_op_put_by_index): 833 (JSC::Interpreter::cti_op_switch_imm): 834 (JSC::Interpreter::cti_op_switch_char): 835 (JSC::Interpreter::cti_op_switch_string): 836 (JSC::Interpreter::cti_op_del_by_val): 837 (JSC::Interpreter::cti_op_put_getter): 838 (JSC::Interpreter::cti_op_put_setter): 839 (JSC::Interpreter::cti_op_new_error): 840 * interpreter/Interpreter.h: 841 (JSC::Interpreter::isJSArray): 842 (JSC::Interpreter::isJSString): 843 (JSC::Interpreter::isJSByteArray): 844 * interpreter/Register.h: 845 (JSC::Register::marked): 846 (JSC::Register::mark): 847 * jit/JITInlineMethods.h: 848 (JSC::JIT::getConstantOperandImmediateInt): 849 (JSC::JIT::isOperandConstantImmediateInt): 850 * jsc.cpp: 851 (functionPrint): 852 (functionDebug): 853 (functionRun): 854 (functionLoad): 855 (runWithScripts): 856 (runInteractive): 857 * parser/Nodes.cpp: 858 (JSC::processClauseList): 859 * profiler/ProfileGenerator.cpp: 860 (JSC::ProfileGenerator::addParentForConsoleStart): 861 * profiler/Profiler.cpp: 862 (JSC::Profiler::createCallIdentifier): 863 * runtime/ArrayConstructor.cpp: 864 (JSC::constructArrayWithSizeQuirk): 865 * runtime/ArrayPrototype.cpp: 866 (JSC::arrayProtoFuncToString): 867 (JSC::arrayProtoFuncToLocaleString): 868 (JSC::arrayProtoFuncJoin): 869 (JSC::arrayProtoFuncConcat): 870 (JSC::arrayProtoFuncPop): 871 (JSC::arrayProtoFuncPush): 872 (JSC::arrayProtoFuncReverse): 873 (JSC::arrayProtoFuncShift): 874 (JSC::arrayProtoFuncSlice): 875 (JSC::arrayProtoFuncSort): 876 (JSC::arrayProtoFuncSplice): 877 (JSC::arrayProtoFuncUnShift): 878 (JSC::arrayProtoFuncFilter): 879 (JSC::arrayProtoFuncMap): 880 (JSC::arrayProtoFuncEvery): 881 (JSC::arrayProtoFuncForEach): 882 (JSC::arrayProtoFuncSome): 883 (JSC::arrayProtoFuncIndexOf): 884 (JSC::arrayProtoFuncLastIndexOf): 885 * runtime/BooleanConstructor.cpp: 886 (JSC::constructBoolean): 887 (JSC::callBooleanConstructor): 888 * runtime/BooleanPrototype.cpp: 889 (JSC::booleanProtoFuncToString): 890 (JSC::booleanProtoFuncValueOf): 891 * runtime/Collector.cpp: 892 (JSC::Heap::protect): 893 (JSC::Heap::unprotect): 894 (JSC::Heap::heap): 895 (JSC::Heap::collect): 896 (JSC::typeName): 897 * runtime/Completion.cpp: 898 (JSC::evaluate): 899 * runtime/DateConstructor.cpp: 900 (JSC::constructDate): 901 (JSC::dateParse): 902 (JSC::dateUTC): 903 * runtime/DateInstance.h: 904 (JSC::DateInstance::internalNumber): 905 * runtime/DatePrototype.cpp: 906 (JSC::formatLocaleDate): 907 (JSC::fillStructuresUsingTimeArgs): 908 (JSC::fillStructuresUsingDateArgs): 909 (JSC::dateProtoFuncToString): 910 (JSC::dateProtoFuncToUTCString): 911 (JSC::dateProtoFuncToDateString): 912 (JSC::dateProtoFuncToTimeString): 913 (JSC::dateProtoFuncToLocaleString): 914 (JSC::dateProtoFuncToLocaleDateString): 915 (JSC::dateProtoFuncToLocaleTimeString): 916 (JSC::dateProtoFuncGetTime): 917 (JSC::dateProtoFuncGetFullYear): 918 (JSC::dateProtoFuncGetUTCFullYear): 919 (JSC::dateProtoFuncToGMTString): 920 (JSC::dateProtoFuncGetMonth): 921 (JSC::dateProtoFuncGetUTCMonth): 922 (JSC::dateProtoFuncGetDate): 923 (JSC::dateProtoFuncGetUTCDate): 924 (JSC::dateProtoFuncGetDay): 925 (JSC::dateProtoFuncGetUTCDay): 926 (JSC::dateProtoFuncGetHours): 927 (JSC::dateProtoFuncGetUTCHours): 928 (JSC::dateProtoFuncGetMinutes): 929 (JSC::dateProtoFuncGetUTCMinutes): 930 (JSC::dateProtoFuncGetSeconds): 931 (JSC::dateProtoFuncGetUTCSeconds): 932 (JSC::dateProtoFuncGetMilliSeconds): 933 (JSC::dateProtoFuncGetUTCMilliseconds): 934 (JSC::dateProtoFuncGetTimezoneOffset): 935 (JSC::dateProtoFuncSetTime): 936 (JSC::setNewValueFromTimeArgs): 937 (JSC::setNewValueFromDateArgs): 938 (JSC::dateProtoFuncSetYear): 939 (JSC::dateProtoFuncGetYear): 940 * runtime/ErrorConstructor.cpp: 941 (JSC::constructError): 942 * runtime/ErrorPrototype.cpp: 943 (JSC::errorProtoFuncToString): 944 * runtime/ExceptionHelpers.cpp: 945 (JSC::createError): 946 (JSC::createErrorMessage): 947 * runtime/FunctionConstructor.cpp: 948 (JSC::constructFunction): 949 * runtime/FunctionPrototype.cpp: 950 (JSC::functionProtoFuncToString): 951 (JSC::functionProtoFuncApply): 952 (JSC::functionProtoFuncCall): 953 * runtime/GetterSetter.cpp: 954 (JSC::GetterSetter::toObject): 955 * runtime/JSActivation.cpp: 956 (JSC::JSActivation::getOwnPropertySlot): 957 * runtime/JSArray.cpp: 958 (JSC::JSArray::put): 959 (JSC::JSArray::mark): 960 (JSC::JSArray::sort): 961 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key): 962 (JSC::JSArray::compactForSorting): 963 * runtime/JSByteArray.h: 964 (JSC::JSByteArray::setIndex): 965 * runtime/JSCell.h: 966 (JSC::asCell): 967 * runtime/JSFunction.cpp: 968 (JSC::JSFunction::call): 969 (JSC::JSFunction::construct): 970 * runtime/JSGlobalObject.cpp: 971 (JSC::markIfNeeded): 972 (JSC::lastInPrototypeChain): 973 * runtime/JSGlobalObjectFunctions.cpp: 974 (JSC::encode): 975 (JSC::decode): 976 (JSC::globalFuncEval): 977 (JSC::globalFuncParseInt): 978 (JSC::globalFuncParseFloat): 979 (JSC::globalFuncIsNaN): 980 (JSC::globalFuncIsFinite): 981 (JSC::globalFuncEscape): 982 (JSC::globalFuncUnescape): 983 (JSC::globalFuncJSCPrint): 984 * runtime/JSImmediate.cpp: 985 (JSC::JSImmediate::toThisObject): 986 (JSC::JSImmediate::toObject): 987 (JSC::JSImmediate::prototype): 988 (JSC::JSImmediate::toString): 989 * runtime/JSImmediate.h: 990 * runtime/JSObject.cpp: 991 (JSC::JSObject::mark): 992 (JSC::JSObject::put): 993 (JSC::callDefaultValueFunction): 994 (JSC::JSObject::getPrimitiveNumber): 995 (JSC::JSObject::defineGetter): 996 (JSC::JSObject::defineSetter): 997 (JSC::JSObject::lookupGetter): 998 (JSC::JSObject::lookupSetter): 999 (JSC::JSObject::hasInstance): 1000 (JSC::JSObject::toNumber): 1001 (JSC::JSObject::toString): 1002 * runtime/JSObject.h: 1003 (JSC::JSObject::JSObject): 1004 (JSC::JSObject::inlineGetOwnPropertySlot): 1005 (JSC::JSObject::getOwnPropertySlotForWrite): 1006 (JSC::JSObject::getPropertySlot): 1007 (JSC::JSValuePtr::get): 1008 * runtime/JSPropertyNameIterator.h: 1009 (JSC::JSPropertyNameIterator::create): 1010 * runtime/JSString.cpp: 1011 (JSC::JSString::getOwnPropertySlot): 1012 * runtime/JSValue.h: 1013 * runtime/JSWrapperObject.cpp: 1014 (JSC::JSWrapperObject::mark): 1015 * runtime/JSWrapperObject.h: 1016 (JSC::JSWrapperObject::setInternalValue): 1017 * runtime/MathObject.cpp: 1018 (JSC::mathProtoFuncAbs): 1019 (JSC::mathProtoFuncACos): 1020 (JSC::mathProtoFuncASin): 1021 (JSC::mathProtoFuncATan): 1022 (JSC::mathProtoFuncATan2): 1023 (JSC::mathProtoFuncCeil): 1024 (JSC::mathProtoFuncCos): 1025 (JSC::mathProtoFuncExp): 1026 (JSC::mathProtoFuncFloor): 1027 (JSC::mathProtoFuncLog): 1028 (JSC::mathProtoFuncMax): 1029 (JSC::mathProtoFuncMin): 1030 (JSC::mathProtoFuncPow): 1031 (JSC::mathProtoFuncRound): 1032 (JSC::mathProtoFuncSin): 1033 (JSC::mathProtoFuncSqrt): 1034 (JSC::mathProtoFuncTan): 1035 * runtime/NativeErrorConstructor.cpp: 1036 (JSC::NativeErrorConstructor::NativeErrorConstructor): 1037 (JSC::NativeErrorConstructor::construct): 1038 * runtime/NumberConstructor.cpp: 1039 (JSC::constructWithNumberConstructor): 1040 (JSC::callNumberConstructor): 1041 * runtime/NumberPrototype.cpp: 1042 (JSC::numberProtoFuncToString): 1043 (JSC::numberProtoFuncToLocaleString): 1044 (JSC::numberProtoFuncValueOf): 1045 (JSC::numberProtoFuncToFixed): 1046 (JSC::numberProtoFuncToExponential): 1047 (JSC::numberProtoFuncToPrecision): 1048 * runtime/ObjectConstructor.cpp: 1049 (JSC::constructObject): 1050 * runtime/ObjectPrototype.cpp: 1051 (JSC::objectProtoFuncValueOf): 1052 (JSC::objectProtoFuncHasOwnProperty): 1053 (JSC::objectProtoFuncIsPrototypeOf): 1054 (JSC::objectProtoFuncDefineGetter): 1055 (JSC::objectProtoFuncDefineSetter): 1056 (JSC::objectProtoFuncLookupGetter): 1057 (JSC::objectProtoFuncLookupSetter): 1058 (JSC::objectProtoFuncPropertyIsEnumerable): 1059 (JSC::objectProtoFuncToLocaleString): 1060 (JSC::objectProtoFuncToString): 1061 * runtime/Operations.h: 1062 (JSC::JSValuePtr::equalSlowCaseInline): 1063 (JSC::JSValuePtr::strictEqual): 1064 (JSC::JSValuePtr::strictEqualSlowCaseInline): 1065 * runtime/Protect.h: 1066 (JSC::gcProtect): 1067 (JSC::gcUnprotect): 1068 * runtime/RegExpConstructor.cpp: 1069 (JSC::setRegExpConstructorInput): 1070 (JSC::setRegExpConstructorMultiline): 1071 (JSC::constructRegExp): 1072 * runtime/RegExpObject.cpp: 1073 (JSC::setRegExpObjectLastIndex): 1074 (JSC::RegExpObject::match): 1075 * runtime/RegExpPrototype.cpp: 1076 (JSC::regExpProtoFuncTest): 1077 (JSC::regExpProtoFuncExec): 1078 (JSC::regExpProtoFuncCompile): 1079 (JSC::regExpProtoFuncToString): 1080 * runtime/StringConstructor.cpp: 1081 (JSC::stringFromCharCodeSlowCase): 1082 (JSC::stringFromCharCode): 1083 (JSC::constructWithStringConstructor): 1084 (JSC::callStringConstructor): 1085 * runtime/StringPrototype.cpp: 1086 (JSC::stringProtoFuncReplace): 1087 (JSC::stringProtoFuncToString): 1088 (JSC::stringProtoFuncCharAt): 1089 (JSC::stringProtoFuncCharCodeAt): 1090 (JSC::stringProtoFuncConcat): 1091 (JSC::stringProtoFuncIndexOf): 1092 (JSC::stringProtoFuncLastIndexOf): 1093 (JSC::stringProtoFuncMatch): 1094 (JSC::stringProtoFuncSearch): 1095 (JSC::stringProtoFuncSlice): 1096 (JSC::stringProtoFuncSplit): 1097 (JSC::stringProtoFuncSubstr): 1098 (JSC::stringProtoFuncSubstring): 1099 (JSC::stringProtoFuncToLowerCase): 1100 (JSC::stringProtoFuncToUpperCase): 1101 (JSC::stringProtoFuncLocaleCompare): 1102 (JSC::stringProtoFuncBig): 1103 (JSC::stringProtoFuncSmall): 1104 (JSC::stringProtoFuncBlink): 1105 (JSC::stringProtoFuncBold): 1106 (JSC::stringProtoFuncFixed): 1107 (JSC::stringProtoFuncItalics): 1108 (JSC::stringProtoFuncStrike): 1109 (JSC::stringProtoFuncSub): 1110 (JSC::stringProtoFuncSup): 1111 (JSC::stringProtoFuncFontcolor): 1112 (JSC::stringProtoFuncFontsize): 1113 (JSC::stringProtoFuncAnchor): 1114 (JSC::stringProtoFuncLink): 1115 * runtime/Structure.cpp: 1116 (JSC::Structure::Structure): 1117 (JSC::Structure::getEnumerablePropertyNames): 1118 (JSC::Structure::createCachedPrototypeChain): 1119 * runtime/Structure.h: 1120 (JSC::Structure::mark): 1121 * runtime/StructureChain.cpp: 1122 (JSC::StructureChain::StructureChain): 1123 11242009-01-19 Darin Adler <darin@apple.com> 1125 1126 Reviewed by Sam Weinig. 1127 1128 Bug 23409: REGRESSION: RegExp 'replace()' function improperly processes '$$' 1129 <https://bugs.webkit.org/show_bug.cgi?id=23409> 1130 <rdar://problem/6505723> 1131 1132 Test: fast/js/string-replace-3.html 1133 1134 * runtime/StringPrototype.cpp: 1135 (JSC::substituteBackreferences): Remove code that adds an extra $ -- not sure 1136 how this ever worked. 1137 11382009-01-16 Gavin Barraclough <barraclough@apple.com> 1139 1140 Reviewed by Oliver Hunt. 1141 1142 On x86-64 jit, cache JSImmedate::TagMask & JSImmedate::TagTypeNumber in 1143 registers, save reloading them every time they're used. 1144 1145 Draws x86-64 jit performance close to that of i386 jit. 1146 1147 * assembler/MacroAssembler.h: 1148 (JSC::MacroAssembler::subPtr): 1149 (JSC::MacroAssembler::jnzPtr): 1150 (JSC::MacroAssembler::jzPtr): 1151 * jit/JIT.cpp: 1152 (JSC::JIT::privateCompileMainPass): 1153 * jit/JIT.h: 1154 * jit/JITArithmetic.cpp: 1155 (JSC::JIT::compileBinaryArithOpSlowCase): 1156 * jit/JITInlineMethods.h: 1157 (JSC::JIT::emitJumpIfJSCell): 1158 (JSC::JIT::emitJumpIfNotJSCell): 1159 (JSC::JIT::emitJumpIfImmediateNumber): 1160 (JSC::JIT::emitJumpIfNotImmediateNumber): 1161 (JSC::JIT::emitJumpIfImmediateInteger): 1162 (JSC::JIT::emitJumpIfNotImmediateInteger): 1163 (JSC::JIT::emitFastArithIntToImmNoCheck): 1164 11652009-01-16 Gavin Barraclough <barraclough@apple.com> 1166 1167 Reviewed by Oliver Hunt. 1168 1169 Add support to x86-64 JIT for inline double precision arithmetic ops. 1170 +5/6% on x86-64, JIT enabled, sunspider. 1171 1172 * assembler/MacroAssembler.h: 1173 (JSC::MacroAssembler::addPtr): 1174 * assembler/X86Assembler.h: 1175 (JSC::X86Assembler::movq_rr): 1176 * jit/JIT.h: 1177 * jit/JITArithmetic.cpp: 1178 (JSC::JIT::compileFastArith_op_pre_inc): 1179 (JSC::JIT::compileBinaryArithOp): 1180 (JSC::JIT::compileBinaryArithOpSlowCase): 1181 (JSC::JIT::compileFastArith_op_add): 1182 (JSC::JIT::compileFastArithSlow_op_add): 1183 (JSC::JIT::compileFastArith_op_mul): 1184 (JSC::JIT::compileFastArithSlow_op_mul): 1185 (JSC::JIT::compileFastArith_op_sub): 1186 (JSC::JIT::compileFastArithSlow_op_sub): 1187 * parser/ResultType.h: 1188 (JSC::ResultType::isReusable): 1189 (JSC::ResultType::isInt32): 1190 (JSC::ResultType::definitelyIsNumber): 1191 (JSC::ResultType::mightBeNumber): 1192 (JSC::ResultType::isNotNumber): 1193 (JSC::ResultType::unknownType): 1194 11952009-01-16 Gavin Barraclough <barraclough@apple.com> 1196 1197 Reviewed by Geoff Garen. 1198 1199 Fixes for SamplingTool. 1200 1201 https://bugs.webkit.org/show_bug.cgi?id=23390 1202 1203 * assembler/MacroAssembler.h: 1204 (JSC::MacroAssembler::storePtr): 1205 * bytecode/SamplingTool.cpp: 1206 (JSC::SamplingTool::run): 1207 (JSC::SamplingTool::dump): 1208 * bytecode/SamplingTool.h: 1209 (JSC::SamplingTool::encodeSample): 1210 * jit/JIT.cpp: 1211 (JSC::JIT::privateCompileMainPass): 1212 (JSC::JIT::privateCompile): 1213 * jit/JIT.h: 1214 (JSC::JIT::samplingToolTrackCodeBlock): 1215 * jit/JITCall.cpp: 1216 (JSC::JIT::compileOpCall): 1217 (JSC::JIT::compileOpCallSlowCase): 1218 * jit/JITInlineMethods.h: 1219 (JSC::JIT::emitCTICall_internal): 1220 12212009-01-16 Geoffrey Garen <ggaren@apple.com> 1222 1223 Reviewed by Darin Adler. 1224 1225 Fixed <rdar://problem/6452301> REGRESSION: Latest WebKit nightlies 1226 turn "c" into "" when stripping \\c_ character 1227 1228 * wrec/WRECParser.cpp: 1229 (JSC::WREC::Parser::consumeEscape): Mimic a Firefox quirk when parsing 1230 control escapes inside character classes. 1231 12322009-01-16 Adam Roben <aroben@apple.com> 1233 1234 Windows build fix 1235 1236 * wrec/WRECParser.cpp: 1237 (JSC::WREC::Parser::parseParentheses): Removed unreachable code. 1238 12392009-01-15 Geoffrey Garen <ggaren@apple.com> 1240 1241 Reviewed by Cameron Zwarich. 1242 1243 Fixed <rdar://problem/6471394> REGRESSION (r39164): Discarding quantifier 1244 on assertion gives incorrect result (23075) 1245 1246 https://bugs.webkit.org/show_bug.cgi?id=23075 1247 1248 * pcre/pcre_compile.cpp: 1249 (compileBranch): Throw away an assertion if it's followed by a quantifier 1250 with a 0 minimum, to match SpiderMonkey, v8, and the ECMA spec. 1251 1252 * wrec/WRECParser.cpp: 1253 (JSC::WREC::Parser::parseParentheses): Fall back on PCRE for the rare 1254 case of an assertion with a quantifier with a 0 minimum, since we 1255 don't handle quantified subexpressions yet, and in this special case, 1256 we can't just throw away the quantifier. 1257 12582009-01-15 Gavin Barraclough <barraclough@apple.com> 1259 1260 Reviewed by Oliver Hunt. 1261 1262 Add support in ResultType to track that the results of bitops 1263 are always of type int32_t. 1264 1265 * parser/Nodes.cpp: 1266 (JSC::ReadModifyResolveNode::emitBytecode): 1267 (JSC::ReadModifyDotNode::emitBytecode): 1268 (JSC::ReadModifyBracketNode::emitBytecode): 1269 * parser/Nodes.h: 1270 (JSC::ExpressionNode::): 1271 (JSC::BooleanNode::): 1272 (JSC::NumberNode::): 1273 (JSC::StringNode::): 1274 (JSC::PrePostResolveNode::): 1275 (JSC::TypeOfResolveNode::): 1276 (JSC::TypeOfValueNode::): 1277 (JSC::UnaryPlusNode::): 1278 (JSC::NegateNode::): 1279 (JSC::BitwiseNotNode::): 1280 (JSC::LogicalNotNode::): 1281 (JSC::MultNode::): 1282 (JSC::DivNode::): 1283 (JSC::ModNode::): 1284 (JSC::SubNode::): 1285 (JSC::LeftShiftNode::): 1286 (JSC::RightShiftNode::): 1287 (JSC::UnsignedRightShiftNode::): 1288 (JSC::LessNode::): 1289 (JSC::GreaterNode::): 1290 (JSC::LessEqNode::): 1291 (JSC::GreaterEqNode::): 1292 (JSC::InstanceOfNode::): 1293 (JSC::EqualNode::): 1294 (JSC::NotEqualNode::): 1295 (JSC::StrictEqualNode::): 1296 (JSC::NotStrictEqualNode::): 1297 (JSC::BitAndNode::): 1298 (JSC::BitOrNode::): 1299 (JSC::BitXOrNode::): 1300 (JSC::LogicalOpNode::): 1301 * parser/ResultType.h: 1302 (JSC::ResultType::isInt32): 1303 (JSC::ResultType::isNotNumber): 1304 (JSC::ResultType::booleanType): 1305 (JSC::ResultType::numberType): 1306 (JSC::ResultType::numberTypeCanReuse): 1307 (JSC::ResultType::numberTypeCanReuseIsInt32): 1308 (JSC::ResultType::stringOrNumberTypeCanReuse): 1309 (JSC::ResultType::stringType): 1310 (JSC::ResultType::unknownType): 1311 (JSC::ResultType::forAdd): 1312 (JSC::ResultType::forBitOp): 1313 (JSC::OperandTypes::OperandTypes): 1314 13152009-01-15 Gavin Barraclough <barraclough@apple.com> 1316 1317 Reviewed by Oliver Hunt. 1318 1319 Add support for integer addition, subtraction and multiplication 1320 in JIT code on x86-64. 1321 1322 * assembler/MacroAssembler.h: 1323 (JSC::MacroAssembler::mul32): 1324 (JSC::MacroAssembler::sub32): 1325 (JSC::MacroAssembler::joMul32): 1326 (JSC::MacroAssembler::joSub32): 1327 * jit/JIT.cpp: 1328 (JSC::JIT::privateCompileMainPass): 1329 (JSC::JIT::privateCompileSlowCases): 1330 * jit/JIT.h: 1331 * jit/JITArithmetic.cpp: 1332 (JSC::JIT::compileFastArith_op_add): 1333 (JSC::JIT::compileFastArithSlow_op_add): 1334 (JSC::JIT::compileFastArith_op_mul): 1335 (JSC::JIT::compileFastArithSlow_op_mul): 1336 (JSC::JIT::compileFastArith_op_sub): 1337 (JSC::JIT::compileFastArithSlow_op_sub): 1338 13392009-01-15 Gavin Barraclough <barraclough@apple.com> 1340 1341 Reviewed by Geoff Garen. 1342 1343 On x86-64 allow JSImmediate to encode 64-bit double precision values. 1344 This patch only affects builds that set USE(ALTERNATE_JSIMMEDIATE). 1345 Updates the implementation of JSValuePtr:: and JSImmediate:: methods 1346 that operate on neumeric values to be be aware of the new representation. 1347 When this representation is in use, the class JSNumberCell is redundant 1348 and is compiled out. 1349 1350 The format of the new immediate representation is documented in JSImmediate.h. 1351 1352 * JavaScriptCore.exp: 1353 * assembler/MacroAssembler.h: 1354 (JSC::MacroAssembler::subPtr): 1355 * assembler/X86Assembler.h: 1356 (JSC::X86Assembler::): 1357 (JSC::X86Assembler::subq_rr): 1358 (JSC::X86Assembler::movq_rr): 1359 (JSC::X86Assembler::ucomisd_rr): 1360 (JSC::X86Assembler::X86InstructionFormatter::twoByteOp64): 1361 * interpreter/Interpreter.cpp: 1362 (JSC::Interpreter::cti_op_stricteq): 1363 (JSC::Interpreter::cti_op_nstricteq): 1364 * jit/JIT.cpp: 1365 (JSC::JIT::compileOpStrictEq): 1366 (JSC::JIT::privateCompileMainPass): 1367 (JSC::JIT::privateCompileSlowCases): 1368 * jit/JIT.h: 1369 * jit/JITArithmetic.cpp: 1370 (JSC::JIT::compileFastArith_op_lshift): 1371 (JSC::JIT::compileFastArith_op_rshift): 1372 (JSC::JIT::compileFastArith_op_bitand): 1373 (JSC::JIT::compileFastArith_op_mod): 1374 (JSC::JIT::compileFastArith_op_add): 1375 (JSC::JIT::compileFastArith_op_mul): 1376 (JSC::JIT::compileFastArith_op_post_inc): 1377 (JSC::JIT::compileFastArith_op_post_dec): 1378 (JSC::JIT::compileFastArith_op_pre_inc): 1379 (JSC::JIT::compileFastArith_op_pre_dec): 1380 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate): 1381 (JSC::JIT::compileBinaryArithOp): 1382 * jit/JITInlineMethods.h: 1383 (JSC::JIT::emitJumpIfBothJSCells): 1384 (JSC::JIT::emitJumpIfEitherNumber): 1385 (JSC::JIT::emitJumpIfNotEitherNumber): 1386 (JSC::JIT::emitJumpIfImmediateIntegerNumber): 1387 (JSC::JIT::emitJumpIfNotImmediateIntegerNumber): 1388 (JSC::JIT::emitJumpIfNotImmediateIntegerNumbers): 1389 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumber): 1390 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumbers): 1391 (JSC::JIT::emitFastArithDeTagImmediate): 1392 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): 1393 (JSC::JIT::emitFastArithReTagImmediate): 1394 (JSC::JIT::emitFastArithIntToImmNoCheck): 1395 * runtime/JSCell.h: 1396 * runtime/JSGlobalData.cpp: 1397 (JSC::JSGlobalData::JSGlobalData): 1398 * runtime/JSImmediate.cpp: 1399 (JSC::JSImmediate::toThisObject): 1400 (JSC::JSImmediate::toObject): 1401 (JSC::JSImmediate::toString): 1402 * runtime/JSImmediate.h: 1403 (JSC::wtf_reinterpret_cast): 1404 (JSC::JSImmediate::isNumber): 1405 (JSC::JSImmediate::isIntegerNumber): 1406 (JSC::JSImmediate::isDoubleNumber): 1407 (JSC::JSImmediate::isPositiveIntegerNumber): 1408 (JSC::JSImmediate::areBothImmediateIntegerNumbers): 1409 (JSC::JSImmediate::makeInt): 1410 (JSC::JSImmediate::makeDouble): 1411 (JSC::JSImmediate::doubleValue): 1412 (JSC::doubleToBoolean): 1413 (JSC::JSImmediate::toBoolean): 1414 (JSC::JSImmediate::getTruncatedUInt32): 1415 (JSC::JSImmediate::makeOutOfIntegerRange): 1416 (JSC::JSImmediate::from): 1417 (JSC::JSImmediate::getTruncatedInt32): 1418 (JSC::JSImmediate::toDouble): 1419 (JSC::JSImmediate::getUInt32): 1420 (JSC::JSValuePtr::isInt32Fast): 1421 (JSC::JSValuePtr::isUInt32Fast): 1422 (JSC::JSValuePtr::areBothInt32Fast): 1423 (JSC::JSFastMath::canDoFastBitwiseOperations): 1424 (JSC::JSFastMath::xorImmediateNumbers): 1425 (JSC::JSFastMath::canDoFastRshift): 1426 (JSC::JSFastMath::canDoFastUrshift): 1427 (JSC::JSFastMath::rightShiftImmediateNumbers): 1428 (JSC::JSFastMath::canDoFastAdditiveOperations): 1429 (JSC::JSFastMath::addImmediateNumbers): 1430 (JSC::JSFastMath::subImmediateNumbers): 1431 * runtime/JSNumberCell.cpp: 1432 (JSC::jsNumberCell): 1433 * runtime/JSNumberCell.h: 1434 (JSC::createNumberStructure): 1435 (JSC::isNumberCell): 1436 (JSC::asNumberCell): 1437 (JSC::jsNumber): 1438 (JSC::JSValuePtr::isDoubleNumber): 1439 (JSC::JSValuePtr::getDoubleNumber): 1440 (JSC::JSValuePtr::isNumber): 1441 (JSC::JSValuePtr::uncheckedGetNumber): 1442 (JSC::jsNaN): 1443 (JSC::JSValuePtr::getNumber): 1444 (JSC::JSValuePtr::numberToInt32): 1445 (JSC::JSValuePtr::numberToUInt32): 1446 * runtime/JSValue.h: 1447 * runtime/NumberConstructor.cpp: 1448 (JSC::numberConstructorNegInfinity): 1449 (JSC::numberConstructorPosInfinity): 1450 (JSC::numberConstructorMaxValue): 1451 (JSC::numberConstructorMinValue): 1452 * runtime/NumberObject.cpp: 1453 (JSC::constructNumber): 1454 * runtime/NumberObject.h: 1455 * runtime/Operations.h: 1456 (JSC::JSValuePtr::equal): 1457 (JSC::JSValuePtr::equalSlowCaseInline): 1458 (JSC::JSValuePtr::strictEqual): 1459 (JSC::JSValuePtr::strictEqualSlowCaseInline): 1460 * wtf/Platform.h: 1461 14622009-01-15 Sam Weinig <sam@webkit.org> 1463 1464 Reviewed by Geoffrey Garen. 1465 1466 <rdar://problem/6045018> 1467 REGRESSION (r34838): JavaScript objects appear to be leaked after loading google.com 1468 1469 Subtract the number of JSStrings cached in SmallStrings when calculating the 1470 number of live JSObjects. 1471 1472 * runtime/Collector.cpp: 1473 (JSC::Heap::objectCount): 1474 * runtime/SmallStrings.cpp: 1475 (JSC::SmallStrings::count): 1476 * runtime/SmallStrings.h: 1477 14782009-01-15 Sam Weinig <sam@webkit.org> 1479 1480 Fix Qt build. 1481 1482 * runtime/Collector.cpp: 1483 14842009-01-15 Sam Weinig <sam@webkit.org> 1485 1486 Reviewed by Gavin Barraclough. 1487 1488 Fix crash seen running fast/canvas. 1489 1490 Make sure to mark the ScopeNode and CodeBlock being created 1491 in the re-parse for exception information. 1492 1493 * bytecode/CodeBlock.cpp: 1494 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): 1495 * parser/Nodes.h: 1496 (JSC::ScopeNode::mark): 1497 * runtime/Collector.cpp: 1498 (JSC::Heap::collect): 1499 * runtime/JSGlobalData.cpp: 1500 (JSC::JSGlobalData::JSGlobalData): 1501 * runtime/JSGlobalData.h: 1502 15032009-01-15 Craig Schlenter <craig.schlenter@gmail.com> 1504 1505 Reviewed by Darin Adler. 1506 1507 https://bugs.webkit.org/show_bug.cgi?id=23347 1508 Compilation of JavaScriptCore/wtf/ThreadingPthreads.cpp fails on Linux 1509 1510 * wtf/ThreadingPthreads.cpp: included limits.h as INT_MAX is defined there. 1511 15122009-01-15 Oliver Hunt <oliver@apple.com> 1513 1514 Reviewed by Geoff Garen. 1515 1516 Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com 1517 <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432> 1518 1519 Character position for open and closing brace was incorrectly referencing m_position to 1520 record their position in a source document, however this is unsafe as BOMs may lead to 1521 m_position being an arbitrary position from the real position of the current character. 1522 1523 * parser/Lexer.cpp: 1524 (JSC::Lexer::matchPunctuator): 1525 15262009-01-14 David Kilzer <ddkilzer@apple.com> 1527 1528 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html 1529 1530 <https://bugs.webkit.org/show_bug.cgi?id=23153> 1531 1532 Reviewed by Darin Adler. 1533 1534 Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it 1535 into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html. 1536 1537 Also fixes make-bytecode-docs.pl to actually generate documentation. 1538 1539 * DerivedSources.make: Changed bytecode.html to be built into local docs 1540 directory in ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore. 1541 * JavaScriptCore.xcodeproj/project.pbxproj: Added "/docs" to the end of the 1542 "mkdir -p" command so that the docs subdirectory is automatically created. 1543 * docs/make-bytecode-docs.pl: Changed BEGIN_OPCODE to DEFINE_OPCODE so that 1544 documentation is actually generated. 1545 15462009-01-14 Adam Treat <adam.treat@torchmobile.com> 1547 1548 Build fix for Qt from Dmitry Titov. 1549 1550 * wtf/ThreadingQt.cpp: 1551 (WTF::ThreadCondition::timedWait): 1552 15532009-01-14 Oliver Hunt <oliver@apple.com> 1554 1555 Reviewed by Cameron Zwarich. 1556 1557 Bug 22903: REGRESSION (r36267): visiting this site reliably crashes WebKit nightly 1558 1559 EvalCodeBlock's do not reference the functions that are declared inside the eval 1560 code, this means that simply marking the EvalCodeBlock through the global object 1561 is insufficient to mark the declared functions. This patch corrects this by 1562 explicitly marking the CodeBlocks of all the functions declared in the cached 1563 EvalNode. 1564 1565 * bytecode/CodeBlock.cpp: 1566 (JSC::CodeBlock::mark): 1567 * bytecode/CodeBlock.h: 1568 (JSC::CodeBlock::hasFunctions): 1569 * bytecode/EvalCodeCache.h: 1570 (JSC::EvalCodeCache::mark): 1571 * parser/Nodes.cpp: 1572 (JSC::ScopeNodeData::mark): 1573 (JSC::EvalNode::mark): 1574 * parser/Nodes.h: 1575 15762009-01-14 Dmitry Titov <dimich@chromium.org> 1577 1578 Reviewed by Alexey Proskuryakov. 1579 1580 https://bugs.webkit.org/show_bug.cgi?id=23312 1581 Implement MessageQueue::waitForMessageTimed() 1582 Also fixed ThreadCondition::timedWait() to take absolute time, as discussed on webkit-dev. 1583 Win32 version of timedWait still has to be implemented. 1584 1585 * wtf/MessageQueue.h: 1586 (WTF::MessageQueueWaitResult: new enum for the result of MessageQueue::waitForMessageTimed. 1587 (WTF::MessageQueue::waitForMessage): 1588 (WTF::MessageQueue::waitForMessageTimed): New method. 1589 * wtf/Threading.h: 1590 * wtf/ThreadingGtk.cpp: 1591 (WTF::ThreadCondition::timedWait): changed to use absolute time instead of interval. 1592 * wtf/ThreadingNone.cpp: 1593 (WTF::ThreadCondition::timedWait): ditto. 1594 * wtf/ThreadingPthreads.cpp: 1595 (WTF::ThreadCondition::timedWait): ditto. 1596 * wtf/ThreadingQt.cpp: 1597 (WTF::ThreadCondition::timedWait): ditto. 1598 * wtf/ThreadingWin.cpp: 1599 (WTF::ThreadCondition::timedWait): ditto. The actual Win32 code is still to be implemented. 1600 16012009-01-14 Dean McNamee <deanm@chromium.org> 1602 1603 Reviewed by Darin Adler and Oliver hunt. 1604 1605 Correctly match allocation functions by implementing a custom deref(). 1606 1607 https://bugs.webkit.org/show_bug.cgi?id=23315 1608 1609 * runtime/ByteArray.h: 1610 (JSC::ByteArray::deref): 1611 (JSC::ByteArray::ByteArray): 1612 16132009-01-14 Dan Bernstein <mitz@apple.com> 1614 1615 Reviewed by John Sullivan. 1616 1617 - update copyright 1618 1619 * Info.plist: 1620 16212009-01-13 Beth Dakin <bdakin@apple.com> 1622 1623 Reviewed by Darin Adler and Oliver Hunt. 1624 1625 <rdar://problem/6489314> REGRESSION: Business widget's front side 1626 fails to render correctly when flipping widget 1627 1628 The problem here is that parseInt was parsing NaN as 0. This patch 1629 corrects that by parsing NaN as NaN. This matches our old behavior 1630 and Firefox. 1631 1632 * runtime/JSGlobalObjectFunctions.cpp: 1633 (JSC::globalFuncParseInt): 1634 16352009-01-13 Gavin Barraclough <barraclough@apple.com> 1636 1637 Reviewed by Oliver Hunt. 1638 1639 Fix for: https://bugs.webkit.org/show_bug.cgi?id=23292 1640 1641 Implementation of two argument canDoFastAdditiveOperations does not correlate well with reality. 1642 1643 * runtime/JSImmediate.h: 1644 (JSC::JSFastMath::canDoFastAdditiveOperations): 1645 16462009-01-13 Zalan Bujtas <zbujtas@gmail.com> 1647 1648 Reviewed by Darin Adler. 1649 1650 https://bugs.webkit.org/show_bug.cgi?id=23290 1651 Fix JSImmediate::isImmediate(src) to !src->isCell() 1652 1653 * interpreter/Interpreter.cpp: 1654 (JSC::Interpreter::privateExecute): 1655 16562009-01-13 Dmitry Titov <dimich@chromium.org> 1657 1658 Reviewed by Darin Adler. 1659 1660 https://bugs.webkit.org/show_bug.cgi?id=23281 1661 Fix the Chromium Win build. 1662 Need to use PLATFORM(WIN_OS) instead of PLATFORM(WIN). 1663 Moved GTK and WX up in #if sequence because they could come with WIN_OS too, 1664 while they have their own implementation even on Windows. 1665 1666 * wtf/CurrentTime.cpp: 1667 (WTF::currentTime): 1668 16692009-01-12 Gavin Barraclough <barraclough@apple.com> 1670 1671 Reviewed by Oliver Hunt. 1672 1673 Make the JSImmediate interface private. 1674 1675 All manipulation of JS values should be through the JSValuePtr class, not by using JSImmediate 1676 directly. The key missing methods on JSValuePtr are: 1677 1678 * isCell() - check for values that are JSCell*s, and as such where asCell() may be used. 1679 * isInt32Fast() getInt32Fast() - fast check/access for integer immediates. 1680 * isUInt32Fast() getUInt32Fast() - ditto for unsigned integer immediates. 1681 1682 The JIT is allowed full access to JSImmediate, since it needs to be able to directly 1683 manipulate JSValuePtrs. The Interpreter is provided access to perform operations directly 1684 on JSValuePtrs through the new JSFastMath interface. 1685 1686 No performance impact. 1687 1688 * API/JSCallbackObjectFunctions.h: 1689 (JSC::::toNumber): 1690 * API/JSValueRef.cpp: 1691 (JSValueIsEqual): 1692 (JSValueIsStrictEqual): 1693 * JavaScriptCore.exp: 1694 * bytecode/CodeBlock.h: 1695 (JSC::CodeBlock::isKnownNotImmediate): 1696 * bytecompiler/BytecodeGenerator.cpp: 1697 (JSC::keyForImmediateSwitch): 1698 * bytecompiler/BytecodeGenerator.h: 1699 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue): 1700 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue): 1701 * interpreter/Interpreter.cpp: 1702 (JSC::jsLess): 1703 (JSC::jsLessEq): 1704 (JSC::jsAdd): 1705 (JSC::jsIsObjectType): 1706 (JSC::cachePrototypeChain): 1707 (JSC::Interpreter::tryCachePutByID): 1708 (JSC::Interpreter::tryCacheGetByID): 1709 (JSC::Interpreter::privateExecute): 1710 (JSC::Interpreter::tryCTICachePutByID): 1711 (JSC::Interpreter::tryCTICacheGetByID): 1712 (JSC::Interpreter::cti_op_add): 1713 (JSC::Interpreter::cti_op_get_by_id_self_fail): 1714 (JSC::Interpreter::cti_op_get_by_id_proto_list): 1715 (JSC::Interpreter::cti_op_instanceof): 1716 (JSC::Interpreter::cti_op_mul): 1717 (JSC::Interpreter::cti_op_get_by_val): 1718 (JSC::Interpreter::cti_op_get_by_val_byte_array): 1719 (JSC::Interpreter::cti_op_sub): 1720 (JSC::Interpreter::cti_op_put_by_val): 1721 (JSC::Interpreter::cti_op_put_by_val_array): 1722 (JSC::Interpreter::cti_op_put_by_val_byte_array): 1723 (JSC::Interpreter::cti_op_negate): 1724 (JSC::Interpreter::cti_op_div): 1725 (JSC::Interpreter::cti_op_eq): 1726 (JSC::Interpreter::cti_op_lshift): 1727 (JSC::Interpreter::cti_op_bitand): 1728 (JSC::Interpreter::cti_op_rshift): 1729 (JSC::Interpreter::cti_op_bitnot): 1730 (JSC::Interpreter::cti_op_neq): 1731 (JSC::Interpreter::cti_op_urshift): 1732 (JSC::Interpreter::cti_op_call_eval): 1733 (JSC::Interpreter::cti_op_throw): 1734 (JSC::Interpreter::cti_op_is_undefined): 1735 (JSC::Interpreter::cti_op_stricteq): 1736 (JSC::Interpreter::cti_op_nstricteq): 1737 (JSC::Interpreter::cti_op_switch_imm): 1738 (JSC::Interpreter::cti_vm_throw): 1739 * interpreter/Interpreter.h: 1740 (JSC::Interpreter::isJSArray): 1741 (JSC::Interpreter::isJSString): 1742 (JSC::Interpreter::isJSByteArray): 1743 * jit/JIT.cpp: 1744 (JSC::JIT::compileOpStrictEq): 1745 (JSC::JIT::privateCompileMainPass): 1746 * jit/JIT.h: 1747 (JSC::JIT::isStrictEqCaseHandledInJITCode): 1748 * jit/JITArithmetic.cpp: 1749 (JSC::JIT::compileFastArith_op_rshift): 1750 (JSC::JIT::compileFastArith_op_bitand): 1751 (JSC::JIT::compileFastArith_op_mod): 1752 * jit/JITCall.cpp: 1753 (JSC::JIT::unlinkCall): 1754 (JSC::JIT::compileOpCall): 1755 * jit/JITInlineMethods.h: 1756 (JSC::JIT::getConstantOperandImmediateInt): 1757 (JSC::JIT::isOperandConstantImmediateInt): 1758 * parser/Nodes.cpp: 1759 (JSC::processClauseList): 1760 * runtime/ArrayPrototype.cpp: 1761 (JSC::arrayProtoFuncIndexOf): 1762 (JSC::arrayProtoFuncLastIndexOf): 1763 * runtime/BooleanPrototype.cpp: 1764 (JSC::booleanProtoFuncValueOf): 1765 * runtime/Collector.cpp: 1766 (JSC::Heap::protect): 1767 (JSC::Heap::unprotect): 1768 (JSC::Heap::heap): 1769 * runtime/JSByteArray.cpp: 1770 (JSC::JSByteArray::getOwnPropertySlot): 1771 * runtime/JSByteArray.h: 1772 (JSC::JSByteArray::getIndex): 1773 * runtime/JSCell.cpp: 1774 * runtime/JSCell.h: 1775 (JSC::JSValuePtr::isNumberCell): 1776 (JSC::JSValuePtr::asCell): 1777 (JSC::JSValuePtr::isNumber): 1778 * runtime/JSGlobalObjectFunctions.cpp: 1779 (JSC::globalFuncParseInt): 1780 * runtime/JSImmediate.h: 1781 (JSC::js0): 1782 (JSC::jsImpossibleValue): 1783 (JSC::JSValuePtr::toInt32): 1784 (JSC::JSValuePtr::toUInt32): 1785 (JSC::JSValuePtr::isCell): 1786 (JSC::JSValuePtr::isInt32Fast): 1787 (JSC::JSValuePtr::getInt32Fast): 1788 (JSC::JSValuePtr::isUInt32Fast): 1789 (JSC::JSValuePtr::getUInt32Fast): 1790 (JSC::JSValuePtr::makeInt32Fast): 1791 (JSC::JSValuePtr::areBothInt32Fast): 1792 (JSC::JSFastMath::canDoFastBitwiseOperations): 1793 (JSC::JSFastMath::equal): 1794 (JSC::JSFastMath::notEqual): 1795 (JSC::JSFastMath::andImmediateNumbers): 1796 (JSC::JSFastMath::xorImmediateNumbers): 1797 (JSC::JSFastMath::orImmediateNumbers): 1798 (JSC::JSFastMath::canDoFastRshift): 1799 (JSC::JSFastMath::canDoFastUrshift): 1800 (JSC::JSFastMath::rightShiftImmediateNumbers): 1801 (JSC::JSFastMath::canDoFastAdditiveOperations): 1802 (JSC::JSFastMath::addImmediateNumbers): 1803 (JSC::JSFastMath::subImmediateNumbers): 1804 (JSC::JSFastMath::incImmediateNumber): 1805 (JSC::JSFastMath::decImmediateNumber): 1806 * runtime/JSNumberCell.h: 1807 (JSC::JSValuePtr::asNumberCell): 1808 (JSC::jsNumber): 1809 (JSC::JSValuePtr::uncheckedGetNumber): 1810 (JSC::JSNumberCell::toInt32): 1811 (JSC::JSNumberCell::toUInt32): 1812 (JSC::JSValuePtr::toJSNumber): 1813 (JSC::JSValuePtr::getNumber): 1814 (JSC::JSValuePtr::numberToInt32): 1815 (JSC::JSValuePtr::numberToUInt32): 1816 * runtime/JSObject.h: 1817 (JSC::JSValuePtr::isObject): 1818 (JSC::JSValuePtr::get): 1819 (JSC::JSValuePtr::put): 1820 * runtime/JSValue.cpp: 1821 (JSC::JSValuePtr::toInteger): 1822 (JSC::JSValuePtr::toIntegerPreserveNaN): 1823 * runtime/JSValue.h: 1824 * runtime/Operations.cpp: 1825 (JSC::JSValuePtr::equalSlowCase): 1826 (JSC::JSValuePtr::strictEqualSlowCase): 1827 * runtime/Operations.h: 1828 (JSC::JSValuePtr::equal): 1829 (JSC::JSValuePtr::equalSlowCaseInline): 1830 (JSC::JSValuePtr::strictEqual): 1831 (JSC::JSValuePtr::strictEqualSlowCaseInline): 1832 * runtime/Protect.h: 1833 (JSC::gcProtect): 1834 (JSC::gcUnprotect): 1835 * runtime/StringPrototype.cpp: 1836 (JSC::stringProtoFuncCharAt): 1837 (JSC::stringProtoFuncCharCodeAt): 1838 * runtime/Structure.cpp: 1839 (JSC::Structure::createCachedPrototypeChain): 1840 18412009-01-12 Kevin Ollivier <kevino@theolliviers.com> 1842 1843 Since date time functions have moved here, now the wx port JSC 1844 needs to depend on wx. 1845 1846 * jscore.bkl: 1847 18482009-01-11 David Levin <levin@chromium.org> 1849 1850 Reviewed by Darin Adler. 1851 1852 https://bugs.webkit.org/show_bug.cgi?id=23245 1853 1854 Add initializeThreading to key places in JS API to ensure that 1855 UString is properly initialized. 1856 1857 * API/JSContextRef.cpp: 1858 (JSContextGroupCreate): 1859 (JSGlobalContextCreate): 1860 * API/JSObjectRef.cpp: 1861 (JSClassCreate): 1862 * API/JSStringRef.cpp: 1863 (JSStringCreateWithCharacters): 1864 (JSStringCreateWithUTF8CString): 1865 * API/JSStringRefCF.cpp: 1866 (JSStringCreateWithCFString): 1867 18682009-01-11 David Levin <levin@chromium.org> 1869 1870 Reviewed by Darin Adler. 1871 1872 https://bugs.webkit.org/show_bug.cgi?id=23175 1873 1874 Separate out BaseString information from UString::Rep and make all baseString access go through 1875 a member function, so that it may be used for something else (in the future) in the BaseString 1876 case. 1877 1878 * runtime/SmallStrings.cpp: 1879 (JSC::SmallStringsStorage::rep): 1880 (JSC::SmallStringsStorage::SmallStringsStorage): 1881 (JSC::SmallStrings::SmallStrings): 1882 (JSC::SmallStrings::mark): 1883 Adjust to account for the changes in UString and put the UString in place in 1884 SmallStringsStorage to aid in locality of reference among the UChar[] and UString::Rep's. 1885 1886 * runtime/SmallStrings.h: 1887 * runtime/UString.cpp: 1888 (JSC::initializeStaticBaseString): 1889 (JSC::initializeUString): 1890 (JSC::UString::Rep::create): 1891 (JSC::UString::Rep::destroy): 1892 (JSC::UString::Rep::checkConsistency): 1893 (JSC::expandCapacity): 1894 (JSC::UString::expandPreCapacity): 1895 (JSC::concatenate): 1896 (JSC::UString::append): 1897 (JSC::UString::operator=): 1898 * runtime/UString.h: 1899 (JSC::UString::Rep::baseIsSelf): 1900 (JSC::UString::Rep::setBaseString): 1901 (JSC::UString::Rep::baseString): 1902 (JSC::UString::Rep::): 1903 (JSC::UString::Rep::null): 1904 (JSC::UString::Rep::empty): 1905 (JSC::UString::Rep::data): 1906 (JSC::UString::cost): 1907 Separate out the items out used by base strings from those used in Rep's that only 1908 point to base strings. (This potentially saves 24 bytes per Rep.) 1909 19102009-01-11 Darin Adler <darin@apple.com> 1911 1912 Reviewed by Dan Bernstein. 1913 1914 Bug 23239: improve handling of unused arguments in JavaScriptCore 1915 https://bugs.webkit.org/show_bug.cgi?id=23239 1916 1917 * runtime/DatePrototype.cpp: Moved LocaleDateTimeFormat enum outside #if 1918 so we can use this on all platforms. Changed valueOf to share the same 1919 function with getTime, since the contents of the two are identical. Removed 1920 a FIXME since the idea isn't really specific enough or helpful enough to 1921 need to sit here in the source code. 1922 (JSC::formatLocaleDate): Changed the Mac version of this function to take 1923 the same arguments as the non-Mac version so the caller doesn't have to 1924 special-case the two platforms. Also made the formatString array be const; 1925 before the characters were, but the array was a modifiable global variable. 1926 (JSC::dateProtoFuncToLocaleString): Changed to call the new unified 1927 version of formatLocaleDate and remove the ifdef. 1928 (JSC::dateProtoFuncToLocaleDateString): Ditto. 1929 (JSC::dateProtoFuncToLocaleTimeString): Ditto. 1930 1931 * runtime/JSNotAnObject.cpp: 1932 (JSC::JSNotAnObject::toObject): Use the new ASSERT_UNUSED instead of the 1933 old UNUSED_PARAM. 1934 1935 * runtime/RegExp.cpp: 1936 (JSC::RegExp::RegExp): Changed to only use UNUSED_PARAM when the parameter 1937 is actually unused. 1938 1939 * wtf/TCSystemAlloc.cpp: 1940 (TCMalloc_SystemRelease): Changed to only use UNUSED_PARAM when the parameter 1941 is actually unused. 1942 (TCMalloc_SystemCommit): Changed to omit the argument names instead of using 1943 UNUSED_PARAM. 1944 19452009-01-11 Oliver Hunt <oliver@apple.com> 1946 1947 Reviewed by NOBODY (Build fix). 1948 1949 Fix the build (whoops) 1950 1951 * interpreter/Interpreter.cpp: 1952 (JSC::Interpreter::cti_op_get_by_val): 1953 19542009-01-11 Oliver Hunt <oliver@apple.com> 1955 1956 Reviewed by Darin Adler and Anders Carlsson 1957 1958 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray 1959 1960 Restructure the code slightly, and add comments per Darin's suggestions 1961 1962 * interpreter/Interpreter.cpp: 1963 (JSC::Interpreter::cti_op_get_by_val): 1964 (JSC::Interpreter::cti_op_get_by_val_byte_array): 1965 (JSC::Interpreter::cti_op_put_by_val): 1966 (JSC::Interpreter::cti_op_put_by_val_byte_array): 1967 19682009-01-11 Oliver Hunt <oliver@apple.com> 1969 1970 Reviewed by Anders Carlsson. 1971 1972 Whoops, I accidentally removed an exception check from fast the 1973 fast path for string indexing when i originally landed the 1974 byte array logic. 1975 1976 * interpreter/Interpreter.cpp: 1977 (JSC::Interpreter::cti_op_get_by_val): 1978 19792009-01-11 Oliver Hunt <oliver@apple.com> 1980 1981 Reviewed by Anders Carlsson. 1982 1983 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray 1984 <https://bugs.webkit.org/show_bug.cgi?id=23128> 1985 1986 Fairly simple patch, add specialised versions of cti_op_get/put_by_val 1987 that assume ByteArray, thus avoiding a few branches in the case of bytearray 1988 manipulation. 1989 1990 No effect on SunSpider. 15% win on the original testcase. 1991 1992 * interpreter/Interpreter.cpp: 1993 (JSC::Interpreter::cti_op_get_by_val): 1994 (JSC::Interpreter::cti_op_get_by_val_byte_array): 1995 (JSC::Interpreter::cti_op_put_by_val): 1996 (JSC::Interpreter::cti_op_put_by_val_byte_array): 1997 * interpreter/Interpreter.h: 1998 19992009-01-11 Alexey Proskuryakov <ap@webkit.org> 2000 2001 Try to fix Windows build. 2002 2003 * wtf/CurrentTime.cpp: Added a definition of msPerSecond (previously, this code was in 2004 DateMath.cpp, with constant definition in DateTime.h) 2005 20062009-01-11 Alexey Proskuryakov <ap@webkit.org> 2007 2008 Try to fix Windows build. 2009 2010 * wtf/CurrentTime.cpp: Include <sys/types.h> and <sys/timeb.h>, as MSDN says to. 2011 20122009-01-11 Dmitry Titov <dimich@chromium.org> 2013 2014 Reviewed by Darin Adler. 2015 2016 https://bugs.webkit.org/show_bug.cgi?id=23207 2017 Moved currentTime() to from WebCore to WTF. 2018 2019 * GNUmakefile.am: 2020 * JavaScriptCore.exp: added export for WTF::currentTime() 2021 * JavaScriptCore.pri: 2022 * JavaScriptCore.scons: 2023 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 2024 * JavaScriptCore.xcodeproj/project.pbxproj: 2025 * JavaScriptCoreSources.bkl: 2026 * runtime/DateMath.cpp: 2027 (JSC::getCurrentUTCTimeWithMicroseconds): This function had another implementation of currentTime(), essentially. Now uses WTF version. 2028 * wtf/CurrentTime.cpp: Added. 2029 (WTF::currentTime): 2030 (WTF::highResUpTime): 2031 (WTF::lowResUTCTime): 2032 (WTF::qpcAvailable): 2033 * wtf/CurrentTime.h: Added. 2034 20352009-01-09 Gavin Barraclough <barraclough@apple.com> 2036 2037 Reviewed by Oliver Hunt. 2038 2039 Stage two of converting JSValue from a pointer to a class type. 2040 Remove the class JSValue. The functionallity has been transitioned 2041 into the wrapper class type JSValuePtr. 2042 2043 The last stage will be to rename JSValuePtr to JSValue, remove the 2044 overloaded -> operator, and switch operations on JSValuePtrs from 2045 using '->' to use '.' instead. 2046 2047 * API/APICast.h: 2048 * JavaScriptCore.exp: 2049 * runtime/JSCell.h: 2050 (JSC::asCell): 2051 (JSC::JSValuePtr::asCell): 2052 (JSC::JSValuePtr::isNumber): 2053 (JSC::JSValuePtr::isString): 2054 (JSC::JSValuePtr::isGetterSetter): 2055 (JSC::JSValuePtr::isObject): 2056 (JSC::JSValuePtr::getNumber): 2057 (JSC::JSValuePtr::getString): 2058 (JSC::JSValuePtr::getObject): 2059 (JSC::JSValuePtr::getCallData): 2060 (JSC::JSValuePtr::getConstructData): 2061 (JSC::JSValuePtr::getUInt32): 2062 (JSC::JSValuePtr::getTruncatedInt32): 2063 (JSC::JSValuePtr::getTruncatedUInt32): 2064 (JSC::JSValuePtr::mark): 2065 (JSC::JSValuePtr::marked): 2066 (JSC::JSValuePtr::toPrimitive): 2067 (JSC::JSValuePtr::getPrimitiveNumber): 2068 (JSC::JSValuePtr::toBoolean): 2069 (JSC::JSValuePtr::toNumber): 2070 (JSC::JSValuePtr::toString): 2071 (JSC::JSValuePtr::toObject): 2072 (JSC::JSValuePtr::toThisObject): 2073 (JSC::JSValuePtr::needsThisConversion): 2074 (JSC::JSValuePtr::toThisString): 2075 (JSC::JSValuePtr::getJSNumber): 2076 * runtime/JSImmediate.h: 2077 (JSC::JSValuePtr::isUndefined): 2078 (JSC::JSValuePtr::isNull): 2079 (JSC::JSValuePtr::isUndefinedOrNull): 2080 (JSC::JSValuePtr::isBoolean): 2081 (JSC::JSValuePtr::getBoolean): 2082 (JSC::JSValuePtr::toInt32): 2083 (JSC::JSValuePtr::toUInt32): 2084 * runtime/JSNumberCell.h: 2085 (JSC::JSValuePtr::uncheckedGetNumber): 2086 (JSC::JSValuePtr::toJSNumber): 2087 * runtime/JSObject.h: 2088 (JSC::JSValuePtr::isObject): 2089 (JSC::JSValuePtr::get): 2090 (JSC::JSValuePtr::put): 2091 * runtime/JSString.h: 2092 (JSC::JSValuePtr::toThisJSString): 2093 * runtime/JSValue.cpp: 2094 (JSC::JSValuePtr::toInteger): 2095 (JSC::JSValuePtr::toIntegerPreserveNaN): 2096 (JSC::JSValuePtr::toInt32SlowCase): 2097 (JSC::JSValuePtr::toUInt32SlowCase): 2098 * runtime/JSValue.h: 2099 (JSC::JSValuePtr::makeImmediate): 2100 (JSC::JSValuePtr::immediateValue): 2101 (JSC::JSValuePtr::JSValuePtr): 2102 (JSC::JSValuePtr::operator->): 2103 (JSC::JSValuePtr::operator bool): 2104 (JSC::JSValuePtr::operator==): 2105 (JSC::JSValuePtr::operator!=): 2106 (JSC::JSValuePtr::encode): 2107 (JSC::JSValuePtr::decode): 2108 (JSC::JSValuePtr::toFloat): 2109 (JSC::JSValuePtr::asValue): 2110 (JSC::operator==): 2111 (JSC::operator!=): 2112 21132009-01-09 David Levin <levin@chromium.org> 2114 2115 Reviewed by Oliver Hunt. 2116 2117 https://bugs.webkit.org/show_bug.cgi?id=23175 2118 2119 Adjustment to previous patch. Remove call to initilizeThreading from JSGlobalCreate 2120 and fix jsc.cpp instead. 2121 2122 * jsc.cpp: 2123 (main): 2124 (jscmain): 2125 * runtime/JSGlobalData.cpp: 2126 (JSC::JSGlobalData::create): 2127 21282009-01-09 Sam Weinig <sam@webkit.org> 2129 2130 Roll r39720 back in with a working interpreted mode. 2131 21322009-01-09 David Levin <levin@chromium.org> 2133 2134 Reviewed by Oliver Hunt. 2135 2136 https://bugs.webkit.org/show_bug.cgi?id=23175 2137 2138 Added a template to make the pointer and flags combination 2139 in UString more readable and less error prone. 2140 2141 * GNUmakefile.am: 2142 * JavaScriptCore.exp: 2143 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 2144 * JavaScriptCore.xcodeproj/project.pbxproj: 2145 Added PtrAndFlags.h (and sorted the xcode project file). 2146 2147 * runtime/Identifier.cpp: 2148 (JSC::Identifier::add): 2149 (JSC::Identifier::addSlowCase): 2150 * runtime/InitializeThreading.cpp: 2151 (JSC::initializeThreadingOnce): 2152 Made the init threading initialize the UString globals. Before 2153 these were initilized using {} but that became harder due to the 2154 addition of this tempalte class. 2155 2156 * runtime/JSGlobalData.cpp: 2157 (JSC::JSGlobalData::create): 2158 * runtime/PropertyNameArray.cpp: 2159 (JSC::PropertyNameArray::add): 2160 * runtime/UString.cpp: 2161 (JSC::initializeStaticBaseString): 2162 (JSC::initializeUString): 2163 (JSC::UString::Rep::create): 2164 (JSC::UString::Rep::createFromUTF8): 2165 (JSC::createRep): 2166 (JSC::UString::UString): 2167 (JSC::concatenate): 2168 (JSC::UString::operator=): 2169 (JSC::UString::makeNull): 2170 (JSC::UString::nullRep): 2171 * runtime/UString.h: 2172 (JSC::UString::Rep::identifierTable): 2173 (JSC::UString::Rep::setIdentifierTable): 2174 (JSC::UString::Rep::isStatic): 2175 (JSC::UString::Rep::setStatic): 2176 (JSC::UString::Rep::): 2177 (JSC::UString::Rep::null): 2178 (JSC::UString::Rep::empty): 2179 (JSC::UString::isNull): 2180 (JSC::UString::null): 2181 (JSC::UString::UString): 2182 2183 * wtf/PtrAndFlags.h: Added. 2184 (WTF::PtrAndFlags::PtrAndFlags): 2185 (WTF::PtrAndFlags::isFlagSet): 2186 (WTF::PtrAndFlags::setFlag): 2187 (WTF::PtrAndFlags::clearFlag): 2188 (WTF::PtrAndFlags::get): 2189 (WTF::PtrAndFlags::set): 2190 A simple way to layer together a pointer and 2 flags. It relies on the pointer being 4 byte aligned, 2191 which should happen for all allocators (due to aligning pointers, int's, etc. on 4 byte boundaries). 2192 21932009-01-08 Gavin Barraclough <barraclough@apple.com> 2194 2195 Reviewed by -O-l-i-v-e-r- -H-u-n-t- Sam Weinig (sorry, Sam!). 2196 2197 Encode immediates in the low word of JSValuePtrs, on x86-64. 2198 2199 On 32-bit platforms a JSValuePtr may represent a 31-bit signed integer. 2200 On 64-bit platforms, if USE(ALTERNATE_JSIMMEDIATE) is defined, a full 2201 32-bit integer may be stored in an immediate. 2202 2203 Presently USE(ALTERNATE_JSIMMEDIATE) uses the same encoding as the default 2204 immediate format - the value is left shifted by one, so a one bit tag can 2205 be added to indicate the value is an immediate. However this means that 2206 values must be commonly be detagged (by right shifting by one) before 2207 arithmetic operations can be performed on immediates. This patch modifies 2208 the formattting so the the high bits of the immediate mark values as being 2209 integer. 2210 2211 * assembler/MacroAssembler.h: 2212 (JSC::MacroAssembler::not32): 2213 (JSC::MacroAssembler::orPtr): 2214 (JSC::MacroAssembler::zeroExtend32ToPtr): 2215 (JSC::MacroAssembler::jaePtr): 2216 (JSC::MacroAssembler::jbPtr): 2217 (JSC::MacroAssembler::jnzPtr): 2218 (JSC::MacroAssembler::jzPtr): 2219 * assembler/X86Assembler.h: 2220 (JSC::X86Assembler::): 2221 (JSC::X86Assembler::notl_r): 2222 (JSC::X86Assembler::testq_i32r): 2223 * jit/JIT.cpp: 2224 (JSC::JIT::privateCompileMainPass): 2225 (JSC::JIT::privateCompileSlowCases): 2226 (JSC::JIT::privateCompileCTIMachineTrampolines): 2227 * jit/JIT.h: 2228 * jit/JITArithmetic.cpp: 2229 (JSC::JIT::compileFastArith_op_lshift): 2230 (JSC::JIT::compileFastArith_op_rshift): 2231 (JSC::JIT::compileFastArith_op_bitand): 2232 (JSC::JIT::compileFastArithSlow_op_bitand): 2233 (JSC::JIT::compileFastArith_op_mod): 2234 (JSC::JIT::compileFastArithSlow_op_mod): 2235 (JSC::JIT::compileFastArith_op_add): 2236 (JSC::JIT::compileFastArith_op_mul): 2237 (JSC::JIT::compileFastArith_op_post_inc): 2238 (JSC::JIT::compileFastArith_op_post_dec): 2239 (JSC::JIT::compileFastArith_op_pre_inc): 2240 (JSC::JIT::compileFastArith_op_pre_dec): 2241 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate): 2242 (JSC::JIT::compileBinaryArithOp): 2243 * jit/JITCall.cpp: 2244 (JSC::JIT::compileOpCallSlowCase): 2245 * jit/JITInlineMethods.h: 2246 (JSC::JIT::emitJumpIfJSCell): 2247 (JSC::JIT::emitJumpIfNotJSCell): 2248 (JSC::JIT::emitJumpIfImmNum): 2249 (JSC::JIT::emitJumpSlowCaseIfNotImmNum): 2250 (JSC::JIT::emitJumpSlowCaseIfNotImmNums): 2251 (JSC::JIT::emitFastArithDeTagImmediate): 2252 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): 2253 (JSC::JIT::emitFastArithReTagImmediate): 2254 (JSC::JIT::emitFastArithImmToInt): 2255 (JSC::JIT::emitFastArithIntToImmNoCheck): 2256 (JSC::JIT::emitTagAsBoolImmediate): 2257 * jit/JITPropertyAccess.cpp: 2258 (JSC::resizePropertyStorage): 2259 (JSC::JIT::privateCompilePutByIdTransition): 2260 (JSC::JIT::privateCompilePatchGetArrayLength): 2261 (JSC::JIT::privateCompileGetByIdSelf): 2262 (JSC::JIT::privateCompileGetByIdProto): 2263 (JSC::JIT::privateCompileGetByIdChain): 2264 (JSC::JIT::privateCompilePutByIdReplace): 2265 * runtime/JSImmediate.h: 2266 (JSC::JSImmediate::isNumber): 2267 (JSC::JSImmediate::isPositiveNumber): 2268 (JSC::JSImmediate::areBothImmediateNumbers): 2269 (JSC::JSImmediate::xorImmediateNumbers): 2270 (JSC::JSImmediate::rightShiftImmediateNumbers): 2271 (JSC::JSImmediate::canDoFastAdditiveOperations): 2272 (JSC::JSImmediate::addImmediateNumbers): 2273 (JSC::JSImmediate::subImmediateNumbers): 2274 (JSC::JSImmediate::makeInt): 2275 (JSC::JSImmediate::toBoolean): 2276 * wtf/Platform.h: 2277 22782009-01-08 Sam Weinig <sam@webkit.org> 2279 2280 Revert r39720. It broke Interpreted mode. 2281 22822009-01-08 Sam Weinig <sam@webkit.org> 2283 2284 Reviewed by Oliver Hunt. 2285 2286 Fix for https://bugs.webkit.org/show_bug.cgi?id=23197 2287 Delay creating the PCVector until an exception is thrown 2288 Part of <rdar://problem/6469060> 2289 Don't store exception information for a CodeBlock until first exception is thrown 2290 2291 - Change the process for re-parsing/re-generating bytecode for exception information 2292 to use data from the original CodeBlock (offsets of GlobalResolve instructions) to 2293 aid in creating an identical instruction stream on re-parse, instead of padding 2294 interchangeable opcodes, which would result in different JITed code. 2295 - Fix bug where the wrong ScopeChainNode was used when re-parsing/regenerating from 2296 within some odd modified scope chains. 2297 - Lazily create the pcVector by re-JITing the regenerated CodeBlock and stealing the 2298 the pcVector from it. 2299 2300 Saves ~2MB on Membuster head. 2301 2302 * bytecode/CodeBlock.cpp: 2303 (JSC::CodeBlock::dump): 2304 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): 2305 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset): 2306 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset): 2307 * bytecode/CodeBlock.h: 2308 (JSC::JITCodeRef::JITCodeRef): 2309 (JSC::GlobalResolveInfo::GlobalResolveInfo): 2310 (JSC::CodeBlock::getBytecodeIndex): 2311 (JSC::CodeBlock::addGlobalResolveInstruction): 2312 (JSC::CodeBlock::addGlobalResolveInfo): 2313 (JSC::CodeBlock::addFunctionRegisterInfo): 2314 (JSC::CodeBlock::hasExceptionInfo): 2315 (JSC::CodeBlock::pcVector): 2316 (JSC::EvalCodeBlock::EvalCodeBlock): 2317 (JSC::EvalCodeBlock::baseScopeDepth): 2318 * bytecode/Opcode.h: 2319 * bytecompiler/BytecodeGenerator.cpp: 2320 (JSC::BytecodeGenerator::BytecodeGenerator): 2321 (JSC::BytecodeGenerator::emitResolve): 2322 (JSC::BytecodeGenerator::emitGetScopedVar): 2323 * bytecompiler/BytecodeGenerator.h: 2324 (JSC::BytecodeGenerator::setRegeneratingForExceptionInfo): 2325 * interpreter/Interpreter.cpp: 2326 (JSC::bytecodeOffsetForPC): 2327 (JSC::Interpreter::unwindCallFrame): 2328 (JSC::Interpreter::privateExecute): 2329 (JSC::Interpreter::retrieveLastCaller): 2330 (JSC::Interpreter::cti_op_instanceof): 2331 (JSC::Interpreter::cti_op_call_NotJSFunction): 2332 (JSC::Interpreter::cti_op_resolve): 2333 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 2334 (JSC::Interpreter::cti_op_resolve_func): 2335 (JSC::Interpreter::cti_op_resolve_skip): 2336 (JSC::Interpreter::cti_op_resolve_global): 2337 (JSC::Interpreter::cti_op_resolve_with_base): 2338 (JSC::Interpreter::cti_op_throw): 2339 (JSC::Interpreter::cti_op_in): 2340 (JSC::Interpreter::cti_vm_throw): 2341 * jit/JIT.cpp: 2342 (JSC::JIT::privateCompile): 2343 * parser/Nodes.cpp: 2344 (JSC::EvalNode::generateBytecode): 2345 (JSC::EvalNode::bytecodeForExceptionInfoReparse): 2346 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): 2347 * parser/Nodes.h: 2348 23492009-01-08 Jian Li <jianli@chromium.org> 2350 2351 Reviewed by Alexey Proskuryakov. 2352 2353 Add Win32 implementation of ThreadSpecific. 2354 https://bugs.webkit.org/show_bug.cgi?id=22614 2355 2356 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 2357 * wtf/ThreadSpecific.h: 2358 (WTF::ThreadSpecific::ThreadSpecific): 2359 (WTF::ThreadSpecific::~ThreadSpecific): 2360 (WTF::ThreadSpecific::get): 2361 (WTF::ThreadSpecific::set): 2362 (WTF::ThreadSpecific::destroy): 2363 * wtf/ThreadSpecificWin.cpp: Added. 2364 (WTF::ThreadSpecificThreadExit): 2365 * wtf/ThreadingWin.cpp: 2366 (WTF::wtfThreadEntryPoint): 2367 23682009-01-08 Justin McPherson <justin.mcpherson@nokia.com> 2369 2370 Reviewed by Simon Hausmann. 2371 2372 Fix compilation with Qt on NetBSD. 2373 2374 * runtime/Collector.cpp: 2375 (JSC::currentThreadStackBase): Use PLATFORM(NETBSD) to enter the 2376 code path to retrieve the stack base using pthread_attr_get_np. 2377 The PTHREAD_NP_H define is not used because the header file does 2378 not exist on NetBSD, but the function is declared nevertheless. 2379 * wtf/Platform.h: Introduce WTF_PLATFORM_NETBSD. 2380 23812009-01-07 Sam Weinig <sam@webkit.org> 2382 2383 Reviewed by Geoffrey Garen. 2384 2385 <rdar://problem/6469060> Don't store exception information for a CodeBlock until first exception is thrown 2386 2387 Don't initially store exception information (lineNumber/expressionRange/getByIdExcecptionInfo) 2388 in CodeBlocks blocks. Instead, re-parse for the data on demand and cache it then. 2389 2390 One important change that was needed to make this work was to pad op_get_global_var with nops to 2391 be the same length as op_resolve_global, since one could be replaced for the other on re-parsing, 2392 and we want to keep the offsets bytecode offsets the same. 2393 2394 1.3MB improvement on Membuster head. 2395 2396 * bytecode/CodeBlock.cpp: 2397 (JSC::CodeBlock::dump): Update op_get_global_var to account for the padding. 2398 (JSC::CodeBlock::dumpStatistics): Add more statistic dumping. 2399 (JSC::CodeBlock::CodeBlock): Initialize m_exceptionInfo. 2400 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): Re-parses the CodeBlocks 2401 associated SourceCode and steals the ExceptionInfo from it. 2402 (JSC::CodeBlock::lineNumberForBytecodeOffset): Creates the exception info on demand. 2403 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto. 2404 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto. 2405 * bytecode/CodeBlock.h: 2406 (JSC::CodeBlock::numberOfExceptionHandlers): Updated to account for m_exceptionInfo indirection. 2407 (JSC::CodeBlock::addExceptionHandler): Ditto. 2408 (JSC::CodeBlock::exceptionHandler): Ditto. 2409 (JSC::CodeBlock::clearExceptionInfo): Ditto. 2410 (JSC::CodeBlock::addExpressionInfo): Ditto. 2411 (JSC::CodeBlock::addGetByIdExceptionInfo): Ditto. 2412 (JSC::CodeBlock::numberOfLineInfos): Ditto. 2413 (JSC::CodeBlock::addLineInfo): Ditto. 2414 (JSC::CodeBlock::lastLineInfo): Ditto. 2415 2416 * bytecode/Opcode.h: Change length of op_get_global_var to match op_resolve_global. 2417 2418 * bytecode/SamplingTool.cpp: 2419 (JSC::SamplingTool::dump): Add comment indicating why it is okay not to pass a CallFrame. 2420 2421 * bytecompiler/BytecodeGenerator.cpp: 2422 (JSC::BytecodeGenerator::generate): Clear the exception info after generation for Function and Eval 2423 Code when not in regenerate for exception info mode. 2424 (JSC::BytecodeGenerator::BytecodeGenerator): Initialize m_regeneratingForExceptionInfo to false. 2425 (JSC::BytecodeGenerator::emitGetScopedVar): Pad op_get_global_var with 2 nops. 2426 * bytecompiler/BytecodeGenerator.h: 2427 (JSC::BytecodeGenerator::setRegeneratingForExcpeptionInfo): Added. 2428 2429 * interpreter/Interpreter.cpp: 2430 (JSC::Interpreter::throwException): Pass the CallFrame to exception info accessors. 2431 (JSC::Interpreter::privateExecute): Ditto. 2432 (JSC::Interpreter::retrieveLastCaller): Ditto. 2433 (JSC::Interpreter::cti_op_new_error): Ditto. 2434 2435 * jit/JIT.cpp: 2436 (JSC::JIT::privateCompileMainPass): Pass the current bytecode offset instead of hard coding the 2437 line number, the stub will do the accessing if it gets called. 2438 2439 * parser/Nodes.cpp: 2440 (JSC::ProgramNode::emitBytecode): Moved. 2441 (JSC::ProgramNode::generateBytecode): Moved. 2442 (JSC::EvalNode::create): Moved. 2443 (JSC::EvalNode::bytecodeForExceptionInfoReparse): Added. 2444 (JSC::FunctionBodyNode::generateBytecode): Rename reparse to reparseInPlace. 2445 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): Addded. 2446 2447 * parser/Nodes.h: 2448 (JSC::ScopeNode::features): Added getter. 2449 * parser/Parser.cpp: 2450 (JSC::Parser::reparseInPlace): Renamed from reparse. 2451 * parser/Parser.h: 2452 (JSC::Parser::reparse): Added. Re-parses the passed in Node into 2453 a new Node. 2454 * runtime/ExceptionHelpers.cpp: 2455 (JSC::createUndefinedVariableError): Pass along CallFrame. 2456 (JSC::createInvalidParamError): Ditto. 2457 (JSC::createNotAConstructorError): Ditto. 2458 (JSC::createNotAFunctionError): Ditto. 2459 (JSC::createNotAnObjectError): Ditto. 2460 24612009-01-06 Gavin Barraclough <baraclough@apple.com> 2462 2463 Reviewed by Maciej Stachowiak. 2464 2465 Replace accidentally removed references in BytecodeGenerator, deleting these 2466 will be hindering the sharing of constant numbers and strings. 2467 2468 The code to add a new constant (either number or string) to their respective 2469 map works by attempting to add a null entry, then checking the result of the 2470 add for null. The first time, this should return the null (or noValue). 2471 The code checks for null (to see if this is the initial add), and then allocates 2472 a new number / string object. This code relies on the result returned from 2473 the add to the map being stored as a reference, such that the allocated object 2474 will be stored in the map, and will be resused if the same constant is encountered 2475 again. By failing to use a reference we will be leaking GC object for each 2476 additional entry added to the map. As GC objects they should be clollected, 2477 be we should no be allocatin them in the first place. 2478 2479 https://bugs.webkit.org/show_bug.cgi?id=23158 2480 2481 * bytecompiler/BytecodeGenerator.cpp: 2482 (JSC::BytecodeGenerator::emitLoad): 2483 24842009-01-06 Oliver Hunt <oliver@apple.com> 2485 2486 Reviewed by Gavin Barraclough. 2487 2488 <rdar://problem/6040850> JavaScript register file should use VirtualAlloc on Windows 2489 2490 Fairly simple, just reserve 4Mb of address space for the 2491 register file, and then commit one section at a time. We 2492 don't release committed memory as we drop back, but then 2493 mac doesn't either so this probably not too much of a 2494 problem. 2495 2496 * interpreter/RegisterFile.cpp: 2497 (JSC::RegisterFile::~RegisterFile): 2498 * interpreter/RegisterFile.h: 2499 (JSC::RegisterFile::RegisterFile): 2500 (JSC::RegisterFile::grow): 2501 25022009-01-06 Alexey Proskuryakov <ap@webkit.org> 2503 2504 Reviewed by Darin Adler. 2505 2506 https://bugs.webkit.org/show_bug.cgi?id=23142 2507 ThreadGlobalData leaks seen on buildbot 2508 2509 * wtf/ThreadSpecific.h: (WTF::ThreadSpecific::destroy): Temporarily reset the thread 2510 specific value to make getter work on Mac OS X. 2511 2512 * wtf/Platform.h: Touch this file again to make sure all Windows builds use the most recent 2513 version of ThreadSpecific.h. 2514 25152009-01-05 Gavin Barraclough <baraclough@apple.com> 2516 2517 Reviewed by Oliver Hunt. 2518 2519 Replace all uses of JSValue* with a new smart pointer type, JSValuePtr. 2520 2521 A JavaScript value may be a heap object or boxed primitive, represented by a 2522 pointer, or may be an unboxed immediate value, such as an integer. Since a 2523 value may dynamically need to contain either a pointer value or an immediate, 2524 we encode immediates as pointer values (since all valid JSCell pointers are 2525 allocated at alligned addesses, unaligned addresses are available to encode 2526 immediates). As such all JavaScript values are represented using a JSValue*. 2527 2528 This implementation is encumbered by a number of constraints. It ties the 2529 JSValue representation to the size of pointer on the platform, which, for 2530 example, means that we currently can represent different ranges of integers 2531 as immediates on x86 and x86-64. It also prevents us from overloading the 2532 to-boolean conversion used to test for noValue() - effectively forcing us 2533 to represent noValue() as 0. This would potentially be problematic were we 2534 to wish to encode integer values differently (e.g. were we to use the v8 2535 encoding, where pointers are tagged with 1 and integers with 0, then the 2536 immediate integer 0 would conflict with noValue()). 2537 2538 This patch replaces all usage of JSValue* with a new class, JSValuePtr, 2539 which encapsulates the pointer. JSValuePtr maintains the same interface as 2540 JSValue*, overloading operator-> and operator bool such that previous 2541 operations in the code on variables of type JSValue* are still supported. 2542 2543 In order to provide a ProtectPtr<> type with support for the new value 2544 representation (without using the internal JSValue type directly), a new 2545 ProtectJSValuePtr type has been added, equivalent to the previous type 2546 ProtectPtr<JSValue>. 2547 2548 This patch is likely the first in a sequence of three changes. With the 2549 value now encapsulated it will likely make sense to migrate the functionality 2550 from JSValue into JSValuePtr, such that the internal pointer representation 2551 need not be exposed. Through migrating the functionality to the wrapper 2552 class the existing JSValue should be rendered redundant, and the class is 2553 likely to be removed (the JSValuePtr now wrapping a pointer to a JSCell). 2554 At this stage it will likely make sense to rename JSValuePtr to JSValue. 2555 2556 https://bugs.webkit.org/show_bug.cgi?id=23114 2557 2558 * API/APICast.h: 2559 (toJS): 2560 (toRef): 2561 * API/JSBase.cpp: 2562 (JSEvaluateScript): 2563 * API/JSCallbackConstructor.h: 2564 (JSC::JSCallbackConstructor::createStructure): 2565 * API/JSCallbackFunction.cpp: 2566 (JSC::JSCallbackFunction::call): 2567 * API/JSCallbackFunction.h: 2568 (JSC::JSCallbackFunction::createStructure): 2569 * API/JSCallbackObject.h: 2570 (JSC::JSCallbackObject::createStructure): 2571 * API/JSCallbackObjectFunctions.h: 2572 (JSC::::asCallbackObject): 2573 (JSC::::put): 2574 (JSC::::hasInstance): 2575 (JSC::::call): 2576 (JSC::::staticValueGetter): 2577 (JSC::::staticFunctionGetter): 2578 (JSC::::callbackGetter): 2579 * API/JSContextRef.cpp: 2580 * API/JSObjectRef.cpp: 2581 (JSObjectMakeConstructor): 2582 (JSObjectSetPrototype): 2583 (JSObjectGetProperty): 2584 (JSObjectSetProperty): 2585 (JSObjectGetPropertyAtIndex): 2586 (JSObjectSetPropertyAtIndex): 2587 * API/JSValueRef.cpp: 2588 (JSValueGetType): 2589 (JSValueIsUndefined): 2590 (JSValueIsNull): 2591 (JSValueIsBoolean): 2592 (JSValueIsNumber): 2593 (JSValueIsString): 2594 (JSValueIsObject): 2595 (JSValueIsObjectOfClass): 2596 (JSValueIsEqual): 2597 (JSValueIsStrictEqual): 2598 (JSValueIsInstanceOfConstructor): 2599 (JSValueToBoolean): 2600 (JSValueToNumber): 2601 (JSValueToStringCopy): 2602 (JSValueToObject): 2603 (JSValueProtect): 2604 (JSValueUnprotect): 2605 * JavaScriptCore.exp: 2606 * bytecode/CodeBlock.cpp: 2607 (JSC::valueToSourceString): 2608 (JSC::constantName): 2609 (JSC::CodeBlock::dump): 2610 * bytecode/CodeBlock.h: 2611 (JSC::CodeBlock::getConstant): 2612 (JSC::CodeBlock::addUnexpectedConstant): 2613 (JSC::CodeBlock::unexpectedConstant): 2614 * bytecode/EvalCodeCache.h: 2615 (JSC::EvalCodeCache::get): 2616 * bytecompiler/BytecodeGenerator.cpp: 2617 (JSC::BytecodeGenerator::BytecodeGenerator): 2618 (JSC::BytecodeGenerator::addConstant): 2619 (JSC::BytecodeGenerator::addUnexpectedConstant): 2620 (JSC::BytecodeGenerator::emitLoad): 2621 (JSC::BytecodeGenerator::emitLoadJSV): 2622 (JSC::BytecodeGenerator::emitGetScopedVar): 2623 (JSC::BytecodeGenerator::emitPutScopedVar): 2624 (JSC::BytecodeGenerator::emitNewError): 2625 (JSC::keyForImmediateSwitch): 2626 * bytecompiler/BytecodeGenerator.h: 2627 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue): 2628 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue): 2629 * debugger/DebuggerCallFrame.cpp: 2630 (JSC::DebuggerCallFrame::evaluate): 2631 * debugger/DebuggerCallFrame.h: 2632 (JSC::DebuggerCallFrame::DebuggerCallFrame): 2633 (JSC::DebuggerCallFrame::exception): 2634 * interpreter/CallFrame.cpp: 2635 (JSC::CallFrame::thisValue): 2636 * interpreter/CallFrame.h: 2637 (JSC::ExecState::setException): 2638 (JSC::ExecState::exception): 2639 (JSC::ExecState::exceptionSlot): 2640 (JSC::ExecState::hadException): 2641 * interpreter/Interpreter.cpp: 2642 (JSC::fastIsNumber): 2643 (JSC::fastToInt32): 2644 (JSC::fastToUInt32): 2645 (JSC::jsLess): 2646 (JSC::jsLessEq): 2647 (JSC::jsAddSlowCase): 2648 (JSC::jsAdd): 2649 (JSC::jsTypeStringForValue): 2650 (JSC::jsIsObjectType): 2651 (JSC::jsIsFunctionType): 2652 (JSC::Interpreter::resolve): 2653 (JSC::Interpreter::resolveSkip): 2654 (JSC::Interpreter::resolveGlobal): 2655 (JSC::inlineResolveBase): 2656 (JSC::Interpreter::resolveBase): 2657 (JSC::Interpreter::resolveBaseAndProperty): 2658 (JSC::Interpreter::resolveBaseAndFunc): 2659 (JSC::isNotObject): 2660 (JSC::Interpreter::callEval): 2661 (JSC::Interpreter::unwindCallFrame): 2662 (JSC::Interpreter::throwException): 2663 (JSC::Interpreter::execute): 2664 (JSC::Interpreter::checkTimeout): 2665 (JSC::Interpreter::createExceptionScope): 2666 (JSC::cachePrototypeChain): 2667 (JSC::Interpreter::tryCachePutByID): 2668 (JSC::countPrototypeChainEntriesAndCheckForProxies): 2669 (JSC::Interpreter::tryCacheGetByID): 2670 (JSC::Interpreter::privateExecute): 2671 (JSC::Interpreter::retrieveArguments): 2672 (JSC::Interpreter::retrieveCaller): 2673 (JSC::Interpreter::retrieveLastCaller): 2674 (JSC::Interpreter::tryCTICachePutByID): 2675 (JSC::Interpreter::tryCTICacheGetByID): 2676 (JSC::returnToThrowTrampoline): 2677 (JSC::Interpreter::cti_op_convert_this): 2678 (JSC::Interpreter::cti_op_add): 2679 (JSC::Interpreter::cti_op_pre_inc): 2680 (JSC::Interpreter::cti_op_loop_if_less): 2681 (JSC::Interpreter::cti_op_loop_if_lesseq): 2682 (JSC::Interpreter::cti_op_get_by_id_generic): 2683 (JSC::Interpreter::cti_op_get_by_id): 2684 (JSC::Interpreter::cti_op_get_by_id_second): 2685 (JSC::Interpreter::cti_op_get_by_id_self_fail): 2686 (JSC::Interpreter::cti_op_get_by_id_proto_list): 2687 (JSC::Interpreter::cti_op_get_by_id_proto_list_full): 2688 (JSC::Interpreter::cti_op_get_by_id_proto_fail): 2689 (JSC::Interpreter::cti_op_get_by_id_array_fail): 2690 (JSC::Interpreter::cti_op_get_by_id_string_fail): 2691 (JSC::Interpreter::cti_op_instanceof): 2692 (JSC::Interpreter::cti_op_del_by_id): 2693 (JSC::Interpreter::cti_op_mul): 2694 (JSC::Interpreter::cti_op_call_NotJSFunction): 2695 (JSC::Interpreter::cti_op_resolve): 2696 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 2697 (JSC::Interpreter::cti_op_get_by_val): 2698 (JSC::Interpreter::cti_op_resolve_func): 2699 (JSC::Interpreter::cti_op_sub): 2700 (JSC::Interpreter::cti_op_put_by_val): 2701 (JSC::Interpreter::cti_op_put_by_val_array): 2702 (JSC::Interpreter::cti_op_lesseq): 2703 (JSC::Interpreter::cti_op_loop_if_true): 2704 (JSC::Interpreter::cti_op_negate): 2705 (JSC::Interpreter::cti_op_resolve_base): 2706 (JSC::Interpreter::cti_op_resolve_skip): 2707 (JSC::Interpreter::cti_op_resolve_global): 2708 (JSC::Interpreter::cti_op_div): 2709 (JSC::Interpreter::cti_op_pre_dec): 2710 (JSC::Interpreter::cti_op_jless): 2711 (JSC::Interpreter::cti_op_not): 2712 (JSC::Interpreter::cti_op_jtrue): 2713 (JSC::Interpreter::cti_op_post_inc): 2714 (JSC::Interpreter::cti_op_eq): 2715 (JSC::Interpreter::cti_op_lshift): 2716 (JSC::Interpreter::cti_op_bitand): 2717 (JSC::Interpreter::cti_op_rshift): 2718 (JSC::Interpreter::cti_op_bitnot): 2719 (JSC::Interpreter::cti_op_resolve_with_base): 2720 (JSC::Interpreter::cti_op_mod): 2721 (JSC::Interpreter::cti_op_less): 2722 (JSC::Interpreter::cti_op_neq): 2723 (JSC::Interpreter::cti_op_post_dec): 2724 (JSC::Interpreter::cti_op_urshift): 2725 (JSC::Interpreter::cti_op_bitxor): 2726 (JSC::Interpreter::cti_op_bitor): 2727 (JSC::Interpreter::cti_op_call_eval): 2728 (JSC::Interpreter::cti_op_throw): 2729 (JSC::Interpreter::cti_op_next_pname): 2730 (JSC::Interpreter::cti_op_typeof): 2731 (JSC::Interpreter::cti_op_is_undefined): 2732 (JSC::Interpreter::cti_op_is_boolean): 2733 (JSC::Interpreter::cti_op_is_number): 2734 (JSC::Interpreter::cti_op_is_string): 2735 (JSC::Interpreter::cti_op_is_object): 2736 (JSC::Interpreter::cti_op_is_function): 2737 (JSC::Interpreter::cti_op_stricteq): 2738 (JSC::Interpreter::cti_op_nstricteq): 2739 (JSC::Interpreter::cti_op_to_jsnumber): 2740 (JSC::Interpreter::cti_op_in): 2741 (JSC::Interpreter::cti_op_switch_imm): 2742 (JSC::Interpreter::cti_op_switch_char): 2743 (JSC::Interpreter::cti_op_switch_string): 2744 (JSC::Interpreter::cti_op_del_by_val): 2745 (JSC::Interpreter::cti_op_new_error): 2746 (JSC::Interpreter::cti_vm_throw): 2747 * interpreter/Interpreter.h: 2748 (JSC::Interpreter::isJSArray): 2749 (JSC::Interpreter::isJSString): 2750 * interpreter/Register.h: 2751 (JSC::Register::): 2752 (JSC::Register::Register): 2753 (JSC::Register::jsValue): 2754 (JSC::Register::getJSValue): 2755 * jit/JIT.cpp: 2756 (JSC::): 2757 (JSC::JIT::compileOpStrictEq): 2758 (JSC::JIT::privateCompileMainPass): 2759 (JSC::JIT::privateCompileSlowCases): 2760 * jit/JIT.h: 2761 (JSC::): 2762 (JSC::JIT::execute): 2763 * jit/JITArithmetic.cpp: 2764 (JSC::JIT::compileFastArith_op_rshift): 2765 (JSC::JIT::compileFastArithSlow_op_rshift): 2766 * jit/JITCall.cpp: 2767 (JSC::JIT::unlinkCall): 2768 (JSC::JIT::compileOpCallInitializeCallFrame): 2769 (JSC::JIT::compileOpCall): 2770 * jit/JITInlineMethods.h: 2771 (JSC::JIT::emitGetVirtualRegister): 2772 (JSC::JIT::getConstantOperand): 2773 (JSC::JIT::isOperandConstant31BitImmediateInt): 2774 (JSC::JIT::emitPutJITStubArgFromVirtualRegister): 2775 (JSC::JIT::emitInitRegister): 2776 * jit/JITPropertyAccess.cpp: 2777 (JSC::resizePropertyStorage): 2778 (JSC::JIT::privateCompilePutByIdTransition): 2779 (JSC::JIT::patchGetByIdSelf): 2780 (JSC::JIT::patchPutByIdReplace): 2781 (JSC::JIT::privateCompileGetByIdSelf): 2782 (JSC::JIT::privateCompileGetByIdProto): 2783 (JSC::JIT::privateCompileGetByIdSelfList): 2784 (JSC::JIT::privateCompileGetByIdProtoList): 2785 (JSC::JIT::privateCompileGetByIdChainList): 2786 (JSC::JIT::privateCompileGetByIdChain): 2787 (JSC::JIT::privateCompilePutByIdReplace): 2788 * jsc.cpp: 2789 (functionPrint): 2790 (functionDebug): 2791 (functionGC): 2792 (functionVersion): 2793 (functionRun): 2794 (functionLoad): 2795 (functionReadline): 2796 (functionQuit): 2797 * parser/Nodes.cpp: 2798 (JSC::NullNode::emitBytecode): 2799 (JSC::ArrayNode::emitBytecode): 2800 (JSC::FunctionCallValueNode::emitBytecode): 2801 (JSC::FunctionCallResolveNode::emitBytecode): 2802 (JSC::VoidNode::emitBytecode): 2803 (JSC::ConstDeclNode::emitCodeSingle): 2804 (JSC::ReturnNode::emitBytecode): 2805 (JSC::processClauseList): 2806 (JSC::EvalNode::emitBytecode): 2807 (JSC::FunctionBodyNode::emitBytecode): 2808 (JSC::ProgramNode::emitBytecode): 2809 * profiler/ProfileGenerator.cpp: 2810 (JSC::ProfileGenerator::addParentForConsoleStart): 2811 * profiler/Profiler.cpp: 2812 (JSC::Profiler::willExecute): 2813 (JSC::Profiler::didExecute): 2814 (JSC::Profiler::createCallIdentifier): 2815 * profiler/Profiler.h: 2816 * runtime/ArgList.cpp: 2817 (JSC::ArgList::slowAppend): 2818 * runtime/ArgList.h: 2819 (JSC::ArgList::at): 2820 (JSC::ArgList::append): 2821 * runtime/Arguments.cpp: 2822 (JSC::Arguments::put): 2823 * runtime/Arguments.h: 2824 (JSC::Arguments::createStructure): 2825 (JSC::asArguments): 2826 * runtime/ArrayConstructor.cpp: 2827 (JSC::callArrayConstructor): 2828 * runtime/ArrayPrototype.cpp: 2829 (JSC::getProperty): 2830 (JSC::putProperty): 2831 (JSC::arrayProtoFuncToString): 2832 (JSC::arrayProtoFuncToLocaleString): 2833 (JSC::arrayProtoFuncJoin): 2834 (JSC::arrayProtoFuncConcat): 2835 (JSC::arrayProtoFuncPop): 2836 (JSC::arrayProtoFuncPush): 2837 (JSC::arrayProtoFuncReverse): 2838 (JSC::arrayProtoFuncShift): 2839 (JSC::arrayProtoFuncSlice): 2840 (JSC::arrayProtoFuncSort): 2841 (JSC::arrayProtoFuncSplice): 2842 (JSC::arrayProtoFuncUnShift): 2843 (JSC::arrayProtoFuncFilter): 2844 (JSC::arrayProtoFuncMap): 2845 (JSC::arrayProtoFuncEvery): 2846 (JSC::arrayProtoFuncForEach): 2847 (JSC::arrayProtoFuncSome): 2848 (JSC::arrayProtoFuncIndexOf): 2849 (JSC::arrayProtoFuncLastIndexOf): 2850 * runtime/BooleanConstructor.cpp: 2851 (JSC::callBooleanConstructor): 2852 (JSC::constructBooleanFromImmediateBoolean): 2853 * runtime/BooleanConstructor.h: 2854 * runtime/BooleanObject.h: 2855 (JSC::asBooleanObject): 2856 * runtime/BooleanPrototype.cpp: 2857 (JSC::booleanProtoFuncToString): 2858 (JSC::booleanProtoFuncValueOf): 2859 * runtime/CallData.cpp: 2860 (JSC::call): 2861 * runtime/CallData.h: 2862 * runtime/Collector.cpp: 2863 (JSC::Heap::protect): 2864 (JSC::Heap::unprotect): 2865 (JSC::Heap::heap): 2866 (JSC::Heap::collect): 2867 * runtime/Collector.h: 2868 * runtime/Completion.cpp: 2869 (JSC::evaluate): 2870 * runtime/Completion.h: 2871 (JSC::Completion::Completion): 2872 (JSC::Completion::value): 2873 (JSC::Completion::setValue): 2874 (JSC::Completion::isValueCompletion): 2875 * runtime/ConstructData.cpp: 2876 (JSC::construct): 2877 * runtime/ConstructData.h: 2878 * runtime/DateConstructor.cpp: 2879 (JSC::constructDate): 2880 (JSC::callDate): 2881 (JSC::dateParse): 2882 (JSC::dateNow): 2883 (JSC::dateUTC): 2884 * runtime/DateInstance.h: 2885 (JSC::asDateInstance): 2886 * runtime/DatePrototype.cpp: 2887 (JSC::dateProtoFuncToString): 2888 (JSC::dateProtoFuncToUTCString): 2889 (JSC::dateProtoFuncToDateString): 2890 (JSC::dateProtoFuncToTimeString): 2891 (JSC::dateProtoFuncToLocaleString): 2892 (JSC::dateProtoFuncToLocaleDateString): 2893 (JSC::dateProtoFuncToLocaleTimeString): 2894 (JSC::dateProtoFuncValueOf): 2895 (JSC::dateProtoFuncGetTime): 2896 (JSC::dateProtoFuncGetFullYear): 2897 (JSC::dateProtoFuncGetUTCFullYear): 2898 (JSC::dateProtoFuncToGMTString): 2899 (JSC::dateProtoFuncGetMonth): 2900 (JSC::dateProtoFuncGetUTCMonth): 2901 (JSC::dateProtoFuncGetDate): 2902 (JSC::dateProtoFuncGetUTCDate): 2903 (JSC::dateProtoFuncGetDay): 2904 (JSC::dateProtoFuncGetUTCDay): 2905 (JSC::dateProtoFuncGetHours): 2906 (JSC::dateProtoFuncGetUTCHours): 2907 (JSC::dateProtoFuncGetMinutes): 2908 (JSC::dateProtoFuncGetUTCMinutes): 2909 (JSC::dateProtoFuncGetSeconds): 2910 (JSC::dateProtoFuncGetUTCSeconds): 2911 (JSC::dateProtoFuncGetMilliSeconds): 2912 (JSC::dateProtoFuncGetUTCMilliseconds): 2913 (JSC::dateProtoFuncGetTimezoneOffset): 2914 (JSC::dateProtoFuncSetTime): 2915 (JSC::setNewValueFromTimeArgs): 2916 (JSC::setNewValueFromDateArgs): 2917 (JSC::dateProtoFuncSetMilliSeconds): 2918 (JSC::dateProtoFuncSetUTCMilliseconds): 2919 (JSC::dateProtoFuncSetSeconds): 2920 (JSC::dateProtoFuncSetUTCSeconds): 2921 (JSC::dateProtoFuncSetMinutes): 2922 (JSC::dateProtoFuncSetUTCMinutes): 2923 (JSC::dateProtoFuncSetHours): 2924 (JSC::dateProtoFuncSetUTCHours): 2925 (JSC::dateProtoFuncSetDate): 2926 (JSC::dateProtoFuncSetUTCDate): 2927 (JSC::dateProtoFuncSetMonth): 2928 (JSC::dateProtoFuncSetUTCMonth): 2929 (JSC::dateProtoFuncSetFullYear): 2930 (JSC::dateProtoFuncSetUTCFullYear): 2931 (JSC::dateProtoFuncSetYear): 2932 (JSC::dateProtoFuncGetYear): 2933 * runtime/DatePrototype.h: 2934 (JSC::DatePrototype::createStructure): 2935 * runtime/ErrorConstructor.cpp: 2936 (JSC::callErrorConstructor): 2937 * runtime/ErrorPrototype.cpp: 2938 (JSC::errorProtoFuncToString): 2939 * runtime/ExceptionHelpers.cpp: 2940 (JSC::createInterruptedExecutionException): 2941 (JSC::createError): 2942 (JSC::createStackOverflowError): 2943 (JSC::createUndefinedVariableError): 2944 (JSC::createErrorMessage): 2945 (JSC::createInvalidParamError): 2946 (JSC::createNotAConstructorError): 2947 (JSC::createNotAFunctionError): 2948 * runtime/ExceptionHelpers.h: 2949 * runtime/FunctionConstructor.cpp: 2950 (JSC::callFunctionConstructor): 2951 * runtime/FunctionPrototype.cpp: 2952 (JSC::callFunctionPrototype): 2953 (JSC::functionProtoFuncToString): 2954 (JSC::functionProtoFuncApply): 2955 (JSC::functionProtoFuncCall): 2956 * runtime/FunctionPrototype.h: 2957 (JSC::FunctionPrototype::createStructure): 2958 * runtime/GetterSetter.cpp: 2959 (JSC::GetterSetter::toPrimitive): 2960 (JSC::GetterSetter::getPrimitiveNumber): 2961 * runtime/GetterSetter.h: 2962 (JSC::asGetterSetter): 2963 * runtime/InitializeThreading.cpp: 2964 * runtime/InternalFunction.h: 2965 (JSC::InternalFunction::createStructure): 2966 (JSC::asInternalFunction): 2967 * runtime/JSActivation.cpp: 2968 (JSC::JSActivation::getOwnPropertySlot): 2969 (JSC::JSActivation::put): 2970 (JSC::JSActivation::putWithAttributes): 2971 (JSC::JSActivation::argumentsGetter): 2972 * runtime/JSActivation.h: 2973 (JSC::JSActivation::createStructure): 2974 (JSC::asActivation): 2975 * runtime/JSArray.cpp: 2976 (JSC::storageSize): 2977 (JSC::JSArray::JSArray): 2978 (JSC::JSArray::getOwnPropertySlot): 2979 (JSC::JSArray::put): 2980 (JSC::JSArray::putSlowCase): 2981 (JSC::JSArray::deleteProperty): 2982 (JSC::JSArray::getPropertyNames): 2983 (JSC::JSArray::setLength): 2984 (JSC::JSArray::pop): 2985 (JSC::JSArray::push): 2986 (JSC::JSArray::mark): 2987 (JSC::JSArray::sort): 2988 (JSC::JSArray::compactForSorting): 2989 (JSC::JSArray::checkConsistency): 2990 (JSC::constructArray): 2991 * runtime/JSArray.h: 2992 (JSC::JSArray::getIndex): 2993 (JSC::JSArray::setIndex): 2994 (JSC::JSArray::createStructure): 2995 (JSC::asArray): 2996 * runtime/JSCell.cpp: 2997 (JSC::JSCell::put): 2998 (JSC::JSCell::getJSNumber): 2999 * runtime/JSCell.h: 3000 (JSC::asCell): 3001 (JSC::JSValue::asCell): 3002 (JSC::JSValue::toPrimitive): 3003 (JSC::JSValue::getPrimitiveNumber): 3004 (JSC::JSValue::getJSNumber): 3005 * runtime/JSFunction.cpp: 3006 (JSC::JSFunction::call): 3007 (JSC::JSFunction::argumentsGetter): 3008 (JSC::JSFunction::callerGetter): 3009 (JSC::JSFunction::lengthGetter): 3010 (JSC::JSFunction::getOwnPropertySlot): 3011 (JSC::JSFunction::put): 3012 (JSC::JSFunction::construct): 3013 * runtime/JSFunction.h: 3014 (JSC::JSFunction::createStructure): 3015 (JSC::asFunction): 3016 * runtime/JSGlobalData.h: 3017 * runtime/JSGlobalObject.cpp: 3018 (JSC::markIfNeeded): 3019 (JSC::JSGlobalObject::put): 3020 (JSC::JSGlobalObject::putWithAttributes): 3021 (JSC::JSGlobalObject::reset): 3022 (JSC::JSGlobalObject::resetPrototype): 3023 * runtime/JSGlobalObject.h: 3024 (JSC::JSGlobalObject::createStructure): 3025 (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo): 3026 (JSC::asGlobalObject): 3027 (JSC::Structure::prototypeForLookup): 3028 * runtime/JSGlobalObjectFunctions.cpp: 3029 (JSC::encode): 3030 (JSC::decode): 3031 (JSC::globalFuncEval): 3032 (JSC::globalFuncParseInt): 3033 (JSC::globalFuncParseFloat): 3034 (JSC::globalFuncIsNaN): 3035 (JSC::globalFuncIsFinite): 3036 (JSC::globalFuncDecodeURI): 3037 (JSC::globalFuncDecodeURIComponent): 3038 (JSC::globalFuncEncodeURI): 3039 (JSC::globalFuncEncodeURIComponent): 3040 (JSC::globalFuncEscape): 3041 (JSC::globalFuncUnescape): 3042 (JSC::globalFuncJSCPrint): 3043 * runtime/JSGlobalObjectFunctions.h: 3044 * runtime/JSImmediate.cpp: 3045 (JSC::JSImmediate::toThisObject): 3046 (JSC::JSImmediate::toObject): 3047 (JSC::JSImmediate::prototype): 3048 (JSC::JSImmediate::toString): 3049 * runtime/JSImmediate.h: 3050 (JSC::JSImmediate::isImmediate): 3051 (JSC::JSImmediate::isNumber): 3052 (JSC::JSImmediate::isPositiveNumber): 3053 (JSC::JSImmediate::isBoolean): 3054 (JSC::JSImmediate::isUndefinedOrNull): 3055 (JSC::JSImmediate::isNegative): 3056 (JSC::JSImmediate::isEitherImmediate): 3057 (JSC::JSImmediate::isAnyImmediate): 3058 (JSC::JSImmediate::areBothImmediate): 3059 (JSC::JSImmediate::areBothImmediateNumbers): 3060 (JSC::JSImmediate::andImmediateNumbers): 3061 (JSC::JSImmediate::xorImmediateNumbers): 3062 (JSC::JSImmediate::orImmediateNumbers): 3063 (JSC::JSImmediate::rightShiftImmediateNumbers): 3064 (JSC::JSImmediate::canDoFastAdditiveOperations): 3065 (JSC::JSImmediate::addImmediateNumbers): 3066 (JSC::JSImmediate::subImmediateNumbers): 3067 (JSC::JSImmediate::incImmediateNumber): 3068 (JSC::JSImmediate::decImmediateNumber): 3069 (JSC::JSImmediate::makeValue): 3070 (JSC::JSImmediate::makeInt): 3071 (JSC::JSImmediate::makeBool): 3072 (JSC::JSImmediate::makeUndefined): 3073 (JSC::JSImmediate::makeNull): 3074 (JSC::JSImmediate::intValue): 3075 (JSC::JSImmediate::uintValue): 3076 (JSC::JSImmediate::boolValue): 3077 (JSC::JSImmediate::rawValue): 3078 (JSC::JSImmediate::trueImmediate): 3079 (JSC::JSImmediate::falseImmediate): 3080 (JSC::JSImmediate::undefinedImmediate): 3081 (JSC::JSImmediate::nullImmediate): 3082 (JSC::JSImmediate::zeroImmediate): 3083 (JSC::JSImmediate::oneImmediate): 3084 (JSC::JSImmediate::impossibleValue): 3085 (JSC::JSImmediate::toBoolean): 3086 (JSC::JSImmediate::getTruncatedUInt32): 3087 (JSC::JSImmediate::from): 3088 (JSC::JSImmediate::getTruncatedInt32): 3089 (JSC::JSImmediate::toDouble): 3090 (JSC::JSImmediate::getUInt32): 3091 (JSC::jsNull): 3092 (JSC::jsBoolean): 3093 (JSC::jsUndefined): 3094 (JSC::JSValue::isUndefined): 3095 (JSC::JSValue::isNull): 3096 (JSC::JSValue::isUndefinedOrNull): 3097 (JSC::JSValue::isBoolean): 3098 (JSC::JSValue::getBoolean): 3099 (JSC::JSValue::toInt32): 3100 (JSC::JSValue::toUInt32): 3101 (JSC::toInt32): 3102 (JSC::toUInt32): 3103 * runtime/JSNotAnObject.cpp: 3104 (JSC::JSNotAnObject::toPrimitive): 3105 (JSC::JSNotAnObject::getPrimitiveNumber): 3106 (JSC::JSNotAnObject::put): 3107 * runtime/JSNotAnObject.h: 3108 (JSC::JSNotAnObject::createStructure): 3109 * runtime/JSNumberCell.cpp: 3110 (JSC::JSNumberCell::toPrimitive): 3111 (JSC::JSNumberCell::getPrimitiveNumber): 3112 (JSC::JSNumberCell::getJSNumber): 3113 (JSC::jsNumberCell): 3114 (JSC::jsNaN): 3115 * runtime/JSNumberCell.h: 3116 (JSC::JSNumberCell::createStructure): 3117 (JSC::asNumberCell): 3118 (JSC::jsNumber): 3119 (JSC::JSValue::toJSNumber): 3120 * runtime/JSObject.cpp: 3121 (JSC::JSObject::mark): 3122 (JSC::JSObject::put): 3123 (JSC::JSObject::putWithAttributes): 3124 (JSC::callDefaultValueFunction): 3125 (JSC::JSObject::getPrimitiveNumber): 3126 (JSC::JSObject::defaultValue): 3127 (JSC::JSObject::defineGetter): 3128 (JSC::JSObject::defineSetter): 3129 (JSC::JSObject::lookupGetter): 3130 (JSC::JSObject::lookupSetter): 3131 (JSC::JSObject::hasInstance): 3132 (JSC::JSObject::toNumber): 3133 (JSC::JSObject::toString): 3134 (JSC::JSObject::fillGetterPropertySlot): 3135 * runtime/JSObject.h: 3136 (JSC::JSObject::getDirect): 3137 (JSC::JSObject::getDirectLocation): 3138 (JSC::JSObject::offsetForLocation): 3139 (JSC::JSObject::locationForOffset): 3140 (JSC::JSObject::getDirectOffset): 3141 (JSC::JSObject::putDirectOffset): 3142 (JSC::JSObject::createStructure): 3143 (JSC::asObject): 3144 (JSC::JSObject::prototype): 3145 (JSC::JSObject::setPrototype): 3146 (JSC::JSObject::inlineGetOwnPropertySlot): 3147 (JSC::JSObject::getOwnPropertySlotForWrite): 3148 (JSC::JSObject::getPropertySlot): 3149 (JSC::JSObject::get): 3150 (JSC::JSObject::putDirect): 3151 (JSC::JSObject::putDirectWithoutTransition): 3152 (JSC::JSObject::toPrimitive): 3153 (JSC::JSValue::get): 3154 (JSC::JSValue::put): 3155 (JSC::JSObject::allocatePropertyStorageInline): 3156 * runtime/JSPropertyNameIterator.cpp: 3157 (JSC::JSPropertyNameIterator::toPrimitive): 3158 (JSC::JSPropertyNameIterator::getPrimitiveNumber): 3159 * runtime/JSPropertyNameIterator.h: 3160 (JSC::JSPropertyNameIterator::create): 3161 (JSC::JSPropertyNameIterator::next): 3162 * runtime/JSStaticScopeObject.cpp: 3163 (JSC::JSStaticScopeObject::put): 3164 (JSC::JSStaticScopeObject::putWithAttributes): 3165 * runtime/JSStaticScopeObject.h: 3166 (JSC::JSStaticScopeObject::JSStaticScopeObject): 3167 (JSC::JSStaticScopeObject::createStructure): 3168 * runtime/JSString.cpp: 3169 (JSC::JSString::toPrimitive): 3170 (JSC::JSString::getPrimitiveNumber): 3171 (JSC::JSString::getOwnPropertySlot): 3172 * runtime/JSString.h: 3173 (JSC::JSString::createStructure): 3174 (JSC::asString): 3175 * runtime/JSValue.h: 3176 (JSC::JSValuePtr::makeImmediate): 3177 (JSC::JSValuePtr::immediateValue): 3178 (JSC::JSValuePtr::JSValuePtr): 3179 (JSC::JSValuePtr::operator->): 3180 (JSC::JSValuePtr::hasValue): 3181 (JSC::JSValuePtr::operator==): 3182 (JSC::JSValuePtr::operator!=): 3183 (JSC::JSValuePtr::encode): 3184 (JSC::JSValuePtr::decode): 3185 (JSC::JSValue::asValue): 3186 (JSC::noValue): 3187 (JSC::operator==): 3188 (JSC::operator!=): 3189 * runtime/JSVariableObject.h: 3190 (JSC::JSVariableObject::symbolTablePut): 3191 (JSC::JSVariableObject::symbolTablePutWithAttributes): 3192 * runtime/JSWrapperObject.cpp: 3193 (JSC::JSWrapperObject::mark): 3194 * runtime/JSWrapperObject.h: 3195 (JSC::JSWrapperObject::internalValue): 3196 (JSC::JSWrapperObject::setInternalValue): 3197 * runtime/Lookup.cpp: 3198 (JSC::setUpStaticFunctionSlot): 3199 * runtime/Lookup.h: 3200 (JSC::lookupPut): 3201 * runtime/MathObject.cpp: 3202 (JSC::mathProtoFuncAbs): 3203 (JSC::mathProtoFuncACos): 3204 (JSC::mathProtoFuncASin): 3205 (JSC::mathProtoFuncATan): 3206 (JSC::mathProtoFuncATan2): 3207 (JSC::mathProtoFuncCeil): 3208 (JSC::mathProtoFuncCos): 3209 (JSC::mathProtoFuncExp): 3210 (JSC::mathProtoFuncFloor): 3211 (JSC::mathProtoFuncLog): 3212 (JSC::mathProtoFuncMax): 3213 (JSC::mathProtoFuncMin): 3214 (JSC::mathProtoFuncPow): 3215 (JSC::mathProtoFuncRandom): 3216 (JSC::mathProtoFuncRound): 3217 (JSC::mathProtoFuncSin): 3218 (JSC::mathProtoFuncSqrt): 3219 (JSC::mathProtoFuncTan): 3220 * runtime/MathObject.h: 3221 (JSC::MathObject::createStructure): 3222 * runtime/NativeErrorConstructor.cpp: 3223 (JSC::callNativeErrorConstructor): 3224 * runtime/NumberConstructor.cpp: 3225 (JSC::numberConstructorNaNValue): 3226 (JSC::numberConstructorNegInfinity): 3227 (JSC::numberConstructorPosInfinity): 3228 (JSC::numberConstructorMaxValue): 3229 (JSC::numberConstructorMinValue): 3230 (JSC::callNumberConstructor): 3231 * runtime/NumberConstructor.h: 3232 (JSC::NumberConstructor::createStructure): 3233 * runtime/NumberObject.cpp: 3234 (JSC::NumberObject::getJSNumber): 3235 (JSC::constructNumberFromImmediateNumber): 3236 * runtime/NumberObject.h: 3237 * runtime/NumberPrototype.cpp: 3238 (JSC::numberProtoFuncToString): 3239 (JSC::numberProtoFuncToLocaleString): 3240 (JSC::numberProtoFuncValueOf): 3241 (JSC::numberProtoFuncToFixed): 3242 (JSC::numberProtoFuncToExponential): 3243 (JSC::numberProtoFuncToPrecision): 3244 * runtime/ObjectConstructor.cpp: 3245 (JSC::constructObject): 3246 (JSC::callObjectConstructor): 3247 * runtime/ObjectPrototype.cpp: 3248 (JSC::objectProtoFuncValueOf): 3249 (JSC::objectProtoFuncHasOwnProperty): 3250 (JSC::objectProtoFuncIsPrototypeOf): 3251 (JSC::objectProtoFuncDefineGetter): 3252 (JSC::objectProtoFuncDefineSetter): 3253 (JSC::objectProtoFuncLookupGetter): 3254 (JSC::objectProtoFuncLookupSetter): 3255 (JSC::objectProtoFuncPropertyIsEnumerable): 3256 (JSC::objectProtoFuncToLocaleString): 3257 (JSC::objectProtoFuncToString): 3258 * runtime/ObjectPrototype.h: 3259 * runtime/Operations.cpp: 3260 (JSC::equal): 3261 (JSC::equalSlowCase): 3262 (JSC::strictEqual): 3263 (JSC::strictEqualSlowCase): 3264 (JSC::throwOutOfMemoryError): 3265 * runtime/Operations.h: 3266 (JSC::equalSlowCaseInline): 3267 (JSC::strictEqualSlowCaseInline): 3268 * runtime/PropertySlot.cpp: 3269 (JSC::PropertySlot::functionGetter): 3270 * runtime/PropertySlot.h: 3271 (JSC::PropertySlot::PropertySlot): 3272 (JSC::PropertySlot::getValue): 3273 (JSC::PropertySlot::putValue): 3274 (JSC::PropertySlot::setValueSlot): 3275 (JSC::PropertySlot::setValue): 3276 (JSC::PropertySlot::setCustom): 3277 (JSC::PropertySlot::setCustomIndex): 3278 (JSC::PropertySlot::slotBase): 3279 (JSC::PropertySlot::setBase): 3280 (JSC::PropertySlot::): 3281 * runtime/Protect.h: 3282 (JSC::gcProtect): 3283 (JSC::gcUnprotect): 3284 (JSC::ProtectedPtr::ProtectedPtr): 3285 (JSC::ProtectedPtr::operator JSValuePtr): 3286 (JSC::ProtectedJSValuePtr::ProtectedJSValuePtr): 3287 (JSC::ProtectedJSValuePtr::get): 3288 (JSC::ProtectedJSValuePtr::operator JSValuePtr): 3289 (JSC::ProtectedJSValuePtr::operator->): 3290 (JSC::::ProtectedPtr): 3291 (JSC::::~ProtectedPtr): 3292 (JSC::::operator): 3293 (JSC::ProtectedJSValuePtr::~ProtectedJSValuePtr): 3294 (JSC::ProtectedJSValuePtr::operator=): 3295 (JSC::operator==): 3296 (JSC::operator!=): 3297 * runtime/RegExpConstructor.cpp: 3298 (JSC::RegExpConstructor::getBackref): 3299 (JSC::RegExpConstructor::getLastParen): 3300 (JSC::RegExpConstructor::getLeftContext): 3301 (JSC::RegExpConstructor::getRightContext): 3302 (JSC::regExpConstructorDollar1): 3303 (JSC::regExpConstructorDollar2): 3304 (JSC::regExpConstructorDollar3): 3305 (JSC::regExpConstructorDollar4): 3306 (JSC::regExpConstructorDollar5): 3307 (JSC::regExpConstructorDollar6): 3308 (JSC::regExpConstructorDollar7): 3309 (JSC::regExpConstructorDollar8): 3310 (JSC::regExpConstructorDollar9): 3311 (JSC::regExpConstructorInput): 3312 (JSC::regExpConstructorMultiline): 3313 (JSC::regExpConstructorLastMatch): 3314 (JSC::regExpConstructorLastParen): 3315 (JSC::regExpConstructorLeftContext): 3316 (JSC::regExpConstructorRightContext): 3317 (JSC::RegExpConstructor::put): 3318 (JSC::setRegExpConstructorInput): 3319 (JSC::setRegExpConstructorMultiline): 3320 (JSC::constructRegExp): 3321 (JSC::callRegExpConstructor): 3322 * runtime/RegExpConstructor.h: 3323 (JSC::RegExpConstructor::createStructure): 3324 (JSC::asRegExpConstructor): 3325 * runtime/RegExpMatchesArray.h: 3326 (JSC::RegExpMatchesArray::put): 3327 * runtime/RegExpObject.cpp: 3328 (JSC::regExpObjectGlobal): 3329 (JSC::regExpObjectIgnoreCase): 3330 (JSC::regExpObjectMultiline): 3331 (JSC::regExpObjectSource): 3332 (JSC::regExpObjectLastIndex): 3333 (JSC::RegExpObject::put): 3334 (JSC::setRegExpObjectLastIndex): 3335 (JSC::RegExpObject::test): 3336 (JSC::RegExpObject::exec): 3337 (JSC::callRegExpObject): 3338 * runtime/RegExpObject.h: 3339 (JSC::RegExpObject::createStructure): 3340 (JSC::asRegExpObject): 3341 * runtime/RegExpPrototype.cpp: 3342 (JSC::regExpProtoFuncTest): 3343 (JSC::regExpProtoFuncExec): 3344 (JSC::regExpProtoFuncCompile): 3345 (JSC::regExpProtoFuncToString): 3346 * runtime/StringConstructor.cpp: 3347 (JSC::stringFromCharCodeSlowCase): 3348 (JSC::stringFromCharCode): 3349 (JSC::callStringConstructor): 3350 * runtime/StringObject.cpp: 3351 (JSC::StringObject::put): 3352 * runtime/StringObject.h: 3353 (JSC::StringObject::createStructure): 3354 (JSC::asStringObject): 3355 * runtime/StringObjectThatMasqueradesAsUndefined.h: 3356 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 3357 * runtime/StringPrototype.cpp: 3358 (JSC::stringProtoFuncReplace): 3359 (JSC::stringProtoFuncToString): 3360 (JSC::stringProtoFuncCharAt): 3361 (JSC::stringProtoFuncCharCodeAt): 3362 (JSC::stringProtoFuncConcat): 3363 (JSC::stringProtoFuncIndexOf): 3364 (JSC::stringProtoFuncLastIndexOf): 3365 (JSC::stringProtoFuncMatch): 3366 (JSC::stringProtoFuncSearch): 3367 (JSC::stringProtoFuncSlice): 3368 (JSC::stringProtoFuncSplit): 3369 (JSC::stringProtoFuncSubstr): 3370 (JSC::stringProtoFuncSubstring): 3371 (JSC::stringProtoFuncToLowerCase): 3372 (JSC::stringProtoFuncToUpperCase): 3373 (JSC::stringProtoFuncLocaleCompare): 3374 (JSC::stringProtoFuncBig): 3375 (JSC::stringProtoFuncSmall): 3376 (JSC::stringProtoFuncBlink): 3377 (JSC::stringProtoFuncBold): 3378 (JSC::stringProtoFuncFixed): 3379 (JSC::stringProtoFuncItalics): 3380 (JSC::stringProtoFuncStrike): 3381 (JSC::stringProtoFuncSub): 3382 (JSC::stringProtoFuncSup): 3383 (JSC::stringProtoFuncFontcolor): 3384 (JSC::stringProtoFuncFontsize): 3385 (JSC::stringProtoFuncAnchor): 3386 (JSC::stringProtoFuncLink): 3387 * runtime/Structure.cpp: 3388 (JSC::Structure::Structure): 3389 (JSC::Structure::changePrototypeTransition): 3390 (JSC::Structure::createCachedPrototypeChain): 3391 * runtime/Structure.h: 3392 (JSC::Structure::create): 3393 (JSC::Structure::setPrototypeWithoutTransition): 3394 (JSC::Structure::storedPrototype): 3395 33962009-01-06 Oliver Hunt <oliver@apple.com> 3397 3398 Reviewed by Cameron Zwarich. 3399 3400 <https://bugs.webkit.org/show_bug.cgi?id=23085> [jsfunfuzz] Over released ScopeChainNode 3401 <rdar://problem/6474110> 3402 3403 So this delightful bug was caused by our unwind code using a ScopeChain to perform 3404 the unwind. The ScopeChain would ref the initial top of the scope chain, then deref 3405 the resultant top of scope chain, which is incorrect. 3406 3407 This patch removes the dependency on ScopeChain for the unwind, and i've filed 3408 <https://bugs.webkit.org/show_bug.cgi?id=23144> to look into the unintuitive 3409 ScopeChain behaviour. 3410 3411 * interpreter/Interpreter.cpp: 3412 (JSC::Interpreter::throwException): 3413 34142009-01-06 Adam Roben <aroben@apple.com> 3415 3416 Hopeful Windows crash-on-launch fix 3417 3418 * wtf/Platform.h: Force a world rebuild by touching this file. 3419 34202009-01-06 Holger Hans Peter Freyther <zecke@selfish.org> 3421 3422 Reviewed by NOBODY (Build fix). 3423 3424 * GNUmakefile.am:Add ByteArray.cpp too 3425 34262009-01-06 Holger Hans Peter Freyther <zecke@selfish.org> 3427 3428 Reviewed by NOBODY (Speculative build fix). 3429 3430 AllInOneFile.cpp does not include the JSByteArray.cpp include it... 3431 3432 * GNUmakefile.am: 3433 34342009-01-05 Oliver Hunt <oliver@apple.com> 3435 3436 Reviewed by NOBODY (Build fix). 3437 3438 Fix Wx build 3439 3440 * JavaScriptCoreSources.bkl: 3441 34422009-01-05 Oliver Hunt <oliver@apple.com> 3443 3444 Windows build fixes 3445 3446 Rubber-stamped by Alice Liu. 3447 3448 * interpreter/Interpreter.cpp: 3449 (JSC::Interpreter::Interpreter): 3450 * runtime/ByteArray.cpp: 3451 (JSC::ByteArray::create): 3452 * runtime/ByteArray.h: 3453 34542009-01-05 Oliver Hunt <oliver@apple.com> 3455 3456 Reviewed by Gavin Barraclough. 3457 3458 CanvasPixelArray performance is too slow 3459 <https://bugs.webkit.org/show_bug.cgi?id=23123> 3460 3461 The fix to this is to devirtualise get and put in a manner similar to 3462 JSString and JSArray. To do this I've added a ByteArray implementation 3463 and JSByteArray wrapper to JSC. We can then do vptr comparisons to 3464 devirtualise the calls. 3465 3466 This devirtualisation improves performance by 1.5-2x in my somewhat ad 3467 hoc tests. 3468 3469 * GNUmakefile.am: 3470 * JavaScriptCore.exp: 3471 * JavaScriptCore.pri: 3472 * JavaScriptCore.scons: 3473 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 3474 * JavaScriptCore.xcodeproj/project.pbxproj: 3475 * interpreter/Interpreter.cpp: 3476 (JSC::Interpreter::Interpreter): 3477 (JSC::Interpreter::privateExecute): 3478 (JSC::Interpreter::cti_op_get_by_val): 3479 (JSC::Interpreter::cti_op_put_by_val): 3480 * interpreter/Interpreter.h: 3481 (JSC::Interpreter::isJSByteArray): 3482 * runtime/ByteArray.cpp: Added. 3483 (JSC::ByteArray::create): 3484 * runtime/ByteArray.h: Added. 3485 (JSC::ByteArray::length): 3486 (JSC::ByteArray::set): 3487 (JSC::ByteArray::get): 3488 (JSC::ByteArray::data): 3489 (JSC::ByteArray::ByteArray): 3490 * runtime/JSByteArray.cpp: Added. 3491 (JSC::): 3492 (JSC::JSByteArray::JSByteArray): 3493 (JSC::JSByteArray::createStructure): 3494 (JSC::JSByteArray::getOwnPropertySlot): 3495 (JSC::JSByteArray::put): 3496 (JSC::JSByteArray::getPropertyNames): 3497 * runtime/JSByteArray.h: Added. 3498 (JSC::JSByteArray::canAccessIndex): 3499 (JSC::JSByteArray::getIndex): 3500 (JSC::JSByteArray::setIndex): 3501 (JSC::JSByteArray::classInfo): 3502 (JSC::JSByteArray::length): 3503 (JSC::JSByteArray::): 3504 (JSC::JSByteArray::JSByteArray): 3505 (JSC::asByteArray): 3506 35072009-01-05 Alexey Proskuryakov <ap@webkit.org> 3508 3509 Reviewed by Darin Adler. 3510 3511 https://bugs.webkit.org/show_bug.cgi?id=23073 3512 <rdar://problem/6471129> Workers crash on Windows Release builds 3513 3514 * wtf/ThreadSpecific.h: 3515 (WTF::ThreadSpecific::destroy): Changed to clear the pointer only after data object 3516 destruction is finished - otherwise, WebCore::ThreadGlobalData destructor was re-creating 3517 the object in order to access atomic string table. 3518 (WTF::ThreadSpecific::operator T*): Symmetrically, set up the per-thread pointer before 3519 data constructor is called. 3520 3521 * wtf/ThreadingWin.cpp: (WTF::wtfThreadEntryPoint): Remove a Windows-only hack to finalize 3522 a thread - pthreadVC2 is a DLL, so it gets thread detached messages, and cleans up thread 3523 specific data automatically. Besides, this code wasn't even compiled in for some time now. 3524 35252009-01-05 Alexey Proskuryakov <ap@webkit.org> 3526 3527 Reviewed by Darin Adler. 3528 3529 https://bugs.webkit.org/show_bug.cgi?id=23115 3530 Create a version of ASSERT for use with otherwise unused variables 3531 3532 * wtf/Assertions.h: Added ASSERT_UNUSED. 3533 3534 * jit/ExecutableAllocatorPosix.cpp: 3535 (JSC::ExecutablePool::systemRelease): 3536 * runtime/Collector.cpp: 3537 (JSC::Heap::destroy): 3538 (JSC::Heap::heapAllocate): 3539 * runtime/JSNotAnObject.cpp: 3540 (JSC::JSNotAnObject::toPrimitive): 3541 (JSC::JSNotAnObject::getPrimitiveNumber): 3542 (JSC::JSNotAnObject::toBoolean): 3543 (JSC::JSNotAnObject::toNumber): 3544 (JSC::JSNotAnObject::toString): 3545 (JSC::JSNotAnObject::getOwnPropertySlot): 3546 (JSC::JSNotAnObject::put): 3547 (JSC::JSNotAnObject::deleteProperty): 3548 (JSC::JSNotAnObject::getPropertyNames): 3549 * wtf/TCSystemAlloc.cpp: 3550 (TCMalloc_SystemRelease): 3551 Use it in some places that used other idioms for this purpose. 3552 35532009-01-04 Alice Liu <alice.liu@apple.com> 3554 3555 <rdar://problem/6341776> Merge m_transitionCount and m_offset in Structure. 3556 3557 Reviewed by Darin Adler. 3558 3559 * runtime/Structure.cpp: 3560 (JSC::Structure::Structure): Remove m_transitionCount 3561 (JSC::Structure::addPropertyTransitionToExistingStructure): No need to wait until after the assignment to offset to assert if it's notFound; move it up. 3562 (JSC::Structure::addPropertyTransition): Use method for transitionCount instead of m_transitionCount. Remove line that maintains the m_transitionCount. 3563 (JSC::Structure::changePrototypeTransition): Remove line that maintains the m_transitionCount. 3564 (JSC::Structure::getterSetterTransition): Remove line that maintains the m_transitionCount. 3565 * runtime/Structure.h: 3566 Changed s_maxTransitionLength and m_offset from size_t to signed char. m_offset will never become greater than 64 3567 because the structure transitions to a dictionary at that time. 3568 (JSC::Structure::transitionCount): method to replace the data member 3569 35702009-01-04 Darin Adler <darin@apple.com> 3571 3572 Reviewed by David Kilzer. 3573 3574 Bug 15114: Provide compile-time assertions for sizeof(UChar), sizeof(DeprecatedChar), etc. 3575 https://bugs.webkit.org/show_bug.cgi?id=15114 3576 3577 * wtf/unicode/Unicode.h: Assert size of UChar. There is no DeprecatedChar any more. 3578 35792009-01-03 Sam Weinig <sam@webkit.org> 3580 3581 Reviewed by Oliver Hunt. 3582 3583 Change the pcVector from storing native code pointers to storing offsets 3584 from the base pointer. This will allow us to generate the pcVector on demand 3585 for exceptions. 3586 3587 * bytecode/CodeBlock.h: 3588 (JSC::PC::PC): 3589 (JSC::getNativePCOffset): 3590 (JSC::CodeBlock::getBytecodeIndex): 3591 * jit/JIT.cpp: 3592 (JSC::JIT::privateCompile): 3593 35942009-01-02 Oliver Hunt <oliver@apple.com> 3595 3596 Reviewed by NOBODY (Build fix). 3597 3598 * runtime/ScopeChain.cpp: 3599 36002009-01-02 Oliver Hunt <oliver@apple.com> 3601 3602 Reviewed by Gavin Barraclough. 3603 3604 [jsfunfuzz] unwind logic for exceptions in eval fails to account for dynamic scope external to the eval 3605 https://bugs.webkit.org/show_bug.cgi?id=23078 3606 3607 This bug was caused by eval codeblocks being generated without accounting 3608 for the depth of the scope chain they inherited. This meant that exception 3609 handlers would understate their expected scope chain depth, which in turn 3610 led to incorrectly removing nodes from the scope chain. 3611 3612 * bytecompiler/BytecodeGenerator.cpp: 3613 (JSC::BytecodeGenerator::BytecodeGenerator): 3614 (JSC::BytecodeGenerator::emitCatch): 3615 * bytecompiler/BytecodeGenerator.h: 3616 * interpreter/Interpreter.cpp: 3617 (JSC::depth): 3618 * runtime/ScopeChain.cpp: 3619 (JSC::ScopeChain::localDepth): 3620 * runtime/ScopeChain.h: 3621 (JSC::ScopeChainNode::deref): 3622 (JSC::ScopeChainNode::ref): 3623 36242009-01-02 David Smith <catfish.man@gmail.com> 3625 3626 Reviewed by Darin Adler. 3627 3628 https://bugs.webkit.org/show_bug.cgi?id=22699 3629 Enable NodeList caching for getElementsByTagName 3630 3631 * wtf/HashFunctions.h: Moved the definition of PHI here and renamed to stringHashingStartValue 3632 36332009-01-02 David Kilzer <ddkilzer@apple.com> 3634 3635 Attempt to fix Qt Linux build after r39553 3636 3637 * wtf/RandomNumberSeed.h: Include <sys/time.h> for gettimeofday(). 3638 Include <sys/types.h> and <unistd.h> for getpid(). 3639 36402009-01-02 David Kilzer <ddkilzer@apple.com> 3641 3642 Bug 23081: These files are no longer part of the KDE libraries 3643 3644 <https://bugs.webkit.org/show_bug.cgi?id=23081> 3645 3646 Reviewed by Darin Adler. 3647 3648 Removed "This file is part of the KDE libraries" comment from 3649 source files. Added or updated Apple copyrights as well. 3650 3651 * parser/Lexer.h: 3652 * wtf/HashCountedSet.h: 3653 * wtf/RetainPtr.h: 3654 * wtf/VectorTraits.h: 3655 36562009-01-02 David Kilzer <ddkilzer@apple.com> 3657 3658 Bug 23080: Remove last vestiges of KJS references 3659 3660 <https://bugs.webkit.org/show_bug.cgi?id=23080> 3661 3662 Reviewed by Darin Adler. 3663 3664 Also updated Apple copyright statements. 3665 3666 * DerivedSources.make: Changed bison "kjsyy" prefix to "jscyy". 3667 * GNUmakefile.am: Ditto. 3668 * JavaScriptCore.pri: Ditto. Also changed KJSBISON to JSCBISON 3669 and kjsbison to jscbison. 3670 3671 * JavaScriptCoreSources.bkl: Changed JSCORE_KJS_SOURCES to 3672 JSCORE_JSC_SOURCES. 3673 * jscore.bkl: Ditto. 3674 3675 * create_hash_table: Updated copyright and removed old comment. 3676 3677 * parser/Grammar.y: Changed "kjsyy" prefix to "jscyy" prefix. 3678 * parser/Lexer.cpp: Ditto. Also changed KJS_DEBUG_LEX to 3679 JSC_DEBUG_LEX. 3680 (jscyylex): 3681 (JSC::Lexer::lex): 3682 * parser/Parser.cpp: Ditto. 3683 (JSC::Parser::parse): 3684 3685 * pcre/dftables: Changed "kjs_pcre_" prefix to "jsc_pcre_". 3686 * pcre/pcre_compile.cpp: Ditto. 3687 (getOthercaseRange): 3688 (encodeUTF8): 3689 (compileBranch): 3690 (calculateCompiledPatternLength): 3691 * pcre/pcre_exec.cpp: Ditto. 3692 (matchRef): 3693 (getUTF8CharAndIncrementLength): 3694 (match): 3695 * pcre/pcre_internal.h: Ditto. 3696 (toLowerCase): 3697 (flipCase): 3698 (classBitmapForChar): 3699 (charTypeForChar): 3700 * pcre/pcre_tables.cpp: Ditto. 3701 * pcre/pcre_ucp_searchfuncs.cpp: Ditto. 3702 (jsc_pcre_ucp_othercase): 3703 * pcre/pcre_xclass.cpp: Ditto. 3704 (getUTF8CharAndAdvancePointer): 3705 (jsc_pcre_xclass): 3706 3707 * runtime/Collector.h: Updated header guards using the 3708 clean-header-guards script. 3709 * runtime/CollectorHeapIterator.h: Added missing header guard. 3710 * runtime/Identifier.h: Updated header guards. 3711 * runtime/JSFunction.h: Fixed end-of-namespace comment. 3712 3713 * runtime/JSGlobalObject.cpp: 3714 (JSC::JSGlobalObject::reset): Renamed "kjsprint" debug function 3715 to "jscprint". Changed implementation method from 3716 globalFuncKJSPrint() to globalFuncJSCPrint(). 3717 * runtime/JSGlobalObjectFunctions.cpp: 3718 (JSC::globalFuncJSCPrint): Renamed from globalFuncKJSPrint(). 3719 * runtime/JSGlobalObjectFunctions.h: Ditto. 3720 3721 * runtime/JSImmediate.h: Updated header guards. 3722 * runtime/JSLock.h: Ditto. 3723 * runtime/JSType.h: Ditto. 3724 * runtime/JSWrapperObject.h: Ditto. 3725 * runtime/Lookup.h: Ditto. 3726 * runtime/Operations.h: Ditto. 3727 * runtime/Protect.h: Ditto. 3728 * runtime/RegExp.h: Ditto. 3729 * runtime/UString.h: Ditto. 3730 3731 * tests/mozilla/js1_5/Array/regress-157652.js: Changed "KJS" 3732 reference in comment to "JSC". 3733 3734 * wrec/CharacterClassConstructor.cpp: Change "kjs_pcre_" function 3735 prefixes to "jsc_pcre_". 3736 (JSC::WREC::CharacterClassConstructor::put): 3737 (JSC::WREC::CharacterClassConstructor::flush): 3738 3739 * wtf/unicode/Unicode.h: Change "KJS_" header guard to "WTF_". 3740 * wtf/unicode/icu/UnicodeIcu.h: Ditto. 3741 * wtf/unicode/qt4/UnicodeQt4.h: Ditto. 3742 37432009-01-02 Oliver Hunt <oliver@apple.com> 3744 3745 Reviewed by Maciej Stachowiak. 3746 3747 Make randomNumber generate 2^53 values instead of 2^32 (or 2^31 for rand() platforms) 3748 3749 * wtf/RandomNumber.cpp: 3750 (WTF::randomNumber): 3751 37522009-01-02 David Kilzer <ddkilzer@apple.com> 3753 3754 Remove declaration for JSC::Identifier::initializeIdentifierThreading() 3755 3756 Reviewed by Alexey Proskuryakov. 3757 3758 * runtime/Identifier.h: 3759 (JSC::Identifier::initializeIdentifierThreading): Removed 3760 declaration since the implementation was removed in r34412. 3761 37622009-01-01 Darin Adler <darin@apple.com> 3763 3764 Reviewed by Oliver Hunt. 3765 3766 String.replace does not support $& replacement metacharacter when search term is not a RegExp 3767 <https://bugs.webkit.org/show_bug.cgi?id=21431> 3768 <rdar://problem/6274993> 3769 3770 Test: fast/js/string-replace-3.html 3771 3772 * runtime/StringPrototype.cpp: 3773 (JSC::substituteBackreferences): Added a null check here so we won't try to handle $$-$9 3774 backreferences when the search term is a string, not a RegExp. Added a check for 0 so we 3775 won't try to handle $0 or $00 as a backreference. 3776 (JSC::stringProtoFuncReplace): Added a call to substituteBackreferences. 3777 37782009-01-01 Gavin Barraclough <barraclough@apple.com> 3779 3780 Reviewed by Darin Adler. 3781 3782 Allow 32-bit integers to be stored in JSImmediates, on x64-bit. 3783 Presently the top 32-bits of a 64-bit JSImmediate serve as a sign extension of a 31-bit 3784 int stored in the low word (shifted left by one, to make room for a tag). In the new 3785 format, the top 31-bits serve as a sign extension of a 32-bit int, still shifted left by 3786 one. 3787 3788 The new behavior is enabled using a flag in Platform.h, 'WTF_USE_ALTERNATE_JSIMMEDIATE'. 3789 When this is set the constants defining the range of ints allowed to be stored as 3790 JSImmediate values is extended. The code in JSImmediate.h can safely operate on either 3791 format. This patch updates the JIT so that it can also operate with the new format. 3792 3793 ~2% progression on x86-64, with & without the JIT, on sunspider & v8 tests. 3794 3795 * assembler/MacroAssembler.h: 3796 (JSC::MacroAssembler::addPtr): 3797 (JSC::MacroAssembler::orPtr): 3798 (JSC::MacroAssembler::or32): 3799 (JSC::MacroAssembler::rshiftPtr): 3800 (JSC::MacroAssembler::rshift32): 3801 (JSC::MacroAssembler::subPtr): 3802 (JSC::MacroAssembler::xorPtr): 3803 (JSC::MacroAssembler::xor32): 3804 (JSC::MacroAssembler::move): 3805 (JSC::MacroAssembler::compareImm64ForBranch): 3806 (JSC::MacroAssembler::compareImm64ForBranchEquality): 3807 (JSC::MacroAssembler::jePtr): 3808 (JSC::MacroAssembler::jgePtr): 3809 (JSC::MacroAssembler::jlPtr): 3810 (JSC::MacroAssembler::jlePtr): 3811 (JSC::MacroAssembler::jnePtr): 3812 (JSC::MacroAssembler::jnzSubPtr): 3813 (JSC::MacroAssembler::joAddPtr): 3814 (JSC::MacroAssembler::jzSubPtr): 3815 * assembler/X86Assembler.h: 3816 (JSC::X86Assembler::addq_rr): 3817 (JSC::X86Assembler::orq_ir): 3818 (JSC::X86Assembler::subq_ir): 3819 (JSC::X86Assembler::xorq_rr): 3820 (JSC::X86Assembler::sarq_CLr): 3821 (JSC::X86Assembler::sarq_i8r): 3822 (JSC::X86Assembler::cmpq_ir): 3823 * jit/JIT.cpp: 3824 (JSC::JIT::compileOpStrictEq): 3825 (JSC::JIT::privateCompileMainPass): 3826 (JSC::JIT::privateCompileSlowCases): 3827 (JSC::JIT::privateCompileCTIMachineTrampolines): 3828 * jit/JIT.h: 3829 * jit/JITArithmetic.cpp: 3830 (JSC::JIT::compileFastArith_op_lshift): 3831 (JSC::JIT::compileFastArithSlow_op_lshift): 3832 (JSC::JIT::compileFastArith_op_rshift): 3833 (JSC::JIT::compileFastArithSlow_op_rshift): 3834 (JSC::JIT::compileFastArith_op_bitand): 3835 (JSC::JIT::compileFastArithSlow_op_bitand): 3836 (JSC::JIT::compileFastArith_op_mod): 3837 (JSC::JIT::compileFastArithSlow_op_mod): 3838 (JSC::JIT::compileFastArith_op_add): 3839 (JSC::JIT::compileFastArithSlow_op_add): 3840 (JSC::JIT::compileFastArith_op_mul): 3841 (JSC::JIT::compileFastArithSlow_op_mul): 3842 (JSC::JIT::compileFastArith_op_post_inc): 3843 (JSC::JIT::compileFastArithSlow_op_post_inc): 3844 (JSC::JIT::compileFastArith_op_post_dec): 3845 (JSC::JIT::compileFastArithSlow_op_post_dec): 3846 (JSC::JIT::compileFastArith_op_pre_inc): 3847 (JSC::JIT::compileFastArithSlow_op_pre_inc): 3848 (JSC::JIT::compileFastArith_op_pre_dec): 3849 (JSC::JIT::compileFastArithSlow_op_pre_dec): 3850 (JSC::JIT::compileBinaryArithOp): 3851 * jit/JITInlineMethods.h: 3852 (JSC::JIT::getConstantOperand): 3853 (JSC::JIT::getConstantOperandImmediateInt): 3854 (JSC::JIT::isOperandConstantImmediateInt): 3855 (JSC::JIT::isOperandConstant31BitImmediateInt): 3856 (JSC::JIT::emitFastArithDeTagImmediate): 3857 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): 3858 (JSC::JIT::emitFastArithReTagImmediate): 3859 (JSC::JIT::emitFastArithImmToInt): 3860 (JSC::JIT::emitFastArithIntToImmNoCheck): 3861 * runtime/JSImmediate.h: 3862 (JSC::JSImmediate::isPositiveNumber): 3863 (JSC::JSImmediate::isNegative): 3864 (JSC::JSImmediate::rightShiftImmediateNumbers): 3865 (JSC::JSImmediate::canDoFastAdditiveOperations): 3866 (JSC::JSImmediate::makeValue): 3867 (JSC::JSImmediate::makeInt): 3868 (JSC::JSImmediate::makeBool): 3869 (JSC::JSImmediate::intValue): 3870 (JSC::JSImmediate::rawValue): 3871 (JSC::JSImmediate::toBoolean): 3872 (JSC::JSImmediate::from): 3873 * wtf/Platform.h: 3874 38752008-12-31 Oliver Hunt <oliver@apple.com> 3876 3877 Reviewed by Cameron Zwarich. 3878 3879 [jsfunfuzz] Assertion + incorrect behaviour with dynamically created local variable in a catch block 3880 <https://bugs.webkit.org/show_bug.cgi?id=23063> 3881 3882 Eval inside a catch block attempts to use the catch block's static scope in 3883 an unsafe way by attempting to add new properties to the scope. This patch 3884 fixes this issue simply by preventing the catch block from using a static 3885 scope if it contains an eval. 3886 3887 * parser/Grammar.y: 3888 * parser/Nodes.cpp: 3889 (JSC::TryNode::emitBytecode): 3890 * parser/Nodes.h: 3891 (JSC::TryNode::): 3892 38932008-12-31 Oliver Hunt <oliver@apple.com> 3894 3895 Reviewed by Gavin Barraclough. 3896 3897 [jsfunfuzz] Computed exception offset wrong when first instruction is attempt to resolve deleted eval 3898 <https://bugs.webkit.org/show_bug.cgi?id=23062> 3899 3900 This was caused by the expression information for the initial resolve of 3901 eval not being emitted. If this resolve was the first instruction that 3902 could throw an exception the information search would fail leading to an 3903 assertion failure. If it was not the first throwable opcode the wrong 3904 expression information would used. 3905 3906 Fix is simply to emit the expression info. 3907 3908 * parser/Nodes.cpp: 3909 (JSC::EvalFunctionCallNode::emitBytecode): 3910 39112008-12-31 Cameron Zwarich <cwzwarich@uwaterloo.ca> 3912 3913 Reviewed by Oliver Hunt. 3914 3915 Bug 23054: Caching of global lookups occurs even when the global object has become a dictionary 3916 <https://bugs.webkit.org/show_bug.cgi?id=23054> 3917 <rdar://problem/6469905> 3918 3919 * interpreter/Interpreter.cpp: 3920 (JSC::Interpreter::resolveGlobal): Do not cache lookup if the global 3921 object has transitioned to a dictionary. 3922 (JSC::Interpreter::cti_op_resolve_global): Do not cache lookup if the 3923 global object has transitioned to a dictionary. 3924 39252008-12-30 Oliver Hunt <oliver@apple.com> 3926 3927 Reviewed by Darin Adler. 3928 3929 <https://bugs.webkit.org/show_bug.cgi?id=23049> [jsfunfuzz] With blocks do not correctly protect their scope object 3930 <rdar://problem/6469742> Crash in JSC::TypeInfo::hasStandardGetOwnPropertySlot() running jsfunfuzz 3931 3932 The problem that caused this was that with nodes were not correctly protecting 3933 the final object that was placed in the scope chain. We correct this by forcing 3934 the use of a temporary register (which stops us relying on a local register 3935 protecting the scope) and changing the behaviour of op_push_scope so that it 3936 will store the final scope object. 3937 3938 * bytecompiler/BytecodeGenerator.cpp: 3939 (JSC::BytecodeGenerator::emitPushScope): 3940 * interpreter/Interpreter.cpp: 3941 (JSC::Interpreter::privateExecute): 3942 (JSC::Interpreter::cti_op_push_scope): 3943 * interpreter/Interpreter.h: 3944 * jit/JIT.cpp: 3945 (JSC::JIT::privateCompileMainPass): 3946 * parser/Nodes.cpp: 3947 (JSC::WithNode::emitBytecode): 3948 39492008-12-30 Cameron Zwarich <cwzwarich@uwaterloo.ca> 3950 3951 Reviewed by Sam Weinig. 3952 3953 Bug 23037: Parsing and reparsing disagree on automatic semicolon insertion 3954 <https://bugs.webkit.org/show_bug.cgi?id=23037> 3955 <rdar://problem/6467124> 3956 3957 Parsing and reparsing disagree about automatic semicolon insertion, so that a 3958 function like 3959 3960 function() { a = 1, } 3961 3962 is parsed as being syntactically valid but gets a syntax error upon reparsing. 3963 This leads to an assertion failure in Parser::reparse(). It is not that big of 3964 an issue in practice, because in a Release build such a function will return 3965 'undefined' when called. 3966 3967 In this case, we are not following the spec and it should be a syntax error. 3968 However, unless there is a newline separating the ',' and the '}', WebKit would 3969 not treat it as a syntax error in the past either. It would be a bit of work to 3970 make the automatic semicolon insertion match the spec exactly, so this patch 3971 changes it to match our past behaviour. 3972 3973 The problem is that even during reparsing, the Lexer adds a semicolon at the 3974 end of the input, which confuses allowAutomaticSemicolon(), because it is 3975 expecting either a '}', the end of input, or a terminator like a newline. 3976 3977 * parser/Lexer.cpp: 3978 (JSC::Lexer::Lexer): Initialize m_isReparsing to false. 3979 (JSC::Lexer::lex): Do not perform automatic semicolon insertion in the Lexer if 3980 we are in the middle of reparsing. 3981 (JSC::Lexer::clear): Set m_isReparsing to false. 3982 * parser/Lexer.h: 3983 (JSC::Lexer::setIsReparsing): Added. 3984 * parser/Parser.cpp: 3985 (JSC::Parser::reparse): Call Lexer::setIsReparsing() to notify the Lexer of 3986 reparsing. 3987 39882008-12-29 Oliver Hunt <oliver@apple.com> 3989 3990 Reviewed by NOBODY (Build fix). 3991 3992 Yet another attempt to fix Tiger. 3993 3994 * wtf/RandomNumber.cpp: 3995 (WTF::randomNumber): 3996 39972008-12-29 Oliver Hunt <oliver@apple.com> 3998 3999 Reviewed by NOBODY (Build fix). 4000 4001 Tiger build fix (correct this time) 4002 4003 * wtf/RandomNumber.cpp: 4004 40052008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca> 4006 4007 Rubber-stamped by Alexey Proskuryakov. 4008 4009 Revert r39509, because kjsyydebug is used in the generated code if YYDEBUG is 1. 4010 4011 * parser/Grammar.y: 4012 40132008-12-29 Oliver Hunt <oliver@apple.com> 4014 4015 Reviewed by NOBODY (Build fix). 4016 4017 Tiger build fix. 4018 4019 * wtf/RandomNumber.cpp: 4020 40212008-12-29 Oliver Hunt <oliver@apple.com> 4022 4023 Reviewed by Mark Rowe. 4024 4025 <rdar://problem/6358108> Insecure randomness in Math.random() leads to user tracking 4026 4027 Switch to arc4random on PLATFORM(DARWIN), this is ~1.5x slower than random(), but the 4028 it is still so fast that there is no fathomable way it could be a bottleneck for anything. 4029 4030 randomNumber is called in two places 4031 * During form submission where it is called once per form 4032 * Math.random in JSC. For this difference to show up you have to be looping on 4033 a cached local copy of random, for a large (>10000) calls. 4034 4035 No change in SunSpider. 4036 4037 * wtf/RandomNumber.cpp: 4038 (WTF::randomNumber): 4039 * wtf/RandomNumberSeed.h: 4040 (WTF::initializeRandomNumberGenerator): 4041 40422008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca> 4043 4044 Rubber-stamped by Sam Weinig. 4045 4046 Remove unused kjsyydebug #define. 4047 4048 * parser/Grammar.y: 4049 40502008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca> 4051 4052 Reviewed by Oliver Hunt and Sam Weinig. 4053 4054 Bug 23029: REGRESSION (r39337): jsfunfuzz generates identical test files 4055 <https://bugs.webkit.org/show_bug.cgi?id=23029> 4056 <rdar://problem/6469185> 4057 4058 The unification of random number generation in r39337 resulted in random() 4059 being initialized on Darwin, but rand() actually being used. Fix this by 4060 making randomNumber() use random() instead of rand() on Darwin. 4061 4062 * wtf/RandomNumber.cpp: 4063 (WTF::randomNumber): 4064 40652008-12-29 Sam Weinig <sam@webkit.org> 4066 4067 Fix buildbots. 4068 4069 * runtime/Structure.cpp: 4070 40712008-12-29 Sam Weinig <sam@webkit.org> 4072 4073 Reviewed by Oliver Hunt. 4074 4075 Patch for https://bugs.webkit.org/show_bug.cgi?id=23026 4076 Move the deleted offsets vector into the PropertyMap 4077 4078 Saves 3 words per Structure. 4079 4080 * runtime/PropertyMapHashTable.h: 4081 * runtime/Structure.cpp: 4082 (JSC::Structure::addPropertyTransition): 4083 (JSC::Structure::changePrototypeTransition): 4084 (JSC::Structure::getterSetterTransition): 4085 (JSC::Structure::toDictionaryTransition): 4086 (JSC::Structure::fromDictionaryTransition): 4087 (JSC::Structure::copyPropertyTable): 4088 (JSC::Structure::put): 4089 (JSC::Structure::remove): 4090 (JSC::Structure::rehashPropertyMapHashTable): 4091 * runtime/Structure.h: 4092 (JSC::Structure::propertyStorageSize): 4093 40942008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca> 4095 4096 Reviewed by Oliver Hunt. 4097 4098 Change code using m_body.get() as a boolean to take advantage of the 4099 implicit conversion of RefPtr to boolean. 4100 4101 * runtime/JSFunction.cpp: 4102 (JSC::JSFunction::~JSFunction): 4103 41042008-12-28 Cameron Zwarich <cwzwarich@uwaterloo.ca> 4105 4106 Reviewed by Oliver Hunt. 4107 4108 Bug 22840: REGRESSION (r38349): Gmail doesn't load with profiling enabled 4109 <https://bugs.webkit.org/show_bug.cgi?id=22840> 4110 <rdar://problem/6468077> 4111 4112 * bytecompiler/BytecodeGenerator.cpp: 4113 (JSC::BytecodeGenerator::emitNewArray): Add an assertion that the range 4114 of registers passed to op_new_array is sequential. 4115 (JSC::BytecodeGenerator::emitCall): Correct the relocation of registers 4116 when emitting profiler hooks so that registers aren't leaked. Also, add 4117 an assertion that the 'this' register is always ref'd (because it is), 4118 remove the needless protection of the 'this' register when relocating, 4119 and add an assertion that the range of registers passed to op_call for 4120 function call arguments is sequential. 4121 (JSC::BytecodeGenerator::emitConstruct): Correct the relocation of 4122 registers when emitting profiler hooks so that registers aren't leaked. 4123 Also, add an assertion that the range of registers passed to op_construct 4124 for function call arguments is sequential. 4125 41262008-12-26 Mark Rowe <mrowe@apple.com> 4127 4128 Reviewed by Alexey Proskuryakov. 4129 4130 <rdar://problem/6467376> Race condition in WTF::currentThread can lead to a thread using two different identifiers during its lifetime 4131 4132 If a newly-created thread calls WTF::currentThread() before WTF::createThread calls establishIdentifierForPthreadHandle 4133 then more than one identifier will be used for the same thread. We can avoid this by adding some extra synchronization 4134 during thread creation that delays the execution of the thread function until the thread identifier has been set up, and 4135 an assertion to catch this problem should it reappear in the future. 4136 4137 * wtf/Threading.cpp: Added. 4138 (WTF::NewThreadContext::NewThreadContext): 4139 (WTF::threadEntryPoint): 4140 (WTF::createThread): Add cross-platform createThread function that delays the execution of the thread function until 4141 after the thread identifier has been set up. 4142 * wtf/Threading.h: 4143 * wtf/ThreadingGtk.cpp: 4144 (WTF::establishIdentifierForThread): 4145 (WTF::createThreadInternal): 4146 * wtf/ThreadingNone.cpp: 4147 (WTF::createThreadInternal): 4148 * wtf/ThreadingPthreads.cpp: 4149 (WTF::establishIdentifierForPthreadHandle): 4150 (WTF::createThreadInternal): 4151 * wtf/ThreadingQt.cpp: 4152 (WTF::identifierByQthreadHandle): 4153 (WTF::establishIdentifierForThread): 4154 (WTF::createThreadInternal): 4155 * wtf/ThreadingWin.cpp: 4156 (WTF::storeThreadHandleByIdentifier): 4157 (WTF::createThreadInternal): 4158 4159 Add Threading.cpp to the build. 4160 4161 * GNUmakefile.am: 4162 * JavaScriptCore.pri: 4163 * JavaScriptCore.scons: 4164 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 4165 * JavaScriptCore.xcodeproj/project.pbxproj: 4166 * JavaScriptCoreSources.bkl: 4167 41682008-12-26 Sam Weinig <sam@webkit.org> 4169 4170 Reviewed by Alexey Proskuryakov. 4171 4172 Remove unused method. 4173 4174 * runtime/Structure.h: Remove mutableTypeInfo. 4175 41762008-12-22 Gavin Barraclough <barraclough@apple.com> 4177 4178 Reviewed by Oliver Hunt. 4179 4180 Fix rounding / bounds / signed comparison bug in ExecutableAllocator. 4181 4182 ExecutableAllocator::alloc assumed that m_freePtr would be aligned. This was 4183 not always true, since the first allocation from an additional pool would not 4184 be rounded up. Subsequent allocations would be unaligned, and too much memory 4185 could be erroneously allocated from the pool, when the size requested was 4186 available, but the size rounded up to word granularity was not available in the 4187 pool. This may result in the value of m_freePtr being greater than m_end. 4188 4189 Under these circumstances, the unsigned check for space will always pass, 4190 resulting in pointers to memory outside of the arena being returned, and 4191 ultimately segfaulty goodness when attempting to memcpy the hot freshly jitted 4192 code from the AssemblerBuffer. 4193 4194 https://bugs.webkit.org/show_bug.cgi?id=22974 4195 ... and probably many, many more. 4196 4197 * jit/ExecutableAllocator.h: 4198 (JSC::ExecutablePool::alloc): 4199 (JSC::ExecutablePool::roundUpAllocationSize): 4200 (JSC::ExecutablePool::ExecutablePool): 4201 (JSC::ExecutablePool::poolAllocate): 4202 42032008-12-22 Sam Weinig <sam@webkit.org> 4204 4205 Reviewed by Gavin Barraclough. 4206 4207 Rename all uses of the term "repatch" to "patch". 4208 4209 * assembler/MacroAssembler.h: 4210 (JSC::MacroAssembler::DataLabelPtr::patch): 4211 (JSC::MacroAssembler::DataLabel32::patch): 4212 (JSC::MacroAssembler::Jump::patch): 4213 (JSC::MacroAssembler::PatchBuffer::PatchBuffer): 4214 (JSC::MacroAssembler::PatchBuffer::setPtr): 4215 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch): 4216 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch): 4217 (JSC::MacroAssembler::storePtrWithPatch): 4218 (JSC::MacroAssembler::jnePtrWithPatch): 4219 * assembler/X86Assembler.h: 4220 (JSC::X86Assembler::patchAddress): 4221 (JSC::X86Assembler::patchImmediate): 4222 (JSC::X86Assembler::patchPointer): 4223 (JSC::X86Assembler::patchBranchOffset): 4224 * interpreter/Interpreter.cpp: 4225 (JSC::Interpreter::tryCTICachePutByID): 4226 (JSC::Interpreter::tryCTICacheGetByID): 4227 (JSC::Interpreter::cti_op_put_by_id): 4228 (JSC::Interpreter::cti_op_get_by_id): 4229 (JSC::Interpreter::cti_op_get_by_id_self_fail): 4230 (JSC::Interpreter::cti_op_get_by_id_proto_list): 4231 (JSC::Interpreter::cti_vm_dontLazyLinkCall): 4232 * jit/JIT.cpp: 4233 (JSC::ctiPatchCallByReturnAddress): 4234 (JSC::JIT::privateCompileMainPass): 4235 (JSC::JIT::privateCompile): 4236 (JSC::JIT::privateCompileCTIMachineTrampolines): 4237 * jit/JIT.h: 4238 * jit/JITCall.cpp: 4239 (JSC::JIT::unlinkCall): 4240 (JSC::JIT::linkCall): 4241 (JSC::JIT::compileOpCall): 4242 * jit/JITPropertyAccess.cpp: 4243 (JSC::JIT::compileGetByIdHotPath): 4244 (JSC::JIT::compilePutByIdHotPath): 4245 (JSC::JIT::compileGetByIdSlowCase): 4246 (JSC::JIT::compilePutByIdSlowCase): 4247 (JSC::JIT::privateCompilePutByIdTransition): 4248 (JSC::JIT::patchGetByIdSelf): 4249 (JSC::JIT::patchPutByIdReplace): 4250 (JSC::JIT::privateCompilePatchGetArrayLength): 4251 (JSC::JIT::privateCompileGetByIdSelf): 4252 (JSC::JIT::privateCompileGetByIdProto): 4253 (JSC::JIT::privateCompileGetByIdSelfList): 4254 (JSC::JIT::privateCompileGetByIdProtoList): 4255 (JSC::JIT::privateCompileGetByIdChainList): 4256 (JSC::JIT::privateCompileGetByIdChain): 4257 (JSC::JIT::privateCompilePutByIdReplace): 4258 42592008-12-22 Adam Roben <aroben@apple.com> 4260 4261 Build fix after r39428 4262 4263 * jit/JITCall.cpp: 4264 (JSC::JIT::compileOpCallSlowCase): Added a missing MacroAssembler:: 4265 42662008-12-22 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 4267 4268 Rubber-stamped by George Staikos. 4269 4270 Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago. 4271 4272 * wtf/RandomNumber.cpp: 4273 * wtf/RandomNumber.h: 4274 * wtf/RandomNumberSeed.h: 4275 42762008-12-21 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 4277 4278 Rubber-stamped by George Staikos. 4279 4280 Fix copyright of the new RandomNumber* files. 4281 4282 * wtf/RandomNumber.cpp: 4283 * wtf/RandomNumber.h: 4284 * wtf/RandomNumberSeed.h: 4285 42862008-12-21 Gavin Barraclough <barraclough@apple.com> 4287 4288 Reviewed by Oliver Hunt & Cameron Zwarich. 4289 4290 Add support for call and property access repatching on x86-64. 4291 4292 No change in performance on current configurations (2x impovement on v8-tests with JIT enabled on x86-64). 4293 4294 * assembler/MacroAssembler.h: 4295 (JSC::MacroAssembler::DataLabelPtr::repatch): 4296 (JSC::MacroAssembler::DataLabelPtr::operator X86Assembler::JmpDst): 4297 (JSC::MacroAssembler::DataLabel32::repatch): 4298 (JSC::MacroAssembler::RepatchBuffer::addressOf): 4299 (JSC::MacroAssembler::add32): 4300 (JSC::MacroAssembler::sub32): 4301 (JSC::MacroAssembler::loadPtrWithAddressOffsetRepatch): 4302 (JSC::MacroAssembler::storePtrWithAddressOffsetRepatch): 4303 (JSC::MacroAssembler::jePtr): 4304 (JSC::MacroAssembler::jnePtr): 4305 (JSC::MacroAssembler::jnePtrWithRepatch): 4306 (JSC::MacroAssembler::differenceBetween): 4307 * assembler/X86Assembler.h: 4308 (JSC::X86Assembler::addl_im): 4309 (JSC::X86Assembler::subl_im): 4310 (JSC::X86Assembler::cmpl_rm): 4311 (JSC::X86Assembler::movq_rm_disp32): 4312 (JSC::X86Assembler::movq_mr_disp32): 4313 (JSC::X86Assembler::repatchPointer): 4314 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32): 4315 * jit/JIT.cpp: 4316 (JSC::JIT::privateCompile): 4317 (JSC::JIT::privateCompileCTIMachineTrampolines): 4318 * jit/JIT.h: 4319 * jit/JITCall.cpp: 4320 (JSC::JIT::unlinkCall): 4321 (JSC::JIT::linkCall): 4322 (JSC::JIT::compileOpCall): 4323 (JSC::JIT::compileOpCallSlowCase): 4324 * jit/JITInlineMethods.h: 4325 (JSC::JIT::restoreArgumentReferenceForTrampoline): 4326 * jit/JITPropertyAccess.cpp: 4327 (JSC::JIT::compileGetByIdHotPath): 4328 (JSC::JIT::compileGetByIdSlowCase): 4329 (JSC::JIT::compilePutByIdHotPath): 4330 (JSC::JIT::compilePutByIdSlowCase): 4331 (JSC::resizePropertyStorage): 4332 (JSC::JIT::privateCompilePutByIdTransition): 4333 (JSC::JIT::privateCompileGetByIdProto): 4334 (JSC::JIT::privateCompileGetByIdProtoList): 4335 (JSC::JIT::privateCompileGetByIdChainList): 4336 (JSC::JIT::privateCompileGetByIdChain): 4337 * wtf/Platform.h: 4338 43392008-12-20 Gavin Barraclough <barraclough@apple.com> 4340 4341 Reviewed by Oliver Hunt. 4342 4343 Port optimized property access generation to the MacroAssembler. 4344 4345 * assembler/MacroAssembler.h: 4346 (JSC::MacroAssembler::AbsoluteAddress::AbsoluteAddress): 4347 (JSC::MacroAssembler::DataLabelPtr::repatch): 4348 (JSC::MacroAssembler::DataLabel32::DataLabel32): 4349 (JSC::MacroAssembler::DataLabel32::repatch): 4350 (JSC::MacroAssembler::Label::operator X86Assembler::JmpDst): 4351 (JSC::MacroAssembler::Jump::repatch): 4352 (JSC::MacroAssembler::JumpList::empty): 4353 (JSC::MacroAssembler::RepatchBuffer::link): 4354 (JSC::MacroAssembler::add32): 4355 (JSC::MacroAssembler::and32): 4356 (JSC::MacroAssembler::sub32): 4357 (JSC::MacroAssembler::loadPtrWithAddressRepatch): 4358 (JSC::MacroAssembler::storePtrWithAddressRepatch): 4359 (JSC::MacroAssembler::push): 4360 (JSC::MacroAssembler::ja32): 4361 (JSC::MacroAssembler::jePtr): 4362 (JSC::MacroAssembler::jnePtr): 4363 (JSC::MacroAssembler::jnePtrWithRepatch): 4364 (JSC::MacroAssembler::align): 4365 (JSC::MacroAssembler::differenceBetween): 4366 * assembler/X86Assembler.h: 4367 (JSC::X86Assembler::movl_rm_disp32): 4368 (JSC::X86Assembler::movl_mr_disp32): 4369 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32): 4370 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM): 4371 * jit/JIT.cpp: 4372 (JSC::ctiRepatchCallByReturnAddress): 4373 (JSC::JIT::privateCompileMainPass): 4374 (JSC::JIT::privateCompile): 4375 (JSC::JIT::privateCompileCTIMachineTrampolines): 4376 * jit/JIT.h: 4377 * jit/JITPropertyAccess.cpp: 4378 (JSC::JIT::compileGetByIdHotPath): 4379 (JSC::JIT::compileGetByIdSlowCase): 4380 (JSC::JIT::compilePutByIdHotPath): 4381 (JSC::JIT::compilePutByIdSlowCase): 4382 (JSC::resizePropertyStorage): 4383 (JSC::JIT::privateCompilePutByIdTransition): 4384 (JSC::JIT::patchGetByIdSelf): 4385 (JSC::JIT::patchPutByIdReplace): 4386 (JSC::JIT::privateCompilePatchGetArrayLength): 4387 (JSC::JIT::privateCompileGetByIdSelf): 4388 (JSC::JIT::privateCompileGetByIdProto): 4389 (JSC::JIT::privateCompileGetByIdSelfList): 4390 (JSC::JIT::privateCompileGetByIdProtoList): 4391 (JSC::JIT::privateCompileGetByIdChainList): 4392 (JSC::JIT::privateCompileGetByIdChain): 4393 (JSC::JIT::privateCompilePutByIdReplace): 4394 * wtf/RefCounted.h: 4395 (WTF::RefCountedBase::addressOfCount): 4396 43972008-12-19 Gustavo Noronha Silva <gns@gnome.org> 4398 4399 Reviewed by Holger Freyther. 4400 4401 https://bugs.webkit.org/show_bug.cgi?id=22686 4402 4403 Added file which was missing to the javascriptcore_sources 4404 variable, so that it shows up in the tarball created by `make 4405 dist'. 4406 4407 * GNUmakefile.am: 4408 44092008-12-19 Holger Hans Peter Freyther <zecke@selfish.org> 4410 4411 Reviewed by Antti Koivisto. 4412 4413 Build fix when building JS API tests with a c89 c compiler 4414 4415 Do not use C++ style comments and convert them to C comments. 4416 4417 * wtf/Platform.h: 4418 44192008-12-18 Gavin Barraclough <barraclough@apple.com> 4420 4421 Reviewed by Sam Weinig. 4422 4423 Same as last revision, adding cases for pre & post inc & dec. 4424 4425 https://bugs.webkit.org/show_bug.cgi?id=22928 4426 4427 * jit/JIT.cpp: 4428 (JSC::JIT::privateCompileMainPass): 4429 44302008-12-18 Gavin Barraclough <barraclough@apple.com> 4431 4432 Reviewed by Sam Weinig. 4433 4434 Fixes for the JIT's handling of JSImmediate values on x86-64. 4435 On 64-bit systems, the code in JSImmediate.h relies on the upper 4436 bits of a JSImmediate being a sign extension of the low 32-bits. 4437 This was not being enforced by the JIT, since a number of inline 4438 operations were being performed on 32-bit values in registers, and 4439 when a 32-bit result is written to a register on x86-64 the value 4440 is zero-extended to 64-bits. 4441 4442 This fix honors previous behavoir. A better fix in the long run 4443 (when the JIT is enabled by default) may be to change JSImmediate.h 4444 so it no longer relies on the upper bits of the pointer,... though 4445 if we're going to change JSImmediate.h for 64-bit, we probably may 4446 as well change the format so that the full range of 32-bit ints can 4447 be stored, rather than just 31-bits. 4448 4449 https://bugs.webkit.org/show_bug.cgi?id=22925 4450 4451 * assembler/MacroAssembler.h: 4452 (JSC::MacroAssembler::addPtr): 4453 (JSC::MacroAssembler::andPtr): 4454 (JSC::MacroAssembler::orPtr): 4455 (JSC::MacroAssembler::or32): 4456 (JSC::MacroAssembler::xor32): 4457 (JSC::MacroAssembler::xorPtr): 4458 (JSC::MacroAssembler::signExtend32ToPtr): 4459 * assembler/X86Assembler.h: 4460 (JSC::X86Assembler::): 4461 (JSC::X86Assembler::andq_rr): 4462 (JSC::X86Assembler::andq_ir): 4463 (JSC::X86Assembler::orq_rr): 4464 (JSC::X86Assembler::xorq_ir): 4465 (JSC::X86Assembler::movsxd_rr): 4466 * jit/JIT.cpp: 4467 (JSC::JIT::privateCompileMainPass): 4468 * jit/JITInlineMethods.h: 4469 (JSC::JIT::emitFastArithReTagImmediate): 4470 (JSC::JIT::emitFastArithPotentiallyReTagImmediate): 4471 (JSC::JIT::emitFastArithImmToInt): 4472 44732008-12-18 Gavin Barraclough <barraclough@apple.com> 4474 4475 Reviewed by Sam Weinig. 4476 4477 Just a tidy up - rename & refactor some the #defines configuring the JIT. 4478 4479 * interpreter/Interpreter.cpp: 4480 (JSC::Interpreter::cti_op_convert_this): 4481 (JSC::Interpreter::cti_op_end): 4482 (JSC::Interpreter::cti_op_add): 4483 (JSC::Interpreter::cti_op_pre_inc): 4484 (JSC::Interpreter::cti_timeout_check): 4485 (JSC::Interpreter::cti_register_file_check): 4486 (JSC::Interpreter::cti_op_loop_if_less): 4487 (JSC::Interpreter::cti_op_loop_if_lesseq): 4488 (JSC::Interpreter::cti_op_new_object): 4489 (JSC::Interpreter::cti_op_put_by_id_generic): 4490 (JSC::Interpreter::cti_op_get_by_id_generic): 4491 (JSC::Interpreter::cti_op_put_by_id): 4492 (JSC::Interpreter::cti_op_put_by_id_second): 4493 (JSC::Interpreter::cti_op_put_by_id_fail): 4494 (JSC::Interpreter::cti_op_get_by_id): 4495 (JSC::Interpreter::cti_op_get_by_id_second): 4496 (JSC::Interpreter::cti_op_get_by_id_self_fail): 4497 (JSC::Interpreter::cti_op_get_by_id_proto_list): 4498 (JSC::Interpreter::cti_op_get_by_id_proto_list_full): 4499 (JSC::Interpreter::cti_op_get_by_id_proto_fail): 4500 (JSC::Interpreter::cti_op_get_by_id_array_fail): 4501 (JSC::Interpreter::cti_op_get_by_id_string_fail): 4502 (JSC::Interpreter::cti_op_instanceof): 4503 (JSC::Interpreter::cti_op_del_by_id): 4504 (JSC::Interpreter::cti_op_mul): 4505 (JSC::Interpreter::cti_op_new_func): 4506 (JSC::Interpreter::cti_op_call_JSFunction): 4507 (JSC::Interpreter::cti_op_call_arityCheck): 4508 (JSC::Interpreter::cti_vm_dontLazyLinkCall): 4509 (JSC::Interpreter::cti_vm_lazyLinkCall): 4510 (JSC::Interpreter::cti_op_push_activation): 4511 (JSC::Interpreter::cti_op_call_NotJSFunction): 4512 (JSC::Interpreter::cti_op_create_arguments): 4513 (JSC::Interpreter::cti_op_create_arguments_no_params): 4514 (JSC::Interpreter::cti_op_tear_off_activation): 4515 (JSC::Interpreter::cti_op_tear_off_arguments): 4516 (JSC::Interpreter::cti_op_profile_will_call): 4517 (JSC::Interpreter::cti_op_profile_did_call): 4518 (JSC::Interpreter::cti_op_ret_scopeChain): 4519 (JSC::Interpreter::cti_op_new_array): 4520 (JSC::Interpreter::cti_op_resolve): 4521 (JSC::Interpreter::cti_op_construct_JSConstruct): 4522 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 4523 (JSC::Interpreter::cti_op_get_by_val): 4524 (JSC::Interpreter::cti_op_resolve_func): 4525 (JSC::Interpreter::cti_op_sub): 4526 (JSC::Interpreter::cti_op_put_by_val): 4527 (JSC::Interpreter::cti_op_put_by_val_array): 4528 (JSC::Interpreter::cti_op_lesseq): 4529 (JSC::Interpreter::cti_op_loop_if_true): 4530 (JSC::Interpreter::cti_op_negate): 4531 (JSC::Interpreter::cti_op_resolve_base): 4532 (JSC::Interpreter::cti_op_resolve_skip): 4533 (JSC::Interpreter::cti_op_resolve_global): 4534 (JSC::Interpreter::cti_op_div): 4535 (JSC::Interpreter::cti_op_pre_dec): 4536 (JSC::Interpreter::cti_op_jless): 4537 (JSC::Interpreter::cti_op_not): 4538 (JSC::Interpreter::cti_op_jtrue): 4539 (JSC::Interpreter::cti_op_post_inc): 4540 (JSC::Interpreter::cti_op_eq): 4541 (JSC::Interpreter::cti_op_lshift): 4542 (JSC::Interpreter::cti_op_bitand): 4543 (JSC::Interpreter::cti_op_rshift): 4544 (JSC::Interpreter::cti_op_bitnot): 4545 (JSC::Interpreter::cti_op_resolve_with_base): 4546 (JSC::Interpreter::cti_op_new_func_exp): 4547 (JSC::Interpreter::cti_op_mod): 4548 (JSC::Interpreter::cti_op_less): 4549 (JSC::Interpreter::cti_op_neq): 4550 (JSC::Interpreter::cti_op_post_dec): 4551 (JSC::Interpreter::cti_op_urshift): 4552 (JSC::Interpreter::cti_op_bitxor): 4553 (JSC::Interpreter::cti_op_new_regexp): 4554 (JSC::Interpreter::cti_op_bitor): 4555 (JSC::Interpreter::cti_op_call_eval): 4556 (JSC::Interpreter::cti_op_throw): 4557 (JSC::Interpreter::cti_op_get_pnames): 4558 (JSC::Interpreter::cti_op_next_pname): 4559 (JSC::Interpreter::cti_op_push_scope): 4560 (JSC::Interpreter::cti_op_pop_scope): 4561 (JSC::Interpreter::cti_op_typeof): 4562 (JSC::Interpreter::cti_op_is_undefined): 4563 (JSC::Interpreter::cti_op_is_boolean): 4564 (JSC::Interpreter::cti_op_is_number): 4565 (JSC::Interpreter::cti_op_is_string): 4566 (JSC::Interpreter::cti_op_is_object): 4567 (JSC::Interpreter::cti_op_is_function): 4568 (JSC::Interpreter::cti_op_stricteq): 4569 (JSC::Interpreter::cti_op_nstricteq): 4570 (JSC::Interpreter::cti_op_to_jsnumber): 4571 (JSC::Interpreter::cti_op_in): 4572 (JSC::Interpreter::cti_op_push_new_scope): 4573 (JSC::Interpreter::cti_op_jmp_scopes): 4574 (JSC::Interpreter::cti_op_put_by_index): 4575 (JSC::Interpreter::cti_op_switch_imm): 4576 (JSC::Interpreter::cti_op_switch_char): 4577 (JSC::Interpreter::cti_op_switch_string): 4578 (JSC::Interpreter::cti_op_del_by_val): 4579 (JSC::Interpreter::cti_op_put_getter): 4580 (JSC::Interpreter::cti_op_put_setter): 4581 (JSC::Interpreter::cti_op_new_error): 4582 (JSC::Interpreter::cti_op_debug): 4583 (JSC::Interpreter::cti_vm_throw): 4584 * interpreter/Interpreter.h: 4585 * jit/JIT.cpp: 4586 (JSC::): 4587 (JSC::JIT::privateCompileMainPass): 4588 (JSC::JIT::privateCompile): 4589 * jit/JIT.h: 4590 * jit/JITInlineMethods.h: 4591 (JSC::JIT::restoreArgumentReference): 4592 (JSC::JIT::restoreArgumentReferenceForTrampoline): 4593 * wtf/Platform.h: 4594 45952008-12-18 Cameron Zwarich <zwarich@apple.com> 4596 4597 Reviewed by Geoff Garen. 4598 4599 Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link 4600 <https://bugs.webkit.org/show_bug.cgi?id=21855> 4601 <rdar://problem/6278244> 4602 4603 Move DynamicGlobalObjectScope to JSGlobalObject.h so that it can be used 4604 from WebCore. 4605 4606 * interpreter/Interpreter.cpp: 4607 * runtime/JSGlobalObject.h: 4608 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): 4609 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope): 4610 46112008-12-17 Geoffrey Garen <ggaren@apple.com> 4612 4613 Reviewed by Gavin Barraclough. 4614 4615 Fixed https://bugs.webkit.org/show_bug.cgi?id=22393 4616 Segfault when caching property accesses to primitive cells. 4617 4618 Changed some asObject casts to asCell casts in cases where a primitive 4619 value may be a cell and not an object. 4620 4621 Re-enabled property caching for primitives in cases where it had been 4622 disabled because of this bug. 4623 4624 Updated a comment to better explain something Darin thought needed 4625 explaining in an old patch review. 4626 4627 * interpreter/Interpreter.cpp: 4628 (JSC::countPrototypeChainEntriesAndCheckForProxies): 4629 (JSC::Interpreter::tryCacheGetByID): 4630 (JSC::Interpreter::tryCTICacheGetByID): 4631 (JSC::Interpreter::cti_op_get_by_id_self_fail): 4632 (JSC::Interpreter::cti_op_get_by_id_proto_list): 4633 46342008-12-17 Gavin Barraclough <barraclough@apple.com> 4635 4636 Reviewed by Cameron Zwarich. 4637 4638 Fixes for Sunspider failures with the JIT enabled on x86-64. 4639 4640 * assembler/MacroAssembler.h: 4641 Switch the order of the RegisterID & Address form of je32, to keep it consistent with jne32. 4642 * jit/JIT.cpp: 4643 * jit/JIT.h: 4644 * jit/JITInlineMethods.h: 4645 Port the m_ctiVirtualCall tramopline generation to use the MacroAssembler interface. 4646 * jit/JITCall.cpp: 4647 Fix bug in the non-optimizing code path, vptr check should have been to the memory address pointer 4648 to by the register, not to the register itself. 4649 * wrec/WRECGenerator.cpp: 4650 See assembler/MacroAssembler.h, above. 4651 46522008-12-17 Gavin Barraclough <barraclough@apple.com> 4653 4654 Reviewed by Sam Weinig. 4655 4656 print("Hello, 64-bit jitted world!"); 4657 Get hello-world working through the JIT, on x86-64. 4658 4659 * assembler/X86Assembler.h: 4660 Fix encoding of opcode + RegisterID format instructions for 64-bit. 4661 * interpreter/Interpreter.cpp: 4662 * interpreter/Interpreter.h: 4663 Make VoidPtrPair actually be a pair of void*s. 4664 (Possibly should make this change for 32-bit Mac platforms, too - but won't change 32-bit behaviour in this patch). 4665 * jit/JIT.cpp: 4666 * jit/JIT.h: 4667 Provide names for the timeoutCheckRegister & callFrameRegister on x86-64, 4668 force x86-64 ctiTrampoline arguments onto the stack, 4669 implement the asm trampolines for x86-64, 4670 implement the restoreArgumentReference methods for x86-64 calling conventions. 4671 * jit/JITCall.cpp: 4672 * jit/JITInlineMethods.h: 4673 * wtf/Platform.h: 4674 Add switch settings to ENABLE(JIT), on PLATFORM(X86_64) (currently still disabled). 4675 46762008-12-17 Sam Weinig <sam@webkit.org> 4677 4678 Reviewed by Gavin Barraclough. 4679 4680 Add more CodeBlock statistics. 4681 4682 * bytecode/CodeBlock.cpp: 4683 (JSC::CodeBlock::dumpStatistics): 4684 46852008-12-17 Sam Weinig <sam@webkit.org> 4686 4687 Reviewed by Darin Adler. 4688 4689 Fix for https://bugs.webkit.org/show_bug.cgi?id=22897 4690 <rdar://problem/6428342> 4691 Look into feasibility of discarding bytecode after native codegen 4692 4693 Clear the bytecode Instruction vector at the end JIT generation. 4694 4695 Saves 4.8 MB on Membuster head. 4696 4697 * bytecode/CodeBlock.cpp: 4698 (JSC::CodeBlock::dump): Add logging for the case that someone tries 4699 to dump the instructions of a CodeBlock that has had its bytecode 4700 vector cleared. 4701 (JSC::CodeBlock::CodeBlock): Initialize the instructionCount 4702 (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead 4703 of the size of the instruction vector in the assertion. 4704 (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto. 4705 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto. 4706 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto. 4707 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto. 4708 * bytecode/CodeBlock.h: 4709 (JSC::CodeBlock::setInstructionCount): Store the instruction vector size 4710 in debug builds for assertions. 4711 * bytecompiler/BytecodeGenerator.cpp: 4712 (JSC::BytecodeGenerator::generate): 4713 * jit/JIT.cpp: 4714 (JSC::JIT::privateCompile): Clear the bytecode vector unless we 4715 have compiled with Opcode sampling where we will continue to require it 4716 47172008-12-17 Cary Clark <caryclark@google.com> 4718 4719 Reviewed by Darin Adler. 4720 Landed by Adam Barth. 4721 4722 Add ENABLE_TEXT_CARET to permit the ANDROID platform 4723 to invalidate and draw the caret in a separate thread. 4724 4725 * wtf/Platform.h: 4726 Default ENABLE_TEXT_CARET to 1. 4727 47282008-12-17 Alexey Proskuryakov <ap@webkit.org> 4729 4730 Reviewed by Darin Adler. 4731 4732 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard, take two. 4733 4734 * API/JSContextRef.cpp: The previous patch that claimed to do this was making Tiger and 4735 Leopard always use unique context group instead. 4736 47372008-12-16 Sam Weinig <sam@webkit.org> 4738 4739 Reviewed by Geoffrey Garen. 4740 4741 Fix for https://bugs.webkit.org/show_bug.cgi?id=22838 4742 Remove dependency on the bytecode Instruction buffer in Interpreter::throwException 4743 Part of <rdar://problem/6428342> 4744 4745 * bytecode/CodeBlock.cpp: 4746 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Added. Function to get 4747 a function Register index in a callFrame for a bytecode offset. 4748 (JSC::CodeBlock::shrinkToFit): Shrink m_getByIdExceptionInfo and m_functionRegisterInfos. 4749 * bytecode/CodeBlock.h: 4750 (JSC::FunctionRegisterInfo::FunctionRegisterInfo): Added. 4751 (JSC::CodeBlock::addFunctionRegisterInfo): 4752 * bytecompiler/BytecodeGenerator.cpp: 4753 (JSC::BytecodeGenerator::emitCall): 4754 * interpreter/Interpreter.cpp: 4755 (JSC::Interpreter::throwException): Use functionRegisterForBytecodeOffset in JIT 4756 mode. 4757 47582008-12-16 Sam Weinig <sam@webkit.org> 4759 4760 Reviewed by Gavin Barraclough. 4761 4762 Fix for https://bugs.webkit.org/show_bug.cgi?id=22837 4763 Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction 4764 Part of <rdar://problem/6428342> 4765 4766 * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*. 4767 * interpreter/Interpreter.cpp: 4768 (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC 4769 being in the instruction stream for JIT, so we can remove the check. 4770 (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS 4771 as the call frame returnPC as it is only necessary for looking up when 4772 throwing an exception. 4773 * interpreter/RegisterFile.h: 4774 (JSC::RegisterFile::): Added comment regarding returnPC storing a void*. 4775 * jit/JIT.h: Remove ARG_instr4. 4776 * jit/JITCall.cpp: 4777 (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer. 4778 47792008-12-16 Darin Adler <darin@apple.com> 4780 4781 Reviewed and landed by Cameron Zwarich. 4782 4783 Preparatory work for fixing 4784 4785 Bug 22887: Make UString::Rep use RefCounted rather than implementing its own ref counting 4786 <https://bugs.webkit.org/show_bug.cgi?id=22887> 4787 4788 Change the various string translators used by Identifier:add() so that 4789 they never zero the ref count of a newly created UString::Rep. 4790 4791 * runtime/Identifier.cpp: 4792 (JSC::CStringTranslator::translate): 4793 (JSC::Identifier::add): 4794 (JSC::UCharBufferTranslator::translate): 4795 47962008-12-16 Gavin Barraclough <barraclough@apple.com> 4797 4798 Build fix for 'doze. 4799 4800 * assembler/AssemblerBuffer.h: 4801 48022008-12-16 Gavin Barraclough <barraclough@apple.com> 4803 4804 Reviewed by Cameron Zwarich. 4805 4806 Make the JIT compile on x86-64. 4807 This largely involves populting the missing calls in MacroAssembler.h. 4808 In addition some reinterpret_casts need removing from the JIT, and the 4809 repatching property access code will need to be fully compiled out for 4810 now. The changes in interpret.cpp are to reorder the functions so that 4811 the _generic forms come before all other property access methods, and 4812 then to place all property access methods other than the generic forms 4813 under control of the ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS macro. 4814 4815 No performance impact. 4816 4817 * assembler/AssemblerBuffer.h: 4818 (JSC::AssemblerBuffer::putInt64Unchecked): 4819 * assembler/MacroAssembler.h: 4820 (JSC::MacroAssembler::loadPtr): 4821 (JSC::MacroAssembler::load32): 4822 (JSC::MacroAssembler::storePtr): 4823 (JSC::MacroAssembler::storePtrWithRepatch): 4824 (JSC::MacroAssembler::store32): 4825 (JSC::MacroAssembler::poke): 4826 (JSC::MacroAssembler::move): 4827 (JSC::MacroAssembler::testImm64): 4828 (JSC::MacroAssembler::jePtr): 4829 (JSC::MacroAssembler::jnePtr): 4830 (JSC::MacroAssembler::jnzPtr): 4831 (JSC::MacroAssembler::jzPtr): 4832 * assembler/X86Assembler.h: 4833 (JSC::X86Assembler::): 4834 (JSC::X86Assembler::cmpq_rr): 4835 (JSC::X86Assembler::cmpq_rm): 4836 (JSC::X86Assembler::cmpq_im): 4837 (JSC::X86Assembler::testq_i32m): 4838 (JSC::X86Assembler::movl_mEAX): 4839 (JSC::X86Assembler::movl_i32r): 4840 (JSC::X86Assembler::movl_EAXm): 4841 (JSC::X86Assembler::movq_rm): 4842 (JSC::X86Assembler::movq_mEAX): 4843 (JSC::X86Assembler::movq_mr): 4844 (JSC::X86Assembler::movq_i64r): 4845 (JSC::X86Assembler::movl_mr): 4846 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64): 4847 (JSC::X86Assembler::X86InstructionFormatter::immediate64): 4848 * interpreter/Interpreter.cpp: 4849 (JSC::Interpreter::cti_op_put_by_id_generic): 4850 (JSC::Interpreter::cti_op_get_by_id_generic): 4851 (JSC::Interpreter::cti_op_put_by_id): 4852 (JSC::Interpreter::cti_op_put_by_id_second): 4853 * jit/JIT.cpp: 4854 (JSC::JIT::privateCompileMainPass): 4855 (JSC::JIT::privateCompile): 4856 (JSC::JIT::privateCompileCTIMachineTrampolines): 4857 * jit/JITCall.cpp: 4858 (JSC::JIT::compileOpCallSetupArgs): 4859 (JSC::JIT::compileOpCall): 4860 * jit/JITPropertyAccess.cpp: 4861 (JSC::JIT::compileGetByIdHotPath): 4862 (JSC::JIT::compilePutByIdHotPath): 4863 * runtime/JSImmediate.h: 4864 (JSC::JSImmediate::makeInt): 4865 48662008-12-16 Cameron Zwarich <zwarich@apple.com> 4867 4868 Reviewed by Darin Adler. 4869 4870 Bug 22869: REGRESSION (r38407): http://news.cnet.com/8301-13579_3-9953533-37.html crashes 4871 <https://bugs.webkit.org/show_bug.cgi?id=22869> 4872 <rdar://problem/6402499> 4873 4874 Before r38407, Structure::m_nameInPrevious was ref'd due to it being 4875 stored in a PropertyMap. However, PropertyMaps are created lazily after 4876 r38407, so Structure::m_nameInPrevious is not necessarily ref'd while 4877 it is being used. Making it a RefPtr instead of a raw pointer fixes 4878 the problem. 4879 4880 Unfortunately, the crash in the bug is rather intermittent, and it is 4881 impossible to add an assertion in UString::Ref::ref() to catch this bug 4882 because some users of UString::Rep deliberately zero out the reference 4883 count. Therefore, there is no layout test accompanying this bug fix. 4884 4885 * runtime/Structure.cpp: 4886 (JSC::Structure::~Structure): Use get(). 4887 (JSC::Structure::materializePropertyMap): Use get(). 4888 (JSC::Structure::addPropertyTransitionToExistingStructure): Use get(). 4889 (JSC::Structure::addPropertyTransition): Use get(). 4890 * runtime/Structure.h: Make Structure::m_nameInPrevious a RefPtr instead 4891 of a raw pointer. 4892 48932008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 4894 4895 Not reviewed. Attempt to fix win build. No 'using namespace WTF' in this file, needs manual WTF:: prefix. 4896 Not sure why the build works as is here. 4897 4898 * runtime/MathObject.cpp: 4899 (JSC::mathProtoFuncRandom): 4900 49012008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 4902 4903 Reviewed by Darin Adler. 4904 4905 Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876 4906 4907 Unify random number generation in JavaScriptCore & WebCore, by introducing 4908 wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h. 4909 4910 wtf_random_init() has been renamed to initializeRandomNumberGenerator() and 4911 lives in it's own private header: wtf/RandomNumberSeed.h, only intended to 4912 be used from within JavaScriptCore. 4913 4914 wtf_random() has been renamed to randomNumber() and lives in a public header 4915 wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates 4916 the code taking care of initializing the random number generator (only when 4917 building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading() 4918 already took care of that). 4919 4920 Functional change on darwin: Use random() instead of rand(), as it got a larger 4921 period (more randomness). HTMLFormElement already contains this implementation 4922 and I just moved it in randomNumber(), as special case for PLATFORM(DARWIN). 4923 4924 * GNUmakefile.am: Add RandomNumber.(cpp/h) / RandomNumberSeed.h. 4925 * JavaScriptCore.exp: Ditto. 4926 * JavaScriptCore.pri: Ditto. 4927 * JavaScriptCore.scons: Ditto. 4928 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto. 4929 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. 4930 * JavaScriptCoreSources.bkl: Ditto. 4931 * runtime/MathObject.cpp: Use new WTF::randomNumber() functionality. 4932 (JSC::mathProtoFuncRandom): 4933 * wtf/MathExtras.h: Move wtf_random / wtf_random_init to new files. 4934 * wtf/RandomNumber.cpp: Added. 4935 (WTF::randomNumber): 4936 * wtf/RandomNumber.h: Added. 4937 * wtf/RandomNumberSeed.h: Added. Internal usage within JSC only. 4938 (WTF::initializeRandomNumberGenerator): 4939 * wtf/ThreadingGtk.cpp: Rename wtf_random_init() to initializeRandomNumberGenerator(). 4940 (WTF::initializeThreading): 4941 * wtf/ThreadingPthreads.cpp: Ditto. 4942 (WTF::initializeThreading): 4943 * wtf/ThreadingQt.cpp: Ditto. 4944 (WTF::initializeThreading): 4945 * wtf/ThreadingWin.cpp: Ditto. 4946 (WTF::initializeThreading): 4947 49482008-12-16 Yael Aharon <yael.aharon@nokia.com> 4949 4950 Reviewed by Tor Arne Vestbø. 4951 4952 Qt/Win build fix 4953 4954 * JavaScriptCore.pri: 4955 49562008-12-15 Mark Rowe <mrowe@apple.com> 4957 4958 Reviewed by Cameron Zwarich. 4959 4960 Fix the build with GCC 4.0. 4961 4962 * Configurations/JavaScriptCore.xcconfig: GCC 4.0 appears to have a bug when compiling with -funwind-tables on, 4963 so don't use it with that compiler version. 4964 49652008-12-15 Mark Rowe <mrowe@apple.com> 4966 4967 Rubber-stamped by Cameron Zwarich. 4968 4969 <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard. 4970 4971 * Configurations/Base.xcconfig: 4972 * Configurations/DebugRelease.xcconfig: 4973 49742008-12-15 Alexey Proskuryakov <ap@webkit.org> 4975 4976 Reviewed by Darin Adler. 4977 4978 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard. 4979 4980 * API/JSContextRef.cpp: (JSGlobalContextCreate): 4981 49822008-12-15 Alexey Proskuryakov <ap@webkit.org> 4983 4984 Reviewed by Darin Adler. 4985 4986 <rdar://problem/6445089> Mach ports leak from worker threads 4987 4988 * interpreter/Interpreter.cpp: (JSC::getCPUTime): 4989 Deallocate the thread self port. 4990 49912008-12-15 Gavin Barraclough <barraclough@apple.com> 4992 4993 Reviewed by Mark Rowe. 4994 4995 Construct stack frames in JIT code, so that backtracing can still work. 4996 <rdar://problem/6447870> JIT should play nice with attempts to take stack traces 4997 4998 * jit/JIT.cpp: 4999 (JSC::): 5000 (JSC::JIT::privateCompileMainPass): 5001 50022008-12-15 Mark Rowe <mrowe@apple.com> 5003 5004 Reviewed by Gavin Barraclough. 5005 5006 <rdar://problem/6402262> JavaScriptCore needs exception handling tables in order to get stack traces without frame pointers 5007 5008 * Configurations/JavaScriptCore.xcconfig: 5009 50102008-12-15 Gavin Barraclough <barraclough@apple.com> 5011 5012 Rubber stamped by Mark Rowe. 5013 5014 Revert r39226 / Bug 22818: Unify JIT callback argument access OS X / Windows 5015 This causes Acid3 failures – reverting for now & will revisit later. 5016 https://bugs.webkit.org/show_bug.cgi?id=22873 5017 5018 * interpreter/Interpreter.h: 5019 * jit/JIT.cpp: 5020 (JSC::JIT::privateCompileCTIMachineTrampolines): 5021 * jit/JIT.h: 5022 * jit/JITInlineMethods.h: 5023 (JSC::JIT::restoreArgumentReference): 5024 (JSC::JIT::restoreArgumentReferenceForTrampoline): 5025 (JSC::JIT::emitCTICall_internal): 5026 * jit/JITPropertyAccess.cpp: 5027 (JSC::JIT::privateCompilePutByIdTransition): 5028 * wtf/Platform.h: 5029 50302008-12-15 Darin Adler <darin@apple.com> 5031 5032 Reviewed by Sam Weinig. 5033 5034 - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window 5035 5036 Replaced toGlobalObject with the more generally useful unwrappedObject and used it to 5037 fix the cycle detection code in put(__proto__). 5038 5039 * JavaScriptCore.exp: Updated. 5040 5041 * runtime/JSGlobalObject.cpp: Removed toGlobalObject. We now use unwrappedObject instead. 5042 * runtime/JSGlobalObject.h: 5043 (JSC::JSGlobalObject::isGlobalObject): Ditto. 5044 5045 * runtime/JSGlobalObjectFunctions.cpp: 5046 (JSC::globalFuncEval): Use unwrappedObject and isGlobalObject here rather than toGlobalObject. 5047 5048 * runtime/JSObject.cpp: 5049 (JSC::JSObject::put): Rewrote prototype cycle checking loop. Use unwrappedObject in the loop now. 5050 (JSC::JSObject::unwrappedObject): Replaced toGlobalObject with this new function. 5051 * runtime/JSObject.h: More of the same. 5052 50532008-12-15 Steve Falkenburg <sfalken@apple.com> 5054 5055 Windows build fix. 5056 5057 Visual Studio requires visibility of forward declarations to match class declaration. 5058 5059 * assembler/X86Assembler.h: 5060 50612008-12-15 Gustavo Noronha Silva <kov@kov.eti.br> 5062 5063 Reviewed by Mark Rowe. 5064 5065 https://bugs.webkit.org/show_bug.cgi?id=22686 5066 5067 GTK+ build fix. 5068 5069 * GNUmakefile.am: 5070 50712008-12-15 Gavin Barraclough <barraclough@apple.com> 5072 5073 Reviewed by Geoff Garen. 5074 5075 Add support to X86Assembler emitting instructions that access all 16 registers on x86-64. 5076 Add a new formating class, that is reponsible for both emitting the opcode bytes and the 5077 ModRm bytes of an instruction in a single call; this can insert the REX byte as necessary 5078 before the opcode, but has access to the register numbers to build the REX. 5079 5080 * assembler/AssemblerBuffer.h: 5081 (JSC::AssemblerBuffer::isAligned): 5082 (JSC::AssemblerBuffer::data): 5083 * assembler/MacroAssembler.h: 5084 (JSC::MacroAssembler::addPtr): 5085 (JSC::MacroAssembler::add32): 5086 (JSC::MacroAssembler::and32): 5087 (JSC::MacroAssembler::or32): 5088 (JSC::MacroAssembler::sub32): 5089 (JSC::MacroAssembler::xor32): 5090 (JSC::MacroAssembler::loadPtr): 5091 (JSC::MacroAssembler::load32): 5092 (JSC::MacroAssembler::load16): 5093 (JSC::MacroAssembler::storePtr): 5094 (JSC::MacroAssembler::storePtrWithRepatch): 5095 (JSC::MacroAssembler::store32): 5096 (JSC::MacroAssembler::pop): 5097 (JSC::MacroAssembler::push): 5098 (JSC::MacroAssembler::compareImm32ForBranch): 5099 (JSC::MacroAssembler::compareImm32ForBranchEquality): 5100 (JSC::MacroAssembler::testImm32): 5101 (JSC::MacroAssembler::jae32): 5102 (JSC::MacroAssembler::jb32): 5103 (JSC::MacroAssembler::je16): 5104 (JSC::MacroAssembler::jg32): 5105 (JSC::MacroAssembler::jnePtr): 5106 (JSC::MacroAssembler::jne32): 5107 (JSC::MacroAssembler::jump): 5108 * assembler/X86Assembler.h: 5109 (JSC::X86::): 5110 (JSC::X86Assembler::): 5111 (JSC::X86Assembler::size): 5112 (JSC::X86Assembler::push_r): 5113 (JSC::X86Assembler::pop_r): 5114 (JSC::X86Assembler::push_i32): 5115 (JSC::X86Assembler::push_m): 5116 (JSC::X86Assembler::pop_m): 5117 (JSC::X86Assembler::addl_rr): 5118 (JSC::X86Assembler::addl_mr): 5119 (JSC::X86Assembler::addl_ir): 5120 (JSC::X86Assembler::addq_ir): 5121 (JSC::X86Assembler::addl_im): 5122 (JSC::X86Assembler::andl_rr): 5123 (JSC::X86Assembler::andl_ir): 5124 (JSC::X86Assembler::orl_rr): 5125 (JSC::X86Assembler::orl_mr): 5126 (JSC::X86Assembler::orl_ir): 5127 (JSC::X86Assembler::subl_rr): 5128 (JSC::X86Assembler::subl_mr): 5129 (JSC::X86Assembler::subl_ir): 5130 (JSC::X86Assembler::subl_im): 5131 (JSC::X86Assembler::xorl_rr): 5132 (JSC::X86Assembler::xorl_ir): 5133 (JSC::X86Assembler::sarl_i8r): 5134 (JSC::X86Assembler::sarl_CLr): 5135 (JSC::X86Assembler::shll_i8r): 5136 (JSC::X86Assembler::shll_CLr): 5137 (JSC::X86Assembler::imull_rr): 5138 (JSC::X86Assembler::imull_i32r): 5139 (JSC::X86Assembler::idivl_r): 5140 (JSC::X86Assembler::cmpl_rr): 5141 (JSC::X86Assembler::cmpl_rm): 5142 (JSC::X86Assembler::cmpl_mr): 5143 (JSC::X86Assembler::cmpl_ir): 5144 (JSC::X86Assembler::cmpl_ir_force32): 5145 (JSC::X86Assembler::cmpl_im): 5146 (JSC::X86Assembler::cmpl_im_force32): 5147 (JSC::X86Assembler::cmpw_rm): 5148 (JSC::X86Assembler::testl_rr): 5149 (JSC::X86Assembler::testl_i32r): 5150 (JSC::X86Assembler::testl_i32m): 5151 (JSC::X86Assembler::testq_rr): 5152 (JSC::X86Assembler::testq_i32r): 5153 (JSC::X86Assembler::testb_i8r): 5154 (JSC::X86Assembler::sete_r): 5155 (JSC::X86Assembler::setz_r): 5156 (JSC::X86Assembler::setne_r): 5157 (JSC::X86Assembler::setnz_r): 5158 (JSC::X86Assembler::cdq): 5159 (JSC::X86Assembler::xchgl_rr): 5160 (JSC::X86Assembler::movl_rr): 5161 (JSC::X86Assembler::movl_rm): 5162 (JSC::X86Assembler::movl_mr): 5163 (JSC::X86Assembler::movl_i32r): 5164 (JSC::X86Assembler::movl_i32m): 5165 (JSC::X86Assembler::movq_rr): 5166 (JSC::X86Assembler::movq_rm): 5167 (JSC::X86Assembler::movq_mr): 5168 (JSC::X86Assembler::movzwl_mr): 5169 (JSC::X86Assembler::movzbl_rr): 5170 (JSC::X86Assembler::leal_mr): 5171 (JSC::X86Assembler::call): 5172 (JSC::X86Assembler::jmp): 5173 (JSC::X86Assembler::jmp_r): 5174 (JSC::X86Assembler::jmp_m): 5175 (JSC::X86Assembler::jne): 5176 (JSC::X86Assembler::jnz): 5177 (JSC::X86Assembler::je): 5178 (JSC::X86Assembler::jl): 5179 (JSC::X86Assembler::jb): 5180 (JSC::X86Assembler::jle): 5181 (JSC::X86Assembler::jbe): 5182 (JSC::X86Assembler::jge): 5183 (JSC::X86Assembler::jg): 5184 (JSC::X86Assembler::ja): 5185 (JSC::X86Assembler::jae): 5186 (JSC::X86Assembler::jo): 5187 (JSC::X86Assembler::jp): 5188 (JSC::X86Assembler::js): 5189 (JSC::X86Assembler::addsd_rr): 5190 (JSC::X86Assembler::addsd_mr): 5191 (JSC::X86Assembler::cvtsi2sd_rr): 5192 (JSC::X86Assembler::cvttsd2si_rr): 5193 (JSC::X86Assembler::movd_rr): 5194 (JSC::X86Assembler::movsd_rm): 5195 (JSC::X86Assembler::movsd_mr): 5196 (JSC::X86Assembler::mulsd_rr): 5197 (JSC::X86Assembler::mulsd_mr): 5198 (JSC::X86Assembler::pextrw_irr): 5199 (JSC::X86Assembler::subsd_rr): 5200 (JSC::X86Assembler::subsd_mr): 5201 (JSC::X86Assembler::ucomis_rr): 5202 (JSC::X86Assembler::int3): 5203 (JSC::X86Assembler::ret): 5204 (JSC::X86Assembler::predictNotTaken): 5205 (JSC::X86Assembler::label): 5206 (JSC::X86Assembler::align): 5207 (JSC::X86Assembler::link): 5208 (JSC::X86Assembler::executableCopy): 5209 (JSC::X86Assembler::X86InstructionFormater::prefix): 5210 (JSC::X86Assembler::X86InstructionFormater::oneByteOp): 5211 (JSC::X86Assembler::X86InstructionFormater::twoByteOp): 5212 (JSC::X86Assembler::X86InstructionFormater::oneByteOp64): 5213 (JSC::X86Assembler::X86InstructionFormater::oneByteOp8): 5214 (JSC::X86Assembler::X86InstructionFormater::twoByteOp8): 5215 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate8): 5216 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate32): 5217 (JSC::X86Assembler::X86InstructionFormater::instructionRel32): 5218 (JSC::X86Assembler::X86InstructionFormater::size): 5219 (JSC::X86Assembler::X86InstructionFormater::isAligned): 5220 (JSC::X86Assembler::X86InstructionFormater::data): 5221 (JSC::X86Assembler::X86InstructionFormater::executableCopy): 5222 (JSC::X86Assembler::X86InstructionFormater::registerModRM): 5223 (JSC::X86Assembler::X86InstructionFormater::memoryModRM): 5224 * jit/JIT.cpp: 5225 (JSC::JIT::privateCompileMainPass): 5226 (JSC::JIT::privateCompile): 5227 (JSC::JIT::privateCompileCTIMachineTrampolines): 5228 * jit/JITArithmetic.cpp: 5229 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate): 5230 (JSC::JIT::compileBinaryArithOp): 5231 * jit/JITCall.cpp: 5232 (JSC::JIT::compileOpCall): 5233 (JSC::JIT::compileOpCallSlowCase): 5234 * jit/JITPropertyAccess.cpp: 5235 (JSC::JIT::compileGetByIdHotPath): 5236 (JSC::JIT::compilePutByIdHotPath): 5237 (JSC::JIT::privateCompilePutByIdTransition): 5238 (JSC::JIT::privateCompilePatchGetArrayLength): 5239 (JSC::JIT::privateCompileGetByIdProto): 5240 (JSC::JIT::privateCompileGetByIdProtoList): 5241 (JSC::JIT::privateCompileGetByIdChainList): 5242 (JSC::JIT::privateCompileGetByIdChain): 5243 52442008-12-15 Darin Adler <darin@apple.com> 5245 5246 * interpreter/RegisterFile.h: Tweak include formatting. 5247 52482008-12-15 Holger Hans Peter Freyther <zecke@selfish.org> 5249 5250 Build fix for Gtk+. 5251 5252 * interpreter/RegisterFile.h: Include stdio.h for fprintf 5253 52542008-12-15 Alexey Proskuryakov <ap@webkit.org> 5255 5256 Reviewed by Oliver Hunt. 5257 5258 <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time 5259 5260 * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile): 5261 Improve error handling: if mmap fails, crash immediately, and print out the reason. 5262 52632008-12-13 Gavin Barraclough <barraclough@apple.com> 5264 5265 Reviewed by Cameron Zwarich. 5266 5267 Re-enable WREC on 64-bit. 5268 Implements one of the MacroAssembler::jnzPtr methods, previously only implemented for 32-bit x86. 5269 5270 https://bugs.webkit.org/show_bug.cgi?id=22849 5271 5272 * assembler/MacroAssembler.h: 5273 (JSC::MacroAssembler::testImm64): 5274 (JSC::MacroAssembler::jnzPtr): 5275 * assembler/X86Assembler.h: 5276 (JSC::X86Assembler::testq_i32r): 5277 (JSC::X86Assembler::testq_rr): 5278 * wtf/Platform.h: 5279 52802008-12-13 Gavin Barraclough <barraclough@apple.com> 5281 5282 Fix PPC builds. 5283 5284 * assembler/MacroAssembler.h: 5285 52862008-12-13 Gavin Barraclough <barraclough@apple.com> 5287 5288 Build fix only, no review. 5289 5290 * bytecode/CodeBlock.h: 5291 52922008-12-13 Gavin Barraclough <barraclough@apple.com> 5293 5294 Reviewed by Cameron Zwarich. 5295 5296 Port the remainder of the JIT, bar calling convention related code, and code 5297 implementing optimizations which can be disabled, to use the MacroAssembler. 5298 5299 * assembler/MacroAssembler.h: 5300 (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr): 5301 (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer): 5302 (JSC::MacroAssembler::RepatchBuffer::link): 5303 (JSC::MacroAssembler::RepatchBuffer::addressOf): 5304 (JSC::MacroAssembler::RepatchBuffer::setPtr): 5305 (JSC::MacroAssembler::addPtr): 5306 (JSC::MacroAssembler::lshift32): 5307 (JSC::MacroAssembler::mod32): 5308 (JSC::MacroAssembler::rshift32): 5309 (JSC::MacroAssembler::storePtrWithRepatch): 5310 (JSC::MacroAssembler::jnzPtr): 5311 (JSC::MacroAssembler::jzPtr): 5312 (JSC::MacroAssembler::jump): 5313 (JSC::MacroAssembler::label): 5314 * assembler/X86Assembler.h: 5315 (JSC::X86Assembler::): 5316 (JSC::X86Assembler::xchgl_rr): 5317 (JSC::X86Assembler::jmp_m): 5318 (JSC::X86Assembler::repatchAddress): 5319 (JSC::X86Assembler::getRelocatedAddress): 5320 * bytecode/CodeBlock.cpp: 5321 (JSC::CodeBlock::CodeBlock): 5322 * bytecode/CodeBlock.h: 5323 (JSC::JITCodeRef::JITCodeRef): 5324 (JSC::CodeBlock::setJITCode): 5325 (JSC::CodeBlock::jitCode): 5326 (JSC::CodeBlock::executablePool): 5327 * jit/JIT.cpp: 5328 (JSC::JIT::privateCompileMainPass): 5329 (JSC::JIT::privateCompileLinkPass): 5330 (JSC::JIT::privateCompile): 5331 (JSC::JIT::privateCompileCTIMachineTrampolines): 5332 * jit/JIT.h: 5333 (JSC::CallRecord::CallRecord): 5334 (JSC::JumpTable::JumpTable): 5335 (JSC::JIT::emitCTICall): 5336 (JSC::JIT::JSRInfo::JSRInfo): 5337 * jit/JITArithmetic.cpp: 5338 * jit/JITCall.cpp: 5339 * jit/JITInlineMethods.h: 5340 (JSC::JIT::emitNakedCall): 5341 (JSC::JIT::emitCTICall_internal): 5342 (JSC::JIT::checkStructure): 5343 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): 5344 (JSC::JIT::addSlowCase): 5345 (JSC::JIT::addJump): 5346 (JSC::JIT::emitJumpSlowToHot): 5347 * jit/JITPropertyAccess.cpp: 5348 (JSC::JIT::privateCompileGetByIdChainList): 5349 (JSC::JIT::privateCompileGetByIdChain): 5350 53512008-12-12 Cameron Zwarich <zwarich@apple.com> 5352 5353 Reviewed by Sam Weinig. 5354 5355 Fix the failures of the following layout tests, which regressed in 5356 r39255: 5357 5358 fast/dom/StyleSheet/ownerNode-lifetime-2.html 5359 fast/xsl/transform-xhr-doc.xhtml 5360 5361 The binary search in CodeBlock::getByIdExceptionInfoForBytecodeOffset() 5362 doesn't guarantee that it actually finds a match, so add an explicit check 5363 for this. 5364 5365 * bytecode/CodeBlock.cpp: 5366 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): 5367 53682008-12-12 Gavin Barraclough <barraclough@apple.com> 5369 5370 Reviewed by Cameron Zwarich. 5371 5372 Replace emitPutCallArg methods with emitPutJITStubArg methods. Primarily to make the argument numbering 5373 more sensible (1-based incrementing by 1, rather than 0-based incrementing by 4). The CTI name also seems 5374 to be being deprecated from the code generally. 5375 5376 * jit/JIT.cpp: 5377 (JSC::JIT::privateCompileMainPass): 5378 (JSC::JIT::privateCompileSlowCases): 5379 (JSC::JIT::privateCompileCTIMachineTrampolines): 5380 * jit/JIT.h: 5381 * jit/JITArithmetic.cpp: 5382 (JSC::JIT::compileBinaryArithOp): 5383 (JSC::JIT::compileBinaryArithOpSlowCase): 5384 * jit/JITCall.cpp: 5385 (JSC::JIT::compileOpCallSetupArgs): 5386 (JSC::JIT::compileOpCallEvalSetupArgs): 5387 (JSC::JIT::compileOpConstructSetupArgs): 5388 (JSC::JIT::compileOpCall): 5389 * jit/JITInlineMethods.h: 5390 (JSC::JIT::emitPutJITStubArg): 5391 (JSC::JIT::emitPutJITStubArgConstant): 5392 (JSC::JIT::emitGetJITStubArg): 5393 (JSC::JIT::emitPutJITStubArgFromVirtualRegister): 5394 * jit/JITPropertyAccess.cpp: 5395 (JSC::JIT::compileGetByIdHotPath): 5396 (JSC::JIT::compilePutByIdHotPath): 5397 (JSC::JIT::compileGetByIdSlowCase): 5398 (JSC::JIT::compilePutByIdSlowCase): 5399 54002008-12-12 Gavin Barraclough <barraclough@apple.com> 5401 5402 Fix windows builds. 5403 5404 * jit/JIT.cpp: 5405 (JSC::JIT::privateCompileMainPass): 5406 (JSC::JIT::privateCompileSlowCases): 5407 (JSC::JIT::privateCompile): 5408 54092008-12-12 Gavin Barraclough <barraclough@apple.com> 5410 5411 Reviewed by Geoff Garen. 5412 5413 Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex. 5414 5415 No impact on performance. 5416 5417 * jit/JIT.cpp: 5418 (JSC::JIT::compileOpStrictEq): 5419 (JSC::JIT::emitSlowScriptCheck): 5420 (JSC::JIT::privateCompileMainPass): 5421 (JSC::JIT::privateCompileSlowCases): 5422 (JSC::JIT::privateCompile): 5423 * jit/JIT.h: 5424 (JSC::CallRecord::CallRecord): 5425 (JSC::JmpTable::JmpTable): 5426 (JSC::JIT::emitCTICall): 5427 * jit/JITArithmetic.cpp: 5428 (JSC::JIT::compileBinaryArithOp): 5429 (JSC::JIT::compileBinaryArithOpSlowCase): 5430 * jit/JITCall.cpp: 5431 (JSC::JIT::compileOpCall): 5432 (JSC::JIT::compileOpCallSlowCase): 5433 * jit/JITInlineMethods.h: 5434 (JSC::JIT::emitGetVirtualRegister): 5435 (JSC::JIT::emitGetVirtualRegisters): 5436 (JSC::JIT::emitNakedCall): 5437 (JSC::JIT::emitCTICall_internal): 5438 (JSC::JIT::emitJumpSlowCaseIfJSCell): 5439 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 5440 (JSC::JIT::emitJumpSlowCaseIfNotImmNum): 5441 (JSC::JIT::emitJumpSlowCaseIfNotImmNums): 5442 (JSC::JIT::emitFastArithIntToImmOrSlowCase): 5443 (JSC::JIT::addSlowCase): 5444 (JSC::JIT::addJump): 5445 (JSC::JIT::emitJumpSlowToHot): 5446 * jit/JITPropertyAccess.cpp: 5447 (JSC::JIT::compileGetByIdHotPath): 5448 (JSC::JIT::compileGetByIdSlowCase): 5449 (JSC::JIT::compilePutByIdHotPath): 5450 (JSC::JIT::compilePutByIdSlowCase): 5451 54522008-12-12 Sam Weinig <sam@webkit.org> 5453 5454 Reviewed by Cameron Zwarich. 5455 5456 <rdar://problem/6428342> Look into feasibility of discarding bytecode after native codegen 5457 5458 Move more JIT functionality to using offsets into the Instruction buffer 5459 instead of raw pointers. Two to go! 5460 5461 * interpreter/Interpreter.cpp: 5462 (JSC::bytecodeOffsetForPC): Rename from vPCForPC. 5463 (JSC::Interpreter::resolve): Pass offset to exception helper. 5464 (JSC::Interpreter::resolveSkip): Ditto. 5465 (JSC::Interpreter::resolveGlobal): Ditto. 5466 (JSC::Interpreter::resolveBaseAndProperty): Ditto. 5467 (JSC::Interpreter::resolveBaseAndFunc): Ditto. 5468 (JSC::isNotObject): Ditto. 5469 (JSC::Interpreter::unwindCallFrame): Call bytecodeOffsetForPC. 5470 (JSC::Interpreter::throwException): Use offsets instead of vPCs. 5471 (JSC::Interpreter::privateExecute): Pass offset to exception helper. 5472 (JSC::Interpreter::retrieveLastCaller): Ditto. 5473 (JSC::Interpreter::cti_op_instanceof): Ditto. 5474 (JSC::Interpreter::cti_op_call_NotJSFunction): Ditto. 5475 (JSC::Interpreter::cti_op_resolve): Pass offset to exception helper. 5476 (JSC::Interpreter::cti_op_construct_NotJSConstruct): Ditto. 5477 (JSC::Interpreter::cti_op_resolve_func): Ditto. 5478 (JSC::Interpreter::cti_op_resolve_skip): Ditto. 5479 (JSC::Interpreter::cti_op_resolve_global): Ditto. 5480 (JSC::Interpreter::cti_op_resolve_with_base): Ditto. 5481 (JSC::Interpreter::cti_op_throw): Ditto. 5482 (JSC::Interpreter::cti_op_in): Ditto. 5483 (JSC::Interpreter::cti_vm_throw): Ditto. 5484 * interpreter/Interpreter.h: 5485 5486 * jit/JIT.cpp: 5487 (JSC::JIT::privateCompileMainPass): Don't pass unnecessary vPC to stub. 5488 * jit/JIT.h: Remove ARG_instr1 - ARG_instr3 and ARG_instr5 - ARG_instr6. 5489 * jit/JITCall.cpp: 5490 (JSC::JIT::compileOpCallEvalSetupArgs): Don't pass unnecessary vPC to stub.. 5491 (JSC::JIT::compileOpConstructSetupArgs): Ditto. 5492 5493 * runtime/ExceptionHelpers.cpp: 5494 (JSC::createUndefinedVariableError): Take an offset instead of vPC. 5495 (JSC::createInvalidParamError): Ditto. 5496 (JSC::createNotAConstructorError): Ditto. 5497 (JSC::createNotAFunctionError): Ditto. 5498 (JSC::createNotAnObjectError): Ditto. 5499 * runtime/ExceptionHelpers.h: 5500 55012008-12-12 Cameron Zwarich <zwarich@apple.com> 5502 5503 Reviewed by Oliver Hunt. 5504 5505 Bug 22835: Crash during bytecode generation when comparing to null 5506 <https://bugs.webkit.org/show_bug.cgi?id=22835> 5507 <rdar://problem/6286749> 5508 5509 Change the special cases in bytecode generation for comparison to null 5510 to use tempDestination(). 5511 5512 * parser/Nodes.cpp: 5513 (JSC::BinaryOpNode::emitBytecode): 5514 (JSC::EqualNode::emitBytecode): 5515 55162008-12-12 Gavin Barraclough <barraclough@apple.com> 5517 5518 Reviewed by Geoff Garen. 5519 5520 Move slow-cases of JIT code generation over to the MacroAssembler interface. 5521 5522 * assembler/MacroAssembler.h: 5523 (JSC::MacroAssembler::Label::Label): 5524 (JSC::MacroAssembler::jae32): 5525 (JSC::MacroAssembler::jg32): 5526 (JSC::MacroAssembler::jzPtr): 5527 * jit/JIT.cpp: 5528 (JSC::JIT::privateCompileSlowCases): 5529 (JSC::JIT::privateCompile): 5530 (JSC::JIT::emitGetVariableObjectRegister): 5531 (JSC::JIT::emitPutVariableObjectRegister): 5532 * jit/JIT.h: 5533 (JSC::SlowCaseEntry::SlowCaseEntry): 5534 (JSC::JIT::getSlowCase): 5535 (JSC::JIT::linkSlowCase): 5536 * jit/JITArithmetic.cpp: 5537 (JSC::JIT::compileBinaryArithOpSlowCase): 5538 * jit/JITCall.cpp: 5539 (JSC::JIT::compileOpCallInitializeCallFrame): 5540 (JSC::JIT::compileOpCall): 5541 (JSC::JIT::compileOpCallSlowCase): 5542 * jit/JITInlineMethods.h: 5543 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 5544 (JSC::JIT::linkSlowCaseIfNotJSCell): 5545 * jit/JITPropertyAccess.cpp: 5546 (JSC::JIT::compileGetByIdHotPath): 5547 (JSC::JIT::compilePutByIdHotPath): 5548 (JSC::JIT::compileGetByIdSlowCase): 5549 (JSC::JIT::compilePutByIdSlowCase): 5550 55512008-12-12 Cameron Zwarich <zwarich@apple.com> 5552 5553 Reviewed by Sam Weinig. 5554 5555 Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information 5556 <https://bugs.webkit.org/show_bug.cgi?id=22828> 5557 5558 In order to remove the bytecode instruction stream after generating 5559 native code, all inspection of bytecode instructions at runtime must 5560 be removed. One particular instance of this is the special handling of 5561 exceptions thrown by the op_get_by_id emitted directly before an 5562 op_construct or an op_instanceof. This patch moves that information to 5563 an auxiliary data structure in CodeBlock. 5564 5565 * bytecode/CodeBlock.cpp: 5566 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): 5567 * bytecode/CodeBlock.h: 5568 (JSC::CodeBlock::addGetByIdExceptionInfo): 5569 * bytecompiler/BytecodeGenerator.cpp: 5570 (JSC::BytecodeGenerator::emitConstruct): 5571 * bytecompiler/BytecodeGenerator.h: 5572 (JSC::BytecodeGenerator::emitGetByIdExceptionInfo): 5573 * parser/Nodes.cpp: 5574 (JSC::InstanceOfNode::emitBytecode): 5575 * runtime/ExceptionHelpers.cpp: 5576 (JSC::createNotAnObjectError): 5577 55782008-12-12 Sam Weinig <sam@webkit.org> 5579 5580 Reviewed by Geoffrey Garen. 5581 5582 Change exception information accessors to take offsets into the bytecode 5583 instruction buffer instead of pointers so that they can work even even 5584 if the bytecode buffer is purged. 5585 5586 * bytecode/CodeBlock.cpp: 5587 (JSC::instructionOffsetForNth): 5588 (JSC::CodeBlock::handlerForBytecodeOffset): 5589 (JSC::CodeBlock::lineNumberForBytecodeOffset): 5590 (JSC::CodeBlock::expressionRangeForBytecodeOffset): 5591 * bytecode/CodeBlock.h: 5592 * bytecode/SamplingTool.cpp: 5593 (JSC::SamplingTool::dump): 5594 * interpreter/Interpreter.cpp: 5595 (JSC::Interpreter::throwException): 5596 (JSC::Interpreter::privateExecute): 5597 (JSC::Interpreter::retrieveLastCaller): 5598 * jit/JIT.cpp: 5599 (JSC::JIT::privateCompileMainPass): 5600 * runtime/ExceptionHelpers.cpp: 5601 (JSC::createUndefinedVariableError): 5602 (JSC::createInvalidParamError): 5603 (JSC::createNotAConstructorError): 5604 (JSC::createNotAFunctionError): 5605 (JSC::createNotAnObjectError): 5606 56072008-12-12 Geoffrey Garen <ggaren@apple.com> 5608 5609 Reviewed by Cameron Zwarich. 5610 5611 Tiny bit of refactoring in quantifier generation. 5612 5613 * wrec/WRECGenerator.cpp: 5614 (JSC::WREC::Generator::generateNonGreedyQuantifier): 5615 (JSC::WREC::Generator::generateGreedyQuantifier): 5616 56172008-12-11 Sam Weinig <sam@webkit.org> 5618 5619 Reviewed by Geoffrey Garen. 5620 5621 Remove dependancy on having the Instruction buffer in order to 5622 deref Structures used for property access and global resolves. 5623 Instead, we put references to the necessary Structures in auxiliary 5624 data structures on the CodeBlock. This is not an ideal solution, 5625 as we still pay for having the Structures in two places and we 5626 would like to eventually just hold on to offsets into the machine 5627 code buffer. 5628 5629 - Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT 5630 only data structures. 5631 5632 * GNUmakefile.am: 5633 * JavaScriptCore.pri: 5634 * JavaScriptCore.scons: 5635 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 5636 * JavaScriptCore.xcodeproj/project.pbxproj: 5637 * JavaScriptCoreSources.bkl: 5638 * bytecode/CodeBlock.cpp: 5639 (JSC::isGlobalResolve): 5640 (JSC::isPropertyAccess): 5641 (JSC::instructionOffsetForNth): 5642 (JSC::printGlobalResolveInfo): 5643 (JSC::printStructureStubInfo): 5644 (JSC::CodeBlock::printStructures): 5645 (JSC::CodeBlock::dump): 5646 (JSC::CodeBlock::~CodeBlock): 5647 (JSC::CodeBlock::shrinkToFit): 5648 * bytecode/CodeBlock.h: 5649 (JSC::GlobalResolveInfo::GlobalResolveInfo): 5650 (JSC::getNativePC): 5651 (JSC::CodeBlock::instructions): 5652 (JSC::CodeBlock::getStubInfo): 5653 (JSC::CodeBlock::getBytecodeIndex): 5654 (JSC::CodeBlock::addPropertyAccessInstruction): 5655 (JSC::CodeBlock::addGlobalResolveInstruction): 5656 (JSC::CodeBlock::numberOfStructureStubInfos): 5657 (JSC::CodeBlock::addStructureStubInfo): 5658 (JSC::CodeBlock::structureStubInfo): 5659 (JSC::CodeBlock::addGlobalResolveInfo): 5660 (JSC::CodeBlock::globalResolveInfo): 5661 (JSC::CodeBlock::numberOfCallLinkInfos): 5662 (JSC::CodeBlock::addCallLinkInfo): 5663 (JSC::CodeBlock::callLinkInfo): 5664 * bytecode/Instruction.h: 5665 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set): 5666 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList): 5667 * bytecode/Opcode.h: 5668 (JSC::): 5669 * bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp. 5670 (JSC::StructureStubInfo::deref): 5671 * bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h. 5672 (JSC::StructureStubInfo::StructureStubInfo): 5673 (JSC::StructureStubInfo::initGetByIdSelf): 5674 (JSC::StructureStubInfo::initGetByIdProto): 5675 (JSC::StructureStubInfo::initGetByIdChain): 5676 (JSC::StructureStubInfo::initGetByIdSelfList): 5677 (JSC::StructureStubInfo::initGetByIdProtoList): 5678 (JSC::StructureStubInfo::initPutByIdTransition): 5679 (JSC::StructureStubInfo::initPutByIdReplace): 5680 (JSC::StructureStubInfo::): 5681 * bytecompiler/BytecodeGenerator.cpp: 5682 (JSC::BytecodeGenerator::emitResolve): 5683 (JSC::BytecodeGenerator::emitGetById): 5684 (JSC::BytecodeGenerator::emitPutById): 5685 (JSC::BytecodeGenerator::emitCall): 5686 (JSC::BytecodeGenerator::emitConstruct): 5687 (JSC::BytecodeGenerator::emitCatch): 5688 * interpreter/Interpreter.cpp: 5689 (JSC::Interpreter::tryCTICachePutByID): 5690 (JSC::Interpreter::tryCTICacheGetByID): 5691 (JSC::Interpreter::cti_op_get_by_id_self_fail): 5692 (JSC::getPolymorphicAccessStructureListSlot): 5693 (JSC::Interpreter::cti_op_get_by_id_proto_list): 5694 (JSC::Interpreter::cti_op_resolve_global): 5695 * jit/JIT.cpp: 5696 (JSC::JIT::JIT): 5697 (JSC::JIT::privateCompileMainPass): 5698 (JSC::JIT::privateCompileSlowCases): 5699 (JSC::JIT::privateCompile): 5700 * jit/JITPropertyAccess.cpp: 5701 (JSC::JIT::compileGetByIdHotPath): 5702 (JSC::JIT::compilePutByIdHotPath): 5703 (JSC::JIT::compileGetByIdSlowCase): 5704 (JSC::JIT::compilePutByIdSlowCase): 5705 (JSC::JIT::privateCompileGetByIdSelfList): 5706 (JSC::JIT::privateCompileGetByIdProtoList): 5707 (JSC::JIT::privateCompileGetByIdChainList): 5708 57092008-12-11 Gavin Barraclough <barraclough@apple.com> 5710 5711 Reviewed by Oliver Hunt. 5712 5713 Remove CTI_ARGUMENTS mode, use va_start implementation on Windows, 5714 unifying JIT callback (cti_*) argument access on OS X & Windows 5715 5716 No performance impact. 5717 5718 * interpreter/Interpreter.h: 5719 * jit/JIT.cpp: 5720 (JSC::JIT::privateCompileCTIMachineTrampolines): 5721 * jit/JIT.h: 5722 * jit/JITInlineMethods.h: 5723 (JSC::JIT::emitCTICall): 5724 * jit/JITPropertyAccess.cpp: 5725 (JSC::JIT::privateCompilePutByIdTransition): 5726 * wtf/Platform.h: 5727 57282008-12-11 Holger Freyther <zecke@selfish.org> 5729 5730 Reviewed by Simon Hausmann. 5731 5732 https://bugs.webkit.org/show_bug.cgi?id=20953 5733 5734 For Qt it is not pratical to have a FontCache and GlyphPageTreeNode 5735 implementation. This is one of the reasons why the Qt port is currently not 5736 using WebCore/platform/graphics/Font.cpp. By allowing to not use 5737 the simple/fast-path the Qt port will be able to use it. 5738 5739 Introduce USE(FONT_FAST_PATH) and define it for every port but the 5740 Qt one. 5741 5742 * wtf/Platform.h: Enable USE(FONT_FAST_PATH) 5743 57442008-12-11 Gabor Loki <loki@inf.u-szeged.hu> 5745 5746 Reviewed by Darin Adler and landed by Holger Freyther. 5747 5748 <https://bugs.webkit.org/show_bug.cgi?id=22648> 5749 Fix threading on Qt-port and Gtk-port for Sampling tool. 5750 5751 * wtf/ThreadingGtk.cpp: 5752 (WTF::waitForThreadCompletion): 5753 * wtf/ThreadingQt.cpp: 5754 (WTF::waitForThreadCompletion): 5755 57562008-12-10 Cameron Zwarich <zwarich@apple.com> 5757 5758 Reviewed by Oliver Hunt. 5759 5760 Bug 22734: Debugger crashes when stepping into a function call in a return statement 5761 <https://bugs.webkit.org/show_bug.cgi?id=22734> 5762 <rdar://problem/6426796> 5763 5764 * bytecompiler/BytecodeGenerator.cpp: 5765 (JSC::BytecodeGenerator::BytecodeGenerator): The DebuggerCallFrame uses 5766 the 'this' value stored in a callFrame, so op_convert_this should be 5767 emitted at the beginning of a function body when generating bytecode 5768 with debug hooks. 5769 * debugger/DebuggerCallFrame.cpp: 5770 (JSC::DebuggerCallFrame::thisObject): The assertion inherent in the call 5771 to asObject() here is valid, because any 'this' value should have been 5772 converted to a JSObject*. 5773 57742008-12-10 Gavin Barraclough <barraclough@apple.com> 5775 5776 Reviewed by Geoff Garen. 5777 5778 Port more of the JIT to use the MacroAssembler interface. 5779 5780 Everything in the main pass, bar a few corner cases (operations with required 5781 registers, or calling convention code). Slightly refactors array creation, 5782 moving the offset calculation into the callFrame into C code (reducing code 5783 planted). 5784 5785 Overall this appears to be a 1% win on v8-tests, due to the smaller immediates 5786 being planted (in jfalse in particular). 5787 5788 * interpreter/Interpreter.cpp: 5789 (JSC::Interpreter::cti_op_new_array): 5790 * jit/JIT.cpp: 5791 (JSC::JIT::privateCompileMainPass): 5792 (JSC::JIT::privateCompileSlowCases): 5793 * jit/JIT.h: 5794 * wrec/WRECGenerator.cpp: 5795 (JSC::WREC::Generator::generateEnter): 5796 57972008-12-10 Sam Weinig <sam@webkit.org> 5798 5799 Fix non-JIT builds. 5800 5801 * bytecode/CodeBlock.h: 5802 58032008-12-10 Sam Weinig <sam@webkit.org> 5804 5805 Reviewed by Geoffrey Garen. 5806 5807 <rdar://problem/6428332> Remove the CTI return address table from CodeBlock 5808 5809 Step 2: 5810 5811 Convert the return address table from a HashMap to a sorted Vector. This 5812 reduces the size of the data structure by ~4.5MB on Membuster head. 5813 5814 SunSpider reports a 0.5% progression. 5815 5816 * bytecode/CodeBlock.cpp: 5817 (JSC::sizeInBytes): Generic method to get the cost of a Vector. 5818 (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes. 5819 * bytecode/CodeBlock.h: 5820 (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings. 5821 (JSC::getNativePC): Helper for binary chop. 5822 (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a 5823 NativePC using a binary chop of the pcVector. 5824 (JSC::CodeBlock::pcVector): Accessor. 5825 5826 * interpreter/Interpreter.cpp: 5827 (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get(). 5828 (JSC::Interpreter::cti_op_instanceof): Ditto. 5829 (JSC::Interpreter::cti_op_resolve): Ditto. 5830 (JSC::Interpreter::cti_op_resolve_func): Ditto. 5831 (JSC::Interpreter::cti_op_resolve_skip): Ditto. 5832 (JSC::Interpreter::cti_op_resolve_with_base): Ditto. 5833 (JSC::Interpreter::cti_op_throw): Ditto. 5834 (JSC::Interpreter::cti_op_in): Ditto. 5835 (JSC::Interpreter::cti_vm_throw): Ditto. 5836 5837 * jit/JIT.cpp: 5838 (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector. 5839 58402008-12-09 Geoffrey Garen <ggaren@apple.com> 5841 5842 Reviewed by Oliver Hunt. 5843 5844 Added WREC support for an assertion followed by a quantifier. Fixed 5845 PCRE to match. 5846 5847 * wrec/WRECParser.cpp: 5848 (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since 5849 it's meaningless. (Firefox does the same.) 5850 5851 * pcre/pcre_compile.cpp: 5852 (compileBranch): ditto. 5853 58542008-12-09 Geoffrey Garen <ggaren@apple.com> 5855 5856 Reviewed by Cameron Zwarich. 5857 5858 In preparation for compiling WREC without PCRE: 5859 5860 Further relaxed WREC's parsing to be more web-compatible. Fixed PCRE to 5861 match in cases where it didn't already. 5862 5863 Changed JavaScriptCore to report syntax errors detected by WREC, rather 5864 than falling back on PCRE any time WREC sees an error. 5865 5866 * pcre/pcre_compile.cpp: 5867 (checkEscape): Relaxed parsing of \c and \N escapes to be more 5868 web-compatible. 5869 5870 * runtime/RegExp.cpp: 5871 (JSC::RegExp::RegExp): Only fall back on PCRE if WREC has not reported 5872 a syntax error. 5873 5874 * wrec/WREC.cpp: 5875 (JSC::WREC::Generator::compileRegExp): Fixed some error reporting to 5876 match PCRE. 5877 5878 * wrec/WRECParser.cpp: Added error messages that match PCRE. 5879 5880 (JSC::WREC::Parser::consumeGreedyQuantifier): 5881 (JSC::WREC::Parser::parseParentheses): 5882 (JSC::WREC::Parser::parseCharacterClass): 5883 (JSC::WREC::Parser::parseNonCharacterEscape): Updated the above functions to 5884 use the new setError API. 5885 5886 (JSC::WREC::Parser::consumeEscape): Relaxed parsing of \c \N \u \x \B 5887 to be more web-compatible. 5888 5889 (JSC::WREC::Parser::parseAlternative): Distinguish between a malformed 5890 quantifier and a quantifier with no prefix, like PCRE does. 5891 5892 (JSC::WREC::Parser::consumeParenthesesType): Updated to use the new setError API. 5893 5894 * wrec/WRECParser.h: 5895 (JSC::WREC::Parser::error): 5896 (JSC::WREC::Parser::syntaxError): 5897 (JSC::WREC::Parser::parsePattern): 5898 (JSC::WREC::Parser::reset): 5899 (JSC::WREC::Parser::setError): Store error messages instead of error codes, 5900 to provide for exception messages. Use a setter for reporting errors, so 5901 errors detected early are not overwritten by errors detected later. 5902 59032008-12-09 Gavin Barraclough <barraclough@apple.com> 5904 5905 Reviewed by Oliver Hunt. 5906 5907 Use va_args to access cti function arguments. 5908 https://bugs.webkit.org/show_bug.cgi?id=22774 5909 5910 This may be a minor regression, but we'll take the hit if so to reduce fragility. 5911 5912 * interpreter/Interpreter.cpp: 5913 * interpreter/Interpreter.h: 5914 59152008-12-09 Sam Weinig <sam@webkit.org> 5916 5917 Reviewed twice by Cameron Zwarich. 5918 5919 Fix for https://bugs.webkit.org/show_bug.cgi?id=22752 5920 Clear SymbolTable after codegen for Function codeblocks that 5921 don't require an activation 5922 5923 This is a ~1.5MB improvement on Membuster-head. 5924 5925 * bytecode/CodeBlock.cpp: 5926 (JSC::CodeBlock::dumpStatistics): Add logging of non-empty symbol tables 5927 and total size used by symbol tables. 5928 * bytecompiler/BytecodeGenerator.cpp: 5929 (JSC::BytecodeGenerator::generate): Clear the symbol table here. 5930 59312008-12-09 Sam Weinig <sam@webkit.org> 5932 5933 Reviewed by Geoffrey Garen. 5934 5935 Remove unnecessary extra lookup when throwing an exception. 5936 We used to first lookup the target offset using getHandlerForVPC 5937 and then we would lookup the native code stub using 5938 nativeExceptionCodeForHandlerVPC. Instead, we can just pass around 5939 the HandlerInfo. 5940 5941 * bytecode/CodeBlock.cpp: 5942 (JSC::CodeBlock::handlerForVPC): Return the HandlerInfo. 5943 * bytecode/CodeBlock.h: Remove nativeExceptionCodeForHandlerVPC. 5944 5945 * interpreter/Interpreter.cpp: 5946 (JSC::Interpreter::throwException): Return a HandlerInfo instead of 5947 and Instruction offset. 5948 (JSC::Interpreter::privateExecute): Get the offset from HandlerInfo. 5949 (JSC::Interpreter::cti_op_throw): Get the native code from the HandleInfo. 5950 (JSC::Interpreter::cti_vm_throw): Ditto. 5951 * interpreter/Interpreter.h: 5952 59532008-12-09 Eric Seidel <eric@webkit.org> 5954 5955 Build fix only, no review. 5956 5957 Speculative fix for the Chromium-Windows bot. 5958 Add JavaScriptCore/os-win32 to the include path (for stdint.h) 5959 Strangely it builds fine on my local windows box (or at least doesn't hit this error) 5960 5961 * JavaScriptCore.scons: 5962 59632008-12-09 Eric Seidel <eric@webkit.org> 5964 5965 No review, build fix only. 5966 5967 Add ExecutableAllocator files missing from Scons build. 5968 5969 * JavaScriptCore.scons: 5970 59712008-12-09 Dimitri Glazkov <dglazkov@chromium.org> 5972 5973 Reviewed by Timothy Hatcher. 5974 5975 https://bugs.webkit.org/show_bug.cgi?id=22631 5976 Allow ScriptCallFrame query names of functions in the call stack. 5977 5978 * JavaScriptCore.exp: added InternalFunction::name and 5979 UString operator==() as exported symbol 5980 59812008-12-08 Judit Jasz <jasy@inf.u-szeged.hu> 5982 5983 Reviewed and tweaked by Cameron Zwarich. 5984 5985 Bug 22352: Annotate opcodes with their length 5986 <https://bugs.webkit.org/show_bug.cgi?id=22352> 5987 5988 * bytecode/Opcode.cpp: 5989 * bytecode/Opcode.h: 5990 * interpreter/Interpreter.cpp: 5991 (JSC::Interpreter::privateExecute): 5992 * jit/JIT.cpp: 5993 (JSC::JIT::privateCompileMainPass): 5994 (JSC::JIT::privateCompileSlowCases): 5995 59962008-12-08 Geoffrey Garen <ggaren@apple.com> 5997 5998 Reviewed by Oliver Hunt. 5999 6000 Implemented more of the relaxed and somewhat weird rules for deciding 6001 how to interpret a non-pattern-character. 6002 6003 * wrec/Escapes.h: 6004 (JSC::WREC::Escape::): 6005 (JSC::WREC::Escape::Escape): Eliminated Escape::None because it was 6006 unused. If you see an '\\', it's either a valid escape or an error. 6007 6008 * wrec/Quantifier.h: 6009 (JSC::WREC::Quantifier::Quantifier): 6010 * wrec/WRECGenerator.cpp: 6011 (JSC::WREC::Generator::generateNonGreedyQuantifier): 6012 (JSC::WREC::Generator::generateGreedyQuantifier): Renamed "noMaxSpecified" 6013 to "Infinity", since that's what it means. 6014 6015 * wrec/WRECParser.cpp: 6016 (JSC::WREC::Parser::consumeGreedyQuantifier): Re-wrote {n,m} parsing rules 6017 because they were too strict before. Added support for backtracking 6018 in the case where the {n,m} fails to parse as a quantifier, and yet is 6019 not a syntax error. 6020 6021 (JSC::WREC::Parser::parseCharacterClass): 6022 (JSC::WREC::Parser::parseNonCharacterEscape): Eliminated Escape::None, 6023 as above. 6024 6025 (JSC::WREC::Parser::consumeEscape): Don't treat ASCII and _ escapes 6026 as syntax errors. See fast/regex/non-pattern-characters.html. 6027 6028 * wrec/WRECParser.h: 6029 (JSC::WREC::Parser::SavedState::SavedState): 6030 (JSC::WREC::Parser::SavedState::restore): Added a state backtracker, 6031 since parsing {n,m} forms requires backtracking if the form turns out 6032 not to be a quantifier. 6033 60342008-12-08 Geoffrey Garen <ggaren@apple.com> 6035 6036 Reviewed by Oliver Hunt. 6037 6038 Refactored WREC parsing so that only one piece of code needs to know 6039 the relaxed and somewhat weird rules for deciding how to interpret a 6040 non-pattern-character, in preparation for implementing those rules. 6041 6042 Also, implemented the relaxed and somewhat weird rules for '}' and ']'. 6043 6044 * wrec/WREC.cpp: Reduced the regular expression size limit. Now that 6045 WREC handles ']' properly, it compiles fast/js/regexp-charclass-crash.html, 6046 which makes it hang at the old limit. (The old limit was based on the 6047 misimpression that the same value in PCRE limited the regular expression 6048 pattern size; in reality, it limited the expected compiled regular 6049 expression size. WREC doesn't have a way to calculate an expected 6050 compiled regular expression size, but this should be good enough.) 6051 6052 * wrec/WRECParser.cpp: 6053 (JSC::WREC::parsePatternCharacterSequence): Nixed this function because 6054 it contained a second copy of the logic for handling non-pattern-characters, 6055 which is about to get a lot more complicated. 6056 6057 (JSC::WREC::PatternCharacterSequence::PatternCharacterSequence): 6058 (JSC::WREC::PatternCharacterSequence::size): 6059 (JSC::WREC::PatternCharacterSequence::append): 6060 (JSC::WREC::PatternCharacterSequence::flush): Helper object for generating 6061 an optimized sequence of pattern characters. 6062 6063 (JSC::WREC::Parser::parseNonCharacterEscape): Renamed to reflect the fact 6064 that the main parseAlternative loop handles character escapes. 6065 6066 (JSC::WREC::Parser::parseAlternative): Moved pattern character sequence 6067 logic from parsePatternCharacterSequence to here, using 6068 PatternCharacterSequence to help with the details. 6069 6070 * wrec/WRECParser.h: Updated for renames. 6071 60722008-12-08 Alexey Proskuryakov <ap@webkit.org> 6073 6074 Reviewed by Geoff Garen. 6075 6076 <rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware, 6077 and un-deprecate it 6078 6079 * API/JSContextRef.cpp: (JSGlobalContextCreate): 6080 * API/JSContextRef.h: 6081 Use a unique context group for the context, unless the application was linked against old 6082 JavaScriptCore. 6083 60842008-12-08 Sam Weinig <sam@webkit.org> 6085 6086 Reviewed by Cameron Zwarich. 6087 6088 Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock 6089 6090 Step 1: 6091 6092 Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures 6093 in for cached lookup. Instead, use the offset in the StructureStubInfo that is 6094 already required. 6095 6096 * bytecode/CodeBlock.cpp: 6097 (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon. 6098 * interpreter/Interpreter.cpp: 6099 (JSC::Interpreter::tryCTICachePutByID): 6100 (JSC::Interpreter::tryCTICacheGetByID): 6101 (JSC::Interpreter::cti_op_get_by_id_self_fail): 6102 (JSC::Interpreter::cti_op_get_by_id_proto_list): 6103 * jit/JIT.h: 6104 (JSC::JIT::compileGetByIdSelf): 6105 (JSC::JIT::compileGetByIdProto): 6106 (JSC::JIT::compileGetByIdChain): 6107 (JSC::JIT::compilePutByIdReplace): 6108 (JSC::JIT::compilePutByIdTransition): 6109 * jit/JITPropertyAccess.cpp: 6110 (JSC::JIT::privateCompilePutByIdTransition): 6111 (JSC::JIT::patchGetByIdSelf): 6112 (JSC::JIT::patchPutByIdReplace): 6113 (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo. 6114 (JSC::JIT::privateCompileGetByIdSelf): 6115 (JSC::JIT::privateCompileGetByIdProto): 6116 (JSC::JIT::privateCompileGetByIdChain): 6117 (JSC::JIT::privateCompilePutByIdReplace): 6118 61192008-12-08 Gavin Barraclough <barraclough@apple.com> 6120 6121 Reviewed by Oliver Hunt. 6122 6123 Port the op_j?n?eq_null JIT code generation to use the MacroAssembler, 6124 and clean up slightly at the same time. The 'j' forms currently compare, 6125 then set a register, then compare again, then branch. Branch directly on 6126 the result of the first compare. 6127 6128 Around a 1% progression on deltablue, crypto & early boyer, for about 1/2% 6129 overall on v8-tests. 6130 6131 * jit/JIT.cpp: 6132 (JSC::JIT::privateCompileMainPass): 6133 * jit/JITPropertyAccess.cpp: 6134 (JSC::JIT::compileGetByIdSlowCase): 6135 61362008-12-08 Gavin Barraclough <barraclough@apple.com> 6137 6138 Reviewed by Geoff Garen. 6139 6140 Expand MacroAssembler to support more operations, required by the JIT. 6141 6142 Generally adds more operations and permutations of operands to the existing 6143 interface. Rename 'jset' to 'jnz' and 'jnset' to 'jz', which seem clearer, 6144 and require that immediate pointer operands (though not pointer addresses to 6145 load and store instructions) are wrapped in a ImmPtr() type, akin to Imm32(). 6146 6147 No performance impact. 6148 6149 * assembler/MacroAssembler.h: 6150 (JSC::MacroAssembler::): 6151 (JSC::MacroAssembler::ImmPtr::ImmPtr): 6152 (JSC::MacroAssembler::add32): 6153 (JSC::MacroAssembler::and32): 6154 (JSC::MacroAssembler::or32): 6155 (JSC::MacroAssembler::sub32): 6156 (JSC::MacroAssembler::xor32): 6157 (JSC::MacroAssembler::loadPtr): 6158 (JSC::MacroAssembler::load32): 6159 (JSC::MacroAssembler::storePtr): 6160 (JSC::MacroAssembler::store32): 6161 (JSC::MacroAssembler::poke): 6162 (JSC::MacroAssembler::move): 6163 (JSC::MacroAssembler::testImm32): 6164 (JSC::MacroAssembler::jae32): 6165 (JSC::MacroAssembler::jb32): 6166 (JSC::MacroAssembler::jePtr): 6167 (JSC::MacroAssembler::je32): 6168 (JSC::MacroAssembler::jnePtr): 6169 (JSC::MacroAssembler::jne32): 6170 (JSC::MacroAssembler::jnzPtr): 6171 (JSC::MacroAssembler::jnz32): 6172 (JSC::MacroAssembler::jzPtr): 6173 (JSC::MacroAssembler::jz32): 6174 (JSC::MacroAssembler::joSub32): 6175 (JSC::MacroAssembler::jump): 6176 (JSC::MacroAssembler::sete32): 6177 (JSC::MacroAssembler::setne32): 6178 (JSC::MacroAssembler::setnz32): 6179 (JSC::MacroAssembler::setz32): 6180 * assembler/X86Assembler.h: 6181 (JSC::X86Assembler::addl_mr): 6182 (JSC::X86Assembler::andl_i8r): 6183 (JSC::X86Assembler::cmpl_rm): 6184 (JSC::X86Assembler::cmpl_mr): 6185 (JSC::X86Assembler::cmpl_i8m): 6186 (JSC::X86Assembler::subl_mr): 6187 (JSC::X86Assembler::testl_i32m): 6188 (JSC::X86Assembler::xorl_i32r): 6189 (JSC::X86Assembler::movl_rm): 6190 (JSC::X86Assembler::modRm_opmsib): 6191 * jit/JIT.cpp: 6192 (JSC::JIT::privateCompileMainPass): 6193 * jit/JITInlineMethods.h: 6194 (JSC::JIT::emitGetVirtualRegister): 6195 (JSC::JIT::emitPutCTIArgConstant): 6196 (JSC::JIT::emitPutCTIParam): 6197 (JSC::JIT::emitPutImmediateToCallFrameHeader): 6198 (JSC::JIT::emitInitRegister): 6199 (JSC::JIT::checkStructure): 6200 (JSC::JIT::emitJumpIfJSCell): 6201 (JSC::JIT::emitJumpIfNotJSCell): 6202 (JSC::JIT::emitJumpSlowCaseIfNotImmNum): 6203 62042008-12-08 Geoffrey Garen <ggaren@apple.com> 6205 6206 Reviewed by Sam Weinig. 6207 6208 Fixed a bug where WREC would allow a quantifier whose minimum was 6209 greater than its maximum. 6210 6211 * wrec/Quantifier.h: 6212 (JSC::WREC::Quantifier::Quantifier): ASSERT that the quantifier is not 6213 backwards. 6214 6215 * wrec/WRECParser.cpp: 6216 (JSC::WREC::Parser::consumeGreedyQuantifier): Verify that the minimum 6217 is not greater than the maximum. 6218 62192008-12-08 Eric Seidel <eric@webkit.org> 6220 6221 Build fix only, no review. 6222 6223 * JavaScriptCore.scons: add bytecode/JumpTable.cpp 6224 62252008-12-08 Sam Weinig <sam@webkit.org> 6226 6227 Reviewed by Geoffrey Garen. 6228 6229 Patch for https://bugs.webkit.org/show_bug.cgi?id=22716 6230 <rdar://problem/6428315> 6231 Add RareData structure to CodeBlock for infrequently used auxiliary data 6232 members. 6233 6234 Reduces memory on Membuster-head by ~.5MB 6235 6236 * bytecode/CodeBlock.cpp: 6237 (JSC::CodeBlock::dump): 6238 (JSC::CodeBlock::dumpStatistics): 6239 (JSC::CodeBlock::mark): 6240 (JSC::CodeBlock::getHandlerForVPC): 6241 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC): 6242 (JSC::CodeBlock::shrinkToFit): 6243 * bytecode/CodeBlock.h: 6244 (JSC::CodeBlock::numberOfExceptionHandlers): 6245 (JSC::CodeBlock::addExceptionHandler): 6246 (JSC::CodeBlock::exceptionHandler): 6247 (JSC::CodeBlock::addFunction): 6248 (JSC::CodeBlock::function): 6249 (JSC::CodeBlock::addUnexpectedConstant): 6250 (JSC::CodeBlock::unexpectedConstant): 6251 (JSC::CodeBlock::addRegExp): 6252 (JSC::CodeBlock::regexp): 6253 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables): 6254 (JSC::CodeBlock::addImmediateSwitchJumpTable): 6255 (JSC::CodeBlock::immediateSwitchJumpTable): 6256 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables): 6257 (JSC::CodeBlock::addCharacterSwitchJumpTable): 6258 (JSC::CodeBlock::characterSwitchJumpTable): 6259 (JSC::CodeBlock::numberOfStringSwitchJumpTables): 6260 (JSC::CodeBlock::addStringSwitchJumpTable): 6261 (JSC::CodeBlock::stringSwitchJumpTable): 6262 (JSC::CodeBlock::evalCodeCache): 6263 (JSC::CodeBlock::createRareDataIfNecessary): 6264 62652008-11-26 Peter Kasting <pkasting@google.com> 6266 6267 Reviewed by Anders Carlsson. 6268 6269 https://bugs.webkit.org/show_bug.cgi?id=16814 6270 Allow ports to disable ActiveX->NPAPI conversion for Media Player. 6271 Improve handling of miscellaneous ActiveX objects. 6272 6273 * wtf/Platform.h: Add another ENABLE(...). 6274 62752008-12-08 Sam Weinig <sam@webkit.org> 6276 6277 Reviewed by Mark Rowe. 6278 6279 Add dumping of CodeBlock member structure usage. 6280 6281 * bytecode/CodeBlock.cpp: 6282 (JSC::CodeBlock::dumpStatistics): 6283 * bytecode/EvalCodeCache.h: 6284 (JSC::EvalCodeCache::isEmpty): 6285 62862008-12-08 David Kilzer <ddkilzer@apple.com> 6287 6288 Bug 22555: Sort "children" sections in Xcode project files 6289 6290 <https://bugs.webkit.org/show_bug.cgi?id=22555> 6291 6292 Reviewed by Eric Seidel. 6293 6294 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted. 6295 62962008-12-08 Tony Chang <tony@chromium.org> 6297 6298 Reviewed by Eric Seidel. 6299 6300 Enable Pan scrolling only when building on PLATFORM(WIN_OS) 6301 Previously platforms like Apple Windows WebKit, Cairo Windows WebKit, 6302 Wx and Chromium were enabling it explicitly, now we just turn it on 6303 for all WIN_OS, later platforms can turn it off as needed on Windows 6304 (or turn it on under Linux, etc.) 6305 https://bugs.webkit.org/show_bug.cgi?id=22698 6306 6307 * wtf/Platform.h: 6308 63092008-12-08 Sam Weinig <sam@webkit.org> 6310 6311 Reviewed by Cameron Zwarich. 6312 6313 Add basic memory statistics dumping for CodeBlock. 6314 6315 * bytecode/CodeBlock.cpp: 6316 (JSC::CodeBlock::dumpStatistics): 6317 (JSC::CodeBlock::CodeBlock): 6318 (JSC::CodeBlock::~CodeBlock): 6319 * bytecode/CodeBlock.h: 6320 63212008-12-08 Simon Hausmann <simon.hausmann@nokia.com> 6322 6323 Fix the Linux build with newer gcc/glibc. 6324 6325 * jit/ExecutableAllocatorPosix.cpp: Include unistd.h for 6326 getpagesize(), according to 6327 http://opengroup.org/onlinepubs/007908775/xsh/getpagesize.html 6328 63292008-12-08 Simon Hausmann <simon.hausmann@nokia.com> 6330 6331 Fix the build with Qt on Windows. 6332 6333 * JavaScriptCore.pri: Compile ExecutableAllocatorWin.cpp on Windows. 6334 63352008-12-07 Oliver Hunt <oliver@apple.com> 6336 6337 Reviewed by NOBODY (Buildfix). 6338 6339 Fix non-WREC builds 6340 6341 * runtime/RegExp.cpp: 6342 (JSC::RegExp::RegExp): 6343 63442008-12-07 Oliver Hunt <oliver@apple.com> 6345 6346 Reviewed by NOBODY (Build fix). 6347 6348 Put ENABLE(ASSEMBLER) guards around use of ExecutableAllocator in global data 6349 6350 Correct Qt and Gtk project files 6351 6352 * GNUmakefile.am: 6353 * JavaScriptCore.pri: 6354 * runtime/JSGlobalData.h: 6355 63562008-12-07 Oliver Hunt <oliver@apple.com> 6357 6358 Reviewed by NOBODY (Build fix). 6359 6360 Add new files to other projects. 6361 6362 * GNUmakefile.am: 6363 * JavaScriptCore.pri: 6364 * JavaScriptCore.pro: 6365 63662008-12-07 Oliver Hunt <oliver@apple.com> 6367 6368 Rubber stamped by Mark Rowe. 6369 6370 Rename ExecutableAllocatorMMAP to the more sensible ExecutableAllocatorPosix 6371 6372 * JavaScriptCore.xcodeproj/project.pbxproj: 6373 * jit/ExecutableAllocator.h: 6374 * jit/ExecutableAllocatorPosix.cpp: Renamed from JavaScriptCore/jit/ExecutableAllocatorMMAP.cpp. 6375 (JSC::ExecutableAllocator::intializePageSize): 6376 (JSC::ExecutablePool::systemAlloc): 6377 (JSC::ExecutablePool::systemRelease): 6378 63792008-12-07 Oliver Hunt <oliver@apple.com> 6380 6381 Reviewed by Cameron Zwarich and Sam Weinig 6382 6383 <rdar://problem/6309878> Need more granular control over allocation of executable memory (21783) 6384 <https://bugs.webkit.org/show_bug.cgi?id=21783> 6385 6386 Add a new allocator for use by the JIT that provides executable pages, so 6387 we can get rid of the current hack that makes the entire heap executable. 6388 6389 1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well! 6390 6391 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 6392 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 6393 * JavaScriptCore.xcodeproj/project.pbxproj: 6394 * assembler/AssemblerBuffer.h: 6395 (JSC::AssemblerBuffer::size): 6396 (JSC::AssemblerBuffer::executableCopy): 6397 * assembler/MacroAssembler.h: 6398 (JSC::MacroAssembler::size): 6399 (JSC::MacroAssembler::copyCode): 6400 * assembler/X86Assembler.h: 6401 (JSC::X86Assembler::size): 6402 (JSC::X86Assembler::executableCopy): 6403 * bytecode/CodeBlock.cpp: 6404 (JSC::CodeBlock::~CodeBlock): 6405 * bytecode/CodeBlock.h: 6406 (JSC::CodeBlock::executablePool): 6407 (JSC::CodeBlock::setExecutablePool): 6408 * bytecode/Instruction.h: 6409 (JSC::PolymorphicAccessStructureList::derefStructures): 6410 * interpreter/Interpreter.cpp: 6411 (JSC::Interpreter::~Interpreter): 6412 * interpreter/Interpreter.h: 6413 * jit/ExecutableAllocator.cpp: Added. 6414 * jit/ExecutableAllocator.h: Added. 6415 (JSC::ExecutablePool::create): 6416 (JSC::ExecutablePool::alloc): 6417 (JSC::ExecutablePool::~ExecutablePool): 6418 (JSC::ExecutablePool::available): 6419 (JSC::ExecutablePool::ExecutablePool): 6420 (JSC::ExecutablePool::poolAllocate): 6421 (JSC::ExecutableAllocator::ExecutableAllocator): 6422 (JSC::ExecutableAllocator::poolForSize): 6423 (JSC::ExecutablePool::sizeForAllocation): 6424 * jit/ExecutableAllocatorMMAP.cpp: Added. 6425 (JSC::ExecutableAllocator::intializePageSize): 6426 (JSC::ExecutablePool::systemAlloc): 6427 (JSC::ExecutablePool::systemRelease): 6428 * jit/ExecutableAllocatorWin.cpp: Added. 6429 (JSC::ExecutableAllocator::intializePageSize): 6430 (JSC::ExecutablePool::systemAlloc): 6431 (JSC::ExecutablePool::systemRelease): 6432 * jit/JIT.cpp: 6433 (JSC::JIT::privateCompile): 6434 (JSC::JIT::privateCompileCTIMachineTrampolines): 6435 * jit/JIT.h: 6436 (JSC::JIT::compileCTIMachineTrampolines): 6437 * jit/JITPropertyAccess.cpp: 6438 (JSC::JIT::privateCompilePutByIdTransition): 6439 (JSC::JIT::privateCompilePatchGetArrayLength): 6440 (JSC::JIT::privateCompileGetByIdSelf): 6441 (JSC::JIT::privateCompileGetByIdProto): 6442 (JSC::JIT::privateCompileGetByIdSelfList): 6443 (JSC::JIT::privateCompileGetByIdProtoList): 6444 (JSC::JIT::privateCompileGetByIdChainList): 6445 (JSC::JIT::privateCompileGetByIdChain): 6446 (JSC::JIT::privateCompilePutByIdReplace): 6447 * parser/Nodes.cpp: 6448 (JSC::RegExpNode::emitBytecode): 6449 * runtime/JSGlobalData.h: 6450 (JSC::JSGlobalData::poolForSize): 6451 * runtime/RegExp.cpp: 6452 (JSC::RegExp::RegExp): 6453 (JSC::RegExp::create): 6454 (JSC::RegExp::~RegExp): 6455 * runtime/RegExp.h: 6456 * runtime/RegExpConstructor.cpp: 6457 (JSC::constructRegExp): 6458 * runtime/RegExpPrototype.cpp: 6459 (JSC::regExpProtoFuncCompile): 6460 * runtime/StringPrototype.cpp: 6461 (JSC::stringProtoFuncMatch): 6462 (JSC::stringProtoFuncSearch): 6463 * wrec/WREC.cpp: 6464 (JSC::WREC::Generator::compileRegExp): 6465 * wrec/WRECGenerator.h: 6466 * wtf/FastMalloc.cpp: 6467 * wtf/FastMalloc.h: 6468 * wtf/TCSystemAlloc.cpp: 6469 (TryMmap): 6470 (TryVirtualAlloc): 6471 (TryDevMem): 6472 (TCMalloc_SystemRelease): 6473 64742008-12-06 Sam Weinig <sam@webkit.org> 6475 6476 Fix the Gtk build. 6477 6478 * jit/JITPropertyAccess.cpp: 6479 (JSC::JIT::compileGetByIdHotPath): 6480 (JSC::JIT::compilePutByIdHotPath): 6481 64822008-12-06 Sam Weinig <sam@webkit.org> 6483 6484 Reviewed by Cameron Zwarich, 6485 6486 Move CodeBlock constructor into the .cpp file. 6487 6488 Sunspider reports a .7% progression, but I can only assume this 6489 is noise. 6490 6491 * bytecode/CodeBlock.cpp: 6492 (JSC::CodeBlock::CodeBlock): 6493 * bytecode/CodeBlock.h: 6494 64952008-12-06 Sam Weinig <sam@webkit.org> 6496 6497 Reviewed by Cameron Zwarich. 6498 6499 Split JumpTable code into its own file. 6500 6501 * GNUmakefile.am: 6502 * JavaScriptCore.pri: 6503 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 6504 * JavaScriptCore.xcodeproj/project.pbxproj: 6505 * JavaScriptCoreSources.bkl: 6506 * bytecode/CodeBlock.cpp: 6507 * bytecode/CodeBlock.h: 6508 * bytecode/JumpTable.cpp: Copied from bytecode/CodeBlock.cpp. 6509 * bytecode/JumpTable.h: Copied from bytecode/CodeBlock.h. 6510 65112008-12-05 Sam Weinig <sam@webkit.org> 6512 6513 Reviewed by Cameron Zwarich. 6514 6515 Fix for https://bugs.webkit.org/show_bug.cgi?id=22715 6516 Encapsulate more CodeBlock members in preparation 6517 of moving some of them to a rare data structure. 6518 6519 * bytecode/CodeBlock.cpp: 6520 (JSC::locationForOffset): 6521 (JSC::printConditionalJump): 6522 (JSC::printGetByIdOp): 6523 (JSC::printPutByIdOp): 6524 (JSC::CodeBlock::printStructure): 6525 (JSC::CodeBlock::printStructures): 6526 (JSC::CodeBlock::dump): 6527 (JSC::CodeBlock::~CodeBlock): 6528 (JSC::CodeBlock::unlinkCallers): 6529 (JSC::CodeBlock::derefStructures): 6530 (JSC::CodeBlock::refStructures): 6531 (JSC::CodeBlock::mark): 6532 (JSC::CodeBlock::getHandlerForVPC): 6533 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC): 6534 (JSC::CodeBlock::lineNumberForVPC): 6535 (JSC::CodeBlock::expressionRangeForVPC): 6536 (JSC::CodeBlock::shrinkToFit): 6537 * bytecode/CodeBlock.h: 6538 (JSC::CodeBlock::CodeBlock): 6539 (JSC::CodeBlock::addCaller): 6540 (JSC::CodeBlock::removeCaller): 6541 (JSC::CodeBlock::isKnownNotImmediate): 6542 (JSC::CodeBlock::isConstantRegisterIndex): 6543 (JSC::CodeBlock::getConstant): 6544 (JSC::CodeBlock::isTemporaryRegisterIndex): 6545 (JSC::CodeBlock::getStubInfo): 6546 (JSC::CodeBlock::getCallLinkInfo): 6547 (JSC::CodeBlock::instructions): 6548 (JSC::CodeBlock::setJITCode): 6549 (JSC::CodeBlock::jitCode): 6550 (JSC::CodeBlock::ownerNode): 6551 (JSC::CodeBlock::setGlobalData): 6552 (JSC::CodeBlock::setThisRegister): 6553 (JSC::CodeBlock::thisRegister): 6554 (JSC::CodeBlock::setNeedsFullScopeChain): 6555 (JSC::CodeBlock::needsFullScopeChain): 6556 (JSC::CodeBlock::setUsesEval): 6557 (JSC::CodeBlock::usesEval): 6558 (JSC::CodeBlock::setUsesArguments): 6559 (JSC::CodeBlock::usesArguments): 6560 (JSC::CodeBlock::codeType): 6561 (JSC::CodeBlock::source): 6562 (JSC::CodeBlock::sourceOffset): 6563 (JSC::CodeBlock::addGlobalResolveInstruction): 6564 (JSC::CodeBlock::numberOfPropertyAccessInstructions): 6565 (JSC::CodeBlock::addPropertyAccessInstruction): 6566 (JSC::CodeBlock::propertyAccessInstruction): 6567 (JSC::CodeBlock::numberOfCallLinkInfos): 6568 (JSC::CodeBlock::addCallLinkInfo): 6569 (JSC::CodeBlock::callLinkInfo): 6570 (JSC::CodeBlock::numberOfJumpTargets): 6571 (JSC::CodeBlock::addJumpTarget): 6572 (JSC::CodeBlock::jumpTarget): 6573 (JSC::CodeBlock::lastJumpTarget): 6574 (JSC::CodeBlock::numberOfExceptionHandlers): 6575 (JSC::CodeBlock::addExceptionHandler): 6576 (JSC::CodeBlock::exceptionHandler): 6577 (JSC::CodeBlock::addExpressionInfo): 6578 (JSC::CodeBlock::numberOfLineInfos): 6579 (JSC::CodeBlock::addLineInfo): 6580 (JSC::CodeBlock::lastLineInfo): 6581 (JSC::CodeBlock::jitReturnAddressVPCMap): 6582 (JSC::CodeBlock::numberOfIdentifiers): 6583 (JSC::CodeBlock::addIdentifier): 6584 (JSC::CodeBlock::identifier): 6585 (JSC::CodeBlock::numberOfConstantRegisters): 6586 (JSC::CodeBlock::addConstantRegister): 6587 (JSC::CodeBlock::constantRegister): 6588 (JSC::CodeBlock::addFunction): 6589 (JSC::CodeBlock::function): 6590 (JSC::CodeBlock::addFunctionExpression): 6591 (JSC::CodeBlock::functionExpression): 6592 (JSC::CodeBlock::addUnexpectedConstant): 6593 (JSC::CodeBlock::unexpectedConstant): 6594 (JSC::CodeBlock::addRegExp): 6595 (JSC::CodeBlock::regexp): 6596 (JSC::CodeBlock::symbolTable): 6597 (JSC::CodeBlock::evalCodeCache): 6598 New inline setters/getters. 6599 6600 (JSC::ProgramCodeBlock::ProgramCodeBlock): 6601 (JSC::ProgramCodeBlock::~ProgramCodeBlock): 6602 (JSC::ProgramCodeBlock::clearGlobalObject): 6603 * bytecode/SamplingTool.cpp: 6604 (JSC::ScopeSampleRecord::sample): 6605 (JSC::SamplingTool::dump): 6606 * bytecompiler/BytecodeGenerator.cpp: 6607 * bytecompiler/BytecodeGenerator.h: 6608 * bytecompiler/Label.h: 6609 * interpreter/CallFrame.cpp: 6610 * interpreter/Interpreter.cpp: 6611 * jit/JIT.cpp: 6612 * jit/JITCall.cpp: 6613 * jit/JITInlineMethods.h: 6614 * jit/JITPropertyAccess.cpp: 6615 * parser/Nodes.cpp: 6616 * runtime/Arguments.h: 6617 * runtime/ExceptionHelpers.cpp: 6618 * runtime/JSActivation.cpp: 6619 * runtime/JSActivation.h: 6620 * runtime/JSGlobalObject.cpp: 6621 Change direct access to use new getter/setters. 6622 66232008-12-05 Gavin Barraclough <barraclough@apple.com> 6624 6625 Reviewed by Oliver Hunt. 6626 6627 Prevent GCC4.2 from hanging when trying to compile Interpreter.cpp. 6628 Added "-fno-var-tracking" compiler flag. 6629 6630 https://bugs.webkit.org/show_bug.cgi?id=22704 6631 6632 * JavaScriptCore.xcodeproj/project.pbxproj: 6633 66342008-12-05 Gavin Barraclough <barraclough@apple.com> 6635 6636 Reviewed by Oliver Hunt. 6637 6638 Ordering of branch operands in MacroAssembler in unnecessarily inconsistent. 6639 6640 je, jg etc take an immediate operand as the second argument, but for the 6641 equality branches (je, jne) the immediate operand was the first argument. This 6642 was unnecessarily inconsistent. Change je, jne methods to take the immediate 6643 as the second argument. 6644 6645 https://bugs.webkit.org/show_bug.cgi?id=22703 6646 6647 * assembler/MacroAssembler.h: 6648 (JSC::MacroAssembler::je32): 6649 (JSC::MacroAssembler::jne32): 6650 * jit/JIT.cpp: 6651 (JSC::JIT::compileOpStrictEq): 6652 * wrec/WRECGenerator.cpp: 6653 (JSC::WREC::Generator::generateEnter): 6654 (JSC::WREC::Generator::generateNonGreedyQuantifier): 6655 (JSC::WREC::Generator::generateGreedyQuantifier): 6656 (JSC::WREC::Generator::generatePatternCharacterPair): 6657 (JSC::WREC::Generator::generatePatternCharacter): 6658 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 6659 (JSC::WREC::Generator::generateCharacterClassInverted): 6660 (JSC::WREC::Generator::generateAssertionBOL): 6661 (JSC::WREC::Generator::generateAssertionWordBoundary): 6662 66632008-12-05 Gavin Barraclough <barraclough@apple.com> 6664 6665 Reviewed by Geoff Garen. 6666 6667 Second tranche of porting JIT.cpp to MacroAssembler interface. 6668 6669 * assembler/MacroAssembler.h: 6670 (JSC::MacroAssembler::mul32): 6671 (JSC::MacroAssembler::jl32): 6672 (JSC::MacroAssembler::jnzSub32): 6673 (JSC::MacroAssembler::joAdd32): 6674 (JSC::MacroAssembler::joMul32): 6675 (JSC::MacroAssembler::jzSub32): 6676 * jit/JIT.cpp: 6677 (JSC::JIT::emitSlowScriptCheck): 6678 (JSC::JIT::privateCompileMainPass): 6679 (JSC::JIT::privateCompileSlowCases): 6680 (JSC::JIT::privateCompileCTIMachineTrampolines): 6681 * jit/JIT.h: 6682 * jit/JITInlineMethods.h: 6683 (JSC::JIT::emitJumpIfNotJSCell): 6684 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 6685 66862008-12-05 David Kilzer <ddkilzer@apple.com> 6687 6688 Bug 22609: Provide a build-time choice when generating hash tables for properties of built-in DOM objects 6689 6690 <https://bugs.webkit.org/show_bug.cgi?id=22609> 6691 <rdar://problem/6331749> 6692 6693 Reviewed by Darin Adler. 6694 6695 Initial patch by Yosen Lin. Adapted for ToT WebKit by David Kilzer. 6696 6697 Added back the code that generates a "compact" hash (instead of a 6698 perfect hash) as a build-time option using the 6699 ENABLE(PERFECT_HASH_SIZE) macro as defined in Lookup.h. 6700 6701 * create_hash_table: Rename variables to differentiate perfect hash 6702 values from compact hash values. Added back code to compute compact 6703 hash tables. Generate both hash table sizes and emit 6704 conditionalized code based on ENABLE(PERFECT_HASH_SIZE). 6705 * runtime/Lookup.cpp: 6706 (JSC::HashTable::createTable): Added version of createTable() for 6707 use with compact hash tables. 6708 (JSC::HashTable::deleteTable): Updated to work with compact hash 6709 tables. 6710 * runtime/Lookup.h: Defined ENABLE(PERFECT_HASH_SIZE) macro here. 6711 (JSC::HashEntry::initialize): Set m_next to zero when using compact 6712 hash tables. 6713 (JSC::HashEntry::setNext): Added for compact hash tables. 6714 (JSC::HashEntry::next): Added for compact hash tables. 6715 (JSC::HashTable::entry): Added version of entry() for use with 6716 compact hash tables. 6717 * runtime/Structure.cpp: 6718 (JSC::Structure::getEnumerablePropertyNames): Updated to work with 6719 compact hash tables. 6720 67212008-12-05 Gavin Barraclough <barraclough@apple.com> 6722 6723 Reviewed by Geoff Garen. 6724 6725 Remove redundant calls to JIT::emitSlowScriptCheck. 6726 This is checked in the hot path, so is not needed on the slow path - and the code 6727 was being planted before the start of the slow case, so was completely unreachable! 6728 6729 * jit/JIT.cpp: 6730 (JSC::JIT::privateCompileSlowCases): 6731 67322008-12-05 Gavin Barraclough <barraclough@apple.com> 6733 6734 Reviewed by Geoff Garen. 6735 6736 Move JIT::compileOpStrictEq to MacroAssembler interface. 6737 6738 The rewrite also looks like a small (<1%) performance progression. 6739 6740 https://bugs.webkit.org/show_bug.cgi?id=22697 6741 6742 * jit/JIT.cpp: 6743 (JSC::JIT::compileOpStrictEq): 6744 (JSC::JIT::privateCompileSlowCases): 6745 * jit/JIT.h: 6746 * jit/JITInlineMethods.h: 6747 (JSC::JIT::emitJumpIfJSCell): 6748 (JSC::JIT::emitJumpSlowCaseIfJSCell): 6749 67502008-12-05 Gavin Barraclough <barraclough@apple.com> 6751 6752 Reviewed by Geoff Garen. 6753 6754 Remove m_assembler from MacroAssembler::Jump. 6755 Keeping a pointer allowed for some syntactic sugar - "link()" looks nicer 6756 than "link(this)". But maintaining this doubles the size of Jump, which 6757 is even more unfortunate for the JIT, since there are many large structures 6758 holding JmpSrcs. Probably best to remove it. 6759 6760 https://bugs.webkit.org/show_bug.cgi?id=22693 6761 6762 * assembler/MacroAssembler.h: 6763 (JSC::MacroAssembler::Jump::Jump): 6764 (JSC::MacroAssembler::Jump::link): 6765 (JSC::MacroAssembler::Jump::linkTo): 6766 (JSC::MacroAssembler::JumpList::link): 6767 (JSC::MacroAssembler::JumpList::linkTo): 6768 (JSC::MacroAssembler::jae32): 6769 (JSC::MacroAssembler::je32): 6770 (JSC::MacroAssembler::je16): 6771 (JSC::MacroAssembler::jg32): 6772 (JSC::MacroAssembler::jge32): 6773 (JSC::MacroAssembler::jl32): 6774 (JSC::MacroAssembler::jle32): 6775 (JSC::MacroAssembler::jnePtr): 6776 (JSC::MacroAssembler::jne32): 6777 (JSC::MacroAssembler::jnset32): 6778 (JSC::MacroAssembler::jset32): 6779 (JSC::MacroAssembler::jump): 6780 (JSC::MacroAssembler::jzSub32): 6781 (JSC::MacroAssembler::joAdd32): 6782 (JSC::MacroAssembler::call): 6783 * wrec/WREC.cpp: 6784 (JSC::WREC::Generator::compileRegExp): 6785 * wrec/WRECGenerator.cpp: 6786 (JSC::WREC::Generator::generateEnter): 6787 (JSC::WREC::Generator::generateBackreferenceQuantifier): 6788 (JSC::WREC::Generator::generateNonGreedyQuantifier): 6789 (JSC::WREC::Generator::generateGreedyQuantifier): 6790 (JSC::WREC::Generator::generatePatternCharacter): 6791 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 6792 (JSC::WREC::Generator::generateCharacterClassInverted): 6793 (JSC::WREC::Generator::generateCharacterClass): 6794 (JSC::WREC::Generator::generateParenthesesAssertion): 6795 (JSC::WREC::Generator::generateParenthesesInvertedAssertion): 6796 (JSC::WREC::Generator::generateParenthesesNonGreedy): 6797 (JSC::WREC::Generator::generateParenthesesResetTrampoline): 6798 (JSC::WREC::Generator::generateAssertionBOL): 6799 (JSC::WREC::Generator::generateAssertionEOL): 6800 (JSC::WREC::Generator::generateAssertionWordBoundary): 6801 (JSC::WREC::Generator::generateBackreference): 6802 (JSC::WREC::Generator::terminateAlternative): 6803 (JSC::WREC::Generator::terminateDisjunction): 6804 * wrec/WRECParser.h: 6805 68062008-12-05 Gavin Barraclough <barraclough@apple.com> 6807 6808 Reviewed by Geoffrey Garen. 6809 6810 Simplify JIT generated checks for timeout code, by moving more work into the C function. 6811 https://bugs.webkit.org/show_bug.cgi?id=22688 6812 6813 * interpreter/Interpreter.cpp: 6814 (JSC::Interpreter::cti_timeout_check): 6815 * interpreter/Interpreter.h: 6816 * jit/JIT.cpp: 6817 (JSC::JIT::emitSlowScriptCheck): 6818 68192008-12-05 Sam Weinig <sam@webkit.org> 6820 6821 Reviewed by Geoffrey Garen. 6822 6823 Encapsulate access to jump tables in the CodeBlock in preparation 6824 of moving them to a rare data structure. 6825 6826 * bytecode/CodeBlock.cpp: 6827 (JSC::CodeBlock::dump): 6828 (JSC::CodeBlock::shrinkToFit): 6829 * bytecode/CodeBlock.h: 6830 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables): 6831 (JSC::CodeBlock::addImmediateSwitchJumpTable): 6832 (JSC::CodeBlock::immediateSwitchJumpTable): 6833 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables): 6834 (JSC::CodeBlock::addCharacterSwitchJumpTable): 6835 (JSC::CodeBlock::characterSwitchJumpTable): 6836 (JSC::CodeBlock::numberOfStringSwitchJumpTables): 6837 (JSC::CodeBlock::addStringSwitchJumpTable): 6838 (JSC::CodeBlock::stringSwitchJumpTable): 6839 * bytecompiler/BytecodeGenerator.cpp: 6840 (JSC::BytecodeGenerator::generate): 6841 (JSC::BytecodeGenerator::endSwitch): 6842 * interpreter/Interpreter.cpp: 6843 (JSC::Interpreter::privateExecute): 6844 (JSC::Interpreter::cti_op_switch_imm): 6845 (JSC::Interpreter::cti_op_switch_char): 6846 (JSC::Interpreter::cti_op_switch_string): 6847 * jit/JIT.cpp: 6848 (JSC::JIT::privateCompileMainPass): 6849 68502008-12-05 Adam Roben <aroben@apple.com> 6851 6852 Windows build fix after r39020 6853 6854 * jit/JITInlineMethods.h: 6855 (JSC::JIT::restoreArgumentReference): 6856 (JSC::JIT::restoreArgumentReferenceForTrampoline): 6857 Add some apparently-missing __. 6858 68592008-12-04 Geoffrey Garen <ggaren@apple.com> 6860 6861 Reviewed by Darin Adler. 6862 6863 https://bugs.webkit.org/show_bug.cgi?id=22673 6864 6865 Added support for the assertion (?=) and inverted assertion (?!) atoms 6866 in WREC. 6867 6868 * wrec/WRECGenerator.cpp: 6869 (JSC::WREC::Generator::generateParenthesesAssertion): 6870 (JSC::WREC::Generator::generateParenthesesInvertedAssertion): Split the 6871 old (unused) generateParentheses into these two functions, with more 6872 limited capabilities. 6873 6874 * wrec/WRECGenerator.h: 6875 (JSC::WREC::Generator::): Moved an enum to the top of the class definition, 6876 to match the WebKit style, and removed a defunct comment. 6877 6878 * wrec/WRECParser.cpp: 6879 (JSC::WREC::Parser::parseParentheses): 6880 (JSC::WREC::Parser::consumeParenthesesType): 6881 * wrec/WRECParser.h: 6882 (JSC::WREC::Parser::): Added support for parsing (?=) and (?!). 6883 68842008-12-05 Simon Hausmann <simon.hausmann@nokia.com> 6885 6886 Rubber-stamped by Tor Arne Vestbø. 6887 6888 Disable the JIT for the Qt build alltogether again, after observing 6889 more miscompilations in a wider range of newer gcc versions. 6890 6891 * JavaScriptCore.pri: 6892 68932008-12-05 Simon Hausmann <simon.hausmann@nokia.com> 6894 6895 Reviewed by Tor Arne Vestbø. 6896 6897 Disable the JIT for the Qt build on Linux unless gcc is >= 4.2, 6898 due to miscompilations. 6899 6900 * JavaScriptCore.pri: 6901 69022008-12-04 Gavin Barraclough <barraclough@apple.com> 6903 6904 Reviewed by Geoff Garen. 6905 6906 Start porting the JIT to use the MacroAssembler. 6907 6908 https://bugs.webkit.org/show_bug.cgi?id=22671 6909 No change in performance. 6910 6911 * assembler/MacroAssembler.h: 6912 (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc): 6913 (JSC::MacroAssembler::add32): 6914 (JSC::MacroAssembler::and32): 6915 (JSC::MacroAssembler::lshift32): 6916 (JSC::MacroAssembler::rshift32): 6917 (JSC::MacroAssembler::storePtr): 6918 (JSC::MacroAssembler::store32): 6919 (JSC::MacroAssembler::poke): 6920 (JSC::MacroAssembler::move): 6921 (JSC::MacroAssembler::compareImm32ForBranchEquality): 6922 (JSC::MacroAssembler::jnePtr): 6923 (JSC::MacroAssembler::jnset32): 6924 (JSC::MacroAssembler::jset32): 6925 (JSC::MacroAssembler::jzeroSub32): 6926 (JSC::MacroAssembler::joverAdd32): 6927 (JSC::MacroAssembler::call): 6928 * assembler/X86Assembler.h: 6929 (JSC::X86Assembler::shll_i8r): 6930 * jit/JIT.cpp: 6931 (JSC::JIT::privateCompileMainPass): 6932 (JSC::JIT::privateCompile): 6933 (JSC::JIT::privateCompileCTIMachineTrampolines): 6934 * jit/JIT.h: 6935 * jit/JITArithmetic.cpp: 6936 (JSC::JIT::compileBinaryArithOp): 6937 * jit/JITInlineMethods.h: 6938 (JSC::JIT::emitGetVirtualRegister): 6939 (JSC::JIT::emitPutCTIArg): 6940 (JSC::JIT::emitPutCTIArgConstant): 6941 (JSC::JIT::emitGetCTIArg): 6942 (JSC::JIT::emitPutCTIArgFromVirtualRegister): 6943 (JSC::JIT::emitPutCTIParam): 6944 (JSC::JIT::emitGetCTIParam): 6945 (JSC::JIT::emitPutToCallFrameHeader): 6946 (JSC::JIT::emitPutImmediateToCallFrameHeader): 6947 (JSC::JIT::emitGetFromCallFrameHeader): 6948 (JSC::JIT::emitPutVirtualRegister): 6949 (JSC::JIT::emitInitRegister): 6950 (JSC::JIT::emitNakedCall): 6951 (JSC::JIT::restoreArgumentReference): 6952 (JSC::JIT::restoreArgumentReferenceForTrampoline): 6953 (JSC::JIT::emitCTICall): 6954 (JSC::JIT::checkStructure): 6955 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 6956 (JSC::JIT::emitJumpSlowCaseIfNotImmNum): 6957 (JSC::JIT::emitJumpSlowCaseIfNotImmNums): 6958 (JSC::JIT::emitFastArithDeTagImmediate): 6959 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): 6960 (JSC::JIT::emitFastArithReTagImmediate): 6961 (JSC::JIT::emitFastArithPotentiallyReTagImmediate): 6962 (JSC::JIT::emitFastArithImmToInt): 6963 (JSC::JIT::emitFastArithIntToImmOrSlowCase): 6964 (JSC::JIT::emitFastArithIntToImmNoCheck): 6965 (JSC::JIT::emitTagAsBoolImmediate): 6966 * jit/JITPropertyAccess.cpp: 6967 (JSC::JIT::privateCompilePutByIdTransition): 6968 69692008-12-04 Geoffrey Garen <ggaren@apple.com> 6970 6971 Reviewed by Oliver Hunt. 6972 6973 Some refactoring for generateGreedyQuantifier. 6974 6975 SunSpider reports no change (possibly a 0.3% speedup). 6976 6977 * wrec/WRECGenerator.cpp: 6978 (JSC::WREC::Generator::generateGreedyQuantifier): Clarified label 6979 meanings and unified some logic to simplify things. 6980 6981 * wrec/WRECParser.h: 6982 (JSC::WREC::Parser::parseAlternative): Added a version of parseAlternative 6983 that can jump to a Label, instead of a JumpList, upon failure. (Eventually, 6984 when we have a true Label class, this will be redundant.) This makes 6985 things easier for generateGreedyQuantifier, because it can avoid 6986 explicitly linking things. 6987 69882008-12-04 Simon Hausmann <simon.hausmann@nokia.com> 6989 6990 Reviewed by Holger Freyther. 6991 6992 Fix crashes in the Qt build on Linux/i386 with non-executable memory 6993 by enabling TCSystemAlloc and the PROT_EXEC flag for mmap. 6994 6995 * JavaScriptCore.pri: Enable the use of TCSystemAlloc if the JIT is 6996 enabled. 6997 * wtf/TCSystemAlloc.cpp: Extend the PROT_EXEC permissions to 6998 PLATFORM(QT). 6999 70002008-12-04 Simon Hausmann <simon.hausmann@nokia.com> 7001 7002 Reviewed by Tor Arne Vestbø. 7003 7004 Enable ENABLE_JIT_OPTIMIZE_CALL, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 7005 and ENABLE_JIT_OPTIMIZE_ARITHMETIC, as suggested by Niko. 7006 7007 * JavaScriptCore.pri: 7008 70092008-12-04 Kent Hansen <khansen@trolltech.com> 7010 7011 Reviewed by Simon Hausmann. 7012 7013 Enable the JSC jit for the Qt build by default for release builds on 7014 linux-g++ and win32-msvc. 7015 7016 * JavaScriptCore.pri: 7017 70182008-12-04 Gavin Barraclough <barraclough@apple.com> 7019 7020 Reviewed by Oliver Hunt. 7021 7022 Allow JIT to function without property access repatching and arithmetic optimizations. 7023 Controlled by ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS and ENABLE_JIT_OPTIMIZE_ARITHMETIC switches. 7024 7025 https://bugs.webkit.org/show_bug.cgi?id=22643 7026 7027 * JavaScriptCore.xcodeproj/project.pbxproj: 7028 * jit/JIT.cpp: 7029 (JSC::JIT::privateCompileMainPass): 7030 (JSC::JIT::privateCompileSlowCases): 7031 * jit/JIT.h: 7032 * jit/JITArithmetic.cpp: Copied from jit/JIT.cpp. 7033 (JSC::JIT::compileBinaryArithOp): 7034 (JSC::JIT::compileBinaryArithOpSlowCase): 7035 * jit/JITPropertyAccess.cpp: Copied from jit/JIT.cpp. 7036 (JSC::JIT::compileGetByIdHotPath): 7037 (JSC::JIT::compileGetByIdSlowCase): 7038 (JSC::JIT::compilePutByIdHotPath): 7039 (JSC::JIT::compilePutByIdSlowCase): 7040 (JSC::resizePropertyStorage): 7041 (JSC::transitionWillNeedStorageRealloc): 7042 (JSC::JIT::privateCompilePutByIdTransition): 7043 (JSC::JIT::patchGetByIdSelf): 7044 (JSC::JIT::patchPutByIdReplace): 7045 (JSC::JIT::privateCompilePatchGetArrayLength): 7046 * wtf/Platform.h: 7047 70482008-12-03 Geoffrey Garen <ggaren@apple.com> 7049 7050 Reviewed by Oliver Hunt. 7051 7052 Optimized sequences of characters in regular expressions by comparing 7053 two characters at a time. 7054 7055 1-2% speedup on SunSpider, 19-25% speedup on regexp-dna. 7056 7057 * assembler/MacroAssembler.h: 7058 (JSC::MacroAssembler::load32): 7059 (JSC::MacroAssembler::jge32): Filled out a few more macro methods. 7060 7061 * assembler/X86Assembler.h: 7062 (JSC::X86Assembler::movl_mr): Added a verion of movl_mr that operates 7063 without an offset, to allow the macro assembler to optmize for that case. 7064 7065 * wrec/WREC.cpp: 7066 (JSC::WREC::Generator::compileRegExp): Test the saved value of index 7067 instead of the index register when checking for "end of input." The 7068 index register doesn't increment by 1 in an orderly fashion, so testing 7069 it for == "end of input" is not valid. 7070 7071 Also, jump all the way to "return failure" upon reaching "end of input," 7072 instead of executing the next alternative. This is more logical, and 7073 it's a slight optimization in the case of an expression with many alternatives. 7074 7075 * wrec/WRECGenerator.cpp: 7076 (JSC::WREC::Generator::generateIncrementIndex): Added support for 7077 jumping to a failure label in the case where the index has reached "end 7078 of input." 7079 7080 (JSC::WREC::Generator::generatePatternCharacterSequence): 7081 (JSC::WREC::Generator::generatePatternCharacterPair): This is the 7082 optmization. It's basically like generatePatternCharacter, but it runs two 7083 characters at a time. 7084 7085 (JSC::WREC::Generator::generatePatternCharacter): Changed to use isASCII, 7086 since it's clearer than comparing to a magic hex value. 7087 7088 * wrec/WRECGenerator.h: 7089 70902008-12-03 Gavin Barraclough <barraclough@apple.com> 7091 7092 Reviewed by Cameron Zwarich. 7093 7094 Allow JIT to operate without the call-repatching optimization. 7095 Controlled by ENABLE(JIT_OPTIMIZE_CALL), defaults on, disabling 7096 this leads to significant performance regression. 7097 7098 https://bugs.webkit.org/show_bug.cgi?id=22639 7099 7100 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 7101 * JavaScriptCore.xcodeproj/project.pbxproj: 7102 * jit/JIT.cpp: 7103 (JSC::JIT::privateCompileSlowCases): 7104 * jit/JIT.h: 7105 * jit/JITCall.cpp: Copied from jit/JIT.cpp. 7106 (JSC::JIT::compileOpCallInitializeCallFrame): 7107 (JSC::JIT::compileOpCallSetupArgs): 7108 (JSC::JIT::compileOpCallEvalSetupArgs): 7109 (JSC::JIT::compileOpConstructSetupArgs): 7110 (JSC::JIT::compileOpCall): 7111 (JSC::JIT::compileOpCallSlowCase): 7112 (JSC::unreachable): 7113 * jit/JITInlineMethods.h: Copied from jit/JIT.cpp. 7114 (JSC::JIT::checkStructure): 7115 (JSC::JIT::emitFastArithPotentiallyReTagImmediate): 7116 (JSC::JIT::emitTagAsBoolImmediate): 7117 * wtf/Platform.h: 7118 71192008-12-03 Eric Seidel <eric@webkit.org> 7120 7121 Rubber-stamped by David Hyatt. 7122 7123 Make HAVE_ACCESSIBILITY only define if !defined 7124 7125 * wtf/Platform.h: 7126 71272008-12-03 Sam Weinig <sam@webkit.org> 7128 7129 Fix build. 7130 7131 * assembler/X86Assembler.h: 7132 (JSC::X86Assembler::orl_i32r): 7133 71342008-12-03 Sam Weinig <sam@webkit.org> 7135 7136 Reviewed by Geoffrey Garen. 7137 7138 Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer 7139 an 256 byte inline capacity. 7140 7141 1% progression on Sunspider. 7142 7143 * assembler/AssemblerBuffer.h: 7144 (JSC::AssemblerBuffer::AssemblerBuffer): 7145 (JSC::AssemblerBuffer::~AssemblerBuffer): 7146 (JSC::AssemblerBuffer::grow): 7147 * assembler/MacroAssembler.h: 7148 (JSC::MacroAssembler::MacroAssembler): 7149 * assembler/X86Assembler.h: 7150 (JSC::X86Assembler::X86Assembler): 7151 * interpreter/Interpreter.cpp: 7152 (JSC::Interpreter::Interpreter): 7153 * interpreter/Interpreter.h: 7154 * jit/JIT.cpp: 7155 (JSC::JIT::JIT): 7156 * parser/Nodes.cpp: 7157 (JSC::RegExpNode::emitBytecode): 7158 * runtime/RegExp.cpp: 7159 (JSC::RegExp::RegExp): 7160 (JSC::RegExp::create): 7161 * runtime/RegExp.h: 7162 * runtime/RegExpConstructor.cpp: 7163 (JSC::constructRegExp): 7164 * runtime/RegExpPrototype.cpp: 7165 (JSC::regExpProtoFuncCompile): 7166 * runtime/StringPrototype.cpp: 7167 (JSC::stringProtoFuncMatch): 7168 (JSC::stringProtoFuncSearch): 7169 * wrec/WREC.cpp: 7170 (JSC::WREC::Generator::compileRegExp): 7171 * wrec/WRECGenerator.h: 7172 (JSC::WREC::Generator::Generator): 7173 * wrec/WRECParser.h: 7174 (JSC::WREC::Parser::Parser): 7175 71762008-12-03 Geoffrey Garen <ggaren@apple.com> 7177 7178 Reviewed by Oliver Hunt, with help from Gavin Barraclough. 7179 7180 orl_i32r was actually coded as an 8bit OR. So, I renamed orl_i32r to 7181 orl_i8r, changed all orl_i32r clients to use orl_i8r, and then added 7182 a new orl_i32r that actually does a 32bit OR. 7183 7184 (32bit OR is currently unused, but a patch I'm working on uses it.) 7185 7186 * assembler/MacroAssembler.h: 7187 (JSC::MacroAssembler::or32): Updated to choose between 8bit and 32bit OR. 7188 7189 * assembler/X86Assembler.h: 7190 (JSC::X86Assembler::orl_i8r): The old orl_i32r. 7191 (JSC::X86Assembler::orl_i32r): The new orl_i32r. 7192 7193 * jit/JIT.cpp: 7194 (JSC::JIT::emitFastArithPotentiallyReTagImmediate): 7195 (JSC::JIT::emitTagAsBoolImmediate): Use orl_i8r, since we're ORing 8bit 7196 values. 7197 71982008-12-03 Dean Jackson <dino@apple.com> 7199 7200 Reviewed by Dan Bernstein. 7201 7202 Helper functions for turn -> degrees. 7203 https://bugs.webkit.org/show_bug.cgi?id=22497 7204 7205 * wtf/MathExtras.h: 7206 (turn2deg): 7207 (deg2turn): 7208 72092008-12-02 Cameron Zwarich <zwarich@apple.com> 7210 7211 Reviewed by Geoff Garen. 7212 7213 Bug 22504: Crashes during code generation occur due to refing of ignoredResult() 7214 <https://bugs.webkit.org/show_bug.cgi?id=22504> 7215 7216 Since ignoredResult() was implemented by casting 1 to a RegisterID*, any 7217 attempt to ref ignoredResult() results in a crash. This will occur in 7218 code generation of a function body where a node emits another node with 7219 the dst that was passed to it, and then refs the returned RegisterID*. 7220 7221 To fix this problem, make ignoredResult() a member function of 7222 BytecodeGenerator that simply returns a pointe to a fixed RegisterID 7223 member of BytecodeGenerator. 7224 7225 * bytecompiler/BytecodeGenerator.h: 7226 (JSC::BytecodeGenerator::ignoredResult): 7227 * bytecompiler/RegisterID.h: 7228 * parser/Nodes.cpp: 7229 (JSC::NullNode::emitBytecode): 7230 (JSC::BooleanNode::emitBytecode): 7231 (JSC::NumberNode::emitBytecode): 7232 (JSC::StringNode::emitBytecode): 7233 (JSC::RegExpNode::emitBytecode): 7234 (JSC::ThisNode::emitBytecode): 7235 (JSC::ResolveNode::emitBytecode): 7236 (JSC::ObjectLiteralNode::emitBytecode): 7237 (JSC::PostfixResolveNode::emitBytecode): 7238 (JSC::PostfixBracketNode::emitBytecode): 7239 (JSC::PostfixDotNode::emitBytecode): 7240 (JSC::DeleteValueNode::emitBytecode): 7241 (JSC::VoidNode::emitBytecode): 7242 (JSC::TypeOfResolveNode::emitBytecode): 7243 (JSC::TypeOfValueNode::emitBytecode): 7244 (JSC::PrefixResolveNode::emitBytecode): 7245 (JSC::AssignResolveNode::emitBytecode): 7246 (JSC::CommaNode::emitBytecode): 7247 (JSC::ForNode::emitBytecode): 7248 (JSC::ForInNode::emitBytecode): 7249 (JSC::ReturnNode::emitBytecode): 7250 (JSC::ThrowNode::emitBytecode): 7251 (JSC::FunctionBodyNode::emitBytecode): 7252 (JSC::FuncDeclNode::emitBytecode): 7253 72542008-12-02 Geoffrey Garen <ggaren@apple.com> 7255 7256 Reviewed by Cameron Zwarich. 7257 7258 Fixed https://bugs.webkit.org/show_bug.cgi?id=22537 7259 REGRESSION (r38745): Assertion failure in jsSubstring() at ge.com 7260 7261 The bug was that index would become greater than length, so our 7262 "end of input" checks, which all check "index == length", would fail. 7263 7264 The solution is to check for end of input before incrementing index, 7265 to ensure that index is always <= length. 7266 7267 As a side benefit, generateJumpIfEndOfInput can now use je instead of 7268 jg, which should be slightly faster. 7269 7270 * wrec/WREC.cpp: 7271 (JSC::WREC::Generator::compileRegExp): 7272 * wrec/WRECGenerator.cpp: 7273 (JSC::WREC::Generator::generateJumpIfEndOfInput): 7274 72752008-12-02 Gavin Barraclough <barraclough@apple.com> 7276 7277 Reviewed by Geoffrey Garen. 7278 7279 Plant shift right immediate instructions, which are awesome. 7280 https://bugs.webkit.org/show_bug.cgi?id=22610 7281 ~5% on the v8-crypto test. 7282 7283 * jit/JIT.cpp: 7284 (JSC::JIT::privateCompileMainPass): 7285 (JSC::JIT::privateCompileSlowCases): 7286 72872008-12-02 Geoffrey Garen <ggaren@apple.com> 7288 7289 Reviewed by Sam Weinig. 7290 7291 Cleaned up SegmentedVector by abstracting segment access into helper 7292 functions. 7293 7294 SunSpider reports no change. 7295 7296 * bytecompiler/SegmentedVector.h: 7297 (JSC::SegmentedVector::SegmentedVector): 7298 (JSC::SegmentedVector::~SegmentedVector): 7299 (JSC::SegmentedVector::size): 7300 (JSC::SegmentedVector::at): 7301 (JSC::SegmentedVector::operator[]): 7302 (JSC::SegmentedVector::last): 7303 (JSC::SegmentedVector::append): 7304 (JSC::SegmentedVector::removeLast): 7305 (JSC::SegmentedVector::grow): 7306 (JSC::SegmentedVector::clear): 7307 (JSC::SegmentedVector::deleteAllSegments): 7308 (JSC::SegmentedVector::segmentFor): 7309 (JSC::SegmentedVector::subscriptFor): 7310 (JSC::SegmentedVector::ensureSegmentsFor): 7311 (JSC::SegmentedVector::ensureSegment): 7312 73132008-12-02 Geoffrey Garen <ggaren@apple.com> 7314 7315 Reviewed by Geoffrey Garen. (Patch by Cameron Zwarich <zwarich@apple.com>.) 7316 7317 Fixed https://bugs.webkit.org/show_bug.cgi?id=22482 7318 REGRESSION (r37991): Occasionally see "Scene rendered incorrectly" 7319 message when running the V8 Raytrace benchmark 7320 7321 Rolled out r37991. It didn't properly save xmm0, which is caller-save, 7322 before calling helper functions. 7323 7324 SunSpider and v8 benchmarks show little change -- possibly a .2% 7325 SunSpider regression, possibly a .2% v8 benchmark speedup. 7326 7327 * assembler/X86Assembler.h: 7328 (JSC::X86Assembler::): 7329 * bytecode/CodeBlock.cpp: 7330 (JSC::CodeBlock::dump): 7331 * bytecode/Instruction.h: 7332 (JSC::Instruction::): 7333 * bytecompiler/BytecodeGenerator.cpp: 7334 (JSC::BytecodeGenerator::emitUnaryOp): 7335 * bytecompiler/BytecodeGenerator.h: 7336 (JSC::BytecodeGenerator::emitToJSNumber): 7337 (JSC::BytecodeGenerator::emitTypeOf): 7338 (JSC::BytecodeGenerator::emitGetPropertyNames): 7339 * interpreter/Interpreter.cpp: 7340 (JSC::Interpreter::privateExecute): 7341 * interpreter/Interpreter.h: 7342 * jit/JIT.cpp: 7343 (JSC::JIT::privateCompileMainPass): 7344 (JSC::JIT::privateCompileSlowCases): 7345 * jit/JIT.h: 7346 * parser/Nodes.cpp: 7347 (JSC::UnaryOpNode::emitBytecode): 7348 (JSC::BinaryOpNode::emitBytecode): 7349 (JSC::EqualNode::emitBytecode): 7350 * parser/ResultType.h: 7351 (JSC::ResultType::isReusable): 7352 (JSC::ResultType::mightBeNumber): 7353 * runtime/JSNumberCell.h: 7354 73552008-12-01 Gavin Barraclough <barraclough@apple.com> 7356 7357 Reviewed by Geoffrey Garen. 7358 7359 Remove unused (sampling only, and derivable) argument to JIT::emitCTICall. 7360 https://bugs.webkit.org/show_bug.cgi?id=22587 7361 7362 * jit/JIT.cpp: 7363 (JSC::JIT::emitCTICall): 7364 (JSC::JIT::compileOpCall): 7365 (JSC::JIT::emitSlowScriptCheck): 7366 (JSC::JIT::compileBinaryArithOpSlowCase): 7367 (JSC::JIT::privateCompileMainPass): 7368 (JSC::JIT::privateCompileSlowCases): 7369 (JSC::JIT::privateCompile): 7370 * jit/JIT.h: 7371 73722008-12-02 Dimitri Glazkov <dglazkov@chromium.org> 7373 7374 Reviewed by Eric Seidel. 7375 7376 Fix the inheritance chain for JSFunction. 7377 7378 * runtime/JSFunction.cpp: 7379 (JSC::JSFunction::info): Add InternalFunction::info as parent class 7380 73812008-12-02 Simon Hausmann <hausmann@webkit.org> 7382 7383 Reviewed by Tor Arne Vestbø. 7384 7385 Fix ability to include JavaScriptCore.pri from other .pro files. 7386 7387 * JavaScriptCore.pri: Moved -O3 setting into the .pro files. 7388 * JavaScriptCore.pro: 7389 * jsc.pro: 7390 73912008-12-01 Geoffrey Garen <ggaren@apple.com> 7392 7393 Reviewed by Cameron Zwarich, with help from Gavin Barraclough. 7394 7395 Fixed https://bugs.webkit.org/show_bug.cgi?id=22583. 7396 7397 Refactored regular expression parsing to parse sequences of characters 7398 as a single unit, in preparation for optimizing sequences of characters. 7399 7400 SunSpider reports no change. 7401 7402 * JavaScriptCore.xcodeproj/project.pbxproj: 7403 * wrec/Escapes.h: Added. Set of classes for representing an escaped 7404 token in a pattern. 7405 7406 * wrec/Quantifier.h: 7407 (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly, 7408 to match the new Escape constructor. 7409 7410 * wrec/WRECGenerator.cpp: 7411 (JSC::WREC::Generator::generatePatternCharacterSequence): 7412 * wrec/WRECGenerator.h: Added an interface for generating a sequence 7413 of pattern characters at a time. It doesn't do anything special yet. 7414 7415 * wrec/WRECParser.cpp: 7416 (JSC::WREC::Parser::consumeGreedyQuantifier): 7417 (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in 7418 these functions, to match "consumeEscape." 7419 7420 (JSC::WREC::Parser::parsePatternCharacterSequence): New function for 7421 iteratively aggregating a sequence of characters in a pattern. 7422 7423 (JSC::WREC::Parser::parseCharacterClassQuantifier): 7424 (JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to 7425 "consume" in these functions, to match "consumeEscape." 7426 7427 (JSC::WREC::Parser::parseCharacterClass): Refactored to use the common 7428 escape processing code in consumeEscape. 7429 7430 (JSC::WREC::Parser::parseEscape): Refactored to use the common 7431 escape processing code in consumeEscape. 7432 7433 (JSC::WREC::Parser::consumeEscape): Factored escaped token processing 7434 into a common function, since we were doing this in a few places. 7435 7436 (JSC::WREC::Parser::parseTerm): Refactored to use the common 7437 escape processing code in consumeEscape. 7438 7439 * wrec/WRECParser.h: 7440 (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function 7441 for reading a digit. 7442 74432008-12-01 Cameron Zwarich <zwarich@apple.com> 7444 7445 Reviewed by Oliver Hunt. 7446 7447 Bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers 7448 <https://bugs.webkit.org/show_bug.cgi?id=20340> 7449 7450 SegmentedVector currently frees segments and reallocates them when used 7451 as a stack. This can lead to unsafe use of pointers into freed segments. 7452 7453 In order to fix this problem, SegmentedVector will be changed to only 7454 grow and never shrink. Also, rename the reserveCapacity() member 7455 function to grow() to match the actual usage in BytecodeGenerator, where 7456 this function is used to allocate a group of registers at once, rather 7457 than merely saving space for them. 7458 7459 * bytecompiler/BytecodeGenerator.cpp: 7460 (JSC::BytecodeGenerator::BytecodeGenerator): Use grow() instead of 7461 reserveCapacity(). 7462 * bytecompiler/SegmentedVector.h: 7463 (JSC::SegmentedVector::SegmentedVector): 7464 (JSC::SegmentedVector::last): 7465 (JSC::SegmentedVector::append): 7466 (JSC::SegmentedVector::removeLast): 7467 (JSC::SegmentedVector::grow): Renamed from reserveCapacity(). 7468 (JSC::SegmentedVector::clear): 7469 74702008-12-01 Mark Rowe <mrowe@apple.com> 7471 7472 Rubber-stamped by Anders Carlsson. 7473 7474 Disable WREC for x86_64 since memory allocated by the system allocator is not marked executable, 7475 which causes 64-bit debug builds to crash. Once we have a dedicated allocator for executable 7476 memory we can turn this back on. 7477 7478 * wtf/Platform.h: 7479 74802008-12-01 Antti Koivisto <antti@apple.com> 7481 7482 Reviewed by Maciej Stachowiak. 7483 7484 Restore inline buffer after vector is shrunk back below its inline capacity. 7485 7486 * wtf/Vector.h: 7487 (WTF::): 7488 (WTF::VectorBuffer::restoreInlineBufferIfNeeded): 7489 (WTF::::shrinkCapacity): 7490 74912008-11-30 Antti Koivisto <antti@apple.com> 7492 7493 Reviewed by Mark Rowe. 7494 7495 Try to return free pages in the current thread cache too. 7496 7497 * wtf/FastMalloc.cpp: 7498 (WTF::TCMallocStats::releaseFastMallocFreeMemory): 7499 75002008-12-01 David Levin <levin@chromium.org> 7501 7502 Reviewed by Alexey Proskuryakov. 7503 7504 https://bugs.webkit.org/show_bug.cgi?id=22567 7505 Make HashTable work as expected with respect to threads. Specifically, it has class-level 7506 thread safety and constant methods work on constant objects without synchronization. 7507 7508 No observable change in behavior, so no test. This only affects debug builds. 7509 7510 * wtf/HashTable.cpp: 7511 (WTF::hashTableStatsMutex): 7512 (WTF::HashTableStats::~HashTableStats): 7513 (WTF::HashTableStats::recordCollisionAtCount): 7514 Guarded variable access with a mutex. 7515 7516 * wtf/HashTable.h: 7517 (WTF::::lookup): 7518 (WTF::::lookupForWriting): 7519 (WTF::::fullLookupForWriting): 7520 (WTF::::add): 7521 (WTF::::reinsert): 7522 (WTF::::remove): 7523 (WTF::::rehash): 7524 Changed increments of static variables to use atomicIncrement. 7525 7526 (WTF::::invalidateIterators): 7527 (WTF::addIterator): 7528 (WTF::removeIterator): 7529 Guarded mutable access with a mutex. 7530 75312008-11-29 Gavin Barraclough <barraclough@apple.com> 7532 7533 Reviewed by Cameron Zwarich. 7534 7535 Enable WREC on PLATFORM(X86_64). This change predominantly requires changes to the 7536 WREC::Generator::generateEnter method to support the x86-64 ABI, and addition of 7537 support for a limited number of quadword operations in the X86Assembler. 7538 7539 This patch will cause the JS heap to be allocated with RWX permissions on 64-bit Mac 7540 platforms. This is a regression with respect to previous 64-bit behaviour, but is no 7541 more permissive than on 32-bit builds. This issue should be addressed at some point. 7542 (This is tracked by bug #21783.) 7543 7544 https://bugs.webkit.org/show_bug.cgi?id=22554 7545 Greater than 4x speedup on regexp-dna, on x86-64. 7546 7547 * assembler/MacroAssembler.h: 7548 (JSC::MacroAssembler::addPtr): 7549 (JSC::MacroAssembler::loadPtr): 7550 (JSC::MacroAssembler::storePtr): 7551 (JSC::MacroAssembler::pop): 7552 (JSC::MacroAssembler::push): 7553 (JSC::MacroAssembler::move): 7554 * assembler/X86Assembler.h: 7555 (JSC::X86Assembler::): 7556 (JSC::X86Assembler::movq_rr): 7557 (JSC::X86Assembler::addl_i8m): 7558 (JSC::X86Assembler::addl_i32r): 7559 (JSC::X86Assembler::addq_i8r): 7560 (JSC::X86Assembler::addq_i32r): 7561 (JSC::X86Assembler::movq_mr): 7562 (JSC::X86Assembler::movq_rm): 7563 * wrec/WREC.h: 7564 * wrec/WRECGenerator.cpp: 7565 (JSC::WREC::Generator::generateEnter): 7566 (JSC::WREC::Generator::generateReturnSuccess): 7567 (JSC::WREC::Generator::generateReturnFailure): 7568 * wtf/Platform.h: 7569 * wtf/TCSystemAlloc.cpp: 7570 75712008-12-01 Cameron Zwarich <zwarich@apple.com> 7572 7573 Reviewed by Sam Weinig. 7574 7575 Preliminary work for bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers 7576 <https://bugs.webkit.org/show_bug.cgi?id=20340> 7577 7578 SegmentedVector currently frees segments and reallocates them when used 7579 as a stack. This can lead to unsafe use of pointers into freed segments. 7580 7581 In order to fix this problem, SegmentedVector will be changed to only 7582 grow and never shrink, with the sole exception of clearing all of its 7583 data, a capability that is required by Lexer. This patch changes the 7584 public interface to only allow for these capabilities. 7585 7586 * bytecompiler/BytecodeGenerator.cpp: 7587 (JSC::BytecodeGenerator::BytecodeGenerator): Use reserveCapacity() 7588 instead of resize() for m_globals and m_parameters. 7589 * bytecompiler/SegmentedVector.h: 7590 (JSC::SegmentedVector::resize): Removed. 7591 (JSC::SegmentedVector::reserveCapacity): Added. 7592 (JSC::SegmentedVector::clear): Added. 7593 (JSC::SegmentedVector::shrink): Removed. 7594 (JSC::SegmentedVector::grow): Removed. 7595 * parser/Lexer.cpp: 7596 (JSC::Lexer::clear): Use clear() instead of resize(0). 7597 75982008-11-30 Sam Weinig <sam@webkit.org> 7599 7600 Reviewed by Mark Rowe. 7601 7602 Renames jumps to m_jumps in JumpList. 7603 7604 * assembler/MacroAssembler.h: 7605 (JSC::MacroAssembler::JumpList::link): 7606 (JSC::MacroAssembler::JumpList::linkTo): 7607 (JSC::MacroAssembler::JumpList::append): 7608 76092008-11-30 Antti Koivisto <antti@apple.com> 7610 7611 Reviewed by Mark Rowe. 7612 7613 https://bugs.webkit.org/show_bug.cgi?id=22557 7614 7615 Report free size in central and thread caches too. 7616 7617 * wtf/FastMalloc.cpp: 7618 (WTF::TCMallocStats::fastMallocStatistics): 7619 * wtf/FastMalloc.h: 7620 76212008-11-29 Antti Koivisto <antti@apple.com> 7622 7623 Reviewed by Dan Bernstein. 7624 7625 https://bugs.webkit.org/show_bug.cgi?id=22557 7626 Add statistics for JavaScript GC heap. 7627 7628 * JavaScriptCore.exp: 7629 * runtime/Collector.cpp: 7630 (JSC::Heap::objectCount): 7631 (JSC::addToStatistics): 7632 (JSC::Heap::statistics): 7633 * runtime/Collector.h: 7634 76352008-11-29 Antti Koivisto <antti@apple.com> 7636 7637 Fix debug build by adding a stub method. 7638 7639 * wtf/FastMalloc.cpp: 7640 (WTF::fastMallocStatistics): 7641 76422008-11-29 Antti Koivisto <antti@apple.com> 7643 7644 Reviewed by Alexey Proskuryakov. 7645 7646 https://bugs.webkit.org/show_bug.cgi?id=22557 7647 7648 Add function for getting basic statistics from FastMalloc. 7649 7650 * JavaScriptCore.exp: 7651 * wtf/FastMalloc.cpp: 7652 (WTF::DLL_Length): 7653 (WTF::TCMalloc_PageHeap::ReturnedBytes): 7654 (WTF::TCMallocStats::fastMallocStatistics): 7655 * wtf/FastMalloc.h: 7656 76572008-11-29 Cameron Zwarich <zwarich@apple.com> 7658 7659 Not reviewed. 7660 7661 The C++ standard does not automatically grant the friendships of an 7662 enclosing class to its nested subclasses, so we should do so explicitly. 7663 This fixes the GCC 4.0 build, although both GCC 4.2 and Visual C++ 2005 7664 accept the incorrect code as it is. 7665 7666 * assembler/MacroAssembler.h: 7667 76682008-11-29 Gavin Barraclough <barraclough@apple.com> 7669 7670 Reviewed by Cameron Zwarich. 7671 7672 Add the class MacroAssembler to provide some abstraction of code generation, 7673 and change WREC to make use of this class, rather than directly accessing 7674 the X86Assembler. 7675 7676 This patch also allows WREC to be compiled without the rest of the JIT enabled. 7677 7678 * JavaScriptCore.xcodeproj/project.pbxproj: 7679 * assembler/MacroAssembler.h: Added. 7680 (JSC::MacroAssembler::): 7681 (JSC::MacroAssembler::MacroAssembler): 7682 (JSC::MacroAssembler::copyCode): 7683 (JSC::MacroAssembler::Address::Address): 7684 (JSC::MacroAssembler::ImplicitAddress::ImplicitAddress): 7685 (JSC::MacroAssembler::BaseIndex::BaseIndex): 7686 (JSC::MacroAssembler::Label::Label): 7687 (JSC::MacroAssembler::Jump::Jump): 7688 (JSC::MacroAssembler::Jump::link): 7689 (JSC::MacroAssembler::Jump::linkTo): 7690 (JSC::MacroAssembler::JumpList::link): 7691 (JSC::MacroAssembler::JumpList::linkTo): 7692 (JSC::MacroAssembler::JumpList::append): 7693 (JSC::MacroAssembler::Imm32::Imm32): 7694 (JSC::MacroAssembler::add32): 7695 (JSC::MacroAssembler::or32): 7696 (JSC::MacroAssembler::sub32): 7697 (JSC::MacroAssembler::loadPtr): 7698 (JSC::MacroAssembler::load32): 7699 (JSC::MacroAssembler::load16): 7700 (JSC::MacroAssembler::storePtr): 7701 (JSC::MacroAssembler::store32): 7702 (JSC::MacroAssembler::pop): 7703 (JSC::MacroAssembler::push): 7704 (JSC::MacroAssembler::peek): 7705 (JSC::MacroAssembler::poke): 7706 (JSC::MacroAssembler::move): 7707 (JSC::MacroAssembler::compareImm32ForBranch): 7708 (JSC::MacroAssembler::compareImm32ForBranchEquality): 7709 (JSC::MacroAssembler::jae32): 7710 (JSC::MacroAssembler::je32): 7711 (JSC::MacroAssembler::je16): 7712 (JSC::MacroAssembler::jg32): 7713 (JSC::MacroAssembler::jge32): 7714 (JSC::MacroAssembler::jl32): 7715 (JSC::MacroAssembler::jle32): 7716 (JSC::MacroAssembler::jne32): 7717 (JSC::MacroAssembler::jump): 7718 (JSC::MacroAssembler::breakpoint): 7719 (JSC::MacroAssembler::ret): 7720 * assembler/X86Assembler.h: 7721 (JSC::X86Assembler::cmpw_rm): 7722 * interpreter/Interpreter.cpp: 7723 (JSC::Interpreter::Interpreter): 7724 * interpreter/Interpreter.h: 7725 (JSC::Interpreter::assemblerBuffer): 7726 * runtime/RegExp.cpp: 7727 (JSC::RegExp::RegExp): 7728 * wrec/WREC.cpp: 7729 (JSC::WREC::Generator::compileRegExp): 7730 * wrec/WREC.h: 7731 * wrec/WRECFunctors.cpp: 7732 (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom): 7733 (JSC::WREC::GenerateCharacterClassFunctor::generateAtom): 7734 (JSC::WREC::GenerateBackreferenceFunctor::generateAtom): 7735 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom): 7736 * wrec/WRECFunctors.h: 7737 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor): 7738 * wrec/WRECGenerator.cpp: 7739 (JSC::WREC::Generator::generateEnter): 7740 (JSC::WREC::Generator::generateReturnSuccess): 7741 (JSC::WREC::Generator::generateSaveIndex): 7742 (JSC::WREC::Generator::generateIncrementIndex): 7743 (JSC::WREC::Generator::generateLoadCharacter): 7744 (JSC::WREC::Generator::generateJumpIfEndOfInput): 7745 (JSC::WREC::Generator::generateJumpIfNotEndOfInput): 7746 (JSC::WREC::Generator::generateReturnFailure): 7747 (JSC::WREC::Generator::generateBacktrack1): 7748 (JSC::WREC::Generator::generateBacktrackBackreference): 7749 (JSC::WREC::Generator::generateBackreferenceQuantifier): 7750 (JSC::WREC::Generator::generateNonGreedyQuantifier): 7751 (JSC::WREC::Generator::generateGreedyQuantifier): 7752 (JSC::WREC::Generator::generatePatternCharacter): 7753 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 7754 (JSC::WREC::Generator::generateCharacterClassInverted): 7755 (JSC::WREC::Generator::generateCharacterClass): 7756 (JSC::WREC::Generator::generateParentheses): 7757 (JSC::WREC::Generator::generateParenthesesNonGreedy): 7758 (JSC::WREC::Generator::generateParenthesesResetTrampoline): 7759 (JSC::WREC::Generator::generateAssertionBOL): 7760 (JSC::WREC::Generator::generateAssertionEOL): 7761 (JSC::WREC::Generator::generateAssertionWordBoundary): 7762 (JSC::WREC::Generator::generateBackreference): 7763 (JSC::WREC::Generator::terminateAlternative): 7764 (JSC::WREC::Generator::terminateDisjunction): 7765 * wrec/WRECGenerator.h: 7766 (JSC::WREC::Generator::Generator): 7767 * wrec/WRECParser.cpp: 7768 (JSC::WREC::Parser::parsePatternCharacterQualifier): 7769 (JSC::WREC::Parser::parseCharacterClassQuantifier): 7770 (JSC::WREC::Parser::parseBackreferenceQuantifier): 7771 (JSC::WREC::Parser::parseParentheses): 7772 (JSC::WREC::Parser::parseCharacterClass): 7773 (JSC::WREC::Parser::parseOctalEscape): 7774 (JSC::WREC::Parser::parseEscape): 7775 (JSC::WREC::Parser::parseTerm): 7776 (JSC::WREC::Parser::parseDisjunction): 7777 * wrec/WRECParser.h: 7778 (JSC::WREC::Parser::Parser): 7779 (JSC::WREC::Parser::parsePattern): 7780 (JSC::WREC::Parser::parseAlternative): 7781 * wtf/Platform.h: 7782 77832008-11-28 Simon Hausmann <hausmann@webkit.org> 7784 7785 Reviewed by Tor Arne Vestbø. 7786 7787 Fix compilation on Windows CE 7788 7789 Port away from the use of errno after calling strtol(), instead 7790 detect conversion errors by checking the result and the stop 7791 position. 7792 7793 * runtime/DateMath.cpp: 7794 (JSC::parseLong): 7795 (JSC::parseDate): 7796 77972008-11-28 Joerg Bornemann <joerg.bornemann@trolltech.com> 7798 7799 Reviewed by Simon Hausmann. 7800 7801 Implement lowResUTCTime() on Windows CE using GetSystemTime as _ftime() is not available. 7802 7803 * runtime/DateMath.cpp: 7804 (JSC::lowResUTCTime): 7805 78062008-11-28 Simon Hausmann <hausmann@webkit.org> 7807 7808 Rubber-stamped by Tor Arne Vestbø. 7809 7810 Removed unnecessary inclusion of errno.h, which also fixes compilation on Windows CE. 7811 7812 * runtime/JSGlobalObjectFunctions.cpp: 7813 78142008-11-27 Cameron Zwarich <zwarich@apple.com> 7815 7816 Not reviewed. 7817 7818 r38825 made JSFunction::m_body private, but some inspector code in 7819 WebCore sets the field. Add setters for it. 7820 7821 * runtime/JSFunction.h: 7822 (JSC::JSFunction::setBody): 7823 78242008-11-27 Sam Weinig <sam@webkit.org> 7825 7826 Reviewed by Cameron Zwarich. 7827 7828 Fix FIXME by adding accessor for JSFunction's m_body property. 7829 7830 * interpreter/Interpreter.cpp: 7831 (JSC::Interpreter::cti_op_call_JSFunction): 7832 (JSC::Interpreter::cti_vm_dontLazyLinkCall): 7833 (JSC::Interpreter::cti_vm_lazyLinkCall): 7834 * profiler/Profiler.cpp: 7835 (JSC::createCallIdentifierFromFunctionImp): 7836 * runtime/Arguments.h: 7837 (JSC::Arguments::getArgumentsData): 7838 (JSC::Arguments::Arguments): 7839 * runtime/FunctionPrototype.cpp: 7840 (JSC::functionProtoFuncToString): 7841 * runtime/JSFunction.h: 7842 (JSC::JSFunction::JSFunction): 7843 (JSC::JSFunction::body): 7844 78452008-11-27 Sam Weinig <sam@webkit.org> 7846 7847 Reviewed by Oliver Hunt. 7848 7849 Remove unused member variables from ProgramNode. 7850 7851 * parser/Nodes.h: 7852 78532008-11-27 Brent Fulgham <bfulgham@gmail.com> 7854 7855 Reviewed by Alexey Proskuryakov. 7856 7857 Enable mouse panning feaure on Windows Cairo build. 7858 See http://bugs.webkit.org/show_bug.cgi?id=22525 7859 7860 * wtf/Platform.h: Enable mouse panning feaure on Windows Cairo build. 7861 78622008-11-27 Alp Toker <alp@nuanti.com> 7863 7864 Change recently introduced C++ comments in Platform.h to C comments to 7865 fix the minidom build with traditional C. 7866 7867 Build GtkLauncher and minidom with the '-ansi' compiler flag to detect 7868 API header breakage at build time. 7869 7870 * GNUmakefile.am: 7871 * wtf/Platform.h: 7872 78732008-11-27 Alp Toker <alp@nuanti.com> 7874 7875 Remove C++ comment from JavaScriptCore API headers (introduced r35449). 7876 Fixes build for ANSI C applications using the public API. 7877 7878 * API/WebKitAvailability.h: 7879 78802008-11-26 Eric Seidel <eric@webkit.org> 7881 7882 No review, build fix only. 7883 7884 Fix the JSC Chromium Mac build by adding JavaScriptCore/icu into the include path 7885 7886 * JavaScriptCore.scons: 7887 78882008-11-25 Cameron Zwarich <zwarich@apple.com> 7889 7890 Reviewed by Maciej Stachowiak. 7891 7892 Remove the unused member function JSFunction::getParameterName(). 7893 7894 * runtime/JSFunction.cpp: 7895 * runtime/JSFunction.h: 7896 78972008-11-24 Gavin Barraclough <barraclough@apple.com> 7898 7899 Reviewed by Geoff Garen. 7900 7901 Polymorpic caching for get by id chain. Similar to the polymorphic caching already implemented 7902 for self and proto accesses (implemented by allowing multiple trampolines to be JIT genertaed, 7903 and linked together) - the get by id chain caching is implemented as a genericization of the 7904 proto list caching, allowing cached access lists to contain a mix of proto and proto chain 7905 accesses (since in JS style inheritance hierarchies you may commonly see a mix of properties 7906 being overridden on the direct prototype, or higher up its prototype chain). 7907 7908 In order to allow this patch to compile there is a fix to appease gcc 4.2 compiler issues 7909 (removing the jumps between fall-through cases in privateExecute). 7910 7911 This patch also removes redundant immediate checking from the reptach code, and fixes a related 7912 memory leak (failure to deallocate trampolines). 7913 7914 ~2% progression on v8 tests (bulk on the win on deltablue) 7915 7916 * bytecode/Instruction.h: 7917 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::): 7918 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set): 7919 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList): 7920 (JSC::PolymorphicAccessStructureList::derefStructures): 7921 * interpreter/Interpreter.cpp: 7922 (JSC::countPrototypeChainEntriesAndCheckForProxies): 7923 (JSC::Interpreter::tryCacheGetByID): 7924 (JSC::Interpreter::privateExecute): 7925 (JSC::Interpreter::tryCTICacheGetByID): 7926 (JSC::Interpreter::cti_op_get_by_id_self_fail): 7927 (JSC::getPolymorphicAccessStructureListSlot): 7928 (JSC::Interpreter::cti_op_get_by_id_proto_list): 7929 * interpreter/Interpreter.h: 7930 * jit/JIT.cpp: 7931 (JSC::JIT::privateCompileGetByIdProto): 7932 (JSC::JIT::privateCompileGetByIdSelfList): 7933 (JSC::JIT::privateCompileGetByIdProtoList): 7934 (JSC::JIT::privateCompileGetByIdChainList): 7935 (JSC::JIT::privateCompileGetByIdChain): 7936 (JSC::JIT::privateCompilePatchGetArrayLength): 7937 * jit/JIT.h: 7938 (JSC::JIT::compileGetByIdChainList): 7939 79402008-11-25 Cameron Zwarich <zwarich@apple.com> 7941 7942 Reviewed by Alexey Proskuryakov. 7943 7944 Move the collect() call in Heap::heapAllocate() that is conditionally 7945 compiled under COLLECT_ON_EVERY_ALLOCATION so that it is before we get 7946 information about the heap. This was causing assertion failures for me 7947 while I was reducing a bug. 7948 7949 * runtime/Collector.cpp: 7950 (JSC::Heap::heapAllocate): 7951 79522008-11-24 Cameron Zwarich <zwarich@apple.com> 7953 7954 Reviewed by Geoff Garen. 7955 7956 Bug 13790: Function declarations are not treated as statements (used to affect starcraft2.com) 7957 <https://bugs.webkit.org/show_bug.cgi?id=13790> 7958 7959 Modify the parser to treat function declarations as statements, 7960 simplifying the grammar in the process. Technically, according to the 7961 grammar in the ECMA spec, function declarations are not statements and 7962 can not be used everywhere that statements can, but it is not worth the 7963 possibility compatibility issues just to stick to the spec in this case. 7964 7965 * parser/Grammar.y: 7966 * parser/Nodes.cpp: 7967 (JSC::FuncDeclNode::emitBytecode): Avoid returning ignoredResult() 7968 as a result, because it causes a crash in DoWhileNode::emitBytecode(). 7969 79702008-11-24 Geoffrey Garen <ggaren@apple.com> 7971 7972 Reviewed by Sam Weinig. 7973 7974 Unroll the regexp matching loop by 1. 10% speedup on simple matching 7975 stress test. No change on SunSpider. 7976 7977 (I decided not to unroll to arbitrary levels because the returns diminsh 7978 quickly.) 7979 7980 * wrec/WREC.cpp: 7981 (JSC::WREC::compileRegExp): 7982 * wrec/WRECGenerator.cpp: 7983 (JSC::WREC::Generator::generateJumpIfEndOfInput): 7984 (JSC::WREC::Generator::generateJumpIfNotEndOfInput): 7985 * wrec/WRECGenerator.h: 7986 * wrec/WRECParser.h: 7987 (JSC::WREC::Parser::error): 7988 (JSC::WREC::Parser::parsePattern): 7989 79902008-11-24 Geoffrey Garen <ggaren@apple.com> 7991 7992 Reviewed by Sam Weinig. 7993 7994 Removed some unnecessary "Generator::" prefixes. 7995 7996 * wrec/WRECGenerator.cpp: 7997 (JSC::WREC::Generator::generateEnter): 7998 (JSC::WREC::Generator::generateReturnSuccess): 7999 (JSC::WREC::Generator::generateSaveIndex): 8000 (JSC::WREC::Generator::generateIncrementIndex): 8001 (JSC::WREC::Generator::generateLoopIfNotEndOfInput): 8002 (JSC::WREC::Generator::generateReturnFailure): 8003 80042008-11-24 Geoffrey Garen <ggaren@apple.com> 8005 8006 Reviewed by Sam Weinig. 8007 8008 Made a bunch of WREC::Parser functions private, and added an explicit 8009 "reset()" function, so a parser can be reused. 8010 8011 * wrec/WRECParser.h: 8012 (JSC::WREC::Parser::Parser): 8013 (JSC::WREC::Parser::generator): 8014 (JSC::WREC::Parser::ignoreCase): 8015 (JSC::WREC::Parser::multiline): 8016 (JSC::WREC::Parser::recordSubpattern): 8017 (JSC::WREC::Parser::numSubpatterns): 8018 (JSC::WREC::Parser::parsePattern): 8019 (JSC::WREC::Parser::parseAlternative): 8020 (JSC::WREC::Parser::reset): 8021 80222008-11-24 Gavin Barraclough <barraclough@apple.com> 8023 8024 Reviewed by Cameron Zwarich. 8025 8026 Implement repatching for get by id chain. 8027 Previously the access is performed in a function stub, in the repatch form 8028 the trampoline is not called to; instead the hot path is relinked to jump 8029 directly to the trampoline, if it fails it will jump to the slow case. 8030 8031 https://bugs.webkit.org/show_bug.cgi?id=22449 8032 3% progression on deltablue. 8033 8034 * jit/JIT.cpp: 8035 (JSC::JIT::privateCompileGetByIdProto): 8036 (JSC::JIT::privateCompileGetByIdChain): 8037 80382008-11-24 Joerg Bornemann <joerg.bornemann@trolltech.com> 8039 8040 Reviewed by Simon Hausmann. 8041 8042 https://bugs.webkit.org/show_bug.cgi?id=20746 8043 8044 Various small compilation fixes to make the Qt port of WebKit 8045 compile on Windows CE. 8046 8047 * config.h: Don't set _CRT_RAND_S for CE, it's not available. 8048 * jsc.cpp: Disabled use of debugger includes for CE. It 8049 does not have the debugging functions. 8050 * runtime/DateMath.cpp: Use localtime() on Windows CE. 8051 * wtf/Assertions.cpp: Compile on Windows CE without debugger. 8052 * wtf/Assertions.h: Include windows.h before defining ASSERT. 8053 * wtf/MathExtras.h: Include stdlib.h instead of xmath.h. 8054 * wtf/Platform.h: Disable ERRNO_H and detect endianess based 8055 on the Qt endianess. On Qt for Windows CE the endianess is 8056 defined by the vendor specific build spec. 8057 * wtf/Threading.h: Use the volatile-less atomic functions. 8058 * wtf/dtoa.cpp: Compile without errno. 8059 * wtf/win/MainThreadWin.cpp: Don't include windows.h on CE after 8060 Assertions.h due to the redefinition of ASSERT. 8061 80622008-11-22 Gavin Barraclough <barraclough@apple.com> 8063 8064 Reviewed by Cameron Zwarich. 8065 8066 Replace accidentally deleted immediate check from get by id chain trampoline. 8067 https://bugs.webkit.org/show_bug.cgi?id=22413 8068 8069 * jit/JIT.cpp: 8070 (JSC::JIT::privateCompileGetByIdChain): 8071 80722008-11-21 Gavin Barraclough <barraclough@apple.com> 8073 8074 Reviewed by Oliver Hunt. 8075 8076 Add (really) polymorphic caching for get by id self. 8077 Very similar to caching of prototype accesses, described below. 8078 8079 Oh, also, probably shouldn't have been leaking those structure list objects. 8080 8081 4% preogression on deltablue. 8082 8083 * bytecode/CodeBlock.cpp: 8084 (JSC::CodeBlock::dump): 8085 (JSC::CodeBlock::derefStructures): 8086 (JSC::PrototypeStructureList::derefStructures): 8087 * bytecode/Instruction.h: 8088 * bytecode/Opcode.h: 8089 * interpreter/Interpreter.cpp: 8090 (JSC::Interpreter::privateExecute): 8091 (JSC::Interpreter::cti_op_get_by_id_self_fail): 8092 * jit/JIT.cpp: 8093 (JSC::JIT::privateCompileMainPass): 8094 (JSC::JIT::privateCompileGetByIdSelfList): 8095 (JSC::JIT::patchGetByIdSelf): 8096 * jit/JIT.h: 8097 (JSC::JIT::compileGetByIdSelfList): 8098 80992008-11-21 Geoffrey Garen <ggaren@apple.com> 8100 8101 Reviewed by Sam Weinig. 8102 8103 Fixed many crashes seen 'round the world (but only in release builds). 8104 8105 Update outputParameter offset to reflect slight re-ordering of push 8106 instructions in r38669. 8107 8108 * wrec/WRECGenerator.cpp: 8109 81102008-11-21 Geoffrey Garen <ggaren@apple.com> 8111 8112 Reviewed by Sam Weinig. 8113 8114 A little more RegExp refactoring. 8115 8116 Deployed a helper function for reading the next character. Used the "link 8117 vector of jumps" helper in a place I missed before. 8118 8119 * wrec/WRECGenerator.cpp: 8120 (JSC::WREC::Generator::generateLoadCharacter): 8121 (JSC::WREC::Generator::generatePatternCharacter): 8122 (JSC::WREC::Generator::generateCharacterClass): 8123 (JSC::WREC::Generator::generateAssertionEOL): 8124 (JSC::WREC::Generator::generateAssertionWordBoundary): 8125 * wrec/WRECGenerator.h: 8126 81272008-11-21 Alexey Proskuryakov <ap@webkit.org> 8128 8129 Reviewed by Dan Bernstein. 8130 8131 https://bugs.webkit.org/show_bug.cgi?id=22402 8132 Replace abort() with CRASH() 8133 8134 * wtf/Assertions.h: Added a different method to crash, which should work even is 0xbbadbeef 8135 is a valid memory address. 8136 8137 * runtime/Collector.cpp: 8138 * wtf/FastMalloc.cpp: 8139 * wtf/FastMalloc.h: 8140 * wtf/TCSpinLock.h: 8141 Replace abort() with CRASH(). 8142 81432008-11-21 Alexey Proskuryakov <ap@webkit.org> 8144 8145 Reverted fix for bug 22042 (Replace abort() with CRASH()), because it was breaking 8146 FOR_EACH_OPCODE_ID macro somehow, making Safari crash. 8147 8148 * runtime/Collector.cpp: 8149 (JSC::Heap::heapAllocate): 8150 (JSC::Heap::collect): 8151 * wtf/Assertions.h: 8152 * wtf/FastMalloc.cpp: 8153 (WTF::fastMalloc): 8154 (WTF::fastCalloc): 8155 (WTF::fastRealloc): 8156 (WTF::InitSizeClasses): 8157 (WTF::PageHeapAllocator::New): 8158 (WTF::TCMallocStats::do_malloc): 8159 * wtf/FastMalloc.h: 8160 * wtf/TCSpinLock.h: 8161 (TCMalloc_SpinLock::Init): 8162 (TCMalloc_SpinLock::Finalize): 8163 (TCMalloc_SpinLock::Lock): 8164 (TCMalloc_SpinLock::Unlock): 8165 81662008-11-21 Geoffrey Garen <ggaren@apple.com> 8167 8168 Reviewed by Sam Weinig. 8169 8170 A little more RegExp refactoring. 8171 8172 Moved all assembly from WREC.cpp into WRECGenerator helper functions. 8173 This should help with portability and readability. 8174 8175 Removed ASSERTs after calls to executableCopy(), and changed 8176 executableCopy() to ASSERT instead. 8177 8178 * assembler/X86Assembler.h: 8179 (JSC::X86Assembler::executableCopy): 8180 * jit/JIT.cpp: 8181 (JSC::JIT::privateCompile): 8182 (JSC::JIT::privateCompileGetByIdSelf): 8183 (JSC::JIT::privateCompileGetByIdProto): 8184 (JSC::JIT::privateCompileGetByIdChain): 8185 (JSC::JIT::privateCompilePutByIdReplace): 8186 (JSC::JIT::privateCompilePutByIdTransition): 8187 (JSC::JIT::privateCompileCTIMachineTrampolines): 8188 (JSC::JIT::privateCompilePatchGetArrayLength): 8189 * wrec/WREC.cpp: 8190 (JSC::WREC::compileRegExp): 8191 * wrec/WRECGenerator.cpp: 8192 (JSC::WREC::Generator::generateEnter): 8193 (JSC::WREC::Generator::generateReturnSuccess): 8194 (JSC::WREC::Generator::generateSaveIndex): 8195 (JSC::WREC::Generator::generateIncrementIndex): 8196 (JSC::WREC::Generator::generateLoopIfNotEndOfInput): 8197 (JSC::WREC::Generator::generateReturnFailure): 8198 * wrec/WRECGenerator.h: 8199 * wrec/WRECParser.h: 8200 (JSC::WREC::Parser::ignoreCase): 8201 (JSC::WREC::Parser::generator): 8202 82032008-11-21 Alexey Proskuryakov <ap@webkit.org> 8204 8205 Build fix. 8206 8207 * wtf/Assertions.h: Use ::abort for C++ code. 8208 82092008-11-21 Alexey Proskuryakov <ap@webkit.org> 8210 8211 Reviewed by Sam Weinig. 8212 8213 https://bugs.webkit.org/show_bug.cgi?id=22402 8214 Replace abort() with CRASH() 8215 8216 * wtf/Assertions.h: Added abort() after an attempt to crash for extra safety. 8217 8218 * runtime/Collector.cpp: 8219 * wtf/FastMalloc.cpp: 8220 * wtf/FastMalloc.h: 8221 * wtf/TCSpinLock.h: 8222 Replace abort() with CRASH(). 8223 82242008-11-21 Geoffrey Garen <ggaren@apple.com> 8225 8226 Reviewed by Sam Weinig. 8227 8228 Renamed wrec => generator. 8229 8230 * wrec/WRECFunctors.cpp: 8231 (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom): 8232 (JSC::WREC::GeneratePatternCharacterFunctor::backtrack): 8233 (JSC::WREC::GenerateCharacterClassFunctor::generateAtom): 8234 (JSC::WREC::GenerateCharacterClassFunctor::backtrack): 8235 (JSC::WREC::GenerateBackreferenceFunctor::generateAtom): 8236 (JSC::WREC::GenerateBackreferenceFunctor::backtrack): 8237 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom): 8238 82392008-11-19 Gavin Barraclough <barraclough@apple.com> 8240 8241 Reviewed by Darin Adler. 8242 8243 Add support for (really) polymorphic caching of prototype accesses. 8244 8245 If a cached prototype access misses, cti_op_get_by_id_proto_list is called. 8246 When this occurs the Structure pointers from the instruction stream are copied 8247 off into a new ProtoStubInfo object. A second prototype access trampoline is 8248 generated, and chained onto the first. Subsequent missed call to 8249 cti_op_get_by_id_proto_list_append, which append futher new trampolines, up to 8250 PROTOTYPE_LIST_CACHE_SIZE (currently 4). If any of the misses result in an 8251 access other than to a direct prototype property, list formation is halted (or 8252 for the initial miss, does not take place at all). 8253 8254 Separate fail case functions are provided for each access since this contributes 8255 to the performance progression (enables better processor branch prediction). 8256 8257 Overall this is a near 5% progression on v8, with around 10% wins on richards 8258 and deltablue. 8259 8260 * bytecode/CodeBlock.cpp: 8261 (JSC::CodeBlock::dump): 8262 (JSC::CodeBlock::derefStructures): 8263 * bytecode/Instruction.h: 8264 (JSC::ProtoStructureList::ProtoStubInfo::set): 8265 (JSC::ProtoStructureList::ProtoStructureList): 8266 (JSC::Instruction::Instruction): 8267 (JSC::Instruction::): 8268 * bytecode/Opcode.h: 8269 * interpreter/Interpreter.cpp: 8270 (JSC::Interpreter::privateExecute): 8271 (JSC::Interpreter::tryCTICacheGetByID): 8272 (JSC::Interpreter::cti_op_put_by_id_fail): 8273 (JSC::Interpreter::cti_op_get_by_id_self_fail): 8274 (JSC::Interpreter::cti_op_get_by_id_proto_list): 8275 (JSC::Interpreter::cti_op_get_by_id_proto_list_append): 8276 (JSC::Interpreter::cti_op_get_by_id_proto_list_full): 8277 (JSC::Interpreter::cti_op_get_by_id_proto_fail): 8278 (JSC::Interpreter::cti_op_get_by_id_chain_fail): 8279 (JSC::Interpreter::cti_op_get_by_id_array_fail): 8280 (JSC::Interpreter::cti_op_get_by_id_string_fail): 8281 * interpreter/Interpreter.h: 8282 * jit/JIT.cpp: 8283 (JSC::JIT::privateCompileMainPass): 8284 (JSC::JIT::privateCompileGetByIdSelf): 8285 (JSC::JIT::privateCompileGetByIdProto): 8286 (JSC::JIT::privateCompileGetByIdProtoList): 8287 (JSC::JIT::privateCompileGetByIdChain): 8288 (JSC::JIT::privateCompileCTIMachineTrampolines): 8289 (JSC::JIT::privateCompilePatchGetArrayLength): 8290 * jit/JIT.h: 8291 (JSC::JIT::compileGetByIdProtoList): 8292 82932008-11-20 Sam Weinig <sam@webkit.org> 8294 8295 Try and fix the tiger build. 8296 8297 * parser/Grammar.y: 8298 82992008-11-20 Eric Seidel <eric@webkit.org> 8300 8301 Reviewed by Darin Adler. 8302 8303 Make JavaScriptCore Chromium build under Windows (cmd only, cygwin almost works) 8304 https://bugs.webkit.org/show_bug.cgi?id=22347 8305 8306 * JavaScriptCore.scons: 8307 * parser/Parser.cpp: Add using std::auto_ptr since we use auto_ptr 8308 83092008-11-20 Steve Falkenburg <sfalken@apple.com> 8310 8311 Fix build. 8312 8313 Reviewed by Sam Weinig. 8314 8315 * parser/Parser.cpp: 8316 (JSC::Parser::reparse): 8317 83182008-11-20 Geoffrey Garen <ggaren@apple.com> 8319 8320 Reviewed by Sam Weinig. 8321 8322 A little more RegExp refactoring. 8323 8324 Created a helper function in the assembler for linking a vector of 8325 JmpSrc to a location, and deployed it in a bunch of places. 8326 8327 * JavaScriptCore.xcodeproj/project.pbxproj: 8328 * assembler/X86Assembler.h: 8329 (JSC::X86Assembler::link): 8330 * wrec/WREC.cpp: 8331 (JSC::WREC::compileRegExp): 8332 * wrec/WRECGenerator.cpp: 8333 (JSC::WREC::Generator::generateNonGreedyQuantifier): 8334 (JSC::WREC::Generator::generateGreedyQuantifier): 8335 (JSC::WREC::Generator::generateCharacterClassInverted): 8336 (JSC::WREC::Generator::generateParentheses): 8337 (JSC::WREC::Generator::generateParenthesesResetTrampoline): 8338 (JSC::WREC::Generator::generateAssertionBOL): 8339 (JSC::WREC::Generator::generateAssertionEOL): 8340 (JSC::WREC::Generator::generateAssertionWordBoundary): 8341 (JSC::WREC::Generator::terminateAlternative): 8342 (JSC::WREC::Generator::terminateDisjunction): 8343 * wrec/WRECParser.cpp: 8344 * wrec/WRECParser.h: 8345 (JSC::WREC::Parser::consumeHex): 8346 83472008-11-20 Sam Weinig <sam@webkit.org> 8348 8349 Fix non-mac builds. 8350 8351 * parser/Lexer.cpp: 8352 * parser/Parser.cpp: 8353 83542008-11-20 Sam Weinig <sam@webkit.org> 8355 8356 Reviewed by Darin Adler. 8357 8358 Patch for https://bugs.webkit.org/show_bug.cgi?id=22385 8359 <rdar://problem/6390179> 8360 Lazily reparse FunctionBodyNodes on first execution. 8361 8362 - Saves 57MB on Membuster head. 8363 8364 * bytecompiler/BytecodeGenerator.cpp: 8365 (JSC::BytecodeGenerator::generate): Remove vector shrinking since this is now 8366 handled by destroying the ScopeNodeData after generation. 8367 8368 * parser/Grammar.y: Add alternate NoNode version of the grammar 8369 that does not create nodes. This is used to lazily create FunctionBodyNodes 8370 on first execution. 8371 8372 * parser/Lexer.cpp: 8373 (JSC::Lexer::setCode): Fix bug where on reparse, the Lexer was confused about 8374 what position and length meant. Position is the current position in the original 8375 data buffer (important for getting correct line/column information) and length 8376 the end offset in the original buffer. 8377 * parser/Lexer.h: 8378 (JSC::Lexer::sourceCode): Positions are relative to the beginning of the buffer. 8379 8380 * parser/Nodes.cpp: 8381 (JSC::ScopeNodeData::ScopeNodeData): Move initialization of ScopeNode data here. 8382 (JSC::ScopeNode::ScopeNode): Add constructor that only sets the JSGlobalData 8383 for FunctionBodyNode stubs. 8384 (JSC::ScopeNode::~ScopeNode): Release m_children now that we don't inherit from 8385 BlockNode. 8386 (JSC::ScopeNode::releaseNodes): Ditto. 8387 (JSC::EvalNode::generateBytecode): Only shrink m_children, as we need to keep around 8388 the rest of the data. 8389 (JSC::FunctionBodyNode::FunctionBodyNode): Add constructor that only sets the 8390 JSGlobalData. 8391 (JSC::FunctionBodyNode::create): Ditto. 8392 (JSC::FunctionBodyNode::generateBytecode): If we don't have the data, do a reparse 8393 to construct it. Then after generation, destroy the data. 8394 (JSC::ProgramNode::generateBytecode): After generation, destroy the AST data. 8395 * parser/Nodes.h: 8396 (JSC::ExpressionNode::): Add isFuncExprNode for FunctionConstructor. 8397 (JSC::StatementNode::): Add isExprStatementNode for FunctionConstructor. 8398 (JSC::ExprStatementNode::): Ditto. 8399 (JSC::ExprStatementNode::expr): Add accessor for FunctionConstructor. 8400 (JSC::FuncExprNode::): Add isFuncExprNode for FunctionConstructor 8401 8402 (JSC::ScopeNode::adoptData): Adopts a ScopeNodeData. 8403 (JSC::ScopeNode::data): Accessor for ScopeNodeData. 8404 (JSC::ScopeNode::destroyData): Deletes the ScopeNodeData. 8405 (JSC::ScopeNode::setFeatures): Added. 8406 (JSC::ScopeNode::varStack): Added assert. 8407 (JSC::ScopeNode::functionStack): Ditto. 8408 (JSC::ScopeNode::children): Ditto. 8409 (JSC::ScopeNode::neededConstants): Ditto. 8410 Factor m_varStack, m_functionStack, m_children and m_numConstants into ScopeNodeData. 8411 8412 * parser/Parser.cpp: 8413 (JSC::Parser::reparse): Reparse the SourceCode in the FunctionBodyNode and set 8414 set up the ScopeNodeData for it. 8415 * parser/Parser.h: 8416 8417 * parser/SourceCode.h: 8418 (JSC::SourceCode::endOffset): Added for use in the lexer. 8419 8420 * runtime/FunctionConstructor.cpp: 8421 (JSC::getFunctionBody): Assuming a ProgramNode with one FunctionExpression in it, 8422 get the FunctionBodyNode. Any issues signifies a parse failure in constructFunction. 8423 (JSC::constructFunction): Make parsing functions in the form new Function(""), easier 8424 by concatenating the strings together (with some glue) and parsing the function expression 8425 as a ProgramNode from which we can receive the FunctionBodyNode. This has the added benefit 8426 of not having special parsing code for the arguments and lazily constructing the 8427 FunctionBodyNode's AST on first execution. 8428 8429 * runtime/Identifier.h: 8430 (JSC::operator!=): Added. 8431 84322008-11-20 Sam Weinig <sam@webkit.org> 8433 8434 Reviewed by Geoffrey Garen. 8435 8436 Speedup the lexer to offset coming re-parsing patch. 8437 8438 - .6% progression on Sunspider. 8439 8440 * bytecompiler/SegmentedVector.h: 8441 (JSC::SegmentedVector::shrink): Fixed bug where m_size would not be 8442 set when shrinking to 0. 8443 8444 * parser/Lexer.cpp: 8445 (JSC::Lexer::Lexer): 8446 (JSC::Lexer::isIdentStart): Use isASCIIAlpha and isASCII to avoid going into ICU in the common cases. 8447 (JSC::Lexer::isIdentPart): Use isASCIIAlphanumeric and isASCII to avoid going into ICU in the common cases 8448 (JSC::isDecimalDigit): Use version in ASCIICType.h. Inlining it was a regression. 8449 (JSC::Lexer::isHexDigit): Ditto. 8450 (JSC::Lexer::isOctalDigit): Ditto. 8451 (JSC::Lexer::clear): Resize the m_identifiers SegmentedVector to initial 8452 capacity 8453 * parser/Lexer.h: Remove unused m_strings vector. Make m_identifiers 8454 a SegmentedVector<Identifier> to avoid allocating a new Identifier* for 8455 each identifier found. The SegmentedVector is need so we can passes 8456 references to the Identifier to the parser, which remain valid even when 8457 the vector is resized. 8458 (JSC::Lexer::makeIdentifier): Inline and return a reference to the added 8459 Identifier. 8460 84612008-11-20 Sam Weinig <sam@webkit.org> 8462 8463 Reviewed by Darin Adler. 8464 8465 Add isASCII to ASCIICType. Use coming soon! 8466 8467 * wtf/ASCIICType.h: 8468 (WTF::isASCII): 8469 84702008-11-20 Sam Weinig <sam@webkit.org> 8471 8472 Reviewed by Darin Adler. 8473 8474 Add OwnPtr constructor and OwnPtr::adopt that take an auto_ptr. 8475 8476 * wtf/OwnPtr.h: 8477 (WTF::OwnPtr::OwnPtr): 8478 (WTF::OwnPtr::adopt): 8479 84802008-11-20 Alexey Proskuryakov <ap@webkit.org> 8481 8482 Reviewed by Darin Adler. 8483 8484 https://bugs.webkit.org/show_bug.cgi?id=22364 8485 Crashes seen on Tiger buildbots due to worker threads exhausting pthread keys 8486 8487 * runtime/Collector.cpp: 8488 (JSC::Heap::Heap): 8489 (JSC::Heap::destroy): 8490 (JSC::Heap::makeUsableFromMultipleThreads): 8491 (JSC::Heap::registerThread): 8492 * runtime/Collector.h: 8493 Pthread key for tracking threads is only created on request now, because this is a limited 8494 resource, and thread tracking is not needed for worker heaps, or for WebCore heap. 8495 8496 * API/JSContextRef.cpp: (JSGlobalContextCreateInGroup): Call makeUsableFromMultipleThreads(). 8497 8498 * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::sharedInstance): Ditto. 8499 8500 * runtime/JSGlobalData.h: (JSC::JSGlobalData::makeUsableFromMultipleThreads): Just forward 8501 the call to Heap, which clients need not know about, ideally. 8502 85032008-11-20 Geoffrey Garen <ggaren@apple.com> 8504 8505 Reviewed by Sam Weinig. 8506 8507 A little more WREC refactoring. 8508 8509 Removed the "Register" suffix from register names in WREC, and renamed: 8510 currentPosition => index 8511 currentValue => character 8512 quantifierCount => repeatCount 8513 8514 Added a top-level parsePattern function to the WREC parser, which 8515 allowed me to remove the error() and atEndOfPattern() accessors. 8516 8517 Factored out an MSVC customization into a constant. 8518 8519 Renamed nextLabel => beginPattern. 8520 8521 * wrec/WREC.cpp: 8522 (JSC::WREC::compileRegExp): 8523 * wrec/WRECGenerator.cpp: 8524 (JSC::WREC::Generator::generateBacktrack1): 8525 (JSC::WREC::Generator::generateBacktrackBackreference): 8526 (JSC::WREC::Generator::generateBackreferenceQuantifier): 8527 (JSC::WREC::Generator::generateNonGreedyQuantifier): 8528 (JSC::WREC::Generator::generateGreedyQuantifier): 8529 (JSC::WREC::Generator::generatePatternCharacter): 8530 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 8531 (JSC::WREC::Generator::generateCharacterClassInverted): 8532 (JSC::WREC::Generator::generateCharacterClass): 8533 (JSC::WREC::Generator::generateParentheses): 8534 (JSC::WREC::Generator::generateParenthesesResetTrampoline): 8535 (JSC::WREC::Generator::generateAssertionBOL): 8536 (JSC::WREC::Generator::generateAssertionEOL): 8537 (JSC::WREC::Generator::generateAssertionWordBoundary): 8538 (JSC::WREC::Generator::generateBackreference): 8539 (JSC::WREC::Generator::generateDisjunction): 8540 (JSC::WREC::Generator::terminateDisjunction): 8541 * wrec/WRECGenerator.h: 8542 * wrec/WRECParser.h: 8543 (JSC::WREC::Parser::parsePattern): 8544 85452008-11-19 Geoffrey Garen <ggaren@apple.com> 8546 8547 Reviewed by Darin Adler. 8548 8549 https://bugs.webkit.org/show_bug.cgi?id=22361 8550 A little more RegExp refactoring. 8551 8552 Consistently named variables holding the starting position at which 8553 regexp matching should begin to "startOffset". 8554 8555 A few more "regExpObject" => "regExpConstructor" changes. 8556 8557 Refactored RegExpObject::match for clarity, and replaced a slow "get" 8558 of the "global" property with a fast access to the global bit. 8559 8560 Made the error message you see when RegExpObject::match has no input a 8561 little more informative, as in Firefox. 8562 8563 * runtime/RegExp.cpp: 8564 (JSC::RegExp::match): 8565 * runtime/RegExp.h: 8566 * runtime/RegExpObject.cpp: 8567 (JSC::RegExpObject::match): 8568 * runtime/StringPrototype.cpp: 8569 (JSC::stringProtoFuncReplace): 8570 (JSC::stringProtoFuncMatch): 8571 (JSC::stringProtoFuncSearch): 8572 85732008-11-19 Geoffrey Garen <ggaren@apple.com> 8574 8575 Reviewed by Sam Weinig. 8576 8577 A little more refactoring. 8578 8579 Removed the "emit" and "emitUnlinked" prefixes from the assembler. 8580 8581 Moved the JmpSrc and JmpDst class definitions to the top of the X86 8582 assembler class, in accordance with WebKit style guidelines. 8583 8584 * assembler/X86Assembler.h: 8585 (JSC::X86Assembler::JmpSrc::JmpSrc): 8586 (JSC::X86Assembler::JmpDst::JmpDst): 8587 (JSC::X86Assembler::int3): 8588 (JSC::X86Assembler::pushl_m): 8589 (JSC::X86Assembler::popl_m): 8590 (JSC::X86Assembler::movl_rr): 8591 (JSC::X86Assembler::addl_rr): 8592 (JSC::X86Assembler::addl_i8r): 8593 (JSC::X86Assembler::addl_i8m): 8594 (JSC::X86Assembler::addl_i32r): 8595 (JSC::X86Assembler::addl_mr): 8596 (JSC::X86Assembler::andl_rr): 8597 (JSC::X86Assembler::andl_i32r): 8598 (JSC::X86Assembler::cmpl_i8r): 8599 (JSC::X86Assembler::cmpl_rr): 8600 (JSC::X86Assembler::cmpl_rm): 8601 (JSC::X86Assembler::cmpl_mr): 8602 (JSC::X86Assembler::cmpl_i32r): 8603 (JSC::X86Assembler::cmpl_i32m): 8604 (JSC::X86Assembler::cmpl_i8m): 8605 (JSC::X86Assembler::cmpw_rm): 8606 (JSC::X86Assembler::orl_rr): 8607 (JSC::X86Assembler::orl_mr): 8608 (JSC::X86Assembler::orl_i32r): 8609 (JSC::X86Assembler::subl_rr): 8610 (JSC::X86Assembler::subl_i8r): 8611 (JSC::X86Assembler::subl_i8m): 8612 (JSC::X86Assembler::subl_i32r): 8613 (JSC::X86Assembler::subl_mr): 8614 (JSC::X86Assembler::testl_i32r): 8615 (JSC::X86Assembler::testl_i32m): 8616 (JSC::X86Assembler::testl_rr): 8617 (JSC::X86Assembler::xorl_i8r): 8618 (JSC::X86Assembler::xorl_rr): 8619 (JSC::X86Assembler::sarl_i8r): 8620 (JSC::X86Assembler::sarl_CLr): 8621 (JSC::X86Assembler::shl_i8r): 8622 (JSC::X86Assembler::shll_CLr): 8623 (JSC::X86Assembler::imull_rr): 8624 (JSC::X86Assembler::imull_i32r): 8625 (JSC::X86Assembler::idivl_r): 8626 (JSC::X86Assembler::negl_r): 8627 (JSC::X86Assembler::movl_mr): 8628 (JSC::X86Assembler::movzbl_rr): 8629 (JSC::X86Assembler::movzwl_mr): 8630 (JSC::X86Assembler::movl_rm): 8631 (JSC::X86Assembler::movl_i32r): 8632 (JSC::X86Assembler::movl_i32m): 8633 (JSC::X86Assembler::leal_mr): 8634 (JSC::X86Assembler::jmp_r): 8635 (JSC::X86Assembler::jmp_m): 8636 (JSC::X86Assembler::movsd_mr): 8637 (JSC::X86Assembler::xorpd_mr): 8638 (JSC::X86Assembler::movsd_rm): 8639 (JSC::X86Assembler::movd_rr): 8640 (JSC::X86Assembler::cvtsi2sd_rr): 8641 (JSC::X86Assembler::cvttsd2si_rr): 8642 (JSC::X86Assembler::addsd_mr): 8643 (JSC::X86Assembler::subsd_mr): 8644 (JSC::X86Assembler::mulsd_mr): 8645 (JSC::X86Assembler::addsd_rr): 8646 (JSC::X86Assembler::subsd_rr): 8647 (JSC::X86Assembler::mulsd_rr): 8648 (JSC::X86Assembler::ucomis_rr): 8649 (JSC::X86Assembler::pextrw_irr): 8650 (JSC::X86Assembler::call): 8651 (JSC::X86Assembler::jmp): 8652 (JSC::X86Assembler::jne): 8653 (JSC::X86Assembler::jnz): 8654 (JSC::X86Assembler::je): 8655 (JSC::X86Assembler::jl): 8656 (JSC::X86Assembler::jb): 8657 (JSC::X86Assembler::jle): 8658 (JSC::X86Assembler::jbe): 8659 (JSC::X86Assembler::jge): 8660 (JSC::X86Assembler::jg): 8661 (JSC::X86Assembler::ja): 8662 (JSC::X86Assembler::jae): 8663 (JSC::X86Assembler::jo): 8664 (JSC::X86Assembler::jp): 8665 (JSC::X86Assembler::js): 8666 (JSC::X86Assembler::predictNotTaken): 8667 (JSC::X86Assembler::convertToFastCall): 8668 (JSC::X86Assembler::restoreArgumentReference): 8669 (JSC::X86Assembler::restoreArgumentReferenceForTrampoline): 8670 (JSC::X86Assembler::modRm_rr): 8671 (JSC::X86Assembler::modRm_rr_Unchecked): 8672 (JSC::X86Assembler::modRm_rm): 8673 (JSC::X86Assembler::modRm_rm_Unchecked): 8674 (JSC::X86Assembler::modRm_rmsib): 8675 (JSC::X86Assembler::modRm_opr): 8676 (JSC::X86Assembler::modRm_opr_Unchecked): 8677 (JSC::X86Assembler::modRm_opm): 8678 (JSC::X86Assembler::modRm_opm_Unchecked): 8679 (JSC::X86Assembler::modRm_opmsib): 8680 * jit/JIT.cpp: 8681 (JSC::JIT::emitNakedCall): 8682 (JSC::JIT::emitNakedFastCall): 8683 (JSC::JIT::emitCTICall): 8684 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 8685 (JSC::JIT::emitJumpSlowCaseIfNotImmNum): 8686 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): 8687 (JSC::JIT::emitFastArithIntToImmOrSlowCase): 8688 (JSC::JIT::emitArithIntToImmWithJump): 8689 (JSC::JIT::compileOpCall): 8690 (JSC::JIT::compileOpStrictEq): 8691 (JSC::JIT::emitSlowScriptCheck): 8692 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate): 8693 (JSC::JIT::compileBinaryArithOp): 8694 (JSC::JIT::privateCompileMainPass): 8695 (JSC::JIT::privateCompileSlowCases): 8696 (JSC::JIT::privateCompile): 8697 (JSC::JIT::privateCompileGetByIdSelf): 8698 (JSC::JIT::privateCompileGetByIdProto): 8699 (JSC::JIT::privateCompileGetByIdChain): 8700 (JSC::JIT::privateCompilePutByIdReplace): 8701 (JSC::JIT::privateCompilePutByIdTransition): 8702 (JSC::JIT::privateCompileCTIMachineTrampolines): 8703 (JSC::JIT::privateCompilePatchGetArrayLength): 8704 * wrec/WREC.cpp: 8705 (JSC::WREC::compileRegExp): 8706 * wrec/WRECGenerator.cpp: 8707 (JSC::WREC::Generator::generateBackreferenceQuantifier): 8708 (JSC::WREC::Generator::generateNonGreedyQuantifier): 8709 (JSC::WREC::Generator::generateGreedyQuantifier): 8710 (JSC::WREC::Generator::generatePatternCharacter): 8711 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 8712 (JSC::WREC::Generator::generateCharacterClassInverted): 8713 (JSC::WREC::Generator::generateCharacterClass): 8714 (JSC::WREC::Generator::generateParentheses): 8715 (JSC::WREC::Generator::generateParenthesesNonGreedy): 8716 (JSC::WREC::Generator::generateParenthesesResetTrampoline): 8717 (JSC::WREC::Generator::generateAssertionBOL): 8718 (JSC::WREC::Generator::generateAssertionEOL): 8719 (JSC::WREC::Generator::generateAssertionWordBoundary): 8720 (JSC::WREC::Generator::generateBackreference): 8721 (JSC::WREC::Generator::generateDisjunction): 8722 87232008-11-19 Simon Hausmann <hausmann@webkit.org> 8724 8725 Sun CC build fix, removed trailing comman for last enum value. 8726 8727 * wtf/unicode/qt4/UnicodeQt4.h: 8728 (WTF::Unicode::): 8729 87302008-11-19 Mark Rowe <mrowe@apple.com> 8731 8732 Reviewed by Alexey Proskuryakov. 8733 8734 Expand the workaround for Apple GCC compiler bug <rdar://problem/6354696> to all versions of GCC 4.0.1. 8735 It has been observed with builds 5465 (Xcode 3.0) and 5484 (Xcode 3.1), and there is no evidence 8736 that it has been fixed in newer builds of GCC 4.0.1. 8737 8738 This addresses <https://bugs.webkit.org/show_bug.cgi?id=22351> (WebKit nightly crashes on launch on 10.4.11). 8739 8740 * wtf/StdLibExtras.h: 8741 87422008-11-18 Cameron Zwarich <zwarich@apple.com> 8743 8744 Reviewed by Maciej Stachowiak and Geoff Garen. 8745 8746 Bug 22287: ASSERTION FAILED: Not enough jumps linked in slow case codegen in CTI::privateCompileSlowCases()) 8747 <https://bugs.webkit.org/show_bug.cgi?id=22287> 8748 8749 Fix a typo in the number cell reuse code where the first and second 8750 operands are sometimes confused. 8751 8752 * jit/JIT.cpp: 8753 (JSC::JIT::compileBinaryArithOpSlowCase): 8754 87552008-11-18 Dan Bernstein <mitz@apple.com> 8756 8757 - try to fix the Windows build 8758 8759 * interpreter/Interpreter.cpp: 8760 (JSC::Interpreter::privateExecute): 8761 87622008-11-18 Geoffrey Garen <ggaren@apple.com> 8763 8764 Reviewed by Sam Weinig. 8765 8766 Minor RegExp cleanup. 8767 8768 SunSpider says no change. 8769 8770 * runtime/RegExpObject.cpp: 8771 (JSC::RegExpObject::match): Renamed "regExpObj" to "regExpConstructor". 8772 8773 * wrec/WREC.cpp: 8774 (JSC::WREC::compileRegExp): Instead of checking for a NULL output vector, 8775 ASSERT that the output vector is not NULL. (The rest of WREC is not 8776 safe to use with a NULL output vector, and we probably don't want to 8777 spend the time and/or performance to make it safe.) 8778 87792008-11-18 Geoffrey Garen <ggaren@apple.com> 8780 8781 Reviewed by Darin Adler. 8782 8783 A little more renaming and refactoring. 8784 8785 VM_CHECK_EXCEPTION() => CHECK_FOR_EXCEPTION(). 8786 NEXT_INSTRUCTION => NEXT_INSTRUCTION(). 8787 8788 Removed the "Error_" and "TempError_" prefixes from WREC error types. 8789 8790 Refactored the WREC parser so it doesn't need a "setError" function, 8791 and changed "isEndOfPattern" and its use -- they read kind of backwards 8792 before. 8793 8794 Changed our "TODO:" error messages at least to say something, since you 8795 can't say "TODO:" in shipping software. 8796 8797 * interpreter/Interpreter.cpp: 8798 (JSC::Interpreter::privateExecute): 8799 (JSC::Interpreter::cti_op_convert_this): 8800 (JSC::Interpreter::cti_op_add): 8801 (JSC::Interpreter::cti_op_pre_inc): 8802 (JSC::Interpreter::cti_op_loop_if_less): 8803 (JSC::Interpreter::cti_op_loop_if_lesseq): 8804 (JSC::Interpreter::cti_op_put_by_id): 8805 (JSC::Interpreter::cti_op_put_by_id_second): 8806 (JSC::Interpreter::cti_op_put_by_id_generic): 8807 (JSC::Interpreter::cti_op_put_by_id_fail): 8808 (JSC::Interpreter::cti_op_get_by_id): 8809 (JSC::Interpreter::cti_op_get_by_id_second): 8810 (JSC::Interpreter::cti_op_get_by_id_generic): 8811 (JSC::Interpreter::cti_op_get_by_id_fail): 8812 (JSC::Interpreter::cti_op_instanceof): 8813 (JSC::Interpreter::cti_op_del_by_id): 8814 (JSC::Interpreter::cti_op_mul): 8815 (JSC::Interpreter::cti_op_call_NotJSFunction): 8816 (JSC::Interpreter::cti_op_resolve): 8817 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 8818 (JSC::Interpreter::cti_op_get_by_val): 8819 (JSC::Interpreter::cti_op_resolve_func): 8820 (JSC::Interpreter::cti_op_sub): 8821 (JSC::Interpreter::cti_op_put_by_val): 8822 (JSC::Interpreter::cti_op_put_by_val_array): 8823 (JSC::Interpreter::cti_op_lesseq): 8824 (JSC::Interpreter::cti_op_loop_if_true): 8825 (JSC::Interpreter::cti_op_negate): 8826 (JSC::Interpreter::cti_op_resolve_skip): 8827 (JSC::Interpreter::cti_op_resolve_global): 8828 (JSC::Interpreter::cti_op_div): 8829 (JSC::Interpreter::cti_op_pre_dec): 8830 (JSC::Interpreter::cti_op_jless): 8831 (JSC::Interpreter::cti_op_not): 8832 (JSC::Interpreter::cti_op_jtrue): 8833 (JSC::Interpreter::cti_op_post_inc): 8834 (JSC::Interpreter::cti_op_eq): 8835 (JSC::Interpreter::cti_op_lshift): 8836 (JSC::Interpreter::cti_op_bitand): 8837 (JSC::Interpreter::cti_op_rshift): 8838 (JSC::Interpreter::cti_op_bitnot): 8839 (JSC::Interpreter::cti_op_resolve_with_base): 8840 (JSC::Interpreter::cti_op_mod): 8841 (JSC::Interpreter::cti_op_less): 8842 (JSC::Interpreter::cti_op_neq): 8843 (JSC::Interpreter::cti_op_post_dec): 8844 (JSC::Interpreter::cti_op_urshift): 8845 (JSC::Interpreter::cti_op_bitxor): 8846 (JSC::Interpreter::cti_op_bitor): 8847 (JSC::Interpreter::cti_op_push_scope): 8848 (JSC::Interpreter::cti_op_to_jsnumber): 8849 (JSC::Interpreter::cti_op_in): 8850 (JSC::Interpreter::cti_op_del_by_val): 8851 * wrec/WREC.cpp: 8852 (JSC::WREC::compileRegExp): 8853 * wrec/WRECParser.cpp: 8854 (JSC::WREC::Parser::parseGreedyQuantifier): 8855 (JSC::WREC::Parser::parseParentheses): 8856 (JSC::WREC::Parser::parseCharacterClass): 8857 (JSC::WREC::Parser::parseEscape): 8858 * wrec/WRECParser.h: 8859 (JSC::WREC::Parser::): 8860 (JSC::WREC::Parser::atEndOfPattern): 8861 88622008-11-18 Alexey Proskuryakov <ap@webkit.org> 8863 8864 Reviewed by Darin Adler. 8865 8866 https://bugs.webkit.org/show_bug.cgi?id=22337 8867 Enable workers by default 8868 8869 * Configurations/JavaScriptCore.xcconfig: Define ENABLE_WORKERS. 8870 88712008-11-18 Alexey Proskuryakov <ap@webkit.org> 8872 8873 - Windows build fix 8874 8875 * wrec/WRECFunctors.h: 8876 * wrec/WRECGenerator.h: 8877 * wrec/WRECParser.h: 8878 CharacterClass is a struct, not a class, fix forward declarations. 8879 88802008-11-18 Dan Bernstein <mitz@apple.com> 8881 8882 - Windows build fix 8883 8884 * assembler/X86Assembler.h: 8885 88862008-11-17 Geoffrey Garen <ggaren@apple.com> 8887 8888 Not reviewed. 8889 8890 Try to fix gtk build. 8891 8892 * wrec/Quantifier.h: 8893 88942008-11-17 Geoffrey Garen <ggaren@apple.com> 8895 8896 Not reviewed. 8897 8898 Try to fix gtk build. 8899 8900 * assembler/AssemblerBuffer.h: 8901 89022008-11-17 Geoffrey Garen <ggaren@apple.com> 8903 8904 Reviewed by Sam Weinig. 8905 8906 Split WREC classes out into individual files, with a few modifications 8907 to more closely match the WebKit coding style. 8908 8909 * GNUmakefile.am: 8910 * JavaScriptCore.scons: 8911 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 8912 * JavaScriptCore.xcodeproj/project.pbxproj: 8913 * assembler/X86Assembler.h: 8914 * runtime/RegExp.cpp: 8915 * wrec/CharacterClass.cpp: Copied from wrec/CharacterClassConstructor.cpp. 8916 (JSC::WREC::CharacterClass::newline): 8917 (JSC::WREC::CharacterClass::digits): 8918 (JSC::WREC::CharacterClass::spaces): 8919 (JSC::WREC::CharacterClass::wordchar): 8920 (JSC::WREC::CharacterClass::nondigits): 8921 (JSC::WREC::CharacterClass::nonspaces): 8922 (JSC::WREC::CharacterClass::nonwordchar): 8923 * wrec/CharacterClass.h: Copied from wrec/CharacterClassConstructor.h. 8924 * wrec/CharacterClassConstructor.cpp: 8925 (JSC::WREC::CharacterClassConstructor::addSortedRange): 8926 (JSC::WREC::CharacterClassConstructor::append): 8927 * wrec/CharacterClassConstructor.h: 8928 * wrec/Quantifier.h: Copied from wrec/WREC.h. 8929 * wrec/WREC.cpp: 8930 (JSC::WREC::compileRegExp): 8931 * wrec/WREC.h: 8932 * wrec/WRECFunctors.cpp: Copied from wrec/WREC.cpp. 8933 * wrec/WRECFunctors.h: Copied from wrec/WREC.cpp. 8934 (JSC::WREC::GenerateAtomFunctor::~GenerateAtomFunctor): 8935 (JSC::WREC::GeneratePatternCharacterFunctor::GeneratePatternCharacterFunctor): 8936 (JSC::WREC::GenerateCharacterClassFunctor::GenerateCharacterClassFunctor): 8937 (JSC::WREC::GenerateBackreferenceFunctor::GenerateBackreferenceFunctor): 8938 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor): 8939 * wrec/WRECGenerator.cpp: Copied from wrec/WREC.cpp. 8940 (JSC::WREC::Generator::generatePatternCharacter): 8941 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 8942 (JSC::WREC::Generator::generateCharacterClassInverted): 8943 (JSC::WREC::Generator::generateCharacterClass): 8944 (JSC::WREC::Generator::generateParentheses): 8945 (JSC::WREC::Generator::generateAssertionBOL): 8946 (JSC::WREC::Generator::generateAssertionEOL): 8947 (JSC::WREC::Generator::generateAssertionWordBoundary): 8948 * wrec/WRECGenerator.h: Copied from wrec/WREC.h. 8949 * wrec/WRECParser.cpp: Copied from wrec/WREC.cpp. 8950 (JSC::WREC::Parser::parseGreedyQuantifier): 8951 (JSC::WREC::Parser::parseCharacterClassQuantifier): 8952 (JSC::WREC::Parser::parseParentheses): 8953 (JSC::WREC::Parser::parseCharacterClass): 8954 (JSC::WREC::Parser::parseEscape): 8955 (JSC::WREC::Parser::parseTerm): 8956 * wrec/WRECParser.h: Copied from wrec/WREC.h. 8957 (JSC::WREC::Parser::): 8958 (JSC::WREC::Parser::Parser): 8959 (JSC::WREC::Parser::setError): 8960 (JSC::WREC::Parser::error): 8961 (JSC::WREC::Parser::recordSubpattern): 8962 (JSC::WREC::Parser::numSubpatterns): 8963 (JSC::WREC::Parser::ignoreCase): 8964 (JSC::WREC::Parser::multiline): 8965 89662008-11-17 Geoffrey Garen <ggaren@apple.com> 8967 8968 Not reviewed. 8969 8970 Try to fix a few builds. 8971 8972 * JavaScriptCoreSources.bkl: 8973 89742008-11-17 Geoffrey Garen <ggaren@apple.com> 8975 8976 Not reviewed. 8977 8978 Try to fix a few builds. 8979 8980 * JavaScriptCore.pri: 8981 * JavaScriptCore.scons: 8982 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 8983 89842008-11-17 Geoffrey Garen <ggaren@apple.com> 8985 8986 Reviewed by Sam Weinig. 8987 8988 Moved VM/CTI.* => jit/JIT.*. 8989 8990 Removed VM. 8991 8992 * GNUmakefile.am: 8993 * JavaScriptCore.pri: 8994 * JavaScriptCore.scons: 8995 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 8996 * JavaScriptCore.xcodeproj/project.pbxproj: 8997 * VM/CTI.cpp: Removed. 8998 * VM/CTI.h: Removed. 8999 * bytecode/CodeBlock.cpp: 9000 * interpreter/Interpreter.cpp: 9001 * jit: Added. 9002 * jit/JIT.cpp: Copied from VM/CTI.cpp. 9003 * jit/JIT.h: Copied from VM/CTI.h. 9004 * runtime/RegExp.cpp: 9005 90062008-11-17 Geoffrey Garen <ggaren@apple.com> 9007 9008 Reviewed by Sam Weinig. 9009 9010 Moved runtime/ExecState.* => interpreter/CallFrame.*. 9011 9012 * API/JSBase.cpp: 9013 * API/OpaqueJSString.cpp: 9014 * GNUmakefile.am: 9015 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9016 * JavaScriptCore.xcodeproj/project.pbxproj: 9017 * debugger/DebuggerCallFrame.h: 9018 * interpreter/CallFrame.cpp: Copied from runtime/ExecState.cpp. 9019 * interpreter/CallFrame.h: Copied from runtime/ExecState.h. 9020 * interpreter/Interpreter.cpp: 9021 * parser/Nodes.cpp: 9022 * profiler/ProfileGenerator.cpp: 9023 * profiler/Profiler.cpp: 9024 * runtime/ClassInfo.h: 9025 * runtime/Collector.cpp: 9026 * runtime/Completion.cpp: 9027 * runtime/ExceptionHelpers.cpp: 9028 * runtime/ExecState.cpp: Removed. 9029 * runtime/ExecState.h: Removed. 9030 * runtime/Identifier.cpp: 9031 * runtime/JSFunction.cpp: 9032 * runtime/JSGlobalObjectFunctions.cpp: 9033 * runtime/JSLock.cpp: 9034 * runtime/JSNumberCell.h: 9035 * runtime/JSObject.h: 9036 * runtime/JSString.h: 9037 * runtime/Lookup.h: 9038 * runtime/PropertyNameArray.h: 9039 90402008-11-17 Geoffrey Garen <ggaren@apple.com> 9041 9042 Not reviewed. 9043 9044 Try to fix Windows build. 9045 9046 * API/APICast.h: 9047 90482008-11-17 Geoffrey Garen <ggaren@apple.com> 9049 9050 Not reviewed. 9051 9052 Try to fix Windows build. 9053 9054 * API/APICast.h: 9055 * runtime/ExecState.h: 9056 90572008-11-17 Geoffrey Garen <ggaren@apple.com> 9058 9059 Reviewed by Sam Weinig. 9060 9061 Moved VM/SamplingTool.* => bytecode/SamplingTool.*. 9062 9063 * GNUmakefile.am: 9064 * JavaScriptCore.pri: 9065 * JavaScriptCore.scons: 9066 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9067 * JavaScriptCore.xcodeproj/project.pbxproj: 9068 * JavaScriptCoreSources.bkl: 9069 * VM/SamplingTool.cpp: Removed. 9070 * VM/SamplingTool.h: Removed. 9071 * bytecode/SamplingTool.cpp: Copied from VM/SamplingTool.cpp. 9072 * bytecode/SamplingTool.h: Copied from VM/SamplingTool.h. 9073 * jsc.cpp: 9074 (runWithScripts): 9075 90762008-11-17 Geoffrey Garen <ggaren@apple.com> 9077 9078 Not reviewed. 9079 9080 Try to fix Windows build. 9081 9082 * runtime/ExecState.h: 9083 90842008-11-17 Geoffrey Garen <ggaren@apple.com> 9085 9086 Reviewed by Sam Weinig. 9087 9088 Moved VM/ExceptionHelpers.cpp => runtime/ExceptionHelpers.cpp. 9089 9090 * GNUmakefile.am: 9091 * JavaScriptCore.pri: 9092 * JavaScriptCore.scons: 9093 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9094 * JavaScriptCore.xcodeproj/project.pbxproj: 9095 * JavaScriptCoreSources.bkl: 9096 * VM/ExceptionHelpers.cpp: Removed. 9097 * runtime/ExceptionHelpers.cpp: Copied from VM/ExceptionHelpers.cpp. 9098 90992008-11-17 Geoffrey Garen <ggaren@apple.com> 9100 9101 Reviewed by Sam Weinig. 9102 9103 Moved VM/RegisterFile.cpp => interpreter/RegisterFile.cpp. 9104 9105 * AllInOneFile.cpp: 9106 * GNUmakefile.am: 9107 * JavaScriptCore.pri: 9108 * JavaScriptCore.scons: 9109 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9110 * JavaScriptCore.xcodeproj/project.pbxproj: 9111 * JavaScriptCoreSources.bkl: 9112 * VM/RegisterFile.cpp: Removed. 9113 * interpreter/RegisterFile.cpp: Copied from VM/RegisterFile.cpp. 9114 91152008-11-17 Geoffrey Garen <ggaren@apple.com> 9116 9117 Not reviewed. 9118 9119 Try to fix Windows build. 9120 9121 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9122 91232008-11-17 Geoffrey Garen <ggaren@apple.com> 9124 9125 Not reviewed. 9126 9127 Try to fix Windows build. 9128 9129 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 9130 91312008-11-17 Geoffrey Garen <ggaren@apple.com> 9132 9133 Not reviewed. 9134 9135 Try to fix Windows build. 9136 9137 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9138 91392008-11-17 Geoffrey Garen <ggaren@apple.com> 9140 9141 Reviewed by Sam Weinig. 9142 9143 Moved: 9144 VM/ExceptionHelpers.h => runtime/ExceptionHelpers.h 9145 VM/Register.h => interpreter/Register.h 9146 VM/RegisterFile.h => interpreter/RegisterFile.h 9147 9148 9149 * GNUmakefile.am: 9150 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9151 * JavaScriptCore.xcodeproj/project.pbxproj: 9152 * VM/ExceptionHelpers.h: Removed. 9153 * VM/Register.h: Removed. 9154 * VM/RegisterFile.h: Removed. 9155 * interpreter/Register.h: Copied from VM/Register.h. 9156 * interpreter/RegisterFile.h: Copied from VM/RegisterFile.h. 9157 * runtime/ExceptionHelpers.h: Copied from VM/ExceptionHelpers.h. 9158 91592008-11-17 Geoffrey Garen <ggaren@apple.com> 9160 9161 Not reviewed. 9162 9163 Try to fix Qt build. 9164 9165 * JavaScriptCore.pri: 9166 91672008-11-17 Geoffrey Garen <ggaren@apple.com> 9168 9169 Reviewed by Sam Weinig. 9170 9171 Moved VM/Machine.cpp => interpreter/Interpreter.cpp. 9172 9173 * DerivedSources.make: 9174 * GNUmakefile.am: 9175 * JavaScriptCore.pri: 9176 * JavaScriptCore.scons: 9177 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9178 * JavaScriptCore.xcodeproj/project.pbxproj: 9179 * JavaScriptCoreSources.bkl: 9180 * VM/Machine.cpp: Removed. 9181 * interpreter/Interpreter.cpp: Copied from VM/Machine.cpp. 9182 91832008-11-17 Geoffrey Garen <ggaren@apple.com> 9184 9185 Reviewed by Sam Weinig. 9186 9187 Moved VM/Machine.h => interpreter/Interpreter.h 9188 9189 * GNUmakefile.am: 9190 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9191 * JavaScriptCore.xcodeproj/project.pbxproj: 9192 * VM/CTI.cpp: 9193 * VM/CTI.h: 9194 * VM/ExceptionHelpers.cpp: 9195 * VM/Machine.cpp: 9196 * VM/Machine.h: Removed. 9197 * VM/SamplingTool.cpp: 9198 * bytecode/CodeBlock.cpp: 9199 * bytecompiler/BytecodeGenerator.cpp: 9200 * bytecompiler/BytecodeGenerator.h: 9201 * debugger/DebuggerCallFrame.cpp: 9202 * interpreter: Added. 9203 * interpreter/Interpreter.h: Copied from VM/Machine.h. 9204 * profiler/ProfileGenerator.cpp: 9205 * runtime/Arguments.h: 9206 * runtime/ArrayPrototype.cpp: 9207 * runtime/Collector.cpp: 9208 * runtime/Completion.cpp: 9209 * runtime/ExecState.h: 9210 * runtime/FunctionPrototype.cpp: 9211 * runtime/JSActivation.cpp: 9212 * runtime/JSFunction.cpp: 9213 * runtime/JSGlobalData.cpp: 9214 * runtime/JSGlobalObject.cpp: 9215 * runtime/JSGlobalObjectFunctions.cpp: 9216 * wrec/WREC.cpp: 9217 92182008-11-17 Geoffrey Garen <ggaren@apple.com> 9219 9220 Reviewed by Sam Weinig. 9221 9222 Moved runtime/Interpreter.cpp => runtime/Completion.cpp. 9223 9224 Moved functions from Interpreter.h to Completion.h, and removed 9225 Interpreter.h from the project. 9226 9227 * API/JSBase.cpp: 9228 * AllInOneFile.cpp: 9229 * GNUmakefile.am: 9230 * JavaScriptCore.pri: 9231 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9232 * JavaScriptCore.xcodeproj/project.pbxproj: 9233 * JavaScriptCoreSources.bkl: 9234 * jsc.cpp: 9235 * runtime/Completion.cpp: Copied from runtime/Interpreter.cpp. 9236 * runtime/Completion.h: 9237 * runtime/Interpreter.cpp: Removed. 9238 * runtime/Interpreter.h: Removed. 9239 92402008-11-17 Gabor Loki <loki@inf.u-szeged.hu> 9241 9242 Reviewed by Darin Adler. 9243 9244 <https://bugs.webkit.org/show_bug.cgi?id=22312> 9245 Fix PCRE include path problem on Qt-port 9246 9247 * JavaScriptCore.pri: 9248 * pcre/pcre.pri: 9249 92502008-11-17 Gabor Loki <loki@inf.u-szeged.hu> 9251 9252 Reviewed by Darin Adler. 9253 9254 <https://bugs.webkit.org/show_bug.cgi?id=22313> 9255 Add missing CTI source to the build system on Qt-port 9256 9257 * JavaScriptCore.pri: 9258 92592008-11-17 Geoffrey Garen <ggaren@apple.com> 9260 9261 Not reviewed. 9262 9263 Try to fix JSGlue build. 9264 9265 * JavaScriptCore.xcodeproj/project.pbxproj: 9266 92672008-11-17 Geoffrey Garen <ggaren@apple.com> 9268 9269 Not reviewed. 9270 9271 Try to fix Qt build. 9272 9273 * jsc.pro: 9274 92752008-11-17 Geoffrey Garen <ggaren@apple.com> 9276 9277 Not reviewed. 9278 9279 Try to fix Qt build. 9280 9281 * JavaScriptCore.pri: 9282 92832008-11-17 Geoffrey Garen <ggaren@apple.com> 9284 9285 Not reviewed. 9286 9287 Try to fix Qt build. 9288 9289 * JavaScriptCore.pri: 9290 92912008-11-17 Geoffrey Garen <ggaren@apple.com> 9292 9293 Reviewed by Sam Weinig. 9294 9295 More file moves: 9296 9297 VM/CodeBlock.* => bytecode/CodeBlock.* 9298 VM/EvalCodeCache.h => bytecode/EvalCodeCache.h 9299 VM/Instruction.h => bytecode/Instruction.h 9300 VM/Opcode.* => bytecode/Opcode.* 9301 9302 * GNUmakefile.am: 9303 * JavaScriptCore.scons: 9304 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9305 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 9306 * JavaScriptCore.xcodeproj/project.pbxproj: 9307 * JavaScriptCoreSources.bkl: 9308 * VM/CodeBlock.cpp: Removed. 9309 * VM/CodeBlock.h: Removed. 9310 * VM/EvalCodeCache.h: Removed. 9311 * VM/Instruction.h: Removed. 9312 * VM/Opcode.cpp: Removed. 9313 * VM/Opcode.h: Removed. 9314 * bytecode: Added. 9315 * bytecode/CodeBlock.cpp: Copied from VM/CodeBlock.cpp. 9316 * bytecode/CodeBlock.h: Copied from VM/CodeBlock.h. 9317 * bytecode/EvalCodeCache.h: Copied from VM/EvalCodeCache.h. 9318 * bytecode/Instruction.h: Copied from VM/Instruction.h. 9319 * bytecode/Opcode.cpp: Copied from VM/Opcode.cpp. 9320 * bytecode/Opcode.h: Copied from VM/Opcode.h. 9321 * jsc.pro: 9322 * jscore.bkl: 9323 93242008-11-17 Geoffrey Garen <ggaren@apple.com> 9325 9326 Not reviewed. 9327 9328 Try to fix a few more builds. 9329 9330 * GNUmakefile.am: 9331 * JavaScriptCore.pri: 9332 * JavaScriptCore.scons: 9333 * JavaScriptCoreSources.bkl: 9334 93352008-11-17 Geoffrey Garen <ggaren@apple.com> 9336 9337 Not reviewed. 9338 9339 Try to fix gtk build. 9340 9341 * GNUmakefile.am: 9342 93432008-11-17 Geoffrey Garen <ggaren@apple.com> 9344 9345 Not reviewed. 9346 9347 Try to fix Windows build. 9348 9349 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9350 93512008-11-17 Geoffrey Garen <ggaren@apple.com> 9352 9353 Reviewed by Sam Weinig. 9354 9355 Some file moves: 9356 9357 VM/LabelID.h => bytecompiler/Label.h 9358 VM/RegisterID.h => bytecompiler/RegisterID.h 9359 VM/SegmentedVector.h => bytecompiler/SegmentedVector.h 9360 bytecompiler/CodeGenerator.* => bytecompiler/BytecodeGenerator.* 9361 9362 * AllInOneFile.cpp: 9363 * JavaScriptCore.xcodeproj/project.pbxproj: 9364 * VM/LabelID.h: Removed. 9365 * VM/RegisterID.h: Removed. 9366 * VM/SegmentedVector.h: Removed. 9367 * bytecompiler/BytecodeGenerator.cpp: Copied from bytecompiler/CodeGenerator.cpp. 9368 * bytecompiler/BytecodeGenerator.h: Copied from bytecompiler/CodeGenerator.h. 9369 * bytecompiler/CodeGenerator.cpp: Removed. 9370 * bytecompiler/CodeGenerator.h: Removed. 9371 * bytecompiler/Label.h: Copied from VM/LabelID.h. 9372 * bytecompiler/LabelScope.h: 9373 * bytecompiler/RegisterID.h: Copied from VM/RegisterID.h. 9374 * bytecompiler/SegmentedVector.h: Copied from VM/SegmentedVector.h. 9375 * jsc.cpp: 9376 * parser/Nodes.cpp: 9377 93782008-11-17 Geoffrey Garen <ggaren@apple.com> 9379 9380 Not reviewed. 9381 9382 Try to fix Windows build. 9383 9384 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9385 93862008-11-17 Geoffrey Garen <ggaren@apple.com> 9387 9388 Not reviewed. 9389 9390 Try to fix Windows build. 9391 9392 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9393 93942008-11-17 Geoffrey Garen <ggaren@apple.com> 9395 9396 Not reviewed. 9397 9398 Try to fix Windows build. 9399 9400 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9401 94022008-11-16 Geoffrey Garen <ggaren@apple.com> 9403 9404 Not reviewed. 9405 9406 Try to fix Windows build. 9407 9408 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 9409 94102008-11-16 Geoffrey Garen <ggaren@apple.com> 9411 9412 Not reviewed. 9413 9414 Try to fix Windows build. 9415 9416 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 9417 94182008-11-16 Geoffrey Garen <ggaren@apple.com> 9419 9420 Reviewed by Sam Weinig. 9421 9422 Moved masm => assembler and split "AssemblerBuffer.h" out of "X86Assembler.h". 9423 9424 Also renamed ENABLE_MASM to ENABLE_ASSEMBLER. 9425 9426 * GNUmakefile.am: 9427 * JavaScriptCore.xcodeproj/project.pbxproj: 9428 * assembler: Added. 9429 * assembler/AssemblerBuffer.h: Copied from masm/X86Assembler.h. 9430 (JSC::AssemblerBuffer::AssemblerBuffer): 9431 (JSC::AssemblerBuffer::~AssemblerBuffer): 9432 (JSC::AssemblerBuffer::ensureSpace): 9433 (JSC::AssemblerBuffer::isAligned): 9434 (JSC::AssemblerBuffer::putByteUnchecked): 9435 (JSC::AssemblerBuffer::putByte): 9436 (JSC::AssemblerBuffer::putShortUnchecked): 9437 (JSC::AssemblerBuffer::putShort): 9438 (JSC::AssemblerBuffer::putIntUnchecked): 9439 (JSC::AssemblerBuffer::putInt): 9440 (JSC::AssemblerBuffer::data): 9441 (JSC::AssemblerBuffer::size): 9442 (JSC::AssemblerBuffer::reset): 9443 (JSC::AssemblerBuffer::executableCopy): 9444 (JSC::AssemblerBuffer::grow): 9445 * assembler/X86Assembler.h: Copied from masm/X86Assembler.h. 9446 * masm: Removed. 9447 * masm/X86Assembler.h: Removed. 9448 * wtf/Platform.h: 9449 94502008-11-16 Geoffrey Garen <ggaren@apple.com> 9451 9452 Not reviewed. 9453 9454 Try to fix gtk build. 9455 9456 * GNUmakefile.am: 9457 94582008-11-16 Geoffrey Garen <ggaren@apple.com> 9459 9460 Not reviewed. 9461 9462 Fixed tyop. 9463 9464 * VM/CTI.cpp: 9465 94662008-11-16 Geoffrey Garen <ggaren@apple.com> 9467 9468 Not reviewed. 9469 9470 Try to fix windows build. 9471 9472 * VM/CTI.cpp: 9473 94742008-11-16 Geoffrey Garen <ggaren@apple.com> 9475 9476 Not reviewed. 9477 9478 Try to fix gtk build. 9479 9480 * GNUmakefile.am: 9481 94822008-11-16 Geoffrey Garen <ggaren@apple.com> 9483 9484 Reviewed by Sam Weinig. 9485 9486 Renamed ENABLE_CTI and ENABLE(CTI) to ENABLE_JIT and ENABLE(JIT). 9487 9488 * VM/CTI.cpp: 9489 * VM/CTI.h: 9490 * VM/CodeBlock.cpp: 9491 (JSC::CodeBlock::~CodeBlock): 9492 * VM/CodeBlock.h: 9493 (JSC::CodeBlock::CodeBlock): 9494 * VM/Machine.cpp: 9495 (JSC::Interpreter::Interpreter): 9496 (JSC::Interpreter::initialize): 9497 (JSC::Interpreter::~Interpreter): 9498 (JSC::Interpreter::execute): 9499 (JSC::Interpreter::privateExecute): 9500 * VM/Machine.h: 9501 * bytecompiler/CodeGenerator.cpp: 9502 (JSC::prepareJumpTableForStringSwitch): 9503 * runtime/JSFunction.cpp: 9504 (JSC::JSFunction::~JSFunction): 9505 * runtime/JSGlobalData.h: 9506 * wrec/WREC.h: 9507 * wtf/Platform.h: 9508 * wtf/TCSystemAlloc.cpp: 9509 95102008-11-16 Geoffrey Garen <ggaren@apple.com> 9511 9512 Not reviewed. 9513 9514 Try to fix gtk build. 9515 9516 * VM/CTI.cpp: 9517 95182008-11-16 Geoffrey Garen <ggaren@apple.com> 9519 9520 Reviewed by a few people on squirrelfish-dev. 9521 9522 Renamed CTI => JIT. 9523 9524 * VM/CTI.cpp: 9525 (JSC::JIT::killLastResultRegister): 9526 (JSC::JIT::emitGetVirtualRegister): 9527 (JSC::JIT::emitGetVirtualRegisters): 9528 (JSC::JIT::emitPutCTIArgFromVirtualRegister): 9529 (JSC::JIT::emitPutCTIArg): 9530 (JSC::JIT::emitGetCTIArg): 9531 (JSC::JIT::emitPutCTIArgConstant): 9532 (JSC::JIT::getConstantImmediateNumericArg): 9533 (JSC::JIT::emitPutCTIParam): 9534 (JSC::JIT::emitGetCTIParam): 9535 (JSC::JIT::emitPutToCallFrameHeader): 9536 (JSC::JIT::emitGetFromCallFrameHeader): 9537 (JSC::JIT::emitPutVirtualRegister): 9538 (JSC::JIT::emitInitRegister): 9539 (JSC::JIT::printBytecodeOperandTypes): 9540 (JSC::JIT::emitAllocateNumber): 9541 (JSC::JIT::emitNakedCall): 9542 (JSC::JIT::emitNakedFastCall): 9543 (JSC::JIT::emitCTICall): 9544 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 9545 (JSC::JIT::linkSlowCaseIfNotJSCell): 9546 (JSC::JIT::emitJumpSlowCaseIfNotImmNum): 9547 (JSC::JIT::emitJumpSlowCaseIfNotImmNums): 9548 (JSC::JIT::getDeTaggedConstantImmediate): 9549 (JSC::JIT::emitFastArithDeTagImmediate): 9550 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): 9551 (JSC::JIT::emitFastArithReTagImmediate): 9552 (JSC::JIT::emitFastArithPotentiallyReTagImmediate): 9553 (JSC::JIT::emitFastArithImmToInt): 9554 (JSC::JIT::emitFastArithIntToImmOrSlowCase): 9555 (JSC::JIT::emitFastArithIntToImmNoCheck): 9556 (JSC::JIT::emitArithIntToImmWithJump): 9557 (JSC::JIT::emitTagAsBoolImmediate): 9558 (JSC::JIT::JIT): 9559 (JSC::JIT::compileOpCallInitializeCallFrame): 9560 (JSC::JIT::compileOpCallSetupArgs): 9561 (JSC::JIT::compileOpCallEvalSetupArgs): 9562 (JSC::JIT::compileOpConstructSetupArgs): 9563 (JSC::JIT::compileOpCall): 9564 (JSC::JIT::compileOpStrictEq): 9565 (JSC::JIT::emitSlowScriptCheck): 9566 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate): 9567 (JSC::JIT::compileBinaryArithOp): 9568 (JSC::JIT::compileBinaryArithOpSlowCase): 9569 (JSC::JIT::privateCompileMainPass): 9570 (JSC::JIT::privateCompileLinkPass): 9571 (JSC::JIT::privateCompileSlowCases): 9572 (JSC::JIT::privateCompile): 9573 (JSC::JIT::privateCompileGetByIdSelf): 9574 (JSC::JIT::privateCompileGetByIdProto): 9575 (JSC::JIT::privateCompileGetByIdChain): 9576 (JSC::JIT::privateCompilePutByIdReplace): 9577 (JSC::JIT::privateCompilePutByIdTransition): 9578 (JSC::JIT::unlinkCall): 9579 (JSC::JIT::linkCall): 9580 (JSC::JIT::privateCompileCTIMachineTrampolines): 9581 (JSC::JIT::freeCTIMachineTrampolines): 9582 (JSC::JIT::patchGetByIdSelf): 9583 (JSC::JIT::patchPutByIdReplace): 9584 (JSC::JIT::privateCompilePatchGetArrayLength): 9585 (JSC::JIT::emitGetVariableObjectRegister): 9586 (JSC::JIT::emitPutVariableObjectRegister): 9587 * VM/CTI.h: 9588 (JSC::JIT::compile): 9589 (JSC::JIT::compileGetByIdSelf): 9590 (JSC::JIT::compileGetByIdProto): 9591 (JSC::JIT::compileGetByIdChain): 9592 (JSC::JIT::compilePutByIdReplace): 9593 (JSC::JIT::compilePutByIdTransition): 9594 (JSC::JIT::compileCTIMachineTrampolines): 9595 (JSC::JIT::compilePatchGetArrayLength): 9596 * VM/CodeBlock.cpp: 9597 (JSC::CodeBlock::unlinkCallers): 9598 * VM/Machine.cpp: 9599 (JSC::Interpreter::initialize): 9600 (JSC::Interpreter::~Interpreter): 9601 (JSC::Interpreter::execute): 9602 (JSC::Interpreter::tryCTICachePutByID): 9603 (JSC::Interpreter::tryCTICacheGetByID): 9604 (JSC::Interpreter::cti_op_call_JSFunction): 9605 (JSC::Interpreter::cti_vm_dontLazyLinkCall): 9606 (JSC::Interpreter::cti_vm_lazyLinkCall): 9607 * VM/Machine.h: 9608 * VM/RegisterFile.h: 9609 * parser/Nodes.h: 9610 * runtime/JSArray.h: 9611 * runtime/JSCell.h: 9612 * runtime/JSFunction.h: 9613 * runtime/JSImmediate.h: 9614 * runtime/JSNumberCell.h: 9615 * runtime/JSObject.h: 9616 * runtime/JSString.h: 9617 * runtime/JSVariableObject.h: 9618 * runtime/ScopeChain.h: 9619 * runtime/Structure.h: 9620 * runtime/TypeInfo.h: 9621 * runtime/UString.h: 9622 96232008-11-16 Geoffrey Garen <ggaren@apple.com> 9624 9625 Not reviewed. 9626 9627 Try to fix wx build. 9628 9629 * jscore.bkl: 9630 96312008-11-16 Geoffrey Garen <ggaren@apple.com> 9632 9633 Reviewed by Sam Weinig. 9634 9635 Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs. 9636 9637 * VM/CTI.cpp: 9638 (JSC::CTI::emitGetVirtualRegister): 9639 (JSC::CTI::emitGetVirtualRegisters): 9640 (JSC::CTI::emitPutCTIArgFromVirtualRegister): 9641 (JSC::CTI::emitPutCTIArg): 9642 (JSC::CTI::emitGetCTIArg): 9643 (JSC::CTI::emitPutCTIParam): 9644 (JSC::CTI::emitGetCTIParam): 9645 (JSC::CTI::emitPutToCallFrameHeader): 9646 (JSC::CTI::emitGetFromCallFrameHeader): 9647 (JSC::CTI::emitPutVirtualRegister): 9648 (JSC::CTI::emitNakedCall): 9649 (JSC::CTI::emitNakedFastCall): 9650 (JSC::CTI::emitCTICall): 9651 (JSC::CTI::emitJumpSlowCaseIfNotJSCell): 9652 (JSC::CTI::emitJumpSlowCaseIfNotImmNum): 9653 (JSC::CTI::emitJumpSlowCaseIfNotImmNums): 9654 (JSC::CTI::emitFastArithDeTagImmediate): 9655 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero): 9656 (JSC::CTI::emitFastArithReTagImmediate): 9657 (JSC::CTI::emitFastArithPotentiallyReTagImmediate): 9658 (JSC::CTI::emitFastArithImmToInt): 9659 (JSC::CTI::emitFastArithIntToImmOrSlowCase): 9660 (JSC::CTI::emitFastArithIntToImmNoCheck): 9661 (JSC::CTI::emitArithIntToImmWithJump): 9662 (JSC::CTI::emitTagAsBoolImmediate): 9663 (JSC::CTI::compileOpCall): 9664 (JSC::CTI::compileOpStrictEq): 9665 (JSC::CTI::emitSlowScriptCheck): 9666 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): 9667 (JSC::CTI::compileBinaryArithOp): 9668 (JSC::CTI::compileBinaryArithOpSlowCase): 9669 (JSC::CTI::privateCompileMainPass): 9670 (JSC::CTI::privateCompileSlowCases): 9671 (JSC::CTI::privateCompile): 9672 (JSC::CTI::privateCompileGetByIdSelf): 9673 (JSC::CTI::privateCompileGetByIdProto): 9674 (JSC::CTI::privateCompileGetByIdChain): 9675 (JSC::CTI::privateCompilePutByIdReplace): 9676 (JSC::CTI::privateCompilePutByIdTransition): 9677 (JSC::CTI::privateCompileCTIMachineTrampolines): 9678 (JSC::CTI::privateCompilePatchGetArrayLength): 9679 (JSC::CTI::emitGetVariableObjectRegister): 9680 (JSC::CTI::emitPutVariableObjectRegister): 9681 * VM/CTI.h: 9682 (JSC::CallRecord::CallRecord): 9683 (JSC::JmpTable::JmpTable): 9684 (JSC::SlowCaseEntry::SlowCaseEntry): 9685 (JSC::CTI::JSRInfo::JSRInfo): 9686 * wrec/WREC.h: 9687 96882008-11-16 Geoffrey Garen <ggaren@apple.com> 9689 9690 Not reviewed. 9691 9692 Try to fix Qt build. 9693 9694 * JavaScriptCore.pri: 9695 96962008-11-16 Geoffrey Garen <ggaren@apple.com> 9697 9698 Reviewed by Sam Weinig. 9699 9700 Renamed OBJECT_OFFSET => FIELD_OFFSET 9701 9702 Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in 9703 more places. 9704 9705 * VM/CTI.cpp: 9706 (JSC::CTI::compileOpCallInitializeCallFrame): 9707 (JSC::CTI::compileOpCall): 9708 (JSC::CTI::emitSlowScriptCheck): 9709 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): 9710 (JSC::CTI::compileBinaryArithOp): 9711 (JSC::CTI::privateCompileMainPass): 9712 (JSC::CTI::privateCompileSlowCases): 9713 (JSC::CTI::privateCompile): 9714 (JSC::CTI::privateCompileGetByIdSelf): 9715 (JSC::CTI::privateCompileGetByIdProto): 9716 (JSC::CTI::privateCompileGetByIdChain): 9717 (JSC::CTI::privateCompilePutByIdReplace): 9718 (JSC::CTI::privateCompilePutByIdTransition): 9719 (JSC::CTI::privateCompileCTIMachineTrampolines): 9720 (JSC::CTI::privateCompilePatchGetArrayLength): 9721 (JSC::CTI::emitGetVariableObjectRegister): 9722 (JSC::CTI::emitPutVariableObjectRegister): 9723 * runtime/JSValue.h: 9724 * runtime/JSVariableObject.h: 9725 97262008-11-16 Geoffrey Garen <ggaren@apple.com> 9727 9728 Reviewed by Sam Weinig. 9729 9730 Renames: 9731 9732 X86Assembler::copy => X86Assembler::executableCopy 9733 AssemblerBuffer::copy => AssemblerBuffer::executableCopy 9734 9735 * VM/CTI.cpp: 9736 (JSC::CTI::privateCompile): 9737 (JSC::CTI::privateCompileGetByIdSelf): 9738 (JSC::CTI::privateCompileGetByIdProto): 9739 (JSC::CTI::privateCompileGetByIdChain): 9740 (JSC::CTI::privateCompilePutByIdReplace): 9741 (JSC::CTI::privateCompilePutByIdTransition): 9742 (JSC::CTI::privateCompileCTIMachineTrampolines): 9743 (JSC::CTI::privateCompilePatchGetArrayLength): 9744 * masm/X86Assembler.h: 9745 (JSC::AssemblerBuffer::executableCopy): 9746 (JSC::X86Assembler::executableCopy): 9747 * wrec/WREC.cpp: 9748 (JSC::WREC::compileRegExp): 9749 97502008-11-16 Geoffrey Garen <ggaren@apple.com> 9751 9752 Reviewed by Sam Weinig. 9753 9754 Renamed WREC => JSC::WREC, removing JSC:: prefix in a lot of places. 9755 Renamed WRECFunction => WREC::CompiledRegExp, and deployed this type 9756 name in place of a few casts. 9757 9758 * runtime/RegExp.cpp: 9759 (JSC::RegExp::RegExp): 9760 (JSC::RegExp::~RegExp): 9761 (JSC::RegExp::match): 9762 * runtime/RegExp.h: 9763 * wrec/CharacterClassConstructor.cpp: 9764 * wrec/CharacterClassConstructor.h: 9765 * wrec/WREC.cpp: 9766 (JSC::WREC::compileRegExp): 9767 * wrec/WREC.h: 9768 (JSC::WREC::Generator::Generator): 9769 (JSC::WREC::Parser::Parser): 9770 (JSC::WREC::Parser::parseAlternative): 9771 97722008-11-16 Geoffrey Garen <ggaren@apple.com> 9773 9774 Reviewed by Sam Weinig. 9775 9776 Renamed BytecodeInterpreter => Interpreter. 9777 9778 * JavaScriptCore.exp: 9779 * VM/CTI.cpp: 9780 (JSC::): 9781 (JSC::CTI::compileOpCall): 9782 (JSC::CTI::emitSlowScriptCheck): 9783 (JSC::CTI::compileBinaryArithOpSlowCase): 9784 (JSC::CTI::privateCompileMainPass): 9785 (JSC::CTI::privateCompileSlowCases): 9786 (JSC::CTI::privateCompile): 9787 (JSC::CTI::privateCompileGetByIdSelf): 9788 (JSC::CTI::privateCompileGetByIdProto): 9789 (JSC::CTI::privateCompileGetByIdChain): 9790 (JSC::CTI::privateCompilePutByIdReplace): 9791 (JSC::CTI::privateCompilePutByIdTransition): 9792 (JSC::CTI::privateCompileCTIMachineTrampolines): 9793 (JSC::CTI::freeCTIMachineTrampolines): 9794 (JSC::CTI::patchGetByIdSelf): 9795 (JSC::CTI::patchPutByIdReplace): 9796 (JSC::CTI::privateCompilePatchGetArrayLength): 9797 * VM/CTI.h: 9798 * VM/CodeBlock.cpp: 9799 (JSC::CodeBlock::printStructures): 9800 (JSC::CodeBlock::derefStructures): 9801 (JSC::CodeBlock::refStructures): 9802 * VM/Machine.cpp: 9803 (JSC::jsLess): 9804 (JSC::jsLessEq): 9805 (JSC::Interpreter::resolve): 9806 (JSC::Interpreter::resolveSkip): 9807 (JSC::Interpreter::resolveGlobal): 9808 (JSC::Interpreter::resolveBase): 9809 (JSC::Interpreter::resolveBaseAndProperty): 9810 (JSC::Interpreter::resolveBaseAndFunc): 9811 (JSC::Interpreter::slideRegisterWindowForCall): 9812 (JSC::Interpreter::callEval): 9813 (JSC::Interpreter::Interpreter): 9814 (JSC::Interpreter::initialize): 9815 (JSC::Interpreter::~Interpreter): 9816 (JSC::Interpreter::dumpCallFrame): 9817 (JSC::Interpreter::dumpRegisters): 9818 (JSC::Interpreter::isOpcode): 9819 (JSC::Interpreter::unwindCallFrame): 9820 (JSC::Interpreter::throwException): 9821 (JSC::Interpreter::execute): 9822 (JSC::Interpreter::debug): 9823 (JSC::Interpreter::resetTimeoutCheck): 9824 (JSC::Interpreter::checkTimeout): 9825 (JSC::Interpreter::createExceptionScope): 9826 (JSC::Interpreter::tryCachePutByID): 9827 (JSC::Interpreter::uncachePutByID): 9828 (JSC::Interpreter::tryCacheGetByID): 9829 (JSC::Interpreter::uncacheGetByID): 9830 (JSC::Interpreter::privateExecute): 9831 (JSC::Interpreter::retrieveArguments): 9832 (JSC::Interpreter::retrieveCaller): 9833 (JSC::Interpreter::retrieveLastCaller): 9834 (JSC::Interpreter::findFunctionCallFrame): 9835 (JSC::Interpreter::tryCTICachePutByID): 9836 (JSC::Interpreter::tryCTICacheGetByID): 9837 (JSC::Interpreter::cti_op_convert_this): 9838 (JSC::Interpreter::cti_op_end): 9839 (JSC::Interpreter::cti_op_add): 9840 (JSC::Interpreter::cti_op_pre_inc): 9841 (JSC::Interpreter::cti_timeout_check): 9842 (JSC::Interpreter::cti_register_file_check): 9843 (JSC::Interpreter::cti_op_loop_if_less): 9844 (JSC::Interpreter::cti_op_loop_if_lesseq): 9845 (JSC::Interpreter::cti_op_new_object): 9846 (JSC::Interpreter::cti_op_put_by_id): 9847 (JSC::Interpreter::cti_op_put_by_id_second): 9848 (JSC::Interpreter::cti_op_put_by_id_generic): 9849 (JSC::Interpreter::cti_op_put_by_id_fail): 9850 (JSC::Interpreter::cti_op_get_by_id): 9851 (JSC::Interpreter::cti_op_get_by_id_second): 9852 (JSC::Interpreter::cti_op_get_by_id_generic): 9853 (JSC::Interpreter::cti_op_get_by_id_fail): 9854 (JSC::Interpreter::cti_op_instanceof): 9855 (JSC::Interpreter::cti_op_del_by_id): 9856 (JSC::Interpreter::cti_op_mul): 9857 (JSC::Interpreter::cti_op_new_func): 9858 (JSC::Interpreter::cti_op_call_JSFunction): 9859 (JSC::Interpreter::cti_op_call_arityCheck): 9860 (JSC::Interpreter::cti_vm_dontLazyLinkCall): 9861 (JSC::Interpreter::cti_vm_lazyLinkCall): 9862 (JSC::Interpreter::cti_op_push_activation): 9863 (JSC::Interpreter::cti_op_call_NotJSFunction): 9864 (JSC::Interpreter::cti_op_create_arguments): 9865 (JSC::Interpreter::cti_op_create_arguments_no_params): 9866 (JSC::Interpreter::cti_op_tear_off_activation): 9867 (JSC::Interpreter::cti_op_tear_off_arguments): 9868 (JSC::Interpreter::cti_op_profile_will_call): 9869 (JSC::Interpreter::cti_op_profile_did_call): 9870 (JSC::Interpreter::cti_op_ret_scopeChain): 9871 (JSC::Interpreter::cti_op_new_array): 9872 (JSC::Interpreter::cti_op_resolve): 9873 (JSC::Interpreter::cti_op_construct_JSConstruct): 9874 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 9875 (JSC::Interpreter::cti_op_get_by_val): 9876 (JSC::Interpreter::cti_op_resolve_func): 9877 (JSC::Interpreter::cti_op_sub): 9878 (JSC::Interpreter::cti_op_put_by_val): 9879 (JSC::Interpreter::cti_op_put_by_val_array): 9880 (JSC::Interpreter::cti_op_lesseq): 9881 (JSC::Interpreter::cti_op_loop_if_true): 9882 (JSC::Interpreter::cti_op_negate): 9883 (JSC::Interpreter::cti_op_resolve_base): 9884 (JSC::Interpreter::cti_op_resolve_skip): 9885 (JSC::Interpreter::cti_op_resolve_global): 9886 (JSC::Interpreter::cti_op_div): 9887 (JSC::Interpreter::cti_op_pre_dec): 9888 (JSC::Interpreter::cti_op_jless): 9889 (JSC::Interpreter::cti_op_not): 9890 (JSC::Interpreter::cti_op_jtrue): 9891 (JSC::Interpreter::cti_op_post_inc): 9892 (JSC::Interpreter::cti_op_eq): 9893 (JSC::Interpreter::cti_op_lshift): 9894 (JSC::Interpreter::cti_op_bitand): 9895 (JSC::Interpreter::cti_op_rshift): 9896 (JSC::Interpreter::cti_op_bitnot): 9897 (JSC::Interpreter::cti_op_resolve_with_base): 9898 (JSC::Interpreter::cti_op_new_func_exp): 9899 (JSC::Interpreter::cti_op_mod): 9900 (JSC::Interpreter::cti_op_less): 9901 (JSC::Interpreter::cti_op_neq): 9902 (JSC::Interpreter::cti_op_post_dec): 9903 (JSC::Interpreter::cti_op_urshift): 9904 (JSC::Interpreter::cti_op_bitxor): 9905 (JSC::Interpreter::cti_op_new_regexp): 9906 (JSC::Interpreter::cti_op_bitor): 9907 (JSC::Interpreter::cti_op_call_eval): 9908 (JSC::Interpreter::cti_op_throw): 9909 (JSC::Interpreter::cti_op_get_pnames): 9910 (JSC::Interpreter::cti_op_next_pname): 9911 (JSC::Interpreter::cti_op_push_scope): 9912 (JSC::Interpreter::cti_op_pop_scope): 9913 (JSC::Interpreter::cti_op_typeof): 9914 (JSC::Interpreter::cti_op_is_undefined): 9915 (JSC::Interpreter::cti_op_is_boolean): 9916 (JSC::Interpreter::cti_op_is_number): 9917 (JSC::Interpreter::cti_op_is_string): 9918 (JSC::Interpreter::cti_op_is_object): 9919 (JSC::Interpreter::cti_op_is_function): 9920 (JSC::Interpreter::cti_op_stricteq): 9921 (JSC::Interpreter::cti_op_nstricteq): 9922 (JSC::Interpreter::cti_op_to_jsnumber): 9923 (JSC::Interpreter::cti_op_in): 9924 (JSC::Interpreter::cti_op_push_new_scope): 9925 (JSC::Interpreter::cti_op_jmp_scopes): 9926 (JSC::Interpreter::cti_op_put_by_index): 9927 (JSC::Interpreter::cti_op_switch_imm): 9928 (JSC::Interpreter::cti_op_switch_char): 9929 (JSC::Interpreter::cti_op_switch_string): 9930 (JSC::Interpreter::cti_op_del_by_val): 9931 (JSC::Interpreter::cti_op_put_getter): 9932 (JSC::Interpreter::cti_op_put_setter): 9933 (JSC::Interpreter::cti_op_new_error): 9934 (JSC::Interpreter::cti_op_debug): 9935 (JSC::Interpreter::cti_vm_throw): 9936 * VM/Machine.h: 9937 * VM/Register.h: 9938 * VM/SamplingTool.h: 9939 (JSC::SamplingTool::SamplingTool): 9940 * bytecompiler/CodeGenerator.cpp: 9941 (JSC::BytecodeGenerator::generate): 9942 (JSC::BytecodeGenerator::BytecodeGenerator): 9943 * jsc.cpp: 9944 (runWithScripts): 9945 * runtime/ExecState.h: 9946 (JSC::ExecState::interpreter): 9947 * runtime/JSCell.h: 9948 * runtime/JSFunction.h: 9949 * runtime/JSGlobalData.cpp: 9950 (JSC::JSGlobalData::JSGlobalData): 9951 * runtime/JSGlobalData.h: 9952 * runtime/JSString.h: 9953 * wrec/WREC.cpp: 9954 (WREC::compileRegExp): 9955 * wrec/WREC.h: 9956 99572008-11-16 Geoffrey Garen <ggaren@apple.com> 9958 9959 Roll out r38461 (my last patch) because it broke the world. 9960 99612008-11-16 Geoffrey Garen <ggaren@apple.com> 9962 9963 Reviewed by Sam Weinig. 9964 9965 A few more renames: 9966 9967 BytecodeInterpreter => Interpreter 9968 WREC => JSC::WREC, removing JSC:: prefix in a lot of places 9969 X86Assembler::copy => X86Assembler::executableCopy 9970 AssemblerBuffer::copy => AssemblerBuffer::executableCopy 9971 WRECFunction => WREC::RegExpFunction 9972 OBJECT_OFFSET => FIELD_OFFSET 9973 9974 Also: 9975 9976 Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in more places. 9977 Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs 9978 9979 * JavaScriptCore.exp: 9980 * VM/CTI.cpp: 9981 (JSC::): 9982 (JSC::CTI::emitGetVirtualRegister): 9983 (JSC::CTI::emitGetVirtualRegisters): 9984 (JSC::CTI::emitPutCTIArgFromVirtualRegister): 9985 (JSC::CTI::emitPutCTIArg): 9986 (JSC::CTI::emitGetCTIArg): 9987 (JSC::CTI::emitPutCTIParam): 9988 (JSC::CTI::emitGetCTIParam): 9989 (JSC::CTI::emitPutToCallFrameHeader): 9990 (JSC::CTI::emitGetFromCallFrameHeader): 9991 (JSC::CTI::emitPutVirtualRegister): 9992 (JSC::CTI::emitNakedCall): 9993 (JSC::CTI::emitNakedFastCall): 9994 (JSC::CTI::emitCTICall): 9995 (JSC::CTI::emitJumpSlowCaseIfNotJSCell): 9996 (JSC::CTI::emitJumpSlowCaseIfNotImmNum): 9997 (JSC::CTI::emitJumpSlowCaseIfNotImmNums): 9998 (JSC::CTI::emitFastArithDeTagImmediate): 9999 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero): 10000 (JSC::CTI::emitFastArithReTagImmediate): 10001 (JSC::CTI::emitFastArithPotentiallyReTagImmediate): 10002 (JSC::CTI::emitFastArithImmToInt): 10003 (JSC::CTI::emitFastArithIntToImmOrSlowCase): 10004 (JSC::CTI::emitFastArithIntToImmNoCheck): 10005 (JSC::CTI::emitArithIntToImmWithJump): 10006 (JSC::CTI::emitTagAsBoolImmediate): 10007 (JSC::CTI::compileOpCallInitializeCallFrame): 10008 (JSC::CTI::compileOpCall): 10009 (JSC::CTI::compileOpStrictEq): 10010 (JSC::CTI::emitSlowScriptCheck): 10011 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): 10012 (JSC::CTI::compileBinaryArithOp): 10013 (JSC::CTI::compileBinaryArithOpSlowCase): 10014 (JSC::CTI::privateCompileMainPass): 10015 (JSC::CTI::privateCompileSlowCases): 10016 (JSC::CTI::privateCompile): 10017 (JSC::CTI::privateCompileGetByIdSelf): 10018 (JSC::CTI::privateCompileGetByIdProto): 10019 (JSC::CTI::privateCompileGetByIdChain): 10020 (JSC::CTI::privateCompilePutByIdReplace): 10021 (JSC::CTI::privateCompilePutByIdTransition): 10022 (JSC::CTI::privateCompileCTIMachineTrampolines): 10023 (JSC::CTI::freeCTIMachineTrampolines): 10024 (JSC::CTI::patchGetByIdSelf): 10025 (JSC::CTI::patchPutByIdReplace): 10026 (JSC::CTI::privateCompilePatchGetArrayLength): 10027 (JSC::CTI::emitGetVariableObjectRegister): 10028 (JSC::CTI::emitPutVariableObjectRegister): 10029 * VM/CTI.h: 10030 (JSC::CallRecord::CallRecord): 10031 (JSC::JmpTable::JmpTable): 10032 (JSC::SlowCaseEntry::SlowCaseEntry): 10033 (JSC::CTI::JSRInfo::JSRInfo): 10034 * VM/CodeBlock.cpp: 10035 (JSC::CodeBlock::printStructures): 10036 (JSC::CodeBlock::derefStructures): 10037 (JSC::CodeBlock::refStructures): 10038 * VM/Machine.cpp: 10039 (JSC::jsLess): 10040 (JSC::jsLessEq): 10041 (JSC::Interpreter::resolve): 10042 (JSC::Interpreter::resolveSkip): 10043 (JSC::Interpreter::resolveGlobal): 10044 (JSC::Interpreter::resolveBase): 10045 (JSC::Interpreter::resolveBaseAndProperty): 10046 (JSC::Interpreter::resolveBaseAndFunc): 10047 (JSC::Interpreter::slideRegisterWindowForCall): 10048 (JSC::Interpreter::callEval): 10049 (JSC::Interpreter::Interpreter): 10050 (JSC::Interpreter::initialize): 10051 (JSC::Interpreter::~Interpreter): 10052 (JSC::Interpreter::dumpCallFrame): 10053 (JSC::Interpreter::dumpRegisters): 10054 (JSC::Interpreter::isOpcode): 10055 (JSC::Interpreter::unwindCallFrame): 10056 (JSC::Interpreter::throwException): 10057 (JSC::Interpreter::execute): 10058 (JSC::Interpreter::debug): 10059 (JSC::Interpreter::resetTimeoutCheck): 10060 (JSC::Interpreter::checkTimeout): 10061 (JSC::Interpreter::createExceptionScope): 10062 (JSC::Interpreter::tryCachePutByID): 10063 (JSC::Interpreter::uncachePutByID): 10064 (JSC::Interpreter::tryCacheGetByID): 10065 (JSC::Interpreter::uncacheGetByID): 10066 (JSC::Interpreter::privateExecute): 10067 (JSC::Interpreter::retrieveArguments): 10068 (JSC::Interpreter::retrieveCaller): 10069 (JSC::Interpreter::retrieveLastCaller): 10070 (JSC::Interpreter::findFunctionCallFrame): 10071 (JSC::Interpreter::tryCTICachePutByID): 10072 (JSC::Interpreter::tryCTICacheGetByID): 10073 (JSC::): 10074 (JSC::Interpreter::cti_op_convert_this): 10075 (JSC::Interpreter::cti_op_end): 10076 (JSC::Interpreter::cti_op_add): 10077 (JSC::Interpreter::cti_op_pre_inc): 10078 (JSC::Interpreter::cti_timeout_check): 10079 (JSC::Interpreter::cti_register_file_check): 10080 (JSC::Interpreter::cti_op_loop_if_less): 10081 (JSC::Interpreter::cti_op_loop_if_lesseq): 10082 (JSC::Interpreter::cti_op_new_object): 10083 (JSC::Interpreter::cti_op_put_by_id): 10084 (JSC::Interpreter::cti_op_put_by_id_second): 10085 (JSC::Interpreter::cti_op_put_by_id_generic): 10086 (JSC::Interpreter::cti_op_put_by_id_fail): 10087 (JSC::Interpreter::cti_op_get_by_id): 10088 (JSC::Interpreter::cti_op_get_by_id_second): 10089 (JSC::Interpreter::cti_op_get_by_id_generic): 10090 (JSC::Interpreter::cti_op_get_by_id_fail): 10091 (JSC::Interpreter::cti_op_instanceof): 10092 (JSC::Interpreter::cti_op_del_by_id): 10093 (JSC::Interpreter::cti_op_mul): 10094 (JSC::Interpreter::cti_op_new_func): 10095 (JSC::Interpreter::cti_op_call_JSFunction): 10096 (JSC::Interpreter::cti_op_call_arityCheck): 10097 (JSC::Interpreter::cti_vm_dontLazyLinkCall): 10098 (JSC::Interpreter::cti_vm_lazyLinkCall): 10099 (JSC::Interpreter::cti_op_push_activation): 10100 (JSC::Interpreter::cti_op_call_NotJSFunction): 10101 (JSC::Interpreter::cti_op_create_arguments): 10102 (JSC::Interpreter::cti_op_create_arguments_no_params): 10103 (JSC::Interpreter::cti_op_tear_off_activation): 10104 (JSC::Interpreter::cti_op_tear_off_arguments): 10105 (JSC::Interpreter::cti_op_profile_will_call): 10106 (JSC::Interpreter::cti_op_profile_did_call): 10107 (JSC::Interpreter::cti_op_ret_scopeChain): 10108 (JSC::Interpreter::cti_op_new_array): 10109 (JSC::Interpreter::cti_op_resolve): 10110 (JSC::Interpreter::cti_op_construct_JSConstruct): 10111 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 10112 (JSC::Interpreter::cti_op_get_by_val): 10113 (JSC::Interpreter::cti_op_resolve_func): 10114 (JSC::Interpreter::cti_op_sub): 10115 (JSC::Interpreter::cti_op_put_by_val): 10116 (JSC::Interpreter::cti_op_put_by_val_array): 10117 (JSC::Interpreter::cti_op_lesseq): 10118 (JSC::Interpreter::cti_op_loop_if_true): 10119 (JSC::Interpreter::cti_op_negate): 10120 (JSC::Interpreter::cti_op_resolve_base): 10121 (JSC::Interpreter::cti_op_resolve_skip): 10122 (JSC::Interpreter::cti_op_resolve_global): 10123 (JSC::Interpreter::cti_op_div): 10124 (JSC::Interpreter::cti_op_pre_dec): 10125 (JSC::Interpreter::cti_op_jless): 10126 (JSC::Interpreter::cti_op_not): 10127 (JSC::Interpreter::cti_op_jtrue): 10128 (JSC::Interpreter::cti_op_post_inc): 10129 (JSC::Interpreter::cti_op_eq): 10130 (JSC::Interpreter::cti_op_lshift): 10131 (JSC::Interpreter::cti_op_bitand): 10132 (JSC::Interpreter::cti_op_rshift): 10133 (JSC::Interpreter::cti_op_bitnot): 10134 (JSC::Interpreter::cti_op_resolve_with_base): 10135 (JSC::Interpreter::cti_op_new_func_exp): 10136 (JSC::Interpreter::cti_op_mod): 10137 (JSC::Interpreter::cti_op_less): 10138 (JSC::Interpreter::cti_op_neq): 10139 (JSC::Interpreter::cti_op_post_dec): 10140 (JSC::Interpreter::cti_op_urshift): 10141 (JSC::Interpreter::cti_op_bitxor): 10142 (JSC::Interpreter::cti_op_new_regexp): 10143 (JSC::Interpreter::cti_op_bitor): 10144 (JSC::Interpreter::cti_op_call_eval): 10145 (JSC::Interpreter::cti_op_throw): 10146 (JSC::Interpreter::cti_op_get_pnames): 10147 (JSC::Interpreter::cti_op_next_pname): 10148 (JSC::Interpreter::cti_op_push_scope): 10149 (JSC::Interpreter::cti_op_pop_scope): 10150 (JSC::Interpreter::cti_op_typeof): 10151 (JSC::Interpreter::cti_op_is_undefined): 10152 (JSC::Interpreter::cti_op_is_boolean): 10153 (JSC::Interpreter::cti_op_is_number): 10154 (JSC::Interpreter::cti_op_is_string): 10155 (JSC::Interpreter::cti_op_is_object): 10156 (JSC::Interpreter::cti_op_is_function): 10157 (JSC::Interpreter::cti_op_stricteq): 10158 (JSC::Interpreter::cti_op_nstricteq): 10159 (JSC::Interpreter::cti_op_to_jsnumber): 10160 (JSC::Interpreter::cti_op_in): 10161 (JSC::Interpreter::cti_op_push_new_scope): 10162 (JSC::Interpreter::cti_op_jmp_scopes): 10163 (JSC::Interpreter::cti_op_put_by_index): 10164 (JSC::Interpreter::cti_op_switch_imm): 10165 (JSC::Interpreter::cti_op_switch_char): 10166 (JSC::Interpreter::cti_op_switch_string): 10167 (JSC::Interpreter::cti_op_del_by_val): 10168 (JSC::Interpreter::cti_op_put_getter): 10169 (JSC::Interpreter::cti_op_put_setter): 10170 (JSC::Interpreter::cti_op_new_error): 10171 (JSC::Interpreter::cti_op_debug): 10172 (JSC::Interpreter::cti_vm_throw): 10173 * VM/Machine.h: 10174 * VM/Register.h: 10175 * VM/SamplingTool.cpp: 10176 (JSC::SamplingTool::dump): 10177 * VM/SamplingTool.h: 10178 (JSC::SamplingTool::SamplingTool): 10179 * bytecompiler/CodeGenerator.cpp: 10180 (JSC::BytecodeGenerator::generate): 10181 (JSC::BytecodeGenerator::BytecodeGenerator): 10182 * jsc.cpp: 10183 (runWithScripts): 10184 * masm/X86Assembler.h: 10185 (JSC::AssemblerBuffer::executableCopy): 10186 (JSC::X86Assembler::executableCopy): 10187 * runtime/ExecState.h: 10188 (JSC::ExecState::interpreter): 10189 * runtime/JSCell.h: 10190 * runtime/JSFunction.h: 10191 * runtime/JSGlobalData.cpp: 10192 (JSC::JSGlobalData::JSGlobalData): 10193 * runtime/JSGlobalData.h: 10194 * runtime/JSImmediate.h: 10195 * runtime/JSString.h: 10196 * runtime/JSValue.h: 10197 * runtime/JSVariableObject.h: 10198 * runtime/RegExp.cpp: 10199 (JSC::RegExp::RegExp): 10200 (JSC::RegExp::~RegExp): 10201 (JSC::RegExp::match): 10202 * runtime/RegExp.h: 10203 * wrec/CharacterClassConstructor.cpp: 10204 * wrec/CharacterClassConstructor.h: 10205 * wrec/WREC.cpp: 10206 (JSC::WREC::compileRegExp): 10207 * wrec/WREC.h: 10208 (JSC::WREC::Generator::Generator): 10209 (JSC::WREC::Parser::): 10210 (JSC::WREC::Parser::Parser): 10211 (JSC::WREC::Parser::parseAlternative): 10212 102132008-11-16 Greg Bolsinga <bolsinga@apple.com> 10214 10215 Reviewed by Darin Adler. 10216 10217 https://bugs.webkit.org/show_bug.cgi?id=21810 10218 Remove use of static C++ objects that are destroyed at exit time (destructors) 10219 10220 Conditionally have the DEFINE_STATIC_LOCAL workaround <rdar://problem/6354696> 10221 (Codegen issue with C++ static reference in gcc build 5465) based upon the compiler 10222 build versions. It will use the: 10223 static T& = *new T; 10224 style for all other compilers. 10225 10226 * wtf/StdLibExtras.h: 10227 102282008-11-16 Alexey Proskuryakov <ap@webkit.org> 10229 10230 Reviewed by Dan Bernstein. 10231 10232 https://bugs.webkit.org/show_bug.cgi?id=22290 10233 Remove cross-heap GC and MessagePort multi-threading support 10234 10235 It is broken (and may not be implementable at all), and no longer needed, as we 10236 don't use MessagePorts for communication with workers any more. 10237 10238 * JavaScriptCore.exp: 10239 * runtime/Collector.cpp: 10240 (JSC::Heap::collect): 10241 * runtime/JSGlobalObject.cpp: 10242 * runtime/JSGlobalObject.h: 10243 Remove hooks for cross-heap GC. 10244 102452008-11-15 Sam Weinig <sam@webkit.org> 10246 10247 Reviewed by Cameron Zwarich. 10248 10249 Cleanup jsc command line code a little. 10250 10251 * jsc.cpp: 10252 (functionQuit): 10253 (main): Use standard exit status macros 10254 (cleanupGlobalData): Factor out cleanup code into this function. 10255 (printUsageStatement): Use standard exit status macros. 10256 102572008-11-15 Sam Weinig <sam@webkit.org> 10258 10259 Reviewed by Cameron Zwarich. 10260 10261 Cleanup BytecodeGenerator constructors. 10262 10263 * bytecompiler/CodeGenerator.cpp: 10264 (JSC::BytecodeGenerator::BytecodeGenerator): 10265 * bytecompiler/CodeGenerator.h: 10266 * parser/Nodes.cpp: 10267 (JSC::ProgramNode::generateBytecode): 10268 102692008-11-15 Darin Adler <darin@apple.com> 10270 10271 Rubber stamped by Geoff Garen. 10272 10273 - do the long-planned StructureID -> Structure rename 10274 10275 * API/JSCallbackConstructor.cpp: 10276 (JSC::JSCallbackConstructor::JSCallbackConstructor): 10277 * API/JSCallbackConstructor.h: 10278 (JSC::JSCallbackConstructor::createStructure): 10279 * API/JSCallbackFunction.h: 10280 (JSC::JSCallbackFunction::createStructure): 10281 * API/JSCallbackObject.h: 10282 (JSC::JSCallbackObject::createStructure): 10283 * API/JSCallbackObjectFunctions.h: 10284 (JSC::::JSCallbackObject): 10285 * API/JSValueRef.cpp: 10286 (JSValueIsInstanceOfConstructor): 10287 * GNUmakefile.am: 10288 * JavaScriptCore.exp: 10289 * JavaScriptCore.pri: 10290 * JavaScriptCore.scons: 10291 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 10292 * JavaScriptCore.xcodeproj/project.pbxproj: 10293 * JavaScriptCoreSources.bkl: 10294 * VM/CTI.cpp: 10295 (JSC::CTI::compileBinaryArithOp): 10296 (JSC::CTI::privateCompileMainPass): 10297 (JSC::CTI::privateCompileGetByIdSelf): 10298 (JSC::CTI::privateCompileGetByIdProto): 10299 (JSC::CTI::privateCompileGetByIdChain): 10300 (JSC::CTI::privateCompilePutByIdReplace): 10301 (JSC::transitionWillNeedStorageRealloc): 10302 (JSC::CTI::privateCompilePutByIdTransition): 10303 (JSC::CTI::patchGetByIdSelf): 10304 (JSC::CTI::patchPutByIdReplace): 10305 * VM/CTI.h: 10306 (JSC::CTI::compileGetByIdSelf): 10307 (JSC::CTI::compileGetByIdProto): 10308 (JSC::CTI::compileGetByIdChain): 10309 (JSC::CTI::compilePutByIdReplace): 10310 (JSC::CTI::compilePutByIdTransition): 10311 * VM/CodeBlock.cpp: 10312 (JSC::CodeBlock::printStructure): 10313 (JSC::CodeBlock::printStructures): 10314 (JSC::CodeBlock::dump): 10315 (JSC::CodeBlock::~CodeBlock): 10316 (JSC::CodeBlock::derefStructures): 10317 (JSC::CodeBlock::refStructures): 10318 * VM/CodeBlock.h: 10319 * VM/Instruction.h: 10320 (JSC::Instruction::Instruction): 10321 (JSC::Instruction::): 10322 * VM/Machine.cpp: 10323 (JSC::jsTypeStringForValue): 10324 (JSC::jsIsObjectType): 10325 (JSC::BytecodeInterpreter::resolveGlobal): 10326 (JSC::BytecodeInterpreter::BytecodeInterpreter): 10327 (JSC::cachePrototypeChain): 10328 (JSC::BytecodeInterpreter::tryCachePutByID): 10329 (JSC::BytecodeInterpreter::uncachePutByID): 10330 (JSC::BytecodeInterpreter::tryCacheGetByID): 10331 (JSC::BytecodeInterpreter::uncacheGetByID): 10332 (JSC::BytecodeInterpreter::privateExecute): 10333 (JSC::BytecodeInterpreter::tryCTICachePutByID): 10334 (JSC::BytecodeInterpreter::tryCTICacheGetByID): 10335 (JSC::BytecodeInterpreter::cti_op_instanceof): 10336 (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct): 10337 (JSC::BytecodeInterpreter::cti_op_resolve_global): 10338 (JSC::BytecodeInterpreter::cti_op_is_undefined): 10339 * runtime/Arguments.h: 10340 (JSC::Arguments::createStructure): 10341 * runtime/ArrayConstructor.cpp: 10342 (JSC::ArrayConstructor::ArrayConstructor): 10343 * runtime/ArrayConstructor.h: 10344 * runtime/ArrayPrototype.cpp: 10345 (JSC::ArrayPrototype::ArrayPrototype): 10346 * runtime/ArrayPrototype.h: 10347 * runtime/BatchedTransitionOptimizer.h: 10348 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer): 10349 (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer): 10350 * runtime/BooleanConstructor.cpp: 10351 (JSC::BooleanConstructor::BooleanConstructor): 10352 * runtime/BooleanConstructor.h: 10353 * runtime/BooleanObject.cpp: 10354 (JSC::BooleanObject::BooleanObject): 10355 * runtime/BooleanObject.h: 10356 * runtime/BooleanPrototype.cpp: 10357 (JSC::BooleanPrototype::BooleanPrototype): 10358 * runtime/BooleanPrototype.h: 10359 * runtime/DateConstructor.cpp: 10360 (JSC::DateConstructor::DateConstructor): 10361 * runtime/DateConstructor.h: 10362 * runtime/DateInstance.cpp: 10363 (JSC::DateInstance::DateInstance): 10364 * runtime/DateInstance.h: 10365 * runtime/DatePrototype.cpp: 10366 (JSC::DatePrototype::DatePrototype): 10367 * runtime/DatePrototype.h: 10368 (JSC::DatePrototype::createStructure): 10369 * runtime/ErrorConstructor.cpp: 10370 (JSC::ErrorConstructor::ErrorConstructor): 10371 * runtime/ErrorConstructor.h: 10372 * runtime/ErrorInstance.cpp: 10373 (JSC::ErrorInstance::ErrorInstance): 10374 * runtime/ErrorInstance.h: 10375 * runtime/ErrorPrototype.cpp: 10376 (JSC::ErrorPrototype::ErrorPrototype): 10377 * runtime/ErrorPrototype.h: 10378 * runtime/FunctionConstructor.cpp: 10379 (JSC::FunctionConstructor::FunctionConstructor): 10380 * runtime/FunctionConstructor.h: 10381 * runtime/FunctionPrototype.cpp: 10382 (JSC::FunctionPrototype::FunctionPrototype): 10383 (JSC::FunctionPrototype::addFunctionProperties): 10384 * runtime/FunctionPrototype.h: 10385 (JSC::FunctionPrototype::createStructure): 10386 * runtime/GlobalEvalFunction.cpp: 10387 (JSC::GlobalEvalFunction::GlobalEvalFunction): 10388 * runtime/GlobalEvalFunction.h: 10389 * runtime/Identifier.h: 10390 * runtime/InternalFunction.cpp: 10391 (JSC::InternalFunction::InternalFunction): 10392 * runtime/InternalFunction.h: 10393 (JSC::InternalFunction::createStructure): 10394 (JSC::InternalFunction::InternalFunction): 10395 * runtime/JSActivation.cpp: 10396 (JSC::JSActivation::JSActivation): 10397 * runtime/JSActivation.h: 10398 (JSC::JSActivation::createStructure): 10399 * runtime/JSArray.cpp: 10400 (JSC::JSArray::JSArray): 10401 * runtime/JSArray.h: 10402 (JSC::JSArray::createStructure): 10403 * runtime/JSCell.h: 10404 (JSC::JSCell::JSCell): 10405 (JSC::JSCell::isObject): 10406 (JSC::JSCell::isString): 10407 (JSC::JSCell::structure): 10408 (JSC::JSValue::needsThisConversion): 10409 * runtime/JSFunction.cpp: 10410 (JSC::JSFunction::construct): 10411 * runtime/JSFunction.h: 10412 (JSC::JSFunction::JSFunction): 10413 (JSC::JSFunction::createStructure): 10414 * runtime/JSGlobalData.cpp: 10415 (JSC::JSGlobalData::JSGlobalData): 10416 (JSC::JSGlobalData::createLeaked): 10417 * runtime/JSGlobalData.h: 10418 * runtime/JSGlobalObject.cpp: 10419 (JSC::markIfNeeded): 10420 (JSC::JSGlobalObject::reset): 10421 * runtime/JSGlobalObject.h: 10422 (JSC::JSGlobalObject::JSGlobalObject): 10423 (JSC::JSGlobalObject::argumentsStructure): 10424 (JSC::JSGlobalObject::arrayStructure): 10425 (JSC::JSGlobalObject::booleanObjectStructure): 10426 (JSC::JSGlobalObject::callbackConstructorStructure): 10427 (JSC::JSGlobalObject::callbackFunctionStructure): 10428 (JSC::JSGlobalObject::callbackObjectStructure): 10429 (JSC::JSGlobalObject::dateStructure): 10430 (JSC::JSGlobalObject::emptyObjectStructure): 10431 (JSC::JSGlobalObject::errorStructure): 10432 (JSC::JSGlobalObject::functionStructure): 10433 (JSC::JSGlobalObject::numberObjectStructure): 10434 (JSC::JSGlobalObject::prototypeFunctionStructure): 10435 (JSC::JSGlobalObject::regExpMatchesArrayStructure): 10436 (JSC::JSGlobalObject::regExpStructure): 10437 (JSC::JSGlobalObject::stringObjectStructure): 10438 (JSC::JSGlobalObject::createStructure): 10439 (JSC::Structure::prototypeForLookup): 10440 * runtime/JSNotAnObject.h: 10441 (JSC::JSNotAnObject::createStructure): 10442 * runtime/JSNumberCell.h: 10443 (JSC::JSNumberCell::createStructure): 10444 (JSC::JSNumberCell::JSNumberCell): 10445 * runtime/JSObject.cpp: 10446 (JSC::JSObject::mark): 10447 (JSC::JSObject::put): 10448 (JSC::JSObject::deleteProperty): 10449 (JSC::JSObject::defineGetter): 10450 (JSC::JSObject::defineSetter): 10451 (JSC::JSObject::getPropertyAttributes): 10452 (JSC::JSObject::getPropertyNames): 10453 (JSC::JSObject::removeDirect): 10454 (JSC::JSObject::createInheritorID): 10455 * runtime/JSObject.h: 10456 (JSC::JSObject::getDirect): 10457 (JSC::JSObject::getDirectLocation): 10458 (JSC::JSObject::hasCustomProperties): 10459 (JSC::JSObject::hasGetterSetterProperties): 10460 (JSC::JSObject::createStructure): 10461 (JSC::JSObject::JSObject): 10462 (JSC::JSObject::~JSObject): 10463 (JSC::JSObject::prototype): 10464 (JSC::JSObject::setPrototype): 10465 (JSC::JSObject::setStructure): 10466 (JSC::JSObject::inheritorID): 10467 (JSC::JSObject::inlineGetOwnPropertySlot): 10468 (JSC::JSObject::getOwnPropertySlotForWrite): 10469 (JSC::JSCell::fastGetOwnPropertySlot): 10470 (JSC::JSObject::putDirect): 10471 (JSC::JSObject::putDirectWithoutTransition): 10472 (JSC::JSObject::transitionTo): 10473 * runtime/JSPropertyNameIterator.h: 10474 (JSC::JSPropertyNameIterator::next): 10475 * runtime/JSStaticScopeObject.h: 10476 (JSC::JSStaticScopeObject::JSStaticScopeObject): 10477 (JSC::JSStaticScopeObject::createStructure): 10478 * runtime/JSString.h: 10479 (JSC::JSString::JSString): 10480 (JSC::JSString::createStructure): 10481 * runtime/JSVariableObject.h: 10482 (JSC::JSVariableObject::JSVariableObject): 10483 * runtime/JSWrapperObject.h: 10484 (JSC::JSWrapperObject::JSWrapperObject): 10485 * runtime/MathObject.cpp: 10486 (JSC::MathObject::MathObject): 10487 * runtime/MathObject.h: 10488 (JSC::MathObject::createStructure): 10489 * runtime/NativeErrorConstructor.cpp: 10490 (JSC::NativeErrorConstructor::NativeErrorConstructor): 10491 * runtime/NativeErrorConstructor.h: 10492 * runtime/NativeErrorPrototype.cpp: 10493 (JSC::NativeErrorPrototype::NativeErrorPrototype): 10494 * runtime/NativeErrorPrototype.h: 10495 * runtime/NumberConstructor.cpp: 10496 (JSC::NumberConstructor::NumberConstructor): 10497 * runtime/NumberConstructor.h: 10498 (JSC::NumberConstructor::createStructure): 10499 * runtime/NumberObject.cpp: 10500 (JSC::NumberObject::NumberObject): 10501 * runtime/NumberObject.h: 10502 * runtime/NumberPrototype.cpp: 10503 (JSC::NumberPrototype::NumberPrototype): 10504 * runtime/NumberPrototype.h: 10505 * runtime/ObjectConstructor.cpp: 10506 (JSC::ObjectConstructor::ObjectConstructor): 10507 * runtime/ObjectConstructor.h: 10508 * runtime/ObjectPrototype.cpp: 10509 (JSC::ObjectPrototype::ObjectPrototype): 10510 * runtime/ObjectPrototype.h: 10511 * runtime/Operations.h: 10512 (JSC::equalSlowCaseInline): 10513 * runtime/PropertyNameArray.h: 10514 (JSC::PropertyNameArrayData::setCachedStructure): 10515 (JSC::PropertyNameArrayData::cachedStructure): 10516 (JSC::PropertyNameArrayData::setCachedPrototypeChain): 10517 (JSC::PropertyNameArrayData::cachedPrototypeChain): 10518 (JSC::PropertyNameArrayData::PropertyNameArrayData): 10519 * runtime/PrototypeFunction.cpp: 10520 (JSC::PrototypeFunction::PrototypeFunction): 10521 * runtime/PrototypeFunction.h: 10522 * runtime/RegExpConstructor.cpp: 10523 (JSC::RegExpConstructor::RegExpConstructor): 10524 * runtime/RegExpConstructor.h: 10525 (JSC::RegExpConstructor::createStructure): 10526 * runtime/RegExpObject.cpp: 10527 (JSC::RegExpObject::RegExpObject): 10528 * runtime/RegExpObject.h: 10529 (JSC::RegExpObject::createStructure): 10530 * runtime/RegExpPrototype.cpp: 10531 (JSC::RegExpPrototype::RegExpPrototype): 10532 * runtime/RegExpPrototype.h: 10533 * runtime/StringConstructor.cpp: 10534 (JSC::StringConstructor::StringConstructor): 10535 * runtime/StringConstructor.h: 10536 * runtime/StringObject.cpp: 10537 (JSC::StringObject::StringObject): 10538 * runtime/StringObject.h: 10539 (JSC::StringObject::createStructure): 10540 * runtime/StringObjectThatMasqueradesAsUndefined.h: 10541 (JSC::StringObjectThatMasqueradesAsUndefined::create): 10542 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): 10543 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 10544 * runtime/StringPrototype.cpp: 10545 (JSC::StringPrototype::StringPrototype): 10546 * runtime/StringPrototype.h: 10547 * runtime/Structure.cpp: Copied from JavaScriptCore/runtime/StructureID.cpp. 10548 (JSC::Structure::dumpStatistics): 10549 (JSC::Structure::Structure): 10550 (JSC::Structure::~Structure): 10551 (JSC::Structure::startIgnoringLeaks): 10552 (JSC::Structure::stopIgnoringLeaks): 10553 (JSC::Structure::materializePropertyMap): 10554 (JSC::Structure::getEnumerablePropertyNames): 10555 (JSC::Structure::clearEnumerationCache): 10556 (JSC::Structure::growPropertyStorageCapacity): 10557 (JSC::Structure::addPropertyTransitionToExistingStructure): 10558 (JSC::Structure::addPropertyTransition): 10559 (JSC::Structure::removePropertyTransition): 10560 (JSC::Structure::changePrototypeTransition): 10561 (JSC::Structure::getterSetterTransition): 10562 (JSC::Structure::toDictionaryTransition): 10563 (JSC::Structure::fromDictionaryTransition): 10564 (JSC::Structure::addPropertyWithoutTransition): 10565 (JSC::Structure::removePropertyWithoutTransition): 10566 (JSC::Structure::createCachedPrototypeChain): 10567 (JSC::Structure::checkConsistency): 10568 (JSC::Structure::copyPropertyTable): 10569 (JSC::Structure::get): 10570 (JSC::Structure::put): 10571 (JSC::Structure::remove): 10572 (JSC::Structure::insertIntoPropertyMapHashTable): 10573 (JSC::Structure::createPropertyMapHashTable): 10574 (JSC::Structure::expandPropertyMapHashTable): 10575 (JSC::Structure::rehashPropertyMapHashTable): 10576 (JSC::Structure::getEnumerablePropertyNamesInternal): 10577 * runtime/Structure.h: Copied from JavaScriptCore/runtime/StructureID.h. 10578 (JSC::Structure::create): 10579 (JSC::Structure::previousID): 10580 (JSC::Structure::setCachedPrototypeChain): 10581 (JSC::Structure::cachedPrototypeChain): 10582 (JSC::Structure::): 10583 (JSC::Structure::get): 10584 * runtime/StructureChain.cpp: Copied from JavaScriptCore/runtime/StructureIDChain.cpp. 10585 (JSC::StructureChain::StructureChain): 10586 (JSC::structureChainsAreEqual): 10587 * runtime/StructureChain.h: Copied from JavaScriptCore/runtime/StructureIDChain.h. 10588 (JSC::StructureChain::create): 10589 (JSC::StructureChain::head): 10590 * runtime/StructureID.cpp: Removed. 10591 * runtime/StructureID.h: Removed. 10592 * runtime/StructureIDChain.cpp: Removed. 10593 * runtime/StructureIDChain.h: Removed. 10594 * runtime/StructureIDTransitionTable.h: Removed. 10595 * runtime/StructureTransitionTable.h: Copied from JavaScriptCore/runtime/StructureIDTransitionTable.h. 10596 105972008-11-15 Darin Adler <darin@apple.com> 10598 10599 - fix non-WREC build 10600 10601 * runtime/RegExp.cpp: Put "using namespace WREC" inside #if ENABLE(WREC). 10602 106032008-11-15 Kevin Ollivier <kevino@theolliviers.com> 10604 10605 Reviewed by Timothy Hatcher. 10606 10607 As ThreadingNone doesn't implement threads, isMainThread should return true, 10608 not false. 10609 10610 https://bugs.webkit.org/show_bug.cgi?id=22285 10611 10612 * wtf/ThreadingNone.cpp: 10613 (WTF::isMainThread): 10614 106152008-11-15 Geoffrey Garen <ggaren@apple.com> 10616 10617 Reviewed by Sam Weinig. 10618 10619 Moved all WREC-related code into WREC.cpp and put it in a WREC namespace. 10620 Removed the WREC prefix from class names. 10621 10622 * VM/CTI.cpp: 10623 * VM/CTI.h: 10624 * VM/Machine.h: 10625 (JSC::BytecodeInterpreter::assemblerBuffer): 10626 * masm/X86Assembler.h: 10627 * runtime/RegExp.cpp: 10628 (JSC::RegExp::RegExp): 10629 * wrec/CharacterClassConstructor.cpp: 10630 * wrec/CharacterClassConstructor.h: 10631 * wrec/WREC.cpp: 10632 (WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor): 10633 (WREC::GeneratePatternCharacterFunctor::generateAtom): 10634 (WREC::GeneratePatternCharacterFunctor::backtrack): 10635 (WREC::GenerateCharacterClassFunctor::generateAtom): 10636 (WREC::GenerateCharacterClassFunctor::backtrack): 10637 (WREC::GenerateBackreferenceFunctor::generateAtom): 10638 (WREC::GenerateBackreferenceFunctor::backtrack): 10639 (WREC::GenerateParenthesesNonGreedyFunctor::generateAtom): 10640 (WREC::GenerateParenthesesNonGreedyFunctor::backtrack): 10641 (WREC::Generator::generateBacktrack1): 10642 (WREC::Generator::generateBacktrackBackreference): 10643 (WREC::Generator::generateBackreferenceQuantifier): 10644 (WREC::Generator::generateNonGreedyQuantifier): 10645 (WREC::Generator::generateGreedyQuantifier): 10646 (WREC::Generator::generatePatternCharacter): 10647 (WREC::Generator::generateCharacterClassInvertedRange): 10648 (WREC::Generator::generateCharacterClassInverted): 10649 (WREC::Generator::generateCharacterClass): 10650 (WREC::Generator::generateParentheses): 10651 (WREC::Generator::generateParenthesesNonGreedy): 10652 (WREC::Generator::generateParenthesesResetTrampoline): 10653 (WREC::Generator::generateAssertionBOL): 10654 (WREC::Generator::generateAssertionEOL): 10655 (WREC::Generator::generateAssertionWordBoundary): 10656 (WREC::Generator::generateBackreference): 10657 (WREC::Generator::generateDisjunction): 10658 (WREC::Generator::terminateDisjunction): 10659 (WREC::Parser::parseGreedyQuantifier): 10660 (WREC::Parser::parseQuantifier): 10661 (WREC::Parser::parsePatternCharacterQualifier): 10662 (WREC::Parser::parseCharacterClassQuantifier): 10663 (WREC::Parser::parseBackreferenceQuantifier): 10664 (WREC::Parser::parseParentheses): 10665 (WREC::Parser::parseCharacterClass): 10666 (WREC::Parser::parseOctalEscape): 10667 (WREC::Parser::parseEscape): 10668 (WREC::Parser::parseTerm): 10669 (WREC::Parser::parseDisjunction): 10670 (WREC::compileRegExp): 10671 * wrec/WREC.h: 10672 (WREC::Generator::Generator): 10673 (WREC::Parser::Parser): 10674 (WREC::Parser::parseAlternative): 10675 106762008-11-15 Geoffrey Garen <ggaren@apple.com> 10677 10678 Reviewed by Sam Weinig. 10679 10680 Changed another case of "m_jit" to "m_assembler". 10681 10682 * VM/CTI.cpp: 10683 * wrec/WREC.cpp: 10684 * wrec/WREC.h: 10685 (JSC::WRECGenerator::WRECGenerator): 10686 (JSC::WRECParser::WRECParser): 10687 106882008-11-15 Geoffrey Garen <ggaren@apple.com> 10689 10690 Reviewed by Sam Weinig. 10691 10692 Renamed "jit" to "assembler" and, for brevity, replaced *jit.* with __ 10693 using a macro. 10694 10695 * VM/CTI.cpp: 10696 (JSC::CTI::emitGetVirtualRegister): 10697 (JSC::CTI::emitPutCTIArgFromVirtualRegister): 10698 (JSC::CTI::emitPutCTIArg): 10699 (JSC::CTI::emitGetCTIArg): 10700 (JSC::CTI::emitPutCTIArgConstant): 10701 (JSC::CTI::emitPutCTIParam): 10702 (JSC::CTI::emitGetCTIParam): 10703 (JSC::CTI::emitPutToCallFrameHeader): 10704 (JSC::CTI::emitGetFromCallFrameHeader): 10705 (JSC::CTI::emitPutVirtualRegister): 10706 (JSC::CTI::emitInitRegister): 10707 (JSC::CTI::emitAllocateNumber): 10708 (JSC::CTI::emitNakedCall): 10709 (JSC::CTI::emitNakedFastCall): 10710 (JSC::CTI::emitCTICall): 10711 (JSC::CTI::emitJumpSlowCaseIfNotJSCell): 10712 (JSC::CTI::linkSlowCaseIfNotJSCell): 10713 (JSC::CTI::emitJumpSlowCaseIfNotImmNum): 10714 (JSC::CTI::emitJumpSlowCaseIfNotImmNums): 10715 (JSC::CTI::emitFastArithDeTagImmediate): 10716 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero): 10717 (JSC::CTI::emitFastArithReTagImmediate): 10718 (JSC::CTI::emitFastArithPotentiallyReTagImmediate): 10719 (JSC::CTI::emitFastArithImmToInt): 10720 (JSC::CTI::emitFastArithIntToImmOrSlowCase): 10721 (JSC::CTI::emitFastArithIntToImmNoCheck): 10722 (JSC::CTI::emitArithIntToImmWithJump): 10723 (JSC::CTI::emitTagAsBoolImmediate): 10724 (JSC::CTI::CTI): 10725 (JSC::CTI::compileOpCallInitializeCallFrame): 10726 (JSC::CTI::compileOpCall): 10727 (JSC::CTI::compileOpStrictEq): 10728 (JSC::CTI::emitSlowScriptCheck): 10729 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): 10730 (JSC::CTI::compileBinaryArithOp): 10731 (JSC::CTI::compileBinaryArithOpSlowCase): 10732 (JSC::CTI::privateCompileMainPass): 10733 (JSC::CTI::privateCompileLinkPass): 10734 (JSC::CTI::privateCompileSlowCases): 10735 (JSC::CTI::privateCompile): 10736 (JSC::CTI::privateCompileGetByIdSelf): 10737 (JSC::CTI::privateCompileGetByIdProto): 10738 (JSC::CTI::privateCompileGetByIdChain): 10739 (JSC::CTI::privateCompilePutByIdReplace): 10740 (JSC::CTI::privateCompilePutByIdTransition): 10741 (JSC::CTI::privateCompileCTIMachineTrampolines): 10742 (JSC::CTI::privateCompilePatchGetArrayLength): 10743 (JSC::CTI::emitGetVariableObjectRegister): 10744 (JSC::CTI::emitPutVariableObjectRegister): 10745 (JSC::CTI::compileRegExp): 10746 * VM/CTI.h: 10747 * wrec/WREC.cpp: 10748 (JSC::WRECGenerator::generateBacktrack1): 10749 (JSC::WRECGenerator::generateBacktrackBackreference): 10750 (JSC::WRECGenerator::generateBackreferenceQuantifier): 10751 (JSC::WRECGenerator::generateNonGreedyQuantifier): 10752 (JSC::WRECGenerator::generateGreedyQuantifier): 10753 (JSC::WRECGenerator::generatePatternCharacter): 10754 (JSC::WRECGenerator::generateCharacterClassInvertedRange): 10755 (JSC::WRECGenerator::generateCharacterClassInverted): 10756 (JSC::WRECGenerator::generateCharacterClass): 10757 (JSC::WRECGenerator::generateParentheses): 10758 (JSC::WRECGenerator::generateParenthesesNonGreedy): 10759 (JSC::WRECGenerator::generateParenthesesResetTrampoline): 10760 (JSC::WRECGenerator::generateAssertionBOL): 10761 (JSC::WRECGenerator::generateAssertionEOL): 10762 (JSC::WRECGenerator::generateAssertionWordBoundary): 10763 (JSC::WRECGenerator::generateBackreference): 10764 (JSC::WRECGenerator::generateDisjunction): 10765 (JSC::WRECGenerator::terminateDisjunction): 10766 107672008-11-15 Sam Weinig <sam@webkit.org> 10768 10769 Reviewed by Geoffrey Garen. 10770 10771 Remove dead method declaration. 10772 10773 * bytecompiler/CodeGenerator.h: 10774 107752008-11-15 Geoffrey Garen <ggaren@apple.com> 10776 10777 Reviewed by Sam Weinig. 10778 10779 Renamed LabelID to Label, Label::isForwardLabel to Label::isForward. 10780 10781 * VM/LabelID.h: 10782 (JSC::Label::Label): 10783 (JSC::Label::isForward): 10784 * bytecompiler/CodeGenerator.cpp: 10785 (JSC::BytecodeGenerator::newLabel): 10786 (JSC::BytecodeGenerator::emitLabel): 10787 (JSC::BytecodeGenerator::emitJump): 10788 (JSC::BytecodeGenerator::emitJumpIfTrue): 10789 (JSC::BytecodeGenerator::emitJumpIfFalse): 10790 (JSC::BytecodeGenerator::pushFinallyContext): 10791 (JSC::BytecodeGenerator::emitComplexJumpScopes): 10792 (JSC::BytecodeGenerator::emitJumpScopes): 10793 (JSC::BytecodeGenerator::emitNextPropertyName): 10794 (JSC::BytecodeGenerator::emitCatch): 10795 (JSC::BytecodeGenerator::emitJumpSubroutine): 10796 (JSC::prepareJumpTableForImmediateSwitch): 10797 (JSC::prepareJumpTableForCharacterSwitch): 10798 (JSC::prepareJumpTableForStringSwitch): 10799 (JSC::BytecodeGenerator::endSwitch): 10800 * bytecompiler/CodeGenerator.h: 10801 * bytecompiler/LabelScope.h: 10802 (JSC::LabelScope::LabelScope): 10803 (JSC::LabelScope::breakTarget): 10804 (JSC::LabelScope::continueTarget): 10805 * parser/Nodes.cpp: 10806 (JSC::LogicalOpNode::emitBytecode): 10807 (JSC::ConditionalNode::emitBytecode): 10808 (JSC::IfNode::emitBytecode): 10809 (JSC::IfElseNode::emitBytecode): 10810 (JSC::DoWhileNode::emitBytecode): 10811 (JSC::WhileNode::emitBytecode): 10812 (JSC::ForNode::emitBytecode): 10813 (JSC::ForInNode::emitBytecode): 10814 (JSC::ReturnNode::emitBytecode): 10815 (JSC::CaseBlockNode::emitBytecodeForBlock): 10816 (JSC::TryNode::emitBytecode): 10817 108182008-11-15 Geoffrey Garen <ggaren@apple.com> 10819 10820 Reviewed by Sam Weinig. 10821 10822 Renamed JITCodeBuffer to AssemblerBuffer and renamed its data members 10823 to be more like the rest of our buffer classes, with a size and a 10824 capacity. 10825 10826 Added an assert in the unchecked put case to match the test in the checked 10827 put case. 10828 10829 Changed a C-style cast to a C++-style cast. 10830 10831 Renamed MAX_INSTRUCTION_SIZE to maxInstructionSize. 10832 10833 * VM/CTI.cpp: 10834 (JSC::CTI::CTI): 10835 (JSC::CTI::compileRegExp): 10836 * VM/Machine.cpp: 10837 (JSC::BytecodeInterpreter::BytecodeInterpreter): 10838 * VM/Machine.h: 10839 (JSC::BytecodeInterpreter::assemblerBuffer): 10840 * masm/X86Assembler.h: 10841 (JSC::AssemblerBuffer::AssemblerBuffer): 10842 (JSC::AssemblerBuffer::~AssemblerBuffer): 10843 (JSC::AssemblerBuffer::ensureSpace): 10844 (JSC::AssemblerBuffer::isAligned): 10845 (JSC::AssemblerBuffer::putByteUnchecked): 10846 (JSC::AssemblerBuffer::putByte): 10847 (JSC::AssemblerBuffer::putShortUnchecked): 10848 (JSC::AssemblerBuffer::putShort): 10849 (JSC::AssemblerBuffer::putIntUnchecked): 10850 (JSC::AssemblerBuffer::putInt): 10851 (JSC::AssemblerBuffer::data): 10852 (JSC::AssemblerBuffer::size): 10853 (JSC::AssemblerBuffer::reset): 10854 (JSC::AssemblerBuffer::copy): 10855 (JSC::AssemblerBuffer::grow): 10856 (JSC::X86Assembler::): 10857 (JSC::X86Assembler::X86Assembler): 10858 (JSC::X86Assembler::testl_i32r): 10859 (JSC::X86Assembler::movl_mr): 10860 (JSC::X86Assembler::movl_rm): 10861 (JSC::X86Assembler::movl_i32m): 10862 (JSC::X86Assembler::emitCall): 10863 (JSC::X86Assembler::label): 10864 (JSC::X86Assembler::emitUnlinkedJmp): 10865 (JSC::X86Assembler::emitUnlinkedJne): 10866 (JSC::X86Assembler::emitUnlinkedJe): 10867 (JSC::X86Assembler::emitUnlinkedJl): 10868 (JSC::X86Assembler::emitUnlinkedJb): 10869 (JSC::X86Assembler::emitUnlinkedJle): 10870 (JSC::X86Assembler::emitUnlinkedJbe): 10871 (JSC::X86Assembler::emitUnlinkedJge): 10872 (JSC::X86Assembler::emitUnlinkedJg): 10873 (JSC::X86Assembler::emitUnlinkedJa): 10874 (JSC::X86Assembler::emitUnlinkedJae): 10875 (JSC::X86Assembler::emitUnlinkedJo): 10876 (JSC::X86Assembler::emitUnlinkedJp): 10877 (JSC::X86Assembler::emitUnlinkedJs): 10878 (JSC::X86Assembler::link): 10879 (JSC::X86Assembler::emitModRm_rr): 10880 (JSC::X86Assembler::emitModRm_rm): 10881 (JSC::X86Assembler::emitModRm_opr): 10882 108832008-11-15 Geoffrey Garen <ggaren@apple.com> 10884 10885 Suggested by Maciej Stachowiak. 10886 10887 Reverted most "opcode" => "bytecode" renames. We use "bytecode" as a 10888 mass noun to refer to a stream of instructions. Each instruction may be 10889 an opcode or an operand. 10890 10891 * VM/CTI.cpp: 10892 (JSC::CTI::emitCTICall): 10893 (JSC::CTI::compileOpCall): 10894 (JSC::CTI::compileBinaryArithOp): 10895 (JSC::CTI::compileBinaryArithOpSlowCase): 10896 (JSC::CTI::privateCompileMainPass): 10897 (JSC::CTI::privateCompileSlowCases): 10898 (JSC::CTI::privateCompile): 10899 * VM/CTI.h: 10900 * VM/CodeBlock.cpp: 10901 (JSC::CodeBlock::printStructureIDs): 10902 (JSC::CodeBlock::dump): 10903 (JSC::CodeBlock::derefStructureIDs): 10904 (JSC::CodeBlock::refStructureIDs): 10905 * VM/CodeBlock.h: 10906 * VM/ExceptionHelpers.cpp: 10907 (JSC::createNotAnObjectError): 10908 * VM/Instruction.h: 10909 (JSC::Instruction::Instruction): 10910 (JSC::Instruction::): 10911 * VM/Machine.cpp: 10912 (JSC::BytecodeInterpreter::isOpcode): 10913 (JSC::BytecodeInterpreter::throwException): 10914 (JSC::BytecodeInterpreter::tryCachePutByID): 10915 (JSC::BytecodeInterpreter::uncachePutByID): 10916 (JSC::BytecodeInterpreter::tryCacheGetByID): 10917 (JSC::BytecodeInterpreter::uncacheGetByID): 10918 (JSC::BytecodeInterpreter::privateExecute): 10919 (JSC::BytecodeInterpreter::tryCTICachePutByID): 10920 (JSC::BytecodeInterpreter::tryCTICacheGetByID): 10921 * VM/Machine.h: 10922 (JSC::BytecodeInterpreter::getOpcode): 10923 (JSC::BytecodeInterpreter::getOpcodeID): 10924 (JSC::BytecodeInterpreter::isCallBytecode): 10925 * VM/Opcode.cpp: 10926 (JSC::): 10927 (JSC::OpcodeStats::OpcodeStats): 10928 (JSC::compareOpcodeIndices): 10929 (JSC::compareOpcodePairIndices): 10930 (JSC::OpcodeStats::~OpcodeStats): 10931 (JSC::OpcodeStats::recordInstruction): 10932 (JSC::OpcodeStats::resetLastInstruction): 10933 * VM/Opcode.h: 10934 (JSC::): 10935 (JSC::padOpcodeName): 10936 * VM/SamplingTool.cpp: 10937 (JSC::ScopeSampleRecord::sample): 10938 (JSC::SamplingTool::run): 10939 (JSC::compareOpcodeIndicesSampling): 10940 (JSC::SamplingTool::dump): 10941 * VM/SamplingTool.h: 10942 (JSC::ScopeSampleRecord::ScopeSampleRecord): 10943 (JSC::SamplingTool::SamplingTool): 10944 * bytecompiler/CodeGenerator.cpp: 10945 (JSC::BytecodeGenerator::BytecodeGenerator): 10946 (JSC::BytecodeGenerator::emitLabel): 10947 (JSC::BytecodeGenerator::emitOpcode): 10948 (JSC::BytecodeGenerator::emitJump): 10949 (JSC::BytecodeGenerator::emitJumpIfTrue): 10950 (JSC::BytecodeGenerator::emitJumpIfFalse): 10951 (JSC::BytecodeGenerator::emitMove): 10952 (JSC::BytecodeGenerator::emitUnaryOp): 10953 (JSC::BytecodeGenerator::emitPreInc): 10954 (JSC::BytecodeGenerator::emitPreDec): 10955 (JSC::BytecodeGenerator::emitPostInc): 10956 (JSC::BytecodeGenerator::emitPostDec): 10957 (JSC::BytecodeGenerator::emitBinaryOp): 10958 (JSC::BytecodeGenerator::emitEqualityOp): 10959 (JSC::BytecodeGenerator::emitUnexpectedLoad): 10960 (JSC::BytecodeGenerator::emitInstanceOf): 10961 (JSC::BytecodeGenerator::emitResolve): 10962 (JSC::BytecodeGenerator::emitGetScopedVar): 10963 (JSC::BytecodeGenerator::emitPutScopedVar): 10964 (JSC::BytecodeGenerator::emitResolveBase): 10965 (JSC::BytecodeGenerator::emitResolveWithBase): 10966 (JSC::BytecodeGenerator::emitResolveFunction): 10967 (JSC::BytecodeGenerator::emitGetById): 10968 (JSC::BytecodeGenerator::emitPutById): 10969 (JSC::BytecodeGenerator::emitPutGetter): 10970 (JSC::BytecodeGenerator::emitPutSetter): 10971 (JSC::BytecodeGenerator::emitDeleteById): 10972 (JSC::BytecodeGenerator::emitGetByVal): 10973 (JSC::BytecodeGenerator::emitPutByVal): 10974 (JSC::BytecodeGenerator::emitDeleteByVal): 10975 (JSC::BytecodeGenerator::emitPutByIndex): 10976 (JSC::BytecodeGenerator::emitNewObject): 10977 (JSC::BytecodeGenerator::emitNewArray): 10978 (JSC::BytecodeGenerator::emitNewFunction): 10979 (JSC::BytecodeGenerator::emitNewRegExp): 10980 (JSC::BytecodeGenerator::emitNewFunctionExpression): 10981 (JSC::BytecodeGenerator::emitCall): 10982 (JSC::BytecodeGenerator::emitReturn): 10983 (JSC::BytecodeGenerator::emitUnaryNoDstOp): 10984 (JSC::BytecodeGenerator::emitConstruct): 10985 (JSC::BytecodeGenerator::emitPopScope): 10986 (JSC::BytecodeGenerator::emitDebugHook): 10987 (JSC::BytecodeGenerator::emitComplexJumpScopes): 10988 (JSC::BytecodeGenerator::emitJumpScopes): 10989 (JSC::BytecodeGenerator::emitNextPropertyName): 10990 (JSC::BytecodeGenerator::emitCatch): 10991 (JSC::BytecodeGenerator::emitNewError): 10992 (JSC::BytecodeGenerator::emitJumpSubroutine): 10993 (JSC::BytecodeGenerator::emitSubroutineReturn): 10994 (JSC::BytecodeGenerator::emitPushNewScope): 10995 (JSC::BytecodeGenerator::beginSwitch): 10996 * bytecompiler/CodeGenerator.h: 10997 * jsc.cpp: 10998 (runWithScripts): 10999 * masm/X86Assembler.h: 11000 (JSC::X86Assembler::): 11001 (JSC::X86Assembler::emitModRm_opr): 11002 (JSC::X86Assembler::emitModRm_opr_Unchecked): 11003 (JSC::X86Assembler::emitModRm_opm): 11004 (JSC::X86Assembler::emitModRm_opm_Unchecked): 11005 (JSC::X86Assembler::emitModRm_opmsib): 11006 * parser/Nodes.cpp: 11007 (JSC::UnaryOpNode::emitBytecode): 11008 (JSC::BinaryOpNode::emitBytecode): 11009 (JSC::ReverseBinaryOpNode::emitBytecode): 11010 (JSC::ThrowableBinaryOpNode::emitBytecode): 11011 (JSC::emitReadModifyAssignment): 11012 (JSC::ScopeNode::ScopeNode): 11013 * parser/Nodes.h: 11014 (JSC::UnaryPlusNode::): 11015 (JSC::NegateNode::): 11016 (JSC::BitwiseNotNode::): 11017 (JSC::LogicalNotNode::): 11018 (JSC::MultNode::): 11019 (JSC::DivNode::): 11020 (JSC::ModNode::): 11021 (JSC::AddNode::): 11022 (JSC::SubNode::): 11023 (JSC::LeftShiftNode::): 11024 (JSC::RightShiftNode::): 11025 (JSC::UnsignedRightShiftNode::): 11026 (JSC::LessNode::): 11027 (JSC::GreaterNode::): 11028 (JSC::LessEqNode::): 11029 (JSC::GreaterEqNode::): 11030 (JSC::InstanceOfNode::): 11031 (JSC::InNode::): 11032 (JSC::EqualNode::): 11033 (JSC::NotEqualNode::): 11034 (JSC::StrictEqualNode::): 11035 (JSC::NotStrictEqualNode::): 11036 (JSC::BitAndNode::): 11037 (JSC::BitOrNode::): 11038 (JSC::BitXOrNode::): 11039 * runtime/StructureID.cpp: 11040 (JSC::StructureID::fromDictionaryTransition): 11041 * wtf/Platform.h: 11042 110432008-11-15 Geoffrey Garen <ggaren@apple.com> 11044 11045 Reviewed by Sam Weinig. 11046 11047 Renames: 11048 11049 CodeGenerator => BytecodeGenerator 11050 emitCodeForBlock => emitBytecodeForBlock 11051 generatedByteCode => generatedBytecode 11052 generateCode => generateBytecode 11053 11054 * JavaScriptCore.exp: 11055 * bytecompiler/CodeGenerator.cpp: 11056 (JSC::BytecodeGenerator::setDumpsGeneratedCode): 11057 (JSC::BytecodeGenerator::generate): 11058 (JSC::BytecodeGenerator::addVar): 11059 (JSC::BytecodeGenerator::addGlobalVar): 11060 (JSC::BytecodeGenerator::allocateConstants): 11061 (JSC::BytecodeGenerator::BytecodeGenerator): 11062 (JSC::BytecodeGenerator::addParameter): 11063 (JSC::BytecodeGenerator::registerFor): 11064 (JSC::BytecodeGenerator::constRegisterFor): 11065 (JSC::BytecodeGenerator::isLocal): 11066 (JSC::BytecodeGenerator::isLocalConstant): 11067 (JSC::BytecodeGenerator::newRegister): 11068 (JSC::BytecodeGenerator::newTemporary): 11069 (JSC::BytecodeGenerator::highestUsedRegister): 11070 (JSC::BytecodeGenerator::newLabelScope): 11071 (JSC::BytecodeGenerator::newLabel): 11072 (JSC::BytecodeGenerator::emitLabel): 11073 (JSC::BytecodeGenerator::emitBytecode): 11074 (JSC::BytecodeGenerator::retrieveLastBinaryOp): 11075 (JSC::BytecodeGenerator::retrieveLastUnaryOp): 11076 (JSC::BytecodeGenerator::rewindBinaryOp): 11077 (JSC::BytecodeGenerator::rewindUnaryOp): 11078 (JSC::BytecodeGenerator::emitJump): 11079 (JSC::BytecodeGenerator::emitJumpIfTrue): 11080 (JSC::BytecodeGenerator::emitJumpIfFalse): 11081 (JSC::BytecodeGenerator::addConstant): 11082 (JSC::BytecodeGenerator::addUnexpectedConstant): 11083 (JSC::BytecodeGenerator::addRegExp): 11084 (JSC::BytecodeGenerator::emitMove): 11085 (JSC::BytecodeGenerator::emitUnaryOp): 11086 (JSC::BytecodeGenerator::emitPreInc): 11087 (JSC::BytecodeGenerator::emitPreDec): 11088 (JSC::BytecodeGenerator::emitPostInc): 11089 (JSC::BytecodeGenerator::emitPostDec): 11090 (JSC::BytecodeGenerator::emitBinaryOp): 11091 (JSC::BytecodeGenerator::emitEqualityOp): 11092 (JSC::BytecodeGenerator::emitLoad): 11093 (JSC::BytecodeGenerator::emitUnexpectedLoad): 11094 (JSC::BytecodeGenerator::findScopedProperty): 11095 (JSC::BytecodeGenerator::emitInstanceOf): 11096 (JSC::BytecodeGenerator::emitResolve): 11097 (JSC::BytecodeGenerator::emitGetScopedVar): 11098 (JSC::BytecodeGenerator::emitPutScopedVar): 11099 (JSC::BytecodeGenerator::emitResolveBase): 11100 (JSC::BytecodeGenerator::emitResolveWithBase): 11101 (JSC::BytecodeGenerator::emitResolveFunction): 11102 (JSC::BytecodeGenerator::emitGetById): 11103 (JSC::BytecodeGenerator::emitPutById): 11104 (JSC::BytecodeGenerator::emitPutGetter): 11105 (JSC::BytecodeGenerator::emitPutSetter): 11106 (JSC::BytecodeGenerator::emitDeleteById): 11107 (JSC::BytecodeGenerator::emitGetByVal): 11108 (JSC::BytecodeGenerator::emitPutByVal): 11109 (JSC::BytecodeGenerator::emitDeleteByVal): 11110 (JSC::BytecodeGenerator::emitPutByIndex): 11111 (JSC::BytecodeGenerator::emitNewObject): 11112 (JSC::BytecodeGenerator::emitNewArray): 11113 (JSC::BytecodeGenerator::emitNewFunction): 11114 (JSC::BytecodeGenerator::emitNewRegExp): 11115 (JSC::BytecodeGenerator::emitNewFunctionExpression): 11116 (JSC::BytecodeGenerator::emitCall): 11117 (JSC::BytecodeGenerator::emitCallEval): 11118 (JSC::BytecodeGenerator::emitReturn): 11119 (JSC::BytecodeGenerator::emitUnaryNoDstOp): 11120 (JSC::BytecodeGenerator::emitConstruct): 11121 (JSC::BytecodeGenerator::emitPushScope): 11122 (JSC::BytecodeGenerator::emitPopScope): 11123 (JSC::BytecodeGenerator::emitDebugHook): 11124 (JSC::BytecodeGenerator::pushFinallyContext): 11125 (JSC::BytecodeGenerator::popFinallyContext): 11126 (JSC::BytecodeGenerator::breakTarget): 11127 (JSC::BytecodeGenerator::continueTarget): 11128 (JSC::BytecodeGenerator::emitComplexJumpScopes): 11129 (JSC::BytecodeGenerator::emitJumpScopes): 11130 (JSC::BytecodeGenerator::emitNextPropertyName): 11131 (JSC::BytecodeGenerator::emitCatch): 11132 (JSC::BytecodeGenerator::emitNewError): 11133 (JSC::BytecodeGenerator::emitJumpSubroutine): 11134 (JSC::BytecodeGenerator::emitSubroutineReturn): 11135 (JSC::BytecodeGenerator::emitPushNewScope): 11136 (JSC::BytecodeGenerator::beginSwitch): 11137 (JSC::BytecodeGenerator::endSwitch): 11138 (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException): 11139 * bytecompiler/CodeGenerator.h: 11140 * jsc.cpp: 11141 (runWithScripts): 11142 * parser/Nodes.cpp: 11143 (JSC::ThrowableExpressionData::emitThrowError): 11144 (JSC::NullNode::emitBytecode): 11145 (JSC::BooleanNode::emitBytecode): 11146 (JSC::NumberNode::emitBytecode): 11147 (JSC::StringNode::emitBytecode): 11148 (JSC::RegExpNode::emitBytecode): 11149 (JSC::ThisNode::emitBytecode): 11150 (JSC::ResolveNode::isPure): 11151 (JSC::ResolveNode::emitBytecode): 11152 (JSC::ArrayNode::emitBytecode): 11153 (JSC::ObjectLiteralNode::emitBytecode): 11154 (JSC::PropertyListNode::emitBytecode): 11155 (JSC::BracketAccessorNode::emitBytecode): 11156 (JSC::DotAccessorNode::emitBytecode): 11157 (JSC::ArgumentListNode::emitBytecode): 11158 (JSC::NewExprNode::emitBytecode): 11159 (JSC::EvalFunctionCallNode::emitBytecode): 11160 (JSC::FunctionCallValueNode::emitBytecode): 11161 (JSC::FunctionCallResolveNode::emitBytecode): 11162 (JSC::FunctionCallBracketNode::emitBytecode): 11163 (JSC::FunctionCallDotNode::emitBytecode): 11164 (JSC::emitPreIncOrDec): 11165 (JSC::emitPostIncOrDec): 11166 (JSC::PostfixResolveNode::emitBytecode): 11167 (JSC::PostfixBracketNode::emitBytecode): 11168 (JSC::PostfixDotNode::emitBytecode): 11169 (JSC::PostfixErrorNode::emitBytecode): 11170 (JSC::DeleteResolveNode::emitBytecode): 11171 (JSC::DeleteBracketNode::emitBytecode): 11172 (JSC::DeleteDotNode::emitBytecode): 11173 (JSC::DeleteValueNode::emitBytecode): 11174 (JSC::VoidNode::emitBytecode): 11175 (JSC::TypeOfResolveNode::emitBytecode): 11176 (JSC::TypeOfValueNode::emitBytecode): 11177 (JSC::PrefixResolveNode::emitBytecode): 11178 (JSC::PrefixBracketNode::emitBytecode): 11179 (JSC::PrefixDotNode::emitBytecode): 11180 (JSC::PrefixErrorNode::emitBytecode): 11181 (JSC::UnaryOpNode::emitBytecode): 11182 (JSC::BinaryOpNode::emitBytecode): 11183 (JSC::EqualNode::emitBytecode): 11184 (JSC::StrictEqualNode::emitBytecode): 11185 (JSC::ReverseBinaryOpNode::emitBytecode): 11186 (JSC::ThrowableBinaryOpNode::emitBytecode): 11187 (JSC::InstanceOfNode::emitBytecode): 11188 (JSC::LogicalOpNode::emitBytecode): 11189 (JSC::ConditionalNode::emitBytecode): 11190 (JSC::emitReadModifyAssignment): 11191 (JSC::ReadModifyResolveNode::emitBytecode): 11192 (JSC::AssignResolveNode::emitBytecode): 11193 (JSC::AssignDotNode::emitBytecode): 11194 (JSC::ReadModifyDotNode::emitBytecode): 11195 (JSC::AssignErrorNode::emitBytecode): 11196 (JSC::AssignBracketNode::emitBytecode): 11197 (JSC::ReadModifyBracketNode::emitBytecode): 11198 (JSC::CommaNode::emitBytecode): 11199 (JSC::ConstDeclNode::emitCodeSingle): 11200 (JSC::ConstDeclNode::emitBytecode): 11201 (JSC::ConstStatementNode::emitBytecode): 11202 (JSC::statementListEmitCode): 11203 (JSC::BlockNode::emitBytecode): 11204 (JSC::EmptyStatementNode::emitBytecode): 11205 (JSC::DebuggerStatementNode::emitBytecode): 11206 (JSC::ExprStatementNode::emitBytecode): 11207 (JSC::VarStatementNode::emitBytecode): 11208 (JSC::IfNode::emitBytecode): 11209 (JSC::IfElseNode::emitBytecode): 11210 (JSC::DoWhileNode::emitBytecode): 11211 (JSC::WhileNode::emitBytecode): 11212 (JSC::ForNode::emitBytecode): 11213 (JSC::ForInNode::emitBytecode): 11214 (JSC::ContinueNode::emitBytecode): 11215 (JSC::BreakNode::emitBytecode): 11216 (JSC::ReturnNode::emitBytecode): 11217 (JSC::WithNode::emitBytecode): 11218 (JSC::CaseBlockNode::emitBytecodeForBlock): 11219 (JSC::SwitchNode::emitBytecode): 11220 (JSC::LabelNode::emitBytecode): 11221 (JSC::ThrowNode::emitBytecode): 11222 (JSC::TryNode::emitBytecode): 11223 (JSC::EvalNode::emitBytecode): 11224 (JSC::EvalNode::generateBytecode): 11225 (JSC::FunctionBodyNode::generateBytecode): 11226 (JSC::FunctionBodyNode::emitBytecode): 11227 (JSC::ProgramNode::emitBytecode): 11228 (JSC::ProgramNode::generateBytecode): 11229 (JSC::FuncDeclNode::emitBytecode): 11230 (JSC::FuncExprNode::emitBytecode): 11231 * parser/Nodes.h: 11232 (JSC::ExpressionNode::): 11233 (JSC::BooleanNode::): 11234 (JSC::NumberNode::): 11235 (JSC::StringNode::): 11236 (JSC::ProgramNode::): 11237 (JSC::EvalNode::): 11238 (JSC::FunctionBodyNode::): 11239 * runtime/Arguments.h: 11240 (JSC::Arguments::getArgumentsData): 11241 (JSC::JSActivation::copyRegisters): 11242 * runtime/JSActivation.cpp: 11243 (JSC::JSActivation::mark): 11244 * runtime/JSActivation.h: 11245 (JSC::JSActivation::JSActivationData::JSActivationData): 11246 * runtime/JSFunction.cpp: 11247 (JSC::JSFunction::~JSFunction): 11248 112492008-11-15 Geoffrey Garen <ggaren@apple.com> 11250 11251 Reviewed by Sam Weinig. 11252 11253 Renamed all forms of "byte code" "opcode" "op code" "code" "bitcode" 11254 etc. to "bytecode". 11255 11256 * VM/CTI.cpp: 11257 (JSC::CTI::printBytecodeOperandTypes): 11258 (JSC::CTI::emitAllocateNumber): 11259 (JSC::CTI::emitNakedCall): 11260 (JSC::CTI::emitNakedFastCall): 11261 (JSC::CTI::emitCTICall): 11262 (JSC::CTI::emitJumpSlowCaseIfNotJSCell): 11263 (JSC::CTI::emitJumpSlowCaseIfNotImmNum): 11264 (JSC::CTI::emitJumpSlowCaseIfNotImmNums): 11265 (JSC::CTI::emitFastArithIntToImmOrSlowCase): 11266 (JSC::CTI::compileOpCall): 11267 (JSC::CTI::emitSlowScriptCheck): 11268 (JSC::CTI::compileBinaryArithOp): 11269 (JSC::CTI::compileBinaryArithOpSlowCase): 11270 (JSC::CTI::privateCompileMainPass): 11271 (JSC::CTI::privateCompileSlowCases): 11272 (JSC::CTI::privateCompile): 11273 * VM/CTI.h: 11274 (JSC::CallRecord::CallRecord): 11275 (JSC::SwitchRecord::SwitchRecord): 11276 * VM/CodeBlock.cpp: 11277 (JSC::CodeBlock::printStructureIDs): 11278 (JSC::CodeBlock::dump): 11279 (JSC::CodeBlock::~CodeBlock): 11280 (JSC::CodeBlock::derefStructureIDs): 11281 (JSC::CodeBlock::refStructureIDs): 11282 * VM/CodeBlock.h: 11283 (JSC::StructureStubInfo::StructureStubInfo): 11284 * VM/ExceptionHelpers.cpp: 11285 (JSC::createNotAnObjectError): 11286 * VM/Instruction.h: 11287 (JSC::Instruction::Instruction): 11288 (JSC::Instruction::): 11289 * VM/Machine.cpp: 11290 (JSC::BytecodeInterpreter::isBytecode): 11291 (JSC::BytecodeInterpreter::throwException): 11292 (JSC::BytecodeInterpreter::execute): 11293 (JSC::BytecodeInterpreter::tryCachePutByID): 11294 (JSC::BytecodeInterpreter::uncachePutByID): 11295 (JSC::BytecodeInterpreter::tryCacheGetByID): 11296 (JSC::BytecodeInterpreter::uncacheGetByID): 11297 (JSC::BytecodeInterpreter::privateExecute): 11298 (JSC::BytecodeInterpreter::tryCTICachePutByID): 11299 (JSC::BytecodeInterpreter::tryCTICacheGetByID): 11300 (JSC::BytecodeInterpreter::cti_op_call_JSFunction): 11301 (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall): 11302 (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall): 11303 * VM/Machine.h: 11304 (JSC::BytecodeInterpreter::getBytecode): 11305 (JSC::BytecodeInterpreter::getBytecodeID): 11306 (JSC::BytecodeInterpreter::isCallBytecode): 11307 * VM/Opcode.cpp: 11308 (JSC::): 11309 (JSC::BytecodeStats::BytecodeStats): 11310 (JSC::compareBytecodeIndices): 11311 (JSC::compareBytecodePairIndices): 11312 (JSC::BytecodeStats::~BytecodeStats): 11313 (JSC::BytecodeStats::recordInstruction): 11314 (JSC::BytecodeStats::resetLastInstruction): 11315 * VM/Opcode.h: 11316 (JSC::): 11317 (JSC::padBytecodeName): 11318 * VM/SamplingTool.cpp: 11319 (JSC::ScopeSampleRecord::sample): 11320 (JSC::SamplingTool::run): 11321 (JSC::compareBytecodeIndicesSampling): 11322 (JSC::SamplingTool::dump): 11323 * VM/SamplingTool.h: 11324 (JSC::ScopeSampleRecord::ScopeSampleRecord): 11325 (JSC::SamplingTool::SamplingTool): 11326 * bytecompiler/CodeGenerator.cpp: 11327 (JSC::CodeGenerator::generate): 11328 (JSC::CodeGenerator::CodeGenerator): 11329 (JSC::CodeGenerator::emitLabel): 11330 (JSC::CodeGenerator::emitBytecode): 11331 (JSC::CodeGenerator::emitJump): 11332 (JSC::CodeGenerator::emitJumpIfTrue): 11333 (JSC::CodeGenerator::emitJumpIfFalse): 11334 (JSC::CodeGenerator::emitMove): 11335 (JSC::CodeGenerator::emitUnaryOp): 11336 (JSC::CodeGenerator::emitPreInc): 11337 (JSC::CodeGenerator::emitPreDec): 11338 (JSC::CodeGenerator::emitPostInc): 11339 (JSC::CodeGenerator::emitPostDec): 11340 (JSC::CodeGenerator::emitBinaryOp): 11341 (JSC::CodeGenerator::emitEqualityOp): 11342 (JSC::CodeGenerator::emitUnexpectedLoad): 11343 (JSC::CodeGenerator::emitInstanceOf): 11344 (JSC::CodeGenerator::emitResolve): 11345 (JSC::CodeGenerator::emitGetScopedVar): 11346 (JSC::CodeGenerator::emitPutScopedVar): 11347 (JSC::CodeGenerator::emitResolveBase): 11348 (JSC::CodeGenerator::emitResolveWithBase): 11349 (JSC::CodeGenerator::emitResolveFunction): 11350 (JSC::CodeGenerator::emitGetById): 11351 (JSC::CodeGenerator::emitPutById): 11352 (JSC::CodeGenerator::emitPutGetter): 11353 (JSC::CodeGenerator::emitPutSetter): 11354 (JSC::CodeGenerator::emitDeleteById): 11355 (JSC::CodeGenerator::emitGetByVal): 11356 (JSC::CodeGenerator::emitPutByVal): 11357 (JSC::CodeGenerator::emitDeleteByVal): 11358 (JSC::CodeGenerator::emitPutByIndex): 11359 (JSC::CodeGenerator::emitNewObject): 11360 (JSC::CodeGenerator::emitNewArray): 11361 (JSC::CodeGenerator::emitNewFunction): 11362 (JSC::CodeGenerator::emitNewRegExp): 11363 (JSC::CodeGenerator::emitNewFunctionExpression): 11364 (JSC::CodeGenerator::emitCall): 11365 (JSC::CodeGenerator::emitReturn): 11366 (JSC::CodeGenerator::emitUnaryNoDstOp): 11367 (JSC::CodeGenerator::emitConstruct): 11368 (JSC::CodeGenerator::emitPopScope): 11369 (JSC::CodeGenerator::emitDebugHook): 11370 (JSC::CodeGenerator::emitComplexJumpScopes): 11371 (JSC::CodeGenerator::emitJumpScopes): 11372 (JSC::CodeGenerator::emitNextPropertyName): 11373 (JSC::CodeGenerator::emitCatch): 11374 (JSC::CodeGenerator::emitNewError): 11375 (JSC::CodeGenerator::emitJumpSubroutine): 11376 (JSC::CodeGenerator::emitSubroutineReturn): 11377 (JSC::CodeGenerator::emitPushNewScope): 11378 (JSC::CodeGenerator::beginSwitch): 11379 (JSC::CodeGenerator::endSwitch): 11380 * bytecompiler/CodeGenerator.h: 11381 (JSC::CodeGenerator::emitNode): 11382 * jsc.cpp: 11383 (runWithScripts): 11384 * masm/X86Assembler.h: 11385 (JSC::X86Assembler::): 11386 (JSC::X86Assembler::emitModRm_opr): 11387 (JSC::X86Assembler::emitModRm_opr_Unchecked): 11388 (JSC::X86Assembler::emitModRm_opm): 11389 (JSC::X86Assembler::emitModRm_opm_Unchecked): 11390 (JSC::X86Assembler::emitModRm_opmsib): 11391 * parser/Nodes.cpp: 11392 (JSC::NullNode::emitBytecode): 11393 (JSC::BooleanNode::emitBytecode): 11394 (JSC::NumberNode::emitBytecode): 11395 (JSC::StringNode::emitBytecode): 11396 (JSC::RegExpNode::emitBytecode): 11397 (JSC::ThisNode::emitBytecode): 11398 (JSC::ResolveNode::emitBytecode): 11399 (JSC::ArrayNode::emitBytecode): 11400 (JSC::ObjectLiteralNode::emitBytecode): 11401 (JSC::PropertyListNode::emitBytecode): 11402 (JSC::BracketAccessorNode::emitBytecode): 11403 (JSC::DotAccessorNode::emitBytecode): 11404 (JSC::ArgumentListNode::emitBytecode): 11405 (JSC::NewExprNode::emitBytecode): 11406 (JSC::EvalFunctionCallNode::emitBytecode): 11407 (JSC::FunctionCallValueNode::emitBytecode): 11408 (JSC::FunctionCallResolveNode::emitBytecode): 11409 (JSC::FunctionCallBracketNode::emitBytecode): 11410 (JSC::FunctionCallDotNode::emitBytecode): 11411 (JSC::PostfixResolveNode::emitBytecode): 11412 (JSC::PostfixBracketNode::emitBytecode): 11413 (JSC::PostfixDotNode::emitBytecode): 11414 (JSC::PostfixErrorNode::emitBytecode): 11415 (JSC::DeleteResolveNode::emitBytecode): 11416 (JSC::DeleteBracketNode::emitBytecode): 11417 (JSC::DeleteDotNode::emitBytecode): 11418 (JSC::DeleteValueNode::emitBytecode): 11419 (JSC::VoidNode::emitBytecode): 11420 (JSC::TypeOfResolveNode::emitBytecode): 11421 (JSC::TypeOfValueNode::emitBytecode): 11422 (JSC::PrefixResolveNode::emitBytecode): 11423 (JSC::PrefixBracketNode::emitBytecode): 11424 (JSC::PrefixDotNode::emitBytecode): 11425 (JSC::PrefixErrorNode::emitBytecode): 11426 (JSC::UnaryOpNode::emitBytecode): 11427 (JSC::BinaryOpNode::emitBytecode): 11428 (JSC::EqualNode::emitBytecode): 11429 (JSC::StrictEqualNode::emitBytecode): 11430 (JSC::ReverseBinaryOpNode::emitBytecode): 11431 (JSC::ThrowableBinaryOpNode::emitBytecode): 11432 (JSC::InstanceOfNode::emitBytecode): 11433 (JSC::LogicalOpNode::emitBytecode): 11434 (JSC::ConditionalNode::emitBytecode): 11435 (JSC::emitReadModifyAssignment): 11436 (JSC::ReadModifyResolveNode::emitBytecode): 11437 (JSC::AssignResolveNode::emitBytecode): 11438 (JSC::AssignDotNode::emitBytecode): 11439 (JSC::ReadModifyDotNode::emitBytecode): 11440 (JSC::AssignErrorNode::emitBytecode): 11441 (JSC::AssignBracketNode::emitBytecode): 11442 (JSC::ReadModifyBracketNode::emitBytecode): 11443 (JSC::CommaNode::emitBytecode): 11444 (JSC::ConstDeclNode::emitBytecode): 11445 (JSC::ConstStatementNode::emitBytecode): 11446 (JSC::BlockNode::emitBytecode): 11447 (JSC::EmptyStatementNode::emitBytecode): 11448 (JSC::DebuggerStatementNode::emitBytecode): 11449 (JSC::ExprStatementNode::emitBytecode): 11450 (JSC::VarStatementNode::emitBytecode): 11451 (JSC::IfNode::emitBytecode): 11452 (JSC::IfElseNode::emitBytecode): 11453 (JSC::DoWhileNode::emitBytecode): 11454 (JSC::WhileNode::emitBytecode): 11455 (JSC::ForNode::emitBytecode): 11456 (JSC::ForInNode::emitBytecode): 11457 (JSC::ContinueNode::emitBytecode): 11458 (JSC::BreakNode::emitBytecode): 11459 (JSC::ReturnNode::emitBytecode): 11460 (JSC::WithNode::emitBytecode): 11461 (JSC::SwitchNode::emitBytecode): 11462 (JSC::LabelNode::emitBytecode): 11463 (JSC::ThrowNode::emitBytecode): 11464 (JSC::TryNode::emitBytecode): 11465 (JSC::ScopeNode::ScopeNode): 11466 (JSC::EvalNode::emitBytecode): 11467 (JSC::FunctionBodyNode::emitBytecode): 11468 (JSC::ProgramNode::emitBytecode): 11469 (JSC::FuncDeclNode::emitBytecode): 11470 (JSC::FuncExprNode::emitBytecode): 11471 * parser/Nodes.h: 11472 (JSC::UnaryPlusNode::): 11473 (JSC::NegateNode::): 11474 (JSC::BitwiseNotNode::): 11475 (JSC::LogicalNotNode::): 11476 (JSC::MultNode::): 11477 (JSC::DivNode::): 11478 (JSC::ModNode::): 11479 (JSC::AddNode::): 11480 (JSC::SubNode::): 11481 (JSC::LeftShiftNode::): 11482 (JSC::RightShiftNode::): 11483 (JSC::UnsignedRightShiftNode::): 11484 (JSC::LessNode::): 11485 (JSC::GreaterNode::): 11486 (JSC::LessEqNode::): 11487 (JSC::GreaterEqNode::): 11488 (JSC::InstanceOfNode::): 11489 (JSC::InNode::): 11490 (JSC::EqualNode::): 11491 (JSC::NotEqualNode::): 11492 (JSC::StrictEqualNode::): 11493 (JSC::NotStrictEqualNode::): 11494 (JSC::BitAndNode::): 11495 (JSC::BitOrNode::): 11496 (JSC::BitXOrNode::): 11497 (JSC::ProgramNode::): 11498 (JSC::EvalNode::): 11499 (JSC::FunctionBodyNode::): 11500 * runtime/JSNotAnObject.h: 11501 * runtime/StructureID.cpp: 11502 (JSC::StructureID::fromDictionaryTransition): 11503 * wtf/Platform.h: 11504 115052008-11-15 Geoffrey Garen <ggaren@apple.com> 11506 11507 Reviewed by Sam Weinig. 11508 11509 Renamed Machine to BytecodeInterpreter. 11510 11511 Nixed the Interpreter class, and changed its two functions to stand-alone 11512 functions. 11513 11514 * JavaScriptCore.exp: 11515 * VM/CTI.cpp: 11516 (JSC::): 11517 (JSC::CTI::emitCTICall): 11518 (JSC::CTI::CTI): 11519 (JSC::CTI::compileOpCall): 11520 (JSC::CTI::emitSlowScriptCheck): 11521 (JSC::CTI::compileBinaryArithOpSlowCase): 11522 (JSC::CTI::privateCompileMainPass): 11523 (JSC::CTI::privateCompileSlowCases): 11524 (JSC::CTI::privateCompile): 11525 (JSC::CTI::privateCompileGetByIdSelf): 11526 (JSC::CTI::privateCompileGetByIdProto): 11527 (JSC::CTI::privateCompileGetByIdChain): 11528 (JSC::CTI::privateCompilePutByIdReplace): 11529 (JSC::CTI::privateCompilePutByIdTransition): 11530 (JSC::CTI::privateCompileCTIMachineTrampolines): 11531 (JSC::CTI::freeCTIMachineTrampolines): 11532 (JSC::CTI::patchGetByIdSelf): 11533 (JSC::CTI::patchPutByIdReplace): 11534 (JSC::CTI::privateCompilePatchGetArrayLength): 11535 (JSC::CTI::compileRegExp): 11536 * VM/CTI.h: 11537 * VM/CodeBlock.cpp: 11538 (JSC::CodeBlock::printStructureIDs): 11539 (JSC::CodeBlock::dump): 11540 (JSC::CodeBlock::derefStructureIDs): 11541 (JSC::CodeBlock::refStructureIDs): 11542 * VM/ExceptionHelpers.cpp: 11543 (JSC::createNotAnObjectError): 11544 * VM/Machine.cpp: 11545 (JSC::jsLess): 11546 (JSC::jsLessEq): 11547 (JSC::BytecodeInterpreter::resolve): 11548 (JSC::BytecodeInterpreter::resolveSkip): 11549 (JSC::BytecodeInterpreter::resolveGlobal): 11550 (JSC::BytecodeInterpreter::resolveBase): 11551 (JSC::BytecodeInterpreter::resolveBaseAndProperty): 11552 (JSC::BytecodeInterpreter::resolveBaseAndFunc): 11553 (JSC::BytecodeInterpreter::slideRegisterWindowForCall): 11554 (JSC::BytecodeInterpreter::callEval): 11555 (JSC::BytecodeInterpreter::BytecodeInterpreter): 11556 (JSC::BytecodeInterpreter::initialize): 11557 (JSC::BytecodeInterpreter::~BytecodeInterpreter): 11558 (JSC::BytecodeInterpreter::dumpCallFrame): 11559 (JSC::BytecodeInterpreter::dumpRegisters): 11560 (JSC::BytecodeInterpreter::isOpcode): 11561 (JSC::BytecodeInterpreter::unwindCallFrame): 11562 (JSC::BytecodeInterpreter::throwException): 11563 (JSC::BytecodeInterpreter::execute): 11564 (JSC::BytecodeInterpreter::debug): 11565 (JSC::BytecodeInterpreter::resetTimeoutCheck): 11566 (JSC::BytecodeInterpreter::checkTimeout): 11567 (JSC::BytecodeInterpreter::createExceptionScope): 11568 (JSC::BytecodeInterpreter::tryCachePutByID): 11569 (JSC::BytecodeInterpreter::uncachePutByID): 11570 (JSC::BytecodeInterpreter::tryCacheGetByID): 11571 (JSC::BytecodeInterpreter::uncacheGetByID): 11572 (JSC::BytecodeInterpreter::privateExecute): 11573 (JSC::BytecodeInterpreter::retrieveArguments): 11574 (JSC::BytecodeInterpreter::retrieveCaller): 11575 (JSC::BytecodeInterpreter::retrieveLastCaller): 11576 (JSC::BytecodeInterpreter::findFunctionCallFrame): 11577 (JSC::BytecodeInterpreter::tryCTICachePutByID): 11578 (JSC::BytecodeInterpreter::tryCTICacheGetByID): 11579 (JSC::BytecodeInterpreter::cti_op_convert_this): 11580 (JSC::BytecodeInterpreter::cti_op_end): 11581 (JSC::BytecodeInterpreter::cti_op_add): 11582 (JSC::BytecodeInterpreter::cti_op_pre_inc): 11583 (JSC::BytecodeInterpreter::cti_timeout_check): 11584 (JSC::BytecodeInterpreter::cti_register_file_check): 11585 (JSC::BytecodeInterpreter::cti_op_loop_if_less): 11586 (JSC::BytecodeInterpreter::cti_op_loop_if_lesseq): 11587 (JSC::BytecodeInterpreter::cti_op_new_object): 11588 (JSC::BytecodeInterpreter::cti_op_put_by_id): 11589 (JSC::BytecodeInterpreter::cti_op_put_by_id_second): 11590 (JSC::BytecodeInterpreter::cti_op_put_by_id_generic): 11591 (JSC::BytecodeInterpreter::cti_op_put_by_id_fail): 11592 (JSC::BytecodeInterpreter::cti_op_get_by_id): 11593 (JSC::BytecodeInterpreter::cti_op_get_by_id_second): 11594 (JSC::BytecodeInterpreter::cti_op_get_by_id_generic): 11595 (JSC::BytecodeInterpreter::cti_op_get_by_id_fail): 11596 (JSC::BytecodeInterpreter::cti_op_instanceof): 11597 (JSC::BytecodeInterpreter::cti_op_del_by_id): 11598 (JSC::BytecodeInterpreter::cti_op_mul): 11599 (JSC::BytecodeInterpreter::cti_op_new_func): 11600 (JSC::BytecodeInterpreter::cti_op_call_JSFunction): 11601 (JSC::BytecodeInterpreter::cti_op_call_arityCheck): 11602 (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall): 11603 (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall): 11604 (JSC::BytecodeInterpreter::cti_op_push_activation): 11605 (JSC::BytecodeInterpreter::cti_op_call_NotJSFunction): 11606 (JSC::BytecodeInterpreter::cti_op_create_arguments): 11607 (JSC::BytecodeInterpreter::cti_op_create_arguments_no_params): 11608 (JSC::BytecodeInterpreter::cti_op_tear_off_activation): 11609 (JSC::BytecodeInterpreter::cti_op_tear_off_arguments): 11610 (JSC::BytecodeInterpreter::cti_op_profile_will_call): 11611 (JSC::BytecodeInterpreter::cti_op_profile_did_call): 11612 (JSC::BytecodeInterpreter::cti_op_ret_scopeChain): 11613 (JSC::BytecodeInterpreter::cti_op_new_array): 11614 (JSC::BytecodeInterpreter::cti_op_resolve): 11615 (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct): 11616 (JSC::BytecodeInterpreter::cti_op_construct_NotJSConstruct): 11617 (JSC::BytecodeInterpreter::cti_op_get_by_val): 11618 (JSC::BytecodeInterpreter::cti_op_resolve_func): 11619 (JSC::BytecodeInterpreter::cti_op_sub): 11620 (JSC::BytecodeInterpreter::cti_op_put_by_val): 11621 (JSC::BytecodeInterpreter::cti_op_put_by_val_array): 11622 (JSC::BytecodeInterpreter::cti_op_lesseq): 11623 (JSC::BytecodeInterpreter::cti_op_loop_if_true): 11624 (JSC::BytecodeInterpreter::cti_op_negate): 11625 (JSC::BytecodeInterpreter::cti_op_resolve_base): 11626 (JSC::BytecodeInterpreter::cti_op_resolve_skip): 11627 (JSC::BytecodeInterpreter::cti_op_resolve_global): 11628 (JSC::BytecodeInterpreter::cti_op_div): 11629 (JSC::BytecodeInterpreter::cti_op_pre_dec): 11630 (JSC::BytecodeInterpreter::cti_op_jless): 11631 (JSC::BytecodeInterpreter::cti_op_not): 11632 (JSC::BytecodeInterpreter::cti_op_jtrue): 11633 (JSC::BytecodeInterpreter::cti_op_post_inc): 11634 (JSC::BytecodeInterpreter::cti_op_eq): 11635 (JSC::BytecodeInterpreter::cti_op_lshift): 11636 (JSC::BytecodeInterpreter::cti_op_bitand): 11637 (JSC::BytecodeInterpreter::cti_op_rshift): 11638 (JSC::BytecodeInterpreter::cti_op_bitnot): 11639 (JSC::BytecodeInterpreter::cti_op_resolve_with_base): 11640 (JSC::BytecodeInterpreter::cti_op_new_func_exp): 11641 (JSC::BytecodeInterpreter::cti_op_mod): 11642 (JSC::BytecodeInterpreter::cti_op_less): 11643 (JSC::BytecodeInterpreter::cti_op_neq): 11644 (JSC::BytecodeInterpreter::cti_op_post_dec): 11645 (JSC::BytecodeInterpreter::cti_op_urshift): 11646 (JSC::BytecodeInterpreter::cti_op_bitxor): 11647 (JSC::BytecodeInterpreter::cti_op_new_regexp): 11648 (JSC::BytecodeInterpreter::cti_op_bitor): 11649 (JSC::BytecodeInterpreter::cti_op_call_eval): 11650 (JSC::BytecodeInterpreter::cti_op_throw): 11651 (JSC::BytecodeInterpreter::cti_op_get_pnames): 11652 (JSC::BytecodeInterpreter::cti_op_next_pname): 11653 (JSC::BytecodeInterpreter::cti_op_push_scope): 11654 (JSC::BytecodeInterpreter::cti_op_pop_scope): 11655 (JSC::BytecodeInterpreter::cti_op_typeof): 11656 (JSC::BytecodeInterpreter::cti_op_is_undefined): 11657 (JSC::BytecodeInterpreter::cti_op_is_boolean): 11658 (JSC::BytecodeInterpreter::cti_op_is_number): 11659 (JSC::BytecodeInterpreter::cti_op_is_string): 11660 (JSC::BytecodeInterpreter::cti_op_is_object): 11661 (JSC::BytecodeInterpreter::cti_op_is_function): 11662 (JSC::BytecodeInterpreter::cti_op_stricteq): 11663 (JSC::BytecodeInterpreter::cti_op_nstricteq): 11664 (JSC::BytecodeInterpreter::cti_op_to_jsnumber): 11665 (JSC::BytecodeInterpreter::cti_op_in): 11666 (JSC::BytecodeInterpreter::cti_op_push_new_scope): 11667 (JSC::BytecodeInterpreter::cti_op_jmp_scopes): 11668 (JSC::BytecodeInterpreter::cti_op_put_by_index): 11669 (JSC::BytecodeInterpreter::cti_op_switch_imm): 11670 (JSC::BytecodeInterpreter::cti_op_switch_char): 11671 (JSC::BytecodeInterpreter::cti_op_switch_string): 11672 (JSC::BytecodeInterpreter::cti_op_del_by_val): 11673 (JSC::BytecodeInterpreter::cti_op_put_getter): 11674 (JSC::BytecodeInterpreter::cti_op_put_setter): 11675 (JSC::BytecodeInterpreter::cti_op_new_error): 11676 (JSC::BytecodeInterpreter::cti_op_debug): 11677 (JSC::BytecodeInterpreter::cti_vm_throw): 11678 * VM/Machine.h: 11679 * VM/Register.h: 11680 * VM/SamplingTool.cpp: 11681 (JSC::SamplingTool::run): 11682 * VM/SamplingTool.h: 11683 (JSC::SamplingTool::SamplingTool): 11684 * bytecompiler/CodeGenerator.cpp: 11685 (JSC::CodeGenerator::generate): 11686 (JSC::CodeGenerator::CodeGenerator): 11687 (JSC::CodeGenerator::emitOpcode): 11688 * debugger/DebuggerCallFrame.cpp: 11689 (JSC::DebuggerCallFrame::evaluate): 11690 * jsc.cpp: 11691 (runWithScripts): 11692 * parser/Nodes.cpp: 11693 (JSC::ScopeNode::ScopeNode): 11694 * profiler/ProfileGenerator.cpp: 11695 (JSC::ProfileGenerator::addParentForConsoleStart): 11696 * runtime/ArrayPrototype.cpp: 11697 (JSC::arrayProtoFuncPop): 11698 (JSC::arrayProtoFuncPush): 11699 * runtime/Collector.cpp: 11700 (JSC::Heap::collect): 11701 * runtime/ExecState.h: 11702 (JSC::ExecState::interpreter): 11703 * runtime/FunctionPrototype.cpp: 11704 (JSC::functionProtoFuncApply): 11705 * runtime/Interpreter.cpp: 11706 (JSC::Interpreter::evaluate): 11707 * runtime/JSCell.h: 11708 * runtime/JSFunction.cpp: 11709 (JSC::JSFunction::call): 11710 (JSC::JSFunction::argumentsGetter): 11711 (JSC::JSFunction::callerGetter): 11712 (JSC::JSFunction::construct): 11713 * runtime/JSFunction.h: 11714 * runtime/JSGlobalData.cpp: 11715 (JSC::JSGlobalData::JSGlobalData): 11716 (JSC::JSGlobalData::~JSGlobalData): 11717 * runtime/JSGlobalData.h: 11718 * runtime/JSGlobalObject.cpp: 11719 (JSC::JSGlobalObject::~JSGlobalObject): 11720 (JSC::JSGlobalObject::setTimeoutTime): 11721 (JSC::JSGlobalObject::startTimeoutCheck): 11722 (JSC::JSGlobalObject::stopTimeoutCheck): 11723 (JSC::JSGlobalObject::mark): 11724 * runtime/JSGlobalObjectFunctions.cpp: 11725 (JSC::globalFuncEval): 11726 * runtime/JSString.h: 11727 * runtime/RegExp.cpp: 11728 (JSC::RegExp::RegExp): 11729 117302008-11-15 Maciej Stachowiak <mjs@apple.com> 11731 11732 Reviewed by Sam Weinig. 11733 11734 - Remove SymbolTable from FunctionBodyNode and move it to CodeBlock 11735 11736 It's not needed for functions that have never been executed, so no 11737 need to waste the memory. Saves ~4M on membuster after 30 pages. 11738 11739 * VM/CodeBlock.h: 11740 * VM/Machine.cpp: 11741 (JSC::Machine::retrieveArguments): 11742 * parser/Nodes.cpp: 11743 (JSC::EvalNode::generateCode): 11744 (JSC::FunctionBodyNode::generateCode): 11745 * parser/Nodes.h: 11746 * runtime/JSActivation.h: 11747 (JSC::JSActivation::JSActivationData::JSActivationData): 11748 117492008-11-14 Cameron Zwarich <zwarich@apple.com> 11750 11751 Reviewed by Darin Adler. 11752 11753 Bug 22259: Make all opcodes use eax as their final result register 11754 <https://bugs.webkit.org/show_bug.cgi?id=22259> 11755 11756 Change one case of op_add (and the corresponding slow case) to use eax 11757 rather than edx. Also, change the order in which the two results of 11758 resolve_func and resolve_base are emitted so that the retrieved value is 11759 put last into eax. 11760 11761 This gives no performance change on SunSpider or the V8 benchmark suite 11762 when run in either harness. 11763 11764 * VM/CTI.cpp: 11765 (JSC::CTI::privateCompileMainPass): 11766 (JSC::CTI::privateCompileSlowCases): 11767 117682008-11-14 Gavin Barraclough <barraclough@apple.com> 11769 11770 Reviewed by Geoff Garen. 11771 11772 Geoff has this wacky notion that emitGetArg and emitPutArg should be related to 11773 doing the same thing. Crazy. 11774 11775 Rename the methods for accessing virtual registers to say 'VirtualRegister' in the 11776 name, and those for setting up the arguments for CTI methods to contain 'CTIArg'. 11777 11778 * VM/CTI.cpp: 11779 (JSC::CTI::emitGetVirtualRegister): 11780 (JSC::CTI::emitGetVirtualRegisters): 11781 (JSC::CTI::emitPutCTIArgFromVirtualRegister): 11782 (JSC::CTI::emitPutCTIArg): 11783 (JSC::CTI::emitGetCTIArg): 11784 (JSC::CTI::emitPutCTIArgConstant): 11785 (JSC::CTI::emitPutVirtualRegister): 11786 (JSC::CTI::compileOpCallSetupArgs): 11787 (JSC::CTI::compileOpCallEvalSetupArgs): 11788 (JSC::CTI::compileOpConstructSetupArgs): 11789 (JSC::CTI::compileOpCall): 11790 (JSC::CTI::compileOpStrictEq): 11791 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): 11792 (JSC::CTI::compileBinaryArithOp): 11793 (JSC::CTI::compileBinaryArithOpSlowCase): 11794 (JSC::CTI::privateCompileMainPass): 11795 (JSC::CTI::privateCompileSlowCases): 11796 (JSC::CTI::privateCompileCTIMachineTrampolines): 11797 * VM/CTI.h: 11798 117992008-11-14 Greg Bolsinga <bolsinga@apple.com> 11800 11801 Reviewed by Antti Koivisto 11802 11803 Fix potential build break by adding StdLibExtras.h 11804 11805 * GNUmakefile.am: 11806 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 11807 118082008-11-14 Gavin Barraclough <barraclough@apple.com> 11809 11810 Reviewed by Geoff Garen. 11811 11812 Generate less code for the slow cases of op_call and op_construct. 11813 https://bugs.webkit.org/show_bug.cgi?id=22272 11814 11815 1% progression on v8 tests. 11816 11817 * VM/CTI.cpp: 11818 (JSC::CTI::emitRetrieveArg): 11819 (JSC::CTI::emitNakedCall): 11820 (JSC::CTI::compileOpCallInitializeCallFrame): 11821 (JSC::CTI::compileOpCall): 11822 (JSC::CTI::privateCompileSlowCases): 11823 (JSC::CTI::privateCompileCTIMachineTrampolines): 11824 * VM/CTI.h: 11825 * VM/CodeBlock.h: 11826 (JSC::getCallLinkInfoReturnLocation): 11827 (JSC::CodeBlock::getCallLinkInfo): 11828 * VM/Machine.cpp: 11829 (JSC::Machine::Machine): 11830 (JSC::Machine::cti_vm_dontLazyLinkCall): 11831 (JSC::Machine::cti_vm_lazyLinkCall): 11832 * VM/Machine.h: 11833 118342008-11-14 Greg Bolsinga <bolsinga@apple.com> 11835 11836 Reviewed by Darin Alder. 11837 11838 https://bugs.webkit.org/show_bug.cgi?id=21810 11839 Remove use of static C++ objects that are destroyed at exit time (destructors) 11840 11841 Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid 11842 exit-time destructor. Update code that was changed to fix this issue that ran 11843 into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference 11844 in gcc build 5465). Also typdefs for template types needed to be added in some 11845 cases so the type could make it through the macro successfully. 11846 11847 Basically code of the form: 11848 static T m; 11849 becomes: 11850 DEFINE_STATIC_LOCAL(T, m, ()); 11851 11852 Also any code of the form: 11853 static T& m = *new T; 11854 also becomes: 11855 DEFINE_STATIC_LOCAL(T, m, ()); 11856 11857 * JavaScriptCore.xcodeproj/project.pbxproj: 11858 * wtf/MainThread.cpp: 11859 (WTF::mainThreadFunctionQueueMutex): 11860 (WTF::functionQueue): 11861 * wtf/StdLibExtras.h: Added. Add DEFINE_STATIC_LOCAL macro 11862 * wtf/ThreadingPthreads.cpp: 11863 (WTF::threadMapMutex): 11864 (WTF::threadMap): 11865 (WTF::identifierByPthreadHandle): 11866 118672008-11-13 Sam Weinig <sam@webkit.org> 11868 11869 Reviewed by Darin Adler 11870 11871 Fix for https://bugs.webkit.org/show_bug.cgi?id=22269 11872 Reduce PropertyMap usage 11873 11874 From observation of StructureID statistics, it became clear that many 11875 StructureID's were not being used as StructureIDs themselves, but rather 11876 only being necessary as links in the transition chain. Acknowledging this 11877 and that PropertyMaps stored in StructureIDs can be treated as caches, that 11878 is that they can be reconstructed on demand, it became clear that we could 11879 reduce the memory consumption of StructureIDs by only keeping PropertyMaps 11880 for the StructureIDs that need them the most. 11881 11882 The specific strategy used to reduce the number of StructureIDs with 11883 PropertyMaps is to take the previous StructureIDs PropertyMap when initially 11884 transitioning (addPropertyTransition) from it and clearing out the pointer 11885 in the process. The next time we need to do the same transition, for instance 11886 repeated calls to the same constructor, we use the new addPropertyTransitionToExistingStructure 11887 first, which allows us not to need the PropertyMap to determine if the property 11888 exists already, since a transition to that property would require it not already 11889 be present in the StructureID. Should there be no transition, the PropertyMap 11890 can be constructed on demand (via materializePropertyMap) to determine if the put is a 11891 replace or a transition to a new StructureID. 11892 11893 Reduces memory use on Membuster head test (30 pages open) by ~15MB. 11894 11895 * JavaScriptCore.exp: 11896 * runtime/JSObject.h: 11897 (JSC::JSObject::putDirect): First use addPropertyTransitionToExistingStructure 11898 so that we can avoid building the PropertyMap on subsequent similar object 11899 creations. 11900 * runtime/PropertyMapHashTable.h: 11901 (JSC::PropertyMapEntry::PropertyMapEntry): Add version of constructor which takes 11902 all values to be used when lazily building the PropertyMap. 11903 * runtime/StructureID.cpp: 11904 (JSC::StructureID::dumpStatistics): Add statistics on the number of StructureIDs 11905 with PropertyMaps. 11906 (JSC::StructureID::StructureID): Rename m_cachedTransistionOffset to m_offset 11907 (JSC::isPowerOf2): 11908 (JSC::nextPowerOf2): 11909 (JSC::sizeForKeyCount): Returns the expected size of a PropertyMap for a key count. 11910 (JSC::StructureID::materializePropertyMap): Builds the PropertyMap out of its previous pointer chain. 11911 (JSC::StructureID::addPropertyTransitionToExistingStructure): Only transitions if there is a 11912 an existing transition. 11913 (JSC::StructureID::addPropertyTransition): Instead of always copying the ProperyMap, try and take 11914 it from it previous pointer. 11915 (JSC::StructureID::removePropertyTransition): Simplify by calling toDictionaryTransition() to do 11916 transition work. 11917 (JSC::StructureID::changePrototypeTransition): Build the PropertyMap if necessary before transitioning 11918 because once you have transitioned, you will not be able to reconstruct it afterwards as there is no 11919 previous pointer, pinning the ProperyMap as well. 11920 (JSC::StructureID::getterSetterTransition): Ditto. 11921 (JSC::StructureID::toDictionaryTransition): Pin the PropertyMap so that it is not destroyed on further transitions. 11922 (JSC::StructureID::fromDictionaryTransition): We can only transition back from a dictionary transition if there 11923 are no deleted offsets. 11924 (JSC::StructureID::addPropertyWithoutTransition): Build PropertyMap on demands and pin. 11925 (JSC::StructureID::removePropertyWithoutTransition): Ditto. 11926 (JSC::StructureID::get): Build on demand. 11927 (JSC::StructureID::createPropertyMapHashTable): Add version of create that takes a size 11928 for on demand building. 11929 (JSC::StructureID::expandPropertyMapHashTable): 11930 (JSC::StructureID::rehashPropertyMapHashTable): 11931 (JSC::StructureID::getEnumerablePropertyNamesInternal): Build PropertyMap on demand. 11932 * runtime/StructureID.h: 11933 (JSC::StructureID::propertyStorageSize): Account for StructureIDs without PropertyMaps. 11934 (JSC::StructureID::isEmpty): Ditto. 11935 (JSC::StructureID::materializePropertyMapIfNecessary): 11936 (JSC::StructureID::get): Build PropertyMap on demand 11937 119382008-11-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 11939 11940 Reviewed by Simon Hausmann. 11941 11942 <https://bugs.webkit.org/show_bug.cgi?id=21500> 11943 11944 JavaScriptCore build with -O3 flag instead of -O2 (gcc). 11945 2.02% speedup on SunSpider (Qt-port on Linux) 11946 1.10% speedup on V8 (Qt-port on Linux) 11947 3.45% speedup on WindScorpion (Qt-port on Linux) 11948 11949 * JavaScriptCore.pri: 11950 119512008-11-14 Kristian Amlie <kristian.amlie@trolltech.com> 11952 11953 Reviewed by Darin Adler. 11954 11955 Compile fix for RVCT. 11956 11957 In reality, it is two fixes: 11958 11959 1. Remove typename. I believe typename can only be used when the named 11960 type depends on the template parameters, which it doesn't in this 11961 case, so I think this is more correct. 11962 2. Replace ::iterator scope with specialized typedef. This is to work 11963 around a bug in RVCT. 11964 11965 https://bugs.webkit.org/show_bug.cgi?id=22260 11966 11967 * wtf/ListHashSet.h: 11968 (WTF::::find): 11969 119702008-11-14 Kristian Amlie <kristian.amlie@trolltech.com> 11971 11972 Reviewed by Darin Adler. 11973 11974 Compile fix for WINSCW. 11975 11976 This fix doesn't protect against implicit conversions from bool to 11977 integers, but most likely that will be caught on another platform. 11978 11979 https://bugs.webkit.org/show_bug.cgi?id=22260 11980 11981 * wtf/PassRefPtr.h: 11982 (WTF::PassRefPtr::operator bool): 11983 * wtf/RefPtr.h: 11984 (WTF::RefPtr::operator bool): 11985 119862008-11-14 Cameron Zwarich <zwarich@apple.com> 11987 11988 Reviewed by Darin Adler. 11989 11990 Bug 22245: Move wtf/dtoa.h into the WTF namespace 11991 <https://bugs.webkit.org/show_bug.cgi?id=22245> 11992 11993 Move wtf/dtoa.h into the WTF namespace from the JSC namespace. This 11994 introduces some ambiguities in name lookups, so I changed all uses of 11995 the functions in wtf/dtoa.h to explicitly state the namespace. 11996 11997 * JavaScriptCore.exp: 11998 * parser/Lexer.cpp: 11999 (JSC::Lexer::lex): 12000 * runtime/InitializeThreading.cpp: 12001 * runtime/JSGlobalObjectFunctions.cpp: 12002 (JSC::parseInt): 12003 * runtime/NumberPrototype.cpp: 12004 (JSC::integerPartNoExp): 12005 (JSC::numberProtoFuncToExponential): 12006 * runtime/UString.cpp: 12007 (JSC::concatenate): 12008 (JSC::UString::from): 12009 (JSC::UString::toDouble): 12010 * wtf/dtoa.cpp: 12011 * wtf/dtoa.h: 12012 120132008-11-14 Cameron Zwarich <zwarich@apple.com> 12014 12015 Reviewed by Maciej Stachowiak. 12016 12017 Bug 22257: Enable redundant read optimizations for results generated by compileBinaryArithOp() 12018 <https://bugs.webkit.org/show_bug.cgi?id=22257> 12019 12020 This shows no change in performance on either SunSpider or the V8 12021 benchmark suite, but it removes an ugly special case and allows for 12022 future optimizations to be implemented in a cleaner fashion. 12023 12024 This patch was essentially given to me by Gavin Barraclough upon my 12025 request, but I did regression and performance testing so that he could 12026 work on something else. 12027 12028 * VM/CTI.cpp: 12029 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): Move the final 12030 result to eax if it is not already there. 12031 (JSC::CTI::compileBinaryArithOp): Remove the killing of the final result 12032 register that disables the optimization. 12033 120342008-11-13 Eric Seidel <eric@webkit.org> 12035 12036 Reviewed by Adam Roben. 12037 12038 Add a Scons-based build system for building 12039 the Chromium-Mac build of JavaScriptCore. 12040 https://bugs.webkit.org/show_bug.cgi?id=21991 12041 12042 * JavaScriptCore.scons: Added. 12043 * SConstruct: Added. 12044 120452008-11-13 Eric Seidel <eric@webkit.org> 12046 12047 Reviewed by Adam Roben. 12048 12049 Add PLATFORM(CHROMIUM) to the "we don't use cairo" blacklist 12050 until https://bugs.webkit.org/show_bug.cgi?id=22250 is fixed. 12051 12052 * wtf/Platform.h: 12053 120542008-11-13 Cameron Zwarich <zwarich@apple.com> 12055 12056 Reviewed by Sam Weinig. 12057 12058 In r38375 the 'jsc' shell was changed to improve teardown on quit. The 12059 main() function in jsc.cpp uses Structured Exception Handling, so Visual 12060 C++ emits a warning when destructors are used. 12061 12062 In order to speculatively fix the Windows build, this patch changes that 12063 code to use explicit pointer manipulation and locking rather than smart 12064 pointers and RAII. 12065 12066 * jsc.cpp: 12067 (main): 12068 120692008-11-13 Cameron Zwarich <zwarich@apple.com> 12070 12071 Reviewed by Darin Adler. 12072 12073 Bug 22246: Get arguments for opcodes together to eliminate more redundant memory reads 12074 <https://bugs.webkit.org/show_bug.cgi?id=22246> 12075 12076 It is common for opcodes to read their first operand into eax and their 12077 second operand into edx. If the value intended for the second operand is 12078 in eax, we should first move eax to the register for the second operand 12079 and then read the first operand into eax. 12080 12081 This is a 0.5% speedup on SunSpider and a 2.0% speedup on the V8 12082 benchmark suite when measured using the V8 harness. 12083 12084 * VM/CTI.cpp: 12085 (JSC::CTI::emitGetArgs): 12086 (JSC::CTI::compileOpStrictEq): 12087 (JSC::CTI::compileBinaryArithOp): 12088 (JSC::CTI::privateCompileMainPass): 12089 (JSC::CTI::privateCompileSlowCases): 12090 * VM/CTI.h: 12091 120922008-11-13 Cameron Zwarich <zwarich@apple.com> 12093 12094 Reviewed by Darin Adler. 12095 12096 Bug 22238: Avoid unnecessary reads of temporaries when the target machine register is not eax 12097 <https://bugs.webkit.org/show_bug.cgi?id=22238> 12098 12099 Enable the optimization of not reading a value back from memory that we 12100 just wrote when the target machine register is not eax. In order to do 12101 this, the code generation for op_put_global_var must be changed to 12102 read its argument into a register before overwriting eax. 12103 12104 This is a 0.5% speedup on SunSpider and shows no change on the V8 12105 benchmark suite when run in either harness. 12106 12107 * VM/CTI.cpp: 12108 (JSC::CTI::emitGetArg): 12109 (JSC::CTI::privateCompileMainPass): 12110 121112008-11-13 Cameron Zwarich <zwarich@apple.com> 12112 12113 Reviewed by Alexey Proskuryakov. 12114 12115 Perform teardown in the 'jsc' shell in order to suppress annoying and 12116 misleading leak messages. There is still a lone JSC::Node leaking when 12117 quit() is called, but hopefully that can be fixed as well. 12118 12119 * jsc.cpp: 12120 (functionQuit): 12121 (main): 12122 121232008-11-13 Mike Pinkerton <pinkerton@chromium.org> 12124 12125 Reviewed by Sam Weinig. 12126 12127 Fix for https://bugs.webkit.org/show_bug.cgi?id=22087 12128 Need correct platform defines for Mac Chromium 12129 12130 Set the appropriate platform defines for Mac Chromium, which is 12131 similar to PLATFORM(MAC), but isn't. 12132 12133 * wtf/Platform.h: 12134 121352008-11-13 Maciej Stachowiak <mjs@apple.com> 12136 12137 Reviewed by Cameron Zwarich. 12138 12139 - remove immediate checks from native codegen for known non-immediate cases like "this" 12140 12141 ~.5% speedup on v8 benchmarks 12142 12143 In the future we can extend this model to remove all sorts of 12144 typechecks based on local type info or type inference. 12145 12146 I also added an assertion to verify that all slow cases linked as 12147 many slow case jumps as the corresponding fast case generated, and 12148 fixed the pre-existing cases where this was not true. 12149 12150 * VM/CTI.cpp: 12151 (JSC::CTI::emitJumpSlowCaseIfNotJSCell): 12152 (JSC::CTI::linkSlowCaseIfNotJSCell): 12153 (JSC::CTI::compileBinaryArithOp): 12154 (JSC::CTI::compileBinaryArithOpSlowCase): 12155 (JSC::CTI::privateCompileMainPass): 12156 (JSC::CTI::privateCompileSlowCases): 12157 * VM/CTI.h: 12158 * VM/CodeBlock.h: 12159 (JSC::CodeBlock::isKnownNotImmediate): 12160 121612008-11-13 Cameron Zwarich <zwarich@apple.com> 12162 12163 Reviewed by Maciej Stachowiak. 12164 12165 Bug 21943: Avoid needless reads of temporary values in CTI code 12166 <https://bugs.webkit.org/show_bug.cgi?id=21943> 12167 12168 If an opcode needs to load a virtual register and a previous opcode left 12169 the contents of that virtual register in a machine register, use the 12170 value in the machine register rather than getting it from memory. 12171 12172 In order to perform this optimization, it is necessary to know the 12173 jump tagets in the CodeBlock. For temporaries, the only problematic 12174 jump targets are binary logical operators and the ternary conditional 12175 operator. However, if this optimization were to be extended to local 12176 variable registers as well, other jump targets would need to be 12177 included, like switch statement cases and the beginnings of catch 12178 blocks. 12179 12180 This optimization also requires that the fast case and the slow case 12181 of an opcode use emitPutResult() on the same register, which was chosen 12182 to be eax, as that is the register into which we read the first operand 12183 of opcodes. In order to make this the case, we needed to add some mov 12184 instructions to the slow cases of some instructions. 12185 12186 This optimizaton is not applied whenever compileBinaryArithOp() is used 12187 to compile an opcode, because different machine registers may be used to 12188 store the final result. It seems possible to rewrite the code generation 12189 in compileBinaryArithOp() to allow for this optimization. 12190 12191 This optimization is also not applied when generating slow cases, 12192 because some fast cases overwrite the value of eax before jumping to the 12193 slow case. In the future, it may be possible to apply this optimization 12194 to slow cases as well, but it did not seem to be a speedup when testing 12195 an early version of this patch. 12196 12197 This is a 1.0% speedup on SunSpider and a 6.3% speedup on the V8 12198 benchmark suite. 12199 12200 * VM/CTI.cpp: 12201 (JSC::CTI::killLastResultRegister): 12202 (JSC::CTI::emitGetArg): 12203 (JSC::CTI::emitGetPutArg): 12204 (JSC::CTI::emitGetCTIParam): 12205 (JSC::CTI::emitGetFromCallFrameHeader): 12206 (JSC::CTI::emitPutResult): 12207 (JSC::CTI::emitCTICall): 12208 (JSC::CTI::CTI): 12209 (JSC::CTI::compileOpCall): 12210 (JSC::CTI::compileOpStrictEq): 12211 (JSC::CTI::emitSlowScriptCheck): 12212 (JSC::CTI::compileBinaryArithOp): 12213 (JSC::CTI::privateCompileMainPass): 12214 (JSC::CTI::privateCompileSlowCases): 12215 (JSC::CTI::privateCompileGetByIdProto): 12216 (JSC::CTI::privateCompilePatchGetArrayLength): 12217 * VM/CTI.h: 12218 * VM/CodeBlock.h: 12219 (JSC::CodeBlock::isTemporaryRegisterIndex): 12220 * bytecompiler/CodeGenerator.cpp: 12221 (JSC::CodeGenerator::emitLabel): 12222 122232008-11-12 Alp Toker <alp@nuanti.com> 12224 12225 autotools build system fix-up only. Add FloatQuad.h to the source 12226 lists and sort them. 12227 12228 * GNUmakefile.am: 12229 122302008-11-12 Geoffrey Garen <ggaren@apple.com> 12231 12232 Reviewed by Sam Weinig. 12233 12234 Fixed https://bugs.webkit.org/show_bug.cgi?id=22192 12235 +37 failures in fast/profiler 12236 12237 along with Darin's review comments in 12238 https://bugs.webkit.org/show_bug.cgi?id=22174 12239 Simplified op_call by nixing its responsibility for moving the value of 12240 "this" into the first argument slot 12241 12242 * VM/Machine.cpp: 12243 (JSC::returnToThrowTrampoline): 12244 (JSC::throwStackOverflowError): 12245 (JSC::Machine::cti_register_file_check): 12246 (JSC::Machine::cti_op_call_arityCheck): 12247 (JSC::Machine::cti_vm_throw): Moved the throw logic into a function, since 12248 functions are better than macros. 12249 12250 * bytecompiler/CodeGenerator.cpp: 12251 (JSC::CodeGenerator::emitCall): 12252 (JSC::CodeGenerator::emitConstruct): Ensure that the function register 12253 is preserved if profiling is enabled, since the profiler uses that 12254 register. 12255 12256 * runtime/JSGlobalData.h: Renamed throwReturnAddress to exceptionLocation, 12257 because I had a hard time understanding what "throwReturnAddress" meant. 12258 122592008-11-12 Geoffrey Garen <ggaren@apple.com> 12260 12261 Reviewed by Sam Weinig. 12262 12263 Roll in r38322, now that test failures have been fixed. 12264 12265 * VM/CTI.cpp: 12266 (JSC::CTI::compileOpCallSetupArgs): 12267 (JSC::CTI::compileOpCallEvalSetupArgs): 12268 (JSC::CTI::compileOpConstructSetupArgs): 12269 (JSC::CTI::compileOpCall): 12270 (JSC::CTI::privateCompileMainPass): 12271 (JSC::CTI::privateCompileSlowCases): 12272 * VM/CTI.h: 12273 * VM/CodeBlock.cpp: 12274 (JSC::CodeBlock::dump): 12275 * VM/Machine.cpp: 12276 (JSC::Machine::callEval): 12277 (JSC::Machine::dumpCallFrame): 12278 (JSC::Machine::dumpRegisters): 12279 (JSC::Machine::execute): 12280 (JSC::Machine::privateExecute): 12281 (JSC::Machine::cti_register_file_check): 12282 (JSC::Machine::cti_op_call_arityCheck): 12283 (JSC::Machine::cti_op_call_NotJSFunction): 12284 (JSC::Machine::cti_op_construct_JSConstruct): 12285 (JSC::Machine::cti_op_construct_NotJSConstruct): 12286 (JSC::Machine::cti_op_call_eval): 12287 (JSC::Machine::cti_vm_throw): 12288 * VM/Machine.h: 12289 * bytecompiler/CodeGenerator.cpp: 12290 (JSC::CodeGenerator::emitCall): 12291 (JSC::CodeGenerator::emitCallEval): 12292 (JSC::CodeGenerator::emitConstruct): 12293 * bytecompiler/CodeGenerator.h: 12294 * parser/Nodes.cpp: 12295 (JSC::EvalFunctionCallNode::emitCode): 12296 (JSC::FunctionCallValueNode::emitCode): 12297 (JSC::FunctionCallResolveNode::emitCode): 12298 (JSC::FunctionCallBracketNode::emitCode): 12299 (JSC::FunctionCallDotNode::emitCode): 12300 * parser/Nodes.h: 12301 (JSC::ScopeNode::neededConstants): 12302 123032008-11-12 Gavin Barraclough <barraclough@apple.com> 12304 12305 Reviewed by Cameron Zwarich. 12306 12307 Fix for https://bugs.webkit.org/show_bug.cgi?id=22201 12308 Integer conversion in array.length was safe signed values, 12309 but the length is unsigned. 12310 12311 * VM/CTI.cpp: 12312 (JSC::CTI::privateCompilePatchGetArrayLength): 12313 123142008-11-12 Cameron Zwarich <zwarich@apple.com> 12315 12316 Rubber-stamped by Mark Rowe. 12317 12318 Roll out r38322 due to test failures on the bots. 12319 12320 * VM/CTI.cpp: 12321 (JSC::CTI::compileOpCallSetupArgs): 12322 (JSC::CTI::compileOpCall): 12323 (JSC::CTI::privateCompileMainPass): 12324 (JSC::CTI::privateCompileSlowCases): 12325 * VM/CTI.h: 12326 * VM/CodeBlock.cpp: 12327 (JSC::CodeBlock::dump): 12328 * VM/Machine.cpp: 12329 (JSC::Machine::callEval): 12330 (JSC::Machine::dumpCallFrame): 12331 (JSC::Machine::dumpRegisters): 12332 (JSC::Machine::execute): 12333 (JSC::Machine::privateExecute): 12334 (JSC::Machine::throwStackOverflowPreviousFrame): 12335 (JSC::Machine::cti_register_file_check): 12336 (JSC::Machine::cti_op_call_arityCheck): 12337 (JSC::Machine::cti_op_call_NotJSFunction): 12338 (JSC::Machine::cti_op_construct_JSConstruct): 12339 (JSC::Machine::cti_op_construct_NotJSConstruct): 12340 (JSC::Machine::cti_op_call_eval): 12341 (JSC::Machine::cti_vm_throw): 12342 * VM/Machine.h: 12343 * bytecompiler/CodeGenerator.cpp: 12344 (JSC::CodeGenerator::emitCall): 12345 (JSC::CodeGenerator::emitCallEval): 12346 (JSC::CodeGenerator::emitConstruct): 12347 * bytecompiler/CodeGenerator.h: 12348 * parser/Nodes.cpp: 12349 (JSC::EvalFunctionCallNode::emitCode): 12350 (JSC::FunctionCallValueNode::emitCode): 12351 (JSC::FunctionCallResolveNode::emitCode): 12352 (JSC::FunctionCallBracketNode::emitCode): 12353 (JSC::FunctionCallDotNode::emitCode): 12354 * parser/Nodes.h: 12355 (JSC::ScopeNode::neededConstants): 12356 123572008-11-11 Geoffrey Garen <ggaren@apple.com> 12358 12359 Reviewed by Darin Adler. 12360 12361 Fixed https://bugs.webkit.org/show_bug.cgi?id=22174 12362 Simplified op_call by nixing its responsibility for moving the value of 12363 "this" into the first argument slot. 12364 12365 Instead, the caller emits an explicit load or mov instruction, or relies 12366 on implicit knowledge that "this" is already in the first argument slot. 12367 As a result, two operands to op_call are gone: firstArg and thisVal. 12368 12369 SunSpider and v8 tests show no change in bytecode or CTI. 12370 12371 * VM/CTI.cpp: 12372 (JSC::CTI::compileOpCallSetupArgs): 12373 (JSC::CTI::compileOpCallEvalSetupArgs): 12374 (JSC::CTI::compileOpConstructSetupArgs): Split apart these three versions 12375 of setting up arguments to op_call, because they're more different than 12376 they are the same -- even more so with this patch. 12377 12378 (JSC::CTI::compileOpCall): Updated for the fact that op_construct doesn't 12379 match op_call anymore. 12380 12381 (JSC::CTI::privateCompileMainPass): 12382 (JSC::CTI::privateCompileSlowCases): Merged a few call cases. Updated 12383 for changes mentioned above. 12384 12385 * VM/CTI.h: 12386 12387 * VM/CodeBlock.cpp: 12388 (JSC::CodeBlock::dump): Updated for new bytecode format of call / construct. 12389 12390 * VM/Machine.cpp: 12391 (JSC::Machine::callEval): Updated for new bytecode format of call / construct. 12392 12393 (JSC::Machine::dumpCallFrame): 12394 (JSC::Machine::dumpRegisters): Simplified these debugging functions, 12395 taking advantage of the new call frame layout. 12396 12397 (JSC::Machine::execute): Fixed up the eval version of execute to be 12398 friendlier to calls in the new format. 12399 12400 (JSC::Machine::privateExecute): Implemented the new call format in 12401 bytecode. 12402 12403 (JSC::Machine::cti_op_call_NotJSFunction): 12404 (JSC::Machine::cti_op_construct_JSConstruct): 12405 (JSC::Machine::cti_op_construct_NotJSConstruct): 12406 (JSC::Machine::cti_op_call_eval): Updated CTI helpers to match the new 12407 call format. 12408 12409 Fixed a latent bug in stack overflow checking that is now hit because 12410 the register layout has changed a bit -- namely: when throwing a stack 12411 overflow exception inside an op_call helper, we need to account for the 12412 fact that the current call frame is only half-constructed, and use the 12413 parent call frame instead. 12414 12415 * VM/Machine.h: 12416 12417 * bytecompiler/CodeGenerator.cpp: 12418 (JSC::CodeGenerator::emitCall): 12419 (JSC::CodeGenerator::emitCallEval): 12420 (JSC::CodeGenerator::emitConstruct): 12421 * bytecompiler/CodeGenerator.h: Updated codegen to match the new call 12422 format. 12423 12424 * parser/Nodes.cpp: 12425 (JSC::EvalFunctionCallNode::emitCode): 12426 (JSC::FunctionCallValueNode::emitCode): 12427 (JSC::FunctionCallResolveNode::emitCode): 12428 (JSC::FunctionCallBracketNode::emitCode): 12429 (JSC::FunctionCallDotNode::emitCode): 12430 * parser/Nodes.h: 12431 (JSC::ScopeNode::neededConstants): ditto 12432 124332008-11-11 Cameron Zwarich <zwarich@apple.com> 12434 12435 Reviewed by Geoff Garen. 12436 12437 Remove an unused forwarding header for a file that no longer exists. 12438 12439 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed. 12440 124412008-11-11 Mark Rowe <mrowe@apple.com> 12442 12443 Fix broken dependencies building JavaScriptCore on a freezing cold cat, caused 12444 by failure to update all instances of "kjs" to their new locations. 12445 12446 * JavaScriptCore.xcodeproj/project.pbxproj: 12447 124482008-11-11 Alexey Proskuryakov <ap@webkit.org> 12449 12450 Rubber-stamped by Adam Roben. 12451 12452 * wtf/AVLTree.h: (WTF::AVLTree::Iterator::start_iter): 12453 Fix indentation a little more. 12454 124552008-11-11 Cameron Zwarich <zwarich@apple.com> 12456 12457 Rubber-stamped by Sam Weinig. 12458 12459 Clean up EvalCodeCache to match our coding style a bit more. 12460 12461 * VM/EvalCodeCache.h: 12462 (JSC::EvalCodeCache::get): 12463 124642008-11-11 Cameron Zwarich <zwarich@apple.com> 12465 12466 Rubber-stamped by Sam Weinig. 12467 12468 Bug 22179: Move EvalCodeCache from CodeBlock.h into its own file 12469 <https://bugs.webkit.org/show_bug.cgi?id=22179> 12470 12471 * GNUmakefile.am: 12472 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 12473 * JavaScriptCore.xcodeproj/project.pbxproj: 12474 * VM/CodeBlock.h: 12475 * VM/EvalCodeCache.h: Copied from VM/CodeBlock.h. 12476 * VM/Machine.cpp: 12477 124782008-11-11 Cameron Zwarich <zwarich@apple.com> 12479 12480 Reviewed by Sam Weinig. 12481 12482 Remove the 'm_' prefix from the fields of the SwitchRecord struct. 12483 12484 * VM/CTI.cpp: 12485 (JSC::CTI::privateCompile): 12486 * VM/CTI.h: 12487 (JSC::SwitchRecord): 12488 (JSC::SwitchRecord::SwitchRecord): 12489 124902008-11-11 Cameron Zwarich <zwarich@apple.com> 12491 12492 Rubber-stamped by Sam Weinig. 12493 12494 Make asInteger() a static function so that it has internal linkage. 12495 12496 * VM/CTI.cpp: 12497 (JSC::asInteger): 12498 124992008-11-11 Maciej Stachowiak <mjs@apple.com> 12500 12501 Reviewed by Mark Rowe. 12502 12503 - shrink CodeBlock and AST related Vectors to exact fit (5-10M savings on membuster test) 12504 12505 No perf regression combined with the last patch (each seems like a small regression individually) 12506 12507 * bytecompiler/CodeGenerator.cpp: 12508 (JSC::CodeGenerator::generate): 12509 * parser/Nodes.h: 12510 (JSC::SourceElements::releaseContentsIntoVector): 12511 * wtf/Vector.h: 12512 (WTF::Vector::shrinkToFit): 12513 125142008-11-11 Maciej Stachowiak <mjs@apple.com> 12515 12516 Reviewed by Mark Rowe. 12517 12518 - remove inline capacity from declaration stacks (15M savings on membuster test) 12519 12520 No perf regression on SunSpider or V8 test combined with other upcoming memory improvement patch. 12521 12522 * JavaScriptCore.exp: 12523 * parser/Nodes.h: 12524 125252008-11-11 Cameron Zwarich <zwarich@apple.com> 12526 12527 Reviewed by Oliver Hunt. 12528 12529 While r38286 removed the need for the m_callFrame member variable of 12530 CTI, it should be also be removed. 12531 12532 * VM/CTI.h: 12533 125342008-11-10 Cameron Zwarich <zwarich@apple.com> 12535 12536 Reviewed by Oliver Hunt. 12537 12538 Make CTI::asInteger() a non-member function, since it needs no access to 12539 any of CTI's member variables. 12540 12541 * VM/CTI.cpp: 12542 (JSC::asInteger): 12543 * VM/CTI.h: 12544 125452008-11-10 Cameron Zwarich <zwarich@apple.com> 12546 12547 Reviewed by Maciej Stachowiak. 12548 12549 Use 'value' instead of 'js' in CTI as a name for JSValue* to match our 12550 usual convention elsewhere. 12551 12552 * VM/CTI.cpp: 12553 (JSC::CTI::emitGetArg): 12554 (JSC::CTI::emitGetPutArg): 12555 (JSC::CTI::getConstantImmediateNumericArg): 12556 (JSC::CTI::printOpcodeOperandTypes): 12557 125582008-11-10 Cameron Zwarich <zwarich@apple.com> 12559 12560 Reviewed by Maciej Stachowiak. 12561 12562 Make CTI::getConstant() a member function of CodeBlock instead. 12563 12564 * VM/CTI.cpp: 12565 (JSC::CTI::emitGetArg): 12566 (JSC::CTI::emitGetPutArg): 12567 (JSC::CTI::getConstantImmediateNumericArg): 12568 (JSC::CTI::printOpcodeOperandTypes): 12569 (JSC::CTI::privateCompileMainPass): 12570 * VM/CTI.h: 12571 * VM/CodeBlock.h: 12572 (JSC::CodeBlock::getConstant): 12573 125742008-11-10 Cameron Zwarich <zwarich@apple.com> 12575 12576 Reviewed by Sam Weinig. 12577 12578 Rename CodeBlock::isConstant() to isConstantRegisterIndex(). 12579 12580 * VM/CTI.cpp: 12581 (JSC::CTI::emitGetArg): 12582 (JSC::CTI::emitGetPutArg): 12583 (JSC::CTI::getConstantImmediateNumericArg): 12584 (JSC::CTI::printOpcodeOperandTypes): 12585 (JSC::CTI::privateCompileMainPass): 12586 * VM/CodeBlock.h: 12587 (JSC::CodeBlock::isConstantRegisterIndex): 12588 * bytecompiler/CodeGenerator.cpp: 12589 (JSC::CodeGenerator::emitEqualityOp): 12590 125912008-11-10 Gavin Barraclough <barraclough@apple.com> 12592 12593 Build fix for non-CTI builds. 12594 12595 * VM/Machine.cpp: 12596 (JSC::Machine::initialize): 12597 125982008-11-10 Cameron Zwarich <zwarich@apple.com> 12599 12600 Reviewed by Sam Weinig. 12601 12602 Remove the unused labels member variable of CodeBlock. 12603 12604 * VM/CodeBlock.h: 12605 * VM/LabelID.h: 12606 (JSC::LabelID::setLocation): 12607 126082008-11-10 Gavin Barraclough <barraclough@apple.com> 12609 12610 Reviewed by Cameron Zwarich. 12611 12612 Batch compile the set of static trampolines at the point Machine is constructed, using a single allocation. 12613 Refactor out m_callFrame from CTI, since this is only needed to access the global data (instead store a 12614 pointer to the global data directly, since this is available at the point the Machine is constructed). 12615 Add a method to align the code buffer, to allow JIT generation for multiple trampolines in one block. 12616 12617 * VM/CTI.cpp: 12618 (JSC::CTI::getConstant): 12619 (JSC::CTI::emitGetArg): 12620 (JSC::CTI::emitGetPutArg): 12621 (JSC::CTI::getConstantImmediateNumericArg): 12622 (JSC::CTI::printOpcodeOperandTypes): 12623 (JSC::CTI::CTI): 12624 (JSC::CTI::compileBinaryArithOp): 12625 (JSC::CTI::privateCompileMainPass): 12626 (JSC::CTI::privateCompileGetByIdProto): 12627 (JSC::CTI::privateCompileGetByIdChain): 12628 (JSC::CTI::privateCompileCTIMachineTrampolines): 12629 (JSC::CTI::freeCTIMachineTrampolines): 12630 * VM/CTI.h: 12631 (JSC::CTI::compile): 12632 (JSC::CTI::compileGetByIdSelf): 12633 (JSC::CTI::compileGetByIdProto): 12634 (JSC::CTI::compileGetByIdChain): 12635 (JSC::CTI::compilePutByIdReplace): 12636 (JSC::CTI::compilePutByIdTransition): 12637 (JSC::CTI::compileCTIMachineTrampolines): 12638 (JSC::CTI::compilePatchGetArrayLength): 12639 * VM/Machine.cpp: 12640 (JSC::Machine::initialize): 12641 (JSC::Machine::~Machine): 12642 (JSC::Machine::execute): 12643 (JSC::Machine::tryCTICachePutByID): 12644 (JSC::Machine::tryCTICacheGetByID): 12645 (JSC::Machine::cti_op_call_JSFunction): 12646 (JSC::Machine::cti_vm_lazyLinkCall): 12647 * VM/Machine.h: 12648 * masm/X86Assembler.h: 12649 (JSC::JITCodeBuffer::isAligned): 12650 (JSC::X86Assembler::): 12651 (JSC::X86Assembler::align): 12652 * runtime/JSGlobalData.cpp: 12653 (JSC::JSGlobalData::JSGlobalData): 12654 126552008-11-10 Maciej Stachowiak <mjs@apple.com> 12656 12657 Reviewed by Antti Koivisto. 12658 12659 - Make Vector::clear() release the Vector's memory (1MB savings on membuster) 12660 https://bugs.webkit.org/show_bug.cgi?id=22170 12661 12662 * wtf/Vector.h: 12663 (WTF::VectorBufferBase::deallocateBuffer): Set capacity to 0 as 12664 well as size, otherwise shrinking capacity to 0 can fail to reset 12665 the capacity and thus cause a future crash. 12666 (WTF::Vector::~Vector): Shrink size not capacity; we only need 12667 to call destructors, the buffer will be freed anyway. 12668 (WTF::Vector::clear): Change this to shrinkCapacity(0), not just shrink(0). 12669 (WTF::::shrinkCapacity): Use shrink() instead of resize() for case where 12670 the size is greater than the new capacity, to work with types that have no 12671 default constructor. 12672 126732008-11-10 Cameron Zwarich <zwarich@apple.com> 12674 12675 Reviewed by Maciej Stachowiak. 12676 12677 Split multiple definitions into separate lines. 12678 12679 * VM/CTI.cpp: 12680 (JSC::CTI::compileBinaryArithOp): 12681 126822008-11-10 Cameron Zwarich <zwarich@apple.com> 12683 12684 Reviewed by Geoff Garen. 12685 12686 Bug 22162: Remove cachedValueGetter from the JavaScriptCore API implementation 12687 <https://bugs.webkit.org/show_bug.cgi?id=22162> 12688 12689 There is no more need for the cachedValueGetter hack now that we have 12690 PropertySlot::setValue(), so we should remove it. 12691 12692 * API/JSCallbackObject.h: 12693 * API/JSCallbackObjectFunctions.h: 12694 (JSC::::getOwnPropertySlot): 12695 126962008-11-10 Cameron Zwarich <zwarich@apple.com> 12697 12698 Reviewed by Darin Adler. 12699 12700 Bug 22152: Remove asObject() call from JSCallbackObject::getOwnPropertySlot() 12701 <https://bugs.webkit.org/show_bug.cgi?id=22152> 12702 12703 With the recent change to adopt asType() style cast functions with 12704 assertions instead of static_casts in many places, the assertion for 12705 the asObject() call in JSCallbackObject::getOwnPropertySlot() has been 12706 failing when using any nontrivial client of the JavaScriptCore API. 12707 The cast isn't even necessary to call slot.setCustom(), so it should 12708 be removed. 12709 12710 * API/JSCallbackObjectFunctions.h: 12711 (JSC::JSCallbackObject::getOwnPropertySlot): 12712 127132008-11-10 Alexey Proskuryakov <ap@webkit.org> 12714 12715 Reviewed by Adam Roben. 12716 12717 A few coding style fixes for AVLTree. 12718 12719 * wtf/AVLTree.h: Moved to WTF namespace, Removed "KJS_" from include guards. 12720 (WTF::AVLTree::Iterator::start_iter): Fixed indentation 12721 12722 * runtime/JSArray.cpp: Added "using namepace WTF". 12723 127242008-11-09 Cameron Zwarich <zwarich@apple.com> 12725 12726 Not reviewed. 12727 12728 Speculatively fix the non-AllInOne build. 12729 12730 * runtime/NativeErrorConstructor.cpp: 12731 127322008-11-09 Darin Adler <darin@apple.com> 12733 12734 Reviewed by Tim Hatcher. 12735 12736 - https://bugs.webkit.org/show_bug.cgi?id=22149 12737 remove unused code from the parser 12738 12739 * AllInOneFile.cpp: Removed nodes2string.cpp. 12740 * GNUmakefile.am: Ditto. 12741 * JavaScriptCore.exp: Ditto. 12742 * JavaScriptCore.pri: Ditto. 12743 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto. 12744 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. 12745 * JavaScriptCoreSources.bkl: Ditto. 12746 12747 * VM/CodeBlock.h: Added include. 12748 12749 * VM/Machine.cpp: (JSC::Machine::execute): Use the types from 12750 DeclarationStacks as DeclarationStacks:: rather than Node:: since 12751 "Node" really has little to do with it. 12752 * bytecompiler/CodeGenerator.cpp: 12753 (JSC::CodeGenerator::CodeGenerator): Ditto. 12754 12755 * jsc.cpp: 12756 (Options::Options): Removed prettyPrint option. 12757 (runWithScripts): Ditto. 12758 (printUsageStatement): Ditto. 12759 (parseArguments): Ditto. 12760 (jscmain): Ditto. 12761 12762 * parser/Grammar.y: Removed use of obsolete ImmediateNumberNode. 12763 12764 * parser/Nodes.cpp: 12765 (JSC::ThrowableExpressionData::emitThrowError): Use inline functions 12766 instead of direct member access for ThrowableExpressionData values. 12767 (JSC::BracketAccessorNode::emitCode): Ditto. 12768 (JSC::DotAccessorNode::emitCode): Ditto. 12769 (JSC::NewExprNode::emitCode): Ditto. 12770 (JSC::EvalFunctionCallNode::emitCode): Ditto. 12771 (JSC::FunctionCallValueNode::emitCode): Ditto. 12772 (JSC::FunctionCallResolveNode::emitCode): Ditto. 12773 (JSC::FunctionCallBracketNode::emitCode): Ditto. 12774 (JSC::FunctionCallDotNode::emitCode): Ditto. 12775 (JSC::PostfixResolveNode::emitCode): Ditto. 12776 (JSC::PostfixBracketNode::emitCode): Ditto. 12777 (JSC::PostfixDotNode::emitCode): Ditto. 12778 (JSC::DeleteResolveNode::emitCode): Ditto. 12779 (JSC::DeleteBracketNode::emitCode): Ditto. 12780 (JSC::DeleteDotNode::emitCode): Ditto. 12781 (JSC::PrefixResolveNode::emitCode): Ditto. 12782 (JSC::PrefixBracketNode::emitCode): Ditto. 12783 (JSC::PrefixDotNode::emitCode): Ditto. 12784 (JSC::ThrowableBinaryOpNode::emitCode): Ditto. 12785 (JSC::InstanceOfNode::emitCode): Ditto. 12786 (JSC::ReadModifyResolveNode::emitCode): Ditto. 12787 (JSC::AssignResolveNode::emitCode): Ditto. 12788 (JSC::AssignDotNode::emitCode): Ditto. 12789 (JSC::ReadModifyDotNode::emitCode): Ditto. 12790 (JSC::AssignBracketNode::emitCode): Ditto. 12791 (JSC::ReadModifyBracketNode::emitCode): Ditto. 12792 (JSC::statementListEmitCode): Take a const StatementVector instead 12793 of a non-const one. Also removed unused statementListPushFIFO. 12794 (JSC::ForInNode::emitCode): Inline functions instead of member access. 12795 (JSC::ThrowNode::emitCode): Ditto. 12796 (JSC::EvalNode::emitCode): Ditto. 12797 (JSC::FunctionBodyNode::emitCode): Ditto. 12798 (JSC::ProgramNode::emitCode): Ditto. 12799 12800 * parser/Nodes.h: Removed unused includes and forward declarations. 12801 Removed Precedence enum. Made many more members private instead of 12802 protected or public. Removed unused NodeStack typedef. Moved the 12803 VarStack and FunctionStack typedefs from Node to ScopeNode. Made 12804 Node::emitCode pure virtual and changed classes that don't emit 12805 any code to inherit from ParserRefCounted rather than Node. 12806 Moved isReturnNode from Node to StatementNode. Removed the 12807 streamTo, precedence, and needsParensIfLeftmost functions from 12808 all classes. Removed the ImmediateNumberNode class and make 12809 NumberNode::setValue nonvirtual. 12810 12811 * parser/nodes2string.cpp: Removed. 12812 128132008-11-09 Darin Adler <darin@apple.com> 12814 12815 Reviewed by Sam Weinig and Maciej Stachowiak. 12816 Includes some work done by Chris Brichford. 12817 12818 - fix https://bugs.webkit.org/show_bug.cgi?id=14886 12819 Stack overflow due to deeply nested parse tree doing repeated string concatentation 12820 12821 Test: fast/js/large-expressions.html 12822 12823 1) Code generation is recursive, so takes stack proportional to the complexity 12824 of the source code expression. Fixed by setting an arbitrary recursion limit 12825 of 10,000 nodes. 12826 12827 2) Destruction of the syntax tree was recursive. Fixed by introducing a 12828 non-recursive mechanism for destroying the tree. 12829 12830 * bytecompiler/CodeGenerator.cpp: 12831 (JSC::CodeGenerator::CodeGenerator): Initialize depth to 0. 12832 (JSC::CodeGenerator::emitThrowExpressionTooDeepException): Added. Emits the code 12833 to throw a "too deep" exception. 12834 * bytecompiler/CodeGenerator.h: 12835 (JSC::CodeGenerator::emitNode): Check depth and emit an exception if we exceed 12836 the maximum depth. 12837 12838 * parser/Nodes.cpp: 12839 (JSC::NodeReleaser::releaseAllNodes): Added. To be called inside node destructors 12840 to avoid recursive calls to destructors for nodes inside this one. 12841 (JSC::NodeReleaser::release): Added. To be called inside releaseNodes functions. 12842 Also added releaseNodes functions and calls to releaseAllNodes inside destructors 12843 for each class derived from Node that has RefPtr to other nodes. 12844 (JSC::NodeReleaser::adopt): Added. Used by the release function. 12845 (JSC::NodeReleaser::adoptFunctionBodyNode): Added. 12846 12847 * parser/Nodes.h: Added declarations of releaseNodes and destructors in all classes 12848 that needed it. Eliminated use of ListRefPtr and releaseNext, which are the two parts 12849 of an older solution to the non-recursive destruction problem that works only for 12850 lists, whereas the new solution works for other graphs. Changed ReverseBinaryOpNode 12851 to use BinaryOpNode as a base class to avoid some duplicated code. 12852 128532008-11-08 Kevin Ollivier <kevino@theolliviers.com> 12854 12855 wx build fixes after addition of JSCore parser and bycompiler dirs. Also cleanup 12856 the JSCore Bakefile's group names to be consistent. 12857 12858 * JavaScriptCoreSources.bkl: 12859 * jscore.bkl: 12860 128612008-11-07 Cameron Zwarich <zwarich@apple.com> 12862 12863 Reviewed by Geoff Garen. 12864 12865 Bug 21801: REGRESSION (r37821): YUI date formatting JavaScript puts the letter 'd' in place of the day 12866 <https://bugs.webkit.org/show_bug.cgi?id=21801> 12867 12868 Fix the constant register check in the 'typeof' optimization in 12869 CodeGenerator, which was completely broken after r37821. 12870 12871 * bytecompiler/CodeGenerator.cpp: 12872 (JSC::CodeGenerator::emitEqualityOp): 12873 128742008-11-07 Cameron Zwarich <zwarich@apple.com> 12875 12876 Reviewed by Geoff Garen. 12877 12878 Bug 22129: Move CTI::isConstant() to CodeBlock 12879 <https://bugs.webkit.org/show_bug.cgi?id=22129> 12880 12881 * VM/CTI.cpp: 12882 (JSC::CTI::emitGetArg): 12883 (JSC::CTI::emitGetPutArg): 12884 (JSC::CTI::getConstantImmediateNumericArg): 12885 (JSC::CTI::printOpcodeOperandTypes): 12886 (JSC::CTI::privateCompileMainPass): 12887 * VM/CTI.h: 12888 * VM/CodeBlock.h: 12889 (JSC::CodeBlock::isConstant): 12890 128912008-11-07 Alp Toker <alp@nuanti.com> 12892 12893 autotools fix. Always use the configured perl binary (which may be 12894 different to the one in $PATH) when generating sources. 12895 12896 * GNUmakefile.am: 12897 128982008-11-07 Cameron Zwarich <zwarich@apple.com> 12899 12900 Not reviewed. 12901 12902 Change grammar.cpp to Grammar.cpp and grammar.h to Grammar.h in several 12903 build scripts. 12904 12905 * DerivedSources.make: 12906 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 12907 * JavaScriptCoreSources.bkl: 12908 129092008-11-07 Alp Toker <alp@nuanti.com> 12910 12911 More grammar.cpp -> Grammar.cpp build fixes. 12912 12913 * AllInOneFile.cpp: 12914 * GNUmakefile.am: 12915 129162008-11-07 Simon Hausmann <hausmann@webkit.org> 12917 12918 Fix the build on case-sensitive file systems. grammar.y was renamed to 12919 Grammar.y but Lexer.cpp includes grammar.h. The build bots didn't 12920 notice this change because of stale files. 12921 12922 * parser/Lexer.cpp: 12923 129242008-11-07 Cameron Zwarich <zwarich@apple.com> 12925 12926 Reviewed by Alexey Proskuryakov. 12927 12928 Rename the m_nextGlobal, m_nextParameter, and m_nextConstant member 12929 variables of CodeGenerator to m_nextGlobalIndex, m_nextParameterIndex, 12930 and m_nextConstantIndex respectively. This is to distinguish these from 12931 member variables like m_lastConstant, which are actually RefPtrs to 12932 Registers. 12933 12934 * bytecompiler/CodeGenerator.cpp: 12935 (JSC::CodeGenerator::addGlobalVar): 12936 (JSC::CodeGenerator::allocateConstants): 12937 (JSC::CodeGenerator::CodeGenerator): 12938 (JSC::CodeGenerator::addParameter): 12939 (JSC::CodeGenerator::addConstant): 12940 * bytecompiler/CodeGenerator.h: 12941 129422008-11-06 Gavin Barraclough barraclough@apple.com 12943 12944 Reviewed by Oliver Hunt. 12945 12946 Do not make a cti_* call to perform an op_call unless either: 12947 (1) The codeblock for the function body has not been generated. 12948 (2) The number of arguments passed does not match the callee arity. 12949 12950 ~1% progression on sunspider --v8 12951 12952 * VM/CTI.cpp: 12953 (JSC::CTI::compileOpCallInitializeCallFrame): 12954 (JSC::CTI::compileOpCall): 12955 (JSC::CTI::privateCompileSlowCases): 12956 * VM/CTI.h: 12957 * VM/Machine.cpp: 12958 (JSC::Machine::cti_op_call_JSFunction): 12959 (JSC::Machine::cti_op_call_arityCheck): 12960 (JSC::Machine::cti_op_construct_JSConstruct): 12961 * VM/Machine.h: 12962 * kjs/nodes.h: 12963 129642008-11-06 Cameron Zwarich <zwarich@apple.com> 12965 12966 Reviewed by Geoff Garen. 12967 12968 Move the remaining files in the kjs subdirectory of JavaScriptCore to 12969 a new parser subdirectory, and remove the kjs subdirectory entirely. 12970 12971 * AllInOneFile.cpp: 12972 * DerivedSources.make: 12973 * GNUmakefile.am: 12974 * JavaScriptCore.pri: 12975 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 12976 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 12977 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 12978 * JavaScriptCore.xcodeproj/project.pbxproj: 12979 * JavaScriptCoreSources.bkl: 12980 * VM/CodeBlock.h: 12981 * VM/ExceptionHelpers.cpp: 12982 * VM/SamplingTool.h: 12983 * bytecompiler/CodeGenerator.h: 12984 * jsc.pro: 12985 * jscore.bkl: 12986 * kjs: Removed. 12987 * kjs/NodeInfo.h: Removed. 12988 * kjs/Parser.cpp: Removed. 12989 * kjs/Parser.h: Removed. 12990 * kjs/ResultType.h: Removed. 12991 * kjs/SourceCode.h: Removed. 12992 * kjs/SourceProvider.h: Removed. 12993 * kjs/grammar.y: Removed. 12994 * kjs/keywords.table: Removed. 12995 * kjs/lexer.cpp: Removed. 12996 * kjs/lexer.h: Removed. 12997 * kjs/nodes.cpp: Removed. 12998 * kjs/nodes.h: Removed. 12999 * kjs/nodes2string.cpp: Removed. 13000 * parser: Added. 13001 * parser/Grammar.y: Copied from kjs/grammar.y. 13002 * parser/Keywords.table: Copied from kjs/keywords.table. 13003 * parser/Lexer.cpp: Copied from kjs/lexer.cpp. 13004 * parser/Lexer.h: Copied from kjs/lexer.h. 13005 * parser/NodeInfo.h: Copied from kjs/NodeInfo.h. 13006 * parser/Nodes.cpp: Copied from kjs/nodes.cpp. 13007 * parser/Nodes.h: Copied from kjs/nodes.h. 13008 * parser/Parser.cpp: Copied from kjs/Parser.cpp. 13009 * parser/Parser.h: Copied from kjs/Parser.h. 13010 * parser/ResultType.h: Copied from kjs/ResultType.h. 13011 * parser/SourceCode.h: Copied from kjs/SourceCode.h. 13012 * parser/SourceProvider.h: Copied from kjs/SourceProvider.h. 13013 * parser/nodes2string.cpp: Copied from kjs/nodes2string.cpp. 13014 * pcre/pcre.pri: 13015 * pcre/pcre_exec.cpp: 13016 * runtime/FunctionConstructor.cpp: 13017 * runtime/JSActivation.h: 13018 * runtime/JSFunction.h: 13019 * runtime/JSGlobalData.cpp: 13020 * runtime/JSGlobalObjectFunctions.cpp: 13021 * runtime/JSObject.cpp: 13022 (JSC::JSObject::toNumber): 13023 * runtime/RegExp.cpp: 13024 130252008-11-06 Adam Roben <aroben@apple.com> 13026 13027 Windows build fix after r38196 13028 13029 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added bytecompiler/ to the 13030 include path. 13031 130322008-11-06 Cameron Zwarich <zwarich@apple.com> 13033 13034 Rubber-stamped by Sam Weinig. 13035 13036 Create a new bytecompiler subdirectory of JavaScriptCore and move some 13037 relevant files to it. 13038 13039 * AllInOneFile.cpp: 13040 * GNUmakefile.am: 13041 * JavaScriptCore.pri: 13042 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13043 * JavaScriptCore.xcodeproj/project.pbxproj: 13044 * JavaScriptCoreSources.bkl: 13045 * VM/CodeGenerator.cpp: Removed. 13046 * VM/CodeGenerator.h: Removed. 13047 * bytecompiler: Added. 13048 * bytecompiler/CodeGenerator.cpp: Copied from VM/CodeGenerator.cpp. 13049 * bytecompiler/CodeGenerator.h: Copied from VM/CodeGenerator.h. 13050 * bytecompiler/LabelScope.h: Copied from kjs/LabelScope.h. 13051 * jscore.bkl: 13052 * kjs/LabelScope.h: Removed. 13053 130542008-11-06 Adam Roben <aroben@apple.com> 13055 13056 Windows clean build fix after r38155 13057 13058 Rubberstamped by Cameron Zwarich. 13059 13060 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update 13061 the post-build event for the move of create_hash_table out of kjs/. 13062 130632008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com> 13064 13065 Reviewed by Darin Adler. 13066 13067 https://bugs.webkit.org/show_bug.cgi?id=22107 13068 13069 Bug uncovered during RVCT port in functions not used. get_lt() and 13070 get_gt() takes only one argument - remove second argument where 13071 applicable. 13072 13073 * wtf/AVLTree.h: 13074 (JSC::AVLTree::remove): Remove second argument of get_lt/get_gt(). 13075 (JSC::AVLTree::subst): Ditto. 13076 130772008-11-06 Alp Toker <alp@nuanti.com> 13078 13079 Reviewed by Cameron Zwarich. 13080 13081 https://bugs.webkit.org/show_bug.cgi?id=22033 13082 [GTK] CTI/Linux r38064 crashes; JIT requires executable memory 13083 13084 Mark pages allocated by the FastMalloc mmap code path executable with 13085 PROT_EXEC. This fixes crashes seen on CPUs and kernels that enforce 13086 non-executable memory (like ExecShield on Fedora Linux) when the JIT 13087 is enabled. 13088 13089 This patch does not resolve the issue on debug builds so affected 13090 developers may still need to pass --disable-jit to configure. 13091 13092 * wtf/TCSystemAlloc.cpp: 13093 (TryMmap): 13094 (TryDevMem): 13095 (TCMalloc_SystemRelease): 13096 130972008-11-06 Peter Gal <galpeter@inf.u-szeged.hu> 13098 13099 Reviewed by Cameron Zwarich. 13100 13101 Bug 22099: Make the Qt port build the JSC shell in the correct place 13102 <https://bugs.webkit.org/show_bug.cgi?id=22099> 13103 13104 Adjust include paths and build destination dir for the 'jsc' executable 13105 in the Qt build. 13106 13107 * jsc.pro: 13108 131092008-11-06 Kristian Amlie <kristian.amlie@nokia.com> 13110 13111 Reviewed by Simon Hausmann. 13112 13113 Implemented the block allocation on Symbian through heap allocation. 13114 13115 Unfortunately there is no way to allocate virtual memory. The Posix 13116 layer provides mmap() but no anonymous mapping. So this is a very slow 13117 solution but it should work as a start. 13118 13119 * runtime/Collector.cpp: 13120 (JSC::allocateBlock): 13121 (JSC::freeBlock): 13122 131232008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com> 13124 13125 Reviewed by Simon Hausmann. 13126 13127 Borrow some math functions from the MSVC port to the build with the 13128 RVCT compiler. 13129 13130 * wtf/MathExtras.h: 13131 (isinf): 13132 (isnan): 13133 (signbit): 13134 131352008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com> 13136 13137 Reviewed by Simon Hausmann. 13138 13139 Include strings.h for strncasecmp(). 13140 This is needed for compilation inside Symbian and it is also 13141 confirmed by the man-page on Linux. 13142 13143 * runtime/DateMath.cpp: 13144 131452008-11-06 Norbert Leser <norbert.leser@nokia.com> 13146 13147 Reviewed by Simon Hausmann. 13148 13149 Implemented currentThreadStackBase for Symbian. 13150 13151 * runtime/Collector.cpp: 13152 (JSC::currentThreadStackBase): 13153 131542008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com> 13155 13156 Reviewed by Simon Hausmann. 13157 13158 RVCT does not support tm_gmtoff field, so disable that code just like 13159 for MSVC. 13160 13161 * runtime/DateMath.h: 13162 (JSC::GregorianDateTime::GregorianDateTime): 13163 (JSC::GregorianDateTime::operator tm): 13164 131652008-11-06 Kristian Amlie <kristian.amlie@nokia.com> 13166 13167 Reviewed by Simon Hausmann. 13168 13169 Define PLATFORM(UNIX) for S60. Effectively WebKit on S60 is compiled 13170 on top of the Posix layer. 13171 13172 * wtf/Platform.h: 13173 131742008-11-06 Norbert Leser <norbert.leser@nokia.com> 13175 13176 Reviewed by Simon Hausmann. 13177 13178 Added __SYMBIAN32__ condition for defining PLATFORM(SYMBIAN). 13179 13180 * wtf/Platform.h: 13181 131822008-11-06 Ariya Hidayat <ariya.hidayat@trolltech.com> 13183 13184 Reviewed by Simon Hausmann. 13185 13186 Added WINSCW compiler define for Symbian S60. 13187 13188 * wtf/Platform.h: 13189 131902008-11-06 Kristian Amlie <kristian.amlie@nokia.com> 13191 13192 Reviewed by Simon Hausmann. 13193 13194 Use the GCC defines of the WTF_ALIGN* macros for the RVCT and the 13195 MINSCW compiler. 13196 13197 * wtf/Vector.h: 13198 131992008-11-06 Kristian Amlie <kristian.amlie@nokia.com> 13200 13201 Reviewed by Simon Hausmann. 13202 13203 Define capabilities of the SYMBIAN platform. Some of the system 13204 headers are actually dependent on RVCT. 13205 13206 * wtf/Platform.h: 13207 132082008-11-06 Kristian Amlie <kristian.amlie@nokia.com> 13209 13210 Reviewed by Simon Hausmann. 13211 13212 Add missing stddef.h header needed for compilation in Symbian. 13213 13214 * runtime/Collector.h: 13215 132162008-11-06 Kristian Amlie <kristian.amlie@nokia.com> 13217 13218 Reviewed by Simon Hausmann. 13219 13220 Added COMPILER(RVCT) to detect the ARM RVCT compiler used in the Symbian environment. 13221 13222 * wtf/Platform.h: 13223 132242008-11-06 Simon Hausmann <hausmann@webkit.org> 13225 13226 Fix the Qt build, adjust include paths after move of jsc.pro. 13227 13228 * jsc.pro: 13229 132302008-11-06 Cameron Zwarich <zwarich@apple.com> 13231 13232 Rubber-stamped by Sam Weinig. 13233 13234 Move kjs/Shell.cpp to the top level of the JavaScriptCore directory and 13235 rename it to jsc.cpp to reflect the name of the binary compiled from it. 13236 13237 * GNUmakefile.am: 13238 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 13239 * JavaScriptCore.xcodeproj/project.pbxproj: 13240 * jsc.cpp: Copied from kjs/Shell.cpp. 13241 * jsc.pro: 13242 * jscore.bkl: 13243 * kjs/Shell.cpp: Removed. 13244 132452008-11-06 Cameron Zwarich <zwarich@apple.com> 13246 13247 Rubber-stamped by Sam Weinig. 13248 13249 Move create_hash_table and jsc.pro out of the kjs directory and into the 13250 root directory of JavaScriptCore. 13251 13252 * DerivedSources.make: 13253 * JavaScriptCore.pri: 13254 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13255 * JavaScriptCore.xcodeproj/project.pbxproj: 13256 * create_hash_table: Copied from kjs/create_hash_table. 13257 * jsc.pro: Copied from kjs/jsc.pro. 13258 * kjs/create_hash_table: Removed. 13259 * kjs/jsc.pro: Removed. 13260 * make-generated-sources.sh: 13261 132622008-11-05 Gavin Barraclough <barraclough@apple.com> 13263 13264 Reviewed by Maciej Stachowiak. 13265 13266 https://bugs.webkit.org/show_bug.cgi?id=22094 13267 13268 Fix for bug where the callee incorrectly recieves the caller's lexical 13269 global object as this, rather than its own. Implementation closely 13270 follows the spec, passing jsNull, checking in the callee and replacing 13271 with the global object where necessary. 13272 13273 * VM/CTI.cpp: 13274 (JSC::CTI::compileOpCall): 13275 * VM/Machine.cpp: 13276 (JSC::Machine::cti_op_call_NotJSFunction): 13277 (JSC::Machine::cti_op_call_eval): 13278 * runtime/JSCell.h: 13279 (JSC::JSValue::toThisObject): 13280 * runtime/JSImmediate.cpp: 13281 (JSC::JSImmediate::toThisObject): 13282 * runtime/JSImmediate.h: 13283 132842008-11-05 Kevin Ollivier <kevino@theolliviers.com> 13285 13286 wx build fix after Operations.cpp move. 13287 13288 * JavaScriptCoreSources.bkl: 13289 132902008-11-05 Cameron Zwarich <zwarich@apple.com> 13291 13292 Not reviewed. 13293 13294 Fix the build for case-sensitive build systems and wxWindows. 13295 13296 * JavaScriptCoreSources.bkl: 13297 * kjs/create_hash_table: 13298 132992008-11-05 Cameron Zwarich <zwarich@apple.com> 13300 13301 Not reviewed. 13302 13303 Fix the build for case-sensitive build systems. 13304 13305 * JavaScriptCoreSources.bkl: 13306 * kjs/Shell.cpp: 13307 * runtime/Interpreter.cpp: 13308 * runtime/JSArray.cpp: 13309 133102008-11-05 Cameron Zwarich <zwarich@apple.com> 13311 13312 Not reviewed. 13313 13314 Fix the build for case-sensitive build systems. 13315 13316 * API/JSBase.cpp: 13317 * API/JSObjectRef.cpp: 13318 * runtime/CommonIdentifiers.h: 13319 * runtime/Identifier.cpp: 13320 * runtime/InitializeThreading.cpp: 13321 * runtime/InternalFunction.h: 13322 * runtime/JSString.h: 13323 * runtime/Lookup.h: 13324 * runtime/PropertyNameArray.h: 13325 * runtime/PropertySlot.h: 13326 * runtime/StructureID.cpp: 13327 * runtime/StructureID.h: 13328 * runtime/UString.cpp: 13329 133302008-11-05 Cameron Zwarich <zwarich@apple.com> 13331 13332 Rubber-stamped by Sam Weinig. 13333 13334 Move more files to the runtime subdirectory of JavaScriptCore. 13335 13336 * API/APICast.h: 13337 * API/JSBase.cpp: 13338 * API/JSCallbackObject.cpp: 13339 * API/JSClassRef.cpp: 13340 * API/JSClassRef.h: 13341 * API/JSStringRefCF.cpp: 13342 * API/JSValueRef.cpp: 13343 * API/OpaqueJSString.cpp: 13344 * API/OpaqueJSString.h: 13345 * AllInOneFile.cpp: 13346 * GNUmakefile.am: 13347 * JavaScriptCore.pri: 13348 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13349 * JavaScriptCore.xcodeproj/project.pbxproj: 13350 * JavaScriptCoreSources.bkl: 13351 * VM/CodeBlock.h: 13352 * VM/CodeGenerator.cpp: 13353 * VM/Machine.cpp: 13354 * VM/RegisterFile.h: 13355 * debugger/Debugger.h: 13356 * kjs/SourceProvider.h: 13357 * kjs/TypeInfo.h: Removed. 13358 * kjs/collector.cpp: Removed. 13359 * kjs/collector.h: Removed. 13360 * kjs/completion.h: Removed. 13361 * kjs/create_hash_table: 13362 * kjs/identifier.cpp: Removed. 13363 * kjs/identifier.h: Removed. 13364 * kjs/interpreter.cpp: Removed. 13365 * kjs/interpreter.h: Removed. 13366 * kjs/lexer.cpp: 13367 * kjs/lexer.h: 13368 * kjs/lookup.cpp: Removed. 13369 * kjs/lookup.h: Removed. 13370 * kjs/nodes.cpp: 13371 * kjs/nodes.h: 13372 * kjs/operations.cpp: Removed. 13373 * kjs/operations.h: Removed. 13374 * kjs/protect.h: Removed. 13375 * kjs/regexp.cpp: Removed. 13376 * kjs/regexp.h: Removed. 13377 * kjs/ustring.cpp: Removed. 13378 * kjs/ustring.h: Removed. 13379 * pcre/pcre_exec.cpp: 13380 * profiler/CallIdentifier.h: 13381 * profiler/Profile.h: 13382 * runtime/ArrayConstructor.cpp: 13383 * runtime/ArrayPrototype.cpp: 13384 * runtime/ArrayPrototype.h: 13385 * runtime/Collector.cpp: Copied from kjs/collector.cpp. 13386 * runtime/Collector.h: Copied from kjs/collector.h. 13387 * runtime/CollectorHeapIterator.h: 13388 * runtime/Completion.h: Copied from kjs/completion.h. 13389 * runtime/ErrorPrototype.cpp: 13390 * runtime/Identifier.cpp: Copied from kjs/identifier.cpp. 13391 * runtime/Identifier.h: Copied from kjs/identifier.h. 13392 * runtime/InitializeThreading.cpp: 13393 * runtime/Interpreter.cpp: Copied from kjs/interpreter.cpp. 13394 * runtime/Interpreter.h: Copied from kjs/interpreter.h. 13395 * runtime/JSCell.h: 13396 * runtime/JSGlobalData.cpp: 13397 * runtime/JSGlobalData.h: 13398 * runtime/JSLock.cpp: 13399 * runtime/JSNumberCell.cpp: 13400 * runtime/JSNumberCell.h: 13401 * runtime/JSObject.cpp: 13402 * runtime/JSValue.h: 13403 * runtime/Lookup.cpp: Copied from kjs/lookup.cpp. 13404 * runtime/Lookup.h: Copied from kjs/lookup.h. 13405 * runtime/MathObject.cpp: 13406 * runtime/NativeErrorPrototype.cpp: 13407 * runtime/NumberPrototype.cpp: 13408 * runtime/Operations.cpp: Copied from kjs/operations.cpp. 13409 * runtime/Operations.h: Copied from kjs/operations.h. 13410 * runtime/PropertyMapHashTable.h: 13411 * runtime/Protect.h: Copied from kjs/protect.h. 13412 * runtime/RegExp.cpp: Copied from kjs/regexp.cpp. 13413 * runtime/RegExp.h: Copied from kjs/regexp.h. 13414 * runtime/RegExpConstructor.cpp: 13415 * runtime/RegExpObject.h: 13416 * runtime/RegExpPrototype.cpp: 13417 * runtime/SmallStrings.h: 13418 * runtime/StringObjectThatMasqueradesAsUndefined.h: 13419 * runtime/StructureID.cpp: 13420 * runtime/StructureID.h: 13421 * runtime/StructureIDTransitionTable.h: 13422 * runtime/SymbolTable.h: 13423 * runtime/TypeInfo.h: Copied from kjs/TypeInfo.h. 13424 * runtime/UString.cpp: Copied from kjs/ustring.cpp. 13425 * runtime/UString.h: Copied from kjs/ustring.h. 13426 * wrec/CharacterClassConstructor.h: 13427 * wrec/WREC.h: 13428 134292008-11-05 Geoffrey Garen <ggaren@apple.com> 13430 13431 Suggested by Darin Adler. 13432 13433 Removed two copy constructors that the compiler can generate for us 13434 automatically. 13435 13436 * VM/LabelID.h: 13437 (JSC::LabelID::setLocation): 13438 (JSC::LabelID::offsetFrom): 13439 (JSC::LabelID::ref): 13440 (JSC::LabelID::refCount): 13441 * kjs/LabelScope.h: 13442 134432008-11-05 Anders Carlsson <andersca@apple.com> 13444 13445 Fix Snow Leopard build. 13446 13447 * JavaScriptCore.xcodeproj/project.pbxproj: 13448 134492008-11-04 Cameron Zwarich <zwarich@apple.com> 13450 13451 Rubber-stamped by Steve Falkenburg. 13452 13453 Move dtoa.cpp and dtoa.h to the WTF Visual Studio project to reflect 13454 their movement in the filesystem. 13455 13456 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13457 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 13458 134592008-11-04 Cameron Zwarich <zwarich@apple.com> 13460 13461 Rubber-stamped by Sam Weinig. 13462 13463 Move kjs/dtoa.h to the wtf subdirectory of JavaScriptCore. 13464 13465 * AllInOneFile.cpp: 13466 * GNUmakefile.am: 13467 * JavaScriptCore.pri: 13468 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13469 * JavaScriptCore.xcodeproj/project.pbxproj: 13470 * JavaScriptCoreSources.bkl: 13471 * kjs/dtoa.cpp: Removed. 13472 * kjs/dtoa.h: Removed. 13473 * wtf/dtoa.cpp: Copied from kjs/dtoa.cpp. 13474 * wtf/dtoa.h: Copied from kjs/dtoa.h. 13475 134762008-11-04 Cameron Zwarich <zwarich@apple.com> 13477 13478 Rubber-stamped by Sam Weinig. 13479 13480 Move kjs/config.h to the top level of JavaScriptCore. 13481 13482 * GNUmakefile.am: 13483 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13484 * JavaScriptCore.xcodeproj/project.pbxproj: 13485 * config.h: Copied from kjs/config.h. 13486 * kjs/config.h: Removed. 13487 134882008-11-04 Darin Adler <darin@apple.com> 13489 13490 Reviewed by Tim Hatcher. 13491 13492 * wtf/ThreadingNone.cpp: Tweak formatting. 13493 134942008-11-03 Darin Adler <darin@apple.com> 13495 13496 Reviewed by Tim Hatcher. 13497 13498 - https://bugs.webkit.org/show_bug.cgi?id=22061 13499 create script to check for exit-time destructors 13500 13501 * JavaScriptCore.exp: Changed to export functions rather than 13502 a global for the atomically initialized static mutex. 13503 13504 * JavaScriptCore.xcodeproj/project.pbxproj: Added a script 13505 phase that runs the check-for-exit-time-destructors script. 13506 13507 * wtf/MainThread.cpp: 13508 (WTF::mainThreadFunctionQueueMutex): Changed to leak an object 13509 rather than using an exit time destructor. 13510 (WTF::functionQueue): Ditto. 13511 * wtf/unicode/icu/CollatorICU.cpp: 13512 (WTF::cachedCollatorMutex): Ditto. 13513 13514 * wtf/Threading.h: Changed other platforms to share the Windows 13515 approach where the mutex is internal and the functions are exported. 13516 * wtf/ThreadingGtk.cpp: 13517 (WTF::lockAtomicallyInitializedStaticMutex): Ditto. 13518 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 13519 * wtf/ThreadingNone.cpp: 13520 (WTF::lockAtomicallyInitializedStaticMutex): Ditto. 13521 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 13522 * wtf/ThreadingPthreads.cpp: 13523 (WTF::threadMapMutex): Changed to leak an object rather than using 13524 an exit time destructor. 13525 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change. 13526 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 13527 (WTF::threadMap): Changed to leak an object rather than using 13528 an exit time destructor. 13529 * wtf/ThreadingQt.cpp: 13530 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change. 13531 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto. 13532 * wtf/ThreadingWin.cpp: 13533 (WTF::lockAtomicallyInitializedStaticMutex): Added an assertion. 13534 135352008-11-04 Adam Roben <aroben@apple.com> 13536 13537 Windows build fix 13538 13539 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update 13540 the location of JSStaticScopeObject.{cpp,h}. 13541 135422008-11-04 Cameron Zwarich <zwarich@apple.com> 13543 13544 Reviewed by Alexey Proskuryakov. 13545 13546 Move AllInOneFile.cpp to the top level of JavaScriptCore. 13547 13548 * AllInOneFile.cpp: Copied from kjs/AllInOneFile.cpp. 13549 * GNUmakefile.am: 13550 * JavaScriptCore.xcodeproj/project.pbxproj: 13551 * kjs/AllInOneFile.cpp: Removed. 13552 135532008-11-04 Cameron Zwarich <zwarich@apple.com> 13554 13555 Rubber-stamped by Alexey Proskuryakov. 13556 13557 Add NodeInfo.h to the JavaScriptCore Xcode project. 13558 13559 * JavaScriptCore.xcodeproj/project.pbxproj: 13560 135612008-11-03 Cameron Zwarich <zwarich@apple.com> 13562 13563 Rubber-stamped by Maciej Stachowiak. 13564 13565 Move more files into the runtime subdirectory of JavaScriptCore. 13566 13567 * API/JSBase.cpp: 13568 * API/JSCallbackConstructor.cpp: 13569 * API/JSCallbackFunction.cpp: 13570 * API/JSClassRef.cpp: 13571 * API/OpaqueJSString.cpp: 13572 * GNUmakefile.am: 13573 * JavaScriptCore.pri: 13574 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13575 * JavaScriptCore.xcodeproj/project.pbxproj: 13576 * JavaScriptCoreSources.bkl: 13577 * kjs/AllInOneFile.cpp: 13578 * kjs/ArgList.cpp: Removed. 13579 * kjs/ArgList.h: Removed. 13580 * kjs/Arguments.cpp: Removed. 13581 * kjs/Arguments.h: Removed. 13582 * kjs/BatchedTransitionOptimizer.h: Removed. 13583 * kjs/CollectorHeapIterator.h: Removed. 13584 * kjs/CommonIdentifiers.cpp: Removed. 13585 * kjs/CommonIdentifiers.h: Removed. 13586 * kjs/ExecState.cpp: Removed. 13587 * kjs/ExecState.h: Removed. 13588 * kjs/GetterSetter.cpp: Removed. 13589 * kjs/GetterSetter.h: Removed. 13590 * kjs/InitializeThreading.cpp: Removed. 13591 * kjs/InitializeThreading.h: Removed. 13592 * kjs/JSActivation.cpp: Removed. 13593 * kjs/JSActivation.h: Removed. 13594 * kjs/JSGlobalData.cpp: Removed. 13595 * kjs/JSGlobalData.h: Removed. 13596 * kjs/JSLock.cpp: Removed. 13597 * kjs/JSLock.h: Removed. 13598 * kjs/JSStaticScopeObject.cpp: Removed. 13599 * kjs/JSStaticScopeObject.h: Removed. 13600 * kjs/JSType.h: Removed. 13601 * kjs/PropertyNameArray.cpp: Removed. 13602 * kjs/PropertyNameArray.h: Removed. 13603 * kjs/ScopeChain.cpp: Removed. 13604 * kjs/ScopeChain.h: Removed. 13605 * kjs/ScopeChainMark.h: Removed. 13606 * kjs/SymbolTable.h: Removed. 13607 * kjs/Tracing.d: Removed. 13608 * kjs/Tracing.h: Removed. 13609 * runtime/ArgList.cpp: Copied from kjs/ArgList.cpp. 13610 * runtime/ArgList.h: Copied from kjs/ArgList.h. 13611 * runtime/Arguments.cpp: Copied from kjs/Arguments.cpp. 13612 * runtime/Arguments.h: Copied from kjs/Arguments.h. 13613 * runtime/BatchedTransitionOptimizer.h: Copied from kjs/BatchedTransitionOptimizer.h. 13614 * runtime/CollectorHeapIterator.h: Copied from kjs/CollectorHeapIterator.h. 13615 * runtime/CommonIdentifiers.cpp: Copied from kjs/CommonIdentifiers.cpp. 13616 * runtime/CommonIdentifiers.h: Copied from kjs/CommonIdentifiers.h. 13617 * runtime/ExecState.cpp: Copied from kjs/ExecState.cpp. 13618 * runtime/ExecState.h: Copied from kjs/ExecState.h. 13619 * runtime/GetterSetter.cpp: Copied from kjs/GetterSetter.cpp. 13620 * runtime/GetterSetter.h: Copied from kjs/GetterSetter.h. 13621 * runtime/InitializeThreading.cpp: Copied from kjs/InitializeThreading.cpp. 13622 * runtime/InitializeThreading.h: Copied from kjs/InitializeThreading.h. 13623 * runtime/JSActivation.cpp: Copied from kjs/JSActivation.cpp. 13624 * runtime/JSActivation.h: Copied from kjs/JSActivation.h. 13625 * runtime/JSGlobalData.cpp: Copied from kjs/JSGlobalData.cpp. 13626 * runtime/JSGlobalData.h: Copied from kjs/JSGlobalData.h. 13627 * runtime/JSLock.cpp: Copied from kjs/JSLock.cpp. 13628 * runtime/JSLock.h: Copied from kjs/JSLock.h. 13629 * runtime/JSStaticScopeObject.cpp: Copied from kjs/JSStaticScopeObject.cpp. 13630 * runtime/JSStaticScopeObject.h: Copied from kjs/JSStaticScopeObject.h. 13631 * runtime/JSType.h: Copied from kjs/JSType.h. 13632 * runtime/PropertyNameArray.cpp: Copied from kjs/PropertyNameArray.cpp. 13633 * runtime/PropertyNameArray.h: Copied from kjs/PropertyNameArray.h. 13634 * runtime/ScopeChain.cpp: Copied from kjs/ScopeChain.cpp. 13635 * runtime/ScopeChain.h: Copied from kjs/ScopeChain.h. 13636 * runtime/ScopeChainMark.h: Copied from kjs/ScopeChainMark.h. 13637 * runtime/SymbolTable.h: Copied from kjs/SymbolTable.h. 13638 * runtime/Tracing.d: Copied from kjs/Tracing.d. 13639 * runtime/Tracing.h: Copied from kjs/Tracing.h. 13640 136412008-11-03 Sam Weinig <sam@webkit.org> 13642 13643 Reviewed by Mark Rowe. 13644 13645 Move #define to turn on dumping StructureID statistics to StructureID.cpp so that 13646 turning it on does not require a full rebuild. 13647 13648 * runtime/StructureID.cpp: 13649 (JSC::StructureID::dumpStatistics): 13650 * runtime/StructureID.h: 13651 136522008-11-03 Alp Toker <alp@nuanti.com> 13653 13654 Reviewed by Geoffrey Garen. 13655 13656 Fix warning when building on Darwin without JSC_MULTIPLE_THREADS 13657 enabled. 13658 13659 * kjs/InitializeThreading.cpp: 13660 136612008-11-02 Matt Lilek <webkit@mattlilek.com> 13662 13663 Reviewed by Cameron Zwarich. 13664 13665 Bug 22042: REGRESSION(r38066): ASSERTION FAILED: source in CodeBlock 13666 <https://bugs.webkit.org/show_bug.cgi?id=22042> 13667 13668 Rename parameter name to avoid ASSERT. 13669 13670 * VM/CodeBlock.h: 13671 (JSC::CodeBlock::CodeBlock): 13672 (JSC::ProgramCodeBlock::ProgramCodeBlock): 13673 (JSC::EvalCodeBlock::EvalCodeBlock): 13674 136752008-11-02 Cameron Zwarich <zwarich@apple.com> 13676 13677 Reviewed by Oliver Hunt. 13678 13679 Bug 22035: Remove the '_' suffix on constructor parameter names for structs 13680 <https://bugs.webkit.org/show_bug.cgi?id=22035> 13681 13682 * API/JSCallbackObject.h: 13683 (JSC::JSCallbackObject::JSCallbackObjectData::JSCallbackObjectData): 13684 * VM/CodeBlock.h: 13685 (JSC::CodeBlock::CodeBlock): 13686 (JSC::ProgramCodeBlock::ProgramCodeBlock): 13687 (JSC::EvalCodeBlock::EvalCodeBlock): 13688 * wrec/WREC.h: 13689 (JSC::Quantifier::Quantifier): 13690 136912008-10-31 Cameron Zwarich <zwarich@apple.com> 13692 13693 Rubber-stamped by Geoff Garen. 13694 13695 Rename SourceRange.h to SourceCode.h. 13696 13697 * API/JSBase.cpp: 13698 * GNUmakefile.am: 13699 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13700 * JavaScriptCore.xcodeproj/project.pbxproj: 13701 * VM/CodeBlock.h: 13702 * kjs/SourceCode.h: Copied from kjs/SourceRange.h. 13703 * kjs/SourceRange.h: Removed. 13704 * kjs/grammar.y: 13705 * kjs/lexer.h: 13706 * kjs/nodes.cpp: 13707 (JSC::ForInNode::ForInNode): 13708 * kjs/nodes.h: 13709 (JSC::ThrowableExpressionData::setExceptionSourceCode): 13710 137112008-10-31 Cameron Zwarich <zwarich@apple.com> 13712 13713 Reviewed by Darin Adler. 13714 13715 Bug 22019: Move JSC::Interpreter::shouldPrintExceptions() to WebCore::Console 13716 <https://bugs.webkit.org/show_bug.cgi?id=22019> 13717 13718 The JSC::Interpreter::shouldPrintExceptions() function is not used at 13719 all in JavaScriptCore, so it should be moved to WebCore::Console, its 13720 only user. 13721 13722 * JavaScriptCore.exp: 13723 * kjs/interpreter.cpp: 13724 * kjs/interpreter.h: 13725 137262008-10-31 Cameron Zwarich <zwarich@apple.com> 13727 13728 Not reviewed. 13729 13730 Windows build fix. 13731 13732 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13733 137342008-10-31 Cameron Zwarich <zwarich@apple.com> 13735 13736 Rubber-stamped by Sam Weinig. 13737 13738 Remove the call to Interpreter::setShouldPrintExceptions() from the 13739 GlobalObject constructor in the shell. The shouldPrintExceptions() 13740 information is not used anywhere in JavaScriptCore, only in WebCore. 13741 13742 * kjs/Shell.cpp: 13743 (GlobalObject::GlobalObject): 13744 137452008-10-31 Kevin Ollivier <kevino@theolliviers.com> 13746 13747 wxMSW build fix. 13748 13749 * wtf/Threading.h: 13750 137512008-10-31 Cameron Zwarich <zwarich@apple.com> 13752 13753 Rubber-stamped by Sam Weinig. 13754 13755 Move more files from the kjs subdirectory of JavaScriptCore to the 13756 runtime subdirectory. 13757 13758 * GNUmakefile.am: 13759 * JavaScriptCore.pri: 13760 * JavaScriptCore.xcodeproj/project.pbxproj: 13761 * JavaScriptCoreSources.bkl: 13762 * kjs/AllInOneFile.cpp: 13763 * kjs/RegExpConstructor.cpp: Removed. 13764 * kjs/RegExpConstructor.h: Removed. 13765 * kjs/RegExpMatchesArray.h: Removed. 13766 * kjs/RegExpObject.cpp: Removed. 13767 * kjs/RegExpObject.h: Removed. 13768 * kjs/RegExpPrototype.cpp: Removed. 13769 * kjs/RegExpPrototype.h: Removed. 13770 * runtime/RegExpConstructor.cpp: Copied from kjs/RegExpConstructor.cpp. 13771 * runtime/RegExpConstructor.h: Copied from kjs/RegExpConstructor.h. 13772 * runtime/RegExpMatchesArray.h: Copied from kjs/RegExpMatchesArray.h. 13773 * runtime/RegExpObject.cpp: Copied from kjs/RegExpObject.cpp. 13774 * runtime/RegExpObject.h: Copied from kjs/RegExpObject.h. 13775 * runtime/RegExpPrototype.cpp: Copied from kjs/RegExpPrototype.cpp. 13776 * runtime/RegExpPrototype.h: Copied from kjs/RegExpPrototype.h. 13777 137782008-10-31 Mark Rowe <mrowe@apple.com> 13779 13780 Revert an incorrect portion of r38034. 13781 13782 * profiler/ProfilerServer.mm: 13783 137842008-10-31 Mark Rowe <mrowe@apple.com> 13785 13786 Fix the 64-bit build. 13787 13788 Disable strict aliasing in ProfilerServer.mm as it leads to the compiler being unhappy 13789 with the common Obj-C idiom self = [super init]; 13790 13791 * JavaScriptCore.xcodeproj/project.pbxproj: 13792 137932008-10-31 Cameron Zwarich <zwarich@apple.com> 13794 13795 Reviewed by Alexey Proskuryakov. 13796 13797 Change a header guard to match our coding style. 13798 13799 * kjs/InitializeThreading.h: 13800 138012008-10-30 Geoffrey Garen <ggaren@apple.com> 13802 13803 Reviewed by Oliver Hunt. 13804 13805 Fixed a small bit of https://bugs.webkit.org/show_bug.cgi?id=21962 13806 AST uses way too much memory 13807 13808 Removed a word from StatementNode by nixing LabelStack and turning it 13809 into a compile-time data structure managed by CodeGenerator. 13810 13811 v8 tests and SunSpider, run by Gavin, report no change. 13812 13813 * GNUmakefile.am: 13814 * JavaScriptCore.order: 13815 * JavaScriptCore.pri: 13816 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13817 * JavaScriptCore.xcodeproj/project.pbxproj: 13818 * kjs/AllInOneFile.cpp: 13819 * JavaScriptCoreSources.bkl: I sure hope this builds! 13820 13821 * VM/CodeGenerator.cpp: 13822 (JSC::CodeGenerator::CodeGenerator): 13823 (JSC::CodeGenerator::newLabelScope): 13824 (JSC::CodeGenerator::breakTarget): 13825 (JSC::CodeGenerator::continueTarget): 13826 * VM/CodeGenerator.h: Nixed the JumpContext system because it depended 13827 on a LabelStack in the AST, and it was a little cumbersome on the client 13828 side. Replaced with LabelScope, which tracks all break / continue 13829 information in the CodeGenerator, just like we track LabelIDs and other 13830 stacks of compile-time data. 13831 13832 * kjs/LabelScope.h: Added. 13833 (JSC::LabelScope::): 13834 (JSC::LabelScope::LabelScope): 13835 (JSC::LabelScope::ref): 13836 (JSC::LabelScope::deref): 13837 (JSC::LabelScope::refCount): 13838 (JSC::LabelScope::breakTarget): 13839 (JSC::LabelScope::continueTarget): 13840 (JSC::LabelScope::type): 13841 (JSC::LabelScope::name): 13842 (JSC::LabelScope::scopeDepth): Simple abstraction for holding everything 13843 you might want to know about a break-able / continue-able scope. 13844 13845 * kjs/LabelStack.cpp: Removed. 13846 * kjs/LabelStack.h: Removed. 13847 13848 * kjs/grammar.y: No need to push labels at parse time -- we don't store 13849 LabelStacks in the AST anymore. 13850 13851 * kjs/nodes.cpp: 13852 (JSC::DoWhileNode::emitCode): 13853 (JSC::WhileNode::emitCode): 13854 (JSC::ForNode::emitCode): 13855 (JSC::ForInNode::emitCode): 13856 (JSC::ContinueNode::emitCode): 13857 (JSC::BreakNode::emitCode): 13858 (JSC::SwitchNode::emitCode): 13859 (JSC::LabelNode::emitCode): 13860 * kjs/nodes.h: 13861 (JSC::StatementNode::): 13862 (JSC::LabelNode::): Use LabelScope where we used to use JumpContext. 13863 Simplified a bunch of code. Touched up label-related error messages a 13864 bit. 13865 13866 * kjs/nodes2string.cpp: 13867 (JSC::LabelNode::streamTo): Updated for rename. 13868 138692008-10-31 Cameron Zwarich <zwarich@apple.com> 13870 13871 Reviewed by Darin Adler. 13872 13873 Bug 22005: Move StructureIDChain into its own file 13874 <https://bugs.webkit.org/show_bug.cgi?id=22005> 13875 13876 * GNUmakefile.am: 13877 * JavaScriptCore.pri: 13878 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13879 * JavaScriptCore.xcodeproj/project.pbxproj: 13880 * JavaScriptCoreSources.bkl: 13881 * runtime/StructureID.cpp: 13882 * runtime/StructureID.h: 13883 * runtime/StructureIDChain.cpp: Copied from runtime/StructureID.cpp. 13884 * runtime/StructureIDChain.h: Copied from runtime/StructureID.h. 13885 138862008-10-31 Steve Falkenburg <sfalken@apple.com> 13887 13888 Build fix. 13889 13890 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 13891 138922008-10-31 Steve Falkenburg <sfalken@apple.com> 13893 13894 Build fix. 13895 13896 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13897 138982008-10-31 Darin Adler <darin@apple.com> 13899 13900 Reviewed by Dan Bernstein. 13901 13902 - fix storage leak seen on buildbot 13903 13904 Some other cleanup too. The storage leak was caused by the fact 13905 that HashTraits<CallIdentifier>::needsDestruction was false, so 13906 the call identifier objects didn't get deleted. 13907 13908 * profiler/CallIdentifier.h: 13909 13910 Added a default constructor to create empty call identifiers. 13911 13912 Changed the normal constructor to use const UString& 13913 to avoid extra copying and reference count thrash. 13914 13915 Removed the explicit copy constructor definition, since it's what 13916 the compiler will automatically generate. (Rule of thumb: Either 13917 you need both a custom copy constructor and a custom assignment 13918 operator, or neither.) 13919 13920 Moved the CallIdentifier hash function out of the WTF namespace; 13921 there's no reason to put it there. 13922 13923 Changed the CallIdentifier hash function to be a struct rather than 13924 a specialization of the IntHash struct template. Having it be 13925 a specialization made no sense, since CallIdentifier is not an integer, 13926 and did no good. 13927 13928 Removed explicit definition of emptyValueIsZero in the hash traits, 13929 since inheriting from GenericHashTraits already makes that false. 13930 13931 Removed explicit definition of emptyValue, instead relying on the 13932 default constructor and GenericHashTraits. 13933 13934 Removed explicit definition of needsDestruction, because we want it 13935 to have its default value: true, not false. This fixes the leak! 13936 13937 Changed constructDeletedValue and isDeletedValue to use a line number 13938 of numeric_limits<unsigned>::max() to indicate a value is deleted. 13939 Previously this used empty strings for the empty value and null strings 13940 for the deleted value, but it's more efficient to use null for both. 13941 139422008-10-31 Timothy Hatcher <timothy@apple.com> 13943 13944 Emit the WillExecuteStatement debugger hook before the for loop body 13945 when the statement node for the body isn't a block. This allows 13946 breakpoints on those statements in the Web Inspector. 13947 13948 https://bugs.webkit.org/show_bug.cgi?id=22004 13949 13950 Reviewed by Darin Adler. 13951 13952 * kjs/nodes.cpp: 13953 (JSC::ForNode::emitCode): Emit the WillExecuteStatement 13954 debugger hook before the statement node if isn't a block. 13955 Also emit the WillExecuteStatement debugger hook for the 13956 loop as the first op-code. 13957 (JSC::ForInNode::emitCode): Ditto. 13958 139592008-10-31 Timothy Hatcher <timothy@apple.com> 13960 13961 Fixes console warnings about not having an autorelease pool. 13962 Also fixes the build for Snow Leopard, by including individual 13963 Foundation headers instead of Foundation.h. 13964 13965 https://bugs.webkit.org/show_bug.cgi?id=21995 13966 13967 Reviewed by Oliver Hunt. 13968 13969 * profiler/ProfilerServer.mm: 13970 (-[ProfilerServer init]): Create a NSAutoreleasePool and drain it. 13971 139722008-10-31 Cameron Zwarich <zwarich@apple.com> 13973 13974 Not reviewed. 13975 13976 Speculative wxWindows build fix. 13977 13978 * JavaScriptCoreSources.bkl: 13979 * jscore.bkl: 13980 139812008-10-31 Cameron Zwarich <zwarich@apple.com> 13982 13983 Rubber-stamped by Maciej Stachowiak. 13984 13985 Move VM/JSPropertyNameIterator.cpp and VM/JSPropertyNameIterator.h to 13986 the runtime directory. 13987 13988 * GNUmakefile.am: 13989 * JavaScriptCore.pri: 13990 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13991 * JavaScriptCore.xcodeproj/project.pbxproj: 13992 * JavaScriptCoreSources.bkl: 13993 * VM/JSPropertyNameIterator.cpp: Removed. 13994 * VM/JSPropertyNameIterator.h: Removed. 13995 * runtime/JSPropertyNameIterator.cpp: Copied from VM/JSPropertyNameIterator.cpp. 13996 * runtime/JSPropertyNameIterator.h: Copied from VM/JSPropertyNameIterator.h. 13997 139982008-10-31 Cameron Zwarich <zwarich@apple.com> 13999 14000 Not reviewed. 14001 14002 Speculative wxWindows build fix. 14003 14004 * jscore.bkl: 14005 140062008-10-30 Mark Rowe <mrowe@apple.com> 14007 14008 Reviewed by Jon Homeycutt. 14009 14010 Explicitly default to building for only the native architecture in debug and release builds. 14011 14012 * Configurations/DebugRelease.xcconfig: 14013 140142008-10-30 Cameron Zwarich <zwarich@apple.com> 14015 14016 Rubber-stamped by Sam Weinig. 14017 14018 Create a debugger directory in JavaScriptCore and move the relevant 14019 files to it. 14020 14021 * GNUmakefile.am: 14022 * JavaScriptCore.pri: 14023 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14024 * JavaScriptCore.xcodeproj/project.pbxproj: 14025 * VM/CodeBlock.cpp: 14026 * VM/CodeGenerator.h: 14027 * VM/Machine.cpp: 14028 * debugger: Added. 14029 * debugger/Debugger.cpp: Copied from kjs/debugger.cpp. 14030 * debugger/Debugger.h: Copied from kjs/debugger.h. 14031 * debugger/DebuggerCallFrame.cpp: Copied from kjs/DebuggerCallFrame.cpp. 14032 * debugger/DebuggerCallFrame.h: Copied from kjs/DebuggerCallFrame.h. 14033 * kjs/AllInOneFile.cpp: 14034 * kjs/DebuggerCallFrame.cpp: Removed. 14035 * kjs/DebuggerCallFrame.h: Removed. 14036 * kjs/Parser.cpp: 14037 * kjs/Parser.h: 14038 * kjs/debugger.cpp: Removed. 14039 * kjs/debugger.h: Removed. 14040 * kjs/interpreter.cpp: 14041 * kjs/nodes.cpp: 14042 * runtime/FunctionConstructor.cpp: 14043 * runtime/JSGlobalObject.cpp: 14044 140452008-10-30 Benjamin K. Stuhl <bks24@cornell.edu> 14046 14047 gcc 4.3.3/linux-x86 generates "suggest parentheses around && within ||" 14048 warnings; add some parentheses to disambiguate things. No functional 14049 changes, so no tests. 14050 14051 https://bugs.webkit.org/show_bug.cgi?id=21973 14052 Add parentheses to clean up some gcc warnings 14053 14054 Reviewed by Dan Bernstein. 14055 14056 * wtf/ASCIICType.h: 14057 (WTF::isASCIIAlphanumeric): 14058 (WTF::isASCIIHexDigit): 14059 140602008-10-30 Kevin Lindeman <klindeman@apple.com> 14061 14062 Adds ProfilerServer, which is a distributed notification listener 14063 that allows starting and stopping the profiler remotely for use 14064 in conjunction with the profiler's DTace probes. 14065 14066 https://bugs.webkit.org/show_bug.cgi?id=21719 14067 14068 Reviewed by Timothy Hatcher. 14069 14070 * JavaScriptCore.xcodeproj/project.pbxproj: 14071 * kjs/JSGlobalData.cpp: 14072 (JSC::JSGlobalData::JSGlobalData): Calls startProfilerServerIfNeeded. 14073 * profiler/ProfilerServer.h: Added. 14074 * profiler/ProfilerServer.mm: Added. 14075 (+[ProfilerServer sharedProfileServer]): 14076 (-[ProfilerServer init]): 14077 (-[ProfilerServer startProfiling]): 14078 (-[ProfilerServer stopProfiling]): 14079 (JSC::startProfilerServerIfNeeded): 14080 140812008-10-30 Kevin Ollivier <kevino@theolliviers.com> 14082 14083 wx build fix after PropertyMap and StructureID merge. 14084 14085 * JavaScriptCoreSources.bkl: 14086 140872008-10-30 Cameron Zwarich <zwarich@apple.com> 14088 14089 Reviewed by Mark Rowe. 14090 14091 Change the JavaScriptCore Xcode project to use relative paths for the 14092 PCRE source files. 14093 14094 * JavaScriptCore.xcodeproj/project.pbxproj: 14095 140962008-10-30 Sam Weinig <sam@webkit.org> 14097 14098 Reviewed by Cameron Zwarich and Geoffrey Garen. 14099 14100 Fix for https://bugs.webkit.org/show_bug.cgi?id=21989 14101 Merge PropertyMap and StructureID 14102 14103 - Move PropertyMap code into StructureID in preparation for lazily 14104 creating the map on gets. 14105 - Make remove with transition explicit by adding removePropertyTransition. 14106 - Make the put/remove without transition explicit. 14107 - Make cache invalidation part of put/remove without transition. 14108 14109 1% speedup on SunSpider; 0.5% speedup on v8 suite. 14110 14111 * GNUmakefile.am: 14112 * JavaScriptCore.exp: 14113 * JavaScriptCore.pri: 14114 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14115 * JavaScriptCore.xcodeproj/project.pbxproj: 14116 * JavaScriptCoreSources.bkl: 14117 * kjs/AllInOneFile.cpp: 14118 * kjs/identifier.h: 14119 * runtime/JSObject.cpp: 14120 (JSC::JSObject::removeDirect): 14121 * runtime/JSObject.h: 14122 (JSC::JSObject::putDirect): 14123 * runtime/PropertyMap.cpp: Removed. 14124 * runtime/PropertyMap.h: Removed. 14125 * runtime/PropertyMapHashTable.h: Copied from runtime/PropertyMap.h. 14126 * runtime/StructureID.cpp: 14127 (JSC::StructureID::dumpStatistics): 14128 (JSC::StructureID::StructureID): 14129 (JSC::StructureID::~StructureID): 14130 (JSC::StructureID::getEnumerablePropertyNames): 14131 (JSC::StructureID::addPropertyTransition): 14132 (JSC::StructureID::removePropertyTransition): 14133 (JSC::StructureID::toDictionaryTransition): 14134 (JSC::StructureID::changePrototypeTransition): 14135 (JSC::StructureID::getterSetterTransition): 14136 (JSC::StructureID::addPropertyWithoutTransition): 14137 (JSC::StructureID::removePropertyWithoutTransition): 14138 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): 14139 (JSC::StructureID::checkConsistency): 14140 (JSC::StructureID::copyPropertyTable): 14141 (JSC::StructureID::get): 14142 (JSC::StructureID::put): 14143 (JSC::StructureID::remove): 14144 (JSC::StructureID::insertIntoPropertyMapHashTable): 14145 (JSC::StructureID::expandPropertyMapHashTable): 14146 (JSC::StructureID::createPropertyMapHashTable): 14147 (JSC::StructureID::rehashPropertyMapHashTable): 14148 (JSC::comparePropertyMapEntryIndices): 14149 (JSC::StructureID::getEnumerablePropertyNamesInternal): 14150 * runtime/StructureID.h: 14151 (JSC::StructureID::propertyStorageSize): 14152 (JSC::StructureID::isEmpty): 14153 (JSC::StructureID::get): 14154 141552008-10-30 Cameron Zwarich <zwarich@apple.com> 14156 14157 Reviewed by Oliver Hunt. 14158 14159 Bug 21987: CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result register 14160 <https://bugs.webkit.org/show_bug.cgi?id=21987> 14161 14162 CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result 14163 register as ecx, but it should be tempReg1, which is ecx at all of its 14164 callsites. 14165 14166 * VM/CTI.cpp: 14167 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): 14168 141692008-10-30 Cameron Zwarich <zwarich@apple.com> 14170 14171 Reviewed by Sam Weinig. 14172 14173 Bug 21985: Opcodes should use eax as their destination register whenever possible 14174 <https://bugs.webkit.org/show_bug.cgi?id=21985> 14175 14176 Change more opcodes to use eax as the register for their final result, 14177 and change calls to emitPutResult() that pass eax to rely on the default 14178 value of eax. 14179 14180 * VM/CTI.cpp: 14181 (JSC::CTI::privateCompileMainPass): 14182 141832008-10-30 Alp Toker <alp@nuanti.com> 14184 14185 Build fix attempt for older gcc on the trunk-mac-intel build bot 14186 (error: initializer for scalar variable requires one element). 14187 14188 Modify the initializer syntax slightly with an additional comma. 14189 14190 * VM/Machine.cpp: 14191 (JSC::Machine::cti_op_call_JSFunction): 14192 (JSC::Machine::cti_op_construct_JSConstruct): 14193 (JSC::Machine::cti_op_resolve_func): 14194 (JSC::Machine::cti_op_post_inc): 14195 (JSC::Machine::cti_op_resolve_with_base): 14196 (JSC::Machine::cti_op_post_dec): 14197 141982008-10-30 Alp Toker <alp@nuanti.com> 14199 14200 Reviewed by Alexey Proskuryakov. 14201 14202 https://bugs.webkit.org/show_bug.cgi?id=21571 14203 VoidPtrPair breaks CTI on Linux 14204 14205 The VoidPtrPair return change made in r37457 does not work on Linux 14206 since POD structs aren't passed in registers. 14207 14208 This patch uses a union to vectorize VoidPtrPair to a uint64_t and 14209 matches Darwin/MSVC fixing CTI/WREC on Linux. 14210 14211 Alexey reports no measurable change in Mac performance with this fix. 14212 14213 * VM/Machine.cpp: 14214 (JSC::Machine::cti_op_call_JSFunction): 14215 (JSC::Machine::cti_op_construct_JSConstruct): 14216 (JSC::Machine::cti_op_resolve_func): 14217 (JSC::Machine::cti_op_post_inc): 14218 (JSC::Machine::cti_op_resolve_with_base): 14219 (JSC::Machine::cti_op_post_dec): 14220 * VM/Machine.h: 14221 (JSC::): 14222 142232008-10-29 Oliver Hunt <oliver@apple.com> 14224 14225 Reviewed by Geoff Garen. 14226 14227 Initial work to reduce cost of JSNumberCell allocation 14228 14229 This does the initial work needed to bring more of number 14230 allocation into CTI code directly, rather than just falling 14231 back onto the slow paths if we can't guarantee that a number 14232 cell can be reused. 14233 14234 Initial implementation only used by op_negate to make sure 14235 it all works. In a negate heavy (though not dominated) test 14236 it results in a 10% win in the non-reusable cell case. 14237 14238 * VM/CTI.cpp: 14239 (JSC::): 14240 (JSC::CTI::emitAllocateNumber): 14241 (JSC::CTI::emitNakedFastCall): 14242 (JSC::CTI::emitArithIntToImmWithJump): 14243 (JSC::CTI::privateCompileMainPass): 14244 (JSC::CTI::privateCompileSlowCases): 14245 * VM/CTI.h: 14246 * VM/CodeBlock.cpp: 14247 (JSC::CodeBlock::dump): 14248 * VM/CodeGenerator.cpp: 14249 (JSC::CodeGenerator::emitUnaryOp): 14250 * VM/CodeGenerator.h: 14251 (JSC::CodeGenerator::emitToJSNumber): 14252 (JSC::CodeGenerator::emitTypeOf): 14253 (JSC::CodeGenerator::emitGetPropertyNames): 14254 * VM/Machine.cpp: 14255 (JSC::Machine::privateExecute): 14256 * VM/Machine.h: 14257 * kjs/ResultType.h: 14258 (JSC::ResultType::isReusableNumber): 14259 (JSC::ResultType::toInt): 14260 * kjs/nodes.cpp: 14261 (JSC::UnaryOpNode::emitCode): 14262 (JSC::BinaryOpNode::emitCode): 14263 (JSC::EqualNode::emitCode): 14264 * masm/X86Assembler.h: 14265 (JSC::X86Assembler::): 14266 (JSC::X86Assembler::negl_r): 14267 (JSC::X86Assembler::xorpd_mr): 14268 * runtime/JSNumberCell.h: 14269 (JSC::JSNumberCell::JSNumberCell): 14270 142712008-10-29 Steve Falkenburg <sfalken@apple.com> 14272 14273 <rdar://problem/6326563> Crash on launch 14274 14275 For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex. 14276 14277 Exporting data from a DLL on Windows requires specifying __declspec(dllimport) in the header used by 14278 callers, but __declspec(dllexport) when defined in the DLL implementation. By instead exporting 14279 the explicit lock/unlock functions, we can avoid this. 14280 14281 Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function. 14282 14283 Reviewed by Darin Adler. 14284 14285 * wtf/Threading.h: 14286 (WTF::lockAtomicallyInitializedStaticMutex): 14287 (WTF::unlockAtomicallyInitializedStaticMutex): 14288 * wtf/ThreadingWin.cpp: 14289 (WTF::lockAtomicallyInitializedStaticMutex): 14290 (WTF::unlockAtomicallyInitializedStaticMutex): 14291 142922008-10-29 Sam Weinig <sam@webkit.org> 14293 14294 Reviewed by Oliver Hunt. 14295 14296 Remove direct use of PropertyMap. 14297 14298 * JavaScriptCore.exp: 14299 * runtime/JSObject.cpp: 14300 (JSC::JSObject::mark): 14301 (JSC::JSObject::put): 14302 (JSC::JSObject::deleteProperty): 14303 (JSC::JSObject::getPropertyAttributes): 14304 (JSC::JSObject::removeDirect): 14305 * runtime/JSObject.h: 14306 (JSC::JSObject::getDirect): 14307 (JSC::JSObject::getDirectLocation): 14308 (JSC::JSObject::hasCustomProperties): 14309 (JSC::JSObject::JSObject): 14310 (JSC::JSObject::putDirect): 14311 * runtime/PropertyMap.cpp: 14312 (JSC::PropertyMap::get): 14313 * runtime/PropertyMap.h: 14314 (JSC::PropertyMap::isEmpty): 14315 (JSC::PropertyMap::get): 14316 * runtime/StructureID.cpp: 14317 (JSC::StructureID::dumpStatistics): 14318 * runtime/StructureID.h: 14319 (JSC::StructureID::propertyStorageSize): 14320 (JSC::StructureID::get): 14321 (JSC::StructureID::put): 14322 (JSC::StructureID::remove): 14323 (JSC::StructureID::isEmpty): 14324 143252008-10-29 Sam Weinig <sam@webkit.org> 14326 14327 Reviewed by Geoffrey Garen. 14328 14329 Rename and move the StructureID transition table to its own file. 14330 14331 * GNUmakefile.am: 14332 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14333 * JavaScriptCore.xcodeproj/project.pbxproj: 14334 * runtime/StructureID.cpp: 14335 (JSC::StructureID::addPropertyTransition): 14336 * runtime/StructureID.h: 14337 (JSC::StructureID::): 14338 * runtime/StructureIDTransitionTable.h: Copied from runtime/StructureID.h. 14339 (JSC::StructureIDTransitionTableHash::hash): 14340 (JSC::StructureIDTransitionTableHash::equal): 14341 143422008-10-29 Sam Weinig <sam@webkit.org> 14343 14344 Reviewed by Cameron Zwarich. 14345 14346 Fix for https://bugs.webkit.org/show_bug.cgi?id=21958 14347 Pack bits in StructureID to reduce the size of each StructureID by 2 words. 14348 14349 * runtime/PropertyMap.h: 14350 (JSC::PropertyMap::propertyMapSize): 14351 * runtime/StructureID.cpp: 14352 (JSC::StructureID::dumpStatistics): Add additional size statistics when dumping. 14353 (JSC::StructureID::StructureID): 14354 * runtime/StructureID.h: 14355 143562008-10-29 Kevin Ollivier <kevino@theolliviers.com> 14357 14358 wx build fixes after addition of runtime and ImageBuffer changes. 14359 14360 * JavaScriptCoreSources.bkl: 14361 * jscore.bkl: 14362 143632008-10-29 Timothy Hatcher <timothy@apple.com> 14364 14365 Emit the WillExecuteStatement debugger hook before the "else" body 14366 when there is no block for the "else" body. This allows breakpoints 14367 on those statements in the Web Inspector. 14368 14369 https://bugs.webkit.org/show_bug.cgi?id=21944 14370 14371 Reviewed by Maciej Stachowiak. 14372 14373 * kjs/nodes.cpp: 14374 (JSC::IfElseNode::emitCode): Emit the WillExecuteStatement 14375 debugger hook before the else node if isn't a block. 14376 143772008-10-29 Alexey Proskuryakov <ap@webkit.org> 14378 14379 Build fix. 14380 14381 * JavaScriptCore.exp: Export HashTable::deleteTable(). 14382 143832008-10-28 Alp Toker <alp@nuanti.com> 14384 14385 Fix builddir != srcdir builds after kjs -> runtime breakage. Sources 14386 may now be generated in both kjs/ and runtime/. 14387 14388 Also sort the sources list for readability. 14389 14390 * GNUmakefile.am: 14391 143922008-10-28 Alp Toker <alp@nuanti.com> 14393 14394 Reviewed by Cameron Zwarich. 14395 14396 Build fix attempt after kjs -> runtime rename. 14397 14398 * GNUmakefile.am: 14399 144002008-10-28 Cameron Zwarich <zwarich@apple.com> 14401 14402 Not reviewed. 14403 14404 Remove a duplicate includes directory. 14405 14406 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14407 144082008-10-28 Cameron Zwarich <zwarich@apple.com> 14409 14410 Not reviewed. 14411 14412 Attempt to fix the Windows build. 14413 14414 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14415 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 14416 144172008-10-28 Dan Bernstein <mitz@apple.com> 14418 14419 Reviewed by Mark Rowe. 14420 14421 - export WTF::atomicallyInitializedStaticMutex 14422 14423 * JavaScriptCore.exp: 14424 144252008-10-28 Geoffrey Garen <ggaren@apple.com> 14426 14427 Reviewed by Cameron Zwarich. 14428 14429 Fixed CodeBlock dumping to accurately report constant register indices. 14430 14431 * VM/CodeBlock.cpp: 14432 (JSC::CodeBlock::dump): 14433 144342008-10-28 Cameron Zwarich <zwarich@apple.com> 14435 14436 Not reviewed. 14437 14438 More Qt build fixes. 14439 14440 * JavaScriptCore.pri: 14441 144422008-10-28 Cameron Zwarich <zwarich@apple.com> 14443 14444 Not reviewed. 14445 14446 Fix the Qt build, hopefully for real this time. 14447 14448 * JavaScriptCore.pri: 14449 144502008-10-28 Cameron Zwarich <zwarich@apple.com> 14451 14452 Not reviewed. 14453 14454 Fix the Qt build. 14455 14456 * JavaScriptCore.pri: 14457 144582008-10-28 Cameron Zwarich <zwarich@apple.com> 14459 14460 Not reviewed. 14461 14462 Fix the Windows build. 14463 14464 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14465 144662008-10-28 Cameron Zwarich <zwarich@apple.com> 14467 14468 Rubber-stamped by Sam Weinig. 14469 14470 Create a runtime directory in JavaScriptCore and begin moving files to 14471 it. This is the first step towards removing the kjs directory and 14472 placing files in more meaningful subdirectories of JavaScriptCore. 14473 14474 * API/JSBase.cpp: 14475 * API/JSCallbackConstructor.cpp: 14476 * API/JSCallbackConstructor.h: 14477 * API/JSCallbackFunction.cpp: 14478 * API/JSClassRef.cpp: 14479 * API/JSClassRef.h: 14480 * API/JSStringRefCF.cpp: 14481 * API/JSValueRef.cpp: 14482 * API/OpaqueJSString.cpp: 14483 * DerivedSources.make: 14484 * GNUmakefile.am: 14485 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14486 * JavaScriptCore.xcodeproj/project.pbxproj: 14487 * kjs/AllInOneFile.cpp: 14488 * kjs/ArrayConstructor.cpp: Removed. 14489 * kjs/ArrayConstructor.h: Removed. 14490 * kjs/ArrayPrototype.cpp: Removed. 14491 * kjs/ArrayPrototype.h: Removed. 14492 * kjs/BooleanConstructor.cpp: Removed. 14493 * kjs/BooleanConstructor.h: Removed. 14494 * kjs/BooleanObject.cpp: Removed. 14495 * kjs/BooleanObject.h: Removed. 14496 * kjs/BooleanPrototype.cpp: Removed. 14497 * kjs/BooleanPrototype.h: Removed. 14498 * kjs/CallData.cpp: Removed. 14499 * kjs/CallData.h: Removed. 14500 * kjs/ClassInfo.h: Removed. 14501 * kjs/ConstructData.cpp: Removed. 14502 * kjs/ConstructData.h: Removed. 14503 * kjs/DateConstructor.cpp: Removed. 14504 * kjs/DateConstructor.h: Removed. 14505 * kjs/DateInstance.cpp: Removed. 14506 * kjs/DateInstance.h: Removed. 14507 * kjs/DateMath.cpp: Removed. 14508 * kjs/DateMath.h: Removed. 14509 * kjs/DatePrototype.cpp: Removed. 14510 * kjs/DatePrototype.h: Removed. 14511 * kjs/Error.cpp: Removed. 14512 * kjs/Error.h: Removed. 14513 * kjs/ErrorConstructor.cpp: Removed. 14514 * kjs/ErrorConstructor.h: Removed. 14515 * kjs/ErrorInstance.cpp: Removed. 14516 * kjs/ErrorInstance.h: Removed. 14517 * kjs/ErrorPrototype.cpp: Removed. 14518 * kjs/ErrorPrototype.h: Removed. 14519 * kjs/FunctionConstructor.cpp: Removed. 14520 * kjs/FunctionConstructor.h: Removed. 14521 * kjs/FunctionPrototype.cpp: Removed. 14522 * kjs/FunctionPrototype.h: Removed. 14523 * kjs/GlobalEvalFunction.cpp: Removed. 14524 * kjs/GlobalEvalFunction.h: Removed. 14525 * kjs/InternalFunction.cpp: Removed. 14526 * kjs/InternalFunction.h: Removed. 14527 * kjs/JSArray.cpp: Removed. 14528 * kjs/JSArray.h: Removed. 14529 * kjs/JSCell.cpp: Removed. 14530 * kjs/JSCell.h: Removed. 14531 * kjs/JSFunction.cpp: Removed. 14532 * kjs/JSFunction.h: Removed. 14533 * kjs/JSGlobalObject.cpp: Removed. 14534 * kjs/JSGlobalObject.h: Removed. 14535 * kjs/JSGlobalObjectFunctions.cpp: Removed. 14536 * kjs/JSGlobalObjectFunctions.h: Removed. 14537 * kjs/JSImmediate.cpp: Removed. 14538 * kjs/JSImmediate.h: Removed. 14539 * kjs/JSNotAnObject.cpp: Removed. 14540 * kjs/JSNotAnObject.h: Removed. 14541 * kjs/JSNumberCell.cpp: Removed. 14542 * kjs/JSNumberCell.h: Removed. 14543 * kjs/JSObject.cpp: Removed. 14544 * kjs/JSObject.h: Removed. 14545 * kjs/JSString.cpp: Removed. 14546 * kjs/JSString.h: Removed. 14547 * kjs/JSValue.cpp: Removed. 14548 * kjs/JSValue.h: Removed. 14549 * kjs/JSVariableObject.cpp: Removed. 14550 * kjs/JSVariableObject.h: Removed. 14551 * kjs/JSWrapperObject.cpp: Removed. 14552 * kjs/JSWrapperObject.h: Removed. 14553 * kjs/MathObject.cpp: Removed. 14554 * kjs/MathObject.h: Removed. 14555 * kjs/NativeErrorConstructor.cpp: Removed. 14556 * kjs/NativeErrorConstructor.h: Removed. 14557 * kjs/NativeErrorPrototype.cpp: Removed. 14558 * kjs/NativeErrorPrototype.h: Removed. 14559 * kjs/NumberConstructor.cpp: Removed. 14560 * kjs/NumberConstructor.h: Removed. 14561 * kjs/NumberObject.cpp: Removed. 14562 * kjs/NumberObject.h: Removed. 14563 * kjs/NumberPrototype.cpp: Removed. 14564 * kjs/NumberPrototype.h: Removed. 14565 * kjs/ObjectConstructor.cpp: Removed. 14566 * kjs/ObjectConstructor.h: Removed. 14567 * kjs/ObjectPrototype.cpp: Removed. 14568 * kjs/ObjectPrototype.h: Removed. 14569 * kjs/PropertyMap.cpp: Removed. 14570 * kjs/PropertyMap.h: Removed. 14571 * kjs/PropertySlot.cpp: Removed. 14572 * kjs/PropertySlot.h: Removed. 14573 * kjs/PrototypeFunction.cpp: Removed. 14574 * kjs/PrototypeFunction.h: Removed. 14575 * kjs/PutPropertySlot.h: Removed. 14576 * kjs/SmallStrings.cpp: Removed. 14577 * kjs/SmallStrings.h: Removed. 14578 * kjs/StringConstructor.cpp: Removed. 14579 * kjs/StringConstructor.h: Removed. 14580 * kjs/StringObject.cpp: Removed. 14581 * kjs/StringObject.h: Removed. 14582 * kjs/StringObjectThatMasqueradesAsUndefined.h: Removed. 14583 * kjs/StringPrototype.cpp: Removed. 14584 * kjs/StringPrototype.h: Removed. 14585 * kjs/StructureID.cpp: Removed. 14586 * kjs/StructureID.h: Removed. 14587 * kjs/completion.h: 14588 * kjs/interpreter.h: 14589 * runtime: Added. 14590 * runtime/ArrayConstructor.cpp: Copied from kjs/ArrayConstructor.cpp. 14591 * runtime/ArrayConstructor.h: Copied from kjs/ArrayConstructor.h. 14592 * runtime/ArrayPrototype.cpp: Copied from kjs/ArrayPrototype.cpp. 14593 * runtime/ArrayPrototype.h: Copied from kjs/ArrayPrototype.h. 14594 * runtime/BooleanConstructor.cpp: Copied from kjs/BooleanConstructor.cpp. 14595 * runtime/BooleanConstructor.h: Copied from kjs/BooleanConstructor.h. 14596 * runtime/BooleanObject.cpp: Copied from kjs/BooleanObject.cpp. 14597 * runtime/BooleanObject.h: Copied from kjs/BooleanObject.h. 14598 * runtime/BooleanPrototype.cpp: Copied from kjs/BooleanPrototype.cpp. 14599 * runtime/BooleanPrototype.h: Copied from kjs/BooleanPrototype.h. 14600 * runtime/CallData.cpp: Copied from kjs/CallData.cpp. 14601 * runtime/CallData.h: Copied from kjs/CallData.h. 14602 * runtime/ClassInfo.h: Copied from kjs/ClassInfo.h. 14603 * runtime/ConstructData.cpp: Copied from kjs/ConstructData.cpp. 14604 * runtime/ConstructData.h: Copied from kjs/ConstructData.h. 14605 * runtime/DateConstructor.cpp: Copied from kjs/DateConstructor.cpp. 14606 * runtime/DateConstructor.h: Copied from kjs/DateConstructor.h. 14607 * runtime/DateInstance.cpp: Copied from kjs/DateInstance.cpp. 14608 * runtime/DateInstance.h: Copied from kjs/DateInstance.h. 14609 * runtime/DateMath.cpp: Copied from kjs/DateMath.cpp. 14610 * runtime/DateMath.h: Copied from kjs/DateMath.h. 14611 * runtime/DatePrototype.cpp: Copied from kjs/DatePrototype.cpp. 14612 * runtime/DatePrototype.h: Copied from kjs/DatePrototype.h. 14613 * runtime/Error.cpp: Copied from kjs/Error.cpp. 14614 * runtime/Error.h: Copied from kjs/Error.h. 14615 * runtime/ErrorConstructor.cpp: Copied from kjs/ErrorConstructor.cpp. 14616 * runtime/ErrorConstructor.h: Copied from kjs/ErrorConstructor.h. 14617 * runtime/ErrorInstance.cpp: Copied from kjs/ErrorInstance.cpp. 14618 * runtime/ErrorInstance.h: Copied from kjs/ErrorInstance.h. 14619 * runtime/ErrorPrototype.cpp: Copied from kjs/ErrorPrototype.cpp. 14620 * runtime/ErrorPrototype.h: Copied from kjs/ErrorPrototype.h. 14621 * runtime/FunctionConstructor.cpp: Copied from kjs/FunctionConstructor.cpp. 14622 * runtime/FunctionConstructor.h: Copied from kjs/FunctionConstructor.h. 14623 * runtime/FunctionPrototype.cpp: Copied from kjs/FunctionPrototype.cpp. 14624 * runtime/FunctionPrototype.h: Copied from kjs/FunctionPrototype.h. 14625 * runtime/GlobalEvalFunction.cpp: Copied from kjs/GlobalEvalFunction.cpp. 14626 * runtime/GlobalEvalFunction.h: Copied from kjs/GlobalEvalFunction.h. 14627 * runtime/InternalFunction.cpp: Copied from kjs/InternalFunction.cpp. 14628 * runtime/InternalFunction.h: Copied from kjs/InternalFunction.h. 14629 * runtime/JSArray.cpp: Copied from kjs/JSArray.cpp. 14630 * runtime/JSArray.h: Copied from kjs/JSArray.h. 14631 * runtime/JSCell.cpp: Copied from kjs/JSCell.cpp. 14632 * runtime/JSCell.h: Copied from kjs/JSCell.h. 14633 * runtime/JSFunction.cpp: Copied from kjs/JSFunction.cpp. 14634 * runtime/JSFunction.h: Copied from kjs/JSFunction.h. 14635 * runtime/JSGlobalObject.cpp: Copied from kjs/JSGlobalObject.cpp. 14636 * runtime/JSGlobalObject.h: Copied from kjs/JSGlobalObject.h. 14637 * runtime/JSGlobalObjectFunctions.cpp: Copied from kjs/JSGlobalObjectFunctions.cpp. 14638 * runtime/JSGlobalObjectFunctions.h: Copied from kjs/JSGlobalObjectFunctions.h. 14639 * runtime/JSImmediate.cpp: Copied from kjs/JSImmediate.cpp. 14640 * runtime/JSImmediate.h: Copied from kjs/JSImmediate.h. 14641 * runtime/JSNotAnObject.cpp: Copied from kjs/JSNotAnObject.cpp. 14642 * runtime/JSNotAnObject.h: Copied from kjs/JSNotAnObject.h. 14643 * runtime/JSNumberCell.cpp: Copied from kjs/JSNumberCell.cpp. 14644 * runtime/JSNumberCell.h: Copied from kjs/JSNumberCell.h. 14645 * runtime/JSObject.cpp: Copied from kjs/JSObject.cpp. 14646 * runtime/JSObject.h: Copied from kjs/JSObject.h. 14647 * runtime/JSString.cpp: Copied from kjs/JSString.cpp. 14648 * runtime/JSString.h: Copied from kjs/JSString.h. 14649 * runtime/JSValue.cpp: Copied from kjs/JSValue.cpp. 14650 * runtime/JSValue.h: Copied from kjs/JSValue.h. 14651 * runtime/JSVariableObject.cpp: Copied from kjs/JSVariableObject.cpp. 14652 * runtime/JSVariableObject.h: Copied from kjs/JSVariableObject.h. 14653 * runtime/JSWrapperObject.cpp: Copied from kjs/JSWrapperObject.cpp. 14654 * runtime/JSWrapperObject.h: Copied from kjs/JSWrapperObject.h. 14655 * runtime/MathObject.cpp: Copied from kjs/MathObject.cpp. 14656 * runtime/MathObject.h: Copied from kjs/MathObject.h. 14657 * runtime/NativeErrorConstructor.cpp: Copied from kjs/NativeErrorConstructor.cpp. 14658 * runtime/NativeErrorConstructor.h: Copied from kjs/NativeErrorConstructor.h. 14659 * runtime/NativeErrorPrototype.cpp: Copied from kjs/NativeErrorPrototype.cpp. 14660 * runtime/NativeErrorPrototype.h: Copied from kjs/NativeErrorPrototype.h. 14661 * runtime/NumberConstructor.cpp: Copied from kjs/NumberConstructor.cpp. 14662 * runtime/NumberConstructor.h: Copied from kjs/NumberConstructor.h. 14663 * runtime/NumberObject.cpp: Copied from kjs/NumberObject.cpp. 14664 * runtime/NumberObject.h: Copied from kjs/NumberObject.h. 14665 * runtime/NumberPrototype.cpp: Copied from kjs/NumberPrototype.cpp. 14666 * runtime/NumberPrototype.h: Copied from kjs/NumberPrototype.h. 14667 * runtime/ObjectConstructor.cpp: Copied from kjs/ObjectConstructor.cpp. 14668 * runtime/ObjectConstructor.h: Copied from kjs/ObjectConstructor.h. 14669 * runtime/ObjectPrototype.cpp: Copied from kjs/ObjectPrototype.cpp. 14670 * runtime/ObjectPrototype.h: Copied from kjs/ObjectPrototype.h. 14671 * runtime/PropertyMap.cpp: Copied from kjs/PropertyMap.cpp. 14672 * runtime/PropertyMap.h: Copied from kjs/PropertyMap.h. 14673 * runtime/PropertySlot.cpp: Copied from kjs/PropertySlot.cpp. 14674 * runtime/PropertySlot.h: Copied from kjs/PropertySlot.h. 14675 * runtime/PrototypeFunction.cpp: Copied from kjs/PrototypeFunction.cpp. 14676 * runtime/PrototypeFunction.h: Copied from kjs/PrototypeFunction.h. 14677 * runtime/PutPropertySlot.h: Copied from kjs/PutPropertySlot.h. 14678 * runtime/SmallStrings.cpp: Copied from kjs/SmallStrings.cpp. 14679 * runtime/SmallStrings.h: Copied from kjs/SmallStrings.h. 14680 * runtime/StringConstructor.cpp: Copied from kjs/StringConstructor.cpp. 14681 * runtime/StringConstructor.h: Copied from kjs/StringConstructor.h. 14682 * runtime/StringObject.cpp: Copied from kjs/StringObject.cpp. 14683 * runtime/StringObject.h: Copied from kjs/StringObject.h. 14684 * runtime/StringObjectThatMasqueradesAsUndefined.h: Copied from kjs/StringObjectThatMasqueradesAsUndefined.h. 14685 * runtime/StringPrototype.cpp: Copied from kjs/StringPrototype.cpp. 14686 * runtime/StringPrototype.h: Copied from kjs/StringPrototype.h. 14687 * runtime/StructureID.cpp: Copied from kjs/StructureID.cpp. 14688 * runtime/StructureID.h: Copied from kjs/StructureID.h. 14689 146902008-10-28 Geoffrey Garen <ggaren@apple.com> 14691 14692 Reviewed by Sam Weinig. 14693 14694 Fixed https://bugs.webkit.org/show_bug.cgi?id=21919 14695 Sampler reports bogus time in op_enter during 3d-raytrace.js 14696 14697 Fixed a bug where we would pass the incorrect Instruction* during some 14698 parts of CTI codegen. 14699 14700 * VM/CTI.cpp: 14701 (JSC::CTI::privateCompileMainPass): 14702 (JSC::CTI::privateCompileSlowCases): 14703 * VM/SamplingTool.cpp: 14704 (JSC::SamplingTool::run): 14705 * wtf/Platform.h: 14706 147072008-10-28 Kevin McCullough <kmccullough@apple.com> 14708 14709 Reviewed by Dan Bernstein. 14710 14711 -Removed unused includes. 14712 Apparent .4% speedup in Sunspider 14713 14714 * kjs/JSObject.cpp: 14715 * kjs/interpreter.cpp: 14716 147172008-10-28 Alp Toker <alp@nuanti.com> 14718 14719 Include copyright license files in the autotools dist target. 14720 14721 Change suggested by Mike Hommey. 14722 14723 * GNUmakefile.am: 14724 147252008-10-27 Geoffrey Garen <ggaren@apple.com> 14726 14727 Reviewed by Maciej Stachowiak. 14728 14729 Stop discarding CodeBlock samples that can't be charged to a specific 14730 opcode. Instead, charge the relevant CodeBlock, and provide a footnote 14731 explaining the situation. 14732 14733 This will help us tell which CodeBlocks are hot, even if we can't 14734 identify specific lines of code within the CodeBlocks. 14735 14736 * VM/SamplingTool.cpp: 14737 (JSC::ScopeSampleRecord::sample): 14738 (JSC::compareScopeSampleRecords): 14739 (JSC::SamplingTool::dump): 14740 14741 * VM/SamplingTool.h: 14742 (JSC::ScopeSampleRecord::ScopeSampleRecord): 14743 (JSC::ScopeSampleRecord::~ScopeSampleRecord): 14744 147452008-10-27 Geoffrey Garen <ggaren@apple.com> 14746 14747 Reviewed by Sam Weinig. 14748 14749 Added a mutex around the SamplingTool's ScopeNode* map, to solve a crash 14750 when sampling the v8 tests. 14751 14752 * VM/SamplingTool.cpp: 14753 (JSC::SamplingTool::run): 14754 (JSC::SamplingTool::notifyOfScope): 14755 * VM/SamplingTool.h: Since new ScopeNodes can be created after 14756 the SamplingTools has begun sampling, reads and writes to / from the 14757 map need to be synchronized. Shark says this doesn't measurably increase 14758 sampling overhead. 14759 147602008-10-25 Geoffrey Garen <ggaren@apple.com> 14761 14762 Not reviewed. 14763 14764 Try to fix Windows build. 14765 14766 * VM/Machine.cpp: 14767 (JSC::Machine::privateExecute): Provide a dummy value to the 14768 HostCallRecord in CTI non-sampling builds, to silence compiler warning. 14769 147702008-10-25 Geoffrey Garen <ggaren@apple.com> 14771 14772 Not reviewed. 14773 14774 Try to fix Windows build. 14775 14776 * VM/SamplingTool.h: 14777 (JSC::SamplingTool::encodeSample): Explicitly cast bool to int, to 14778 silence compiler warning. 14779 147802008-10-25 Geoffrey Garen <ggaren@apple.com> 14781 14782 Reviewed by Sam Weinig, with Gavin Barraclough's help. 14783 14784 Fixed Sampling Tool: 14785 - Made CodeBlock sampling work with CTI 14786 - Improved accuracy by unifying most sampling data into a single 14787 32bit word, which can be written / read atomically. 14788 - Split out three different #ifdefs for modularity: OPCODE_SAMPLING; 14789 CODEBLOCK_SAMPLING; OPCODE_STATS. 14790 - Improved reporting clarity 14791 - Refactored for code clarity 14792 14793 * JavaScriptCore.exp: Exported another symbol. 14794 14795 * VM/CTI.cpp: 14796 (JSC::CTI::emitCTICall): 14797 (JSC::CTI::compileOpCall): 14798 (JSC::CTI::emitSlowScriptCheck): 14799 (JSC::CTI::compileBinaryArithOpSlowCase): 14800 (JSC::CTI::privateCompileMainPass): 14801 (JSC::CTI::privateCompileSlowCases): 14802 (JSC::CTI::privateCompile): 14803 * VM/CTI.h: Updated CTI codegen to use the unified SamplingTool interface 14804 for encoding samples. (This required passing the current vPC to a lot 14805 more functions, since the unified interface samples the current vPC.) 14806 Added hooks for writing the current CodeBlock* on function entry and 14807 after a function call, for the sake of the CodeBlock sampler. Removed 14808 obsolete hook for clearing the current sample inside op_end. Also removed 14809 the custom enum used to differentiate flavors of op_call, since the 14810 OpcodeID enum works just as well. (This was important in an earlier 14811 version of the patch, but now it's just cleanup.) 14812 14813 * VM/CodeBlock.cpp: 14814 (JSC::CodeBlock::lineNumberForVPC): 14815 * VM/CodeBlock.h: Upated for refactored #ifdefs. Changed lineNumberForVPC 14816 to be robust against vPCs not recorded for exception handling, since 14817 the Sampler may ask for an arbitrary vPC. 14818 14819 * VM/Machine.cpp: 14820 (JSC::Machine::execute): 14821 (JSC::Machine::privateExecute): 14822 (JSC::Machine::cti_op_call_NotJSFunction): 14823 (JSC::Machine::cti_op_construct_NotJSConstruct): 14824 * VM/Machine.h: 14825 (JSC::Machine::setSampler): 14826 (JSC::Machine::sampler): 14827 (JSC::Machine::jitCodeBuffer): Upated for refactored #ifdefs. Changed 14828 Machine to use SamplingTool helper objects to record movement in and 14829 out of host code. This makes samples a bit more precise. 14830 14831 * VM/Opcode.cpp: 14832 (JSC::OpcodeStats::~OpcodeStats): 14833 * VM/Opcode.h: Upated for refactored #ifdefs. Added a little more padding, 14834 to accomodate our more verbose opcode names. 14835 14836 * VM/SamplingTool.cpp: 14837 (JSC::ScopeSampleRecord::sample): Only count a sample toward our total 14838 if we actually record it. This solves cases where a CodeBlock will 14839 claim to have been sampled many times, with reported samples that don't 14840 match. 14841 14842 (JSC::SamplingTool::run): Read the current sample into a Sample helper 14843 object, to ensure that the data doesn't change while we're analyzing it, 14844 and to help decode the data. Only access the CodeBlock sampling hash 14845 table if CodeBlock sampling has been enabled, so non-CodeBlock sampling 14846 runs can operate with even less overhead. 14847 14848 (JSC::SamplingTool::dump): I reorganized this code a lot to print the 14849 most important info at the top, print as a table, annotate and document 14850 the stuff I didn't understand when I started, etc. 14851 14852 * VM/SamplingTool.h: New helper classes, described above. 14853 14854 * kjs/Parser.h: 14855 * kjs/Shell.cpp: 14856 (runWithScripts): 14857 * kjs/nodes.cpp: 14858 (JSC::ScopeNode::ScopeNode): Updated for new sampling APIs. 14859 14860 * wtf/Platform.h: Moved sampling #defines here, since our custom is to 14861 put ENABLE #defines into Platform.h. Made explicit the fact that 14862 CODEBLOCK_SAMPLING depends on OPCODE_SAMPLING. 14863 148642008-10-25 Jan Michael Alonzo <jmalonzo@webkit.org> 14865 14866 JSC Build fix, not reviewed. 14867 14868 * VM/CTI.cpp: add missing include stdio.h for debug builds 14869 148702008-10-24 Eric Seidel <eric@webkit.org> 14871 14872 Reviewed by Darin Adler. 14873 14874 Get rid of a bonus ASSERT when using a null string as a regexp. 14875 Specifically calling: RegularExpression::match() with String::empty() 14876 will hit this ASSERT. 14877 Chromium hits this, but I don't know of any way to make a layout test. 14878 14879 * pcre/pcre_exec.cpp: 14880 (jsRegExpExecute): 14881 148822008-10-24 Alexey Proskuryakov <ap@webkit.org> 14883 14884 Suggested and rubber-stamped by Geoff Garen. 14885 14886 Fix a crash when opening Font Picker. 14887 14888 The change also hopefully fixes this bug, which I could never reproduce: 14889 https://bugs.webkit.org/show_bug.cgi?id=20241 14890 <rdar://problem/6290576> Safari crashes at JSValueUnprotect() when fontpicker view close 14891 14892 * API/JSContextRef.cpp: (JSContextGetGlobalObject): Use lexical global object instead of 14893 dynamic one. 14894 148952008-10-24 Cameron Zwarich <zwarich@apple.com> 14896 14897 Reviewed by Geoff Garen. 14898 14899 Remove ScopeChainNode::bottom() and inline it into its only caller, 14900 ScopeChainnode::globalObject(). 14901 14902 * kjs/JSGlobalObject.h: 14903 (JSC::ScopeChainNode::globalObject): 14904 * kjs/ScopeChain.h: 14905 (JSC::ScopeChain::bottom): 14906 149072008-10-24 Cameron Zwarich <zwarich@apple.com> 14908 14909 Reviewed by Maciej Stachowiak. 14910 14911 Bug 21862: Create JSFunction prototype property lazily 14912 <https://bugs.webkit.org/show_bug.cgi?id=21862> 14913 14914 This is a 1.5% speedup on SunSpider and a 1.4% speedup on the V8 14915 benchmark suite, including a 3.8% speedup on Earley-Boyer. 14916 14917 * kjs/JSFunction.cpp: 14918 (JSC::JSFunction::getOwnPropertySlot): 14919 * kjs/nodes.cpp: 14920 (JSC::FuncDeclNode::makeFunction): 14921 (JSC::FuncExprNode::makeFunction): 14922 149232008-10-24 Greg Bolsinga <bolsinga@apple.com> 14924 14925 Reviewed by Sam Weinig. 14926 14927 https://bugs.webkit.org/show_bug.cgi?id=21475 14928 14929 Provide support for the Geolocation API 14930 14931 http://dev.w3.org/geo/api/spec-source.html 14932 14933 * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0 14934 149352008-10-24 Darin Adler <darin@apple.com> 14936 14937 - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732 14938 14939 * API/APICast.h: 14940 * API/JSCallbackConstructor.h: 14941 * API/JSCallbackFunction.cpp: 14942 * API/JSCallbackFunction.h: 14943 * API/JSCallbackObject.h: 14944 * API/JSCallbackObjectFunctions.h: 14945 * API/JSContextRef.cpp: 14946 * API/JSObjectRef.cpp: 14947 * API/JSValueRef.cpp: 14948 * VM/CTI.cpp: 14949 * VM/CTI.h: 14950 * VM/CodeBlock.cpp: 14951 * VM/CodeBlock.h: 14952 * VM/CodeGenerator.cpp: 14953 * VM/CodeGenerator.h: 14954 * VM/ExceptionHelpers.cpp: 14955 * VM/ExceptionHelpers.h: 14956 * VM/JSPropertyNameIterator.cpp: 14957 * VM/JSPropertyNameIterator.h: 14958 * VM/Machine.cpp: 14959 * VM/Machine.h: 14960 * VM/Register.h: 14961 * kjs/ArgList.cpp: 14962 * kjs/ArgList.h: 14963 * kjs/Arguments.cpp: 14964 * kjs/Arguments.h: 14965 * kjs/ArrayConstructor.cpp: 14966 * kjs/ArrayPrototype.cpp: 14967 * kjs/BooleanConstructor.cpp: 14968 * kjs/BooleanConstructor.h: 14969 * kjs/BooleanObject.h: 14970 * kjs/BooleanPrototype.cpp: 14971 * kjs/CallData.cpp: 14972 * kjs/CallData.h: 14973 * kjs/ConstructData.cpp: 14974 * kjs/ConstructData.h: 14975 * kjs/DateConstructor.cpp: 14976 * kjs/DateInstance.h: 14977 * kjs/DatePrototype.cpp: 14978 * kjs/DatePrototype.h: 14979 * kjs/DebuggerCallFrame.cpp: 14980 * kjs/DebuggerCallFrame.h: 14981 * kjs/ErrorConstructor.cpp: 14982 * kjs/ErrorPrototype.cpp: 14983 * kjs/ExecState.cpp: 14984 * kjs/ExecState.h: 14985 * kjs/FunctionConstructor.cpp: 14986 * kjs/FunctionPrototype.cpp: 14987 * kjs/FunctionPrototype.h: 14988 * kjs/GetterSetter.cpp: 14989 * kjs/GetterSetter.h: 14990 * kjs/InternalFunction.h: 14991 * kjs/JSActivation.cpp: 14992 * kjs/JSActivation.h: 14993 * kjs/JSArray.cpp: 14994 * kjs/JSArray.h: 14995 * kjs/JSCell.cpp: 14996 * kjs/JSCell.h: 14997 * kjs/JSFunction.cpp: 14998 * kjs/JSFunction.h: 14999 * kjs/JSGlobalData.h: 15000 * kjs/JSGlobalObject.cpp: 15001 * kjs/JSGlobalObject.h: 15002 * kjs/JSGlobalObjectFunctions.cpp: 15003 * kjs/JSGlobalObjectFunctions.h: 15004 * kjs/JSImmediate.cpp: 15005 * kjs/JSImmediate.h: 15006 * kjs/JSNotAnObject.cpp: 15007 * kjs/JSNotAnObject.h: 15008 * kjs/JSNumberCell.cpp: 15009 * kjs/JSNumberCell.h: 15010 * kjs/JSObject.cpp: 15011 * kjs/JSObject.h: 15012 * kjs/JSStaticScopeObject.cpp: 15013 * kjs/JSStaticScopeObject.h: 15014 * kjs/JSString.cpp: 15015 * kjs/JSString.h: 15016 * kjs/JSValue.h: 15017 * kjs/JSVariableObject.h: 15018 * kjs/JSWrapperObject.h: 15019 * kjs/MathObject.cpp: 15020 * kjs/MathObject.h: 15021 * kjs/NativeErrorConstructor.cpp: 15022 * kjs/NumberConstructor.cpp: 15023 * kjs/NumberConstructor.h: 15024 * kjs/NumberObject.cpp: 15025 * kjs/NumberObject.h: 15026 * kjs/NumberPrototype.cpp: 15027 * kjs/ObjectConstructor.cpp: 15028 * kjs/ObjectPrototype.cpp: 15029 * kjs/ObjectPrototype.h: 15030 * kjs/PropertyMap.h: 15031 * kjs/PropertySlot.cpp: 15032 * kjs/PropertySlot.h: 15033 * kjs/RegExpConstructor.cpp: 15034 * kjs/RegExpConstructor.h: 15035 * kjs/RegExpMatchesArray.h: 15036 * kjs/RegExpObject.cpp: 15037 * kjs/RegExpObject.h: 15038 * kjs/RegExpPrototype.cpp: 15039 * kjs/Shell.cpp: 15040 * kjs/StringConstructor.cpp: 15041 * kjs/StringObject.cpp: 15042 * kjs/StringObject.h: 15043 * kjs/StringObjectThatMasqueradesAsUndefined.h: 15044 * kjs/StringPrototype.cpp: 15045 * kjs/StructureID.cpp: 15046 * kjs/StructureID.h: 15047 * kjs/collector.cpp: 15048 * kjs/collector.h: 15049 * kjs/completion.h: 15050 * kjs/grammar.y: 15051 * kjs/interpreter.cpp: 15052 * kjs/interpreter.h: 15053 * kjs/lookup.cpp: 15054 * kjs/lookup.h: 15055 * kjs/nodes.h: 15056 * kjs/operations.cpp: 15057 * kjs/operations.h: 15058 * kjs/protect.h: 15059 * profiler/ProfileGenerator.cpp: 15060 * profiler/Profiler.cpp: 15061 * profiler/Profiler.h: 15062 Use JSValue* instead of JSValuePtr. 15063 150642008-10-24 David Kilzer <ddkilzer@apple.com> 15065 15066 Rolled out r37840. 15067 15068 * wtf/Platform.h: 15069 150702008-10-23 Greg Bolsinga <bolsinga@apple.com> 15071 15072 Reviewed by Sam Weinig. 15073 15074 https://bugs.webkit.org/show_bug.cgi?id=21475 15075 15076 Provide support for the Geolocation API 15077 15078 http://dev.w3.org/geo/api/spec-source.html 15079 15080 * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0 15081 150822008-10-23 David Kilzer <ddkilzer@apple.com> 15083 15084 Bug 21832: Fix scripts using 'new File::Temp' for Perl 5.10 15085 15086 <https://bugs.webkit.org/show_bug.cgi?id=21832> 15087 15088 Reviewed by Sam Weinig. 15089 15090 * pcre/dftables: Use imported tempfile() from File::Temp instead of 15091 'new File::Temp' to make the script work with Perl 5.10. 15092 150932008-10-23 Gavin Barraclough <barraclough@apple.com> 15094 15095 Reviewed by Oliver Hunt. 15096 15097 Fix hideous pathological case performance when looking up repatch info, bug #21727. 15098 15099 When repatching JIT code to optimize we look up records providing information about 15100 the generated code (also used to track recsources used in linking to be later released). 15101 The lookup was being performed using a linear scan of all such records. 15102 15103 (1) Split up the different types of reptach information. This means we can search them 15104 separately, and in some cases should reduce their size. 15105 (2) In the case of property accesses, search with a binary chop over the data. 15106 (3) In the case of calls, pass a pointer to the repatch info into the relink function. 15107 15108 * VM/CTI.cpp: 15109 (JSC::CTI::CTI): 15110 (JSC::CTI::compileOpCall): 15111 (JSC::CTI::privateCompileMainPass): 15112 (JSC::CTI::privateCompileSlowCases): 15113 (JSC::CTI::privateCompile): 15114 (JSC::CTI::unlinkCall): 15115 (JSC::CTI::linkCall): 15116 * VM/CTI.h: 15117 * VM/CodeBlock.cpp: 15118 (JSC::CodeBlock::dump): 15119 (JSC::CodeBlock::~CodeBlock): 15120 (JSC::CodeBlock::unlinkCallers): 15121 (JSC::CodeBlock::derefStructureIDs): 15122 * VM/CodeBlock.h: 15123 (JSC::StructureStubInfo::StructureStubInfo): 15124 (JSC::CallLinkInfo::CallLinkInfo): 15125 (JSC::CallLinkInfo::setUnlinked): 15126 (JSC::CallLinkInfo::isLinked): 15127 (JSC::getStructureStubInfoReturnLocation): 15128 (JSC::binaryChop): 15129 (JSC::CodeBlock::addCaller): 15130 (JSC::CodeBlock::getStubInfo): 15131 * VM/CodeGenerator.cpp: 15132 (JSC::CodeGenerator::emitResolve): 15133 (JSC::CodeGenerator::emitGetById): 15134 (JSC::CodeGenerator::emitPutById): 15135 (JSC::CodeGenerator::emitCall): 15136 (JSC::CodeGenerator::emitConstruct): 15137 * VM/Machine.cpp: 15138 (JSC::Machine::cti_vm_lazyLinkCall): 15139 151402008-10-23 Peter Kasting <pkasting@google.com> 15141 15142 Reviewed by Adam Roben. 15143 15144 https://bugs.webkit.org/show_bug.cgi?id=21833 15145 Place JavaScript Debugger hooks under #if ENABLE(JAVASCRIPT_DEBUGGER). 15146 15147 * wtf/Platform.h: 15148 151492008-10-23 David Kilzer <ddkilzer@apple.com> 15150 15151 Bug 21831: Fix create_hash_table for Perl 5.10 15152 15153 <https://bugs.webkit.org/show_bug.cgi?id=21831> 15154 15155 Reviewed by Sam Weinig. 15156 15157 * kjs/create_hash_table: Escaped square brackets so that Perl 5.10 15158 doesn't try to use @nameEntries. 15159 151602008-10-23 Darin Adler <darin@apple.com> 15161 15162 - roll out https://bugs.webkit.org/show_bug.cgi?id=21732 15163 to remove the JSValuePtr class, to fix two problems 15164 15165 1) slowness under MSVC, since it doesn't handle a 15166 class with a single pointer in it as efficiently 15167 as a pointer 15168 15169 2) uninitialized pointers in Vector 15170 15171 * JavaScriptCore.exp: Updated. 15172 15173 * API/APICast.h: 15174 (toRef): 15175 * VM/CTI.cpp: 15176 (JSC::CTI::asInteger): 15177 * VM/CodeGenerator.cpp: 15178 (JSC::CodeGenerator::addConstant): 15179 * VM/CodeGenerator.h: 15180 (JSC::CodeGenerator::JSValueHashTraits::constructDeletedValue): 15181 (JSC::CodeGenerator::JSValueHashTraits::isDeletedValue): 15182 * VM/Machine.cpp: 15183 (JSC::Machine::cti_op_add): 15184 (JSC::Machine::cti_op_pre_inc): 15185 (JSC::Machine::cti_op_get_by_id): 15186 (JSC::Machine::cti_op_get_by_id_second): 15187 (JSC::Machine::cti_op_get_by_id_generic): 15188 (JSC::Machine::cti_op_get_by_id_fail): 15189 (JSC::Machine::cti_op_instanceof): 15190 (JSC::Machine::cti_op_del_by_id): 15191 (JSC::Machine::cti_op_mul): 15192 (JSC::Machine::cti_op_call_NotJSFunction): 15193 (JSC::Machine::cti_op_resolve): 15194 (JSC::Machine::cti_op_construct_NotJSConstruct): 15195 (JSC::Machine::cti_op_get_by_val): 15196 (JSC::Machine::cti_op_sub): 15197 (JSC::Machine::cti_op_lesseq): 15198 (JSC::Machine::cti_op_negate): 15199 (JSC::Machine::cti_op_resolve_base): 15200 (JSC::Machine::cti_op_resolve_skip): 15201 (JSC::Machine::cti_op_resolve_global): 15202 (JSC::Machine::cti_op_div): 15203 (JSC::Machine::cti_op_pre_dec): 15204 (JSC::Machine::cti_op_not): 15205 (JSC::Machine::cti_op_eq): 15206 (JSC::Machine::cti_op_lshift): 15207 (JSC::Machine::cti_op_bitand): 15208 (JSC::Machine::cti_op_rshift): 15209 (JSC::Machine::cti_op_bitnot): 15210 (JSC::Machine::cti_op_mod): 15211 (JSC::Machine::cti_op_less): 15212 (JSC::Machine::cti_op_neq): 15213 (JSC::Machine::cti_op_urshift): 15214 (JSC::Machine::cti_op_bitxor): 15215 (JSC::Machine::cti_op_bitor): 15216 (JSC::Machine::cti_op_call_eval): 15217 (JSC::Machine::cti_op_throw): 15218 (JSC::Machine::cti_op_next_pname): 15219 (JSC::Machine::cti_op_typeof): 15220 (JSC::Machine::cti_op_is_undefined): 15221 (JSC::Machine::cti_op_is_boolean): 15222 (JSC::Machine::cti_op_is_number): 15223 (JSC::Machine::cti_op_is_string): 15224 (JSC::Machine::cti_op_is_object): 15225 (JSC::Machine::cti_op_is_function): 15226 (JSC::Machine::cti_op_stricteq): 15227 (JSC::Machine::cti_op_nstricteq): 15228 (JSC::Machine::cti_op_to_jsnumber): 15229 (JSC::Machine::cti_op_in): 15230 (JSC::Machine::cti_op_del_by_val): 15231 (JSC::Machine::cti_vm_throw): 15232 Removed calls to payload functions. 15233 15234 * VM/Register.h: 15235 (JSC::Register::Register): Removed overload for JSCell and call 15236 to payload function. 15237 15238 * kjs/JSCell.h: Changed JSCell to derive from JSValue again. 15239 Removed JSValuePtr constructor. 15240 (JSC::asCell): Changed cast from reinterpret_cast to static_cast. 15241 15242 * kjs/JSImmediate.h: Removed JSValuePtr class. Added typedef back. 15243 15244 * kjs/JSValue.h: 15245 (JSC::JSValue::JSValue): Added empty protected inline constructor back. 15246 (JSC::JSValue::~JSValue): Same for destructor. 15247 Removed == and != operator for JSValuePtr. 15248 15249 * kjs/PropertySlot.h: 15250 (JSC::PropertySlot::PropertySlot): Chnaged argument to const JSValue* 15251 and added a const_cast. 15252 15253 * kjs/protect.h: Removed overloads and specialization for JSValuePtr. 15254 152552008-10-22 Oliver Hunt <oliver@apple.com> 15256 15257 Reviewed by Maciej Stachowiak. 15258 15259 Really "fix" CTI mode on windows 2k3. 15260 15261 This adds new methods fastMallocExecutable and fastFreeExecutable 15262 to wrap allocation for cti code. This still just makes fastMalloc 15263 return executable memory all the time, which will be fixed in a 15264 later patch. 15265 15266 However in windows debug builds all executable allocations will be 15267 allocated on separate executable pages, which should resolve any 15268 remaining 2k3 issues. Conveniently the 2k3 bot will now also fail 15269 if there are any fastFree vs. fastFreeExecutable errors. 15270 15271 * ChangeLog: 15272 * VM/CodeBlock.cpp: 15273 (JSC::CodeBlock::~CodeBlock): 15274 * kjs/regexp.cpp: 15275 (JSC::RegExp::~RegExp): 15276 * masm/X86Assembler.h: 15277 (JSC::JITCodeBuffer::copy): 15278 * wtf/FastMalloc.cpp: 15279 (WTF::fastMallocExecutable): 15280 (WTF::fastFreeExecutable): 15281 (WTF::TCMallocStats::fastMallocExecutable): 15282 (WTF::TCMallocStats::fastFreeExecutable): 15283 * wtf/FastMalloc.h: 15284 152852008-10-22 Darin Adler <darin@apple.com> 15286 15287 Reviewed by Sam Weinig. 15288 15289 - fix https://bugs.webkit.org/show_bug.cgi?id=21294 15290 Bug 21294: Devirtualize getOwnPropertySlot() 15291 15292 A bit over 3% faster on V8 tests. 15293 15294 * JavascriptCore.exp: Export leak-related functions.. 15295 15296 * API/JSCallbackConstructor.h: 15297 (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot 15298 since this class doesn't override getPropertySlot. 15299 * API/JSCallbackFunction.h: 15300 (JSC::JSCallbackFunction::createStructureID): Ditto. 15301 15302 * VM/ExceptionHelpers.cpp: 15303 (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure 15304 that's created just for this class instead of trying to share a single "null 15305 prototype" structure. 15306 15307 * VM/Machine.cpp: 15308 (JSC::Machine::cti_op_create_arguments_no_params): Rename 15309 Arguments::ArgumentsNoParameters to Arguments::NoParameters. 15310 15311 * kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to 15312 Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters 15313 to Arguments::NoParameters. 15314 (JSC::Arguments::createStructureID): Added. Returns a structure without 15315 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. 15316 (JSC::Arguments::Arguments): Added an assertion that there are no parameters. 15317 15318 * kjs/DatePrototype.h: 15319 (JSC::DatePrototype::createStructureID): Added. Returns a structure without 15320 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. 15321 15322 * kjs/FunctionPrototype.h: 15323 (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot 15324 since this class doesn't override getPropertySlot. 15325 * kjs/InternalFunction.h: 15326 (JSC::InternalFunction::createStructureID): Ditto. 15327 15328 * kjs/JSArray.h: 15329 (JSC::JSArray::createStructureID): Added. Returns a structure without 15330 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. 15331 15332 * kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual 15333 version that uses the structure bit to decide whether to call the virtual 15334 version. 15335 15336 * kjs/JSFunction.h: 15337 (JSC::JSFunction::createStructureID): Added. Returns a structure without 15338 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. 15339 15340 * kjs/JSGlobalData.cpp: 15341 (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed 15342 nullProtoStructureID. 15343 * kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID. 15344 15345 * kjs/JSGlobalObject.h: 15346 (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without 15347 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. 15348 15349 * kjs/JSNotAnObject.h: 15350 (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure 15351 that's created just for this class instead of trying to share a single "null 15352 prototype" structure. 15353 (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function 15354 virtual for clarity and made it private since no one should call it if they 15355 already have a pointer to this specific type. 15356 (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just 15357 for this class instead of trying to share a single "null prototype" structure. 15358 (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without 15359 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. 15360 15361 * kjs/JSObject.h: 15362 (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot. 15363 (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code 15364 between getOwnPropertySlot and fastGetOwnPropertySlot. 15365 (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the 15366 functions that call them. Moved the guts of this function into 15367 inlineGetOwnPropertySlot. 15368 (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the 15369 HasStandardGetOwnPropertySlot bit and if it's set, calls 15370 inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot. 15371 (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot. 15372 (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot. 15373 15374 * kjs/JSWrapperObject.h: Made constructor protected to emphasize that 15375 this class is only a base class and never instantiated. 15376 15377 * kjs/MathObject.h: 15378 (JSC::MathObject::createStructureID): Added. Returns a structure without 15379 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. 15380 * kjs/NumberConstructor.h: 15381 (JSC::NumberConstructor::createStructureID): Ditto. 15382 * kjs/RegExpConstructor.h: 15383 (JSC::RegExpConstructor::createStructureID): Ditto. 15384 * kjs/RegExpObject.h: 15385 (JSC::RegExpObject::createStructureID): Ditto. 15386 * kjs/StringObject.h: 15387 (JSC::StringObject::createStructureID): Ditto. 15388 15389 * kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and 15390 hasStandardGetOwnPropertySlot accessor function. 15391 153922008-10-22 Cameron Zwarich <zwarich@apple.com> 15393 15394 Reviewed by Geoff Garen. 15395 15396 Bug 21803: Fuse op_jfalse with op_eq_null and op_neq_null 15397 <https://bugs.webkit.org/show_bug.cgi?id=21803> 15398 15399 Fuse op_jfalse with op_eq_null and op_neq_null to make the new opcodes 15400 op_jeq_null and op_jneq_null. 15401 15402 This is a 2.6% speedup on the V8 Raytrace benchmark, and strangely also 15403 a 4.7% speedup on the V8 Arguments benchmark, even though it uses 15404 neither of the two new opcodes. 15405 15406 * VM/CTI.cpp: 15407 (JSC::CTI::privateCompileMainPass): 15408 * VM/CodeBlock.cpp: 15409 (JSC::CodeBlock::dump): 15410 * VM/CodeGenerator.cpp: 15411 (JSC::CodeGenerator::emitJumpIfTrue): 15412 (JSC::CodeGenerator::emitJumpIfFalse): 15413 * VM/Machine.cpp: 15414 (JSC::Machine::privateExecute): 15415 * VM/Opcode.h: 15416 154172008-10-22 Darin Fisher <darin@chromium.org> 15418 15419 Reviewed by Eric Seidel. 15420 15421 Should not define PLATFORM(WIN,MAC,GTK) when PLATFORM(CHROMIUM) is defined 15422 https://bugs.webkit.org/show_bug.cgi?id=21757 15423 15424 PLATFORM(CHROMIUM) implies HAVE_ACCESSIBILITY 15425 15426 * wtf/Platform.h: 15427 154282008-10-22 Cameron Zwarich <zwarich@apple.com> 15429 15430 Reviewed by Alexey Proskuryakov. 15431 15432 Correct opcode names in documentation. 15433 15434 * VM/Machine.cpp: 15435 (JSC::Machine::privateExecute): 15436 154372008-10-21 Oliver Hunt <oliver@apple.com> 15438 15439 RS=Maciej Stachowiak. 15440 15441 Force FastMalloc to make all allocated pages executable in 15442 a vague hope this will allow the Win2k3 bot to be able to 15443 run tests. 15444 15445 Filed Bug 21783: Need more granular control over allocation of executable memory 15446 to cover a more granular version of this patch. 15447 15448 * wtf/TCSystemAlloc.cpp: 15449 (TryVirtualAlloc): 15450 154512008-10-21 Alexey Proskuryakov <ap@webkit.org> 15452 15453 Reviewed by Darin Adler. 15454 15455 https://bugs.webkit.org/show_bug.cgi?id=21769 15456 MessagePort should be GC protected if there are messages to be delivered 15457 15458 * wtf/MessageQueue.h: 15459 (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue 15460 state, thus likely to cause race conditions. 15461 154622008-10-21 Darin Adler <darin@apple.com> 15463 15464 Reviewed by Maciej Stachowiak. 15465 15466 - convert post-increment to pre-increment in a couple more places for speed 15467 15468 Speeds up V8 benchmarks a little on most computers. (But, strangely, slows 15469 them down a little on my computer.) 15470 15471 * kjs/nodes.cpp: 15472 (JSC::statementListEmitCode): Removed default argument, since we always want 15473 to specify this explicitly. 15474 (JSC::ForNode::emitCode): Tolerate ignoredResult() as the dst -- means the 15475 same thing as 0. 15476 (JSC::ReturnNode::emitCode): Ditto. 15477 (JSC::ThrowNode::emitCode): Ditto. 15478 (JSC::FunctionBodyNode::emitCode): Pass ignoredResult() so that we know we 15479 don't have to compute the result of function statements. 15480 154812008-10-21 Peter Kasting <pkasting@google.com> 15482 15483 Reviewed by Maciej Stachowiak. 15484 15485 Fix an include of a non-public header to use "" instead of <>. 15486 15487 * API/JSProfilerPrivate.cpp: 15488 154892008-10-20 Sam Weinig <sam@webkit.org> 15490 15491 Reviewed by Cameron Zwarich. 15492 15493 Fix for https://bugs.webkit.org/show_bug.cgi?id=21766 15494 REGRESSION: 12 JSC tests fail 15495 15496 The JSGlobalObject was mutating the shared nullProtoStructureID when 15497 used in jsc. Instead of using nullProtoStructureID, use a new StructureID. 15498 15499 * API/JSCallbackObject.h: 15500 * API/JSCallbackObjectFunctions.h: 15501 (JSC::::JSCallbackObject): 15502 * API/JSContextRef.cpp: 15503 (JSGlobalContextCreateInGroup): 15504 * kjs/JSGlobalObject.h: 15505 (JSC::JSGlobalObject::JSGlobalObject): 15506 * kjs/Shell.cpp: 15507 (GlobalObject::GlobalObject): 15508 (jscmain): 15509 155102008-10-20 Cameron Zwarich <zwarich@apple.com> 15511 15512 Reviewed by Maciej Stachowiak. 15513 15514 Remove an untaken branch in CodeGenerator::emitJumpIfFalse(). This 15515 function is never called with a backwards target LabelID, and there is 15516 even an assertion to this effect at the top of the function body. 15517 15518 * VM/CodeGenerator.cpp: 15519 (JSC::CodeGenerator::emitJumpIfFalse): 15520 155212008-10-20 Cameron Zwarich <zwarich@apple.com> 15522 15523 Rubber-stamped by Sam Weinig. 15524 15525 Add opcode documentation for undocumented opcodes. 15526 15527 * VM/Machine.cpp: 15528 (JSC::Machine::privateExecute): 15529 155302008-10-16 Sam Weinig <sam@webkit.org> 15531 15532 Reviewed by Cameron Zwarich. 15533 15534 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683 15535 Don't create intermediate StructureIDs for builtin objects 15536 15537 Second stage in reduce number of StructureIDs created when initializing the 15538 JSGlobalObject. 15539 15540 - Use putDirectWithoutTransition for the remaining singleton objects to reduce 15541 the number of StructureIDs create for about:blank from 132 to 73. 15542 15543 * kjs/ArrayConstructor.cpp: 15544 (JSC::ArrayConstructor::ArrayConstructor): 15545 * kjs/BooleanConstructor.cpp: 15546 (JSC::BooleanConstructor::BooleanConstructor): 15547 * kjs/BooleanPrototype.cpp: 15548 (JSC::BooleanPrototype::BooleanPrototype): 15549 * kjs/DateConstructor.cpp: 15550 (JSC::DateConstructor::DateConstructor): 15551 * kjs/ErrorConstructor.cpp: 15552 (JSC::ErrorConstructor::ErrorConstructor): 15553 * kjs/ErrorPrototype.cpp: 15554 (JSC::ErrorPrototype::ErrorPrototype): 15555 * kjs/FunctionConstructor.cpp: 15556 (JSC::FunctionConstructor::FunctionConstructor): 15557 * kjs/FunctionPrototype.cpp: 15558 (JSC::FunctionPrototype::FunctionPrototype): 15559 (JSC::FunctionPrototype::addFunctionProperties): 15560 * kjs/FunctionPrototype.h: 15561 (JSC::FunctionPrototype::createStructureID): 15562 * kjs/InternalFunction.cpp: 15563 * kjs/InternalFunction.h: 15564 (JSC::InternalFunction::InternalFunction): 15565 * kjs/JSGlobalObject.cpp: 15566 (JSC::JSGlobalObject::reset): 15567 * kjs/JSObject.h: 15568 * kjs/MathObject.cpp: 15569 (JSC::MathObject::MathObject): 15570 * kjs/NumberConstructor.cpp: 15571 (JSC::NumberConstructor::NumberConstructor): 15572 * kjs/NumberPrototype.cpp: 15573 (JSC::NumberPrototype::NumberPrototype): 15574 * kjs/ObjectConstructor.cpp: 15575 (JSC::ObjectConstructor::ObjectConstructor): 15576 * kjs/RegExpConstructor.cpp: 15577 (JSC::RegExpConstructor::RegExpConstructor): 15578 * kjs/RegExpPrototype.cpp: 15579 (JSC::RegExpPrototype::RegExpPrototype): 15580 * kjs/StringConstructor.cpp: 15581 (JSC::StringConstructor::StringConstructor): 15582 * kjs/StringPrototype.cpp: 15583 (JSC::StringPrototype::StringPrototype): 15584 * kjs/StructureID.cpp: 15585 (JSC::StructureID::dumpStatistics): 15586 * kjs/StructureID.h: 15587 (JSC::StructureID::setPrototypeWithoutTransition): 15588 155892008-10-20 Alp Toker <alp@nuanti.com> 15590 15591 Fix autotools dist build target by listing recently added header 15592 files only. Not reviewed. 15593 15594 * GNUmakefile.am: 15595 155962008-10-20 Geoffrey Garen <ggaren@apple.com> 15597 15598 Reviewed by Anders Carlsson. 15599 15600 * VM/Machine.cpp: 15601 (JSC::Machine::tryCacheGetByID): Removed a redundant and sometimes 15602 incorrect cast, which started ASSERTing after Darin's last checkin. 15603 156042008-10-20 Geoffrey Garen <ggaren@apple.com> 15605 15606 Not reviewed. 15607 15608 Re-enable CTI, which I accidentally disabled while checking in fixes 15609 to bytecode. 15610 15611 * wtf/Platform.h: 15612 156132008-10-20 Alp Toker <alp@nuanti.com> 15614 15615 Rubber-stamped by Mark Rowe. 15616 15617 Typo fix in function name: mimimum -> minimum. 15618 15619 * kjs/DateMath.cpp: 15620 (JSC::minimumYearForDST): 15621 (JSC::equivalentYearForDST): 15622 156232008-10-20 Alp Toker <alp@nuanti.com> 15624 15625 Reviewed by Mark Rowe. 15626 15627 Use pthread instead of GThread where possible in the GTK+ port. This 15628 fixes issues with global initialisation, particularly on GTK+/Win32 15629 where a late g_thread_init() will cause hangs. 15630 15631 * GNUmakefile.am: 15632 * wtf/Platform.h: 15633 * wtf/Threading.h: 15634 * wtf/ThreadingGtk.cpp: 15635 * wtf/ThreadingPthreads.cpp: 15636 156372008-10-20 Geoffrey Garen <ggaren@apple.com> 15638 15639 Reviewed by Darin Adler. 15640 15641 Fixed https://bugs.webkit.org/show_bug.cgi?id=21735 15642 Emit profiling instrumentation only if the Web Inspector's profiling 15643 feature is enabled 15644 15645 22.2% speedup on empty function call benchmark. 15646 2.9% speedup on v8 benchmark. 15647 0.7% speedup on SunSpider. 15648 15649 Lesser but similar speedups in bytecode. 15650 15651 * VM/CTI.cpp: 15652 (JSC::CTI::compileOpCall): 15653 (JSC::CTI::privateCompileMainPass): 15654 (JSC::CTI::privateCompileSlowCases): Nixed JITed profiler hooks. Profiler 15655 hooks now have their own opcodes. Added support for compiling profiler 15656 hook opcodes. 15657 15658 (JSC::CodeBlock::dump): Dump support for the new profiling opcodes. 15659 15660 * VM/CodeGenerator.h: 15661 * VM/CodeGenerator.cpp: 15662 (JSC::CodeGenerator::CodeGenerator): 15663 (JSC::CodeGenerator::emitCall): 15664 (JSC::CodeGenerator::emitConstruct): Conditionally emit profiling hooks 15665 around call and construct, at the call site. (It's easier to get things 15666 right this way, if you have profiled code calling non-profiled code. 15667 Also, you get a slightly more accurate profile, since you charge the full 15668 cost of the call / construct operation to the callee.) 15669 15670 Also, fixed a bug where construct would fetch the ".prototype" property 15671 from the constructor before evaluating the arguments to the constructor, 15672 incorrectly allowing an "invalid constructor" exception to short-circuit 15673 argument evaluation. I encountered this bug when trying to make 15674 constructor exceptions work with profiling. 15675 15676 * VM/Machine.cpp: 15677 (JSC::Machine::callEval): Removed obsolete profiler hooks. 15678 15679 (JSC::Machine::throwException): Added a check for an exception thrown 15680 within a call instruction. We didn't need this before because the call 15681 instruction would check for a valid call before involing the profiler. 15682 (JSC::Machine::execute): Added a didExecute hook at the end of top-level 15683 function invocation, since op_ret no longer does this for us. 15684 15685 (JSC::Machine::privateExecute): Removed obsolete profiler hooks. Added 15686 profiler opcodes. Changed some ++vPC to vPC[x] notation, since the 15687 latter is better for performance, and it makes reasoning about the 15688 current opcode in exception handling much simpler. 15689 15690 (JSC::Machine::cti_op_call_NotJSFunction): Removed obsolete profiler 15691 hooks. 15692 15693 (JSC::Machine::cti_op_create_arguments_no_params): Added missing 15694 CTI_STACK_HACK that I noticed when adding CTI_STACK_HACK to the new 15695 profiler opcode functions. 15696 15697 (JSC::Machine::cti_op_profile_will_call): 15698 (JSC::Machine::cti_op_profile_did_call): The new profiler opcode 15699 functions. 15700 15701 (JSC::Machine::cti_op_construct_NotJSConstruct): Removed obsolete profiler 15702 hooks. 15703 15704 * VM/Machine.h: 15705 (JSC::Machine::isCallOpcode): Helper for exception handling. 15706 15707 * VM/Opcode.h: Declare new opcodes. 15708 15709 * kjs/JSGlobalObject.h: 15710 (JSC::JSGlobalObject::supportsProfiling): Added virtual interface that 15711 allows WebCore to specify whether the target global object has the Web 15712 Inspector's profiling feature enabled. 15713 15714 * profiler/Profiler.cpp: 15715 (JSC::Profiler::willExecute): 15716 (JSC::Profiler::didExecute): 15717 (JSC::Profiler::createCallIdentifier): 15718 * profiler/Profiler.h: Added support for invoking the profiler with 15719 an arbitrary JSValue*, and not a known object. We didn't need this 15720 before because the call instruction would check for a valid call before 15721 involing the profiler. 15722 157232008-10-20 Darin Adler <darin@apple.com> 15724 15725 Reviewed by Geoff Garen. 15726 15727 - get CTI working on Windows again 15728 15729 * VM/CTI.cpp: 15730 (JSC::CTI::emitCTICall): Add an overload for functions that 15731 return JSObject*. 15732 * VM/CTI.h: Use JSValue* and JSObject* as return types for 15733 cti_op functions. Apparently, MSVC doesn't handle returning 15734 the JSValuePtr struct in a register. We'll have to look into 15735 this more. 15736 15737 * VM/Machine.cpp: 15738 (JSC::Machine::cti_op_convert_this): 15739 (JSC::Machine::cti_op_add): 15740 (JSC::Machine::cti_op_pre_inc): 15741 (JSC::Machine::cti_op_new_object): 15742 (JSC::Machine::cti_op_get_by_id): 15743 (JSC::Machine::cti_op_get_by_id_second): 15744 (JSC::Machine::cti_op_get_by_id_generic): 15745 (JSC::Machine::cti_op_get_by_id_fail): 15746 (JSC::Machine::cti_op_instanceof): 15747 (JSC::Machine::cti_op_del_by_id): 15748 (JSC::Machine::cti_op_mul): 15749 (JSC::Machine::cti_op_new_func): 15750 (JSC::Machine::cti_op_push_activation): 15751 (JSC::Machine::cti_op_call_NotJSFunction): 15752 (JSC::Machine::cti_op_new_array): 15753 (JSC::Machine::cti_op_resolve): 15754 (JSC::Machine::cti_op_construct_JSConstructFast): 15755 (JSC::Machine::cti_op_construct_NotJSConstruct): 15756 (JSC::Machine::cti_op_get_by_val): 15757 (JSC::Machine::cti_op_sub): 15758 (JSC::Machine::cti_op_lesseq): 15759 (JSC::Machine::cti_op_negate): 15760 (JSC::Machine::cti_op_resolve_base): 15761 (JSC::Machine::cti_op_resolve_skip): 15762 (JSC::Machine::cti_op_resolve_global): 15763 (JSC::Machine::cti_op_div): 15764 (JSC::Machine::cti_op_pre_dec): 15765 (JSC::Machine::cti_op_not): 15766 (JSC::Machine::cti_op_eq): 15767 (JSC::Machine::cti_op_lshift): 15768 (JSC::Machine::cti_op_bitand): 15769 (JSC::Machine::cti_op_rshift): 15770 (JSC::Machine::cti_op_bitnot): 15771 (JSC::Machine::cti_op_new_func_exp): 15772 (JSC::Machine::cti_op_mod): 15773 (JSC::Machine::cti_op_less): 15774 (JSC::Machine::cti_op_neq): 15775 (JSC::Machine::cti_op_urshift): 15776 (JSC::Machine::cti_op_bitxor): 15777 (JSC::Machine::cti_op_new_regexp): 15778 (JSC::Machine::cti_op_bitor): 15779 (JSC::Machine::cti_op_call_eval): 15780 (JSC::Machine::cti_op_throw): 15781 (JSC::Machine::cti_op_next_pname): 15782 (JSC::Machine::cti_op_typeof): 15783 (JSC::Machine::cti_op_is_undefined): 15784 (JSC::Machine::cti_op_is_boolean): 15785 (JSC::Machine::cti_op_is_number): 15786 (JSC::Machine::cti_op_is_string): 15787 (JSC::Machine::cti_op_is_object): 15788 (JSC::Machine::cti_op_is_function): 15789 (JSC::Machine::cti_op_stricteq): 15790 (JSC::Machine::cti_op_nstricteq): 15791 (JSC::Machine::cti_op_to_jsnumber): 15792 (JSC::Machine::cti_op_in): 15793 (JSC::Machine::cti_op_push_new_scope): 15794 (JSC::Machine::cti_op_del_by_val): 15795 (JSC::Machine::cti_op_new_error): 15796 (JSC::Machine::cti_vm_throw): 15797 Change these functions to return pointer types, and never 15798 JSValuePtr. 15799 * VM/Machine.h: Ditto. 15800 158012008-10-20 Geoffrey Garen <ggaren@apple.com> 15802 15803 Reviewed by Darin Adler. 15804 15805 Fixed some recent break-age in bytecode mode. 15806 15807 * VM/CodeBlock.cpp: 15808 (JSC::CodeBlock::printStructureIDs): Fixed up an ASSERT caused by 15809 Gavin's last checkin. This is a temporary fix so I can keep on moving. 15810 I'll send email about what I think is an underlying problem soon. 15811 15812 * VM/Machine.cpp: 15813 (JSC::Machine::privateExecute): Removed a redundant and sometimes 15814 incorrect cast, which started ASSERTing after Darin's last checkin. 15815 158162008-10-20 Darin Adler <darin@apple.com> 15817 15818 - another similar Windows build fix 15819 15820 * VM/CTI.cpp: Changed return type to JSObject* instead of JSValuePtr. 15821 158222008-10-20 Darin Adler <darin@apple.com> 15823 15824 - try to fix Windows build 15825 15826 * VM/CTI.cpp: Use JSValue* instead of JSValuePtr for ctiTrampoline. 15827 * VM/CTI.h: Ditto. 15828 158292008-10-19 Darin Adler <darin@apple.com> 15830 15831 Reviewed by Cameron Zwarich. 15832 15833 - finish https://bugs.webkit.org/show_bug.cgi?id=21732 15834 improve performance by eliminating JSValue as a base class for JSCell 15835 15836 * VM/Machine.cpp: 15837 (JSC::Machine::cti_op_call_profiler): Use asFunction. 15838 (JSC::Machine::cti_vm_lazyLinkCall): Ditto. 15839 (JSC::Machine::cti_op_construct_JSConstructFast): Use asObject. 15840 15841 * kjs/JSCell.h: Re-sort friend classes. Eliminate inheritance from 15842 JSValue. Changed cast in asCell from static_cast to reinterpret_cast. 15843 Removed JSValue::getNumber(double&) and one of JSValue::getObject 15844 overloads. 15845 15846 * kjs/JSValue.h: Made the private constructor and destructor both 15847 non-virtual and also remove the definitions. This class can never 15848 be instantiated or derived. 15849 158502008-10-19 Darin Adler <darin@apple.com> 15851 15852 Reviewed by Cameron Zwarich. 15853 15854 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732 15855 improve performance by eliminating JSValue as a base class for JSCell 15856 15857 Change JSValuePtr from a typedef into a class. This allows us to support 15858 conversion from JSCell* to JSValuePtr even if JSCell isn't derived from 15859 JSValue. 15860 15861 * JavaScriptCore.exp: Updated symbols that involve JSValuePtr, since 15862 it's now a distinct type. 15863 15864 * API/APICast.h: 15865 (toRef): Extract the JSValuePtr payload explicitly since we can't just 15866 cast any more. 15867 * VM/CTI.cpp: 15868 (JSC::CTI::asInteger): Ditto. 15869 15870 * VM/CodeGenerator.cpp: 15871 (JSC::CodeGenerator::addConstant): Get at the payload directly. 15872 (JSC::CodeGenerator::emitLoad): Added an overload of JSCell* because 15873 otherwise classes derived from JSValue end up calling the bool 15874 overload instead of JSValuePtr. 15875 * VM/CodeGenerator.h: Ditto. Also update traits to use JSValue* 15876 and the payload functions. 15877 15878 * VM/Register.h: Added a JSCell* overload and use of payload functions. 15879 15880 * kjs/JSCell.h: 15881 (JSC::asCell): Use payload function. 15882 (JSC::JSValue::asCell): Use JSValue* instead of JSValuePtr. 15883 (JSC::JSValuePtr::JSValuePtr): Added. Constructor that takes JSCell* 15884 and creates a JSValuePtr. 15885 15886 * kjs/JSImmediate.h: Added JSValuePtr class. Also updated makeValue 15887 and makeInt to work with JSValue* and the payload function. 15888 15889 * kjs/JSValue.h: Added == and != operators for JSValuePtr. Put them 15890 here because eventually all the JSValue functions should go here 15891 except what's needed by JSImmediate. Also fix asValue to use 15892 JSValue* instead of JSValuePtr. 15893 15894 * kjs/PropertySlot.h: Change constructor to take JSValuePtr. 15895 15896 * kjs/protect.h: Update gcProtect functions to work with JSCell* 15897 as well as JSValuePtr. Also updated the ProtectedPtr<JSValuePtr> 15898 specialization to work more directly. Also changed all the call 15899 sites to use gcProtectNullTolerant. 15900 159012008-10-19 Darin Adler <darin@apple.com> 15902 15903 Reviewed by Oliver Hunt. 15904 15905 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732 15906 improve performance by eliminating JSValue as a base class for JSCell 15907 15908 Remove most uses of JSValue, which will be removed in a future patch. 15909 15910 * VM/Machine.cpp: 15911 (JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member 15912 of JSValue. 15913 * kjs/JSNumberCell.h: 15914 (JSC::JSNumberCell::toInt32): Ditto. 15915 (JSC::JSNumberCell::toUInt32): Ditto. 15916 15917 * kjs/JSValue.cpp: 15918 (JSC::toInt32SlowCase): Made a non-member function. 15919 (JSC::JSValue::toInt32SlowCase): Changed to call non-member function. 15920 (JSC::toUInt32SlowCase): More of the same. 15921 (JSC::JSValue::toUInt32SlowCase): Ditto. 15922 15923 * kjs/JSValue.h: Moved static member function so they are no longer 15924 member functions at all. 15925 15926 * VM/CTI.h: Removed forward declaration of JSValue. 15927 * VM/ExceptionHelpers.h: Ditto. 15928 * kjs/CallData.h: Ditto. 15929 * kjs/ConstructData.h: Ditto. 15930 * kjs/JSGlobalObjectFunctions.h: Ditto. 15931 * kjs/PropertyMap.h: Ditto. 15932 * kjs/StructureID.h: Ditto. 15933 * kjs/collector.h: Ditto. 15934 * kjs/completion.h: Ditto. 15935 15936 * kjs/grammar.y: 15937 (JSC::makeBitwiseNotNode): Call new non-member toInt32 function. 15938 (JSC::makeLeftShiftNode): More of the same. 15939 (JSC::makeRightShiftNode): Ditto. 15940 15941 * kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr> 15942 so this can be used with JSValuePtr. 15943 159442008-10-18 Darin Adler <darin@apple.com> 15945 15946 Reviewed by Oliver Hunt. 15947 15948 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732 15949 improve performance by eliminating JSValue as a base class for JSCell 15950 15951 Tweak a little more to get closer to where we can make JSValuePtr a class. 15952 15953 * API/APICast.h: 15954 (toJS): Change back to JSValue* here, since we're converting the 15955 pointer type. 15956 * VM/CTI.cpp: 15957 (JSC::CTI::unlinkCall): Call asPointer. 15958 * VM/CTI.h: Cast to JSValue* here, since it's a pointer cast. 15959 * kjs/DebuggerCallFrame.h: 15960 (JSC::DebuggerCallFrame::DebuggerCallFrame): Call noValue. 15961 * kjs/JSGlobalData.cpp: 15962 (JSC::JSGlobalData::JSGlobalData): Call noValue. 15963 * kjs/JSImmediate.cpp: 15964 (JSC::JSImmediate::toObject): Remove unneeded const_cast. 15965 * kjs/JSWrapperObject.h: 15966 (JSC::JSWrapperObject::JSWrapperObject): Call noValue. 15967 159682008-10-18 Darin Adler <darin@apple.com> 15969 15970 - fix non-all-in-one build 15971 15972 * kjs/completion.h: 15973 (JSC::Completion::Completion): Add include of JSValue.h. 15974 159752008-10-18 Darin Adler <darin@apple.com> 15976 15977 Reviewed by Oliver Hunt. 15978 15979 - fix assertions I introduced with my casting changes 15980 15981 These were showing up as failures in the JavaScriptCore tests. 15982 15983 * VM/Machine.cpp: 15984 (JSC::Machine::cti_op_instanceof): Remove the bogus asCell casting that 15985 was at the top of the function, and instead cast at the point of use. 15986 (JSC::Machine::cti_op_construct_NotJSConstruct): Moved the cast to 15987 object after checking the construct type. 15988 159892008-10-18 Darin Adler <darin@apple.com> 15990 15991 - fix non-all-in-one build 15992 15993 * kjs/JSGlobalObjectFunctions.h: Add include of JSImmedate.h (for now). 15994 159952008-10-18 Darin Adler <darin@apple.com> 15996 15997 - fix build 15998 15999 * kjs/interpreter.h: Include JSValue.h instead of JSImmediate.h. 16000 160012008-10-18 Darin Adler <darin@apple.com> 16002 16003 * kjs/interpreter.h: Fix include of JSImmediate.h. 16004 160052008-10-18 Darin Adler <darin@apple.com> 16006 16007 - fix non-all-in-one build 16008 16009 * kjs/interpreter.h: Add include of JSImmediate.h. 16010 160112008-10-18 Darin Adler <darin@apple.com> 16012 16013 - fix non-all-in-one build 16014 16015 * kjs/ConstructData.h: Add include of JSImmedate.h (for now). 16016 160172008-10-18 Darin Adler <darin@apple.com> 16018 16019 - try to fix Windows build 16020 16021 * VM/Machine.cpp: 16022 (JSC::Machine::Machine): Use JSCell* type since MSVC seems to only allow 16023 calling ~JSCell directly if it's a JSCell*. 16024 160252008-10-18 Darin Adler <darin@apple.com> 16026 16027 Reviewed by Cameron Zwarich. 16028 16029 - next step on https://bugs.webkit.org/show_bug.cgi?id=21732 16030 improve performance by eliminating JSValue as a base class for JSCell 16031 16032 Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be 16033 changing JSValuePtr to be a class, and then eventually renaming it 16034 to JSValue once that's done. 16035 16036 * JavaScriptCore.exp: Update entry points, since some now take JSValue* 16037 instead of const JSValue*. 16038 16039 * API/APICast.h: 16040 * API/JSCallbackConstructor.h: 16041 * API/JSCallbackFunction.cpp: 16042 * API/JSCallbackFunction.h: 16043 * API/JSCallbackObject.h: 16044 * API/JSCallbackObjectFunctions.h: 16045 * API/JSContextRef.cpp: 16046 * API/JSObjectRef.cpp: 16047 * API/JSValueRef.cpp: 16048 * VM/CTI.cpp: 16049 * VM/CTI.h: 16050 * VM/CodeBlock.cpp: 16051 * VM/CodeBlock.h: 16052 * VM/CodeGenerator.cpp: 16053 * VM/CodeGenerator.h: 16054 * VM/ExceptionHelpers.cpp: 16055 * VM/ExceptionHelpers.h: 16056 * VM/JSPropertyNameIterator.cpp: 16057 * VM/JSPropertyNameIterator.h: 16058 * VM/Machine.cpp: 16059 * VM/Machine.h: 16060 * VM/Register.h: 16061 * kjs/ArgList.cpp: 16062 * kjs/ArgList.h: 16063 * kjs/Arguments.cpp: 16064 * kjs/Arguments.h: 16065 * kjs/ArrayConstructor.cpp: 16066 * kjs/ArrayPrototype.cpp: 16067 * kjs/BooleanConstructor.cpp: 16068 * kjs/BooleanConstructor.h: 16069 * kjs/BooleanObject.h: 16070 * kjs/BooleanPrototype.cpp: 16071 * kjs/CallData.cpp: 16072 * kjs/CallData.h: 16073 * kjs/ConstructData.cpp: 16074 * kjs/ConstructData.h: 16075 * kjs/DateConstructor.cpp: 16076 * kjs/DateInstance.h: 16077 * kjs/DatePrototype.cpp: 16078 * kjs/DebuggerCallFrame.cpp: 16079 * kjs/DebuggerCallFrame.h: 16080 * kjs/ErrorConstructor.cpp: 16081 * kjs/ErrorPrototype.cpp: 16082 * kjs/ExecState.cpp: 16083 * kjs/ExecState.h: 16084 * kjs/FunctionConstructor.cpp: 16085 * kjs/FunctionPrototype.cpp: 16086 * kjs/GetterSetter.cpp: 16087 * kjs/GetterSetter.h: 16088 * kjs/InternalFunction.h: 16089 * kjs/JSActivation.cpp: 16090 * kjs/JSActivation.h: 16091 * kjs/JSArray.cpp: 16092 * kjs/JSArray.h: 16093 * kjs/JSCell.cpp: 16094 * kjs/JSCell.h: 16095 * kjs/JSFunction.cpp: 16096 * kjs/JSFunction.h: 16097 * kjs/JSGlobalData.h: 16098 * kjs/JSGlobalObject.cpp: 16099 * kjs/JSGlobalObject.h: 16100 * kjs/JSGlobalObjectFunctions.cpp: 16101 * kjs/JSGlobalObjectFunctions.h: 16102 * kjs/JSImmediate.cpp: 16103 * kjs/JSImmediate.h: 16104 * kjs/JSNotAnObject.cpp: 16105 * kjs/JSNotAnObject.h: 16106 * kjs/JSNumberCell.cpp: 16107 * kjs/JSNumberCell.h: 16108 * kjs/JSObject.cpp: 16109 * kjs/JSObject.h: 16110 * kjs/JSStaticScopeObject.cpp: 16111 * kjs/JSStaticScopeObject.h: 16112 * kjs/JSString.cpp: 16113 * kjs/JSString.h: 16114 * kjs/JSValue.h: 16115 * kjs/JSVariableObject.h: 16116 * kjs/JSWrapperObject.h: 16117 * kjs/MathObject.cpp: 16118 * kjs/NativeErrorConstructor.cpp: 16119 * kjs/NumberConstructor.cpp: 16120 * kjs/NumberConstructor.h: 16121 * kjs/NumberObject.cpp: 16122 * kjs/NumberObject.h: 16123 * kjs/NumberPrototype.cpp: 16124 * kjs/ObjectConstructor.cpp: 16125 * kjs/ObjectPrototype.cpp: 16126 * kjs/ObjectPrototype.h: 16127 * kjs/PropertyMap.h: 16128 * kjs/PropertySlot.cpp: 16129 * kjs/PropertySlot.h: 16130 * kjs/RegExpConstructor.cpp: 16131 * kjs/RegExpConstructor.h: 16132 * kjs/RegExpMatchesArray.h: 16133 * kjs/RegExpObject.cpp: 16134 * kjs/RegExpObject.h: 16135 * kjs/RegExpPrototype.cpp: 16136 * kjs/Shell.cpp: 16137 * kjs/StringConstructor.cpp: 16138 * kjs/StringObject.cpp: 16139 * kjs/StringObject.h: 16140 * kjs/StringObjectThatMasqueradesAsUndefined.h: 16141 * kjs/StringPrototype.cpp: 16142 * kjs/StructureID.cpp: 16143 * kjs/StructureID.h: 16144 * kjs/collector.cpp: 16145 * kjs/collector.h: 16146 * kjs/completion.h: 16147 * kjs/grammar.y: 16148 * kjs/interpreter.cpp: 16149 * kjs/interpreter.h: 16150 * kjs/lookup.cpp: 16151 * kjs/lookup.h: 16152 * kjs/nodes.h: 16153 * kjs/operations.cpp: 16154 * kjs/operations.h: 16155 * kjs/protect.h: 16156 * profiler/ProfileGenerator.cpp: 16157 Replace JSValue* with JSValuePtr. 16158 161592008-10-18 Darin Adler <darin@apple.com> 16160 16161 * VM/Machine.cpp: 16162 (JSC::Machine::cti_op_call_eval): Removed stray parentheses from my 16163 last check-in. 16164 161652008-10-18 Darin Adler <darin@apple.com> 16166 16167 Reviewed by Oliver Hunt. 16168 16169 - first step of https://bugs.webkit.org/show_bug.cgi?id=21732 16170 improve performance by eliminating JSValue as a base class for JSCell 16171 16172 Remove casts from JSValue* to derived classes, replacing them with 16173 calls to inline casting functions. These functions are also a bit 16174 better than aidrect cast because they also do a runtime assertion. 16175 16176 Removed use of 0 as for JSValue*, changing call sites to use a 16177 noValue() function instead. 16178 16179 Move things needed by classes derived from JSValue out of the class, 16180 since the classes won't be deriving from JSValue any more soon. 16181 16182 I did most of these changes by changing JSValue to not be JSValue* any 16183 more, then fixing a lot of the compilation problems, then rolling out 16184 the JSValue change. 16185 16186 1.011x as fast on SunSpider (presumably due to some of the Machine.cpp changes) 16187 16188 * API/APICast.h: Removed unneeded forward declarations. 16189 16190 * API/JSCallbackObject.h: Added an asCallbackObject function for casting. 16191 * API/JSCallbackObjectFunctions.h: 16192 (JSC::JSCallbackObject::asCallbackObject): Added. 16193 (JSC::JSCallbackObject::getOwnPropertySlot): Use asObject. 16194 (JSC::JSCallbackObject::call): Use noValue. 16195 (JSC::JSCallbackObject::staticValueGetter): Use asCallbackObject. 16196 (JSC::JSCallbackObject::staticFunctionGetter): Ditto. 16197 (JSC::JSCallbackObject::callbackGetter): Ditto. 16198 16199 * JavaScriptCore.exp: Updated. 16200 16201 * JavaScriptCore.xcodeproj/project.pbxproj: Added RegExpMatchesArray.h. 16202 16203 * VM/CTI.cpp: 16204 (JSC::CTI::asInteger): Added. For use casting a JSValue to an integer. 16205 (JSC::CTI::emitGetArg): Use asInteger. 16206 (JSC::CTI::emitGetPutArg): Ditto. 16207 (JSC::CTI::getConstantImmediateNumericArg): Ditto. Also use noValue. 16208 (JSC::CTI::emitInitRegister): Use asInteger. 16209 (JSC::CTI::getDeTaggedConstantImmediate): Ditto. 16210 (JSC::CTI::compileOpCallInitializeCallFrame): Ditto. 16211 (JSC::CTI::compileOpCall): Ditto. 16212 (JSC::CTI::compileOpStrictEq): Ditto. 16213 (JSC::CTI::privateCompileMainPass): Ditto. 16214 (JSC::CTI::privateCompileGetByIdProto): Ditto. 16215 (JSC::CTI::privateCompileGetByIdChain): Ditto. 16216 (JSC::CTI::privateCompilePutByIdTransition): Ditto. 16217 * VM/CTI.h: Rewrite the ARG-related macros to use C++ casts instead of 16218 C casts and get rid of some extra parentheses. Addd declaration of 16219 asInteger. 16220 16221 * VM/CodeGenerator.cpp: 16222 (JSC::CodeGenerator::emitEqualityOp): Use asString. 16223 (JSC::CodeGenerator::emitLoad): Use noValue. 16224 (JSC::CodeGenerator::findScopedProperty): Change globalObject argument 16225 to JSObject* instead of JSValue*. 16226 (JSC::CodeGenerator::emitResolve): Remove unneeded cast. 16227 (JSC::CodeGenerator::emitGetScopedVar): Use asCell. 16228 (JSC::CodeGenerator::emitPutScopedVar): Ditto. 16229 * VM/CodeGenerator.h: Changed out argument of findScopedProperty. 16230 Also change the JSValueMap to use PtrHash explicitly instead of 16231 getting it from DefaultHash. 16232 16233 * VM/JSPropertyNameIterator.cpp: 16234 (JSC::JSPropertyNameIterator::toPrimitive): Use noValue. 16235 * VM/JSPropertyNameIterator.h: 16236 (JSC::JSPropertyNameIterator::next): Ditto. 16237 16238 * VM/Machine.cpp: 16239 (JSC::fastIsNumber): Moved isImmediate check here instead of 16240 checking for 0 inside Heap::isNumber. Use asCell and asNumberCell. 16241 (JSC::fastToInt32): Ditto. 16242 (JSC::fastToUInt32): Ditto. 16243 (JSC::jsLess): Use asString. 16244 (JSC::jsLessEq): Ditto. 16245 (JSC::jsAdd): Ditto. 16246 (JSC::jsTypeStringForValue): Use asObject. 16247 (JSC::jsIsObjectType): Ditto. 16248 (JSC::jsIsFunctionType): Ditto. 16249 (JSC::inlineResolveBase): Use noValue. 16250 (JSC::Machine::callEval): Use asString. Initialize result to 16251 undefined, not 0. 16252 (JSC::Machine::Machine): Remove unneeded casts to JSCell*. 16253 (JSC::Machine::throwException): Use asObject. 16254 (JSC::Machine::debug): Remove explicit calls to the DebuggerCallFrame 16255 constructor. 16256 (JSC::Machine::checkTimeout): Use noValue. 16257 (JSC::cachePrototypeChain): Use asObject. 16258 (JSC::Machine::tryCachePutByID): Use asCell. 16259 (JSC::Machine::tryCacheGetByID): Use aCell and asObject. 16260 (JSC::Machine::privateExecute): Use noValue, asCell, asObject, asString, 16261 asArray, asActivation, asFunction. Changed code that creates call frames 16262 for host functions to pass 0 for the function pointer -- the call frame 16263 needs a JSFunction* and a host function object is not one. This was 16264 caught by the assertions in the casting functions. Also remove some 16265 unneeded casts in cases where two values are compared. 16266 (JSC::Machine::retrieveLastCaller): Use noValue. 16267 (JSC::Machine::tryCTICachePutByID): Use asCell. 16268 (JSC::Machine::tryCTICacheGetByID): Use aCell and asObject. 16269 (JSC::setUpThrowTrampolineReturnAddress): Added this function to restore 16270 the PIC-branch-avoidance that was recently lost. 16271 (JSC::Machine::cti_op_add): Use asString. 16272 (JSC::Machine::cti_op_instanceof): Use asCell and asObject. 16273 (JSC::Machine::cti_op_call_JSFunction): Use asFunction. 16274 (JSC::Machine::cti_op_call_NotJSFunction): Changed code to pass 0 for 16275 the function pointer, since we don't have a JSFunction. Use asObject. 16276 (JSC::Machine::cti_op_tear_off_activation): Use asActivation. 16277 (JSC::Machine::cti_op_construct_JSConstruct): Use asFunction and asObject. 16278 (JSC::Machine::cti_op_construct_NotJSConstruct): use asObject. 16279 (JSC::Machine::cti_op_get_by_val): Use asArray and asString. 16280 (JSC::Machine::cti_op_resolve_func): Use asPointer; this helps prepare 16281 us for a situation where JSValue is not a pointer. 16282 (JSC::Machine::cti_op_put_by_val): Use asArray. 16283 (JSC::Machine::cti_op_put_by_val_array): Ditto. 16284 (JSC::Machine::cti_op_resolve_global): Use asGlobalObject. 16285 (JSC::Machine::cti_op_post_inc): Change VM_CHECK_EXCEPTION_2 to 16286 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after 16287 that point. Also use asPointer. 16288 (JSC::Machine::cti_op_resolve_with_base): Use asPointer. 16289 (JSC::Machine::cti_op_post_dec): Change VM_CHECK_EXCEPTION_2 to 16290 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after 16291 that point. Also use asPointer. 16292 (JSC::Machine::cti_op_call_eval): Use asObject, noValue, and change 16293 VM_CHECK_EXCEPTION_ARG to VM_THROW_EXCEPTION_AT_END. 16294 (JSC::Machine::cti_op_throw): Change return value to a JSValue*. 16295 (JSC::Machine::cti_op_in): Use asObject. 16296 (JSC::Machine::cti_op_switch_char): Use asString. 16297 (JSC::Machine::cti_op_switch_string): Ditto. 16298 (JSC::Machine::cti_op_put_getter): Use asObject. 16299 (JSC::Machine::cti_op_put_setter): Ditto. 16300 (JSC::Machine::cti_vm_throw): Change return value to a JSValue*. 16301 Use noValue. 16302 * VM/Machine.h: Change return values of both cti_op_throw and 16303 cti_vm_throw to JSValue*. 16304 16305 * VM/Register.h: Remove nullJSValue, which is the same thing 16306 as noValue(). Also removed unneeded definition of JSValue. 16307 16308 * kjs/ArgList.h: Removed unneeded definition of JSValue. 16309 16310 * kjs/Arguments.h: 16311 (JSC::asArguments): Added. 16312 16313 * kjs/ArrayPrototype.cpp: 16314 (JSC::getProperty): Use noValue. 16315 (JSC::arrayProtoFuncToString): Use asArray. 16316 (JSC::arrayProtoFuncToLocaleString): Ditto. 16317 (JSC::arrayProtoFuncConcat): Ditto. 16318 (JSC::arrayProtoFuncPop): Ditto. Also removed unneeded initialization 16319 of the result, which is set in both sides of the branch. 16320 (JSC::arrayProtoFuncPush): Ditto. 16321 (JSC::arrayProtoFuncShift): Removed unneeded initialization 16322 of the result, which is set in both sides of the branch. 16323 (JSC::arrayProtoFuncSort): Use asArray. 16324 16325 * kjs/BooleanObject.h: 16326 (JSC::asBooleanObject): Added. 16327 16328 * kjs/BooleanPrototype.cpp: 16329 (JSC::booleanProtoFuncToString): Use asBooleanObject. 16330 (JSC::booleanProtoFuncValueOf): Ditto. 16331 16332 * kjs/CallData.cpp: 16333 (JSC::call): Use asObject and asFunction. 16334 * kjs/ConstructData.cpp: 16335 (JSC::construct): Ditto. 16336 16337 * kjs/DateConstructor.cpp: 16338 (JSC::constructDate): Use asDateInstance. 16339 16340 * kjs/DateInstance.h: 16341 (JSC::asDateInstance): Added. 16342 16343 * kjs/DatePrototype.cpp: 16344 (JSC::dateProtoFuncToString): Use asDateInstance. 16345 (JSC::dateProtoFuncToUTCString): Ditto. 16346 (JSC::dateProtoFuncToDateString): Ditto. 16347 (JSC::dateProtoFuncToTimeString): Ditto. 16348 (JSC::dateProtoFuncToLocaleString): Ditto. 16349 (JSC::dateProtoFuncToLocaleDateString): Ditto. 16350 (JSC::dateProtoFuncToLocaleTimeString): Ditto. 16351 (JSC::dateProtoFuncValueOf): Ditto. 16352 (JSC::dateProtoFuncGetTime): Ditto. 16353 (JSC::dateProtoFuncGetFullYear): Ditto. 16354 (JSC::dateProtoFuncGetUTCFullYear): Ditto. 16355 (JSC::dateProtoFuncToGMTString): Ditto. 16356 (JSC::dateProtoFuncGetMonth): Ditto. 16357 (JSC::dateProtoFuncGetUTCMonth): Ditto. 16358 (JSC::dateProtoFuncGetDate): Ditto. 16359 (JSC::dateProtoFuncGetUTCDate): Ditto. 16360 (JSC::dateProtoFuncGetDay): Ditto. 16361 (JSC::dateProtoFuncGetUTCDay): Ditto. 16362 (JSC::dateProtoFuncGetHours): Ditto. 16363 (JSC::dateProtoFuncGetUTCHours): Ditto. 16364 (JSC::dateProtoFuncGetMinutes): Ditto. 16365 (JSC::dateProtoFuncGetUTCMinutes): Ditto. 16366 (JSC::dateProtoFuncGetSeconds): Ditto. 16367 (JSC::dateProtoFuncGetUTCSeconds): Ditto. 16368 (JSC::dateProtoFuncGetMilliSeconds): Ditto. 16369 (JSC::dateProtoFuncGetUTCMilliseconds): Ditto. 16370 (JSC::dateProtoFuncGetTimezoneOffset): Ditto. 16371 (JSC::dateProtoFuncSetTime): Ditto. 16372 (JSC::setNewValueFromTimeArgs): Ditto. 16373 (JSC::setNewValueFromDateArgs): Ditto. 16374 (JSC::dateProtoFuncSetYear): Ditto. 16375 (JSC::dateProtoFuncGetYear): Ditto. 16376 16377 * kjs/DebuggerCallFrame.cpp: 16378 (JSC::DebuggerCallFrame::thisObject): Use asObject. 16379 (JSC::DebuggerCallFrame::evaluate): Use noValue. 16380 * kjs/DebuggerCallFrame.h: Added a constructor that 16381 takes only a callFrame. 16382 16383 * kjs/ExecState.h: 16384 (JSC::ExecState::clearException): Use noValue. 16385 16386 * kjs/FunctionPrototype.cpp: 16387 (JSC::functionProtoFuncToString): Use asFunction. 16388 (JSC::functionProtoFuncApply): Use asArguments and asArray. 16389 16390 * kjs/GetterSetter.cpp: 16391 (JSC::GetterSetter::getPrimitiveNumber): Use noValue. 16392 16393 * kjs/GetterSetter.h: 16394 (JSC::asGetterSetter): Added. 16395 16396 * kjs/InternalFunction.cpp: 16397 (JSC::InternalFunction::name): Use asString. 16398 16399 * kjs/InternalFunction.h: 16400 (JSC::asInternalFunction): Added. 16401 16402 * kjs/JSActivation.cpp: 16403 (JSC::JSActivation::argumentsGetter): Use asActivation. 16404 16405 * kjs/JSActivation.h: 16406 (JSC::asActivation): Added. 16407 16408 * kjs/JSArray.cpp: 16409 (JSC::JSArray::putSlowCase): Use noValue. 16410 (JSC::JSArray::deleteProperty): Ditto. 16411 (JSC::JSArray::increaseVectorLength): Ditto. 16412 (JSC::JSArray::setLength): Ditto. 16413 (JSC::JSArray::pop): Ditto. 16414 (JSC::JSArray::sort): Ditto. 16415 (JSC::JSArray::compactForSorting): Ditto. 16416 * kjs/JSArray.h: 16417 (JSC::asArray): Added. 16418 16419 * kjs/JSCell.cpp: 16420 (JSC::JSCell::getJSNumber): Use noValue. 16421 16422 * kjs/JSCell.h: 16423 (JSC::asCell): Added. 16424 (JSC::JSValue::asCell): Changed to not preserve const. 16425 Given the wide use of JSValue* and JSCell*, it's not 16426 really useful to use const. 16427 (JSC::JSValue::isNumber): Use asValue. 16428 (JSC::JSValue::isString): Ditto. 16429 (JSC::JSValue::isGetterSetter): Ditto. 16430 (JSC::JSValue::isObject): Ditto. 16431 (JSC::JSValue::getNumber): Ditto. 16432 (JSC::JSValue::getString): Ditto. 16433 (JSC::JSValue::getObject): Ditto. 16434 (JSC::JSValue::getCallData): Ditto. 16435 (JSC::JSValue::getConstructData): Ditto. 16436 (JSC::JSValue::getUInt32): Ditto. 16437 (JSC::JSValue::getTruncatedInt32): Ditto. 16438 (JSC::JSValue::getTruncatedUInt32): Ditto. 16439 (JSC::JSValue::mark): Ditto. 16440 (JSC::JSValue::marked): Ditto. 16441 (JSC::JSValue::toPrimitive): Ditto. 16442 (JSC::JSValue::getPrimitiveNumber): Ditto. 16443 (JSC::JSValue::toBoolean): Ditto. 16444 (JSC::JSValue::toNumber): Ditto. 16445 (JSC::JSValue::toString): Ditto. 16446 (JSC::JSValue::toObject): Ditto. 16447 (JSC::JSValue::toThisObject): Ditto. 16448 (JSC::JSValue::needsThisConversion): Ditto. 16449 (JSC::JSValue::toThisString): Ditto. 16450 (JSC::JSValue::getJSNumber): Ditto. 16451 16452 * kjs/JSFunction.cpp: 16453 (JSC::JSFunction::argumentsGetter): Use asFunction. 16454 (JSC::JSFunction::callerGetter): Ditto. 16455 (JSC::JSFunction::lengthGetter): Ditto. 16456 (JSC::JSFunction::construct): Use asObject. 16457 16458 * kjs/JSFunction.h: 16459 (JSC::asFunction): Added. 16460 16461 * kjs/JSGlobalObject.cpp: 16462 (JSC::lastInPrototypeChain): Use asObject. 16463 16464 * kjs/JSGlobalObject.h: 16465 (JSC::asGlobalObject): Added. 16466 (JSC::ScopeChainNode::globalObject): Use asGlobalObject. 16467 16468 * kjs/JSImmediate.h: Added noValue, asPointer, and makeValue 16469 functions. Use rawValue, makeValue, and noValue consistently 16470 instead of doing reinterpret_cast in various functions. 16471 16472 * kjs/JSNumberCell.h: 16473 (JSC::asNumberCell): Added. 16474 (JSC::JSValue::uncheckedGetNumber): Use asValue and asNumberCell. 16475 (JSC::JSValue::toJSNumber): Use asValue. 16476 16477 * kjs/JSObject.cpp: 16478 (JSC::JSObject::put): Use asObject and asGetterSetter. 16479 (JSC::callDefaultValueFunction): Use noValue. 16480 (JSC::JSObject::defineGetter): Use asGetterSetter. 16481 (JSC::JSObject::defineSetter): Ditto. 16482 (JSC::JSObject::lookupGetter): Ditto. Also use asObject. 16483 (JSC::JSObject::lookupSetter): Ditto. 16484 (JSC::JSObject::hasInstance): Use asObject. 16485 (JSC::JSObject::fillGetterPropertySlot): Use asGetterSetter. 16486 16487 * kjs/JSObject.h: 16488 (JSC::JSObject::getDirect): Use noValue. 16489 (JSC::asObject): Added. 16490 (JSC::JSValue::isObject): Use asValue. 16491 (JSC::JSObject::get): Removed unneeded const_cast. 16492 (JSC::JSObject::getPropertySlot): Use asObject. 16493 (JSC::JSValue::get): Removed unneeded const_cast. 16494 Use asValue, asCell, and asObject. 16495 (JSC::JSValue::put): Ditto. 16496 (JSC::JSObject::allocatePropertyStorageInline): Fixed spelling 16497 of "oldPropertStorage". 16498 16499 * kjs/JSString.cpp: 16500 (JSC::JSString::getOwnPropertySlot): Use asObject. 16501 16502 * kjs/JSString.h: 16503 (JSC::asString): Added. 16504 (JSC::JSValue::toThisJSString): Use asValue. 16505 16506 * kjs/JSValue.h: Make PreferredPrimitiveType a top level enum 16507 instead of a member of JSValue. Added an asValue function that 16508 returns this. Removed overload of asCell for const. Use asValue 16509 instead of getting right at this. 16510 16511 * kjs/ObjectPrototype.cpp: 16512 (JSC::objectProtoFuncIsPrototypeOf): Use asObject. 16513 (JSC::objectProtoFuncDefineGetter): Ditto. 16514 (JSC::objectProtoFuncDefineSetter): Ditto. 16515 16516 * kjs/PropertySlot.h: 16517 (JSC::PropertySlot::PropertySlot): Take a const JSValue* so the 16518 callers don't have to worry about const. 16519 (JSC::PropertySlot::clearBase): Use noValue. 16520 (JSC::PropertySlot::clearValue): Ditto. 16521 16522 * kjs/RegExpConstructor.cpp: 16523 (JSC::regExpConstructorDollar1): Use asRegExpConstructor. 16524 (JSC::regExpConstructorDollar2): Ditto. 16525 (JSC::regExpConstructorDollar3): Ditto. 16526 (JSC::regExpConstructorDollar4): Ditto. 16527 (JSC::regExpConstructorDollar5): Ditto. 16528 (JSC::regExpConstructorDollar6): Ditto. 16529 (JSC::regExpConstructorDollar7): Ditto. 16530 (JSC::regExpConstructorDollar8): Ditto. 16531 (JSC::regExpConstructorDollar9): Ditto. 16532 (JSC::regExpConstructorInput): Ditto. 16533 (JSC::regExpConstructorMultiline): Ditto. 16534 (JSC::regExpConstructorLastMatch): Ditto. 16535 (JSC::regExpConstructorLastParen): Ditto. 16536 (JSC::regExpConstructorLeftContext): Ditto. 16537 (JSC::regExpConstructorRightContext): Ditto. 16538 (JSC::setRegExpConstructorInput): Ditto. 16539 (JSC::setRegExpConstructorMultiline): Ditto. 16540 (JSC::constructRegExp): Use asObject. 16541 16542 * kjs/RegExpConstructor.h: 16543 (JSC::asRegExpConstructor): Added. 16544 16545 * kjs/RegExpObject.cpp: 16546 (JSC::regExpObjectGlobal): Use asRegExpObject. 16547 (JSC::regExpObjectIgnoreCase): Ditto. 16548 (JSC::regExpObjectMultiline): Ditto. 16549 (JSC::regExpObjectSource): Ditto. 16550 (JSC::regExpObjectLastIndex): Ditto. 16551 (JSC::setRegExpObjectLastIndex): Ditto. 16552 (JSC::callRegExpObject): Ditto. 16553 16554 * kjs/RegExpObject.h: 16555 (JSC::asRegExpObject): Added. 16556 16557 * kjs/RegExpPrototype.cpp: 16558 (JSC::regExpProtoFuncTest): Use asRegExpObject. 16559 (JSC::regExpProtoFuncExec): Ditto. 16560 (JSC::regExpProtoFuncCompile): Ditto. 16561 (JSC::regExpProtoFuncToString): Ditto. 16562 16563 * kjs/StringObject.h: 16564 (JSC::StringObject::internalValue): Use asString. 16565 (JSC::asStringObject): Added. 16566 16567 * kjs/StringPrototype.cpp: 16568 (JSC::stringProtoFuncReplace): Use asRegExpObject. 16569 (JSC::stringProtoFuncToString): Ue asStringObject. 16570 (JSC::stringProtoFuncMatch): Use asRegExpObject. 16571 (JSC::stringProtoFuncSearch): Ditto. 16572 (JSC::stringProtoFuncSplit): Ditto. 16573 16574 * kjs/StructureID.cpp: 16575 (JSC::StructureID::getEnumerablePropertyNames): Use asObject. 16576 (JSC::StructureID::createCachedPrototypeChain): Ditto. 16577 (JSC::StructureIDChain::StructureIDChain): Use asCell and asObject. 16578 16579 * kjs/collector.h: 16580 (JSC::Heap::isNumber): Removed null handling. This can only be called 16581 on valid cells. 16582 (JSC::Heap::cellBlock): Removed overload for const and non-const. 16583 Whether the JSCell* is const or not really should have no effect on 16584 whether you can modify the collector block it's in. 16585 16586 * kjs/interpreter.cpp: 16587 (JSC::Interpreter::evaluate): Use noValue and noObject. 16588 16589 * kjs/nodes.cpp: 16590 (JSC::FunctionCallResolveNode::emitCode): Use JSObject for the global 16591 object rather than JSValue. 16592 (JSC::PostfixResolveNode::emitCode): Ditto. 16593 (JSC::PrefixResolveNode::emitCode): Ditto. 16594 (JSC::ReadModifyResolveNode::emitCode): Ditto. 16595 (JSC::AssignResolveNode::emitCode): Ditto. 16596 16597 * kjs/operations.h: 16598 (JSC::equalSlowCaseInline): Use asString, asCell, asNumberCell, 16599 (JSC::strictEqualSlowCaseInline): Ditto. 16600 166012008-10-18 Cameron Zwarich <zwarich@apple.com> 16602 16603 Reviewed by Oliver Hunt. 16604 16605 Bug 21702: Special op_create_activation for the case where there are no named parameters 16606 <https://bugs.webkit.org/show_bug.cgi?id=21702> 16607 16608 This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup 16609 on the V8 Earley-Boyer benchmark. 16610 16611 * VM/CTI.cpp: 16612 (JSC::CTI::privateCompileMainPass): 16613 * VM/Machine.cpp: 16614 (JSC::Machine::cti_op_create_arguments_no_params): 16615 * VM/Machine.h: 16616 * kjs/Arguments.h: 16617 (JSC::Arguments::): 16618 (JSC::Arguments::Arguments): 16619 166202008-10-17 Maciej Stachowiak <mjs@apple.com> 16621 16622 Reviewed by Cameron Zwarich. 16623 16624 - in debug builds, alter the stack to avoid blowing out MallocStackLogging 16625 16626 (In essence, while executing a CTI function we alter the return 16627 address to jscGeneratedNativeCode so that a single consistent 16628 function is on the stack instead of many random functions without 16629 symbols.) 16630 16631 * VM/CTI.h: 16632 * VM/Machine.cpp: 16633 (JSC::doSetReturnAddress): 16634 (JSC::): 16635 (JSC::StackHack::StackHack): 16636 (JSC::StackHack::~StackHack): 16637 (JSC::Machine::cti_op_convert_this): 16638 (JSC::Machine::cti_op_end): 16639 (JSC::Machine::cti_op_add): 16640 (JSC::Machine::cti_op_pre_inc): 16641 (JSC::Machine::cti_timeout_check): 16642 (JSC::Machine::cti_register_file_check): 16643 (JSC::Machine::cti_op_loop_if_less): 16644 (JSC::Machine::cti_op_loop_if_lesseq): 16645 (JSC::Machine::cti_op_new_object): 16646 (JSC::Machine::cti_op_put_by_id): 16647 (JSC::Machine::cti_op_put_by_id_second): 16648 (JSC::Machine::cti_op_put_by_id_generic): 16649 (JSC::Machine::cti_op_put_by_id_fail): 16650 (JSC::Machine::cti_op_get_by_id): 16651 (JSC::Machine::cti_op_get_by_id_second): 16652 (JSC::Machine::cti_op_get_by_id_generic): 16653 (JSC::Machine::cti_op_get_by_id_fail): 16654 (JSC::Machine::cti_op_instanceof): 16655 (JSC::Machine::cti_op_del_by_id): 16656 (JSC::Machine::cti_op_mul): 16657 (JSC::Machine::cti_op_new_func): 16658 (JSC::Machine::cti_op_call_profiler): 16659 (JSC::Machine::cti_op_call_JSFunction): 16660 (JSC::Machine::cti_vm_lazyLinkCall): 16661 (JSC::Machine::cti_vm_compile): 16662 (JSC::Machine::cti_op_push_activation): 16663 (JSC::Machine::cti_op_call_NotJSFunction): 16664 (JSC::Machine::cti_op_create_arguments): 16665 (JSC::Machine::cti_op_tear_off_activation): 16666 (JSC::Machine::cti_op_tear_off_arguments): 16667 (JSC::Machine::cti_op_ret_profiler): 16668 (JSC::Machine::cti_op_ret_scopeChain): 16669 (JSC::Machine::cti_op_new_array): 16670 (JSC::Machine::cti_op_resolve): 16671 (JSC::Machine::cti_op_construct_JSConstructFast): 16672 (JSC::Machine::cti_op_construct_JSConstruct): 16673 (JSC::Machine::cti_op_construct_NotJSConstruct): 16674 (JSC::Machine::cti_op_get_by_val): 16675 (JSC::Machine::cti_op_resolve_func): 16676 (JSC::Machine::cti_op_sub): 16677 (JSC::Machine::cti_op_put_by_val): 16678 (JSC::Machine::cti_op_put_by_val_array): 16679 (JSC::Machine::cti_op_lesseq): 16680 (JSC::Machine::cti_op_loop_if_true): 16681 (JSC::Machine::cti_op_negate): 16682 (JSC::Machine::cti_op_resolve_base): 16683 (JSC::Machine::cti_op_resolve_skip): 16684 (JSC::Machine::cti_op_resolve_global): 16685 (JSC::Machine::cti_op_div): 16686 (JSC::Machine::cti_op_pre_dec): 16687 (JSC::Machine::cti_op_jless): 16688 (JSC::Machine::cti_op_not): 16689 (JSC::Machine::cti_op_jtrue): 16690 (JSC::Machine::cti_op_post_inc): 16691 (JSC::Machine::cti_op_eq): 16692 (JSC::Machine::cti_op_lshift): 16693 (JSC::Machine::cti_op_bitand): 16694 (JSC::Machine::cti_op_rshift): 16695 (JSC::Machine::cti_op_bitnot): 16696 (JSC::Machine::cti_op_resolve_with_base): 16697 (JSC::Machine::cti_op_new_func_exp): 16698 (JSC::Machine::cti_op_mod): 16699 (JSC::Machine::cti_op_less): 16700 (JSC::Machine::cti_op_neq): 16701 (JSC::Machine::cti_op_post_dec): 16702 (JSC::Machine::cti_op_urshift): 16703 (JSC::Machine::cti_op_bitxor): 16704 (JSC::Machine::cti_op_new_regexp): 16705 (JSC::Machine::cti_op_bitor): 16706 (JSC::Machine::cti_op_call_eval): 16707 (JSC::Machine::cti_op_throw): 16708 (JSC::Machine::cti_op_get_pnames): 16709 (JSC::Machine::cti_op_next_pname): 16710 (JSC::Machine::cti_op_push_scope): 16711 (JSC::Machine::cti_op_pop_scope): 16712 (JSC::Machine::cti_op_typeof): 16713 (JSC::Machine::cti_op_is_undefined): 16714 (JSC::Machine::cti_op_is_boolean): 16715 (JSC::Machine::cti_op_is_number): 16716 (JSC::Machine::cti_op_is_string): 16717 (JSC::Machine::cti_op_is_object): 16718 (JSC::Machine::cti_op_is_function): 16719 (JSC::Machine::cti_op_stricteq): 16720 (JSC::Machine::cti_op_nstricteq): 16721 (JSC::Machine::cti_op_to_jsnumber): 16722 (JSC::Machine::cti_op_in): 16723 (JSC::Machine::cti_op_push_new_scope): 16724 (JSC::Machine::cti_op_jmp_scopes): 16725 (JSC::Machine::cti_op_put_by_index): 16726 (JSC::Machine::cti_op_switch_imm): 16727 (JSC::Machine::cti_op_switch_char): 16728 (JSC::Machine::cti_op_switch_string): 16729 (JSC::Machine::cti_op_del_by_val): 16730 (JSC::Machine::cti_op_put_getter): 16731 (JSC::Machine::cti_op_put_setter): 16732 (JSC::Machine::cti_op_new_error): 16733 (JSC::Machine::cti_op_debug): 16734 (JSC::Machine::cti_vm_throw): 16735 167362008-10-17 Gavin Barraclough <barraclough@apple.com> 16737 16738 Optimize op_call by allowing call sites to be directly linked to callees. 16739 16740 For the hot path of op_call, CTI now generates a check (initially for an impossible 16741 value), and the first time the call is executed we attempt to link the call directly 16742 to the callee. We can currently only do so if the arity of the caller and callee 16743 match. The (optimized) setup for the call on the hot path is linked directly to 16744 the ctiCode for the callee, without indirection. 16745 16746 Two forms of the slow case of the call are generated, the first will be executed the 16747 first time the call is reached. As well as this path attempting to link the call to 16748 a callee, it also relinks the slow case to a second slow case, which will not continue 16749 to attempt relinking the call. (This policy could be changed in future, but for not 16750 this is intended to prevent thrashing). 16751 16752 If a callee that the caller has been linked to is garbage collected, then the link 16753 in the caller's JIt code will be reset back to a value that cannot match - to prevent 16754 any false positive matches. 16755 16756 ~20% progression on deltablue & richards, >12% overall reduction in v8-tests 16757 runtime, one or two percent progression on sunspider. 16758 16759 Reviewed by Oliver Hunt. 16760 16761 * VM/CTI.cpp: 16762 (JSC::): 16763 (JSC::CTI::emitNakedCall): 16764 (JSC::unreachable): 16765 (JSC::CTI::compileOpCallInitializeCallFrame): 16766 (JSC::CTI::compileOpCallSetupArgs): 16767 (JSC::CTI::compileOpCall): 16768 (JSC::CTI::privateCompileMainPass): 16769 (JSC::CTI::privateCompileSlowCases): 16770 (JSC::CTI::privateCompile): 16771 (JSC::CTI::unlinkCall): 16772 (JSC::CTI::linkCall): 16773 * VM/CTI.h: 16774 * VM/CodeBlock.cpp: 16775 (JSC::CodeBlock::~CodeBlock): 16776 (JSC::CodeBlock::unlinkCallers): 16777 (JSC::CodeBlock::derefStructureIDs): 16778 * VM/CodeBlock.h: 16779 (JSC::StructureStubInfo::StructureStubInfo): 16780 (JSC::CallLinkInfo::CallLinkInfo): 16781 (JSC::CodeBlock::addCaller): 16782 (JSC::CodeBlock::removeCaller): 16783 (JSC::CodeBlock::getStubInfo): 16784 * VM/CodeGenerator.cpp: 16785 (JSC::CodeGenerator::emitCall): 16786 (JSC::CodeGenerator::emitConstruct): 16787 * VM/Machine.cpp: 16788 (JSC::Machine::cti_op_call_profiler): 16789 (JSC::Machine::cti_op_call_JSFunction): 16790 (JSC::Machine::cti_vm_lazyLinkCall): 16791 (JSC::Machine::cti_op_construct_JSConstructFast): 16792 (JSC::Machine::cti_op_construct_JSConstruct): 16793 (JSC::Machine::cti_op_construct_NotJSConstruct): 16794 * VM/Machine.h: 16795 * kjs/JSFunction.cpp: 16796 (JSC::JSFunction::~JSFunction): 16797 * kjs/JSFunction.h: 16798 * kjs/nodes.h: 16799 (JSC::FunctionBodyNode::): 16800 * masm/X86Assembler.h: 16801 (JSC::X86Assembler::getDifferenceBetweenLabels): 16802 168032008-10-17 Maciej Stachowiak <mjs@apple.com> 16804 16805 Reviewed by Geoff Garen. 16806 16807 - remove ASSERT that makes the leaks buildbot cry 16808 16809 * kjs/JSFunction.cpp: 16810 (JSC::JSFunction::JSFunction): 16811 168122008-10-17 Maciej Stachowiak <mjs@apple.com> 16813 16814 Reviewed by Cameron Zwarich 16815 16816 - don't bother to do arguments tearoff when it will have no effect 16817 16818 ~1% on v8 raytrace 16819 16820 * VM/CodeGenerator.cpp: 16821 (JSC::CodeGenerator::emitReturn): 16822 168232008-10-17 Marco Barisione <marco.barisione@collabora.co.uk> 16824 16825 Reviewed by Sam Weinig. Landed by Jan Alonzo. 16826 16827 https://bugs.webkit.org/show_bug.cgi?id=21603 16828 [GTK] Minor fixes to GOwnPtr 16829 16830 * wtf/GOwnPtr.cpp: 16831 (WTF::GError): 16832 (WTF::GList): 16833 (WTF::GCond): 16834 (WTF::GMutex): 16835 (WTF::GPatternSpec): 16836 (WTF::GDir): 16837 * wtf/GOwnPtr.h: 16838 (WTF::freeOwnedGPtr): 16839 (WTF::GOwnPtr::~GOwnPtr): 16840 (WTF::GOwnPtr::outPtr): 16841 (WTF::GOwnPtr::set): 16842 (WTF::GOwnPtr::clear): 16843 * wtf/Threading.h: 16844 168452008-10-17 Maciej Stachowiak <mjs@apple.com> 16846 16847 Reviewed by Cameron Zwarich. 16848 16849 - speed up transitions that resize the property storage a fair bit 16850 16851 ~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue 16852 16853 * VM/CTI.cpp: 16854 (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize 16855 the object's property storage with one inline call. 16856 (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage 16857 resize, but still do all the rest of the work in assembly in that case, and pass the known 16858 compile-time constants of old and new size rather than structureIDs, saving a bunch of 16859 redundant memory access. 16860 * kjs/JSObject.cpp: 16861 (JSC::JSObject::allocatePropertyStorage): Just call the inline version. 16862 * kjs/JSObject.h: 16863 (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage 16864 * masm/X86Assembler.h: 16865 (JSC::X86Assembler::): 16866 (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich. 16867 168682008-10-17 Cameron Zwarich <zwarich@apple.com> 16869 16870 Reviewed by Maciej Stachowiak. 16871 16872 Remove some C style casts. 16873 16874 * masm/X86Assembler.h: 16875 (JSC::JITCodeBuffer::putIntUnchecked): 16876 (JSC::X86Assembler::link): 16877 (JSC::X86Assembler::linkAbsoluteAddress): 16878 (JSC::X86Assembler::getRelocatedAddress): 16879 168802008-10-17 Cameron Zwarich <zwarich@apple.com> 16881 16882 Rubber-stamped by Maciej Stachowiak. 16883 16884 Remove some C style casts. 16885 16886 * VM/CTI.cpp: 16887 (JSC::CTI::patchGetByIdSelf): 16888 (JSC::CTI::patchPutByIdReplace): 16889 * VM/Machine.cpp: 16890 (JSC::Machine::tryCTICachePutByID): 16891 (JSC::Machine::tryCTICacheGetByID): 16892 (JSC::Machine::cti_op_put_by_id): 16893 (JSC::Machine::cti_op_put_by_id_fail): 16894 (JSC::Machine::cti_op_get_by_id): 16895 (JSC::Machine::cti_op_get_by_id_fail): 16896 168972008-10-17 Maciej Stachowiak <mjs@apple.com> 16898 16899 Reviewed by Cameron Zwarich. 16900 16901 - Avoid restoring the caller's 'r' value in op_ret 16902 https://bugs.webkit.org/show_bug.cgi?id=21319 16903 16904 This patch stops writing the call frame at call and return points; 16905 instead it does so immediately before any CTI call. 16906 16907 0.5% speedup or so on the v8 benchmark 16908 16909 * VM/CTI.cpp: 16910 (JSC::CTI::emitCTICall): 16911 (JSC::CTI::compileOpCall): 16912 (JSC::CTI::emitSlowScriptCheck): 16913 (JSC::CTI::compileBinaryArithOpSlowCase): 16914 (JSC::CTI::privateCompileMainPass): 16915 (JSC::CTI::privateCompileSlowCases): 16916 (JSC::CTI::privateCompile): 16917 * VM/CTI.h: 16918 169192008-10-17 Cameron Zwarich <zwarich@apple.com> 16920 16921 Reviewed by Sam Weinig. 16922 16923 Make WREC require CTI because it won't actually compile otherwise. 16924 16925 * wtf/Platform.h: 16926 169272008-10-16 Maciej Stachowiak <mjs@apple.com> 16928 16929 Reviewed by Geoff Garen. 16930 16931 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0 16932 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default 16933 16934 This time there is no performance regression; we can avoid having 16935 to use the fastcall calling convention for CTI functions by using 16936 varargs to prevent the compiler from moving things around on the 16937 stack. 16938 16939 * Configurations/DebugRelease.xcconfig: 16940 * JavaScriptCore.xcodeproj/project.pbxproj: 16941 * VM/CTI.cpp: 16942 * VM/Machine.h: 16943 * wtf/Platform.h: 16944 169452008-10-16 Maciej Stachowiak <mjs@apple.com> 16946 16947 Reviewed by Oliver Hunt. 16948 16949 - fix for REGRESSION: r37631 causing crashes on buildbot 16950 https://bugs.webkit.org/show_bug.cgi?id=21682 16951 16952 * kjs/collector.cpp: 16953 (JSC::Heap::collect): Avoid crashing when a GC occurs while no global objects are live. 16954 169552008-10-16 Sam Weinig <sam@webkit.org> 16956 16957 Reviewed by Maciej Stachowiak. 16958 16959 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683 16960 Don't create intermediate StructureIDs for builtin objects 16961 16962 First step in reduce number of StructureIDs created when initializing the 16963 JSGlobalObject. 16964 16965 - In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition 16966 and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning 16967 the StructureID. This patch just implements this strategy for ObjectPrototype but alone 16968 reduces the number of StructureIDs create for about:blank by 10, from 142 to 132. 16969 16970 * kjs/JSGlobalObject.cpp: 16971 (JSC::JSGlobalObject::reset): 16972 * kjs/JSObject.cpp: 16973 (JSC::JSObject::putDirectFunctionWithoutTransition): 16974 * kjs/JSObject.h: 16975 (JSC::JSObject::putDirectWithoutTransition): 16976 * kjs/ObjectPrototype.cpp: 16977 (JSC::ObjectPrototype::ObjectPrototype): 16978 * kjs/ObjectPrototype.h: 16979 * kjs/StructureID.cpp: 16980 (JSC::StructureID::addPropertyWithoutTransition): 16981 * kjs/StructureID.h: 16982 169832008-10-16 Maciej Stachowiak <mjs@apple.com> 16984 16985 Reviewed by Cameron Zwarich. 16986 16987 - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633) 16988 16989 Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider. 16990 16991 * kjs/StructureID.cpp: 16992 (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to 16993 itself from the destructor; that doesn't even make sense. 16994 (JSC::StructureID::addPropertyTransition): Don't refer the single transition; 16995 the rule is that parent StructureIDs are ref'd but child ones are not. Refing 16996 the child creates a cycle. 16997 169982008-10-15 Alexey Proskuryakov <ap@webkit.org> 16999 17000 Reviewed by Darin Adler. 17001 17002 https://bugs.webkit.org/show_bug.cgi?id=21609 17003 Make MessagePorts protect their peers across heaps 17004 17005 * JavaScriptCore.exp: 17006 * kjs/JSGlobalObject.cpp: 17007 (JSC::JSGlobalObject::markCrossHeapDependentObjects): 17008 * kjs/JSGlobalObject.h: 17009 * kjs/collector.cpp: 17010 (JSC::Heap::collect): 17011 Before GC sweep phase, a function supplied by global object is now called for all global 17012 objects in the heap, making it possible to implement cross-heap dependencies. 17013 170142008-10-15 Alexey Proskuryakov <ap@webkit.org> 17015 17016 Reviewed by Darin Adler. 17017 17018 https://bugs.webkit.org/show_bug.cgi?id=21610 17019 run-webkit-threads --threaded crashes in StructureID destructor 17020 17021 * kjs/StructureID.cpp: 17022 (JSC::StructureID::StructureID): 17023 (JSC::StructureID::~StructureID): 17024 Protect access to a static (debug-only) HashSet with a lock. 17025 170262008-10-15 Sam Weinig <sam@webkit.org> 17027 17028 Reviewed by Goeffrey Garen. 17029 17030 Add function to dump statistics for StructureIDs. 17031 17032 * kjs/StructureID.cpp: 17033 (JSC::StructureID::dumpStatistics): 17034 (JSC::StructureID::StructureID): 17035 (JSC::StructureID::~StructureID): 17036 * kjs/StructureID.h: 17037 170382008-10-15 Cameron Zwarich <zwarich@apple.com> 17039 17040 Reviewed by Maciej Stachowiak. 17041 17042 Bug 21633: Avoid using a HashMap when there is only a single transition 17043 <https://bugs.webkit.org/show_bug.cgi?id=21633> 17044 17045 This is a 0.8% speedup on SunSpider and between a 0.5% and 1.0% speedup 17046 on the V8 benchmark suite, depending on which harness we use. It will 17047 also slightly reduce the memory footprint of a StructureID. 17048 17049 * kjs/StructureID.cpp: 17050 (JSC::StructureID::StructureID): 17051 (JSC::StructureID::~StructureID): 17052 (JSC::StructureID::addPropertyTransition): 17053 * kjs/StructureID.h: 17054 (JSC::StructureID::): 17055 170562008-10-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 17057 17058 Reviewed by Geoffrey Garen. 17059 17060 1.40% speedup on SunSpider, 1.44% speedup on V8. (Linux) 17061 17062 No change on Mac. 17063 17064 * VM/Machine.cpp: 17065 (JSC::fastIsNumber): ALWAYS_INLINE modifier added. 17066 170672008-10-15 Geoffrey Garen <ggaren@apple.com> 17068 17069 Reviewed by Cameron Zwarich. 17070 17071 Fixed https://bugs.webkit.org/show_bug.cgi?id=21345 17072 Start the debugger without reloading the inspected page 17073 17074 * JavaScriptCore.exp: New symbols. 17075 * JavaScriptCore.xcodeproj/project.pbxproj: New files. 17076 17077 * VM/CodeBlock.h: 17078 (JSC::EvalCodeCache::get): Updated for tweak to parsing API. 17079 17080 * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap, 17081 which we use to find all the live functions and recompile them. 17082 17083 * kjs/DebuggerCallFrame.cpp: 17084 (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API. 17085 17086 * kjs/FunctionConstructor.cpp: 17087 (JSC::constructFunction): Updated for tweak to parsing API. 17088 17089 * kjs/JSFunction.cpp: 17090 (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug 17091 builds by ASSERTing that it's syntactically valid. This doesn't catch 17092 all SourceCode bugs, but it catches a lot of them. 17093 17094 * kjs/JSGlobalObjectFunctions.cpp: 17095 (JSC::globalFuncEval): Updated for tweak to parsing API. 17096 17097 * kjs/Parser.cpp: 17098 (JSC::Parser::parse): 17099 * kjs/Parser.h: 17100 (JSC::Parser::parse): Tweaked the parser to make it possible to parse 17101 without an ExecState, and to allow the client to specify a debugger to 17102 notify (or not) about the source we parse. This allows the inspector 17103 to recompile even though no JavaScript is executing, then notify the 17104 debugger about all source code when it's done. 17105 17106 * kjs/Shell.cpp: 17107 (prettyPrintScript): Updated for tweak to parsing API. 17108 17109 * kjs/SourceRange.h: 17110 (JSC::SourceCode::isNull): Added to help with ASSERTs. 17111 17112 * kjs/collector.cpp: 17113 (JSC::Heap::heapAllocate): 17114 (JSC::Heap::sweep): 17115 (JSC::Heap::primaryHeapBegin): 17116 (JSC::Heap::primaryHeapEnd): 17117 * kjs/collector.h: 17118 (JSC::): Moved a bunch of declarations around to enable compilation of 17119 CollectorHeapIterator. 17120 17121 * kjs/interpreter.cpp: 17122 (JSC::Interpreter::checkSyntax): 17123 (JSC::Interpreter::evaluate): Updated for tweak to parsing API. 17124 17125 * kjs/lexer.h: 17126 (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative 17127 to the SourceCode range in which we're lexing, otherwise nested functions 17128 that are compiled individually get SourceCode ranges that don't reflect 17129 their nesting. 17130 17131 * kjs/nodes.cpp: 17132 (JSC::FunctionBodyNode::FunctionBodyNode): 17133 (JSC::FunctionBodyNode::finishParsing): 17134 (JSC::FunctionBodyNode::create): 17135 (JSC::FunctionBodyNode::copyParameters): 17136 * kjs/nodes.h: 17137 (JSC::ScopeNode::setSource): 17138 (JSC::FunctionBodyNode::parameterCount): Added some helper functions for 17139 copying one FunctionBodyNode's parameters to another. The recompiler uses 17140 these when calling "finishParsing". 17141 171422008-10-15 Joerg Bornemann <joerg.bornemann@trolltech.com> 17143 17144 Reviewed by Darin Adler. 17145 17146 - part of https://bugs.webkit.org/show_bug.cgi?id=20746 17147 Fix compilation on Windows CE. 17148 17149 str(n)icmp, strdup and vsnprintf are not available on Windows CE, 17150 they are called _str(n)icmp, etc. instead 17151 17152 * wtf/StringExtras.h: Added inline function implementations. 17153 171542008-10-15 Gabor Loki <loki@inf.u-szeged.hu> 17155 17156 Reviewed by Cameron Zwarich. 17157 17158 <https://bugs.webkit.org/show_bug.cgi?id=20912> 17159 Use simple uint32_t multiplication on op_mul if both operands are 17160 immediate number and they are between zero and 0x7FFF. 17161 17162 * VM/Machine.cpp: 17163 (JSC::Machine::privateExecute): 17164 171652008-10-09 Darin Fisher <darin@chromium.org> 17166 17167 Reviewed by Sam Weinig. 17168 17169 Make pan scrolling a platform configurable option. 17170 https://bugs.webkit.org/show_bug.cgi?id=21515 17171 17172 * wtf/Platform.h: Add ENABLE_PAN_SCROLLING 17173 171742008-10-14 Maciej Stachowiak <mjs@apple.com> 17175 17176 Rubber stamped by Sam Weinig. 17177 17178 - revert r37572 and r37581 for now 17179 17180 Turns out GCC 4.2 is still a (small) regression, we'll have to do 17181 more work to turn it on. 17182 17183 * Configurations/DebugRelease.xcconfig: 17184 * JavaScriptCore.xcodeproj/project.pbxproj: 17185 * VM/CTI.cpp: 17186 * VM/CTI.h: 17187 * VM/Machine.cpp: 17188 (JSC::Machine::cti_op_convert_this): 17189 (JSC::Machine::cti_op_end): 17190 (JSC::Machine::cti_op_add): 17191 (JSC::Machine::cti_op_pre_inc): 17192 (JSC::Machine::cti_timeout_check): 17193 (JSC::Machine::cti_register_file_check): 17194 (JSC::Machine::cti_op_loop_if_less): 17195 (JSC::Machine::cti_op_loop_if_lesseq): 17196 (JSC::Machine::cti_op_new_object): 17197 (JSC::Machine::cti_op_put_by_id): 17198 (JSC::Machine::cti_op_put_by_id_second): 17199 (JSC::Machine::cti_op_put_by_id_generic): 17200 (JSC::Machine::cti_op_put_by_id_fail): 17201 (JSC::Machine::cti_op_get_by_id): 17202 (JSC::Machine::cti_op_get_by_id_second): 17203 (JSC::Machine::cti_op_get_by_id_generic): 17204 (JSC::Machine::cti_op_get_by_id_fail): 17205 (JSC::Machine::cti_op_instanceof): 17206 (JSC::Machine::cti_op_del_by_id): 17207 (JSC::Machine::cti_op_mul): 17208 (JSC::Machine::cti_op_new_func): 17209 (JSC::Machine::cti_op_call_JSFunction): 17210 (JSC::Machine::cti_vm_compile): 17211 (JSC::Machine::cti_op_push_activation): 17212 (JSC::Machine::cti_op_call_NotJSFunction): 17213 (JSC::Machine::cti_op_create_arguments): 17214 (JSC::Machine::cti_op_tear_off_activation): 17215 (JSC::Machine::cti_op_tear_off_arguments): 17216 (JSC::Machine::cti_op_ret_profiler): 17217 (JSC::Machine::cti_op_ret_scopeChain): 17218 (JSC::Machine::cti_op_new_array): 17219 (JSC::Machine::cti_op_resolve): 17220 (JSC::Machine::cti_op_construct_JSConstruct): 17221 (JSC::Machine::cti_op_construct_NotJSConstruct): 17222 (JSC::Machine::cti_op_get_by_val): 17223 (JSC::Machine::cti_op_resolve_func): 17224 (JSC::Machine::cti_op_sub): 17225 (JSC::Machine::cti_op_put_by_val): 17226 (JSC::Machine::cti_op_put_by_val_array): 17227 (JSC::Machine::cti_op_lesseq): 17228 (JSC::Machine::cti_op_loop_if_true): 17229 (JSC::Machine::cti_op_negate): 17230 (JSC::Machine::cti_op_resolve_base): 17231 (JSC::Machine::cti_op_resolve_skip): 17232 (JSC::Machine::cti_op_resolve_global): 17233 (JSC::Machine::cti_op_div): 17234 (JSC::Machine::cti_op_pre_dec): 17235 (JSC::Machine::cti_op_jless): 17236 (JSC::Machine::cti_op_not): 17237 (JSC::Machine::cti_op_jtrue): 17238 (JSC::Machine::cti_op_post_inc): 17239 (JSC::Machine::cti_op_eq): 17240 (JSC::Machine::cti_op_lshift): 17241 (JSC::Machine::cti_op_bitand): 17242 (JSC::Machine::cti_op_rshift): 17243 (JSC::Machine::cti_op_bitnot): 17244 (JSC::Machine::cti_op_resolve_with_base): 17245 (JSC::Machine::cti_op_new_func_exp): 17246 (JSC::Machine::cti_op_mod): 17247 (JSC::Machine::cti_op_less): 17248 (JSC::Machine::cti_op_neq): 17249 (JSC::Machine::cti_op_post_dec): 17250 (JSC::Machine::cti_op_urshift): 17251 (JSC::Machine::cti_op_bitxor): 17252 (JSC::Machine::cti_op_new_regexp): 17253 (JSC::Machine::cti_op_bitor): 17254 (JSC::Machine::cti_op_call_eval): 17255 (JSC::Machine::cti_op_throw): 17256 (JSC::Machine::cti_op_get_pnames): 17257 (JSC::Machine::cti_op_next_pname): 17258 (JSC::Machine::cti_op_push_scope): 17259 (JSC::Machine::cti_op_pop_scope): 17260 (JSC::Machine::cti_op_typeof): 17261 (JSC::Machine::cti_op_is_undefined): 17262 (JSC::Machine::cti_op_is_boolean): 17263 (JSC::Machine::cti_op_is_number): 17264 (JSC::Machine::cti_op_is_string): 17265 (JSC::Machine::cti_op_is_object): 17266 (JSC::Machine::cti_op_is_function): 17267 (JSC::Machine::cti_op_stricteq): 17268 (JSC::Machine::cti_op_nstricteq): 17269 (JSC::Machine::cti_op_to_jsnumber): 17270 (JSC::Machine::cti_op_in): 17271 (JSC::Machine::cti_op_push_new_scope): 17272 (JSC::Machine::cti_op_jmp_scopes): 17273 (JSC::Machine::cti_op_put_by_index): 17274 (JSC::Machine::cti_op_switch_imm): 17275 (JSC::Machine::cti_op_switch_char): 17276 (JSC::Machine::cti_op_switch_string): 17277 (JSC::Machine::cti_op_del_by_val): 17278 (JSC::Machine::cti_op_put_getter): 17279 (JSC::Machine::cti_op_put_setter): 17280 (JSC::Machine::cti_op_new_error): 17281 (JSC::Machine::cti_op_debug): 17282 (JSC::Machine::cti_vm_throw): 17283 * VM/Machine.h: 17284 * masm/X86Assembler.h: 17285 (JSC::X86Assembler::emitRestoreArgumentReference): 17286 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline): 17287 * wtf/Platform.h: 17288 172892008-10-14 Alexey Proskuryakov <ap@webkit.org> 17290 17291 Reviewed by Darin Adler. 17292 17293 https://bugs.webkit.org/show_bug.cgi?id=20256 17294 Array.push and other standard methods disappear 17295 17296 * kjs/JSGlobalData.cpp: 17297 (JSC::JSGlobalData::JSGlobalData): 17298 (JSC::JSGlobalData::~JSGlobalData): 17299 Don't use static hash tables even on platforms that don't enable JSC_MULTIPLE_THREADS - 17300 these tables reference IdentifierTable, which is always per-GlobalData. 17301 173022008-10-14 Maciej Stachowiak <mjs@apple.com> 17303 17304 Reviewed by Cameron Zwarich. 17305 17306 - always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL 17307 17308 This is a small regression for GCC 4.0, but simplifies the code 17309 for future improvements and lets us focus on GCC 4.2+ and MSVC. 17310 17311 * VM/CTI.cpp: 17312 * VM/CTI.h: 17313 * VM/Machine.cpp: 17314 (JSC::Machine::cti_op_convert_this): 17315 (JSC::Machine::cti_op_end): 17316 (JSC::Machine::cti_op_add): 17317 (JSC::Machine::cti_op_pre_inc): 17318 (JSC::Machine::cti_timeout_check): 17319 (JSC::Machine::cti_register_file_check): 17320 (JSC::Machine::cti_op_loop_if_less): 17321 (JSC::Machine::cti_op_loop_if_lesseq): 17322 (JSC::Machine::cti_op_new_object): 17323 (JSC::Machine::cti_op_put_by_id): 17324 (JSC::Machine::cti_op_put_by_id_second): 17325 (JSC::Machine::cti_op_put_by_id_generic): 17326 (JSC::Machine::cti_op_put_by_id_fail): 17327 (JSC::Machine::cti_op_get_by_id): 17328 (JSC::Machine::cti_op_get_by_id_second): 17329 (JSC::Machine::cti_op_get_by_id_generic): 17330 (JSC::Machine::cti_op_get_by_id_fail): 17331 (JSC::Machine::cti_op_instanceof): 17332 (JSC::Machine::cti_op_del_by_id): 17333 (JSC::Machine::cti_op_mul): 17334 (JSC::Machine::cti_op_new_func): 17335 (JSC::Machine::cti_op_call_JSFunction): 17336 (JSC::Machine::cti_vm_compile): 17337 (JSC::Machine::cti_op_push_activation): 17338 (JSC::Machine::cti_op_call_NotJSFunction): 17339 (JSC::Machine::cti_op_create_arguments): 17340 (JSC::Machine::cti_op_tear_off_activation): 17341 (JSC::Machine::cti_op_tear_off_arguments): 17342 (JSC::Machine::cti_op_ret_profiler): 17343 (JSC::Machine::cti_op_ret_scopeChain): 17344 (JSC::Machine::cti_op_new_array): 17345 (JSC::Machine::cti_op_resolve): 17346 (JSC::Machine::cti_op_construct_JSConstruct): 17347 (JSC::Machine::cti_op_construct_NotJSConstruct): 17348 (JSC::Machine::cti_op_get_by_val): 17349 (JSC::Machine::cti_op_resolve_func): 17350 (JSC::Machine::cti_op_sub): 17351 (JSC::Machine::cti_op_put_by_val): 17352 (JSC::Machine::cti_op_put_by_val_array): 17353 (JSC::Machine::cti_op_lesseq): 17354 (JSC::Machine::cti_op_loop_if_true): 17355 (JSC::Machine::cti_op_negate): 17356 (JSC::Machine::cti_op_resolve_base): 17357 (JSC::Machine::cti_op_resolve_skip): 17358 (JSC::Machine::cti_op_resolve_global): 17359 (JSC::Machine::cti_op_div): 17360 (JSC::Machine::cti_op_pre_dec): 17361 (JSC::Machine::cti_op_jless): 17362 (JSC::Machine::cti_op_not): 17363 (JSC::Machine::cti_op_jtrue): 17364 (JSC::Machine::cti_op_post_inc): 17365 (JSC::Machine::cti_op_eq): 17366 (JSC::Machine::cti_op_lshift): 17367 (JSC::Machine::cti_op_bitand): 17368 (JSC::Machine::cti_op_rshift): 17369 (JSC::Machine::cti_op_bitnot): 17370 (JSC::Machine::cti_op_resolve_with_base): 17371 (JSC::Machine::cti_op_new_func_exp): 17372 (JSC::Machine::cti_op_mod): 17373 (JSC::Machine::cti_op_less): 17374 (JSC::Machine::cti_op_neq): 17375 (JSC::Machine::cti_op_post_dec): 17376 (JSC::Machine::cti_op_urshift): 17377 (JSC::Machine::cti_op_bitxor): 17378 (JSC::Machine::cti_op_new_regexp): 17379 (JSC::Machine::cti_op_bitor): 17380 (JSC::Machine::cti_op_call_eval): 17381 (JSC::Machine::cti_op_throw): 17382 (JSC::Machine::cti_op_get_pnames): 17383 (JSC::Machine::cti_op_next_pname): 17384 (JSC::Machine::cti_op_push_scope): 17385 (JSC::Machine::cti_op_pop_scope): 17386 (JSC::Machine::cti_op_typeof): 17387 (JSC::Machine::cti_op_is_undefined): 17388 (JSC::Machine::cti_op_is_boolean): 17389 (JSC::Machine::cti_op_is_number): 17390 (JSC::Machine::cti_op_is_string): 17391 (JSC::Machine::cti_op_is_object): 17392 (JSC::Machine::cti_op_is_function): 17393 (JSC::Machine::cti_op_stricteq): 17394 (JSC::Machine::cti_op_nstricteq): 17395 (JSC::Machine::cti_op_to_jsnumber): 17396 (JSC::Machine::cti_op_in): 17397 (JSC::Machine::cti_op_push_new_scope): 17398 (JSC::Machine::cti_op_jmp_scopes): 17399 (JSC::Machine::cti_op_put_by_index): 17400 (JSC::Machine::cti_op_switch_imm): 17401 (JSC::Machine::cti_op_switch_char): 17402 (JSC::Machine::cti_op_switch_string): 17403 (JSC::Machine::cti_op_del_by_val): 17404 (JSC::Machine::cti_op_put_getter): 17405 (JSC::Machine::cti_op_put_setter): 17406 (JSC::Machine::cti_op_new_error): 17407 (JSC::Machine::cti_op_debug): 17408 (JSC::Machine::cti_vm_throw): 17409 * VM/Machine.h: 17410 * masm/X86Assembler.h: 17411 (JSC::X86Assembler::emitRestoreArgumentReference): 17412 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline): 17413 * wtf/Platform.h: 17414 174152008-10-13 Maciej Stachowiak <mjs@apple.com> 17416 17417 Reviewed by Cameron Zwarich. 17418 17419 - make Machine::getArgumentsData an Arguments method and inline it 17420 17421 ~2% on v8 raytrace 17422 17423 * VM/Machine.cpp: 17424 * kjs/Arguments.h: 17425 (JSC::Machine::getArgumentsData): 17426 174272008-10-13 Alp Toker <alp@nuanti.com> 17428 17429 Fix autotools dist build target by listing recently added header 17430 files only. Not reviewed. 17431 17432 * GNUmakefile.am: 17433 174342008-10-13 Maciej Stachowiak <mjs@apple.com> 17435 17436 Rubber stamped by Mark Rowe. 17437 17438 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0 17439 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default 17440 17441 * Configurations/DebugRelease.xcconfig: 17442 * JavaScriptCore.xcodeproj/project.pbxproj: 17443 174442008-10-13 Cameron Zwarich <zwarich@apple.com> 17445 17446 Reviewed by Geoff Garen. 17447 17448 Bug 21541: Move RegisterFile growth check to callee 17449 <https://bugs.webkit.org/show_bug.cgi?id=21541> 17450 17451 Move the RegisterFile growth check to the callee in the common case, 17452 where some of the information is known statically at JIT time. There is 17453 still a check in the caller in the case where the caller provides too 17454 few arguments. 17455 17456 This is a 2.1% speedup on the V8 benchmark, including a 5.1% speedup on 17457 the Richards benchmark, a 4.1% speedup on the DeltaBlue benchmark, and a 17458 1.4% speedup on the Earley-Boyer benchmark. It is also a 0.5% speedup on 17459 SunSpider. 17460 17461 * VM/CTI.cpp: 17462 (JSC::CTI::privateCompile): 17463 * VM/Machine.cpp: 17464 (JSC::Machine::cti_register_file_check): 17465 (JSC::Machine::cti_op_call_JSFunction): 17466 (JSC::Machine::cti_op_construct_JSConstruct): 17467 * VM/Machine.h: 17468 * VM/RegisterFile.h: 17469 * masm/X86Assembler.h: 17470 (JSC::X86Assembler::): 17471 (JSC::X86Assembler::cmpl_mr): 17472 (JSC::X86Assembler::emitUnlinkedJg): 17473 174742008-10-13 Sam Weinig <sam@webkit.org> 17475 17476 Reviewed by Dan Bernstein. 17477 17478 Fix for https://bugs.webkit.org/show_bug.cgi?id=21577 17479 5 false positive StructureID leaks 17480 17481 - Add leak ignore set to StructureID to selectively ignore leaking some StructureIDs. 17482 - Add create method to JSGlolalData to be used when the data will be intentionally 17483 leaked and ignore all leaks caused the StructureIDs stored in it. 17484 17485 * JavaScriptCore.exp: 17486 * kjs/JSGlobalData.cpp: 17487 (JSC::JSGlobalData::createLeaked): 17488 * kjs/JSGlobalData.h: 17489 * kjs/StructureID.cpp: 17490 (JSC::StructureID::StructureID): 17491 (JSC::StructureID::~StructureID): 17492 (JSC::StructureID::startIgnoringLeaks): 17493 (JSC::StructureID::stopIgnoringLeaks): 17494 * kjs/StructureID.h: 17495 174962008-10-13 Marco Barisione <marco.barisione@collabora.co.uk> 17497 17498 Reviewed by Darin Adler. Landed by Jan Alonzo. 17499 17500 WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?) 17501 http://bugs.webkit.org/show_bug.cgi?id=20483 17502 17503 Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory 17504 allocated by GLib and start the conversion to use it. 17505 17506 * GNUmakefile.am: 17507 * wtf/GOwnPtr.cpp: Added. 17508 (WTF::GError): 17509 (WTF::GList): 17510 (WTF::GCond): 17511 (WTF::GMutex): 17512 (WTF::GPatternSpec): 17513 (WTF::GDir): 17514 * wtf/GOwnPtr.h: Added. 17515 (WTF::freeOwnedPtr): 17516 (WTF::GOwnPtr::GOwnPtr): 17517 (WTF::GOwnPtr::~GOwnPtr): 17518 (WTF::GOwnPtr::get): 17519 (WTF::GOwnPtr::release): 17520 (WTF::GOwnPtr::rawPtr): 17521 (WTF::GOwnPtr::set): 17522 (WTF::GOwnPtr::clear): 17523 (WTF::GOwnPtr::operator*): 17524 (WTF::GOwnPtr::operator->): 17525 (WTF::GOwnPtr::operator!): 17526 (WTF::GOwnPtr::operator UnspecifiedBoolType): 17527 (WTF::GOwnPtr::swap): 17528 (WTF::swap): 17529 (WTF::operator==): 17530 (WTF::operator!=): 17531 (WTF::getPtr): 17532 * wtf/Threading.h: 17533 * wtf/ThreadingGtk.cpp: 17534 (WTF::Mutex::~Mutex): 17535 (WTF::Mutex::lock): 17536 (WTF::Mutex::tryLock): 17537 (WTF::Mutex::unlock): 17538 (WTF::ThreadCondition::~ThreadCondition): 17539 (WTF::ThreadCondition::wait): 17540 (WTF::ThreadCondition::timedWait): 17541 (WTF::ThreadCondition::signal): 17542 (WTF::ThreadCondition::broadcast): 17543 175442008-10-12 Gabriella Toth <gtoth@inf.u-szeged.hu> 17545 17546 Reviewed by Darin Adler. 17547 17548 - part of https://bugs.webkit.org/show_bug.cgi?id=21055 17549 Bug 21055: not invoked functions 17550 17551 * kjs/nodes.cpp: Deleted a function that is not invoked: 17552 statementListInitializeVariableAccessStack. 17553 175542008-10-12 Darin Adler <darin@apple.com> 17555 17556 Reviewed by Sam Weinig. 17557 17558 * wtf/unicode/icu/UnicodeIcu.h: Fixed indentation to match WebKit coding style. 17559 * wtf/unicode/qt4/UnicodeQt4.h: Ditto. 17560 175612008-10-12 Darin Adler <darin@apple.com> 17562 17563 Reviewed by Sam Weinig. 17564 17565 - https://bugs.webkit.org/show_bug.cgi?id=21556 17566 Bug 21556: non-ASCII digits are allowed in places where only ASCII should be 17567 17568 * wtf/unicode/icu/UnicodeIcu.h: Removed isDigit, digitValue, and isFormatChar. 17569 * wtf/unicode/qt4/UnicodeQt4.h: Ditto. 17570 175712008-10-12 Anders Carlsson <andersca@apple.com> 17572 17573 Reviewed by Darin Adler. 17574 17575 Make the append method that takes a Vector more strict - it now requires the elements 17576 of the vector to be appended same type as the elements of the Vector they're being appended to. 17577 17578 This would cause problems when dealing with Vectors containing other Vectors. 17579 17580 * wtf/Vector.h: 17581 (WTF::::append): 17582 175832008-10-11 Cameron Zwarich <zwarich@apple.com> 17584 17585 Reviewed by Sam Weinig. 17586 17587 Clean up RegExpMatchesArray.h to match our coding style. 17588 17589 * kjs/RegExpMatchesArray.h: 17590 (JSC::RegExpMatchesArray::getOwnPropertySlot): 17591 (JSC::RegExpMatchesArray::put): 17592 (JSC::RegExpMatchesArray::deleteProperty): 17593 (JSC::RegExpMatchesArray::getPropertyNames): 17594 175952008-10-11 Cameron Zwarich <zwarich@apple.com> 17596 17597 Reviewed by Sam Weinig. 17598 17599 Bug 21525: 55 StructureID leaks on Wikitravel's main page 17600 <https://bugs.webkit.org/show_bug.cgi?id=21525> 17601 17602 Bug 21533: Simple JavaScript code leaks StructureIDs 17603 <https://bugs.webkit.org/show_bug.cgi?id=21533> 17604 17605 StructureID::getEnumerablePropertyNames() ends up calling back to itself 17606 via JSObject::getPropertyNames(), which causes the PropertyNameArray to 17607 be cached twice. This leads to a memory leak in almost every use of 17608 JSObject::getPropertyNames() on an object. The fix here is based on a 17609 suggestion of Sam Weinig. 17610 17611 This patch also fixes every StructureID leaks that occurs while running 17612 the Mozilla MemBuster test. 17613 17614 * kjs/PropertyNameArray.h: 17615 (JSC::PropertyNameArray::PropertyNameArray): 17616 (JSC::PropertyNameArray::setCacheable): 17617 (JSC::PropertyNameArray::cacheable): 17618 * kjs/StructureID.cpp: 17619 (JSC::StructureID::getEnumerablePropertyNames): 17620 176212008-10-10 Oliver Hunt <oliver@apple.com> 17622 17623 Reviewed by Cameron Zwarich. 17624 17625 Use fastcall calling convention on GCC > 4.0 17626 17627 Results in a 2-3% improvement in GCC 4.2 performance, so 17628 that it is no longer a regression vs. GCC 4.0 17629 17630 * VM/CTI.cpp: 17631 * VM/Machine.h: 17632 * wtf/Platform.h: 17633 176342008-10-10 Sam Weinig <sam@webkit.org> 17635 17636 Reviewed by Darin Adler. 17637 17638 - Add a workaround for a bug in ceil in Darwin libc. 17639 - Remove old workarounds for JS math functions that are not needed 17640 anymore. 17641 17642 The math functions are heavily tested by fast/js/math.html. 17643 17644 * kjs/MathObject.cpp: 17645 (JSC::mathProtoFuncAbs): Remove workaround. 17646 (JSC::mathProtoFuncCeil): Ditto. 17647 (JSC::mathProtoFuncFloor): Ditto. 17648 * wtf/MathExtras.h: 17649 (wtf_ceil): Add ceil workaround for darwin. 17650 176512008-10-10 Sam Weinig <sam@webkit.org> 17652 17653 Reviewed by Darin Adler 17654 17655 Add Assertions to JSObject constructor. 17656 17657 * kjs/JSObject.h: 17658 (JSC::JSObject::JSObject): 17659 176602008-10-10 Sam Weinig <sam@webkit.org> 17661 17662 Reviewed by Cameron Zwarich. 17663 17664 Remove now unused m_getterSetterFlag variable from PropertyMap. 17665 17666 * kjs/PropertyMap.cpp: 17667 (JSC::PropertyMap::operator=): 17668 * kjs/PropertyMap.h: 17669 (JSC::PropertyMap::PropertyMap): 17670 176712008-10-09 Sam Weinig <sam@webkit.org> 17672 17673 Reviewed by Maciej Stachowiak. 17674 17675 Add leaks checking to StructureID. 17676 17677 * kjs/StructureID.cpp: 17678 (JSC::StructureID::StructureID): 17679 (JSC::StructureID::~StructureID): 17680 176812008-10-09 Alp Toker <alp@nuanti.com> 17682 17683 Reviewed by Mark Rowe. 17684 17685 https://bugs.webkit.org/show_bug.cgi?id=20760 17686 Implement support for x86 Linux in CTI 17687 17688 Prepare to enable CTI/WREC on supported architectures. 17689 17690 Make it possible to use the CTI_ARGUMENT workaround with GCC as well 17691 as MSVC by fixing some preprocessor conditionals. 17692 17693 Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we 17694 don't actually enable it except when building with MSVC. GCC on Win32 17695 remains untested. 17696 17697 Adapt inline ASM code to use the global symbol underscore prefix only 17698 on Darwin and to call the properly mangled Machine::cti_vm_throw 17699 symbol name depending on CTI_ARGUMENT. 17700 17701 Also avoid global inclusion of the JIT infrastructure headers 17702 throughout WebCore and WebKit causing recompilation of about ~1500 17703 source files after modification to X86Assembler.h, CTI.h, WREC.h, 17704 which are only used deep inside JavaScriptCore. 17705 17706 * GNUmakefile.am: 17707 * VM/CTI.cpp: 17708 * VM/CTI.h: 17709 * VM/Machine.cpp: 17710 * VM/Machine.h: 17711 * kjs/regexp.cpp: 17712 (JSC::RegExp::RegExp): 17713 (JSC::RegExp::~RegExp): 17714 (JSC::RegExp::match): 17715 * kjs/regexp.h: 17716 * masm/X86Assembler.h: 17717 (JSC::X86Assembler::emitConvertToFastCall): 17718 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline): 17719 (JSC::X86Assembler::emitRestoreArgumentReference): 17720 177212008-10-09 Gavin Barraclough <barraclough@apple.com> 17722 17723 Reviewed by Cameron Zwarich. 17724 17725 Fix for bug #21160, x=0;1/(x*-1) == -Infinity 17726 17727 * ChangeLog: 17728 * VM/CTI.cpp: 17729 (JSC::CTI::emitFastArithDeTagImmediate): 17730 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero): 17731 (JSC::CTI::compileBinaryArithOp): 17732 (JSC::CTI::compileBinaryArithOpSlowCase): 17733 (JSC::CTI::privateCompileMainPass): 17734 (JSC::CTI::privateCompileSlowCases): 17735 * VM/CTI.h: 17736 * masm/X86Assembler.h: 17737 (JSC::X86Assembler::): 17738 (JSC::X86Assembler::emitUnlinkedJs): 17739 177402008-10-09 Cameron Zwarich <zwarich@apple.com> 17741 17742 Reviewed by Oliver Hunt. 17743 17744 Bug 21459: REGRESSION (r37324): Safari crashes inside JavaScriptCore while browsing hulu.com 17745 <https://bugs.webkit.org/show_bug.cgi?id=21459> 17746 17747 After r37324, an Arguments object does not mark an associated activation 17748 object. This change was made because Arguments no longer directly used 17749 the activation object in any way. However, if an activation is torn off, 17750 then the backing store of Arguments becomes the register array of the 17751 activation object. Arguments directly marks all of the arguments, but 17752 the activation object is being collected, which causes its register 17753 array to be freed and new memory to be allocated in its place. 17754 17755 Unfortunately, it does not seem possible to reproduce this issue in a 17756 layout test. 17757 17758 * kjs/Arguments.cpp: 17759 (JSC::Arguments::mark): 17760 * kjs/Arguments.h: 17761 (JSC::Arguments::setActivation): 17762 (JSC::Arguments::Arguments): 17763 (JSC::JSActivation::copyRegisters): 17764 177652008-10-09 Ariya Hidayat <ariya.hidayat@trolltech.com> 17766 17767 Reviewed by Simon. 17768 17769 Build fix for MinGW. 17770 17771 * wtf/AlwaysInline.h: 17772 177732008-10-08 Cameron Zwarich <zwarich@apple.com> 17774 17775 Reviewed by Maciej Stachowiak. 17776 17777 Bug 21497: REGRESSION (r37433): Bytecode JSC tests are severely broken 17778 <https://bugs.webkit.org/show_bug.cgi?id=21497> 17779 17780 Fix a typo in r37433 that causes the failure of a large number of JSC 17781 tests with the bytecode interpreter enabled. 17782 17783 * VM/Machine.cpp: 17784 (JSC::Machine::privateExecute): 17785 177862008-10-08 Mark Rowe <mrowe@apple.com> 17787 17788 Windows build fix. 17789 17790 * VM/CTI.cpp: 17791 (JSC::): Update type of argument to ctiTrampoline. 17792 177932008-10-08 Darin Adler <darin@apple.com> 17794 17795 Reviewed by Cameron Zwarich. 17796 17797 - https://bugs.webkit.org/show_bug.cgi?id=21403 17798 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation 17799 17800 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every 17801 client over to the new name. 17802 17803 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such 17804 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use 17805 accessor functions to get at things in the frame. 17806 17807 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with 17808 JSGlobalData* and in other cases eliminating them entirely. 17809 17810 * API/JSObjectRef.cpp: 17811 (JSObjectMakeFunctionWithCallback): 17812 (JSObjectMakeFunction): 17813 (JSObjectHasProperty): 17814 (JSObjectGetProperty): 17815 (JSObjectSetProperty): 17816 (JSObjectDeleteProperty): 17817 * API/OpaqueJSString.cpp: 17818 * API/OpaqueJSString.h: 17819 * VM/CTI.cpp: 17820 (JSC::CTI::getConstant): 17821 (JSC::CTI::emitGetArg): 17822 (JSC::CTI::emitGetPutArg): 17823 (JSC::CTI::getConstantImmediateNumericArg): 17824 (JSC::CTI::printOpcodeOperandTypes): 17825 (JSC::CTI::CTI): 17826 (JSC::CTI::compileOpCall): 17827 (JSC::CTI::compileBinaryArithOp): 17828 (JSC::CTI::privateCompileMainPass): 17829 (JSC::CTI::privateCompile): 17830 (JSC::CTI::privateCompileGetByIdProto): 17831 (JSC::CTI::privateCompileGetByIdChain): 17832 (JSC::CTI::compileRegExp): 17833 * VM/CTI.h: 17834 * VM/CodeBlock.h: 17835 * VM/CodeGenerator.cpp: 17836 (JSC::CodeGenerator::emitEqualityOp): 17837 (JSC::CodeGenerator::emitLoad): 17838 (JSC::CodeGenerator::emitUnexpectedLoad): 17839 (JSC::CodeGenerator::emitConstruct): 17840 * VM/CodeGenerator.h: 17841 * VM/Machine.cpp: 17842 (JSC::jsLess): 17843 (JSC::jsLessEq): 17844 (JSC::jsAddSlowCase): 17845 (JSC::jsAdd): 17846 (JSC::jsTypeStringForValue): 17847 (JSC::Machine::resolve): 17848 (JSC::Machine::resolveSkip): 17849 (JSC::Machine::resolveGlobal): 17850 (JSC::inlineResolveBase): 17851 (JSC::Machine::resolveBase): 17852 (JSC::Machine::resolveBaseAndProperty): 17853 (JSC::Machine::resolveBaseAndFunc): 17854 (JSC::Machine::slideRegisterWindowForCall): 17855 (JSC::isNotObject): 17856 (JSC::Machine::callEval): 17857 (JSC::Machine::dumpCallFrame): 17858 (JSC::Machine::dumpRegisters): 17859 (JSC::Machine::unwindCallFrame): 17860 (JSC::Machine::throwException): 17861 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): 17862 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope): 17863 (JSC::Machine::execute): 17864 (JSC::Machine::debug): 17865 (JSC::Machine::createExceptionScope): 17866 (JSC::cachePrototypeChain): 17867 (JSC::Machine::tryCachePutByID): 17868 (JSC::Machine::tryCacheGetByID): 17869 (JSC::Machine::privateExecute): 17870 (JSC::Machine::retrieveArguments): 17871 (JSC::Machine::retrieveCaller): 17872 (JSC::Machine::retrieveLastCaller): 17873 (JSC::Machine::findFunctionCallFrame): 17874 (JSC::Machine::getArgumentsData): 17875 (JSC::Machine::tryCTICachePutByID): 17876 (JSC::Machine::getCTIArrayLengthTrampoline): 17877 (JSC::Machine::getCTIStringLengthTrampoline): 17878 (JSC::Machine::tryCTICacheGetByID): 17879 (JSC::Machine::cti_op_convert_this): 17880 (JSC::Machine::cti_op_end): 17881 (JSC::Machine::cti_op_add): 17882 (JSC::Machine::cti_op_pre_inc): 17883 (JSC::Machine::cti_timeout_check): 17884 (JSC::Machine::cti_op_loop_if_less): 17885 (JSC::Machine::cti_op_loop_if_lesseq): 17886 (JSC::Machine::cti_op_new_object): 17887 (JSC::Machine::cti_op_put_by_id): 17888 (JSC::Machine::cti_op_put_by_id_second): 17889 (JSC::Machine::cti_op_put_by_id_generic): 17890 (JSC::Machine::cti_op_put_by_id_fail): 17891 (JSC::Machine::cti_op_get_by_id): 17892 (JSC::Machine::cti_op_get_by_id_second): 17893 (JSC::Machine::cti_op_get_by_id_generic): 17894 (JSC::Machine::cti_op_get_by_id_fail): 17895 (JSC::Machine::cti_op_instanceof): 17896 (JSC::Machine::cti_op_del_by_id): 17897 (JSC::Machine::cti_op_mul): 17898 (JSC::Machine::cti_op_new_func): 17899 (JSC::Machine::cti_op_call_JSFunction): 17900 (JSC::Machine::cti_vm_compile): 17901 (JSC::Machine::cti_op_push_activation): 17902 (JSC::Machine::cti_op_call_NotJSFunction): 17903 (JSC::Machine::cti_op_create_arguments): 17904 (JSC::Machine::cti_op_tear_off_activation): 17905 (JSC::Machine::cti_op_tear_off_arguments): 17906 (JSC::Machine::cti_op_ret_profiler): 17907 (JSC::Machine::cti_op_ret_scopeChain): 17908 (JSC::Machine::cti_op_new_array): 17909 (JSC::Machine::cti_op_resolve): 17910 (JSC::Machine::cti_op_construct_JSConstruct): 17911 (JSC::Machine::cti_op_construct_NotJSConstruct): 17912 (JSC::Machine::cti_op_get_by_val): 17913 (JSC::Machine::cti_op_resolve_func): 17914 (JSC::Machine::cti_op_sub): 17915 (JSC::Machine::cti_op_put_by_val): 17916 (JSC::Machine::cti_op_put_by_val_array): 17917 (JSC::Machine::cti_op_lesseq): 17918 (JSC::Machine::cti_op_loop_if_true): 17919 (JSC::Machine::cti_op_negate): 17920 (JSC::Machine::cti_op_resolve_base): 17921 (JSC::Machine::cti_op_resolve_skip): 17922 (JSC::Machine::cti_op_resolve_global): 17923 (JSC::Machine::cti_op_div): 17924 (JSC::Machine::cti_op_pre_dec): 17925 (JSC::Machine::cti_op_jless): 17926 (JSC::Machine::cti_op_not): 17927 (JSC::Machine::cti_op_jtrue): 17928 (JSC::Machine::cti_op_post_inc): 17929 (JSC::Machine::cti_op_eq): 17930 (JSC::Machine::cti_op_lshift): 17931 (JSC::Machine::cti_op_bitand): 17932 (JSC::Machine::cti_op_rshift): 17933 (JSC::Machine::cti_op_bitnot): 17934 (JSC::Machine::cti_op_resolve_with_base): 17935 (JSC::Machine::cti_op_new_func_exp): 17936 (JSC::Machine::cti_op_mod): 17937 (JSC::Machine::cti_op_less): 17938 (JSC::Machine::cti_op_neq): 17939 (JSC::Machine::cti_op_post_dec): 17940 (JSC::Machine::cti_op_urshift): 17941 (JSC::Machine::cti_op_bitxor): 17942 (JSC::Machine::cti_op_new_regexp): 17943 (JSC::Machine::cti_op_bitor): 17944 (JSC::Machine::cti_op_call_eval): 17945 (JSC::Machine::cti_op_throw): 17946 (JSC::Machine::cti_op_get_pnames): 17947 (JSC::Machine::cti_op_next_pname): 17948 (JSC::Machine::cti_op_push_scope): 17949 (JSC::Machine::cti_op_pop_scope): 17950 (JSC::Machine::cti_op_typeof): 17951 (JSC::Machine::cti_op_to_jsnumber): 17952 (JSC::Machine::cti_op_in): 17953 (JSC::Machine::cti_op_push_new_scope): 17954 (JSC::Machine::cti_op_jmp_scopes): 17955 (JSC::Machine::cti_op_put_by_index): 17956 (JSC::Machine::cti_op_switch_imm): 17957 (JSC::Machine::cti_op_switch_char): 17958 (JSC::Machine::cti_op_switch_string): 17959 (JSC::Machine::cti_op_del_by_val): 17960 (JSC::Machine::cti_op_put_getter): 17961 (JSC::Machine::cti_op_put_setter): 17962 (JSC::Machine::cti_op_new_error): 17963 (JSC::Machine::cti_op_debug): 17964 (JSC::Machine::cti_vm_throw): 17965 * VM/Machine.h: 17966 * VM/Register.h: 17967 * VM/RegisterFile.h: 17968 * kjs/Arguments.h: 17969 * kjs/DebuggerCallFrame.cpp: 17970 (JSC::DebuggerCallFrame::functionName): 17971 (JSC::DebuggerCallFrame::type): 17972 (JSC::DebuggerCallFrame::thisObject): 17973 (JSC::DebuggerCallFrame::evaluate): 17974 * kjs/DebuggerCallFrame.h: 17975 * kjs/ExecState.cpp: 17976 (JSC::CallFrame::thisValue): 17977 * kjs/ExecState.h: 17978 * kjs/FunctionConstructor.cpp: 17979 (JSC::constructFunction): 17980 * kjs/JSActivation.cpp: 17981 (JSC::JSActivation::JSActivation): 17982 (JSC::JSActivation::argumentsGetter): 17983 * kjs/JSActivation.h: 17984 * kjs/JSGlobalObject.cpp: 17985 (JSC::JSGlobalObject::init): 17986 * kjs/JSGlobalObjectFunctions.cpp: 17987 (JSC::globalFuncEval): 17988 * kjs/JSVariableObject.h: 17989 * kjs/Parser.cpp: 17990 (JSC::Parser::parse): 17991 * kjs/RegExpConstructor.cpp: 17992 (JSC::constructRegExp): 17993 * kjs/RegExpPrototype.cpp: 17994 (JSC::regExpProtoFuncCompile): 17995 * kjs/Shell.cpp: 17996 (prettyPrintScript): 17997 * kjs/StringPrototype.cpp: 17998 (JSC::stringProtoFuncMatch): 17999 (JSC::stringProtoFuncSearch): 18000 * kjs/identifier.cpp: 18001 (JSC::Identifier::checkSameIdentifierTable): 18002 * kjs/interpreter.cpp: 18003 (JSC::Interpreter::checkSyntax): 18004 (JSC::Interpreter::evaluate): 18005 * kjs/nodes.cpp: 18006 (JSC::ThrowableExpressionData::emitThrowError): 18007 (JSC::RegExpNode::emitCode): 18008 (JSC::ArrayNode::emitCode): 18009 (JSC::InstanceOfNode::emitCode): 18010 * kjs/nodes.h: 18011 * kjs/regexp.cpp: 18012 (JSC::RegExp::RegExp): 18013 (JSC::RegExp::create): 18014 * kjs/regexp.h: 18015 * profiler/HeavyProfile.h: 18016 * profiler/Profile.h: 18017 * wrec/WREC.cpp: 18018 * wrec/WREC.h: 18019 180202008-10-08 Mark Rowe <mrowe@apple.com> 18021 18022 Typed by Maciej Stachowiak, reviewed by Mark Rowe. 18023 18024 Fix crash in fast/js/constant-folding.html with CTI disabled. 18025 18026 * VM/Machine.cpp: 18027 (JSC::Machine::privateExecute): 18028 180292008-10-08 Timothy Hatcher <timothy@apple.com> 18030 18031 Roll out r37427 because it causes an infinite recursion loading about:blank. 18032 18033 https://bugs.webkit.org/show_bug.cgi?id=21476 18034 180352008-10-08 Darin Adler <darin@apple.com> 18036 18037 Reviewed by Cameron Zwarich. 18038 18039 - https://bugs.webkit.org/show_bug.cgi?id=21403 18040 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation 18041 18042 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every 18043 client over to the new name. 18044 18045 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such 18046 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use 18047 accessor functions to get at things in the frame. 18048 18049 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with 18050 JSGlobalData* and in other cases eliminating them entirely. 18051 18052 * API/JSObjectRef.cpp: 18053 (JSObjectMakeFunctionWithCallback): 18054 (JSObjectMakeFunction): 18055 (JSObjectHasProperty): 18056 (JSObjectGetProperty): 18057 (JSObjectSetProperty): 18058 (JSObjectDeleteProperty): 18059 * API/OpaqueJSString.cpp: 18060 * API/OpaqueJSString.h: 18061 * VM/CTI.cpp: 18062 (JSC::CTI::getConstant): 18063 (JSC::CTI::emitGetArg): 18064 (JSC::CTI::emitGetPutArg): 18065 (JSC::CTI::getConstantImmediateNumericArg): 18066 (JSC::CTI::printOpcodeOperandTypes): 18067 (JSC::CTI::CTI): 18068 (JSC::CTI::compileOpCall): 18069 (JSC::CTI::compileBinaryArithOp): 18070 (JSC::CTI::privateCompileMainPass): 18071 (JSC::CTI::privateCompile): 18072 (JSC::CTI::privateCompileGetByIdProto): 18073 (JSC::CTI::privateCompileGetByIdChain): 18074 (JSC::CTI::compileRegExp): 18075 * VM/CTI.h: 18076 * VM/CodeBlock.h: 18077 * VM/CodeGenerator.cpp: 18078 (JSC::CodeGenerator::emitEqualityOp): 18079 (JSC::CodeGenerator::emitLoad): 18080 (JSC::CodeGenerator::emitUnexpectedLoad): 18081 (JSC::CodeGenerator::emitConstruct): 18082 * VM/CodeGenerator.h: 18083 * VM/Machine.cpp: 18084 (JSC::jsLess): 18085 (JSC::jsLessEq): 18086 (JSC::jsAddSlowCase): 18087 (JSC::jsAdd): 18088 (JSC::jsTypeStringForValue): 18089 (JSC::Machine::resolve): 18090 (JSC::Machine::resolveSkip): 18091 (JSC::Machine::resolveGlobal): 18092 (JSC::inlineResolveBase): 18093 (JSC::Machine::resolveBase): 18094 (JSC::Machine::resolveBaseAndProperty): 18095 (JSC::Machine::resolveBaseAndFunc): 18096 (JSC::Machine::slideRegisterWindowForCall): 18097 (JSC::isNotObject): 18098 (JSC::Machine::callEval): 18099 (JSC::Machine::dumpCallFrame): 18100 (JSC::Machine::dumpRegisters): 18101 (JSC::Machine::unwindCallFrame): 18102 (JSC::Machine::throwException): 18103 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): 18104 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope): 18105 (JSC::Machine::execute): 18106 (JSC::Machine::debug): 18107 (JSC::Machine::createExceptionScope): 18108 (JSC::cachePrototypeChain): 18109 (JSC::Machine::tryCachePutByID): 18110 (JSC::Machine::tryCacheGetByID): 18111 (JSC::Machine::privateExecute): 18112 (JSC::Machine::retrieveArguments): 18113 (JSC::Machine::retrieveCaller): 18114 (JSC::Machine::retrieveLastCaller): 18115 (JSC::Machine::findFunctionCallFrame): 18116 (JSC::Machine::getArgumentsData): 18117 (JSC::Machine::tryCTICachePutByID): 18118 (JSC::Machine::getCTIArrayLengthTrampoline): 18119 (JSC::Machine::getCTIStringLengthTrampoline): 18120 (JSC::Machine::tryCTICacheGetByID): 18121 (JSC::Machine::cti_op_convert_this): 18122 (JSC::Machine::cti_op_end): 18123 (JSC::Machine::cti_op_add): 18124 (JSC::Machine::cti_op_pre_inc): 18125 (JSC::Machine::cti_timeout_check): 18126 (JSC::Machine::cti_op_loop_if_less): 18127 (JSC::Machine::cti_op_loop_if_lesseq): 18128 (JSC::Machine::cti_op_new_object): 18129 (JSC::Machine::cti_op_put_by_id): 18130 (JSC::Machine::cti_op_put_by_id_second): 18131 (JSC::Machine::cti_op_put_by_id_generic): 18132 (JSC::Machine::cti_op_put_by_id_fail): 18133 (JSC::Machine::cti_op_get_by_id): 18134 (JSC::Machine::cti_op_get_by_id_second): 18135 (JSC::Machine::cti_op_get_by_id_generic): 18136 (JSC::Machine::cti_op_get_by_id_fail): 18137 (JSC::Machine::cti_op_instanceof): 18138 (JSC::Machine::cti_op_del_by_id): 18139 (JSC::Machine::cti_op_mul): 18140 (JSC::Machine::cti_op_new_func): 18141 (JSC::Machine::cti_op_call_JSFunction): 18142 (JSC::Machine::cti_vm_compile): 18143 (JSC::Machine::cti_op_push_activation): 18144 (JSC::Machine::cti_op_call_NotJSFunction): 18145 (JSC::Machine::cti_op_create_arguments): 18146 (JSC::Machine::cti_op_tear_off_activation): 18147 (JSC::Machine::cti_op_tear_off_arguments): 18148 (JSC::Machine::cti_op_ret_profiler): 18149 (JSC::Machine::cti_op_ret_scopeChain): 18150 (JSC::Machine::cti_op_new_array): 18151 (JSC::Machine::cti_op_resolve): 18152 (JSC::Machine::cti_op_construct_JSConstruct): 18153 (JSC::Machine::cti_op_construct_NotJSConstruct): 18154 (JSC::Machine::cti_op_get_by_val): 18155 (JSC::Machine::cti_op_resolve_func): 18156 (JSC::Machine::cti_op_sub): 18157 (JSC::Machine::cti_op_put_by_val): 18158 (JSC::Machine::cti_op_put_by_val_array): 18159 (JSC::Machine::cti_op_lesseq): 18160 (JSC::Machine::cti_op_loop_if_true): 18161 (JSC::Machine::cti_op_negate): 18162 (JSC::Machine::cti_op_resolve_base): 18163 (JSC::Machine::cti_op_resolve_skip): 18164 (JSC::Machine::cti_op_resolve_global): 18165 (JSC::Machine::cti_op_div): 18166 (JSC::Machine::cti_op_pre_dec): 18167 (JSC::Machine::cti_op_jless): 18168 (JSC::Machine::cti_op_not): 18169 (JSC::Machine::cti_op_jtrue): 18170 (JSC::Machine::cti_op_post_inc): 18171 (JSC::Machine::cti_op_eq): 18172 (JSC::Machine::cti_op_lshift): 18173 (JSC::Machine::cti_op_bitand): 18174 (JSC::Machine::cti_op_rshift): 18175 (JSC::Machine::cti_op_bitnot): 18176 (JSC::Machine::cti_op_resolve_with_base): 18177 (JSC::Machine::cti_op_new_func_exp): 18178 (JSC::Machine::cti_op_mod): 18179 (JSC::Machine::cti_op_less): 18180 (JSC::Machine::cti_op_neq): 18181 (JSC::Machine::cti_op_post_dec): 18182 (JSC::Machine::cti_op_urshift): 18183 (JSC::Machine::cti_op_bitxor): 18184 (JSC::Machine::cti_op_new_regexp): 18185 (JSC::Machine::cti_op_bitor): 18186 (JSC::Machine::cti_op_call_eval): 18187 (JSC::Machine::cti_op_throw): 18188 (JSC::Machine::cti_op_get_pnames): 18189 (JSC::Machine::cti_op_next_pname): 18190 (JSC::Machine::cti_op_push_scope): 18191 (JSC::Machine::cti_op_pop_scope): 18192 (JSC::Machine::cti_op_typeof): 18193 (JSC::Machine::cti_op_to_jsnumber): 18194 (JSC::Machine::cti_op_in): 18195 (JSC::Machine::cti_op_push_new_scope): 18196 (JSC::Machine::cti_op_jmp_scopes): 18197 (JSC::Machine::cti_op_put_by_index): 18198 (JSC::Machine::cti_op_switch_imm): 18199 (JSC::Machine::cti_op_switch_char): 18200 (JSC::Machine::cti_op_switch_string): 18201 (JSC::Machine::cti_op_del_by_val): 18202 (JSC::Machine::cti_op_put_getter): 18203 (JSC::Machine::cti_op_put_setter): 18204 (JSC::Machine::cti_op_new_error): 18205 (JSC::Machine::cti_op_debug): 18206 (JSC::Machine::cti_vm_throw): 18207 * VM/Machine.h: 18208 * VM/Register.h: 18209 * VM/RegisterFile.h: 18210 * kjs/Arguments.h: 18211 * kjs/DebuggerCallFrame.cpp: 18212 (JSC::DebuggerCallFrame::functionName): 18213 (JSC::DebuggerCallFrame::type): 18214 (JSC::DebuggerCallFrame::thisObject): 18215 (JSC::DebuggerCallFrame::evaluate): 18216 * kjs/DebuggerCallFrame.h: 18217 * kjs/ExecState.cpp: 18218 (JSC::CallFrame::thisValue): 18219 * kjs/ExecState.h: 18220 * kjs/FunctionConstructor.cpp: 18221 (JSC::constructFunction): 18222 * kjs/JSActivation.cpp: 18223 (JSC::JSActivation::JSActivation): 18224 (JSC::JSActivation::argumentsGetter): 18225 * kjs/JSActivation.h: 18226 * kjs/JSGlobalObject.cpp: 18227 (JSC::JSGlobalObject::init): 18228 * kjs/JSGlobalObjectFunctions.cpp: 18229 (JSC::globalFuncEval): 18230 * kjs/JSVariableObject.h: 18231 * kjs/Parser.cpp: 18232 (JSC::Parser::parse): 18233 * kjs/RegExpConstructor.cpp: 18234 (JSC::constructRegExp): 18235 * kjs/RegExpPrototype.cpp: 18236 (JSC::regExpProtoFuncCompile): 18237 * kjs/Shell.cpp: 18238 (prettyPrintScript): 18239 * kjs/StringPrototype.cpp: 18240 (JSC::stringProtoFuncMatch): 18241 (JSC::stringProtoFuncSearch): 18242 * kjs/identifier.cpp: 18243 (JSC::Identifier::checkSameIdentifierTable): 18244 * kjs/interpreter.cpp: 18245 (JSC::Interpreter::checkSyntax): 18246 (JSC::Interpreter::evaluate): 18247 * kjs/nodes.cpp: 18248 (JSC::ThrowableExpressionData::emitThrowError): 18249 (JSC::RegExpNode::emitCode): 18250 (JSC::ArrayNode::emitCode): 18251 (JSC::InstanceOfNode::emitCode): 18252 * kjs/nodes.h: 18253 * kjs/regexp.cpp: 18254 (JSC::RegExp::RegExp): 18255 (JSC::RegExp::create): 18256 * kjs/regexp.h: 18257 * profiler/HeavyProfile.h: 18258 * profiler/Profile.h: 18259 * wrec/WREC.cpp: 18260 * wrec/WREC.h: 18261 182622008-10-08 Prasanth Ullattil <pullatti@trolltech.com> 18263 18264 Reviewed by Oliver Hunt. 18265 18266 Avoid endless loops when compiling without the computed goto 18267 optimization. 18268 18269 NEXT_OPCODE expands to "continue", which will not work inside 18270 loops. 18271 18272 * VM/Machine.cpp: 18273 (JSC::Machine::privateExecute): 18274 182752008-10-08 Maciej Stachowiak <mjs@apple.com> 18276 18277 Reviewed by Oliver Hunt. 18278 18279 Re-landing the following fix with the crashing bug in it fixed (r37405): 18280 18281 - optimize away multiplication by constant 1.0 18282 18283 2.3% speedup on v8 RayTrace benchmark 18284 18285 Apparently it's not uncommon for JavaScript code to multiply by 18286 constant 1.0 in the mistaken belief that this converts integer to 18287 floating point and that there is any operational difference. 18288 18289 * VM/CTI.cpp: 18290 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for 18291 case where parameter is already number. 18292 (JSC::CTI::privateCompileSlowCases): ditto 18293 * VM/Machine.cpp: 18294 (JSC::Machine::privateExecute): ditto 18295 * kjs/grammar.y: 18296 (makeMultNode): Transform as follows: 18297 +FOO * BAR ==> FOO * BAR 18298 FOO * +BAR ==> FOO * BAR 18299 FOO * 1 ==> +FOO 18300 1 * FOO ==> +FOO 18301 (makeDivNode): Transform as follows: 18302 +FOO / BAR ==> FOO / BAR 18303 FOO / +BAR ==> FOO / BAR 18304 (makeSubNode): Transform as follows: 18305 +FOO - BAR ==> FOO - BAR 18306 FOO - +BAR ==> FOO - BAR 18307 * kjs/nodes.h: 18308 (JSC::ExpressionNode::stripUnaryPlus): Helper for above 18309 grammar.y changes 18310 (JSC::UnaryPlusNode::stripUnaryPlus): ditto 18311 183122008-10-08 Maciej Stachowiak <mjs@apple.com> 18313 18314 Reviewed by Oliver Hunt. 18315 18316 - correctly handle appending -0 to a string, it should stringify as just 0 18317 18318 * kjs/ustring.cpp: 18319 (JSC::concatenate): 18320 183212008-10-08 Prasanth Ullattil <pullatti@trolltech.com> 18322 18323 Reviewed by Simon. 18324 18325 Fix WebKit compilation with VC2008SP1 18326 18327 Apply the TR1 workaround for JavaScriptCore, too. 18328 18329 * JavaScriptCore.pro: 18330 183312008-10-08 Prasanth Ullattil <pullatti@trolltech.com> 18332 18333 Reviewed by Simon. 18334 18335 Fix compilation errors on VS2008 64Bit 18336 18337 * kjs/collector.cpp: 18338 (JSC::currentThreadStackBase): 18339 183402008-10-08 André Pönitz <apoenitz@trolltech.com> 18341 18342 Reviewed by Simon. 18343 18344 Fix compilation with Qt namespaces. 18345 18346 * wtf/Threading.h: 18347 183482008-10-07 Sam Weinig <sam@webkit.org> 18349 18350 Roll out r37405. 18351 183522008-10-07 Oliver Hunt <oliver@apple.com> 18353 18354 Reviewed by Cameron Zwarich. 18355 18356 Switch CTI runtime calls to the fastcall calling convention 18357 18358 Basically this means that we get to store the argument for CTI 18359 calls in the ECX register, which saves a register->memory write 18360 and subsequent memory->register read. 18361 18362 This is a 1.7% progression in SunSpider and 2.4% on commandline 18363 v8 tests on Windows 18364 18365 * VM/CTI.cpp: 18366 (JSC::): 18367 (JSC::CTI::privateCompilePutByIdTransition): 18368 (JSC::CTI::privateCompilePatchGetArrayLength): 18369 * VM/CTI.h: 18370 * VM/Machine.h: 18371 * masm/X86Assembler.h: 18372 (JSC::X86Assembler::emitRestoreArgumentReference): 18373 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline): 18374 We need this to correctly reload ecx from inside certain property access 18375 trampolines. 18376 * wtf/Platform.h: 18377 183782008-10-07 Maciej Stachowiak <mjs@apple.com> 18379 18380 Reviewed by Mark Rowe. 18381 18382 - optimize away multiplication by constant 1.0 18383 18384 2.3% speedup on v8 RayTrace benchmark 18385 18386 Apparently it's not uncommon for JavaScript code to multiply by 18387 constant 1.0 in the mistaken belief that this converts integer to 18388 floating point and that there is any operational difference. 18389 18390 * VM/CTI.cpp: 18391 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for 18392 case where parameter is already number. 18393 (JSC::CTI::privateCompileSlowCases): ditto 18394 * VM/Machine.cpp: 18395 (JSC::Machine::privateExecute): ditto 18396 * kjs/grammar.y: 18397 (makeMultNode): Transform as follows: 18398 +FOO * BAR ==> FOO * BAR 18399 FOO * +BAR ==> FOO * BAR 18400 FOO * 1 ==> +FOO 18401 1 * FOO ==> +FOO 18402 (makeDivNode): Transform as follows: 18403 +FOO / BAR ==> FOO / BAR 18404 FOO / +BAR ==> FOO / BAR 18405 (makeSubNode): Transform as follows: 18406 +FOO - BAR ==> FOO - BAR 18407 FOO - +BAR ==> FOO - BAR 18408 * kjs/nodes.h: 18409 (JSC::ExpressionNode::stripUnaryPlus): Helper for above 18410 grammar.y changes 18411 (JSC::UnaryPlusNode::stripUnaryPlus): ditto 18412 184132008-10-07 Maciej Stachowiak <mjs@apple.com> 18414 18415 Reviewed by Oliver Hunt. 18416 18417 - make constant folding code more consistent 18418 18419 Added a makeSubNode to match add, mult and div; use the makeFooNode functions always, 18420 instead of allocating nodes directly in other places in the grammar. 18421 18422 * kjs/grammar.y: 18423 184242008-10-07 Sam Weinig <sam@webkit.org> 18425 18426 Reviewed by Cameron Zwarich. 18427 18428 Move hasGetterSetterProperties flag from PropertyMap to StructureID. 18429 18430 * kjs/JSObject.cpp: 18431 (JSC::JSObject::put): 18432 (JSC::JSObject::defineGetter): 18433 (JSC::JSObject::defineSetter): 18434 * kjs/JSObject.h: 18435 (JSC::JSObject::hasGetterSetterProperties): 18436 (JSC::JSObject::getOwnPropertySlotForWrite): 18437 (JSC::JSObject::getOwnPropertySlot): 18438 * kjs/PropertyMap.h: 18439 * kjs/StructureID.cpp: 18440 (JSC::StructureID::StructureID): 18441 (JSC::StructureID::addPropertyTransition): 18442 (JSC::StructureID::toDictionaryTransition): 18443 (JSC::StructureID::changePrototypeTransition): 18444 (JSC::StructureID::getterSetterTransition): 18445 * kjs/StructureID.h: 18446 (JSC::StructureID::hasGetterSetterProperties): 18447 (JSC::StructureID::setHasGetterSetterProperties): 18448 184492008-10-07 Sam Weinig <sam@webkit.org> 18450 18451 Reviewed by Cameron Zwarich. 18452 18453 Roll r37370 back in with bug fixes. 18454 18455 - PropertyMap::storageSize() should reflect the number of keys + deletedOffsets 18456 and has nothing to do with the internal deletedSentinel count anymore. 18457 184582008-10-07 Gavin Barraclough <barraclough@apple.com> 18459 18460 Reviewed by Oliver Hunt. 18461 18462 Move callframe initialization into JIT code, again. 18463 18464 As a part of the restructuring the second result from functions is now 18465 returned in edx, allowing the new value of 'r' to be returned via a 18466 register, and stored to the stack from JIT code, too. 18467 18468 4.5% progression on v8-tests. (3% in their harness) 18469 18470 * VM/CTI.cpp: 18471 (JSC::): 18472 (JSC::CTI::emitCall): 18473 (JSC::CTI::compileOpCall): 18474 (JSC::CTI::privateCompileMainPass): 18475 (JSC::CTI::privateCompileSlowCases): 18476 (JSC::CTI::privateCompile): 18477 * VM/CTI.h: 18478 (JSC::CallRecord::CallRecord): 18479 * VM/Machine.cpp: 18480 (JSC::Machine::cti_op_call_JSFunction): 18481 (JSC::Machine::cti_op_construct_JSConstruct): 18482 (JSC::Machine::cti_op_resolve_func): 18483 (JSC::Machine::cti_op_post_inc): 18484 (JSC::Machine::cti_op_resolve_with_base): 18485 (JSC::Machine::cti_op_post_dec): 18486 * VM/Machine.h: 18487 * kjs/JSFunction.h: 18488 * kjs/ScopeChain.h: 18489 184902008-10-07 Mark Rowe <mrowe@apple.com> 18491 18492 Fix typo in method name. 18493 18494 * wrec/WREC.cpp: 18495 * wrec/WREC.h: 18496 184972008-10-07 Cameron Zwarich <zwarich@apple.com> 18498 18499 Rubber-stamped by Mark Rowe. 18500 18501 Roll out r37370. 18502 185032008-10-06 Sam Weinig <sam@webkit.org> 18504 18505 Reviewed by Cameron Zwarich. 18506 18507 Fix for https://bugs.webkit.org/show_bug.cgi?id=21415 18508 Improve the division between PropertyStorageArray and PropertyMap 18509 18510 - Rework ProperyMap to store offsets in the value so that they don't 18511 change when rehashing. This allows us not to have to keep the 18512 PropertyStorageArray in sync and thus not have to pass it in. 18513 - Rename PropertyMap::getOffset -> PropertyMap::get since put/remove 18514 now also return offsets. 18515 - A Vector of deleted offsets is now needed since the storage is out of 18516 band. 18517 18518 1% win on SunSpider. Wash on V8 suite. 18519 18520 * JavaScriptCore.exp: 18521 * VM/CTI.cpp: 18522 (JSC::transitionWillNeedStorageRealloc): 18523 * VM/Machine.cpp: 18524 (JSC::Machine::privateExecute): 18525 Transition logic can be greatly simplified by the fact that 18526 the storage capacity is always known, and is correct for the 18527 inline case. 18528 * kjs/JSObject.cpp: 18529 (JSC::JSObject::put): Rename getOffset -> get. 18530 (JSC::JSObject::deleteProperty): Ditto. 18531 (JSC::JSObject::getPropertyAttributes): Ditto. 18532 (JSC::JSObject::removeDirect): Use returned offset to 18533 clear the value in the PropertyNameArray. 18534 (JSC::JSObject::allocatePropertyStorage): Add assert. 18535 * kjs/JSObject.h: 18536 (JSC::JSObject::getDirect): Rename getOffset -> get 18537 (JSC::JSObject::getDirectLocation): Rename getOffset -> get 18538 (JSC::JSObject::putDirect): Use propertyStorageCapacity to determine whether 18539 or not to resize. Also, since put now returns an offset (and thus 18540 addPropertyTransition does also) setting of the PropertyStorageArray is 18541 now done here. 18542 (JSC::JSObject::transitionTo): 18543 * kjs/PropertyMap.cpp: 18544 (JSC::PropertyMap::checkConsistency): PropertyStorageArray is no longer 18545 passed in. 18546 (JSC::PropertyMap::operator=): Copy the delete offsets vector. 18547 (JSC::PropertyMap::put): Instead of setting the PropertyNameArray 18548 explicitly, return the offset where the value should go. 18549 (JSC::PropertyMap::remove): Instead of removing from the PropertyNameArray 18550 explicitly, return the offset where the value should be removed. 18551 (JSC::PropertyMap::get): Switch to using the stored offset, instead 18552 of the implicit one. 18553 (JSC::PropertyMap::insert): 18554 (JSC::PropertyMap::expand): This is never called when m_table is null, 18555 so remove that branch and add it as an assertion. 18556 (JSC::PropertyMap::createTable): Consistency checks no longer take 18557 a PropertyNameArray. 18558 (JSC::PropertyMap::rehash): No need to rehash the PropertyNameArray 18559 now that it is completely out of band. 18560 * kjs/PropertyMap.h: 18561 (JSC::PropertyMapEntry::PropertyMapEntry): Store offset into PropertyNameArray. 18562 (JSC::PropertyMap::get): Switch to using the stored offset, instead 18563 of the implicit one. 18564 * kjs/StructureID.cpp: 18565 (JSC::StructureID::StructureID): Initialize the propertyStorageCapacity to 18566 JSObject::inlineStorageCapacity. 18567 (JSC::StructureID::growPropertyStorageCapacity): Grow the storage capacity as 18568 described below. 18569 (JSC::StructureID::addPropertyTransition): Copy the storage capacity. 18570 (JSC::StructureID::toDictionaryTransition): Ditto. 18571 (JSC::StructureID::changePrototypeTransition): Ditto. 18572 (JSC::StructureID::getterSetterTransition): Ditto. 18573 * kjs/StructureID.h: 18574 (JSC::StructureID::propertyStorageCapacity): Add propertyStorageCapacity 18575 which is the current capacity for the JSObjects PropertyStorageArray. 18576 It starts at the JSObject::inlineStorageCapacity (currently 2), then 18577 when it first needs to be resized moves to the JSObject::nonInlineBaseStorageCapacity 18578 (currently 16), and after that doubles each time. 18579 185802008-10-06 Cameron Zwarich <zwarich@apple.com> 18581 18582 Reviewed by Oliver Hunt. 18583 18584 Bug 21396: Remove the OptionalCalleeActivation call frame slot 18585 <https://bugs.webkit.org/show_bug.cgi?id=21396> 18586 18587 Remove the OptionalCalleeActivation call frame slot. We have to be 18588 careful to store the activation object in a register, because objects 18589 in the scope chain do not get marked. 18590 18591 This is a 0.3% speedup on both SunSpider and the V8 benchmark. 18592 18593 * VM/CTI.cpp: 18594 (JSC::CTI::privateCompileMainPass): 18595 * VM/CodeBlock.cpp: 18596 (JSC::CodeBlock::dump): 18597 * VM/CodeGenerator.cpp: 18598 (JSC::CodeGenerator::CodeGenerator): 18599 (JSC::CodeGenerator::emitReturn): 18600 * VM/CodeGenerator.h: 18601 * VM/Machine.cpp: 18602 (JSC::Machine::dumpRegisters): 18603 (JSC::Machine::unwindCallFrame): 18604 (JSC::Machine::privateExecute): 18605 (JSC::Machine::cti_op_call_JSFunction): 18606 (JSC::Machine::cti_op_push_activation): 18607 (JSC::Machine::cti_op_tear_off_activation): 18608 (JSC::Machine::cti_op_construct_JSConstruct): 18609 * VM/Machine.h: 18610 (JSC::Machine::initializeCallFrame): 18611 * VM/RegisterFile.h: 18612 (JSC::RegisterFile::): 18613 186142008-10-06 Tony Chang <tony@chromium.org> 18615 18616 Reviewed by Alexey Proskuryakov. 18617 18618 Chromium doesn't use pthreads on windows, so make its use conditional. 18619 18620 Also convert a WORD to a DWORD to avoid a compiler warning. This 18621 matches the other methods around it. 18622 18623 * wtf/ThreadingWin.cpp: 18624 (WTF::wtfThreadEntryPoint): 18625 (WTF::ThreadCondition::broadcast): 18626 186272008-10-06 Mark Mentovai <mark@moxienet.com> 18628 18629 Reviewed by Tim Hatcher. 18630 18631 Allow ENABLE_DASHBOARD_SUPPORT and ENABLE_MAC_JAVA_BRIDGE to be 18632 disabled on the Mac. 18633 18634 https://bugs.webkit.org/show_bug.cgi?id=21333 18635 18636 * wtf/Platform.h: 18637 186382008-10-06 Steve Falkenburg <sfalken@apple.com> 18639 18640 https://bugs.webkit.org/show_bug.cgi?id=21416 18641 Pass 0 for size to VirtualAlloc, as documented by MSDN. 18642 Identified by Application Verifier. 18643 18644 Reviewed by Darin Adler. 18645 18646 * kjs/collector.cpp: 18647 (KJS::freeBlock): 18648 186492008-10-06 Kevin McCullough <kmccullough@apple.com> 18650 18651 Reviewed by Tim Hatcheri and Oliver Hunt. 18652 18653 https://bugs.webkit.org/show_bug.cgi?id=21412 18654 Bug 21412: Refactor user initiated profile count to be more stable 18655 - Export UString::from for use with creating the profile title. 18656 18657 * JavaScriptCore.exp: 18658 186592008-10-06 Maciej Stachowiak <mjs@apple.com> 18660 18661 Not reviewed. Build fix. 18662 18663 - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these 18664 18665 * API/JSValueRef.cpp: 18666 (JSValueToBoolean): 18667 * ChangeLog: 18668 * JavaScriptCore.exp: 18669 * VM/CodeBlock.cpp: 18670 (JSC::CodeBlock::dump): 18671 * VM/Machine.cpp: 18672 (JSC::Machine::privateExecute): 18673 (JSC::Machine::cti_op_loop_if_true): 18674 (JSC::Machine::cti_op_not): 18675 (JSC::Machine::cti_op_jtrue): 18676 * kjs/ArrayPrototype.cpp: 18677 (JSC::arrayProtoFuncFilter): 18678 (JSC::arrayProtoFuncEvery): 18679 (JSC::arrayProtoFuncSome): 18680 * kjs/BooleanConstructor.cpp: 18681 (JSC::constructBoolean): 18682 (JSC::callBooleanConstructor): 18683 * kjs/GetterSetter.h: 18684 * kjs/JSCell.h: 18685 (JSC::JSValue::toBoolean): 18686 * kjs/JSNumberCell.cpp: 18687 (JSC::JSNumberCell::toBoolean): 18688 * kjs/JSNumberCell.h: 18689 * kjs/JSObject.cpp: 18690 (JSC::JSObject::toBoolean): 18691 * kjs/JSObject.h: 18692 * kjs/JSString.cpp: 18693 (JSC::JSString::toBoolean): 18694 * kjs/JSString.h: 18695 * kjs/JSValue.h: 18696 * kjs/RegExpConstructor.cpp: 18697 (JSC::setRegExpConstructorMultiline): 18698 * kjs/RegExpObject.cpp: 18699 (JSC::RegExpObject::match): 18700 * kjs/RegExpPrototype.cpp: 18701 (JSC::regExpProtoFuncToString): 18702 187032008-10-06 Maciej Stachowiak <mjs@apple.com> 18704 18705 Reviewed by Sam Weinig. 18706 18707 - optimize op_jtrue, op_loop_if_true and op_not in various ways 18708 https://bugs.webkit.org/show_bug.cgi?id=21404 18709 18710 1) Make JSValue::toBoolean nonvirtual and completely inline by 18711 making use of the StructureID type field. 18712 18713 2) Make JSValue::toBoolean not take an ExecState; doesn't need it. 18714 18715 3) Make op_not, op_loop_if_true and op_jtrue not read the 18716 ExecState (toBoolean doesn't need it any more) and not check 18717 exceptions (toBoolean can't throw). 18718 18719 * API/JSValueRef.cpp: 18720 (JSValueToBoolean): 18721 * JavaScriptCore.exp: 18722 * VM/CodeBlock.cpp: 18723 (JSC::CodeBlock::dump): 18724 * VM/Machine.cpp: 18725 (JSC::Machine::privateExecute): 18726 (JSC::Machine::cti_op_loop_if_true): 18727 (JSC::Machine::cti_op_not): 18728 (JSC::Machine::cti_op_jtrue): 18729 * kjs/ArrayPrototype.cpp: 18730 (JSC::arrayProtoFuncFilter): 18731 (JSC::arrayProtoFuncEvery): 18732 (JSC::arrayProtoFuncSome): 18733 * kjs/BooleanConstructor.cpp: 18734 (JSC::constructBoolean): 18735 (JSC::callBooleanConstructor): 18736 * kjs/GetterSetter.h: 18737 * kjs/JSCell.h: 18738 (JSC::JSValue::toBoolean): 18739 * kjs/JSNumberCell.cpp: 18740 * kjs/JSNumberCell.h: 18741 (JSC::JSNumberCell::toBoolean): 18742 * kjs/JSObject.cpp: 18743 * kjs/JSObject.h: 18744 (JSC::JSObject::toBoolean): 18745 (JSC::JSCell::toBoolean): 18746 * kjs/JSString.cpp: 18747 * kjs/JSString.h: 18748 (JSC::JSString::toBoolean): 18749 * kjs/JSValue.h: 18750 * kjs/RegExpConstructor.cpp: 18751 (JSC::setRegExpConstructorMultiline): 18752 * kjs/RegExpObject.cpp: 18753 (JSC::RegExpObject::match): 18754 * kjs/RegExpPrototype.cpp: 18755 (JSC::regExpProtoFuncToString): 18756 187572008-10-06 Ariya Hidayat <ariya.hidayat@trolltech.com> 18758 18759 Reviewed by Simon. 18760 18761 Build fix for MinGW. 18762 18763 * JavaScriptCore.pri: 18764 * kjs/DateMath.cpp: 18765 (JSC::highResUpTime): 18766 187672008-10-05 Cameron Zwarich <zwarich@apple.com> 18768 18769 Reviewed by Oliver Hunt. 18770 18771 Remove ScopeNode::containsClosures() now that it is unused. 18772 18773 * kjs/nodes.h: 18774 (JSC::ScopeNode::containsClosures): 18775 187762008-10-05 Maciej Stachowiak <mjs@apple.com> 18777 18778 Reviewed by Cameron Zwarich. 18779 18780 - fix releas-only test failures caused by the fix to bug 21375 18781 18782 * VM/Machine.cpp: 18783 (JSC::Machine::unwindCallFrame): Update ExecState while unwinding call frames; 18784 it now matters more to have a still-valid ExecState, since dynamicGlobalObject 18785 will make use of the ExecState's scope chain. 18786 * VM/Machine.h: 18787 187882008-10-05 Cameron Zwarich <zwarich@apple.com> 18789 18790 Reviewed by Oliver Hunt. 18791 18792 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments 18793 <https://bugs.webkit.org/show_bug.cgi?id=21364> 18794 18795 Use information from the parser to detect whether an activation is 18796 needed or 'arguments' is used, and emit explicit instructions to tear 18797 them off before op_ret. This allows a branch to be removed from op_ret 18798 and simplifies some other code. This does cause a small change in the 18799 behaviour of 'f.arguments'; it is no longer live when 'arguments' is not 18800 mentioned in the lexical scope of the function. 18801 18802 It should now be easy to remove the OptionaCalleeActivation slot in the 18803 call frame, but this will be done in a later patch. 18804 18805 * VM/CTI.cpp: 18806 (JSC::CTI::privateCompileMainPass): 18807 * VM/CodeBlock.cpp: 18808 (JSC::CodeBlock::dump): 18809 * VM/CodeGenerator.cpp: 18810 (JSC::CodeGenerator::emitReturn): 18811 * VM/CodeGenerator.h: 18812 * VM/Machine.cpp: 18813 (JSC::Machine::unwindCallFrame): 18814 (JSC::Machine::privateExecute): 18815 (JSC::Machine::retrieveArguments): 18816 (JSC::Machine::cti_op_create_arguments): 18817 (JSC::Machine::cti_op_tear_off_activation): 18818 (JSC::Machine::cti_op_tear_off_arguments): 18819 * VM/Machine.h: 18820 * VM/Opcode.h: 18821 * kjs/Arguments.cpp: 18822 (JSC::Arguments::mark): 18823 * kjs/Arguments.h: 18824 (JSC::Arguments::isTornOff): 18825 (JSC::Arguments::Arguments): 18826 (JSC::Arguments::copyRegisters): 18827 (JSC::JSActivation::copyRegisters): 18828 * kjs/JSActivation.cpp: 18829 (JSC::JSActivation::argumentsGetter): 18830 * kjs/JSActivation.h: 18831 188322008-10-05 Maciej Stachowiak <mjs@apple.com> 18833 18834 Reviewed by Oliver Hunt. 18835 18836 - fixed "REGRESSION (r37297): fast/js/deep-recursion-test takes too long and times out" 18837 https://bugs.webkit.org/show_bug.cgi?id=21375 18838 18839 The problem is that dynamicGlobalObject had become O(N) in number 18840 of call frames, but unwinding the stack for an exception called it 18841 for every call frame, resulting in O(N^2) behavior for an 18842 exception thrown from inside deep recursion. 18843 18844 Instead of doing it that way, stash the dynamic global object in JSGlobalData. 18845 18846 * JavaScriptCore.exp: 18847 * VM/Machine.cpp: 18848 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily 18849 store and later restore a dynamicGlobalObject in JSGlobalData. 18850 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope): 18851 (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope. 18852 For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval, 18853 only if none is currently set. 18854 * VM/Machine.h: 18855 * kjs/ExecState.h: 18856 * kjs/JSGlobalData.cpp: 18857 (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0. 18858 * kjs/JSGlobalData.h: 18859 * kjs/JSGlobalObject.h: 18860 (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining. 18861 Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData 18862 for the one stashed there. 18863 188642008-10-05 Sam Weinig <sam@webkit.org> 18865 18866 Reviewed by Maciej Stachowiak. 18867 18868 Avoid an extra lookup when transitioning to an existing StructureID 18869 by caching the offset of property that caused the transition. 18870 18871 1% win on V8 suite. Wash on SunSpider. 18872 18873 * kjs/PropertyMap.cpp: 18874 (JSC::PropertyMap::put): 18875 * kjs/PropertyMap.h: 18876 * kjs/StructureID.cpp: 18877 (JSC::StructureID::StructureID): 18878 (JSC::StructureID::addPropertyTransition): 18879 * kjs/StructureID.h: 18880 (JSC::StructureID::setCachedTransistionOffset): 18881 (JSC::StructureID::cachedTransistionOffset): 18882 188832008-10-05 Cameron Zwarich <zwarich@apple.com> 18884 18885 Reviewed by Maciej Stachowiak. 18886 18887 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments 18888 <https://bugs.webkit.org/show_bug.cgi?id=21364> 18889 18890 This patch does not yet remove the branch, but it does a bit of refactoring 18891 so that a CodeGenerator now knows whether the associated CodeBlock will need 18892 a full scope before doing any code generation. This makes it possible to emit 18893 explicit tear-off instructions before every op_ret. 18894 18895 * VM/CodeBlock.h: 18896 (JSC::CodeBlock::CodeBlock): 18897 * VM/CodeGenerator.cpp: 18898 (JSC::CodeGenerator::generate): 18899 (JSC::CodeGenerator::CodeGenerator): 18900 (JSC::CodeGenerator::emitPushScope): 18901 (JSC::CodeGenerator::emitPushNewScope): 18902 * kjs/nodes.h: 18903 (JSC::ScopeNode::needsActivation): 18904 189052008-10-05 Gavin Barraclough <barraclough@apple.com> 18906 18907 Reviewed by Cameron Zwarich. 18908 18909 Fix for bug #21387 - using SamplingTool with CTI. 18910 18911 (1) A repatch offset offset changes due to an additional instruction to update SamplingTool state. 18912 (2) Fix an incusion order problem due to ExecState changes. 18913 (3) Change to a MACHINE_SAMPLING macro, use of exec should now be accessing global data. 18914 18915 * VM/CTI.h: 18916 (JSC::CTI::execute): 18917 * VM/SamplingTool.h: 18918 (JSC::SamplingTool::privateExecuteReturned): 18919 * kjs/Shell.cpp: 18920 189212008-10-04 Mark Rowe <mrowe@apple.com> 18922 18923 Reviewed by Tim Hatcher. 18924 18925 Add a 'Check For Weak VTables' build phase to catch weak vtables as early as possible. 18926 18927 * JavaScriptCore.xcodeproj/project.pbxproj: 18928 189292008-10-04 Sam Weinig <sam@webkit.org> 18930 18931 Reviewed by Oliver Hunt. 18932 18933 Fix https://bugs.webkit.org/show_bug.cgi?id=21320 18934 leaks of PropertyNameArrayData seen on buildbot 18935 18936 - Fix RefPtr cycle by making PropertyNameArrayData's pointer back 18937 to the StructureID a weak pointer. 18938 18939 * kjs/PropertyNameArray.h: 18940 (JSC::PropertyNameArrayData::setCachedStructureID): 18941 (JSC::PropertyNameArrayData::cachedStructureID): 18942 * kjs/StructureID.cpp: 18943 (JSC::StructureID::getEnumerablePropertyNames): 18944 (JSC::StructureID::clearEnumerationCache): 18945 (JSC::StructureID::~StructureID): 18946 189472008-10-04 Darin Adler <darin@apple.com> 18948 18949 Reviewed by Cameron Zwarich. 18950 18951 - https://bugs.webkit.org/show_bug.cgi?id=21295 18952 Bug 21295: Replace ExecState with a call frame Register pointer 18953 18954 10% faster on Richards; other v8 benchmarks faster too. 18955 A wash on SunSpider. 18956 18957 This does the minimum necessary to get the speedup. Next step in 18958 cleaning this up is to replace ExecState with a CallFrame class, 18959 and be more judicious about when to pass a call frame and when 18960 to pass a global data pointer, global object pointer, or perhaps 18961 something else entirely. 18962 18963 * VM/CTI.cpp: Remove the debug-only check of the exception in 18964 ctiVMThrowTrampoline -- already checked in the code the trampoline 18965 jumps to, so not all that useful. Removed the exec argument from 18966 ctiTrampoline. Removed emitDebugExceptionCheck -- no longer needed. 18967 (JSC::CTI::emitCall): Removed code to set ExecState::m_callFrame. 18968 (JSC::CTI::privateCompileMainPass): Removed code in catch to extract 18969 the exception from ExecState::m_exception; instead, the code that 18970 jumps into catch will make sure the exception is already in eax. 18971 * VM/CTI.h: Removed exec from the ctiTrampoline. Also removed the 18972 non-helpful "volatile". Temporarily left ARG_exec in as a synonym 18973 for ARG_r; I'll change that on a future cleanup pass when introducing 18974 more use of the CallFrame type. 18975 (JSC::CTI::execute): Removed the ExecState* argument. 18976 18977 * VM/ExceptionHelpers.cpp: 18978 (JSC::InterruptedExecutionError::InterruptedExecutionError): Take 18979 JSGlobalData* instead of ExecState*. 18980 (JSC::createInterruptedExecutionException): Ditto. 18981 * VM/ExceptionHelpers.h: Ditto. Also removed an unneeded include. 18982 18983 * VM/Machine.cpp: 18984 (JSC::slideRegisterWindowForCall): Removed the exec and 18985 exceptionValue arguments. Changed to return 0 when there's a stack 18986 overflow rather than using a separate exception argument to cut 18987 down on memory accesses in the calling convention. 18988 (JSC::Machine::unwindCallFrame): Removed the exec argument when 18989 constructing a DebuggerCallFrame. Also removed code to set 18990 ExecState::m_callFrame. 18991 (JSC::Machine::throwException): Removed the exec argument when 18992 construction a DebuggerCallFrame. 18993 (JSC::Machine::execute): Updated to use the register instead of 18994 ExecState and also removed various uses of ExecState. 18995 (JSC::Machine::debug): 18996 (JSC::Machine::privateExecute): Put globalData into a local 18997 variable so it can be used throughout the interpreter. Changed 18998 the VM_CHECK_EXCEPTION to get the exception in globalData instead 18999 of through ExecState. 19000 (JSC::Machine::retrieveLastCaller): Turn exec into a registers 19001 pointer by calling registers() instead of by getting m_callFrame. 19002 (JSC::Machine::callFrame): Ditto. 19003 Tweaked exception macros. Made new versions for when you know 19004 you have an exception. Get at global exception with ARG_globalData. 19005 Got rid of the need to pass in the return value type. 19006 (JSC::Machine::cti_op_add): Update to use new version of exception 19007 macros. 19008 (JSC::Machine::cti_op_pre_inc): Ditto. 19009 (JSC::Machine::cti_timeout_check): Ditto. 19010 (JSC::Machine::cti_op_instanceof): Ditto. 19011 (JSC::Machine::cti_op_new_func): Ditto. 19012 (JSC::Machine::cti_op_call_JSFunction): Optimized by using the 19013 ARG values directly instead of through local variables -- this gets 19014 rid of code that just shuffles things around in the stack frame. 19015 Also get rid of ExecState and update for the new way exceptions are 19016 handled in slideRegisterWindowForCall. 19017 (JSC::Machine::cti_vm_compile): Update to make exec out of r since 19018 they are both the same thing now. 19019 (JSC::Machine::cti_op_call_NotJSFunction): Ditto. 19020 (JSC::Machine::cti_op_init_arguments): Ditto. 19021 (JSC::Machine::cti_op_resolve): Ditto. 19022 (JSC::Machine::cti_op_construct_JSConstruct): Ditto. 19023 (JSC::Machine::cti_op_construct_NotJSConstruct): Ditto. 19024 (JSC::Machine::cti_op_resolve_func): Ditto. 19025 (JSC::Machine::cti_op_put_by_val): Ditto. 19026 (JSC::Machine::cti_op_put_by_val_array): Ditto. 19027 (JSC::Machine::cti_op_resolve_skip): Ditto. 19028 (JSC::Machine::cti_op_resolve_global): Ditto. 19029 (JSC::Machine::cti_op_post_inc): Ditto. 19030 (JSC::Machine::cti_op_resolve_with_base): Ditto. 19031 (JSC::Machine::cti_op_post_dec): Ditto. 19032 (JSC::Machine::cti_op_call_eval): Ditto. 19033 (JSC::Machine::cti_op_throw): Ditto. Also rearranged to return 19034 the exception value as the return value so it can be used by 19035 op_catch. 19036 (JSC::Machine::cti_op_push_scope): Ditto. 19037 (JSC::Machine::cti_op_in): Ditto. 19038 (JSC::Machine::cti_op_del_by_val): Ditto. 19039 (JSC::Machine::cti_vm_throw): Ditto. Also rearranged to return 19040 the exception value as the return value so it can be used by 19041 op_catch. 19042 19043 * kjs/DebuggerCallFrame.cpp: 19044 (JSC::DebuggerCallFrame::functionName): Pass globalData. 19045 (JSC::DebuggerCallFrame::evaluate): Eliminated code to make a 19046 new ExecState. 19047 * kjs/DebuggerCallFrame.h: Removed ExecState argument from 19048 constructor. 19049 19050 * kjs/ExecState.h: Eliminated all data members and made ExecState 19051 inherit privately from Register instead. Also added a typedef to 19052 the future name for this class, which is CallFrame. It's just a 19053 Register* that knows it's a pointer at a call frame. The new class 19054 can't be constructed or copied. Changed all functions to use 19055 the this pointer instead of m_callFrame. Changed exception-related 19056 functions to access an exception in JSGlobalData. Removed functions 19057 used by CTI to pass the return address to the throw machinery -- 19058 this is now done directly with a global in the global data. 19059 19060 * kjs/FunctionPrototype.cpp: 19061 (JSC::functionProtoFuncToString): Pass globalData instead of exec. 19062 19063 * kjs/InternalFunction.cpp: 19064 (JSC::InternalFunction::name): Take globalData instead of exec. 19065 * kjs/InternalFunction.h: Ditto. 19066 19067 * kjs/JSGlobalData.cpp: Initialize the new exception global to 0. 19068 * kjs/JSGlobalData.h: Declare two new globals. One for the current 19069 exception and another for the return address used by CTI to 19070 implement the throw operation. 19071 19072 * kjs/JSGlobalObject.cpp: 19073 (JSC::JSGlobalObject::init): Removed code to set up globalExec, 19074 which is now the same thing as globalCallFrame. 19075 (JSC::JSGlobalObject::reset): Get globalExec from our globalExec 19076 function so we don't have to repeat the logic twice. 19077 (JSC::JSGlobalObject::mark): Removed code to mark the exception; 19078 the exception is now stored in JSGlobalData and marked there. 19079 (JSC::JSGlobalObject::globalExec): Return a pointer to the end 19080 of the global call frame. 19081 * kjs/JSGlobalObject.h: Removed the globalExec data member. 19082 19083 * kjs/JSObject.cpp: 19084 (JSC::JSObject::putDirectFunction): Pass globalData instead of exec. 19085 19086 * kjs/collector.cpp: 19087 (JSC::Heap::collect): Mark the global exception. 19088 19089 * profiler/ProfileGenerator.cpp: 19090 (JSC::ProfileGenerator::addParentForConsoleStart): Pass globalData 19091 instead of exec to createCallIdentifier. 19092 19093 * profiler/Profiler.cpp: 19094 (JSC::Profiler::willExecute): Pass globalData instead of exec to 19095 createCallIdentifier. 19096 (JSC::Profiler::didExecute): Ditto. 19097 (JSC::Profiler::createCallIdentifier): Take globalData instead of 19098 exec. 19099 (JSC::createCallIdentifierFromFunctionImp): Ditto. 19100 * profiler/Profiler.h: Change interface to take a JSGlobalData 19101 instead of an ExecState. 19102 191032008-10-04 Cameron Zwarich <zwarich@apple.com> 19104 19105 Reviewed by Darin Adler. 19106 19107 Bug 21369: Add opcode documentation for all undocumented opcodes 19108 <https://bugs.webkit.org/show_bug.cgi?id=21369> 19109 19110 This patch adds opcode documentation for all undocumented opcodes, and 19111 it also renames op_init_arguments to op_create_arguments. 19112 19113 * VM/CTI.cpp: 19114 (JSC::CTI::privateCompileMainPass): 19115 * VM/CodeBlock.cpp: 19116 (JSC::CodeBlock::dump): 19117 * VM/CodeGenerator.cpp: 19118 (JSC::CodeGenerator::CodeGenerator): 19119 * VM/Machine.cpp: 19120 (JSC::Machine::privateExecute): 19121 (JSC::Machine::cti_op_create_arguments): 19122 * VM/Machine.h: 19123 * VM/Opcode.h: 19124 191252008-10-03 Maciej Stachowiak <mjs@apple.com> 19126 19127 Reviewed by Cameron Zwarich. 19128 19129 - "this" object in methods called on primitives should be wrapper object 19130 https://bugs.webkit.org/show_bug.cgi?id=21362 19131 19132 I changed things so that functions which use "this" do a fast 19133 version of toThisObject conversion if needed. Currently we miss 19134 the conversion entirely, at least for primitive types. Using 19135 TypeInfo and the primitive check, I made the fast case bail out 19136 pretty fast. 19137 19138 This is inexplicably an 1.007x SunSpider speedup (and a wash on V8 benchmarks). 19139 19140 Also renamed some opcodes for clarity: 19141 19142 init ==> enter 19143 init_activation ==> enter_with_activation 19144 19145 * VM/CTI.cpp: 19146 (JSC::CTI::privateCompileMainPass): 19147 (JSC::CTI::privateCompileSlowCases): 19148 * VM/CodeBlock.cpp: 19149 (JSC::CodeBlock::dump): 19150 * VM/CodeGenerator.cpp: 19151 (JSC::CodeGenerator::generate): 19152 (JSC::CodeGenerator::CodeGenerator): 19153 * VM/Machine.cpp: 19154 (JSC::Machine::privateExecute): 19155 (JSC::Machine::cti_op_convert_this): 19156 * VM/Machine.h: 19157 * VM/Opcode.h: 19158 * kjs/JSActivation.cpp: 19159 (JSC::JSActivation::JSActivation): 19160 * kjs/JSActivation.h: 19161 (JSC::JSActivation::createStructureID): 19162 * kjs/JSCell.h: 19163 (JSC::JSValue::needsThisConversion): 19164 * kjs/JSGlobalData.cpp: 19165 (JSC::JSGlobalData::JSGlobalData): 19166 * kjs/JSGlobalData.h: 19167 * kjs/JSNumberCell.h: 19168 (JSC::JSNumberCell::createStructureID): 19169 * kjs/JSStaticScopeObject.h: 19170 (JSC::JSStaticScopeObject::JSStaticScopeObject): 19171 (JSC::JSStaticScopeObject::createStructureID): 19172 * kjs/JSString.h: 19173 (JSC::JSString::createStructureID): 19174 * kjs/JSValue.h: 19175 * kjs/TypeInfo.h: 19176 (JSC::TypeInfo::needsThisConversion): 19177 * kjs/nodes.h: 19178 (JSC::ScopeNode::usesThis): 19179 191802008-10-03 Cameron Zwarich <zwarich@apple.com> 19181 19182 Reviewed by Maciej Stachowiak. 19183 19184 Bug 21356: The size of the RegisterFile differs depending on 32-bit / 64-bit and Debug / Release 19185 <https://bugs.webkit.org/show_bug.cgi?id=21356> 19186 19187 The RegisterFile decreases in size (measured in terms of numbers of 19188 Registers) as the size of a Register increases. This causes 19189 19190 js1_5/Regress/regress-159334.js 19191 19192 to fail in 64-bit debug builds. This fix makes the RegisterFile on all 19193 platforms the same size that it is in 32-bit Release builds. 19194 19195 * VM/RegisterFile.h: 19196 (JSC::RegisterFile::RegisterFile): 19197 191982008-10-03 Maciej Stachowiak <mjs@apple.com> 19199 19200 Reviewed by Cameron Zwarich. 19201 19202 - Some code cleanup to how we handle code features. 19203 19204 1) Rename FeatureInfo typedef to CodeFeatures. 19205 2) Rename NodeFeatureInfo template to NodeInfo. 19206 3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools. 19207 4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning 19208 of ClosureFeature. 19209 5) Make setUsersArguments() not take an argument since it only goes one way. 19210 19211 * JavaScriptCore.exp: 19212 * VM/CodeBlock.h: 19213 (JSC::CodeBlock::CodeBlock): 19214 * kjs/NodeInfo.h: 19215 * kjs/Parser.cpp: 19216 (JSC::Parser::didFinishParsing): 19217 * kjs/Parser.h: 19218 (JSC::Parser::parse): 19219 * kjs/grammar.y: 19220 * kjs/nodes.cpp: 19221 (JSC::ScopeNode::ScopeNode): 19222 (JSC::ProgramNode::ProgramNode): 19223 (JSC::ProgramNode::create): 19224 (JSC::EvalNode::EvalNode): 19225 (JSC::EvalNode::create): 19226 (JSC::FunctionBodyNode::FunctionBodyNode): 19227 (JSC::FunctionBodyNode::create): 19228 * kjs/nodes.h: 19229 (JSC::ScopeNode::usesEval): 19230 (JSC::ScopeNode::containsClosures): 19231 (JSC::ScopeNode::usesArguments): 19232 (JSC::ScopeNode::setUsesArguments): 19233 192342008-10-03 Cameron Zwarich <zwarich@apple.com> 19235 19236 Reviewed by Maciej Stachowiak. 19237 19238 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit 19239 <https://bugs.webkit.org/show_bug.cgi?id=21343> 19240 19241 A fix was landed for this issue in r37253, and the ChangeLog assumes 19242 that it is a compiler bug, but it turns out that it is a subtle issue 19243 with mixing signed and unsigned 32-bit values in a 64-bit environment. 19244 In order to properly fix this bug, we should convert our signed offsets 19245 into the register file to use ptrdiff_t. 19246 19247 This may not be the only instance of this issue, but I will land this 19248 fix first and look for more later. 19249 19250 * VM/Machine.cpp: 19251 (JSC::Machine::getArgumentsData): 19252 * VM/Machine.h: 19253 * kjs/Arguments.cpp: 19254 (JSC::Arguments::getOwnPropertySlot): 19255 * kjs/Arguments.h: 19256 (JSC::Arguments::init): 19257 192582008-10-03 Darin Adler <darin@apple.com> 19259 19260 * VM/CTI.cpp: Another Windows build fix. Change the args of ctiTrampoline. 19261 19262 * kjs/JSNumberCell.h: A build fix for newer versions of gcc. Added 19263 declarations of JSGlobalData overloads of jsNumberCell. 19264 192652008-10-03 Darin Adler <darin@apple.com> 19266 19267 - try to fix Windows build 19268 19269 * kjs/ScopeChain.h: Add forward declaration of JSGlobalData. 19270 192712008-10-03 Darin Adler <darin@apple.com> 19272 19273 Reviewed by Geoff Garen. 19274 19275 - next step of https://bugs.webkit.org/show_bug.cgi?id=21295 19276 Turn ExecState into a call frame pointer. 19277 19278 Remove m_globalObject and m_globalData from ExecState. 19279 19280 SunSpider says this is a wash (slightly faster but not statistically 19281 significant); which is good enough since it's a preparation step and 19282 not supposed to be a spedup. 19283 19284 * API/JSCallbackFunction.cpp: 19285 (JSC::JSCallbackFunction::JSCallbackFunction): 19286 * kjs/ArrayConstructor.cpp: 19287 (JSC::ArrayConstructor::ArrayConstructor): 19288 * kjs/BooleanConstructor.cpp: 19289 (JSC::BooleanConstructor::BooleanConstructor): 19290 * kjs/DateConstructor.cpp: 19291 (JSC::DateConstructor::DateConstructor): 19292 * kjs/ErrorConstructor.cpp: 19293 (JSC::ErrorConstructor::ErrorConstructor): 19294 * kjs/FunctionPrototype.cpp: 19295 (JSC::FunctionPrototype::FunctionPrototype): 19296 * kjs/JSFunction.cpp: 19297 (JSC::JSFunction::JSFunction): 19298 * kjs/NativeErrorConstructor.cpp: 19299 (JSC::NativeErrorConstructor::NativeErrorConstructor): 19300 * kjs/NumberConstructor.cpp: 19301 (JSC::NumberConstructor::NumberConstructor): 19302 * kjs/ObjectConstructor.cpp: 19303 (JSC::ObjectConstructor::ObjectConstructor): 19304 * kjs/PrototypeFunction.cpp: 19305 (JSC::PrototypeFunction::PrototypeFunction): 19306 * kjs/RegExpConstructor.cpp: 19307 (JSC::RegExpConstructor::RegExpConstructor): 19308 * kjs/StringConstructor.cpp: 19309 (JSC::StringConstructor::StringConstructor): 19310 Pass JSGlobalData* instead of ExecState* to the InternalFunction 19311 constructor. 19312 19313 * API/OpaqueJSString.cpp: Added now-needed include. 19314 19315 * JavaScriptCore.exp: Updated. 19316 19317 * VM/CTI.cpp: 19318 (JSC::CTI::emitSlowScriptCheck): Changed to use ARGS_globalData 19319 instead of ARGS_exec. 19320 19321 * VM/CTI.h: Added a new argument to the CTI, the global data pointer. 19322 While it's possible to get to the global data pointer using the 19323 ExecState pointer, it's slow enough that it's better to just keep 19324 it around in the CTI arguments. 19325 19326 * VM/CodeBlock.h: Moved the CodeType enum here from ExecState.h. 19327 19328 * VM/Machine.cpp: 19329 (JSC::Machine::execute): Pass fewer arguments when constructing 19330 ExecState, and pass the global data pointer when invoking CTI. 19331 (JSC::Machine::firstCallFrame): Added. Used to get the dynamic global 19332 object, which is in the scope chain of the first call frame. 19333 (JSC::Machine::cti_op_add): Use globalData instead of exec when 19334 possible, to keep fast cases fast, since it's now more expensive to 19335 get to it through the exec pointer. 19336 (JSC::Machine::cti_timeout_check): Ditto. 19337 (JSC::Machine::cti_op_put_by_id_second): Ditto. 19338 (JSC::Machine::cti_op_get_by_id_second): Ditto. 19339 (JSC::Machine::cti_op_mul): Ditto. 19340 (JSC::Machine::cti_vm_compile): Ditto. 19341 (JSC::Machine::cti_op_get_by_val): Ditto. 19342 (JSC::Machine::cti_op_sub): Ditto. 19343 (JSC::Machine::cti_op_put_by_val): Ditto. 19344 (JSC::Machine::cti_op_put_by_val_array): Ditto. 19345 (JSC::Machine::cti_op_negate): Ditto. 19346 (JSC::Machine::cti_op_div): Ditto. 19347 (JSC::Machine::cti_op_pre_dec): Ditto. 19348 (JSC::Machine::cti_op_post_inc): Ditto. 19349 (JSC::Machine::cti_op_lshift): Ditto. 19350 (JSC::Machine::cti_op_bitand): Ditto. 19351 (JSC::Machine::cti_op_rshift): Ditto. 19352 (JSC::Machine::cti_op_bitnot): Ditto. 19353 (JSC::Machine::cti_op_mod): Ditto. 19354 (JSC::Machine::cti_op_post_dec): Ditto. 19355 (JSC::Machine::cti_op_urshift): Ditto. 19356 (JSC::Machine::cti_op_bitxor): Ditto. 19357 (JSC::Machine::cti_op_bitor): Ditto. 19358 (JSC::Machine::cti_op_call_eval): Ditto. 19359 (JSC::Machine::cti_op_throw): Ditto. 19360 (JSC::Machine::cti_op_is_string): Ditto. 19361 (JSC::Machine::cti_op_debug): Ditto. 19362 (JSC::Machine::cti_vm_throw): Ditto. 19363 19364 * VM/Machine.h: Added firstCallFrame. 19365 19366 * kjs/DebuggerCallFrame.cpp: 19367 (JSC::DebuggerCallFrame::evaluate): Pass fewer arguments when 19368 constructing ExecState. 19369 19370 * kjs/ExecState.cpp: Deleted contents. Later we'll remove the 19371 file altogether. 19372 19373 * kjs/ExecState.h: Removed m_globalObject and m_globalData. 19374 Moved CodeType into another header. 19375 (JSC::ExecState::ExecState): Take only a single argument, a 19376 call frame pointer. 19377 (JSC::ExecState::dynamicGlobalObject): Get the object from 19378 the first call frame since it's no longer stored. 19379 (JSC::ExecState::globalData): Get the global data from the 19380 scope chain, since we no longer store a pointer to it here. 19381 (JSC::ExecState::identifierTable): Ditto. 19382 (JSC::ExecState::propertyNames): Ditto. 19383 (JSC::ExecState::emptyList): Ditto. 19384 (JSC::ExecState::lexer): Ditto. 19385 (JSC::ExecState::parser): Ditto. 19386 (JSC::ExecState::machine): Ditto. 19387 (JSC::ExecState::arrayTable): Ditto. 19388 (JSC::ExecState::dateTable): Ditto. 19389 (JSC::ExecState::mathTable): Ditto. 19390 (JSC::ExecState::numberTable): Ditto. 19391 (JSC::ExecState::regExpTable): Ditto. 19392 (JSC::ExecState::regExpConstructorTable): Ditto. 19393 (JSC::ExecState::stringTable): Ditto. 19394 (JSC::ExecState::heap): Ditto. 19395 19396 * kjs/FunctionConstructor.cpp: 19397 (JSC::FunctionConstructor::FunctionConstructor): Pass 19398 JSGlobalData* instead of ExecState* to the InternalFunction 19399 constructor. 19400 (JSC::constructFunction): Pass the global data pointer when 19401 constructing a new scope chain. 19402 19403 * kjs/InternalFunction.cpp: 19404 (JSC::InternalFunction::InternalFunction): Take a JSGlobalData* 19405 instead of an ExecState*. Later we can change more places to 19406 work this way -- it's more efficient to take the type you need 19407 since the caller might already have it. 19408 * kjs/InternalFunction.h: Ditto. 19409 19410 * kjs/JSCell.h: 19411 (JSC::JSCell::operator new): Added an overload that takes a 19412 JSGlobalData* so you can construct without an ExecState*. 19413 19414 * kjs/JSGlobalObject.cpp: 19415 (JSC::JSGlobalObject::init): Moved creation of the global scope 19416 chain in here, since it now requires a pointer to the global data. 19417 Moved the initialization of the call frame in here since it requires 19418 the global scope chain node. Removed the extra argument to ExecState 19419 when creating the global ExecState*. 19420 * kjs/JSGlobalObject.h: Removed initialization of globalScopeChain 19421 and the call frame from the JSGlobalObjectData constructor. Added 19422 a thisValue argument to the init function. 19423 19424 * kjs/JSNumberCell.cpp: Added versions of jsNumberCell that take 19425 JSGlobalData* rather than ExecState*. 19426 * kjs/JSNumberCell.h: 19427 (JSC::JSNumberCell::operator new): Added a version that takes 19428 JSGlobalData*. 19429 (JSC::JSNumberCell::JSNumberCell): Ditto. 19430 (JSC::jsNumber): Ditto. 19431 * kjs/JSString.cpp: 19432 (JSC::jsString): Ditto. 19433 (JSC::jsSubstring): Ditto. 19434 (JSC::jsOwnedString): Ditto. 19435 * kjs/JSString.h: 19436 (JSC::JSString::JSString): Changed to take JSGlobalData*. 19437 (JSC::jsEmptyString): Added a version that takes JSGlobalData*. 19438 (JSC::jsSingleCharacterString): Ditto. 19439 (JSC::jsSingleCharacterSubstring): Ditto. 19440 (JSC::jsNontrivialString): Ditto. 19441 (JSC::JSString::getIndex): Ditto. 19442 (JSC::jsString): Ditto. 19443 (JSC::jsSubstring): Ditto. 19444 (JSC::jsOwnedString): Ditto. 19445 19446 * kjs/ScopeChain.h: Added a globalData pointer to each node. 19447 (JSC::ScopeChainNode::ScopeChainNode): Initialize the globalData 19448 pointer. 19449 (JSC::ScopeChainNode::push): Set the global data pointer in the 19450 new node. 19451 (JSC::ScopeChain::ScopeChain): Take a globalData argument. 19452 19453 * kjs/SmallStrings.cpp: 19454 (JSC::SmallStrings::createEmptyString): Take JSGlobalData* instead of 19455 ExecState*. 19456 (JSC::SmallStrings::createSingleCharacterString): Ditto. 19457 * kjs/SmallStrings.h: 19458 (JSC::SmallStrings::emptyString): Ditto. 19459 (JSC::SmallStrings::singleCharacterString): Ditto. 19460 194612008-10-03 Cameron Zwarich <zwarich@apple.com> 19462 19463 Reviewed by Geoff Garen. 19464 19465 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit 19466 <https://bugs.webkit.org/show_bug.cgi?id=21343> 19467 19468 Add a workaround for a bug in GCC, which affects GCC 4.0, GCC 4.2, and 19469 llvm-gcc 4.2. I put it in an #ifdef because it was a slight regression 19470 on SunSpider in 32-bit, although that might be entirely random. 19471 19472 * kjs/Arguments.cpp: 19473 (JSC::Arguments::getOwnPropertySlot): 19474 194752008-10-03 Darin Adler <darin@apple.com> 19476 19477 Rubber stamped by Alexey Proskuryakov. 19478 19479 * kjs/Shell.cpp: (main): Don't delete JSGlobalData. Later, we need to change 19480 this tool to use public JavaScriptCore API instead. 19481 194822008-10-03 Darin Adler <darin@apple.com> 19483 19484 Suggested by Alexey Proskuryakov. 19485 19486 * kjs/JSGlobalData.cpp: 19487 (JSC::JSGlobalData::~JSGlobalData): Remove call to heap.destroy() because 19488 it's too late to ref the JSGlobalData object once it's already being 19489 destroyed. In practice this is not a problem because WebCore's JSGlobalData 19490 is never destroyed and JSGlobalContextRelease takes care of calling 19491 heap.destroy() in advance. 19492 194932008-10-02 Oliver Hunt <oliver@apple.com> 19494 19495 Reviewed by Maciej Stachowiak. 19496 19497 Replace SSE3 check with an SSE2 check, and implement SSE2 check on windows. 19498 19499 5.6% win on SunSpider on windows. 19500 19501 * VM/CTI.cpp: 19502 (JSC::isSSE2Present): 19503 (JSC::CTI::compileBinaryArithOp): 19504 (JSC::CTI::compileBinaryArithOpSlowCase): 19505 195062008-10-03 Maciej Stachowiak <mjs@apple.com> 19507 19508 Rubber stamped by Cameron Zwarich. 19509 19510 - fix mistaken change of | to || which caused a big perf regression on EarleyBoyer 19511 19512 * kjs/grammar.y: 19513 195142008-10-02 Darin Adler <darin@apple.com> 19515 19516 Reviewed by Geoff Garen. 19517 19518 - https://bugs.webkit.org/show_bug.cgi?id=21321 19519 Bug 21321: speed up JavaScriptCore by inlining Heap in JSGlobalData 19520 19521 1.019x as fast on SunSpider. 19522 19523 * API/JSBase.cpp: 19524 (JSEvaluateScript): Use heap. instead of heap-> to work with the heap. 19525 (JSCheckScriptSyntax): Ditto. 19526 (JSGarbageCollect): Ditto. 19527 (JSReportExtraMemoryCost): Ditto. 19528 * API/JSContextRef.cpp: 19529 (JSGlobalContextRetain): Ditto. 19530 (JSGlobalContextRelease): Destroy the heap with the destroy function instead 19531 of the delete operator. 19532 (JSContextGetGlobalObject): Use heap. instead of heap-> to work with the heap. 19533 * API/JSObjectRef.cpp: 19534 (JSObjectMake): Use heap. instead of heap-> to work with the heap. 19535 (JSObjectMakeFunctionWithCallback): Ditto. 19536 (JSObjectMakeConstructor): Ditto. 19537 (JSObjectMakeFunction): Ditto. 19538 (JSObjectMakeArray): Ditto. 19539 (JSObjectMakeDate): Ditto. 19540 (JSObjectMakeError): Ditto. 19541 (JSObjectMakeRegExp): Ditto. 19542 (JSObjectHasProperty): Ditto. 19543 (JSObjectGetProperty): Ditto. 19544 (JSObjectSetProperty): Ditto. 19545 (JSObjectGetPropertyAtIndex): Ditto. 19546 (JSObjectSetPropertyAtIndex): Ditto. 19547 (JSObjectDeleteProperty): Ditto. 19548 (JSObjectCallAsFunction): Ditto. 19549 (JSObjectCallAsConstructor): Ditto. 19550 (JSObjectCopyPropertyNames): Ditto. 19551 (JSPropertyNameAccumulatorAddName): Ditto. 19552 * API/JSValueRef.cpp: 19553 (JSValueIsEqual): Ditto. 19554 (JSValueIsInstanceOfConstructor): Ditto. 19555 (JSValueMakeNumber): Ditto. 19556 (JSValueMakeString): Ditto. 19557 (JSValueToNumber): Ditto. 19558 (JSValueToStringCopy): Ditto. 19559 (JSValueToObject): Ditto. 19560 (JSValueProtect): Ditto. 19561 (JSValueUnprotect): Ditto. 19562 19563 * kjs/ExecState.h: 19564 (JSC::ExecState::heap): Update to use the & operator. 19565 19566 * kjs/JSGlobalData.cpp: 19567 (JSC::JSGlobalData::JSGlobalData): Update to initialize a heap member 19568 instead of calling new to make a heap. 19569 (JSC::JSGlobalData::~JSGlobalData): Destroy the heap with the destroy 19570 function instead of the delete operator. 19571 * kjs/JSGlobalData.h: Change from Heap* to a Heap. 19572 * kjs/JSGlobalObject.cpp: 19573 (JSC::JSGlobalObject::mark): Use the & operator here. 19574 (JSC::JSGlobalObject::operator new): Use heap. instead of heap-> to work 19575 with the heap. 19576 195772008-10-02 Cameron Zwarich <zwarich@apple.com> 19578 19579 Reviewed by Geoff Garen. 19580 19581 Bug 21317: Replace RegisterFile size and capacity information with Register pointers 19582 <https://bugs.webkit.org/show_bug.cgi?id=21317> 19583 19584 This is a 2.3% speedup on the V8 DeltaBlue benchmark, a 3.3% speedup on 19585 the V8 Raytrace benchmark, and a 1.0% speedup on SunSpider. 19586 19587 * VM/Machine.cpp: 19588 (JSC::slideRegisterWindowForCall): 19589 (JSC::Machine::callEval): 19590 (JSC::Machine::execute): 19591 (JSC::Machine::privateExecute): 19592 (JSC::Machine::cti_op_call_JSFunction): 19593 (JSC::Machine::cti_op_construct_JSConstruct): 19594 * VM/RegisterFile.cpp: 19595 (JSC::RegisterFile::~RegisterFile): 19596 * VM/RegisterFile.h: 19597 (JSC::RegisterFile::RegisterFile): 19598 (JSC::RegisterFile::start): 19599 (JSC::RegisterFile::end): 19600 (JSC::RegisterFile::size): 19601 (JSC::RegisterFile::shrink): 19602 (JSC::RegisterFile::grow): 19603 (JSC::RegisterFile::lastGlobal): 19604 (JSC::RegisterFile::markGlobals): 19605 (JSC::RegisterFile::markCallFrames): 19606 * kjs/JSGlobalObject.cpp: 19607 (JSC::JSGlobalObject::copyGlobalsTo): 19608 196092008-10-02 Cameron Zwarich <zwarich@apple.com> 19610 19611 Rubber-stamped by Darin Adler. 19612 19613 Change bitwise operations introduced in r37166 to boolean operations. We 19614 only use bitwise operations over boolean operations for increasing 19615 performance in extremely hot code, but that does not apply to anything 19616 in the parser. 19617 19618 * kjs/grammar.y: 19619 196202008-10-02 Gavin Barraclough <barraclough@apple.com> 19621 19622 Reviewed by Darin Adler. 19623 19624 Fix for bug #21232 - should reset m_isPendingDash on flush, 19625 and should allow '\-' as beginning or end of a range (though 19626 not to specifiy a range itself). 19627 19628 * ChangeLog: 19629 * wrec/CharacterClassConstructor.cpp: 19630 (JSC::CharacterClassConstructor::put): 19631 (JSC::CharacterClassConstructor::flush): 19632 * wrec/CharacterClassConstructor.h: 19633 (JSC::CharacterClassConstructor::flushBeforeEscapedHyphen): 19634 * wrec/WREC.cpp: 19635 (JSC::WRECGenerator::generateDisjunction): 19636 (JSC::WRECParser::parseCharacterClass): 19637 (JSC::WRECParser::parseDisjunction): 19638 * wrec/WREC.h: 19639 196402008-10-02 Darin Adler <darin@apple.com> 19641 19642 Reviewed by Sam Weinig. 19643 19644 - remove the "static" from declarations in a header file, since we 19645 don't want them to have internal linkage 19646 19647 * VM/Machine.h: Remove the static keyword from the constant and the 19648 three inline functions that Geoff just moved here. 19649 196502008-10-02 Geoffrey Garen <ggaren@apple.com> 19651 19652 Reviewed by Sam Weinig. 19653 19654 Fixed https://bugs.webkit.org/show_bug.cgi?id=21283. 19655 Profiler Crashes When Started 19656 19657 * VM/Machine.cpp: 19658 * VM/Machine.h: 19659 (JSC::makeHostCallFramePointer): 19660 (JSC::isHostCallFrame): 19661 (JSC::stripHostCallFrameBit): Moved some things to the header so 19662 JSGlobalObject could use them. 19663 19664 * kjs/JSGlobalObject.h: 19665 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Call the 19666 new makeHostCallFramePointer API, since 0 no longer indicates a host 19667 call frame. 19668 196692008-10-02 Alexey Proskuryakov <ap@webkit.org> 19670 19671 Reviewed by Darin Adler. 19672 19673 https://bugs.webkit.org/show_bug.cgi?id=21304 19674 Stop using a static wrapper map for WebCore JS bindings 19675 19676 * kjs/JSGlobalData.cpp: 19677 (JSC::JSGlobalData::JSGlobalData): 19678 (JSC::JSGlobalData::~JSGlobalData): 19679 (JSC::JSGlobalData::ClientData::~ClientData): 19680 * kjs/JSGlobalData.h: 19681 Added a client data member to JSGlobalData. WebCore will use it to store bindings-related 19682 global data. 19683 19684 * JavaScriptCore.exp: Export virtual ClientData destructor. 19685 196862008-10-02 Geoffrey Garen <ggaren@apple.com> 19687 19688 Not reviewed. 19689 19690 Try to fix Qt build. 19691 19692 * kjs/Error.h: 19693 196942008-10-01 Geoffrey Garen <ggaren@apple.com> 19695 19696 Reviewed by Darin Adler and Cameron Zwarich. 19697 19698 Preliminary step toward dynamic recompilation: Standardized and 19699 simplified the parsing interface. 19700 19701 The main goal in this patch is to make it easy to ask for a duplicate 19702 compilation, and get back a duplicate result -- same source URL, same 19703 debugger / profiler ID, same toString behavior, etc. 19704 19705 The basic unit of compilation and evaluation is now SourceCode, which 19706 encompasses a SourceProvider, a range in that provider, and a starting 19707 line number. 19708 19709 A SourceProvider now encompasses a source URL, and *is* a source ID, 19710 since a pointer is a unique identifier. 19711 19712 * API/JSBase.cpp: 19713 (JSEvaluateScript): 19714 (JSCheckScriptSyntax): Provide a SourceCode to the Interpreter, since 19715 other APIs are no longer supported. 19716 19717 * VM/CodeBlock.h: 19718 (JSC::EvalCodeCache::get): Provide a SourceCode to the Interpreter, since 19719 other APIs are no longer supported. 19720 (JSC::CodeBlock::CodeBlock): ASSERT something that used to be ASSERTed 19721 by our caller -- this is a better bottleneck. 19722 19723 * VM/CodeGenerator.cpp: 19724 (JSC::CodeGenerator::CodeGenerator): Updated for the fact that 19725 FunctionBodyNode's parameters are no longer a WTF::Vector. 19726 19727 * kjs/Arguments.cpp: 19728 (JSC::Arguments::Arguments): ditto 19729 19730 * kjs/DebuggerCallFrame.cpp: 19731 (JSC::DebuggerCallFrame::evaluate): Provide a SourceCode to the Parser, 19732 since other APIs are no longer supported. 19733 19734 * kjs/FunctionConstructor.cpp: 19735 (JSC::constructFunction): Provide a SourceCode to the Parser, since 19736 other APIs are no longer supported. Adopt FunctionBodyNode's new 19737 "finishParsing" API. 19738 19739 * kjs/JSFunction.cpp: 19740 (JSC::JSFunction::lengthGetter): 19741 (JSC::JSFunction::getParameterName): Updated for the fact that 19742 FunctionBodyNode's parameters are no longer a wtf::Vector. 19743 19744 * kjs/JSFunction.h: Nixed some cruft. 19745 19746 * kjs/JSGlobalObjectFunctions.cpp: 19747 (JSC::globalFuncEval): Provide a SourceCode to the Parser, since 19748 other APIs are no longer supported. 19749 19750 * kjs/Parser.cpp: 19751 (JSC::Parser::parse): Require a SourceCode argument, instead of a bunch 19752 of broken out parameters. Stop tracking sourceId as an integer, since we 19753 use the SourceProvider pointer for this now. Don't clamp the 19754 startingLineNumber, since SourceCode does that now. 19755 19756 * kjs/Parser.h: 19757 (JSC::Parser::parse): Standardized the parsing interface to require a 19758 SourceCode. 19759 19760 * kjs/Shell.cpp: 19761 (functionRun): 19762 (functionLoad): 19763 (prettyPrintScript): 19764 (runWithScripts): 19765 (runInteractive): Provide a SourceCode to the Interpreter, since 19766 other APIs are no longer supported. 19767 19768 * kjs/SourceProvider.h: 19769 (JSC::SourceProvider::SourceProvider): 19770 (JSC::SourceProvider::url): 19771 (JSC::SourceProvider::asId): 19772 (JSC::UStringSourceProvider::create): 19773 (JSC::UStringSourceProvider::UStringSourceProvider): Added new 19774 responsibilities described above. 19775 19776 * kjs/SourceRange.h: 19777 (JSC::SourceCode::SourceCode): 19778 (JSC::SourceCode::toString): 19779 (JSC::SourceCode::provider): 19780 (JSC::SourceCode::firstLine): 19781 (JSC::SourceCode::data): 19782 (JSC::SourceCode::length): Added new responsibilities described above. 19783 Renamed SourceRange to SourceCode, based on review feedback. Added 19784 a makeSource function for convenience. 19785 19786 * kjs/debugger.h: Provide a SourceCode to the client, since other APIs 19787 are no longer supported. 19788 19789 * kjs/grammar.y: Provide startingLineNumber when creating a SourceCode. 19790 19791 * kjs/debugger.h: Treat sourceId as intptr_t to avoid loss of precision 19792 on 64bit platforms. 19793 19794 * kjs/interpreter.cpp: 19795 (JSC::Interpreter::checkSyntax): 19796 (JSC::Interpreter::evaluate): 19797 * kjs/interpreter.h: Require a SourceCode instead of broken out arguments. 19798 19799 * kjs/lexer.cpp: 19800 (JSC::Lexer::setCode): 19801 * kjs/lexer.h: 19802 (JSC::Lexer::sourceRange): Fold together the SourceProvider and line number 19803 into a SourceCode. Fixed a bug where the Lexer would accidentally keep 19804 alive the last SourceProvider forever. 19805 19806 * kjs/nodes.cpp: 19807 (JSC::ScopeNode::ScopeNode): 19808 (JSC::ProgramNode::ProgramNode): 19809 (JSC::ProgramNode::create): 19810 (JSC::EvalNode::EvalNode): 19811 (JSC::EvalNode::generateCode): 19812 (JSC::EvalNode::create): 19813 (JSC::FunctionBodyNode::FunctionBodyNode): 19814 (JSC::FunctionBodyNode::finishParsing): 19815 (JSC::FunctionBodyNode::create): 19816 (JSC::FunctionBodyNode::generateCode): 19817 (JSC::ProgramNode::generateCode): 19818 (JSC::FunctionBodyNode::paramString): 19819 * kjs/nodes.h: 19820 (JSC::ScopeNode::): 19821 (JSC::ScopeNode::sourceId): 19822 (JSC::FunctionBodyNode::): 19823 (JSC::FunctionBodyNode::parameterCount): 19824 (JSC::FuncExprNode::): 19825 (JSC::FuncDeclNode::): Store a SourceCode in all ScopeNodes, since 19826 SourceCode is now responsible for tracking URL, ID, etc. Streamlined 19827 some ad hoc FunctionBodyNode fixups into a "finishParsing" function, to 19828 help make clear what you need to do in order to finish parsing a 19829 FunctionBodyNode. 19830 19831 * wtf/Vector.h: 19832 (WTF::::releaseBuffer): Don't ASSERT that releaseBuffer() is only called 19833 when buffer is not 0, since FunctionBodyNode is more than happy 19834 to get back a 0 buffer, and other functions like RefPtr::release() allow 19835 for 0, too. 19836 198372008-10-01 Cameron Zwarich <zwarich@apple.com> 19838 19839 Reviewed by Maciej Stachowiak. 19840 19841 Bug 21289: REGRESSION (r37160): Inspector crashes on load 19842 <https://bugs.webkit.org/show_bug.cgi?id=21289> 19843 19844 The code in Arguments::mark() in r37160 was wrong. It marks indices in 19845 d->registers, but that makes no sense (they are local variables, not 19846 arguments). It should mark those indices in d->registerArray instead. 19847 19848 This patch also changes Arguments::copyRegisters() to use d->numParameters 19849 instead of recomputing it. 19850 19851 * kjs/Arguments.cpp: 19852 (JSC::Arguments::mark): 19853 * kjs/Arguments.h: 19854 (JSC::Arguments::copyRegisters): 19855 198562008-09-30 Darin Adler <darin@apple.com> 19857 19858 Reviewed by Eric Seidel. 19859 19860 - https://bugs.webkit.org/show_bug.cgi?id=21214 19861 work on getting rid of ExecState 19862 19863 Eliminate some unneeded uses of dynamicGlobalObject. 19864 19865 * API/JSClassRef.cpp: 19866 (OpaqueJSClass::contextData): Changed to use a map in the global data instead 19867 of on the global object. Also fixed to use only a single hash table lookup. 19868 19869 * API/JSObjectRef.cpp: 19870 (JSObjectMakeConstructor): Use lexicalGlobalObject rather than dynamicGlobalObject 19871 to get the object prototype. 19872 19873 * kjs/ArrayPrototype.cpp: 19874 (JSC::arrayProtoFuncToString): Use arrayVisitedElements set in global data rather 19875 than in the global object. 19876 (JSC::arrayProtoFuncToLocaleString): Ditto. 19877 (JSC::arrayProtoFuncJoin): Ditto. 19878 19879 * kjs/JSGlobalData.cpp: 19880 (JSC::JSGlobalData::JSGlobalData): Don't initialize opaqueJSClassData, since 19881 it's no longer a pointer. 19882 (JSC::JSGlobalData::~JSGlobalData): We still need to delete all the values, but 19883 we don't need to delete the map since it's no longer a pointer. 19884 19885 * kjs/JSGlobalData.h: Made opaqueJSClassData a map instead of a pointer to a map. 19886 Also added arrayVisitedElements. 19887 19888 * kjs/JSGlobalObject.h: Removed arrayVisitedElements. 19889 19890 * kjs/Shell.cpp: 19891 (functionRun): Use lexicalGlobalObject instead of dynamicGlobalObject. 19892 (functionLoad): Ditto. 19893 198942008-10-01 Cameron Zwarich <zwarich@apple.com> 19895 19896 Not reviewed. 19897 19898 Speculative Windows build fix. 19899 19900 * kjs/grammar.y: 19901 199022008-10-01 Cameron Zwarich <zwarich@apple.com> 19903 19904 Reviewed by Darin Adler. 19905 19906 Bug 21123: using "arguments" in a function should not force creation of an activation object 19907 <https://bugs.webkit.org/show_bug.cgi?id=21123> 19908 19909 Make the 'arguments' object not require a JSActivation. We store the 19910 'arguments' object in the OptionalCalleeArguments call frame slot. We 19911 need to be able to get the original 'arguments' object to tear it off 19912 when returning from a function, but 'arguments' may be assigned to in a 19913 number of ways. 19914 19915 Therefore, we use the OptionalCalleeArguments slot when we want to get 19916 the original activation or we know that 'arguments' was not assigned a 19917 different value. When 'arguments' may have been assigned a new value, 19918 we use a new local variable that is initialized with 'arguments'. Since 19919 a function parameter named 'arguments' may overwrite the value of 19920 'arguments', we also need to be careful to look up 'arguments' in the 19921 symbol table, so we get the parameter named 'arguments' instead of the 19922 local variable that we have added for holding the 'arguments' object. 19923 19924 This is a 19.1% win on the V8 Raytrace benchmark using the SunSpider 19925 harness, and a 20.7% win using the V8 harness. This amounts to a 6.5% 19926 total speedup on the V8 benchmark suite using the V8 harness. 19927 19928 * VM/CTI.cpp: 19929 (JSC::CTI::privateCompileMainPass): 19930 * VM/CodeBlock.h: 19931 * VM/CodeGenerator.cpp: 19932 (JSC::CodeGenerator::CodeGenerator): 19933 * VM/Machine.cpp: 19934 (JSC::Machine::unwindCallFrame): 19935 (JSC::Machine::privateExecute): 19936 (JSC::Machine::retrieveArguments): 19937 (JSC::Machine::cti_op_init_arguments): 19938 (JSC::Machine::cti_op_ret_activation_arguments): 19939 * VM/Machine.h: 19940 * VM/RegisterFile.h: 19941 (JSC::RegisterFile::): 19942 * kjs/Arguments.cpp: 19943 (JSC::Arguments::mark): 19944 (JSC::Arguments::fillArgList): 19945 (JSC::Arguments::getOwnPropertySlot): 19946 (JSC::Arguments::put): 19947 * kjs/Arguments.h: 19948 (JSC::Arguments::setRegisters): 19949 (JSC::Arguments::init): 19950 (JSC::Arguments::Arguments): 19951 (JSC::Arguments::copyRegisters): 19952 (JSC::JSActivation::copyRegisters): 19953 * kjs/JSActivation.cpp: 19954 (JSC::JSActivation::argumentsGetter): 19955 * kjs/JSActivation.h: 19956 (JSC::JSActivation::JSActivationData::JSActivationData): 19957 * kjs/grammar.y: 19958 * kjs/nodes.h: 19959 (JSC::ScopeNode::setUsesArguments): 19960 * masm/X86Assembler.h: 19961 (JSC::X86Assembler::): 19962 (JSC::X86Assembler::orl_mr): 19963 199642008-10-01 Kevin McCullough <kmccullough@apple.com> 19965 19966 Rubberstamped by Geoff Garen. 19967 19968 Remove BreakpointCheckStatement because it's not used anymore. 19969 No effect on sunspider or the jsc tests. 19970 19971 * kjs/nodes.cpp: 19972 * kjs/nodes.h: 19973 199742008-09-30 Oliver Hunt <oliver@apple.com> 19975 19976 Reviewed by Geoff Garen. 19977 19978 Improve performance of CTI on windows. 19979 19980 Currently on platforms where the compiler doesn't allow us to safely 19981 index relative to the address of a parameter we need to actually 19982 provide a pointer to CTI runtime call arguments. This patch improves 19983 performance in this case by making the CTI logic for restoring this 19984 parameter much less conservative by only resetting it before we actually 19985 make a call, rather than between each and every SF bytecode we generate 19986 code for. 19987 19988 This results in a 3.6% progression on the v8 benchmark when compiled with MSVC. 19989 19990 * VM/CTI.cpp: 19991 (JSC::CTI::emitCall): 19992 (JSC::CTI::compileOpCall): 19993 (JSC::CTI::privateCompileMainPass): 19994 (JSC::CTI::privateCompileSlowCases): 19995 (JSC::CTI::privateCompilePutByIdTransition): 19996 * VM/CTI.h: 19997 * masm/X86Assembler.h: 19998 * wtf/Platform.h: 19999 200002008-09-30 Maciej Stachowiak <mjs@apple.com> 20001 20002 Reviewed by Oliver Hunt. 20003 20004 - track uses of "this", "with" and "catch" in the parser 20005 20006 Knowing this up front will be useful for future optimizations. 20007 20008 Perf and correctness remain the same. 20009 20010 * kjs/NodeInfo.h: 20011 * kjs/grammar.y: 20012 200132008-09-30 Sam Weinig <sam@webkit.org> 20014 20015 Reviewed by Mark Rowe. 20016 20017 Add WebKitAvailability macros for JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, 20018 and JSObjectMakeRegExp 20019 20020 * API/JSObjectRef.h: 20021 200222008-09-30 Darin Adler <darin@apple.com> 20023 20024 Reviewed by Geoff Garen. 20025 20026 - https://bugs.webkit.org/show_bug.cgi?id=21214 20027 work on getting rid of ExecState 20028 20029 Replaced the m_prev field of ExecState with a bit in the 20030 call frame pointer to indicate "host" call frames. 20031 20032 * VM/Machine.cpp: 20033 (JSC::makeHostCallFramePointer): Added. Sets low bit. 20034 (JSC::isHostCallFrame): Added. Checks low bit. 20035 (JSC::stripHostCallFrameBit): Added. Clears low bit. 20036 (JSC::Machine::unwindCallFrame): Replaced null check that was 20037 formerly used to detect host call frames with an isHostCallFrame check. 20038 (JSC::Machine::execute): Pass in a host call frame pointer rather than 20039 always passing 0 when starting execution from the host. This allows us 20040 to follow the entire call frame pointer chain when desired, or to stop 20041 at the host calls when that's desired. 20042 (JSC::Machine::privateExecute): Replaced null check that was 20043 formerly used to detect host call frames with an isHostCallFrame check. 20044 (JSC::Machine::retrieveCaller): Ditto. 20045 (JSC::Machine::retrieveLastCaller): Ditto. 20046 (JSC::Machine::callFrame): Removed the code to walk up m_prev pointers 20047 and replaced it with code that uses the caller pointer and uses the 20048 stripHostCallFrameBit function. 20049 20050 * kjs/ExecState.cpp: Removed m_prev. 20051 * kjs/ExecState.h: Ditto. 20052 200532008-09-30 Cameron Zwarich <zwarich@apple.com> 20054 20055 Reviewed by Geoff Garen. 20056 20057 Move all detection of 'arguments' in a lexical scope to the parser, in 20058 preparation for fixing 20059 20060 Bug 21123: using "arguments" in a function should not force creation of an activation object 20061 <https://bugs.webkit.org/show_bug.cgi?id=21123> 20062 20063 * VM/CodeGenerator.cpp: 20064 (JSC::CodeGenerator::CodeGenerator): 20065 * kjs/NodeInfo.h: 20066 * kjs/grammar.y: 20067 200682008-09-30 Geoffrey Garen <ggaren@apple.com> 20069 20070 Not reviewed. 20071 20072 * kjs/Shell.cpp: 20073 (runWithScripts): Fixed indentation. 20074 200752008-09-30 Mark Rowe <mrowe@apple.com> 20076 20077 Rubber-stamped by Sam Weinig. 20078 20079 Build fix. Move InternalFunction::classInfo implementation into the .cpp 20080 file to prevent the vtable for InternalFunction being generated as a weak symbol. 20081 Has no effect on SunSpider. 20082 20083 * kjs/InternalFunction.cpp: 20084 (JSC::InternalFunction::classInfo): 20085 * kjs/InternalFunction.h: 20086 200872008-09-29 Maciej Stachowiak <mjs@apple.com> 20088 20089 Reviewed by Darin Adler. 20090 20091 - optimize appending a number to a string 20092 https://bugs.webkit.org/show_bug.cgi?id=21203 20093 20094 It's pretty common in real-world code (and on some of the v8 20095 benchmarks) to append a number to a string, so I made this one of 20096 the fast cases, and also added support to UString to do it 20097 directly without allocating a temporary UString. 20098 20099 ~1% speedup on v8 benchmark. 20100 20101 * VM/Machine.cpp: 20102 (JSC::jsAddSlowCase): Make this NEVER_INLINE because somehow otherwise 20103 the change is a regression. 20104 (JSC::jsAdd): Handle number + string special case. 20105 (JSC::Machine::cti_op_add): Integrate much of the logic of jsAdd to 20106 avoid exception check in the str + str, num + num and str + num cases. 20107 * kjs/ustring.cpp: 20108 (JSC::expandedSize): Make this a non-member function, since it needs to be 20109 called in non-member functions but not outside this file. 20110 (JSC::expandCapacity): Ditto. 20111 (JSC::UString::expandCapacity): Call the non-member version. 20112 (JSC::createRep): Helper to make a rep from a char*. 20113 (JSC::UString::UString): Use above helper. 20114 (JSC::concatenate): Guts of concatenating constructor for cases where first 20115 item is a UString::Rep, and second is a UChar* and length, or a char*. 20116 (JSC::UString::append): Implement for cases where first item is a UString::Rep, 20117 and second is an int or double. Sadly duplicates logic of UString::from(int) 20118 and UString::from(double). 20119 * kjs/ustring.h: 20120 201212008-09-29 Darin Adler <darin@apple.com> 20122 20123 Reviewed by Sam Weinig. 20124 20125 - https://bugs.webkit.org/show_bug.cgi?id=21214 20126 work on getting rid of ExecState 20127 20128 * JavaScriptCore.exp: Updated since JSGlobalObject::init 20129 no longer takes a parameter. 20130 20131 * VM/Machine.cpp: 20132 (JSC::Machine::execute): Removed m_registerFile argument 20133 for ExecState constructors. 20134 20135 * kjs/DebuggerCallFrame.cpp: 20136 (JSC::DebuggerCallFrame::evaluate): Removed globalThisValue 20137 argument for ExecState constructor. 20138 20139 * kjs/ExecState.cpp: 20140 (JSC::ExecState::ExecState): Removed globalThisValue and 20141 registerFile arguments to constructors. 20142 20143 * kjs/ExecState.h: Removed m_globalThisValue and 20144 m_registerFile data members. 20145 20146 * kjs/JSGlobalObject.cpp: 20147 (JSC::JSGlobalObject::init): Removed globalThisValue 20148 argument for ExecState constructor. 20149 20150 * kjs/JSGlobalObject.h: 20151 (JSC::JSGlobalObject::JSGlobalObject): Got rid of parameter 20152 for the init function. 20153 201542008-09-29 Geoffrey Garen <ggaren@apple.com> 20155 20156 Rubber-stamped by Cameron Zwarich. 20157 20158 Fixed https://bugs.webkit.org/show_bug.cgi?id=21225 20159 Machine::retrieveLastCaller should check for a NULL codeBlock 20160 20161 In order to crash, you would need to call retrieveCaller in a situation 20162 where you had two host call frames in a row in the register file. I 20163 don't know how to make that happen, or if it's even possible, so I don't 20164 have a test case -- but better safe than sorry! 20165 20166 * VM/Machine.cpp: 20167 (JSC::Machine::retrieveLastCaller): 20168 201692008-09-29 Geoffrey Garen <ggaren@apple.com> 20170 20171 Reviewed by Cameron Zwarich. 20172 20173 Store the callee ScopeChain, not the caller ScopeChain, in the call frame 20174 header. Nix the "scopeChain" local variable and ExecState::m_scopeChain, and 20175 access the callee ScopeChain through the call frame header instead. 20176 20177 Profit: call + return are simpler, because they don't have to update the 20178 "scopeChain" local variable, or ExecState::m_scopeChain. 20179 20180 Because CTI keeps "r" in a register, reading the callee ScopeChain relative 20181 to "r" can be very fast, in any cases we care to optimize. 20182 20183 0% speedup on empty function call benchmark. (5.5% speedup in bytecode.) 20184 0% speedup on SunSpider. (7.5% speedup on controlflow-recursive.) 20185 2% speedup on SunSpider --v8. 20186 2% speedup on v8 benchmark. 20187 20188 * VM/CTI.cpp: Changed scope chain access to read the scope chain from 20189 the call frame header. Sped up op_ret by changing it not to fuss with 20190 the "scopeChain" local variable or ExecState::m_scopeChain. 20191 20192 * VM/CTI.h: Updated CTI trampolines not to take a ScopeChainNode* 20193 argument, since that's stored in the call frame header now. 20194 20195 * VM/Machine.cpp: Access "scopeChain" and "codeBlock" through new helper 20196 functions that read from the call frame header. Updated functions operating 20197 on ExecState::m_callFrame to account for / take advantage of the fact that 20198 Exec:m_callFrame is now never NULL. 20199 20200 Fixed a bug in op_construct, where it would use the caller's default 20201 object prototype, rather than the callee's, when constructing a new object. 20202 20203 * VM/Machine.h: Made some helper functions available. Removed 20204 ScopeChainNode* arguments to a lot of functions, since the ScopeChainNode* 20205 is now stored in the call frame header. 20206 20207 * VM/RegisterFile.h: Renamed "CallerScopeChain" to "ScopeChain", since 20208 that's what it is now. 20209 20210 * kjs/DebuggerCallFrame.cpp: Updated for change to ExecState signature. 20211 20212 * kjs/ExecState.cpp: 20213 * kjs/ExecState.h: Nixed ExecState::m_callFrame, along with the unused 20214 isGlobalObject function. 20215 20216 * kjs/JSGlobalObject.cpp: 20217 * kjs/JSGlobalObject.h: Gave the global object a fake call frame in 20218 which to store the global scope chain, since our code now assumes that 20219 it can always read the scope chain out of the ExecState's call frame. 20220 202212008-09-29 Cameron Zwarich <cwzwarich@uwaterloo.ca> 20222 20223 Reviewed by Sam Weinig. 20224 20225 Remove the isActivationObject() virtual method on JSObject and use 20226 StructureID information instead. This should be slightly faster, but 20227 isActivationObject() is only used in assertions and unwinding the stack 20228 for exceptions. 20229 20230 * VM/Machine.cpp: 20231 (JSC::depth): 20232 (JSC::Machine::unwindCallFrame): 20233 (JSC::Machine::privateExecute): 20234 (JSC::Machine::cti_op_ret_activation): 20235 * kjs/JSActivation.cpp: 20236 * kjs/JSActivation.h: 20237 * kjs/JSObject.h: 20238 202392008-09-29 Peter Gal <galpeter@inf.u-szeged.hu> 20240 20241 Reviewed and tweaked by Darin Adler. 20242 20243 Fix build for non-all-in-one platforms. 20244 20245 * kjs/StringPrototype.cpp: Added missing ASCIICType.h include. 20246 202472008-09-29 Bradley T. Hughes <bradley.hughes@nokia.com> 20248 20249 Reviewed by Simon Hausmann. 20250 20251 Fix compilation with icpc 20252 20253 * wtf/HashSet.h: 20254 (WTF::::find): 20255 (WTF::::contains): 20256 202572008-09-29 Thiago Macieira <thiago.macieira@nokia.com> 20258 20259 Reviewed by Simon Hausmann. 20260 20261 Changed copyright from Trolltech ASA to Nokia. 20262 20263 Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008. 20264 20265 20266 * wtf/qt/MainThreadQt.cpp: 20267 202682008-09-29 Simon Hausmann <hausmann@webkit.org> 20269 20270 Reviewed by Lars Knoll. 20271 20272 Don't accidentially install libJavaScriptCore.a for the build inside 20273 Qt. 20274 20275 * JavaScriptCore.pro: 20276 202772008-09-28 Cameron Zwarich <cwzwarich@uwaterloo.ca> 20278 20279 Reviewed by Maciej Stachowiak. 20280 20281 Bug 21200: Allow direct access to 'arguments' without using op_resolve 20282 <https://bugs.webkit.org/show_bug.cgi?id=21200> 20283 20284 Allow fast access to the 'arguments' object by adding an extra slot to 20285 the callframe to store it. 20286 20287 This is a 3.0% speedup on the V8 Raytrace benchmark. 20288 20289 * JavaScriptCore.exp: 20290 * VM/CTI.cpp: 20291 (JSC::CTI::privateCompileMainPass): 20292 * VM/CodeBlock.cpp: 20293 (JSC::CodeBlock::dump): 20294 * VM/CodeGenerator.cpp: 20295 (JSC::CodeGenerator::CodeGenerator): 20296 (JSC::CodeGenerator::registerFor): 20297 * VM/CodeGenerator.h: 20298 (JSC::CodeGenerator::registerFor): 20299 * VM/Machine.cpp: 20300 (JSC::Machine::initializeCallFrame): 20301 (JSC::Machine::dumpRegisters): 20302 (JSC::Machine::privateExecute): 20303 (JSC::Machine::retrieveArguments): 20304 (JSC::Machine::cti_op_call_JSFunction): 20305 (JSC::Machine::cti_op_create_arguments): 20306 (JSC::Machine::cti_op_construct_JSConstruct): 20307 * VM/Machine.h: 20308 * VM/Opcode.h: 20309 * VM/RegisterFile.h: 20310 (JSC::RegisterFile::): 20311 * kjs/JSActivation.cpp: 20312 (JSC::JSActivation::mark): 20313 (JSC::JSActivation::argumentsGetter): 20314 * kjs/JSActivation.h: 20315 (JSC::JSActivation::JSActivationData::JSActivationData): 20316 * kjs/NodeInfo.h: 20317 * kjs/Parser.cpp: 20318 (JSC::Parser::didFinishParsing): 20319 * kjs/Parser.h: 20320 (JSC::Parser::parse): 20321 * kjs/grammar.y: 20322 * kjs/nodes.cpp: 20323 (JSC::ScopeNode::ScopeNode): 20324 (JSC::ProgramNode::ProgramNode): 20325 (JSC::ProgramNode::create): 20326 (JSC::EvalNode::EvalNode): 20327 (JSC::EvalNode::create): 20328 (JSC::FunctionBodyNode::FunctionBodyNode): 20329 (JSC::FunctionBodyNode::create): 20330 * kjs/nodes.h: 20331 (JSC::ScopeNode::usesArguments): 20332 203332008-09-28 Mark Rowe <mrowe@apple.com> 20334 20335 Reviewed by Sam Weinig. 20336 20337 Add an ASCII fast-path to toLowerCase and toUpperCase. 20338 20339 The fast path speeds up the common case of an ASCII-only string by up to 60% while adding a less than 5% penalty 20340 to the less common non-ASCII case. 20341 20342 This also removes stringProtoFuncToLocaleLowerCase and stringProtoFuncToLocaleUpperCase, which were identical 20343 to the non-locale variants of the functions. toLocaleLowerCase and toLocaleUpperCase now use the non-locale 20344 variants of the functions directly. 20345 20346 * kjs/StringPrototype.cpp: 20347 (JSC::stringProtoFuncToLowerCase): 20348 (JSC::stringProtoFuncToUpperCase): 20349 203502008-09-28 Mark Rowe <mrowe@apple.com> 20351 20352 Reviewed by Cameron Zwarich. 20353 20354 Speed up parseInt and parseFloat. 20355 20356 Repeatedly indexing into a UString is slow, so retrieve a pointer into the underlying buffer once up front 20357 and use that instead. This is a 7% win on a parseInt/parseFloat micro-benchmark. 20358 20359 * kjs/JSGlobalObjectFunctions.cpp: 20360 (JSC::parseInt): 20361 (JSC::parseFloat): 20362 203632008-09-28 Simon Hausmann <hausmann@webkit.org> 20364 20365 Reviewed by David Hyatt. 20366 20367 In Qt's initializeThreading re-use an existing thread identifier for the main 20368 thread if it exists. 20369 20370 currentThread() implicitly creates new identifiers and it could be that 20371 it is called before initializeThreading(). 20372 20373 * wtf/ThreadingQt.cpp: 20374 (WTF::initializeThreading): 20375 203762008-09-27 Keishi Hattori <casey.hattori@gmail.com> 20377 20378 Added Machine::retrieveCaller to the export list. 20379 20380 Reviewed by Kevin McCullough and Tim Hatcher. 20381 20382 * JavaScriptCore.exp: Added Machine::retrieveCaller. 20383 203842008-09-27 Anders Carlsson <andersca@apple.com> 20385 20386 Fix build. 20387 20388 * VM/CTI.cpp: 20389 (JSC::): 20390 203912008-09-27 Geoffrey Garen <ggaren@apple.com> 20392 20393 Reviewed by Cameron Zwarich. 20394 20395 https://bugs.webkit.org/show_bug.cgi?id=21175 20396 20397 Store the callee CodeBlock, not the caller CodeBlock, in the call frame 20398 header. Nix the "codeBlock" local variable, and access the callee 20399 CodeBlock through the call frame header instead. 20400 20401 Profit: call + return are simpler, because they don't have to update the 20402 "codeBlock" local variable. 20403 20404 Because CTI keeps "r" in a register, reading the callee CodeBlock relative 20405 to "r" can be very fast, in any cases we care to optimize. Presently, 20406 no such cases seem important. 20407 20408 Also, stop writing "dst" to the call frame header. CTI doesn't use it. 20409 20410 21.6% speedup on empty function call benchmark. 20411 3.8% speedup on SunSpider --v8. 20412 2.1% speedup on v8 benchmark. 20413 0.7% speedup on SunSpider (6% speedup on controlflow-recursive). 20414 20415 Small regression in bytecode, because currently every op_ret reads the 20416 callee CodeBlock to check needsFullScopeChain, and bytecode does not 20417 keep "r" in a register. On-balance, this is probably OK, since CTI is 20418 our high-performance execution model. Also, this should go away once 20419 we make needsFullScopeChain statically determinable at parse time. 20420 20421 * VM/CTI.cpp: 20422 (JSC::CTI::compileOpCall): The speedup! 20423 (JSC::CTI::privateCompileSlowCases): ditto 20424 20425 * VM/CTI.h: 20426 (JSC::): Fixed up magic trampoline constants to account for the nixed 20427 "codeBlock" argument. 20428 (JSC::CTI::execute): Changed trampoline function not to take a "codeBlock" 20429 argument, since codeBlock is now stored in the call frame header. 20430 20431 * VM/Machine.cpp: Read the callee CodeBlock from the register file. Use 20432 a NULL CallerRegisters in the call frame header to signal a built-in 20433 caller, since CodeBlock is now never NULL. 20434 20435 * VM/Machine.h: Made some stand-alone functions Machine member functions 20436 so they could call the private codeBlock() accessor in the Register 20437 class, of which Machine is a friend. Renamed "CallerCodeBlock" to 20438 "CodeBlock", since it's no longer the caller's CodeBlock. 20439 20440 * VM/RegisterFile.h: Marked some methods const to accommodate a 20441 const RegisterFile* being passed around in Machine.cpp. 20442 204432008-09-26 Jan Michael Alonzo <jmalonzo@webkit.org> 20444 20445 Gtk build fix. Not reviewed. 20446 20447 Narrow-down the target of the JavaScriptCore .lut.h generator so 20448 it won't try to create the WebCore .lut.hs. 20449 20450 * GNUmakefile.am: 20451 204522008-09-26 Matt Lilek <webkit@mattlilek.com> 20453 20454 Reviewed by Tim Hatcher. 20455 20456 Update FEATURE_DEFINES after ENABLE_CROSS_DOCUMENT_MESSAGING was removed. 20457 20458 * Configurations/JavaScriptCore.xcconfig: 20459 204602008-09-26 Cameron Zwarich <cwzwarich@uwaterloo.ca> 20461 20462 Rubber-stamped by Anders Carlson. 20463 20464 Change the name 'sc' to 'scopeChainNode' in a few places. 20465 20466 * kjs/nodes.cpp: 20467 (JSC::EvalNode::generateCode): 20468 (JSC::FunctionBodyNode::generateCode): 20469 (JSC::ProgramNode::generateCode): 20470 204712008-09-26 Sam Weinig <sam@webkit.org> 20472 20473 Reviewed by Darin Adler. 20474 20475 Patch for https://bugs.webkit.org/show_bug.cgi?id=21152 20476 Speedup static property get/put 20477 20478 Convert getting/setting static property values to use static functions 20479 instead of storing an integer and switching in getValueProperty/putValueProperty. 20480 20481 * kjs/JSObject.cpp: 20482 (JSC::JSObject::deleteProperty): 20483 (JSC::JSObject::getPropertyAttributes): 20484 * kjs/MathObject.cpp: 20485 (JSC::MathObject::getOwnPropertySlot): 20486 * kjs/NumberConstructor.cpp: 20487 (JSC::numberConstructorNaNValue): 20488 (JSC::numberConstructorNegInfinity): 20489 (JSC::numberConstructorPosInfinity): 20490 (JSC::numberConstructorMaxValue): 20491 (JSC::numberConstructorMinValue): 20492 * kjs/PropertySlot.h: 20493 (JSC::PropertySlot::): 20494 * kjs/RegExpConstructor.cpp: 20495 (JSC::regExpConstructorDollar1): 20496 (JSC::regExpConstructorDollar2): 20497 (JSC::regExpConstructorDollar3): 20498 (JSC::regExpConstructorDollar4): 20499 (JSC::regExpConstructorDollar5): 20500 (JSC::regExpConstructorDollar6): 20501 (JSC::regExpConstructorDollar7): 20502 (JSC::regExpConstructorDollar8): 20503 (JSC::regExpConstructorDollar9): 20504 (JSC::regExpConstructorInput): 20505 (JSC::regExpConstructorMultiline): 20506 (JSC::regExpConstructorLastMatch): 20507 (JSC::regExpConstructorLastParen): 20508 (JSC::regExpConstructorLeftContext): 20509 (JSC::regExpConstructorRightContext): 20510 (JSC::setRegExpConstructorInput): 20511 (JSC::setRegExpConstructorMultiline): 20512 (JSC::RegExpConstructor::setInput): 20513 (JSC::RegExpConstructor::setMultiline): 20514 (JSC::RegExpConstructor::multiline): 20515 * kjs/RegExpConstructor.h: 20516 * kjs/RegExpObject.cpp: 20517 (JSC::regExpObjectGlobal): 20518 (JSC::regExpObjectIgnoreCase): 20519 (JSC::regExpObjectMultiline): 20520 (JSC::regExpObjectSource): 20521 (JSC::regExpObjectLastIndex): 20522 (JSC::setRegExpObjectLastIndex): 20523 * kjs/RegExpObject.h: 20524 (JSC::RegExpObject::setLastIndex): 20525 (JSC::RegExpObject::lastIndex): 20526 (JSC::RegExpObject::RegExpObjectData::RegExpObjectData): 20527 * kjs/StructureID.cpp: 20528 (JSC::StructureID::getEnumerablePropertyNames): 20529 * kjs/create_hash_table: 20530 * kjs/lexer.cpp: 20531 (JSC::Lexer::lex): 20532 * kjs/lookup.cpp: 20533 (JSC::HashTable::createTable): 20534 (JSC::HashTable::deleteTable): 20535 (JSC::setUpStaticFunctionSlot): 20536 * kjs/lookup.h: 20537 (JSC::HashEntry::initialize): 20538 (JSC::HashEntry::setKey): 20539 (JSC::HashEntry::key): 20540 (JSC::HashEntry::attributes): 20541 (JSC::HashEntry::function): 20542 (JSC::HashEntry::functionLength): 20543 (JSC::HashEntry::propertyGetter): 20544 (JSC::HashEntry::propertyPutter): 20545 (JSC::HashEntry::lexerValue): 20546 (JSC::HashEntry::): 20547 (JSC::HashTable::entry): 20548 (JSC::getStaticPropertySlot): 20549 (JSC::getStaticValueSlot): 20550 (JSC::lookupPut): 20551 205522008-09-26 Gavin Barraclough <barraclough@apple.com> 20553 20554 Reviewed by Maciej Stachowiak & Oliver Hunt. 20555 20556 Add support for reusing temporary JSNumberCells. This change is based on the observation 20557 that if the result of certain operations is a JSNumberCell and is consumed by a subsequent 20558 operation that would produce a JSNumberCell, we can reuse the object rather than allocating 20559 a fresh one. E.g. given the expression ((a * b) * c), we can statically determine that 20560 (a * b) will have a numeric result (or else it will have thrown an exception), so the result 20561 will either be a JSNumberCell or a JSImmediate. 20562 20563 This patch changes three areas of JSC: 20564 * The AST now tracks type information about the result of each node. 20565 * This information is consumed in bytecode compilation, and certain bytecode operations 20566 now carry the statically determined type information about their operands. 20567 * CTI uses the information in a number of fashions: 20568 * Where an operand to certain arithmetic operations is reusable, it will plant code 20569 to try to perform the operation in JIT code & reuse the cell, where appropriate. 20570 * Where it can be statically determined that an operand can only be numeric (typically 20571 the result of another arithmetic operation) the code will not redundantly check that 20572 the JSCell is a JSNumberCell. 20573 * Where either of the operands to an add are non-numeric do not plant an optimized 20574 arithmetic code path, just call straight out to the C function. 20575 20576 +6% Sunspider (10% progression on 3D, 16% progression on math, 60% progression on access-nbody), 20577 +1% v8-tests (improvements in raytrace & crypto) 20578 20579 * VM/CTI.cpp: Add optimized code generation with reuse of temporary JSNumberCells. 20580 * VM/CTI.h: 20581 * kjs/JSNumberCell.h: 20582 * masm/X86Assembler.h: 20583 20584 * VM/CodeBlock.cpp: Add type information to specific bytecodes. 20585 * VM/CodeGenerator.cpp: 20586 * VM/CodeGenerator.h: 20587 * VM/Machine.cpp: 20588 20589 * kjs/nodes.cpp: Track static type information for nodes. 20590 * kjs/nodes.h: 20591 * kjs/ResultDescriptor.h: (Added) 20592 * JavaScriptCore.xcodeproj/project.pbxproj: 20593 205942008-09-26 Yichao Yin <yichao.yin@torchmobile.com.cn> 20595 20596 Reviewed by George Staikos, Maciej Stachowiak. 20597 20598 Add utility functions needed for upcoming WML code. 20599 20600 * wtf/ASCIICType.h: 20601 (WTF::isASCIIPrintable): 20602 206032008-09-26 Geoffrey Garen <ggaren@apple.com> 20604 20605 Reviewed by Darin Adler. 20606 20607 Reverted the part of r36614 that used static data because static data 20608 is not thread-safe. 20609 206102008-09-26 Geoffrey Garen <ggaren@apple.com> 20611 20612 Reviewed by Maciej Stachowiak. 20613 20614 Removed dynamic check for whether the callee needs an activation object. 20615 Replaced with callee code to create the activation object. 20616 20617 0.5% speedup on SunSpider. 20618 No change on v8 benchmark. (Might be a speedup, but it's in range of the 20619 variance.) 20620 20621 0.7% speedup on v8 benchmark in bytecode. 20622 1.3% speedup on empty call benchmark in bytecode. 20623 20624 * VM/CTI.cpp: 20625 (JSC::CTI::privateCompileMainPass): Added support for op_init_activation, 20626 the new opcode that specifies that the callee's initialization should 20627 create an activation object. 20628 (JSC::CTI::privateCompile): Removed previous code that did a similar 20629 thing in an ad-hoc way. 20630 20631 * VM/CodeBlock.cpp: 20632 (JSC::CodeBlock::dump): Added a case for dumping op_init_activation. 20633 20634 * VM/CodeGenerator.cpp: 20635 (JSC::CodeGenerator::generate): Added fixup code to change op_init to 20636 op_init_activation if necessary. (With a better parser, we would know 20637 which to use from the beginning.) 20638 20639 * VM/Instruction.h: 20640 (JSC::Instruction::Instruction): 20641 (WTF::): Faster traits for the instruction vector. An earlier version 20642 of this patch relied on inserting at the beginning of the vector, and 20643 depended on this change for speed. 20644 20645 * VM/Machine.cpp: 20646 (JSC::Machine::execute): Removed clients of setScopeChain, the old 20647 abstraction for dynamically checking for whether an activation object 20648 needed to be created. 20649 (JSC::Machine::privateExecute): ditto 20650 20651 (JSC::Machine::cti_op_push_activation): Renamed this function from 20652 cti_vm_updateScopeChain, and made it faster by removing the call to 20653 setScopeChain. 20654 * VM/Machine.h: 20655 20656 * VM/Opcode.h: Declared op_init_activation. 20657 206582008-09-24 Geoffrey Garen <ggaren@apple.com> 20659 20660 Reviewed by Maciej Stachowiak. 20661 20662 Move most of the return code back into the callee, now that the callee 20663 doesn't have to calculate anything dynamically. 20664 20665 11.5% speedup on empty function call benchmark. 20666 20667 SunSpider says 0.3% faster. SunSpider --v8 says no change. 20668 20669 * VM/CTI.cpp: 20670 (JSC::CTI::compileOpCall): 20671 (JSC::CTI::privateCompileMainPass): 20672 (JSC::CTI::privateCompileSlowCases): 20673 206742008-09-24 Sam Weinig <sam@webkit.org> 20675 20676 Reviewed by Maciej Stachowiak. 20677 20678 Remove staticFunctionGetter. There is only one remaining user of 20679 staticFunctionGetter and it can be converted to use setUpStaticFunctionSlot. 20680 20681 * JavaScriptCore.exp: 20682 * kjs/lookup.cpp: 20683 * kjs/lookup.h: 20684 206852008-09-24 Maciej Stachowiak <mjs@apple.com> 20686 20687 Reviewed by Oliver Hunt. 20688 20689 - inline JIT fast case of op_neq 20690 - remove extra level of function call indirection from slow cases of eq and neq 20691 20692 1% speedup on Richards 20693 20694 * VM/CTI.cpp: 20695 (JSC::CTI::privateCompileMainPass): 20696 (JSC::CTI::privateCompileSlowCases): 20697 * VM/Machine.cpp: 20698 (JSC::Machine::privateExecute): 20699 (JSC::Machine::cti_op_eq): 20700 (JSC::Machine::cti_op_neq): 20701 * kjs/operations.cpp: 20702 (JSC::equal): 20703 (JSC::equalSlowCase): 20704 * kjs/operations.h: 20705 (JSC::equalSlowCaseInline): 20706 207072008-09-24 Sam Weinig <sam@webkit.org> 20708 20709 Reviewed by Darin Adler. 20710 20711 Fix for https://bugs.webkit.org/show_bug.cgi?id=21080 20712 <rdar://problem/6243534> 20713 Crash below Function.apply when using a runtime array as the argument list 20714 20715 Test: plugins/bindings-array-apply-crash.html 20716 20717 * kjs/FunctionPrototype.cpp: 20718 (JSC::functionProtoFuncApply): Revert to the slow case if the object inherits from 20719 JSArray (via ClassInfo) but is not a JSArray. 20720 207212008-09-24 Kevin McCullough <kmccullough@apple.com> 20722 20723 Style change. 20724 20725 * kjs/nodes.cpp: 20726 (JSC::statementListEmitCode): 20727 207282008-09-24 Kevin McCullough <kmccullough@apple.com> 20729 20730 Reviewed by Geoff. 20731 20732 Bug 21031: Breakpoints in the condition of loops only breaks the first 20733 time 20734 - Now when setting breakpoints in the condition of a loop (for, while, 20735 for in, and do while) will successfully break each time throught the 20736 loop. 20737 - For 'for' loops we need a little more complicated behavior that cannot 20738 be accomplished without some more significant changes: 20739 https://bugs.webkit.org/show_bug.cgi?id=21073 20740 20741 * kjs/nodes.cpp: 20742 (JSC::statementListEmitCode): We don't want to blindly emit a debug hook 20743 at the first line of loops, instead let the loop emit the debug hooks. 20744 (JSC::DoWhileNode::emitCode): 20745 (JSC::WhileNode::emitCode): 20746 (JSC::ForNode::emitCode): 20747 (JSC::ForInNode::emitCode): 20748 * kjs/nodes.h: 20749 (JSC::StatementNode::): 20750 (JSC::DoWhileNode::): 20751 (JSC::WhileNode::): 20752 (JSC::ForInNode::): 20753 207542008-09-24 Geoffrey Garen <ggaren@apple.com> 20755 20756 Reviewed by Darin Adler. 20757 20758 Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of 20759 the objects it retains 20760 20761 * API/tests/testapi.c: Test the new SPI a little. 20762 20763 * API/JSSPI.cpp: Add the new SPI. 20764 * API/JSSPI.h: Add the new SPI. 20765 * JavaScriptCore.exp: Add the new SPI. 20766 * JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI. 20767 207682008-09-24 Geoffrey Garen <ggaren@apple.com> 20769 20770 Reviewed by Darin Adler. 20771 20772 * API/JSBase.h: Filled in some missing function names. 20773 207742008-09-24 Geoffrey Garen <ggaren@apple.com> 20775 20776 Reviewed by Cameron Zwarich. 20777 20778 Fixed https://bugs.webkit.org/show_bug.cgi?id=21057 20779 Crash in RegisterID::deref() running fast/canvas/canvas-putImageData.html 20780 20781 * VM/CodeGenerator.h: Changed declaration order to ensure the 20782 m_lastConstant, which is a RefPtr that points into m_calleeRegisters, 20783 has its destructor called before the destructor for m_calleeRegisters. 20784 207852008-09-24 Darin Adler <darin@apple.com> 20786 20787 Reviewed by Sam Weinig. 20788 20789 - https://bugs.webkit.org/show_bug.cgi?id=21047 20790 speed up ret_activation with inlining 20791 20792 About 1% on v8-raytrace. 20793 20794 * JavaScriptCore.exp: Removed JSVariableObject::setRegisters. 20795 20796 * kjs/JSActivation.cpp: Moved copyRegisters to the header to make it inline. 20797 * kjs/JSActivation.h: 20798 (JSC::JSActivation::copyRegisters): Moved here. Also removed the registerArraySize 20799 argument to setRegisters, since the object doesn't need to store the number of 20800 registers. 20801 20802 * kjs/JSGlobalObject.cpp: 20803 (JSC::JSGlobalObject::reset): Removed unnecessary clearing left over from when we 20804 used this on objects that weren't brand new. These days, this function is really 20805 just part of the constructor. 20806 20807 * kjs/JSGlobalObject.h: Added registerArraySize to JSGlobalObjectData, since 20808 JSVariableObjectData no longer needs it. Added a setRegisters override here 20809 that handles storing the size. 20810 20811 * kjs/JSStaticScopeObject.h: Removed code to set registerArraySize, since it 20812 no longer exists. 20813 20814 * kjs/JSVariableObject.cpp: Moved copyRegisterArray and setRegisters to the 20815 header to make them inline. 20816 * kjs/JSVariableObject.h: Removed registerArraySize from JSVariableObjectData, 20817 since it was only used for the global object. 20818 (JSC::JSVariableObject::copyRegisterArray): Moved here ot make it inline. 20819 (JSC::JSVariableObject::setRegisters): Moved here to make it inline. Also 20820 removed the code to set registerArraySize and changed an if statement into 20821 an assert to save an unnnecessary branch. 20822 208232008-09-24 Maciej Stachowiak <mjs@apple.com> 20824 20825 Reviewed by Oliver Hunt. 20826 20827 - inline PropertyMap::getOffset to speed up polymorphic lookups 20828 20829 ~1.5% speedup on v8 benchmark 20830 no effect on SunSpider 20831 20832 * JavaScriptCore.exp: 20833 * kjs/PropertyMap.cpp: 20834 * kjs/PropertyMap.h: 20835 (JSC::PropertyMap::getOffset): 20836 208372008-09-24 Jan Michael Alonzo <jmalonzo@webkit.org> 20838 20839 Reviewed by Alp Toker. 20840 20841 https://bugs.webkit.org/show_bug.cgi?id=20992 20842 Build fails on GTK+ Mac OS 20843 20844 * wtf/ThreadingGtk.cpp: Remove platform ifdef as suggested by 20845 Richard Hult. 20846 (WTF::initializeThreading): 20847 208482008-09-23 Oliver Hunt <oliver@apple.com> 20849 20850 Reviewed by Maciej Stachowiak. 20851 20852 Bug 19968: Slow Script at www.huffingtonpost.com 20853 <https://bugs.webkit.org/show_bug.cgi?id=19968> 20854 20855 Finally found the cause of this accursed issue. It is triggered 20856 by synchronous creation of a new global object from JS. The new 20857 global object resets the timer state in this execution group's 20858 Machine, taking timerCheckCount to 0. Then when JS returns the 20859 timerCheckCount is decremented making it non-zero. The next time 20860 we execute JS we will start the timeout counter, however the non-zero 20861 timeoutCheckCount means we don't reset the timer information. This 20862 means that the timeout check is now checking the cumulative time 20863 since the creation of the global object rather than the time since 20864 JS was last entered. At this point the slow script dialog is guaranteed 20865 to eventually be displayed incorrectly unless a page is loaded 20866 asynchronously (which will reset everything into a sane state). 20867 20868 The fix for this is rather trivial -- the JSGlobalObject constructor 20869 should not be resetting the machine timer state. 20870 20871 * VM/Machine.cpp: 20872 (JSC::Machine::Machine): 20873 Now that we can't rely on the GlobalObject initialising the timeout 20874 state, we do it in the Machine constructor. 20875 20876 * VM/Machine.h: 20877 (JSC::Machine::stopTimeoutCheck): 20878 Add assertions to guard against this happening. 20879 20880 * kjs/JSGlobalObject.cpp: 20881 (JSC::JSGlobalObject::init): 20882 Don't reset the timeout state. 20883 208842008-09-23 Geoffrey Garen <ggaren@apple.com> 20885 20886 Reviewed by Oliver Hunt. 20887 20888 Fixed https://bugs.webkit.org/show_bug.cgi?id=21038 | <rdar://problem/6240812> 20889 Uncaught exceptions in regex replace callbacks crash webkit 20890 20891 This was a combination of two problems: 20892 20893 (1) the replace function would continue execution after an exception 20894 had been thrown. 20895 20896 (2) In some cases, the Machine would return 0 in the case of an exception, 20897 despite the fact that a few clients dereference the Machine's return 20898 value without first checking for an exception. 20899 20900 * VM/Machine.cpp: 20901 (JSC::Machine::execute): 20902 20903 ^ Return jsNull() instead of 0 in the case of an exception, since some 20904 clients depend on using our return value. 20905 20906 ^ ASSERT that execution does not continue after an exception has been 20907 thrown, to help catch problems like this in the future. 20908 20909 * kjs/StringPrototype.cpp: 20910 (JSC::stringProtoFuncReplace): 20911 20912 ^ Stop execution if an exception has been thrown. 20913 209142008-09-23 Geoffrey Garen <ggaren@apple.com> 20915 20916 Try to fix the windows build. 20917 20918 * VM/CTI.cpp: 20919 (JSC::CTI::compileOpCall): 20920 (JSC::CTI::privateCompileMainPass): 20921 209222008-09-23 Alp Toker <alp@nuanti.com> 20923 20924 Build fix. 20925 20926 * VM/CTI.h: 20927 209282008-09-23 Geoffrey Garen <ggaren@apple.com> 20929 20930 Reviewed by Darin Adler. 20931 20932 * wtf/Platform.h: Removed duplicate #if. 20933 209342008-09-23 Geoffrey Garen <ggaren@apple.com> 20935 20936 Reviewed by Darin Adler. 20937 20938 Changed the layout of the call frame from 20939 20940 { header, parameters, locals | constants, temporaries } 20941 20942 to 20943 20944 { parameters, header | locals, constants, temporaries } 20945 20946 This simplifies function entry+exit, and enables a number of future 20947 optimizations. 20948 20949 13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on 20950 empty call benchmark for CTI. 20951 20952 SunSpider says no change. SunSpider --v8 says 1% faster. 20953 20954 * VM/CTI.cpp: 20955 20956 Added a bit of abstraction for calculating whether a register is a 20957 constant, since this patch changes that calculation: 20958 (JSC::CTI::isConstant): 20959 (JSC::CTI::getConstant): 20960 (JSC::CTI::emitGetArg): 20961 (JSC::CTI::emitGetPutArg): 20962 (JSC::CTI::getConstantImmediateNumericArg): 20963 20964 Updated for changes to callframe header location: 20965 (JSC::CTI::emitPutToCallFrameHeader): 20966 (JSC::CTI::emitGetFromCallFrameHeader): 20967 (JSC::CTI::printOpcodeOperandTypes): 20968 20969 Renamed to spite Oliver: 20970 (JSC::CTI::emitInitRegister): 20971 20972 Added an abstraction for emitting a call through a register, so that 20973 calls through registers generate exception info, too: 20974 (JSC::CTI::emitCall): 20975 20976 Updated to match the new callframe header layout, and to support calls 20977 through registers, which have no destination address: 20978 (JSC::CTI::compileOpCall): 20979 (JSC::CTI::privateCompileMainPass): 20980 (JSC::CTI::privateCompileSlowCases): 20981 (JSC::CTI::privateCompile): 20982 20983 * VM/CTI.h: 20984 20985 More of the above: 20986 (JSC::CallRecord::CallRecord): 20987 20988 * VM/CodeBlock.cpp: 20989 20990 Updated for new register layout: 20991 (JSC::registerName): 20992 (JSC::CodeBlock::dump): 20993 20994 * VM/CodeBlock.h: 20995 20996 Updated CodeBlock to track slightly different information about the 20997 register frame, and tweaked the style of an ASSERT_NOT_REACHED. 20998 (JSC::CodeBlock::CodeBlock): 20999 (JSC::CodeBlock::getStubInfo): 21000 21001 * VM/CodeGenerator.cpp: 21002 21003 Added some abstraction around constant register allocation, since this 21004 patch changes it, changed codegen to account for the new callframe 21005 layout, and added abstraction around register fetching code 21006 that used to assume that all local registers lived at negative indices, 21007 since vars now live at positive indices: 21008 (JSC::CodeGenerator::generate): 21009 (JSC::CodeGenerator::addVar): 21010 (JSC::CodeGenerator::addGlobalVar): 21011 (JSC::CodeGenerator::allocateConstants): 21012 (JSC::CodeGenerator::CodeGenerator): 21013 (JSC::CodeGenerator::addParameter): 21014 (JSC::CodeGenerator::registerFor): 21015 (JSC::CodeGenerator::constRegisterFor): 21016 (JSC::CodeGenerator::newRegister): 21017 (JSC::CodeGenerator::newTemporary): 21018 (JSC::CodeGenerator::highestUsedRegister): 21019 (JSC::CodeGenerator::addConstant): 21020 21021 ASSERT that our caller referenced the registers it passed to us. 21022 Otherwise, we might overwrite them with parameters: 21023 (JSC::CodeGenerator::emitCall): 21024 (JSC::CodeGenerator::emitConstruct): 21025 21026 * VM/CodeGenerator.h: 21027 21028 Added some abstraction for getting a RegisterID for a given index, 21029 since the rules are a little weird: 21030 (JSC::CodeGenerator::registerFor): 21031 21032 * VM/Machine.cpp: 21033 21034 Utility function to transform a machine return PC to a virtual machine 21035 return VPC, for the sake of stack unwinding, since both PCs are stored 21036 in the same location now: 21037 (JSC::vPCForPC): 21038 21039 Tweaked to account for new call frame: 21040 (JSC::Machine::initializeCallFrame): 21041 21042 Tweaked to account for registerOffset supplied by caller: 21043 (JSC::slideRegisterWindowForCall): 21044 21045 Tweaked to account for new register layout: 21046 (JSC::scopeChainForCall): 21047 (JSC::Machine::callEval): 21048 (JSC::Machine::dumpRegisters): 21049 (JSC::Machine::unwindCallFrame): 21050 (JSC::Machine::execute): 21051 21052 Changed op_call and op_construct to implement the new calling convention: 21053 (JSC::Machine::privateExecute): 21054 21055 Tweaked to account for the new register layout: 21056 (JSC::Machine::retrieveArguments): 21057 (JSC::Machine::retrieveCaller): 21058 (JSC::Machine::retrieveLastCaller): 21059 (JSC::Machine::callFrame): 21060 (JSC::Machine::getArgumentsData): 21061 21062 Changed CTI call helpers to implement the new calling convention: 21063 (JSC::Machine::cti_op_call_JSFunction): 21064 (JSC::Machine::cti_op_call_NotJSFunction): 21065 (JSC::Machine::cti_op_ret_activation): 21066 (JSC::Machine::cti_op_ret_profiler): 21067 (JSC::Machine::cti_op_construct_JSConstruct): 21068 (JSC::Machine::cti_op_construct_NotJSConstruct): 21069 (JSC::Machine::cti_op_call_eval): 21070 21071 * VM/Machine.h: 21072 21073 * VM/Opcode.h: 21074 21075 Renamed op_initialise_locals to op_init, because this opcode 21076 doesn't initialize all locals, and it doesn't initialize only locals. 21077 Also, to spite Oliver. 21078 21079 * VM/RegisterFile.h: 21080 21081 New call frame enumeration values: 21082 (JSC::RegisterFile::): 21083 21084 Simplified the calculation of whether a RegisterID is a temporary, 21085 since we can no longer assume that all positive non-constant registers 21086 are temporaries: 21087 * VM/RegisterID.h: 21088 (JSC::RegisterID::RegisterID): 21089 (JSC::RegisterID::setTemporary): 21090 (JSC::RegisterID::isTemporary): 21091 21092 Renamed firstArgumentIndex to firstParameterIndex because the assumption 21093 that this variable pertained to the actual arguments supplied by the 21094 caller caused me to write some buggy code: 21095 * kjs/Arguments.cpp: 21096 (JSC::ArgumentsData::ArgumentsData): 21097 (JSC::Arguments::Arguments): 21098 (JSC::Arguments::fillArgList): 21099 (JSC::Arguments::getOwnPropertySlot): 21100 (JSC::Arguments::put): 21101 21102 Updated for new call frame layout: 21103 * kjs/DebuggerCallFrame.cpp: 21104 (JSC::DebuggerCallFrame::functionName): 21105 (JSC::DebuggerCallFrame::type): 21106 * kjs/DebuggerCallFrame.h: 21107 21108 Changed the activation object to account for the fact that a call frame 21109 header now sits between parameters and local variables. This change 21110 requires all variable objects to do their own marking, since they 21111 now use their register storage differently: 21112 * kjs/JSActivation.cpp: 21113 (JSC::JSActivation::mark): 21114 (JSC::JSActivation::copyRegisters): 21115 (JSC::JSActivation::createArgumentsObject): 21116 * kjs/JSActivation.h: 21117 21118 Updated global object to use the new interfaces required by the change 21119 to JSActivation above: 21120 * kjs/JSGlobalObject.cpp: 21121 (JSC::JSGlobalObject::reset): 21122 (JSC::JSGlobalObject::mark): 21123 (JSC::JSGlobalObject::copyGlobalsFrom): 21124 (JSC::JSGlobalObject::copyGlobalsTo): 21125 * kjs/JSGlobalObject.h: 21126 (JSC::JSGlobalObject::addStaticGlobals): 21127 21128 Updated static scope object to use the new interfaces required by the 21129 change to JSActivation above: 21130 * kjs/JSStaticScopeObject.cpp: 21131 (JSC::JSStaticScopeObject::mark): 21132 (JSC::JSStaticScopeObject::~JSStaticScopeObject): 21133 * kjs/JSStaticScopeObject.h: 21134 (JSC::JSStaticScopeObject::JSStaticScopeObject): 21135 (JSC::JSStaticScopeObject::d): 21136 21137 Updated variable object to use the new interfaces required by the 21138 change to JSActivation above: 21139 * kjs/JSVariableObject.cpp: 21140 (JSC::JSVariableObject::copyRegisterArray): 21141 (JSC::JSVariableObject::setRegisters): 21142 * kjs/JSVariableObject.h: 21143 21144 Changed the bit twiddling in symbol table not to assume that all indices 21145 are negative, since they can be positive now: 21146 * kjs/SymbolTable.h: 21147 (JSC::SymbolTableEntry::SymbolTableEntry): 21148 (JSC::SymbolTableEntry::isNull): 21149 (JSC::SymbolTableEntry::getIndex): 21150 (JSC::SymbolTableEntry::getAttributes): 21151 (JSC::SymbolTableEntry::setAttributes): 21152 (JSC::SymbolTableEntry::isReadOnly): 21153 (JSC::SymbolTableEntry::pack): 21154 (JSC::SymbolTableEntry::isValidIndex): 21155 21156 Changed call and construct nodes to ref their functions and/or bases, 21157 so that emitCall/emitConstruct doesn't overwrite them with parameters. 21158 Also, updated for rename to registerFor: 21159 * kjs/nodes.cpp: 21160 (JSC::ResolveNode::emitCode): 21161 (JSC::NewExprNode::emitCode): 21162 (JSC::EvalFunctionCallNode::emitCode): 21163 (JSC::FunctionCallValueNode::emitCode): 21164 (JSC::FunctionCallResolveNode::emitCode): 21165 (JSC::FunctionCallBracketNode::emitCode): 21166 (JSC::FunctionCallDotNode::emitCode): 21167 (JSC::PostfixResolveNode::emitCode): 21168 (JSC::DeleteResolveNode::emitCode): 21169 (JSC::TypeOfResolveNode::emitCode): 21170 (JSC::PrefixResolveNode::emitCode): 21171 (JSC::ReadModifyResolveNode::emitCode): 21172 (JSC::AssignResolveNode::emitCode): 21173 (JSC::ConstDeclNode::emitCodeSingle): 21174 (JSC::ForInNode::emitCode): 21175 21176 Added abstraction for getting exception info out of a call through a 21177 register: 21178 * masm/X86Assembler.h: 21179 (JSC::X86Assembler::emitCall): 21180 21181 Removed duplicate #if: 21182 * wtf/Platform.h: 21183 211842008-09-23 Kevin McCullough <kmccullough@apple.com> 21185 21186 Reviewed by Darin. 21187 21188 Bug 21030: The JS debugger breaks on the do of a do-while not the while 21189 (where the conditional statement is) 21190 https://bugs.webkit.org/show_bug.cgi?id=21030 21191 Now the statementListEmitCode detects if a do-while node is being 21192 emited and emits the debug hook on the last line instead of the first. 21193 21194 This change had no effect on sunspider. 21195 21196 * kjs/nodes.cpp: 21197 (JSC::statementListEmitCode): 21198 * kjs/nodes.h: 21199 (JSC::StatementNode::isDoWhile): 21200 (JSC::DoWhileNode::isDoWhile): 21201 212022008-09-23 Maciej Stachowiak <mjs@apple.com> 21203 21204 Reviewed by Cameron Zwarich. 21205 21206 - inline the fast case of instanceof 21207 https://bugs.webkit.org/show_bug.cgi?id=20818 21208 21209 ~2% speedup on EarleyBoyer test. 21210 21211 * VM/CTI.cpp: 21212 (JSC::CTI::privateCompileMainPass): 21213 (JSC::CTI::privateCompileSlowCases): 21214 * VM/Machine.cpp: 21215 (JSC::Machine::cti_op_instanceof): 21216 212172008-09-23 Maciej Stachowiak <mjs@apple.com> 21218 21219 Reviewed by Cameron Zwarich. 21220 21221 - add forgotten slow case logic for !== 21222 21223 * VM/CTI.cpp: 21224 (JSC::CTI::privateCompileSlowCases): 21225 212262008-09-23 Maciej Stachowiak <mjs@apple.com> 21227 21228 Reviewed by Cameron Zwarich. 21229 21230 - inline the fast cases of !==, same as for === 21231 21232 2.9% speedup on EarleyBoyer benchmark 21233 21234 * VM/CTI.cpp: 21235 (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function, 21236 and parameterized so it can do the reverse version as well. 21237 (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq. 21238 * VM/CTI.h: 21239 (JSC::CTI::): Declare above stuff. 21240 * VM/Machine.cpp: 21241 (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline. 21242 212432008-09-23 Cameron Zwarich <cwzwarich@uwaterloo.ca> 21244 21245 Reviewed by Oliver Hunt. 21246 21247 Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way 21248 <https://bugs.webkit.org/show_bug.cgi?id=20989> 21249 21250 Make special cases for the 'callee' and 'length' properties in the 21251 Arguments object. 21252 21253 This is somewhere between a 7.8% speedup and a 10% speedup on the V8 21254 Raytrace benchmark, depending on whether it is run alone or with the 21255 other V8 benchmarks. 21256 21257 * kjs/Arguments.cpp: 21258 (JSC::ArgumentsData::ArgumentsData): 21259 (JSC::Arguments::Arguments): 21260 (JSC::Arguments::mark): 21261 (JSC::Arguments::getOwnPropertySlot): 21262 (JSC::Arguments::put): 21263 (JSC::Arguments::deleteProperty): 21264 212652008-09-23 Maciej Stachowiak <mjs@apple.com> 21266 21267 Reviewed by Darin. 21268 21269 - speed up instanceof some more 21270 https://bugs.webkit.org/show_bug.cgi?id=20818 21271 21272 ~2% speedup on EarleyBoyer 21273 21274 The idea here is to record in the StructureID whether the class 21275 needs a special hasInstance or if it can use the normal logic from 21276 JSObject. 21277 21278 Based on this I inlined the real work directly into 21279 cti_op_instanceof and put the fastest checks up front and the 21280 error handling at the end (so it should be fairly straightforward 21281 to split off the beginning to be inlined if desired). 21282 21283 I only did this for CTI, not the bytecode interpreter. 21284 21285 * API/JSCallbackObject.h: 21286 (JSC::JSCallbackObject::createStructureID): 21287 * ChangeLog: 21288 * VM/Machine.cpp: 21289 (JSC::Machine::cti_op_instanceof): 21290 * kjs/JSImmediate.h: 21291 (JSC::JSImmediate::isAnyImmediate): 21292 * kjs/TypeInfo.h: 21293 (JSC::TypeInfo::overridesHasInstance): 21294 (JSC::TypeInfo::flags): 21295 212962008-09-22 Darin Adler <darin@apple.com> 21297 21298 Reviewed by Sam Weinig. 21299 21300 - https://bugs.webkit.org/show_bug.cgi?id=21019 21301 make FunctionBodyNode::ref/deref fast 21302 21303 Speeds up v8-raytrace by 7.2%. 21304 21305 * kjs/nodes.cpp: 21306 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0. 21307 * kjs/nodes.h: 21308 (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use 21309 m_refCount. 21310 (JSC::FunctionBodyNode::deref): Ditto, but the deref side. 21311 213122008-09-22 Darin Adler <darin@apple.com> 21313 21314 Pointed out by Sam Weinig. 21315 21316 * kjs/Arguments.cpp: 21317 (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops! 21318 213192008-09-22 Darin Adler <darin@apple.com> 21320 21321 Reviewed by Cameron Zwarich. 21322 21323 - https://bugs.webkit.org/show_bug.cgi?id=20983 21324 ArgumentsData should have some room to allocate some extra arguments inline 21325 21326 Speeds up v8-raytrace by 5%. 21327 21328 * kjs/Arguments.cpp: 21329 (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer 21330 extra arguments. 21331 (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer 21332 extra arguments. 21333 (JSC::Arguments::~Arguments): Delete the buffer if necessary. 21334 (JSC::Arguments::mark): Update since extraArguments are now Register. 21335 (JSC::Arguments::fillArgList): Added special case for the only case that's 21336 actually used in the practice, when there are no parameters. There are some 21337 other special cases in there too, but that's the only one that matters. 21338 (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's 21339 no operation to get you at the JSValue* inside a Register as a "slot". 21340 213412008-09-22 Sam Weinig <sam@webkit.org> 21342 21343 Reviewed by Maciej Stachowiak. 21344 21345 Patch for https://bugs.webkit.org/show_bug.cgi?id=21014 21346 Speed up for..in by using StructureID to avoid calls to hasProperty 21347 21348 Speeds up fasta by 8%. 21349 21350 * VM/JSPropertyNameIterator.cpp: 21351 (JSC::JSPropertyNameIterator::invalidate): 21352 * VM/JSPropertyNameIterator.h: 21353 (JSC::JSPropertyNameIterator::next): 21354 * kjs/PropertyNameArray.h: 21355 (JSC::PropertyNameArrayData::begin): 21356 (JSC::PropertyNameArrayData::end): 21357 (JSC::PropertyNameArrayData::setCachedStructureID): 21358 (JSC::PropertyNameArrayData::cachedStructureID): 21359 * kjs/StructureID.cpp: 21360 (JSC::StructureID::getEnumerablePropertyNames): 21361 (JSC::structureIDChainsAreEqual): 21362 * kjs/StructureID.h: 21363 213642008-09-22 Kelvin Sherlock <ksherlock@gmail.com> 21365 21366 Updated and tweaked by Sam Weinig. 21367 21368 Reviewed by Geoffrey Garen. 21369 21370 Bug 20020: Proposed enhancement to JavaScriptCore API 21371 <https://bugs.webkit.org/show_bug.cgi?id=20020> 21372 21373 Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp 21374 functions to create JavaScript Array, Date, Error, and RegExp objects, respectively. 21375 21376 * API/JSObjectRef.cpp: The functions 21377 * API/JSObjectRef.h: Function prototype and documentation 21378 * JavaScriptCore.exp: Added functions to exported function list 21379 * API/tests/testapi.c: Added basic functionality tests. 21380 21381 * kjs/DateConstructor.cpp: 21382 Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args) 21383 with JSObject* constructDate(ExecState* exec, const ArgList& args). 21384 Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function 21385 21386 * kjs/DateConstructor.h: 21387 added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args) 21388 21389 * kjs/ErrorConstructor.cpp: 21390 removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args) 21391 21392 * kjs/ErrorConstructor.h: 21393 added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args) 21394 21395 * kjs/RegExpConstructor.cpp: 21396 removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args) 21397 21398 * kjs/RegExpConstructor.h: 21399 added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args) 21400 214012008-09-22 Matt Lilek <webkit@mattlilek.com> 21402 21403 Not reviewed, Windows build fix. 21404 21405 * kjs/Arguments.cpp: 21406 * kjs/FunctionPrototype.cpp: 21407 214082008-09-22 Sam Weinig <sam@webkit.org> 21409 21410 Reviewed by Darin Adler. 21411 21412 Patch for https://bugs.webkit.org/show_bug.cgi?id=20982 21413 Speed up the apply method of functions by special-casing array and 'arguments' objects 21414 21415 1% speedup on v8-raytrace. 21416 21417 Test: fast/js/function-apply.html 21418 21419 * kjs/Arguments.cpp: 21420 (JSC::Arguments::fillArgList): 21421 * kjs/Arguments.h: 21422 * kjs/FunctionPrototype.cpp: 21423 (JSC::functionProtoFuncApply): 21424 * kjs/JSArray.cpp: 21425 (JSC::JSArray::fillArgList): 21426 * kjs/JSArray.h: 21427 214282008-09-22 Darin Adler <darin@apple.com> 21429 21430 Reviewed by Sam Weinig. 21431 21432 - https://bugs.webkit.org/show_bug.cgi?id=20993 21433 Array.push/pop need optimized cases for JSArray 21434 21435 3% or so speedup on DeltaBlue benchmark. 21436 21437 * kjs/ArrayPrototype.cpp: 21438 (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate. 21439 (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate. 21440 21441 * kjs/JSArray.cpp: 21442 (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting 21443 us into the fast code path. 21444 (JSC::JSArray::pop): Added. 21445 (JSC::JSArray::push): Added. 21446 * kjs/JSArray.h: Added push and pop. 21447 21448 * kjs/operations.cpp: 21449 (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches. 21450 214512008-09-22 Maciej Stachowiak <mjs@apple.com> 21452 21453 Reviewed by Cameron Zwarich. 21454 21455 - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag 21456 21457 Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818> 21458 21459 2.2% speedup on EarleyBoyer benchmark. 21460 21461 * API/JSCallbackConstructor.cpp: 21462 * API/JSCallbackConstructor.h: 21463 (JSC::JSCallbackConstructor::createStructureID): 21464 * API/JSCallbackFunction.cpp: 21465 * API/JSCallbackFunction.h: 21466 (JSC::JSCallbackFunction::createStructureID): 21467 * API/JSCallbackObject.h: 21468 (JSC::JSCallbackObject::createStructureID): 21469 * API/JSCallbackObjectFunctions.h: 21470 (JSC::::hasInstance): 21471 * API/JSValueRef.cpp: 21472 (JSValueIsInstanceOfConstructor): 21473 * JavaScriptCore.exp: 21474 * VM/Machine.cpp: 21475 (JSC::Machine::privateExecute): 21476 (JSC::Machine::cti_op_instanceof): 21477 * kjs/InternalFunction.cpp: 21478 * kjs/InternalFunction.h: 21479 (JSC::InternalFunction::createStructureID): 21480 * kjs/JSObject.cpp: 21481 * kjs/JSObject.h: 21482 * kjs/TypeInfo.h: 21483 (JSC::TypeInfo::implementsHasInstance): 21484 214852008-09-22 Maciej Stachowiak <mjs@apple.com> 21486 21487 Reviewed by Dave Hyatt. 21488 21489 Based on initial work by Darin Adler. 21490 21491 - replace masqueradesAsUndefined virtual method with a flag in TypeInfo 21492 - use this to JIT inline code for eq_null and neq_null 21493 https://bugs.webkit.org/show_bug.cgi?id=20823 21494 21495 0.5% speedup on SunSpider 21496 ~4% speedup on Richards benchmark 21497 21498 * VM/CTI.cpp: 21499 (JSC::CTI::privateCompileMainPass): 21500 * VM/Machine.cpp: 21501 (JSC::jsTypeStringForValue): 21502 (JSC::jsIsObjectType): 21503 (JSC::Machine::privateExecute): 21504 (JSC::Machine::cti_op_is_undefined): 21505 * VM/Machine.h: 21506 * kjs/JSCell.h: 21507 * kjs/JSValue.h: 21508 * kjs/StringObjectThatMasqueradesAsUndefined.h: 21509 (JSC::StringObjectThatMasqueradesAsUndefined::create): 21510 (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID): 21511 * kjs/StructureID.h: 21512 (JSC::StructureID::mutableTypeInfo): 21513 * kjs/TypeInfo.h: 21514 (JSC::TypeInfo::TypeInfo): 21515 (JSC::TypeInfo::masqueradesAsUndefined): 21516 * kjs/operations.cpp: 21517 (JSC::equal): 21518 * masm/X86Assembler.h: 21519 (JSC::X86Assembler::): 21520 (JSC::X86Assembler::setne_r): 21521 (JSC::X86Assembler::setnz_r): 21522 (JSC::X86Assembler::testl_i32m): 21523 215242008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com> 21525 21526 Reviewed by Simon. 21527 21528 Initialize QCoreApplication in kjs binary/Shell.cpp 21529 21530 This allows us to use QCoreApplication::instance() to 21531 get the main thread in ThreadingQt.cpp 21532 21533 * kjs/Shell.cpp: 21534 (main): 21535 * wtf/ThreadingQt.cpp: 21536 (WTF::initializeThreading): 21537 215382008-09-21 Darin Adler <darin@apple.com> 21539 21540 - blind attempt to fix non-all-in-one builds 21541 21542 * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h. 21543 215442008-09-21 Darin Adler <darin@apple.com> 21545 21546 - fix debug build 21547 21548 * kjs/StructureID.cpp: 21549 (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type. 21550 (JSC::StructureID::createCachedPrototypeChain): Ditto. 21551 215522008-09-21 Maciej Stachowiak <mjs@apple.com> 21553 21554 Reviewed by Darin Adler. 21555 21556 - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID 21557 https://bugs.webkit.org/show_bug.cgi?id=20981 21558 21559 * JavaScriptCore.exp: 21560 * JavaScriptCore.xcodeproj/project.pbxproj: 21561 * VM/CTI.cpp: 21562 (JSC::CTI::privateCompileMainPass): 21563 (JSC::CTI::privateCompilePutByIdTransition): 21564 * VM/Machine.cpp: 21565 (JSC::jsIsObjectType): 21566 (JSC::Machine::Machine): 21567 * kjs/AllInOneFile.cpp: 21568 * kjs/JSCell.h: 21569 (JSC::JSCell::isObject): 21570 (JSC::JSCell::isString): 21571 * kjs/JSGlobalData.cpp: 21572 (JSC::JSGlobalData::JSGlobalData): 21573 * kjs/JSGlobalObject.cpp: 21574 (JSC::JSGlobalObject::reset): 21575 * kjs/JSGlobalObject.h: 21576 (JSC::StructureID::prototypeForLookup): 21577 * kjs/JSNumberCell.h: 21578 (JSC::JSNumberCell::createStructureID): 21579 * kjs/JSObject.cpp: 21580 (JSC::JSObject::createInheritorID): 21581 * kjs/JSObject.h: 21582 (JSC::JSObject::createStructureID): 21583 * kjs/JSString.h: 21584 (JSC::JSString::createStructureID): 21585 * kjs/NativeErrorConstructor.cpp: 21586 (JSC::NativeErrorConstructor::NativeErrorConstructor): 21587 * kjs/RegExpConstructor.cpp: 21588 * kjs/RegExpMatchesArray.h: Added. 21589 (JSC::RegExpMatchesArray::getOwnPropertySlot): 21590 (JSC::RegExpMatchesArray::put): 21591 (JSC::RegExpMatchesArray::deleteProperty): 21592 (JSC::RegExpMatchesArray::getPropertyNames): 21593 * kjs/StructureID.cpp: 21594 (JSC::StructureID::StructureID): 21595 (JSC::StructureID::addPropertyTransition): 21596 (JSC::StructureID::toDictionaryTransition): 21597 (JSC::StructureID::changePrototypeTransition): 21598 (JSC::StructureID::getterSetterTransition): 21599 * kjs/StructureID.h: 21600 (JSC::StructureID::create): 21601 (JSC::StructureID::typeInfo): 21602 * kjs/TypeInfo.h: Added. 21603 (JSC::TypeInfo::TypeInfo): 21604 (JSC::TypeInfo::type): 21605 216062008-09-21 Darin Adler <darin@apple.com> 21607 21608 Reviewed by Cameron Zwarich. 21609 21610 - fix crash logging into Gmail due to recent Arguments change 21611 21612 * kjs/Arguments.cpp: 21613 (JSC::Arguments::Arguments): Fix window where mark() function could 21614 see d->extraArguments with uninitialized contents. 21615 (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two 21616 cases: 1) Inside the constructor before it's initialized. 21617 2) numArguments <= numParameters. 21618 216192008-09-21 Darin Adler <darin@apple.com> 21620 21621 - fix loose end from the "duplicate constant values" patch 21622 21623 * VM/CodeGenerator.cpp: 21624 (JSC::CodeGenerator::emitLoad): Add a special case for values the 21625 hash table can't handle. 21626 216272008-09-21 Mark Rowe <mrowe@apple.com> 21628 21629 Fix the non-AllInOneFile build. 21630 21631 * kjs/Arguments.cpp: Add missing #include. 21632 216332008-09-21 Darin Adler <darin@apple.com> 21634 21635 Reviewed by Cameron Zwarich and Mark Rowe. 21636 21637 - fix test failure caused by my recent IndexToNameMap patch 21638 21639 * kjs/Arguments.cpp: 21640 (JSC::Arguments::deleteProperty): Added the accidentally-omitted 21641 check of the boolean result from toArrayIndex. 21642 216432008-09-21 Darin Adler <darin@apple.com> 21644 21645 Reviewed by Maciej Stachowiak. 21646 21647 - https://bugs.webkit.org/show_bug.cgi?id=20975 21648 inline immediate-number case of == 21649 21650 * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to 21651 emitJumpSlowCaseIfNotImmNum, since the old name was incorrect. 21652 21653 * VM/CTI.cpp: Updated for new name. 21654 (JSC::CTI::privateCompileMainPass): Added op_eq. 21655 (JSC::CTI::privateCompileSlowCases): Added op_eq. 21656 21657 * VM/Machine.cpp: 21658 (JSC::Machine::cti_op_eq): Removed fast case, since it's now 21659 compiled. 21660 216612008-09-21 Peter Gal <galpter@inf.u-szeged.hu> 21662 21663 Reviewed by Tim Hatcher and Eric Seidel. 21664 21665 Fix the QT/Linux JavaScriptCore segmentation fault. 21666 https://bugs.webkit.org/show_bug.cgi?id=20914 21667 21668 * wtf/ThreadingQt.cpp: 21669 (WTF::initializeThreading): Use currentThread() if 21670 platform is not a MAC (like in pre 36541 revisions) 21671 216722008-09-21 Darin Adler <darin@apple.com> 21673 21674 Reviewed by Sam Weinig. 21675 21676 * kjs/debugger.h: Removed some unneeded includes and declarations. 21677 216782008-09-21 Darin Adler <darin@apple.com> 21679 21680 Reviewed by Sam Weinig. 21681 21682 - https://bugs.webkit.org/show_bug.cgi?id=20972 21683 speed up Arguments further by eliminating the IndexToNameMap 21684 21685 No change on SunSpider. 1.29x as fast on V8 Raytrace. 21686 21687 * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the 21688 indexToNameMap and hadDeletes data members. Changed extraArguments into 21689 an OwnArrayPtr and added deletedArguments, another OwnArrayPtr. 21690 Replaced numExtraArguments with numParameters, since that's what's 21691 used more directly in hot code paths. 21692 (JSC::Arguments::Arguments): Pass in argument count instead of ArgList. 21693 Initialize ArgumentsData the new way. 21694 (JSC::Arguments::mark): Updated. 21695 (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so 21696 we don't have to convert integers to identifiers just to get an argument. 21697 Integrated the deleted case with the fast case. 21698 (JSC::Arguments::put): Ditto. 21699 (JSC::Arguments::deleteProperty): Ditto. 21700 21701 * kjs/Arguments.h: Minimized includes. Made everything private. Added 21702 overloads for the integral property name case. Eliminated mappedIndexSetter. 21703 Moved ArgumentsData into the .cpp file. 21704 21705 * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion. 21706 * kjs/IndexToNameMap.h: Ditto. 21707 21708 * kjs/JSActivation.cpp: 21709 (JSC::JSActivation::createArgumentsObject): Elminated ArgList. 21710 21711 * GNUmakefile.am: 21712 * JavaScriptCore.pri: 21713 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 21714 * JavaScriptCore.xcodeproj/project.pbxproj: 21715 * JavaScriptCoreSources.bkl: 21716 * kjs/AllInOneFile.cpp: 21717 Removed IndexToNameMap. 21718 217192008-09-21 Darin Adler <darin@apple.com> 21720 21721 * VM/CodeGenerator.cpp: 21722 (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly 21723 clearer style. 21724 217252008-09-21 Judit Jasz <jasy@inf.u-szeged.hu> 21726 21727 Reviewed and tweaked by Darin Adler. 21728 21729 - https://bugs.webkit.org/show_bug.cgi?id=20645 21730 Elminate duplicate constant values in CodeBlocks. 21731 21732 Seems to be a wash on SunSpider. 21733 21734 * VM/CodeGenerator.cpp: 21735 (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee 21736 we emit the same JSValue* for identical numbers and strings. 21737 * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&. 21738 Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap. 21739 * kjs/nodes.cpp: 21740 (JSC::StringNode::emitCode): Call the new emitLoad and let it do the 21741 JSString creation. 21742 217432008-09-21 Paul Pedriana <webkit@pedriana.com> 21744 21745 Reviewed and tweaked by Darin Adler. 21746 21747 - https://bugs.webkit.org/show_bug.cgi?id=16925 21748 Fixed lack of Vector buffer alignment for both GCC and MSVC. 21749 Since there's no portable way to do this, for now we don't support 21750 other compilers. 21751 21752 * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer. 21753 Use AlignedBuffer insteadof an array of char in VectorBuffer. 21754 217552008-09-21 Gabor Loki <loki@inf.u-szeged.hu> 21756 21757 Reviewed by Darin Adler. 21758 21759 - https://bugs.webkit.org/show_bug.cgi?id=19408 21760 Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators. 21761 21762 1.008x as fast on SunSpider. 21763 21764 * kjs/grammar.y: 21765 (makeNegateNode): Fold if expression is a number > 0. 21766 (makeBitwiseNotNode): Fold if expression is a number. 21767 (makeMultNode): Fold if expressions are both numbers. 21768 (makeDivNode): Fold if expressions are both numbers. 21769 (makeAddNode): Fold if expressions are both numbers. 21770 (makeLeftShiftNode): Fold if expressions are both numbers. 21771 (makeRightShiftNode): Fold if expressions are both numbers. 21772 217732008-09-21 Maciej Stachowiak <mjs@apple.com> 21774 21775 Reviewed by Oliver. 21776 21777 - speed up === operator by generating inline machine code for the fast paths 21778 https://bugs.webkit.org/show_bug.cgi?id=20820 21779 21780 * VM/CTI.cpp: 21781 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber): 21782 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers): 21783 (JSC::CTI::emitJumpSlowCaseIfNotImmediates): 21784 (JSC::CTI::emitTagAsBoolImmediate): 21785 (JSC::CTI::privateCompileMainPass): 21786 (JSC::CTI::privateCompileSlowCases): 21787 * VM/CTI.h: 21788 * VM/Machine.cpp: 21789 (JSC::Machine::cti_op_stricteq): 21790 * masm/X86Assembler.h: 21791 (JSC::X86Assembler::): 21792 (JSC::X86Assembler::sete_r): 21793 (JSC::X86Assembler::setz_r): 21794 (JSC::X86Assembler::movzbl_rr): 21795 (JSC::X86Assembler::emitUnlinkedJnz): 21796 217972008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca> 21798 21799 Reviewed by Maciej Stachowiak. 21800 21801 Free memory allocated for extra arguments in the destructor of the 21802 Arguments object. 21803 21804 * kjs/Arguments.cpp: 21805 (JSC::Arguments::~Arguments): 21806 * kjs/Arguments.h: 21807 218082008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca> 21809 21810 Reviewed by Maciej Stachowiak. 21811 21812 Bug 20815: 'arguments' object creation is non-optimal 21813 <https://bugs.webkit.org/show_bug.cgi?id=20815> 21814 21815 Fix our inefficient way of creating the arguments object by only 21816 creating named properties for each of the arguments after a use of the 21817 'delete' statement. This patch also speeds up access to the 'arguments' 21818 object slightly, but it still does not use the array fast path for 21819 indexed access that exists for many opcodes. 21820 21821 This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5% 21822 improvement on the Earley-Boyer benchmark, which gives a 4% improvement 21823 overall. 21824 21825 * kjs/Arguments.cpp: 21826 (JSC::Arguments::Arguments): 21827 (JSC::Arguments::mark): 21828 (JSC::Arguments::getOwnPropertySlot): 21829 (JSC::Arguments::put): 21830 (JSC::Arguments::deleteProperty): 21831 * kjs/Arguments.h: 21832 (JSC::Arguments::ArgumentsData::ArgumentsData): 21833 * kjs/IndexToNameMap.h: 21834 (JSC::IndexToNameMap::size): 21835 * kjs/JSActivation.cpp: 21836 (JSC::JSActivation::createArgumentsObject): 21837 * kjs/JSActivation.h: 21838 (JSC::JSActivation::uncheckedSymbolTableGet): 21839 (JSC::JSActivation::uncheckedSymbolTableGetValue): 21840 (JSC::JSActivation::uncheckedSymbolTablePut): 21841 * kjs/JSFunction.h: 21842 (JSC::JSFunction::numParameters): 21843 218442008-09-20 Darin Adler <darin@apple.com> 21845 21846 Reviewed by Mark Rowe. 21847 21848 - fix crash seen on buildbot 21849 21850 * kjs/JSGlobalObject.cpp: 21851 (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype, 21852 deleted by accident in my recent check-in. 21853 218542008-09-20 Maciej Stachowiak <mjs@apple.com> 21855 21856 Not reviewed, build fix. 21857 21858 - speculative fix for non-AllInOne builds 21859 21860 * kjs/operations.h: 21861 218622008-09-20 Maciej Stachowiak <mjs@apple.com> 21863 21864 Reviewed by Darin Adler. 21865 21866 - assorted optimizations to === and !== operators 21867 (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>) 21868 21869 2.5% speedup on earley-boyer test 21870 21871 * VM/Machine.cpp: 21872 (JSC::Machine::cti_op_stricteq): Use inline version of 21873 strictEqualSlowCase; remove unneeded exception check. 21874 (JSC::Machine::cti_op_nstricteq): ditto 21875 * kjs/operations.cpp: 21876 (JSC::strictEqual): Use strictEqualSlowCaseInline 21877 (JSC::strictEqualSlowCase): ditto 21878 * kjs/operations.h: 21879 (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined, 21880 since the extra function call indirection is a lose for CTI. 21881 218822008-09-20 Darin Adler <darin@apple.com> 21883 21884 Reviewed by Maciej Stachowiak. 21885 21886 - finish https://bugs.webkit.org/show_bug.cgi?id=20858 21887 make each distinct C++ class get a distinct JSC::Structure 21888 21889 This also includes some optimizations that make the change an overall 21890 small speedup. Without those it was a bit of a slowdown. 21891 21892 * API/JSCallbackConstructor.cpp: 21893 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure. 21894 * API/JSCallbackConstructor.h: Ditto. 21895 * API/JSCallbackFunction.cpp: 21896 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure. 21897 * API/JSCallbackObject.h: Take a structure. 21898 * API/JSCallbackObjectFunctions.h: 21899 (JSC::JSCallbackObject::JSCallbackObject): Ditto. 21900 21901 * API/JSClassRef.cpp: 21902 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype 21903 if there's a custom prototype involved. 21904 * API/JSObjectRef.cpp: 21905 (JSObjectMake): Ditto. 21906 (JSObjectMakeConstructor): Pass in a structure. 21907 21908 * JavaScriptCore.exp: Updated. 21909 21910 * VM/Machine.cpp: 21911 (JSC::jsLess): Added a special case for when both arguments are strings. 21912 This avoids converting both strings to with UString::toDouble. 21913 (JSC::jsLessEq): Ditto. 21914 (JSC::Machine::privateExecute): Pass in a structure. 21915 (JSC::Machine::cti_op_construct_JSConstruct): Ditto. 21916 (JSC::Machine::cti_op_new_regexp): Ditto. 21917 (JSC::Machine::cti_op_is_string): Ditto. 21918 * VM/Machine.h: Made isJSString public so it can be used in the CTI. 21919 21920 * kjs/Arguments.cpp: 21921 (JSC::Arguments::Arguments): Pass in a structure. 21922 21923 * kjs/JSCell.h: Mark constructor explicit. 21924 21925 * kjs/JSGlobalObject.cpp: 21926 (JSC::markIfNeeded): Added an overload for marking structures. 21927 (JSC::JSGlobalObject::reset): Eliminate code to set data members to 21928 zero. We now do that in the constructor, and we no longer use this 21929 anywhere except in the constructor. Added code to create structures. 21930 Pass structures rather than prototypes when creating objects. 21931 (JSC::JSGlobalObject::mark): Mark the structures. 21932 21933 * kjs/JSGlobalObject.h: Removed unneeded class declarations. 21934 Added initializers for raw pointers in JSGlobalObjectData so 21935 everything starts with a 0. Added structure data and accessor 21936 functions. 21937 21938 * kjs/JSImmediate.cpp: 21939 (JSC::JSImmediate::nonInlineNaN): Added. 21940 * kjs/JSImmediate.h: 21941 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches. 21942 21943 * kjs/JSNumberCell.cpp: 21944 (JSC::jsNumberCell): Made non-inline to avoid PIC branches 21945 in functions that call this one. 21946 (JSC::jsNaN): Ditto. 21947 * kjs/JSNumberCell.h: Ditto. 21948 21949 * kjs/JSObject.h: Removed constructor that takes a prototype. 21950 All callers now pass structures. 21951 21952 * kjs/ArrayConstructor.cpp: 21953 (JSC::ArrayConstructor::ArrayConstructor): 21954 (JSC::constructArrayWithSizeQuirk): 21955 * kjs/ArrayConstructor.h: 21956 * kjs/ArrayPrototype.cpp: 21957 (JSC::ArrayPrototype::ArrayPrototype): 21958 * kjs/ArrayPrototype.h: 21959 * kjs/BooleanConstructor.cpp: 21960 (JSC::BooleanConstructor::BooleanConstructor): 21961 (JSC::constructBoolean): 21962 (JSC::constructBooleanFromImmediateBoolean): 21963 * kjs/BooleanConstructor.h: 21964 * kjs/BooleanObject.cpp: 21965 (JSC::BooleanObject::BooleanObject): 21966 * kjs/BooleanObject.h: 21967 * kjs/BooleanPrototype.cpp: 21968 (JSC::BooleanPrototype::BooleanPrototype): 21969 * kjs/BooleanPrototype.h: 21970 * kjs/DateConstructor.cpp: 21971 (JSC::DateConstructor::DateConstructor): 21972 (JSC::constructDate): 21973 * kjs/DateConstructor.h: 21974 * kjs/DateInstance.cpp: 21975 (JSC::DateInstance::DateInstance): 21976 * kjs/DateInstance.h: 21977 * kjs/DatePrototype.cpp: 21978 (JSC::DatePrototype::DatePrototype): 21979 * kjs/DatePrototype.h: 21980 * kjs/ErrorConstructor.cpp: 21981 (JSC::ErrorConstructor::ErrorConstructor): 21982 (JSC::constructError): 21983 * kjs/ErrorConstructor.h: 21984 * kjs/ErrorInstance.cpp: 21985 (JSC::ErrorInstance::ErrorInstance): 21986 * kjs/ErrorInstance.h: 21987 * kjs/ErrorPrototype.cpp: 21988 (JSC::ErrorPrototype::ErrorPrototype): 21989 * kjs/ErrorPrototype.h: 21990 * kjs/FunctionConstructor.cpp: 21991 (JSC::FunctionConstructor::FunctionConstructor): 21992 * kjs/FunctionConstructor.h: 21993 * kjs/FunctionPrototype.cpp: 21994 (JSC::FunctionPrototype::FunctionPrototype): 21995 (JSC::FunctionPrototype::addFunctionProperties): 21996 * kjs/FunctionPrototype.h: 21997 * kjs/GlobalEvalFunction.cpp: 21998 (JSC::GlobalEvalFunction::GlobalEvalFunction): 21999 * kjs/GlobalEvalFunction.h: 22000 * kjs/InternalFunction.cpp: 22001 (JSC::InternalFunction::InternalFunction): 22002 * kjs/InternalFunction.h: 22003 (JSC::InternalFunction::InternalFunction): 22004 * kjs/JSArray.cpp: 22005 (JSC::JSArray::JSArray): 22006 (JSC::constructEmptyArray): 22007 (JSC::constructArray): 22008 * kjs/JSArray.h: 22009 * kjs/JSFunction.cpp: 22010 (JSC::JSFunction::JSFunction): 22011 (JSC::JSFunction::construct): 22012 * kjs/JSObject.cpp: 22013 (JSC::constructEmptyObject): 22014 * kjs/JSString.cpp: 22015 (JSC::StringObject::create): 22016 * kjs/JSWrapperObject.h: 22017 * kjs/MathObject.cpp: 22018 (JSC::MathObject::MathObject): 22019 * kjs/MathObject.h: 22020 * kjs/NativeErrorConstructor.cpp: 22021 (JSC::NativeErrorConstructor::NativeErrorConstructor): 22022 (JSC::NativeErrorConstructor::construct): 22023 * kjs/NativeErrorConstructor.h: 22024 * kjs/NativeErrorPrototype.cpp: 22025 (JSC::NativeErrorPrototype::NativeErrorPrototype): 22026 * kjs/NativeErrorPrototype.h: 22027 * kjs/NumberConstructor.cpp: 22028 (JSC::NumberConstructor::NumberConstructor): 22029 (JSC::constructWithNumberConstructor): 22030 * kjs/NumberConstructor.h: 22031 * kjs/NumberObject.cpp: 22032 (JSC::NumberObject::NumberObject): 22033 (JSC::constructNumber): 22034 (JSC::constructNumberFromImmediateNumber): 22035 * kjs/NumberObject.h: 22036 * kjs/NumberPrototype.cpp: 22037 (JSC::NumberPrototype::NumberPrototype): 22038 * kjs/NumberPrototype.h: 22039 * kjs/ObjectConstructor.cpp: 22040 (JSC::ObjectConstructor::ObjectConstructor): 22041 (JSC::constructObject): 22042 * kjs/ObjectConstructor.h: 22043 * kjs/ObjectPrototype.cpp: 22044 (JSC::ObjectPrototype::ObjectPrototype): 22045 * kjs/ObjectPrototype.h: 22046 * kjs/PrototypeFunction.cpp: 22047 (JSC::PrototypeFunction::PrototypeFunction): 22048 * kjs/PrototypeFunction.h: 22049 * kjs/RegExpConstructor.cpp: 22050 (JSC::RegExpConstructor::RegExpConstructor): 22051 (JSC::RegExpMatchesArray::RegExpMatchesArray): 22052 (JSC::constructRegExp): 22053 * kjs/RegExpConstructor.h: 22054 * kjs/RegExpObject.cpp: 22055 (JSC::RegExpObject::RegExpObject): 22056 * kjs/RegExpObject.h: 22057 * kjs/RegExpPrototype.cpp: 22058 (JSC::RegExpPrototype::RegExpPrototype): 22059 * kjs/RegExpPrototype.h: 22060 * kjs/Shell.cpp: 22061 (GlobalObject::GlobalObject): 22062 * kjs/StringConstructor.cpp: 22063 (JSC::StringConstructor::StringConstructor): 22064 (JSC::constructWithStringConstructor): 22065 * kjs/StringConstructor.h: 22066 * kjs/StringObject.cpp: 22067 (JSC::StringObject::StringObject): 22068 * kjs/StringObject.h: 22069 * kjs/StringObjectThatMasqueradesAsUndefined.h: 22070 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): 22071 * kjs/StringPrototype.cpp: 22072 (JSC::StringPrototype::StringPrototype): 22073 * kjs/StringPrototype.h: 22074 Take and pass structures. 22075 220762008-09-19 Alp Toker <alp@nuanti.com> 22077 22078 Build fix for the 'gold' linker and recent binutils. New behaviour 22079 requires that we link to used libraries explicitly. 22080 22081 * GNUmakefile.am: 22082 220832008-09-19 Sam Weinig <sam@webkit.org> 22084 22085 Roll r36694 back in. It did not cause the crash. 22086 22087 * JavaScriptCore.exp: 22088 * VM/JSPropertyNameIterator.cpp: 22089 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator): 22090 (JSC::JSPropertyNameIterator::invalidate): 22091 * VM/JSPropertyNameIterator.h: 22092 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 22093 (JSC::JSPropertyNameIterator::create): 22094 * kjs/JSObject.cpp: 22095 (JSC::JSObject::getPropertyNames): 22096 * kjs/PropertyMap.cpp: 22097 (JSC::PropertyMap::getEnumerablePropertyNames): 22098 * kjs/PropertyMap.h: 22099 * kjs/PropertyNameArray.cpp: 22100 (JSC::PropertyNameArray::add): 22101 * kjs/PropertyNameArray.h: 22102 (JSC::PropertyNameArrayData::create): 22103 (JSC::PropertyNameArrayData::propertyNameVector): 22104 (JSC::PropertyNameArrayData::setCachedPrototypeChain): 22105 (JSC::PropertyNameArrayData::cachedPrototypeChain): 22106 (JSC::PropertyNameArrayData::begin): 22107 (JSC::PropertyNameArrayData::end): 22108 (JSC::PropertyNameArrayData::PropertyNameArrayData): 22109 (JSC::PropertyNameArray::PropertyNameArray): 22110 (JSC::PropertyNameArray::addKnownUnique): 22111 (JSC::PropertyNameArray::size): 22112 (JSC::PropertyNameArray::operator[]): 22113 (JSC::PropertyNameArray::begin): 22114 (JSC::PropertyNameArray::end): 22115 (JSC::PropertyNameArray::setData): 22116 (JSC::PropertyNameArray::data): 22117 (JSC::PropertyNameArray::releaseData): 22118 * kjs/StructureID.cpp: 22119 (JSC::structureIDChainsAreEqual): 22120 (JSC::StructureID::getEnumerablePropertyNames): 22121 (JSC::StructureID::clearEnumerationCache): 22122 (JSC::StructureID::createCachedPrototypeChain): 22123 * kjs/StructureID.h: 22124 221252008-09-19 Sam Weinig <sam@webkit.org> 22126 22127 Roll out r36694. 22128 22129 * JavaScriptCore.exp: 22130 * VM/JSPropertyNameIterator.cpp: 22131 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator): 22132 (JSC::JSPropertyNameIterator::invalidate): 22133 * VM/JSPropertyNameIterator.h: 22134 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 22135 (JSC::JSPropertyNameIterator::create): 22136 * kjs/JSObject.cpp: 22137 (JSC::JSObject::getPropertyNames): 22138 * kjs/PropertyMap.cpp: 22139 (JSC::PropertyMap::getEnumerablePropertyNames): 22140 * kjs/PropertyMap.h: 22141 * kjs/PropertyNameArray.cpp: 22142 (JSC::PropertyNameArray::add): 22143 * kjs/PropertyNameArray.h: 22144 (JSC::PropertyNameArray::PropertyNameArray): 22145 (JSC::PropertyNameArray::addKnownUnique): 22146 (JSC::PropertyNameArray::begin): 22147 (JSC::PropertyNameArray::end): 22148 (JSC::PropertyNameArray::size): 22149 (JSC::PropertyNameArray::operator[]): 22150 (JSC::PropertyNameArray::releaseIdentifiers): 22151 * kjs/StructureID.cpp: 22152 (JSC::StructureID::getEnumerablePropertyNames): 22153 * kjs/StructureID.h: 22154 (JSC::StructureID::clearEnumerationCache): 22155 221562008-09-19 Oliver Hunt <oliver@apple.com> 22157 22158 Reviewed by Maciej Stachowiak. 22159 22160 Improve peformance of local variable initialisation. 22161 22162 Pull local and constant initialisation out of slideRegisterWindowForCall 22163 and into its own opcode. This allows the JIT to generate the initialisation 22164 code for a function directly into the instruction stream and so avoids a few 22165 branches on function entry. 22166 22167 Results a 1% progression in SunSpider, particularly in a number of the bitop 22168 tests where the called functions are very fast. 22169 22170 * VM/CTI.cpp: 22171 (JSC::CTI::emitInitialiseRegister): 22172 (JSC::CTI::privateCompileMainPass): 22173 * VM/CTI.h: 22174 * VM/CodeBlock.cpp: 22175 (JSC::CodeBlock::dump): 22176 * VM/CodeGenerator.cpp: 22177 (JSC::CodeGenerator::CodeGenerator): 22178 * VM/Machine.cpp: 22179 (JSC::slideRegisterWindowForCall): 22180 (JSC::Machine::privateExecute): 22181 * VM/Opcode.h: 22182 221832008-09-19 Sam Weinig <sam@webkit.org> 22184 22185 Reviewed by Darin Adler. 22186 22187 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928 22188 Speed up JS property enumeration by caching entire PropertyNameArray 22189 22190 1.3% speedup on Sunspider, 30% on string-fasta. 22191 22192 * JavaScriptCore.exp: 22193 * VM/JSPropertyNameIterator.cpp: 22194 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator): 22195 (JSC::JSPropertyNameIterator::invalidate): 22196 * VM/JSPropertyNameIterator.h: 22197 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 22198 (JSC::JSPropertyNameIterator::create): 22199 * kjs/JSObject.cpp: 22200 (JSC::JSObject::getPropertyNames): 22201 * kjs/PropertyMap.cpp: 22202 (JSC::PropertyMap::getEnumerablePropertyNames): 22203 * kjs/PropertyMap.h: 22204 * kjs/PropertyNameArray.cpp: 22205 (JSC::PropertyNameArray::add): 22206 * kjs/PropertyNameArray.h: 22207 (JSC::PropertyNameArrayData::create): 22208 (JSC::PropertyNameArrayData::propertyNameVector): 22209 (JSC::PropertyNameArrayData::setCachedPrototypeChain): 22210 (JSC::PropertyNameArrayData::cachedPrototypeChain): 22211 (JSC::PropertyNameArrayData::begin): 22212 (JSC::PropertyNameArrayData::end): 22213 (JSC::PropertyNameArrayData::PropertyNameArrayData): 22214 (JSC::PropertyNameArray::PropertyNameArray): 22215 (JSC::PropertyNameArray::addKnownUnique): 22216 (JSC::PropertyNameArray::size): 22217 (JSC::PropertyNameArray::operator[]): 22218 (JSC::PropertyNameArray::begin): 22219 (JSC::PropertyNameArray::end): 22220 (JSC::PropertyNameArray::setData): 22221 (JSC::PropertyNameArray::data): 22222 (JSC::PropertyNameArray::releaseData): 22223 * kjs/ScopeChain.cpp: 22224 (JSC::ScopeChainNode::print): 22225 * kjs/StructureID.cpp: 22226 (JSC::structureIDChainsAreEqual): 22227 (JSC::StructureID::getEnumerablePropertyNames): 22228 (JSC::StructureID::clearEnumerationCache): 22229 (JSC::StructureID::createCachedPrototypeChain): 22230 * kjs/StructureID.h: 22231 222322008-09-19 Holger Hans Peter Freyther <zecke@selfish.org> 22233 22234 Reviewed by Maciej Stachowiak. 22235 22236 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage 22237 22238 * kjs/JSObject.cpp: 22239 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind. 22240 222412008-09-19 Darin Adler <darin@apple.com> 22242 22243 Reviewed by Sam Weinig. 22244 22245 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858 22246 make each distinct C++ class get a distinct JSC::Structure 22247 22248 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore. 22249 22250 * kjs/JSGlobalObject.h: Changed the protected constructor to take a 22251 structure instead of a prototype. 22252 22253 * kjs/JSVariableObject.h: Removed constructor that takes a prototype. 22254 222552008-09-19 Julien Chaffraix <jchaffraix@pleyo.com> 22256 22257 Reviewed by Alexey Proskuryakov. 22258 22259 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to 22260 non-template methods' code been copied for each instance of the template. 22261 The patch splits RefCounted between a base class that holds non-template methods and attributes 22262 and the template RefCounted class that keeps the same functionnality. 22263 22264 On my Linux with gcc 4.3 for the Gtk port, this is: 22265 - a ~600KB save on libwebkit.so in release. 22266 - a ~1.6MB save on libwebkit.so in debug. 22267 22268 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant). 22269 On the whole, it should be a small win as we reduce the compiled code size and the only 22270 new function call should be inlined by the compiler. 22271 22272 * wtf/RefCounted.h: 22273 (WTF::RefCountedBase::ref): Copied from RefCounted. 22274 (WTF::RefCountedBase::hasOneRef): Ditto. 22275 (WTF::RefCountedBase::refCount): Ditto. 22276 (WTF::RefCountedBase::RefCountedBase): Ditto. 22277 (WTF::RefCountedBase::~RefCountedBase): Ditto. 22278 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove 22279 template section. 22280 (WTF::RefCounted::RefCounted): 22281 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase(). 22282 (WTF::RefCounted::~RefCounted): Keep private destructor. 22283 222842008-09-18 Darin Adler <darin@apple.com> 22285 22286 Reviewed by Maciej Stachowiak. 22287 22288 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858 22289 make each distinct C++ class get a distinct JSC::Structure 22290 22291 * kjs/lookup.h: Removed things here that were used only in WebCore: 22292 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE, 22293 and JSC_IMPLEMENT_PROTOTYPE. 22294 222952008-09-18 Darin Adler <darin@apple.com> 22296 22297 Reviewed by Maciej Stachowiak. 22298 22299 - https://bugs.webkit.org/show_bug.cgi?id=20927 22300 simplify/streamline the code to turn strings into identifiers while parsing 22301 22302 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as 22303 well as for IDENT. 22304 22305 * kjs/lexer.cpp: 22306 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String. 22307 * kjs/lexer.h: Remove makeUString. 22308 22309 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString. 22310 22311 * VM/CodeGenerator.cpp: 22312 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier. 22313 (JSC::prepareJumpTableForStringSwitch): Ditto. 22314 * kjs/nodes.cpp: 22315 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer. 22316 (JSC::processClauseList): Ditto. 22317 * kjs/nodes2string.cpp: 22318 (JSC::StringNode::streamTo): Ditto. 22319 223202008-09-18 Sam Weinig <sam@webkit.org> 22321 22322 Fix style. 22323 22324 * VM/Instruction.h: 22325 (JSC::Instruction::Instruction): 22326 223272008-09-18 Oliver Hunt <oliver@apple.com> 22328 22329 Reviewed by Maciej Stachowiak. 22330 22331 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore 22332 <https://bugs.webkit.org/show_bug.cgi?id=20911> 22333 22334 The problem was simply caused by the int constructor for Instruction 22335 failing to initialise the full struct in 64bit builds. 22336 22337 * VM/Instruction.h: 22338 (JSC::Instruction::Instruction): 22339 223402008-09-18 Darin Adler <darin@apple.com> 22341 22342 - fix release build 22343 22344 * wtf/RefCountedLeakCounter.cpp: Removed stray "static". 22345 223462008-09-18 Darin Adler <darin@apple.com> 22347 22348 Reviewed by Sam Weinig. 22349 22350 * kjs/JSGlobalObject.h: Tiny style guideline tweak. 22351 223522008-09-18 Darin Adler <darin@apple.com> 22353 22354 Reviewed by Sam Weinig. 22355 22356 - fix https://bugs.webkit.org/show_bug.cgi?id=20925 22357 LEAK messages appear every time I quit 22358 22359 * JavaScriptCore.exp: Updated, and also added an export 22360 needed for future WebCore use of JSC::StructureID. 22361 22362 * wtf/RefCountedLeakCounter.cpp: 22363 (WTF::RefCountedLeakCounter::suppressMessages): Added. 22364 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added. 22365 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit. 22366 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to 22367 log the reason there was no leak checking done. 22368 (WTF::RefCountedLeakCounter::increment): Tweaked a bit. 22369 (WTF::RefCountedLeakCounter::decrement): Ditto. 22370 22371 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two 22372 new functions, suppressMessages and cancelMessageSuppression. Also 22373 added m_ prefixes to the data member names. 22374 223752008-09-18 Holger Hans Peter Freyther <zecke@selfish.org> 22376 22377 Reviewed by Mark Rowe. 22378 22379 https://bugs.webkit.org/show_bug.cgi?id=20437 22380 22381 Add a proper #define to define which XML Parser implementation to use. Client 22382 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader 22383 implementation is going to be used. 22384 22385 * wtf/Platform.h: 22386 223872008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca> 22388 22389 Reviewed by Maciej Stachowiak. 22390 22391 Make a Unicode non-breaking space count as a whitespace character in 22392 PCRE. This change was already made in WREC, and it fixes one of the 22393 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check 22394 in a new set of expected test results. 22395 22396 * pcre/pcre_internal.h: 22397 (isSpaceChar): 22398 * tests/mozilla/expected.html: 22399 224002008-09-18 Stephanie Lewis <slewis@apple.com> 22401 22402 Reviewed by Mark Rowe and Maciej Stachowiak. 22403 22404 add an option use arch to specify which architecture to run. 22405 22406 * tests/mozilla/jsDriver.pl: 22407 224082008-09-17 Oliver Hunt <oliver@apple.com> 22409 22410 Correctly restore argument reference prior to SFX runtime calls. 22411 22412 Reviewed by Steve Falkenburg. 22413 22414 * VM/CTI.cpp: 22415 (JSC::CTI::privateCompileSlowCases): 22416 (JSC::CTI::privateCompile): 22417 224182008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> 22419 22420 Reviewed by Maciej Stachowiak. 22421 22422 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails 22423 <https://bugs.webkit.org/show_bug.cgi?id=20876> 22424 22425 r36417 and r36427 caused an get_by_id opcode to be emitted before the 22426 instanceof and construct opcodes, in order to enable inline caching of 22427 the prototype property. Unfortunately, this regressed some tests dealing 22428 with exceptions thrown by 'instanceof' and the 'new' operator. We fix 22429 these problems by detecting whether an "is not an object" exception is 22430 thrown before op_instanceof or op_construct, and emit the proper 22431 exception in those cases. 22432 22433 * VM/CodeGenerator.cpp: 22434 (JSC::CodeGenerator::emitConstruct): 22435 * VM/CodeGenerator.h: 22436 * VM/ExceptionHelpers.cpp: 22437 (JSC::createInvalidParamError): 22438 (JSC::createNotAConstructorError): 22439 (JSC::createNotAnObjectError): 22440 * VM/ExceptionHelpers.h: 22441 * VM/Machine.cpp: 22442 (JSC::Machine::getOpcode): 22443 (JSC::Machine::privateExecute): 22444 * VM/Machine.h: 22445 * kjs/nodes.cpp: 22446 (JSC::NewExprNode::emitCode): 22447 (JSC::InstanceOfNode::emitCode): 22448 224492008-09-17 Gavin Barraclough <barraclough@apple.com> 22450 22451 Reviewed by Oliver Hunt. 22452 22453 JIT generation cti_op_construct_verify. 22454 22455 Quarter to half percent progression on v8-tests. 22456 Roughly not change on SunSpider (possible minor progression). 22457 22458 * VM/CTI.cpp: 22459 (JSC::CTI::privateCompileMainPass): 22460 * VM/Machine.cpp: 22461 * VM/Machine.h: 22462 224632008-09-15 Steve Falkenburg <sfalken@apple.com> 22464 22465 Improve timer accuracy for JavaScript Date object on Windows. 22466 22467 Use a combination of ftime and QueryPerformanceCounter. 22468 ftime returns the information we want, but doesn't have sufficient resolution. 22469 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals. 22470 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use 22471 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to 22472 correct for drift if the low-res and high-res elapsed time between calls differs by more 22473 than twice the low-resolution timer resolution. 22474 22475 QueryPerformanceCounter may be inaccurate due to a problems with: 22476 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323) 22477 - BIOS bugs (http://support.microsoft.com/kb/895980/) 22478 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx) 22479 22480 Reviewed by Darin Adler. 22481 22482 * kjs/DateMath.cpp: 22483 (JSC::highResUpTime): 22484 (JSC::lowResUTCTime): 22485 (JSC::qpcAvailable): 22486 (JSC::getCurrentUTCTimeWithMicroseconds): 22487 224882008-09-17 Gavin Barraclough <barraclough@apple.com> 22489 22490 Reviewed by Geoff Garen. 22491 22492 Implement JIT generation of CallFrame initialization, for op_call. 22493 22494 1% sunspider 2.5% v8-tests. 22495 22496 * VM/CTI.cpp: 22497 (JSC::CTI::compileOpCall): 22498 * VM/Machine.cpp: 22499 (JSC::Machine::cti_op_call_JSFunction): 22500 (JSC::Machine::cti_op_call_NotJSFunction): 22501 225022008-09-17 Gavin Barraclough <barraclough@apple.com> 22503 22504 Reviewed by Geoff Garen. 22505 22506 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code, 22507 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of 22508 functions, instead of checking prior to making the call. 22509 22510 3% on v8-tests (4% on richards, 6% in delta-blue) 22511 22512 * VM/CTI.cpp: 22513 (JSC::CTI::compileOpCall): 22514 (JSC::CTI::privateCompileSlowCases): 22515 (JSC::CTI::privateCompile): 22516 * VM/Machine.cpp: 22517 (JSC::Machine::execute): 22518 (JSC::Machine::cti_op_call_JSFunction): 22519 (JSC::Machine::cti_vm_compile): 22520 (JSC::Machine::cti_vm_updateScopeChain): 22521 (JSC::Machine::cti_op_construct_JSConstruct): 22522 * VM/Machine.h: 22523 225242008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com> 22525 22526 Fix the QtWebKit/Mac build 22527 22528 * wtf/ThreadingQt.cpp: 22529 (WTF::initializeThreading): use QCoreApplication to get the main thread 22530 225312008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca> 22532 22533 Reviewed by Maciej Stachowiak. 22534 22535 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref() 22536 <https://bugs.webkit.org/show_bug.cgi?id=20857> 22537 22538 Fix a problem stemming from the slightly unsafe behaviour of the 22539 CodeGenerator::finalDestination() method by putting the "func" argument 22540 of the emitConstruct() method in a RefPtr in its caller. Also, add an 22541 assertion guaranteeing that this is always the case. 22542 22543 CodeGenerator::finalDestination() is still incorrect and can cause 22544 problems with a different allocator; see bug 20340 for more details. 22545 22546 * VM/CodeGenerator.cpp: 22547 (JSC::CodeGenerator::emitConstruct): 22548 * kjs/nodes.cpp: 22549 (JSC::NewExprNode::emitCode): 22550 225512008-09-16 Alice Liu <alice.liu@apple.com> 22552 22553 build fix. 22554 22555 * VM/CTI.cpp: 22556 (JSC::CTI::privateCompileMainPass): 22557 225582008-09-16 Gavin Barraclough <barraclough@apple.com> 22559 22560 Reviewed by Geoff Garen. 22561 22562 CTI code generation for op_ret. The majority of the work 22563 (updating variables on the stack & on exec) can be performed 22564 directly in generated code. 22565 22566 We still need to check, & to call out to C-code to handle 22567 activation records, profiling, and full scope chains. 22568 22569 +1.5% Sunspider, +5/6% v8 tests. 22570 22571 * VM/CTI.cpp: 22572 (JSC::CTI::emitPutCTIParam): 22573 (JSC::CTI::compileOpCall): 22574 (JSC::CTI::privateCompileMainPass): 22575 * VM/CTI.h: 22576 * VM/Machine.cpp: 22577 (JSC::Machine::cti_op_ret_activation): 22578 (JSC::Machine::cti_op_ret_profiler): 22579 (JSC::Machine::cti_op_ret_scopeChain): 22580 * VM/Machine.h: 22581 225822008-09-16 Dimitri Glazkov <dglazkov@chromium.org> 22583 22584 Fix the Windows build. 22585 22586 Add some extra parentheses to stop MSVC from complaining so much. 22587 22588 * VM/Machine.cpp: 22589 (JSC::Machine::privateExecute): 22590 (JSC::Machine::cti_op_stricteq): 22591 (JSC::Machine::cti_op_nstricteq): 22592 * kjs/operations.cpp: 22593 (JSC::strictEqual): 22594 225952008-09-15 Maciej Stachowiak <mjs@apple.com> 22596 22597 Reviewed by Cameron Zwarich. 22598 22599 - speed up the === and !== operators by choosing the fast cases better 22600 22601 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%. 22602 22603 * VM/Machine.cpp: 22604 (JSC::Machine::privateExecute): 22605 (JSC::Machine::cti_op_stricteq): 22606 (JSC::Machine::cti_op_nstricteq): 22607 * kjs/JSImmediate.h: 22608 (JSC::JSImmediate::areBothImmediate): 22609 * kjs/operations.cpp: 22610 (JSC::strictEqual): 22611 (JSC::strictEqualSlowCase): 22612 * kjs/operations.h: 22613 226142008-09-15 Oliver Hunt <oliver@apple.com> 22615 22616 RS=Sam Weinig. 22617 22618 Coding style cleanup. 22619 22620 * VM/Machine.cpp: 22621 (JSC::Machine::privateExecute): 22622 226232008-09-15 Oliver Hunt <oliver@apple.com> 22624 22625 Reviewed by Cameron Zwarich. 22626 22627 Bug 20874: op_resolve does not do any form of caching 22628 <https://bugs.webkit.org/show_bug.cgi?id=20874> 22629 22630 This patch adds an op_resolve_global opcode to handle (and cache) 22631 property lookup we can statically determine must occur on the global 22632 object (if at all). 22633 22634 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and 22635 10% in math-partial-sums 22636 22637 * VM/CTI.cpp: 22638 (JSC::CTI::privateCompileMainPass): 22639 * VM/CTI.h: 22640 * VM/CodeBlock.cpp: 22641 (JSC::CodeBlock::dump): 22642 * VM/CodeGenerator.cpp: 22643 (JSC::CodeGenerator::findScopedProperty): 22644 (JSC::CodeGenerator::emitResolve): 22645 * VM/Machine.cpp: 22646 (JSC::resolveGlobal): 22647 (JSC::Machine::privateExecute): 22648 (JSC::Machine::cti_op_resolve_global): 22649 * VM/Machine.h: 22650 * VM/Opcode.h: 22651 226522008-09-15 Sam Weinig <sam@webkit.org> 22653 22654 Roll out r36462. It broke document.all. 22655 22656 * VM/CTI.cpp: 22657 (JSC::CTI::privateCompileMainPass): 22658 (JSC::CTI::privateCompileSlowCases): 22659 * VM/CTI.h: 22660 * VM/Machine.cpp: 22661 (JSC::Machine::Machine): 22662 (JSC::Machine::cti_op_eq_null): 22663 (JSC::Machine::cti_op_neq_null): 22664 * VM/Machine.h: 22665 (JSC::Machine::isJSString): 22666 * kjs/JSCell.h: 22667 * kjs/JSWrapperObject.h: 22668 * kjs/StringObject.h: 22669 * kjs/StringObjectThatMasqueradesAsUndefined.h: 22670 226712008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca> 22672 22673 Reviewed by Maciej Stachowiak. 22674 22675 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC 22676 <https://bugs.webkit.org/show_bug.cgi?id=20863> 22677 22678 r36427 changed the number of arguments to op_construct without changing 22679 the argument index for the vPC in the call to initializeCallFrame() in 22680 the CTI case. This caused a JSC test failure. Correcting the argument 22681 index fixes the test failure. 22682 22683 * VM/Machine.cpp: 22684 (JSC::Machine::cti_op_construct_JSConstruct): 22685 226862008-09-15 Mark Rowe <mrowe@apple.com> 22687 22688 Fix GCC 4.2 build. 22689 22690 * VM/CTI.h: 22691 226922008-09-15 Geoffrey Garen <ggaren@apple.com> 22693 22694 Reviewed by Maciej Stachowiak. 22695 22696 Fixed a typo in op_get_by_id_chain that caused it to miss every time 22697 in the interpreter. 22698 22699 Also, a little cleanup. 22700 22701 * VM/Machine.cpp: 22702 (JSC::Machine::privateExecute): Set up baseObject before entering the 22703 loop, so we compare against the right values. 22704 227052008-09-15 Geoffrey Garen <ggaren@apple.com> 22706 22707 Reviewed by Sam Weinig. 22708 22709 Removed the CalledAsConstructor flag from the call frame header. Now, 22710 we use an explicit opcode at the call site to fix up constructor results. 22711 22712 SunSpider says 0.4% faster. 22713 22714 cti_op_construct_verify is an out-of-line function call for now, but we 22715 can fix that once StructureID holds type information like isObject. 22716 22717 * VM/CTI.cpp: 22718 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode. 22719 22720 * VM/CodeBlock.cpp: 22721 (JSC::CodeBlock::dump): 22722 22723 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also... 22724 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value. 22725 (JSC::CodeGenerator::emitConstruct): ... ditto. 22726 22727 * VM/Machine.cpp: No more CalledAsConstructor 22728 (JSC::Machine::privateExecute): Implementation for the new opcode. 22729 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were 22730 called as a constructor. 22731 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode. 22732 * VM/Machine.h: 22733 22734 * VM/Opcode.h: Declare new opcode. 22735 22736 * VM/RegisterFile.h: 22737 (JSC::RegisterFile::): No more CalledAsConstructor 22738 227392008-09-15 Gavin Barraclough <barraclough@apple.com> 22740 22741 Reviewed by Geoff Garen. 22742 22743 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for 22744 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the 22745 masquerading may be handled differently (through the StructureIDs - see bug 22746 #20823). 22747 22748 >1% on v8-tests. 22749 22750 * VM/CTI.cpp: 22751 (JSC::CTI::emitJumpSlowCaseIfIsJSCell): 22752 (JSC::CTI::privateCompileMainPass): 22753 (JSC::CTI::privateCompileSlowCases): 22754 * VM/CTI.h: 22755 * VM/Machine.cpp: 22756 (JSC::Machine::Machine): 22757 (JSC::Machine::cti_op_eq_null): 22758 (JSC::Machine::cti_op_neq_null): 22759 * VM/Machine.h: 22760 (JSC::Machine::doesMasqueradesAsUndefined): 22761 * kjs/JSWrapperObject.h: 22762 (JSC::JSWrapperObject::): 22763 (JSC::JSWrapperObject::JSWrapperObject): 22764 * kjs/StringObject.h: 22765 (JSC::StringObject::StringObject): 22766 * kjs/StringObjectThatMasqueradesAsUndefined.h: 22767 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): 22768 227692008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca> 22770 22771 Rubber-stamped by Oliver Hunt. 22772 22773 r36427 broke CodeBlock::dump() by changing the number of arguments to 22774 op_construct without changing the code that prints it. This patch fixes 22775 it by printing the additional argument. 22776 22777 * JavaScriptCore.xcodeproj/project.pbxproj: 22778 * VM/CodeBlock.cpp: 22779 (JSC::CodeBlock::dump): 22780 227812008-09-15 Adam Roben <aroben@apple.com> 22782 22783 Build fix 22784 22785 * kjs/StructureID.cpp: Removed a stray semicolon. 22786 227872008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca> 22788 22789 Reviewed by Maciej Stachowiak. 22790 22791 Fix a crash in fast/js/exception-expression-offset.html caused by not 22792 updating all mentions of the length of op_construct in r36427. 22793 22794 * VM/Machine.cpp: 22795 (JSC::Machine::cti_op_construct_NotJSConstruct): 22796 227972008-09-15 Maciej Stachowiak <mjs@apple.com> 22798 22799 Reviewed by Cameron Zwarich. 22800 22801 - fix layout test failure introduced by fix for 20849 22802 22803 (The failing test was fast/js/delete-then-put.html) 22804 22805 * kjs/JSObject.cpp: 22806 (JSC::JSObject::removeDirect): Clear enumeration cache 22807 in the dictionary case. 22808 * kjs/JSObject.h: 22809 (JSC::JSObject::putDirect): Ditto. 22810 * kjs/StructureID.h: 22811 (JSC::StructureID::clearEnumerationCache): Inline to handle the 22812 clear. 22813 228142008-09-15 Maciej Stachowiak <mjs@apple.com> 22815 22816 Reviewed by Cameron Zwarich. 22817 22818 - fix JSC test failures introduced by fix for 20849 22819 22820 * kjs/PropertyMap.cpp: 22821 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count. 22822 228232008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca> 22824 22825 Reviewed by Maciej Stachowiak. 22826 22827 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails 22828 <https://bugs.webkit.org/show_bug.cgi?id=20851> 22829 22830 r36410 introduced an optimization for parseInt() that is incorrect when 22831 its argument is larger than the range of a 32-bit integer. If the 22832 argument is a number that is not an immediate integer, then the correct 22833 behaviour is to return the floor of its value, unless it is an infinite 22834 value, in which case the correct behaviour is to return 0. 22835 22836 * kjs/JSGlobalObjectFunctions.cpp: 22837 (JSC::globalFuncParseInt): 22838 228392008-09-15 Sam Weinig <sam@webkit.org> 22840 22841 Reviewed by Maciej Stachowiak. 22842 22843 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849 22844 Cache property names for getEnumerablePropertyNames in the StructureID. 22845 22846 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup 22847 on the v8 test suite. 22848 22849 * kjs/JSObject.cpp: 22850 (JSC::JSObject::getPropertyNames): 22851 * kjs/PropertyMap.cpp: 22852 (JSC::PropertyMap::getEnumerablePropertyNames): 22853 * kjs/PropertyMap.h: 22854 * kjs/StructureID.cpp: 22855 (JSC::StructureID::StructureID): 22856 (JSC::StructureID::getEnumerablePropertyNames): 22857 * kjs/StructureID.h: 22858 228592008-09-14 Maciej Stachowiak <mjs@apple.com> 22860 22861 Reviewed by Cameron Zwarich. 22862 22863 - speed up JS construction by extracting "prototype" lookup so PIC applies. 22864 22865 ~0.5% speedup on SunSpider 22866 Speeds up some of the V8 tests as well, most notably earley-boyer. 22867 22868 * VM/CTI.cpp: 22869 (JSC::CTI::compileOpCall): Account for extra arg for prototype. 22870 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct. 22871 * VM/CodeGenerator.cpp: 22872 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property. 22873 * VM/Machine.cpp: 22874 (JSC::Machine::privateExecute): Expect prototype arg in op_construct. 22875 (JSC::Machine::cti_op_construct_JSConstruct): ditto 22876 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto 22877 228782008-09-10 Alexey Proskuryakov <ap@webkit.org> 22879 22880 Reviewed by Eric Seidel. 22881 22882 Add a protected destructor for RefCounted. 22883 22884 It is wrong to call its destructor directly, because (1) this should be taken care of by 22885 deref(), and (2) many classes that use RefCounted have non-virtual destructors. 22886 22887 No change in behavior. 22888 22889 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted): 22890 228912008-09-14 Gavin Barraclough <barraclough@apple.com> 22892 22893 Reviewed by Sam Weinig. 22894 22895 Accelerated property accesses. 22896 22897 Inline more of the array access code into the JIT code for get/put_by_val. 22898 Accelerate get/put_by_id by speculatively inlining a disable direct access 22899 into the hot path of the code, and repatch this with the correct StructureID 22900 and property map offset once these are known. In the case of accesses to the 22901 prototype and reading the array-length a trampoline is genertaed, and the 22902 branch to the slow-case is relinked to jump to this. 22903 22904 By repatching, we mean rewriting the x86 instruction stream. Instructions are 22905 only modified in a simple fasion - altering immediate operands, memory access 22906 deisplacements, and branch offsets. 22907 22908 For regular get_by_id/put_by_id accesses to an object, a StructureID in an 22909 instruction's immediate operant is updateded, and a memory access operation's 22910 displacement is updated to access the correct field on the object. In the case 22911 of more complex accesses (array length and get_by_id_prototype) the offset on 22912 the branch to slow-case is updated, to now jump to a trampoline. 22913 22914 +2.8% sunspider, +13% v8-tests 22915 22916 * VM/CTI.cpp: 22917 (JSC::CTI::emitCall): 22918 (JSC::CTI::emitJumpSlowCaseIfNotJSCell): 22919 (JSC::CTI::CTI): 22920 (JSC::CTI::privateCompileMainPass): 22921 (JSC::CTI::privateCompileSlowCases): 22922 (JSC::CTI::privateCompile): 22923 (JSC::CTI::privateCompileGetByIdSelf): 22924 (JSC::CTI::privateCompileGetByIdProto): 22925 (JSC::CTI::privateCompileGetByIdChain): 22926 (JSC::CTI::privateCompilePutByIdReplace): 22927 (JSC::CTI::privateCompilePutByIdTransition): 22928 (JSC::CTI::privateCompileArrayLengthTrampoline): 22929 (JSC::CTI::privateCompileStringLengthTrampoline): 22930 (JSC::CTI::patchGetByIdSelf): 22931 (JSC::CTI::patchPutByIdReplace): 22932 (JSC::CTI::privateCompilePatchGetArrayLength): 22933 (JSC::CTI::privateCompilePatchGetStringLength): 22934 * VM/CTI.h: 22935 (JSC::CTI::compileGetByIdSelf): 22936 (JSC::CTI::compileGetByIdProto): 22937 (JSC::CTI::compileGetByIdChain): 22938 (JSC::CTI::compilePutByIdReplace): 22939 (JSC::CTI::compilePutByIdTransition): 22940 (JSC::CTI::compileArrayLengthTrampoline): 22941 (JSC::CTI::compileStringLengthTrampoline): 22942 (JSC::CTI::compilePatchGetArrayLength): 22943 (JSC::CTI::compilePatchGetStringLength): 22944 * VM/CodeBlock.cpp: 22945 (JSC::CodeBlock::dump): 22946 (JSC::CodeBlock::~CodeBlock): 22947 * VM/CodeBlock.h: 22948 (JSC::StructureStubInfo::StructureStubInfo): 22949 (JSC::CodeBlock::getStubInfo): 22950 * VM/Machine.cpp: 22951 (JSC::Machine::tryCTICachePutByID): 22952 (JSC::Machine::tryCTICacheGetByID): 22953 (JSC::Machine::cti_op_put_by_val_array): 22954 * VM/Machine.h: 22955 * masm/X86Assembler.h: 22956 (JSC::X86Assembler::): 22957 (JSC::X86Assembler::cmpl_i8m): 22958 (JSC::X86Assembler::emitUnlinkedJa): 22959 (JSC::X86Assembler::getRelocatedAddress): 22960 (JSC::X86Assembler::getDifferenceBetweenLabels): 22961 (JSC::X86Assembler::emitModRm_opmsib): 22962 229632008-09-14 Maciej Stachowiak <mjs@apple.com> 22964 22965 Reviewed by Cameron Zwarich. 22966 22967 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached 22968 22969 ~5% speedup on v8 earley-boyer test 22970 22971 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype. 22972 * API/JSCallbackObjectFunctions.h: 22973 (JSC::::hasInstance): Ditto. 22974 * API/JSValueRef.cpp: 22975 (JSValueIsInstanceOfConstructor): Look up and pass in prototype. 22976 * JavaScriptCore.exp: 22977 * VM/CTI.cpp: 22978 (JSC::CTI::privateCompileMainPass): Pass along prototype. 22979 * VM/CodeBlock.cpp: 22980 (JSC::CodeBlock::dump): Print third arg. 22981 * VM/CodeGenerator.cpp: 22982 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there 22983 is a third argument. 22984 * VM/CodeGenerator.h: 22985 * VM/Machine.cpp: 22986 (JSC::Machine::privateExecute): Pass along the prototype. 22987 (JSC::Machine::cti_op_instanceof): ditto 22988 * kjs/JSObject.cpp: 22989 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype. 22990 * kjs/JSObject.h: 22991 * kjs/nodes.cpp: 22992 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype 22993 property and pass that register to instanceof. 22994 * kjs/nodes.h: 22995 229962008-09-14 Gavin Barraclough <barraclough@apple.com> 22997 22998 Reviewed by Sam Weinig. 22999 23000 Remove unnecessary virtual function call from cti_op_call_JSFunction - 23001 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider. 23002 23003 * VM/Machine.cpp: 23004 (JSC::Machine::cti_op_call_JSFunction): 23005 230062008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23007 23008 Reviewed by Maciej Stachowiak. 23009 23010 Bug 20827: the 'typeof' operator is slow 23011 <https://bugs.webkit.org/show_bug.cgi?id=20827> 23012 23013 Optimize the 'typeof' operator when its result is compared to a constant 23014 string. 23015 23016 This is a 5.5% speedup on the V8 Earley-Boyer test. 23017 23018 * VM/CTI.cpp: 23019 (JSC::CTI::privateCompileMainPass): 23020 * VM/CodeBlock.cpp: 23021 (JSC::CodeBlock::dump): 23022 * VM/CodeGenerator.cpp: 23023 (JSC::CodeGenerator::emitEqualityOp): 23024 * VM/CodeGenerator.h: 23025 * VM/Machine.cpp: 23026 (JSC::jsIsObjectType): 23027 (JSC::jsIsFunctionType): 23028 (JSC::Machine::privateExecute): 23029 (JSC::Machine::cti_op_is_undefined): 23030 (JSC::Machine::cti_op_is_boolean): 23031 (JSC::Machine::cti_op_is_number): 23032 (JSC::Machine::cti_op_is_string): 23033 (JSC::Machine::cti_op_is_object): 23034 (JSC::Machine::cti_op_is_function): 23035 * VM/Machine.h: 23036 * VM/Opcode.h: 23037 * kjs/nodes.cpp: 23038 (JSC::BinaryOpNode::emitCode): 23039 (JSC::EqualNode::emitCode): 23040 (JSC::StrictEqualNode::emitCode): 23041 * kjs/nodes.h: 23042 230432008-09-14 Sam Weinig <sam@webkit.org> 23044 23045 Reviewed by Cameron Zwarich. 23046 23047 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844 23048 Speed up parseInt for numbers 23049 23050 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code. 23051 No change on the v8 suite. 23052 23053 * kjs/JSGlobalObjectFunctions.cpp: 23054 (JSC::globalFuncParseInt): Don't convert numbers to strings just to 23055 convert them back to numbers. 23056 230572008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23058 23059 Reviewed by Oliver Hunt. 23060 23061 Bug 20816: op_lesseq should be optimized 23062 <https://bugs.webkit.org/show_bug.cgi?id=20816> 23063 23064 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode. 23065 23066 This is a 9.4% speedup on the V8 Crypto benchmark. 23067 23068 * VM/CTI.cpp: 23069 (JSC::CTI::privateCompileMainPass): 23070 (JSC::CTI::privateCompileSlowCases): 23071 * VM/CodeBlock.cpp: 23072 (JSC::CodeBlock::dump): 23073 * VM/CodeGenerator.cpp: 23074 (JSC::CodeGenerator::emitJumpIfTrue): 23075 * VM/Machine.cpp: 23076 (JSC::Machine::privateExecute): 23077 (JSC::Machine::cti_op_loop_if_lesseq): 23078 * VM/Machine.h: 23079 * VM/Opcode.h: 23080 230812008-09-14 Sam Weinig <sam@webkit.org> 23082 23083 Reviewed by Cameron Zwarich. 23084 23085 Cleanup Sampling code. 23086 23087 * VM/CTI.cpp: 23088 (JSC::CTI::emitCall): 23089 (JSC::CTI::privateCompileMainPass): 23090 * VM/CTI.h: 23091 (JSC::CTI::execute): 23092 * VM/SamplingTool.cpp: 23093 (JSC::): 23094 (JSC::SamplingTool::run): 23095 (JSC::SamplingTool::dump): 23096 * VM/SamplingTool.h: 23097 (JSC::SamplingTool::callingHostFunction): 23098 230992008-09-13 Oliver Hunt <oliver@apple.com> 23100 23101 Reviewed by Cameron Zwarich. 23102 23103 Bug 20821: Cache property transitions to speed up object initialization 23104 https://bugs.webkit.org/show_bug.cgi?id=20821 23105 23106 Implement a transition cache to improve the performance of new properties 23107 being added to objects. This is extremely beneficial in constructors and 23108 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8% 23109 overall) 23110 23111 * VM/CTI.cpp: 23112 (JSC::CTI::privateCompileMainPass): 23113 (JSC::): 23114 (JSC::transitionWillNeedStorageRealloc): 23115 (JSC::CTI::privateCompilePutByIdTransition): 23116 * VM/CTI.h: 23117 (JSC::CTI::compilePutByIdTransition): 23118 * VM/CodeBlock.cpp: 23119 (JSC::printPutByIdOp): 23120 (JSC::CodeBlock::printStructureIDs): 23121 (JSC::CodeBlock::dump): 23122 (JSC::CodeBlock::derefStructureIDs): 23123 (JSC::CodeBlock::refStructureIDs): 23124 * VM/CodeGenerator.cpp: 23125 (JSC::CodeGenerator::emitPutById): 23126 * VM/Machine.cpp: 23127 (JSC::cachePrototypeChain): 23128 (JSC::Machine::tryCachePutByID): 23129 (JSC::Machine::tryCacheGetByID): 23130 (JSC::Machine::privateExecute): 23131 (JSC::Machine::tryCTICachePutByID): 23132 (JSC::Machine::tryCTICacheGetByID): 23133 * VM/Machine.h: 23134 * VM/Opcode.h: 23135 * kjs/JSObject.h: 23136 (JSC::JSObject::putDirect): 23137 (JSC::JSObject::transitionTo): 23138 * kjs/PutPropertySlot.h: 23139 (JSC::PutPropertySlot::PutPropertySlot): 23140 (JSC::PutPropertySlot::wasTransition): 23141 (JSC::PutPropertySlot::setWasTransition): 23142 * kjs/StructureID.cpp: 23143 (JSC::StructureID::transitionTo): 23144 (JSC::StructureIDChain::StructureIDChain): 23145 * kjs/StructureID.h: 23146 (JSC::StructureID::previousID): 23147 (JSC::StructureID::setCachedPrototypeChain): 23148 (JSC::StructureID::cachedPrototypeChain): 23149 (JSC::StructureID::propertyMap): 23150 * masm/X86Assembler.h: 23151 (JSC::X86Assembler::addl_i8m): 23152 (JSC::X86Assembler::subl_i8m): 23153 231542008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23155 23156 Reviewed by Maciej Stachowiak. 23157 23158 Bug 20819: JSValue::isObject() is slow 23159 <https://bugs.webkit.org/show_bug.cgi?id=20819> 23160 23161 Optimize JSCell::isObject() and JSCell::isString() by making them 23162 non-virtual calls that rely on the StructureID type information. 23163 23164 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8 23165 benchmark suite. 23166 23167 * JavaScriptCore.exp: 23168 * kjs/JSCell.cpp: 23169 * kjs/JSCell.h: 23170 (JSC::JSCell::isObject): 23171 (JSC::JSCell::isString): 23172 * kjs/JSObject.cpp: 23173 * kjs/JSObject.h: 23174 * kjs/JSString.cpp: 23175 * kjs/JSString.h: 23176 (JSC::JSString::JSString): 23177 * kjs/StructureID.h: 23178 (JSC::StructureID::type): 23179 231802008-09-11 Stephanie Lewis <slewis@apple.com> 23181 23182 Reviewed by Oliver Hunt. 23183 23184 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes 23185 crash on CNN and on Dromaeo. 23186 Fix Missing close tag in vcproj. 23187 23188 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 23189 231902008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23191 23192 Not reviewed. 23193 23194 Correct an SVN problem with the last commit and actually add the new 23195 files. 23196 23197 * wrec/CharacterClassConstructor.cpp: Added. 23198 (JSC::): 23199 (JSC::getCharacterClassNewline): 23200 (JSC::getCharacterClassDigits): 23201 (JSC::getCharacterClassSpaces): 23202 (JSC::getCharacterClassWordchar): 23203 (JSC::getCharacterClassNondigits): 23204 (JSC::getCharacterClassNonspaces): 23205 (JSC::getCharacterClassNonwordchar): 23206 (JSC::CharacterClassConstructor::addSorted): 23207 (JSC::CharacterClassConstructor::addSortedRange): 23208 (JSC::CharacterClassConstructor::put): 23209 (JSC::CharacterClassConstructor::flush): 23210 (JSC::CharacterClassConstructor::append): 23211 * wrec/CharacterClassConstructor.h: Added. 23212 (JSC::CharacterClassConstructor::CharacterClassConstructor): 23213 (JSC::CharacterClassConstructor::isUpsideDown): 23214 (JSC::CharacterClassConstructor::charClass): 23215 232162008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23217 23218 Reviewed by Maciej Stachowiak. 23219 23220 Bug 20788: Split CharacterClassConstructor into its own file 23221 <https://bugs.webkit.org/show_bug.cgi?id=20788> 23222 23223 Split CharacterClassConstructor into its own file and clean up some 23224 style issues. 23225 23226 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 23227 * JavaScriptCore.xcodeproj/project.pbxproj: 23228 * wrec/CharacterClassConstructor.cpp: Added. 23229 (JSC::): 23230 (JSC::getCharacterClassNewline): 23231 (JSC::getCharacterClassDigits): 23232 (JSC::getCharacterClassSpaces): 23233 (JSC::getCharacterClassWordchar): 23234 (JSC::getCharacterClassNondigits): 23235 (JSC::getCharacterClassNonspaces): 23236 (JSC::getCharacterClassNonwordchar): 23237 (JSC::CharacterClassConstructor::addSorted): 23238 (JSC::CharacterClassConstructor::addSortedRange): 23239 (JSC::CharacterClassConstructor::put): 23240 (JSC::CharacterClassConstructor::flush): 23241 (JSC::CharacterClassConstructor::append): 23242 * wrec/CharacterClassConstructor.h: Added. 23243 (JSC::CharacterClassConstructor::CharacterClassConstructor): 23244 (JSC::CharacterClassConstructor::isUpsideDown): 23245 (JSC::CharacterClassConstructor::charClass): 23246 * wrec/WREC.cpp: 23247 (JSC::WRECParser::parseCharacterClass): 23248 232492008-09-10 Simon Hausmann <hausmann@webkit.org> 23250 23251 Not reviewed but trivial one-liner for yet unused macro. 23252 23253 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark. 23254 23255 (part of https://bugs.webkit.org/show_bug.cgi?id=20746) 23256 23257 * wtf/Platform.h: 23258 232592008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23260 23261 Rubber-stamped by Oliver Hunt. 23262 23263 Fix a typo by renaming the overloaded orl_rr that takes an immediate to 23264 orl_i32r. 23265 23266 * VM/CTI.cpp: 23267 (JSC::CTI::emitFastArithPotentiallyReTagImmediate): 23268 * masm/X86Assembler.h: 23269 (JSC::X86Assembler::orl_i32r): 23270 * wrec/WREC.cpp: 23271 (JSC::WRECGenerator::generatePatternCharacter): 23272 (JSC::WRECGenerator::generateCharacterClassInverted): 23273 232742008-09-10 Sam Weinig <sam@webkit.org> 23275 23276 Reviewed by Geoff Garen. 23277 23278 Add inline property storage for JSObject. 23279 23280 1.2% progression on Sunspider. .5% progression on the v8 test suite. 23281 23282 * JavaScriptCore.exp: 23283 * VM/CTI.cpp: 23284 (JSC::CTI::privateCompileGetByIdProto): 23285 (JSC::CTI::privateCompileGetByIdChain): 23286 * kjs/JSObject.cpp: 23287 (JSC::JSObject::mark): There is no reason to check storageSize now that 23288 we start from 0. 23289 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage. 23290 * kjs/JSObject.h: 23291 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr 23292 now so there is no reason to .get() 23293 (JSC::JSObject::usingInlineStorage): 23294 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the 23295 inline storage. 23296 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline 23297 storage. 23298 (JSC::JSObject::putDirect): Switch to the heap storage only when we know 23299 we know that we are about to add a property that will overflow the inline 23300 storage. 23301 * kjs/PropertyMap.cpp: 23302 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is 23303 now handled by JSObject. 23304 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore. 23305 * kjs/PropertyMap.h: 23306 (JSC::PropertyMap::storageSize): Rename from markingCount. 23307 * kjs/StructureID.cpp: 23308 (JSC::StructureID::addPropertyTransition): Don't resize the property storage 23309 if we are using inline storage. 23310 * kjs/StructureID.h: 23311 233122008-09-10 Oliver Hunt <oliver@apple.com> 23313 23314 Reviewed by Geoff Garen. 23315 23316 Inline immediate number version of op_mul. 23317 23318 Renamed mull_rr to imull_rr as that's what it's 23319 actually doing, and added imull_i32r for the constant 23320 case immediate multiply. 23321 23322 1.1% improvement to SunSpider. 23323 23324 * VM/CTI.cpp: 23325 (JSC::CTI::privateCompileMainPass): 23326 (JSC::CTI::privateCompileSlowCases): 23327 * masm/X86Assembler.h: 23328 (JSC::X86Assembler::): 23329 (JSC::X86Assembler::imull_rr): 23330 (JSC::X86Assembler::imull_i32r): 23331 233322008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23333 23334 Not reviewed. 23335 23336 Mac build fix. 23337 23338 * JavaScriptCore.xcodeproj/project.pbxproj: 23339 233402008-09-09 Oliver Hunt <oliver@apple.com> 23341 23342 Reviewed by Maciej Stachowiak. 23343 23344 Add optimised access to known properties on the global object. 23345 23346 Improve cross scope access to the global object by emitting 23347 code to access it directly rather than by walking the scope chain. 23348 23349 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks. 23350 23351 * VM/CTI.cpp: 23352 (JSC::CTI::privateCompileMainPass): 23353 (JSC::CTI::emitGetVariableObjectRegister): 23354 (JSC::CTI::emitPutVariableObjectRegister): 23355 * VM/CTI.h: 23356 * VM/CodeBlock.cpp: 23357 (JSC::CodeBlock::dump): 23358 * VM/CodeGenerator.cpp: 23359 (JSC::CodeGenerator::findScopedProperty): 23360 (JSC::CodeGenerator::emitResolve): 23361 (JSC::CodeGenerator::emitGetScopedVar): 23362 (JSC::CodeGenerator::emitPutScopedVar): 23363 * VM/CodeGenerator.h: 23364 * VM/Machine.cpp: 23365 (JSC::Machine::privateExecute): 23366 * VM/Opcode.h: 23367 * kjs/nodes.cpp: 23368 (JSC::FunctionCallResolveNode::emitCode): 23369 (JSC::PostfixResolveNode::emitCode): 23370 (JSC::PrefixResolveNode::emitCode): 23371 (JSC::ReadModifyResolveNode::emitCode): 23372 (JSC::AssignResolveNode::emitCode): 23373 233742008-09-10 Maciej Stachowiak <mjs@apple.com> 23375 23376 Reviewed by Oliver. 23377 23378 - enable polymorphic inline caching of properties of primitives 23379 23380 1.012x speedup on SunSpider. 23381 23382 We create special structure IDs for JSString and 23383 JSNumberCell. Unlike normal structure IDs, these cannot hold the 23384 true prototype. Due to JS autoboxing semantics, the prototype used 23385 when looking up string or number properties depends on the lexical 23386 global object of the call site, not the creation site. Thus we 23387 enable StructureIDs to handle this quirk for primitives. 23388 23389 Everything else should be straightforward. 23390 23391 * VM/CTI.cpp: 23392 (JSC::CTI::privateCompileGetByIdProto): 23393 (JSC::CTI::privateCompileGetByIdChain): 23394 * VM/CTI.h: 23395 (JSC::CTI::compileGetByIdProto): 23396 (JSC::CTI::compileGetByIdChain): 23397 * VM/JSPropertyNameIterator.h: 23398 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 23399 * VM/Machine.cpp: 23400 (JSC::Machine::Machine): 23401 (JSC::cachePrototypeChain): 23402 (JSC::Machine::tryCachePutByID): 23403 (JSC::Machine::tryCacheGetByID): 23404 (JSC::Machine::privateExecute): 23405 (JSC::Machine::tryCTICachePutByID): 23406 (JSC::Machine::tryCTICacheGetByID): 23407 * kjs/GetterSetter.h: 23408 (JSC::GetterSetter::GetterSetter): 23409 * kjs/JSCell.h: 23410 * kjs/JSGlobalData.cpp: 23411 (JSC::JSGlobalData::JSGlobalData): 23412 * kjs/JSGlobalData.h: 23413 * kjs/JSGlobalObject.h: 23414 (JSC::StructureID::prototypeForLookup): 23415 * kjs/JSNumberCell.h: 23416 (JSC::JSNumberCell::JSNumberCell): 23417 (JSC::jsNumberCell): 23418 * kjs/JSObject.h: 23419 (JSC::JSObject::prototype): 23420 * kjs/JSString.cpp: 23421 (JSC::jsString): 23422 (JSC::jsSubstring): 23423 (JSC::jsOwnedString): 23424 * kjs/JSString.h: 23425 (JSC::JSString::JSString): 23426 (JSC::JSString::): 23427 (JSC::jsSingleCharacterString): 23428 (JSC::jsSingleCharacterSubstring): 23429 (JSC::jsNontrivialString): 23430 * kjs/SmallStrings.cpp: 23431 (JSC::SmallStrings::createEmptyString): 23432 (JSC::SmallStrings::createSingleCharacterString): 23433 * kjs/StructureID.cpp: 23434 (JSC::StructureID::StructureID): 23435 (JSC::StructureID::addPropertyTransition): 23436 (JSC::StructureID::getterSetterTransition): 23437 (JSC::StructureIDChain::StructureIDChain): 23438 * kjs/StructureID.h: 23439 (JSC::StructureID::create): 23440 (JSC::StructureID::storedPrototype): 23441 234422008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com> 23443 23444 Reviewed by Sam Weinig. 23445 23446 https://bugs.webkit.org/show_bug.cgi?id=20746 23447 23448 Added WINCE platform macro. 23449 23450 * wtf/Platform.h: 23451 234522008-09-09 Sam Weinig <sam@webkit.org> 23453 23454 Reviewed by Mark Rowe. 23455 23456 Remove unnecessary override of getOffset. 23457 23458 Sunspider reports this as a .6% progression. 23459 23460 * JavaScriptCore.exp: 23461 * kjs/JSObject.h: 23462 (JSC::JSObject::getDirectLocation): 23463 (JSC::JSObject::getOwnPropertySlotForWrite): 23464 (JSC::JSObject::putDirect): 23465 * kjs/PropertyMap.cpp: 23466 * kjs/PropertyMap.h: 23467 234682008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23469 23470 Reviewed by Maciej Stachowiak. 23471 23472 Bug 20759: Remove MacroAssembler 23473 <https://bugs.webkit.org/show_bug.cgi?id=20759> 23474 23475 Remove MacroAssembler and move its functionality to X86Assembler. 23476 23477 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 23478 * JavaScriptCore.xcodeproj/project.pbxproj: 23479 * VM/CTI.cpp: 23480 (JSC::CTI::emitGetArg): 23481 (JSC::CTI::emitGetPutArg): 23482 (JSC::CTI::emitPutArg): 23483 (JSC::CTI::emitPutCTIParam): 23484 (JSC::CTI::emitGetCTIParam): 23485 (JSC::CTI::emitPutToCallFrameHeader): 23486 (JSC::CTI::emitGetFromCallFrameHeader): 23487 (JSC::CTI::emitPutResult): 23488 (JSC::CTI::emitDebugExceptionCheck): 23489 (JSC::CTI::emitJumpSlowCaseIfNotImm): 23490 (JSC::CTI::emitJumpSlowCaseIfNotImms): 23491 (JSC::CTI::emitFastArithDeTagImmediate): 23492 (JSC::CTI::emitFastArithReTagImmediate): 23493 (JSC::CTI::emitFastArithPotentiallyReTagImmediate): 23494 (JSC::CTI::emitFastArithImmToInt): 23495 (JSC::CTI::emitFastArithIntToImmOrSlowCase): 23496 (JSC::CTI::emitFastArithIntToImmNoCheck): 23497 (JSC::CTI::compileOpCall): 23498 (JSC::CTI::emitSlowScriptCheck): 23499 (JSC::CTI::privateCompileMainPass): 23500 (JSC::CTI::privateCompileSlowCases): 23501 (JSC::CTI::privateCompile): 23502 (JSC::CTI::privateCompileGetByIdSelf): 23503 (JSC::CTI::privateCompileGetByIdProto): 23504 (JSC::CTI::privateCompileGetByIdChain): 23505 (JSC::CTI::privateCompilePutByIdReplace): 23506 (JSC::CTI::privateArrayLengthTrampoline): 23507 (JSC::CTI::privateStringLengthTrampoline): 23508 (JSC::CTI::compileRegExp): 23509 * VM/CTI.h: 23510 (JSC::CallRecord::CallRecord): 23511 (JSC::JmpTable::JmpTable): 23512 (JSC::SlowCaseEntry::SlowCaseEntry): 23513 (JSC::CTI::JSRInfo::JSRInfo): 23514 * masm/MacroAssembler.h: Removed. 23515 * masm/MacroAssemblerWin.cpp: Removed. 23516 * masm/X86Assembler.h: 23517 (JSC::X86Assembler::emitConvertToFastCall): 23518 (JSC::X86Assembler::emitRestoreArgumentReference): 23519 * wrec/WREC.h: 23520 (JSC::WRECGenerator::WRECGenerator): 23521 (JSC::WRECParser::WRECParser): 23522 235232008-09-09 Sam Weinig <sam@webkit.org> 23524 23525 Reviewed by Cameron Zwarich. 23526 23527 Don't waste the first item in the PropertyStorage. 23528 23529 - Fix typo (makingCount -> markingCount) 23530 - Remove undefined method declaration. 23531 23532 No change on Sunspider. 23533 23534 * kjs/JSObject.cpp: 23535 (JSC::JSObject::mark): 23536 * kjs/PropertyMap.cpp: 23537 (JSC::PropertyMap::put): 23538 (JSC::PropertyMap::remove): 23539 (JSC::PropertyMap::getOffset): 23540 (JSC::PropertyMap::insert): 23541 (JSC::PropertyMap::rehash): 23542 (JSC::PropertyMap::resizePropertyStorage): 23543 (JSC::PropertyMap::checkConsistency): 23544 * kjs/PropertyMap.h: 23545 (JSC::PropertyMap::markingCount): Fix typo. 23546 235472008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23548 23549 Not reviewed. 23550 23551 Speculative Windows build fix. 23552 23553 * masm/MacroAssemblerWin.cpp: 23554 (JSC::MacroAssembler::emitConvertToFastCall): 23555 (JSC::MacroAssembler::emitRestoreArgumentReference): 23556 235572008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23558 23559 Reviewed by Maciej Stachowiak. 23560 23561 Bug 20755: Create an X86 namespace for register names and other things 23562 <https://bugs.webkit.org/show_bug.cgi?id=20755> 23563 23564 Create an X86 namespace to put X86 register names. Perhaps I will move 23565 opcode names here later as well. 23566 23567 * VM/CTI.cpp: 23568 (JSC::CTI::emitGetArg): 23569 (JSC::CTI::emitGetPutArg): 23570 (JSC::CTI::emitPutArg): 23571 (JSC::CTI::emitPutArgConstant): 23572 (JSC::CTI::emitPutCTIParam): 23573 (JSC::CTI::emitGetCTIParam): 23574 (JSC::CTI::emitPutToCallFrameHeader): 23575 (JSC::CTI::emitGetFromCallFrameHeader): 23576 (JSC::CTI::emitPutResult): 23577 (JSC::CTI::emitDebugExceptionCheck): 23578 (JSC::CTI::emitJumpSlowCaseIfNotImms): 23579 (JSC::CTI::compileOpCall): 23580 (JSC::CTI::emitSlowScriptCheck): 23581 (JSC::CTI::privateCompileMainPass): 23582 (JSC::CTI::privateCompileSlowCases): 23583 (JSC::CTI::privateCompile): 23584 (JSC::CTI::privateCompileGetByIdSelf): 23585 (JSC::CTI::privateCompileGetByIdProto): 23586 (JSC::CTI::privateCompileGetByIdChain): 23587 (JSC::CTI::privateCompilePutByIdReplace): 23588 (JSC::CTI::privateArrayLengthTrampoline): 23589 (JSC::CTI::privateStringLengthTrampoline): 23590 (JSC::CTI::compileRegExp): 23591 * VM/CTI.h: 23592 * masm/X86Assembler.h: 23593 (JSC::X86::): 23594 (JSC::X86Assembler::emitModRm_rm): 23595 (JSC::X86Assembler::emitModRm_rm_Unchecked): 23596 (JSC::X86Assembler::emitModRm_rmsib): 23597 * wrec/WREC.cpp: 23598 (JSC::WRECGenerator::generateNonGreedyQuantifier): 23599 (JSC::WRECGenerator::generateGreedyQuantifier): 23600 (JSC::WRECGenerator::generateParentheses): 23601 (JSC::WRECGenerator::generateBackreference): 23602 (JSC::WRECGenerator::gernerateDisjunction): 23603 * wrec/WREC.h: 23604 236052008-09-09 Sam Weinig <sam@webkit.org> 23606 23607 Reviewed by Geoffrey Garen. 23608 23609 Remove unnecessary friend declaration. 23610 23611 * kjs/PropertyMap.h: 23612 236132008-09-09 Sam Weinig <sam@webkit.org> 23614 23615 Reviewed by Geoffrey Garen. 23616 23617 Replace uses of PropertyMap::get and PropertyMap::getLocation with 23618 PropertyMap::getOffset. 23619 23620 Sunspider reports this as a .6% improvement. 23621 23622 * JavaScriptCore.exp: 23623 * kjs/JSObject.cpp: 23624 (JSC::JSObject::put): 23625 (JSC::JSObject::deleteProperty): 23626 (JSC::JSObject::getPropertyAttributes): 23627 * kjs/JSObject.h: 23628 (JSC::JSObject::getDirect): 23629 (JSC::JSObject::getDirectLocation): 23630 (JSC::JSObject::locationForOffset): 23631 * kjs/PropertyMap.cpp: 23632 (JSC::PropertyMap::remove): 23633 (JSC::PropertyMap::getOffset): 23634 * kjs/PropertyMap.h: 23635 236362008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23637 23638 Reviewed by Sam Weinig. 23639 23640 Bug 20754: Remove emit prefix from assembler opcode methods 23641 <https://bugs.webkit.org/show_bug.cgi?id=20754> 23642 23643 * VM/CTI.cpp: 23644 (JSC::CTI::emitGetArg): 23645 (JSC::CTI::emitGetPutArg): 23646 (JSC::CTI::emitPutArg): 23647 (JSC::CTI::emitPutArgConstant): 23648 (JSC::CTI::emitPutCTIParam): 23649 (JSC::CTI::emitGetCTIParam): 23650 (JSC::CTI::emitPutToCallFrameHeader): 23651 (JSC::CTI::emitGetFromCallFrameHeader): 23652 (JSC::CTI::emitPutResult): 23653 (JSC::CTI::emitDebugExceptionCheck): 23654 (JSC::CTI::emitCall): 23655 (JSC::CTI::emitJumpSlowCaseIfNotImm): 23656 (JSC::CTI::emitJumpSlowCaseIfNotImms): 23657 (JSC::CTI::emitFastArithDeTagImmediate): 23658 (JSC::CTI::emitFastArithReTagImmediate): 23659 (JSC::CTI::emitFastArithPotentiallyReTagImmediate): 23660 (JSC::CTI::emitFastArithImmToInt): 23661 (JSC::CTI::emitFastArithIntToImmOrSlowCase): 23662 (JSC::CTI::emitFastArithIntToImmNoCheck): 23663 (JSC::CTI::compileOpCall): 23664 (JSC::CTI::emitSlowScriptCheck): 23665 (JSC::CTI::privateCompileMainPass): 23666 (JSC::CTI::privateCompileSlowCases): 23667 (JSC::CTI::privateCompile): 23668 (JSC::CTI::privateCompileGetByIdSelf): 23669 (JSC::CTI::privateCompileGetByIdProto): 23670 (JSC::CTI::privateCompileGetByIdChain): 23671 (JSC::CTI::privateCompilePutByIdReplace): 23672 (JSC::CTI::privateArrayLengthTrampoline): 23673 (JSC::CTI::privateStringLengthTrampoline): 23674 (JSC::CTI::compileRegExp): 23675 * masm/MacroAssemblerWin.cpp: 23676 (JSC::MacroAssembler::emitConvertToFastCall): 23677 (JSC::MacroAssembler::emitRestoreArgumentReference): 23678 * masm/X86Assembler.h: 23679 (JSC::X86Assembler::pushl_r): 23680 (JSC::X86Assembler::pushl_m): 23681 (JSC::X86Assembler::popl_r): 23682 (JSC::X86Assembler::popl_m): 23683 (JSC::X86Assembler::movl_rr): 23684 (JSC::X86Assembler::addl_rr): 23685 (JSC::X86Assembler::addl_i8r): 23686 (JSC::X86Assembler::addl_i32r): 23687 (JSC::X86Assembler::addl_mr): 23688 (JSC::X86Assembler::andl_rr): 23689 (JSC::X86Assembler::andl_i32r): 23690 (JSC::X86Assembler::cmpl_i8r): 23691 (JSC::X86Assembler::cmpl_rr): 23692 (JSC::X86Assembler::cmpl_rm): 23693 (JSC::X86Assembler::cmpl_i32r): 23694 (JSC::X86Assembler::cmpl_i32m): 23695 (JSC::X86Assembler::cmpw_rm): 23696 (JSC::X86Assembler::orl_rr): 23697 (JSC::X86Assembler::subl_rr): 23698 (JSC::X86Assembler::subl_i8r): 23699 (JSC::X86Assembler::subl_i32r): 23700 (JSC::X86Assembler::subl_mr): 23701 (JSC::X86Assembler::testl_i32r): 23702 (JSC::X86Assembler::testl_rr): 23703 (JSC::X86Assembler::xorl_i8r): 23704 (JSC::X86Assembler::xorl_rr): 23705 (JSC::X86Assembler::sarl_i8r): 23706 (JSC::X86Assembler::sarl_CLr): 23707 (JSC::X86Assembler::shl_i8r): 23708 (JSC::X86Assembler::shll_CLr): 23709 (JSC::X86Assembler::mull_rr): 23710 (JSC::X86Assembler::idivl_r): 23711 (JSC::X86Assembler::cdq): 23712 (JSC::X86Assembler::movl_mr): 23713 (JSC::X86Assembler::movzwl_mr): 23714 (JSC::X86Assembler::movl_rm): 23715 (JSC::X86Assembler::movl_i32r): 23716 (JSC::X86Assembler::movl_i32m): 23717 (JSC::X86Assembler::leal_mr): 23718 (JSC::X86Assembler::ret): 23719 (JSC::X86Assembler::jmp_r): 23720 (JSC::X86Assembler::jmp_m): 23721 (JSC::X86Assembler::call_r): 23722 * wrec/WREC.cpp: 23723 (JSC::WRECGenerator::generateBacktrack1): 23724 (JSC::WRECGenerator::generateBacktrackBackreference): 23725 (JSC::WRECGenerator::generateBackreferenceQuantifier): 23726 (JSC::WRECGenerator::generateNonGreedyQuantifier): 23727 (JSC::WRECGenerator::generateGreedyQuantifier): 23728 (JSC::WRECGenerator::generatePatternCharacter): 23729 (JSC::WRECGenerator::generateCharacterClassInvertedRange): 23730 (JSC::WRECGenerator::generateCharacterClassInverted): 23731 (JSC::WRECGenerator::generateCharacterClass): 23732 (JSC::WRECGenerator::generateParentheses): 23733 (JSC::WRECGenerator::gererateParenthesesResetTrampoline): 23734 (JSC::WRECGenerator::generateAssertionBOL): 23735 (JSC::WRECGenerator::generateAssertionEOL): 23736 (JSC::WRECGenerator::generateAssertionWordBoundary): 23737 (JSC::WRECGenerator::generateBackreference): 23738 (JSC::WRECGenerator::gernerateDisjunction): 23739 237402008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23741 23742 Reviewed by Maciej Stachowiak. 23743 23744 Clean up the WREC code some more. 23745 23746 * VM/CTI.cpp: 23747 (JSC::CTI::compileRegExp): 23748 * wrec/WREC.cpp: 23749 (JSC::getCharacterClassNewline): 23750 (JSC::getCharacterClassDigits): 23751 (JSC::getCharacterClassSpaces): 23752 (JSC::getCharacterClassWordchar): 23753 (JSC::getCharacterClassNondigits): 23754 (JSC::getCharacterClassNonspaces): 23755 (JSC::getCharacterClassNonwordchar): 23756 (JSC::WRECGenerator::generateBacktrack1): 23757 (JSC::WRECGenerator::generateBacktrackBackreference): 23758 (JSC::WRECGenerator::generateBackreferenceQuantifier): 23759 (JSC::WRECGenerator::generateNonGreedyQuantifier): 23760 (JSC::WRECGenerator::generateGreedyQuantifier): 23761 (JSC::WRECGenerator::generatePatternCharacter): 23762 (JSC::WRECGenerator::generateCharacterClassInvertedRange): 23763 (JSC::WRECGenerator::generateCharacterClassInverted): 23764 (JSC::WRECGenerator::generateCharacterClass): 23765 (JSC::WRECGenerator::generateParentheses): 23766 (JSC::WRECGenerator::gererateParenthesesResetTrampoline): 23767 (JSC::WRECGenerator::generateAssertionBOL): 23768 (JSC::WRECGenerator::generateAssertionEOL): 23769 (JSC::WRECGenerator::generateAssertionWordBoundary): 23770 (JSC::WRECGenerator::generateBackreference): 23771 (JSC::WRECGenerator::gernerateDisjunction): 23772 (JSC::WRECParser::parseCharacterClass): 23773 (JSC::WRECParser::parseEscape): 23774 (JSC::WRECParser::parseTerm): 23775 * wrec/WREC.h: 23776 237772008-09-09 Mark Rowe <mrowe@apple.com> 23778 23779 Build fix, rubber-stamped by Anders Carlsson. 23780 23781 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp. 23782 23783 * JavaScriptCore.xcodeproj/project.pbxproj: 23784 237852008-09-09 Mark Rowe <mrowe@apple.com> 23786 23787 Rubber-stamped by Oliver Hunt. 23788 23789 Fix builds using the "debug" variant. 23790 23791 This reverts r36130 and tweaks Identifier to export the same symbols for Debug 23792 and Release configurations. 23793 23794 * Configurations/JavaScriptCore.xcconfig: 23795 * DerivedSources.make: 23796 * JavaScriptCore.Debug.exp: Removed. 23797 * JavaScriptCore.base.exp: Removed. 23798 * JavaScriptCore.exp: Added. 23799 * JavaScriptCore.xcodeproj/project.pbxproj: 23800 * kjs/identifier.cpp: 23801 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that 23802 there is no overhead in Release builds. 23803 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds. 23804 * kjs/identifier.h: 23805 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is 23806 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable. 23807 238082008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23809 23810 Reviewed by Maciej Stachowiak. 23811 23812 Clean up WREC a bit to bring it closer to our coding style guidelines. 23813 23814 * wrec/WREC.cpp: 23815 (JSC::): 23816 (JSC::getCharacterClass_newline): 23817 (JSC::getCharacterClass_d): 23818 (JSC::getCharacterClass_s): 23819 (JSC::getCharacterClass_w): 23820 (JSC::getCharacterClass_D): 23821 (JSC::getCharacterClass_S): 23822 (JSC::getCharacterClass_W): 23823 (JSC::CharacterClassConstructor::append): 23824 (JSC::WRECGenerator::generateNonGreedyQuantifier): 23825 (JSC::WRECGenerator::generateGreedyQuantifier): 23826 (JSC::WRECGenerator::generateCharacterClassInverted): 23827 (JSC::WRECParser::parseQuantifier): 23828 (JSC::WRECParser::parsePatternCharacterQualifier): 23829 (JSC::WRECParser::parseCharacterClassQuantifier): 23830 (JSC::WRECParser::parseBackreferenceQuantifier): 23831 * wrec/WREC.h: 23832 (JSC::Quantifier::): 23833 (JSC::Quantifier::Quantifier): 23834 238352008-09-09 Jungshik Shin <jungshik.shin@gmail.com> 23836 23837 Reviewed by Alexey Proskuryakov. 23838 23839 Try MIME charset names before trying IANA names 23840 ( https://bugs.webkit.org/show_bug.cgi?id=17537 ) 23841 23842 * wtf/StringExtras.h: (strcasecmp): Added. 23843 238442008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23845 23846 Reviewed by Mark Rowe. 23847 23848 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds 23849 <https://bugs.webkit.org/show_bug.cgi?id=20719> 23850 <rdar://problem/6205787> 23851 23852 Fix a typo in the case-insensitive matching of character patterns. 23853 23854 * wrec/WREC.cpp: 23855 (JSC::WRECGenerator::generatePatternCharacter): 23856 238572008-09-09 Maciej Stachowiak <mjs@apple.com> 23858 23859 Reviewed by Sam Weinig. 23860 23861 - allow polymorphic inline cache to handle Math object functions and possibly other similar things 23862 23863 1.012x speedup on SunSpider. 23864 23865 * kjs/MathObject.cpp: 23866 (JSC::MathObject::getOwnPropertySlot): 23867 * kjs/lookup.cpp: 23868 (JSC::setUpStaticFunctionSlot): 23869 * kjs/lookup.h: 23870 (JSC::getStaticPropertySlot): 23871 238722008-09-08 Sam Weinig <sam@webkit.org> 23873 23874 Reviewed by Maciej Stachowiak and Oliver Hunt. 23875 23876 Split storage of properties out of the PropertyMap and into the JSObject 23877 to allow sharing PropertyMap on the StructureID. In order to get this 23878 function correctly, the StructureID's transition mappings were changed to 23879 transition based on property name and attribute pairs, instead of just 23880 property name. 23881 23882 - Removes the single property optimization now that the PropertyMap is shared. 23883 This will be replaced by in-lining some values on the JSObject. 23884 23885 This is a wash on Sunspider and a 6.7% win on the v8 test suite. 23886 23887 * JavaScriptCore.base.exp: 23888 * VM/CTI.cpp: 23889 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject. 23890 (JSC::CTI::privateCompileGetByIdProto): Ditto. 23891 (JSC::CTI::privateCompileGetByIdChain): Ditto. 23892 (JSC::CTI::privateCompilePutByIdReplace): Ditto. 23893 * kjs/JSObject.cpp: 23894 (JSC::JSObject::mark): Mark the PropertyStorage. 23895 (JSC::JSObject::put): Update to get the propertyMap of the StructureID. 23896 (JSC::JSObject::deleteProperty): Ditto. 23897 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter. 23898 (JSC::JSObject::defineSetter): Ditto. 23899 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID 23900 (JSC::JSObject::getPropertyNames): Ditto. 23901 (JSC::JSObject::removeDirect): Ditto. 23902 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage. 23903 (JSC::JSObject::propertyStorage): return the PropertyStorage. 23904 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID. 23905 (JSC::JSObject::getDirectLocation): Ditto. 23906 (JSC::JSObject::offsetForLocation): Compute location directly. 23907 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID. 23908 (JSC::JSObject::hasGetterSetterProperties): Ditto. 23909 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage. 23910 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage. 23911 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID. 23912 (JSC::JSObject::getOwnPropertySlot): Ditto. 23913 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists. 23914 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues. 23915 (JSC::PropertyMap::checkConsistency): 23916 (JSC::PropertyMap::operator=): 23917 (JSC::PropertyMap::~PropertyMap): 23918 (JSC::PropertyMap::get): 23919 (JSC::PropertyMap::getLocation): 23920 (JSC::PropertyMap::put): 23921 (JSC::PropertyMap::getOffset): 23922 (JSC::PropertyMap::insert): 23923 (JSC::PropertyMap::expand): 23924 (JSC::PropertyMap::rehash): 23925 (JSC::PropertyMap::createTable): 23926 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map 23927 (JSC::PropertyMap::remove): 23928 (JSC::PropertyMap::getEnumerablePropertyNames): 23929 * kjs/PropertyMap.h: 23930 (JSC::PropertyMapEntry::PropertyMapEntry): 23931 (JSC::PropertyMap::isEmpty): 23932 (JSC::PropertyMap::size): 23933 (JSC::PropertyMap::makingCount): 23934 (JSC::PropertyMap::PropertyMap): 23935 23936 * kjs/StructureID.cpp: 23937 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name 23938 and attributes. 23939 (JSC::StructureID::toDictionaryTransition): Copy the map. 23940 (JSC::StructureID::changePrototypeTransition): Copy the map. 23941 (JSC::StructureID::getterSetterTransition): Copy the map. 23942 (JSC::StructureID::~StructureID): 23943 * kjs/StructureID.h: 23944 (JSC::TransitionTableHash::hash): Custom hash for transition map. 23945 (JSC::TransitionTableHash::equal): Ditto. 23946 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map 23947 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto. 23948 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto. 23949 (JSC::StructureID::propertyMap): Added. 23950 239512008-09-08 Oliver Hunt <oliver@apple.com> 23952 23953 Reviewed by Mark Rowe. 23954 23955 Bug 20694: Slow Script error pops up when running Dromaeo tests 23956 23957 Correct error in timeout logic where execution tick count would 23958 be reset to incorrect value due to incorrect offset and indirection. 23959 Codegen for the slow script dialog was factored out into a separate 23960 method (emitSlowScriptCheck) rather than having multiple copies of 23961 the same code. Also added calls to generate slow script checks 23962 for loop_if_less and loop_if_true opcodes. 23963 23964 * VM/CTI.cpp: 23965 (JSC::CTI::emitSlowScriptCheck): 23966 (JSC::CTI::privateCompileMainPass): 23967 (JSC::CTI::privateCompileSlowCases): 23968 * VM/CTI.h: 23969 239702008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23971 23972 Reviewed by Maciej Stachowiak. 23973 23974 Remove references to the removed WRECompiler class. 23975 23976 * VM/Machine.h: 23977 * wrec/WREC.h: 23978 239792008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca> 23980 23981 Rubber-stamped by Mark Rowe. 23982 23983 Fix the build with CTI enabled but WREC disabled. 23984 23985 * VM/CTI.cpp: 23986 * VM/CTI.h: 23987 239882008-09-08 Dan Bernstein <mitz@apple.com> 23989 23990 - build fix 23991 23992 * kjs/nodes.h: 23993 (JSC::StatementNode::): 23994 (JSC::BlockNode::): 23995 239962008-09-08 Kevin McCullough <kmccullough@apple.com> 23997 23998 Reviewed by Geoff. 23999 24000 <rdar://problem/6134407> Breakpoints in for loops, while loops or 24001 conditions without curly braces don't break. (19306) 24002 -Statement Lists already emit debug hooks but conditionals without 24003 brackets are not lists. 24004 24005 * kjs/nodes.cpp: 24006 (KJS::IfNode::emitCode): 24007 (KJS::IfElseNode::emitCode): 24008 (KJS::DoWhileNode::emitCode): 24009 (KJS::WhileNode::emitCode): 24010 (KJS::ForNode::emitCode): 24011 (KJS::ForInNode::emitCode): 24012 * kjs/nodes.h: 24013 (KJS::StatementNode::): 24014 (KJS::BlockNode::): 24015 240162008-09-08 Maciej Stachowiak <mjs@apple.com> 24017 24018 Reviewed by Anders Carlsson. 24019 24020 - Cache the code generated for eval to speed up SunSpider and web sites 24021 https://bugs.webkit.org/show_bug.cgi?id=20718 24022 24023 1.052x on SunSpider 24024 2.29x on date-format-tofte 24025 24026 Lots of real sites seem to get many hits on this cache as well, 24027 including GMail, Google Spreadsheets, Slate and Digg (the last of 24028 these gets over 100 hits on initial page load). 24029 24030 * VM/CodeBlock.h: 24031 (JSC::EvalCodeCache::get): 24032 * VM/Machine.cpp: 24033 (JSC::Machine::callEval): 24034 (JSC::Machine::privateExecute): 24035 (JSC::Machine::cti_op_call_eval): 24036 * VM/Machine.h: 24037 240382008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> 24039 24040 Reviewed by Oliver Hunt. 24041 24042 Bug 20711: Change KJS prefix on preprocessor macros to JSC 24043 <https://bugs.webkit.org/show_bug.cgi?id=20711> 24044 24045 * kjs/CommonIdentifiers.cpp: 24046 (JSC::CommonIdentifiers::CommonIdentifiers): 24047 * kjs/CommonIdentifiers.h: 24048 * kjs/PropertySlot.h: 24049 (JSC::PropertySlot::getValue): 24050 (JSC::PropertySlot::putValue): 24051 (JSC::PropertySlot::setValueSlot): 24052 (JSC::PropertySlot::setValue): 24053 (JSC::PropertySlot::setRegisterSlot): 24054 * kjs/lookup.h: 24055 * kjs/nodes.cpp: 24056 * kjs/nodes.h: 24057 (JSC::Node::): 24058 (JSC::ExpressionNode::): 24059 (JSC::StatementNode::): 24060 (JSC::NullNode::): 24061 (JSC::BooleanNode::): 24062 (JSC::NumberNode::): 24063 (JSC::ImmediateNumberNode::): 24064 (JSC::StringNode::): 24065 (JSC::RegExpNode::): 24066 (JSC::ThisNode::): 24067 (JSC::ResolveNode::): 24068 (JSC::ElementNode::): 24069 (JSC::ArrayNode::): 24070 (JSC::PropertyNode::): 24071 (JSC::PropertyListNode::): 24072 (JSC::ObjectLiteralNode::): 24073 (JSC::BracketAccessorNode::): 24074 (JSC::DotAccessorNode::): 24075 (JSC::ArgumentListNode::): 24076 (JSC::ArgumentsNode::): 24077 (JSC::NewExprNode::): 24078 (JSC::EvalFunctionCallNode::): 24079 (JSC::FunctionCallValueNode::): 24080 (JSC::FunctionCallResolveNode::): 24081 (JSC::FunctionCallBracketNode::): 24082 (JSC::FunctionCallDotNode::): 24083 (JSC::PrePostResolveNode::): 24084 (JSC::PostfixResolveNode::): 24085 (JSC::PostfixBracketNode::): 24086 (JSC::PostfixDotNode::): 24087 (JSC::PostfixErrorNode::): 24088 (JSC::DeleteResolveNode::): 24089 (JSC::DeleteBracketNode::): 24090 (JSC::DeleteDotNode::): 24091 (JSC::DeleteValueNode::): 24092 (JSC::VoidNode::): 24093 (JSC::TypeOfResolveNode::): 24094 (JSC::TypeOfValueNode::): 24095 (JSC::PrefixResolveNode::): 24096 (JSC::PrefixBracketNode::): 24097 (JSC::PrefixDotNode::): 24098 (JSC::PrefixErrorNode::): 24099 (JSC::UnaryPlusNode::): 24100 (JSC::NegateNode::): 24101 (JSC::BitwiseNotNode::): 24102 (JSC::LogicalNotNode::): 24103 (JSC::MultNode::): 24104 (JSC::DivNode::): 24105 (JSC::ModNode::): 24106 (JSC::AddNode::): 24107 (JSC::SubNode::): 24108 (JSC::LeftShiftNode::): 24109 (JSC::RightShiftNode::): 24110 (JSC::UnsignedRightShiftNode::): 24111 (JSC::LessNode::): 24112 (JSC::GreaterNode::): 24113 (JSC::LessEqNode::): 24114 (JSC::GreaterEqNode::): 24115 (JSC::ThrowableBinaryOpNode::): 24116 (JSC::InstanceOfNode::): 24117 (JSC::InNode::): 24118 (JSC::EqualNode::): 24119 (JSC::NotEqualNode::): 24120 (JSC::StrictEqualNode::): 24121 (JSC::NotStrictEqualNode::): 24122 (JSC::BitAndNode::): 24123 (JSC::BitOrNode::): 24124 (JSC::BitXOrNode::): 24125 (JSC::LogicalOpNode::): 24126 (JSC::ConditionalNode::): 24127 (JSC::ReadModifyResolveNode::): 24128 (JSC::AssignResolveNode::): 24129 (JSC::ReadModifyBracketNode::): 24130 (JSC::AssignBracketNode::): 24131 (JSC::AssignDotNode::): 24132 (JSC::ReadModifyDotNode::): 24133 (JSC::AssignErrorNode::): 24134 (JSC::CommaNode::): 24135 (JSC::VarDeclCommaNode::): 24136 (JSC::ConstDeclNode::): 24137 (JSC::ConstStatementNode::): 24138 (JSC::EmptyStatementNode::): 24139 (JSC::DebuggerStatementNode::): 24140 (JSC::ExprStatementNode::): 24141 (JSC::VarStatementNode::): 24142 (JSC::IfNode::): 24143 (JSC::IfElseNode::): 24144 (JSC::DoWhileNode::): 24145 (JSC::WhileNode::): 24146 (JSC::ForNode::): 24147 (JSC::ContinueNode::): 24148 (JSC::BreakNode::): 24149 (JSC::ReturnNode::): 24150 (JSC::WithNode::): 24151 (JSC::LabelNode::): 24152 (JSC::ThrowNode::): 24153 (JSC::TryNode::): 24154 (JSC::ParameterNode::): 24155 (JSC::ScopeNode::): 24156 (JSC::ProgramNode::): 24157 (JSC::EvalNode::): 24158 (JSC::FunctionBodyNode::): 24159 (JSC::FuncExprNode::): 24160 (JSC::FuncDeclNode::): 24161 (JSC::CaseClauseNode::): 24162 (JSC::ClauseListNode::): 24163 (JSC::CaseBlockNode::): 24164 (JSC::SwitchNode::): 24165 241662008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> 24167 24168 Reviewed by Maciej Stachowiak. 24169 24170 Bug 20704: Replace the KJS namespace 24171 <https://bugs.webkit.org/show_bug.cgi?id=20704> 24172 24173 Rename the KJS namespace to JSC. There are still some uses of KJS in 24174 preprocessor macros and comments, but these will also be changed some 24175 time in the near future. 24176 24177 * API/APICast.h: 24178 (toJS): 24179 (toRef): 24180 (toGlobalRef): 24181 * API/JSBase.cpp: 24182 * API/JSCallbackConstructor.cpp: 24183 * API/JSCallbackConstructor.h: 24184 * API/JSCallbackFunction.cpp: 24185 * API/JSCallbackFunction.h: 24186 * API/JSCallbackObject.cpp: 24187 * API/JSCallbackObject.h: 24188 * API/JSCallbackObjectFunctions.h: 24189 * API/JSClassRef.cpp: 24190 (OpaqueJSClass::staticValues): 24191 (OpaqueJSClass::staticFunctions): 24192 * API/JSClassRef.h: 24193 * API/JSContextRef.cpp: 24194 * API/JSObjectRef.cpp: 24195 * API/JSProfilerPrivate.cpp: 24196 * API/JSStringRef.cpp: 24197 * API/JSValueRef.cpp: 24198 (JSValueGetType): 24199 * API/OpaqueJSString.cpp: 24200 * API/OpaqueJSString.h: 24201 * JavaScriptCore.Debug.exp: 24202 * JavaScriptCore.base.exp: 24203 * VM/CTI.cpp: 24204 (JSC::): 24205 * VM/CTI.h: 24206 * VM/CodeBlock.cpp: 24207 * VM/CodeBlock.h: 24208 * VM/CodeGenerator.cpp: 24209 * VM/CodeGenerator.h: 24210 * VM/ExceptionHelpers.cpp: 24211 * VM/ExceptionHelpers.h: 24212 * VM/Instruction.h: 24213 * VM/JSPropertyNameIterator.cpp: 24214 * VM/JSPropertyNameIterator.h: 24215 * VM/LabelID.h: 24216 * VM/Machine.cpp: 24217 * VM/Machine.h: 24218 * VM/Opcode.cpp: 24219 * VM/Opcode.h: 24220 * VM/Register.h: 24221 (WTF::): 24222 * VM/RegisterFile.cpp: 24223 * VM/RegisterFile.h: 24224 * VM/RegisterID.h: 24225 (WTF::): 24226 * VM/SamplingTool.cpp: 24227 * VM/SamplingTool.h: 24228 * VM/SegmentedVector.h: 24229 * kjs/ArgList.cpp: 24230 * kjs/ArgList.h: 24231 * kjs/Arguments.cpp: 24232 * kjs/Arguments.h: 24233 * kjs/ArrayConstructor.cpp: 24234 * kjs/ArrayConstructor.h: 24235 * kjs/ArrayPrototype.cpp: 24236 * kjs/ArrayPrototype.h: 24237 * kjs/BatchedTransitionOptimizer.h: 24238 * kjs/BooleanConstructor.cpp: 24239 * kjs/BooleanConstructor.h: 24240 * kjs/BooleanObject.cpp: 24241 * kjs/BooleanObject.h: 24242 * kjs/BooleanPrototype.cpp: 24243 * kjs/BooleanPrototype.h: 24244 * kjs/CallData.cpp: 24245 * kjs/CallData.h: 24246 * kjs/ClassInfo.h: 24247 * kjs/CommonIdentifiers.cpp: 24248 * kjs/CommonIdentifiers.h: 24249 * kjs/ConstructData.cpp: 24250 * kjs/ConstructData.h: 24251 * kjs/DateConstructor.cpp: 24252 * kjs/DateConstructor.h: 24253 * kjs/DateInstance.cpp: 24254 (JSC::DateInstance::msToGregorianDateTime): 24255 * kjs/DateInstance.h: 24256 * kjs/DateMath.cpp: 24257 * kjs/DateMath.h: 24258 * kjs/DatePrototype.cpp: 24259 * kjs/DatePrototype.h: 24260 * kjs/DebuggerCallFrame.cpp: 24261 * kjs/DebuggerCallFrame.h: 24262 * kjs/Error.cpp: 24263 * kjs/Error.h: 24264 * kjs/ErrorConstructor.cpp: 24265 * kjs/ErrorConstructor.h: 24266 * kjs/ErrorInstance.cpp: 24267 * kjs/ErrorInstance.h: 24268 * kjs/ErrorPrototype.cpp: 24269 * kjs/ErrorPrototype.h: 24270 * kjs/ExecState.cpp: 24271 * kjs/ExecState.h: 24272 * kjs/FunctionConstructor.cpp: 24273 * kjs/FunctionConstructor.h: 24274 * kjs/FunctionPrototype.cpp: 24275 * kjs/FunctionPrototype.h: 24276 * kjs/GetterSetter.cpp: 24277 * kjs/GetterSetter.h: 24278 * kjs/GlobalEvalFunction.cpp: 24279 * kjs/GlobalEvalFunction.h: 24280 * kjs/IndexToNameMap.cpp: 24281 * kjs/IndexToNameMap.h: 24282 * kjs/InitializeThreading.cpp: 24283 * kjs/InitializeThreading.h: 24284 * kjs/InternalFunction.cpp: 24285 * kjs/InternalFunction.h: 24286 (JSC::InternalFunction::InternalFunction): 24287 * kjs/JSActivation.cpp: 24288 * kjs/JSActivation.h: 24289 * kjs/JSArray.cpp: 24290 * kjs/JSArray.h: 24291 * kjs/JSCell.cpp: 24292 * kjs/JSCell.h: 24293 * kjs/JSFunction.cpp: 24294 * kjs/JSFunction.h: 24295 (JSC::JSFunction::JSFunction): 24296 * kjs/JSGlobalData.cpp: 24297 (JSC::JSGlobalData::JSGlobalData): 24298 * kjs/JSGlobalData.h: 24299 * kjs/JSGlobalObject.cpp: 24300 * kjs/JSGlobalObject.h: 24301 * kjs/JSGlobalObjectFunctions.cpp: 24302 * kjs/JSGlobalObjectFunctions.h: 24303 * kjs/JSImmediate.cpp: 24304 * kjs/JSImmediate.h: 24305 * kjs/JSLock.cpp: 24306 * kjs/JSLock.h: 24307 * kjs/JSNotAnObject.cpp: 24308 * kjs/JSNotAnObject.h: 24309 * kjs/JSNumberCell.cpp: 24310 * kjs/JSNumberCell.h: 24311 * kjs/JSObject.cpp: 24312 * kjs/JSObject.h: 24313 * kjs/JSStaticScopeObject.cpp: 24314 * kjs/JSStaticScopeObject.h: 24315 * kjs/JSString.cpp: 24316 * kjs/JSString.h: 24317 * kjs/JSType.h: 24318 * kjs/JSValue.cpp: 24319 * kjs/JSValue.h: 24320 * kjs/JSVariableObject.cpp: 24321 * kjs/JSVariableObject.h: 24322 * kjs/JSWrapperObject.cpp: 24323 * kjs/JSWrapperObject.h: 24324 * kjs/LabelStack.cpp: 24325 * kjs/LabelStack.h: 24326 * kjs/MathObject.cpp: 24327 * kjs/MathObject.h: 24328 * kjs/NativeErrorConstructor.cpp: 24329 * kjs/NativeErrorConstructor.h: 24330 * kjs/NativeErrorPrototype.cpp: 24331 * kjs/NativeErrorPrototype.h: 24332 * kjs/NodeInfo.h: 24333 * kjs/NumberConstructor.cpp: 24334 * kjs/NumberConstructor.h: 24335 * kjs/NumberObject.cpp: 24336 * kjs/NumberObject.h: 24337 * kjs/NumberPrototype.cpp: 24338 * kjs/NumberPrototype.h: 24339 * kjs/ObjectConstructor.cpp: 24340 * kjs/ObjectConstructor.h: 24341 * kjs/ObjectPrototype.cpp: 24342 * kjs/ObjectPrototype.h: 24343 * kjs/Parser.cpp: 24344 * kjs/Parser.h: 24345 * kjs/PropertyMap.cpp: 24346 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): 24347 * kjs/PropertyMap.h: 24348 * kjs/PropertyNameArray.cpp: 24349 * kjs/PropertyNameArray.h: 24350 * kjs/PropertySlot.cpp: 24351 * kjs/PropertySlot.h: 24352 * kjs/PrototypeFunction.cpp: 24353 * kjs/PrototypeFunction.h: 24354 * kjs/PutPropertySlot.h: 24355 * kjs/RegExpConstructor.cpp: 24356 * kjs/RegExpConstructor.h: 24357 * kjs/RegExpObject.cpp: 24358 * kjs/RegExpObject.h: 24359 * kjs/RegExpPrototype.cpp: 24360 * kjs/RegExpPrototype.h: 24361 * kjs/ScopeChain.cpp: 24362 * kjs/ScopeChain.h: 24363 * kjs/ScopeChainMark.h: 24364 * kjs/Shell.cpp: 24365 (jscmain): 24366 * kjs/SmallStrings.cpp: 24367 * kjs/SmallStrings.h: 24368 * kjs/SourceProvider.h: 24369 * kjs/SourceRange.h: 24370 * kjs/StringConstructor.cpp: 24371 * kjs/StringConstructor.h: 24372 * kjs/StringObject.cpp: 24373 * kjs/StringObject.h: 24374 * kjs/StringObjectThatMasqueradesAsUndefined.h: 24375 * kjs/StringPrototype.cpp: 24376 * kjs/StringPrototype.h: 24377 * kjs/StructureID.cpp: 24378 * kjs/StructureID.h: 24379 * kjs/SymbolTable.h: 24380 * kjs/collector.cpp: 24381 * kjs/collector.h: 24382 * kjs/completion.h: 24383 * kjs/create_hash_table: 24384 * kjs/debugger.cpp: 24385 * kjs/debugger.h: 24386 * kjs/dtoa.cpp: 24387 * kjs/dtoa.h: 24388 * kjs/grammar.y: 24389 * kjs/identifier.cpp: 24390 * kjs/identifier.h: 24391 (JSC::Identifier::equal): 24392 * kjs/interpreter.cpp: 24393 * kjs/interpreter.h: 24394 * kjs/lexer.cpp: 24395 (JSC::Lexer::Lexer): 24396 (JSC::Lexer::clear): 24397 (JSC::Lexer::makeIdentifier): 24398 * kjs/lexer.h: 24399 * kjs/lookup.cpp: 24400 * kjs/lookup.h: 24401 * kjs/nodes.cpp: 24402 * kjs/nodes.h: 24403 * kjs/nodes2string.cpp: 24404 * kjs/operations.cpp: 24405 * kjs/operations.h: 24406 * kjs/protect.h: 24407 * kjs/regexp.cpp: 24408 * kjs/regexp.h: 24409 * kjs/ustring.cpp: 24410 * kjs/ustring.h: 24411 (JSC::operator!=): 24412 (JSC::IdentifierRepHash::hash): 24413 (WTF::): 24414 * masm/MacroAssembler.h: 24415 * masm/MacroAssemblerWin.cpp: 24416 * masm/X86Assembler.h: 24417 * pcre/pcre_exec.cpp: 24418 * profiler/CallIdentifier.h: 24419 (WTF::): 24420 * profiler/HeavyProfile.cpp: 24421 * profiler/HeavyProfile.h: 24422 * profiler/Profile.cpp: 24423 * profiler/Profile.h: 24424 * profiler/ProfileGenerator.cpp: 24425 * profiler/ProfileGenerator.h: 24426 * profiler/ProfileNode.cpp: 24427 * profiler/ProfileNode.h: 24428 * profiler/Profiler.cpp: 24429 * profiler/Profiler.h: 24430 * profiler/TreeProfile.cpp: 24431 * profiler/TreeProfile.h: 24432 * wrec/WREC.cpp: 24433 * wrec/WREC.h: 24434 * wtf/AVLTree.h: 24435 244362008-09-07 Maciej Stachowiak <mjs@apple.com> 24437 24438 Reviewed by Dan Bernstein. 24439 24440 - rename IA32MacroAssembler class to X86Assembler 24441 24442 We otherwise call the platform X86, and also, I don't see any macros. 24443 24444 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 24445 * JavaScriptCore.xcodeproj/project.pbxproj: 24446 * masm/IA32MacroAsm.h: Removed. 24447 * masm/MacroAssembler.h: 24448 (KJS::MacroAssembler::MacroAssembler): 24449 * masm/MacroAssemblerWin.cpp: 24450 (KJS::MacroAssembler::emitRestoreArgumentReference): 24451 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h. 24452 (KJS::X86Assembler::X86Assembler): 24453 * wrec/WREC.cpp: 24454 (KJS::WRECGenerator::generateNonGreedyQuantifier): 24455 (KJS::WRECGenerator::generateGreedyQuantifier): 24456 (KJS::WRECGenerator::generateParentheses): 24457 (KJS::WRECGenerator::generateBackreference): 24458 (KJS::WRECGenerator::gernerateDisjunction): 24459 * wrec/WREC.h: 24460 244612008-09-07 Cameron Zwarich <cwzwarich@webkit.org> 24462 24463 Not reviewed. 24464 24465 Visual C++ seems to have some odd casting rules, so just convert the 24466 offending cast back to a C-style cast for now. 24467 24468 * kjs/collector.cpp: 24469 (KJS::otherThreadStackPointer): 24470 244712008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> 24472 24473 Reviewed by Mark Rowe. 24474 24475 Attempt to fix the Windows build by using a const_cast to cast regs.Esp 24476 to a uintptr_t instead of a reinterpret_cast. 24477 24478 * kjs/collector.cpp: 24479 (KJS::otherThreadStackPointer): 24480 244812008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> 24482 24483 Reviewed by Sam Weinig. 24484 24485 Remove C-style casts from kjs/collector.cpp. 24486 24487 * kjs/collector.cpp: 24488 (KJS::Heap::heapAllocate): 24489 (KJS::currentThreadStackBase): 24490 (KJS::Heap::markConservatively): 24491 (KJS::otherThreadStackPointer): 24492 (KJS::Heap::markOtherThreadConservatively): 24493 (KJS::Heap::sweep): 24494 244952008-09-07 Mark Rowe <mrowe@apple.com> 24496 24497 Build fix for the debug variant. 24498 24499 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant. 24500 245012008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> 24502 24503 Reviewed by Timothy Hatcher. 24504 24505 Remove C-style casts from the CTI code. 24506 24507 * VM/CTI.cpp: 24508 (KJS::CTI::emitGetArg): 24509 (KJS::CTI::emitGetPutArg): 24510 (KJS::ctiRepatchCallByReturnAddress): 24511 (KJS::CTI::compileOpCall): 24512 (KJS::CTI::privateCompileMainPass): 24513 (KJS::CTI::privateCompileGetByIdSelf): 24514 (KJS::CTI::privateCompileGetByIdProto): 24515 (KJS::CTI::privateCompileGetByIdChain): 24516 (KJS::CTI::privateCompilePutByIdReplace): 24517 (KJS::CTI::privateArrayLengthTrampoline): 24518 (KJS::CTI::privateStringLengthTrampoline): 24519 24520=== End merge of squirrelfish-extreme === 24521 245222008-09-06 Gavin Barraclough <barraclough@apple.com> 24523 24524 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak. 24525 24526 - refactor WREC to share more of the JIT infrastructure with CTI 24527 24528 * VM/CTI.cpp: 24529 (KJS::CTI::emitGetArg): 24530 (KJS::CTI::emitGetPutArg): 24531 (KJS::CTI::emitPutArg): 24532 (KJS::CTI::emitPutArgConstant): 24533 (KJS::CTI::emitPutCTIParam): 24534 (KJS::CTI::emitGetCTIParam): 24535 (KJS::CTI::emitPutToCallFrameHeader): 24536 (KJS::CTI::emitGetFromCallFrameHeader): 24537 (KJS::CTI::emitPutResult): 24538 (KJS::CTI::emitDebugExceptionCheck): 24539 (KJS::CTI::emitJumpSlowCaseIfNotImm): 24540 (KJS::CTI::emitJumpSlowCaseIfNotImms): 24541 (KJS::CTI::emitFastArithDeTagImmediate): 24542 (KJS::CTI::emitFastArithReTagImmediate): 24543 (KJS::CTI::emitFastArithPotentiallyReTagImmediate): 24544 (KJS::CTI::emitFastArithImmToInt): 24545 (KJS::CTI::emitFastArithIntToImmOrSlowCase): 24546 (KJS::CTI::emitFastArithIntToImmNoCheck): 24547 (KJS::CTI::CTI): 24548 (KJS::CTI::compileOpCall): 24549 (KJS::CTI::privateCompileMainPass): 24550 (KJS::CTI::privateCompileSlowCases): 24551 (KJS::CTI::privateCompile): 24552 (KJS::CTI::privateCompileGetByIdSelf): 24553 (KJS::CTI::privateCompileGetByIdProto): 24554 (KJS::CTI::privateCompileGetByIdChain): 24555 (KJS::CTI::privateCompilePutByIdReplace): 24556 (KJS::CTI::privateArrayLengthTrampoline): 24557 (KJS::CTI::privateStringLengthTrampoline): 24558 (KJS::CTI::compileRegExp): 24559 * VM/CTI.h: 24560 (KJS::CallRecord::CallRecord): 24561 (KJS::JmpTable::JmpTable): 24562 (KJS::SlowCaseEntry::SlowCaseEntry): 24563 (KJS::CTI::JSRInfo::JSRInfo): 24564 * kjs/regexp.cpp: 24565 (KJS::RegExp::RegExp): 24566 * wrec/WREC.cpp: 24567 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor): 24568 (KJS::GeneratePatternCharacterFunctor::generateAtom): 24569 (KJS::GeneratePatternCharacterFunctor::backtrack): 24570 (KJS::GenerateCharacterClassFunctor::generateAtom): 24571 (KJS::GenerateCharacterClassFunctor::backtrack): 24572 (KJS::GenerateBackreferenceFunctor::generateAtom): 24573 (KJS::GenerateBackreferenceFunctor::backtrack): 24574 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom): 24575 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack): 24576 (KJS::WRECGenerate::generateBacktrack1): 24577 (KJS::WRECGenerate::generateBacktrackBackreference): 24578 (KJS::WRECGenerate::generateBackreferenceQuantifier): 24579 (KJS::WRECGenerate::generateNonGreedyQuantifier): 24580 (KJS::WRECGenerate::generateGreedyQuantifier): 24581 (KJS::WRECGenerate::generatePatternCharacter): 24582 (KJS::WRECGenerate::generateCharacterClassInvertedRange): 24583 (KJS::WRECGenerate::generateCharacterClassInverted): 24584 (KJS::WRECGenerate::generateCharacterClass): 24585 (KJS::WRECGenerate::generateParentheses): 24586 (KJS::WRECGenerate::generateParenthesesNonGreedy): 24587 (KJS::WRECGenerate::gererateParenthesesResetTrampoline): 24588 (KJS::WRECGenerate::generateAssertionBOL): 24589 (KJS::WRECGenerate::generateAssertionEOL): 24590 (KJS::WRECGenerate::generateAssertionWordBoundary): 24591 (KJS::WRECGenerate::generateBackreference): 24592 (KJS::WRECGenerate::gernerateDisjunction): 24593 (KJS::WRECGenerate::terminateDisjunction): 24594 (KJS::WRECParser::parseGreedyQuantifier): 24595 (KJS::WRECParser::parseQuantifier): 24596 (KJS::WRECParser::parsePatternCharacterQualifier): 24597 (KJS::WRECParser::parseCharacterClassQuantifier): 24598 (KJS::WRECParser::parseBackreferenceQuantifier): 24599 (KJS::WRECParser::parseParentheses): 24600 (KJS::WRECParser::parseCharacterClass): 24601 (KJS::WRECParser::parseOctalEscape): 24602 (KJS::WRECParser::parseEscape): 24603 (KJS::WRECParser::parseTerm): 24604 (KJS::WRECParser::parseDisjunction): 24605 * wrec/WREC.h: 24606 (KJS::WRECGenerate::WRECGenerate): 24607 (KJS::WRECParser::): 24608 (KJS::WRECParser::WRECParser): 24609 (KJS::WRECParser::parseAlternative): 24610 (KJS::WRECParser::isEndOfPattern): 24611 246122008-09-06 Oliver Hunt <oliver@apple.com> 24613 24614 Reviewed by NOBODY (Build fix). 24615 24616 Fix the sampler build. 24617 24618 * VM/SamplingTool.h: 24619 246202008-09-06 Oliver Hunt <oliver@apple.com> 24621 24622 Reviewed by Maciej Stachowiak. 24623 24624 Jump through the necessary hoops required to make MSVC cooperate with SFX 24625 24626 We now explicitly declare the calling convention on all cti_op_* cfunctions, 24627 and return int instead of bool where appropriate (despite the cdecl calling 24628 convention seems to state MSVC generates code that returns the result value 24629 through ecx). SFX behaves slightly differently under MSVC, specifically it 24630 stores the base argument address for the cti_op_* functions in the first 24631 argument, and then does the required stack manipulation through that pointer. 24632 This is necessary as MSVC's optimisations assume they have complete control 24633 of the stack, and periodically elide our stack manipulations, or move 24634 values in unexpected ways. MSVC also frequently produces tail calls which may 24635 clobber the first argument, so the MSVC path is slightly less efficient due 24636 to the need to restore it. 24637 24638 * JavaScriptCore.xcodeproj/project.pbxproj: 24639 * VM/CTI.cpp: 24640 (KJS::): 24641 (KJS::CTI::compileOpCall): 24642 (KJS::CTI::privateCompileMainPass): 24643 (KJS::CTI::privateCompileSlowCases): 24644 * VM/CTI.h: 24645 * VM/Machine.cpp: 24646 * VM/Machine.h: 24647 * masm/MacroAssembler.h: 24648 (KJS::MacroAssembler::emitConvertToFastCall): 24649 * masm/MacroAssemblerIA32GCC.cpp: Removed. 24650 For performance reasons we need these no-op functions to be inlined. 24651 24652 * masm/MacroAssemblerWin.cpp: 24653 (KJS::MacroAssembler::emitRestoreArgumentReference): 24654 * wtf/Platform.h: 24655 246562008-09-05 Geoffrey Garen <ggaren@apple.com> 24657 24658 Reviewed by Maciej Stachowiak, or maybe the other way around. 24659 24660 Added the ability to coalesce JITCode buffer grow operations by first 24661 growing the buffer and then executing unchecked puts to it. 24662 24663 About a 2% speedup on date-format-tofte. 24664 24665 * VM/CTI.cpp: 24666 (KJS::CTI::compileOpCall): 24667 * masm/IA32MacroAsm.h: 24668 (KJS::JITCodeBuffer::ensureSpace): 24669 (KJS::JITCodeBuffer::putByteUnchecked): 24670 (KJS::JITCodeBuffer::putByte): 24671 (KJS::JITCodeBuffer::putShortUnchecked): 24672 (KJS::JITCodeBuffer::putShort): 24673 (KJS::JITCodeBuffer::putIntUnchecked): 24674 (KJS::JITCodeBuffer::putInt): 24675 (KJS::IA32MacroAssembler::emitTestl_i32r): 24676 (KJS::IA32MacroAssembler::emitMovl_mr): 24677 (KJS::IA32MacroAssembler::emitMovl_rm): 24678 (KJS::IA32MacroAssembler::emitMovl_i32m): 24679 (KJS::IA32MacroAssembler::emitUnlinkedJe): 24680 (KJS::IA32MacroAssembler::emitModRm_rr): 24681 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked): 24682 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked): 24683 (KJS::IA32MacroAssembler::emitModRm_rm): 24684 (KJS::IA32MacroAssembler::emitModRm_opr): 24685 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked): 24686 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked): 24687 246882008-09-05 Mark Rowe <mrowe@apple.com> 24689 24690 Reviewed by Sam Weinig. 24691 24692 Disable WREC and CTI on platforms that we have not yet had a chance to test with. 24693 24694 * wtf/Platform.h: 24695 246962008-09-05 Geoffrey Garen <ggaren@apple.com> 24697 24698 Reviewed by Sam Weinig. 24699 24700 Use jo instead of a mask compare when fetching array.length and 24701 string.length. 4% speedup on array.length / string.length torture 24702 test. 24703 24704 * VM/CTI.cpp: 24705 (KJS::CTI::privateArrayLengthTrampoline): 24706 (KJS::CTI::privateStringLengthTrampoline): 24707 247082008-09-05 Geoffrey Garen <ggaren@apple.com> 24709 24710 Reviewed by Sam Weinig. 24711 24712 Removed a CTI compilation pass by recording labels during bytecode 24713 generation. This is more to reduce complexity than it is to improve 24714 performance. 24715 24716 SunSpider reports no change. 24717 24718 CodeBlock now keeps a "labels" set, which holds the offsets of all the 24719 instructions that can be jumped to. 24720 24721 * VM/CTI.cpp: Nixed a pass. 24722 24723 * VM/CodeBlock.h: Added a "labels" set. 24724 24725 * VM/LabelID.h: No need for a special LableID for holding jump 24726 destinations, since the CodeBlock now knows all jump destinations. 24727 24728 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in 24729 the set. 24730 24731 * kjs/nodes.cpp: 24732 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets. 24733 247342008-09-05 Mark Rowe <mrowe@apple.com> 24735 24736 Reviewed by Oliver Hunt and Gavin Barraclough. 24737 24738 Move the JITCodeBuffer onto Machine and remove the static variables. 24739 24740 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer. 24741 * VM/Machine.cpp: 24742 (KJS::Machine::Machine): Allocate a JITCodeBuffer. 24743 * VM/Machine.h: 24744 * kjs/RegExpConstructor.cpp: 24745 (KJS::constructRegExp): Pass the ExecState through. 24746 * kjs/RegExpPrototype.cpp: 24747 (KJS::regExpProtoFuncCompile): Ditto. 24748 * kjs/StringPrototype.cpp: 24749 (KJS::stringProtoFuncMatch): Ditto. 24750 (KJS::stringProtoFuncSearch): Ditto. 24751 * kjs/nodes.cpp: 24752 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time 24753 so that we have access to an ExecState. 24754 * kjs/nodes.h: 24755 (KJS::RegExpNode::): 24756 * kjs/nodes2string.cpp: 24757 * kjs/regexp.cpp: 24758 (KJS::RegExp::RegExp): Pass the ExecState through. 24759 (KJS::RegExp::create): Ditto. 24760 * kjs/regexp.h: 24761 * masm/IA32MacroAsm.h: 24762 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are 24763 constructed. 24764 * wrec/WREC.cpp: 24765 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine. 24766 * wrec/WREC.h: 24767 247682008-09-05 Mark Rowe <mrowe@apple.com> 24769 24770 Reviewed by Oliver Hunt and Gavin Barraclough. 24771 24772 Fix the build when CTI is disabled. 24773 24774 * VM/CodeBlock.cpp: 24775 (KJS::CodeBlock::~CodeBlock): 24776 * VM/CodeGenerator.cpp: 24777 (KJS::prepareJumpTableForStringSwitch): 24778 * VM/Machine.cpp: 24779 (KJS::Machine::Machine): 24780 (KJS::Machine::~Machine): 24781 247822008-09-05 Gavin Barraclough <barraclough@apple.com> 24783 24784 Reviewed by Mark Rowe. 24785 24786 Fix some windows abi issues. 24787 24788 * VM/CTI.cpp: 24789 (KJS::CTI::privateCompileMainPass): 24790 (KJS::CTI::privateCompileSlowCases): 24791 * VM/CTI.h: 24792 (KJS::CallRecord::CallRecord): 24793 (KJS::): 24794 * VM/Machine.cpp: 24795 (KJS::Machine::cti_op_resolve_func): 24796 (KJS::Machine::cti_op_post_inc): 24797 (KJS::Machine::cti_op_resolve_with_base): 24798 (KJS::Machine::cti_op_post_dec): 24799 * VM/Machine.h: 24800 248012008-09-05 Mark Rowe <mrowe@apple.com> 24802 24803 Reviewed by Sam Weinig. 24804 24805 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93. 24806 24807 * VM/Machine.cpp: 24808 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call. 24809 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto. 24810 248112008-09-04 Mark Rowe <mrowe@apple.com> 24812 24813 Reviewed by Sam Weinig. 24814 24815 Fix fast/dom/Window/console-functions.html. 24816 24817 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions 24818 such as console.log would use the line number of the last JS function on the call stack. 24819 24820 * VM/Machine.cpp: 24821 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call, 24822 and restore it when the function is done. 24823 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto. 24824 248252008-09-05 Oliver Hunt <oliver@apple.com> 24826 24827 Start bringing up SFX on windows. 24828 24829 Reviewed by Mark Rowe and Sam Weinig 24830 24831 Start doing the work to bring up SFX on windows. Initially 24832 just working on WREC, as it does not make any calls so reduces 24833 the amount of code that needs to be corrected. 24834 24835 Start abstracting the CTI JIT codegen engine. 24836 24837 * ChangeLog: 24838 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 24839 * JavaScriptCore.xcodeproj/project.pbxproj: 24840 * VM/CTI.cpp: 24841 * masm/IA32MacroAsm.h: 24842 * masm/MacroAssembler.h: Added. 24843 (KJS::MacroAssembler::MacroAssembler): 24844 * masm/MacroAssemblerIA32GCC.cpp: Added. 24845 (KJS::MacroAssembler::emitConvertToFastCall): 24846 * masm/MacroAssemblerWin.cpp: Added. 24847 (KJS::MacroAssembler::emitConvertToFastCall): 24848 * wrec/WREC.cpp: 24849 (KJS::WRECompiler::parseGreedyQuantifier): 24850 (KJS::WRECompiler::parseCharacterClass): 24851 (KJS::WRECompiler::parseEscape): 24852 (KJS::WRECompiler::compilePattern): 24853 * wrec/WREC.h: 24854 248552008-09-04 Gavin Barraclough <barraclough@apple.com> 24856 24857 Reviewed by Sam Weinig. 24858 24859 Support for slow scripts (timeout checking). 24860 24861 * VM/CTI.cpp: 24862 (KJS::CTI::privateCompileMainPass): 24863 (KJS::CTI::privateCompile): 24864 * VM/Machine.cpp: 24865 (KJS::slideRegisterWindowForCall): 24866 (KJS::Machine::cti_timeout_check): 24867 (KJS::Machine::cti_vm_throw): 24868 248692008-09-04 Sam Weinig <sam@webkit.org> 24870 24871 Reviewed by Mark Rowe. 24872 24873 Third round of style cleanup. 24874 24875 * VM/CTI.cpp: 24876 * VM/CTI.h: 24877 * VM/CodeBlock.h: 24878 * VM/Machine.cpp: 24879 * VM/Machine.h: 24880 * kjs/ExecState.h: 24881 248822008-09-04 Sam Weinig <sam@webkit.org> 24883 24884 Reviewed by Jon Honeycutt. 24885 24886 Second round of style cleanup. 24887 24888 * VM/CTI.cpp: 24889 * VM/CTI.h: 24890 * wrec/WREC.h: 24891 248922008-09-04 Sam Weinig <sam@webkit.org> 24893 24894 Reviewed by Mark Rowe. 24895 24896 First round of style cleanup. 24897 24898 * VM/CTI.cpp: 24899 * VM/CTI.h: 24900 * masm/IA32MacroAsm.h: 24901 * wrec/WREC.cpp: 24902 * wrec/WREC.h: 24903 249042008-09-04 Geoffrey Garen <ggaren@apple.com> 24905 24906 Reviewed by Mark Rowe. 24907 24908 Merged http://trac.webkit.org/changeset/36081 to work with CTI. 24909 24910 * VM/Machine.cpp: 24911 (KJS::Machine::tryCtiCacheGetByID): 24912 249132008-09-04 Gavin Barraclough <barraclough@apple.com> 24914 24915 Reviewed by Sam Weinig. 24916 24917 Enable profiling in CTI. 24918 24919 * VM/CTI.h: 24920 (KJS::): 24921 (KJS::CTI::execute): 24922 * VM/Machine.cpp: 24923 (KJS::Machine::cti_op_call_JSFunction): 24924 (KJS::Machine::cti_op_call_NotJSFunction): 24925 (KJS::Machine::cti_op_ret): 24926 (KJS::Machine::cti_op_construct_JSConstruct): 24927 (KJS::Machine::cti_op_construct_NotJSConstruct): 24928 249292008-09-04 Victor Hernandez <vhernandez@apple.com> 24930 24931 Reviewed by Geoffrey Garen. 24932 24933 Fixed an #if to support using WREC without CTI. 24934 24935 * kjs/regexp.cpp: 24936 (KJS::RegExp::match): 24937 249382008-09-04 Gavin Barraclough <barraclough@apple.com> 24939 24940 Reviewed by Oliver Hunt. 24941 24942 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them. 24943 24944 * VM/CTI.cpp: 24945 (KJS::CTI::privateArrayLengthTrampoline): 24946 (KJS::CTI::privateStringLengthTrampoline): 24947 * VM/Machine.cpp: 24948 (KJS::Machine::~Machine): 24949 * VM/Machine.h: 24950 249512008-09-04 Mark Rowe <mrowe@apple.com> 24952 24953 Reviewed by Gavin Barraclough and Sam Weinig. 24954 24955 Fix a crash on launch of jsc when GuardMalloc is enabled. 24956 24957 * kjs/ScopeChain.h: 24958 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain. 24959 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref. 24960 249612008-09-03 Oliver Hunt <oliver@apple.com> 24962 24963 Reviewed by Gavin Barraclough and Geoff Garen. 24964 24965 Fix inspector and fast array access so that it bounds 24966 checks correctly. 24967 24968 * VM/CTI.cpp: 24969 (KJS::CTI::privateCompile_pass2_Main): 24970 * masm/IA32MacroAsm.h: 24971 (KJS::IA32MacroAssembler::): 24972 (KJS::IA32MacroAssembler::emitUnlinkedJb): 24973 (KJS::IA32MacroAssembler::emitUnlinkedJbe): 24974 249752008-09-03 Mark Rowe <mrowe@apple.com> 24976 24977 Move the assertion after the InitializeAndReturn block, as 24978 that is used even when CTI is enabled. 24979 24980 * VM/Machine.cpp: 24981 (KJS::Machine::privateExecute): 24982 249832008-09-03 Mark Rowe <mrowe@apple.com> 24984 24985 Reviewed by Sam Weinig. 24986 24987 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED. 24988 24989 * VM/CTI.cpp: 24990 (KJS::CTI::privateCompile_pass1_Scan): 24991 (KJS::CTI::privateCompile_pass2_Main): 24992 (KJS::CTI::privateCompile_pass4_SlowCases): 24993 * VM/Machine.cpp: 24994 (KJS::Machine::privateExecute): 24995 (KJS::Machine::cti_vm_throw): 24996 249972008-09-03 Mark Rowe <mrowe@apple.com> 24998 24999 Reviewed by Sam Weinig. 25000 25001 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved 25002 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86) 25003 #if's. 25004 25005 * VM/CTI.cpp: 25006 * VM/CTI.h: 25007 * VM/CodeBlock.cpp: 25008 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for 25009 printing a ptrdiff_t. 25010 * VM/Machine.cpp: 25011 * VM/Machine.h: 25012 * kjs/regexp.cpp: 25013 (KJS::RegExp::RegExp): 25014 (KJS::RegExp::~RegExp): 25015 (KJS::RegExp::match): 25016 * kjs/regexp.h: 25017 * masm/IA32MacroAsm.h: 25018 * wrec/WREC.cpp: 25019 * wrec/WREC.h: 25020 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to 25021 track whether any MASM-using features are enabled. 25022 250232008-09-03 Gavin Barraclough <barraclough@apple.com> 25024 25025 Reviewed by Oliver Hunt. 25026 25027 Copy Geoff's array/string length optimization for CTI. 25028 25029 * VM/CTI.cpp: 25030 (KJS::CTI::privateArrayLengthTrampoline): 25031 (KJS::CTI::privateStringLengthTrampoline): 25032 * VM/CTI.h: 25033 (KJS::CTI::compileArrayLengthTrampoline): 25034 (KJS::CTI::compileStringLengthTrampoline): 25035 * VM/Machine.cpp: 25036 (KJS::Machine::Machine): 25037 (KJS::Machine::getCtiArrayLengthTrampoline): 25038 (KJS::Machine::getCtiStringLengthTrampoline): 25039 (KJS::Machine::tryCtiCacheGetByID): 25040 (KJS::Machine::cti_op_get_by_id_second): 25041 * VM/Machine.h: 25042 * kjs/JSString.h: 25043 * kjs/ustring.h: 25044 250452008-09-03 Gavin Barraclough <barraclough@apple.com> 25046 25047 Reviewed by Oliver Hunt. 25048 25049 Implement fast array accesses in CTI - 2-3% progression on sunspider. 25050 25051 * VM/CTI.cpp: 25052 (KJS::CTI::emitFastArithIntToImmNoCheck): 25053 (KJS::CTI::compileOpCall): 25054 (KJS::CTI::privateCompile_pass2_Main): 25055 (KJS::CTI::privateCompile_pass4_SlowCases): 25056 * VM/CTI.h: 25057 * kjs/JSArray.h: 25058 250592008-09-02 Gavin Barraclough <barraclough@apple.com> 25060 25061 Reviewed by Oliver Hunt. 25062 25063 Enable fast property access support in CTI. 25064 25065 * VM/CTI.cpp: 25066 (KJS::ctiSetReturnAddress): 25067 (KJS::ctiRepatchCallByReturnAddress): 25068 (KJS::CTI::privateCompile_pass2_Main): 25069 (KJS::CTI::privateCompile): 25070 (KJS::CTI::privateCompileGetByIdSelf): 25071 (KJS::CTI::privateCompileGetByIdProto): 25072 (KJS::CTI::privateCompileGetByIdChain): 25073 (KJS::CTI::privateCompilePutByIdReplace): 25074 * VM/CTI.h: 25075 (KJS::CTI::compileGetByIdSelf): 25076 (KJS::CTI::compileGetByIdProto): 25077 (KJS::CTI::compileGetByIdChain): 25078 (KJS::CTI::compilePutByIdReplace): 25079 * VM/CodeBlock.cpp: 25080 (KJS::CodeBlock::~CodeBlock): 25081 * VM/CodeBlock.h: 25082 * VM/Machine.cpp: 25083 (KJS::doSetReturnAddressVmThrowTrampoline): 25084 (KJS::Machine::tryCtiCachePutByID): 25085 (KJS::Machine::tryCtiCacheGetByID): 25086 (KJS::Machine::cti_op_put_by_id): 25087 (KJS::Machine::cti_op_put_by_id_second): 25088 (KJS::Machine::cti_op_put_by_id_generic): 25089 (KJS::Machine::cti_op_put_by_id_fail): 25090 (KJS::Machine::cti_op_get_by_id): 25091 (KJS::Machine::cti_op_get_by_id_second): 25092 (KJS::Machine::cti_op_get_by_id_generic): 25093 (KJS::Machine::cti_op_get_by_id_fail): 25094 (KJS::Machine::cti_op_throw): 25095 (KJS::Machine::cti_vm_throw): 25096 * VM/Machine.h: 25097 * kjs/JSCell.h: 25098 * kjs/JSObject.h: 25099 * kjs/PropertyMap.h: 25100 * kjs/StructureID.cpp: 25101 (KJS::StructureIDChain::StructureIDChain): 25102 * masm/IA32MacroAsm.h: 25103 (KJS::IA32MacroAssembler::emitCmpl_i32m): 25104 (KJS::IA32MacroAssembler::emitMovl_mr): 25105 (KJS::IA32MacroAssembler::emitMovl_rm): 25106 251072008-09-02 Sam Weinig <sam@webkit.org> 25108 25109 Reviewed by Gavin Barraclough and Mark Rowe. 25110 25111 A backslash (\) at the of a RegEx should produce an error. 25112 Fixes fast/regex/test1.html. 25113 25114 * wrec/WREC.cpp: 25115 (KJS::WRECompiler::parseEscape): 25116 251172008-09-02 Sam Weinig <sam@webkit.org> 25118 25119 Reviewed by Geoff Garen. 25120 25121 Link jumps for the slow case of op_loop_if_less. Fixes acid3. 25122 25123 * VM/CTI.cpp: 25124 (KJS::CTI::privateCompile_pass4_SlowCases): 25125 251262008-09-01 Sam Weinig <sam@webkit.org> 25127 25128 Rubber-stamped by Maciej Stachowiak. 25129 25130 Switch WREC on by default. 25131 25132 * wtf/Platform.h: 25133 251342008-09-01 Sam Weinig <sam@webkit.org> 25135 25136 Reviewed by Mark Rowe. 25137 25138 Fix two failures in fast/regex/test1.html 25139 - \- in a character class should be treated as a literal - 25140 - A missing max quantifier needs to be treated differently than 25141 a null max quantifier. 25142 25143 * wrec/WREC.cpp: 25144 (KJS::WRECompiler::generateNonGreedyQuantifier): 25145 (KJS::WRECompiler::generateGreedyQuantifier): 25146 (KJS::WRECompiler::parseCharacterClass): 25147 * wrec/WREC.h: 25148 (KJS::Quantifier::Quantifier): 25149 251502008-09-01 Sam Weinig <sam@webkit.org> 25151 25152 Reviewed by Mark Rowe. 25153 25154 Fix crash in fast/js/kde/evil-n.html 25155 25156 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function. 25157 251582008-09-01 Sam Weinig <sam@webkit.org> 25159 25160 Reviewed by Gavin Barraclough and Mark Rowe. 25161 25162 Add pattern length limit fixing one test in fast/js. 25163 25164 * wrec/WREC.cpp: 25165 (KJS::WRECompiler::compile): 25166 * wrec/WREC.h: 25167 (KJS::WRECompiler::): 25168 251692008-09-01 Sam Weinig <sam@webkit.org> 25170 25171 Reviewed by Gavin Barraclough and Mark Rowe. 25172 25173 Make octal escape parsing/back-reference parsing more closely match 25174 prior behavior fixing one test in fast/js. 25175 25176 * wrec/WREC.cpp: 25177 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped 25178 (KJS::WRECompiler::parseEscape): 25179 * wrec/WREC.h: 25180 (KJS::WRECompiler::peekDigit): 25181 251822008-09-01 Sam Weinig <sam@webkit.org> 25183 25184 Reviewed by Gavin Barraclough and Mark Rowe. 25185 25186 Fix one mozilla test. 25187 25188 * wrec/WREC.cpp: 25189 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not 25190 ascii upper check. 25191 251922008-09-01 Sam Weinig <sam@webkit.org> 25193 25194 Reviewed by Gavin Barraclough and Mark Rowe. 25195 25196 Parse octal escapes in character classes fixing one mozilla test. 25197 25198 * wrec/WREC.cpp: 25199 (KJS::WRECompiler::parseCharacterClass): 25200 (KJS::WRECompiler::parseOctalEscape): 25201 * wrec/WREC.h: 25202 (KJS::WRECompiler::consumeOctal): 25203 252042008-09-01 Sam Weinig <sam@webkit.org> 25205 25206 Reviewed by Oliver Hunt. 25207 25208 Fixes two mozilla tests with WREC enabled. 25209 25210 * wrec/WREC.cpp: 25211 (KJS::CharacterClassConstructor::append): Keep the character class sorted 25212 when appending another character class. 25213 252142008-09-01 Sam Weinig <sam@webkit.org> 25215 25216 Reviewed by Gavin Barraclough and Mark Rowe. 25217 25218 Fixes two mozilla tests with WREC enabled. 25219 25220 * wrec/WREC.cpp: 25221 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position 25222 instead of appending it to the end. 25223 252242008-09-01 Gavin Barraclough <barraclough@apple.com> 25225 25226 Reviewed by Oliver Hunt. 25227 25228 Move cross-compilation unit call into NEVER_INLINE function. 25229 25230 * VM/Machine.cpp: 25231 (KJS::doSetReturnAddressVmThrowTrampoline): 25232 252332008-09-01 Sam Weinig <sam@webkit.org> 25234 25235 Reviewed by Gavin Barraclough and Geoff Garen. 25236 25237 Fix one test in fast/js. 25238 25239 * VM/Machine.cpp: 25240 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError, 25241 instead of a createNotAFunctionError. 25242 252432008-08-31 Gavin Barraclough <barraclough@apple.com> 25244 25245 Reviewed by Maciej Stachowiak. 25246 25247 Zero-cost exception handling. This patch takes the exception checking 25248 back of the hot path. When an exception occurs in a Machine::cti* 25249 method, the return address to JIT code is recorded, and is then 25250 overwritten with a pointer to a trampoline routine. When the method 25251 returns the trampoline will cause the cti_vm_throw method to be invoked. 25252 25253 cti_vm_throw uses the return address preserved above, to discover the 25254 vPC of the bytecode that raised the exception (using a map build during 25255 translation). From the VPC of the faulting bytecode the vPC of a catch 25256 routine may be discovered (unwinding the stack where necesary), and then 25257 a bytecode address for the catch routine is looked up. Final cti_vm_throw 25258 overwrites its return address to JIT code again, to trampoline directly 25259 to the catch routine. 25260 25261 cti_op_throw is handled in a similar fashion. 25262 25263 * VM/CTI.cpp: 25264 (KJS::CTI::emitPutCTIParam): 25265 (KJS::CTI::emitPutToCallFrameHeader): 25266 (KJS::CTI::emitGetFromCallFrameHeader): 25267 (KJS::ctiSetReturnAddressForArgs): 25268 (KJS::CTI::emitDebugExceptionCheck): 25269 (KJS::CTI::printOpcodeOperandTypes): 25270 (KJS::CTI::emitCall): 25271 (KJS::CTI::compileOpCall): 25272 (KJS::CTI::privateCompile_pass2_Main): 25273 (KJS::CTI::privateCompile): 25274 * VM/CTI.h: 25275 (KJS::CallRecord::CallRecord): 25276 (KJS::): 25277 (KJS::CTI::execute): 25278 * VM/CodeBlock.h: 25279 * VM/Machine.cpp: 25280 (KJS::Machine::privateExecute): 25281 (KJS::Machine::cti_op_instanceof): 25282 (KJS::Machine::cti_op_call_NotJSFunction): 25283 (KJS::Machine::cti_op_resolve): 25284 (KJS::Machine::cti_op_resolve_func): 25285 (KJS::Machine::cti_op_resolve_skip): 25286 (KJS::Machine::cti_op_resolve_with_base): 25287 (KJS::Machine::cti_op_throw): 25288 (KJS::Machine::cti_op_in): 25289 (KJS::Machine::cti_vm_throw): 25290 * VM/RegisterFile.h: 25291 (KJS::RegisterFile::): 25292 * kjs/ExecState.h: 25293 (KJS::ExecState::setCtiReturnAddress): 25294 (KJS::ExecState::ctiReturnAddress): 25295 * masm/IA32MacroAsm.h: 25296 (KJS::IA32MacroAssembler::): 25297 (KJS::IA32MacroAssembler::emitPushl_m): 25298 (KJS::IA32MacroAssembler::emitPopl_m): 25299 (KJS::IA32MacroAssembler::getRelocatedAddress): 25300 253012008-08-31 Mark Rowe <mrowe@apple.com> 25302 25303 Reviewed by Oliver Hunt. 25304 25305 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them. 25306 25307 * wrec/WREC.cpp: 25308 (KJS::WRECompiler::parseParentheses): 25309 * wrec/WREC.h: 25310 (KJS::WRECompiler::): 25311 253122008-08-31 Mark Rowe <mrowe@apple.com> 25313 25314 Reviewed by Oliver Hunt. 25315 25316 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled. 25317 25318 * wrec/WREC.cpp: 25319 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum. 25320 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register. 25321 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag. 25322 253232008-08-30 Mark Rowe <mrowe@apple.com> 25324 25325 Reviewed by Oliver Hunt. 25326 25327 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance. 25328 This shows up as a 0.6% progression on SunSpider on my machine. 25329 25330 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out. 25331 25332 * VM/CodeBlock.h: 25333 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc. 25334 * kjs/regexp.cpp: Ditto. 25335 * masm/IA32MacroAsm.h: 25336 (KJS::JITCodeBuffer::growBuffer): 25337 (KJS::JITCodeBuffer::JITCodeBuffer): 25338 (KJS::JITCodeBuffer::~JITCodeBuffer): 25339 (KJS::JITCodeBuffer::putByte): 25340 (KJS::JITCodeBuffer::putShort): 25341 (KJS::JITCodeBuffer::putInt): 25342 (KJS::JITCodeBuffer::reset): 25343 (KJS::JITCodeBuffer::copy): 25344 253452008-08-29 Oliver Hunt <oliver@apple.com> 25346 25347 RS=Maciej 25348 25349 Roll out previous patch as it causes a 5% performance regression 25350 25351 * JavaScriptCore.xcodeproj/project.pbxproj: 25352 * VM/CTI.cpp: 25353 (KJS::getJCB): 25354 (KJS::CTI::privateCompile): 25355 * VM/CodeBlock.h: 25356 (KJS::CodeBlock::~CodeBlock): 25357 * masm/IA32MacroAsm.h: 25358 (KJS::JITCodeBuffer::JITCodeBuffer): 25359 (KJS::JITCodeBuffer::putByte): 25360 (KJS::JITCodeBuffer::putShort): 25361 (KJS::JITCodeBuffer::putInt): 25362 (KJS::JITCodeBuffer::getEIP): 25363 (KJS::JITCodeBuffer::start): 25364 (KJS::JITCodeBuffer::getOffset): 25365 (KJS::JITCodeBuffer::reset): 25366 (KJS::JITCodeBuffer::copy): 25367 (KJS::IA32MacroAssembler::emitModRm_rr): 25368 (KJS::IA32MacroAssembler::emitModRm_rm): 25369 (KJS::IA32MacroAssembler::emitModRm_rmsib): 25370 (KJS::IA32MacroAssembler::IA32MacroAssembler): 25371 (KJS::IA32MacroAssembler::emitInt3): 25372 (KJS::IA32MacroAssembler::emitPushl_r): 25373 (KJS::IA32MacroAssembler::emitPopl_r): 25374 (KJS::IA32MacroAssembler::emitMovl_rr): 25375 (KJS::IA32MacroAssembler::emitAddl_rr): 25376 (KJS::IA32MacroAssembler::emitAddl_i8r): 25377 (KJS::IA32MacroAssembler::emitAddl_i32r): 25378 (KJS::IA32MacroAssembler::emitAddl_mr): 25379 (KJS::IA32MacroAssembler::emitAndl_rr): 25380 (KJS::IA32MacroAssembler::emitAndl_i32r): 25381 (KJS::IA32MacroAssembler::emitCmpl_i8r): 25382 (KJS::IA32MacroAssembler::emitCmpl_rr): 25383 (KJS::IA32MacroAssembler::emitCmpl_rm): 25384 (KJS::IA32MacroAssembler::emitCmpl_i32r): 25385 (KJS::IA32MacroAssembler::emitCmpl_i32m): 25386 (KJS::IA32MacroAssembler::emitCmpw_rm): 25387 (KJS::IA32MacroAssembler::emitOrl_rr): 25388 (KJS::IA32MacroAssembler::emitOrl_i8r): 25389 (KJS::IA32MacroAssembler::emitSubl_rr): 25390 (KJS::IA32MacroAssembler::emitSubl_i8r): 25391 (KJS::IA32MacroAssembler::emitSubl_i32r): 25392 (KJS::IA32MacroAssembler::emitSubl_mr): 25393 (KJS::IA32MacroAssembler::emitTestl_i32r): 25394 (KJS::IA32MacroAssembler::emitTestl_rr): 25395 (KJS::IA32MacroAssembler::emitXorl_i8r): 25396 (KJS::IA32MacroAssembler::emitXorl_rr): 25397 (KJS::IA32MacroAssembler::emitSarl_i8r): 25398 (KJS::IA32MacroAssembler::emitSarl_CLr): 25399 (KJS::IA32MacroAssembler::emitShl_i8r): 25400 (KJS::IA32MacroAssembler::emitShll_CLr): 25401 (KJS::IA32MacroAssembler::emitMull_rr): 25402 (KJS::IA32MacroAssembler::emitIdivl_r): 25403 (KJS::IA32MacroAssembler::emitCdq): 25404 (KJS::IA32MacroAssembler::emitMovl_mr): 25405 (KJS::IA32MacroAssembler::emitMovzwl_mr): 25406 (KJS::IA32MacroAssembler::emitMovl_rm): 25407 (KJS::IA32MacroAssembler::emitMovl_i32r): 25408 (KJS::IA32MacroAssembler::emitMovl_i32m): 25409 (KJS::IA32MacroAssembler::emitLeal_mr): 25410 (KJS::IA32MacroAssembler::emitRet): 25411 (KJS::IA32MacroAssembler::emitJmpN_r): 25412 (KJS::IA32MacroAssembler::emitJmpN_m): 25413 (KJS::IA32MacroAssembler::emitCall): 25414 (KJS::IA32MacroAssembler::label): 25415 (KJS::IA32MacroAssembler::emitUnlinkedJmp): 25416 (KJS::IA32MacroAssembler::emitUnlinkedJne): 25417 (KJS::IA32MacroAssembler::emitUnlinkedJe): 25418 (KJS::IA32MacroAssembler::emitUnlinkedJl): 25419 (KJS::IA32MacroAssembler::emitUnlinkedJle): 25420 (KJS::IA32MacroAssembler::emitUnlinkedJge): 25421 (KJS::IA32MacroAssembler::emitUnlinkedJae): 25422 (KJS::IA32MacroAssembler::emitUnlinkedJo): 25423 (KJS::IA32MacroAssembler::link): 25424 * wrec/WREC.cpp: 25425 (KJS::WRECompiler::compilePattern): 25426 (KJS::WRECompiler::compile): 25427 * wrec/WREC.h: 25428 254292008-08-29 Mark Rowe <mrowe@apple.com> 25430 25431 Reviewed by Oliver Hunt. 25432 25433 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow 25434 as needed when generating code for a large function. This fixes all six remaining failures 25435 in Mozilla tests in both debug and release builds. 25436 25437 * VM/CTI.cpp: 25438 (KJS::CTI::privateCompile): 25439 * VM/CodeBlock.h: 25440 (KJS::CodeBlock::~CodeBlock): 25441 * masm/IA32MacroAsm.h: 25442 (KJS::JITCodeBuffer::putByte): 25443 (KJS::JITCodeBuffer::putShort): 25444 (KJS::JITCodeBuffer::putInt): 25445 (KJS::JITCodeBuffer::getEIP): 25446 (KJS::JITCodeBuffer::start): 25447 (KJS::JITCodeBuffer::getOffset): 25448 (KJS::JITCodeBuffer::getCode): 25449 (KJS::IA32MacroAssembler::emitModRm_rr): 25450 * wrec/WREC.cpp: 25451 (KJS::WRECompiler::compilePattern): 25452 * wrec/WREC.h: 25453 254542008-08-29 Mark Rowe <mrowe@apple.com> 25455 25456 Reviewed by Oliver Hunt. 25457 25458 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests. 25459 25460 * wrec/WREC.cpp: 25461 (KJS::WRECompiler::parseOctalEscape): 25462 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero. 25463 Add a FIXME about treating invalid backreferences as octal escapes in the future. 25464 * wrec/WREC.h: 25465 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than 25466 one digit. 25467 * wtf/ASCIICType.h: 25468 (WTF::isASCIIOctalDigit): 25469 254702008-08-29 Sam Weinig <sam@webkit.org> 25471 25472 Reviewed by Mark Rowe. 25473 25474 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug. 25475 25476 * VM/CTI.cpp: 25477 (KJS::CTI::privateCompile_pass2_Main): 25478 * VM/Machine.cpp: 25479 (KJS::Machine::cti_op_instanceof): 25480 254812008-08-29 Sam Weinig <sam@webkit.org> 25482 25483 Reviewed by Mark Rowe. 25484 25485 Pass vPCs to resolve methods for correct exception creation. Fixes 25486 17 mozilla tests in debug. 25487 25488 * VM/CTI.cpp: 25489 (KJS::CTI::privateCompile_pass2_Main): 25490 * VM/CTI.h: 25491 * VM/Machine.cpp: 25492 (KJS::Machine::cti_op_resolve): 25493 (KJS::Machine::cti_op_resolve_func): 25494 (KJS::Machine::cti_op_resolve_skip): 25495 (KJS::Machine::cti_op_resolve_with_base): 25496 254972008-08-29 Gavin Barraclough <barraclough@apple.com> 25498 25499 Reviewed by Oliver Hunt. 25500 25501 Remembering to actually throw the exception passed to op throw helps. 25502 Regressions 19 -> 6. 25503 25504 * VM/Machine.cpp: 25505 (KJS::Machine::cti_op_throw): 25506 (KJS::Machine::cti_vm_throw): 25507 255082008-08-29 Gavin Barraclough <barraclough@apple.com> 25509 25510 Reviewed by Sam Weinig. 25511 25512 Support for exception unwinding the stack. 25513 25514 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address 25515 is now preserved on entry to a JIT code function (if we preserve lazily we need 25516 restore the native return address during exception stack unwind). This takes 25517 the number of regressions down from ~150 to 19. 25518 25519 * VM/CTI.cpp: 25520 (KJS::getJCB): 25521 (KJS::CTI::emitExceptionCheck): 25522 (KJS::CTI::compileOpCall): 25523 (KJS::CTI::privateCompile_pass2_Main): 25524 (KJS::CTI::privateCompile): 25525 * VM/CTI.h: 25526 (KJS::): 25527 * VM/Machine.cpp: 25528 (KJS::Machine::throwException): 25529 (KJS::Machine::cti_op_call_JSFunction): 25530 (KJS::Machine::cti_op_call_NotJSFunction): 25531 (KJS::Machine::cti_op_construct_JSConstruct): 25532 (KJS::Machine::cti_op_construct_NotJSConstruct): 25533 (KJS::Machine::cti_op_throw): 25534 (KJS::Machine::cti_vm_throw): 25535 255362008-08-29 Mark Rowe <mrowe@apple.com> 25537 25538 Reviewed by Oliver Hunt. 25539 25540 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled. 25541 25542 * wrec/WREC.cpp: 25543 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches 25544 succeeded, jump to failure. 25545 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored 25546 on the stack to ensure that it will be reset to the correct position after a failed 25547 match has consumed input. 25548 255492008-08-29 Mark Rowe <mrowe@apple.com> 25550 25551 Reviewed by Oliver Hunt. 25552 25553 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled. 25554 A backreference with a quantifier would get stuck in an infinite 25555 loop if the captured range was empty. 25556 25557 * wrec/WREC.cpp: 25558 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range 25559 was empty, do not attempt to match the backreference. 25560 (KJS::WRECompiler::parseBackreferenceQuantifier): 25561 * wrec/WREC.h: 25562 (KJS::Quantifier::): 25563 255642008-08-28 Sam Weinig <sam@webkit.org> 25565 25566 Reviewed by Oliver Hunt. 25567 25568 Implement op_debug. 25569 25570 * VM/CTI.cpp: 25571 (KJS::CTI::privateCompile_pass1_Scan): 25572 (KJS::CTI::privateCompile_pass2_Main): 25573 * VM/Machine.cpp: 25574 (KJS::Machine::debug): 25575 (KJS::Machine::privateExecute): 25576 (KJS::Machine::cti_op_debug): 25577 * VM/Machine.h: 25578 255792008-08-28 Sam Weinig <sam@webkit.org> 25580 25581 Reviewed by Gavin Barraclough and Geoff Garen. 25582 25583 Implement op_switch_string fixing 1 mozilla test and one test in fast/js. 25584 25585 * VM/CTI.cpp: 25586 (KJS::CTI::privateCompile_pass1_Scan): 25587 (KJS::CTI::privateCompile_pass2_Main): 25588 (KJS::CTI::privateCompile): 25589 * VM/CTI.h: 25590 (KJS::SwitchRecord::): 25591 (KJS::SwitchRecord::SwitchRecord): 25592 * VM/CodeBlock.cpp: 25593 (KJS::CodeBlock::dump): 25594 * VM/CodeBlock.h: 25595 (KJS::ExpressionRangeInfo::): 25596 (KJS::StringJumpTable::offsetForValue): 25597 (KJS::StringJumpTable::ctiForValue): 25598 (KJS::SimpleJumpTable::add): 25599 (KJS::SimpleJumpTable::ctiForValue): 25600 * VM/CodeGenerator.cpp: 25601 (KJS::prepareJumpTableForStringSwitch): 25602 * VM/Machine.cpp: 25603 (KJS::Machine::privateExecute): 25604 (KJS::Machine::cti_op_switch_string): 25605 * VM/Machine.h: 25606 256072008-08-28 Gavin Barraclough <barraclough@apple.com> 25608 25609 Reviewed by Oliver Hunt. 25610 25611 Do not recurse on the machine stack when executing op_call. 25612 25613 * VM/CTI.cpp: 25614 (KJS::CTI::emitGetPutArg): 25615 (KJS::CTI::emitPutArg): 25616 (KJS::CTI::emitPutArgConstant): 25617 (KJS::CTI::compileOpCall): 25618 (KJS::CTI::privateCompile_pass2_Main): 25619 (KJS::CTI::privateCompile): 25620 * VM/CTI.h: 25621 (KJS::): 25622 (KJS::CTI::compile): 25623 (KJS::CTI::execute): 25624 (KJS::CTI::): 25625 * VM/Machine.cpp: 25626 (KJS::Machine::Machine): 25627 (KJS::Machine::execute): 25628 (KJS::Machine::cti_op_call_JSFunction): 25629 (KJS::Machine::cti_op_call_NotJSFunction): 25630 (KJS::Machine::cti_op_ret): 25631 (KJS::Machine::cti_op_construct_JSConstruct): 25632 (KJS::Machine::cti_op_construct_NotJSConstruct): 25633 (KJS::Machine::cti_op_call_eval): 25634 * VM/Machine.h: 25635 * VM/Register.h: 25636 (KJS::Register::Register): 25637 * VM/RegisterFile.h: 25638 (KJS::RegisterFile::): 25639 * kjs/InternalFunction.h: 25640 (KJS::InternalFunction::InternalFunction): 25641 * kjs/JSFunction.h: 25642 (KJS::JSFunction::JSFunction): 25643 * kjs/ScopeChain.h: 25644 (KJS::ScopeChain::ScopeChain): 25645 * masm/IA32MacroAsm.h: 25646 (KJS::IA32MacroAssembler::): 25647 (KJS::IA32MacroAssembler::emitModRm_opm): 25648 (KJS::IA32MacroAssembler::emitCmpl_i32m): 25649 (KJS::IA32MacroAssembler::emitCallN_r): 25650 256512008-08-28 Sam Weinig <sam@webkit.org> 25652 25653 Reviewed by Mark Rowe. 25654 25655 Exit instead of crashing in ctiUnsupported and ctiTimedOut. 25656 25657 * VM/Machine.cpp: 25658 (KJS::ctiUnsupported): 25659 (KJS::ctiTimedOut): 25660 256612008-08-28 Oliver Hunt <oliver@apple.com> 25662 25663 Reviewed by Maciej Stachowiak. 25664 25665 Implement codegen for op_jsr and op_sret. 25666 25667 * VM/CTI.cpp: 25668 (KJS::CTI::privateCompile_pass1_Scan): 25669 (KJS::CTI::privateCompile_pass2_Main): 25670 (KJS::CTI::privateCompile): 25671 * VM/CTI.h: 25672 (KJS::CTI::JSRInfo::JSRInfo): 25673 * masm/IA32MacroAsm.h: 25674 (KJS::IA32MacroAssembler::emitJmpN_m): 25675 (KJS::IA32MacroAssembler::linkAbsoluteAddress): 25676 256772008-08-28 Gavin Barraclough <barraclough@apple.com> 25678 25679 Reviewed by Oliver Hunt. 25680 25681 Initial support for exceptions (throw / catch must occur in same CodeBlock). 25682 25683 * VM/CTI.cpp: 25684 (KJS::CTI::emitExceptionCheck): 25685 (KJS::CTI::emitCall): 25686 (KJS::CTI::privateCompile_pass2_Main): 25687 (KJS::CTI::privateCompile_pass4_SlowCases): 25688 (KJS::CTI::privateCompile): 25689 * VM/CTI.h: 25690 * VM/CodeBlock.cpp: 25691 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC): 25692 * VM/CodeBlock.h: 25693 * VM/CodeGenerator.cpp: 25694 (KJS::CodeGenerator::emitCatch): 25695 * VM/Machine.cpp: 25696 (KJS::Machine::throwException): 25697 (KJS::Machine::privateExecute): 25698 (KJS::ctiUnsupported): 25699 (KJS::ctiTimedOut): 25700 (KJS::Machine::cti_op_add): 25701 (KJS::Machine::cti_op_pre_inc): 25702 (KJS::Machine::cti_timeout_check): 25703 (KJS::Machine::cti_op_loop_if_less): 25704 (KJS::Machine::cti_op_put_by_id): 25705 (KJS::Machine::cti_op_get_by_id): 25706 (KJS::Machine::cti_op_instanceof): 25707 (KJS::Machine::cti_op_del_by_id): 25708 (KJS::Machine::cti_op_mul): 25709 (KJS::Machine::cti_op_call): 25710 (KJS::Machine::cti_op_resolve): 25711 (KJS::Machine::cti_op_construct): 25712 (KJS::Machine::cti_op_get_by_val): 25713 (KJS::Machine::cti_op_resolve_func): 25714 (KJS::Machine::cti_op_sub): 25715 (KJS::Machine::cti_op_put_by_val): 25716 (KJS::Machine::cti_op_lesseq): 25717 (KJS::Machine::cti_op_loop_if_true): 25718 (KJS::Machine::cti_op_negate): 25719 (KJS::Machine::cti_op_resolve_skip): 25720 (KJS::Machine::cti_op_div): 25721 (KJS::Machine::cti_op_pre_dec): 25722 (KJS::Machine::cti_op_jless): 25723 (KJS::Machine::cti_op_not): 25724 (KJS::Machine::cti_op_jtrue): 25725 (KJS::Machine::cti_op_post_inc): 25726 (KJS::Machine::cti_op_eq): 25727 (KJS::Machine::cti_op_lshift): 25728 (KJS::Machine::cti_op_bitand): 25729 (KJS::Machine::cti_op_rshift): 25730 (KJS::Machine::cti_op_bitnot): 25731 (KJS::Machine::cti_op_resolve_with_base): 25732 (KJS::Machine::cti_op_mod): 25733 (KJS::Machine::cti_op_less): 25734 (KJS::Machine::cti_op_neq): 25735 (KJS::Machine::cti_op_post_dec): 25736 (KJS::Machine::cti_op_urshift): 25737 (KJS::Machine::cti_op_bitxor): 25738 (KJS::Machine::cti_op_bitor): 25739 (KJS::Machine::cti_op_call_eval): 25740 (KJS::Machine::cti_op_throw): 25741 (KJS::Machine::cti_op_push_scope): 25742 (KJS::Machine::cti_op_stricteq): 25743 (KJS::Machine::cti_op_nstricteq): 25744 (KJS::Machine::cti_op_to_jsnumber): 25745 (KJS::Machine::cti_op_in): 25746 (KJS::Machine::cti_op_del_by_val): 25747 (KJS::Machine::cti_vm_throw): 25748 * VM/Machine.h: 25749 * kjs/ExecState.h: 25750 * masm/IA32MacroAsm.h: 25751 (KJS::IA32MacroAssembler::emitCmpl_i32m): 25752 257532008-08-28 Mark Rowe <mrowe@apple.com> 25754 25755 Rubber-stamped by Oliver Hunt. 25756 25757 Print debugging info to stderr so that run-webkit-tests can capture it. 25758 This makes it easy to check whether test failures are due to unimplemented 25759 op codes, missing support for exceptions, etc. 25760 25761 * VM/CTI.cpp: 25762 (KJS::CTI::privateCompile_pass1_Scan): 25763 (KJS::CTI::printOpcodeOperandTypes): 25764 (KJS::CTI::privateCompile_pass2_Main): 25765 (KJS::CTI::privateCompile_pass4_SlowCases): 25766 (KJS::CTI::privateCompile): 25767 * VM/Machine.cpp: 25768 (KJS::Machine::privateExecute): 25769 (KJS::ctiException): 25770 (KJS::ctiUnsupported): 25771 (KJS::Machine::cti_op_call): 25772 (KJS::Machine::cti_op_resolve): 25773 (KJS::Machine::cti_op_construct): 25774 (KJS::Machine::cti_op_get_by_val): 25775 (KJS::Machine::cti_op_resolve_func): 25776 (KJS::Machine::cti_op_resolve_skip): 25777 (KJS::Machine::cti_op_resolve_with_base): 25778 (KJS::Machine::cti_op_call_eval): 25779 257802008-08-27 Mark Rowe <mrowe@apple.com> 25781 25782 Reviewed by Gavin Barraclough and Maciej Stachowiak. 25783 25784 Fix fast/js/bitwise-and-on-undefined.html. 25785 25786 A temporary value in the slow path of op_bitand was being stored in edx, but was 25787 being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg 25788 now takes a third argument that specifies the scratch register to use when loading 25789 from memory. This allows us to avoid clobbering the temporary in op_bitand. 25790 25791 * VM/CTI.cpp: 25792 (KJS::CTI::emitGetPutArg): 25793 (KJS::CTI::privateCompile_pass2_Main): 25794 (KJS::CTI::privateCompile_pass4_SlowCases): 25795 * VM/CTI.h: 25796 257972008-08-27 Mark Rowe <mrowe@apple.com> 25798 25799 Rubber-stamped by Oliver Hunt. 25800 25801 Switch CTI on by default. 25802 25803 * wtf/Platform.h: 25804 258052008-08-27 Mark Rowe <mrowe@apple.com> 25806 25807 Reviewed by Oliver Hunt. 25808 25809 Fix the build of the full WebKit stack. 25810 25811 * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore. 25812 * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore. 25813 * wrec/WREC.h: Ditto. 25814 258152008-08-27 Mark Rowe <mrowe@apple.com> 25816 25817 Reviewed by Sam Weinig. 25818 25819 Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw. 25820 25821 * VM/CTI.cpp: 25822 (KJS::CTI::privateCompile_pass1_Scan): 25823 (KJS::CTI::privateCompile_pass2_Main): 25824 * VM/Machine.cpp: 25825 (KJS::Machine::cti_op_new_error): 25826 * VM/Machine.h: 25827 258282008-08-27 Sam Weinig <sam@webkit.org> 25829 25830 Reviewed by Gavin Barraclough and Geoff Garen. 25831 25832 Implement op_put_getter and op_put_setter. 25833 25834 * VM/CTI.cpp: 25835 (KJS::CTI::privateCompile_pass1_Scan): 25836 (KJS::CTI::privateCompile_pass2_Main): 25837 * VM/Machine.cpp: 25838 (KJS::Machine::cti_op_put_getter): 25839 (KJS::Machine::cti_op_put_setter): 25840 * VM/Machine.h: 25841 258422008-08-27 Sam Weinig <sam@webkit.org> 25843 25844 Reviewed by Gavin Barraclough and Geoff Garen. 25845 25846 Implement op_del_by_val fixing 3 mozilla tests. 25847 25848 * VM/CTI.cpp: 25849 (KJS::CTI::privateCompile_pass1_Scan): 25850 (KJS::CTI::privateCompile_pass2_Main): 25851 * VM/Machine.cpp: 25852 (KJS::Machine::cti_op_del_by_val): 25853 * VM/Machine.h: 25854 258552008-08-27 Gavin Barraclough <barraclough@apple.com> 25856 25857 Reviewed by Oliver Hunt. 25858 25859 Quick & dirty fix to get SamplingTool sampling op_call. 25860 25861 * VM/SamplingTool.h: 25862 (KJS::SamplingTool::callingHostFunction): 25863 258642008-08-27 Sam Weinig <sam@webkit.org> 25865 25866 Reviewed by Gavin Barraclough and Geoff Garen. 25867 25868 Fix op_put_by_index. 25869 25870 * VM/CTI.cpp: 25871 (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg 25872 for the property value. 25873 * VM/Machine.cpp: 25874 (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument. 25875 258762008-08-27 Sam Weinig <sam@webkit.org> 25877 25878 Reviewed by Gavin Barraclough and Geoff Garen. 25879 25880 Implement op_switch_imm in the CTI fixing 13 mozilla tests. 25881 25882 * VM/CTI.cpp: 25883 (KJS::CTI::privateCompile_pass1_Scan): 25884 (KJS::CTI::privateCompile_pass2_Main): 25885 * VM/Machine.cpp: 25886 (KJS::Machine::cti_op_switch_imm): 25887 * VM/Machine.h: 25888 258892008-08-27 Gavin Barraclough <barraclough@apple.com> 25890 25891 Reviewed by Oliver Hunt. 25892 25893 Implement op_switch_char in CTI. 25894 25895 * VM/CTI.cpp: 25896 (KJS::CTI::emitCall): 25897 (KJS::CTI::privateCompile_pass1_Scan): 25898 (KJS::CTI::privateCompile_pass2_Main): 25899 (KJS::CTI::privateCompile): 25900 * VM/CTI.h: 25901 (KJS::CallRecord::CallRecord): 25902 (KJS::SwitchRecord::SwitchRecord): 25903 * VM/CodeBlock.h: 25904 (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue): 25905 * VM/Machine.cpp: 25906 (KJS::Machine::cti_op_switch_char): 25907 * VM/Machine.h: 25908 * masm/IA32MacroAsm.h: 25909 (KJS::IA32MacroAssembler::): 25910 (KJS::IA32MacroAssembler::emitJmpN_r): 25911 (KJS::IA32MacroAssembler::getRelocatedAddress): 25912 * wtf/Platform.h: 25913 259142008-08-26 Sam Weinig <sam@webkit.org> 25915 25916 Reviewed by Mark Rowe. 25917 25918 Implement op_put_by_index to fix 1 mozilla test. 25919 25920 * VM/CTI.cpp: 25921 (KJS::CTI::privateCompile_pass1_Scan): 25922 (KJS::CTI::privateCompile_pass2_Main): 25923 * VM/Machine.cpp: 25924 (KJS::Machine::cti_op_put_by_index): 25925 * VM/Machine.h: 25926 259272008-08-26 Gavin Barraclough <barraclough@apple.com> 25928 25929 Reviewed by Geoff Garen. 25930 25931 More fixes from Geoff's review. 25932 25933 * VM/CTI.cpp: 25934 (KJS::CTI::emitGetArg): 25935 (KJS::CTI::emitGetPutArg): 25936 (KJS::CTI::emitPutArg): 25937 (KJS::CTI::emitPutArgConstant): 25938 (KJS::CTI::getConstantImmediateNumericArg): 25939 (KJS::CTI::emitGetCTIParam): 25940 (KJS::CTI::emitPutResult): 25941 (KJS::CTI::emitCall): 25942 (KJS::CTI::emitJumpSlowCaseIfNotImm): 25943 (KJS::CTI::emitJumpSlowCaseIfNotImms): 25944 (KJS::CTI::getDeTaggedConstantImmediate): 25945 (KJS::CTI::emitFastArithDeTagImmediate): 25946 (KJS::CTI::emitFastArithReTagImmediate): 25947 (KJS::CTI::emitFastArithPotentiallyReTagImmediate): 25948 (KJS::CTI::emitFastArithImmToInt): 25949 (KJS::CTI::emitFastArithIntToImmOrSlowCase): 25950 (KJS::CTI::privateCompile_pass2_Main): 25951 (KJS::CTI::privateCompile_pass4_SlowCases): 25952 (KJS::CTI::privateCompile): 25953 * VM/CTI.h: 25954 259552008-08-26 Mark Rowe <mrowe@apple.com> 25956 25957 Reviewed by Gavin Barraclough and Geoff Garen. 25958 25959 Implement op_jmp_scopes to fix 2 Mozilla tests. 25960 25961 * VM/CTI.cpp: 25962 (KJS::CTI::privateCompile_pass1_Scan): 25963 (KJS::CTI::privateCompile_pass2_Main): 25964 * VM/Machine.cpp: 25965 (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain. 25966 (KJS::Machine::cti_op_jmp_scopes): 25967 * VM/Machine.h: 25968 259692008-08-26 Gavin Barraclough <barraclough@apple.com> 25970 25971 Reviewed by Oliver Hunt. 25972 25973 WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h). 25974 25975 * JavaScriptCore.xcodeproj/project.pbxproj: 25976 * kjs/regexp.cpp: 25977 * kjs/regexp.h: 25978 * wrec: Added. 25979 * wrec/WREC.cpp: Added. 25980 * wrec/WREC.h: Added. 25981 * wtf/Platform.h: 25982 259832008-08-26 Sam Weinig <sam@webkit.org> 25984 25985 Rubber-stamped by Oliver Hunt. 25986 25987 Remove bogus assertion. 25988 25989 * VM/Machine.cpp: 25990 (KJS::Machine::cti_op_del_by_id): 25991 259922008-08-26 Mark Rowe <mrowe@apple.com> 25993 25994 Reviewed by Sam Weinig. 25995 25996 Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests. 25997 25998 * VM/CTI.cpp: 25999 (KJS::CTI::privateCompile_pass1_Scan): 26000 (KJS::CTI::privateCompile_pass2_Main): 26001 * VM/Machine.cpp: 26002 (KJS::Machine::cti_op_push_new_scope): 26003 (KJS::Machine::cti_op_catch): 26004 * VM/Machine.h: 26005 260062008-08-26 Mark Rowe <mrowe@apple.com> 26007 26008 Reviewed by Sam Weinig. 26009 26010 Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter. 26011 26012 * VM/Machine.cpp: 26013 (KJS::inlineResolveBase): 26014 (KJS::resolveBase): 26015 260162008-08-26 Oliver Hunt <oliver@apple.com> 26017 26018 Reviewed by Sam Weinig. 26019 26020 Add codegen support for op_instanceof, fixing 15 mozilla tests. 26021 26022 * VM/CTI.cpp: 26023 (KJS::CTI::privateCompile_pass1_Scan): 26024 (KJS::CTI::privateCompile_pass2_Main): 26025 * VM/Machine.cpp: 26026 (KJS::Machine::cti_op_instanceof): 26027 (KJS::Machine::cti_op_del_by_id): 26028 * VM/Machine.h: 26029 * wtf/Platform.h: 26030 260312008-08-26 Gavin Barraclough <barraclough@apple.com> 26032 26033 Reviewed by Geoff Garen. 26034 26035 Fixes for initial review comments. 26036 26037 * VM/CTI.cpp: 26038 (KJS::CTI::ctiCompileGetArg): 26039 (KJS::CTI::ctiCompileGetPutArg): 26040 (KJS::CTI::ctiCompilePutResult): 26041 (KJS::CTI::ctiCompileCall): 26042 (KJS::CTI::CTI): 26043 (KJS::CTI::privateCompile_pass1_Scan): 26044 (KJS::CTI::printOpcodeOperandTypes): 26045 (KJS::CTI::privateCompile_pass2_Main): 26046 (KJS::CTI::privateCompile_pass4_SlowCases): 26047 (KJS::CTI::privateCompile): 26048 * VM/CTI.h: 26049 * VM/Register.h: 26050 * kjs/JSValue.h: 26051 260522008-08-26 Sam Weinig <sam@webkit.org> 26053 26054 Reviewed by Gavin Barraclough and Geoff Garen. 26055 26056 Fix up exception checking code. 26057 26058 * VM/Machine.cpp: 26059 (KJS::Machine::cti_op_call): 26060 (KJS::Machine::cti_op_resolve): 26061 (KJS::Machine::cti_op_construct): 26062 (KJS::Machine::cti_op_resolve_func): 26063 (KJS::Machine::cti_op_resolve_skip): 26064 (KJS::Machine::cti_op_resolve_with_base): 26065 (KJS::Machine::cti_op_call_eval): 26066 260672008-08-26 Sam Weinig <sam@webkit.org> 26068 26069 Reviewed by Oliver Hunt. 26070 26071 Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests. 26072 26073 * VM/CTI.cpp: 26074 (KJS::CTI::privateCompile_pass4_SlowCases): 26075 260762008-08-26 Mark Rowe <mrowe@apple.com> 26077 26078 Reviewed by Sam Weinig. 26079 26080 Implement op_in, fixing 8 mozilla tests. 26081 26082 * VM/CTI.cpp: 26083 (KJS::CTI::privateCompile_pass1_Scan): 26084 (KJS::CTI::privateCompile_pass2_Main): 26085 * VM/Machine.cpp: 26086 (KJS::Machine::cti_op_in): 26087 * VM/Machine.h: 26088 260892008-08-26 Mark Rowe <mrowe@apple.com> 26090 26091 Rubber-stamped by Oliver Hunt. 26092 26093 Don't hardcode the size of a Register for op_new_array. Fixes a crash 26094 seen during the Mozilla tests. 26095 26096 * VM/CTI.cpp: 26097 (KJS::CTI::privateCompile_pass2_Main): 26098 260992008-08-26 Sam Weinig <sam@webkit.org> 26100 26101 Reviewed by Gavin Barraclough and Geoff Garen. 26102 26103 Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests. 26104 26105 * VM/CTI.cpp: 26106 (KJS::CTI::privateCompile_pass1_Scan): 26107 (KJS::CTI::privateCompile_pass2_Main): 26108 * VM/CTI.h: 26109 * VM/Machine.cpp: 26110 (KJS::Machine::cti_op_push_scope): 26111 (KJS::Machine::cti_op_pop_scope): 26112 * VM/Machine.h: 26113 261142008-08-26 Oliver Hunt <oliver@apple.com> 26115 26116 Reviewed by Maciej Stachowiak. 26117 26118 Add codegen support for op_del_by_id, fixing 49 mozilla tests. 26119 26120 * VM/CTI.cpp: 26121 (KJS::CTI::privateCompile_pass1_Scan): 26122 (KJS::CTI::privateCompile_pass2_Main): 26123 * VM/Machine.cpp: 26124 (KJS::Machine::cti_op_del_by_id): 26125 * VM/Machine.h: 26126 261272008-08-26 Sam Weinig <sam@webkit.org> 26128 26129 Reviewed by Gavin Barraclough and Geoff Garen. 26130 26131 Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var 26132 fixing 513 mozilla tests in debug build. 26133 26134 * VM/CTI.cpp: 26135 (KJS::CTI::privateCompile_pass2_Main): 26136 261372008-08-26 Oliver Hunt <oliver@apple.com> 26138 26139 Reviewed by Maciej Stachowiak. 26140 26141 Added code generator support for op_loop, fixing around 60 mozilla tests. 26142 26143 * VM/CTI.cpp: 26144 (KJS::CTI::privateCompile_pass1_Scan): 26145 (KJS::CTI::privateCompile_pass2_Main): 26146 261472008-08-26 Mark Rowe <mrowe@apple.com> 26148 26149 Reviewed by Sam Weinig. 26150 26151 Set -fomit-frame-pointer in the correct location. 26152 26153 * Configurations/JavaScriptCore.xcconfig: 26154 * JavaScriptCore.xcodeproj/project.pbxproj: 26155 261562008-08-26 Gavin Barraclough <barraclough@apple.com> 26157 26158 Reviewed by Geoff Garen. 26159 26160 Inital cut of CTI, Geoff's review fixes to follow. 26161 26162 * JavaScriptCore.xcodeproj/project.pbxproj: 26163 * VM/CTI.cpp: Added. 26164 (KJS::getJCB): 26165 (KJS::CTI::ctiCompileGetArg): 26166 (KJS::CTI::ctiCompileGetPutArg): 26167 (KJS::CTI::ctiCompilePutArg): 26168 (KJS::CTI::ctiCompilePutArgImm): 26169 (KJS::CTI::ctiImmediateNumericArg): 26170 (KJS::CTI::ctiCompileGetCTIParam): 26171 (KJS::CTI::ctiCompilePutResult): 26172 (KJS::CTI::ctiCompileCall): 26173 (KJS::CTI::slowCaseIfNotImm): 26174 (KJS::CTI::slowCaseIfNotImms): 26175 (KJS::CTI::ctiFastArithDeTagConstImmediate): 26176 (KJS::CTI::ctiFastArithDeTagImmediate): 26177 (KJS::CTI::ctiFastArithReTagImmediate): 26178 (KJS::CTI::ctiFastArithPotentiallyReTagImmediate): 26179 (KJS::CTI::ctiFastArithImmToInt): 26180 (KJS::CTI::ctiFastArithIntToImmOrSlowCase): 26181 (KJS::CTI::CTI): 26182 (KJS::CTI::privateCompile_pass1_Scan): 26183 (KJS::CTI::ctiCompileAdd): 26184 (KJS::CTI::ctiCompileAddImm): 26185 (KJS::CTI::ctiCompileAddImmNotInt): 26186 (KJS::CTI::TEMP_HACK_PRINT_TYPES): 26187 (KJS::CTI::privateCompile_pass2_Main): 26188 (KJS::CTI::privateCompile_pass3_Link): 26189 (KJS::CTI::privateCompile_pass4_SlowCases): 26190 (KJS::CTI::privateCompile): 26191 * VM/CTI.h: Added. 26192 (KJS::CTI2Result::CTI2Result): 26193 (KJS::CallRecord::CallRecord): 26194 (KJS::JmpTable::JmpTable): 26195 (KJS::SlowCaseEntry::SlowCaseEntry): 26196 (KJS::CTI::compile): 26197 (KJS::CTI::LabelInfo::LabelInfo): 26198 * VM/CodeBlock.h: 26199 (KJS::CodeBlock::CodeBlock): 26200 (KJS::CodeBlock::~CodeBlock): 26201 * VM/Machine.cpp: 26202 (KJS::Machine::execute): 26203 (KJS::Machine::privateExecute): 26204 (KJS::ctiException): 26205 (KJS::ctiUnsupported): 26206 (KJS::ctiTimedOut): 26207 (KJS::Machine::cti_op_end): 26208 (KJS::Machine::cti_op_add): 26209 (KJS::Machine::cti_op_pre_inc): 26210 (KJS::Machine::cti_timeout_check): 26211 (KJS::Machine::cti_op_loop_if_less): 26212 (KJS::Machine::cti_op_new_object): 26213 (KJS::Machine::cti_op_put_by_id): 26214 (KJS::Machine::cti_op_get_by_id): 26215 (KJS::Machine::cti_op_mul): 26216 (KJS::Machine::cti_op_new_func): 26217 (KJS::Machine::cti_op_call): 26218 (KJS::Machine::cti_op_ret): 26219 (KJS::Machine::cti_op_new_array): 26220 (KJS::Machine::cti_op_resolve): 26221 (KJS::Machine::cti_op_construct): 26222 (KJS::Machine::cti_op_get_by_val): 26223 (KJS::Machine::cti_op_resolve_func): 26224 (KJS::Machine::cti_op_sub): 26225 (KJS::Machine::cti_op_put_by_val): 26226 (KJS::Machine::cti_op_lesseq): 26227 (KJS::Machine::cti_op_loop_if_true): 26228 (KJS::Machine::cti_op_negate): 26229 (KJS::Machine::cti_op_resolve_base): 26230 (KJS::Machine::cti_op_resolve_skip): 26231 (KJS::Machine::cti_op_div): 26232 (KJS::Machine::cti_op_pre_dec): 26233 (KJS::Machine::cti_op_jless): 26234 (KJS::Machine::cti_op_not): 26235 (KJS::Machine::cti_op_jtrue): 26236 (KJS::Machine::cti_op_post_inc): 26237 (KJS::Machine::cti_op_eq): 26238 (KJS::Machine::cti_op_lshift): 26239 (KJS::Machine::cti_op_bitand): 26240 (KJS::Machine::cti_op_rshift): 26241 (KJS::Machine::cti_op_bitnot): 26242 (KJS::Machine::cti_op_resolve_with_base): 26243 (KJS::Machine::cti_op_new_func_exp): 26244 (KJS::Machine::cti_op_mod): 26245 (KJS::Machine::cti_op_less): 26246 (KJS::Machine::cti_op_neq): 26247 (KJS::Machine::cti_op_post_dec): 26248 (KJS::Machine::cti_op_urshift): 26249 (KJS::Machine::cti_op_bitxor): 26250 (KJS::Machine::cti_op_new_regexp): 26251 (KJS::Machine::cti_op_bitor): 26252 (KJS::Machine::cti_op_call_eval): 26253 (KJS::Machine::cti_op_throw): 26254 (KJS::Machine::cti_op_get_pnames): 26255 (KJS::Machine::cti_op_next_pname): 26256 (KJS::Machine::cti_op_typeof): 26257 (KJS::Machine::cti_op_stricteq): 26258 (KJS::Machine::cti_op_nstricteq): 26259 (KJS::Machine::cti_op_to_jsnumber): 26260 * VM/Machine.h: 26261 * VM/Register.h: 26262 (KJS::Register::jsValue): 26263 (KJS::Register::getJSValue): 26264 (KJS::Register::codeBlock): 26265 (KJS::Register::scopeChain): 26266 (KJS::Register::i): 26267 (KJS::Register::r): 26268 (KJS::Register::vPC): 26269 (KJS::Register::jsPropertyNameIterator): 26270 * VM/SamplingTool.cpp: 26271 (KJS::): 26272 (KJS::SamplingTool::run): 26273 (KJS::SamplingTool::dump): 26274 * VM/SamplingTool.h: 26275 * kjs/JSImmediate.h: 26276 (KJS::JSImmediate::zeroImmediate): 26277 (KJS::JSImmediate::oneImmediate): 26278 * kjs/JSValue.h: 26279 * kjs/JSVariableObject.h: 26280 (KJS::JSVariableObject::JSVariableObjectData::offsetOf_registers): 26281 (KJS::JSVariableObject::offsetOf_d): 26282 (KJS::JSVariableObject::offsetOf_Data_registers): 26283 * masm: Added. 26284 * masm/IA32MacroAsm.h: Added. 26285 (KJS::JITCodeBuffer::JITCodeBuffer): 26286 (KJS::JITCodeBuffer::putByte): 26287 (KJS::JITCodeBuffer::putShort): 26288 (KJS::JITCodeBuffer::putInt): 26289 (KJS::JITCodeBuffer::getEIP): 26290 (KJS::JITCodeBuffer::start): 26291 (KJS::JITCodeBuffer::getOffset): 26292 (KJS::JITCodeBuffer::reset): 26293 (KJS::JITCodeBuffer::copy): 26294 (KJS::IA32MacroAssembler::): 26295 (KJS::IA32MacroAssembler::emitModRm_rr): 26296 (KJS::IA32MacroAssembler::emitModRm_rm): 26297 (KJS::IA32MacroAssembler::emitModRm_rmsib): 26298 (KJS::IA32MacroAssembler::emitModRm_opr): 26299 (KJS::IA32MacroAssembler::emitModRm_opm): 26300 (KJS::IA32MacroAssembler::IA32MacroAssembler): 26301 (KJS::IA32MacroAssembler::emitInt3): 26302 (KJS::IA32MacroAssembler::emitPushl_r): 26303 (KJS::IA32MacroAssembler::emitPopl_r): 26304 (KJS::IA32MacroAssembler::emitMovl_rr): 26305 (KJS::IA32MacroAssembler::emitAddl_rr): 26306 (KJS::IA32MacroAssembler::emitAddl_i8r): 26307 (KJS::IA32MacroAssembler::emitAddl_i32r): 26308 (KJS::IA32MacroAssembler::emitAddl_mr): 26309 (KJS::IA32MacroAssembler::emitAndl_rr): 26310 (KJS::IA32MacroAssembler::emitAndl_i32r): 26311 (KJS::IA32MacroAssembler::emitCmpl_i8r): 26312 (KJS::IA32MacroAssembler::emitCmpl_rr): 26313 (KJS::IA32MacroAssembler::emitCmpl_rm): 26314 (KJS::IA32MacroAssembler::emitCmpl_i32r): 26315 (KJS::IA32MacroAssembler::emitCmpw_rm): 26316 (KJS::IA32MacroAssembler::emitOrl_rr): 26317 (KJS::IA32MacroAssembler::emitOrl_i8r): 26318 (KJS::IA32MacroAssembler::emitSubl_rr): 26319 (KJS::IA32MacroAssembler::emitSubl_i8r): 26320 (KJS::IA32MacroAssembler::emitSubl_i32r): 26321 (KJS::IA32MacroAssembler::emitSubl_mr): 26322 (KJS::IA32MacroAssembler::emitTestl_i32r): 26323 (KJS::IA32MacroAssembler::emitTestl_rr): 26324 (KJS::IA32MacroAssembler::emitXorl_i8r): 26325 (KJS::IA32MacroAssembler::emitXorl_rr): 26326 (KJS::IA32MacroAssembler::emitSarl_i8r): 26327 (KJS::IA32MacroAssembler::emitSarl_CLr): 26328 (KJS::IA32MacroAssembler::emitShl_i8r): 26329 (KJS::IA32MacroAssembler::emitShll_CLr): 26330 (KJS::IA32MacroAssembler::emitMull_rr): 26331 (KJS::IA32MacroAssembler::emitIdivl_r): 26332 (KJS::IA32MacroAssembler::emitCdq): 26333 (KJS::IA32MacroAssembler::emitMovl_mr): 26334 (KJS::IA32MacroAssembler::emitMovzwl_mr): 26335 (KJS::IA32MacroAssembler::emitMovl_rm): 26336 (KJS::IA32MacroAssembler::emitMovl_i32r): 26337 (KJS::IA32MacroAssembler::emitMovl_i32m): 26338 (KJS::IA32MacroAssembler::emitLeal_mr): 26339 (KJS::IA32MacroAssembler::emitRet): 26340 (KJS::IA32MacroAssembler::JmpSrc::JmpSrc): 26341 (KJS::IA32MacroAssembler::JmpDst::JmpDst): 26342 (KJS::IA32MacroAssembler::emitCall): 26343 (KJS::IA32MacroAssembler::label): 26344 (KJS::IA32MacroAssembler::emitUnlinkedJmp): 26345 (KJS::IA32MacroAssembler::emitUnlinkedJne): 26346 (KJS::IA32MacroAssembler::emitUnlinkedJe): 26347 (KJS::IA32MacroAssembler::emitUnlinkedJl): 26348 (KJS::IA32MacroAssembler::emitUnlinkedJle): 26349 (KJS::IA32MacroAssembler::emitUnlinkedJge): 26350 (KJS::IA32MacroAssembler::emitUnlinkedJae): 26351 (KJS::IA32MacroAssembler::emitUnlinkedJo): 26352 (KJS::IA32MacroAssembler::emitPredictionNotTaken): 26353 (KJS::IA32MacroAssembler::link): 26354 (KJS::IA32MacroAssembler::copy): 26355 * wtf/Platform.h: 26356 263572008-08-26 Oliver Hunt <oliver@apple.com> 26358 26359 RS=Maciej. 26360 26361 Enabled -fomit-frame-pointer on Release and Production builds, add additional Profiling build config for shark, etc. 26362 26363 * JavaScriptCore.xcodeproj/project.pbxproj: 26364 26365=== Start merge of squirrelfish-extreme === 26366 263672008-09-06 Cameron Zwarich <cwzwarich@uwaterloo.ca> 26368 26369 Reviewed by Maciej Stachowiak. 26370 26371 Fix the Mac Debug build by adding symbols that are exported only in a 26372 Debug configuration. 26373 26374 * Configurations/JavaScriptCore.xcconfig: 26375 * DerivedSources.make: 26376 * JavaScriptCore.Debug.exp: Added. 26377 * JavaScriptCore.base.exp: Copied from JavaScriptCore.exp. 26378 * JavaScriptCore.exp: Removed. 26379 * JavaScriptCore.xcodeproj/project.pbxproj: 26380 263812008-09-05 Darin Adler <darin@apple.com> 26382 26383 Reviewed by Cameron Zwarich. 26384 26385 - https://bugs.webkit.org/show_bug.cgi?id=20681 26386 JSPropertyNameIterator functions need to be inlined 26387 26388 1.007x as fast on SunSpider overall 26389 1.081x as fast on SunSpider math-cordic 26390 26391 * VM/JSPropertyNameIterator.cpp: Moved functions out of here. 26392 * VM/JSPropertyNameIterator.h: 26393 (KJS::JSPropertyNameIterator::JSPropertyNameIterator): Moved 26394 this into the header and marked it inline. 26395 (KJS::JSPropertyNameIterator::create): Ditto. 26396 (KJS::JSPropertyNameIterator::next): Ditto. 26397 263982008-09-05 Darin Adler <darin@apple.com> 26399 26400 Reviewed by Geoffrey Garen. 26401 26402 - fix https://bugs.webkit.org/show_bug.cgi?id=20673 26403 single-character strings are churning in the Identifier table 26404 26405 1.007x as fast on SunSpider overall 26406 1.167x as fast on SunSpider string-fasta 26407 26408 * JavaScriptCore.exp: Updated. 26409 * kjs/SmallStrings.cpp: 26410 (KJS::SmallStrings::singleCharacterStringRep): Added. 26411 * kjs/SmallStrings.h: Added singleCharacterStringRep for clients that 26412 need just a UString, not a JSString. 26413 * kjs/identifier.cpp: 26414 (KJS::Identifier::add): Added special cases for single character strings 26415 so that the UString::Rep that ends up in the identifier table is the one 26416 from the single-character string optimization; otherwise we end up having 26417 to look it up in the identifier table over and over again. 26418 (KJS::Identifier::addSlowCase): Ditto. 26419 (KJS::Identifier::checkSameIdentifierTable): Made this function an empty 26420 inline in release builds so that callers don't have to put #ifndef NDEBUG 26421 at each call site. 26422 * kjs/identifier.h: 26423 (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to 26424 checkSameIdentifierTable. 26425 (KJS::Identifier::checkSameIdentifierTable): Added. Empty inline version 26426 for NDEBUG builds. 26427 264282008-09-05 Mark Rowe <mrowe@apple.com> 26429 26430 Build fix. 26431 26432 * kjs/JSObject.h: Move the inline virtual destructor after a non-inline 26433 virtual function so that the symbol for the vtable is not marked as a 26434 weakly exported symbol. 26435 264362008-09-05 Darin Adler <darin@apple.com> 26437 26438 Reviewed by Sam Weinig. 26439 26440 - fix https://bugs.webkit.org/show_bug.cgi?id=20671 26441 JavaScriptCore string manipulation spends too much time in memcpy 26442 26443 1.011x as fast on SunSpider overall 26444 1.028x as fast on SunSpider string tests 26445 26446 For small strings, use a loop rather than calling memcpy. The loop can 26447 be faster because there's no function call overhead, and because it can 26448 assume the pointers are aligned instead of checking that. Currently the 26449 threshold is set at 20 characters, based on some testing on one particular 26450 computer. Later we can tune this for various platforms by setting 26451 USTRING_COPY_CHARS_INLINE_CUTOFF appropriately, but it does no great harm 26452 if not perfectly tuned. 26453 26454 * kjs/ustring.cpp: 26455 (KJS::overflowIndicator): Removed bogus const. 26456 (KJS::maxUChars): Ditto. 26457 (KJS::copyChars): Added. 26458 (KJS::UString::Rep::createCopying): Call copyChars instead of memcpy. 26459 Also eliminated need for const_cast. 26460 (KJS::UString::expandPreCapacity): Ditto. 26461 (KJS::concatenate): Ditto. 26462 (KJS::UString::spliceSubstringsWithSeparators): Ditto. 26463 (KJS::UString::append): Ditto. 26464 264652008-09-05 Kevin McCullough <kmccullough@apple.com> 26466 26467 Reviewed by Sam and Alexey. 26468 26469 Make the profiler work with a null exec state. This will allow other 26470 applications start the profiler to get DTrace probes going without 26471 needing a WebView. 26472 26473 * ChangeLog: 26474 * profiler/ProfileGenerator.cpp: 26475 (KJS::ProfileGenerator::ProfileGenerator): 26476 (KJS::ProfileGenerator::willExecute): 26477 (KJS::ProfileGenerator::didExecute): 26478 * profiler/Profiler.cpp: 26479 (KJS::Profiler::startProfiling): 26480 (KJS::Profiler::stopProfiling): 26481 (KJS::dispatchFunctionToProfiles): 26482 264832008-09-04 Gavin Barraclough <barraclough@apple.com> 26484 26485 Reviewed by Geoffrey Garen. 26486 26487 Fixed an off-by-one error that would cause the StructureIDChain to 26488 be one object too short. 26489 26490 Can't construct a test case because other factors make this not crash 26491 (yet!). 26492 26493 * kjs/StructureID.cpp: 26494 (KJS::StructureIDChain::StructureIDChain): 26495 264962008-09-04 Kevin Ollivier <kevino@theolliviers.com> 26497 26498 wx build fixes. 26499 26500 * JavaScriptCoreSources.bkl: 26501 265022008-09-04 Mark Rowe <mrowe@apple.com> 26503 26504 Reviewed by Eric Seidel. 26505 26506 Fix https://bugs.webkit.org/show_bug.cgi?id=20639. 26507 Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE 26508 26509 * Configurations/JavaScriptCore.xcconfig: Remove ENABLE_DASHBOARD_SUPPORT from FEATURE_DEFINES. 26510 * wtf/Platform.h: Set ENABLE_DASHBOARD_SUPPORT for PLATFORM(MAC). 26511 265122008-09-04 Adele Peterson <adele@apple.com> 26513 26514 Build fix. 26515 26516 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 26517 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 26518 * JavaScriptCore.vcproj/jsc/jsc.vcproj: 26519 265202008-09-04 Mark Rowe <mrowe@apple.com> 26521 26522 Mac build fix. 26523 26524 * kjs/config.h: Only check the value of HAVE_CONFIG_H if it is defined. 26525 265262008-09-04 Marco Barisione <marco.barisione@collabora.co.uk> 26527 26528 Reviewed by Eric Seidel. 26529 26530 http://bugs.webkit.org/show_bug.cgi?id=20380 26531 [GTK][AUTOTOOLS] Include autotoolsconfig.h from config.h 26532 26533 * kjs/config.h: Include the configuration header generated by 26534 autotools if available. 26535 265362008-09-04 Tor Arne Vestbø <tavestbo@trolltech.com> 26537 26538 Reviewed by Simon. 26539 26540 Fix the QtWebKit build to match changes in r36016 26541 26542 * JavaScriptCore.pri: 26543 265442008-09-04 Mark Rowe <mrowe@apple.com> 26545 26546 Fix the 64-bit build. 26547 26548 * VM/CodeBlock.cpp: 26549 (KJS::CodeBlock::printStructureID): Store the instruction offset into an unsigned local 26550 to avoid a warning related to format specifiers. 26551 (KJS::CodeBlock::printStructureIDs): Ditto. 26552 265532008-09-04 Cameron Zwarich <cwzwarich@uwaterloo.ca> 26554 26555 Rubber-stamped by Oliver Hunt. 26556 26557 Correct the spelling of 'entryIndices'. 26558 26559 * kjs/PropertyMap.cpp: 26560 (KJS::PropertyMap::get): 26561 (KJS::PropertyMap::getLocation): 26562 (KJS::PropertyMap::put): 26563 (KJS::PropertyMap::insert): 26564 (KJS::PropertyMap::remove): 26565 (KJS::PropertyMap::checkConsistency): 26566 * kjs/PropertyMap.h: 26567 (KJS::PropertyMapHashTable::entries): 26568 (KJS::PropertyMap::getOffset): 26569 (KJS::PropertyMap::putOffset): 26570 (KJS::PropertyMap::offsetForTableLocation): 26571 265722008-09-03 Geoffrey Garen <ggaren@apple.com> 26573 26574 Reviewed by Cameron Zwarich. 26575 26576 Fixed <rdar://problem/6193925> REGRESSION: Crash occurs at 26577 KJS::Machine::privateExecute() when attempting to load my Mobile Gallery 26578 (http://www.me.com/gallery/#home) 26579 26580 also 26581 26582 https://bugs.webkit.org/show_bug.cgi?id=20633 Crash in privateExecute 26583 @ cs.byu.edu 26584 26585 The underlying problem was that we would cache prototype properties 26586 even if the prototype was a dictionary. 26587 26588 The fix is to transition a prototype back from dictionary to normal 26589 status when an opcode caches access to it. (This is better than just 26590 refusing to cache, since a heavily accessed prototype is almost 26591 certainly not a true dictionary.) 26592 26593 * VM/Machine.cpp: 26594 (KJS::Machine::tryCacheGetByID): 26595 * kjs/JSObject.h: 26596 265972008-09-03 Eric Seidel <eric@webkit.org> 26598 26599 Reviewed by Sam. 26600 26601 Clean up Platform.h and add PLATFORM(CHROMIUM), PLATFORM(SKIA) and USE(V8_BINDINGS) 26602 26603 * Configurations/JavaScriptCore.xcconfig: add missing ENABLE_* 26604 * wtf/ASCIICType.h: include <wtf/Assertions.h> since it depends on it. 26605 * wtf/Platform.h: 26606 266072008-09-03 Kevin McCullough <kmccullough@apple.com> 26608 26609 Reviewed by Tim. 26610 26611 Remove the rest of the "zombie" code from the profiler. 26612 - There is no longer a need for the ProfilerClient callback mechanism. 26613 26614 * API/JSProfilerPrivate.cpp: 26615 (JSStartProfiling): 26616 * JavaScriptCore.exp: 26617 * profiler/HeavyProfile.h: 26618 * profiler/ProfileGenerator.cpp: 26619 (KJS::ProfileGenerator::create): 26620 (KJS::ProfileGenerator::ProfileGenerator): 26621 * profiler/ProfileGenerator.h: 26622 (KJS::ProfileGenerator::profileGroup): 26623 * profiler/Profiler.cpp: 26624 (KJS::Profiler::startProfiling): 26625 (KJS::Profiler::stopProfiling): Immediately return the profile when 26626 stopped instead of using a callback. 26627 * profiler/Profiler.h: 26628 * profiler/TreeProfile.h: 26629 266302008-09-03 Adele Peterson <adele@apple.com> 26631 26632 Build fix. 26633 26634 * wtf/win/MainThreadWin.cpp: 26635 266362008-09-02 Kevin McCullough <kmccullough@apple.com> 26637 26638 Reviewed by Darin and Tim. 26639 26640 Remove most of the "zombie" mode from the profiler. Next we will need 26641 to remove the client callback mechanism in profiles. 26642 26643 - This simplifies the code, leverages the recent changes I've made in 26644 getting line numbers from SquirrelFish, and is a slight speed 26645 improvement on SunSpider. 26646 - Also the "zombie" mode was a constant source of odd edge cases and 26647 obscure bugs so it's good to remove since all of its issues may not have 26648 been found. 26649 26650 * API/JSProfilerPrivate.cpp: No need to call didFinishAllExecution() any 26651 more. 26652 (JSEndProfiling): 26653 * JavaScriptCore.exp: Export the new signature of retrieveLastCaller() 26654 * VM/Machine.cpp: 26655 (KJS::Machine::execute): No need to call didFinishAllExecution() any 26656 more. 26657 (KJS::Machine::retrieveCaller): Now operates on InternalFunctions now 26658 since the RegisterFile is no longer guaranteeded to store only 26659 JSFunctions 26660 (KJS::Machine::retrieveLastCaller): Now also retrieve the function's 26661 name 26662 (KJS::Machine::callFrame): A result of changing retrieveCaller() 26663 * VM/Machine.h: 26664 * VM/Register.h: 26665 * kjs/JSGlobalObject.cpp: 26666 (KJS::JSGlobalObject::~JSGlobalObject): 26667 * kjs/nodes.h: 26668 * profiler/ProfileGenerator.cpp: 26669 (KJS::ProfileGenerator::create): Now pass the original exec and get the 26670 global exec and client when necessary. We need the original exec so we 26671 can have the stack frame where profiling started. 26672 (KJS::ProfileGenerator::ProfileGenerator): ditto. 26673 (KJS::ProfileGenerator::addParentForConsoleStart): This is where the 26674 parent to star of the profile is added, if there is one. 26675 (KJS::ProfileGenerator::willExecute): Remove uglyness! 26676 (KJS::ProfileGenerator::didExecute): Ditto! 26677 (KJS::ProfileGenerator::stopProfiling): 26678 (KJS::ProfileGenerator::removeProfileStart): Use a better way to find 26679 and remove the function we are looking for. 26680 (KJS::ProfileGenerator::removeProfileEnd): Ditto. 26681 * profiler/ProfileGenerator.h: 26682 (KJS::ProfileGenerator::client): 26683 * profiler/ProfileNode.cpp: 26684 (KJS::ProfileNode::removeChild): Add a better way to remove a child from 26685 a ProfileNode. 26686 (KJS::ProfileNode::stopProfiling): 26687 (KJS::ProfileNode::debugPrintData): Modified a debug-only diagnostic 26688 function to be sane. 26689 * profiler/ProfileNode.h: 26690 * profiler/Profiler.cpp: Change to pass the original exec state. 26691 (KJS::Profiler::startProfiling): 26692 (KJS::Profiler::stopProfiling): 26693 (KJS::Profiler::willExecute): 26694 (KJS::Profiler::didExecute): 26695 (KJS::Profiler::createCallIdentifier): 26696 * profiler/Profiler.h: 26697 266982008-09-01 Alexey Proskuryakov <ap@webkit.org> 26699 26700 Reviewed by Darin Adler. 26701 26702 Implement callOnMainThreadAndWait(). 26703 26704 This will be useful when a background thread needs to perform UI calls synchronously 26705 (e.g. an openDatabase() call cannot return until the user answers to a confirmation dialog). 26706 26707 * wtf/MainThread.cpp: 26708 (WTF::FunctionWithContext::FunctionWithContext): Added a ThreadCondition member. When 26709 non-zero, the condition is signalled after the function is called. 26710 (WTF::mainThreadFunctionQueueMutex): Renamed from functionQueueMutex, sinc this is no longer 26711 static. Changed to be initialized from initializeThreading() to avoid lock contention. 26712 (WTF::initializeMainThread): On non-Windows platforms, just call mainThreadFunctionQueueMutex. 26713 (WTF::dispatchFunctionsFromMainThread): Signal synchronous calls when done. 26714 (WTF::callOnMainThread): Updated for functionQueueMutex rename. 26715 (WTF::callOnMainThreadAndWait): Added. 26716 26717 * wtf/MainThread.h: Added callOnMainThreadAndWait(); initializeMainThread() now exists on 26718 all platforms. 26719 26720 * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThread): Added a callOnMainThreadAndWait() 26721 call to initialize function queue mutex. 26722 26723 * wtf/ThreadingGtk.cpp: (WTF::initializeThreading): 26724 * wtf/ThreadingPthreads.cpp: (WTF::initializeThreading): 26725 * wtf/ThreadingQt.cpp: (WTF::initializeThreading): 26726 Only initialize mainThreadIdentifier on non-Darwin platforms. It was not guaranteed to be 26727 accurate on Darwin. 26728 267292008-09-03 Geoffrey Garen <ggaren@apple.com> 26730 26731 Reviewed by Darin Adler. 26732 26733 Use isUndefinedOrNull() instead of separate checks for each in op_eq_null 26734 and op_neq_null. 26735 26736 * VM/Machine.cpp: 26737 (KJS::Machine::privateExecute): 26738 267392008-09-02 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 26740 26741 Reviewed by Darin Adler. 26742 26743 Bug 20296: OpcodeStats doesn't build on platforms which don't have mergesort(). 26744 <https://bugs.webkit.org/show_bug.cgi?id=20296> 26745 26746 * VM/Opcode.cpp: 26747 (KJS::OpcodeStats::~OpcodeStats): mergesort() replaced with qsort() 26748 267492008-09-02 Geoffrey Garen <ggaren@apple.com> 26750 26751 Reviewed by Oliver Hunt. 26752 26753 Fast path for array.length and string.length. 26754 26755 SunSpider says 0.5% faster. 26756 267572008-09-02 Geoffrey Garen <ggaren@apple.com> 26758 26759 Reviewed by Anders Carlsson. 26760 26761 Added optimized paths for comparing to null. 26762 26763 SunSpider says 0.5% faster. 26764 267652008-09-02 Geoffrey Garen <ggaren@apple.com> 26766 26767 Reviewed by Sam Weinig. 26768 26769 Changed jsDriver.pl to dump the exact text you would need in order to 26770 reproduce a test result. This enables a fast workflow where you copy 26771 and paste a test failure in the terminal. 26772 26773 * tests/mozilla/jsDriver.pl: 26774 267752008-09-02 Geoffrey Garen <ggaren@apple.com> 26776 26777 Reviewed by Sam Weinig. 26778 26779 Implemented the rest of Darin's review comments for the 09-01 inline 26780 caching patch. 26781 26782 SunSpider says 0.5% faster, but that seems like noise. 26783 26784 * JavaScriptCore.xcodeproj/project.pbxproj: Put PutPropertySlot into 26785 its own file, and added BatchedTransitionOptimizer. 26786 26787 * VM/CodeBlock.cpp: 26788 (KJS::CodeBlock::~CodeBlock): Use array indexing instead of a pointer 26789 iterator. 26790 26791 * VM/CodeGenerator.cpp: 26792 (KJS::CodeGenerator::CodeGenerator): Used BatchedTransitionOptimizer to 26793 make batched put and remove for declared variables fast, without forever 26794 pessimizing the global object. Removed the old getDirect/removeDirect hack 26795 that tried to do the same in a more limited way. 26796 26797 * VM/CodeGenerator.h: Moved IdentifierRepHash to the KJS namespace since 26798 it doesn't specialize anything in WTF. 26799 26800 * VM/Machine.cpp: 26801 (KJS::Machine::Machine): Nixed the DummyConstruct tag because it was 26802 confusingly named. 26803 26804 (KJS::Machine::execute): Used BatchedTransitionOptimizer, as above. Fixed 26805 up some comments. 26806 26807 (KJS::cachePrototypeChain): Cast to JSObject*, since it's more specific. 26808 26809 (KJS::Machine::tryCachePutByID): Use isNull() instead of comparing to 26810 jsNull(), since isNull() leaves more options open for the future. 26811 (KJS::Machine::tryCacheGetByID): ditto 26812 (KJS::Machine::privateExecute): ditto 26813 26814 * VM/SamplingTool.cpp: 26815 (KJS::SamplingTool::dump): Use C++-style cast, to match our style 26816 guidelines. 26817 26818 * kjs/BatchedTransitionOptimizer.h: Added. New class that allows host 26819 code to add a batch of properties to an object in an efficient way. 26820 26821 * kjs/JSActivation.cpp: Use isNull(), as above. 26822 26823 * kjs/JSArray.cpp: Get rid of DummyConstruct tag, as above. 26824 * kjs/JSArray.h: 26825 26826 * kjs/JSGlobalData.cpp: Nixed two unused StructureIDs. 26827 * kjs/JSGlobalData.h: 26828 26829 * kjs/JSImmediate.cpp: Use isNull(), as above. 26830 26831 * kjs/JSObject.cpp: 26832 (KJS::JSObject::mark): Moved mark tracing code elsewhere, to make this 26833 function more readable. 26834 26835 (KJS::JSObject::put): Use isNull(), as above. 26836 26837 (KJS::JSObject::createInheritorID): Return a raw pointer, since the 26838 object is owned by a data member, not necessarily the caller. 26839 * kjs/JSObject.h: 26840 26841 * kjs/JSString.cpp: Use isNull(), as above. 26842 26843 * kjs/PropertyMap.h: Updated to use PropertySlot::invalidOffset. 26844 26845 * kjs/PropertySlot.h: Changed KJS_INVALID_OFFSET to WTF::notFound 26846 because C macros are so 80's. 26847 26848 * kjs/PutPropertySlot.h: Added. Split out of PropertySlot.h. Also renamed 26849 PutPropertySlot::SlotType to PutPropertySlot::Type, and slotBase to base, 26850 since "slot" was redundant. 26851 26852 * kjs/StructureID.cpp: Added a new transition *away* from dictionary 26853 status, to support BatchedTransitionOptimizer. 26854 26855 (KJS::StructureIDChain::StructureIDChain): No need to store m_size as 26856 a data member, so keep it in a local, which might be faster. 26857 * kjs/StructureID.h: 26858 26859 * kjs/SymbolTable.h: Moved IdentifierRepHash to KJS namespace, as above. 26860 * kjs/ustring.h: 26861 268622008-09-02 Adam Roben <aroben@apple.com> 26863 26864 Windows build fixes 26865 26866 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add 26867 StructureID.{cpp,h} to the project. Also let VS reorder this file. 26868 * VM/CodeBlock.cpp: Include StringExtras so that snprintf will be 26869 defined on Windows. 26870 268712008-09-01 Sam Weinig <sam@webkit.org> 26872 26873 Fix release build. 26874 26875 * JavaScriptCore.exp: 26876 268772008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org> 26878 26879 Reviewed by Oliver Hunt. 26880 26881 Gtk buildfix 26882 26883 * GNUmakefile.am: 26884 * kjs/PropertyMap.cpp: rename Identifier.h to identifier.h 26885 * kjs/StructureID.cpp: include JSObject.h 26886 268872008-09-01 Geoffrey Garen <ggaren@apple.com> 26888 26889 Reviewed by Darin Adler. 26890 26891 First cut at inline caching for access to vanilla JavaScript properties. 26892 26893 SunSpider says 4% faster. Tests heavy on dictionary-like access have 26894 regressed a bit -- we have a lot of room to improve in this area, 26895 but this patch is over-ripe as-is. 26896 26897 JSCells now have a StructureID that uniquely identifies their layout, 26898 and holds their prototype. 26899 26900 JSValue::put takes a PropertySlot& argument, so it can fill in details 26901 about where it put a value, for the sake of caching. 26902 26903 * VM/CodeGenerator.cpp: 26904 (KJS::CodeGenerator::CodeGenerator): Avoid calling removeDirect if we 26905 can, since it disables inline caching in the global object. This can 26906 probably improve in the future. 26907 26908 * kjs/JSGlobalObject.cpp: Nixed reset(), since it complicates caching, and 26909 wasn't really necessary. 26910 26911 * kjs/JSObject.cpp: Tweaked getter / setter behavior not to rely on the 26912 IsGetterSetter flag, since the flag was buggy. This is necessary in order 26913 to avoid accidentally accessing a getter / setter as a normal property. 26914 26915 Also changed getter / setter creation to honor ReadOnly, matching Mozilla. 26916 26917 * kjs/PropertyMap.cpp: Nixed clear(), since it complicates caching and 26918 isn't necessary. 26919 26920 * kjs/Shell.cpp: Moved SamplingTool dumping outside the loop. This allows 26921 you to aggregate sampling of multiple files (or the same file repeatedly), 26922 which helped me track down regressions. 26923 26924 * kjs/ustring.h: Moved IdentifierRepHash here to share it. 26925 269262008-09-01 Geoffrey Garen <ggaren@apple.com> 26927 26928 Reviewed by Sam Weinig. 26929 26930 Eagerly allocate the Math object's numeric constants. This avoids 26931 constantly reallocating them in loops, and also ensures that the Math 26932 object will not use the single property optimization, which makes 26933 properties ineligible for caching. 26934 26935 SunSpider reports a small speedup, in combination with inline caching. 26936 26937 * kjs/MathObject.cpp: 26938 (KJS::MathObject::MathObject): 26939 (KJS::MathObject::getOwnPropertySlot): 26940 * kjs/MathObject.h: 26941 269422008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org> 26943 26944 Gtk build fix, not reviewed. 26945 26946 * GNUmakefile.am: Add SmallStrings.cpp in both release and debug builds 26947 269482008-08-31 Cameron Zwarich <cwzwarich@uwaterloo.ca> 26949 26950 Reviewed by Maciej Stachowiak. 26951 26952 Bug 20577: REGRESSION (r36006): Gmail is broken 26953 <https://bugs.webkit.org/show_bug.cgi?id=20577> 26954 26955 r36006 changed stringProtoFuncSubstr() so that it is uses the more 26956 efficient jsSubstring(), rather than using UString::substr() and then 26957 calling jsString(). However, the change did not account for the case 26958 where the start and the length of the substring extend beyond the length 26959 of the original string. This patch corrects that. 26960 26961 * kjs/StringPrototype.cpp: 26962 (KJS::stringProtoFuncSubstr): 26963 269642008-08-31 Simon Hausmann <hausmann@wekit.org> 26965 26966 Unreviewed build fix (with gcc 4.3) 26967 26968 * kjs/ustring.h: Properly forward declare operator== for UString and 26969 the the concatenate functions inside the KJS namespace. 26970 269712008-08-30 Darin Adler <darin@apple.com> 26972 26973 Reviewed by Maciej. 26974 26975 - https://bugs.webkit.org/show_bug.cgi?id=20333 26976 improve JavaScript speed when handling single-character strings 26977 26978 1.035x as fast on SunSpider overall. 26979 1.127x as fast on SunSpider string tests. 26980 1.910x as fast on SunSpider string-base64 test. 26981 26982 * API/JSObjectRef.cpp: 26983 (JSObjectMakeFunction): Removed unneeded explicit construction of UString. 26984 26985 * GNUmakefile.am: Added SmallStrings.h and SmallStrings.cpp. 26986 * JavaScriptCore.pri: Ditto. 26987 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 26988 Ditto. 26989 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. 26990 * JavaScriptCoreSources.bkl: Ditto. 26991 26992 * JavaScriptCore.exp: Updated. 26993 26994 * VM/Machine.cpp: 26995 (KJS::jsAddSlowCase): Changed to use a code path that doesn't involve 26996 a UString constructor. This avoids an extra jump caused by the "in charge" 26997 vs. "not in charge" constructors. 26998 (KJS::jsAdd): Ditto. 26999 (KJS::jsTypeStringForValue): Adopted jsNontrivialString. 27000 27001 * kjs/ArrayPrototype.cpp: 27002 (KJS::arrayProtoFuncToString): Adopted jsEmptyString. 27003 (KJS::arrayProtoFuncToLocaleString): Ditto. 27004 (KJS::arrayProtoFuncJoin): Ditto. 27005 * kjs/BooleanPrototype.cpp: 27006 (KJS::booleanProtoFuncToString): Adopted jsNontrivialString. 27007 * kjs/DateConstructor.cpp: 27008 (KJS::callDate): Ditto. 27009 * kjs/DatePrototype.cpp: 27010 (KJS::formatLocaleDate): Adopted jsEmptyString and jsNontrivialString. 27011 (KJS::dateProtoFuncToString): Ditto. 27012 (KJS::dateProtoFuncToUTCString): Ditto. 27013 (KJS::dateProtoFuncToDateString): Ditto. 27014 (KJS::dateProtoFuncToTimeString): Ditto. 27015 (KJS::dateProtoFuncToLocaleString): Ditto. 27016 (KJS::dateProtoFuncToLocaleDateString): Ditto. 27017 (KJS::dateProtoFuncToLocaleTimeString): Ditto. 27018 (KJS::dateProtoFuncToGMTString): Ditto. 27019 27020 * kjs/ErrorPrototype.cpp: 27021 (KJS::ErrorPrototype::ErrorPrototype): Ditto. 27022 (KJS::errorProtoFuncToString): Ditto. 27023 27024 * kjs/JSGlobalData.h: Added SmallStrings. 27025 27026 * kjs/JSString.cpp: 27027 (KJS::jsString): Eliminated the overload that takes a const char*. 27028 Added code to use SmallStrings to get strings of small sizes rather 27029 than creating a new JSString every time. 27030 (KJS::jsSubstring): Added. Used when creating a string from a substring 27031 to avoid creating a JSString in cases where the substring will end up 27032 empty or as one character. 27033 (KJS::jsOwnedString): Added the same code as in jsString. 27034 27035 * kjs/JSString.h: Added new functions jsEmptyString, jsSingleCharacterString, 27036 jsSingleCharacterSubstring, jsSubstring, and jsNontrivialString for various 27037 cases where we want to create JSString, and want special handling for small 27038 strings. 27039 (KJS::JSString::JSString): Added an overload that takes a PassRefPtr of 27040 a UString::Rep so you don't have to construct a UString; PassRefPtr can be 27041 more efficient. 27042 (KJS::jsEmptyString): Added. 27043 (KJS::jsSingleCharacterString): Added. 27044 (KJS::jsSingleCharacterSubstring): Added. 27045 (KJS::jsNontrivialString): Added. 27046 (KJS::JSString::getIndex): Adopted jsSingleCharacterSubstring. 27047 (KJS::JSString::getStringPropertySlot): Ditto. 27048 27049 * kjs/NumberPrototype.cpp: 27050 (KJS::numberProtoFuncToFixed): Adopted jsNontrivialString. 27051 (KJS::numberProtoFuncToExponential): Ditto. 27052 (KJS::numberProtoFuncToPrecision): Ditto. 27053 27054 * kjs/ObjectPrototype.cpp: 27055 (KJS::objectProtoFuncToLocaleString): Adopted toThisJSString. 27056 (KJS::objectProtoFuncToString): Adopted jsNontrivialString. 27057 27058 * kjs/RegExpConstructor.cpp: Separated the lastInput value that's used 27059 with the lastOvector to return matches from the input value that can be 27060 changed via JavaScript. They will be equal in many cases, but not all. 27061 (KJS::RegExpConstructor::performMatch): Set input. 27062 (KJS::RegExpMatchesArray::RegExpMatchesArray): Ditto. 27063 (KJS::RegExpMatchesArray::fillArrayInstance): Adopted jsSubstring. Also, 27064 use input rather than lastInput in the appropriate place. 27065 (KJS::RegExpConstructor::getBackref): Adopted jsSubstring and jsEmptyString. 27066 Added code to handle the case where there is no backref -- before this 27067 depended on range checking in UString::substr which is not present in 27068 jsSubstring. 27069 (KJS::RegExpConstructor::getLastParen): Ditto. 27070 (KJS::RegExpConstructor::getLeftContext): Ditto. 27071 (KJS::RegExpConstructor::getRightContext): Ditto. 27072 (KJS::RegExpConstructor::getValueProperty): Use input rather than lastInput. 27073 Also adopt jsEmptyString. 27074 (KJS::RegExpConstructor::putValueProperty): Ditto. 27075 (KJS::RegExpConstructor::input): Ditto. 27076 27077 * kjs/RegExpPrototype.cpp: 27078 (KJS::regExpProtoFuncToString): Adopt jsNonTrivialString. Also changed to 27079 use UString::append to append single characters rather than using += and 27080 a C-style string. 27081 27082 * kjs/SmallStrings.cpp: Added. 27083 (KJS::SmallStringsStorage::SmallStringsStorage): Construct the 27084 buffer and UString::Rep for all 256 single-character strings for 27085 the U+0000 through U+00FF. This covers all the values used in 27086 the base64 test as well as most values seen elsewhere on the web 27087 as well. It's possible that later we might fix this to only work 27088 for U+0000 through U+007F but the others are used quite a bit in 27089 the current version of the base64 test. 27090 (KJS::SmallStringsStorage::~SmallStringsStorage): Free memory. 27091 (KJS::SmallStrings::SmallStrings): Create a set of small strings, 27092 initially not created; created later when they are used. 27093 (KJS::SmallStrings::~SmallStrings): Deallocate. Not left compiler 27094 generated because the SmallStringsStorage class's destructor needs 27095 to be visible. 27096 (KJS::SmallStrings::mark): Mark all the strings. 27097 (KJS::SmallStrings::createEmptyString): Create a cell for the 27098 empty string. Called only the first time. 27099 (KJS::SmallStrings::createSingleCharacterString): Create a cell 27100 for one of the single-character strings. Called only the first time. 27101 * kjs/SmallStrings.h: Added. 27102 27103 * kjs/StringConstructor.cpp: 27104 (KJS::stringFromCharCodeSlowCase): Factored out of strinFromCharCode. 27105 Only used for cases where the caller does not pass exactly one argument. 27106 (KJS::stringFromCharCode): Adopted jsSingleCharacterString. 27107 (KJS::callStringConstructor): Adopted jsEmptyString. 27108 27109 * kjs/StringObject.cpp: 27110 (KJS::StringObject::StringObject): Adopted jsEmptyString. 27111 27112 * kjs/StringPrototype.cpp: 27113 (KJS::stringProtoFuncReplace): Adopted jsSubstring. 27114 (KJS::stringProtoFuncCharAt): Adopted jsEmptyString and 27115 jsSingleCharacterSubstring and also added a special case when the 27116 index is an immediate number to avoid conversion to and from floating 27117 point, since that's the common case. 27118 (KJS::stringProtoFuncCharCodeAt): Ditto. 27119 (KJS::stringProtoFuncMatch): Adopted jsSubstring and jsEmptyString. 27120 (KJS::stringProtoFuncSlice): Adopted jsSubstring and 27121 jsSingleCharacterSubstring. Also got rid of some unneeded locals and 27122 removed unneeded code to set the length property of the array, since it 27123 is automatically updated as values are added to the array. 27124 (KJS::stringProtoFuncSplit): Adopted jsEmptyString. 27125 (KJS::stringProtoFuncSubstr): Adopted jsSubstring. 27126 (KJS::stringProtoFuncSubstring): Ditto. 27127 27128 * kjs/collector.cpp: 27129 (KJS::Heap::collect): Added a call to mark SmallStrings. 27130 27131 * kjs/ustring.cpp: 27132 (KJS::UString::expandedSize): Made this a static member function since 27133 it doesn't need to look at any data members. 27134 (KJS::UString::expandCapacity): Use a non-inline function, makeNull, to 27135 set the rep to null in failure cases. This avoids adding a PIC branch for 27136 the normal case when there is no failure. 27137 (KJS::UString::expandPreCapacity): Ditto. 27138 (KJS::UString::UString): Ditto. 27139 (KJS::concatenate): Refactored the concatenation constructor into this 27140 separate function. Calling the concatenation constructor was leading to 27141 an extra branch because of the in-charge vs. not-in-charge versions not 27142 both being inlined, and this was showing up as nearly 1% on Shark. Also 27143 added a special case for when the second string is a single character, 27144 since it's a common idiom to build up a string that way and we can do 27145 things much more quickly, without involving memcpy for example. Also 27146 adopted the non-inline function, nullRep, for the same reason given for 27147 makeNull above. 27148 (KJS::UString::append): Adopted makeNull for failure cases. 27149 (KJS::UString::operator=): Ditto. 27150 (KJS::UString::toDouble): Added a special case for converting single 27151 character strings to numbers. We're doing this a ton of times while 27152 running the base64 test. 27153 (KJS::operator==): Added special cases so we can compare single-character 27154 strings without calling memcmp. Later we might want to special case other 27155 short lengths similarly. 27156 (KJS::UString::makeNull): Added. 27157 (KJS::UString::nullRep): Added. 27158 * kjs/ustring.h: Added declarations for the nullRep and makeNull. Changed 27159 expandedSize to be a static member function. Added a declaration of the 27160 concatenate function. Removed the concatenation constructor. Rewrote 27161 operator+ to use the concatenate function. 27162 271632008-08-29 Anders Carlsson <andersca@apple.com> 27164 27165 Build fix. 27166 27167 * VM/Machine.cpp: 27168 (KJS::getCPUTime): 27169 271702008-08-29 Anders Carlsson <andersca@apple.com> 27171 27172 Reviewed by Darin Adler. 27173 27174 <rdar://problem/6174667> 27175 When a machine is under heavy load, the Slow Script dialog often comes up many times and just gets in the way 27176 27177 Instead of using clock time, use the CPU time spent executing the current thread when 27178 determining if the script has been running for too long. 27179 27180 * VM/Machine.cpp: 27181 (KJS::getCPUTime): 27182 (KJS::Machine::checkTimeout): 27183 271842008-08-28 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27185 27186 Rubber-stamped by Sam Weinig. 27187 27188 Change 'term' to 'expr' in variable names to standardize terminology. 27189 27190 * kjs/nodes.cpp: 27191 (KJS::BinaryOpNode::emitCode): 27192 (KJS::ReverseBinaryOpNode::emitCode): 27193 (KJS::ThrowableBinaryOpNode::emitCode): 27194 * kjs/nodes.h: 27195 (KJS::BinaryOpNode::BinaryOpNode): 27196 (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode): 27197 (KJS::MultNode::): 27198 (KJS::DivNode::): 27199 (KJS::ModNode::): 27200 (KJS::AddNode::): 27201 (KJS::SubNode::): 27202 (KJS::LeftShiftNode::): 27203 (KJS::RightShiftNode::): 27204 (KJS::UnsignedRightShiftNode::): 27205 (KJS::LessNode::): 27206 (KJS::GreaterNode::): 27207 (KJS::LessEqNode::): 27208 (KJS::GreaterEqNode::): 27209 (KJS::ThrowableBinaryOpNode::): 27210 (KJS::InstanceOfNode::): 27211 (KJS::InNode::): 27212 (KJS::EqualNode::): 27213 (KJS::NotEqualNode::): 27214 (KJS::StrictEqualNode::): 27215 (KJS::NotStrictEqualNode::): 27216 (KJS::BitAndNode::): 27217 (KJS::BitOrNode::): 27218 (KJS::BitXOrNode::): 27219 * kjs/nodes2string.cpp: 27220 (KJS::MultNode::streamTo): 27221 (KJS::DivNode::streamTo): 27222 (KJS::ModNode::streamTo): 27223 (KJS::AddNode::streamTo): 27224 (KJS::SubNode::streamTo): 27225 (KJS::LeftShiftNode::streamTo): 27226 (KJS::RightShiftNode::streamTo): 27227 (KJS::UnsignedRightShiftNode::streamTo): 27228 (KJS::LessNode::streamTo): 27229 (KJS::GreaterNode::streamTo): 27230 (KJS::LessEqNode::streamTo): 27231 (KJS::GreaterEqNode::streamTo): 27232 (KJS::InstanceOfNode::streamTo): 27233 (KJS::InNode::streamTo): 27234 (KJS::EqualNode::streamTo): 27235 (KJS::NotEqualNode::streamTo): 27236 (KJS::StrictEqualNode::streamTo): 27237 (KJS::NotStrictEqualNode::streamTo): 27238 (KJS::BitAndNode::streamTo): 27239 (KJS::BitXOrNode::streamTo): 27240 (KJS::BitOrNode::streamTo): 27241 272422008-08-28 Alp Toker <alp@nuanti.com> 27243 27244 GTK+ dist/build fix. List newly added header files. 27245 27246 * GNUmakefile.am: 27247 272482008-08-28 Sam Weinig <sam@webkit.org> 27249 27250 Reviewed by Oliver Hunt. 27251 27252 Change to throw a ReferenceError at runtime instead of a ParseError 27253 at parse time, when the left hand side expression of a for-in statement 27254 is not an lvalue. 27255 27256 * kjs/grammar.y: 27257 * kjs/nodes.cpp: 27258 (KJS::ForInNode::emitCode): 27259 272602008-08-28 Alexey Proskuryakov <ap@webkit.org> 27261 27262 Not reviewed, build fix (at least for OpenBSD, posssibly more). 27263 27264 https://bugs.webkit.org/show_bug.cgi?id=20545 27265 missing #include <unistd.h> in JavaScriptCore/VM/SamplingTool.cpp 27266 27267 * VM/SamplingTool.cpp: add the missing include. 27268 272692008-08-26 Kevin McCullough <kmccullough@apple.com> 27270 27271 Reviewed by Geoff and Cameron. 27272 27273 <rdar://problem/6174603> Hitting assertion in Register::codeBlock when 27274 loading facebook (20516). 27275 27276 - This was a result of my line numbers change. After a host function is 27277 called the stack does not get reset correctly. 27278 - Oddly this also appears to be a slight speedup on SunSpider. 27279 27280 * VM/Machine.cpp: 27281 (KJS::Machine::privateExecute): 27282 272832008-08-26 Alexey Proskuryakov <ap@webkit.org> 27284 27285 Reviewed by Geoff and Tim. 27286 27287 Export new API methods. 27288 27289 * JavaScriptCore.exp: 27290 272912008-08-25 Kevin McCullough <kmccullough@apple.com> 27292 27293 Reviewed by Geoff, Tim and Mark. 27294 27295 <rdar://problem/6150623> JSProfiler: It would be nice if the profiles 27296 in the console said what file and line number they came from 27297 - Lay the foundation for getting line numbers and other data from the 27298 JavaScript engine. With the cleanup in kjs/ExecState this is actually 27299 a slight performance improvement. 27300 27301 * JavaScriptCore.exp: Export retrieveLastCaller() for WebCore. 27302 * JavaScriptCore.xcodeproj/project.pbxproj: 27303 * VM/Machine.cpp: Now Host and JS functions set a call frame on the 27304 exec state, so this and the profiler code were pulled out of the 27305 branches. 27306 (KJS::Machine::privateExecute): 27307 (KJS::Machine::retrieveLastCaller): This get's the lineNumber, sourceID 27308 and sourceURL for the previously called function. 27309 * VM/Machine.h: 27310 * kjs/ExecState.cpp: Remove references to JSFunction since it's not used 27311 anywhere. 27312 * kjs/ExecState.h: 27313 273142008-08-25 Alexey Proskuryakov <ap@webkit.org> 27315 27316 Reviewed by Darin Adler. 27317 27318 Ensure that JSGlobalContextRelease() performs garbage collection, even if there are other 27319 contexts in the current context's group. 27320 27321 This is only really necessary when the last reference is released, but there is no way to 27322 determine that, and no harm in collecting slightly more often. 27323 27324 * API/JSContextRef.cpp: (JSGlobalContextRelease): Explicitly collect the heap if it is not 27325 being destroyed. 27326 273272008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27328 27329 Reviewed by Oliver Hunt. 27330 27331 Bug 20093: JSC shell does not clear exceptions after it executes toString on an expression 27332 <https://bugs.webkit.org/show_bug.cgi?id=20093> 27333 27334 Clear exceptions after evaluating any code in the JSC shell. We do not 27335 report exceptions that are caused by calling toString on the final 27336 valued, but at least we avoid incorrect behaviour. 27337 27338 Also, print any exceptions that occurred while evaluating code at the 27339 interactive prompt, not just while evaluating code from a file. 27340 27341 * kjs/Shell.cpp: 27342 (runWithScripts): 27343 (runInteractive): 27344 273452008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27346 27347 Reviewed by Oliver. 27348 27349 Remove an unnecessary RefPtr to a RegisterID. 27350 27351 * kjs/nodes.cpp: 27352 (KJS::DeleteBracketNode::emitCode): 27353 273542008-08-24 Mark Rowe <mrowe@apple.com> 27355 27356 Reviewed by Oliver Hunt. 27357 27358 Use the correct version number for when JSGlobalContextCreate was introduced. 27359 27360 * API/JSContextRef.h: 27361 273622008-08-23 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27363 27364 Rubber-stamped by Mark Rowe. 27365 27366 Remove modelines. 27367 27368 * API/APICast.h: 27369 * API/JSBase.cpp: 27370 * API/JSCallbackConstructor.cpp: 27371 * API/JSCallbackConstructor.h: 27372 * API/JSCallbackFunction.cpp: 27373 * API/JSCallbackFunction.h: 27374 * API/JSCallbackObject.cpp: 27375 * API/JSCallbackObject.h: 27376 * API/JSCallbackObjectFunctions.h: 27377 * API/JSClassRef.cpp: 27378 * API/JSContextRef.cpp: 27379 * API/JSObjectRef.cpp: 27380 * API/JSProfilerPrivate.cpp: 27381 * API/JSStringRef.cpp: 27382 * API/JSStringRefBSTR.cpp: 27383 * API/JSStringRefCF.cpp: 27384 * API/JSValueRef.cpp: 27385 * API/tests/JSNode.c: 27386 * API/tests/JSNode.h: 27387 * API/tests/JSNodeList.c: 27388 * API/tests/JSNodeList.h: 27389 * API/tests/Node.c: 27390 * API/tests/Node.h: 27391 * API/tests/NodeList.c: 27392 * API/tests/NodeList.h: 27393 * API/tests/minidom.c: 27394 * API/tests/minidom.js: 27395 * API/tests/testapi.c: 27396 * API/tests/testapi.js: 27397 * JavaScriptCore.pro: 27398 * kjs/FunctionConstructor.h: 27399 * kjs/FunctionPrototype.h: 27400 * kjs/JSArray.h: 27401 * kjs/JSString.h: 27402 * kjs/JSWrapperObject.cpp: 27403 * kjs/NumberConstructor.h: 27404 * kjs/NumberObject.h: 27405 * kjs/NumberPrototype.h: 27406 * kjs/lexer.h: 27407 * kjs/lookup.h: 27408 * wtf/Assertions.cpp: 27409 * wtf/Assertions.h: 27410 * wtf/HashCountedSet.h: 27411 * wtf/HashFunctions.h: 27412 * wtf/HashIterators.h: 27413 * wtf/HashMap.h: 27414 * wtf/HashSet.h: 27415 * wtf/HashTable.h: 27416 * wtf/HashTraits.h: 27417 * wtf/ListHashSet.h: 27418 * wtf/ListRefPtr.h: 27419 * wtf/Noncopyable.h: 27420 * wtf/OwnArrayPtr.h: 27421 * wtf/OwnPtr.h: 27422 * wtf/PassRefPtr.h: 27423 * wtf/Platform.h: 27424 * wtf/RefPtr.h: 27425 * wtf/RefPtrHashMap.h: 27426 * wtf/RetainPtr.h: 27427 * wtf/UnusedParam.h: 27428 * wtf/Vector.h: 27429 * wtf/VectorTraits.h: 27430 * wtf/unicode/Unicode.h: 27431 * wtf/unicode/icu/UnicodeIcu.h: 27432 274332008-08-22 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27434 27435 Reviewed by Oliver. 27436 27437 Some cleanup to match our coding style. 27438 27439 * VM/CodeGenerator.h: 27440 * VM/Machine.cpp: 27441 (KJS::Machine::privateExecute): 27442 * kjs/ExecState.cpp: 27443 * kjs/ExecState.h: 27444 * kjs/completion.h: 27445 * kjs/identifier.cpp: 27446 (KJS::Identifier::equal): 27447 (KJS::CStringTranslator::hash): 27448 (KJS::CStringTranslator::equal): 27449 (KJS::CStringTranslator::translate): 27450 (KJS::UCharBufferTranslator::equal): 27451 (KJS::UCharBufferTranslator::translate): 27452 (KJS::Identifier::remove): 27453 * kjs/operations.h: 27454 274552008-08-20 Alexey Proskuryakov <ap@webkit.org> 27456 27457 Windows build fix. 27458 27459 * API/WebKitAvailability.h: Define DEPRECATED_ATTRIBUTE. 27460 274612008-08-19 Alexey Proskuryakov <ap@webkit.org> 27462 27463 Reviewed by Geoff Garen. 27464 27465 Bring back shared JSGlobalData and implicit locking, because too many clients rely on it. 27466 27467 * kjs/JSGlobalData.cpp: 27468 (KJS::JSGlobalData::~JSGlobalData): 27469 (KJS::JSGlobalData::JSGlobalData): Re-add shared instance. 27470 (KJS::JSGlobalData::sharedInstanceExists): Ditto. 27471 (KJS::JSGlobalData::sharedInstance): Ditto. 27472 (KJS::JSGlobalData::sharedInstanceInternal): Ditto. 27473 27474 * API/JSContextRef.h: Deprecated JSGlobalContextCreate(). Added a very conservative 27475 description of its threading model (nothing is allowed). 27476 27477 * API/JSContextRef.cpp: 27478 (JSGlobalContextCreate): Use shared JSGlobalData. 27479 (JSGlobalContextCreateInGroup): Support passing NULL group to request a unique one. 27480 (JSGlobalContextRetain): Added back locking. 27481 (JSGlobalContextRelease): Ditto. 27482 (JSContextGetGlobalObject): Ditto. 27483 27484 * API/tests/minidom.c: (main): 27485 * API/tests/testapi.c: (main): 27486 Switched to JSGlobalContextCreateInGroup() to avoid deprecation warnings. 27487 27488 * JavaScriptCore.exp: Re-added JSLock methods. Added JSGlobalContextCreateInGroup (d'oh!). 27489 27490 * API/JSBase.cpp: 27491 (JSEvaluateScript): 27492 (JSCheckScriptSyntax): 27493 (JSGarbageCollect): 27494 * API/JSCallbackConstructor.cpp: 27495 (KJS::constructJSCallback): 27496 * API/JSCallbackFunction.cpp: 27497 (KJS::JSCallbackFunction::call): 27498 * API/JSCallbackObjectFunctions.h: 27499 (KJS::::init): 27500 (KJS::::getOwnPropertySlot): 27501 (KJS::::put): 27502 (KJS::::deleteProperty): 27503 (KJS::::construct): 27504 (KJS::::hasInstance): 27505 (KJS::::call): 27506 (KJS::::getPropertyNames): 27507 (KJS::::toNumber): 27508 (KJS::::toString): 27509 (KJS::::staticValueGetter): 27510 (KJS::::callbackGetter): 27511 * API/JSObjectRef.cpp: 27512 (JSObjectMake): 27513 (JSObjectMakeFunctionWithCallback): 27514 (JSObjectMakeConstructor): 27515 (JSObjectMakeFunction): 27516 (JSObjectHasProperty): 27517 (JSObjectGetProperty): 27518 (JSObjectSetProperty): 27519 (JSObjectGetPropertyAtIndex): 27520 (JSObjectSetPropertyAtIndex): 27521 (JSObjectDeleteProperty): 27522 (JSObjectCallAsFunction): 27523 (JSObjectCallAsConstructor): 27524 (JSObjectCopyPropertyNames): 27525 (JSPropertyNameArrayRelease): 27526 (JSPropertyNameAccumulatorAddName): 27527 * API/JSValueRef.cpp: 27528 (JSValueIsEqual): 27529 (JSValueIsInstanceOfConstructor): 27530 (JSValueMakeNumber): 27531 (JSValueMakeString): 27532 (JSValueToNumber): 27533 (JSValueToStringCopy): 27534 (JSValueToObject): 27535 (JSValueProtect): 27536 (JSValueUnprotect): 27537 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added. 27538 * GNUmakefile.am: 27539 * JavaScriptCore.pri: 27540 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 27541 * JavaScriptCore.xcodeproj/project.pbxproj: 27542 * JavaScriptCoreSources.bkl: 27543 * kjs/AllInOneFile.cpp: 27544 * kjs/JSGlobalData.h: 27545 * kjs/JSGlobalObject.cpp: 27546 (KJS::JSGlobalObject::~JSGlobalObject): 27547 (KJS::JSGlobalObject::init): 27548 * kjs/JSLock.cpp: Added. 27549 (KJS::createJSLockCount): 27550 (KJS::JSLock::lockCount): 27551 (KJS::setLockCount): 27552 (KJS::JSLock::JSLock): 27553 (KJS::JSLock::lock): 27554 (KJS::JSLock::unlock): 27555 (KJS::JSLock::currentThreadIsHoldingLock): 27556 (KJS::JSLock::DropAllLocks::DropAllLocks): 27557 (KJS::JSLock::DropAllLocks::~DropAllLocks): 27558 * kjs/JSLock.h: Added. 27559 (KJS::JSLock::JSLock): 27560 (KJS::JSLock::~JSLock): 27561 * kjs/Shell.cpp: 27562 (functionGC): 27563 (jscmain): 27564 * kjs/collector.cpp: 27565 (KJS::Heap::~Heap): 27566 (KJS::Heap::heapAllocate): 27567 (KJS::Heap::setGCProtectNeedsLocking): 27568 (KJS::Heap::protect): 27569 (KJS::Heap::unprotect): 27570 (KJS::Heap::collect): 27571 * kjs/identifier.cpp: 27572 * kjs/interpreter.cpp: 27573 (KJS::Interpreter::checkSyntax): 27574 (KJS::Interpreter::evaluate): 27575 Re-added implicit locking. 27576 275772008-08-19 Kevin McCullough <kmccullough@apple.com> 27578 27579 Reviewed by Tim and Mark. 27580 27581 Implement DTrace hooks for dashcode and instruments. 27582 27583 * API/JSProfilerPrivate.cpp: Added. Expose SPI so that profiling can be 27584 turned on from a client. The DTrace probes were added within the 27585 profiler mechanism for performance reasons so the profiler must be 27586 started to enable tracing. 27587 (JSStartProfiling): 27588 (JSEndProfiling): 27589 * API/JSProfilerPrivate.h: Added. Ditto. 27590 * JavaScriptCore.exp: Exposing the start/stop methods to clients. 27591 * JavaScriptCore.xcodeproj/project.pbxproj: 27592 * kjs/Tracing.d: Define the DTrace probes. 27593 * kjs/Tracing.h: Ditto. 27594 * profiler/ProfileGenerator.cpp: Implement the DTrace probes in the 27595 profiler. 27596 (KJS::ProfileGenerator::willExecute): 27597 (KJS::ProfileGenerator::didExecute): 27598 275992008-08-19 Steve Falkenburg <sfalken@apple.com> 27600 27601 Build fix. 27602 27603 * kjs/operations.cpp: 27604 (KJS::equal): 27605 276062008-08-18 Timothy Hatcher <timothy@apple.com> 27607 27608 Fix an assertion when generating a heavy profile because the 27609 empty value and deleted value of CallIdentifier where equal. 27610 27611 https://bugs.webkit.org/show_bug.cgi?id=20439 27612 27613 Reviewed by Dan Bernstein. 27614 27615 * profiler/CallIdentifier.h: Make the emptyValue for CallIdentifier 27616 use empty strings for URL and function name. 27617 276182008-08-12 Darin Adler <darin@apple.com> 27619 27620 Reviewed by Geoff. 27621 27622 - eliminate JSValue::type() 27623 27624 This will make it slightly easier to change the JSImmediate design without 27625 having to touch so many call sites. 27626 27627 SunSpider says this change is a wash (looked like a slight speedup, but not 27628 statistically significant). 27629 27630 * API/JSStringRef.cpp: Removed include of JSType.h. 27631 * API/JSValueRef.cpp: Removed include of JSType.h. 27632 (JSValueGetType): Replaced use of JSValue::type() with 27633 JSValue::is functions. 27634 27635 * JavaScriptCore.exp: Updated. 27636 27637 * VM/JSPropertyNameIterator.cpp: Removed type() implementation. 27638 (KJS::JSPropertyNameIterator::toPrimitive): Changed to take 27639 PreferredPrimitiveType argument instead of JSType. 27640 * VM/JSPropertyNameIterator.h: Ditto. 27641 27642 * VM/Machine.cpp: 27643 (KJS::fastIsNumber): Updated for name change. 27644 (KJS::fastToInt32): Ditto. 27645 (KJS::fastToUInt32): Ditto. 27646 (KJS::jsAddSlowCase): Updated toPrimitive caller for change from 27647 JSType to PreferredPrimitiveType. 27648 (KJS::jsAdd): Replaced calls to JSValue::type() with calls to 27649 JSValue::isString(). 27650 (KJS::jsTypeStringForValue): Replaced calls to JSValue::type() 27651 with multiple calls to JSValue::is -- we could make this a 27652 virtual function instead if we want to have faster performance. 27653 (KJS::Machine::privateExecute): Renamed JSImmediate::toTruncatedUInt32 27654 to JSImmediate::getTruncatedUInt32 for consistency with other functions. 27655 Changed two calls of JSValue::type() to JSValue::isString(). 27656 27657 * kjs/GetterSetter.cpp: 27658 (KJS::GetterSetter::toPrimitive): Changed to take 27659 PreferredPrimitiveType argument instead of JSType. 27660 (KJS::GetterSetter::isGetterSetter): Added. 27661 * kjs/GetterSetter.h: 27662 27663 * kjs/JSCell.cpp: 27664 (KJS::JSCell::isString): Added. 27665 (KJS::JSCell::isGetterSetter): Added. 27666 (KJS::JSCell::isObject): Added. 27667 27668 * kjs/JSCell.h: Eliminated type function. Added isGetterSetter. 27669 Made isString and isObject virtual. Changed toPrimitive to take 27670 PreferredPrimitiveType argument instead of JSType. 27671 (KJS::JSCell::isNumber): Use Heap::isNumber for faster performance. 27672 (KJS::JSValue::isGetterSetter): Added. 27673 (KJS::JSValue::toPrimitive): Changed to take 27674 PreferredPrimitiveType argument instead of JSType. 27675 27676 * kjs/JSImmediate.h: Removed JSValue::type() and replaced 27677 JSValue::toTruncatedUInt32 with JSValue::getTruncatedUInt32. 27678 (KJS::JSImmediate::isEitherImmediate): Added. 27679 27680 * kjs/JSNotAnObject.cpp: 27681 (KJS::JSNotAnObject::toPrimitive): Changed to take 27682 PreferredPrimitiveType argument instead of JSType. 27683 * kjs/JSNotAnObject.h: Ditto. 27684 * kjs/JSNumberCell.cpp: 27685 (KJS::JSNumberCell::toPrimitive): Ditto. 27686 * kjs/JSNumberCell.h: 27687 (KJS::JSNumberCell::toInt32): Renamed from fastToInt32. There's no 27688 other "slow" version of this once you have a JSNumberCell, so there's 27689 no need for "fast" in the name. It's a feature that this hides the 27690 base class toInt32, which does the same job less efficiently (and has 27691 an additional ExecState argument). 27692 (KJS::JSNumberCell::toUInt32): Ditto. 27693 27694 * kjs/JSObject.cpp: 27695 (KJS::callDefaultValueFunction): Use isGetterSetter instead of type. 27696 (KJS::JSObject::getPrimitiveNumber): Use PreferredPrimitiveType. 27697 (KJS::JSObject::defaultValue): Ditto. 27698 (KJS::JSObject::defineGetter): Use isGetterSetter. 27699 (KJS::JSObject::defineSetter): Ditto. 27700 (KJS::JSObject::lookupGetter): Ditto. 27701 (KJS::JSObject::lookupSetter): Ditto. 27702 (KJS::JSObject::toNumber): Use PreferredPrimitiveType. 27703 (KJS::JSObject::toString): Ditto. 27704 (KJS::JSObject::isObject): Added. 27705 27706 * kjs/JSObject.h: 27707 (KJS::JSObject::inherits): Call the isObject from JSCell; it's now 27708 hidden by our override of isObject. 27709 (KJS::JSObject::getOwnPropertySlotForWrite): Use isGetterSetter 27710 instead of type. 27711 (KJS::JSObject::getOwnPropertySlot): Ditto. 27712 (KJS::JSObject::toPrimitive): Use PreferredPrimitiveType. 27713 27714 * kjs/JSString.cpp: 27715 (KJS::JSString::toPrimitive): Use PreferredPrimitiveType. 27716 (KJS::JSString::isString): Added. 27717 * kjs/JSString.h: Ditto. 27718 27719 * kjs/JSValue.h: Removed type(), added isGetterSetter(). Added 27720 PreferredPrimitiveType enum and used it as the argument for the 27721 toPrimitive function. 27722 (KJS::JSValue::getBoolean): Simplified a bit an removed a branch. 27723 27724 * kjs/collector.cpp: 27725 (KJS::typeName): Changed to use JSCell::is functions instead of 27726 calling JSCell::type. 27727 27728 * kjs/collector.h: 27729 (KJS::Heap::isNumber): Renamed from fastIsNumber. 27730 27731 * kjs/nodes.h: Added now-needed include of JSType, since the type 27732 is used here to record types of values in the tree. 27733 27734 * kjs/operations.cpp: 27735 (KJS::equal): Rewrote to no longer depend on type(). 27736 (KJS::strictEqual): Ditto. 27737 277382008-08-18 Kevin McCullough <kmccullough@apple.com> 27739 27740 Reviewed by Tim. 27741 27742 If there are no nodes in a profile all the time should be attributed to 27743 (idle) 27744 27745 * profiler/Profile.cpp: If ther are no nodes make sure we still process 27746 the head. 27747 (KJS::Profile::forEach): 27748 * profiler/ProfileGenerator.cpp: Remove some useless code. 27749 (KJS::ProfileGenerator::stopProfiling): 27750 277512008-08-18 Alexey Proskuryakov <ap@webkit.org> 27752 27753 Reviewed by Maciej. 27754 27755 Make JSGlobalContextRetain/Release actually work. 27756 27757 * API/JSContextRef.cpp: 27758 (JSGlobalContextRetain): 27759 (JSGlobalContextRelease): 27760 Ref/deref global data to give checking for globalData.refCount() some sense. 27761 27762 * API/tests/testapi.c: (main): Added a test for this bug. 27763 27764 * kjs/JSGlobalData.cpp: 27765 (KJS::JSGlobalData::~JSGlobalData): 27766 While checking for memory leaks, found that JSGlobalData::emptyList has changed to 27767 a pointer, but it was not destructed, causing a huge leak in run-webkit-tests --threaded. 27768 277692008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27770 27771 Reviewed by Maciej. 27772 27773 Change the counting of constants so that preincrement and predecrement of 27774 const local variables are considered unexpected loads. 27775 27776 * kjs/nodes.cpp: 27777 (KJS::PrefixResolveNode::emitCode): 27778 * kjs/nodes.h: 27779 (KJS::ScopeNode::neededConstants): 27780 277812008-08-17 Oliver Hunt <oliver@apple.com> 27782 27783 Reviewed by Cameron Zwarich. 27784 27785 <rdar://problem/6150322> In Gmail, a crash occurs at KJS::Machine::privateExecute() when applying list styling to text after a quote had been removed 27786 <https://bugs.webkit.org/show_bug.cgi?id=20386> 27787 27788 This crash was caused by "depth()" incorrectly determining the scope depth 27789 of a 0 depth function without a full scope chain. Because such a function 27790 would not have an activation the depth function would return the scope depth 27791 of the parent frame, thus triggering an incorrect unwind. Any subsequent 27792 look up that walked the scope chain would result in incorrect behaviour, 27793 leading to a crash or incorrect variable resolution. This can only actually 27794 happen in try...finally statements as that's the only path that can result in 27795 the need to unwind the scope chain, but not force the function to need a 27796 full scope chain. 27797 27798 The fix is simply to check for this case before attempting to walk the scope chain. 27799 27800 * VM/Machine.cpp: 27801 (KJS::depth): 27802 (KJS::Machine::throwException): 27803 278042008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27805 27806 Reviewed by Maciej. 27807 27808 Bug 20419: Remove op_jless 27809 <https://bugs.webkit.org/show_bug.cgi?id=20419> 27810 27811 Remove op_jless, which is rarely used now that we have op_loop_if_less. 27812 27813 * VM/CodeBlock.cpp: 27814 (KJS::CodeBlock::dump): 27815 * VM/CodeGenerator.cpp: 27816 (KJS::CodeGenerator::emitJumpIfTrue): 27817 * VM/Machine.cpp: 27818 (KJS::Machine::privateExecute): 27819 * VM/Opcode.h: 27820 278212008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> 27822 27823 Reviewed by Dan Bernstein. 27824 27825 Fix a typo in r35807 that is also causing build failures for 27826 non-AllInOne builds. 27827 27828 * kjs/NumberConstructor.cpp: 27829 278302008-08-17 Geoffrey Garen <ggaren@apple.com> 27831 27832 Reviewed by Cameron Zwarich. 27833 27834 Made room for a free word in JSCell. 27835 27836 SunSpider says no change. 27837 27838 I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to 27839 store auxiliary data in a secondary structure. 27840 27841 I changed InternalFunction to store the function's name in the property 27842 map. 27843 27844 I changed JSGlobalObjectData to use a virtual destructor, so WebCore's 27845 JSDOMWindowBaseData could inherit from it safely. (It's a strange design 27846 for JSDOMWindowBase to allocate an object that JSGlobalObject deletes, 27847 but that's really our only option, given the size constraint.) 27848 27849 I also added a bunch of compile-time ASSERTs, and removed lots of comments 27850 in JSObject.h because they were often out of date, and they got in the 27851 way of reading what was actually going on. 27852 27853 Also renamed JSArray::getLength to JSArray::length, to match our style 27854 guidelines. 27855 278562008-08-16 Geoffrey Garen <ggaren@apple.com> 27857 27858 Reviewed by Oliver Hunt. 27859 27860 Sped up property access for array.length and string.length by adding a 27861 mechanism for returning a temporary value directly instead of returning 27862 a pointer to a function that retrieves the value. 27863 27864 Also removed some unused cruft from PropertySlot. 27865 27866 SunSpider says 0.5% - 1.2% faster. 27867 27868 NOTE: This optimization is not a good idea in general, because it's 27869 actually a pessimization in the case of resolve for assignment, 27870 and it may get in the way of other optimizations in the future. 27871 278722008-08-16 Dan Bernstein <mitz@apple.com> 27873 27874 Reviewed by Geoffrey Garen. 27875 27876 Disable dead code stripping in debug builds. 27877 27878 * Configurations/Base.xcconfig: 27879 * JavaScriptCore.xcodeproj/project.pbxproj: 27880 278812008-08-15 Mark Rowe <mrowe@apple.com> 27882 27883 Reviewed by Oliver Hunt. 27884 27885 <rdar://problem/6143072> FastMallocZone's enumeration code makes assumptions about handling of remote memory regions that overlap 27886 27887 * wtf/FastMalloc.cpp: 27888 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Don't directly compare pointers mapped into the local process with 27889 a pointer that has not been mapped. Instead, calculate a local address for the pointer and compare with that. 27890 (WTF::TCMallocStats::FreeObjectFinder::findFreeObjects): Pass in the remote address of the central free list so that it can 27891 be used when calculating local addresses. 27892 (WTF::TCMallocStats::FastMallocZone::enumerate): Ditto. 27893 278942008-08-15 Mark Rowe <mrowe@apple.com> 27895 27896 Rubber-stamped by Geoff Garen. 27897 27898 <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework 27899 27900 * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared 27901 between the Debug configuration and debug Production variant. 27902 * JavaScriptCore.xcodeproj/project.pbxproj: Enable the debug variant. 27903 279042008-08-15 Mark Rowe <mrowe@apple.com> 27905 27906 Fix the 64-bit build. 27907 27908 Add extra cast to avoid warnings about loss of precision when casting from 27909 JSValue* to an integer type. 27910 27911 * kjs/JSImmediate.h: 27912 (KJS::JSImmediate::intValue): 27913 (KJS::JSImmediate::uintValue): 27914 279152008-08-15 Alexey Proskuryakov <ap@webkit.org> 27916 27917 Still fixing Windows build. 27918 27919 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added OpaqueJSString 27920 to yet another place. 27921 279222008-08-15 Alexey Proskuryakov <ap@webkit.org> 27923 27924 Trying to fix non-Apple builds. 27925 27926 * ForwardingHeaders/JavaScriptCore/OpaqueJSString.h: Added. 27927 279282008-08-15 Gavin Barraclough <barraclough@apple.com> 27929 27930 Reviewed by Geoff Garen. 27931 27932 Allow JSImmediate to hold 31 bit signed integer immediate values. The low two bits of a 27933 JSValue* are a tag, with the tag value 00 indicating the JSValue* is a pointer to a 27934 JSCell. Non-zero tag values used to indicate that the JSValue* is not a real pointer, 27935 but instead holds an immediate value encoded within the pointer. This patch changes the 27936 encoding so both the tag values 01 and 11 indicate the value is a signed integer, allowing 27937 a 31 bit value to be stored. All other immediates are tagged with the value 10, and 27938 distinguished by a secondary tag. 27939 27940 Roughly +2% on SunSpider. 27941 27942 * kjs/JSImmediate.h: Encoding of JSImmediates has changed - see comment at head of file for 27943 descption of new layout. 27944 279452008-08-15 Alexey Proskuryakov <ap@webkit.org> 27946 27947 More build fixes. 27948 27949 * API/OpaqueJSString.h: Add a namespace to friend declaration to appease MSVC. 27950 * API/JSStringRefCF.h: (JSStringCreateWithCFString) Cast UniChar* to UChar* explicitly. 27951 * JavaScriptCore.exp: Added OpaqueJSString::create(const KJS::UString&) to fix WebCore build. 27952 279532008-08-15 Alexey Proskuryakov <ap@webkit.org> 27954 27955 Build fix. 27956 27957 * JavaScriptCore.xcodeproj/project.pbxproj: Marked OpaqueJSString as private 27958 27959 * kjs/identifier.cpp: 27960 (KJS::Identifier::checkSameIdentifierTable): 27961 * kjs/identifier.h: 27962 (KJS::Identifier::add): 27963 Since checkSameIdentifierTable is exported for debug build's sake, gcc wants it to be 27964 non-inline in release builds, too. 27965 27966 * JavaScriptCore.exp: Don't export inline OpaqueJSString destructor. 27967 279682008-08-15 Alexey Proskuryakov <ap@webkit.org> 27969 27970 Reviewed by Geoff Garen. 27971 27972 JSStringRef is created context-free, but can get linked to one via an identifier table, 27973 breaking an implicit API contract. 27974 27975 Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString. 27976 27977 * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a 27978 simple typecast. 27979 27980 * kjs/identifier.cpp: 27981 (KJS::Identifier::checkSameIdentifierTable): 27982 * kjs/identifier.h: 27983 (KJS::Identifier::add): 27984 (KJS::UString::checkSameIdentifierTable): 27985 Added assertions to verify that an identifier is not being added to a different JSGlobalData. 27986 27987 * API/JSObjectRef.cpp: 27988 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to 27989 hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance 27990 in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast. 27991 27992 * API/OpaqueJSString.cpp: Added. 27993 (OpaqueJSString::create): 27994 (OpaqueJSString::ustring): 27995 (OpaqueJSString::identifier): 27996 * API/OpaqueJSString.h: Added. 27997 (OpaqueJSString::create): 27998 (OpaqueJSString::characters): 27999 (OpaqueJSString::length): 28000 (OpaqueJSString::OpaqueJSString): 28001 (OpaqueJSString::~OpaqueJSString): 28002 28003 * API/JSBase.cpp: 28004 (JSEvaluateScript): 28005 (JSCheckScriptSyntax): 28006 * API/JSCallbackObjectFunctions.h: 28007 (KJS::::getOwnPropertySlot): 28008 (KJS::::put): 28009 (KJS::::deleteProperty): 28010 (KJS::::staticValueGetter): 28011 (KJS::::callbackGetter): 28012 * API/JSStringRef.cpp: 28013 (JSStringCreateWithCharacters): 28014 (JSStringCreateWithUTF8CString): 28015 (JSStringRetain): 28016 (JSStringRelease): 28017 (JSStringGetLength): 28018 (JSStringGetCharactersPtr): 28019 (JSStringGetMaximumUTF8CStringSize): 28020 (JSStringGetUTF8CString): 28021 (JSStringIsEqual): 28022 * API/JSStringRefCF.cpp: 28023 (JSStringCreateWithCFString): 28024 (JSStringCopyCFString): 28025 * API/JSValueRef.cpp: 28026 (JSValueMakeString): 28027 (JSValueToStringCopy): 28028 Updated to use OpaqueJSString. 28029 28030 * GNUmakefile.am: 28031 * JavaScriptCore.exp: 28032 * JavaScriptCore.pri: 28033 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 28034 * JavaScriptCore.xcodeproj/project.pbxproj: 28035 * JavaScriptCoreSources.bkl: 28036 Added OpaqueJSString. 28037 280382008-08-14 Kevin McCullough <kmccullough@apple.com> 28039 28040 Reviewed by Tim. 28041 28042 <rdar://problem/6115819> Notify of profile in console 28043 - Profiles now have a unique ID so that they can be linked to the 28044 console message that announces that a profile completed. 28045 28046 * profiler/HeavyProfile.cpp: 28047 (KJS::HeavyProfile::HeavyProfile): 28048 * profiler/Profile.cpp: 28049 (KJS::Profile::create): 28050 (KJS::Profile::Profile): 28051 * profiler/Profile.h: 28052 (KJS::Profile::uid): 28053 * profiler/ProfileGenerator.cpp: 28054 (KJS::ProfileGenerator::create): 28055 (KJS::ProfileGenerator::ProfileGenerator): 28056 * profiler/ProfileGenerator.h: 28057 * profiler/Profiler.cpp: 28058 (KJS::Profiler::startProfiling): 28059 * profiler/TreeProfile.cpp: 28060 (KJS::TreeProfile::create): 28061 (KJS::TreeProfile::TreeProfile): 28062 * profiler/TreeProfile.h: 28063 280642008-08-13 Geoffrey Garen <ggaren@apple.com> 28065 28066 Reviewed by Oliver Hunt. 28067 28068 Nixed a PIC branch from JSObject::getOwnPropertySlot, by forcing 28069 fillGetterProperty, which references a global function pointer, 28070 out-of-line. 28071 28072 .2% SunSpider speedup, 4.3% access-nbody speedup, 8.7% speedup on a 28073 custom property access benchmark for objects with one property. 28074 28075 * kjs/JSObject.cpp: 28076 (KJS::JSObject::fillGetterPropertySlot): 28077 280782008-08-13 Alp Toker <alp@nuanti.com> 28079 28080 Reviewed by Eric Seidel. 28081 28082 https://bugs.webkit.org/show_bug.cgi?id=20349 28083 WTF::initializeThreading() fails if threading is already initialized 28084 28085 Fix threading initialization logic to support cases where 28086 g_thread_init() has already been called elsewhere. 28087 28088 Resolves database-related crashers reported in several applications. 28089 28090 * wtf/ThreadingGtk.cpp: 28091 (WTF::initializeThreading): 28092 280932008-08-13 Brad Hughes <bhughes@trolltech.com> 28094 28095 Reviewed by Simon. 28096 28097 Fix compiling of QtWebKit in release mode with the Intel C++ Compiler for Linux 28098 28099 The latest upgrade of the intel compiler allows us to compile all of 28100 Qt with optimizations enabled (yay!). 28101 28102 * JavaScriptCore.pro: 28103 281042008-08-12 Oliver Hunt <oliver@apple.com> 28105 28106 Reviewed by Geoff Garen. 28107 28108 Add peephole optimisation to 'op_not... jfalse...' (eg. if(!...) ) 28109 28110 This is a very slight win in sunspider, and a fairly substantial win 28111 in hot code that does if(!...), etc. 28112 28113 * VM/CodeGenerator.cpp: 28114 (KJS::CodeGenerator::retrieveLastUnaryOp): 28115 (KJS::CodeGenerator::rewindBinaryOp): 28116 (KJS::CodeGenerator::rewindUnaryOp): 28117 (KJS::CodeGenerator::emitJumpIfFalse): 28118 * VM/CodeGenerator.h: 28119 281202008-08-12 Dan Bernstein <mitz@apple.com> 28121 28122 - JavaScriptCore part of <rdar://problem/6121636> 28123 Make fast*alloc() abort() on failure and add "try" variants that 28124 return NULL on failure. 28125 28126 Reviewed by Darin Adler. 28127 28128 * JavaScriptCore.exp: Exported tryFastCalloc(). 28129 * VM/RegisterFile.h: 28130 (KJS::RegisterFile::RegisterFile): Removed an ASSERT(). 28131 * kjs/JSArray.cpp: 28132 (KJS::JSArray::putSlowCase): Changed to use tryFastRealloc(). 28133 (KJS::JSArray::increaseVectorLength): Ditto. 28134 * kjs/ustring.cpp: 28135 (KJS::allocChars): Changed to use tryFastMalloc(). 28136 (KJS::reallocChars): Changed to use tryFastRealloc(). 28137 * wtf/FastMalloc.cpp: 28138 (WTF::fastZeroedMalloc): Removed null checking of fastMalloc()'s result 28139 and removed extra call to InvokeNewHook(). 28140 (WTF::tryFastZeroedMalloc): Added. Uses tryFastMalloc(). 28141 (WTF::tryFastMalloc): Renamed fastMalloc() to this. 28142 (WTF::fastMalloc): Added. This version abort()s if allocation fails. 28143 (WTF::tryFastCalloc): Renamed fastCalloc() to this. 28144 (WTF::fastCalloc): Added. This version abort()s if allocation fails. 28145 (WTF::tryFastRealloc): Renamed fastRealloc() to this. 28146 (WTF::fastRealloc): Added. This version abort()s if allocation fails. 28147 (WTF::do_malloc): Made this a function template. When the abortOnFailure 28148 template parameter is set, the function abort()s on failure to allocate. 28149 Otherwise, it sets errno to ENOMEM and returns zero. 28150 (WTF::TCMallocStats::fastMalloc): Defined to abort() on failure. 28151 (WTF::TCMallocStats::tryFastMalloc): Added. Does not abort() on 28152 failure. 28153 (WTF::TCMallocStats::fastCalloc): Defined to abort() on failure. 28154 (WTF::TCMallocStats::tryFastCalloc): Added. Does not abort() on 28155 failure. 28156 (WTF::TCMallocStats::fastRealloc): Defined to abort() on failure. 28157 (WTF::TCMallocStats::tryFastRealloc): Added. Does not abort() on 28158 failure. 28159 * wtf/FastMalloc.h: Declared the "try" variants. 28160 281612008-08-11 Adam Roben <aroben@apple.com> 28162 28163 Move WTF::notFound into its own header so that it can be used 28164 independently of Vector 28165 28166 Rubberstamped by Darin Adler. 28167 28168 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 28169 * JavaScriptCore.xcodeproj/project.pbxproj: 28170 Added NotFound.h to the project. 28171 * wtf/NotFound.h: Added. Moved the notFound constant here... 28172 * wtf/Vector.h: ...from here. 28173 281742008-08-11 Alexey Proskuryakov <ap@webkit.org> 28175 28176 Reviewed by Mark Rowe. 28177 28178 <rdar://problem/6130393> REGRESSION: PhotoBooth hangs after launching under TOT Webkit 28179 28180 * API/JSContextRef.cpp: (JSGlobalContextRelease): Corrected a comment. 28181 28182 * kjs/collector.cpp: (KJS::Heap::~Heap): Ensure that JSGlobalData is not deleted while 28183 sweeping the heap. 28184 28185== Rolled over to ChangeLog-2008-08-10 == 28186