1 2007-11-07 Eric Seidel <eric@webkit.org>
3 Reviewed by Darin and Oliver.
5 Add evaluateToNumber parallel evaluation tree to speed up number operations.
6 Make ImmediateNumberNode a subclass of NumberNode.
7 Share evaluate logic between evaluate and evaluateToNumber using inline functions
8 There is still a lot of improvement to be made here.
10 SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
11 Given the huge win that this prepares us for with simple type inferencing I see the small
12 regression in base64 being worth the substantial overall improvement.
16 (KJS::Node::evaluateToNumber):
17 (KJS::NumberNode::evaluate):
18 (KJS::NumberNode::evaluateToNumber):
19 (KJS::StringNode::evaluateToNumber):
20 (KJS::LocalVarAccessNode::inlineEvaluate):
21 (KJS::LocalVarAccessNode::evaluate):
22 (KJS::LocalVarAccessNode::evaluateToNumber):
23 (KJS::BracketAccessorNode::inlineEvaluate):
24 (KJS::BracketAccessorNode::evaluate):
25 (KJS::BracketAccessorNode::evaluateToNumber):
26 (KJS::NegateNode::evaluate):
27 (KJS::NegateNode::evaluateToNumber):
28 (KJS::MultNode::inlineEvaluateToNumber):
29 (KJS::MultNode::evaluate):
30 (KJS::MultNode::evaluateToNumber):
31 (KJS::DivNode::inlineEvaluateToNumber):
32 (KJS::DivNode::evaluate):
33 (KJS::DivNode::evaluateToNumber):
34 (KJS::ModNode::inlineEvaluateToNumber):
35 (KJS::ModNode::evaluate):
36 (KJS::ModNode::evaluateToNumber):
37 (KJS::throwOutOfMemoryErrorToNumber):
38 (KJS::addSlowCaseToNumber):
41 (KJS::AddNode::evaluateToNumber):
42 (KJS::SubNode::inlineEvaluateToNumber):
43 (KJS::SubNode::evaluate):
44 (KJS::SubNode::evaluateToNumber):
45 (KJS::valueForReadModifyAssignment):
46 (KJS::ReadModifyLocalVarNode::evaluate):
47 (KJS::ReadModifyResolveNode::evaluate):
48 (KJS::ReadModifyDotNode::evaluate):
49 (KJS::ReadModifyBracketNode::evaluate):
53 (KJS::ImmediateNumberNode::):
54 (KJS::AddNode::precedence):
55 * kjs/nodes2string.cpp:
56 (KJS::NumberNode::streamTo):
58 2007-11-07 Mark Rowe <mrowe@apple.com>
62 Fix up initialization after being mangled in r27572, and remove the
63 ternary expression as extraCost will always be zero for the numeric
67 (KJS::Collector::heapAllocate):
69 2007-11-07 Mark Rowe <mrowe@apple.com>
73 * kjs/regexp_object.cpp:
75 2007-11-07 Geoffrey Garen <ggaren@apple.com>
77 Reviewed by Beth Dakin.
79 Eliminated a bogus (though compiled-out) branch in the collector.
82 (KJS::Collector::heapAllocate):
84 2007-11-06 Geoffrey Garen <ggaren@apple.com>
86 Reviewed by Darin Adler.
88 Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861
89 15% of string-validate-input.js is spent compiling the same regular expression.
91 Put RegExpImp properties into a static hashtable to avoid a slew of
92 PropertyMap churn when creating a RegExpImp.
94 Factored important bits of regular expression implementation out of
95 RegExpImp (the JS object) and into RegExp (the PCRE wrapper class),
96 making RegExp a ref-counted class. (This will help later.)
98 Removed PCRE_POSIX support because I didn't quite know how to test it
99 and keep it working with these changes.
101 1.1% SunSpider speedup. 5.8% speedup on string-validate-input.js.
103 * kjs/regexp.h: A few interface changes:
104 1. Renamed "subpatterns()" => "numSubpatterns()"
105 2. Made flag enumeration private and replaced it with public getters for
107 3. Made RegExp ref-counted so RegExps can be shared by RegExpImps.
108 4. Made RegExp take a string of flags instead of an int, eliminating
109 duplicated flag parsing code elsewhere.
111 * kjs/regexp_object.cpp:
112 (KJS::RegExpProtoFunc::callAsFunction): For RegExp.compile:
113 - Fixed a bug where compile(undefined) would throw an exception.
114 - Removed some now-redundant code.
115 - Used RegExp sharing to eliminate an allocation and a bunch of
116 PropertyMap thrash. (Not a big win since compile is a deprecated
117 function. I mainly did this to test the plubming.)
119 2007-11-07 Simon Hausmann <hausmann@kde.org>
121 Reviewed by nobody, Qt/Windows build fix.
123 JavaScriptCore.pri expects OBJECTS_DIR to be set, so set it in
124 testkjs.pro, too, where it's included from.
128 2007-11-07 Simon Hausmann <shausman@trolltech.com>
132 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.
134 * JavaScriptCore.pri:
137 2007-11-07 Lars Knoll <lars@trolltech.com>
143 Pretty embarrassing bug. Has the potential to fix quite a few test failures.
145 * wtf/unicode/qt4/UnicodeQt4.h:
146 (WTF::Unicode::umemcasecmp):
148 2007-11-06 Maciej Stachowiak <mjs@apple.com>
152 - only collect when the heap is full, unless we have lots of extra cost garbage
154 1.1% SunSpider speedup.
156 This shouldn't hit memory use much since the extra space in those
157 blocks hangs around either way.
160 (KJS::Collector::heapAllocate):
161 (KJS::Collector::collect): Fix logic error that reversed the sense of collect's
164 2007-11-06 Oliver Hunt <oliver@apple.com>
168 Avoid unnecessarily boxing the result from post inc/decrement for 0.3% gain in sunspider
170 We now convert the common 'for (...; ...; <var>++) ...' to the semantically identical
171 'for (...; ...; ++<var>) ...'.
174 (KJS::PostIncResolveNode::optimizeForUnnecessaryResult):
175 (KJS::PostIncLocalVarNode::evaluate):
176 (KJS::PostIncLocalVarNode::optimizeForUnnecessaryResult):
177 (KJS::PostDecResolveNode::optimizeForUnnecessaryResult):
178 (KJS::PostDecLocalVarNode::evaluate):
179 (KJS::PostDecLocalVarNode::optimizeForUnnecessaryResult):
181 (KJS::PrePostResolveNode::):
182 (KJS::PostIncResolveNode::):
183 (KJS::PostIncLocalVarNode::):
184 (KJS::PostDecResolveNode::):
185 (KJS::PostDecLocalVarNode::):
186 (KJS::PreIncResolveNode::):
187 (KJS::PreDecResolveNode::):
188 (KJS::ForNode::ForNode):
190 2007-11-06 Eric Seidel <eric@webkit.org>
194 This fixes a regressed layout test for string + object
196 SunSpider claims this was an overall 0.3% speedup, although some individual tests were slower.
199 (KJS::add): remove erroneous "fast path" for string + *
201 2007-11-06 Geoffrey Garen <ggaren@apple.com>
203 Reviewed by Eric Seidel.
205 Added toJSNumber, a fast path for converting a JSValue to a JS number,
206 and deployed it in postfix expressions. In the fast case this
207 eliminates a call to jsNumber.
209 0.4% speedup on SunSpider.
213 (KJS::PostIncResolveNode::evaluate):
214 (KJS::PostIncLocalVarNode::evaluate):
215 (KJS::PostDecResolveNode::evaluate):
216 (KJS::PostDecLocalVarNode::evaluate):
217 (KJS::PostIncBracketNode::evaluate):
218 (KJS::PostDecBracketNode::evaluate):
219 (KJS::PostIncDotNode::evaluate):
220 (KJS::PostDecDotNode::evaluate):
221 (KJS::UnaryPlusNode::evaluate):
223 (KJS::JSValue::toJSNumber):
225 2007-11-06 Darin Adler <darin@apple.com>
229 - http://bugs.webkit.org/show_bug.cgi?id=15846
230 REGRESSION (r27387): Memory corruption when running fast/js/kde/delete.html
232 There was a mistake in the algorithm used to find an empty slot in the property
233 map entries vector; when we were putting in a new property value and not overwriting
234 an existing deleted sentinel, we would enlarge the entries vector, but would not
235 overwrite the stale data that's in the new part. It was easy to pin this down by
236 turning on property map consistency checks -- I never would have landed with this
237 bug if I had run the regression tests once with consistency checks on!
239 * kjs/property_map.cpp: (KJS::PropertyMap::put): Changed logic for the case where
240 foundDeletedElement is false to always use the item at the end of the entries vector.
241 Also allowed me to merge with the logic for the "no deleted sentinels at all" case.
243 2007-11-06 Oliver Hunt <oliver@apple.com>
247 Fix previous patch to use a 3 bit shift, a 16 bit shift causes a regression in sunspider.
252 2007-11-06 Oliver Hunt <oliver@apple.com>
256 Replace boolean comparisons in AddNode with mask
257 comparisons for a 0.2% improvement in sunspider.
259 * JavaScriptCore.xcodeproj/project.pbxproj:
263 2007-11-06 Eric Seidel <eric@webkit.org>
267 SunSpider claims this is a 1.1% speedup.
270 (KJS::throwOutOfMemoryError): Added, non inline.
271 (KJS::addSlowCase): renamed from add(), non inline.
272 (KJS::add): add fast path for String + String, Number + Number and String + *
274 2007-11-06 Eric Seidel <eric@webkit.org>
278 Avoid more UString creation.
280 SunSpider claims this is a 0.4% speedup.
282 * kjs/regexp_object.cpp:
283 (KJS::RegExpObjectImp::construct): use UString::find(UChar)
285 2007-11-05 Mark Rowe <mrowe@apple.com>
289 * kjs/array_object.cpp:
290 (KJS::ArrayProtoFunc::callAsFunction):
292 2007-11-05 Adam Roben <aroben@apple.com>
298 2007-11-05 Mark Rowe <mrowe@apple.com>
300 Build fix. Add missing #include.
302 * kjs/operations.cpp:
304 2007-11-05 Eric Seidel <eric@webkit.org>
308 Remove another call to toString(exec)
310 SunSpider claims this is a 0.5% speedup.
312 * kjs/operations.cpp:
313 (KJS::equal): remove another toString
315 2007-11-05 Eric Seidel <eric@webkit.org>
317 * kjs/operations.cpp:
318 (KJS::equal): correct broken change.
320 2007-11-05 Eric Seidel <eric@webkit.org>
324 Remove one more call to toString(exec).
326 SunSpider claims this is a 0.7% speedup.
328 * kjs/operations.cpp:
329 (KJS::equal): remove a call to toString()
331 2007-11-05 Mark Rowe <mrowe@apple.com>
337 2007-11-05 Mark Rowe <mrowe@apple.com>
343 2007-11-05 Geoffrey Garen <ggaren@apple.com>
345 Touched a file to test my new HTTP access.
347 * kjs/scope_chain.cpp:
349 2007-11-05 Alp Toker <alp@atoker.com>
351 Unreviewed build fix for qmake-based ports.
353 Someone with a better understanding of qmake still needs to sort out
354 the INCLUDEPATH/DEPENDPATH mess.
356 * JavaScriptCore.pri:
358 2007-11-05 Geoffrey Garen <ggaren@apple.com>
360 Reviewed by Darin Adler.
362 http://bugs.webkit.org/show_bug.cgi?id=15835
364 Switched List implementation from a custom heap allocator to an inline
365 Vector, for a disappointing .5% SunSpider speedup.
367 Also renamed List::slice to List::getSlice because "get" is the
368 conventional prefix for functions returning a value through an out
371 * kjs/array_object.cpp:
372 (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
373 calls and memory accesses.
375 * kjs/bool_object.cpp:
376 (BooleanObjectImp::construct): Removed questionable use of iterator.
379 * kjs/list.h: New List class, implemented in terms of Vector. Two
380 interesting differences:
381 1. The inline capacity is 8, not 5. Many of the Lists constructed
382 during a SunSpider run are larger than 5; almost none are larger
385 2. The growth factor is 4, not 2. Since we can guarantee that Lists
386 aren't long-lived, we can grow them more aggressively, to avoid
389 * kjs/regexp_object.cpp:
390 (RegExpObjectImp::construct): Removed redundant function calls.
392 * kjs/string_object.cpp:
393 (KJS::StringObjectImp::construct): Removed questionable use of iterator.
396 (WTF::::uncheckedAppend): Added a fast, unchecked version of append.
398 2007-11-05 Mark Rowe <mrowe@apple.com>
400 Reviewed by Alp Toker.
402 Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.
404 * JavaScriptCore.pri:
407 2007-11-04 Darin Adler <darin@apple.com>
411 - http://bugs.webkit.org/show_bug.cgi?id=15826
412 optimize opcode loop and case insensitive ASCII compares for a 30% speedup
414 SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
416 * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
418 * pcre/pcre_compile.c:
419 (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
420 added OP_NOT since there was no reason it should not be in here.
421 (could_be_empty_branch): Ditto.
422 (compile_branch): Streamlined all the single-character cases; there was a bit of
423 duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
424 But in particular, compile to those opcodes when the single character match is
426 (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
428 * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
429 the matchframe, after I discovered that none of them needed to be saved and restored
430 across recursive match calls. Also eliminated the ignored result field from the
431 matchframe, since I discovered that rrc ("recursive result code") was already the
432 exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
433 statement of the switch instead of doing them before the switch. This removes a
434 branch from each iteration of the opcode interpreter, just as removal of "op"
435 removed at least one store from each iteration. Last, but not least, add the
436 OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
437 surrogate pair and the letter case can be handled efficiently.
439 2007-11-04 Darin Adler <darin@apple.com>
441 * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.
443 2007-11-03 Darin Adler <darin@apple.com>
445 - fix non-Mac builds; remove some more unused PCRE stuff
447 * pcre/pcre_compile.c:
448 (compile_branch): Removed branch chain and some unused ESC values.
449 (compile_regex): Ditto.
450 (jsRegExpCompile): Ditto.
452 (match): Removed unused branch targets. Don't use macros any more.
453 (jsRegExpExecute): More of the same.
455 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
456 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
457 * pcre/pcre.pri: Ditto.
459 * pcre/MERGING: Removed.
460 * pcre/pcre_fullinfo.c: Removed.
461 * pcre/pcre_get.c: Removed.
462 * pcre/pcre_internal.h:
463 * pcre/ucp.h: Removed.
465 2007-11-03 Darin Adler <darin@apple.com>
469 - http://bugs.webkit.org/show_bug.cgi?id=15821
470 remove unused PCRE features for speed
472 A first step toward removing the PCRE features we don't use.
473 This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
474 the SunSpider regular expression test.
476 Replaced the public interface with one that doesn't use the
477 name PCRE. Removed code we don't need for JavaScript and various
478 configurations we don't use. This is in preparation for still
479 more changes in the future. We'll probably switch to C++ and
480 make some even more significant changes to the regexp engine
481 to get some additional speed.
483 There's probably additional unused stuff that I haven't
486 This does mean that our PCRE is now a fork, but I think that's
487 not really a big deal.
489 * JavaScriptCore.exp: Remove the 5 old entry points and add
490 the 3 new entry points for WebCore's direct use of the regular
493 * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
494 its sense and now there's a USE(POSIX_REGEX) instead, which should
495 probably not be set by anyone. Maybe later we'll just get rid of it
500 (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
501 defines. Cut down on the number of functions used.
502 (KJS::RegExp::~RegExp): Ditto.
503 (KJS::RegExp::match): Ditto.
505 * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
508 * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
509 size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
510 POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
511 and JAVASCRIPT. These are all no longer configurable in our copy
514 * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
515 version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
516 the include of <stdlib.h>, and most of the constants and
517 functions defined in this header. Changed the naming scheme to
518 use a JSRegExp prefix rather than a pcre prefix. In the future,
519 we'll probably change this to be a C++ header.
521 * pcre/pcre_compile.c: Removed all unused code branches,
522 including many whole functions and various byte codes.
523 Kept changes outside of removal to a minimum.
525 (first_significant_code):
528 (could_be_empty_branch):
533 (find_firstassertedchar):
534 (jsRegExpCompile): Renamed from pcre_compile2 and changed the
535 parameters around a bit.
536 (jsRegExpFree): Added.
538 * pcre/pcre_exec.c: Removed many unused opcodes and variables.
539 Also started tearing down the NO_RECURSE mechanism since it's
540 now the default. In some cases there were things in the explicit
541 frame that could be turned into plain old local variables and
542 other small like optimizations.
545 (match): Changed parameters quite a bit since it's now not used
547 (jsRegExpExecute): Renamed from pcre_exec.
549 * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
550 PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
551 PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
552 PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
553 _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
554 and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
556 * pcre/pcre_maketables.c: Changed to only compile in dftables.
557 Also got rid of many of the tables that we don't use.
559 * pcre/pcre_tables.c: Removed the unused Unicode property tables.
561 * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
564 * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
565 for classes based on Unicode properties.
567 * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
568 to eliminate this completely, but we need the regular expression
569 code to be C++ first.
571 * pcre/pcre_fullinfo.c:
574 Files that are no longer needed. I didn't remove them with this
575 check-in, because I didn't want to modify all the project files.
577 2007-11-03 Maciej Stachowiak <mjs@apple.com>
581 - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
583 It turns out that doing this check costs more than it saves.
586 (KJS::JSImmediate::fromDouble):
588 2007-11-03 Sam Weinig <sam@webkit.org>
592 Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
593 The variable had been kept around for binary compatibility, but since nothing
594 else is there is no point in continuing to keep it around.
596 * API/JSCallbackConstructor.cpp:
598 * API/JSCallbackFunction.cpp:
600 * API/JSCallbackObject.cpp:
602 * bindings/objc/objc_runtime.mm:
603 * bindings/runtime_array.cpp:
604 * bindings/runtime_object.cpp:
605 * kjs/array_instance.cpp:
607 * kjs/array_object.cpp:
609 * kjs/bool_object.cpp:
610 * kjs/date_object.cpp:
612 * kjs/error_object.cpp:
618 * kjs/math_object.cpp:
619 * kjs/number_object.cpp:
621 * kjs/regexp_object.cpp:
622 * kjs/string_object.cpp:
625 2007-11-03 Kevin McCullough <kmccullough@apple.com>
627 - Updated testkjs results to make the build bots green until we
628 can fix the tests that are failing. The new failures are in DST.
630 * tests/mozilla/expected.html:
632 2007-11-03 Maciej Stachowiak <mjs@apple.com>
636 - don't print the var twice for ForInNodes with a var declaration
638 * kjs/nodes2string.cpp:
639 (KJS::ForInNode::streamTo):
641 2007-11-03 Darin Adler <darin@apple.com>
643 * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
644 C-incompatible declaration.
646 2007-11-03 Mark Rowe <mrowe@apple.com>
650 * kjs/nodes.cpp: Add missing include.
652 2007-11-03 Darin Adler <darin@apple.com>
656 - fix http://bugs.webkit.org/show_bug.cgi?id=15814
657 <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
659 These changes cause us to match the JavaScript specification and pass the
660 fast/js/kde/encode_decode_uri.html test.
662 * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
663 new strict mode, throwing an exception if there are malformed UTF-16 surrogate
666 * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
668 (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
669 those might be illegal in some sense, they aren't supposed to get any special
670 handling in the place where this function is currently used.
671 (KJS::UString::UTF8String): Added the strictness.
673 2007-11-03 Darin Adler <darin@apple.com>
677 - http://bugs.webkit.org/show_bug.cgi?id=15812
678 some JavaScript tests (from the Mozilla test suite) are failing
680 Two or three fixes get 7 more of the Mozilla tests passing.
681 This gets us down from 61 failing tests to 54.
683 * kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
684 Made this inline and gave it a more specific type. Some day we should
685 probably do that for all of these -- might even get a bit of a speed
687 * kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
688 inline in the header.
690 * kjs/regexp_object.h:
691 * kjs/regexp_object.cpp:
692 (KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
693 switch statement into the RegExpImp object, so they can be shared with
694 RegExpImp::callAsFunction.
695 (KJS::RegExpImp::match): Added. Common code used by both test and exec.
696 (KJS::RegExpImp::test): Added.
697 (KJS::RegExpImp::exec): Added.
698 (KJS::RegExpImp::implementsCall): Added.
699 (KJS::RegExpImp::callAsFunction): Added.
700 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
701 lastInput to null rather than empty string -- we take advantage of the
702 difference in RegExpImp::match.
703 (KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
704 just to get at a field like this.
706 * pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
707 the JavaScript specification. If there are not 4 hex digits after the \u,
708 then it's processed as if it wasn't an escape sequence at all.
710 * pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
711 for JavaScript (4 specific Unicode values).
713 (match): Changed all call sites to use IS_NEWLINE.
716 * tests/mozilla/expected.html: Updated to expect 7 more successful tests.
718 2007-11-03 David D. Kilzer <ddkilzer@webkit.org>
720 Sort files(...); sections of Xcode project files.
722 Rubber-stamped by Darin.
724 * JavaScriptCore.xcodeproj/project.pbxproj:
726 2007-11-03 Maciej Stachowiak <mjs@apple.com>
730 - remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup
734 (KJS::VarDeclNode::optimizeVariableAccess):
735 (KJS::VarDeclNode::getDeclarations):
736 (KJS::VarDeclNode::handleSlowCase):
737 (KJS::VarDeclNode::evaluateSingle):
738 (KJS::VarDeclNode::evaluate):
739 (KJS::VarStatementNode::execute):
741 (KJS::VarDeclNode::):
742 (KJS::VarStatementNode::):
743 * kjs/nodes2string.cpp:
744 (KJS::VarDeclNode::streamTo):
746 2007-11-03 Alexey Proskuryakov <ap@webkit.org>
750 http://bugs.webkit.org/show_bug.cgi?id=15800
751 REGRESSION (r27303): RegExp leaks
753 * kjs/regexp_object.h:
754 (KJS::RegExpImp::setRegExp):
755 (KJS::RegExpImp::regExp):
756 (KJS::RegExpImp::classInfo):
757 * kjs/regexp_object.cpp:
758 (RegExpImp::RegExpImp):
759 (RegExpImp::~RegExpImp):
760 Renamed reg member variable to m_regExp, changed it to use OwnPtr.
762 2007-11-02 Maciej Stachowiak <mjs@apple.com>
766 - add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.
770 (KJS::statementListPushFIFO):
771 (KJS::statementListGetDeclarations):
772 (KJS::statementListInitializeDeclarationStacks):
773 (KJS::statementListInitializeVariableAccessStack):
774 (KJS::statementListExecute):
775 (KJS::BlockNode::BlockNode):
776 (KJS::FunctionBodyNode::FunctionBodyNode):
777 (KJS::ProgramNode::ProgramNode):
779 (KJS::CaseClauseNode::):
781 2007-11-02 Darin Adler <darin@apple.com>
785 - http://bugs.webkit.org/show_bug.cgi?id=15791
786 change property map data structure for less memory use, better speed
788 The property map now has an array of indices and a separate array of
789 property map entries. This slightly slows down lookup because of a second
790 memory acess, but makes property maps smaller and faster to iterate in
791 functions like mark().
793 SunSpider says this is 1.2% faster, although it makes the bitwise-end test
794 more than 10% slower. To fix that we'll need to optimize global variable lookup.
796 * kjs/property_map.cpp:
797 (KJS::PropertyMapEntry::PropertyMapEntry):
798 (KJS::PropertyMapHashTable::entries):
799 (KJS::PropertyMapHashTable::allocationSize):
800 (KJS::SavedProperties::SavedProperties):
801 (KJS::SavedProperties::~SavedProperties):
802 (KJS::PropertyMap::checkConsistency):
803 (KJS::PropertyMap::~PropertyMap):
804 (KJS::PropertyMap::clear):
805 (KJS::PropertyMap::get):
806 (KJS::PropertyMap::getLocation):
807 (KJS::PropertyMap::put):
808 (KJS::PropertyMap::insert):
809 (KJS::PropertyMap::createTable):
810 (KJS::PropertyMap::rehash):
811 (KJS::PropertyMap::remove):
812 (KJS::PropertyMap::mark):
813 (KJS::comparePropertyMapEntryIndices):
814 (KJS::PropertyMap::containsGettersOrSetters):
815 (KJS::PropertyMap::getEnumerablePropertyNames):
816 (KJS::PropertyMap::save):
817 (KJS::PropertyMap::restore):
818 * kjs/property_map.h:
820 2007-11-02 Darin Adler <darin@apple.com>
824 - http://bugs.webkit.org/show_bug.cgi?id=15807
825 HashMap needs a take() function that combines get and remove
827 * wtf/HashMap.h: Added take function. Simplistic implementation for now,
828 but still does only one hash table lookup.
830 * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
831 a find followed by a remove.
833 2007-11-02 David Carson <dacarson@gmail.com>
837 Fix compiler warning "warning: suggest parentheses around && within ||"
838 http://bugs.webkit.org/show_bug.cgi?id=15764
840 * kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.
842 2007-11-01 Geoffrey Garen <ggaren@apple.com>
844 Reviewed by Maciej Stachowiak.
846 In preparation for making List a simple stack-allocated Vector:
848 Removed all instances of List copying and/or assignment, and made List
849 inherit from Noncopyable.
851 Functions that used to return a List by copy now take List& out
854 Layout tests and JS tests pass.
857 (KJS::List::slice): Replaced copyTail with a more generic slice
858 alternative. (JavaScriptCore only calls slice(1), but WebCore calls
861 2007-11-01 Geoffrey Garen <ggaren@apple.com>
863 Reviewed by Maciej Stachowiak.
865 Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
866 REGRESSION(r27344): Crash on load at finance.yahoo.com
868 Reverted a small portion of my last check-in. (The speedup and the List
869 removal are still there, though.)
871 ActivationImp needs to hold a pointer to its function, and mark that
872 pointer (rather than accessing its function through its ExecState, and
873 counting on the active scope to mark its function) because a closure
874 can cause an ActivationImp to outlive its ExecState along with any
878 (KJS::ExecState::ExecState):
880 (KJS::FunctionImp::~FunctionImp):
881 (KJS::ActivationImp::ActivationImp):
883 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
885 Also made HashTable a little more crash-happy in debug builds, so
886 problems like this will show up earlier:
889 (WTF::HashTable::~HashTable):
891 2007-11-01 Geoffrey Garen <ggaren@apple.com>
893 Reviewed by Adam Roben.
895 Addressed some of Darin's review comments.
897 Used perl -p, which is the shorthand while(<>) {}.
899 Made sure not to suppress bison's output.
901 Added line to removed bison_out.txt, since this script removes other
902 intermediate files, too.
904 * DerivedSources.make:
906 2007-11-01 Geoffrey Garen <ggaren@apple.com>
908 Reviewed by Oliver Hunt.
910 Removed List from ActivationImp, in preparation for making all lists
915 1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.
918 (KJS::ExecState::ExecState):
919 (KJS::ExecState::~ExecState):
921 (KJS::ActivationImp::ActivationImp):
922 (KJS::ActivationImp::createArgumentsObject):
924 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
926 2007-11-01 Adam Roben <aroben@apple.com>
928 Use jsNumberCell instead of jsNumber when converting double constants to JSValues
930 This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
931 ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.
933 It also gets rid of an MSVC warning that we previously had to silence.
937 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
938 back on the "overflow in constant arithmetic" warning.
939 * kjs/number_object.cpp:
940 (NumberObjectImp::getValueProperty): Use jsNumberCell instead of
943 2007-10-31 Adam Roben <aroben@apple.com>
949 2007-10-31 Maciej Stachowiak <mjs@apple.com>
953 - shave some cycles off of local storage access for a 1% SunSpider speedup
955 Keep the LocalStorage pointer in the ExecState, instead of getting
956 it from the ActivationImp all the time.
959 (KJS::ExecState::updateLocalStorage):
961 (KJS::ExecState::localStorage):
963 (KJS::LocalVarAccessNode::evaluate):
964 (KJS::LocalVarFunctionCallNode::evaluate):
965 (KJS::PostIncLocalVarNode::evaluate):
966 (KJS::PostDecLocalVarNode::evaluate):
967 (KJS::LocalVarTypeOfNode::evaluate):
968 (KJS::PreIncLocalVarNode::evaluate):
969 (KJS::PreDecLocalVarNode::evaluate):
970 (KJS::ReadModifyLocalVarNode::evaluate):
971 (KJS::AssignLocalVarNode::evaluate):
972 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
974 2007-10-31 Adam Roben <aroben@apple.com>
976 Fix a crash on launch due to a static initializer race
978 We now use fast inline assembler spinlocks which can be statically
979 initialized at compile time.
981 As a side benefit, this speeds up SunSpider by 0.4%.
985 * wtf/FastMalloc.cpp:
987 (TCMalloc_SpinLock::Lock):
988 (TCMalloc_SpinLock::Unlock):
990 * wtf/TCSystemAlloc.cpp:
992 2007-10-31 Kevin McCullough <kmccullough@apple.com>
996 - Corrected spelling.
1000 2007-10-31 Mark Rowe <mrowe@apple.com>
1002 Further Gtk build fixage.
1004 * kjs/regexp_object.cpp:
1006 2007-10-31 Mark Rowe <mrowe@apple.com>
1012 2007-10-31 Darin Adler <darin@apple.com>
1016 - fix http://bugs.webkit.org/show_bug.cgi?id=15749
1017 RegExp/RegExpObjectImp cause needless UString creation
1019 Speeds things up 0.4% according to SunSpider.
1021 * kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
1022 because this library doesn't use the real PCRE -- it uses its
1023 own PCRE that works on UTF-16.
1025 * kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
1026 Use Noncopyable. Change the return value of match.
1028 (KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
1029 (KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
1030 (KJS::RegExp::match): Change to return the position as an int and the
1031 ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.
1033 * kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
1034 require a result string.
1035 * kjs/regexp_object.cpp:
1036 (RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
1037 (RegExpObjectImp::performMatch): Change so it doesn't return a string.
1038 (RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
1039 the main result with the backreferences; now it doesn't need to take
1041 (RegExpObjectImp::getBackref): Minor tweaks.
1042 (RegExpObjectImp::getLastParen): Ditto.
1043 (RegExpObjectImp::getLeftContext): Ditto.
1044 (RegExpObjectImp::getRightContext): Ditto.
1045 (RegExpObjectImp::getValueProperty): Change LastMatch case to call
1046 getBackref(0) so we don't need a separate getLastMatch function.
1048 * kjs/string_object.cpp:
1049 (KJS::replace): Update to use new performMatch, including merging the
1050 matched string section with the other substrings.
1051 (KJS::StringProtoFunc::callAsFunction): Update functions to use the
1052 new performMatch and match. Also change to use OwnArrayPtr.
1054 2007-10-31 Oliver Hunt <oliver@apple.com>
1056 * kjs/nodes.h: include OwnPtr.h
1058 2007-10-31 Oliver Hunt <oliver@apple.com>
1062 Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider
1066 (KJS::statementListPushFIFO):
1067 (KJS::statementListGetDeclarations):
1068 (KJS::statementListInitializeDeclarationStacks):
1069 (KJS::statementListInitializeVariableAccessStack):
1070 (KJS::statementListExecute):
1071 (KJS::BlockNode::optimizeVariableAccess):
1072 (KJS::BlockNode::BlockNode):
1073 (KJS::BlockNode::getDeclarations):
1074 (KJS::BlockNode::execute):
1075 (KJS::CaseClauseNode::optimizeVariableAccess):
1076 (KJS::CaseClauseNode::getDeclarations):
1077 (KJS::CaseClauseNode::evalStatements):
1078 (KJS::FunctionBodyNode::initializeDeclarationStacks):
1079 (KJS::FunctionBodyNode::optimizeVariableAccess):
1081 * kjs/nodes2string.cpp:
1082 (KJS::statementListStreamTo):
1083 (KJS::BlockNode::streamTo):
1084 (KJS::CaseClauseNode::streamTo):
1086 2007-10-30 Mark Rowe <mrowe@apple.com>
1088 * kjs/property_map.cpp: Added a missing using directive to fix the build
1089 for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
1091 2007-10-31 Maciej Stachowiak <mjs@apple.com>
1093 * kjs/property_map.cpp: Include HashTable.h the right way to fix the build
1096 2007-10-31 Alexey Proskuryakov <ap@webkit.org>
1100 http://bugs.webkit.org/show_bug.cgi?id=11001
1101 WebKit doesn't support RegExp.compile method
1103 Test: fast/js/regexp-compile.html
1105 * kjs/regexp_object.cpp:
1106 (RegExpPrototype::RegExpPrototype):
1107 (RegExpProtoFunc::callAsFunction):
1108 * kjs/regexp_object.h:
1109 (KJS::RegExpProtoFunc::):
1110 Added RegExp.compile.
1112 * tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.
1114 2007-10-31 Maciej Stachowiak <mjs@apple.com>
1118 - get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
1120 Integer divide sucks. Fortunately, a bunch of shifts and XORs
1121 biased towards the high bits is sufficient to provide a good
1122 double hash. Besides the SunSpider win, I used the dump statistics
1123 mode for both to verify that collisions did not increase and that
1124 the longest collision chain is not any longer.
1126 * kjs/property_map.cpp:
1128 (KJS::PropertyMap::get):
1129 (KJS::PropertyMap::getLocation):
1130 (KJS::PropertyMap::put):
1131 (KJS::PropertyMap::insert):
1132 (KJS::PropertyMap::remove):
1133 (KJS::PropertyMap::checkConsistency):
1137 (WTF::::lookupForWriting):
1138 (WTF::::fullLookupForWriting):
1141 2007-10-30 Adam Roben <aroben@apple.com>
1143 * kjs/collector.h: Make HeapType public so it can be used for non-member
1144 things like the HeapConstants struct template. Fixes the build on Windows.
1146 2007-10-30 Adam Roben <aroben@apple.com>
1148 Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows
1150 Speeds up SunSpider by 0.4%.
1152 Reviewed by Steve and Maciej.
1154 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
1155 a warning during LTCG in release builds about double -> float
1157 * wtf/AlwaysInline.h:
1160 2007-10-30 Adam Roben <aroben@apple.com>
1162 Use GetCurrentThreadId instead of pthread_self in FastMalloc
1164 Speeds up SunSpider by 0.3%.
1168 * wtf/FastMalloc.cpp:
1169 (WTF::TCMalloc_ThreadCache::InitTSD):
1170 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
1172 2007-10-30 Adam Roben <aroben@apple.com>
1174 Switch to a Win32 critical section implementation of spinlocks
1176 Speeds up SunSpider by 0.4%.
1180 * wtf/FastMalloc.cpp:
1182 (TCMalloc_SpinLock::TCMalloc_SpinLock):
1183 (TCMalloc_SpinLock::Init):
1184 (TCMalloc_SpinLock::Finalize):
1185 (TCMalloc_SpinLock::Lock):
1186 (TCMalloc_SpinLock::Unlock):
1187 * wtf/TCSystemAlloc.cpp:
1189 2007-10-30 Adam Roben <aroben@apple.com>
1191 Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta
1193 http://bugs.webkit.org/show_bug.cgi?id=15586
1195 Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll
1197 Use Win32 TLS functions instead of __declspec(thread), which breaks
1202 * wtf/FastMalloc.cpp:
1203 (WTF::getThreadHeap):
1204 (WTF::TCMalloc_ThreadCache::InitModule):
1206 2007-10-30 Maciej Stachowiak <mjs@apple.com>
1210 - allocate numbers in half-size cells, for an 0.5% SunSpider speedup
1211 http://bugs.webkit.org/show_bug.cgi?id=15772
1213 We do this by using a single mark bit per two number cells, and
1216 Besides being an 0.5% win overall, this is a 7.1% win on morph.
1218 * kjs/collector.cpp:
1220 (KJS::Collector::heapAllocate):
1221 (KJS::Collector::markStackObjectsConservatively):
1222 (KJS::Collector::sweep):
1224 (KJS::SmallCollectorCell::):
1226 2007-10-30 Geoffrey Garen <ggaren@apple.com>
1228 Reviewed by Adam Roben, Sam Weinig.
1230 Made conflicts in grammar.y a persistent build failure.
1232 * DerivedSources.make:
1234 2007-10-30 Kevin McCullough <kmccullough@apple.com>
1236 Reviewed by Adam and Geoff.
1238 - Added a new cast so all the casts are in the same place.
1243 2007-10-30 Geoffrey Garen <ggaren@apple.com>
1245 Reviewed by Darin Adler.
1247 Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
1251 ecma_2/Statements/dowhile-001.js
1252 ecma_2/Statements/dowhile-002.js
1253 ecma_2/Statements/dowhile-003.js
1254 ecma_2/Statements/dowhile-004.js
1255 ecma_2/Statements/dowhile-005.js
1256 ecma_2/Statements/dowhile-006.js
1257 ecma_2/Statements/dowhile-007.js
1258 js1_2/statements/do_while.js
1260 and layout tests, including
1262 do-while-expression-value.html
1263 do-while-semicolon.html
1264 do-while-without-semicolon.html
1268 * kjs/grammar.y: Use the explicit "error" production, as we do with other
1269 automatic semicolon insertions, to disambiguate "do { } while();" from
1270 "do { } while()" followed by ";" (the empty statement).
1272 2007-10-29 Oliver Hunt <oliver@apple.com>
1276 Debranching remaining assignment nodes, and miscellaneous cleanup
1278 Split read-modify code paths out of AssignBracketNode and AssignDotNode
1279 Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode
1280 and ReadModifyResolveNode evaluate methods
1282 Leads to a 1% gain in SunSpider.
1286 (KJS::ReadModifyLocalVarNode::evaluate):
1287 (KJS::ReadModifyResolveNode::evaluate):
1288 (KJS::AssignDotNode::evaluate):
1289 (KJS::ReadModifyDotNode::optimizeVariableAccess):
1290 (KJS::ReadModifyDotNode::evaluate):
1291 (KJS::AssignBracketNode::evaluate):
1292 (KJS::ReadModifyBracketNode::optimizeVariableAccess):
1293 (KJS::ReadModifyBracketNode::evaluate):
1295 (KJS::AssignBracketNode::):
1296 (KJS::AssignBracketNode::precedence):
1297 (KJS::AssignDotNode::):
1298 (KJS::AssignDotNode::precedence):
1299 * kjs/nodes2string.cpp:
1300 (KJS::ReadModifyBracketNode::streamTo):
1301 (KJS::AssignBracketNode::streamTo):
1302 (KJS::ReadModifyDotNode::streamTo):
1303 (KJS::AssignDotNode::streamTo):
1305 2007-10-29 Oliver Hunt <oliver@apple.com>
1307 Debranching various Node::evaluate implementations
1311 Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
1312 Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
1314 Gains 1.6% on SunSpider
1316 * JavaScriptCore.xcodeproj/project.pbxproj:
1319 (KJS::PostIncResolveNode::optimizeVariableAccess):
1320 (KJS::PostIncResolveNode::evaluate):
1321 (KJS::PostIncLocalVarNode::evaluate):
1322 (KJS::PostDecResolveNode::optimizeVariableAccess):
1323 (KJS::PostDecResolveNode::evaluate):
1324 (KJS::PostDecLocalVarNode::evaluate):
1325 (KJS::PostIncBracketNode::evaluate):
1326 (KJS::PostDecBracketNode::evaluate):
1327 (KJS::PostIncDotNode::evaluate):
1328 (KJS::PostDecDotNode::evaluate):
1329 (KJS::PreIncResolveNode::optimizeVariableAccess):
1330 (KJS::PreIncLocalVarNode::evaluate):
1331 (KJS::PreIncResolveNode::evaluate):
1332 (KJS::PreDecResolveNode::optimizeVariableAccess):
1333 (KJS::PreDecLocalVarNode::evaluate):
1334 (KJS::PreDecResolveNode::evaluate):
1335 (KJS::PreIncBracketNode::evaluate):
1336 (KJS::PreDecBracketNode::evaluate):
1337 (KJS::PreIncDotNode::evaluate):
1338 (KJS::PreDecDotNode::evaluate):
1339 (KJS::ReadModifyResolveNode::optimizeVariableAccess):
1340 (KJS::AssignResolveNode::optimizeVariableAccess):
1341 (KJS::AssignLocalVarNode::evaluate):
1342 (KJS::AssignResolveNode::evaluate):
1344 (KJS::PostDecResolveNode::):
1345 (KJS::PostDecResolveNode::precedence):
1346 (KJS::PostDecLocalVarNode::):
1347 (KJS::PostfixBracketNode::):
1348 (KJS::PostfixBracketNode::precedence):
1349 (KJS::PostIncBracketNode::):
1350 (KJS::PostIncBracketNode::isIncrement):
1351 (KJS::PostDecBracketNode::):
1352 (KJS::PostDecBracketNode::isIncrement):
1353 (KJS::PostfixDotNode::):
1354 (KJS::PostfixDotNode::precedence):
1355 (KJS::PostIncDotNode::):
1356 (KJS::PostIncDotNode::isIncrement):
1357 (KJS::PostDecDotNode::):
1358 (KJS::PreIncResolveNode::):
1359 (KJS::PreDecResolveNode::):
1360 (KJS::PreDecResolveNode::precedence):
1361 (KJS::PreDecLocalVarNode::):
1362 (KJS::PrefixBracketNode::):
1363 (KJS::PrefixBracketNode::precedence):
1364 (KJS::PreIncBracketNode::):
1365 (KJS::PreIncBracketNode::isIncrement):
1366 (KJS::PreDecBracketNode::):
1367 (KJS::PreDecBracketNode::isIncrement):
1368 (KJS::PrefixDotNode::):
1369 (KJS::PrefixDotNode::precedence):
1370 (KJS::PreIncDotNode::):
1371 (KJS::PreIncDotNode::isIncrement):
1372 (KJS::PreDecDotNode::):
1373 (KJS::ReadModifyResolveNode::):
1374 (KJS::ReadModifyLocalVarNode::):
1375 (KJS::AssignResolveNode::):
1376 (KJS::AssignResolveNode::precedence):
1377 * kjs/nodes2string.cpp:
1378 (KJS::PostIncResolveNode::streamTo):
1379 (KJS::PostDecResolveNode::streamTo):
1380 (KJS::PostfixBracketNode::streamTo):
1381 (KJS::PostfixDotNode::streamTo):
1382 (KJS::PreIncResolveNode::streamTo):
1383 (KJS::PreDecResolveNode::streamTo):
1384 (KJS::ReadModifyResolveNode::streamTo):
1385 (KJS::AssignResolveNode::streamTo):
1387 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1389 Not reviewed, build fix.
1391 - Include Vector.h in a way that actually works.
1393 * kjs/LocalStorage.h:
1395 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1397 Not reviewed, build fix.
1399 - Install LocalStorage.h as a private header.
1401 * JavaScriptCore.xcodeproj/project.pbxproj:
1403 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1407 - Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.
1409 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1410 * JavaScriptCore.xcodeproj/project.pbxproj:
1411 * kjs/LocalStorage.h: Added.
1412 (KJS::LocalStorageEntry::LocalStorageEntry):
1416 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
1418 2007-10-29 Geoffrey Garen <ggaren@apple.com>
1420 Reviewed by Oliver Hunt.
1422 Some small tweaks that I notice while reviewing Oliver's last patch.
1424 Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
1426 No change in SunSpider because SunSpider doesn't take the code path that
1427 would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.
1430 (KJS::LocalVarPostfixNode::evaluate):
1431 (KJS::TypeOfResolveNode::optimizeVariableAccess):
1432 (KJS::LocalVarTypeOfNode::evaluate):
1433 (KJS::PrefixResolveNode::optimizeVariableAccess):
1434 (KJS::LocalVarPrefixNode::evaluate):
1435 (KJS::AssignResolveNode::optimizeVariableAccess):
1436 (KJS::LocalVarAssignNode::evaluate):
1438 (KJS::LocalVarTypeOfNode::):
1439 (KJS::PrefixResolveNode::):
1440 (KJS::LocalVarPrefixNode::):
1441 (KJS::AssignResolveNode::):
1442 (KJS::LocalVarAssignNode::):
1444 2007-10-29 Eric Seidel <eric@webkit.org>
1448 SunSpider claims this was a 0.7% speedup.
1450 * kjs/string_object.cpp:
1451 (KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case
1453 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1457 - re-enable asserts for access to empty or deleted keys
1461 (WTF::::lookupForWriting):
1462 (WTF::::fullLookupForWriting):
1465 2007-10-29 Eric Seidel <eric@webkit.org>
1467 Build fix only, no review.
1469 * JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot
1471 2007-10-29 Mark Rowe <mrowe@apple.com>
1473 Gtk build fix. Move struct declarations into nodes.h.
1478 2007-10-29 Eric Seidel <eric@webkit.org>
1482 Give StringInstance a getOwnPropertySlot(ExecState, unsigned, PropertySlot) fastpath, just like Arrays.
1483 Make it a compile time error to use toString(ExecState) on a StringInstance
1485 SunSpider claims this was a 6.6% speedup overall (22% on string-base64)
1488 (KJS::StringImp::getLength):
1489 * kjs/string_object.cpp:
1490 (KJS::StringInstance::lengthGetter):
1491 (KJS::StringInstance::inlineGetOwnPropertySlot):
1492 (KJS::StringInstance::getOwnPropertySlot):
1493 * kjs/string_object.h:
1495 2007-10-28 Oliver Hunt <oliver@apple.com>
1499 Add nodes to allow Assignment, TypeOf, and prefix operators to
1500 make use of the new optimised local variable look up.
1502 5% gain on sunspider
1505 (KJS::TypeOfResolveNode::optimizeVariableAccess):
1506 (KJS::LocalTypeOfAccessNode::evaluate):
1507 (KJS::PrefixResolveNode::optimizeVariableAccess):
1508 (KJS::PrefixLocalAccessNode::evaluate):
1509 (KJS::AssignResolveNode::optimizeVariableAccess):
1510 (KJS::AssignLocalAccessNode::evaluate):
1512 (KJS::TypeOfResolveNode::):
1513 (KJS::TypeOfResolveNode::precedence):
1514 (KJS::LocalTypeOfAccessNode::):
1515 (KJS::PrefixResolveNode::):
1516 (KJS::PrefixResolveNode::precedence):
1517 (KJS::PrefixLocalAccessNode::):
1518 (KJS::AssignResolveNode::):
1519 (KJS::AssignLocalAccessNode::):
1521 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1525 - avoid creating and then breaking circular lists in the parser, instead track head and tail pointers at parse time
1526 http://bugs.webkit.org/show_bug.cgi?id=15748
1528 Not a significant speedup or slowdown on SunSpider.
1531 (KJS::clearNewNodes):
1535 (KJS::BlockNode::BlockNode):
1536 (KJS::CaseBlockNode::CaseBlockNode):
1537 (KJS::FunctionBodyNode::FunctionBodyNode):
1538 (KJS::SourceElementsNode::SourceElementsNode):
1539 (KJS::ProgramNode::ProgramNode):
1541 (KJS::ElementNode::):
1543 (KJS::PropertyListNode::):
1544 (KJS::ObjectLiteralNode::):
1545 (KJS::ArgumentListNode::):
1546 (KJS::ArgumentsNode::):
1547 (KJS::VarDeclListNode::):
1548 (KJS::VarStatementNode::):
1550 (KJS::ParameterNode::):
1551 (KJS::FuncExprNode::):
1552 (KJS::FuncDeclNode::):
1553 (KJS::SourceElementsNode::):
1554 (KJS::CaseClauseNode::):
1555 (KJS::ClauseListNode::):
1557 2007-10-28 Mark Rowe <mrowe@apple.com>
1559 Disable assertions in a manner that doesn't break the Qt Windows build.
1563 (WTF::::lookupForWriting):
1564 (WTF::::fullLookupForWriting):
1566 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1568 Temporarily disabling some ASSERTs I introduced in my last check-in
1569 because of http://bugs.webkit.org/show_bug.cgi?id=15747
1570 Lots of layout tests fail the !HashTranslator::equal(KeyTraits::emptyValue() ASSERT
1574 (WTF::::lookupForWriting):
1575 (WTF::::fullLookupForWriting):
1578 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1580 Reviewed by Darin Adler.
1582 Fixed http://bugs.webkit.org/show_bug.cgi?id=15746
1583 #ifndef ASSERT_DISABLED is no good!
1585 Replaced with #if !ASSERT_DISABLED.
1589 (WTF::::lookupForWriting):
1590 (WTF::::fullLookupForWriting):
1593 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1595 Reviewed by Darin Adler.
1597 Added FunctionCallResolveNode, PostfixResolveNode, and DeleteResolveNode
1598 to the AST transfom that replaces slow resolve nodes with fast local
1599 variable alternatives.
1601 2.5% speedup on SunSpider.
1603 Also added some missing copyright notices.
1606 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
1607 (KJS::FunctionCallResolveNode::evaluate):
1608 (KJS::LocalVarFunctionCallNode::evaluate):
1609 (KJS::PostfixResolveNode::optimizeVariableAccess):
1610 (KJS::PostfixResolveNode::evaluate):
1611 (KJS::LocalVarPostfixNode::evaluate):
1612 (KJS::DeleteResolveNode::optimizeVariableAccess):
1613 (KJS::DeleteResolveNode::evaluate):
1614 (KJS::LocalVarDeleteNode::evaluate):
1616 (KJS::FunctionCallResolveNode::):
1617 (KJS::LocalVarFunctionCallNode::LocalVarFunctionCallNode):
1618 (KJS::PostfixResolveNode::):
1619 (KJS::LocalVarPostfixNode::LocalVarPostfixNode):
1620 (KJS::DeleteResolveNode::):
1621 (KJS::LocalVarDeleteNode::LocalVarDeleteNode):
1623 2007-10-28 Eric Seidel <eric@webkit.org>
1627 Inline UString::Rep::deref() for a 0.8% improvement in SunSpider
1628 Add virtual keyword to a few virtual functions previously unmarked.
1631 (KJS::StringImp::type):
1632 (KJS::NumberImp::type):
1634 (KJS::UString::Rep::deref):
1636 2007-10-28 Darin Adler <darin@apple.com>
1638 - fix "broken everything" from the storage leak fix
1640 * wtf/RefPtr.h: (WTF::RefPtr::RefPtr): Added a PlacementNewAdopt constructor.
1641 * kjs/ustring.h: (KJS::UString::UString): Pass PlacementNewAdopt along to RefPtr.
1643 2007-10-28 Darin Adler <darin@apple.com>
1647 - turn on unused parameter waring on Mac OS X because it's already on elsewhere
1649 * Configurations/Base.xcconfig: Took out -wno-unused-parameter.
1655 Fixed unused variables by using them or marked them with UNUSED_PARAM.
1657 * kjs/CollectorHeapIntrospector.h: (KJS::CollectorHeapIntrospector::zoneCalloc):
1658 Removed parameter names to indicate they are unused.
1660 2007-10-28 Darin Adler <darin@apple.com>
1664 - fix a storage leak where we ref the UString every time we replace
1665 a ResolveNode with a LocalVarAccessNode
1667 * kjs/identifier.h: (KJS::Identifier::Identifier): Added a constructor
1668 that takes PlacementNewAdopt.
1670 * kjs/nodes.h: (KJS::ResolveNode::ResolveNode): Initialize the ident
1671 with PlacementNewAdopt instead of the old value of ident.
1673 * kjs/ustring.h: (KJS::UString::UString): Added a constructor that
1674 takes PlacementNewAdopt.
1676 2007-10-28 Darin Adler <darin@apple.com>
1678 - Windows build fix; get rid of unused parameter
1680 * kjs/nodes.cpp: (KJS::ResolveNode::optimizeVariableAccess): Don't pass it.
1681 * kjs/nodes.h: (KJS::LocalVarAccessNode::LocalVarAccessNode): Remove it.
1682 The assertions weren't all that helpful.
1684 2007-10-28 Mark Rowe <mrowe@apple.com>
1686 Gtk build fix. Add include of MathExtras.h.
1688 * kjs/string_object.cpp:
1690 2007-10-28 Mark Rowe <mrowe@apple.com>
1692 Reviewed by Maciej and Tim.
1694 Replace uses of isNaN and isInf with isnan and isinf, and
1695 remove isNaN and isInf.
1697 * kjs/config.h: Remove unused HAVE_'s.
1698 * kjs/date_object.cpp:
1699 (KJS::DateInstance::getTime):
1700 (KJS::DateInstance::getUTCTime):
1701 (KJS::DateProtoFunc::callAsFunction):
1702 (KJS::DateObjectImp::construct):
1703 (KJS::DateObjectFuncImp::callAsFunction):
1705 (KJS::GlobalFuncImp::callAsFunction):
1706 * kjs/math_object.cpp:
1707 (MathFuncImp::callAsFunction):
1708 * kjs/nodes2string.cpp:
1709 (KJS::isParserRoundTripNumber):
1710 * kjs/number_object.cpp:
1711 (NumberProtoFunc::callAsFunction):
1712 * kjs/operations.cpp:
1714 * kjs/string_object.cpp:
1715 (KJS::StringProtoFunc::callAsFunction):
1717 (KJS::UString::from):
1719 (KJS::JSValue::toInteger):
1720 (KJS::JSValue::toInt32SlowCase):
1721 (KJS::JSValue::toUInt32SlowCase):
1723 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1725 Build fix: use the new-fangled missingSymbolMarker().
1728 (KJS::ResolveNode::optimizeVariableAccess):
1730 (KJS::LocalVarAccessNode::LocalVarAccessNode):
1732 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1734 Reviewed by Maciej Stachowiak, Darin Adler.
1736 Much supporting work done by Maciej Stachowiak, Maks Orlovich, and
1739 AST transfom to replace slow resolve nodes with fast local variable
1740 alternatives that do direct memory access. Currently, only ResolveNode
1741 provides a fast local variable alternative. 6 others are soon to come.
1743 16.7% speedup on SunSpider.
1745 Most of this patch is just scaffolding to support iterating all the
1746 resolve nodes in the AST through optimizeResolveNodes(). In
1747 optimizeResolveNodes(), most classes just push their child nodes onto
1748 the processing stack, while ResolveNodes actually replace themselves in
1749 the tree with more optimized alternatives, if possible.
1751 Here are the interesting bits:
1753 * kjs/nodes.h: Added PlacementNewAdoptTag, along with implementations
1754 in Node and ResolveNode. This tag allows you to use placement new to
1755 swap out a base class Node in favor of a subclass copy that holds the
1756 same data. (Without this tag, default initialization would NULL out
1757 RefPtrs, change line numbers, etc.)
1760 (KJS::ResolveNode::evaluate): Since we're taking the slow path, ASSERT
1761 that the fast path is impossible, to make sure we didn't leave anything
1764 (KJS::FunctionBodyNode::optimizeResolveNodes): Here's where the AST
1765 transformation happens.
1767 (KJS::ResolveNode::optimizeResolveNodes): Here's where the ResolveNode
1768 optimization happens.
1770 * kjs/function.h: Added symbolTable() accessor for, for the sake of
1773 2007-10-28 Mark Rowe <mrowe@apple.com>
1777 Fix "AllInOneFile.o has a global initializer in it".
1779 Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
1780 We can avoid this by moving it inside an inline function.
1782 * kjs/SymbolTable.h:
1783 (KJS::missingSymbolMarker):
1785 (KJS::ActivationImp::getOwnPropertySlot):
1786 (KJS::ActivationImp::put):
1788 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1792 - Added assertions to protect against adding empty or deleted keys to a HashTable
1795 (WTF::HashTable::lookup):
1796 (WTF::HashTable::lookupForWriting):
1797 (WTF::HashTable::fullLookupForWriting):
1798 (WTF::HashTable::add):
1800 2007-10-28 Darin Adler <darin@apple.com>
1804 * kjs/nodes2string.cpp: (KJS::isParserRoundTripNumber):
1805 Use isNaN and isInf instead of isnan and isinf.
1807 2007-10-28 Darin Adler <darin@apple.com>
1811 - http://bugs.webkit.org/show_bug.cgi?id=15735
1812 remove GroupNode to simplify AST and possibly get a modest speedup
1814 This patch removes 4 node types: GroupNode, PropertyNameNode,
1815 FunctionCallParenBracketNode, and FunctionCallParenDotNode.
1817 To remove GroupNode, we add knowledge of precedence to the tree nodes,
1818 and use that when serializing to determine where parentheses are needed.
1819 This means we no longer have to represent parentheses in the tree.
1821 The precedence values are named after productions in the grammar from the
1822 JavaScript standard.
1824 SunSpider says this is an 0.4% speedup.
1827 * kjs/function.cpp: Removed escapeStringForPrettyPrinting -- it's part of
1828 serialization, so I moved it to the file that takes care of that.
1830 * kjs/grammar.y: Changed makeGetterOrSetterPropertyNode to use 0 to
1831 indicate failure instead of a separate boolean. Got rid of PropertyNameNode
1832 by merging the PropertyName rule into the Property rule (which was easier
1833 than figuring out how to pass the Identifier from one node to another).
1834 Got rid of GroupNode, nodeInsideAllParens(), FunctionCallParenBracketNode,
1835 and FunctionCallParenDotNode.
1837 * kjs/nodes.h: Removed unused forward declarations and Operator values.
1838 Added Precedence enum, and precedence function to all nodes. Removed
1839 nodeInsideAllParens. Added streamBinaryOperator function for serialization.
1840 Removed GroupNode and PropertyNameNode. Made PropertyNode store an Identifier.
1841 Removed FunctionCallParenBracketNode and FunctionCallParenDotNode.
1843 * kjs/nodes.cpp: Removed Node::nodinsideAllParens, GroupNode, and PropertyNameNode.
1844 (KJS::PropertyListNode::evaluate): Changed code to get name directly instead
1845 of converting it from an Identifier to a jsString then back to a UString
1846 then into an Identifier again!
1848 * kjs/nodes2string.cpp: Changed special-token implementation to use a separate
1849 function for each of Endl, Indent, Unindent, and DotExpr instead of using a
1850 single function with a switch. Added a precedence that you can stream in, to
1851 cause the next node serialized to add parentheses based on that precedence value.
1852 (KJS::operatorString): Moved to the top of the file.
1853 (KJS::escapeStringForPrettyPrinting): Moved here from function.cpp. Removed old
1854 workaround for snprintf, since StringExtras.h takes care of that.
1855 (KJS::operator<<): Made the char and char* versions faster by using UString's
1856 character append functions instead of constructing a UString. Added the logic
1857 to the Node* version to add parentheses if needed.
1858 (KJS::Node::streamLeftAssociativeBinaryOperator): Added helper function.
1859 (KJS::ElementNode::streamTo): Use PrecAssignment for the elements.
1860 (KJS::BracketAccessorNode::streamTo): Use PrecCall for the expression before
1862 (KJS::DotAccessorNode::streamTo): Use PrecCall for the expression before the dot.
1863 (KJS::ArgumentListNode::streamTo): Use PrecAssignment for the arguments.
1864 (KJS::NewExprNode::streamTo): Use PrecMember for the expression.
1865 (KJS::FunctionCallValueNode::streamTo): Use PrecCall.
1866 (KJS::FunctionCallBracketNode::streamTo): Ditto.
1867 (KJS::FunctionCallDotNode::streamTo): Ditto.
1868 (KJS::PostfixBracketNode::streamTo): Ditto.
1869 (KJS::PostfixDotNode::streamTo): Ditto.
1870 (KJS::PostfixErrorNode::streamTo): Use PrecLeftHandSide.
1871 (KJS::DeleteBracketNode::streamTo): Use PrecCall.
1872 (KJS::DeleteDotNode::streamTo): Ditto.
1873 (KJS::DeleteValueNode::streamTo): Use PrecUnary.
1874 (KJS::VoidNode::streamTo): Ditto.
1875 (KJS::TypeOfValueNode::streamTo): Ditto.
1876 (KJS::PrefixBracketNode::streamTo): Use PrecCall.
1877 (KJS::PrefixDotNode::streamTo): Ditto.
1878 (KJS::PrefixErrorNode::streamTo): Use PrecUnary.
1879 (KJS::UnaryPlusNode::streamTo): Ditto.
1880 (KJS::NegateNode::streamTo): Ditto.
1881 (KJS::BitwiseNotNode::streamTo): Ditto.
1882 (KJS::LogicalNotNode::streamTo): Ditto.
1883 (KJS::MultNode::streamTo): Use streamLeftAssociativeBinaryOperator.
1884 (KJS::DivNode::streamTo): Ditto.
1885 (KJS::ModNode::streamTo): Ditto.
1886 (KJS::AddNode::streamTo): Ditto.
1887 (KJS::SubNode::streamTo): Ditto.
1888 (KJS::LeftShiftNode::streamTo): Ditto.
1889 (KJS::RightShiftNode::streamTo): Ditto.
1890 (KJS::UnsignedRightShiftNode::streamTo): Ditto.
1891 (KJS::LessNode::streamTo): Ditto.
1892 (KJS::GreaterNode::streamTo): Ditto.
1893 (KJS::LessEqNode::streamTo): Ditto.
1894 (KJS::GreaterEqNode::streamTo): Ditto.
1895 (KJS::InstanceOfNode::streamTo): Ditto.
1896 (KJS::InNode::streamTo): Ditto.
1897 (KJS::EqualNode::streamTo): Ditto.
1898 (KJS::NotEqualNode::streamTo): Ditto.
1899 (KJS::StrictEqualNode::streamTo): Ditto.
1900 (KJS::NotStrictEqualNode::streamTo): Ditto.
1901 (KJS::BitAndNode::streamTo): Ditto.
1902 (KJS::BitXOrNode::streamTo): Ditto.
1903 (KJS::BitOrNode::streamTo): Ditto.
1904 (KJS::LogicalAndNode::streamTo): Ditto.
1905 (KJS::LogicalOrNode::streamTo): Ditto.
1906 (KJS::ConditionalNode::streamTo): Ditto.
1907 (KJS::AssignResolveNode::streamTo): Use PrecAssignment for the right side.
1908 (KJS::AssignBracketNode::streamTo): Use PrecCall for the expression before
1909 the bracket and PrecAssignment for the right side.
1910 (KJS::AssignDotNode::streamTo): Ditto.
1911 (KJS::AssignErrorNode::streamTo): Use PrecLeftHandSide for the left side
1912 and PrecAssignment for the right side.
1913 (KJS::CommaNode::streamTo): Use PrecAssignment for both expressions.
1914 (KJS::AssignExprNode::streamTo): Use PrecAssignment.
1916 2007-10-28 Kevin Ollivier <kevino@theolliviers.com>
1918 Define wx port and set wx port USE options.
1920 Reviewed by Adam Roben.
1924 2007-10-28 Mark Rowe <mrowe@apple.com>
1926 We don't include "config.h" in headers.
1928 * bindings/jni/jni_instance.h:
1933 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1935 Rubber stamped by Mark.
1937 - avoid using non-portable SIZE_T_MAX in favor of std::numeric_limits
1939 * kjs/SymbolTable.h:
1940 (KJS::SymbolTableIndexHashTraits::emptyValue):
1942 (KJS::ActivationImp::getOwnPropertySlot):
1943 (KJS::ActivationImp::put):
1945 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1949 - switch SymbolTable to be a HashMap instead of a PropertyMap for 3% SunSpider speedup
1951 * kjs/SymbolTable.h:
1952 (KJS::IdentifierRepHash::hash): Special hash function for identifier reps.
1953 (KJS::IdentifierRepHash::equal): ditto
1954 (KJS::SymbolTableIndexHashTraits::emptyValue): Special HashTraits for the index value.
1955 (KJS::SymbolTable): change to a typedef for a HashMap.
1957 (KJS::ActivationImp::getOwnPropertySlot): Adjusted for new SymbolTable API.
1958 (KJS::ActivationImp::deleteProperty): ditto
1959 (KJS::ActivationImp::put): ditto
1962 (KJS::FunctionBodyNode::initializesymbolTable): Adjusted, since
1963 you now have to store a UString::rep, not an identifier.
1965 2007-10-27 Maciej Stachowiak <mjs@apple.com>
1969 - numerous HashTable performance improvements
1971 This does not quite add up to a measurable win on SunSpider, but it allows a
1972 follow-on > 3% improvement and probably helps WebCore too.
1974 I made the following improvements, among others:
1976 - Made HashFunctions note whether it is ok to compare a real value with the equal() function
1977 to the empty or deleted value, and used this to optimize the comparisons done in hash lookup.
1979 - Specialized lookup so it doesn't have to do so many extra branches and build so many extra
1980 std::pairs for cases that don't need them. There are now four versions, one for read-only access,
1981 two for writing, and one folded directly into add() (these all were improvments).
1983 - Made HashMap::get() use lookup() directly instead of find() to avoid having to build iterators.
1985 - Made a special constructor for iterators that knows it points to
1986 a valid filled cell and so skips updating itself.
1988 - Reordered memory accesses in the various lookup functions for better code generation
1990 - Made simple translators avoid passing a hash code around
1992 - Other minor tweaks
1996 (WTF::HashTableConstIterator::HashTableConstIterator):
1997 (WTF::HashTableIterator::HashTableIterator):
1998 (WTF::IdentityHashTranslator::translate):
1999 (WTF::HashTable::end):
2000 (WTF::HashTable::lookup):
2001 (WTF::HashTable::lookupForWriting):
2002 (WTF::HashTable::makeKnownGoodIterator):
2003 (WTF::HashTable::makeKnownGoodConstIterator):
2005 (WTF::::lookupForWriting):
2006 (WTF::::fullLookupForWriting):
2008 (WTF::::addPassingHashCode):
2012 * kjs/identifier.cpp:
2014 * wtf/HashFunctions.h:
2022 * wtf/ListHashSet.h:
2023 (WTF::ListHashSetTranslator::translate):
2025 2007-10-27 Darin Adler <darin@apple.com>
2029 - fix ASCIICType.h for some Windows compiles
2031 * wtf/ASCIICType.h: Check the compiler, not the OS, since it's the
2032 compiler/library that has the wchar_t that is just a typedef.
2034 2007-10-27 Kevin McCullough <kmccullough@apple.com>
2037 - Forgot to change the build step when I changed the filename.
2039 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2041 2007-10-27 Geoffrey Garen <ggaren@apple.com>
2043 Reviewed by Darin Adler.
2045 Fixed the rest of "ASSERTION FAILED: _hash in KJS::UString::Rep::
2047 http://bugs.webkit.org/show_bug.cgi?id=15718
2049 * kjs/identifier.cpp: Fixed more cases where an Identifier didn't get a
2050 hash value. Also changed O(n) strlen to O(1) check for empty string.
2051 (KJS::Identifier::add):
2053 * kjs/ustring.cpp: Changed O(n) strlens to O(1) checks for empty string.
2054 (KJS::UString::UString):
2055 (KJS::UString::operator=):
2057 2007-10-27 Darin Adler <darin@apple.com>
2061 - fix pow on Windows
2063 * wtf/MathExtras.h: (wtf_pow): Add a special case for MSVC, which has
2064 a "pow" function that does not properly handle the case where arg1 is
2067 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Don't explicity
2068 specify "::pow" -- just "pow" is fine.
2070 2007-10-27 Darin Adler <darin@apple.com>
2074 - http://bugs.webkit.org/show_bug.cgi?id=15711
2075 force JSImmediate to be inlined for roughly 1.2% SunSpider speedup
2077 * kjs/JSImmediate.h: Put ALWAYS_INLINE on everything.
2079 * kjs/object.h: Removed redundant includes.
2080 * kjs/value.h: Ditto.
2082 2007-10-27 Maciej Stachowiak <mjs@apple.com>
2086 - fixed "ASSERTION FAILED: _hash in KJS::UString::Rep::computedHash()"
2087 http://bugs.webkit.org/show_bug.cgi?id=15718
2089 * kjs/identifier.cpp:
2090 (KJS::Identifier::addSlowCase): Ensure that empty Identifiers have a hash computed,
2091 now that we count on all Identifiers already having one.
2093 2007-10-27 Mark Rowe <mrowe@apple.com>
2097 * kjs/SymbolTable.h:
2099 2007-10-27 Mark Rowe <mrowe@apple.com>
2105 2007-10-26 Kevin McCullough <kmccullough@apple.com>
2107 Rubber stamp by Adam.
2109 - Renamed JSStringRefCOM to JSStringRefBSTR since it he only thing the
2110 files contain are functions that operate on BSTRs.
2112 * API/JSStringRefBSTR.cpp: Copied from API/JSStringRefCOM.cpp.
2113 * API/JSStringRefBSTR.h: Copied from API/JSStringRefCOM.h.
2114 * API/JSStringRefCOM.cpp: Removed.
2115 * API/JSStringRefCOM.h: Removed.
2116 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2118 2007-10-26 Kevin McCullough <kmccullough@apple.com>
2122 - Made JSStringCreateWithBSTR capable of handling null BSTRs.
2124 * API/JSStringRefCOM.cpp:
2125 (JSStringCreateWithBSTR):
2127 2007-10-26 Sam Weinig <sam@webkit.org>
2131 * kjs/SymbolTable.h: Add header gaurd.
2132 * kjs/nodes.h: #include "SymbolTable.h"
2134 2007-10-26 Geoffrey Garen <ggaren@apple.com>
2136 Suggested by Anders Carlsson.
2141 (KJS::ActivationImp::getOwnPropertySlot):
2143 2007-10-26 Geoffrey Garen <ggaren@apple.com>
2145 Suggested by Darin Adler.
2147 Use computedHash(), which is safer than just directly accessing _hash.
2150 (KJS::Lookup::findEntry):
2151 (KJS::Lookup::find):
2153 2007-10-26 Geoffrey Garen <ggaren@apple.com>
2155 Build fix: svn add SymbolTable.h
2157 * kjs/SymbolTable.h: Added.
2158 (KJS::SymbolTable::set):
2159 (KJS::SymbolTable::get):
2161 2007-10-26 Geoffrey Garen <ggaren@apple.com>
2163 Build fix: export SymbolTable.h to WebCore.
2165 * JavaScriptCore.xcodeproj/project.pbxproj:
2167 2007-10-26 Geoffrey Garen <ggaren@apple.com>
2169 Comment tweak suggested by Maciej.
2172 (KJS::ActivationImp::getOwnPropertySlot):
2174 2007-10-26 Geoffrey Garen <ggaren@apple.com>
2176 Reviewed by Maciej Stachowiak.
2178 Tweaked property maps to remove 2 branches. 2.5% speedup on SunSpider.
2180 * kjs/property_map.cpp: Use a special no branch accessor to the UString's
2181 hash value. Also, return immediately instead of branching to the end
2182 of the loop if the value is not found.
2183 (KJS::PropertyMap::get):
2184 (KJS::PropertyMap::getLocation):
2185 (KJS::PropertyMap::put):
2186 (KJS::PropertyMap::insert):
2187 (KJS::PropertyMap::remove):
2188 (KJS::PropertyMap::checkConsistency):
2191 (KJS::UString::Rep::computedHash): Special no branch accessor to the
2192 UString's hash value. Used when the caller knows that the hash value
2193 has already been computed. (For example, if the caller got the UString
2194 from an Identifier.)
2196 2007-10-26 Geoffrey Garen <ggaren@apple.com>
2198 Reviewed by Maciej Stachowiak.
2200 Switched ActivationImp to using a symbol table. For now, though, all
2201 clients take the slow path.
2203 Net .6% speedup on SunSpider.
2206 - ActivationImp now mallocs in its constructor
2207 - Local variable hits use an extra level of indirection to retrieve
2209 - Local variable misses do two lookups
2212 - Fast initialization of local variables upon function entry
2214 * JavaScriptCore.xcodeproj/project.pbxproj: Added SymbolTable.h
2217 (KJS::ActivationImp::ActivationImp): Malloc a private structure to hold
2218 data that won't fit in a JSCell.
2219 (KJS::ActivationImp::argumentsGetter): Use slow symbol table path for
2221 (KJS::ActivationImp::getOwnPropertySlot): ditto
2222 (KJS::ActivationImp::deleteProperty): ditto
2223 (KJS::ActivationImp::put): ditto
2224 (KJS::ActivationImp::createArgumentsObject): ditto
2226 (KJS::ActivationImp::mark): Call JSObject::mark first so that one of
2227 our properties doesn't try to recursively mark us. (This caused a crash
2228 in earlier testing. Not sure why we haven't run into it before.)
2230 * kjs/nodes.cpp: Functions now build a symbol table the first time
2232 (KJS::VarDeclNode::evaluate):
2233 (KJS::FunctionBodyNode::FunctionBodyNode):
2234 (KJS::FunctionBodyNode::initializeSymbolTable):
2235 (KJS::FunctionBodyNode::processDeclarations):
2236 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
2237 (KJS::FunctionBodyNode::processDeclarationsForProgramCode):
2240 (KJS::FunctionBodyNode::symbolTable):
2242 * wtf/Forward.h: Added Vector.
2244 2007-10-26 Kevin McCullough <kmccullough@apple.com>
2246 - Corrected function name mistake in this changelog.
2248 2007-10-26 Kevin McCullough <kmccullough@apple.com>
2249 Reviewed by Sam and Steve.
2251 - Added convenience methods for converting between BSTR and JSStringRefs
2253 * API/JSStringRefCOM.cpp: Added.
2254 (JSStringCreateWithBSTR):
2256 * API/JSStringRefCOM.h: Added.
2257 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2259 2007-10-26 Mark Rowe <mrowe@apple.com>
2263 * kjs/collector.cpp:
2264 (KJS::Collector::collect):
2266 2007-10-26 Oliver Hunt <oliver@apple.com>
2270 Make the JSC GC use a separate heap for JSNumbers to get a 0.7-1.4% progression in SunSpider.
2272 * kjs/CollectorHeapIntrospector.cpp:
2273 (KJS::CollectorHeapIntrospector::init):
2274 (KJS::CollectorHeapIntrospector::enumerate):
2275 * kjs/CollectorHeapIntrospector.h:
2276 * kjs/collector.cpp:
2277 (KJS::Collector::recordExtraCost):
2278 (KJS::Collector::heapAllocate):
2279 (KJS::Collector::allocate):
2280 (KJS::Collector::allocateNumber):
2281 (KJS::Collector::registerThread):
2282 (KJS::Collector::markStackObjectsConservatively):
2283 (KJS::Collector::markMainThreadOnlyObjects):
2284 (KJS::Collector::sweep):
2285 (KJS::Collector::collect):
2288 (KJS::NumberImp::operator new):
2289 Force numbers to be allocated in the secondary heap.
2291 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2295 - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
2298 (KJS::JSValue::getUInt32):
2299 (KJS::JSValue::getTruncatedInt32):
2300 (KJS::JSValue::toNumber):
2302 (WTF::PassRefPtr::~PassRefPtr):
2304 (WTF::RefPtr::operator->):
2306 2007-10-26 Mark Rowe <mrowe@apple.com>
2312 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2316 - Merge Context class fully into ExecState, since they are always created and used together.
2318 No measurable performance impact but this is a useful cleanup.
2320 * JavaScriptCore.pri:
2321 * kjs/ExecState.cpp:
2322 (KJS::ExecState::ExecState):
2323 (KJS::ExecState::~ExecState):
2324 (KJS::ExecState::mark):
2325 (KJS::ExecState::lexicalInterpreter):
2327 (KJS::ExecState::dynamicInterpreter):
2328 (KJS::ExecState::setException):
2329 (KJS::ExecState::clearException):
2330 (KJS::ExecState::exception):
2331 (KJS::ExecState::exceptionSlot):
2332 (KJS::ExecState::hadException):
2333 (KJS::ExecState::scopeChain):
2334 (KJS::ExecState::callingExecState):
2335 (KJS::ExecState::propertyNames):
2336 * kjs/collector.cpp:
2337 (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2339 (KJS::FunctionImp::callAsFunction):
2340 (KJS::FunctionImp::argumentsGetter):
2341 (KJS::FunctionImp::callerGetter):
2342 (KJS::GlobalFuncImp::callAsFunction):
2343 * kjs/interpreter.cpp:
2344 (KJS::Interpreter::Interpreter):
2345 (KJS::Interpreter::init):
2346 (KJS::Interpreter::evaluate):
2347 (KJS::Interpreter::mark):
2348 * kjs/interpreter.h:
2349 (KJS::Interpreter::setCurrentExec):
2350 (KJS::Interpreter::currentExec):
2352 (KJS::currentSourceId):
2353 (KJS::currentSourceURL):
2354 (KJS::ThisNode::evaluate):
2355 (KJS::ResolveNode::evaluate):
2356 (KJS::FunctionCallResolveNode::evaluate):
2357 (KJS::PostfixResolveNode::evaluate):
2358 (KJS::DeleteResolveNode::evaluate):
2359 (KJS::TypeOfResolveNode::evaluate):
2360 (KJS::PrefixResolveNode::evaluate):
2361 (KJS::AssignResolveNode::evaluate):
2362 (KJS::VarDeclNode::evaluate):
2363 (KJS::DoWhileNode::execute):
2364 (KJS::WhileNode::execute):
2365 (KJS::ForNode::execute):
2366 (KJS::ForInNode::execute):
2367 (KJS::ContinueNode::execute):
2368 (KJS::BreakNode::execute):
2369 (KJS::ReturnNode::execute):
2370 (KJS::WithNode::execute):
2371 (KJS::SwitchNode::execute):
2372 (KJS::LabelNode::execute):
2373 (KJS::TryNode::execute):
2374 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2375 (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2376 (KJS::FunctionBodyNode::processDeclarations):
2377 (KJS::FuncDeclNode::makeFunction):
2378 (KJS::FuncExprNode::evaluate):
2380 2007-10-26 Mark Rowe <mrowe@apple.com>
2384 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2386 2007-10-26 Mark Rowe <mrowe@apple.com>
2390 * JavaScriptCore.pri:
2391 * kjs/ExecState.cpp:
2393 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2397 - moved Context class into ExecState.{h,cpp} in preparation for merging
2398 ExecState and Context classes.
2400 * kjs/ExecState.h: Moved CodeType enum and Context class here in
2401 preparation for merging ExecState and Context.
2402 * kjs/ExecState.cpp: Moved Context class here from Context.cpp.
2403 (KJS::Context::Context):
2404 (KJS::Context::~Context):
2405 (KJS::Context::mark):
2406 * kjs/context.h: Removed.
2407 * kjs/Context.cpp: Removed.
2408 * kjs/function.h: Removed CodeType enum.
2409 * kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
2410 * kjs/internal.h: Removed LabelStack.
2411 * JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
2412 * kjs/collector.cpp: Fixed includes.
2413 * kjs/function.cpp: ditto
2414 * kjs/internal.cpp: ditto
2415 * kjs/interpreter.cpp: ditto
2416 * kjs/lookup.h: ditto
2417 * kjs/nodes.cpp: ditto
2419 2007-10-26 Mark Rowe <mrowe@apple.com>
2423 * kjs/string_object.cpp:
2424 (KJS::StringObjectFuncImp::callAsFunction):
2426 2007-10-25 Darin Adler <darin@apple.com>
2430 - http://bugs.webkit.org/show_bug.cgi?id=15703
2431 fix numeric functions -- improve correctness and speed
2433 Gives about 1% gain on SunSpider.
2435 * kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
2436 (KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
2437 with both immediate and number values.
2438 (KJS::JSValue::toUInt32): Ditto.
2440 (KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
2441 differences. One is that it now correctly returns 0 for NaN, and another is that
2442 there's no special case for 0 or infinity, since the general case already handles
2444 (KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
2446 (KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
2447 truncation done by the typecast already does the necessary truncation that
2448 roundValue was doing.
2449 (KJS::JSValue::toUInt32SlowCase): Ditto.
2450 (KJS::JSValue::toUInt16): Removed.
2452 * kjs/internal.h: Removed roundValue.
2453 * kjs/internal.cpp: Ditto.
2455 * kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
2456 code to handle NaN in Array.slice; toInteger now never returns NaN as specified.
2458 * kjs/date_object.cpp:
2459 (KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
2460 toNumber as specified.
2461 (KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
2462 with a call to toNumber and timeClip as specified.
2463 (KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
2464 where the default behavior of toInt32 (returning 0) was already correct. Replaced
2465 call to roundValue with a call to toNumber as specified.
2466 (KJS::DateObjectFuncImp::callAsFunction): Ditto.
2468 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
2469 cases for the pow function that the library already handles correctly.
2471 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
2472 call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
2473 The real toInteger now returns 0 for NaN. Took out unneeded special case in
2474 ToFixed for undefined; was only needed because our toInteger was wrong. Same
2475 thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.
2477 * kjs/string_object.cpp:
2478 (KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
2479 cases for undefined that were only needed because toInteger was wrong. Same in
2480 IndexOf, and was able to remove some special cases. In LastIndexOf, used
2481 toIntegerPreserveNaN, but was able to remove some special cases there too.
2482 Changed Substr implementation to preserve correct behavior with the change
2483 to toInteger and match the specification. Also made sure we weren't converting
2484 an out of range double to an int.
2485 (KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
2486 toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
2487 no reason to have toUInt16 as a second, less-optimized function that's only
2488 called at this one call site.
2490 * wtf/MathExtras.h: Added trunc function for Windows.
2492 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2494 Reviewed by Maciej Stachowiak.
2496 Tweaked the inner hashtable lookup loop to remove a branch in the "not
2497 found" case. .5% speedup on SunSpider.
2499 * JavaScriptCore.xcodeproj/project.pbxproj:
2503 2007-10-25 Maciej Stachowiak <mjs@apple.com>
2507 - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider
2510 (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
2511 adding any value over toNumber() here.
2512 (KJS::valueForReadModifyAssignment): Ditto.
2513 (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
2515 (KJS::lessThanEq): Ditto.
2516 * JavaScriptCore.exp: Export new functions as needed.
2518 (KJS::JSValue::toPrimitive): Fixed formatting.
2519 (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
2520 to number and tells you whether a toPrimitive() conversion with a Number hint
2521 would have given a string.
2523 (KJS::StringImp::getPrimitiveNumber): Implemented.
2524 (KJS::NumberImp::getPrimitiveNumber): ditto
2525 (KJS::GetterSetterImp::getPrimitiveNumber): ditto
2526 (KJS::StringImp::toPrimitive): Fixed formatting.
2527 (KJS::NumberImp::toPrimitive): ditto
2528 (KJS::GetterSetterImp::toPrimitive): ditto
2531 (KJS::JSObject::getPrimitiveNumber): Implemented.
2534 2007-10-25 Sam Weinig <sam@webkit.org>
2536 Reviewed by Adam Roben.
2538 Remove JSStringRefCFHack from windows as it is no longer needed.
2540 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2542 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2544 Reviewed by Oliver Hunt.
2546 Rolled out my last patch. It turns out that I needed 2 words, not 1,
2549 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2551 Reviewed by Oliver Hunt.
2553 Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
2554 Shrink the size of an activation object by 1 word
2556 This is in preparation for adding a symbol table to the activation
2559 The basic strategy here is to rely on the mutual exclusion between
2560 the arguments object pointer and the function pointer (you only need
2561 the latter in order to create the former), and store them in the same
2562 place. The LazyArgumentsObject class encapsulates this strategy.
2564 Also inlined the ArgumentsImp constructor, for good measure.
2566 SunSpider reports no regression. Regression tests pass.
2568 * JavaScriptCore.xcodeproj/project.pbxproj:
2570 (KJS::Context::~Context):
2572 (KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
2573 (KJS::ActivationImp::LazyArgumentsObject::mark):
2575 (KJS::ActivationImp::argumentsGetter):
2576 (KJS::ActivationImp::mark):
2578 (KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
2579 (KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
2580 (KJS::ActivationImp::LazyArgumentsObject::resetArguments):
2581 (KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
2582 (KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
2583 (KJS::ActivationImp::LazyArgumentsObject::setFunction):
2584 (KJS::ActivationImp::LazyArgumentsObject::function):
2585 (KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
2586 (KJS::ActivationImp::LazyArgumentsObject::):
2587 (KJS::ActivationImp::ActivationImp::ActivationImp):
2588 (KJS::ActivationImp::resetArguments):
2590 2007-10-25 Adam Roben <aroben@apple.com>
2592 Change JavaScriptCore.vcproj to use DerivedSources.make
2594 We were trying to emulate the logic of make in
2595 build-generated-files.sh, but we got it wrong. We now use a
2596 build-generated-files very much like the one that WebCore uses to
2599 We also now only have a Debug configuration of dftables which we build
2600 even when doing a Release build of JavaScriptCore. dftables also no
2601 longer has the "_debug" name suffix.
2603 Changes mostly made by Darin, reviewed by me.
2605 * DerivedSources.make: Add a variable to set the extension used for
2606 the dftables executable.
2607 * JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
2608 dftables in Release configurations.
2609 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
2610 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2611 - Updated include path to point to the new location of the derived
2613 - Modified pre-build event to pass the right arguments to
2614 build-generated-files.sh and not call dftables directly.
2615 - Added the derived source files to the project.
2616 - Removed grammarWrapper.cpp, which isn't needed now that we're
2617 compiling grammar.cpp directly.
2618 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2619 Slightly modified from the WebCore version.
2620 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
2621 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2622 - Changed the output location to match Mac.
2623 - Removed the Release configuration.
2624 - Removed the _debug suffix.
2626 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2628 Reviewed by Eric Seidel.
2630 Slightly elaborated the differences between declaration procesing in
2631 Function Code and Program Code.
2633 .3% speedup on SunSpider.
2636 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2637 (KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a
2638 minimum set of attributes instead of recomputing all the time. Also,
2639 ignore m_parameters, since programs don't have arguments.
2641 2007-10-25 Eric Seidel <eric@webkit.org>
2645 More preparation work before adding long-running mode to testkjs.
2648 (TestFunctionImp::callAsFunction):
2649 (prettyPrintScript):
2653 (fillBufferWithContentsOfFile):
2655 2007-10-25 Eric Seidel <eric@webkit.org>
2659 Bring testkjs code out of the dark ages in preparation for more
2660 radical improvements (like long-running testing support!)
2663 (TestFunctionImp::callAsFunction):
2666 (fillBufferWithContentsOfFile):
2668 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2670 Reviewed by Maciej Stachowiak.
2672 Make a fast path for declaration processing inside Function Code.
2674 Lifted declaration processing code up from individual declaration nodes
2675 and into processDeclarations.
2677 Broke out processDeclarations into two cases, depending on the type of
2678 code. This eliminates 2 branches, and facilitates more radical
2679 divergeance in the future.
2681 2.5% SunSpider speedup.
2683 * JavaScriptCore.xcodeproj/project.pbxproj:
2685 (KJS::FunctionBodyNode::initializeDeclarationStacks):
2686 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2687 (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2688 (KJS::FunctionBodyNode::execute):
2689 (KJS::FuncDeclNode::makeFunction):
2693 2007-10-25 Maciej Stachowiak <mjs@apple.com>
2697 - add header includes needed on platforms that don't use AllInOneFile.cpp
2699 * API/JSCallbackObject.cpp:
2701 * kjs/ExecState.cpp:
2702 * kjs/array_instance.cpp:
2703 * kjs/function_object.cpp:
2704 * kjs/interpreter.cpp:
2707 2007-10-25 Eric Seidel <eric@webkit.org>
2711 * JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private
2713 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2715 Reviewed by Maciej Stachowiak.
2717 Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
2718 Re-order declaration initialization to avoid calling hasProperty inside
2719 VarDeclNode::processDeclaration
2721 .7% speedup on SunSpider.
2724 * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
2725 other processing of declared symbols, so the order of execution could
2729 (KJS::VarDeclNode::getDeclarations): Added special case for the
2730 "arguments" property name, explained in the comment.
2732 (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
2733 in the case of function code, since we know the declared symbol
2734 management will resolve conflicts between symbols. Yay!
2736 (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's
2737 implementation of getDeclarations is non-trivial, we can't take a
2738 short-cut here any longer -- we need to put the VarDecl node on the
2739 stack so it gets processed normally.
2741 (KJS::FunctionBodyNode::processDeclarations): Changed the order of
2742 processing to enforce mutual exclusion rules.
2745 (KJS::DeclarationStacks::DeclarationStacks): Structure includes an
2746 ExecState now, for fast access to the "arguments" property name.
2748 2007-10-24 Eric Seidel <eric@webkit.org>
2752 Add a JSGlobalObject class and remove the InterpreterMap
2753 http://bugs.webkit.org/show_bug.cgi?id=15681
2755 This required making JSCallbackObject a template class to allow for
2756 JSGlobalObjects with JSCallbackObject functionality.
2758 SunSpider claims this was a 0.5% speedup.
2760 * API/JSCallbackObject.cpp:
2762 * API/JSCallbackObject.h:
2763 * API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
2764 (KJS::::JSCallbackObject):
2766 (KJS::::~JSCallbackObject):
2767 (KJS::::initializeIfNeeded):
2769 (KJS::::getOwnPropertySlot):
2771 (KJS::::deleteProperty):
2772 (KJS::::implementsConstruct):
2774 (KJS::::implementsHasInstance):
2775 (KJS::::hasInstance):
2776 (KJS::::implementsCall):
2777 (KJS::::callAsFunction):
2778 (KJS::::getPropertyNames):
2781 (KJS::::setPrivate):
2782 (KJS::::getPrivate):
2784 (KJS::::cachedValueGetter):
2785 (KJS::::staticValueGetter):
2786 (KJS::::staticFunctionGetter):
2787 (KJS::::callbackGetter):
2788 * API/JSClassRef.cpp:
2789 (OpaqueJSClass::prototype):
2790 * API/JSContextRef.cpp:
2791 (JSGlobalContextCreate):
2792 * API/JSObjectRef.cpp:
2794 (JSObjectGetPrivate):
2795 (JSObjectSetPrivate):
2796 * API/JSValueRef.cpp:
2797 (JSValueIsObjectOfClass):
2798 * JavaScriptCore.exp:
2799 * JavaScriptCore.xcodeproj/project.pbxproj:
2800 * bindings/c/c_utility.cpp:
2801 (KJS::Bindings::convertValueToNPVariant):
2802 * bindings/jni/jni_jsobject.cpp:
2803 * bindings/objc/objc_utility.mm:
2804 (KJS::Bindings::convertValueToObjcValue):
2806 (KJS::Context::Context):
2807 * kjs/ExecState.cpp:
2808 (KJS::ExecState::lexicalInterpreter):
2809 * kjs/JSGlobalObject.h: Added.
2810 (KJS::JSGlobalObject::JSGlobalObject):
2811 (KJS::JSGlobalObject::isGlobalObject):
2812 (KJS::JSGlobalObject::interpreter):
2813 (KJS::JSGlobalObject::setInterpreter):
2814 * kjs/array_instance.cpp:
2817 (KJS::FunctionImp::callAsFunction):
2818 (KJS::GlobalFuncImp::callAsFunction):
2819 * kjs/interpreter.cpp:
2820 (KJS::Interpreter::Interpreter):
2821 (KJS::Interpreter::init):
2822 (KJS::Interpreter::~Interpreter):
2823 (KJS::Interpreter::globalObject):
2824 (KJS::Interpreter::initGlobalObject):
2825 (KJS::Interpreter::evaluate):
2826 * kjs/interpreter.h:
2828 (KJS::cacheGlobalObject):
2830 (KJS::JSObject::isGlobalObject):
2833 2007-10-24 Eric Seidel <eric@webkit.org>
2835 Build fix for Gtk, no review.
2837 * kjs/collector.cpp: #include "context.h"
2839 2007-10-24 Eric Seidel <eric@webkit.org>
2843 Stop checking isOutOfMemory after every allocation, instead let the collector
2844 notify all ExecStates if we ever hit this rare condition.
2846 SunSpider claims this was a 2.2% speedup.
2848 * kjs/collector.cpp:
2849 (KJS::Collector::collect):
2850 (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2853 (KJS::TryNode::execute):
2855 2007-10-24 Mark Rowe <mrowe@apple.com>
2859 * kjs/identifier.h: Remove extra qualification.
2861 2007-10-24 Geoffrey Garen <ggaren@apple.com>
2863 Reviewed by Sam Weinig.
2865 Disable ALWAYS_INLINE in debug builds, since it drives the debugger
2868 * wtf/AlwaysInline.h:
2870 2007-10-24 Geoffrey Garen <ggaren@apple.com>
2872 Reviewed by Sam Weinig.
2874 Inlined the fast path for creating an Identifier from an Identifier.
2876 This is a .4% speedup on SunSpider overall, but as big as a 2.5%
2877 speedup on certain individual tests. 65% of the Identifiers creating
2878 by SunSpider are already Identifiers.
2880 (The main reason I'm making this change is that it resolves a large
2881 regression in a patch I haven't checked in yet.)
2883 * JavaScriptCore.exp:
2884 * kjs/identifier.cpp:
2885 (KJS::Identifier::addSlowCase):
2887 (KJS::Identifier::Identifier::add):
2889 2007-10-24 Lars Knoll <lars@trolltech.com>
2893 some changes to the way JS values are converted to Qt values in the script bindings. Added support for converting JS arrays into QStringList's.
2895 * bindings/qt/qt_instance.cpp:
2896 (KJS::Bindings::QtInstance::invokeMethod):
2897 * bindings/qt/qt_runtime.cpp:
2898 (KJS::Bindings::convertValueToQVariant):
2899 (KJS::Bindings::QtField::setValueToInstance):
2901 2007-10-24 Oliver Hunt <oliver@apple.com>
2905 Remove old relation method, replace with specialised LessThan and lessThenEq functions for a 0.5-0.6% improvement in SunSpider
2910 (KJS::LessNode::evaluate):
2911 (KJS::GreaterNode::evaluate):
2912 (KJS::LessEqNode::evaluate):
2913 (KJS::GreaterEqNode::evaluate):
2914 * kjs/operations.cpp:
2917 2007-10-24 Eric Seidel <eric@webkit.org>
2922 (KJS::ImmediateNumberNode::): Fix ASSERT correctness (and debug build!)
2924 2007-10-24 Darin Adler <darin@apple.com>
2928 * kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little
2929 Identifier ref/deref for what SunSpider claims is a 0.4% speedup.
2931 2007-10-24 Darin Adler <darin@apple.com>
2935 - separate out the code to create a hash table the first time from the code
2938 SunSpider claims this was a 0.7% speedup.
2940 * kjs/property_map.cpp:
2941 (KJS::PropertyMap::expand): Changed to call either createTable or rehash.
2942 (KJS::PropertyMap::createTable): Added. For the case where we had no table.
2943 (KJS::PropertyMap::rehash): Removed code needed only in the case where we
2945 * kjs/property_map.h: Added createTable.
2947 2007-10-24 Eric Seidel <eric@webkit.org>
2951 Add ImmediateNumberNode to hold a JSValue* instead of a double for numbers
2952 which can be represented by JSImmediate.
2954 SunSpider claims this was a 0.6% speedup.
2958 (KJS::NumberNode::evaluate):
2959 (KJS::ImmediateNumberNode::evaluate):
2962 (KJS::ImmediateNumberNode::):
2963 * kjs/nodes2string.cpp:
2964 (ImmediateNumberNode::streamTo):
2966 2007-10-24 Darin Adler <darin@apple.com>
2970 - http://bugs.webkit.org/show_bug.cgi?id=15657
2971 change static hash tables to use powers of two for speed
2973 Seems to give 0.7% SunSpider speedup.
2975 * kjs/create_hash_table: Updated to generate new format.
2977 (KJS::keysMatch): Took out unneeded typecast.
2978 (KJS::findEntry): Updated to expect table type 3 -- changed the printf to a plain old assert.
2979 Replaced the modulus with a bit mask.
2980 (KJS::Lookup::findEntry): Get the hash directly, since we know identifiers already have computed
2981 their hash -- saves a branch.
2982 (KJS::Lookup::find): Ditto.
2983 * kjs/lookup.h: Changed attr from 2-byte value to one-byte value. Replaced hashSize with hashSizeMask.
2985 2007-10-24 Maciej Stachowiak <mjs@apple.com>
2989 - remove KJS_CHECKEXCEPTIONs in places where exceptions can't happen for 0.6% SunSpider speedup
2992 (KJS::DoWhileNode::execute):
2993 (KJS::WhileNode::execute):
2994 (KJS::ForNode::execute):
2995 (KJS::ForInNode::execute):
2996 (KJS::SourceElementsNode::execute):
2998 2007-10-23 Darin Adler <darin@apple.com>
3002 * kjs/JSImmediate.h: (KJS::JSImmediate::getUInt32):
3003 Changed an && to an & for a 1% gain in SunSpider.
3005 2007-10-23 Oliver Hunt <oliver@apple.com>
3009 Reduce branching in implementations of some operator implementations, yielding 1.3% boost to SunSpider.
3012 (KJS::MultNode::evaluate):
3013 (KJS::DivNode::evaluate):
3014 (KJS::ModNode::evaluate):
3017 (KJS::AddNode::evaluate):
3018 (KJS::SubNode::evaluate):
3019 (KJS::valueForReadModifyAssignment):
3020 * kjs/operations.cpp:
3023 2007-10-23 Oliver Hunt <oliver@apple.com>
3027 Separating all of the simple (eg. non-read-modify-write) binary operators
3028 into separate classes in preparation for further JS optimisations.
3030 Happily this produces a 0.8% to 1.0% performance increase in SunSpider with
3033 * JavaScriptCore.xcodeproj/project.pbxproj:
3036 (KJS::MultNode::evaluate):
3037 (KJS::DivNode::evaluate):
3038 (KJS::ModNode::evaluate):
3039 (KJS::AddNode::evaluate):
3040 (KJS::SubNode::evaluate):
3041 (KJS::LeftShiftNode::evaluate):
3042 (KJS::RightShiftNode::evaluate):
3043 (KJS::UnsignedRightShiftNode::evaluate):
3044 (KJS::LessNode::evaluate):
3045 (KJS::GreaterNode::evaluate):
3046 (KJS::LessEqNode::evaluate):
3047 (KJS::GreaterEqNode::evaluate):
3048 (KJS::InstanceOfNode::evaluate):
3049 (KJS::InNode::evaluate):
3050 (KJS::EqualNode::evaluate):
3051 (KJS::NotEqualNode::evaluate):
3052 (KJS::StrictEqualNode::evaluate):
3053 (KJS::NotStrictEqualNode::evaluate):
3054 (KJS::BitAndNode::evaluate):
3055 (KJS::BitXOrNode::evaluate):
3056 (KJS::BitOrNode::evaluate):
3057 (KJS::LogicalAndNode::evaluate):
3058 (KJS::LogicalOrNode::evaluate):
3065 (KJS::LeftShiftNode::):
3066 (KJS::RightShiftNode::):
3067 (KJS::UnsignedRightShiftNode::):
3069 (KJS::GreaterNode::):
3070 (KJS::LessEqNode::):
3071 (KJS::GreaterEqNode::):
3072 (KJS::InstanceOfNode::):
3075 (KJS::NotEqualNode::):
3076 (KJS::StrictEqualNode::):
3077 (KJS::NotStrictEqualNode::):
3078 (KJS::BitAndNode::):
3080 (KJS::BitXOrNode::):
3081 (KJS::LogicalAndNode::):
3082 (KJS::LogicalOrNode::):
3083 * kjs/nodes2string.cpp:
3084 (MultNode::streamTo):
3085 (DivNode::streamTo):
3086 (ModNode::streamTo):
3087 (AddNode::streamTo):
3088 (SubNode::streamTo):
3089 (LeftShiftNode::streamTo):
3090 (RightShiftNode::streamTo):
3091 (UnsignedRightShiftNode::streamTo):
3092 (LessNode::streamTo):
3093 (GreaterNode::streamTo):
3094 (LessEqNode::streamTo):
3095 (GreaterEqNode::streamTo):
3096 (InstanceOfNode::streamTo):
3098 (EqualNode::streamTo):
3099 (NotEqualNode::streamTo):
3100 (StrictEqualNode::streamTo):
3101 (NotStrictEqualNode::streamTo):
3102 (BitAndNode::streamTo):
3103 (BitXOrNode::streamTo):
3104 (BitOrNode::streamTo):
3105 (LogicalAndNode::streamTo):
3107 2007-10-23 Darin Adler <darin@apple.com>
3111 - fix http://bugs.webkit.org/show_bug.cgi?id=15639
3112 fix Math.abs(0), Math.ceil(-0), and Math.floor(-0)
3114 Test: fast/js/math.html
3116 * kjs/math_object.cpp: (MathFuncImp::callAsFunction):
3117 Fix abs to look at the sign bit. Add a special case for values in the range
3118 between -0 and -1 and a special case for ceil and for -0 for floor.
3120 2007-10-23 Darin Adler <darin@apple.com>
3124 - streamline exception handling code for a >1% speed-up of SunSpider
3126 * kjs/nodes.cpp: Changed macros to use functions for everything that's not
3127 part of normal execution. We'll take function call overhead when propagating
3128 an exception or out of memory.
3129 (KJS::createOutOfMemoryCompletion): Added.
3130 (KJS::substitute): Use append instead of the relatively inefficient + operator.
3131 (KJS::Node::rethrowException): Added.
3132 * kjs/nodes.h: Added rethrowException.
3134 2007-10-22 Darin Adler <darin@apple.com>
3138 - fix http://bugs.webkit.org/show_bug.cgi?id=15636
3139 some JavaScriptCore regression tests are failing due to numeric conversion
3141 This should restore correctness and make speed better too, restoring some
3142 of the optimization we lost in my last check-in.
3144 * kjs/JSImmediate.h:
3145 (KJS::JSImmediate::getTruncatedInt32): Added. Uses the range checking idiom
3146 I used in my patch yesterday.
3147 (KJS::JSImmediate::getTruncatedUInt32): Ditto.
3149 * kjs/internal.h: Removed getInt32 and added getTruncatedInt/UInt32.
3151 (KJS::NumberImp::getUInt32): Changed to always use double, since I can't find
3152 a way to write this more efficiently for float.
3153 (KJS::NumberImp::getTruncatedInt32): Added.
3154 (KJS::NumberImp::getTruncatedUInt32): Added.
3156 * kjs/value.h: Removed getInt32 and added getTruncatedInt/UInt32.
3157 (KJS::JSValue::getUInt32):
3158 (KJS::JSValue::getTruncatedInt32): Added.
3159 (KJS::JSValue::getTruncatedUInt32): Added.
3160 (KJS::JSValue::toInt32): Changed getInt32 call to getTruncatedInt32.
3161 (KJS::JSValue::toUInt32): Changed getUInt32 call to getTruncatedUInt32.
3163 (KJS::JSCell::getTruncatedInt32): Added.
3164 (KJS::JSCell::getTruncatedUInt32): Added.
3165 (KJS::JSValue::toInteger): Changed getUInt32 call to getTruncatedInt32.
3166 (KJS::JSValue::toInt32SlowCase): Removed extra getInt32 call I accidentally
3168 (KJS::JSValue::toUInt32SlowCase): Ditto.
3169 (KJS::JSValue::toUInt16): Changed getUInt32 call to getTruncatedUInt32.
3171 * JavaScriptCore.exp: Updated.
3173 2007-10-22 Darin Adler <darin@apple.com>
3177 - fix http://bugs.webkit.org/show_bug.cgi?id=15632
3178 js1_5/Array/array-001.js test failing
3180 One of the JavaScriptCore tests was failing; it failed because of
3181 my change to NumberImp::getUInt32. The incorrect code I copied was
3182 from JSImmediate::getUInt32, and was a pre-existing bug.
3184 This patch fixes correctness, but will surely slow down SunSpider.
3185 We may be able to code this tighter and get the speed back.
3187 * kjs/JSImmediate.h:
3188 (KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
3189 reflect the fact that this function only returns true if the value is
3190 accurate (no fractional part, etc.). Changed code so that it returns
3191 false when the value has a fraction.
3192 (KJS::JSImmediate::getUInt32): Ditto.
3195 (KJS::NumberImp::getInt32): Changed code so that it returns false when
3196 the value has a fraction. Restores the old behavior.
3197 (KJS::NumberImp::getUInt32): Ditto.
3200 (KJS::JSValue::getInt32): Updated for name change.
3201 (KJS::JSValue::getUInt32): Ditto.
3202 (KJS::JSValue::toInt32): Ditto.
3203 (KJS::JSValue::toUInt32): Ditto.
3205 2007-10-22 Darin Adler <darin@apple.com>
3209 - fix crash seen when running JavaScriptCore tests
3211 * kjs/array_instance.cpp: (KJS::ArrayInstance::mark):
3212 Copy and paste error: I accidentally had code here that was
3213 making a copy of the HashMap -- that's illegal inside a mark
3214 function and was unnecessary. The other callsite was modifying
3215 the map as it iterated it, but this function is not.
3217 2007-10-22 Maciej Stachowiak <mjs@apple.com>
3221 - Avoid moving floats into integer registers in jsNumber() for 3% speedup on SunSpider
3222 http://bugs.webkit.org/show_bug.cgi?id=15627
3224 * kjs/JSImmediate.h:
3225 (KJS::JSImmediate::fromDouble): Avoid moving floats to integer
3226 registers since this is very slow.
3228 2007-10-22 Darin Adler <darin@apple.com>
3230 Reviewed by Eric Seidel.
3232 - http://bugs.webkit.org/show_bug.cgi?id=15617
3233 improve speed of integer conversions
3235 Makes SunSpider 6% faster.
3237 * kjs/JSImmediate.h: Added toInt32 and toUInt32, with separate versions for
3240 (KJS::JSValue::getUInt32): Call JSImmediate::toUInt32.
3242 * kjs/internal.h: Added getInt32.
3244 (KJS::NumberImp::getInt32): Added.
3245 (KJS::NumberImp::getUInt32): Replaced with more-optimal implementation
3246 stolen from JSValue.
3249 (KJS::jsNumber): Marked ALWAYS_INLINE, because this wasn't getting
3251 (KJS::JSValue::getInt32): Added.
3252 (KJS::JSValue::getUInt32): Changed to call the new JSImmediate::toUInt32
3253 to avoid converting from float to double.
3254 (KJS::JSValue::toInt32): Made inline, separated out the slow case.
3255 (KJS::JSValue::toUInt32): Ditto.
3257 (KJS::JSCell::getInt32): Added.
3258 (KJS::JSValue::toInt32SlowCase): Renamed from toInt32. Changed to use the
3259 new getInt32. Added a faster case for in-range numbers.
3260 (KJS::JSValue::toUInt32SlowCase): Ditto.
3261 (KJS::JSValue::toUInt16): Added a faster case for in-range numbers.
3263 * JavaScriptCore.exp: Updated for changes.
3265 2007-10-22 Adam Roben <aroben@apple.com>
3269 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn off
3270 warning about implicit conversion to bool.
3272 2007-10-22 Mark Rowe <mrowe@apple.com>
3276 * kjs/array_instance.cpp:
3278 2007-10-22 Darin Adler <darin@apple.com>
3282 - http://bugs.webkit.org/show_bug.cgi?id=15606
3283 make cut-off for sparse vs. dense arrays smarter for speed with large arrays
3285 Makes the morph test in SunSpider 26% faster, and the overall
3286 benchmark 3% faster.
3288 This also fixes some small problems we had with the distinction
3289 between nonexistent and undefined values in arrays.
3291 * kjs/array_instance.h: Tweaked formatting and naming.
3292 * kjs/array_instance.cpp: Copied from kjs/array_object.cpp.
3293 (KJS::storageSize): Added. Computes the size of the storage given a vector length.
3294 (KJS::increasedVectorLength): Added. Implements the rule for resizing the vector.
3295 (KJS::isDenseEnoughForVector): Added.
3296 (KJS::ArrayInstance::ArrayInstance): Initialize the new fields.
3297 (KJS::ArrayInstance::~ArrayInstance): Since m_storage is now never 0, delete it.
3298 (KJS::ArrayInstance::getItem): Updated for name changes.
3299 (KJS::ArrayInstance::lengthGetter): Ditto.
3300 (KJS::ArrayInstance::inlineGetOwnPropertySlot): Added. Allows both versions of
3301 getOwnPropertySlot to share more code.
3302 (KJS::ArrayInstance::getOwnPropertySlot): Just refactored, no code change.
3303 (KJS::ArrayInstance::put): Added logic for extending the vector as long as the
3304 array is dense enough. Also keep m_numValuesInVector up to date.
3305 (KJS::ArrayInstance::deleteProperty): Added code to keep m_numValuesInVector
3307 (KJS::ArrayInstance::getPropertyNames): Fixed bug where this would omit names
3308 for array indices with undefined values.
3309 (KJS::ArrayInstance::increaseVectorLength): Renamed from resizeStorage. Also
3310 simplified to only handle getting larger.
3311 (KJS::ArrayInstance::setLength): Added code to update m_numValuesInVector, to
3312 zero out the unused part of the vector and to delete the map if it's no longer
3314 (KJS::ArrayInstance::mark): Tweaked formatting.
3315 (KJS::compareByStringForQSort): Ditto.
3316 (KJS::ArrayInstance::sort): Ditto.
3317 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
3319 (KJS::compareWithCompareFunctionForQSort): Ditto.
3320 (KJS::ArrayInstance::compactForSorting): Fixed bug where this would turn
3321 undefined values into nonexistent values in some cases.
3323 * kjs/array_object.h: Removed MAX_ARRAY_INDEX.
3324 * kjs/array_object.cpp: Removed ArrayInstance. Moved to a separate file.
3326 * JavaScriptCore.pri: Added array_instance.cpp.
3327 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3328 * kjs/AllInOneFile.cpp: Ditto.
3330 2007-10-22 Andrew Wellington <proton@wiretapped.net>
3332 Reviewed by Mark Rowe.
3334 Fix for local database support after r26879
3335 Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set
3337 * Configurations/JavaScriptCore.xcconfig:
3339 2007-10-22 Simon Hausmann <hausmann@kde.org>
3343 Build fix for the non-qmake builds.
3345 * wtf/Platform.h: Default to enabling the database features unless
3346 otherwise specified. (similar to ENABLE_ICONDATABASE)
3348 2007-10-22 Holger Freyther <zecke@selfish.org>
3350 Reviewed by Simon Hausmann <hausmann@kde.org>.
3352 * Do not build testkjs as an application bundle. This is
3353 needed for run-javascriptcore-tests on OSX.
3354 * Also, based on r26633, allow to test the WebKit/Qt port on OSX.
3355 * Set DYLD_LIBRARY_PATH if it was set in the environment. It must be set
3356 as we do not have -rpath on OSX.
3360 2007-10-21 Mark Rowe <mrowe@apple.com>
3364 http://bugs.webkit.org/show_bug.cgi?id=15575
3365 Bug 15575: [GTK] Implement threading using GThread
3367 * wtf/Platform.h: Do not enable pthreads for Gtk.
3369 2007-10-21 Mark Rowe <mrowe@apple.com>
3373 Fix http://bugs.webkit.org/show_bug.cgi?id=15603
3374 Bug 15603: Regression(r26847): Crash when sorting an empty array from JavaScript
3376 * kjs/array_object.cpp:
3377 (KJS::freeStorage): Reinstate null-check that was removed in r26847.
3379 2007-10-21 Darin Adler <darin@apple.com>
3383 * kjs/array_instance.h: Removed unused ExecState parameter.
3384 * kjs/array_object.cpp:
3385 (KJS::ArrayInstance::put): Ditto.
3386 (KJS::ArrayInstance::setLength): Ditto.
3388 2007-10-21 Darin Adler <darin@apple.com>
3390 * kjs/array_object.cpp: (KJS::ArrayInstance::put):
3391 Add missing assignment that was causing regression test crash.
3393 2007-10-21 Darin Adler <darin@apple.com>
3397 - http://bugs.webkit.org/show_bug.cgi?id=15585
3398 speed up sparse arrays by using a custom map
3400 Speeds up SunSpider by 10%.
3402 * kjs/array_object.cpp:
3403 (allocateStorage): Leave room for an additional pointer.
3404 (reallocateStorage): Ditto.
3405 (freeStorage): Ditto.
3406 (ArrayInstance::~ArrayInstance): Delete the overflow map if present.
3407 (ArrayInstance::getItem): Read values from the overflow map if present.
3408 Removed the check of length, since it slows down the common case.
3409 (ArrayInstance::getOwnPropertySlot): Ditto. Also removed the fallback
3410 to the property map.
3411 (ArrayInstance::put): Write values into the overflow map as needed.
3412 Also create overflow map when needed.
3413 (ArrayInstance::deleteProperty): Remove values from the overflow map
3415 (ArrayInstance::getPropertyNames): Add a name for each identifier in
3416 the property map. This is extremely inefficient.
3417 (ArrayInstance::setLength): Remove any values in the overflow map
3418 that are past the new length, as we formerly did with the property map.
3419 (ArrayInstance::mark): Mark any values in the overflow map.
3420 (compareByStringForQSort): Removed unneeded undefined case, since
3421 compactForSorting guarantees we will have no undefined values.
3422 (compareWithCompareFunctionForQSort): Ditto.
3423 (ArrayInstance::compactForSorting): Copy all the values out of the
3424 overflow map and destroy it.
3426 * kjs/property_map.h: Removed now-unused getSparseArrayPropertyNames.
3427 * kjs/property_map.cpp: Ditto.
3429 2007-10-20 Darin Adler <darin@apple.com>
3433 - http://bugs.webkit.org/show_bug.cgi?id=15579
3434 stop churning identifier reference counts copying Completion objects
3436 * kjs/completion.h: Replace the Identifier with an Identifier*.
3438 (ForInNode::execute): Update for change to Completion constructor.
3439 (ContinueNode::execute): Ditto.
3440 (BreakNode::execute): Ditto.
3442 2007-10-20 Mark Rowe <mrowe@apple.com>
3446 Gtk changes needed to enable HTML 5 client-side database storage.
3448 * wtf/Platform.h: Have Gtk use pthreads for now.
3450 2007-10-20 Geoffrey Garen <ggaren@apple.com>
3452 Reviewed by Maciej Stachowiak.
3454 Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
3455 Store gathered declaration nodes in the function body node.
3457 This means that you only have to gather the declaration nodes the first
3458 time the function executes. Performance gain of 2.10% on SunSpider,
3459 0.90% on command-line JS iBench.
3461 * kjs/nodes.cpp: Split declaration stack initialization code off into
3462 initializeDeclarationStacks().
3463 (FunctionBodyNode::FunctionBodyNode):
3464 (FunctionBodyNode::initializeDeclarationStacks):
3465 (FunctionBodyNode::processDeclarations):
3467 * kjs/nodes.h: Changed DeclarationStacks structure to hold references,
3468 since the actual Vectors are now stored either on the stack or in the
3471 2007-10-19 Geoffrey Garen <ggaren@apple.com>
3473 Reviewed by Darin Adler.
3475 http://bugs.webkit.org/show_bug.cgi?id=15559
3476 Moved processDeclarations call into FunctionBodyNode::execute
3478 To improve encapsulation, moved processDeclarations call into
3479 FunctionBodyNode::execute. Also marked processDeclarations
3480 ALWAYS_INLINE, since it has only 1 caller now. This is a .71% speedup
3481 on command-line JS iBench.
3484 (KJS::FunctionImp::callAsFunction):
3485 (KJS::GlobalFuncImp::callAsFunction):
3487 * kjs/interpreter.cpp:
3488 (KJS::Interpreter::evaluate):
3490 (FunctionBodyNode::execute):
3493 2007-10-19 Brady Eidson <beidson@apple.com>
3497 Queue -> Deque! and small style tweaks
3499 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3500 * JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
3501 * wtf/Deque.h: Added.
3502 (WTF::DequeNode::DequeNode):
3503 (WTF::Deque::Deque):
3504 (WTF::Deque::~Deque):
3506 (WTF::Deque::isEmpty):
3507 (WTF::Deque::append):
3508 (WTF::Deque::prepend):
3509 (WTF::Deque::first):
3511 (WTF::Deque::removeFirst):
3512 (WTF::Deque::clear):
3513 * wtf/Queue.h: Removed.
3516 2007-10-19 Brady Eidson <beidson@apple.com>
3520 Added a simple LinkedList based Queue to wtf
3521 We can make a better, more sophisticated an efficient one later, but have
3522 needed one for some time, now!
3524 * JavaScriptCore.xcodeproj/project.pbxproj:
3525 * wtf/Queue.h: Added.
3526 (WTF::QueueNode::QueueNode):
3527 (WTF::Queue::Queue):
3528 (WTF::Queue::~Queue):
3530 (WTF::Queue::isEmpty):
3531 (WTF::Queue::append):
3532 (WTF::Queue::prepend):
3533 (WTF::Queue::first):
3535 (WTF::Queue::removeFirst):
3536 (WTF::Queue::clear):
3538 2007-10-19 Nikolas Zimmermann <zimmermann@kde.org>
3542 Try to fix Qt/Win build slave, by including windows.h also on Qt/Win.
3544 * kjs/testkjs.cpp: Change PLATFORM(WIN) to PLATFORM(WIN_OS)
3546 2007-10-19 Simon Hausmann <hausmann@kde.org>