1 2007-10-11 Mark Rowe <mrowe@apple.com>
3 Reviewed by Tim Hatcher.
5 Fix for <rdar://problem/5488678>. Disable debugging symbols in production builds for 10.4
6 PowerPC to prevent a huge STABS section from being generated.
8 * Configurations/Base.xcconfig:
10 2007-10-08 George Staikos <staikos@kde.org>
12 Reviewed by Adam Roben.
14 Fix Qt build on Win32.
19 2007-10-10 Simon Hausmann <hausmann@kde.org>
23 Fix compilation using gcc 4.3. Header files have been reorganized and as a result some extra
24 includes are needed for INT_MAX, std::auto_ptr and the like.
29 * kjs/scope_chain.cpp:
33 2007-10-09 Lars Knoll <lars@trolltech.com>
37 fix the invokation of slots with return types. Add a JSLock around the conversion from QVariant to JSValue.
39 * bindings/qt/qt_instance.cpp:
40 (KJS::Bindings::QtInstance::invokeMethod):
41 * bindings/qt/qt_runtime.cpp:
42 (KJS::Bindings::convertValueToQVariant):
43 (KJS::Bindings::convertQVariantToValue):
45 2007-10-05 Geoffrey Garen <ggaren@apple.com>
47 Reviewed by Sam Weinig.
49 Added JSObject::removeDirect, to support the fix for
50 <rdar://problem/5522487> REGRESSION: With JavaScript disabled, any
51 page load causes a crash in PropertyMap::put
54 (KJS::JSObject::removeDirect):
57 2007-10-04 Mark Rowe <mrowe@apple.com>
61 Switch to default level of debugging symbols to resolve <rdar://problem/5488678>.
62 The "full" level appears to offer no observable benefits even though the documentation
63 suggests it be used for dead code stripping. This should also decrease link times.
65 * Configurations/Base.xcconfig:
67 2007-10-03 Lars Knoll <lars@trolltech.com>
71 Fix a stupid bug in Unicode::toUpper/toLower.
72 Fixes all three test failures in the JavaScriptCore test
75 * wtf/unicode/qt4/UnicodeQt4.h:
76 (WTF::Unicode::toLower):
77 (WTF::Unicode::toUpper):
79 2007-10-02 Darin Adler <darin@apple.com>
83 - add support for GDI objects to OwnPtr; I plan to use this
84 to fix some GDI handle leaks
86 * kjs/grammar.y: Change parser to avoid macros that conflict
87 with macros defined in Windows system headers: THIS, DELETE,
88 VOID, IN, and CONST. This is needed because OwnPtr.h will now
90 * kjs/keywords.table: Ditto.
92 * wtf/OwnPtr.h: For PLATFORM(WIN), add support so that OwnPtr can be
93 a GDI handle, and it will call DeleteObject. Also change to use the
94 RemovePointer technique used by RetainPtr, so you can say OwnPtr<HBITMAP>
95 rather than having to pass in the type pointed to by HBITMAP.
97 * wtf/OwnPtrWin.cpp: Added.
98 (WebCore::deleteOwnedPtr): Put this in a separate file so that we
99 don't have to include <windows.h> in OwnPtr.h.
101 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OwnPtrWin.cpp.
103 2007-09-29 Holger Hans Peter Freyther <zecke@selfish.org>
107 -Fix http://bugs.webkit.org/show_bug.cgi?id=13226.
108 Remove Bakefiles from svn.
110 * JavaScriptCoreSources.bkl: Removed.
111 * jscore.bkl: Removed.
113 2007-09-27 Kevin Decker <kdecker@apple.com>
115 Rubber stamped by John Sullivan.
117 <rdar://problem/5493093>
119 * JavaScriptCore.order: Added.
120 * JavaScriptCore.xcodeproj/project.pbxproj: We're changing from using an order file built by
121 another team to using one we actually check into our project repository. Linker settings for
122 Symbol Ordering Flags have been updated accordingly.
124 2007-09-26 Adam Roben <aroben@apple.com>
126 Make testkjs delay-load WebKit.dll so WebKitInitializer can work its magic
128 Rubberstamped by Anders.
130 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
132 2007-09-25 Adam Roben <aroben@apple.com>
134 Make testkjs delay-load its dependencies
136 This lets WebKitInitializer re-route the dependencies to be loaded out
137 of the Safari installation directory.
139 Rubberstamped by Sam.
141 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
143 2007-09-25 David Kilzer <ddkilzer@webkit.org>
147 - Fix http://bugs.webkit.org/show_bug.cgi?id=14885
148 LGPL'ed files contain incorrect FSF address
151 * bindings/testbindings.cpp:
152 * kjs/AllInOneFile.cpp:
154 * kjs/PropertyNameArray.cpp:
155 * kjs/PropertyNameArray.h:
158 2007-09-25 Sam Weinig <sam@webkit.org>
160 Fix location for build products for Debug_Internal.
162 Reviewed by Adam Roben.
164 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
166 2007-09-25 Adam Roben <aroben@apple.com>
168 Make testkjs use WebKitInitializer
172 * JavaScriptCore.vcproj/JavaScriptCore.sln: Add WebKitInitializer and
173 make testkjs depend on it.
174 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
175 WebKitInitializer.lib.
177 (main): Call initializeWebKit.
179 2007-09-24 Kevin McCullough <kmccullough@apple.com>
183 - Continued to update project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
185 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
186 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
188 2007-09-21 Kevin McCullough <kmccullough@apple.com>
192 - Updated project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
194 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
195 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
197 2007-09-20 Holger Hans Peter Freyther <zecke@selfish.org>
199 Rubber stamped by Adam.
201 Renamed files from *Gdk to *Gtk (see #14732) using the
202 work of Juan A. Suarez Romero as a base.
206 * JavaScriptCore.pri:
209 * wtf/Platform.h: PLATFORM(GDK) to PLATFORM(GTK)
211 2007-09-21 Mark Rowe <mrowe@apple.com>
213 Reviewed by Antti Koivisto.
215 http://bugs.webkit.org/show_bug.cgi?id=15250
216 <rdar://problem/5496942> REGRESSION: Reproducible crash in Safari when evaluating script in Drosera console (15250)
219 (KJS::GlobalFuncImp::callAsFunction): Null-check thisObj before passing it to interpreterForGlobalObject.
221 2007-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
223 Rubber stamped by Adam.
225 Make the guard/#if use the same name (ENABLE_FTPDIR) as the #define. This follows
226 the ENABLE_ICONDATABASE example from a couple of lines above.
230 2007-09-19 Mark Rowe <mrowe@apple.com>
234 <rdar://problem/5487107> NULL dereference crash in FastMallocZone::enumerate when running leaks against Safari
236 Storing remote pointers to their local equivalents in mapped memory was leading to the local pointer being
237 interpreted as a remote pointer. This caused a crash when using the result of mapping this invalid remote pointer.
238 The fix is to follow the pattern used elsewhere in FastMallocZone by always doing the mapping after reading and
239 never storing the mapped pointer.
241 * wtf/FastMalloc.cpp:
242 (WTF::FastMallocZone::enumerate):
244 2007-09-15 Darin Adler <darin@apple.com>
248 * JavaScriptCore.exp: Export WTFLogVerbose.
250 2007-09-14 Kevin McCullough <kmccullough@apple.com>
254 - Copy JSRetainPtr to include folder.
256 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
258 2007-09-13 Geoffrey Garen <ggaren@apple.com>
260 Try to fix GDK build.
265 2007-09-12 Geoff Garen <ggaren@apple.com>
267 Reviewed by Sam Weinig.
269 Fixed <rdar://problem/5429064> 141885 Safari JavaScript: Math.random() slightly less randomly distributed than on Safari / Mac
271 Math.random was skewed slightly upward because it assumed that RAND_MAX was outside the range of
272 values that rand() might return. This problem was particularly pronounced on Windows because
273 the range of values returned by rand() on Windows is 2^16 smaller than the range of values
274 return by rand() on Mac.
276 Fixed by accounting for RAND_MAX return values. Also, switched Windows over to rand_s, which has
277 a range that's equal to rand()'s range on Mac.
281 * kjs/math_object.cpp:
282 (MathFuncImp::callAsFunction): Use the new new thing.
284 * wtf/MathExtras.h: Platform abstraction for random numbers, to cover over differences on Windows.
288 2007-09-13 Antti Koivisto <antti@apple.com>
292 Small addition to previous path to cover
293 http://bugs.webkit.org/show_bug.cgi?id=11399
294 window.eval runs in the global scope of the calling window
296 Switch variable scope as well.
299 (KJS::GlobalFuncImp::callAsFunction):
301 2007-09-12 Antti Koivisto <antti@apple.com>
303 Reviewed by Geoff, Maciej.
305 Fix <rdar://problem/5445058>
306 REGRESSION: Unable to upload picture to eBay auction due to domain security check
308 eBay uses window.eval() between windows. In Firefox window.eval() switches execution
309 and security context to the target window, something WebKit did not do. With WebKit
310 security tightening in r24781, this broke picture uploads.
312 Fix by making WebKit switch context in window.eval().
315 (KJS::Context::Context):
316 (KJS::Context::~Context):
318 Save and restore interpreter context independently from calling context.
321 (KJS::GlobalFuncImp::callAsFunction):
322 If eval is called for global object different than current one, switch execution context
323 to that object and push it to scope.
325 2007-09-12 Sam Weinig <sam@webkit.org>
327 Reviewed by Geoffrey Garen.
329 <rdar://problem/5478717> JSStringCreateWithCFString leaks when passed a zero length CFStringRef
331 * API/JSStringRefCF.cpp:
332 (JSStringCreateWithCFString): Special case the zero length string and remove the
333 UTF16 optimized path since it will always leak due to the fact that we won't be
334 able to free the backing store that the CFStringRef provides.
336 2007-09-10 Timothy Hatcher <timothy@apple.com>
338 Reviewed by Darin Adler.
340 <rdar://problem/5456224> CrashTracer: [USER] 2 crashes in Toast Titanium at com.apple.CoreServices.CarbonCore: CSMemDisposePtr + 37
342 Removed the implementation of these malloc zone functions. We do not have the ability to
343 check if a pointer is valid or not, so we can't correctly implement them. The system free
344 does not fail if you pass in a bad pointer.
346 * wtf/FastMalloc.cpp:
347 (WTF::FastMallocZone::size):
348 (WTF::FastMallocZone::zoneMalloc):
349 (WTF::FastMallocZone::zoneCalloc):
350 (WTF::FastMallocZone::zoneFree):
351 (WTF::FastMallocZone::zoneRealloc):
353 2007-09-07 Darin Adler <darin@apple.com>
355 Reviewed by Steve Falkenburg.
357 - fix crash seen on Windows release builds
359 * wtf/FastMalloc.cpp: Change pthread_getspecific optimization to be done only
360 on the DARWIN platform. Also correct a couple reinterpret_cast that should be
363 2007-09-06 Kevin McCullough <kmccullough@apple.com>
367 - Moved JSRetainPtr to the API.
369 * API/JSRetainPtr.h: Copied from kjs/JSRetainPtr.h.
372 (JSRetainPtr::JSRetainPtr):
373 (JSRetainPtr::~JSRetainPtr):
375 (JSRetainPtr::releaseRef):
376 (JSRetainPtr::operator->):
377 (JSRetainPtr::operator!):
378 (JSRetainPtr::operator UnspecifiedBoolType):
385 * JavaScriptCore.xcodeproj/project.pbxproj:
386 * kjs/JSRetainPtr.h: Removed.
388 2007-09-05 Maciej Stachowiak <mjs@apple.com>
392 - Remove single-threaded optimization for FastMalloc.
394 It does not appear to help anywhere but Mac OS X on PPC, due to
395 pthread_getspecific being slow there. On Intel, removing the
396 optimization results in a ~1.5% PLT speedup, a ~1-5% JS iBench
397 speedup, and a ~1.5% HTML iBench speedup. On PPC this change is a
398 speedup on some benchmarks, a slight hit on others.
400 * JavaScriptCore.xcodeproj/project.pbxproj:
402 (KJS::Collector::registerThread):
403 * wtf/FastMalloc.cpp:
404 (WTF::TCMalloc_ThreadCache::GetCache):
405 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
406 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
408 * wtf/FastMallocInternal.h: Removed.
410 2007-09-05 Kevin McCullough <kmccullough@apple.com>
412 Reviewed by Adam, Sam, Darin.
414 - Created a JSRetainPtr specifically for JSStringRefs so they can be automatically refed and derefed.
416 * JavaScriptCore.xcodeproj/project.pbxproj:
417 * kjs/JSRetainPtr.h: Copied from wtf/RetainPtr.h.
421 (KJS::JSRetainPtr::JSRetainPtr):
422 (KJS::JSRetainPtr::~JSRetainPtr):
423 (KJS::JSRetainPtr::get):
424 (KJS::JSRetainPtr::releaseRef):
425 (KJS::JSRetainPtr::operator->):
426 (KJS::JSRetainPtr::operator UnspecifiedBoolType):
434 2007-09-05 Mark Rowe <mrowe@apple.com>
436 Unreviewed Qt build fix.
438 * wtf/unicode/qt4/UnicodeQt4.h: Fix the constness of the src argument to toUpper to prevent build failures.
440 2007-09-04 Maciej Stachowiak <mjs@apple.com>
442 Back out accidentally committed change.
444 * JavaScriptCore.xcodeproj/project.pbxproj:
446 (KJS::Collector::registerThread):
447 * wtf/FastMalloc.cpp:
448 (WTF::fastMallocSetIsMultiThreaded):
449 (WTF::TCMalloc_ThreadCache::GetCache):
450 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
451 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
453 * wtf/FastMallocInternal.h: Added.
455 2007-09-04 Maciej Stachowiak <mjs@apple.com>
459 - Added Vector::appendRange(), which appends to a vector based on a given start and end iterator
460 - Added keys() and values() functions to HashMap iterators, which give keys-only and values-only iterators
462 Together, these allow easy copying of a set, or the keys or values of a map, into a Vector. Examples:
464 HashMap<int, int> map;
468 vec.appendRange(set.begin(), set.end());
469 vec.appendRange(map.begin().keys(), map.end().keys());
470 vec.appendRange(map.begin().values(), map.end().values());
472 This also allows for a slightly nicer syntax when iterating a map. Instead of saying
473 (*it)->first, you can say *it.values(). Similarly for keys. Example:
475 HashMap<int, int>::const_iterator end = map.end();
476 for (HashMap<int, int>::const_iterator it = map.begin(); it != end; ++it)
477 printf(" [%d => %d]", *it.keys(), *it.values());
479 * JavaScriptCore.xcodeproj/project.pbxproj:
480 * wtf/HashIterators.h: Added.
482 (WTF::HashTableConstKeysIterator::HashTableConstKeysIterator):
483 (WTF::HashTableConstKeysIterator::get):
484 (WTF::HashTableConstKeysIterator::operator*):
485 (WTF::HashTableConstKeysIterator::operator->):
486 (WTF::HashTableConstKeysIterator::operator++):
487 (WTF::HashTableConstValuesIterator::HashTableConstValuesIterator):
488 (WTF::HashTableConstValuesIterator::get):
489 (WTF::HashTableConstValuesIterator::operator*):
490 (WTF::HashTableConstValuesIterator::operator->):
491 (WTF::HashTableConstValuesIterator::operator++):
492 (WTF::HashTableKeysIterator::HashTableKeysIterator):
493 (WTF::HashTableKeysIterator::get):
494 (WTF::HashTableKeysIterator::operator*):
495 (WTF::HashTableKeysIterator::operator->):
496 (WTF::HashTableKeysIterator::operator++):
497 (WTF::HashTableKeysIterator::operator HashTableConstKeysIterator<HashTableType, KeyType, MappedType>):
498 (WTF::HashTableValuesIterator::HashTableValuesIterator):
499 (WTF::HashTableValuesIterator::get):
500 (WTF::HashTableValuesIterator::operator*):
501 (WTF::HashTableValuesIterator::operator->):
502 (WTF::HashTableValuesIterator::operator++):
503 (WTF::HashTableValuesIterator::operator HashTableConstValuesIterator<HashTableType, KeyType, MappedType>):
508 (WTF::::appendRange):
510 2007-09-04 Maciej Stachowiak <mjs@apple.com>
514 - Remove single-threaded optimization for FastMalloc.
516 It does not appear to help anywhere but Mac OS X on PPC, due to
517 pthread_getspecific being slow there. On Intel, removing the
518 optimization results in a 1% PLT speedup, a 2% JS iBench speedup,
519 and no measurable effect on HTML iBench (maybe a slight speedup).
521 * JavaScriptCore.xcodeproj/project.pbxproj:
523 (KJS::Collector::registerThread):
524 * wtf/FastMalloc.cpp:
525 (WTF::TCMalloc_ThreadCache::GetCache):
526 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
527 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
529 * wtf/FastMallocInternal.h: Removed.
531 2007-09-03 Mark Rowe <mrowe@apple.com>
533 Reviewed by Tim Hatcher.
535 <rdar://problem/5452164> Production build with in symbols directory has no debug info
537 Enable debug symbol generation on all build configurations. Production builds are stripped
538 of symbols by Xcode during deployment post-processing.
540 * Configurations/Base.xcconfig:
541 * JavaScriptCore.xcodeproj/project.pbxproj:
543 2007-08-30 Riku Voipio <riku.voipio@iki.fi>
545 Reviewed by Dave Kilzer.
549 * kjs/ustring.h: Update comments to reflect the change and update test
550 to fit changes to Platform.h.
551 * wtf/Platform.h: Forced packing is only needed on oldabi ARM.
552 Set middle-endian floats only for little-endian oldabi ARM.
553 Set big-endian define for big-endian ARM.
555 2007-08-29 Ryan Leavengood <leavengood@gmail.com>
559 http://bugs.webkit.org/show_bug.cgi?id=15043
560 - posix_memalign takes a void** as its first parameter. My port makes use of this function call.
563 (KJS::allocateBlock):
565 2007-08-26 Darin Adler <darin@apple.com>
567 - quick follow on to that last check-in
569 * API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject):
570 Need to initialize m_class to 0.
572 2007-08-26 Mark Rowe <mrowe@apple.com>
574 Reviewed by Darin Adler.
576 <rdar://problem/4949002> JSGlobalContextCreate can cause crashes because it passes a NULL JSContextRef to the globalObjectClass's initialize callback
578 JSCallbackObject now tracks whether it was constructed with a null ExecState. This will happen when the object is being used as the global object,
579 as the Interpreter needs to be created after the global object. In this situation the initialization is deferred until after the Interpreter's
580 ExecState is available to be passed down to the initialize callbacks.
582 * API/JSCallbackObject.cpp:
583 (KJS::JSCallbackObject::init): Track whether we successfully initialized.
584 (KJS::JSCallbackObject::initializeIfNeeded): Attempt to initialize with the new ExecState.
585 * API/JSCallbackObject.h:
586 * API/JSContextRef.cpp:
587 (JSGlobalContextCreate): Initialize the JSCallbackObject with the Interpreter's ExecState.
589 (testInitializeOfGlobalObjectClassHasNonNullContext):
590 (main): Verify that the context passed to the initialize callback is non-null.
592 2007-08-26 Mark Rowe <mrowe@apple.com>
594 Reviewed by Darin Adler.
596 <rdar://problem/5438496> JSGlobalContextCreate crashes when passed a custom class
598 * API/JSContextRef.cpp:
599 (JSGlobalContextCreate): Specify jsNull() as the prototype and let Interpreter's constructor fix it up to point at builtinObjectPrototype().
601 (main): Use an instance of a custom class as the global object to ensure the code path is exercised in the test.
603 2007-08-26 Mike Hommey <glandium@debian.org>
605 Reviewed by Mark Rowe and David Kilzer.
607 Fix build failure on arm.
609 * wtf/Platform.h: Also test if __arm__ is defined.
611 2007-08-25 Peter Kasting <zerodpx@gmail.org>
613 Reviewed by Maciej Stachowiak.
615 Part 3 of http://bugs.webkit.org/show_bug.cgi?id=14967
616 Bug 14967: Reduce wtf::Vector::operator[]() overloads
619 (WTF::Vector::operator[]): Only provide versions of operator[] that takes a size_t argument.
621 2007-08-25 Peter Kasting <zerodpx@gmail.org>
623 Reviewed by Sam Weinig.
625 Part 2 of http://bugs.webkit.org/show_bug.cgi?id=14967.
626 Eliminate all remaining implicit conversions of wtf::Vector<T> to T*. Where code was
627 previously checking that the Vector's data pointer was non-NULL, check !Vector::isEmpty()
633 2007-08-16 Kevin McCullough <kmccullough@apple.com>
635 Reviewed by Geoff and Adam.
637 - 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)
641 2007-08-15 Peter Kasting <zerodpx@gmail.org>
645 http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
646 conversions of wtf::Vector<T> to T* by explicitly calling .data()
648 * API/JSCallbackConstructor.cpp:
649 (KJS::JSCallbackConstructor::construct):
650 * API/JSCallbackFunction.cpp:
651 (KJS::JSCallbackFunction::callAsFunction):
652 * API/JSCallbackObject.cpp:
653 (KJS::JSCallbackObject::construct):
654 (KJS::JSCallbackObject::callAsFunction):
655 * bindings/c/c_instance.cpp:
656 (KJS::Bindings::CInstance::invokeMethod):
657 (KJS::Bindings::CInstance::invokeDefaultMethod):
658 * kjs/number_object.cpp:
659 (integer_part_noexp):
662 (KJS::UString::UTF8String):
664 2007-08-14 Darin Adler <darin@apple.com>
668 - fix <rdar://problem/5410570> Global initializer introduced by use of std::numeric_limits in r24919
671 (KJS::overflowIndicator): Turned into a function.
672 (KJS::maxUChars): Ditto.
673 (KJS::allocChars): Use the functions.
674 (KJS::reallocChars): Ditto.
675 (KJS::UString::expandedSize): Ditto.
677 2007-08-12 Darin Adler <darin@apple.com>
681 - fix http://bugs.webkit.org/show_bug.cgi?id=14931
682 <rdar://problem/5403816> JavaScript regular expression non-participating capturing parentheses
683 fail in 3 different ways
685 Test: fast/js/regexp-non-capturing-groups.html
687 * kjs/string_object.cpp:
688 (KJS::replace): Add missing code to handle undefined backreferences; before we'd get the empty string
689 instead of a JavaScript "undefined" value.
690 (KJS::StringProtoFunc::callAsFunction): Implemented backreference support for split.
691 * pcre/pcre_exec.c: (match): Made backreferences to undefined groups match the empty string instead
692 of always failing. Only in JAVASCRIPT mode.
694 * tests/mozilla/expected.html: Add a new expected test success, since this fixed one test result.
696 2007-08-10 Timothy Hatcher <timothy@apple.com>
700 <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
702 Disable the NPAPI for 64-bit on Mac OS X.
704 * Configurations/JavaScriptCore.xcconfig: Use the 64-bit export file.
705 * JavaScriptCore.xcodeproj/project.pbxproj: Create a 64-bit export file
706 that filters out the NPN fnctions.
707 * bindings/NP_jsobject.cpp: #ifdef out this for 64-bit on Mac OS X
708 * bindings/NP_jsobject.h: Ditto.
709 * bindings/c/c_class.cpp: Ditto.
710 * bindings/c/c_class.h: Ditto.
711 * bindings/c/c_instance.cpp: Ditto.
712 * bindings/c/c_instance.h: Ditto.
713 * bindings/c/c_runtime.cpp: Ditto.
714 * bindings/c/c_runtime.h: Ditto.
715 * bindings/c/c_utility.cpp: Ditto.
716 * bindings/c/c_utility.h: Ditto.
717 * bindings/npapi.h: Ditto.
718 * bindings/npruntime.cpp: Ditto.
719 * bindings/npruntime.h: Ditto.
720 * bindings/npruntime_impl.h: Ditto.
721 * bindings/npruntime_priv.h: Ditto.
722 * bindings/runtime.cpp:
723 (KJS::Bindings::Instance::createBindingForLanguageInstance):
724 don't creat an NPObject on Mac OS X in 64-bit.
726 2007-08-09 Mark Rowe <mrowe@apple.com>
730 <rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
732 * Configurations/Version.xcconfig:
733 * JavaScriptCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
734 Version.xcconfig and Info.plist explicit to Xcode.
736 2007-08-08 George Staikos <staikos@kde.org>
738 Make it compile with Qt again.
740 * wtf/unicode/qt4/UnicodeQt4.h:
741 (WTF::Unicode::toUpper):
743 2007-08-07 Sam Weinig <sam@webkit.org>
747 Fix for http://bugs.webkit.org/show_bug.cgi?id=14897
748 Decompilation of double negation fails and produces invalid or incorrect code
750 Test: fast/js/function-decompilation-operators.html
752 * kjs/nodes2string.cpp:
753 (UnaryPlusNode::streamTo): Put space after unary operator. Matches Firefox.
754 (NegateNode::streamTo): Diito.
755 (MultNode::streamTo): Put spaces around binary operator. Matches Firefox.
756 (AddNode::streamTo): Ditto.
758 2007-08-07 Darin Adler <darin@apple.com>
762 - fix <rdar://problem/5383104> REGRESSION: XHR.responseText is null instead of empty string
763 in http/tests/xmlhttprequest/zero-length-response.html
765 The new code to handle out of memory conditions was turning a "" into a null string.
767 * kjs/ustring.h: Removed UCharReference, which has long been obsolete and unused.
768 Removed copyForWriting, which was only used for the upper/lowercasing code and for
771 (KJS::allocChars): Removed special case that made this fail (return 0) when passed 0.
772 Instead assert that we're not passed 0. Also added an overflow check for two reasons:
773 1) for sizes that aren't checked this prevents us from allocating a buffer that's too
774 small, and 2) for sizes where we overflowed in the expandedSize function and returned
775 overflowIndicator, it guarantees we fail.
776 (KJS::reallocChars): Ditto.
777 (KJS::UString::expandedSize): Return a large number, overflowIndicator, rather than 0
778 for cases where we overflow.
779 (KJS::UString::spliceSubstringsWithSeparators): Added a special case for empty string so
780 we don't call allocChars with a length of 0.
781 (KJS::UString::operator=): Added special characters for both 0 and empty string so we
782 match the behavior of the constructor. This avoids calling allocChars with a length of 0
783 and making a null string rather than an empty string in that case, and also matches the
784 pattern used in the rest of the functions.
785 (KJS::UString::operator[]): Made the return value const so code that tries to use the
786 operator to modify the string will fail.
788 * kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction): Rewrote uppercasing and
789 lowercasing functions so they don't need copyForWriting any more -- it wasn't really doing
790 any good for optimization purposes. Instead use a Vector and releaseBuffer.
792 * wtf/unicode/icu/UnicodeIcu.h: Eliminate one of the versions of toLower/toUpper -- we now
793 only need the version where both a source and destination buffer is passed in, not the one
795 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
797 2007-08-06 Sam Weinig <sam@webkit.org>
801 Fix for http://bugs.webkit.org/show_bug.cgi?id=14891
802 Decompilation of try block immediately following "else" fails
804 Test: fast/js/toString-try-else.html
806 * kjs/nodes2string.cpp:
807 (TryNode::streamTo): Add newline before "try".
809 2007-08-07 Mark Rowe <mrowe@apple.com>
813 <rdar://problem/5388774> REGRESSION: Hang occurs after clicking "Attach a file " link in a new .Mac message
815 Attempting to acquire the JSLock inside CollectorHeap::forceLock can lead to a deadlock if the thread currently
816 holding the lock is waiting on the thread that is forking. It is not considered safe to use system frameworks
817 after a fork without first execing[*] so it is not particularly important to ensure that the collector and
818 fastMalloc allocators are unlocked in the child process. If the child process wishes to use JavaScriptCore it
819 should exec after forking like it would to use any other system framework.
820 [*]: <http://lists.apple.com/archives/Cocoa-dev/2005/Jan/msg00676.html>
822 * kjs/CollectorHeapIntrospector.cpp: Remove forceLock and forceUnlock implementations.
823 * kjs/CollectorHeapIntrospector.h: Stub out forceLock and forceUnlock methods.
824 * wtf/FastMalloc.cpp: Ditto.
826 2007-08-06 Darin Adler <darin@apple.com>
828 Rubber stamped by Geoff.
830 * kjs/ustring.h: Added an assertion which would have helped us find the
831 previous bug more easily.
833 2007-08-06 Darin Adler <darin@apple.com>
837 - fix <rdar://problem/5387589> 9A514: Quartz Composer crash on launch in KJS::jsString
840 (JSEvaluateScript): Turn NULL for sourceURL into UString::null(), just as JSObjectMakeFunction already does.
841 (JSCheckScriptSyntax): Ditto.
843 2007-08-06 Matt Lilek <pewtermoose@gmail.com>
845 Not reviewed, build fix.
847 * kjs/string_object.cpp:
848 (KJS::StringProtoFunc::callAsFunction):
850 2007-08-04 Darin Adler <darin@apple.com>
854 - fix <rdar://problem/5371862> crash in Dashcode due to Quartz Composer JavaScript garbage collector reentrancy
856 * API/JSBase.cpp: (JSGarbageCollect): Don't call collector() if isBusy() returns true.
858 * kjs/collector.h: Added isBusy(), removed the unused return value from collect()
859 * kjs/collector.cpp: Added an "operation in progress" flag to the allocator.
860 (KJS::Collector::allocate): Call abort() if an operation is already in progress. Set the new flag instead
861 of using the debug-only GCLock.
862 (KJS::Collector::collect): Ditto.
863 (KJS::Collector::isBusy): Added.
865 2007-08-04 Maciej Stachowiak <mjs@apple.com>
867 Reviewed by Darin and Adam.
869 <rdar://problem/5368990> REGRESSION: newsgator.com sign-on 6x slower than Safari 3 beta due to GC changes (14808)
871 * kjs/string_object.cpp:
872 (KJS::replace): if the string didn't change (very common in some cases) reuse the original string value.
873 (KJS::StringProtoFunc::callAsFunction): Pass in the StringImp* when replacing, not just the UString.
874 * kjs/string_object.h:
875 (KJS::StringInstance::internalValue): covariant override to return StringImp for convenience
877 2007-08-04 Mark Rowe <mrowe@apple.com>
879 Reviewed by Oliver Hunt.
881 <rdar://problem/5385145> r24843 introduces a crash on calling fork() (14878)
882 http://bugs.webkit.org/show_bug.cgi?id=14878
884 Provide no-op functions for all members of the malloc_zone_t and malloc_introspection_t structures that we
885 register to avoid crashes in system code that assumes they will be non-null.
887 * kjs/CollectorHeapIntrospector.cpp:
888 (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector):
889 (KJS::CollectorHeapIntrospector::forceLock): Grab the lock.
890 (KJS::CollectorHeapIntrospector::forceUnlock): Release the lock.
891 * kjs/CollectorHeapIntrospector.h:
892 (KJS::CollectorHeapIntrospector::goodSize):
893 (KJS::CollectorHeapIntrospector::check):
894 (KJS::CollectorHeapIntrospector::print):
895 (KJS::CollectorHeapIntrospector::log):
896 (KJS::CollectorHeapIntrospector::statistics):
897 (KJS::CollectorHeapIntrospector::size):
898 (KJS::CollectorHeapIntrospector::zoneMalloc):
899 (KJS::CollectorHeapIntrospector::zoneCalloc):
900 (KJS::CollectorHeapIntrospector::zoneFree):
901 * wtf/FastMalloc.cpp:
902 (WTF::FastMallocZone::goodSize):
903 (WTF::FastMallocZone::check):
904 (WTF::FastMallocZone::print):
905 (WTF::FastMallocZone::log):
906 (WTF::FastMallocZone::forceLock): Grab the TCMalloc locks.
907 (WTF::FastMallocZone::forceUnlock): Release the TCMalloc locks.
908 (WTF::FastMallocZone::FastMallocZone):
910 2007-08-04 Mark Rowe <mrowe@apple.com>
912 Rubber-stamped by Anders.
914 * pcre/pcre_compile.c: Remove non-ASCII character from a comment.
916 2007-08-02 Mark Rowe <mrowe@apple.com>
918 Reviewed by Geoff Garen.
920 <rdar://problem/4212199> 'leaks' reports false leaks in WebKit (because the WTF allocator uses mmap?)
922 Implement malloc zone introspection routines to allow leaks, heap, and friends to request information
923 about specific memory regions that were allocated by FastMalloc or the JavaScriptCore collector.
925 This requires tool-side support before the regions will be displayed. The addition of that support is
926 tracked by <rdar://problems/5353057&5353060>.
928 * JavaScriptCore.exp: Export the two variables that are used by leaks to introspect the allocators.
929 * JavaScriptCore.xcodeproj/project.pbxproj:
930 * kjs/AllInOneFile.cpp:
931 * kjs/CollectorHeapIntrospector.cpp: Added.
933 (KJS::CollectorHeapIntrospector::init):
934 (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector): Create and register our zone with the system.
935 (KJS::CollectorHeapIntrospector::enumerate): Iterate over the CollectorBlocks that are in use and report them to the caller as being used.
936 * kjs/CollectorHeapIntrospector.h: Added.
937 (KJS::CollectorHeapIntrospector::size): Return zero to indicate the specified pointer does not belong to this zone.
939 (KJS::Collector::registerThread): Register the CollectorHeapIntrospector with the system when the first thread is registered with the collector.
940 * wtf/FastMalloc.cpp:
941 (WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe):
942 (WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Enumerate the objects on the free list.
943 (WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Ditto.
944 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Ditto.
945 (WTF::TCMalloc_ThreadCache::InitModule): Register the FastMallocZone with the system when initializing TCMalloc.
946 (WTF::FreeObjectFinder::FreeObjectFinder):
947 (WTF::FreeObjectFinder::visit): Add an object to the free list.
948 (WTF::FreeObjectFinder::isFreeObject):
949 (WTF::FreeObjectFinder::freeObjectCount):
950 (WTF::FreeObjectFinder::findFreeObjects): Find the free objects within a thread cache or free list.
951 (WTF::PageMapFreeObjectFinder::PageMapFreeObjectFinder): Find the free objects within a TC_PageMap.
952 (WTF::PageMapFreeObjectFinder::visit): Called once per allocated span. Record whether the span or any subobjects are free.
953 (WTF::PageMapMemoryUsageRecorder::PageMapMemoryUsageRecorder):
954 (WTF::PageMapMemoryUsageRecorder::visit): Called once per allocated span. Report the range of memory as being allocated, and the span or
955 its subobjects as being used if they do not appear on the free list.
956 (WTF::FastMallocZone::enumerate): Map the key remote TCMalloc data structures into our address space. We then locate all free memory ranges
957 before reporting the other ranges as being in use.
958 (WTF::FastMallocZone::size): Determine whether the given pointer originates from within our allocation zone. If so,
959 we return its allocation size.
960 (WTF::FastMallocZone::zoneMalloc):
961 (WTF::FastMallocZone::zoneCalloc):
962 (WTF::FastMallocZone::zoneFree):
963 (WTF::FastMallocZone::zoneRealloc):
965 (WTF::FastMallocZone::FastMallocZone): Create and register our zone with the system.
966 (WTF::FastMallocZone::init):
967 * wtf/MallocZoneSupport.h: Added.
968 (WTF::RemoteMemoryReader::RemoteMemoryReader): A helper class to ease the process of mapping memory in a different process into
969 our local address space
970 (WTF::RemoteMemoryReader::operator()):
972 (TCMalloc_PageMap2::visit): Walk over the heap and visit each allocated span.
973 (TCMalloc_PageMap3::visit): Ditto.
975 2007-08-02 Mark Rowe <mrowe@apple.com>
980 (KJS::UString::expandedSize): Use std::numeric_limits<size_t>::max() rather than the non-portable SIZE_T_MAX.
982 2007-08-02 Mark Rowe <mrowe@apple.com>
986 <rdar://problem/5352887> "Out of memory" error during repeated JS string concatenation leaks hundreds of MBs of RAM
988 A call to fastRealloc was failing which lead to UString::expandCapacity leaking the buffer it was trying to reallocate.
989 It also resulted in the underlying UString::rep having both a null baseString and buf field, which meant that attempting
990 to access the contents of the string after the failed memory reallocation would crash.
992 A third issue is that expandedSize size was calculating the new length in a way that led to an integer overflow occurring.
993 Attempting to allocate a string more than 190,000,000 characters long would fail a the integer overflow would lead to a
994 memory allocation of around 3.6GB being attempted rather than the expected 390MB. Sizes that would lead to an overflow
995 are now returned as zero and callers are updated to treat this as though the memory allocation has failed.
997 * kjs/array_object.cpp:
998 (ArrayProtoFunc::callAsFunction): Check whether the append failed and raise an "Out of memory" exception if it did.
1000 (KJS::allocChars): Wrapper around fastMalloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
1001 (KJS::reallocChars): Wrapper around fastRealloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
1002 (KJS::UString::expandedSize): Split the size calculation in two and guard against overflow during each step.
1003 (KJS::UString::expandCapacity): Don't leak r->buf if reallocation fails. Instead free the memory and use the null representation.
1004 (KJS::UString::expandPreCapacity): If fastMalloc fails then use the null representation rather than crashing in memcpy.
1005 (KJS::UString::UString): If calls to expandCapacity, expandPreCapacity or fastMalloc fail then use the null representation rather than crashing in memcpy.
1006 (KJS::UString::append): Ditto.
1007 (KJS::UString::operator=): Ditto.
1008 * kjs/ustring.h: Change return type of expandedSize from int to size_t.
1010 2007-08-01 Darin Adler <darin@apple.com>
1012 Reviewed by Kevin McCullough.
1014 - fix <rdar://problem/5375186> pointers to pieces of class definition passed to JSClassCreate should all be const
1016 * API/JSObjectRef.h: Added const.
1018 * API/JSClassRef.cpp:
1019 (OpaqueJSClass::OpaqueJSClass): Added const.
1020 (OpaqueJSClass::create): Added const.
1021 * API/JSObjectRef.cpp:
1022 (JSClassCreate): Added const.
1024 2007-08-01 Steve Falkenburg <sfalken@apple.com>
1026 Build mod: Fix sln to match configs in vcproj.
1030 * JavaScriptCore.vcproj/JavaScriptCore.make:
1031 * JavaScriptCore.vcproj/JavaScriptCore.sln:
1033 2007-07-30 Simon Hausmann <hausmann@kde.org>
1035 Done with and reviewed by Lars.
1037 Removed the __BUILDING_QT ifdef in JSStringRef.h and changed UChar for the Qt build to use wchar_t on Windows.
1039 * API/JSStringRef.h:
1040 * wtf/unicode/qt4/UnicodeQt4.h:
1042 2007-07-27 Simon Hausmann <hausmann@kde.org>
1044 Done with and reviewed by Lars and Zack.
1046 Always define JSChar to be unsigned short for the Qt builds, to ensure compatibility with UChar.
1048 * API/JSStringRef.h:
1050 2007-07-27 Simon Hausmann <hausmann@kde.org>
1052 Done with and reviewed by Lars and Zack.
1054 Fix compilation with Qt on Windows with MingW: Implemented currentThreadStackBase() for this platform.
1056 * kjs/collector.cpp:
1057 (KJS::currentThreadStackBase):
1059 2007-07-27 Simon Hausmann <hausmann@kde.org>
1061 Done with and reviewed by Lars and Zack.
1063 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.
1066 (KJS::getDSTOffsetSimple):
1068 2007-07-27 Simon Hausmann <hausmann@kde.org>
1070 Done with and reviewed by Lars and Zack.
1072 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.
1074 * JavaScriptCore.pri:
1076 2007-07-27 Simon Hausmann <hausmann@kde.org>
1078 Done with and reviewed by Lars and Zack.
1080 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.
1082 * kjs/interpreter.cpp:
1083 (KJS::getCurrentTime):
1088 2007-07-27 Simon Hausmann <hausmann@kde.org>
1090 Done with and reviewed by Lars and Zack.
1092 Replace the use of snprintf with QByteArray to compile under msvc 2005 express.
1094 * bindings/qt/qt_instance.cpp:
1095 (KJS::Bindings::QtInstance::stringValue):
1097 2007-07-27 Simon Hausmann <hausmann@kde.org>
1099 Done with and reviewed by Lars and Zack.
1101 Don't use pthread.h unless thread support is enabled.
1103 * kjs/collector.cpp:
1104 (KJS::Collector::registerAsMainThread):
1105 (KJS::onMainThread):
1107 2007-07-27 Simon Hausmann <hausmann@kde.org>
1109 Done with and reviewed by Lars and Zack.
1111 Removed TCSystemMalloc from the Qt build, it's not necessary it seems.
1113 * JavaScriptCore.pri:
1115 2007-07-27 Simon Hausmann <hausmann@kde.org>
1117 Done with and reviewed by Lars and Zack.
1119 Added os-win32 to the include search path for the Qt windows build in order to provide the fake stdint.h header file.
1121 * JavaScriptCore.pri:
1123 2007-07-25 Maciej Stachowiak <mjs@apple.com>
1127 - follow-up to previous change
1130 (KJS::UString::operator=): Make sure to reset the length when
1131 replacing the buffer contents for a single-owned string.
1133 2007-07-25 Maciej Stachowiak <mjs@apple.com>
1137 - JavaScriptCore part of fix for <rdar://problem/5300291> Optimize GC to reclaim big, temporary objects (like XMLHttpRequest.responseXML) quickly
1139 Also, as a side effect of optimizations included in this patch:
1140 - 7% speedup on JavaScript iBench
1141 - 4% speedup on "Celtic Kane" JS benchmark
1143 The basic idea is explained in a big comment in collector.cpp. When unusually
1144 large objecs are allocated, we push the next GC closer on the assumption that
1145 most objects are short-lived.
1147 I also did the following two optimizations in the course of tuning
1148 this not to be a performance regression:
1150 1) Change UString::Rep to hold a self-pointer as the baseString in
1151 the unshared case, instead of a null pointer; this removes a
1152 number of null checks in hot code because many places already
1153 wanted to use the rep itself or the baseString as appropriate.
1155 2) Avoid creating duplicate StringImpls when creating a
1156 StringInstance (the object wrapper for a JS string) or calling
1157 their methods. Since a temporary wrapper object is made every time
1158 a string method is called, this resulted in two useless extra
1159 StringImpls being allocated for no reason whenever a String method
1160 was invoked on a string value. Now we bypass those.
1162 * kjs/collector.cpp:
1164 (KJS::Collector::recordExtraCost): Basics of the extra cost mechanism.
1165 (KJS::Collector::allocate): ditto
1166 (KJS::Collector::collect): ditto
1168 (KJS::Collector::reportExtraMemoryCost): ditto
1169 * kjs/array_object.cpp:
1170 (ArrayInstance::ArrayInstance): record extra cost
1172 (KJS::StringImp::toObject): don't create a whole new StringImpl just
1173 to be the internal value of a StringInstance! StringImpls are immutable
1174 so there's no point tot his.
1176 (KJS::StringImp::StringImp): report extra cost
1177 * kjs/string_object.cpp:
1178 (KJS::StringInstance::StringInstance): new version that takes a StringImp
1179 (KJS::StringProtoFunc::callAsFunction): don't create a whole new StringImpl
1180 just to convert self to string! we already have one in the internal value
1181 * kjs/string_object.h: report extra cost
1182 * kjs/ustring.cpp: All changes to handle baseString being self instead of null in the
1185 (KJS::UString::Rep::create):
1186 (KJS::UString::Rep::destroy):
1187 (KJS::UString::usedCapacity):
1188 (KJS::UString::usedPreCapacity):
1189 (KJS::UString::expandCapacity):
1190 (KJS::UString::expandPreCapacity):
1191 (KJS::UString::UString):
1192 (KJS::UString::append):
1193 (KJS::UString::operator=):
1194 (KJS::UString::copyForWriting):
1196 (KJS::UString::Rep::baseIsSelf): new method, now that baseString is
1197 self instead of null in the unshared case we can't just null check.
1198 (KJS::UString::Rep::data): adjusted as mentioned above
1199 (KJS::UString::cost): new method to compute the cost for a UString, for
1203 (KJS::jsString): style fixups.
1204 (KJS::jsOwnedString): new method, use this for strings allocated from UStrings
1205 held by the parse tree. Tracking their cost as part of string cost is pointless,
1206 because garbage collecting them will not actually free the relevant string buffer.
1207 * kjs/value.h: prototyped jsOwnedString.
1209 (StringNode::evaluate): use jsOwnedString as appropriate
1210 (RegExpNode::evaluate): ditto
1211 (PropertyNameNode::evaluate): ditto
1212 (ForInNode::execute): ditto
1214 * JavaScriptCore.exp: Exported some new symbols.
1216 2007-07-23 Anders Carlsson <andersca@apple.com>
1220 <rdar://problem/5121461> REGRESSION: Unable to load JigZone puzzle
1222 * bindings/jni/jni_jsobject.cpp:
1223 (JavaJSObject::createNative):
1225 Call RootObject::gcProtect on the global object, thereby putting it in the
1226 "protect count" set which is used for checking if a native handle is valid.
1228 2007-07-23 Darin Adler <darin@apple.com>
1230 * pcre/pcre_compile.c: Roll back a tiny accidental change in the unused !JAVASCRIPT
1231 side of an #ifdef. This has no effect when using PCRE in JAVASCRIPT mode as we do,
1232 but seems worth rolling back.
1234 2007-07-23 Maciej Stachowiak <mjs@apple.com>
1238 - fix remaining problems with Window shadowing
1241 (VarDeclNode::evaluate): Tweak the special case a little.
1243 2007-07-23 Maciej Stachowiak <mjs@apple.com>
1247 - fix Window shadowing regressions caused by the previous commit.
1250 (VarDeclNode::evaluate): Handle the case of global scope specially.
1252 2007-07-22 Maciej Stachowiak <mjs@apple.com>
1256 -fixed <rdar://problem/5353293> REGRESSION (r24287): 1% i-Bench JS slowdown from JavaScript compatibility fix (14719)
1257 http://bugs.webkit.org/show_bug.cgi?id=14719
1259 My fix for this actually resulted in JS iBench being 1% faster than before the regression
1260 and the Celtic Kane benchmark being 5% faster than before the regression.
1263 (VarDeclNode::handleSlowCase): factored out the slow code path to be out of line.
1264 (VarDeclNode::evaluate): I did a couple of things:
1265 (1) Don't check if the variable is already declared by looking for the property in
1266 the variable object, that code path was dead code.
1267 (2) Special-case the common case where the top of the scope and the variable object
1268 are the same; in that case the variable must always be in the variable object.
1269 (3) Don't return a jsString() of the variable name, nothing uses the return value
1270 from this node types evaluate method.
1273 2007-07-22 Darin Adler <darin@apple.com>
1275 Reviewed by Kevin Decker.
1277 - fix <rdar://problem/5126394> REGRESSION: Crash after clicking back button in test application (13250)
1278 http://bugs.webkit.org/show_bug.cgi?id=13250
1280 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1281 If the object returns 0 for _imp, convert that to "undefined", since callers
1282 can't cope with a JSValue of 0.
1284 2007-07-19 Geoffrey Garen <ggaren@apple.com>
1286 Reviewed by Darin Adler.
1288 Fixed http://bugs.webkit.org/show_bug.cgi?id=10880 | <rdar://problem/5335694>
1289 REGRESSION: JavaScript menu doesn't appear on pricepoint.com (14595)
1291 Though the ECMA spec says auto-semicolon insertion should not occur
1292 without a newline or '}', Firefox treats do-while specially, and the
1293 library used by pricepoint.com requires that special treatment.
1295 * JavaScriptCore.xcodeproj/project.pbxproj:
1298 2007-07-19 Darin Adler <darin@apple.com>
1302 - fix <rdar://problem/5345440> PCRE computes wrong length for expressions with quantifiers
1303 on named recursion or subexpressions
1305 It's challenging to implement proper preflighting for compiling these advanced features.
1306 But we don't want them in the JavaScript engine anyway.
1308 Turned off the following features of PCRE (some of these are simply parsed and not implemented):
1310 \C \E \G \L \N \P \Q \U \X \Z
1313 (?#) (?<=) (?<!) (?>)
1318 Added the following:
1322 Because of \v, the js1_2/regexp/special_characters.js test now passes.
1324 To be conservative, I left some features that JavaScript doesn't want, such as
1325 \012 and \x{2013}, in place. We can revisit these later; they're not directly-enough
1326 related to avoiding the incorrect preflighting.
1328 I also didn't try to remove unused opcodes and remove code from the execution engine.
1329 That could save code size and speed things up a bit, but it would require more changes.
1332 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the sanitizePattern workaround for
1333 lack of \u support, since the PCRE code now has \u support.
1335 * pcre/pcre-config.h: Set JAVASCRIPT to 1.
1336 * pcre/pcre_internal.h: Added ESC_v.
1338 * pcre/pcre_compile.c: Added a different escape table for when JAVASCRIPT is set that
1339 omits all the escapes we don't want interpreted and includes '\v'.
1340 (check_escape): Put !JAVASCRIPT around the code for '\l', '\L', '\N', '\u', and '\U',
1341 and added code to handle '\u2013' inside JAVASCRIPT.
1342 (compile_branch): Put !JAVASCRIPT if around all the code implementing the features we
1344 (pcre_compile2): Ditto.
1346 * tests/mozilla/expected.html: Updated since js1_2/regexp/special_characters.js now
1349 2007-07-18 Darin Adler <darin@apple.com>
1351 Reviewed by Oliver Hunt.
1353 - fix <rdar://problem/5345432> PCRE computes length wrong for expressions such as "[**]"
1355 Test: fast/js/regexp-charclass-crash.html
1357 * pcre/pcre_compile.c: (pcre_compile2): Fix the preflight code that calls
1358 check_posix_syntax to match the actual regular expression compilation code;
1359 before it was missing the check of the first character.
1361 2007-07-19 Holger Hans Peter Freyther <zecke@selfish.org>
1365 Define __BUILDING_GDK when building for Gdk to fix building testkjs on OSX.
1367 * JavaScriptCore.pri:
1369 2007-07-18 Simon Hausmann <hausmann@kde.org>
1371 * Fix the Qt build, call dftables from the right directory.
1373 Reviewed by Adam Treat.
1377 2007-07-18 Simon Hausmann <hausmann@kde.org>
1381 Don't call gcc directly when building the dftables tool but use a separate .pro file for the Qt build.
1383 * pcre/dftables.pro: Added.
1386 2007-07-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1388 Reviewed by Darin, Maciej, and Adam.
1390 Fixes <http://bugs.webkit.org/show_bug.cgi?id=9697>,
1391 the failure of ecma/GlobalObject/15.1.2.2-2.js,
1392 the failure of ecma/LexicalConventions/7.7.3-1.js,
1393 and most of the failures of tests in ecma/TypeConversion/9.3.1-3.js.
1395 Bug 9697: parseInt results may be inaccurate for numbers greater than 2^53
1397 This patch also fixes similar issues in the lexer and UString::toDouble().
1400 (KJS::parseIntOverflow):
1406 (KJS::UString::toDouble):
1407 * tests/mozilla/expected.html:
1409 2007-07-16 Sam Weinig <sam@webkit.org>
1413 Turn off -Wshorten-64-to-32 warning for 64-bit builds.
1415 * Configurations/Base.xcconfig:
1417 2007-07-14 Brady Eidson <beidson@apple.com>
1419 Reviewed by Sam Weinig
1421 Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser
1423 * wtf/Platform.h: Add ENABLE_FTPDIR feature to handle building on platforms that don't have the
1424 proper network-layer support
1426 2007-07-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1430 Fixes http://bugs.webkit.org/show_bug.cgi?id=13517,
1431 http://bugs.webkit.org/show_bug.cgi?id=14237, and
1432 the failure of test js1_5/Scope/regress-185485.js
1434 Bug 13517: DOM Exception 8 in finance.aol.com sub-page
1435 Bug 14237: Javascript "var" statement interprets initialization in the topmost function scope
1438 (VarDeclNode::evaluate):
1439 * tests/mozilla/expected.html:
1441 2007-07-12 Alexey Proskuryakov <ap@webkit.org>
1445 http://bugs.webkit.org/show_bug.cgi?id=14596
1446 Fix JSC compilation with KJS_VERBOSE.
1449 (KJS::FunctionImp::passInParameters):
1451 2007-07-11 George Staikos <staikos@kde.org>
1455 * ForwardingHeaders: Added.
1456 * ForwardingHeaders/JavaScriptCore: Added.
1457 * ForwardingHeaders/JavaScriptCore/APICast.h: Added.
1458 * ForwardingHeaders/JavaScriptCore/JSBase.h: Added.
1459 * ForwardingHeaders/JavaScriptCore/JSContextRef.h: Added.
1460 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
1461 * ForwardingHeaders/JavaScriptCore/JSObjectRef.h: Added.
1462 * ForwardingHeaders/JavaScriptCore/JSStringRef.h: Added.
1463 * ForwardingHeaders/JavaScriptCore/JSStringRefCF.h: Added.
1464 * ForwardingHeaders/JavaScriptCore/JSValueRef.h: Added.
1465 * ForwardingHeaders/JavaScriptCore/JavaScriptCore.h: Added.
1467 2007-07-11 Holger Hans Peter Freyther <zecke@selfish.org>
1471 As of http://bugs.webkit.org/show_bug.cgi?id=14527 move the
1472 WebCore/ForwardingHeader/JavaScriptCore to JavaScriptCore
1474 * ForwardingHeaders: Added.
1475 * ForwardingHeaders/JavaScriptCore: Copied from WebCore/ForwardingHeaders/JavaScriptCore.
1477 2007-07-11 Nikolas Zimmermann <zimmermann@kde.org>
1481 Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
1482 Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
1484 * kjs/create_hash_table:
1486 2007-07-09 Maciej Stachowiak <mjs@apple.com>
1490 - 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
1492 * JavaScriptCore.exp: Added needed export.
1494 2007-07-06 Maciej Stachowiak <mjs@apple.com>
1498 - <rdar://problem/5311093> JavaScriptCore fails to build with strict-aliasing warnings
1500 * Configurations/Base.xcconfig: Re-enable -Wstrict-aliasing
1501 * bindings/jni/jni_utility.cpp:
1502 (KJS::Bindings::getJNIEnv): Type-pun via a union instead of a pointer cast.
1504 (WTF::): Instead of doing type-punned assignments via pointer cast, do one of three things:
1505 (1) assign directly w/o cast if storage type matches real type; (2) assign using cast
1506 via union if type does not need reffing; (3) copy with memcpy and ref/deref manually if type
1507 needs reffing. This is ok peref-wise because memcpy of a constant length gets optomized.
1508 HashTraits are now expected to make ref()/deref() take the storage type, not the true type.
1510 (WTF::): Same basic idea.
1512 (WTF::): Added Assigner template for use by HashMap/HashSet. Change RefCounter to call ref()
1513 and deref() via storage type, avoiding the need to
1515 (WTF::RefCounter::ref): ditto
1516 (WTF::RefCounter::deref): ditto
1518 (WTF::): Change ref() and deref() for RefPtr HashTraits to take the storage type; cast
1519 via union to pointer type.
1520 * wtf/FastMalloc.cpp:
1521 (WTF::TCMalloc_PageHeap::init): Changed from constructor to init function so this can go in a union.
1522 (WTF::): redefine pageheap macro in terms of getPageHeap().
1523 (WTF::getPageHeap): new inline function, helper for pageheap macro. This hides the cast in a union.
1524 (WTF::TCMalloc_ThreadCache::InitModule): Call init() instead of using placement new to initialize page
1527 (TCMalloc_PageMap1::init): Changed from constructor to init function.
1528 (TCMalloc_PageMap2::init): ditto
1529 (TCMalloc_PageMap3::init): ditto
1532 2007-07-06 George Staikos <staikos@kde.org>
1536 Switch USE(ICONDATABASE) to ENABLE(ICONDATABASE)
1540 2007-07-03 Sam Weinig <sam@webkit.org>
1544 Eleventh round of fixes for implicit 64-32 bit conversion errors.
1545 <rdar://problem/5292262>
1547 - Fixes a real bug where where we were setting long long and unsigned long long
1548 values to a long field.
1550 * bindings/objc/objc_utility.mm:
1551 (KJS::Bindings::convertValueToObjcValue):
1553 2007-07-03 Sam Weinig <sam@webkit.org>
1555 Reviewed by Brady Eidson.
1557 Tenth round of fixes for implicit 64-32 bit conversion errors.
1558 <rdar://problem/5292262>
1560 - Add explicit casts.
1565 2007-07-02 Sam Weinig <sam@webkit.org>
1567 Reviewed by Kevin McCullough.
1569 Fourth round of fixes for implicit 64-32 bit conversion errors.
1570 <rdar://problem/5292262>
1572 Add custom piDouble and piFloat constants to use instead of M_PI.
1574 * kjs/math_object.cpp:
1575 (MathObjectImp::getValueProperty):
1579 2007-06-29 Sam Weinig <sam@webkit.org>
1583 Second pass at fixing implicit 64-32 bit conversion errors.
1584 <rdar://problem/5292262>
1586 - Add a toFloat() method to JSValue for float conversion.
1588 * JavaScriptCore.exp:
1590 (KJS::JSValue::toFloat):
1593 2007-06-27 Kevin McCullough <kmccullough@apple.com>
1597 - <rdar://problem/5271937> REGRESSION: Apparent WebKit JavaScript memory smasher when submitting comment to iWeb site (crashes in kjs_pcre_compile2)
1598 - Correctly evaluate the return value of _pcre_ucp_findchar.
1600 * pcre/pcre_compile.c:
1605 2007-06-27 Sam Weinig <sam@webkit.org>
1609 First pass at fixing implicit 64-32 bit conversion errors.
1610 <rdar://problem/5292262>
1612 - Add 'f' suffix where necessary.
1615 (StopWatch::getElapsedMS):
1617 2007-06-26 Geoffrey Garen <ggaren@apple.com>
1619 Reviewed by Maciej Stachowiak.
1621 Fixed <rdar://problem/5296627> JSGarbageCollect headerdoc suggests that
1622 using JavaScriptCore requires leaking memory
1624 * API/JSBase.h: Changed documentation to explain that you can pass NULL
1625 to JSGarbageCollect.
1627 2007-06-26 Adam Treat <adam@staikos.net>
1629 Reviewed by Adam Roben.
1631 Make the SQLite icon database optional.
1635 2007-06-15 George Staikos <staikos@kde.org>
1637 More missing files for Qt.
1639 * JavaScriptCore.pri:
1642 2007-06-15 George Staikos <staikos@kde.org>
1644 Another Qt build fix.
1646 * JavaScriptCore.pri:
1649 2007-06-15 George Staikos <staikos@kde.org>
1653 * JavaScriptCore.pri:
1655 2007-06-20 Mark Rowe <mrowe@apple.com>
1659 Fix http://bugs.webkit.org/show_bug.cgi?id=14244
1660 Bug 14244: Data corruption when using a replace() callback function with data containing "$"
1662 * kjs/string_object.cpp:
1663 (KJS::replace): When 'replacement' is a function, do not replace $n placeholders in its return value.
1664 This matches the behaviour described in ECMA 262 3rd Ed section 15.5.4.1, and as implemented in Firefox.
1666 2007-06-14 Anders Carlsson <andersca@apple.com>
1670 * bindings/runtime_object.cpp:
1671 (RuntimeObjectImp::canPut):
1673 2007-06-14 Anders Carlsson <andersca@apple.com>
1677 <rdar://problem/5103077>
1678 Crash at _NPN_ReleaseObject when quitting page at http://eshop.macsales.com/shop/ModBook
1680 <rdar://problem/5183692>
1681 http://bugs.webkit.org/show_bug.cgi?id=13547
1682 REGRESSION: Crash in _NPN_ReleaseObject when closing Safari on nba.com (13547)
1684 <rdar://problem/5261499>
1685 CrashTracer: [USER] 75 crashes in Safari at com.apple.JavaScriptCore: KJS::Bindings::CInstance::~CInstance + 40
1687 Have the root object track all live instances of RuntimeObjectImp. When invalidating
1688 the root object, also invalidate all live runtime objects by zeroing out their instance ivar.
1689 This prevents instances from outliving their plug-ins which lead to crashes.
1691 * bindings/c/c_utility.cpp:
1692 (KJS::Bindings::convertValueToNPVariant):
1693 * bindings/jni/jni_jsobject.cpp:
1694 (JavaJSObject::convertValueToJObject):
1695 * bindings/jni/jni_utility.cpp:
1696 (KJS::Bindings::convertValueToJValue):
1697 * bindings/objc/objc_runtime.mm:
1698 (ObjcFallbackObjectImp::callAsFunction):
1699 * bindings/runtime_array.cpp:
1700 (RuntimeArray::RuntimeArray):
1701 * bindings/runtime_array.h:
1702 (KJS::RuntimeArray::getConcreteArray):
1703 * bindings/runtime_method.cpp:
1704 (RuntimeMethod::callAsFunction):
1705 * bindings/runtime_method.h:
1706 * bindings/runtime_object.cpp:
1707 (RuntimeObjectImp::RuntimeObjectImp):
1708 (RuntimeObjectImp::~RuntimeObjectImp):
1709 (RuntimeObjectImp::invalidate):
1710 (RuntimeObjectImp::fallbackObjectGetter):
1711 (RuntimeObjectImp::fieldGetter):
1712 (RuntimeObjectImp::methodGetter):
1713 (RuntimeObjectImp::getOwnPropertySlot):
1714 (RuntimeObjectImp::put):
1715 (RuntimeObjectImp::canPut):
1716 (RuntimeObjectImp::defaultValue):
1717 (RuntimeObjectImp::implementsCall):
1718 (RuntimeObjectImp::callAsFunction):
1719 (RuntimeObjectImp::getPropertyNames):
1720 (RuntimeObjectImp::throwInvalidAccessError):
1721 * bindings/runtime_object.h:
1722 * bindings/runtime_root.cpp:
1723 (KJS::Bindings::RootObject::invalidate):
1724 (KJS::Bindings::RootObject::addRuntimeObject):
1725 (KJS::Bindings::RootObject::removeRuntimeObject):
1726 * bindings/runtime_root.h:
1728 2007-06-14 Anders Carlsson <andersca@apple.com>
1732 <rdar://problem/5244948>
1733 Safari keeps on complaining about slow script playing NBC TV video (14133)
1735 http://bugs.webkit.org/show_bug.cgi?id=14133
1736 Runaway JavaScript timer fires when spinning around in Google Maps street view
1738 Make sure to start and stop the timeout checker around calls to JS.
1740 * bindings/NP_jsobject.cpp:
1741 (_NPN_InvokeDefault):
1744 * bindings/jni/jni_jsobject.cpp:
1745 (JavaJSObject::call):
1746 (JavaJSObject::eval):
1748 2007-06-13 Darin Adler <darin@apple.com>
1750 Reviewed by Mark Rowe.
1752 - fix http://bugs.webkit.org/show_bug.cgi?id=14132
1753 array sort with > 10000 elements sets elements > 10000 undefined
1755 Test: fast/js/sort-large-array.html
1757 * kjs/array_instance.h: Replaced pushUndefinedObjectsToEnd with
1758 compactForSorting, and removed ExecState parameters.
1760 * kjs/array_object.cpp:
1761 (ArrayInstance::sort): Changed to call compactForSorting.
1762 (ArrayInstance::compactForSorting): Do the get and delete of the
1763 properties directly on the property map instead of using public
1764 calls from JSObject. The public calls would just read the undefined
1765 values from the compacted sort results array!
1767 2007-06-13 George Staikos <staikos@kde.org>
1771 Fix Mac OS X build after last checkin.
1775 2007-06-14 Lars Knoll <lars@trolltech.com>
1779 Disable FastMalloc for the Qt build and make sure we
1780 don't reimplement the global new/delete operators
1781 when using the system malloc.
1783 * wtf/FastMalloc.cpp:
1787 2007-06-13 Anders Carlsson <andersca@apple.com>
1791 Make sure that bindings instances get correct root objects.
1793 * JavaScriptCore.exp:
1794 * bindings/NP_jsobject.cpp:
1795 (listFromVariantArgs):
1796 (_NPN_InvokeDefault):
1799 * bindings/c/c_instance.cpp:
1800 (KJS::Bindings::CInstance::invokeMethod):
1801 (KJS::Bindings::CInstance::invokeDefaultMethod):
1802 * bindings/c/c_runtime.cpp:
1803 (KJS::Bindings::CField::valueFromInstance):
1804 * bindings/c/c_utility.cpp:
1805 (KJS::Bindings::convertNPVariantToValue):
1806 * bindings/c/c_utility.h:
1807 * bindings/objc/objc_instance.mm:
1808 (ObjcInstance::invokeMethod):
1809 (ObjcInstance::invokeDefaultMethod):
1810 (ObjcInstance::getValueOfUndefinedField):
1811 * bindings/objc/objc_runtime.mm:
1812 (ObjcField::valueFromInstance):
1813 (ObjcArray::valueAt):
1814 * bindings/objc/objc_utility.h:
1815 * bindings/objc/objc_utility.mm:
1816 (KJS::Bindings::convertObjcValueToValue):
1817 * bindings/runtime.h:
1819 2007-06-13 Simon Hausmann <hausmann@kde.org>
1823 * kjs/testkjs.pro: WebKitQt is now called QtWebKit.
1825 2007-06-12 Anders Carlsson <andersca@apple.com>
1829 * bindings/qt/qt_instance.cpp:
1830 (KJS::Bindings::QtInstance::invokeMethod):
1832 2007-06-12 Anders Carlsson <andersca@apple.com>
1836 Move the notion of field type to the JNI runtime since that's the only
1837 one that was actually using it.
1839 * bindings/c/c_runtime.h:
1840 (KJS::Bindings::CField::CField):
1841 * bindings/jni/jni_runtime.h:
1842 * bindings/objc/objc_runtime.h:
1843 * bindings/objc/objc_runtime.mm:
1844 * bindings/qt/qt_runtime.h:
1845 * bindings/runtime.h:
1846 * bindings/runtime_method.cpp:
1848 2007-06-12 Anders Carlsson <andersca@apple.com>
1852 * bindings/qt/qt_class.cpp:
1853 (KJS::Bindings::QtClass::methodsNamed):
1854 * bindings/qt/qt_instance.cpp:
1855 (KJS::Bindings::QtInstance::invokeMethod):
1857 2007-06-12 Anders Carlsson <andersca@apple.com>
1861 Get rid of the MethodList class and use a good ol' Vector instead.
1863 * bindings/c/c_class.cpp:
1864 (KJS::Bindings::CClass::methodsNamed):
1865 * bindings/c/c_instance.cpp:
1866 (KJS::Bindings::CInstance::invokeMethod):
1867 * bindings/jni/jni_class.cpp:
1868 (JavaClass::JavaClass):
1869 (JavaClass::~JavaClass):
1870 * bindings/jni/jni_instance.cpp:
1871 (JavaInstance::invokeMethod):
1872 * bindings/objc/objc_class.mm:
1873 (KJS::Bindings::ObjcClass::methodsNamed):
1874 * bindings/objc/objc_instance.mm:
1875 (ObjcInstance::invokeMethod):
1876 * bindings/objc/objc_runtime.mm:
1877 (ObjcFallbackObjectImp::callAsFunction):
1878 * bindings/runtime.cpp:
1879 * bindings/runtime.h:
1880 * bindings/runtime_method.cpp:
1881 (RuntimeMethod::lengthGetter):
1882 (RuntimeMethod::callAsFunction):
1883 * bindings/runtime_object.cpp:
1884 (RuntimeObjectImp::getOwnPropertySlot):
1886 2007-06-12 Anders Carlsson <andersca@apple.com>
1890 Make RuntimeMethod's method list a pointer so that the object size doesn't
1891 grow beyond 32 bytes when we later will replace MethodList with a Vector.
1893 * bindings/runtime_method.cpp:
1894 (RuntimeMethod::RuntimeMethod):
1895 (RuntimeMethod::lengthGetter):
1896 (RuntimeMethod::callAsFunction):
1897 * bindings/runtime_method.h:
1899 2007-06-12 Anders Carlsson <andersca@apple.com>
1903 Get rid of the Parameter class.
1905 * bindings/jni/jni_instance.cpp:
1906 (JavaInstance::invokeMethod):
1907 * bindings/jni/jni_runtime.cpp:
1908 (JavaMethod::signature):
1909 * bindings/jni/jni_runtime.h:
1910 (KJS::Bindings::JavaParameter::JavaParameter):
1911 (KJS::Bindings::JavaParameter::~JavaParameter):
1912 (KJS::Bindings::JavaParameter::type):
1913 (KJS::Bindings::JavaMethod::parameterAt):
1914 (KJS::Bindings::JavaMethod::numParameters):
1915 * bindings/runtime.h:
1917 2007-06-12 Anders Carlsson <andersca@apple.com>
1921 * bindings/qt/qt_class.h:
1923 2007-06-12 Mark Rowe <mrowe@apple.com>
1927 * bindings/objc/objc_runtime.h:
1929 2007-06-12 Anders Carlsson <andersca@apple.com>
1933 Get rid of Constructor and its only subclass JavaConstructor.
1935 * bindings/c/c_class.h:
1936 * bindings/jni/jni_class.cpp:
1937 (JavaClass::JavaClass):
1938 (JavaClass::~JavaClass):
1939 * bindings/jni/jni_class.h:
1940 * bindings/jni/jni_runtime.cpp:
1941 * bindings/jni/jni_runtime.h:
1942 * bindings/objc/objc_class.h:
1943 * bindings/runtime.h:
1945 2007-06-12 Anders Carlsson <andersca@apple.com>
1949 Use RetainPtr throughout the bindings code.
1951 * bindings/objc/objc_class.h:
1952 * bindings/objc/objc_class.mm:
1953 (KJS::Bindings::ObjcClass::ObjcClass):
1954 (KJS::Bindings::ObjcClass::methodsNamed):
1955 (KJS::Bindings::ObjcClass::fieldNamed):
1956 * bindings/objc/objc_instance.h:
1957 (KJS::Bindings::ObjcInstance::getObject):
1958 * bindings/objc/objc_instance.mm:
1959 (ObjcInstance::ObjcInstance):
1960 (ObjcInstance::~ObjcInstance):
1961 (ObjcInstance::implementsCall):
1962 (ObjcInstance::invokeMethod):
1963 (ObjcInstance::invokeDefaultMethod):
1964 (ObjcInstance::defaultValue):
1965 * bindings/objc/objc_runtime.h:
1966 (KJS::Bindings::ObjcMethod::setJavaScriptName):
1967 (KJS::Bindings::ObjcMethod::javaScriptName):
1968 (KJS::Bindings::ObjcArray::getObjcArray):
1969 * bindings/objc/objc_runtime.mm:
1971 (ObjcArray::ObjcArray):
1972 (ObjcArray::setValueAt):
1973 (ObjcArray::valueAt):
1974 (ObjcArray::getLength):
1977 2007-06-12 Anders Carlsson <andersca@apple.com>
1981 Have JSCell inherit from Noncopyable.
1983 * bindings/objc/objc_runtime.h:
1984 * bindings/runtime_object.h:
1987 2007-06-12 Anders Carlsson <andersca@apple.com>
1989 Reviewed by Darin and Maciej.
1991 More cleanup. Use our Noncopyable WTF class, add a root object member
1994 * bindings/c/c_class.h:
1995 * bindings/jni/jni_class.h:
1996 * bindings/jni/jni_instance.h:
1997 * bindings/jni/jni_runtime.cpp:
1998 (JavaArray::JavaArray):
1999 * bindings/jni/jni_runtime.h:
2000 * bindings/objc/objc_class.h:
2001 * bindings/objc/objc_runtime.h:
2002 * bindings/objc/objc_runtime.mm:
2003 (ObjcArray::ObjcArray):
2004 * bindings/objc/objc_utility.mm:
2005 (KJS::Bindings::convertObjcValueToValue):
2006 * bindings/runtime.cpp:
2007 (KJS::Bindings::Array::Array):
2008 (KJS::Bindings::Array::~Array):
2009 * bindings/runtime.h:
2010 * bindings/runtime_object.h:
2011 * bindings/runtime_root.h:
2013 2007-06-08 Zack Rusin <zrusin@trolltech.com>
2017 * bindings/qt/qt_instance.cpp:
2018 (KJS::Bindings::QtInstance::QtInstance):
2019 * bindings/qt/qt_instance.h:
2021 2007-06-07 Anders Carlsson <andersca@apple.com>
2025 Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.
2027 * bindings/c/c_instance.cpp:
2028 (KJS::Bindings::CInstance::CInstance):
2029 * bindings/c/c_instance.h:
2030 * bindings/jni/jni_instance.cpp:
2031 (JavaInstance::JavaInstance):
2032 * bindings/jni/jni_instance.h:
2033 * bindings/jni/jni_jsobject.cpp:
2034 (JavaJSObject::convertJObjectToValue):
2035 * bindings/objc/objc_instance.h:
2036 * bindings/objc/objc_instance.mm:
2037 (ObjcInstance::ObjcInstance):
2038 * bindings/runtime.cpp:
2039 (KJS::Bindings::Instance::Instance):
2040 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2041 * bindings/runtime.h:
2043 2007-06-07 Anders Carlsson <andersca@apple.com>
2047 Don't use a JavaInstance to store the field when all we want to do is to keep the field
2048 from being garbage collected. Instead, use a JObjectWrapper.
2050 * bindings/jni/jni_instance.h:
2051 * bindings/jni/jni_runtime.cpp:
2052 (JavaField::JavaField):
2053 (JavaField::dispatchValueFromInstance):
2054 (JavaField::dispatchSetValueToInstance):
2055 * bindings/jni/jni_runtime.h:
2056 (KJS::Bindings::JavaField::JavaField):
2057 (KJS::Bindings::JavaField::operator=):
2059 2007-05-30 Alp Toker <alp.toker@collabora.co.uk>
2063 Enable logging in the Gdk port.
2064 http://bugs.webkit.org/show_bug.cgi?id=13936
2066 * wtf/Assertions.cpp:
2067 * wtf/Assertions.h: Add WTFLogVerbose which also logs
2068 the file, line number and function.
2070 2007-05-30 Mark Rowe <mrowe@apple.com>
2072 Mac build fix. Update #include.
2074 * API/JSCallbackFunction.h:
2076 2007-05-30 Luciano Montanaro <mikelima@cirulla.net>
2080 - cross-port Harri Porten's commits 636099 and 636108 from KJS:
2081 "publish a class anyway public already" and "class is being used from
2082 outside for quite some time" in preparation for further syncronizations
2085 * kjs/date_object.cpp:
2086 * kjs/date_object.h:
2089 (KJS::InternalFunctionImp::classInfo):
2090 (KJS::InternalFunctionImp::functionName):
2091 * kjs/function_object.h:
2094 (KJS::getStaticPropertySlot):
2095 (KJS::getStaticFunctionSlot):
2096 (KJS::getStaticValueSlot):
2097 * kjs/object_object.h:
2099 2007-05-29 Sam Weinig <sam@webkit.org>
2101 Reviewed by Adam Roben.
2103 Cleanup function and fix to match comparison API.
2105 * kjs/string_object.cpp:
2106 (KJS::substituteBackreferences):
2107 (KJS::localeCompare):
2109 2007-05-28 Geoffrey Garen <ggaren@apple.com>
2111 Slight clarification to an exception message.
2113 * API/JSCallbackObject.cpp:
2114 (KJS::JSCallbackObject::put):
2116 2007-05-27 Holger Freyther <zecke@selfish.org>
2118 Reviewed by Mark Rowe.
2120 * wtf/Platform.h: Move Gdk up to allow building WebKit/Gdk on Darwin
2122 2007-05-27 Darin Adler <darin@apple.com>
2124 - fix a couple ifdefs that said WIN instead of WIN_OS
2126 * kjs/collector.cpp:
2127 (KJS::allocateBlock): WIN -> WIN_OS
2128 (KJS::freeBlock): Ditto.
2130 2007-05-26 Sam Weinig <sam@webkit.org>
2134 Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
2135 Port of commit 667785 from kjs
2137 - special case calling String.localeCompare() with no parameters to return 0.
2139 * kjs/string_object.cpp:
2140 (KJS::StringProtoFunc::callAsFunction):
2142 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
2146 - Fix for http://bugs.webkit.org/show_bug.cgi?id=13456
2147 REGRESSION: setTimeout "arguments" object gets shadowed by a local variable
2149 - Add a explicit check for arguments. Previously check was done with getDirect,
2150 but since the arguments is created on-demand in ActivationImp, it doesn't
2151 show up in the test. 'arguments' should always be in the VarDeclNode's
2155 (VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'
2157 2007-05-25 George Staikos <staikos@kde.org>
2161 - Use COMPILER(GCC), not PLATFORM(GCC) - as Platform.h defines
2165 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
2169 - http://bugs.webkit.org/show_bug.cgi?id=13623 (Decompilation of function
2170 doesn't compile with "++(x,y)")
2171 - Create the error node based on the actual node, not the node inside
2173 - Fix applies to postfix, prefix and typeof operators
2174 - Produces run-time ReferenceError like other non-lvalue assignments etc.
2176 * kjs/grammar.y: Create {Prefix,Postfix}ErrorNode based on the actual node,
2177 not the based on the node returned by "nodeInsideAllParens()". Same for
2180 2007-05-25 Simon Hausmann <hausmann@kde.org>
2184 Fix crash in Qt JavaScript bindings when the arguments used on the Qt side are not
2185 registered with QMetaType.
2187 * bindings/qt/qt_instance.cpp:
2188 (KJS::Bindings::QtInstance::invokeMethod):
2189 * bindings/qt/qt_runtime.cpp:
2191 2007-05-24 Luciano Montanaro <mikelima@cirulla.net>
2195 Patch for http://bugs.webkit.org/show_bug.cgi?id=13855
2196 Port patch 666176 to JavaScriptCore
2198 - Renamed JSValue::downcast() to JSValue::asCell() which makes the
2199 function meaning cleaner. It's modeled after Harri Porten change in
2202 * kjs/collector.cpp:
2203 (KJS::Collector::protect):
2204 (KJS::Collector::unprotect):
2205 (KJS::Collector::collectOnMainThreadOnly):
2207 (KJS::JSValue::isObject):
2208 * kjs/string_object.cpp:
2209 (KJS::StringProtoFunc::callAsFunction):
2211 (KJS::JSValue::asCell):
2212 (KJS::JSValue::isNumber):
2213 (KJS::JSValue::isString):
2214 (KJS::JSValue::isObject):
2215 (KJS::JSValue::getNumber):
2216 (KJS::JSValue::getString):
2217 (KJS::JSValue::getObject):
2218 (KJS::JSValue::getUInt32):
2219 (KJS::JSValue::mark):
2220 (KJS::JSValue::marked):
2221 (KJS::JSValue::type):
2222 (KJS::JSValue::toPrimitive):
2223 (KJS::JSValue::toBoolean):
2224 (KJS::JSValue::toNumber):
2225 (KJS::JSValue::toString):
2226 (KJS::JSValue::toObject):
2228 2007-05-18 Holger Hans Peter Freyther <zecke@selfish.org>
2230 Reviewed by Mark Rowe.
2232 * kjs/testkjs.pro: Make the Gdk port link to icu
2234 2007-05-15 Geoffrey Garen <ggaren@apple.com>
2236 Reviewed by Adele Peterson.
2238 It helps if you swap the right variable.
2243 2007-05-15 Lars Knoll <lars@trolltech.com>
2247 Extend the QObject JavaScript bindings to work for slots with
2250 * bindings/qt/qt_instance.cpp:
2251 (KJS::Bindings::QtInstance::invokeMethod):
2253 2007-05-14 Kimmo Kinnunen <kimmok@iki.fi>
2257 - Fixes http://bugs.webkit.org/show_bug.cgi?id=13622 (Decompiler
2258 omits trailing comma in array literal)
2260 * kjs/nodes2string.cpp:
2261 (ArrayNode::streamTo): print extra ',' in case there was elision
2262 commas (check opt member var) and array elements present
2263 in the array expression
2265 2007-05-14 Geoffrey Garen <ggaren@apple.com>
2267 Reviewed by Oliver Hunt.
2269 Added HashMap::swap and HashSet::swap. WebCore now uses HashSet::swap.
2270 I figured while I was in the neighborhood I might as well add HashMap::swap,
2280 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
2284 - Fix for bug http://bugs.webkit.org/show_bug.cgi?id=13620
2285 Bogus decompilation of "for (var j = 1 in [])"
2286 - ForInNode toString()'ed to syntax error if there was var decl
2288 - ForNode toStringed()'ed lost 'var ' if it was present
2290 * kjs/nodes2string.cpp:
2291 (VarDeclListNode::streamTo): Print "var " here
2292 (VarStatementNode::streamTo): Don't print "var " here
2293 (ForNode::streamTo): Remove TODO comment, VarDeclListNode will
2295 (ForInNode::streamTo): ForIn initializer is printed by VarDeclNode
2297 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
2301 - Fixes http://bugs.webkit.org/show_bug.cgi?id=10878
2302 (Incorrect decompilation for "4..x")
2303 - Group numbers in dotted expressions in toString() output, so we
2304 avoid the 4.x constructs when the original input is 4..x.
2305 4..x means the same as 4. .x or (4).x or Number(4).x
2307 * kjs/nodes2string.cpp:
2308 (KJS::SourceStream::):
2309 Add boolean flag to indicate that if next item is a number, it should be grouped.
2310 Add new formatting enum which turns on the boolean flag.
2311 (KJS::SourceStream::SourceStream): Added. Initialize the flag.
2312 (SourceStream::operator<<): Added. New overloaded operator with double value as parameter.
2313 (NumberNode::streamTo): Use the double operator
2314 (ArrayNode::streamTo):
2315 (DotAccessorNode::streamTo):
2316 (FunctionCallDotNode::streamTo):
2317 (FunctionCallParenDotNode::streamTo):
2318 (PostfixDotNode::streamTo):
2319 (DeleteDotNode::streamTo):
2320 (PrefixDotNode::streamTo):
2321 (AssignDotNode::streamTo): Use the new formatting enum to turn on the grouping flag.
2323 2007-05-10 Lars Knoll <lars@trolltech.com>
2327 Fix our last three test failures in the JavaScript
2330 * wtf/unicode/qt4/UnicodeQt4.h:
2331 (WTF::Unicode::toLower):
2332 (WTF::Unicode::toUpper):
2334 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2336 Reviewed by Darin Adler.
2338 Fixed #includes of JSStringRefCF.h and use of CF datatypes. I think I
2339 misunderstood this issue before.
2341 * API/JavaScriptCore.h: #include JSStringRefCF.h. Platforms that don't
2342 want this behavior can just #include individual headers, instead of the
2343 umbrella framework header. But we definitely want Mac OS X clients to
2344 get the #include of JSStringRefCF.h "for free."
2345 * API/minidom.c: Don't #include JSStringRefCF.h. (Don't need to #include
2346 JavaScriptCore.h, either.)
2347 * API/testapi.c: Don't #include JSStringRefCF.h. Do use CF datatypes
2348 regardless of whether __APPLE__ is defined. Platforms that don't support
2349 CF just shouldn't compile this file.
2352 2007-05-09 Eric Seidel <eric@webkit.org>
2356 http://bugs.webkit.org/show_bug.cgi?id=6985
2357 Cyclic __proto__ values cause WebKit to hang
2360 (KJS::JSObject::put): do a cycle check before setting __proto__
2362 2007-05-08 Kimmo Kinnunen <kimmok@iki.fi>
2364 Reviewed by darin. Landed by eseidel.
2366 - http://bugs.webkit.org/show_bug.cgi?id=10880 (Do..while loop gains
2367 a semicolon each time it is toStringed)
2368 Grammar in Ecma-66262, 12.6: "do Statement while ( Expression );"
2369 EmptyStatement was created after every do..while(expr) which
2370 had semicolon at the end.
2372 * kjs/grammar.y: Require semicolon at the end of do..while
2374 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2376 Build fix -- this time for sure.
2378 APICast.h, being private, ends up in a different folder than JSValueRef.h,
2379 so we can't include one from the other using "". Instead, just forward
2380 declare the relevant data types.
2384 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2386 Build fix: export APICast.h for WebCore and WebKit.
2388 * JavaScriptCore.xcodeproj/project.pbxproj:
2390 2007-05-04 Darin Adler <darin@apple.com>
2394 - fix http://bugs.webkit.org/show_bug.cgi?id=12821
2395 <rdar://problem/5007921> Number.toExponential doesn't work for negative numbers
2397 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2398 Added a call to fabs before calling log10.
2400 2007-05-03 Holger Freyther <freyther@kde.org>
2402 Reviewed by Zack, landed by Simon.
2403 This is bugzilla bug 13499.
2405 * JavaScriptCore.pri: Place Qt into the qt-port scope
2406 * bindings/testbindings.pro: Place Qt into the qt-port scope
2407 * kjs/testkjs.pro: Place Qt into the qt-port scope
2408 * pcre/pcre.pri: Place Qt into the qt-port scope
2410 2007-05-02 David Harrison <harrison@apple.com>
2414 <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
2416 Added insertion support for more than one value.
2420 Added support for inserting multiple values.
2423 New. Insert at the start of vectors. Convenient for vectors used as strings.
2425 2007-05-01 Jungshik Shin <jungshik.shin@gmail.com>
2429 - get rid of non-ASCII lteral characters : suppress compiler warnings
2430 http://bugs.webkit.org/show_bug.cgi?id=13551
2433 * pcre/pcre_compile.c:
2435 2007-04-28 Jungshik Shin <jungshik.shin@gmail.com>
2437 Reviewed by Sam Weinig.
2439 - Replace copyright sign in Latin-1 (0xA9) with '(C)'
2440 http://bugs.webkit.org/show_bug.cgi?id=13531
2442 * bindings/npruntime.h:
2444 2007-04-28 Darin Adler <darin@apple.com>
2448 - fix <rdar://problem/5154144> Hamachi test fails: assertion failure in ListHashSet
2450 Test: fast/forms/add-remove-form-elements-stress-test.html
2452 * wtf/ListHashSet.h:
2453 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Initialize
2454 m_isDoneWithInitialFreeList to false.
2455 (WTF::ListHashSetNodeAllocator::allocate): Added assertions based on a debug-only
2456 m_isAllocated flag that make sure we don't allocate a block that's already allocated.
2457 These assertions helped pinpoint the bug. Set m_isDoneWithInitialFreeList when we
2458 allocate the last block of the initial free list. Once we're done with the initial
2459 free list, turn off the rule that says that the next node in the pool after the last
2460 node in the free list is also free. This rule works because any free nodes are added
2461 to the head of the free list, so a node that hasn't been allocated even once is always
2462 at the tail of the free list and all the nodes after it also haven't been allocated
2463 even once. But it doesn't work any longer once the entire pool has been used at least
2464 once, because there's nothing special about the last node on the free list any more.
2465 (WTF::ListHashSetNodeAllocator::deallocate): Set the node's m_isAllocated to false.
2466 (WTF::ListHashSetNodeAllocator::pastPool): Added. Used above.
2467 (WTF::ListHashSetNodeAllocator::inPool): Changed to use the pastPool function.
2468 (WTF::ListHashSetNode::ListHashSetNode): Initialize m_isAllocated to true.
2469 (WTF::ListHashSetNode::operator new): Removed variable name for unused size
2471 (WTF::ListHashSetNode::destroy): Changed to call the destructor rather than
2472 delete -- this gets rid of the need to define an operator delete.
2474 2007-04-27 Christopher Brichford <chrisb@adobe.com>
2476 Reviewed by Timothy Hatcher.
2478 Fix for: Bug 13211: Move JavaScriptCore mac project files for apollo port
2479 http://bugs.webkit.org/show_bug.cgi?id=13211
2481 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Debug.xcconfig: Added.
2482 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Release.xcconfig: Added.
2483 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcconfig: Added.
2484 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcodeproj/project.pbxproj: Added.
2485 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Removed.
2486 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Removed.
2487 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Removed.
2488 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Removed.
2490 2007-04-27 Holger Freyther <freyther@kde.org>
2494 Remove unmaintained CMake build system.
2496 * CMakeLists.txt: Removed.
2497 * pcre/CMakeLists.txt: Removed.
2499 2007-04-27 Mark Rowe <mrowe@apple.com>
2503 * JavaScriptCore.xcodeproj/project.pbxproj: Improve dependencies in Xcode project
2504 by marking dftables as a dependency of Generate Derived Sources rather than of
2505 JavaScriptCore itself.
2507 2007-04-26 Geoffrey Garen <ggaren@apple.com>
2509 Build fix -- added #includes that we used to get implicitly through
2517 2007-04-26 Geoffrey Garen <ggaren@apple.com>
2519 Reviewed by Maciej Stachowiak, Adam Roben.
2522 <rdar://problem/4885130> Remove #include of JSStringRefCF.h from JSStringRef.h
2523 <rdar://problem/4885123> JavaScriptCore is not cross-platform -- JSStringRef.h references CF datatypes
2525 * API/JSStringRef.h: Removed #include -- no clients need it anymore.
2527 2007-04-25 David Kilzer <ddkilzer@apple.com>
2531 Add assertions for debug builds.
2534 (KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
2535 (KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.
2537 2007-04-25 Maciej Stachowiak <mjs@apple.com>
2541 - fix build problems
2543 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable warning that
2544 gives often downright incorrect results based on guessing what will happen in 64-bit.
2546 2007-04-25 Darin Adler <darin@apple.com>
2550 - tweak the allocator for a small speedup -- Shark showed this was a win, but I can't
2551 measure an improvement right now, but it's also clear these changes do no harm
2553 * wtf/FastMalloc.cpp:
2554 (WTF::LgFloor): Use ALWAYS_INLINE here; in testing I did a while back this was necessary
2555 to get this single-instruction function to be inlined.
2556 (WTF::SizeClass): Use ALWAYS_INLINE here too for the same reason. Also change the special
2557 case for a size of 0 to work without a branch for a bit of extra speed.
2558 (WTF::ByteSizeForClass): Use ALWAYS_INLINE here too for the same reason.
2560 2007-04-24 Maciej Stachowiak <mjs@apple.com>
2564 - use custom calling convention for everything in nodes.cpp on intel gcc for 1.5% speed boost
2566 Nearly all functions in nodes.cpp were marked up to use the
2567 regparm(3) calling convention under GCC for x86, since this is
2568 faster and they are all guaranteed to be called only internally to
2571 The only exception is destructors, since delete doesn't know how to use a custom calling convention.
2574 (dotExprDoesNotAllowCallsString):
2577 (KJS::StatementNode::):
2579 (KJS::BooleanNode::):
2580 (KJS::NumberNode::):
2581 (KJS::StringNode::):
2582 (KJS::RegExpNode::):
2584 (KJS::ResolveNode::):
2586 (KJS::ElementNode::):
2588 (KJS::PropertyNameNode::):
2589 (KJS::PropertyNode::):
2590 (KJS::PropertyListNode::):
2591 (KJS::ObjectLiteralNode::):
2592 (KJS::BracketAccessorNode::):
2593 (KJS::DotAccessorNode::):
2594 (KJS::ArgumentListNode::):
2595 (KJS::ArgumentsNode::):
2596 (KJS::NewExprNode::):
2597 (KJS::FunctionCallValueNode::):
2598 (KJS::FunctionCallResolveNode::):
2599 (KJS::FunctionCallBracketNode::):
2600 (KJS::FunctionCallParenBracketNode::):
2601 (KJS::FunctionCallDotNode::):
2602 (KJS::FunctionCallParenDotNode::):
2603 (KJS::PostfixResolveNode::):
2604 (KJS::PostfixBracketNode::):
2605 (KJS::PostfixDotNode::):
2606 (KJS::PostfixErrorNode::):
2607 (KJS::DeleteResolveNode::):
2608 (KJS::DeleteBracketNode::):
2609 (KJS::DeleteDotNode::):
2610 (KJS::DeleteValueNode::):
2612 (KJS::TypeOfResolveNode::):
2613 (KJS::TypeOfValueNode::):
2614 (KJS::PrefixResolveNode::):
2615 (KJS::PrefixBracketNode::):
2616 (KJS::PrefixDotNode::):
2617 (KJS::PrefixErrorNode::):
2618 (KJS::UnaryPlusNode::):
2619 (KJS::NegateNode::):
2620 (KJS::BitwiseNotNode::):
2621 (KJS::LogicalNotNode::):
2625 (KJS::RelationalNode::):
2627 (KJS::BitOperNode::):
2628 (KJS::BinaryLogicalNode::):
2629 (KJS::ConditionalNode::):
2630 (KJS::AssignResolveNode::):
2631 (KJS::AssignBracketNode::):
2632 (KJS::AssignDotNode::):
2633 (KJS::AssignErrorNode::):
2635 (KJS::AssignExprNode::):
2636 (KJS::VarDeclListNode::):
2637 (KJS::VarStatementNode::):
2638 (KJS::EmptyStatementNode::):
2639 (KJS::ExprStatementNode::):
2641 (KJS::DoWhileNode::):
2644 (KJS::ContinueNode::):
2646 (KJS::ReturnNode::):
2651 (KJS::ParameterNode::):
2653 (KJS::FunctionBodyNode::):
2654 (KJS::FuncExprNode::):
2655 (KJS::FuncDeclNode::):
2656 (KJS::SourceElementsNode::):
2657 (KJS::CaseClauseNode::):
2658 (KJS::ClauseListNode::):
2659 (KJS::SwitchNode::):
2661 2007-04-24 Oliver Hunt <oliver@apple.com>
2663 GTK Build fix, ::findEntry->KJS::findEntry
2666 (KJS::Lookup::findEntry):
2667 (KJS::Lookup::find):
2669 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2673 - compile most of JavaScriptCore as one file for 4% JS iBench speed improvement
2675 * JavaScriptCore.xcodeproj/project.pbxproj: Add AllInOneFile.cpp, and remove files it includes
2677 * kjs/AllInOneFile.cpp: Added.
2678 * kjs/dtoa.cpp: Renamed CONST to CONST_ to avoid conflict.
2680 (Bigint::nrv_alloc):
2681 * kjs/lookup.cpp: Use "namspace KJS { ... }" instead of "using namespace KJS;"
2683 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2685 Build fix, not reviewed.
2687 * kjs/collector.h: Fix struct/class mismatch.
2689 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2693 - raise ALLOCATIONS_PER_COLLECTION to 4000, for 3.7% iBench speed improvement
2695 Now that the cell size is smaller and the block size is bigger, we can fit 4000 objects in
2696 the two spare cells the collector is willing to keep around, so collect a bit less often.
2698 * kjs/collector.cpp:
2700 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2702 Reviewed by Darin and Geoff.
2704 - move mark and collectOnMainThreadOnly bits into separate bitmaps
2706 This saves 4 bytes per cell, allowing shrink of cell size to 32,
2707 which leads to a .8% speed improvement on iBench.
2709 This is only feasible because of all the previous changes on the branch.
2711 * kjs/collector.cpp:
2712 (KJS::allocateBlock): Adjust for some renames of constants.
2713 (KJS::Collector::markStackObjectsConservatively): Now that cells are 32 bytes (64
2714 bytes on 64-bit) the cell alignment check can be made much more strict, and also
2715 obsoletes the need for a % sizeof(CollectorCell) check. Also, we can mask off the low
2716 bits of the pointer to have a potential block pointer to look for.
2717 (KJS::Collector::collectOnMainThreadOnly): Use bitmap.
2718 (KJS::Collector::markMainThreadOnlyObjects): Use bitmap.
2719 (KJS::Collector::collect): When sweeping, use bitmaps directly to find mark bits.
2721 (KJS::): Move needed constants and type declarations here.
2722 (KJS::CollectorBitmap::get): Bit twiddling to get a bitmap value.
2723 (KJS::CollectorBitmap::set): Bit twiddling to set a bitmap bit to true.
2724 (KJS::CollectorBitmap::clear): Bit twiddling to set a bitmap bit to false.
2725 (KJS::CollectorBitmap::clearAll): Clear whole bitmap at one go.
2726 (KJS::Collector::cellBlock): New operation, compute the block pointer for
2727 a cell by masking off low bits.
2728 (KJS::Collector::cellOffset): New operation, compute the cell offset for a
2729 cell by masking off high bits and dividing (actually a shift).
2730 (KJS::Collector::isCellMarked): Check mark bit in bitmap
2731 (KJS::Collector::markCell): Set mark bit in bitmap.
2733 (KJS::JSCell::JSCell): No more bits.
2734 (KJS::JSCell::marked): Let collector handle it.
2735 (KJS::JSCell::mark): Let collector handle it.
2737 2007-04-23 Anders Carlsson <andersca@apple.com>
2741 * kjs/regexp_object.h:
2742 RegExpObjectImpPrivate is a struct, not a class.
2744 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2748 - shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body
2750 I reconciled this with a similar change in KDE kjs by Maks Orlovich <maksim@kde.org>.
2753 (KJS::FunctionImp::callAsFunction):
2754 (KJS::FunctionImp::passInParameters):
2755 (KJS::FunctionImp::lengthGetter):
2756 (KJS::FunctionImp::getParameterName):
2758 * kjs/function_object.cpp:
2759 (FunctionProtoFunc::callAsFunction):
2760 (FunctionObjectImp::construct):
2762 (FunctionBodyNode::addParam):
2763 (FunctionBodyNode::paramString):
2764 (FuncDeclNode::addParams):
2765 (FuncDeclNode::processFuncDecl):
2766 (FuncExprNode::addParams):
2767 (FuncExprNode::evaluate):
2769 (KJS::Parameter::Parameter):
2770 (KJS::FunctionBodyNode::numParams):
2771 (KJS::FunctionBodyNode::paramName):
2772 (KJS::FunctionBodyNode::parameters):
2773 (KJS::FuncExprNode::FuncExprNode):
2774 (KJS::FuncDeclNode::FuncDeclNode):
2775 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because
2776 they handle size_t badly.
2778 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2782 - shrink RegexpObjectImp by 4 bytes
2784 Somewhat inexplicably, this seems to be a .33% speedup on JS iBench.
2786 * kjs/regexp_object.cpp:
2787 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate):
2788 (RegExpObjectImp::RegExpObjectImp):
2789 (RegExpObjectImp::performMatch):
2790 (RegExpObjectImp::arrayOfMatches):
2791 (RegExpObjectImp::getBackref):
2792 (RegExpObjectImp::getLastMatch):
2793 (RegExpObjectImp::getLastParen):
2794 (RegExpObjectImp::getLeftContext):
2795 (RegExpObjectImp::getRightContext):
2796 (RegExpObjectImp::getValueProperty):
2797 (RegExpObjectImp::putValueProperty):
2798 * kjs/regexp_object.h:
2800 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2804 - change to 1-bit bitfields instead of 8-bit, this turns out to lead to a .51% speedup on JS iBench
2806 The 1-bit bitfields are actually faster than just plain bools, at least on Intel (go figure).
2808 * kjs/property_map.h:
2810 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2814 - shrink ArrayInstance objects by 4 bytes
2815 http://bugs.webkit.org/show_bug.cgi?id=13386
2817 I did this by storing the capacity before the beginning of the storage array. It turns out
2818 it is rarely needed and is by definition 0 when the storage array is null.
2820 * kjs/array_instance.h:
2821 (KJS::ArrayInstance::capacity): Get it from the secret stash
2822 * kjs/array_object.cpp:
2823 (allocateStorage): New function to encapsulate allocating the storage with extra space ahead
2825 (reallocateStorage): ditto for realloc
2826 (ArrayInstance::ArrayInstance):
2827 (ArrayInstance::~ArrayInstance):
2828 (ArrayInstance::resizeStorage):
2830 2007-04-23 Darin Adler <darin@apple.com>
2834 - fix <rdar://problem/4840688> REGRESSION (r10588, r10621): JavaScript won't parse
2835 modifications of non-references (breaks 300themovie.warnerbros.com, fedex.com)
2837 Despite the ECMAScript specification's claim that you can treat these as syntax
2838 errors, doing so creates some website incompatibilities. So this patch turns them back
2839 into evaluation errors instead.
2841 Test: fast/js/modify-non-references.html
2843 * kjs/grammar.y: Change makeAssignNode, makePrefixNode, and makePostfixNode so that they
2844 never fail to parse. Update rules that use them. Fix a little bit of indenting. Use
2845 new PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2847 * kjs/nodes.h: Added an overload of throwError that takes a char* argument.
2848 Replaced setExceptionDetailsIfNeeded and debugExceptionIfNeeded with handleException,
2849 which does both. Added PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2851 * kjs/nodes.cpp: Changed exception macros to use handleException; simpler and smaller
2852 code size than the two functions that we used before.
2853 (Node::throwError): Added the overload mentioned above.
2854 (Node::handleException): Added. Contains the code from both setExceptionDetailsIfNeeded
2855 and debugExceptionIfNeeded.
2856 (PostfixErrorNode::evaluate): Added. Throws an exception.
2857 (PrefixErrorNode::evaluate): Ditto.
2858 (AssignErrorNode::evaluate): Ditto.
2859 (ThrowNode::execute): Call handleException instead of debugExceptionIfNeeded; this
2860 effectively adds a call to setExceptionDetailsIfNeeded, which may help with getting
2861 the correct file and line number for these exceptions.
2863 * kjs/nodes2string.cpp:
2864 (PostfixErrorNode::streamTo): Added.
2865 (PrefixErrorNode::streamTo): Added.
2866 (AssignErrorNode::streamTo): Added.
2868 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2872 - fix test failures / crashes on PPC
2874 * kjs/property_map.h: Make the bool fields explicitly 8-bit bitfields, since bool is a full
2875 word there otherwise :-(
2877 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2881 - fix more test case failures
2883 * bindings/runtime_array.cpp:
2884 (RuntimeArray::RuntimeArray): inherit from JSObject instead of ArrayInstance; it turns
2885 out that this class only needs the prototype and classInfo from ArrayInstance, not the
2886 actual class itself, and it was too big otherwise.
2887 (RuntimeArray::getOwnPropertySlot):
2888 * bindings/runtime_array.h:
2890 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2894 - fix some test failures
2896 * bindings/runtime_method.cpp:
2897 (RuntimeMethod::RuntimeMethod): inherit from InternalFunctionImp instead of FunctionImpl,
2898 otherwise this is too big
2899 (RuntimeMethod::getOwnPropertySlot):
2900 * bindings/runtime_method.h:
2902 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2906 - discard the arguments List for an ActivationImp when the corresponding Context is destroyed (1.7% speedup)
2907 http://bugs.webkit.org/show_bug.cgi?id=13385
2909 Based an idea by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>. His patch to do
2910 this also had many other List changes and I found this much simpler subset of the changes
2911 was actually a hair faster.
2913 This optimization is valid because the arguments list is only kept around to
2914 lazily make the arguments object. If it's not made by the time the function
2915 exits, it never will be, since any function that captures the continuation will
2916 have its own local arguments variable in scope.
2918 Besides the 1.7% speed improvement, it shrinks List by 4 bytes
2919 (which in turn shrinks ActivationImp by 4 bytes).
2922 (KJS::Context::~Context): Clear the activation's arguments list.
2924 (KJS::ActivationImp::ActivationImp): Adjusted for list changes.
2925 (KJS::ActivationImp::mark): No need to mark, lists are always protected (this doesn't
2926 cause a ref-cycle for reasons stated above).
2927 (KJS::ActivationImp::createArgumentsObject): Clear arguments list.
2930 (KJS::List::List): No more needsMarking boolean
2931 (KJS::List::operator=): ditto
2933 (KJS::List::List): ditto
2934 (KJS::List::reset): ditto
2935 (KJS::List::deref): ditto
2937 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2941 - shrink PropertyMap by 8 bytes and therefore shrink CELL_SIZE to 40 (for 32-bit;
2942 similar shrinkage for 64-bit)
2943 http://bugs.webkit.org/show_bug.cgi?id=13384
2945 Inspired by similar changes by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>
2946 done in the kjs-tweaks branch of KDE's kjs. However, this version is somewhat
2947 cleaner style-wise and avoids some of the negative speed impact (at least on gcc/x86)
2950 This is nearly a wash performance-wise, maybe a slight slowdown, but worth doing
2951 to eventually reach cell size 32.
2953 * kjs/collector.cpp:
2955 * kjs/property_map.cpp:
2956 (KJS::PropertyMap::~PropertyMap):
2957 (KJS::PropertyMap::clear):
2958 (KJS::PropertyMap::get):
2959 (KJS::PropertyMap::getLocation):
2960 (KJS::PropertyMap::put):
2961 (KJS::PropertyMap::insert):
2962 (KJS::PropertyMap::expand):
2963 (KJS::PropertyMap::rehash):
2964 (KJS::PropertyMap::remove):
2965 (KJS::PropertyMap::mark):
2966 (KJS::PropertyMap::containsGettersOrSetters):
2967 (KJS::PropertyMap::getEnumerablePropertyNames):
2968 (KJS::PropertyMap::getSparseArrayPropertyNames):
2969 (KJS::PropertyMap::save):
2970 (KJS::PropertyMap::checkConsistency):
2971 * kjs/property_map.h:
2972 (KJS::PropertyMap::hasGetterSetterProperties):
2973 (KJS::PropertyMap::setHasGetterSetterProperties):
2974 (KJS::PropertyMap::):
2975 (KJS::PropertyMap::PropertyMap):
2977 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2981 - change blocks to 64k in size, and use various platform-specific calls to allocate at 64k-aligned addresses
2982 http://bugs.webkit.org/show_bug.cgi?id=13383
2984 * kjs/collector.cpp:
2985 (KJS::allocateBlock): New function to allocate 64k of 64k-aligned memory
2986 (KJS::freeBlock): Corresponding free
2987 (KJS::Collector::allocate):
2988 (KJS::Collector::collect):
2990 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2992 Reviewed by Darin and Geoff.
2994 - remove the concept of oversize objects, now that there aren't any (for now
2995 only enforced with an assert).
2996 http://bugs.webkit.org/show_bug.cgi?id=13382
2998 This change is a .66% speedup on JS iBench for 32-bit platforms, probably much more
2999 for 64-bit since it finally gives a reasonable cell size, but I did not test that.
3001 * kjs/collector.cpp:
3002 (KJS::): Use different cell size for 32-bit and 64-bit, now that there is no
3003 oversize allocation.
3004 (KJS::Collector::allocate): Remove oversize allocator.
3005 (KJS::Collector::markStackObjectsConservatively): Don't check oversize objects.
3006 (KJS::Collector::markMainThreadOnlyObjects): Ditto.
3007 (KJS::Collector::collect): Ditto.
3009 2007-04-21 Mitz Pettel <mitz@webkit.org>
3013 - fix http://bugs.webkit.org/show_bug.cgi?id=13428
3014 REGRESSION (r20973-r20976): Failing ecma/Array/15.4.4.5-3.js
3016 - fix http://bugs.webkit.org/show_bug.cgi?id=13429
3017 REGRESSION (r20973-r20976): Crashing in fast/dom/plugin-attributes-enumeration.html
3019 * kjs/array_object.cpp:
3020 (ArrayInstance::sort): Free the old storage, not the new one.
3022 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3024 Not reviewed, build fix.
3026 - fix build problem with last change - -O3 complains more about uninitialized variables
3028 * pcre/pcre_compile.c:
3032 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3036 - <rdar://problem/5149915> use mergesort when possible, since it leads to fewer compares (2% JS iBench speedup)
3038 * kjs/array_object.cpp:
3039 (ArrayInstance::sort): Use mergesort(3) on platforms that have it, since it tends
3040 to do fewer compares than qsort; but avoid it very on large arrays since it uses extra
3041 memory. Also added comments identifying possibly even better sorting algorithms
3042 for sort by string value and sort by compare function.
3045 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3049 - bump optimization flags up to -O3 for 1% JS iBench speed improvement
3051 * Configurations/Base.xcconfig:
3053 2007-04-20 Mark Rowe <mrowe@apple.com>
3057 Fix bogus optimisation in the generic pthread code path.
3059 * kjs/collector.cpp:
3060 (KJS::currentThreadStackBase):
3062 2007-04-20 Mark Rowe <mrowe@apple.com>
3066 Improve FreeBSD compatibility, as suggested by Alexander Botero-Lowry.
3068 * kjs/collector.cpp:
3069 (KJS::currentThreadStackBase): FreeBSD requires that pthread_attr_t's are
3070 initialized via pthread_attr_init before being used in any context.
3072 2007-04-19 Mark Rowe <mrowe@apple.com>
3076 Fix http://bugs.webkit.org/show_bug.cgi?id=13401
3077 Bug 13401: Reproducible crash calling myArray.sort(compareFn) from within
3078 a sort comparison function
3080 * kjs/array_object.cpp:
3081 (ArrayInstance::sort): Save/restore the static variables around calls to qsort
3082 to ensure nested calls to ArrayInstance::sort behave correctly.
3084 2007-04-12 Deneb Meketa <dmeketa@adobe.com>
3086 Reviewed by Darin Adler.
3088 http://bugs.webkit.org/show_bug.cgi?id=13029
3089 rdar://problem/4994849
3090 Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
3091 This doesn't actually change JavaScriptCore, but that's where npapi.h is.
3094 Add headers member to NPStream struct. Also increase NP_VERSION_MINOR to 18.
3095 Increasing to >= 17 allows plug-ins to safely detect whether to look for
3096 NPStream::headers. Increasing from 17 to 18 reflects presence of NPObject
3097 enumeration, which was added in a prior patch, and which has been agreed to
3098 constitute version 18 by the plugin-futures list. Also add other missing
3099 bits of npapi.h to catch up from 14 to 18. This includes features that are
3100 not implemented in WebKit, but those are safely stubbed.
3102 2007-04-10 Geoffrey Garen <ggaren@apple.com>
3104 Reviewed by Mark Rowe.
3106 Fixed last check-in to print in release builds, too.
3108 * kjs/collector.cpp:
3109 (KJS::getPlatformThreadRegisters):
3111 2007-04-10 Geoffrey Garen <ggaren@apple.com>
3113 Reviewed by John Sullivan, Darin Adler.
3115 Fixed <rdar://problem/5121899> JavaScript garbage collection leads to
3116 later crash under Rosetta (should abort or leak instead?)
3118 Log an error message and crash if the kernel reports failure during GC.
3119 We decided to do this instead of just leaking because we don't want people
3120 to get the mistaken impression that running in Rosetta is a supported
3123 The CRASH macro will also hook into CrashReporter, which will tell us if
3124 many (any?) users run into this issue.
3126 * kjs/collector.cpp:
3127 (KJS::getPlatformThreadRegisters):
3129 2007-04-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3133 Coverity fix. Coverity says:
3134 "Event var_deref_model: Variable "sourceRanges" tracked as NULL was passed to a
3135 function that dereferences it"
3137 * kjs/string_object.cpp:
3140 2007-04-06 Geoffrey Garen <ggaren@apple.com>
3142 Rubber stamped by Adele Peterson.
3144 * kjs/ExecState.h: Removed obsolete forward/friend declaration of
3147 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3151 Coverity fix. Coverity says:
3152 "Event check_after_deref: Pointer "dateString" dereferenced before NULL check"
3154 * kjs/date_object.cpp:
3157 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3161 Coverity fix. Coverity says:
3162 "Event check_after_deref: Pointer "re" dereferenced before NULL check"
3164 * pcre/pcre_study.c:
3167 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3171 Coverity fixes. Coverity says:
3172 "Event leaked_storage: Returned without freeing storage "buffer""
3174 "Event leaked_storage: Returned without freeing storage "script""
3178 (createStringWithContentsOfFile):
3180 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3184 Coverity fix: in single-threaded case currentThreadIsMainThread is always true
3185 so the code in if (!currentThreadIsMainThread) cannot possibly be reached
3186 and Coverity complains about dead code.
3188 * kjs/collector.cpp:
3189 (KJS::Collector::collect):
3191 === Safari-5522.6 ===
3193 2007-04-03 Kevin McCullough <kmccullough@apple.com>
3197 - Testing a post-commit hook.
3199 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3201 2007-04-03 Anders Carlsson <andersca@apple.com>
3205 <rdar://problem/5107534>
3206 http://bugs.webkit.org/show_bug.cgi?id=13265
3207 REGRESSION: Crash in KJS::Bindings::convertValueToNPVariant
3209 * bindings/NP_jsobject.cpp:
3210 (_NPN_InvokeDefault):
3211 Return false if the object isn't a function. Set the return value to undefined by default
3214 2007-03-30 Anders Carlsson <andersca@apple.com>
3218 * bindings/NP_jsobject.cpp:
3221 2007-03-30 Anders Carlsson <andersca@apple.com>
3225 Implement _NPN_Enumerate support.
3227 * JavaScriptCore.exp:
3228 * bindings/NP_jsobject.cpp:
3230 * bindings/c/c_instance.cpp:
3231 (KJS::Bindings::CInstance::getPropertyNames):
3232 * bindings/c/c_instance.h:
3234 * bindings/npruntime.h:
3235 * bindings/npruntime_impl.h:
3236 * bindings/runtime.h:
3237 (KJS::Bindings::Instance::getPropertyNames):
3238 * bindings/runtime_object.cpp:
3239 (RuntimeObjectImp::getPropertyNames):
3240 * bindings/runtime_object.h:
3241 (KJS::RuntimeObjectImp::getInternalInstance):
3243 2007-03-28 Jeff Walden <jwalden+code@mit.edu>
3247 http://bugs.webkit.org/show_bug.cgi?id=12963
3248 Fix some inconsistencies in the Mozilla JS Array extras implementations
3249 with respect to the Mozilla implementation:
3251 - holes in arrays should be skipped, not treated as undefined,
3253 - an element with value undefined is not a hole
3254 - Array.prototype.forEach should return undefined
3256 * kjs/array_object.cpp:
3257 (ArrayInstance::getOwnPropertySlot):
3258 (ArrayProtoFunc::callAsFunction):
3260 2007-03-27 Anders Carlsson <acarlsson@apple.com>
3264 * bindings/NP_jsobject.cpp:
3265 (_NPN_InvokeDefault):
3266 Call JSObject:call for native JavaScript objects.
3268 2007-03-26 David Carson <dacarson@gmail.com>
3270 Reviewed by Darin, landed by Anders.
3272 Fix for: REGRESSION (r19559): Java applet crash
3273 http://bugs.webkit.org/show_bug.cgi?id=13142
3274 <rdar://problem/5080340>
3276 The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636
3277 introduced new JNIType to enum in jni_utility.h This is a
3278 problem on the Mac as it seems that the JNIType enum is also
3279 used in the JVM, it is used to specify the return type in
3281 Corrected the fix by moving type to the end, and changing
3282 jni_objc.mm to convert the new type to an old compatible
3285 * bindings/jni/jni_objc.mm:
3286 (KJS::Bindings::dispatchJNICall):
3287 * bindings/jni/jni_utility.h:
3289 2007-03-26 Christopher Brichford <chrisb@adobe.com>
3291 Reviewed/landed by Adam.
3293 Bug 13198: Move build settings from project file to xcconfig file for apollo
3295 http://bugs.webkit.org/show_bug.cgi?id=13198
3297 - Moving build settings from xcode project file to xcconfig files.
3299 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig:
3300 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig:
3301 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
3302 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
3304 2007-03-26 Brady Eidson <beidson@apple.com>
3306 Rubberstamped by Anders and Maciej aand Geoff (oh my!)
3308 Since CFTypeRef is really void*, a RetainPtr couldn't be used.
3309 RefType was "void", which doesn't actually exist as a type.
3310 Since RefType only existed for operator*(), and since that operator
3311 doesn't make any sense for RetainPtr, I removed them!
3313 * kjs/nodes.cpp: Touch this to force a rebuild and (hopefully) help the
3314 compiler with dependencies
3315 * wtf/RetainPtr.h: Nuke RefType and operator*()
3317 2007-03-26 Geoffrey Garen <ggaren@apple.com>
3319 Touched a file to (hopefully) help the compiler with RetainPtr dependencies.
3324 2007-03-24 Brady Eidson <beidson@apple.com>
3328 Whoops, RetainPtr should be in the WTF namespace
3332 2007-03-24 Brady Eidson <beidson@apple.com>
3336 <rdar://problem/5086210> - Move RetainPtr to WTF
3338 * wtf/RetainPtr.h: Added
3339 * JavaScriptCore.xcodeproj/project.pbxproj: Add it to the project file
3340 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto
3343 2007-03-23 Christopher Brichford <chrisb@adobe.com>
3345 Reviewed/landed by Adam.
3347 Bug 13175: Make apollo mac project files for JavaScriptCore actually
3349 http://bugs.webkit.org/show_bug.cgi?id=13175
3351 - Changing apollo mac project files for JavaScriptCore such that they actually build
3352 JavaScriptCore source code.
3354 * JavaScriptCore.apolloproj/ForwardingSources/grammar.cpp: Added.
3355 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
3356 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
3358 2007-03-24 Mark Rowe <mrowe@apple.com>
3360 Rubber-stamped by Darin.
3362 * Configurations/JavaScriptCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
3364 2007-03-22 Christopher Brichford <chrisb@adobe.com>
3366 Reviewed/landed by Adam.
3368 Bug 13164: Initial version of mac JavaScriptCore project files for
3370 http://bugs.webkit.org/show_bug.cgi?id=13164
3372 - Adding mac project files for apollo port of JavaScriptCore. Currently project
3373 just builds dftables.
3375 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Added.
3376 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Added.
3377 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Added.
3378 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Added.
3380 2007-03-21 Timothy Hatcher <timothy@apple.com>
3384 <rdar://problem/5076599> JavaScriptCore has a weak export (vtable for KJS::JSCell)
3386 * JavaScriptCore.exp: Remove __ZTVN3KJS6JSCellE.
3388 2007-03-21 Adele Peterson <adele@apple.com>
3392 * API/JSStringRef.cpp: (JSStringIsEqual): Added JSLock.
3394 2007-03-21 Zack Rusin <zrusin@trolltech.com>
3396 Fix the compile when USE(MULTIPLE_THREADS) isn't
3400 (KJS::JSLock::currentThreadIsHoldingLock):
3402 2007-03-20 Maciej Stachowiak <mjs@apple.com>
3404 Reviewed by Geoff and Adam.
3406 - make USE(MULTIPLE_THREADS) support more portable
3407 http://bugs.webkit.org/show_bug.cgi?id=13069
3409 - fixed a threadsafety bug discovered by testing this
3411 - enhanced threadsafety assertions in collector
3413 * API/JSCallbackObject.cpp:
3414 (KJS::JSCallbackObject::~JSCallbackObject): This destructor can't
3415 DropAllLocks around the finalize callback, because it gets called
3416 from garbage collection and we can't let other threads collect!
3418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3420 (KJS::JSLock::currentThreadIsHoldingLock): Added new function
3421 to allow stronger assertions than just that the lock is held
3422 by some thread (you can now assert that the current thread is
3423 holding it, given the new JSLock design).
3425 * kjs/collector.cpp: Refactored for portability plus added some
3426 stronger assertions.
3427 (KJS::Collector::allocate):
3428 (KJS::currentThreadStackBase):
3429 (KJS::Collector::registerAsMainThread):
3430 (KJS::onMainThread):
3431 (KJS::PlatformThread::PlatformThread):
3432 (KJS::getCurrentPlatformThread):
3433 (KJS::Collector::Thread::Thread):
3434 (KJS::destroyRegisteredThread):
3435 (KJS::Collector::registerThread):
3436 (KJS::Collector::markCurrentThreadConservatively):
3437 (KJS::suspendThread):
3438 (KJS::resumeThread):
3439 (KJS::getPlatformThreadRegisters):
3440 (KJS::otherThreadStackPointer):
3441 (KJS::otherThreadStackBase):
3442 (KJS::Collector::markOtherThreadConservatively):
3443 (KJS::Collector::markStackObjectsConservatively):
3444 (KJS::Collector::protect):
3445 (KJS::Collector::unprotect):
3446 (KJS::Collector::collectOnMainThreadOnly):
3447 (KJS::Collector::markMainThreadOnlyObjects):
3448 (KJS::Collector::collect):
3450 * wtf/FastMalloc.cpp:
3451 (WTF::fastMallocSetIsMultiThreaded):
3452 * wtf/FastMallocInternal.h:
3455 2007-03-19 Darin Adler <darin@apple.com>
3457 * kjs/value.h: Roll ~JSValue change out. It was causing problems. I'll do it right later.
3459 2007-03-19 Geoffrey Garen <ggaren@apple.com>
3461 Reviewed by John Sullivan.
3463 Fixed <rdar://problem/5073380> REGRESSION: Crash occurs at WTF::fastFree()
3464 when reloading liveconnect page (applet)
3466 Best to use free when you use malloc, especially when malloc and delete
3467 use completely different libraries.
3469 * bindings/jni/jni_runtime.cpp:
3470 (JavaMethod::~JavaMethod):
3472 2007-03-19 Andrew Wellington <proton@wiretapped.net>
3476 Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
3478 * JavaScriptCore.xcodeproj/project.pbxproj:
3480 2007-03-19 Darin Adler <darin@apple.com>
3484 - Changed list size threshold to 5 based on testing.
3486 I was testing the i-Bench JavaScript with the list statistics
3487 dumping on, and discovered that there were many 5-element lists.
3488 The fast case for lists was for 4 elements and fewer. By changing
3489 the threshold to 5 elements we get a measurable speedup. I believe
3490 this will help real web pages too, not just the benchmark.
3492 * kjs/list.cpp: Change constant from 4 to 5.
3494 2007-03-19 Darin Adler <darin@apple.com>
3496 * kjs/value.h: Oops, fix build.
3498 2007-03-19 Darin Adler <darin@apple.com>
3502 - remove ~JSValue; tiny low-risk performance boost
3504 * kjs/value.h: Remove unneeded empty virtual destructor from JSValue.
3505 The only class derived from JSValue is JSCell and it already has a
3506 virtual destructor. Declaring an empty constructor in JSValue had one
3507 good effect: it marked the destructor private, making it a compile
3508 time error to try to destroy a JSValue; but that's not a likely
3509 mistake for someone to make. It had two bad effects: (1) it caused gcc,
3510 at least, to generate code to fix up the virtual table pointer to
3511 point to the JSValue version of the virtual table inside the destructor
3512 of all classes derived from JSValue directly or indirectly; (2) it
3513 caused JSValue to be a polymorphic class so required a virtual table for
3514 it. It's cleaner to not have either of those.
3516 2007-03-18 Maciej Stachowiak <mjs@apple.com>
3520 - avoid static construction (and global variable access) in a smarter, more portable way,
3521 to later enable MUTLI_THREAD mode to work on other platforms and compilers.
3523 * kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers.
3524 (KJS::CommonIdentifiers::CommonIdentifiers):
3525 (KJS::CommonIdentifiers::shared):
3526 * kjs/CommonIdentifiers.h: Added.
3529 (KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access.
3530 (KJS::ExecState::ExecState):
3532 * API/JSObjectRef.cpp:
3533 (JSObjectMakeConstructor):
3535 * JavaScriptCore.exp:
3536 * JavaScriptCore.pri:
3537 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3538 * JavaScriptCore.xcodeproj/project.pbxproj:
3539 * JavaScriptCoreSources.bkl:
3540 * bindings/runtime_array.cpp:
3541 (RuntimeArray::getOwnPropertySlot):
3542 (RuntimeArray::put):
3543 * bindings/runtime_method.cpp:
3544 (RuntimeMethod::getOwnPropertySlot):
3545 * kjs/array_object.cpp:
3546 (ArrayInstance::getOwnPropertySlot):
3547 (ArrayInstance::put):
3548 (ArrayInstance::deleteProperty):
3549 (ArrayProtoFunc::ArrayProtoFunc):
3550 (ArrayProtoFunc::callAsFunction):
3551 (ArrayObjectImp::ArrayObjectImp):
3552 * kjs/bool_object.cpp:
3553 (BooleanPrototype::BooleanPrototype):
3554 (BooleanProtoFunc::BooleanProtoFunc):
3555 (BooleanProtoFunc::callAsFunction):
3556 (BooleanObjectImp::BooleanObjectImp):
3558 (KJS::Completion::Completion):
3559 * kjs/date_object.cpp:
3560 (KJS::DateProtoFunc::DateProtoFunc):
3561 (KJS::DateObjectImp::DateObjectImp):
3562 (KJS::DateObjectFuncImp::DateObjectFuncImp):
3563 * kjs/error_object.cpp:
3564 (ErrorPrototype::ErrorPrototype):
3565 (ErrorProtoFunc::ErrorProtoFunc):
3566 (ErrorProtoFunc::callAsFunction):
3567 (ErrorObjectImp::ErrorObjectImp):
3568 (ErrorObjectImp::construct):
3569 (NativeErrorPrototype::NativeErrorPrototype):
3570 (NativeErrorImp::NativeErrorImp):
3571 (NativeErrorImp::construct):
3572 (NativeErrorImp::callAsFunction):
3574 (KJS::FunctionImp::getOwnPropertySlot):
3575 (KJS::FunctionImp::put):
3576 (KJS::FunctionImp::deleteProperty):
3577 (KJS::FunctionImp::getParameterName):
3578 (KJS::DeclaredFunctionImp::construct):
3579 (KJS::IndexToNameMap::unMap):
3580 (KJS::Arguments::Arguments):
3581 (KJS::ActivationImp::getOwnPropertySlot):
3582 (KJS::ActivationImp::deleteProperty):
3583 (KJS::GlobalFuncImp::GlobalFuncImp):
3584 * kjs/function_object.cpp:
3585 (FunctionPrototype::FunctionPrototype):
3586 (FunctionProtoFunc::FunctionProtoFunc):
3587 (FunctionProtoFunc::callAsFunction):
3588 (FunctionObjectImp::FunctionObjectImp):
3589 (FunctionObjectImp::construct):
3591 * kjs/identifier.cpp:
3593 * kjs/interpreter.cpp:
3594 (KJS::Interpreter::init):
3595 (KJS::Interpreter::initGlobalObject):
3596 * kjs/interpreter.h:
3598 * kjs/math_object.cpp:
3599 (MathFuncImp::MathFuncImp):
3601 (ArrayNode::evaluate):
3602 (FuncDeclNode::processFuncDecl):
3603 (FuncExprNode::evaluate):
3604 * kjs/number_object.cpp:
3605 (NumberPrototype::NumberPrototype):
3606 (NumberProtoFunc::NumberProtoFunc):
3607 (NumberObjectImp::NumberObjectImp):
3609 (KJS::JSObject::put):
3610 (KJS::JSObject::defaultValue):
3611 (KJS::JSObject::hasInstance):
3613 (KJS::JSObject::getOwnPropertySlot):
3614 * kjs/object_object.cpp:
3615 (ObjectPrototype::ObjectPrototype):
3616 (ObjectProtoFunc::ObjectProtoFunc):
3617 (ObjectObjectImp::ObjectObjectImp):
3618 * kjs/regexp_object.cpp:
3619 (RegExpPrototype::RegExpPrototype):
3620 (RegExpProtoFunc::RegExpProtoFunc):
3621 (RegExpObjectImp::RegExpObjectImp):
3622 * kjs/string_object.cpp:
3623 (KJS::StringInstance::getOwnPropertySlot):
3624 (KJS::StringInstance::put):
3625 (KJS::StringInstance::deleteProperty):
3626 (KJS::StringPrototype::StringPrototype):
3627 (KJS::StringProtoFunc::StringProtoFunc):
3628 (KJS::StringProtoFunc::callAsFunction):
3629 (KJS::StringObjectImp::StringObjectImp):
3630 (KJS::StringObjectFuncImp::StringObjectFuncImp):
3632 (TestFunctionImp::TestFunctionImp):
3634 2007-03-18 Andrew Wellington <proton@wiretapped.net>
3636 Reviewed by Mark Rowe
3638 Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
3640 * JavaScriptCore.xcodeproj/project.pbxproj:
3642 2007-03-19 Mark Rowe <mrowe@apple.com>
3644 Rubber-stamped by Brady.
3646 Update references to bugzilla.opendarwin.org with bugs.webkit.org.
3648 * bindings/c/c_utility.cpp:
3649 (KJS::Bindings::convertUTF8ToUTF16):
3651 (KJS::FunctionImp::callAsFunction):
3653 * kjs/keywords.table:
3655 (KJS::Lexer::shift):
3657 2007-03-18 Geoffrey Garen <ggaren@apple.com>
3659 Reviewed by Oliver Hunt.
3661 Exposed some extra toUInt32 functionality, as part of the fix for
3662 REGRESSION: Incomplete document.all implementation breaks abtelectronics.com
3663 (Style Change Through JavaScript Blanks Content)
3665 * JavaScriptCore.exp:
3667 (KJS::Identifier::toUInt32):
3669 2007-03-18 Geoffrey Garen <ggaren@apple.com>
3671 Removed duplicate export name.
3673 * JavaScriptCore.exp:
3675 2007-03-15 Geoffrey Garen <ggaren@apple.com>
3677 Reviewed by Maciej Stachowiak.
3679 Fixed <rdar://problem/5064964> Repro ASSERT failure in JS Bindings when
3680 closing window @ lowtrades.bptrade.com
3682 Unfortunately, the bindings depend on UString and Identifier as string
3683 representations. So, they need to acquire the JSLock when doing something
3684 that will ref/deref their strings.
3686 Layout tests, the original site, and Java, Flash, and Quicktime on the
3687 web work. No leaks reported. No automated test for this because testing
3688 the Java bindings, like math, is hard.
3690 * bindings/runtime.h: Made Noncopyable, just to be sure.
3692 * bindings/c/c_class.cpp:
3693 (KJS::Bindings::CClass::~CClass): Acquire the JSLock and explicitly clear the keys
3694 in our hashtable, since they're UString::Reps, and ref/deref aren't thread-safe.
3695 (KJS::Bindings::CClass::methodsNamed): Also acquire the JSLock when adding
3696 keys to the table, since the table ref's them.
3697 (KJS::Bindings::CClass::fieldNamed): ditto.
3699 * bindings/c/c_utility.cpp: Removed dead function.
3700 (KJS::Bindings::convertValueToNPVariant): Acquire the JSLock because doing
3701 it recursively is pretty cheap, and it's just too confusing to tell whether
3702 all our callers do it for us.
3703 (KJS::Bindings::convertNPVariantToValue): ditto
3704 * bindings/c/c_utility.h:
3706 * bindings/jni/jni_class.cpp: Same deal as c_class.cpp.
3707 (JavaClass::JavaClass):
3708 (JavaClass::~JavaClass):
3710 * bindings/jni/jni_instance.cpp: Same deal as c_utility.cpp.
3711 (JavaInstance::stringValue):
3712 * bindings/jni/jni_jsobject.cpp:
3713 (JavaJSObject::convertValueToJObject):
3715 * bindings/jni/jni_runtime.cpp:
3716 (JavaMethod::~JavaMethod): Moved from header, for clarity.
3717 (appendClassName): Made this static, so the set of callers is known, and
3718 we can assert that we hold the JSLock. Also changed it to take a UString
3719 reference, which makes the calling code simpler.
3720 (JavaMethod::signature): Store the ASCII value we care about instead of
3721 a UString, since UString is so much more hassle. Hold the JSLock while
3722 building up the temporary UString.
3724 * bindings/jni/jni_runtime.h: Nixed dead code in JavaMethod.
3725 (KJS::Bindings::JavaString::JavaString): Hold a UString::Rep instead of
3726 a UString, so we can acquire the JSLock and explicitly release it.
3727 (KJS::Bindings::JavaString::_commonInit):
3728 (KJS::Bindings::JavaString::~JavaString):
3729 (KJS::Bindings::JavaString::UTF8String):
3730 (KJS::Bindings::JavaString::uchars):
3731 (KJS::Bindings::JavaString::length):
3732 (KJS::Bindings::JavaString::ustring):
3734 * bindings/jni/jni_utility.cpp:
3735 (KJS::Bindings::convertArrayInstanceToJavaArray): Made this static, so
3736 the set of callers is known, and we can assert that we hold the JSLock.
3737 (KJS::Bindings::convertValueToJValue): Acquire the JSLock because doing
3738 it recursively is pretty cheap, and it's just too confusing to tell whether
3739 all our callers do it for us.
3741 * bindings/objc/objc_runtime.h: Nixed some dead code.
3742 * bindings/objc/objc_utility.mm:
3743 (KJS::Bindings::convertNSStringToString): Same drill as above.
3745 2007-03-18 Alexey Proskuryakov <ap@webkit.org>
3749 http://bugs.webkit.org/show_bug.cgi?id=13105
3750 REGRESSION: an exception raised when calculating base value of a dot expression is not returned
3752 Test: fast/js/dot-node-base-exception.html
3755 (FunctionCallDotNode::evaluate): Added the necessary KJS_CHECKEXCEPTIONVALUE.
3757 2007-03-18 Steve Falkenburg <sfalken@apple.com>
3761 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3763 2007-03-17 Timothy Hatcher <timothy@apple.com>
3765 Reviewed by Mark Rowe.
3767 Made Version.xcconfig smarter when building for different configurations.
3768 Now uses the 522+ OpenSource version for Debug and Release, while using the
3769 full 522.4 version for Production builds. The system prefix is also computed
3770 based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
3772 * Configurations/JavaScriptCore.xcconfig:
3773 * Configurations/Version.xcconfig:
3775 2007-03-15 Maciej Stachowiak <mjs@apple.com>
3781 * wtf/TCSystemAlloc.cpp:
3783 2007-03-15 Maciej Stachowiak <mjs@apple.com>
3785 Reviewed by Geoff and Steve.
3787 - fix some portability issues with TCMalloc.
3789 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3791 * wtf/FastMalloc.cpp:
3793 (WTF::InitSizeClasses):
3794 (WTF::TCMalloc_PageHeap::Split):
3795 (WTF::TCMalloc_PageHeap::RegisterSizeClass):
3796 (WTF::TCMalloc_Central_FreeList::length):
3797 (WTF::TCMalloc_ThreadCache::InitTSD):
3798 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3800 * wtf/TCSystemAlloc.cpp:
3802 (TCMalloc_SystemAlloc):
3804 2007-03-15 Timothy Hatcher <timothy@apple.com>
3808 * Factored out most of our common build settings into .xcconfig files. Anything that was common in
3809 each build configuration was factored out into the shared .xcconfig file.
3810 * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
3811 * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
3812 * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
3814 * Configurations/Base.xcconfig: Added.
3815 * Configurations/DebugRelease.xcconfig: Added.
3816 * Configurations/JavaScriptCore.xcconfig: Added.
3817 * Configurations/Version.xcconfig: Added.
3819 * JavaScriptCore.xcodeproj/project.pbxproj:
3821 2007-03-16 Shrikant Gangoda <shrikant.gangoda@celunite.com>
3825 * kjs/DateMath.cpp: gettimeofday comes from <sys/time.h> on Linux.
3827 2007-03-14 Kevin McCullough <kmccullough@apple.com>
3831 - Fixed one more build breakage
3833 * kjs/date_object.cpp:
3834 (KJS::formatLocaleDate):
3836 2007-03-14 Kevin McCullough <kmccullough@apple.com>
3840 - Fixed a build breakage.
3843 * kjs/date_object.cpp:
3844 (KJS::formatLocaleDate):
3845 (KJS::DateObjectImp::construct):
3847 2007-03-14 Kevin McCullough <kmccullough@apple.com>
3851 - rdar://problem/5045720
3852 - DST changes in US affect JavaScript date calculations (12975)
3853 This fix was to ensure we properly test for the new changes to DST in the US.
3854 Also this fixes when we apply DST, now we correctly map most past years to current
3855 DST rules. We still have a small issue with years before 1900 or after 2100.
3856 rdar://problem/5055038
3858 * kjs/DateMath.cpp: Fix DST to match spec better.
3859 (KJS::getCurrentUTCTime):
3860 (KJS::mimimumYearForDST):
3861 (KJS::maximumYearForDST):
3862 (KJS::equivalentYearForDST):
3863 (KJS::getDSTOffset):
3864 * kjs/DateMath.h: Consolodated common funtionality.
3865 * kjs/date_object.cpp: Consolodated common functionality.
3866 (KJS::formatLocaleDate):
3867 (KJS::DateObjectImp::construct):
3868 * tests/mozilla/ecma/jsref.js: Added functions for finding the correct days when DST starts and ends.
3869 * tests/mozilla/ecma/shell.js: Added back in the old DST functions for ease of merging with mozilla if needed.
3870 * tests/mozilla/ecma_2/jsref.js: Added functions for finding the correct days when DST starts and ends.
3871 * tests/mozilla/ecma_3/Date/shell.js: Added functions for finding the correct days when DST starts and ends.
3872 * tests/mozilla/expected.html: Updated to show all date tests passing.
3874 === Safari-5522.4 ===
3876 2007-03-13 Kevin McCullough <kmccullough@apple.com>
3880 - Adding expected failures until the are truly fixed.
3881 - rdar://problem/5060302
3883 * tests/mozilla/expected.html:
3885 2007-03-12 Kevin McCullough <kmccullough@apple.com>
3889 - Actually update tests for new DST rules.
3891 * tests/mozilla/ecma/Date/15.9.3.1-1.js:
3892 * tests/mozilla/ecma/Date/15.9.3.1-2.js:
3893 * tests/mozilla/ecma/Date/15.9.3.1-3.js:
3894 * tests/mozilla/ecma/Date/15.9.3.1-4.js:
3895 * tests/mozilla/ecma/Date/15.9.3.1-5.js:
3896 * tests/mozilla/ecma/Date/15.9.3.2-1.js:
3897 * tests/mozilla/ecma/Date/15.9.3.2-2.js:
3898 * tests/mozilla/ecma/Date/15.9.3.2-3.js:
3899 * tests/mozilla/ecma/Date/15.9.3.2-4.js:
3900 * tests/mozilla/ecma/Date/15.9.3.2-5.js:
3901 * tests/mozilla/ecma/Date/15.9.3.8-1.js:
3902 * tests/mozilla/ecma/Date/15.9.3.8-2.js:
3903 * tests/mozilla/ecma/Date/15.9.3.8-3.js:
3904 * tests/mozilla/ecma/Date/15.9.3.8-4.js:
3905 * tests/mozilla/ecma/Date/15.9.3.8-5.js:
3906 * tests/mozilla/ecma/Date/15.9.5.10-1.js:
3907 * tests/mozilla/ecma/Date/15.9.5.10-10.js:
3908 * tests/mozilla/ecma/Date/15.9.5.10-11.js:
3909 * tests/mozilla/ecma/Date/15.9.5.10-12.js:
3910 * tests/mozilla/ecma/Date/15.9.5.10-13.js:
3911 * tests/mozilla/ecma/Date/15.9.5.10-2.js:
3912 * tests/mozilla/ecma/Date/15.9.5.10-3.js:
3913 * tests/mozilla/ecma/Date/15.9.5.10-4.js:
3914 * tests/mozilla/ecma/Date/15.9.5.10-5.js:
3915 * tests/mozilla/ecma/Date/15.9.5.10-6.js:
3916 * tests/mozilla/ecma/Date/15.9.5.10-7.js:
3917 * tests/mozilla/ecma/Date/15.9.5.10-8.js:
3918 * tests/mozilla/ecma/Date/15.9.5.10-9.js:
3919 * tests/mozilla/ecma/jsref.js:
3920 * tests/mozilla/ecma_2/jsref.js:
3921 * tests/mozilla/ecma_3/Date/shell.js:
3923 2007-03-12 Kevin McCullough <kmccullough@apple.com>
3927 - Update tests for new DST rules.
3929 * tests/mozilla/ecma/shell.js:
3931 2007-03-11 Geoffrey Garen <ggaren@apple.com>
3933 Reviewed by Oliver Hunt.
3935 Fixed <rdar://problem/4681051> Installer crashes in KJS::Collector::
3936 markOtherThreadConservatively(KJS::Collector::Thread*) trying to install
3937 iLife 06 using Rosetta on an Intel Machine
3939 The problem was that our thread-specific data destructor would modify the
3940 list of active JavaScript threads without holding the JSLock, corrupting
3941 the list. Corruption was especially likely if one JavaScript thread exited
3942 while another was starting up.
3944 * JavaScriptCore.exp:
3945 * kjs/JSLock.cpp: Don't conflate locking the JSLock with registering a
3946 thread, since the thread-specific data destructor needs to lock
3947 without registering a thread. Instead, treat thread registration as a
3948 part of the convenience of the JSLock object, and whittle down JSLock::lock()
3949 to just the bits that actually do the locking.
3950 (KJS::JSLock::lock):
3951 (KJS::JSLock::registerThread):
3952 * kjs/JSLock.h: Updated comments to mention the new behavior above, and
3953 other recent changes.
3954 (KJS::JSLock::JSLock):
3955 * kjs/collector.cpp:
3956 (KJS::destroyRegisteredThread): Lock here.
3957 (KJS::Collector::registerThread): To match, assert that we're locked here.
3959 2007-03-10 Geoffrey Garen <ggaren@apple.com>
3961 Reviewed by Darin Adler.
3963 Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and
3964 JSCore causes a hang @ www.panoramas.dk
3966 With a PAC file, run-webkit-tests --threaded passes, the reported site
3967 works, and all the Quicktime/JavaScript and Flash/JavaScript examples
3968 I found through Google work, too.
3970 Any time JavaScript causes arbitrary non-JavaScript code to execute, it
3971 risks deadlock, because that code may block, trying to acquire a lock
3972 owned by a thread that is waiting to execute JavaScript. In this case,
3973 the thread was a networking thread that was waiting to interpret a PAC file.
3975 Because non-JavaScript code may execute in response to, well, anything,
3976 a perfect solution to this problem is impossible. I've implemented an
3977 optimistic solution, instead: JavaScript will drop its lock whenever it
3978 makes a direct call to non-JavaScript code through a bridging/plug-in API,
3979 but will blissfully ignore the indirect ways it may cause non-JavaScript
3980 code to run (resizing a window, for example).
3982 Unfortunately, this solution introduces significant locking overhead in
3983 the bridging APIs. I don't see a way around that.
3985 This patch includes some distinct bug fixes I saw along the way:
3987 * bindings/objc/objc_instance.mm: Fixed a bug where a nested begin() call
3988 would leak its autorelease pool, because it would NULL out _pool without
3991 * bindings/runtime_object.cpp:
3992 (RuntimeObjectImp::methodGetter): Don't copy an Identifier to ASCII only
3993 to turn around and make an Identifier from the ASCII. In an earlier
3994 version of this patch, the copy caused an assertion failure. Now it's
3995 just unnecessary work.
3996 (RuntimeObjectImp::getOwnPropertySlot): ditto
3998 * bindings/objc/objc_instance.h: Removed overrides of setVAlueOfField and
3999 getValueOfField, because they did exactly what the base class versions did.
4000 Removed overrides of Noncopyable declarations for the same reason.
4002 * bindings/runtime.h: Inherit from Noncopyable instead of rolling our own.
4003 * bindings/c/c_instance.h: ditto
4005 And the actual patch:
4007 * API/JSCallbackConstructor.cpp: Drop all locks when calling out to C.
4008 (KJS::JSCallbackConstructor::construct):
4009 * API/JSCallbackFunction.cpp: ditto
4010 (KJS::JSCallbackFunction::callAsFunction):
4011 * API/JSCallbackObject.cpp: ditto
4012 (KJS::JSCallbackObject::init):
4013 (KJS::JSCallbackObject::~JSCallbackObject):
4014 (KJS::JSCallbackObject::getOwnPropertySlot):
4015 (KJS::JSCallbackObject::put):
4016 (KJS::JSCallbackObject::deleteProperty):
4017 (KJS::JSCallbackObject::construct):
4018 (KJS::JSCallbackObject::hasInstance):
4019 (KJS::JSCallbackObject::callAsFunction):
4020 (KJS::JSCallbackObject::getPropertyNames):
4021 (KJS::JSCallbackObject::toNumber):
4022 (KJS::JSCallbackObject::toString):
4023 (KJS::JSCallbackObject::staticValueGetter):
4024 (KJS::JSCallbackObject::callbackGetter):
4026 * bindings/c/c_instance.cpp: Drop all locks when calling out to C.
4027 (KJS::Bindings::CInstance::invokeMethod):
4028 (KJS::Bindings::CInstance::invokeDefaultMethod):
4029 * bindings/c/c_runtime.cpp: Drop all locks when calling out to C.
4030 (KJS::Bindings::CField::valueFromInstance):
4031 (KJS::Bindings::CField::setValueToInstance):
4032 * bindings/jni/jni_objc.mm:
4033 (KJS::Bindings::dispatchJNICall): Drop all locks when calling out to Java.
4035 * bindings/objc/objc_instance.mm: The changes here are to accomodate the
4036 fact that C++ unwinding of DropAllLocks goes crazy when you put it inside
4037 a @try block. I moved all JavaScript stuff outside of the @try blocks, and
4038 then prefixed the whole blocks with DropAllLocks objects. This required some
4039 supporting changes in other functions, which now acquire the JSLock for
4040 themselves, intead of relying on their callers to do so.
4041 (ObjcInstance::end):
4042 (ObjcInstance::invokeMethod):
4043 (ObjcInstance::invokeDefaultMethod):
4044 (ObjcInstance::setValueOfUndefinedField):
4045 (ObjcInstance::getValueOfUndefinedField):
4046 * bindings/objc/objc_runtime.mm: Same as above, except I didn't want to
4047 change throwError to acquire the JSLock for itself.
4048 (ObjcField::valueFromInstance):
4049 (ObjcField::setValueToInstance):
4050 * bindings/objc/objc_utility.mm: Supporting changes mentioned above.
4051 (KJS::Bindings::convertValueToObjcValue):
4052 (KJS::Bindings::convertObjcValueToValue):
4055 (1) Fixed DropAllLocks to behave as advertised, and drop the JSLock only
4056 if the current thread actually acquired it in the first place. This is
4057 important because WebKit needs to ensure that the JSLock has been
4058 dropped before it makes a plug-in call, even though it doesn't know if
4059 the current thread actually acquired the JSLock. (We don't want WebKit
4060 to accidentally drop a lock belonging to *another thread*.)
4061 (2) Used the new per-thread code written for (1) to make recursive calls
4062 to JSLock very cheap. JSLock now knows to call pthread_mutext_lock/
4063 pthread_mutext_unlock only at nesting level 0.
4064 (KJS::createDidLockJSMutex):
4065 (KJS::JSLock::lock):
4066 (KJS::JSLock::unlock):
4067 (KJS::DropAllLocks::DropAllLocks):
4068 (KJS::DropAllLocks::~DropAllLocks):
4069 (KJS::JSLock::lockCount):
4070 * kjs/JSLock.h: Don't duplicate Noncopyable.
4071 (KJS::JSLock::~JSLock):
4073 * wtf/Assertions.h: Blind attempt at helping the Windows build.
4075 2007-03-08 MorganL <morganl.webkit@yahoo.com>
4079 http://bugs.webkit.org/show_bug.cgi?id=13018
4080 Bug 13018: allow embedders to override the definition of CRASH.
4082 * wtf/Assertions.h: make it possible to override CRASH.
4084 2007-03-07 Anrong Hu <huanr@yahoo.com>
4088 Fix http://bugs.webkit.org/show_bug.cgi?id=12535
4089 Bug 12535: Stack-optimizing compilers can trick GC into freeing in-use objects
4092 (KJS::StringImp::toObject): Copy val onto the stack so it is not subject to garbage collection.
4094 2007-03-07 Geoffrey Garen <ggaren@apple.com>
4096 Build fix for non-multiple-thread folks.
4098 Use a shared global in the non-multiple-thread case.
4100 * wtf/FastMalloc.cpp:
4102 (WTF::fastMallocForbid):
4103 (WTF::fastMallocAllow):
4105 2007-03-07 Geoffrey Garen <ggaren@apple.com>
4107 Reviewed by Darin Adler.
4109 Fixed ASSERT failure I just introduced.
4111 Made the fastMalloc isForbidden flag per thread. (Oops!) We expect that
4112 other threads will malloc while we're marking -- we just want to prevent
4113 our own marking from malloc'ing.
4115 * wtf/FastMalloc.cpp:
4116 (WTF::initializeIsForbiddenKey):
4118 (WTF::fastMallocForbid):
4119 (WTF::fastMallocAllow):
4126 2007-03-07 Shrikant Gangoda <shrikant.gangoda@celunite.com>
4130 http://bugs.webkit.org/show_bug.cgi?id=12997
4132 Wrap pthread-specific assertion in #if USE(MULTIPLE_THREADS).
4134 * kjs/collector.cpp:
4135 (KJS::Collector::markMainThreadOnlyObjects):
4137 2007-03-06 Geoffrey Garen <ggaren@apple.com>
4139 Reviewed by Maciej Stachowiak.
4141 Fixed <rdar://problem/4576242> | http://bugs.webkit.org/show_bug.cgi?id=12586