1 === End merge of feature-branch 11-11-2007 ===
3 2007-10-11 Mark Rowe <mrowe@apple.com>
5 Reviewed by Tim Hatcher.
7 Fix for <rdar://problem/5488678>. Disable debugging symbols in production builds for 10.4
8 PowerPC to prevent a huge STABS section from being generated.
10 * Configurations/Base.xcconfig:
12 2007-10-08 George Staikos <staikos@kde.org>
14 Reviewed by Adam Roben.
16 Fix Qt build on Win32.
21 2007-10-10 Simon Hausmann <hausmann@kde.org>
25 Fix compilation using gcc 4.3. Header files have been reorganized and as a result some extra
26 includes are needed for INT_MAX, std::auto_ptr and the like.
31 * kjs/scope_chain.cpp:
35 2007-10-09 Lars Knoll <lars@trolltech.com>
39 fix the invokation of slots with return types. Add a JSLock around the conversion from QVariant to JSValue.
41 * bindings/qt/qt_instance.cpp:
42 (KJS::Bindings::QtInstance::invokeMethod):
43 * bindings/qt/qt_runtime.cpp:
44 (KJS::Bindings::convertValueToQVariant):
45 (KJS::Bindings::convertQVariantToValue):
47 2007-10-05 Geoffrey Garen <ggaren@apple.com>
49 Reviewed by Sam Weinig.
51 Added JSObject::removeDirect, to support the fix for
52 <rdar://problem/5522487> REGRESSION: With JavaScript disabled, any
53 page load causes a crash in PropertyMap::put
56 (KJS::JSObject::removeDirect):
59 2007-10-04 Mark Rowe <mrowe@apple.com>
63 Switch to default level of debugging symbols to resolve <rdar://problem/5488678>.
64 The "full" level appears to offer no observable benefits even though the documentation
65 suggests it be used for dead code stripping. This should also decrease link times.
67 * Configurations/Base.xcconfig:
69 2007-10-03 Lars Knoll <lars@trolltech.com>
73 Fix a stupid bug in Unicode::toUpper/toLower.
74 Fixes all three test failures in the JavaScriptCore test
77 * wtf/unicode/qt4/UnicodeQt4.h:
78 (WTF::Unicode::toLower):
79 (WTF::Unicode::toUpper):
81 2007-10-02 Darin Adler <darin@apple.com>
85 - add support for GDI objects to OwnPtr; I plan to use this
86 to fix some GDI handle leaks
88 * kjs/grammar.y: Change parser to avoid macros that conflict
89 with macros defined in Windows system headers: THIS, DELETE,
90 VOID, IN, and CONST. This is needed because OwnPtr.h will now
92 * kjs/keywords.table: Ditto.
94 * wtf/OwnPtr.h: For PLATFORM(WIN), add support so that OwnPtr can be
95 a GDI handle, and it will call DeleteObject. Also change to use the
96 RemovePointer technique used by RetainPtr, so you can say OwnPtr<HBITMAP>
97 rather than having to pass in the type pointed to by HBITMAP.
99 * wtf/OwnPtrWin.cpp: Added.
100 (WebCore::deleteOwnedPtr): Put this in a separate file so that we
101 don't have to include <windows.h> in OwnPtr.h.
103 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OwnPtrWin.cpp.
105 2007-09-29 Holger Hans Peter Freyther <zecke@selfish.org>
109 -Fix http://bugs.webkit.org/show_bug.cgi?id=13226.
110 Remove Bakefiles from svn.
112 * JavaScriptCoreSources.bkl: Removed.
113 * jscore.bkl: Removed.
115 2007-09-27 Kevin Decker <kdecker@apple.com>
117 Rubber stamped by John Sullivan.
119 <rdar://problem/5493093>
121 * JavaScriptCore.order: Added.
122 * JavaScriptCore.xcodeproj/project.pbxproj: We're changing from using an order file built by
123 another team to using one we actually check into our project repository. Linker settings for
124 Symbol Ordering Flags have been updated accordingly.
126 2007-09-26 Adam Roben <aroben@apple.com>
128 Make testkjs delay-load WebKit.dll so WebKitInitializer can work its magic
130 Rubberstamped by Anders.
132 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
134 2007-09-25 Adam Roben <aroben@apple.com>
136 Make testkjs delay-load its dependencies
138 This lets WebKitInitializer re-route the dependencies to be loaded out
139 of the Safari installation directory.
141 Rubberstamped by Sam.
143 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
145 2007-09-25 David Kilzer <ddkilzer@webkit.org>
149 - Fix http://bugs.webkit.org/show_bug.cgi?id=14885
150 LGPL'ed files contain incorrect FSF address
153 * bindings/testbindings.cpp:
154 * kjs/AllInOneFile.cpp:
156 * kjs/PropertyNameArray.cpp:
157 * kjs/PropertyNameArray.h:
160 2007-09-25 Sam Weinig <sam@webkit.org>
162 Fix location for build products for Debug_Internal.
164 Reviewed by Adam Roben.
166 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
168 2007-09-25 Adam Roben <aroben@apple.com>
170 Make testkjs use WebKitInitializer
174 * JavaScriptCore.vcproj/JavaScriptCore.sln: Add WebKitInitializer and
175 make testkjs depend on it.
176 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
177 WebKitInitializer.lib.
179 (main): Call initializeWebKit.
181 2007-09-24 Kevin McCullough <kmccullough@apple.com>
185 - Continued to update project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
187 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
188 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
190 2007-09-21 Kevin McCullough <kmccullough@apple.com>
194 - Updated project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
196 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
197 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
199 2007-09-20 Holger Hans Peter Freyther <zecke@selfish.org>
201 Rubber stamped by Adam.
203 Renamed files from *Gdk to *Gtk (see #14732) using the
204 work of Juan A. Suarez Romero as a base.
208 * JavaScriptCore.pri:
211 * wtf/Platform.h: PLATFORM(GDK) to PLATFORM(GTK)
213 2007-09-21 Mark Rowe <mrowe@apple.com>
215 Reviewed by Antti Koivisto.
217 http://bugs.webkit.org/show_bug.cgi?id=15250
218 <rdar://problem/5496942> REGRESSION: Reproducible crash in Safari when evaluating script in Drosera console (15250)
221 (KJS::GlobalFuncImp::callAsFunction): Null-check thisObj before passing it to interpreterForGlobalObject.
223 2007-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
225 Rubber stamped by Adam.
227 Make the guard/#if use the same name (ENABLE_FTPDIR) as the #define. This follows
228 the ENABLE_ICONDATABASE example from a couple of lines above.
232 2007-09-19 Mark Rowe <mrowe@apple.com>
236 <rdar://problem/5487107> NULL dereference crash in FastMallocZone::enumerate when running leaks against Safari
238 Storing remote pointers to their local equivalents in mapped memory was leading to the local pointer being
239 interpreted as a remote pointer. This caused a crash when using the result of mapping this invalid remote pointer.
240 The fix is to follow the pattern used elsewhere in FastMallocZone by always doing the mapping after reading and
241 never storing the mapped pointer.
243 * wtf/FastMalloc.cpp:
244 (WTF::FastMallocZone::enumerate):
246 2007-09-15 Darin Adler <darin@apple.com>
250 * JavaScriptCore.exp: Export WTFLogVerbose.
252 2007-09-14 Kevin McCullough <kmccullough@apple.com>
256 - Copy JSRetainPtr to include folder.
258 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
260 2007-09-13 Geoffrey Garen <ggaren@apple.com>
262 Try to fix GDK build.
267 2007-09-12 Geoff Garen <ggaren@apple.com>
269 Reviewed by Sam Weinig.
271 Fixed <rdar://problem/5429064> 141885 Safari JavaScript: Math.random() slightly less randomly distributed than on Safari / Mac
273 Math.random was skewed slightly upward because it assumed that RAND_MAX was outside the range of
274 values that rand() might return. This problem was particularly pronounced on Windows because
275 the range of values returned by rand() on Windows is 2^16 smaller than the range of values
276 return by rand() on Mac.
278 Fixed by accounting for RAND_MAX return values. Also, switched Windows over to rand_s, which has
279 a range that's equal to rand()'s range on Mac.
283 * kjs/math_object.cpp:
284 (MathFuncImp::callAsFunction): Use the new new thing.
286 * wtf/MathExtras.h: Platform abstraction for random numbers, to cover over differences on Windows.
290 2007-09-13 Antti Koivisto <antti@apple.com>
294 Small addition to previous path to cover
295 http://bugs.webkit.org/show_bug.cgi?id=11399
296 window.eval runs in the global scope of the calling window
298 Switch variable scope as well.
301 (KJS::GlobalFuncImp::callAsFunction):
303 2007-09-12 Antti Koivisto <antti@apple.com>
305 Reviewed by Geoff, Maciej.
307 Fix <rdar://problem/5445058>
308 REGRESSION: Unable to upload picture to eBay auction due to domain security check
310 eBay uses window.eval() between windows. In Firefox window.eval() switches execution
311 and security context to the target window, something WebKit did not do. With WebKit
312 security tightening in r24781, this broke picture uploads.
314 Fix by making WebKit switch context in window.eval().
317 (KJS::Context::Context):
318 (KJS::Context::~Context):
320 Save and restore interpreter context independently from calling context.
323 (KJS::GlobalFuncImp::callAsFunction):
324 If eval is called for global object different than current one, switch execution context
325 to that object and push it to scope.
327 2007-09-12 Sam Weinig <sam@webkit.org>
329 Reviewed by Geoffrey Garen.
331 <rdar://problem/5478717> JSStringCreateWithCFString leaks when passed a zero length CFStringRef
333 * API/JSStringRefCF.cpp:
334 (JSStringCreateWithCFString): Special case the zero length string and remove the
335 UTF16 optimized path since it will always leak due to the fact that we won't be
336 able to free the backing store that the CFStringRef provides.
338 2007-09-10 Timothy Hatcher <timothy@apple.com>
340 Reviewed by Darin Adler.
342 <rdar://problem/5456224> CrashTracer: [USER] 2 crashes in Toast Titanium at com.apple.CoreServices.CarbonCore: CSMemDisposePtr + 37
344 Removed the implementation of these malloc zone functions. We do not have the ability to
345 check if a pointer is valid or not, so we can't correctly implement them. The system free
346 does not fail if you pass in a bad pointer.
348 * wtf/FastMalloc.cpp:
349 (WTF::FastMallocZone::size):
350 (WTF::FastMallocZone::zoneMalloc):
351 (WTF::FastMallocZone::zoneCalloc):
352 (WTF::FastMallocZone::zoneFree):
353 (WTF::FastMallocZone::zoneRealloc):
355 2007-09-07 Darin Adler <darin@apple.com>
357 Reviewed by Steve Falkenburg.
359 - fix crash seen on Windows release builds
361 * wtf/FastMalloc.cpp: Change pthread_getspecific optimization to be done only
362 on the DARWIN platform. Also correct a couple reinterpret_cast that should be
365 2007-09-06 Kevin McCullough <kmccullough@apple.com>
369 - Moved JSRetainPtr to the API.
371 * API/JSRetainPtr.h: Copied from kjs/JSRetainPtr.h.
374 (JSRetainPtr::JSRetainPtr):
375 (JSRetainPtr::~JSRetainPtr):
377 (JSRetainPtr::releaseRef):
378 (JSRetainPtr::operator->):
379 (JSRetainPtr::operator!):
380 (JSRetainPtr::operator UnspecifiedBoolType):
387 * JavaScriptCore.xcodeproj/project.pbxproj:
388 * kjs/JSRetainPtr.h: Removed.
390 2007-09-05 Maciej Stachowiak <mjs@apple.com>
394 - Remove single-threaded optimization for FastMalloc.
396 It does not appear to help anywhere but Mac OS X on PPC, due to
397 pthread_getspecific being slow there. On Intel, removing the
398 optimization results in a ~1.5% PLT speedup, a ~1-5% JS iBench
399 speedup, and a ~1.5% HTML iBench speedup. On PPC this change is a
400 speedup on some benchmarks, a slight hit on others.
402 * JavaScriptCore.xcodeproj/project.pbxproj:
404 (KJS::Collector::registerThread):
405 * wtf/FastMalloc.cpp:
406 (WTF::TCMalloc_ThreadCache::GetCache):
407 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
408 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
410 * wtf/FastMallocInternal.h: Removed.
412 2007-09-05 Kevin McCullough <kmccullough@apple.com>
414 Reviewed by Adam, Sam, Darin.
416 - Created a JSRetainPtr specifically for JSStringRefs so they can be automatically refed and derefed.
418 * JavaScriptCore.xcodeproj/project.pbxproj:
419 * kjs/JSRetainPtr.h: Copied from wtf/RetainPtr.h.
423 (KJS::JSRetainPtr::JSRetainPtr):
424 (KJS::JSRetainPtr::~JSRetainPtr):
425 (KJS::JSRetainPtr::get):
426 (KJS::JSRetainPtr::releaseRef):
427 (KJS::JSRetainPtr::operator->):
428 (KJS::JSRetainPtr::operator UnspecifiedBoolType):
436 2007-09-05 Mark Rowe <mrowe@apple.com>
438 Unreviewed Qt build fix.
440 * wtf/unicode/qt4/UnicodeQt4.h: Fix the constness of the src argument to toUpper to prevent build failures.
442 2007-09-04 Maciej Stachowiak <mjs@apple.com>
444 Back out accidentally committed change.
446 * JavaScriptCore.xcodeproj/project.pbxproj:
448 (KJS::Collector::registerThread):
449 * wtf/FastMalloc.cpp:
450 (WTF::fastMallocSetIsMultiThreaded):
451 (WTF::TCMalloc_ThreadCache::GetCache):
452 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
453 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
455 * wtf/FastMallocInternal.h: Added.
457 2007-09-04 Maciej Stachowiak <mjs@apple.com>
461 - Added Vector::appendRange(), which appends to a vector based on a given start and end iterator
462 - Added keys() and values() functions to HashMap iterators, which give keys-only and values-only iterators
464 Together, these allow easy copying of a set, or the keys or values of a map, into a Vector. Examples:
466 HashMap<int, int> map;
470 vec.appendRange(set.begin(), set.end());
471 vec.appendRange(map.begin().keys(), map.end().keys());
472 vec.appendRange(map.begin().values(), map.end().values());
474 This also allows for a slightly nicer syntax when iterating a map. Instead of saying
475 (*it)->first, you can say *it.values(). Similarly for keys. Example:
477 HashMap<int, int>::const_iterator end = map.end();
478 for (HashMap<int, int>::const_iterator it = map.begin(); it != end; ++it)
479 printf(" [%d => %d]", *it.keys(), *it.values());
481 * JavaScriptCore.xcodeproj/project.pbxproj:
482 * wtf/HashIterators.h: Added.
484 (WTF::HashTableConstKeysIterator::HashTableConstKeysIterator):
485 (WTF::HashTableConstKeysIterator::get):
486 (WTF::HashTableConstKeysIterator::operator*):
487 (WTF::HashTableConstKeysIterator::operator->):
488 (WTF::HashTableConstKeysIterator::operator++):
489 (WTF::HashTableConstValuesIterator::HashTableConstValuesIterator):
490 (WTF::HashTableConstValuesIterator::get):
491 (WTF::HashTableConstValuesIterator::operator*):
492 (WTF::HashTableConstValuesIterator::operator->):
493 (WTF::HashTableConstValuesIterator::operator++):
494 (WTF::HashTableKeysIterator::HashTableKeysIterator):
495 (WTF::HashTableKeysIterator::get):
496 (WTF::HashTableKeysIterator::operator*):
497 (WTF::HashTableKeysIterator::operator->):
498 (WTF::HashTableKeysIterator::operator++):
499 (WTF::HashTableKeysIterator::operator HashTableConstKeysIterator<HashTableType, KeyType, MappedType>):
500 (WTF::HashTableValuesIterator::HashTableValuesIterator):
501 (WTF::HashTableValuesIterator::get):
502 (WTF::HashTableValuesIterator::operator*):
503 (WTF::HashTableValuesIterator::operator->):
504 (WTF::HashTableValuesIterator::operator++):
505 (WTF::HashTableValuesIterator::operator HashTableConstValuesIterator<HashTableType, KeyType, MappedType>):
510 (WTF::::appendRange):
512 2007-09-04 Maciej Stachowiak <mjs@apple.com>
516 - Remove single-threaded optimization for FastMalloc.
518 It does not appear to help anywhere but Mac OS X on PPC, due to
519 pthread_getspecific being slow there. On Intel, removing the
520 optimization results in a 1% PLT speedup, a 2% JS iBench speedup,
521 and no measurable effect on HTML iBench (maybe a slight speedup).
523 * JavaScriptCore.xcodeproj/project.pbxproj:
525 (KJS::Collector::registerThread):
526 * wtf/FastMalloc.cpp:
527 (WTF::TCMalloc_ThreadCache::GetCache):
528 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
529 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
531 * wtf/FastMallocInternal.h: Removed.
533 2007-09-03 Mark Rowe <mrowe@apple.com>
535 Reviewed by Tim Hatcher.
537 <rdar://problem/5452164> Production build with in symbols directory has no debug info
539 Enable debug symbol generation on all build configurations. Production builds are stripped
540 of symbols by Xcode during deployment post-processing.
542 * Configurations/Base.xcconfig:
543 * JavaScriptCore.xcodeproj/project.pbxproj:
545 2007-08-30 Riku Voipio <riku.voipio@iki.fi>
547 Reviewed by Dave Kilzer.
551 * kjs/ustring.h: Update comments to reflect the change and update test
552 to fit changes to Platform.h.
553 * wtf/Platform.h: Forced packing is only needed on oldabi ARM.
554 Set middle-endian floats only for little-endian oldabi ARM.
555 Set big-endian define for big-endian ARM.
557 2007-08-29 Ryan Leavengood <leavengood@gmail.com>
561 http://bugs.webkit.org/show_bug.cgi?id=15043
562 - posix_memalign takes a void** as its first parameter. My port makes use of this function call.
565 (KJS::allocateBlock):
567 2007-08-26 Darin Adler <darin@apple.com>
569 - quick follow on to that last check-in
571 * API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject):
572 Need to initialize m_class to 0.
574 2007-08-26 Mark Rowe <mrowe@apple.com>
576 Reviewed by Darin Adler.
578 <rdar://problem/4949002> JSGlobalContextCreate can cause crashes because it passes a NULL JSContextRef to the globalObjectClass's initialize callback
580 JSCallbackObject now tracks whether it was constructed with a null ExecState. This will happen when the object is being used as the global object,
581 as the Interpreter needs to be created after the global object. In this situation the initialization is deferred until after the Interpreter's
582 ExecState is available to be passed down to the initialize callbacks.
584 * API/JSCallbackObject.cpp:
585 (KJS::JSCallbackObject::init): Track whether we successfully initialized.
586 (KJS::JSCallbackObject::initializeIfNeeded): Attempt to initialize with the new ExecState.
587 * API/JSCallbackObject.h:
588 * API/JSContextRef.cpp:
589 (JSGlobalContextCreate): Initialize the JSCallbackObject with the Interpreter's ExecState.
591 (testInitializeOfGlobalObjectClassHasNonNullContext):
592 (main): Verify that the context passed to the initialize callback is non-null.
594 2007-08-26 Mark Rowe <mrowe@apple.com>
596 Reviewed by Darin Adler.
598 <rdar://problem/5438496> JSGlobalContextCreate crashes when passed a custom class
600 * API/JSContextRef.cpp:
601 (JSGlobalContextCreate): Specify jsNull() as the prototype and let Interpreter's constructor fix it up to point at builtinObjectPrototype().
603 (main): Use an instance of a custom class as the global object to ensure the code path is exercised in the test.
605 2007-08-26 Mike Hommey <glandium@debian.org>
607 Reviewed by Mark Rowe and David Kilzer.
609 Fix build failure on arm.
611 * wtf/Platform.h: Also test if __arm__ is defined.
613 2007-08-25 Peter Kasting <zerodpx@gmail.org>
615 Reviewed by Maciej Stachowiak.
617 Part 3 of http://bugs.webkit.org/show_bug.cgi?id=14967
618 Bug 14967: Reduce wtf::Vector::operator[]() overloads
621 (WTF::Vector::operator[]): Only provide versions of operator[] that takes a size_t argument.
623 2007-08-25 Peter Kasting <zerodpx@gmail.org>
625 Reviewed by Sam Weinig.
627 Part 2 of http://bugs.webkit.org/show_bug.cgi?id=14967.
628 Eliminate all remaining implicit conversions of wtf::Vector<T> to T*. Where code was
629 previously checking that the Vector's data pointer was non-NULL, check !Vector::isEmpty()
635 2007-08-16 Kevin McCullough <kmccullough@apple.com>
637 Reviewed by Geoff and Adam.
639 - 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)
643 2007-08-15 Peter Kasting <zerodpx@gmail.org>
647 http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
648 conversions of wtf::Vector<T> to T* by explicitly calling .data()
650 * API/JSCallbackConstructor.cpp:
651 (KJS::JSCallbackConstructor::construct):
652 * API/JSCallbackFunction.cpp:
653 (KJS::JSCallbackFunction::callAsFunction):
654 * API/JSCallbackObject.cpp:
655 (KJS::JSCallbackObject::construct):
656 (KJS::JSCallbackObject::callAsFunction):
657 * bindings/c/c_instance.cpp:
658 (KJS::Bindings::CInstance::invokeMethod):
659 (KJS::Bindings::CInstance::invokeDefaultMethod):
660 * kjs/number_object.cpp:
661 (integer_part_noexp):
664 (KJS::UString::UTF8String):
666 2007-08-14 Darin Adler <darin@apple.com>
670 - fix <rdar://problem/5410570> Global initializer introduced by use of std::numeric_limits in r24919
673 (KJS::overflowIndicator): Turned into a function.
674 (KJS::maxUChars): Ditto.
675 (KJS::allocChars): Use the functions.
676 (KJS::reallocChars): Ditto.
677 (KJS::UString::expandedSize): Ditto.
679 2007-08-12 Darin Adler <darin@apple.com>
683 - fix http://bugs.webkit.org/show_bug.cgi?id=14931
684 <rdar://problem/5403816> JavaScript regular expression non-participating capturing parentheses
685 fail in 3 different ways
687 Test: fast/js/regexp-non-capturing-groups.html
689 * kjs/string_object.cpp:
690 (KJS::replace): Add missing code to handle undefined backreferences; before we'd get the empty string
691 instead of a JavaScript "undefined" value.
692 (KJS::StringProtoFunc::callAsFunction): Implemented backreference support for split.
693 * pcre/pcre_exec.c: (match): Made backreferences to undefined groups match the empty string instead
694 of always failing. Only in JAVASCRIPT mode.
696 * tests/mozilla/expected.html: Add a new expected test success, since this fixed one test result.
698 2007-08-10 Timothy Hatcher <timothy@apple.com>
702 <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
704 Disable the NPAPI for 64-bit on Mac OS X.
706 * Configurations/JavaScriptCore.xcconfig: Use the 64-bit export file.
707 * JavaScriptCore.xcodeproj/project.pbxproj: Create a 64-bit export file
708 that filters out the NPN fnctions.
709 * bindings/NP_jsobject.cpp: #ifdef out this for 64-bit on Mac OS X
710 * bindings/NP_jsobject.h: Ditto.
711 * bindings/c/c_class.cpp: Ditto.
712 * bindings/c/c_class.h: Ditto.
713 * bindings/c/c_instance.cpp: Ditto.
714 * bindings/c/c_instance.h: Ditto.
715 * bindings/c/c_runtime.cpp: Ditto.
716 * bindings/c/c_runtime.h: Ditto.
717 * bindings/c/c_utility.cpp: Ditto.
718 * bindings/c/c_utility.h: Ditto.
719 * bindings/npapi.h: Ditto.
720 * bindings/npruntime.cpp: Ditto.
721 * bindings/npruntime.h: Ditto.
722 * bindings/npruntime_impl.h: Ditto.
723 * bindings/npruntime_priv.h: Ditto.
724 * bindings/runtime.cpp:
725 (KJS::Bindings::Instance::createBindingForLanguageInstance):
726 don't creat an NPObject on Mac OS X in 64-bit.
728 2007-08-09 Mark Rowe <mrowe@apple.com>
732 <rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
734 * Configurations/Version.xcconfig:
735 * JavaScriptCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
736 Version.xcconfig and Info.plist explicit to Xcode.
738 2007-08-08 George Staikos <staikos@kde.org>
740 Make it compile with Qt again.
742 * wtf/unicode/qt4/UnicodeQt4.h:
743 (WTF::Unicode::toUpper):
745 2007-08-07 Sam Weinig <sam@webkit.org>
749 Fix for http://bugs.webkit.org/show_bug.cgi?id=14897
750 Decompilation of double negation fails and produces invalid or incorrect code
752 Test: fast/js/function-decompilation-operators.html
754 * kjs/nodes2string.cpp:
755 (UnaryPlusNode::streamTo): Put space after unary operator. Matches Firefox.
756 (NegateNode::streamTo): Diito.
757 (MultNode::streamTo): Put spaces around binary operator. Matches Firefox.
758 (AddNode::streamTo): Ditto.
760 2007-08-07 Darin Adler <darin@apple.com>
764 - fix <rdar://problem/5383104> REGRESSION: XHR.responseText is null instead of empty string
765 in http/tests/xmlhttprequest/zero-length-response.html
767 The new code to handle out of memory conditions was turning a "" into a null string.
769 * kjs/ustring.h: Removed UCharReference, which has long been obsolete and unused.
770 Removed copyForWriting, which was only used for the upper/lowercasing code and for
773 (KJS::allocChars): Removed special case that made this fail (return 0) when passed 0.
774 Instead assert that we're not passed 0. Also added an overflow check for two reasons:
775 1) for sizes that aren't checked this prevents us from allocating a buffer that's too
776 small, and 2) for sizes where we overflowed in the expandedSize function and returned
777 overflowIndicator, it guarantees we fail.
778 (KJS::reallocChars): Ditto.
779 (KJS::UString::expandedSize): Return a large number, overflowIndicator, rather than 0
780 for cases where we overflow.
781 (KJS::UString::spliceSubstringsWithSeparators): Added a special case for empty string so
782 we don't call allocChars with a length of 0.
783 (KJS::UString::operator=): Added special characters for both 0 and empty string so we
784 match the behavior of the constructor. This avoids calling allocChars with a length of 0
785 and making a null string rather than an empty string in that case, and also matches the
786 pattern used in the rest of the functions.
787 (KJS::UString::operator[]): Made the return value const so code that tries to use the
788 operator to modify the string will fail.
790 * kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction): Rewrote uppercasing and
791 lowercasing functions so they don't need copyForWriting any more -- it wasn't really doing
792 any good for optimization purposes. Instead use a Vector and releaseBuffer.
794 * wtf/unicode/icu/UnicodeIcu.h: Eliminate one of the versions of toLower/toUpper -- we now
795 only need the version where both a source and destination buffer is passed in, not the one
797 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
799 2007-08-06 Sam Weinig <sam@webkit.org>
803 Fix for http://bugs.webkit.org/show_bug.cgi?id=14891
804 Decompilation of try block immediately following "else" fails
806 Test: fast/js/toString-try-else.html
808 * kjs/nodes2string.cpp:
809 (TryNode::streamTo): Add newline before "try".
811 2007-08-07 Mark Rowe <mrowe@apple.com>
815 <rdar://problem/5388774> REGRESSION: Hang occurs after clicking "Attach a file " link in a new .Mac message
817 Attempting to acquire the JSLock inside CollectorHeap::forceLock can lead to a deadlock if the thread currently
818 holding the lock is waiting on the thread that is forking. It is not considered safe to use system frameworks
819 after a fork without first execing[*] so it is not particularly important to ensure that the collector and
820 fastMalloc allocators are unlocked in the child process. If the child process wishes to use JavaScriptCore it
821 should exec after forking like it would to use any other system framework.
822 [*]: <http://lists.apple.com/archives/Cocoa-dev/2005/Jan/msg00676.html>
824 * kjs/CollectorHeapIntrospector.cpp: Remove forceLock and forceUnlock implementations.
825 * kjs/CollectorHeapIntrospector.h: Stub out forceLock and forceUnlock methods.
826 * wtf/FastMalloc.cpp: Ditto.
828 2007-08-06 Darin Adler <darin@apple.com>
830 Rubber stamped by Geoff.
832 * kjs/ustring.h: Added an assertion which would have helped us find the
833 previous bug more easily.
835 2007-08-06 Darin Adler <darin@apple.com>
839 - fix <rdar://problem/5387589> 9A514: Quartz Composer crash on launch in KJS::jsString
842 (JSEvaluateScript): Turn NULL for sourceURL into UString::null(), just as JSObjectMakeFunction already does.
843 (JSCheckScriptSyntax): Ditto.
845 2007-08-06 Matt Lilek <pewtermoose@gmail.com>
847 Not reviewed, build fix.
849 * kjs/string_object.cpp:
850 (KJS::StringProtoFunc::callAsFunction):
852 2007-08-04 Darin Adler <darin@apple.com>
856 - fix <rdar://problem/5371862> crash in Dashcode due to Quartz Composer JavaScript garbage collector reentrancy
858 * API/JSBase.cpp: (JSGarbageCollect): Don't call collector() if isBusy() returns true.
860 * kjs/collector.h: Added isBusy(), removed the unused return value from collect()
861 * kjs/collector.cpp: Added an "operation in progress" flag to the allocator.
862 (KJS::Collector::allocate): Call abort() if an operation is already in progress. Set the new flag instead
863 of using the debug-only GCLock.
864 (KJS::Collector::collect): Ditto.
865 (KJS::Collector::isBusy): Added.
867 2007-08-04 Maciej Stachowiak <mjs@apple.com>
869 Reviewed by Darin and Adam.
871 <rdar://problem/5368990> REGRESSION: newsgator.com sign-on 6x slower than Safari 3 beta due to GC changes (14808)
873 * kjs/string_object.cpp:
874 (KJS::replace): if the string didn't change (very common in some cases) reuse the original string value.
875 (KJS::StringProtoFunc::callAsFunction): Pass in the StringImp* when replacing, not just the UString.
876 * kjs/string_object.h:
877 (KJS::StringInstance::internalValue): covariant override to return StringImp for convenience
879 2007-08-04 Mark Rowe <mrowe@apple.com>
881 Reviewed by Oliver Hunt.
883 <rdar://problem/5385145> r24843 introduces a crash on calling fork() (14878)
884 http://bugs.webkit.org/show_bug.cgi?id=14878
886 Provide no-op functions for all members of the malloc_zone_t and malloc_introspection_t structures that we
887 register to avoid crashes in system code that assumes they will be non-null.
889 * kjs/CollectorHeapIntrospector.cpp:
890 (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector):
891 (KJS::CollectorHeapIntrospector::forceLock): Grab the lock.
892 (KJS::CollectorHeapIntrospector::forceUnlock): Release the lock.
893 * kjs/CollectorHeapIntrospector.h:
894 (KJS::CollectorHeapIntrospector::goodSize):
895 (KJS::CollectorHeapIntrospector::check):
896 (KJS::CollectorHeapIntrospector::print):
897 (KJS::CollectorHeapIntrospector::log):
898 (KJS::CollectorHeapIntrospector::statistics):
899 (KJS::CollectorHeapIntrospector::size):
900 (KJS::CollectorHeapIntrospector::zoneMalloc):
901 (KJS::CollectorHeapIntrospector::zoneCalloc):
902 (KJS::CollectorHeapIntrospector::zoneFree):
903 * wtf/FastMalloc.cpp:
904 (WTF::FastMallocZone::goodSize):
905 (WTF::FastMallocZone::check):
906 (WTF::FastMallocZone::print):
907 (WTF::FastMallocZone::log):
908 (WTF::FastMallocZone::forceLock): Grab the TCMalloc locks.
909 (WTF::FastMallocZone::forceUnlock): Release the TCMalloc locks.
910 (WTF::FastMallocZone::FastMallocZone):
912 2007-08-04 Mark Rowe <mrowe@apple.com>
914 Rubber-stamped by Anders.
916 * pcre/pcre_compile.c: Remove non-ASCII character from a comment.
918 2007-08-02 Mark Rowe <mrowe@apple.com>
920 Reviewed by Geoff Garen.
922 <rdar://problem/4212199> 'leaks' reports false leaks in WebKit (because the WTF allocator uses mmap?)
924 Implement malloc zone introspection routines to allow leaks, heap, and friends to request information
925 about specific memory regions that were allocated by FastMalloc or the JavaScriptCore collector.
927 This requires tool-side support before the regions will be displayed. The addition of that support is
928 tracked by <rdar://problems/5353057&5353060>.
930 * JavaScriptCore.exp: Export the two variables that are used by leaks to introspect the allocators.
931 * JavaScriptCore.xcodeproj/project.pbxproj:
932 * kjs/AllInOneFile.cpp:
933 * kjs/CollectorHeapIntrospector.cpp: Added.
935 (KJS::CollectorHeapIntrospector::init):
936 (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector): Create and register our zone with the system.
937 (KJS::CollectorHeapIntrospector::enumerate): Iterate over the CollectorBlocks that are in use and report them to the caller as being used.
938 * kjs/CollectorHeapIntrospector.h: Added.
939 (KJS::CollectorHeapIntrospector::size): Return zero to indicate the specified pointer does not belong to this zone.
941 (KJS::Collector::registerThread): Register the CollectorHeapIntrospector with the system when the first thread is registered with the collector.
942 * wtf/FastMalloc.cpp:
943 (WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe):
944 (WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Enumerate the objects on the free list.
945 (WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Ditto.
946 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Ditto.
947 (WTF::TCMalloc_ThreadCache::InitModule): Register the FastMallocZone with the system when initializing TCMalloc.
948 (WTF::FreeObjectFinder::FreeObjectFinder):
949 (WTF::FreeObjectFinder::visit): Add an object to the free list.
950 (WTF::FreeObjectFinder::isFreeObject):
951 (WTF::FreeObjectFinder::freeObjectCount):
952 (WTF::FreeObjectFinder::findFreeObjects): Find the free objects within a thread cache or free list.
953 (WTF::PageMapFreeObjectFinder::PageMapFreeObjectFinder): Find the free objects within a TC_PageMap.
954 (WTF::PageMapFreeObjectFinder::visit): Called once per allocated span. Record whether the span or any subobjects are free.
955 (WTF::PageMapMemoryUsageRecorder::PageMapMemoryUsageRecorder):
956 (WTF::PageMapMemoryUsageRecorder::visit): Called once per allocated span. Report the range of memory as being allocated, and the span or
957 its subobjects as being used if they do not appear on the free list.
958 (WTF::FastMallocZone::enumerate): Map the key remote TCMalloc data structures into our address space. We then locate all free memory ranges
959 before reporting the other ranges as being in use.
960 (WTF::FastMallocZone::size): Determine whether the given pointer originates from within our allocation zone. If so,
961 we return its allocation size.
962 (WTF::FastMallocZone::zoneMalloc):
963 (WTF::FastMallocZone::zoneCalloc):
964 (WTF::FastMallocZone::zoneFree):
965 (WTF::FastMallocZone::zoneRealloc):
967 (WTF::FastMallocZone::FastMallocZone): Create and register our zone with the system.
968 (WTF::FastMallocZone::init):
969 * wtf/MallocZoneSupport.h: Added.
970 (WTF::RemoteMemoryReader::RemoteMemoryReader): A helper class to ease the process of mapping memory in a different process into
971 our local address space
972 (WTF::RemoteMemoryReader::operator()):
974 (TCMalloc_PageMap2::visit): Walk over the heap and visit each allocated span.
975 (TCMalloc_PageMap3::visit): Ditto.
977 2007-08-02 Mark Rowe <mrowe@apple.com>
982 (KJS::UString::expandedSize): Use std::numeric_limits<size_t>::max() rather than the non-portable SIZE_T_MAX.
984 2007-08-02 Mark Rowe <mrowe@apple.com>
988 <rdar://problem/5352887> "Out of memory" error during repeated JS string concatenation leaks hundreds of MBs of RAM
990 A call to fastRealloc was failing which lead to UString::expandCapacity leaking the buffer it was trying to reallocate.
991 It also resulted in the underlying UString::rep having both a null baseString and buf field, which meant that attempting
992 to access the contents of the string after the failed memory reallocation would crash.
994 A third issue is that expandedSize size was calculating the new length in a way that led to an integer overflow occurring.
995 Attempting to allocate a string more than 190,000,000 characters long would fail a the integer overflow would lead to a
996 memory allocation of around 3.6GB being attempted rather than the expected 390MB. Sizes that would lead to an overflow
997 are now returned as zero and callers are updated to treat this as though the memory allocation has failed.
999 * kjs/array_object.cpp:
1000 (ArrayProtoFunc::callAsFunction): Check whether the append failed and raise an "Out of memory" exception if it did.
1002 (KJS::allocChars): Wrapper around fastMalloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
1003 (KJS::reallocChars): Wrapper around fastRealloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
1004 (KJS::UString::expandedSize): Split the size calculation in two and guard against overflow during each step.
1005 (KJS::UString::expandCapacity): Don't leak r->buf if reallocation fails. Instead free the memory and use the null representation.
1006 (KJS::UString::expandPreCapacity): If fastMalloc fails then use the null representation rather than crashing in memcpy.
1007 (KJS::UString::UString): If calls to expandCapacity, expandPreCapacity or fastMalloc fail then use the null representation rather than crashing in memcpy.
1008 (KJS::UString::append): Ditto.
1009 (KJS::UString::operator=): Ditto.
1010 * kjs/ustring.h: Change return type of expandedSize from int to size_t.
1012 2007-08-01 Darin Adler <darin@apple.com>
1014 Reviewed by Kevin McCullough.
1016 - fix <rdar://problem/5375186> pointers to pieces of class definition passed to JSClassCreate should all be const
1018 * API/JSObjectRef.h: Added const.
1020 * API/JSClassRef.cpp:
1021 (OpaqueJSClass::OpaqueJSClass): Added const.
1022 (OpaqueJSClass::create): Added const.
1023 * API/JSObjectRef.cpp:
1024 (JSClassCreate): Added const.
1026 2007-08-01 Steve Falkenburg <sfalken@apple.com>
1028 Build mod: Fix sln to match configs in vcproj.
1032 * JavaScriptCore.vcproj/JavaScriptCore.make:
1033 * JavaScriptCore.vcproj/JavaScriptCore.sln:
1035 2007-07-30 Simon Hausmann <hausmann@kde.org>
1037 Done with and reviewed by Lars.
1039 Removed the __BUILDING_QT ifdef in JSStringRef.h and changed UChar for the Qt build to use wchar_t on Windows.
1041 * API/JSStringRef.h:
1042 * wtf/unicode/qt4/UnicodeQt4.h:
1044 2007-07-27 Simon Hausmann <hausmann@kde.org>
1046 Done with and reviewed by Lars and Zack.
1048 Always define JSChar to be unsigned short for the Qt builds, to ensure compatibility with UChar.
1050 * API/JSStringRef.h:
1052 2007-07-27 Simon Hausmann <hausmann@kde.org>
1054 Done with and reviewed by Lars and Zack.
1056 Fix compilation with Qt on Windows with MingW: Implemented currentThreadStackBase() for this platform.
1058 * kjs/collector.cpp:
1059 (KJS::currentThreadStackBase):
1061 2007-07-27 Simon Hausmann <hausmann@kde.org>
1063 Done with and reviewed by Lars and Zack.
1065 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.
1068 (KJS::getDSTOffsetSimple):
1070 2007-07-27 Simon Hausmann <hausmann@kde.org>
1072 Done with and reviewed by Lars and Zack.
1074 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.
1076 * JavaScriptCore.pri:
1078 2007-07-27 Simon Hausmann <hausmann@kde.org>
1080 Done with and reviewed by Lars and Zack.
1082 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.
1084 * kjs/interpreter.cpp:
1085 (KJS::getCurrentTime):
1090 2007-07-27 Simon Hausmann <hausmann@kde.org>
1092 Done with and reviewed by Lars and Zack.
1094 Replace the use of snprintf with QByteArray to compile under msvc 2005 express.
1096 * bindings/qt/qt_instance.cpp:
1097 (KJS::Bindings::QtInstance::stringValue):
1099 2007-07-27 Simon Hausmann <hausmann@kde.org>
1101 Done with and reviewed by Lars and Zack.
1103 Don't use pthread.h unless thread support is enabled.
1105 * kjs/collector.cpp:
1106 (KJS::Collector::registerAsMainThread):
1107 (KJS::onMainThread):
1109 2007-07-27 Simon Hausmann <hausmann@kde.org>
1111 Done with and reviewed by Lars and Zack.
1113 Removed TCSystemMalloc from the Qt build, it's not necessary it seems.
1115 * JavaScriptCore.pri:
1117 2007-07-27 Simon Hausmann <hausmann@kde.org>
1119 Done with and reviewed by Lars and Zack.
1121 Added os-win32 to the include search path for the Qt windows build in order to provide the fake stdint.h header file.
1123 * JavaScriptCore.pri:
1125 2007-07-25 Maciej Stachowiak <mjs@apple.com>
1129 - follow-up to previous change
1132 (KJS::UString::operator=): Make sure to reset the length when
1133 replacing the buffer contents for a single-owned string.
1135 2007-07-25 Maciej Stachowiak <mjs@apple.com>
1139 - JavaScriptCore part of fix for <rdar://problem/5300291> Optimize GC to reclaim big, temporary objects (like XMLHttpRequest.responseXML) quickly
1141 Also, as a side effect of optimizations included in this patch:
1142 - 7% speedup on JavaScript iBench
1143 - 4% speedup on "Celtic Kane" JS benchmark
1145 The basic idea is explained in a big comment in collector.cpp. When unusually
1146 large objecs are allocated, we push the next GC closer on the assumption that
1147 most objects are short-lived.
1149 I also did the following two optimizations in the course of tuning
1150 this not to be a performance regression:
1152 1) Change UString::Rep to hold a self-pointer as the baseString in
1153 the unshared case, instead of a null pointer; this removes a
1154 number of null checks in hot code because many places already
1155 wanted to use the rep itself or the baseString as appropriate.
1157 2) Avoid creating duplicate StringImpls when creating a
1158 StringInstance (the object wrapper for a JS string) or calling
1159 their methods. Since a temporary wrapper object is made every time
1160 a string method is called, this resulted in two useless extra
1161 StringImpls being allocated for no reason whenever a String method
1162 was invoked on a string value. Now we bypass those.
1164 * kjs/collector.cpp:
1166 (KJS::Collector::recordExtraCost): Basics of the extra cost mechanism.
1167 (KJS::Collector::allocate): ditto
1168 (KJS::Collector::collect): ditto
1170 (KJS::Collector::reportExtraMemoryCost): ditto
1171 * kjs/array_object.cpp:
1172 (ArrayInstance::ArrayInstance): record extra cost
1174 (KJS::StringImp::toObject): don't create a whole new StringImpl just
1175 to be the internal value of a StringInstance! StringImpls are immutable
1176 so there's no point tot his.
1178 (KJS::StringImp::StringImp): report extra cost
1179 * kjs/string_object.cpp:
1180 (KJS::StringInstance::StringInstance): new version that takes a StringImp
1181 (KJS::StringProtoFunc::callAsFunction): don't create a whole new StringImpl
1182 just to convert self to string! we already have one in the internal value
1183 * kjs/string_object.h: report extra cost
1184 * kjs/ustring.cpp: All changes to handle baseString being self instead of null in the
1187 (KJS::UString::Rep::create):
1188 (KJS::UString::Rep::destroy):
1189 (KJS::UString::usedCapacity):
1190 (KJS::UString::usedPreCapacity):
1191 (KJS::UString::expandCapacity):
1192 (KJS::UString::expandPreCapacity):
1193 (KJS::UString::UString):
1194 (KJS::UString::append):
1195 (KJS::UString::operator=):
1196 (KJS::UString::copyForWriting):
1198 (KJS::UString::Rep::baseIsSelf): new method, now that baseString is
1199 self instead of null in the unshared case we can't just null check.
1200 (KJS::UString::Rep::data): adjusted as mentioned above
1201 (KJS::UString::cost): new method to compute the cost for a UString, for
1205 (KJS::jsString): style fixups.
1206 (KJS::jsOwnedString): new method, use this for strings allocated from UStrings
1207 held by the parse tree. Tracking their cost as part of string cost is pointless,
1208 because garbage collecting them will not actually free the relevant string buffer.
1209 * kjs/value.h: prototyped jsOwnedString.
1211 (StringNode::evaluate): use jsOwnedString as appropriate
1212 (RegExpNode::evaluate): ditto
1213 (PropertyNameNode::evaluate): ditto
1214 (ForInNode::execute): ditto
1216 * JavaScriptCore.exp: Exported some new symbols.
1218 2007-07-23 Anders Carlsson <andersca@apple.com>
1222 <rdar://problem/5121461> REGRESSION: Unable to load JigZone puzzle
1224 * bindings/jni/jni_jsobject.cpp:
1225 (JavaJSObject::createNative):
1227 Call RootObject::gcProtect on the global object, thereby putting it in the
1228 "protect count" set which is used for checking if a native handle is valid.
1230 2007-07-23 Darin Adler <darin@apple.com>
1232 * pcre/pcre_compile.c: Roll back a tiny accidental change in the unused !JAVASCRIPT
1233 side of an #ifdef. This has no effect when using PCRE in JAVASCRIPT mode as we do,
1234 but seems worth rolling back.
1236 2007-07-23 Maciej Stachowiak <mjs@apple.com>
1240 - fix remaining problems with Window shadowing
1243 (VarDeclNode::evaluate): Tweak the special case a little.
1245 2007-07-23 Maciej Stachowiak <mjs@apple.com>
1249 - fix Window shadowing regressions caused by the previous commit.
1252 (VarDeclNode::evaluate): Handle the case of global scope specially.
1254 2007-07-22 Maciej Stachowiak <mjs@apple.com>
1258 -fixed <rdar://problem/5353293> REGRESSION (r24287): 1% i-Bench JS slowdown from JavaScript compatibility fix (14719)
1259 http://bugs.webkit.org/show_bug.cgi?id=14719
1261 My fix for this actually resulted in JS iBench being 1% faster than before the regression
1262 and the Celtic Kane benchmark being 5% faster than before the regression.
1265 (VarDeclNode::handleSlowCase): factored out the slow code path to be out of line.
1266 (VarDeclNode::evaluate): I did a couple of things:
1267 (1) Don't check if the variable is already declared by looking for the property in
1268 the variable object, that code path was dead code.
1269 (2) Special-case the common case where the top of the scope and the variable object
1270 are the same; in that case the variable must always be in the variable object.
1271 (3) Don't return a jsString() of the variable name, nothing uses the return value
1272 from this node types evaluate method.
1275 2007-07-22 Darin Adler <darin@apple.com>
1277 Reviewed by Kevin Decker.
1279 - fix <rdar://problem/5126394> REGRESSION: Crash after clicking back button in test application (13250)
1280 http://bugs.webkit.org/show_bug.cgi?id=13250
1282 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1283 If the object returns 0 for _imp, convert that to "undefined", since callers
1284 can't cope with a JSValue of 0.
1286 2007-07-19 Geoffrey Garen <ggaren@apple.com>
1288 Reviewed by Darin Adler.
1290 Fixed http://bugs.webkit.org/show_bug.cgi?id=10880 | <rdar://problem/5335694>
1291 REGRESSION: JavaScript menu doesn't appear on pricepoint.com (14595)
1293 Though the ECMA spec says auto-semicolon insertion should not occur
1294 without a newline or '}', Firefox treats do-while specially, and the
1295 library used by pricepoint.com requires that special treatment.
1297 * JavaScriptCore.xcodeproj/project.pbxproj:
1300 2007-07-19 Darin Adler <darin@apple.com>
1304 - fix <rdar://problem/5345440> PCRE computes wrong length for expressions with quantifiers
1305 on named recursion or subexpressions
1307 It's challenging to implement proper preflighting for compiling these advanced features.
1308 But we don't want them in the JavaScript engine anyway.
1310 Turned off the following features of PCRE (some of these are simply parsed and not implemented):
1312 \C \E \G \L \N \P \Q \U \X \Z
1315 (?#) (?<=) (?<!) (?>)
1320 Added the following:
1324 Because of \v, the js1_2/regexp/special_characters.js test now passes.
1326 To be conservative, I left some features that JavaScript doesn't want, such as
1327 \012 and \x{2013}, in place. We can revisit these later; they're not directly-enough
1328 related to avoiding the incorrect preflighting.
1330 I also didn't try to remove unused opcodes and remove code from the execution engine.
1331 That could save code size and speed things up a bit, but it would require more changes.
1334 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the sanitizePattern workaround for
1335 lack of \u support, since the PCRE code now has \u support.
1337 * pcre/pcre-config.h: Set JAVASCRIPT to 1.
1338 * pcre/pcre_internal.h: Added ESC_v.
1340 * pcre/pcre_compile.c: Added a different escape table for when JAVASCRIPT is set that
1341 omits all the escapes we don't want interpreted and includes '\v'.
1342 (check_escape): Put !JAVASCRIPT around the code for '\l', '\L', '\N', '\u', and '\U',
1343 and added code to handle '\u2013' inside JAVASCRIPT.
1344 (compile_branch): Put !JAVASCRIPT if around all the code implementing the features we
1346 (pcre_compile2): Ditto.
1348 * tests/mozilla/expected.html: Updated since js1_2/regexp/special_characters.js now
1351 2007-07-18 Darin Adler <darin@apple.com>
1353 Reviewed by Oliver Hunt.
1355 - fix <rdar://problem/5345432> PCRE computes length wrong for expressions such as "[**]"
1357 Test: fast/js/regexp-charclass-crash.html
1359 * pcre/pcre_compile.c: (pcre_compile2): Fix the preflight code that calls
1360 check_posix_syntax to match the actual regular expression compilation code;
1361 before it was missing the check of the first character.
1363 2007-07-19 Holger Hans Peter Freyther <zecke@selfish.org>
1367 Define __BUILDING_GDK when building for Gdk to fix building testkjs on OSX.
1369 * JavaScriptCore.pri:
1371 2007-07-18 Simon Hausmann <hausmann@kde.org>
1373 * Fix the Qt build, call dftables from the right directory.
1375 Reviewed by Adam Treat.
1379 2007-07-18 Simon Hausmann <hausmann@kde.org>
1383 Don't call gcc directly when building the dftables tool but use a separate .pro file for the Qt build.
1385 * pcre/dftables.pro: Added.
1388 2007-07-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1390 Reviewed by Darin, Maciej, and Adam.
1392 Fixes <http://bugs.webkit.org/show_bug.cgi?id=9697>,
1393 the failure of ecma/GlobalObject/15.1.2.2-2.js,
1394 the failure of ecma/LexicalConventions/7.7.3-1.js,
1395 and most of the failures of tests in ecma/TypeConversion/9.3.1-3.js.
1397 Bug 9697: parseInt results may be inaccurate for numbers greater than 2^53
1399 This patch also fixes similar issues in the lexer and UString::toDouble().
1402 (KJS::parseIntOverflow):
1408 (KJS::UString::toDouble):
1409 * tests/mozilla/expected.html:
1411 2007-07-16 Sam Weinig <sam@webkit.org>
1415 Turn off -Wshorten-64-to-32 warning for 64-bit builds.
1417 * Configurations/Base.xcconfig:
1419 2007-07-14 Brady Eidson <beidson@apple.com>
1421 Reviewed by Sam Weinig
1423 Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser
1425 * wtf/Platform.h: Add ENABLE_FTPDIR feature to handle building on platforms that don't have the
1426 proper network-layer support
1428 2007-07-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1432 Fixes http://bugs.webkit.org/show_bug.cgi?id=13517,
1433 http://bugs.webkit.org/show_bug.cgi?id=14237, and
1434 the failure of test js1_5/Scope/regress-185485.js
1436 Bug 13517: DOM Exception 8 in finance.aol.com sub-page
1437 Bug 14237: Javascript "var" statement interprets initialization in the topmost function scope
1440 (VarDeclNode::evaluate):
1441 * tests/mozilla/expected.html:
1443 2007-07-12 Alexey Proskuryakov <ap@webkit.org>
1447 http://bugs.webkit.org/show_bug.cgi?id=14596
1448 Fix JSC compilation with KJS_VERBOSE.
1451 (KJS::FunctionImp::passInParameters):
1453 2007-07-11 George Staikos <staikos@kde.org>
1457 * ForwardingHeaders: Added.
1458 * ForwardingHeaders/JavaScriptCore: Added.
1459 * ForwardingHeaders/JavaScriptCore/APICast.h: Added.
1460 * ForwardingHeaders/JavaScriptCore/JSBase.h: Added.
1461 * ForwardingHeaders/JavaScriptCore/JSContextRef.h: Added.
1462 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
1463 * ForwardingHeaders/JavaScriptCore/JSObjectRef.h: Added.
1464 * ForwardingHeaders/JavaScriptCore/JSStringRef.h: Added.
1465 * ForwardingHeaders/JavaScriptCore/JSStringRefCF.h: Added.
1466 * ForwardingHeaders/JavaScriptCore/JSValueRef.h: Added.
1467 * ForwardingHeaders/JavaScriptCore/JavaScriptCore.h: Added.
1469 2007-07-11 Holger Hans Peter Freyther <zecke@selfish.org>
1473 As of http://bugs.webkit.org/show_bug.cgi?id=14527 move the
1474 WebCore/ForwardingHeader/JavaScriptCore to JavaScriptCore
1476 * ForwardingHeaders: Added.
1477 * ForwardingHeaders/JavaScriptCore: Copied from WebCore/ForwardingHeaders/JavaScriptCore.
1479 2007-07-11 Nikolas Zimmermann <zimmermann@kde.org>
1483 Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
1484 Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
1486 * kjs/create_hash_table:
1488 2007-07-09 Maciej Stachowiak <mjs@apple.com>
1492 - 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
1494 * JavaScriptCore.exp: Added needed export.
1496 2007-07-06 Maciej Stachowiak <mjs@apple.com>
1500 - <rdar://problem/5311093> JavaScriptCore fails to build with strict-aliasing warnings
1502 * Configurations/Base.xcconfig: Re-enable -Wstrict-aliasing
1503 * bindings/jni/jni_utility.cpp:
1504 (KJS::Bindings::getJNIEnv): Type-pun via a union instead of a pointer cast.
1506 (WTF::): Instead of doing type-punned assignments via pointer cast, do one of three things:
1507 (1) assign directly w/o cast if storage type matches real type; (2) assign using cast
1508 via union if type does not need reffing; (3) copy with memcpy and ref/deref manually if type
1509 needs reffing. This is ok peref-wise because memcpy of a constant length gets optomized.
1510 HashTraits are now expected to make ref()/deref() take the storage type, not the true type.
1512 (WTF::): Same basic idea.
1514 (WTF::): Added Assigner template for use by HashMap/HashSet. Change RefCounter to call ref()
1515 and deref() via storage type, avoiding the need to
1517 (WTF::RefCounter::ref): ditto
1518 (WTF::RefCounter::deref): ditto
1520 (WTF::): Change ref() and deref() for RefPtr HashTraits to take the storage type; cast
1521 via union to pointer type.
1522 * wtf/FastMalloc.cpp:
1523 (WTF::TCMalloc_PageHeap::init): Changed from constructor to init function so this can go in a union.
1524 (WTF::): redefine pageheap macro in terms of getPageHeap().
1525 (WTF::getPageHeap): new inline function, helper for pageheap macro. This hides the cast in a union.
1526 (WTF::TCMalloc_ThreadCache::InitModule): Call init() instead of using placement new to initialize page
1529 (TCMalloc_PageMap1::init): Changed from constructor to init function.
1530 (TCMalloc_PageMap2::init): ditto
1531 (TCMalloc_PageMap3::init): ditto
1534 2007-07-06 George Staikos <staikos@kde.org>
1538 Switch USE(ICONDATABASE) to ENABLE(ICONDATABASE)
1542 2007-07-03 Sam Weinig <sam@webkit.org>
1546 Eleventh round of fixes for implicit 64-32 bit conversion errors.
1547 <rdar://problem/5292262>
1549 - Fixes a real bug where where we were setting long long and unsigned long long
1550 values to a long field.
1552 * bindings/objc/objc_utility.mm:
1553 (KJS::Bindings::convertValueToObjcValue):
1555 2007-07-03 Sam Weinig <sam@webkit.org>
1557 Reviewed by Brady Eidson.
1559 Tenth round of fixes for implicit 64-32 bit conversion errors.
1560 <rdar://problem/5292262>
1562 - Add explicit casts.
1567 2007-07-02 Sam Weinig <sam@webkit.org>
1569 Reviewed by Kevin McCullough.
1571 Fourth round of fixes for implicit 64-32 bit conversion errors.
1572 <rdar://problem/5292262>
1574 Add custom piDouble and piFloat constants to use instead of M_PI.
1576 * kjs/math_object.cpp:
1577 (MathObjectImp::getValueProperty):
1581 2007-06-29 Sam Weinig <sam@webkit.org>
1585 Second pass at fixing implicit 64-32 bit conversion errors.
1586 <rdar://problem/5292262>
1588 - Add a toFloat() method to JSValue for float conversion.
1590 * JavaScriptCore.exp:
1592 (KJS::JSValue::toFloat):
1595 2007-06-27 Kevin McCullough <kmccullough@apple.com>
1599 - <rdar://problem/5271937> REGRESSION: Apparent WebKit JavaScript memory smasher when submitting comment to iWeb site (crashes in kjs_pcre_compile2)
1600 - Correctly evaluate the return value of _pcre_ucp_findchar.
1602 * pcre/pcre_compile.c:
1607 2007-06-27 Sam Weinig <sam@webkit.org>
1611 First pass at fixing implicit 64-32 bit conversion errors.
1612 <rdar://problem/5292262>
1614 - Add 'f' suffix where necessary.
1617 (StopWatch::getElapsedMS):
1619 2007-06-26 Geoffrey Garen <ggaren@apple.com>
1621 Reviewed by Maciej Stachowiak.
1623 Fixed <rdar://problem/5296627> JSGarbageCollect headerdoc suggests that
1624 using JavaScriptCore requires leaking memory
1626 * API/JSBase.h: Changed documentation to explain that you can pass NULL
1627 to JSGarbageCollect.
1629 2007-06-26 Adam Treat <adam@staikos.net>
1631 Reviewed by Adam Roben.
1633 Make the SQLite icon database optional.
1637 2007-06-15 George Staikos <staikos@kde.org>
1639 More missing files for Qt.
1641 * JavaScriptCore.pri:
1644 2007-06-15 George Staikos <staikos@kde.org>
1646 Another Qt build fix.
1648 * JavaScriptCore.pri:
1651 2007-06-15 George Staikos <staikos@kde.org>
1655 * JavaScriptCore.pri:
1657 2007-06-20 Mark Rowe <mrowe@apple.com>
1661 Fix http://bugs.webkit.org/show_bug.cgi?id=14244
1662 Bug 14244: Data corruption when using a replace() callback function with data containing "$"
1664 * kjs/string_object.cpp:
1665 (KJS::replace): When 'replacement' is a function, do not replace $n placeholders in its return value.
1666 This matches the behaviour described in ECMA 262 3rd Ed section 15.5.4.1, and as implemented in Firefox.
1668 2007-06-14 Anders Carlsson <andersca@apple.com>
1672 * bindings/runtime_object.cpp:
1673 (RuntimeObjectImp::canPut):
1675 2007-06-14 Anders Carlsson <andersca@apple.com>
1679 <rdar://problem/5103077>
1680 Crash at _NPN_ReleaseObject when quitting page at http://eshop.macsales.com/shop/ModBook
1682 <rdar://problem/5183692>
1683 http://bugs.webkit.org/show_bug.cgi?id=13547
1684 REGRESSION: Crash in _NPN_ReleaseObject when closing Safari on nba.com (13547)
1686 <rdar://problem/5261499>
1687 CrashTracer: [USER] 75 crashes in Safari at com.apple.JavaScriptCore: KJS::Bindings::CInstance::~CInstance + 40
1689 Have the root object track all live instances of RuntimeObjectImp. When invalidating
1690 the root object, also invalidate all live runtime objects by zeroing out their instance ivar.
1691 This prevents instances from outliving their plug-ins which lead to crashes.
1693 * bindings/c/c_utility.cpp:
1694 (KJS::Bindings::convertValueToNPVariant):
1695 * bindings/jni/jni_jsobject.cpp:
1696 (JavaJSObject::convertValueToJObject):
1697 * bindings/jni/jni_utility.cpp:
1698 (KJS::Bindings::convertValueToJValue):
1699 * bindings/objc/objc_runtime.mm:
1700 (ObjcFallbackObjectImp::callAsFunction):
1701 * bindings/runtime_array.cpp:
1702 (RuntimeArray::RuntimeArray):
1703 * bindings/runtime_array.h:
1704 (KJS::RuntimeArray::getConcreteArray):
1705 * bindings/runtime_method.cpp:
1706 (RuntimeMethod::callAsFunction):
1707 * bindings/runtime_method.h:
1708 * bindings/runtime_object.cpp:
1709 (RuntimeObjectImp::RuntimeObjectImp):
1710 (RuntimeObjectImp::~RuntimeObjectImp):
1711 (RuntimeObjectImp::invalidate):
1712 (RuntimeObjectImp::fallbackObjectGetter):
1713 (RuntimeObjectImp::fieldGetter):
1714 (RuntimeObjectImp::methodGetter):
1715 (RuntimeObjectImp::getOwnPropertySlot):
1716 (RuntimeObjectImp::put):
1717 (RuntimeObjectImp::canPut):
1718 (RuntimeObjectImp::defaultValue):
1719 (RuntimeObjectImp::implementsCall):
1720 (RuntimeObjectImp::callAsFunction):
1721 (RuntimeObjectImp::getPropertyNames):
1722 (RuntimeObjectImp::throwInvalidAccessError):
1723 * bindings/runtime_object.h:
1724 * bindings/runtime_root.cpp:
1725 (KJS::Bindings::RootObject::invalidate):
1726 (KJS::Bindings::RootObject::addRuntimeObject):
1727 (KJS::Bindings::RootObject::removeRuntimeObject):
1728 * bindings/runtime_root.h:
1730 2007-06-14 Anders Carlsson <andersca@apple.com>
1734 <rdar://problem/5244948>
1735 Safari keeps on complaining about slow script playing NBC TV video (14133)
1737 http://bugs.webkit.org/show_bug.cgi?id=14133
1738 Runaway JavaScript timer fires when spinning around in Google Maps street view
1740 Make sure to start and stop the timeout checker around calls to JS.
1742 * bindings/NP_jsobject.cpp:
1743 (_NPN_InvokeDefault):
1746 * bindings/jni/jni_jsobject.cpp:
1747 (JavaJSObject::call):
1748 (JavaJSObject::eval):
1750 2007-06-13 Darin Adler <darin@apple.com>
1752 Reviewed by Mark Rowe.
1754 - fix http://bugs.webkit.org/show_bug.cgi?id=14132
1755 array sort with > 10000 elements sets elements > 10000 undefined
1757 Test: fast/js/sort-large-array.html
1759 * kjs/array_instance.h: Replaced pushUndefinedObjectsToEnd with
1760 compactForSorting, and removed ExecState parameters.
1762 * kjs/array_object.cpp:
1763 (ArrayInstance::sort): Changed to call compactForSorting.
1764 (ArrayInstance::compactForSorting): Do the get and delete of the
1765 properties directly on the property map instead of using public
1766 calls from JSObject. The public calls would just read the undefined
1767 values from the compacted sort results array!
1769 2007-06-13 George Staikos <staikos@kde.org>
1773 Fix Mac OS X build after last checkin.
1777 2007-06-14 Lars Knoll <lars@trolltech.com>
1781 Disable FastMalloc for the Qt build and make sure we
1782 don't reimplement the global new/delete operators
1783 when using the system malloc.
1785 * wtf/FastMalloc.cpp:
1789 2007-06-13 Anders Carlsson <andersca@apple.com>
1793 Make sure that bindings instances get correct root objects.
1795 * JavaScriptCore.exp:
1796 * bindings/NP_jsobject.cpp:
1797 (listFromVariantArgs):
1798 (_NPN_InvokeDefault):
1801 * bindings/c/c_instance.cpp:
1802 (KJS::Bindings::CInstance::invokeMethod):
1803 (KJS::Bindings::CInstance::invokeDefaultMethod):
1804 * bindings/c/c_runtime.cpp:
1805 (KJS::Bindings::CField::valueFromInstance):
1806 * bindings/c/c_utility.cpp:
1807 (KJS::Bindings::convertNPVariantToValue):
1808 * bindings/c/c_utility.h:
1809 * bindings/objc/objc_instance.mm:
1810 (ObjcInstance::invokeMethod):
1811 (ObjcInstance::invokeDefaultMethod):
1812 (ObjcInstance::getValueOfUndefinedField):
1813 * bindings/objc/objc_runtime.mm:
1814 (ObjcField::valueFromInstance):
1815 (ObjcArray::valueAt):
1816 * bindings/objc/objc_utility.h:
1817 * bindings/objc/objc_utility.mm:
1818 (KJS::Bindings::convertObjcValueToValue):
1819 * bindings/runtime.h:
1821 2007-06-13 Simon Hausmann <hausmann@kde.org>
1825 * kjs/testkjs.pro: WebKitQt is now called QtWebKit.
1827 2007-06-12 Anders Carlsson <andersca@apple.com>
1831 * bindings/qt/qt_instance.cpp:
1832 (KJS::Bindings::QtInstance::invokeMethod):
1834 2007-06-12 Anders Carlsson <andersca@apple.com>
1838 Move the notion of field type to the JNI runtime since that's the only
1839 one that was actually using it.
1841 * bindings/c/c_runtime.h:
1842 (KJS::Bindings::CField::CField):
1843 * bindings/jni/jni_runtime.h:
1844 * bindings/objc/objc_runtime.h:
1845 * bindings/objc/objc_runtime.mm:
1846 * bindings/qt/qt_runtime.h:
1847 * bindings/runtime.h:
1848 * bindings/runtime_method.cpp:
1850 2007-06-12 Anders Carlsson <andersca@apple.com>
1854 * bindings/qt/qt_class.cpp:
1855 (KJS::Bindings::QtClass::methodsNamed):
1856 * bindings/qt/qt_instance.cpp:
1857 (KJS::Bindings::QtInstance::invokeMethod):
1859 2007-06-12 Anders Carlsson <andersca@apple.com>
1863 Get rid of the MethodList class and use a good ol' Vector instead.
1865 * bindings/c/c_class.cpp:
1866 (KJS::Bindings::CClass::methodsNamed):
1867 * bindings/c/c_instance.cpp:
1868 (KJS::Bindings::CInstance::invokeMethod):
1869 * bindings/jni/jni_class.cpp:
1870 (JavaClass::JavaClass):
1871 (JavaClass::~JavaClass):
1872 * bindings/jni/jni_instance.cpp:
1873 (JavaInstance::invokeMethod):
1874 * bindings/objc/objc_class.mm:
1875 (KJS::Bindings::ObjcClass::methodsNamed):
1876 * bindings/objc/objc_instance.mm:
1877 (ObjcInstance::invokeMethod):
1878 * bindings/objc/objc_runtime.mm:
1879 (ObjcFallbackObjectImp::callAsFunction):
1880 * bindings/runtime.cpp:
1881 * bindings/runtime.h:
1882 * bindings/runtime_method.cpp:
1883 (RuntimeMethod::lengthGetter):
1884 (RuntimeMethod::callAsFunction):
1885 * bindings/runtime_object.cpp:
1886 (RuntimeObjectImp::getOwnPropertySlot):
1888 2007-06-12 Anders Carlsson <andersca@apple.com>
1892 Make RuntimeMethod's method list a pointer so that the object size doesn't
1893 grow beyond 32 bytes when we later will replace MethodList with a Vector.
1895 * bindings/runtime_method.cpp:
1896 (RuntimeMethod::RuntimeMethod):
1897 (RuntimeMethod::lengthGetter):
1898 (RuntimeMethod::callAsFunction):
1899 * bindings/runtime_method.h:
1901 2007-06-12 Anders Carlsson <andersca@apple.com>
1905 Get rid of the Parameter class.
1907 * bindings/jni/jni_instance.cpp:
1908 (JavaInstance::invokeMethod):
1909 * bindings/jni/jni_runtime.cpp:
1910 (JavaMethod::signature):
1911 * bindings/jni/jni_runtime.h:
1912 (KJS::Bindings::JavaParameter::JavaParameter):
1913 (KJS::Bindings::JavaParameter::~JavaParameter):
1914 (KJS::Bindings::JavaParameter::type):
1915 (KJS::Bindings::JavaMethod::parameterAt):
1916 (KJS::Bindings::JavaMethod::numParameters):
1917 * bindings/runtime.h:
1919 2007-06-12 Anders Carlsson <andersca@apple.com>
1923 * bindings/qt/qt_class.h:
1925 2007-06-12 Mark Rowe <mrowe@apple.com>
1929 * bindings/objc/objc_runtime.h:
1931 2007-06-12 Anders Carlsson <andersca@apple.com>
1935 Get rid of Constructor and its only subclass JavaConstructor.
1937 * bindings/c/c_class.h:
1938 * bindings/jni/jni_class.cpp:
1939 (JavaClass::JavaClass):
1940 (JavaClass::~JavaClass):
1941 * bindings/jni/jni_class.h:
1942 * bindings/jni/jni_runtime.cpp:
1943 * bindings/jni/jni_runtime.h:
1944 * bindings/objc/objc_class.h:
1945 * bindings/runtime.h:
1947 2007-06-12 Anders Carlsson <andersca@apple.com>
1951 Use RetainPtr throughout the bindings code.
1953 * bindings/objc/objc_class.h:
1954 * bindings/objc/objc_class.mm:
1955 (KJS::Bindings::ObjcClass::ObjcClass):
1956 (KJS::Bindings::ObjcClass::methodsNamed):
1957 (KJS::Bindings::ObjcClass::fieldNamed):
1958 * bindings/objc/objc_instance.h:
1959 (KJS::Bindings::ObjcInstance::getObject):
1960 * bindings/objc/objc_instance.mm:
1961 (ObjcInstance::ObjcInstance):
1962 (ObjcInstance::~ObjcInstance):
1963 (ObjcInstance::implementsCall):
1964 (ObjcInstance::invokeMethod):
1965 (ObjcInstance::invokeDefaultMethod):
1966 (ObjcInstance::defaultValue):
1967 * bindings/objc/objc_runtime.h:
1968 (KJS::Bindings::ObjcMethod::setJavaScriptName):
1969 (KJS::Bindings::ObjcMethod::javaScriptName):
1970 (KJS::Bindings::ObjcArray::getObjcArray):
1971 * bindings/objc/objc_runtime.mm:
1973 (ObjcArray::ObjcArray):
1974 (ObjcArray::setValueAt):
1975 (ObjcArray::valueAt):
1976 (ObjcArray::getLength):
1979 2007-06-12 Anders Carlsson <andersca@apple.com>
1983 Have JSCell inherit from Noncopyable.
1985 * bindings/objc/objc_runtime.h:
1986 * bindings/runtime_object.h:
1989 2007-06-12 Anders Carlsson <andersca@apple.com>
1991 Reviewed by Darin and Maciej.
1993 More cleanup. Use our Noncopyable WTF class, add a root object member
1996 * bindings/c/c_class.h:
1997 * bindings/jni/jni_class.h:
1998 * bindings/jni/jni_instance.h:
1999 * bindings/jni/jni_runtime.cpp:
2000 (JavaArray::JavaArray):
2001 * bindings/jni/jni_runtime.h:
2002 * bindings/objc/objc_class.h:
2003 * bindings/objc/objc_runtime.h:
2004 * bindings/objc/objc_runtime.mm:
2005 (ObjcArray::ObjcArray):
2006 * bindings/objc/objc_utility.mm:
2007 (KJS::Bindings::convertObjcValueToValue):
2008 * bindings/runtime.cpp:
2009 (KJS::Bindings::Array::Array):
2010 (KJS::Bindings::Array::~Array):
2011 * bindings/runtime.h:
2012 * bindings/runtime_object.h:
2013 * bindings/runtime_root.h:
2015 2007-06-08 Zack Rusin <zrusin@trolltech.com>
2019 * bindings/qt/qt_instance.cpp:
2020 (KJS::Bindings::QtInstance::QtInstance):
2021 * bindings/qt/qt_instance.h:
2023 2007-06-07 Anders Carlsson <andersca@apple.com>
2027 Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.
2029 * bindings/c/c_instance.cpp:
2030 (KJS::Bindings::CInstance::CInstance):
2031 * bindings/c/c_instance.h:
2032 * bindings/jni/jni_instance.cpp:
2033 (JavaInstance::JavaInstance):
2034 * bindings/jni/jni_instance.h:
2035 * bindings/jni/jni_jsobject.cpp:
2036 (JavaJSObject::convertJObjectToValue):
2037 * bindings/objc/objc_instance.h:
2038 * bindings/objc/objc_instance.mm:
2039 (ObjcInstance::ObjcInstance):
2040 * bindings/runtime.cpp:
2041 (KJS::Bindings::Instance::Instance):
2042 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2043 * bindings/runtime.h:
2045 2007-06-07 Anders Carlsson <andersca@apple.com>
2049 Don't use a JavaInstance to store the field when all we want to do is to keep the field
2050 from being garbage collected. Instead, use a JObjectWrapper.
2052 * bindings/jni/jni_instance.h:
2053 * bindings/jni/jni_runtime.cpp:
2054 (JavaField::JavaField):
2055 (JavaField::dispatchValueFromInstance):
2056 (JavaField::dispatchSetValueToInstance):
2057 * bindings/jni/jni_runtime.h:
2058 (KJS::Bindings::JavaField::JavaField):
2059 (KJS::Bindings::JavaField::operator=):
2061 2007-05-30 Alp Toker <alp.toker@collabora.co.uk>
2065 Enable logging in the Gdk port.
2066 http://bugs.webkit.org/show_bug.cgi?id=13936
2068 * wtf/Assertions.cpp:
2069 * wtf/Assertions.h: Add WTFLogVerbose which also logs
2070 the file, line number and function.
2072 2007-05-30 Mark Rowe <mrowe@apple.com>
2074 Mac build fix. Update #include.
2076 * API/JSCallbackFunction.h:
2078 2007-05-30 Luciano Montanaro <mikelima@cirulla.net>
2082 - cross-port Harri Porten's commits 636099 and 636108 from KJS:
2083 "publish a class anyway public already" and "class is being used from
2084 outside for quite some time" in preparation for further syncronizations
2087 * kjs/date_object.cpp:
2088 * kjs/date_object.h:
2091 (KJS::InternalFunctionImp::classInfo):
2092 (KJS::InternalFunctionImp::functionName):
2093 * kjs/function_object.h:
2096 (KJS::getStaticPropertySlot):
2097 (KJS::getStaticFunctionSlot):
2098 (KJS::getStaticValueSlot):
2099 * kjs/object_object.h:
2101 2007-05-29 Sam Weinig <sam@webkit.org>
2103 Reviewed by Adam Roben.
2105 Cleanup function and fix to match comparison API.
2107 * kjs/string_object.cpp:
2108 (KJS::substituteBackreferences):
2109 (KJS::localeCompare):
2111 2007-05-28 Geoffrey Garen <ggaren@apple.com>
2113 Slight clarification to an exception message.
2115 * API/JSCallbackObject.cpp:
2116 (KJS::JSCallbackObject::put):
2118 2007-05-27 Holger Freyther <zecke@selfish.org>
2120 Reviewed by Mark Rowe.
2122 * wtf/Platform.h: Move Gdk up to allow building WebKit/Gdk on Darwin
2124 2007-05-27 Darin Adler <darin@apple.com>
2126 - fix a couple ifdefs that said WIN instead of WIN_OS
2128 * kjs/collector.cpp:
2129 (KJS::allocateBlock): WIN -> WIN_OS
2130 (KJS::freeBlock): Ditto.
2132 2007-05-26 Sam Weinig <sam@webkit.org>
2136 Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
2137 Port of commit 667785 from kjs
2139 - special case calling String.localeCompare() with no parameters to return 0.
2141 * kjs/string_object.cpp:
2142 (KJS::StringProtoFunc::callAsFunction):
2144 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
2148 - Fix for http://bugs.webkit.org/show_bug.cgi?id=13456
2149 REGRESSION: setTimeout "arguments" object gets shadowed by a local variable
2151 - Add a explicit check for arguments. Previously check was done with getDirect,
2152 but since the arguments is created on-demand in ActivationImp, it doesn't
2153 show up in the test. 'arguments' should always be in the VarDeclNode's
2157 (VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'
2159 2007-05-25 George Staikos <staikos@kde.org>
2163 - Use COMPILER(GCC), not PLATFORM(GCC) - as Platform.h defines
2167 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
2171 - http://bugs.webkit.org/show_bug.cgi?id=13623 (Decompilation of function
2172 doesn't compile with "++(x,y)")
2173 - Create the error node based on the actual node, not the node inside
2175 - Fix applies to postfix, prefix and typeof operators
2176 - Produces run-time ReferenceError like other non-lvalue assignments etc.
2178 * kjs/grammar.y: Create {Prefix,Postfix}ErrorNode based on the actual node,
2179 not the based on the node returned by "nodeInsideAllParens()". Same for
2182 2007-05-25 Simon Hausmann <hausmann@kde.org>
2186 Fix crash in Qt JavaScript bindings when the arguments used on the Qt side are not
2187 registered with QMetaType.
2189 * bindings/qt/qt_instance.cpp:
2190 (KJS::Bindings::QtInstance::invokeMethod):
2191 * bindings/qt/qt_runtime.cpp:
2193 2007-05-24 Luciano Montanaro <mikelima@cirulla.net>
2197 Patch for http://bugs.webkit.org/show_bug.cgi?id=13855
2198 Port patch 666176 to JavaScriptCore
2200 - Renamed JSValue::downcast() to JSValue::asCell() which makes the
2201 function meaning cleaner. It's modeled after Harri Porten change in
2204 * kjs/collector.cpp:
2205 (KJS::Collector::protect):
2206 (KJS::Collector::unprotect):
2207 (KJS::Collector::collectOnMainThreadOnly):
2209 (KJS::JSValue::isObject):
2210 * kjs/string_object.cpp:
2211 (KJS::StringProtoFunc::callAsFunction):
2213 (KJS::JSValue::asCell):
2214 (KJS::JSValue::isNumber):
2215 (KJS::JSValue::isString):
2216 (KJS::JSValue::isObject):
2217 (KJS::JSValue::getNumber):
2218 (KJS::JSValue::getString):
2219 (KJS::JSValue::getObject):
2220 (KJS::JSValue::getUInt32):
2221 (KJS::JSValue::mark):
2222 (KJS::JSValue::marked):
2223 (KJS::JSValue::type):
2224 (KJS::JSValue::toPrimitive):
2225 (KJS::JSValue::toBoolean):
2226 (KJS::JSValue::toNumber):
2227 (KJS::JSValue::toString):
2228 (KJS::JSValue::toObject):
2230 2007-05-18 Holger Hans Peter Freyther <zecke@selfish.org>
2232 Reviewed by Mark Rowe.
2234 * kjs/testkjs.pro: Make the Gdk port link to icu
2236 2007-05-15 Geoffrey Garen <ggaren@apple.com>
2238 Reviewed by Adele Peterson.
2240 It helps if you swap the right variable.
2245 2007-05-15 Lars Knoll <lars@trolltech.com>
2249 Extend the QObject JavaScript bindings to work for slots with
2252 * bindings/qt/qt_instance.cpp:
2253 (KJS::Bindings::QtInstance::invokeMethod):
2255 2007-05-14 Kimmo Kinnunen <kimmok@iki.fi>
2259 - Fixes http://bugs.webkit.org/show_bug.cgi?id=13622 (Decompiler
2260 omits trailing comma in array literal)
2262 * kjs/nodes2string.cpp:
2263 (ArrayNode::streamTo): print extra ',' in case there was elision
2264 commas (check opt member var) and array elements present
2265 in the array expression
2267 2007-05-14 Geoffrey Garen <ggaren@apple.com>
2269 Reviewed by Oliver Hunt.
2271 Added HashMap::swap and HashSet::swap. WebCore now uses HashSet::swap.
2272 I figured while I was in the neighborhood I might as well add HashMap::swap,
2282 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
2286 - Fix for bug http://bugs.webkit.org/show_bug.cgi?id=13620
2287 Bogus decompilation of "for (var j = 1 in [])"
2288 - ForInNode toString()'ed to syntax error if there was var decl
2290 - ForNode toStringed()'ed lost 'var ' if it was present
2292 * kjs/nodes2string.cpp:
2293 (VarDeclListNode::streamTo): Print "var " here
2294 (VarStatementNode::streamTo): Don't print "var " here
2295 (ForNode::streamTo): Remove TODO comment, VarDeclListNode will
2297 (ForInNode::streamTo): ForIn initializer is printed by VarDeclNode
2299 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
2303 - Fixes http://bugs.webkit.org/show_bug.cgi?id=10878
2304 (Incorrect decompilation for "4..x")
2305 - Group numbers in dotted expressions in toString() output, so we
2306 avoid the 4.x constructs when the original input is 4..x.
2307 4..x means the same as 4. .x or (4).x or Number(4).x
2309 * kjs/nodes2string.cpp:
2310 (KJS::SourceStream::):
2311 Add boolean flag to indicate that if next item is a number, it should be grouped.
2312 Add new formatting enum which turns on the boolean flag.
2313 (KJS::SourceStream::SourceStream): Added. Initialize the flag.
2314 (SourceStream::operator<<): Added. New overloaded operator with double value as parameter.
2315 (NumberNode::streamTo): Use the double operator
2316 (ArrayNode::streamTo):
2317 (DotAccessorNode::streamTo):
2318 (FunctionCallDotNode::streamTo):
2319 (FunctionCallParenDotNode::streamTo):
2320 (PostfixDotNode::streamTo):
2321 (DeleteDotNode::streamTo):
2322 (PrefixDotNode::streamTo):
2323 (AssignDotNode::streamTo): Use the new formatting enum to turn on the grouping flag.
2325 2007-05-10 Lars Knoll <lars@trolltech.com>
2329 Fix our last three test failures in the JavaScript
2332 * wtf/unicode/qt4/UnicodeQt4.h:
2333 (WTF::Unicode::toLower):
2334 (WTF::Unicode::toUpper):
2336 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2338 Reviewed by Darin Adler.
2340 Fixed #includes of JSStringRefCF.h and use of CF datatypes. I think I
2341 misunderstood this issue before.
2343 * API/JavaScriptCore.h: #include JSStringRefCF.h. Platforms that don't
2344 want this behavior can just #include individual headers, instead of the
2345 umbrella framework header. But we definitely want Mac OS X clients to
2346 get the #include of JSStringRefCF.h "for free."
2347 * API/minidom.c: Don't #include JSStringRefCF.h. (Don't need to #include
2348 JavaScriptCore.h, either.)
2349 * API/testapi.c: Don't #include JSStringRefCF.h. Do use CF datatypes
2350 regardless of whether __APPLE__ is defined. Platforms that don't support
2351 CF just shouldn't compile this file.
2354 2007-05-09 Eric Seidel <eric@webkit.org>
2358 http://bugs.webkit.org/show_bug.cgi?id=6985
2359 Cyclic __proto__ values cause WebKit to hang
2362 (KJS::JSObject::put): do a cycle check before setting __proto__
2364 2007-05-08 Kimmo Kinnunen <kimmok@iki.fi>
2366 Reviewed by darin. Landed by eseidel.
2368 - http://bugs.webkit.org/show_bug.cgi?id=10880 (Do..while loop gains
2369 a semicolon each time it is toStringed)
2370 Grammar in Ecma-66262, 12.6: "do Statement while ( Expression );"
2371 EmptyStatement was created after every do..while(expr) which
2372 had semicolon at the end.
2374 * kjs/grammar.y: Require semicolon at the end of do..while
2376 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2378 Build fix -- this time for sure.
2380 APICast.h, being private, ends up in a different folder than JSValueRef.h,
2381 so we can't include one from the other using "". Instead, just forward
2382 declare the relevant data types.
2386 2007-05-08 Geoffrey Garen <ggaren@apple.com>
2388 Build fix: export APICast.h for WebCore and WebKit.
2390 * JavaScriptCore.xcodeproj/project.pbxproj:
2392 2007-05-04 Darin Adler <darin@apple.com>
2396 - fix http://bugs.webkit.org/show_bug.cgi?id=12821
2397 <rdar://problem/5007921> Number.toExponential doesn't work for negative numbers
2399 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2400 Added a call to fabs before calling log10.
2402 2007-05-03 Holger Freyther <freyther@kde.org>
2404 Reviewed by Zack, landed by Simon.
2405 This is bugzilla bug 13499.
2407 * JavaScriptCore.pri: Place Qt into the qt-port scope
2408 * bindings/testbindings.pro: Place Qt into the qt-port scope
2409 * kjs/testkjs.pro: Place Qt into the qt-port scope
2410 * pcre/pcre.pri: Place Qt into the qt-port scope
2412 2007-05-02 David Harrison <harrison@apple.com>
2416 <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
2418 Added insertion support for more than one value.
2422 Added support for inserting multiple values.
2425 New. Insert at the start of vectors. Convenient for vectors used as strings.
2427 2007-05-01 Jungshik Shin <jungshik.shin@gmail.com>
2431 - get rid of non-ASCII lteral characters : suppress compiler warnings
2432 http://bugs.webkit.org/show_bug.cgi?id=13551
2435 * pcre/pcre_compile.c:
2437 2007-04-28 Jungshik Shin <jungshik.shin@gmail.com>
2439 Reviewed by Sam Weinig.
2441 - Replace copyright sign in Latin-1 (0xA9) with '(C)'
2442 http://bugs.webkit.org/show_bug.cgi?id=13531
2444 * bindings/npruntime.h:
2446 2007-04-28 Darin Adler <darin@apple.com>
2450 - fix <rdar://problem/5154144> Hamachi test fails: assertion failure in ListHashSet
2452 Test: fast/forms/add-remove-form-elements-stress-test.html
2454 * wtf/ListHashSet.h:
2455 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Initialize
2456 m_isDoneWithInitialFreeList to false.
2457 (WTF::ListHashSetNodeAllocator::allocate): Added assertions based on a debug-only
2458 m_isAllocated flag that make sure we don't allocate a block that's already allocated.
2459 These assertions helped pinpoint the bug. Set m_isDoneWithInitialFreeList when we
2460 allocate the last block of the initial free list. Once we're done with the initial
2461 free list, turn off the rule that says that the next node in the pool after the last
2462 node in the free list is also free. This rule works because any free nodes are added
2463 to the head of the free list, so a node that hasn't been allocated even once is always
2464 at the tail of the free list and all the nodes after it also haven't been allocated
2465 even once. But it doesn't work any longer once the entire pool has been used at least
2466 once, because there's nothing special about the last node on the free list any more.
2467 (WTF::ListHashSetNodeAllocator::deallocate): Set the node's m_isAllocated to false.
2468 (WTF::ListHashSetNodeAllocator::pastPool): Added. Used above.
2469 (WTF::ListHashSetNodeAllocator::inPool): Changed to use the pastPool function.
2470 (WTF::ListHashSetNode::ListHashSetNode): Initialize m_isAllocated to true.
2471 (WTF::ListHashSetNode::operator new): Removed variable name for unused size
2473 (WTF::ListHashSetNode::destroy): Changed to call the destructor rather than
2474 delete -- this gets rid of the need to define an operator delete.
2476 2007-04-27 Christopher Brichford <chrisb@adobe.com>
2478 Reviewed by Timothy Hatcher.
2480 Fix for: Bug 13211: Move JavaScriptCore mac project files for apollo port
2481 http://bugs.webkit.org/show_bug.cgi?id=13211
2483 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Debug.xcconfig: Added.
2484 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Release.xcconfig: Added.
2485 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcconfig: Added.
2486 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcodeproj/project.pbxproj: Added.
2487 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Removed.
2488 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Removed.
2489 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Removed.
2490 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Removed.
2492 2007-04-27 Holger Freyther <freyther@kde.org>
2496 Remove unmaintained CMake build system.
2498 * CMakeLists.txt: Removed.
2499 * pcre/CMakeLists.txt: Removed.
2501 2007-04-27 Mark Rowe <mrowe@apple.com>
2505 * JavaScriptCore.xcodeproj/project.pbxproj: Improve dependencies in Xcode project
2506 by marking dftables as a dependency of Generate Derived Sources rather than of
2507 JavaScriptCore itself.
2509 2007-04-26 Geoffrey Garen <ggaren@apple.com>
2511 Build fix -- added #includes that we used to get implicitly through
2519 2007-04-26 Geoffrey Garen <ggaren@apple.com>
2521 Reviewed by Maciej Stachowiak, Adam Roben.
2524 <rdar://problem/4885130> Remove #include of JSStringRefCF.h from JSStringRef.h
2525 <rdar://problem/4885123> JavaScriptCore is not cross-platform -- JSStringRef.h references CF datatypes
2527 * API/JSStringRef.h: Removed #include -- no clients need it anymore.
2529 2007-04-25 David Kilzer <ddkilzer@apple.com>
2533 Add assertions for debug builds.
2536 (KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
2537 (KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.
2539 2007-04-25 Maciej Stachowiak <mjs@apple.com>
2543 - fix build problems
2545 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable warning that
2546 gives often downright incorrect results based on guessing what will happen in 64-bit.
2548 2007-04-25 Darin Adler <darin@apple.com>
2552 - tweak the allocator for a small speedup -- Shark showed this was a win, but I can't
2553 measure an improvement right now, but it's also clear these changes do no harm
2555 * wtf/FastMalloc.cpp:
2556 (WTF::LgFloor): Use ALWAYS_INLINE here; in testing I did a while back this was necessary
2557 to get this single-instruction function to be inlined.
2558 (WTF::SizeClass): Use ALWAYS_INLINE here too for the same reason. Also change the special
2559 case for a size of 0 to work without a branch for a bit of extra speed.
2560 (WTF::ByteSizeForClass): Use ALWAYS_INLINE here too for the same reason.
2562 2007-04-24 Maciej Stachowiak <mjs@apple.com>
2566 - use custom calling convention for everything in nodes.cpp on intel gcc for 1.5% speed boost
2568 Nearly all functions in nodes.cpp were marked up to use the
2569 regparm(3) calling convention under GCC for x86, since this is
2570 faster and they are all guaranteed to be called only internally to
2573 The only exception is destructors, since delete doesn't know how to use a custom calling convention.
2576 (dotExprDoesNotAllowCallsString):
2579 (KJS::StatementNode::):
2581 (KJS::BooleanNode::):
2582 (KJS::NumberNode::):
2583 (KJS::StringNode::):
2584 (KJS::RegExpNode::):
2586 (KJS::ResolveNode::):
2588 (KJS::ElementNode::):
2590 (KJS::PropertyNameNode::):
2591 (KJS::PropertyNode::):
2592 (KJS::PropertyListNode::):
2593 (KJS::ObjectLiteralNode::):
2594 (KJS::BracketAccessorNode::):
2595 (KJS::DotAccessorNode::):
2596 (KJS::ArgumentListNode::):
2597 (KJS::ArgumentsNode::):
2598 (KJS::NewExprNode::):
2599 (KJS::FunctionCallValueNode::):
2600 (KJS::FunctionCallResolveNode::):
2601 (KJS::FunctionCallBracketNode::):
2602 (KJS::FunctionCallParenBracketNode::):
2603 (KJS::FunctionCallDotNode::):
2604 (KJS::FunctionCallParenDotNode::):
2605 (KJS::PostfixResolveNode::):
2606 (KJS::PostfixBracketNode::):
2607 (KJS::PostfixDotNode::):
2608 (KJS::PostfixErrorNode::):
2609 (KJS::DeleteResolveNode::):
2610 (KJS::DeleteBracketNode::):
2611 (KJS::DeleteDotNode::):
2612 (KJS::DeleteValueNode::):
2614 (KJS::TypeOfResolveNode::):
2615 (KJS::TypeOfValueNode::):
2616 (KJS::PrefixResolveNode::):
2617 (KJS::PrefixBracketNode::):
2618 (KJS::PrefixDotNode::):
2619 (KJS::PrefixErrorNode::):
2620 (KJS::UnaryPlusNode::):
2621 (KJS::NegateNode::):
2622 (KJS::BitwiseNotNode::):
2623 (KJS::LogicalNotNode::):
2627 (KJS::RelationalNode::):
2629 (KJS::BitOperNode::):
2630 (KJS::BinaryLogicalNode::):
2631 (KJS::ConditionalNode::):
2632 (KJS::AssignResolveNode::):
2633 (KJS::AssignBracketNode::):
2634 (KJS::AssignDotNode::):
2635 (KJS::AssignErrorNode::):
2637 (KJS::AssignExprNode::):
2638 (KJS::VarDeclListNode::):
2639 (KJS::VarStatementNode::):
2640 (KJS::EmptyStatementNode::):
2641 (KJS::ExprStatementNode::):
2643 (KJS::DoWhileNode::):
2646 (KJS::ContinueNode::):
2648 (KJS::ReturnNode::):
2653 (KJS::ParameterNode::):
2655 (KJS::FunctionBodyNode::):
2656 (KJS::FuncExprNode::):
2657 (KJS::FuncDeclNode::):
2658 (KJS::SourceElementsNode::):
2659 (KJS::CaseClauseNode::):
2660 (KJS::ClauseListNode::):
2661 (KJS::SwitchNode::):
2663 2007-04-24 Oliver Hunt <oliver@apple.com>
2665 GTK Build fix, ::findEntry->KJS::findEntry
2668 (KJS::Lookup::findEntry):
2669 (KJS::Lookup::find):
2671 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2675 - compile most of JavaScriptCore as one file for 4% JS iBench speed improvement
2677 * JavaScriptCore.xcodeproj/project.pbxproj: Add AllInOneFile.cpp, and remove files it includes
2679 * kjs/AllInOneFile.cpp: Added.
2680 * kjs/dtoa.cpp: Renamed CONST to CONST_ to avoid conflict.
2682 (Bigint::nrv_alloc):
2683 * kjs/lookup.cpp: Use "namspace KJS { ... }" instead of "using namespace KJS;"
2685 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2687 Build fix, not reviewed.
2689 * kjs/collector.h: Fix struct/class mismatch.
2691 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2695 - raise ALLOCATIONS_PER_COLLECTION to 4000, for 3.7% iBench speed improvement
2697 Now that the cell size is smaller and the block size is bigger, we can fit 4000 objects in
2698 the two spare cells the collector is willing to keep around, so collect a bit less often.
2700 * kjs/collector.cpp:
2702 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2704 Reviewed by Darin and Geoff.
2706 - move mark and collectOnMainThreadOnly bits into separate bitmaps
2708 This saves 4 bytes per cell, allowing shrink of cell size to 32,
2709 which leads to a .8% speed improvement on iBench.
2711 This is only feasible because of all the previous changes on the branch.
2713 * kjs/collector.cpp:
2714 (KJS::allocateBlock): Adjust for some renames of constants.
2715 (KJS::Collector::markStackObjectsConservatively): Now that cells are 32 bytes (64
2716 bytes on 64-bit) the cell alignment check can be made much more strict, and also
2717 obsoletes the need for a % sizeof(CollectorCell) check. Also, we can mask off the low
2718 bits of the pointer to have a potential block pointer to look for.
2719 (KJS::Collector::collectOnMainThreadOnly): Use bitmap.
2720 (KJS::Collector::markMainThreadOnlyObjects): Use bitmap.
2721 (KJS::Collector::collect): When sweeping, use bitmaps directly to find mark bits.
2723 (KJS::): Move needed constants and type declarations here.
2724 (KJS::CollectorBitmap::get): Bit twiddling to get a bitmap value.
2725 (KJS::CollectorBitmap::set): Bit twiddling to set a bitmap bit to true.
2726 (KJS::CollectorBitmap::clear): Bit twiddling to set a bitmap bit to false.
2727 (KJS::CollectorBitmap::clearAll): Clear whole bitmap at one go.
2728 (KJS::Collector::cellBlock): New operation, compute the block pointer for
2729 a cell by masking off low bits.
2730 (KJS::Collector::cellOffset): New operation, compute the cell offset for a
2731 cell by masking off high bits and dividing (actually a shift).
2732 (KJS::Collector::isCellMarked): Check mark bit in bitmap
2733 (KJS::Collector::markCell): Set mark bit in bitmap.
2735 (KJS::JSCell::JSCell): No more bits.
2736 (KJS::JSCell::marked): Let collector handle it.
2737 (KJS::JSCell::mark): Let collector handle it.
2739 2007-04-23 Anders Carlsson <andersca@apple.com>
2743 * kjs/regexp_object.h:
2744 RegExpObjectImpPrivate is a struct, not a class.
2746 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2750 - shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body
2752 I reconciled this with a similar change in KDE kjs by Maks Orlovich <maksim@kde.org>.
2755 (KJS::FunctionImp::callAsFunction):
2756 (KJS::FunctionImp::passInParameters):
2757 (KJS::FunctionImp::lengthGetter):
2758 (KJS::FunctionImp::getParameterName):
2760 * kjs/function_object.cpp:
2761 (FunctionProtoFunc::callAsFunction):
2762 (FunctionObjectImp::construct):
2764 (FunctionBodyNode::addParam):
2765 (FunctionBodyNode::paramString):
2766 (FuncDeclNode::addParams):
2767 (FuncDeclNode::processFuncDecl):
2768 (FuncExprNode::addParams):
2769 (FuncExprNode::evaluate):
2771 (KJS::Parameter::Parameter):
2772 (KJS::FunctionBodyNode::numParams):
2773 (KJS::FunctionBodyNode::paramName):
2774 (KJS::FunctionBodyNode::parameters):
2775 (KJS::FuncExprNode::FuncExprNode):
2776 (KJS::FuncDeclNode::FuncDeclNode):
2777 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because
2778 they handle size_t badly.
2780 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2784 - shrink RegexpObjectImp by 4 bytes
2786 Somewhat inexplicably, this seems to be a .33% speedup on JS iBench.
2788 * kjs/regexp_object.cpp:
2789 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate):
2790 (RegExpObjectImp::RegExpObjectImp):
2791 (RegExpObjectImp::performMatch):
2792 (RegExpObjectImp::arrayOfMatches):
2793 (RegExpObjectImp::getBackref):
2794 (RegExpObjectImp::getLastMatch):
2795 (RegExpObjectImp::getLastParen):
2796 (RegExpObjectImp::getLeftContext):
2797 (RegExpObjectImp::getRightContext):
2798 (RegExpObjectImp::getValueProperty):
2799 (RegExpObjectImp::putValueProperty):
2800 * kjs/regexp_object.h:
2802 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2806 - change to 1-bit bitfields instead of 8-bit, this turns out to lead to a .51% speedup on JS iBench
2808 The 1-bit bitfields are actually faster than just plain bools, at least on Intel (go figure).
2810 * kjs/property_map.h:
2812 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2816 - shrink ArrayInstance objects by 4 bytes
2817 http://bugs.webkit.org/show_bug.cgi?id=13386
2819 I did this by storing the capacity before the beginning of the storage array. It turns out
2820 it is rarely needed and is by definition 0 when the storage array is null.
2822 * kjs/array_instance.h:
2823 (KJS::ArrayInstance::capacity): Get it from the secret stash
2824 * kjs/array_object.cpp:
2825 (allocateStorage): New function to encapsulate allocating the storage with extra space ahead
2827 (reallocateStorage): ditto for realloc
2828 (ArrayInstance::ArrayInstance):
2829 (ArrayInstance::~ArrayInstance):
2830 (ArrayInstance::resizeStorage):
2832 2007-04-23 Darin Adler <darin@apple.com>
2836 - fix <rdar://problem/4840688> REGRESSION (r10588, r10621): JavaScript won't parse
2837 modifications of non-references (breaks 300themovie.warnerbros.com, fedex.com)
2839 Despite the ECMAScript specification's claim that you can treat these as syntax
2840 errors, doing so creates some website incompatibilities. So this patch turns them back
2841 into evaluation errors instead.
2843 Test: fast/js/modify-non-references.html
2845 * kjs/grammar.y: Change makeAssignNode, makePrefixNode, and makePostfixNode so that they
2846 never fail to parse. Update rules that use them. Fix a little bit of indenting. Use
2847 new PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2849 * kjs/nodes.h: Added an overload of throwError that takes a char* argument.
2850 Replaced setExceptionDetailsIfNeeded and debugExceptionIfNeeded with handleException,
2851 which does both. Added PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2853 * kjs/nodes.cpp: Changed exception macros to use handleException; simpler and smaller
2854 code size than the two functions that we used before.
2855 (Node::throwError): Added the overload mentioned above.
2856 (Node::handleException): Added. Contains the code from both setExceptionDetailsIfNeeded
2857 and debugExceptionIfNeeded.
2858 (PostfixErrorNode::evaluate): Added. Throws an exception.
2859 (PrefixErrorNode::evaluate): Ditto.
2860 (AssignErrorNode::evaluate): Ditto.
2861 (ThrowNode::execute): Call handleException instead of debugExceptionIfNeeded; this
2862 effectively adds a call to setExceptionDetailsIfNeeded, which may help with getting
2863 the correct file and line number for these exceptions.
2865 * kjs/nodes2string.cpp:
2866 (PostfixErrorNode::streamTo): Added.
2867 (PrefixErrorNode::streamTo): Added.
2868 (AssignErrorNode::streamTo): Added.
2870 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2874 - fix test failures / crashes on PPC
2876 * kjs/property_map.h: Make the bool fields explicitly 8-bit bitfields, since bool is a full
2877 word there otherwise :-(
2879 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2883 - fix more test case failures
2885 * bindings/runtime_array.cpp:
2886 (RuntimeArray::RuntimeArray): inherit from JSObject instead of ArrayInstance; it turns
2887 out that this class only needs the prototype and classInfo from ArrayInstance, not the
2888 actual class itself, and it was too big otherwise.
2889 (RuntimeArray::getOwnPropertySlot):
2890 * bindings/runtime_array.h:
2892 2007-04-23 Maciej Stachowiak <mjs@apple.com>
2896 - fix some test failures
2898 * bindings/runtime_method.cpp:
2899 (RuntimeMethod::RuntimeMethod): inherit from InternalFunctionImp instead of FunctionImpl,
2900 otherwise this is too big
2901 (RuntimeMethod::getOwnPropertySlot):
2902 * bindings/runtime_method.h:
2904 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2908 - discard the arguments List for an ActivationImp when the corresponding Context is destroyed (1.7% speedup)
2909 http://bugs.webkit.org/show_bug.cgi?id=13385
2911 Based an idea by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>. His patch to do
2912 this also had many other List changes and I found this much simpler subset of the changes
2913 was actually a hair faster.
2915 This optimization is valid because the arguments list is only kept around to
2916 lazily make the arguments object. If it's not made by the time the function
2917 exits, it never will be, since any function that captures the continuation will
2918 have its own local arguments variable in scope.
2920 Besides the 1.7% speed improvement, it shrinks List by 4 bytes
2921 (which in turn shrinks ActivationImp by 4 bytes).
2924 (KJS::Context::~Context): Clear the activation's arguments list.
2926 (KJS::ActivationImp::ActivationImp): Adjusted for list changes.
2927 (KJS::ActivationImp::mark): No need to mark, lists are always protected (this doesn't
2928 cause a ref-cycle for reasons stated above).
2929 (KJS::ActivationImp::createArgumentsObject): Clear arguments list.
2932 (KJS::List::List): No more needsMarking boolean
2933 (KJS::List::operator=): ditto
2935 (KJS::List::List): ditto
2936 (KJS::List::reset): ditto
2937 (KJS::List::deref): ditto
2939 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2943 - shrink PropertyMap by 8 bytes and therefore shrink CELL_SIZE to 40 (for 32-bit;
2944 similar shrinkage for 64-bit)
2945 http://bugs.webkit.org/show_bug.cgi?id=13384
2947 Inspired by similar changes by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>
2948 done in the kjs-tweaks branch of KDE's kjs. However, this version is somewhat
2949 cleaner style-wise and avoids some of the negative speed impact (at least on gcc/x86)
2952 This is nearly a wash performance-wise, maybe a slight slowdown, but worth doing
2953 to eventually reach cell size 32.
2955 * kjs/collector.cpp:
2957 * kjs/property_map.cpp:
2958 (KJS::PropertyMap::~PropertyMap):
2959 (KJS::PropertyMap::clear):
2960 (KJS::PropertyMap::get):
2961 (KJS::PropertyMap::getLocation):
2962 (KJS::PropertyMap::put):
2963 (KJS::PropertyMap::insert):
2964 (KJS::PropertyMap::expand):
2965 (KJS::PropertyMap::rehash):
2966 (KJS::PropertyMap::remove):
2967 (KJS::PropertyMap::mark):
2968 (KJS::PropertyMap::containsGettersOrSetters):
2969 (KJS::PropertyMap::getEnumerablePropertyNames):
2970 (KJS::PropertyMap::getSparseArrayPropertyNames):
2971 (KJS::PropertyMap::save):
2972 (KJS::PropertyMap::checkConsistency):
2973 * kjs/property_map.h:
2974 (KJS::PropertyMap::hasGetterSetterProperties):
2975 (KJS::PropertyMap::setHasGetterSetterProperties):
2976 (KJS::PropertyMap::):
2977 (KJS::PropertyMap::PropertyMap):
2979 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2983 - change blocks to 64k in size, and use various platform-specific calls to allocate at 64k-aligned addresses
2984 http://bugs.webkit.org/show_bug.cgi?id=13383
2986 * kjs/collector.cpp:
2987 (KJS::allocateBlock): New function to allocate 64k of 64k-aligned memory
2988 (KJS::freeBlock): Corresponding free
2989 (KJS::Collector::allocate):
2990 (KJS::Collector::collect):
2992 2007-04-22 Maciej Stachowiak <mjs@apple.com>
2994 Reviewed by Darin and Geoff.
2996 - remove the concept of oversize objects, now that there aren't any (for now
2997 only enforced with an assert).
2998 http://bugs.webkit.org/show_bug.cgi?id=13382
3000 This change is a .66% speedup on JS iBench for 32-bit platforms, probably much more
3001 for 64-bit since it finally gives a reasonable cell size, but I did not test that.
3003 * kjs/collector.cpp:
3004 (KJS::): Use different cell size for 32-bit and 64-bit, now that there is no
3005 oversize allocation.
3006 (KJS::Collector::allocate): Remove oversize allocator.
3007 (KJS::Collector::markStackObjectsConservatively): Don't check oversize objects.
3008 (KJS::Collector::markMainThreadOnlyObjects): Ditto.
3009 (KJS::Collector::collect): Ditto.
3011 2007-04-21 Mitz Pettel <mitz@webkit.org>
3015 - fix http://bugs.webkit.org/show_bug.cgi?id=13428
3016 REGRESSION (r20973-r20976): Failing ecma/Array/15.4.4.5-3.js
3018 - fix http://bugs.webkit.org/show_bug.cgi?id=13429
3019 REGRESSION (r20973-r20976): Crashing in fast/dom/plugin-attributes-enumeration.html
3021 * kjs/array_object.cpp:
3022 (ArrayInstance::sort): Free the old storage, not the new one.
3024 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3026 Not reviewed, build fix.
3028 - fix build problem with last change - -O3 complains more about uninitialized variables
3030 * pcre/pcre_compile.c:
3034 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3038 - <rdar://problem/5149915> use mergesort when possible, since it leads to fewer compares (2% JS iBench speedup)
3040 * kjs/array_object.cpp:
3041 (ArrayInstance::sort): Use mergesort(3) on platforms that have it, since it tends
3042 to do fewer compares than qsort; but avoid it very on large arrays since it uses extra
3043 memory. Also added comments identifying possibly even better sorting algorithms
3044 for sort by string value and sort by compare function.
3047 2007-04-20 Maciej Stachowiak <mjs@apple.com>
3051 - bump optimization flags up to -O3 for 1% JS iBench speed improvement
3053 * Configurations/Base.xcconfig:
3055 2007-04-20 Mark Rowe <mrowe@apple.com>
3059 Fix bogus optimisation in the generic pthread code path.
3061 * kjs/collector.cpp:
3062 (KJS::currentThreadStackBase):
3064 2007-04-20 Mark Rowe <mrowe@apple.com>
3068 Improve FreeBSD compatibility, as suggested by Alexander Botero-Lowry.
3070 * kjs/collector.cpp:
3071 (KJS::currentThreadStackBase): FreeBSD requires that pthread_attr_t's are
3072 initialized via pthread_attr_init before being used in any context.
3074 2007-04-19 Mark Rowe <mrowe@apple.com>
3078 Fix http://bugs.webkit.org/show_bug.cgi?id=13401
3079 Bug 13401: Reproducible crash calling myArray.sort(compareFn) from within
3080 a sort comparison function
3082 * kjs/array_object.cpp:
3083 (ArrayInstance::sort): Save/restore the static variables around calls to qsort
3084 to ensure nested calls to ArrayInstance::sort behave correctly.
3086 2007-04-12 Deneb Meketa <dmeketa@adobe.com>
3088 Reviewed by Darin Adler.
3090 http://bugs.webkit.org/show_bug.cgi?id=13029
3091 rdar://problem/4994849
3092 Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
3093 This doesn't actually change JavaScriptCore, but that's where npapi.h is.
3096 Add headers member to NPStream struct. Also increase NP_VERSION_MINOR to 18.
3097 Increasing to >= 17 allows plug-ins to safely detect whether to look for
3098 NPStream::headers. Increasing from 17 to 18 reflects presence of NPObject
3099 enumeration, which was added in a prior patch, and which has been agreed to
3100 constitute version 18 by the plugin-futures list. Also add other missing
3101 bits of npapi.h to catch up from 14 to 18. This includes features that are
3102 not implemented in WebKit, but those are safely stubbed.
3104 2007-04-10 Geoffrey Garen <ggaren@apple.com>
3106 Reviewed by Mark Rowe.
3108 Fixed last check-in to print in release builds, too.
3110 * kjs/collector.cpp:
3111 (KJS::getPlatformThreadRegisters):
3113 2007-04-10 Geoffrey Garen <ggaren@apple.com>
3115 Reviewed by John Sullivan, Darin Adler.
3117 Fixed <rdar://problem/5121899> JavaScript garbage collection leads to
3118 later crash under Rosetta (should abort or leak instead?)
3120 Log an error message and crash if the kernel reports failure during GC.
3121 We decided to do this instead of just leaking because we don't want people
3122 to get the mistaken impression that running in Rosetta is a supported
3125 The CRASH macro will also hook into CrashReporter, which will tell us if
3126 many (any?) users run into this issue.
3128 * kjs/collector.cpp:
3129 (KJS::getPlatformThreadRegisters):
3131 2007-04-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3135 Coverity fix. Coverity says:
3136 "Event var_deref_model: Variable "sourceRanges" tracked as NULL was passed to a
3137 function that dereferences it"
3139 * kjs/string_object.cpp:
3142 2007-04-06 Geoffrey Garen <ggaren@apple.com>
3144 Rubber stamped by Adele Peterson.
3146 * kjs/ExecState.h: Removed obsolete forward/friend declaration of
3149 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3153 Coverity fix. Coverity says:
3154 "Event check_after_deref: Pointer "dateString" dereferenced before NULL check"
3156 * kjs/date_object.cpp:
3159 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3163 Coverity fix. Coverity says:
3164 "Event check_after_deref: Pointer "re" dereferenced before NULL check"
3166 * pcre/pcre_study.c:
3169 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3173 Coverity fixes. Coverity says:
3174 "Event leaked_storage: Returned without freeing storage "buffer""
3176 "Event leaked_storage: Returned without freeing storage "script""
3180 (createStringWithContentsOfFile):
3182 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3186 Coverity fix: in single-threaded case currentThreadIsMainThread is always true
3187 so the code in if (!currentThreadIsMainThread) cannot possibly be reached
3188 and Coverity complains about dead code.
3190 * kjs/collector.cpp:
3191 (KJS::Collector::collect):
3193 === Safari-5522.6 ===
3195 2007-04-03 Kevin McCullough <kmccullough@apple.com>
3199 - Testing a post-commit hook.
3201 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3203 2007-04-03 Anders Carlsson <andersca@apple.com>
3207 <rdar://problem/5107534>
3208 http://bugs.webkit.org/show_bug.cgi?id=13265
3209 REGRESSION: Crash in KJS::Bindings::convertValueToNPVariant
3211 * bindings/NP_jsobject.cpp:
3212 (_NPN_InvokeDefault):
3213 Return false if the object isn't a function. Set the return value to undefined by default
3216 2007-03-30 Anders Carlsson <andersca@apple.com>
3220 * bindings/NP_jsobject.cpp:
3223 2007-03-30 Anders Carlsson <andersca@apple.com>
3227 Implement _NPN_Enumerate support.
3229 * JavaScriptCore.exp:
3230 * bindings/NP_jsobject.cpp:
3232 * bindings/c/c_instance.cpp:
3233 (KJS::Bindings::CInstance::getPropertyNames):
3234 * bindings/c/c_instance.h:
3236 * bindings/npruntime.h:
3237 * bindings/npruntime_impl.h:
3238 * bindings/runtime.h:
3239 (KJS::Bindings::Instance::getPropertyNames):
3240 * bindings/runtime_object.cpp:
3241 (RuntimeObjectImp::getPropertyNames):
3242 * bindings/runtime_object.h:
3243 (KJS::RuntimeObjectImp::getInternalInstance):
3245 2007-03-28 Jeff Walden <jwalden+code@mit.edu>
3249 http://bugs.webkit.org/show_bug.cgi?id=12963
3250 Fix some inconsistencies in the Mozilla JS Array extras implementations
3251 with respect to the Mozilla implementation:
3253 - holes in arrays should be skipped, not treated as undefined,
3255 - an element with value undefined is not a hole
3256 - Array.prototype.forEach should return undefined
3258 * kjs/array_object.cpp:
3259 (ArrayInstance::getOwnPropertySlot):
3260 (ArrayProtoFunc::callAsFunction):
3262 2007-03-27 Anders Carlsson <acarlsson@apple.com>
3266 * bindings/NP_jsobject.cpp:
3267 (_NPN_InvokeDefault):
3268 Call JSObject:call for native JavaScript objects.
3270 2007-03-26 David Carson <dacarson@gmail.com>
3272 Reviewed by Darin, landed by Anders.
3274 Fix for: REGRESSION (r19559): Java applet crash
3275 http://bugs.webkit.org/show_bug.cgi?id=13142
3276 <rdar://problem/5080340>
3278 The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636
3279 introduced new JNIType to enum in jni_utility.h This is a
3280 problem on the Mac as it seems that the JNIType enum is also
3281 used in the JVM, it is used to specify the return type in
3283 Corrected the fix by moving type to the end, and changing
3284 jni_objc.mm to convert the new type to an old compatible
3287 * bindings/jni/jni_objc.mm:
3288 (KJS::Bindings::dispatchJNICall):
3289 * bindings/jni/jni_utility.h:
3291 2007-03-26 Christopher Brichford <chrisb@adobe.com>
3293 Reviewed/landed by Adam.
3295 Bug 13198: Move build settings from project file to xcconfig file for apollo
3297 http://bugs.webkit.org/show_bug.cgi?id=13198
3299 - Moving build settings from xcode project file to xcconfig files.
3301 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig:
3302 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig:
3303 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
3304 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
3306 2007-03-26 Brady Eidson <beidson@apple.com>
3308 Rubberstamped by Anders and Maciej aand Geoff (oh my!)
3310 Since CFTypeRef is really void*, a RetainPtr couldn't be used.
3311 RefType was "void", which doesn't actually exist as a type.
3312 Since RefType only existed for operator*(), and since that operator
3313 doesn't make any sense for RetainPtr, I removed them!
3315 * kjs/nodes.cpp: Touch this to force a rebuild and (hopefully) help the
3316 compiler with dependencies
3317 * wtf/RetainPtr.h: Nuke RefType and operator*()
3319 2007-03-26 Geoffrey Garen <ggaren@apple.com>
3321 Touched a file to (hopefully) help the compiler with RetainPtr dependencies.
3326 2007-03-24 Brady Eidson <beidson@apple.com>
3330 Whoops, RetainPtr should be in the WTF namespace
3334 2007-03-24 Brady Eidson <beidson@apple.com>
3338 <rdar://problem/5086210> - Move RetainPtr to WTF
3340 * wtf/RetainPtr.h: Added
3341 * JavaScriptCore.xcodeproj/project.pbxproj: Add it to the project file
3342 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto
3345 2007-03-23 Christopher Brichford <chrisb@adobe.com>
3347 Reviewed/landed by Adam.
3349 Bug 13175: Make apollo mac project files for JavaScriptCore actually
3351 http://bugs.webkit.org/show_bug.cgi?id=13175
3353 - Changing apollo mac project files for JavaScriptCore such that they actually build
3354 JavaScriptCore source code.
3356 * JavaScriptCore.apolloproj/ForwardingSources/grammar.cpp: Added.
3357 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
3358 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
3360 2007-03-24 Mark Rowe <mrowe@apple.com>
3362 Rubber-stamped by Darin.
3364 * Configurations/JavaScriptCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
3366 2007-03-22 Christopher Brichford <chrisb@adobe.com>
3368 Reviewed/landed by Adam.
3370 Bug 13164: Initial version of mac JavaScriptCore project files for
3372 http://bugs.webkit.org/show_bug.cgi?id=13164
3374 - Adding mac project files for apollo port of JavaScriptCore. Currently project
3375 just builds dftables.
3377 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Added.
3378 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Added.
3379 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Added.
3380 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Added.
3382 2007-03-21 Timothy Hatcher <timothy@apple.com>
3386 <rdar://problem/5076599> JavaScriptCore has a weak export (vtable for KJS::JSCell)
3388 * JavaScriptCore.exp: Remove __ZTVN3KJS6JSCellE.
3390 2007-03-21 Adele Peterson <adele@apple.com>
3394 * API/JSStringRef.cpp: (JSStringIsEqual): Added JSLock.
3396 2007-03-21 Zack Rusin <zrusin@trolltech.com>
3398 Fix the compile when USE(MULTIPLE_THREADS) isn't
3402 (KJS::JSLock::currentThreadIsHoldingLock):
3404 2007-03-20 Maciej Stachowiak <mjs@apple.com>
3406 Reviewed by Geoff and Adam.
3408 - make USE(MULTIPLE_THREADS) support more portable
3409 http://bugs.webkit.org/show_bug.cgi?id=13069
3411 - fixed a threadsafety bug discovered by testing this
3413 - enhanced threadsafety assertions in collector
3415 * API/JSCallbackObject.cpp:
3416 (KJS::JSCallbackObject::~JSCallbackObject): This destructor can't
3417 DropAllLocks around the finalize callback, because it gets called
3418 from garbage collection and we can't let other threads collect!
3420 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3422 (KJS::JSLock::currentThreadIsHoldingLock): Added new function
3423 to allow stronger assertions than just that the lock is held
3424 by some thread (you can now assert that the current thread is
3425 holding it, given the new JSLock design).
3427 * kjs/collector.cpp: Refactored for portability plus added some
3428 stronger assertions.
3429 (KJS::Collector::allocate):
3430 (KJS::currentThreadStackBase):
3431 (KJS::Collector::registerAsMainThread):
3432 (KJS::onMainThread):
3433 (KJS::PlatformThread::PlatformThread):
3434 (KJS::getCurrentPlatformThread):
3435 (KJS::Collector::Thread::Thread):
3436 (KJS::destroyRegisteredThread):
3437 (KJS::Collector::registerThread):
3438 (KJS::Collector::markCurrentThreadConservatively):
3439 (KJS::suspendThread):
3440 (KJS::resumeThread):
3441 (KJS::getPlatformThreadRegisters):
3442 (KJS::otherThreadStackPointer):
3443 (KJS::otherThreadStackBase):
3444 (KJS::Collector::markOtherThreadConservatively):
3445 (KJS::Collector::markStackObjectsConservatively):
3446 (KJS::Collector::protect):
3447 (KJS::Collector::unprotect):
3448 (KJS::Collector::collectOnMainThreadOnly):
3449 (KJS::Collector::markMainThreadOnlyObjects):
3450 (KJS::Collector::collect):
3452 * wtf/FastMalloc.cpp:
3453 (WTF::fastMallocSetIsMultiThreaded):
3454 * wtf/FastMallocInternal.h:
3457 2007-03-19 Darin Adler <darin@apple.com>
3459 * kjs/value.h: Roll ~JSValue change out. It was causing problems. I'll do it right later.
3461 2007-03-19 Geoffrey Garen <ggaren@apple.com>
3463 Reviewed by John Sullivan.
3465 Fixed <rdar://problem/5073380> REGRESSION: Crash occurs at WTF::fastFree()
3466 when reloading liveconnect page (applet)
3468 Best to use free when you use malloc, especially when malloc and delete
3469 use completely different libraries.
3471 * bindings/jni/jni_runtime.cpp:
3472 (JavaMethod::~JavaMethod):
3474 2007-03-19 Andrew Wellington <proton@wiretapped.net>
3478 Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
3480 * JavaScriptCore.xcodeproj/project.pbxproj:
3482 2007-03-19 Darin Adler <darin@apple.com>
3486 - Changed list size threshold to 5 based on testing.
3488 I was testing the i-Bench JavaScript with the list statistics
3489 dumping on, and discovered that there were many 5-element lists.
3490 The fast case for lists was for 4 elements and fewer. By changing
3491 the threshold to 5 elements we get a measurable speedup. I believe
3492 this will help real web pages too, not just the benchmark.
3494 * kjs/list.cpp: Change constant from 4 to 5.
3496 2007-03-19 Darin Adler <darin@apple.com>
3498 * kjs/value.h: Oops, fix build.
3500 2007-03-19 Darin Adler <darin@apple.com>
3504 - remove ~JSValue; tiny low-risk performance boost
3506 * kjs/value.h: Remove unneeded empty virtual destructor from JSValue.
3507 The only class derived from JSValue is JSCell and it already has a
3508 virtual destructor. Declaring an empty constructor in JSValue had one
3509 good effect: it marked the destructor private, making it a compile
3510 time error to try to destroy a JSValue; but that's not a likely
3511 mistake for someone to make. It had two bad effects: (1) it caused gcc,
3512 at least, to generate code to fix up the virtual table pointer to
3513 point to the JSValue version of the virtual table inside the destructor
3514 of all classes derived from JSValue directly or indirectly; (2) it
3515 caused JSValue to be a polymorphic class so required a virtual table for
3516 it. It's cleaner to not have either of those.
3518 2007-03-18 Maciej Stachowiak <mjs@apple.com>
3522 - avoid static construction (and global variable access) in a smarter, more portable way,
3523 to later enable MUTLI_THREAD mode to work on other platforms and compilers.
3525 * kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers.
3526 (KJS::CommonIdentifiers::CommonIdentifiers):
3527 (KJS::CommonIdentifiers::shared):
3528 * kjs/CommonIdentifiers.h: Added.
3531 (KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access.
3532 (KJS::ExecState::ExecState):