1 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
3 * make-generated-sources.sh: Changed to be executable and removed
4 text in the file generated by "svn diff".
6 2006-05-15 Geoffrey Garen <ggaren@apple.com>
10 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
11 a reserved word while parsing JavaScript (and other ECMA reserved
16 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
17 We treat "char" as a reserved word in JavaScript and firefox/IE do
20 (1) I unreserved most of the spec's "future reserved words" because
21 they're not reserved in IE or FF. (Most, but not all, because IE
22 somewhat randomly *does* reserve a few of them.)
23 (2) I made 'debugger' a legitimate statement that acts like an empty
24 statement because FF and IE support it.
29 2006-05-15 Tim Omernick <timo@apple.com>
31 Reviewed by John Sullivan.
33 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
35 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
36 determines the kind of graphics context created by the browser for the plugin, as well as
37 the Mac types of various Netscape Plugin API data structures.
39 There is a drawing model to represent the old QuickDraw-based API. It is used by default
40 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
42 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
43 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
46 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
47 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
49 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
51 NPRegion's type now depends on the drawing model specified by the plugin.
52 NP_Port is now only defined when QuickDraw is available.
53 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
55 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
57 Reviewed by Darin, landed by ap.
59 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
60 Bakefiles (and generated Makefiles) for wx and gdk ports
62 * make-generated-sources.sh:
63 Added script to configure environment to run DerivedSources.make
65 * JavaScriptCoreSources.bkl:
66 Added JavaScriptCore sources list for Bakefile.
69 Bakefile used to generate JavaScriptCore project files
70 (currently only used by wx and gdk ports)
72 2006-05-09 Steve Falkenburg <sfalken@apple.com>
75 Minor fixes to WTF headers.
79 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
80 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
81 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
82 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
84 2006-05-09 Maciej Stachowiak <mjs@apple.com>
86 Rubber stamped by Anders.
88 - renamed kxmlcore to wtf
94 * JavaScriptCore.xcodeproj/project.pbxproj:
95 * bindings/c/c_instance.cpp:
96 * bindings/objc/WebScriptObject.mm:
100 * kjs/array_object.cpp:
102 (KJS::Collector::registerThread):
106 (KJS::isStrWhiteSpace):
108 * kjs/identifier.cpp:
113 (Lexer::isWhiteSpace):
114 (Lexer::isIdentStart):
115 (Lexer::isIdentPart):
119 * kjs/number_object.cpp:
121 * kjs/property_map.cpp:
122 * kjs/property_map.h:
123 * kjs/string_object.cpp:
124 (StringProtoFunc::callAsFunction):
130 * kxmlcore/AlwaysInline.h: Removed.
131 * kxmlcore/Assertions.cpp: Removed.
132 * kxmlcore/Assertions.h: Removed.
133 * kxmlcore/FastMalloc.cpp: Removed.
134 * kxmlcore/FastMalloc.h: Removed.
135 * kxmlcore/FastMallocInternal.h: Removed.
136 * kxmlcore/Forward.h: Removed.
137 * kxmlcore/HashCountedSet.h: Removed.
138 * kxmlcore/HashFunctions.h: Removed.
139 * kxmlcore/HashMap.h: Removed.
140 * kxmlcore/HashSet.h: Removed.
141 * kxmlcore/HashTable.cpp: Removed.
142 * kxmlcore/HashTable.h: Removed.
143 * kxmlcore/HashTraits.h: Removed.
144 * kxmlcore/ListRefPtr.h: Removed.
145 * kxmlcore/Noncopyable.h: Removed.
146 * kxmlcore/OwnArrayPtr.h: Removed.
147 * kxmlcore/OwnPtr.h: Removed.
148 * kxmlcore/PassRefPtr.h: Removed.
149 * kxmlcore/Platform.h: Removed.
150 * kxmlcore/RefPtr.h: Removed.
151 * kxmlcore/TCPageMap.h: Removed.
152 * kxmlcore/TCSpinLock.h: Removed.
153 * kxmlcore/TCSystemAlloc.cpp: Removed.
154 * kxmlcore/TCSystemAlloc.h: Removed.
155 * kxmlcore/UnusedParam.h: Removed.
156 * kxmlcore/Vector.h: Removed.
157 * kxmlcore/VectorTraits.h: Removed.
158 * kxmlcore/unicode: Removed.
159 * kxmlcore/unicode/Unicode.h: Removed.
160 * kxmlcore/unicode/UnicodeCategory.h: Removed.
161 * kxmlcore/unicode/icu: Removed.
162 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
163 * kxmlcore/unicode/posix: Removed.
164 * kxmlcore/unicode/qt3: Removed.
165 * kxmlcore/unicode/qt4: Removed.
166 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
169 * wtf/Assertions.cpp:
171 * wtf/FastMalloc.cpp:
172 (WTF::TCMalloc_ThreadCache::Scavenge):
175 (WTF::TCMallocGuard::TCMallocGuard):
182 * wtf/FastMallocInternal.h:
184 * wtf/HashCountedSet.h:
185 * wtf/HashFunctions.h:
197 * wtf/TCSystemAlloc.cpp:
198 (TCMalloc_SystemAlloc):
200 * wtf/VectorTraits.h:
201 * wtf/unicode/UnicodeCategory.h:
202 * wtf/unicode/icu/UnicodeIcu.h:
204 2006-05-08 Timothy Hatcher <timothy@apple.com>
208 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
210 2006-05-07 Darin Adler <darin@apple.com>
212 Reviewed and landed by Maciej.
214 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
215 Random crashes on TOT since the form state change
217 I haven't figured out how to construct a test for this, but this does seem to fix the
218 problem; Mitz mentioned that a double-destroy was occurring in these functions.
220 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
221 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
222 destroys the element based on the storage type. The RefCounter template correctly does work
223 only in cases where ValueType and ValueStorageType differ and this class is what's used
224 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
225 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
227 2006-05-05 Darin Adler <darin@apple.com>
229 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
230 IE compatibility fix in date parsing
232 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
233 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
235 2006-05-04 Anders Carlsson <andersca@mac.com>
239 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
240 Would like a Vector::append that takes another Vector
243 (KXMLCore::::append):
244 New function that takes another array.
246 2006-05-02 Steve Falkenburg <sfalken@apple.com>
250 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
251 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
253 2006-05-02 Anders Carlsson <andersca@mac.com>
257 * kxmlcore/HashMap.h:
258 (KXMLCore::::operator):
261 2006-05-01 Tim Omernick <timo@apple.com>
263 Reviewed by Tim Hatcher.
265 <rdar://problem/4476875> Support printing for embedded Netscape plugins
268 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
269 and Mac OS X systems, as this is what plugins expect.
271 2006-05-01 Timothy Hatcher <timothy@apple.com>
275 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
277 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
278 imp->m_destructorIsThreadSafe" where we collect oversized cells.
280 We don't have a way to test PAC files yet, so there's no test attached.
283 (KJS::Collector::collect): test the thread when we collect oversized cells
285 2006-05-01 Tim Omernick <timo@apple.com>
289 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
291 * kxmlcore/Assertions.cpp:
292 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
294 2006-04-28 Steve Falkenburg <sfalken@apple.com>
298 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
301 (main): Suppress C runtime alerts
303 2006-04-28 Steve Falkenburg <sfalken@apple.com>
307 Suppress error reporting dialog that blocks Javascript tests from completing.
309 Real error is due to an overflow in the date/time handling functions that needs
310 to be addressed, but this will prevent the hang running the Javascript tests
311 on the build bot (along with the related changes).
314 (main): Suppress C runtime alerts
316 2006-04-27 Geoffrey Garen <ggaren@apple.com>
320 - Minor fixups I discovered while working on the autogenerator.
323 (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
324 compute a garbage address, and possibly crash.
326 (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
327 would be hidden entirely.
329 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
333 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
334 Compilation fixes for building on gcc 4.0.2, and without precomp headers
337 * kxmlcore/Assertions.cpp:
338 * kxmlcore/FastMalloc.cpp:
339 Added necessary headers to resolve compilation issues when not using
342 * kjs/value.h: Declare the JSCell class before friend declaration
343 to resolve compilation issues with gcc 4.0.2.
345 * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
346 other than KDE (previously only defined for Win and Mac OS)
348 2006-04-18 Eric Seidel <eseidel@apple.com>
352 Fix "new Function()" to correctly use lexical scoping.
353 Add ScopeChain::print() function for debugging.
354 <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
356 * kjs/function_object.cpp:
357 (FunctionObjectImp::construct):
358 * kjs/scope_chain.cpp:
359 (KJS::ScopeChain::print):
362 2006-04-14 James G. Speth <speth@end.com>
366 Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
367 http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
369 Adds a category to WebScriptObject with array accessors for KVC/KVO.
371 If super valueForKey: fails it will call valueForUndefinedKey:, which is
372 important because it causes the right behavior to happen with bindings using
373 the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
375 * bindings/objc/WebScriptObject.mm:
376 (-[WebScriptObject valueForKey:]):
377 (-[WebScriptObject count]):
378 (-[WebScriptObject objectAtIndex:]):
379 (-[WebUndefined description]): return "undefined"
381 2006-04-13 Geoffrey Garen <ggaren@apple.com>
386 (KJS::InterpreterImp::initGlobalObject): Add the built-in object
387 prototype to the end of the global object's prototype chain instead of
388 just blowing away its existing prototype. We need to do this because
389 the window object has a meaningful prototype now.
391 2006-04-13 Maciej Stachowiak <mjs@apple.com>
395 - fix testkjs to not show false-positive KJS::Node leaks in debug builds
401 2006-04-11 Geoffrey Garen <ggaren@apple.com>
405 Minor code cleanup -- passes all the JS tests.
407 * kjs/object_object.cpp:
408 (ObjectObjectImp::construct):
409 (ObjectObjectImp::callAsFunction):
411 2006-04-11 Darin Adler <darin@apple.com>
413 - another attempt to fix Windows build -- Vector in Forward.h was not working
415 * kxmlcore/Forward.h: Remove Vector.
416 * kxmlcore/Vector.h: Add back default arguments, remove include of
419 2006-04-11 Darin Adler <darin@apple.com>
421 - try to fix Windows build -- HashForward.h was not working
423 * kxmlcore/HashForward.h: Removed.
425 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
426 * kjs/collector.h: Remove use of HashForward.h.
427 * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
429 * kxmlcore/HashMap.h: Ditto.
430 * kxmlcore/HashSet.h: Ditto.
432 2006-04-11 David Harrison <harrison@apple.com>
436 - fixed clean build, broken by Darin's check-in
438 * kjs/date_object.cpp: Add needed include of lookup.h.
439 * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
441 2006-04-10 Darin Adler <darin@apple.com>
443 Rubber-stamped by John Sullivan.
445 - switched from a shell script to a makefile for generated files
446 - removed lots of unneeded includes
447 - added new Forward.h and HashForward.h headers that allow compiling with
448 fewer unneeded templates
450 * DerivedSources.make: Added.
451 * generate-derived-sources: Removed.
452 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
455 * kxmlcore/Forward.h: Added.
456 * kxmlcore/HashForward.h: Added.
458 * kxmlcore/HashCountedSet.h: Include HashForward for default args.
459 * kxmlcore/HashMap.h: Ditto.
460 * kxmlcore/HashSet.h: Ditto.
464 Moved KJS_MAX_STACK into the .cpp file.
466 * bindings/NP_jsobject.cpp:
467 * bindings/c/c_instance.h:
468 * bindings/jni/jni_class.h:
469 * bindings/jni/jni_runtime.h:
470 * bindings/jni/jni_utility.h:
471 * bindings/objc/WebScriptObject.mm:
472 * bindings/objc/WebScriptObjectPrivate.h:
473 * bindings/objc/objc_class.h:
474 * bindings/objc/objc_class.mm:
475 * bindings/objc/objc_instance.h:
476 * bindings/objc/objc_instance.mm:
477 * bindings/objc/objc_runtime.mm:
478 * bindings/objc/objc_utility.mm:
479 * bindings/runtime.h:
480 * bindings/runtime_array.cpp:
481 * bindings/runtime_array.h:
482 * bindings/runtime_method.cpp:
483 * bindings/runtime_method.h:
484 * bindings/runtime_object.cpp:
485 * bindings/runtime_root.h:
486 * kjs/JSImmediate.cpp:
488 * kjs/array_object.cpp:
489 * kjs/array_object.h:
490 * kjs/bool_object.cpp:
495 * kjs/error_object.h:
496 * kjs/function_object.h:
499 * kjs/math_object.cpp:
503 * kjs/number_object.cpp:
504 * kjs/number_object.h:
505 * kjs/object_object.cpp:
506 * kjs/operations.cpp:
507 * kjs/protected_reference.h:
509 * kjs/reference_list.h:
510 * kjs/regexp_object.h:
511 * kjs/string_object.cpp:
512 * kjs/string_object.h:
516 * kxmlcore/HashTable.h:
517 * kxmlcore/ListRefPtr.h:
518 * kxmlcore/TCPageMap.h:
520 Removed unneeded header includes.
522 2006-04-09 Geoffrey Garen <ggaren@apple.com>
526 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
527 prevent unnecessary entries in the "nodes with extra refs" hash table
529 This patch switches manually RefPtr exchange with use of
530 RefPtr::release to ensure that a node's ref count never tops 1
531 (in the normal case).
534 (BlockNode::BlockNode):
535 (CaseBlockNode::CaseBlockNode):
537 (KJS::ArrayNode::ArrayNode):
538 (KJS::ObjectLiteralNode::ObjectLiteralNode):
539 (KJS::ArgumentsNode::ArgumentsNode):
540 (KJS::VarStatementNode::VarStatementNode):
541 (KJS::ForNode::ForNode):
542 (KJS::CaseClauseNode::CaseClauseNode):
543 (KJS::FuncExprNode::FuncExprNode):
544 (KJS::FuncDeclNode::FuncDeclNode):
546 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
550 One more attempt - use reinterpret_cast, rather than static_cast.
552 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
556 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
558 * kxmlcore/unicode/icu/UnicodeIcu.h:
559 (KXMLCore::Unicode::toLower):
560 (KXMLCore::Unicode::toUpper):
562 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
566 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
567 toLowerCase and toUpperCase don't honor special mappings
569 Test: fast/js/string-capitalization.html
571 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
572 * icu/unicode/putil.h: Added (copied from WebCore).
573 * icu/unicode/uiter.h: Ditto.
574 * icu/unicode/ustring.h: Ditto.
575 * kjs/string_object.cpp:
576 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
577 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
578 * kjs/ustring.h: Ditto.
580 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
581 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
583 * kxmlcore/unicode/icu/UnicodeIcu.h:
584 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
585 (KXMLCore::Unicode::toUpper): Ditto.
586 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
587 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
588 (KXMLCore::Unicode::category): Ditto.
589 * kxmlcore/unicode/qt4/UnicodeQt4.h:
590 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
591 (KXMLCore::Unicode::toUpper): Ditto.
592 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
593 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
594 (KXMLCore::Unicode::category): Ditto.
596 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
597 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
599 2006-04-05 Darin Adler <darin@apple.com>
601 - attempt to fix Windows build
603 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
604 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
606 2006-04-05 Darin Adler <darin@apple.com>
608 - attempt to fix Windows build
610 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
612 2006-04-05 Darin Adler <darin@apple.com>
616 - fix memory leak introduced by the previous change
618 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
619 the value in question is a pair where one of the pair needs a ref and the other
620 of the pair does not.
622 2006-04-05 Darin Adler <darin@apple.com>
626 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
627 StringImpl hash traits deleted value creates an init routine for WebCore
628 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
630 Change HashMap and HashSet implementation so they fold various types together.
631 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
632 and WebCore::String in terms of the underlying raw pointer type, and hence use
633 -1 for the deleted value.
635 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
636 type to be used when storing a value that has the same layout as the type itself.
637 This is used only for non-key cases. In the case of keys, the hash function must also
638 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
639 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
640 explicit reference counting. If the type itself has needsRef true, but the storage
641 type has needsRef false, then the HashSet or HashMap has to handle the reference
642 counting explicitly. Added hash trait specializations for all signed integer values
643 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
644 integer type of the same size so int and long will share code. Gave all pointers and
645 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
646 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
647 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
648 Useful for types where we don't want to force the existence of deletedValue, such as
649 the type of a pair in a HashMap which is not the actual storage type. Removed an
650 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
651 template, which determines what type can be used to store a given hash key type with
652 a given hash function, and specialized it for pointers and RefPtr so that pointer
653 hash tables share an underlying HashTable that uses IntHash.
655 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
656 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
657 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
658 tables where the type stored is not the same as the real value type.
660 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
661 integer type given a sizeof value. Renamed pointerHash to intHash and made it
662 use overloading and take integer parameters. Added an IntHash struct which is
663 a hash function that works for integers. Changed PtrHash to call IntHash with
664 an appropriately sized integer. Made IntHash the default hash function for
665 many integer types. Made PtrHash the default hash function for RefPtr as well
668 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
669 derived from the new traits. The HashTable will use the storage type and all
670 necessary translation and ref/deref is done at the HashSet level. Also reorganized
671 the file so that the HashSet is at the top and has no inline implementation inside
672 it so it's easy to read the interface to HashSet.
674 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
675 derived from the new traits. The HashTable will use the storage type and all
676 necessary translation and ref/deref is done at the HashMap level. Also reorganized
677 the file so that the HashMap is at the top and has no inline implementation inside
678 it so it's easy to read the interface to HashMap.
680 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
682 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
683 and also remove some unnecessary build settings from the aggregate target that
684 generates derived sources.
685 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
687 2006-04-04 Timothy Hatcher <timothy@apple.com>
691 The Debug and Release frameworks are now built with install paths relative to the build products directory.
692 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
694 * JavaScriptCore.xcodeproj/project.pbxproj:
696 2006-04-04 Eric Seidel <eseidel@apple.com>
701 Disable ASSERT redefinition warnings for now.
703 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
704 * kxmlcore/Assertions.h:
706 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
708 Reviewed by ggaren & darin. Landed by eseidel.
710 Integrate CURL version of gettimeofday
711 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
712 Disable crash report dialogs for testkjs.exe in Release mode
713 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
718 (StopWatch::getElapsedMS):
722 2006-04-04 Eric Seidel <eseidel@apple.com>
726 * kjs/number_object.cpp:
727 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
729 2006-03-12 Maciej Stachowiak <mjs@apple.com>
733 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
734 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
736 * kjs/number_object.cpp:
737 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
738 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
739 plus a bit of refactoring.
741 2006-04-03 Darin Adler <darin@apple.com>
743 - tweak config.h and Platform.h to try to get buildbot working
744 (making some small changes at the same time)
746 * kjs/config.h: Removed now-unneeded HAVE_ICU.
747 * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
748 USE stuff to the end.
750 2006-04-03 George Staikos <staikos@opensource.apple.com>
754 Fix Win32 build breakage from previous commit, remove unused forward.
756 2006-04-03 George Staikos <staikos@opensource.apple.com>
760 Implement a unicode abstraction layer to make JavaScriptCore much more
761 easily ported to other platforms without having to take in libicu. Also
762 makes the unicode related code easier to understand.
764 2006-04-03 Timothy Hatcher <timothy@apple.com>
768 Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
769 Other 64 bit build fixes.
772 (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
774 (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
775 * bindings/jni/jni_utility.cpp:
776 (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
777 (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
778 * bindings/runtime_root.cpp:
779 (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
780 (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
782 2006-03-31 Darin Adler <darin@apple.com>
786 - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
788 * bindings/objc/WebScriptObject.h: Fixed comment.
790 2006-03-31 Eric Seidel <eseidel@apple.com>
794 A bit more code cleanup.
796 * bindings/c/c_utility.cpp:
797 (KJS::Bindings::convertValueToNPVariant):
798 * bindings/objc/objc_runtime.mm:
799 (convertValueToObjcObject):
800 * bindings/objc/objc_utility.mm:
801 (KJS::Bindings::convertValueToObjcValue):
803 (KJS::GlobalFuncImp::callAsFunction):
804 * kjs/interpreter.cpp:
805 (KJS::ExecState::lexicalInterpreter):
807 * kjs/operations.cpp:
810 2006-03-30 Eric Seidel <eseidel@apple.com>
814 Small code-style update.
816 * kjs/operations.cpp:
829 2006-03-31 Anders Carlsson <andersca@mac.com>
833 Make sure the GetterSetterImp objects are marked as well.
836 (KJS::GetterSetterImp::mark):
839 2006-03-30 Eric Seidel <eseidel@apple.com>
843 * kjs/nodes.h: Some various small style fixes.
845 2006-03-30 Eric Seidel <eseidel@apple.com>
849 Clean-up style issues in node.h, remove redundant initializations.
852 (KJS::StatementNode::evaluate):
853 (KJS::ArrayNode::ArrayNode):
854 (KJS::ObjectLiteralNode::ObjectLiteralNode):
855 (KJS::ArgumentsNode::ArgumentsNode):
856 (KJS::NewExprNode::NewExprNode):
857 (KJS::CaseClauseNode::CaseClauseNode):
858 (KJS::FuncDeclNode::FuncDeclNode):
860 2006-03-30 Tim Omernick <timo@apple.com>
864 <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
867 * bindings/runtime.h:
868 (KJS::Bindings::Instance::implementsCall):
869 New method. Returns false by default. Concrete subclasses can override this return true when
870 the bound object may be called as a function.
871 (KJS::Bindings::Instance::invokeDefaultMethod):
872 Since bound objects are no longer treated as functions by default, we can return jsUndefined()
873 here instead of in concrete subclasses that decide not to implement the default method
876 * bindings/runtime_object.cpp:
877 (RuntimeObjectImp::implementsCall):
878 Don't assume that the bound object is a function; instead, let the object instance decide whether
881 * bindings/c/c_instance.h:
882 * bindings/c/c_instance.cpp:
883 (KJS::Bindings::CInstance::implementsCall):
884 The object is callable if its class has an invokeDefault function.
886 * bindings/objc/objc_instance.h:
887 * bindings/objc/objc_instance.mm:
888 (ObjcInstance::implementsCall):
889 The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
891 * bindings/jni/jni_instance.h:
892 * bindings/jni/jni_instance.cpp:
893 Moved bogus invokeDefaultMethod() to superclass.
895 2006-03-29 Geoffrey Garen <ggaren@apple.com>
899 - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
900 Regression: crash in malloc_consolidate if you use a .PAC file
902 The crash was a result of threaded deallocation of thread-unsafe
903 objects. Pure JS objects are thread-safe because all JS execution
904 is synchronized through JSLock. However, JS objects that wrap WebCore
905 objects are thread-unsafe because JS and WebCore execution are not
906 synchronized. That unsafety comes into play when the collector
907 deallocates a JS object that wraps a WebCore object, thus causing the
908 WebCore object to be deallocated.
910 The solution here is to have each JSCell know whether it is safe to
911 collect on a non-main thread, and to avoid collecting unsafe cells
912 when on a non-main thread.
914 We don't have a way to test PAC files yet, so there's no test
915 attached to this patch.
918 (KJS::Collector::collect):
919 (1) Added the test "currentThreadIsMainThread ||
920 imp->m_destructorIsThreadSafe".
923 (KJS::gcProtectNullTolerant):
924 (KJS::gcUnprotectNullTolerant):
926 (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
927 m_destructorIsThreadSafe becomes another whole word, ruining the
928 collector optimizations we've made based on the size of a JSObject.
929 * kxmlcore/FastMalloc.cpp:
930 (KXMLCore::currentThreadIsMainThread):
931 (KXMLCore::fastMallocRegisterThread):
932 * kxmlcore/FastMalloc.h:
934 2006-03-28 Darin Adler <darin@apple.com>
938 - change some code that resulted in init routines on Mac OS X -- if the framework has
939 init routines it will use memory and slow down applications that link with WebKit
940 even in cases where those applications don't use WebKit
942 * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
943 to use immediate numbers instead. Apparently, double constant expressions of the type we
944 had here are evaluated at load time.
946 * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
947 ListImp, so go back to using a plain old pointer.
948 (KJS::List::List): Set overflow to 0 when initializing ListImp.
949 (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
950 (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
951 a swap of OwnArrayPtr.
952 (KJS::List::copyFrom): Remove now-unneeded get().
953 (KJS::List::copyTail): Ditto.
955 * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
956 a static initializer routine. Had to get rid of one level of constant to get the compiler
957 to understand it could initialize without any code.
959 - added a build step that checks for init routines
961 * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
962 was replaced by the generate-derived-sources script a while back. Added a custom build
963 phase that invokes the check-for-global-initializers script.
965 2006-03-28 Timothy Hatcher <timothy@apple.com>
969 fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
971 * bindings/npapi.h: added #defines after the #ifndefs
973 2006-03-27 Maciej Stachowiak <mjs@apple.com>
977 - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
980 (Node::deref): take into account the case where the extra refcount table was never created
982 2006-03-23 David Carson <dacarson@gmail.com>
986 - JSObject in LiveConnect not working.
987 http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
989 * bindings/jni_jsobject.cpp:
990 (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
991 class, and the GetFieldID was using the wrong signature.
993 2006-03-23 Darin Adler <darin@apple.com>
999 * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
1000 Also add -Y 3 option for linker.
1002 2006-03-23 Darin Adler <darin@apple.com>
1006 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
1007 REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
1009 * kjs/object.h: Take function name, as well as source URL and line number, when
1010 using the special overloaded construct for making functions.
1011 * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
1012 * kjs/function_object.h: Ditto.
1013 * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
1014 constructing the function rather than null. Use "anonymous" when making a
1015 function using the default function constructor.
1017 * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
1018 a function declaration.
1022 * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
1024 2006-03-23 Darin Adler <darin@apple.com>
1028 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
1029 LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
1031 * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
1032 * bindings/c/c_utility.cpp:
1033 (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
1034 BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
1035 OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
1036 one case and remove a _NPN_ReleaseObject in another because this
1037 should return a retained value.
1038 (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
1039 NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
1041 * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
1042 CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
1043 * bindings/c/c_runtime.cpp:
1044 (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
1046 (KJS::Bindings::CField::name): Added. Returns the string from inside the
1048 (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
1049 on the result of getProperty after using it to fix a storage leak.
1050 (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
1051 after pasing a value to setProperty now that the conversion function does a retain.
1053 * bindings/c/c_instance.cpp:
1054 (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
1055 stack buffer. Removed special case for NPVARIANT_IS_VOID because the
1056 convertNPVariantToValue function handles that properly.
1057 (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
1059 * bindings/NP_jsobject.h: Formatting changes only.
1060 * bindings/NP_jsobject.cpp:
1061 (jsDeallocate): Changed parameter type so we don't need a function cast.
1062 (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
1063 (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1064 (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
1065 (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1067 * bindings/c/c_class.cpp: Formatting changes only.
1068 * bindings/c/c_class.h: Formatting changes only.
1070 * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
1071 NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
1072 NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
1073 NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
1074 NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
1075 NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
1076 NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
1077 NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
1078 NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
1079 NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
1080 * bindings/npruntime.cpp:
1081 (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
1082 integer dictionary since the default behavior is fine for integers.
1084 2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1086 Reviewed and landed by Maciej.
1088 - WebKit no longer builds with bison 2.1
1089 http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
1091 * generate-derived-sources: Handle generated header named either grammar.cpp.h
1094 2006-03-22 Maciej Stachowiak <mjs@apple.com>
1098 * JavaScriptCore.xcodeproj/project.pbxproj:
1100 2006-03-21 Maciej Stachowiak <mjs@apple.com>
1102 * kjs/generate-derived-sources: Set executable property.
1104 2006-03-21 Maciej Stachowiak <mjs@apple.com>
1108 Ensure that generated source dependencies are handled properly, as follows:
1110 - Made an external script that generates the sources into a
1111 DerivedSources dir in the build products directory.
1112 - Added a new build target that builds all the generated sources
1113 if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
1114 - Added the DerivedSources dir in question to the include path.
1115 - Added the new DerivedSources dir and its contents to the project as build-relative.
1117 * JavaScriptCore.xcodeproj/project.pbxproj:
1118 * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
1121 2006-03-11 Maciej Stachowiak <mjs@apple.com>
1125 - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
1126 http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
1129 (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
1131 2006-03-16 Maciej Stachowiak <mjs@apple.com>
1135 - tweaks to my change to redo KJS::Node refcounting
1141 (Node::clearNewNodes):
1144 2006-03-16 Darin Adler <darin@apple.com>
1148 - fixed Vector so that you can pass a reference to something in the vector
1149 to the append or insert functions
1151 * kxmlcore/Vector.h:
1152 (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
1153 and return the adjusted value of the pointer.
1154 (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
1155 adding the new element. Makes the case where the element moves when the vector
1157 (KXMLCore::Vector::insert): Ditto.
1159 2006-03-15 Eric Seidel <eseidel@apple.com>
1165 * kjs/date_object.cpp:
1166 (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
1168 2006-03-15 Eric Seidel <eseidel@apple.com>
1172 Fix CString copy constructor, fixes Date.parse("") on Win32.
1174 * kjs/date_object.cpp:
1175 (KJS::DateProtoFunc::callAsFunction):
1177 (KJS::CString::CString):
1178 (KJS::CString::operator=):
1180 2006-03-13 Maciej Stachowiak <mjs@apple.com>
1184 - KJS::Node and KJS::StatementNode are bigger than they need to be
1185 http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
1187 The memory usage of Node was reduced by 2 machine words per node:
1189 - sourceURL was removed and only kept on FunctionBodyNode. The
1190 source URL can only be distinct per function or top-level program node,
1191 and you always have one.
1193 - refcount was removed and kept in a separate hashtable when
1194 greater than 1. newNodes set represents floating nodes with
1195 refcount of 0. This helps because almost all nodes have a refcount of 1
1196 for almost all of their lifetime.
1198 * bindings/runtime_method.cpp:
1199 (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
1201 (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
1202 them at the appropriate time.
1204 (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
1206 (KJS::ContextImp::pushIteration): moved here from LabelStack
1207 (KJS::ContextImp::popIteration): ditto
1208 (KJS::ContextImp::inIteration): ditto
1209 (KJS::ContextImp::pushSwitch): ditto
1210 (KJS::ContextImp::popSwitch): ditto
1211 (KJS::ContextImp::inSwitch): ditto
1213 (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
1214 (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
1215 (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
1216 (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
1218 (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
1220 * kjs/function.h: Move body field from DeclaredFunctionImp to
1222 * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
1224 (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
1225 and m_switchDepth data members. New FunctionBodyNode* parameter - the
1226 function body provides source URL and SourceId.
1227 (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
1228 (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
1231 (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
1232 statement label stacks don't need these and it bloats their size. Put them
1233 in the ContextImp instead.
1234 * kjs/interpreter.cpp:
1235 (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
1236 * kjs/interpreter.h:
1237 (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
1238 (KJS::ExecState::context): ditto
1239 (KJS::ExecState::setException): Renamed _exception to m_exception
1240 (KJS::ExecState::clearException): ditto
1241 (KJS::ExecState::exception): ditto
1242 (KJS::ExecState::hadException): ditto
1243 (KJS::ExecState::ExecState): ditto both above renames
1245 (Node::Node): Removed initialization of line, source URL and refcount. Add to
1246 local newNodes set instead of involving parser.
1247 (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
1248 HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
1250 (Node::deref): ditto
1251 (Node::refcount): ditto
1252 (Node::clearNewNodes): Destroy anything left in the new nodes set.
1253 (currentSourceId): Inline helper to get sourceId from function body via context.
1254 (currentSourceURL): ditto for sourceURL.
1255 (Node::createErrorCompletion): use new helper
1256 (Node::throwError): ditto
1257 (Node::setExceptionDetailsIfNeeded): ditto
1258 (StatementNode::StatementNode): remove initialization of l0 and sid, rename
1260 (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
1261 (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
1262 (StatListNode::StatListNode): updated for setLoc changes
1263 (BlockNode::BlockNode): ditto
1264 (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
1265 (WhileNode::execute): ditto
1266 (ForNode::execute): ditto
1267 (ForInNode::execute): ditto
1268 (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
1269 (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
1270 (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
1271 (FunctionBodyNode::FunctionBodyNode): update for new setLoc
1272 (FunctionBodyNode::processFuncDecl): reindent
1273 (SourceElementsNode::SourceElementsNode): update for new setLoc
1275 (KJS::Node::lineNo): Renamed _line to m_line
1276 (KJS::StatementNode::firstLine): Use lineNo()
1277 (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
1278 (KJS::FunctionBodyNode::sourceId): added
1279 (KJS::FunctionBodyNode::sourceURL): added
1282 2006-03-14 Geoffrey Garen <ggaren@apple.com>
1284 - Fixed <rdar://problem/4478239> string sort puts "closed" before
1290 (KJS::compare): Inverted a < in order to treat the longer string as >
1293 2006-03-12 Alexey Proskuryakov <ap@nypop.com>
1297 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
1298 REGRESSION: Flash callback to JavaScript function not working.
1300 Test: plugins/invoke.html
1302 * bindings/c/c_utility.cpp:
1303 (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
1305 2006-03-08 Eric Seidel <eseidel@apple.com>
1309 Partially fix JS on win32 by fixing hash table generation.
1311 * kjs/create_hash_table: limit << results to 32 bits.
1313 (TestFunctionImp::callAsFunction):
1315 2006-03-07 Darin Adler <darin@apple.com>
1317 * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
1319 2006-03-07 Darin Adler <darin@apple.com>
1323 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
1324 unwanted output while running layout tests
1326 * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
1327 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
1328 to standard output. I think we should arrange for the error text to be in JavaScript
1329 exceptions instead at some point.
1330 * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
1331 too-large size rather than allocating a buffer smaller than requested.
1333 2006-03-06 David Carson <dacarson@gmail.com>
1335 Reviewed by Darin, landed by ap.
1337 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
1338 c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
1340 Tested with test case from:
1341 http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
1343 * bindings/c_utility.cpp
1344 (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
1345 * icu/unicode/ucnv.h: Copied from WebCore.
1346 * icu/unicode/ucnv_err.h: Ditto.
1347 * icu/unicode/uenum.h: Ditto.
1349 2006-03-05 Darin Adler <darin@apple.com>
1351 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
1353 2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
1355 Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
1357 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
1358 REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
1360 * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
1362 2006-03-05 Darin Adler <darin@apple.com>
1366 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
1367 get all references to KJS::Node out of internal.h
1369 * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
1371 * kjs/Parser.cpp: Added.
1372 * kjs/Parser.h: Added.
1374 * kjs/internal.cpp: Removed the Parser class.
1375 * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
1376 not used in this header.
1378 * kjs/nodes.h: Added an include of "Parser.h".
1379 * kjs/function.h: Added a declaration of FunctionBodyNode.
1381 2006-03-05 Geoffrey Garen <ggaren@apple.com>
1385 - JSC support for the fix for <rdar://problem/4467143> JavaScript
1386 enumeration of HTML element properties skips DOM node properties
1389 (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
1390 class definiton macro needs to know about the prototype's prototype so
1391 that the class constructor properly sets it.
1392 (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
1393 implementation macro does not need to know about the prototype's
1394 prototype, since getOwnPropertySlot should only look in the current
1395 object's property map, and not its prototype's.
1397 2006-03-05 Andrew Wellington <proton@wiretapped.net>
1399 Reviewed by Eric, landed by ap.
1401 - Remove unused breakpoint bool from StatementNodes. No test provided as
1402 there is no functionality change.
1405 (StatementNode::StatementNode):
1408 2006-03-03 Geoffrey Garen <ggaren@apple.com>
1412 - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at
1413 http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
1415 This regression was caused by my fix for 4448098. I failed to account for the
1416 deleted entry sentinel in the mehtod that saves the contents of a property map to
1417 the back/forward cache.
1419 Manual test in WebCore/manual-tests/property-map-save-crash.html
1421 * kjs/property_map.cpp:
1422 (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
1423 (KJS::isValid): New function: checks if a key is null or the deleted sentinel
1424 (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
1425 and a slight performance win
1426 (KJS::PropertyMap::clear):
1427 (KJS::PropertyMap::rehash):
1428 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1429 (KJS::PropertyMap::save): Check keys with isValid()
1431 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1433 - now fix mac build again
1435 * kjs/identifier.cpp:
1437 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1439 Rubber stamped by Anders and Eric.
1441 - add fpconst.cpp to win32 build, it is now needed
1443 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1446 2006-03-02 Maciej Stachowiak <mjs@apple.com>
1450 - fix windows build, broken by my last patch
1452 * kjs/JSImmediate.cpp:
1453 * kjs/identifier.cpp:
1454 * kxmlcore/FastMalloc.cpp:
1455 * kxmlcore/Platform.h:
1457 2006-03-01 Maciej Stachowiak <mjs@apple.com>
1461 - Set up new prototype macros and avoid using #if without defined() in JSC
1463 Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
1464 are defined, and to separate core OS-level dependencies from operating environment
1465 dependencies so you can, e.g., build KDE on Mac or Windows.
1467 * kxmlcore/Platform.h: Added.
1469 - deploy them everywhere in JavaScriptCore
1471 * JavaScriptCore.xcodeproj/project.pbxproj:
1472 * bindings/jni/jni_utility.cpp:
1473 (KJS::Bindings::convertValueToJValue):
1474 * bindings/objc/WebScriptObject.mm:
1475 * bindings/objc/objc_instance.mm:
1476 (ObjcInstance::end):
1477 * bindings/softlinking.h:
1478 * bindings/testbindings.mm:
1481 * kjs/collector.cpp:
1482 (KJS::Collector::markCurrentThreadConservatively):
1483 (KJS::Collector::markOtherThreadConservatively):
1484 (KJS::Collector::markStackObjectsConservatively):
1486 * kjs/date_object.cpp:
1489 (KJS::DateProtoFunc::callAsFunction):
1490 (KJS::DateObjectImp::construct):
1497 * kjs/identifier.cpp:
1499 * kjs/interpreter.cpp:
1500 (KJS::Interpreter::evaluate):
1501 (KJS::Interpreter::createLanguageInstanceForValue):
1502 * kjs/interpreter.h:
1505 * kjs/math_object.cpp:
1508 * kjs/operations.cpp:
1515 (KJS::RegExp::RegExp):
1516 (KJS::RegExp::~RegExp):
1517 (KJS::RegExp::match):
1522 (StopWatch::getElapsedMS):
1525 * kxmlcore/AlwaysInline.h:
1526 * kxmlcore/Assertions.cpp:
1527 * kxmlcore/Assertions.h:
1528 * kxmlcore/FastMalloc.cpp:
1530 * kxmlcore/FastMalloc.h:
1531 * kxmlcore/FastMallocInternal.h:
1532 * kxmlcore/HashTable.h:
1533 * kxmlcore/TCPageMap.h:
1534 * kxmlcore/TCSpinLock.h:
1535 (TCMalloc_SpinLock::Lock):
1536 (TCMalloc_SpinLock::Unlock):
1537 (TCMalloc_SlowLock):
1538 * kxmlcore/TCSystemAlloc.cpp:
1539 (TCMalloc_SystemAlloc):
1540 * os-win32/stdint.h:
1542 2006-02-28 Geoffrey Garen <ggaren@apple.com>
1546 - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry
1547 placeholder to -1 from UString::Rep::null
1549 This turned out to be only a small speedup (.12%). That's within the
1550 margin of error for super accurate JS iBench, but Shark confirms the
1551 same, so I think it's worth landing.
1553 FYI, I also confirmed that the single entry optimization in
1554 PropertyMap is a 3.2% speedup.
1556 * kjs/property_map.cpp:
1557 (KJS::PropertyMap::~PropertyMap):
1558 (KJS::PropertyMap::clear):
1559 (KJS::PropertyMap::put):
1560 (KJS::PropertyMap::insert):
1561 (KJS::PropertyMap::rehash):
1562 (KJS::PropertyMap::remove):
1563 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1564 (KJS::PropertyMap::checkConsistency):
1565 * kjs/property_map.h:
1566 (KJS::PropertyMap::deletedSentinel):
1568 2006-02-27 Eric Seidel <eseidel@apple.com>
1570 Rubber-stamped by darin.
1572 Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
1574 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1576 2006-02-27 Eric Seidel <eseidel@apple.com>
1580 Fix Assertions.cpp to compile on win32.
1582 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1583 * kxmlcore/Assertions.cpp:
1585 2006-02-27 Eric Seidel <eseidel@apple.com>
1589 Made Assertions.cpp platform independent.
1590 Moved mac-specific logging logic up into WebCore.
1591 http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
1593 * JavaScriptCore.xcodeproj/project.pbxproj:
1594 * kxmlcore/Assertions.cpp: Added.
1595 * kxmlcore/Assertions.h:
1596 * kxmlcore/Assertions.mm: Removed.
1598 2006-02-27 Darin Adler <darin@apple.com>
1600 - fixed Mac Debug build, there was an unused parameter
1602 * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
1603 Remove parameter name.
1605 * kjs/debugger.h: Fixed comment.
1607 2006-02-27 Eric Seidel <eseidel@apple.com>
1611 * kxmlcore/Vector.h:
1612 (KXMLCore::deleteAllValues): fix unused variable warning
1614 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1618 - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
1619 http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
1621 * JavaScriptCore.xcodeproj/project.pbxproj:
1622 * bindings/NP_jsobject.cpp:
1624 (_NPN_InvokeDefault):
1628 (_NPN_RemoveProperty):
1631 * bindings/c/c_class.h:
1632 (KJS::Bindings::CClass::constructorAt):
1633 * bindings/c/c_utility.cpp:
1634 (KJS::Bindings::convertNPVariantToValue):
1635 * bindings/jni/jni_class.cpp:
1636 (JavaClass::methodsNamed):
1637 (JavaClass::fieldNamed):
1638 * bindings/jni/jni_instance.cpp:
1639 (JavaInstance::invokeDefaultMethod):
1640 * bindings/jni/jni_jsobject.cpp:
1641 * bindings/jni/jni_objc.mm:
1642 (-[NSObject KJS::Bindings::]):
1643 * bindings/objc/WebScriptObject.mm:
1644 (+[WebUndefined allocWithZone:]):
1645 (-[WebUndefined initWithCoder:]):
1646 (-[WebUndefined encodeWithCoder:]):
1647 (-[WebUndefined copyWithZone:]):
1648 * bindings/objc/objc_class.h:
1649 (KJS::Bindings::ObjcClass::constructorAt):
1650 * bindings/objc/objc_class.mm:
1651 (KJS::Bindings::ObjcClass::methodsNamed):
1652 (KJS::Bindings::ObjcClass::fallbackObject):
1653 * bindings/objc/objc_instance.mm:
1654 (ObjcInstance::getValueOfUndefinedField):
1655 * bindings/objc/objc_runtime.mm:
1656 (ObjcFallbackObjectImp::getOwnPropertySlot):
1657 (ObjcFallbackObjectImp::put):
1658 (ObjcFallbackObjectImp::canPut):
1659 (ObjcFallbackObjectImp::deleteProperty):
1660 (ObjcFallbackObjectImp::toBoolean):
1661 * bindings/runtime.cpp:
1662 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1663 * bindings/runtime.h:
1664 (KJS::Bindings::Instance::getValueOfUndefinedField):
1665 (KJS::Bindings::Instance::setValueOfUndefinedField):
1666 * bindings/runtime_array.cpp:
1667 (RuntimeArray::lengthGetter):
1668 (RuntimeArray::indexGetter):
1669 (RuntimeArray::put):
1670 (RuntimeArray::deleteProperty):
1671 * bindings/runtime_method.cpp:
1672 (RuntimeMethod::lengthGetter):
1673 (RuntimeMethod::execute):
1674 * bindings/runtime_object.cpp:
1675 (RuntimeObjectImp::fallbackObjectGetter):
1676 (RuntimeObjectImp::fieldGetter):
1677 (RuntimeObjectImp::methodGetter):
1678 (RuntimeObjectImp::put):
1679 (RuntimeObjectImp::canPut):
1680 (RuntimeObjectImp::deleteProperty):
1681 (RuntimeObjectImp::defaultValue):
1682 (RuntimeObjectImp::callAsFunction):
1683 * bindings/runtime_root.cpp:
1684 (performJavaScriptAccess):
1685 * kjs/array_object.cpp:
1686 (ArrayInstance::lengthGetter):
1687 (ArrayInstance::getOwnPropertySlot):
1688 (ArrayPrototype::ArrayPrototype):
1689 (ArrayPrototype::getOwnPropertySlot):
1690 * kjs/bool_object.cpp:
1691 (BooleanObjectImp::BooleanObjectImp):
1692 * kjs/date_object.cpp:
1693 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1694 (KJS::DateObjectFuncImp::callAsFunction):
1695 * kjs/error_object.cpp:
1696 (ErrorObjectImp::ErrorObjectImp):
1697 (NativeErrorPrototype::NativeErrorPrototype):
1698 (NativeErrorImp::NativeErrorImp):
1700 (KJS::FunctionImp::argumentsGetter):
1701 (KJS::FunctionImp::lengthGetter):
1702 (KJS::Arguments::mappedIndexGetter):
1703 (KJS::ActivationImp::argumentsGetter):
1704 (KJS::ActivationImp::put):
1705 * kjs/function_object.cpp:
1706 (FunctionObjectImp::FunctionObjectImp):
1708 (KJS::GetterSetterImp::toPrimitive):
1709 (KJS::GetterSetterImp::toBoolean):
1710 * kjs/interpreter.cpp:
1711 (KJS::Interpreter::evaluate):
1712 * kjs/interpreter.h:
1713 (KJS::Interpreter::isGlobalObject):
1714 (KJS::Interpreter::interpreterForGlobalObject):
1715 (KJS::Interpreter::isSafeScript):
1717 (Lexer::makeIdentifier):
1718 (Lexer::makeUString):
1720 (KJS::staticFunctionGetter):
1721 (KJS::staticValueGetter):
1723 (StatementNode::processFuncDecl):
1724 (PropertyNode::evaluate):
1725 (PropertyNameNode::evaluate):
1726 * kjs/number_object.cpp:
1727 (NumberObjectImp::NumberObjectImp):
1728 (NumberObjectImp::getOwnPropertySlot):
1730 (KJS::JSObject::defineGetter):
1731 (KJS::JSObject::defineSetter):
1732 (KJS::JSObject::hasInstance):
1733 (KJS::JSObject::propertyIsEnumerable):
1734 * kjs/object_object.cpp:
1735 (ObjectObjectImp::ObjectObjectImp):
1736 * kjs/property_slot.cpp:
1737 (KJS::PropertySlot::undefinedGetter):
1738 (KJS::PropertySlot::functionGetter):
1739 * kjs/reference.cpp:
1740 (KJS::Reference::getPropertyName):
1741 * kjs/reference_list.cpp:
1742 (ReferenceListIterator::operator++):
1743 * kjs/regexp_object.cpp:
1744 (RegExpObjectImp::RegExpObjectImp):
1745 (RegExpObjectImp::getValueProperty):
1746 (RegExpObjectImp::putValueProperty):
1747 * kjs/string_object.cpp:
1748 (StringInstance::lengthGetter):
1749 (StringInstance::indexGetter):
1750 (StringPrototype::StringPrototype):
1751 * kxmlcore/Assertions.mm:
1752 * kxmlcore/FastMalloc.cpp:
1753 (KXMLCore::TCMalloc_PageHeap::CheckList):
1754 * kxmlcore/HashTable.h:
1755 (KXMLCore::HashTableConstIterator::checkValidity):
1756 (KXMLCore::IdentityHashTranslator::translate):
1758 (pcre_get_stringnumber):
1760 2006-02-23 Darin Adler <darin@apple.com>
1762 - try to fix buildbot failure
1764 * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
1765 recompiled after additional inlining was introduced (Xcode bug?).
1767 2006-02-23 Geoffrey Garen <ggaren@apple.com>
1769 Reviewed by Darin, Maciej.
1771 - Inline some functions suggested by Shark. 2.9% speedup on super
1774 http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
1775 <rdar://problem/4448116>
1778 (KJS::ArgumentsNode::evaluateList):
1781 (KJS::ScopeChain::release):
1782 (KJS::JSObject::toPrimitive):
1783 * kjs/scope_chain.cpp:
1786 (KJS::UString::toArrayIndex):
1789 (KJS::JSValue::toObject):
1790 * kxmlcore/FastMalloc.cpp:
1791 (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
1792 (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
1794 2006-02-21 Eric Seidel <eseidel@apple.com>
1796 Added *.user to ignore list.
1798 2006-02-21 Eric Seidel <eseidel@apple.com>
1802 Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
1804 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1805 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
1807 2006-02-21 Eric Seidel <eseidel@apple.com>
1811 * kjs/testkjs.cpp: #if out timeval code on win32
1813 2006-02-21 Michael Emmel <mike.emmel@gmail.com>
1817 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
1818 TCPageMap.h would not compile for me because string.h was missing
1820 * kxmlcore/TCPageMap.h: Added <string.h> include.
1822 2006-02-21 Darin Adler <darin@apple.com>
1824 Reviewed by John Sullivan.
1826 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
1827 remove a bunch of extra implementsCall overrides
1829 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
1831 * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
1832 we'll get a compile error if some derived class neglects to implement it.
1834 * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
1835 of param, which is an OwnPtr so it gets initialized by default.
1837 * bindings/runtime_method.cpp:
1838 * bindings/runtime_method.h:
1839 * kjs/array_object.cpp:
1840 * kjs/array_object.h:
1841 * kjs/bool_object.cpp:
1842 * kjs/bool_object.h:
1843 * kjs/date_object.cpp:
1844 * kjs/date_object.h:
1845 * kjs/error_object.cpp:
1846 * kjs/error_object.h:
1849 * kjs/function_object.cpp:
1850 * kjs/function_object.h:
1851 * kjs/math_object.cpp:
1852 * kjs/math_object.h:
1853 * kjs/number_object.cpp:
1854 * kjs/number_object.h:
1855 * kjs/object_object.cpp:
1856 * kjs/object_object.h:
1857 * kjs/regexp_object.cpp:
1858 * kjs/regexp_object.h:
1859 * kjs/string_object.cpp:
1860 * kjs/string_object.h:
1861 Removed many rendundant implementations of implementsCall from subclasses of
1862 InternalFunctionImp.
1864 2006-02-21 Darin Adler <darin@apple.com>
1868 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
1871 2006-02-21 Darin Adler <darin@apple.com>
1873 Change suggested by Mitz.
1875 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
1876 REGRESSION: Methods do not execute
1878 * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
1879 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
1880 Return true. All the classes derived from InternalFunctionImp need
1881 to return true from this -- later we can remove all the extra
1882 implementations too.
1884 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1886 - fix build breakage caused by last-minute change to my patch
1890 2006-02-20 Maciej Stachowiak <mjs@apple.com>
1892 Reviewed by Geoff and Darin.
1894 Patch from Maks Orlovich, based on work by David Faure, hand-applied and
1895 significantly reworked by me.
1897 - Patch: give internal function names (KJS merge)
1898 http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
1900 * tests/mozilla/expected.html: Updated for newly fixed test.
1902 * kjs/array_object.cpp:
1903 (ArrayProtoFunc::ArrayProtoFunc):
1904 * kjs/array_object.h:
1905 * kjs/bool_object.cpp:
1906 (BooleanPrototype::BooleanPrototype):
1907 (BooleanProtoFunc::BooleanProtoFunc):
1908 * kjs/bool_object.h:
1909 * kjs/date_object.cpp:
1910 (KJS::DateProtoFunc::DateProtoFunc):
1911 (KJS::DateObjectImp::DateObjectImp):
1912 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1913 * kjs/error_object.cpp:
1914 (ErrorPrototype::ErrorPrototype):
1915 (ErrorProtoFunc::ErrorProtoFunc):
1916 * kjs/error_object.h:
1918 (KJS::FunctionImp::FunctionImp):
1919 (KJS::GlobalFuncImp::GlobalFuncImp):
1921 * kjs/function_object.cpp:
1922 (FunctionPrototype::FunctionPrototype):
1923 (FunctionProtoFunc::FunctionProtoFunc):
1924 (FunctionProtoFunc::callAsFunction):
1925 * kjs/function_object.h:
1927 (KJS::InterpreterImp::initGlobalObject):
1928 (KJS::InternalFunctionImp::InternalFunctionImp):
1930 (KJS::InternalFunctionImp::functionName):
1932 (KJS::staticFunctionGetter):
1933 (KJS::HashEntryFunction::HashEntryFunction):
1934 (KJS::HashEntryFunction::implementsCall):
1935 (KJS::HashEntryFunction::toBoolean):
1936 (KJS::HashEntryFunction::implementsHasInstance):
1937 (KJS::HashEntryFunction::hasInstance):
1938 * kjs/math_object.cpp:
1939 (MathFuncImp::MathFuncImp):
1940 * kjs/math_object.h:
1941 * kjs/number_object.cpp:
1942 (NumberPrototype::NumberPrototype):
1943 (NumberProtoFunc::NumberProtoFunc):
1944 * kjs/number_object.h:
1946 (KJS::JSObject::putDirectFunction):
1947 (KJS::Error::create):
1949 * kjs/object_object.cpp:
1950 (ObjectPrototype::ObjectPrototype):
1951 (ObjectProtoFunc::ObjectProtoFunc):
1952 * kjs/object_object.h:
1953 * kjs/regexp_object.cpp:
1954 (RegExpPrototype::RegExpPrototype):
1955 (RegExpProtoFunc::RegExpProtoFunc):
1956 * kjs/regexp_object.h:
1957 * kjs/string_object.cpp:
1958 (StringProtoFunc::StringProtoFunc):
1959 (StringObjectImp::StringObjectImp):
1960 (StringObjectFuncImp::StringObjectFuncImp):
1961 * kjs/string_object.h:
1963 2006-02-20 Geoffrey Garen <ggaren@apple.com>
1965 Reviewed by Darin, with help from Eric, Maciej.
1967 - More changes to support super-accurate JS iBench. Doesn't work on
1968 Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
1969 opendarwin.org/show_bug.cgi?id= 7399] about that.
1971 * kjs/interpreter.cpp:
1972 (KJS::Interpreter::evaluate): Print line numbers with exception output
1973 * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the
1974 way we roll with .cpp files.
1975 (StopWatch::StopWatch): New class. Provides microsecond-accurate
1977 (StopWatch::~StopWatch):
1980 (StopWatch::getElapsedMS):
1981 (TestFunctionImp::callAsFunction): Added missing return statement.
1982 Fixed up "run" to use refactored helper functions. Removed bogus
1983 return statement from "quit" case. Made "print" output to stdout
1984 instead of stderr because that makes more sense, and PERL handles
1986 (main): Factored out KXMLCore unit tests. Removed custom exception
1987 printing code because the interpreter prints exceptions for you. Added
1988 a "delete" call for the GlobalImp we allocate.
1989 (testIsInteger): New function, result of refacotring.
1990 (createStringWithContentsOfFile): New function, result of refactoring.
1991 Renamed "code" to "buffer" to match factored-out-ness.
1993 2006-02-20 Eric Seidel <eseidel@apple.com>
1997 Fix "Copy ICU DLLs..." phase.
1999 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2000 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2002 2006-02-19 Darin Adler <darin@apple.com>
2004 - renamed ERROR to LOG_ERROR to fix build
2005 presumably Maciej had this change and forgot to land it
2007 * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
2008 * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
2009 * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
2011 2006-02-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
2013 Test: fast/js/toString-exception.html
2017 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
2018 REGRESSION: fast/js/toString-overrides.html fails when run multiple times
2020 * kjs/array_object.cpp:
2021 (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
2024 2006-02-18 Darin Adler <darin@apple.com>
2028 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
2029 add insert and remove to KXMLCore::Vector
2031 * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
2032 insert and remove to slide elements within the vector. Also added
2033 "insert" and "remove" functions.
2035 2006-02-16 Geoffrey Garen <ggaren@apple.com>
2039 - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
2040 Bindings::Instance::deref when leaving page @ gigaom.com
2042 * bindings/c/c_instance.cpp:
2043 (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
2044 globally, we shouldn't delete it, so don't.
2046 2006-02-16 Timothy Hatcher <timothy@apple.com>
2048 Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
2049 warnings. Using <rdar://problem/4448350> to track this.
2051 * JavaScriptCore.xcodeproj/project.pbxproj:
2052 * bindings/objc/objc_jsobject.h: Removed empty file.
2053 * bindings/objc/objc_jsobject.mm: Removed empty file.
2055 2006-02-16 Tim Omernick <timo@apple.com>
2059 <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
2060 javascript disabled (7015)
2062 * bindings/NP_jsobject.cpp:
2063 (_NPN_CreateNoScriptObject):
2064 Returns an NPObject which is not bound to a JavaScript object. This kind of NPObject
2065 can be given to a plugin as the "window script object" when JavaScript is disabled.
2066 The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
2067 Because of this, none of the NPN_* functions called by the plugin on this "no script
2068 object" will cause entry into JavaScript code.
2069 (_NPN_InvokeDefault):
2070 Make sure the NPVariant is filled before returning from this function. This never
2071 mattered before because we never reached this case, having only created NPObjects of
2072 the class NPScriptObjectClass.
2080 * bindings/NP_jsobject.h:
2081 Declared _NPN_CreateNoScriptObject().
2083 2006-02-16 Darin Adler <darin@apple.com>
2085 Reviewed by me, change by Peter Kuemmel.
2087 * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
2088 checking for positive infinity (rolling in fix from KDE side).
2090 2006-02-15 Geoffrey Garen <ggaren@apple.com>
2092 Reviewed by Maciej, Eric.
2094 - JavaScriptCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
2095 crashes in DashboardClient at com.apple.JavaScriptCore:
2096 KJS::Bindings::ObjcFallbackObjectImp::type()
2098 WebCore and JavaScriptCore weren't sharing Instance objects very
2099 nicely. I made them use RefPtrs, and sent them to bed without dessert.
2101 * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
2102 (JavaInstance::~JavaInstance):
2103 (JObjectWrapper::JObjectWrapper):
2104 * bindings/jni/jni_instance.h:
2105 (KJS::Bindings::JObjectWrapper::ref):
2106 (KJS::Bindings::JObjectWrapper::deref):
2107 * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
2108 (JavaArray::~JavaArray):
2109 (JavaArray::JavaArray):
2110 * bindings/jni/jni_runtime.h:
2111 (KJS::Bindings::JavaArray::operator=):
2112 * bindings/objc/objc_runtime.h:
2113 - Prohibited copying because that would muss the ref count.
2114 - Prohibited construction without instance because an instance wrapper
2115 without an instance is almost certainly a bug.
2116 * bindings/objc/objc_runtime.mm:
2117 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2118 * bindings/runtime.cpp:
2119 (KJS::Bindings::Instance::Instance):
2120 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2121 (KJS::Bindings::Instance::createRuntimeObject):
2122 * bindings/runtime.h:
2123 (KJS::Bindings::Instance::ref):
2124 (KJS::Bindings::Instance::deref):
2125 * bindings/runtime_object.cpp:
2126 (RuntimeObjectImp::RuntimeObjectImp):
2127 (RuntimeObjectImp::fallbackObjectGetter):
2128 (RuntimeObjectImp::fieldGetter):
2129 (RuntimeObjectImp::methodGetter):
2130 (RuntimeObjectImp::getOwnPropertySlot):
2131 (RuntimeObjectImp::put):
2132 (RuntimeObjectImp::canPut):
2133 * bindings/runtime_object.h:
2134 - Removed ownsInstance data member because RefPtr takes care of
2135 instance lifetime now.
2136 - Prohibited copying because that would muss the ref count.
2137 - Prohibited construction without instance because an instance wrapper
2138 without an instance is almost certainly a bug.
2139 (KJS::RuntimeObjectImp::getInternalInstance):
2141 2006-02-15 Geoffrey Garen <ggaren@apple.com>
2145 - Applied the 4330457 change to CClass and ObjcClass as well.
2147 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2150 This change isn't as critical because CClass and ObjcClass objects get
2151 cached globally and never deleted, but it's good practice, in case we
2152 ever do decide to delete CClass and ObjcClass objects.
2154 This change requires prohibiting copying, because we don't do any
2155 intelligent ref-counting -- when a Class is destroyed, it destroys its
2156 methods and fields unconditionally. (Java classes already prohibited
2159 * bindings/c/c_class.cpp:
2160 - Merged _commonInit and _commonDelete into constructor and destructor.
2163 (CClass::methodsNamed): Added delete callbacks
2164 (CClass::fieldNamed): Added delete callbacks
2165 * bindings/c/c_class.h: Prohibited copying
2166 * bindings/c/c_instance.cpp:
2167 (KJS::Bindings::CInstance::getClass): Changed to use the preferred
2168 class factory method, to take advantage of the global cache.
2170 [ Repeated changes applied to CClass for ObjcClass: ]
2172 * bindings/objc/objc_class.h:
2173 * bindings/objc/objc_class.mm:
2174 (KJS::Bindings::ObjcClass::ObjcClass):
2175 (KJS::Bindings::ObjcClass::~ObjcClass):
2176 (KJS::Bindings::ObjcClass::methodsNamed):
2177 (KJS::Bindings::ObjcClass::fieldNamed):
2178 * bindings/objc/objc_runtime.h:
2179 (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
2180 variable to prevent bad CFRelease.
2181 (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
2182 if statement to prevent bad CFRelease.
2183 * bindings/objc/objc_runtime.cpp: Changed to use the preferred
2184 ObjectStructPtr, for clarity.
2186 2006-02-14 Geoffrey Garen <ggaren@apple.com>
2190 - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
2191 in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
2194 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2197 This was a memory leak in the bindings code. The leak was so extreme
2198 that it would cause Safari or the JVM to abort from lack of memory.
2199 Upon construction, Class objects create field and method objects,
2200 storing them in CFDictionaries. The bug was that upon destruction, the
2201 class objects released the dictionaries but didn't destroy the stored
2204 The fix is to supply CFDictionary callbacks for destroying the values
2205 added to the dictionary.
2207 * bindings/jni/jni_class.cpp:
2208 (JavaClass::JavaClass): Added delete callbacks
2209 * bindings/runtime.cpp: Added definitions for delete callbacks
2210 (KJS::Bindings::deleteMethodList):
2211 (KJS::Bindings::deleteMethod):
2212 (KJS::Bindings::deleteField):
2213 * bindings/runtime.h: Added declarations for delete callbacks
2215 2006-02-14 Timothy Hatcher <timothy@apple.com>
2219 Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
2220 behavior due to POSIX version of sh
2222 * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
2224 2006-02-13 Dave Hyatt <hyatt@apple.com>
2226 Fix Win32 bustage in JavaScriptCore.
2230 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2231 Add JSImmediate to the Win32 project.
2233 * kjs/JSImmediate.h:
2234 (KJS::JSImmediate::fromDouble):
2235 (KJS::JSImmediate::toDouble):
2236 (KJS::JSImmediate::NanAsBits):
2237 (KJS::JSImmediate::oneAsBits):
2238 Win32 needs explicit returns after abort() for non-void functions.
2242 Win32 catches a bug in testkjs! The "return 2" should actually
2243 have been a return false.
2246 The extern decls of NaN and Inf need to be const.
2248 === JavaScriptCore-521.7 ===
2250 2006-02-13 Timothy Hatcher <timothy@apple.com>
2254 Replaced the old NS_DURING exception blocking with @try/@catch.
2256 * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
2257 * bindings/objc/objc_instance.mm:
2258 (ObjcInstance::invokeMethod):
2259 (ObjcInstance::invokeDefaultMethod):
2260 (ObjcInstance::setValueOfUndefinedField):
2261 (ObjcInstance::getValueOfUndefinedField):
2262 * bindings/objc/objc_runtime.mm:
2263 (ObjcField::valueFromInstance):
2264 (ObjcField::setValueToInstance):
2265 (ObjcArray::setValueAt):
2266 (ObjcArray::valueAt):
2268 2006-02-13 Darin Adler <darin@apple.com>
2270 - fix a couple problems building on Windows, based on requests
2271 from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2273 * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
2274 to the standard uint32/64_t. Also removed curious "isIEEE()" function
2275 that checked the sizes of some types (and type sizes alone don't tell you if
2276 the floating point conforms to the IEEE-standard). Added missing include
2279 * kjs/property_slot.h: Added missing include of <assert.h>.
2281 2006-02-12 Geoffrey Garen <ggaren@apple.com>
2285 Cleaned up testkjs, added new "run" functionality to allow scripting
2286 tests from within JS. ("run" is a part of my new super-accurate
2289 No regressions in run-javascriptcore-tests.
2292 (GlobalImp::className):
2293 (TestFunctionImp::):
2294 (TestFunctionImp::callAsFunction):
2298 2006-02-11 Alexey Proskuryakov <ap@nypop.com>
2302 - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2303 RealPlayer.GetTitle() Crashes Safari/Dashboard
2305 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2306 Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1,
2307 because the latter encoding has holes, and conversion can still fail.
2309 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2313 - Inlined RefPtr assignment operators. .7% performance win on
2314 super-accurate JS iBench.
2316 * kxmlcore/RefPtr.h:
2317 (KXMLCore::::operator):
2319 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2321 No review needed, just a build fix. This time for sure.
2325 2006-02-10 Geoffrey Garen <ggaren@apple.com>
2329 - Fixed build. As it goes without saying, I will not mention that I
2332 * JavaScriptCore.xcodeproj/project.pbxproj:
2333 * kjs/JSImmediate.cpp:
2334 (KJS::JSImmediate::toObject):
2336 2006-02-09 Geoffrey Garen <ggaren@apple.com>
2340 - Fixed <rdar://problem/4343730> Should switch ConstantValues (null,
2341 undefined, true, false) from JS objects to immediate values similar to
2344 2.0% performance gain on my new super-accurate version of JS iBench.
2345 (I promise to land a version of it soon.)
2347 The gist of the change:
2348 (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
2349 class (JSImmediate.h/.cpp), and it handles not only numbers but also
2350 null, undefined, true, and false.
2351 (2) JSImmediate provides convenience methods for the bit masking
2352 necessary to encode and decode immediate values.
2353 (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
2354 (4) JSCell no longer implements functions like getBoolean, because
2355 only a JSImmediate can be a boolean.
2356 (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
2357 and ALWAYS_INLINE is a non-portable option of last resort.
2358 (6) Type is now JSType, and it resides in its own file, JSType.h.
2359 Since I was there, I did some header include sorting as part of this
2362 The rest pretty much explains itself.
2364 * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
2365 added JSImmediate.h/.cpp.
2366 * bindings/c/c_instance.cpp:
2367 (KJS::Bindings::CInstance::defaultValue):
2368 * bindings/c/c_instance.h:
2369 * bindings/c/c_utility.cpp:
2370 (KJS::Bindings::convertValueToNPVariant):
2371 * bindings/jni/jni_instance.cpp:
2372 (JavaInstance::defaultValue):
2373 * bindings/jni/jni_instance.h:
2374 * bindings/jni/jni_jsobject.cpp:
2375 (JavaJSObject::convertValueToJObject):
2376 * bindings/objc/WebScriptObject.mm:
2377 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
2378 Standardized calls to use getXXX instead of hand-rolling JSValue
2380 * bindings/objc/objc_instance.h:
2381 * bindings/objc/objc_instance.mm:
2382 (ObjcInstance::getValueOfUndefinedField):
2383 (ObjcInstance::defaultValue):
2384 * bindings/objc/objc_runtime.h:
2385 * bindings/objc/objc_runtime.mm:
2386 (ObjcFallbackObjectImp::type):
2387 (ObjcFallbackObjectImp::defaultValue):
2388 * bindings/runtime.h:
2389 (KJS::Bindings::Instance::getValueOfUndefinedField):
2390 * bindings/runtime_object.cpp:
2391 (RuntimeObjectImp::defaultValue):
2392 * bindings/runtime_object.h:
2393 * kjs/JSImmediate.h: Added.
2394 (KJS::JSImmediate::isImmediate):
2395 (KJS::JSImmediate::isNumber):
2396 (KJS::JSImmediate::isBoolean):
2397 (KJS::JSImmediate::isUndefinedOrNull):
2398 (KJS::JSImmediate::fromDouble):
2399 (KJS::JSImmediate::toDouble):
2400 (KJS::JSImmediate::toBoolean):
2401 (KJS::JSImmediate::trueImmediate):
2402 (KJS::JSImmediate::falseImmediate):
2403 (KJS::JSImmediate::NaNImmediate):
2404 (KJS::JSImmediate::undefinedImmediate):
2405 (KJS::JSImmediate::nullImmediate):
2406 (KJS::JSImmediate::tag):
2407 (KJS::JSImmediate::unTag):
2408 (KJS::JSImmediate::getTag):
2409 (KJS::JSImmediate::):
2410 (KJS::JSImmediate::isIEEE):
2411 (KJS::JSImmediate::is32bit):
2412 (KJS::JSImmediate::is64bit):
2413 (KJS::JSImmediate::NanAsBits):
2414 (KJS::JSImmediate::zeroAsBits):
2415 (KJS::JSImmediate::oneAsBits):
2417 (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
2418 * kjs/JSType.h: Added.
2419 * kjs/collector.cpp:
2420 (KJS::Collector::protect):
2421 (KJS::Collector::unprotect):
2422 (KJS::Collector::collect):
2424 (KJS::StringImp::toPrimitive):
2425 (KJS::NumberImp::toPrimitive):
2426 (KJS::NumberImp::toBoolean):
2427 (KJS::GetterSetterImp::toPrimitive):
2429 (KJS::StringImp::type):
2430 (KJS::NumberImp::type):
2432 (KJS::JSObject::type):
2433 (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
2434 I'm looking for?" test with "Are you not the one thing I'm not looking
2436 (KJS::JSObject::defaultValue):
2437 (KJS::JSObject::toPrimitive):
2439 (KJS::GetterSetterImp::type):
2440 (KJS::JSValue::isObject):
2441 * kjs/operations.cpp:
2445 * kjs/reference.cpp:
2446 (KJS::Reference::deleteValue):
2447 * kjs/simple_number.h: Removed.
2448 * kjs/string_object.cpp:
2449 (StringInstance::getOwnPropertySlot): fixed indentation
2451 (KJS::JSValue::toObject):
2452 (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
2453 us to inline jsNumber without adding PIC branches to callers.
2460 (KJS::JSValue::downcast):
2461 (KJS::JSValue::isUndefinedOrNull):
2462 (KJS::JSValue::isBoolean):
2463 (KJS::JSValue::isNumber):
2464 (KJS::JSValue::isString):
2465 (KJS::JSValue::isObject):
2466 (KJS::JSValue::getBoolean):
2467 (KJS::JSValue::getNumber):
2468 (KJS::JSValue::getString):
2469 (KJS::JSValue::getObject):
2470 (KJS::JSValue::getUInt32):
2471 (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
2472 resulting in a slight performance gain. Callers should always check
2473 !marked() before calling mark(), so it's impossible to call mark on
2475 (KJS::JSValue::marked):
2476 (KJS::JSValue::type):
2477 (KJS::JSValue::toPrimitive):
2478 (KJS::JSValue::toBoolean):
2479 (KJS::JSValue::toNumber):
2480 (KJS::JSValue::toString):
2482 2006-02-06 Eric Seidel <eseidel@apple.com>
2484 Add svn:ignore properties for visual studio internals.
2486 2006-02-06 Alexey Proskuryakov <ap@nypop.com>
2490 - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
2491 http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
2493 - No tests added - only changed functionality on WIN32, which should be covered by
2496 * kjs/date_object.cpp:
2497 (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
2499 (KJS::timeZoneOffset): Removed, was basically the same as the above.
2500 (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
2501 Windows based on struct tm itself.
2502 (KJS::DateInstance::getTime): Added.
2503 (KJS::DateInstance::getUTCTime): Added.
2504 (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
2505 (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
2506 (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
2507 GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
2508 with daylight savings time being in effect.
2510 * kjs/date_object.h: Added prototypes for new functions.
2512 2006-02-05 Maciej Stachowiak <mjs@apple.com>
2516 - fixed ~1100 KJS::Node leaked on layout tests
2517 http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
2520 (KJS::Parser::noteNodeCycle):
2521 (KJS::Parser::removeNodeCycle):
2522 (KJS::clearNewNodes):
2525 (ElementNode::breakCycle):
2526 (PropertyListNode::breakCycle):
2527 (ArgumentListNode::breakCycle):
2528 (StatListNode::StatListNode):
2529 (StatListNode::breakCycle):
2530 (VarDeclListNode::breakCycle):
2531 (BlockNode::BlockNode):
2532 (ClauseListNode::breakCycle):
2533 (CaseBlockNode::CaseBlockNode):
2534 (ParameterNode::breakCycle):
2535 (SourceElementsNode::SourceElementsNode):
2536 (SourceElementsNode::breakCycle):
2538 (KJS::Node::breakCycle):
2539 (KJS::ElementNode::ElementNode):
2540 (KJS::ArrayNode::ArrayNode):
2541 (KJS::PropertyListNode::PropertyListNode):
2542 (KJS::ObjectLiteralNode::ObjectLiteralNode):
2543 (KJS::ArgumentListNode::ArgumentListNode):
2544 (KJS::ArgumentsNode::ArgumentsNode):
2545 (KJS::VarDeclListNode::VarDeclListNode):
2546 (KJS::VarStatementNode::VarStatementNode):
2547 (KJS::ForNode::ForNode):
2548 (KJS::CaseClauseNode::CaseClauseNode):
2549 (KJS::ClauseListNode::ClauseListNode):
2550 (KJS::ParameterNode::ParameterNode):
2551 (KJS::FuncExprNode::FuncExprNode):
2552 (KJS::FuncDeclNode::FuncDeclNode):
2554 2006-02-05 Maciej Stachowiak <mjs@apple.com>
2558 - fix default traits for classes to make sure default constructors get called
2560 * kxmlcore/VectorTraits.h:
2563 2006-02-04 Darin Adler <darin@apple.com>
2567 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
2568 REGRESSION: for/in loop with var changes global variable instead of making local
2570 Test: fast/js/for-in-var-scope.html
2573 (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
2574 (ForInNode::execute): Break out of the scope chain loop once we find and set the
2575 loop variable. We don't want to set multiple loop variables.
2576 (ForInNode::processVarDecls): Process the declaration of the loop variable.
2580 * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
2581 * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
2582 instead of defining it here a second time.
2584 2006-02-04 Maciej Stachowiak <mjs@apple.com>
2588 - change JavaScript collector statistics calls to use HashCountedSet instead
2589 of CFSet; other misc cleanup
2590 http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
2592 * kjs/collector.cpp:
2593 (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
2595 (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
2598 (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
2601 2006-02-03 Timothy Hatcher <timothy@apple.com>
2605 Renamed configuration names to Debug, Release and Production.
2607 * JavaScriptCore.xcodeproj/project.pbxproj:
2609 2006-02-02 George Staikos <staikos@opensource.apple.com>
2613 * kjs/lookup.h: Fix compile, merged from KDE.
2615 2006-02-02 Darin Adler <darin@apple.com>
2619 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
2620 add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
2622 * kxmlcore/Noncopyable.h: Added.
2623 * kxmlcore/OwnArrayPtr.h: Added.
2624 * kxmlcore/OwnPtr.h: Added.
2626 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
2629 * kjs/function.cpp: Use OwnPtr for Parameter pointers.
2631 * kjs/internal.h: Use Noncopyable for LabelStack.
2633 * kjs/list.cpp: Use OwnArrayPtr for overflow.
2635 * kjs/property_map.h:
2636 * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
2637 Use Vector for some stack buffers.
2639 * kjs/regexp_object.h:
2640 * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
2642 2006-01-31 Maciej Stachowiak <mjs@apple.com>
2646 - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
2647 that would catch them
2650 (NodeCounter::~NodeCounter): Added debug-only node counter.
2653 * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
2655 2006-01-31 Darin Adler <darin@apple.com>
2659 - added deleteAllValues for HashSet as well as HashMap
2660 - fixed conversion from const_iterator to iterator, which I broke a while back
2662 * kxmlcore/HashMap.h: Updated copyright date.
2663 * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
2664 * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
2666 2006-01-31 Tim Omernick <timo@apple.com>
2668 Reviewed by Geoff Garen.
2670 * bindings/c/c_utility.cpp:
2671 (KJS::Bindings::convertUTF8ToUTF16):
2672 Fixed an invalid assertion that UTF8Chars is not NULL. It is valid for it to be NULL as long as
2674 This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
2675 where JavaScript is getting a NULL string back from some call on the Real Player plugin.
2677 2006-01-30 Anders Carlsson <andersca@mac.com>
2681 Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
2682 REGRESSION: United.com menus messed up due to document.all/MSIE sniff
2685 (typeStringForValue):
2686 Return "undefined" if the given object should masquerade as undefined.
2689 (KJS::JSObject::masqueradeAsUndefined):
2690 Rename from isEqualToNull.
2692 * kjs/operations.cpp:
2694 Update for name change.
2696 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2700 - properly define Vector assignment operator; the private version was accidentally left
2701 in, and the template version is not enough to replace the default
2703 * kxmlcore/Vector.h:
2704 (KXMLCore::Vector::operator=):
2706 2006-01-29 Eric Seidel <eseidel@apple.com>
2710 Fix the build by applying a GCC-specific namespace hack.
2714 2006-01-29 Eric Seidel <eseidel@apple.com>
2720 * kjs/lookup.h: fixed ::cacheGlobalObject
2721 * kxmlcore/Vector.h:
2722 (KXMLCore::Vector::operator[]): use unsigned long
2724 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2726 Reviewed by Dave Hyatt.
2728 * kxmlcore/Vector.h:
2729 (KXMLCore::Vector::operator[]): Add unsigned overload
2731 2006-01-28 Darin Adler <darin@apple.com>
2733 Reviewed by John Sullivan.
2735 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
2736 include exception names in JavaScript form of DOM exception
2738 * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
2739 exception in the error message.
2741 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2745 - miscellaneous Vector improvements
2747 * kxmlcore/Vector.h:
2748 (KXMLCore::Vector::at): Add range-checking asserts.
2749 (KXMLCore::Vector::first): Added as a convenience.
2750 (KXMLCore::Vector::last): Convenience for stack-style use.
2751 (KXMLCore::Vector::removeLast): ditto
2753 2006-01-28 Darin Adler <darin@apple.com>
2755 Reviewed by John Sullivan
2757 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
2758 REGRESSION: JavaScript Date constructor won't accept another Date object
2760 Test: fast/js/date-constructor.html
2762 * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
2763 Added a special case for constructing one date from another (to avoid losing
2764 milliseconds, which are not in the text form, to match Firefox), and changed
2765 the base code to convert to primitive before checking for string to match
2766 the standard. Also corrected a couple silly things in the "construct from
2767 current time" code path (removed a floor that does no good, and changed
2768 the constant used to convert microseconds to milliseconds to be a 1000
2769 rather than "msPerSecond").
2771 2006-01-28 Darin Adler <darin@apple.com>
2773 * kjs/create_hash_table: Added missing license.
2775 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2777 Reviewed by Dave Hyatt.
2779 - added a Vector class
2780 http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
2782 * JavaScriptCore.xcodeproj/project.pbxproj:
2784 (KJS::Parser::saveNewNode): Apply Vector.
2785 (KJS::clearNewNodes): ditto
2786 * kjs/number_object.cpp:
2787 (integer_part_noexp): ditto
2788 (char_sequence): ditto
2790 (KJS::UString::UTF8String): ditto
2791 * kxmlcore/HashMap.h:
2792 (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
2793 other versions are useful for other containers.
2794 * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
2795 be usable for all Array/QVector style purposes, and also as a stack buffer
2796 with oversize handling. Also some helper classes to make vector operations
2797 as efficient as possible for POD types and for simple non-PODs like RefPtr.
2799 (KXMLCore::VectorTypeOperations::destruct):
2800 (KXMLCore::VectorTypeOperations::initialize):
2801 (KXMLCore::VectorTypeOperations::move):
2802 (KXMLCore::VectorTypeOperations::uninitializedCopy):
2803 (KXMLCore::VectorTypeOperations::uninitializedFill):
2804 (KXMLCore::VectorBuffer::VectorBuffer):
2805 (KXMLCore::VectorBuffer::~VectorBuffer):
2806 (KXMLCore::VectorBuffer::deallocateBuffer):
2807 (KXMLCore::VectorBuffer::inlineBuffer):
2808 (KXMLCore::Vector::Vector):
2809 (KXMLCore::Vector::~Vector):
2810 (KXMLCore::Vector::size):
2811 (KXMLCore::Vector::capacity):
2812 (KXMLCore::Vector::isEmpty):
2813 (KXMLCore::Vector::at):
2814 (KXMLCore::Vector::operator[]):
2815 (KXMLCore::Vector::data):
2816 (KXMLCore::Vector::operator T*):
2817 (KXMLCore::Vector::operator const T*):
2818 (KXMLCore::Vector::begin):
2819 (KXMLCore::Vector::end):
2820 (KXMLCore::Vector::clear):
2821 (KXMLCore::Vector::fill):
2822 (KXMLCore::Vector::operator=):
2823 (KXMLCore::::Vector):
2824 (KXMLCore::::operator):
2826 (KXMLCore::::expandCapacity):
2827 (KXMLCore::::resize):
2828 (KXMLCore::::reserveCapacity):
2829 (KXMLCore::::append):
2830 (KXMLCore::deleteAllValues):
2831 * kxmlcore/VectorTraits.h: Added.
2832 (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
2835 2006-01-28 Alexey Proskuryakov <ap@nypop.com>
2839 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2840 RealPlayer.GetTitle() Crashes Safari/Dashboard
2842 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2843 Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
2845 2006-01-25 George Staikos <staikos@opensource.apple.com>
2849 * kxmlcore/HashFunctions.h: Merge build fix from KDE.
2851 2006-01-25 Darin Adler <darin@apple.com>
2853 - removed an unused source file
2855 * kjs/pointer_hash.h: Removed.
2856 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
2858 2006-01-23 Anders Carlsson <andersca@mac.com>
2862 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
2863 KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
2866 Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
2868 (cacheGlobalObject):
2869 Move this out of the KJS namespace.
2871 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2875 - renamed PointerHash to PtrHash
2876 - made PtrHash the default hash function for int and pointer types that aren't further specialized
2877 - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
2878 - did appropriate consequent cleanup (very few places now need to declare a hash function)
2879 http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
2881 * kjs/array_object.cpp:
2882 (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
2883 * kjs/collector.cpp: ditto
2884 * kjs/identifier.cpp:
2885 (KXMLCore::): declare DefaultHash the new way
2886 * kjs/internal.cpp: no need to mention PointerHash
2888 * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
2889 easier to specialize on PtrHash
2890 * kxmlcore/HashFunctions.h:
2891 (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
2892 a Hash typedef rather than being a hash function class itself; declared DefaultHash
2893 for int and partializy specialized for pointer types
2894 * kxmlcore/HashMapPtrSpec.h:
2895 (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
2896 way of handling pointer hash
2897 (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
2899 * kxmlcore/HashMap.h: ditto
2900 * kxmlcore/HashSet.h: ditto
2902 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2904 Reviewed by Tim Omernick.
2906 - use classes instead of free functions for extractors, this better matches how other
2907 things work and should avoid the need for hacky workarounds on other compilers
2908 http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
2910 * kjs/array_object.cpp:
2911 * kjs/identifier.cpp:
2913 * kxmlcore/HashMap.h:
2914 (KXMLCore::PairFirstExtractor::extract):
2915 * kxmlcore/HashMapPtrSpec.h:
2917 * kxmlcore/HashSet.h:
2918 (KXMLCore::IdentityExtractor::extract):
2919 * kxmlcore/HashTable.h:
2920 (KXMLCore::addIterator):
2921 (KXMLCore::removeIterator):
2922 (KXMLCore::HashTable::add):
2923 (KXMLCore::HashTable::isEmptyBucket):
2924 (KXMLCore::HashTable::isDeletedBucket):
2925 (KXMLCore::HashTable::HashTable):
2926 (KXMLCore::HashTable::lookup):
2927 (KXMLCore::HashTable::add):
2928 (KXMLCore::HashTable::reinsert):
2929 (KXMLCore::HashTable::find):
2930 (KXMLCore::HashTable::contains):
2931 (KXMLCore::HashTable::remove):
2932 (KXMLCore::HashTable::allocateTable):
2933 (KXMLCore::HashTable::deallocateTable):
2934 (KXMLCore::HashTable::expand):
2935 (KXMLCore::HashTable::rehash):
2936 (KXMLCore::HashTable::clear):
2937 (KXMLCore::HashTable::swap):
2938 (KXMLCore::HashTable::operator):
2939 (KXMLCore::HashTable::checkTableConsistency):
2940 (KXMLCore::HashTable::checkTableConsistencyExceptSize):
2941 (KXMLCore::HashTable::invalidateIterators):
2943 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2945 Rubber stamped by Tim Hatcher.
2947 - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
2948 for consistency with HashMap
2950 * kjs/array_object.cpp:
2951 (ArrayProtoFunc::callAsFunction):
2952 * kjs/collector.cpp:
2953 (KJS::Collector::protect):
2954 * kjs/identifier.cpp:
2955 (KJS::Identifier::add):
2956 * kxmlcore/HashCountedSet.h:
2958 * kxmlcore/HashMap.h:
2959 (KXMLCore::::inlineAdd):
2960 * kxmlcore/HashSet.h:
2962 * kxmlcore/HashTable.h:
2963 (KXMLCore::HashTable::add):
2965 (KXMLCore::::HashTable):
2967 2006-01-23 Justin Garcia <justin.garcia@apple.com>
2969 Reviewed by thatcher
2971 Turned on -O2 for B&I build.
2973 * JavaScriptCore.xcodeproj/project.pbxproj:
2975 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2977 Reviewed by Tim Hatcher.
2979 - it's "Franklin Street", not "Franklin Steet"
2981 * kjs/array_instance.h:
2982 * kjs/array_object.cpp:
2983 * kjs/array_object.h:
2984 * kjs/bool_object.cpp:
2985 * kjs/bool_object.h:
2986 * kjs/collector.cpp:
2990 * kjs/date_object.cpp:
2991 * kjs/date_object.h:
2995 * kjs/error_object.cpp:
2996 * kjs/error_object.h:
2999 * kjs/function_object.cpp:
3000 * kjs/function_object.h:
3002 * kjs/identifier.cpp:
3006 * kjs/interpreter.cpp:
3007 * kjs/interpreter.h:
3014 * kjs/math_object.cpp:
3015 * kjs/math_object.h:
3018 * kjs/nodes2string.cpp:
3019 * kjs/number_object.cpp:
3020 * kjs/number_object.h:
3023 * kjs/object_object.cpp:
3024 * kjs/object_object.h:
3025 * kjs/operations.cpp:
3027 * kjs/property_map.cpp:
3028 * kjs/property_map.h:
3029 * kjs/property_slot.cpp:
3030 * kjs/property_slot.h:
3031 * kjs/reference.cpp:
3033 * kjs/reference_list.cpp:
3034 * kjs/reference_list.h:
3037 * kjs/regexp_object.cpp:
3038 * kjs/regexp_object.h:
3039 * kjs/scope_chain.cpp:
3040 * kjs/scope_chain.h:
3041 * kjs/simple_number.h:
3042 * kjs/string_object.cpp:
3043 * kjs/string_object.h:
3050 * kxmlcore/AlwaysInline.h:
3051 * kxmlcore/ListRefPtr.h:
3052 * kxmlcore/PassRefPtr.h:
3053 * kxmlcore/RefPtr.h:
3055 2006-01-23 Darin Adler <darin@apple.com>
3057 Reviewed by John Sullivan.
3059 - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
3060 REGRESSION: Crash in cloneChildNodes when clicking element
3062 * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
3063 type by calling get() instead of going directly at m_ptr.
3064 * kxmlcore/RefPtr.h: Ditto.
3068 * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
3069 It's just a resorted list of keys in a dictionary.
3071 * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
3072 in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
3073 routine" property we want to have on OS X.
3075 2006-01-22 Maciej Stachowiak <mjs@apple.com>
3079 - Set up Page class and invert Frame / WebCoreFrameBridge ownership
3080 http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
3082 * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can
3085 2006-01-23 George Staikos <staikos@opensource.apple.com>
3087 Reviewed by Maciej and Darin.
3089 * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
3090 * kjs/interpreter.cpp: ditto
3091 * kjs/simple_number.h: Add assert.h and remove from config.h
3092 * kjs/array_object.cpp: Use relative paths for kxmlcore includes
3093 * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
3095 2006-01-23 George Staikos <staikos@opensource.apple.com>
3099 * kjs/config.h: unbreak preprocessor change
3101 2006-01-23 George Staikos <staikos@opensource.apple.com>
3103 Approved by Maciej and Darin.
3107 Update FSF address in license to make merging easier
3109 2006-01-22 George Staikos <staikos@opensource.apple.com>
3113 * kjs/collector.cpp: merge major speedup from KDE on Linux
3114 patch by Maks Orlovich, bug #6145
3115 Also unify cpu detection
3116 * kjs/config.h: define simpler CPU macros
3118 2006-01-22 George Staikos <staikos@opensource.apple.com>
3122 * kjs/collector.cpp: merge FreeBSD compile fix from KDE
3123 -> requires build magic for use
3125 2006-01-21 George Staikos <staikos@opensource.apple.com>
3129 * kjs/nodes2string.cpp
3132 Fix pedantic compile with some gcc versions (Merge from KDE)
3134 * kjs/create_hash_table:
3135 Fix build with Perl 5.8.0 (Merge from KDE)
3137 2006-01-18 Darin Adler <darin@apple.com>
3141 - hash table fixes needed for my WebCore changes
3143 * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
3144 Added a missing return statement.
3146 * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
3147 can't instantiate with a 0 by using traits rather than ? : to select the default
3148 emtpy value of hash table keys.
3150 - small cleanup of "runtime" code left over from recent JavaScript crash fix
3152 * bindings/runtime_root.h:
3153 (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
3154 since it's now a ProtectedPtr.
3155 (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
3156 fact that _imp was 0 and replaced with use of ProtectedPtr.
3157 (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
3159 2006-01-17 Darin Adler <darin@apple.com>
3163 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
3164 add assertions to check correct use of hash table iterators
3166 * kxmlcore/HashTable.h:
3167 (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
3168 maintained by the specified hash table.
3169 (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
3170 the list maintained by the hash table it's in.
3171 (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
3172 parameter, ignored when not debugging. Call addIterator.
3173 (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
3174 (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
3175 (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
3176 (KXMLCore::HashTableConstIterator::operator->): Ditto.
3177 (KXMLCore::HashTableConstIterator::operator++): Ditto.
3178 (KXMLCore::HashTableConstIterator::operator==): Ditto.
3179 (KXMLCore::HashTableConstIterator::operator!=): Ditto.
3180 (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
3181 pointer is not 0 and if there are two iterators that both point at the same table.
3182 (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
3183 as an implementation detail, to avoid having two separate iterator implementations.
3184 (KXMLCore::HashTableIterator::operator*): Ditto.
3185 (KXMLCore::HashTableIterator::operator->): Ditto.
3186 (KXMLCore::HashTableIterator::operator++): Ditto.
3187 (KXMLCore::HashTableIterator::operator==): Ditto.
3188 (KXMLCore::HashTableIterator::operator!=): Ditto.
3189 (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
3190 (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
3191 (KXMLCore::HashTable::makeIterator): Pass this pointer.
3192 (KXMLCore::HashTable::makeConstIterator): Ditto.
3193 (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
3194 entry point that modifies the hash table.
3195 (KXMLCore::HashTable::remove): Ditto.
3196 (KXMLCore::HashTable::clear): Ditto.
3197 (KXMLCore::HashTable::swap): Ditto.
3198 (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
3199 clears out the table, next, and previous pointers in all of them, and then clears
3200 the head so we have an empty list.
3201 (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
3202 passed-in table, and points the iterator at the table.
3203 (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
3204 the passed-in table.
3206 * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
3208 2006-01-17 Justin Garcia <justin.garcia@apple.com>
3212 Deployment builds now use -O2
3214 * JavaScriptCore.xcodeproj/project.pbxproj:
3216 2006-01-17 Darin Adler <darin@apple.com>
3220 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
3221 change RefPtr so that it works when deref ends up deleting the RefPtr
3223 * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
3224 * kxmlcore/RefPtr.h: Ditto.
3226 2006-01-16 Geoffrey Garen <ggaren@apple.com>
3230 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
3231 DateProtoFuncImp::callAsFunction can crash due to lack of type checking
3233 * kjs/date_object.cpp:
3234 (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods.
3235 This matches section 15.9.5 in the spec.
3237 2006-01-16 Tim Omernick <timo@apple.com>
3239 Reviewed by John Sullivan.
3241 JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
3243 * bindings/npruntime.cpp:
3244 (_NPN_ReleaseObject):
3245 Refactored part of this function out into _NPN_DeallocateObject.
3246 (_NPN_DeallocateObject):
3247 Forcibly deallocates the passed object, even if its refcount is
3250 * bindings/npruntime_impl.h:
3251 Declared _NPN_DeallocateObject().
3253 2006-01-16 Darin Adler <darin@apple.com>
3257 - fix problem with ++, ==, and != on const iterators in
3258 HashMaps that are using the pointer specialization
3260 * kxmlcore/HashMapPtrSpec.h:
3261 (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
3262 (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
3263 (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
3265 2006-01-15 Alexey Proskuryakov <ap@nypop.com>
3269 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
3270 run-javascriptcore-tests doesn't work
3272 * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm:
3273 Changed revision number to 1.8 (broken by svn migration).
3275 2006-01-14 David Kilzer <ddkilzer@kilzer.net>
3277 Reviewed and landed by Anders.
3279 * kjs/create_hash_table: Fixed comment typo.
3281 2006-01-13 Maks Orlovich <maksim@kde.org>
3283 Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
3285 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
3286 Misc. array object fixes from KJS
3288 * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
3289 (ArrayInstance::getOwnPropertySlot): Ditto.
3290 (ArrayInstance::deleteProperty): Ditto.
3291 (ArrayInstance::put): Ditto.
3292 (ArrayInstance::propList): Added a FIXME comment.
3293 (ArrayInstance::put): Throw exception on trying to set invalid array length.
3294 (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
3295 * kjs/array_object.h: Added MAX_ARRAY_INDEX.
3297 2006-01-13 Darin Adler <darin@apple.com>
3299 - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
3300 - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
3302 2006-01-13 Anders Carlsson <andersca@mac.com>
3306 * kjs/create_hash_table:
3307 Use correct size variables.
3309 2006-01-13 Anders Carlsson <andersca@mac.com>
3313 * kjs/create_hash_table:
3314 Don't create an empty entry array, instead add a entry with all fields
3315 set to null and set the hash table size to 1.
3319 Remove the hash table size check
3321 2006-01-12 Anders Carlsson <andersca@mac.com>
3325 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
3326 Crash when assigning a new function to a DOMParser object
3328 * JavaScriptCore.xcodeproj/project.pbxproj:
3329 Move lookup.cpp before lookup.h
3333 If the hash table is empty, return 0 early.
3335 2006-01-12 George Staikos <staikos@kde.org>
3339 * kjs/interpreter.cpp:
3341 * kjs/interpreter.h:
3342 Add helper to interpreter to call the collector in order to facilitate
3343 visibility rules in KDE.
3345 2006-01-12 George Staikos <staikos@kde.org>
3349 * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
3351 * kxmlcore/HashTable.h: Add missing assert.h
3353 2006-01-12 Darin Adler <darin@apple.com>
3357 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
3358 retire APPLE_CHANGES from JavaScriptCore
3360 * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
3361 APPLE_CHANGES and HAVE_CONFIG_H from all targets.
3363 * README: Removed. This had obsolete information in it
3364 and it wasn't clear what to replace it with.
3366 * kjs/collector.h: Removed an APPLE_CHANGES if around something
3367 that's not really platform-specific (although it does use a
3368 platform-specific API at the moment).
3369 * kjs/collector.cpp: Removed a mistaken comment.
3374 * kjs/operations.cpp:
3377 Use __APPLE__ instead of APPLE_CHANGES for code that should be
3378 used only on Mac OS X.
3380 * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
3381 of the runtime.h header. Even though that header isn't needed at the
3382 moment on platforms other than Mac OS X, the conditional stuff should
3383 be in the header itself, not in this one client.
3385 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
3386 code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
3387 any platform where pow is implemented corrrectly according to the IEEE
3388 standard. If it is needed on some, we can add it back with an appropriate
3389 #if for the platforms where it is needed.
3391 2006-01-12 Justin Haygood <justin@xiondigital.net>
3393 Reviewed, tweaked, and landed by Darin.
3395 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
3396 lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
3398 * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3399 quotes instead of angle brackets. Moved dtoa.h include to the top.
3400 Changed system header includes to use angle brackets instead of quotes.
3401 * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
3402 quotes instead of angle brackets.
3403 * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3404 quotes instead of angle brackets. Moved lexer.h include to the top.
3405 * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
3406 quotes instead of angle brackets. Moved ustring.h include to the top.
3408 2006-01-12 George Staikos <staikos@kde.org>
3412 - Import initial QMake file. Doesn't fully work yet.
3414 2006-01-11 Ricci Adams <ricciadams@apple.com>
3416 Reviewed by Maciej and Darin, landed by Darin.
3418 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
3419 final comma in javascript object prevents parsing
3421 * kjs/grammar.y: Added rule to allow trailing comma in
3422 object construction.
3424 2006-01-11 Ricci Adams <ricciadams@apple.com>
3426 Reviewed by Geoff, landed by Darin.
3428 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
3429 Number.toFixed doesn't include leading 0
3431 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
3432 Fixed a "<" that should have been a "<=".
3434 2006-01-11 Ricci Adams <ricciadams@apple.com>
3436 Reviewed by Geoff, landed by Darin.
3438 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
3439 Number.toFixed doesn't round 0.5 up
3441 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
3442 Fixed a ">" that should have been a ">=".
3444 2006-01-11 Justin Haygood <justin@xiondigital.net>
3446 Reviewed and landed by Darin.
3448 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6486
3449 JavaScriptCore should use system malloc on Windows
3451 * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
3453 2006-01-10 Darin Adler <darin@apple.com>
3455 * Makefile: Took out unneeded "export" line.
3456 * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
3457 MIME types, other small corrections).
3459 2006-01-09 Darin Adler <darin@apple.com>
3461 * Makefile.am: Removed.
3463 2006-01-07 Anders Carlsson <andersca@mac.com>
3467 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
3468 REGRESSION: JavaScript hang when comparing large array to null
3471 (KJS::JSObject::isEqualToNull):
3472 Add new function which returns true if an object should be treated as null when
3475 * kjs/operations.cpp:
3479 2006-01-07 Alexey Proskuryakov <ap@nypop.com>
3483 - Fix WebCore development build
3484 http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
3486 * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
3488 2006-01-06 Maciej Stachowiak <mjs@apple.com>
3492 - miscellaneous changes for 4% speedup on the JavaScript iBench
3493 http://bugzilla.opendarwin.org/show_bug.cgi?id=6396
3495 Changes mostly thanks to Maks Orlovich, tweaked a little by me.
3497 * kjs/create_hash_table: Use the same hash as the one used by Identifier.
3499 (KJS::FunctionImp::processParameters): Use the new List::copyFrom
3500 (KJS::ActivationImp::ActivationImp): track variable while iterating
3502 (KJS::StringImp::toObject): create StringInstance directly
3504 (KJS::List::copy): implement in terms of copyFrom
3505 (KJS::List::copyFrom): more efficient way to copy in another list
3508 (keysMatch): updated to work with identifier hash
3510 (Lookup::findEntry): ditto
3511 (Lookup::find): ditto
3514 2006-01-06 Maciej Stachowiak <mjs@apple.com>
3516 - fix development build failure from the previous checkin
3519 (KJS::ActivationImp::put): Use prototype() acce