1 2007-11-05 Mark Rowe <mrowe@apple.com>
5 * kjs/array_object.cpp:
6 (KJS::ArrayProtoFunc::callAsFunction):
8 2007-11-05 Adam Roben <aroben@apple.com>
14 2007-11-05 Mark Rowe <mrowe@apple.com>
16 Build fix. Add missing #include.
20 2007-11-05 Eric Seidel <eric@webkit.org>
24 Remove another call to toString(exec)
26 SunSpider claims this is a 0.5% speedup.
29 (KJS::equal): remove another toString
31 2007-11-05 Eric Seidel <eric@webkit.org>
34 (KJS::equal): correct broken change.
36 2007-11-05 Eric Seidel <eric@webkit.org>
40 Remove one more call to toString(exec).
42 SunSpider claims this is a 0.7% speedup.
45 (KJS::equal): remove a call to toString()
47 2007-11-05 Mark Rowe <mrowe@apple.com>
53 2007-11-05 Mark Rowe <mrowe@apple.com>
59 2007-11-05 Geoffrey Garen <ggaren@apple.com>
61 Touched a file to test my new HTTP access.
63 * kjs/scope_chain.cpp:
65 2007-11-05 Alp Toker <alp@atoker.com>
67 Unreviewed build fix for qmake-based ports.
69 Someone with a better understanding of qmake still needs to sort out
70 the INCLUDEPATH/DEPENDPATH mess.
74 2007-11-05 Geoffrey Garen <ggaren@apple.com>
76 Reviewed by Darin Adler.
78 http://bugs.webkit.org/show_bug.cgi?id=15835
80 Switched List implementation from a custom heap allocator to an inline
81 Vector, for a disappointing .5% SunSpider speedup.
83 Also renamed List::slice to List::getSlice because "get" is the
84 conventional prefix for functions returning a value through an out
87 * kjs/array_object.cpp:
88 (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
89 calls and memory accesses.
91 * kjs/bool_object.cpp:
92 (BooleanObjectImp::construct): Removed questionable use of iterator.
95 * kjs/list.h: New List class, implemented in terms of Vector. Two
96 interesting differences:
97 1. The inline capacity is 8, not 5. Many of the Lists constructed
98 during a SunSpider run are larger than 5; almost none are larger
101 2. The growth factor is 4, not 2. Since we can guarantee that Lists
102 aren't long-lived, we can grow them more aggressively, to avoid
105 * kjs/regexp_object.cpp:
106 (RegExpObjectImp::construct): Removed redundant function calls.
108 * kjs/string_object.cpp:
109 (KJS::StringObjectImp::construct): Removed questionable use of iterator.
112 (WTF::::uncheckedAppend): Added a fast, unchecked version of append.
114 2007-11-05 Mark Rowe <mrowe@apple.com>
116 Reviewed by Alp Toker.
118 Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.
120 * JavaScriptCore.pri:
123 2007-11-04 Darin Adler <darin@apple.com>
127 - http://bugs.webkit.org/show_bug.cgi?id=15826
128 optimize opcode loop and case insensitive ASCII compares for a 30% speedup
130 SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
132 * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
134 * pcre/pcre_compile.c:
135 (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
136 added OP_NOT since there was no reason it should not be in here.
137 (could_be_empty_branch): Ditto.
138 (compile_branch): Streamlined all the single-character cases; there was a bit of
139 duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
140 But in particular, compile to those opcodes when the single character match is
142 (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
144 * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
145 the matchframe, after I discovered that none of them needed to be saved and restored
146 across recursive match calls. Also eliminated the ignored result field from the
147 matchframe, since I discovered that rrc ("recursive result code") was already the
148 exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
149 statement of the switch instead of doing them before the switch. This removes a
150 branch from each iteration of the opcode interpreter, just as removal of "op"
151 removed at least one store from each iteration. Last, but not least, add the
152 OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
153 surrogate pair and the letter case can be handled efficiently.
155 2007-11-04 Darin Adler <darin@apple.com>
157 * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.
159 2007-11-03 Darin Adler <darin@apple.com>
161 - fix non-Mac builds; remove some more unused PCRE stuff
163 * pcre/pcre_compile.c:
164 (compile_branch): Removed branch chain and some unused ESC values.
165 (compile_regex): Ditto.
166 (jsRegExpCompile): Ditto.
168 (match): Removed unused branch targets. Don't use macros any more.
169 (jsRegExpExecute): More of the same.
171 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
172 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
173 * pcre/pcre.pri: Ditto.
175 * pcre/MERGING: Removed.
176 * pcre/pcre_fullinfo.c: Removed.
177 * pcre/pcre_get.c: Removed.
178 * pcre/pcre_internal.h:
179 * pcre/ucp.h: Removed.
181 2007-11-03 Darin Adler <darin@apple.com>
185 - http://bugs.webkit.org/show_bug.cgi?id=15821
186 remove unused PCRE features for speed
188 A first step toward removing the PCRE features we don't use.
189 This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
190 the SunSpider regular expression test.
192 Replaced the public interface with one that doesn't use the
193 name PCRE. Removed code we don't need for JavaScript and various
194 configurations we don't use. This is in preparation for still
195 more changes in the future. We'll probably switch to C++ and
196 make some even more significant changes to the regexp engine
197 to get some additional speed.
199 There's probably additional unused stuff that I haven't
202 This does mean that our PCRE is now a fork, but I think that's
203 not really a big deal.
205 * JavaScriptCore.exp: Remove the 5 old entry points and add
206 the 3 new entry points for WebCore's direct use of the regular
209 * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
210 its sense and now there's a USE(POSIX_REGEX) instead, which should
211 probably not be set by anyone. Maybe later we'll just get rid of it
216 (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
217 defines. Cut down on the number of functions used.
218 (KJS::RegExp::~RegExp): Ditto.
219 (KJS::RegExp::match): Ditto.
221 * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
224 * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
225 size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
226 POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
227 and JAVASCRIPT. These are all no longer configurable in our copy
230 * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
231 version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
232 the include of <stdlib.h>, and most of the constants and
233 functions defined in this header. Changed the naming scheme to
234 use a JSRegExp prefix rather than a pcre prefix. In the future,
235 we'll probably change this to be a C++ header.
237 * pcre/pcre_compile.c: Removed all unused code branches,
238 including many whole functions and various byte codes.
239 Kept changes outside of removal to a minimum.
241 (first_significant_code):
244 (could_be_empty_branch):
249 (find_firstassertedchar):
250 (jsRegExpCompile): Renamed from pcre_compile2 and changed the
251 parameters around a bit.
252 (jsRegExpFree): Added.
254 * pcre/pcre_exec.c: Removed many unused opcodes and variables.
255 Also started tearing down the NO_RECURSE mechanism since it's
256 now the default. In some cases there were things in the explicit
257 frame that could be turned into plain old local variables and
258 other small like optimizations.
261 (match): Changed parameters quite a bit since it's now not used
263 (jsRegExpExecute): Renamed from pcre_exec.
265 * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
266 PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
267 PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
268 PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
269 _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
270 and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
272 * pcre/pcre_maketables.c: Changed to only compile in dftables.
273 Also got rid of many of the tables that we don't use.
275 * pcre/pcre_tables.c: Removed the unused Unicode property tables.
277 * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
280 * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
281 for classes based on Unicode properties.
283 * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
284 to eliminate this completely, but we need the regular expression
285 code to be C++ first.
287 * pcre/pcre_fullinfo.c:
290 Files that are no longer needed. I didn't remove them with this
291 check-in, because I didn't want to modify all the project files.
293 2007-11-03 Maciej Stachowiak <mjs@apple.com>
297 - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
299 It turns out that doing this check costs more than it saves.
302 (KJS::JSImmediate::fromDouble):
304 2007-11-03 Sam Weinig <sam@webkit.org>
308 Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
309 The variable had been kept around for binary compatibility, but since nothing
310 else is there is no point in continuing to keep it around.
312 * API/JSCallbackConstructor.cpp:
314 * API/JSCallbackFunction.cpp:
316 * API/JSCallbackObject.cpp:
318 * bindings/objc/objc_runtime.mm:
319 * bindings/runtime_array.cpp:
320 * bindings/runtime_object.cpp:
321 * kjs/array_instance.cpp:
323 * kjs/array_object.cpp:
325 * kjs/bool_object.cpp:
326 * kjs/date_object.cpp:
328 * kjs/error_object.cpp:
334 * kjs/math_object.cpp:
335 * kjs/number_object.cpp:
337 * kjs/regexp_object.cpp:
338 * kjs/string_object.cpp:
341 2007-11-03 Kevin McCullough <kmccullough@apple.com>
343 - Updated testkjs results to make the build bots green until we
344 can fix the tests that are failing. The new failures are in DST.
346 * tests/mozilla/expected.html:
348 2007-11-03 Maciej Stachowiak <mjs@apple.com>
352 - don't print the var twice for ForInNodes with a var declaration
354 * kjs/nodes2string.cpp:
355 (KJS::ForInNode::streamTo):
357 2007-11-03 Darin Adler <darin@apple.com>
359 * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
360 C-incompatible declaration.
362 2007-11-03 Mark Rowe <mrowe@apple.com>
366 * kjs/nodes.cpp: Add missing include.
368 2007-11-03 Darin Adler <darin@apple.com>
372 - fix http://bugs.webkit.org/show_bug.cgi?id=15814
373 <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
375 These changes cause us to match the JavaScript specification and pass the
376 fast/js/kde/encode_decode_uri.html test.
378 * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
379 new strict mode, throwing an exception if there are malformed UTF-16 surrogate
382 * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
384 (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
385 those might be illegal in some sense, they aren't supposed to get any special
386 handling in the place where this function is currently used.
387 (KJS::UString::UTF8String): Added the strictness.
389 2007-11-03 Darin Adler <darin@apple.com>
393 - http://bugs.webkit.org/show_bug.cgi?id=15812
394 some JavaScript tests (from the Mozilla test suite) are failing
396 Two or three fixes get 7 more of the Mozilla tests passing.
397 This gets us down from 61 failing tests to 54.
399 * kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
400 Made this inline and gave it a more specific type. Some day we should
401 probably do that for all of these -- might even get a bit of a speed
403 * kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
404 inline in the header.
406 * kjs/regexp_object.h:
407 * kjs/regexp_object.cpp:
408 (KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
409 switch statement into the RegExpImp object, so they can be shared with
410 RegExpImp::callAsFunction.
411 (KJS::RegExpImp::match): Added. Common code used by both test and exec.
412 (KJS::RegExpImp::test): Added.
413 (KJS::RegExpImp::exec): Added.
414 (KJS::RegExpImp::implementsCall): Added.
415 (KJS::RegExpImp::callAsFunction): Added.
416 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
417 lastInput to null rather than empty string -- we take advantage of the
418 difference in RegExpImp::match.
419 (KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
420 just to get at a field like this.
422 * pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
423 the JavaScript specification. If there are not 4 hex digits after the \u,
424 then it's processed as if it wasn't an escape sequence at all.
426 * pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
427 for JavaScript (4 specific Unicode values).
429 (match): Changed all call sites to use IS_NEWLINE.
432 * tests/mozilla/expected.html: Updated to expect 7 more successful tests.
434 2007-11-03 David D. Kilzer <ddkilzer@webkit.org>
436 Sort files(...); sections of Xcode project files.
438 Rubber-stamped by Darin.
440 * JavaScriptCore.xcodeproj/project.pbxproj:
442 2007-11-03 Maciej Stachowiak <mjs@apple.com>
446 - remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup
450 (KJS::VarDeclNode::optimizeVariableAccess):
451 (KJS::VarDeclNode::getDeclarations):
452 (KJS::VarDeclNode::handleSlowCase):
453 (KJS::VarDeclNode::evaluateSingle):
454 (KJS::VarDeclNode::evaluate):
455 (KJS::VarStatementNode::execute):
457 (KJS::VarDeclNode::):
458 (KJS::VarStatementNode::):
459 * kjs/nodes2string.cpp:
460 (KJS::VarDeclNode::streamTo):
462 2007-11-03 Alexey Proskuryakov <ap@webkit.org>
466 http://bugs.webkit.org/show_bug.cgi?id=15800
467 REGRESSION (r27303): RegExp leaks
469 * kjs/regexp_object.h:
470 (KJS::RegExpImp::setRegExp):
471 (KJS::RegExpImp::regExp):
472 (KJS::RegExpImp::classInfo):
473 * kjs/regexp_object.cpp:
474 (RegExpImp::RegExpImp):
475 (RegExpImp::~RegExpImp):
476 Renamed reg member variable to m_regExp, changed it to use OwnPtr.
478 2007-11-02 Maciej Stachowiak <mjs@apple.com>
482 - add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.
486 (KJS::statementListPushFIFO):
487 (KJS::statementListGetDeclarations):
488 (KJS::statementListInitializeDeclarationStacks):
489 (KJS::statementListInitializeVariableAccessStack):
490 (KJS::statementListExecute):
491 (KJS::BlockNode::BlockNode):
492 (KJS::FunctionBodyNode::FunctionBodyNode):
493 (KJS::ProgramNode::ProgramNode):
495 (KJS::CaseClauseNode::):
497 2007-11-02 Darin Adler <darin@apple.com>
501 - http://bugs.webkit.org/show_bug.cgi?id=15791
502 change property map data structure for less memory use, better speed
504 The property map now has an array of indices and a separate array of
505 property map entries. This slightly slows down lookup because of a second
506 memory acess, but makes property maps smaller and faster to iterate in
507 functions like mark().
509 SunSpider says this is 1.2% faster, although it makes the bitwise-end test
510 more than 10% slower. To fix that we'll need to optimize global variable lookup.
512 * kjs/property_map.cpp:
513 (KJS::PropertyMapEntry::PropertyMapEntry):
514 (KJS::PropertyMapHashTable::entries):
515 (KJS::PropertyMapHashTable::allocationSize):
516 (KJS::SavedProperties::SavedProperties):
517 (KJS::SavedProperties::~SavedProperties):
518 (KJS::PropertyMap::checkConsistency):
519 (KJS::PropertyMap::~PropertyMap):
520 (KJS::PropertyMap::clear):
521 (KJS::PropertyMap::get):
522 (KJS::PropertyMap::getLocation):
523 (KJS::PropertyMap::put):
524 (KJS::PropertyMap::insert):
525 (KJS::PropertyMap::createTable):
526 (KJS::PropertyMap::rehash):
527 (KJS::PropertyMap::remove):
528 (KJS::PropertyMap::mark):
529 (KJS::comparePropertyMapEntryIndices):
530 (KJS::PropertyMap::containsGettersOrSetters):
531 (KJS::PropertyMap::getEnumerablePropertyNames):
532 (KJS::PropertyMap::save):
533 (KJS::PropertyMap::restore):
534 * kjs/property_map.h:
536 2007-11-02 Darin Adler <darin@apple.com>
540 - http://bugs.webkit.org/show_bug.cgi?id=15807
541 HashMap needs a take() function that combines get and remove
543 * wtf/HashMap.h: Added take function. Simplistic implementation for now,
544 but still does only one hash table lookup.
546 * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
547 a find followed by a remove.
549 2007-11-02 David Carson <dacarson@gmail.com>
553 Fix compiler warning "warning: suggest parentheses around && within ||"
554 http://bugs.webkit.org/show_bug.cgi?id=15764
556 * kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.
558 2007-11-01 Geoffrey Garen <ggaren@apple.com>
560 Reviewed by Maciej Stachowiak.
562 In preparation for making List a simple stack-allocated Vector:
564 Removed all instances of List copying and/or assignment, and made List
565 inherit from Noncopyable.
567 Functions that used to return a List by copy now take List& out
570 Layout tests and JS tests pass.
573 (KJS::List::slice): Replaced copyTail with a more generic slice
574 alternative. (JavaScriptCore only calls slice(1), but WebCore calls
577 2007-11-01 Geoffrey Garen <ggaren@apple.com>
579 Reviewed by Maciej Stachowiak.
581 Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
582 REGRESSION(r27344): Crash on load at finance.yahoo.com
584 Reverted a small portion of my last check-in. (The speedup and the List
585 removal are still there, though.)
587 ActivationImp needs to hold a pointer to its function, and mark that
588 pointer (rather than accessing its function through its ExecState, and
589 counting on the active scope to mark its function) because a closure
590 can cause an ActivationImp to outlive its ExecState along with any
594 (KJS::ExecState::ExecState):
596 (KJS::FunctionImp::~FunctionImp):
597 (KJS::ActivationImp::ActivationImp):
599 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
601 Also made HashTable a little more crash-happy in debug builds, so
602 problems like this will show up earlier:
605 (WTF::HashTable::~HashTable):
607 2007-11-01 Geoffrey Garen <ggaren@apple.com>
609 Reviewed by Adam Roben.
611 Addressed some of Darin's review comments.
613 Used perl -p, which is the shorthand while(<>) {}.
615 Made sure not to suppress bison's output.
617 Added line to removed bison_out.txt, since this script removes other
618 intermediate files, too.
620 * DerivedSources.make:
622 2007-11-01 Geoffrey Garen <ggaren@apple.com>
624 Reviewed by Oliver Hunt.
626 Removed List from ActivationImp, in preparation for making all lists
631 1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.
634 (KJS::ExecState::ExecState):
635 (KJS::ExecState::~ExecState):
637 (KJS::ActivationImp::ActivationImp):
638 (KJS::ActivationImp::createArgumentsObject):
640 (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
642 2007-11-01 Adam Roben <aroben@apple.com>
644 Use jsNumberCell instead of jsNumber when converting double constants to JSValues
646 This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
647 ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.
649 It also gets rid of an MSVC warning that we previously had to silence.
653 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
654 back on the "overflow in constant arithmetic" warning.
655 * kjs/number_object.cpp:
656 (NumberObjectImp::getValueProperty): Use jsNumberCell instead of
659 2007-10-31 Adam Roben <aroben@apple.com>
665 2007-10-31 Maciej Stachowiak <mjs@apple.com>
669 - shave some cycles off of local storage access for a 1% SunSpider speedup
671 Keep the LocalStorage pointer in the ExecState, instead of getting
672 it from the ActivationImp all the time.
675 (KJS::ExecState::updateLocalStorage):
677 (KJS::ExecState::localStorage):
679 (KJS::LocalVarAccessNode::evaluate):
680 (KJS::LocalVarFunctionCallNode::evaluate):
681 (KJS::PostIncLocalVarNode::evaluate):
682 (KJS::PostDecLocalVarNode::evaluate):
683 (KJS::LocalVarTypeOfNode::evaluate):
684 (KJS::PreIncLocalVarNode::evaluate):
685 (KJS::PreDecLocalVarNode::evaluate):
686 (KJS::ReadModifyLocalVarNode::evaluate):
687 (KJS::AssignLocalVarNode::evaluate):
688 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
690 2007-10-31 Adam Roben <aroben@apple.com>
692 Fix a crash on launch due to a static initializer race
694 We now use fast inline assembler spinlocks which can be statically
695 initialized at compile time.
697 As a side benefit, this speeds up SunSpider by 0.4%.
701 * wtf/FastMalloc.cpp:
703 (TCMalloc_SpinLock::Lock):
704 (TCMalloc_SpinLock::Unlock):
706 * wtf/TCSystemAlloc.cpp:
708 2007-10-31 Kevin McCullough <kmccullough@apple.com>
712 - Corrected spelling.
716 2007-10-31 Mark Rowe <mrowe@apple.com>
718 Further Gtk build fixage.
720 * kjs/regexp_object.cpp:
722 2007-10-31 Mark Rowe <mrowe@apple.com>
728 2007-10-31 Darin Adler <darin@apple.com>
732 - fix http://bugs.webkit.org/show_bug.cgi?id=15749
733 RegExp/RegExpObjectImp cause needless UString creation
735 Speeds things up 0.4% according to SunSpider.
737 * kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
738 because this library doesn't use the real PCRE -- it uses its
739 own PCRE that works on UTF-16.
741 * kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
742 Use Noncopyable. Change the return value of match.
744 (KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
745 (KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
746 (KJS::RegExp::match): Change to return the position as an int and the
747 ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.
749 * kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
750 require a result string.
751 * kjs/regexp_object.cpp:
752 (RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
753 (RegExpObjectImp::performMatch): Change so it doesn't return a string.
754 (RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
755 the main result with the backreferences; now it doesn't need to take
757 (RegExpObjectImp::getBackref): Minor tweaks.
758 (RegExpObjectImp::getLastParen): Ditto.
759 (RegExpObjectImp::getLeftContext): Ditto.
760 (RegExpObjectImp::getRightContext): Ditto.
761 (RegExpObjectImp::getValueProperty): Change LastMatch case to call
762 getBackref(0) so we don't need a separate getLastMatch function.
764 * kjs/string_object.cpp:
765 (KJS::replace): Update to use new performMatch, including merging the
766 matched string section with the other substrings.
767 (KJS::StringProtoFunc::callAsFunction): Update functions to use the
768 new performMatch and match. Also change to use OwnArrayPtr.
770 2007-10-31 Oliver Hunt <oliver@apple.com>
772 * kjs/nodes.h: include OwnPtr.h
774 2007-10-31 Oliver Hunt <oliver@apple.com>
778 Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider
782 (KJS::statementListPushFIFO):
783 (KJS::statementListGetDeclarations):
784 (KJS::statementListInitializeDeclarationStacks):
785 (KJS::statementListInitializeVariableAccessStack):
786 (KJS::statementListExecute):
787 (KJS::BlockNode::optimizeVariableAccess):
788 (KJS::BlockNode::BlockNode):
789 (KJS::BlockNode::getDeclarations):
790 (KJS::BlockNode::execute):
791 (KJS::CaseClauseNode::optimizeVariableAccess):
792 (KJS::CaseClauseNode::getDeclarations):
793 (KJS::CaseClauseNode::evalStatements):
794 (KJS::FunctionBodyNode::initializeDeclarationStacks):
795 (KJS::FunctionBodyNode::optimizeVariableAccess):
797 * kjs/nodes2string.cpp:
798 (KJS::statementListStreamTo):
799 (KJS::BlockNode::streamTo):
800 (KJS::CaseClauseNode::streamTo):
802 2007-10-30 Mark Rowe <mrowe@apple.com>
804 * kjs/property_map.cpp: Added a missing using directive to fix the build
805 for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
807 2007-10-31 Maciej Stachowiak <mjs@apple.com>
809 * kjs/property_map.cpp: Include HashTable.h the right way to fix the build
812 2007-10-31 Alexey Proskuryakov <ap@webkit.org>
816 http://bugs.webkit.org/show_bug.cgi?id=11001
817 WebKit doesn't support RegExp.compile method
819 Test: fast/js/regexp-compile.html
821 * kjs/regexp_object.cpp:
822 (RegExpPrototype::RegExpPrototype):
823 (RegExpProtoFunc::callAsFunction):
824 * kjs/regexp_object.h:
825 (KJS::RegExpProtoFunc::):
826 Added RegExp.compile.
828 * tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.
830 2007-10-31 Maciej Stachowiak <mjs@apple.com>
834 - get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
836 Integer divide sucks. Fortunately, a bunch of shifts and XORs
837 biased towards the high bits is sufficient to provide a good
838 double hash. Besides the SunSpider win, I used the dump statistics
839 mode for both to verify that collisions did not increase and that
840 the longest collision chain is not any longer.
842 * kjs/property_map.cpp:
844 (KJS::PropertyMap::get):
845 (KJS::PropertyMap::getLocation):
846 (KJS::PropertyMap::put):
847 (KJS::PropertyMap::insert):
848 (KJS::PropertyMap::remove):
849 (KJS::PropertyMap::checkConsistency):
853 (WTF::::lookupForWriting):
854 (WTF::::fullLookupForWriting):
857 2007-10-30 Adam Roben <aroben@apple.com>
859 * kjs/collector.h: Make HeapType public so it can be used for non-member
860 things like the HeapConstants struct template. Fixes the build on Windows.
862 2007-10-30 Adam Roben <aroben@apple.com>
864 Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows
866 Speeds up SunSpider by 0.4%.
868 Reviewed by Steve and Maciej.
870 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
871 a warning during LTCG in release builds about double -> float
873 * wtf/AlwaysInline.h:
876 2007-10-30 Adam Roben <aroben@apple.com>
878 Use GetCurrentThreadId instead of pthread_self in FastMalloc
880 Speeds up SunSpider by 0.3%.
884 * wtf/FastMalloc.cpp:
885 (WTF::TCMalloc_ThreadCache::InitTSD):
886 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
888 2007-10-30 Adam Roben <aroben@apple.com>
890 Switch to a Win32 critical section implementation of spinlocks
892 Speeds up SunSpider by 0.4%.
896 * wtf/FastMalloc.cpp:
898 (TCMalloc_SpinLock::TCMalloc_SpinLock):
899 (TCMalloc_SpinLock::Init):
900 (TCMalloc_SpinLock::Finalize):
901 (TCMalloc_SpinLock::Lock):
902 (TCMalloc_SpinLock::Unlock):
903 * wtf/TCSystemAlloc.cpp:
905 2007-10-30 Adam Roben <aroben@apple.com>
907 Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta
909 http://bugs.webkit.org/show_bug.cgi?id=15586
911 Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll
913 Use Win32 TLS functions instead of __declspec(thread), which breaks
918 * wtf/FastMalloc.cpp:
919 (WTF::getThreadHeap):
920 (WTF::TCMalloc_ThreadCache::InitModule):
922 2007-10-30 Maciej Stachowiak <mjs@apple.com>
926 - allocate numbers in half-size cells, for an 0.5% SunSpider speedup
927 http://bugs.webkit.org/show_bug.cgi?id=15772
929 We do this by using a single mark bit per two number cells, and
932 Besides being an 0.5% win overall, this is a 7.1% win on morph.
936 (KJS::Collector::heapAllocate):
937 (KJS::Collector::markStackObjectsConservatively):
938 (KJS::Collector::sweep):
940 (KJS::SmallCollectorCell::):
942 2007-10-30 Geoffrey Garen <ggaren@apple.com>
944 Reviewed by Adam Roben, Sam Weinig.
946 Made conflicts in grammar.y a persistent build failure.
948 * DerivedSources.make:
950 2007-10-30 Kevin McCullough <kmccullough@apple.com>
952 Reviewed by Adam and Geoff.
954 - Added a new cast so all the casts are in the same place.
959 2007-10-30 Geoffrey Garen <ggaren@apple.com>
961 Reviewed by Darin Adler.
963 Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
967 ecma_2/Statements/dowhile-001.js
968 ecma_2/Statements/dowhile-002.js
969 ecma_2/Statements/dowhile-003.js
970 ecma_2/Statements/dowhile-004.js
971 ecma_2/Statements/dowhile-005.js
972 ecma_2/Statements/dowhile-006.js
973 ecma_2/Statements/dowhile-007.js
974 js1_2/statements/do_while.js
976 and layout tests, including
978 do-while-expression-value.html
979 do-while-semicolon.html
980 do-while-without-semicolon.html
984 * kjs/grammar.y: Use the explicit "error" production, as we do with other
985 automatic semicolon insertions, to disambiguate "do { } while();" from
986 "do { } while()" followed by ";" (the empty statement).
988 2007-10-29 Oliver Hunt <oliver@apple.com>
992 Debranching remaining assignment nodes, and miscellaneous cleanup
994 Split read-modify code paths out of AssignBracketNode and AssignDotNode
995 Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode
996 and ReadModifyResolveNode evaluate methods
998 Leads to a 1% gain in SunSpider.
1002 (KJS::ReadModifyLocalVarNode::evaluate):
1003 (KJS::ReadModifyResolveNode::evaluate):
1004 (KJS::AssignDotNode::evaluate):
1005 (KJS::ReadModifyDotNode::optimizeVariableAccess):
1006 (KJS::ReadModifyDotNode::evaluate):
1007 (KJS::AssignBracketNode::evaluate):
1008 (KJS::ReadModifyBracketNode::optimizeVariableAccess):
1009 (KJS::ReadModifyBracketNode::evaluate):
1011 (KJS::AssignBracketNode::):
1012 (KJS::AssignBracketNode::precedence):
1013 (KJS::AssignDotNode::):
1014 (KJS::AssignDotNode::precedence):
1015 * kjs/nodes2string.cpp:
1016 (KJS::ReadModifyBracketNode::streamTo):
1017 (KJS::AssignBracketNode::streamTo):
1018 (KJS::ReadModifyDotNode::streamTo):
1019 (KJS::AssignDotNode::streamTo):
1021 2007-10-29 Oliver Hunt <oliver@apple.com>
1023 Debranching various Node::evaluate implementations
1027 Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
1028 Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
1030 Gains 1.6% on SunSpider
1032 * JavaScriptCore.xcodeproj/project.pbxproj:
1035 (KJS::PostIncResolveNode::optimizeVariableAccess):
1036 (KJS::PostIncResolveNode::evaluate):
1037 (KJS::PostIncLocalVarNode::evaluate):
1038 (KJS::PostDecResolveNode::optimizeVariableAccess):
1039 (KJS::PostDecResolveNode::evaluate):
1040 (KJS::PostDecLocalVarNode::evaluate):
1041 (KJS::PostIncBracketNode::evaluate):
1042 (KJS::PostDecBracketNode::evaluate):
1043 (KJS::PostIncDotNode::evaluate):
1044 (KJS::PostDecDotNode::evaluate):
1045 (KJS::PreIncResolveNode::optimizeVariableAccess):
1046 (KJS::PreIncLocalVarNode::evaluate):
1047 (KJS::PreIncResolveNode::evaluate):
1048 (KJS::PreDecResolveNode::optimizeVariableAccess):
1049 (KJS::PreDecLocalVarNode::evaluate):
1050 (KJS::PreDecResolveNode::evaluate):
1051 (KJS::PreIncBracketNode::evaluate):
1052 (KJS::PreDecBracketNode::evaluate):
1053 (KJS::PreIncDotNode::evaluate):
1054 (KJS::PreDecDotNode::evaluate):
1055 (KJS::ReadModifyResolveNode::optimizeVariableAccess):
1056 (KJS::AssignResolveNode::optimizeVariableAccess):
1057 (KJS::AssignLocalVarNode::evaluate):
1058 (KJS::AssignResolveNode::evaluate):
1060 (KJS::PostDecResolveNode::):
1061 (KJS::PostDecResolveNode::precedence):
1062 (KJS::PostDecLocalVarNode::):
1063 (KJS::PostfixBracketNode::):
1064 (KJS::PostfixBracketNode::precedence):
1065 (KJS::PostIncBracketNode::):
1066 (KJS::PostIncBracketNode::isIncrement):
1067 (KJS::PostDecBracketNode::):
1068 (KJS::PostDecBracketNode::isIncrement):
1069 (KJS::PostfixDotNode::):
1070 (KJS::PostfixDotNode::precedence):
1071 (KJS::PostIncDotNode::):
1072 (KJS::PostIncDotNode::isIncrement):
1073 (KJS::PostDecDotNode::):
1074 (KJS::PreIncResolveNode::):
1075 (KJS::PreDecResolveNode::):
1076 (KJS::PreDecResolveNode::precedence):
1077 (KJS::PreDecLocalVarNode::):
1078 (KJS::PrefixBracketNode::):
1079 (KJS::PrefixBracketNode::precedence):
1080 (KJS::PreIncBracketNode::):
1081 (KJS::PreIncBracketNode::isIncrement):
1082 (KJS::PreDecBracketNode::):
1083 (KJS::PreDecBracketNode::isIncrement):
1084 (KJS::PrefixDotNode::):
1085 (KJS::PrefixDotNode::precedence):
1086 (KJS::PreIncDotNode::):
1087 (KJS::PreIncDotNode::isIncrement):
1088 (KJS::PreDecDotNode::):
1089 (KJS::ReadModifyResolveNode::):
1090 (KJS::ReadModifyLocalVarNode::):
1091 (KJS::AssignResolveNode::):
1092 (KJS::AssignResolveNode::precedence):
1093 * kjs/nodes2string.cpp:
1094 (KJS::PostIncResolveNode::streamTo):
1095 (KJS::PostDecResolveNode::streamTo):
1096 (KJS::PostfixBracketNode::streamTo):
1097 (KJS::PostfixDotNode::streamTo):
1098 (KJS::PreIncResolveNode::streamTo):
1099 (KJS::PreDecResolveNode::streamTo):
1100 (KJS::ReadModifyResolveNode::streamTo):
1101 (KJS::AssignResolveNode::streamTo):
1103 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1105 Not reviewed, build fix.
1107 - Include Vector.h in a way that actually works.
1109 * kjs/LocalStorage.h:
1111 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1113 Not reviewed, build fix.
1115 - Install LocalStorage.h as a private header.
1117 * JavaScriptCore.xcodeproj/project.pbxproj:
1119 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1123 - Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.
1125 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1126 * JavaScriptCore.xcodeproj/project.pbxproj:
1127 * kjs/LocalStorage.h: Added.
1128 (KJS::LocalStorageEntry::LocalStorageEntry):
1132 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
1134 2007-10-29 Geoffrey Garen <ggaren@apple.com>
1136 Reviewed by Oliver Hunt.
1138 Some small tweaks that I notice while reviewing Oliver's last patch.
1140 Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
1142 No change in SunSpider because SunSpider doesn't take the code path that
1143 would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.
1146 (KJS::LocalVarPostfixNode::evaluate):
1147 (KJS::TypeOfResolveNode::optimizeVariableAccess):
1148 (KJS::LocalVarTypeOfNode::evaluate):
1149 (KJS::PrefixResolveNode::optimizeVariableAccess):
1150 (KJS::LocalVarPrefixNode::evaluate):
1151 (KJS::AssignResolveNode::optimizeVariableAccess):
1152 (KJS::LocalVarAssignNode::evaluate):
1154 (KJS::LocalVarTypeOfNode::):
1155 (KJS::PrefixResolveNode::):
1156 (KJS::LocalVarPrefixNode::):
1157 (KJS::AssignResolveNode::):
1158 (KJS::LocalVarAssignNode::):
1160 2007-10-29 Eric Seidel <eric@webkit.org>
1164 SunSpider claims this was a 0.7% speedup.
1166 * kjs/string_object.cpp:
1167 (KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case
1169 2007-10-29 Maciej Stachowiak <mjs@apple.com>
1173 - re-enable asserts for access to empty or deleted keys
1177 (WTF::::lookupForWriting):
1178 (WTF::::fullLookupForWriting):
1181 2007-10-29 Eric Seidel <eric@webkit.org>
1183 Build fix only, no review.
1185 * JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot
1187 2007-10-29 Mark Rowe <mrowe@apple.com>
1189 Gtk build fix. Move struct declarations into nodes.h.
1194 2007-10-29 Eric Seidel <eric@webkit.org>
1198 Give StringInstance a getOwnPropertySlot(ExecState, unsigned, PropertySlot) fastpath, just like Arrays.
1199 Make it a compile time error to use toString(ExecState) on a StringInstance
1201 SunSpider claims this was a 6.6% speedup overall (22% on string-base64)
1204 (KJS::StringImp::getLength):
1205 * kjs/string_object.cpp:
1206 (KJS::StringInstance::lengthGetter):
1207 (KJS::StringInstance::inlineGetOwnPropertySlot):
1208 (KJS::StringInstance::getOwnPropertySlot):
1209 * kjs/string_object.h:
1211 2007-10-28 Oliver Hunt <oliver@apple.com>
1215 Add nodes to allow Assignment, TypeOf, and prefix operators to
1216 make use of the new optimised local variable look up.
1218 5% gain on sunspider
1221 (KJS::TypeOfResolveNode::optimizeVariableAccess):
1222 (KJS::LocalTypeOfAccessNode::evaluate):
1223 (KJS::PrefixResolveNode::optimizeVariableAccess):
1224 (KJS::PrefixLocalAccessNode::evaluate):
1225 (KJS::AssignResolveNode::optimizeVariableAccess):
1226 (KJS::AssignLocalAccessNode::evaluate):
1228 (KJS::TypeOfResolveNode::):
1229 (KJS::TypeOfResolveNode::precedence):
1230 (KJS::LocalTypeOfAccessNode::):
1231 (KJS::PrefixResolveNode::):
1232 (KJS::PrefixResolveNode::precedence):
1233 (KJS::PrefixLocalAccessNode::):
1234 (KJS::AssignResolveNode::):
1235 (KJS::AssignLocalAccessNode::):
1237 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1241 - avoid creating and then breaking circular lists in the parser, instead track head and tail pointers at parse time
1242 http://bugs.webkit.org/show_bug.cgi?id=15748
1244 Not a significant speedup or slowdown on SunSpider.
1247 (KJS::clearNewNodes):
1251 (KJS::BlockNode::BlockNode):
1252 (KJS::CaseBlockNode::CaseBlockNode):
1253 (KJS::FunctionBodyNode::FunctionBodyNode):
1254 (KJS::SourceElementsNode::SourceElementsNode):
1255 (KJS::ProgramNode::ProgramNode):
1257 (KJS::ElementNode::):
1259 (KJS::PropertyListNode::):
1260 (KJS::ObjectLiteralNode::):
1261 (KJS::ArgumentListNode::):
1262 (KJS::ArgumentsNode::):
1263 (KJS::VarDeclListNode::):
1264 (KJS::VarStatementNode::):
1266 (KJS::ParameterNode::):
1267 (KJS::FuncExprNode::):
1268 (KJS::FuncDeclNode::):
1269 (KJS::SourceElementsNode::):
1270 (KJS::CaseClauseNode::):
1271 (KJS::ClauseListNode::):
1273 2007-10-28 Mark Rowe <mrowe@apple.com>
1275 Disable assertions in a manner that doesn't break the Qt Windows build.
1279 (WTF::::lookupForWriting):
1280 (WTF::::fullLookupForWriting):
1282 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1284 Temporarily disabling some ASSERTs I introduced in my last check-in
1285 because of http://bugs.webkit.org/show_bug.cgi?id=15747
1286 Lots of layout tests fail the !HashTranslator::equal(KeyTraits::emptyValue() ASSERT
1290 (WTF::::lookupForWriting):
1291 (WTF::::fullLookupForWriting):
1294 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1296 Reviewed by Darin Adler.
1298 Fixed http://bugs.webkit.org/show_bug.cgi?id=15746
1299 #ifndef ASSERT_DISABLED is no good!
1301 Replaced with #if !ASSERT_DISABLED.
1305 (WTF::::lookupForWriting):
1306 (WTF::::fullLookupForWriting):
1309 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1311 Reviewed by Darin Adler.
1313 Added FunctionCallResolveNode, PostfixResolveNode, and DeleteResolveNode
1314 to the AST transfom that replaces slow resolve nodes with fast local
1315 variable alternatives.
1317 2.5% speedup on SunSpider.
1319 Also added some missing copyright notices.
1322 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
1323 (KJS::FunctionCallResolveNode::evaluate):
1324 (KJS::LocalVarFunctionCallNode::evaluate):
1325 (KJS::PostfixResolveNode::optimizeVariableAccess):
1326 (KJS::PostfixResolveNode::evaluate):
1327 (KJS::LocalVarPostfixNode::evaluate):
1328 (KJS::DeleteResolveNode::optimizeVariableAccess):
1329 (KJS::DeleteResolveNode::evaluate):
1330 (KJS::LocalVarDeleteNode::evaluate):
1332 (KJS::FunctionCallResolveNode::):
1333 (KJS::LocalVarFunctionCallNode::LocalVarFunctionCallNode):
1334 (KJS::PostfixResolveNode::):
1335 (KJS::LocalVarPostfixNode::LocalVarPostfixNode):
1336 (KJS::DeleteResolveNode::):
1337 (KJS::LocalVarDeleteNode::LocalVarDeleteNode):
1339 2007-10-28 Eric Seidel <eric@webkit.org>
1343 Inline UString::Rep::deref() for a 0.8% improvement in SunSpider
1344 Add virtual keyword to a few virtual functions previously unmarked.
1347 (KJS::StringImp::type):
1348 (KJS::NumberImp::type):
1350 (KJS::UString::Rep::deref):
1352 2007-10-28 Darin Adler <darin@apple.com>
1354 - fix "broken everything" from the storage leak fix
1356 * wtf/RefPtr.h: (WTF::RefPtr::RefPtr): Added a PlacementNewAdopt constructor.
1357 * kjs/ustring.h: (KJS::UString::UString): Pass PlacementNewAdopt along to RefPtr.
1359 2007-10-28 Darin Adler <darin@apple.com>
1363 - turn on unused parameter waring on Mac OS X because it's already on elsewhere
1365 * Configurations/Base.xcconfig: Took out -wno-unused-parameter.
1371 Fixed unused variables by using them or marked them with UNUSED_PARAM.
1373 * kjs/CollectorHeapIntrospector.h: (KJS::CollectorHeapIntrospector::zoneCalloc):
1374 Removed parameter names to indicate they are unused.
1376 2007-10-28 Darin Adler <darin@apple.com>
1380 - fix a storage leak where we ref the UString every time we replace
1381 a ResolveNode with a LocalVarAccessNode
1383 * kjs/identifier.h: (KJS::Identifier::Identifier): Added a constructor
1384 that takes PlacementNewAdopt.
1386 * kjs/nodes.h: (KJS::ResolveNode::ResolveNode): Initialize the ident
1387 with PlacementNewAdopt instead of the old value of ident.
1389 * kjs/ustring.h: (KJS::UString::UString): Added a constructor that
1390 takes PlacementNewAdopt.
1392 2007-10-28 Darin Adler <darin@apple.com>
1394 - Windows build fix; get rid of unused parameter
1396 * kjs/nodes.cpp: (KJS::ResolveNode::optimizeVariableAccess): Don't pass it.
1397 * kjs/nodes.h: (KJS::LocalVarAccessNode::LocalVarAccessNode): Remove it.
1398 The assertions weren't all that helpful.
1400 2007-10-28 Mark Rowe <mrowe@apple.com>
1402 Gtk build fix. Add include of MathExtras.h.
1404 * kjs/string_object.cpp:
1406 2007-10-28 Mark Rowe <mrowe@apple.com>
1408 Reviewed by Maciej and Tim.
1410 Replace uses of isNaN and isInf with isnan and isinf, and
1411 remove isNaN and isInf.
1413 * kjs/config.h: Remove unused HAVE_'s.
1414 * kjs/date_object.cpp:
1415 (KJS::DateInstance::getTime):
1416 (KJS::DateInstance::getUTCTime):
1417 (KJS::DateProtoFunc::callAsFunction):
1418 (KJS::DateObjectImp::construct):
1419 (KJS::DateObjectFuncImp::callAsFunction):
1421 (KJS::GlobalFuncImp::callAsFunction):
1422 * kjs/math_object.cpp:
1423 (MathFuncImp::callAsFunction):
1424 * kjs/nodes2string.cpp:
1425 (KJS::isParserRoundTripNumber):
1426 * kjs/number_object.cpp:
1427 (NumberProtoFunc::callAsFunction):
1428 * kjs/operations.cpp:
1430 * kjs/string_object.cpp:
1431 (KJS::StringProtoFunc::callAsFunction):
1433 (KJS::UString::from):
1435 (KJS::JSValue::toInteger):
1436 (KJS::JSValue::toInt32SlowCase):
1437 (KJS::JSValue::toUInt32SlowCase):
1439 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1441 Build fix: use the new-fangled missingSymbolMarker().
1444 (KJS::ResolveNode::optimizeVariableAccess):
1446 (KJS::LocalVarAccessNode::LocalVarAccessNode):
1448 2007-10-28 Geoffrey Garen <ggaren@apple.com>
1450 Reviewed by Maciej Stachowiak, Darin Adler.
1452 Much supporting work done by Maciej Stachowiak, Maks Orlovich, and
1455 AST transfom to replace slow resolve nodes with fast local variable
1456 alternatives that do direct memory access. Currently, only ResolveNode
1457 provides a fast local variable alternative. 6 others are soon to come.
1459 16.7% speedup on SunSpider.
1461 Most of this patch is just scaffolding to support iterating all the
1462 resolve nodes in the AST through optimizeResolveNodes(). In
1463 optimizeResolveNodes(), most classes just push their child nodes onto
1464 the processing stack, while ResolveNodes actually replace themselves in
1465 the tree with more optimized alternatives, if possible.
1467 Here are the interesting bits:
1469 * kjs/nodes.h: Added PlacementNewAdoptTag, along with implementations
1470 in Node and ResolveNode. This tag allows you to use placement new to
1471 swap out a base class Node in favor of a subclass copy that holds the
1472 same data. (Without this tag, default initialization would NULL out
1473 RefPtrs, change line numbers, etc.)
1476 (KJS::ResolveNode::evaluate): Since we're taking the slow path, ASSERT
1477 that the fast path is impossible, to make sure we didn't leave anything
1480 (KJS::FunctionBodyNode::optimizeResolveNodes): Here's where the AST
1481 transformation happens.
1483 (KJS::ResolveNode::optimizeResolveNodes): Here's where the ResolveNode
1484 optimization happens.
1486 * kjs/function.h: Added symbolTable() accessor for, for the sake of
1489 2007-10-28 Mark Rowe <mrowe@apple.com>
1493 Fix "AllInOneFile.o has a global initializer in it".
1495 Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
1496 We can avoid this by moving it inside an inline function.
1498 * kjs/SymbolTable.h:
1499 (KJS::missingSymbolMarker):
1501 (KJS::ActivationImp::getOwnPropertySlot):
1502 (KJS::ActivationImp::put):
1504 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1508 - Added assertions to protect against adding empty or deleted keys to a HashTable
1511 (WTF::HashTable::lookup):
1512 (WTF::HashTable::lookupForWriting):
1513 (WTF::HashTable::fullLookupForWriting):
1514 (WTF::HashTable::add):
1516 2007-10-28 Darin Adler <darin@apple.com>
1520 * kjs/nodes2string.cpp: (KJS::isParserRoundTripNumber):
1521 Use isNaN and isInf instead of isnan and isinf.
1523 2007-10-28 Darin Adler <darin@apple.com>
1527 - http://bugs.webkit.org/show_bug.cgi?id=15735
1528 remove GroupNode to simplify AST and possibly get a modest speedup
1530 This patch removes 4 node types: GroupNode, PropertyNameNode,
1531 FunctionCallParenBracketNode, and FunctionCallParenDotNode.
1533 To remove GroupNode, we add knowledge of precedence to the tree nodes,
1534 and use that when serializing to determine where parentheses are needed.
1535 This means we no longer have to represent parentheses in the tree.
1537 The precedence values are named after productions in the grammar from the
1538 JavaScript standard.
1540 SunSpider says this is an 0.4% speedup.
1543 * kjs/function.cpp: Removed escapeStringForPrettyPrinting -- it's part of
1544 serialization, so I moved it to the file that takes care of that.
1546 * kjs/grammar.y: Changed makeGetterOrSetterPropertyNode to use 0 to
1547 indicate failure instead of a separate boolean. Got rid of PropertyNameNode
1548 by merging the PropertyName rule into the Property rule (which was easier
1549 than figuring out how to pass the Identifier from one node to another).
1550 Got rid of GroupNode, nodeInsideAllParens(), FunctionCallParenBracketNode,
1551 and FunctionCallParenDotNode.
1553 * kjs/nodes.h: Removed unused forward declarations and Operator values.
1554 Added Precedence enum, and precedence function to all nodes. Removed
1555 nodeInsideAllParens. Added streamBinaryOperator function for serialization.
1556 Removed GroupNode and PropertyNameNode. Made PropertyNode store an Identifier.
1557 Removed FunctionCallParenBracketNode and FunctionCallParenDotNode.
1559 * kjs/nodes.cpp: Removed Node::nodinsideAllParens, GroupNode, and PropertyNameNode.
1560 (KJS::PropertyListNode::evaluate): Changed code to get name directly instead
1561 of converting it from an Identifier to a jsString then back to a UString
1562 then into an Identifier again!
1564 * kjs/nodes2string.cpp: Changed special-token implementation to use a separate
1565 function for each of Endl, Indent, Unindent, and DotExpr instead of using a
1566 single function with a switch. Added a precedence that you can stream in, to
1567 cause the next node serialized to add parentheses based on that precedence value.
1568 (KJS::operatorString): Moved to the top of the file.
1569 (KJS::escapeStringForPrettyPrinting): Moved here from function.cpp. Removed old
1570 workaround for snprintf, since StringExtras.h takes care of that.
1571 (KJS::operator<<): Made the char and char* versions faster by using UString's
1572 character append functions instead of constructing a UString. Added the logic
1573 to the Node* version to add parentheses if needed.
1574 (KJS::Node::streamLeftAssociativeBinaryOperator): Added helper function.
1575 (KJS::ElementNode::streamTo): Use PrecAssignment for the elements.
1576 (KJS::BracketAccessorNode::streamTo): Use PrecCall for the expression before
1578 (KJS::DotAccessorNode::streamTo): Use PrecCall for the expression before the dot.
1579 (KJS::ArgumentListNode::streamTo): Use PrecAssignment for the arguments.
1580 (KJS::NewExprNode::streamTo): Use PrecMember for the expression.
1581 (KJS::FunctionCallValueNode::streamTo): Use PrecCall.
1582 (KJS::FunctionCallBracketNode::streamTo): Ditto.
1583 (KJS::FunctionCallDotNode::streamTo): Ditto.
1584 (KJS::PostfixBracketNode::streamTo): Ditto.
1585 (KJS::PostfixDotNode::streamTo): Ditto.
1586 (KJS::PostfixErrorNode::streamTo): Use PrecLeftHandSide.
1587 (KJS::DeleteBracketNode::streamTo): Use PrecCall.
1588 (KJS::DeleteDotNode::streamTo): Ditto.
1589 (KJS::DeleteValueNode::streamTo): Use PrecUnary.
1590 (KJS::VoidNode::streamTo): Ditto.
1591 (KJS::TypeOfValueNode::streamTo): Ditto.
1592 (KJS::PrefixBracketNode::streamTo): Use PrecCall.
1593 (KJS::PrefixDotNode::streamTo): Ditto.
1594 (KJS::PrefixErrorNode::streamTo): Use PrecUnary.
1595 (KJS::UnaryPlusNode::streamTo): Ditto.
1596 (KJS::NegateNode::streamTo): Ditto.
1597 (KJS::BitwiseNotNode::streamTo): Ditto.
1598 (KJS::LogicalNotNode::streamTo): Ditto.
1599 (KJS::MultNode::streamTo): Use streamLeftAssociativeBinaryOperator.
1600 (KJS::DivNode::streamTo): Ditto.
1601 (KJS::ModNode::streamTo): Ditto.
1602 (KJS::AddNode::streamTo): Ditto.
1603 (KJS::SubNode::streamTo): Ditto.
1604 (KJS::LeftShiftNode::streamTo): Ditto.
1605 (KJS::RightShiftNode::streamTo): Ditto.
1606 (KJS::UnsignedRightShiftNode::streamTo): Ditto.
1607 (KJS::LessNode::streamTo): Ditto.
1608 (KJS::GreaterNode::streamTo): Ditto.
1609 (KJS::LessEqNode::streamTo): Ditto.
1610 (KJS::GreaterEqNode::streamTo): Ditto.
1611 (KJS::InstanceOfNode::streamTo): Ditto.
1612 (KJS::InNode::streamTo): Ditto.
1613 (KJS::EqualNode::streamTo): Ditto.
1614 (KJS::NotEqualNode::streamTo): Ditto.
1615 (KJS::StrictEqualNode::streamTo): Ditto.
1616 (KJS::NotStrictEqualNode::streamTo): Ditto.
1617 (KJS::BitAndNode::streamTo): Ditto.
1618 (KJS::BitXOrNode::streamTo): Ditto.
1619 (KJS::BitOrNode::streamTo): Ditto.
1620 (KJS::LogicalAndNode::streamTo): Ditto.
1621 (KJS::LogicalOrNode::streamTo): Ditto.
1622 (KJS::ConditionalNode::streamTo): Ditto.
1623 (KJS::AssignResolveNode::streamTo): Use PrecAssignment for the right side.
1624 (KJS::AssignBracketNode::streamTo): Use PrecCall for the expression before
1625 the bracket and PrecAssignment for the right side.
1626 (KJS::AssignDotNode::streamTo): Ditto.
1627 (KJS::AssignErrorNode::streamTo): Use PrecLeftHandSide for the left side
1628 and PrecAssignment for the right side.
1629 (KJS::CommaNode::streamTo): Use PrecAssignment for both expressions.
1630 (KJS::AssignExprNode::streamTo): Use PrecAssignment.
1632 2007-10-28 Kevin Ollivier <kevino@theolliviers.com>
1634 Define wx port and set wx port USE options.
1636 Reviewed by Adam Roben.
1640 2007-10-28 Mark Rowe <mrowe@apple.com>
1642 We don't include "config.h" in headers.
1644 * bindings/jni/jni_instance.h:
1649 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1651 Rubber stamped by Mark.
1653 - avoid using non-portable SIZE_T_MAX in favor of std::numeric_limits
1655 * kjs/SymbolTable.h:
1656 (KJS::SymbolTableIndexHashTraits::emptyValue):
1658 (KJS::ActivationImp::getOwnPropertySlot):
1659 (KJS::ActivationImp::put):
1661 2007-10-28 Maciej Stachowiak <mjs@apple.com>
1665 - switch SymbolTable to be a HashMap instead of a PropertyMap for 3% SunSpider speedup
1667 * kjs/SymbolTable.h:
1668 (KJS::IdentifierRepHash::hash): Special hash function for identifier reps.
1669 (KJS::IdentifierRepHash::equal): ditto
1670 (KJS::SymbolTableIndexHashTraits::emptyValue): Special HashTraits for the index value.
1671 (KJS::SymbolTable): change to a typedef for a HashMap.
1673 (KJS::ActivationImp::getOwnPropertySlot): Adjusted for new SymbolTable API.
1674 (KJS::ActivationImp::deleteProperty): ditto
1675 (KJS::ActivationImp::put): ditto
1678 (KJS::FunctionBodyNode::initializesymbolTable): Adjusted, since
1679 you now have to store a UString::rep, not an identifier.
1681 2007-10-27 Maciej Stachowiak <mjs@apple.com>
1685 - numerous HashTable performance improvements
1687 This does not quite add up to a measurable win on SunSpider, but it allows a
1688 follow-on > 3% improvement and probably helps WebCore too.
1690 I made the following improvements, among others:
1692 - Made HashFunctions note whether it is ok to compare a real value with the equal() function
1693 to the empty or deleted value, and used this to optimize the comparisons done in hash lookup.
1695 - Specialized lookup so it doesn't have to do so many extra branches and build so many extra
1696 std::pairs for cases that don't need them. There are now four versions, one for read-only access,
1697 two for writing, and one folded directly into add() (these all were improvments).
1699 - Made HashMap::get() use lookup() directly instead of find() to avoid having to build iterators.
1701 - Made a special constructor for iterators that knows it points to
1702 a valid filled cell and so skips updating itself.
1704 - Reordered memory accesses in the various lookup functions for better code generation
1706 - Made simple translators avoid passing a hash code around
1708 - Other minor tweaks
1712 (WTF::HashTableConstIterator::HashTableConstIterator):
1713 (WTF::HashTableIterator::HashTableIterator):
1714 (WTF::IdentityHashTranslator::translate):
1715 (WTF::HashTable::end):
1716 (WTF::HashTable::lookup):
1717 (WTF::HashTable::lookupForWriting):
1718 (WTF::HashTable::makeKnownGoodIterator):
1719 (WTF::HashTable::makeKnownGoodConstIterator):
1721 (WTF::::lookupForWriting):
1722 (WTF::::fullLookupForWriting):
1724 (WTF::::addPassingHashCode):
1728 * kjs/identifier.cpp:
1730 * wtf/HashFunctions.h:
1738 * wtf/ListHashSet.h:
1739 (WTF::ListHashSetTranslator::translate):
1741 2007-10-27 Darin Adler <darin@apple.com>
1745 - fix ASCIICType.h for some Windows compiles
1747 * wtf/ASCIICType.h: Check the compiler, not the OS, since it's the
1748 compiler/library that has the wchar_t that is just a typedef.
1750 2007-10-27 Kevin McCullough <kmccullough@apple.com>
1753 - Forgot to change the build step when I changed the filename.
1755 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1757 2007-10-27 Geoffrey Garen <ggaren@apple.com>
1759 Reviewed by Darin Adler.
1761 Fixed the rest of "ASSERTION FAILED: _hash in KJS::UString::Rep::
1763 http://bugs.webkit.org/show_bug.cgi?id=15718
1765 * kjs/identifier.cpp: Fixed more cases where an Identifier didn't get a
1766 hash value. Also changed O(n) strlen to O(1) check for empty string.
1767 (KJS::Identifier::add):
1769 * kjs/ustring.cpp: Changed O(n) strlens to O(1) checks for empty string.
1770 (KJS::UString::UString):
1771 (KJS::UString::operator=):
1773 2007-10-27 Darin Adler <darin@apple.com>
1777 - fix pow on Windows
1779 * wtf/MathExtras.h: (wtf_pow): Add a special case for MSVC, which has
1780 a "pow" function that does not properly handle the case where arg1 is
1783 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Don't explicity
1784 specify "::pow" -- just "pow" is fine.
1786 2007-10-27 Darin Adler <darin@apple.com>
1790 - http://bugs.webkit.org/show_bug.cgi?id=15711
1791 force JSImmediate to be inlined for roughly 1.2% SunSpider speedup
1793 * kjs/JSImmediate.h: Put ALWAYS_INLINE on everything.
1795 * kjs/object.h: Removed redundant includes.
1796 * kjs/value.h: Ditto.
1798 2007-10-27 Maciej Stachowiak <mjs@apple.com>
1802 - fixed "ASSERTION FAILED: _hash in KJS::UString::Rep::computedHash()"
1803 http://bugs.webkit.org/show_bug.cgi?id=15718
1805 * kjs/identifier.cpp:
1806 (KJS::Identifier::addSlowCase): Ensure that empty Identifiers have a hash computed,
1807 now that we count on all Identifiers already having one.
1809 2007-10-27 Mark Rowe <mrowe@apple.com>
1813 * kjs/SymbolTable.h:
1815 2007-10-27 Mark Rowe <mrowe@apple.com>
1821 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1823 Rubber stamp by Adam.
1825 - Renamed JSStringRefCOM to JSStringRefBSTR since it he only thing the
1826 files contain are functions that operate on BSTRs.
1828 * API/JSStringRefBSTR.cpp: Copied from API/JSStringRefCOM.cpp.
1829 * API/JSStringRefBSTR.h: Copied from API/JSStringRefCOM.h.
1830 * API/JSStringRefCOM.cpp: Removed.
1831 * API/JSStringRefCOM.h: Removed.
1832 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1834 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1838 - Made JSStringCreateWithBSTR capable of handling null BSTRs.
1840 * API/JSStringRefCOM.cpp:
1841 (JSStringCreateWithBSTR):
1843 2007-10-26 Sam Weinig <sam@webkit.org>
1847 * kjs/SymbolTable.h: Add header gaurd.
1848 * kjs/nodes.h: #include "SymbolTable.h"
1850 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1852 Suggested by Anders Carlsson.
1857 (KJS::ActivationImp::getOwnPropertySlot):
1859 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1861 Suggested by Darin Adler.
1863 Use computedHash(), which is safer than just directly accessing _hash.
1866 (KJS::Lookup::findEntry):
1867 (KJS::Lookup::find):
1869 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1871 Build fix: svn add SymbolTable.h
1873 * kjs/SymbolTable.h: Added.
1874 (KJS::SymbolTable::set):
1875 (KJS::SymbolTable::get):
1877 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1879 Build fix: export SymbolTable.h to WebCore.
1881 * JavaScriptCore.xcodeproj/project.pbxproj:
1883 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1885 Comment tweak suggested by Maciej.
1888 (KJS::ActivationImp::getOwnPropertySlot):
1890 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1892 Reviewed by Maciej Stachowiak.
1894 Tweaked property maps to remove 2 branches. 2.5% speedup on SunSpider.
1896 * kjs/property_map.cpp: Use a special no branch accessor to the UString's
1897 hash value. Also, return immediately instead of branching to the end
1898 of the loop if the value is not found.
1899 (KJS::PropertyMap::get):
1900 (KJS::PropertyMap::getLocation):
1901 (KJS::PropertyMap::put):
1902 (KJS::PropertyMap::insert):
1903 (KJS::PropertyMap::remove):
1904 (KJS::PropertyMap::checkConsistency):
1907 (KJS::UString::Rep::computedHash): Special no branch accessor to the
1908 UString's hash value. Used when the caller knows that the hash value
1909 has already been computed. (For example, if the caller got the UString
1910 from an Identifier.)
1912 2007-10-26 Geoffrey Garen <ggaren@apple.com>
1914 Reviewed by Maciej Stachowiak.
1916 Switched ActivationImp to using a symbol table. For now, though, all
1917 clients take the slow path.
1919 Net .6% speedup on SunSpider.
1922 - ActivationImp now mallocs in its constructor
1923 - Local variable hits use an extra level of indirection to retrieve
1925 - Local variable misses do two lookups
1928 - Fast initialization of local variables upon function entry
1930 * JavaScriptCore.xcodeproj/project.pbxproj: Added SymbolTable.h
1933 (KJS::ActivationImp::ActivationImp): Malloc a private structure to hold
1934 data that won't fit in a JSCell.
1935 (KJS::ActivationImp::argumentsGetter): Use slow symbol table path for
1937 (KJS::ActivationImp::getOwnPropertySlot): ditto
1938 (KJS::ActivationImp::deleteProperty): ditto
1939 (KJS::ActivationImp::put): ditto
1940 (KJS::ActivationImp::createArgumentsObject): ditto
1942 (KJS::ActivationImp::mark): Call JSObject::mark first so that one of
1943 our properties doesn't try to recursively mark us. (This caused a crash
1944 in earlier testing. Not sure why we haven't run into it before.)
1946 * kjs/nodes.cpp: Functions now build a symbol table the first time
1948 (KJS::VarDeclNode::evaluate):
1949 (KJS::FunctionBodyNode::FunctionBodyNode):
1950 (KJS::FunctionBodyNode::initializeSymbolTable):
1951 (KJS::FunctionBodyNode::processDeclarations):
1952 (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
1953 (KJS::FunctionBodyNode::processDeclarationsForProgramCode):
1956 (KJS::FunctionBodyNode::symbolTable):
1958 * wtf/Forward.h: Added Vector.
1960 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1962 - Corrected function name mistake in this changelog.
1964 2007-10-26 Kevin McCullough <kmccullough@apple.com>
1965 Reviewed by Sam and Steve.
1967 - Added convenience methods for converting between BSTR and JSStringRefs
1969 * API/JSStringRefCOM.cpp: Added.
1970 (JSStringCreateWithBSTR):
1972 * API/JSStringRefCOM.h: Added.
1973 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1975 2007-10-26 Mark Rowe <mrowe@apple.com>
1979 * kjs/collector.cpp:
1980 (KJS::Collector::collect):
1982 2007-10-26 Oliver Hunt <oliver@apple.com>
1986 Make the JSC GC use a separate heap for JSNumbers to get a 0.7-1.4% progression in SunSpider.
1988 * kjs/CollectorHeapIntrospector.cpp:
1989 (KJS::CollectorHeapIntrospector::init):
1990 (KJS::CollectorHeapIntrospector::enumerate):
1991 * kjs/CollectorHeapIntrospector.h:
1992 * kjs/collector.cpp:
1993 (KJS::Collector::recordExtraCost):
1994 (KJS::Collector::heapAllocate):
1995 (KJS::Collector::allocate):
1996 (KJS::Collector::allocateNumber):
1997 (KJS::Collector::registerThread):
1998 (KJS::Collector::markStackObjectsConservatively):
1999 (KJS::Collector::markMainThreadOnlyObjects):
2000 (KJS::Collector::sweep):
2001 (KJS::Collector::collect):
2004 (KJS::NumberImp::operator new):
2005 Force numbers to be allocated in the secondary heap.
2007 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2011 - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
2014 (KJS::JSValue::getUInt32):
2015 (KJS::JSValue::getTruncatedInt32):
2016 (KJS::JSValue::toNumber):
2018 (WTF::PassRefPtr::~PassRefPtr):
2020 (WTF::RefPtr::operator->):
2022 2007-10-26 Mark Rowe <mrowe@apple.com>
2028 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2032 - Merge Context class fully into ExecState, since they are always created and used together.
2034 No measurable performance impact but this is a useful cleanup.
2036 * JavaScriptCore.pri:
2037 * kjs/ExecState.cpp:
2038 (KJS::ExecState::ExecState):
2039 (KJS::ExecState::~ExecState):
2040 (KJS::ExecState::mark):
2041 (KJS::ExecState::lexicalInterpreter):
2043 (KJS::ExecState::dynamicInterpreter):
2044 (KJS::ExecState::setException):
2045 (KJS::ExecState::clearException):
2046 (KJS::ExecState::exception):
2047 (KJS::ExecState::exceptionSlot):
2048 (KJS::ExecState::hadException):
2049 (KJS::ExecState::scopeChain):
2050 (KJS::ExecState::callingExecState):
2051 (KJS::ExecState::propertyNames):
2052 * kjs/collector.cpp:
2053 (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2055 (KJS::FunctionImp::callAsFunction):
2056 (KJS::FunctionImp::argumentsGetter):
2057 (KJS::FunctionImp::callerGetter):
2058 (KJS::GlobalFuncImp::callAsFunction):
2059 * kjs/interpreter.cpp:
2060 (KJS::Interpreter::Interpreter):
2061 (KJS::Interpreter::init):
2062 (KJS::Interpreter::evaluate):
2063 (KJS::Interpreter::mark):
2064 * kjs/interpreter.h:
2065 (KJS::Interpreter::setCurrentExec):
2066 (KJS::Interpreter::currentExec):
2068 (KJS::currentSourceId):
2069 (KJS::currentSourceURL):
2070 (KJS::ThisNode::evaluate):
2071 (KJS::ResolveNode::evaluate):
2072 (KJS::FunctionCallResolveNode::evaluate):
2073 (KJS::PostfixResolveNode::evaluate):
2074 (KJS::DeleteResolveNode::evaluate):
2075 (KJS::TypeOfResolveNode::evaluate):
2076 (KJS::PrefixResolveNode::evaluate):
2077 (KJS::AssignResolveNode::evaluate):
2078 (KJS::VarDeclNode::evaluate):
2079 (KJS::DoWhileNode::execute):
2080 (KJS::WhileNode::execute):
2081 (KJS::ForNode::execute):
2082 (KJS::ForInNode::execute):
2083 (KJS::ContinueNode::execute):
2084 (KJS::BreakNode::execute):
2085 (KJS::ReturnNode::execute):
2086 (KJS::WithNode::execute):
2087 (KJS::SwitchNode::execute):
2088 (KJS::LabelNode::execute):
2089 (KJS::TryNode::execute):
2090 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2091 (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2092 (KJS::FunctionBodyNode::processDeclarations):
2093 (KJS::FuncDeclNode::makeFunction):
2094 (KJS::FuncExprNode::evaluate):
2096 2007-10-26 Mark Rowe <mrowe@apple.com>
2100 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2102 2007-10-26 Mark Rowe <mrowe@apple.com>
2106 * JavaScriptCore.pri:
2107 * kjs/ExecState.cpp:
2109 2007-10-26 Maciej Stachowiak <mjs@apple.com>
2113 - moved Context class into ExecState.{h,cpp} in preparation for merging
2114 ExecState and Context classes.
2116 * kjs/ExecState.h: Moved CodeType enum and Context class here in
2117 preparation for merging ExecState and Context.
2118 * kjs/ExecState.cpp: Moved Context class here from Context.cpp.
2119 (KJS::Context::Context):
2120 (KJS::Context::~Context):
2121 (KJS::Context::mark):
2122 * kjs/context.h: Removed.
2123 * kjs/Context.cpp: Removed.
2124 * kjs/function.h: Removed CodeType enum.
2125 * kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
2126 * kjs/internal.h: Removed LabelStack.
2127 * JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
2128 * kjs/collector.cpp: Fixed includes.
2129 * kjs/function.cpp: ditto
2130 * kjs/internal.cpp: ditto
2131 * kjs/interpreter.cpp: ditto
2132 * kjs/lookup.h: ditto
2133 * kjs/nodes.cpp: ditto
2135 2007-10-26 Mark Rowe <mrowe@apple.com>
2139 * kjs/string_object.cpp:
2140 (KJS::StringObjectFuncImp::callAsFunction):
2142 2007-10-25 Darin Adler <darin@apple.com>
2146 - http://bugs.webkit.org/show_bug.cgi?id=15703
2147 fix numeric functions -- improve correctness and speed
2149 Gives about 1% gain on SunSpider.
2151 * kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
2152 (KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
2153 with both immediate and number values.
2154 (KJS::JSValue::toUInt32): Ditto.
2156 (KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
2157 differences. One is that it now correctly returns 0 for NaN, and another is that
2158 there's no special case for 0 or infinity, since the general case already handles
2160 (KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
2162 (KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
2163 truncation done by the typecast already does the necessary truncation that
2164 roundValue was doing.
2165 (KJS::JSValue::toUInt32SlowCase): Ditto.
2166 (KJS::JSValue::toUInt16): Removed.
2168 * kjs/internal.h: Removed roundValue.
2169 * kjs/internal.cpp: Ditto.
2171 * kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
2172 code to handle NaN in Array.slice; toInteger now never returns NaN as specified.
2174 * kjs/date_object.cpp:
2175 (KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
2176 toNumber as specified.
2177 (KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
2178 with a call to toNumber and timeClip as specified.
2179 (KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
2180 where the default behavior of toInt32 (returning 0) was already correct. Replaced
2181 call to roundValue with a call to toNumber as specified.
2182 (KJS::DateObjectFuncImp::callAsFunction): Ditto.
2184 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
2185 cases for the pow function that the library already handles correctly.
2187 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
2188 call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
2189 The real toInteger now returns 0 for NaN. Took out unneeded special case in
2190 ToFixed for undefined; was only needed because our toInteger was wrong. Same
2191 thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.
2193 * kjs/string_object.cpp:
2194 (KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
2195 cases for undefined that were only needed because toInteger was wrong. Same in
2196 IndexOf, and was able to remove some special cases. In LastIndexOf, used
2197 toIntegerPreserveNaN, but was able to remove some special cases there too.
2198 Changed Substr implementation to preserve correct behavior with the change
2199 to toInteger and match the specification. Also made sure we weren't converting
2200 an out of range double to an int.
2201 (KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
2202 toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
2203 no reason to have toUInt16 as a second, less-optimized function that's only
2204 called at this one call site.
2206 * wtf/MathExtras.h: Added trunc function for Windows.
2208 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2210 Reviewed by Maciej Stachowiak.
2212 Tweaked the inner hashtable lookup loop to remove a branch in the "not
2213 found" case. .5% speedup on SunSpider.
2215 * JavaScriptCore.xcodeproj/project.pbxproj:
2219 2007-10-25 Maciej Stachowiak <mjs@apple.com>
2223 - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider
2226 (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
2227 adding any value over toNumber() here.
2228 (KJS::valueForReadModifyAssignment): Ditto.
2229 (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
2231 (KJS::lessThanEq): Ditto.
2232 * JavaScriptCore.exp: Export new functions as needed.
2234 (KJS::JSValue::toPrimitive): Fixed formatting.
2235 (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
2236 to number and tells you whether a toPrimitive() conversion with a Number hint
2237 would have given a string.
2239 (KJS::StringImp::getPrimitiveNumber): Implemented.
2240 (KJS::NumberImp::getPrimitiveNumber): ditto
2241 (KJS::GetterSetterImp::getPrimitiveNumber): ditto
2242 (KJS::StringImp::toPrimitive): Fixed formatting.
2243 (KJS::NumberImp::toPrimitive): ditto
2244 (KJS::GetterSetterImp::toPrimitive): ditto
2247 (KJS::JSObject::getPrimitiveNumber): Implemented.
2250 2007-10-25 Sam Weinig <sam@webkit.org>
2252 Reviewed by Adam Roben.
2254 Remove JSStringRefCFHack from windows as it is no longer needed.
2256 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2258 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2260 Reviewed by Oliver Hunt.
2262 Rolled out my last patch. It turns out that I needed 2 words, not 1,
2265 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2267 Reviewed by Oliver Hunt.
2269 Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
2270 Shrink the size of an activation object by 1 word
2272 This is in preparation for adding a symbol table to the activation
2275 The basic strategy here is to rely on the mutual exclusion between
2276 the arguments object pointer and the function pointer (you only need
2277 the latter in order to create the former), and store them in the same
2278 place. The LazyArgumentsObject class encapsulates this strategy.
2280 Also inlined the ArgumentsImp constructor, for good measure.
2282 SunSpider reports no regression. Regression tests pass.
2284 * JavaScriptCore.xcodeproj/project.pbxproj:
2286 (KJS::Context::~Context):
2288 (KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
2289 (KJS::ActivationImp::LazyArgumentsObject::mark):
2291 (KJS::ActivationImp::argumentsGetter):
2292 (KJS::ActivationImp::mark):
2294 (KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
2295 (KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
2296 (KJS::ActivationImp::LazyArgumentsObject::resetArguments):
2297 (KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
2298 (KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
2299 (KJS::ActivationImp::LazyArgumentsObject::setFunction):
2300 (KJS::ActivationImp::LazyArgumentsObject::function):
2301 (KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
2302 (KJS::ActivationImp::LazyArgumentsObject::):
2303 (KJS::ActivationImp::ActivationImp::ActivationImp):
2304 (KJS::ActivationImp::resetArguments):
2306 2007-10-25 Adam Roben <aroben@apple.com>
2308 Change JavaScriptCore.vcproj to use DerivedSources.make
2310 We were trying to emulate the logic of make in
2311 build-generated-files.sh, but we got it wrong. We now use a
2312 build-generated-files very much like the one that WebCore uses to
2315 We also now only have a Debug configuration of dftables which we build
2316 even when doing a Release build of JavaScriptCore. dftables also no
2317 longer has the "_debug" name suffix.
2319 Changes mostly made by Darin, reviewed by me.
2321 * DerivedSources.make: Add a variable to set the extension used for
2322 the dftables executable.
2323 * JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
2324 dftables in Release configurations.
2325 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
2326 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2327 - Updated include path to point to the new location of the derived
2329 - Modified pre-build event to pass the right arguments to
2330 build-generated-files.sh and not call dftables directly.
2331 - Added the derived source files to the project.
2332 - Removed grammarWrapper.cpp, which isn't needed now that we're
2333 compiling grammar.cpp directly.
2334 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2335 Slightly modified from the WebCore version.
2336 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
2337 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2338 - Changed the output location to match Mac.
2339 - Removed the Release configuration.
2340 - Removed the _debug suffix.
2342 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2344 Reviewed by Eric Seidel.
2346 Slightly elaborated the differences between declaration procesing in
2347 Function Code and Program Code.
2349 .3% speedup on SunSpider.
2352 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2353 (KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a
2354 minimum set of attributes instead of recomputing all the time. Also,
2355 ignore m_parameters, since programs don't have arguments.
2357 2007-10-25 Eric Seidel <eric@webkit.org>
2361 More preparation work before adding long-running mode to testkjs.
2364 (TestFunctionImp::callAsFunction):
2365 (prettyPrintScript):
2369 (fillBufferWithContentsOfFile):
2371 2007-10-25 Eric Seidel <eric@webkit.org>
2375 Bring testkjs code out of the dark ages in preparation for more
2376 radical improvements (like long-running testing support!)
2379 (TestFunctionImp::callAsFunction):
2382 (fillBufferWithContentsOfFile):
2384 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2386 Reviewed by Maciej Stachowiak.
2388 Make a fast path for declaration processing inside Function Code.
2390 Lifted declaration processing code up from individual declaration nodes
2391 and into processDeclarations.
2393 Broke out processDeclarations into two cases, depending on the type of
2394 code. This eliminates 2 branches, and facilitates more radical
2395 divergeance in the future.
2397 2.5% SunSpider speedup.
2399 * JavaScriptCore.xcodeproj/project.pbxproj:
2401 (KJS::FunctionBodyNode::initializeDeclarationStacks):
2402 (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2403 (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2404 (KJS::FunctionBodyNode::execute):
2405 (KJS::FuncDeclNode::makeFunction):
2409 2007-10-25 Maciej Stachowiak <mjs@apple.com>
2413 - add header includes needed on platforms that don't use AllInOneFile.cpp
2415 * API/JSCallbackObject.cpp:
2417 * kjs/ExecState.cpp:
2418 * kjs/array_instance.cpp:
2419 * kjs/function_object.cpp:
2420 * kjs/interpreter.cpp:
2423 2007-10-25 Eric Seidel <eric@webkit.org>
2427 * JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private
2429 2007-10-25 Geoffrey Garen <ggaren@apple.com>
2431 Reviewed by Maciej Stachowiak.
2433 Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
2434 Re-order declaration initialization to avoid calling hasProperty inside
2435 VarDeclNode::processDeclaration
2437 .7% speedup on SunSpider.
2440 * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
2441 other processing of declared symbols, so the order of execution could
2445 (KJS::VarDeclNode::getDeclarations): Added special case for the
2446 "arguments" property name, explained in the comment.
2448 (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
2449 in the case of function code, since we know the declared symbol
2450 management will resolve conflicts between symbols. Yay!
2452 (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's
2453 implementation of getDeclarations is non-trivial, we can't take a
2454 short-cut here any longer -- we need to put the VarDecl node on the
2455 stack so it gets processed normally.
2457 (KJS::FunctionBodyNode::processDeclarations): Changed the order of
2458 processing to enforce mutual exclusion rules.
2461 (KJS::DeclarationStacks::DeclarationStacks): Structure includes an
2462 ExecState now, for fast access to the "arguments" property name.
2464 2007-10-24 Eric Seidel <eric@webkit.org>
2468 Add a JSGlobalObject class and remove the InterpreterMap
2469 http://bugs.webkit.org/show_bug.cgi?id=15681
2471 This required making JSCallbackObject a template class to allow for
2472 JSGlobalObjects with JSCallbackObject functionality.
2474 SunSpider claims this was a 0.5% speedup.
2476 * API/JSCallbackObject.cpp:
2478 * API/JSCallbackObject.h:
2479 * API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
2480 (KJS::::JSCallbackObject):
2482 (KJS::::~JSCallbackObject):
2483 (KJS::::initializeIfNeeded):
2485 (KJS::::getOwnPropertySlot):
2487 (KJS::::deleteProperty):
2488 (KJS::::implementsConstruct):
2490 (KJS::::implementsHasInstance):
2491 (KJS::::hasInstance):
2492 (KJS::::implementsCall):
2493 (KJS::::callAsFunction):
2494 (KJS::::getPropertyNames):
2497 (KJS::::setPrivate):
2498 (KJS::::getPrivate):
2500 (KJS::::cachedValueGetter):
2501 (KJS::::staticValueGetter):
2502 (KJS::::staticFunctionGetter):
2503 (KJS::::callbackGetter):
2504 * API/JSClassRef.cpp:
2505 (OpaqueJSClass::prototype):
2506 * API/JSContextRef.cpp:
2507 (JSGlobalContextCreate):
2508 * API/JSObjectRef.cpp:
2510 (JSObjectGetPrivate):
2511 (JSObjectSetPrivate):
2512 * API/JSValueRef.cpp:
2513 (JSValueIsObjectOfClass):
2514 * JavaScriptCore.exp:
2515 * JavaScriptCore.xcodeproj/project.pbxproj:
2516 * bindings/c/c_utility.cpp:
2517 (KJS::Bindings::convertValueToNPVariant):
2518 * bindings/jni/jni_jsobject.cpp:
2519 * bindings/objc/objc_utility.mm:
2520 (KJS::Bindings::convertValueToObjcValue):
2522 (KJS::Context::Context):
2523 * kjs/ExecState.cpp:
2524 (KJS::ExecState::lexicalInterpreter):
2525 * kjs/JSGlobalObject.h: Added.
2526 (KJS::JSGlobalObject::JSGlobalObject):
2527 (KJS::JSGlobalObject::isGlobalObject):
2528 (KJS::JSGlobalObject::interpreter):
2529 (KJS::JSGlobalObject::setInterpreter):
2530 * kjs/array_instance.cpp:
2533 (KJS::FunctionImp::callAsFunction):
2534 (KJS::GlobalFuncImp::callAsFunction):
2535 * kjs/interpreter.cpp:
2536 (KJS::Interpreter::Interpreter):
2537 (KJS::Interpreter::init):
2538 (KJS::Interpreter::~Interpreter):
2539 (KJS::Interpreter::globalObject):
2540 (KJS::Interpreter::initGlobalObject):
2541 (KJS::Interpreter::evaluate):
2542 * kjs/interpreter.h:
2544 (KJS::cacheGlobalObject):
2546 (KJS::JSObject::isGlobalObject):
2549 2007-10-24 Eric Seidel <eric@webkit.org>
2551 Build fix for Gtk, no review.
2553 * kjs/collector.cpp: #include "context.h"
2555 2007-10-24 Eric Seidel <eric@webkit.org>
2559 Stop checking isOutOfMemory after every allocation, instead let the collector
2560 notify all ExecStates if we ever hit this rare condition.
2562 SunSpider claims this was a 2.2% speedup.
2564 * kjs/collector.cpp:
2565 (KJS::Collector::collect):
2566 (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2569 (KJS::TryNode::execute):
2571 2007-10-24 Mark Rowe <mrowe@apple.com>
2575 * kjs/identifier.h: Remove extra qualification.
2577 2007-10-24 Geoffrey Garen <ggaren@apple.com>
2579 Reviewed by Sam Weinig.
2581 Disable ALWAYS_INLINE in debug builds, since it drives the debugger
2584 * wtf/AlwaysInline.h:
2586 2007-10-24 Geoffrey Garen <ggaren@apple.com>
2588 Reviewed by Sam Weinig.
2590 Inlined the fast path for creating an Identifier from an Identifier.
2592 This is a .4% speedup on SunSpider overall, but as big as a 2.5%
2593 speedup on certain individual tests. 65% of the Identifiers creating
2594 by SunSpider are already Identifiers.
2596 (The main reason I'm making this change is that it resolves a large
2597 regression in a patch I haven't checked in yet.)
2599 * JavaScriptCore.exp:
2600 * kjs/identifier.cpp:
2601 (KJS::Identifier::addSlowCase):
2603 (KJS::Identifier::Identifier::add):
2605 2007-10-24 Lars Knoll <lars@trolltech.com>
2609 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.
2611 * bindings/qt/qt_instance.cpp:
2612 (KJS::Bindings::QtInstance::invokeMethod):
2613 * bindings/qt/qt_runtime.cpp:
2614 (KJS::Bindings::convertValueToQVariant):
2615 (KJS::Bindings::QtField::setValueToInstance):
2617 2007-10-24 Oliver Hunt <oliver@apple.com>
2621 Remove old relation method, replace with specialised LessThan and lessThenEq functions for a 0.5-0.6% improvement in SunSpider
2626 (KJS::LessNode::evaluate):
2627 (KJS::GreaterNode::evaluate):
2628 (KJS::LessEqNode::evaluate):
2629 (KJS::GreaterEqNode::evaluate):
2630 * kjs/operations.cpp:
2633 2007-10-24 Eric Seidel <eric@webkit.org>
2638 (KJS::ImmediateNumberNode::): Fix ASSERT correctness (and debug build!)
2640 2007-10-24 Darin Adler <darin@apple.com>
2644 * kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little
2645 Identifier ref/deref for what SunSpider claims is a 0.4% speedup.
2647 2007-10-24 Darin Adler <darin@apple.com>
2651 - separate out the code to create a hash table the first time from the code
2654 SunSpider claims this was a 0.7% speedup.
2656 * kjs/property_map.cpp:
2657 (KJS::PropertyMap::expand): Changed to call either createTable or rehash.
2658 (KJS::PropertyMap::createTable): Added. For the case where we had no table.
2659 (KJS::PropertyMap::rehash): Removed code needed only in the case where we
2661 * kjs/property_map.h: Added createTable.
2663 2007-10-24 Eric Seidel <eric@webkit.org>
2667 Add ImmediateNumberNode to hold a JSValue* instead of a double for numbers
2668 which can be represented by JSImmediate.
2670 SunSpider claims this was a 0.6% speedup.
2674 (KJS::NumberNode::evaluate):
2675 (KJS::ImmediateNumberNode::evaluate):
2678 (KJS::ImmediateNumberNode::):
2679 * kjs/nodes2string.cpp:
2680 (ImmediateNumberNode::streamTo):
2682 2007-10-24 Darin Adler <darin@apple.com>
2686 - http://bugs.webkit.org/show_bug.cgi?id=15657
2687 change static hash tables to use powers of two for speed
2689 Seems to give 0.7% SunSpider speedup.
2691 * kjs/create_hash_table: Updated to generate new format.
2693 (KJS::keysMatch): Took out unneeded typecast.
2694 (KJS::findEntry): Updated to expect table type 3 -- changed the printf to a plain old assert.
2695 Replaced the modulus with a bit mask.
2696 (KJS::Lookup::findEntry): Get the hash directly, since we know identifiers already have computed
2697 their hash -- saves a branch.
2698 (KJS::Lookup::find): Ditto.
2699 * kjs/lookup.h: Changed attr from 2-byte value to one-byte value. Replaced hashSize with hashSizeMask.
2701 2007-10-24 Maciej Stachowiak <mjs@apple.com>
2705 - remove KJS_CHECKEXCEPTIONs in places where exceptions can't happen for 0.6% SunSpider speedup
2708 (KJS::DoWhileNode::execute):
2709 (KJS::WhileNode::execute):
2710 (KJS::ForNode::execute):
2711 (KJS::ForInNode::execute):
2712 (KJS::SourceElementsNode::execute):
2714 2007-10-23 Darin Adler <darin@apple.com>
2718 * kjs/JSImmediate.h: (KJS::JSImmediate::getUInt32):
2719 Changed an && to an & for a 1% gain in SunSpider.
2721 2007-10-23 Oliver Hunt <oliver@apple.com>
2725 Reduce branching in implementations of some operator implementations, yielding 1.3% boost to SunSpider.
2728 (KJS::MultNode::evaluate):
2729 (KJS::DivNode::evaluate):
2730 (KJS::ModNode::evaluate):
2733 (KJS::AddNode::evaluate):
2734 (KJS::SubNode::evaluate):
2735 (KJS::valueForReadModifyAssignment):
2736 * kjs/operations.cpp:
2739 2007-10-23 Oliver Hunt <oliver@apple.com>
2743 Separating all of the simple (eg. non-read-modify-write) binary operators
2744 into separate classes in preparation for further JS optimisations.
2746 Happily this produces a 0.8% to 1.0% performance increase in SunSpider with
2749 * JavaScriptCore.xcodeproj/project.pbxproj:
2752 (KJS::MultNode::evaluate):
2753 (KJS::DivNode::evaluate):
2754 (KJS::ModNode::evaluate):
2755 (KJS::AddNode::evaluate):
2756 (KJS::SubNode::evaluate):
2757 (KJS::LeftShiftNode::evaluate):
2758 (KJS::RightShiftNode::evaluate):
2759 (KJS::UnsignedRightShiftNode::evaluate):
2760 (KJS::LessNode::evaluate):
2761 (KJS::GreaterNode::evaluate):
2762 (KJS::LessEqNode::evaluate):
2763 (KJS::GreaterEqNode::evaluate):
2764 (KJS::InstanceOfNode::evaluate):
2765 (KJS::InNode::evaluate):
2766 (KJS::EqualNode::evaluate):
2767 (KJS::NotEqualNode::evaluate):
2768 (KJS::StrictEqualNode::evaluate):
2769 (KJS::NotStrictEqualNode::evaluate):
2770 (KJS::BitAndNode::evaluate):
2771 (KJS::BitXOrNode::evaluate):
2772 (KJS::BitOrNode::evaluate):
2773 (KJS::LogicalAndNode::evaluate):
2774 (KJS::LogicalOrNode::evaluate):
2781 (KJS::LeftShiftNode::):
2782 (KJS::RightShiftNode::):
2783 (KJS::UnsignedRightShiftNode::):
2785 (KJS::GreaterNode::):
2786 (KJS::LessEqNode::):
2787 (KJS::GreaterEqNode::):
2788 (KJS::InstanceOfNode::):
2791 (KJS::NotEqualNode::):
2792 (KJS::StrictEqualNode::):
2793 (KJS::NotStrictEqualNode::):
2794 (KJS::BitAndNode::):
2796 (KJS::BitXOrNode::):
2797 (KJS::LogicalAndNode::):
2798 (KJS::LogicalOrNode::):
2799 * kjs/nodes2string.cpp:
2800 (MultNode::streamTo):
2801 (DivNode::streamTo):
2802 (ModNode::streamTo):
2803 (AddNode::streamTo):
2804 (SubNode::streamTo):
2805 (LeftShiftNode::streamTo):
2806 (RightShiftNode::streamTo):
2807 (UnsignedRightShiftNode::streamTo):
2808 (LessNode::streamTo):
2809 (GreaterNode::streamTo):
2810 (LessEqNode::streamTo):
2811 (GreaterEqNode::streamTo):
2812 (InstanceOfNode::streamTo):
2814 (EqualNode::streamTo):
2815 (NotEqualNode::streamTo):
2816 (StrictEqualNode::streamTo):
2817 (NotStrictEqualNode::streamTo):
2818 (BitAndNode::streamTo):
2819 (BitXOrNode::streamTo):
2820 (BitOrNode::streamTo):
2821 (LogicalAndNode::streamTo):
2823 2007-10-23 Darin Adler <darin@apple.com>
2827 - fix http://bugs.webkit.org/show_bug.cgi?id=15639
2828 fix Math.abs(0), Math.ceil(-0), and Math.floor(-0)
2830 Test: fast/js/math.html
2832 * kjs/math_object.cpp: (MathFuncImp::callAsFunction):
2833 Fix abs to look at the sign bit. Add a special case for values in the range
2834 between -0 and -1 and a special case for ceil and for -0 for floor.
2836 2007-10-23 Darin Adler <darin@apple.com>
2840 - streamline exception handling code for a >1% speed-up of SunSpider
2842 * kjs/nodes.cpp: Changed macros to use functions for everything that's not
2843 part of normal execution. We'll take function call overhead when propagating
2844 an exception or out of memory.
2845 (KJS::createOutOfMemoryCompletion): Added.
2846 (KJS::substitute): Use append instead of the relatively inefficient + operator.
2847 (KJS::Node::rethrowException): Added.
2848 * kjs/nodes.h: Added rethrowException.
2850 2007-10-22 Darin Adler <darin@apple.com>
2854 - fix http://bugs.webkit.org/show_bug.cgi?id=15636
2855 some JavaScriptCore regression tests are failing due to numeric conversion
2857 This should restore correctness and make speed better too, restoring some
2858 of the optimization we lost in my last check-in.
2860 * kjs/JSImmediate.h:
2861 (KJS::JSImmediate::getTruncatedInt32): Added. Uses the range checking idiom
2862 I used in my patch yesterday.
2863 (KJS::JSImmediate::getTruncatedUInt32): Ditto.
2865 * kjs/internal.h: Removed getInt32 and added getTruncatedInt/UInt32.
2867 (KJS::NumberImp::getUInt32): Changed to always use double, since I can't find
2868 a way to write this more efficiently for float.
2869 (KJS::NumberImp::getTruncatedInt32): Added.
2870 (KJS::NumberImp::getTruncatedUInt32): Added.
2872 * kjs/value.h: Removed getInt32 and added getTruncatedInt/UInt32.
2873 (KJS::JSValue::getUInt32):
2874 (KJS::JSValue::getTruncatedInt32): Added.
2875 (KJS::JSValue::getTruncatedUInt32): Added.
2876 (KJS::JSValue::toInt32): Changed getInt32 call to getTruncatedInt32.
2877 (KJS::JSValue::toUInt32): Changed getUInt32 call to getTruncatedUInt32.
2879 (KJS::JSCell::getTruncatedInt32): Added.
2880 (KJS::JSCell::getTruncatedUInt32): Added.
2881 (KJS::JSValue::toInteger): Changed getUInt32 call to getTruncatedInt32.
2882 (KJS::JSValue::toInt32SlowCase): Removed extra getInt32 call I accidentally
2884 (KJS::JSValue::toUInt32SlowCase): Ditto.
2885 (KJS::JSValue::toUInt16): Changed getUInt32 call to getTruncatedUInt32.
2887 * JavaScriptCore.exp: Updated.
2889 2007-10-22 Darin Adler <darin@apple.com>
2893 - fix http://bugs.webkit.org/show_bug.cgi?id=15632
2894 js1_5/Array/array-001.js test failing
2896 One of the JavaScriptCore tests was failing; it failed because of
2897 my change to NumberImp::getUInt32. The incorrect code I copied was
2898 from JSImmediate::getUInt32, and was a pre-existing bug.
2900 This patch fixes correctness, but will surely slow down SunSpider.
2901 We may be able to code this tighter and get the speed back.
2903 * kjs/JSImmediate.h:
2904 (KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
2905 reflect the fact that this function only returns true if the value is
2906 accurate (no fractional part, etc.). Changed code so that it returns
2907 false when the value has a fraction.
2908 (KJS::JSImmediate::getUInt32): Ditto.
2911 (KJS::NumberImp::getInt32): Changed code so that it returns false when
2912 the value has a fraction. Restores the old behavior.
2913 (KJS::NumberImp::getUInt32): Ditto.
2916 (KJS::JSValue::getInt32): Updated for name change.
2917 (KJS::JSValue::getUInt32): Ditto.
2918 (KJS::JSValue::toInt32): Ditto.
2919 (KJS::JSValue::toUInt32): Ditto.
2921 2007-10-22 Darin Adler <darin@apple.com>
2925 - fix crash seen when running JavaScriptCore tests
2927 * kjs/array_instance.cpp: (KJS::ArrayInstance::mark):
2928 Copy and paste error: I accidentally had code here that was
2929 making a copy of the HashMap -- that's illegal inside a mark
2930 function and was unnecessary. The other callsite was modifying
2931 the map as it iterated it, but this function is not.
2933 2007-10-22 Maciej Stachowiak <mjs@apple.com>
2937 - Avoid moving floats into integer registers in jsNumber() for 3% speedup on SunSpider
2938 http://bugs.webkit.org/show_bug.cgi?id=15627
2940 * kjs/JSImmediate.h:
2941 (KJS::JSImmediate::fromDouble): Avoid moving floats to integer
2942 registers since this is very slow.
2944 2007-10-22 Darin Adler <darin@apple.com>
2946 Reviewed by Eric Seidel.
2948 - http://bugs.webkit.org/show_bug.cgi?id=15617
2949 improve speed of integer conversions
2951 Makes SunSpider 6% faster.
2953 * kjs/JSImmediate.h: Added toInt32 and toUInt32, with separate versions for
2956 (KJS::JSValue::getUInt32): Call JSImmediate::toUInt32.
2958 * kjs/internal.h: Added getInt32.
2960 (KJS::NumberImp::getInt32): Added.
2961 (KJS::NumberImp::getUInt32): Replaced with more-optimal implementation
2962 stolen from JSValue.
2965 (KJS::jsNumber): Marked ALWAYS_INLINE, because this wasn't getting
2967 (KJS::JSValue::getInt32): Added.
2968 (KJS::JSValue::getUInt32): Changed to call the new JSImmediate::toUInt32
2969 to avoid converting from float to double.
2970 (KJS::JSValue::toInt32): Made inline, separated out the slow case.
2971 (KJS::JSValue::toUInt32): Ditto.
2973 (KJS::JSCell::getInt32): Added.
2974 (KJS::JSValue::toInt32SlowCase): Renamed from toInt32. Changed to use the
2975 new getInt32. Added a faster case for in-range numbers.
2976 (KJS::JSValue::toUInt32SlowCase): Ditto.
2977 (KJS::JSValue::toUInt16): Added a faster case for in-range numbers.
2979 * JavaScriptCore.exp: Updated for changes.
2981 2007-10-22 Adam Roben <aroben@apple.com>
2985 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn off
2986 warning about implicit conversion to bool.
2988 2007-10-22 Mark Rowe <mrowe@apple.com>
2992 * kjs/array_instance.cpp:
2994 2007-10-22 Darin Adler <darin@apple.com>
2998 - http://bugs.webkit.org/show_bug.cgi?id=15606
2999 make cut-off for sparse vs. dense arrays smarter for speed with large arrays
3001 Makes the morph test in SunSpider 26% faster, and the overall
3002 benchmark 3% faster.
3004 This also fixes some small problems we had with the distinction
3005 between nonexistent and undefined values in arrays.
3007 * kjs/array_instance.h: Tweaked formatting and naming.
3008 * kjs/array_instance.cpp: Copied from kjs/array_object.cpp.
3009 (KJS::storageSize): Added. Computes the size of the storage given a vector length.
3010 (KJS::increasedVectorLength): Added. Implements the rule for resizing the vector.
3011 (KJS::isDenseEnoughForVector): Added.
3012 (KJS::ArrayInstance::ArrayInstance): Initialize the new fields.
3013 (KJS::ArrayInstance::~ArrayInstance): Since m_storage is now never 0, delete it.
3014 (KJS::ArrayInstance::getItem): Updated for name changes.
3015 (KJS::ArrayInstance::lengthGetter): Ditto.
3016 (KJS::ArrayInstance::inlineGetOwnPropertySlot): Added. Allows both versions of
3017 getOwnPropertySlot to share more code.
3018 (KJS::ArrayInstance::getOwnPropertySlot): Just refactored, no code change.
3019 (KJS::ArrayInstance::put): Added logic for extending the vector as long as the
3020 array is dense enough. Also keep m_numValuesInVector up to date.
3021 (KJS::ArrayInstance::deleteProperty): Added code to keep m_numValuesInVector
3023 (KJS::ArrayInstance::getPropertyNames): Fixed bug where this would omit names
3024 for array indices with undefined values.
3025 (KJS::ArrayInstance::increaseVectorLength): Renamed from resizeStorage. Also
3026 simplified to only handle getting larger.
3027 (KJS::ArrayInstance::setLength): Added code to update m_numValuesInVector, to
3028 zero out the unused part of the vector and to delete the map if it's no longer
3030 (KJS::ArrayInstance::mark): Tweaked formatting.
3031 (KJS::compareByStringForQSort): Ditto.
3032 (KJS::ArrayInstance::sort): Ditto.
3033 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
3035 (KJS::compareWithCompareFunctionForQSort): Ditto.
3036 (KJS::ArrayInstance::compactForSorting): Fixed bug where this would turn
3037 undefined values into nonexistent values in some cases.
3039 * kjs/array_object.h: Removed MAX_ARRAY_INDEX.
3040 * kjs/array_object.cpp: Removed ArrayInstance. Moved to a separate file.
3042 * JavaScriptCore.pri: Added array_instance.cpp.
3043 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3044 * kjs/AllInOneFile.cpp: Ditto.
3046 2007-10-22 Andrew Wellington <proton@wiretapped.net>
3048 Reviewed by Mark Rowe.
3050 Fix for local database support after r26879
3051 Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set
3053 * Configurations/JavaScriptCore.xcconfig:
3055 2007-10-22 Simon Hausmann <hausmann@kde.org>
3059 Build fix for the non-qmake builds.
3061 * wtf/Platform.h: Default to enabling the database features unless
3062 otherwise specified. (similar to ENABLE_ICONDATABASE)
3064 2007-10-22 Holger Freyther <zecke@selfish.org>
3066 Reviewed by Simon Hausmann <hausmann@kde.org>.
3068 * Do not build testkjs as an application bundle. This is
3069 needed for run-javascriptcore-tests on OSX.
3070 * Also, based on r26633, allow to test the WebKit/Qt port on OSX.
3071 * Set DYLD_LIBRARY_PATH if it was set in the environment. It must be set
3072 as we do not have -rpath on OSX.
3076 2007-10-21 Mark Rowe <mrowe@apple.com>
3080 http://bugs.webkit.org/show_bug.cgi?id=15575
3081 Bug 15575: [GTK] Implement threading using GThread
3083 * wtf/Platform.h: Do not enable pthreads for Gtk.
3085 2007-10-21 Mark Rowe <mrowe@apple.com>
3089 Fix http://bugs.webkit.org/show_bug.cgi?id=15603
3090 Bug 15603: Regression(r26847): Crash when sorting an empty array from JavaScript
3092 * kjs/array_object.cpp:
3093 (KJS::freeStorage): Reinstate null-check that was removed in r26847.
3095 2007-10-21 Darin Adler <darin@apple.com>
3099 * kjs/array_instance.h: Removed unused ExecState parameter.
3100 * kjs/array_object.cpp:
3101 (KJS::ArrayInstance::put): Ditto.
3102 (KJS::ArrayInstance::setLength): Ditto.
3104 2007-10-21 Darin Adler <darin@apple.com>
3106 * kjs/array_object.cpp: (KJS::ArrayInstance::put):
3107 Add missing assignment that was causing regression test crash.
3109 2007-10-21 Darin Adler <darin@apple.com>
3113 - http://bugs.webkit.org/show_bug.cgi?id=15585
3114 speed up sparse arrays by using a custom map
3116 Speeds up SunSpider by 10%.
3118 * kjs/array_object.cpp:
3119 (allocateStorage): Leave room for an additional pointer.
3120 (reallocateStorage): Ditto.
3121 (freeStorage): Ditto.
3122 (ArrayInstance::~ArrayInstance): Delete the overflow map if present.
3123 (ArrayInstance::getItem): Read values from the overflow map if present.
3124 Removed the check of length, since it slows down the common case.
3125 (ArrayInstance::getOwnPropertySlot): Ditto. Also removed the fallback
3126 to the property map.
3127 (ArrayInstance::put): Write values into the overflow map as needed.
3128 Also create overflow map when needed.
3129 (ArrayInstance::deleteProperty): Remove values from the overflow map
3131 (ArrayInstance::getPropertyNames): Add a name for each identifier in
3132 the property map. This is extremely inefficient.
3133 (ArrayInstance::setLength): Remove any values in the overflow map
3134 that are past the new length, as we formerly did with the property map.
3135 (ArrayInstance::mark): Mark any values in the overflow map.
3136 (compareByStringForQSort): Removed unneeded undefined case, since
3137 compactForSorting guarantees we will have no undefined values.
3138 (compareWithCompareFunctionForQSort): Ditto.
3139 (ArrayInstance::compactForSorting): Copy all the values out of the
3140 overflow map and destroy it.
3142 * kjs/property_map.h: Removed now-unused getSparseArrayPropertyNames.
3143 * kjs/property_map.cpp: Ditto.
3145 2007-10-20 Darin Adler <darin@apple.com>
3149 - http://bugs.webkit.org/show_bug.cgi?id=15579
3150 stop churning identifier reference counts copying Completion objects
3152 * kjs/completion.h: Replace the Identifier with an Identifier*.
3154 (ForInNode::execute): Update for change to Completion constructor.
3155 (ContinueNode::execute): Ditto.
3156 (BreakNode::execute): Ditto.
3158 2007-10-20 Mark Rowe <mrowe@apple.com>
3162 Gtk changes needed to enable HTML 5 client-side database storage.
3164 * wtf/Platform.h: Have Gtk use pthreads for now.
3166 2007-10-20 Geoffrey Garen <ggaren@apple.com>
3168 Reviewed by Maciej Stachowiak.
3170 Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
3171 Store gathered declaration nodes in the function body node.
3173 This means that you only have to gather the declaration nodes the first
3174 time the function executes. Performance gain of 2.10% on SunSpider,
3175 0.90% on command-line JS iBench.
3177 * kjs/nodes.cpp: Split declaration stack initialization code off into
3178 initializeDeclarationStacks().
3179 (FunctionBodyNode::FunctionBodyNode):
3180 (FunctionBodyNode::initializeDeclarationStacks):
3181 (FunctionBodyNode::processDeclarations):
3183 * kjs/nodes.h: Changed DeclarationStacks structure to hold references,
3184 since the actual Vectors are now stored either on the stack or in the
3187 2007-10-19 Geoffrey Garen <ggaren@apple.com>
3189 Reviewed by Darin Adler.
3191 http://bugs.webkit.org/show_bug.cgi?id=15559
3192 Moved processDeclarations call into FunctionBodyNode::execute
3194 To improve encapsulation, moved processDeclarations call into
3195 FunctionBodyNode::execute. Also marked processDeclarations
3196 ALWAYS_INLINE, since it has only 1 caller now. This is a .71% speedup
3197 on command-line JS iBench.
3200 (KJS::FunctionImp::callAsFunction):
3201 (KJS::GlobalFuncImp::callAsFunction):
3203 * kjs/interpreter.cpp:
3204 (KJS::Interpreter::evaluate):
3206 (FunctionBodyNode::execute):
3209 2007-10-19 Brady Eidson <beidson@apple.com>
3213 Queue -> Deque! and small style tweaks
3215 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3216 * JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
3217 * wtf/Deque.h: Added.
3218 (WTF::DequeNode::DequeNode):
3219 (WTF::Deque::Deque):
3220 (WTF::Deque::~Deque):
3222 (WTF::Deque::isEmpty):
3223 (WTF::Deque::append):
3224 (WTF::Deque::prepend):
3225 (WTF::Deque::first):
3227 (WTF::Deque::removeFirst):
3228 (WTF::Deque::clear):
3229 * wtf/Queue.h: Removed.
3232 2007-10-19 Brady Eidson <beidson@apple.com>
3236 Added a simple LinkedList based Queue to wtf
3237 We can make a better, more sophisticated an efficient one later, but have
3238 needed one for some time, now!
3240 * JavaScriptCore.xcodeproj/project.pbxproj:
3241 * wtf/Queue.h: Added.
3242 (WTF::QueueNode::QueueNode):
3243 (WTF::Queue::Queue):
3244 (WTF::Queue::~Queue):
3246 (WTF::Queue::isEmpty):
3247 (WTF::Queue::append):
3248 (WTF::Queue::prepend):
3249 (WTF::Queue::first):
3251 (WTF::Queue::removeFirst):
3252 (WTF::Queue::clear):
3254 2007-10-19 Nikolas Zimmermann <zimmermann@kde.org>
3258 Try to fix Qt/Win build slave, by including windows.h also on Qt/Win.
3260 * kjs/testkjs.cpp: Change PLATFORM(WIN) to PLATFORM(WIN_OS)
3262 2007-10-19 Simon Hausmann <hausmann@kde.org>
3266 Fix compilation on Windows when wchar_t is a typedef instead of a native type (triggered by -Zc:wchar_t-).
3267 Don't provide the wchar_t overloads then as they conflict with the unsigned short ones.
3270 (WTF::isASCIIAlpha):
3271 (WTF::isASCIIAlphanumeric):
3272 (WTF::isASCIIDigit):
3273 (WTF::isASCIIHexDigit):
3274 (WTF::isASCIILower):
3275 (WTF::isASCIISpace):
3276 (WTF::toASCIILower):
3277 (WTF::toASCIIUpper):
3279 2007-10-19 Simon Hausmann <hausmann@kde.org>
3283 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.
3287 2007-10-18 Maciej Stachowiak <mjs@apple.com>
3291 - use __declspec(thread) for fast thread-local storage on Windows
3293 - 2.2% speedup on sunspider (on Windows)
3294 - 7% speedup on the string section
3295 - 6% speedup on JS iBench
3297 - fixed <rdar://problem/5473084> PLT on Windows got 2.5% slower between r25406 and r25422
3298 - fixed at least some of <rdar://5527965? i-Bench JS was 14% slower in 310A11 than 310A10
3301 * wtf/FastMalloc.cpp:
3302 (WTF::getThreadHeap):
3303 (WTF::setThreadHeap):
3304 (WTF::TCMalloc_ThreadCache::GetCache):
3305 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
3306 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3308 2007-10-17 Darin Adler <darin@apple.com>
3310 Reviewed by Mark Rowe.
3312 - fix http://bugs.webkit.org/show_bug.cgi?id=15543
3313 <rdar://problem/5545639> REGRESSION (r26697):
3314 GoogleDocs: Can't create new documents or open existing ones
3316 Test: fast/js/regexp-non-character.html
3318 * pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
3319 in the \u sequences -- not needed and actively harmful.
3321 2007-10-17 Anders Carlsson <andersca@apple.com>
3326 #define USE_PTHREADS on Mac.
3328 2007-10-17 Geoffrey Garen <ggaren@apple.com>
3330 Reviewed by Darin Adler.
3332 Merged DeclaredFunctionImp into FunctionImp (the base class) because
3333 the distinction between the two was unused.
3335 Removed codeType() from FunctionImp because FunctionImp and its
3336 subclasses all returned FunctionCode, so it was unused, practically
3339 Removed a different codeType() from GlobalFuncImp because it was unused.
3340 (Perhaps it was vestigial from a time when GlobalFuncImp used to
3341 inherit from FunctionImp.)
3343 * bindings/runtime_method.cpp:
3344 * bindings/runtime_method.h:
3347 (KJS::FunctionImp::FunctionImp):
3348 (KJS::FunctionImp::callAsFunction):
3349 (KJS::FunctionImp::construct):
3350 (KJS::FunctionImp::execute):
3351 (KJS::FunctionImp::processVarDecls):
3353 (KJS::FunctionImp::implementsConstruct):
3354 (KJS::FunctionImp::scope):
3355 * kjs/function_object.cpp:
3356 (FunctionProtoFunc::callAsFunction):
3357 (FunctionObjectImp::construct):
3359 (FuncDeclNode::processFuncDecl):
3360 (FuncExprNode::evaluate):
3362 2007-10-17 Adam Roben <aroben@apple.com>
3364 Windows build fix part 2.
3366 Fix was by Darin, reviewed by Anders and Adam.
3368 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
3369 FastMallocPCRE.cpp to the project, and let Visual Studio have its way
3370 with the post-build step.
3371 * pcre/pcre.h: Don't DLL export the entry points just because this
3372 is Win32 -- this is an internal copy of PCRE and should be private.
3373 * pcre/pcre_compile.c: Fix an uninitialized variable warning --
3374 there's no real problem but it's better to quiet the compiler by
3375 tweaking the code slightly than turn off the warning entirely.
3377 2007-10-17 Adam Roben <aroben@apple.com>
3383 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
3384 some mismatched signed/unsigned comparison warnings.
3386 (match): #if-out some labels that don't seem to exist.
3388 2007-10-17 Mark Rowe <mrowe@apple.com>
3392 * JavaScriptCore.pri: Add FastMallocPCRE.cpp.
3393 * pcre/pcre_get. #if out two functions that depend on pcre_get_stringnumber, which
3394 is currently unavailable for UTF-16.
3396 2007-10-16 Darin Adler <darin@apple.com>
3400 - merged PCRE changes between 6.4 and 6.5
3402 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3403 * JavaScriptCore.xcodeproj/project.pbxproj:
3404 Removed pcre_config.c, pcre_globals.c, pcre_info.c, pcre_maketables.c,
3405 pcre_printint.src, pcre_refcount.c, pcre_study.c, pcre_try_flipped.c,
3406 pcre_ucp_findchar.c, pcre_version.c, and ucptable.c. Added pcre_ucp_searchfuncs.c.
3412 * pcre/pcre-config.h:
3415 * pcre/pcre_compile.c:
3417 * pcre/pcre_fullinfo.c:
3419 * pcre/pcre_internal.h:
3420 * pcre/pcre_maketables.c:
3421 * pcre/pcre_ord2utf8.c:
3422 * pcre/pcre_tables.c:
3423 * pcre/pcre_ucp_searchfuncs.c: Copied from pcre/pcre_ucp_findchar.c.
3424 * pcre/pcre_xclass.c:
3426 * pcre/ucpinternal.h:
3428 Updated with new versions from the PCRE 6.5 release, merged with changes.
3430 * pcre/pcre_config.c: Removed.
3431 * pcre/pcre_globals.c: Removed.
3432 * pcre/pcre_info.c: Removed.
3433 * pcre/pcre_printint.src: Removed.
3434 * pcre/pcre_refcount.c: Removed.
3435 * pcre/pcre_study.c: Removed.
3436 * pcre/pcre_try_flipped.c: Removed.
3437 * pcre/pcre_ucp_findchar.c: Removed.
3438 * pcre/pcre_version.c: Removed.
3440 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3442 Reviewed by Darin Adler.
3444 Removed KJS_VERBOSE because it was getting in the way of readability,
3445 and the messages didn't seem very helpful.
3448 (KJS::FunctionImp::callAsFunction):
3449 (KJS::FunctionImp::passInParameters):
3453 (KJS::JSObject::put):
3456 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3458 Reviewed by Darin Adler.
3460 Removed the Parameter class because it was a redundant wrapper around
3464 (KJS::FunctionImp::passInParameters):
3465 (KJS::FunctionImp::getParameterName):
3467 (FunctionBodyNode::addParam):
3469 (KJS::FunctionBodyNode::):
3471 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3473 Reviewed by Darin Adler.
3475 Global replace of assert with ASSERT.
3477 2007-10-16 Adam Roben <aroben@apple.com>
3479 Make testkjs not delay-load WebKit
3481 Soon, delay-loading WebKit will be impossible (because we will be
3482 using __declspec(thread) for thread-local storage). This change
3483 prepares testkjs for the future.
3487 * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed WebKitInitializer,
3489 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Don't link against
3490 WebKitInitializer, don't delay-load WebKit.
3491 * kjs/testkjs.cpp: Don't use WebKitInitializer.
3493 2007-10-16 Adam Roben <aroben@apple.com>
3495 Updated testkjs for the rename of WebKit_debug.dll to WebKit.dll for the Debug configuration
3497 Reviewed by Kevin McCullough.
3499 * JavaScriptCore.vcproj/debug.vsprops: Added WebKitDLLConfigSuffix.
3500 * JavaScriptCore.vcproj/debug_internal.vsprops: Ditto.
3501 * JavaScriptCore.vcproj/release.vsprops: Ditto.
3502 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Use
3503 WebKitDLLConfigSuffix when referring to WebKit.dll, and fixed a typo
3504 in the name of icuuc36[_debug].dll.
3506 2007-10-16 Geoffrey Garen <ggaren@apple.com>
3508 Reviewed by Maciej Stachowiak.
3510 Re-structured variable and function declaration code.
3512 Command-line JS iBench shows no regression.
3514 Here are the changes:
3516 1. Function declarations are now processed at the same time as var
3517 declarations -- namely, immediately upon entry to an execution context.
3518 This does not match Firefox, which waits to process a function
3519 declaration until the declaration's containing block executes, but it
3520 does match IE and the ECMA spec. (10.1.3 states that var and function
3521 declarations should be processed at the same time -- namely, "On
3522 entering an execution context." 12.2 states that "A Block does not
3523 define a new execution scope.")
3525 2. Declaration processing proceeds iteratively now, rather than
3526 recursively, storing the nodes is finds in stacks. This will later
3527 facilitate an optimization to hold on to the gathered declaration nodes,
3528 rather than re-fetching them in every function call.
3529 [ http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3531 Modified these tests because they expected the incorrect Mozilla
3532 behavior described above:
3534 * tests/mozilla/ecma_3/Function/scope-001.js:
3535 * tests/mozilla/js1_5/Scope/regress-184107.js:
3537 2007-10-16 Darin Adler <darin@apple.com>
3539 - try to fix the GTK build
3541 * kjs/ustring.cpp: Include ASCIICType.h, not ASCIICtype.h.
3543 2007-10-16 Darin Adler <darin@apple.com>
3545 - try to fix the Windows build
3547 * kjs/date_object.cpp: (KJS::parseDate): A couple instances of isspace were
3548 in here. Not sure why it wasn't failing elsewhere. Changed to isASCIISpace.