ChangeLog 180 KB
Newer Older
1 2 3 4 5 6
2007-11-11  Mark Rowe  <mrowe@apple.com>

        Build fix.  Use the correct filename case.

        * kjs/nodes.h:

ggaren@apple.com's avatar
ggaren@apple.com committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
2007-11-11  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=15902
        15% of string-validate-input.js is spent compiling the same regular expression
        
        Store a compiled representation of the regular expression in the AST.
        
        Only a .2% SunSpider speedup overall, but a 10.6% speedup on 
        string-validate-input.js.

        * kjs/nodes.cpp:
        (KJS::RegExpNode::evaluate):
        * kjs/nodes.h:
        (KJS::RegExpNode::):
        * kjs/nodes2string.cpp:
        (KJS::RegExpNode::streamTo):
        * kjs/regexp.cpp:
        (KJS::RegExp::flags):
        * kjs/regexp.h:
        (KJS::RegExp::pattern):
        * kjs/regexp_object.cpp:
        (KJS::RegExpObjectImp::construct):
        (KJS::RegExpObjectImp::createRegExpImp):
        * kjs/regexp_object.h:

34 35 36 37 38 39 40 41 42 43
2007-11-11  Oliver Hunt  <oliver@apple.com>

        Reviewed by Eric.

        Partial fix for <rdar://problem/5585334> numfuzz: integer overflows opening malformed SVG file in WebCore::ImageBuffer::create

        Unfortunately this is a very slight regression, but is unavoidable.

        * wtf/FastMalloc.cpp:

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
2007-11-10  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.
        
        Add simple type inferencing to the parser, and create custom
        AddNode and LessNode subclasses based on inferred types.
        http://bugs.webkit.org/show_bug.cgi?id=15884
        
        SunSpider claims this is at least a 0.5% speedup.

        * JavaScriptCore.exp:
        * kjs/grammar.y:
        * kjs/internal.cpp:
        (KJS::NumberImp::getPrimitiveNumber):
        (KJS::GetterSetterImp::getPrimitiveNumber):
        * kjs/internal.h:
        * kjs/lexer.cpp:
        (KJS::Lexer::lex):
        * kjs/nodes.cpp:
        (KJS::Node::Node):
        (KJS::StringNode::evaluate):
        (KJS::StringNode::evaluateToNumber):
        (KJS::StringNode::evaluateToBoolean):
        (KJS::RegExpNode::evaluate):
        (KJS::UnaryPlusNode::optimizeVariableAccess):
        (KJS::AddNode::evaluate):
        (KJS::AddNode::evaluateToNumber):
        (KJS::AddNumbersNode::inlineEvaluateToNumber):
        (KJS::AddNumbersNode::evaluate):
        (KJS::AddNumbersNode::evaluateToNumber):
        (KJS::AddStringsNode::evaluate):
        (KJS::AddStringLeftNode::evaluate):
        (KJS::AddStringRightNode::evaluate):
        (KJS::lessThan):
        (KJS::lessThanEq):
        (KJS::LessNumbersNode::evaluate):
        (KJS::LessStringsNode::evaluate):
        * kjs/nodes.h:
        (KJS::ExpressionNode::):
        (KJS::RegExpNode::):
        (KJS::RegExpNode::precedence):
        (KJS::TypeOfResolveNode::):
        (KJS::LocalVarTypeOfNode::):
        (KJS::UnaryPlusNode::):
        (KJS::UnaryPlusNode::precedence):
        (KJS::AddNode::):
        (KJS::AddNode::precedence):
        (KJS::AddNumbersNode::):
        (KJS::AddStringLeftNode::):
        (KJS::AddStringRightNode::):
        (KJS::AddStringsNode::):
        (KJS::LessNode::):
        (KJS::LessNode::precedence):
        (KJS::LessNumbersNode::):
        (KJS::LessStringsNode::):
        * kjs/nodes2string.cpp:
        (KJS::StringNode::streamTo):
        * kjs/object.cpp:
        * kjs/object.h:
        * kjs/value.h:
        (KJS::JSValue::getPrimitiveNumber):

106 107 108 109 110 111 112 113 114 115 116 117
2007-11-11  Darin Adler  <darin@apple.com>

        - try another way of fixing dftables builds -- refactor pcre_internal.h a bit

        * pcre/pcre_internal.h: Make most of this header do nothing when DFTABLES is set.
        Later we can break it into two files.

        * JavaScriptCore.vcproj/dftables/dftables.vcproj: Take out now-unneeded include paths.
        * pcre/dftables.cpp: Set DFTABLES. Use delete instead of free.
        * pcre/dftables.pro: Take out now-unneeded include paths.
        * pcre/pcre_maketables.cpp: Use new instead of malloc.

118 119 120 121 122
2007-11-11  Darin Adler  <darin@apple.com>

        * pcre/dftables.pro: Try fixing Qt builds (I looked at qt-win) by adding
        another include path.

123 124 125 126 127
2007-11-11  Darin Adler  <darin@apple.com>

        * JavaScriptCore.xcodeproj/project.pbxproj: Try fixing Mac Tiger builds
        by adding another include path.

darin@apple.com's avatar
darin@apple.com committed
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
2007-11-11  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - http://bugs.webkit.org/show_bug.cgi?id=15924
          next round of changes to JSRegExp (formerly PCRE)

        This is a combination of converting to C++, tweaking the API, and adding
        some additional optimizations.

        Future steps will involve getting rid of the use of UTF-8 completely
        (we'll use UTF-16 exclusively instead), eliminating more source files,
        and some more speed-ups.

        SunSpider says the current round is an 0.9% speed-up overall, and a
        5.3% speed-up for regexp.

        * JavaScriptCore.exp: Updated for new entry points.

        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.vcproj/dftables/dftables.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * jscore.bkl:
        Updated for new source file names and ForwardingHeaders.

        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp): Changed to use the error message without calling
        strdup on it and to pass the new types and options.
        (KJS::RegExp::~RegExp): Removed the now-unneeded free of the error message.
        (KJS::RegExp::match): Pass the new types and options.
        * kjs/regexp.h: Update type of m_constructionError.

        * pcre/AUTHORS: Update to reflect the status of the project -- we don't include
        the Google parts, and this isn't the PCRE library, per se.
        * pcre/COPYING: Ditto.

        * pcre/dftables.cpp: Copied from JavaScriptCore/pcre/dftables.c.
        (main): Removed unneeded ctype_digit.

        * pcre/pcre.h: Convert to C++, tweak API a bit. Use UChar instead of JSRegExpChar.

        * pcre/pcre_compile.cpp: Copied from JavaScriptCore/pcre/pcre_compile.c.
        Moved a lot of private stuff used only within this file here from pcre_internal.h.
        Renumbered the error codes.
        (error_text): Use a single string with embedded nulls for the error text (I got
        this idea from newer versions of PCRE).
        (check_escape): Changed return type to be enum instead of int. Replaced ctype_digit
        uses with isASCIIDigit.
        (is_counted_repeat): Ditto.
        (read_repeat_counts): Ditto.
        (first_significant_code): Ditto.
        (find_fixedlength): Ditto.
        (could_be_empty_branch): Ditto.
        (compile_branch): Ditto. Also removed some code that handles changing options.
        JavaScript doesn't have any of the features that allow options to change.
        (compile_regex): Updated for change to options parameter.
        (is_anchored): Ditto.
        (find_firstassertedchar): Ditto.
        (jsRegExpCompile): Changed to take separate flags instead of an options int.
        Also changed to call new/delete instead of pcre_malloc/free.
        (jsRegExpFree): Ditto.

        * pcre/pcre_exec.cpp: Copied from JavaScriptCore/pcre/pcre_exec.c.
        Added a case that uses computed goto for the opcode loop, but did not turn it on.
        Changed the RMATCH macro to handle returns more efficiently by putting the where
        pointer in the new frame instead of the old one, allowing us to branch to the
        return with a single statement. Switched to new/delete from pcre_malloc/free.
        Changed many RRETURN callers to not set the return value since it's already
        set correctly. Replaced the rrc variable with an is_match variable. Values other
        than "match" and "no match" are now handled differently. This allows us to remove
        the code to check for those cases in various rules.
        (match): All the case statements use a macro BEGIN_OPCODE instead. And all the
        continue statements, or break statements that break out of the outer case use
        a macro NEXT_OPCODE instead. Replaced a few if statements with assertions.
        (jsRegExpExecute): Use new/delete instead of pcre_malloc/free. Removed unused
        start_match field from the match block.

        * pcre/pcre_internal.h: Moved the last few configuration macros from pcre-config.h
        in here. Removed various unused types. Converted from JSRegExpChar to UChar.
        Eliminated pcre_malloc/free. Replaced the opcode enum with a macro that can be
        used in multiple places. Unfortunately we lose the comments for each opcode; we
        should find a place to put those back. Removed ctype_digit.

        * pcre/pcre_maketables.cpp: Copied from JavaScriptCore/pcre/pcre_maketables.c.
        (pcre_maketables): Got rid of the conditional code that allows this to be compiled
        in -- it's only used for dftables now (and soon may be obsolete entirely).
        Changed code for cbit_digit to not use isdigit, and took the "_" case out of the
        loop. Removed ctype_digit.

        * pcre/pcre_ord2utf8.cpp: Copied from JavaScriptCore/pcre/pcre_ord2utf8.c.

        * pcre/pcre_tables.cpp: Copied from JavaScriptCore/pcre/pcre_tables.c.
        Moved _pcre_OP_lengths out of here into pcre_exec.cpp.

        * pcre/pcre_ucp_searchfuncs.cpp: Copied from JavaScriptCore/pcre/pcre_ucp_searchfuncs.c.
        Updated for other file name changes.

        * pcre/pcre_xclass.cpp: Copied from JavaScriptCore/pcre/pcre_xclass.c.

        * pcre/ucpinternal.h: Updated header.

        * pcre/ucptable.cpp: Copied from JavaScriptCore/pcre/ucptable.c.

        * wtf/ASCIICType.h: (WTF::isASCIIDigit): Removed a branch by changing from && to
        & for this operation. Also added an overload that takes an int because that's
        useful for PCRE. Later we could optimize for int and overload other functions in
        this file; stuck to this simple one for now.

        * wtf/unicode/icu/UnicodeIcu.h: Removed unused isUpper.
        * wtf/unicode/qt4/UnicodeQt4.h: Ditto.

        * pcre/LICENCE: Removed.
        * pcre/pcre-config.h: Removed.
        * wtf/FastMallocPCRE.cpp: Removed.

        * pcre/dftables.c: Renamed to cpp.
        * pcre/pcre_compile.c: Ditto.
        * pcre/pcre_exec.c: Ditto.
        * pcre/pcre_maketables.c: Ditto.
        * pcre/pcre_ord2utf8.c: Ditto.
        * pcre/pcre_tables.c: Ditto.
        * pcre/pcre_ucp_searchfuncs.c: Ditto.
        * pcre/pcre_xclass.c: Ditto.
        * pcre/ucptable.c: Ditto.

255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
2007-11-11  Eric Seidel  <eric@webkit.org>

        Reviewed by Oliver.

        Add KJS_CHECKEXCEPTIONBOOLEAN to match rest of nodes.cpp

        * kjs/nodes.cpp:
        (KJS::ExpressionNode::evaluateToBoolean):
        (KJS::LessNode::evaluateToBoolean):
        (KJS::GreaterNode::evaluateToBoolean):
        (KJS::LessEqNode::evaluateToBoolean):
        (KJS::GreaterEqNode::evaluateToBoolean):
        (KJS::InstanceOfNode::evaluateToBoolean):
        (KJS::InNode::evaluateToBoolean):
        (KJS::EqualNode::evaluateToBoolean):
        (KJS::NotEqualNode::evaluateToBoolean):
        (KJS::StrictEqualNode::evaluateToBoolean):
        (KJS::NotStrictEqualNode::evaluateToBoolean):
        (KJS::LogicalAndNode::evaluateToBoolean):
        (KJS::LogicalOrNode::evaluateToBoolean):
        (KJS::ConditionalNode::evaluateToBoolean):

darin@apple.com's avatar
darin@apple.com committed
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
2007-11-10  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15927
          REGRESSION(r27487): delete a.c followed by __defineGetter__("c", ...) incorrectly deletes another property
          and <rdar://problem/5586384> REGRESSION (r27487): Can't switch out of Edit HTML Source mode on Leopard Wiki

        Test: fast/js/delete-then-put.html

        * kjs/property_map.cpp:
        (KJS::PropertyMap::put): Added a missing "- 1"; code to find an empty slot was not working.
        (KJS::PropertyMap::checkConsistency): Added a missing range check that would have caught this
        problem before.

        - roll out a last-minute change to my evaluateToBoolean patch that was incorrect.

        * kjs/nodes.h: (KJS::ExprStatementNode::ExprStatementNode): Take out call to
        optimizeForUnnecessaryResult, since the result is used in some cases.

aroben@apple.com's avatar
aroben@apple.com committed
297 298 299 300 301 302 303 304 305
2007-11-10  Adam Roben  <aroben@apple.com>

        Windows build fix

        Roll out some changes that were (seemingly accidentally) checked in
        with r27664.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

darin@apple.com's avatar
darin@apple.com committed
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
2007-11-10  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - http://bugs.webkit.org/show_bug.cgi?id=15915
          add an evaluation path for booleans like the one we have for numbers

        Gives 1.1% on SunSpider.

        * kjs/grammar.y: Create TrueNode and FalseNode instead of BooleanNode.

        * kjs/nodes.h: Changed to use Noncopyable. Moved optimizeForUnnecessaryResult
        down from Node to ExpressionNode. Changed some classes to not inherit from
        ExpressionNode where not necessary, and removed unnneeded evaluate functions
        as well as evaluate functions that need not be virtual. Call the
        optimizeForUnnecessaryResult function on the start of a for loop too.
        * kjs/nodes.cpp:
        (KJS::ExpressionNode::evaluateToBoolean): Added.
        (KJS::FalseNode::evaluate): Added.
        (KJS::TrueNode::evaluate): Added.
        (KJS::NumberNode::evaluateToBoolean): Added.
        (KJS::StringNode::evaluateToBoolean): Added.
        (KJS::LocalVarAccessNode::evaluateToBoolean): Added.
        (KJS::BracketAccessorNode::evaluateToBoolean): Added.
        (KJS::LogicalNotNode::evaluate): Changed to call evaluateToBoolean.
        (KJS::LogicalNotNode::evaluateToBoolean): Added.
        (KJS::lessThan): Changed to return bool.
        (KJS::lessThanEq): Ditto.
        (KJS::LessNode::evaluate): Changed since lessThan returns bool.
        (KJS::LessNode::evaluateToBoolean): Added.
        (KJS::GreaterNode::evaluate): Changed since lessThanEq returns bool.
        (KJS::GreaterNode::evaluateToBoolean): Added.
        (KJS::LessEqNode::evaluate): Changed since lessThanEq returns bool.
        (KJS::LessEqNode::evaluateToBoolean): Added.
        (KJS::GreaterEqNode::evaluate): Changed since lessThan returns bool.
        (KJS::GreaterEqNode::evaluateToBoolean): Added.
        (KJS::InstanceOfNode::evaluateToBoolean): Added.
        (KJS::InNode::evaluateToBoolean): Added.
        (KJS::EqualNode::evaluateToBoolean): Added.
        (KJS::NotEqualNode::evaluateToBoolean): Added.
        (KJS::StrictEqualNode::evaluateToBoolean): Added.
        (KJS::NotStrictEqualNode::evaluateToBoolean): Added.
        (KJS::ConditionalNode::evaluate): Changed to call evaluateToBoolean.
        (KJS::IfNode::execute): Ditto.
        (KJS::DoWhileNode::execute): Ditto.
        (KJS::WhileNode::execute): Ditto.
        (KJS::ForNode::execute): Ditto.

        * kjs/nodes2string.cpp:
        (KJS::FalseNode::streamTo): Added.
        (KJS::TrueNode::streamTo): Added.

aroben@apple.com's avatar
aroben@apple.com committed
358 359 360 361 362 363 364 365 366
2007-11-09  Adam Roben  <aroben@apple.com>

        Windows build fix

        Reviewed by Darin.

        * kjs/value.h:
        (KJS::jsNumber): Add some explicit casts.

darin@apple.com's avatar
darin@apple.com committed
367 368 369 370 371 372 373 374
2007-11-08  Darin Adler  <darin@apple.com>

        - fix build

        * kjs/grammar.y:
        * kjs/nodes.h:
        * kjs/property_map.cpp:

375 376 377 378 379 380
2007-11-08  Darin Adler  <darin@apple.com>

        - roll out accidentally-checked in changes

        * kjs/nodes.cpp: Back to previous version.
        * kjs/nodes.h: Ditto.
381
        * kjs/grammar.y: Ditto.
382

darin@apple.com's avatar
darin@apple.com committed
383 384 385 386 387 388 389 390 391 392 393 394 395
2007-11-08  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15912
          fasta spends a lot of time in qsort

        * kjs/property_map.cpp:
        (KJS::PropertyMap::getEnumerablePropertyNames):
        Use insertion sort instead of qsort for small sets of property names.
        We can probably do some even-better speedups of for/in, but this nets
        0.6% overall and 6.7% on fasta.

darin@apple.com's avatar
darin@apple.com committed
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
2007-11-08  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15906
          getting characters by indexing into a string is very slow

        This fixes one source of the slowness -- the conversion to an unused
        Identifier as we call the get function from the slot -- but doesn't
        fix others, such as the fact that we have to allocate a new UString::Rep
        for every single character.

        Speeds up string-base64 30%, and at least 0.5% overall.
        But does slow down access-fannkuch quite a bit. Might be worth
        revisiting in the future to see what we can do about that (although
        I did look at a profile for a while).

        * kjs/property_slot.h: Add a new marker for "numeric" property slots;
        slots where we don't need to pass the identifier to the get function.
        (KJS::PropertySlot::getValue): Added code to call the numeric get function.
        (KJS::PropertySlot::setCustomNumeric): Added.
        * kjs/string_object.cpp:
        (KJS::StringInstance::indexGetter): Changed to use substr() instead
        of constructing a wholly new UString each time.
        (KJS::stringInstanceNumericPropertyGetter): Added. Like indexGetter, but
        takes advantage of setCustomNumeric to avoid creating an Identifier.
        (KJS::StringInstance::getOwnPropertySlot): Changed to use setCustomNumeric.

darin@apple.com's avatar
darin@apple.com committed
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
2007-11-08  Darin Adler  <darin@apple.com>

        Reviewed by Oliver.

        - http://bugs.webkit.org/show_bug.cgi?id=15904
          more speed-ups possible by tightening up int version of JSImmediate

        1% improvement of SunSpider

        * kjs/JSImmediate.h: Eliminate the now-unneeded FPBitValues struct template.
        (KJS::JSImmediate::from): Overload for most numeric types; many types can
        do fewer branches and checks.
        (KJS::JSImmediate::getUInt32): Removed unneeded check for undefined.
        (KJS::JSImmediate::getTruncatedInt32): Ditto.
        (KJS::JSImmediate::getTruncatedUInt32): Ditto. There's no difference any more
        between getUInt32 and getTruncatedUInt32, so that's worth a rename and merge later.

        * kjs/grammar.y: Update since fromDouble is now just from.
        * kjs/nodes.h: Ditto.

        * kjs/value.h: (KJS::jsNumber): Overload for most numeric types.

446 447 448 449 450 451 452 453 454
2007-11-08  Kevin Ollivier  <kevino@theolliviers.com>

        Bakefiles for building JavaScriptCore, needed by wx port.

        Reviewed by Mark Rowe.

        * JavaScriptCoreSources.bkl: Added.
        * jscore.bkl: Added.

455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
2007-11-08  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Fix regression caused by earlier bitwise and optimisation.  1 & undefined != 1.

        The implementation of JSImmediate::areBothImmediateNumbers relies on 
        (JSImmediate::getTag(immediate1) & JSImmediate::getTag(immediate2)) having 
        a unique result when both immediate values are numbers.

        The regression was due to UndefinedType & NumberType returning NumberType (3 & 1).
        By swapping the value of NumberType and UndefinedType this ceases to be a problem.

        * kjs/JSType.h:
        (KJS::):

darin@apple.com's avatar
darin@apple.com committed
471 472 473 474 475 476
2007-11-08  Darin Adler  <darin@apple.com>

        - fix build

        * kjs/nodes.h: Add missing parameter name.

477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
2007-11-08  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.

        Add ExpressionNode subclass of Node, use it.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::ForInNode::ForInNode):
        * kjs/nodes.h:
        (KJS::ExpressionNode::):
        (KJS::NullNode::):
        (KJS::NullNode::precedence):
        (KJS::BooleanNode::):
        (KJS::BooleanNode::precedence):
        (KJS::RegExpNode::):
        (KJS::RegExpNode::precedence):
        (KJS::ThisNode::):
        (KJS::ThisNode::precedence):
        (KJS::ResolveNode::):
        (KJS::ElementNode::):
        (KJS::ArrayNode::):
        (KJS::PropertyNode::):
        (KJS::PropertyNode::precedence):
        (KJS::PropertyNode::name):
        (KJS::PropertyListNode::):
        (KJS::ObjectLiteralNode::):
        (KJS::ObjectLiteralNode::precedence):
        (KJS::BracketAccessorNode::):
        (KJS::DotAccessorNode::):
        (KJS::DotAccessorNode::precedence):
        (KJS::ArgumentListNode::):
        (KJS::ArgumentsNode::):
        (KJS::NewExprNode::):
        (KJS::NewExprNode::precedence):
        (KJS::FunctionCallValueNode::):
        (KJS::FunctionCallValueNode::precedence):
        (KJS::FunctionCallResolveNode::):
        (KJS::FunctionCallBracketNode::):
        (KJS::FunctionCallBracketNode::precedence):
        (KJS::FunctionCallDotNode::):
        (KJS::FunctionCallDotNode::precedence):
        (KJS::PrePostResolveNode::):
        (KJS::PostfixBracketNode::):
        (KJS::PostfixBracketNode::precedence):
        (KJS::PostIncBracketNode::):
        (KJS::PostIncBracketNode::isIncrement):
        (KJS::PostDecBracketNode::):
        (KJS::PostDecBracketNode::isIncrement):
        (KJS::PostfixDotNode::):
        (KJS::PostfixDotNode::precedence):
        (KJS::PostIncDotNode::):
        (KJS::PostIncDotNode::isIncrement):
        (KJS::PostDecDotNode::):
        (KJS::PostDecDotNode::isIncrement):
        (KJS::PostfixErrorNode::):
        (KJS::PostfixErrorNode::precedence):
        (KJS::DeleteResolveNode::):
        (KJS::DeleteBracketNode::):
        (KJS::DeleteBracketNode::precedence):
        (KJS::DeleteDotNode::):
        (KJS::DeleteDotNode::precedence):
        (KJS::DeleteValueNode::):
        (KJS::DeleteValueNode::precedence):
        (KJS::VoidNode::):
        (KJS::VoidNode::precedence):
        (KJS::TypeOfResolveNode::):
        (KJS::TypeOfValueNode::):
        (KJS::PrefixBracketNode::):
        (KJS::PrefixBracketNode::precedence):
        (KJS::PreIncBracketNode::):
        (KJS::PreIncBracketNode::isIncrement):
        (KJS::PreDecBracketNode::):
        (KJS::PreDecBracketNode::isIncrement):
        (KJS::PrefixDotNode::):
        (KJS::PrefixDotNode::precedence):
        (KJS::PreIncDotNode::):
        (KJS::PreIncDotNode::isIncrement):
        (KJS::PreDecDotNode::):
        (KJS::PreDecDotNode::isIncrement):
        (KJS::PrefixErrorNode::):
        (KJS::PrefixErrorNode::precedence):
        (KJS::UnaryPlusNode::):
        (KJS::UnaryPlusNode::precedence):
        (KJS::NegateNode::):
        (KJS::NegateNode::precedence):
        (KJS::BitwiseNotNode::):
        (KJS::BitwiseNotNode::precedence):
        (KJS::LogicalNotNode::):
        (KJS::LogicalNotNode::precedence):
        (KJS::AddNode::):
        (KJS::AddNode::precedence):
        (KJS::LeftShiftNode::):
        (KJS::LeftShiftNode::precedence):
        (KJS::RightShiftNode::):
        (KJS::RightShiftNode::precedence):
        (KJS::UnsignedRightShiftNode::):
        (KJS::UnsignedRightShiftNode::precedence):
        (KJS::LessNode::):
        (KJS::LessNode::precedence):
        (KJS::GreaterNode::):
        (KJS::GreaterNode::precedence):
        (KJS::LessEqNode::):
        (KJS::LessEqNode::precedence):
        (KJS::GreaterEqNode::):
        (KJS::GreaterEqNode::precedence):
        (KJS::InstanceOfNode::):
        (KJS::InstanceOfNode::precedence):
        (KJS::InNode::):
        (KJS::InNode::precedence):
        (KJS::EqualNode::):
        (KJS::EqualNode::precedence):
        (KJS::NotEqualNode::):
        (KJS::NotEqualNode::precedence):
        (KJS::StrictEqualNode::):
        (KJS::StrictEqualNode::precedence):
        (KJS::NotStrictEqualNode::):
        (KJS::NotStrictEqualNode::precedence):
        (KJS::BitAndNode::):
        (KJS::BitAndNode::precedence):
        (KJS::BitOrNode::):
        (KJS::BitOrNode::precedence):
        (KJS::BitXOrNode::):
        (KJS::BitXOrNode::precedence):
        (KJS::LogicalAndNode::):
        (KJS::LogicalAndNode::precedence):
        (KJS::LogicalOrNode::):
        (KJS::LogicalOrNode::precedence):
        (KJS::ConditionalNode::):
        (KJS::ConditionalNode::precedence):
        (KJS::ReadModifyResolveNode::):
        (KJS::ReadModifyResolveNode::precedence):
        (KJS::AssignResolveNode::):
        (KJS::AssignResolveNode::precedence):
        (KJS::ReadModifyBracketNode::):
        (KJS::ReadModifyBracketNode::precedence):
        (KJS::AssignBracketNode::):
        (KJS::AssignBracketNode::precedence):
        (KJS::AssignDotNode::):
        (KJS::AssignDotNode::precedence):
        (KJS::ReadModifyDotNode::):
        (KJS::ReadModifyDotNode::precedence):
        (KJS::AssignErrorNode::):
        (KJS::AssignErrorNode::precedence):
        (KJS::CommaNode::):
        (KJS::CommaNode::precedence):
        (KJS::AssignExprNode::):
        (KJS::AssignExprNode::precedence):
        (KJS::ExprStatementNode::):
        (KJS::IfNode::):
        (KJS::DoWhileNode::):
        (KJS::WhileNode::):
        (KJS::ReturnNode::):
        (KJS::WithNode::):
        (KJS::ThrowNode::):
        (KJS::ParameterNode::):
        (KJS::CaseClauseNode::):
        (KJS::CaseClauseNode::precedence):
        (KJS::ClauseListNode::):
        (KJS::SwitchNode::):

638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660
2007-11-08  Oliver Hunt  <oliver@apple.com>

        Reviewed by Sam.

        Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).

        This only improves bitwise-and performance, as the additional logic required 
        for similar code paths on or, xor, and shifting requires additional operations
        and branches that negate (and in certain cases, regress) any advantage we might
        otherwise receive.

        This improves performance on all bitop tests, the cryptography tests, as well as 
        the string-base64 and string-unpack-code tests.  No significant degradation on 
        any other tests.

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::areBothImmediateNumbers):
        (KJS::JSImmediate::andImmediateNumbers):
        * kjs/nodes.cpp:
        (KJS::BitAndNode::evaluate):
        * kjs/value.h:
        (KJS::jsNumberFromAnd):

661 662 663 664 665 666 667 668 669 670
2007-11-08  Adam Roben  <aroben@apple.com>

        Stop using KJS inside of MathExtras.h

        Reviewed by Darin.

        * wtf/MathExtras.h: Removed an unused header, and a now-unused
        forward-declaration.
        (wtf_atan2): Use std::numeric_limits intead of KJS.

weinig@apple.com's avatar
weinig@apple.com committed
671 672 673 674 675 676 677 678 679
2007-11-08  Sam Weinig  <sam@webkit.org>

        Windows build fix.

        * kjs/date_object.cpp:
        (KJS::DateProtoFuncToLocaleString::callAsFunction): Fix unused arg warning.
        (KJS::DateProtoFuncToLocaleDateString::callAsFunction): ditto
        (KJS::DateProtoFuncToLocaleTimeString::callAsFunction): ditto

680 681 682 683 684 685
2007-11-08  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/lookup.h: Add missing include.

weinig@apple.com's avatar
weinig@apple.com committed
686 687 688 689 690 691 692 693 694 695 696 697 698 699
2007-11-08  Sam Weinig  <sam@webkit.org>

        Reviewed by Darin.

        Convert JavaScript internal function objects to use one class per
        function.  This avoids a switch statement inside what used to be
        the shared function classes and will allow Shark to better analyze
        the code.

        To make this switch, the value property of the HashEntry was changed
        to a union of an intptr_t (which is used to continue handle valueGetters)
        and function pointer which points to a static constructor for the
        individual new function objects.

700
        SunSpider claims this is a 1.0% speedup.
weinig@apple.com's avatar
weinig@apple.com committed
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841

        * kjs/array_object.cpp:
        (KJS::ArrayPrototype::getOwnPropertySlot):
        (KJS::getProperty):
        (KJS::ArrayProtoFuncToString::callAsFunction):
        (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
        (KJS::ArrayProtoFuncJoin::callAsFunction):
        (KJS::ArrayProtoFuncConcat::callAsFunction):
        (KJS::ArrayProtoFuncPop::callAsFunction):
        (KJS::ArrayProtoFuncPush::callAsFunction):
        (KJS::ArrayProtoFuncReverse::callAsFunction):
        (KJS::ArrayProtoFuncShift::callAsFunction):
        (KJS::ArrayProtoFuncSlice::callAsFunction):
        (KJS::ArrayProtoFuncSort::callAsFunction):
        (KJS::ArrayProtoFuncSplice::callAsFunction):
        (KJS::ArrayProtoFuncUnShift::callAsFunction):
        (KJS::ArrayProtoFuncFilter::callAsFunction):
        (KJS::ArrayProtoFuncMap::callAsFunction):
        (KJS::ArrayProtoFuncEvery::callAsFunction):
        (KJS::ArrayProtoFuncForEach::callAsFunction):
        (KJS::ArrayProtoFuncSome::callAsFunction):
        (KJS::ArrayProtoFuncIndexOf::callAsFunction):
        (KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
        * kjs/array_object.h:
        (KJS::ArrayPrototype::classInfo):
        * kjs/create_hash_table:
        * kjs/date_object.cpp:
        (KJS::DatePrototype::getOwnPropertySlot):
        (KJS::DateProtoFuncToString::callAsFunction):
        (KJS::DateProtoFuncToUTCString::callAsFunction):
        (KJS::DateProtoFuncToDateString::callAsFunction):
        (KJS::DateProtoFuncToTimeString::callAsFunction):
        (KJS::DateProtoFuncToLocaleString::callAsFunction):
        (KJS::DateProtoFuncToLocaleDateString::callAsFunction):
        (KJS::DateProtoFuncToLocaleTimeString::callAsFunction):
        (KJS::DateProtoFuncValueOf::callAsFunction):
        (KJS::DateProtoFuncGetTime::callAsFunction):
        (KJS::DateProtoFuncGetFullYear::callAsFunction):
        (KJS::DateProtoFuncGetUTCFullYear::callAsFunction):
        (KJS::DateProtoFuncToGMTString::callAsFunction):
        (KJS::DateProtoFuncGetMonth::callAsFunction):
        (KJS::DateProtoFuncGetUTCMonth::callAsFunction):
        (KJS::DateProtoFuncGetDate::callAsFunction):
        (KJS::DateProtoFuncGetUTCDate::callAsFunction):
        (KJS::DateProtoFuncGetDay::callAsFunction):
        (KJS::DateProtoFuncGetUTCDay::callAsFunction):
        (KJS::DateProtoFuncGetHours::callAsFunction):
        (KJS::DateProtoFuncGetUTCHours::callAsFunction):
        (KJS::DateProtoFuncGetMinutes::callAsFunction):
        (KJS::DateProtoFuncGetUTCMinutes::callAsFunction):
        (KJS::DateProtoFuncGetSeconds::callAsFunction):
        (KJS::DateProtoFuncGetUTCSeconds::callAsFunction):
        (KJS::DateProtoFuncGetMilliSeconds::callAsFunction):
        (KJS::DateProtoFuncGetUTCMilliseconds::callAsFunction):
        (KJS::DateProtoFuncGetTimezoneOffset::callAsFunction):
        (KJS::DateProtoFuncSetTime::callAsFunction):
        (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
        (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
        (KJS::DateProtoFuncSetSeconds::callAsFunction):
        (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
        (KJS::DateProtoFuncSetMinutes::callAsFunction):
        (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
        (KJS::DateProtoFuncSetHours::callAsFunction):
        (KJS::DateProtoFuncSetUTCHours::callAsFunction):
        (KJS::DateProtoFuncSetDate::callAsFunction):
        (KJS::DateProtoFuncSetUTCDate::callAsFunction):
        (KJS::DateProtoFuncSetMonth::callAsFunction):
        (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
        (KJS::DateProtoFuncSetFullYear::callAsFunction):
        (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
        (KJS::DateProtoFuncSetYear::callAsFunction):
        (KJS::DateProtoFuncGetYear::callAsFunction):
        * kjs/date_object.h:
        * kjs/lookup.cpp:
        (KJS::Lookup::find):
        * kjs/lookup.h:
        (KJS::HashEntry::):
        (KJS::staticFunctionGetter):
        (KJS::staticValueGetter):
        (KJS::getStaticPropertySlot):
        (KJS::getStaticFunctionSlot):
        (KJS::lookupPut):
        * kjs/math_object.cpp:
        (KJS::MathObjectImp::getOwnPropertySlot):
        (KJS::MathProtoFuncAbs::callAsFunction):
        (KJS::MathProtoFuncACos::callAsFunction):
        (KJS::MathProtoFuncASin::callAsFunction):
        (KJS::MathProtoFuncATan::callAsFunction):
        (KJS::MathProtoFuncATan2::callAsFunction):
        (KJS::MathProtoFuncCeil::callAsFunction):
        (KJS::MathProtoFuncCos::callAsFunction):
        (KJS::MathProtoFuncExp::callAsFunction):
        (KJS::MathProtoFuncFloor::callAsFunction):
        (KJS::MathProtoFuncLog::callAsFunction):
        (KJS::MathProtoFuncMax::callAsFunction):
        (KJS::MathProtoFuncMin::callAsFunction):
        (KJS::MathProtoFuncPow::callAsFunction):
        (KJS::MathProtoFuncRandom::callAsFunction):
        (KJS::MathProtoFuncRound::callAsFunction):
        (KJS::MathProtoFuncSin::callAsFunction):
        (KJS::MathProtoFuncSqrt::callAsFunction):
        (KJS::MathProtoFuncTan::callAsFunction):
        * kjs/math_object.h:
        (KJS::MathObjectImp::classInfo):
        (KJS::MathObjectImp::):
        * kjs/string_object.cpp:
        (KJS::StringPrototype::getOwnPropertySlot):
        (KJS::StringProtoFuncToString::callAsFunction):
        (KJS::StringProtoFuncValueOf::callAsFunction):
        (KJS::StringProtoFuncCharAt::callAsFunction):
        (KJS::StringProtoFuncCharCodeAt::callAsFunction):
        (KJS::StringProtoFuncConcat::callAsFunction):
        (KJS::StringProtoFuncIndexOf::callAsFunction):
        (KJS::StringProtoFuncLastIndexOf::callAsFunction):
        (KJS::StringProtoFuncMatch::callAsFunction):
        (KJS::StringProtoFuncSearch::callAsFunction):
        (KJS::StringProtoFuncReplace::callAsFunction):
        (KJS::StringProtoFuncSlice::callAsFunction):
        (KJS::StringProtoFuncSplit::callAsFunction):
        (KJS::StringProtoFuncSubstr::callAsFunction):
        (KJS::StringProtoFuncSubstring::callAsFunction):
        (KJS::StringProtoFuncToLowerCase::callAsFunction):
        (KJS::StringProtoFuncToUpperCase::callAsFunction):
        (KJS::StringProtoFuncToLocaleLowerCase::callAsFunction):
        (KJS::StringProtoFuncToLocaleUpperCase::callAsFunction):
        (KJS::StringProtoFuncLocaleCompare::callAsFunction):
        (KJS::StringProtoFuncBig::callAsFunction):
        (KJS::StringProtoFuncSmall::callAsFunction):
        (KJS::StringProtoFuncBlink::callAsFunction):
        (KJS::StringProtoFuncBold::callAsFunction):
        (KJS::StringProtoFuncFixed::callAsFunction):
        (KJS::StringProtoFuncItalics::callAsFunction):
        (KJS::StringProtoFuncStrike::callAsFunction):
        (KJS::StringProtoFuncSub::callAsFunction):
        (KJS::StringProtoFuncSup::callAsFunction):
        (KJS::StringProtoFuncFontcolor::callAsFunction):
        (KJS::StringProtoFuncFontsize::callAsFunction):
        (KJS::StringProtoFuncAnchor::callAsFunction):
        (KJS::StringProtoFuncLink::callAsFunction):
        * kjs/string_object.h:

aroben@apple.com's avatar
aroben@apple.com committed
842 843 844 845 846 847 848 849 850
2007-11-08  Adam Roben  <aroben@apple.com>

        Windows build fix

        Reviewed by Sam and Ada.

        * wtf/MathExtras.h: Get rid of a circular #include dependency to fix
        the build.

851 852 853 854 855 856 857
2007-11-08  Adam Roben  <aroben@apple.com>

        Fix a precedence warning on Windows

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::toBoolean):

858 859 860 861 862 863
2007-11-08  Mark Rowe  <mrowe@apple.com>

        Build fix for JavaScriptGlue.

        * wtf/MathExtras.h: Include stdlib.h for srand and RAND_MAX.

darin@apple.com's avatar
darin@apple.com committed
864 865 866 867 868 869
2007-11-08  Darin Adler  <darin@apple.com>

        - Windows build fix

        * kjs/JSImmediate.h: Include MathExtras.h rather than math.h since this file uses "signbit".

870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892
2007-11-08  Oliver Hunt  <oliver@apple.com>

        Reviewed by Darin.

        Replace the use of floats for immediate values with the use of integers for a 4.5% improvement in SunSpider.

        Unfortunately this change results in NaN, +Inf, -Inf, and -0 being heap allocated now, but
        we should now have faster array access, faster immediate to double conversion, and the 
        potential to further improve bitwise operators in future.

        This also removes the need for unions to avoid strict aliasing problems when extracting 
        a value from immediates.

        * kjs/JSImmediate.h:
        (KJS::):
        (KJS::JSImmediate::trueImmediate):
        (KJS::JSImmediate::falseImmediate):
        (KJS::JSImmediate::undefinedImmediate):
        (KJS::JSImmediate::nullImmediate):
        (KJS::JSImmediate::toBoolean):
        * kjs/value.h:
        (KJS::jsNaN):

893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949
2007-11-07  Eric Seidel  <eric@webkit.org>

        Reviewed by Darin and Oliver.
        
        Add evaluateToNumber parallel evaluation tree to speed up number operations.
        Make ImmediateNumberNode a subclass of NumberNode.
        Share evaluate logic between evaluate and evaluateToNumber using inline functions
        There is still a lot of improvement to be made here.
        
        SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
        Given the huge win that this prepares us for with simple type inferencing I see the small
        regression in base64 being worth the substantial overall improvement.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::Node::evaluateToNumber):
        (KJS::NumberNode::evaluate):
        (KJS::NumberNode::evaluateToNumber):
        (KJS::StringNode::evaluateToNumber):
        (KJS::LocalVarAccessNode::inlineEvaluate):
        (KJS::LocalVarAccessNode::evaluate):
        (KJS::LocalVarAccessNode::evaluateToNumber):
        (KJS::BracketAccessorNode::inlineEvaluate):
        (KJS::BracketAccessorNode::evaluate):
        (KJS::BracketAccessorNode::evaluateToNumber):
        (KJS::NegateNode::evaluate):
        (KJS::NegateNode::evaluateToNumber):
        (KJS::MultNode::inlineEvaluateToNumber):
        (KJS::MultNode::evaluate):
        (KJS::MultNode::evaluateToNumber):
        (KJS::DivNode::inlineEvaluateToNumber):
        (KJS::DivNode::evaluate):
        (KJS::DivNode::evaluateToNumber):
        (KJS::ModNode::inlineEvaluateToNumber):
        (KJS::ModNode::evaluate):
        (KJS::ModNode::evaluateToNumber):
        (KJS::throwOutOfMemoryErrorToNumber):
        (KJS::addSlowCaseToNumber):
        (KJS::add):
        (KJS::addToNumber):
        (KJS::AddNode::evaluateToNumber):
        (KJS::SubNode::inlineEvaluateToNumber):
        (KJS::SubNode::evaluate):
        (KJS::SubNode::evaluateToNumber):
        (KJS::valueForReadModifyAssignment):
        (KJS::ReadModifyLocalVarNode::evaluate):
        (KJS::ReadModifyResolveNode::evaluate):
        (KJS::ReadModifyDotNode::evaluate):
        (KJS::ReadModifyBracketNode::evaluate):
        * kjs/nodes.h:
        (KJS::Node::):
        (KJS::NumberNode::):
        (KJS::ImmediateNumberNode::):
        (KJS::AddNode::precedence):
        * kjs/nodes2string.cpp:
        (KJS::NumberNode::streamTo):

950 951 952 953 954 955 956 957 958 959 960
2007-11-07  Mark Rowe  <mrowe@apple.com>

        Reviewed by Eric.

        Fix up initialization after being mangled in r27572, and remove the
        ternary expression as extraCost will always be zero for the numeric
        heap.

        * kjs/collector.cpp:
        (KJS::Collector::heapAllocate):

961 962 963 964 965 966
2007-11-07  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/regexp_object.cpp:

ggaren@apple.com's avatar
ggaren@apple.com committed
967 968 969 970 971 972 973 974 975
2007-11-07  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Beth Dakin.
        
        Eliminated a bogus (though compiled-out) branch in the collector.

        * kjs/collector.cpp:
        (KJS::Collector::heapAllocate):

ggaren@apple.com's avatar
ggaren@apple.com committed
976 977 978 979 980
2007-11-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861 
981
        5.8% of string-validate-input.js is spent creating RegExpImps
ggaren@apple.com's avatar
ggaren@apple.com committed
982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010

        Put RegExpImp properties into a static hashtable to avoid a slew of
        PropertyMap churn when creating a RegExpImp.
        
        Factored important bits of regular expression implementation out of
        RegExpImp (the JS object) and into RegExp (the PCRE wrapper class), 
        making RegExp a ref-counted class. (This will help later.)

        Removed PCRE_POSIX support because I didn't quite know how to test it 
        and keep it working with these changes.
        
        1.1% SunSpider speedup. 5.8% speedup on string-validate-input.js.

        * kjs/regexp.h: A few interface changes:
        1. Renamed "subpatterns()" => "numSubpatterns()"
        2. Made flag enumeration private and replaced it with public getters for
        specific flags.
        3. Made RegExp ref-counted so RegExps can be shared by RegExpImps.
        4. Made RegExp take a string of flags instead of an int, eliminating 
        duplicated flag parsing code elsewhere.

        * kjs/regexp_object.cpp:
        (KJS::RegExpProtoFunc::callAsFunction): For RegExp.compile: 
        - Fixed a bug where compile(undefined) would throw an exception. 
        - Removed some now-redundant code.
        - Used RegExp sharing to eliminate an allocation and a bunch of 
        PropertyMap thrash. (Not a big win since compile is a deprecated 
        function. I mainly did this to test the plubming.)

1011 1012 1013 1014 1015 1016 1017 1018 1019
2007-11-07  Simon Hausmann  <hausmann@kde.org>

        Reviewed by nobody, Qt/Windows build fix.

        JavaScriptCore.pri expects OBJECTS_DIR to be set, so set it in
        testkjs.pro, too, where it's included from.

        * kjs/testkjs.pro:

1020 1021 1022 1023 1024 1025 1026 1027 1028
2007-11-07  Simon Hausmann  <shausman@trolltech.com>

        Reviewed by Lars.

        Fix "nmake clean" for the Qt/Windows build by replacing tmp/ with a variable that ends with the correct type of slash/backslash depending on the choice of compiler/make tool.

        * JavaScriptCore.pri:
        * pcre/pcre.pri:

hausmann's avatar
hausmann committed
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
2007-11-07  Lars Knoll  <lars@trolltech.com>

        Reviewed by Simon.

        fix umemcasecmp
        
        Pretty embarrassing bug. Has the potential to fix quite a few test failures.

        * wtf/unicode/qt4/UnicodeQt4.h:
        (WTF::Unicode::umemcasecmp):

mjs's avatar
mjs committed
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
2007-11-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Eric.        
        
        - only collect when the heap is full, unless we have lots of extra cost garbage
        
        1.1% SunSpider speedup.
        
        This shouldn't hit memory use much since the extra space in those
        blocks hangs around either way.

        * kjs/collector.cpp:
        (KJS::Collector::heapAllocate):
        (KJS::Collector::collect): Fix logic error that reversed the sense of collect's 
        return value.

1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081
2007-11-06  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Avoid unnecessarily boxing the result from post inc/decrement for 0.3% gain in sunspider
        
        We now convert the common 'for (...; ...; <var>++) ...' to the semantically identical
        'for (...; ...; ++<var>) ...'.

        * kjs/nodes.cpp:
        (KJS::PostIncResolveNode::optimizeForUnnecessaryResult):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostIncLocalVarNode::optimizeForUnnecessaryResult):
        (KJS::PostDecResolveNode::optimizeForUnnecessaryResult):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::PostDecLocalVarNode::optimizeForUnnecessaryResult):
        * kjs/nodes.h:
        (KJS::PrePostResolveNode::):
        (KJS::PostIncResolveNode::):
        (KJS::PostIncLocalVarNode::):
        (KJS::PostDecResolveNode::):
        (KJS::PostDecLocalVarNode::):
        (KJS::PreIncResolveNode::):
        (KJS::PreDecResolveNode::):
        (KJS::ForNode::ForNode):

1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092
2007-11-06  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.

        This fixes a regressed layout test for string + object
        
        SunSpider claims this was an overall 0.3% speedup, although some individual tests were slower.

        * kjs/nodes.cpp:
        (KJS::add): remove erroneous "fast path" for string + *

ggaren@apple.com's avatar
ggaren@apple.com committed
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116
2007-11-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Eric Seidel.
        
        Added toJSNumber, a fast path for converting a JSValue to a JS number,
        and deployed it in postfix expressions. In the fast case this 
        eliminates a call to jsNumber.
        
        0.4% speedup on SunSpider.

        * ChangeLog:
        * kjs/nodes.cpp:
        (KJS::PostIncResolveNode::evaluate):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostDecResolveNode::evaluate):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::PostIncBracketNode::evaluate):
        (KJS::PostDecBracketNode::evaluate):
        (KJS::PostIncDotNode::evaluate):
        (KJS::PostDecDotNode::evaluate):
        (KJS::UnaryPlusNode::evaluate):
        * kjs/value.h:
        (KJS::JSValue::toJSNumber):

darin@apple.com's avatar
darin@apple.com committed
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134
2007-11-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15846
          REGRESSION (r27387): Memory corruption when running fast/js/kde/delete.html

        There was a mistake in the algorithm used to find an empty slot in the property
        map entries vector; when we were putting in a new property value and not overwriting
        an existing deleted sentinel, we would enlarge the entries vector, but would not
        overwrite the stale data that's in the new part. It was easy to pin this down by
        turning on property map consistency checks -- I never would have landed with this
        bug if I had run the regression tests once with consistency checks on!

        * kjs/property_map.cpp: (KJS::PropertyMap::put): Changed logic for the case where
        foundDeletedElement is false to always use the item at the end of the entries vector.
        Also allowed me to merge with the logic for the "no deleted sentinels at all" case.

1135 1136 1137 1138 1139 1140 1141 1142 1143
2007-11-06  Oliver Hunt  <oliver@apple.com>

        RS=Darin.

        Fix previous patch to use a 3 bit shift, a 16 bit shift causes a regression in sunspider.

        * kjs/nodes.cpp:
        (KJS::add):

1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
2007-11-06  Oliver Hunt  <oliver@apple.com>

        Reviewed by Darin.

        Replace boolean comparisons in AddNode with mask
        comparisons for a 0.2% improvement in sunspider.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/nodes.cpp:
        (KJS::add):

1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165
2007-11-06  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.
        
        SunSpider claims this is a 1.1% speedup.

        * kjs/nodes.cpp:
        (KJS::throwOutOfMemoryError): Added, non inline.
        (KJS::addSlowCase): renamed from add(), non inline.
        (KJS::add): add fast path for String + String, Number + Number and String + *

1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176
2007-11-06  Eric Seidel  <eric@webkit.org>

        Reviewed by mjs.
        
        Avoid more UString creation.
        
        SunSpider claims this is a 0.4% speedup.

        * kjs/regexp_object.cpp:
        (KJS::RegExpObjectImp::construct): use UString::find(UChar)

1177 1178 1179 1180 1181 1182 1183
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Mac build fix.

        * kjs/array_object.cpp:
        (KJS::ArrayProtoFunc::callAsFunction):

aroben's avatar
aroben committed
1184 1185 1186 1187 1188 1189
2007-11-05  Adam Roben  <aroben@apple.com>

        Windows build fix

        * kjs/list.h:

1190 1191 1192 1193 1194 1195
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Build fix.  Add missing #include.

        * kjs/operations.cpp:

1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206
2007-11-05  Eric Seidel  <eric@webkit.org>

        Reviewed by mjs.
        
        Remove another call to toString(exec)
        
        SunSpider claims this is a 0.5% speedup.

        * kjs/operations.cpp:
        (KJS::equal): remove another toString

1207 1208 1209 1210 1211
2007-11-05  Eric Seidel  <eric@webkit.org>

        * kjs/operations.cpp:
        (KJS::equal): correct broken change.

1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222
2007-11-05  Eric Seidel  <eric@webkit.org>

        Reviewed by mjs.

        Remove one more call to toString(exec).
        
        SunSpider claims this is a 0.7% speedup.

        * kjs/operations.cpp:
        (KJS::equal): remove a call to toString()

1223 1224 1225 1226 1227 1228
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * pcre/pcre.pri:

1229 1230 1231 1232 1233 1234
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/list.cpp:

1235 1236 1237 1238 1239 1240
2007-11-05  Geoffrey Garen  <ggaren@apple.com>

        Touched a file to test my new HTTP access.

        * kjs/scope_chain.cpp:

alp's avatar
alp committed
1241 1242 1243 1244 1245 1246 1247 1248 1249
2007-11-05  Alp Toker  <alp@atoker.com>

        Unreviewed build fix for qmake-based ports.

        Someone with a better understanding of qmake still needs to sort out
        the INCLUDEPATH/DEPENDPATH mess.

        * JavaScriptCore.pri:

ggaren's avatar
ggaren committed
1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
2007-11-05  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        http://bugs.webkit.org/show_bug.cgi?id=15835

        Switched List implementation from a custom heap allocator to an inline
        Vector, for a disappointing .5% SunSpider speedup.
        
        Also renamed List::slice to List::getSlice because "get" is the 
        conventional prefix for functions returning a value through an out 
        parameter.

        * kjs/array_object.cpp:
        (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
        calls and memory accesses.

        * kjs/bool_object.cpp:
        (BooleanObjectImp::construct): Removed questionable use of iterator.

        * kjs/list.cpp:
        * kjs/list.h: New List class, implemented in terms of Vector. Two 
        interesting differences:
            1. The inline capacity is 8, not 5. Many of the Lists constructed 
            during a SunSpider run are larger than 5; almost none are larger
            than 8.

            2. The growth factor is 4, not 2. Since we can guarantee that Lists
            aren't long-lived, we can grow them more aggressively, to avoid
            excessive copying.

        * kjs/regexp_object.cpp:
        (RegExpObjectImp::construct): Removed redundant function calls.

        * kjs/string_object.cpp:
        (KJS::StringObjectImp::construct): Removed questionable use of iterator.

        * wtf/Vector.h:
        (WTF::::uncheckedAppend): Added a fast, unchecked version of append.

1290 1291 1292 1293 1294 1295 1296 1297 1298
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Reviewed by Alp Toker.

        Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.

        * JavaScriptCore.pri:
        * pcre/pcre.pri:

darin@apple.com's avatar
darin@apple.com committed
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330
2007-11-04  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15826
          optimize opcode loop and case insensitive ASCII compares for a 30% speedup

        SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.

        * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.

        * pcre/pcre_compile.c:
        (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
        added OP_NOT since there was no reason it should not be in here.
        (could_be_empty_branch): Ditto.
        (compile_branch): Streamlined all the single-character cases; there was a bit of
        duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
        But in particular, compile to those opcodes when the single character match is
        ASCII.
        (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.

        * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
        the matchframe, after I discovered that none of them needed to be saved and restored
        across recursive match calls. Also eliminated the ignored result field from the
        matchframe, since I discovered that rrc ("recursive result code") was already the
        exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
        statement of the switch instead of doing them before the switch. This removes a
        branch from each iteration of the opcode interpreter, just as removal of "op"
        removed at least one store from each iteration. Last, but not least, add the
        OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
        surrogate pair and the letter case can be handled efficiently.

1331 1332 1333 1334
2007-11-04  Darin Adler  <darin@apple.com>

        * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.

1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356
2007-11-03  Darin Adler  <darin@apple.com>

        - fix non-Mac builds; remove some more unused PCRE stuff

        * pcre/pcre_compile.c:
        (compile_branch): Removed branch chain and some unused ESC values.
        (compile_regex): Ditto.
        (jsRegExpCompile): Ditto.
        * pcre/pcre_exec.c:
        (match): Removed unused branch targets. Don't use macros any more.
        (jsRegExpExecute): More of the same.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
        * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
        * pcre/pcre.pri: Ditto.

        * pcre/MERGING: Removed.
        * pcre/pcre_fullinfo.c: Removed.
        * pcre/pcre_get.c: Removed.
        * pcre/pcre_internal.h:
        * pcre/ucp.h: Removed.

darin@apple.com's avatar
darin@apple.com committed
1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468
2007-11-03  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15821
          remove unused PCRE features for speed

        A first step toward removing the PCRE features we don't use.
        This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
        the SunSpider regular expression test.

        Replaced the public interface with one that doesn't use the
        name PCRE. Removed code we don't need for JavaScript and various
        configurations we don't use. This is in preparation for still
        more changes in the future. We'll probably switch to C++ and
        make some even more significant changes to the regexp engine
        to get some additional speed.

        There's probably additional unused stuff that I haven't
        deleted yet.

        This does mean that our PCRE is now a fork, but I think that's
        not really a big deal.

        * JavaScriptCore.exp: Remove the 5 old entry points and add
        the 3 new entry points for WebCore's direct use of the regular
        expression engine.

        * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
        its sense and now there's a USE(POSIX_REGEX) instead, which should
        probably not be set by anyone. Maybe later we'll just get rid of it
        altogether.

        * kjs/regexp.h:
        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
        defines. Cut down on the number of functions used.
        (KJS::RegExp::~RegExp): Ditto.
        (KJS::RegExp::match): Ditto.

        * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
        which are unused.

        * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
        size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
        POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
        and JAVASCRIPT. These are all no longer configurable in our copy
        of the library.

        * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
        version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
        the include of <stdlib.h>, and most of the constants and
        functions defined in this header. Changed the naming scheme to
        use a JSRegExp prefix rather than a pcre prefix. In the future,
        we'll probably change this to be a C++ header.

        * pcre/pcre_compile.c: Removed all unused code branches,
        including many whole functions and various byte codes.
        Kept changes outside of removal to a minimum.
        (check_escape):
        (first_significant_code):
        (find_fixedlength):
        (find_recurse):
        (could_be_empty_branch):
        (compile_branch):
        (compile_regex):
        (is_anchored):
        (is_startline):
        (find_firstassertedchar):
        (jsRegExpCompile): Renamed from pcre_compile2 and changed the
        parameters around a bit.
        (jsRegExpFree): Added.

        * pcre/pcre_exec.c: Removed many unused opcodes and variables.
        Also started tearing down the NO_RECURSE mechanism since it's
        now the default. In some cases there were things in the explicit
        frame that could be turned into plain old local variables and
        other small like optimizations.
        (pchars):
        (match_ref):
        (match): Changed parameters quite a bit since it's now not used
        recursively.
        (jsRegExpExecute): Renamed from pcre_exec.

        * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
        PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
        PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
        PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
        _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
        and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.

        * pcre/pcre_maketables.c: Changed to only compile in dftables.
        Also got rid of many of the tables that we don't use.

        * pcre/pcre_tables.c: Removed the unused Unicode property tables.

        * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
        _pcre_ucp_othercase.

        * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
        for classes based on Unicode properties.

        * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
        to eliminate this completely, but we need the regular expression
        code to be C++ first.

        * pcre/pcre_fullinfo.c:
        * pcre/pcre_get.c:
        * pcre/ucp.h:
        Files that are no longer needed. I didn't remove them with this
        check-in, because I didn't want to modify all the project files.

mjs's avatar
mjs committed
1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479
2007-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Sam.
        
        - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup

        It turns out that doing this check costs more than it saves.
        
        * kjs/JSImmediate.h:
        (KJS::JSImmediate::fromDouble):

weinig@apple.com's avatar
weinig@apple.com committed
1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516
2007-11-03  Sam Weinig  <sam@webkit.org>

        Reviewed by Oliver.

        Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
        The variable had been kept around for binary compatibility, but since nothing
        else is there is no point in continuing to keep it around.

        * API/JSCallbackConstructor.cpp:
        (KJS::):
        * API/JSCallbackFunction.cpp:
        (KJS::):
        * API/JSCallbackObject.cpp:
        (KJS::):
        * bindings/objc/objc_runtime.mm:
        * bindings/runtime_array.cpp:
        * bindings/runtime_object.cpp:
        * kjs/array_instance.cpp:
        (KJS::):
        * kjs/array_object.cpp:
        (KJS::):
        * kjs/bool_object.cpp:
        * kjs/date_object.cpp:
        (KJS::):
        * kjs/error_object.cpp:
        * kjs/function.cpp:
        (KJS::):
        * kjs/internal.cpp:
        (KJS::):
        * kjs/lookup.h:
        * kjs/math_object.cpp:
        * kjs/number_object.cpp:
        * kjs/object.h:
        * kjs/regexp_object.cpp:
        * kjs/string_object.cpp:
        (KJS::):

1517 1518 1519 1520 1521 1522 1523
2007-11-03  Kevin McCullough  <kmccullough@apple.com>

        - Updated testkjs results to make the build bots green until we
        can fix the tests that are failing.  The new failures are in DST.

        * tests/mozilla/expected.html:

mjs's avatar
mjs committed
1524 1525 1526 1527 1528 1529 1530 1531 1532
2007-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Adam.
        
        - don't print the var twice for ForInNodes with a var declaration

        * kjs/nodes2string.cpp:
        (KJS::ForInNode::streamTo):

1533 1534 1535 1536 1537
2007-11-03  Darin Adler  <darin@apple.com>

        * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
        C-incompatible declaration.

1538 1539 1540 1541 1542 1543
2007-11-03  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/nodes.cpp:  Add missing include.

darin@apple.com's avatar
darin@apple.com committed
1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564
2007-11-03  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15814
          <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails

        These changes cause us to match the JavaScript specification and pass the
        fast/js/kde/encode_decode_uri.html test.

        * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
        new strict mode, throwing an exception if there are malformed UTF-16 surrogate
        pairs in the text.

        * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
        * kjs/ustring.cpp:
        (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
        those might be illegal in some sense, they aren't supposed to get any special
        handling in the place where this function is currently used.
        (KJS::UString::UTF8String): Added the strictness.

darin@apple.com's avatar
darin@apple.com committed
1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609
2007-11-03  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15812
          some JavaScript tests (from the Mozilla test suite) are failing

        Two or three fixes get 7 more of the Mozilla tests passing.
        This gets us down from 61 failing tests to 54.

        * kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
        Made this inline and gave it a more specific type. Some day we should
        probably do that for all of these -- might even get a bit of a speed
        boost from it.
        * kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
        inline in the header.

        * kjs/regexp_object.h:
        * kjs/regexp_object.cpp:
        (KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
        switch statement into the RegExpImp object, so they can be shared with
        RegExpImp::callAsFunction.
        (KJS::RegExpImp::match): Added. Common code used by both test and exec.
        (KJS::RegExpImp::test): Added.
        (KJS::RegExpImp::exec): Added.
        (KJS::RegExpImp::implementsCall): Added.
        (KJS::RegExpImp::callAsFunction): Added.
        (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
        lastInput to null rather than empty string -- we take advantage of the
        difference in RegExpImp::match.
        (KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
        just to get at a field like this.

        * pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
        the JavaScript specification. If there are not 4 hex digits after the \u,
        then it's processed as if it wasn't an escape sequence at all.

        * pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
        for JavaScript (4 specific Unicode values).
        * pcre/pcre_exec.c:
        (match): Changed all call sites to use IS_NEWLINE.
        (pcre_exec): Ditto.

        * tests/mozilla/expected.html: Updated to expect 7 more successful tests.

ddkilzer's avatar
ddkilzer committed
1610 1611 1612 1613 1614 1615 1616 1617
2007-11-03  David D. Kilzer  <ddkilzer@webkit.org>

        Sort files(...); sections of Xcode project files.

        Rubber-stamped by Darin.

        * JavaScriptCore.xcodeproj/project.pbxproj:

mjs's avatar
mjs committed
1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637
2007-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::VarDeclNode::optimizeVariableAccess):
        (KJS::VarDeclNode::getDeclarations):
        (KJS::VarDeclNode::handleSlowCase):
        (KJS::VarDeclNode::evaluateSingle):
        (KJS::VarDeclNode::evaluate):
        (KJS::VarStatementNode::execute):
        * kjs/nodes.h:
        (KJS::VarDeclNode::):
        (KJS::VarStatementNode::):
        * kjs/nodes2string.cpp:
        (KJS::VarDeclNode::streamTo):

ap's avatar
ap committed
1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653
2007-11-03  Alexey Proskuryakov  <ap@webkit.org>

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=15800
        REGRESSION (r27303): RegExp leaks

        * kjs/regexp_object.h:
        (KJS::RegExpImp::setRegExp):
        (KJS::RegExpImp::regExp):
        (KJS::RegExpImp::classInfo):
        * kjs/regexp_object.cpp:
        (RegExpImp::RegExpImp):
        (RegExpImp::~RegExpImp):
        Renamed reg member variable to m_regExp, changed it to use OwnPtr.

mjs's avatar
mjs committed
1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672
2007-11-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::statementListPushFIFO):
        (KJS::statementListGetDeclarations):
        (KJS::statementListInitializeDeclarationStacks):
        (KJS::statementListInitializeVariableAccessStack):
        (KJS::statementListExecute):
        (KJS::BlockNode::BlockNode):
        (KJS::FunctionBodyNode::FunctionBodyNode):
        (KJS::ProgramNode::ProgramNode):
        * kjs/nodes.h:
        (KJS::CaseClauseNode::):

darin@apple.com's avatar
darin@apple.com committed
1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711
2007-11-02  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15791
          change property map data structure for less memory use, better speed

        The property map now has an array of indices and a separate array of
        property map entries. This slightly slows down lookup because of a second
        memory acess, but makes property maps smaller and faster to iterate in
        functions like mark().

        SunSpider says this is 1.2% faster, although it makes the bitwise-end test
        more than 10% slower. To fix that we'll need to optimize global variable lookup.

        * kjs/property_map.cpp:
        (KJS::PropertyMapEntry::PropertyMapEntry):
        (KJS::PropertyMapHashTable::entries):
        (KJS::PropertyMapHashTable::allocationSize):
        (KJS::SavedProperties::SavedProperties):
        (KJS::SavedProperties::~SavedProperties):
        (KJS::PropertyMap::checkConsistency):
        (KJS::PropertyMap::~PropertyMap):
        (KJS::PropertyMap::clear):
        (KJS::PropertyMap::get):
        (KJS::PropertyMap::getLocation):
        (KJS::PropertyMap::put):
        (KJS::PropertyMap::insert):
        (KJS::PropertyMap::createTable):
        (KJS::PropertyMap::rehash):
        (KJS::PropertyMap::remove):
        (KJS::PropertyMap::mark):
        (KJS::comparePropertyMapEntryIndices):
        (KJS::PropertyMap::containsGettersOrSetters):
        (KJS::PropertyMap::getEnumerablePropertyNames):
        (KJS::PropertyMap::save):
        (KJS::PropertyMap::restore):
        * kjs/property_map.h:

darin@apple.com's avatar
darin@apple.com committed
1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724
2007-11-02  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15807
          HashMap needs a take() function that combines get and remove

        * wtf/HashMap.h: Added take function. Simplistic implementation for now,
        but still does only one hash table lookup.

        * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
        a find followed by a remove.

darin@apple.com's avatar
darin@apple.com committed
1725 1726 1727 1728 1729 1730 1731 1732 1733
2007-11-02  David Carson  <dacarson@gmail.com>

        Reviewed by Darin.

        Fix compiler warning "warning: suggest parentheses around && within ||"
        http://bugs.webkit.org/show_bug.cgi?id=15764

        * kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.

ggaren's avatar
ggaren committed
1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        In preparation for making List a simple stack-allocated Vector:

        Removed all instances of List copying and/or assignment, and made List 
        inherit from Noncopyable.
        
        Functions that used to return a List by copy now take List& out 
        parameters.
        
        Layout tests and JS tests pass.

        * kjs/list.cpp:
        (KJS::List::slice): Replaced copyTail with a more generic slice 
        alternative. (JavaScriptCore only calls slice(1), but WebCore calls 
        slice(2)).

ggaren's avatar
ggaren committed
1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.

        Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
        REGRESSION(r27344): Crash on load at finance.yahoo.com
        
        Reverted a small portion of my last check-in. (The speedup and the List 
        removal are still there, though.)
        
        ActivationImp needs to hold a pointer to its function, and mark that 
        pointer (rather than accessing its function through its ExecState, and 
        counting on the active scope to mark its function) because a closure 
        can cause an ActivationImp to outlive its ExecState along with any 
        active scope.

        * kjs/ExecState.cpp:
        (KJS::ExecState::ExecState):
        * kjs/function.cpp:
        (KJS::FunctionImp::~FunctionImp):
        (KJS::ActivationImp::ActivationImp):
        * kjs/function.h:
        (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):

        Also made HashTable a little more crash-happy in debug builds, so 
        problems like this will show up earlier:
        
        * wtf/HashTable.h:
        (WTF::HashTable::~HashTable):

ggaren's avatar
ggaren committed
1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Adam Roben.
        
        Addressed some of Darin's review comments.
        
        Used perl -p, which is the shorthand while(<>) {}.
        
        Made sure not to suppress bison's output.
        
        Added line to removed bison_out.txt, since this script removes other 
        intermediate files, too.

        * DerivedSources.make:

ggaren's avatar
ggaren committed
1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Removed List from ActivationImp, in preparation for making all lists
        stack-allocated.
        
        Tests pass.
        
        1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.

        * kjs/ExecState.cpp:
        (KJS::ExecState::ExecState):
        (KJS::ExecState::~ExecState):
        * kjs/function.cpp:
        (KJS::ActivationImp::ActivationImp):
        (KJS::ActivationImp::createArgumentsObject):
        * kjs/function.h:
        (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):

1818 1819 1820 1821
2007-11-01  Adam Roben  <aroben@apple.com>

        Use jsNumberCell instead of jsNumber when converting double constants to JSValues

aroben's avatar
aroben committed
1822 1823 1824
        This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
        ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.

1825 1826 1827 1828 1829 1830 1831 1832 1833 1834
        It also gets rid of an MSVC warning that we previously had to silence.

        Reviewed by Geoff.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
        back on the "overflow in constant arithmetic" warning.
        * kjs/number_object.cpp:
        (NumberObjectImp::getValueProperty): Use jsNumberCell instead of
        jsNumber.

aroben's avatar
aroben committed
1835 1836 1837 1838 1839 1840
2007-10-31  Adam Roben  <aroben@apple.com>

        Windows build fix

        * kjs/ExecState.h:

mjs's avatar
mjs committed
1841 1842 1843 1844 1845 1846
2007-10-31  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - shave some cycles off of local storage access for a 1% SunSpider speedup
        
mjs's avatar
mjs committed
1847 1848
        Keep the LocalStorage pointer in the ExecState, instead of getting
        it from the ActivationImp all the time.
mjs's avatar
mjs committed
1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865

        * kjs/ExecState.cpp:
        (KJS::ExecState::updateLocalStorage):
        * kjs/ExecState.h:
        (KJS::ExecState::localStorage):
        * kjs/nodes.cpp:
        (KJS::LocalVarAccessNode::evaluate):
        (KJS::LocalVarFunctionCallNode::evaluate):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::LocalVarTypeOfNode::evaluate):
        (KJS::PreIncLocalVarNode::evaluate):
        (KJS::PreDecLocalVarNode::evaluate):
        (KJS::ReadModifyLocalVarNode::evaluate):
        (KJS::AssignLocalVarNode::evaluate):
        (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):

1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883
2007-10-31  Adam Roben  <aroben@apple.com>

        Fix a crash on launch due to a static initializer race

        We now use fast inline assembler spinlocks which can be statically
        initialized at compile time.

        As a side benefit, this speeds up SunSpider by 0.4%.

        Reviewed by Oliver.

        * wtf/FastMalloc.cpp:
        * wtf/TCSpinLock.h:
        (TCMalloc_SpinLock::Lock):
        (TCMalloc_SpinLock::Unlock):
        (TCMalloc_SlowLock):
        * wtf/TCSystemAlloc.cpp:

kmccullo's avatar
kmccullo committed
1884 1885 1886 1887 1888 1889 1890 1891
2007-10-31  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Sam.

        - Corrected spelling.

        * wtf/HashTraits.h:

1892 1893 1894 1895 1896 1897
2007-10-31  Mark Rowe  <mrowe@apple.com>

        Further Gtk build fixage.

        * kjs/regexp_object.cpp:

1898 1899 1900 1901 1902 1903
2007-10-31  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/regexp.h:

darin's avatar
darin committed
1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
2007-10-31  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15749
          RegExp/RegExpObjectImp cause needless UString creation

        Speeds things up 0.4% according to SunSpider.

        * kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
        because this library doesn't use the real PCRE -- it uses its
        own PCRE that works on UTF-16.

        * kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
        Use Noncopyable. Change the return value of match.
        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
        (KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
        (KJS::RegExp::match): Change to return the position as an int and the
        ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.

        * kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
        require a result string.
        * kjs/regexp_object.cpp:
        (RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
        (RegExpObjectImp::performMatch): Change so it doesn't return a string.
        (RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
        the main result with the backreferences; now it doesn't need to take
        a result parameter.
        (RegExpObjectImp::getBackref): Minor tweaks.
        (RegExpObjectImp::getLastParen): Ditto.
        (RegExpObjectImp::getLeftContext): Ditto.
        (RegExpObjectImp::getRightContext): Ditto.
        (RegExpObjectImp::getValueProperty): Change LastMatch case to call
        getBackref(0) so we don't need a separate getLastMatch function.

        * kjs/string_object.cpp:
        (KJS::replace): Update to use new performMatch, including merging the
        matched string section with the other substrings.
        (KJS::StringProtoFunc::callAsFunction): Update functions to use the
        new performMatch and match. Also change to use OwnArrayPtr.

oliver's avatar
oliver committed
1946 1947 1948 1949
2007-10-31  Oliver Hunt  <oliver@apple.com>

        * kjs/nodes.h: include OwnPtr.h

1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977
2007-10-31  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::statementListPushFIFO):
        (KJS::statementListGetDeclarations):
        (KJS::statementListInitializeDeclarationStacks):
        (KJS::statementListInitializeVariableAccessStack):
        (KJS::statementListExecute):
        (KJS::BlockNode::optimizeVariableAccess):
        (KJS::BlockNode::BlockNode):
        (KJS::BlockNode::getDeclarations):
        (KJS::BlockNode::execute):
        (KJS::CaseClauseNode::optimizeVariableAccess):
        (KJS::CaseClauseNode::getDeclarations):
        (KJS::CaseClauseNode::evalStatements):
        (KJS::FunctionBodyNode::initializeDeclarationStacks):
        (KJS::FunctionBodyNode::optimizeVariableAccess):
        * kjs/nodes.h:
        * kjs/nodes2string.cpp:
        (KJS::statementListStreamTo):
        (KJS::BlockNode::streamTo):
        (KJS::CaseClauseNode::streamTo):

bdash's avatar
bdash committed
1978 1979
2007-10-30  Mark Rowe  <mrowe@apple.com>

1980 1981
        * kjs/property_map.cpp: Added a missing using directive to fix the build
        for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
bdash's avatar
bdash committed
1982

mjs's avatar
mjs committed
1983 1984
2007-10-31  Maciej Stachowiak  <mjs@apple.com>

1985 1986
        * kjs/property_map.cpp: Include HashTable.h the right way to fix the build
        for non-Mac ports.
mjs's avatar
mjs committed
1987

ap's avatar
ap committed
1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
2007-10-31  Alexey Proskuryakov  <ap@webkit.org>

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=11001
        WebKit doesn't support RegExp.compile method

        Test: fast/js/regexp-compile.html

        * kjs/regexp_object.cpp:
        (RegExpPrototype::RegExpPrototype):
        (RegExpProtoFunc::callAsFunction):
        * kjs/regexp_object.h:
        (KJS::RegExpProtoFunc::):
        Added RegExp.compile.

        * tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.

mjs's avatar
mjs committed
2006 2007
2007-10-31  Maciej Stachowiak  <mjs@apple.com>

2008
        Reviewed by Oliver.
mjs's avatar
mjs committed
2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032
        
        - get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
        
        Integer divide sucks. Fortunately, a bunch of shifts and XORs
        biased towards the high bits is sufficient to provide a good
        double hash. Besides the SunSpider win, I used the dump statistics
        mode for both to verify that collisions did not increase and that
        the longest collision chain is not any longer.

        * kjs/property_map.cpp:
        (KJS::doubleHash):
        (KJS::PropertyMap::get):
        (KJS::PropertyMap::getLocation):
        (KJS::PropertyMap::put):
        (KJS::PropertyMap::insert):
        (KJS::PropertyMap::remove):
        (KJS::PropertyMap::checkConsistency):
        * wtf/HashTable.h:
        (WTF::doubleHash):
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):
        (WTF::::add):

aroben's avatar
aroben committed
2033 2034
2007-10-30  Adam Roben  <aroben@apple.com>

2035 2036
        * kjs/collector.h: Make HeapType public so it can be used for non-member
        things like the HeapConstants struct template. Fixes the build on Windows.
aroben's avatar
aroben committed
2037

2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051
2007-10-30  Adam Roben  <aroben@apple.com>

        Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows

        Speeds up SunSpider by 0.4%.

        Reviewed by Steve and Maciej.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
        a warning during LTCG in release builds about double -> float
        conversion.
        * wtf/AlwaysInline.h:
        * wtf/FastMalloc.h:

2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063
2007-10-30  Adam Roben  <aroben@apple.com>

        Use GetCurrentThreadId instead of pthread_self in FastMalloc

        Speeds up SunSpider by 0.3%.

        Reviewed by Steve.

        * wtf/FastMalloc.cpp:
        (WTF::TCMalloc_ThreadCache::InitTSD):
        (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):

2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080
2007-10-30  Adam Roben  <aroben@apple.com>

        Switch to a Win32 critical section implementation of spinlocks
        
        Speeds up SunSpider by 0.4%.
        
        Reviewed by Steve.
        
        * wtf/FastMalloc.cpp:
        * wtf/TCSpinLock.h:
        (TCMalloc_SpinLock::TCMalloc_SpinLock):
        (TCMalloc_SpinLock::Init):
        (TCMalloc_SpinLock::Finalize):
        (TCMalloc_SpinLock::Lock):
        (TCMalloc_SpinLock::Unlock):
        * wtf/TCSystemAlloc.cpp:

2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097
2007-10-30  Adam Roben  <aroben@apple.com>

        Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta

        http://bugs.webkit.org/show_bug.cgi?id=15586

        Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll

        Use Win32 TLS functions instead of __declspec(thread), which breaks
        delay-loading.

        Reviewed by Steve.

        * wtf/FastMalloc.cpp:
        (WTF::getThreadHeap):
        (WTF::TCMalloc_ThreadCache::InitModule):

mjs's avatar
mjs committed
2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117
2007-10-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - allocate numbers in half-size cells, for an 0.5% SunSpider speedup
        http://bugs.webkit.org/show_bug.cgi?id=15772
        
        We do this by using a single mark bit per two number cells, and
        tweaking marking.
        
        Besides being an 0.5% win overall, this is a 7.1% win on morph.

        * kjs/collector.cpp:
        (KJS::):
        (KJS::Collector::heapAllocate):
        (KJS::Collector::markStackObjectsConservatively):
        (KJS::Collector::sweep):
        * kjs/collector.h:
        (KJS::SmallCollectorCell::):

ggaren's avatar
ggaren committed
2118 2119 2120 2121 2122 2123 2124 2125
2007-10-30  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Adam Roben, Sam Weinig.
        
        Made conflicts in grammar.y a persistent build failure.

        * DerivedSources.make:

kmccullo's avatar
kmccullo committed
2126 2127 2128 2129 2130 2131 2132 2133 2134
2007-10-30  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Adam and Geoff.

        - Added a new cast so all the casts are in the same place.

        * API/APICast.h:
        (toGlobalRef):

ggaren's avatar
ggaren committed
2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163
2007-10-30  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.

        Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
        
        JS tests, including 

            ecma_2/Statements/dowhile-001.js
            ecma_2/Statements/dowhile-002.js
            ecma_2/Statements/dowhile-003.js
            ecma_2/Statements/dowhile-004.js
            ecma_2/Statements/dowhile-005.js
            ecma_2/Statements/dowhile-006.js
            ecma_2/Statements/dowhile-007.js
            js1_2/statements/do_while.js

        and layout tests, including

            do-while-expression-value.html
            do-while-semicolon.html
            do-while-without-semicolon.html
        
        pass.
        
        * kjs/grammar.y: Use the explicit "error" production, as we do with other
        automatic semicolon insertions, to disambiguate "do { } while();" from
        "do { } while()" followed by ";" (the empty statement).

2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
2007-10-29  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Debranching remaining assignment nodes, and miscellaneous cleanup
        
        Split read-modify code paths out of AssignBracketNode and AssignDotNode
        Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode 
        and ReadModifyResolveNode evaluate methods

        Leads to a 1% gain in SunSpider.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::ReadModifyLocalVarNode::evaluate):
        (KJS::ReadModifyResolveNode::evaluate):
        (KJS::AssignDotNode::evaluate):
        (KJS::ReadModifyDotNode::optimizeVariableAccess):
        (KJS::ReadModifyDotNode::evaluate):
        (KJS::AssignBracketNode::evaluate):
        (KJS::ReadModifyBracketNode::optimizeVariableAccess):
        (KJS::ReadModifyBracketNode::evaluate):
        * kjs/nodes.h:
        (KJS::AssignBracketNode::):
        (KJS::AssignBracketNode::precedence):
        (KJS::AssignDotNode::):
        (KJS::AssignDotNode::precedence):
        * kjs/nodes2string.cpp:
        (KJS::ReadModifyBracketNode::streamTo):
        (KJS::AssignBracketNode::streamTo):
        (KJS::ReadModifyDotNode::streamTo):
        (KJS::AssignDotNode::streamTo):

2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278
2007-10-29  Oliver Hunt  <oliver@apple.com>

        Debranching various Node::evaluate implementations
        
        Reviewed by Maciej.
        
        Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
        Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
        
        Gains 1.6% on SunSpider

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::PostIncResolveNode::optimizeVariableAccess):
        (KJS::PostIncResolveNode::evaluate):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostDecResolveNode::optimizeVariableAccess):
        (KJS::PostDecResolveNode::evaluate):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::PostIncBracketNode::evaluate):
        (KJS::PostDecBracketNode::evaluate):
        (KJS::PostIncDotNode::evaluate):
        (KJS::PostDecDotNode::evaluate):
        (KJS::PreIncResolveNode::optimizeVariableAccess):
        (KJS::PreIncLocalVarNode::evaluate):
        (KJS::PreIncResolveNode::evaluate):
        (KJS::PreDecResolveNode::optimizeVariableAccess):
        (KJS::PreDecLocalVarNode::evaluate):
        (KJS::PreDecResolveNode::evaluate):
        (KJS::PreIncBracketNode::evaluate):
        (KJS::PreDecBracketNode::evaluate):
        (KJS::PreIncDotNode::evaluate):
        (KJS::PreDecDotNode::evaluate):
        (KJS::ReadModifyResolveNode::optimizeVariableAccess):
        (KJS::AssignResolveNode::optimizeVariableAccess):
        (KJS::AssignLocalVarNode::evaluate):
        (KJS::AssignResolveNode::evaluate):
        * kjs/nodes.h:
        (KJS::PostDecResolveNode::):
        (KJS::PostDecResolveNode::precedence):
        (KJS::PostDecLocalVarNode::):
        (KJS::PostfixBracketNode::):
        (KJS::PostfixBracketNode::precedence):
        (KJS::PostIncBracketNode::):
        (KJS::PostIncBracketNode::isIncrement):
        (KJS::PostDecBracketNode::):
        (KJS::PostDecBracketNode::isIncrement):
        (KJS::PostfixDotNode::):
        (KJS::PostfixDotNode::precedence):
        (KJS::PostIncDotNode::):
        (KJS::PostIncDotNode::isIncrement):
        (KJS::PostDecDotNode::):
        (KJS::PreIncResolveNode::):
        (KJS::PreDecResolveNode::):
        (KJS::PreDecResolveNode::precedence):
        (KJS::PreDecLocalVarNode::):
        (KJS::PrefixBracketNode::):
        (KJS::PrefixBracketNode::precedence):
        (KJS::PreIncBracketNode::):
        (KJS::PreIncBracketNode::isIncrement):
        (KJS::PreDecBracketNode::):
        (KJS::PreDecBracketNode::isIncrement):
        (KJS::PrefixDotNode::):
        (KJS::PrefixDotNode::precedence):
        (KJS::PreIncDotNode::):
        (KJS::PreIncDotNode::isIncrement):
        (KJS::PreDecDotNode::):
        (KJS::ReadModifyResolveNode::):
        (KJS::ReadModifyLocalVarNode::):
        (KJS::AssignResolveNode::):
        (KJS::AssignResolveNode::precedence):
        * kjs/nodes2string.cpp:
        (KJS::PostIncResolveNode::streamTo):
        (KJS::PostDecResolveNode::streamTo):
        (KJS::PostfixBracketNode::streamTo):
        (KJS::PostfixDotNode::streamTo):
        (KJS::PreIncResolveNode::streamTo):
        (KJS::PreDecResolveNode::streamTo):
        (KJS::ReadModifyResolveNode::streamTo):
        (KJS::AssignResolveNode::streamTo):

mjs's avatar
mjs committed
2279 2280 2281 2282 2283 2284 2285 2286
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed, build fix.
        
        - Include Vector.h in a way that actually works.

        * kjs/LocalStorage.h:

mjs's avatar
mjs committed
2287 2288 2289 2290 2291 2292 2293 2294
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed, build fix.
        
        - Install LocalStorage.h as a private header.

        * JavaScriptCore.xcodeproj/project.pbxproj:

mjs's avatar
mjs committed
2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/LocalStorage.h: Added.
        (KJS::LocalStorageEntry::LocalStorageEntry):
        (WTF::):
        * kjs/function.h:
        * kjs/nodes.cpp:
        (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):

ggaren's avatar
ggaren committed
2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335
2007-10-29  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Some small tweaks that I notice while reviewing Oliver's last patch.
        
        Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
        
        No change in SunSpider because SunSpider doesn't take the code path that
        would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.

        * kjs/nodes.cpp:
        (KJS::LocalVarPostfixNode::evaluate):
        (KJS::TypeOfResolveNode::optimizeVariableAccess):
        (KJS::LocalVarTypeOfNode::evaluate):
        (KJS::PrefixResolveNode::optimizeVariableAccess):
        (KJS::LocalVarPrefixNode::evaluate):
        (KJS::AssignResolveNode::optimizeVariableAccess):
        (KJS::LocalVarAssignNode::evaluate):
        * kjs/nodes.h:
        (KJS::LocalVarTypeOfNode::):
        (KJS::PrefixResolveNode::):
        (KJS::LocalVarPrefixNode::):
        (KJS::AssignResolveNode::):
        (KJS::LocalVarAssignNode::):

2336 2337 2338 2339 2340 2341 2342 2343 2344
2007-10-29  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        SunSpider claims this was a 0.7% speedup.

        * kjs/string_object.cpp:
        (KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case

mjs's avatar
mjs committed
2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Mark.
        
        - re-enable asserts for access to empty or deleted keys

        * wtf/HashTable.h:
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):
        (WTF::::add):

2357 2358 2359 2360 2361 2362
2007-10-29  Eric Seidel  <eric@webkit.org>

        Build fix only, no review.

        * JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot

2363 2364 2365 2366 2367 2368 2369
2007-10-29  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.  Move struct declarations into nodes.h.

        * kjs/grammar.y:
        * kjs/nodes.h:

2370 2371 2372 2373 2374 2375 2376