1 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
5 One more attempt - use reinterpret_cast, rather than static_cast.
7 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
11 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
13 * kxmlcore/unicode/icu/UnicodeIcu.h:
14 (KXMLCore::Unicode::toLower):
15 (KXMLCore::Unicode::toUpper):
17 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
21 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
22 toLowerCase and toUpperCase don't honor special mappings
24 Test: fast/js/string-capitalization.html
26 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
27 * icu/unicode/putil.h: Added (copied from WebCore).
28 * icu/unicode/uiter.h: Ditto.
29 * icu/unicode/ustring.h: Ditto.
30 * kjs/string_object.cpp:
31 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
32 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
33 * kjs/ustring.h: Ditto.
35 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
36 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
38 * kxmlcore/unicode/icu/UnicodeIcu.h:
39 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
40 (KXMLCore::Unicode::toUpper): Ditto.
41 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
42 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
43 (KXMLCore::Unicode::category): Ditto.
44 * kxmlcore/unicode/qt4/UnicodeQt4.h:
45 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
46 (KXMLCore::Unicode::toUpper): Ditto.
47 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
48 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
49 (KXMLCore::Unicode::category): Ditto.
51 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
52 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
54 2006-04-05 Darin Adler <darin@apple.com>
56 - attempt to fix Windows build
58 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
59 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
61 2006-04-05 Darin Adler <darin@apple.com>
63 - attempt to fix Windows build
65 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
67 2006-04-05 Darin Adler <darin@apple.com>
71 - fix memory leak introduced by the previous change
73 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
74 the value in question is a pair where one of the pair needs a ref and the other
77 2006-04-05 Darin Adler <darin@apple.com>
81 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
82 StringImpl hash traits deleted value creates an init routine for WebCore
83 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
85 Change HashMap and HashSet implementation so they fold various types together.
86 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
87 and WebCore::String in terms of the underlying raw pointer type, and hence use
88 -1 for the deleted value.
90 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
91 type to be used when storing a value that has the same layout as the type itself.
92 This is used only for non-key cases. In the case of keys, the hash function must also
93 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
94 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
95 explicit reference counting. If the type itself has needsRef true, but the storage
96 type has needsRef false, then the HashSet or HashMap has to handle the reference
97 counting explicitly. Added hash trait specializations for all signed integer values
98 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
99 integer type of the same size so int and long will share code. Gave all pointers and
100 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
101 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
102 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
103 Useful for types where we don't want to force the existence of deletedValue, such as
104 the type of a pair in a HashMap which is not the actual storage type. Removed an
105 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
106 template, which determines what type can be used to store a given hash key type with
107 a given hash function, and specialized it for pointers and RefPtr so that pointer
108 hash tables share an underlying HashTable that uses IntHash.
110 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
111 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
112 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
113 tables where the type stored is not the same as the real value type.
115 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
116 integer type given a sizeof value. Renamed pointerHash to intHash and made it
117 use overloading and take integer parameters. Added an IntHash struct which is
118 a hash function that works for integers. Changed PtrHash to call IntHash with
119 an appropriately sized integer. Made IntHash the default hash function for
120 many integer types. Made PtrHash the default hash function for RefPtr as well
123 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
124 derived from the new traits. The HashTable will use the storage type and all
125 necessary translation and ref/deref is done at the HashSet level. Also reorganized
126 the file so that the HashSet is at the top and has no inline implementation inside
127 it so it's easy to read the interface to HashSet.
129 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
130 derived from the new traits. The HashTable will use the storage type and all
131 necessary translation and ref/deref is done at the HashMap level. Also reorganized
132 the file so that the HashMap is at the top and has no inline implementation inside
133 it so it's easy to read the interface to HashMap.
135 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
137 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
138 and also remove some unnecessary build settings from the aggregate target that
139 generates derived sources.
140 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
142 2006-04-04 Timothy Hatcher <timothy@apple.com>
146 The Debug and Release frameworks are now built with install paths relative to the build products directory.
147 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
149 * JavaScriptCore.xcodeproj/project.pbxproj:
151 2006-04-04 Eric Seidel <eseidel@apple.com>
156 Disable ASSERT redefinition warnings for now.
158 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
159 * kxmlcore/Assertions.h:
161 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
163 Reviewed by ggaren & darin. Landed by eseidel.
165 Integrate CURL version of gettimeofday
166 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
167 Disable crash report dialogs for testkjs.exe in Release mode
168 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
173 (StopWatch::getElapsedMS):
177 2006-04-04 Eric Seidel <eseidel@apple.com>
181 * kjs/number_object.cpp:
182 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
184 2006-03-12 Maciej Stachowiak <mjs@apple.com>
188 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
189 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
191 * kjs/number_object.cpp:
192 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
193 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
194 plus a bit of refactoring.
196 2006-04-03 Darin Adler <darin@apple.com>
198 - tweak config.h and Platform.h to try to get buildbot working
199 (making some small changes at the same time)
201 * kjs/config.h: Removed now-unneeded HAVE_ICU.
202 * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
203 USE stuff to the end.
205 2006-04-03 George Staikos <staikos@opensource.apple.com>
209 Fix Win32 build breakage from previous commit, remove unused forward.
211 2006-04-03 George Staikos <staikos@opensource.apple.com>
215 Implement a unicode abstraction layer to make JavaScriptCore much more
216 easily ported to other platforms without having to take in libicu. Also
217 makes the unicode related code easier to understand.
219 2006-04-03 Timothy Hatcher <timothy@apple.com>
223 Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
224 Other 64 bit build fixes.
227 (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
229 (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
230 * bindings/jni/jni_utility.cpp:
231 (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
232 (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
233 * bindings/runtime_root.cpp:
234 (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
235 (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
237 2006-03-31 Darin Adler <darin@apple.com>
241 - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
243 * bindings/objc/WebScriptObject.h: Fixed comment.
245 2006-03-31 Eric Seidel <eseidel@apple.com>
249 A bit more code cleanup.
251 * bindings/c/c_utility.cpp:
252 (KJS::Bindings::convertValueToNPVariant):
253 * bindings/objc/objc_runtime.mm:
254 (convertValueToObjcObject):
255 * bindings/objc/objc_utility.mm:
256 (KJS::Bindings::convertValueToObjcValue):
258 (KJS::GlobalFuncImp::callAsFunction):
259 * kjs/interpreter.cpp:
260 (KJS::ExecState::lexicalInterpreter):
262 * kjs/operations.cpp:
265 2006-03-30 Eric Seidel <eseidel@apple.com>
269 Small code-style update.
271 * kjs/operations.cpp:
284 2006-03-31 Anders Carlsson <andersca@mac.com>
288 Make sure the GetterSetterImp objects are marked as well.
291 (KJS::GetterSetterImp::mark):
294 2006-03-30 Eric Seidel <eseidel@apple.com>
298 * kjs/nodes.h: Some various small style fixes.
300 2006-03-30 Eric Seidel <eseidel@apple.com>
304 Clean-up style issues in node.h, remove redundant initializations.
307 (KJS::StatementNode::evaluate):
308 (KJS::ArrayNode::ArrayNode):
309 (KJS::ObjectLiteralNode::ObjectLiteralNode):
310 (KJS::ArgumentsNode::ArgumentsNode):
311 (KJS::NewExprNode::NewExprNode):
312 (KJS::CaseClauseNode::CaseClauseNode):
313 (KJS::FuncDeclNode::FuncDeclNode):
315 2006-03-30 Tim Omernick <timo@apple.com>
319 <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
322 * bindings/runtime.h:
323 (KJS::Bindings::Instance::implementsCall):
324 New method. Returns false by default. Concrete subclasses can override this return true when
325 the bound object may be called as a function.
326 (KJS::Bindings::Instance::invokeDefaultMethod):
327 Since bound objects are no longer treated as functions by default, we can return jsUndefined()
328 here instead of in concrete subclasses that decide not to implement the default method
331 * bindings/runtime_object.cpp:
332 (RuntimeObjectImp::implementsCall):
333 Don't assume that the bound object is a function; instead, let the object instance decide whether
336 * bindings/c/c_instance.h:
337 * bindings/c/c_instance.cpp:
338 (KJS::Bindings::CInstance::implementsCall):
339 The object is callable if its class has an invokeDefault function.
341 * bindings/objc/objc_instance.h:
342 * bindings/objc/objc_instance.mm:
343 (ObjcInstance::implementsCall):
344 The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
346 * bindings/jni/jni_instance.h:
347 * bindings/jni/jni_instance.cpp:
348 Moved bogus invokeDefaultMethod() to superclass.
350 2006-03-29 Geoffrey Garen <ggaren@apple.com>
354 - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
355 Regression: crash in malloc_consolidate if you use a .PAC file
357 The crash was a result of threaded deallocation of thread-unsafe
358 objects. Pure JS objects are thread-safe because all JS execution
359 is synchronized through JSLock. However, JS objects that wrap WebCore
360 objects are thread-unsafe because JS and WebCore execution are not
361 synchronized. That unsafety comes into play when the collector
362 deallocates a JS object that wraps a WebCore object, thus causing the
363 WebCore object to be deallocated.
365 The solution here is to have each JSCell know whether it is safe to
366 collect on a non-main thread, and to avoid collecting unsafe cells
367 when on a non-main thread.
369 We don't have a way to test PAC files yet, so there's no test
370 attached to this patch.
373 (KJS::Collector::collect):
374 (1) Added the test "currentThreadIsMainThread ||
375 imp->m_destructorIsThreadSafe".
378 (KJS::gcProtectNullTolerant):
379 (KJS::gcUnprotectNullTolerant):
381 (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
382 m_destructorIsThreadSafe becomes another whole word, ruining the
383 collector optimizations we've made based on the size of a JSObject.
384 * kxmlcore/FastMalloc.cpp:
385 (KXMLCore::currentThreadIsMainThread):
386 (KXMLCore::fastMallocRegisterThread):
387 * kxmlcore/FastMalloc.h:
389 2006-03-28 Darin Adler <darin@apple.com>
393 - change some code that resulted in init routines on Mac OS X -- if the framework has
394 init routines it will use memory and slow down applications that link with WebKit
395 even in cases where those applications don't use WebKit
397 * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
398 to use immediate numbers instead. Apparently, double constant expressions of the type we
399 had here are evaluated at load time.
401 * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
402 ListImp, so go back to using a plain old pointer.
403 (KJS::List::List): Set overflow to 0 when initializing ListImp.
404 (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
405 (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
406 a swap of OwnArrayPtr.
407 (KJS::List::copyFrom): Remove now-unneeded get().
408 (KJS::List::copyTail): Ditto.
410 * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
411 a static initializer routine. Had to get rid of one level of constant to get the compiler
412 to understand it could initialize without any code.
414 - added a build step that checks for init routines
416 * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
417 was replaced by the generate-derived-sources script a while back. Added a custom build
418 phase that invokes the check-for-global-initializers script.
420 2006-03-28 Timothy Hatcher <timothy@apple.com>
424 fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
426 * bindings/npapi.h: added #defines after the #ifndefs
428 2006-03-27 Maciej Stachowiak <mjs@apple.com>
432 - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
435 (Node::deref): take into account the case where the extra refcount table was never created
437 2006-03-23 David Carson <dacarson@gmail.com>
441 - JSObject in LiveConnect not working.
442 http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
444 * bindings/jni_jsobject.cpp:
445 (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
446 class, and the GetFieldID was using the wrong signature.
448 2006-03-23 Darin Adler <darin@apple.com>
454 * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
455 Also add -Y 3 option for linker.
457 2006-03-23 Darin Adler <darin@apple.com>
461 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
462 REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
464 * kjs/object.h: Take function name, as well as source URL and line number, when
465 using the special overloaded construct for making functions.
466 * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
467 * kjs/function_object.h: Ditto.
468 * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
469 constructing the function rather than null. Use "anonymous" when making a
470 function using the default function constructor.
472 * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
473 a function declaration.
477 * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
479 2006-03-23 Darin Adler <darin@apple.com>
483 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
484 LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
486 * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
487 * bindings/c/c_utility.cpp:
488 (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
489 BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
490 OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
491 one case and remove a _NPN_ReleaseObject in another because this
492 should return a retained value.
493 (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
494 NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
496 * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
497 CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
498 * bindings/c/c_runtime.cpp:
499 (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
501 (KJS::Bindings::CField::name): Added. Returns the string from inside the
503 (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
504 on the result of getProperty after using it to fix a storage leak.
505 (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
506 after pasing a value to setProperty now that the conversion function does a retain.
508 * bindings/c/c_instance.cpp:
509 (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
510 stack buffer. Removed special case for NPVARIANT_IS_VOID because the
511 convertNPVariantToValue function handles that properly.
512 (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
514 * bindings/NP_jsobject.h: Formatting changes only.
515 * bindings/NP_jsobject.cpp:
516 (jsDeallocate): Changed parameter type so we don't need a function cast.
517 (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
518 (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
519 (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
520 (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
522 * bindings/c/c_class.cpp: Formatting changes only.
523 * bindings/c/c_class.h: Formatting changes only.
525 * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
526 NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
527 NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
528 NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
529 NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
530 NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
531 NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
532 NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
533 NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
534 NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
535 * bindings/npruntime.cpp:
536 (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
537 integer dictionary since the default behavior is fine for integers.
539 2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
541 Reviewed and landed by Maciej.
543 - WebKit no longer builds with bison 2.1
544 http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
546 * generate-derived-sources: Handle generated header named either grammar.cpp.h
549 2006-03-22 Maciej Stachowiak <mjs@apple.com>
553 * JavaScriptCore.xcodeproj/project.pbxproj:
555 2006-03-21 Maciej Stachowiak <mjs@apple.com>
557 * kjs/generate-derived-sources: Set executable property.
559 2006-03-21 Maciej Stachowiak <mjs@apple.com>
563 Ensure that generated source dependencies are handled properly, as follows:
565 - Made an external script that generates the sources into a
566 DerivedSources dir in the build products directory.
567 - Added a new build target that builds all the generated sources
568 if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
569 - Added the DerivedSources dir in question to the include path.
570 - Added the new DerivedSources dir and its contents to the project as build-relative.
572 * JavaScriptCore.xcodeproj/project.pbxproj:
573 * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
576 2006-03-11 Maciej Stachowiak <mjs@apple.com>
580 - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
581 http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
584 (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
586 2006-03-16 Maciej Stachowiak <mjs@apple.com>
590 - tweaks to my change to redo KJS::Node refcounting
596 (Node::clearNewNodes):
599 2006-03-16 Darin Adler <darin@apple.com>
603 - fixed Vector so that you can pass a reference to something in the vector
604 to the append or insert functions
607 (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
608 and return the adjusted value of the pointer.
609 (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
610 adding the new element. Makes the case where the element moves when the vector
612 (KXMLCore::Vector::insert): Ditto.
614 2006-03-15 Eric Seidel <eseidel@apple.com>
620 * kjs/date_object.cpp:
621 (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
623 2006-03-15 Eric Seidel <eseidel@apple.com>
627 Fix CString copy constructor, fixes Date.parse("") on Win32.
629 * kjs/date_object.cpp:
630 (KJS::DateProtoFunc::callAsFunction):
632 (KJS::CString::CString):
633 (KJS::CString::operator=):
635 2006-03-13 Maciej Stachowiak <mjs@apple.com>
639 - KJS::Node and KJS::StatementNode are bigger than they need to be
640 http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
642 The memory usage of Node was reduced by 2 machine words per node:
644 - sourceURL was removed and only kept on FunctionBodyNode. The
645 source URL can only be distinct per function or top-level program node,
646 and you always have one.
648 - refcount was removed and kept in a separate hashtable when
649 greater than 1. newNodes set represents floating nodes with
650 refcount of 0. This helps because almost all nodes have a refcount of 1
651 for almost all of their lifetime.
653 * bindings/runtime_method.cpp:
654 (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
656 (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
657 them at the appropriate time.
659 (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
661 (KJS::ContextImp::pushIteration): moved here from LabelStack
662 (KJS::ContextImp::popIteration): ditto
663 (KJS::ContextImp::inIteration): ditto
664 (KJS::ContextImp::pushSwitch): ditto
665 (KJS::ContextImp::popSwitch): ditto
666 (KJS::ContextImp::inSwitch): ditto
668 (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
669 (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
670 (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
671 (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
673 (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
675 * kjs/function.h: Move body field from DeclaredFunctionImp to
677 * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
679 (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
680 and m_switchDepth data members. New FunctionBodyNode* parameter - the
681 function body provides source URL and SourceId.
682 (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
683 (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
686 (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
687 statement label stacks don't need these and it bloats their size. Put them
688 in the ContextImp instead.
689 * kjs/interpreter.cpp:
690 (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
692 (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
693 (KJS::ExecState::context): ditto
694 (KJS::ExecState::setException): Renamed _exception to m_exception
695 (KJS::ExecState::clearException): ditto
696 (KJS::ExecState::exception): ditto
697 (KJS::ExecState::hadException): ditto
698 (KJS::ExecState::ExecState): ditto both above renames
700 (Node::Node): Removed initialization of line, source URL and refcount. Add to
701 local newNodes set instead of involving parser.
702 (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
703 HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
706 (Node::refcount): ditto
707 (Node::clearNewNodes): Destroy anything left in the new nodes set.
708 (currentSourceId): Inline helper to get sourceId from function body via context.
709 (currentSourceURL): ditto for sourceURL.
710 (Node::createErrorCompletion): use new helper
711 (Node::throwError): ditto
712 (Node::setExceptionDetailsIfNeeded): ditto
713 (StatementNode::StatementNode): remove initialization of l0 and sid, rename
715 (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
716 (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
717 (StatListNode::StatListNode): updated for setLoc changes
718 (BlockNode::BlockNode): ditto
719 (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
720 (WhileNode::execute): ditto
721 (ForNode::execute): ditto
722 (ForInNode::execute): ditto
723 (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
724 (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
725 (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
726 (FunctionBodyNode::FunctionBodyNode): update for new setLoc
727 (FunctionBodyNode::processFuncDecl): reindent
728 (SourceElementsNode::SourceElementsNode): update for new setLoc
730 (KJS::Node::lineNo): Renamed _line to m_line
731 (KJS::StatementNode::firstLine): Use lineNo()
732 (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
733 (KJS::FunctionBodyNode::sourceId): added
734 (KJS::FunctionBodyNode::sourceURL): added
737 2006-03-14 Geoffrey Garen <ggaren@apple.com>
739 - Fixed <rdar://problem/4478239> string sort puts "closed" before
745 (KJS::compare): Inverted a < in order to treat the longer string as >
748 2006-03-12 Alexey Proskuryakov <ap@nypop.com>
752 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
753 REGRESSION: Flash callback to JavaScript function not working.
755 Test: plugins/invoke.html
757 * bindings/c/c_utility.cpp:
758 (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
760 2006-03-08 Eric Seidel <eseidel@apple.com>
764 Partially fix JS on win32 by fixing hash table generation.
766 * kjs/create_hash_table: limit << results to 32 bits.
768 (TestFunctionImp::callAsFunction):
770 2006-03-07 Darin Adler <darin@apple.com>
772 * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
774 2006-03-07 Darin Adler <darin@apple.com>
778 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
779 unwanted output while running layout tests
781 * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
782 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
783 to standard output. I think we should arrange for the error text to be in JavaScript
784 exceptions instead at some point.
785 * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
786 too-large size rather than allocating a buffer smaller than requested.
788 2006-03-06 David Carson <dacarson@gmail.com>
790 Reviewed by Darin, landed by ap.
792 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
793 c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
795 Tested with test case from:
796 http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
798 * bindings/c_utility.cpp
799 (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
800 * icu/unicode/ucnv.h: Copied from WebCore.
801 * icu/unicode/ucnv_err.h: Ditto.
802 * icu/unicode/uenum.h: Ditto.
804 2006-03-05 Darin Adler <darin@apple.com>
806 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
808 2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
810 Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
812 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
813 REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
815 * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
817 2006-03-05 Darin Adler <darin@apple.com>
821 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
822 get all references to KJS::Node out of internal.h
824 * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
826 * kjs/Parser.cpp: Added.
827 * kjs/Parser.h: Added.
829 * kjs/internal.cpp: Removed the Parser class.
830 * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
831 not used in this header.
833 * kjs/nodes.h: Added an include of "Parser.h".
834 * kjs/function.h: Added a declaration of FunctionBodyNode.
836 2006-03-05 Geoffrey Garen <ggaren@apple.com>
840 - JSC support for the fix for <rdar://problem/4467143> JavaScript
841 enumeration of HTML element properties skips DOM node properties
844 (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
845 class definiton macro needs to know about the prototype's prototype so
846 that the class constructor properly sets it.
847 (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
848 implementation macro does not need to know about the prototype's
849 prototype, since getOwnPropertySlot should only look in the current
850 object's property map, and not its prototype's.
852 2006-03-05 Andrew Wellington <proton@wiretapped.net>
854 Reviewed by Eric, landed by ap.
856 - Remove unused breakpoint bool from StatementNodes. No test provided as
857 there is no functionality change.
860 (StatementNode::StatementNode):
863 2006-03-03 Geoffrey Garen <ggaren@apple.com>
867 - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at
868 http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
870 This regression was caused by my fix for 4448098. I failed to account for the
871 deleted entry sentinel in the mehtod that saves the contents of a property map to
872 the back/forward cache.
874 Manual test in WebCore/manual-tests/property-map-save-crash.html
876 * kjs/property_map.cpp:
877 (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
878 (KJS::isValid): New function: checks if a key is null or the deleted sentinel
879 (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
880 and a slight performance win
881 (KJS::PropertyMap::clear):
882 (KJS::PropertyMap::rehash):
883 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
884 (KJS::PropertyMap::save): Check keys with isValid()
886 2006-03-02 Maciej Stachowiak <mjs@apple.com>
888 - now fix mac build again
890 * kjs/identifier.cpp:
892 2006-03-02 Maciej Stachowiak <mjs@apple.com>
894 Rubber stamped by Anders and Eric.
896 - add fpconst.cpp to win32 build, it is now needed
898 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
901 2006-03-02 Maciej Stachowiak <mjs@apple.com>
905 - fix windows build, broken by my last patch
907 * kjs/JSImmediate.cpp:
908 * kjs/identifier.cpp:
909 * kxmlcore/FastMalloc.cpp:
910 * kxmlcore/Platform.h:
912 2006-03-01 Maciej Stachowiak <mjs@apple.com>
916 - Set up new prototype macros and avoid using #if without defined() in JSC
918 Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
919 are defined, and to separate core OS-level dependencies from operating environment
920 dependencies so you can, e.g., build KDE on Mac or Windows.
922 * kxmlcore/Platform.h: Added.
924 - deploy them everywhere in JavaScriptCore
926 * JavaScriptCore.xcodeproj/project.pbxproj:
927 * bindings/jni/jni_utility.cpp:
928 (KJS::Bindings::convertValueToJValue):
929 * bindings/objc/WebScriptObject.mm:
930 * bindings/objc/objc_instance.mm:
932 * bindings/softlinking.h:
933 * bindings/testbindings.mm:
937 (KJS::Collector::markCurrentThreadConservatively):
938 (KJS::Collector::markOtherThreadConservatively):
939 (KJS::Collector::markStackObjectsConservatively):
941 * kjs/date_object.cpp:
944 (KJS::DateProtoFunc::callAsFunction):
945 (KJS::DateObjectImp::construct):
952 * kjs/identifier.cpp:
954 * kjs/interpreter.cpp:
955 (KJS::Interpreter::evaluate):
956 (KJS::Interpreter::createLanguageInstanceForValue):
960 * kjs/math_object.cpp:
963 * kjs/operations.cpp:
970 (KJS::RegExp::RegExp):
971 (KJS::RegExp::~RegExp):
972 (KJS::RegExp::match):
977 (StopWatch::getElapsedMS):
980 * kxmlcore/AlwaysInline.h:
981 * kxmlcore/Assertions.cpp:
982 * kxmlcore/Assertions.h:
983 * kxmlcore/FastMalloc.cpp:
985 * kxmlcore/FastMalloc.h:
986 * kxmlcore/FastMallocInternal.h:
987 * kxmlcore/HashTable.h:
988 * kxmlcore/TCPageMap.h:
989 * kxmlcore/TCSpinLock.h:
990 (TCMalloc_SpinLock::Lock):
991 (TCMalloc_SpinLock::Unlock):
993 * kxmlcore/TCSystemAlloc.cpp:
994 (TCMalloc_SystemAlloc):
997 2006-02-28 Geoffrey Garen <ggaren@apple.com>
1001 - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry
1002 placeholder to -1 from UString::Rep::null
1004 This turned out to be only a small speedup (.12%). That's within the
1005 margin of error for super accurate JS iBench, but Shark confirms the
1006 same, so I think it's worth landing.
1008 FYI, I also confirmed that the single entry optimization in
1009 PropertyMap is a 3.2% speedup.
1011 * kjs/property_map.cpp:
1012 (KJS::PropertyMap::~PropertyMap):
1013 (KJS::PropertyMap::clear):
1014 (KJS::PropertyMap::put):
1015 (KJS::PropertyMap::insert):
1016 (KJS::PropertyMap::rehash):
1017 (KJS::PropertyMap::remove):
1018 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1019 (KJS::PropertyMap::checkConsistency):
1020 * kjs/property_map.h:
1021 (KJS::PropertyMap::deletedSentinel):
1023 2006-02-27 Eric Seidel <eseidel@apple.com>
1025 Rubber-stamped by darin.
1027 Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
1029 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1031 2006-02-27 Eric Seidel <eseidel@apple.com>
1035 Fix Assertions.cpp to compile on win32.
1037 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1038 * kxmlcore/Assertions.cpp:
1040 2006-02-27 Eric Seidel <eseidel@apple.com>
1044 Made Assertions.cpp platform independent.
1045 Moved mac-specific logging logic up into WebCore.
1046 http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
1048 * JavaScriptCore.xcodeproj/project.pbxproj:
1049 * kxmlcore/Assertions.cpp: Added.
1050 * kxmlcore/Assertions.h:
1051 * kxmlcore/Assertions.mm: Removed.
1053 2006-02-27 Darin Adler <darin@apple.com>
1055 - fixed Mac Debug build, there was an unused parameter
1057 * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
1058 Remove parameter name.
1060 * kjs/debugger.h: Fixed comment.
1062 2006-02-27 Eric Seidel <eseidel@apple.com>
1066 * kxmlcore/Vector.h:
1067 (KXMLCore::deleteAllValues): fix unused variable warning
1069 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1073 - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
1074 http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
1076 * JavaScriptCore.xcodeproj/project.pbxproj:
1077 * bindings/NP_jsobject.cpp:
1079 (_NPN_InvokeDefault):
1083 (_NPN_RemoveProperty):
1086 * bindings/c/c_class.h:
1087 (KJS::Bindings::CClass::constructorAt):
1088 * bindings/c/c_utility.cpp:
1089 (KJS::Bindings::convertNPVariantToValue):
1090 * bindings/jni/jni_class.cpp:
1091 (JavaClass::methodsNamed):
1092 (JavaClass::fieldNamed):
1093 * bindings/jni/jni_instance.cpp:
1094 (JavaInstance::invokeDefaultMethod):
1095 * bindings/jni/jni_jsobject.cpp:
1096 * bindings/jni/jni_objc.mm:
1097 (-[NSObject KJS::Bindings::]):
1098 * bindings/objc/WebScriptObject.mm:
1099 (+[WebUndefined allocWithZone:]):
1100 (-[WebUndefined initWithCoder:]):
1101 (-[WebUndefined encodeWithCoder:]):
1102 (-[WebUndefined copyWithZone:]):
1103 * bindings/objc/objc_class.h:
1104 (KJS::Bindings::ObjcClass::constructorAt):
1105 * bindings/objc/objc_class.mm:
1106 (KJS::Bindings::ObjcClass::methodsNamed):
1107 (KJS::Bindings::ObjcClass::fallbackObject):
1108 * bindings/objc/objc_instance.mm:
1109 (ObjcInstance::getValueOfUndefinedField):
1110 * bindings/objc/objc_runtime.mm:
1111 (ObjcFallbackObjectImp::getOwnPropertySlot):
1112 (ObjcFallbackObjectImp::put):
1113 (ObjcFallbackObjectImp::canPut):
1114 (ObjcFallbackObjectImp::deleteProperty):
1115 (ObjcFallbackObjectImp::toBoolean):
1116 * bindings/runtime.cpp:
1117 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1118 * bindings/runtime.h:
1119 (KJS::Bindings::Instance::getValueOfUndefinedField):
1120 (KJS::Bindings::Instance::setValueOfUndefinedField):
1121 * bindings/runtime_array.cpp:
1122 (RuntimeArray::lengthGetter):
1123 (RuntimeArray::indexGetter):
1124 (RuntimeArray::put):
1125 (RuntimeArray::deleteProperty):
1126 * bindings/runtime_method.cpp:
1127 (RuntimeMethod::lengthGetter):
1128 (RuntimeMethod::execute):
1129 * bindings/runtime_object.cpp:
1130 (RuntimeObjectImp::fallbackObjectGetter):
1131 (RuntimeObjectImp::fieldGetter):
1132 (RuntimeObjectImp::methodGetter):
1133 (RuntimeObjectImp::put):
1134 (RuntimeObjectImp::canPut):
1135 (RuntimeObjectImp::deleteProperty):
1136 (RuntimeObjectImp::defaultValue):
1137 (RuntimeObjectImp::callAsFunction):
1138 * bindings/runtime_root.cpp:
1139 (performJavaScriptAccess):
1140 * kjs/array_object.cpp:
1141 (ArrayInstance::lengthGetter):
1142 (ArrayInstance::getOwnPropertySlot):
1143 (ArrayPrototype::ArrayPrototype):
1144 (ArrayPrototype::getOwnPropertySlot):
1145 * kjs/bool_object.cpp:
1146 (BooleanObjectImp::BooleanObjectImp):
1147 * kjs/date_object.cpp:
1148 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1149 (KJS::DateObjectFuncImp::callAsFunction):
1150 * kjs/error_object.cpp:
1151 (ErrorObjectImp::ErrorObjectImp):
1152 (NativeErrorPrototype::NativeErrorPrototype):
1153 (NativeErrorImp::NativeErrorImp):
1155 (KJS::FunctionImp::argumentsGetter):
1156 (KJS::FunctionImp::lengthGetter):
1157 (KJS::Arguments::mappedIndexGetter):
1158 (KJS::ActivationImp::argumentsGetter):
1159 (KJS::ActivationImp::put):
1160 * kjs/function_object.cpp:
1161 (FunctionObjectImp::FunctionObjectImp):
1163 (KJS::GetterSetterImp::toPrimitive):
1164 (KJS::GetterSetterImp::toBoolean):
1165 * kjs/interpreter.cpp:
1166 (KJS::Interpreter::evaluate):
1167 * kjs/interpreter.h:
1168 (KJS::Interpreter::isGlobalObject):
1169 (KJS::Interpreter::interpreterForGlobalObject):
1170 (KJS::Interpreter::isSafeScript):
1172 (Lexer::makeIdentifier):
1173 (Lexer::makeUString):
1175 (KJS::staticFunctionGetter):
1176 (KJS::staticValueGetter):
1178 (StatementNode::processFuncDecl):
1179 (PropertyNode::evaluate):
1180 (PropertyNameNode::evaluate):
1181 * kjs/number_object.cpp:
1182 (NumberObjectImp::NumberObjectImp):
1183 (NumberObjectImp::getOwnPropertySlot):
1185 (KJS::JSObject::defineGetter):
1186 (KJS::JSObject::defineSetter):
1187 (KJS::JSObject::hasInstance):
1188 (KJS::JSObject::propertyIsEnumerable):
1189 * kjs/object_object.cpp:
1190 (ObjectObjectImp::ObjectObjectImp):
1191 * kjs/property_slot.cpp:
1192 (KJS::PropertySlot::undefinedGetter):
1193 (KJS::PropertySlot::functionGetter):
1194 * kjs/reference.cpp:
1195 (KJS::Reference::getPropertyName):
1196 * kjs/reference_list.cpp:
1197 (ReferenceListIterator::operator++):
1198 * kjs/regexp_object.cpp:
1199 (RegExpObjectImp::RegExpObjectImp):
1200 (RegExpObjectImp::getValueProperty):
1201 (RegExpObjectImp::putValueProperty):
1202 * kjs/string_object.cpp:
1203 (StringInstance::lengthGetter):
1204 (StringInstance::indexGetter):
1205 (StringPrototype::StringPrototype):
1206 * kxmlcore/Assertions.mm:
1207 * kxmlcore/FastMalloc.cpp:
1208 (KXMLCore::TCMalloc_PageHeap::CheckList):
1209 * kxmlcore/HashTable.h:
1210 (KXMLCore::HashTableConstIterator::checkValidity):
1211 (KXMLCore::IdentityHashTranslator::translate):
1213 (pcre_get_stringnumber):
1215 2006-02-23 Darin Adler <darin@apple.com>
1217 - try to fix buildbot failure
1219 * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
1220 recompiled after additional inlining was introduced (Xcode bug?).
1222 2006-02-23 Geoffrey Garen <ggaren@apple.com>
1224 Reviewed by Darin, Maciej.
1226 - Inline some functions suggested by Shark. 2.9% speedup on super
1229 http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
1230 <rdar://problem/4448116>
1233 (KJS::ArgumentsNode::evaluateList):
1236 (KJS::ScopeChain::release):
1237 (KJS::JSObject::toPrimitive):
1238 * kjs/scope_chain.cpp:
1241 (KJS::UString::toArrayIndex):
1244 (KJS::JSValue::toObject):
1245 * kxmlcore/FastMalloc.cpp:
1246 (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
1247 (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
1249 2006-02-21 Eric Seidel <eseidel@apple.com>
1251 Added *.user to ignore list.
1253 2006-02-21 Eric Seidel <eseidel@apple.com>
1257 Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
1259 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1260 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
1262 2006-02-21 Eric Seidel <eseidel@apple.com>
1266 * kjs/testkjs.cpp: #if out timeval code on win32
1268 2006-02-21 Michael Emmel <mike.emmel@gmail.com>
1272 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
1273 TCPageMap.h would not compile for me because string.h was missing
1275 * kxmlcore/TCPageMap.h: Added <string.h> include.
1277 2006-02-21 Darin Adler <darin@apple.com>
1279 Reviewed by John Sullivan.
1281 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
1282 remove a bunch of extra implementsCall overrides
1284 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
1286 * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
1287 we'll get a compile error if some derived class neglects to implement it.
1289 * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
1290 of param, which is an OwnPtr so it gets initialized by default.
1292 * bindings/runtime_method.cpp:
1293 * bindings/runtime_method.h:
1294 * kjs/array_object.cpp:
1295 * kjs/array_object.h:
1296 * kjs/bool_object.cpp:
1297 * kjs/bool_object.h:
1298 * kjs/date_object.cpp:
1299 * kjs/date_object.h:
1300 * kjs/error_object.cpp:
1301 * kjs/error_object.h:
1304 * kjs/function_object.cpp:
1305 * kjs/function_object.h:
1306 * kjs/math_object.cpp:
1307 * kjs/math_object.h:
1308 * kjs/number_object.cpp:
1309 * kjs/number_object.h:
1310 * kjs/object_object.cpp:
1311 * kjs/object_object.h:
1312 * kjs/regexp_object.cpp:
1313 * kjs/regexp_object.h:
1314 * kjs/string_object.cpp:
1315 * kjs/string_object.h:
1316 Removed many rendundant implementations of implementsCall from subclasses of
1317 InternalFunctionImp.
1319 2006-02-21 Darin Adler <darin@apple.com>
1323 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
1326 2006-02-21 Darin Adler <darin@apple.com>
1328 Change suggested by Mitz.
1330 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
1331 REGRESSION: Methods do not execute
1333 * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
1334 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
1335 Return true. All the classes derived from InternalFunctionImp need
1336 to return true from this -- later we can remove all the extra
1337 implementations too.
1339 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1341 - fix build breakage caused by last-minute change to my patch
1345 2006-02-20 Maciej Stachowiak <mjs@apple.com>
1347 Reviewed by Geoff and Darin.
1349 Patch from Maks Orlovich, based on work by David Faure, hand-applied and
1350 significantly reworked by me.
1352 - Patch: give internal function names (KJS merge)
1353 http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
1355 * tests/mozilla/expected.html: Updated for newly fixed test.
1357 * kjs/array_object.cpp:
1358 (ArrayProtoFunc::ArrayProtoFunc):
1359 * kjs/array_object.h:
1360 * kjs/bool_object.cpp:
1361 (BooleanPrototype::BooleanPrototype):
1362 (BooleanProtoFunc::BooleanProtoFunc):
1363 * kjs/bool_object.h:
1364 * kjs/date_object.cpp:
1365 (KJS::DateProtoFunc::DateProtoFunc):
1366 (KJS::DateObjectImp::DateObjectImp):
1367 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1368 * kjs/error_object.cpp:
1369 (ErrorPrototype::ErrorPrototype):
1370 (ErrorProtoFunc::ErrorProtoFunc):
1371 * kjs/error_object.h:
1373 (KJS::FunctionImp::FunctionImp):
1374 (KJS::GlobalFuncImp::GlobalFuncImp):
1376 * kjs/function_object.cpp:
1377 (FunctionPrototype::FunctionPrototype):
1378 (FunctionProtoFunc::FunctionProtoFunc):
1379 (FunctionProtoFunc::callAsFunction):
1380 * kjs/function_object.h:
1382 (KJS::InterpreterImp::initGlobalObject):
1383 (KJS::InternalFunctionImp::InternalFunctionImp):
1385 (KJS::InternalFunctionImp::functionName):
1387 (KJS::staticFunctionGetter):
1388 (KJS::HashEntryFunction::HashEntryFunction):
1389 (KJS::HashEntryFunction::implementsCall):
1390 (KJS::HashEntryFunction::toBoolean):
1391 (KJS::HashEntryFunction::implementsHasInstance):
1392 (KJS::HashEntryFunction::hasInstance):
1393 * kjs/math_object.cpp:
1394 (MathFuncImp::MathFuncImp):
1395 * kjs/math_object.h:
1396 * kjs/number_object.cpp:
1397 (NumberPrototype::NumberPrototype):
1398 (NumberProtoFunc::NumberProtoFunc):
1399 * kjs/number_object.h:
1401 (KJS::JSObject::putDirectFunction):
1402 (KJS::Error::create):
1404 * kjs/object_object.cpp:
1405 (ObjectPrototype::ObjectPrototype):
1406 (ObjectProtoFunc::ObjectProtoFunc):
1407 * kjs/object_object.h:
1408 * kjs/regexp_object.cpp:
1409 (RegExpPrototype::RegExpPrototype):
1410 (RegExpProtoFunc::RegExpProtoFunc):
1411 * kjs/regexp_object.h:
1412 * kjs/string_object.cpp:
1413 (StringProtoFunc::StringProtoFunc):
1414 (StringObjectImp::StringObjectImp):
1415 (StringObjectFuncImp::StringObjectFuncImp):
1416 * kjs/string_object.h:
1418 2006-02-20 Geoffrey Garen <ggaren@apple.com>
1420 Reviewed by Darin, with help from Eric, Maciej.
1422 - More changes to support super-accurate JS iBench. Doesn't work on
1423 Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
1424 opendarwin.org/show_bug.cgi?id= 7399] about that.
1426 * kjs/interpreter.cpp:
1427 (KJS::Interpreter::evaluate): Print line numbers with exception output
1428 * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the
1429 way we roll with .cpp files.
1430 (StopWatch::StopWatch): New class. Provides microsecond-accurate
1432 (StopWatch::~StopWatch):
1435 (StopWatch::getElapsedMS):
1436 (TestFunctionImp::callAsFunction): Added missing return statement.
1437 Fixed up "run" to use refactored helper functions. Removed bogus
1438 return statement from "quit" case. Made "print" output to stdout
1439 instead of stderr because that makes more sense, and PERL handles
1441 (main): Factored out KXMLCore unit tests. Removed custom exception
1442 printing code because the interpreter prints exceptions for you. Added
1443 a "delete" call for the GlobalImp we allocate.
1444 (testIsInteger): New function, result of refacotring.
1445 (createStringWithContentsOfFile): New function, result of refactoring.
1446 Renamed "code" to "buffer" to match factored-out-ness.
1448 2006-02-20 Eric Seidel <eseidel@apple.com>
1452 Fix "Copy ICU DLLs..." phase.
1454 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1455 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1457 2006-02-19 Darin Adler <darin@apple.com>
1459 - renamed ERROR to LOG_ERROR to fix build
1460 presumably Maciej had this change and forgot to land it
1462 * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
1463 * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
1464 * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
1466 2006-02-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
1468 Test: fast/js/toString-exception.html
1472 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
1473 REGRESSION: fast/js/toString-overrides.html fails when run multiple times
1475 * kjs/array_object.cpp:
1476 (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
1479 2006-02-18 Darin Adler <darin@apple.com>
1483 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
1484 add insert and remove to KXMLCore::Vector
1486 * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
1487 insert and remove to slide elements within the vector. Also added
1488 "insert" and "remove" functions.
1490 2006-02-16 Geoffrey Garen <ggaren@apple.com>
1494 - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
1495 Bindings::Instance::deref when leaving page @ gigaom.com
1497 * bindings/c/c_instance.cpp:
1498 (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
1499 globally, we shouldn't delete it, so don't.
1501 2006-02-16 Timothy Hatcher <timothy@apple.com>
1503 Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
1504 warnings. Using <rdar://problem/4448350> to track this.
1506 * JavaScriptCore.xcodeproj/project.pbxproj:
1507 * bindings/objc/objc_jsobject.h: Removed empty file.
1508 * bindings/objc/objc_jsobject.mm: Removed empty file.
1510 2006-02-16 Tim Omernick <timo@apple.com>
1514 <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
1515 javascript disabled (7015)
1517 * bindings/NP_jsobject.cpp:
1518 (_NPN_CreateNoScriptObject):
1519 Returns an NPObject which is not bound to a JavaScript object. This kind of NPObject
1520 can be given to a plugin as the "window script object" when JavaScript is disabled.
1521 The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
1522 Because of this, none of the NPN_* functions called by the plugin on this "no script
1523 object" will cause entry into JavaScript code.
1524 (_NPN_InvokeDefault):
1525 Make sure the NPVariant is filled before returning from this function. This never
1526 mattered before because we never reached this case, having only created NPObjects of
1527 the class NPScriptObjectClass.
1535 * bindings/NP_jsobject.h:
1536 Declared _NPN_CreateNoScriptObject().
1538 2006-02-16 Darin Adler <darin@apple.com>
1540 Reviewed by me, change by Peter Kuemmel.
1542 * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
1543 checking for positive infinity (rolling in fix from KDE side).
1545 2006-02-15 Geoffrey Garen <ggaren@apple.com>
1547 Reviewed by Maciej, Eric.
1549 - WebCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
1550 crashes in DashboardClient at com.apple.JavaScriptCore:
1551 KJS::Bindings::ObjcFallbackObjectImp::type()
1553 WebCore and JavaScriptCore weren't sharing Instance objects very
1554 nicely. I made them use RefPtrs, and sent them to bed without dessert.
1556 * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
1557 (JavaInstance::~JavaInstance):
1558 (JObjectWrapper::JObjectWrapper):
1559 * bindings/jni/jni_instance.h:
1560 (KJS::Bindings::JObjectWrapper::ref):
1561 (KJS::Bindings::JObjectWrapper::deref):
1562 * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
1563 (JavaArray::~JavaArray):
1564 (JavaArray::JavaArray):
1565 * bindings/jni/jni_runtime.h:
1566 (KJS::Bindings::JavaArray::operator=):
1567 * bindings/objc/objc_runtime.h:
1568 - Prohibited copying because that would muss the ref count.
1569 - Prohibited construction without instance because an instance wrapper
1570 without an instance is almost certainly a bug.
1571 * bindings/objc/objc_runtime.mm:
1572 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1573 * bindings/runtime.cpp:
1574 (KJS::Bindings::Instance::Instance):
1575 (KJS::Bindings::Instance::createBindingForLanguageInstance):
1576 (KJS::Bindings::Instance::createRuntimeObject):
1577 * bindings/runtime.h:
1578 (KJS::Bindings::Instance::ref):
1579 (KJS::Bindings::Instance::deref):
1580 * bindings/runtime_object.cpp:
1581 (RuntimeObjectImp::RuntimeObjectImp):
1582 (RuntimeObjectImp::fallbackObjectGetter):
1583 (RuntimeObjectImp::fieldGetter):
1584 (RuntimeObjectImp::methodGetter):
1585 (RuntimeObjectImp::getOwnPropertySlot):
1586 (RuntimeObjectImp::put):
1587 (RuntimeObjectImp::canPut):
1588 * bindings/runtime_object.h:
1589 - Removed ownsInstance data member because RefPtr takes care of
1590 instance lifetime now.
1591 - Prohibited copying because that would muss the ref count.
1592 - Prohibited construction without instance because an instance wrapper
1593 without an instance is almost certainly a bug.
1594 (KJS::RuntimeObjectImp::getInternalInstance):
1596 2006-02-15 Geoffrey Garen <ggaren@apple.com>
1600 - Applied the 4330457 change to CClass and ObjcClass as well.
1602 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
1605 This change isn't as critical because CClass and ObjcClass objects get
1606 cached globally and never deleted, but it's good practice, in case we
1607 ever do decide to delete CClass and ObjcClass objects.
1609 This change requires prohibiting copying, because we don't do any
1610 intelligent ref-counting -- when a Class is destroyed, it destroys its
1611 methods and fields unconditionally. (Java classes already prohibited
1614 * bindings/c/c_class.cpp:
1615 - Merged _commonInit and _commonDelete into constructor and destructor.
1618 (CClass::methodsNamed): Added delete callbacks
1619 (CClass::fieldNamed): Added delete callbacks
1620 * bindings/c/c_class.h: Prohibited copying
1621 * bindings/c/c_instance.cpp:
1622 (KJS::Bindings::CInstance::getClass): Changed to use the preferred
1623 class factory method, to take advantage of the global cache.
1625 [ Repeated changes applied to CClass for ObjcClass: ]
1627 * bindings/objc/objc_class.h:
1628 * bindings/objc/objc_class.mm:
1629 (KJS::Bindings::ObjcClass::ObjcClass):
1630 (KJS::Bindings::ObjcClass::~ObjcClass):
1631 (KJS::Bindings::ObjcClass::methodsNamed):
1632 (KJS::Bindings::ObjcClass::fieldNamed):
1633 * bindings/objc/objc_runtime.h:
1634 (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
1635 variable to prevent bad CFRelease.
1636 (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
1637 if statement to prevent bad CFRelease.
1638 * bindings/objc/objc_runtime.cpp: Changed to use the preferred
1639 ObjectStructPtr, for clarity.
1641 2006-02-14 Geoffrey Garen <ggaren@apple.com>
1645 - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
1646 in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
1649 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
1652 This was a memory leak in the bindings code. The leak was so extreme
1653 that it would cause Safari or the JVM to abort from lack of memory.
1654 Upon construction, Class objects create field and method objects,
1655 storing them in CFDictionaries. The bug was that upon destruction, the
1656 class objects released the dictionaries but didn't destroy the stored
1659 The fix is to supply CFDictionary callbacks for destroying the values
1660 added to the dictionary.
1662 * bindings/jni/jni_class.cpp:
1663 (JavaClass::JavaClass): Added delete callbacks
1664 * bindings/runtime.cpp: Added definitions for delete callbacks
1665 (KJS::Bindings::deleteMethodList):
1666 (KJS::Bindings::deleteMethod):
1667 (KJS::Bindings::deleteField):
1668 * bindings/runtime.h: Added declarations for delete callbacks
1670 2006-02-14 Timothy Hatcher <timothy@apple.com>
1674 Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
1675 behavior due to POSIX version of sh
1677 * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
1679 2006-02-13 Dave Hyatt <hyatt@apple.com>
1681 Fix Win32 bustage in JavaScriptCore.
1685 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1686 Add JSImmediate to the Win32 project.
1688 * kjs/JSImmediate.h:
1689 (KJS::JSImmediate::fromDouble):
1690 (KJS::JSImmediate::toDouble):
1691 (KJS::JSImmediate::NanAsBits):
1692 (KJS::JSImmediate::oneAsBits):
1693 Win32 needs explicit returns after abort() for non-void functions.
1697 Win32 catches a bug in testkjs! The "return 2" should actually
1698 have been a return false.
1701 The extern decls of NaN and Inf need to be const.
1703 === JavaScriptCore-521.7 ===
1705 2006-02-13 Timothy Hatcher <timothy@apple.com>
1709 Replaced the old NS_DURING exception blocking with @try/@catch.
1711 * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
1712 * bindings/objc/objc_instance.mm:
1713 (ObjcInstance::invokeMethod):
1714 (ObjcInstance::invokeDefaultMethod):
1715 (ObjcInstance::setValueOfUndefinedField):
1716 (ObjcInstance::getValueOfUndefinedField):
1717 * bindings/objc/objc_runtime.mm:
1718 (ObjcField::valueFromInstance):
1719 (ObjcField::setValueToInstance):
1720 (ObjcArray::setValueAt):
1721 (ObjcArray::valueAt):
1723 2006-02-13 Darin Adler <darin@apple.com>
1725 - fix a couple problems building on Windows, based on requests
1726 from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1728 * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
1729 to the standard uint32/64_t. Also removed curious "isIEEE()" function
1730 that checked the sizes of some types (and type sizes alone don't tell you if
1731 the floating point conforms to the IEEE-standard). Added missing include
1734 * kjs/property_slot.h: Added missing include of <assert.h>.
1736 2006-02-12 Geoffrey Garen <ggaren@apple.com>
1740 Cleaned up testkjs, added new "run" functionality to allow scripting
1741 tests from within JS. ("run" is a part of my new super-accurate
1744 No regressions in run-javascriptcore-tests.
1747 (GlobalImp::className):
1748 (TestFunctionImp::):
1749 (TestFunctionImp::callAsFunction):
1753 2006-02-11 Alexey Proskuryakov <ap@nypop.com>
1757 - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
1758 RealPlayer.GetTitle() Crashes Safari/Dashboard
1760 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
1761 Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1,
1762 because the latter encoding has holes, and conversion can still fail.
1764 2006-02-10 Geoffrey Garen <ggaren@apple.com>
1768 - Inlined RefPtr assignment operators. .7% performance win on
1769 super-accurate JS iBench.
1771 * kxmlcore/RefPtr.h:
1772 (KXMLCore::::operator):
1774 2006-02-10 Geoffrey Garen <ggaren@apple.com>
1776 No review needed, just a build fix. This time for sure.
1780 2006-02-10 Geoffrey Garen <ggaren@apple.com>
1784 - Fixed build. As it goes without saying, I will not mention that I
1787 * JavaScriptCore.xcodeproj/project.pbxproj:
1788 * kjs/JSImmediate.cpp:
1789 (KJS::JSImmediate::toObject):
1791 2006-02-09 Geoffrey Garen <ggaren@apple.com>
1795 - Fixed <rdar://problem/4343730> Should switch ConstantValues (null,
1796 undefined, true, false) from JS objects to immediate values similar to
1799 2.0% performance gain on my new super-accurate version of JS iBench.
1800 (I promise to land a version of it soon.)
1802 The gist of the change:
1803 (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
1804 class (JSImmediate.h/.cpp), and it handles not only numbers but also
1805 null, undefined, true, and false.
1806 (2) JSImmediate provides convenience methods for the bit masking
1807 necessary to encode and decode immediate values.
1808 (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
1809 (4) JSCell no longer implements functions like getBoolean, because
1810 only a JSImmediate can be a boolean.
1811 (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
1812 and ALWAYS_INLINE is a non-portable option of last resort.
1813 (6) Type is now JSType, and it resides in its own file, JSType.h.
1814 Since I was there, I did some header include sorting as part of this
1817 The rest pretty much explains itself.
1819 * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
1820 added JSImmediate.h/.cpp.
1821 * bindings/c/c_instance.cpp:
1822 (KJS::Bindings::CInstance::defaultValue):
1823 * bindings/c/c_instance.h:
1824 * bindings/c/c_utility.cpp:
1825 (KJS::Bindings::convertValueToNPVariant):
1826 * bindings/jni/jni_instance.cpp:
1827 (JavaInstance::defaultValue):
1828 * bindings/jni/jni_instance.h:
1829 * bindings/jni/jni_jsobject.cpp:
1830 (JavaJSObject::convertValueToJObject):
1831 * bindings/objc/WebScriptObject.mm:
1832 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1833 Standardized calls to use getXXX instead of hand-rolling JSValue
1835 * bindings/objc/objc_instance.h:
1836 * bindings/objc/objc_instance.mm:
1837 (ObjcInstance::getValueOfUndefinedField):
1838 (ObjcInstance::defaultValue):
1839 * bindings/objc/objc_runtime.h:
1840 * bindings/objc/objc_runtime.mm:
1841 (ObjcFallbackObjectImp::type):
1842 (ObjcFallbackObjectImp::defaultValue):
1843 * bindings/runtime.h:
1844 (KJS::Bindings::Instance::getValueOfUndefinedField):
1845 * bindings/runtime_object.cpp:
1846 (RuntimeObjectImp::defaultValue):
1847 * bindings/runtime_object.h:
1848 * kjs/JSImmediate.h: Added.
1849 (KJS::JSImmediate::isImmediate):
1850 (KJS::JSImmediate::isNumber):
1851 (KJS::JSImmediate::isBoolean):
1852 (KJS::JSImmediate::isUndefinedOrNull):
1853 (KJS::JSImmediate::fromDouble):
1854 (KJS::JSImmediate::toDouble):
1855 (KJS::JSImmediate::toBoolean):
1856 (KJS::JSImmediate::trueImmediate):
1857 (KJS::JSImmediate::falseImmediate):
1858 (KJS::JSImmediate::NaNImmediate):
1859 (KJS::JSImmediate::undefinedImmediate):
1860 (KJS::JSImmediate::nullImmediate):
1861 (KJS::JSImmediate::tag):
1862 (KJS::JSImmediate::unTag):
1863 (KJS::JSImmediate::getTag):
1864 (KJS::JSImmediate::):
1865 (KJS::JSImmediate::isIEEE):
1866 (KJS::JSImmediate::is32bit):
1867 (KJS::JSImmediate::is64bit):
1868 (KJS::JSImmediate::NanAsBits):
1869 (KJS::JSImmediate::zeroAsBits):
1870 (KJS::JSImmediate::oneAsBits):
1872 (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
1873 * kjs/JSType.h: Added.
1874 * kjs/collector.cpp:
1875 (KJS::Collector::protect):
1876 (KJS::Collector::unprotect):
1877 (KJS::Collector::collect):
1879 (KJS::StringImp::toPrimitive):
1880 (KJS::NumberImp::toPrimitive):
1881 (KJS::NumberImp::toBoolean):
1882 (KJS::GetterSetterImp::toPrimitive):
1884 (KJS::StringImp::type):
1885 (KJS::NumberImp::type):
1887 (KJS::JSObject::type):
1888 (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
1889 I'm looking for?" test with "Are you not the one thing I'm not looking
1891 (KJS::JSObject::defaultValue):
1892 (KJS::JSObject::toPrimitive):
1894 (KJS::GetterSetterImp::type):
1895 (KJS::JSValue::isObject):
1896 * kjs/operations.cpp:
1900 * kjs/reference.cpp:
1901 (KJS::Reference::deleteValue):
1902 * kjs/simple_number.h: Removed.
1903 * kjs/string_object.cpp:
1904 (StringInstance::getOwnPropertySlot): fixed indentation
1906 (KJS::JSValue::toObject):
1907 (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
1908 us to inline jsNumber without adding PIC branches to callers.
1915 (KJS::JSValue::downcast):
1916 (KJS::JSValue::isUndefinedOrNull):
1917 (KJS::JSValue::isBoolean):
1918 (KJS::JSValue::isNumber):
1919 (KJS::JSValue::isString):
1920 (KJS::JSValue::isObject):
1921 (KJS::JSValue::getBoolean):
1922 (KJS::JSValue::getNumber):
1923 (KJS::JSValue::getString):
1924 (KJS::JSValue::getObject):
1925 (KJS::JSValue::getUInt32):
1926 (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
1927 resulting in a slight performance gain. Callers should always check
1928 !marked() before calling mark(), so it's impossible to call mark on
1930 (KJS::JSValue::marked):
1931 (KJS::JSValue::type):
1932 (KJS::JSValue::toPrimitive):
1933 (KJS::JSValue::toBoolean):
1934 (KJS::JSValue::toNumber):
1935 (KJS::JSValue::toString):
1937 2006-02-06 Eric Seidel <eseidel@apple.com>
1939 Add svn:ignore properties for visual studio internals.
1941 2006-02-06 Alexey Proskuryakov <ap@nypop.com>
1945 - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
1946 http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
1948 - No tests added - only changed functionality on WIN32, which should be covered by
1951 * kjs/date_object.cpp:
1952 (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
1954 (KJS::timeZoneOffset): Removed, was basically the same as the above.
1955 (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
1956 Windows based on struct tm itself.
1957 (KJS::DateInstance::getTime): Added.
1958 (KJS::DateInstance::getUTCTime): Added.
1959 (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
1960 (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
1961 (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
1962 GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
1963 with daylight savings time being in effect.
1965 * kjs/date_object.h: Added prototypes for new functions.
1967 2006-02-05 Maciej Stachowiak <mjs@apple.com>
1971 - fixed ~1100 KJS::Node leaked on layout tests
1972 http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
1975 (KJS::Parser::noteNodeCycle):
1976 (KJS::Parser::removeNodeCycle):
1977 (KJS::clearNewNodes):
1980 (ElementNode::breakCycle):
1981 (PropertyListNode::breakCycle):
1982 (ArgumentListNode::breakCycle):
1983 (StatListNode::StatListNode):
1984 (StatListNode::breakCycle):
1985 (VarDeclListNode::breakCycle):
1986 (BlockNode::BlockNode):
1987 (ClauseListNode::breakCycle):
1988 (CaseBlockNode::CaseBlockNode):
1989 (ParameterNode::breakCycle):
1990 (SourceElementsNode::SourceElementsNode):
1991 (SourceElementsNode::breakCycle):
1993 (KJS::Node::breakCycle):
1994 (KJS::ElementNode::ElementNode):
1995 (KJS::ArrayNode::ArrayNode):
1996 (KJS::PropertyListNode::PropertyListNode):
1997 (KJS::ObjectLiteralNode::ObjectLiteralNode):
1998 (KJS::ArgumentListNode::ArgumentListNode):
1999 (KJS::ArgumentsNode::ArgumentsNode):
2000 (KJS::VarDeclListNode::VarDeclListNode):
2001 (KJS::VarStatementNode::VarStatementNode):
2002 (KJS::ForNode::ForNode):
2003 (KJS::CaseClauseNode::CaseClauseNode):
2004 (KJS::ClauseListNode::ClauseListNode):
2005 (KJS::ParameterNode::ParameterNode):
2006 (KJS::FuncExprNode::FuncExprNode):
2007 (KJS::FuncDeclNode::FuncDeclNode):
2009 2006-02-05 Maciej Stachowiak <mjs@apple.com>
2013 - fix default traits for classes to make sure default constructors get called
2015 * kxmlcore/VectorTraits.h:
2018 2006-02-04 Darin Adler <darin@apple.com>
2022 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
2023 REGRESSION: for/in loop with var changes global variable instead of making local
2025 Test: fast/js/for-in-var-scope.html
2028 (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
2029 (ForInNode::execute): Break out of the scope chain loop once we find and set the
2030 loop variable. We don't want to set multiple loop variables.
2031 (ForInNode::processVarDecls): Process the declaration of the loop variable.
2035 * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
2036 * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
2037 instead of defining it here a second time.
2039 2006-02-04 Maciej Stachowiak <mjs@apple.com>
2043 - change JavaScript collector statistics calls to use HashCountedSet instead
2044 of CFSet; other misc cleanup
2045 http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
2047 * kjs/collector.cpp:
2048 (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
2050 (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
2053 (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
2056 2006-02-03 Timothy Hatcher <timothy@apple.com>
2060 Renamed configuration names to Debug, Release and Production.
2062 * JavaScriptCore.xcodeproj/project.pbxproj:
2064 2006-02-02 George Staikos <staikos@opensource.apple.com>
2068 * kjs/lookup.h: Fix compile, merged from KDE.
2070 2006-02-02 Darin Adler <darin@apple.com>
2074 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
2075 add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
2077 * kxmlcore/Noncopyable.h: Added.
2078 * kxmlcore/OwnArrayPtr.h: Added.
2079 * kxmlcore/OwnPtr.h: Added.
2081 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
2084 * kjs/function.cpp: Use OwnPtr for Parameter pointers.
2086 * kjs/internal.h: Use Noncopyable for LabelStack.
2088 * kjs/list.cpp: Use OwnArrayPtr for overflow.
2090 * kjs/property_map.h:
2091 * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
2092 Use Vector for some stack buffers.
2094 * kjs/regexp_object.h:
2095 * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
2097 2006-01-31 Maciej Stachowiak <mjs@apple.com>
2101 - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
2102 that would catch them
2105 (NodeCounter::~NodeCounter): Added debug-only node counter.
2108 * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
2110 2006-01-31 Darin Adler <darin@apple.com>
2114 - added deleteAllValues for HashSet as well as HashMap
2115 - fixed conversion from const_iterator to iterator, which I broke a while back
2117 * kxmlcore/HashMap.h: Updated copyright date.
2118 * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
2119 * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
2121 2006-01-31 Tim Omernick <timo@apple.com>
2123 Reviewed by Geoff Garen.
2125 * bindings/c/c_utility.cpp:
2126 (KJS::Bindings::convertUTF8ToUTF16):
2127 Fixed an invalid assertion that UTF8Chars is not NULL. It is valid for it to be NULL as long as
2129 This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
2130 where JavaScript is getting a NULL string back from some call on the Real Player plugin.
2132 2006-01-30 Anders Carlsson <andersca@mac.com>
2136 Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
2137 REGRESSION: United.com menus messed up due to document.all/MSIE sniff
2140 (typeStringForValue):
2141 Return "undefined" if the given object should masquerade as undefined.
2144 (KJS::JSObject::masqueradeAsUndefined):
2145 Rename from isEqualToNull.
2147 * kjs/operations.cpp:
2149 Update for name change.
2151 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2155 - properly define Vector assignment operator; the private version was accidentally left
2156 in, and the template version is not enough to replace the default
2158 * kxmlcore/Vector.h:
2159 (KXMLCore::Vector::operator=):
2161 2006-01-29 Eric Seidel <eseidel@apple.com>
2165 Fix the build by applying a GCC-specific namespace hack.
2169 2006-01-29 Eric Seidel <eseidel@apple.com>
2175 * kjs/lookup.h: fixed ::cacheGlobalObject
2176 * kxmlcore/Vector.h:
2177 (KXMLCore::Vector::operator[]): use unsigned long
2179 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2181 Reviewed by Dave Hyatt.
2183 * kxmlcore/Vector.h:
2184 (KXMLCore::Vector::operator[]): Add unsigned overload
2186 2006-01-28 Darin Adler <darin@apple.com>
2188 Reviewed by John Sullivan.
2190 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
2191 include exception names in JavaScript form of DOM exception
2193 * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
2194 exception in the error message.
2196 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2200 - miscellaneous Vector improvements
2202 * kxmlcore/Vector.h:
2203 (KXMLCore::Vector::at): Add range-checking asserts.
2204 (KXMLCore::Vector::first): Added as a convenience.
2205 (KXMLCore::Vector::last): Convenience for stack-style use.
2206 (KXMLCore::Vector::removeLast): ditto
2208 2006-01-28 Darin Adler <darin@apple.com>
2210 Reviewed by John Sullivan
2212 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
2213 REGRESSION: JavaScript Date constructor won't accept another Date object
2215 Test: fast/js/date-constructor.html
2217 * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
2218 Added a special case for constructing one date from another (to avoid losing
2219 milliseconds, which are not in the text form, to match Firefox), and changed
2220 the base code to convert to primitive before checking for string to match
2221 the standard. Also corrected a couple silly things in the "construct from
2222 current time" code path (removed a floor that does no good, and changed
2223 the constant used to convert microseconds to milliseconds to be a 1000
2224 rather than "msPerSecond").
2226 2006-01-28 Darin Adler <darin@apple.com>
2228 * kjs/create_hash_table: Added missing license.
2230 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2232 Reviewed by Dave Hyatt.
2234 - added a Vector class
2235 http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
2237 * JavaScriptCore.xcodeproj/project.pbxproj:
2239 (KJS::Parser::saveNewNode): Apply Vector.
2240 (KJS::clearNewNodes): ditto
2241 * kjs/number_object.cpp:
2242 (integer_part_noexp): ditto
2243 (char_sequence): ditto
2245 (KJS::UString::UTF8String): ditto
2246 * kxmlcore/HashMap.h:
2247 (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
2248 other versions are useful for other containers.
2249 * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
2250 be usable for all Array/QVector style purposes, and also as a stack buffer
2251 with oversize handling. Also some helper classes to make vector operations
2252 as efficient as possible for POD types and for simple non-PODs like RefPtr.
2254 (KXMLCore::VectorTypeOperations::destruct):
2255 (KXMLCore::VectorTypeOperations::initialize):
2256 (KXMLCore::VectorTypeOperations::move):
2257 (KXMLCore::VectorTypeOperations::uninitializedCopy):
2258 (KXMLCore::VectorTypeOperations::uninitializedFill):
2259 (KXMLCore::VectorBuffer::VectorBuffer):
2260 (KXMLCore::VectorBuffer::~VectorBuffer):
2261 (KXMLCore::VectorBuffer::deallocateBuffer):
2262 (KXMLCore::VectorBuffer::inlineBuffer):
2263 (KXMLCore::Vector::Vector):
2264 (KXMLCore::Vector::~Vector):
2265 (KXMLCore::Vector::size):
2266 (KXMLCore::Vector::capacity):
2267 (KXMLCore::Vector::isEmpty):
2268 (KXMLCore::Vector::at):
2269 (KXMLCore::Vector::operator[]):
2270 (KXMLCore::Vector::data):
2271 (KXMLCore::Vector::operator T*):
2272 (KXMLCore::Vector::operator const T*):
2273 (KXMLCore::Vector::begin):
2274 (KXMLCore::Vector::end):
2275 (KXMLCore::Vector::clear):
2276 (KXMLCore::Vector::fill):
2277 (KXMLCore::Vector::operator=):
2278 (KXMLCore::::Vector):
2279 (KXMLCore::::operator):
2281 (KXMLCore::::expandCapacity):
2282 (KXMLCore::::resize):
2283 (KXMLCore::::reserveCapacity):
2284 (KXMLCore::::append):
2285 (KXMLCore::deleteAllValues):
2286 * kxmlcore/VectorTraits.h: Added.
2287 (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
2290 2006-01-28 Alexey Proskuryakov <ap@nypop.com>
2294 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2295 RealPlayer.GetTitle() Crashes Safari/Dashboard
2297 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2298 Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
2300 2006-01-25 George Staikos <staikos@opensource.apple.com>
2304 * kxmlcore/HashFunctions.h: Merge build fix from KDE.
2306 2006-01-25 Darin Adler <darin@apple.com>
2308 - removed an unused source file
2310 * kjs/pointer_hash.h: Removed.
2311 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
2313 2006-01-23 Anders Carlsson <andersca@mac.com>
2317 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
2318 KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
2321 Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
2323 (cacheGlobalObject):
2324 Move this out of the KJS namespace.
2326 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2330 - renamed PointerHash to PtrHash
2331 - made PtrHash the default hash function for int and pointer types that aren't further specialized
2332 - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
2333 - did appropriate consequent cleanup (very few places now need to declare a hash function)
2334 http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
2336 * kjs/array_object.cpp:
2337 (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
2338 * kjs/collector.cpp: ditto
2339 * kjs/identifier.cpp:
2340 (KXMLCore::): declare DefaultHash the new way
2341 * kjs/internal.cpp: no need to mention PointerHash
2343 * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
2344 easier to specialize on PtrHash
2345 * kxmlcore/HashFunctions.h:
2346 (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
2347 a Hash typedef rather than being a hash function class itself; declared DefaultHash
2348 for int and partializy specialized for pointer types
2349 * kxmlcore/HashMapPtrSpec.h:
2350 (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
2351 way of handling pointer hash
2352 (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
2354 * kxmlcore/HashMap.h: ditto
2355 * kxmlcore/HashSet.h: ditto
2357 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2359 Reviewed by Tim Omernick.
2361 - use classes instead of free functions for extractors, this better matches how other
2362 things work and should avoid the need for hacky workarounds on other compilers
2363 http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
2365 * kjs/array_object.cpp:
2366 * kjs/identifier.cpp:
2368 * kxmlcore/HashMap.h:
2369 (KXMLCore::PairFirstExtractor::extract):
2370 * kxmlcore/HashMapPtrSpec.h:
2372 * kxmlcore/HashSet.h:
2373 (KXMLCore::IdentityExtractor::extract):
2374 * kxmlcore/HashTable.h:
2375 (KXMLCore::addIterator):
2376 (KXMLCore::removeIterator):
2377 (KXMLCore::HashTable::add):
2378 (KXMLCore::HashTable::isEmptyBucket):
2379 (KXMLCore::HashTable::isDeletedBucket):
2380 (KXMLCore::HashTable::HashTable):
2381 (KXMLCore::HashTable::lookup):
2382 (KXMLCore::HashTable::add):
2383 (KXMLCore::HashTable::reinsert):
2384 (KXMLCore::HashTable::find):
2385 (KXMLCore::HashTable::contains):
2386 (KXMLCore::HashTable::remove):
2387 (KXMLCore::HashTable::allocateTable):
2388 (KXMLCore::HashTable::deallocateTable):
2389 (KXMLCore::HashTable::expand):
2390 (KXMLCore::HashTable::rehash):
2391 (KXMLCore::HashTable::clear):
2392 (KXMLCore::HashTable::swap):
2393 (KXMLCore::HashTable::operator):
2394 (KXMLCore::HashTable::checkTableConsistency):
2395 (KXMLCore::HashTable::checkTableConsistencyExceptSize):
2396 (KXMLCore::HashTable::invalidateIterators):
2398 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2400 Rubber stamped by Tim Hatcher.
2402 - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
2403 for consistency with HashMap
2405 * kjs/array_object.cpp:
2406 (ArrayProtoFunc::callAsFunction):
2407 * kjs/collector.cpp:
2408 (KJS::Collector::protect):
2409 * kjs/identifier.cpp:
2410 (KJS::Identifier::add):
2411 * kxmlcore/HashCountedSet.h:
2413 * kxmlcore/HashMap.h:
2414 (KXMLCore::::inlineAdd):
2415 * kxmlcore/HashSet.h:
2417 * kxmlcore/HashTable.h:
2418 (KXMLCore::HashTable::add):
2420 (KXMLCore::::HashTable):
2422 2006-01-23 Justin Garcia <justin.garcia@apple.com>
2424 Reviewed by thatcher
2426 Turned on -O2 for B&I build.
2428 * JavaScriptCore.xcodeproj/project.pbxproj:
2430 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2432 Reviewed by Tim Hatcher.
2434 - it's "Franklin Street", not "Franklin Steet"
2436 * kjs/array_instance.h:
2437 * kjs/array_object.cpp:
2438 * kjs/array_object.h:
2439 * kjs/bool_object.cpp:
2440 * kjs/bool_object.h:
2441 * kjs/collector.cpp:
2445 * kjs/date_object.cpp:
2446 * kjs/date_object.h:
2450 * kjs/error_object.cpp:
2451 * kjs/error_object.h:
2454 * kjs/function_object.cpp:
2455 * kjs/function_object.h:
2457 * kjs/identifier.cpp:
2461 * kjs/interpreter.cpp:
2462 * kjs/interpreter.h:
2469 * kjs/math_object.cpp:
2470 * kjs/math_object.h:
2473 * kjs/nodes2string.cpp:
2474 * kjs/number_object.cpp:
2475 * kjs/number_object.h:
2478 * kjs/object_object.cpp:
2479 * kjs/object_object.h:
2480 * kjs/operations.cpp:
2482 * kjs/property_map.cpp:
2483 * kjs/property_map.h:
2484 * kjs/property_slot.cpp:
2485 * kjs/property_slot.h:
2486 * kjs/reference.cpp:
2488 * kjs/reference_list.cpp:
2489 * kjs/reference_list.h:
2492 * kjs/regexp_object.cpp:
2493 * kjs/regexp_object.h:
2494 * kjs/scope_chain.cpp:
2495 * kjs/scope_chain.h:
2496 * kjs/simple_number.h:
2497 * kjs/string_object.cpp:
2498 * kjs/string_object.h:
2505 * kxmlcore/AlwaysInline.h:
2506 * kxmlcore/ListRefPtr.h:
2507 * kxmlcore/PassRefPtr.h:
2508 * kxmlcore/RefPtr.h:
2510 2006-01-23 Darin Adler <darin@apple.com>
2512 Reviewed by John Sullivan.
2514 - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
2515 REGRESSION: Crash in cloneChildNodes when clicking element
2517 * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
2518 type by calling get() instead of going directly at m_ptr.
2519 * kxmlcore/RefPtr.h: Ditto.
2523 * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
2524 It's just a resorted list of keys in a dictionary.
2526 * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
2527 in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
2528 routine" property we want to have on OS X.
2530 2006-01-22 Maciej Stachowiak <mjs@apple.com>
2534 - Set up Page class and invert Frame / WebCoreFrameBridge ownership
2535 http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
2537 * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can
2540 2006-01-23 George Staikos <staikos@opensource.apple.com>
2542 Reviewed by Maciej and Darin.
2544 * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
2545 * kjs/interpreter.cpp: ditto
2546 * kjs/simple_number.h: Add assert.h and remove from config.h
2547 * kjs/array_object.cpp: Use relative paths for kxmlcore includes
2548 * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
2550 2006-01-23 George Staikos <staikos@opensource.apple.com>
2554 * kjs/config.h: unbreak preprocessor change
2556 2006-01-23 George Staikos <staikos@opensource.apple.com>
2558 Approved by Maciej and Darin.
2562 Update FSF address in license to make merging easier
2564 2006-01-22 George Staikos <staikos@opensource.apple.com>
2568 * kjs/collector.cpp: merge major speedup from KDE on Linux
2569 patch by Maks Orlovich, bug #6145
2570 Also unify cpu detection
2571 * kjs/config.h: define simpler CPU macros
2573 2006-01-22 George Staikos <staikos@opensource.apple.com>
2577 * kjs/collector.cpp: merge FreeBSD compile fix from KDE
2578 -> requires build magic for use
2580 2006-01-21 George Staikos <staikos@opensource.apple.com>
2584 * kjs/nodes2string.cpp
2587 Fix pedantic compile with some gcc versions (Merge from KDE)
2589 * kjs/create_hash_table:
2590 Fix build with Perl 5.8.0 (Merge from KDE)
2592 2006-01-18 Darin Adler <darin@apple.com>
2596 - hash table fixes needed for my WebCore changes
2598 * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
2599 Added a missing return statement.
2601 * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
2602 can't instantiate with a 0 by using traits rather than ? : to select the default
2603 emtpy value of hash table keys.
2605 - small cleanup of "runtime" code left over from recent JavaScript crash fix
2607 * bindings/runtime_root.h:
2608 (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
2609 since it's now a ProtectedPtr.
2610 (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
2611 fact that _imp was 0 and replaced with use of ProtectedPtr.
2612 (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
2614 2006-01-17 Darin Adler <darin@apple.com>
2618 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
2619 add assertions to check correct use of hash table iterators
2621 * kxmlcore/HashTable.h:
2622 (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
2623 maintained by the specified hash table.
2624 (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
2625 the list maintained by the hash table it's in.
2626 (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
2627 parameter, ignored when not debugging. Call addIterator.
2628 (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
2629 (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
2630 (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
2631 (KXMLCore::HashTableConstIterator::operator->): Ditto.
2632 (KXMLCore::HashTableConstIterator::operator++): Ditto.
2633 (KXMLCore::HashTableConstIterator::operator==): Ditto.
2634 (KXMLCore::HashTableConstIterator::operator!=): Ditto.
2635 (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
2636 pointer is not 0 and if there are two iterators that both point at the same table.
2637 (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
2638 as an implementation detail, to avoid having two separate iterator implementations.
2639 (KXMLCore::HashTableIterator::operator*): Ditto.
2640 (KXMLCore::HashTableIterator::operator->): Ditto.
2641 (KXMLCore::HashTableIterator::operator++): Ditto.
2642 (KXMLCore::HashTableIterator::operator==): Ditto.
2643 (KXMLCore::HashTableIterator::operator!=): Ditto.
2644 (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
2645 (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
2646 (KXMLCore::HashTable::makeIterator): Pass this pointer.
2647 (KXMLCore::HashTable::makeConstIterator): Ditto.
2648 (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
2649 entry point that modifies the hash table.
2650 (KXMLCore::HashTable::remove): Ditto.
2651 (KXMLCore::HashTable::clear): Ditto.
2652 (KXMLCore::HashTable::swap): Ditto.
2653 (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
2654 clears out the table, next, and previous pointers in all of them, and then clears
2655 the head so we have an empty list.
2656 (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
2657 passed-in table, and points the iterator at the table.
2658 (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
2659 the passed-in table.
2661 * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
2663 2006-01-17 Justin Garcia <justin.garcia@apple.com>
2667 Deployment builds now use -O2
2669 * JavaScriptCore.xcodeproj/project.pbxproj:
2671 2006-01-17 Darin Adler <darin@apple.com>
2675 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
2676 change RefPtr so that it works when deref ends up deleting the RefPtr
2678 * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
2679 * kxmlcore/RefPtr.h: Ditto.
2681 2006-01-16 Geoffrey Garen <ggaren@apple.com>
2685 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
2686 DateProtoFuncImp::callAsFunction can crash due to lack of type checking
2688 * kjs/date_object.cpp:
2689 (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods.
2690 This matches section 15.9.5 in the spec.
2692 2006-01-16 Tim Omernick <timo@apple.com>
2694 Reviewed by John Sullivan.
2696 JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
2698 * bindings/npruntime.cpp:
2699 (_NPN_ReleaseObject):
2700 Refactored part of this function out into _NPN_DeallocateObject.
2701 (_NPN_DeallocateObject):
2702 Forcibly deallocates the passed object, even if its refcount is
2705 * bindings/npruntime_impl.h:
2706 Declared _NPN_DeallocateObject().
2708 2006-01-16 Darin Adler <darin@apple.com>
2712 - fix problem with ++, ==, and != on const iterators in
2713 HashMaps that are using the pointer specialization
2715 * kxmlcore/HashMapPtrSpec.h:
2716 (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
2717 (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
2718 (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
2720 2006-01-15 Alexey Proskuryakov <ap@nypop.com>
2724 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
2725 run-javascriptcore-tests doesn't work
2727 * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm:
2728 Changed revision number to 1.8 (broken by svn migration).
2730 2006-01-14 David Kilzer <ddkilzer@kilzer.net>
2732 Reviewed and landed by Anders.
2734 * kjs/create_hash_table: Fixed comment typo.
2736 2006-01-13 Maks Orlovich <maksim@kde.org>
2738 Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
2740 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
2741 Misc. array object fixes from KJS
2743 * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
2744 (ArrayInstance::getOwnPropertySlot): Ditto.
2745 (ArrayInstance::deleteProperty): Ditto.
2746 (ArrayInstance::put): Ditto.
2747 (ArrayInstance::propList): Added a FIXME comment.
2748 (ArrayInstance::put): Throw exception on trying to set invalid array length.
2749 (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
2750 * kjs/array_object.h: Added MAX_ARRAY_INDEX.
2752 2006-01-13 Darin Adler <darin@apple.com>
2754 - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
2755 - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
2757 2006-01-13 Anders Carlsson <andersca@mac.com>
2761 * kjs/create_hash_table:
2762 Use correct size variables.
2764 2006-01-13 Anders Carlsson <andersca@mac.com>
2768 * kjs/create_hash_table:
2769 Don't create an empty entry array, instead add a entry with all fields
2770 set to null and set the hash table size to 1.
2774 Remove the hash table size check
2776 2006-01-12 Anders Carlsson <andersca@mac.com>
2780 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
2781 Crash when assigning a new function to a DOMParser object
2783 * JavaScriptCore.xcodeproj/project.pbxproj:
2784 Move lookup.cpp before lookup.h
2788 If the hash table is empty, return 0 early.
2790 2006-01-12 George Staikos <staikos@kde.org>
2794 * kjs/interpreter.cpp:
2796 * kjs/interpreter.h:
2797 Add helper to interpreter to call the collector in order to facilitate
2798 visibility rules in KDE.
2800 2006-01-12 George Staikos <staikos@kde.org>
2804 * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
2806 * kxmlcore/HashTable.h: Add missing assert.h
2808 2006-01-12 Darin Adler <darin@apple.com>
2812 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
2813 retire APPLE_CHANGES from JavaScriptCore
2815 * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
2816 APPLE_CHANGES and HAVE_CONFIG_H from all targets.
2818 * README: Removed. This had obsolete information in it
2819 and it wasn't clear what to replace it with.
2821 * kjs/collector.h: Removed an APPLE_CHANGES if around something
2822 that's not really platform-specific (although it does use a
2823 platform-specific API at the moment).
2824 * kjs/collector.cpp: Removed a mistaken comment.
2829 * kjs/operations.cpp:
2832 Use __APPLE__ instead of APPLE_CHANGES for code that should be
2833 used only on Mac OS X.
2835 * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
2836 of the runtime.h header. Even though that header isn't needed at the
2837 moment on platforms other than Mac OS X, the conditional stuff should
2838 be in the header itself, not in this one client.
2840 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
2841 code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
2842 any platform where pow is implemented corrrectly according to the IEEE
2843 standard. If it is needed on some, we can add it back with an appropriate
2844 #if for the platforms where it is needed.
2846 2006-01-12 Justin Haygood <justin@xiondigital.net>
2848 Reviewed, tweaked, and landed by Darin.
2850 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
2851 lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
2853 * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2854 quotes instead of angle brackets. Moved dtoa.h include to the top.
2855 Changed system header includes to use angle brackets instead of quotes.
2856 * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
2857 quotes instead of angle brackets.
2858 * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2859 quotes instead of angle brackets. Moved lexer.h include to the top.
2860 * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2861 quotes instead of angle brackets. Moved ustring.h include to the top.
2863 2006-01-12 George Staikos <staikos@kde.org>
2867 - Import initial QMake file. Doesn't fully work yet.
2869 2006-01-11 Ricci Adams <ricciadams@apple.com>
2871 Reviewed by Maciej and Darin, landed by Darin.
2873 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
2874 final comma in javascript object prevents parsing
2876 * kjs/grammar.y: Added rule to allow trailing comma in
2877 object construction.
2879 2006-01-11 Ricci Adams <ricciadams@apple.com>
2881 Reviewed by Geoff, landed by Darin.
2883 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
2884 Number.toFixed doesn't include leading 0
2886 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2887 Fixed a "<" that should have been a "<=".
2889 2006-01-11 Ricci Adams <ricciadams@apple.com>
2891 Reviewed by Geoff, landed by Darin.
2893 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
2894 Number.toFixed doesn't round 0.5 up
2896 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2897 Fixed a ">" that should have been a ">=".
2899 2006-01-11 Justin Haygood <justin@xiondigital.net>
2901 Reviewed and landed by Darin.
2903 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6486
2904 JavaScriptCore should use system malloc on Windows
2906 * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
2908 2006-01-10 Darin Adler <darin@apple.com>
2910 * Makefile: Took out unneeded "export" line.
2911 * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
2912 MIME types, other small corrections).
2914 2006-01-09 Darin Adler <darin@apple.com>
2916 * Makefile.am: Removed.
2918 2006-01-07 Anders Carlsson <andersca@mac.com>
2922 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
2923 REGRESSION: JavaScript hang when comparing large array to null
2926 (KJS::JSObject::isEqualToNull):
2927 Add new function which returns true if an object should be treated as null when
2930 * kjs/operations.cpp:
2934 2006-01-07 Alexey Proskuryakov <ap@nypop.com>
2938 - Fix WebCore development build
2939 http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
2941 * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
2943 2006-01-06 Maciej Stachowiak <mjs@apple.com>
2947 - miscellaneous changes for 4% speedup on the JavaScript iBench
2948 http://bugzilla.opendarwin.org/show_bug.cgi?id=6396
2950 Changes mostly thanks to Maks Orlovich, tweaked a little by me.
2952 * kjs/create_hash_table: Use the same hash as the one used by Identifier.
2954 (KJS::FunctionImp::processParameters): Use the new List::copyFrom
2955 (KJS::ActivationImp::ActivationImp): track variable while iterating
2957 (KJS::StringImp::toObject): create StringInstance directly
2959 (KJS::List::copy): implement in terms of copyFrom
2960 (KJS::List::copyFrom): more efficient way to copy in another list
2963 (keysMatch): updated to work with identifier hash
2965 (Lookup::findEntry): ditto
2966 (Lookup::find): ditto
2969 2006-01-06 Maciej Stachowiak <mjs@apple.com>
2971 - fix development build failure from the previous checkin
2974 (KJS::ActivationImp::put): Use prototype() accessor in assert.
2976 2006-01-05 Maciej Stachowiak <mjs@apple.com>
2980 - fix remaining performance regression from Getter/Setter change
2981 http://bugzilla.opendarwin.org/show_bug.cgi?id=6249
2983 - Activation objects should not have __proto__ property
2984 http://bugzilla.opendarwin.org/show_bug.cgi?id=6395
2987 (KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
2988 skipping getter/setter handling and __proto__ handling, as well
2989 as inlining needed superclass stuff.
2990 (KJS::ActivationImp::put): Implement directly, skipping getter/setter,
2991 __proto__, and do canPut directly in PropertyMap::put since there's no
2992 static property table either.
2994 * kjs/property_map.cpp:
2995 (KJS::PropertyMap::put): Allow optionally inlining canPut check.
2996 * kjs/property_map.h:
2998 2006-01-04 Geoffrey Garen <ggaren@apple.com>
3000 Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
3002 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4921
3003 \u escape sequences in JavaScript identifiers
3005 * kjs/function_object.cpp:
3006 (FunctionObjectImp::construct):
3010 (Lexer::isWhiteSpace):
3011 (Lexer::isLineTerminator):
3012 (Lexer::isIdentStart):
3013 (Lexer::isIdentPart):
3015 (Lexer::scanRegExp):
3019 * tests/mozilla/expected.html: Updated test results.
3021 2005-12-30 Maciej Stachowiak <mjs@apple.com>
3023 No review, just test result update.
3025 * tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
3027 2005-12-30 Anders Carlsson <andersca@mac.com>
3031 - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6298
3032 Getter setter test is failing
3035 (KJS::JSObject::put):
3036 Rework the getter setter part. We now walk the prototype chain, checking for
3037 getter/setter properties and only take the slow path if any are found.
3039 2005-12-30 Maks Orlovich <maksim@kde.org>
3041 Reviewed and committed by Maciej.
3043 - Handle negative, FP numbers with non-10 radix in toString
3044 http://bugzilla.opendarwin.org/show_bug.cgi?id=6259
3046 (Merged from KJS, original work by Harri Porten)
3048 * kjs/number_object.cpp:
3049 (NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with
3050 negative numbers, floating point and very large numbers.
3052 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3054 Patch by Maks Orlovich, reviewed and landed by me.
3056 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6267
3057 Fix Number.prototype.toFixed/toExponential(undefined)
3059 * kjs/number_object.cpp:
3060 (NumberProtoFunc::callAsFunction):
3062 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3064 Patch by Maks Orlovich, Reviewed and landed by me.
3066 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6266
3067 Minor object naming updates (to match Mozilla, KJS)
3069 * kjs/number_object.cpp:
3070 * kjs/regexp_object.cpp:
3072 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3074 Patch by Maks Orlovich, reviewed by mjs.
3076 This has 2 very minor fixes, covered by KJS testsuite:
3077 1. Enumerates string indices in property list (with the same bug as array
3078 object has in corresponding code). This is a mozilla emulation thing.
3079 2. Permits properties with integer names in prototypes to be found
3081 * kjs/string_object.cpp:
3082 (StringInstance::getOwnPropertySlot):
3083 (StringInstanceImp::propList):
3084 * kjs/string_object.h:
3086 2005-12-26 Geoffrey Garen <ggaren@apple.com>
3090 - Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in
3091 KJS::BlockNode::deref
3093 http://bugzilla.opendarwin.org/show_bug.cgi?id=6233
3094 Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in
3097 This patch does four things:
3098 (1) Standardizes all our linked list nodes to use "next" as their next
3100 (2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
3101 to iteratively deref "next" pointers.
3102 (3) Standardizes our linked list nodes to use ListRefPtr<T> and
3103 implement the releaseNext() function used by ~ListRefPtr<T>().
3104 (4) Adds to RefPtr<T> the release() method used by releaseNext().
3106 - Modified existing mozilla test to ensure it would make deployment
3107 builds crash as well.
3109 * JavaScriptCore.xcodeproj/project.pbxproj:
3111 (ElementNode::evaluate):
3112 (PropertyListNode::evaluate):
3113 (ArgumentListNode::evaluateList):
3114 (StatListNode::StatListNode):
3115 (StatListNode::execute):
3116 (StatListNode::processVarDecls):
3117 (VarDeclListNode::evaluate):
3118 (VarDeclListNode::processVarDecls):
3119 (VarStatementNode::execute):
3120 (VarStatementNode::processVarDecls):
3121 (BlockNode::BlockNode):
3122 (CaseClauseNode::evalStatements):
3123 (CaseClauseNode::processVarDecls):
3124 (ClauseListNode::processVarDecls):
3125 (CaseBlockNode::CaseBlockNode):
3126 (CaseBlockNode::evalBlock):
3127 (SourceElementsNode::SourceElementsNode):
3128 (SourceElementsNode::execute):
3129 (SourceElementsNode::processFuncDecl):
3130 (SourceElementsNode::processVarDecls):
3132 (KJS::ElementNode::ElementNode):
3133 (KJS::ElementNode::releaseNext):
3134 (KJS::ArrayNode::ArrayNode):
3135 (KJS::PropertyListNode::PropertyListNode):
3136 (KJS::PropertyListNode::releaseNext):
3137 (KJS::ObjectLiteralNode::ObjectLiteralNode):
3138 (KJS::ArgumentListNode::ArgumentListNode):
3139 (KJS::ArgumentListNode::releaseNext):
3140 (KJS::ArgumentsNode::ArgumentsNode):
3141 (KJS::StatListNode::releaseNext):
3142 (KJS::VarDeclListNode::VarDeclListNode):
3143 (KJS::VarDeclListNode::releaseNext):
3144 (KJS::VarStatementNode::VarStatementNode):
3145 (KJS::ForNode::ForNode):
3146 (KJS::CaseClauseNode::CaseClauseNode):
3147 (KJS::ClauseListNode::ClauseListNode):
3148 (KJS::ClauseListNode::getClause):
3149 (KJS::ClauseListNode::getNext):
3150 (KJS::ClauseListNode::releaseNext):
3151 (KJS::ParameterNode::ParameterNode):
3152 (KJS::ParameterNode::releaseNext):
3153 (KJS::SourceElementsNode::releaseNext):
3154 * kjs/nodes2string.cpp:
3155 (ElementNode::streamTo):
3156 (PropertyListNode::streamTo):
3157 (ArgumentListNode::streamTo):
3158 (StatListNode::streamTo):
3159 (VarDeclListNode::streamTo):
3160 (VarStatementNode::streamTo):
3161 (CaseClauseNode::streamTo):
3162 (ClauseListNode::streamTo):
3163 (CaseBlockNode::streamTo):
3164 (SourceElementsNode::streamTo):
3165 * kxmlcore/ListRefPtr.h: Added.
3166 (KXMLCore::ListRefPtr::ListRefPtr):
3167 (KXMLCore::ListRefPtr::~ListRefPtr):
3168 (KXMLCore::ListRefPtr::operator=):
3169 * kxmlcore/RefPtr.h:
3170 (KXMLCore::RefPtr::release):
3172 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3176 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4026
3177 Math.random() not seeded.
3179 Added call to sranddev() -- it executes the first time a process
3180 calls Math.random().
3182 * kjs/math_object.cpp:
3183 (MathFuncImp::callAsFunction):
3185 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3189 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6265
3190 Name change regression: Java doesn't know what JavaJSObject is
3192 Changed strings passed to Java back to original "JSObject".
3194 * bindings/jni/jni_jsobject.cpp:
3195 (JavaJSObject::convertValueToJObject):
3196 (JavaJSObject::convertJObjectToValue):
3198 2005-12-28 Anders Carlsson <andersca@mac.com>
3202 - The JSC part of http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
3203 Add undetectable document.all
3205 * kjs/operations.cpp:
3207 When comparing an object with null or undefined, call toPrimitive with
3208 NullType as the preferred type.
3210 2005-12-27 Anders Carlsson <andersca@mac.com>
3214 * kjs/array_object.cpp:
3215 (ArrayProtoFunc::callAsFunction):
3216 Implement filter and map. Also, make the existing
3217 array iteration functions not invoke the callback for
3218 non-existing properties, just as Mozilla does now.
3220 * kjs/array_object.h:
3221 (KJS::ArrayProtoFunc::):
3224 * tests/mozilla/expected.html:
3225 Update, two 1.6 tests now pass.
3227 2005-12-27 Maciej Stachowiak <mjs@apple.com>
3229 - updated test results for new JS 1.6 tests
3231 * tests/mozilla/expected.html:
3233 2005-12-27 Anders Carlsson <andersca@mac.com>
3237 Add Mozilla JS 1.6 tests.
3239 * tests/mozilla/js1_6/Array/browser.js: Added.
3240 * tests/mozilla/js1_6/Array/regress-290592.js: Added.
3241 * tests/mozilla/js1_6/Array/regress-304828.js: Added.
3242 * tests/mozilla/js1_6/Array/regress-305002.js: Added.
3243 * tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
3244 * tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
3245 * tests/mozilla/js1_6/Array/regress-320887.js: Added.
3246 * tests/mozilla/js1_6/Array/shell.js: Added.
3247 * tests/mozilla/js1_6/README: Added.
3248 * tests/mozilla/js1_6/Regress/browser.js: Added.
3249 * tests/mozilla/js1_6/Regress/regress-301574.js: Added.
3250 * tests/mozilla/js1_6/Regress/regress-309242.js: Added.
3251 * tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
3252 * tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
3253 * tests/mozilla/js1_6/Regress/regress-314887.js: Added.
3254 * tests/mozilla/js1_6/Regress/regress-320172.js: Added.
3255 * tests/mozilla/js1_6/Regress/shell.js: Added.
3256 * tests/mozilla/js1_6/String/browser.js: Added.
3257 * tests/mozilla/js1_6/String/regress-306591.js: Added.
3258 * tests/mozilla/js1_6/String/shell.js: Added.
3259 * tests/mozilla/js1_6/browser.js: Added.
3260 * tests/mozilla/js1_6/shell.js: Added.
3261 * tests/mozilla/js1_6/template.js: Added.
3263 2005-12-27 Maks Orlovich <maksim@kde.org>
3265 Reviewed and landed by Maciej.
3267 - fixed 6234: Can delete array index property incorrectly.
3268 http://bugzilla.opendarwin.org/show_bug.cgi?id=6234
3270 * kjs/array_object.cpp:
3271 (ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
3272 looking for array properties.
3274 2005-12-27 Anders Carlsson <andersca@mac.com>
3279 (KJS::JSObject::defineSetter):
3280 Remove duplicate call to putDirect.
3282 2005-12-26 Maciej Stachowiak <mjs@apple.com>
3284 Reviewed by Darin and Geoff.
3286 Changes by me and Anders.
3288 - mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
3289 http://bugzilla.opendarwin.org/show_bug.cgi?id=6083
3291 - also fixed some warnings reported by -Winline
3293 * JavaScriptCorePrefix.h: Move new and delete definitions higher so there
3294 aren't conflicts with use in standard C++ headers
3296 (KJS::throwSetterError): Moved this piece of put into a seprate function
3297 to avoid the PIC branch.
3298 (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
3299 when not needed. Also use GetterSetter properties attribute.
3300 (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
3301 properties any more, if this one was one.
3302 (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
3303 properties now (and use the new attribute).
3304 (KJS::JSObject::defineSetter): Ditto.
3305 (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
3306 to avoid global variable access in the hot code path.
3308 (KJS::): Added GetterSetter attribute.
3309 (KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
3310 (KJS::JSValue::isObject): ditto
3311 (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
3312 as much as possible in the case where they are not being used
3313 * kjs/property_map.cpp:
3314 (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
3315 * kjs/property_map.h:
3316 (KJS::PropertyMap::hasGetterSetterProperties): Ditto
3317 (KJS::PropertyMap::setHasGetterSetterProperties): Ditto
3318 (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
3319 global "has getter/setter properties" flag in the property map
3320 single entry, to avoid making objects any bigger.
3321 * kjs/value.h: Moved some things to object.h to make -Winline happier
3323 2005-12-24 Maciej Stachowiak <mjs@apple.com>
3325 Reviewed by Eric and Dave Hyatt.
3327 - make even const PassRefPtrs give transfer of ownership semantics
3328 http://bugzilla.opendarwin.org/show_bug.cgi?id=6238
3330 This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
3331 in assignment and copy construction. And this makes life way easier and removes
3332 the need for pass(). It is not really correct, but we pretty much never need a real
3333 const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
3335 * kjs/identifier.cpp:
3336 (KJS::Identifier::add): No more need for pass()
3337 * kjs/property_map.cpp:
3338 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
3340 (KJS::UString::Rep::create): Use adoptRef
3341 (KJS::UString::UString): No more need for pass
3342 (KJS::UString::append): No more need for pass
3343 (KJS::UString::substr): No more need for pass
3344 * kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
3345 (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
3346 (KXMLCore::PassRefPtr::release): Made this a const method (ugh)
3347 (KXMLCore::PassRefPtr::operator=): clean up appropriately
3348 (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
3349 it makes the behavior more clear and it is less verbose.
3350 (KXMLCore::static_pointer_cast): use adoptRef
3351 (KXMLCore::const_pointer_cast): use adoptRef
3352 * kxmlcore/RefPtr.h:
3353 (KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
3354 (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
3356 2005-12-25 Eric Seidel <eseidel@apple.com>
3360 Unbreak HashTableConstIterator++ by returning const_iterator
3362 * kxmlcore/HashTable.h:
3363 (KXMLCore::HashTableConstIterator::operator++): use const_iterator
3365 2005-12-25 Eric Seidel <eseidel@apple.com>
3369 Un-break HashTable copy constructor.
3371 * kxmlcore/HashTable.h:
3372 (KXMLCore::::HashTable): use const_iterator instead
3374 2005-12-23 Maciej Stachowiak <mjs@apple.com>
3378 - fixed "HashMap does not work with const pointer keys or values"
3379 http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
3381 * kxmlcore/HashMapPtrSpec.h:
3382 (KXMLCore::HashMap): In all methods, explicitly cast all pointers
3383 to void * before passing to internal implementation. Use C-style
3384 casts instead of new-style casts, because the real solution would
3385 require a combo of reinterpret_cast anc const_cast.
3388 2005-12-23 Maciej Stachowiak <mjs@apple.com>
3390 - this time for sure
3392 * kxmlcore/RefPtr.h:
3395 2005-12-22 Maciej Stachowiak <mjs@apple.com>
3397 - fix build problem from last commit.
3399 * kxmlcore/RefPtr.h:
3402 2005-12-21 Maciej Stachowiak <mjs@apple.com>
3406 - Make HashMap/HashSet support non-POD types
3407 http://bugzilla.opendarwin.org/show_bug.cgi?id=5332
3409 The changes for support are relatively simple, but I also made extensive changes to
3410 avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
3412 * kxmlcore/HashTable.h:
3413 (KXMLCore::swap): specialize swap for pairs, to swap elements individually,
3414 so that excess copies can be avoided.
3415 (KXMLCore::Mover::move): Template function to either copy or swap, used
3416 when transferring elements from old table to new.
3417 (KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
3418 that took two or three function parameters now take a class parameter, this is
3419 the class used to do a normal lookup.
3420 (KXMLCore::IdentityHashTranslator::equal): Ditto.
3421 (KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
3422 to write into instead of returning a value to avoid redundant copies.
3423 (KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
3424 (KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
3425 functions. Added a FIXME about a remaining rare excess copy.
3426 (KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
3427 the key from Traits, to avoid creating and destroying pair, which copies.
3428 (KXMLCore::HashTable::isDeletedBucket): ditto
3429 (KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
3430 (KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
3431 work right for non-POD types.
3432 (KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
3433 (KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
3434 (KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
3435 (KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
3436 (KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
3437 (KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
3438 (KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
3440 * kxmlcore/HashFunctions.h:
3441 (KXMLCore::PointerHash): Specialize PointerHash for RefPtr
3442 * kxmlcore/HashMap.h:
3443 (KXMLCore::extractFirst): Return a reference not a full object to avoid
3445 (KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
3446 to defer making the pair as long as possible, thus avoiding needless copies.
3447 (KXMLCore::HashMapTranslator::equal): ditto
3448 (KXMLCore::HashMapTranslator::translate): ditto
3449 (KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
3450 (KXMLCore::::set): Use inlineAdd
3451 (KXMLCore::::add): Use inlineAdd
3452 * kxmlcore/HashMapPtrSpec.h:
3453 (KXMLCore::): Pass KeyTraits along
3454 * kxmlcore/HashSet.h:
3455 (KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
3456 (KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
3457 the new HashTranslator approach.
3458 (KXMLCore::HashSetTranslatorAdapter::equal): ditto
3459 (KXMLCore::HashSetTranslatorAdapter::translate): ditto
3460 (KXMLCore::::insert): ditto
3461 * kxmlcore/HashTraits.h:
3462 (KXMLCore::GenericHashTraits): This is intended be used as a base class for
3463 customized traits: sensible defaults.
3464 (KXMLCore::): Use it a bunch
3465 (KXMLCore::assignDeleted): template function to allow pairs to be assigned the
3466 deleted value w/o excess copies.
3467 (KXMLCore::PairHashTraits::emptyValue): Updated
3468 (KXMLCore::PairHashTraits::deletedValue): Updated
3469 (KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
3470 (KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
3471 to either use use deletedValue or assignDeletedValue for the cases where we care.
3472 * kxmlcore/RefPtr.h:
3473 (KXMLCore::RefPtr::swap): Added swap method.
3474 (KXMLCore::swap): Added swap free function.
3475 * kjs/identifier.cpp:
3476 (KJS::CStringTranslator::hash): Use new HashTranslator class approach to
3477 alternate type based insertion.
3478 (KJS::CStringTranslator::equal): ditto
3479 (KJS::CStringTranslator::translate): ditto
3480 (KJS::Identifier::add): ditto
3481 (KJS::UCharBufferTranslator::hash): ditto
3482 (KJS::UCharBufferTranslator::equal): ditto
3483 (KJS::UCharBufferTranslator::translate): ditto
3485 - irrelevant change:
3487 * kjs/array_object.cpp:
3488 (ArrayProtoFunc::callAsFunction): Removed a stray space.
3490 2005-12-22 Anders Carlsson <andersca@mac.com>
3492 Reviewed by Eric and Darin.
3494 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
3495 Would like to be able to define prototypes in headers
3498 Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
3499 Also, namespace all macros by prefixing them with KJS_.
3501 2005-12-22 Darin Adler <darin@apple.com>
3505 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6191
3506 RefPtr/PassRefPtr have a leak issue, operator== issues
3508 * kxmlcore/PassRefPtr.h: