1 2007-12-03 Dan Bernstein <mitz@apple.com>
3 - fix a copy-and-paste-o
5 * bindings/npruntime.cpp:
6 (_NPN_GetIntIdentifier):
8 2007-12-03 Dan Bernstein <mitz@apple.com>
10 Reviewed by Darin Adler.
12 - fix an ASSERT when getIntIdentifier is called with 0 or -1
14 * bindings/npruntime.cpp:
15 (_NPN_GetIntIdentifier): We cannot use the hashmap for 0 and -1 since
16 they are the empty value and the deleted value. Instead, keep the
17 identifiers for those two integers in a static array.
19 2007-12-02 Darin Adler <darin@apple.com>
23 - fix http://bugs.webkit.org/show_bug.cgi?id=15848
24 <rdar://problem/5619330> REGRESSION: Assertion failure viewing comments page on digg.com
26 Test: fast/js/sparse-array.html
28 * kjs/array_instance.cpp:
29 (KJS::ArrayInstance::inlineGetOwnPropertySlot): Check sparse array cutoff before looking
30 in hash map. Can't avoid the branch because we can't look for 0 in the hash.
31 (KJS::ArrayInstance::deleteProperty): Ditto.
33 2007-12-02 Geoffrey Garen <ggaren@apple.com>
35 Build fix: added an #include.
39 2007-12-02 Geoffrey Garen <ggaren@apple.com>
41 Reviewed by Eric Seidel.
43 Second step in refactoring JSGlobalObject: moved virtual functions from
44 Interpreter to JSGlobalObject.
46 Layout and JS tests pass. SunSpider reports a .7% speedup -- don't
49 2007-12-01 Alp Toker <alp@atoker.com>
51 Reviewed by Adam Roben.
53 http://bugs.webkit.org/show_bug.cgi?id=16228
54 kJSClassDefinitionEmpty is not exported with JS_EXPORT
56 Add JS_EXPORT to kJSClassDefinitionEmpty.
58 Make the gcc compiler check take precedence over the WIN32||_WIN32
59 check to ensure that symbols are exported on Windows when using gcc.
61 Add a TODO referencing the bug about JS_EXPORT in the Win build
62 (http://bugs.webkit.org/show_bug.cgi?id=16227)
64 Don't define JS_EXPORT as 'extern' when the compiler is unknown since
65 it would result in the incorrect expansion:
67 extern extern const JSClassDefinition kJSClassDefinitionEmpty;
69 (This was something we inherited from CFBase.h that doesn't make sense
75 2007-11-30 Geoffrey Garen <ggaren@apple.com>
77 Reviewed by Beth Dakin.
79 Reversed the ownership relationship between Interpreter and JSGlobalObject.
80 Now, the JSGlobalObject owns the Interpreter, and top-level objects
81 that need the two to persist just protect the JSGlobalObject from GC.
83 Global object bootstrapping looks a little odd right now, but it will
84 make much more sense soon, after further rounds of refactoring.
86 * bindings/runtime_root.h: Made this class inherit from RefCounted,
87 to avoid code duplication.
90 (KJS::Collector::collect): No need to give special GC treatment to
91 Interpreters, since we mark their global objects, which mark them.
93 * kjs/interpreter.cpp:
94 (KJS::Interpreter::mark): No need to mark our global object, since it
96 * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject
99 * kjs/testkjs.cpp: Modified to follow the new rules.
100 (createGlobalObject):
103 2007-11-30 Brent Fulgham <bfulgham@gmail.com>
108 * pcre/pcre_compile.cpp:
111 2007-11-30 Eric Seidel <eric@webkit.org>
113 No review, build fix only.
115 Fix uninitialized var warnings in release build.
117 * JavaScriptCore.xcodeproj/project.pbxproj:
118 * pcre/pcre_compile.cpp:
121 2007-11-30 Darin Adler <darin@apple.com>
123 Reviewed by Adam Roben.
125 - fix http://bugs.webkit.org/show_bug.cgi?id=16207
126 JavaScript regular expressions should match UTF-16 code units rather than characters
128 SunSpider says this is 5.5% faster on the regexp test, 0.4% faste overall.
130 Test: fast/js/regexp-non-bmp.html
132 Renamed ANY_CHAR to NOT_NEWLINE to more-accurately reflect its meaning.
134 * pcre/pcre_compile.cpp:
135 (compile_branch): Removed calls to the UTF-16 character accessor functions, replacing
136 them with simple pointer dereferences in some cases, and no code at all in others.
137 (calculateCompiledPatternLengthAndFlags): Ditto.
139 * pcre/pcre_exec.cpp:
140 (match): Fixed indentation of some case labels (including all the BEGIN_OPCODE).
141 Removed calls to the UTF-16 character accessor functions, replacing them with simple
142 pointer dereferences in some cases, and no code at all in others. Also removed some
143 explicit UTF-16 support code in a few cases. Removed the unneeded "UTF-8" code path
144 in the ANY_CHAR repeat code, and in another case, eliminated the code to check against
145 end_subject in because it is already done outside the loop.
148 * pcre/pcre_internal.h: Removed all the UTF-16 helper functions.
150 2007-11-30 Eric Seidel <eric@webkit.org>
154 PCRE crashes under GuardMalloc
155 http://bugs.webkit.org/show_bug.cgi?id=16127
156 check against patternEnd to make sure we don't walk off the end of the string
158 * pcre/pcre_compile.cpp:
160 (calculateCompiledPatternLengthAndFlags):
162 2007-11-30 Eric Seidel <eric@webkit.org>
166 Fix layout test regressions caused by r28186
167 http://bugs.webkit.org/show_bug.cgi?id=16195
168 change first_byte and req_byte back to shorts instead of chars
169 (I think PCRE stuffs information in the high bits)
171 * pcre/pcre_internal.h:
173 2007-11-29 Oliver Hunt <oliver@apple.com>
175 Reviewed by Maciej and Darin.
177 Make the JS collector work with multiple threads
179 Under heavy contention it was possible the GC to suspend other
180 threads inside the pthread spinlock, which could lead to the GC
181 thread blocking on the pthread spinlock itself.
183 We now determine and store each thread's stack base when it is
184 registered, thus removing the need for any calls to pthread_get_stackaddr_np
185 that needed the pthread spinlock.
188 (KJS::Collector::Thread::Thread):
189 (KJS::Collector::registerThread):
190 (KJS::Collector::markOtherThreadConservatively):
192 2007-11-29 Adam Roben <aroben@apple.com>
196 Removed some unreachable code (ironically, the code was some
197 ASSERT_NOT_REACHED()s).
199 * pcre/pcre_compile.cpp:
201 * pcre/pcre_exec.cpp:
204 2007-11-29 Eric Seidel <eric@webkit.org>
206 Reviewed by Mark Rowe.
208 Fix for --guard crash of fast/js/regexp-charclass-crash introduced by r28151.
210 * pcre/pcre_compile.cpp:
213 2007-11-28 Mark Rowe <mrowe@apple.com>
215 Gtk build fix. Rubber-stamped by Eric.
217 * pcre/pcre_exec.cpp:
218 (match): Add braces around the body of the case statement to prevent
219 wanings about jumps across the initialization of a variable.
221 2007-11-29 Eric Seidel <eric@webkit.org>
223 Reviewed by Mark Rowe.
225 Attempt to fix non-mac builds after PCRE cleanup.
227 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
228 * JavaScriptCoreSources.bkl:
231 2007-11-28 Eric Seidel <eric@webkit.org>
235 Centralize code for subjectPtr adjustments using inlines, only ever check for a single trailing surrogate (as UTF16 only allows one), possibly fix PCRE bugs involving char classes and garbled UTF16 strings.
237 * pcre/pcre_exec.cpp:
240 * pcre/pcre_internal.h:
242 (movePtrToPreviousChar):
244 (movePtrToStartOfCurrentChar):
246 2007-11-28 Eric Seidel <eric@webkit.org>
250 change getChar* functions to return result and push 'c' into local scopes for clarity
252 * pcre/pcre_compile.cpp:
254 (calculateCompiledPatternLengthAndFlags):
255 * pcre/pcre_exec.cpp:
257 * pcre/pcre_internal.h:
261 (getCharAndAdvanceIfSurrogate):
263 2007-11-28 Eric Seidel <eric@webkit.org>
269 * pcre/pcre_exec.cpp:
272 2007-11-26 Eric Seidel <eric@webkit.org>
276 Further cleanups to calculateCompiledPatternLengthAndFlags
278 * pcre/pcre_compile.cpp:
279 (calculateCompiledPatternLengthAndFlags):
280 * pcre/pcre_internal.h:
282 2007-11-26 Eric Seidel <eric@webkit.org>
286 Give consistent naming to the RegExp options/compile flags
288 * pcre/pcre_compile.cpp:
291 (find_firstassertedchar):
292 (printCompiledRegExp):
294 * pcre/pcre_exec.cpp:
296 * pcre/pcre_internal.h:
298 2007-11-26 Eric Seidel <eric@webkit.org>
302 Pull first_byte and req_byte optimizations out into separate static funtions, SunSpider reported this as a win.
304 * pcre/pcre_exec.cpp:
305 (tryFirstByteOptimization):
306 (tryRequiredByteOptimization):
308 * pcre/pcre_internal.h:
310 2007-11-26 Eric Seidel <eric@webkit.org>
314 give PCRE_MULTILINE a better name: OptionMatchAcrossMultipleLines
316 * pcre/pcre_compile.cpp:
319 (printCompiledRegExp):
321 * pcre/pcre_exec.cpp:
323 * pcre/pcre_internal.h:
325 2007-11-26 Eric Seidel <eric@webkit.org>
329 Deprecate jsRegExpExecute's offset-vector fallback code
331 * pcre/pcre_exec.cpp:
334 2007-11-26 Eric Seidel <eric@webkit.org>
338 Make cur_is_word and prev_is_word locals, and change OP_ANY to OP_ANY_CHAR for clarity
340 * pcre/pcre_compile.cpp:
343 (canApplyFirstCharOptimization):
344 * pcre/pcre_exec.cpp:
346 * pcre/pcre_internal.h:
348 2007-11-26 Eric Seidel <eric@webkit.org>
350 Reviewed by Mitz & Maciej.
352 Change _NC operators to use _IGNORING_CASE for clarity
354 * pcre/pcre_compile.cpp:
357 (find_firstassertedchar):
358 * pcre/pcre_exec.cpp:
360 * pcre/pcre_internal.h:
362 2007-11-26 Eric Seidel <eric@webkit.org>
366 Remove branch from return
368 * pcre/pcre_compile.cpp:
370 * pcre/pcre_exec.cpp:
373 2007-11-26 Eric Seidel <eric@webkit.org>
377 Add repeatInformationFromInstructionOffset inline
379 * pcre/pcre_exec.cpp:
380 (repeatInformationFromInstructionOffset):
383 2007-11-26 Eric Seidel <eric@webkit.org>
387 Remove no longer used error code JSRegExpErrorMatchLimit
390 (KJS::RegExp::match):
392 * pcre/pcre_internal.h:
394 2007-11-26 Eric Seidel <eric@webkit.org>
398 Make i locally scoped for better code clarity
400 * pcre/pcre_exec.cpp:
403 2007-11-26 Eric Seidel <eric@webkit.org>
407 Give subjectPtr and instructionPtr sane names, reduce size of MatchFrame for a 0.2% speedup.
409 * pcre/pcre_compile.cpp:
411 (calculateCompiledPatternLengthAndFlags):
412 * pcre/pcre_exec.cpp:
414 (MatchStack::pushNewFrame):
415 (getUTF8CharAndIncrementLength):
417 * pcre/pcre_internal.h:
421 (getCharAndAdvanceIfSurrogate):
422 * pcre/pcre_xclass.cpp:
423 (getUTF8CharAndAdvancePointer):
425 2007-11-26 Eric Seidel <eric@webkit.org>
429 Small speedup (0.7%) by simplifying canUseStackBufferForNextFrame() check
431 * pcre/pcre_exec.cpp:
432 (MatchStack::MatchStack):
433 (MatchStack::popCurrentFrame):
435 2007-11-25 Eric Seidel <eric@webkit.org>
439 Lower MATCH_LIMIT_RECURSION to more sane levels to prevent hangs on run-javascriptcore-tests
441 * pcre/pcre_internal.h:
443 2007-11-25 Eric Seidel <eric@webkit.org>
447 Remove match_is_group variable for another 5% speedup
449 * pcre/pcre_compile.cpp:
450 * pcre/pcre_exec.cpp:
454 2007-11-28 Eric Seidel <eric@webkit.org>
458 Abstract frame variables into locals and args
460 * pcre/pcre_compile.cpp:
462 * pcre/pcre_exec.cpp:
464 * pcre/pcre_internal.h:
466 2007-11-28 Eric Seidel <eric@webkit.org>
470 Section off MatchData arguments into args struct
472 * pcre/pcre_exec.cpp:
473 (MatchStack::pushNewFrame):
476 2007-11-24 Eric Seidel <eric@webkit.org>
480 Remove redundant eptrblock struct
482 * pcre/pcre_exec.cpp:
483 (MatchStack::pushNewFrame):
486 2007-11-24 Eric Seidel <eric@webkit.org>
490 Remove redundant match_call_count and move recursion check out of super-hot code path
491 SunSpider says this is at least an 8% speedup for regexp.
493 * pcre/pcre_exec.cpp:
494 (MatchStack::MatchStack):
495 (MatchStack::pushNewFrame):
496 (MatchStack::popCurrentFrame):
497 (MatchStack::popAllFrames):
500 * pcre/pcre_internal.h:
502 2007-11-24 Eric Seidel <eric@webkit.org>
506 Get rid of GETCHAR* macros, replacing them with better named inlines
508 * pcre/pcre_compile.cpp:
510 (calculateCompiledPatternLengthAndFlags):
511 * pcre/pcre_exec.cpp:
513 * pcre/pcre_internal.h:
516 (getCharAndAdvanceIfSurrogate):
518 2007-11-24 Eric Seidel <eric@webkit.org>
522 Further cleanup GET/PUT inlines
524 * pcre/pcre_internal.h:
525 (putOpcodeValueAtOffset):
526 (getOpcodeValueAtOffset):
527 (putOpcodeValueAtOffsetAndAdvance):
528 (put2ByteOpcodeValueAtOffset):
529 (get2ByteOpcodeValueAtOffset):
530 (put2ByteOpcodeValueAtOffsetAndAdvance):
532 2007-11-24 Eric Seidel <eric@webkit.org>
536 Give GET, PUT better names, and add (poor) moveOpcodePtrPastAnyAlternateBranches
538 * pcre/pcre_compile.cpp:
539 (firstSignificantOpCodeSkippingAssertions):
545 (canApplyFirstCharOptimization):
546 (find_firstassertedchar):
547 * pcre/pcre_exec.cpp:
549 * pcre/pcre_internal.h:
550 (putOpcodeValueAtOffset):
551 (getOpcodeValueAtOffset):
552 (putOpcodeValueAtOffsetAndAdvance):
553 (put2ByteOpcodeValueAtOffset):
554 (get2ByteOpcodeValueAtOffset):
555 (moveOpcodePtrPastAnyAlternateBranches):
556 * pcre/pcre_ucp_searchfuncs.cpp:
557 (_pcre_ucp_othercase):
559 2007-11-24 Eric Seidel <eric@webkit.org>
563 Add inlines for toLowerCase, isWordChar, isSpaceChar for further regexp speedup
565 * pcre/pcre_compile.cpp:
568 * pcre/pcre_exec.cpp:
571 * pcre/pcre_internal.h:
574 (classBitmapForChar):
578 (CompileData::CompileData):
579 * pcre/pcre_xclass.cpp:
582 2007-11-24 Eric Seidel <eric@webkit.org>
586 cleanup _pcre_ucp_othercase
588 * pcre/pcre_ucp_searchfuncs.cpp:
589 (_pcre_ucp_othercase):
591 2007-11-24 Eric Seidel <eric@webkit.org>
595 Use better variable names for case ignoring options
597 * pcre/pcre_compile.cpp:
599 (find_firstassertedchar):
600 (printCompiledRegExp):
602 * pcre/pcre_exec.cpp:
606 * pcre/pcre_internal.h:
608 2007-11-24 Eric Seidel <eric@webkit.org>
612 split first_significant_code into two simpler functions
614 * pcre/pcre_compile.cpp:
615 (firstSignificantOpCode):
616 (firstSignificantOpCodeSkippingAssertions):
618 (canApplyFirstCharOptimization):
619 (find_firstassertedchar):
621 2007-11-24 Eric Seidel <eric@webkit.org>
625 clean up is_counted_repeat
627 * pcre/pcre_compile.cpp:
630 2007-11-24 Eric Seidel <eric@webkit.org>
634 clean up check_escape
636 * pcre/pcre_compile.cpp:
639 2007-11-24 Eric Seidel <eric@webkit.org>
643 Reformat find_fixedlength
645 * pcre/pcre_compile.cpp:
648 2007-11-24 Eric Seidel <eric@webkit.org>
654 * pcre/pcre_compile.cpp:
657 2007-11-24 Eric Seidel <eric@webkit.org>
661 Remove unused function could_be_empty_branch
663 * pcre/pcre_compile.cpp:
664 (first_significant_code):
667 (canApplyFirstCharOptimization):
669 2007-11-24 Eric Seidel <eric@webkit.org>
673 Pass around MatchData objects by reference
675 * pcre/pcre_exec.cpp:
681 2007-11-24 Eric Seidel <eric@webkit.org>
685 give PCRE_STARTLINE a better name and rename match_data to MatchData
687 * pcre/pcre_compile.cpp:
689 (canApplyFirstCharOptimization):
690 (find_firstassertedchar):
691 (printCompiledRegExp):
693 * pcre/pcre_exec.cpp:
696 * pcre/pcre_internal.h:
698 2007-11-24 Eric Seidel <eric@webkit.org>
702 Clean up find_firstassertedchar
704 * pcre/pcre_compile.cpp:
705 (get_othercase_range):
706 (find_firstassertedchar):
707 (calculateCompiledPatternLengthAndFlags):
709 2007-11-24 Eric Seidel <eric@webkit.org>
711 Reviewed by Tim Hatcher.
713 Pass around CompileData& instead of CompileData*
715 * pcre/pcre_compile.cpp:
719 2007-11-24 Eric Seidel <eric@webkit.org>
723 Clean up compile_branch, move _pcre_ord2utf8, and rename CompileData
725 * JavaScriptCore.xcodeproj/project.pbxproj:
726 * pcre/pcre_compile.cpp:
728 (calculateCompiledPatternLengthAndFlags):
730 * pcre/pcre_internal.h:
731 * pcre/pcre_ord2utf8.cpp: Removed.
733 2007-11-24 Eric Seidel <eric@webkit.org>
739 * pcre/pcre_compile.cpp:
740 (could_be_empty_branch):
742 (calculateCompiledPatternLengthAndFlags):
743 * pcre/pcre_exec.cpp:
746 * pcre/pcre_internal.h:
747 * pcre/pcre_xclass.cpp:
749 2007-11-24 Eric Seidel <eric@webkit.org>
753 clean up formating in compile_branch
755 * pcre/pcre_compile.cpp:
758 2007-11-24 Eric Seidel <eric@webkit.org>
762 Fix spacing for read_repeat_counts
764 * pcre/pcre_compile.cpp:
765 (read_repeat_counts):
767 2007-11-24 Eric Seidel <eric@webkit.org>
771 Get rid of PCRE custom char types
773 * pcre/pcre_compile.cpp:
778 (calculateCompiledPatternLengthAndFlags):
780 * pcre/pcre_exec.cpp:
784 * pcre/pcre_internal.h:
786 2007-11-24 Eric Seidel <eric@webkit.org>
790 reformat get_othercase_range
792 * pcre/pcre_compile.cpp:
793 (get_othercase_range):
795 2007-11-24 Eric Seidel <eric@webkit.org>
799 Remove register keyword and more cleanup
801 * pcre/pcre_compile.cpp:
806 (find_firstassertedchar):
807 (calculateCompiledPatternLengthAndFlags):
809 * pcre/pcre_exec.cpp:
810 (MatchStack::canUseStackBufferForNextFrame):
811 (MatchStack::allocateNextFrame):
812 (MatchStack::pushNewFrame):
813 (MatchStack::frameIsStackAllocated):
814 (MatchStack::popCurrentFrame):
815 (MatchStack::unrollAnyHeapAllocatedFrames):
816 (getUTF8CharAndIncrementLength):
819 * pcre/pcre_internal.h:
821 (isLeadingSurrogate):
822 (isTrailingSurrogate):
823 (decodeSurrogatePair):
825 * pcre/pcre_ord2utf8.cpp:
827 * pcre/pcre_xclass.cpp:
828 (getUTF8CharAndAdvancePointer):
831 2007-11-24 Eric Seidel <eric@webkit.org>
835 Clean up jsRegExpExecute
837 * pcre/pcre_compile.cpp:
840 * pcre/pcre_exec.cpp:
842 * pcre/pcre_internal.h:
844 2007-11-29 Oliver Hunt <oliver@apple.com>
848 Merging updated system alloc and spinlock code from r38 of TCMalloc.
850 This is needed as a precursor to the merge of TCMalloc proper.
852 * wtf/FastMalloc.cpp:
853 (WTF::TCMalloc_PageHeap::GrowHeap):
855 (TCMalloc_SpinLock::TCMalloc_SpinLock):
856 (TCMalloc_SpinLock::):
857 (TCMalloc_SpinLock::Lock):
858 (TCMalloc_SpinLock::Unlock):
859 (TCMalloc_SpinLock::IsHeld):
860 * wtf/TCSystemAlloc.cpp:
865 (TCMalloc_SystemAlloc):
866 * wtf/TCSystemAlloc.h:
868 2007-11-28 Brady Eidson <beidson@apple.com>
872 Add copyKeysToVector utility, mirroring copyValuesToVector
873 Also change the copyValuesToVector implementation to be a little more attractive
876 (WTF::copyKeysToVector):
877 (WTF::copyValuesToVector):
879 2007-11-27 Alp Toker <alp@atoker.com>
881 Reviewed by Mark Rowe.
883 Add a list of public JavaScriptCore headers for installation.
885 This follows the convention used for the Qt and GTK+ header lists.
887 * headers.pri: Added.
889 2007-11-27 Alp Toker <alp@atoker.com>
891 Prospective MSVC build fix.
893 Roll back dllexport/dllimport support for now.
897 2007-11-27 Alp Toker <alp@atoker.com>
901 http://bugs.webkit.org/show_bug.cgi?id=15569
902 [gtk] GTK JavaScriptCore needs to export symbols for JSC API and WTF
904 Introduce JS_EXPORT to mark symbols to be exported as public API.
906 Export all public symbols in the JavaScriptCore C API.
908 This matches conventions for exporting symbols set by the CF and CG
912 * API/JSContextRef.h:
915 * API/JSStringRefBSTR.h:
916 * API/JSStringRefCF.h:
919 2007-11-27 Anders Carlsson <andersca@apple.com>
923 Make PropertyNameArray and ScopeChain COMEnumVariant friendly.
925 * kjs/PropertyNameArray.cpp:
926 (KJS::PropertyNameArray::swap):
927 Implement PropertyNameArray::swap.
929 * kjs/PropertyNameArray.h:
930 Add ValueType typedef. Replace PropertyNameArrayIterator with
931 PropertyNameArray::const_iterator.
934 (KJS::ForInNode::execute):
935 * kjs/scope_chain.cpp:
936 (KJS::ScopeChain::print):
937 Update for changes to PropertyNameArray.
940 Add const_iterator and ValueType typedef.
942 2007-11-27 Anders Carlsson <andersca@apple.com>
946 Add a ValueType typedef.
950 2007-11-26 Darin Adler <darin@apple.com>
954 - fix http://bugs.webkit.org/show_bug.cgi?id=16096
955 REGRESSION (r26653-r26699): Plaxo.com addressbook does not load in webkit nightlies
957 Test: fast/js/regexp-overflow.html
959 * pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags):
960 Removed a stray "ptr++" that I added by accident when merging the
961 changes between PCRE 6.4 and 6.5.
963 2007-11-26 Geoffrey Garen <ggaren@apple.com>
965 Reviewed by Kevin McCullough.
967 Fixed <rdar://problem/5597937> REGRESSION (r27126): Drosera does not
968 show variables (can't enumerate ActivationImp properties)
970 Implemented a custom ActivationImp::getPropertyNames, since
971 ActivationImp now uses a custom property storage mechanism for local
975 (KJS::ActivationImp::getPropertyNames):
978 2007-11-26 Alp Toker <alp@atoker.com>
980 GTK+/Qt/Wx build fix for breakage introduced in r28039.
982 * ForwardingHeaders/JavaScriptCore/JSRetainPtr.h: Added.
984 2007-11-24 Laszlo Gombos <laszlo.gombos@gmail.com>
986 Reviewed by Maciej Stachowiak.
988 Fix minor compiler warning (GCC 4.1.3)
990 * pcre/pcre_internal.h:
991 * pcre/pcre_ucp_searchfuncs.cpp:
992 (_pcre_ucp_othercase):
994 2007-11-25 Mark Rowe <mrowe@apple.com>
996 Reviewed by Dan Bernstein.
998 Fix http://bugs.webkit.org/show_bug.cgi?id=16129
999 Bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build)
1001 * pcre/pcre_compile.cpp: Change errorcode to be passed by reference so that any error code is propagated
1002 to our caller like they expect.
1004 2007-11-23 Kevin Ollivier <kevino@theolliviers.com>
1006 MSVC7 build fix. (rand_s doesn't exist there)
1008 Reviewed by Adam Roben.
1013 2007-11-23 Kevin Ollivier <kevino@theolliviers.com>
1015 wx build fix. Move WX_PYTHON logic into project build settings,
1016 add WebKitLibraries dirs on Win, and explicitly include JSCore
1017 headers in testkjs rather than getting them from a template.
1018 (Include dir order of JSCore/WTF and ICU headers is important due
1019 to wtf/unicode/utf8.h.)
1023 2007-11-23 Simon Hausmann <hausmann@webkit.org>
1025 Reviewed by George Staikos <staikos@kde.org>.
1027 Fix make (dist)clean on Windows.
1029 OBJECTS_DIR_WTR does not exist anymore, use GENERATED_SOURCES_DIR.
1032 * JavaScriptCore.pri:
1035 2007-11-22 Simon Hausmann <hausmann@kde.org>
1039 Make the directory of where to put the generated sources configurable through the GENERATED_SOURCE_DIR variable
1041 * JavaScriptCore.pri:
1044 2007-11-22 Simon Hausmann <hausmann@kde.org>
1048 Centralize the setup for all the extra compilers in a addExtraCompiler function.
1050 This allows adding a "generated_files" target that builds all generated files using "make generated_files".
1051 For the build inside Qt we do not generate actual rules for the extra compilers but instead
1052 do the variable substitution of compiler.output manually and add the generated sources to SOURCES.
1054 * JavaScriptCore.pri:
1057 2007-11-20 Mark Rowe <mrowe@apple.com>
1059 Reviewed by Tim Hatcher.
1061 <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings
1063 Fix all warnings emitted by GCC 4.2 when building JavaScriptCore. This allows builds with
1064 -Werror to succeed. At present they will crash when executed due to code that is not safe
1065 under strict aliasing (<rdar://problem/5536806>).
1067 * Configurations/Base.xcconfig: Remove the -Wno-long-double flag.
1068 * kjs/date_object.cpp:
1069 (KJS::formatTime): Test whether the stack-allocated string is empty rather than at a non-null address.
1071 (Bigint::): Tweak formatting to silence warnings.
1072 * pcre/pcre_exec.cpp:
1073 (match): Tweak formatting to silence warnings
1074 * wtf/Assertions.cpp: Add printf format attribute to functions that warrant it.
1075 * wtf/Assertions.h: Ditto.
1077 2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
1079 wx port build fix (wx headers include ctype functions).
1083 2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
1085 Remove outdated and unused Windows port files.
1087 Reviewed by Adam Roben.
1089 * Makefile.vc: Removed.
1090 * README-Win32.txt: Removed.
1092 2007-11-18 Eric Seidel <eric@webkit.org>
1096 * tests/mozilla/jsDriver.pl: exit non-0 when user aborts test run
1098 2007-11-17 Mark Rowe <mrowe@apple.com>
1100 Reviewed by Darin Adler.
1102 Fix: <rdar://problem/5607032> REGRESSION: testapi exits with assertion failure in debug build
1103 <rdar://problem/5440659> JSGlobalContextCreate throws away globalObjectClass's prototype
1104 http://bugs.webkit.org/show_bug.cgi?id=16033
1106 Split Interpreter's initialization into two distinct steps: the creation of the global prototypes
1107 and constructors, and storing them on the global object. This allows JSClassRef's passed to
1108 JSGlobalContextCreate to be instantiated with the correct prototype.
1110 * API/JSCallbackObject.cpp: Assert at compile-time that the custom global object will fit in a collector cell.
1111 * API/JSCallbackObject.h:
1112 * API/JSCallbackObjectFunctions.h:
1113 (KJS::::JSCallbackObject):
1115 * API/JSContextRef.cpp:
1116 (JSGlobalContextCreate): Construct and set the interpreter's global object separately. When globalObjectClass
1117 is passed we need to set the interpreter's global object before doing the JSCallbackObject's initialization to
1118 prevent any JSObjectInitializeCallback's being invoked before a global object is set.
1120 (globalObject_initialize): Test the object passed in is correct and that it has the expected global properties.
1124 * API/testapi.js: Test that any static properties exposed by the global object's custom class are found.
1125 * JavaScriptCore.exp:
1126 * bindings/testbindings.cpp:
1127 (main): Update for changes in Interpreter method signatures.
1128 * bindings/testbindings.mm:
1130 * kjs/ExecState.cpp:
1131 (KJS::ExecState::ExecState):
1132 (KJS::ExecState::mark):
1133 (KJS::ExecState::setGlobalObject):
1134 * kjs/ExecState.h: Rename scope to m_scopeChain.
1135 * kjs/interpreter.cpp:
1136 (KJS::Interpreter::Interpreter):
1137 (KJS::Interpreter::init):
1138 (KJS::Interpreter::globalObject):
1139 (KJS::Interpreter::setGlobalObject):
1140 (KJS::Interpreter::resetGlobalObjectProperties):
1141 (KJS::Interpreter::createObjectsForGlobalObjectProperties):
1142 (KJS::Interpreter::setGlobalObjectProperties): Switch to using putDirect to ensure that the global object's put method
1143 cannot interfere with setting of the global properties. This prevents a user-written JSClassRef from attempting to
1144 call back into JavaScript from the initialization of the global object's members.
1145 * kjs/interpreter.h:
1147 (setupInterpreter): Update for changes in Interpreter method signatures.
1149 2007-11-17 Mark Rowe <mrowe@apple.com>
1151 Reviewed by Sam Weinig.
1153 Prevent testapi from reporting false leaks. Clear out local variables pointing at
1154 JSObjectRefs to allow their values to be collected.
1159 2007-11-17 Mark Rowe <mrowe@apple.com>
1161 Reviewed by Sam Weinig.
1163 Prevent testapi from crashing if testapi.js can not be found by nil-checking the result of createStringWithContentsOfFile.
1168 2007-11-17 Alp Toker <alp@atoker.com>
1172 http://bugs.webkit.org/show_bug.cgi?id=16032
1173 JS minidom is not portable
1175 Use a plain UTF-8 string instead of a CFString.
1177 Print to stdout, not stderr like CFShow() would have done, since that
1178 behaviour seems unintentional.
1183 2007-11-17 Steve Falkenburg <sfalken@apple.com>
1187 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1189 2007-11-16 Mark Rowe <mrowe@apple.com>
1194 (KJS::Lexer::record8):
1196 2007-11-16 Mark Rowe <mrowe@apple.com>
1200 Replace strings, identifier, buffer8 and buffer16 members of Lexer with vectors.
1201 SunSpider claims this is a 0.7% speedup.
1204 (KJS::Lexer::Lexer):
1206 (KJS::Lexer::record8):
1207 (KJS::Lexer::record16):
1208 (KJS::Lexer::scanRegExp):
1209 (KJS::Lexer::clear):
1210 (KJS::Lexer::makeIdentifier):
1211 (KJS::Lexer::makeUString):
1214 (KJS::UString::UString): Add a convenience constructor that takes a const Vector<UChar>&.
1217 2007-11-16 Adam Roben <aroben@apple.com>
1221 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add a new include path
1222 and ignore the int -> bool conversion warning.
1224 2007-11-16 Alexey Proskuryakov <ap@webkit.org>
1226 Fix Windows debug build.
1227 Rubber-stamped by Eric
1229 * pcre/pcre_exec.cpp: (match): Removed ASSERT_NOT_REACHED assertions that were making MSVC
1230 complain about unreachable code.
1232 2007-11-15 Mark Rowe <mrowe@apple.com>
1238 2007-11-15 Mark Rowe <mrowe@apple.com>
1240 Mac build and header search path sanity fix.
1242 Reviewed by Sam Weinig and Tim Hatcher.
1244 Move base setting for HEADER_SEARCH_PATHS into Base.xcconfig, and extend
1245 it in JavaScriptCore.xcconfig. This removes the need to override it on a
1246 per-target basis inside the .xcodeproj file.
1248 * Configurations/Base.xcconfig:
1249 * Configurations/JavaScriptCore.xcconfig:
1250 * JavaScriptCore.xcodeproj/project.pbxproj:
1252 2007-11-15 Mark Rowe <mrowe@apple.com>
1258 2007-11-15 Geoffrey Garen <ggaren@apple.com>
1260 Reviewed by Eric Seidel.
1262 Another round of grammar / parsing cleanup.
1264 1. Created distinct parser calls for parsing function bodies vs
1265 programs. This will help later with optimizing global variable access.
1267 2. Turned Parser into a singleton. Cleaned up Lexer's singleton
1270 3. Modified Lexer to free a little more memory when done lexing. (Added
1271 FIXMEs for similar issues that I didn't fix.)
1273 4. Changed Lexer::makeIdentifier and Lexer::makeUString to start
1274 respecting the arguments passed to them. (No behavior change, but this
1275 problem could have caused serious problems for an unsuspecting user of
1278 5. Removed KJS_DEBUG_MEM because it was bit-rotted.
1280 6. Removed Parser::prettyPrint because the same work was simpler to do
1285 "Parser::accept" => "Parser::didFinishParsing"
1286 "Parser::sid" => "Parser::m_sourceID"
1287 "Lexer::doneParsing" => "Lexer::clear"
1289 "lineno" => "lineNo"
1291 * JavaScriptCore.exp:
1293 (KJS::Parser::Parser):
1294 (KJS::Parser::parseProgram):
1295 (KJS::Parser::parseFunctionBody):
1296 (KJS::Parser::parse):
1297 (KJS::Parser::didFinishParsing):
1300 (KJS::Parser::sourceId):
1302 (KJS::GlobalFuncImp::callAsFunction):
1303 * kjs/function_object.cpp:
1304 (FunctionObjectImp::construct):
1306 * kjs/interpreter.cpp:
1307 (KJS::Interpreter::checkSyntax):
1308 (KJS::Interpreter::evaluate):
1309 * kjs/interpreter.h:
1313 (KJS::Lexer::Lexer):
1314 (KJS::Lexer::~Lexer):
1315 (KJS::Lexer::scanRegExp):
1316 (KJS::Lexer::doneParsing):
1317 (KJS::Lexer::makeIdentifier):
1318 (KJS::Lexer::makeUString):
1320 (KJS::Lexer::pattern):
1321 (KJS::Lexer::flags):
1322 (KJS::Lexer::sawError):
1325 (KJS::FunctionBodyNode::FunctionBodyNode):
1328 (prettyPrintScript):
1333 2007-11-15 Oliver Hunt <oliver@apple.com>
1337 <rdar://problem/5601548> REGRESSION: All SourceElements and their children leak after a syntax error
1339 Add a stub node to maintain the Vector of SourceElements until assignment.
1343 (KJS::SourceElementsStub::SourceElementsStub):
1344 (KJS::SourceElementsStub::append):
1345 (KJS::SourceElementsStub::release):
1346 (KJS::SourceElementsStub::):
1347 (KJS::SourceElementsStub::precedence):
1349 2007-11-15 Eric Seidel <eric@webkit.org>
1353 Abstract most of RMATCH into MatchStack functions.
1355 SunSpider claims this, combined with the last 2 patches was a 1% speedup, 10% for dna-regexp.
1357 * pcre/pcre_exec.cpp:
1358 (MatchStack::canUseStackBufferForNextFrame):
1359 (MatchStack::allocateNextFrame):
1360 (MatchStack::pushNewFrame):
1361 (MatchStack::frameIsStackAllocated):
1362 (MatchStack::popCurrentFrame):
1363 (MatchStack::unrollAnyHeapAllocatedFrames):
1366 2007-11-15 Eric Seidel <eric@webkit.org>
1370 Remove RETURN_ERROR, add MatchStack
1372 * pcre/pcre_exec.cpp:
1373 (MatchStack::MatchStack):
1374 (MatchStack::unrollAnyHeapAllocatedFrames):
1378 2007-11-15 Eric Seidel <eric@webkit.org>
1382 Clean up match function to match WebKit style
1384 * JavaScriptCore.xcodeproj/project.pbxproj:
1385 * pcre/pcre_exec.cpp:
1388 2007-11-15 Steve Falkenburg <sfalken@apple.com>
1392 * JavaScriptCore.vcproj/JavaScriptCore.make:
1394 2007-11-14 Alexey Proskuryakov <ap@webkit.org>
1398 http://bugs.webkit.org/show_bug.cgi?id=15982
1399 Improve JSString UTF-8 decoding
1401 * API/JSStringRef.cpp:
1402 (JSStringCreateWithUTF8CString): Use strict decoding, return 0 on error.
1404 * wtf/unicode/UTF8.cpp:
1405 (WTF::Unicode::convertUTF16ToUTF8):
1406 (WTF::Unicode::convertUTF8ToUTF16):
1407 * wtf/unicode/UTF8.h:
1408 Made these function names start with a lower case letter.
1410 * kjs/ustring.cpp: (KJS::UString::UTF8String): Updated for the above renaming.
1412 * bindings/c/c_utility.cpp:
1413 (KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback): Renamed to highlight the difference
1414 from convertUTF8ToUTF16 in wtf/unicode.
1415 (KJS::Bindings::convertNPStringToUTF16): Updated for the above renaming.
1416 (KJS::Bindings::identifierFromNPIdentifier): Ditto.
1417 * bindings/c/c_utility.h: Made convertUTF8ToUTF16WithLatin1Fallback() a file static.
1419 2007-11-14 Sam Weinig <sam@webkit.org>
1421 Rubber-stamped by Anders.
1423 Fix the Xcode project file after it was messed up in r27402.
1425 * JavaScriptCore.xcodeproj/project.pbxproj:
1427 2007-11-14 Eric Seidel <eric@webkit.org>
1431 More PCRE style cleanup.
1433 * pcre/pcre_compile.cpp:
1436 2007-11-14 Adam Roben <aroben@apple.com>
1438 Clean up the bison conflict checking script
1442 * DerivedSources.make:
1444 2007-11-14 Eric Seidel <eric@webkit.org>
1448 Another round of PCRE cleanups: inlines
1450 SunSpider claims that this, combined with my previous PCRE cleanup were a 0.7% speedup, go figure.
1452 * pcre/pcre_compile.cpp:
1454 * pcre/pcre_exec.cpp:
1457 * pcre/pcre_internal.h:
1464 2007-11-14 Eric Seidel <eric@webkit.org>
1468 Give PCRE a (small) bath.
1469 Fix some formating and break things off into separate functions
1470 http://bugs.webkit.org/show_bug.cgi?id=15993
1472 * pcre/pcre_compile.cpp:
1473 (calculateCompiledPatternLengthAndFlags):
1474 (printCompiledRegExp):
1477 * pcre/pcre_internal.h:
1478 (compile_data::compile_data):
1480 2007-11-14 Geoffrey Garen <ggaren@apple.com>
1482 Reviewed by Eric Seidel.
1484 Cleaned up the JavaScript grammar a bit.
1486 1. Changed BlockNode to always hold a child vector (which may be empty),
1487 eliminating a few NULL-check branches in the common execution case.
1489 2. Changed the Block production to correctly report its starting and
1490 ending line numbers to the debugger. (It used to report its ending line
1491 as its starting line.) Also, removed duplicate line-reporting code
1492 inside the BlockNode constructor.
1494 3. Moved curly braces up from FunctionBody production into parent
1495 productions. (I had to move the line number reporting code, too, since
1496 it depends on the location of the curly braces.) This matches the ECMA
1497 spec more closely, and makes some future changes I plan easier.
1499 4. Fixed statementList* convenience functions to deal appropriately with
1502 SunSpider reports a small and statistically insignificant speedup.
1506 (KJS::statementListPushFIFO):
1507 (KJS::statementListGetDeclarations):
1508 (KJS::statementListInitializeDeclarationStack):
1509 (KJS::statementListInitializeVariableAccessStack):
1510 (KJS::BlockNode::BlockNode):
1511 (KJS::BlockNode::optimizeVariableAccess):
1512 (KJS::BlockNode::getDeclarations):
1513 (KJS::BlockNode::execute):
1514 (KJS::FunctionBodyNode::initializeDeclarationStacks):
1515 (KJS::FunctionBodyNode::optimizeVariableAccess):
1517 2007-11-13 Anders Carlsson <andersca@apple.com>
1519 Add RefCounted.h (And remove Shared.h)
1521 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1523 2007-11-13 Geoffrey Garen <ggaren@apple.com>
1529 2007-11-13 Geoffrey Garen <ggaren@apple.com>
1531 Reviewed by Anders Carlsson.
1533 Renamed Shared to RefCounted.
1536 * JavaScriptCore.xcodeproj/project.pbxproj:
1537 * kjs/interpreter.h:
1539 * wtf/RefCounted.h: Copied from JavaScriptCore/wtf/Shared.h.
1540 (WTF::RefCounted::RefCounted):
1541 * wtf/Shared.h: Removed.
1543 2007-11-13 Adam Roben <aroben@apple.com>
1549 * kjs/regexp.h: Added a missing #include.
1551 2007-11-13 Geoffrey Garen <ggaren@apple.com>
1553 Reviewed by Sam Weinig.
1555 Moved Shared.h into wtf so it could be used in more places. Deployed
1556 Shared in places where JSCore previously had hand-rolled ref-counting
1559 * API/JSClassRef.cpp:
1560 (OpaqueJSClass::OpaqueJSClass):
1562 * API/JSObjectRef.cpp:
1565 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1566 * JavaScriptCore.xcodeproj/project.pbxproj:
1567 * kjs/interpreter.cpp:
1568 (KJS::Interpreter::init):
1569 * kjs/interpreter.h:
1571 (KJS::RegExp::RegExp):
1573 * wtf/Shared.h: Copied from WebCore/platform/Shared.h.
1575 2007-11-13 Eric Seidel <eric@webkit.org>
1579 Add an ASSERT to getTruncatedInt32 to enforce proper usage.
1580 Best part about this patch? It doesn't break the web!
1582 * kjs/JSImmediate.h:
1583 (KJS::JSImmediate::getTruncatedInt32):
1584 (KJS::JSImmediate::toDouble):
1585 (KJS::JSImmediate::getUInt32):
1587 2007-11-13 Alexey Proskuryakov <ap@webkit.org>
1591 * bindings/c/c_utility.cpp:
1592 (KJS::Bindings::convertUTF8ToUTF16):
1594 (KJS::UString::UTF8String):
1595 * wtf/unicode/UTF8.cpp:
1596 (WTF::Unicode::ConvertUTF8ToUTF16):
1598 2007-11-13 Darin Adler <darin@apple.com>
1602 - fix http://bugs.webkit.org/show_bug.cgi?id=11231
1603 RegExp bug when handling newline characters
1604 and a number of other differences between PCRE behvior
1605 and JavaScript regular expressions:
1607 + single-digit sequences like \4 should be treated as octal
1608 character constants, unless there is a sufficient number
1609 of brackets for them to be treated as backreferences
1611 + \8 turns into the character "8", not a binary zero character
1612 followed by "8" (same for 9)
1614 + only the first 3 digits should be considered part of an
1615 octal character constant (the old behavior was to decode
1616 an arbitrarily long sequence and then mask with 0xFF)
1618 + if \x is followed by anything other than two valid hex digits,
1619 then it should simply be treated a the letter "x"; that includes
1620 not supporting the \x{41} syntax
1622 + if \u is followed by anything less than four valid hex digits,
1623 then it should simply be treated a the letter "u"
1625 + an extra "+" should be a syntax error, rather than being treated
1626 as the "possessive quantifier"
1628 + if a "]" character appears immediately after a "[" character that
1629 starts a character class, then that's an empty character class,
1630 rather than being the start of a character class that includes a
1633 + a "$" should not match a terminating newline; we could have gotten
1634 PCRE to handle this the way we wanted by passing an appropriate option
1636 Test: fast/js/regexp-no-extensions.html
1638 * pcre/pcre_compile.cpp:
1639 (check_escape): Check backreferences against bracount to catch both
1640 overflows and things that should be treated as octal. Rewrite octal
1641 loop to not go on indefinitely. Rewrite both hex loops to match and
1642 remove \x{} support.
1643 (compile_branch): Restructure loops so that we don't special-case a "]"
1644 at the beginning of a character class. Remove code that treated "+" as
1645 the possessive quantifier.
1646 (jsRegExpCompile): Change the "]" handling here too.
1648 * pcre/pcre_exec.cpp: (match): Changed CIRC to match the DOLL implementation.
1649 Changed DOLL to remove handling of "terminating newline", a Perl concept
1650 which we don't need.
1652 * tests/mozilla/expected.html: Two tests are fixed now:
1653 ecma_3/RegExp/regress-100199.js and ecma_3/RegExp/regress-188206.js.
1654 One test fails now: ecma_3/RegExp/perlstress-002.js -- our success before
1655 was due to a bug (we treated all 1-character numeric escapes as backreferences).
1656 The date tests also now both expect success -- whatever was making them fail
1657 before was probably due to the time being close to a DST shift; maybe we need
1658 to get rid of those tests.
1660 2007-11-13 Darin Adler <darin@apple.com>
1662 * kjs/JSImmediate.h: (KJS::JSImmediate::getTruncatedInt32):
1663 Remove too-strong assert that was firing constantly and preventing even basic
1664 web browsing from working in a debug build. This function is used in many
1665 cases where the immediate value is not a number; the assertion could perhaps
1666 be added back later with a bit of reorganization.
1668 2007-11-13 Alp Toker <alp@atoker.com>
1670 Build fix for breakage to non-Mac builds introduced in r27746.
1674 2007-11-13 Eric Seidel <eric@webkit.org>
1678 Clean up evaluateToBoolean functions to use inlines instead of copy/paste code
1680 * kjs/JSImmediate.h:
1682 (KJS::GreaterNode::inlineEvaluateToBoolean):
1683 (KJS::GreaterNode::evaluate):
1684 (KJS::LessEqNode::inlineEvaluateToBoolean):
1685 (KJS::LessEqNode::evaluate):
1686 (KJS::GreaterEqNode::inlineEvaluateToBoolean):
1687 (KJS::GreaterEqNode::evaluate):
1688 (KJS::InNode::evaluateToBoolean):
1689 (KJS::EqualNode::inlineEvaluateToBoolean):
1690 (KJS::EqualNode::evaluate):
1691 (KJS::NotEqualNode::inlineEvaluateToBoolean):
1692 (KJS::NotEqualNode::evaluate):
1693 (KJS::StrictEqualNode::inlineEvaluateToBoolean):
1694 (KJS::StrictEqualNode::evaluate):
1695 (KJS::NotStrictEqualNode::inlineEvaluateToBoolean):
1696 (KJS::NotStrictEqualNode::evaluate):
1699 2007-11-12 Geoffrey Garen <ggaren@apple.com>
1701 Reviewed by Sam Weinig.
1703 Fixed http://bugs.webkit.org/show_bug.cgi?id=15958
1704 base64 spends 1.1% of total time checking for special Infinity case
1706 Use a fast character test instead of calling strncmp.
1708 1.1% speedup on string-base64. SunSpider reports a .4% speedup overall;
1709 Sharks reports only .1%. Who are you going to believe? Huh?
1712 (KJS::UString::toDouble):
1714 2007-11-12 Eric Seidel <eric@webkit.org>
1718 Add evaluateToInt32 and evaluateUInt32 methods and deploy them.
1719 Fix a few missing evaluateToBoolean methods
1720 Deploy all evaluateTo* functions to more nodes to avoid slowdowns
1721 http://bugs.webkit.org/show_bug.cgi?id=15950
1723 SunSpider claims this is at least a 1.4% speedup.
1725 * kjs/JSImmediate.h:
1726 (KJS::JSImmediate::getTruncatedInt32):
1727 (KJS::JSImmediate::toDouble):
1728 (KJS::JSImmediate::getUInt32):
1730 (KJS::ExpressionNode::evaluateToNumber):
1731 (KJS::ExpressionNode::evaluateToInt32):
1732 (KJS::ExpressionNode::evaluateToUInt32):
1733 (KJS::NumberNode::evaluateToInt32):
1734 (KJS::NumberNode::evaluateToUInt32):
1735 (KJS::ImmediateNumberNode::evaluateToInt32):
1736 (KJS::ImmediateNumberNode::evaluateToUInt32):
1737 (KJS::ResolveNode::evaluate):
1738 (KJS::ResolveNode::evaluateToNumber):
1739 (KJS::ResolveNode::evaluateToBoolean):
1740 (KJS::ResolveNode::evaluateToInt32):
1741 (KJS::ResolveNode::evaluateToUInt32):
1742 (KJS::LocalVarAccessNode::evaluateToInt32):
1743 (KJS::LocalVarAccessNode::evaluateToUInt32):
1744 (KJS::BracketAccessorNode::evaluateToNumber):
1745 (KJS::BracketAccessorNode::evaluateToBoolean):
1746 (KJS::BracketAccessorNode::evaluateToInt32):
1747 (KJS::BracketAccessorNode::evaluateToUInt32):
1748 (KJS::DotAccessorNode::inlineEvaluate):
1749 (KJS::DotAccessorNode::evaluate):
1750 (KJS::DotAccessorNode::evaluateToNumber):
1751 (KJS::DotAccessorNode::evaluateToBoolean):
1752 (KJS::DotAccessorNode::evaluateToInt32):
1753 (KJS::DotAccessorNode::evaluateToUInt32):
1754 (KJS::NewExprNode::inlineEvaluate):
1755 (KJS::NewExprNode::evaluate):
1756 (KJS::NewExprNode::evaluateToNumber):
1757 (KJS::NewExprNode::evaluateToBoolean):
1758 (KJS::NewExprNode::evaluateToInt32):
1759 (KJS::NewExprNode::evaluateToUInt32):
1760 (KJS::FunctionCallResolveNode::inlineEvaluate):
1761 (KJS::FunctionCallResolveNode::evaluate):
1762 (KJS::FunctionCallResolveNode::evaluateToNumber):
1763 (KJS::FunctionCallResolveNode::evaluateToBoolean):
1764 (KJS::FunctionCallResolveNode::evaluateToInt32):
1765 (KJS::FunctionCallResolveNode::evaluateToUInt32):
1766 (KJS::LocalVarFunctionCallNode::evaluate):
1767 (KJS::LocalVarFunctionCallNode::evaluateToNumber):
1768 (KJS::LocalVarFunctionCallNode::evaluateToBoolean):
1769 (KJS::LocalVarFunctionCallNode::evaluateToInt32):
1770 (KJS::LocalVarFunctionCallNode::evaluateToUInt32):
1771 (KJS::FunctionCallDotNode::evaluate):
1772 (KJS::FunctionCallDotNode::evaluateToNumber):
1773 (KJS::FunctionCallDotNode::evaluateToBoolean):
1774 (KJS::FunctionCallDotNode::evaluateToInt32):
1775 (KJS::FunctionCallDotNode::evaluateToUInt32):
1776 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
1777 (KJS::PostDecLocalVarNode::evaluateToNumber):
1778 (KJS::PostDecLocalVarNode::evaluateToBoolean):
1779 (KJS::PostDecLocalVarNode::evaluateToInt32):
1780 (KJS::PostDecLocalVarNode::evaluateToUInt32):
1781 (KJS::typeStringForValue):
1782 (KJS::UnaryPlusNode::evaluate):
1783 (KJS::UnaryPlusNode::evaluateToBoolean):
1784 (KJS::UnaryPlusNode::evaluateToNumber):
1785 (KJS::UnaryPlusNode::evaluateToInt32):
1786 (KJS::BitwiseNotNode::inlineEvaluateToInt32):
1787 (KJS::BitwiseNotNode::evaluate):
1788 (KJS::BitwiseNotNode::evaluateToNumber):
1789 (KJS::BitwiseNotNode::evaluateToBoolean):
1790 (KJS::BitwiseNotNode::evaluateToInt32):
1791 (KJS::MultNode::evaluateToBoolean):
1792 (KJS::MultNode::evaluateToInt32):
1793 (KJS::MultNode::evaluateToUInt32):
1794 (KJS::DivNode::evaluateToInt32):
1795 (KJS::DivNode::evaluateToUInt32):
1796 (KJS::ModNode::evaluateToBoolean):
1797 (KJS::ModNode::evaluateToInt32):
1798 (KJS::ModNode::evaluateToUInt32):
1799 (KJS::AddNode::evaluateToNumber):
1800 (KJS::AddNode::evaluateToInt32):
1801 (KJS::AddNode::evaluateToUInt32):
1802 (KJS::AddNumbersNode::evaluateToInt32):
1803 (KJS::AddNumbersNode::evaluateToUInt32):
1804 (KJS::SubNode::evaluateToInt32):
1805 (KJS::SubNode::evaluateToUInt32):
1806 (KJS::LeftShiftNode::inlineEvaluateToInt32):
1807 (KJS::LeftShiftNode::evaluate):
1808 (KJS::LeftShiftNode::evaluateToNumber):
1809 (KJS::LeftShiftNode::evaluateToInt32):
1810 (KJS::RightShiftNode::inlineEvaluateToInt32):
1811 (KJS::RightShiftNode::evaluate):
1812 (KJS::RightShiftNode::evaluateToNumber):
1813 (KJS::RightShiftNode::evaluateToInt32):
1814 (KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
1815 (KJS::UnsignedRightShiftNode::evaluate):
1816 (KJS::UnsignedRightShiftNode::evaluateToNumber):
1817 (KJS::UnsignedRightShiftNode::evaluateToInt32):
1818 (KJS::LessNode::inlineEvaluateToBoolean):
1819 (KJS::LessNode::evaluate):
1820 (KJS::LessNode::evaluateToBoolean):
1821 (KJS::LessNumbersNode::inlineEvaluateToBoolean):
1822 (KJS::LessNumbersNode::evaluate):
1823 (KJS::LessNumbersNode::evaluateToBoolean):
1824 (KJS::LessStringsNode::inlineEvaluateToBoolean):
1825 (KJS::LessStringsNode::evaluate):
1826 (KJS::BitAndNode::evaluate):
1827 (KJS::BitAndNode::inlineEvaluateToInt32):
1828 (KJS::BitAndNode::evaluateToNumber):
1829 (KJS::BitAndNode::evaluateToBoolean):
1830 (KJS::BitAndNode::evaluateToInt32):
1831 (KJS::BitXOrNode::inlineEvaluateToInt32):
1832 (KJS::BitXOrNode::evaluate):
1833 (KJS::BitXOrNode::evaluateToNumber):
1834 (KJS::BitXOrNode::evaluateToBoolean):
1835 (KJS::BitXOrNode::evaluateToInt32):
1836 (KJS::BitOrNode::inlineEvaluateToInt32):
1837 (KJS::BitOrNode::evaluate):
1838 (KJS::BitOrNode::evaluateToNumber):
1839 (KJS::BitOrNode::evaluateToBoolean):
1840 (KJS::BitOrNode::evaluateToInt32):
1841 (KJS::ConditionalNode::evaluateToNumber):
1842 (KJS::ConditionalNode::evaluateToInt32):
1843 (KJS::ConditionalNode::evaluateToUInt32):
1844 (KJS::valueForReadModifyAssignment):
1845 (KJS::AssignExprNode::evaluate):
1846 (KJS::AssignExprNode::evaluateToBoolean):
1847 (KJS::AssignExprNode::evaluateToNumber):
1848 (KJS::AssignExprNode::evaluateToInt32):
1849 (KJS::VarDeclNode::handleSlowCase):
1851 (KJS::FunctionCallResolveNode::precedence):
1852 (KJS::AddNode::precedence):
1854 (KJS::LessNumbersNode::):
1855 (KJS::LessStringsNode::):
1857 (KJS::JSValue::toInt32SlowCase):
1858 (KJS::JSValue::toUInt32SlowCase):
1860 (KJS::JSValue::asCell):
1861 (KJS::JSValue::toInt32):
1862 (KJS::JSValue::toUInt32):
1864 2007-11-12 Alexey Proskuryakov <ap@webkit.org>
1868 http://bugs.webkit.org/show_bug.cgi?id=15953
1869 Add UTF-8 encoding/decoding to WTF
1871 * kjs/ustring.h: Moved UTF8SequenceLength() and decodeUTF8Sequence() to wtf/unicode.
1872 * kjs/ustring.cpp: (KJS::UString::UTF8String): Changed this function to take a strict/lenient
1873 parameter. Callers are not interested in getting decoding results in strict mode, so
1874 this allows for bailing out as soon as an error is seen.
1877 (KJS::encode): Updated for new UString::UTF8String() signature.
1879 * API/JSStringRef.cpp:
1880 (JSStringCreateWithCharacters): Disambiguate UChar.
1881 (JSStringCreateWithUTF8CString): Actually use UTF-8 when creating the string!
1882 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16): Use ConvertUTF8ToUTF16().
1884 * wtf/unicode/UTF8.cpp: Added.
1885 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII):
1886 (WTF::Unicode::inlineUTF8SequenceLength):
1887 (WTF::Unicode::UTF8SequenceLength):
1888 (WTF::Unicode::decodeUTF8Sequence):
1890 (WTF::Unicode::ConvertUTF16ToUTF8):
1891 (WTF::Unicode::isLegalUTF8):
1892 (WTF::Unicode::ConvertUTF8ToUTF16):
1893 * wtf/unicode/UTF8.h: Added.
1895 Some code moved from ustring.h, some adapted from unicode.org sources.
1897 * JavaScriptCore.exp:
1898 * JavaScriptCore.pri:
1899 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1900 * JavaScriptCore.xcodeproj/project.pbxproj:
1901 * JavaScriptCoreSources.bkl:
1904 2007-11-12 Josh Aas <joshmoz@gmail.com>
1908 - http://bugs.webkit.org/show_bug.cgi?id=15946
1909 add NPPValue NPPVpluginDrawingModel (Mozilla bug 403418 compat)
1913 2007-11-12 Darin Adler <darin@apple.com>
1917 - http://bugs.webkit.org/show_bug.cgi?id=15951
1918 REGRESSION: assertion failure in regexp match() when running JS tests
1920 Test: fast/js/regexp-many-brackets.html
1922 * pcre/pcre_exec.cpp: (match): Added back accidentally-removed case for
1923 the BRANUMBER opcode.
1925 2007-11-12 Darin Adler <darin@apple.com>
1929 - fix use of prefix and config.h, got rid of a few unneeded things in
1930 the PCRE code; no behavior changes
1932 * API/JSBase.cpp: Added include of config.h.
1933 * API/JSCallbackConstructor.cpp: Ditto.
1934 * API/JSCallbackFunction.cpp: Ditto.
1935 * API/JSCallbackObject.cpp: Ditto.
1936 * API/JSClassRef.cpp: Ditto.
1937 * API/JSContextRef.cpp: Ditto.
1938 * API/JSObjectRef.cpp: Ditto.
1939 * API/JSStringRef.cpp: Ditto.
1940 * API/JSValueRef.cpp: Ditto.
1942 * JavaScriptCorePrefix.h: Removed obsolete <ctype.h> workaround.
1943 Moved new/delete macros after includes, as they are in WebCore's prefix.
1946 * pcre/dftables.cpp: (main): Changed back to not use a separate maketables
1947 function. This is needed for PCRE, but not helpful for our use. Also changed
1948 the tables to all be 128 entries long instead of 256, since only the first
1951 * pcre/pcre_compile.cpp: Added include of config.h. Eliminated digitab,
1952 which was only being used to check hex digits. Changed all uses of TRUE and
1953 FALSE to use the C++ true and false instead.
1954 (check_escape): Just the TRUE/FALSE thing.
1955 (is_counted_repeat): Ditto.
1956 (could_be_empty_branch): Ditto.
1957 (get_othercase_range): Ditto.
1958 (compile_branch): Ditto.
1959 (compile_regex): Ditto.
1960 (is_anchored): Ditto.
1961 (is_startline): Ditto.
1962 (find_firstassertedchar): Ditto.
1963 (jsRegExpCompile): Ditto.
1965 * pcre/pcre_exec.cpp: Added include of config.h. Changed all uses of TRUE and
1966 FALSE to use the C++ true and false instead.
1967 (match_ref): Just the TRUE/FALSE thing.
1968 (match): Ditto. Removed some unneeded braces.
1969 (jsRegExpExecute): Just the TRUE/FALSE thing.
1971 * pcre/pcre_internal.h: Moved the constants needed by dftables.cpp to the top
1972 of the file instead of the bottom, so they can be used. Also changed the table
1973 sizes to 128 instead of 256. Removed macro definitions of FALSE and TRUE.
1974 Set array sizes for all the const arrays. Changed _pcre_utf8_table1_size to
1975 be a macro instead of a extern int.
1977 * pcre/pcre_maketables.cpp: Removed. It's all in dftables.cpp now.
1979 * pcre/pcre_tables.cpp: Made table sizes explicit.
1981 * pcre/pcre_xclass.cpp: Just the TRUE/FALSE thing.
1983 2007-11-12 Adam Roben <aroben@apple.com>
1987 * wtf/FastMalloc.h: Add missing using statement.
1989 2007-11-11 Oliver Hunt <oliver@apple.com>
1993 Add special fastZeroedMalloc function to replace a
1994 number of fastCalloc calls where one argument was 1.
1996 This results in a 0.4% progression in SunSpider, more
1997 than making up for the earlier regression caused by
1998 additional overflow checks.
2000 * JavaScriptCore.exp:
2001 * kjs/array_instance.cpp:
2002 * kjs/property_map.cpp:
2003 * wtf/FastMalloc.cpp:
2007 2007-11-11 Adam Roben <aroben@apple.com>
2009 Fix <rdar://5578982> ASSERT in HashTable::checkTableConsistencyExceptSize beneath WebNotificationCenter
2011 The bug was due to a mismatch between HashMap::remove and
2012 HashTable::checkTableConsistency. HashMap::remove can delete the value
2013 stored in the HashTable (by derefing it), which is not normally
2014 allowed by HashTable. It's OK in this case because the value is about
2015 to be removed from the table, but HashTable wasn't aware of this.
2017 HashMap::remove now performs the consistency check itself before
2020 Darin noticed that the same bug would occur in HashSet, so I've fixed
2026 (WTF::HashMap::remove): Perform the HashTable consistency check
2027 manually before calling deref.
2029 (WTF::HashSet::remove): Ditto.
2030 * wtf/HashTable.h: Made checkTableConsistency public so that HashMap
2031 and HashSet can call it.
2032 (WTF::HashTable::removeAndInvalidateWithoutEntryConsistencyCheck):
2034 (WTF::HashTable::removeAndInvalidate): Added.
2035 (WTF::HashTable::remove):
2036 (WTF::HashTable::removeWithoutEntryConsistencyCheck): Added.
2038 2007-11-11 Mark Rowe <mrowe@apple.com>
2040 Build fix. Use the correct filename case.
2044 2007-11-11 Geoffrey Garen <ggaren@apple.com>
2046 Reviewed by Sam Weinig.
2048 Fixed http://bugs.webkit.org/show_bug.cgi?id=15902
2049 15% of string-validate-input.js is spent compiling the same regular expression
2051 Store a compiled representation of the regular expression in the AST.
2053 Only a .2% SunSpider speedup overall, but a 10.6% speedup on
2054 string-validate-input.js.
2057 (KJS::RegExpNode::evaluate):
2059 (KJS::RegExpNode::):
2060 * kjs/nodes2string.cpp:
2061 (KJS::RegExpNode::streamTo):
2063 (KJS::RegExp::flags):
2065 (KJS::RegExp::pattern):
2066 * kjs/regexp_object.cpp:
2067 (KJS::RegExpObjectImp::construct):
2068 (KJS::RegExpObjectImp::createRegExpImp):
2069 * kjs/regexp_object.h:
2071 2007-11-11 Oliver Hunt <oliver@apple.com>
2075 Partial fix for <rdar://problem/5585334> numfuzz: integer overflows opening malformed SVG file in WebCore::ImageBuffer::create
2077 Unfortunately this is a very slight regression, but is unavoidable.
2079 * wtf/FastMalloc.cpp:
2081 2007-11-10 Eric Seidel <eric@webkit.org>
2085 Add simple type inferencing to the parser, and create custom
2086 AddNode and LessNode subclasses based on inferred types.
2087 http://bugs.webkit.org/show_bug.cgi?id=15884
2089 SunSpider claims this is at least a 0.5% speedup.
2091 * JavaScriptCore.exp:
2094 (KJS::NumberImp::getPrimitiveNumber):
2095 (KJS::GetterSetterImp::getPrimitiveNumber):
2101 (KJS::StringNode::evaluate):
2102 (KJS::StringNode::evaluateToNumber):
2103 (KJS::StringNode::evaluateToBoolean):
2104 (KJS::RegExpNode::evaluate):
2105 (KJS::UnaryPlusNode::optimizeVariableAccess):
2106 (KJS::AddNode::evaluate):
2107 (KJS::AddNode::evaluateToNumber):
2108 (KJS::AddNumbersNode::inlineEvaluateToNumber):
2109 (KJS::AddNumbersNode::evaluate):
2110 (KJS::AddNumbersNode::evaluateToNumber):
2111 (KJS::AddStringsNode::evaluate):
2112 (KJS::AddStringLeftNode::evaluate):
2113 (KJS::AddStringRightNode::evaluate):
2116 (KJS::LessNumbersNode::evaluate):
2117 (KJS::LessStringsNode::evaluate):
2119 (KJS::ExpressionNode::):
2120 (KJS::RegExpNode::):
2121 (KJS::RegExpNode::precedence):
2122 (KJS::TypeOfResolveNode::):
2123 (KJS::LocalVarTypeOfNode::):
2124 (KJS::UnaryPlusNode::):
2125 (KJS::UnaryPlusNode::precedence):
2127 (KJS::AddNode::precedence):
2128 (KJS::AddNumbersNode::):
2129 (KJS::AddStringLeftNode::):
2130 (KJS::AddStringRightNode::):
2131 (KJS::AddStringsNode::):
2133 (KJS::LessNode::precedence):
2134 (KJS::LessNumbersNode::):
2135 (KJS::LessStringsNode::):
2136 * kjs/nodes2string.cpp:
2137 (KJS::StringNode::streamTo):
2141 (KJS::JSValue::getPrimitiveNumber):
2143 2007-11-11 Darin Adler <darin@apple.com>
2145 - try another way of fixing dftables builds -- refactor pcre_internal.h a bit
2147 * pcre/pcre_internal.h: Make most of this header do nothing when DFTABLES is set.
2148 Later we can break it into two files.
2150 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Take out now-unneeded include paths.
2151 * pcre/dftables.cpp: Set DFTABLES. Use delete instead of free.
2152 * pcre/dftables.pro: Take out now-unneeded include paths.
2153 * pcre/pcre_maketables.cpp: Use new instead of malloc.
2155 2007-11-11 Darin Adler <darin@apple.com>
2157 * pcre/dftables.pro: Try fixing Qt builds (I looked at qt-win) by adding
2158 another include path.
2160 2007-11-11 Darin Adler <darin@apple.com>
2162 * JavaScriptCore.xcodeproj/project.pbxproj: Try fixing Mac Tiger builds
2163 by adding another include path.
2165 2007-11-11 Darin Adler <darin@apple.com>
2169 - http://bugs.webkit.org/show_bug.cgi?id=15924
2170 next round of changes to JSRegExp (formerly PCRE)
2172 This is a combination of converting to C++, tweaking the API, and adding
2173 some additional optimizations.
2175 Future steps will involve getting rid of the use of UTF-8 completely
2176 (we'll use UTF-16 exclusively instead), eliminating more source files,
2177 and some more speed-ups.
2179 SunSpider says the current round is an 0.9% speed-up overall, and a
2180 5.3% speed-up for regexp.
2182 * JavaScriptCore.exp: Updated for new entry points.
2184 * JavaScriptCore.pri:
2185 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2186 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2187 * JavaScriptCore.xcodeproj/project.pbxproj:
2188 * JavaScriptCoreSources.bkl:
2190 Updated for new source file names and ForwardingHeaders.
2193 (KJS::RegExp::RegExp): Changed to use the error message without calling
2194 strdup on it and to pass the new types and options.
2195 (KJS::RegExp::~RegExp): Removed the now-unneeded free of the error message.
2196 (KJS::RegExp::match): Pass the new types and options.
2197 * kjs/regexp.h: Update type of m_constructionError.
2199 * pcre/AUTHORS: Update to reflect the status of the project -- we don't include
2200 the Google parts, and this isn't the PCRE library, per se.
2201 * pcre/COPYING: Ditto.
2203 * pcre/dftables.cpp: Copied from JavaScriptCore/pcre/dftables.c.
2204 (main): Removed unneeded ctype_digit.
2206 * pcre/pcre.h: Convert to C++, tweak API a bit. Use UChar instead of JSRegExpChar.
2208 * pcre/pcre_compile.cpp: Copied from JavaScriptCore/pcre/pcre_compile.c.
2209 Moved a lot of private stuff used only within this file here from pcre_internal.h.
2210 Renumbered the error codes.
2211 (error_text): Use a single string with embedded nulls for the error text (I got
2212 this idea from newer versions of PCRE).
2213 (check_escape): Changed return type to be enum instead of int. Replaced ctype_digit
2214 uses with isASCIIDigit.
2215 (is_counted_repeat): Ditto.
2216 (read_repeat_counts): Ditto.
2217 (first_significant_code): Ditto.
2218 (find_fixedlength): Ditto.
2219 (could_be_empty_branch): Ditto.
2220 (compile_branch): Ditto. Also removed some code that handles changing options.
2221 JavaScript doesn't have any of the features that allow options to change.
2222 (compile_regex): Updated for change to options parameter.
2223 (is_anchored): Ditto.
2224 (find_firstassertedchar): Ditto.
2225 (jsRegExpCompile): Changed to take separate flags instead of an options int.
2226 Also changed to call new/delete instead of pcre_malloc/free.
2227 (jsRegExpFree): Ditto.
2229 * pcre/pcre_exec.cpp: Copied from JavaScriptCore/pcre/pcre_exec.c.
2230 Added a case that uses computed goto for the opcode loop, but did not turn it on.
2231 Changed the RMATCH macro to handle returns more efficiently by putting the where
2232 pointer in the new frame instead of the old one, allowing us to branch to the
2233 return with a single statement. Switched to new/delete from pcre_malloc/free.
2234 Changed many RRETURN callers to not set the return value since it's already
2235 set correctly. Replaced the rrc variable with an is_match variable. Values other
2236 than "match" and "no match" are now handled differently. This allows us to remove
2237 the code to check for those cases in various rules.
2238 (match): All the case statements use a macro BEGIN_OPCODE instead. And all the
2239 continue statements, or break statements that break out of the outer case use
2240 a macro NEXT_OPCODE instead. Replaced a few if statements with assertions.
2241 (jsRegExpExecute): Use new/delete instead of pcre_malloc/free. Removed unused
2242 start_match field from the match block.
2244 * pcre/pcre_internal.h: Moved the last few configuration macros from pcre-config.h
2245 in here. Removed various unused types. Converted from JSRegExpChar to UChar.
2246 Eliminated pcre_malloc/free. Replaced the opcode enum with a macro that can be
2247 used in multiple places. Unfortunately we lose the comments for each opcode; we
2248 should find a place to put those back. Removed ctype_digit.
2250 * pcre/pcre_maketables.cpp: Copied from JavaScriptCore/pcre/pcre_maketables.c.
2251 (pcre_maketables): Got rid of the conditional code that allows this to be compiled
2252 in -- it's only used for dftables now (and soon may be obsolete entirely).
2253 Changed code for cbit_digit to not use isdigit, and took the "_" case out of the
2254 loop. Removed ctype_digit.
2256 * pcre/pcre_ord2utf8.cpp: Copied from JavaScriptCore/pcre/pcre_ord2utf8.c.
2258 * pcre/pcre_tables.cpp: Copied from JavaScriptCore/pcre/pcre_tables.c.
2259 Moved _pcre_OP_lengths out of here into pcre_exec.cpp.
2261 * pcre/pcre_ucp_searchfuncs.cpp: Copied from JavaScriptCore/pcre/pcre_ucp_searchfuncs.c.
2262 Updated for other file name changes.
2264 * pcre/pcre_xclass.cpp: Copied from JavaScriptCore/pcre/pcre_xclass.c.
2266 * pcre/ucpinternal.h: Updated header.
2268 * pcre/ucptable.cpp: Copied from JavaScriptCore/pcre/ucptable.c.
2270 * wtf/ASCIICType.h: (WTF::isASCIIDigit): Removed a branch by changing from && to
2271 & for this operation. Also added an overload that takes an int because that's
2272 useful for PCRE. Later we could optimize for int and overload other functions in
2273 this file; stuck to this simple one for now.
2275 * wtf/unicode/icu/UnicodeIcu.h: Removed unused isUpper.
2276 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
2278 * pcre/LICENCE: Removed.
2279 * pcre/pcre-config.h: Removed.
2280 * wtf/FastMallocPCRE.cpp: Removed.
2282 * pcre/dftables.c: Renamed to cpp.
2283 * pcre/pcre_compile.c: Ditto.
2284 * pcre/pcre_exec.c: Ditto.
2285 * pcre/pcre_maketables.c: Ditto.
2286 * pcre/pcre_ord2utf8.c: Ditto.
2287 * pcre/pcre_tables.c: Ditto.
2288 * pcre/pcre_ucp_searchfuncs.c: Ditto.
2289 * pcre/pcre_xclass.c: Ditto.
2290 * pcre/ucptable.c: Ditto.
2292 2007-11-11 Eric Seidel <eric@webkit.org>
2296 Add KJS_CHECKEXCEPTIONBOOLEAN to match rest of nodes.cpp
2299 (KJS::ExpressionNode::evaluateToBoolean):
2300 (KJS::LessNode::evaluateToBoolean):
2301 (KJS::GreaterNode::evaluateToBoolean):
2302 (KJS::LessEqNode::evaluateToBoolean):
2303 (KJS::GreaterEqNode::evaluateToBoolean):
2304 (KJS::InstanceOfNode::evaluateToBoolean):
2305 (KJS::InNode::evaluateToBoolean):
2306 (KJS::EqualNode::evaluateToBoolean):
2307 (KJS::NotEqualNode::evaluateToBoolean):
2308 (KJS::StrictEqualNode::evaluateToBoolean):
2309 (KJS::NotStrictEqualNode::evaluateToBoolean):
2310 (KJS::LogicalAndNode::evaluateToBoolean):
2311 (KJS::LogicalOrNode::evaluateToBoolean):
2312 (KJS::ConditionalNode::evaluateToBoolean):
2314 2007-11-10 Darin Adler <darin@apple.com>
2318 - fix http://bugs.webkit.org/show_bug.cgi?id=15927
2319 REGRESSION(r27487): delete a.c followed by __defineGetter__("c", ...) incorrectly deletes another property
2320 and <rdar://problem/5586384> REGRESSION (r27487): Can't switch out of Edit HTML Source mode on Leopard Wiki
2322 Test: fast/js/delete-then-put.html
2324 * kjs/property_map.cpp:
2325 (KJS::PropertyMap::put): Added a missing "- 1"; code to find an empty slot was not working.
2326 (KJS::PropertyMap::checkConsistency): Added a missing range check that would have caught this
2329 - roll out a last-minute change to my evaluateToBoolean patch that was incorrect.
2331 * kjs/nodes.h: (KJS::ExprStatementNode::ExprStatementNode): Take out call to
2332 optimizeForUnnecessaryResult, since the result is used in some cases.
2334 2007-11-10 Adam Roben <aroben@apple.com>
2338 Roll out some changes that were (seemingly accidentally) checked in
2341 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2343 2007-11-10 Darin Adler <darin@apple.com>
2347 - http://bugs.webkit.org/show_bug.cgi?id=15915
2348 add an evaluation path for booleans like the one we have for numbers
2350 Gives 1.1% on SunSpider.
2352 * kjs/grammar.y: Create TrueNode and FalseNode instead of BooleanNode.
2354 * kjs/nodes.h: Changed to use Noncopyable. Moved optimizeForUnnecessaryResult
2355 down from Node to ExpressionNode. Changed some classes to not inherit from
2356 ExpressionNode where not necessary, and removed unnneeded evaluate functions
2357 as well as evaluate functions that need not be virtual. Call the
2358 optimizeForUnnecessaryResult function on the start of a for loop too.
2360 (KJS::ExpressionNode::evaluateToBoolean): Added.
2361 (KJS::FalseNode::evaluate): Added.
2362 (KJS::TrueNode::evaluate): Added.
2363 (KJS::NumberNode::evaluateToBoolean): Added.
2364 (KJS::StringNode::evaluateToBoolean): Added.
2365 (KJS::LocalVarAccessNode::evaluateToBoolean): Added.
2366 (KJS::BracketAccessorNode::evaluateToBoolean): Added.
2367 (KJS::LogicalNotNode::evaluate): Changed to call evaluateToBoolean.
2368 (KJS::LogicalNotNode::evaluateToBoolean): Added.
2369 (KJS::lessThan): Changed to return bool.
2370 (KJS::lessThanEq): Ditto.
2371 (KJS::LessNode::evaluate): Changed since lessThan returns bool.
2372 (KJS::LessNode::evaluateToBoolean): Added.
2373 (KJS::GreaterNode::evaluate): Changed since lessThanEq returns bool.
2374 (KJS::GreaterNode::evaluateToBoolean): Added.
2375 (KJS::LessEqNode::evaluate): Changed since lessThanEq returns bool.
2376 (KJS::LessEqNode::evaluateToBoolean): Added.
2377 (KJS::GreaterEqNode::evaluate): Changed since lessThan returns bool.
2378 (KJS::GreaterEqNode::evaluateToBoolean): Added.
2379 (KJS::InstanceOfNode::evaluateToBoolean): Added.
2380 (KJS::InNode::evaluateToBoolean): Added.
2381 (KJS::EqualNode::evaluateToBoolean): Added.
2382 (KJS::NotEqualNode::evaluateToBoolean): Added.
2383 (KJS::StrictEqualNode::evaluateToBoolean): Added.
2384 (KJS::NotStrictEqualNode::evaluateToBoolean): Added.
2385 (KJS::ConditionalNode::evaluate): Changed to call evaluateToBoolean.
2386 (KJS::IfNode::execute): Ditto.
2387 (KJS::DoWhileNode::execute): Ditto.
2388 (KJS::WhileNode::execute): Ditto.
2389 (KJS::ForNode::execute): Ditto.
2391 * kjs/nodes2string.cpp:
2392 (KJS::FalseNode::streamTo): Added.
2393 (KJS::TrueNode::streamTo): Added.
2395 2007-11-09 Adam Roben <aroben@apple.com>
2402 (KJS::jsNumber): Add some explicit casts.
2404 2007-11-08 Darin Adler <darin@apple.com>
2410 * kjs/property_map.cpp:
2412 2007-11-08 Darin Adler <darin@apple.com>
2414 - roll out accidentally-checked in changes
2416 * kjs/nodes.cpp: Back to previous version.
2417 * kjs/nodes.h: Ditto.
2418 * kjs/grammar.y: Ditto.
2420 2007-11-08 Darin Adler <darin@apple.com>
2424 - http://bugs.webkit.org/show_bug.cgi?id=15912
2425 fasta spends a lot of time in qsort
2427 * kjs/property_map.cpp:
2428 (KJS::PropertyMap::getEnumerablePropertyNames):
2429 Use insertion sort instead of qsort for small sets of property names.
2430 We can probably do some even-better speedups of for/in, but this nets
2431 0.6% overall and 6.7% on fasta.
2433 2007-11-08 Darin Adler <darin@apple.com>
2437 - http://bugs.webkit.org/show_bug.cgi?id=15906
2438 getting characters by indexing into a string is very slow
2440 This fixes one source of the slowness -- the conversion to an unused
2441 Identifier as we call the get function from the slot -- but doesn't
2442 fix others, such as the fact that we have to allocate a new UString::Rep
2443 for every single character.
2445 Speeds up string-base64 30%, and at least 0.5% overall.
2446 But does slow down access-fannkuch quite a bit. Might be worth
2447 revisiting in the future to see what we can do about that (although
2448 I did look at a profile for a while).
2450 * kjs/property_slot.h: Add a new marker for "numeric" property slots;
2451 slots where we don't need to pass the identifier to the get function.
2452 (KJS::PropertySlot::getValue): Added code to call the numeric get function.
2453 (KJS::PropertySlot::setCustomNumeric): Added.
2454 * kjs/string_object.cpp:
2455 (KJS::StringInstance::indexGetter): Changed to use substr() instead
2456 of constructing a wholly new UString each time.
2457 (KJS::stringInstanceNumericPropertyGetter): Added. Like indexGetter, but
2458 takes advantage of setCustomNumeric to avoid creating an Identifier.
2459 (KJS::StringInstance::getOwnPropertySlot): Changed to use setCustomNumeric.
2461 2007-11-08 Darin Adler <darin@apple.com>
2465 - http://bugs.webkit.org/show_bug.cgi?id=15904
2466 more speed-ups possible by tightening up int version of JSImmediate
2468 1% improvement of SunSpider
2470 * kjs/JSImmediate.h: Eliminate the now-unneeded FPBitValues struct template.
2471 (KJS::JSImmediate::from): Overload for most numeric types; many types can
2472 do fewer branches and checks.
2473 (KJS::JSImmediate::getUInt32): Removed unneeded check for undefined.
2474 (KJS::JSImmediate::getTruncatedInt32): Ditto.
2475 (KJS::JSImmediate::getTruncatedUInt32): Ditto. There's no difference any more
2476 between getUInt32 and getTruncatedUInt32, so that's worth a rename and merge later.
2478 * kjs/grammar.y: Update since fromDouble is now just from.
2479 * kjs/nodes.h: Ditto.
2481 * kjs/value.h: (KJS::jsNumber): Overload for most numeric types.
2483 2007-11-08 Kevin Ollivier <kevino@theolliviers.com>
2485 Bakefiles for building JavaScriptCore, needed by wx port.
2487 Reviewed by Mark Rowe.
2489 * JavaScriptCoreSources.bkl: Added.
2490 * jscore.bkl: Added.
2492 2007-11-08 Oliver Hunt <oliver@apple.com>
2496 Fix regression caused by earlier bitwise and optimisation. 1 & undefined != 1.
2498 The implementation of JSImmediate::areBothImmediateNumbers relies on
2499 (JSImmediate::getTag(immediate1) & JSImmediate::getTag(immediate2)) having
2500 a unique result when both immediate values are numbers.
2502 The regression was due to UndefinedType & NumberType returning NumberType (3 & 1).
2503 By swapping the value of NumberType and UndefinedType this ceases to be a problem.
2508 2007-11-08 Darin Adler <darin@apple.com>
2512 * kjs/nodes.h: Add missing parameter name.
2514 2007-11-08 Eric Seidel <eric@webkit.org>
2518 Add ExpressionNode subclass of Node, use it.
2522 (KJS::ForInNode::ForInNode):
2524 (KJS::ExpressionNode::):
2526 (KJS::NullNode::precedence):
2527 (KJS::BooleanNode::):
2528 (KJS::BooleanNode::precedence):
2529 (KJS::RegExpNode::):
2530 (KJS::RegExpNode::precedence):
2532 (KJS::ThisNode::precedence):
2533 (KJS::ResolveNode::):
2534 (KJS::ElementNode::):
2536 (KJS::PropertyNode::):
2537 (KJS::PropertyNode::precedence):
2538 (KJS::PropertyNode::name):
2539 (KJS::PropertyListNode::):
2540 (KJS::ObjectLiteralNode::):
2541 (KJS::ObjectLiteralNode::precedence):
2542 (KJS::BracketAccessorNode::):
2543 (KJS::DotAccessorNode::):
2544 (KJS::DotAccessorNode::precedence):
2545 (KJS::ArgumentListNode::):
2546 (KJS::ArgumentsNode::):
2547 (KJS::NewExprNode::):
2548 (KJS::NewExprNode::precedence):
2549 (KJS::FunctionCallValueNode::):
2550 (KJS::FunctionCallValueNode::precedence):
2551 (KJS::FunctionCallResolveNode::):
2552 (KJS::FunctionCallBracketNode::):
2553 (KJS::FunctionCallBracketNode::precedence):
2554 (KJS::FunctionCallDotNode::):
2555 (KJS::FunctionCallDotNode::precedence):
2556 (KJS::PrePostResolveNode::):
2557 (KJS::PostfixBracketNode::):
2558 (KJS::PostfixBracketNode::precedence):
2559 (KJS::PostIncBracketNode::):
2560 (KJS::PostIncBracketNode::isIncrement):
2561 (KJS::PostDecBracketNode::):
2562 (KJS::PostDecBracketNode::isIncrement):
2563 (KJS::PostfixDotNode::):
2564 (KJS::PostfixDotNode::precedence):
2565 (KJS::PostIncDotNode::):
2566 (KJS::PostIncDotNode::isIncrement):
2567 (KJS::PostDecDotNode::):
2568 (KJS::PostDecDotNode::isIncrement):
2569 (KJS::PostfixErrorNode::):
2570 (KJS::PostfixErrorNode::precedence):
2571 (KJS::DeleteResolveNode::):
2572 (KJS::DeleteBracketNode::):
2573 (KJS::DeleteBracketNode::precedence):
2574 (KJS::DeleteDotNode::):
2575 (KJS::DeleteDotNode::precedence):
2576 (KJS::DeleteValueNode::):
2577 (KJS::DeleteValueNode::precedence):
2579 (KJS::VoidNode::precedence):
2580 (KJS::TypeOfResolveNode::):
2581 (KJS::TypeOfValueNode::):
2582 (KJS::PrefixBracketNode::):
2583 (KJS::PrefixBracketNode::precedence):
2584 (KJS::PreIncBracketNode::):
2585 (KJS::PreIncBracketNode::isIncrement):
2586 (KJS::PreDecBracketNode::):
2587 (KJS::PreDecBracketNode::isIncrement):
2588 (KJS::PrefixDotNode::):
2589 (KJS::PrefixDotNode::precedence):
2590 (KJS::PreIncDotNode::):
2591 (KJS::PreIncDotNode::isIncrement):
2592 (KJS::PreDecDotNode::):
2593 (KJS::PreDecDotNode::isIncrement):
2594 (KJS::PrefixErrorNode::):
2595 (KJS::PrefixErrorNode::precedence):
2596 (KJS::UnaryPlusNode::):
2597 (KJS::UnaryPlusNode::precedence):
2598 (KJS::NegateNode::):
2599 (KJS::NegateNode::precedence):
2600 (KJS::BitwiseNotNode::):
2601 (KJS::BitwiseNotNode::precedence):
2602 (KJS::LogicalNotNode::):
2603 (KJS::LogicalNotNode::precedence):
2605 (KJS::AddNode::precedence):
2606 (KJS::LeftShiftNode::):
2607 (KJS::LeftShiftNode::precedence):
2608 (KJS::RightShiftNode::):
2609 (KJS::RightShiftNode::precedence):
2610 (KJS::UnsignedRightShiftNode::):
2611 (KJS::UnsignedRightShiftNode::precedence):
2613 (KJS::LessNode::precedence):
2614 (KJS::GreaterNode::):
2615 (KJS::GreaterNode::precedence):
2616 (KJS::LessEqNode::):
2617 (KJS::LessEqNode::precedence):
2618 (KJS::GreaterEqNode::):
2619 (KJS::GreaterEqNode::precedence):
2620 (KJS::InstanceOfNode::):
2621 (KJS::InstanceOfNode::precedence):
2623 (KJS::InNode::precedence):
2625 (KJS::EqualNode::precedence):
2626 (KJS::NotEqualNode::):
2627 (KJS::NotEqualNode::precedence):
2628 (KJS::StrictEqualNode::):
2629 (KJS::StrictEqualNode::precedence):
2630 (KJS::NotStrictEqualNode::):
2631 (KJS::NotStrictEqualNode::precedence):
2632 (KJS::BitAndNode::):
2633 (KJS::BitAndNode::precedence):
2635 (KJS::BitOrNode::precedence):
2636 (KJS::BitXOrNode::):
2637 (KJS::BitXOrNode::precedence):
2638 (KJS::LogicalAndNode::):
2639 (KJS::LogicalAndNode::precedence):
2640 (KJS::LogicalOrNode::):
2641 (KJS::LogicalOrNode::precedence):
2642 (KJS::ConditionalNode::):
2643 (KJS::ConditionalNode::precedence):
2644 (KJS::ReadModifyResolveNode::):
2645 (KJS::ReadModifyResolveNode::precedence):
2646 (KJS::AssignResolveNode::):
2647 (KJS::AssignResolveNode::precedence):
2648 (KJS::ReadModifyBracketNode::):
2649 (KJS::ReadModifyBracketNode::precedence):
2650 (KJS::AssignBracketNode::):
2651 (KJS::AssignBracketNode::precedence):
2652 (KJS::AssignDotNode::):
2653 (KJS::AssignDotNode::precedence):
2654 (KJS::ReadModifyDotNode::):
2655 (KJS::ReadModifyDotNode::precedence):
2656 (KJS::AssignErrorNode::):
2657 (KJS::AssignErrorNode::precedence):
2659 (KJS::CommaNode::precedence):
2660 (KJS::AssignExprNode::):
2661 (KJS::AssignExprNode::precedence):
2662 (KJS::ExprStatementNode::):
2664 (KJS::DoWhileNode::):
2666 (KJS::ReturnNode::):
2669 (KJS::ParameterNode::):
2670 (KJS::CaseClauseNode::):
2671 (KJS::CaseClauseNode::precedence):
2672 (KJS::ClauseListNode::):
2673 (KJS::SwitchNode::):
2675 2007-11-08 Oliver Hunt <oliver@apple.com>
2679 Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).
2681 This only improves bitwise-and performance, as the additional logic required
2682 for similar code paths on or, xor, and shifting requires additional operations
2683 and branches that negate (and in certain cases, regress) any advantage we might
2686 This improves performance on all bitop tests, the cryptography tests, as well as
2687 the string-base64 and string-unpack-code tests. No significant degradation on
2690 * kjs/JSImmediate.h:
2691 (KJS::JSImmediate::areBothImmediateNumbers):
2692 (KJS::JSImmediate::andImmediateNumbers):
2694 (KJS::BitAndNode::evaluate):
2696 (KJS::jsNumberFromAnd):
2698 2007-11-08 Adam Roben <aroben@apple.com>
2700 Stop using KJS inside of MathExtras.h
2704 * wtf/MathExtras.h: Removed an unused header, and a now-unused
2705 forward-declaration.
2706 (wtf_atan2): Use std::numeric_limits intead of KJS.
2708 2007-11-08 Sam Weinig <sam@webkit.org>
2712 * kjs/date_object.cpp:
2713 (KJS::DateProtoFuncToLocaleString::callAsFunction): Fix unused arg warning.
2714 (KJS::DateProtoFuncToLocaleDateString::callAsFunction): ditto
2715 (KJS::DateProtoFuncToLocaleTimeString::callAsFunction): ditto
2717 2007-11-08 Mark Rowe <mrowe@apple.com>
2721 * kjs/lookup.h: Add missing include.
2723 2007-11-08 Sam Weinig <sam@webkit.org>
2727 Convert JavaScript internal function objects to use one class per
2728 function. This avoids a switch statement inside what used to be
2729 the shared function classes and will allow Shark to better analyze
2732 To make this switch, the value property of the HashEntry was changed
2733 to a union of an intptr_t (which is used to continue handle valueGetters)
2734 and function pointer which points to a static constructor for the
2735 individual new function objects.
2737 SunSpider claims this is a 1.0% speedup.
2739 * kjs/array_object.cpp:
2740 (KJS::ArrayPrototype::getOwnPropertySlot):
2742 (KJS::ArrayProtoFuncToString::callAsFunction):
2743 (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
2744 (KJS::ArrayProtoFuncJoin::callAsFunction):
2745 (KJS::ArrayProtoFuncConcat::callAsFunction):
2746 (KJS::ArrayProtoFuncPop::callAsFunction):
2747 (KJS::ArrayProtoFuncPush::callAsFunction):
2748 (KJS::ArrayProtoFuncReverse::callAsFunction):
2749 (KJS::ArrayProtoFuncShift::callAsFunction):
2750 (KJS::ArrayProtoFuncSlice::callAsFunction):
2751 (KJS::ArrayProtoFuncSort::callAsFunction):
2752 (KJS::ArrayProtoFuncSplice::callAsFunction):
2753 (KJS::ArrayProtoFuncUnShift::callAsFunction):
2754 (KJS::ArrayProtoFuncFilter::callAsFunction):
2755 (KJS::ArrayProtoFuncMap::callAsFunction):
2756 (KJS::ArrayProtoFuncEvery::callAsFunction):
2757 (KJS::ArrayProtoFuncForEach::callAsFunction):
2758 (KJS::ArrayProtoFuncSome::callAsFunction):
2759 (KJS::ArrayProtoFuncIndexOf::callAsFunction):
2760 (KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
2761 * kjs/array_object.h:
2762 (KJS::ArrayPrototype::classInfo):
2763 * kjs/create_hash_table:
2764 * kjs/date_object.cpp:
2765 (KJS::DatePrototype::getOwnPropertySlot):
2766 (KJS::DateProtoFuncToString::callAsFunction):
2767 (KJS::DateProtoFuncToUTCString::callAsFunction):
2768 (KJS::DateProtoFuncToDateString::callAsFunction):
2769 (KJS::DateProtoFuncToTimeString::callAsFunction):
2770 (KJS::DateProtoFuncToLocaleString::callAsFunction):
2771 (KJS::DateProtoFuncToLocaleDateString::callAsFunction):
2772 (KJS::DateProtoFuncToLocaleTimeString::callAsFunction):
2773 (KJS::DateProtoFuncValueOf::callAsFunction):
2774 (KJS::DateProtoFuncGetTime::callAsFunction):
2775 (KJS::DateProtoFuncGetFullYear::callAsFunction):
2776 (KJS::DateProtoFuncGetUTCFullYear::callAsFunction):
2777 (KJS::DateProtoFuncToGMTString::callAsFunction):
2778 (KJS::DateProtoFuncGetMonth::callAsFunction):
2779 (KJS::DateProtoFuncGetUTCMonth::callAsFunction):
2780 (KJS::DateProtoFuncGetDate::callAsFunction):
2781 (KJS::DateProtoFuncGetUTCDate::callAsFunction):
2782 (KJS::DateProtoFuncGetDay::callAsFunction):
2783 (KJS::DateProtoFuncGetUTCDay::callAsFunction):
2784 (KJS::DateProtoFuncGetHours::callAsFunction):
2785 (KJS::DateProtoFuncGetUTCHours::callAsFunction):
2786 (KJS::DateProtoFuncGetMinutes::callAsFunction):
2787 (KJS::DateProtoFuncGetUTCMinutes::callAsFunction):
2788 (KJS::DateProtoFuncGetSeconds::callAsFunction):
2789 (KJS::DateProtoFuncGetUTCSeconds::callAsFunction):
2790 (KJS::DateProtoFuncGetMilliSeconds::callAsFunction):
2791 (KJS::DateProtoFuncGetUTCMilliseconds::callAsFunction):
2792 (KJS::DateProtoFuncGetTimezoneOffset::callAsFunction):
2793 (KJS::DateProtoFuncSetTime::callAsFunction):
2794 (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
2795 (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
2796 (KJS::DateProtoFuncSetSeconds::callAsFunction):
2797 (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
2798 (KJS::DateProtoFuncSetMinutes::callAsFunction):
2799 (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
2800 (KJS::DateProtoFuncSetHours::callAsFunction):
2801 (KJS::DateProtoFuncSetUTCHours::callAsFunction):
2802 (KJS::DateProtoFuncSetDate::callAsFunction):
2803 (KJS::DateProtoFuncSetUTCDate::callAsFunction):
2804 (KJS::DateProtoFuncSetMonth::callAsFunction):
2805 (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
2806 (KJS::DateProtoFuncSetFullYear::callAsFunction):
2807 (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
2808 (KJS::DateProtoFuncSetYear::callAsFunction):
2809 (KJS::DateProtoFuncGetYear::callAsFunction):
2810 * kjs/date_object.h:
2812 (KJS::Lookup::find):
2815 (KJS::staticFunctionGetter):
2816 (KJS::staticValueGetter):
2817 (KJS::getStaticPropertySlot):
2818 (KJS::getStaticFunctionSlot):
2820 * kjs/math_object.cpp:
2821 (KJS::MathObjectImp::getOwnPropertySlot):
2822 (KJS::MathProtoFuncAbs::callAsFunction):
2823 (KJS::MathProtoFuncACos::callAsFunction):
2824 (KJS::MathProtoFuncASin::callAsFunction):
2825 (KJS::MathProtoFuncATan::callAsFunction):
2826 (KJS::MathProtoFuncATan2::callAsFunction):
2827 (KJS::MathProtoFuncCeil::callAsFunction):
2828 (KJS::MathProtoFuncCos::callAsFunction):
2829 (KJS::MathProtoFuncExp::callAsFunction):
2830 (KJS::MathProtoFuncFloor::callAsFunction):
2831 (KJS::MathProtoFuncLog::callAsFunction):
2832 (KJS::MathProtoFuncMax::callAsFunction):
2833 (KJS::MathProtoFuncMin::callAsFunction):
2834 (KJS::MathProtoFuncPow::callAsFunction):
2835 (KJS::MathProtoFuncRandom::callAsFunction):
2836 (KJS::MathProtoFuncRound::callAsFunction):
2837 (KJS::MathProtoFuncSin::callAsFunction):
2838 (KJS::MathProtoFuncSqrt::callAsFunction):
2839 (KJS::MathProtoFuncTan::callAsFunction):
2840 * kjs/math_object.h:
2841 (KJS::MathObjectImp::classInfo):
2842 (KJS::MathObjectImp::):
2843 * kjs/string_object.cpp:
2844 (KJS::StringPrototype::getOwnPropertySlot):
2845 (KJS::StringProtoFuncToString::callAsFunction):
2846 (KJS::StringProtoFuncValueOf::callAsFunction):
2847 (KJS::StringProtoFuncCharAt::callAsFunction):
2848 (KJS::StringProtoFuncCharCodeAt::callAsFunction):
2849 (KJS::StringProtoFuncConcat::callAsFunction):
2850 (KJS::StringProtoFuncIndexOf::callAsFunction):
2851 (KJS::StringProtoFuncLastIndexOf::callAsFunction):
2852 (KJS::StringProtoFuncMatch::callAsFunction):
2853 (KJS::StringProtoFuncSearch::callAsFunction):
2854 (KJS::StringProtoFuncReplace::callAsFunction):
2855 (KJS::StringProtoFuncSlice::callAsFunction):
2856 (KJS::StringProtoFuncSplit::callAsFunction):
2857 (KJS::StringProtoFuncSubstr::callAsFunction):
2858 (KJS::StringProtoFuncSubstring::callAsFunction):
2859 (KJS::StringProtoFuncToLowerCase::callAsFunction):
2860 (KJS::StringProtoFuncToUpperCase::callAsFunction):
2861 (KJS::StringProtoFuncToLocaleLowerCase::callAsFunction):
2862 (KJS::StringProtoFuncToLocaleUpperCase::callAsFunction):
2863 (KJS::StringProtoFuncLocaleCompare::callAsFunction):
2864 (KJS::StringProtoFuncBig::callAsFunction):
2865 (KJS::StringProtoFuncSmall::callAsFunction):
2866 (KJS::StringProtoFuncBlink::callAsFunction):
2867 (KJS::StringProtoFuncBold::callAsFunction):
2868 (KJS::StringProtoFuncFixed::callAsFunction):
2869 (KJS::StringProtoFuncItalics::callAsFunction):
2870 (KJS::StringProtoFuncStrike::callAsFunction):
2871 (KJS::StringProtoFuncSub::callAsFunction):
2872 (KJS::StringProtoFuncSup::callAsFunction):
2873 (KJS::StringProtoFuncFontcolor::callAsFunction):
2874 (KJS::StringProtoFuncFontsize::callAsFunction):
2875 (KJS::StringProtoFuncAnchor::callAsFunction):
2876 (KJS::StringProtoFuncLink::callAsFunction):
2877 * kjs/string_object.h:
2879 2007-11-08 Adam Roben <aroben@apple.com>
2883 Reviewed by Sam and Ada.
2885 * wtf/MathExtras.h: Get rid of a circular #include dependency to fix
2888 2007-11-08 Adam Roben <aroben@apple.com>
2890 Fix a precedence warning on Windows
2892 * kjs/JSImmediate.h:
2893 (KJS::JSImmediate::toBoolean):
2895 2007-11-08 Mark Rowe <mrowe@apple.com>
2897 Build fix for JavaScriptGlue.
2899 * wtf/MathExtras.h: Include stdlib.h for srand and RAND_MAX.
2901 2007-11-08 Darin Adler <darin@apple.com>
2905 * kjs/JSImmediate.h: Include MathExtras.h rather than math.h since this file uses "signbit".
2907 2007-11-08 Oliver Hunt <oliver@apple.com>
2911 Replace the use of floats for immediate values with the use of integers for a 4.5% improvement in SunSpider.
2913 Unfortunately this change results in NaN, +Inf, -Inf, and -0 being heap allocated now, but
2914 we should now have faster array access, faster immediate to double conversion, and the
2915 potential to further improve bitwise operators in future.
2917 This also removes the need for unions to avoid strict aliasing problems when extracting
2918 a value from immediates.
2920 * kjs/JSImmediate.h:
2922 (KJS::JSImmediate::trueImmediate):
2923 (KJS::JSImmediate::falseImmediate):
2924 (KJS::JSImmediate::undefinedImmediate):
2925 (KJS::JSImmediate::nullImmediate):
2926 (KJS::JSImmediate::toBoolean):
2930 2007-11-07 Eric Seidel <eric@webkit.org>
2932 Reviewed by Darin and Oliver.
2934 Add evaluateToNumber parallel evaluation tree to speed up number operations.
2935 Make ImmediateNumberNode a subclass of NumberNode.
2936 Share evaluate logic between evaluate and evaluateToNumber using inline functions
2937 There is still a lot of improvement to be made here.
2939 SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
2940 Given the huge win that this prepares us for with simple type inferencing I see the small
2941 regression in base64 being worth the substantial overall improvement.
2945 (KJS::Node::evaluateToNumber):
2946 (KJS::NumberNode::evaluate):
2947 (KJS::NumberNode::evaluateToNumber):
2948 (KJS::StringNode::evaluateToNumber):
2949 (KJS::LocalVarAccessNode::inlineEvaluate):
2950 (KJS::LocalVarAccessNode::evaluate):
2951 (KJS::LocalVarAccessNode::evaluateToNumber):
2952 (KJS::BracketAccessorNode::inlineEvaluate):
2953 (KJS::BracketAccessorNode::evaluate):
2954 (KJS::BracketAccessorNode::evaluateToNumber):
2955 (KJS::NegateNode::evaluate):
2956 (KJS::NegateNode::evaluateToNumber):
2957 (KJS::MultNode::inlineEvaluateToNumber):
2958 (KJS::MultNode::evaluate):
2959 (KJS::MultNode::evaluateToNumber):
2960 (KJS::DivNode::inlineEvaluateToNumber):
2961 (KJS::DivNode::evaluate):
2962 (KJS::DivNode::evaluateToNumber):
2963 (KJS::ModNode::inlineEvaluateToNumber):
2964 (KJS::ModNode::evaluate):
2965 (KJS::ModNode::evaluateToNumber):
2966 (KJS::throwOutOfMemoryErrorToNumber):
2967 (KJS::addSlowCaseToNumber):
2970 (KJS::AddNode::evaluateToNumber):
2971 (KJS::SubNode::inlineEvaluateToNumber):
2972 (KJS::SubNode::evaluate):
2973 (KJS::SubNode::evaluateToNumber):
2974 (KJS::valueForReadModifyAssignment):
2975 (KJS::ReadModifyLocalVarNode::evaluate):
2976 (KJS::ReadModifyResolveNode::evaluate):
2977 (KJS::ReadModifyDotNode::evaluate):
2978 (KJS::ReadModifyBracketNode::evaluate):
2981 (KJS::NumberNode::):
2982 (KJS::ImmediateNumberNode::):
2983 (KJS::AddNode::precedence):
2984 * kjs/nodes2string.cpp:
2985 (KJS::NumberNode::streamTo):
2987 2007-11-07 Mark Rowe <mrowe@apple.com>
2991 Fix up initialization after being mangled in r27572, and remove the
2992 ternary expression as extraCost will always be zero for the numeric
2995 * kjs/collector.cpp:
2996 (KJS::Collector::heapAllocate):
2998 2007-11-07 Mark Rowe <mrowe@apple.com>
3002 * kjs/regexp_object.cpp:
3004 2007-11-07 Geoffrey Garen <ggaren@apple.com>
3006 Reviewed by Beth Dakin.
3008 Eliminated a bogus (though compiled-out) branch in the collector.
3010 * kjs/collector.cpp:
3011 (KJS::Collector::heapAllocate):
3013 2007-11-06 Geoffrey Garen <ggaren@apple.com>
3015 Reviewed by Darin Adler.
3017 Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861
3018 5.8% of string-validate-input.js is spent creating RegExpImps
3020 Put RegExpImp properties into a static hashtable to avoid a slew of
3021 PropertyMap churn when creating a RegExpImp.
3023 Factored important bits of regular expression implementation out of
3024 RegExpImp (the JS object) and into RegExp (the PCRE wrapper class),
3025 making RegExp a ref-counted class. (This will help later.)
3027 Removed PCRE_POSIX support because I didn't quite know how to test it
3028 and keep it working with these changes.
3030 1.1% SunSpider speedup. 5.8% speedup on string-validate-input.js.
3032 * kjs/regexp.h: A few interface changes:
3033 1. Renamed "subpatterns()" => "numSubpatterns()"
3034 2. Made flag enumeration private and replaced it with public getters for
3036 3. Made RegExp ref-counted so RegExps can be shared by RegExpImps.
3037 4. Made RegExp take a string of flags instead of an int, eliminating
3038 duplicated flag parsing code elsewhere.
3040 * kjs/regexp_object.cpp:
3041 (KJS::RegExpProtoFunc::callAsFunction): For RegExp.compile:
3042 - Fixed a bug where compile(undefined) would throw an exception.
3043 - Removed some now-redundant code.
3044 - Used RegExp sharing to eliminate an allocation and a bunch of
3045 PropertyMap thrash. (Not a big win since compile is a deprecated
3046 function. I mainly did this to test the plubming.)
3048 2007-11-07 Simon Hausmann <hausmann@kde.org>
3050 Reviewed by nobody, Qt/Windows build fix.
3052 JavaScriptCore.pri expects OBJECTS_DIR to be set, so set it in
3053 testkjs.pro, too, where it's included from.
3057 2007-11-07 Simon Hausmann <shausman@trolltech.com>
3061 Fix "nmake clean" for the Qt/Windows build by replacing tmp/ with a variable that ends with the correct type of slash/backslash depending on the choice of compiler/make tool.
3063 * JavaScriptCore.pri:
3066 2007-11-07 Lars Knoll <lars@trolltech.com>
3072 Pretty embarrassing bug. Has the potential to fix quite a few test failures.
3074 * wtf/unicode/qt4/UnicodeQt4.h:
3075 (WTF::Unicode::umemcasecmp):
3077 2007-11-06 Maciej Stachowiak <mjs@apple.com>
3081 - only collect when the heap is full, unless we have lots of extra cost garbage
3083 1.1% SunSpider speedup.
3085 This shouldn't hit memory use much since the extra space in those
3086 blocks hangs around either way.
3088 * kjs/collector.cpp:
3089 (KJS::Collector::heapAllocate):
3090 (KJS::Collector::collect): Fix logic error that reversed the sense of collect's
3093 2007-11-06 Oliver Hunt <oliver@apple.com>
3097 Avoid unnecessarily boxing the result from post inc/decrement for 0.3% gain in sunspider
3099 We now convert the common 'for (...; ...; <var>++) ...' to the semantically identical
3100 'for (...; ...; ++<var>) ...'.
3103 (KJS::PostIncResolveNode::optimizeForUnnecessaryResult):
3104 (KJS::PostIncLocalVarNode::evaluate):
3105 (KJS::PostIncLocalVarNode::optimizeForUnnecessaryResult):
3106 (KJS::PostDecResolveNode::optimizeForUnnecessaryResult):
3107 (KJS::PostDecLocalVarNode::evaluate):
3108 (KJS::PostDecLocalVarNode::optimizeForUnnecessaryResult):
3110 (KJS::PrePostResolveNode::):
3111 (KJS::PostIncResolveNode::):
3112 (KJS::PostIncLocalVarNode::):
3113 (KJS::PostDecResolveNode::):
3114 (KJS::PostDecLocalVarNode::):
3115 (KJS::PreIncResolveNode::):
3116 (KJS::PreDecResolveNode::):
3117 (KJS::ForNode::ForNode):
3119 2007-11-06 Eric Seidel <eric@webkit.org>
3123 This fixes a regressed layout test for string + object
3125 SunSpider claims this was an overall 0.3% speedup, although some individual tests were slower.
3128 (KJS::add): remove erroneous "fast path" for string + *
3130 2007-11-06 Geoffrey Garen <ggaren@apple.com>
3132 Reviewed by Eric Seidel.
3134 Added toJSNumber, a fast path for converting a JSValue to a JS number,
3135 and deployed it in postfix expressions. In the fast case this
3136 eliminates a call to jsNumber.
3138 0.4% speedup on SunSpider.
3142 (KJS::PostIncResolveNode::evaluate):
3143 (KJS::PostIncLocalVarNode::evaluate):
3144 (KJS::PostDecResolveNode::evaluate):
3145 (KJS::PostDecLocalVarNode::evaluate):
3146 (KJS::PostIncBracketNode::evaluate):
3147 (KJS::PostDecBracketNode::evaluate):
3148 (KJS::PostIncDotNode::evaluate):
3149 (KJS::PostDecDotNode::evaluate):
3150 (KJS::UnaryPlusNode::evaluate):
3152 (KJS::JSValue::toJSNumber):
3154 2007-11-06 Darin Adler <darin@apple.com>
3158 - http://bugs.webkit.org/show_bug.cgi?id=15846
3159 REGRESSION (r27387): Memory corruption when running fast/js/kde/delete.html
3161 There was a mistake in the algorithm used to find an empty slot in the property
3162 map entries vector; when we were putting in a new property value and not overwriting
3163 an existing deleted sentinel, we would enlarge the entries vector, but would not
3164 overwrite the stale data that's in the new part. It was easy to pin this down by
3165 turning on property map consistency checks -- I never would have landed with this
3166 bug if I had run the regression tests once with consistency checks on!
3168 * kjs/property_map.cpp: (KJS::PropertyMap::put): Changed logic for the case where
3169 foundDeletedElement is false to always use the item at the end of the entries vector.
3170 Also allowed me to merge with the logic for the "no deleted sentinels at all" case.
3172 2007-11-06 Oliver Hunt <oliver@apple.com>
3176 Fix previous patch to use a 3 bit shift, a 16 bit shift causes a regression in sunspider.
3181 2007-11-06 Oliver Hunt <oliver@apple.com>
3185 Replace boolean comparisons in AddNode with mask
3186 comparisons for a 0.2% improvement in sunspider.
3188 * JavaScriptCore.xcodeproj/project.pbxproj:
3192 2007-11-06 Eric Seidel <eric@webkit.org>
3196 SunSpider claims this is a 1.1% speedup.
3199 (KJS::throwOutOfMemoryError): Added, non inline.
3200 (KJS::addSlowCase): renamed from add(), non inline.
3201 (KJS::add): add fast path for String + String, Number + Number and String + *
3203 2007-11-06 Eric Seidel <eric@webkit.org>
3207 Avoid more UString creation.
3209 SunSpider claims this is a 0.4% speedup.
3211 * kjs/regexp_object.cpp:
3212 (KJS::RegExpObjectImp::construct): use UString::find(UChar)
3214 2007-11-05 Mark Rowe <mrowe@apple.com>
3218 * kjs/array_object.cpp:
3219 (KJS::ArrayProtoFunc::callAsFunction):
3221 2007-11-05 Adam Roben <aroben@apple.com>
3227 2007-11-05 Mark Rowe <mrowe@apple.com>
3229 Build fix. Add missing #include.
3231 * kjs/operations.cpp:
3233 2007-11-05 Eric Seidel <eric@webkit.org>
3237 Remove another call to toString(exec)
3239 SunSpider claims this is a 0.5% speedup.
3241 * kjs/operations.cpp:
3242 (KJS::equal): remove another toString
3244 2007-11-05 Eric Seidel <eric@webkit.org>
3246 * kjs/operations.cpp:
3247 (KJS::equal): correct broken change.
3249 2007-11-05 Eric Seidel <eric@webkit.org>
3253 Remove one more call to toString(exec).
3255 SunSpider claims this is a 0.7% speedup.
3257 * kjs/operations.cpp:
3258 (KJS::equal): remove a call to toString()
3260 2007-11-05 Mark Rowe <mrowe@apple.com>
3266 2007-11-05 Mark Rowe <mrowe@apple.com>
3272 2007-11-05 Geoffrey Garen <ggaren@apple.com>
3274 Touched a file to test my new HTTP access.
3276 * kjs/scope_chain.cpp:
3278 2007-11-05 Alp Toker <alp@atoker.com>
3280 Unreviewed build fix for qmake-based ports.
3282 Someone with a better understanding of qmake still needs to sort out
3283 the INCLUDEPATH/DEPENDPATH mess.
3285 * JavaScriptCore.pri:
3287 2007-11-05 Geoffrey Garen <ggaren@apple.com>
3289 Reviewed by Darin Adler.
3291 http://bugs.webkit.org/show_bug.cgi?id=15835
3293 Switched List implementation from a custom heap allocator to an inline
3294 Vector, for a disappointing .5% SunSpider speedup.
3296 Also renamed List::slice to List::getSlice because "get" is the
3297 conventional prefix for functions returning a value through an out
3300 * kjs/array_object.cpp:
3301 (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
3302 calls and memory accesses.
3304 * kjs/bool_object.cpp:
3305 (BooleanObjectImp::construct): Removed questionable use of iterator.
3308 * kjs/list.h: New List class, implemented in terms of Vector. Two
3309 interesting differences:
3310 1. The inline capacity is 8, not 5. Many of the Lists constructed
3311 during a SunSpider run are larger than 5; almost none are larger
3314 2. The growth factor is 4, not 2. Since we can guarantee that Lists
3315 aren't long-lived, we can grow them more aggressively, to avoid
3318 * kjs/regexp_object.cpp:
3319 (RegExpObjectImp::construct): Removed redundant function calls.
3321 * kjs/string_object.cpp:
3322 (KJS::StringObjectImp::construct): Removed questionable use of iterator.
3325 (WTF::::uncheckedAppend): Added a fast, unchecked version of append.
3327 2007-11-05 Mark Rowe <mrowe@apple.com>
3329 Reviewed by Alp Toker.
3331 Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.
3333 * JavaScriptCore.pri:
3336 2007-11-04 Darin Adler <darin@apple.com>
3340 - http://bugs.webkit.org/show_bug.cgi?id=15826
3341 optimize opcode loop and case insensitive ASCII compares for a 30% speedup
3343 SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
3345 * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
3347 * pcre/pcre_compile.c:
3348 (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
3349 added OP_NOT since there was no reason it should not be in here.
3350 (could_be_empty_branch): Ditto.
3351 (compile_branch): Streamlined all the single-character cases; there was a bit of
3352 duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
3353 But in particular, compile to those opcodes when the single character match is
3355 (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
3357 * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
3358 the matchframe, after I discovered that none of them needed to be saved and restored
3359 across recursive match calls. Also eliminated the ignored result field from the
3360 matchframe, since I discovered that rrc ("recursive result code") was already the
3361 exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
3362 statement of the switch instead of doing them before the switch. This removes a
3363 branch from each iteration of the opcode interpreter, just as removal of "op"
3364 removed at least one store from each iteration. Last, but not least, add the
3365 OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
3366 surrogate pair and the letter case can be handled efficiently.
3368 2007-11-04 Darin Adler <darin@apple.com>
3370 * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.
3372 2007-11-03 Darin Adler <darin@apple.com>
3374 - fix non-Mac builds; remove some more unused PCRE stuff
3376 * pcre/pcre_compile.c:
3377 (compile_branch): Removed branch chain and some unused ESC values.
3378 (compile_regex): Ditto.
3379 (jsRegExpCompile): Ditto.
3381 (match): Removed unused branch targets. Don't use macros any more.
3382 (jsRegExpExecute): More of the same.
3384 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
3385 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3386 * pcre/pcre.pri: Ditto.
3388 * pcre/MERGING: Removed.
3389 * pcre/pcre_fullinfo.c: Removed.
3390 * pcre/pcre_get.c: Removed.
3391 * pcre/pcre_internal.h:
3392 * pcre/ucp.h: Removed.
3394 2007-11-03 Darin Adler <darin@apple.com>
3398 - http://bugs.webkit.org/show_bug.cgi?id=15821
3399 remove unused PCRE features for speed
3401 A first step toward removing the PCRE features we don't use.
3402 This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
3403 the SunSpider regular expression test.
3405 Replaced the public interface with one that doesn't use the
3406 name PCRE. Removed code we don't need for JavaScript and various
3407 configurations we don't use. This is in preparation for still
3408 more changes in the future. We'll probably switch to C++ and
3409 make some even more significant changes to the regexp engine
3410 to get some additional speed.
3412 There's probably additional unused stuff that I haven't
3415 This does mean that our PCRE is now a fork, but I think that's
3416 not really a big deal.
3418 * JavaScriptCore.exp: Remove the 5 old entry points and add
3419 the 3 new entry points for WebCore's direct use of the regular
3422 * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
3423 its sense and now there's a USE(POSIX_REGEX) instead, which should
3424 probably not be set by anyone. Maybe later we'll just get rid of it
3429 (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
3430 defines. Cut down on the number of functions used.
3431 (KJS::RegExp::~RegExp): Ditto.
3432 (KJS::RegExp::match): Ditto.
3434 * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
3437 * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
3438 size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
3439 POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
3440 and JAVASCRIPT. These are all no longer configurable in our copy
3443 * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
3444 version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
3445 the include of <stdlib.h>, and most of the constants and
3446 functions defined in this header. Changed the naming scheme to
3447 use a JSRegExp prefix rather than a pcre prefix. In the future,
3448 we'll probably change this to be a C++ header.
3450 * pcre/pcre_compile.c: Removed all unused code branches,
3451 including many whole functions and various byte codes.
3452 Kept changes outside of removal to a minimum.
3454 (first_significant_code):
3457 (could_be_empty_branch):
3462 (find_firstassertedchar):
3463 (jsRegExpCompile): Renamed from pcre_compile2 and changed the
3464 parameters around a bit.
3465 (jsRegExpFree): Added.
3467 * pcre/pcre_exec.c: Removed many unused opcodes and variables.
3468 Also started tearing down the NO_RECURSE mechanism since it's
3469 now the default. In some cases there were things in the explicit
3470 frame that could be turned into plain old local variables and
3471 other small like optimizations.
3474 (match): Changed parameters quite a bit since it's now not used
3476 (jsRegExpExecute): Renamed from pcre_exec.
3478 * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
3479 PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
3480 PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
3481 PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
3482 _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
3483 and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
3485 * pcre/pcre_maketables.c: Changed to only compile in dftables.
3486 Also got rid of many of the tables that we don't use.
3488 * pcre/pcre_tables.c: Removed the unused Unicode property tables.
3490 * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
3491 _pcre_ucp_othercase.
3493 * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
3494 for classes based on Unicode properties.
3496 * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
3497 to eliminate this completely, but we need the regular expression
3498 code to be C++ first.
3500 * pcre/pcre_fullinfo.c:
3503 Files that are no longer needed. I didn't remove them with this
3504 check-in, because I didn't want to modify all the project files.
3506 2007-11-03 Maciej Stachowiak <mjs@apple.com>
3510 - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
3512 It turns out that doing this check costs more than it saves.
3514 * kjs/JSImmediate.h:
3515 (KJS::JSImmediate::fromDouble):
3517 2007-11-03 Sam Weinig <sam@webkit.org>
3521 Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
3522 The variable had been kept around for binary compatibility, but since nothing
3523 else is there is no point in continuing to keep it around.
3525 * API/JSCallbackConstructor.cpp:
3527 * API/JSCallbackFunction.cpp:
3529 * API/JSCallbackObject.cpp:
3531 * bindings/objc/objc_runtime.mm:
3532 * bindings/runtime_array.cpp:
3533 * bindings/runtime_object.cpp:
3534 * kjs/array_instance.cpp:
3536 * kjs/array_object.cpp:
3538 * kjs/bool_object.cpp:
3539 * kjs/date_object.cpp:
3541 * kjs/error_object.cpp:
3547 * kjs/math_object.cpp:
3548 * kjs/number_object.cpp:
3550 * kjs/regexp_object.cpp:
3551 * kjs/string_object.cpp:
3554 2007-11-03 Kevin McCullough <kmccullough@apple.com>
3556 - Updated testkjs results to make the build bots green until we
3557 can fix the tests that are failing. The new failures are in DST.
3559 * tests/mozilla/expected.html:
3561 2007-11-03 Maciej Stachowiak <mjs@apple.com>
3565 - don't print the var twice for ForInNodes with a var declaration
3567 * kjs/nodes2string.cpp:
3568 (KJS::ForInNode::streamTo):
3570 2007-11-03 Darin Adler <darin@apple.com>
3572 * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
3573 C-incompatible declaration.
3575 2007-11-03 Mark Rowe <mrowe@apple.com>
3579 * kjs/nodes.cpp: Add missing include.
3581 2007-11-03 Darin Adler <darin@apple.com>
3585 - fix http://bugs.webkit.org/show_bug.cgi?id=15814
3586 <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
3588 These changes cause us to match the JavaScript specification and pass the
3589 fast/js/kde/encode_decode_uri.html test.
3591 * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its