1 2006-05-22 Timothy Hatcher <timothy@apple.com>
3 Reviewed by Eric, Kevin and Geoff.
5 Merge open source build fixes. <rdar://problem/4555500>
7 * kjs/collector.cpp: look at the rsp register in x86_64
8 (KJS::Collector::markOtherThreadConservatively):
9 * wtf/Platform.h: add x86_64 to the platform list
11 2006-05-19 Anders Carlsson <acarlsson@apple.com>
15 http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
16 Support function declaration in case statements
18 * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
21 (CaseClauseNode::evalStatements):
22 (CaseClauseNode::processVarDecls):
23 (CaseClauseNode::processFuncDecl):
24 (ClauseListNode::processFuncDecl):
25 (CaseBlockNode::processFuncDecl):
26 (SwitchNode::processFuncDecl):
28 (KJS::CaseClauseNode::CaseClauseNode):
29 (KJS::ClauseListNode::ClauseListNode):
30 (KJS::ClauseListNode::getClause):
31 (KJS::ClauseListNode::getNext):
32 (KJS::ClauseListNode::releaseNext):
33 (KJS::SwitchNode::SwitchNode):
34 Add processFuncDecl for the relevant nodes.
36 * kjs/nodes2string.cpp:
37 (CaseClauseNode::streamTo):
38 next got renamed to source.
40 2006-05-17 George Staikos <staikos@kde.org>
42 Reviewed by Maciej, Alexey, and Eric.
44 * pcre/pcre_compile.c:
48 Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
51 Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
53 * wtf/unicode/qt4/UnicodeQt4.h:
54 Use correct parentheses and correct mask for utf-32 support.
56 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
60 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
61 Crash typing in Yahoo auto-complete widget.
63 Test: fast/js/regexp-stack-overflow.html
65 * pcre/pcre-config.h: Define NO_RECURSE.
67 2006-05-16 George Staikos <staikos@kde.org>
71 Fix some warnings and strict compilation errors.
76 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
78 * make-generated-sources.sh: Changed to be executable and removed
79 text in the file generated by "svn diff".
81 2006-05-15 Geoffrey Garen <ggaren@apple.com>
85 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
86 a reserved word while parsing JavaScript (and other ECMA reserved
91 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
92 We treat "char" as a reserved word in JavaScript and firefox/IE do
95 (1) I unreserved most of the spec's "future reserved words" because
96 they're not reserved in IE or FF. (Most, but not all, because IE
97 somewhat randomly *does* reserve a few of them.)
98 (2) I made 'debugger' a legitimate statement that acts like an empty
99 statement because FF and IE support it.
102 * kjs/keywords.table:
104 2006-05-15 Tim Omernick <timo@apple.com>
106 Reviewed by John Sullivan.
108 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
110 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
111 determines the kind of graphics context created by the browser for the plugin, as well as
112 the Mac types of various Netscape Plugin API data structures.
114 There is a drawing model to represent the old QuickDraw-based API. It is used by default
115 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
117 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
118 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
121 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
122 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
124 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
126 NPRegion's type now depends on the drawing model specified by the plugin.
127 NP_Port is now only defined when QuickDraw is available.
128 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
130 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
132 Reviewed by Darin, landed by ap.
134 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
135 Bakefiles (and generated Makefiles) for wx and gdk ports
137 * make-generated-sources.sh:
138 Added script to configure environment to run DerivedSources.make
140 * JavaScriptCoreSources.bkl:
141 Added JavaScriptCore sources list for Bakefile.
144 Bakefile used to generate JavaScriptCore project files
145 (currently only used by wx and gdk ports)
147 2006-05-09 Steve Falkenburg <sfalken@apple.com>
150 Minor fixes to WTF headers.
154 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
155 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
156 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
157 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
159 2006-05-09 Maciej Stachowiak <mjs@apple.com>
161 Rubber stamped by Anders.
163 - renamed kxmlcore to wtf
169 * JavaScriptCore.xcodeproj/project.pbxproj:
170 * bindings/c/c_instance.cpp:
171 * bindings/objc/WebScriptObject.mm:
175 * kjs/array_object.cpp:
177 (KJS::Collector::registerThread):
181 (KJS::isStrWhiteSpace):
183 * kjs/identifier.cpp:
188 (Lexer::isWhiteSpace):
189 (Lexer::isIdentStart):
190 (Lexer::isIdentPart):
194 * kjs/number_object.cpp:
196 * kjs/property_map.cpp:
197 * kjs/property_map.h:
198 * kjs/string_object.cpp:
199 (StringProtoFunc::callAsFunction):
205 * kxmlcore/AlwaysInline.h: Removed.
206 * kxmlcore/Assertions.cpp: Removed.
207 * kxmlcore/Assertions.h: Removed.
208 * kxmlcore/FastMalloc.cpp: Removed.
209 * kxmlcore/FastMalloc.h: Removed.
210 * kxmlcore/FastMallocInternal.h: Removed.
211 * kxmlcore/Forward.h: Removed.
212 * kxmlcore/HashCountedSet.h: Removed.
213 * kxmlcore/HashFunctions.h: Removed.
214 * kxmlcore/HashMap.h: Removed.
215 * kxmlcore/HashSet.h: Removed.
216 * kxmlcore/HashTable.cpp: Removed.
217 * kxmlcore/HashTable.h: Removed.
218 * kxmlcore/HashTraits.h: Removed.
219 * kxmlcore/ListRefPtr.h: Removed.
220 * kxmlcore/Noncopyable.h: Removed.
221 * kxmlcore/OwnArrayPtr.h: Removed.
222 * kxmlcore/OwnPtr.h: Removed.
223 * kxmlcore/PassRefPtr.h: Removed.
224 * kxmlcore/Platform.h: Removed.
225 * kxmlcore/RefPtr.h: Removed.
226 * kxmlcore/TCPageMap.h: Removed.
227 * kxmlcore/TCSpinLock.h: Removed.
228 * kxmlcore/TCSystemAlloc.cpp: Removed.
229 * kxmlcore/TCSystemAlloc.h: Removed.
230 * kxmlcore/UnusedParam.h: Removed.
231 * kxmlcore/Vector.h: Removed.
232 * kxmlcore/VectorTraits.h: Removed.
233 * kxmlcore/unicode: Removed.
234 * kxmlcore/unicode/Unicode.h: Removed.
235 * kxmlcore/unicode/UnicodeCategory.h: Removed.
236 * kxmlcore/unicode/icu: Removed.
237 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
238 * kxmlcore/unicode/posix: Removed.
239 * kxmlcore/unicode/qt3: Removed.
240 * kxmlcore/unicode/qt4: Removed.
241 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
244 * wtf/Assertions.cpp:
246 * wtf/FastMalloc.cpp:
247 (WTF::TCMalloc_ThreadCache::Scavenge):
250 (WTF::TCMallocGuard::TCMallocGuard):
257 * wtf/FastMallocInternal.h:
259 * wtf/HashCountedSet.h:
260 * wtf/HashFunctions.h:
272 * wtf/TCSystemAlloc.cpp:
273 (TCMalloc_SystemAlloc):
275 * wtf/VectorTraits.h:
276 * wtf/unicode/UnicodeCategory.h:
277 * wtf/unicode/icu/UnicodeIcu.h:
279 2006-05-08 Timothy Hatcher <timothy@apple.com>
283 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
285 2006-05-07 Darin Adler <darin@apple.com>
287 Reviewed and landed by Maciej.
289 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
290 Random crashes on TOT since the form state change
292 I haven't figured out how to construct a test for this, but this does seem to fix the
293 problem; Mitz mentioned that a double-destroy was occurring in these functions.
295 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
296 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
297 destroys the element based on the storage type. The RefCounter template correctly does work
298 only in cases where ValueType and ValueStorageType differ and this class is what's used
299 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
300 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
302 2006-05-05 Darin Adler <darin@apple.com>
304 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
305 IE compatibility fix in date parsing
307 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
308 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
310 2006-05-04 Anders Carlsson <andersca@mac.com>
314 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
315 Would like a Vector::append that takes another Vector
318 (KXMLCore::::append):
319 New function that takes another array.
321 2006-05-02 Steve Falkenburg <sfalken@apple.com>
325 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
326 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
328 2006-05-02 Anders Carlsson <andersca@mac.com>
332 * kxmlcore/HashMap.h:
333 (KXMLCore::::operator):
336 2006-05-01 Tim Omernick <timo@apple.com>
338 Reviewed by Tim Hatcher.
340 <rdar://problem/4476875> Support printing for embedded Netscape plugins
343 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
344 and Mac OS X systems, as this is what plugins expect.
346 2006-05-01 Timothy Hatcher <timothy@apple.com>
350 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
352 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
353 imp->m_destructorIsThreadSafe" where we collect oversized cells.
355 We don't have a way to test PAC files yet, so there's no test attached.
358 (KJS::Collector::collect): test the thread when we collect oversized cells
360 2006-05-01 Tim Omernick <timo@apple.com>
364 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
366 * kxmlcore/Assertions.cpp:
367 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
369 2006-04-28 Steve Falkenburg <sfalken@apple.com>
373 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
376 (main): Suppress C runtime alerts
378 2006-04-28 Steve Falkenburg <sfalken@apple.com>
382 Suppress error reporting dialog that blocks Javascript tests from completing.
384 Real error is due to an overflow in the date/time handling functions that needs
385 to be addressed, but this will prevent the hang running the Javascript tests
386 on the build bot (along with the related changes).
389 (main): Suppress C runtime alerts
391 2006-04-27 Geoffrey Garen <ggaren@apple.com>
395 - Minor fixups I discovered while working on the autogenerator.
398 (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
399 compute a garbage address, and possibly crash.
401 (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
402 would be hidden entirely.
404 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
408 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
409 Compilation fixes for building on gcc 4.0.2, and without precomp headers
412 * kxmlcore/Assertions.cpp:
413 * kxmlcore/FastMalloc.cpp:
414 Added necessary headers to resolve compilation issues when not using
417 * kjs/value.h: Declare the JSCell class before friend declaration
418 to resolve compilation issues with gcc 4.0.2.
420 * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
421 other than KDE (previously only defined for Win and Mac OS)
423 2006-04-18 Eric Seidel <eseidel@apple.com>
427 Fix "new Function()" to correctly use lexical scoping.
428 Add ScopeChain::print() function for debugging.
429 <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
431 * kjs/function_object.cpp:
432 (FunctionObjectImp::construct):
433 * kjs/scope_chain.cpp:
434 (KJS::ScopeChain::print):
437 2006-04-14 James G. Speth <speth@end.com>
441 Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
442 http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
444 Adds a category to WebScriptObject with array accessors for KVC/KVO.
446 If super valueForKey: fails it will call valueForUndefinedKey:, which is
447 important because it causes the right behavior to happen with bindings using
448 the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
450 * bindings/objc/WebScriptObject.mm:
451 (-[WebScriptObject valueForKey:]):
452 (-[WebScriptObject count]):
453 (-[WebScriptObject objectAtIndex:]):
454 (-[WebUndefined description]): return "undefined"
456 2006-04-13 Geoffrey Garen <ggaren@apple.com>
461 (KJS::InterpreterImp::initGlobalObject): Add the built-in object
462 prototype to the end of the global object's prototype chain instead of
463 just blowing away its existing prototype. We need to do this because
464 the window object has a meaningful prototype now.
466 2006-04-13 Maciej Stachowiak <mjs@apple.com>
470 - fix testkjs to not show false-positive KJS::Node leaks in debug builds
476 2006-04-11 Geoffrey Garen <ggaren@apple.com>
480 Minor code cleanup -- passes all the JS tests.
482 * kjs/object_object.cpp:
483 (ObjectObjectImp::construct):
484 (ObjectObjectImp::callAsFunction):
486 2006-04-11 Darin Adler <darin@apple.com>
488 - another attempt to fix Windows build -- Vector in Forward.h was not working
490 * kxmlcore/Forward.h: Remove Vector.
491 * kxmlcore/Vector.h: Add back default arguments, remove include of
494 2006-04-11 Darin Adler <darin@apple.com>
496 - try to fix Windows build -- HashForward.h was not working
498 * kxmlcore/HashForward.h: Removed.
500 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
501 * kjs/collector.h: Remove use of HashForward.h.
502 * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
504 * kxmlcore/HashMap.h: Ditto.
505 * kxmlcore/HashSet.h: Ditto.
507 2006-04-11 David Harrison <harrison@apple.com>
511 - fixed clean build, broken by Darin's check-in
513 * kjs/date_object.cpp: Add needed include of lookup.h.
514 * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
516 2006-04-10 Darin Adler <darin@apple.com>
518 Rubber-stamped by John Sullivan.
520 - switched from a shell script to a makefile for generated files
521 - removed lots of unneeded includes
522 - added new Forward.h and HashForward.h headers that allow compiling with
523 fewer unneeded templates
525 * DerivedSources.make: Added.
526 * generate-derived-sources: Removed.
527 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
530 * kxmlcore/Forward.h: Added.
531 * kxmlcore/HashForward.h: Added.
533 * kxmlcore/HashCountedSet.h: Include HashForward for default args.
534 * kxmlcore/HashMap.h: Ditto.
535 * kxmlcore/HashSet.h: Ditto.
539 Moved KJS_MAX_STACK into the .cpp file.
541 * bindings/NP_jsobject.cpp:
542 * bindings/c/c_instance.h:
543 * bindings/jni/jni_class.h:
544 * bindings/jni/jni_runtime.h:
545 * bindings/jni/jni_utility.h:
546 * bindings/objc/WebScriptObject.mm:
547 * bindings/objc/WebScriptObjectPrivate.h:
548 * bindings/objc/objc_class.h:
549 * bindings/objc/objc_class.mm:
550 * bindings/objc/objc_instance.h:
551 * bindings/objc/objc_instance.mm:
552 * bindings/objc/objc_runtime.mm:
553 * bindings/objc/objc_utility.mm:
554 * bindings/runtime.h:
555 * bindings/runtime_array.cpp:
556 * bindings/runtime_array.h:
557 * bindings/runtime_method.cpp:
558 * bindings/runtime_method.h:
559 * bindings/runtime_object.cpp:
560 * bindings/runtime_root.h:
561 * kjs/JSImmediate.cpp:
563 * kjs/array_object.cpp:
564 * kjs/array_object.h:
565 * kjs/bool_object.cpp:
570 * kjs/error_object.h:
571 * kjs/function_object.h:
574 * kjs/math_object.cpp:
578 * kjs/number_object.cpp:
579 * kjs/number_object.h:
580 * kjs/object_object.cpp:
581 * kjs/operations.cpp:
582 * kjs/protected_reference.h:
584 * kjs/reference_list.h:
585 * kjs/regexp_object.h:
586 * kjs/string_object.cpp:
587 * kjs/string_object.h:
591 * kxmlcore/HashTable.h:
592 * kxmlcore/ListRefPtr.h:
593 * kxmlcore/TCPageMap.h:
595 Removed unneeded header includes.
597 2006-04-09 Geoffrey Garen <ggaren@apple.com>
601 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
602 prevent unnecessary entries in the "nodes with extra refs" hash table
604 This patch switches manually RefPtr exchange with use of
605 RefPtr::release to ensure that a node's ref count never tops 1
606 (in the normal case).
609 (BlockNode::BlockNode):
610 (CaseBlockNode::CaseBlockNode):
612 (KJS::ArrayNode::ArrayNode):
613 (KJS::ObjectLiteralNode::ObjectLiteralNode):
614 (KJS::ArgumentsNode::ArgumentsNode):
615 (KJS::VarStatementNode::VarStatementNode):
616 (KJS::ForNode::ForNode):
617 (KJS::CaseClauseNode::CaseClauseNode):
618 (KJS::FuncExprNode::FuncExprNode):
619 (KJS::FuncDeclNode::FuncDeclNode):
621 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
625 One more attempt - use reinterpret_cast, rather than static_cast.
627 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
631 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
633 * kxmlcore/unicode/icu/UnicodeIcu.h:
634 (KXMLCore::Unicode::toLower):
635 (KXMLCore::Unicode::toUpper):
637 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
641 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
642 toLowerCase and toUpperCase don't honor special mappings
644 Test: fast/js/string-capitalization.html
646 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
647 * icu/unicode/putil.h: Added (copied from WebCore).
648 * icu/unicode/uiter.h: Ditto.
649 * icu/unicode/ustring.h: Ditto.
650 * kjs/string_object.cpp:
651 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
652 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
653 * kjs/ustring.h: Ditto.
655 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
656 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
658 * kxmlcore/unicode/icu/UnicodeIcu.h:
659 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
660 (KXMLCore::Unicode::toUpper): Ditto.
661 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
662 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
663 (KXMLCore::Unicode::category): Ditto.
664 * kxmlcore/unicode/qt4/UnicodeQt4.h:
665 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
666 (KXMLCore::Unicode::toUpper): Ditto.
667 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
668 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
669 (KXMLCore::Unicode::category): Ditto.
671 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
672 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
674 2006-04-05 Darin Adler <darin@apple.com>
676 - attempt to fix Windows build
678 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
679 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
681 2006-04-05 Darin Adler <darin@apple.com>
683 - attempt to fix Windows build
685 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
687 2006-04-05 Darin Adler <darin@apple.com>
691 - fix memory leak introduced by the previous change
693 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
694 the value in question is a pair where one of the pair needs a ref and the other
695 of the pair does not.
697 2006-04-05 Darin Adler <darin@apple.com>
701 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
702 StringImpl hash traits deleted value creates an init routine for WebCore
703 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
705 Change HashMap and HashSet implementation so they fold various types together.
706 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
707 and WebCore::String in terms of the underlying raw pointer type, and hence use
708 -1 for the deleted value.
710 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
711 type to be used when storing a value that has the same layout as the type itself.
712 This is used only for non-key cases. In the case of keys, the hash function must also
713 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
714 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
715 explicit reference counting. If the type itself has needsRef true, but the storage
716 type has needsRef false, then the HashSet or HashMap has to handle the reference
717 counting explicitly. Added hash trait specializations for all signed integer values
718 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
719 integer type of the same size so int and long will share code. Gave all pointers and
720 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
721 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
722 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
723 Useful for types where we don't want to force the existence of deletedValue, such as
724 the type of a pair in a HashMap which is not the actual storage type. Removed an
725 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
726 template, which determines what type can be used to store a given hash key type with
727 a given hash function, and specialized it for pointers and RefPtr so that pointer
728 hash tables share an underlying HashTable that uses IntHash.
730 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
731 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
732 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
733 tables where the type stored is not the same as the real value type.
735 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
736 integer type given a sizeof value. Renamed pointerHash to intHash and made it
737 use overloading and take integer parameters. Added an IntHash struct which is
738 a hash function that works for integers. Changed PtrHash to call IntHash with
739 an appropriately sized integer. Made IntHash the default hash function for
740 many integer types. Made PtrHash the default hash function for RefPtr as well
743 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
744 derived from the new traits. The HashTable will use the storage type and all
745 necessary translation and ref/deref is done at the HashSet level. Also reorganized
746 the file so that the HashSet is at the top and has no inline implementation inside
747 it so it's easy to read the interface to HashSet.
749 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
750 derived from the new traits. The HashTable will use the storage type and all
751 necessary translation and ref/deref is done at the HashMap level. Also reorganized
752 the file so that the HashMap is at the top and has no inline implementation inside
753 it so it's easy to read the interface to HashMap.
755 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
757 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
758 and also remove some unnecessary build settings from the aggregate target that
759 generates derived sources.
760 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
762 2006-04-04 Timothy Hatcher <timothy@apple.com>
766 The Debug and Release frameworks are now built with install paths relative to the build products directory.
767 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
769 * JavaScriptCore.xcodeproj/project.pbxproj:
771 2006-04-04 Eric Seidel <eseidel@apple.com>
776 Disable ASSERT redefinition warnings for now.
778 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
779 * kxmlcore/Assertions.h:
781 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
783 Reviewed by ggaren & darin. Landed by eseidel.
785 Integrate CURL version of gettimeofday
786 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
787 Disable crash report dialogs for testkjs.exe in Release mode
788 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
793 (StopWatch::getElapsedMS):
797 2006-04-04 Eric Seidel <eseidel@apple.com>
801 * kjs/number_object.cpp:
802 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
804 2006-03-12 Maciej Stachowiak <mjs@apple.com>
808 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
809 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
811 * kjs/number_object.cpp:
812 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
813 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
814 plus a bit of refactoring.
816 2006-04-03 Darin Adler <darin@apple.com>
818 - tweak config.h and Platform.h to try to get buildbot working
819 (making some small changes at the same time)
821 * kjs/config.h: Removed now-unneeded HAVE_ICU.
822 * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
823 USE stuff to the end.
825 2006-04-03 George Staikos <staikos@opensource.apple.com>
829 Fix Win32 build breakage from previous commit, remove unused forward.
831 2006-04-03 George Staikos <staikos@opensource.apple.com>
835 Implement a unicode abstraction layer to make JavaScriptCore much more
836 easily ported to other platforms without having to take in libicu. Also
837 makes the unicode related code easier to understand.
839 2006-04-03 Timothy Hatcher <timothy@apple.com>
843 Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
844 Other 64 bit build fixes.
847 (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
849 (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
850 * bindings/jni/jni_utility.cpp:
851 (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
852 (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
853 * bindings/runtime_root.cpp:
854 (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
855 (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
857 2006-03-31 Darin Adler <darin@apple.com>
861 - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
863 * bindings/objc/WebScriptObject.h: Fixed comment.
865 2006-03-31 Eric Seidel <eseidel@apple.com>
869 A bit more code cleanup.
871 * bindings/c/c_utility.cpp:
872 (KJS::Bindings::convertValueToNPVariant):
873 * bindings/objc/objc_runtime.mm:
874 (convertValueToObjcObject):
875 * bindings/objc/objc_utility.mm:
876 (KJS::Bindings::convertValueToObjcValue):
878 (KJS::GlobalFuncImp::callAsFunction):
879 * kjs/interpreter.cpp:
880 (KJS::ExecState::lexicalInterpreter):
882 * kjs/operations.cpp:
885 2006-03-30 Eric Seidel <eseidel@apple.com>
889 Small code-style update.
891 * kjs/operations.cpp:
904 2006-03-31 Anders Carlsson <andersca@mac.com>
908 Make sure the GetterSetterImp objects are marked as well.
911 (KJS::GetterSetterImp::mark):
914 2006-03-30 Eric Seidel <eseidel@apple.com>
918 * kjs/nodes.h: Some various small style fixes.
920 2006-03-30 Eric Seidel <eseidel@apple.com>
924 Clean-up style issues in node.h, remove redundant initializations.
927 (KJS::StatementNode::evaluate):
928 (KJS::ArrayNode::ArrayNode):
929 (KJS::ObjectLiteralNode::ObjectLiteralNode):
930 (KJS::ArgumentsNode::ArgumentsNode):
931 (KJS::NewExprNode::NewExprNode):
932 (KJS::CaseClauseNode::CaseClauseNode):
933 (KJS::FuncDeclNode::FuncDeclNode):
935 2006-03-30 Tim Omernick <timo@apple.com>
939 <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
942 * bindings/runtime.h:
943 (KJS::Bindings::Instance::implementsCall):
944 New method. Returns false by default. Concrete subclasses can override this return true when
945 the bound object may be called as a function.
946 (KJS::Bindings::Instance::invokeDefaultMethod):
947 Since bound objects are no longer treated as functions by default, we can return jsUndefined()
948 here instead of in concrete subclasses that decide not to implement the default method
951 * bindings/runtime_object.cpp:
952 (RuntimeObjectImp::implementsCall):
953 Don't assume that the bound object is a function; instead, let the object instance decide whether
956 * bindings/c/c_instance.h:
957 * bindings/c/c_instance.cpp:
958 (KJS::Bindings::CInstance::implementsCall):
959 The object is callable if its class has an invokeDefault function.
961 * bindings/objc/objc_instance.h:
962 * bindings/objc/objc_instance.mm:
963 (ObjcInstance::implementsCall):
964 The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
966 * bindings/jni/jni_instance.h:
967 * bindings/jni/jni_instance.cpp:
968 Moved bogus invokeDefaultMethod() to superclass.
970 2006-03-29 Geoffrey Garen <ggaren@apple.com>
974 - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
975 Regression: crash in malloc_consolidate if you use a .PAC file
977 The crash was a result of threaded deallocation of thread-unsafe
978 objects. Pure JS objects are thread-safe because all JS execution
979 is synchronized through JSLock. However, JS objects that wrap WebCore
980 objects are thread-unsafe because JS and WebCore execution are not
981 synchronized. That unsafety comes into play when the collector
982 deallocates a JS object that wraps a WebCore object, thus causing the
983 WebCore object to be deallocated.
985 The solution here is to have each JSCell know whether it is safe to
986 collect on a non-main thread, and to avoid collecting unsafe cells
987 when on a non-main thread.
989 We don't have a way to test PAC files yet, so there's no test
990 attached to this patch.
993 (KJS::Collector::collect):
994 (1) Added the test "currentThreadIsMainThread ||
995 imp->m_destructorIsThreadSafe".
998 (KJS::gcProtectNullTolerant):
999 (KJS::gcUnprotectNullTolerant):
1001 (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
1002 m_destructorIsThreadSafe becomes another whole word, ruining the
1003 collector optimizations we've made based on the size of a JSObject.
1004 * kxmlcore/FastMalloc.cpp:
1005 (KXMLCore::currentThreadIsMainThread):
1006 (KXMLCore::fastMallocRegisterThread):
1007 * kxmlcore/FastMalloc.h:
1009 2006-03-28 Darin Adler <darin@apple.com>
1013 - change some code that resulted in init routines on Mac OS X -- if the framework has
1014 init routines it will use memory and slow down applications that link with WebKit
1015 even in cases where those applications don't use WebKit
1017 * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
1018 to use immediate numbers instead. Apparently, double constant expressions of the type we
1019 had here are evaluated at load time.
1021 * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
1022 ListImp, so go back to using a plain old pointer.
1023 (KJS::List::List): Set overflow to 0 when initializing ListImp.
1024 (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
1025 (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
1026 a swap of OwnArrayPtr.
1027 (KJS::List::copyFrom): Remove now-unneeded get().
1028 (KJS::List::copyTail): Ditto.
1030 * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
1031 a static initializer routine. Had to get rid of one level of constant to get the compiler
1032 to understand it could initialize without any code.
1034 - added a build step that checks for init routines
1036 * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
1037 was replaced by the generate-derived-sources script a while back. Added a custom build
1038 phase that invokes the check-for-global-initializers script.
1040 2006-03-28 Timothy Hatcher <timothy@apple.com>
1044 fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
1046 * bindings/npapi.h: added #defines after the #ifndefs
1048 2006-03-27 Maciej Stachowiak <mjs@apple.com>
1052 - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
1055 (Node::deref): take into account the case where the extra refcount table was never created
1057 2006-03-23 David Carson <dacarson@gmail.com>
1061 - JSObject in LiveConnect not working.
1062 http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
1064 * bindings/jni_jsobject.cpp:
1065 (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
1066 class, and the GetFieldID was using the wrong signature.
1068 2006-03-23 Darin Adler <darin@apple.com>
1074 * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
1075 Also add -Y 3 option for linker.
1077 2006-03-23 Darin Adler <darin@apple.com>
1081 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
1082 REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
1084 * kjs/object.h: Take function name, as well as source URL and line number, when
1085 using the special overloaded construct for making functions.
1086 * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
1087 * kjs/function_object.h: Ditto.
1088 * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
1089 constructing the function rather than null. Use "anonymous" when making a
1090 function using the default function constructor.
1092 * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
1093 a function declaration.
1097 * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
1099 2006-03-23 Darin Adler <darin@apple.com>
1103 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
1104 LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
1106 * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
1107 * bindings/c/c_utility.cpp:
1108 (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
1109 BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
1110 OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
1111 one case and remove a _NPN_ReleaseObject in another because this
1112 should return a retained value.
1113 (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
1114 NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
1116 * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
1117 CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
1118 * bindings/c/c_runtime.cpp:
1119 (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
1121 (KJS::Bindings::CField::name): Added. Returns the string from inside the
1123 (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
1124 on the result of getProperty after using it to fix a storage leak.
1125 (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
1126 after pasing a value to setProperty now that the conversion function does a retain.
1128 * bindings/c/c_instance.cpp:
1129 (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
1130 stack buffer. Removed special case for NPVARIANT_IS_VOID because the
1131 convertNPVariantToValue function handles that properly.
1132 (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
1134 * bindings/NP_jsobject.h: Formatting changes only.
1135 * bindings/NP_jsobject.cpp:
1136 (jsDeallocate): Changed parameter type so we don't need a function cast.
1137 (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
1138 (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1139 (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
1140 (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1142 * bindings/c/c_class.cpp: Formatting changes only.
1143 * bindings/c/c_class.h: Formatting changes only.
1145 * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
1146 NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
1147 NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
1148 NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
1149 NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
1150 NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
1151 NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
1152 NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
1153 NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
1154 NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
1155 * bindings/npruntime.cpp:
1156 (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
1157 integer dictionary since the default behavior is fine for integers.
1159 2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1161 Reviewed and landed by Maciej.
1163 - WebKit no longer builds with bison 2.1
1164 http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
1166 * generate-derived-sources: Handle generated header named either grammar.cpp.h
1169 2006-03-22 Maciej Stachowiak <mjs@apple.com>
1173 * JavaScriptCore.xcodeproj/project.pbxproj:
1175 2006-03-21 Maciej Stachowiak <mjs@apple.com>
1177 * kjs/generate-derived-sources: Set executable property.
1179 2006-03-21 Maciej Stachowiak <mjs@apple.com>
1183 Ensure that generated source dependencies are handled properly, as follows:
1185 - Made an external script that generates the sources into a
1186 DerivedSources dir in the build products directory.
1187 - Added a new build target that builds all the generated sources
1188 if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
1189 - Added the DerivedSources dir in question to the include path.
1190 - Added the new DerivedSources dir and its contents to the project as build-relative.
1192 * JavaScriptCore.xcodeproj/project.pbxproj:
1193 * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
1196 2006-03-11 Maciej Stachowiak <mjs@apple.com>
1200 - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
1201 http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
1204 (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
1206 2006-03-16 Maciej Stachowiak <mjs@apple.com>
1210 - tweaks to my change to redo KJS::Node refcounting
1216 (Node::clearNewNodes):
1219 2006-03-16 Darin Adler <darin@apple.com>
1223 - fixed Vector so that you can pass a reference to something in the vector
1224 to the append or insert functions
1226 * kxmlcore/Vector.h:
1227 (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
1228 and return the adjusted value of the pointer.
1229 (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
1230 adding the new element. Makes the case where the element moves when the vector
1232 (KXMLCore::Vector::insert): Ditto.
1234 2006-03-15 Eric Seidel <eseidel@apple.com>
1240 * kjs/date_object.cpp:
1241 (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
1243 2006-03-15 Eric Seidel <eseidel@apple.com>
1247 Fix CString copy constructor, fixes Date.parse("") on Win32.
1249 * kjs/date_object.cpp:
1250 (KJS::DateProtoFunc::callAsFunction):
1252 (KJS::CString::CString):
1253 (KJS::CString::operator=):
1255 2006-03-13 Maciej Stachowiak <mjs@apple.com>
1259 - KJS::Node and KJS::StatementNode are bigger than they need to be
1260 http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
1262 The memory usage of Node was reduced by 2 machine words per node:
1264 - sourceURL was removed and only kept on FunctionBodyNode. The
1265 source URL can only be distinct per function or top-level program node,
1266 and you always have one.
1268 - refcount was removed and kept in a separate hashtable when
1269 greater than 1. newNodes set represents floating nodes with
1270 refcount of 0. This helps because almost all nodes have a refcount of 1
1271 for almost all of their lifetime.
1273 * bindings/runtime_method.cpp:
1274 (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
1276 (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
1277 them at the appropriate time.
1279 (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
1281 (KJS::ContextImp::pushIteration): moved here from LabelStack
1282 (KJS::ContextImp::popIteration): ditto
1283 (KJS::ContextImp::inIteration): ditto
1284 (KJS::ContextImp::pushSwitch): ditto
1285 (KJS::ContextImp::popSwitch): ditto
1286 (KJS::ContextImp::inSwitch): ditto
1288 (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
1289 (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
1290 (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
1291 (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
1293 (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
1295 * kjs/function.h: Move body field from DeclaredFunctionImp to
1297 * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
1299 (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
1300 and m_switchDepth data members. New FunctionBodyNode* parameter - the
1301 function body provides source URL and SourceId.
1302 (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
1303 (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
1306 (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
1307 statement label stacks don't need these and it bloats their size. Put them
1308 in the ContextImp instead.
1309 * kjs/interpreter.cpp:
1310 (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
1311 * kjs/interpreter.h:
1312 (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
1313 (KJS::ExecState::context): ditto
1314 (KJS::ExecState::setException): Renamed _exception to m_exception
1315 (KJS::ExecState::clearException): ditto
1316 (KJS::ExecState::exception): ditto
1317 (KJS::ExecState::hadException): ditto
1318 (KJS::ExecState::ExecState): ditto both above renames
1320 (Node::Node): Removed initialization of line, source URL and refcount. Add to
1321 local newNodes set instead of involving parser.
1322 (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
1323 HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
1325 (Node::deref): ditto
1326 (Node::refcount): ditto
1327 (Node::clearNewNodes): Destroy anything left in the new nodes set.
1328 (currentSourceId): Inline helper to get sourceId from function body via context.
1329 (currentSourceURL): ditto for sourceURL.
1330 (Node::createErrorCompletion): use new helper
1331 (Node::throwError): ditto
1332 (Node::setExceptionDetailsIfNeeded): ditto
1333 (StatementNode::StatementNode): remove initialization of l0 and sid, rename
1335 (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
1336 (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
1337 (StatListNode::StatListNode): updated for setLoc changes
1338 (BlockNode::BlockNode): ditto
1339 (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
1340 (WhileNode::execute): ditto
1341 (ForNode::execute): ditto
1342 (ForInNode::execute): ditto
1343 (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
1344 (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
1345 (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
1346 (FunctionBodyNode::FunctionBodyNode): update for new setLoc
1347 (FunctionBodyNode::processFuncDecl): reindent
1348 (SourceElementsNode::SourceElementsNode): update for new setLoc
1350 (KJS::Node::lineNo): Renamed _line to m_line
1351 (KJS::StatementNode::firstLine): Use lineNo()
1352 (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
1353 (KJS::FunctionBodyNode::sourceId): added
1354 (KJS::FunctionBodyNode::sourceURL): added
1357 2006-03-14 Geoffrey Garen <ggaren@apple.com>
1359 - Fixed <rdar://problem/4478239> string sort puts "closed" before
1365 (KJS::compare): Inverted a < in order to treat the longer string as >
1368 2006-03-12 Alexey Proskuryakov <ap@nypop.com>
1372 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
1373 REGRESSION: Flash callback to JavaScript function not working.
1375 Test: plugins/invoke.html
1377 * bindings/c/c_utility.cpp:
1378 (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
1380 2006-03-08 Eric Seidel <eseidel@apple.com>
1384 Partially fix JS on win32 by fixing hash table generation.
1386 * kjs/create_hash_table: limit << results to 32 bits.
1388 (TestFunctionImp::callAsFunction):
1390 2006-03-07 Darin Adler <darin@apple.com>
1392 * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
1394 2006-03-07 Darin Adler <darin@apple.com>
1398 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
1399 unwanted output while running layout tests
1401 * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
1402 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
1403 to standard output. I think we should arrange for the error text to be in JavaScript
1404 exceptions instead at some point.
1405 * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
1406 too-large size rather than allocating a buffer smaller than requested.
1408 2006-03-06 David Carson <dacarson@gmail.com>
1410 Reviewed by Darin, landed by ap.
1412 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
1413 c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
1415 Tested with test case from:
1416 http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
1418 * bindings/c_utility.cpp
1419 (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
1420 * icu/unicode/ucnv.h: Copied from WebCore.
1421 * icu/unicode/ucnv_err.h: Ditto.
1422 * icu/unicode/uenum.h: Ditto.
1424 2006-03-05 Darin Adler <darin@apple.com>
1426 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
1428 2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
1430 Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
1432 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
1433 REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
1435 * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
1437 2006-03-05 Darin Adler <darin@apple.com>
1441 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
1442 get all references to KJS::Node out of internal.h
1444 * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
1446 * kjs/Parser.cpp: Added.
1447 * kjs/Parser.h: Added.
1449 * kjs/internal.cpp: Removed the Parser class.
1450 * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
1451 not used in this header.
1453 * kjs/nodes.h: Added an include of "Parser.h".
1454 * kjs/function.h: Added a declaration of FunctionBodyNode.
1456 2006-03-05 Geoffrey Garen <ggaren@apple.com>
1460 - JSC support for the fix for <rdar://problem/4467143> JavaScript
1461 enumeration of HTML element properties skips DOM node properties
1464 (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
1465 class definiton macro needs to know about the prototype's prototype so
1466 that the class constructor properly sets it.
1467 (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
1468 implementation macro does not need to know about the prototype's
1469 prototype, since getOwnPropertySlot should only look in the current
1470 object's property map, and not its prototype's.
1472 2006-03-05 Andrew Wellington <proton@wiretapped.net>
1474 Reviewed by Eric, landed by ap.
1476 - Remove unused breakpoint bool from StatementNodes. No test provided as
1477 there is no functionality change.
1480 (StatementNode::StatementNode):
1483 2006-03-03 Geoffrey Garen <ggaren@apple.com>
1487 - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at
1488 http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
1490 This regression was caused by my fix for 4448098. I failed to account for the
1491 deleted entry sentinel in the mehtod that saves the contents of a property map to
1492 the back/forward cache.
1494 Manual test in WebCore/manual-tests/property-map-save-crash.html
1496 * kjs/property_map.cpp:
1497 (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
1498 (KJS::isValid): New function: checks if a key is null or the deleted sentinel
1499 (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
1500 and a slight performance win
1501 (KJS::PropertyMap::clear):
1502 (KJS::PropertyMap::rehash):
1503 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1504 (KJS::PropertyMap::save): Check keys with isValid()
1506 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1508 - now fix mac build again
1510 * kjs/identifier.cpp:
1512 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1514 Rubber stamped by Anders and Eric.
1516 - add fpconst.cpp to win32 build, it is now needed
1518 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1521 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1525 - fix windows build, broken by my last patch
1527 * kjs/JSImmediate.cpp:
1528 * kjs/identifier.cpp:
1529 * kxmlcore/FastMalloc.cpp:
1530 * kxmlcore/Platform.h:
1532 2006-03-01 Maciej Stachowiak <mjs@apple.com>
1536 - Set up new prototype macros and avoid using #if without defined() in JSC
1538 Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
1539 are defined, and to separate core OS-level dependencies from operating environment
1540 dependencies so you can, e.g., build KDE on Mac or Windows.
1542 * kxmlcore/Platform.h: Added.
1544 - deploy them everywhere in JavaScriptCore
1546 * JavaScriptCore.xcodeproj/project.pbxproj:
1547 * bindings/jni/jni_utility.cpp:
1548 (KJS::Bindings::convertValueToJValue):
1549 * bindings/objc/WebScriptObject.mm:
1550 * bindings/objc/objc_instance.mm:
1551 (ObjcInstance::end):
1552 * bindings/softlinking.h:
1553 * bindings/testbindings.mm:
1556 * kjs/collector.cpp:
1557 (KJS::Collector::markCurrentThreadConservatively):
1558 (KJS::Collector::markOtherThreadConservatively):
1559 (KJS::Collector::markStackObjectsConservatively):
1561 * kjs/date_object.cpp:
1564 (KJS::DateProtoFunc::callAsFunction):
1565 (KJS::DateObjectImp::construct):
1572 * kjs/identifier.cpp:
1574 * kjs/interpreter.cpp:
1575 (KJS::Interpreter::evaluate):
1576 (KJS::Interpreter::createLanguageInstanceForValue):
1577 * kjs/interpreter.h:
1580 * kjs/math_object.cpp:
1583 * kjs/operations.cpp:
1590 (KJS::RegExp::RegExp):
1591 (KJS::RegExp::~RegExp):
1592 (KJS::RegExp::match):
1597 (StopWatch::getElapsedMS):
1600 * kxmlcore/AlwaysInline.h:
1601 * kxmlcore/Assertions.cpp:
1602 * kxmlcore/Assertions.h:
1603 * kxmlcore/FastMalloc.cpp:
1605 * kxmlcore/FastMalloc.h:
1606 * kxmlcore/FastMallocInternal.h:
1607 * kxmlcore/HashTable.h:
1608 * kxmlcore/TCPageMap.h:
1609 * kxmlcore/TCSpinLock.h:
1610 (TCMalloc_SpinLock::Lock):
1611 (TCMalloc_SpinLock::Unlock):
1612 (TCMalloc_SlowLock):
1613 * kxmlcore/TCSystemAlloc.cpp:
1614 (TCMalloc_SystemAlloc):
1615 * os-win32/stdint.h:
1617 2006-02-28 Geoffrey Garen <ggaren@apple.com>
1621 - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry
1622 placeholder to -1 from UString::Rep::null
1624 This turned out to be only a small speedup (.12%). That's within the
1625 margin of error for super accurate JS iBench, but Shark confirms the
1626 same, so I think it's worth landing.
1628 FYI, I also confirmed that the single entry optimization in
1629 PropertyMap is a 3.2% speedup.
1631 * kjs/property_map.cpp:
1632 (KJS::PropertyMap::~PropertyMap):
1633 (KJS::PropertyMap::clear):
1634 (KJS::PropertyMap::put):
1635 (KJS::PropertyMap::insert):
1636 (KJS::PropertyMap::rehash):
1637 (KJS::PropertyMap::remove):
1638 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1639 (KJS::PropertyMap::checkConsistency):
1640 * kjs/property_map.h:
1641 (KJS::PropertyMap::deletedSentinel):
1643 2006-02-27 Eric Seidel <eseidel@apple.com>
1645 Rubber-stamped by darin.
1647 Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
1649 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1651 2006-02-27 Eric Seidel <eseidel@apple.com>
1655 Fix Assertions.cpp to compile on win32.
1657 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1658 * kxmlcore/Assertions.cpp:
1660 2006-02-27 Eric Seidel <eseidel@apple.com>
1664 Made Assertions.cpp platform independent.
1665 Moved mac-specific logging logic up into WebCore.
1666 http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
1668 * JavaScriptCore.xcodeproj/project.pbxproj:
1669 * kxmlcore/Assertions.cpp: Added.
1670 * kxmlcore/Assertions.h:
1671 * kxmlcore/Assertions.mm: Removed.
1673 2006-02-27 Darin Adler <darin@apple.com>
1675 - fixed Mac Debug build, there was an unused parameter
1677 * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
1678 Remove parameter name.
1680 * kjs/debugger.h: Fixed comment.
1682 2006-02-27 Eric Seidel <eseidel@apple.com>
1686 * kxmlcore/Vector.h:
1687 (KXMLCore::deleteAllValues): fix unused variable warning
1689 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1693 - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
1694 http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
1696 * JavaScriptCore.xcodeproj/project.pbxproj:
1697 * bindings/NP_jsobject.cpp:
1699 (_NPN_InvokeDefault):
1703 (_NPN_RemoveProperty):
1706 * bindings/c/c_class.h:
1707 (KJS::Bindings::CClass::constructorAt):
1708 * bindings/c/c_utility.cpp:
1709 (KJS::Bindings::convertNPVariantToValue):
1710 * bindings/jni/jni_class.cpp:
1711 (JavaClass::methodsNamed):
1712 (JavaClass::fieldNamed):
1713 * bindings/jni/jni_instance.cpp:
1714 (JavaInstance::invokeDefaultMethod):
1715 * bindings/jni/jni_jsobject.cpp:
1716 * bindings/jni/jni_objc.mm:
1717 (-[NSObject KJS::Bindings::]):
1718 * bindings/objc/WebScriptObject.mm:
1719 (+[WebUndefined allocWithZone:]):
1720 (-[WebUndefined initWithCoder:]):
1721 (-[WebUndefined encodeWithCoder:]):
1722 (-[WebUndefined copyWithZone:]):
1723 * bindings/objc/objc_class.h:
1724 (KJS::Bindings::ObjcClass::constructorAt):
1725 * bindings/objc/objc_class.mm:
1726 (KJS::Bindings::ObjcClass::methodsNamed):
1727 (KJS::Bindings::ObjcClass::fallbackObject):
1728 * bindings/objc/objc_instance.mm:
1729 (ObjcInstance::getValueOfUndefinedField):
1730 * bindings/objc/objc_runtime.mm:
1731 (ObjcFallbackObjectImp::getOwnPropertySlot):
1732 (ObjcFallbackObjectImp::put):
1733 (ObjcFallbackObjectImp::canPut):
1734 (ObjcFallbackObjectImp::deleteProperty):
1735 (ObjcFallbackObjectImp::toBoolean):
1736 * bindings/runtime.cpp:
1737 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1738 * bindings/runtime.h:
1739 (KJS::Bindings::Instance::getValueOfUndefinedField):
1740 (KJS::Bindings::Instance::setValueOfUndefinedField):
1741 * bindings/runtime_array.cpp:
1742 (RuntimeArray::lengthGetter):
1743 (RuntimeArray::indexGetter):
1744 (RuntimeArray::put):
1745 (RuntimeArray::deleteProperty):
1746 * bindings/runtime_method.cpp:
1747 (RuntimeMethod::lengthGetter):
1748 (RuntimeMethod::execute):
1749 * bindings/runtime_object.cpp:
1750 (RuntimeObjectImp::fallbackObjectGetter):
1751 (RuntimeObjectImp::fieldGetter):
1752 (RuntimeObjectImp::methodGetter):
1753 (RuntimeObjectImp::put):
1754 (RuntimeObjectImp::canPut):
1755 (RuntimeObjectImp::deleteProperty):
1756 (RuntimeObjectImp::defaultValue):
1757 (RuntimeObjectImp::callAsFunction):
1758 * bindings/runtime_root.cpp:
1759 (performJavaScriptAccess):
1760 * kjs/array_object.cpp:
1761 (ArrayInstance::lengthGetter):
1762 (ArrayInstance::getOwnPropertySlot):
1763 (ArrayPrototype::ArrayPrototype):
1764 (ArrayPrototype::getOwnPropertySlot):
1765 * kjs/bool_object.cpp:
1766 (BooleanObjectImp::BooleanObjectImp):
1767 * kjs/date_object.cpp:
1768 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1769 (KJS::DateObjectFuncImp::callAsFunction):
1770 * kjs/error_object.cpp:
1771 (ErrorObjectImp::ErrorObjectImp):
1772 (NativeErrorPrototype::NativeErrorPrototype):
1773 (NativeErrorImp::NativeErrorImp):
1775 (KJS::FunctionImp::argumentsGetter):
1776 (KJS::FunctionImp::lengthGetter):
1777 (KJS::Arguments::mappedIndexGetter):
1778 (KJS::ActivationImp::argumentsGetter):
1779 (KJS::ActivationImp::put):
1780 * kjs/function_object.cpp:
1781 (FunctionObjectImp::FunctionObjectImp):
1783 (KJS::GetterSetterImp::toPrimitive):
1784 (KJS::GetterSetterImp::toBoolean):
1785 * kjs/interpreter.cpp:
1786 (KJS::Interpreter::evaluate):
1787 * kjs/interpreter.h:
1788 (KJS::Interpreter::isGlobalObject):
1789 (KJS::Interpreter::interpreterForGlobalObject):
1790 (KJS::Interpreter::isSafeScript):
1792 (Lexer::makeIdentifier):
1793 (Lexer::makeUString):
1795 (KJS::staticFunctionGetter):
1796 (KJS::staticValueGetter):
1798 (StatementNode::processFuncDecl):
1799 (PropertyNode::evaluate):
1800 (PropertyNameNode::evaluate):
1801 * kjs/number_object.cpp:
1802 (NumberObjectImp::NumberObjectImp):
1803 (NumberObjectImp::getOwnPropertySlot):
1805 (KJS::JSObject::defineGetter):
1806 (KJS::JSObject::defineSetter):
1807 (KJS::JSObject::hasInstance):
1808 (KJS::JSObject::propertyIsEnumerable):
1809 * kjs/object_object.cpp:
1810 (ObjectObjectImp::ObjectObjectImp):
1811 * kjs/property_slot.cpp:
1812 (KJS::PropertySlot::undefinedGetter):
1813 (KJS::PropertySlot::functionGetter):
1814 * kjs/reference.cpp:
1815 (KJS::Reference::getPropertyName):
1816 * kjs/reference_list.cpp:
1817 (ReferenceListIterator::operator++):
1818 * kjs/regexp_object.cpp:
1819 (RegExpObjectImp::RegExpObjectImp):
1820 (RegExpObjectImp::getValueProperty):
1821 (RegExpObjectImp::putValueProperty):
1822 * kjs/string_object.cpp:
1823 (StringInstance::lengthGetter):
1824 (StringInstance::indexGetter):
1825 (StringPrototype::StringPrototype):
1826 * kxmlcore/Assertions.mm:
1827 * kxmlcore/FastMalloc.cpp:
1828 (KXMLCore::TCMalloc_PageHeap::CheckList):
1829 * kxmlcore/HashTable.h:
1830 (KXMLCore::HashTableConstIterator::checkValidity):
1831 (KXMLCore::IdentityHashTranslator::translate):
1833 (pcre_get_stringnumber):
1835 2006-02-23 Darin Adler <darin@apple.com>
1837 - try to fix buildbot failure
1839 * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
1840 recompiled after additional inlining was introduced (Xcode bug?).
1842 2006-02-23 Geoffrey Garen <ggaren@apple.com>
1844 Reviewed by Darin, Maciej.
1846 - Inline some functions suggested by Shark. 2.9% speedup on super
1849 http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
1850 <rdar://problem/4448116>
1853 (KJS::ArgumentsNode::evaluateList):
1856 (KJS::ScopeChain::release):
1857 (KJS::JSObject::toPrimitive):
1858 * kjs/scope_chain.cpp:
1861 (KJS::UString::toArrayIndex):
1864 (KJS::JSValue::toObject):
1865 * kxmlcore/FastMalloc.cpp:
1866 (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
1867 (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
1869 2006-02-21 Eric Seidel <eseidel@apple.com>
1871 Added *.user to ignore list.
1873 2006-02-21 Eric Seidel <eseidel@apple.com>
1877 Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
1879 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1880 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
1882 2006-02-21 Eric Seidel <eseidel@apple.com>
1886 * kjs/testkjs.cpp: #if out timeval code on win32
1888 2006-02-21 Michael Emmel <mike.emmel@gmail.com>
1892 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
1893 TCPageMap.h would not compile for me because string.h was missing
1895 * kxmlcore/TCPageMap.h: Added <string.h> include.
1897 2006-02-21 Darin Adler <darin@apple.com>
1899 Reviewed by John Sullivan.
1901 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
1902 remove a bunch of extra implementsCall overrides
1904 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
1906 * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
1907 we'll get a compile error if some derived class neglects to implement it.
1909 * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
1910 of param, which is an OwnPtr so it gets initialized by default.
1912 * bindings/runtime_method.cpp:
1913 * bindings/runtime_method.h:
1914 * kjs/array_object.cpp:
1915 * kjs/array_object.h:
1916 * kjs/bool_object.cpp:
1917 * kjs/bool_object.h:
1918 * kjs/date_object.cpp:
1919 * kjs/date_object.h:
1920 * kjs/error_object.cpp:
1921 * kjs/error_object.h:
1924 * kjs/function_object.cpp:
1925 * kjs/function_object.h:
1926 * kjs/math_object.cpp:
1927 * kjs/math_object.h:
1928 * kjs/number_object.cpp:
1929 * kjs/number_object.h:
1930 * kjs/object_object.cpp:
1931 * kjs/object_object.h:
1932 * kjs/regexp_object.cpp:
1933 * kjs/regexp_object.h:
1934 * kjs/string_object.cpp:
1935 * kjs/string_object.h:
1936 Removed many rendundant implementations of implementsCall from subclasses of
1937 InternalFunctionImp.
1939 2006-02-21 Darin Adler <darin@apple.com>
1943 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
1946 2006-02-21 Darin Adler <darin@apple.com>
1948 Change suggested by Mitz.
1950 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
1951 REGRESSION: Methods do not execute
1953 * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
1954 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
1955 Return true. All the classes derived from InternalFunctionImp need
1956 to return true from this -- later we can remove all the extra
1957 implementations too.
1959 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1961 - fix build breakage caused by last-minute change to my patch
1965 2006-02-20 Maciej Stachowiak <mjs@apple.com>
1967 Reviewed by Geoff and Darin.
1969 Patch from Maks Orlovich, based on work by David Faure, hand-applied and
1970 significantly reworked by me.
1972 - Patch: give internal function names (KJS merge)
1973 http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
1975 * tests/mozilla/expected.html: Updated for newly fixed test.
1977 * kjs/array_object.cpp:
1978 (ArrayProtoFunc::ArrayProtoFunc):
1979 * kjs/array_object.h:
1980 * kjs/bool_object.cpp:
1981 (BooleanPrototype::BooleanPrototype):
1982 (BooleanProtoFunc::BooleanProtoFunc):
1983 * kjs/bool_object.h:
1984 * kjs/date_object.cpp:
1985 (KJS::DateProtoFunc::DateProtoFunc):
1986 (KJS::DateObjectImp::DateObjectImp):
1987 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1988 * kjs/error_object.cpp:
1989 (ErrorPrototype::ErrorPrototype):
1990 (ErrorProtoFunc::ErrorProtoFunc):
1991 * kjs/error_object.h:
1993 (KJS::FunctionImp::FunctionImp):
1994 (KJS::GlobalFuncImp::GlobalFuncImp):
1996 * kjs/function_object.cpp:
1997 (FunctionPrototype::FunctionPrototype):
1998 (FunctionProtoFunc::FunctionProtoFunc):
1999 (FunctionProtoFunc::callAsFunction):
2000 * kjs/function_object.h:
2002 (KJS::InterpreterImp::initGlobalObject):
2003 (KJS::InternalFunctionImp::InternalFunctionImp):
2005 (KJS::InternalFunctionImp::functionName):
2007 (KJS::staticFunctionGetter):
2008 (KJS::HashEntryFunction::HashEntryFunction):
2009 (KJS::HashEntryFunction::implementsCall):
2010 (KJS::HashEntryFunction::toBoolean):
2011 (KJS::HashEntryFunction::implementsHasInstance):
2012 (KJS::HashEntryFunction::hasInstance):
2013 * kjs/math_object.cpp:
2014 (MathFuncImp::MathFuncImp):
2015 * kjs/math_object.h:
2016 * kjs/number_object.cpp:
2017 (NumberPrototype::NumberPrototype):
2018 (NumberProtoFunc::NumberProtoFunc):
2019 * kjs/number_object.h:
2021 (KJS::JSObject::putDirectFunction):
2022 (KJS::Error::create):
2024 * kjs/object_object.cpp:
2025 (ObjectPrototype::ObjectPrototype):
2026 (ObjectProtoFunc::ObjectProtoFunc):
2027 * kjs/object_object.h:
2028 * kjs/regexp_object.cpp:
2029 (RegExpPrototype::RegExpPrototype):
2030 (RegExpProtoFunc::RegExpProtoFunc):
2031 * kjs/regexp_object.h:
2032 * kjs/string_object.cpp:
2033 (StringProtoFunc::StringProtoFunc):
2034 (StringObjectImp::StringObjectImp):
2035 (StringObjectFuncImp::StringObjectFuncImp):
2036 * kjs/string_object.h:
2038 2006-02-20 Geoffrey Garen <ggaren@apple.com>
2040 Reviewed by Darin, with help from Eric, Maciej.
2042 - More changes to support super-accurate JS iBench. Doesn't work on
2043 Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
2044 opendarwin.org/show_bug.cgi?id= 7399] about that.
2046 * kjs/interpreter.cpp:
2047 (KJS::Interpreter::evaluate): Print line numbers with exception output
2048 * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the
2049 way we roll with .cpp files.
2050 (StopWatch::StopWatch): New class. Provides microsecond-accurate
2052 (StopWatch::~StopWatch):
2055 (StopWatch::getElapsedMS):
2056 (TestFunctionImp::callAsFunction): Added missing return statement.
2057 Fixed up "run" to use refactored helper functions. Removed bogus
2058 return statement from "quit" case. Made "print" output to stdout
2059 instead of stderr because that makes more sense, and PERL handles
2061 (main): Factored out KXMLCore unit tests. Removed custom exception
2062 printing code because the interpreter prints exceptions for you. Added
2063 a "delete" call for the GlobalImp we allocate.
2064 (testIsInteger): New function, result of refacotring.
2065 (createStringWithContentsOfFile): New function, result of refactoring.
2066 Renamed "code" to "buffer" to match factored-out-ness.
2068 2006-02-20 Eric Seidel <eseidel@apple.com>
2072 Fix "Copy ICU DLLs..." phase.
2074 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2075 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2077 2006-02-19 Darin Adler <darin@apple.com>
2079 - renamed ERROR to LOG_ERROR to fix build
2080 presumably Maciej had this change and forgot to land it
2082 * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
2083 * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
2084 * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
2086 2006-02-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
2088 Test: fast/js/toString-exception.html
2092 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
2093 REGRESSION: fast/js/toString-overrides.html fails when run multiple times
2095 * kjs/array_object.cpp:
2096 (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
2099 2006-02-18 Darin Adler <darin@apple.com>
2103 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
2104 add insert and remove to KXMLCore::Vector
2106 * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
2107 insert and remove to slide elements within the vector. Also added
2108 "insert" and "remove" functions.
2110 2006-02-16 Geoffrey Garen <ggaren@apple.com>
2114 - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
2115 Bindings::Instance::deref when leaving page @ gigaom.com
2117 * bindings/c/c_instance.cpp:
2118 (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
2119 globally, we shouldn't delete it, so don't.
2121 2006-02-16 Timothy Hatcher <timothy@apple.com>
2123 Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
2124 warnings. Using <rdar://problem/4448350> to track this.
2126 * JavaScriptCore.xcodeproj/project.pbxproj:
2127 * bindings/objc/objc_jsobject.h: Removed empty file.
2128 * bindings/objc/objc_jsobject.mm: Removed empty file.
2130 2006-02-16 Tim Omernick <timo@apple.com>
2134 <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
2135 javascript disabled (7015)
2137 * bindings/NP_jsobject.cpp:
2138 (_NPN_CreateNoScriptObject):
2139 Returns an NPObject which is not bound to a JavaScript object. This kind of NPObject
2140 can be given to a plugin as the "window script object" when JavaScript is disabled.
2141 The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
2142 Because of this, none of the NPN_* functions called by the plugin on this "no script
2143 object" will cause entry into JavaScript code.
2144 (_NPN_InvokeDefault):
2145 Make sure the NPVariant is filled before returning from this function. This never
2146 mattered before because we never reached this case, having only created NPObjects of
2147 the class NPScriptObjectClass.
2155 * bindings/NP_jsobject.h:
2156 Declared _NPN_CreateNoScriptObject().
2158 2006-02-16 Darin Adler <darin@apple.com>
2160 Reviewed by me, change by Peter Kuemmel.
2162 * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
2163 checking for positive infinity (rolling in fix from KDE side).
2165 2006-02-15 Geoffrey Garen <ggaren@apple.com>
2167 Reviewed by Maciej, Eric.
2169 - JavaScriptCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
2170 crashes in DashboardClient at com.apple.JavaScriptCore:
2171 KJS::Bindings::ObjcFallbackObjectImp::type()
2173 WebCore and JavaScriptCore weren't sharing Instance objects very
2174 nicely. I made them use RefPtrs, and sent them to bed without dessert.
2176 * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
2177 (JavaInstance::~JavaInstance):
2178 (JObjectWrapper::JObjectWrapper):
2179 * bindings/jni/jni_instance.h:
2180 (KJS::Bindings::JObjectWrapper::ref):
2181 (KJS::Bindings::JObjectWrapper::deref):
2182 * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
2183 (JavaArray::~JavaArray):
2184 (JavaArray::JavaArray):
2185 * bindings/jni/jni_runtime.h:
2186 (KJS::Bindings::JavaArray::operator=):
2187 * bindings/objc/objc_runtime.h:
2188 - Prohibited copying because that would muss the ref count.
2189 - Prohibited construction without instance because an instance wrapper
2190 without an instance is almost certainly a bug.
2191 * bindings/objc/objc_runtime.mm:
2192 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2193 * bindings/runtime.cpp:
2194 (KJS::Bindings::Instance::Instance):
2195 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2196 (KJS::Bindings::Instance::createRuntimeObject):
2197 * bindings/runtime.h:
2198 (KJS::Bindings::Instance::ref):
2199 (KJS::Bindings::Instance::deref):
2200 * bindings/runtime_object.cpp:
2201 (RuntimeObjectImp::RuntimeObjectImp):
2202 (RuntimeObjectImp::fallbackObjectGetter):
2203 (RuntimeObjectImp::fieldGetter):
2204 (RuntimeObjectImp::methodGetter):
2205 (RuntimeObjectImp::getOwnPropertySlot):
2206 (RuntimeObjectImp::put):
2207 (RuntimeObjectImp::canPut):
2208 * bindings/runtime_object.h:
2209 - Removed ownsInstance data member because RefPtr takes care of
2210 instance lifetime now.
2211 - Prohibited copying because that would muss the ref count.
2212 - Prohibited construction without instance because an instance wrapper
2213 without an instance is almost certainly a bug.
2214 (KJS::RuntimeObjectImp::getInternalInstance):
2216 2006-02-15 Geoffrey Garen <ggaren@apple.com>
2220 - Applied the 4330457 change to CClass and ObjcClass as well.
2222 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2225 This change isn't as critical because CClass and ObjcClass objects get
2226 cached globally and never deleted, but it's good practice, in case we
2227 ever do decide to delete CClass and ObjcClass objects.
2229 This change requires prohibiting copying, because we don't do any
2230 intelligent ref-counting -- when a Class is destroyed, it destroys its
2231 methods and fields unconditionally. (Java classes already prohibited
2234 * bindings/c/c_class.cpp:
2235 - Merged _commonInit and _commonDelete into constructor and destructor.
2238 (CClass::methodsNamed): Added delete callbacks
2239 (CClass::fieldNamed): Added delete callbacks
2240 * bindings/c/c_class.h: Prohibited copying
2241 * bindings/c/c_instance.cpp:
2242 (KJS::Bindings::CInstance::getClass): Changed to use the preferred
2243 class factory method, to take advantage of the global cache.
2245 [ Repeated changes applied to CClass for ObjcClass: ]
2247 * bindings/objc/objc_class.h:
2248 * bindings/objc/objc_class.mm:
2249 (KJS::Bindings::ObjcClass::ObjcClass):
2250 (KJS::Bindings::ObjcClass::~ObjcClass):
2251 (KJS::Bindings::ObjcClass::methodsNamed):
2252 (KJS::Bindings::ObjcClass::fieldNamed):
2253 * bindings/objc/objc_runtime.h:
2254 (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
2255 variable to prevent bad CFRelease.
2256 (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
2257 if statement to prevent bad CFRelease.
2258 * bindings/objc/objc_runtime.cpp: Changed to use the preferred
2259 ObjectStructPtr, for clarity.
2261 2006-02-14 Geoffrey Garen <ggaren@apple.com>
2265 - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
2266 in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
2269 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2272 This was a memory leak in the bindings code. The leak was so extreme
2273 that it would cause Safari or the JVM to abort from lack of memory.
2274 Upon construction, Class objects create field and method objects,
2275 storing them in CFDictionaries. The bug was that upon destruction, the
2276 class objects released the dictionaries but didn't destroy the stored
2279 The fix is to supply CFDictionary callbacks for destroying the values
2280 added to the dictionary.
2282 * bindings/jni/jni_class.cpp:
2283 (JavaClass::JavaClass): Added delete callbacks
2284 * bindings/runtime.cpp: Added definitions for delete callbacks
2285 (KJS::Bindings::deleteMethodList):
2286 (KJS::Bindings::deleteMethod):
2287 (KJS::Bindings::deleteField):
2288 * bindings/runtime.h: Added declarations for delete callbacks
2290 2006-02-14 Timothy Hatcher <timothy@apple.com>
2294 Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
2295 behavior due to POSIX version of sh
2297 * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
2299 2006-02-13 Dave Hyatt <hyatt@apple.com>
2301 Fix Win32 bustage in JavaScriptCore.
2305 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2306 Add JSImmediate to the Win32 project.
2308 * kjs/JSImmediate.h:
2309 (KJS::JSImmediate::fromDouble):
2310 (KJS::JSImmediate::toDouble):
2311 (KJS::JSImmediate::NanAsBits):
2312 (KJS::JSImmediate::oneAsBits):
2313 Win32 needs explicit returns after abort() for non-void functions.
2317 Win32 catches a bug in testkjs! The "return 2" should actually
2318 have been a return false.
2321 The extern decls of NaN and Inf need to be const.
2323 === JavaScriptCore-521.7 ===
2325 2006-02-13 Timothy Hatcher <timothy@apple.com>
2329 Replaced the old NS_DURING exception blocking with @try/@catch.
2331 * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
2332 * bindings/objc/objc_instance.mm:
2333 (ObjcInstance::invokeMethod):
2334 (ObjcInstance::invokeDefaultMethod):
2335 (ObjcInstance::setValueOfUndefinedField):
2336 (ObjcInstance::getValueOfUndefinedField):
2337 * bindings/objc/objc_runtime.mm:
2338 (ObjcField::valueFromInstance):
2339 (ObjcField::setValueToInstance):
2340 (ObjcArray::setValueAt):
2341 (ObjcArray::valueAt):
2343 2006-02-13 Darin Adler <darin@apple.com>
2345 - fix a couple problems building on Windows, based on requests
2346 from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2348 * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
2349 to the standard uint32/64_t. Also removed curious "isIEEE()" function
2350 that checked the sizes of some types (and type sizes alone don't tell you if
2351 the floating point conforms to the IEEE-standard). Added missing include
2354 * kjs/property_slot.h: Added missing include of <assert.h>.
2356 2006-02-12 Geoffrey Garen <ggaren@apple.com>
2360 Cleaned up testkjs, added new "run" functionality to allow scripting
2361 tests from within JS. ("run" is a part of my new super-accurate
2364 No regressions in run-javascriptcore-tests.
2367 (GlobalImp::className):
2368 (TestFunctionImp::):
2369 (TestFunctionImp::callAsFunction):
2373 2006-02-11 Alexey Proskuryakov <ap@nypop.com>
2377 - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2378 RealPlayer.GetTitle() Crashes Safari/Dashboard
2380 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2381 Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1,
2382 because the latter encoding has holes, and conversion can still fail.
2384 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2388 - Inlined RefPtr assignment operators. .7% performance win on
2389 super-accurate JS iBench.
2391 * kxmlcore/RefPtr.h:
2392 (KXMLCore::::operator):
2394 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2396 No review needed, just a build fix. This time for sure.
2400 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2404 - Fixed build. As it goes without saying, I will not mention that I
2407 * JavaScriptCore.xcodeproj/project.pbxproj:
2408 * kjs/JSImmediate.cpp:
2409 (KJS::JSImmediate::toObject):
2411 2006-02-09 Geoffrey Garen <ggaren@apple.com>
2415 - Fixed <rdar://problem/4343730> Should switch ConstantValues (null,
2416 undefined, true, false) from JS objects to immediate values similar to
2419 2.0% performance gain on my new super-accurate version of JS iBench.
2420 (I promise to land a version of it soon.)
2422 The gist of the change:
2423 (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
2424 class (JSImmediate.h/.cpp), and it handles not only numbers but also
2425 null, undefined, true, and false.
2426 (2) JSImmediate provides convenience methods for the bit masking
2427 necessary to encode and decode immediate values.
2428 (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
2429 (4) JSCell no longer implements functions like getBoolean, because
2430 only a JSImmediate can be a boolean.
2431 (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
2432 and ALWAYS_INLINE is a non-portable option of last resort.
2433 (6) Type is now JSType, and it resides in its own file, JSType.h.
2434 Since I was there, I did some header include sorting as part of this
2437 The rest pretty much explains itself.
2439 * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
2440 added JSImmediate.h/.cpp.
2441 * bindings/c/c_instance.cpp:
2442 (KJS::Bindings::CInstance::defaultValue):
2443 * bindings/c/c_instance.h:
2444 * bindings/c/c_utility.cpp:
2445 (KJS::Bindings::convertValueToNPVariant):
2446 * bindings/jni/jni_instance.cpp:
2447 (JavaInstance::defaultValue):
2448 * bindings/jni/jni_instance.h:
2449 * bindings/jni/jni_jsobject.cpp:
2450 (JavaJSObject::convertValueToJObject):
2451 * bindings/objc/WebScriptObject.mm:
2452 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
2453 Standardized calls to use getXXX instead of hand-rolling JSValue
2455 * bindings/objc/objc_instance.h:
2456 * bindings/objc/objc_instance.mm:
2457 (ObjcInstance::getValueOfUndefinedField):
2458 (ObjcInstance::defaultValue):
2459 * bindings/objc/objc_runtime.h:
2460 * bindings/objc/objc_runtime.mm:
2461 (ObjcFallbackObjectImp::type):
2462 (ObjcFallbackObjectImp::defaultValue):
2463 * bindings/runtime.h:
2464 (KJS::Bindings::Instance::getValueOfUndefinedField):
2465 * bindings/runtime_object.cpp:
2466 (RuntimeObjectImp::defaultValue):
2467 * bindings/runtime_object.h:
2468 * kjs/JSImmediate.h: Added.
2469 (KJS::JSImmediate::isImmediate):
2470 (KJS::JSImmediate::isNumber):
2471 (KJS::JSImmediate::isBoolean):
2472 (KJS::JSImmediate::isUndefinedOrNull):
2473 (KJS::JSImmediate::fromDouble):
2474 (KJS::JSImmediate::toDouble):
2475 (KJS::JSImmediate::toBoolean):
2476 (KJS::JSImmediate::trueImmediate):
2477 (KJS::JSImmediate::falseImmediate):
2478 (KJS::JSImmediate::NaNImmediate):
2479 (KJS::JSImmediate::undefinedImmediate):
2480 (KJS::JSImmediate::nullImmediate):
2481 (KJS::JSImmediate::tag):
2482 (KJS::JSImmediate::unTag):
2483 (KJS::JSImmediate::getTag):
2484 (KJS::JSImmediate::):
2485 (KJS::JSImmediate::isIEEE):
2486 (KJS::JSImmediate::is32bit):
2487 (KJS::JSImmediate::is64bit):
2488 (KJS::JSImmediate::NanAsBits):
2489 (KJS::JSImmediate::zeroAsBits):
2490 (KJS::JSImmediate::oneAsBits):
2492 (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
2493 * kjs/JSType.h: Added.
2494 * kjs/collector.cpp:
2495 (KJS::Collector::protect):
2496 (KJS::Collector::unprotect):
2497 (KJS::Collector::collect):
2499 (KJS::StringImp::toPrimitive):
2500 (KJS::NumberImp::toPrimitive):
2501 (KJS::NumberImp::toBoolean):
2502 (KJS::GetterSetterImp::toPrimitive):
2504 (KJS::StringImp::type):
2505 (KJS::NumberImp::type):
2507 (KJS::JSObject::type):
2508 (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
2509 I'm looking for?" test with "Are you not the one thing I'm not looking
2511 (KJS::JSObject::defaultValue):
2512 (KJS::JSObject::toPrimitive):
2514 (KJS::GetterSetterImp::type):
2515 (KJS::JSValue::isObject):
2516 * kjs/operations.cpp:
2520 * kjs/reference.cpp:
2521 (KJS::Reference::deleteValue):
2522 * kjs/simple_number.h: Removed.
2523 * kjs/string_object.cpp:
2524 (StringInstance::getOwnPropertySlot): fixed indentation
2526 (KJS::JSValue::toObject):
2527 (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
2528 us to inline jsNumber without adding PIC branches to callers.
2535 (KJS::JSValue::downcast):
2536 (KJS::JSValue::isUndefinedOrNull):
2537 (KJS::JSValue::isBoolean):
2538 (KJS::JSValue::isNumber):
2539 (KJS::JSValue::isString):
2540 (KJS::JSValue::isObject):
2541 (KJS::JSValue::getBoolean):
2542 (KJS::JSValue::getNumber):
2543 (KJS::JSValue::getString):
2544 (KJS::JSValue::getObject):
2545 (KJS::JSValue::getUInt32):
2546 (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
2547 resulting in a slight performance gain. Callers should always check
2548 !marked() before calling mark(), so it's impossible to call mark on
2550 (KJS::JSValue::marked):
2551 (KJS::JSValue::type):
2552 (KJS::JSValue::toPrimitive):
2553 (KJS::JSValue::toBoolean):
2554 (KJS::JSValue::toNumber):
2555 (KJS::JSValue::toString):
2557 2006-02-06 Eric Seidel <eseidel@apple.com>
2559 Add svn:ignore properties for visual studio internals.
2561 2006-02-06 Alexey Proskuryakov <ap@nypop.com>
2565 - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
2566 http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
2568 - No tests added - only changed functionality on WIN32, which should be covered by
2571 * kjs/date_object.cpp:
2572 (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
2574 (KJS::timeZoneOffset): Removed, was basically the same as the above.
2575 (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
2576 Windows based on struct tm itself.
2577 (KJS::DateInstance::getTime): Added.
2578 (KJS::DateInstance::getUTCTime): Added.
2579 (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
2580 (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
2581 (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
2582 GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
2583 with daylight savings time being in effect.
2585 * kjs/date_object.h: Added prototypes for new functions.
2587 2006-02-05 Maciej Stachowiak <mjs@apple.com>
2591 - fixed ~1100 KJS::Node leaked on layout tests
2592 http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
2595 (KJS::Parser::noteNodeCycle):
2596 (KJS::Parser::removeNodeCycle):
2597 (KJS::clearNewNodes):
2600 (ElementNode::breakCycle):
2601 (PropertyListNode::breakCycle):
2602 (ArgumentListNode::breakCycle):
2603 (StatListNode::StatListNode):
2604 (StatListNode::breakCycle):
2605 (VarDeclListNode::breakCycle):
2606 (BlockNode::BlockNode):
2607 (ClauseListNode::breakCycle):
2608 (CaseBlockNode::CaseBlockNode):
2609 (ParameterNode::breakCycle):
2610 (SourceElementsNode::SourceElementsNode):
2611 (SourceElementsNode::breakCycle):
2613 (KJS::Node::breakCycle):
2614 (KJS::ElementNode::ElementNode):
2615 (KJS::ArrayNode::ArrayNode):
2616 (KJS::PropertyListNode::PropertyListNode):
2617 (KJS::ObjectLiteralNode::ObjectLiteralNode):
2618 (KJS::ArgumentListNode::ArgumentListNode):
2619 (KJS::ArgumentsNode::ArgumentsNode):
2620 (KJS::VarDeclListNode::VarDeclListNode):
2621 (KJS::VarStatementNode::VarStatementNode):
2622 (KJS::ForNode::ForNode):
2623 (KJS::CaseClauseNode::CaseClauseNode):
2624 (KJS::ClauseListNode::ClauseListNode):
2625 (KJS::ParameterNode::ParameterNode):
2626 (KJS::FuncExprNode::FuncExprNode):
2627 (KJS::FuncDeclNode::FuncDeclNode):
2629 2006-02-05 Maciej Stachowiak <mjs@apple.com>
2633 - fix default traits for classes to make sure default constructors get called
2635 * kxmlcore/VectorTraits.h:
2638 2006-02-04 Darin Adler <darin@apple.com>
2642 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
2643 REGRESSION: for/in loop with var changes global variable instead of making local
2645 Test: fast/js/for-in-var-scope.html
2648 (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
2649 (ForInNode::execute): Break out of the scope chain loop once we find and set the
2650 loop variable. We don't want to set multiple loop variables.
2651 (ForInNode::processVarDecls): Process the declaration of the loop variable.
2655 * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
2656 * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
2657 instead of defining it here a second time.
2659 2006-02-04 Maciej Stachowiak <mjs@apple.com>
2663 - change JavaScript collector statistics calls to use HashCountedSet instead
2664 of CFSet; other misc cleanup
2665 http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
2667 * kjs/collector.cpp:
2668 (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
2670 (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
2673 (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
2676 2006-02-03 Timothy Hatcher <timothy@apple.com>
2680 Renamed configuration names to Debug, Release and Production.
2682 * JavaScriptCore.xcodeproj/project.pbxproj:
2684 2006-02-02 George Staikos <staikos@opensource.apple.com>
2688 * kjs/lookup.h: Fix compile, merged from KDE.
2690 2006-02-02 Darin Adler <darin@apple.com>
2694 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
2695 add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
2697 * kxmlcore/Noncopyable.h: Added.
2698 * kxmlcore/OwnArrayPtr.h: Added.
2699 * kxmlcore/OwnPtr.h: Added.
2701 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
2704 * kjs/function.cpp: Use OwnPtr for Parameter pointers.
2706 * kjs/internal.h: Use Noncopyable for LabelStack.
2708 * kjs/list.cpp: Use OwnArrayPtr for overflow.
2710 * kjs/property_map.h:
2711 * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
2712 Use Vector for some stack buffers.
2714 * kjs/regexp_object.h:
2715 * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
2717 2006-01-31 Maciej Stachowiak <mjs@apple.com>
2721 - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
2722 that would catch them
2725 (NodeCounter::~NodeCounter): Added debug-only node counter.
2728 * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
2730 2006-01-31 Darin Adler <darin@apple.com>
2734 - added deleteAllValues for HashSet as well as HashMap
2735 - fixed conversion from const_iterator to iterator, which I broke a while back
2737 * kxmlcore/HashMap.h: Updated copyright date.
2738 * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
2739 * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
2741 2006-01-31 Tim Omernick <timo@apple.com>
2743 Reviewed by Geoff Garen.
2745 * bindings/c/c_utility.cpp:
2746 (KJS::Bindings::convertUTF8ToUTF16):
2747 Fixed an invalid assertion that UTF8Chars is not NULL. It is valid for it to be NULL as long as
2749 This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
2750 where JavaScript is getting a NULL string back from some call on the Real Player plugin.
2752 2006-01-30 Anders Carlsson <andersca@mac.com>
2756 Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
2757 REGRESSION: United.com menus messed up due to document.all/MSIE sniff
2760 (typeStringForValue):
2761 Return "undefined" if the given object should masquerade as undefined.
2764 (KJS::JSObject::masqueradeAsUndefined):
2765 Rename from isEqualToNull.
2767 * kjs/operations.cpp:
2769 Update for name change.
2771 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2775 - properly define Vector assignment operator; the private version was accidentally left
2776 in, and the template version is not enough to replace the default
2778 * kxmlcore/Vector.h:
2779 (KXMLCore::Vector::operator=):
2781 2006-01-29 Eric Seidel <eseidel@apple.com>
2785 Fix the build by applying a GCC-specific namespace hack.
2789 2006-01-29 Eric Seidel <eseidel@apple.com>
2795 * kjs/lookup.h: fixed ::cacheGlobalObject
2796 * kxmlcore/Vector.h:
2797 (KXMLCore::Vector::operator[]): use unsigned long
2799 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2801 Reviewed by Dave Hyatt.
2803 * kxmlcore/Vector.h:
2804 (KXMLCore::Vector::operator[]): Add unsigned overload
2806 2006-01-28 Darin Adler <darin@apple.com>
2808 Reviewed by John Sullivan.
2810 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
2811 include exception names in JavaScript form of DOM exception
2813 * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
2814 exception in the error message.
2816 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2820 - miscellaneous Vector improvements
2822 * kxmlcore/Vector.h:
2823 (KXMLCore::Vector::at): Add range-checking asserts.
2824 (KXMLCore::Vector::first): Added as a convenience.
2825 (KXMLCore::Vector::last): Convenience for stack-style use.
2826 (KXMLCore::Vector::removeLast): ditto
2828 2006-01-28 Darin Adler <darin@apple.com>
2830 Reviewed by John Sullivan
2832 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
2833 REGRESSION: JavaScript Date constructor won't accept another Date object
2835 Test: fast/js/date-constructor.html
2837 * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
2838 Added a special case for constructing one date from another (to avoid losing
2839 milliseconds, which are not in the text form, to match Firefox), and changed
2840 the base code to convert to primitive before checking for string to match
2841 the standard. Also corrected a couple silly things in the "construct from
2842 current time" code path (removed a floor that does no good, and changed
2843 the constant used to convert microseconds to milliseconds to be a 1000
2844 rather than "msPerSecond").
2846 2006-01-28 Darin Adler <darin@apple.com>
2848 * kjs/create_hash_table: Added missing license.
2850 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2852 Reviewed by Dave Hyatt.
2854 - added a Vector class
2855 http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
2857 * JavaScriptCore.xcodeproj/project.pbxproj:
2859 (KJS::Parser::saveNewNode): Apply Vector.
2860 (KJS::clearNewNodes): ditto
2861 * kjs/number_object.cpp:
2862 (integer_part_noexp): ditto
2863 (char_sequence): ditto
2865 (KJS::UString::UTF8String): ditto
2866 * kxmlcore/HashMap.h:
2867 (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
2868 other versions are useful for other containers.
2869 * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
2870 be usable for all Array/QVector style purposes, and also as a stack buffer
2871 with oversize handling. Also some helper classes to make vector operations
2872 as efficient as possible for POD types and for simple non-PODs like RefPtr.
2874 (KXMLCore::VectorTypeOperations::destruct):
2875 (KXMLCore::VectorTypeOperations::initialize):
2876 (KXMLCore::VectorTypeOperations::move):
2877 (KXMLCore::VectorTypeOperations::uninitializedCopy):
2878 (KXMLCore::VectorTypeOperations::uninitializedFill):
2879 (KXMLCore::VectorBuffer::VectorBuffer):
2880 (KXMLCore::VectorBuffer::~VectorBuffer):
2881 (KXMLCore::VectorBuffer::deallocateBuffer):
2882 (KXMLCore::VectorBuffer::inlineBuffer):
2883 (KXMLCore::Vector::Vector):
2884 (KXMLCore::Vector::~Vector):
2885 (KXMLCore::Vector::size):
2886 (KXMLCore::Vector::capacity):
2887 (KXMLCore::Vector::isEmpty):
2888 (KXMLCore::Vector::at):
2889 (KXMLCore::Vector::operator[]):
2890 (KXMLCore::Vector::data):
2891 (KXMLCore::Vector::operator T*):
2892 (KXMLCore::Vector::operator const T*):
2893 (KXMLCore::Vector::begin):
2894 (KXMLCore::Vector::end):
2895 (KXMLCore::Vector::clear):
2896 (KXMLCore::Vector::fill):
2897 (KXMLCore::Vector::operator=):
2898 (KXMLCore::::Vector):
2899 (KXMLCore::::operator):
2901 (KXMLCore::::expandCapacity):
2902 (KXMLCore::::resize):
2903 (KXMLCore::::reserveCapacity):
2904 (KXMLCore::::append):
2905 (KXMLCore::deleteAllValues):
2906 * kxmlcore/VectorTraits.h: Added.
2907 (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
2910 2006-01-28 Alexey Proskuryakov <ap@nypop.com>
2914 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2915 RealPlayer.GetTitle() Crashes Safari/Dashboard
2917 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2918 Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
2920 2006-01-25 George Staikos <staikos@opensource.apple.com>
2924 * kxmlcore/HashFunctions.h: Merge build fix from KDE.
2926 2006-01-25 Darin Adler <darin@apple.com>
2928 - removed an unused source file
2930 * kjs/pointer_hash.h: Removed.
2931 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
2933 2006-01-23 Anders Carlsson <andersca@mac.com>
2937 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
2938 KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
2941 Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
2943 (cacheGlobalObject):
2944 Move this out of the KJS namespace.
2946 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2950 - renamed PointerHash to PtrHash
2951 - made PtrHash the default hash function for int and pointer types that aren't further specialized
2952 - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
2953 - did appropriate consequent cleanup (very few places now need to declare a hash function)
2954 http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
2956 * kjs/array_object.cpp:
2957 (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
2958 * kjs/collector.cpp: ditto
2959 * kjs/identifier.cpp:
2960 (KXMLCore::): declare DefaultHash the new way
2961 * kjs/internal.cpp: no need to mention PointerHash
2963 * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
2964 easier to specialize on PtrHash
2965 * kxmlcore/HashFunctions.h:
2966 (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
2967 a Hash typedef rather than being a hash function class itself; declared DefaultHash
2968 for int and partializy specialized for pointer types
2969 * kxmlcore/HashMapPtrSpec.h:
2970 (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
2971 way of handling pointer hash
2972 (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
2974 * kxmlcore/HashMap.h: ditto
2975 * kxmlcore/HashSet.h: ditto
2977 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2979 Reviewed by Tim Omernick.
2981 - use classes instead of free functions for extractors, this better matches how other
2982 things work and should avoid the need for hacky workarounds on other compilers
2983 http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
2985 * kjs/array_object.cpp:
2986 * kjs/identifier.cpp:
2988 * kxmlcore/HashMap.h:
2989 (KXMLCore::PairFirstExtractor::extract):
2990 * kxmlcore/HashMapPtrSpec.h:
2992 * kxmlcore/HashSet.h:
2993 (KXMLCore::IdentityExtractor::extract):
2994 * kxmlcore/HashTable.h:
2995 (KXMLCore::addIterator):
2996 (KXMLCore::removeIterator):
2997 (KXMLCore::HashTable::add):
2998 (KXMLCore::HashTable::isEmptyBucket):
2999 (KXMLCore::HashTable::isDeletedBucket):
3000 (KXMLCore::HashTable::HashTable):
3001 (KXMLCore::HashTable::lookup):
3002 (KXMLCore::HashTable::add):
3003 (KXMLCore::HashTable::reinsert):
3004 (KXMLCore::HashTable::find):
3005 (KXMLCore::HashTable::contains):
3006 (KXMLCore::HashTable::remove):
3007 (KXMLCore::HashTable::allocateTable):
3008 (KXMLCore::HashTable::deallocateTable):
3009 (KXMLCore::HashTable::expand):
3010 (KXMLCore::HashTable::rehash):
3011 (KXMLCore::HashTable::clear):
3012 (KXMLCore::HashTable::swap):
3013 (KXMLCore::HashTable::operator):
3014 (KXMLCore::HashTable::checkTableConsistency):
3015 (KXMLCore::HashTable::checkTableConsistencyExceptSize):
3016 (KXMLCore::HashTable::invalidateIterators):
3018 2006-01-23 Maciej Stachowiak <mjs@apple.com>
3020 Rubber stamped by Tim Hatcher.
3022 - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
3023 for consistency with HashMap
3025 * kjs/array_object.cpp:
3026 (ArrayProtoFunc::callAsFunction):
3027 * kjs/collector.cpp:
3028 (KJS::Collector::protect):
3029 * kjs/identifier.cpp:
3030 (KJS::Identifier::add):
3031 * kxmlcore/HashCountedSet.h:
3033 * kxmlcore/HashMap.h:
3034 (KXMLCore::::inlineAdd):
3035 * kxmlcore/HashSet.h:
3037 * kxmlcore/HashTable.h:
3038 (KXMLCore::HashTable::add):
3040 (KXMLCore::::HashTable):
3042 2006-01-23 Justin Garcia <justin.garcia@apple.com>
3044 Reviewed by thatcher
3046 Turned on -O2 for B&I build.
3048 * JavaScriptCore.xcodeproj/project.pbxproj:
3050 2006-01-23 Maciej Stachowiak <mjs@apple.com>
3052 Reviewed by Tim Hatcher.
3054 - it's "Franklin Street", not "Franklin Steet"
3056 * kjs/array_instance.h:
3057 * kjs/array_object.cpp:
3058 * kjs/array_object.h:
3059 * kjs/bool_object.cpp:
3060 * kjs/bool_object.h:
3061 * kjs/collector.cpp:
3065 * kjs/date_object.cpp:
3066 * kjs/date_object.h:
3070 * kjs/error_object.cpp:
3071 * kjs/error_object.h:
3074 * kjs/function_object.cpp:
3075 * kjs/function_object.h:
3077 * kjs/identifier.cpp:
3081 * kjs/interpreter.cpp:
3082 * kjs/interpreter.h:
3089 * kjs/math_object.cpp:
3090 * kjs/math_object.h:
3093 * kjs/nodes2string.cpp:
3094 * kjs/number_object.cpp:
3095 * kjs/number_object.h:
3098 * kjs/object_object.cpp:
3099 * kjs/object_object.h:
3100 * kjs/operations.cpp:
3102 * kjs/property_map.cpp:
3103 * kjs/property_map.h:
3104 * kjs/property_slot.cpp:
3105 * kjs/property_slot.h:
3106 * kjs/reference.cpp:
3108 * kjs/reference_list.cpp:
3109 * kjs/reference_list.h:
3112 * kjs/regexp_object.cpp:
3113 * kjs/regexp_object.h:
3114 * kjs/scope_chain.cpp:
3115 * kjs/scope_chain.h:
3116 * kjs/simple_number.h:
3117 * kjs/string_object.cpp:
3118 * kjs/string_object.h:
3125 * kxmlcore/AlwaysInline.h:
3126 * kxmlcore/ListRefPtr.h:
3127 * kxmlcore/PassRefPtr.h:
3128 * kxmlcore/RefPtr.h:
3130 2006-01-23 Darin Adler <darin@apple.com>
3132 Reviewed by John Sullivan.
3134 - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
3135 REGRESSION: Crash in cloneChildNodes when clicking element
3137 * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
3138 type by calling get() instead of going directly at m_ptr.
3139 * kxmlcore/RefPtr.h: Ditto.
3143 * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
3144 It's just a resorted list of keys in a dictionary.
3146 * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
3147 in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
3148 routine" property we want to have on OS X.
3150 2006-01-22 Maciej Stachowiak <mjs@apple.com>
3154 - Set up Page class and invert Frame / WebCoreFrameBridge ownership
3155 http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
3157 * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can
3160 2006-01-23 George Staikos <staikos@opensource.apple.com>
3162 Reviewed by Maciej and Darin.
3164 * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
3165 * kjs/interpreter.cpp: ditto
3166 * kjs/simple_number.h: Add assert.h and remove from config.h
3167 * kjs/array_object.cpp: Use relative paths for kxmlcore includes
3168 * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
3170 2006-01-23 George Staikos <staikos@opensource.apple.com>
3174 * kjs/config.h: unbreak preprocessor change
3176 2006-01-23 George Staikos <staikos@opensource.apple.com>
3178 Approved by Maciej and Darin.
3182 Update FSF address in license to make merging easier
3184 2006-01-22 George Staikos <staikos@opensource.apple.com>
3188 * kjs/collector.cpp: merge major speedup from KDE on Linux
3189 patch by Maks Orlovich, bug #6145
3190 Also unify cpu detection
3191 * kjs/config.h: define simpler CPU macros
3193 2006-01-22 George Staikos <staikos@opensource.apple.com>
3197 * kjs/collector.cpp: merge FreeBSD compile fix from KDE
3198 -> requires build magic for use
3200 2006-01-21 George Staikos <staikos@opensource.apple.com>
3204 * kjs/nodes2string.cpp
3207 Fix pedantic compile with some gcc versions (Merge from KDE)
3209 * kjs/create_hash_table:
3210 Fix build with Perl 5.8.0 (Merge from KDE)
3212 2006-01-18 Darin Adler <darin@apple.com>
3216 - hash table fixes needed for my WebCore changes
3218 * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
3219 Added a missing return statement.
3221 * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
3222 can't instantiate with a 0 by using traits rather than ? : to select the default
3223 emtpy value of hash table keys.
3225 - small cleanup of "runtime" code left over from recent JavaScript crash fix
3227 * bindings/runtime_root.h:
3228 (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
3229 since it's now a ProtectedPtr.
3230 (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
3231 fact that _imp was 0 and replaced with use of ProtectedPtr.
3232 (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
3234 2006-01-17 Darin Adler <darin@apple.com>
3238 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
3239 add assertions to check correct use of hash table iterators
3241 * kxmlcore/HashTable.h:
3242 (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
3243 maintained by the specified hash table.
3244 (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
3245 the list maintained by the hash table it's in.
3246 (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
3247 parameter, ignored when not debugging. Call addIterator.
3248 (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
3249 (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
3250 (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
3251 (KXMLCore::HashTableConstIterator::operator->): Ditto.
3252 (KXMLCore::HashTableConstIterator::operator++): Ditto.
3253 (KXMLCore::HashTableConstIterator::operator==): Ditto.
3254 (KXMLCore::HashTableConstIterator::operator!=): Ditto.
3255 (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
3256 pointer is not 0 and if there are two iterators that both point at the same table.
3257 (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
3258 as an implementation detail, to avoid having two separate iterator implementations.
3259 (KXMLCore::HashTableIterator::operator*): Ditto.
3260 (KXMLCore::HashTableIterator::operator->): Ditto.
3261 (KXMLCore::HashTableIterator::operator++): Ditto.
3262 (KXMLCore::HashTableIterator::operator==): Ditto.
3263 (KXMLCore::HashTableIterator::operator!=): Ditto.
3264 (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
3265 (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
3266 (KXMLCore::HashTable::makeIterator): Pass this pointer.
3267 (KXMLCore::HashTable::makeConstIterator): Ditto.
3268 (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
3269 entry point that modifies the hash table.
3270 (KXMLCore::HashTable::remove): Ditto.
3271 (KXMLCore::HashTable::clear): Ditto.
3272 (KXMLCore::HashTable::swap): Ditto.
3273 (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
3274 clears out the table, next, and previous pointers in all of them, and then clears
3275 the head so we have an empty list.
3276 (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
3277 passed-in table, and points the iterator at the table.
3278 (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
3279 the passed-in table.
3281 * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
3283 2006-01-17 Justin Garcia <justin.garcia@apple.com>
3287 Deployment builds now use -O2
3289 * JavaScriptCore.xcodeproj/project.pbxproj:
3291 2006-01-17 Darin Adler <darin@apple.com>
3295 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
3296 change RefPtr so that it works when deref ends up deleting the RefPtr
3298 * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
3299 * kxmlcore/RefPtr.h: Ditto.
3301 2006-01-16 Geoffrey Garen <ggaren@apple.com>
3305 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
3306 DateProtoFuncImp::callAsFunction can crash due to lack of type checking
3308 * kjs/date_object.cpp:
3309 (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods.
3310 This matches section 15.9.5 in the spec.
3312 2006-01-16 Tim Omernick <timo@apple.com>
3314 Reviewed by John Sullivan.
3316 JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
3318 * bindings/npruntime.cpp:
3319 (_NPN_ReleaseObject):
3320 Refactored part of this function out into _NPN_DeallocateObject.
3321 (_NPN_DeallocateObject):
3322 Forcibly deallocates the passed object, even if its refcount is
3325 * bindings/npruntime_impl.h:
3326 Declared _NPN_DeallocateObject().
3328 2006-01-16 Darin Adler <darin@apple.com>
3332 - fix problem with ++, ==, and != on const iterators in
3333 HashMaps that are using the pointer specialization
3335 * kxmlcore/HashMapPtrSpec.h:
3336 (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
3337 (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
3338 (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
3340 2006-01-15 Alexey Proskuryakov <ap@nypop.com>
3344 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
3345 run-javascriptcore-tests doesn't work
3347 * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm:
3348 Changed revision number to 1.8 (broken by svn migration).
3350 2006-01-14 David Kilzer <ddkilzer@kilzer.net>
3352 Reviewed and landed by Anders.
3354 * kjs/create_hash_table: Fixed comment typo.
3356 2006-01-13 Maks Orlovich <maksim@kde.org>
3358 Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
3360 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
3361 Misc. array object fixes from KJS
3363 * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
3364 (ArrayInstance::getOwnPropertySlot): Ditto.
3365 (ArrayInstance::deleteProperty): Ditto.
3366 (ArrayInstance::put): Ditto.
3367 (ArrayInstance::propList): Added a FIXME comment.
3368 (ArrayInstance::put): Throw exception on trying to set invalid array length.
3369 (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
3370 * kjs/array_object.h: Added MAX_ARRAY_INDEX.
3372 2006-01-13 Darin Adler <darin@apple.com>
3374 - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
3375 - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
3377 2006-01-13 Anders Carlsson <andersca@mac.com>
3381 * kjs/create_hash_table:
3382 Use correct size variables.
3384 2006-01-13 Anders Carlsson <andersca@mac.com>
3388 * kjs/create_hash_table:
3389 Don't create an empty entry array, instead add a entry with all fields
3390 set to null and set the hash table size to 1.
3394 Remove the hash table size check
3396 2006-01-12 Anders Carlsson <andersca@mac.com>
3400 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
3401 Crash when assigning a new function to a DOMParser object
3403 * JavaScriptCore.xcodeproj/project.pbxproj:
3404 Move lookup.cpp before lookup.h
3408 If the hash table is empty, return 0 early.
3410 2006-01-12 George Staikos <staikos@kde.org>
3414 * kjs/interpreter.cpp:
3416 * kjs/interpreter.h:
3417 Add helper to interpreter to call the collector in order to facilitate
3418 visibility rules in KDE.
3420 2006-01-12 George Staikos <staikos@kde.org>
3424 * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
3426 * kxmlcore/HashTable.h: Add missing assert.h
3428 2006-01-12 Darin Adler <darin@apple.com>
3432 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
3433 retire APPLE_CHANGES from JavaScriptCore
3435 * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
3436 APPLE_CHANGES and HAVE_CONFIG_H from all targets.
3438 * README: Removed. This had obsolete information in it
3439 and it wasn't clear what to replace it with.
3441 * kjs/collector.h: Removed an APPLE_CHANGES if around something
3442 that's not really platform-specific (although it does use a
3443 platform-specific API at the moment).
3444 * kjs/collector.cpp: Removed a mistaken comment.
3449 * kjs/operations.cpp:
3452 Use __APPLE__ instead of APPLE_CHANGES for code that should be
3453 used only on Mac OS X.
3455 * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
3456 of the runtime.h header. Even though that header isn't needed at the
3457 moment on platforms other than Mac OS X, the conditional stuff should
3458 be in the header itself, not in this one client.
3460 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
3461 code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
3462 any platform where pow is implemented corrrectly according to the IEEE
3463 standard. If it is needed on some, we can add it back with an appropriate
3464 #if for the platforms where it is needed.
3466 2006-01-12 Justin Haygood <justin@xiondigital.net>
3468 Reviewed, tweaked, and landed by Darin.
3470 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
3471 lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
3473 * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3474 quotes instead of angle brackets. Moved dtoa.h include to the top.
3475 Changed system header includes to use angle brackets instead of quotes.
3476 * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
3477 quotes instead of angle brackets.
3478 * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3479 quotes instead of angle brackets. Moved lexer.h include to the top.
3480 * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3481 quotes instead of angle brackets. Moved ustring.h include to the top.
3483 2006-01-12 George Staikos <staikos@kde.org>
3487 - Import initial QMake file. Doesn't fully work yet.
3489 2006-01-11 Ricci Adams <ricciadams@apple.com>
3491 Reviewed by Maciej and Darin, landed by Darin.
3493 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
3494 final comma in javascript object prevents parsing
3496 * kjs/grammar.y: Added rule to allow trailing comma in
3497 object construction.
3499 2006-01-11 Ricci Adams <ricciadams@apple.com>
3501 Reviewed by Geoff, landed by Darin.
3503 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
3504 Number.toFixed doesn't include leading 0
3506 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
3507 Fixed a "<" that should have been a "<=".
3509 2006-01-11 Ricci Adams <ricciadams@apple.com>
3511 Reviewed by Geoff, landed by Darin.
3513 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
3514 Number.toFixed doesn't round 0.5 up
3516 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
3517 Fixed a ">" that should have been a ">=".
3519 2006-01-11 Justin Haygood <justin@xiondigital.net>