1 2006-05-15 Geoffrey Garen <ggaren@apple.com>
5 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
6 a reserved word while parsing JavaScript (and other ECMA reserved
11 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
12 We treat "char" as a reserved word in JavaScript and firefox/IE do
15 (1) I unreserved most of the spec's "future reserved words" because
16 they're not reserved in IE or FF. (Most, but not all, because IE
17 somewhat randomly *does* reserve a few of them.)
18 (2) I made 'debugger' a legitimate statement that acts like an empty
19 statement because FF and IE support it.
24 2006-05-15 Tim Omernick <timo@apple.com>
26 Reviewed by John Sullivan.
28 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
30 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
31 determines the kind of graphics context created by the browser for the plugin, as well as
32 the Mac types of various Netscape Plugin API data structures.
34 There is a drawing model to represent the old QuickDraw-based API. It is used by default
35 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
37 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
38 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
41 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
42 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
44 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
46 NPRegion's type now depends on the drawing model specified by the plugin.
47 NP_Port is now only defined when QuickDraw is available.
48 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
50 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
52 Reviewed by Darin, landed by ap.
54 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
55 Bakefiles (and generated Makefiles) for wx and gdk ports
57 * make-generated-sources.sh:
58 Added script to configure environment to run DerivedSources.make
60 * JavaScriptCoreSources.bkl:
61 Added JavaScriptCore sources list for Bakefile.
64 Bakefile used to generate JavaScriptCore project files
65 (currently only used by wx and gdk ports)
67 2006-05-09 Steve Falkenburg <sfalken@apple.com>
70 Minor fixes to WTF headers.
74 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
75 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
76 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
77 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
79 2006-05-09 Maciej Stachowiak <mjs@apple.com>
81 Rubber stamped by Anders.
83 - renamed kxmlcore to wtf
89 * JavaScriptCore.xcodeproj/project.pbxproj:
90 * bindings/c/c_instance.cpp:
91 * bindings/objc/WebScriptObject.mm:
95 * kjs/array_object.cpp:
97 (KJS::Collector::registerThread):
101 (KJS::isStrWhiteSpace):
103 * kjs/identifier.cpp:
108 (Lexer::isWhiteSpace):
109 (Lexer::isIdentStart):
110 (Lexer::isIdentPart):
114 * kjs/number_object.cpp:
116 * kjs/property_map.cpp:
117 * kjs/property_map.h:
118 * kjs/string_object.cpp:
119 (StringProtoFunc::callAsFunction):
125 * kxmlcore/AlwaysInline.h: Removed.
126 * kxmlcore/Assertions.cpp: Removed.
127 * kxmlcore/Assertions.h: Removed.
128 * kxmlcore/FastMalloc.cpp: Removed.
129 * kxmlcore/FastMalloc.h: Removed.
130 * kxmlcore/FastMallocInternal.h: Removed.
131 * kxmlcore/Forward.h: Removed.
132 * kxmlcore/HashCountedSet.h: Removed.
133 * kxmlcore/HashFunctions.h: Removed.
134 * kxmlcore/HashMap.h: Removed.
135 * kxmlcore/HashSet.h: Removed.
136 * kxmlcore/HashTable.cpp: Removed.
137 * kxmlcore/HashTable.h: Removed.
138 * kxmlcore/HashTraits.h: Removed.
139 * kxmlcore/ListRefPtr.h: Removed.
140 * kxmlcore/Noncopyable.h: Removed.
141 * kxmlcore/OwnArrayPtr.h: Removed.
142 * kxmlcore/OwnPtr.h: Removed.
143 * kxmlcore/PassRefPtr.h: Removed.
144 * kxmlcore/Platform.h: Removed.
145 * kxmlcore/RefPtr.h: Removed.
146 * kxmlcore/TCPageMap.h: Removed.
147 * kxmlcore/TCSpinLock.h: Removed.
148 * kxmlcore/TCSystemAlloc.cpp: Removed.
149 * kxmlcore/TCSystemAlloc.h: Removed.
150 * kxmlcore/UnusedParam.h: Removed.
151 * kxmlcore/Vector.h: Removed.
152 * kxmlcore/VectorTraits.h: Removed.
153 * kxmlcore/unicode: Removed.
154 * kxmlcore/unicode/Unicode.h: Removed.
155 * kxmlcore/unicode/UnicodeCategory.h: Removed.
156 * kxmlcore/unicode/icu: Removed.
157 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
158 * kxmlcore/unicode/posix: Removed.
159 * kxmlcore/unicode/qt3: Removed.
160 * kxmlcore/unicode/qt4: Removed.
161 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
164 * wtf/Assertions.cpp:
166 * wtf/FastMalloc.cpp:
167 (WTF::TCMalloc_ThreadCache::Scavenge):
170 (WTF::TCMallocGuard::TCMallocGuard):
177 * wtf/FastMallocInternal.h:
179 * wtf/HashCountedSet.h:
180 * wtf/HashFunctions.h:
192 * wtf/TCSystemAlloc.cpp:
193 (TCMalloc_SystemAlloc):
195 * wtf/VectorTraits.h:
196 * wtf/unicode/UnicodeCategory.h:
197 * wtf/unicode/icu/UnicodeIcu.h:
199 2006-05-08 Timothy Hatcher <timothy@apple.com>
203 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
205 2006-05-07 Darin Adler <darin@apple.com>
207 Reviewed and landed by Maciej.
209 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
210 Random crashes on TOT since the form state change
212 I haven't figured out how to construct a test for this, but this does seem to fix the
213 problem; Mitz mentioned that a double-destroy was occurring in these functions.
215 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
216 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
217 destroys the element based on the storage type. The RefCounter template correctly does work
218 only in cases where ValueType and ValueStorageType differ and this class is what's used
219 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
220 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
222 2006-05-05 Darin Adler <darin@apple.com>
224 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
225 IE compatibility fix in date parsing
227 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
228 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
230 2006-05-04 Anders Carlsson <andersca@mac.com>
234 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
235 Would like a Vector::append that takes another Vector
238 (KXMLCore::::append):
239 New function that takes another array.
241 2006-05-02 Steve Falkenburg <sfalken@apple.com>
245 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
246 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
248 2006-05-02 Anders Carlsson <andersca@mac.com>
252 * kxmlcore/HashMap.h:
253 (KXMLCore::::operator):
256 2006-05-01 Tim Omernick <timo@apple.com>
258 Reviewed by Tim Hatcher.
260 <rdar://problem/4476875> Support printing for embedded Netscape plugins
263 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
264 and Mac OS X systems, as this is what plugins expect.
266 2006-05-01 Timothy Hatcher <timothy@apple.com>
270 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
272 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
273 imp->m_destructorIsThreadSafe" where we collect oversized cells.
275 We don't have a way to test PAC files yet, so there's no test attached.
278 (KJS::Collector::collect): test the thread when we collect oversized cells
280 2006-05-01 Tim Omernick <timo@apple.com>
284 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
286 * kxmlcore/Assertions.cpp:
287 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
289 2006-04-28 Steve Falkenburg <sfalken@apple.com>
293 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
296 (main): Suppress C runtime alerts
298 2006-04-28 Steve Falkenburg <sfalken@apple.com>
302 Suppress error reporting dialog that blocks Javascript tests from completing.
304 Real error is due to an overflow in the date/time handling functions that needs
305 to be addressed, but this will prevent the hang running the Javascript tests
306 on the build bot (along with the related changes).
309 (main): Suppress C runtime alerts
311 2006-04-27 Geoffrey Garen <ggaren@apple.com>
315 - Minor fixups I discovered while working on the autogenerator.
318 (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
319 compute a garbage address, and possibly crash.
321 (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
322 would be hidden entirely.
324 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
328 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
329 Compilation fixes for building on gcc 4.0.2, and without precomp headers
332 * kxmlcore/Assertions.cpp:
333 * kxmlcore/FastMalloc.cpp:
334 Added necessary headers to resolve compilation issues when not using
337 * kjs/value.h: Declare the JSCell class before friend declaration
338 to resolve compilation issues with gcc 4.0.2.
340 * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
341 other than KDE (previously only defined for Win and Mac OS)
343 2006-04-18 Eric Seidel <eseidel@apple.com>
347 Fix "new Function()" to correctly use lexical scoping.
348 Add ScopeChain::print() function for debugging.
349 <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
351 * kjs/function_object.cpp:
352 (FunctionObjectImp::construct):
353 * kjs/scope_chain.cpp:
354 (KJS::ScopeChain::print):
357 2006-04-14 James G. Speth <speth@end.com>
361 Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
362 http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
364 Adds a category to WebScriptObject with array accessors for KVC/KVO.
366 If super valueForKey: fails it will call valueForUndefinedKey:, which is
367 important because it causes the right behavior to happen with bindings using
368 the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
370 * bindings/objc/WebScriptObject.mm:
371 (-[WebScriptObject valueForKey:]):
372 (-[WebScriptObject count]):
373 (-[WebScriptObject objectAtIndex:]):
374 (-[WebUndefined description]): return "undefined"
376 2006-04-13 Geoffrey Garen <ggaren@apple.com>
381 (KJS::InterpreterImp::initGlobalObject): Add the built-in object
382 prototype to the end of the global object's prototype chain instead of
383 just blowing away its existing prototype. We need to do this because
384 the window object has a meaningful prototype now.
386 2006-04-13 Maciej Stachowiak <mjs@apple.com>
390 - fix testkjs to not show false-positive KJS::Node leaks in debug builds
396 2006-04-11 Geoffrey Garen <ggaren@apple.com>
400 Minor code cleanup -- passes all the JS tests.
402 * kjs/object_object.cpp:
403 (ObjectObjectImp::construct):
404 (ObjectObjectImp::callAsFunction):
406 2006-04-11 Darin Adler <darin@apple.com>
408 - another attempt to fix Windows build -- Vector in Forward.h was not working
410 * kxmlcore/Forward.h: Remove Vector.
411 * kxmlcore/Vector.h: Add back default arguments, remove include of
414 2006-04-11 Darin Adler <darin@apple.com>
416 - try to fix Windows build -- HashForward.h was not working
418 * kxmlcore/HashForward.h: Removed.
420 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
421 * kjs/collector.h: Remove use of HashForward.h.
422 * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
424 * kxmlcore/HashMap.h: Ditto.
425 * kxmlcore/HashSet.h: Ditto.
427 2006-04-11 David Harrison <harrison@apple.com>
431 - fixed clean build, broken by Darin's check-in
433 * kjs/date_object.cpp: Add needed include of lookup.h.
434 * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
436 2006-04-10 Darin Adler <darin@apple.com>
438 Rubber-stamped by John Sullivan.
440 - switched from a shell script to a makefile for generated files
441 - removed lots of unneeded includes
442 - added new Forward.h and HashForward.h headers that allow compiling with
443 fewer unneeded templates
445 * DerivedSources.make: Added.
446 * generate-derived-sources: Removed.
447 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
450 * kxmlcore/Forward.h: Added.
451 * kxmlcore/HashForward.h: Added.
453 * kxmlcore/HashCountedSet.h: Include HashForward for default args.
454 * kxmlcore/HashMap.h: Ditto.
455 * kxmlcore/HashSet.h: Ditto.
459 Moved KJS_MAX_STACK into the .cpp file.
461 * bindings/NP_jsobject.cpp:
462 * bindings/c/c_instance.h:
463 * bindings/jni/jni_class.h:
464 * bindings/jni/jni_runtime.h:
465 * bindings/jni/jni_utility.h:
466 * bindings/objc/WebScriptObject.mm:
467 * bindings/objc/WebScriptObjectPrivate.h:
468 * bindings/objc/objc_class.h:
469 * bindings/objc/objc_class.mm:
470 * bindings/objc/objc_instance.h:
471 * bindings/objc/objc_instance.mm:
472 * bindings/objc/objc_runtime.mm:
473 * bindings/objc/objc_utility.mm:
474 * bindings/runtime.h:
475 * bindings/runtime_array.cpp:
476 * bindings/runtime_array.h:
477 * bindings/runtime_method.cpp:
478 * bindings/runtime_method.h:
479 * bindings/runtime_object.cpp:
480 * bindings/runtime_root.h:
481 * kjs/JSImmediate.cpp:
483 * kjs/array_object.cpp:
484 * kjs/array_object.h:
485 * kjs/bool_object.cpp:
490 * kjs/error_object.h:
491 * kjs/function_object.h:
494 * kjs/math_object.cpp:
498 * kjs/number_object.cpp:
499 * kjs/number_object.h:
500 * kjs/object_object.cpp:
501 * kjs/operations.cpp:
502 * kjs/protected_reference.h:
504 * kjs/reference_list.h:
505 * kjs/regexp_object.h:
506 * kjs/string_object.cpp:
507 * kjs/string_object.h:
511 * kxmlcore/HashTable.h:
512 * kxmlcore/ListRefPtr.h:
513 * kxmlcore/TCPageMap.h:
515 Removed unneeded header includes.
517 2006-04-09 Geoffrey Garen <ggaren@apple.com>
521 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
522 prevent unnecessary entries in the "nodes with extra refs" hash table
524 This patch switches manually RefPtr exchange with use of
525 RefPtr::release to ensure that a node's ref count never tops 1
526 (in the normal case).
529 (BlockNode::BlockNode):
530 (CaseBlockNode::CaseBlockNode):
532 (KJS::ArrayNode::ArrayNode):
533 (KJS::ObjectLiteralNode::ObjectLiteralNode):
534 (KJS::ArgumentsNode::ArgumentsNode):
535 (KJS::VarStatementNode::VarStatementNode):
536 (KJS::ForNode::ForNode):
537 (KJS::CaseClauseNode::CaseClauseNode):
538 (KJS::FuncExprNode::FuncExprNode):
539 (KJS::FuncDeclNode::FuncDeclNode):
541 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
545 One more attempt - use reinterpret_cast, rather than static_cast.
547 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
551 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
553 * kxmlcore/unicode/icu/UnicodeIcu.h:
554 (KXMLCore::Unicode::toLower):
555 (KXMLCore::Unicode::toUpper):
557 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
561 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
562 toLowerCase and toUpperCase don't honor special mappings
564 Test: fast/js/string-capitalization.html
566 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
567 * icu/unicode/putil.h: Added (copied from WebCore).
568 * icu/unicode/uiter.h: Ditto.
569 * icu/unicode/ustring.h: Ditto.
570 * kjs/string_object.cpp:
571 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
572 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
573 * kjs/ustring.h: Ditto.
575 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
576 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
578 * kxmlcore/unicode/icu/UnicodeIcu.h:
579 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
580 (KXMLCore::Unicode::toUpper): Ditto.
581 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
582 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
583 (KXMLCore::Unicode::category): Ditto.
584 * kxmlcore/unicode/qt4/UnicodeQt4.h:
585 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
586 (KXMLCore::Unicode::toUpper): Ditto.
587 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
588 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
589 (KXMLCore::Unicode::category): Ditto.
591 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
592 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
594 2006-04-05 Darin Adler <darin@apple.com>
596 - attempt to fix Windows build
598 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
599 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
601 2006-04-05 Darin Adler <darin@apple.com>
603 - attempt to fix Windows build
605 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
607 2006-04-05 Darin Adler <darin@apple.com>
611 - fix memory leak introduced by the previous change
613 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
614 the value in question is a pair where one of the pair needs a ref and the other
615 of the pair does not.
617 2006-04-05 Darin Adler <darin@apple.com>
621 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
622 StringImpl hash traits deleted value creates an init routine for WebCore
623 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
625 Change HashMap and HashSet implementation so they fold various types together.
626 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
627 and WebCore::String in terms of the underlying raw pointer type, and hence use
628 -1 for the deleted value.
630 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
631 type to be used when storing a value that has the same layout as the type itself.
632 This is used only for non-key cases. In the case of keys, the hash function must also
633 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
634 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
635 explicit reference counting. If the type itself has needsRef true, but the storage
636 type has needsRef false, then the HashSet or HashMap has to handle the reference
637 counting explicitly. Added hash trait specializations for all signed integer values
638 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
639 integer type of the same size so int and long will share code. Gave all pointers and
640 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
641 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
642 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
643 Useful for types where we don't want to force the existence of deletedValue, such as
644 the type of a pair in a HashMap which is not the actual storage type. Removed an
645 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
646 template, which determines what type can be used to store a given hash key type with
647 a given hash function, and specialized it for pointers and RefPtr so that pointer
648 hash tables share an underlying HashTable that uses IntHash.
650 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
651 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
652 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
653 tables where the type stored is not the same as the real value type.
655 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
656 integer type given a sizeof value. Renamed pointerHash to intHash and made it
657 use overloading and take integer parameters. Added an IntHash struct which is
658 a hash function that works for integers. Changed PtrHash to call IntHash with
659 an appropriately sized integer. Made IntHash the default hash function for
660 many integer types. Made PtrHash the default hash function for RefPtr as well
663 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
664 derived from the new traits. The HashTable will use the storage type and all
665 necessary translation and ref/deref is done at the HashSet level. Also reorganized
666 the file so that the HashSet is at the top and has no inline implementation inside
667 it so it's easy to read the interface to HashSet.
669 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
670 derived from the new traits. The HashTable will use the storage type and all
671 necessary translation and ref/deref is done at the HashMap level. Also reorganized
672 the file so that the HashMap is at the top and has no inline implementation inside
673 it so it's easy to read the interface to HashMap.
675 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
677 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
678 and also remove some unnecessary build settings from the aggregate target that
679 generates derived sources.
680 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
682 2006-04-04 Timothy Hatcher <timothy@apple.com>
686 The Debug and Release frameworks are now built with install paths relative to the build products directory.
687 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
689 * JavaScriptCore.xcodeproj/project.pbxproj:
691 2006-04-04 Eric Seidel <eseidel@apple.com>
696 Disable ASSERT redefinition warnings for now.
698 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
699 * kxmlcore/Assertions.h:
701 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
703 Reviewed by ggaren & darin. Landed by eseidel.
705 Integrate CURL version of gettimeofday
706 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
707 Disable crash report dialogs for testkjs.exe in Release mode
708 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
713 (StopWatch::getElapsedMS):
717 2006-04-04 Eric Seidel <eseidel@apple.com>
721 * kjs/number_object.cpp:
722 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
724 2006-03-12 Maciej Stachowiak <mjs@apple.com>
728 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
729 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
731 * kjs/number_object.cpp:
732 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
733 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
734 plus a bit of refactoring.
736 2006-04-03 Darin Adler <darin@apple.com>
738 - tweak config.h and Platform.h to try to get buildbot working
739 (making some small changes at the same time)
741 * kjs/config.h: Removed now-unneeded HAVE_ICU.
742 * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
743 USE stuff to the end.
745 2006-04-03 George Staikos <staikos@opensource.apple.com>
749 Fix Win32 build breakage from previous commit, remove unused forward.
751 2006-04-03 George Staikos <staikos@opensource.apple.com>
755 Implement a unicode abstraction layer to make JavaScriptCore much more
756 easily ported to other platforms without having to take in libicu. Also
757 makes the unicode related code easier to understand.
759 2006-04-03 Timothy Hatcher <timothy@apple.com>
763 Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
764 Other 64 bit build fixes.
767 (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
769 (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
770 * bindings/jni/jni_utility.cpp:
771 (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
772 (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
773 * bindings/runtime_root.cpp:
774 (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
775 (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
777 2006-03-31 Darin Adler <darin@apple.com>
781 - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
783 * bindings/objc/WebScriptObject.h: Fixed comment.
785 2006-03-31 Eric Seidel <eseidel@apple.com>
789 A bit more code cleanup.
791 * bindings/c/c_utility.cpp:
792 (KJS::Bindings::convertValueToNPVariant):
793 * bindings/objc/objc_runtime.mm:
794 (convertValueToObjcObject):
795 * bindings/objc/objc_utility.mm:
796 (KJS::Bindings::convertValueToObjcValue):
798 (KJS::GlobalFuncImp::callAsFunction):
799 * kjs/interpreter.cpp:
800 (KJS::ExecState::lexicalInterpreter):
802 * kjs/operations.cpp:
805 2006-03-30 Eric Seidel <eseidel@apple.com>
809 Small code-style update.
811 * kjs/operations.cpp:
824 2006-03-31 Anders Carlsson <andersca@mac.com>
828 Make sure the GetterSetterImp objects are marked as well.
831 (KJS::GetterSetterImp::mark):
834 2006-03-30 Eric Seidel <eseidel@apple.com>
838 * kjs/nodes.h: Some various small style fixes.
840 2006-03-30 Eric Seidel <eseidel@apple.com>
844 Clean-up style issues in node.h, remove redundant initializations.
847 (KJS::StatementNode::evaluate):
848 (KJS::ArrayNode::ArrayNode):
849 (KJS::ObjectLiteralNode::ObjectLiteralNode):
850 (KJS::ArgumentsNode::ArgumentsNode):
851 (KJS::NewExprNode::NewExprNode):
852 (KJS::CaseClauseNode::CaseClauseNode):
853 (KJS::FuncDeclNode::FuncDeclNode):
855 2006-03-30 Tim Omernick <timo@apple.com>
859 <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
862 * bindings/runtime.h:
863 (KJS::Bindings::Instance::implementsCall):
864 New method. Returns false by default. Concrete subclasses can override this return true when
865 the bound object may be called as a function.
866 (KJS::Bindings::Instance::invokeDefaultMethod):
867 Since bound objects are no longer treated as functions by default, we can return jsUndefined()
868 here instead of in concrete subclasses that decide not to implement the default method
871 * bindings/runtime_object.cpp:
872 (RuntimeObjectImp::implementsCall):
873 Don't assume that the bound object is a function; instead, let the object instance decide whether
876 * bindings/c/c_instance.h:
877 * bindings/c/c_instance.cpp:
878 (KJS::Bindings::CInstance::implementsCall):
879 The object is callable if its class has an invokeDefault function.
881 * bindings/objc/objc_instance.h:
882 * bindings/objc/objc_instance.mm:
883 (ObjcInstance::implementsCall):
884 The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
886 * bindings/jni/jni_instance.h:
887 * bindings/jni/jni_instance.cpp:
888 Moved bogus invokeDefaultMethod() to superclass.
890 2006-03-29 Geoffrey Garen <ggaren@apple.com>
894 - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
895 Regression: crash in malloc_consolidate if you use a .PAC file
897 The crash was a result of threaded deallocation of thread-unsafe
898 objects. Pure JS objects are thread-safe because all JS execution
899 is synchronized through JSLock. However, JS objects that wrap WebCore
900 objects are thread-unsafe because JS and WebCore execution are not
901 synchronized. That unsafety comes into play when the collector
902 deallocates a JS object that wraps a WebCore object, thus causing the
903 WebCore object to be deallocated.
905 The solution here is to have each JSCell know whether it is safe to
906 collect on a non-main thread, and to avoid collecting unsafe cells
907 when on a non-main thread.
909 We don't have a way to test PAC files yet, so there's no test
910 attached to this patch.
913 (KJS::Collector::collect):
914 (1) Added the test "currentThreadIsMainThread ||
915 imp->m_destructorIsThreadSafe".
918 (KJS::gcProtectNullTolerant):
919 (KJS::gcUnprotectNullTolerant):
921 (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
922 m_destructorIsThreadSafe becomes another whole word, ruining the
923 collector optimizations we've made based on the size of a JSObject.
924 * kxmlcore/FastMalloc.cpp:
925 (KXMLCore::currentThreadIsMainThread):
926 (KXMLCore::fastMallocRegisterThread):
927 * kxmlcore/FastMalloc.h:
929 2006-03-28 Darin Adler <darin@apple.com>
933 - change some code that resulted in init routines on Mac OS X -- if the framework has
934 init routines it will use memory and slow down applications that link with WebKit
935 even in cases where those applications don't use WebKit
937 * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
938 to use immediate numbers instead. Apparently, double constant expressions of the type we
939 had here are evaluated at load time.
941 * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
942 ListImp, so go back to using a plain old pointer.
943 (KJS::List::List): Set overflow to 0 when initializing ListImp.
944 (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
945 (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
946 a swap of OwnArrayPtr.
947 (KJS::List::copyFrom): Remove now-unneeded get().
948 (KJS::List::copyTail): Ditto.
950 * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
951 a static initializer routine. Had to get rid of one level of constant to get the compiler
952 to understand it could initialize without any code.
954 - added a build step that checks for init routines
956 * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
957 was replaced by the generate-derived-sources script a while back. Added a custom build
958 phase that invokes the check-for-global-initializers script.
960 2006-03-28 Timothy Hatcher <timothy@apple.com>
964 fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
966 * bindings/npapi.h: added #defines after the #ifndefs
968 2006-03-27 Maciej Stachowiak <mjs@apple.com>
972 - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
975 (Node::deref): take into account the case where the extra refcount table was never created
977 2006-03-23 David Carson <dacarson@gmail.com>
981 - JSObject in LiveConnect not working.
982 http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
984 * bindings/jni_jsobject.cpp:
985 (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
986 class, and the GetFieldID was using the wrong signature.
988 2006-03-23 Darin Adler <darin@apple.com>
994 * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
995 Also add -Y 3 option for linker.
997 2006-03-23 Darin Adler <darin@apple.com>
1001 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
1002 REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
1004 * kjs/object.h: Take function name, as well as source URL and line number, when
1005 using the special overloaded construct for making functions.
1006 * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
1007 * kjs/function_object.h: Ditto.
1008 * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
1009 constructing the function rather than null. Use "anonymous" when making a
1010 function using the default function constructor.
1012 * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
1013 a function declaration.
1017 * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
1019 2006-03-23 Darin Adler <darin@apple.com>
1023 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
1024 LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
1026 * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
1027 * bindings/c/c_utility.cpp:
1028 (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
1029 BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
1030 OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
1031 one case and remove a _NPN_ReleaseObject in another because this
1032 should return a retained value.
1033 (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
1034 NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
1036 * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
1037 CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
1038 * bindings/c/c_runtime.cpp:
1039 (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
1041 (KJS::Bindings::CField::name): Added. Returns the string from inside the
1043 (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
1044 on the result of getProperty after using it to fix a storage leak.
1045 (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
1046 after pasing a value to setProperty now that the conversion function does a retain.
1048 * bindings/c/c_instance.cpp:
1049 (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
1050 stack buffer. Removed special case for NPVARIANT_IS_VOID because the
1051 convertNPVariantToValue function handles that properly.
1052 (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
1054 * bindings/NP_jsobject.h: Formatting changes only.
1055 * bindings/NP_jsobject.cpp:
1056 (jsDeallocate): Changed parameter type so we don't need a function cast.
1057 (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
1058 (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1059 (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
1060 (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1062 * bindings/c/c_class.cpp: Formatting changes only.
1063 * bindings/c/c_class.h: Formatting changes only.
1065 * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
1066 NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
1067 NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
1068 NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
1069 NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
1070 NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
1071 NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
1072 NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
1073 NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
1074 NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
1075 * bindings/npruntime.cpp:
1076 (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
1077 integer dictionary since the default behavior is fine for integers.
1079 2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1081 Reviewed and landed by Maciej.
1083 - WebKit no longer builds with bison 2.1
1084 http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
1086 * generate-derived-sources: Handle generated header named either grammar.cpp.h
1089 2006-03-22 Maciej Stachowiak <mjs@apple.com>
1093 * JavaScriptCore.xcodeproj/project.pbxproj:
1095 2006-03-21 Maciej Stachowiak <mjs@apple.com>
1097 * kjs/generate-derived-sources: Set executable property.
1099 2006-03-21 Maciej Stachowiak <mjs@apple.com>
1103 Ensure that generated source dependencies are handled properly, as follows:
1105 - Made an external script that generates the sources into a
1106 DerivedSources dir in the build products directory.
1107 - Added a new build target that builds all the generated sources
1108 if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
1109 - Added the DerivedSources dir in question to the include path.
1110 - Added the new DerivedSources dir and its contents to the project as build-relative.
1112 * JavaScriptCore.xcodeproj/project.pbxproj:
1113 * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
1116 2006-03-11 Maciej Stachowiak <mjs@apple.com>
1120 - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
1121 http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
1124 (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
1126 2006-03-16 Maciej Stachowiak <mjs@apple.com>
1130 - tweaks to my change to redo KJS::Node refcounting
1136 (Node::clearNewNodes):
1139 2006-03-16 Darin Adler <darin@apple.com>
1143 - fixed Vector so that you can pass a reference to something in the vector
1144 to the append or insert functions
1146 * kxmlcore/Vector.h:
1147 (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
1148 and return the adjusted value of the pointer.
1149 (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
1150 adding the new element. Makes the case where the element moves when the vector
1152 (KXMLCore::Vector::insert): Ditto.
1154 2006-03-15 Eric Seidel <eseidel@apple.com>
1160 * kjs/date_object.cpp:
1161 (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
1163 2006-03-15 Eric Seidel <eseidel@apple.com>
1167 Fix CString copy constructor, fixes Date.parse("") on Win32.
1169 * kjs/date_object.cpp:
1170 (KJS::DateProtoFunc::callAsFunction):
1172 (KJS::CString::CString):
1173 (KJS::CString::operator=):
1175 2006-03-13 Maciej Stachowiak <mjs@apple.com>
1179 - KJS::Node and KJS::StatementNode are bigger than they need to be
1180 http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
1182 The memory usage of Node was reduced by 2 machine words per node:
1184 - sourceURL was removed and only kept on FunctionBodyNode. The
1185 source URL can only be distinct per function or top-level program node,
1186 and you always have one.
1188 - refcount was removed and kept in a separate hashtable when
1189 greater than 1. newNodes set represents floating nodes with
1190 refcount of 0. This helps because almost all nodes have a refcount of 1
1191 for almost all of their lifetime.
1193 * bindings/runtime_method.cpp:
1194 (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
1196 (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
1197 them at the appropriate time.
1199 (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
1201 (KJS::ContextImp::pushIteration): moved here from LabelStack
1202 (KJS::ContextImp::popIteration): ditto
1203 (KJS::ContextImp::inIteration): ditto
1204 (KJS::ContextImp::pushSwitch): ditto
1205 (KJS::ContextImp::popSwitch): ditto
1206 (KJS::ContextImp::inSwitch): ditto
1208 (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
1209 (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
1210 (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
1211 (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
1213 (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
1215 * kjs/function.h: Move body field from DeclaredFunctionImp to
1217 * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
1219 (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
1220 and m_switchDepth data members. New FunctionBodyNode* parameter - the
1221 function body provides source URL and SourceId.
1222 (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
1223 (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
1226 (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
1227 statement label stacks don't need these and it bloats their size. Put them
1228 in the ContextImp instead.
1229 * kjs/interpreter.cpp:
1230 (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
1231 * kjs/interpreter.h:
1232 (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
1233 (KJS::ExecState::context): ditto
1234 (KJS::ExecState::setException): Renamed _exception to m_exception
1235 (KJS::ExecState::clearException): ditto
1236 (KJS::ExecState::exception): ditto
1237 (KJS::ExecState::hadException): ditto
1238 (KJS::ExecState::ExecState): ditto both above renames
1240 (Node::Node): Removed initialization of line, source URL and refcount. Add to
1241 local newNodes set instead of involving parser.
1242 (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
1243 HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
1245 (Node::deref): ditto
1246 (Node::refcount): ditto
1247 (Node::clearNewNodes): Destroy anything left in the new nodes set.
1248 (currentSourceId): Inline helper to get sourceId from function body via context.
1249 (currentSourceURL): ditto for sourceURL.
1250 (Node::createErrorCompletion): use new helper
1251 (Node::throwError): ditto
1252 (Node::setExceptionDetailsIfNeeded): ditto
1253 (StatementNode::StatementNode): remove initialization of l0 and sid, rename
1255 (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
1256 (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
1257 (StatListNode::StatListNode): updated for setLoc changes
1258 (BlockNode::BlockNode): ditto
1259 (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
1260 (WhileNode::execute): ditto
1261 (ForNode::execute): ditto
1262 (ForInNode::execute): ditto
1263 (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
1264 (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
1265 (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
1266 (FunctionBodyNode::FunctionBodyNode): update for new setLoc
1267 (FunctionBodyNode::processFuncDecl): reindent
1268 (SourceElementsNode::SourceElementsNode): update for new setLoc
1270 (KJS::Node::lineNo): Renamed _line to m_line
1271 (KJS::StatementNode::firstLine): Use lineNo()
1272 (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
1273 (KJS::FunctionBodyNode::sourceId): added
1274 (KJS::FunctionBodyNode::sourceURL): added
1277 2006-03-14 Geoffrey Garen <ggaren@apple.com>
1279 - Fixed <rdar://problem/4478239> string sort puts "closed" before
1285 (KJS::compare): Inverted a < in order to treat the longer string as >
1288 2006-03-12 Alexey Proskuryakov <ap@nypop.com>
1292 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
1293 REGRESSION: Flash callback to JavaScript function not working.
1295 Test: plugins/invoke.html
1297 * bindings/c/c_utility.cpp:
1298 (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
1300 2006-03-08 Eric Seidel <eseidel@apple.com>
1304 Partially fix JS on win32 by fixing hash table generation.
1306 * kjs/create_hash_table: limit << results to 32 bits.
1308 (TestFunctionImp::callAsFunction):
1310 2006-03-07 Darin Adler <darin@apple.com>
1312 * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
1314 2006-03-07 Darin Adler <darin@apple.com>
1318 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
1319 unwanted output while running layout tests
1321 * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
1322 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
1323 to standard output. I think we should arrange for the error text to be in JavaScript
1324 exceptions instead at some point.
1325 * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
1326 too-large size rather than allocating a buffer smaller than requested.
1328 2006-03-06 David Carson <dacarson@gmail.com>
1330 Reviewed by Darin, landed by ap.
1332 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
1333 c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
1335 Tested with test case from:
1336 http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
1338 * bindings/c_utility.cpp
1339 (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
1340 * icu/unicode/ucnv.h: Copied from WebCore.
1341 * icu/unicode/ucnv_err.h: Ditto.
1342 * icu/unicode/uenum.h: Ditto.
1344 2006-03-05 Darin Adler <darin@apple.com>
1346 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
1348 2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
1350 Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
1352 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
1353 REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
1355 * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
1357 2006-03-05 Darin Adler <darin@apple.com>
1361 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
1362 get all references to KJS::Node out of internal.h
1364 * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
1366 * kjs/Parser.cpp: Added.
1367 * kjs/Parser.h: Added.
1369 * kjs/internal.cpp: Removed the Parser class.
1370 * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
1371 not used in this header.
1373 * kjs/nodes.h: Added an include of "Parser.h".
1374 * kjs/function.h: Added a declaration of FunctionBodyNode.
1376 2006-03-05 Geoffrey Garen <ggaren@apple.com>
1380 - JSC support for the fix for <rdar://problem/4467143> JavaScript
1381 enumeration of HTML element properties skips DOM node properties
1384 (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
1385 class definiton macro needs to know about the prototype's prototype so
1386 that the class constructor properly sets it.
1387 (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
1388 implementation macro does not need to know about the prototype's
1389 prototype, since getOwnPropertySlot should only look in the current
1390 object's property map, and not its prototype's.
1392 2006-03-05 Andrew Wellington <proton@wiretapped.net>
1394 Reviewed by Eric, landed by ap.
1396 - Remove unused breakpoint bool from StatementNodes. No test provided as
1397 there is no functionality change.
1400 (StatementNode::StatementNode):
1403 2006-03-03 Geoffrey Garen <ggaren@apple.com>
1407 - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at
1408 http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
1410 This regression was caused by my fix for 4448098. I failed to account for the
1411 deleted entry sentinel in the mehtod that saves the contents of a property map to
1412 the back/forward cache.
1414 Manual test in WebCore/manual-tests/property-map-save-crash.html
1416 * kjs/property_map.cpp:
1417 (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
1418 (KJS::isValid): New function: checks if a key is null or the deleted sentinel
1419 (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
1420 and a slight performance win
1421 (KJS::PropertyMap::clear):
1422 (KJS::PropertyMap::rehash):
1423 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1424 (KJS::PropertyMap::save): Check keys with isValid()
1426 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1428 - now fix mac build again
1430 * kjs/identifier.cpp:
1432 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1434 Rubber stamped by Anders and Eric.
1436 - add fpconst.cpp to win32 build, it is now needed
1438 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1441 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1445 - fix windows build, broken by my last patch
1447 * kjs/JSImmediate.cpp:
1448 * kjs/identifier.cpp:
1449 * kxmlcore/FastMalloc.cpp:
1450 * kxmlcore/Platform.h:
1452 2006-03-01 Maciej Stachowiak <mjs@apple.com>
1456 - Set up new prototype macros and avoid using #if without defined() in JSC
1458 Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
1459 are defined, and to separate core OS-level dependencies from operating environment
1460 dependencies so you can, e.g., build KDE on Mac or Windows.
1462 * kxmlcore/Platform.h: Added.
1464 - deploy them everywhere in JavaScriptCore
1466 * JavaScriptCore.xcodeproj/project.pbxproj:
1467 * bindings/jni/jni_utility.cpp:
1468 (KJS::Bindings::convertValueToJValue):
1469 * bindings/objc/WebScriptObject.mm:
1470 * bindings/objc/objc_instance.mm:
1471 (ObjcInstance::end):
1472 * bindings/softlinking.h:
1473 * bindings/testbindings.mm:
1476 * kjs/collector.cpp:
1477 (KJS::Collector::markCurrentThreadConservatively):
1478 (KJS::Collector::markOtherThreadConservatively):
1479 (KJS::Collector::markStackObjectsConservatively):
1481 * kjs/date_object.cpp:
1484 (KJS::DateProtoFunc::callAsFunction):
1485 (KJS::DateObjectImp::construct):
1492 * kjs/identifier.cpp:
1494 * kjs/interpreter.cpp:
1495 (KJS::Interpreter::evaluate):
1496 (KJS::Interpreter::createLanguageInstanceForValue):
1497 * kjs/interpreter.h:
1500 * kjs/math_object.cpp:
1503 * kjs/operations.cpp:
1510 (KJS::RegExp::RegExp):
1511 (KJS::RegExp::~RegExp):
1512 (KJS::RegExp::match):
1517 (StopWatch::getElapsedMS):
1520 * kxmlcore/AlwaysInline.h:
1521 * kxmlcore/Assertions.cpp:
1522 * kxmlcore/Assertions.h:
1523 * kxmlcore/FastMalloc.cpp:
1525 * kxmlcore/FastMalloc.h:
1526 * kxmlcore/FastMallocInternal.h:
1527 * kxmlcore/HashTable.h:
1528 * kxmlcore/TCPageMap.h:
1529 * kxmlcore/TCSpinLock.h:
1530 (TCMalloc_SpinLock::Lock):
1531 (TCMalloc_SpinLock::Unlock):
1532 (TCMalloc_SlowLock):
1533 * kxmlcore/TCSystemAlloc.cpp:
1534 (TCMalloc_SystemAlloc):
1535 * os-win32/stdint.h:
1537 2006-02-28 Geoffrey Garen <ggaren@apple.com>
1541 - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry
1542 placeholder to -1 from UString::Rep::null
1544 This turned out to be only a small speedup (.12%). That's within the
1545 margin of error for super accurate JS iBench, but Shark confirms the
1546 same, so I think it's worth landing.
1548 FYI, I also confirmed that the single entry optimization in
1549 PropertyMap is a 3.2% speedup.
1551 * kjs/property_map.cpp:
1552 (KJS::PropertyMap::~PropertyMap):
1553 (KJS::PropertyMap::clear):
1554 (KJS::PropertyMap::put):
1555 (KJS::PropertyMap::insert):
1556 (KJS::PropertyMap::rehash):
1557 (KJS::PropertyMap::remove):
1558 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1559 (KJS::PropertyMap::checkConsistency):
1560 * kjs/property_map.h:
1561 (KJS::PropertyMap::deletedSentinel):
1563 2006-02-27 Eric Seidel <eseidel@apple.com>
1565 Rubber-stamped by darin.
1567 Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
1569 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1571 2006-02-27 Eric Seidel <eseidel@apple.com>
1575 Fix Assertions.cpp to compile on win32.
1577 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1578 * kxmlcore/Assertions.cpp:
1580 2006-02-27 Eric Seidel <eseidel@apple.com>
1584 Made Assertions.cpp platform independent.
1585 Moved mac-specific logging logic up into WebCore.
1586 http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
1588 * JavaScriptCore.xcodeproj/project.pbxproj:
1589 * kxmlcore/Assertions.cpp: Added.
1590 * kxmlcore/Assertions.h:
1591 * kxmlcore/Assertions.mm: Removed.
1593 2006-02-27 Darin Adler <darin@apple.com>
1595 - fixed Mac Debug build, there was an unused parameter
1597 * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
1598 Remove parameter name.
1600 * kjs/debugger.h: Fixed comment.
1602 2006-02-27 Eric Seidel <eseidel@apple.com>
1606 * kxmlcore/Vector.h:
1607 (KXMLCore::deleteAllValues): fix unused variable warning
1609 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1613 - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
1614 http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
1616 * JavaScriptCore.xcodeproj/project.pbxproj:
1617 * bindings/NP_jsobject.cpp:
1619 (_NPN_InvokeDefault):
1623 (_NPN_RemoveProperty):
1626 * bindings/c/c_class.h:
1627 (KJS::Bindings::CClass::constructorAt):
1628 * bindings/c/c_utility.cpp:
1629 (KJS::Bindings::convertNPVariantToValue):
1630 * bindings/jni/jni_class.cpp:
1631 (JavaClass::methodsNamed):
1632 (JavaClass::fieldNamed):
1633 * bindings/jni/jni_instance.cpp:
1634 (JavaInstance::invokeDefaultMethod):
1635 * bindings/jni/jni_jsobject.cpp:
1636 * bindings/jni/jni_objc.mm:
1637 (-[NSObject KJS::Bindings::]):
1638 * bindings/objc/WebScriptObject.mm:
1639 (+[WebUndefined allocWithZone:]):
1640 (-[WebUndefined initWithCoder:]):
1641 (-[WebUndefined encodeWithCoder:]):
1642 (-[WebUndefined copyWithZone:]):
1643 * bindings/objc/objc_class.h:
1644 (KJS::Bindings::ObjcClass::constructorAt):
1645 * bindings/objc/objc_class.mm:
1646 (KJS::Bindings::ObjcClass::methodsNamed):
1647 (KJS::Bindings::ObjcClass::fallbackObject):
1648 * bindings/objc/objc_instance.mm:
1649 (ObjcInstance::getValueOfUndefinedField):
1650 * bindings/objc/objc_runtime.mm:
1651 (ObjcFallbackObjectImp::getOwnPropertySlot):
1652 (ObjcFallbackObjectImp::put):
1653 (ObjcFallbackObjectImp::canPut):
1654 (ObjcFallbackObjectImp::deleteProperty):
1655 (ObjcFallbackObjectImp::toBoolean):
1656 * bindings/runtime.cpp:
1657 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1658 * bindings/runtime.h:
1659 (KJS::Bindings::Instance::getValueOfUndefinedField):
1660 (KJS::Bindings::Instance::setValueOfUndefinedField):
1661 * bindings/runtime_array.cpp:
1662 (RuntimeArray::lengthGetter):
1663 (RuntimeArray::indexGetter):
1664 (RuntimeArray::put):
1665 (RuntimeArray::deleteProperty):
1666 * bindings/runtime_method.cpp:
1667 (RuntimeMethod::lengthGetter):
1668 (RuntimeMethod::execute):
1669 * bindings/runtime_object.cpp:
1670 (RuntimeObjectImp::fallbackObjectGetter):
1671 (RuntimeObjectImp::fieldGetter):
1672 (RuntimeObjectImp::methodGetter):
1673 (RuntimeObjectImp::put):
1674 (RuntimeObjectImp::canPut):
1675 (RuntimeObjectImp::deleteProperty):
1676 (RuntimeObjectImp::defaultValue):
1677 (RuntimeObjectImp::callAsFunction):
1678 * bindings/runtime_root.cpp:
1679 (performJavaScriptAccess):
1680 * kjs/array_object.cpp:
1681 (ArrayInstance::lengthGetter):
1682 (ArrayInstance::getOwnPropertySlot):
1683 (ArrayPrototype::ArrayPrototype):
1684 (ArrayPrototype::getOwnPropertySlot):
1685 * kjs/bool_object.cpp:
1686 (BooleanObjectImp::BooleanObjectImp):
1687 * kjs/date_object.cpp:
1688 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1689 (KJS::DateObjectFuncImp::callAsFunction):
1690 * kjs/error_object.cpp:
1691 (ErrorObjectImp::ErrorObjectImp):
1692 (NativeErrorPrototype::NativeErrorPrototype):
1693 (NativeErrorImp::NativeErrorImp):
1695 (KJS::FunctionImp::argumentsGetter):
1696 (KJS::FunctionImp::lengthGetter):
1697 (KJS::Arguments::mappedIndexGetter):
1698 (KJS::ActivationImp::argumentsGetter):
1699 (KJS::ActivationImp::put):
1700 * kjs/function_object.cpp:
1701 (FunctionObjectImp::FunctionObjectImp):
1703 (KJS::GetterSetterImp::toPrimitive):
1704 (KJS::GetterSetterImp::toBoolean):
1705 * kjs/interpreter.cpp:
1706 (KJS::Interpreter::evaluate):
1707 * kjs/interpreter.h:
1708 (KJS::Interpreter::isGlobalObject):
1709 (KJS::Interpreter::interpreterForGlobalObject):
1710 (KJS::Interpreter::isSafeScript):
1712 (Lexer::makeIdentifier):
1713 (Lexer::makeUString):
1715 (KJS::staticFunctionGetter):
1716 (KJS::staticValueGetter):
1718 (StatementNode::processFuncDecl):
1719 (PropertyNode::evaluate):
1720 (PropertyNameNode::evaluate):
1721 * kjs/number_object.cpp:
1722 (NumberObjectImp::NumberObjectImp):
1723 (NumberObjectImp::getOwnPropertySlot):
1725 (KJS::JSObject::defineGetter):
1726 (KJS::JSObject::defineSetter):
1727 (KJS::JSObject::hasInstance):
1728 (KJS::JSObject::propertyIsEnumerable):
1729 * kjs/object_object.cpp:
1730 (ObjectObjectImp::ObjectObjectImp):
1731 * kjs/property_slot.cpp:
1732 (KJS::PropertySlot::undefinedGetter):
1733 (KJS::PropertySlot::functionGetter):
1734 * kjs/reference.cpp:
1735 (KJS::Reference::getPropertyName):
1736 * kjs/reference_list.cpp:
1737 (ReferenceListIterator::operator++):
1738 * kjs/regexp_object.cpp:
1739 (RegExpObjectImp::RegExpObjectImp):
1740 (RegExpObjectImp::getValueProperty):
1741 (RegExpObjectImp::putValueProperty):
1742 * kjs/string_object.cpp:
1743 (StringInstance::lengthGetter):
1744 (StringInstance::indexGetter):
1745 (StringPrototype::StringPrototype):
1746 * kxmlcore/Assertions.mm:
1747 * kxmlcore/FastMalloc.cpp:
1748 (KXMLCore::TCMalloc_PageHeap::CheckList):
1749 * kxmlcore/HashTable.h:
1750 (KXMLCore::HashTableConstIterator::checkValidity):
1751 (KXMLCore::IdentityHashTranslator::translate):
1753 (pcre_get_stringnumber):
1755 2006-02-23 Darin Adler <darin@apple.com>
1757 - try to fix buildbot failure
1759 * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
1760 recompiled after additional inlining was introduced (Xcode bug?).
1762 2006-02-23 Geoffrey Garen <ggaren@apple.com>
1764 Reviewed by Darin, Maciej.
1766 - Inline some functions suggested by Shark. 2.9% speedup on super
1769 http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
1770 <rdar://problem/4448116>
1773 (KJS::ArgumentsNode::evaluateList):
1776 (KJS::ScopeChain::release):
1777 (KJS::JSObject::toPrimitive):
1778 * kjs/scope_chain.cpp:
1781 (KJS::UString::toArrayIndex):
1784 (KJS::JSValue::toObject):
1785 * kxmlcore/FastMalloc.cpp:
1786 (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
1787 (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
1789 2006-02-21 Eric Seidel <eseidel@apple.com>
1791 Added *.user to ignore list.
1793 2006-02-21 Eric Seidel <eseidel@apple.com>
1797 Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
1799 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1800 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
1802 2006-02-21 Eric Seidel <eseidel@apple.com>
1806 * kjs/testkjs.cpp: #if out timeval code on win32
1808 2006-02-21 Michael Emmel <mike.emmel@gmail.com>
1812 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
1813 TCPageMap.h would not compile for me because string.h was missing
1815 * kxmlcore/TCPageMap.h: Added <string.h> include.
1817 2006-02-21 Darin Adler <darin@apple.com>
1819 Reviewed by John Sullivan.
1821 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
1822 remove a bunch of extra implementsCall overrides
1824 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
1826 * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
1827 we'll get a compile error if some derived class neglects to implement it.
1829 * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
1830 of param, which is an OwnPtr so it gets initialized by default.
1832 * bindings/runtime_method.cpp:
1833 * bindings/runtime_method.h:
1834 * kjs/array_object.cpp:
1835 * kjs/array_object.h:
1836 * kjs/bool_object.cpp:
1837 * kjs/bool_object.h:
1838 * kjs/date_object.cpp:
1839 * kjs/date_object.h:
1840 * kjs/error_object.cpp:
1841 * kjs/error_object.h:
1844 * kjs/function_object.cpp:
1845 * kjs/function_object.h:
1846 * kjs/math_object.cpp:
1847 * kjs/math_object.h:
1848 * kjs/number_object.cpp:
1849 * kjs/number_object.h:
1850 * kjs/object_object.cpp:
1851 * kjs/object_object.h:
1852 * kjs/regexp_object.cpp:
1853 * kjs/regexp_object.h:
1854 * kjs/string_object.cpp:
1855 * kjs/string_object.h:
1856 Removed many rendundant implementations of implementsCall from subclasses of
1857 InternalFunctionImp.
1859 2006-02-21 Darin Adler <darin@apple.com>
1863 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
1866 2006-02-21 Darin Adler <darin@apple.com>
1868 Change suggested by Mitz.
1870 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
1871 REGRESSION: Methods do not execute
1873 * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
1874 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
1875 Return true. All the classes derived from InternalFunctionImp need
1876 to return true from this -- later we can remove all the extra
1877 implementations too.
1879 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1881 - fix build breakage caused by last-minute change to my patch
1885 2006-02-20 Maciej Stachowiak <mjs@apple.com>
1887 Reviewed by Geoff and Darin.
1889 Patch from Maks Orlovich, based on work by David Faure, hand-applied and
1890 significantly reworked by me.
1892 - Patch: give internal function names (KJS merge)
1893 http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
1895 * tests/mozilla/expected.html: Updated for newly fixed test.
1897 * kjs/array_object.cpp:
1898 (ArrayProtoFunc::ArrayProtoFunc):
1899 * kjs/array_object.h:
1900 * kjs/bool_object.cpp:
1901 (BooleanPrototype::BooleanPrototype):
1902 (BooleanProtoFunc::BooleanProtoFunc):
1903 * kjs/bool_object.h:
1904 * kjs/date_object.cpp:
1905 (KJS::DateProtoFunc::DateProtoFunc):
1906 (KJS::DateObjectImp::DateObjectImp):
1907 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1908 * kjs/error_object.cpp:
1909 (ErrorPrototype::ErrorPrototype):
1910 (ErrorProtoFunc::ErrorProtoFunc):
1911 * kjs/error_object.h:
1913 (KJS::FunctionImp::FunctionImp):
1914 (KJS::GlobalFuncImp::GlobalFuncImp):
1916 * kjs/function_object.cpp:
1917 (FunctionPrototype::FunctionPrototype):
1918 (FunctionProtoFunc::FunctionProtoFunc):
1919 (FunctionProtoFunc::callAsFunction):
1920 * kjs/function_object.h:
1922 (KJS::InterpreterImp::initGlobalObject):
1923 (KJS::InternalFunctionImp::InternalFunctionImp):
1925 (KJS::InternalFunctionImp::functionName):
1927 (KJS::staticFunctionGetter):
1928 (KJS::HashEntryFunction::HashEntryFunction):
1929 (KJS::HashEntryFunction::implementsCall):
1930 (KJS::HashEntryFunction::toBoolean):
1931 (KJS::HashEntryFunction::implementsHasInstance):
1932 (KJS::HashEntryFunction::hasInstance):
1933 * kjs/math_object.cpp:
1934 (MathFuncImp::MathFuncImp):
1935 * kjs/math_object.h:
1936 * kjs/number_object.cpp:
1937 (NumberPrototype::NumberPrototype):
1938 (NumberProtoFunc::NumberProtoFunc):
1939 * kjs/number_object.h:
1941 (KJS::JSObject::putDirectFunction):
1942 (KJS::Error::create):
1944 * kjs/object_object.cpp:
1945 (ObjectPrototype::ObjectPrototype):
1946 (ObjectProtoFunc::ObjectProtoFunc):
1947 * kjs/object_object.h:
1948 * kjs/regexp_object.cpp:
1949 (RegExpPrototype::RegExpPrototype):
1950 (RegExpProtoFunc::RegExpProtoFunc):
1951 * kjs/regexp_object.h:
1952 * kjs/string_object.cpp:
1953 (StringProtoFunc::StringProtoFunc):
1954 (StringObjectImp::StringObjectImp):
1955 (StringObjectFuncImp::StringObjectFuncImp):
1956 * kjs/string_object.h:
1958 2006-02-20 Geoffrey Garen <ggaren@apple.com>
1960 Reviewed by Darin, with help from Eric, Maciej.
1962 - More changes to support super-accurate JS iBench. Doesn't work on
1963 Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
1964 opendarwin.org/show_bug.cgi?id= 7399] about that.
1966 * kjs/interpreter.cpp:
1967 (KJS::Interpreter::evaluate): Print line numbers with exception output
1968 * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the
1969 way we roll with .cpp files.
1970 (StopWatch::StopWatch): New class. Provides microsecond-accurate
1972 (StopWatch::~StopWatch):
1975 (StopWatch::getElapsedMS):
1976 (TestFunctionImp::callAsFunction): Added missing return statement.
1977 Fixed up "run" to use refactored helper functions. Removed bogus
1978 return statement from "quit" case. Made "print" output to stdout
1979 instead of stderr because that makes more sense, and PERL handles
1981 (main): Factored out KXMLCore unit tests. Removed custom exception
1982 printing code because the interpreter prints exceptions for you. Added
1983 a "delete" call for the GlobalImp we allocate.
1984 (testIsInteger): New function, result of refacotring.
1985 (createStringWithContentsOfFile): New function, result of refactoring.
1986 Renamed "code" to "buffer" to match factored-out-ness.
1988 2006-02-20 Eric Seidel <eseidel@apple.com>
1992 Fix "Copy ICU DLLs..." phase.
1994 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1995 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1997 2006-02-19 Darin Adler <darin@apple.com>
1999 - renamed ERROR to LOG_ERROR to fix build
2000 presumably Maciej had this change and forgot to land it
2002 * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
2003 * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
2004 * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
2006 2006-02-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
2008 Test: fast/js/toString-exception.html
2012 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
2013 REGRESSION: fast/js/toString-overrides.html fails when run multiple times
2015 * kjs/array_object.cpp:
2016 (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
2019 2006-02-18 Darin Adler <darin@apple.com>
2023 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
2024 add insert and remove to KXMLCore::Vector
2026 * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
2027 insert and remove to slide elements within the vector. Also added
2028 "insert" and "remove" functions.
2030 2006-02-16 Geoffrey Garen <ggaren@apple.com>
2034 - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
2035 Bindings::Instance::deref when leaving page @ gigaom.com
2037 * bindings/c/c_instance.cpp:
2038 (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
2039 globally, we shouldn't delete it, so don't.
2041 2006-02-16 Timothy Hatcher <timothy@apple.com>
2043 Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
2044 warnings. Using <rdar://problem/4448350> to track this.
2046 * JavaScriptCore.xcodeproj/project.pbxproj:
2047 * bindings/objc/objc_jsobject.h: Removed empty file.
2048 * bindings/objc/objc_jsobject.mm: Removed empty file.
2050 2006-02-16 Tim Omernick <timo@apple.com>
2054 <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
2055 javascript disabled (7015)
2057 * bindings/NP_jsobject.cpp:
2058 (_NPN_CreateNoScriptObject):
2059 Returns an NPObject which is not bound to a JavaScript object. This kind of NPObject
2060 can be given to a plugin as the "window script object" when JavaScript is disabled.
2061 The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
2062 Because of this, none of the NPN_* functions called by the plugin on this "no script
2063 object" will cause entry into JavaScript code.
2064 (_NPN_InvokeDefault):
2065 Make sure the NPVariant is filled before returning from this function. This never
2066 mattered before because we never reached this case, having only created NPObjects of
2067 the class NPScriptObjectClass.
2075 * bindings/NP_jsobject.h:
2076 Declared _NPN_CreateNoScriptObject().
2078 2006-02-16 Darin Adler <darin@apple.com>
2080 Reviewed by me, change by Peter Kuemmel.
2082 * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
2083 checking for positive infinity (rolling in fix from KDE side).
2085 2006-02-15 Geoffrey Garen <ggaren@apple.com>
2087 Reviewed by Maciej, Eric.
2089 - JavaScriptCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
2090 crashes in DashboardClient at com.apple.JavaScriptCore:
2091 KJS::Bindings::ObjcFallbackObjectImp::type()
2093 WebCore and JavaScriptCore weren't sharing Instance objects very
2094 nicely. I made them use RefPtrs, and sent them to bed without dessert.
2096 * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
2097 (JavaInstance::~JavaInstance):
2098 (JObjectWrapper::JObjectWrapper):
2099 * bindings/jni/jni_instance.h:
2100 (KJS::Bindings::JObjectWrapper::ref):
2101 (KJS::Bindings::JObjectWrapper::deref):
2102 * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
2103 (JavaArray::~JavaArray):
2104 (JavaArray::JavaArray):
2105 * bindings/jni/jni_runtime.h:
2106 (KJS::Bindings::JavaArray::operator=):
2107 * bindings/objc/objc_runtime.h:
2108 - Prohibited copying because that would muss the ref count.
2109 - Prohibited construction without instance because an instance wrapper
2110 without an instance is almost certainly a bug.
2111 * bindings/objc/objc_runtime.mm:
2112 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2113 * bindings/runtime.cpp:
2114 (KJS::Bindings::Instance::Instance):
2115 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2116 (KJS::Bindings::Instance::createRuntimeObject):
2117 * bindings/runtime.h:
2118 (KJS::Bindings::Instance::ref):
2119 (KJS::Bindings::Instance::deref):
2120 * bindings/runtime_object.cpp:
2121 (RuntimeObjectImp::RuntimeObjectImp):
2122 (RuntimeObjectImp::fallbackObjectGetter):
2123 (RuntimeObjectImp::fieldGetter):
2124 (RuntimeObjectImp::methodGetter):
2125 (RuntimeObjectImp::getOwnPropertySlot):
2126 (RuntimeObjectImp::put):
2127 (RuntimeObjectImp::canPut):
2128 * bindings/runtime_object.h:
2129 - Removed ownsInstance data member because RefPtr takes care of
2130 instance lifetime now.
2131 - Prohibited copying because that would muss the ref count.
2132 - Prohibited construction without instance because an instance wrapper
2133 without an instance is almost certainly a bug.
2134 (KJS::RuntimeObjectImp::getInternalInstance):
2136 2006-02-15 Geoffrey Garen <ggaren@apple.com>
2140 - Applied the 4330457 change to CClass and ObjcClass as well.
2142 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2145 This change isn't as critical because CClass and ObjcClass objects get
2146 cached globally and never deleted, but it's good practice, in case we
2147 ever do decide to delete CClass and ObjcClass objects.
2149 This change requires prohibiting copying, because we don't do any
2150 intelligent ref-counting -- when a Class is destroyed, it destroys its
2151 methods and fields unconditionally. (Java classes already prohibited
2154 * bindings/c/c_class.cpp:
2155 - Merged _commonInit and _commonDelete into constructor and destructor.
2158 (CClass::methodsNamed): Added delete callbacks
2159 (CClass::fieldNamed): Added delete callbacks
2160 * bindings/c/c_class.h: Prohibited copying
2161 * bindings/c/c_instance.cpp:
2162 (KJS::Bindings::CInstance::getClass): Changed to use the preferred
2163 class factory method, to take advantage of the global cache.
2165 [ Repeated changes applied to CClass for ObjcClass: ]
2167 * bindings/objc/objc_class.h:
2168 * bindings/objc/objc_class.mm:
2169 (KJS::Bindings::ObjcClass::ObjcClass):
2170 (KJS::Bindings::ObjcClass::~ObjcClass):
2171 (KJS::Bindings::ObjcClass::methodsNamed):
2172 (KJS::Bindings::ObjcClass::fieldNamed):
2173 * bindings/objc/objc_runtime.h:
2174 (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
2175 variable to prevent bad CFRelease.
2176 (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
2177 if statement to prevent bad CFRelease.
2178 * bindings/objc/objc_runtime.cpp: Changed to use the preferred
2179 ObjectStructPtr, for clarity.
2181 2006-02-14 Geoffrey Garen <ggaren@apple.com>
2185 - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
2186 in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
2189 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2192 This was a memory leak in the bindings code. The leak was so extreme
2193 that it would cause Safari or the JVM to abort from lack of memory.
2194 Upon construction, Class objects create field and method objects,
2195 storing them in CFDictionaries. The bug was that upon destruction, the
2196 class objects released the dictionaries but didn't destroy the stored
2199 The fix is to supply CFDictionary callbacks for destroying the values
2200 added to the dictionary.
2202 * bindings/jni/jni_class.cpp:
2203 (JavaClass::JavaClass): Added delete callbacks
2204 * bindings/runtime.cpp: Added definitions for delete callbacks
2205 (KJS::Bindings::deleteMethodList):
2206 (KJS::Bindings::deleteMethod):
2207 (KJS::Bindings::deleteField):
2208 * bindings/runtime.h: Added declarations for delete callbacks
2210 2006-02-14 Timothy Hatcher <timothy@apple.com>
2214 Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
2215 behavior due to POSIX version of sh
2217 * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
2219 2006-02-13 Dave Hyatt <hyatt@apple.com>
2221 Fix Win32 bustage in JavaScriptCore.
2225 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2226 Add JSImmediate to the Win32 project.
2228 * kjs/JSImmediate.h:
2229 (KJS::JSImmediate::fromDouble):
2230 (KJS::JSImmediate::toDouble):
2231 (KJS::JSImmediate::NanAsBits):
2232 (KJS::JSImmediate::oneAsBits):
2233 Win32 needs explicit returns after abort() for non-void functions.
2237 Win32 catches a bug in testkjs! The "return 2" should actually
2238 have been a return false.
2241 The extern decls of NaN and Inf need to be const.
2243 === JavaScriptCore-521.7 ===
2245 2006-02-13 Timothy Hatcher <timothy@apple.com>
2249 Replaced the old NS_DURING exception blocking with @try/@catch.
2251 * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
2252 * bindings/objc/objc_instance.mm:
2253 (ObjcInstance::invokeMethod):
2254 (ObjcInstance::invokeDefaultMethod):
2255 (ObjcInstance::setValueOfUndefinedField):
2256 (ObjcInstance::getValueOfUndefinedField):
2257 * bindings/objc/objc_runtime.mm:
2258 (ObjcField::valueFromInstance):
2259 (ObjcField::setValueToInstance):
2260 (ObjcArray::setValueAt):
2261 (ObjcArray::valueAt):
2263 2006-02-13 Darin Adler <darin@apple.com>
2265 - fix a couple problems building on Windows, based on requests
2266 from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2268 * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
2269 to the standard uint32/64_t. Also removed curious "isIEEE()" function
2270 that checked the sizes of some types (and type sizes alone don't tell you if
2271 the floating point conforms to the IEEE-standard). Added missing include
2274 * kjs/property_slot.h: Added missing include of <assert.h>.
2276 2006-02-12 Geoffrey Garen <ggaren@apple.com>
2280 Cleaned up testkjs, added new "run" functionality to allow scripting
2281 tests from within JS. ("run" is a part of my new super-accurate
2284 No regressions in run-javascriptcore-tests.
2287 (GlobalImp::className):
2288 (TestFunctionImp::):
2289 (TestFunctionImp::callAsFunction):
2293 2006-02-11 Alexey Proskuryakov <ap@nypop.com>
2297 - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2298 RealPlayer.GetTitle() Crashes Safari/Dashboard
2300 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2301 Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1,
2302 because the latter encoding has holes, and conversion can still fail.
2304 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2308 - Inlined RefPtr assignment operators. .7% performance win on
2309 super-accurate JS iBench.
2311 * kxmlcore/RefPtr.h:
2312 (KXMLCore::::operator):
2314 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2316 No review needed, just a build fix. This time for sure.
2320 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2324 - Fixed build. As it goes without saying, I will not mention that I
2327 * JavaScriptCore.xcodeproj/project.pbxproj:
2328 * kjs/JSImmediate.cpp:
2329 (KJS::JSImmediate::toObject):
2331 2006-02-09 Geoffrey Garen <ggaren@apple.com>
2335 - Fixed <rdar://problem/4343730> Should switch ConstantValues (null,
2336 undefined, true, false) from JS objects to immediate values similar to
2339 2.0% performance gain on my new super-accurate version of JS iBench.
2340 (I promise to land a version of it soon.)
2342 The gist of the change:
2343 (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
2344 class (JSImmediate.h/.cpp), and it handles not only numbers but also
2345 null, undefined, true, and false.
2346 (2) JSImmediate provides convenience methods for the bit masking
2347 necessary to encode and decode immediate values.
2348 (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
2349 (4) JSCell no longer implements functions like getBoolean, because
2350 only a JSImmediate can be a boolean.
2351 (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
2352 and ALWAYS_INLINE is a non-portable option of last resort.
2353 (6) Type is now JSType, and it resides in its own file, JSType.h.
2354 Since I was there, I did some header include sorting as part of this
2357 The rest pretty much explains itself.
2359 * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
2360 added JSImmediate.h/.cpp.
2361 * bindings/c/c_instance.cpp:
2362 (KJS::Bindings::CInstance::defaultValue):
2363 * bindings/c/c_instance.h:
2364 * bindings/c/c_utility.cpp:
2365 (KJS::Bindings::convertValueToNPVariant):
2366 * bindings/jni/jni_instance.cpp:
2367 (JavaInstance::defaultValue):
2368 * bindings/jni/jni_instance.h:
2369 * bindings/jni/jni_jsobject.cpp:
2370 (JavaJSObject::convertValueToJObject):
2371 * bindings/objc/WebScriptObject.mm:
2372 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
2373 Standardized calls to use getXXX instead of hand-rolling JSValue
2375 * bindings/objc/objc_instance.h:
2376 * bindings/objc/objc_instance.mm:
2377 (ObjcInstance::getValueOfUndefinedField):
2378 (ObjcInstance::defaultValue):
2379 * bindings/objc/objc_runtime.h:
2380 * bindings/objc/objc_runtime.mm:
2381 (ObjcFallbackObjectImp::type):
2382 (ObjcFallbackObjectImp::defaultValue):
2383 * bindings/runtime.h:
2384 (KJS::Bindings::Instance::getValueOfUndefinedField):
2385 * bindings/runtime_object.cpp:
2386 (RuntimeObjectImp::defaultValue):
2387 * bindings/runtime_object.h:
2388 * kjs/JSImmediate.h: Added.
2389 (KJS::JSImmediate::isImmediate):
2390 (KJS::JSImmediate::isNumber):
2391 (KJS::JSImmediate::isBoolean):
2392 (KJS::JSImmediate::isUndefinedOrNull):
2393 (KJS::JSImmediate::fromDouble):
2394 (KJS::JSImmediate::toDouble):
2395 (KJS::JSImmediate::toBoolean):
2396 (KJS::JSImmediate::trueImmediate):
2397 (KJS::JSImmediate::falseImmediate):
2398 (KJS::JSImmediate::NaNImmediate):
2399 (KJS::JSImmediate::undefinedImmediate):
2400 (KJS::JSImmediate::nullImmediate):
2401 (KJS::JSImmediate::tag):
2402 (KJS::JSImmediate::unTag):
2403 (KJS::JSImmediate::getTag):
2404 (KJS::JSImmediate::):
2405 (KJS::JSImmediate::isIEEE):
2406 (KJS::JSImmediate::is32bit):
2407 (KJS::JSImmediate::is64bit):
2408 (KJS::JSImmediate::NanAsBits):
2409 (KJS::JSImmediate::zeroAsBits):
2410 (KJS::JSImmediate::oneAsBits):
2412 (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
2413 * kjs/JSType.h: Added.
2414 * kjs/collector.cpp:
2415 (KJS::Collector::protect):
2416 (KJS::Collector::unprotect):
2417 (KJS::Collector::collect):
2419 (KJS::StringImp::toPrimitive):
2420 (KJS::NumberImp::toPrimitive):
2421 (KJS::NumberImp::toBoolean):
2422 (KJS::GetterSetterImp::toPrimitive):
2424 (KJS::StringImp::type):
2425 (KJS::NumberImp::type):
2427 (KJS::JSObject::type):
2428 (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
2429 I'm looking for?" test with "Are you not the one thing I'm not looking
2431 (KJS::JSObject::defaultValue):
2432 (KJS::JSObject::toPrimitive):
2434 (KJS::GetterSetterImp::type):
2435 (KJS::JSValue::isObject):
2436 * kjs/operations.cpp:
2440 * kjs/reference.cpp:
2441 (KJS::Reference::deleteValue):
2442 * kjs/simple_number.h: Removed.
2443 * kjs/string_object.cpp:
2444 (StringInstance::getOwnPropertySlot): fixed indentation
2446 (KJS::JSValue::toObject):
2447 (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
2448 us to inline jsNumber without adding PIC branches to callers.
2455 (KJS::JSValue::downcast):
2456 (KJS::JSValue::isUndefinedOrNull):
2457 (KJS::JSValue::isBoolean):
2458 (KJS::JSValue::isNumber):
2459 (KJS::JSValue::isString):
2460 (KJS::JSValue::isObject):
2461 (KJS::JSValue::getBoolean):
2462 (KJS::JSValue::getNumber):
2463 (KJS::JSValue::getString):
2464 (KJS::JSValue::getObject):
2465 (KJS::JSValue::getUInt32):
2466 (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
2467 resulting in a slight performance gain. Callers should always check
2468 !marked() before calling mark(), so it's impossible to call mark on
2470 (KJS::JSValue::marked):
2471 (KJS::JSValue::type):
2472 (KJS::JSValue::toPrimitive):
2473 (KJS::JSValue::toBoolean):
2474 (KJS::JSValue::toNumber):
2475 (KJS::JSValue::toString):
2477 2006-02-06 Eric Seidel <eseidel@apple.com>
2479 Add svn:ignore properties for visual studio internals.
2481 2006-02-06 Alexey Proskuryakov <ap@nypop.com>
2485 - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
2486 http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
2488 - No tests added - only changed functionality on WIN32, which should be covered by
2491 * kjs/date_object.cpp:
2492 (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
2494 (KJS::timeZoneOffset): Removed, was basically the same as the above.
2495 (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
2496 Windows based on struct tm itself.
2497 (KJS::DateInstance::getTime): Added.
2498 (KJS::DateInstance::getUTCTime): Added.
2499 (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
2500 (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
2501 (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
2502 GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
2503 with daylight savings time being in effect.
2505 * kjs/date_object.h: Added prototypes for new functions.
2507 2006-02-05 Maciej Stachowiak <mjs@apple.com>
2511 - fixed ~1100 KJS::Node leaked on layout tests
2512 http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
2515 (KJS::Parser::noteNodeCycle):
2516 (KJS::Parser::removeNodeCycle):
2517 (KJS::clearNewNodes):
2520 (ElementNode::breakCycle):
2521 (PropertyListNode::breakCycle):
2522 (ArgumentListNode::breakCycle):
2523 (StatListNode::StatListNode):
2524 (StatListNode::breakCycle):
2525 (VarDeclListNode::breakCycle):
2526 (BlockNode::BlockNode):
2527 (ClauseListNode::breakCycle):
2528 (CaseBlockNode::CaseBlockNode):
2529 (ParameterNode::breakCycle):
2530 (SourceElementsNode::SourceElementsNode):
2531 (SourceElementsNode::breakCycle):
2533 (KJS::Node::breakCycle):
2534 (KJS::ElementNode::ElementNode):
2535 (KJS::ArrayNode::ArrayNode):
2536 (KJS::PropertyListNode::PropertyListNode):
2537 (KJS::ObjectLiteralNode::ObjectLiteralNode):
2538 (KJS::ArgumentListNode::ArgumentListNode):
2539 (KJS::ArgumentsNode::ArgumentsNode):
2540 (KJS::VarDeclListNode::VarDeclListNode):
2541 (KJS::VarStatementNode::VarStatementNode):
2542 (KJS::ForNode::ForNode):
2543 (KJS::CaseClauseNode::CaseClauseNode):
2544 (KJS::ClauseListNode::ClauseListNode):
2545 (KJS::ParameterNode::ParameterNode):
2546 (KJS::FuncExprNode::FuncExprNode):
2547 (KJS::FuncDeclNode::FuncDeclNode):
2549 2006-02-05 Maciej Stachowiak <mjs@apple.com>
2553 - fix default traits for classes to make sure default constructors get called
2555 * kxmlcore/VectorTraits.h:
2558 2006-02-04 Darin Adler <darin@apple.com>
2562 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
2563 REGRESSION: for/in loop with var changes global variable instead of making local
2565 Test: fast/js/for-in-var-scope.html
2568 (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
2569 (ForInNode::execute): Break out of the scope chain loop once we find and set the
2570 loop variable. We don't want to set multiple loop variables.
2571 (ForInNode::processVarDecls): Process the declaration of the loop variable.
2575 * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
2576 * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
2577 instead of defining it here a second time.
2579 2006-02-04 Maciej Stachowiak <mjs@apple.com>
2583 - change JavaScript collector statistics calls to use HashCountedSet instead
2584 of CFSet; other misc cleanup
2585 http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
2587 * kjs/collector.cpp:
2588 (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
2590 (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
2593 (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
2596 2006-02-03 Timothy Hatcher <timothy@apple.com>
2600 Renamed configuration names to Debug, Release and Production.
2602 * JavaScriptCore.xcodeproj/project.pbxproj:
2604 2006-02-02 George Staikos <staikos@opensource.apple.com>
2608 * kjs/lookup.h: Fix compile, merged from KDE.
2610 2006-02-02 Darin Adler <darin@apple.com>
2614 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
2615 add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
2617 * kxmlcore/Noncopyable.h: Added.
2618 * kxmlcore/OwnArrayPtr.h: Added.
2619 * kxmlcore/OwnPtr.h: Added.
2621 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
2624 * kjs/function.cpp: Use OwnPtr for Parameter pointers.
2626 * kjs/internal.h: Use Noncopyable for LabelStack.
2628 * kjs/list.cpp: Use OwnArrayPtr for overflow.
2630 * kjs/property_map.h:
2631 * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
2632 Use Vector for some stack buffers.
2634 * kjs/regexp_object.h:
2635 * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
2637 2006-01-31 Maciej Stachowiak <mjs@apple.com>
2641 - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
2642 that would catch them
2645 (NodeCounter::~NodeCounter): Added debug-only node counter.
2648 * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
2650 2006-01-31 Darin Adler <darin@apple.com>
2654 - added deleteAllValues for HashSet as well as HashMap
2655 - fixed conversion from const_iterator to iterator, which I broke a while back
2657 * kxmlcore/HashMap.h: Updated copyright date.
2658 * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
2659 * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
2661 2006-01-31 Tim Omernick <timo@apple.com>
2663 Reviewed by Geoff Garen.
2665 * bindings/c/c_utility.cpp:
2666 (KJS::Bindings::convertUTF8ToUTF16):
2667 Fixed an invalid assertion that UTF8Chars is not NULL. It is valid for it to be NULL as long as
2669 This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
2670 where JavaScript is getting a NULL string back from some call on the Real Player plugin.
2672 2006-01-30 Anders Carlsson <andersca@mac.com>
2676 Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
2677 REGRESSION: United.com menus messed up due to document.all/MSIE sniff
2680 (typeStringForValue):
2681 Return "undefined" if the given object should masquerade as undefined.
2684 (KJS::JSObject::masqueradeAsUndefined):
2685 Rename from isEqualToNull.
2687 * kjs/operations.cpp:
2689 Update for name change.
2691 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2695 - properly define Vector assignment operator; the private version was accidentally left
2696 in, and the template version is not enough to replace the default
2698 * kxmlcore/Vector.h:
2699 (KXMLCore::Vector::operator=):
2701 2006-01-29 Eric Seidel <eseidel@apple.com>
2705 Fix the build by applying a GCC-specific namespace hack.
2709 2006-01-29 Eric Seidel <eseidel@apple.com>
2715 * kjs/lookup.h: fixed ::cacheGlobalObject
2716 * kxmlcore/Vector.h:
2717 (KXMLCore::Vector::operator[]): use unsigned long
2719 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2721 Reviewed by Dave Hyatt.
2723 * kxmlcore/Vector.h:
2724 (KXMLCore::Vector::operator[]): Add unsigned overload
2726 2006-01-28 Darin Adler <darin@apple.com>
2728 Reviewed by John Sullivan.
2730 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
2731 include exception names in JavaScript form of DOM exception
2733 * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
2734 exception in the error message.
2736 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2740 - miscellaneous Vector improvements
2742 * kxmlcore/Vector.h:
2743 (KXMLCore::Vector::at): Add range-checking asserts.
2744 (KXMLCore::Vector::first): Added as a convenience.
2745 (KXMLCore::Vector::last): Convenience for stack-style use.
2746 (KXMLCore::Vector::removeLast): ditto
2748 2006-01-28 Darin Adler <darin@apple.com>
2750 Reviewed by John Sullivan
2752 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
2753 REGRESSION: JavaScript Date constructor won't accept another Date object
2755 Test: fast/js/date-constructor.html
2757 * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
2758 Added a special case for constructing one date from another (to avoid losing
2759 milliseconds, which are not in the text form, to match Firefox), and changed
2760 the base code to convert to primitive before checking for string to match
2761 the standard. Also corrected a couple silly things in the "construct from
2762 current time" code path (removed a floor that does no good, and changed
2763 the constant used to convert microseconds to milliseconds to be a 1000
2764 rather than "msPerSecond").
2766 2006-01-28 Darin Adler <darin@apple.com>
2768 * kjs/create_hash_table: Added missing license.
2770 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2772 Reviewed by Dave Hyatt.
2774 - added a Vector class
2775 http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
2777 * JavaScriptCore.xcodeproj/project.pbxproj:
2779 (KJS::Parser::saveNewNode): Apply Vector.
2780 (KJS::clearNewNodes): ditto
2781 * kjs/number_object.cpp:
2782 (integer_part_noexp): ditto
2783 (char_sequence): ditto
2785 (KJS::UString::UTF8String): ditto
2786 * kxmlcore/HashMap.h:
2787 (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
2788 other versions are useful for other containers.
2789 * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
2790 be usable for all Array/QVector style purposes, and also as a stack buffer
2791 with oversize handling. Also some helper classes to make vector operations
2792 as efficient as possible for POD types and for simple non-PODs like RefPtr.
2794 (KXMLCore::VectorTypeOperations::destruct):
2795 (KXMLCore::VectorTypeOperations::initialize):
2796 (KXMLCore::VectorTypeOperations::move):
2797 (KXMLCore::VectorTypeOperations::uninitializedCopy):
2798 (KXMLCore::VectorTypeOperations::uninitializedFill):
2799 (KXMLCore::VectorBuffer::VectorBuffer):
2800 (KXMLCore::VectorBuffer::~VectorBuffer):
2801 (KXMLCore::VectorBuffer::deallocateBuffer):
2802 (KXMLCore::VectorBuffer::inlineBuffer):
2803 (KXMLCore::Vector::Vector):
2804 (KXMLCore::Vector::~Vector):
2805 (KXMLCore::Vector::size):
2806 (KXMLCore::Vector::capacity):
2807 (KXMLCore::Vector::isEmpty):
2808 (KXMLCore::Vector::at):
2809 (KXMLCore::Vector::operator[]):
2810 (KXMLCore::Vector::data):
2811 (KXMLCore::Vector::operator T*):
2812 (KXMLCore::Vector::operator const T*):
2813 (KXMLCore::Vector::begin):
2814 (KXMLCore::Vector::end):
2815 (KXMLCore::Vector::clear):
2816 (KXMLCore::Vector::fill):
2817 (KXMLCore::Vector::operator=):
2818 (KXMLCore::::Vector):
2819 (KXMLCore::::operator):
2821 (KXMLCore::::expandCapacity):
2822 (KXMLCore::::resize):
2823 (KXMLCore::::reserveCapacity):
2824 (KXMLCore::::append):
2825 (KXMLCore::deleteAllValues):
2826 * kxmlcore/VectorTraits.h: Added.
2827 (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
2830 2006-01-28 Alexey Proskuryakov <ap@nypop.com>
2834 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2835 RealPlayer.GetTitle() Crashes Safari/Dashboard
2837 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2838 Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
2840 2006-01-25 George Staikos <staikos@opensource.apple.com>
2844 * kxmlcore/HashFunctions.h: Merge build fix from KDE.
2846 2006-01-25 Darin Adler <darin@apple.com>
2848 - removed an unused source file
2850 * kjs/pointer_hash.h: Removed.
2851 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
2853 2006-01-23 Anders Carlsson <andersca@mac.com>
2857 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
2858 KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
2861 Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
2863 (cacheGlobalObject):
2864 Move this out of the KJS namespace.
2866 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2870 - renamed PointerHash to PtrHash
2871 - made PtrHash the default hash function for int and pointer types that aren't further specialized
2872 - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
2873 - did appropriate consequent cleanup (very few places now need to declare a hash function)
2874 http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
2876 * kjs/array_object.cpp:
2877 (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
2878 * kjs/collector.cpp: ditto
2879 * kjs/identifier.cpp:
2880 (KXMLCore::): declare DefaultHash the new way
2881 * kjs/internal.cpp: no need to mention PointerHash
2883 * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
2884 easier to specialize on PtrHash
2885 * kxmlcore/HashFunctions.h:
2886 (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
2887 a Hash typedef rather than being a hash function class itself; declared DefaultHash
2888 for int and partializy specialized for pointer types
2889 * kxmlcore/HashMapPtrSpec.h:
2890 (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
2891 way of handling pointer hash
2892 (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
2894 * kxmlcore/HashMap.h: ditto
2895 * kxmlcore/HashSet.h: ditto
2897 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2899 Reviewed by Tim Omernick.
2901 - use classes instead of free functions for extractors, this better matches how other
2902 things work and should avoid the need for hacky workarounds on other compilers
2903 http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
2905 * kjs/array_object.cpp:
2906 * kjs/identifier.cpp:
2908 * kxmlcore/HashMap.h:
2909 (KXMLCore::PairFirstExtractor::extract):
2910 * kxmlcore/HashMapPtrSpec.h:
2912 * kxmlcore/HashSet.h:
2913 (KXMLCore::IdentityExtractor::extract):
2914 * kxmlcore/HashTable.h:
2915 (KXMLCore::addIterator):
2916 (KXMLCore::removeIterator):
2917 (KXMLCore::HashTable::add):
2918 (KXMLCore::HashTable::isEmptyBucket):
2919 (KXMLCore::HashTable::isDeletedBucket):
2920 (KXMLCore::HashTable::HashTable):
2921 (KXMLCore::HashTable::lookup):
2922 (KXMLCore::HashTable::add):
2923 (KXMLCore::HashTable::reinsert):
2924 (KXMLCore::HashTable::find):
2925 (KXMLCore::HashTable::contains):
2926 (KXMLCore::HashTable::remove):
2927 (KXMLCore::HashTable::allocateTable):
2928 (KXMLCore::HashTable::deallocateTable):
2929 (KXMLCore::HashTable::expand):
2930 (KXMLCore::HashTable::rehash):
2931 (KXMLCore::HashTable::clear):
2932 (KXMLCore::HashTable::swap):
2933 (KXMLCore::HashTable::operator):
2934 (KXMLCore::HashTable::checkTableConsistency):
2935 (KXMLCore::HashTable::checkTableConsistencyExceptSize):
2936 (KXMLCore::HashTable::invalidateIterators):
2938 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2940 Rubber stamped by Tim Hatcher.
2942 - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
2943 for consistency with HashMap
2945 * kjs/array_object.cpp:
2946 (ArrayProtoFunc::callAsFunction):
2947 * kjs/collector.cpp:
2948 (KJS::Collector::protect):
2949 * kjs/identifier.cpp:
2950 (KJS::Identifier::add):
2951 * kxmlcore/HashCountedSet.h:
2953 * kxmlcore/HashMap.h:
2954 (KXMLCore::::inlineAdd):
2955 * kxmlcore/HashSet.h:
2957 * kxmlcore/HashTable.h:
2958 (KXMLCore::HashTable::add):
2960 (KXMLCore::::HashTable):
2962 2006-01-23 Justin Garcia <justin.garcia@apple.com>
2964 Reviewed by thatcher
2966 Turned on -O2 for B&I build.
2968 * JavaScriptCore.xcodeproj/project.pbxproj:
2970 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2972 Reviewed by Tim Hatcher.
2974 - it's "Franklin Street", not "Franklin Steet"
2976 * kjs/array_instance.h:
2977 * kjs/array_object.cpp:
2978 * kjs/array_object.h:
2979 * kjs/bool_object.cpp:
2980 * kjs/bool_object.h:
2981 * kjs/collector.cpp:
2985 * kjs/date_object.cpp:
2986 * kjs/date_object.h:
2990 * kjs/error_object.cpp:
2991 * kjs/error_object.h:
2994 * kjs/function_object.cpp:
2995 * kjs/function_object.h:
2997 * kjs/identifier.cpp:
3001 * kjs/interpreter.cpp:
3002 * kjs/interpreter.h:
3009 * kjs/math_object.cpp:
3010 * kjs/math_object.h:
3013 * kjs/nodes2string.cpp:
3014 * kjs/number_object.cpp:
3015 * kjs/number_object.h:
3018 * kjs/object_object.cpp:
3019 * kjs/object_object.h:
3020 * kjs/operations.cpp:
3022 * kjs/property_map.cpp:
3023 * kjs/property_map.h:
3024 * kjs/property_slot.cpp:
3025 * kjs/property_slot.h:
3026 * kjs/reference.cpp:
3028 * kjs/reference_list.cpp:
3029 * kjs/reference_list.h:
3032 * kjs/regexp_object.cpp:
3033 * kjs/regexp_object.h:
3034 * kjs/scope_chain.cpp:
3035 * kjs/scope_chain.h:
3036 * kjs/simple_number.h:
3037 * kjs/string_object.cpp:
3038 * kjs/string_object.h:
3045 * kxmlcore/AlwaysInline.h:
3046 * kxmlcore/ListRefPtr.h:
3047 * kxmlcore/PassRefPtr.h:
3048 * kxmlcore/RefPtr.h:
3050 2006-01-23 Darin Adler <darin@apple.com>
3052 Reviewed by John Sullivan.
3054 - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
3055 REGRESSION: Crash in cloneChildNodes when clicking element
3057 * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
3058 type by calling get() instead of going directly at m_ptr.
3059 * kxmlcore/RefPtr.h: Ditto.
3063 * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
3064 It's just a resorted list of keys in a dictionary.
3066 * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
3067 in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
3068 routine" property we want to have on OS X.
3070 2006-01-22 Maciej Stachowiak <mjs@apple.com>
3074 - Set up Page class and invert Frame / WebCoreFrameBridge ownership
3075 http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
3077 * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can
3080 2006-01-23 George Staikos <staikos@opensource.apple.com>
3082 Reviewed by Maciej and Darin.
3084 * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
3085 * kjs/interpreter.cpp: ditto
3086 * kjs/simple_number.h: Add assert.h and remove from config.h
3087 * kjs/array_object.cpp: Use relative paths for kxmlcore includes
3088 * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
3090 2006-01-23 George Staikos <staikos@opensource.apple.com>
3094 * kjs/config.h: unbreak preprocessor change
3096 2006-01-23 George Staikos <staikos@opensource.apple.com>
3098 Approved by Maciej and Darin.
3102 Update FSF address in license to make merging easier
3104 2006-01-22 George Staikos <staikos@opensource.apple.com>
3108 * kjs/collector.cpp: merge major speedup from KDE on Linux
3109 patch by Maks Orlovich, bug #6145
3110 Also unify cpu detection
3111 * kjs/config.h: define simpler CPU macros
3113 2006-01-22 George Staikos <staikos@opensource.apple.com>
3117 * kjs/collector.cpp: merge FreeBSD compile fix from KDE
3118 -> requires build magic for use
3120 2006-01-21 George Staikos <staikos@opensource.apple.com>
3124 * kjs/nodes2string.cpp
3127 Fix pedantic compile with some gcc versions (Merge from KDE)
3129 * kjs/create_hash_table:
3130 Fix build with Perl 5.8.0 (Merge from KDE)
3132 2006-01-18 Darin Adler <darin@apple.com>
3136 - hash table fixes needed for my WebCore changes
3138 * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
3139 Added a missing return statement.
3141 * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
3142 can't instantiate with a 0 by using traits rather than ? : to select the default
3143 emtpy value of hash table keys.
3145 - small cleanup of "runtime" code left over from recent JavaScript crash fix
3147 * bindings/runtime_root.h:
3148 (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
3149 since it's now a ProtectedPtr.
3150 (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
3151 fact that _imp was 0 and replaced with use of ProtectedPtr.
3152 (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
3154 2006-01-17 Darin Adler <darin@apple.com>
3158 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
3159 add assertions to check correct use of hash table iterators
3161 * kxmlcore/HashTable.h:
3162 (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
3163 maintained by the specified hash table.
3164 (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
3165 the list maintained by the hash table it's in.
3166 (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
3167 parameter, ignored when not debugging. Call addIterator.
3168 (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
3169 (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
3170 (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
3171 (KXMLCore::HashTableConstIterator::operator->): Ditto.
3172 (KXMLCore::HashTableConstIterator::operator++): Ditto.
3173 (KXMLCore::HashTableConstIterator::operator==): Ditto.
3174 (KXMLCore::HashTableConstIterator::operator!=): Ditto.
3175 (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
3176 pointer is not 0 and if there are two iterators that both point at the same table.
3177 (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
3178 as an implementation detail, to avoid having two separate iterator implementations.
3179 (KXMLCore::HashTableIterator::operator*): Ditto.
3180 (KXMLCore::HashTableIterator::operator->): Ditto.
3181 (KXMLCore::HashTableIterator::operator++): Ditto.
3182 (KXMLCore::HashTableIterator::operator==): Ditto.
3183 (KXMLCore::HashTableIterator::operator!=): Ditto.
3184 (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
3185 (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
3186 (KXMLCore::HashTable::makeIterator): Pass this pointer.
3187 (KXMLCore::HashTable::makeConstIterator): Ditto.
3188 (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
3189 entry point that modifies the hash table.
3190 (KXMLCore::HashTable::remove): Ditto.
3191 (KXMLCore::HashTable::clear): Ditto.
3192 (KXMLCore::HashTable::swap): Ditto.
3193 (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
3194 clears out the table, next, and previous pointers in all of them, and then clears
3195 the head so we have an empty list.
3196 (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
3197 passed-in table, and points the iterator at the table.
3198 (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
3199 the passed-in table.
3201 * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
3203 2006-01-17 Justin Garcia <justin.garcia@apple.com>
3207 Deployment builds now use -O2
3209 * JavaScriptCore.xcodeproj/project.pbxproj:
3211 2006-01-17 Darin Adler <darin@apple.com>
3215 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
3216 change RefPtr so that it works when deref ends up deleting the RefPtr
3218 * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
3219 * kxmlcore/RefPtr.h: Ditto.
3221 2006-01-16 Geoffrey Garen <ggaren@apple.com>
3225 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
3226 DateProtoFuncImp::callAsFunction can crash due to lack of type checking
3228 * kjs/date_object.cpp:
3229 (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods.
3230 This matches section 15.9.5 in the spec.
3232 2006-01-16 Tim Omernick <timo@apple.com>
3234 Reviewed by John Sullivan.
3236 JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
3238 * bindings/npruntime.cpp:
3239 (_NPN_ReleaseObject):
3240 Refactored part of this function out into _NPN_DeallocateObject.
3241 (_NPN_DeallocateObject):
3242 Forcibly deallocates the passed object, even if its refcount is
3245 * bindings/npruntime_impl.h:
3246 Declared _NPN_DeallocateObject().
3248 2006-01-16 Darin Adler <darin@apple.com>
3252 - fix problem with ++, ==, and != on const iterators in
3253 HashMaps that are using the pointer specialization
3255 * kxmlcore/HashMapPtrSpec.h:
3256 (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
3257 (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
3258 (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
3260 2006-01-15 Alexey Proskuryakov <ap@nypop.com>
3264 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
3265 run-javascriptcore-tests doesn't work
3267 * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm:
3268 Changed revision number to 1.8 (broken by svn migration).
3270 2006-01-14 David Kilzer <ddkilzer@kilzer.net>
3272 Reviewed and landed by Anders.
3274 * kjs/create_hash_table: Fixed comment typo.
3276 2006-01-13 Maks Orlovich <maksim@kde.org>
3278 Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
3280 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
3281 Misc. array object fixes from KJS
3283 * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
3284 (ArrayInstance::getOwnPropertySlot): Ditto.
3285 (ArrayInstance::deleteProperty): Ditto.
3286 (ArrayInstance::put): Ditto.
3287 (ArrayInstance::propList): Added a FIXME comment.
3288 (ArrayInstance::put): Throw exception on trying to set invalid array length.
3289 (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
3290 * kjs/array_object.h: Added MAX_ARRAY_INDEX.
3292 2006-01-13 Darin Adler <darin@apple.com>
3294 - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
3295 - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
3297 2006-01-13 Anders Carlsson <andersca@mac.com>
3301 * kjs/create_hash_table:
3302 Use correct size variables.
3304 2006-01-13 Anders Carlsson <andersca@mac.com>
3308 * kjs/create_hash_table:
3309 Don't create an empty entry array, instead add a entry with all fields
3310 set to null and set the hash table size to 1.
3314 Remove the hash table size check
3316 2006-01-12 Anders Carlsson <andersca@mac.com>
3320 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
3321 Crash when assigning a new function to a DOMParser object
3323 * JavaScriptCore.xcodeproj/project.pbxproj:
3324 Move lookup.cpp before lookup.h
3328 If the hash table is empty, return 0 early.
3330 2006-01-12 George Staikos <staikos@kde.org>
3334 * kjs/interpreter.cpp:
3336 * kjs/interpreter.h:
3337 Add helper to interpreter to call the collector in order to facilitate
3338 visibility rules in KDE.
3340 2006-01-12 George Staikos <staikos@kde.org>
3344 * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
3346 * kxmlcore/HashTable.h: Add missing assert.h
3348 2006-01-12 Darin Adler <darin@apple.com>
3352 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
3353 retire APPLE_CHANGES from JavaScriptCore
3355 * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
3356 APPLE_CHANGES and HAVE_CONFIG_H from all targets.
3358 * README: Removed. This had obsolete information in it
3359 and it wasn't clear what to replace it with.
3361 * kjs/collector.h: Removed an APPLE_CHANGES if around something
3362 that's not really platform-specific (although it does use a
3363 platform-specific API at the moment).
3364 * kjs/collector.cpp: Removed a mistaken comment.
3369 * kjs/operations.cpp:
3372 Use __APPLE__ instead of APPLE_CHANGES for code that should be
3373 used only on Mac OS X.
3375 * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
3376 of the runtime.h header. Even though that header isn't needed at the
3377 moment on platforms other than Mac OS X, the conditional stuff should
3378 be in the header itself, not in this one client.
3380 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
3381 code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
3382 any platform where pow is implemented corrrectly according to the IEEE
3383 standard. If it is needed on some, we can add it back with an appropriate
3384 #if for the platforms where it is needed.
3386 2006-01-12 Justin Haygood <justin@xiondigital.net>
3388 Reviewed, tweaked, and landed by Darin.
3390 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
3391 lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
3393 * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3394 quotes instead of angle brackets. Moved dtoa.h include to the top.
3395 Changed system header includes to use angle brackets instead of quotes.
3396 * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
3397 quotes instead of angle brackets.
3398 * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3399 quotes instead of angle brackets. Moved lexer.h include to the top.
3400 * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3401 quotes instead of angle brackets. Moved ustring.h include to the top.
3403 2006-01-12 George Staikos <staikos@kde.org>
3407 - Import initial QMake file. Doesn't fully work yet.
3409 2006-01-11 Ricci Adams <ricciadams@apple.com>
3411 Reviewed by Maciej and Darin, landed by Darin.
3413 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
3414 final comma in javascript object prevents parsing
3416 * kjs/grammar.y: Added rule to allow trailing comma in
3417 object construction.
3419 2006-01-11 Ricci Adams <ricciadams@apple.com>
3421 Reviewed by Geoff, landed by Darin.
3423 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
3424 Number.toFixed doesn't include leading 0
3426 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
3427 Fixed a "<" that should have been a "<=".
3429 2006-01-11 Ricci Adams <ricciadams@apple.com>
3431 Reviewed by Geoff, landed by Darin.
3433 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
3434 Number.toFixed doesn't round 0.5 up
3436 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
3437 Fixed a ">" that should have been a ">=".
3439 2006-01-11 Justin Haygood <justin@xiondigital.net>
3441 Reviewed and landed by Darin.
3443 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6486
3444 JavaScriptCore should use system malloc on Windows
3446 * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
3448 2006-01-10 Darin Adler <darin@apple.com>
3450 * Makefile: Took out unneeded "export" line.
3451 * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
3452 MIME types, other small corrections).
3454 2006-01-09 Darin Adler <darin@apple.com>
3456 * Makefile.am: Removed.
3458 2006-01-07 Anders Carlsson <andersca@mac.com>
3462 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
3463 REGRESSION: JavaScript hang when comparing large array to null
3466 (KJS::JSObject::isEqualToNull):
3467 Add new function which returns true if an object should be treated as null when
3470 * kjs/operations.cpp:
3474 2006-01-07 Alexey Proskuryakov <ap@nypop.com>
3478 - Fix WebCore development build
3479 http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
3481 * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
3483 2006-01-06 Maciej Stachowiak <mjs@apple.com>
3487 - miscellaneous changes for 4% speedup on the JavaScript iBench
3488 http://bugzilla.opendarwin.org/show_bug.cgi?id=6396
3490 Changes mostly thanks to Maks Orlovich, tweaked a little by me.
3492 * kjs/create_hash_table: Use the same hash as the one used by Identifier.
3494 (KJS::FunctionImp::processParameters): Use the new List::copyFrom
3495 (KJS::ActivationImp::ActivationImp): track variable while iterating
3497 (KJS::StringImp::toObject): create StringInstance directly
3499 (KJS::List::copy): implement in terms of copyFrom
3500 (KJS::List::copyFrom): more efficient way to copy in another list
3503 (keysMatch): updated to work with identifier hash
3505 (Lookup::findEntry): ditto
3506 (Lookup::find): ditto
3509 2006-01-06 Maciej Stachowiak <mjs@apple.com>
3511 - fix development build failure from the previous checkin
3514 (KJS::ActivationImp::put): Use prototype() accessor in assert.
3516 2006-01-05 Maciej Stachowiak <mjs@apple.com>
3520 - fix remaining performance regression from Getter/Setter change
3521 http://bugzilla.opendarwin.org/show_bug.cgi?id=6249
3523 - Activation objects should not have __proto__ property
3524 http://bugzilla.opendarwin.org/show_bug.cgi?id=6395
3527 (KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
3528 skipping getter/setter handling and __proto__ handling, as well
3529 as inlining needed superclass stuff.
3530 (KJS::ActivationImp::put): Implement directly, skipping getter/setter,
3531 __proto__, and do canPut directly in PropertyMap::put since there's no
3532 static property table either.
3534 * kjs/property_map.cpp:
3535 (KJS::PropertyMap::put): Allow optionally inlining canPut check.
3536 * kjs/property_map.h:
3538 2006-01-04 Geoffrey Garen <ggaren@apple.com>
3540 Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
3542 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4921
3543 \u escape sequences in JavaScript identifiers
3545 * kjs/function_object.cpp:
3546 (FunctionObjectImp::construct):
3550 (Lexer::isWhiteSpace):
3551 (Lexer::isLineTerminator):
3552 (Lexer::isIdentStart):
3553 (Lexer::isIdentPart):
3555 (Lexer::scanRegExp):
3559 * tests/mozilla/expected.html: Updated test results.
3561 2005-12-30 Maciej Stachowiak <mjs@apple.com>
3563 No review, just test result update.
3565 * tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
3567 2005-12-30 Anders Carlsson <andersca@mac.com>
3571 - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6298
3572 Getter setter test is failing
3575 (KJS::JSObject::put):
3576 Rework the getter setter part. We now walk the prototype chain, checking for
3577 getter/setter properties and only take the slow path if any are found.
3579 2005-12-30 Maks Orlovich <maksim@kde.org>
3581 Reviewed and committed by Maciej.
3583 - Handle negative, FP numbers with non-10 radix in toString
3584 http://bugzilla.opendarwin.org/show_bug.cgi?id=6259
3586 (Merged from KJS, original work by Harri Porten)
3588 * kjs/number_object.cpp:
3589 (NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with
3590 negative numbers, floating point and very large numbers.
3592 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3594 Patch by Maks Orlovich, reviewed and landed by me.
3596 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6267
3597 Fix Number.prototype.toFixed/toExponential(undefined)
3599 * kjs/number_object.cpp:
3600 (NumberProtoFunc::callAsFunction):
3602 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3604 Patch by Maks Orlovich, Reviewed and landed by me.
3606 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6266
3607 Minor object naming updates (to match Mozilla, KJS)
3609 * kjs/number_object.cpp:
3610 * kjs/regexp_object.cpp:
3612 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3614 Patch by Maks Orlovich, reviewed by mjs.
3616 This has 2 very minor fixes, covered by KJS testsuite:
3617 1. Enumerates string indices in property list (with the same bug as array
3618 object has in corresponding code). This is a mozilla emulation thing.
3619 2. Permits properties with integer names in prototypes to be found
3621 * kjs/string_object.cpp:
3622 (StringInstance::getOwnPropertySlot):
3623 (StringInstanceImp::propList):
3624 * kjs/string_object.h:
3626 2005-12-26 Geoffrey Garen <ggaren@apple.com>
3630 - Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in
3631 KJS::BlockNode::deref
3633 http://bugzilla.opendarwin.org/show_bug.cgi?id=6233
3634 Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in
3637 This patch does four things:
3638 (1) Standardizes all our linked list nodes to use "next" as their next
3640 (2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
3641 to iteratively deref "next" pointers.
3642 (3) Standardizes our linked list nodes to use ListRefPtr<T> and
3643 implement the releaseNext() function used by ~ListRefPtr<T>().
3644 (4) Adds to RefPtr<T> the release() method used by releaseNext().
3646 - Modified existing mozilla test to ensure it would make deployment
3647 builds crash as well.
3649 * JavaScriptCore.xcodeproj/project.pbxproj:
3651 (ElementNode::evaluate):
3652 (PropertyListNode::evaluate):
3653 (ArgumentListNode::evaluateList):
3654 (StatListNode::StatListNode):
3655 (StatListNode::execute):
3656 (StatListNode::processVarDecls):
3657 (VarDeclListNode::evaluate):
3658 (VarDeclListNode::processVarDecls):
3659 (VarStatementNode::execute):
3660 (VarStatementNode::processVarDecls):
3661 (BlockNode::BlockNode):
3662 (CaseClauseNode::evalStatements):
3663 (CaseClauseNode::processVarDecls):
3664 (ClauseListNode::processVarDecls):
3665 (CaseBlockNode::CaseBlockNode):
3666 (CaseBlockNode::evalBlock):
3667 (SourceElementsNode::SourceElementsNode):
3668 (SourceElementsNode::execute):
3669 (SourceElementsNode::processFuncDecl):
3670 (SourceElementsNode::processVarDecls):
3672 (KJS::ElementNode::ElementNode):
3673 (KJS::ElementNode::releaseNext):
3674 (KJS::ArrayNode::ArrayNode):
3675 (KJS::PropertyListNode::PropertyListNode):
3676 (KJS::PropertyListNode::releaseNext):
3677 (KJS::ObjectLiteralNode::ObjectLiteralNode):
3678 (KJS::ArgumentListNode::ArgumentListNode):
3679 (KJS::ArgumentListNode::releaseNext):
3680 (KJS::ArgumentsNode::ArgumentsNode):
3681 (KJS::StatListNode::releaseNext):
3682 (KJS::VarDeclListNode::VarDeclListNode):
3683 (KJS::VarDeclListNode::releaseNext):
3684 (KJS::VarStatementNode::VarStatementNode):
3685 (KJS::ForNode::ForNode):
3686 (KJS::CaseClauseNode::CaseClauseNode):
3687 (KJS::ClauseListNode::ClauseListNode):
3688 (KJS::ClauseListNode::getClause):
3689 (KJS::ClauseListNode::getNext):
3690 (KJS::ClauseListNode::releaseNext):
3691 (KJS::ParameterNode::ParameterNode):
3692 (KJS::ParameterNode::releaseNext):
3693 (KJS::SourceElementsNode::releaseNext):
3694 * kjs/nodes2string.cpp:
3695 (ElementNode::streamTo):
3696 (PropertyListNode::streamTo):
3697 (ArgumentListNode::streamTo):
3698 (StatListNode::streamTo):
3699 (VarDeclListNode::streamTo):
3700 (VarStatementNode::streamTo):
3701 (CaseClauseNode::streamTo):
3702 (ClauseListNode::streamTo):
3703 (CaseBlockNode::streamTo):
3704 (SourceElementsNode::streamTo):
3705 * kxmlcore/ListRefPtr.h: Added.
3706 (KXMLCore::ListRefPtr::ListRefPtr):
3707 (KXMLCore::ListRefPtr::~ListRefPtr):
3708 (KXMLCore::ListRefPtr::operator=):
3709 * kxmlcore/RefPtr.h:
3710 (KXMLCore::RefPtr::release):
3712 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3716 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4026
3717 Math.random() not seeded.
3719 Added call to sranddev() -- it executes the first time a process
3720 calls Math.random().
3722 * kjs/math_object.cpp:
3723 (MathFuncImp::callAsFunction):
3725 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3729 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6265
3730 Name change regression: Java doesn't know what JavaJSObject is
3732 Changed strings passed to Java back to original "JSObject".
3734 * bindings/jni/jni_jsobject.cpp:
3735 (JavaJSObject::convertValueToJObject):
3736 (JavaJSObject::convertJObjectToValue):
3738 2005-12-28 Anders Carlsson <andersca@mac.com>
3742 - The JSC part of http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
3743 Add undetectable document.all
3745 * kjs/operations.cpp:
3747 When comparing an object with null or undefined, call toPrimitive with
3748 NullType as the preferred type.
3750 2005-12-27 Anders Carlsson <andersca@mac.com>
3754 * kjs/array_object.cpp:
3755 (ArrayProtoFunc::callAsFunction):
3756 Implement filter and map. Also, make the existing
3757 array iteration functions not invoke the callback for
3758 non-existing properties, just as Mozilla does now.
3760 * kjs/array_object.h:
3761 (KJS::ArrayProtoFunc::):
3764 * tests/mozilla/expected.html:
3765 Update, two 1.6 tests now pass.
3767 2005-12-27 Maciej Stachowiak <mjs@apple.com>
3769 - updated test results for new JS 1.6 tests
3771 * tests/mozilla/expected.html:
3773 2005-12-27 Anders Carlsson <andersca@mac.com>
3777 Add Mozilla JS 1.6 tests.
3779 * tests/mozilla/js1_6/Array/browser.js: Added.
3780 * tests/mozilla/js1_6/Array/regress-290592.js: Added.
3781 * tests/mozilla/js1_6/Array/regress-304828.js: Added.
3782 * tests/mozilla/js1_6/Array/regress-305002.js: Added.
3783 * tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
3784 * tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
3785 * tests/mozilla/js1_6/Array/regress-320887.js: Added.
3786 * tests/mozilla/js1_6/Array/shell.js: Added.
3787 * tests/mozilla/js1_6/README: Added.
3788 * tests/mozilla/js1_6/Regress/browser.js: Added.
3789 * tests/mozilla/js1_6/Regress/regress-301574.js: Added.
3790 * tests/mozilla/js1_6/Regress/regress-309242.js: Added.
3791 * tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
3792 * tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
3793 * tests/mozilla/js1_6/Regress/regress-314887.js: Added.
3794 * tests/mozilla/js1_6/Regress/regress-320172.js: Added.
3795 * tests/mozilla/js1_6/Regress/shell.js: Added.
3796 * tests/mozilla/js1_6/String/browser.js: Added.
3797 * tests/mozilla/js1_6/String/regress-306591.js: Added.
3798 * tests/mozilla/js1_6/String/shell.js: Added.
3799 * tests/mozilla/js1_6/browser.js: Added.
3800 * tests/mozilla/js1_6/shell.js: Added.
3801 * tests/mozilla/js1_6/template.js: Added.
3803 2005-12-27 Maks Orlovich <maksim@kde.org>
3805 Reviewed and landed by Maciej.
3807 - fixed 6234: Can delete array index property incorrectly.
3808 http://bugzilla.opendarwin.org/show_bug.cgi?id=6234
3810 * kjs/array_object.cpp:
3811 (ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
3812 looking for array properties.
3814 2005-12-27 Anders Carlsson <andersca@mac.com>
3819 (KJS::JSObject::defineSetter):
3820 Remove duplicate call to putDirect.
3822 2005-12-26 Maciej Stachowiak <mjs@apple.com>
3824 Reviewed by Darin and Geoff.
3826 Changes by me and Anders.
3828 - mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
3829 http://bugzilla.opendarwin.org/show_bug.cgi?id=6083
3831 - also fixed some warnings reported by -Winline
3833 * JavaScriptCorePrefix.h: Move new and delete definitions higher so there
3834 aren't conflicts with use in standard C++ headers
3836 (KJS::throwSetterError): Moved this piece of put into a seprate function
3837 to avoid the PIC branch.
3838 (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
3839 when not needed. Also use GetterSetter properties attribute.
3840 (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
3841 properties any more, if this one was one.
3842 (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
3843 properties now (and use the new attribute).
3844 (KJS::JSObject::defineSetter): Ditto.
3845 (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
3846 to avoid global variable access in the hot code path.
3848 (KJS::): Added GetterSetter attribute.
3849 (KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
3850 (KJS::JSValue::isObject): ditto
3851 (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
3852 as much as possible in the case where they are not being used
3853 * kjs/property_map.cpp:
3854 (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
3855 * kjs/property_map.h:
3856 (KJS::PropertyMap::hasGetterSetterProperties): Ditto
3857 (KJS::PropertyMap::setHasGetterSetterProperties): Ditto
3858 (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
3859 global "has getter/setter properties" flag in the property map
3860 single entry, to avoid making objects any bigger.
3861 * kjs/value.h: Moved some things to object.h to make -Winline happier
3863 2005-12-24 Maciej Stachowiak <mjs@apple.com>
3865 Reviewed by Eric and Dave Hyatt.
3867 - make even const PassRefPtrs give transfer of ownership semantics
3868 http://bugzilla.opendarwin.org/show_bug.cgi?id=6238
3870 This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
3871 in assignment and copy construction. And this makes life way easier and removes
3872 the need for pass(). It is not really correct, but we pretty much never need a real
3873 const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
3875 * kjs/identifier.cpp:
3876 (KJS::Identifier::add): No more need for pass()
3877 * kjs/property_map.cpp:
3878 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
3880 (KJS::UString::Rep::create): Use adoptRef
3881 (KJS::UString::UString): No more need for pass
3882 (KJS::UString::append): No more need for pass
3883 (KJS::UString::substr): No more need for pass
3884 * kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
3885 (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
3886 (KXMLCore::PassRefPtr::release): Made this a const method (ugh)
3887 (KXMLCore::PassRefPtr::operator=): clean up appropriately
3888 (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
3889 it makes the behavior more clear and it is less verbose.
3890 (KXMLCore::static_pointer_cast): use adoptRef
3891 (KXMLCore::const_pointer_cast): use adoptRef
3892 * kxmlcore/RefPtr.h:
3893 (KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
3894 (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
3896 2005-12-25 Eric Seidel <eseidel@apple.com>
3900 Unbreak HashTableConstIterator++ by returning const_iterator
3902 * kxmlcore/HashTable.h:
3903 (KXMLCore::HashTableConstIterator::operator++): use const_iterator
3905 2005-12-25 Eric Seidel <eseidel@apple.com>
3909 Un-break HashTable copy constructor.
3911 * kxmlcore/HashTable.h:
3912 (KXMLCore::::HashTable): use const_iterator instead
3914 2005-12-23 Maciej Stachowiak <mjs@apple.com>
3918 - fixed "HashMap does not work with const pointer keys or values"
3919 http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
3921 * kxmlcore/HashMapPtrSpec.h:
3922 (KXMLCore::HashMap): In all methods, explicitly cast all pointers
3923 to void * before passing to internal implementation. Use C-style
3924 casts instead of new-style casts, because the real solution would
3925 require a combo of reinterpret_cast anc const_cast.
3928 2005-12-23 Maciej Stachowiak <mjs@apple.com>
3930 - this time for sure
3932 * kxmlcore/RefPtr.h:
3935 2005-12-22 Maciej Stachowiak <mjs@apple.com>
3937 - fix build problem from last commit.
3939 * kxmlcore/RefPtr.h:
3942 2005-12-21 Maciej Stachowiak <mjs@apple.com>
3946 - Make HashMap/HashSet support non-POD types
3947 http://bugzilla.opendarwin.org/show_bug.cgi?id=5332
3949 The changes for support are relatively simple, but I also made extensive changes to
3950 avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
3952 * kxmlcore/HashTable.h:
3953 (KXMLCore::swap): specialize swap for pairs, to swap elements individually,
3954 so that excess copies can be avoided.
3955 (KXMLCore::Mover::move): Template function to either copy or swap, used
3956 when transferring elements from old table to new.
3957 (KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
3958 that took two or three function parameters now take a class parameter, this is
3959 the class used to do a normal lookup.
3960 (KXMLCore::IdentityHashTranslator::equal): Ditto.
3961 (KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
3962 to write into instead of returning a value to avoid redundant copies.
3963 (KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
3964 (KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
3965 functions. Added a FIXME about a remaining rare excess copy.
3966 (KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
3967 the key from Traits, to avoid creating and destroying pair, which copies.
3968 (KXMLCore::HashTable::isDeletedBucket): ditto
3969 (KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
3970 (KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
3971 work right for non-POD types.
3972 (KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
3973 (KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
3974 (KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
3975 (KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
3976 (KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
3977 (KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
3978 (KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
3980 * kxmlcore/HashFunctions.h:
3981 (KXMLCore::PointerHash): Specialize PointerHash for RefPtr
3982 * kxmlcore/HashMap.h:
3983 (KXMLCore::extractFirst): Return a reference not a full object to avoid
3985 (KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
3986 to defer making the pair as long as possible, thus avoiding needless copies.
3987 (KXMLCore::HashMapTranslator::equal): ditto
3988 (KXMLCore::HashMapTranslator::translate): ditto
3989 (KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
3990 (KXMLCore::::set): Use inlineAdd
3991 (KXMLCore::::add): Use inlineAdd
3992 * kxmlcore/HashMapPtrSpec.h:
3993 (KXMLCore::): Pass KeyTraits along
3994 * kxmlcore/HashSet.h:
3995 (KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
3996 (KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
3997 the new HashTranslator approach.
3998 (KXMLCore::HashSetTranslatorAdapter::equal): ditto
3999 (KXMLCore::HashSetTranslatorAdapter::translate): ditto
4000 (KXMLCore::::insert): ditto
4001 * kxmlcore/HashTraits.h:
4002 (KXMLCore::GenericHashTraits): This is intended be used as a base class for
4003 customized traits: sensible defaults.
4004 (KXMLCore::): Use it a bunch
4005 (KXMLCore::assignDeleted): template function to allow pairs to be assigned the
4006 deleted value w/o excess copies.
4007 (KXMLCore::PairHashTraits::emptyValue): Updated
4008 (KXMLCore::PairHashTraits::deletedValue): Updated
4009 (KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
4010 (KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
4011 to either use use deletedValue or assignDeletedValue for the cases where we care.
4012 * kxmlcore/RefPtr.h:
4013 (KXMLCore::RefPtr::swap): Added swap method.
4014 (KXMLCore::swap): Added swap free function.
4015 * kjs/identifier.cpp:
4016 (KJS::CStringTranslator::hash): Use new HashTranslator class approach to
4017 alternate type based insertion.
4018 (KJS::CStringTranslator::equal): ditto
4019 (KJS::CStringTranslator::translate): ditto
4020 (KJS::Identifier::add): ditto
4021 (KJS::UCharBufferTranslator::hash): ditto
4022 (KJS::UCharBufferTranslator::equal): ditto
4023 (KJS::UCharBufferTranslator::translate): ditto
4025 - irrelevant change:
4027 * kjs/array_object.cpp:
4028 (ArrayProtoFunc::callAsFunction): Removed a stray space.
4030 2005-12-22 Anders Carlsson <andersca@mac.com>
4032 Reviewed by Eric and Darin.
4034 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
4035 Would like to be able to define prototypes in headers
4038 Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
4039 Also, namespace all macros by prefixing them with KJS_.
4041 2005-12-22 Darin Adler <darin@apple.com>
4045 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6191
4046 RefPtr/PassRefPtr have a leak issue, operator== issues
4048 * kxmlcore/PassRefPtr.h:
4049 (KXMLCore::PassRefPtr::PassRefPtr): Remove non-template constructor that takes RefPtr
4050 since the constructor template that takes RefPtr should be sufficient. Add a constructor
4051 template that takes PassRefPtr&.
4052 (KXMLCore::PassRefPtr::adopt): Use PassRefPtr_Ref to avoid setting pointer first to
4053 0 and then to the pointer.
4054 (KXMLCore::PassRefPtr::operator=): Added template versions that take PassRefPtr& and
4056 (KXMLCore::PassRefPtr::operator PassRefPtr<U>): Changed to fix leak -- old version
4057 would release and then ref.
4058 (KXMLCore::operator==): Make templates have two parameters so you can mix types.
4059 Also remove unneeded const in raw pointer versions.
4060 (KXMLCore::operator!=): Ditto.
4062 * kxmlcore/RefPtr.h:
4063 (KXMLCore::RefPtr::RefPtr): Add constructor template that takes PassRefPtr.
4064 (KXMLCore::RefPtr::operator=): Add assignment operator templates that take
4065 RefPtr and PassRefPtr.
4066 (KXMLCore::operator==): Make templates have two parameters so you can mix types.
4067 Also remove unneeded const in raw pointer versions.
4068 (KXMLCore::operator!=): Ditto.
4070 2005-12-21 Timothy Hatcher <timothy@apple.com>
4072 * JavaScriptCore.xcodeproj/project.pbxproj:
4073 Set tab width to 8, indent width to 4 and uses tabs to false per file.
4075 2005-12-21 Geoffrey Garen <ggaren@apple.com>
4079 Removed evil hack for determining if a type is an integer, replaced
4080 with template metaprogramming.
4082 * JavaScriptCore.xcodeproj/project.pbxproj: Set tab size to 2 for
4085 (main): Inserted asserts to test IsInteger. FIXME: Move these to
4086 KXMLCore unit tests directory when we create one.
4087 * kxmlcore/HashTraits.h:
4088 (KXMLCore::): Added IsInteger class for querying types.
4090 2005-12-20 Maciej Stachowiak <mjs@apple.com>
4094 - made ALWAYS_INLINE declare things inline as well as __attribute__((always_inline))
4095 http://bugzilla.opendarwin.org/show_bug.cgi?id=6159
4097 * kxmlcore/AlwaysInline.h:
4099 2005-12-19 Maciej Stachowiak <mjs@apple.com>
4103 - fixed a leak in the assignment operator from PassRefPtr to RefPtr
4104 http://bugzilla.opendarwin.org/show_bug.cgi?id=6158
4106 * kxmlcore/RefPtr.h:
4107 (KXMLCore::RefPtr::operator=):
4109 - fix problem with PassRefPtr that darin spotted - it lacked a copy constructor
4110 and therefore was using the default one, which can lead to excess derefs
4112 I fixed this by adding a copy constructor from non-const
4113 reference, and by adding a template pass() function that you have
4114 to use when raw pointer or RefPtr are passed where PassRefPtr is
4117 * kjs/identifier.cpp:
4118 (KJS::Identifier::add): Changed to have PassRefPtr return type and
4121 * kjs/property_map.cpp:
4122 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Use