1 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
5 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
6 toLowerCase and toUpperCase don't honor special mappings
8 Test: fast/js/string-capitalization.html
10 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
11 * icu/unicode/putil.h: Added (copied from WebCore).
12 * icu/unicode/uiter.h: Ditto.
13 * icu/unicode/ustring.h: Ditto.
14 * kjs/string_object.cpp:
15 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
16 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
17 * kjs/ustring.h: Ditto.
19 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
20 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
22 * kxmlcore/unicode/icu/UnicodeIcu.h:
23 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
24 (KXMLCore::Unicode::toUpper): Ditto.
25 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
26 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
27 (KXMLCore::Unicode::category): Ditto.
28 * kxmlcore/unicode/qt4/UnicodeQt4.h:
29 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
30 (KXMLCore::Unicode::toUpper): Ditto.
31 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
32 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
33 (KXMLCore::Unicode::category): Ditto.
35 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
36 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
38 2006-04-05 Darin Adler <darin@apple.com>
40 - attempt to fix Windows build
42 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
43 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
45 2006-04-05 Darin Adler <darin@apple.com>
47 - attempt to fix Windows build
49 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
51 2006-04-05 Darin Adler <darin@apple.com>
55 - fix memory leak introduced by the previous change
57 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
58 the value in question is a pair where one of the pair needs a ref and the other
61 2006-04-05 Darin Adler <darin@apple.com>
65 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
66 StringImpl hash traits deleted value creates an init routine for WebCore
67 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
69 Change HashMap and HashSet implementation so they fold various types together.
70 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
71 and WebCore::String in terms of the underlying raw pointer type, and hence use
72 -1 for the deleted value.
74 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
75 type to be used when storing a value that has the same layout as the type itself.
76 This is used only for non-key cases. In the case of keys, the hash function must also
77 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
78 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
79 explicit reference counting. If the type itself has needsRef true, but the storage
80 type has needsRef false, then the HashSet or HashMap has to handle the reference
81 counting explicitly. Added hash trait specializations for all signed integer values
82 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
83 integer type of the same size so int and long will share code. Gave all pointers and
84 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
85 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
86 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
87 Useful for types where we don't want to force the existence of deletedValue, such as
88 the type of a pair in a HashMap which is not the actual storage type. Removed an
89 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
90 template, which determines what type can be used to store a given hash key type with
91 a given hash function, and specialized it for pointers and RefPtr so that pointer
92 hash tables share an underlying HashTable that uses IntHash.
94 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
95 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
96 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
97 tables where the type stored is not the same as the real value type.
99 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
100 integer type given a sizeof value. Renamed pointerHash to intHash and made it
101 use overloading and take integer parameters. Added an IntHash struct which is
102 a hash function that works for integers. Changed PtrHash to call IntHash with
103 an appropriately sized integer. Made IntHash the default hash function for
104 many integer types. Made PtrHash the default hash function for RefPtr as well
107 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
108 derived from the new traits. The HashTable will use the storage type and all
109 necessary translation and ref/deref is done at the HashSet level. Also reorganized
110 the file so that the HashSet is at the top and has no inline implementation inside
111 it so it's easy to read the interface to HashSet.
113 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
114 derived from the new traits. The HashTable will use the storage type and all
115 necessary translation and ref/deref is done at the HashMap level. Also reorganized
116 the file so that the HashMap is at the top and has no inline implementation inside
117 it so it's easy to read the interface to HashMap.
119 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
121 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
122 and also remove some unnecessary build settings from the aggregate target that
123 generates derived sources.
124 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
126 2006-04-04 Timothy Hatcher <timothy@apple.com>
130 The Debug and Release frameworks are now built with install paths relative to the build products directory.
131 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
133 * JavaScriptCore.xcodeproj/project.pbxproj:
135 2006-04-04 Eric Seidel <eseidel@apple.com>
140 Disable ASSERT redefinition warnings for now.
142 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
143 * kxmlcore/Assertions.h:
145 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
147 Reviewed by ggaren & darin. Landed by eseidel.
149 Integrate CURL version of gettimeofday
150 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
151 Disable crash report dialogs for testkjs.exe in Release mode
152 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
157 (StopWatch::getElapsedMS):
161 2006-04-04 Eric Seidel <eseidel@apple.com>
165 * kjs/number_object.cpp:
166 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
168 2006-03-12 Maciej Stachowiak <mjs@apple.com>
172 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
173 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
175 * kjs/number_object.cpp:
176 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
177 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
178 plus a bit of refactoring.
180 2006-04-03 Darin Adler <darin@apple.com>
182 - tweak config.h and Platform.h to try to get buildbot working
183 (making some small changes at the same time)
185 * kjs/config.h: Removed now-unneeded HAVE_ICU.
186 * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
187 USE stuff to the end.
189 2006-04-03 George Staikos <staikos@opensource.apple.com>
193 Fix Win32 build breakage from previous commit, remove unused forward.
195 2006-04-03 George Staikos <staikos@opensource.apple.com>
199 Implement a unicode abstraction layer to make JavaScriptCore much more
200 easily ported to other platforms without having to take in libicu. Also
201 makes the unicode related code easier to understand.
203 2006-04-03 Timothy Hatcher <timothy@apple.com>
207 Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
208 Other 64 bit build fixes.
211 (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
213 (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
214 * bindings/jni/jni_utility.cpp:
215 (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
216 (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
217 * bindings/runtime_root.cpp:
218 (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
219 (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
221 2006-03-31 Darin Adler <darin@apple.com>
225 - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
227 * bindings/objc/WebScriptObject.h: Fixed comment.
229 2006-03-31 Eric Seidel <eseidel@apple.com>
233 A bit more code cleanup.
235 * bindings/c/c_utility.cpp:
236 (KJS::Bindings::convertValueToNPVariant):
237 * bindings/objc/objc_runtime.mm:
238 (convertValueToObjcObject):
239 * bindings/objc/objc_utility.mm:
240 (KJS::Bindings::convertValueToObjcValue):
242 (KJS::GlobalFuncImp::callAsFunction):
243 * kjs/interpreter.cpp:
244 (KJS::ExecState::lexicalInterpreter):
246 * kjs/operations.cpp:
249 2006-03-30 Eric Seidel <eseidel@apple.com>
253 Small code-style update.
255 * kjs/operations.cpp:
268 2006-03-31 Anders Carlsson <andersca@mac.com>
272 Make sure the GetterSetterImp objects are marked as well.
275 (KJS::GetterSetterImp::mark):
278 2006-03-30 Eric Seidel <eseidel@apple.com>
282 * kjs/nodes.h: Some various small style fixes.
284 2006-03-30 Eric Seidel <eseidel@apple.com>
288 Clean-up style issues in node.h, remove redundant initializations.
291 (KJS::StatementNode::evaluate):
292 (KJS::ArrayNode::ArrayNode):
293 (KJS::ObjectLiteralNode::ObjectLiteralNode):
294 (KJS::ArgumentsNode::ArgumentsNode):
295 (KJS::NewExprNode::NewExprNode):
296 (KJS::CaseClauseNode::CaseClauseNode):
297 (KJS::FuncDeclNode::FuncDeclNode):
299 2006-03-30 Tim Omernick <timo@apple.com>
303 <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
306 * bindings/runtime.h:
307 (KJS::Bindings::Instance::implementsCall):
308 New method. Returns false by default. Concrete subclasses can override this return true when
309 the bound object may be called as a function.
310 (KJS::Bindings::Instance::invokeDefaultMethod):
311 Since bound objects are no longer treated as functions by default, we can return jsUndefined()
312 here instead of in concrete subclasses that decide not to implement the default method
315 * bindings/runtime_object.cpp:
316 (RuntimeObjectImp::implementsCall):
317 Don't assume that the bound object is a function; instead, let the object instance decide whether
320 * bindings/c/c_instance.h:
321 * bindings/c/c_instance.cpp:
322 (KJS::Bindings::CInstance::implementsCall):
323 The object is callable if its class has an invokeDefault function.
325 * bindings/objc/objc_instance.h:
326 * bindings/objc/objc_instance.mm:
327 (ObjcInstance::implementsCall):
328 The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
330 * bindings/jni/jni_instance.h:
331 * bindings/jni/jni_instance.cpp:
332 Moved bogus invokeDefaultMethod() to superclass.
334 2006-03-29 Geoffrey Garen <ggaren@apple.com>
338 - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
339 Regression: crash in malloc_consolidate if you use a .PAC file
341 The crash was a result of threaded deallocation of thread-unsafe
342 objects. Pure JS objects are thread-safe because all JS execution
343 is synchronized through JSLock. However, JS objects that wrap WebCore
344 objects are thread-unsafe because JS and WebCore execution are not
345 synchronized. That unsafety comes into play when the collector
346 deallocates a JS object that wraps a WebCore object, thus causing the
347 WebCore object to be deallocated.
349 The solution here is to have each JSCell know whether it is safe to
350 collect on a non-main thread, and to avoid collecting unsafe cells
351 when on a non-main thread.
353 We don't have a way to test PAC files yet, so there's no test
354 attached to this patch.
357 (KJS::Collector::collect):
358 (1) Added the test "currentThreadIsMainThread ||
359 imp->m_destructorIsThreadSafe".
362 (KJS::gcProtectNullTolerant):
363 (KJS::gcUnprotectNullTolerant):
365 (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
366 m_destructorIsThreadSafe becomes another whole word, ruining the
367 collector optimizations we've made based on the size of a JSObject.
368 * kxmlcore/FastMalloc.cpp:
369 (KXMLCore::currentThreadIsMainThread):
370 (KXMLCore::fastMallocRegisterThread):
371 * kxmlcore/FastMalloc.h:
373 2006-03-28 Darin Adler <darin@apple.com>
377 - change some code that resulted in init routines on Mac OS X -- if the framework has
378 init routines it will use memory and slow down applications that link with WebKit
379 even in cases where those applications don't use WebKit
381 * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
382 to use immediate numbers instead. Apparently, double constant expressions of the type we
383 had here are evaluated at load time.
385 * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
386 ListImp, so go back to using a plain old pointer.
387 (KJS::List::List): Set overflow to 0 when initializing ListImp.
388 (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
389 (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
390 a swap of OwnArrayPtr.
391 (KJS::List::copyFrom): Remove now-unneeded get().
392 (KJS::List::copyTail): Ditto.
394 * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
395 a static initializer routine. Had to get rid of one level of constant to get the compiler
396 to understand it could initialize without any code.
398 - added a build step that checks for init routines
400 * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
401 was replaced by the generate-derived-sources script a while back. Added a custom build
402 phase that invokes the check-for-global-initializers script.
404 2006-03-28 Timothy Hatcher <timothy@apple.com>
408 fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
410 * bindings/npapi.h: added #defines after the #ifndefs
412 2006-03-27 Maciej Stachowiak <mjs@apple.com>
416 - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
419 (Node::deref): take into account the case where the extra refcount table was never created
421 2006-03-23 David Carson <dacarson@gmail.com>
425 - JSObject in LiveConnect not working.
426 http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
428 * bindings/jni_jsobject.cpp:
429 (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
430 class, and the GetFieldID was using the wrong signature.
432 2006-03-23 Darin Adler <darin@apple.com>
438 * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
439 Also add -Y 3 option for linker.
441 2006-03-23 Darin Adler <darin@apple.com>
445 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
446 REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
448 * kjs/object.h: Take function name, as well as source URL and line number, when
449 using the special overloaded construct for making functions.
450 * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
451 * kjs/function_object.h: Ditto.
452 * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
453 constructing the function rather than null. Use "anonymous" when making a
454 function using the default function constructor.
456 * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
457 a function declaration.
461 * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
463 2006-03-23 Darin Adler <darin@apple.com>
467 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
468 LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
470 * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
471 * bindings/c/c_utility.cpp:
472 (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
473 BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
474 OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
475 one case and remove a _NPN_ReleaseObject in another because this
476 should return a retained value.
477 (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
478 NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
480 * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
481 CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
482 * bindings/c/c_runtime.cpp:
483 (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
485 (KJS::Bindings::CField::name): Added. Returns the string from inside the
487 (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
488 on the result of getProperty after using it to fix a storage leak.
489 (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
490 after pasing a value to setProperty now that the conversion function does a retain.
492 * bindings/c/c_instance.cpp:
493 (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
494 stack buffer. Removed special case for NPVARIANT_IS_VOID because the
495 convertNPVariantToValue function handles that properly.
496 (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
498 * bindings/NP_jsobject.h: Formatting changes only.
499 * bindings/NP_jsobject.cpp:
500 (jsDeallocate): Changed parameter type so we don't need a function cast.
501 (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
502 (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
503 (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
504 (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
506 * bindings/c/c_class.cpp: Formatting changes only.
507 * bindings/c/c_class.h: Formatting changes only.
509 * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
510 NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
511 NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
512 NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
513 NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
514 NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
515 NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
516 NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
517 NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
518 NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
519 * bindings/npruntime.cpp:
520 (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
521 integer dictionary since the default behavior is fine for integers.
523 2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
525 Reviewed and landed by Maciej.
527 - WebKit no longer builds with bison 2.1
528 http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
530 * generate-derived-sources: Handle generated header named either grammar.cpp.h
533 2006-03-22 Maciej Stachowiak <mjs@apple.com>
537 * JavaScriptCore.xcodeproj/project.pbxproj:
539 2006-03-21 Maciej Stachowiak <mjs@apple.com>
541 * kjs/generate-derived-sources: Set executable property.
543 2006-03-21 Maciej Stachowiak <mjs@apple.com>
547 Ensure that generated source dependencies are handled properly, as follows:
549 - Made an external script that generates the sources into a
550 DerivedSources dir in the build products directory.
551 - Added a new build target that builds all the generated sources
552 if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
553 - Added the DerivedSources dir in question to the include path.
554 - Added the new DerivedSources dir and its contents to the project as build-relative.
556 * JavaScriptCore.xcodeproj/project.pbxproj:
557 * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
560 2006-03-11 Maciej Stachowiak <mjs@apple.com>
564 - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
565 http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
568 (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
570 2006-03-16 Maciej Stachowiak <mjs@apple.com>
574 - tweaks to my change to redo KJS::Node refcounting
580 (Node::clearNewNodes):
583 2006-03-16 Darin Adler <darin@apple.com>
587 - fixed Vector so that you can pass a reference to something in the vector
588 to the append or insert functions
591 (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
592 and return the adjusted value of the pointer.
593 (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
594 adding the new element. Makes the case where the element moves when the vector
596 (KXMLCore::Vector::insert): Ditto.
598 2006-03-15 Eric Seidel <eseidel@apple.com>
604 * kjs/date_object.cpp:
605 (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
607 2006-03-15 Eric Seidel <eseidel@apple.com>
611 Fix CString copy constructor, fixes Date.parse("") on Win32.
613 * kjs/date_object.cpp:
614 (KJS::DateProtoFunc::callAsFunction):
616 (KJS::CString::CString):
617 (KJS::CString::operator=):
619 2006-03-13 Maciej Stachowiak <mjs@apple.com>
623 - KJS::Node and KJS::StatementNode are bigger than they need to be
624 http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
626 The memory usage of Node was reduced by 2 machine words per node:
628 - sourceURL was removed and only kept on FunctionBodyNode. The
629 source URL can only be distinct per function or top-level program node,
630 and you always have one.
632 - refcount was removed and kept in a separate hashtable when
633 greater than 1. newNodes set represents floating nodes with
634 refcount of 0. This helps because almost all nodes have a refcount of 1
635 for almost all of their lifetime.
637 * bindings/runtime_method.cpp:
638 (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
640 (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
641 them at the appropriate time.
643 (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
645 (KJS::ContextImp::pushIteration): moved here from LabelStack
646 (KJS::ContextImp::popIteration): ditto
647 (KJS::ContextImp::inIteration): ditto
648 (KJS::ContextImp::pushSwitch): ditto
649 (KJS::ContextImp::popSwitch): ditto
650 (KJS::ContextImp::inSwitch): ditto
652 (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
653 (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
654 (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
655 (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
657 (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
659 * kjs/function.h: Move body field from DeclaredFunctionImp to
661 * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
663 (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
664 and m_switchDepth data members. New FunctionBodyNode* parameter - the
665 function body provides source URL and SourceId.
666 (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
667 (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
670 (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
671 statement label stacks don't need these and it bloats their size. Put them
672 in the ContextImp instead.
673 * kjs/interpreter.cpp:
674 (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
676 (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
677 (KJS::ExecState::context): ditto
678 (KJS::ExecState::setException): Renamed _exception to m_exception
679 (KJS::ExecState::clearException): ditto
680 (KJS::ExecState::exception): ditto
681 (KJS::ExecState::hadException): ditto
682 (KJS::ExecState::ExecState): ditto both above renames
684 (Node::Node): Removed initialization of line, source URL and refcount. Add to
685 local newNodes set instead of involving parser.
686 (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
687 HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
690 (Node::refcount): ditto
691 (Node::clearNewNodes): Destroy anything left in the new nodes set.
692 (currentSourceId): Inline helper to get sourceId from function body via context.
693 (currentSourceURL): ditto for sourceURL.
694 (Node::createErrorCompletion): use new helper
695 (Node::throwError): ditto
696 (Node::setExceptionDetailsIfNeeded): ditto
697 (StatementNode::StatementNode): remove initialization of l0 and sid, rename
699 (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
700 (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
701 (StatListNode::StatListNode): updated for setLoc changes
702 (BlockNode::BlockNode): ditto
703 (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
704 (WhileNode::execute): ditto
705 (ForNode::execute): ditto
706 (ForInNode::execute): ditto
707 (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
708 (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
709 (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
710 (FunctionBodyNode::FunctionBodyNode): update for new setLoc
711 (FunctionBodyNode::processFuncDecl): reindent
712 (SourceElementsNode::SourceElementsNode): update for new setLoc
714 (KJS::Node::lineNo): Renamed _line to m_line
715 (KJS::StatementNode::firstLine): Use lineNo()
716 (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
717 (KJS::FunctionBodyNode::sourceId): added
718 (KJS::FunctionBodyNode::sourceURL): added
721 2006-03-14 Geoffrey Garen <ggaren@apple.com>
723 - Fixed <rdar://problem/4478239> string sort puts "closed" before
729 (KJS::compare): Inverted a < in order to treat the longer string as >
732 2006-03-12 Alexey Proskuryakov <ap@nypop.com>
736 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
737 REGRESSION: Flash callback to JavaScript function not working.
739 Test: plugins/invoke.html
741 * bindings/c/c_utility.cpp:
742 (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
744 2006-03-08 Eric Seidel <eseidel@apple.com>
748 Partially fix JS on win32 by fixing hash table generation.
750 * kjs/create_hash_table: limit << results to 32 bits.
752 (TestFunctionImp::callAsFunction):
754 2006-03-07 Darin Adler <darin@apple.com>
756 * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
758 2006-03-07 Darin Adler <darin@apple.com>
762 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
763 unwanted output while running layout tests
765 * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
766 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
767 to standard output. I think we should arrange for the error text to be in JavaScript
768 exceptions instead at some point.
769 * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
770 too-large size rather than allocating a buffer smaller than requested.
772 2006-03-06 David Carson <dacarson@gmail.com>
774 Reviewed by Darin, landed by ap.
776 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
777 c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
779 Tested with test case from:
780 http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
782 * bindings/c_utility.cpp
783 (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
784 * icu/unicode/ucnv.h: Copied from WebCore.
785 * icu/unicode/ucnv_err.h: Ditto.
786 * icu/unicode/uenum.h: Ditto.
788 2006-03-05 Darin Adler <darin@apple.com>
790 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
792 2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
794 Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
796 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
797 REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
799 * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
801 2006-03-05 Darin Adler <darin@apple.com>
805 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
806 get all references to KJS::Node out of internal.h
808 * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
810 * kjs/Parser.cpp: Added.
811 * kjs/Parser.h: Added.
813 * kjs/internal.cpp: Removed the Parser class.
814 * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
815 not used in this header.
817 * kjs/nodes.h: Added an include of "Parser.h".
818 * kjs/function.h: Added a declaration of FunctionBodyNode.
820 2006-03-05 Geoffrey Garen <ggaren@apple.com>
824 - JSC support for the fix for <rdar://problem/4467143> JavaScript
825 enumeration of HTML element properties skips DOM node properties
828 (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
829 class definiton macro needs to know about the prototype's prototype so
830 that the class constructor properly sets it.
831 (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
832 implementation macro does not need to know about the prototype's
833 prototype, since getOwnPropertySlot should only look in the current
834 object's property map, and not its prototype's.
836 2006-03-05 Andrew Wellington <proton@wiretapped.net>
838 Reviewed by Eric, landed by ap.
840 - Remove unused breakpoint bool from StatementNodes. No test provided as
841 there is no functionality change.
844 (StatementNode::StatementNode):
847 2006-03-03 Geoffrey Garen <ggaren@apple.com>
851 - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at
852 http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
854 This regression was caused by my fix for 4448098. I failed to account for the
855 deleted entry sentinel in the mehtod that saves the contents of a property map to
856 the back/forward cache.
858 Manual test in WebCore/manual-tests/property-map-save-crash.html
860 * kjs/property_map.cpp:
861 (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
862 (KJS::isValid): New function: checks if a key is null or the deleted sentinel
863 (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
864 and a slight performance win
865 (KJS::PropertyMap::clear):
866 (KJS::PropertyMap::rehash):
867 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
868 (KJS::PropertyMap::save): Check keys with isValid()
870 2006-03-02 Maciej Stachowiak <mjs@apple.com>
872 - now fix mac build again
874 * kjs/identifier.cpp:
876 2006-03-02 Maciej Stachowiak <mjs@apple.com>
878 Rubber stamped by Anders and Eric.
880 - add fpconst.cpp to win32 build, it is now needed
882 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
885 2006-03-02 Maciej Stachowiak <mjs@apple.com>
889 - fix windows build, broken by my last patch
891 * kjs/JSImmediate.cpp:
892 * kjs/identifier.cpp:
893 * kxmlcore/FastMalloc.cpp:
894 * kxmlcore/Platform.h:
896 2006-03-01 Maciej Stachowiak <mjs@apple.com>
900 - Set up new prototype macros and avoid using #if without defined() in JSC
902 Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
903 are defined, and to separate core OS-level dependencies from operating environment
904 dependencies so you can, e.g., build KDE on Mac or Windows.
906 * kxmlcore/Platform.h: Added.
908 - deploy them everywhere in JavaScriptCore
910 * JavaScriptCore.xcodeproj/project.pbxproj:
911 * bindings/jni/jni_utility.cpp:
912 (KJS::Bindings::convertValueToJValue):
913 * bindings/objc/WebScriptObject.mm:
914 * bindings/objc/objc_instance.mm:
916 * bindings/softlinking.h:
917 * bindings/testbindings.mm:
921 (KJS::Collector::markCurrentThreadConservatively):
922 (KJS::Collector::markOtherThreadConservatively):
923 (KJS::Collector::markStackObjectsConservatively):
925 * kjs/date_object.cpp:
928 (KJS::DateProtoFunc::callAsFunction):
929 (KJS::DateObjectImp::construct):
936 * kjs/identifier.cpp:
938 * kjs/interpreter.cpp:
939 (KJS::Interpreter::evaluate):
940 (KJS::Interpreter::createLanguageInstanceForValue):
944 * kjs/math_object.cpp:
947 * kjs/operations.cpp:
954 (KJS::RegExp::RegExp):
955 (KJS::RegExp::~RegExp):
956 (KJS::RegExp::match):
961 (StopWatch::getElapsedMS):
964 * kxmlcore/AlwaysInline.h:
965 * kxmlcore/Assertions.cpp:
966 * kxmlcore/Assertions.h:
967 * kxmlcore/FastMalloc.cpp:
969 * kxmlcore/FastMalloc.h:
970 * kxmlcore/FastMallocInternal.h:
971 * kxmlcore/HashTable.h:
972 * kxmlcore/TCPageMap.h:
973 * kxmlcore/TCSpinLock.h:
974 (TCMalloc_SpinLock::Lock):
975 (TCMalloc_SpinLock::Unlock):
977 * kxmlcore/TCSystemAlloc.cpp:
978 (TCMalloc_SystemAlloc):
981 2006-02-28 Geoffrey Garen <ggaren@apple.com>
985 - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry
986 placeholder to -1 from UString::Rep::null
988 This turned out to be only a small speedup (.12%). That's within the
989 margin of error for super accurate JS iBench, but Shark confirms the
990 same, so I think it's worth landing.
992 FYI, I also confirmed that the single entry optimization in
993 PropertyMap is a 3.2% speedup.
995 * kjs/property_map.cpp:
996 (KJS::PropertyMap::~PropertyMap):
997 (KJS::PropertyMap::clear):
998 (KJS::PropertyMap::put):
999 (KJS::PropertyMap::insert):
1000 (KJS::PropertyMap::rehash):
1001 (KJS::PropertyMap::remove):
1002 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1003 (KJS::PropertyMap::checkConsistency):
1004 * kjs/property_map.h:
1005 (KJS::PropertyMap::deletedSentinel):
1007 2006-02-27 Eric Seidel <eseidel@apple.com>
1009 Rubber-stamped by darin.
1011 Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
1013 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1015 2006-02-27 Eric Seidel <eseidel@apple.com>
1019 Fix Assertions.cpp to compile on win32.
1021 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1022 * kxmlcore/Assertions.cpp:
1024 2006-02-27 Eric Seidel <eseidel@apple.com>
1028 Made Assertions.cpp platform independent.
1029 Moved mac-specific logging logic up into WebCore.
1030 http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
1032 * JavaScriptCore.xcodeproj/project.pbxproj:
1033 * kxmlcore/Assertions.cpp: Added.
1034 * kxmlcore/Assertions.h:
1035 * kxmlcore/Assertions.mm: Removed.
1037 2006-02-27 Darin Adler <darin@apple.com>
1039 - fixed Mac Debug build, there was an unused parameter
1041 * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
1042 Remove parameter name.
1044 * kjs/debugger.h: Fixed comment.
1046 2006-02-27 Eric Seidel <eseidel@apple.com>
1050 * kxmlcore/Vector.h:
1051 (KXMLCore::deleteAllValues): fix unused variable warning
1053 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1057 - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
1058 http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
1060 * JavaScriptCore.xcodeproj/project.pbxproj:
1061 * bindings/NP_jsobject.cpp:
1063 (_NPN_InvokeDefault):
1067 (_NPN_RemoveProperty):
1070 * bindings/c/c_class.h:
1071 (KJS::Bindings::CClass::constructorAt):
1072 * bindings/c/c_utility.cpp:
1073 (KJS::Bindings::convertNPVariantToValue):
1074 * bindings/jni/jni_class.cpp:
1075 (JavaClass::methodsNamed):
1076 (JavaClass::fieldNamed):
1077 * bindings/jni/jni_instance.cpp:
1078 (JavaInstance::invokeDefaultMethod):
1079 * bindings/jni/jni_jsobject.cpp:
1080 * bindings/jni/jni_objc.mm:
1081 (-[NSObject KJS::Bindings::]):
1082 * bindings/objc/WebScriptObject.mm:
1083 (+[WebUndefined allocWithZone:]):
1084 (-[WebUndefined initWithCoder:]):
1085 (-[WebUndefined encodeWithCoder:]):
1086 (-[WebUndefined copyWithZone:]):
1087 * bindings/objc/objc_class.h:
1088 (KJS::Bindings::ObjcClass::constructorAt):
1089 * bindings/objc/objc_class.mm:
1090 (KJS::Bindings::ObjcClass::methodsNamed):
1091 (KJS::Bindings::ObjcClass::fallbackObject):
1092 * bindings/objc/objc_instance.mm:
1093 (ObjcInstance::getValueOfUndefinedField):
1094 * bindings/objc/objc_runtime.mm:
1095 (ObjcFallbackObjectImp::getOwnPropertySlot):
1096 (ObjcFallbackObjectImp::put):
1097 (ObjcFallbackObjectImp::canPut):
1098 (ObjcFallbackObjectImp::deleteProperty):
1099 (ObjcFallbackObjectImp::toBoolean):
1100 * bindings/runtime.cpp:
1101 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1102 * bindings/runtime.h:
1103 (KJS::Bindings::Instance::getValueOfUndefinedField):
1104 (KJS::Bindings::Instance::setValueOfUndefinedField):
1105 * bindings/runtime_array.cpp:
1106 (RuntimeArray::lengthGetter):
1107 (RuntimeArray::indexGetter):
1108 (RuntimeArray::put):
1109 (RuntimeArray::deleteProperty):
1110 * bindings/runtime_method.cpp:
1111 (RuntimeMethod::lengthGetter):
1112 (RuntimeMethod::execute):
1113 * bindings/runtime_object.cpp:
1114 (RuntimeObjectImp::fallbackObjectGetter):
1115 (RuntimeObjectImp::fieldGetter):
1116 (RuntimeObjectImp::methodGetter):
1117 (RuntimeObjectImp::put):
1118 (RuntimeObjectImp::canPut):
1119 (RuntimeObjectImp::deleteProperty):
1120 (RuntimeObjectImp::defaultValue):
1121 (RuntimeObjectImp::callAsFunction):
1122 * bindings/runtime_root.cpp:
1123 (performJavaScriptAccess):
1124 * kjs/array_object.cpp:
1125 (ArrayInstance::lengthGetter):
1126 (ArrayInstance::getOwnPropertySlot):
1127 (ArrayPrototype::ArrayPrototype):
1128 (ArrayPrototype::getOwnPropertySlot):
1129 * kjs/bool_object.cpp:
1130 (BooleanObjectImp::BooleanObjectImp):
1131 * kjs/date_object.cpp:
1132 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1133 (KJS::DateObjectFuncImp::callAsFunction):
1134 * kjs/error_object.cpp:
1135 (ErrorObjectImp::ErrorObjectImp):
1136 (NativeErrorPrototype::NativeErrorPrototype):
1137 (NativeErrorImp::NativeErrorImp):
1139 (KJS::FunctionImp::argumentsGetter):
1140 (KJS::FunctionImp::lengthGetter):
1141 (KJS::Arguments::mappedIndexGetter):
1142 (KJS::ActivationImp::argumentsGetter):
1143 (KJS::ActivationImp::put):
1144 * kjs/function_object.cpp:
1145 (FunctionObjectImp::FunctionObjectImp):
1147 (KJS::GetterSetterImp::toPrimitive):
1148 (KJS::GetterSetterImp::toBoolean):
1149 * kjs/interpreter.cpp:
1150 (KJS::Interpreter::evaluate):
1151 * kjs/interpreter.h:
1152 (KJS::Interpreter::isGlobalObject):
1153 (KJS::Interpreter::interpreterForGlobalObject):
1154 (KJS::Interpreter::isSafeScript):
1156 (Lexer::makeIdentifier):
1157 (Lexer::makeUString):
1159 (KJS::staticFunctionGetter):
1160 (KJS::staticValueGetter):
1162 (StatementNode::processFuncDecl):
1163 (PropertyNode::evaluate):
1164 (PropertyNameNode::evaluate):
1165 * kjs/number_object.cpp:
1166 (NumberObjectImp::NumberObjectImp):
1167 (NumberObjectImp::getOwnPropertySlot):
1169 (KJS::JSObject::defineGetter):
1170 (KJS::JSObject::defineSetter):
1171 (KJS::JSObject::hasInstance):
1172 (KJS::JSObject::propertyIsEnumerable):
1173 * kjs/object_object.cpp:
1174 (ObjectObjectImp::ObjectObjectImp):
1175 * kjs/property_slot.cpp:
1176 (KJS::PropertySlot::undefinedGetter):
1177 (KJS::PropertySlot::functionGetter):
1178 * kjs/reference.cpp:
1179 (KJS::Reference::getPropertyName):
1180 * kjs/reference_list.cpp:
1181 (ReferenceListIterator::operator++):
1182 * kjs/regexp_object.cpp:
1183 (RegExpObjectImp::RegExpObjectImp):
1184 (RegExpObjectImp::getValueProperty):
1185 (RegExpObjectImp::putValueProperty):
1186 * kjs/string_object.cpp:
1187 (StringInstance::lengthGetter):
1188 (StringInstance::indexGetter):
1189 (StringPrototype::StringPrototype):
1190 * kxmlcore/Assertions.mm:
1191 * kxmlcore/FastMalloc.cpp:
1192 (KXMLCore::TCMalloc_PageHeap::CheckList):
1193 * kxmlcore/HashTable.h:
1194 (KXMLCore::HashTableConstIterator::checkValidity):
1195 (KXMLCore::IdentityHashTranslator::translate):
1197 (pcre_get_stringnumber):
1199 2006-02-23 Darin Adler <darin@apple.com>
1201 - try to fix buildbot failure
1203 * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
1204 recompiled after additional inlining was introduced (Xcode bug?).
1206 2006-02-23 Geoffrey Garen <ggaren@apple.com>
1208 Reviewed by Darin, Maciej.
1210 - Inline some functions suggested by Shark. 2.9% speedup on super
1213 http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
1214 <rdar://problem/4448116>
1217 (KJS::ArgumentsNode::evaluateList):
1220 (KJS::ScopeChain::release):
1221 (KJS::JSObject::toPrimitive):
1222 * kjs/scope_chain.cpp:
1225 (KJS::UString::toArrayIndex):
1228 (KJS::JSValue::toObject):
1229 * kxmlcore/FastMalloc.cpp:
1230 (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
1231 (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
1233 2006-02-21 Eric Seidel <eseidel@apple.com>
1235 Added *.user to ignore list.
1237 2006-02-21 Eric Seidel <eseidel@apple.com>
1241 Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
1243 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1244 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
1246 2006-02-21 Eric Seidel <eseidel@apple.com>
1250 * kjs/testkjs.cpp: #if out timeval code on win32
1252 2006-02-21 Michael Emmel <mike.emmel@gmail.com>
1256 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
1257 TCPageMap.h would not compile for me because string.h was missing
1259 * kxmlcore/TCPageMap.h: Added <string.h> include.
1261 2006-02-21 Darin Adler <darin@apple.com>
1263 Reviewed by John Sullivan.
1265 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
1266 remove a bunch of extra implementsCall overrides
1268 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
1270 * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
1271 we'll get a compile error if some derived class neglects to implement it.
1273 * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
1274 of param, which is an OwnPtr so it gets initialized by default.
1276 * bindings/runtime_method.cpp:
1277 * bindings/runtime_method.h:
1278 * kjs/array_object.cpp:
1279 * kjs/array_object.h:
1280 * kjs/bool_object.cpp:
1281 * kjs/bool_object.h:
1282 * kjs/date_object.cpp:
1283 * kjs/date_object.h:
1284 * kjs/error_object.cpp:
1285 * kjs/error_object.h:
1288 * kjs/function_object.cpp:
1289 * kjs/function_object.h:
1290 * kjs/math_object.cpp:
1291 * kjs/math_object.h:
1292 * kjs/number_object.cpp:
1293 * kjs/number_object.h:
1294 * kjs/object_object.cpp:
1295 * kjs/object_object.h:
1296 * kjs/regexp_object.cpp:
1297 * kjs/regexp_object.h:
1298 * kjs/string_object.cpp:
1299 * kjs/string_object.h:
1300 Removed many rendundant implementations of implementsCall from subclasses of
1301 InternalFunctionImp.
1303 2006-02-21 Darin Adler <darin@apple.com>
1307 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
1310 2006-02-21 Darin Adler <darin@apple.com>
1312 Change suggested by Mitz.
1314 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
1315 REGRESSION: Methods do not execute
1317 * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
1318 * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
1319 Return true. All the classes derived from InternalFunctionImp need
1320 to return true from this -- later we can remove all the extra
1321 implementations too.
1323 2006-02-21 Maciej Stachowiak <mjs@apple.com>
1325 - fix build breakage caused by last-minute change to my patch
1329 2006-02-20 Maciej Stachowiak <mjs@apple.com>
1331 Reviewed by Geoff and Darin.
1333 Patch from Maks Orlovich, based on work by David Faure, hand-applied and
1334 significantly reworked by me.
1336 - Patch: give internal function names (KJS merge)
1337 http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
1339 * tests/mozilla/expected.html: Updated for newly fixed test.
1341 * kjs/array_object.cpp:
1342 (ArrayProtoFunc::ArrayProtoFunc):
1343 * kjs/array_object.h:
1344 * kjs/bool_object.cpp:
1345 (BooleanPrototype::BooleanPrototype):
1346 (BooleanProtoFunc::BooleanProtoFunc):
1347 * kjs/bool_object.h:
1348 * kjs/date_object.cpp:
1349 (KJS::DateProtoFunc::DateProtoFunc):
1350 (KJS::DateObjectImp::DateObjectImp):
1351 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1352 * kjs/error_object.cpp:
1353 (ErrorPrototype::ErrorPrototype):
1354 (ErrorProtoFunc::ErrorProtoFunc):
1355 * kjs/error_object.h:
1357 (KJS::FunctionImp::FunctionImp):
1358 (KJS::GlobalFuncImp::GlobalFuncImp):
1360 * kjs/function_object.cpp:
1361 (FunctionPrototype::FunctionPrototype):
1362 (FunctionProtoFunc::FunctionProtoFunc):
1363 (FunctionProtoFunc::callAsFunction):
1364 * kjs/function_object.h:
1366 (KJS::InterpreterImp::initGlobalObject):
1367 (KJS::InternalFunctionImp::InternalFunctionImp):
1369 (KJS::InternalFunctionImp::functionName):
1371 (KJS::staticFunctionGetter):
1372 (KJS::HashEntryFunction::HashEntryFunction):
1373 (KJS::HashEntryFunction::implementsCall):
1374 (KJS::HashEntryFunction::toBoolean):
1375 (KJS::HashEntryFunction::implementsHasInstance):
1376 (KJS::HashEntryFunction::hasInstance):
1377 * kjs/math_object.cpp:
1378 (MathFuncImp::MathFuncImp):
1379 * kjs/math_object.h:
1380 * kjs/number_object.cpp:
1381 (NumberPrototype::NumberPrototype):
1382 (NumberProtoFunc::NumberProtoFunc):
1383 * kjs/number_object.h:
1385 (KJS::JSObject::putDirectFunction):
1386 (KJS::Error::create):
1388 * kjs/object_object.cpp:
1389 (ObjectPrototype::ObjectPrototype):
1390 (ObjectProtoFunc::ObjectProtoFunc):
1391 * kjs/object_object.h:
1392 * kjs/regexp_object.cpp:
1393 (RegExpPrototype::RegExpPrototype):
1394 (RegExpProtoFunc::RegExpProtoFunc):
1395 * kjs/regexp_object.h:
1396 * kjs/string_object.cpp:
1397 (StringProtoFunc::StringProtoFunc):
1398 (StringObjectImp::StringObjectImp):
1399 (StringObjectFuncImp::StringObjectFuncImp):
1400 * kjs/string_object.h:
1402 2006-02-20 Geoffrey Garen <ggaren@apple.com>
1404 Reviewed by Darin, with help from Eric, Maciej.
1406 - More changes to support super-accurate JS iBench. Doesn't work on
1407 Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
1408 opendarwin.org/show_bug.cgi?id= 7399] about that.
1410 * kjs/interpreter.cpp:
1411 (KJS::Interpreter::evaluate): Print line numbers with exception output
1412 * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the
1413 way we roll with .cpp files.
1414 (StopWatch::StopWatch): New class. Provides microsecond-accurate
1416 (StopWatch::~StopWatch):
1419 (StopWatch::getElapsedMS):
1420 (TestFunctionImp::callAsFunction): Added missing return statement.
1421 Fixed up "run" to use refactored helper functions. Removed bogus
1422 return statement from "quit" case. Made "print" output to stdout
1423 instead of stderr because that makes more sense, and PERL handles
1425 (main): Factored out KXMLCore unit tests. Removed custom exception
1426 printing code because the interpreter prints exceptions for you. Added
1427 a "delete" call for the GlobalImp we allocate.
1428 (testIsInteger): New function, result of refacotring.
1429 (createStringWithContentsOfFile): New function, result of refactoring.
1430 Renamed "code" to "buffer" to match factored-out-ness.
1432 2006-02-20 Eric Seidel <eseidel@apple.com>
1436 Fix "Copy ICU DLLs..." phase.
1438 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1439 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1441 2006-02-19 Darin Adler <darin@apple.com>
1443 - renamed ERROR to LOG_ERROR to fix build
1444 presumably Maciej had this change and forgot to land it
1446 * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
1447 * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
1448 * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
1450 2006-02-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
1452 Test: fast/js/toString-exception.html
1456 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
1457 REGRESSION: fast/js/toString-overrides.html fails when run multiple times
1459 * kjs/array_object.cpp:
1460 (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
1463 2006-02-18 Darin Adler <darin@apple.com>
1467 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
1468 add insert and remove to KXMLCore::Vector
1470 * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
1471 insert and remove to slide elements within the vector. Also added
1472 "insert" and "remove" functions.
1474 2006-02-16 Geoffrey Garen <ggaren@apple.com>
1478 - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
1479 Bindings::Instance::deref when leaving page @ gigaom.com
1481 * bindings/c/c_instance.cpp:
1482 (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
1483 globally, we shouldn't delete it, so don't.
1485 2006-02-16 Timothy Hatcher <timothy@apple.com>
1487 Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
1488 warnings. Using <rdar://problem/4448350> to track this.
1490 * JavaScriptCore.xcodeproj/project.pbxproj:
1491 * bindings/objc/objc_jsobject.h: Removed empty file.
1492 * bindings/objc/objc_jsobject.mm: Removed empty file.
1494 2006-02-16 Tim Omernick <timo@apple.com>
1498 <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
1499 javascript disabled (7015)
1501 * bindings/NP_jsobject.cpp:
1502 (_NPN_CreateNoScriptObject):
1503 Returns an NPObject which is not bound to a JavaScript object. This kind of NPObject
1504 can be given to a plugin as the "window script object" when JavaScript is disabled.
1505 The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
1506 Because of this, none of the NPN_* functions called by the plugin on this "no script
1507 object" will cause entry into JavaScript code.
1508 (_NPN_InvokeDefault):
1509 Make sure the NPVariant is filled before returning from this function. This never
1510 mattered before because we never reached this case, having only created NPObjects of
1511 the class NPScriptObjectClass.
1519 * bindings/NP_jsobject.h:
1520 Declared _NPN_CreateNoScriptObject().
1522 2006-02-16 Darin Adler <darin@apple.com>
1524 Reviewed by me, change by Peter Kuemmel.
1526 * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
1527 checking for positive infinity (rolling in fix from KDE side).
1529 2006-02-15 Geoffrey Garen <ggaren@apple.com>
1531 Reviewed by Maciej, Eric.
1533 - WebCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
1534 crashes in DashboardClient at com.apple.JavaScriptCore:
1535 KJS::Bindings::ObjcFallbackObjectImp::type()
1537 WebCore and JavaScriptCore weren't sharing Instance objects very
1538 nicely. I made them use RefPtrs, and sent them to bed without dessert.
1540 * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
1541 (JavaInstance::~JavaInstance):
1542 (JObjectWrapper::JObjectWrapper):
1543 * bindings/jni/jni_instance.h:
1544 (KJS::Bindings::JObjectWrapper::ref):
1545 (KJS::Bindings::JObjectWrapper::deref):
1546 * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
1547 (JavaArray::~JavaArray):
1548 (JavaArray::JavaArray):
1549 * bindings/jni/jni_runtime.h:
1550 (KJS::Bindings::JavaArray::operator=):
1551 * bindings/objc/objc_runtime.h:
1552 - Prohibited copying because that would muss the ref count.
1553 - Prohibited construction without instance because an instance wrapper
1554 without an instance is almost certainly a bug.
1555 * bindings/objc/objc_runtime.mm:
1556 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1557 * bindings/runtime.cpp:
1558 (KJS::Bindings::Instance::Instance):
1559 (KJS::Bindings::Instance::createBindingForLanguageInstance):
1560 (KJS::Bindings::Instance::createRuntimeObject):
1561 * bindings/runtime.h:
1562 (KJS::Bindings::Instance::ref):
1563 (KJS::Bindings::Instance::deref):
1564 * bindings/runtime_object.cpp:
1565 (RuntimeObjectImp::RuntimeObjectImp):
1566 (RuntimeObjectImp::fallbackObjectGetter):
1567 (RuntimeObjectImp::fieldGetter):
1568 (RuntimeObjectImp::methodGetter):
1569 (RuntimeObjectImp::getOwnPropertySlot):
1570 (RuntimeObjectImp::put):
1571 (RuntimeObjectImp::canPut):
1572 * bindings/runtime_object.h:
1573 - Removed ownsInstance data member because RefPtr takes care of
1574 instance lifetime now.
1575 - Prohibited copying because that would muss the ref count.
1576 - Prohibited construction without instance because an instance wrapper
1577 without an instance is almost certainly a bug.
1578 (KJS::RuntimeObjectImp::getInternalInstance):
1580 2006-02-15 Geoffrey Garen <ggaren@apple.com>
1584 - Applied the 4330457 change to CClass and ObjcClass as well.
1586 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
1589 This change isn't as critical because CClass and ObjcClass objects get
1590 cached globally and never deleted, but it's good practice, in case we
1591 ever do decide to delete CClass and ObjcClass objects.
1593 This change requires prohibiting copying, because we don't do any
1594 intelligent ref-counting -- when a Class is destroyed, it destroys its
1595 methods and fields unconditionally. (Java classes already prohibited
1598 * bindings/c/c_class.cpp:
1599 - Merged _commonInit and _commonDelete into constructor and destructor.
1602 (CClass::methodsNamed): Added delete callbacks
1603 (CClass::fieldNamed): Added delete callbacks
1604 * bindings/c/c_class.h: Prohibited copying
1605 * bindings/c/c_instance.cpp:
1606 (KJS::Bindings::CInstance::getClass): Changed to use the preferred
1607 class factory method, to take advantage of the global cache.
1609 [ Repeated changes applied to CClass for ObjcClass: ]
1611 * bindings/objc/objc_class.h:
1612 * bindings/objc/objc_class.mm:
1613 (KJS::Bindings::ObjcClass::ObjcClass):
1614 (KJS::Bindings::ObjcClass::~ObjcClass):
1615 (KJS::Bindings::ObjcClass::methodsNamed):
1616 (KJS::Bindings::ObjcClass::fieldNamed):
1617 * bindings/objc/objc_runtime.h:
1618 (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
1619 variable to prevent bad CFRelease.
1620 (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
1621 if statement to prevent bad CFRelease.
1622 * bindings/objc/objc_runtime.cpp: Changed to use the preferred
1623 ObjectStructPtr, for clarity.
1625 2006-02-14 Geoffrey Garen <ggaren@apple.com>
1629 - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
1630 in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
1633 Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
1636 This was a memory leak in the bindings code. The leak was so extreme
1637 that it would cause Safari or the JVM to abort from lack of memory.
1638 Upon construction, Class objects create field and method objects,
1639 storing them in CFDictionaries. The bug was that upon destruction, the
1640 class objects released the dictionaries but didn't destroy the stored
1643 The fix is to supply CFDictionary callbacks for destroying the values
1644 added to the dictionary.
1646 * bindings/jni/jni_class.cpp:
1647 (JavaClass::JavaClass): Added delete callbacks
1648 * bindings/runtime.cpp: Added definitions for delete callbacks
1649 (KJS::Bindings::deleteMethodList):
1650 (KJS::Bindings::deleteMethod):
1651 (KJS::Bindings::deleteField):
1652 * bindings/runtime.h: Added declarations for delete callbacks
1654 2006-02-14 Timothy Hatcher <timothy@apple.com>
1658 Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
1659 behavior due to POSIX version of sh
1661 * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
1663 2006-02-13 Dave Hyatt <hyatt@apple.com>
1665 Fix Win32 bustage in JavaScriptCore.
1669 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1670 Add JSImmediate to the Win32 project.
1672 * kjs/JSImmediate.h:
1673 (KJS::JSImmediate::fromDouble):
1674 (KJS::JSImmediate::toDouble):
1675 (KJS::JSImmediate::NanAsBits):
1676 (KJS::JSImmediate::oneAsBits):
1677 Win32 needs explicit returns after abort() for non-void functions.
1681 Win32 catches a bug in testkjs! The "return 2" should actually
1682 have been a return false.
1685 The extern decls of NaN and Inf need to be const.
1687 === JavaScriptCore-521.7 ===
1689 2006-02-13 Timothy Hatcher <timothy@apple.com>
1693 Replaced the old NS_DURING exception blocking with @try/@catch.
1695 * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
1696 * bindings/objc/objc_instance.mm:
1697 (ObjcInstance::invokeMethod):
1698 (ObjcInstance::invokeDefaultMethod):
1699 (ObjcInstance::setValueOfUndefinedField):
1700 (ObjcInstance::getValueOfUndefinedField):
1701 * bindings/objc/objc_runtime.mm:
1702 (ObjcField::valueFromInstance):
1703 (ObjcField::setValueToInstance):
1704 (ObjcArray::setValueAt):
1705 (ObjcArray::valueAt):
1707 2006-02-13 Darin Adler <darin@apple.com>
1709 - fix a couple problems building on Windows, based on requests
1710 from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1712 * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
1713 to the standard uint32/64_t. Also removed curious "isIEEE()" function
1714 that checked the sizes of some types (and type sizes alone don't tell you if
1715 the floating point conforms to the IEEE-standard). Added missing include
1718 * kjs/property_slot.h: Added missing include of <assert.h>.
1720 2006-02-12 Geoffrey Garen <ggaren@apple.com>
1724 Cleaned up testkjs, added new "run" functionality to allow scripting
1725 tests from within JS. ("run" is a part of my new super-accurate
1728 No regressions in run-javascriptcore-tests.
1731 (GlobalImp::className):
1732 (TestFunctionImp::):
1733 (TestFunctionImp::callAsFunction):
1737 2006-02-11 Alexey Proskuryakov <ap@nypop.com>
1741 - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
1742 RealPlayer.GetTitle() Crashes Safari/Dashboard
1744 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
1745 Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1,
1746 because the latter encoding has holes, and conversion can still fail.
1748 2006-02-10 Geoffrey Garen <ggaren@apple.com>
1752 - Inlined RefPtr assignment operators. .7% performance win on
1753 super-accurate JS iBench.
1755 * kxmlcore/RefPtr.h:
1756 (KXMLCore::::operator):
1758 2006-02-10 Geoffrey Garen <ggaren@apple.com>
1760 No review needed, just a build fix. This time for sure.
1764 2006-02-10 Geoffrey Garen <ggaren@apple.com>
1768 - Fixed build. As it goes without saying, I will not mention that I
1771 * JavaScriptCore.xcodeproj/project.pbxproj:
1772 * kjs/JSImmediate.cpp:
1773 (KJS::JSImmediate::toObject):
1775 2006-02-09 Geoffrey Garen <ggaren@apple.com>
1779 - Fixed <rdar://problem/4343730> Should switch ConstantValues (null,
1780 undefined, true, false) from JS objects to immediate values similar to
1783 2.0% performance gain on my new super-accurate version of JS iBench.
1784 (I promise to land a version of it soon.)
1786 The gist of the change:
1787 (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
1788 class (JSImmediate.h/.cpp), and it handles not only numbers but also
1789 null, undefined, true, and false.
1790 (2) JSImmediate provides convenience methods for the bit masking
1791 necessary to encode and decode immediate values.
1792 (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
1793 (4) JSCell no longer implements functions like getBoolean, because
1794 only a JSImmediate can be a boolean.
1795 (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
1796 and ALWAYS_INLINE is a non-portable option of last resort.
1797 (6) Type is now JSType, and it resides in its own file, JSType.h.
1798 Since I was there, I did some header include sorting as part of this
1801 The rest pretty much explains itself.
1803 * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
1804 added JSImmediate.h/.cpp.
1805 * bindings/c/c_instance.cpp:
1806 (KJS::Bindings::CInstance::defaultValue):
1807 * bindings/c/c_instance.h:
1808 * bindings/c/c_utility.cpp:
1809 (KJS::Bindings::convertValueToNPVariant):
1810 * bindings/jni/jni_instance.cpp:
1811 (JavaInstance::defaultValue):
1812 * bindings/jni/jni_instance.h:
1813 * bindings/jni/jni_jsobject.cpp:
1814 (JavaJSObject::convertValueToJObject):
1815 * bindings/objc/WebScriptObject.mm:
1816 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1817 Standardized calls to use getXXX instead of hand-rolling JSValue
1819 * bindings/objc/objc_instance.h:
1820 * bindings/objc/objc_instance.mm:
1821 (ObjcInstance::getValueOfUndefinedField):
1822 (ObjcInstance::defaultValue):
1823 * bindings/objc/objc_runtime.h:
1824 * bindings/objc/objc_runtime.mm:
1825 (ObjcFallbackObjectImp::type):
1826 (ObjcFallbackObjectImp::defaultValue):
1827 * bindings/runtime.h:
1828 (KJS::Bindings::Instance::getValueOfUndefinedField):
1829 * bindings/runtime_object.cpp:
1830 (RuntimeObjectImp::defaultValue):
1831 * bindings/runtime_object.h:
1832 * kjs/JSImmediate.h: Added.
1833 (KJS::JSImmediate::isImmediate):
1834 (KJS::JSImmediate::isNumber):
1835 (KJS::JSImmediate::isBoolean):
1836 (KJS::JSImmediate::isUndefinedOrNull):
1837 (KJS::JSImmediate::fromDouble):
1838 (KJS::JSImmediate::toDouble):
1839 (KJS::JSImmediate::toBoolean):
1840 (KJS::JSImmediate::trueImmediate):
1841 (KJS::JSImmediate::falseImmediate):
1842 (KJS::JSImmediate::NaNImmediate):
1843 (KJS::JSImmediate::undefinedImmediate):
1844 (KJS::JSImmediate::nullImmediate):
1845 (KJS::JSImmediate::tag):
1846 (KJS::JSImmediate::unTag):
1847 (KJS::JSImmediate::getTag):
1848 (KJS::JSImmediate::):
1849 (KJS::JSImmediate::isIEEE):
1850 (KJS::JSImmediate::is32bit):
1851 (KJS::JSImmediate::is64bit):
1852 (KJS::JSImmediate::NanAsBits):
1853 (KJS::JSImmediate::zeroAsBits):
1854 (KJS::JSImmediate::oneAsBits):
1856 (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
1857 * kjs/JSType.h: Added.
1858 * kjs/collector.cpp:
1859 (KJS::Collector::protect):
1860 (KJS::Collector::unprotect):
1861 (KJS::Collector::collect):
1863 (KJS::StringImp::toPrimitive):
1864 (KJS::NumberImp::toPrimitive):
1865 (KJS::NumberImp::toBoolean):
1866 (KJS::GetterSetterImp::toPrimitive):
1868 (KJS::StringImp::type):
1869 (KJS::NumberImp::type):
1871 (KJS::JSObject::type):
1872 (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
1873 I'm looking for?" test with "Are you not the one thing I'm not looking
1875 (KJS::JSObject::defaultValue):
1876 (KJS::JSObject::toPrimitive):
1878 (KJS::GetterSetterImp::type):
1879 (KJS::JSValue::isObject):
1880 * kjs/operations.cpp:
1884 * kjs/reference.cpp:
1885 (KJS::Reference::deleteValue):
1886 * kjs/simple_number.h: Removed.
1887 * kjs/string_object.cpp:
1888 (StringInstance::getOwnPropertySlot): fixed indentation
1890 (KJS::JSValue::toObject):
1891 (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
1892 us to inline jsNumber without adding PIC branches to callers.
1899 (KJS::JSValue::downcast):
1900 (KJS::JSValue::isUndefinedOrNull):
1901 (KJS::JSValue::isBoolean):
1902 (KJS::JSValue::isNumber):
1903 (KJS::JSValue::isString):
1904 (KJS::JSValue::isObject):
1905 (KJS::JSValue::getBoolean):
1906 (KJS::JSValue::getNumber):
1907 (KJS::JSValue::getString):
1908 (KJS::JSValue::getObject):
1909 (KJS::JSValue::getUInt32):
1910 (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
1911 resulting in a slight performance gain. Callers should always check
1912 !marked() before calling mark(), so it's impossible to call mark on
1914 (KJS::JSValue::marked):
1915 (KJS::JSValue::type):
1916 (KJS::JSValue::toPrimitive):
1917 (KJS::JSValue::toBoolean):
1918 (KJS::JSValue::toNumber):
1919 (KJS::JSValue::toString):
1921 2006-02-06 Eric Seidel <eseidel@apple.com>
1923 Add svn:ignore properties for visual studio internals.
1925 2006-02-06 Alexey Proskuryakov <ap@nypop.com>
1929 - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
1930 http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
1932 - No tests added - only changed functionality on WIN32, which should be covered by
1935 * kjs/date_object.cpp:
1936 (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
1938 (KJS::timeZoneOffset): Removed, was basically the same as the above.
1939 (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
1940 Windows based on struct tm itself.
1941 (KJS::DateInstance::getTime): Added.
1942 (KJS::DateInstance::getUTCTime): Added.
1943 (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
1944 (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
1945 (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
1946 GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
1947 with daylight savings time being in effect.
1949 * kjs/date_object.h: Added prototypes for new functions.
1951 2006-02-05 Maciej Stachowiak <mjs@apple.com>
1955 - fixed ~1100 KJS::Node leaked on layout tests
1956 http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
1959 (KJS::Parser::noteNodeCycle):
1960 (KJS::Parser::removeNodeCycle):
1961 (KJS::clearNewNodes):
1964 (ElementNode::breakCycle):
1965 (PropertyListNode::breakCycle):
1966 (ArgumentListNode::breakCycle):
1967 (StatListNode::StatListNode):
1968 (StatListNode::breakCycle):
1969 (VarDeclListNode::breakCycle):
1970 (BlockNode::BlockNode):
1971 (ClauseListNode::breakCycle):
1972 (CaseBlockNode::CaseBlockNode):
1973 (ParameterNode::breakCycle):
1974 (SourceElementsNode::SourceElementsNode):
1975 (SourceElementsNode::breakCycle):
1977 (KJS::Node::breakCycle):
1978 (KJS::ElementNode::ElementNode):
1979 (KJS::ArrayNode::ArrayNode):
1980 (KJS::PropertyListNode::PropertyListNode):
1981 (KJS::ObjectLiteralNode::ObjectLiteralNode):
1982 (KJS::ArgumentListNode::ArgumentListNode):
1983 (KJS::ArgumentsNode::ArgumentsNode):
1984 (KJS::VarDeclListNode::VarDeclListNode):
1985 (KJS::VarStatementNode::VarStatementNode):
1986 (KJS::ForNode::ForNode):
1987 (KJS::CaseClauseNode::CaseClauseNode):
1988 (KJS::ClauseListNode::ClauseListNode):
1989 (KJS::ParameterNode::ParameterNode):
1990 (KJS::FuncExprNode::FuncExprNode):
1991 (KJS::FuncDeclNode::FuncDeclNode):
1993 2006-02-05 Maciej Stachowiak <mjs@apple.com>
1997 - fix default traits for classes to make sure default constructors get called
1999 * kxmlcore/VectorTraits.h:
2002 2006-02-04 Darin Adler <darin@apple.com>
2006 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
2007 REGRESSION: for/in loop with var changes global variable instead of making local
2009 Test: fast/js/for-in-var-scope.html
2012 (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
2013 (ForInNode::execute): Break out of the scope chain loop once we find and set the
2014 loop variable. We don't want to set multiple loop variables.
2015 (ForInNode::processVarDecls): Process the declaration of the loop variable.
2019 * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
2020 * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
2021 instead of defining it here a second time.
2023 2006-02-04 Maciej Stachowiak <mjs@apple.com>
2027 - change JavaScript collector statistics calls to use HashCountedSet instead
2028 of CFSet; other misc cleanup
2029 http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
2031 * kjs/collector.cpp:
2032 (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
2034 (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
2037 (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
2040 2006-02-03 Timothy Hatcher <timothy@apple.com>
2044 Renamed configuration names to Debug, Release and Production.
2046 * JavaScriptCore.xcodeproj/project.pbxproj:
2048 2006-02-02 George Staikos <staikos@opensource.apple.com>
2052 * kjs/lookup.h: Fix compile, merged from KDE.
2054 2006-02-02 Darin Adler <darin@apple.com>
2058 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
2059 add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
2061 * kxmlcore/Noncopyable.h: Added.
2062 * kxmlcore/OwnArrayPtr.h: Added.
2063 * kxmlcore/OwnPtr.h: Added.
2065 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
2068 * kjs/function.cpp: Use OwnPtr for Parameter pointers.
2070 * kjs/internal.h: Use Noncopyable for LabelStack.
2072 * kjs/list.cpp: Use OwnArrayPtr for overflow.
2074 * kjs/property_map.h:
2075 * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
2076 Use Vector for some stack buffers.
2078 * kjs/regexp_object.h:
2079 * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
2081 2006-01-31 Maciej Stachowiak <mjs@apple.com>
2085 - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
2086 that would catch them
2089 (NodeCounter::~NodeCounter): Added debug-only node counter.
2092 * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
2094 2006-01-31 Darin Adler <darin@apple.com>
2098 - added deleteAllValues for HashSet as well as HashMap
2099 - fixed conversion from const_iterator to iterator, which I broke a while back
2101 * kxmlcore/HashMap.h: Updated copyright date.
2102 * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
2103 * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
2105 2006-01-31 Tim Omernick <timo@apple.com>
2107 Reviewed by Geoff Garen.
2109 * bindings/c/c_utility.cpp:
2110 (KJS::Bindings::convertUTF8ToUTF16):
2111 Fixed an invalid assertion that UTF8Chars is not NULL. It is valid for it to be NULL as long as
2113 This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
2114 where JavaScript is getting a NULL string back from some call on the Real Player plugin.
2116 2006-01-30 Anders Carlsson <andersca@mac.com>
2120 Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
2121 REGRESSION: United.com menus messed up due to document.all/MSIE sniff
2124 (typeStringForValue):
2125 Return "undefined" if the given object should masquerade as undefined.
2128 (KJS::JSObject::masqueradeAsUndefined):
2129 Rename from isEqualToNull.
2131 * kjs/operations.cpp:
2133 Update for name change.
2135 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2139 - properly define Vector assignment operator; the private version was accidentally left
2140 in, and the template version is not enough to replace the default
2142 * kxmlcore/Vector.h:
2143 (KXMLCore::Vector::operator=):
2145 2006-01-29 Eric Seidel <eseidel@apple.com>
2149 Fix the build by applying a GCC-specific namespace hack.
2153 2006-01-29 Eric Seidel <eseidel@apple.com>
2159 * kjs/lookup.h: fixed ::cacheGlobalObject
2160 * kxmlcore/Vector.h:
2161 (KXMLCore::Vector::operator[]): use unsigned long
2163 2006-01-29 Maciej Stachowiak <mjs@apple.com>
2165 Reviewed by Dave Hyatt.
2167 * kxmlcore/Vector.h:
2168 (KXMLCore::Vector::operator[]): Add unsigned overload
2170 2006-01-28 Darin Adler <darin@apple.com>
2172 Reviewed by John Sullivan.
2174 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
2175 include exception names in JavaScript form of DOM exception
2177 * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
2178 exception in the error message.
2180 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2184 - miscellaneous Vector improvements
2186 * kxmlcore/Vector.h:
2187 (KXMLCore::Vector::at): Add range-checking asserts.
2188 (KXMLCore::Vector::first): Added as a convenience.
2189 (KXMLCore::Vector::last): Convenience for stack-style use.
2190 (KXMLCore::Vector::removeLast): ditto
2192 2006-01-28 Darin Adler <darin@apple.com>
2194 Reviewed by John Sullivan
2196 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
2197 REGRESSION: JavaScript Date constructor won't accept another Date object
2199 Test: fast/js/date-constructor.html
2201 * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
2202 Added a special case for constructing one date from another (to avoid losing
2203 milliseconds, which are not in the text form, to match Firefox), and changed
2204 the base code to convert to primitive before checking for string to match
2205 the standard. Also corrected a couple silly things in the "construct from
2206 current time" code path (removed a floor that does no good, and changed
2207 the constant used to convert microseconds to milliseconds to be a 1000
2208 rather than "msPerSecond").
2210 2006-01-28 Darin Adler <darin@apple.com>
2212 * kjs/create_hash_table: Added missing license.
2214 2006-01-28 Maciej Stachowiak <mjs@apple.com>
2216 Reviewed by Dave Hyatt.
2218 - added a Vector class
2219 http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
2221 * JavaScriptCore.xcodeproj/project.pbxproj:
2223 (KJS::Parser::saveNewNode): Apply Vector.
2224 (KJS::clearNewNodes): ditto
2225 * kjs/number_object.cpp:
2226 (integer_part_noexp): ditto
2227 (char_sequence): ditto
2229 (KJS::UString::UTF8String): ditto
2230 * kxmlcore/HashMap.h:
2231 (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
2232 other versions are useful for other containers.
2233 * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
2234 be usable for all Array/QVector style purposes, and also as a stack buffer
2235 with oversize handling. Also some helper classes to make vector operations
2236 as efficient as possible for POD types and for simple non-PODs like RefPtr.
2238 (KXMLCore::VectorTypeOperations::destruct):
2239 (KXMLCore::VectorTypeOperations::initialize):
2240 (KXMLCore::VectorTypeOperations::move):
2241 (KXMLCore::VectorTypeOperations::uninitializedCopy):
2242 (KXMLCore::VectorTypeOperations::uninitializedFill):
2243 (KXMLCore::VectorBuffer::VectorBuffer):
2244 (KXMLCore::VectorBuffer::~VectorBuffer):
2245 (KXMLCore::VectorBuffer::deallocateBuffer):
2246 (KXMLCore::VectorBuffer::inlineBuffer):
2247 (KXMLCore::Vector::Vector):
2248 (KXMLCore::Vector::~Vector):
2249 (KXMLCore::Vector::size):
2250 (KXMLCore::Vector::capacity):
2251 (KXMLCore::Vector::isEmpty):
2252 (KXMLCore::Vector::at):
2253 (KXMLCore::Vector::operator[]):
2254 (KXMLCore::Vector::data):
2255 (KXMLCore::Vector::operator T*):
2256 (KXMLCore::Vector::operator const T*):
2257 (KXMLCore::Vector::begin):
2258 (KXMLCore::Vector::end):
2259 (KXMLCore::Vector::clear):
2260 (KXMLCore::Vector::fill):
2261 (KXMLCore::Vector::operator=):
2262 (KXMLCore::::Vector):
2263 (KXMLCore::::operator):
2265 (KXMLCore::::expandCapacity):
2266 (KXMLCore::::resize):
2267 (KXMLCore::::reserveCapacity):
2268 (KXMLCore::::append):
2269 (KXMLCore::deleteAllValues):
2270 * kxmlcore/VectorTraits.h: Added.
2271 (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
2274 2006-01-28 Alexey Proskuryakov <ap@nypop.com>
2278 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2279 RealPlayer.GetTitle() Crashes Safari/Dashboard
2281 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2282 Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
2284 2006-01-25 George Staikos <staikos@opensource.apple.com>
2288 * kxmlcore/HashFunctions.h: Merge build fix from KDE.
2290 2006-01-25 Darin Adler <darin@apple.com>
2292 - removed an unused source file
2294 * kjs/pointer_hash.h: Removed.
2295 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
2297 2006-01-23 Anders Carlsson <andersca@mac.com>
2301 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
2302 KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
2305 Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
2307 (cacheGlobalObject):
2308 Move this out of the KJS namespace.
2310 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2314 - renamed PointerHash to PtrHash
2315 - made PtrHash the default hash function for int and pointer types that aren't further specialized
2316 - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
2317 - did appropriate consequent cleanup (very few places now need to declare a hash function)
2318 http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
2320 * kjs/array_object.cpp:
2321 (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
2322 * kjs/collector.cpp: ditto
2323 * kjs/identifier.cpp:
2324 (KXMLCore::): declare DefaultHash the new way
2325 * kjs/internal.cpp: no need to mention PointerHash
2327 * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
2328 easier to specialize on PtrHash
2329 * kxmlcore/HashFunctions.h:
2330 (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
2331 a Hash typedef rather than being a hash function class itself; declared DefaultHash
2332 for int and partializy specialized for pointer types
2333 * kxmlcore/HashMapPtrSpec.h:
2334 (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
2335 way of handling pointer hash
2336 (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
2338 * kxmlcore/HashMap.h: ditto
2339 * kxmlcore/HashSet.h: ditto
2341 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2343 Reviewed by Tim Omernick.
2345 - use classes instead of free functions for extractors, this better matches how other
2346 things work and should avoid the need for hacky workarounds on other compilers
2347 http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
2349 * kjs/array_object.cpp:
2350 * kjs/identifier.cpp:
2352 * kxmlcore/HashMap.h:
2353 (KXMLCore::PairFirstExtractor::extract):
2354 * kxmlcore/HashMapPtrSpec.h:
2356 * kxmlcore/HashSet.h:
2357 (KXMLCore::IdentityExtractor::extract):
2358 * kxmlcore/HashTable.h:
2359 (KXMLCore::addIterator):
2360 (KXMLCore::removeIterator):
2361 (KXMLCore::HashTable::add):
2362 (KXMLCore::HashTable::isEmptyBucket):
2363 (KXMLCore::HashTable::isDeletedBucket):
2364 (KXMLCore::HashTable::HashTable):
2365 (KXMLCore::HashTable::lookup):
2366 (KXMLCore::HashTable::add):
2367 (KXMLCore::HashTable::reinsert):
2368 (KXMLCore::HashTable::find):
2369 (KXMLCore::HashTable::contains):
2370 (KXMLCore::HashTable::remove):
2371 (KXMLCore::HashTable::allocateTable):
2372 (KXMLCore::HashTable::deallocateTable):
2373 (KXMLCore::HashTable::expand):
2374 (KXMLCore::HashTable::rehash):
2375 (KXMLCore::HashTable::clear):
2376 (KXMLCore::HashTable::swap):
2377 (KXMLCore::HashTable::operator):
2378 (KXMLCore::HashTable::checkTableConsistency):
2379 (KXMLCore::HashTable::checkTableConsistencyExceptSize):
2380 (KXMLCore::HashTable::invalidateIterators):
2382 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2384 Rubber stamped by Tim Hatcher.
2386 - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
2387 for consistency with HashMap
2389 * kjs/array_object.cpp:
2390 (ArrayProtoFunc::callAsFunction):
2391 * kjs/collector.cpp:
2392 (KJS::Collector::protect):
2393 * kjs/identifier.cpp:
2394 (KJS::Identifier::add):
2395 * kxmlcore/HashCountedSet.h:
2397 * kxmlcore/HashMap.h:
2398 (KXMLCore::::inlineAdd):
2399 * kxmlcore/HashSet.h:
2401 * kxmlcore/HashTable.h:
2402 (KXMLCore::HashTable::add):
2404 (KXMLCore::::HashTable):
2406 2006-01-23 Justin Garcia <justin.garcia@apple.com>
2408 Reviewed by thatcher
2410 Turned on -O2 for B&I build.
2412 * JavaScriptCore.xcodeproj/project.pbxproj:
2414 2006-01-23 Maciej Stachowiak <mjs@apple.com>
2416 Reviewed by Tim Hatcher.
2418 - it's "Franklin Street", not "Franklin Steet"
2420 * kjs/array_instance.h:
2421 * kjs/array_object.cpp:
2422 * kjs/array_object.h:
2423 * kjs/bool_object.cpp:
2424 * kjs/bool_object.h:
2425 * kjs/collector.cpp:
2429 * kjs/date_object.cpp:
2430 * kjs/date_object.h:
2434 * kjs/error_object.cpp:
2435 * kjs/error_object.h:
2438 * kjs/function_object.cpp:
2439 * kjs/function_object.h:
2441 * kjs/identifier.cpp:
2445 * kjs/interpreter.cpp:
2446 * kjs/interpreter.h:
2453 * kjs/math_object.cpp:
2454 * kjs/math_object.h:
2457 * kjs/nodes2string.cpp:
2458 * kjs/number_object.cpp:
2459 * kjs/number_object.h:
2462 * kjs/object_object.cpp:
2463 * kjs/object_object.h:
2464 * kjs/operations.cpp:
2466 * kjs/property_map.cpp:
2467 * kjs/property_map.h:
2468 * kjs/property_slot.cpp:
2469 * kjs/property_slot.h:
2470 * kjs/reference.cpp:
2472 * kjs/reference_list.cpp:
2473 * kjs/reference_list.h:
2476 * kjs/regexp_object.cpp:
2477 * kjs/regexp_object.h:
2478 * kjs/scope_chain.cpp:
2479 * kjs/scope_chain.h:
2480 * kjs/simple_number.h:
2481 * kjs/string_object.cpp:
2482 * kjs/string_object.h:
2489 * kxmlcore/AlwaysInline.h:
2490 * kxmlcore/ListRefPtr.h:
2491 * kxmlcore/PassRefPtr.h:
2492 * kxmlcore/RefPtr.h:
2494 2006-01-23 Darin Adler <darin@apple.com>
2496 Reviewed by John Sullivan.
2498 - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
2499 REGRESSION: Crash in cloneChildNodes when clicking element
2501 * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
2502 type by calling get() instead of going directly at m_ptr.
2503 * kxmlcore/RefPtr.h: Ditto.
2507 * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
2508 It's just a resorted list of keys in a dictionary.
2510 * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
2511 in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
2512 routine" property we want to have on OS X.
2514 2006-01-22 Maciej Stachowiak <mjs@apple.com>
2518 - Set up Page class and invert Frame / WebCoreFrameBridge ownership
2519 http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
2521 * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can
2524 2006-01-23 George Staikos <staikos@opensource.apple.com>
2526 Reviewed by Maciej and Darin.
2528 * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
2529 * kjs/interpreter.cpp: ditto
2530 * kjs/simple_number.h: Add assert.h and remove from config.h
2531 * kjs/array_object.cpp: Use relative paths for kxmlcore includes
2532 * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
2534 2006-01-23 George Staikos <staikos@opensource.apple.com>
2538 * kjs/config.h: unbreak preprocessor change
2540 2006-01-23 George Staikos <staikos@opensource.apple.com>
2542 Approved by Maciej and Darin.
2546 Update FSF address in license to make merging easier
2548 2006-01-22 George Staikos <staikos@opensource.apple.com>
2552 * kjs/collector.cpp: merge major speedup from KDE on Linux
2553 patch by Maks Orlovich, bug #6145
2554 Also unify cpu detection
2555 * kjs/config.h: define simpler CPU macros
2557 2006-01-22 George Staikos <staikos@opensource.apple.com>
2561 * kjs/collector.cpp: merge FreeBSD compile fix from KDE
2562 -> requires build magic for use
2564 2006-01-21 George Staikos <staikos@opensource.apple.com>
2568 * kjs/nodes2string.cpp
2571 Fix pedantic compile with some gcc versions (Merge from KDE)
2573 * kjs/create_hash_table:
2574 Fix build with Perl 5.8.0 (Merge from KDE)
2576 2006-01-18 Darin Adler <darin@apple.com>
2580 - hash table fixes needed for my WebCore changes
2582 * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
2583 Added a missing return statement.
2585 * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
2586 can't instantiate with a 0 by using traits rather than ? : to select the default
2587 emtpy value of hash table keys.
2589 - small cleanup of "runtime" code left over from recent JavaScript crash fix
2591 * bindings/runtime_root.h:
2592 (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
2593 since it's now a ProtectedPtr.
2594 (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
2595 fact that _imp was 0 and replaced with use of ProtectedPtr.
2596 (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
2598 2006-01-17 Darin Adler <darin@apple.com>
2602 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
2603 add assertions to check correct use of hash table iterators
2605 * kxmlcore/HashTable.h:
2606 (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
2607 maintained by the specified hash table.
2608 (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
2609 the list maintained by the hash table it's in.
2610 (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
2611 parameter, ignored when not debugging. Call addIterator.
2612 (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
2613 (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
2614 (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
2615 (KXMLCore::HashTableConstIterator::operator->): Ditto.
2616 (KXMLCore::HashTableConstIterator::operator++): Ditto.
2617 (KXMLCore::HashTableConstIterator::operator==): Ditto.
2618 (KXMLCore::HashTableConstIterator::operator!=): Ditto.
2619 (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
2620 pointer is not 0 and if there are two iterators that both point at the same table.
2621 (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
2622 as an implementation detail, to avoid having two separate iterator implementations.
2623 (KXMLCore::HashTableIterator::operator*): Ditto.
2624 (KXMLCore::HashTableIterator::operator->): Ditto.
2625 (KXMLCore::HashTableIterator::operator++): Ditto.
2626 (KXMLCore::HashTableIterator::operator==): Ditto.
2627 (KXMLCore::HashTableIterator::operator!=): Ditto.
2628 (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
2629 (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
2630 (KXMLCore::HashTable::makeIterator): Pass this pointer.
2631 (KXMLCore::HashTable::makeConstIterator): Ditto.
2632 (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
2633 entry point that modifies the hash table.
2634 (KXMLCore::HashTable::remove): Ditto.
2635 (KXMLCore::HashTable::clear): Ditto.
2636 (KXMLCore::HashTable::swap): Ditto.
2637 (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
2638 clears out the table, next, and previous pointers in all of them, and then clears
2639 the head so we have an empty list.
2640 (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
2641 passed-in table, and points the iterator at the table.
2642 (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
2643 the passed-in table.
2645 * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
2647 2006-01-17 Justin Garcia <justin.garcia@apple.com>
2651 Deployment builds now use -O2
2653 * JavaScriptCore.xcodeproj/project.pbxproj:
2655 2006-01-17 Darin Adler <darin@apple.com>
2659 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
2660 change RefPtr so that it works when deref ends up deleting the RefPtr
2662 * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
2663 * kxmlcore/RefPtr.h: Ditto.
2665 2006-01-16 Geoffrey Garen <ggaren@apple.com>
2669 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
2670 DateProtoFuncImp::callAsFunction can crash due to lack of type checking
2672 * kjs/date_object.cpp:
2673 (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods.
2674 This matches section 15.9.5 in the spec.
2676 2006-01-16 Tim Omernick <timo@apple.com>
2678 Reviewed by John Sullivan.
2680 JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
2682 * bindings/npruntime.cpp:
2683 (_NPN_ReleaseObject):
2684 Refactored part of this function out into _NPN_DeallocateObject.
2685 (_NPN_DeallocateObject):
2686 Forcibly deallocates the passed object, even if its refcount is
2689 * bindings/npruntime_impl.h:
2690 Declared _NPN_DeallocateObject().
2692 2006-01-16 Darin Adler <darin@apple.com>
2696 - fix problem with ++, ==, and != on const iterators in
2697 HashMaps that are using the pointer specialization
2699 * kxmlcore/HashMapPtrSpec.h:
2700 (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
2701 (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
2702 (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
2704 2006-01-15 Alexey Proskuryakov <ap@nypop.com>
2708 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
2709 run-javascriptcore-tests doesn't work
2711 * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm:
2712 Changed revision number to 1.8 (broken by svn migration).
2714 2006-01-14 David Kilzer <ddkilzer@kilzer.net>
2716 Reviewed and landed by Anders.
2718 * kjs/create_hash_table: Fixed comment typo.
2720 2006-01-13 Maks Orlovich <maksim@kde.org>
2722 Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
2724 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
2725 Misc. array object fixes from KJS
2727 * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
2728 (ArrayInstance::getOwnPropertySlot): Ditto.
2729 (ArrayInstance::deleteProperty): Ditto.
2730 (ArrayInstance::put): Ditto.
2731 (ArrayInstance::propList): Added a FIXME comment.
2732 (ArrayInstance::put): Throw exception on trying to set invalid array length.
2733 (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
2734 * kjs/array_object.h: Added MAX_ARRAY_INDEX.
2736 2006-01-13 Darin Adler <darin@apple.com>
2738 - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
2739 - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
2741 2006-01-13 Anders Carlsson <andersca@mac.com>
2745 * kjs/create_hash_table:
2746 Use correct size variables.
2748 2006-01-13 Anders Carlsson <andersca@mac.com>
2752 * kjs/create_hash_table:
2753 Don't create an empty entry array, instead add a entry with all fields
2754 set to null and set the hash table size to 1.
2758 Remove the hash table size check
2760 2006-01-12 Anders Carlsson <andersca@mac.com>
2764 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
2765 Crash when assigning a new function to a DOMParser object
2767 * JavaScriptCore.xcodeproj/project.pbxproj:
2768 Move lookup.cpp before lookup.h
2772 If the hash table is empty, return 0 early.
2774 2006-01-12 George Staikos <staikos@kde.org>
2778 * kjs/interpreter.cpp:
2780 * kjs/interpreter.h:
2781 Add helper to interpreter to call the collector in order to facilitate
2782 visibility rules in KDE.
2784 2006-01-12 George Staikos <staikos@kde.org>
2788 * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
2790 * kxmlcore/HashTable.h: Add missing assert.h
2792 2006-01-12 Darin Adler <darin@apple.com>
2796 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
2797 retire APPLE_CHANGES from JavaScriptCore
2799 * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
2800 APPLE_CHANGES and HAVE_CONFIG_H from all targets.
2802 * README: Removed. This had obsolete information in it
2803 and it wasn't clear what to replace it with.
2805 * kjs/collector.h: Removed an APPLE_CHANGES if around something
2806 that's not really platform-specific (although it does use a
2807 platform-specific API at the moment).
2808 * kjs/collector.cpp: Removed a mistaken comment.
2813 * kjs/operations.cpp:
2816 Use __APPLE__ instead of APPLE_CHANGES for code that should be
2817 used only on Mac OS X.
2819 * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
2820 of the runtime.h header. Even though that header isn't needed at the
2821 moment on platforms other than Mac OS X, the conditional stuff should
2822 be in the header itself, not in this one client.
2824 * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
2825 code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
2826 any platform where pow is implemented corrrectly according to the IEEE
2827 standard. If it is needed on some, we can add it back with an appropriate
2828 #if for the platforms where it is needed.
2830 2006-01-12 Justin Haygood <justin@xiondigital.net>
2832 Reviewed, tweaked, and landed by Darin.
2834 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
2835 lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
2837 * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2838 quotes instead of angle brackets. Moved dtoa.h include to the top.
2839 Changed system header includes to use angle brackets instead of quotes.
2840 * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
2841 quotes instead of angle brackets.
2842 * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2843 quotes instead of angle brackets. Moved lexer.h include to the top.
2844 * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2845 quotes instead of angle brackets. Moved ustring.h include to the top.
2847 2006-01-12 George Staikos <staikos@kde.org>
2851 - Import initial QMake file. Doesn't fully work yet.
2853 2006-01-11 Ricci Adams <ricciadams@apple.com>
2855 Reviewed by Maciej and Darin, landed by Darin.
2857 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
2858 final comma in javascript object prevents parsing
2860 * kjs/grammar.y: Added rule to allow trailing comma in
2861 object construction.
2863 2006-01-11 Ricci Adams <ricciadams@apple.com>
2865 Reviewed by Geoff, landed by Darin.
2867 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
2868 Number.toFixed doesn't include leading 0
2870 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2871 Fixed a "<" that should have been a "<=".
2873 2006-01-11 Ricci Adams <ricciadams@apple.com>
2875 Reviewed by Geoff, landed by Darin.
2877 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
2878 Number.toFixed doesn't round 0.5 up
2880 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2881 Fixed a ">" that should have been a ">=".
2883 2006-01-11 Justin Haygood <justin@xiondigital.net>
2885 Reviewed and landed by Darin.
2887 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6486
2888 JavaScriptCore should use system malloc on Windows
2890 * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
2892 2006-01-10 Darin Adler <darin@apple.com>
2894 * Makefile: Took out unneeded "export" line.
2895 * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
2896 MIME types, other small corrections).
2898 2006-01-09 Darin Adler <darin@apple.com>
2900 * Makefile.am: Removed.
2902 2006-01-07 Anders Carlsson <andersca@mac.com>
2906 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
2907 REGRESSION: JavaScript hang when comparing large array to null
2910 (KJS::JSObject::isEqualToNull):
2911 Add new function which returns true if an object should be treated as null when
2914 * kjs/operations.cpp:
2918 2006-01-07 Alexey Proskuryakov <ap@nypop.com>
2922 - Fix WebCore development build
2923 http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
2925 * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
2927 2006-01-06 Maciej Stachowiak <mjs@apple.com>
2931 - miscellaneous changes for 4% speedup on the JavaScript iBench
2932 http://bugzilla.opendarwin.org/show_bug.cgi?id=6396
2934 Changes mostly thanks to Maks Orlovich, tweaked a little by me.
2936 * kjs/create_hash_table: Use the same hash as the one used by Identifier.
2938 (KJS::FunctionImp::processParameters): Use the new List::copyFrom
2939 (KJS::ActivationImp::ActivationImp): track variable while iterating
2941 (KJS::StringImp::toObject): create StringInstance directly
2943 (KJS::List::copy): implement in terms of copyFrom
2944 (KJS::List::copyFrom): more efficient way to copy in another list
2947 (keysMatch): updated to work with identifier hash
2949 (Lookup::findEntry): ditto
2950 (Lookup::find): ditto
2953 2006-01-06 Maciej Stachowiak <mjs@apple.com>
2955 - fix development build failure from the previous checkin
2958 (KJS::ActivationImp::put): Use prototype() accessor in assert.
2960 2006-01-05 Maciej Stachowiak <mjs@apple.com>
2964 - fix remaining performance regression from Getter/Setter change
2965 http://bugzilla.opendarwin.org/show_bug.cgi?id=6249
2967 - Activation objects should not have __proto__ property
2968 http://bugzilla.opendarwin.org/show_bug.cgi?id=6395
2971 (KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
2972 skipping getter/setter handling and __proto__ handling, as well
2973 as inlining needed superclass stuff.
2974 (KJS::ActivationImp::put): Implement directly, skipping getter/setter,
2975 __proto__, and do canPut directly in PropertyMap::put since there's no
2976 static property table either.
2978 * kjs/property_map.cpp:
2979 (KJS::PropertyMap::put): Allow optionally inlining canPut check.
2980 * kjs/property_map.h:
2982 2006-01-04 Geoffrey Garen <ggaren@apple.com>
2984 Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
2986 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4921
2987 \u escape sequences in JavaScript identifiers
2989 * kjs/function_object.cpp:
2990 (FunctionObjectImp::construct):
2994 (Lexer::isWhiteSpace):
2995 (Lexer::isLineTerminator):
2996 (Lexer::isIdentStart):
2997 (Lexer::isIdentPart):
2999 (Lexer::scanRegExp):
3003 * tests/mozilla/expected.html: Updated test results.
3005 2005-12-30 Maciej Stachowiak <mjs@apple.com>
3007 No review, just test result update.
3009 * tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
3011 2005-12-30 Anders Carlsson <andersca@mac.com>
3015 - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6298
3016 Getter setter test is failing
3019 (KJS::JSObject::put):
3020 Rework the getter setter part. We now walk the prototype chain, checking for
3021 getter/setter properties and only take the slow path if any are found.
3023 2005-12-30 Maks Orlovich <maksim@kde.org>
3025 Reviewed and committed by Maciej.
3027 - Handle negative, FP numbers with non-10 radix in toString
3028 http://bugzilla.opendarwin.org/show_bug.cgi?id=6259
3030 (Merged from KJS, original work by Harri Porten)
3032 * kjs/number_object.cpp:
3033 (NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with
3034 negative numbers, floating point and very large numbers.
3036 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3038 Patch by Maks Orlovich, reviewed and landed by me.
3040 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6267
3041 Fix Number.prototype.toFixed/toExponential(undefined)
3043 * kjs/number_object.cpp:
3044 (NumberProtoFunc::callAsFunction):
3046 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3048 Patch by Maks Orlovich, Reviewed and landed by me.
3050 - http://bugzilla.opendarwin.org/show_bug.cgi?id=6266
3051 Minor object naming updates (to match Mozilla, KJS)
3053 * kjs/number_object.cpp:
3054 * kjs/regexp_object.cpp:
3056 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3058 Patch by Maks Orlovich, reviewed by mjs.
3060 This has 2 very minor fixes, covered by KJS testsuite:
3061 1. Enumerates string indices in property list (with the same bug as array
3062 object has in corresponding code). This is a mozilla emulation thing.
3063 2. Permits properties with integer names in prototypes to be found
3065 * kjs/string_object.cpp:
3066 (StringInstance::getOwnPropertySlot):
3067 (StringInstanceImp::propList):
3068 * kjs/string_object.h:
3070 2005-12-26 Geoffrey Garen <ggaren@apple.com>
3074 - Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in
3075 KJS::BlockNode::deref
3077 http://bugzilla.opendarwin.org/show_bug.cgi?id=6233
3078 Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in
3081 This patch does four things:
3082 (1) Standardizes all our linked list nodes to use "next" as their next
3084 (2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
3085 to iteratively deref "next" pointers.
3086 (3) Standardizes our linked list nodes to use ListRefPtr<T> and
3087 implement the releaseNext() function used by ~ListRefPtr<T>().
3088 (4) Adds to RefPtr<T> the release() method used by releaseNext().
3090 - Modified existing mozilla test to ensure it would make deployment
3091 builds crash as well.
3093 * JavaScriptCore.xcodeproj/project.pbxproj:
3095 (ElementNode::evaluate):
3096 (PropertyListNode::evaluate):
3097 (ArgumentListNode::evaluateList):
3098 (StatListNode::StatListNode):
3099 (StatListNode::execute):
3100 (StatListNode::processVarDecls):
3101 (VarDeclListNode::evaluate):
3102 (VarDeclListNode::processVarDecls):
3103 (VarStatementNode::execute):
3104 (VarStatementNode::processVarDecls):
3105 (BlockNode::BlockNode):
3106 (CaseClauseNode::evalStatements):
3107 (CaseClauseNode::processVarDecls):
3108 (ClauseListNode::processVarDecls):
3109 (CaseBlockNode::CaseBlockNode):
3110 (CaseBlockNode::evalBlock):
3111 (SourceElementsNode::SourceElementsNode):
3112 (SourceElementsNode::execute):
3113 (SourceElementsNode::processFuncDecl):
3114 (SourceElementsNode::processVarDecls):
3116 (KJS::ElementNode::ElementNode):
3117 (KJS::ElementNode::releaseNext):
3118 (KJS::ArrayNode::ArrayNode):
3119 (KJS::PropertyListNode::PropertyListNode):
3120 (KJS::PropertyListNode::releaseNext):
3121 (KJS::ObjectLiteralNode::ObjectLiteralNode):
3122 (KJS::ArgumentListNode::ArgumentListNode):
3123 (KJS::ArgumentListNode::releaseNext):
3124 (KJS::ArgumentsNode::ArgumentsNode):
3125 (KJS::StatListNode::releaseNext):
3126 (KJS::VarDeclListNode::VarDeclListNode):
3127 (KJS::VarDeclListNode::releaseNext):
3128 (KJS::VarStatementNode::VarStatementNode):
3129 (KJS::ForNode::ForNode):
3130 (KJS::CaseClauseNode::CaseClauseNode):
3131 (KJS::ClauseListNode::ClauseListNode):
3132 (KJS::ClauseListNode::getClause):
3133 (KJS::ClauseListNode::getNext):
3134 (KJS::ClauseListNode::releaseNext):
3135 (KJS::ParameterNode::ParameterNode):
3136 (KJS::ParameterNode::releaseNext):
3137 (KJS::SourceElementsNode::releaseNext):
3138 * kjs/nodes2string.cpp:
3139 (ElementNode::streamTo):
3140 (PropertyListNode::streamTo):
3141 (ArgumentListNode::streamTo):
3142 (StatListNode::streamTo):
3143 (VarDeclListNode::streamTo):
3144 (VarStatementNode::streamTo):
3145 (CaseClauseNode::streamTo):
3146 (ClauseListNode::streamTo):
3147 (CaseBlockNode::streamTo):
3148 (SourceElementsNode::streamTo):
3149 * kxmlcore/ListRefPtr.h: Added.
3150 (KXMLCore::ListRefPtr::ListRefPtr):
3151 (KXMLCore::ListRefPtr::~ListRefPtr):
3152 (KXMLCore::ListRefPtr::operator=):
3153 * kxmlcore/RefPtr.h:
3154 (KXMLCore::RefPtr::release):
3156 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3160 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4026
3161 Math.random() not seeded.
3163 Added call to sranddev() -- it executes the first time a process
3164 calls Math.random().
3166 * kjs/math_object.cpp:
3167 (MathFuncImp::callAsFunction):
3169 2005-12-29 Geoffrey Garen <ggaren@apple.com>
3173 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6265
3174 Name change regression: Java doesn't know what JavaJSObject is
3176 Changed strings passed to Java back to original "JSObject".
3178 * bindings/jni/jni_jsobject.cpp:
3179 (JavaJSObject::convertValueToJObject):
3180 (JavaJSObject::convertJObjectToValue):
3182 2005-12-28 Anders Carlsson <andersca@mac.com>
3186 - The JSC part of http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
3187 Add undetectable document.all
3189 * kjs/operations.cpp:
3191 When comparing an object with null or undefined, call toPrimitive with
3192 NullType as the preferred type.
3194 2005-12-27 Anders Carlsson <andersca@mac.com>
3198 * kjs/array_object.cpp:
3199 (ArrayProtoFunc::callAsFunction):
3200 Implement filter and map. Also, make the existing
3201 array iteration functions not invoke the callback for
3202 non-existing properties, just as Mozilla does now.
3204 * kjs/array_object.h:
3205 (KJS::ArrayProtoFunc::):
3208 * tests/mozilla/expected.html:
3209 Update, two 1.6 tests now pass.
3211 2005-12-27 Maciej Stachowiak <mjs@apple.com>
3213 - updated test results for new JS 1.6 tests
3215 * tests/mozilla/expected.html:
3217 2005-12-27 Anders Carlsson <andersca@mac.com>
3221 Add Mozilla JS 1.6 tests.
3223 * tests/mozilla/js1_6/Array/browser.js: Added.
3224 * tests/mozilla/js1_6/Array/regress-290592.js: Added.
3225 * tests/mozilla/js1_6/Array/regress-304828.js: Added.
3226 * tests/mozilla/js1_6/Array/regress-305002.js: Added.
3227 * tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
3228 * tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
3229 * tests/mozilla/js1_6/Array/regress-320887.js: Added.
3230 * tests/mozilla/js1_6/Array/shell.js: Added.
3231 * tests/mozilla/js1_6/README: Added.
3232 * tests/mozilla/js1_6/Regress/browser.js: Added.
3233 * tests/mozilla/js1_6/Regress/regress-301574.js: Added.
3234 * tests/mozilla/js1_6/Regress/regress-309242.js: Added.
3235 * tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
3236 * tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
3237 * tests/mozilla/js1_6/Regress/regress-314887.js: Added.
3238 * tests/mozilla/js1_6/Regress/regress-320172.js: Added.
3239 * tests/mozilla/js1_6/Regress/shell.js: Added.
3240 * tests/mozilla/js1_6/String/browser.js: Added.
3241 * tests/mozilla/js1_6/String/regress-306591.js: Added.
3242 * tests/mozilla/js1_6/String/shell.js: Added.
3243 * tests/mozilla/js1_6/browser.js: Added.
3244 * tests/mozilla/js1_6/shell.js: Added.
3245 * tests/mozilla/js1_6/template.js: Added.
3247 2005-12-27 Maks Orlovich <maksim@kde.org>
3249 Reviewed and landed by Maciej.
3251 - fixed 6234: Can delete array index property incorrectly.
3252 http://bugzilla.opendarwin.org/show_bug.cgi?id=6234
3254 * kjs/array_object.cpp:
3255 (ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
3256 looking for array properties.
3258 2005-12-27 Anders Carlsson <andersca@mac.com>
3263 (KJS::JSObject::defineSetter):
3264 Remove duplicate call to putDirect.
3266 2005-12-26 Maciej Stachowiak <mjs@apple.com>
3268 Reviewed by Darin and Geoff.
3270 Changes by me and Anders.
3272 - mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
3273 http://bugzilla.opendarwin.org/show_bug.cgi?id=6083
3275 - also fixed some warnings reported by -Winline
3277 * JavaScriptCorePrefix.h: Move new and delete definitions higher so there
3278 aren't conflicts with use in standard C++ headers
3280 (KJS::throwSetterError): Moved this piece of put into a seprate function
3281 to avoid the PIC branch.
3282 (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
3283 when not needed. Also use GetterSetter properties attribute.
3284 (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
3285 properties any more, if this one was one.
3286 (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
3287 properties now (and use the new attribute).
3288 (KJS::JSObject::defineSetter): Ditto.
3289 (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
3290 to avoid global variable access in the hot code path.
3292 (KJS::): Added GetterSetter attribute.
3293 (KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
3294 (KJS::JSValue::isObject): ditto
3295 (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
3296 as much as possible in the case where they are not being used
3297 * kjs/property_map.cpp:
3298 (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
3299 * kjs/property_map.h:
3300 (KJS::PropertyMap::hasGetterSetterProperties): Ditto
3301 (KJS::PropertyMap::setHasGetterSetterProperties): Ditto
3302 (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
3303 global "has getter/setter properties" flag in the property map
3304 single entry, to avoid making objects any bigger.
3305 * kjs/value.h: Moved some things to object.h to make -Winline happier
3307 2005-12-24 Maciej Stachowiak <mjs@apple.com>
3309 Reviewed by Eric and Dave Hyatt.
3311 - make even const PassRefPtrs give transfer of ownership semantics
3312 http://bugzilla.opendarwin.org/show_bug.cgi?id=6238
3314 This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
3315 in assignment and copy construction. And this makes life way easier and removes
3316 the need for pass(). It is not really correct, but we pretty much never need a real
3317 const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
3319 * kjs/identifier.cpp:
3320 (KJS::Identifier::add): No more need for pass()
3321 * kjs/property_map.cpp:
3322 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
3324 (KJS::UString::Rep::create): Use adoptRef
3325 (KJS::UString::UString): No more need for pass
3326 (KJS::UString::append): No more need for pass
3327 (KJS::UString::substr): No more need for pass
3328 * kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
3329 (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
3330 (KXMLCore::PassRefPtr::release): Made this a const method (ugh)
3331 (KXMLCore::PassRefPtr::operator=): clean up appropriately
3332 (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
3333 it makes the behavior more clear and it is less verbose.
3334 (KXMLCore::static_pointer_cast): use adoptRef
3335 (KXMLCore::const_pointer_cast): use adoptRef
3336 * kxmlcore/RefPtr.h:
3337 (KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
3338 (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
3340 2005-12-25 Eric Seidel <eseidel@apple.com>
3344 Unbreak HashTableConstIterator++ by returning const_iterator
3346 * kxmlcore/HashTable.h:
3347 (KXMLCore::HashTableConstIterator::operator++): use const_iterator
3349 2005-12-25 Eric Seidel <eseidel@apple.com>
3353 Un-break HashTable copy constructor.
3355 * kxmlcore/HashTable.h:
3356 (KXMLCore::::HashTable): use const_iterator instead
3358 2005-12-23 Maciej Stachowiak <mjs@apple.com>
3362 - fixed "HashMap does not work with const pointer keys or values"
3363 http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
3365 * kxmlcore/HashMapPtrSpec.h:
3366 (KXMLCore::HashMap): In all methods, explicitly cast all pointers
3367 to void * before passing to internal implementation. Use C-style
3368 casts instead of new-style casts, because the real solution would
3369 require a combo of reinterpret_cast anc const_cast.
3372 2005-12-23 Maciej Stachowiak <mjs@apple.com>
3374 - this time for sure
3376 * kxmlcore/RefPtr.h:
3379 2005-12-22 Maciej Stachowiak <mjs@apple.com>
3381 - fix build problem from last commit.
3383 * kxmlcore/RefPtr.h:
3386 2005-12-21 Maciej Stachowiak <mjs@apple.com>
3390 - Make HashMap/HashSet support non-POD types
3391 http://bugzilla.opendarwin.org/show_bug.cgi?id=5332
3393 The changes for support are relatively simple, but I also made extensive changes to
3394 avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
3396 * kxmlcore/HashTable.h:
3397 (KXMLCore::swap): specialize swap for pairs, to swap elements individually,
3398 so that excess copies can be avoided.
3399 (KXMLCore::Mover::move): Template function to either copy or swap, used
3400 when transferring elements from old table to new.
3401 (KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
3402 that took two or three function parameters now take a class parameter, this is
3403 the class used to do a normal lookup.
3404 (KXMLCore::IdentityHashTranslator::equal): Ditto.
3405 (KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
3406 to write into instead of returning a value to avoid redundant copies.
3407 (KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
3408 (KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
3409 functions. Added a FIXME about a remaining rare excess copy.
3410 (KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
3411 the key from Traits, to avoid creating and destroying pair, which copies.
3412 (KXMLCore::HashTable::isDeletedBucket): ditto
3413 (KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
3414 (KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
3415 work right for non-POD types.
3416 (KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
3417 (KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
3418 (KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
3419 (KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
3420 (KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
3421 (KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
3422 (KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
3424 * kxmlcore/HashFunctions.h:
3425 (KXMLCore::PointerHash): Specialize PointerHash for RefPtr
3426 * kxmlcore/HashMap.h:
3427 (KXMLCore::extractFirst): Return a reference not a full object to avoid
3429 (KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
3430 to defer making the pair as long as possible, thus avoiding needless copies.
3431 (KXMLCore::HashMapTranslator::equal): ditto
3432 (KXMLCore::HashMapTranslator::translate): ditto
3433 (KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
3434 (KXMLCore::::set): Use inlineAdd
3435 (KXMLCore::::add): Use inlineAdd
3436 * kxmlcore/HashMapPtrSpec.h:
3437 (KXMLCore::): Pass KeyTraits along
3438 * kxmlcore/HashSet.h:
3439 (KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
3440 (KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
3441 the new HashTranslator approach.
3442 (KXMLCore::HashSetTranslatorAdapter::equal): ditto
3443 (KXMLCore::HashSetTranslatorAdapter::translate): ditto
3444 (KXMLCore::::insert): ditto
3445 * kxmlcore/HashTraits.h:
3446 (KXMLCore::GenericHashTraits): This is intended be used as a base class for
3447 customized traits: sensible defaults.
3448 (KXMLCore::): Use it a bunch
3449 (KXMLCore::assignDeleted): template function to allow pairs to be assigned the
3450 deleted value w/o excess copies.
3451 (KXMLCore::PairHashTraits::emptyValue): Updated
3452 (KXMLCore::PairHashTraits::deletedValue): Updated
3453 (KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
3454 (KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
3455 to either use use deletedValue or assignDeletedValue for the cases where we care.
3456 * kxmlcore/RefPtr.h:
3457 (KXMLCore::RefPtr::swap): Added swap method.
3458 (KXMLCore::swap): Added swap free function.
3459 * kjs/identifier.cpp:
3460 (KJS::CStringTranslator::hash): Use new HashTranslator class approach to
3461 alternate type based insertion.
3462 (KJS::CStringTranslator::equal): ditto
3463 (KJS::CStringTranslator::translate): ditto
3464 (KJS::Identifier::add): ditto
3465 (KJS::UCharBufferTranslator::hash): ditto
3466 (KJS::UCharBufferTranslator::equal): ditto
3467 (KJS::UCharBufferTranslator::translate): ditto
3469 - irrelevant change:
3471 * kjs/array_object.cpp:
3472 (ArrayProtoFunc::callAsFunction): Removed a stray space.
3474 2005-12-22 Anders Carlsson <andersca@mac.com>
3476 Reviewed by Eric and Darin.
3478 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
3479 Would like to be able to define prototypes in headers
3482 Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
3483 Also, namespace all macros by prefixing them with KJS_.
3485 2005-12-22 Darin Adler <darin@apple.com>
3489 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6191
3490 RefPtr/PassRefPtr have a leak issue, operator== issues
3492 * kxmlcore/PassRefPtr.h:
3493 (KXMLCore::PassRefPtr::PassRefPtr): Remove non-template constructor that takes RefPtr
3494 since the constructor template that takes RefPtr should be sufficient. Add a constructor
3495 template that takes PassRefPtr&.
3496 (KXMLCore::PassRefPtr::adopt): Use PassRefPtr_Ref to avoid setting pointer first to
3497 0 and then to the pointer.
3498 (KXMLCore::PassRefPtr::operator=): Added template versions that take PassRefPtr& and
3500 (KXMLCore::PassRefPtr::operator PassRefPtr<U>): Changed to fix leak -- old version
3501 would release and then ref.
3502 (KXMLCore::operator==): Make templates have two parameters so you can mix types.
3503 Also remove unneeded const in raw pointer versions.
3504 (KXMLCore::operator!=): Ditto.