1 2007-11-05 Adam Roben <aroben@apple.com>
7 2007-11-05 Mark Rowe <mrowe@apple.com>
9 Build fix. Add missing #include.
13 2007-11-05 Eric Seidel <eric@webkit.org>
17 Remove another call to toString(exec)
19 SunSpider claims this is a 0.5% speedup.
22 (KJS::equal): remove another toString
24 2007-11-05 Eric Seidel <eric@webkit.org>
27 (KJS::equal): correct broken change.
29 2007-11-05 Eric Seidel <eric@webkit.org>
33 Remove one more call to toString(exec).
35 SunSpider claims this is a 0.7% speedup.
38 (KJS::equal): remove a call to toString()
40 2007-11-05 Mark Rowe <mrowe@apple.com>
46 2007-11-05 Mark Rowe <mrowe@apple.com>
52 2007-11-05 Geoffrey Garen <ggaren@apple.com>
54 Touched a file to test my new HTTP access.
56 * kjs/scope_chain.cpp:
58 2007-11-05 Alp Toker <alp@atoker.com>
60 Unreviewed build fix for qmake-based ports.
62 Someone with a better understanding of qmake still needs to sort out
63 the INCLUDEPATH/DEPENDPATH mess.
67 2007-11-05 Geoffrey Garen <ggaren@apple.com>
69 Reviewed by Darin Adler.
71 http://bugs.webkit.org/show_bug.cgi?id=15835
73 Switched List implementation from a custom heap allocator to an inline
74 Vector, for a disappointing .5% SunSpider speedup.
76 Also renamed List::slice to List::getSlice because "get" is the
77 conventional prefix for functions returning a value through an out
80 * kjs/array_object.cpp:
81 (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
82 calls and memory accesses.
84 * kjs/bool_object.cpp:
85 (BooleanObjectImp::construct): Removed questionable use of iterator.
88 * kjs/list.h: New List class, implemented in terms of Vector. Two
89 interesting differences:
90 1. The inline capacity is 8, not 5. Many of the Lists constructed
91 during a SunSpider run are larger than 5; almost none are larger
94 2. The growth factor is 4, not 2. Since we can guarantee that Lists
95 aren't long-lived, we can grow them more aggressively, to avoid
98 * kjs/regexp_object.cpp:
99 (RegExpObjectImp::construct): Removed redundant function calls.
101 * kjs/string_object.cpp:
102 (KJS::StringObjectImp::construct): Removed questionable use of iterator.
105 (WTF::::uncheckedAppend): Added a fast, unchecked version of append.
107 2007-11-05 Mark Rowe <mrowe@apple.com>
109 Reviewed by Alp Toker.
111 Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.
113 * JavaScriptCore.pri:
116 2007-11-04 Darin Adler <darin@apple.com>
120 - http://bugs.webkit.org/show_bug.cgi?id=15826
121 optimize opcode loop and case insensitive ASCII compares for a 30% speedup
123 SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
125 * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
127 * pcre/pcre_compile.c:
128 (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
129 added OP_NOT since there was no reason it should not be in here.
130 (could_be_empty_branch): Ditto.
131 (compile_branch): Streamlined all the single-character cases; there was a bit of
132 duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
133 But in particular, compile to those opcodes when the single character match is
135 (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
137 * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
138 the matchframe, after I discovered that none of them needed to be saved and restored
139 across recursive match calls. Also eliminated the ignored result field from the
140 matchframe, since I discovered that rrc ("recursive result code") was already the
141 exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
142 statement of the switch instead of doing them before the switch. This removes a
143 branch from each iteration of the opcode interpreter, just as removal of "op"
144 removed at least one store from each iteration. Last, but not least, add the
145 OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
146 surrogate pair and the letter case can be handled efficiently.
148 2007-11-04 Darin Adler <darin@apple.com>
150 * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.
152 2007-11-03 Darin Adler <darin@apple.com>
154 - fix non-Mac builds; remove some more unused PCRE stuff
156 * pcre/pcre_compile.c:
157 (compile_branch): Removed branch chain and some unused ESC values.
158 (compile_regex): Ditto.
159 (jsRegExpCompile): Ditto.
161 (match): Removed unused branch targets. Don't use macros any more.
162 (jsRegExpExecute): More of the same.
164 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
165 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
166 * pcre/pcre.pri: Ditto.
168 * pcre/MERGING: Removed.
169 * pcre/pcre_fullinfo.c: Removed.
170 * pcre/pcre_get.c: Removed.
171 * pcre/pcre_internal.h:
172 * pcre/ucp.h: Removed.
174 2007-11-03 Darin Adler <darin@apple.com>
178 - http://bugs.webkit.org/show_bug.cgi?id=15821
179 remove unused PCRE features for speed
181 A first step toward removing the PCRE features we don't use.
182 This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
183 the SunSpider regular expression test.
185 Replaced the public interface with one that doesn't use the
186 name PCRE. Removed code we don't need for JavaScript and various
187 configurations we don't use. This is in preparation for still
188 more changes in the future. We'll probably switch to C++ and
189 make some even more significant changes to the regexp engine
190 to get some additional speed.
192 There's probably additional unused stuff that I haven't
195 This does mean that our PCRE is now a fork, but I think that's
196 not really a big deal.
198 * JavaScriptCore.exp: Remove the 5 old entry points and add
199 the 3 new entry points for WebCore's direct use of the regular
202 * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
203 its sense and now there's a USE(POSIX_REGEX) instead, which should
204 probably not be set by anyone. Maybe later we'll just get rid of it
209 (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
210 defines. Cut down on the number of functions used.
211 (KJS::RegExp::~RegExp): Ditto.
212 (KJS::RegExp::match): Ditto.
214 * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
217 * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
218 size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
219 POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
220 and JAVASCRIPT. These are all no longer configurable in our copy
223 * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
224 version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
225 the include of <stdlib.h>, and most of the constants and
226 functions defined in this header. Changed the naming scheme to
227 use a JSRegExp prefix rather than a pcre prefix. In the future,
228 we'll probably change this to be a C++ header.
230 * pcre/pcre_compile.c: Removed all unused code branches,
231 including many whole functions and various byte codes.
232 Kept changes outside of removal to a minimum.
234 (first_significant_code):
237 (could_be_empty_branch):
242 (find_firstassertedchar):
243 (jsRegExpCompile): Renamed from pcre_compile2 and changed the
244 parameters around a bit.
245 (jsRegExpFree): Added.
247 * pcre/pcre_exec.c: Removed many unused opcodes and variables.
248 Also started tearing down the NO_RECURSE mechanism since it's
249 now the default. In some cases there were things in the explicit
250 frame that could be turned into plain old local variables and
251 other small like optimizations.
254 (match): Changed parameters quite a bit since it's now not used
256 (jsRegExpExecute): Renamed from pcre_exec.
258 * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
259 PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
260 PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
261 PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
262 _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
263 and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
265 * pcre/pcre_maketables.c: Changed to only compile in dftables.
266 Also got rid of many of the tables that we don't use.
268 * pcre/pcre_tables.c: Removed the unused Unicode property tables.
270 * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
273 * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
274 for classes based on Unicode properties.
276 * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
277 to eliminate this completely, but we need the regular expression
278 code to be C++ first.
280 * pcre/pcre_fullinfo.c:
283 Files that are no longer needed. I didn't remove them with this
284 check-in, because I didn't want to modify all the project files.
286 2007-11-03 Maciej Stachowiak <mjs@apple.com>
290 - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
292 It turns out that doing this check costs more than it saves.
295 (KJS::JSImmediate::fromDouble):
297 2007-11-03 Sam Weinig <sam@webkit.org>
301 Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
302 The variable had been kept around for binary compatibility, but since nothing
303 else is there is no point in continuing to keep it around.
305 * API/JSCallbackConstructor.cpp:
307 * API/JSCallbackFunction.cpp:
309 * API/JSCallbackObject.cpp:
311 * bindings/objc/objc_runtime.mm:
312 * bindings/runtime_array.cpp:
313 * bindings/runtime_object.cpp:
314 * kjs/array_instance.cpp:
316 * kjs/array_object.cpp:
318 * kjs/bool_object.cpp:
319 * kjs/date_object.cpp:
321 * kjs/error_object.cpp:
327 * kjs/math_object.cpp:
328 * kjs/number_object.cpp:
330 * kjs/regexp_object.cpp:
331 * kjs/string_object.cpp:
334 2007-11-03 Kevin McCullough <kmccullough@apple.com>
336 - Updated testkjs results to make the build bots green until we
337 can fix the tests that are failing. The new failures are in DST.
339 * tests/mozilla/expected.html:
341 2007-11-03 Maciej Stachowiak <mjs@apple.com>
345 - don't print the var twice for ForInNodes with a var declaration
347 * kjs/nodes2string.cpp:
348 (KJS::ForInNode::streamTo):
350 2007-11-03 Darin Adler <darin@apple.com>
352 * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
353 C-incompatible declaration.
355 2007-11-03 Mark Rowe <mrowe@apple.com>
359 * kjs/nodes.cpp: Add missing include.
361 2007-11-03 Darin Adler <darin@apple.com>
365 - fix http://bugs.webkit.org/show_bug.cgi?id=15814
366 <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
368 These changes cause us to match the JavaScript specification and pass the
369 fast/js/kde/encode_decode_uri.html test.
371 * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
372 new strict mode, throwing an exception if there are malformed UTF-16 surrogate
375 * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
377 (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
378 those might be illegal in some sense, they aren't supposed to get any special
379 handling in the place where this function is currently used.
380 (KJS::UString::UTF8String): Added the strictness.
382 2007-11-03 Darin Adler <darin@apple.com>
386 - http://bugs.webkit.org/show_bug.cgi?id=15812
387 some JavaScript tests (from the Mozilla test suite) are failing
389 Two or three fixes get 7 more of the Mozilla tests passing.
390 This gets us down from 61 failing tests to 54.
392 * kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
393 Made this inline and gave it a more specific type. Some day we should
394 probably do that for all of these -- might even get a bit of a speed
396 * kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
397 inline in the header.
399 * kjs/regexp_object.h:
400 * kjs/regexp_object.cpp:
401 (KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
402 switch statement into the RegExpImp object, so they can be shared with
403 RegExpImp::callAsFunction.
404 (KJS::RegExpImp::match): Added. Common code used by both test and exec.
405 (KJS::RegExpImp::test): Added.
406 (KJS::RegExpImp::exec): Added.
407 (KJS::RegExpImp::implementsCall): Added.
408 (KJS::RegExpImp::callAsFunction): Added.
409 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
410 lastInput to null rather than empty string -- we take advantage of the
411 difference in RegExpImp::match.
412 (KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
413 just to get at a field like this.
415 * pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
416 the JavaScript specification. If there are not 4 hex digits after the \u,
417 then it's processed as if it wasn't an escape sequence at all.
419 * pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
420 for JavaScript (4 specific Unicode values).
422 (match): Changed all call sites to use IS_NEWLINE.
425 * tests/mozilla/expected.html: Updated to expect 7 more successful tests.
427 2007-11-03 David D. Kilzer <ddkilzer@webkit.org>
429 Sort files(...); sections of Xcode project files.
431 Rubber-stamped by Darin.
433 * JavaScriptCore.xcodeproj/project.pbxproj:
435 2007-11-03 Maciej Stachowiak <mjs@apple.com>
439 - remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup
443 (KJS::VarDeclNode::optimizeVariableAccess):
444 (KJS::VarDeclNode::getDeclarations):
445 (KJS::VarDeclNode::handleSlowCase):
446 (KJS::VarDeclNode::evaluateSingle):
447 (KJS::VarDeclNode::evaluate):
448 (KJS::VarStatementNode::execute):
450 (KJS::VarDeclNode::):
451 (KJS::VarStatementNode::):
452 * kjs/nodes2string.cpp:
453 (KJS::VarDeclNode::streamTo):
455 2007-11-03 Alexey Proskuryakov <ap@webkit.org>
459 http://bugs.webkit.org/show_bug.cgi?id=15800
460 REGRESSION (r27303): RegExp leaks
462 * kjs/regexp_object.h:
463 (KJS::RegExpImp::setRegExp):
464 (KJS::RegExpImp::regExp):
465 (KJS::RegExpImp::classInfo):
466 * kjs/regexp_object.cpp:
467 (RegExpImp::RegExpImp):
468 (RegExpImp::~RegExpImp):
469 Renamed reg member variable to m_regExp, changed it to use OwnPtr.
471 2007-11-02 Maciej Stachowiak <mjs@apple.com>
475 - add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.
479 (KJS::statementListPushFIFO):
480 (KJS::statementListGetDeclarations):
481 (KJS::statementListInitializeDeclarationStacks):
482 (KJS::statementListInitializeVariableAccessStack):
483 (KJS::statementListExecute):
484 (KJS::BlockNode::BlockNode):
485 (KJS::FunctionBodyNode::FunctionBodyNode):
486 (KJS::ProgramNode::ProgramNode):
488 (KJS::CaseClauseNode::):
490 2007-11-02 Darin Adler <darin@apple.com>
494 - http://bugs.webkit.org/show_bug.cgi?id=15791
495 change property map data structure for less memory use, better speed
497 The property map now has an array of indices and a separate array of
498 property map entries. This slightly slows down lookup because of a second
499 memory acess, but makes property maps smaller and faster to iterate in
500 functions like mark().
502 SunSpider says this is 1.2% faster, although it makes the bitwise-end test
503 more than 10% slower. To fix that we'll need to optimize global variable lookup.
505 * kjs/property_map.cpp:
506 (KJS::PropertyMapEntry::PropertyMapEntry):
507 (KJS::PropertyMapHashTable::entries):
508 (KJS::PropertyMapHashTable::allocationSize):
509 (KJS::SavedProperties::SavedProperties):
510 (KJS::SavedProperties::~SavedProperties):
511 (KJS::PropertyMap::checkConsistency):
512 (KJS::PropertyMap::~PropertyMap):
513 (KJS::PropertyMap::clear):
514 (KJS::PropertyMap::get):
515 (KJS::PropertyMap::getLocation):
516 (KJS::PropertyMap::put):
517 (KJS::PropertyMap::insert):
518 (KJS::PropertyMap::createTable):
519 (KJS::PropertyMap::rehash):
520 (KJS::PropertyMap::remove):
521 (KJS::PropertyMap::mark):
522 (KJS::comparePropertyMapEntryIndices):
523 (KJS::PropertyMap::containsGettersOrSetters):
524 (KJS::PropertyMap::getEnumerablePropertyNames):
525 (KJS::PropertyMap::save):
526 (KJS::PropertyMap::restore):
527 * kjs/property_map.h:
529 2007-11-02 Darin Adler <darin@apple.com>
533 - http://bugs.webkit.org/show_bug.cgi?id=15807
534 HashMap needs a take() function that combines get and remove
536 * wtf/HashMap.h: Added take function. Simplistic implementation for now,
537 but still does only one hash table lookup.
539 * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
540 a find followed by a remove.
542 2007-11-02 David Carson <dacarson@gmail.com>
546 Fix compiler warning "warning: suggest parentheses around && within ||"
547 http://bugs.webkit.org/show_bug.cgi?id=15764
549 * kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.
551 2007-11-01 Geoffrey Garen <ggaren@apple.com>
553 Reviewed by Maciej Stachowiak.
555 In preparation for making List a simple stack-allocated Vector:
557 Removed all instances of List copying and/or assignment, and made List
558 inherit from Noncopyable.
560 Functions that used to return a List by copy now take List& out
563 Layout tests and JS tests pass.
566 (KJS::List::slice): Replaced copyTail with a more generic slice
567 alternative. (JavaScriptCore only calls slice(1), but WebCore calls
570 2007-11-01 Geoffrey Garen <ggaren@apple.com>
572 Reviewed by Maciej Stachowiak.
574 Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
575 REGRESSION(r27344): Crash on load at finance.yahoo.com
577 Reverted a small portion of my last check-in. (The speedup and the List
578 removal are still there, though.)
580 ActivationImp needs to hold a pointer to its function, and mark that
581 pointer (rather than accessing its function through its ExecState, and
582 counting on the active scope to mark its function) because a closure
583 can cause an ActivationImp to outlive its ExecState along with any
587 (KJS::ExecState::ExecState):
589 (KJS::FunctionImp::~FunctionImp):
590 (KJS::ActivationImp::ActivationImp):
592 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
594 Also made HashTable a little more crash-happy in debug builds, so
595 problems like this will show up earlier:
598 (WTF::HashTable::~HashTable):
600 2007-11-01 Geoffrey Garen <ggaren@apple.com>
602 Reviewed by Adam Roben.
604 Addressed some of Darin's review comments.
606 Used perl -p, which is the shorthand while(<>) {}.
608 Made sure not to suppress bison's output.
610 Added line to removed bison_out.txt, since this script removes other
611 intermediate files, too.
613 * DerivedSources.make:
615 2007-11-01 Geoffrey Garen <ggaren@apple.com>
617 Reviewed by Oliver Hunt.
619 Removed List from ActivationImp, in preparation for making all lists
624 1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.
627 (KJS::ExecState::ExecState):
628 (KJS::ExecState::~ExecState):
630 (KJS::ActivationImp::ActivationImp):
631 (KJS::ActivationImp::createArgumentsObject):
633 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
635 2007-11-01 Adam Roben <aroben@apple.com>
637 Use jsNumberCell instead of jsNumber when converting double constants to JSValues
639 This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
640 ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.
642 It also gets rid of an MSVC warning that we previously had to silence.
646 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
647 back on the "overflow in constant arithmetic" warning.
648 * kjs/number_object.cpp:
649 (NumberObjectImp::getValueProperty): Use jsNumberCell instead of
652 2007-10-31 Adam Roben <aroben@apple.com>
658 2007-10-31 Maciej Stachowiak <mjs@apple.com>
662 - shave some cycles off of local storage access for a 1% SunSpider speedup
664 Keep the LocalStorage pointer in the ExecState, instead of getting
665 it from the ActivationImp all the time.
668 (KJS::ExecState::updateLocalStorage):
670 (KJS::ExecState::localStorage):
672 (KJS::LocalVarAccessNode::evaluate):
673 (KJS::LocalVarFunctionCallNode::evaluate):
674 (KJS::PostIncLocalVarNode::evaluate):
675 (KJS::PostDecLocalVarNode::evaluate):
676 (KJS::LocalVarTypeOfNode::evaluate):
677 (KJS::PreIncLocalVarNode::evaluate):
678 (KJS::PreDecLocalVarNode::evaluate):
679 (KJS::ReadModifyLocalVarNode::evaluate):
680 (KJS::AssignLocalVarNode::evaluate):
681 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
683 2007-10-31 Adam Roben <aroben@apple.com>
685 Fix a crash on launch due to a static initializer race
687 We now use fast inline assembler spinlocks which can be statically
688 initialized at compile time.
690 As a side benefit, this speeds up SunSpider by 0.4%.
694 * wtf/FastMalloc.cpp:
696 (TCMalloc_SpinLock::Lock):
697 (TCMalloc_SpinLock::Unlock):
699 * wtf/TCSystemAlloc.cpp:
701 2007-10-31 Kevin McCullough <kmccullough@apple.com>
705 - Corrected spelling.
709 2007-10-31 Mark Rowe <mrowe@apple.com>
711 Further Gtk build fixage.
713 * kjs/regexp_object.cpp:
715 2007-10-31 Mark Rowe <mrowe@apple.com>
721 2007-10-31 Darin Adler <darin@apple.com>
725 - fix http://bugs.webkit.org/show_bug.cgi?id=15749
726 RegExp/RegExpObjectImp cause needless UString creation
728 Speeds things up 0.4% according to SunSpider.
730 * kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
731 because this library doesn't use the real PCRE -- it uses its
732 own PCRE that works on UTF-16.
734 * kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
735 Use Noncopyable. Change the return value of match.
737 (KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
738 (KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
739 (KJS::RegExp::match): Change to return the position as an int and the
740 ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.
742 * kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
743 require a result string.
744 * kjs/regexp_object.cpp:
745 (RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
746 (RegExpObjectImp::performMatch): Change so it doesn't return a string.
747 (RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
748 the main result with the backreferences; now it doesn't need to take
750 (RegExpObjectImp::getBackref): Minor tweaks.
751 (RegExpObjectImp::getLastParen): Ditto.
752 (RegExpObjectImp::getLeftContext): Ditto.
753 (RegExpObjectImp::getRightContext): Ditto.
754 (RegExpObjectImp::getValueProperty): Change LastMatch case to call
755 getBackref(0) so we don't need a separate getLastMatch function.
757 * kjs/string_object.cpp:
758 (KJS::replace): Update to use new performMatch, including merging the
759 matched string section with the other substrings.
760 (KJS::StringProtoFunc::callAsFunction): Update functions to use the
761 new performMatch and match. Also change to use OwnArrayPtr.
763 2007-10-31 Oliver Hunt <oliver@apple.com>
765 * kjs/nodes.h: include OwnPtr.h
767 2007-10-31 Oliver Hunt <oliver@apple.com>
771 Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider
775 (KJS::statementListPushFIFO):
776 (KJS::statementListGetDeclarations):
777 (KJS::statementListInitializeDeclarationStacks):
778 (KJS::statementListInitializeVariableAccessStack):
779 (KJS::statementListExecute):
780 (KJS::BlockNode::optimizeVariableAccess):
781 (KJS::BlockNode::BlockNode):
782 (KJS::BlockNode::getDeclarations):
783 (KJS::BlockNode::execute):
784 (KJS::CaseClauseNode::optimizeVariableAccess):
785 (KJS::CaseClauseNode::getDeclarations):
786 (KJS::CaseClauseNode::evalStatements):
787 (KJS::FunctionBodyNode::initializeDeclarationStacks):
788 (KJS::FunctionBodyNode::optimizeVariableAccess):
790 * kjs/nodes2string.cpp:
791 (KJS::statementListStreamTo):
792 (KJS::BlockNode::streamTo):
793 (KJS::CaseClauseNode::streamTo):
795 2007-10-30 Mark Rowe <mrowe@apple.com>
797 * kjs/property_map.cpp: Added a missing using directive to fix the build
798 for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
800 2007-10-31 Maciej Stachowiak <mjs@apple.com>
802 * kjs/property_map.cpp: Include HashTable.h the right way to fix the build
805 2007-10-31 Alexey Proskuryakov <ap@webkit.org>
809 http://bugs.webkit.org/show_bug.cgi?id=11001
810 WebKit doesn't support RegExp.compile method
812 Test: fast/js/regexp-compile.html
814 * kjs/regexp_object.cpp:
815 (RegExpPrototype::RegExpPrototype):
816 (RegExpProtoFunc::callAsFunction):
817 * kjs/regexp_object.h:
818 (KJS::RegExpProtoFunc::):
819 Added RegExp.compile.
821 * tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.
823 2007-10-31 Maciej Stachowiak <mjs@apple.com>
827 - get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
829 Integer divide sucks. Fortunately, a bunch of shifts and XORs
830 biased towards the high bits is sufficient to provide a good
831 double hash. Besides the SunSpider win, I used the dump statistics
832 mode for both to verify that collisions did not increase and that
833 the longest collision chain is not any longer.
835 * kjs/property_map.cpp:
837 (KJS::PropertyMap::get):
838 (KJS::PropertyMap::getLocation):
839 (KJS::PropertyMap::put):
840 (KJS::PropertyMap::insert):
841 (KJS::PropertyMap::remove):
842 (KJS::PropertyMap::checkConsistency):
846 (WTF::::lookupForWriting):
847 (WTF::::fullLookupForWriting):
850 2007-10-30 Adam Roben <aroben@apple.com>
852 * kjs/collector.h: Make HeapType public so it can be used for non-member
853 things like the HeapConstants struct template. Fixes the build on Windows.
855 2007-10-30 Adam Roben <aroben@apple.com>
857 Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows
859 Speeds up SunSpider by 0.4%.
861 Reviewed by Steve and Maciej.
863 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
864 a warning during LTCG in release builds about double -> float
866 * wtf/AlwaysInline.h:
869 2007-10-30 Adam Roben <aroben@apple.com>
871 Use GetCurrentThreadId instead of pthread_self in FastMalloc
873 Speeds up SunSpider by 0.3%.
877 * wtf/FastMalloc.cpp:
878 (WTF::TCMalloc_ThreadCache::InitTSD):
879 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
881 2007-10-30 Adam Roben <aroben@apple.com>
883 Switch to a Win32 critical section implementation of spinlocks
885 Speeds up SunSpider by 0.4%.
889 * wtf/FastMalloc.cpp:
891 (TCMalloc_SpinLock::TCMalloc_SpinLock):
892 (TCMalloc_SpinLock::Init):
893 (TCMalloc_SpinLock::Finalize):
894 (TCMalloc_SpinLock::Lock):
895 (TCMalloc_SpinLock::Unlock):
896 * wtf/TCSystemAlloc.cpp:
898 2007-10-30 Adam Roben <aroben@apple.com>
900 Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta
902 http://bugs.webkit.org/show_bug.cgi?id=15586
904 Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll
906 Use Win32 TLS functions instead of __declspec(thread), which breaks
911 * wtf/FastMalloc.cpp:
912 (WTF::getThreadHeap):
913 (WTF::TCMalloc_ThreadCache::InitModule):
915 2007-10-30 Maciej Stachowiak <mjs@apple.com>
919 - allocate numbers in half-size cells, for an 0.5% SunSpider speedup
920 http://bugs.webkit.org/show_bug.cgi?id=15772
922 We do this by using a single mark bit per two number cells, and
925 Besides being an 0.5% win overall, this is a 7.1% win on morph.
929 (KJS::Collector::heapAllocate):
930 (KJS::Collector::markStackObjectsConservatively):
931 (KJS::Collector::sweep):
933 (KJS::SmallCollectorCell::):
935 2007-10-30 Geoffrey Garen <ggaren@apple.com>
937 Reviewed by Adam Roben, Sam Weinig.
939 Made conflicts in grammar.y a persistent build failure.
941 * DerivedSources.make:
943 2007-10-30 Kevin McCullough <kmccullough@apple.com>
945 Reviewed by Adam and Geoff.
947 - Added a new cast so all the casts are in the same place.
952 2007-10-30 Geoffrey Garen <ggaren@apple.com>
954 Reviewed by Darin Adler.
956 Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
960 ecma_2/Statements/dowhile-001.js
961 ecma_2/Statements/dowhile-002.js
962 ecma_2/Statements/dowhile-003.js
963 ecma_2/Statements/dowhile-004.js
964 ecma_2/Statements/dowhile-005.js
965 ecma_2/Statements/dowhile-006.js
966 ecma_2/Statements/dowhile-007.js
967 js1_2/statements/do_while.js
969 and layout tests, including
971 do-while-expression-value.html
972 do-while-semicolon.html
973 do-while-without-semicolon.html
977 * kjs/grammar.y: Use the explicit "error" production, as we do with other
978 automatic semicolon insertions, to disambiguate "do { } while();" from
979 "do { } while()" followed by ";" (the empty statement).
981 2007-10-29 Oliver Hunt <oliver@apple.com>
985 Debranching remaining assignment nodes, and miscellaneous cleanup
987 Split read-modify code paths out of AssignBracketNode and AssignDotNode
988 Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode
989 and ReadModifyResolveNode evaluate methods
991 Leads to a 1% gain in SunSpider.
995 (KJS::ReadModifyLocalVarNode::evaluate):
996 (KJS::ReadModifyResolveNode::evaluate):
997 (KJS::AssignDotNode::evaluate):
998 (KJS::ReadModifyDotNode::optimizeVariableAccess):
999 (KJS::ReadModifyDotNode::evaluate):
1000 (KJS::AssignBracketNode::evaluate):
1001 (KJS::ReadModifyBracketNode::optimizeVariableAccess):
1002 (KJS::ReadModifyBracketNode::evaluate):
1004 (KJS::AssignBracketNode::):
1005 (KJS::AssignBracketNode::precedence):
1006 (KJS::AssignDotNode::):
1007 (KJS::AssignDotNode::precedence):
1008 * kjs/nodes2string.cpp:
1009 (KJS::ReadModifyBracketNode::streamTo):
1010 (KJS::AssignBracketNode::streamTo):
1011 (KJS::ReadModifyDotNode::streamTo):
1012 (KJS::AssignDotNode::streamTo):
1014 2007-10-29 Oliver Hunt <oliver@apple.com>
1016 Debranching various Node::evaluate implementations
1020 Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
1021 Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
1023 Gains 1.6% on SunSpider
1025 * JavaScriptCore.xcodeproj/project.pbxproj:
1028 (KJS::PostIncResolveNode::optimizeVariableAccess):
1029 (KJS::PostIncResolveNode::evaluate):
1030 (KJS::PostIncLocalVarNode::evaluate):
1031 (KJS::PostDecResolveNode::optimizeVariableAccess):
1032 (KJS::PostDecResolveNode::evaluate):
1033 (KJS::PostDecLocalVarNode::evaluate):
1034 (KJS::PostIncBracketNode::evaluate):
1035 (KJS::PostDecBracketNode::evaluate):
1036 (KJS::PostIncDotNode::evaluate):
1037 (KJS::PostDecDotNode::evaluate):
1038 (KJS::PreIncResolveNode::optimizeVariableAccess):
1039 (KJS::PreIncLocalVarNode::evaluate):
1040 (KJS::PreIncResolveNode::evaluate):
1041 (KJS::PreDecResolveNode::optimizeVariableAccess):
1042 (KJS::PreDecLocalVarNode::evaluate):
1043 (KJS::PreDecResolveNode::evaluate):
1044 (KJS::PreIncBracketNode::evaluate):
1045 (KJS::PreDecBracketNode::evaluate):
1046 (KJS::PreIncDotNode::evaluate):
1047 (KJS::PreDecDotNode::evaluate):
1048 (KJS::ReadModifyResolveNode::optimizeVariableAccess):
1049 (KJS::AssignResolveNode::optimizeVariableAccess):
1050 (KJS::AssignLocalVarNode::evaluate):
1051 (KJS::AssignResolveNode::evaluate):
1053 (KJS::PostDecResolveNode::):
1054 (KJS::PostDecResolveNode::precedence):
1055 (KJS::PostDecLocalVarNode::):
1056 (KJS::PostfixBracketNode::):
1057 (KJS::PostfixBracketNode::precedence):
1058 (KJS::PostIncBracketNode::):
1059 (KJS::PostIncBracketNode::isIncrement):
1060 (KJS::PostDecBracketNode::):
1061 (KJS::PostDecBracketNode::isIncrement):
1062 (KJS::PostfixDotNode::):
1063 (KJS::PostfixDotNode::precedence):
1064 (KJS::PostIncDotNode::):
1065 (KJS::PostIncDotNode::isIncrement):
1066 (KJS::PostDecDotNode::):
1067 (KJS::PreIncResolveNode::):
1068 (KJS::PreDecResolveNode::):
1069 (KJS::PreDecResolveNode::precedence):
1070 (KJS::PreDecLocalVarNode::):
1071 (KJS::PrefixBracketNode::):
1072 (KJS::PrefixBracketNode::precedence):
1073 (KJS::PreIncBracketNode::):
1074 (KJS::PreIncBracketNode::isIncrement):
1075 (KJS::PreDecBracketNode::):
1076 (KJS::PreDecBracketNode::isIncrement):
1077 (KJS::PrefixDotNode::):
1078 (KJS::PrefixDotNode::precedence):
1079 (KJS::PreIncDotNode::):
1080 (KJS::PreIncDotNode::isIncrement):
1081 (KJS::PreDecDotNode::):
1082 (KJS::ReadModifyResolveNode::):
1083 (KJS::ReadModifyLocalVarNode::):
1084 (KJS::AssignResolveNode::):
1085 (KJS::AssignResolveNode::precedence):
1086 * kjs/nodes2string.cpp:
1087 (KJS::PostIncResolveNode::streamTo):
1088 (KJS::PostDecResolveNode::streamTo):
1089 (KJS::PostfixBracketNode::streamTo):
1090 (KJS::PostfixDotNode::streamTo):
1091 (KJS::PreIncResolveNode::streamTo):
1092 (KJS::PreDecResolveNode::streamTo):
1093 (KJS::ReadModifyResolveNode::streamTo):
1094 (KJS::AssignResolveNode::streamTo):
1096 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1098 Not reviewed, build fix.
1100 - Include Vector.h in a way that actually works.
1102 * kjs/LocalStorage.h:
1104 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1106 Not reviewed, build fix.
1108 - Install LocalStorage.h as a private header.
1110 * JavaScriptCore.xcodeproj/project.pbxproj:
1112 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1116 - Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.
1118 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1119 * JavaScriptCore.xcodeproj/project.pbxproj:
1120 * kjs/LocalStorage.h: Added.
1121 (KJS::LocalStorageEntry::LocalStorageEntry):
1125 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
1127 2007-10-29 Geoffrey Garen <ggaren@apple.com>
1129 Reviewed by Oliver Hunt.
1131 Some small tweaks that I notice while reviewing Oliver's last patch.
1133 Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
1135 No change in SunSpider because SunSpider doesn't take the code path that
1136 would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.
1139 (KJS::LocalVarPostfixNode::evaluate):
1140 (KJS::TypeOfResolveNode::optimizeVariableAccess):
1141 (KJS::LocalVarTypeOfNode::evaluate):
1142 (KJS::PrefixResolveNode::optimizeVariableAccess):
1143 (KJS::LocalVarPrefixNode::evaluate):
1144 (KJS::AssignResolveNode::optimizeVariableAccess):
1145 (KJS::LocalVarAssignNode::evaluate):
1147 (KJS::LocalVarTypeOfNode::):
1148 (KJS::PrefixResolveNode::):
1149 (KJS::LocalVarPrefixNode::):
1150 (KJS::AssignResolveNode::):
1151 (KJS::LocalVarAssignNode::):
1153 2007-10-29 Eric Seidel <eric@webkit.org>
1157 SunSpider claims this was a 0.7% speedup.
1159 * kjs/string_object.cpp:
1160 (KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case
1162 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1166 - re-enable asserts for access to empty or deleted keys
1170 (WTF::::lookupForWriting):
1171 (WTF::::fullLookupForWriting):
1174 2007-10-29 Eric Seidel <eric@webkit.org>
1176 Build fix only, no review.
1178 * JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot
1180 2007-10-29 Mark Rowe <mrowe@apple.com>
1182 Gtk build fix. Move struct declarations into nodes.h.
1187 2007-10-29 Eric Seidel <eric@webkit.org>
1191 Give StringInstance a getOwnPropertySlot(ExecState, unsigned, PropertySlot) fastpath, just like Arrays.
1192 Make it a compile time error to use toString(ExecState) on a StringInstance
1194 SunSpider claims this was a 6.6% speedup overall (22% on string-base64)
1197 (KJS::StringImp::getLength):
1198 * kjs/string_object.cpp:
1199 (KJS::StringInstance::lengthGetter):
1200 (KJS::StringInstance::inlineGetOwnPropertySlot):
1201 (KJS::StringInstance::getOwnPropertySlot):
1202 * kjs/string_object.h:
1204 2007-10-28 Oliver Hunt <oliver@apple.com>
1208 Add nodes to allow Assignment, TypeOf, and prefix operators to
1209 make use of the new optimised local variable look up.
1211 5% gain on sunspider
1214 (KJS::TypeOfResolveNode::optimizeVariableAccess):
1215 (KJS::LocalTypeOfAccessNode::evaluate):
1216 (KJS::PrefixResolveNode::optimizeVariableAccess):
1217 (KJS::PrefixLocalAccessNode::evaluate):
1218 (KJS::AssignResolveNode::optimizeVariableAccess):
1219 (KJS::AssignLocalAccessNode::evaluate):
1221 (KJS::TypeOfResolveNode::):
1222 (KJS::TypeOfResolveNode::precedence):
1223 (KJS::LocalTypeOfAccessNode::):
1224 (KJS::PrefixResolveNode::):
1225 (KJS::PrefixResolveNode::precedence):
1226 (KJS::PrefixLocalAccessNode::):
1227 (KJS::AssignResolveNode::):
1228 (KJS::AssignLocalAccessNode::):
1230 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1234 - avoid creating and then breaking circular lists in the parser, instead track head and tail pointers at parse time
1235 http://bugs.webkit.org/show_bug.cgi?id=15748
1237 Not a significant speedup or slowdown on SunSpider.
1240 (KJS::clearNewNodes):
1244 (KJS::BlockNode::BlockNode):
1245 (KJS::CaseBlockNode::CaseBlockNode):
1246 (KJS::FunctionBodyNode::FunctionBodyNode):
1247 (KJS::SourceElementsNode::SourceElementsNode):
1248 (KJS::ProgramNode::ProgramNode):
1250 (KJS::ElementNode::):
1252 (KJS::PropertyListNode::):
1253 (KJS::ObjectLiteralNode::):
1254 (KJS::ArgumentListNode::):
1255 (KJS::ArgumentsNode::):
1256 (KJS::VarDeclListNode::):
1257 (KJS::VarStatementNode::):
1259 (KJS::ParameterNode::):
1260 (KJS::FuncExprNode::):
1261 (KJS::FuncDeclNode::):
1262 (KJS::SourceElementsNode::):
1263 (KJS::CaseClauseNode::):
1264 (KJS::ClauseListNode::):
1266 2007-10-28 Mark Rowe <mrowe@apple.com>
1268 Disable assertions in a manner that doesn't break the Qt Windows build.
1272 (WTF::::lookupForWriting):
1273 (WTF::::fullLookupForWriting):
1275 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1277 Temporarily disabling some ASSERTs I introduced in my last check-in
1278 because of http://bugs.webkit.org/show_bug.cgi?id=15747
1279 Lots of layout tests fail the !HashTranslator::equal(KeyTraits::emptyValue() ASSERT
1283 (WTF::::lookupForWriting):
1284 (WTF::::fullLookupForWriting):
1287 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1289 Reviewed by Darin Adler.
1291 Fixed http://bugs.webkit.org/show_bug.cgi?id=15746
1292 #ifndef ASSERT_DISABLED is no good!
1294 Replaced with #if !ASSERT_DISABLED.
1298 (WTF::::lookupForWriting):
1299 (WTF::::fullLookupForWriting):
1302 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1304 Reviewed by Darin Adler.
1306 Added FunctionCallResolveNode, PostfixResolveNode, and DeleteResolveNode
1307 to the AST transfom that replaces slow resolve nodes with fast local
1308 variable alternatives.
1310 2.5% speedup on SunSpider.
1312 Also added some missing copyright notices.
1315 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
1316 (KJS::FunctionCallResolveNode::evaluate):
1317 (KJS::LocalVarFunctionCallNode::evaluate):
1318 (KJS::PostfixResolveNode::optimizeVariableAccess):
1319 (KJS::PostfixResolveNode::evaluate):
1320 (KJS::LocalVarPostfixNode::evaluate):
1321 (KJS::DeleteResolveNode::optimizeVariableAccess):
1322 (KJS::DeleteResolveNode::evaluate):
1323 (KJS::LocalVarDeleteNode::evaluate):
1325 (KJS::FunctionCallResolveNode::):
1326 (KJS::LocalVarFunctionCallNode::LocalVarFunctionCallNode):
1327 (KJS::PostfixResolveNode::):
1328 (KJS::LocalVarPostfixNode::LocalVarPostfixNode):
1329 (KJS::DeleteResolveNode::):
1330 (KJS::LocalVarDeleteNode::LocalVarDeleteNode):
1332 2007-10-28 Eric Seidel <eric@webkit.org>
1336 Inline UString::Rep::deref() for a 0.8% improvement in SunSpider
1337 Add virtual keyword to a few virtual functions previously unmarked.
1340 (KJS::StringImp::type):
1341 (KJS::NumberImp::type):
1343 (KJS::UString::Rep::deref):
1345 2007-10-28 Darin Adler <darin@apple.com>
1347 - fix "broken everything" from the storage leak fix
1349 * wtf/RefPtr.h: (WTF::RefPtr::RefPtr): Added a PlacementNewAdopt constructor.
1350 * kjs/ustring.h: (KJS::UString::UString): Pass PlacementNewAdopt along to RefPtr.
1352 2007-10-28 Darin Adler <darin@apple.com>
1356 - turn on unused parameter waring on Mac OS X because it's already on elsewhere
1358 * Configurations/Base.xcconfig: Took out -wno-unused-parameter.
1364 Fixed unused variables by using them or marked them with UNUSED_PARAM.
1366 * kjs/CollectorHeapIntrospector.h: (KJS::CollectorHeapIntrospector::zoneCalloc):
1367 Removed parameter names to indicate they are unused.
1369 2007-10-28 Darin Adler <darin@apple.com>
1373 - fix a storage leak where we ref the UString every time we replace
1374 a ResolveNode with a LocalVarAccessNode
1376 * kjs/identifier.h: (KJS::Identifier::Identifier): Added a constructor
1377 that takes PlacementNewAdopt.
1379 * kjs/nodes.h: (KJS::ResolveNode::ResolveNode): Initialize the ident
1380 with PlacementNewAdopt instead of the old value of ident.
1382 * kjs/ustring.h: (KJS::UString::UString): Added a constructor that
1383 takes PlacementNewAdopt.
1385 2007-10-28 Darin Adler <darin@apple.com>
1387 - Windows build fix; get rid of unused parameter
1389 * kjs/nodes.cpp: (KJS::ResolveNode::optimizeVariableAccess): Don't pass it.
1390 * kjs/nodes.h: (KJS::LocalVarAccessNode::LocalVarAccessNode): Remove it.
1391 The assertions weren't all that helpful.
1393 2007-10-28 Mark Rowe <mrowe@apple.com>
1395 Gtk build fix. Add include of MathExtras.h.
1397 * kjs/string_object.cpp:
1399 2007-10-28 Mark Rowe <mrowe@apple.com>
1401 Reviewed by Maciej and Tim.
1403 Replace uses of isNaN and isInf with isnan and isinf, and
1404 remove isNaN and isInf.
1406 * kjs/config.h: Remove unused HAVE_'s.
1407 * kjs/date_object.cpp:
1408 (KJS::DateInstance::getTime):
1409 (KJS::DateInstance::getUTCTime):
1410 (KJS::DateProtoFunc::callAsFunction):
1411 (KJS::DateObjectImp::construct):
1412 (KJS::DateObjectFuncImp::callAsFunction):
1414 (KJS::GlobalFuncImp::callAsFunction):
1415 * kjs/math_object.cpp:
1416 (MathFuncImp::callAsFunction):
1417 * kjs/nodes2string.cpp:
1418 (KJS::isParserRoundTripNumber):
1419 * kjs/number_object.cpp:
1420 (NumberProtoFunc::callAsFunction):
1421 * kjs/operations.cpp:
1423 * kjs/string_object.cpp:
1424 (KJS::StringProtoFunc::callAsFunction):
1426 (KJS::UString::from):
1428 (KJS::JSValue::toInteger):
1429 (KJS::JSValue::toInt32SlowCase):
1430 (KJS::JSValue::toUInt32SlowCase):
1432 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1434 Build fix: use the new-fangled missingSymbolMarker().
1437 (KJS::ResolveNode::optimizeVariableAccess):
1439 (KJS::LocalVarAccessNode::LocalVarAccessNode):
1441 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1443 Reviewed by Maciej Stachowiak, Darin Adler.
1445 Much supporting work done by Maciej Stachowiak, Maks Orlovich, and
1448 AST transfom to replace slow resolve nodes with fast local variable
1449 alternatives that do direct memory access. Currently, only ResolveNode
1450 provides a fast local variable alternative. 6 others are soon to come.
1452 16.7% speedup on SunSpider.
1454 Most of this patch is just scaffolding to support iterating all the
1455 resolve nodes in the AST through optimizeResolveNodes(). In
1456 optimizeResolveNodes(), most classes just push their child nodes onto
1457 the processing stack, while ResolveNodes actually replace themselves in
1458 the tree with more optimized alternatives, if possible.
1460 Here are the interesting bits:
1462 * kjs/nodes.h: Added PlacementNewAdoptTag, along with implementations
1463 in Node and ResolveNode. This tag allows you to use placement new to
1464 swap out a base class Node in favor of a subclass copy that holds the
1465 same data. (Without this tag, default initialization would NULL out
1466 RefPtrs, change line numbers, etc.)
1469 (KJS::ResolveNode::evaluate): Since we're taking the slow path, ASSERT
1470 that the fast path is impossible, to make sure we didn't leave anything
1473 (KJS::FunctionBodyNode::optimizeResolveNodes): Here's where the AST
1474 transformation happens.
1476 (KJS::ResolveNode::optimizeResolveNodes): Here's where the ResolveNode
1477 optimization happens.
1479 * kjs/function.h: Added symbolTable() accessor for, for the sake of
1482 2007-10-28 Mark Rowe <mrowe@apple.com>
1486 Fix "AllInOneFile.o has a global initializer in it".
1488 Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
1489 We can avoid this by moving it inside an inline function.
1491 * kjs/SymbolTable.h:
1492 (KJS::missingSymbolMarker):
1494 (KJS::ActivationImp::getOwnPropertySlot):
1495 (KJS::ActivationImp::put):
1497 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1501 - Added assertions to protect against adding empty or deleted keys to a HashTable
1504 (WTF::HashTable::lookup):
1505 (WTF::HashTable::lookupForWriting):
1506 (WTF::HashTable::fullLookupForWriting):
1507 (WTF::HashTable::add):
1509 2007-10-28 Darin Adler <darin@apple.com>
1513 * kjs/nodes2string.cpp: (KJS::isParserRoundTripNumber):
1514 Use isNaN and isInf instead of isnan and isinf.
1516 2007-10-28 Darin Adler <darin@apple.com>
1520 - http://bugs.webkit.org/show_bug.cgi?id=15735
1521 remove GroupNode to simplify AST and possibly get a modest speedup
1523 This patch removes 4 node types: GroupNode, PropertyNameNode,
1524 FunctionCallParenBracketNode, and FunctionCallParenDotNode.
1526 To remove GroupNode, we add knowledge of precedence to the tree nodes,
1527 and use that when serializing to determine where parentheses are needed.
1528 This means we no longer have to represent parentheses in the tree.
1530 The precedence values are named after productions in the grammar from the
1531 JavaScript standard.
1533 SunSpider says this is an 0.4% speedup.
1536 * kjs/function.cpp: Removed escapeStringForPrettyPrinting -- it's part of
1537 serialization, so I moved it to the file that takes care of that.
1539 * kjs/grammar.y: Changed makeGetterOrSetterPropertyNode to use 0 to
1540 indicate failure instead of a separate boolean. Got rid of PropertyNameNode
1541 by merging the PropertyName rule into the Property rule (which was easier
1542 than figuring out how to pass the Identifier from one node to another).
1543 Got rid of GroupNode, nodeInsideAllParens(), FunctionCallParenBracketNode,
1544 and FunctionCallParenDotNode.
1546 * kjs/nodes.h: Removed unused forward declarations and Operator values.
1547 Added Precedence enum, and precedence function to all nodes. Removed
1548 nodeInsideAllParens. Added streamBinaryOperator function for serialization.
1549 Removed GroupNode and PropertyNameNode. Made PropertyNode store an Identifier.
1550 Removed FunctionCallParenBracketNode and FunctionCallParenDotNode.
1552 * kjs/nodes.cpp: Removed Node::nodinsideAllParens, GroupNode, and PropertyNameNode.
1553 (KJS::PropertyListNode::evaluate): Changed code to get name directly instead
1554 of converting it from an Identifier to a jsString then back to a UString
1555 then into an Identifier again!
1557 * kjs/nodes2string.cpp: Changed special-token implementation to use a separate
1558 function for each of Endl, Indent, Unindent, and DotExpr instead of using a
1559 single function with a switch. Added a precedence that you can stream in, to
1560 cause the next node serialized to add parentheses based on that precedence value.
1561 (KJS::operatorString): Moved to the top of the file.
1562 (KJS::escapeStringForPrettyPrinting): Moved here from function.cpp. Removed old
1563 workaround for snprintf, since StringExtras.h takes care of that.
1564 (KJS::operator<<): Made the char and char* versions faster by using UString's
1565 character append functions instead of constructing a UString. Added the logic
1566 to the Node* version to add parentheses if needed.
1567 (KJS::Node::streamLeftAssociativeBinaryOperator): Added helper function.
1568 (KJS::ElementNode::streamTo): Use PrecAssignment for the elements.
1569 (KJS::BracketAccessorNode::streamTo): Use PrecCall for the expression before
1571 (KJS::DotAccessorNode::streamTo): Use PrecCall for the expression before the dot.
1572 (KJS::ArgumentListNode::streamTo): Use PrecAssignment for the arguments.
1573 (KJS::NewExprNode::streamTo): Use PrecMember for the expression.
1574 (KJS::FunctionCallValueNode::streamTo): Use PrecCall.
1575 (KJS::FunctionCallBracketNode::streamTo): Ditto.
1576 (KJS::FunctionCallDotNode::streamTo): Ditto.
1577 (KJS::PostfixBracketNode::streamTo): Ditto.
1578 (KJS::PostfixDotNode::streamTo): Ditto.
1579 (KJS::PostfixErrorNode::streamTo): Use PrecLeftHandSide.
1580 (KJS::DeleteBracketNode::streamTo): Use PrecCall.
1581 (KJS::DeleteDotNode::streamTo): Ditto.
1582 (KJS::DeleteValueNode::streamTo): Use PrecUnary.
1583 (KJS::VoidNode::streamTo): Ditto.
1584 (KJS::TypeOfValueNode::streamTo): Ditto.
1585 (KJS::PrefixBracketNode::streamTo): Use PrecCall.
1586 (KJS::PrefixDotNode::streamTo): Ditto.
1587 (KJS::PrefixErrorNode::streamTo): Use PrecUnary.
1588 (KJS::UnaryPlusNode::streamTo): Ditto.
1589 (KJS::NegateNode::streamTo): Ditto.
1590 (KJS::BitwiseNotNode::streamTo): Ditto.
1591 (KJS::LogicalNotNode::streamTo): Ditto.
1592 (KJS::MultNode::streamTo): Use streamLeftAssociativeBinaryOperator.
1593 (KJS::DivNode::streamTo): Ditto.
1594 (KJS::ModNode::streamTo): Ditto.
1595 (KJS::AddNode::streamTo): Ditto.
1596 (KJS::SubNode::streamTo): Ditto.
1597 (KJS::LeftShiftNode::streamTo): Ditto.
1598 (KJS::RightShiftNode::streamTo): Ditto.
1599 (KJS::UnsignedRightShiftNode::streamTo): Ditto.
1600 (KJS::LessNode::streamTo): Ditto.
1601 (KJS::GreaterNode::streamTo): Ditto.
1602 (KJS::LessEqNode::streamTo): Ditto.
1603 (KJS::GreaterEqNode::streamTo): Ditto.
1604 (KJS::InstanceOfNode::streamTo): Ditto.
1605 (KJS::InNode::streamTo): Ditto.
1606 (KJS::EqualNode::streamTo): Ditto.
1607 (KJS::NotEqualNode::streamTo): Ditto.
1608 (KJS::StrictEqualNode::streamTo): Ditto.
1609 (KJS::NotStrictEqualNode::streamTo): Ditto.
1610 (KJS::BitAndNode::streamTo): Ditto.
1611 (KJS::BitXOrNode::streamTo): Ditto.
1612 (KJS::BitOrNode::streamTo): Ditto.
1613 (KJS::LogicalAndNode::streamTo): Ditto.
1614 (KJS::LogicalOrNode::streamTo): Ditto.
1615 (KJS::ConditionalNode::streamTo): Ditto.
1616 (KJS::AssignResolveNode::streamTo): Use PrecAssignment for the right side.
1617 (KJS::AssignBracketNode::streamTo): Use PrecCall for the expression before
1618 the bracket and PrecAssignment for the right side.
1619 (KJS::AssignDotNode::streamTo): Ditto.
1620 (KJS::AssignErrorNode::streamTo): Use PrecLeftHandSide for the left side
1621 and PrecAssignment for the right side.
1622 (KJS::CommaNode::streamTo): Use PrecAssignment for both expressions.
1623 (KJS::AssignExprNode::streamTo): Use PrecAssignment.
1625 2007-10-28 Kevin Ollivier <kevino@theolliviers.com>
1627 Define wx port and set wx port USE options.
1629 Reviewed by Adam Roben.
1633 2007-10-28 Mark Rowe <mrowe@apple.com>
1635 We don't include "config.h" in headers.
1637 * bindings/jni/jni_instance.h:
1642 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1644 Rubber stamped by Mark.
1646 - avoid using non-portable SIZE_T_MAX in favor of std::numeric_limits
1648 * kjs/SymbolTable.h:
1649 (KJS::SymbolTableIndexHashTraits::emptyValue):
1651 (KJS::ActivationImp::getOwnPropertySlot):
1652 (KJS::ActivationImp::put):
1654 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1658 - switch SymbolTable to be a HashMap instead of a PropertyMap for 3% SunSpider speedup
1660 * kjs/SymbolTable.h:
1661 (KJS::IdentifierRepHash::hash): Special hash function for identifier reps.
1662 (KJS::IdentifierRepHash::equal): ditto
1663 (KJS::SymbolTableIndexHashTraits::emptyValue): Special HashTraits for the index value.
1664 (KJS::SymbolTable): change to a typedef for a HashMap.
1666 (KJS::ActivationImp::getOwnPropertySlot): Adjusted for new SymbolTable API.
1667 (KJS::ActivationImp::deleteProperty): ditto
1668 (KJS::ActivationImp::put): ditto
1671 (KJS::FunctionBodyNode::initializesymbolTable): Adjusted, since
1672 you now have to store a UString::rep, not an identifier.
1674 2007-10-27 Maciej Stachowiak <mjs@apple.com>
1678 - numerous HashTable performance improvements
1680 This does not quite add up to a measurable win on SunSpider, but it allows a
1681 follow-on > 3% improvement and probably helps WebCore too.
1683 I made the following improvements, among others:
1685 - Made HashFunctions note whether it is ok to compare a real value with the equal() function
1686 to the empty or deleted value, and used this to optimize the comparisons done in hash lookup.
1688 - Specialized lookup so it doesn't have to do so many extra branches and build so many extra
1689 std::pairs for cases that don't need them. There are now four versions, one for read-only access,
1690 two for writing, and one folded directly into add() (these all were improvments).
1692 - Made HashMap::get() use lookup() directly instead of find() to avoid having to build iterators.
1694 - Made a special constructor for iterators that knows it points to
1695 a valid filled cell and so skips updating itself.
1697 - Reordered memory accesses in the various lookup functions for better code generation
1699 - Made simple translators avoid passing a hash code around
1701 - Other minor tweaks
1705 (WTF::HashTableConstIterator::HashTableConstIterator):
1706 (WTF::HashTableIterator::HashTableIterator):
1707 (WTF::IdentityHashTranslator::translate):
1708 (WTF::HashTable::end):
1709 (WTF::HashTable::lookup):
1710 (WTF::HashTable::lookupForWriting):
1711 (WTF::HashTable::makeKnownGoodIterator):
1712 (WTF::HashTable::makeKnownGoodConstIterator):
1714 (WTF::::lookupForWriting):
1715 (WTF::::fullLookupForWriting):
1717 (WTF::::addPassingHashCode):
1721 * kjs/identifier.cpp:
1723 * wtf/HashFunctions.h:
1731 * wtf/ListHashSet.h:
1732 (WTF::ListHashSetTranslator::translate):
1734 2007-10-27 Darin Adler <darin@apple.com>
1738 - fix ASCIICType.h for some Windows compiles
1740 * wtf/ASCIICType.h: Check the compiler, not the OS, since it's the
1741 compiler/library that has the wchar_t that is just a typedef.
1743 2007-10-27 Kevin McCullough <kmccullough@apple.com>
1746 - Forgot to change the build step when I changed the filename.
1748 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1750 2007-10-27 Geoffrey Garen <ggaren@apple.com>
1752 Reviewed by Darin Adler.
1754 Fixed the rest of "ASSERTION FAILED: _hash in KJS::UString::Rep::
1756 http://bugs.webkit.org/show_bug.cgi?id=15718
1758 * kjs/identifier.cpp: Fixed more cases where an Identifier didn't get a
1759 hash value. Also changed O(n) strlen to O(1) check for empty string.
1760 (KJS::Identifier::add):
1762 * kjs/ustring.cpp: Changed O(n) strlens to O(1) checks for empty string.
1763 (KJS::UString::UString):
1764 (KJS::UString::operator=):
1766 2007-10-27 Darin Adler <darin@apple.com>
1770 - fix pow on Windows
1772 * wtf/MathExtras.h: (wtf_pow): Add a special case for MSVC, which has
1773 a "pow" function that does not properly handle the case where arg1 is
1776 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Don't explicity
1777 specify "::pow" -- just "pow" is fine.
1779 2007-10-27 Darin Adler <darin@apple.com>
1783 - http://bugs.webkit.org/show_bug.cgi?id=15711
1784 force JSImmediate to be inlined for roughly 1.2% SunSpider speedup
1786 * kjs/JSImmediate.h: Put ALWAYS_INLINE on everything.
1788 * kjs/object.h: Removed redundant includes.
1789 * kjs/value.h: Ditto.
1791 2007-10-27 Maciej Stachowiak <mjs@apple.com>
1795 - fixed "ASSERTION FAILED: _hash in KJS::UString::Rep::computedHash()"
1796 http://bugs.webkit.org/show_bug.cgi?id=15718
1798 * kjs/identifier.cpp:
1799 (KJS::Identifier::addSlowCase): Ensure that empty Identifiers have a hash computed,
1800 now that we count on all Identifiers already having one.
1802 2007-10-27 Mark Rowe <mrowe@apple.com>
1806 * kjs/SymbolTable.h:
1808 2007-10-27 Mark Rowe <mrowe@apple.com>
1814 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1816 Rubber stamp by Adam.
1818 - Renamed JSStringRefCOM to JSStringRefBSTR since it he only thing the
1819 files contain are functions that operate on BSTRs.
1821 * API/JSStringRefBSTR.cpp: Copied from API/JSStringRefCOM.cpp.
1822 * API/JSStringRefBSTR.h: Copied from API/JSStringRefCOM.h.
1823 * API/JSStringRefCOM.cpp: Removed.
1824 * API/JSStringRefCOM.h: Removed.
1825 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1827 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1831 - Made JSStringCreateWithBSTR capable of handling null BSTRs.
1833 * API/JSStringRefCOM.cpp:
1834 (JSStringCreateWithBSTR):
1836 2007-10-26 Sam Weinig <sam@webkit.org>
1840 * kjs/SymbolTable.h: Add header gaurd.
1841 * kjs/nodes.h: #include "SymbolTable.h"
1843 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1845 Suggested by Anders Carlsson.
1850 (KJS::ActivationImp::getOwnPropertySlot):
1852 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1854 Suggested by Darin Adler.
1856 Use computedHash(), which is safer than just directly accessing _hash.
1859 (KJS::Lookup::findEntry):
1860 (KJS::Lookup::find):
1862 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1864 Build fix: svn add SymbolTable.h
1866 * kjs/SymbolTable.h: Added.
1867 (KJS::SymbolTable::set):
1868 (KJS::SymbolTable::get):
1870 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1872 Build fix: export SymbolTable.h to WebCore.
1874 * JavaScriptCore.xcodeproj/project.pbxproj:
1876 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1878 Comment tweak suggested by Maciej.
1881 (KJS::ActivationImp::getOwnPropertySlot):
1883 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1885 Reviewed by Maciej Stachowiak.
1887 Tweaked property maps to remove 2 branches. 2.5% speedup on SunSpider.
1889 * kjs/property_map.cpp: Use a special no branch accessor to the UString's
1890 hash value. Also, return immediately instead of branching to the end
1891 of the loop if the value is not found.
1892 (KJS::PropertyMap::get):
1893 (KJS::PropertyMap::getLocation):
1894 (KJS::PropertyMap::put):
1895 (KJS::PropertyMap::insert):
1896 (KJS::PropertyMap::remove):
1897 (KJS::PropertyMap::checkConsistency):
1900 (KJS::UString::Rep::computedHash): Special no branch accessor to the
1901 UString's hash value. Used when the caller knows that the hash value
1902 has already been computed. (For example, if the caller got the UString
1903 from an Identifier.)
1905 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1907 Reviewed by Maciej Stachowiak.
1909 Switched ActivationImp to using a symbol table. For now, though, all
1910 clients take the slow path.
1912 Net .6% speedup on SunSpider.
1915 - ActivationImp now mallocs in its constructor
1916 - Local variable hits use an extra level of indirection to retrieve
1918 - Local variable misses do two lookups
1921 - Fast initialization of local variables upon function entry
1923 * JavaScriptCore.xcodeproj/project.pbxproj: Added SymbolTable.h
1926 (KJS::ActivationImp::ActivationImp): Malloc a private structure to hold
1927 data that won't fit in a JSCell.
1928 (KJS::ActivationImp::argumentsGetter): Use slow symbol table path for
1930 (KJS::ActivationImp::getOwnPropertySlot): ditto
1931 (KJS::ActivationImp::deleteProperty): ditto
1932 (KJS::ActivationImp::put): ditto
1933 (KJS::ActivationImp::createArgumentsObject): ditto
1935 (KJS::ActivationImp::mark): Call JSObject::mark first so that one of
1936 our properties doesn't try to recursively mark us. (This caused a crash
1937 in earlier testing. Not sure why we haven't run into it before.)
1939 * kjs/nodes.cpp: Functions now build a symbol table the first time
1941 (KJS::VarDeclNode::evaluate):
1942 (KJS::FunctionBodyNode::FunctionBodyNode):
1943 (KJS::FunctionBodyNode::initializeSymbolTable):
1944 (KJS::FunctionBodyNode::processDeclarations):
1945 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
1946 (KJS::FunctionBodyNode::processDeclarationsForProgramCode):
1949 (KJS::FunctionBodyNode::symbolTable):
1951 * wtf/Forward.h: Added Vector.
1953 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1955 - Corrected function name mistake in this changelog.
1957 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1958 Reviewed by Sam and Steve.
1960 - Added convenience methods for converting between BSTR and JSStringRefs
1962 * API/JSStringRefCOM.cpp: Added.
1963 (JSStringCreateWithBSTR):
1965 * API/JSStringRefCOM.h: Added.
1966 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1968 2007-10-26 Mark Rowe <mrowe@apple.com>
1972 * kjs/collector.cpp:
1973 (KJS::Collector::collect):
1975 2007-10-26 Oliver Hunt <oliver@apple.com>
1979 Make the JSC GC use a separate heap for JSNumbers to get a 0.7-1.4% progression in SunSpider.
1981 * kjs/CollectorHeapIntrospector.cpp:
1982 (KJS::CollectorHeapIntrospector::init):
1983 (KJS::CollectorHeapIntrospector::enumerate):
1984 * kjs/CollectorHeapIntrospector.h:
1985 * kjs/collector.cpp:
1986 (KJS::Collector::recordExtraCost):
1987 (KJS::Collector::heapAllocate):
1988 (KJS::Collector::allocate):
1989 (KJS::Collector::allocateNumber):
1990 (KJS::Collector::registerThread):
1991 (KJS::Collector::markStackObjectsConservatively):
1992 (KJS::Collector::markMainThreadOnlyObjects):
1993 (KJS::Collector::sweep):
1994 (KJS::Collector::collect):
1997 (KJS::NumberImp::operator new):
1998 Force numbers to be allocated in the secondary heap.
2000 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2004 - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
2007 (KJS::JSValue::getUInt32):
2008 (KJS::JSValue::getTruncatedInt32):
2009 (KJS::JSValue::toNumber):
2011 (WTF::PassRefPtr::~PassRefPtr):
2013 (WTF::RefPtr::operator->):
2015 2007-10-26 Mark Rowe <mrowe@apple.com>
2021 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2025 - Merge Context class fully into ExecState, since they are always created and used together.
2027 No measurable performance impact but this is a useful cleanup.
2029 * JavaScriptCore.pri:
2030 * kjs/ExecState.cpp:
2031 (KJS::ExecState::ExecState):
2032 (KJS::ExecState::~ExecState):
2033 (KJS::ExecState::mark):
2034 (KJS::ExecState::lexicalInterpreter):
2036 (KJS::ExecState::dynamicInterpreter):
2037 (KJS::ExecState::setException):
2038 (KJS::ExecState::clearException):
2039 (KJS::ExecState::exception):
2040 (KJS::ExecState::exceptionSlot):
2041 (KJS::ExecState::hadException):
2042 (KJS::ExecState::scopeChain):
2043 (KJS::ExecState::callingExecState):
2044 (KJS::ExecState::propertyNames):
2045 * kjs/collector.cpp:
2046 (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2048 (KJS::FunctionImp::callAsFunction):
2049 (KJS::FunctionImp::argumentsGetter):
2050 (KJS::FunctionImp::callerGetter):
2051 (KJS::GlobalFuncImp::callAsFunction):
2052 * kjs/interpreter.cpp:
2053 (KJS::Interpreter::Interpreter):
2054 (KJS::Interpreter::init):
2055 (KJS::Interpreter::evaluate):
2056 (KJS::Interpreter::mark):
2057 * kjs/interpreter.h:
2058 (KJS::Interpreter::setCurrentExec):
2059 (KJS::Interpreter::currentExec):
2061 (KJS::currentSourceId):
2062 (KJS::currentSourceURL):
2063 (KJS::ThisNode::evaluate):
2064 (KJS::ResolveNode::evaluate):
2065 (KJS::FunctionCallResolveNode::evaluate):
2066 (KJS::PostfixResolveNode::evaluate):
2067 (KJS::DeleteResolveNode::evaluate):
2068 (KJS::TypeOfResolveNode::evaluate):
2069 (KJS::PrefixResolveNode::evaluate):
2070 (KJS::AssignResolveNode::evaluate):
2071 (KJS::VarDeclNode::evaluate):
2072 (KJS::DoWhileNode::execute):
2073 (KJS::WhileNode::execute):
2074 (KJS::ForNode::execute):
2075 (KJS::ForInNode::execute):
2076 (KJS::ContinueNode::execute):
2077 (KJS::BreakNode::execute):
2078 (KJS::ReturnNode::execute):
2079 (KJS::WithNode::execute):
2080 (KJS::SwitchNode::execute):
2081 (KJS::LabelNode::execute):
2082 (KJS::TryNode::execute):
2083 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2084 (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2085 (KJS::FunctionBodyNode::processDeclarations):
2086 (KJS::FuncDeclNode::makeFunction):
2087 (KJS::FuncExprNode::evaluate):
2089 2007-10-26 Mark Rowe <mrowe@apple.com>
2093 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2095 2007-10-26 Mark Rowe <mrowe@apple.com>
2099 * JavaScriptCore.pri:
2100 * kjs/ExecState.cpp:
2102 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2106 - moved Context class into ExecState.{h,cpp} in preparation for merging
2107 ExecState and Context classes.
2109 * kjs/ExecState.h: Moved CodeType enum and Context class here in
2110 preparation for merging ExecState and Context.
2111 * kjs/ExecState.cpp: Moved Context class here from Context.cpp.
2112 (KJS::Context::Context):
2113 (KJS::Context::~Context):
2114 (KJS::Context::mark):
2115 * kjs/context.h: Removed.
2116 * kjs/Context.cpp: Removed.
2117 * kjs/function.h: Removed CodeType enum.
2118 * kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
2119 * kjs/internal.h: Removed LabelStack.
2120 * JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
2121 * kjs/collector.cpp: Fixed includes.
2122 * kjs/function.cpp: ditto
2123 * kjs/internal.cpp: ditto
2124 * kjs/interpreter.cpp: ditto
2125 * kjs/lookup.h: ditto
2126 * kjs/nodes.cpp: ditto
2128 2007-10-26 Mark Rowe <mrowe@apple.com>
2132 * kjs/string_object.cpp:
2133 (KJS::StringObjectFuncImp::callAsFunction):
2135 2007-10-25 Darin Adler <darin@apple.com>
2139 - http://bugs.webkit.org/show_bug.cgi?id=15703
2140 fix numeric functions -- improve correctness and speed
2142 Gives about 1% gain on SunSpider.
2144 * kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
2145 (KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
2146 with both immediate and number values.
2147 (KJS::JSValue::toUInt32): Ditto.
2149 (KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
2150 differences. One is that it now correctly returns 0 for NaN, and another is that
2151 there's no special case for 0 or infinity, since the general case already handles
2153 (KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
2155 (KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
2156 truncation done by the typecast already does the necessary truncation that
2157 roundValue was doing.
2158 (KJS::JSValue::toUInt32SlowCase): Ditto.
2159 (KJS::JSValue::toUInt16): Removed.
2161 * kjs/internal.h: Removed roundValue.
2162 * kjs/internal.cpp: Ditto.
2164 * kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
2165 code to handle NaN in Array.slice; toInteger now never returns NaN as specified.
2167 * kjs/date_object.cpp:
2168 (KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
2169 toNumber as specified.
2170 (KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
2171 with a call to toNumber and timeClip as specified.
2172 (KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
2173 where the default behavior of toInt32 (returning 0) was already correct. Replaced
2174 call to roundValue with a call to toNumber as specified.
2175 (KJS::DateObjectFuncImp::callAsFunction): Ditto.
2177 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
2178 cases for the pow function that the library already handles correctly.
2180 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
2181 call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
2182 The real toInteger now returns 0 for NaN. Took out unneeded special case in
2183 ToFixed for undefined; was only needed because our toInteger was wrong. Same
2184 thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.
2186 * kjs/string_object.cpp:
2187 (KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
2188 cases for undefined that were only needed because toInteger was wrong. Same in
2189 IndexOf, and was able to remove some special cases. In LastIndexOf, used
2190 toIntegerPreserveNaN, but was able to remove some special cases there too.
2191 Changed Substr implementation to preserve correct behavior with the change
2192 to toInteger and match the specification. Also made sure we weren't converting
2193 an out of range double to an int.
2194 (KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
2195 toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
2196 no reason to have toUInt16 as a second, less-optimized function that's only
2197 called at this one call site.
2199 * wtf/MathExtras.h: Added trunc function for Windows.
2201 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2203 Reviewed by Maciej Stachowiak.
2205 Tweaked the inner hashtable lookup loop to remove a branch in the "not
2206 found" case. .5% speedup on SunSpider.
2208 * JavaScriptCore.xcodeproj/project.pbxproj:
2212 2007-10-25 Maciej Stachowiak <mjs@apple.com>
2216 - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider
2219 (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
2220 adding any value over toNumber() here.
2221 (KJS::valueForReadModifyAssignment): Ditto.
2222 (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
2224 (KJS::lessThanEq): Ditto.
2225 * JavaScriptCore.exp: Export new functions as needed.
2227 (KJS::JSValue::toPrimitive): Fixed formatting.
2228 (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
2229 to number and tells you whether a toPrimitive() conversion with a Number hint
2230 would have given a string.
2232 (KJS::StringImp::getPrimitiveNumber): Implemented.
2233 (KJS::NumberImp::getPrimitiveNumber): ditto
2234 (KJS::GetterSetterImp::getPrimitiveNumber): ditto
2235 (KJS::StringImp::toPrimitive): Fixed formatting.
2236 (KJS::NumberImp::toPrimitive): ditto
2237 (KJS::GetterSetterImp::toPrimitive): ditto
2240 (KJS::JSObject::getPrimitiveNumber): Implemented.
2243 2007-10-25 Sam Weinig <sam@webkit.org>
2245 Reviewed by Adam Roben.
2247 Remove JSStringRefCFHack from windows as it is no longer needed.
2249 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2251 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2253 Reviewed by Oliver Hunt.
2255 Rolled out my last patch. It turns out that I needed 2 words, not 1,
2258 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2260 Reviewed by Oliver Hunt.
2262 Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
2263 Shrink the size of an activation object by 1 word
2265 This is in preparation for adding a symbol table to the activation
2268 The basic strategy here is to rely on the mutual exclusion between
2269 the arguments object pointer and the function pointer (you only need
2270 the latter in order to create the former), and store them in the same
2271 place. The LazyArgumentsObject class encapsulates this strategy.
2273 Also inlined the ArgumentsImp constructor, for good measure.
2275 SunSpider reports no regression. Regression tests pass.
2277 * JavaScriptCore.xcodeproj/project.pbxproj:
2279 (KJS::Context::~Context):
2281 (KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
2282 (KJS::ActivationImp::LazyArgumentsObject::mark):
2284 (KJS::ActivationImp::argumentsGetter):
2285 (KJS::ActivationImp::mark):
2287 (KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
2288 (KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
2289 (KJS::ActivationImp::LazyArgumentsObject::resetArguments):
2290 (KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
2291 (KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
2292 (KJS::ActivationImp::LazyArgumentsObject::setFunction):
2293 (KJS::ActivationImp::LazyArgumentsObject::function):
2294 (KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
2295 (KJS::ActivationImp::LazyArgumentsObject::):
2296 (KJS::ActivationImp::ActivationImp::ActivationImp):
2297 (KJS::ActivationImp::resetArguments):
2299 2007-10-25 Adam Roben <aroben@apple.com>
2301 Change JavaScriptCore.vcproj to use DerivedSources.make
2303 We were trying to emulate the logic of make in
2304 build-generated-files.sh, but we got it wrong. We now use a
2305 build-generated-files very much like the one that WebCore uses to
2308 We also now only have a Debug configuration of dftables which we build
2309 even when doing a Release build of JavaScriptCore. dftables also no
2310 longer has the "_debug" name suffix.
2312 Changes mostly made by Darin, reviewed by me.
2314 * DerivedSources.make: Add a variable to set the extension used for
2315 the dftables executable.
2316 * JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
2317 dftables in Release configurations.
2318 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
2319 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2320 - Updated include path to point to the new location of the derived
2322 - Modified pre-build event to pass the right arguments to
2323 build-generated-files.sh and not call dftables directly.
2324 - Added the derived source files to the project.
2325 - Removed grammarWrapper.cpp, which isn't needed now that we're
2326 compiling grammar.cpp directly.
2327 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2328 Slightly modified from the WebCore version.
2329 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
2330 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2331 - Changed the output location to match Mac.
2332 - Removed the Release configuration.
2333 - Removed the _debug suffix.
2335 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2337 Reviewed by Eric Seidel.
2339 Slightly elaborated the differences between declaration procesing in
2340 Function Code and Program Code.
2342 .3% speedup on SunSpider.
2345 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2346 (KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a
2347 minimum set of attributes instead of recomputing all the time. Also,
2348 ignore m_parameters, since programs don't have arguments.
2350 2007-10-25 Eric Seidel <eric@webkit.org>
2354 More preparation work before adding long-running mode to testkjs.
2357 (TestFunctionImp::callAsFunction):
2358 (prettyPrintScript):
2362 (fillBufferWithContentsOfFile):
2364 2007-10-25 Eric Seidel <eric@webkit.org>
2368 Bring testkjs code out of the dark ages in preparation for more
2369 radical improvements (like long-running testing support!)
2372 (TestFunctionImp::callAsFunction):
2375 (fillBufferWithContentsOfFile):
2377 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2379 Reviewed by Maciej Stachowiak.
2381 Make a fast path for declaration processing inside Function Code.
2383 Lifted declaration processing code up from individual declaration nodes
2384 and into processDeclarations.
2386 Broke out processDeclarations into two cases, depending on the type of
2387 code. This eliminates 2 branches, and facilitates more radical
2388 divergeance in the future.
2390 2.5% SunSpider speedup.
2392 * JavaScriptCore.xcodeproj/project.pbxproj:
2394 (KJS::FunctionBodyNode::initializeDeclarationStacks):
2395 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2396 (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2397 (KJS::FunctionBodyNode::execute):
2398 (KJS::FuncDeclNode::makeFunction):
2402 2007-10-25 Maciej Stachowiak <mjs@apple.com>
2406 - add header includes needed on platforms that don't use AllInOneFile.cpp
2408 * API/JSCallbackObject.cpp:
2410 * kjs/ExecState.cpp:
2411 * kjs/array_instance.cpp:
2412 * kjs/function_object.cpp:
2413 * kjs/interpreter.cpp:
2416 2007-10-25 Eric Seidel <eric@webkit.org>
2420 * JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private
2422 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2424 Reviewed by Maciej Stachowiak.
2426 Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
2427 Re-order declaration initialization to avoid calling hasProperty inside
2428 VarDeclNode::processDeclaration
2430 .7% speedup on SunSpider.
2433 * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
2434 other processing of declared symbols, so the order of execution could
2438 (KJS::VarDeclNode::getDeclarations): Added special case for the
2439 "arguments" property name, explained in the comment.
2441 (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
2442 in the case of function code, since we know the declared symbol
2443 management will resolve conflicts between symbols. Yay!
2445 (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's
2446 implementation of getDeclarations is non-trivial, we can't take a
2447 short-cut here any longer -- we need to put the VarDecl node on the
2448 stack so it gets processed normally.
2450 (KJS::FunctionBodyNode::processDeclarations): Changed the order of
2451 processing to enforce mutual exclusion rules.
2454 (KJS::DeclarationStacks::DeclarationStacks): Structure includes an
2455 ExecState now, for fast access to the "arguments" property name.
2457 2007-10-24 Eric Seidel <eric@webkit.org>
2461 Add a JSGlobalObject class and remove the InterpreterMap
2462 http://bugs.webkit.org/show_bug.cgi?id=15681
2464 This required making JSCallbackObject a template class to allow for
2465 JSGlobalObjects with JSCallbackObject functionality.
2467 SunSpider claims this was a 0.5% speedup.
2469 * API/JSCallbackObject.cpp:
2471 * API/JSCallbackObject.h:
2472 * API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
2473 (KJS::::JSCallbackObject):
2475 (KJS::::~JSCallbackObject):
2476 (KJS::::initializeIfNeeded):
2478 (KJS::::getOwnPropertySlot):
2480 (KJS::::deleteProperty):
2481 (KJS::::implementsConstruct):
2483 (KJS::::implementsHasInstance):
2484 (KJS::::hasInstance):
2485 (KJS::::implementsCall):
2486 (KJS::::callAsFunction):
2487 (KJS::::getPropertyNames):
2490 (KJS::::setPrivate):
2491 (KJS::::getPrivate):
2493 (KJS::::cachedValueGetter):
2494 (KJS::::staticValueGetter):
2495 (KJS::::staticFunctionGetter):
2496 (KJS::::callbackGetter):
2497 * API/JSClassRef.cpp:
2498 (OpaqueJSClass::prototype):
2499 * API/JSContextRef.cpp:
2500 (JSGlobalContextCreate):
2501 * API/JSObjectRef.cpp:
2503 (JSObjectGetPrivate):
2504 (JSObjectSetPrivate):
2505 * API/JSValueRef.cpp:
2506 (JSValueIsObjectOfClass):
2507 * JavaScriptCore.exp:
2508 * JavaScriptCore.xcodeproj/project.pbxproj:
2509 * bindings/c/c_utility.cpp:
2510 (KJS::Bindings::convertValueToNPVariant):
2511 * bindings/jni/jni_jsobject.cpp:
2512 * bindings/objc/objc_utility.mm:
2513 (KJS::Bindings::convertValueToObjcValue):
2515 (KJS::Context::Context):
2516 * kjs/ExecState.cpp:
2517 (KJS::ExecState::lexicalInterpreter):
2518 * kjs/JSGlobalObject.h: Added.
2519 (KJS::JSGlobalObject::JSGlobalObject):
2520 (KJS::JSGlobalObject::isGlobalObject):
2521 (KJS::JSGlobalObject::interpreter):
2522 (KJS::JSGlobalObject::setInterpreter):
2523 * kjs/array_instance.cpp:
2526 (KJS::FunctionImp::callAsFunction):
2527 (KJS::GlobalFuncImp::callAsFunction):
2528 * kjs/interpreter.cpp:
2529 (KJS::Interpreter::Interpreter):
2530 (KJS::Interpreter::init):
2531 (KJS::Interpreter::~Interpreter):
2532 (KJS::Interpreter::globalObject):
2533 (KJS::Interpreter::initGlobalObject):
2534 (KJS::Interpreter::evaluate):
2535 * kjs/interpreter.h:
2537 (KJS::cacheGlobalObject):
2539 (KJS::JSObject::isGlobalObject):
2542 2007-10-24 Eric Seidel <eric@webkit.org>
2544 Build fix for Gtk, no review.
2546 * kjs/collector.cpp: #include "context.h"
2548 2007-10-24 Eric Seidel <eric@webkit.org>
2552 Stop checking isOutOfMemory after every allocation, instead let the collector
2553 notify all ExecStates if we ever hit this rare condition.
2555 SunSpider claims this was a 2.2% speedup.
2557 * kjs/collector.cpp:
2558 (KJS::Collector::collect):
2559 (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2562 (KJS::TryNode::execute):
2564 2007-10-24 Mark Rowe <mrowe@apple.com>
2568 * kjs/identifier.h: Remove extra qualification.
2570 2007-10-24 Geoffrey Garen <ggaren@apple.com>
2572 Reviewed by Sam Weinig.
2574 Disable ALWAYS_INLINE in debug builds, since it drives the debugger
2577 * wtf/AlwaysInline.h:
2579 2007-10-24 Geoffrey Garen <ggaren@apple.com>
2581 Reviewed by Sam Weinig.
2583 Inlined the fast path for creating an Identifier from an Identifier.
2585 This is a .4% speedup on SunSpider overall, but as big as a 2.5%
2586 speedup on certain individual tests. 65% of the Identifiers creating
2587 by SunSpider are already Identifiers.
2589 (The main reason I'm making this change is that it resolves a large
2590 regression in a patch I haven't checked in yet.)
2592 * JavaScriptCore.exp:
2593 * kjs/identifier.cpp:
2594 (KJS::Identifier::addSlowCase):
2596 (KJS::Identifier::Identifier::add):
2598 2007-10-24 Lars Knoll <lars@trolltech.com>
2602 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.
2604 * bindings/qt/qt_instance.cpp:
2605 (KJS::Bindings::QtInstance::invokeMethod):
2606 * bindings/qt/qt_runtime.cpp:
2607 (KJS::Bindings::convertValueToQVariant):
2608 (KJS::Bindings::QtField::setValueToInstance):
2610 2007-10-24 Oliver Hunt <oliver@apple.com>
2614 Remove old relation method, replace with specialised LessThan and lessThenEq functions for a 0.5-0.6% improvement in SunSpider
2619 (KJS::LessNode::evaluate):
2620 (KJS::GreaterNode::evaluate):
2621 (KJS::LessEqNode::evaluate):
2622 (KJS::GreaterEqNode::evaluate):
2623 * kjs/operations.cpp:
2626 2007-10-24 Eric Seidel <eric@webkit.org>
2631 (KJS::ImmediateNumberNode::): Fix ASSERT correctness (and debug build!)
2633 2007-10-24 Darin Adler <darin@apple.com>
2637 * kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little
2638 Identifier ref/deref for what SunSpider claims is a 0.4% speedup.
2640 2007-10-24 Darin Adler <darin@apple.com>
2644 - separate out the code to create a hash table the first time from the code
2647 SunSpider claims this was a 0.7% speedup.
2649 * kjs/property_map.cpp:
2650 (KJS::PropertyMap::expand): Changed to call either createTable or rehash.
2651 (KJS::PropertyMap::createTable): Added. For the case where we had no table.
2652 (KJS::PropertyMap::rehash): Removed code needed only in the case where we
2654 * kjs/property_map.h: Added createTable.
2656 2007-10-24 Eric Seidel <eric@webkit.org>
2660 Add ImmediateNumberNode to hold a JSValue* instead of a double for numbers
2661 which can be represented by JSImmediate.
2663 SunSpider claims this was a 0.6% speedup.
2667 (KJS::NumberNode::evaluate):
2668 (KJS::ImmediateNumberNode::evaluate):
2671 (KJS::ImmediateNumberNode::):
2672 * kjs/nodes2string.cpp:
2673 (ImmediateNumberNode::streamTo):
2675 2007-10-24 Darin Adler <darin@apple.com>
2679 - http://bugs.webkit.org/show_bug.cgi?id=15657
2680 change static hash tables to use powers of two for speed
2682 Seems to give 0.7% SunSpider speedup.
2684 * kjs/create_hash_table: Updated to generate new format.
2686 (KJS::keysMatch): Took out unneeded typecast.
2687 (KJS::findEntry): Updated to expect table type 3 -- changed the printf to a plain old assert.
2688 Replaced the modulus with a bit mask.
2689 (KJS::Lookup::findEntry): Get the hash directly, since we know identifiers already have computed
2690 their hash -- saves a branch.
2691 (KJS::Lookup::find): Ditto.
2692 * kjs/lookup.h: Changed attr from 2-byte value to one-byte value. Replaced hashSize with hashSizeMask.
2694 2007-10-24 Maciej Stachowiak <mjs@apple.com>
2698 - remove KJS_CHECKEXCEPTIONs in places where exceptions can't happen for 0.6% SunSpider speedup
2701 (KJS::DoWhileNode::execute):
2702 (KJS::WhileNode::execute):
2703 (KJS::ForNode::execute):
2704 (KJS::ForInNode::execute):
2705 (KJS::SourceElementsNode::execute):
2707 2007-10-23 Darin Adler <darin@apple.com>
2711 * kjs/JSImmediate.h: (KJS::JSImmediate::getUInt32):
2712 Changed an && to an & for a 1% gain in SunSpider.
2714 2007-10-23 Oliver Hunt <oliver@apple.com>
2718 Reduce branching in implementations of some operator implementations, yielding 1.3% boost to SunSpider.
2721 (KJS::MultNode::evaluate):
2722 (KJS::DivNode::evaluate):
2723 (KJS::ModNode::evaluate):
2726 (KJS::AddNode::evaluate):
2727 (KJS::SubNode::evaluate):
2728 (KJS::valueForReadModifyAssignment):
2729 * kjs/operations.cpp:
2732 2007-10-23 Oliver Hunt <oliver@apple.com>
2736 Separating all of the simple (eg. non-read-modify-write) binary operators
2737 into separate classes in preparation for further JS optimisations.
2739 Happily this produces a 0.8% to 1.0% performance increase in SunSpider with
2742 * JavaScriptCore.xcodeproj/project.pbxproj:
2745 (KJS::MultNode::evaluate):
2746 (KJS::DivNode::evaluate):
2747 (KJS::ModNode::evaluate):
2748 (KJS::AddNode::evaluate):
2749 (KJS::SubNode::evaluate):
2750 (KJS::LeftShiftNode::evaluate):
2751 (KJS::RightShiftNode::evaluate):
2752 (KJS::UnsignedRightShiftNode::evaluate):
2753 (KJS::LessNode::evaluate):
2754 (KJS::GreaterNode::evaluate):
2755 (KJS::LessEqNode::evaluate):
2756 (KJS::GreaterEqNode::evaluate):
2757 (KJS::InstanceOfNode::evaluate):
2758 (KJS::InNode::evaluate):
2759 (KJS::EqualNode::evaluate):
2760 (KJS::NotEqualNode::evaluate):
2761 (KJS::StrictEqualNode::evaluate):
2762 (KJS::NotStrictEqualNode::evaluate):
2763 (KJS::BitAndNode::evaluate):
2764 (KJS::BitXOrNode::evaluate):
2765 (KJS::BitOrNode::evaluate):
2766 (KJS::LogicalAndNode::evaluate):
2767 (KJS::LogicalOrNode::evaluate):
2774 (KJS::LeftShiftNode::):
2775 (KJS::RightShiftNode::):
2776 (KJS::UnsignedRightShiftNode::):
2778 (KJS::GreaterNode::):
2779 (KJS::LessEqNode::):
2780 (KJS::GreaterEqNode::):
2781 (KJS::InstanceOfNode::):
2784 (KJS::NotEqualNode::):
2785 (KJS::StrictEqualNode::):
2786 (KJS::NotStrictEqualNode::):
2787 (KJS::BitAndNode::):
2789 (KJS::BitXOrNode::):
2790 (KJS::LogicalAndNode::):
2791 (KJS::LogicalOrNode::):
2792 * kjs/nodes2string.cpp:
2793 (MultNode::streamTo):
2794 (DivNode::streamTo):
2795 (ModNode::streamTo):
2796 (AddNode::streamTo):
2797 (SubNode::streamTo):
2798 (LeftShiftNode::streamTo):
2799 (RightShiftNode::streamTo):
2800 (UnsignedRightShiftNode::streamTo):
2801 (LessNode::streamTo):
2802 (GreaterNode::streamTo):
2803 (LessEqNode::streamTo):
2804 (GreaterEqNode::streamTo):
2805 (InstanceOfNode::streamTo):
2807 (EqualNode::streamTo):
2808 (NotEqualNode::streamTo):
2809 (StrictEqualNode::streamTo):
2810 (NotStrictEqualNode::streamTo):
2811 (BitAndNode::streamTo):
2812 (BitXOrNode::streamTo):
2813 (BitOrNode::streamTo):
2814 (LogicalAndNode::streamTo):
2816 2007-10-23 Darin Adler <darin@apple.com>
2820 - fix http://bugs.webkit.org/show_bug.cgi?id=15639
2821 fix Math.abs(0), Math.ceil(-0), and Math.floor(-0)
2823 Test: fast/js/math.html
2825 * kjs/math_object.cpp: (MathFuncImp::callAsFunction):
2826 Fix abs to look at the sign bit. Add a special case for values in the range
2827 between -0 and -1 and a special case for ceil and for -0 for floor.
2829 2007-10-23 Darin Adler <darin@apple.com>
2833 - streamline exception handling code for a >1% speed-up of SunSpider
2835 * kjs/nodes.cpp: Changed macros to use functions for everything that's not
2836 part of normal execution. We'll take function call overhead when propagating
2837 an exception or out of memory.
2838 (KJS::createOutOfMemoryCompletion): Added.
2839 (KJS::substitute): Use append instead of the relatively inefficient + operator.
2840 (KJS::Node::rethrowException): Added.
2841 * kjs/nodes.h: Added rethrowException.
2843 2007-10-22 Darin Adler <darin@apple.com>
2847 - fix http://bugs.webkit.org/show_bug.cgi?id=15636
2848 some JavaScriptCore regression tests are failing due to numeric conversion
2850 This should restore correctness and make speed better too, restoring some
2851 of the optimization we lost in my last check-in.
2853 * kjs/JSImmediate.h:
2854 (KJS::JSImmediate::getTruncatedInt32): Added. Uses the range checking idiom
2855 I used in my patch yesterday.
2856 (KJS::JSImmediate::getTruncatedUInt32): Ditto.
2858 * kjs/internal.h: Removed getInt32 and added getTruncatedInt/UInt32.
2860 (KJS::NumberImp::getUInt32): Changed to always use double, since I can't find
2861 a way to write this more efficiently for float.
2862 (KJS::NumberImp::getTruncatedInt32): Added.
2863 (KJS::NumberImp::getTruncatedUInt32): Added.
2865 * kjs/value.h: Removed getInt32 and added getTruncatedInt/UInt32.
2866 (KJS::JSValue::getUInt32):
2867 (KJS::JSValue::getTruncatedInt32): Added.
2868 (KJS::JSValue::getTruncatedUInt32): Added.
2869 (KJS::JSValue::toInt32): Changed getInt32 call to getTruncatedInt32.
2870 (KJS::JSValue::toUInt32): Changed getUInt32 call to getTruncatedUInt32.
2872 (KJS::JSCell::getTruncatedInt32): Added.
2873 (KJS::JSCell::getTruncatedUInt32): Added.
2874 (KJS::JSValue::toInteger): Changed getUInt32 call to getTruncatedInt32.
2875 (KJS::JSValue::toInt32SlowCase): Removed extra getInt32 call I accidentally
2877 (KJS::JSValue::toUInt32SlowCase): Ditto.
2878 (KJS::JSValue::toUInt16): Changed getUInt32 call to getTruncatedUInt32.
2880 * JavaScriptCore.exp: Updated.
2882 2007-10-22 Darin Adler <darin@apple.com>
2886 - fix http://bugs.webkit.org/show_bug.cgi?id=15632
2887 js1_5/Array/array-001.js test failing
2889 One of the JavaScriptCore tests was failing; it failed because of
2890 my change to NumberImp::getUInt32. The incorrect code I copied was
2891 from JSImmediate::getUInt32, and was a pre-existing bug.
2893 This patch fixes correctness, but will surely slow down SunSpider.
2894 We may be able to code this tighter and get the speed back.
2896 * kjs/JSImmediate.h:
2897 (KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
2898 reflect the fact that this function only returns true if the value is
2899 accurate (no fractional part, etc.). Changed code so that it returns
2900 false when the value has a fraction.
2901 (KJS::JSImmediate::getUInt32): Ditto.
2904 (KJS::NumberImp::getInt32): Changed code so that it returns false when
2905 the value has a fraction. Restores the old behavior.
2906 (KJS::NumberImp::getUInt32): Ditto.
2909 (KJS::JSValue::getInt32): Updated for name change.
2910 (KJS::JSValue::getUInt32): Ditto.
2911 (KJS::JSValue::toInt32): Ditto.
2912 (KJS::JSValue::toUInt32): Ditto.
2914 2007-10-22 Darin Adler <darin@apple.com>
2918 - fix crash seen when running JavaScriptCore tests
2920 * kjs/array_instance.cpp: (KJS::ArrayInstance::mark):
2921 Copy and paste error: I accidentally had code here that was
2922 making a copy of the HashMap -- that's illegal inside a mark
2923 function and was unnecessary. The other callsite was modifying
2924 the map as it iterated it, but this function is not.
2926 2007-10-22 Maciej Stachowiak <mjs@apple.com>
2930 - Avoid moving floats into integer registers in jsNumber() for 3% speedup on SunSpider
2931 http://bugs.webkit.org/show_bug.cgi?id=15627
2933 * kjs/JSImmediate.h:
2934 (KJS::JSImmediate::fromDouble): Avoid moving floats to integer
2935 registers since this is very slow.
2937 2007-10-22 Darin Adler <darin@apple.com>
2939 Reviewed by Eric Seidel.
2941 - http://bugs.webkit.org/show_bug.cgi?id=15617
2942 improve speed of integer conversions
2944 Makes SunSpider 6% faster.
2946 * kjs/JSImmediate.h: Added toInt32 and toUInt32, with separate versions for
2949 (KJS::JSValue::getUInt32): Call JSImmediate::toUInt32.
2951 * kjs/internal.h: Added getInt32.
2953 (KJS::NumberImp::getInt32): Added.
2954 (KJS::NumberImp::getUInt32): Replaced with more-optimal implementation
2955 stolen from JSValue.
2958 (KJS::jsNumber): Marked ALWAYS_INLINE, because this wasn't getting
2960 (KJS::JSValue::getInt32): Added.
2961 (KJS::JSValue::getUInt32): Changed to call the new JSImmediate::toUInt32
2962 to avoid converting from float to double.
2963 (KJS::JSValue::toInt32): Made inline, separated out the slow case.
2964 (KJS::JSValue::toUInt32): Ditto.
2966 (KJS::JSCell::getInt32): Added.
2967 (KJS::JSValue::toInt32SlowCase): Renamed from toInt32. Changed to use the
2968 new getInt32. Added a faster case for in-range numbers.
2969 (KJS::JSValue::toUInt32SlowCase): Ditto.
2970 (KJS::JSValue::toUInt16): Added a faster case for in-range numbers.
2972 * JavaScriptCore.exp: Updated for changes.
2974 2007-10-22 Adam Roben <aroben@apple.com>
2978 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn off
2979 warning about implicit conversion to bool.
2981 2007-10-22 Mark Rowe <mrowe@apple.com>
2985 * kjs/array_instance.cpp:
2987 2007-10-22 Darin Adler <darin@apple.com>
2991 - http://bugs.webkit.org/show_bug.cgi?id=15606
2992 make cut-off for sparse vs. dense arrays smarter for speed with large arrays
2994 Makes the morph test in SunSpider 26% faster, and the overall
2995 benchmark 3% faster.
2997 This also fixes some small problems we had with the distinction
2998 between nonexistent and undefined values in arrays.
3000 * kjs/array_instance.h: Tweaked formatting and naming.
3001 * kjs/array_instance.cpp: Copied from kjs/array_object.cpp.
3002 (KJS::storageSize): Added. Computes the size of the storage given a vector length.
3003 (KJS::increasedVectorLength): Added. Implements the rule for resizing the vector.
3004 (KJS::isDenseEnoughForVector): Added.
3005 (KJS::ArrayInstance::ArrayInstance): Initialize the new fields.
3006 (KJS::ArrayInstance::~ArrayInstance): Since m_storage is now never 0, delete it.
3007 (KJS::ArrayInstance::getItem): Updated for name changes.
3008 (KJS::ArrayInstance::lengthGetter): Ditto.
3009 (KJS::ArrayInstance::inlineGetOwnPropertySlot): Added. Allows both versions of
3010 getOwnPropertySlot to share more code.
3011 (KJS::ArrayInstance::getOwnPropertySlot): Just refactored, no code change.
3012 (KJS::ArrayInstance::put): Added logic for extending the vector as long as the
3013 array is dense enough. Also keep m_numValuesInVector up to date.
3014 (KJS::ArrayInstance::deleteProperty): Added code to keep m_numValuesInVector
3016 (KJS::ArrayInstance::getPropertyNames): Fixed bug where this would omit names
3017 for array indices with undefined values.
3018 (KJS::ArrayInstance::increaseVectorLength): Renamed from resizeStorage. Also
3019 simplified to only handle getting larger.
3020 (KJS::ArrayInstance::setLength): Added code to update m_numValuesInVector, to
3021 zero out the unused part of the vector and to delete the map if it's no longer
3023 (KJS::ArrayInstance::mark): Tweaked formatting.
3024 (KJS::compareByStringForQSort): Ditto.
3025 (KJS::ArrayInstance::sort): Ditto.
3026 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
3028 (KJS::compareWithCompareFunctionForQSort): Ditto.
3029 (KJS::ArrayInstance::compactForSorting): Fixed bug where this would turn
3030 undefined values into nonexistent values in some cases.
3032 * kjs/array_object.h: Removed MAX_ARRAY_INDEX.
3033 * kjs/array_object.cpp: Removed ArrayInstance. Moved to a separate file.
3035 * JavaScriptCore.pri: Added array_instance.cpp.
3036 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3037 * kjs/AllInOneFile.cpp: Ditto.
3039 2007-10-22 Andrew Wellington <proton@wiretapped.net>
3041 Reviewed by Mark Rowe.
3043 Fix for local database support after r26879
3044 Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set
3046 * Configurations/JavaScriptCore.xcconfig:
3048 2007-10-22 Simon Hausmann <hausmann@kde.org>
3052 Build fix for the non-qmake builds.
3054 * wtf/Platform.h: Default to enabling the database features unless
3055 otherwise specified. (similar to ENABLE_ICONDATABASE)
3057 2007-10-22 Holger Freyther <zecke@selfish.org>
3059 Reviewed by Simon Hausmann <hausmann@kde.org>.
3061 * Do not build testkjs as an application bundle. This is
3062 needed for run-javascriptcore-tests on OSX.
3063 * Also, based on r26633, allow to test the WebKit/Qt port on OSX.
3064 * Set DYLD_LIBRARY_PATH if it was set in the environment. It must be set
3065 as we do not have -rpath on OSX.
3069 2007-10-21 Mark Rowe <mrowe@apple.com>
3073 http://bugs.webkit.org/show_bug.cgi?id=15575
3074 Bug 15575: [GTK] Implement threading using GThread
3076 * wtf/Platform.h: Do not enable pthreads for Gtk.
3078 2007-10-21 Mark Rowe <mrowe@apple.com>
3082 Fix http://bugs.webkit.org/show_bug.cgi?id=15603
3083 Bug 15603: Regression(r26847): Crash when sorting an empty array from JavaScript
3085 * kjs/array_object.cpp:
3086 (KJS::freeStorage): Reinstate null-check that was removed in r26847.
3088 2007-10-21 Darin Adler <darin@apple.com>
3092 * kjs/array_instance.h: Removed unused ExecState parameter.
3093 * kjs/array_object.cpp:
3094 (KJS::ArrayInstance::put): Ditto.
3095 (KJS::ArrayInstance::setLength): Ditto.
3097 2007-10-21 Darin Adler <darin@apple.com>
3099 * kjs/array_object.cpp: (KJS::ArrayInstance::put):
3100 Add missing assignment that was causing regression test crash.
3102 2007-10-21 Darin Adler <darin@apple.com>
3106 - http://bugs.webkit.org/show_bug.cgi?id=15585
3107 speed up sparse arrays by using a custom map
3109 Speeds up SunSpider by 10%.
3111 * kjs/array_object.cpp:
3112 (allocateStorage): Leave room for an additional pointer.
3113 (reallocateStorage): Ditto.
3114 (freeStorage): Ditto.
3115 (ArrayInstance::~ArrayInstance): Delete the overflow map if present.
3116 (ArrayInstance::getItem): Read values from the overflow map if present.
3117 Removed the check of length, since it slows down the common case.
3118 (ArrayInstance::getOwnPropertySlot): Ditto. Also removed the fallback
3119 to the property map.
3120 (ArrayInstance::put): Write values into the overflow map as needed.
3121 Also create overflow map when needed.
3122 (ArrayInstance::deleteProperty): Remove values from the overflow map
3124 (ArrayInstance::getPropertyNames): Add a name for each identifier in
3125 the property map. This is extremely inefficient.
3126 (ArrayInstance::setLength): Remove any values in the overflow map
3127 that are past the new length, as we formerly did with the property map.
3128 (ArrayInstance::mark): Mark any values in the overflow map.
3129 (compareByStringForQSort): Removed unneeded undefined case, since
3130 compactForSorting guarantees we will have no undefined values.
3131 (compareWithCompareFunctionForQSort): Ditto.
3132 (ArrayInstance::compactForSorting): Copy all the values out of the
3133 overflow map and destroy it.
3135 * kjs/property_map.h: Removed now-unused getSparseArrayPropertyNames.
3136 * kjs/property_map.cpp: Ditto.
3138 2007-10-20 Darin Adler <darin@apple.com>
3142 - http://bugs.webkit.org/show_bug.cgi?id=15579
3143 stop churning identifier reference counts copying Completion objects
3145 * kjs/completion.h: Replace the Identifier with an Identifier*.
3147 (ForInNode::execute): Update for change to Completion constructor.
3148 (ContinueNode::execute): Ditto.
3149 (BreakNode::execute): Ditto.
3151 2007-10-20 Mark Rowe <mrowe@apple.com>
3155 Gtk changes needed to enable HTML 5 client-side database storage.
3157 * wtf/Platform.h: Have Gtk use pthreads for now.
3159 2007-10-20 Geoffrey Garen <ggaren@apple.com>
3161 Reviewed by Maciej Stachowiak.
3163 Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
3164 Store gathered declaration nodes in the function body node.
3166 This means that you only have to gather the declaration nodes the first
3167 time the function executes. Performance gain of 2.10% on SunSpider,
3168 0.90% on command-line JS iBench.
3170 * kjs/nodes.cpp: Split declaration stack initialization code off into
3171 initializeDeclarationStacks().
3172 (FunctionBodyNode::FunctionBodyNode):
3173 (FunctionBodyNode::initializeDeclarationStacks):
3174 (FunctionBodyNode::processDeclarations):
3176 * kjs/nodes.h: Changed DeclarationStacks structure to hold references,
3177 since the actual Vectors are now stored either on the stack or in the
3180 2007-10-19 Geoffrey Garen <ggaren@apple.com>
3182 Reviewed by Darin Adler.
3184 http://bugs.webkit.org/show_bug.cgi?id=15559
3185 Moved processDeclarations call into FunctionBodyNode::execute
3187 To improve encapsulation, moved processDeclarations call into
3188 FunctionBodyNode::execute. Also marked processDeclarations
3189 ALWAYS_INLINE, since it has only 1 caller now. This is a .71% speedup
3190 on command-line JS iBench.
3193 (KJS::FunctionImp::callAsFunction):
3194 (KJS::GlobalFuncImp::callAsFunction):
3196 * kjs/interpreter.cpp:
3197 (KJS::Interpreter::evaluate):
3199 (FunctionBodyNode::execute):
3202 2007-10-19 Brady Eidson <beidson@apple.com>
3206 Queue -> Deque! and small style tweaks
3208 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3209 * JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
3210 * wtf/Deque.h: Added.
3211 (WTF::DequeNode::DequeNode):
3212 (WTF::Deque::Deque):
3213 (WTF::Deque::~Deque):
3215 (WTF::Deque::isEmpty):
3216 (WTF::Deque::append):
3217 (WTF::Deque::prepend):
3218 (WTF::Deque::first):
3220 (WTF::Deque::removeFirst):
3221 (WTF::Deque::clear):
3222 * wtf/Queue.h: Removed.
3225 2007-10-19 Brady Eidson <beidson@apple.com>
3229 Added a simple LinkedList based Queue to wtf
3230 We can make a better, more sophisticated an efficient one later, but have
3231 needed one for some time, now!
3233 * JavaScriptCore.xcodeproj/project.pbxproj:
3234 * wtf/Queue.h: Added.
3235 (WTF::QueueNode::QueueNode):
3236 (WTF::Queue::Queue):
3237 (WTF::Queue::~Queue):
3239 (WTF::Queue::isEmpty):
3240 (WTF::Queue::append):
3241 (WTF::Queue::prepend):
3242 (WTF::Queue::first):
3244 (WTF::Queue::removeFirst):
3245 (WTF::Queue::clear):
3247 2007-10-19 Nikolas Zimmermann <zimmermann@kde.org>
3251 Try to fix Qt/Win build slave, by including windows.h also on Qt/Win.
3253 * kjs/testkjs.cpp: Change PLATFORM(WIN) to PLATFORM(WIN_OS)
3255 2007-10-19 Simon Hausmann <hausmann@kde.org>
3259 Fix compilation on Windows when wchar_t is a typedef instead of a native type (triggered by -Zc:wchar_t-).
3260 Don't provide the wchar_t overloads then as they conflict with the unsigned short ones.
3263 (WTF::isASCIIAlpha):
3264 (WTF::isASCIIAlphanumeric):
3265 (WTF::isASCIIDigit):
3266 (WTF::isASCIIHexDigit):
3267 (WTF::isASCIILower):
3268 (WTF::isASCIISpace):
3269 (WTF::toASCIILower):
3270 (WTF::toASCIIUpper):
3272 2007-10-19 Simon Hausmann <hausmann@kde.org>
3276 Another build fix for the windows/qt build: Apply the same fix as in revision 26686 also to kjs/config.h to disable the disallowctype feature.
3280 2007-10-18 Maciej Stachowiak <mjs@apple.com>
3284 - use __declspec(thread) for fast thread-local storage on Windows
3286 - 2.2% speedup on sunspider (on Windows)
3287 - 7% speedup on the string section
3288 - 6% speedup on JS iBench
3290 - fixed <rdar://problem/5473084> PLT on Windows got 2.5% slower between r25406 and r25422
3291 - fixed at least some of <rdar://5527965? i-Bench JS was 14% slower in 310A11 than 310A10
3294 * wtf/FastMalloc.cpp:
3295 (WTF::getThreadHeap):
3296 (WTF::setThreadHeap):
3297 (WTF::TCMalloc_ThreadCache::GetCache):
3298 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
3299 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3301 2007-10-17 Darin Adler <darin@apple.com>
3303 Reviewed by Mark Rowe.
3305 - fix http://bugs.webkit.org/show_bug.cgi?id=15543
3306 <rdar://problem/5545639> REGRESSION (r26697):
3307 GoogleDocs: Can't create new documents or open existing ones
3309 Test: fast/js/regexp-non-character.html
3311 * pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
3312 in the \u sequences -- not needed and actively harmful.
3314 2007-10-17 Anders Carlsson <andersca@apple.com>
3319 #define USE_PTHREADS on Mac.
3321 2007-10-17 Geoffrey Garen <ggaren@apple.com>
3323 Reviewed by Darin Adler.
3325 Merged DeclaredFunctionImp into FunctionImp (the base class) because
3326 the distinction between the two was unused.
3328 Removed codeType() from FunctionImp because FunctionImp and its
3329 subclasses all returned FunctionCode, so it was unused, practically
3332 Removed a different codeType() from GlobalFuncImp because it was unused.
3333 (Perhaps it was vestigial from a time when GlobalFuncImp used to
3334 inherit from FunctionImp.)
3336 * bindings/runtime_method.cpp:
3337 * bindings/runtime_method.h:
3340 (KJS::FunctionImp::FunctionImp):
3341 (KJS::FunctionImp::callAsFunction):
3342 (KJS::FunctionImp::construct):
3343 (KJS::FunctionImp::execute):
3344 (KJS::FunctionImp::processVarDecls):
3346 (KJS::FunctionImp::implementsConstruct):
3347 (KJS::FunctionImp::scope):
3348 * kjs/function_object.cpp:
3349 (FunctionProtoFunc::callAsFunction):
3350 (FunctionObjectImp::construct):
3352 (FuncDeclNode::processFuncDecl):
3353 (FuncExprNode::evaluate):
3355 2007-10-17 Adam Roben <aroben@apple.com>
3357 Windows build fix part 2.
3359 Fix was by Darin, reviewed by Anders and Adam.
3361 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
3362 FastMallocPCRE.cpp to the project, and let Visual Studio have its way
3363 with the post-build step.
3364 * pcre/pcre.h: Don't DLL export the entry points just because this
3365 is Win32 -- this is an internal copy of PCRE and should be private.
3366 * pcre/pcre_compile.c: Fix an uninitialized variable warning --
3367 there's no real problem but it's better to quiet the compiler by
3368 tweaking the code slightly than turn off the warning entirely.
3370 2007-10-17 Adam Roben <aroben@apple.com>
3376 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
3377 some mismatched signed/unsigned comparison warnings.
3379 (match): #if-out some labels that don't seem to exist.
3381 2007-10-17 Mark Rowe <mrowe@apple.com>
3385 * JavaScriptCore.pri: Add FastMallocPCRE.cpp.
3386 * pcre/pcre_get. #if out two functions that depend on pcre_get_stringnumber, which
3387 is currently unavailable for UTF-16.
3389 2007-10-16 Darin Adler <darin@apple.com>
3393 - merged PCRE changes between 6.4 and 6.5
3395 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3396 * JavaScriptCore.xcodeproj/project.pbxproj:
3397 Removed pcre_config.c, pcre_globals.c, pcre_info.c, pcre_maketables.c,
3398 pcre_printint.src, pcre_refcount.c, pcre_study.c, pcre_try_flipped.c,
3399 pcre_ucp_findchar.c, pcre_version.c, and ucptable.c. Added pcre_ucp_searchfuncs.c.
3405 * pcre/pcre-config.h:
3408 * pcre/pcre_compile.c:
3410 * pcre/pcre_fullinfo.c:
3412 * pcre/pcre_internal.h:
3413 * pcre/pcre_maketables.c:
3414 * pcre/pcre_ord2utf8.c:
3415 * pcre/pcre_tables.c:
3416 * pcre/pcre_ucp_searchfuncs.c: Copied from pcre/pcre_ucp_findchar.c.
3417 * pcre/pcre_xclass.c:
3419 * pcre/ucpinternal.h:
3421 Updated with new versions from the PCRE 6.5 release, merged with changes.
3423 * pcre/pcre_config.c: Removed.
3424 * pcre/pcre_globals.c: Removed.
3425 * pcre/pcre_info.c: Removed.
3426 * pcre/pcre_printint.src: Removed.
3427 * pcre/pcre_refcount.c: Removed.
3428 * pcre/pcre_study.c: Removed.
3429 * pcre/pcre_try_flipped.c: Removed.
3430 * pcre/pcre_ucp_findchar.c: Removed.
3431 * pcre/pcre_version.c: Removed.
3433 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3435 Reviewed by Darin Adler.
3437 Removed KJS_VERBOSE because it was getting in the way of readability,
3438 and the messages didn't seem very helpful.
3441 (KJS::FunctionImp::callAsFunction):
3442 (KJS::FunctionImp::passInParameters):
3446 (KJS::JSObject::put):
3449 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3451 Reviewed by Darin Adler.
3453 Removed the Parameter class because it was a redundant wrapper around
3457 (KJS::FunctionImp::passInParameters):
3458 (KJS::FunctionImp::getParameterName):
3460 (FunctionBodyNode::addParam):
3462 (KJS::FunctionBodyNode::):
3464 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3466 Reviewed by Darin Adler.
3468 Global replace of assert with ASSERT.
3470 2007-10-16 Adam Roben <aroben@apple.com>
3472 Make testkjs not delay-load WebKit
3474 Soon, delay-loading WebKit will be impossible (because we will be
3475 using __declspec(thread) for thread-local storage). This change
3476 prepares testkjs for the future.
3480 * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed WebKitInitializer,
3482 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Don't link against
3483 WebKitInitializer, don't delay-load WebKit.
3484 * kjs/testkjs.cpp: Don't use WebKitInitializer.
3486 2007-10-16 Adam Roben <aroben@apple.com>
3488 Updated testkjs for the rename of WebKit_debug.dll to WebKit.dll for the Debug configuration
3490 Reviewed by Kevin McCullough.
3492 * JavaScriptCore.vcproj/debug.vsprops: Added WebKitDLLConfigSuffix.
3493 * JavaScriptCore.vcproj/debug_internal.vsprops: Ditto.
3494 * JavaScriptCore.vcproj/release.vsprops: Ditto.
3495 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Use
3496 WebKitDLLConfigSuffix when referring to WebKit.dll, and fixed a typo
3497 in the name of icuuc36[_debug].dll.
3499 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3501 Reviewed by Maciej Stachowiak.
3503 Re-structured variable and function declaration code.
3505 Command-line JS iBench shows no regression.
3507 Here are the changes:
3509 1. Function declarations are now processed at the same time as var
3510 declarations -- namely, immediately upon entry to an execution context.
3511 This does not match Firefox, which waits to process a function
3512 declaration until the declaration's containing block executes, but it
3513 does match IE and the ECMA spec. (10.1.3 states that var and function
3514 declarations should be processed at the same time -- namely, "On
3515 entering an execution context." 12.2 states that "A Block does not
3516 define a new execution scope.")
3518 2. Declaration processing proceeds iteratively now, rather than
3519 recursively, storing the nodes is finds in stacks. This will later
3520 facilitate an optimization to hold on to the gathered declaration nodes,
3521 rather than re-fetching them in every function call.
3522 [ http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3524 Modified these tests because they expected the incorrect Mozilla
3525 behavior described above:
3527 * tests/mozilla/ecma_3/Function/scope-001.js:
3528 * tests/mozilla/js1_5/Scope/regress-184107.js:
3530 2007-10-16 Darin Adler <darin@apple.com>
3532 - try to fix the GTK build
3534 * kjs/ustring.cpp: Include ASCIICType.h, not ASCIICtype.h.
3536 2007-10-16 Darin Adler <darin@apple.com>
3538 - try to fix the Windows build
3540 * kjs/date_object.cpp: (KJS::parseDate): A couple instances of isspace were
3541 in here. Not sure why it wasn't failing elsewhere. Changed to isASCIISpace.
3543 2007-10-16 Darin Adler <darin@apple.com>
3545 - try to fix the GTK build
3547 * kjs/ustring.cpp: Include ASCIICType.h.
3549 2007-10-16 Darin Adler <darin@apple.com>
3551 Reviewed by Maciej and Geoff (and looked over by Eric).
3553 - http://bugs.webkit.org/show_bug.cgi?id=15519
3554 eliminate use of <ctype.h> for processing ASCII
3556 * wtf/ASCIICType.h: Added.
3557 * wtf/DisallowCType.h: Added.
3559 * kjs/config.h: Include DisallowCType.h.
3561 * kjs/date_object.cpp:
3562 (KJS::skipSpacesAndComments):
3568 (KJS::UString::toDouble):
3569 Use ASCIICType.h functions instead of ctype.h ones.
3571 2007-10-14 Maciej Stachowiak <mjs@apple.com>
3575 - fixes for "New JavaScript benchmark"
3576 http://bugs.webkit.org/show_bug.cgi?id=15515
3579 (TestFunctionImp::callAsFunction): Implement "load" for compatibility
3581 (TestFunctionImp::): ditto
3583 (kjsmain): Drop useless --> from output.
3585 2007-10-15 Geoffrey Garen <ggaren@apple.com>
3587 Removed unnecessary #include.
3589 * API/JSObjectRef.cpp:
3591 2007-10-15 Geoffrey Garen <ggaren@apple.com>
3593 Double-reverse build fix. My tree was out of date.
3596 (NumberNode::evaluate):
3598 2007-10-15 Geoffrey Garen <ggaren@apple.com>
3603 (NumberNode::evaluate):
3605 2007-10-15 Geoffrey Garen <ggaren@apple.com>
3607 Reviewed by Darin Adler.
3609 Removed surprising self-named "hack" that made nested functions
3610 available as named properties of their containing functions, and placed
3611 containing function objects in the scope chains of nested functions.
3613 There were a few reasons to remove this "hack:"
3615 1. It contradicted FF, IE, and the ECMA spec.
3617 2. It incurred a performance penalty, since merely parsing a function
3618 required parsing its body for nested functions (and so on).
3620 3. SVN history contains no explanation for why it was added. It was just
3621 legacy code in a large merge a long, long time ago.
3623 [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3626 (FuncDeclNode::processFuncDecl):
3628 2007-10-15 Geoffrey Garen <ggaren@apple.com>
3630 Reviewed by Darin Adler.
3632 Removed the concept of AnonymousCode. It was unused, and it doesn't
3633 exist in the ECMA spec.
3635 [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3638 (KJS::Context::Context):
3642 (ReturnNode::execute):
3644 2007-10-15 Geoffrey Garen <ggaren@apple.com>
3646 Reviewed by Darin Adler.
3648 Made function parameters DontDelete. This matches FF and the vague
3649 description in ECMA 10.1.3. It's also required in order to make
3650 symbol table based lookup of function parameters valid. (If the
3651 parameters aren't DontDelete, you can't guarantee that you'll find
3652 them later in the symbol table.)
3654 [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3657 (KJS::FunctionImp::passInParameters):
3659 2007-10-15 Geoffrey Garen <ggaren@apple.com>
3661 Reviewed by Maciej Stachowiak.
3663 Some Vector optimizations. These are especially important when using
3664 Vector as a stack for implementing recursive algorithms iteratively.
3666 [ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3668 1. Added shrink(), which is a version of resize() that you can call
3669 to save a branch / improve code generation and inlining when you know
3670 that the vector is not getting bigger.
3672 2. Changed subclassing relationship in VectorBuffer to remove a call to
3673 fastFree() in the destructor for the inlineCapacity != 0 template
3674 specialization. This brings inline Vectors one step closer to true
3675 stack-allocated arrays.
3677 Also changed abort() to CRASH(), since the latter works better.
3680 (WTF::VectorBufferBase::allocateBuffer):
3681 (WTF::VectorBufferBase::deallocateBuffer):
3682 (WTF::VectorBufferBase::VectorBufferBase):
3683 (WTF::VectorBufferBase::~VectorBufferBase):
3685 (WTF::VectorBuffer::VectorBuffer):
3686 (WTF::VectorBuffer::~VectorBuffer):
3687 (WTF::VectorBuffer::deallocateBuffer):
3688 (WTF::VectorBuffer::releaseBuffer):
3689 (WTF::Vector::clear):
3690 (WTF::Vector::removeLast):
3695 2007-10-12 Geoffrey Garen <ggaren@apple.com>
3697 Reviewed by Maciej Stachowiak.
3699 Fixed http://bugs.webkit.org/show_bug.cgi?id=15490
3700 Iteration statements sometimes incorrectly evaluate to the empty value
3703 [ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3705 This patch is a merge of KDE r670547, with substantial modification
3708 It fixes do-while statements to evaluate to a value. (They used
3709 to evaluate to the empty value in all cases.)
3711 It also fixes SourceElementsNode to maintain the value of abnormal
3712 completions like "break" and "continue."
3714 It also re-works the main execution loop in SourceElementsNode so that
3715 it (1) makes a little more sense and (2) avoids unnecessary work. This
3716 is a .28% speedup on command-line JS iBench.
3719 (DoWhileNode::execute):
3720 (SourceElementsNode::execute):
3722 2007-10-15 Simon Hausmann <hausmann@kde.org>
3726 Fix compilation with gcc 4.3 by including 'limits' due to the use of std::numeric_limits.
3730 2007-10-5 Kevin Ollivier <kevino@theolliviers.com>
3734 Add support for MSVC7, and fix cases where PLATFORM(WIN) should
3735 be PLATFORM(WIN_OS) for other ports building on Windows.
3738 (KJS::getDSTOffsetSimple):
3739 * kjs/JSImmediate.h:
3740 * wtf/Assertions.cpp:
3743 * wtf/StringExtras.h:
3747 2007-10-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3751 Adds NegateNode optimization from KJS. The relevant revision in KDE
3756 (NumberNode::evaluate):
3759 (KJS::NumberNode::):
3760 * kjs/nodes2string.cpp:
3761 (NumberNode::streamTo):
3763 2007-10-14 Jason Foreman <jason@threeve.org>
3767 Fix http://bugs.webkit.org/show_bug.cgi?id=15145
3769 Ensure that if adjusting n to minimize the difference of n*intPow10(e-p+1) to x,
3770 that the property n < intPow10(p) is maintained.
3772 * kjs/number_object.cpp:
3773 (NumberProtoFunc::callAsFunction):
3775 == Rolled over to ChangeLog-2007-10-14 ==