1 2007-11-22 Simon Hausmann <hausmann@kde.org>
5 Make the directory of where to put the generated sources configurable through the GENERATED_SOURCE_DIR variable
10 2007-11-22 Simon Hausmann <hausmann@kde.org>
14 Centralize the setup for all the extra compilers in a addExtraCompiler function.
16 This allows adding a "generated_files" target that builds all generated files using "make generated_files".
17 For the build inside Qt we do not generate actual rules for the extra compilers but instead
18 do the variable substitution of compiler.output manually and add the generated sources to SOURCES.
23 2007-11-20 Mark Rowe <mrowe@apple.com>
25 Reviewed by Tim Hatcher.
27 <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings
29 Fix all warnings emitted by GCC 4.2 when building JavaScriptCore. This allows builds with
30 -Werror to succeed. At present they will crash when executed due to code that is not safe
31 under strict aliasing (<rdar://problem/5536806>).
33 * Configurations/Base.xcconfig: Remove the -Wno-long-double flag.
34 * kjs/date_object.cpp:
35 (KJS::formatTime): Test whether the stack-allocated string is empty rather than at a non-null address.
37 (Bigint::): Tweak formatting to silence warnings.
39 (match): Tweak formatting to silence warnings
40 * wtf/Assertions.cpp: Add printf format attribute to functions that warrant it.
41 * wtf/Assertions.h: Ditto.
43 2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
45 wx port build fix (wx headers include ctype functions).
49 2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
51 Remove outdated and unused Windows port files.
53 Reviewed by Adam Roben.
55 * Makefile.vc: Removed.
56 * README-Win32.txt: Removed.
58 2007-11-18 Eric Seidel <eric@webkit.org>
62 * tests/mozilla/jsDriver.pl: exit non-0 when user aborts test run
64 2007-11-17 Mark Rowe <mrowe@apple.com>
66 Reviewed by Darin Adler.
68 Fix: <rdar://problem/5607032> REGRESSION: testapi exits with assertion failure in debug build
69 <rdar://problem/5440659> JSGlobalContextCreate throws away globalObjectClass's prototype
70 http://bugs.webkit.org/show_bug.cgi?id=16033
72 Split Interpreter's initialization into two distinct steps: the creation of the global prototypes
73 and constructors, and storing them on the global object. This allows JSClassRef's passed to
74 JSGlobalContextCreate to be instantiated with the correct prototype.
76 * API/JSCallbackObject.cpp: Assert at compile-time that the custom global object will fit in a collector cell.
77 * API/JSCallbackObject.h:
78 * API/JSCallbackObjectFunctions.h:
79 (KJS::::JSCallbackObject):
81 * API/JSContextRef.cpp:
82 (JSGlobalContextCreate): Construct and set the interpreter's global object separately. When globalObjectClass
83 is passed we need to set the interpreter's global object before doing the JSCallbackObject's initialization to
84 prevent any JSObjectInitializeCallback's being invoked before a global object is set.
86 (globalObject_initialize): Test the object passed in is correct and that it has the expected global properties.
90 * API/testapi.js: Test that any static properties exposed by the global object's custom class are found.
92 * bindings/testbindings.cpp:
93 (main): Update for changes in Interpreter method signatures.
94 * bindings/testbindings.mm:
97 (KJS::ExecState::ExecState):
98 (KJS::ExecState::mark):
99 (KJS::ExecState::setGlobalObject):
100 * kjs/ExecState.h: Rename scope to m_scopeChain.
101 * kjs/interpreter.cpp:
102 (KJS::Interpreter::Interpreter):
103 (KJS::Interpreter::init):
104 (KJS::Interpreter::globalObject):
105 (KJS::Interpreter::setGlobalObject):
106 (KJS::Interpreter::resetGlobalObjectProperties):
107 (KJS::Interpreter::createObjectsForGlobalObjectProperties):
108 (KJS::Interpreter::setGlobalObjectProperties): Switch to using putDirect to ensure that the global object's put method
109 cannot interfere with setting of the global properties. This prevents a user-written JSClassRef from attempting to
110 call back into JavaScript from the initialization of the global object's members.
113 (setupInterpreter): Update for changes in Interpreter method signatures.
115 2007-11-17 Mark Rowe <mrowe@apple.com>
117 Reviewed by Sam Weinig.
119 Prevent testapi from reporting false leaks. Clear out local variables pointing at
120 JSObjectRefs to allow their values to be collected.
125 2007-11-17 Mark Rowe <mrowe@apple.com>
127 Reviewed by Sam Weinig.
129 Prevent testapi from crashing if testapi.js can not be found by nil-checking the result of createStringWithContentsOfFile.
134 2007-11-17 Alp Toker <alp@atoker.com>
138 http://bugs.webkit.org/show_bug.cgi?id=16032
139 JS minidom is not portable
141 Use a plain UTF-8 string instead of a CFString.
143 Print to stdout, not stderr like CFShow() would have done, since that
144 behaviour seems unintentional.
149 2007-11-17 Steve Falkenburg <sfalken@apple.com>
153 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
155 2007-11-16 Mark Rowe <mrowe@apple.com>
160 (KJS::Lexer::record8):
162 2007-11-16 Mark Rowe <mrowe@apple.com>
166 Replace strings, identifier, buffer8 and buffer16 members of Lexer with vectors.
167 SunSpider claims this is a 0.7% speedup.
172 (KJS::Lexer::record8):
173 (KJS::Lexer::record16):
174 (KJS::Lexer::scanRegExp):
176 (KJS::Lexer::makeIdentifier):
177 (KJS::Lexer::makeUString):
180 (KJS::UString::UString): Add a convenience constructor that takes a const Vector<UChar>&.
183 2007-11-16 Adam Roben <aroben@apple.com>
187 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add a new include path
188 and ignore the int -> bool conversion warning.
190 2007-11-16 Alexey Proskuryakov <ap@webkit.org>
192 Fix Windows debug build.
193 Rubber-stamped by Eric
195 * pcre/pcre_exec.cpp: (match): Removed ASSERT_NOT_REACHED assertions that were making MSVC
196 complain about unreachable code.
198 2007-11-15 Mark Rowe <mrowe@apple.com>
204 2007-11-15 Mark Rowe <mrowe@apple.com>
206 Mac build and header search path sanity fix.
208 Reviewed by Sam Weinig and Tim Hatcher.
210 Move base setting for HEADER_SEARCH_PATHS into Base.xcconfig, and extend
211 it in JavaScriptCore.xcconfig. This removes the need to override it on a
212 per-target basis inside the .xcodeproj file.
214 * Configurations/Base.xcconfig:
215 * Configurations/JavaScriptCore.xcconfig:
216 * JavaScriptCore.xcodeproj/project.pbxproj:
218 2007-11-15 Mark Rowe <mrowe@apple.com>
224 2007-11-15 Geoffrey Garen <ggaren@apple.com>
226 Reviewed by Eric Seidel.
228 Another round of grammar / parsing cleanup.
230 1. Created distinct parser calls for parsing function bodies vs
231 programs. This will help later with optimizing global variable access.
233 2. Turned Parser into a singleton. Cleaned up Lexer's singleton
236 3. Modified Lexer to free a little more memory when done lexing. (Added
237 FIXMEs for similar issues that I didn't fix.)
239 4. Changed Lexer::makeIdentifier and Lexer::makeUString to start
240 respecting the arguments passed to them. (No behavior change, but this
241 problem could have caused serious problems for an unsuspecting user of
244 5. Removed KJS_DEBUG_MEM because it was bit-rotted.
246 6. Removed Parser::prettyPrint because the same work was simpler to do
251 "Parser::accept" => "Parser::didFinishParsing"
252 "Parser::sid" => "Parser::m_sourceID"
253 "Lexer::doneParsing" => "Lexer::clear"
257 * JavaScriptCore.exp:
259 (KJS::Parser::Parser):
260 (KJS::Parser::parseProgram):
261 (KJS::Parser::parseFunctionBody):
262 (KJS::Parser::parse):
263 (KJS::Parser::didFinishParsing):
266 (KJS::Parser::sourceId):
268 (KJS::GlobalFuncImp::callAsFunction):
269 * kjs/function_object.cpp:
270 (FunctionObjectImp::construct):
272 * kjs/interpreter.cpp:
273 (KJS::Interpreter::checkSyntax):
274 (KJS::Interpreter::evaluate):
280 (KJS::Lexer::~Lexer):
281 (KJS::Lexer::scanRegExp):
282 (KJS::Lexer::doneParsing):
283 (KJS::Lexer::makeIdentifier):
284 (KJS::Lexer::makeUString):
286 (KJS::Lexer::pattern):
288 (KJS::Lexer::sawError):
291 (KJS::FunctionBodyNode::FunctionBodyNode):
299 2007-11-15 Oliver Hunt <oliver@apple.com>
303 <rdar://problem/5601548> REGRESSION: All SourceElements and their children leak after a syntax error
305 Add a stub node to maintain the Vector of SourceElements until assignment.
309 (KJS::SourceElementsStub::SourceElementsStub):
310 (KJS::SourceElementsStub::append):
311 (KJS::SourceElementsStub::release):
312 (KJS::SourceElementsStub::):
313 (KJS::SourceElementsStub::precedence):
315 2007-11-15 Eric Seidel <eric@webkit.org>
319 Abstract most of RMATCH into MatchStack functions.
321 SunSpider claims this, combined with the last 2 patches was a 1% speedup, 10% for dna-regexp.
323 * pcre/pcre_exec.cpp:
324 (MatchStack::canUseStackBufferForNextFrame):
325 (MatchStack::allocateNextFrame):
326 (MatchStack::pushNewFrame):
327 (MatchStack::frameIsStackAllocated):
328 (MatchStack::popCurrentFrame):
329 (MatchStack::unrollAnyHeapAllocatedFrames):
332 2007-11-15 Eric Seidel <eric@webkit.org>
336 Remove RETURN_ERROR, add MatchStack
338 * pcre/pcre_exec.cpp:
339 (MatchStack::MatchStack):
340 (MatchStack::unrollAnyHeapAllocatedFrames):
344 2007-11-15 Eric Seidel <eric@webkit.org>
348 Clean up match function to match WebKit style
350 * JavaScriptCore.xcodeproj/project.pbxproj:
351 * pcre/pcre_exec.cpp:
354 2007-11-15 Steve Falkenburg <sfalken@apple.com>
358 * JavaScriptCore.vcproj/JavaScriptCore.make:
360 2007-11-14 Alexey Proskuryakov <ap@webkit.org>
364 http://bugs.webkit.org/show_bug.cgi?id=15982
365 Improve JSString UTF-8 decoding
367 * API/JSStringRef.cpp:
368 (JSStringCreateWithUTF8CString): Use strict decoding, return 0 on error.
370 * wtf/unicode/UTF8.cpp:
371 (WTF::Unicode::convertUTF16ToUTF8):
372 (WTF::Unicode::convertUTF8ToUTF16):
373 * wtf/unicode/UTF8.h:
374 Made these function names start with a lower case letter.
376 * kjs/ustring.cpp: (KJS::UString::UTF8String): Updated for the above renaming.
378 * bindings/c/c_utility.cpp:
379 (KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback): Renamed to highlight the difference
380 from convertUTF8ToUTF16 in wtf/unicode.
381 (KJS::Bindings::convertNPStringToUTF16): Updated for the above renaming.
382 (KJS::Bindings::identifierFromNPIdentifier): Ditto.
383 * bindings/c/c_utility.h: Made convertUTF8ToUTF16WithLatin1Fallback() a file static.
385 2007-11-14 Sam Weinig <sam@webkit.org>
387 Rubber-stamped by Anders.
389 Fix the Xcode project file after it was messed up in r27402.
391 * JavaScriptCore.xcodeproj/project.pbxproj:
393 2007-11-14 Eric Seidel <eric@webkit.org>
397 More PCRE style cleanup.
399 * pcre/pcre_compile.cpp:
402 2007-11-14 Adam Roben <aroben@apple.com>
404 Clean up the bison conflict checking script
408 * DerivedSources.make:
410 2007-11-14 Eric Seidel <eric@webkit.org>
414 Another round of PCRE cleanups: inlines
416 SunSpider claims that this, combined with my previous PCRE cleanup were a 0.7% speedup, go figure.
418 * pcre/pcre_compile.cpp:
420 * pcre/pcre_exec.cpp:
423 * pcre/pcre_internal.h:
430 2007-11-14 Eric Seidel <eric@webkit.org>
434 Give PCRE a (small) bath.
435 Fix some formating and break things off into separate functions
436 http://bugs.webkit.org/show_bug.cgi?id=15993
438 * pcre/pcre_compile.cpp:
439 (calculateCompiledPatternLengthAndFlags):
440 (printCompiledRegExp):
443 * pcre/pcre_internal.h:
444 (compile_data::compile_data):
446 2007-11-14 Geoffrey Garen <ggaren@apple.com>
448 Reviewed by Eric Seidel.
450 Cleaned up the JavaScript grammar a bit.
452 1. Changed BlockNode to always hold a child vector (which may be empty),
453 eliminating a few NULL-check branches in the common execution case.
455 2. Changed the Block production to correctly report its starting and
456 ending line numbers to the debugger. (It used to report its ending line
457 as its starting line.) Also, removed duplicate line-reporting code
458 inside the BlockNode constructor.
460 3. Moved curly braces up from FunctionBody production into parent
461 productions. (I had to move the line number reporting code, too, since
462 it depends on the location of the curly braces.) This matches the ECMA
463 spec more closely, and makes some future changes I plan easier.
465 4. Fixed statementList* convenience functions to deal appropriately with
468 SunSpider reports a small and statistically insignificant speedup.
472 (KJS::statementListPushFIFO):
473 (KJS::statementListGetDeclarations):
474 (KJS::statementListInitializeDeclarationStack):
475 (KJS::statementListInitializeVariableAccessStack):
476 (KJS::BlockNode::BlockNode):
477 (KJS::BlockNode::optimizeVariableAccess):
478 (KJS::BlockNode::getDeclarations):
479 (KJS::BlockNode::execute):
480 (KJS::FunctionBodyNode::initializeDeclarationStacks):
481 (KJS::FunctionBodyNode::optimizeVariableAccess):
483 2007-11-13 Anders Carlsson <andersca@apple.com>
485 Add RefCounted.h (And remove Shared.h)
487 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
489 2007-11-13 Geoffrey Garen <ggaren@apple.com>
495 2007-11-13 Geoffrey Garen <ggaren@apple.com>
497 Reviewed by Anders Carlsson.
499 Renamed Shared to RefCounted.
502 * JavaScriptCore.xcodeproj/project.pbxproj:
505 * wtf/RefCounted.h: Copied from JavaScriptCore/wtf/Shared.h.
506 (WTF::RefCounted::RefCounted):
507 * wtf/Shared.h: Removed.
509 2007-11-13 Adam Roben <aroben@apple.com>
515 * kjs/regexp.h: Added a missing #include.
517 2007-11-13 Geoffrey Garen <ggaren@apple.com>
519 Reviewed by Sam Weinig.
521 Moved Shared.h into wtf so it could be used in more places. Deployed
522 Shared in places where JSCore previously had hand-rolled ref-counting
525 * API/JSClassRef.cpp:
526 (OpaqueJSClass::OpaqueJSClass):
528 * API/JSObjectRef.cpp:
531 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
532 * JavaScriptCore.xcodeproj/project.pbxproj:
533 * kjs/interpreter.cpp:
534 (KJS::Interpreter::init):
537 (KJS::RegExp::RegExp):
539 * wtf/Shared.h: Copied from WebCore/platform/Shared.h.
541 2007-11-13 Eric Seidel <eric@webkit.org>
545 Add an ASSERT to getTruncatedInt32 to enforce proper usage.
546 Best part about this patch? It doesn't break the web!
549 (KJS::JSImmediate::getTruncatedInt32):
550 (KJS::JSImmediate::toDouble):
551 (KJS::JSImmediate::getUInt32):
553 2007-11-13 Alexey Proskuryakov <ap@webkit.org>
557 * bindings/c/c_utility.cpp:
558 (KJS::Bindings::convertUTF8ToUTF16):
560 (KJS::UString::UTF8String):
561 * wtf/unicode/UTF8.cpp:
562 (WTF::Unicode::ConvertUTF8ToUTF16):
564 2007-11-13 Darin Adler <darin@apple.com>
568 - fix http://bugs.webkit.org/show_bug.cgi?id=11231
569 RegExp bug when handling newline characters
570 and a number of other differences between PCRE behvior
571 and JavaScript regular expressions:
573 + single-digit sequences like \4 should be treated as octal
574 character constants, unless there is a sufficient number
575 of brackets for them to be treated as backreferences
577 + \8 turns into the character "8", not a binary zero character
578 followed by "8" (same for 9)
580 + only the first 3 digits should be considered part of an
581 octal character constant (the old behavior was to decode
582 an arbitrarily long sequence and then mask with 0xFF)
584 + if \x is followed by anything other than two valid hex digits,
585 then it should simply be treated a the letter "x"; that includes
586 not supporting the \x{41} syntax
588 + if \u is followed by anything less than four valid hex digits,
589 then it should simply be treated a the letter "u"
591 + an extra "+" should be a syntax error, rather than being treated
592 as the "possessive quantifier"
594 + if a "]" character appears immediately after a "[" character that
595 starts a character class, then that's an empty character class,
596 rather than being the start of a character class that includes a
599 + a "$" should not match a terminating newline; we could have gotten
600 PCRE to handle this the way we wanted by passing an appropriate option
602 Test: fast/js/regexp-no-extensions.html
604 * pcre/pcre_compile.cpp:
605 (check_escape): Check backreferences against bracount to catch both
606 overflows and things that should be treated as octal. Rewrite octal
607 loop to not go on indefinitely. Rewrite both hex loops to match and
609 (compile_branch): Restructure loops so that we don't special-case a "]"
610 at the beginning of a character class. Remove code that treated "+" as
611 the possessive quantifier.
612 (jsRegExpCompile): Change the "]" handling here too.
614 * pcre/pcre_exec.cpp: (match): Changed CIRC to match the DOLL implementation.
615 Changed DOLL to remove handling of "terminating newline", a Perl concept
618 * tests/mozilla/expected.html: Two tests are fixed now:
619 ecma_3/RegExp/regress-100199.js and ecma_3/RegExp/regress-188206.js.
620 One test fails now: ecma_3/RegExp/perlstress-002.js -- our success before
621 was due to a bug (we treated all 1-character numeric escapes as backreferences).
622 The date tests also now both expect success -- whatever was making them fail
623 before was probably due to the time being close to a DST shift; maybe we need
624 to get rid of those tests.
626 2007-11-13 Darin Adler <darin@apple.com>
628 * kjs/JSImmediate.h: (KJS::JSImmediate::getTruncatedInt32):
629 Remove too-strong assert that was firing constantly and preventing even basic
630 web browsing from working in a debug build. This function is used in many
631 cases where the immediate value is not a number; the assertion could perhaps
632 be added back later with a bit of reorganization.
634 2007-11-13 Alp Toker <alp@atoker.com>
636 Build fix for breakage to non-Mac builds introduced in r27746.
640 2007-11-13 Eric Seidel <eric@webkit.org>
644 Clean up evaluateToBoolean functions to use inlines instead of copy/paste code
648 (KJS::GreaterNode::inlineEvaluateToBoolean):
649 (KJS::GreaterNode::evaluate):
650 (KJS::LessEqNode::inlineEvaluateToBoolean):
651 (KJS::LessEqNode::evaluate):
652 (KJS::GreaterEqNode::inlineEvaluateToBoolean):
653 (KJS::GreaterEqNode::evaluate):
654 (KJS::InNode::evaluateToBoolean):
655 (KJS::EqualNode::inlineEvaluateToBoolean):
656 (KJS::EqualNode::evaluate):
657 (KJS::NotEqualNode::inlineEvaluateToBoolean):
658 (KJS::NotEqualNode::evaluate):
659 (KJS::StrictEqualNode::inlineEvaluateToBoolean):
660 (KJS::StrictEqualNode::evaluate):
661 (KJS::NotStrictEqualNode::inlineEvaluateToBoolean):
662 (KJS::NotStrictEqualNode::evaluate):
665 2007-11-12 Geoffrey Garen <ggaren@apple.com>
667 Reviewed by Sam Weinig.
669 Fixed http://bugs.webkit.org/show_bug.cgi?id=15958
670 base64 spends 1.1% of total time checking for special Infinity case
672 Use a fast character test instead of calling strncmp.
674 1.1% speedup on string-base64. SunSpider reports a .4% speedup overall;
675 Sharks reports only .1%. Who are you going to believe? Huh?
678 (KJS::UString::toDouble):
680 2007-11-12 Eric Seidel <eric@webkit.org>
684 Add evaluateToInt32 and evaluateUInt32 methods and deploy them.
685 Fix a few missing evaluateToBoolean methods
686 Deploy all evaluateTo* functions to more nodes to avoid slowdowns
687 http://bugs.webkit.org/show_bug.cgi?id=15950
689 SunSpider claims this is at least a 1.4% speedup.
692 (KJS::JSImmediate::getTruncatedInt32):
693 (KJS::JSImmediate::toDouble):
694 (KJS::JSImmediate::getUInt32):
696 (KJS::ExpressionNode::evaluateToNumber):
697 (KJS::ExpressionNode::evaluateToInt32):
698 (KJS::ExpressionNode::evaluateToUInt32):
699 (KJS::NumberNode::evaluateToInt32):
700 (KJS::NumberNode::evaluateToUInt32):
701 (KJS::ImmediateNumberNode::evaluateToInt32):
702 (KJS::ImmediateNumberNode::evaluateToUInt32):
703 (KJS::ResolveNode::evaluate):
704 (KJS::ResolveNode::evaluateToNumber):
705 (KJS::ResolveNode::evaluateToBoolean):
706 (KJS::ResolveNode::evaluateToInt32):
707 (KJS::ResolveNode::evaluateToUInt32):
708 (KJS::LocalVarAccessNode::evaluateToInt32):
709 (KJS::LocalVarAccessNode::evaluateToUInt32):
710 (KJS::BracketAccessorNode::evaluateToNumber):
711 (KJS::BracketAccessorNode::evaluateToBoolean):
712 (KJS::BracketAccessorNode::evaluateToInt32):
713 (KJS::BracketAccessorNode::evaluateToUInt32):
714 (KJS::DotAccessorNode::inlineEvaluate):
715 (KJS::DotAccessorNode::evaluate):
716 (KJS::DotAccessorNode::evaluateToNumber):
717 (KJS::DotAccessorNode::evaluateToBoolean):
718 (KJS::DotAccessorNode::evaluateToInt32):
719 (KJS::DotAccessorNode::evaluateToUInt32):
720 (KJS::NewExprNode::inlineEvaluate):
721 (KJS::NewExprNode::evaluate):
722 (KJS::NewExprNode::evaluateToNumber):
723 (KJS::NewExprNode::evaluateToBoolean):
724 (KJS::NewExprNode::evaluateToInt32):
725 (KJS::NewExprNode::evaluateToUInt32):
726 (KJS::FunctionCallResolveNode::inlineEvaluate):
727 (KJS::FunctionCallResolveNode::evaluate):
728 (KJS::FunctionCallResolveNode::evaluateToNumber):
729 (KJS::FunctionCallResolveNode::evaluateToBoolean):
730 (KJS::FunctionCallResolveNode::evaluateToInt32):
731 (KJS::FunctionCallResolveNode::evaluateToUInt32):
732 (KJS::LocalVarFunctionCallNode::evaluate):
733 (KJS::LocalVarFunctionCallNode::evaluateToNumber):
734 (KJS::LocalVarFunctionCallNode::evaluateToBoolean):
735 (KJS::LocalVarFunctionCallNode::evaluateToInt32):
736 (KJS::LocalVarFunctionCallNode::evaluateToUInt32):
737 (KJS::FunctionCallDotNode::evaluate):
738 (KJS::FunctionCallDotNode::evaluateToNumber):
739 (KJS::FunctionCallDotNode::evaluateToBoolean):
740 (KJS::FunctionCallDotNode::evaluateToInt32):
741 (KJS::FunctionCallDotNode::evaluateToUInt32):
742 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
743 (KJS::PostDecLocalVarNode::evaluateToNumber):
744 (KJS::PostDecLocalVarNode::evaluateToBoolean):
745 (KJS::PostDecLocalVarNode::evaluateToInt32):
746 (KJS::PostDecLocalVarNode::evaluateToUInt32):
747 (KJS::typeStringForValue):
748 (KJS::UnaryPlusNode::evaluate):
749 (KJS::UnaryPlusNode::evaluateToBoolean):
750 (KJS::UnaryPlusNode::evaluateToNumber):
751 (KJS::UnaryPlusNode::evaluateToInt32):
752 (KJS::BitwiseNotNode::inlineEvaluateToInt32):
753 (KJS::BitwiseNotNode::evaluate):
754 (KJS::BitwiseNotNode::evaluateToNumber):
755 (KJS::BitwiseNotNode::evaluateToBoolean):
756 (KJS::BitwiseNotNode::evaluateToInt32):
757 (KJS::MultNode::evaluateToBoolean):
758 (KJS::MultNode::evaluateToInt32):
759 (KJS::MultNode::evaluateToUInt32):
760 (KJS::DivNode::evaluateToInt32):
761 (KJS::DivNode::evaluateToUInt32):
762 (KJS::ModNode::evaluateToBoolean):
763 (KJS::ModNode::evaluateToInt32):
764 (KJS::ModNode::evaluateToUInt32):
765 (KJS::AddNode::evaluateToNumber):
766 (KJS::AddNode::evaluateToInt32):
767 (KJS::AddNode::evaluateToUInt32):
768 (KJS::AddNumbersNode::evaluateToInt32):
769 (KJS::AddNumbersNode::evaluateToUInt32):
770 (KJS::SubNode::evaluateToInt32):
771 (KJS::SubNode::evaluateToUInt32):
772 (KJS::LeftShiftNode::inlineEvaluateToInt32):
773 (KJS::LeftShiftNode::evaluate):
774 (KJS::LeftShiftNode::evaluateToNumber):
775 (KJS::LeftShiftNode::evaluateToInt32):
776 (KJS::RightShiftNode::inlineEvaluateToInt32):
777 (KJS::RightShiftNode::evaluate):
778 (KJS::RightShiftNode::evaluateToNumber):
779 (KJS::RightShiftNode::evaluateToInt32):
780 (KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
781 (KJS::UnsignedRightShiftNode::evaluate):
782 (KJS::UnsignedRightShiftNode::evaluateToNumber):
783 (KJS::UnsignedRightShiftNode::evaluateToInt32):
784 (KJS::LessNode::inlineEvaluateToBoolean):
785 (KJS::LessNode::evaluate):
786 (KJS::LessNode::evaluateToBoolean):
787 (KJS::LessNumbersNode::inlineEvaluateToBoolean):
788 (KJS::LessNumbersNode::evaluate):
789 (KJS::LessNumbersNode::evaluateToBoolean):
790 (KJS::LessStringsNode::inlineEvaluateToBoolean):
791 (KJS::LessStringsNode::evaluate):
792 (KJS::BitAndNode::evaluate):
793 (KJS::BitAndNode::inlineEvaluateToInt32):
794 (KJS::BitAndNode::evaluateToNumber):
795 (KJS::BitAndNode::evaluateToBoolean):
796 (KJS::BitAndNode::evaluateToInt32):
797 (KJS::BitXOrNode::inlineEvaluateToInt32):
798 (KJS::BitXOrNode::evaluate):
799 (KJS::BitXOrNode::evaluateToNumber):
800 (KJS::BitXOrNode::evaluateToBoolean):
801 (KJS::BitXOrNode::evaluateToInt32):
802 (KJS::BitOrNode::inlineEvaluateToInt32):
803 (KJS::BitOrNode::evaluate):
804 (KJS::BitOrNode::evaluateToNumber):
805 (KJS::BitOrNode::evaluateToBoolean):
806 (KJS::BitOrNode::evaluateToInt32):
807 (KJS::ConditionalNode::evaluateToNumber):
808 (KJS::ConditionalNode::evaluateToInt32):
809 (KJS::ConditionalNode::evaluateToUInt32):
810 (KJS::valueForReadModifyAssignment):
811 (KJS::AssignExprNode::evaluate):
812 (KJS::AssignExprNode::evaluateToBoolean):
813 (KJS::AssignExprNode::evaluateToNumber):
814 (KJS::AssignExprNode::evaluateToInt32):
815 (KJS::VarDeclNode::handleSlowCase):
817 (KJS::FunctionCallResolveNode::precedence):
818 (KJS::AddNode::precedence):
820 (KJS::LessNumbersNode::):
821 (KJS::LessStringsNode::):
823 (KJS::JSValue::toInt32SlowCase):
824 (KJS::JSValue::toUInt32SlowCase):
826 (KJS::JSValue::asCell):
827 (KJS::JSValue::toInt32):
828 (KJS::JSValue::toUInt32):
830 2007-11-12 Alexey Proskuryakov <ap@webkit.org>
834 http://bugs.webkit.org/show_bug.cgi?id=15953
835 Add UTF-8 encoding/decoding to WTF
837 * kjs/ustring.h: Moved UTF8SequenceLength() and decodeUTF8Sequence() to wtf/unicode.
838 * kjs/ustring.cpp: (KJS::UString::UTF8String): Changed this function to take a strict/lenient
839 parameter. Callers are not interested in getting decoding results in strict mode, so
840 this allows for bailing out as soon as an error is seen.
843 (KJS::encode): Updated for new UString::UTF8String() signature.
845 * API/JSStringRef.cpp:
846 (JSStringCreateWithCharacters): Disambiguate UChar.
847 (JSStringCreateWithUTF8CString): Actually use UTF-8 when creating the string!
848 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16): Use ConvertUTF8ToUTF16().
850 * wtf/unicode/UTF8.cpp: Added.
851 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII):
852 (WTF::Unicode::inlineUTF8SequenceLength):
853 (WTF::Unicode::UTF8SequenceLength):
854 (WTF::Unicode::decodeUTF8Sequence):
856 (WTF::Unicode::ConvertUTF16ToUTF8):
857 (WTF::Unicode::isLegalUTF8):
858 (WTF::Unicode::ConvertUTF8ToUTF16):
859 * wtf/unicode/UTF8.h: Added.
861 Some code moved from ustring.h, some adapted from unicode.org sources.
863 * JavaScriptCore.exp:
864 * JavaScriptCore.pri:
865 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
866 * JavaScriptCore.xcodeproj/project.pbxproj:
867 * JavaScriptCoreSources.bkl:
870 2007-11-12 Josh Aas <joshmoz@gmail.com>
874 - http://bugs.webkit.org/show_bug.cgi?id=15946
875 add NPPValue NPPVpluginDrawingModel (Mozilla bug 403418 compat)
879 2007-11-12 Darin Adler <darin@apple.com>
883 - http://bugs.webkit.org/show_bug.cgi?id=15951
884 REGRESSION: assertion failure in regexp match() when running JS tests
886 Test: fast/js/regexp-many-brackets.html
888 * pcre/pcre_exec.cpp: (match): Added back accidentally-removed case for
889 the BRANUMBER opcode.
891 2007-11-12 Darin Adler <darin@apple.com>
895 - fix use of prefix and config.h, got rid of a few unneeded things in
896 the PCRE code; no behavior changes
898 * API/JSBase.cpp: Added include of config.h.
899 * API/JSCallbackConstructor.cpp: Ditto.
900 * API/JSCallbackFunction.cpp: Ditto.
901 * API/JSCallbackObject.cpp: Ditto.
902 * API/JSClassRef.cpp: Ditto.
903 * API/JSContextRef.cpp: Ditto.
904 * API/JSObjectRef.cpp: Ditto.
905 * API/JSStringRef.cpp: Ditto.
906 * API/JSValueRef.cpp: Ditto.
908 * JavaScriptCorePrefix.h: Removed obsolete <ctype.h> workaround.
909 Moved new/delete macros after includes, as they are in WebCore's prefix.
912 * pcre/dftables.cpp: (main): Changed back to not use a separate maketables
913 function. This is needed for PCRE, but not helpful for our use. Also changed
914 the tables to all be 128 entries long instead of 256, since only the first
917 * pcre/pcre_compile.cpp: Added include of config.h. Eliminated digitab,
918 which was only being used to check hex digits. Changed all uses of TRUE and
919 FALSE to use the C++ true and false instead.
920 (check_escape): Just the TRUE/FALSE thing.
921 (is_counted_repeat): Ditto.
922 (could_be_empty_branch): Ditto.
923 (get_othercase_range): Ditto.
924 (compile_branch): Ditto.
925 (compile_regex): Ditto.
926 (is_anchored): Ditto.
927 (is_startline): Ditto.
928 (find_firstassertedchar): Ditto.
929 (jsRegExpCompile): Ditto.
931 * pcre/pcre_exec.cpp: Added include of config.h. Changed all uses of TRUE and
932 FALSE to use the C++ true and false instead.
933 (match_ref): Just the TRUE/FALSE thing.
934 (match): Ditto. Removed some unneeded braces.
935 (jsRegExpExecute): Just the TRUE/FALSE thing.
937 * pcre/pcre_internal.h: Moved the constants needed by dftables.cpp to the top
938 of the file instead of the bottom, so they can be used. Also changed the table
939 sizes to 128 instead of 256. Removed macro definitions of FALSE and TRUE.
940 Set array sizes for all the const arrays. Changed _pcre_utf8_table1_size to
941 be a macro instead of a extern int.
943 * pcre/pcre_maketables.cpp: Removed. It's all in dftables.cpp now.
945 * pcre/pcre_tables.cpp: Made table sizes explicit.
947 * pcre/pcre_xclass.cpp: Just the TRUE/FALSE thing.
949 2007-11-12 Adam Roben <aroben@apple.com>
953 * wtf/FastMalloc.h: Add missing using statement.
955 2007-11-11 Oliver Hunt <oliver@apple.com>
959 Add special fastZeroedMalloc function to replace a
960 number of fastCalloc calls where one argument was 1.
962 This results in a 0.4% progression in SunSpider, more
963 than making up for the earlier regression caused by
964 additional overflow checks.
966 * JavaScriptCore.exp:
967 * kjs/array_instance.cpp:
968 * kjs/property_map.cpp:
969 * wtf/FastMalloc.cpp:
973 2007-11-11 Adam Roben <aroben@apple.com>
975 Fix <rdar://5578982> ASSERT in HashTable::checkTableConsistencyExceptSize beneath WebNotificationCenter
977 The bug was due to a mismatch between HashMap::remove and
978 HashTable::checkTableConsistency. HashMap::remove can delete the value
979 stored in the HashTable (by derefing it), which is not normally
980 allowed by HashTable. It's OK in this case because the value is about
981 to be removed from the table, but HashTable wasn't aware of this.
983 HashMap::remove now performs the consistency check itself before
986 Darin noticed that the same bug would occur in HashSet, so I've fixed
992 (WTF::HashMap::remove): Perform the HashTable consistency check
993 manually before calling deref.
995 (WTF::HashSet::remove): Ditto.
996 * wtf/HashTable.h: Made checkTableConsistency public so that HashMap
997 and HashSet can call it.
998 (WTF::HashTable::removeAndInvalidateWithoutEntryConsistencyCheck):
1000 (WTF::HashTable::removeAndInvalidate): Added.
1001 (WTF::HashTable::remove):
1002 (WTF::HashTable::removeWithoutEntryConsistencyCheck): Added.
1004 2007-11-11 Mark Rowe <mrowe@apple.com>
1006 Build fix. Use the correct filename case.
1010 2007-11-11 Geoffrey Garen <ggaren@apple.com>
1012 Reviewed by Sam Weinig.
1014 Fixed http://bugs.webkit.org/show_bug.cgi?id=15902
1015 15% of string-validate-input.js is spent compiling the same regular expression
1017 Store a compiled representation of the regular expression in the AST.
1019 Only a .2% SunSpider speedup overall, but a 10.6% speedup on
1020 string-validate-input.js.
1023 (KJS::RegExpNode::evaluate):
1025 (KJS::RegExpNode::):
1026 * kjs/nodes2string.cpp:
1027 (KJS::RegExpNode::streamTo):
1029 (KJS::RegExp::flags):
1031 (KJS::RegExp::pattern):
1032 * kjs/regexp_object.cpp:
1033 (KJS::RegExpObjectImp::construct):
1034 (KJS::RegExpObjectImp::createRegExpImp):
1035 * kjs/regexp_object.h:
1037 2007-11-11 Oliver Hunt <oliver@apple.com>
1041 Partial fix for <rdar://problem/5585334> numfuzz: integer overflows opening malformed SVG file in WebCore::ImageBuffer::create
1043 Unfortunately this is a very slight regression, but is unavoidable.
1045 * wtf/FastMalloc.cpp:
1047 2007-11-10 Eric Seidel <eric@webkit.org>
1051 Add simple type inferencing to the parser, and create custom
1052 AddNode and LessNode subclasses based on inferred types.
1053 http://bugs.webkit.org/show_bug.cgi?id=15884
1055 SunSpider claims this is at least a 0.5% speedup.
1057 * JavaScriptCore.exp:
1060 (KJS::NumberImp::getPrimitiveNumber):
1061 (KJS::GetterSetterImp::getPrimitiveNumber):
1067 (KJS::StringNode::evaluate):
1068 (KJS::StringNode::evaluateToNumber):
1069 (KJS::StringNode::evaluateToBoolean):
1070 (KJS::RegExpNode::evaluate):
1071 (KJS::UnaryPlusNode::optimizeVariableAccess):
1072 (KJS::AddNode::evaluate):
1073 (KJS::AddNode::evaluateToNumber):
1074 (KJS::AddNumbersNode::inlineEvaluateToNumber):
1075 (KJS::AddNumbersNode::evaluate):
1076 (KJS::AddNumbersNode::evaluateToNumber):
1077 (KJS::AddStringsNode::evaluate):
1078 (KJS::AddStringLeftNode::evaluate):
1079 (KJS::AddStringRightNode::evaluate):
1082 (KJS::LessNumbersNode::evaluate):
1083 (KJS::LessStringsNode::evaluate):
1085 (KJS::ExpressionNode::):
1086 (KJS::RegExpNode::):
1087 (KJS::RegExpNode::precedence):
1088 (KJS::TypeOfResolveNode::):
1089 (KJS::LocalVarTypeOfNode::):
1090 (KJS::UnaryPlusNode::):
1091 (KJS::UnaryPlusNode::precedence):
1093 (KJS::AddNode::precedence):
1094 (KJS::AddNumbersNode::):
1095 (KJS::AddStringLeftNode::):
1096 (KJS::AddStringRightNode::):
1097 (KJS::AddStringsNode::):
1099 (KJS::LessNode::precedence):
1100 (KJS::LessNumbersNode::):
1101 (KJS::LessStringsNode::):
1102 * kjs/nodes2string.cpp:
1103 (KJS::StringNode::streamTo):
1107 (KJS::JSValue::getPrimitiveNumber):
1109 2007-11-11 Darin Adler <darin@apple.com>
1111 - try another way of fixing dftables builds -- refactor pcre_internal.h a bit
1113 * pcre/pcre_internal.h: Make most of this header do nothing when DFTABLES is set.
1114 Later we can break it into two files.
1116 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Take out now-unneeded include paths.
1117 * pcre/dftables.cpp: Set DFTABLES. Use delete instead of free.
1118 * pcre/dftables.pro: Take out now-unneeded include paths.
1119 * pcre/pcre_maketables.cpp: Use new instead of malloc.
1121 2007-11-11 Darin Adler <darin@apple.com>
1123 * pcre/dftables.pro: Try fixing Qt builds (I looked at qt-win) by adding
1124 another include path.
1126 2007-11-11 Darin Adler <darin@apple.com>
1128 * JavaScriptCore.xcodeproj/project.pbxproj: Try fixing Mac Tiger builds
1129 by adding another include path.
1131 2007-11-11 Darin Adler <darin@apple.com>
1135 - http://bugs.webkit.org/show_bug.cgi?id=15924
1136 next round of changes to JSRegExp (formerly PCRE)
1138 This is a combination of converting to C++, tweaking the API, and adding
1139 some additional optimizations.
1141 Future steps will involve getting rid of the use of UTF-8 completely
1142 (we'll use UTF-16 exclusively instead), eliminating more source files,
1143 and some more speed-ups.
1145 SunSpider says the current round is an 0.9% speed-up overall, and a
1146 5.3% speed-up for regexp.
1148 * JavaScriptCore.exp: Updated for new entry points.
1150 * JavaScriptCore.pri:
1151 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1152 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1153 * JavaScriptCore.xcodeproj/project.pbxproj:
1154 * JavaScriptCoreSources.bkl:
1156 Updated for new source file names and ForwardingHeaders.
1159 (KJS::RegExp::RegExp): Changed to use the error message without calling
1160 strdup on it and to pass the new types and options.
1161 (KJS::RegExp::~RegExp): Removed the now-unneeded free of the error message.
1162 (KJS::RegExp::match): Pass the new types and options.
1163 * kjs/regexp.h: Update type of m_constructionError.
1165 * pcre/AUTHORS: Update to reflect the status of the project -- we don't include
1166 the Google parts, and this isn't the PCRE library, per se.
1167 * pcre/COPYING: Ditto.
1169 * pcre/dftables.cpp: Copied from JavaScriptCore/pcre/dftables.c.
1170 (main): Removed unneeded ctype_digit.
1172 * pcre/pcre.h: Convert to C++, tweak API a bit. Use UChar instead of JSRegExpChar.
1174 * pcre/pcre_compile.cpp: Copied from JavaScriptCore/pcre/pcre_compile.c.
1175 Moved a lot of private stuff used only within this file here from pcre_internal.h.
1176 Renumbered the error codes.
1177 (error_text): Use a single string with embedded nulls for the error text (I got
1178 this idea from newer versions of PCRE).
1179 (check_escape): Changed return type to be enum instead of int. Replaced ctype_digit
1180 uses with isASCIIDigit.
1181 (is_counted_repeat): Ditto.
1182 (read_repeat_counts): Ditto.
1183 (first_significant_code): Ditto.
1184 (find_fixedlength): Ditto.
1185 (could_be_empty_branch): Ditto.
1186 (compile_branch): Ditto. Also removed some code that handles changing options.
1187 JavaScript doesn't have any of the features that allow options to change.
1188 (compile_regex): Updated for change to options parameter.
1189 (is_anchored): Ditto.
1190 (find_firstassertedchar): Ditto.
1191 (jsRegExpCompile): Changed to take separate flags instead of an options int.
1192 Also changed to call new/delete instead of pcre_malloc/free.
1193 (jsRegExpFree): Ditto.
1195 * pcre/pcre_exec.cpp: Copied from JavaScriptCore/pcre/pcre_exec.c.
1196 Added a case that uses computed goto for the opcode loop, but did not turn it on.
1197 Changed the RMATCH macro to handle returns more efficiently by putting the where
1198 pointer in the new frame instead of the old one, allowing us to branch to the
1199 return with a single statement. Switched to new/delete from pcre_malloc/free.
1200 Changed many RRETURN callers to not set the return value since it's already
1201 set correctly. Replaced the rrc variable with an is_match variable. Values other
1202 than "match" and "no match" are now handled differently. This allows us to remove
1203 the code to check for those cases in various rules.
1204 (match): All the case statements use a macro BEGIN_OPCODE instead. And all the
1205 continue statements, or break statements that break out of the outer case use
1206 a macro NEXT_OPCODE instead. Replaced a few if statements with assertions.
1207 (jsRegExpExecute): Use new/delete instead of pcre_malloc/free. Removed unused
1208 start_match field from the match block.
1210 * pcre/pcre_internal.h: Moved the last few configuration macros from pcre-config.h
1211 in here. Removed various unused types. Converted from JSRegExpChar to UChar.
1212 Eliminated pcre_malloc/free. Replaced the opcode enum with a macro that can be
1213 used in multiple places. Unfortunately we lose the comments for each opcode; we
1214 should find a place to put those back. Removed ctype_digit.
1216 * pcre/pcre_maketables.cpp: Copied from JavaScriptCore/pcre/pcre_maketables.c.
1217 (pcre_maketables): Got rid of the conditional code that allows this to be compiled
1218 in -- it's only used for dftables now (and soon may be obsolete entirely).
1219 Changed code for cbit_digit to not use isdigit, and took the "_" case out of the
1220 loop. Removed ctype_digit.
1222 * pcre/pcre_ord2utf8.cpp: Copied from JavaScriptCore/pcre/pcre_ord2utf8.c.
1224 * pcre/pcre_tables.cpp: Copied from JavaScriptCore/pcre/pcre_tables.c.
1225 Moved _pcre_OP_lengths out of here into pcre_exec.cpp.
1227 * pcre/pcre_ucp_searchfuncs.cpp: Copied from JavaScriptCore/pcre/pcre_ucp_searchfuncs.c.
1228 Updated for other file name changes.
1230 * pcre/pcre_xclass.cpp: Copied from JavaScriptCore/pcre/pcre_xclass.c.
1232 * pcre/ucpinternal.h: Updated header.
1234 * pcre/ucptable.cpp: Copied from JavaScriptCore/pcre/ucptable.c.
1236 * wtf/ASCIICType.h: (WTF::isASCIIDigit): Removed a branch by changing from && to
1237 & for this operation. Also added an overload that takes an int because that's
1238 useful for PCRE. Later we could optimize for int and overload other functions in
1239 this file; stuck to this simple one for now.
1241 * wtf/unicode/icu/UnicodeIcu.h: Removed unused isUpper.
1242 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
1244 * pcre/LICENCE: Removed.
1245 * pcre/pcre-config.h: Removed.
1246 * wtf/FastMallocPCRE.cpp: Removed.
1248 * pcre/dftables.c: Renamed to cpp.
1249 * pcre/pcre_compile.c: Ditto.
1250 * pcre/pcre_exec.c: Ditto.
1251 * pcre/pcre_maketables.c: Ditto.
1252 * pcre/pcre_ord2utf8.c: Ditto.
1253 * pcre/pcre_tables.c: Ditto.
1254 * pcre/pcre_ucp_searchfuncs.c: Ditto.
1255 * pcre/pcre_xclass.c: Ditto.
1256 * pcre/ucptable.c: Ditto.
1258 2007-11-11 Eric Seidel <eric@webkit.org>
1262 Add KJS_CHECKEXCEPTIONBOOLEAN to match rest of nodes.cpp
1265 (KJS::ExpressionNode::evaluateToBoolean):
1266 (KJS::LessNode::evaluateToBoolean):
1267 (KJS::GreaterNode::evaluateToBoolean):
1268 (KJS::LessEqNode::evaluateToBoolean):
1269 (KJS::GreaterEqNode::evaluateToBoolean):
1270 (KJS::InstanceOfNode::evaluateToBoolean):
1271 (KJS::InNode::evaluateToBoolean):
1272 (KJS::EqualNode::evaluateToBoolean):
1273 (KJS::NotEqualNode::evaluateToBoolean):
1274 (KJS::StrictEqualNode::evaluateToBoolean):
1275 (KJS::NotStrictEqualNode::evaluateToBoolean):
1276 (KJS::LogicalAndNode::evaluateToBoolean):
1277 (KJS::LogicalOrNode::evaluateToBoolean):
1278 (KJS::ConditionalNode::evaluateToBoolean):
1280 2007-11-10 Darin Adler <darin@apple.com>
1284 - fix http://bugs.webkit.org/show_bug.cgi?id=15927
1285 REGRESSION(r27487): delete a.c followed by __defineGetter__("c", ...) incorrectly deletes another property
1286 and <rdar://problem/5586384> REGRESSION (r27487): Can't switch out of Edit HTML Source mode on Leopard Wiki
1288 Test: fast/js/delete-then-put.html
1290 * kjs/property_map.cpp:
1291 (KJS::PropertyMap::put): Added a missing "- 1"; code to find an empty slot was not working.
1292 (KJS::PropertyMap::checkConsistency): Added a missing range check that would have caught this
1295 - roll out a last-minute change to my evaluateToBoolean patch that was incorrect.
1297 * kjs/nodes.h: (KJS::ExprStatementNode::ExprStatementNode): Take out call to
1298 optimizeForUnnecessaryResult, since the result is used in some cases.
1300 2007-11-10 Adam Roben <aroben@apple.com>
1304 Roll out some changes that were (seemingly accidentally) checked in
1307 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1309 2007-11-10 Darin Adler <darin@apple.com>
1313 - http://bugs.webkit.org/show_bug.cgi?id=15915
1314 add an evaluation path for booleans like the one we have for numbers
1316 Gives 1.1% on SunSpider.
1318 * kjs/grammar.y: Create TrueNode and FalseNode instead of BooleanNode.
1320 * kjs/nodes.h: Changed to use Noncopyable. Moved optimizeForUnnecessaryResult
1321 down from Node to ExpressionNode. Changed some classes to not inherit from
1322 ExpressionNode where not necessary, and removed unnneeded evaluate functions
1323 as well as evaluate functions that need not be virtual. Call the
1324 optimizeForUnnecessaryResult function on the start of a for loop too.
1326 (KJS::ExpressionNode::evaluateToBoolean): Added.
1327 (KJS::FalseNode::evaluate): Added.
1328 (KJS::TrueNode::evaluate): Added.
1329 (KJS::NumberNode::evaluateToBoolean): Added.
1330 (KJS::StringNode::evaluateToBoolean): Added.
1331 (KJS::LocalVarAccessNode::evaluateToBoolean): Added.
1332 (KJS::BracketAccessorNode::evaluateToBoolean): Added.
1333 (KJS::LogicalNotNode::evaluate): Changed to call evaluateToBoolean.
1334 (KJS::LogicalNotNode::evaluateToBoolean): Added.
1335 (KJS::lessThan): Changed to return bool.
1336 (KJS::lessThanEq): Ditto.
1337 (KJS::LessNode::evaluate): Changed since lessThan returns bool.
1338 (KJS::LessNode::evaluateToBoolean): Added.
1339 (KJS::GreaterNode::evaluate): Changed since lessThanEq returns bool.
1340 (KJS::GreaterNode::evaluateToBoolean): Added.
1341 (KJS::LessEqNode::evaluate): Changed since lessThanEq returns bool.
1342 (KJS::LessEqNode::evaluateToBoolean): Added.
1343 (KJS::GreaterEqNode::evaluate): Changed since lessThan returns bool.
1344 (KJS::GreaterEqNode::evaluateToBoolean): Added.
1345 (KJS::InstanceOfNode::evaluateToBoolean): Added.
1346 (KJS::InNode::evaluateToBoolean): Added.
1347 (KJS::EqualNode::evaluateToBoolean): Added.
1348 (KJS::NotEqualNode::evaluateToBoolean): Added.
1349 (KJS::StrictEqualNode::evaluateToBoolean): Added.
1350 (KJS::NotStrictEqualNode::evaluateToBoolean): Added.
1351 (KJS::ConditionalNode::evaluate): Changed to call evaluateToBoolean.
1352 (KJS::IfNode::execute): Ditto.
1353 (KJS::DoWhileNode::execute): Ditto.
1354 (KJS::WhileNode::execute): Ditto.
1355 (KJS::ForNode::execute): Ditto.
1357 * kjs/nodes2string.cpp:
1358 (KJS::FalseNode::streamTo): Added.
1359 (KJS::TrueNode::streamTo): Added.
1361 2007-11-09 Adam Roben <aroben@apple.com>
1368 (KJS::jsNumber): Add some explicit casts.
1370 2007-11-08 Darin Adler <darin@apple.com>
1376 * kjs/property_map.cpp:
1378 2007-11-08 Darin Adler <darin@apple.com>
1380 - roll out accidentally-checked in changes
1382 * kjs/nodes.cpp: Back to previous version.
1383 * kjs/nodes.h: Ditto.
1384 * kjs/grammar.y: Ditto.
1386 2007-11-08 Darin Adler <darin@apple.com>
1390 - http://bugs.webkit.org/show_bug.cgi?id=15912
1391 fasta spends a lot of time in qsort
1393 * kjs/property_map.cpp:
1394 (KJS::PropertyMap::getEnumerablePropertyNames):
1395 Use insertion sort instead of qsort for small sets of property names.
1396 We can probably do some even-better speedups of for/in, but this nets
1397 0.6% overall and 6.7% on fasta.
1399 2007-11-08 Darin Adler <darin@apple.com>
1403 - http://bugs.webkit.org/show_bug.cgi?id=15906
1404 getting characters by indexing into a string is very slow
1406 This fixes one source of the slowness -- the conversion to an unused
1407 Identifier as we call the get function from the slot -- but doesn't
1408 fix others, such as the fact that we have to allocate a new UString::Rep
1409 for every single character.
1411 Speeds up string-base64 30%, and at least 0.5% overall.
1412 But does slow down access-fannkuch quite a bit. Might be worth
1413 revisiting in the future to see what we can do about that (although
1414 I did look at a profile for a while).
1416 * kjs/property_slot.h: Add a new marker for "numeric" property slots;
1417 slots where we don't need to pass the identifier to the get function.
1418 (KJS::PropertySlot::getValue): Added code to call the numeric get function.
1419 (KJS::PropertySlot::setCustomNumeric): Added.
1420 * kjs/string_object.cpp:
1421 (KJS::StringInstance::indexGetter): Changed to use substr() instead
1422 of constructing a wholly new UString each time.
1423 (KJS::stringInstanceNumericPropertyGetter): Added. Like indexGetter, but
1424 takes advantage of setCustomNumeric to avoid creating an Identifier.
1425 (KJS::StringInstance::getOwnPropertySlot): Changed to use setCustomNumeric.
1427 2007-11-08 Darin Adler <darin@apple.com>
1431 - http://bugs.webkit.org/show_bug.cgi?id=15904
1432 more speed-ups possible by tightening up int version of JSImmediate
1434 1% improvement of SunSpider
1436 * kjs/JSImmediate.h: Eliminate the now-unneeded FPBitValues struct template.
1437 (KJS::JSImmediate::from): Overload for most numeric types; many types can
1438 do fewer branches and checks.
1439 (KJS::JSImmediate::getUInt32): Removed unneeded check for undefined.
1440 (KJS::JSImmediate::getTruncatedInt32): Ditto.
1441 (KJS::JSImmediate::getTruncatedUInt32): Ditto. There's no difference any more
1442 between getUInt32 and getTruncatedUInt32, so that's worth a rename and merge later.
1444 * kjs/grammar.y: Update since fromDouble is now just from.
1445 * kjs/nodes.h: Ditto.
1447 * kjs/value.h: (KJS::jsNumber): Overload for most numeric types.
1449 2007-11-08 Kevin Ollivier <kevino@theolliviers.com>
1451 Bakefiles for building JavaScriptCore, needed by wx port.
1453 Reviewed by Mark Rowe.
1455 * JavaScriptCoreSources.bkl: Added.
1456 * jscore.bkl: Added.
1458 2007-11-08 Oliver Hunt <oliver@apple.com>
1462 Fix regression caused by earlier bitwise and optimisation. 1 & undefined != 1.
1464 The implementation of JSImmediate::areBothImmediateNumbers relies on
1465 (JSImmediate::getTag(immediate1) & JSImmediate::getTag(immediate2)) having
1466 a unique result when both immediate values are numbers.
1468 The regression was due to UndefinedType & NumberType returning NumberType (3 & 1).
1469 By swapping the value of NumberType and UndefinedType this ceases to be a problem.
1474 2007-11-08 Darin Adler <darin@apple.com>
1478 * kjs/nodes.h: Add missing parameter name.
1480 2007-11-08 Eric Seidel <eric@webkit.org>
1484 Add ExpressionNode subclass of Node, use it.
1488 (KJS::ForInNode::ForInNode):
1490 (KJS::ExpressionNode::):
1492 (KJS::NullNode::precedence):
1493 (KJS::BooleanNode::):
1494 (KJS::BooleanNode::precedence):
1495 (KJS::RegExpNode::):
1496 (KJS::RegExpNode::precedence):
1498 (KJS::ThisNode::precedence):
1499 (KJS::ResolveNode::):
1500 (KJS::ElementNode::):
1502 (KJS::PropertyNode::):
1503 (KJS::PropertyNode::precedence):
1504 (KJS::PropertyNode::name):
1505 (KJS::PropertyListNode::):
1506 (KJS::ObjectLiteralNode::):
1507 (KJS::ObjectLiteralNode::precedence):
1508 (KJS::BracketAccessorNode::):
1509 (KJS::DotAccessorNode::):
1510 (KJS::DotAccessorNode::precedence):
1511 (KJS::ArgumentListNode::):
1512 (KJS::ArgumentsNode::):
1513 (KJS::NewExprNode::):
1514 (KJS::NewExprNode::precedence):
1515 (KJS::FunctionCallValueNode::):
1516 (KJS::FunctionCallValueNode::precedence):
1517 (KJS::FunctionCallResolveNode::):
1518 (KJS::FunctionCallBracketNode::):
1519 (KJS::FunctionCallBracketNode::precedence):
1520 (KJS::FunctionCallDotNode::):
1521 (KJS::FunctionCallDotNode::precedence):
1522 (KJS::PrePostResolveNode::):
1523 (KJS::PostfixBracketNode::):
1524 (KJS::PostfixBracketNode::precedence):
1525 (KJS::PostIncBracketNode::):
1526 (KJS::PostIncBracketNode::isIncrement):
1527 (KJS::PostDecBracketNode::):
1528 (KJS::PostDecBracketNode::isIncrement):
1529 (KJS::PostfixDotNode::):
1530 (KJS::PostfixDotNode::precedence):
1531 (KJS::PostIncDotNode::):
1532 (KJS::PostIncDotNode::isIncrement):
1533 (KJS::PostDecDotNode::):
1534 (KJS::PostDecDotNode::isIncrement):
1535 (KJS::PostfixErrorNode::):
1536 (KJS::PostfixErrorNode::precedence):
1537 (KJS::DeleteResolveNode::):
1538 (KJS::DeleteBracketNode::):
1539 (KJS::DeleteBracketNode::precedence):
1540 (KJS::DeleteDotNode::):
1541 (KJS::DeleteDotNode::precedence):
1542 (KJS::DeleteValueNode::):
1543 (KJS::DeleteValueNode::precedence):
1545 (KJS::VoidNode::precedence):
1546 (KJS::TypeOfResolveNode::):
1547 (KJS::TypeOfValueNode::):
1548 (KJS::PrefixBracketNode::):
1549 (KJS::PrefixBracketNode::precedence):
1550 (KJS::PreIncBracketNode::):
1551 (KJS::PreIncBracketNode::isIncrement):
1552 (KJS::PreDecBracketNode::):
1553 (KJS::PreDecBracketNode::isIncrement):
1554 (KJS::PrefixDotNode::):
1555 (KJS::PrefixDotNode::precedence):
1556 (KJS::PreIncDotNode::):
1557 (KJS::PreIncDotNode::isIncrement):
1558 (KJS::PreDecDotNode::):
1559 (KJS::PreDecDotNode::isIncrement):
1560 (KJS::PrefixErrorNode::):
1561 (KJS::PrefixErrorNode::precedence):
1562 (KJS::UnaryPlusNode::):
1563 (KJS::UnaryPlusNode::precedence):
1564 (KJS::NegateNode::):
1565 (KJS::NegateNode::precedence):
1566 (KJS::BitwiseNotNode::):
1567 (KJS::BitwiseNotNode::precedence):
1568 (KJS::LogicalNotNode::):
1569 (KJS::LogicalNotNode::precedence):
1571 (KJS::AddNode::precedence):
1572 (KJS::LeftShiftNode::):
1573 (KJS::LeftShiftNode::precedence):
1574 (KJS::RightShiftNode::):
1575 (KJS::RightShiftNode::precedence):
1576 (KJS::UnsignedRightShiftNode::):
1577 (KJS::UnsignedRightShiftNode::precedence):
1579 (KJS::LessNode::precedence):
1580 (KJS::GreaterNode::):
1581 (KJS::GreaterNode::precedence):
1582 (KJS::LessEqNode::):
1583 (KJS::LessEqNode::precedence):
1584 (KJS::GreaterEqNode::):
1585 (KJS::GreaterEqNode::precedence):
1586 (KJS::InstanceOfNode::):
1587 (KJS::InstanceOfNode::precedence):
1589 (KJS::InNode::precedence):
1591 (KJS::EqualNode::precedence):
1592 (KJS::NotEqualNode::):
1593 (KJS::NotEqualNode::precedence):
1594 (KJS::StrictEqualNode::):
1595 (KJS::StrictEqualNode::precedence):
1596 (KJS::NotStrictEqualNode::):
1597 (KJS::NotStrictEqualNode::precedence):
1598 (KJS::BitAndNode::):
1599 (KJS::BitAndNode::precedence):
1601 (KJS::BitOrNode::precedence):
1602 (KJS::BitXOrNode::):
1603 (KJS::BitXOrNode::precedence):
1604 (KJS::LogicalAndNode::):
1605 (KJS::LogicalAndNode::precedence):
1606 (KJS::LogicalOrNode::):
1607 (KJS::LogicalOrNode::precedence):
1608 (KJS::ConditionalNode::):
1609 (KJS::ConditionalNode::precedence):
1610 (KJS::ReadModifyResolveNode::):
1611 (KJS::ReadModifyResolveNode::precedence):
1612 (KJS::AssignResolveNode::):
1613 (KJS::AssignResolveNode::precedence):
1614 (KJS::ReadModifyBracketNode::):
1615 (KJS::ReadModifyBracketNode::precedence):
1616 (KJS::AssignBracketNode::):
1617 (KJS::AssignBracketNode::precedence):
1618 (KJS::AssignDotNode::):
1619 (KJS::AssignDotNode::precedence):
1620 (KJS::ReadModifyDotNode::):
1621 (KJS::ReadModifyDotNode::precedence):
1622 (KJS::AssignErrorNode::):
1623 (KJS::AssignErrorNode::precedence):
1625 (KJS::CommaNode::precedence):
1626 (KJS::AssignExprNode::):
1627 (KJS::AssignExprNode::precedence):
1628 (KJS::ExprStatementNode::):
1630 (KJS::DoWhileNode::):
1632 (KJS::ReturnNode::):
1635 (KJS::ParameterNode::):
1636 (KJS::CaseClauseNode::):
1637 (KJS::CaseClauseNode::precedence):
1638 (KJS::ClauseListNode::):
1639 (KJS::SwitchNode::):
1641 2007-11-08 Oliver Hunt <oliver@apple.com>
1645 Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).
1647 This only improves bitwise-and performance, as the additional logic required
1648 for similar code paths on or, xor, and shifting requires additional operations
1649 and branches that negate (and in certain cases, regress) any advantage we might
1652 This improves performance on all bitop tests, the cryptography tests, as well as
1653 the string-base64 and string-unpack-code tests. No significant degradation on
1656 * kjs/JSImmediate.h:
1657 (KJS::JSImmediate::areBothImmediateNumbers):
1658 (KJS::JSImmediate::andImmediateNumbers):
1660 (KJS::BitAndNode::evaluate):
1662 (KJS::jsNumberFromAnd):
1664 2007-11-08 Adam Roben <aroben@apple.com>
1666 Stop using KJS inside of MathExtras.h
1670 * wtf/MathExtras.h: Removed an unused header, and a now-unused
1671 forward-declaration.
1672 (wtf_atan2): Use std::numeric_limits intead of KJS.
1674 2007-11-08 Sam Weinig <sam@webkit.org>
1678 * kjs/date_object.cpp:
1679 (KJS::DateProtoFuncToLocaleString::callAsFunction): Fix unused arg warning.
1680 (KJS::DateProtoFuncToLocaleDateString::callAsFunction): ditto
1681 (KJS::DateProtoFuncToLocaleTimeString::callAsFunction): ditto
1683 2007-11-08 Mark Rowe <mrowe@apple.com>
1687 * kjs/lookup.h: Add missing include.
1689 2007-11-08 Sam Weinig <sam@webkit.org>
1693 Convert JavaScript internal function objects to use one class per
1694 function. This avoids a switch statement inside what used to be
1695 the shared function classes and will allow Shark to better analyze
1698 To make this switch, the value property of the HashEntry was changed
1699 to a union of an intptr_t (which is used to continue handle valueGetters)
1700 and function pointer which points to a static constructor for the
1701 individual new function objects.
1703 SunSpider claims this is a 1.0% speedup.
1705 * kjs/array_object.cpp:
1706 (KJS::ArrayPrototype::getOwnPropertySlot):
1708 (KJS::ArrayProtoFuncToString::callAsFunction):
1709 (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
1710 (KJS::ArrayProtoFuncJoin::callAsFunction):
1711 (KJS::ArrayProtoFuncConcat::callAsFunction):
1712 (KJS::ArrayProtoFuncPop::callAsFunction):
1713 (KJS::ArrayProtoFuncPush::callAsFunction):
1714 (KJS::ArrayProtoFuncReverse::callAsFunction):
1715 (KJS::ArrayProtoFuncShift::callAsFunction):
1716 (KJS::ArrayProtoFuncSlice::callAsFunction):
1717 (KJS::ArrayProtoFuncSort::callAsFunction):
1718 (KJS::ArrayProtoFuncSplice::callAsFunction):
1719 (KJS::ArrayProtoFuncUnShift::callAsFunction):
1720 (KJS::ArrayProtoFuncFilter::callAsFunction):
1721 (KJS::ArrayProtoFuncMap::callAsFunction):
1722 (KJS::ArrayProtoFuncEvery::callAsFunction):
1723 (KJS::ArrayProtoFuncForEach::callAsFunction):
1724 (KJS::ArrayProtoFuncSome::callAsFunction):
1725 (KJS::ArrayProtoFuncIndexOf::callAsFunction):
1726 (KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
1727 * kjs/array_object.h:
1728 (KJS::ArrayPrototype::classInfo):
1729 * kjs/create_hash_table:
1730 * kjs/date_object.cpp:
1731 (KJS::DatePrototype::getOwnPropertySlot):
1732 (KJS::DateProtoFuncToString::callAsFunction):
1733 (KJS::DateProtoFuncToUTCString::callAsFunction):
1734 (KJS::DateProtoFuncToDateString::callAsFunction):
1735 (KJS::DateProtoFuncToTimeString::callAsFunction):
1736 (KJS::DateProtoFuncToLocaleString::callAsFunction):
1737 (KJS::DateProtoFuncToLocaleDateString::callAsFunction):
1738 (KJS::DateProtoFuncToLocaleTimeString::callAsFunction):
1739 (KJS::DateProtoFuncValueOf::callAsFunction):
1740 (KJS::DateProtoFuncGetTime::callAsFunction):
1741 (KJS::DateProtoFuncGetFullYear::callAsFunction):
1742 (KJS::DateProtoFuncGetUTCFullYear::callAsFunction):
1743 (KJS::DateProtoFuncToGMTString::callAsFunction):
1744 (KJS::DateProtoFuncGetMonth::callAsFunction):
1745 (KJS::DateProtoFuncGetUTCMonth::callAsFunction):
1746 (KJS::DateProtoFuncGetDate::callAsFunction):
1747 (KJS::DateProtoFuncGetUTCDate::callAsFunction):
1748 (KJS::DateProtoFuncGetDay::callAsFunction):
1749 (KJS::DateProtoFuncGetUTCDay::callAsFunction):
1750 (KJS::DateProtoFuncGetHours::callAsFunction):
1751 (KJS::DateProtoFuncGetUTCHours::callAsFunction):
1752 (KJS::DateProtoFuncGetMinutes::callAsFunction):
1753 (KJS::DateProtoFuncGetUTCMinutes::callAsFunction):
1754 (KJS::DateProtoFuncGetSeconds::callAsFunction):
1755 (KJS::DateProtoFuncGetUTCSeconds::callAsFunction):
1756 (KJS::DateProtoFuncGetMilliSeconds::callAsFunction):
1757 (KJS::DateProtoFuncGetUTCMilliseconds::callAsFunction):
1758 (KJS::DateProtoFuncGetTimezoneOffset::callAsFunction):
1759 (KJS::DateProtoFuncSetTime::callAsFunction):
1760 (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
1761 (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
1762 (KJS::DateProtoFuncSetSeconds::callAsFunction):
1763 (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
1764 (KJS::DateProtoFuncSetMinutes::callAsFunction):
1765 (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
1766 (KJS::DateProtoFuncSetHours::callAsFunction):
1767 (KJS::DateProtoFuncSetUTCHours::callAsFunction):
1768 (KJS::DateProtoFuncSetDate::callAsFunction):
1769 (KJS::DateProtoFuncSetUTCDate::callAsFunction):
1770 (KJS::DateProtoFuncSetMonth::callAsFunction):
1771 (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
1772 (KJS::DateProtoFuncSetFullYear::callAsFunction):
1773 (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
1774 (KJS::DateProtoFuncSetYear::callAsFunction):
1775 (KJS::DateProtoFuncGetYear::callAsFunction):
1776 * kjs/date_object.h:
1778 (KJS::Lookup::find):
1781 (KJS::staticFunctionGetter):
1782 (KJS::staticValueGetter):
1783 (KJS::getStaticPropertySlot):
1784 (KJS::getStaticFunctionSlot):
1786 * kjs/math_object.cpp:
1787 (KJS::MathObjectImp::getOwnPropertySlot):
1788 (KJS::MathProtoFuncAbs::callAsFunction):
1789 (KJS::MathProtoFuncACos::callAsFunction):
1790 (KJS::MathProtoFuncASin::callAsFunction):
1791 (KJS::MathProtoFuncATan::callAsFunction):
1792 (KJS::MathProtoFuncATan2::callAsFunction):
1793 (KJS::MathProtoFuncCeil::callAsFunction):
1794 (KJS::MathProtoFuncCos::callAsFunction):
1795 (KJS::MathProtoFuncExp::callAsFunction):
1796 (KJS::MathProtoFuncFloor::callAsFunction):
1797 (KJS::MathProtoFuncLog::callAsFunction):
1798 (KJS::MathProtoFuncMax::callAsFunction):
1799 (KJS::MathProtoFuncMin::callAsFunction):
1800 (KJS::MathProtoFuncPow::callAsFunction):
1801 (KJS::MathProtoFuncRandom::callAsFunction):
1802 (KJS::MathProtoFuncRound::callAsFunction):
1803 (KJS::MathProtoFuncSin::callAsFunction):
1804 (KJS::MathProtoFuncSqrt::callAsFunction):
1805 (KJS::MathProtoFuncTan::callAsFunction):
1806 * kjs/math_object.h:
1807 (KJS::MathObjectImp::classInfo):
1808 (KJS::MathObjectImp::):
1809 * kjs/string_object.cpp:
1810 (KJS::StringPrototype::getOwnPropertySlot):
1811 (KJS::StringProtoFuncToString::callAsFunction):
1812 (KJS::StringProtoFuncValueOf::callAsFunction):
1813 (KJS::StringProtoFuncCharAt::callAsFunction):
1814 (KJS::StringProtoFuncCharCodeAt::callAsFunction):
1815 (KJS::StringProtoFuncConcat::callAsFunction):
1816 (KJS::StringProtoFuncIndexOf::callAsFunction):
1817 (KJS::StringProtoFuncLastIndexOf::callAsFunction):
1818 (KJS::StringProtoFuncMatch::callAsFunction):
1819 (KJS::StringProtoFuncSearch::callAsFunction):
1820 (KJS::StringProtoFuncReplace::callAsFunction):
1821 (KJS::StringProtoFuncSlice::callAsFunction):
1822 (KJS::StringProtoFuncSplit::callAsFunction):
1823 (KJS::StringProtoFuncSubstr::callAsFunction):
1824 (KJS::StringProtoFuncSubstring::callAsFunction):
1825 (KJS::StringProtoFuncToLowerCase::callAsFunction):
1826 (KJS::StringProtoFuncToUpperCase::callAsFunction):
1827 (KJS::StringProtoFuncToLocaleLowerCase::callAsFunction):
1828 (KJS::StringProtoFuncToLocaleUpperCase::callAsFunction):
1829 (KJS::StringProtoFuncLocaleCompare::callAsFunction):
1830 (KJS::StringProtoFuncBig::callAsFunction):
1831 (KJS::StringProtoFuncSmall::callAsFunction):
1832 (KJS::StringProtoFuncBlink::callAsFunction):
1833 (KJS::StringProtoFuncBold::callAsFunction):
1834 (KJS::StringProtoFuncFixed::callAsFunction):
1835 (KJS::StringProtoFuncItalics::callAsFunction):
1836 (KJS::StringProtoFuncStrike::callAsFunction):
1837 (KJS::StringProtoFuncSub::callAsFunction):
1838 (KJS::StringProtoFuncSup::callAsFunction):
1839 (KJS::StringProtoFuncFontcolor::callAsFunction):
1840 (KJS::StringProtoFuncFontsize::callAsFunction):
1841 (KJS::StringProtoFuncAnchor::callAsFunction):
1842 (KJS::StringProtoFuncLink::callAsFunction):
1843 * kjs/string_object.h:
1845 2007-11-08 Adam Roben <aroben@apple.com>
1849 Reviewed by Sam and Ada.
1851 * wtf/MathExtras.h: Get rid of a circular #include dependency to fix
1854 2007-11-08 Adam Roben <aroben@apple.com>
1856 Fix a precedence warning on Windows
1858 * kjs/JSImmediate.h:
1859 (KJS::JSImmediate::toBoolean):
1861 2007-11-08 Mark Rowe <mrowe@apple.com>
1863 Build fix for JavaScriptGlue.
1865 * wtf/MathExtras.h: Include stdlib.h for srand and RAND_MAX.
1867 2007-11-08 Darin Adler <darin@apple.com>
1871 * kjs/JSImmediate.h: Include MathExtras.h rather than math.h since this file uses "signbit".
1873 2007-11-08 Oliver Hunt <oliver@apple.com>
1877 Replace the use of floats for immediate values with the use of integers for a 4.5% improvement in SunSpider.
1879 Unfortunately this change results in NaN, +Inf, -Inf, and -0 being heap allocated now, but
1880 we should now have faster array access, faster immediate to double conversion, and the
1881 potential to further improve bitwise operators in future.
1883 This also removes the need for unions to avoid strict aliasing problems when extracting
1884 a value from immediates.
1886 * kjs/JSImmediate.h:
1888 (KJS::JSImmediate::trueImmediate):
1889 (KJS::JSImmediate::falseImmediate):
1890 (KJS::JSImmediate::undefinedImmediate):
1891 (KJS::JSImmediate::nullImmediate):
1892 (KJS::JSImmediate::toBoolean):
1896 2007-11-07 Eric Seidel <eric@webkit.org>
1898 Reviewed by Darin and Oliver.
1900 Add evaluateToNumber parallel evaluation tree to speed up number operations.
1901 Make ImmediateNumberNode a subclass of NumberNode.
1902 Share evaluate logic between evaluate and evaluateToNumber using inline functions
1903 There is still a lot of improvement to be made here.
1905 SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
1906 Given the huge win that this prepares us for with simple type inferencing I see the small
1907 regression in base64 being worth the substantial overall improvement.
1911 (KJS::Node::evaluateToNumber):
1912 (KJS::NumberNode::evaluate):
1913 (KJS::NumberNode::evaluateToNumber):
1914 (KJS::StringNode::evaluateToNumber):
1915 (KJS::LocalVarAccessNode::inlineEvaluate):
1916 (KJS::LocalVarAccessNode::evaluate):
1917 (KJS::LocalVarAccessNode::evaluateToNumber):
1918 (KJS::BracketAccessorNode::inlineEvaluate):
1919 (KJS::BracketAccessorNode::evaluate):
1920 (KJS::BracketAccessorNode::evaluateToNumber):
1921 (KJS::NegateNode::evaluate):
1922 (KJS::NegateNode::evaluateToNumber):
1923 (KJS::MultNode::inlineEvaluateToNumber):
1924 (KJS::MultNode::evaluate):
1925 (KJS::MultNode::evaluateToNumber):
1926 (KJS::DivNode::inlineEvaluateToNumber):
1927 (KJS::DivNode::evaluate):
1928 (KJS::DivNode::evaluateToNumber):
1929 (KJS::ModNode::inlineEvaluateToNumber):
1930 (KJS::ModNode::evaluate):
1931 (KJS::ModNode::evaluateToNumber):
1932 (KJS::throwOutOfMemoryErrorToNumber):
1933 (KJS::addSlowCaseToNumber):
1936 (KJS::AddNode::evaluateToNumber):
1937 (KJS::SubNode::inlineEvaluateToNumber):
1938 (KJS::SubNode::evaluate):
1939 (KJS::SubNode::evaluateToNumber):
1940 (KJS::valueForReadModifyAssignment):
1941 (KJS::ReadModifyLocalVarNode::evaluate):
1942 (KJS::ReadModifyResolveNode::evaluate):
1943 (KJS::ReadModifyDotNode::evaluate):
1944 (KJS::ReadModifyBracketNode::evaluate):
1947 (KJS::NumberNode::):
1948 (KJS::ImmediateNumberNode::):
1949 (KJS::AddNode::precedence):
1950 * kjs/nodes2string.cpp:
1951 (KJS::NumberNode::streamTo):
1953 2007-11-07 Mark Rowe <mrowe@apple.com>
1957 Fix up initialization after being mangled in r27572, and remove the
1958 ternary expression as extraCost will always be zero for the numeric
1961 * kjs/collector.cpp:
1962 (KJS::Collector::heapAllocate):
1964 2007-11-07 Mark Rowe <mrowe@apple.com>
1968 * kjs/regexp_object.cpp:
1970 2007-11-07 Geoffrey Garen <ggaren@apple.com>
1972 Reviewed by Beth Dakin.
1974 Eliminated a bogus (though compiled-out) branch in the collector.
1976 * kjs/collector.cpp:
1977 (KJS::Collector::heapAllocate):
1979 2007-11-06 Geoffrey Garen <ggaren@apple.com>
1981 Reviewed by Darin Adler.
1983 Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861
1984 5.8% of string-validate-input.js is spent creating RegExpImps
1986 Put RegExpImp properties into a static hashtable to avoid a slew of
1987 PropertyMap churn when creating a RegExpImp.
1989 Factored important bits of regular expression implementation out of
1990 RegExpImp (the JS object) and into RegExp (the PCRE wrapper class),
1991 making RegExp a ref-counted class. (This will help later.)
1993 Removed PCRE_POSIX support because I didn't quite know how to test it
1994 and keep it working with these changes.
1996 1.1% SunSpider speedup. 5.8% speedup on string-validate-input.js.
1998 * kjs/regexp.h: A few interface changes:
1999 1. Renamed "subpatterns()" => "numSubpatterns()"
2000 2. Made flag enumeration private and replaced it with public getters for
2002 3. Made RegExp ref-counted so RegExps can be shared by RegExpImps.
2003 4. Made RegExp take a string of flags instead of an int, eliminating
2004 duplicated flag parsing code elsewhere.
2006 * kjs/regexp_object.cpp:
2007 (KJS::RegExpProtoFunc::callAsFunction): For RegExp.compile:
2008 - Fixed a bug where compile(undefined) would throw an exception.
2009 - Removed some now-redundant code.
2010 - Used RegExp sharing to eliminate an allocation and a bunch of
2011 PropertyMap thrash. (Not a big win since compile is a deprecated
2012 function. I mainly did this to test the plubming.)
2014 2007-11-07 Simon Hausmann <hausmann@kde.org>
2016 Reviewed by nobody, Qt/Windows build fix.
2018 JavaScriptCore.pri expects OBJECTS_DIR to be set, so set it in
2019 testkjs.pro, too, where it's included from.
2023 2007-11-07 Simon Hausmann <shausman@trolltech.com>
2027 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.
2029 * JavaScriptCore.pri:
2032 2007-11-07 Lars Knoll <lars@trolltech.com>
2038 Pretty embarrassing bug. Has the potential to fix quite a few test failures.
2040 * wtf/unicode/qt4/UnicodeQt4.h:
2041 (WTF::Unicode::umemcasecmp):
2043 2007-11-06 Maciej Stachowiak <mjs@apple.com>
2047 - only collect when the heap is full, unless we have lots of extra cost garbage
2049 1.1% SunSpider speedup.
2051 This shouldn't hit memory use much since the extra space in those
2052 blocks hangs around either way.
2054 * kjs/collector.cpp:
2055 (KJS::Collector::heapAllocate):
2056 (KJS::Collector::collect): Fix logic error that reversed the sense of collect's
2059 2007-11-06 Oliver Hunt <oliver@apple.com>
2063 Avoid unnecessarily boxing the result from post inc/decrement for 0.3% gain in sunspider
2065 We now convert the common 'for (...; ...; <var>++) ...' to the semantically identical
2066 'for (...; ...; ++<var>) ...'.
2069 (KJS::PostIncResolveNode::optimizeForUnnecessaryResult):
2070 (KJS::PostIncLocalVarNode::evaluate):
2071 (KJS::PostIncLocalVarNode::optimizeForUnnecessaryResult):
2072 (KJS::PostDecResolveNode::optimizeForUnnecessaryResult):
2073 (KJS::PostDecLocalVarNode::evaluate):
2074 (KJS::PostDecLocalVarNode::optimizeForUnnecessaryResult):
2076 (KJS::PrePostResolveNode::):
2077 (KJS::PostIncResolveNode::):
2078 (KJS::PostIncLocalVarNode::):
2079 (KJS::PostDecResolveNode::):
2080 (KJS::PostDecLocalVarNode::):
2081 (KJS::PreIncResolveNode::):
2082 (KJS::PreDecResolveNode::):
2083 (KJS::ForNode::ForNode):
2085 2007-11-06 Eric Seidel <eric@webkit.org>
2089 This fixes a regressed layout test for string + object
2091 SunSpider claims this was an overall 0.3% speedup, although some individual tests were slower.
2094 (KJS::add): remove erroneous "fast path" for string + *
2096 2007-11-06 Geoffrey Garen <ggaren@apple.com>
2098 Reviewed by Eric Seidel.
2100 Added toJSNumber, a fast path for converting a JSValue to a JS number,
2101 and deployed it in postfix expressions. In the fast case this
2102 eliminates a call to jsNumber.
2104 0.4% speedup on SunSpider.
2108 (KJS::PostIncResolveNode::evaluate):
2109 (KJS::PostIncLocalVarNode::evaluate):
2110 (KJS::PostDecResolveNode::evaluate):
2111 (KJS::PostDecLocalVarNode::evaluate):
2112 (KJS::PostIncBracketNode::evaluate):
2113 (KJS::PostDecBracketNode::evaluate):
2114 (KJS::PostIncDotNode::evaluate):
2115 (KJS::PostDecDotNode::evaluate):
2116 (KJS::UnaryPlusNode::evaluate):
2118 (KJS::JSValue::toJSNumber):
2120 2007-11-06 Darin Adler <darin@apple.com>
2124 - http://bugs.webkit.org/show_bug.cgi?id=15846
2125 REGRESSION (r27387): Memory corruption when running fast/js/kde/delete.html
2127 There was a mistake in the algorithm used to find an empty slot in the property
2128 map entries vector; when we were putting in a new property value and not overwriting
2129 an existing deleted sentinel, we would enlarge the entries vector, but would not
2130 overwrite the stale data that's in the new part. It was easy to pin this down by
2131 turning on property map consistency checks -- I never would have landed with this
2132 bug if I had run the regression tests once with consistency checks on!
2134 * kjs/property_map.cpp: (KJS::PropertyMap::put): Changed logic for the case where
2135 foundDeletedElement is false to always use the item at the end of the entries vector.
2136 Also allowed me to merge with the logic for the "no deleted sentinels at all" case.
2138 2007-11-06 Oliver Hunt <oliver@apple.com>
2142 Fix previous patch to use a 3 bit shift, a 16 bit shift causes a regression in sunspider.
2147 2007-11-06 Oliver Hunt <oliver@apple.com>
2151 Replace boolean comparisons in AddNode with mask
2152 comparisons for a 0.2% improvement in sunspider.
2154 * JavaScriptCore.xcodeproj/project.pbxproj:
2158 2007-11-06 Eric Seidel <eric@webkit.org>
2162 SunSpider claims this is a 1.1% speedup.
2165 (KJS::throwOutOfMemoryError): Added, non inline.
2166 (KJS::addSlowCase): renamed from add(), non inline.
2167 (KJS::add): add fast path for String + String, Number + Number and String + *
2169 2007-11-06 Eric Seidel <eric@webkit.org>
2173 Avoid more UString creation.
2175 SunSpider claims this is a 0.4% speedup.
2177 * kjs/regexp_object.cpp:
2178 (KJS::RegExpObjectImp::construct): use UString::find(UChar)
2180 2007-11-05 Mark Rowe <mrowe@apple.com>
2184 * kjs/array_object.cpp:
2185 (KJS::ArrayProtoFunc::callAsFunction):
2187 2007-11-05 Adam Roben <aroben@apple.com>
2193 2007-11-05 Mark Rowe <mrowe@apple.com>
2195 Build fix. Add missing #include.
2197 * kjs/operations.cpp:
2199 2007-11-05 Eric Seidel <eric@webkit.org>
2203 Remove another call to toString(exec)
2205 SunSpider claims this is a 0.5% speedup.
2207 * kjs/operations.cpp:
2208 (KJS::equal): remove another toString
2210 2007-11-05 Eric Seidel <eric@webkit.org>
2212 * kjs/operations.cpp:
2213 (KJS::equal): correct broken change.
2215 2007-11-05 Eric Seidel <eric@webkit.org>
2219 Remove one more call to toString(exec).
2221 SunSpider claims this is a 0.7% speedup.
2223 * kjs/operations.cpp:
2224 (KJS::equal): remove a call to toString()
2226 2007-11-05 Mark Rowe <mrowe@apple.com>
2232 2007-11-05 Mark Rowe <mrowe@apple.com>
2238 2007-11-05 Geoffrey Garen <ggaren@apple.com>
2240 Touched a file to test my new HTTP access.
2242 * kjs/scope_chain.cpp:
2244 2007-11-05 Alp Toker <alp@atoker.com>
2246 Unreviewed build fix for qmake-based ports.
2248 Someone with a better understanding of qmake still needs to sort out
2249 the INCLUDEPATH/DEPENDPATH mess.
2251 * JavaScriptCore.pri:
2253 2007-11-05 Geoffrey Garen <ggaren@apple.com>
2255 Reviewed by Darin Adler.
2257 http://bugs.webkit.org/show_bug.cgi?id=15835
2259 Switched List implementation from a custom heap allocator to an inline
2260 Vector, for a disappointing .5% SunSpider speedup.
2262 Also renamed List::slice to List::getSlice because "get" is the
2263 conventional prefix for functions returning a value through an out
2266 * kjs/array_object.cpp:
2267 (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
2268 calls and memory accesses.
2270 * kjs/bool_object.cpp:
2271 (BooleanObjectImp::construct): Removed questionable use of iterator.
2274 * kjs/list.h: New List class, implemented in terms of Vector. Two
2275 interesting differences:
2276 1. The inline capacity is 8, not 5. Many of the Lists constructed
2277 during a SunSpider run are larger than 5; almost none are larger
2280 2. The growth factor is 4, not 2. Since we can guarantee that Lists
2281 aren't long-lived, we can grow them more aggressively, to avoid
2284 * kjs/regexp_object.cpp:
2285 (RegExpObjectImp::construct): Removed redundant function calls.
2287 * kjs/string_object.cpp:
2288 (KJS::StringObjectImp::construct): Removed questionable use of iterator.
2291 (WTF::::uncheckedAppend): Added a fast, unchecked version of append.
2293 2007-11-05 Mark Rowe <mrowe@apple.com>
2295 Reviewed by Alp Toker.
2297 Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.
2299 * JavaScriptCore.pri:
2302 2007-11-04 Darin Adler <darin@apple.com>
2306 - http://bugs.webkit.org/show_bug.cgi?id=15826
2307 optimize opcode loop and case insensitive ASCII compares for a 30% speedup
2309 SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
2311 * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
2313 * pcre/pcre_compile.c:
2314 (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
2315 added OP_NOT since there was no reason it should not be in here.
2316 (could_be_empty_branch): Ditto.
2317 (compile_branch): Streamlined all the single-character cases; there was a bit of
2318 duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
2319 But in particular, compile to those opcodes when the single character match is
2321 (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
2323 * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
2324 the matchframe, after I discovered that none of them needed to be saved and restored
2325 across recursive match calls. Also eliminated the ignored result field from the
2326 matchframe, since I discovered that rrc ("recursive result code") was already the
2327 exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
2328 statement of the switch instead of doing them before the switch. This removes a
2329 branch from each iteration of the opcode interpreter, just as removal of "op"
2330 removed at least one store from each iteration. Last, but not least, add the
2331 OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
2332 surrogate pair and the letter case can be handled efficiently.
2334 2007-11-04 Darin Adler <darin@apple.com>
2336 * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.
2338 2007-11-03 Darin Adler <darin@apple.com>
2340 - fix non-Mac builds; remove some more unused PCRE stuff
2342 * pcre/pcre_compile.c:
2343 (compile_branch): Removed branch chain and some unused ESC values.
2344 (compile_regex): Ditto.
2345 (jsRegExpCompile): Ditto.
2347 (match): Removed unused branch targets. Don't use macros any more.
2348 (jsRegExpExecute): More of the same.
2350 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
2351 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
2352 * pcre/pcre.pri: Ditto.
2354 * pcre/MERGING: Removed.
2355 * pcre/pcre_fullinfo.c: Removed.
2356 * pcre/pcre_get.c: Removed.
2357 * pcre/pcre_internal.h:
2358 * pcre/ucp.h: Removed.
2360 2007-11-03 Darin Adler <darin@apple.com>
2364 - http://bugs.webkit.org/show_bug.cgi?id=15821
2365 remove unused PCRE features for speed
2367 A first step toward removing the PCRE features we don't use.
2368 This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
2369 the SunSpider regular expression test.
2371 Replaced the public interface with one that doesn't use the
2372 name PCRE. Removed code we don't need for JavaScript and various
2373 configurations we don't use. This is in preparation for still
2374 more changes in the future. We'll probably switch to C++ and
2375 make some even more significant changes to the regexp engine
2376 to get some additional speed.
2378 There's probably additional unused stuff that I haven't
2381 This does mean that our PCRE is now a fork, but I think that's
2382 not really a big deal.
2384 * JavaScriptCore.exp: Remove the 5 old entry points and add
2385 the 3 new entry points for WebCore's direct use of the regular
2388 * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
2389 its sense and now there's a USE(POSIX_REGEX) instead, which should
2390 probably not be set by anyone. Maybe later we'll just get rid of it
2395 (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
2396 defines. Cut down on the number of functions used.
2397 (KJS::RegExp::~RegExp): Ditto.
2398 (KJS::RegExp::match): Ditto.
2400 * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
2403 * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
2404 size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
2405 POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
2406 and JAVASCRIPT. These are all no longer configurable in our copy
2409 * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
2410 version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
2411 the include of <stdlib.h>, and most of the constants and
2412 functions defined in this header. Changed the naming scheme to
2413 use a JSRegExp prefix rather than a pcre prefix. In the future,
2414 we'll probably change this to be a C++ header.
2416 * pcre/pcre_compile.c: Removed all unused code branches,
2417 including many whole functions and various byte codes.
2418 Kept changes outside of removal to a minimum.
2420 (first_significant_code):
2423 (could_be_empty_branch):
2428 (find_firstassertedchar):
2429 (jsRegExpCompile): Renamed from pcre_compile2 and changed the
2430 parameters around a bit.
2431 (jsRegExpFree): Added.
2433 * pcre/pcre_exec.c: Removed many unused opcodes and variables.
2434 Also started tearing down the NO_RECURSE mechanism since it's
2435 now the default. In some cases there were things in the explicit
2436 frame that could be turned into plain old local variables and
2437 other small like optimizations.
2440 (match): Changed parameters quite a bit since it's now not used
2442 (jsRegExpExecute): Renamed from pcre_exec.
2444 * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
2445 PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
2446 PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
2447 PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
2448 _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
2449 and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
2451 * pcre/pcre_maketables.c: Changed to only compile in dftables.
2452 Also got rid of many of the tables that we don't use.
2454 * pcre/pcre_tables.c: Removed the unused Unicode property tables.
2456 * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
2457 _pcre_ucp_othercase.
2459 * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
2460 for classes based on Unicode properties.
2462 * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
2463 to eliminate this completely, but we need the regular expression
2464 code to be C++ first.
2466 * pcre/pcre_fullinfo.c:
2469 Files that are no longer needed. I didn't remove them with this
2470 check-in, because I didn't want to modify all the project files.
2472 2007-11-03 Maciej Stachowiak <mjs@apple.com>
2476 - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
2478 It turns out that doing this check costs more than it saves.
2480 * kjs/JSImmediate.h:
2481 (KJS::JSImmediate::fromDouble):
2483 2007-11-03 Sam Weinig <sam@webkit.org>
2487 Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
2488 The variable had been kept around for binary compatibility, but since nothing
2489 else is there is no point in continuing to keep it around.
2491 * API/JSCallbackConstructor.cpp:
2493 * API/JSCallbackFunction.cpp:
2495 * API/JSCallbackObject.cpp:
2497 * bindings/objc/objc_runtime.mm:
2498 * bindings/runtime_array.cpp:
2499 * bindings/runtime_object.cpp:
2500 * kjs/array_instance.cpp:
2502 * kjs/array_object.cpp:
2504 * kjs/bool_object.cpp:
2505 * kjs/date_object.cpp:
2507 * kjs/error_object.cpp:
2513 * kjs/math_object.cpp:
2514 * kjs/number_object.cpp:
2516 * kjs/regexp_object.cpp:
2517 * kjs/string_object.cpp:
2520 2007-11-03 Kevin McCullough <kmccullough@apple.com>
2522 - Updated testkjs results to make the build bots green until we
2523 can fix the tests that are failing. The new failures are in DST.
2525 * tests/mozilla/expected.html:
2527 2007-11-03 Maciej Stachowiak <mjs@apple.com>
2531 - don't print the var twice for ForInNodes with a var declaration
2533 * kjs/nodes2string.cpp:
2534 (KJS::ForInNode::streamTo):
2536 2007-11-03 Darin Adler <darin@apple.com>
2538 * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
2539 C-incompatible declaration.
2541 2007-11-03 Mark Rowe <mrowe@apple.com>
2545 * kjs/nodes.cpp: Add missing include.
2547 2007-11-03 Darin Adler <darin@apple.com>
2551 - fix http://bugs.webkit.org/show_bug.cgi?id=15814
2552 <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
2554 These changes cause us to match the JavaScript specification and pass the
2555 fast/js/kde/encode_decode_uri.html test.
2557 * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
2558 new strict mode, throwing an exception if there are malformed UTF-16 surrogate
2561 * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
2563 (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
2564 those might be illegal in some sense, they aren't supposed to get any special
2565 handling in the place where this function is currently used.
2566 (KJS::UString::UTF8String): Added the strictness.
2568 2007-11-03 Darin Adler <darin@apple.com>
2572 - http://bugs.webkit.org/show_bug.cgi?id=15812
2573 some JavaScript tests (from the Mozilla test suite) are failing
2575 Two or three fixes get 7 more of the Mozilla tests passing.
2576 This gets us down from 61 failing tests to 54.
2578 * kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
2579 Made this inline and gave it a more specific type. Some day we should
2580 probably do that for all of these -- might even get a bit of a speed
2582 * kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
2583 inline in the header.
2585 * kjs/regexp_object.h:
2586 * kjs/regexp_object.cpp:
2587 (KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
2588 switch statement into the RegExpImp object, so they can be shared with
2589 RegExpImp::callAsFunction.
2590 (KJS::RegExpImp::match): Added. Common code used by both test and exec.
2591 (KJS::RegExpImp::test): Added.
2592 (KJS::RegExpImp::exec): Added.
2593 (KJS::RegExpImp::implementsCall): Added.
2594 (KJS::RegExpImp::callAsFunction): Added.
2595 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
2596 lastInput to null rather than empty string -- we take advantage of the
2597 difference in RegExpImp::match.
2598 (KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
2599 just to get at a field like this.
2601 * pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
2602 the JavaScript specification. If there are not 4 hex digits after the \u,
2603 then it's processed as if it wasn't an escape sequence at all.
2605 * pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
2606 for JavaScript (4 specific Unicode values).
2608 (match): Changed all call sites to use IS_NEWLINE.
2611 * tests/mozilla/expected.html: Updated to expect 7 more successful tests.
2613 2007-11-03 David D. Kilzer <ddkilzer@webkit.org>
2615 Sort files(...); sections of Xcode project files.
2617 Rubber-stamped by Darin.
2619 * JavaScriptCore.xcodeproj/project.pbxproj:
2621 2007-11-03 Maciej Stachowiak <mjs@apple.com>
2625 - remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup
2629 (KJS::VarDeclNode::optimizeVariableAccess):
2630 (KJS::VarDeclNode::getDeclarations):
2631 (KJS::VarDeclNode::handleSlowCase):
2632 (KJS::VarDeclNode::evaluateSingle):
2633 (KJS::VarDeclNode::evaluate):
2634 (KJS::VarStatementNode::execute):
2636 (KJS::VarDeclNode::):
2637 (KJS::VarStatementNode::):
2638 * kjs/nodes2string.cpp:
2639 (KJS::VarDeclNode::streamTo):
2641 2007-11-03 Alexey Proskuryakov <ap@webkit.org>
2645 http://bugs.webkit.org/show_bug.cgi?id=15800
2646 REGRESSION (r27303): RegExp leaks
2648 * kjs/regexp_object.h:
2649 (KJS::RegExpImp::setRegExp):
2650 (KJS::RegExpImp::regExp):
2651 (KJS::RegExpImp::classInfo):
2652 * kjs/regexp_object.cpp:
2653 (RegExpImp::RegExpImp):
2654 (RegExpImp::~RegExpImp):
2655 Renamed reg member variable to m_regExp, changed it to use OwnPtr.
2657 2007-11-02 Maciej Stachowiak <mjs@apple.com>
2661 - add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.
2665 (KJS::statementListPushFIFO):
2666 (KJS::statementListGetDeclarations):
2667 (KJS::statementListInitializeDeclarationStacks):
2668 (KJS::statementListInitializeVariableAccessStack):
2669 (KJS::statementListExecute):
2670 (KJS::BlockNode::BlockNode):
2671 (KJS::FunctionBodyNode::FunctionBodyNode):
2672 (KJS::ProgramNode::ProgramNode):
2674 (KJS::CaseClauseNode::):
2676 2007-11-02 Darin Adler <darin@apple.com>
2680 - http://bugs.webkit.org/show_bug.cgi?id=15791
2681 change property map data structure for less memory use, better speed
2683 The property map now has an array of indices and a separate array of
2684 property map entries. This slightly slows down lookup because of a second
2685 memory acess, but makes property maps smaller and faster to iterate in
2686 functions like mark().
2688 SunSpider says this is 1.2% faster, although it makes the bitwise-end test
2689 more than 10% slower. To fix that we'll need to optimize global variable lookup.
2691 * kjs/property_map.cpp:
2692 (KJS::PropertyMapEntry::PropertyMapEntry):
2693 (KJS::PropertyMapHashTable::entries):
2694 (KJS::PropertyMapHashTable::allocationSize):
2695 (KJS::SavedProperties::SavedProperties):
2696 (KJS::SavedProperties::~SavedProperties):
2697 (KJS::PropertyMap::checkConsistency):
2698 (KJS::PropertyMap::~PropertyMap):
2699 (KJS::PropertyMap::clear):
2700 (KJS::PropertyMap::get):
2701 (KJS::PropertyMap::getLocation):
2702 (KJS::PropertyMap::put):
2703 (KJS::PropertyMap::insert):
2704 (KJS::PropertyMap::createTable):
2705 (KJS::PropertyMap::rehash):
2706 (KJS::PropertyMap::remove):
2707 (KJS::PropertyMap::mark):
2708 (KJS::comparePropertyMapEntryIndices):
2709 (KJS::PropertyMap::containsGettersOrSetters):
2710 (KJS::PropertyMap::getEnumerablePropertyNames):
2711 (KJS::PropertyMap::save):
2712 (KJS::PropertyMap::restore):
2713 * kjs/property_map.h:
2715 2007-11-02 Darin Adler <darin@apple.com>
2719 - http://bugs.webkit.org/show_bug.cgi?id=15807
2720 HashMap needs a take() function that combines get and remove
2722 * wtf/HashMap.h: Added take function. Simplistic implementation for now,
2723 but still does only one hash table lookup.
2725 * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
2726 a find followed by a remove.
2728 2007-11-02 David Carson <dacarson@gmail.com>
2732 Fix compiler warning "warning: suggest parentheses around && within ||"
2733 http://bugs.webkit.org/show_bug.cgi?id=15764
2735 * kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.
2737 2007-11-01 Geoffrey Garen <ggaren@apple.com>
2739 Reviewed by Maciej Stachowiak.
2741 In preparation for making List a simple stack-allocated Vector:
2743 Removed all instances of List copying and/or assignment, and made List
2744 inherit from Noncopyable.
2746 Functions that used to return a List by copy now take List& out
2749 Layout tests and JS tests pass.
2752 (KJS::List::slice): Replaced copyTail with a more generic slice
2753 alternative. (JavaScriptCore only calls slice(1), but WebCore calls
2756 2007-11-01 Geoffrey Garen <ggaren@apple.com>
2758 Reviewed by Maciej Stachowiak.
2760 Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
2761 REGRESSION(r27344): Crash on load at finance.yahoo.com
2763 Reverted a small portion of my last check-in. (The speedup and the List
2764 removal are still there, though.)
2766 ActivationImp needs to hold a pointer to its function, and mark that
2767 pointer (rather than accessing its function through its ExecState, and
2768 counting on the active scope to mark its function) because a closure
2769 can cause an ActivationImp to outlive its ExecState along with any
2772 * kjs/ExecState.cpp:
2773 (KJS::ExecState::ExecState):
2775 (KJS::FunctionImp::~FunctionImp):
2776 (KJS::ActivationImp::ActivationImp):
2778 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
2780 Also made HashTable a little more crash-happy in debug builds, so
2781 problems like this will show up earlier:
2784 (WTF::HashTable::~HashTable):
2786 2007-11-01 Geoffrey Garen <ggaren@apple.com>
2788 Reviewed by Adam Roben.
2790 Addressed some of Darin's review comments.
2792 Used perl -p, which is the shorthand while(<>) {}.
2794 Made sure not to suppress bison's output.
2796 Added line to removed bison_out.txt, since this script removes other
2797 intermediate files, too.
2799 * DerivedSources.make:
2801 2007-11-01 Geoffrey Garen <ggaren@apple.com>
2803 Reviewed by Oliver Hunt.
2805 Removed List from ActivationImp, in preparation for making all lists
2810 1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.
2812 * kjs/ExecState.cpp:
2813 (KJS::ExecState::ExecState):
2814 (KJS::ExecState::~ExecState):
2816 (KJS::ActivationImp::ActivationImp):
2817 (KJS::ActivationImp::createArgumentsObject):
2819 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
2821 2007-11-01 Adam Roben <aroben@apple.com>
2823 Use jsNumberCell instead of jsNumber when converting double constants to JSValues
2825 This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
2826 ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.
2828 It also gets rid of an MSVC warning that we previously had to silence.
2832 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
2833 back on the "overflow in constant arithmetic" warning.
2834 * kjs/number_object.cpp:
2835 (NumberObjectImp::getValueProperty): Use jsNumberCell instead of
2838 2007-10-31 Adam Roben <aroben@apple.com>
2844 2007-10-31 Maciej Stachowiak <mjs@apple.com>
2848 - shave some cycles off of local storage access for a 1% SunSpider speedup
2850 Keep the LocalStorage pointer in the ExecState, instead of getting
2851 it from the ActivationImp all the time.
2853 * kjs/ExecState.cpp:
2854 (KJS::ExecState::updateLocalStorage):
2856 (KJS::ExecState::localStorage):
2858 (KJS::LocalVarAccessNode::evaluate):
2859 (KJS::LocalVarFunctionCallNode::evaluate):
2860 (KJS::PostIncLocalVarNode::evaluate):
2861 (KJS::PostDecLocalVarNode::evaluate):
2862 (KJS::LocalVarTypeOfNode::evaluate):
2863 (KJS::PreIncLocalVarNode::evaluate):
2864 (KJS::PreDecLocalVarNode::evaluate):
2865 (KJS::ReadModifyLocalVarNode::evaluate):
2866 (KJS::AssignLocalVarNode::evaluate):
2867 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
2869 2007-10-31 Adam Roben <aroben@apple.com>
2871 Fix a crash on launch due to a static initializer race
2873 We now use fast inline assembler spinlocks which can be statically
2874 initialized at compile time.
2876 As a side benefit, this speeds up SunSpider by 0.4%.
2880 * wtf/FastMalloc.cpp:
2882 (TCMalloc_SpinLock::Lock):
2883 (TCMalloc_SpinLock::Unlock):
2884 (TCMalloc_SlowLock):
2885 * wtf/TCSystemAlloc.cpp:
2887 2007-10-31 Kevin McCullough <kmccullough@apple.com>
2891 - Corrected spelling.
2895 2007-10-31 Mark Rowe <mrowe@apple.com>
2897 Further Gtk build fixage.
2899 * kjs/regexp_object.cpp:
2901 2007-10-31 Mark Rowe <mrowe@apple.com>
2907 2007-10-31 Darin Adler <darin@apple.com>
2911 - fix http://bugs.webkit.org/show_bug.cgi?id=15749
2912 RegExp/RegExpObjectImp cause needless UString creation
2914 Speeds things up 0.4% according to SunSpider.
2916 * kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
2917 because this library doesn't use the real PCRE -- it uses its
2918 own PCRE that works on UTF-16.
2920 * kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
2921 Use Noncopyable. Change the return value of match.
2923 (KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
2924 (KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
2925 (KJS::RegExp::match): Change to return the position as an int and the
2926 ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.
2928 * kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
2929 require a result string.
2930 * kjs/regexp_object.cpp:
2931 (RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
2932 (RegExpObjectImp::performMatch): Change so it doesn't return a string.
2933 (RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
2934 the main result with the backreferences; now it doesn't need to take
2936 (RegExpObjectImp::getBackref): Minor tweaks.
2937 (RegExpObjectImp::getLastParen): Ditto.
2938 (RegExpObjectImp::getLeftContext): Ditto.
2939 (RegExpObjectImp::getRightContext): Ditto.
2940 (RegExpObjectImp::getValueProperty): Change LastMatch case to call
2941 getBackref(0) so we don't need a separate getLastMatch function.
2943 * kjs/string_object.cpp:
2944 (KJS::replace): Update to use new performMatch, including merging the
2945 matched string section with the other substrings.
2946 (KJS::StringProtoFunc::callAsFunction): Update functions to use the
2947 new performMatch and match. Also change to use OwnArrayPtr.
2949 2007-10-31 Oliver Hunt <oliver@apple.com>
2951 * kjs/nodes.h: include OwnPtr.h
2953 2007-10-31 Oliver Hunt <oliver@apple.com>
2957 Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider
2961 (KJS::statementListPushFIFO):
2962 (KJS::statementListGetDeclarations):
2963 (KJS::statementListInitializeDeclarationStacks):
2964 (KJS::statementListInitializeVariableAccessStack):
2965 (KJS::statementListExecute):
2966 (KJS::BlockNode::optimizeVariableAccess):
2967 (KJS::BlockNode::BlockNode):
2968 (KJS::BlockNode::getDeclarations):
2969 (KJS::BlockNode::execute):
2970 (KJS::CaseClauseNode::optimizeVariableAccess):
2971 (KJS::CaseClauseNode::getDeclarations):
2972 (KJS::CaseClauseNode::evalStatements):
2973 (KJS::FunctionBodyNode::initializeDeclarationStacks):
2974 (KJS::FunctionBodyNode::optimizeVariableAccess):
2976 * kjs/nodes2string.cpp:
2977 (KJS::statementListStreamTo):
2978 (KJS::BlockNode::streamTo):
2979 (KJS::CaseClauseNode::streamTo):
2981 2007-10-30 Mark Rowe <mrowe@apple.com>
2983 * kjs/property_map.cpp: Added a missing using directive to fix the build
2984 for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
2986 2007-10-31 Maciej Stachowiak <mjs@apple.com>
2988 * kjs/property_map.cpp: Include HashTable.h the right way to fix the build
2991 2007-10-31 Alexey Proskuryakov <ap@webkit.org>
2995 http://bugs.webkit.org/show_bug.cgi?id=11001
2996 WebKit doesn't support RegExp.compile method
2998 Test: fast/js/regexp-compile.html
3000 * kjs/regexp_object.cpp:
3001 (RegExpPrototype::RegExpPrototype):
3002 (RegExpProtoFunc::callAsFunction):
3003 * kjs/regexp_object.h:
3004 (KJS::RegExpProtoFunc::):
3005 Added RegExp.compile.
3007 * tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.
3009 2007-10-31 Maciej Stachowiak <mjs@apple.com>
3013 - get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
3015 Integer divide sucks. Fortunately, a bunch of shifts and XORs
3016 biased towards the high bits is sufficient to provide a good
3017 double hash. Besides the SunSpider win, I used the dump statistics
3018 mode for both to verify that collisions did not increase and that
3019 the longest collision chain is not any longer.
3021 * kjs/property_map.cpp:
3023 (KJS::PropertyMap::get):
3024 (KJS::PropertyMap::getLocation):
3025 (KJS::PropertyMap::put):
3026 (KJS::PropertyMap::insert):
3027 (KJS::PropertyMap::remove):
3028 (KJS::PropertyMap::checkConsistency):
3032 (WTF::::lookupForWriting):
3033 (WTF::::fullLookupForWriting):
3036 2007-10-30 Adam Roben <aroben@apple.com>
3038 * kjs/collector.h: Make HeapType public so it can be used for non-member
3039 things like the HeapConstants struct template. Fixes the build on Windows.
3041 2007-10-30 Adam Roben <aroben@apple.com>
3043 Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows
3045 Speeds up SunSpider by 0.4%.
3047 Reviewed by Steve and Maciej.
3049 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
3050 a warning during LTCG in release builds about double -> float
3052 * wtf/AlwaysInline.h:
3055 2007-10-30 Adam Roben <aroben@apple.com>
3057 Use GetCurrentThreadId instead of pthread_self in FastMalloc
3059 Speeds up SunSpider by 0.3%.
3063 * wtf/FastMalloc.cpp:
3064 (WTF::TCMalloc_ThreadCache::InitTSD):
3065 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3067 2007-10-30 Adam Roben <aroben@apple.com>
3069 Switch to a Win32 critical section implementation of spinlocks
3071 Speeds up SunSpider by 0.4%.
3075 * wtf/FastMalloc.cpp:
3077 (TCMalloc_SpinLock::TCMalloc_SpinLock):
3078 (TCMalloc_SpinLock::Init):
3079 (TCMalloc_SpinLock::Finalize):
3080 (TCMalloc_SpinLock::Lock):
3081 (TCMalloc_SpinLock::Unlock):
3082 * wtf/TCSystemAlloc.cpp:
3084 2007-10-30 Adam Roben <aroben@apple.com>
3086 Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta
3088 http://bugs.webkit.org/show_bug.cgi?id=15586
3090 Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll
3092 Use Win32 TLS functions instead of __declspec(thread), which breaks
3097 * wtf/FastMalloc.cpp:
3098 (WTF::getThreadHeap):
3099 (WTF::TCMalloc_ThreadCache::InitModule):
3101 2007-10-30 Maciej Stachowiak <mjs@apple.com>
3105 - allocate numbers in half-size cells, for an 0.5% SunSpider speedup
3106 http://bugs.webkit.org/show_bug.cgi?id=15772
3108 We do this by using a single mark bit per two number cells, and
3111 Besides being an 0.5% win overall, this is a 7.1% win on morph.
3113 * kjs/collector.cpp:
3115 (KJS::Collector::heapAllocate):
3116 (KJS::Collector::markStackObjectsConservatively):
3117 (KJS::Collector::sweep):
3119 (KJS::SmallCollectorCell::):
3121 2007-10-30 Geoffrey Garen <ggaren@apple.com>
3123 Reviewed by Adam Roben, Sam Weinig.
3125 Made conflicts in grammar.y a persistent build failure.
3127 * DerivedSources.make:
3129 2007-10-30 Kevin McCullough <kmccullough@apple.com>
3131 Reviewed by Adam and Geoff.
3133 - Added a new cast so all the casts are in the same place.
3138 2007-10-30 Geoffrey Garen <ggaren@apple.com>
3140 Reviewed by Darin Adler.
3142 Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
3146 ecma_2/Statements/dowhile-001.js
3147 ecma_2/Statements/dowhile-002.js
3148 ecma_2/Statements/dowhile-003.js
3149 ecma_2/Statements/dowhile-004.js
3150 ecma_2/Statements/dowhile-005.js
3151 ecma_2/Statements/dowhile-006.js
3152 ecma_2/Statements/dowhile-007.js
3153 js1_2/statements/do_while.js
3155 and layout tests, including
3157 do-while-expression-value.html
3158 do-while-semicolon.html
3159 do-while-without-semicolon.html
3163 * kjs/grammar.y: Use the explicit "error" production, as we do with other
3164 automatic semicolon insertions, to disambiguate "do { } while();" from
3165 "do { } while()" followed by ";" (the empty statement).
3167 2007-10-29 Oliver Hunt <oliver@apple.com>
3171 Debranching remaining assignment nodes, and miscellaneous cleanup
3173 Split read-modify code paths out of AssignBracketNode and AssignDotNode
3174 Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode
3175 and ReadModifyResolveNode evaluate methods
3177 Leads to a 1% gain in SunSpider.
3181 (KJS::ReadModifyLocalVarNode::evaluate):
3182 (KJS::ReadModifyResolveNode::evaluate):
3183 (KJS::AssignDotNode::evaluate):
3184 (KJS::ReadModifyDotNode::optimizeVariableAccess):
3185 (KJS::ReadModifyDotNode::evaluate):
3186 (KJS::AssignBracketNode::evaluate):
3187 (KJS::ReadModifyBracketNode::optimizeVariableAccess):
3188 (KJS::ReadModifyBracketNode::evaluate):
3190 (KJS::AssignBracketNode::):
3191 (KJS::AssignBracketNode::precedence):
3192 (KJS::AssignDotNode::):
3193 (KJS::AssignDotNode::precedence):
3194 * kjs/nodes2string.cpp:
3195 (KJS::ReadModifyBracketNode::streamTo):
3196 (KJS::AssignBracketNode::streamTo):
3197 (KJS::ReadModifyDotNode::streamTo):
3198 (KJS::AssignDotNode::streamTo):
3200 2007-10-29 Oliver Hunt <oliver@apple.com>
3202 Debranching various Node::evaluate implementations
3206 Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
3207 Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
3209 Gains 1.6% on SunSpider
3211 * JavaScriptCore.xcodeproj/project.pbxproj:
3214 (KJS::PostIncResolveNode::optimizeVariableAccess):
3215 (KJS::PostIncResolveNode::evaluate):
3216 (KJS::PostIncLocalVarNode::evaluate):
3217 (KJS::PostDecResolveNode::optimizeVariableAccess):
3218 (KJS::PostDecResolveNode::evaluate):
3219 (KJS::PostDecLocalVarNode::evaluate):
3220 (KJS::PostIncBracketNode::evaluate):
3221 (KJS::PostDecBracketNode::evaluate):
3222 (KJS::PostIncDotNode::evaluate):
3223 (KJS::PostDecDotNode::evaluate):
3224 (KJS::PreIncResolveNode::optimizeVariableAccess):
3225 (KJS::PreIncLocalVarNode::evaluate):
3226 (KJS::PreIncResolveNode::evaluate):
3227 (KJS::PreDecResolveNode::optimizeVariableAccess):
3228 (KJS::PreDecLocalVarNode::evaluate):
3229 (KJS::PreDecResolveNode::evaluate):
3230 (KJS::PreIncBracketNode::evaluate):
3231 (KJS::PreDecBracketNode::evaluate):
3232 (KJS::PreIncDotNode::evaluate):
3233 (KJS::PreDecDotNode::evaluate):
3234 (KJS::ReadModifyResolveNode::optimizeVariableAccess):
3235 (KJS::AssignResolveNode::optimizeVariableAccess):
3236 (KJS::AssignLocalVarNode::evaluate):
3237 (KJS::AssignResolveNode::evaluate):
3239 (KJS::PostDecResolveNode::):
3240 (KJS::PostDecResolveNode::precedence):
3241 (KJS::PostDecLocalVarNode::):
3242 (KJS::PostfixBracketNode::):
3243 (KJS::PostfixBracketNode::precedence):
3244 (KJS::PostIncBracketNode::):
3245 (KJS::PostIncBracketNode::isIncrement):
3246 (KJS::PostDecBracketNode::):
3247 (KJS::PostDecBracketNode::isIncrement):
3248 (KJS::PostfixDotNode::):
3249 (KJS::PostfixDotNode::precedence):
3250 (KJS::PostIncDotNode::):
3251 (KJS::PostIncDotNode::isIncrement):
3252 (KJS::PostDecDotNode::):
3253 (KJS::PreIncResolveNode::):
3254 (KJS::PreDecResolveNode::):
3255 (KJS::PreDecResolveNode::precedence):
3256 (KJS::PreDecLocalVarNode::):
3257 (KJS::PrefixBracketNode::):
3258 (KJS::PrefixBracketNode::precedence):
3259 (KJS::PreIncBracketNode::):
3260 (KJS::PreIncBracketNode::isIncrement):
3261 (KJS::PreDecBracketNode::):
3262 (KJS::PreDecBracketNode::isIncrement):
3263 (KJS::PrefixDotNode::):
3264 (KJS::PrefixDotNode::precedence):
3265 (KJS::PreIncDotNode::):
3266 (KJS::PreIncDotNode::isIncrement):
3267 (KJS::PreDecDotNode::):
3268 (KJS::ReadModifyResolveNode::):
3269 (KJS::ReadModifyLocalVarNode::):
3270 (KJS::AssignResolveNode::):
3271 (KJS::AssignResolveNode::precedence):
3272 * kjs/nodes2string.cpp:
3273 (KJS::PostIncResolveNode::streamTo):
3274 (KJS::PostDecResolveNode::streamTo):
3275 (KJS::PostfixBracketNode::streamTo):
3276 (KJS::PostfixDotNode::streamTo):
3277 (KJS::PreIncResolveNode::streamTo):
3278 (KJS::PreDecResolveNode::streamTo):
3279 (KJS::ReadModifyResolveNode::streamTo):
3280 (KJS::AssignResolveNode::streamTo):
3282 2007-10-29 Maciej Stachowiak <mjs@apple.com>
3284 Not reviewed, build fix.
3286 - Include Vector.h in a way that actually works.
3288 * kjs/LocalStorage.h:
3290 2007-10-29 Maciej Stachowiak <mjs@apple.com>
3292 Not reviewed, build fix.
3294 - Install LocalStorage.h as a private header.
3296 * JavaScriptCore.xcodeproj/project.pbxproj:
3298 2007-10-29 Maciej Stachowiak <mjs@apple.com>
3302 - Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.
3304 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3305 * JavaScriptCore.xcodeproj/project.pbxproj:
3306 * kjs/LocalStorage.h: Added.
3307 (KJS::LocalStorageEntry::LocalStorageEntry):
3311 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
3313 2007-10-29 Geoffrey Garen <ggaren@apple.com>
3315 Reviewed by Oliver Hunt.
3317 Some small tweaks that I notice while reviewing Oliver's last patch.
3319 Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
3321 No change in SunSpider because SunSpider doesn't take the code path that
3322 would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.
3325 (KJS::LocalVarPostfixNode::evaluate):
3326 (KJS::TypeOfResolveNode::optimizeVariableAccess):
3327 (KJS::LocalVarTypeOfNode::evaluate):
3328 (KJS::PrefixResolveNode::optimizeVariableAccess):
3329 (KJS::LocalVarPrefixNode::evaluate):
3330 (KJS::AssignResolveNode::optimizeVariableAccess):
3331 (KJS::LocalVarAssignNode::evaluate):
3333 (KJS::LocalVarTypeOfNode::):
3334 (KJS::PrefixResolveNode::):
3335 (KJS::LocalVarPrefixNode::):
3336 (KJS::AssignResolveNode::):
3337 (KJS::LocalVarAssignNode::):
3339 2007-10-29 Eric Seidel <eric@webkit.org>
3343 SunSpider claims this was a 0.7% speedup.
3345 * kjs/string_object.cpp:
3346 (KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case
3348 2007-10-29 Maciej Stachowiak <mjs@apple.com>
3352 - re-enable asserts for access to empty or deleted keys
3356 (WTF::::lookupForWriting):
3357 (WTF::::fullLookupForWriting):
3360 2007-10-29 Eric Seidel <eric@webkit.org>
3362 Build fix only, no review.
3364 * JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot
3366 2007-10-29 Mark Rowe <mrowe@apple.com>
3368 Gtk build fix. Move struct declarations into nodes.h.
3373 2007-10-29 Eric Seidel <eric@webkit.org>
3377 Give StringInstance a getOwnPropertySlot(ExecState, unsigned, PropertySlot) fastpath, just like Arrays.
3378 Make it a compile time error to use toString(ExecState) on a StringInstance
3380 SunSpider claims this was a 6.6% speedup overall (22% on string-base64)
3383 (KJS::StringImp::getLength):
3384 * kjs/string_object.cpp:
3385 (KJS::StringInstance::lengthGetter):
3386 (KJS::StringInstance::inlineGetOwnPropertySlot):
3387 (KJS::StringInstance::getOwnPropertySlot):
3388 * kjs/string_object.h:
3390 2007-10-28 Oliver Hunt <oliver@apple.com>
3394 Add nodes to allow Assignment, TypeOf, and prefix operators to
3395 make use of the new optimised local variable look up.
3397 5% gain on sunspider
3400 (KJS::TypeOfResolveNode::optimizeVariableAccess):
3401 (KJS::LocalTypeOfAccessNode::evaluate):
3402 (KJS::PrefixResolveNode::optimizeVariableAccess):
3403 (KJS::PrefixLocalAccessNode::evaluate):
3404 (KJS::AssignResolveNode::optimizeVariableAccess):
3405 (KJS::AssignLocalAccessNode::evaluate):
3407 (KJS::TypeOfResolveNode::):
3408 (KJS::TypeOfResolveNode::precedence):
3409 (KJS::LocalTypeOfAccessNode::):
3410 (KJS::PrefixResolveNode::):
3411 (KJS::PrefixResolveNode::precedence):
3412 (KJS::PrefixLocalAccessNode::):
3413 (KJS::AssignResolveNode::):
3414 (KJS::AssignLocalAccessNode::):
3416 2007-10-28 Maciej Stachowiak <mjs@apple.com>
3420 - avoid creating and then breaking circular lists in the parser, instead track head and tail pointers at parse time
3421 http://bugs.webkit.org/show_bug.cgi?id=15748
3423 Not a significant speedup or slowdown on SunSpider.
3426 (KJS::clearNewNodes):
3430 (KJS::BlockNode::BlockNode):
3431 (KJS::CaseBlockNode::CaseBlockNode):
3432 (KJS::FunctionBodyNode::FunctionBodyNode):
3433 (KJS::SourceElementsNode::SourceElementsNode):
3434 (KJS::ProgramNode::ProgramNode):
3436 (KJS::ElementNode::):
3438 (KJS::PropertyListNode::):
3439 (KJS::ObjectLiteralNode::):
3440 (KJS::ArgumentListNode::):
3441 (KJS::ArgumentsNode::):
3442 (KJS::VarDeclListNode::):
3443 (KJS::VarStatementNode::):
3445 (KJS::ParameterNode::):
3446 (KJS::FuncExprNode::):
3447 (KJS::FuncDeclNode::):
3448 (KJS::SourceElementsNode::):
3449 (KJS::CaseClauseNode::):
3450 (KJS::ClauseListNode::):
3452 2007-10-28 Mark Rowe <mrowe@apple.com>
3454 Disable assertions in a manner that doesn't break the Qt Windows build.
3458 (WTF::::lookupForWriting):
3459 (WTF::::fullLookupForWriting):
3461 2007-10-28 Geoffrey Garen <ggaren@apple.com>
3463 Temporarily disabling some ASSERTs I introduced in my last check-in
3464 because of http://bugs.webkit.org/show_bug.cgi?id=15747
3465 Lots of layout tests fail the !HashTranslator::equal(KeyTraits::emptyValue() ASSERT
3469 (WTF::::lookupForWriting):
3470 (WTF::::fullLookupForWriting):
3473 2007-10-28 Geoffrey Garen <ggaren@apple.com>
3475 Reviewed by Darin Adler.
3477 Fixed http://bugs.webkit.org/show_bug.cgi?id=15746
3478 #ifndef ASSERT_DISABLED is no good!
3480 Replaced with #if !ASSERT_DISABLED.
3484 (WTF::::lookupForWriting):
3485 (WTF::::fullLookupForWriting):
3488 2007-10-28 Geoffrey Garen <ggaren@apple.com>
3490 Reviewed by Darin Adler.
3492 Added FunctionCallResolveNode, PostfixResolveNode, and DeleteResolveNode
3493 to the AST transfom that replaces slow resolve nodes with fast local
3494 variable alternatives.
3496 2.5% speedup on SunSpider.
3498 Also added some missing copyright notices.
3501 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
3502 (KJS::FunctionCallResolveNode::evaluate):
3503 (KJS::LocalVarFunctionCallNode::evaluate):
3504 (KJS::PostfixResolveNode::optimizeVariableAccess):
3505 (KJS::PostfixResolveNode::evaluate):
3506 (KJS::LocalVarPostfixNode::evaluate):
3507 (KJS::DeleteResolveNode::optimizeVariableAccess):
3508 (KJS::DeleteResolveNode::evaluate):
3509 (KJS::LocalVarDeleteNode::evaluate):
3511 (KJS::FunctionCallResolveNode::):
3512 (KJS::LocalVarFunctionCallNode::LocalVarFunctionCallNode):
3513 (KJS::PostfixResolveNode::):
3514 (KJS::LocalVarPostfixNode::LocalVarPostfixNode):
3515 (KJS::DeleteResolveNode::):
3516 (KJS::LocalVarDeleteNode::LocalVarDeleteNode):
3518 2007-10-28 Eric Seidel <eric@webkit.org>
3522 Inline UString::Rep::deref() for a 0.8% improvement in SunSpider
3523 Add virtual keyword to a few virtual functions previously unmarked.
3526 (KJS::StringImp::type):
3527 (KJS::NumberImp::type):
3529 (KJS::UString::Rep::deref):
3531 2007-10-28 Darin Adler <darin@apple.com>
3533 - fix "broken everything" from the storage leak fix
3535 * wtf/RefPtr.h: (WTF::RefPtr::RefPtr): Added a PlacementNewAdopt constructor.
3536 * kjs/ustring.h: (KJS::UString::UString): Pass PlacementNewAdopt along to RefPtr.
3538 2007-10-28 Darin Adler <darin@apple.com>
3542 - turn on unused parameter waring on Mac OS X because it's already on elsewhere