1 === Start merge of feature-branch 2007-10-12 ===
3 2007-10-11 Andrew Wellington <proton@wiretapped.net>
5 Reviewed by Eric Seidel.
7 Fix for http://bugs.webkit.org/show_bug.cgi?id=15076
8 "deg2rad has multiple definitions"
10 Define deg2rad, rad2deg, deg2grad, grad2deg, rad2grad, grad2rad
11 These are used through WebKit.
13 Change based on original patch by Rob Buis.
23 2007-10-10 Maciej Stachowiak <mjs@apple.com>
27 - fix assertion failures on quit.
29 * kjs/array_object.cpp:
30 (ArrayProtoFunc::callAsFunction): Dynamically alocate function-scope static
31 UStrings to avoid the static destructor getting called later.
32 * kjs/lookup.h: Dynamically alocate function-scope static
33 Identifiers to avoid the static destructor getting called later.
35 2007-10-07 Ed Schouten <ed@fxq.nl>
37 Reviewed and landed by Alexey Proskuryakov.
39 Add PLATFORM(FREEBSD), so we can fix the build on FreeBSD-like
40 systems by including <pthread_np.h>. Also fix some (disabled)
41 regcomp()/regexec() code; it seems some variable names have
46 (KJS::RegExp::RegExp):
49 2007-10-02 Alexey Proskuryakov <ap@webkit.org>
53 http://bugs.webkit.org/show_bug.cgi?id=10370
54 RegExp fails to match non-ASCII characters against [\S\s]
56 Test: fast/js/regexp-negative-special-characters.html
58 * pcre/pcre_compile.c:
59 (compile_branch): Adjust opcode and bitmap as necessary to include (or exclude)
60 character codes >255. Fix suggested by Philip Hazel.
63 (match): Merged fix for PCRE bug 580 (\S\S vs. \S{2}).
65 * tests/mozilla/expected.html: One test was fixed.
66 * pcre/MERGING: Added information about this fix.
68 2007-10-02 Maciej Stachowiak <mjs@apple.com>
72 - skip extra hash lookup and avoid converting char* to UString for 19% speedup on CK JS array test
73 http://bugs.webkit.org/show_bug.cgi?id=15350
75 * kjs/array_object.cpp:
76 (ArrayProtoFunc::callAsFunction): Implement the two mentioned optimizations.
78 2007-10-02 Maciej Stachowiak <mjs@apple.com>
82 - Efficiently handle regexp property identifiers for 19% speedup on Celtic Kane regexp test
83 http://bugs.webkit.org/show_bug.cgi?id=15337
85 * kjs/CommonIdentifiers.h:
86 * kjs/regexp_object.cpp:
87 (RegExpProtoFunc::callAsFunction):
88 (RegExpObjectImp::arrayOfMatches):
89 (RegExpObjectImp::construct):
91 2007-10-02 Maciej Stachowiak <mjs@apple.com>
95 - Cache global prorotypes more efficiently for 10% speedup on CK AJAX benchmark
96 http://bugs.webkit.org/show_bug.cgi?id=15335
100 2007-10-01 Oliver Hunt <oliver@apple.com>
104 Enable Experimental SVG features by default when building from Xcode
106 * Configurations/JavaScriptCore.xcconfig:
108 2007-09-29 Rob Buis <buis@kde.org>
112 http://bugs.webkit.org/show_bug.cgi?id=13472
113 Misparsing date in javascript leads to year value of -1
114 http://bugs.webkit.org/show_bug.cgi?id=14176
115 Some date values not handled consistently with IE/Firefox
117 Allow an optional comma between month and year, and year and time.
119 * kjs/date_object.cpp:
122 2007-07-11 Nikolas Zimmermann <zimmermann@kde.org>
126 Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
127 Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
129 * kjs/create_hash_table:
131 2007-06-25 Antti Koivisto <antti@apple.com>
135 Use intHash to hash floats and doubles too.
138 * wtf/HashFunctions.h:
139 (WTF::FloatHash::hash):
140 (WTF::FloatHash::equal):
143 (WTF::FloatHashTraits::emptyValue):
144 (WTF::FloatHashTraits::deletedValue):
147 === End merge of feature-branch 2007-10-12 ===
149 2007-10-11 Mark Rowe <mrowe@apple.com>
151 Reviewed by Tim Hatcher.
153 Fix for <rdar://problem/5488678>. Disable debugging symbols in production builds for 10.4
154 PowerPC to prevent a huge STABS section from being generated.
156 * Configurations/Base.xcconfig:
158 2007-10-08 George Staikos <staikos@kde.org>
160 Reviewed by Adam Roben.
162 Fix Qt build on Win32.
167 2007-10-10 Simon Hausmann <hausmann@kde.org>
171 Fix compilation using gcc 4.3. Header files have been reorganized and as a result some extra
172 includes are needed for INT_MAX, std::auto_ptr and the like.
177 * kjs/scope_chain.cpp:
181 2007-10-09 Lars Knoll <lars@trolltech.com>
185 fix the invokation of slots with return types. Add a JSLock around the conversion from QVariant to JSValue.
187 * bindings/qt/qt_instance.cpp:
188 (KJS::Bindings::QtInstance::invokeMethod):
189 * bindings/qt/qt_runtime.cpp:
190 (KJS::Bindings::convertValueToQVariant):
191 (KJS::Bindings::convertQVariantToValue):
193 2007-10-05 Geoffrey Garen <ggaren@apple.com>
195 Reviewed by Sam Weinig.
197 Added JSObject::removeDirect, to support the fix for
198 <rdar://problem/5522487> REGRESSION: With JavaScript disabled, any
199 page load causes a crash in PropertyMap::put
202 (KJS::JSObject::removeDirect):
205 2007-10-04 Mark Rowe <mrowe@apple.com>
209 Switch to default level of debugging symbols to resolve <rdar://problem/5488678>.
210 The "full" level appears to offer no observable benefits even though the documentation
211 suggests it be used for dead code stripping. This should also decrease link times.
213 * Configurations/Base.xcconfig:
215 2007-10-03 Lars Knoll <lars@trolltech.com>
219 Fix a stupid bug in Unicode::toUpper/toLower.
220 Fixes all three test failures in the JavaScriptCore test
223 * wtf/unicode/qt4/UnicodeQt4.h:
224 (WTF::Unicode::toLower):
225 (WTF::Unicode::toUpper):
227 2007-10-02 Darin Adler <darin@apple.com>
231 - add support for GDI objects to OwnPtr; I plan to use this
232 to fix some GDI handle leaks
234 * kjs/grammar.y: Change parser to avoid macros that conflict
235 with macros defined in Windows system headers: THIS, DELETE,
236 VOID, IN, and CONST. This is needed because OwnPtr.h will now
238 * kjs/keywords.table: Ditto.
240 * wtf/OwnPtr.h: For PLATFORM(WIN), add support so that OwnPtr can be
241 a GDI handle, and it will call DeleteObject. Also change to use the
242 RemovePointer technique used by RetainPtr, so you can say OwnPtr<HBITMAP>
243 rather than having to pass in the type pointed to by HBITMAP.
245 * wtf/OwnPtrWin.cpp: Added.
246 (WebCore::deleteOwnedPtr): Put this in a separate file so that we
247 don't have to include <windows.h> in OwnPtr.h.
249 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OwnPtrWin.cpp.
251 2007-09-29 Holger Hans Peter Freyther <zecke@selfish.org>
255 -Fix http://bugs.webkit.org/show_bug.cgi?id=13226.
256 Remove Bakefiles from svn.
258 * JavaScriptCoreSources.bkl: Removed.
259 * jscore.bkl: Removed.
261 2007-09-27 Kevin Decker <kdecker@apple.com>
263 Rubber stamped by John Sullivan.
265 <rdar://problem/5493093>
267 * JavaScriptCore.order: Added.
268 * JavaScriptCore.xcodeproj/project.pbxproj: We're changing from using an order file built by
269 another team to using one we actually check into our project repository. Linker settings for
270 Symbol Ordering Flags have been updated accordingly.
272 2007-09-26 Adam Roben <aroben@apple.com>
274 Make testkjs delay-load WebKit.dll so WebKitInitializer can work its magic
276 Rubberstamped by Anders.
278 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
280 2007-09-25 Adam Roben <aroben@apple.com>
282 Make testkjs delay-load its dependencies
284 This lets WebKitInitializer re-route the dependencies to be loaded out
285 of the Safari installation directory.
287 Rubberstamped by Sam.
289 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
291 2007-09-25 David Kilzer <ddkilzer@webkit.org>
295 - Fix http://bugs.webkit.org/show_bug.cgi?id=14885
296 LGPL'ed files contain incorrect FSF address
299 * bindings/testbindings.cpp:
300 * kjs/AllInOneFile.cpp:
302 * kjs/PropertyNameArray.cpp:
303 * kjs/PropertyNameArray.h:
306 2007-09-25 Sam Weinig <sam@webkit.org>
308 Fix location for build products for Debug_Internal.
310 Reviewed by Adam Roben.
312 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
314 2007-09-25 Adam Roben <aroben@apple.com>
316 Make testkjs use WebKitInitializer
320 * JavaScriptCore.vcproj/JavaScriptCore.sln: Add WebKitInitializer and
321 make testkjs depend on it.
322 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
323 WebKitInitializer.lib.
325 (main): Call initializeWebKit.
327 2007-09-24 Kevin McCullough <kmccullough@apple.com>
331 - Continued to update project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
333 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
334 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
336 2007-09-21 Kevin McCullough <kmccullough@apple.com>
340 - Updated project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
342 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
343 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
345 2007-09-20 Holger Hans Peter Freyther <zecke@selfish.org>
347 Rubber stamped by Adam.
349 Renamed files from *Gdk to *Gtk (see #14732) using the
350 work of Juan A. Suarez Romero as a base.
354 * JavaScriptCore.pri:
357 * wtf/Platform.h: PLATFORM(GDK) to PLATFORM(GTK)
359 2007-09-21 Mark Rowe <mrowe@apple.com>
361 Reviewed by Antti Koivisto.
363 http://bugs.webkit.org/show_bug.cgi?id=15250
364 <rdar://problem/5496942> REGRESSION: Reproducible crash in Safari when evaluating script in Drosera console (15250)
367 (KJS::GlobalFuncImp::callAsFunction): Null-check thisObj before passing it to interpreterForGlobalObject.
369 2007-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
371 Rubber stamped by Adam.
373 Make the guard/#if use the same name (ENABLE_FTPDIR) as the #define. This follows
374 the ENABLE_ICONDATABASE example from a couple of lines above.
378 2007-09-19 Mark Rowe <mrowe@apple.com>
382 <rdar://problem/5487107> NULL dereference crash in FastMallocZone::enumerate when running leaks against Safari
384 Storing remote pointers to their local equivalents in mapped memory was leading to the local pointer being
385 interpreted as a remote pointer. This caused a crash when using the result of mapping this invalid remote pointer.
386 The fix is to follow the pattern used elsewhere in FastMallocZone by always doing the mapping after reading and
387 never storing the mapped pointer.
389 * wtf/FastMalloc.cpp:
390 (WTF::FastMallocZone::enumerate):
392 2007-09-15 Darin Adler <darin@apple.com>
396 * JavaScriptCore.exp: Export WTFLogVerbose.
398 2007-09-14 Kevin McCullough <kmccullough@apple.com>
402 - Copy JSRetainPtr to include folder.
404 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
406 2007-09-13 Geoffrey Garen <ggaren@apple.com>
408 Try to fix GDK build.
413 2007-09-12 Geoff Garen <ggaren@apple.com>
415 Reviewed by Sam Weinig.
417 Fixed <rdar://problem/5429064> 141885 Safari JavaScript: Math.random() slightly less randomly distributed than on Safari / Mac
419 Math.random was skewed slightly upward because it assumed that RAND_MAX was outside the range of
420 values that rand() might return. This problem was particularly pronounced on Windows because
421 the range of values returned by rand() on Windows is 2^16 smaller than the range of values
422 return by rand() on Mac.
424 Fixed by accounting for RAND_MAX return values. Also, switched Windows over to rand_s, which has
425 a range that's equal to rand()'s range on Mac.
429 * kjs/math_object.cpp:
430 (MathFuncImp::callAsFunction): Use the new new thing.
432 * wtf/MathExtras.h: Platform abstraction for random numbers, to cover over differences on Windows.
436 2007-09-13 Antti Koivisto <antti@apple.com>
440 Small addition to previous path to cover
441 http://bugs.webkit.org/show_bug.cgi?id=11399
442 window.eval runs in the global scope of the calling window
444 Switch variable scope as well.
447 (KJS::GlobalFuncImp::callAsFunction):
449 2007-09-12 Antti Koivisto <antti@apple.com>
451 Reviewed by Geoff, Maciej.
453 Fix <rdar://problem/5445058>
454 REGRESSION: Unable to upload picture to eBay auction due to domain security check
456 eBay uses window.eval() between windows. In Firefox window.eval() switches execution
457 and security context to the target window, something WebKit did not do. With WebKit
458 security tightening in r24781, this broke picture uploads.
460 Fix by making WebKit switch context in window.eval().
463 (KJS::Context::Context):
464 (KJS::Context::~Context):
466 Save and restore interpreter context independently from calling context.
469 (KJS::GlobalFuncImp::callAsFunction):
470 If eval is called for global object different than current one, switch execution context
471 to that object and push it to scope.
473 2007-09-12 Sam Weinig <sam@webkit.org>
475 Reviewed by Geoffrey Garen.
477 <rdar://problem/5478717> JSStringCreateWithCFString leaks when passed a zero length CFStringRef
479 * API/JSStringRefCF.cpp:
480 (JSStringCreateWithCFString): Special case the zero length string and remove the
481 UTF16 optimized path since it will always leak due to the fact that we won't be
482 able to free the backing store that the CFStringRef provides.
484 2007-09-10 Timothy Hatcher <timothy@apple.com>
486 Reviewed by Darin Adler.
488 <rdar://problem/5456224> CrashTracer: [USER] 2 crashes in Toast Titanium at com.apple.CoreServices.CarbonCore: CSMemDisposePtr + 37
490 Removed the implementation of these malloc zone functions. We do not have the ability to
491 check if a pointer is valid or not, so we can't correctly implement them. The system free
492 does not fail if you pass in a bad pointer.
494 * wtf/FastMalloc.cpp:
495 (WTF::FastMallocZone::size):
496 (WTF::FastMallocZone::zoneMalloc):
497 (WTF::FastMallocZone::zoneCalloc):
498 (WTF::FastMallocZone::zoneFree):
499 (WTF::FastMallocZone::zoneRealloc):
501 2007-09-07 Darin Adler <darin@apple.com>
503 Reviewed by Steve Falkenburg.
505 - fix crash seen on Windows release builds
507 * wtf/FastMalloc.cpp: Change pthread_getspecific optimization to be done only
508 on the DARWIN platform. Also correct a couple reinterpret_cast that should be
511 2007-09-06 Kevin McCullough <kmccullough@apple.com>
515 - Moved JSRetainPtr to the API.
517 * API/JSRetainPtr.h: Copied from kjs/JSRetainPtr.h.
520 (JSRetainPtr::JSRetainPtr):
521 (JSRetainPtr::~JSRetainPtr):
523 (JSRetainPtr::releaseRef):
524 (JSRetainPtr::operator->):
525 (JSRetainPtr::operator!):
526 (JSRetainPtr::operator UnspecifiedBoolType):
533 * JavaScriptCore.xcodeproj/project.pbxproj:
534 * kjs/JSRetainPtr.h: Removed.
536 2007-09-05 Maciej Stachowiak <mjs@apple.com>
540 - Remove single-threaded optimization for FastMalloc.
542 It does not appear to help anywhere but Mac OS X on PPC, due to
543 pthread_getspecific being slow there. On Intel, removing the
544 optimization results in a ~1.5% PLT speedup, a ~1-5% JS iBench
545 speedup, and a ~1.5% HTML iBench speedup. On PPC this change is a
546 speedup on some benchmarks, a slight hit on others.
548 * JavaScriptCore.xcodeproj/project.pbxproj:
550 (KJS::Collector::registerThread):
551 * wtf/FastMalloc.cpp:
552 (WTF::TCMalloc_ThreadCache::GetCache):
553 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
554 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
556 * wtf/FastMallocInternal.h: Removed.
558 2007-09-05 Kevin McCullough <kmccullough@apple.com>
560 Reviewed by Adam, Sam, Darin.
562 - Created a JSRetainPtr specifically for JSStringRefs so they can be automatically refed and derefed.
564 * JavaScriptCore.xcodeproj/project.pbxproj:
565 * kjs/JSRetainPtr.h: Copied from wtf/RetainPtr.h.
569 (KJS::JSRetainPtr::JSRetainPtr):
570 (KJS::JSRetainPtr::~JSRetainPtr):
571 (KJS::JSRetainPtr::get):
572 (KJS::JSRetainPtr::releaseRef):
573 (KJS::JSRetainPtr::operator->):
574 (KJS::JSRetainPtr::operator UnspecifiedBoolType):
582 2007-09-05 Mark Rowe <mrowe@apple.com>
584 Unreviewed Qt build fix.
586 * wtf/unicode/qt4/UnicodeQt4.h: Fix the constness of the src argument to toUpper to prevent build failures.
588 2007-09-04 Maciej Stachowiak <mjs@apple.com>
590 Back out accidentally committed change.
592 * JavaScriptCore.xcodeproj/project.pbxproj:
594 (KJS::Collector::registerThread):
595 * wtf/FastMalloc.cpp:
596 (WTF::fastMallocSetIsMultiThreaded):
597 (WTF::TCMalloc_ThreadCache::GetCache):
598 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
599 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
601 * wtf/FastMallocInternal.h: Added.
603 2007-09-04 Maciej Stachowiak <mjs@apple.com>
607 - Added Vector::appendRange(), which appends to a vector based on a given start and end iterator
608 - Added keys() and values() functions to HashMap iterators, which give keys-only and values-only iterators
610 Together, these allow easy copying of a set, or the keys or values of a map, into a Vector. Examples:
612 HashMap<int, int> map;
616 vec.appendRange(set.begin(), set.end());
617 vec.appendRange(map.begin().keys(), map.end().keys());
618 vec.appendRange(map.begin().values(), map.end().values());
620 This also allows for a slightly nicer syntax when iterating a map. Instead of saying
621 (*it)->first, you can say *it.values(). Similarly for keys. Example:
623 HashMap<int, int>::const_iterator end = map.end();
624 for (HashMap<int, int>::const_iterator it = map.begin(); it != end; ++it)
625 printf(" [%d => %d]", *it.keys(), *it.values());
627 * JavaScriptCore.xcodeproj/project.pbxproj:
628 * wtf/HashIterators.h: Added.
630 (WTF::HashTableConstKeysIterator::HashTableConstKeysIterator):
631 (WTF::HashTableConstKeysIterator::get):
632 (WTF::HashTableConstKeysIterator::operator*):
633 (WTF::HashTableConstKeysIterator::operator->):
634 (WTF::HashTableConstKeysIterator::operator++):
635 (WTF::HashTableConstValuesIterator::HashTableConstValuesIterator):
636 (WTF::HashTableConstValuesIterator::get):
637 (WTF::HashTableConstValuesIterator::operator*):
638 (WTF::HashTableConstValuesIterator::operator->):
639 (WTF::HashTableConstValuesIterator::operator++):
640 (WTF::HashTableKeysIterator::HashTableKeysIterator):
641 (WTF::HashTableKeysIterator::get):
642 (WTF::HashTableKeysIterator::operator*):
643 (WTF::HashTableKeysIterator::operator->):
644 (WTF::HashTableKeysIterator::operator++):
645 (WTF::HashTableKeysIterator::operator HashTableConstKeysIterator<HashTableType, KeyType, MappedType>):
646 (WTF::HashTableValuesIterator::HashTableValuesIterator):
647 (WTF::HashTableValuesIterator::get):
648 (WTF::HashTableValuesIterator::operator*):
649 (WTF::HashTableValuesIterator::operator->):
650 (WTF::HashTableValuesIterator::operator++):
651 (WTF::HashTableValuesIterator::operator HashTableConstValuesIterator<HashTableType, KeyType, MappedType>):
656 (WTF::::appendRange):
658 2007-09-04 Maciej Stachowiak <mjs@apple.com>
662 - Remove single-threaded optimization for FastMalloc.
664 It does not appear to help anywhere but Mac OS X on PPC, due to
665 pthread_getspecific being slow there. On Intel, removing the
666 optimization results in a 1% PLT speedup, a 2% JS iBench speedup,
667 and no measurable effect on HTML iBench (maybe a slight speedup).
669 * JavaScriptCore.xcodeproj/project.pbxproj:
671 (KJS::Collector::registerThread):
672 * wtf/FastMalloc.cpp:
673 (WTF::TCMalloc_ThreadCache::GetCache):
674 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
675 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
677 * wtf/FastMallocInternal.h: Removed.
679 2007-09-03 Mark Rowe <mrowe@apple.com>
681 Reviewed by Tim Hatcher.
683 <rdar://problem/5452164> Production build with in symbols directory has no debug info
685 Enable debug symbol generation on all build configurations. Production builds are stripped
686 of symbols by Xcode during deployment post-processing.
688 * Configurations/Base.xcconfig:
689 * JavaScriptCore.xcodeproj/project.pbxproj:
691 2007-08-30 Riku Voipio <riku.voipio@iki.fi>
693 Reviewed by Dave Kilzer.
697 * kjs/ustring.h: Update comments to reflect the change and update test
698 to fit changes to Platform.h.
699 * wtf/Platform.h: Forced packing is only needed on oldabi ARM.
700 Set middle-endian floats only for little-endian oldabi ARM.
701 Set big-endian define for big-endian ARM.
703 2007-08-29 Ryan Leavengood <leavengood@gmail.com>
707 http://bugs.webkit.org/show_bug.cgi?id=15043
708 - posix_memalign takes a void** as its first parameter. My port makes use of this function call.
711 (KJS::allocateBlock):
713 2007-08-26 Darin Adler <darin@apple.com>
715 - quick follow on to that last check-in
717 * API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject):
718 Need to initialize m_class to 0.
720 2007-08-26 Mark Rowe <mrowe@apple.com>
722 Reviewed by Darin Adler.
724 <rdar://problem/4949002> JSGlobalContextCreate can cause crashes because it passes a NULL JSContextRef to the globalObjectClass's initialize callback
726 JSCallbackObject now tracks whether it was constructed with a null ExecState. This will happen when the object is being used as the global object,
727 as the Interpreter needs to be created after the global object. In this situation the initialization is deferred until after the Interpreter's
728 ExecState is available to be passed down to the initialize callbacks.
730 * API/JSCallbackObject.cpp:
731 (KJS::JSCallbackObject::init): Track whether we successfully initialized.
732 (KJS::JSCallbackObject::initializeIfNeeded): Attempt to initialize with the new ExecState.
733 * API/JSCallbackObject.h:
734 * API/JSContextRef.cpp:
735 (JSGlobalContextCreate): Initialize the JSCallbackObject with the Interpreter's ExecState.
737 (testInitializeOfGlobalObjectClassHasNonNullContext):
738 (main): Verify that the context passed to the initialize callback is non-null.
740 2007-08-26 Mark Rowe <mrowe@apple.com>
742 Reviewed by Darin Adler.
744 <rdar://problem/5438496> JSGlobalContextCreate crashes when passed a custom class
746 * API/JSContextRef.cpp:
747 (JSGlobalContextCreate): Specify jsNull() as the prototype and let Interpreter's constructor fix it up to point at builtinObjectPrototype().
749 (main): Use an instance of a custom class as the global object to ensure the code path is exercised in the test.
751 2007-08-26 Mike Hommey <glandium@debian.org>
753 Reviewed by Mark Rowe and David Kilzer.
755 Fix build failure on arm.
757 * wtf/Platform.h: Also test if __arm__ is defined.
759 2007-08-25 Peter Kasting <zerodpx@gmail.org>
761 Reviewed by Maciej Stachowiak.
763 Part 3 of http://bugs.webkit.org/show_bug.cgi?id=14967
764 Bug 14967: Reduce wtf::Vector::operator[]() overloads
767 (WTF::Vector::operator[]): Only provide versions of operator[] that takes a size_t argument.
769 2007-08-25 Peter Kasting <zerodpx@gmail.org>
771 Reviewed by Sam Weinig.
773 Part 2 of http://bugs.webkit.org/show_bug.cgi?id=14967.
774 Eliminate all remaining implicit conversions of wtf::Vector<T> to T*. Where code was
775 previously checking that the Vector's data pointer was non-NULL, check !Vector::isEmpty()
781 2007-08-16 Kevin McCullough <kmccullough@apple.com>
783 Reviewed by Geoff and Adam.
785 - Changing stack depth to 500 (from 100 on mac and win) to help out some apps specifically gmail. <rdar://problem/3590522> JavaScript call stack limit of 99 is too small for some applications; needs to be closer to 500 (4045)
789 2007-08-15 Peter Kasting <zerodpx@gmail.org>
793 http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
794 conversions of wtf::Vector<T> to T* by explicitly calling .data()
796 * API/JSCallbackConstructor.cpp:
797 (KJS::JSCallbackConstructor::construct):
798 * API/JSCallbackFunction.cpp:
799 (KJS::JSCallbackFunction::callAsFunction):
800 * API/JSCallbackObject.cpp:
801 (KJS::JSCallbackObject::construct):
802 (KJS::JSCallbackObject::callAsFunction):
803 * bindings/c/c_instance.cpp:
804 (KJS::Bindings::CInstance::invokeMethod):
805 (KJS::Bindings::CInstance::invokeDefaultMethod):
806 * kjs/number_object.cpp:
807 (integer_part_noexp):
810 (KJS::UString::UTF8String):
812 2007-08-14 Darin Adler <darin@apple.com>
816 - fix <rdar://problem/5410570> Global initializer introduced by use of std::numeric_limits in r24919
819 (KJS::overflowIndicator): Turned into a function.
820 (KJS::maxUChars): Ditto.
821 (KJS::allocChars): Use the functions.
822 (KJS::reallocChars): Ditto.
823 (KJS::UString::expandedSize): Ditto.
825 2007-08-12 Darin Adler <darin@apple.com>
829 - fix http://bugs.webkit.org/show_bug.cgi?id=14931
830 <rdar://problem/5403816> JavaScript regular expression non-participating capturing parentheses
831 fail in 3 different ways
833 Test: fast/js/regexp-non-capturing-groups.html
835 * kjs/string_object.cpp:
836 (KJS::replace): Add missing code to handle undefined backreferences; before we'd get the empty string
837 instead of a JavaScript "undefined" value.
838 (KJS::StringProtoFunc::callAsFunction): Implemented backreference support for split.
839 * pcre/pcre_exec.c: (match): Made backreferences to undefined groups match the empty string instead
840 of always failing. Only in JAVASCRIPT mode.
842 * tests/mozilla/expected.html: Add a new expected test success, since this fixed one test result.
844 2007-08-10 Timothy Hatcher <timothy@apple.com>
848 <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
850 Disable the NPAPI for 64-bit on Mac OS X.
852 * Configurations/JavaScriptCore.xcconfig: Use the 64-bit export file.
853 * JavaScriptCore.xcodeproj/project.pbxproj: Create a 64-bit export file
854 that filters out the NPN fnctions.
855 * bindings/NP_jsobject.cpp: #ifdef out this for 64-bit on Mac OS X
856 * bindings/NP_jsobject.h: Ditto.
857 * bindings/c/c_class.cpp: Ditto.
858 * bindings/c/c_class.h: Ditto.
859 * bindings/c/c_instance.cpp: Ditto.
860 * bindings/c/c_instance.h: Ditto.
861 * bindings/c/c_runtime.cpp: Ditto.
862 * bindings/c/c_runtime.h: Ditto.
863 * bindings/c/c_utility.cpp: Ditto.
864 * bindings/c/c_utility.h: Ditto.
865 * bindings/npapi.h: Ditto.
866 * bindings/npruntime.cpp: Ditto.
867 * bindings/npruntime.h: Ditto.
868 * bindings/npruntime_impl.h: Ditto.
869 * bindings/npruntime_priv.h: Ditto.
870 * bindings/runtime.cpp:
871 (KJS::Bindings::Instance::createBindingForLanguageInstance):
872 don't creat an NPObject on Mac OS X in 64-bit.
874 2007-08-09 Mark Rowe <mrowe@apple.com>
878 <rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
880 * Configurations/Version.xcconfig:
881 * JavaScriptCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
882 Version.xcconfig and Info.plist explicit to Xcode.
884 2007-08-08 George Staikos <staikos@kde.org>
886 Make it compile with Qt again.
888 * wtf/unicode/qt4/UnicodeQt4.h:
889 (WTF::Unicode::toUpper):
891 2007-08-07 Sam Weinig <sam@webkit.org>
895 Fix for http://bugs.webkit.org/show_bug.cgi?id=14897
896 Decompilation of double negation fails and produces invalid or incorrect code
898 Test: fast/js/function-decompilation-operators.html
900 * kjs/nodes2string.cpp:
901 (UnaryPlusNode::streamTo): Put space after unary operator. Matches Firefox.
902 (NegateNode::streamTo): Diito.
903 (MultNode::streamTo): Put spaces around binary operator. Matches Firefox.
904 (AddNode::streamTo): Ditto.
906 2007-08-07 Darin Adler <darin@apple.com>
910 - fix <rdar://problem/5383104> REGRESSION: XHR.responseText is null instead of empty string
911 in http/tests/xmlhttprequest/zero-length-response.html
913 The new code to handle out of memory conditions was turning a "" into a null string.
915 * kjs/ustring.h: Removed UCharReference, which has long been obsolete and unused.
916 Removed copyForWriting, which was only used for the upper/lowercasing code and for
919 (KJS::allocChars): Removed special case that made this fail (return 0) when passed 0.
920 Instead assert that we're not passed 0. Also added an overflow check for two reasons:
921 1) for sizes that aren't checked this prevents us from allocating a buffer that's too
922 small, and 2) for sizes where we overflowed in the expandedSize function and returned
923 overflowIndicator, it guarantees we fail.
924 (KJS::reallocChars): Ditto.
925 (KJS::UString::expandedSize): Return a large number, overflowIndicator, rather than 0
926 for cases where we overflow.
927 (KJS::UString::spliceSubstringsWithSeparators): Added a special case for empty string so
928 we don't call allocChars with a length of 0.
929 (KJS::UString::operator=): Added special characters for both 0 and empty string so we
930 match the behavior of the constructor. This avoids calling allocChars with a length of 0
931 and making a null string rather than an empty string in that case, and also matches the
932 pattern used in the rest of the functions.
933 (KJS::UString::operator[]): Made the return value const so code that tries to use the
934 operator to modify the string will fail.
936 * kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction): Rewrote uppercasing and
937 lowercasing functions so they don't need copyForWriting any more -- it wasn't really doing
938 any good for optimization purposes. Instead use a Vector and releaseBuffer.
940 * wtf/unicode/icu/UnicodeIcu.h: Eliminate one of the versions of toLower/toUpper -- we now
941 only need the version where both a source and destination buffer is passed in, not the one
943 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
945 2007-08-06 Sam Weinig <sam@webkit.org>
949 Fix for http://bugs.webkit.org/show_bug.cgi?id=14891
950 Decompilation of try block immediately following "else" fails
952 Test: fast/js/toString-try-else.html
954 * kjs/nodes2string.cpp:
955 (TryNode::streamTo): Add newline before "try".
957 2007-08-07 Mark Rowe <mrowe@apple.com>
961 <rdar://problem/5388774> REGRESSION: Hang occurs after clicking "Attach a file " link in a new .Mac message
963 Attempting to acquire the JSLock inside CollectorHeap::forceLock can lead to a deadlock if the thread currently
964 holding the lock is waiting on the thread that is forking. It is not considered safe to use system frameworks
965 after a fork without first execing[*] so it is not particularly important to ensure that the collector and
966 fastMalloc allocators are unlocked in the child process. If the child process wishes to use JavaScriptCore it
967 should exec after forking like it would to use any other system framework.
968 [*]: <http://lists.apple.com/archives/Cocoa-dev/2005/Jan/msg00676.html>
970 * kjs/CollectorHeapIntrospector.cpp: Remove forceLock and forceUnlock implementations.
971 * kjs/CollectorHeapIntrospector.h: Stub out forceLock and forceUnlock methods.
972 * wtf/FastMalloc.cpp: Ditto.
974 2007-08-06 Darin Adler <darin@apple.com>
976 Rubber stamped by Geoff.
978 * kjs/ustring.h: Added an assertion which would have helped us find the
979 previous bug more easily.
981 2007-08-06 Darin Adler <darin@apple.com>
985 - fix <rdar://problem/5387589> 9A514: Quartz Composer crash on launch in KJS::jsString
988 (JSEvaluateScript): Turn NULL for sourceURL into UString::null(), just as JSObjectMakeFunction already does.
989 (JSCheckScriptSyntax): Ditto.
991 2007-08-06 Matt Lilek <pewtermoose@gmail.com>
993 Not reviewed, build fix.
995 * kjs/string_object.cpp:
996 (KJS::StringProtoFunc::callAsFunction):
998 2007-08-04 Darin Adler <darin@apple.com>
1002 - fix <rdar://problem/5371862> crash in Dashcode due to Quartz Composer JavaScript garbage collector reentrancy
1004 * API/JSBase.cpp: (JSGarbageCollect): Don't call collector() if isBusy() returns true.
1006 * kjs/collector.h: Added isBusy(), removed the unused return value from collect()
1007 * kjs/collector.cpp: Added an "operation in progress" flag to the allocator.
1008 (KJS::Collector::allocate): Call abort() if an operation is already in progress. Set the new flag instead
1009 of using the debug-only GCLock.
1010 (KJS::Collector::collect): Ditto.
1011 (KJS::Collector::isBusy): Added.
1013 2007-08-04 Maciej Stachowiak <mjs@apple.com>
1015 Reviewed by Darin and Adam.
1017 <rdar://problem/5368990> REGRESSION: newsgator.com sign-on 6x slower than Safari 3 beta due to GC changes (14808)
1019 * kjs/string_object.cpp:
1020 (KJS::replace): if the string didn't change (very common in some cases) reuse the original string value.
1021 (KJS::StringProtoFunc::callAsFunction): Pass in the StringImp* when replacing, not just the UString.
1022 * kjs/string_object.h:
1023 (KJS::StringInstance::internalValue): covariant override to return StringImp for convenience
1025 2007-08-04 Mark Rowe <mrowe@apple.com>
1027 Reviewed by Oliver Hunt.
1029 <rdar://problem/5385145> r24843 introduces a crash on calling fork() (14878)
1030 http://bugs.webkit.org/show_bug.cgi?id=14878
1032 Provide no-op functions for all members of the malloc_zone_t and malloc_introspection_t structures that we
1033 register to avoid crashes in system code that assumes they will be non-null.
1035 * kjs/CollectorHeapIntrospector.cpp:
1036 (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector):
1037 (KJS::CollectorHeapIntrospector::forceLock): Grab the lock.
1038 (KJS::CollectorHeapIntrospector::forceUnlock): Release the lock.
1039 * kjs/CollectorHeapIntrospector.h:
1040 (KJS::CollectorHeapIntrospector::goodSize):
1041 (KJS::CollectorHeapIntrospector::check):
1042 (KJS::CollectorHeapIntrospector::print):
1043 (KJS::CollectorHeapIntrospector::log):
1044 (KJS::CollectorHeapIntrospector::statistics):
1045 (KJS::CollectorHeapIntrospector::size):
1046 (KJS::CollectorHeapIntrospector::zoneMalloc):
1047 (KJS::CollectorHeapIntrospector::zoneCalloc):
1048 (KJS::CollectorHeapIntrospector::zoneFree):
1049 * wtf/FastMalloc.cpp:
1050 (WTF::FastMallocZone::goodSize):
1051 (WTF::FastMallocZone::check):
1052 (WTF::FastMallocZone::print):
1053 (WTF::FastMallocZone::log):
1054 (WTF::FastMallocZone::forceLock): Grab the TCMalloc locks.
1055 (WTF::FastMallocZone::forceUnlock): Release the TCMalloc locks.
1056 (WTF::FastMallocZone::FastMallocZone):
1058 2007-08-04 Mark Rowe <mrowe@apple.com>
1060 Rubber-stamped by Anders.
1062 * pcre/pcre_compile.c: Remove non-ASCII character from a comment.
1064 2007-08-02 Mark Rowe <mrowe@apple.com>
1066 Reviewed by Geoff Garen.
1068 <rdar://problem/4212199> 'leaks' reports false leaks in WebKit (because the WTF allocator uses mmap?)
1070 Implement malloc zone introspection routines to allow leaks, heap, and friends to request information
1071 about specific memory regions that were allocated by FastMalloc or the JavaScriptCore collector.
1073 This requires tool-side support before the regions will be displayed. The addition of that support is
1074 tracked by <rdar://problems/5353057&5353060>.
1076 * JavaScriptCore.exp: Export the two variables that are used by leaks to introspect the allocators.
1077 * JavaScriptCore.xcodeproj/project.pbxproj:
1078 * kjs/AllInOneFile.cpp:
1079 * kjs/CollectorHeapIntrospector.cpp: Added.
1081 (KJS::CollectorHeapIntrospector::init):
1082 (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector): Create and register our zone with the system.
1083 (KJS::CollectorHeapIntrospector::enumerate): Iterate over the CollectorBlocks that are in use and report them to the caller as being used.
1084 * kjs/CollectorHeapIntrospector.h: Added.
1085 (KJS::CollectorHeapIntrospector::size): Return zero to indicate the specified pointer does not belong to this zone.
1086 * kjs/collector.cpp:
1087 (KJS::Collector::registerThread): Register the CollectorHeapIntrospector with the system when the first thread is registered with the collector.
1088 * wtf/FastMalloc.cpp:
1089 (WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe):
1090 (WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Enumerate the objects on the free list.
1091 (WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Ditto.
1092 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Ditto.
1093 (WTF::TCMalloc_ThreadCache::InitModule): Register the FastMallocZone with the system when initializing TCMalloc.
1094 (WTF::FreeObjectFinder::FreeObjectFinder):
1095 (WTF::FreeObjectFinder::visit): Add an object to the free list.
1096 (WTF::FreeObjectFinder::isFreeObject):
1097 (WTF::FreeObjectFinder::freeObjectCount):
1098 (WTF::FreeObjectFinder::findFreeObjects): Find the free objects within a thread cache or free list.
1099 (WTF::PageMapFreeObjectFinder::PageMapFreeObjectFinder): Find the free objects within a TC_PageMap.
1100 (WTF::PageMapFreeObjectFinder::visit): Called once per allocated span. Record whether the span or any subobjects are free.
1101 (WTF::PageMapMemoryUsageRecorder::PageMapMemoryUsageRecorder):
1102 (WTF::PageMapMemoryUsageRecorder::visit): Called once per allocated span. Report the range of memory as being allocated, and the span or
1103 its subobjects as being used if they do not appear on the free list.
1104 (WTF::FastMallocZone::enumerate): Map the key remote TCMalloc data structures into our address space. We then locate all free memory ranges
1105 before reporting the other ranges as being in use.
1106 (WTF::FastMallocZone::size): Determine whether the given pointer originates from within our allocation zone. If so,
1107 we return its allocation size.
1108 (WTF::FastMallocZone::zoneMalloc):
1109 (WTF::FastMallocZone::zoneCalloc):
1110 (WTF::FastMallocZone::zoneFree):
1111 (WTF::FastMallocZone::zoneRealloc):
1113 (WTF::FastMallocZone::FastMallocZone): Create and register our zone with the system.
1114 (WTF::FastMallocZone::init):
1115 * wtf/MallocZoneSupport.h: Added.
1116 (WTF::RemoteMemoryReader::RemoteMemoryReader): A helper class to ease the process of mapping memory in a different process into
1117 our local address space
1118 (WTF::RemoteMemoryReader::operator()):
1120 (TCMalloc_PageMap2::visit): Walk over the heap and visit each allocated span.
1121 (TCMalloc_PageMap3::visit): Ditto.
1123 2007-08-02 Mark Rowe <mrowe@apple.com>
1128 (KJS::UString::expandedSize): Use std::numeric_limits<size_t>::max() rather than the non-portable SIZE_T_MAX.
1130 2007-08-02 Mark Rowe <mrowe@apple.com>
1134 <rdar://problem/5352887> "Out of memory" error during repeated JS string concatenation leaks hundreds of MBs of RAM
1136 A call to fastRealloc was failing which lead to UString::expandCapacity leaking the buffer it was trying to reallocate.
1137 It also resulted in the underlying UString::rep having both a null baseString and buf field, which meant that attempting
1138 to access the contents of the string after the failed memory reallocation would crash.
1140 A third issue is that expandedSize size was calculating the new length in a way that led to an integer overflow occurring.
1141 Attempting to allocate a string more than 190,000,000 characters long would fail a the integer overflow would lead to a
1142 memory allocation of around 3.6GB being attempted rather than the expected 390MB. Sizes that would lead to an overflow
1143 are now returned as zero and callers are updated to treat this as though the memory allocation has failed.
1145 * kjs/array_object.cpp:
1146 (ArrayProtoFunc::callAsFunction): Check whether the append failed and raise an "Out of memory" exception if it did.
1148 (KJS::allocChars): Wrapper around fastMalloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
1149 (KJS::reallocChars): Wrapper around fastRealloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
1150 (KJS::UString::expandedSize): Split the size calculation in two and guard against overflow during each step.
1151 (KJS::UString::expandCapacity): Don't leak r->buf if reallocation fails. Instead free the memory and use the null representation.
1152 (KJS::UString::expandPreCapacity): If fastMalloc fails then use the null representation rather than crashing in memcpy.
1153 (KJS::UString::UString): If calls to expandCapacity, expandPreCapacity or fastMalloc fail then use the null representation rather than crashing in memcpy.
1154 (KJS::UString::append): Ditto.
1155 (KJS::UString::operator=): Ditto.
1156 * kjs/ustring.h: Change return type of expandedSize from int to size_t.
1158 2007-08-01 Darin Adler <darin@apple.com>
1160 Reviewed by Kevin McCullough.
1162 - fix <rdar://problem/5375186> pointers to pieces of class definition passed to JSClassCreate should all be const
1164 * API/JSObjectRef.h: Added const.
1166 * API/JSClassRef.cpp:
1167 (OpaqueJSClass::OpaqueJSClass): Added const.
1168 (OpaqueJSClass::create): Added const.
1169 * API/JSObjectRef.cpp:
1170 (JSClassCreate): Added const.
1172 2007-08-01 Steve Falkenburg <sfalken@apple.com>
1174 Build mod: Fix sln to match configs in vcproj.
1178 * JavaScriptCore.vcproj/JavaScriptCore.make:
1179 * JavaScriptCore.vcproj/JavaScriptCore.sln:
1181 2007-07-30 Simon Hausmann <hausmann@kde.org>
1183 Done with and reviewed by Lars.
1185 Removed the __BUILDING_QT ifdef in JSStringRef.h and changed UChar for the Qt build to use wchar_t on Windows.
1187 * API/JSStringRef.h:
1188 * wtf/unicode/qt4/UnicodeQt4.h:
1190 2007-07-27 Simon Hausmann <hausmann@kde.org>
1192 Done with and reviewed by Lars and Zack.
1194 Always define JSChar to be unsigned short for the Qt builds, to ensure compatibility with UChar.
1196 * API/JSStringRef.h:
1198 2007-07-27 Simon Hausmann <hausmann@kde.org>
1200 Done with and reviewed by Lars and Zack.
1202 Fix compilation with Qt on Windows with MingW: Implemented currentThreadStackBase() for this platform.
1204 * kjs/collector.cpp:
1205 (KJS::currentThreadStackBase):
1207 2007-07-27 Simon Hausmann <hausmann@kde.org>
1209 Done with and reviewed by Lars and Zack.
1211 Fix compilation with Qt on Windows with MingW: The MingW headers do not provide a prototype for a reentrant version of localtime. But since we don't use multiple threads for the Qt build we can use the plain localtime() function.
1214 (KJS::getDSTOffsetSimple):
1216 2007-07-27 Simon Hausmann <hausmann@kde.org>
1218 Done with and reviewed by Lars and Zack.
1220 Use $(MOVE) instead of mv to eliminated the shell dependency and replaced the long shell line to call bison and modify the css grammar file with a few lines of portable perl code.
1222 * JavaScriptCore.pri:
1224 2007-07-27 Simon Hausmann <hausmann@kde.org>
1226 Done with and reviewed by Lars and Zack.
1228 Implemented currentTime() in the interpreter by using QDateTime, so that we don't need timeGetTime() on Windows and therefore also don't need to link against Winmm.dll.
1230 * kjs/interpreter.cpp:
1231 (KJS::getCurrentTime):
1236 2007-07-27 Simon Hausmann <hausmann@kde.org>
1238 Done with and reviewed by Lars and Zack.
1240 Replace the use of snprintf with QByteArray to compile under msvc 2005 express.
1242 * bindings/qt/qt_instance.cpp:
1243 (KJS::Bindings::QtInstance::stringValue):
1245 2007-07-27 Simon Hausmann <hausmann@kde.org>
1247 Done with and reviewed by Lars and Zack.
1249 Don't use pthread.h unless thread support is enabled.
1251 * kjs/collector.cpp:
1252 (KJS::Collector::registerAsMainThread):
1253 (KJS::onMainThread):
1255 2007-07-27 Simon Hausmann <hausmann@kde.org>
1257 Done with and reviewed by Lars and Zack.
1259 Removed TCSystemMalloc from the Qt build, it's not necessary it seems.
1261 * JavaScriptCore.pri:
1263 2007-07-27 Simon Hausmann <hausmann@kde.org>
1265 Done with and reviewed by Lars and Zack.
1267 Added os-win32 to the include search path for the Qt windows build in order to provide the fake stdint.h header file.
1269 * JavaScriptCore.pri:
1271 2007-07-25 Maciej Stachowiak <mjs@apple.com>
1275 - follow-up to previous change
1278 (KJS::UString::operator=): Make sure to reset the length when
1279 replacing the buffer contents for a single-owned string.
1281 2007-07-25 Maciej Stachowiak <mjs@apple.com>
1285 - JavaScriptCore part of fix for <rdar://problem/5300291> Optimize GC to reclaim big, temporary objects (like XMLHttpRequest.responseXML) quickly
1287 Also, as a side effect of optimizations included in this patch:
1288 - 7% speedup on JavaScript iBench
1289 - 4% speedup on "Celtic Kane" JS benchmark
1291 The basic idea is explained in a big comment in collector.cpp. When unusually
1292 large objecs are allocated, we push the next GC closer on the assumption that
1293 most objects are short-lived.
1295 I also did the following two optimizations in the course of tuning
1296 this not to be a performance regression:
1298 1) Change UString::Rep to hold a self-pointer as the baseString in
1299 the unshared case, instead of a null pointer; this removes a
1300 number of null checks in hot code because many places already
1301 wanted to use the rep itself or the baseString as appropriate.
1303 2) Avoid creating duplicate StringImpls when creating a
1304 StringInstance (the object wrapper for a JS string) or calling
1305 their methods. Since a temporary wrapper object is made every time
1306 a string method is called, this resulted in two useless extra
1307 StringImpls being allocated for no reason whenever a String method
1308 was invoked on a string value. Now we bypass those.
1310 * kjs/collector.cpp:
1312 (KJS::Collector::recordExtraCost): Basics of the extra cost mechanism.
1313 (KJS::Collector::allocate): ditto
1314 (KJS::Collector::collect): ditto
1316 (KJS::Collector::reportExtraMemoryCost): ditto
1317 * kjs/array_object.cpp:
1318 (ArrayInstance::ArrayInstance): record extra cost
1320 (KJS::StringImp::toObject): don't create a whole new StringImpl just
1321 to be the internal value of a StringInstance! StringImpls are immutable
1322 so there's no point tot his.
1324 (KJS::StringImp::StringImp): report extra cost
1325 * kjs/string_object.cpp:
1326 (KJS::StringInstance::StringInstance): new version that takes a StringImp
1327 (KJS::StringProtoFunc::callAsFunction): don't create a whole new StringImpl
1328 just to convert self to string! we already have one in the internal value
1329 * kjs/string_object.h: report extra cost
1330 * kjs/ustring.cpp: All changes to handle baseString being self instead of null in the
1333 (KJS::UString::Rep::create):
1334 (KJS::UString::Rep::destroy):
1335 (KJS::UString::usedCapacity):
1336 (KJS::UString::usedPreCapacity):
1337 (KJS::UString::expandCapacity):
1338 (KJS::UString::expandPreCapacity):
1339 (KJS::UString::UString):
1340 (KJS::UString::append):
1341 (KJS::UString::operator=):
1342 (KJS::UString::copyForWriting):
1344 (KJS::UString::Rep::baseIsSelf): new method, now that baseString is
1345 self instead of null in the unshared case we can't just null check.
1346 (KJS::UString::Rep::data): adjusted as mentioned above
1347 (KJS::UString::cost): new method to compute the cost for a UString, for
1351 (KJS::jsString): style fixups.
1352 (KJS::jsOwnedString): new method, use this for strings allocated from UStrings
1353 held by the parse tree. Tracking their cost as part of string cost is pointless,
1354 because garbage collecting them will not actually free the relevant string buffer.
1355 * kjs/value.h: prototyped jsOwnedString.
1357 (StringNode::evaluate): use jsOwnedString as appropriate
1358 (RegExpNode::evaluate): ditto
1359 (PropertyNameNode::evaluate): ditto
1360 (ForInNode::execute): ditto
1362 * JavaScriptCore.exp: Exported some new symbols.
1364 2007-07-23 Anders Carlsson <andersca@apple.com>
1368 <rdar://problem/5121461> REGRESSION: Unable to load JigZone puzzle
1370 * bindings/jni/jni_jsobject.cpp:
1371 (JavaJSObject::createNative):
1373 Call RootObject::gcProtect on the global object, thereby putting it in the
1374 "protect count" set which is used for checking if a native handle is valid.
1376 2007-07-23 Darin Adler <darin@apple.com>
1378 * pcre/pcre_compile.c: Roll back a tiny accidental change in the unused !JAVASCRIPT
1379 side of an #ifdef. This has no effect when using PCRE in JAVASCRIPT mode as we do,
1380 but seems worth rolling back.
1382 2007-07-23 Maciej Stachowiak <mjs@apple.com>
1386 - fix remaining problems with Window shadowing
1389 (VarDeclNode::evaluate): Tweak the special case a little.
1391 2007-07-23 Maciej Stachowiak <mjs@apple.com>
1395 - fix Window shadowing regressions caused by the previous commit.
1398 (VarDeclNode::evaluate): Handle the case of global scope specially.
1400 2007-07-22 Maciej Stachowiak <mjs@apple.com>
1404 -fixed <rdar://problem/5353293> REGRESSION (r24287): 1% i-Bench JS slowdown from JavaScript compatibility fix (14719)
1405 http://bugs.webkit.org/show_bug.cgi?id=14719
1407 My fix for this actually resulted in JS iBench being 1% faster than before the regression
1408 and the Celtic Kane benchmark being 5% faster than before the regression.
1411 (VarDeclNode::handleSlowCase): factored out the slow code path to be out of line.
1412 (VarDeclNode::evaluate): I did a couple of things:
1413 (1) Don't check if the variable is already declared by looking for the property in
1414 the variable object, that code path was dead code.
1415 (2) Special-case the common case where the top of the scope and the variable object
1416 are the same; in that case the variable must always be in the variable object.
1417 (3) Don't return a jsString() of the variable name, nothing uses the return value
1418 from this node types evaluate method.
1421 2007-07-22 Darin Adler <darin@apple.com>
1423 Reviewed by Kevin Decker.
1425 - fix <rdar://problem/5126394> REGRESSION: Crash after clicking back button in test application (13250)
1426 http://bugs.webkit.org/show_bug.cgi?id=13250
1428 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1429 If the object returns 0 for _imp, convert that to "undefined", since callers
1430 can't cope with a JSValue of 0.
1432 2007-07-19 Geoffrey Garen <ggaren@apple.com>
1434 Reviewed by Darin Adler.
1436 Fixed http://bugs.webkit.org/show_bug.cgi?id=10880 | <rdar://problem/5335694>
1437 REGRESSION: JavaScript menu doesn't appear on pricepoint.com (14595)
1439 Though the ECMA spec says auto-semicolon insertion should not occur
1440 without a newline or '}', Firefox treats do-while specially, and the
1441 library used by pricepoint.com requires that special treatment.
1443 * JavaScriptCore.xcodeproj/project.pbxproj:
1446 2007-07-19 Darin Adler <darin@apple.com>
1450 - fix <rdar://problem/5345440> PCRE computes wrong length for expressions with quantifiers
1451 on named recursion or subexpressions
1453 It's challenging to implement proper preflighting for compiling these advanced features.
1454 But we don't want them in the JavaScript engine anyway.
1456 Turned off the following features of PCRE (some of these are simply parsed and not implemented):
1458 \C \E \G \L \N \P \Q \U \X \Z
1461 (?#) (?<=) (?<!) (?>)
1466 Added the following:
1470 Because of \v, the js1_2/regexp/special_characters.js test now passes.
1472 To be conservative, I left some features that JavaScript doesn't want, such as
1473 \012 and \x{2013}, in place. We can revisit these later; they're not directly-enough
1474 related to avoiding the incorrect preflighting.
1476 I also didn't try to remove unused opcodes and remove code from the execution engine.
1477 That could save code size and speed things up a bit, but it would require more changes.
1480 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the sanitizePattern workaround for
1481 lack of \u support, since the PCRE code now has \u support.
1483 * pcre/pcre-config.h: Set JAVASCRIPT to 1.
1484 * pcre/pcre_internal.h: Added ESC_v.
1486 * pcre/pcre_compile.c: Added a different escape table for when JAVASCRIPT is set that
1487 omits all the escapes we don't want interpreted and includes '\v'.
1488 (check_escape): Put !JAVASCRIPT around the code for '\l', '\L', '\N', '\u', and '\U',
1489 and added code to handle '\u2013' inside JAVASCRIPT.
1490 (compile_branch): Put !JAVASCRIPT if around all the code implementing the features we
1492 (pcre_compile2): Ditto.
1494 * tests/mozilla/expected.html: Updated since js1_2/regexp/special_characters.js now
1497 2007-07-18 Darin Adler <darin@apple.com>
1499 Reviewed by Oliver Hunt.
1501 - fix <rdar://problem/5345432> PCRE computes length wrong for expressions such as "[**]"
1503 Test: fast/js/regexp-charclass-crash.html
1505 * pcre/pcre_compile.c: (pcre_compile2): Fix the preflight code that calls
1506 check_posix_syntax to match the actual regular expression compilation code;
1507 before it was missing the check of the first character.
1509 2007-07-19 Holger Hans Peter Freyther <zecke@selfish.org>
1513 Define __BUILDING_GDK when building for Gdk to fix building testkjs on OSX.
1515 * JavaScriptCore.pri:
1517 2007-07-18 Simon Hausmann <hausmann@kde.org>
1519 * Fix the Qt build, call dftables from the right directory.
1521 Reviewed by Adam Treat.
1525 2007-07-18 Simon Hausmann <hausmann@kde.org>
1529 Don't call gcc directly when building the dftables tool but use a separate .pro file for the Qt build.
1531 * pcre/dftables.pro: Added.
1534 2007-07-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1536 Reviewed by Darin, Maciej, and Adam.
1538 Fixes <http://bugs.webkit.org/show_bug.cgi?id=9697>,
1539 the failure of ecma/GlobalObject/15.1.2.2-2.js,
1540 the failure of ecma/LexicalConventions/7.7.3-1.js,
1541 and most of the failures of tests in ecma/TypeConversion/9.3.1-3.js.
1543 Bug 9697: parseInt results may be inaccurate for numbers greater than 2^53
1545 This patch also fixes similar issues in the lexer and UString::toDouble().
1548 (KJS::parseIntOverflow):
1554 (KJS::UString::toDouble):
1555 * tests/mozilla/expected.html:
1557 2007-07-16 Sam Weinig <sam@webkit.org>
1561 Turn off -Wshorten-64-to-32 warning for 64-bit builds.
1563 * Configurations/Base.xcconfig:
1565 2007-07-14 Brady Eidson <beidson@apple.com>
1567 Reviewed by Sam Weinig
1569 Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser
1571 * wtf/Platform.h: Add ENABLE_FTPDIR feature to handle building on platforms that don't have the
1572 proper network-layer support
1574 2007-07-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1578 Fixes http://bugs.webkit.org/show_bug.cgi?id=13517,
1579 http://bugs.webkit.org/show_bug.cgi?id=14237, and
1580 the failure of test js1_5/Scope/regress-185485.js
1582 Bug 13517: DOM Exception 8 in finance.aol.com sub-page
1583 Bug 14237: Javascript "var" statement interprets initialization in the topmost function scope
1586 (VarDeclNode::evaluate):
1587 * tests/mozilla/expected.html:
1589 2007-07-12 Alexey Proskuryakov <ap@webkit.org>
1593 http://bugs.webkit.org/show_bug.cgi?id=14596
1594 Fix JSC compilation with KJS_VERBOSE.
1597 (KJS::FunctionImp::passInParameters):
1599 2007-07-11 George Staikos <staikos@kde.org>
1603 * ForwardingHeaders: Added.
1604 * ForwardingHeaders/JavaScriptCore: Added.
1605 * ForwardingHeaders/JavaScriptCore/APICast.h: Added.
1606 * ForwardingHeaders/JavaScriptCore/JSBase.h: Added.
1607 * ForwardingHeaders/JavaScriptCore/JSContextRef.h: Added.
1608 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
1609 * ForwardingHeaders/JavaScriptCore/JSObjectRef.h: Added.
1610 * ForwardingHeaders/JavaScriptCore/JSStringRef.h: Added.
1611 * ForwardingHeaders/JavaScriptCore/JSStringRefCF.h: Added.
1612 * ForwardingHeaders/JavaScriptCore/JSValueRef.h: Added.
1613 * ForwardingHeaders/JavaScriptCore/JavaScriptCore.h: Added.
1615 2007-07-11 Holger Hans Peter Freyther <zecke@selfish.org>
1619 As of http://bugs.webkit.org/show_bug.cgi?id=14527 move the
1620 WebCore/ForwardingHeader/JavaScriptCore to JavaScriptCore
1622 * ForwardingHeaders: Added.
1623 * ForwardingHeaders/JavaScriptCore: Copied from WebCore/ForwardingHeaders/JavaScriptCore.
1625 2007-07-11 Nikolas Zimmermann <zimmermann@kde.org>
1629 Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
1630 Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
1632 * kjs/create_hash_table:
1634 2007-07-09 Maciej Stachowiak <mjs@apple.com>
1638 - JavaScriptCore part of fix for: <rdar://problem/5295734> Repro crash closing tab/window @ maps.google.com in WTF::HashSet<KJS::RuntimeObjectImp*, WTF::PtrHash<KJS::RuntimeObjectImp*>, WTF::HashTraits<KJS::RuntimeObjectImp*> >::add + 11
1640 * JavaScriptCore.exp: Added needed export.
1642 2007-07-06 Maciej Stachowiak <mjs@apple.com>
1646 - <rdar://problem/5311093> JavaScriptCore fails to build with strict-aliasing warnings
1648 * Configurations/Base.xcconfig: Re-enable -Wstrict-aliasing
1649 * bindings/jni/jni_utility.cpp:
1650 (KJS::Bindings::getJNIEnv): Type-pun via a union instead of a pointer cast.
1652 (WTF::): Instead of doing type-punned assignments via pointer cast, do one of three things:
1653 (1) assign directly w/o cast if storage type matches real type; (2) assign using cast
1654 via union if type does not need reffing; (3) copy with memcpy and ref/deref manually if type
1655 needs reffing. This is ok peref-wise because memcpy of a constant length gets optomized.
1656 HashTraits are now expected to make ref()/deref() take the storage type, not the true type.
1658 (WTF::): Same basic idea.
1660 (WTF::): Added Assigner template for use by HashMap/HashSet. Change RefCounter to call ref()
1661 and deref() via storage type, avoiding the need to
1663 (WTF::RefCounter::ref): ditto
1664 (WTF::RefCounter::deref): ditto
1666 (WTF::): Change ref() and deref() for RefPtr HashTraits to take the storage type; cast
1667 via union to pointer type.
1668 * wtf/FastMalloc.cpp:
1669 (WTF::TCMalloc_PageHeap::init): Changed from constructor to init function so this can go in a union.
1670 (WTF::): redefine pageheap macro in terms of getPageHeap().
1671 (WTF::getPageHeap): new inline function, helper for pageheap macro. This hides the cast in a union.
1672 (WTF::TCMalloc_ThreadCache::InitModule): Call init() instead of using placement new to initialize page
1675 (TCMalloc_PageMap1::init): Changed from constructor to init function.
1676 (TCMalloc_PageMap2::init): ditto
1677 (TCMalloc_PageMap3::init): ditto
1680 2007-07-06 George Staikos <staikos@kde.org>
1684 Switch USE(ICONDATABASE) to ENABLE(ICONDATABASE)
1688 2007-07-03 Sam Weinig <sam@webkit.org>
1692 Eleventh round of fixes for implicit 64-32 bit conversion errors.
1693 <rdar://problem/5292262>
1695 - Fixes a real bug where where we were setting long long and unsigned long long
1696 values to a long field.
1698 * bindings/objc/objc_utility.mm:
1699 (KJS::Bindings::convertValueToObjcValue):
1701 2007-07-03 Sam Weinig <sam@webkit.org>
1703 Reviewed by Brady Eidson.
1705 Tenth round of fixes for implicit 64-32 bit conversion errors.
1706 <rdar://problem/5292262>
1708 - Add explicit casts.
1713 2007-07-02 Sam Weinig <sam@webkit.org>
1715 Reviewed by Kevin McCullough.
1717 Fourth round of fixes for implicit 64-32 bit conversion errors.
1718 <rdar://problem/5292262>
1720 Add custom piDouble and piFloat constants to use instead of M_PI.
1722 * kjs/math_object.cpp:
1723 (MathObjectImp::getValueProperty):
1727 2007-06-29 Sam Weinig <sam@webkit.org>
1731 Second pass at fixing implicit 64-32 bit conversion errors.
1732 <rdar://problem/5292262>
1734 - Add a toFloat() method to JSValue for float conversion.
1736 * JavaScriptCore.exp:
1738 (KJS::JSValue::toFloat):
1741 2007-06-27 Kevin McCullough <kmccullough@apple.com>
1745 - <rdar://problem/5271937> REGRESSION: Apparent WebKit JavaScript memory smasher when submitting comment to iWeb site (crashes in kjs_pcre_compile2)
1746 - Correctly evaluate the return value of _pcre_ucp_findchar.
1748 * pcre/pcre_compile.c:
1753 2007-06-27 Sam Weinig <sam@webkit.org>
1757 First pass at fixing implicit 64-32 bit conversion errors.
1758 <rdar://problem/5292262>
1760 - Add 'f' suffix where necessary.
1763 (StopWatch::getElapsedMS):
1765 2007-06-26 Geoffrey Garen <ggaren@apple.com>
1767 Reviewed by Maciej Stachowiak.
1769 Fixed <rdar://problem/5296627> JSGarbageCollect headerdoc suggests that
1770 using JavaScriptCore requires leaking memory
1772 * API/JSBase.h: Changed documentation to explain that you can pass NULL
1773 to JSGarbageCollect.
1775 2007-06-26 Adam Treat <adam@staikos.net>
1777 Reviewed by Adam Roben.
1779 Make the SQLite icon database optional.
1783 2007-06-15 George Staikos <staikos@kde.org>
1785 More missing files for Qt.
1787 * JavaScriptCore.pri:
1790 2007-06-15 George Staikos <staikos@kde.org>
1792 Another Qt build fix.
1794 * JavaScriptCore.pri:
1797 2007-06-15 George Staikos <staikos@kde.org>
1801 * JavaScriptCore.pri:
1803 2007-06-20 Mark Rowe <mrowe@apple.com>
1807 Fix http://bugs.webkit.org/show_bug.cgi?id=14244
1808 Bug 14244: Data corruption when using a replace() callback function with data containing "$"
1810 * kjs/string_object.cpp:
1811 (KJS::replace): When 'replacement' is a function, do not replace $n placeholders in its return value.
1812 This matches the behaviour described in ECMA 262 3rd Ed section 15.5.4.1, and as implemented in Firefox.
1814 2007-06-14 Anders Carlsson <andersca@apple.com>
1818 * bindings/runtime_object.cpp:
1819 (RuntimeObjectImp::canPut):
1821 2007-06-14 Anders Carlsson <andersca@apple.com>
1825 <rdar://problem/5103077>
1826 Crash at _NPN_ReleaseObject when quitting page at http://eshop.macsales.com/shop/ModBook
1828 <rdar://problem/5183692>
1829 http://bugs.webkit.org/show_bug.cgi?id=13547
1830 REGRESSION: Crash in _NPN_ReleaseObject when closing Safari on nba.com (13547)
1832 <rdar://problem/5261499>
1833 CrashTracer: [USER] 75 crashes in Safari at com.apple.JavaScriptCore: KJS::Bindings::CInstance::~CInstance + 40
1835 Have the root object track all live instances of RuntimeObjectImp. When invalidating
1836 the root object, also invalidate all live runtime objects by zeroing out their instance ivar.
1837 This prevents instances from outliving their plug-ins which lead to crashes.
1839 * bindings/c/c_utility.cpp:
1840 (KJS::Bindings::convertValueToNPVariant):
1841 * bindings/jni/jni_jsobject.cpp:
1842 (JavaJSObject::convertValueToJObject):
1843 * bindings/jni/jni_utility.cpp:
1844 (KJS::Bindings::convertValueToJValue):
1845 * bindings/objc/objc_runtime.mm:
1846 (ObjcFallbackObjectImp::callAsFunction):
1847 * bindings/runtime_array.cpp:
1848 (RuntimeArray::RuntimeArray):
1849 * bindings/runtime_array.h:
1850 (KJS::RuntimeArray::getConcreteArray):
1851 * bindings/runtime_method.cpp:
1852 (RuntimeMethod::callAsFunction):
1853 * bindings/runtime_method.h:
1854 * bindings/runtime_object.cpp:
1855 (RuntimeObjectImp::RuntimeObjectImp):
1856 (RuntimeObjectImp::~RuntimeObjectImp):
1857 (RuntimeObjectImp::invalidate):
1858 (RuntimeObjectImp::fallbackObjectGetter):
1859 (RuntimeObjectImp::fieldGetter):
1860 (RuntimeObjectImp::methodGetter):
1861 (RuntimeObjectImp::getOwnPropertySlot):
1862 (RuntimeObjectImp::put):
1863 (RuntimeObjectImp::canPut):
1864 (RuntimeObjectImp::defaultValue):
1865 (RuntimeObjectImp::implementsCall):
1866 (RuntimeObjectImp::callAsFunction):
1867 (RuntimeObjectImp::getPropertyNames):
1868 (RuntimeObjectImp::throwInvalidAccessError):
1869 * bindings/runtime_object.h:
1870 * bindings/runtime_root.cpp:
1871 (KJS::Bindings::RootObject::invalidate):
1872 (KJS::Bindings::RootObject::addRuntimeObject):
1873 (KJS::Bindings::RootObject::removeRuntimeObject):
1874 * bindings/runtime_root.h:
1876 2007-06-14 Anders Carlsson <andersca@apple.com>
1880 <rdar://problem/5244948>
1881 Safari keeps on complaining about slow script playing NBC TV video (14133)
1883 http://bugs.webkit.org/show_bug.cgi?id=14133
1884 Runaway JavaScript timer fires when spinning around in Google Maps street view
1886 Make sure to start and stop the timeout checker around calls to JS.
1888 * bindings/NP_jsobject.cpp:
1889 (_NPN_InvokeDefault):
1892 * bindings/jni/jni_jsobject.cpp:
1893 (JavaJSObject::call):
1894 (JavaJSObject::eval):
1896 2007-06-13 Darin Adler <darin@apple.com>
1898 Reviewed by Mark Rowe.
1900 - fix http://bugs.webkit.org/show_bug.cgi?id=14132
1901 array sort with > 10000 elements sets elements > 10000 undefined
1903 Test: fast/js/sort-large-array.html
1905 * kjs/array_instance.h: Replaced pushUndefinedObjectsToEnd with
1906 compactForSorting, and removed ExecState parameters.
1908 * kjs/array_object.cpp:
1909 (ArrayInstance::sort): Changed to call compactForSorting.
1910 (ArrayInstance::compactForSorting): Do the get and delete of the
1911 properties directly on the property map instead of using public
1912 calls from JSObject. The public calls would just read the undefined
1913 values from the compacted sort results array!
1915 2007-06-13 George Staikos <staikos@kde.org>
1919 Fix Mac OS X build after last checkin.
1923 2007-06-14 Lars Knoll <lars@trolltech.com>
1927 Disable FastMalloc for the Qt build and make sure we
1928 don't reimplement the global new/delete operators
1929 when using the system malloc.
1931 * wtf/FastMalloc.cpp:
1935 2007-06-13 Anders Carlsson <andersca@apple.com>
1939 Make sure that bindings instances get correct root objects.
1941 * JavaScriptCore.exp:
1942 * bindings/NP_jsobject.cpp:
1943 (listFromVariantArgs):
1944 (_NPN_InvokeDefault):
1947 * bindings/c/c_instance.cpp:
1948 (KJS::Bindings::CInstance::invokeMethod):
1949 (KJS::Bindings::CInstance::invokeDefaultMethod):
1950 * bindings/c/c_runtime.cpp:
1951 (KJS::Bindings::CField::valueFromInstance):
1952 * bindings/c/c_utility.cpp:
1953 (KJS::Bindings::convertNPVariantToValue):
1954 * bindings/c/c_utility.h:
1955 * bindings/objc/objc_instance.mm:
1956 (ObjcInstance::invokeMethod):
1957 (ObjcInstance::invokeDefaultMethod):
1958 (ObjcInstance::getValueOfUndefinedField):
1959 * bindings/objc/objc_runtime.mm:
1960 (ObjcField::valueFromInstance):
1961 (ObjcArray::valueAt):
1962 * bindings/objc/objc_utility.h:
1963 * bindings/objc/objc_utility.mm:
1964 (KJS::Bindings::convertObjcValueToValue):
1965 * bindings/runtime.h:
1967 2007-06-13 Simon Hausmann <hausmann@kde.org>
1971 * kjs/testkjs.pro: WebKitQt is now called QtWebKit.
1973 2007-06-12 Anders Carlsson <andersca@apple.com>
1977 * bindings/qt/qt_instance.cpp:
1978 (KJS::Bindings::QtInstance::invokeMethod):
1980 2007-06-12 Anders Carlsson <andersca@apple.com>
1984 Move the notion of field type to the JNI runtime since that's the only
1985 one that was actually using it.
1987 * bindings/c/c_runtime.h:
1988 (KJS::Bindings::CField::CField):
1989 * bindings/jni/jni_runtime.h:
1990 * bindings/objc/objc_runtime.h:
1991 * bindings/objc/objc_runtime.mm:
1992 * bindings/qt/qt_runtime.h:
1993 * bindings/runtime.h:
1994 * bindings/runtime_method.cpp:
1996 2007-06-12 Anders Carlsson <andersca@apple.com>
2000 * bindings/qt/qt_class.cpp:
2001 (KJS::Bindings::QtClass::methodsNamed):
2002 * bindings/qt/qt_instance.cpp:
2003 (KJS::Bindings::QtInstance::invokeMethod):
2005 2007-06-12 Anders Carlsson <andersca@apple.com>
2009 Get rid of the MethodList class and use a good ol' Vector instead.
2011 * bindings/c/c_class.cpp:
2012 (KJS::Bindings::CClass::methodsNamed):
2013 * bindings/c/c_instance.cpp:
2014 (KJS::Bindings::CInstance::invokeMethod):
2015 * bindings/jni/jni_class.cpp:
2016 (JavaClass::JavaClass):
2017 (JavaClass::~JavaClass):
2018 * bindings/jni/jni_instance.cpp:
2019 (JavaInstance::invokeMethod):
2020 * bindings/objc/objc_class.mm:
2021 (KJS::Bindings::ObjcClass::methodsNamed):
2022 * bindings/objc/objc_instance.mm:
2023 (ObjcInstance::invokeMethod):
2024 * bindings/objc/objc_runtime.mm:
2025 (ObjcFallbackObjectImp::callAsFunction):
2026 * bindings/runtime.cpp:
2027 * bindings/runtime.h:
2028 * bindings/runtime_method.cpp:
2029 (RuntimeMethod::lengthGetter):
2030 (RuntimeMethod::callAsFunction):
2031 * bindings/runtime_object.cpp:
2032 (RuntimeObjectImp::getOwnPropertySlot):
2034 2007-06-12 Anders Carlsson <andersca@apple.com>
2038 Make RuntimeMethod's method list a pointer so that the object size doesn't
2039 grow beyond 32 bytes when we later will replace MethodList with a Vector.
2041 * bindings/runtime_method.cpp:
2042 (RuntimeMethod::RuntimeMethod):
2043 (RuntimeMethod::lengthGetter):
2044 (RuntimeMethod::callAsFunction):
2045 * bindings/runtime_method.h:
2047 2007-06-12 Anders Carlsson <andersca@apple.com>
2051 Get rid of the Parameter class.
2053 * bindings/jni/jni_instance.cpp:
2054 (JavaInstance::invokeMethod):
2055 * bindings/jni/jni_runtime.cpp:
2056 (JavaMethod::signature):
2057 * bindings/jni/jni_runtime.h:
2058 (KJS::Bindings::JavaParameter::JavaParameter):
2059 (KJS::Bindings::JavaParameter::~JavaParameter):
2060 (KJS::Bindings::JavaParameter::type):
2061 (KJS::Bindings::JavaMethod::parameterAt):
2062 (KJS::Bindings::JavaMethod::numParameters):
2063 * bindings/runtime.h:
2065 2007-06-12 Anders Carlsson <andersca@apple.com>
2069 * bindings/qt/qt_class.h:
2071 2007-06-12 Mark Rowe <mrowe@apple.com>
2075 * bindings/objc/objc_runtime.h:
2077 2007-06-12 Anders Carlsson <andersca@apple.com>
2081 Get rid of Constructor and its only subclass JavaConstructor.
2083 * bindings/c/c_class.h:
2084 * bindings/jni/jni_class.cpp:
2085 (JavaClass::JavaClass):
2086 (JavaClass::~JavaClass):
2087 * bindings/jni/jni_class.h:
2088 * bindings/jni/jni_runtime.cpp:
2089 * bindings/jni/jni_runtime.h:
2090 * bindings/objc/objc_class.h:
2091 * bindings/runtime.h:
2093 2007-06-12 Anders Carlsson <andersca@apple.com>
2097 Use RetainPtr throughout the bindings code.
2099 * bindings/objc/objc_class.h:
2100 * bindings/objc/objc_class.mm:
2101 (KJS::Bindings::ObjcClass::ObjcClass):
2102 (KJS::Bindings::ObjcClass::methodsNamed):
2103 (KJS::Bindings::ObjcClass::fieldNamed):
2104 * bindings/objc/objc_instance.h:
2105 (KJS::Bindings::ObjcInstance::getObject):
2106 * bindings/objc/objc_instance.mm:
2107 (ObjcInstance::ObjcInstance):
2108 (ObjcInstance::~ObjcInstance):
2109 (ObjcInstance::implementsCall):
2110 (ObjcInstance::invokeMethod):
2111 (ObjcInstance::invokeDefaultMethod):
2112 (ObjcInstance::defaultValue):
2113 * bindings/objc/objc_runtime.h:
2114 (KJS::Bindings::ObjcMethod::setJavaScriptName):
2115 (KJS::Bindings::ObjcMethod::javaScriptName):
2116 (KJS::Bindings::ObjcArray::getObjcArray):
2117 * bindings/objc/objc_runtime.mm:
2119 (ObjcArray::ObjcArray):
2120 (ObjcArray::setValueAt):
2121 (ObjcArray::valueAt):
2122 (ObjcArray::getLength):
2125 2007-06-12 Anders Carlsson <andersca@apple.com>
2129 Have JSCell inherit from Noncopyable.
2131 * bindings/objc/objc_runtime.h:
2132 * bindings/runtime_object.h:
2135 2007-06-12 Anders Carlsson <andersca@apple.com>
2137 Reviewed by Darin and Maciej.
2139 More cleanup. Use our Noncopyable WTF class, add a root object member
2142 * bindings/c/c_class.h:
2143 * bindings/jni/jni_class.h:
2144 * bindings/jni/jni_instance.h:
2145 * bindings/jni/jni_runtime.cpp:
2146 (JavaArray::JavaArray):
2147 * bindings/jni/jni_runtime.h:
2148 * bindings/objc/objc_class.h:
2149 * bindings/objc/objc_runtime.h:
2150 * bindings/objc/objc_runtime.mm:
2151 (ObjcArray::ObjcArray):
2152 * bindings/objc/objc_utility.mm:
2153 (KJS::Bindings::convertObjcValueToValue):
2154 * bindings/runtime.cpp:
2155 (KJS::Bindings::Array::Array):
2156 (KJS::Bindings::Array::~Array):
2157 * bindings/runtime.h:
2158 * bindings/runtime_object.h:
2159 * bindings/runtime_root.h:
2161 2007-06-08 Zack Rusin <zrusin@trolltech.com>
2165 * bindings/qt/qt_instance.cpp:
2166 (KJS::Bindings::QtInstance::QtInstance):
2167 * bindings/qt/qt_instance.h:
2169 2007-06-07 Anders Carlsson <andersca@apple.com>
2173 Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.
2175 * bindings/c/c_instance.cpp:
2176 (KJS::Bindings::CInstance::CInstance):
2177 * bindings/c/c_instance.h:
2178 * bindings/jni/jni_instance.cpp:
2179 (JavaInstance::JavaInstance):
2180 * bindings/jni/jni_instance.h:
2181 * bindings/jni/jni_jsobject.cpp:
2182 (JavaJSObject::convertJObjectToValue):
2183 * bindings/objc/objc_instance.h:
2184 * bindings/objc/objc_instance.mm:
2185 (ObjcInstance::ObjcInstance):
2186 * bindings/runtime.cpp:
2187 (KJS::Bindings::Instance::Instance):
2188 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2189 * bindings/runtime.h:
2191 2007-06-07 Anders Carlsson <andersca@apple.com>
2195 Don't use a JavaInstance to store the field when all we want to do is to keep the field
2196 from being garbage collected. Instead, use a JObjectWrapper.
2198 * bindings/jni/jni_instance.h:
2199 * bindings/jni/jni_runtime.cpp:
2200 (JavaField::JavaField):
2201 (JavaField::dispatchValueFromInstance):
2202 (JavaField::dispatchSetValueToInstance):
2203 * bindings/jni/jni_runtime.h:
2204 (KJS::Bindings::JavaField::JavaField):
2205 (KJS::Bindings::JavaField::operator=):
2207 2007-05-30 Alp Toker <alp.toker@collabora.co.uk>
2211 Enable logging in the Gdk port.
2212 http://bugs.webkit.org/show_bug.cgi?id=13936
2214 * wtf/Assertions.cpp:
2215 * wtf/Assertions.h: Add WTFLogVerbose which also logs
2216 the file, line number and function.
2218 2007-05-30 Mark Rowe <mrowe@apple.com>
2220 Mac build fix. Update #include.
2222 * API/JSCallbackFunction.h:
2224 2007-05-30 Luciano Montanaro <mikelima@cirulla.net>
2228 - cross-port Harri Porten's commits 636099 and 636108 from KJS:
2229 "publish a class anyway public already" and "class is being used from
2230 outside for quite some time" in preparation for further syncronizations
2233 * kjs/date_object.cpp:
2234 * kjs/date_object.h:
2237 (KJS::InternalFunctionImp::classInfo):
2238 (KJS::InternalFunctionImp::functionName):
2239 * kjs/function_object.h:
2242 (KJS::getStaticPropertySlot):
2243 (KJS::getStaticFunctionSlot):
2244 (KJS::getStaticValueSlot):
2245 * kjs/object_object.h:
2247 2007-05-29 Sam Weinig <sam@webkit.org>
2249 Reviewed by Adam Roben.
2251 Cleanup function and fix to match comparison API.
2253 * kjs/string_object.cpp:
2254 (KJS::substituteBackreferences):
2255 (KJS::localeCompare):
2257 2007-05-28 Geoffrey Garen <ggaren@apple.com>
2259 Slight clarification to an exception message.
2261 * API/JSCallbackObject.cpp:
2262 (KJS::JSCallbackObject::put):
2264 2007-05-27 Holger Freyther <zecke@selfish.org>
2266 Reviewed by Mark Rowe.
2268 * wtf/Platform.h: Move Gdk up to allow building WebKit/Gdk on Darwin
2270 2007-05-27 Darin Adler <darin@apple.com>
2272 - fix a couple ifdefs that said WIN instead of WIN_OS
2274 * kjs/collector.cpp:
2275 (KJS::allocateBlock): WIN -> WIN_OS
2276 (KJS::freeBlock): Ditto.
2278 2007-05-26 Sam Weinig <sam@webkit.org>
2282 Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
2283 Port of commit 667785 from kjs
2285 - special case calling String.localeCompare() with no parameters to return 0.
2287 * kjs/string_object.cpp:
2288 (KJS::StringProtoFunc::callAsFunction):
2290 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
2294 - Fix for http://bugs.webkit.org/show_bug.cgi?id=13456
2295 REGRESSION: setTimeout "arguments" object gets shadowed by a local variable
2297 - Add a explicit check for arguments. Previously check was done with getDirect,
2298 but since the arguments is created on-demand in ActivationImp, it doesn't
2299 show up in the test. 'arguments' should always be in the VarDeclNode's
2303 (VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'
2305 2007-05-25 George Staikos <staikos@kde.org>
2309 - Use COMPILER(GCC), not PLATFORM(GCC) - as Platform.h defines
2313 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
2317 - http://bugs.webkit.org/show_bug.cgi?id=13623 (Decompilation of function
2318 doesn't compile with "++(x,y)")
2319 - Create the error node based on the actual node, not the node inside
2321 - Fix applies to postfix, prefix and typeof operators
2322 - Produces run-time ReferenceError like other non-lvalue assignments etc.
2324 * kjs/grammar.y: Create {Prefix,Postfix}ErrorNode based on the actual node,
2325 not the based on the node returned by "nodeInsideAllParens()". Same for
2328 2007-05-25 Simon Hausmann <hausmann@kde.org>
2332 Fix crash in Qt JavaScript bindings when the arguments used on the Qt side are not
2333 registered with QMetaType.
2335 * bindings/qt/qt_instance.cpp:
2336 (KJS::Bindings::QtInstance::invokeMethod):
2337 * bindings/qt/qt_runtime.cpp:
2339 2007-05-24 Luciano Montanaro <mikelima@cirulla.net>
2343 Patch for http://bugs.webkit.org/show_bug.cgi?id=13855
2344 Port patch 666176 to JavaScriptCore
2346 - Renamed JSValue::downcast() to JSValue::asCell() which makes the
2347 function meaning cleaner. It's modeled after Harri Porten change in
2350 * kjs/collector.cpp:
2351 (KJS::Collector::protect):
2352 (KJS::Collector::unprotect):
2353 (KJS::Collector::collectOnMainThreadOnly):
2355 (KJS::JSValue::isObject):
2356 * kjs/string_object.cpp:
2357 (KJS::StringProtoFunc::callAsFunction):
2359 (KJS::JSValue::asCell):
2360 (KJS::JSValue::isNumber):
2361 (KJS::JSValue::isString):
2362 (KJS::JSValue::isObject):
2363 (KJS::JSValue::getNumber):
2364 (KJS::JSValue::getString):
2365 (KJS::JSValue::getObject):
2366 (KJS::JSValue::getUInt32):
2367 (KJS::JSValue::mark):
2368 (KJS::JSValue::marked):
2369 (KJS::JSValue::type):
2370 (KJS::JSValue::toPrimitive):
2371 (KJS::JSValue::toBoolean):
2372 (KJS::JSValue::toNumber):
2373 (KJS::JSValue::toString):
2374 (KJS::JSValue::toObject):
2376 2007-05-18 Holger Hans Peter Freyther <zecke@selfish.org>
2378 Reviewed by Mark Rowe.
2380 * kjs/testkjs.pro: Make the Gdk port link to icu
2382 2007-05-15 Geoffrey Garen <ggaren@apple.com>
2384 Reviewed by Adele Peterson.
2386 It helps if you swap the right variable.
2391 2007-05-15 Lars Knoll <lars@trolltech.com>
2395 Extend the QObject JavaScript bindings to work for slots with
2398 * bindings/qt/qt_instance.cpp:
2399 (KJS::Bindings::QtInstance::invokeMethod):
2401 2007-05-14 Kimmo Kinnunen <kimmok@iki.fi>
2405 - Fixes http://bugs.webkit.org/show_bug.cgi?id=13622 (Decompiler
2406 omits trailing comma in array literal)
2408 * kjs/nodes2string.cpp:
2409 (ArrayNode::streamTo): print extra ',' in case there was elision
2410 commas (check opt member var) and array elements present
2411 in the array expression
2413 2007-05-14 Geoffrey Garen <ggaren@apple.com>
2415 Reviewed by Oliver Hunt.
2417 Added HashMap::swap and HashSet::swap. WebCore now uses HashSet::swap.
2418 I figured while I was in the neighborhood I might as well add HashMap::swap,
2428 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
2432 - Fix for bug http://bugs.webkit.org/show_bug.cgi?id=13620
2433 Bogus decompilation of "for (var j = 1 in [])"
2434 - ForInNode toString()'ed to syntax error if there was var decl
2436 - ForNode toStringed()'ed lost 'var ' if it was present
2438 * kjs/nodes2string.cpp:
2439 (VarDeclListNode::streamTo): Print "var " here
2440 (VarStatementNode::streamTo): Don't print "var " here
2441 (ForNode::streamTo): Remove TODO comment, VarDeclListNode will
2443 (ForInNode::streamTo): ForIn initializer is printed by VarDeclNode
2445 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
2449 - Fixes http://bugs.webkit.org/show_bug.cgi?id=10878
2450 (Incorrect decompilation for "4..x")
2451 - Group numbers in dotted expressions in toString() output, so we
2452 avoid the 4.x constructs when the original input is 4..x.
2453 4..x means the same as 4. .x or (4).x or Number(4).x
2455 * kjs/nodes2string.cpp:
2456 (KJS::SourceStream::):
2457 Add boolean flag to indicate that if next item is a number, it should be grouped.
2458 Add new formatting enum which turns on the boolean flag.
2459 (KJS::SourceStream::SourceStream): Added. Initialize the flag.
2460 (SourceStream::operator<<): Added. New overloaded operator with double value as parameter.
2461 (NumberNode::streamTo): Use the double operator
2462 (ArrayNode::streamTo):
2463 (DotAccessorNode::streamTo):
2464 (FunctionCallDotNode::streamTo):
2465 (FunctionCallParenDotNode::streamTo):
2466 (PostfixDotNode::streamTo):
2467 (DeleteDotNode::streamTo):
2468 (PrefixDotNode::streamTo):
2469 (AssignDotNode::streamTo): Use the new formatting enum to turn on the grouping flag.
2471 2007-05-10 Lars Knoll <lars@trolltech.com>
2475 Fix our last three test failures in the JavaScript
2478 * wtf/unicode/qt4/UnicodeQt4.h:
2479 (WTF::Unicode::toLower):
2480 (WTF::Unicode::toUpper):
2482 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2484 Reviewed by Darin Adler.
2486 Fixed #includes of JSStringRefCF.h and use of CF datatypes. I think I
2487 misunderstood this issue before.
2489 * API/JavaScriptCore.h: #include JSStringRefCF.h. Platforms that don't
2490 want this behavior can just #include individual headers, instead of the
2491 umbrella framework header. But we definitely want Mac OS X clients to
2492 get the #include of JSStringRefCF.h "for free."
2493 * API/minidom.c: Don't #include JSStringRefCF.h. (Don't need to #include
2494 JavaScriptCore.h, either.)
2495 * API/testapi.c: Don't #include JSStringRefCF.h. Do use CF datatypes
2496 regardless of whether __APPLE__ is defined. Platforms that don't support
2497 CF just shouldn't compile this file.
2500 2007-05-09 Eric Seidel <eric@webkit.org>
2504 http://bugs.webkit.org/show_bug.cgi?id=6985
2505 Cyclic __proto__ values cause WebKit to hang
2508 (KJS::JSObject::put): do a cycle check before setting __proto__
2510 2007-05-08 Kimmo Kinnunen <kimmok@iki.fi>
2512 Reviewed by darin. Landed by eseidel.
2514 - http://bugs.webkit.org/show_bug.cgi?id=10880 (Do..while loop gains
2515 a semicolon each time it is toStringed)
2516 Grammar in Ecma-66262, 12.6: "do Statement while ( Expression );"
2517 EmptyStatement was created after every do..while(expr) which
2518 had semicolon at the end.
2520 * kjs/grammar.y: Require semicolon at the end of do..while
2522 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2524 Build fix -- this time for sure.
2526 APICast.h, being private, ends up in a different folder than JSValueRef.h,
2527 so we can't include one from the other using "". Instead, just forward
2528 declare the relevant data types.
2532 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2534 Build fix: export APICast.h for WebCore and WebKit.
2536 * JavaScriptCore.xcodeproj/project.pbxproj:
2538 2007-05-04 Darin Adler <darin@apple.com>
2542 - fix http://bugs.webkit.org/show_bug.cgi?id=12821
2543 <rdar://problem/5007921> Number.toExponential doesn't work for negative numbers
2545 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2546 Added a call to fabs before calling log10.
2548 2007-05-03 Holger Freyther <freyther@kde.org>
2550 Reviewed by Zack, landed by Simon.
2551 This is bugzilla bug 13499.
2553 * JavaScriptCore.pri: Place Qt into the qt-port scope
2554 * bindings/testbindings.pro: Place Qt into the qt-port scope
2555 * kjs/testkjs.pro: Place Qt into the qt-port scope
2556 * pcre/pcre.pri: Place Qt into the qt-port scope
2558 2007-05-02 David Harrison <harrison@apple.com>
2562 <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
2564 Added insertion support for more than one value.
2568 Added support for inserting multiple values.
2571 New. Insert at the start of vectors. Convenient for vectors used as strings.
2573 2007-05-01 Jungshik Shin <jungshik.shin@gmail.com>
2577 - get rid of non-ASCII lteral characters : suppress compiler warnings
2578 http://bugs.webkit.org/show_bug.cgi?id=13551
2581 * pcre/pcre_compile.c:
2583 2007-04-28 Jungshik Shin <jungshik.shin@gmail.com>
2585 Reviewed by Sam Weinig.
2587 - Replace copyright sign in Latin-1 (0xA9) with '(C)'
2588 http://bugs.webkit.org/show_bug.cgi?id=13531
2590 * bindings/npruntime.h:
2592 2007-04-28 Darin Adler <darin@apple.com>
2596 - fix <rdar://problem/5154144> Hamachi test fails: assertion failure in ListHashSet
2598 Test: fast/forms/add-remove-form-elements-stress-test.html
2600 * wtf/ListHashSet.h:
2601 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Initialize
2602 m_isDoneWithInitialFreeList to false.
2603 (WTF::ListHashSetNodeAllocator::allocate): Added assertions based on a debug-only
2604 m_isAllocated flag that make sure we don't allocate a block that's already allocated.
2605 These assertions helped pinpoint the bug. Set m_isDoneWithInitialFreeList when we
2606 allocate the last block of the initial free list. Once we're done with the initial
2607 free list, turn off the rule that says that the next node in the pool after the last
2608 node in the free list is also free. This rule works because any free nodes are added
2609 to the head of the free list, so a node that hasn't been allocated even once is always
2610 at the tail of the free list and all the nodes after it also haven't been allocated
2611 even once. But it doesn't work any longer once the entire pool has been used at least
2612 once, because there's nothing special about the last node on the free list any more.
2613 (WTF::ListHashSetNodeAllocator::deallocate): Set the node's m_isAllocated to false.
2614 (WTF::ListHashSetNodeAllocator::pastPool): Added. Used above.
2615 (WTF::ListHashSetNodeAllocator::inPool): Changed to use the pastPool function.
2616 (WTF::ListHashSetNode::ListHashSetNode): Initialize m_isAllocated to true.
2617 (WTF::ListHashSetNode::operator new): Removed variable name for unused size
2619 (WTF::ListHashSetNode::destroy): Changed to call the destructor rather than
2620 delete -- this gets rid of the need to define an operator delete.
2622 2007-04-27 Christopher Brichford <chrisb@adobe.com>
2624 Reviewed by Timothy Hatcher.
2626 Fix for: Bug 13211: Move JavaScriptCore mac project files for apollo port
2627 http://bugs.webkit.org/show_bug.cgi?id=13211
2629 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Debug.xcconfig: Added.
2630 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Release.xcconfig: Added.
2631 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcconfig: Added.
2632 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcodeproj/project.pbxproj: Added.
2633 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Removed.
2634 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Removed.
2635 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Removed.
2636 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Removed.
2638 2007-04-27 Holger Freyther <freyther@kde.org>
2642 Remove unmaintained CMake build system.
2644 * CMakeLists.txt: Removed.
2645 * pcre/CMakeLists.txt: Removed.
2647 2007-04-27 Mark Rowe <mrowe@apple.com>
2651 * JavaScriptCore.xcodeproj/project.pbxproj: Improve dependencies in Xcode project
2652 by marking dftables as a dependency of Generate Derived Sources rather than of
2653 JavaScriptCore itself.
2655 2007-04-26 Geoffrey Garen <ggaren@apple.com>
2657 Build fix -- added #includes that we used to get implicitly through
2665 2007-04-26 Geoffrey Garen <ggaren@apple.com>
2667 Reviewed by Maciej Stachowiak, Adam Roben.
2670 <rdar://problem/4885130> Remove #include of JSStringRefCF.h from JSStringRef.h
2671 <rdar://problem/4885123> JavaScriptCore is not cross-platform -- JSStringRef.h references CF datatypes
2673 * API/JSStringRef.h: Removed #include -- no clients need it anymore.
2675 2007-04-25 David Kilzer <ddkilzer@apple.com>
2679 Add assertions for debug builds.
2682 (KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
2683 (KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.
2685 2007-04-25 Maciej Stachowiak <mjs@apple.com>
2689 - fix build problems
2691 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable warning that
2692 gives often downright incorrect results based on guessing what will happen in 64-bit.
2694 2007-04-25 Darin Adler <darin@apple.com>
2698 - tweak the allocator for a small speedup -- Shark showed this was a win, but I can't
2699 measure an improvement right now, but it's also clear these changes do no harm
2701 * wtf/FastMalloc.cpp:
2702 (WTF::LgFloor): Use ALWAYS_INLINE here; in testing I did a while back this was necessary
2703 to get this single-instruction function to be inlined.
2704 (WTF::SizeClass): Use ALWAYS_INLINE here too for the same reason. Also change the special
2705 case for a size of 0 to work without a branch for a bit of extra speed.
2706 (WTF::ByteSizeForClass): Use ALWAYS_INLINE here too for the same reason.
2708 2007-04-24 Maciej Stachowiak <mjs@apple.com>
2712 - use custom calling convention for everything in nodes.cpp on intel gcc for 1.5% speed boost
2714 Nearly all functions in nodes.cpp were marked up to use the
2715 regparm(3) calling convention under GCC for x86, since this is
2716 faster and they are all guaranteed to be called only internally to
2719 The only exception is destructors, since delete doesn't know how to use a custom calling convention.
2722 (dotExprDoesNotAllowCallsString):
2725 (KJS::StatementNode::):
2727 (KJS::BooleanNode::):
2728 (KJS::NumberNode::):
2729 (KJS::StringNode::):
2730 (KJS::RegExpNode::):
2732 (KJS::ResolveNode::):
2734 (KJS::ElementNode::):
2736 (KJS::PropertyNameNode::):
2737 (KJS::PropertyNode::):
2738 (KJS::PropertyListNode::):
2739 (KJS::ObjectLiteralNode::):
2740 (KJS::BracketAccessorNode::):
2741 (KJS::DotAccessorNode::):
2742 (KJS::ArgumentListNode::):
2743 (KJS::ArgumentsNode::):
2744 (KJS::NewExprNode::):
2745 (KJS::FunctionCallValueNode::):
2746 (KJS::FunctionCallResolveNode::):
2747 (KJS::FunctionCallBracketNode::):
2748 (KJS::FunctionCallParenBracketNode::):
2749 (KJS::FunctionCallDotNode::):
2750 (KJS::FunctionCallParenDotNode::):
2751 (KJS::PostfixResolveNode::):
2752 (KJS::PostfixBracketNode::):
2753 (KJS::PostfixDotNode::):
2754 (KJS::PostfixErrorNode::):
2755 (KJS::DeleteResolveNode::):
2756 (KJS::DeleteBracketNode::):
2757 (KJS::DeleteDotNode::):
2758 (KJS::DeleteValueNode::):
2760 (KJS::TypeOfResolveNode::):
2761 (KJS::TypeOfValueNode::):
2762 (KJS::PrefixResolveNode::):
2763 (KJS::PrefixBracketNode::):
2764 (KJS::PrefixDotNode::):
2765 (KJS::PrefixErrorNode::):
2766 (KJS::UnaryPlusNode::):
2767 (KJS::NegateNode::):
2768 (KJS::BitwiseNotNode::):
2769 (KJS::LogicalNotNode::):
2773 (KJS::RelationalNode::):
2775 (KJS::BitOperNode::):
2776 (KJS::BinaryLogicalNode::):
2777 (KJS::ConditionalNode::):
2778 (KJS::AssignResolveNode::):
2779 (KJS::AssignBracketNode::):
2780 (KJS::AssignDotNode::):
2781 (KJS::AssignErrorNode::):
2783 (KJS::AssignExprNode::):
2784 (KJS::VarDeclListNode::):
2785 (KJS::VarStatementNode::):
2786 (KJS::EmptyStatementNode::):
2787 (KJS::ExprStatementNode::):
2789 (KJS::DoWhileNode::):
2792 (KJS::ContinueNode::):
2794 (KJS::ReturnNode::):
2799 (KJS::ParameterNode::):
2801 (KJS::FunctionBodyNode::):
2802 (KJS::FuncExprNode::):
2803 (KJS::FuncDeclNode::):
2804 (KJS::SourceElementsNode::):
2805 (KJS::CaseClauseNode::):
2806 (KJS::ClauseListNode::):
2807 (KJS::SwitchNode::):
2809 2007-04-24 Oliver Hunt <oliver@apple.com>
2811 GTK Build fix, ::findEntry->KJS::findEntry
2814 (KJS::Lookup::findEntry):
2815 (KJS::Lookup::find):
2817 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2821 - compile most of JavaScriptCore as one file for 4% JS iBench speed improvement
2823 * JavaScriptCore.xcodeproj/project.pbxproj: Add AllInOneFile.cpp, and remove files it includes
2825 * kjs/AllInOneFile.cpp: Added.
2826 * kjs/dtoa.cpp: Renamed CONST to CONST_ to avoid conflict.
2828 (Bigint::nrv_alloc):
2829 * kjs/lookup.cpp: Use "namspace KJS { ... }" instead of "using namespace KJS;"
2831 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2833 Build fix, not reviewed.
2835 * kjs/collector.h: Fix struct/class mismatch.
2837 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2841 - raise ALLOCATIONS_PER_COLLECTION to 4000, for 3.7% iBench speed improvement
2843 Now that the cell size is smaller and the block size is bigger, we can fit 4000 objects in
2844 the two spare cells the collector is willing to keep around, so collect a bit less often.
2846 * kjs/collector.cpp:
2848 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2850 Reviewed by Darin and Geoff.
2852 - move mark and collectOnMainThreadOnly bits into separate bitmaps
2854 This saves 4 bytes per cell, allowing shrink of cell size to 32,
2855 which leads to a .8% speed improvement on iBench.
2857 This is only feasible because of all the previous changes on the branch.
2859 * kjs/collector.cpp:
2860 (KJS::allocateBlock): Adjust for some renames of constants.
2861 (KJS::Collector::markStackObjectsConservatively): Now that cells are 32 bytes (64
2862 bytes on 64-bit) the cell alignment check can be made much more strict, and also
2863 obsoletes the need for a % sizeof(CollectorCell) check. Also, we can mask off the low
2864 bits of the pointer to have a potential block pointer to look for.
2865 (KJS::Collector::collectOnMainThreadOnly): Use bitmap.
2866 (KJS::Collector::markMainThreadOnlyObjects): Use bitmap.
2867 (KJS::Collector::collect): When sweeping, use bitmaps directly to find mark bits.
2869 (KJS::): Move needed constants and type declarations here.
2870 (KJS::CollectorBitmap::get): Bit twiddling to get a bitmap value.
2871 (KJS::CollectorBitmap::set): Bit twiddling to set a bitmap bit to true.
2872 (KJS::CollectorBitmap::clear): Bit twiddling to set a bitmap bit to false.
2873 (KJS::CollectorBitmap::clearAll): Clear whole bitmap at one go.
2874 (KJS::Collector::cellBlock): New operation, compute the block pointer for
2875 a cell by masking off low bits.
2876 (KJS::Collector::cellOffset): New operation, compute the cell offset for a
2877 cell by masking off high bits and dividing (actually a shift).
2878 (KJS::Collector::isCellMarked): Check mark bit in bitmap
2879 (KJS::Collector::markCell): Set mark bit in bitmap.
2881 (KJS::JSCell::JSCell): No more bits.
2882 (KJS::JSCell::marked): Let collector handle it.
2883 (KJS::JSCell::mark): Let collector handle it.
2885 2007-04-23 Anders Carlsson <andersca@apple.com>
2889 * kjs/regexp_object.h:
2890 RegExpObjectImpPrivate is a struct, not a class.
2892 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2896 - shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body
2898 I reconciled this with a similar change in KDE kjs by Maks Orlovich <maksim@kde.org>.
2901 (KJS::FunctionImp::callAsFunction):
2902 (KJS::FunctionImp::passInParameters):
2903 (KJS::FunctionImp::lengthGetter):
2904 (KJS::FunctionImp::getParameterName):
2906 * kjs/function_object.cpp:
2907 (FunctionProtoFunc::callAsFunction):
2908 (FunctionObjectImp::construct):
2910 (FunctionBodyNode::addParam):
2911 (FunctionBodyNode::paramString):
2912 (FuncDeclNode::addParams):
2913 (FuncDeclNode::processFuncDecl):
2914 (FuncExprNode::addParams):
2915 (FuncExprNode::evaluate):
2917 (KJS::Parameter::Parameter):
2918 (KJS::FunctionBodyNode::numParams):
2919 (KJS::FunctionBodyNode::paramName):
2920 (KJS::FunctionBodyNode::parameters):
2921 (KJS::FuncExprNode::FuncExprNode):
2922 (KJS::FuncDeclNode::FuncDeclNode):
2923 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because
2924 they handle size_t badly.
2926 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2930 - shrink RegexpObjectImp by 4 bytes
2932 Somewhat inexplicably, this seems to be a .33% speedup on JS iBench.
2934 * kjs/regexp_object.cpp:
2935 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate):
2936 (RegExpObjectImp::RegExpObjectImp):
2937 (RegExpObjectImp::performMatch):
2938 (RegExpObjectImp::arrayOfMatches):
2939 (RegExpObjectImp::getBackref):
2940 (RegExpObjectImp::getLastMatch):
2941 (RegExpObjectImp::getLastParen):
2942 (RegExpObjectImp::getLeftContext):
2943 (RegExpObjectImp::getRightContext):
2944 (RegExpObjectImp::getValueProperty):
2945 (RegExpObjectImp::putValueProperty):
2946 * kjs/regexp_object.h:
2948 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2952 - change to 1-bit bitfields instead of 8-bit, this turns out to lead to a .51% speedup on JS iBench
2954 The 1-bit bitfields are actually faster than just plain bools, at least on Intel (go figure).
2956 * kjs/property_map.h:
2958 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2962 - shrink ArrayInstance objects by 4 bytes
2963 http://bugs.webkit.org/show_bug.cgi?id=13386
2965 I did this by storing the capacity before the beginning of the storage array. It turns out
2966 it is rarely needed and is by definition 0 when the storage array is null.
2968 * kjs/array_instance.h:
2969 (KJS::ArrayInstance::capacity): Get it from the secret stash
2970 * kjs/array_object.cpp:
2971 (allocateStorage): New function to encapsulate allocating the storage with extra space ahead
2973 (reallocateStorage): ditto for realloc
2974 (ArrayInstance::ArrayInstance):
2975 (ArrayInstance::~ArrayInstance):
2976 (ArrayInstance::resizeStorage):
2978 2007-04-23 Darin Adler <darin@apple.com>
2982 - fix <rdar://problem/4840688> REGRESSION (r10588, r10621): JavaScript won't parse
2983 modifications of non-references (breaks 300themovie.warnerbros.com, fedex.com)
2985 Despite the ECMAScript specification's claim that you can treat these as syntax
2986 errors, doing so creates some website incompatibilities. So this patch turns them back
2987 into evaluation errors instead.
2989 Test: fast/js/modify-non-references.html
2991 * kjs/grammar.y: Change makeAssignNode, makePrefixNode, and makePostfixNode so that they
2992 never fail to parse. Update rules that use them. Fix a little bit of indenting. Use
2993 new PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2995 * kjs/nodes.h: Added an overload of throwError that takes a char* argument.
2996 Replaced setExceptionDetailsIfNeeded and debugExceptionIfNeeded with handleException,
2997 which does both. Added PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2999 * kjs/nodes.cpp: Changed exception macros to use handleException; simpler and smaller
3000 code size than the two functions that we used before.
3001 (Node::throwError): Added the overload mentioned above.
3002 (Node::handleException): Added. Contains the code from both setExceptionDetailsIfNeeded
3003 and debugExceptionIfNeeded.
3004 (PostfixErrorNode::evaluate): Added. Throws an exception.
3005 (PrefixErrorNode::evaluate): Ditto.
3006 (AssignErrorNode::evaluate): Ditto.
3007 (ThrowNode::execute): Call handleException instead of debugExceptionIfNeeded; this
3008 effectively adds a call to setExceptionDetailsIfNeeded, which may help with getting
3009 the correct file and line number for these exceptions.
3011 * kjs/nodes2string.cpp:
3012 (PostfixErrorNode::streamTo): Added.
3013 (PrefixErrorNode::streamTo): Added.
3014 (AssignErrorNode::streamTo): Added.
3016 2007-04-23 Maciej Stachowiak <mjs@apple.com>
3020 - fix test failures / crashes on PPC
3022 * kjs/property_map.h: Make the bool fields explicitly 8-bit bitfields, since bool is a full
3023 word there otherwise :-(
3025 2007-04-23 Maciej Stachowiak <mjs@apple.com>
3029 - fix more test case failures
3031 * bindings/runtime_array.cpp:
3032 (RuntimeArray::RuntimeArray): inherit from JSObject instead of ArrayInstance; it turns
3033 out that this class only needs the prototype and classInfo from ArrayInstance, not the
3034 actual class itself, and it was too big otherwise.
3035 (RuntimeArray::getOwnPropertySlot):
3036 * bindings/runtime_array.h:
3038 2007-04-23 Maciej Stachowiak <mjs@apple.com>
3042 - fix some test failures
3044 * bindings/runtime_method.cpp:
3045 (RuntimeMethod::RuntimeMethod): inherit from InternalFunctionImp instead of FunctionImpl,
3046 otherwise this is too big
3047 (RuntimeMethod::getOwnPropertySlot):
3048 * bindings/runtime_method.h:
3050 2007-04-22 Maciej Stachowiak <mjs@apple.com>
3054 - discard the arguments List for an ActivationImp when the corresponding Context is destroyed (1.7% speedup)
3055 http://bugs.webkit.org/show_bug.cgi?id=13385
3057 Based an idea by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>. His patch to do
3058 this also had many other List changes and I found this much simpler subset of the changes
3059 was actually a hair faster.
3061 This optimization is valid because the arguments list is only kept around to
3062 lazily make the arguments object. If it's not made by the time the function
3063 exits, it never will be, since any function that captures the continuation will
3064 have its own local arguments variable in scope.
3066 Besides the 1.7% speed improvement, it shrinks List by 4 bytes
3067 (which in turn shrinks ActivationImp by 4 bytes).
3070 (KJS::Context::~Context): Clear the activation's arguments list.
3072 (KJS::ActivationImp::ActivationImp): Adjusted for list changes.
3073 (KJS::ActivationImp::mark): No need to mark, lists are always protected (this doesn't
3074 cause a ref-cycle for reasons stated above).
3075 (KJS::ActivationImp::createArgumentsObject): Clear arguments list.
3078 (KJS::List::List): No more needsMarking boolean
3079 (KJS::List::operator=): ditto
3081 (KJS::List::List): ditto
3082 (KJS::List::reset): ditto
3083 (KJS::List::deref): ditto
3085 2007-04-22 Maciej Stachowiak <mjs@apple.com>
3089 - shrink PropertyMap by 8 bytes and therefore shrink CELL_SIZE to 40 (for 32-bit;
3090 similar shrinkage for 64-bit)
3091 http://bugs.webkit.org/show_bug.cgi?id=13384
3093 Inspired by similar changes by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>
3094 done in the kjs-tweaks branch of KDE's kjs. However, this version is somewhat
3095 cleaner style-wise and avoids some of the negative speed impact (at least on gcc/x86)
3098 This is nearly a wash performance-wise, maybe a slight slowdown, but worth doing
3099 to eventually reach cell size 32.
3101 * kjs/collector.cpp:
3103 * kjs/property_map.cpp:
3104 (KJS::PropertyMap::~PropertyMap):
3105 (KJS::PropertyMap::clear):
3106 (KJS::PropertyMap::get):
3107 (KJS::PropertyMap::getLocation):
3108 (KJS::PropertyMap::put):
3109 (KJS::PropertyMap::insert):
3110 (KJS::PropertyMap::expand):
3111 (KJS::PropertyMap::rehash):
3112 (KJS::PropertyMap::remove):
3113 (KJS::PropertyMap::mark):
3114 (KJS::PropertyMap::containsGettersOrSetters):
3115 (KJS::PropertyMap::getEnumerablePropertyNames):
3116 (KJS::PropertyMap::getSparseArrayPropertyNames):
3117 (KJS::PropertyMap::save):
3118 (KJS::PropertyMap::checkConsistency):
3119 * kjs/property_map.h:
3120 (KJS::PropertyMap::hasGetterSetterProperties):
3121 (KJS::PropertyMap::setHasGetterSetterProperties):
3122 (KJS::PropertyMap::):
3123 (KJS::PropertyMap::PropertyMap):
3125 2007-04-22 Maciej Stachowiak <mjs@apple.com>
3129 - change blocks to 64k in size, and use various platform-specific calls to allocate at 64k-aligned addresses
3130 http://bugs.webkit.org/show_bug.cgi?id=13383
3132 * kjs/collector.cpp:
3133 (KJS::allocateBlock): New function to allocate 64k of 64k-aligned memory
3134 (KJS::freeBlock): Corresponding free
3135 (KJS::Collector::allocate):
3136 (KJS::Collector::collect):
3138 2007-04-22 Maciej Stachowiak <mjs@apple.com>
3140 Reviewed by Darin and Geoff.
3142 - remove the concept of oversize objects, now that there aren't any (for now
3143 only enforced with an assert).
3144 http://bugs.webkit.org/show_bug.cgi?id=13382
3146 This change is a .66% speedup on JS iBench for 32-bit platforms, probably much more
3147 for 64-bit since it finally gives a reasonable cell size, but I did not test that.
3149 * kjs/collector.cpp:
3150 (KJS::): Use different cell size for 32-bit and 64-bit, now that there is no
3151 oversize allocation.
3152 (KJS::Collector::allocate): Remove oversize allocator.
3153 (KJS::Collector::markStackObjectsConservatively): Don't check oversize objects.
3154 (KJS::Collector::markMainThreadOnlyObjects): Ditto.
3155 (KJS::Collector::collect): Ditto.
3157 2007-04-21 Mitz Pettel <mitz@webkit.org>
3161 - fix http://bugs.webkit.org/show_bug.cgi?id=13428
3162 REGRESSION (r20973-r20976): Failing ecma/Array/15.4.4.5-3.js
3164 - fix http://bugs.webkit.org/show_bug.cgi?id=13429
3165 REGRESSION (r20973-r20976): Crashing in fast/dom/plugin-attributes-enumeration.html
3167 * kjs/array_object.cpp:
3168 (ArrayInstance::sort): Free the old storage, not the new one.
3170 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3172 Not reviewed, build fix.
3174 - fix build problem with last change - -O3 complains more about uninitialized variables
3176 * pcre/pcre_compile.c:
3180 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3184 - <rdar://problem/5149915> use mergesort when possible, since it leads to fewer compares (2% JS iBench speedup)
3186 * kjs/array_object.cpp:
3187 (ArrayInstance::sort): Use mergesort(3) on platforms that have it, since it tends
3188 to do fewer compares than qsort; but avoid it very on large arrays since it uses extra
3189 memory. Also added comments identifying possibly even better sorting algorithms
3190 for sort by string value and sort by compare function.
3193 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3197 - bump optimization flags up to -O3 for 1% JS iBench speed improvement
3199 * Configurations/Base.xcconfig:
3201 2007-04-20 Mark Rowe <mrowe@apple.com>
3205 Fix bogus optimisation in the generic pthread code path.
3207 * kjs/collector.cpp:
3208 (KJS::currentThreadStackBase):
3210 2007-04-20 Mark Rowe <mrowe@apple.com>
3214 Improve FreeBSD compatibility, as suggested by Alexander Botero-Lowry.
3216 * kjs/collector.cpp:
3217 (KJS::currentThreadStackBase): FreeBSD requires that pthread_attr_t's are
3218 initialized via pthread_attr_init before being used in any context.
3220 2007-04-19 Mark Rowe <mrowe@apple.com>
3224 Fix http://bugs.webkit.org/show_bug.cgi?id=13401
3225 Bug 13401: Reproducible crash calling myArray.sort(compareFn) from within
3226 a sort comparison function
3228 * kjs/array_object.cpp:
3229 (ArrayInstance::sort): Save/restore the static variables around calls to qsort
3230 to ensure nested calls to ArrayInstance::sort behave correctly.
3232 2007-04-12 Deneb Meketa <dmeketa@adobe.com>
3234 Reviewed by Darin Adler.
3236 http://bugs.webkit.org/show_bug.cgi?id=13029
3237 rdar://problem/4994849
3238 Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
3239 This doesn't actually change JavaScriptCore, but that's where npapi.h is.
3242 Add headers member to NPStream struct. Also increase NP_VERSION_MINOR to 18.
3243 Increasing to >= 17 allows plug-ins to safely detect whether to look for
3244 NPStream::headers. Increasing from 17 to 18 reflects presence of NPObject
3245 enumeration, which was added in a prior patch, and which has been agreed to
3246 constitute version 18 by the plugin-futures list. Also add other missing
3247 bits of npapi.h to catch up from 14 to 18. This includes features that are
3248 not implemented in WebKit, but those are safely stubbed.
3250 2007-04-10 Geoffrey Garen <ggaren@apple.com>
3252 Reviewed by Mark Rowe.
3254 Fixed last check-in to print in release builds, too.
3256 * kjs/collector.cpp:
3257 (KJS::getPlatformThreadRegisters):
3259 2007-04-10 Geoffrey Garen <ggaren@apple.com>
3261 Reviewed by John Sullivan, Darin Adler.
3263 Fixed <rdar://problem/5121899> JavaScript garbage collection leads to
3264 later crash under Rosetta (should abort or leak instead?)
3266 Log an error message and crash if the kernel reports failure during GC.
3267 We decided to do this instead of just leaking because we don't want people
3268 to get the mistaken impression that running in Rosetta is a supported
3271 The CRASH macro will also hook into CrashReporter, which will tell us if
3272 many (any?) users run into this issue.
3274 * kjs/collector.cpp:
3275 (KJS::getPlatformThreadRegisters):
3277 2007-04-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3281 Coverity fix. Coverity says:
3282 "Event var_deref_model: Variable "sourceRanges" tracked as NULL was passed to a
3283 function that dereferences it"
3285 * kjs/string_object.cpp:
3288 2007-04-06 Geoffrey Garen <ggaren@apple.com>
3290 Rubber stamped by Adele Peterson.
3292 * kjs/ExecState.h: Removed obsolete forward/friend declaration of
3295 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3299 Coverity fix. Coverity says:
3300 "Event check_after_deref: Pointer "dateString" dereferenced before NULL check"
3302 * kjs/date_object.cpp:
3305 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3309 Coverity fix. Coverity says:
3310 "Event check_after_deref: Pointer "re" dereferenced before NULL check"
3312 * pcre/pcre_study.c:
3315 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3319 Coverity fixes. Coverity says:
3320 "Event leaked_storage: Returned without freeing storage "buffer""
3322 "Event leaked_storage: Returned without freeing storage "script""
3326 (createStringWithContentsOfFile):
3328 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3332 Coverity fix: in single-threaded case currentThreadIsMainThread is always true
3333 so the code in if (!currentThreadIsMainThread) cannot possibly be reached
3334 and Coverity complains about dead code.
3336 * kjs/collector.cpp:
3337 (KJS::Collector::collect):
3339 === Safari-5522.6 ===
3341 2007-04-03 Kevin McCullough <kmccullough@apple.com>
3345 - Testing a post-commit hook.
3347 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3349 2007-04-03 Anders Carlsson <andersca@apple.com>
3353 <rdar://problem/5107534>
3354 http://bugs.webkit.org/show_bug.cgi?id=13265
3355 REGRESSION: Crash in KJS::Bindings::convertValueToNPVariant
3357 * bindings/NP_jsobject.cpp:
3358 (_NPN_InvokeDefault):
3359 Return false if the object isn't a function. Set the return value to undefined by default
3362 2007-03-30 Anders Carlsson <andersca@apple.com>
3366 * bindings/NP_jsobject.cpp:
3369 2007-03-30 Anders Carlsson <andersca@apple.com>
3373 Implement _NPN_Enumerate support.
3375 * JavaScriptCore.exp:
3376 * bindings/NP_jsobject.cpp:
3378 * bindings/c/c_instance.cpp:
3379 (KJS::Bindings::CInstance::getPropertyNames):
3380 * bindings/c/c_instance.h:
3382 * bindings/npruntime.h:
3383 * bindings/npruntime_impl.h:
3384 * bindings/runtime.h:
3385 (KJS::Bindings::Instance::getPropertyNames):
3386 * bindings/runtime_object.cpp:
3387 (RuntimeObjectImp::getPropertyNames):
3388 * bindings/runtime_object.h:
3389 (KJS::RuntimeObjectImp::getInternalInstance):
3391 2007-03-28 Jeff Walden <jwalden+code@mit.edu>
3395 http://bugs.webkit.org/show_bug.cgi?id=12963
3396 Fix some inconsistencies in the Mozilla JS Array extras implementations
3397 with respect to the Mozilla implementation:
3399 - holes in arrays should be skipped, not treated as undefined,
3401 - an element with value undefined is not a hole
3402 - Array.prototype.forEach should return undefined
3404 * kjs/array_object.cpp:
3405 (ArrayInstance::getOwnPropertySlot):
3406 (ArrayProtoFunc::callAsFunction):
3408 2007-03-27 Anders Carlsson <acarlsson@apple.com>