1 2005-11-03 Timothy Hatcher <timothy@apple.com>
3 Reviewed by Darin and Vicki.
5 * JavaScriptCore.xcodeproj/project.pbxproj:
6 Change to use $(SYSTEM_LIBRARY_DIR) consistently and place
7 $(NEXT_ROOT) in a few spots to make build-root work.
9 2005-11-03 Geoffrey Garen <ggaren@apple.com>
11 - Updated JavaScriptCore test results to reflect recent fixes.
13 * tests/mozilla/expected.html:
15 2005-11-03 Geoffrey Garen <ggaren@apple.com>
19 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5602
20 REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
22 We now update lastIndex relative to the start of the last match,
23 rather than the start of the last search. We used to assume that
24 the two were equal, but that may not be the case in $ matches.
26 * kjs/regexp_object.cpp:
27 (RegExpProtoFuncImp::callAsFunction):
29 2005-10-24 John Sullivan <sullivan@apple.com>
31 Reviewed by Darin Adler. Code changes by Alexey Proskuryakov.
33 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4931
34 Unicode format characters (Cf) should be removed from JavaScript source
37 include <unicode/uchar.h>
39 use KJS::UChar instead of UChar to avoid ambiguity caused by new include
41 ditto; also, use shift(4) to skip first 4 chars to take advantage of new
44 skip chars of type U_FORMAT_CHAR
45 (Lexer::convertUnicode):
46 use KJS::UChar instead of UChar to avoid ambiguity caused by new include
49 (Lexer::makeIdentifier):
54 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
55 updated to skip soft hyphens
57 2005-10-24 John Sullivan <sullivan@apple.com>
59 Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
61 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4142
62 Date object does not always adjust daylight savings correctly
64 * kjs/date_object.cpp:
66 Fix the case where a time change crosses the daylight savings start/end dates.
68 2005-10-17 Maciej Stachowiak <mjs@apple.com>
70 Reviewed by Geoff. Code changes by Darin.
72 - some micro-optimizations to FastMalloc to reduce math and branches.
74 * kxmlcore/FastMalloc.cpp:
75 (KXMLCore::TCMalloc_Central_FreeList::Populate):
76 (KXMLCore::fastMallocRegisterThread):
77 (KXMLCore::TCMalloc_ThreadCache::GetCache):
78 (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
80 2005-10-15 Maciej Stachowiak <mjs@apple.com>
82 Reverted fix for this bug, because it was part of a time range that caused a performance
85 <rdar://problem/4260481> Remove Reference type from JavaScriptCore
87 2005-10-15 Darin Adler <darin@apple.com>
89 * kxmlcore/HashTable.cpp: Fixed build failure (said hashtable.h instead of HashTable.h).
91 2005-10-14 Geoffrey Garen <ggaren@apple.com>
93 Style changes recommended by Darin.
95 Changed to camelCase, changed ValueImp* to ValueImp *.
97 * kjs/simple_number.h:
98 (KJS::SimpleNumber::make):
99 (KJS::SimpleNumber::value):
101 2005-10-11 Geoffrey Garen <ggaren@apple.com>
103 Added regexp_object.lut.h build phase from JavaScriptCore
104 to JavaScriptCore+SVG.
108 * JavaScriptCore.xcodeproj/project.pbxproj:
110 2005-10-11 Geoffrey Garen <ggaren@apple.com>
112 Fixed build bustage from last checkin (stray characters
113 in the project file).
117 * JavaScriptCore.xcodeproj/project.pbxproj:
119 2005-10-11 Geoffrey Garen <ggaren@apple.com>
121 New JavaScriptCore test results to reflect the last change.
123 * tests/mozilla/expected.html:
125 2005-10-10 Geoffrey Garen <ggaren@apple.com>
127 - Implemented caching of match state inside the global RegExp object
128 (lastParen, leftContext, rightContext, lastMatch, input).
130 exec(), test(), match(), search(), and replace() now dipatch regular
131 expression matching through the RegExp object's performMatch function,
132 to facilitate caching. This replaces registerRegexp and
135 - Implemented the special '$' aliases (e.g. RegExp.input aliases to
138 - Moved support for backreferences into the new static hash table
139 used for other special RegExp properties. Truncated backreferences
140 at $9 to match IE, FF, and the "What's New in Netscape 1.2?" doc.
141 (String.replace still supports double-digit backreferences.)
143 - Tweaked RegExp.prototype.exec to handle ginormous values in lastIndex.
145 Fixes 11 -- count em, 11 -- JavaScriptCore tests.
147 * fast/js/regexp-caching-expected.txt: Added.
148 * fast/js/regexp-caching.html: Added.
152 * JavaScriptCore.xcodeproj/project.pbxproj: Added regexp_object.lut.h
153 * kjs/create_hash_table: Tweaked to allow for more exotic characters.
154 We now rely on the compiler to catch illegal
157 (KJS::RegExp::RegExp):
158 * kjs/regexp_object.cpp:
159 (RegExpProtoFuncImp::callAsFunction):
160 (RegExpObjectImp::RegExpObjectImp):
161 (RegExpObjectImp::performMatch):
162 (RegExpObjectImp::arrayOfMatches):
163 (RegExpObjectImp::backrefGetter):
164 (RegExpObjectImp::getLastMatch):
165 (RegExpObjectImp::getLastParen):
166 (RegExpObjectImp::getLeftContext):
167 (RegExpObjectImp::getRightContext):
168 (RegExpObjectImp::getOwnPropertySlot):
169 (RegExpObjectImp::getValueProperty):
170 (RegExpObjectImp::put):
171 (RegExpObjectImp::putValueProperty):
172 * kjs/regexp_object.h:
173 (KJS::RegExpObjectImp::):
174 * kjs/string_object.cpp:
175 (substituteBackreferences):
177 (StringProtoFuncImp::callAsFunction):
179 2005-10-09 Darin Adler <darin@apple.com>
181 Reviewed by Maciej; some changes done after review.
183 - fixed <rdar://problem/4092064> hanging loading page; rte.ie (works in IE and Firefox)
184 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5280
185 Date.setMonth fails with negative values
186 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5154
187 JSC should switch to _r variants of unix time/date functions
188 - fixed a few possible overflow cases
190 Retested all tests to be sure nothing broke; added layout test for bug 5280.
192 * kjs/config.h: Removed TIME_WITH_SYS_TIME define. Also set HAVE_SYS_TIMEB_H
193 for the __APPLE__ case (the latter is accurate but irrelevant).
195 * kjs/date_object.h: Reformatted. Removed unnecessary include of "function_object.h".
196 Moved declarations of helper classes and functions into the cpp file.
198 * kjs/date_object.cpp: Removed code at top to define macros to use CoreFoundation instead of
199 POSIX date functions.
200 (KJS::styleFromArgString): Tweaked to return early instead of using a variable.
201 (KJS::formatLocaleDate): Tweaked to check for undefined rather than checking argument count.
202 (KJS::formatDate): Made parameter const.
203 (KJS::formatDateUTCVariant): Ditto.
204 (KJS::formatTime): Ditto.
205 (KJS::DateProtoFuncImp::callAsFunction): Use gmtime_r and localtime_r instead of gmtime and
207 (KJS::DateObjectImp::callAsFunction): Use localtime_r instead of localtime.
208 (KJS::ymdhmsToSeconds): Renamed from ymdhms_to_seconds. Changed computation to avoid possible
209 overflow if year is an extremely large or small number.
210 (KJS::makeTime): Removed code to move large month numbers from tm_mon to tm_year; this was
211 to accomodate CFGregorianDate, which is no longer used (and didn't handle negative values).
212 (KJS::parseDate): Renamed from KRFCDate_parseDate; changed to return a value in milliseconds
213 rather than in seconds. Reformatted the code. Changed to use UTF8String() instead of ascii(),
214 since ascii() is not thread safe. Changed some variables back from int to long to avoid
215 trouble if the result of strtol does not fit in an int (64-bit issue only).
217 2005-10-08 Mitz Pettel <opendarwin.org@mitzpettel.com>
220 Tweaked and landed by Darin.
222 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5266
223 Support parenthesized comments in Date.parse()
225 * kjs/date_object.cpp:
226 (KJS::skipSpacesAndComments): Take a pointer, and advance it past spaces,
227 and also past anything enclosed in parentheses.
228 (KJS::KRFCDate_parseDate): Use skipSpacesAndComments wherever we formerly had
231 2005-10-08 Justin Haygood <justin@xiondigital.net>
233 Reviewed, tweaked, and landed by Darin.
235 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5189
236 pcre_exec.c fails to compile using MSVC
237 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5190
238 KJS config.h adjustment for Win32
240 * kjs/config.h: Make sure HAVE_MMAP and HAVE_SBRK are off for Win32.
241 Turn HAVE_ERRNO_H on for Mac OS X. Sort defines so they are easy to compare
242 with each other. Remove #undef of DEBUG_COLLECTOR.
243 * pcre/pcre_exec.c: (match): Work around strange MSVC complaint by splitting
244 the definition of a local variable into a separate declaration and
247 2005-10-05 Geoffrey Garen <ggaren@apple.com>
249 - Darin and I rewrote our implementation of the SimpleNumber class
250 to store number bit patterns in their floating point formats.
252 My tweaks reviewed by Darin.
254 ~1% speedup on JS iBench.
256 * kjs/internal.h: removed obsolete jsNumber declarations.
257 * kjs/math_object.cpp:
258 (MathFuncImp::callAsFunction): changed KJS::isNaN to isNaN
260 (PostfixResolveNode::evaluate): removed obsolete knownToBeInteger
261 (PostfixBracketNode::evaluate): ditto
262 (PostfixDotNode::evaluate): ditto
263 (PrefixResolveNode::evaluate): ditto
264 (PrefixBracketNode::evaluate): ditto
265 (PrefixDotNode::evaluate): ditto
266 (NegateNode::evaluate): ditto
267 (valueForReadModifyAssignment): ditto
268 * kjs/number_object.cpp: removed obsolete comment
269 * kjs/operations.cpp:
270 (KJS::equal): removed unnecessary isNaN checks
271 (KJS::strictEqual): ditto
272 (KJS::add): removed obsolete knownToBeInteger
274 * kjs/operations.h: removed include of "value.h" to prevent circular reference
275 * kjs/simple_number.h: removed unnecessary #includes
276 (KJS::SimpleNumber::make): see above
277 (KJS::SimpleNumber::is): ditto
278 (KJS::SimpleNumber::value): ditto
279 * kjs/string_object.cpp:
280 (StringProtoFuncImp::callAsFunction): changed KJS::isNaN to isNaN
281 * kjs/ustring.cpp: removed unnecessary isNaN check
282 (KJS::UString::toUInt32): ditto
284 (KJS::jsNumber): removed obsolete jsNumber definitions
285 (KJS::ConstantValues::init): NaN is no longer a ConstantValue
286 (KJS::ConstantValues::clear): ditto
287 (KJS::ConstantValues::mark): ditto
288 * kjs/value.h: removed obsolete knownToBeInteger
289 (KJS::jsNaN): now returns a SimpleNumber
290 (KJS::ValueImp::getUInt32): changed to account for NaN being a SimpleNumber
291 (KJS::ValueImp::toBoolean): ditto
292 (KJS::ValueImp::toString): changed to account for +/- 0.0
293 (KJS::jsZero): changed to reflect that SimpleNumber::make takes a double
296 (KJS::Number): removed obsolete non-double constructor declarations
298 2005-10-05 Maciej Stachowiak <mjs@apple.com>
302 - fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
304 Also fixed some bugs with for..in enumeration while I was at it. object
305 properties now come before prototype properties and duplicates
306 between object and prototype are listed only once.
308 * JavaScriptCore.xcodeproj/project.pbxproj:
309 * kjs/IdentifierSequencedSet.cpp: Added.
310 (KJS::IdentifierSequencedSet::IdentifierSequencedSet):
311 (KJS::IdentifierSequencedSet::deallocateVector):
312 (KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
313 (KJS::IdentifierSequencedSet::insert):
314 * kjs/IdentifierSequencedSet.h: Added.
315 (KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
316 (KJS::IdentifierSequencedSetIterator::operator*):
317 (KJS::IdentifierSequencedSetIterator::operator->):
318 (KJS::IdentifierSequencedSetIterator::operator++):
319 (KJS::IdentifierSequencedSetIterator::operator==):
320 (KJS::IdentifierSequencedSetIterator::operator!=):
321 (KJS::IdentifierSequencedSet::begin):
322 (KJS::IdentifierSequencedSet::end):
323 (KJS::IdentifierSequencedSet::size):
324 * kjs/array_instance.h:
325 * kjs/array_object.cpp:
326 (ArrayInstanceImp::getPropertyNames):
327 (ArrayInstanceImp::setLength):
328 (ArrayInstanceImp::pushUndefinedObjectsToEnd):
330 (ForInNode::execute):
333 (KJS::ObjectImp::getPropertyNames):
335 * kjs/property_map.cpp:
336 (KJS::PropertyMap::getEnumerablePropertyNames):
337 (KJS::PropertyMap::getSparseArrayPropertyNames):
338 * kjs/property_map.h:
340 * kjs/protected_reference.h: Removed.
341 * kjs/reference.cpp: Removed.
342 * kjs/reference.h: Removed.
343 * kjs/reference_list.cpp: Removed.
344 * kjs/reference_list.h: Removed.
346 (KJS::UString::impl):
347 * kxmlcore/HashSet.h:
349 2005-10-04 Eric Seidel <eseidel@apple.com>
353 Code cleanup, which resulted in a small win on iBench.
356 (KJS::tryGetAndCallProperty): new static inline
357 (KJS::ObjectImp::defaultValue): code cleanup
359 2005-10-03 Maciej Stachowiak <mjs@apple.com>
361 Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
363 - more Linux build fixes
365 * kjs/operations.cpp:
366 * kxmlcore/FastMalloc.h:
367 * kxmlcore/TCSystemAlloc.cpp:
368 (TCMalloc_SystemAlloc):
370 2005-10-03 Maciej Stachowiak <mjs@apple.com>
372 Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
374 http://bugzilla.opendarwin.org/show_bug.cgi?id=5174
375 Add support for compiling on Linux (likely to help for other POSIX systems too)
378 (KJS::Collector::markCurrentThreadConservatively):
379 (KJS::Collector::markOtherThreadConservatively):
381 * kjs/date_object.cpp:
383 (KJS::formatDateUTCVariant):
385 (KJS::timeZoneOffset):
386 (KJS::DateProtoFuncImp::callAsFunction):
387 (KJS::DateObjectImp::construct):
388 (KJS::DateObjectImp::callAsFunction):
390 * kjs/identifier.cpp:
392 (KJS::initializeInterpreterLock):
393 (KJS::lockInterpreter):
394 (KJS::unlockInterpreter):
395 (KJS::UndefinedImp::toPrimitive):
396 (KJS::UndefinedImp::toBoolean):
397 (KJS::UndefinedImp::toNumber):
398 (KJS::UndefinedImp::toString):
399 (KJS::NullImp::toPrimitive):
400 (KJS::NullImp::toBoolean):
401 (KJS::NullImp::toNumber):
402 (KJS::NullImp::toString):
403 (KJS::BooleanImp::toPrimitive):
404 (KJS::BooleanImp::toBoolean):
405 (KJS::BooleanImp::toNumber):
406 (KJS::BooleanImp::toString):
407 (KJS::StringImp::toPrimitive):
408 (KJS::StringImp::toBoolean):
409 (KJS::StringImp::toNumber):
410 (KJS::StringImp::toString):
412 * kjs/protected_values.cpp:
414 2005-10-03 Maciej Stachowiak <mjs@apple.com>
416 - fix Development build after last checkin
418 * kxmlcore/FastMalloc.cpp:
419 (KXMLCore::fastMallocRegisterThread):
421 2005-10-02 Maciej Stachowiak <mjs@apple.com>
425 <rdar://problem/4283967> REGRESSION: 3% regression on PLT from new FastMalloc
426 http://bugzilla.opendarwin.org/show_bug.cgi?id=5243
428 A number of optimizations to the new threadsafe malloc that make it actually as fast
429 as dlmalloc (I measured wrong before) and as memory-efficient as the system malloc.
431 - use fastMalloc for everything - it now gets applied to all new/delete allocations
432 via a private inline operator new that is now included into every file via config.h.
434 - tweaked some of the numeric parameters for size classes and amount of wasted memory
435 allowed per allocation - this saves on memory use and consequently improves speed.
437 - so long as the allocator is not being used on background threads, get the per-thread
438 cache from a global variable instead of from pthread_getspecific, since the latter is slow.
440 - inline more functions, and force the ones GCC refuses to inline with
441 attribute(always_inline), nearly all of these have one call site so inlining them has
444 - use some tricks to calculate allocation size more efficiently and fewer times for small
445 allocations, to avoid hitting the huge size table array.
447 - avoid hitting the per-thread cache on code paths that don't need it.
449 - implement inline assembly version of spinlock for PowerPC (was already done for x86)
451 * bindings/NP_jsobject.cpp:
452 * bindings/c/c_class.cpp:
453 * bindings/c/c_instance.cpp:
454 * bindings/c/c_runtime.cpp:
455 * bindings/c/c_utility.cpp:
456 * bindings/jni/jni_class.cpp:
457 * bindings/jni/jni_instance.cpp:
458 * bindings/jni/jni_jsobject.cpp:
459 * bindings/jni/jni_objc.mm:
460 * bindings/jni/jni_runtime.cpp:
461 * bindings/jni/jni_utility.cpp:
462 * bindings/npruntime.cpp:
463 * bindings/objc/WebScriptObject.mm:
464 * bindings/objc/objc_class.mm:
465 * bindings/objc/objc_instance.mm:
466 * bindings/objc/objc_runtime.mm:
467 * bindings/objc/objc_utility.mm:
468 * bindings/runtime.cpp:
469 * bindings/runtime_array.cpp:
470 * bindings/runtime_method.cpp:
471 * bindings/runtime_object.cpp:
472 * bindings/runtime_root.cpp:
473 * bindings/testbindings.cpp:
474 * bindings/testbindings.mm:
475 * kjs/array_object.cpp:
476 (ArrayInstanceImp::ArrayInstanceImp):
477 (ArrayInstanceImp::~ArrayInstanceImp):
478 (ArrayInstanceImp::resizeStorage):
479 * kjs/bool_object.cpp:
481 (KJS::Collector::registerThread):
484 * kjs/error_object.cpp:
486 * kjs/function_object.cpp:
487 * kjs/identifier.cpp:
488 (KJS::Identifier::rehash):
490 (KJS::Parser::saveNewNode):
491 (KJS::clearNewNodes):
492 * kjs/interpreter.cpp:
494 (Lexer::doneParsing):
495 (Lexer::makeIdentifier):
496 (Lexer::makeUString):
498 * kjs/math_object.cpp:
501 * kjs/nodes2string.cpp:
502 * kjs/number_object.cpp:
503 (integer_part_noexp):
506 * kjs/object_object.cpp:
507 * kjs/property_map.cpp:
508 * kjs/property_slot.cpp:
509 * kjs/protected_values.cpp:
510 (KJS::ProtectedValues::rehash):
512 * kjs/reference_list.cpp:
514 * kjs/regexp_object.cpp:
515 * kjs/scope_chain.cpp:
517 * kjs/string_object.cpp:
521 * kxmlcore/Assertions.mm:
522 * kxmlcore/FastMalloc.cpp:
523 (KXMLCore::InitSizeClasses):
524 (KXMLCore::DLL_IsEmpty):
525 (KXMLCore::DLL_Prepend):
526 (KXMLCore::TCMalloc_Central_FreeList::Insert):
527 (KXMLCore::TCMalloc_Central_FreeList::Remove):
528 (KXMLCore::TCMalloc_Central_FreeList::Populate):
529 (KXMLCore::TCMalloc_ThreadCache::Allocate):
530 (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
531 (KXMLCore::fastMallocRegisterThread):
532 (KXMLCore::TCMalloc_ThreadCache::GetCache):
533 (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
534 (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
535 (KXMLCore::do_malloc):
538 * kxmlcore/FastMalloc.h:
543 * kxmlcore/HashTable.cpp:
544 * kxmlcore/TCSpinLock.h:
545 (TCMalloc_SpinLock::Lock):
546 (TCMalloc_SpinLock::Unlock):
548 * kxmlcore/TCSystemAlloc.cpp:
550 2005-09-30 Geoffrey Garen <ggaren@apple.com>
552 - Second cut at fixing <rdar://problem/4275206> Denver Regression: Seed:
553 Past Editions of Opinions display "NAN/Undefined" for www.washingtonpost.com
557 * kjs/date_object.cpp:
558 (KJS::KRFCDate_parseDate): Intead of creating a timezone when one isn't specified,
559 just rely on the fallback logic, which will do it for you. Also, return invalidDate
560 if the date includes trailing garbage. (Somewhat accidentally, the timezone logic
561 used to catch trailing garbage.)
563 Added test case to fast/js/date-parse-test.html.
565 2005-09-29 Eric Seidel <eseidel@apple.com>
566 Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
570 Fix JSC memory smasher in TOT.
571 http://bugzilla.opendarwin.org/show_bug.cgi?id=5176
576 2005-09-29 Eric Seidel <eseidel@apple.com>
577 Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
581 * JavaScriptCore.xcodeproj/project.pbxproj:
582 Build fix for JSC+SVG after 5161.
583 http://bugzilla.opendarwin.org/show_bug.cgi?id=5179
585 2005-09-28 Geoffrey Garen <ggaren@apple.com>
587 - Fixed <rdar://problem/4275206> Denver Regression: Seed: Past Editions of Opinions display
588 "NAN/Undefined" for www.washingtonpost.com
592 * kjs/date_object.cpp:
593 (KJS::KRFCDate_parseDate): If the timezone isn't specified, rather than returning
594 invalidDate, substitute the local timezone. This matches the behavior of FF/IE.
596 2005-09-28 Maciej Stachowiak <mjs@apple.com>
598 Patch from George Staikos, reviewed by me.
600 - fixed some compile issues on Linux
602 * kjs/property_slot.h:
603 * kjs/simple_number.h:
605 2005-09-27 Maciej Stachowiak <mjs@apple.com>
609 - move HashMap/HashSet code down to JavaScriptCore
610 http://bugzilla.opendarwin.org/show_bug.cgi?id=5161
612 * JavaScriptCore.xcodeproj/project.pbxproj:
614 (KJS::interpreterMap): Function that fetches the interpreter map on demand.
615 (KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
616 class with an appropriate HashMap.
617 (KJS::InterpreterImp::clear): ditto
618 (KJS::InterpreterImp::interpreterWithGlobalObject): ditto
619 * kjs/interpreter_map.cpp: Removed.
620 * kjs/interpreter_map.h: Removed.
622 The HashMap/HashSet code (copied and slightly tweaked from WebCore)
624 * kxmlcore/HashFunctions.h: Added.
628 (KXMLCore::PointerHash::hash):
629 (KXMLCore::PointerHash::equal):
630 * kxmlcore/HashMap.h: Added.
631 (KXMLCore::extractFirst):
632 (KXMLCore::HashMap::HashMap):
634 (KXMLCore::::capacity):
635 (KXMLCore::::isEmpty):
639 (KXMLCore::::contains):
642 (KXMLCore::::remove):
644 (KXMLCore::deleteAllValues):
645 * kxmlcore/HashMapPtrSpec.h: Added.
646 (KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
647 (KXMLCore::PointerHashIteratorAdapter::operator*):
648 (KXMLCore::PointerHashIteratorAdapter::operator->):
649 (KXMLCore::PointerHashIteratorAdapter::operator++):
650 (KXMLCore::PointerHashIteratorAdapter::operator==):
651 (KXMLCore::PointerHashIteratorAdapter::operator!=):
652 (KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
653 (KXMLCore::PointerHashConstIteratorAdapter::operator*):
654 (KXMLCore::PointerHashConstIteratorAdapter::operator->):
655 (KXMLCore::PointerHashConstIteratorAdapter::operator++):
656 (KXMLCore::PointerHashConstIteratorAdapter::operator==):
657 (KXMLCore::PointerHashConstIteratorAdapter::operator!=):
659 * kxmlcore/HashSet.h: Added.
660 (KXMLCore::identityExtract):
661 (KXMLCore::convertAdapter):
662 (KXMLCore::HashSet::HashSet):
664 (KXMLCore::::capacity):
665 (KXMLCore::::isEmpty):
669 (KXMLCore::::contains):
670 (KXMLCore::::insert):
671 (KXMLCore::::remove):
673 * kxmlcore/HashTable.cpp: Added.
674 (KXMLCore::HashTableStats::~HashTableStats):
675 (KXMLCore::HashTableStats::recordCollisionAtCount):
676 * kxmlcore/HashTable.h: Added.
677 (KXMLCore::HashTableIterator::skipEmptyBuckets):
678 (KXMLCore::HashTableIterator::HashTableIterator):
679 (KXMLCore::HashTableIterator::operator*):
680 (KXMLCore::HashTableIterator::operator->):
681 (KXMLCore::HashTableIterator::operator++):
682 (KXMLCore::HashTableIterator::operator==):
683 (KXMLCore::HashTableIterator::operator!=):
684 (KXMLCore::HashTableConstIterator::HashTableConstIterator):
685 (KXMLCore::HashTableConstIterator::operator*):
686 (KXMLCore::HashTableConstIterator::operator->):
687 (KXMLCore::HashTableConstIterator::skipEmptyBuckets):
688 (KXMLCore::HashTableConstIterator::operator++):
689 (KXMLCore::HashTableConstIterator::operator==):
690 (KXMLCore::HashTableConstIterator::operator!=):
691 (KXMLCore::HashTable::HashTable):
692 (KXMLCore::HashTable::~HashTable):
693 (KXMLCore::HashTable::begin):
694 (KXMLCore::HashTable::end):
695 (KXMLCore::HashTable::size):
696 (KXMLCore::HashTable::capacity):
697 (KXMLCore::HashTable::insert):
698 (KXMLCore::HashTable::isEmptyBucket):
699 (KXMLCore::HashTable::isDeletedBucket):
700 (KXMLCore::HashTable::isEmptyOrDeletedBucket):
701 (KXMLCore::HashTable::hash):
702 (KXMLCore::HashTable::equal):
703 (KXMLCore::HashTable::identityConvert):
704 (KXMLCore::HashTable::extractKey):
705 (KXMLCore::HashTable::lookup):
706 (KXMLCore::HashTable::shouldExpand):
707 (KXMLCore::HashTable::mustRehashInPlace):
708 (KXMLCore::HashTable::shouldShrink):
709 (KXMLCore::HashTable::shrink):
710 (KXMLCore::HashTable::clearBucket):
711 (KXMLCore::HashTable::deleteBucket):
712 (KXMLCore::HashTable::makeLookupResult):
713 (KXMLCore::HashTable::makeIterator):
714 (KXMLCore::HashTable::makeConstIterator):
715 (KXMLCore::::lookup):
716 (KXMLCore::::insert):
717 (KXMLCore::::reinsert):
719 (KXMLCore::::contains):
720 (KXMLCore::::remove):
721 (KXMLCore::::allocateTable):
722 (KXMLCore::::expand):
723 (KXMLCore::::rehash):
725 (KXMLCore::::HashTable):
727 (KXMLCore::::operator):
728 (KXMLCore::::checkTableConsistency):
729 (KXMLCore::::checkTableConsistencyExceptSize):
730 * kxmlcore/HashTraits.h: Added.
731 (KXMLCore::HashTraits::emptyValue):
733 (KXMLCore::PairHashTraits::emptyValue):
734 (KXMLCore::PairHashTraits::deletedValue):
736 2005-09-27 Darin Adler <darin@apple.com>
740 - update grammar to fix conflicts; fixes one of our test cases
741 because it resolves the relationship between function expressions
742 and declarations in the way required by the ECMA specification
744 * kjs/grammar.y: Added lots of new grammar rules so we have no conflicts.
745 A new set of rules for "no bracket or function at start of expression" and
746 another set of rules for "no in anywhere in expression". Also simplified the
747 handling of try to use only a single node and used operator precedence to
748 get rid of the conflict in handling of if and else. Also used a macro to
749 streamline the handling of automatic semicolons and changed parenthesis
750 handling to use a virtual function.
752 * kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement.
753 (KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead
754 of using a special node for each.
756 (Node::createErrorCompletion): Added. Used instead of throwError when creating errors
757 that should not be in a completion rather than an ExecState.
758 (Node::throwUndefinedVariableError): Added. Sets source location unlike the call it
760 (Node::nodeInsideAllParens): Added.
761 (GroupNode::nodeInsideAllParens): Added.
762 (StatListNode::execute): Removed code to move exceptions into completion objects;
763 that's now done solely by the KJS_CHECKEXCEPTION macro.
764 (TryNode::execute): Include execution of catch and finally here rather than using
766 (FuncDeclNode::execute): Moved here, no longer inline.
767 * kjs/nodes2string.cpp:
768 (TryNode::streamTo): Updated for change.
769 (FuncDeclNode::streamTo): Ditto.
770 (FuncExprNode::streamTo): Ditto.
772 * kjs/kjs-test: Removed. Was part of "make check".
773 * kjs/kjs-test.chk: Ditto.
774 * kjs/test.js: Ditto.
776 * tests/mozilla/expected.html: Updated because one more test succeeds.
778 2005-09-27 Adele Peterson <adele@apple.com>
782 Changed ints to size_t where appropriate.
785 (KJS::Collector::allocate):
786 (KJS::Collector::markStackObjectsConservatively):
787 (KJS::Collector::collect):
788 (KJS::Collector::size):
789 (KJS::Collector::numInterpreters):
790 (KJS::Collector::numGCNotAllowedObjects):
791 (KJS::Collector::numReferencedObjects):
794 2005-09-27 Eric Seidel <eseidel@apple.com>
798 * JavaScriptCore.xcodeproj/project.pbxproj: fix after malloc changes.
800 2005-09-27 Eric Seidel <eseidel@apple.com>
805 (FuncExprNode::evaluate): Now sets .constructor properly.
806 Test cases added to WebCore/layout-tests.
807 http://bugzilla.opendarwin.org/show_bug.cgi?id=3537
809 2005-09-26 Maciej Stachowiak <mjs@apple.com>
813 - replace dlmalloc with tcmalloc
814 http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
816 I also moved SharedPtr and the assertion code from WebCore into a
817 new kxmlcore directory.
819 * JavaScriptCore.xcodeproj/project.pbxproj:
821 (KJS::Collector::allocate):
822 (KJS::Collector::collect):
824 * kjs/fast_malloc.cpp: Removed.
825 * kjs/fast_malloc.h: Removed.
828 * kjs/function_object.cpp:
829 * kjs/identifier.cpp:
830 (KJS::Identifier::add):
834 * kjs/nodes2string.cpp:
835 * kjs/property_map.cpp:
836 (KJS::PropertyMap::~PropertyMap):
837 (KJS::PropertyMap::rehash):
839 * kjs/shared_ptr.h: Removed.
840 * kjs/string_object.cpp:
841 (StringObjectFuncImp::callAsFunction):
843 (KJS::UString::Rep::createCopying):
844 (KJS::UString::Rep::destroy):
845 (KJS::UString::expandCapacity):
846 (KJS::UString::expandPreCapacity):
847 (KJS::UString::UString):
848 (KJS::UString::spliceSubstringsWithSeparators):
849 (KJS::UString::append):
850 (KJS::UString::operator=):
851 (KJS::UString::detach):
853 * kxmlcore/Assertions.h: Added.
854 * kxmlcore/Assertions.mm: Added.
855 * kxmlcore/FastMalloc.cpp: Added.
857 (KXMLCore::SizeClass):
858 (KXMLCore::ByteSizeForClass):
859 (KXMLCore::InitSizeClasses):
860 (KXMLCore::MetaDataAlloc):
861 (KXMLCore::PageHeapAllocator::Init):
862 (KXMLCore::PageHeapAllocator::New):
863 (KXMLCore::PageHeapAllocator::Delete):
864 (KXMLCore::PageHeapAllocator::inuse):
866 (KXMLCore::AllocationSize):
869 (KXMLCore::DeleteSpan):
870 (KXMLCore::DLL_Init):
871 (KXMLCore::DLL_Remove):
872 (KXMLCore::DLL_IsEmpty):
873 (KXMLCore::DLL_Length):
874 (KXMLCore::DLL_Print):
875 (KXMLCore::DLL_Prepend):
876 (KXMLCore::DLL_InsertOrdered):
878 (KXMLCore::TCMalloc_PageHeap::GetDescriptor):
879 (KXMLCore::TCMalloc_PageHeap::SystemBytes):
880 (KXMLCore::TCMalloc_PageHeap::FreeBytes):
881 (KXMLCore::TCMalloc_PageHeap::RecordSpan):
882 (KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
883 (KXMLCore::TCMalloc_PageHeap::New):
884 (KXMLCore::TCMalloc_PageHeap::Split):
885 (KXMLCore::TCMalloc_PageHeap::Carve):
886 (KXMLCore::TCMalloc_PageHeap::Delete):
887 (KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
888 (KXMLCore::TCMalloc_PageHeap::Dump):
889 (KXMLCore::TCMalloc_PageHeap::GrowHeap):
890 (KXMLCore::TCMalloc_PageHeap::Check):
891 (KXMLCore::TCMalloc_PageHeap::CheckList):
892 (KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
893 (KXMLCore::TCMalloc_ThreadCache_FreeList::length):
894 (KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
895 (KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
896 (KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
897 (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
898 (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
899 (KXMLCore::TCMalloc_ThreadCache::freelist_length):
900 (KXMLCore::TCMalloc_ThreadCache::Size):
901 (KXMLCore::TCMalloc_Central_FreeList::length):
902 (KXMLCore::TCMalloc_Central_FreeList::Init):
903 (KXMLCore::TCMalloc_Central_FreeList::Insert):
904 (KXMLCore::TCMalloc_Central_FreeList::Remove):
905 (KXMLCore::TCMalloc_Central_FreeList::Populate):
906 (KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
907 (KXMLCore::TCMalloc_ThreadCache::Init):
908 (KXMLCore::TCMalloc_ThreadCache::Cleanup):
909 (KXMLCore::TCMalloc_ThreadCache::Allocate):
910 (KXMLCore::TCMalloc_ThreadCache::Deallocate):
911 (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
912 (KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
913 (KXMLCore::TCMalloc_ThreadCache::Scavenge):
914 (KXMLCore::TCMalloc_ThreadCache::GetCache):
915 (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
916 (KXMLCore::TCMalloc_ThreadCache::PickNextSample):
917 (KXMLCore::TCMalloc_ThreadCache::InitModule):
918 (KXMLCore::TCMalloc_ThreadCache::InitTSD):
919 (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
920 (KXMLCore::TCMalloc_ThreadCache::DeleteCache):
921 (KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
922 (KXMLCore::TCMalloc_ThreadCache::Print):
923 (KXMLCore::ExtractStats):
924 (KXMLCore::DumpStats):
925 (KXMLCore::PrintStats):
926 (KXMLCore::DumpStackTraces):
927 (KXMLCore::TCMallocImplementation::GetStats):
928 (KXMLCore::TCMallocImplementation::ReadStackTraces):
929 (KXMLCore::TCMallocImplementation::GetNumericProperty):
930 (KXMLCore::TCMallocImplementation::SetNumericProperty):
931 (KXMLCore::DoSampledAllocation):
932 (KXMLCore::do_malloc):
934 (KXMLCore::do_memalign):
935 (KXMLCore::TCMallocGuard::TCMallocGuard):
936 (KXMLCore::TCMallocGuard::~TCMallocGuard):
942 (KXMLCore::memalign):
943 (KXMLCore::posix_memalign):
946 (KXMLCore::malloc_stats):
948 (KXMLCore::mallinfo):
949 * kxmlcore/FastMalloc.h: Added.
950 (KXMLCore::FastAllocated::operator new):
951 (KXMLCore::FastAllocated::operator delete):
952 (KXMLCore::FastAllocated::operator new[]):
953 (KXMLCore::FastAllocated::operator delete[]):
954 * kxmlcore/SharedPtr.h: Added.
955 (KXMLCore::SharedPtr::SharedPtr):
956 (KXMLCore::SharedPtr::~SharedPtr):
957 (KXMLCore::SharedPtr::isNull):
958 (KXMLCore::SharedPtr::notNull):
959 (KXMLCore::SharedPtr::reset):
960 (KXMLCore::SharedPtr::get):
961 (KXMLCore::SharedPtr::operator*):
962 (KXMLCore::SharedPtr::operator->):
963 (KXMLCore::SharedPtr::operator!):
964 (KXMLCore::SharedPtr::operator bool):
965 (KXMLCore::::operator):
966 (KXMLCore::operator==):
967 (KXMLCore::operator!=):
968 (KXMLCore::static_pointer_cast):
969 (KXMLCore::const_pointer_cast):
970 * kxmlcore/TCPageMap.h: Added.
971 (TCMalloc_PageMap1::TCMalloc_PageMap1):
972 (TCMalloc_PageMap1::Ensure):
973 (TCMalloc_PageMap1::get):
974 (TCMalloc_PageMap1::set):
975 (TCMalloc_PageMap2::TCMalloc_PageMap2):
976 (TCMalloc_PageMap2::get):
977 (TCMalloc_PageMap2::set):
978 (TCMalloc_PageMap2::Ensure):
979 (TCMalloc_PageMap3::NewNode):
980 (TCMalloc_PageMap3::TCMalloc_PageMap3):
981 (TCMalloc_PageMap3::get):
982 (TCMalloc_PageMap3::set):
983 (TCMalloc_PageMap3::Ensure):
984 * kxmlcore/TCSpinLock.h: Added.
985 (TCMalloc_SpinLock::Init):
986 (TCMalloc_SpinLock::Finalize):
987 (TCMalloc_SpinLock::Lock):
988 (TCMalloc_SpinLock::Unlock):
990 (TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
991 (TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
992 * kxmlcore/TCSystemAlloc.cpp: Added.
996 (TCMalloc_SystemAlloc):
997 * kxmlcore/TCSystemAlloc.h: Added.
999 2005-09-23 Maciej Stachowiak <mjs@apple.com>
1003 <rdar://problem/4260479> Finish deploying PropertySlot in the interpreter
1004 http://bugzilla.opendarwin.org/show_bug.cgi?id=5112
1006 Convert postfix, prefix, delete, prefix, and for..in expressions to use
1007 PropertySlot-based lookup instead of evaluateReference.
1009 3% speedup on JS iBench.
1011 Fixed two of the JS tests:
1012 * tests/mozilla/expected.html:
1016 (PostfixResolveNode::evaluate):
1017 (PostfixBracketNode::evaluate):
1018 (PostfixDotNode::evaluate):
1019 (DeleteResolveNode::evaluate):
1020 (DeleteBracketNode::evaluate):
1021 (DeleteDotNode::evaluate):
1022 (DeleteValueNode::evaluate):
1023 (typeStringForValue):
1024 (TypeOfResolveNode::evaluate):
1025 (TypeOfValueNode::evaluate):
1026 (PrefixResolveNode::evaluate):
1027 (PrefixBracketNode::evaluate):
1028 (PrefixDotNode::evaluate):
1029 (ForInNode::execute):
1031 (KJS::PostfixResolveNode::PostfixResolveNode):
1032 (KJS::PostfixBracketNode::PostfixBracketNode):
1033 (KJS::PostfixDotNode::PostfixDotNode):
1034 (KJS::DeleteResolveNode::DeleteResolveNode):
1035 (KJS::DeleteBracketNode::DeleteBracketNode):
1036 (KJS::DeleteDotNode::DeleteDotNode):
1037 (KJS::DeleteValueNode::DeleteValueNode):
1038 (KJS::TypeOfResolveNode::TypeOfResolveNode):
1039 (KJS::TypeOfValueNode::TypeOfValueNode):
1040 (KJS::PrefixResolveNode::PrefixResolveNode):
1041 (KJS::PrefixBracketNode::PrefixBracketNode):
1042 (KJS::PrefixDotNode::PrefixDotNode):
1043 * kjs/nodes2string.cpp:
1044 (PostfixResolveNode::streamTo):
1045 (PostfixBracketNode::streamTo):
1046 (PostfixDotNode::streamTo):
1047 (DeleteResolveNode::streamTo):
1048 (DeleteBracketNode::streamTo):
1049 (DeleteDotNode::streamTo):
1050 (DeleteValueNode::streamTo):
1051 (TypeOfValueNode::streamTo):
1052 (TypeOfResolveNode::streamTo):
1053 (PrefixResolveNode::streamTo):
1054 (PrefixBracketNode::streamTo):
1055 (PrefixDotNode::streamTo):
1056 * kjs/reference.cpp:
1057 (KJS::Reference::Reference):
1058 (KJS::Reference::getPropertyName):
1059 (KJS::Reference::getValue):
1060 (KJS::Reference::deleteValue):
1063 2005-09-23 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1065 Reviewed and landed by Darin.
1067 - a Windows-specific file
1069 * os-win32/stdint.h: Added. We plan to remove dependency on the <stdint.h> types,
1070 and if we do so, we will remove this file.
1072 2005-09-22 Geoffrey Garen <ggaren@apple.com>
1074 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
1075 Need to restore int/long changes to simple_number.h
1077 Reviewed by darin and mjs.
1079 * kjs/simple_number.h: changed enums to indenpendent constants to clarify types
1080 (KJS::isNegativeZero): changed to static function - no reason to export
1081 (KJS::SimpleNumber::rightShiftSignExtended): new function for clarity
1082 (KJS::SimpleNumber::make): specified cast as reinterpret_cast
1083 (KJS::SimpleNumber::is): changed to use uintptr_t for portability
1084 (KJS::SimpleNumber::value): changed to use uintptr_t and rightShiftSignExtended
1085 (KJS::SimpleNumber::fits): inverted tests - probably only a performance win for double
1086 (KJS::SimpleNumber::integerFits): ditto
1088 2005-09-20 Maciej Stachowiak <mjs@apple.com>
1090 Reviewed by Geoff and partly by Darin.
1092 - fixed http://bugzilla.opendarwin.org/post_bug.cgi
1093 (Reduce conflicts in JavaScriptCore grammar)
1095 This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
1096 9 shift/reduce and 45 reduce/reduce.
1099 * kjs/grammar_types.h: Removed.
1102 (KJS::Node::isGroupNode):
1103 (KJS::Node::isLocation):
1104 (KJS::Node::isResolveNode):
1105 (KJS::Node::isBracketAccessorNode):
1106 (KJS::Node::isDotAccessorNode):
1107 (KJS::ResolveNode::isLocation):
1108 (KJS::ResolveNode::isResolveNode):
1109 (KJS::ResolveNode::identifier):
1110 (KJS::GroupNode::isGroupNode):
1111 (KJS::GroupNode::leafNode):
1112 (KJS::BracketAccessorNode::isLocation):
1113 (KJS::BracketAccessorNode::isBracketAccessorNode):
1114 (KJS::BracketAccessorNode::base):
1115 (KJS::BracketAccessorNode::subscript):
1116 (KJS::DotAccessorNode::isLocation):
1117 (KJS::DotAccessorNode::isDotAccessorNode):
1118 (KJS::DotAccessorNode::base):
1119 (KJS::DotAccessorNode::identifier):
1120 (KJS::FuncExprNode::FuncExprNode):
1121 (KJS::FuncExprNode::identifier):
1122 (KJS::FuncDeclNode::FuncDeclNode):
1123 (KJS::FuncDeclNode::execute):
1125 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1127 - Oops. The 4263434 change was only appropriate on the branch. Rolling out.
1132 (KJS::InterpreterImp::mark):
1134 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1136 - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
1137 kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
1140 Added InterpreterLocks in some places in the bindings we missed before.
1144 * bindings/runtime_root.cpp:
1145 (KJS::Bindings::addNativeReference):
1146 (KJS::Bindings::removeNativeReference):
1147 (RootObject::removeAllNativeReferences):
1148 * bindings/runtime_root.h:
1149 (KJS::Bindings::RootObject::~RootObject):
1150 (KJS::Bindings::RootObject::setRootObjectImp):
1152 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1154 - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
1155 KJS::InterpreterImp::mark() crash
1157 Fix by mjs, review by me.
1160 (KJS::InterpreterImp::mark): Added a null check on globExec in case a
1161 garbage collection occurs inside InterpreterImp::globalInit (called
1162 from InterpreterImp::InterpreterImp), at which point globExec has not yet been initialized.
1164 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1166 - Rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4892
1167 Date constructor has problems with months larger than 11
1171 * layout-tests/fast/js/date-big-constructor-expected.txt: Added.
1172 * layout-tests/fast/js/date-big-constructor.html: Added.
1176 * kjs/date_object.cpp:
1177 (KJS::fillStructuresUsingDateArgs):
1180 2005-09-19 Geoffrey Garen <ggaren@apple.com>
1182 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5028
1183 9 layout tests fail following the change from long to int
1185 - Rolled out changes to simple_number.h, and added fits(long long)
1186 and SimpleNumber::fits(unsigned long long) to the old system.
1190 * kjs/simple_number.h:
1191 (KJS::SimpleNumber::):
1192 (KJS::SimpleNumber::value):
1193 (KJS::SimpleNumber::fits):
1194 (KJS::SimpleNumber::integerFits):
1195 (KJS::SimpleNumber::make):
1197 2005-09-14 Maciej Stachowiak <mjs@apple.com>
1201 - fixed <rdar://problem/4214783> REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer)
1203 Make sure to lock using the InterpreterLock class in all places that need it
1204 (including anything that uses the collector, the parser, the protect count hash table,
1205 and anything that allocates via fast_malloc).
1207 Also added assertions to ensure that the locking rules are followed for the relevant
1211 * bindings/NP_jsobject.cpp:
1212 (identifierFromNPIdentifier):
1217 (_NPN_RemoveProperty):
1220 (_NPN_SetException):
1221 * bindings/jni/jni_jsobject.cpp:
1224 (JSObject::getMember):
1225 (JSObject::setMember):
1226 (JSObject::removeMember):
1227 (JSObject::getSlot):
1228 (JSObject::setSlot):
1229 (JSObject::toString):
1230 (JSObject::convertJObjectToValue):
1231 * bindings/objc/WebScriptObject.mm:
1232 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1233 (-[WebScriptObject evaluateWebScript:]):
1234 (-[WebScriptObject setValue:forKey:]):
1235 (-[WebScriptObject valueForKey:]):
1236 (-[WebScriptObject removeWebScriptKey:]):
1237 (-[WebScriptObject stringRepresentation]):
1238 (-[WebScriptObject webScriptValueAtIndex:]):
1239 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
1240 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
1241 * bindings/runtime.cpp:
1242 (Instance::createRuntimeObject):
1243 * bindings/runtime_root.h:
1244 * bindings/testbindings.cpp:
1246 * bindings/testbindings.mm:
1248 * kjs/fast_malloc.cpp:
1249 (KJS::kjs_fast_malloc):
1250 (KJS::kjs_fast_calloc):
1251 (KJS::kjs_fast_free):
1252 (KJS::kjs_fast_realloc):
1253 * kjs/fast_malloc.h:
1256 (InterpreterImp::InterpreterImp):
1257 (InterpreterImp::clear):
1258 (InterpreterImp::mark):
1259 (InterpreterImp::checkSyntax):
1260 (InterpreterImp::evaluate):
1262 (KJS::InterpreterImp::globalObject):
1263 * kjs/interpreter.cpp:
1264 (Interpreter::evaluate):
1265 * kjs/interpreter.h:
1266 (KJS::InterpreterLock::InterpreterLock):
1267 (KJS::InterpreterLock::~InterpreterLock):
1270 (KJS::ProtectedValue::ProtectedValue):
1271 (KJS::ProtectedValue::~ProtectedValue):
1272 (KJS::ProtectedValue::operator=):
1273 (KJS::ProtectedObject::ProtectedObject):
1274 (KJS::ProtectedObject::~ProtectedObject):
1275 (KJS::ProtectedObject::operator=):
1276 (KJS::ProtectedReference::ProtectedReference):
1277 (KJS::ProtectedReference::~ProtectedReference):
1278 (KJS::ProtectedReference::operator=):
1279 * kjs/protected_object.h:
1280 * kjs/protected_values.cpp:
1281 (KJS::ProtectedValues::getProtectCount):
1282 (KJS::ProtectedValues::increaseProtectCount):
1283 (KJS::ProtectedValues::decreaseProtectCount):
1284 * kjs/string_object.cpp:
1285 (StringObjectImp::StringObjectImp):
1289 2005-09-16 Adele Peterson <adele@apple.com>
1291 Change by Darin, reviewed by me and Maciej.
1293 Fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=4547
1294 use int instead of long for 32-bit (to prepare for LP64 compiling)
1296 * bindings/c/c_class.h:
1297 (KJS::Bindings::CClass::constructorAt):
1298 (KJS::Bindings::CClass::numConstructors):
1299 * bindings/c/c_runtime.h:
1300 (KJS::Bindings::CMethod::numParameters):
1301 * bindings/jni/jni_class.cpp:
1302 (JavaClass::JavaClass):
1303 * bindings/jni/jni_class.h:
1304 (KJS::Bindings::JavaClass::constructorAt):
1305 (KJS::Bindings::JavaClass::numConstructors):
1306 * bindings/jni/jni_instance.cpp:
1307 (JavaInstance::invokeMethod):
1308 * bindings/jni/jni_jsobject.cpp:
1309 (JSObject::convertJObjectToValue):
1310 (JSObject::listFromJArray):
1311 * bindings/jni/jni_runtime.cpp:
1312 (JavaMethod::JavaMethod):
1313 * bindings/jni/jni_runtime.h:
1314 (KJS::Bindings::JavaConstructor::_commonCopy):
1315 (KJS::Bindings::JavaConstructor::parameterAt):
1316 (KJS::Bindings::JavaConstructor::numParameters):
1317 (KJS::Bindings::JavaMethod::_commonCopy):
1318 (KJS::Bindings::JavaMethod::parameterAt):
1319 (KJS::Bindings::JavaMethod::numParameters):
1321 * bindings/objc/WebScriptObject.mm:
1323 * bindings/objc/objc_class.h:
1324 (KJS::Bindings::ObjcClass::constructorAt):
1325 (KJS::Bindings::ObjcClass::numConstructors):
1326 * bindings/objc/objc_instance.h:
1327 * bindings/objc/objc_runtime.h:
1328 * bindings/objc/objc_runtime.mm:
1329 (ObjcMethod::numParameters):
1330 * bindings/runtime.h:
1333 * kjs/property_slot.h:
1334 (KJS::PropertySlot::setCustomIndex):
1335 (KJS::PropertySlot::index):
1336 (KJS::PropertySlot::):
1337 * kjs/regexp_object.cpp:
1338 (RegExpObjectImp::backrefGetter):
1339 (RegExpObjectImp::getOwnPropertySlot):
1340 * kjs/simple_number.h:
1341 (KJS::SimpleNumber::):
1342 (KJS::SimpleNumber::value):
1343 (KJS::SimpleNumber::fits):
1344 (KJS::SimpleNumber::integerFits):
1345 (KJS::SimpleNumber::make):
1346 * kjs/string_object.cpp:
1347 (substituteBackreferences):
1349 (KJS::UString::from):
1350 (KJS::UString::toUInt32):
1351 (KJS::UString::find):
1352 (KJS::UString::rfind):
1358 2005-09-11 Eric Seidel <eseidel@apple.com>
1360 No review requested, build fix affects only SVG.
1362 * JavaScriptCore.xcodeproj/project.pbxproj: Fixed JSC+SVG
1363 Fixed JavaScriptCore+SVG after PCRE 6.1 merger.
1364 http://bugzilla.opendarwin.org/show_bug.cgi?id=4932
1366 2005-09-10 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1368 Reviewed and landed by Darin.
1370 * Makefile.vc: Added.
1371 * README-Win32.txt: Added.
1373 2005-09-10 Darin Adler <darin@apple.com>
1375 - fixed compilation for WebCore (another try)
1377 * kjs/simple_number.h: Added more "using" lines.
1379 2005-09-10 Darin Adler <darin@apple.com>
1381 - fixed compilation for WebCore
1383 * kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
1384 standard C++ library headers.
1386 2005-09-10 Darin Adler <darin@apple.com>
1388 Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
1390 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
1391 win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
1393 * kjs/simple_number.h:
1394 (KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
1395 uses _fpclass and a case for other platforms that uses signbit.
1396 (KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
1398 * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
1400 * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
1403 - improved test engine
1405 * tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
1406 a plain-ASCII sort; now test 33 will be after test 5 in any given set of
1409 2005-09-08 Darin Adler <darin@apple.com>
1411 - fixed overloaded versions of throwError so that they substitute *all*
1412 expected parameters into the message string -- some versions used to
1413 skip parameters, resulting in "%s" being printed in the error message.
1417 * kjs/nodes.h: Updated declarations to use "const &" and not to name parameters
1418 * kjs/nodes.cpp: (Node::throwError): Updated to match above and add one missing
1421 2005-09-08 Darin Adler <darin@apple.com>
1425 - updated to PCRE 6.1
1427 The original PCRE 6.1 sources are checked into the tree with the tag
1428 "pcre-6-1" for reference. What we're checking in right now is the original
1429 plus our changes to make it support UTF-16 and at least one other tweak
1430 (vertical tab considered whitespace). Our work to get our changes was
1431 done on "pcre-6-1-branch", with an anchor at "pcre-6-1-anchor" so you can
1432 see the evolution of the UTF-16 changes.
1434 Note also that there was one small change made here that's not on the branch
1437 * Info.plist: Updated the part of the copyright message that's about PCRE.
1439 * JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
1440 removed obsolete ones.
1442 * pcre/AUTHORS: Updated to PCRE 6.1. Includes credits for Apple's UTF-16
1443 changes, but not the credits for Google's C++ wrapper, since we don't include that.
1444 * pcre/COPYING: Updated to PCRE 6.1.
1445 * pcre/LICENCE: Ditto.
1446 * pcre/dftables.c: Ditto.
1447 * pcre/pcre-config.h: Ditto.
1448 * pcre/pcre.h: Ditto.
1450 * pcre/pcre_compile.c: Added for PCRE 6.1.
1451 * pcre/pcre_config.c: Ditto.
1452 * pcre/pcre_exec.c: Ditto.
1453 * pcre/pcre_fullinfo.c: Ditto.
1454 * pcre/pcre_get.c: Ditto.
1455 * pcre/pcre_globals.c: Ditto.
1456 * pcre/pcre_info.c: Ditto.
1457 * pcre/pcre_internal.h: Ditto.
1458 * pcre/pcre_maketables.c: Ditto.
1459 * pcre/pcre_ord2utf8.c: Ditto.
1460 * pcre/pcre_printint.c: Ditto.
1461 * pcre/pcre_refcount.c: Ditto.
1462 * pcre/pcre_study.c: Ditto.
1463 * pcre/pcre_tables.c: Ditto.
1464 * pcre/pcre_try_flipped.c: Ditto.
1465 * pcre/pcre_ucp_findchar.c: Ditto.
1466 * pcre/pcre_version.c: Ditto.
1467 * pcre/pcre_xclass.c: Ditto.
1468 * pcre/ucp.h: Ditto.
1469 * pcre/ucp_findchar.c: Ditto.
1470 * pcre/ucpinternal.h: Ditto.
1471 * pcre/ucptable.c: Ditto.
1473 * pcre/get.c: Removed.
1474 * pcre/internal.h: Removed.
1475 * pcre/maketables.c: Removed.
1476 * pcre/pcre.c: Removed.
1477 * pcre/study.c: Removed.
1479 2005-09-07 Geoffrey Garen <ggaren@apple.com>
1481 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4781
1482 Date.setMonth fails with big values due to overflow
1486 * kjs/date_object.cpp:
1487 (timetUsingCF): for consistency, changed return statement to invalidDate instead of LONG_MAX
1488 (KJS::fillStructuresUsingTimeArgs): modified for readability
1489 (KJS::fillStructuresUsingDateArgs): new function analogous to fillStructuresUsingTimeArgs
1490 (KJS::DateProtoFuncImp::callAsFunction): modified to use fillStructuresUsingDateArgs
1491 (KJS::DateObjectImp::construct): moved variable declaration to proper scope
1492 (KJS::DateObjectFuncImp::callAsFunction): moved variable declaration to proper scope
1494 2005-09-07 Geoffrey Garen <ggaren@apple.com>
1495 -updated expected test results to reflect fix for
1496 http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1497 kjs does not allow named functions in function expressions
1499 * tests/mozilla/expected.html:
1501 2005-09-04 Darin Adler <darin@apple.com>
1503 * kjs/identifier.cpp: Fix comment, add missing include.
1504 (Follow-on to changes from yesterday.)
1506 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1508 Reviewed, tweaked and landed by Darin.
1510 - another try at some of the Windows compilation fixes
1511 should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
1513 * kjs/collector.cpp: Add missing <setjmp.h> include.
1514 * kjs/date_object.cpp: Fix broken copysign macro.
1515 * kjs/dtoa.cpp: Move macro definitions down after all header includes.
1516 * kjs/fast_malloc.cpp: Add missing <assert.h> and <stddef.h> includes.
1517 * kjs/function.cpp: Remove broken isxdigit definition.
1518 * kjs/grammar.y: Add a missing semicolon (and remove an excess one).
1519 * kjs/identifier.cpp: Turn off AVOID_STATIC_CONSTRUCTORS because the placement new syntax
1520 doesn't seem to work in Visual C++ (I'm surprised to hear that, by the way).
1521 * kjs/value.h: Made ValueImp's destructor virtual because otherwise pointers to ValueImp
1522 on the stack aren't right for garbage collection on Windows (don't think it works that
1523 way with gcc's virtual table scheme, but it's a harmless change).
1525 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1527 Reviewed, tweaked and landed by Darin.
1529 - some Windows compilation fixes, hoping to fix the problems reported in these bugs:
1530 4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
1532 * kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside
1533 KJS_MULTIPLE_THREADS #if directives.
1534 (KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
1536 * kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
1538 * kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
1540 (KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe
1541 that on Win32 there's some other call before that setting errno.
1543 * kjs/date_object.h: Remove unneeded include of <sys/time.h>.
1545 * kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
1547 * kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32.
1548 (KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++.
1549 (KJS::sbrk): Change parameter type to match the declaration.
1551 * kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
1553 * kjs/function.h: Remove unneeded friend class Function for FunctionImp.
1555 * kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS
1556 define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the
1557 non-AVOID_STATIC_CONSTRUCTORS code path.
1559 * kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>!
1560 Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
1562 * kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this
1563 specific to Mac OS X if we like.
1565 * kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
1568 (KJS::ListImp::markValues): Use std::min instead of MIN.
1569 (KJS::List::copy): Ditto.
1570 (KJS::List::copyTail): Ditto.
1572 * kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
1574 * kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
1575 Put the use of always_inline inside __GNUC__.
1577 * kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10"
1578 inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen
1579 when passing an int rather than a double or float.
1581 * kjs/operations.cpp:
1582 (KJS::isInf): Add Win32 implementation.
1583 (KJS::isPosInf): Add Win32 implementation.
1584 (KJS::isNegInf): Add Win32 implementation.
1586 * kjs/regexp.cpp: Use unsigned instead of uint.
1587 * kjs/regexp.h: Ditto.
1588 * kjs/regexp_object.cpp: Ditto.
1589 * kjs/regexp_object.h: Ditto.
1591 2005-09-02 Beth Dakin <bdakin@apple.com>
1593 Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
1594 The other half of the fix is in WebCore.
1596 Fix written by Maciej and Darin.
1597 Reviewed by me/Maciej
1599 As Maciej said in Radar: These problems was caused by a conflict between some of our custom
1600 allocators, causing them to return null. Symptom is typically a null pointer dereference in
1601 a place where it might be expected an allocation has just occurred.
1603 * kjs/fast_malloc.cpp: Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM,
1604 and MALLOC_FAILURE_ACTION.
1606 2005-08-31 Geoffrey Garen <ggaren@apple.com>
1608 -rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1609 kjs does not allow named functions in function expressions
1611 Fix by Arthur Langereis.
1617 (FuncExprNode::evaluate):
1619 (KJS::FuncExprNode::FuncExprNode):
1623 * layout-tests/fast/js/named-function-expression-expected.txt: Added.
1624 * layout-tests/fast/js/named-function-expression.html: Added.
1626 2005-08-31 Justin Haygood <justin@xiondigital.net>
1628 Reviewed, tweaked, and landed by Darin.
1630 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4085
1631 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4087
1632 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4096
1633 Some fixes for compiling on windows.
1635 * kjs/config.h: Added a WIN32 case in here, with suitable defines.
1636 (To be tweaked as necessary.)
1637 * kjs/function.cpp: Took out APPLE_CHANGES around use of ICU.
1638 * kjs/operations.cpp: Removed some bogus code that always set HAVE_FLOAT_H.
1640 2005-08-30 Darin Adler <darin@apple.com>
1642 Reviewed by John Sullivan.
1644 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4758
1645 unify SharedPtr in WebCore and JavaScriptCore
1647 * kjs/shared_ptr.h: Updated namespace to KXMLCore instead of kxhmlcore.
1648 Made a few small improvements to use local variables a bit more and added
1649 an "operator int" to reduce the chance that we'll convert a SharedPtr to
1650 an int by accident. Also made the == operators normal functions rather than
1651 friend functions, added a couple of comemnts.
1653 * kjs/function.h: Updated for namespace change.
1654 * kjs/function.cpp: Ditto.
1655 * kjs/function_object.cpp: Ditto.
1656 * kjs/internal.h: Ditto.
1657 * kjs/internal.cpp: Ditto.
1658 * kjs/nodes.h: Ditto.
1659 * kjs/nodes2string.cpp: Ditto.
1661 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1665 <rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript
1667 Record all nodes that are created during parsing, and delete any
1668 that are left floating with a refcount of 0.
1671 (KJS::Parser::saveNewNode):
1672 (KJS::clearNewNodes):
1673 (KJS::Parser::parse):
1678 (KJS::Node::refcount):
1680 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1684 - fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
1686 Fixed by changing the refcounting scheme for nodes. Instead of each node implementing a custom ref and
1687 deref for all its children (and being responsible for deleting them), nodes use a smart pointer to
1688 hold their children, and smart pointers are used outside the node tree as well. This change mostly
1691 * JavaScriptCore.xcodeproj/project.pbxproj:
1693 (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
1694 (KJS::GlobalFuncImp::callAsFunction):
1696 * kjs/function_object.cpp:
1697 (FunctionObjectImp::construct):
1700 (KJS::Parser::parse):
1701 (KJS::Parser::accept):
1702 (KJS::InterpreterImp::checkSyntax):
1703 (KJS::InterpreterImp::evaluate):
1708 (ElementNode::evaluate):
1709 (PropertyValueNode::evaluate):
1710 (ArgumentListNode::evaluateList):
1711 (NewExprNode::evaluate):
1712 (FunctionCallValueNode::evaluate):
1713 (FunctionCallBracketNode::evaluate):
1714 (FunctionCallDotNode::evaluate):
1715 (RelationalNode::evaluate):
1716 (StatListNode::execute):
1717 (StatListNode::processVarDecls):
1718 (VarDeclListNode::evaluate):
1719 (VarDeclListNode::processVarDecls):
1720 (ForInNode::ForInNode):
1721 (ClauseListNode::processVarDecls):
1722 (CaseBlockNode::evalBlock):
1723 (FuncDeclNode::processFuncDecl):
1724 (FuncExprNode::evaluate):
1725 (SourceElementsNode::execute):
1726 (SourceElementsNode::processFuncDecl):
1727 (SourceElementsNode::processVarDecls):
1731 (KJS::NumberNode::NumberNode):
1732 (KJS::GroupNode::GroupNode):
1733 (KJS::ElementNode::ElementNode):
1734 (KJS::ArrayNode::ArrayNode):
1735 (KJS::PropertyValueNode::PropertyValueNode):
1736 (KJS::ObjectLiteralNode::ObjectLiteralNode):
1737 (KJS::BracketAccessorNode::BracketAccessorNode):
1738 (KJS::DotAccessorNode::DotAccessorNode):
1739 (KJS::ArgumentListNode::ArgumentListNode):
1740 (KJS::ArgumentsNode::ArgumentsNode):
1741 (KJS::NewExprNode::NewExprNode):
1742 (KJS::FunctionCallValueNode::FunctionCallValueNode):
1743 (KJS::FunctionCallResolveNode::FunctionCallResolveNode):
1744 (KJS::FunctionCallBracketNode::FunctionCallBracketNode):
1745 (KJS::FunctionCallDotNode::FunctionCallDotNode):
1746 (KJS::PostfixNode::PostfixNode):
1747 (KJS::DeleteNode::DeleteNode):
1748 (KJS::VoidNode::VoidNode):
1749 (KJS::TypeOfNode::TypeOfNode):
1750 (KJS::PrefixNode::PrefixNode):
1751 (KJS::UnaryPlusNode::UnaryPlusNode):
1752 (KJS::NegateNode::NegateNode):
1753 (KJS::BitwiseNotNode::BitwiseNotNode):
1754 (KJS::LogicalNotNode::LogicalNotNode):
1755 (KJS::MultNode::MultNode):
1756 (KJS::AddNode::AddNode):
1757 (KJS::ShiftNode::ShiftNode):
1758 (KJS::RelationalNode::RelationalNode):
1759 (KJS::EqualNode::EqualNode):
1760 (KJS::BitOperNode::BitOperNode):
1761 (KJS::BinaryLogicalNode::BinaryLogicalNode):
1762 (KJS::ConditionalNode::ConditionalNode):
1763 (KJS::AssignResolveNode::AssignResolveNode):
1764 (KJS::AssignBracketNode::AssignBracketNode):
1765 (KJS::AssignDotNode::AssignDotNode):
1766 (KJS::CommaNode::CommaNode):
1767 (KJS::AssignExprNode::AssignExprNode):
1768 (KJS::VarDeclListNode::VarDeclListNode):
1769 (KJS::VarStatementNode::VarStatementNode):
1770 (KJS::ExprStatementNode::ExprStatementNode):
1771 (KJS::IfNode::IfNode):
1772 (KJS::DoWhileNode::DoWhileNode):
1773 (KJS::WhileNode::WhileNode):
1774 (KJS::ForNode::ForNode):
1775 (KJS::ReturnNode::ReturnNode):
1776 (KJS::WithNode::WithNode):
1777 (KJS::CaseClauseNode::CaseClauseNode):
1778 (KJS::ClauseListNode::ClauseListNode):
1779 (KJS::ClauseListNode::clause):
1780 (KJS::ClauseListNode::next):
1781 (KJS::SwitchNode::SwitchNode):
1782 (KJS::LabelNode::LabelNode):
1783 (KJS::ThrowNode::ThrowNode):
1784 (KJS::CatchNode::CatchNode):
1785 (KJS::FinallyNode::FinallyNode):
1786 (KJS::TryNode::TryNode):
1787 (KJS::ParameterNode::ParameterNode):
1788 (KJS::ParameterNode::nextParam):
1789 (KJS::FuncDeclNode::FuncDeclNode):
1790 (KJS::FuncExprNode::FuncExprNode):
1791 * kjs/nodes2string.cpp:
1792 (KJS::SourceStream::operator<<):
1793 (ElementNode::streamTo):
1794 (PropertyValueNode::streamTo):
1795 (ArgumentListNode::streamTo):
1796 (StatListNode::streamTo):
1797 (VarDeclListNode::streamTo):
1798 (CaseBlockNode::streamTo):
1799 (ParameterNode::streamTo):
1800 (SourceElementsNode::streamTo):
1801 * kjs/shared_ptr.h: Added.
1802 (kxmlcore::SharedPtr::SharedPtr):
1803 (kxmlcore::SharedPtr::~SharedPtr):
1804 (kxmlcore::SharedPtr::isNull):
1805 (kxmlcore::SharedPtr::notNull):
1806 (kxmlcore::SharedPtr::reset):
1807 (kxmlcore::SharedPtr::get):
1808 (kxmlcore::SharedPtr::operator*):
1809 (kxmlcore::SharedPtr::operator->):
1810 (kxmlcore::SharedPtr::operator!):
1811 (kxmlcore::SharedPtr::operator bool):
1812 (kxmlcore::SharedPtr::operator==):
1813 (kxmlcore::::operator):
1814 (kxmlcore::operator!=):
1815 (kxmlcore::static_pointer_cast):
1816 (kxmlcore::const_pointer_cast):
1818 2005-08-26 Geoff Garen <ggaren@apple.com>
1823 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4664
1824 TOT Crash from backwards null check in WebScriptObject.mm
1826 * bindings/objc/WebScriptObject.mm:
1827 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1830 2005-08-25 Darin Adler <darin@apple.com>
1832 Reviewed by John Sullivan.
1834 - rename KJS::UString::string() to KJS::UString::domString()
1835 - rename KJS::Identifier::string() to KJS::Identifier::domString()
1837 * kjs/identifier.h: Renamed.
1838 * kjs/ustring.h: Ditto.
1840 2005-08-19 Darin Adler <darin@apple.com>
1844 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4435
1845 speed up JavaScript by tweaking the Identifier class
1847 * kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
1849 * kjs/identifier.cpp: (KJS::Identifier::init): Initialize a global for the null identifier
1850 as well as all the other globals for special identifiers.
1852 * kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
1853 * kjs/ustring.cpp: Remove the old non-inline version.
1855 2005-08-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
1858 Revised and landed by Darin.
1860 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4474
1861 REGRESSION: Crash when using in-place operator on uninitialized array element
1864 (AssignResolveNode::evaluate): Remove unneeded "isSet" assertion.
1865 (AssignBracketNode::evaluate): Replace code that tested "isSet" with code that
1866 tests the return value of getPropertySlot.
1868 * kjs/property_slot.h: Removed unneeded "isSet" function. Property slots are
1869 either uninitialized or set. There's no "initialized and not set" state.
1871 2005-08-18 Adele Peterson <adele@apple.com>
1873 Checked "Inline Functions Hidden" box
1875 * JavaScriptCore.xcodeproj/project.pbxproj:
1877 2005-08-16 Darin Adler <darin@apple.com>
1881 - fixed crash in one of the JavaScript tests (introduced by my throwError change)
1883 * kjs/nodes.cpp: (Node::setExceptionDetailsIfNeeded): Check if the exception is an
1884 object before setting the file and line number properties on it. Something to think
1885 about in the future -- do we really want to do this on any object that's thrown?
1886 How about limiting it to error objects that were created by the JavaScript engine?
1888 - changed kjs_fast_malloc so we don't have two conflicting versions of the same function
1890 * kjs/fast_malloc.h: Took out all the ifdefs from this header.
1891 * kjs/fast_malloc.cpp: Added non-NDEBUG versions of the functions that just call
1892 the system malloc, and put the NDEBUG versions in an #else.
1894 2005-08-16 Darin Adler <darin@apple.com>
1898 - clean up exported symbols that are not in a "KJS" namespace
1900 * bindings/NP_jsobject.cpp: (identiferFromNPIdentifier): Marked this function static
1901 so it no longer has external linkage.
1902 * bindings/c/c_utility.h: Put all this stuff inside the KJS namespace.
1903 * bindings/c/c_utility.cpp: Also marked some globals static so they don't have external
1904 linkage; not as important given the namespace.
1905 * bindings/npruntime.cpp: Marked functions static so they no longer have internal linkage.
1906 Also removed unused _NPN_SetExceptionWithUTF8 function (not in header, had C++ linkage!).
1908 * bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): Call KJS_GetCreatedJavaVMs
1909 using the soft linking header, instead of calling the JNI call. This allows processes
1910 to link both JavaScriptCore and JavaVM without a symbol conflict.
1911 * bindings/softlinking.c:
1912 (loadFramework): Marked this function static so it no longer has external linkage.
1913 (getFunctionPointer): Ditto.
1914 (KJS_GetCreatedJavaVMs): Renamed this so it has a KJS prefix.
1916 * JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
1917 * bindings/softlinking.h: Added.
1919 * kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
1920 no longer has external linkage.
1922 2005-08-15 Darin Adler <darin@apple.com>
1926 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4437
1927 clean up error creation with new throwError function
1929 * bindings/NP_jsobject.cpp:
1930 (_NPN_SetException):
1931 * bindings/jni/jni_instance.cpp:
1932 (JavaInstance::invokeMethod):
1933 * bindings/jni/jni_runtime.cpp:
1934 (JavaField::dispatchValueFromInstance):
1935 (JavaField::dispatchSetValueToInstance):
1936 * bindings/objc/WebScriptObject.mm:
1937 (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:executionContext:]):
1938 (-[WebScriptObject _initWithObjectImp:originExecutionContext:executionContext:]):
1939 (+[WebScriptObject throwException:]):
1940 (-[WebScriptObject setException:]):
1941 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1942 * bindings/objc/objc_class.h:
1943 (KJS::Bindings::ObjcClass::~ObjcClass):
1944 (KJS::Bindings::ObjcClass::ObjcClass):
1945 (KJS::Bindings::ObjcClass::operator=):
1946 (KJS::Bindings::ObjcClass::constructorAt):
1947 (KJS::Bindings::ObjcClass::numConstructors):
1948 * bindings/objc/objc_header.h:
1949 * bindings/objc/objc_runtime.h:
1950 (KJS::Bindings::ObjcField::~ObjcField):
1951 (KJS::Bindings::ObjcField::ObjcField):
1952 (KJS::Bindings::ObjcField::operator=):
1953 (KJS::Bindings::ObjcMethod::ObjcMethod):
1954 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1955 (KJS::Bindings::ObjcMethod::operator=):
1956 * bindings/objc/objc_runtime.mm:
1957 (ObjcField::valueFromInstance):
1958 (ObjcField::setValueToInstance):
1959 (ObjcArray::setValueAt):
1960 (ObjcArray::valueAt):
1961 * bindings/objc/objc_utility.h:
1962 * bindings/objc/objc_utility.mm:
1963 (KJS::Bindings::JSMethodNameToObjCMethodName):
1964 (KJS::Bindings::convertValueToObjcValue):
1965 (KJS::Bindings::convertNSStringToString):
1966 (KJS::Bindings::convertObjcValueToValue):
1967 (KJS::Bindings::objcValueTypeForType):
1968 (KJS::Bindings::createObjcInstanceForValue):
1969 (KJS::Bindings::throwError):
1970 * bindings/runtime.h:
1971 (KJS::Bindings::Parameter::~Parameter):
1972 (KJS::Bindings::Method::~Method):
1973 (KJS::Bindings::Instance::Instance):
1974 (KJS::Bindings::Instance::begin):
1975 (KJS::Bindings::Instance::end):
1976 (KJS::Bindings::Instance::getValueOfUndefinedField):
1977 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
1978 (KJS::Bindings::Instance::setValueOfUndefinedField):
1979 (KJS::Bindings::Instance::valueOf):
1980 * bindings/runtime_array.cpp:
1981 (RuntimeArrayImp::put):
1982 * bindings/runtime_object.h:
1983 (KJS::RuntimeObjectImp::setInternalInstance):
1984 (KJS::RuntimeObjectImp::getInternalInstance):
1985 * kjs/array_object.cpp:
1987 (ArrayProtoFuncImp::callAsFunction):
1988 (ArrayObjectImp::construct):
1989 * kjs/bool_object.cpp:
1990 (BooleanProtoFuncImp::callAsFunction):
1991 * kjs/date_object.cpp:
1992 (KJS::DateProtoFuncImp::callAsFunction):
1995 (KJS::GlobalFuncImp::callAsFunction):
1996 * kjs/function_object.cpp:
1997 (FunctionProtoFuncImp::callAsFunction):
1998 (FunctionObjectImp::construct):
2000 (KJS::UndefinedImp::toObject):
2001 (KJS::NullImp::toObject):
2002 (KJS::InterpreterImp::evaluate):
2003 (KJS::InternalFunctionImp::hasInstance):
2007 (Node::setExceptionDetailsIfNeeded):
2008 (undefinedVariableError):
2009 (ProgramNode::ProgramNode):
2010 * kjs/number_object.cpp:
2011 (NumberProtoFuncImp::callAsFunction):
2013 (KJS::ObjectImp::call):
2014 (KJS::ObjectImp::defaultValue):
2015 (KJS::Error::create):
2018 (KJS::ObjectImp::clearProperties):
2019 (KJS::ObjectImp::getPropertySlot):
2020 (KJS::ObjectImp::getOwnPropertySlot):
2021 * kjs/object_object.cpp:
2022 (ObjectProtoFuncImp::callAsFunction):
2023 * kjs/reference.cpp:
2024 (KJS::Reference::getBase):
2025 (KJS::Reference::getValue):
2026 (KJS::Reference::putValue):
2027 (KJS::Reference::deleteValue):
2028 * kjs/regexp_object.cpp:
2029 (RegExpProtoFuncImp::callAsFunction):
2030 (RegExpObjectImp::construct):
2031 * kjs/string_object.cpp:
2032 (StringProtoFuncImp::callAsFunction):
2034 2005-08-15 Anders Carlsson <andersca@mac.com>
2038 * tests/mozilla/ecma_3/Date/15.9.5.5.js:
2039 Remove the code which tests that Date.toLocaleString should be parsable
2040 by Date.parse. That is not true according to the spec.
2042 2005-08-15 Darin Adler <darin@apple.com>
2046 * kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
2047 more place; slight speedup.
2049 2005-08-14 Darin Adler <darin@apple.com>
2053 - fixed crash observed on one of the Apple-only layout tests
2055 * kjs/property_map.cpp: (KJS::PropertyMap::mark): Change code to understand that deleted
2056 entries have a value of NULL, so the deleted sentinel count doesn't need to be included
2057 in the count of things to mark since we're ignoring the keys.
2059 2005-08-14 Darin Adler <darin@apple.com>
2063 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4421
2064 speed up JavaScript by inlining some label stack functions
2066 * kjs/internal.h: Removed the copy constructor and assignment operator for LabelStack.
2067 They were unused, and the implementations had bugs; I removed them rather than fixing them.
2068 Also removed the clear function, since that was only needed to help the assignment operator
2069 share code with the destructor, and was not efficient enough for the destructor.
2070 (KJS::LabelStack::~LabelStack): Made this inline. Also used an efficient implementation
2071 that's nice and fast when the stack is empty, better than the old clear() function which
2072 used to keep updating and refetching "tos" each time through the loop.
2073 (KJS::LabelStack::pop): Made this inline.
2075 * kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
2076 deleted a commented-out line of code.
2078 2005-08-14 Darin Adler <darin@apple.com>
2082 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4419
2083 speed up JavaScript by improving KJS::List
2085 my measurements show an improvement of 1% on iBench JavaScript
2087 * kjs/list.cpp: Rearrange list to make the values and free list share the same storage,
2088 which saves 4 bytes per list. Also remove the pointers used only on the heap from the
2089 lists that are in the pool, which saves 8 bytes per list. Moving the free list pointer
2090 closer to the start of the list object also speeds up access to the free list. New
2091 "HeapListImp" struct is used only for the lists on the heap.
2092 (KJS::List::markProtectedLists): Shadowed global variable in local and updated for the
2093 new terminology ("heap" instead of "outside pool").
2094 (KJS::allocateListImp): Updated for new terminology.
2095 (KJS::List::release): Moved the code from deallocateListImp in here -- it wasn't being
2096 inlined and didn't need to be in a separate function.
2098 2005-08-14 Darin Adler <darin@apple.com>
2102 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4417
2103 speed up JavaScript with some small changes to the property map code
2105 my measurements show an improvement of 2% on iBench JavaScript
2107 * kjs/property_map.h: (KJS::PropertyMap::PropertyMap): Made the default constructor inline.
2108 * kjs/property_map.cpp:
2109 (KJS::PropertyMap::~PropertyMap): Changed loop to exit early once we know we've processed
2110 all the hash table entries, based on the count.
2111 (KJS::PropertyMap::mark): Ditto.
2113 * kjs/object.h: Made an arbitrary change here to force recompiling so we pick up changes to
2114 property_map.h. Works around what seems to be an Xcode header dependency bug.
2116 2005-08-14 Darin Adler <darin@apple.com>
2120 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4416
2121 speed up JavaScript with some improvements to the garbage collector
2123 my measurements show an improvement of 2% on iBench JavaScript
2125 * kjs/collector.cpp:
2126 (KJS::Collector::allocate): Use local variables to shadow globals instead of repeatedly
2127 going at global variables. Tighten up loop implementations to make the common case fast.
2128 (KJS::Collector::markStackObjectsConservatively): Use local variables to shadow globals.
2129 Used a goto to eliminate a boolean since it was showing up in the profile.
2130 (KJS::Collector::markProtectedObjects): Iterate through the table using pointer rather
2131 than an index since the profile showed that generating better code.
2132 (KJS::Collector::collect): Added a special case for blocks where all cells are used,
2133 Use local variables to shadow globals. Eliminated a boolean by computing it another
2134 way (checking to see if the number of live objects changed). Also used local variables
2135 to shadow fields in the current cell when sweeping.
2136 (KJS::Collector::numReferencedObjects): Use AllocatedValueImp instead of ValueImp
2137 in one place -- means we get faster versions of various functions that don't worry
2139 (KJS::className): Ditto.
2140 (KJS::Collector::rootObjectClasses): Ditto.
2142 2005-08-14 Darin Adler <darin@apple.com>
2144 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
2145 REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
2147 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
2148 straightforward way. The old code set the proto to 0 and then to the correct value.
2149 This showed up as a "false positive" when searching for places that set prototype
2150 to NULL/0 so I fixed it.
2152 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
2153 not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
2155 * kjs/internal.h: Added a default constructor for InternalFunctionImp.
2156 * kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
2157 default constructor (empty body, just calls base class's default constructor).
2160 (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
2161 in Development builds.
2162 (KJS::ObjectImp::setPrototype): Ditto.
2164 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2168 - two simple speed improvements for a 3% speed gain
2170 * JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
2172 * kjs/scope_chain.h:
2173 (KJS::ScopeChainIterator::ScopeChainIterator): Add a scope chain iterator
2174 so you can walk a scope chain without having to make a copy that you then mutate.
2175 (KJS::ScopeChainIterator::operator*): standard iterator operation
2176 (KJS::ScopeChainIterator::operator->): ditto
2177 (KJS::ScopeChainIterator::operator++): ditto
2178 (KJS::ScopeChainIterator::operator==): ditto
2179 (KJS::ScopeChainIterator::operator!=): ditto
2180 (KJS::ScopeChain::begin): Iterator for the top of the scope chain
2181 (KJS::ScopeChain::end): Iterator for one past the bottom (i.e. null)
2183 (ResolveNode::evaluate): Use scope chain iterator instead of copying
2184 a scope chain and then modifying the copy
2185 (ResolveNode::evaluateReference): ditto
2186 (FunctionCallResolveNode::evaluate): ditto
2187 (AssignResolveNode::evaluate): ditto
2189 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2191 Patch from Anders Carlsson, reviewed by me.
2193 * kjs/nodes.h: Fix build breakage.
2195 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2199 - refactor function calls, 3% speedup on JS iBench.
2203 (Node::throwError): Added new useful variants.
2204 (FunctionCallValueNode::evaluate): New node to handle calls on expressions
2205 that are strictly values, not references.
2206 (FunctionCallValueNode::ref): ditto
2207 (FunctionCallValueNode::deref): ditto
2208 (FunctionCallResolveNode::evaluate): New node to handle calls on identifier
2209 expressions, so that they are looked up in the scope chain.
2210 (FunctionCallResolveNode::ref): ditto
2211 (FunctionCallResolveNode::deref): ditto
2212 (FunctionCallBracketNode::evaluate): New node to handle calls on bracket
2213 dereferences, so that the expression before brackets is used as the this
2215 (FunctionCallBracketNode::ref): ditto
2216 (FunctionCallBracketNode::deref): ditto
2217 (FunctionCallDotNode::evaluate): New node to handle calls on dot
2218 dereferences, so that the expression before the dot is used as the this
2220 (FunctionCallDotNode::ref): ditto
2221 (FunctionCallDotNode::deref): ditto
2222 (dotExprNotAnObjectString): helper function to avoid global variable access.
2223 (dotExprDoesNotAllowCallsString): ditto
2224 * kjs/nodes.h: Declared new classes.
2225 * kjs/nodes2string.cpp:
2226 (FunctionCallValueNode::streamTo): Added - serializes the appropriate function call
2227 (FunctionCallResolveNode::streamTo): ditto
2228 (FunctionCallBracketNode::streamTo): ditto
2229 (FunctionCallParenBracketNode::streamTo): ditto
2230 (FunctionCallDotNode::streamTo): ditto
2231 (FunctionCallParenDotNode::streamTo): ditto
2233 (KJS::ObjectImp::isActivation): Change how activation objects are
2234 detected in the scope chain, a virtual function is cheaper than the
2235 old inheritance test.
2237 (KJS::ActivationImp::isActivation): Ditto.
2239 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2241 - added missing file from earlier checkin
2243 * kjs/grammar_types.h: Added.
2244 (KJS::makeNodePair):
2245 (KJS::makeNodeWithIdent):
2247 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2251 * kjs/date_object.cpp:
2252 (timetUsingCF): Fix one of the date tests my making the CF version of mktime
2253 have the same quirk about the DST field as the real mktime.
2254 * tests/mozilla/expected.html: Updated for newly fixed test.
2256 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2258 - updated for one of the tests that Darin incidentally fixed.
2260 * tests/mozilla/expected.html:
2262 2005-08-10 Maciej Stachowiak <mjs@apple.com>
2266 Refactor assignment grammar to avoid Reference type, and to later
2267 be able to take advantage of writeable PropertySlots, when those
2268 are added. I also fixed a minor bug, turning a function to a
2269 string lost parentheses, I made sure they are printed at least
2270 where semantically significant.
2272 Test cases: see WebCore
2274 * kjs/grammar.y: Change grammar so that assignment expressions are parsed
2275 directly to nodes that know how to set the kind of location being assigned, instead
2276 of having a generic assign node that counts on evaluateReference.
2277 * kjs/lexer.cpp: Include grammar_types.h.
2279 (BracketAccessorNode): Renamed from AccessorNode1 for clarity.
2280 (DotAccessorNode): Renamed from AccessorNode2 for clarity.
2281 (combineForAssignment): Inline function for doing the proper kind of
2282 operation for various update assignments like += or *=.
2283 (AssignResolveNode): Node that handles assignment to a bare identifier.
2284 (AssignDotNode): Node that handles assignments of the form EXPR . IDENT = EXPR
2285 (AssignBracketNode): EXPR [ IDENT ] = EXPR
2286 * kjs/nodes.h: Updated for declarations/renames of new classes.
2287 * kjs/nodes2string.cpp:
2288 (GroupNode::streamTo): Fixed to print parens around the expression.
2289 (BracketAccessorNode::streamTo): Renamed.
2290 (DotAccessorNode::streamTo): Renamed.
2291 (AssignResolveNode::streamTo): Added.
2292 (AssignBracketNode::streamTo): Added.
2293 (AssignDotNode::streamTo): Added.
2294 (streamAssignmentOperatorTo): helper function for the above
2295 * kjs/property_slot.h:
2296 (KJS::PropertySlot::isSet): Made this const.
2298 2005-08-10 Adele Peterson <adele@apple.com>
2300 Bumping version to 420+
2304 2005-08-10 Geoffrey Garen <ggaren@apple.com>
2306 -fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls
2307 throws privilege exception.
2309 Reviewed by richard and mjs.
2311 -I removed the global static JavaClass cache, since it violated Java
2312 security to cache classes between websites and applets.
2314 * bindings/jni/jni_class.cpp:
2315 -removed global static cache dictionary
2316 -instance constructor and destructor now do the work that used to
2317 be done by static factory methods
2318 -removed obsolete functions
2319 (JavaClass::JavaClass):
2320 (JavaClass::~JavaClass):
2321 * bindings/jni/jni_class.h:
2322 -removed obsolete function declarations
2323 -made copying private since it's unused and it's also not clear
2324 excatly how copying would work with Java security
2325 -made default construction private since it's meaningless
2326 * bindings/jni/jni_instance.cpp:
2327 -removed obsolete functions
2328 (JavaInstance::~JavaInstance):
2329 (JavaInstance::getClass):
2330 * bindings/jni/jni_instance.h:
2331 -made copying private since it's unused and it's also not clear
2332 excatly how copying would work with Java security
2333 -made default construction private since it's meaningless
2335 2005-08-08 Geoffrey Garen <ggaren@apple.com>
2337 -fixed crash caused by fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
2339 - exceptionDescription now gets explicitly initialized to NULL in all
2340 the places listed below -- our wrapper classes used to take care of this
2343 * bindings/jni/jni_instance.cpp:
2344 (JavaInstance::invokeMethod):
2345 * bindings/jni/jni_runtime.cpp:
2346 (JavaField::dispatchValueFromInstance):
2347 (JavaField::dispatchSetValueToInstance):
2349 2005-08-08 Darin Adler <darin@apple.com>
2351 Reviewed by John Sullivan.
2353 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4325
2354 Mozilla Date tests have an unnecessary loop that runs 1970 times before each test
2356 * tests/mozilla/ecma/shell.js: Added TIME_YEAR_0 constant.
2358 * tests/mozilla/ecma/Date/15.9.5.10-1.js: Removed the loop and changed code to use the constant.
2359 * tests/mozilla/ecma/Date/15.9.5.10-10.js: Ditto.
2360 * tests/mozilla/ecma/Date/15.9.5.10-11.js: Ditto.
2361 * tests/mozilla/ecma/Date/15.9.5.10-12.js: Ditto.
2362 * tests/mozilla/ecma/Date/15.9.5.10-13.js: Ditto.
2363 * tests/mozilla/ecma/Date/15.9.5.10-2.js: Ditto.
2364 * tests/mozilla/ecma/Date/15.9.5.10-3.js: Ditto.
2365 * tests/mozilla/ecma/Date/15.9.5.10-4.js: Ditto.
2366 * tests/mozilla/ecma/Date/15.9.5.10-5.js: Ditto.
2367 * tests/mozilla/ecma/Date/15.9.5.10-6.js: Ditto.
2368 * tests/mozilla/ecma/Date/15.9.5.10-7.js: Ditto.
2369 * tests/mozilla/ecma/Date/15.9.5.10-8.js: Ditto.
2370 * tests/mozilla/ecma/Date/15.9.5.10-9.js: Ditto.
2371 * tests/mozilla/ecma/Date/15.9.5.11-2.js: Ditto.
2372 * tests/mozilla/ecma/Date/15.9.5.12-1.js: Ditto.
2373 * tests/mozilla/ecma/Date/15.9.5.12-2.js: Ditto.
2374 * tests/mozilla/ecma/Date/15.9.5.12-3.js: Ditto.
2375 * tests/mozilla/ecma/Date/15.9.5.12-4.js: Ditto.
2376 * tests/mozilla/ecma/Date/15.9.5.12-5.js: Ditto.
2377 * tests/mozilla/ecma/Date/15.9.5.12-6.js: Ditto.
2378 * tests/mozilla/ecma/Date/15.9.5.12-7.js: Ditto.
2379 * tests/mozilla/ecma/Date/15.9.5.12-8.js: Ditto.
2380 * tests/mozilla/ecma/Date/15.9.5.13-2.js: Ditto.
2381 * tests/mozilla/ecma/Date/15.9.5.13-8.js: Ditto.
2382 * tests/mozilla/ecma/Date/15.9.5.14.js: Ditto.
2383 * tests/mozilla/ecma/Date/15.9.5.15.js: Ditto.
2384 * tests/mozilla/ecma/Date/15.9.5.16.js: Ditto.
2385 * tests/mozilla/ecma/Date/15.9.5.17.js: Ditto.
2386 * tests/mozilla/ecma/Date/15.9.5.18.js: Ditto.
2387 * tests/mozilla/ecma/Date/15.9.5.19.js: Ditto.
2388 * tests/mozilla/ecma/Date/15.9.5.20.js: Ditto.
2389 * tests/mozilla/ecma/Date/15.9.5.21-1.js: Ditto.
2390 * tests/mozilla/ecma/Date/15.9.5.21-2.js: Ditto.
2391 * tests/mozilla/ecma/Date/15.9.5.21-3.js: Ditto.
2392 * tests/mozilla/ecma/Date/15.9.5.21-4.js: Ditto.
2393 * tests/mozilla/ecma/Date/15.9.5.21-5.js: Ditto.
2394 * tests/mozilla/ecma/Date/15.9.5.21-6.js: Ditto.
2395 * tests/mozilla/ecma/Date/15.9.5.21-7.js: Ditto.
2396 * tests/mozilla/ecma/Date/15.9.5.21-8.js: Ditto.
2397 * tests/mozilla/ecma/Date/15.9.5.22-1.js: Ditto.
2398 * tests/mozilla/ecma/Date/15.9.5.22-2.js: Ditto.
2399 * tests/mozilla/ecma/Date/15.9.5.22-3.js: Ditto.
2400 * tests/mozilla/ecma/Date/15.9.5.22-4.js: Ditto.
2401 * tests/mozilla/ecma/Date/15.9.5.22-5.js: Ditto.
2402 * tests/mozilla/ecma/Date/15.9.5.22-6.js: Ditto.
2403 * tests/mozilla/ecma/Date/15.9.5.22-7.js: Ditto.
2404 * tests/mozilla/ecma/Date/15.9.5.22-8.js: Ditto.
2405 * tests/mozilla/ecma/Date/15.9.5.23-4.js: Ditto.
2406 * tests/mozilla/ecma/Date/15.9.5.23-5.js: Ditto.
2407 * tests/mozilla/ecma/Date/15.9.5.23-6.js: Ditto.
2408 * tests/mozilla/ecma/Date/15.9.5.23-7.js: Ditto.
2409 * tests/mozilla/ecma/Date/15.9.5.23-8.js: Ditto.
2410 * tests/mozilla/ecma/Date/15.9.5.23-9.js: Ditto.
2411 * tests/mozilla/ecma/Date/15.9.5.5.js: Ditto.
2412 * tests/mozilla/ecma/Date/15.9.5.6.js: Ditto.
2413 * tests/mozilla/ecma/Date/15.9.5.7.js: Ditto.
2414 * tests/mozilla/ecma/Date/15.9.5.8.js: Ditto.
2415 * tests/mozilla/ecma/Date/15.9.5.9.js: Ditto.
2417 2005-08-08 Darin Adler <darin@apple.com>
2419 - forgot to delete an obsolete file
2421 * kjs/object_wrapper.h: Deleted.
2423 2005-08-07 Darin Adler <darin@apple.com>
2425 - fixed two problems compiling with gcc 4.0
2427 * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction): Initialized a
2428 variable to quiet an erroneous warning.
2429 * kjs/date_object.cpp: (KJS::makeTime): Removed extraneous KJS:: prefix.
2431 2005-08-07 Darin Adler <darin@apple.com>
2433 Rubber stamped by Maciej.
2435 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
2436 eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
2438 * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
2440 Global replaces and other wonderful stuff.
2442 * bindings/NP_jsobject.cpp:
2448 (_NPN_SetException):
2449 * bindings/c/c_instance.cpp:
2450 (KJS::Bindings::CInstance::CInstance):
2451 (KJS::Bindings::CInstance::invokeMethod):
2452 (KJS::Bindings::CInstance::invokeDefaultMethod):
2453 (KJS::Bindings::CInstance::defaultValue):
2454 (KJS::Bindings::CInstance::stringValue):
2455 (KJS::Bindings::CInstance::numberValue):
2456 (KJS::Bindings::CInstance::booleanValue):
2457 (KJS::Bindings::CInstance::valueOf):
2458 * bindings/c/c_instance.h:
2459 * bindings/c/c_runtime.cpp:
2460 (CField::valueFromInstance):
2461 (CField::setValueToInstance):
2462 * bindings/c/c_runtime.h:
2463 * bindings/c/c_utility.cpp:
2464 (convertNPStringToUTF16):
2465 (convertUTF8ToUTF16):
2466 (coerceValueToNPVariantStringType):
2467 (convertValueToNPVariant):
2468 (convertNPVariantToValue):
2469 * bindings/c/c_utility.h:
2470 * bindings/jni/jni_instance.cpp:
2471 (JavaInstance::stringValue):
2472 (JavaInstance::numberValue):
2473 (JavaInstance::booleanValue):
2474 (JavaInstance::invokeMethod):
2475 (JavaInstance::invokeDefaultMethod):
2476 (JavaInstance::defaultValue):
2477 (JavaInstance::valueOf):
2478 * bindings/jni/jni_instance.h:
2479 * bindings/jni/jni_jsobject.cpp:
2483 (JSObject::getMember):
2484 (JSObject::getSlot):
2485 (JSObject::toString):
2486 (JSObject::convertValueToJObject):
2487 (JSObject::convertJObjectToValue):
2488 (JSObject::listFromJArray):
2489 * bindings/jni/jni_jsobject.h:
2490 * bindings/jni/jni_objc.mm:
2491 (KJS::Bindings::dispatchJNICall):
2492 * bindings/jni/jni_runtime.cpp:
2493 (JavaArray::convertJObjectToArray):
2494 (JavaField::dispatchValueFromInstance):
2495 (JavaField::valueFromInstance):
2496 (JavaField::dispatchSetValueToInstance):
2497 (JavaField::setValueToInstance):
2498 (JavaArray::setValueAt):
2499 (JavaArray::valueAt):
2500 * bindings/jni/jni_runtime.h:
2501 (KJS::Bindings::JavaString::ustring):
2502 * bindings/jni/jni_utility.cpp:
2503 (KJS::Bindings::getJavaVM):
2504 (KJS::Bindings::getJNIEnv):
2505 (KJS::Bindings::getMethodID):
2506 (KJS::Bindings::callJNIVoidMethod):
2507 (KJS::Bindings::callJNIObjectMethod):
2508 (KJS::Bindings::callJNIBooleanMethod):
2509 (KJS::Bindings::callJNIStaticBooleanMethod):
2510 (KJS::Bindings::callJNIByteMethod):
2511 (KJS::Bindings::callJNICharMethod):
2512 (KJS::Bindings::callJNIShortMethod):
2513 (KJS::Bindings::callJNIIntMethod):
2514 (KJS::Bindings::callJNILongMethod):
2515 (KJS::Bindings::callJNIFloatMethod):
2516 (KJS::Bindings::callJNIDoubleMethod):
2517 (KJS::Bindings::callJNIVoidMethodA):
2518 (KJS::Bindings::callJNIObjectMethodA):
2519 (KJS::Bindings::callJNIByteMethodA):
2520 (KJS::Bindings::callJNICharMethodA):
2521 (KJS::Bindings::callJNIShortMethodA):
2522 (KJS::Bindings::callJNIIntMethodA):
2523 (KJS::Bindings::callJNILongMethodA):
2524 (KJS::Bindings::callJNIFloatMethodA):
2525 (KJS::Bindings::callJNIDoubleMethodA):
2526 (KJS::Bindings::callJNIBooleanMethodA):
2527 (KJS::Bindings::callJNIVoidMethodIDA):
2528 (KJS::Bindings::callJNIObjectMethodIDA):
2529 (KJS::Bindings::callJNIByteMethodIDA):
2530 (KJS::Bindings::callJNICharMethodIDA):
2531 (KJS::Bindings::callJNIShortMethodIDA):
2532 (KJS::Bindings::callJNIIntMethodIDA):
2533 (KJS::Bindings::callJNILongMethodIDA):
2534 (KJS::Bindings::callJNIFloatMethodIDA):
2535 (KJS::Bindings::callJNIDoubleMethodIDA):
2536 (KJS::Bindings::callJNIBooleanMethodIDA):
2537 (KJS::Bindings::getCharactersFromJString):
2538 (KJS::Bindings::releaseCharactersForJString):
2539 (KJS::Bindings::getCharactersFromJStringInEnv):
2540 (KJS::Bindings::releaseCharactersForJStringInEnv):
2541 (KJS::Bindings::getUCharactersFromJStringInEnv):
2542 (KJS::Bindings::releaseUCharactersForJStringInEnv):
2543 (KJS::Bindings::JNITypeFromClassName):
2544 (KJS::Bindings::signatureFromPrimitiveType):
2545 (KJS::Bindings::JNITypeFromPrimitiveType):
2546 (KJS::Bindings::getJNIField):
2547 (KJS::Bindings::convertValueToJValue):
2548 * bindings/jni/jni_utility.h:
2549 * bindings/objc/WebScriptObject.mm:
2551 (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
2552 (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
2553 (-[WebScriptObject _imp]):
2554 (-[WebScriptObject _executionContext]):
2555 (-[WebScriptObject _setExecutionContext:]):
2556 (-[WebScriptObject _originExecutionContext]):
2557 (-[WebScriptObject _setOriginExecutionContext:]):
2558 (+[WebScriptObject throwException:]):
2560 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2561 (-[WebScriptObject evaluateWebScript:]):
2562 (-[WebScriptObject setValue:forKey:]):
2563 (-[WebScriptObject valueForKey:]):
2564 (-[WebScriptObject removeWebScriptKey:]):
2565 (-[WebScriptObject stringRepresentation]):
2566 (-[WebScriptObject webScriptValueAtIndex:]):
2567 (-[WebScriptObject setException:]):
2568 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
2569 * bindings/objc/WebScriptObjectPrivate.h:
2570 * bindings/objc/objc_class.h:
2571 * bindings/objc/objc_class.mm:
2572 (KJS::Bindings::ObjcClass::fallbackObject):
2573 * bindings/objc/objc_instance.h:
2574 * bindings/objc/objc_instance.mm:
2575 (ObjcInstance::invokeMethod):
2576 (ObjcInstance::invokeDefaultMethod):
2577 (ObjcInstance::setValueOfField):
2578 (ObjcInstance::setValueOfUndefinedField):
2579 (ObjcInstance::getValueOfField):
2580 (ObjcInstance::getValueOfUndefinedField):
2581 (ObjcInstance::defaultValue):
2582 (ObjcInstance::stringValue):
2583 (ObjcInstance::numberValue):
2584 (ObjcInstance::booleanValue):
2585 (ObjcInstance::valueOf):
2586 * bindings/objc/objc_runtime.h:
2587 * bindings/objc/objc_runtime.mm:
2588 (ObjcField::valueFromInstance):
2589 (convertValueToObjcObject):
2590 (ObjcField::setValueToInstance):
2591 (ObjcArray::setValueAt):
2592 (ObjcArray::valueAt):
2593 (ObjcFallbackObjectImp::put):
2594 (ObjcFallbackObjectImp::callAsFunction):
2595 (ObjcFallbackObjectImp::defaultValue):
2596 * bindings/objc/objc_utility.h:
2597 * bindings/objc/objc_utility.mm:
2598 (Bindings::JSMethodNameToObjCMethodName):
2599 (Bindings::convertValueToObjcValue):
2600 (Bindings::convertNSStringToString):
2601 (Bindings::convertObjcValueToValue):
2602 (Bindings::objcValueTypeForType):
2603 (Bindings::createObjcInstanceForValue):
2604 * bindings/runtime.cpp:
2605 (Instance::getValueOfField):
2606 (Instance::setValueOfField):
2607 (Instance::createRuntimeObject):
2608 (Instance::createLanguageInstanceForValue):
2609 * bindings/runtime.h:
2610 (KJS::Bindings::Constructor::~Constructor):
2611 (KJS::Bindings::Field::~Field):
2612 (KJS::Bindings::MethodList::MethodList):
2613 (KJS::Bindings::Class::fallbackObject):
2614 (KJS::Bindings::Class::~Class):
2615 (KJS::Bindings::Instance::Instance):
2616 (KJS::Bindings::Instance::getValueOfUndefinedField):
2617 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
2618 (KJS::Bindings::Instance::setValueOfUndefinedField):
2619 (KJS::Bindings::Instance::valueOf):
2620 (KJS::Bindings::Instance::setExecutionContext):
2621 (KJS::Bindings::Instance::~Instance):
2622 (KJS::Bindings::Array::~Array):
2623 * bindings/runtime_array.cpp:
2624 (RuntimeArrayImp::RuntimeArrayImp):
2625 (RuntimeArrayImp::lengthGetter):
2626 (RuntimeArrayImp::indexGetter):
2627 (RuntimeArrayImp::put):
2628 * bindings/runtime_array.h:
2629 * bindings/runtime_method.cpp:
2630 (RuntimeMethodImp::lengthGetter):
2631 (RuntimeMethodImp::callAsFunction):
2632 * bindings/runtime_method.h:
2633 * bindings/runtime_object.cpp:
2634 (RuntimeObjectImp::fallbackObjectGetter):
2635 (RuntimeObjectImp::fieldGetter):
2636 (RuntimeObjectImp::methodGetter):
2637 (RuntimeObjectImp::getOwnPropertySlot):
2638 (RuntimeObjectImp::put):
2639 (RuntimeObjectImp::defaultValue):
2640 (RuntimeObjectImp::callAsFunction):
2641 * bindings/runtime_object.h:
2642 * kjs/array_instance.h:
2643 * kjs/array_object.cpp:
2644 (ArrayInstanceImp::ArrayInstanceImp):
2645 (ArrayInstanceImp::lengthGetter):
2646 (ArrayInstanceImp::getOwnPropertySlot):
2647 (ArrayInstanceImp::put):
2648 (ArrayInstanceImp::propList):
2649 (ArrayInstanceImp::setLength):
2650 (compareByStringForQSort):
2651 (compareWithCompareFunctionForQSort):
2652 (ArrayInstanceImp::sort):
2653 (ArrayInstanceImp::pushUndefinedObjectsToEnd):
2654 (ArrayPrototypeImp::ArrayPrototypeImp):
2655 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2656 (ArrayProtoFuncImp::callAsFunction):
2657 (ArrayObjectImp::ArrayObjectImp):
2658 (ArrayObjectImp::construct):
2659 (ArrayObjectImp::callAsFunction):
2660 * kjs/array_object.h:
2661 * kjs/bool_object.cpp:
2662 (BooleanPrototypeImp::BooleanPrototypeImp):
2663 (BooleanProtoFuncImp::BooleanProtoFuncImp):
2664 (BooleanProtoFuncImp::callAsFunction):
2665 (BooleanObjectImp::BooleanObjectImp):
2666 (BooleanObjectImp::construct):
2667 (BooleanObjectImp::callAsFunction):
2668 * kjs/bool_object.h:
2669 * kjs/collector.cpp:
2670 (KJS::Collector::markStackObjectsConservatively):
2671 (KJS::Collector::collect):
2674 (KJS::Completion::Completion):
2675 (KJS::Completion::value):
2676 (KJS::Completion::isValueCompletion):
2678 (KJS::ContextImp::variableObject):
2679 (KJS::ContextImp::setVariableObject):
2680 (KJS::ContextImp::thisValue):
2681 (KJS::ContextImp::activationObject):
2682 (KJS::ContextImp::pushScope):
2683 * kjs/date_object.cpp:
2685 (KJS::timeFromArgs):
2686 (KJS::DatePrototypeImp::DatePrototypeImp):
2687 (KJS::DateProtoFuncImp::DateProtoFuncImp):
2688 (KJS::DateProtoFuncImp::callAsFunction):
2689 (KJS::DateObjectImp::DateObjectImp):
2690 (KJS::DateObjectImp::construct):
2691 (KJS::DateObjectImp::callAsFunction):
2692 (KJS::DateObjectFuncImp::DateObjectFuncImp):
2693 (KJS::DateObjectFuncImp::callAsFunction):
2695 (KJS::KRFCDate_parseDate):
2697 * kjs/date_object.h:
2699 (Debugger::exception):
2700 (Debugger::callEvent):
2701 (Debugger::returnEvent):
2703 * kjs/error_object.cpp:
2704 (ErrorPrototypeImp::ErrorPrototypeImp):
2705 (ErrorProtoFuncImp::ErrorProtoFuncImp):
2706 (ErrorProtoFuncImp::callAsFunction):
2707 (ErrorObjectImp::ErrorObjectImp):
2708 (ErrorObjectImp::construct):
2709 (ErrorObjectImp::callAsFunction):
2710 (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
2711 (NativeErrorImp::NativeErrorImp):
2712 (NativeErrorImp::construct):
2713 (NativeErrorImp::callAsFunction):
2714 * kjs/error_object.h:
2716 (KJS::FunctionImp::FunctionImp):
2717 (KJS::FunctionImp::callAsFunction):
2718 (KJS::FunctionImp::processParameters):
2719 (KJS::FunctionImp::argumentsGetter):
2720 (KJS::FunctionImp::lengthGetter):
2721 (KJS::FunctionImp::put):
2722 (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
2723 (KJS::DeclaredFunctionImp::construct):
2724 (KJS::ArgumentsImp::ArgumentsImp):
2725 (KJS::ArgumentsImp::mappedIndexGetter):
2726 (KJS::ArgumentsImp::put):
2727 (KJS::ActivationImp::argumentsGetter):
2728 (KJS::GlobalFuncImp::GlobalFuncImp):
2731 (KJS::GlobalFuncImp::callAsFunction):
2733 * kjs/function_object.cpp:
2734 (FunctionPrototypeImp::FunctionPrototypeImp):
2735 (FunctionPrototypeImp::callAsFunction):
2736 (FunctionProtoFuncImp::FunctionProtoFuncImp):
2737 (FunctionProtoFuncImp::callAsFunction):
2738 (FunctionObjectImp::FunctionObjectImp):
2739 (FunctionObjectImp::construct):
2740 (FunctionObjectImp::callAsFunction):
2741 * kjs/function_object.h:
2743 (KJS::UndefinedImp::toPrimitive):
2744 (KJS::UndefinedImp::toObject):
2745 (KJS::NullImp::toPrimitive):
2746 (KJS::NullImp::toObject):
2747 (KJS::BooleanImp::toPrimitive):
2748 (KJS::BooleanImp::toObject):
2749 (KJS::StringImp::toPrimitive):
2750 (KJS::StringImp::toObject):
2751 (KJS::NumberImp::toPrimitive):
2752 (KJS::NumberImp::toObject):
2753 (KJS::NumberImp::getUInt32):
2754 (KJS::LabelStack::push):
2755 (KJS::ContextImp::ContextImp):
2756 (KJS::InterpreterImp::globalInit):
2757 (KJS::InterpreterImp::globalClear):
2758 (KJS::InterpreterImp::InterpreterImp):
2759 (KJS::InterpreterImp::initGlobalObject):
2760 (KJS::InterpreterImp::clear):
2761 (KJS::InterpreterImp::mark):
2762 (KJS::InterpreterImp::evaluate):
2763 (KJS::InternalFunctionImp::hasInstance):
2767 (KJS::InterpreterImp::builtinObject):
2768 (KJS::InterpreterImp::builtinFunction):
2769 (KJS::InterpreterImp::builtinArray):
2770 (KJS::InterpreterImp::builtinBoolean):
2771 (KJS::InterpreterImp::builtinString):
2772 (KJS::InterpreterImp::builtinNumber):
2773 (KJS::InterpreterImp::builtinDate):
2774 (KJS::InterpreterImp::builtinRegExp):
2775 (KJS::InterpreterImp::builtinError):
2776 (KJS::InterpreterImp::builtinObjectPrototype):
2777 (KJS::InterpreterImp::builtinFunctionPrototype):
2778 (KJS::InterpreterImp::builtinArrayPrototype):
2779 (KJS::InterpreterImp::builtinBooleanPrototype):
2780 (KJS::InterpreterImp::builtinStringPrototype):
2781 (KJS::InterpreterImp::builtinNumberPrototype):
2782 (KJS::InterpreterImp::builtinDatePrototype):
2783 (KJS::InterpreterImp::builtinRegExpPrototype):
2784 (KJS::InterpreterImp::builtinErrorPrototype):
2785 (KJS::InterpreterImp::builtinEvalError):
2786 (KJS::InterpreterImp::builtinRangeError):
2787 (KJS::InterpreterImp::builtinReferenceError):
2788 (KJS::InterpreterImp::builtinSyntaxError):
2789 (KJS::InterpreterImp::builtinTypeError):
2790 (KJS::InterpreterImp::builtinURIError):
2791 (KJS::InterpreterImp::builtinEvalErrorPrototype):
2792 (KJS::InterpreterImp::builtinRangeErrorPrototype):
2793 (KJS::InterpreterImp::builtinReferenceErrorPrototype):
2794 (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
2795 (KJS::InterpreterImp::builtinTypeErrorPrototype):
2796 (KJS::InterpreterImp::builtinURIErrorPrototype):
2797 * kjs/interpreter.cpp:
2798 (Context::variableObject):
2799 (Context::thisValue):
2800 (Interpreter::Interpreter):
2801 (Interpreter::globalObject):
2802 (Interpreter::evaluate):
2803 (Interpreter::builtinObject):
2804 (Interpreter::builtinFunction):
2805 (Interpreter::builtinArray):
2806 (Interpreter::builtinBoolean):
2807 (Interpreter::builtinString):
2808 (Interpreter::builtinNumber):
2809 (Interpreter::builtinDate):
2810 (Interpreter::builtinRegExp):
2811 (Interpreter::builtinError):
2812 (Interpreter::builtinObjectPrototype):
2813 (Interpreter::builtinFunctionPrototype):
2814 (Interpreter::builtinArrayPrototype):
2815 (Interpreter::builtinBooleanPrototype):
2816 (Interpreter::builtinStringPrototype):
2817 (Interpreter::builtinNumberPrototype):
2818 (Interpreter::builtinDatePrototype):
2819 (Interpreter::builtinRegExpPrototype):
2820 (Interpreter::builtinErrorPrototype):
2821 (Interpreter::builtinEvalError):
2822 (Interpreter::builtinRangeError):
2823 (Interpreter::builtinReferenceError):
2824 (Interpreter::builtinSyntaxError):
2825 (Interpreter::builtinTypeError):
2826 (Interpreter::builtinURIError):
2827 (Interpreter::builtinEvalErrorPrototype):
2828 (Interpreter::builtinRangeErrorPrototype):
2829 (Interpreter::builtinReferenceErrorPrototype):
2830 (Interpreter::builtinSyntaxErrorPrototype):
2831 (Interpreter::builtinTypeErrorPrototype):
2832 (Interpreter::builtinURIErrorPrototype):
2833 (Interpreter::createLanguageInstanceForValue):
2834 * kjs/interpreter.h:
2835 (KJS::Interpreter::isGlobalObject):
2836 (KJS::ExecState::setException):
2837 (KJS::ExecState::clearException):
2838 (KJS::ExecState::exception):
2839 (KJS::ExecState::hadException):
2840 (KJS::ExecState::ExecState):
2844 (KJS::List::operator[]):
2845 (KJS::ListIterator::operator->):
2846 (KJS::ListIterator::operator*):
2847 (KJS::ListIterator::operator++):
2848 (KJS::ListIterator::operator--):
2850 (KJS::staticFunctionGetter):
2851 (KJS::staticValueGetter):
2853 (KJS::cacheGlobalObject):
2854 * kjs/math_object.cpp:
2855 (MathObjectImp::getValueProperty):
2856 (MathFuncImp::MathFuncImp):
2857 (MathFuncImp::callAsFunction):
2858 * kjs/math_object.h:
2860 (Node::evaluateReference):
2862 (Node::setExceptionDetailsIfNeeded):
2863 (NullNode::evaluate):
2864 (BooleanNode::evaluate):
2865 (NumberNode::evaluate):
2866 (StringNode::evaluate):
2867 (RegExpNode::evaluate):
2868 (ThisNode::evaluate):
2869 (ResolveNode::evaluate):
2870 (ResolveNode::evaluateReference):
2871 (GroupNode::evaluate):
2872 (ElementNode::evaluate):
2873 (ArrayNode::evaluate):
2874 (ObjectLiteralNode::evaluate):
2875 (PropertyValueNode::evaluate):
2876 (PropertyNode::evaluate):
2877 (AccessorNode1::evaluate):
2878 (AccessorNode1::evaluateReference):
2879 (AccessorNode2::evaluate):
2880 (AccessorNode2::evaluateReference):
2881 (ArgumentListNode::evaluate):
2882 (ArgumentListNode::evaluateList):
2883 (ArgumentsNode::evaluate):
2884 (NewExprNode::evaluate):
2885 (FunctionCallNode::evaluate):
2886 (PostfixNode::evaluate):
2887 (DeleteNode::evaluate):
2888 (VoidNode::evaluate):
2889 (TypeOfNode::evaluate):
2890 (PrefixNode::evaluate):
2891 (UnaryPlusNode::evaluate):
2892 (NegateNode::evaluate):
2893 (BitwiseNotNode::evaluate):
2894 (LogicalNotNode::evaluate):
2895 (MultNode::evaluate):
2896 (AddNode::evaluate):
2897 (ShiftNode::evaluate):
2898 (RelationalNode::evaluate):
2899 (EqualNode::evaluate):
2900 (BitOperNode::evaluate):
2901 (BinaryLogicalNode::evaluate):
2902 (ConditionalNode::evaluate):
2903 (AssignNode::evaluate):
2904 (CommaNode::evaluate):
2905 (StatListNode::execute):
2906 (AssignExprNode::evaluate):
2907 (VarDeclNode::evaluate):
2908 (VarDeclNode::processVarDecls):
2909 (VarDeclListNode::evaluate):
2910 (ExprStatementNode::execute):
2912 (DoWhileNode::execute):
2913 (WhileNode::execute):
2915 (ForInNode::execute):
2916 (ContinueNode::execute):
2917 (BreakNode::execute):
2918 (ReturnNode::execute):
2919 (WithNode::execute):
2920 (CaseClauseNode::evaluate):
2921 (ClauseListNode::evaluate):
2922 (CaseBlockNode::evaluate):
2923 (CaseBlockNode::evalBlock):
2924 (SwitchNode::execute):
2925 (ThrowNode::execute):
2926 (CatchNode::execute):
2928 (ParameterNode::evaluate):
2929 (FuncDeclNode::processFuncDecl):
2930 (FuncExprNode::evaluate):
2931 (SourceElementsNode::execute):
2933 (KJS::StatementNode::evaluate):
2934 * kjs/number_object.cpp:
2935 (NumberPrototypeImp::NumberPrototypeImp):
2936 (NumberProtoFuncImp::NumberProtoFuncImp):
2937 (NumberProtoFuncImp::callAsFunction):
2938 (NumberObjectImp::NumberObjectImp):
2939 (NumberObjectImp::getValueProperty):
2940 (NumberObjectImp::construct):
2941 (NumberObjectImp::callAsFunction):
2942 * kjs/number_object.h:
2944 (KJS::ObjectImp::call):
2945 (KJS::ObjectImp::mark):
2946 (KJS::ObjectImp::classInfo):
2947 (KJS::ObjectImp::get):
2948 (KJS::ObjectImp::getProperty):
2949 (KJS::ObjectImp::getPropertySlot):
2950 (KJS::ObjectImp::put):
2951 (KJS::ObjectImp::hasOwnProperty):
2952 (KJS::ObjectImp::defaultValue):
2953 (KJS::ObjectImp::findPropertyHashEntry):
2954 (KJS::ObjectImp::construct):
2955 (KJS::ObjectImp::callAsFunction):
2956 (KJS::ObjectImp::hasInstance):
2957 (KJS::ObjectImp::propList):
2958 (KJS::ObjectImp::toPrimitive):
2959 (KJS::ObjectImp::toNumber):
2960 (KJS::ObjectImp::toString):
2961 (KJS::ObjectImp::toObject):
2962 (KJS::ObjectImp::putDirect):
2963 (KJS::Error::create):
2967 (KJS::ObjectImp::getPropertySlot):
2968 (KJS::AllocatedValueImp::isObject):
2969 (KJS::ObjectImp::ObjectImp):
2970 (KJS::ObjectImp::internalValue):
2971 (KJS::ObjectImp::setInternalValue):
2972 (KJS::ObjectImp::prototype):
2973 (KJS::ObjectImp::setPrototype):
2974 (KJS::ObjectImp::inherits):
2975 * kjs/object_object.cpp:
2976 (ObjectPrototypeImp::ObjectPrototypeImp):
2977 (ObjectProtoFuncImp::ObjectProtoFuncImp):
2978 (ObjectProtoFuncImp::callAsFunction):
2979 (ObjectObjectImp::ObjectObjectImp):
2980 (ObjectObjectImp::construct):
2981 (ObjectObjectImp::callAsFunction):
2982 * kjs/object_object.h:
2983 * kjs/operations.cpp:
2990 * kjs/property_map.cpp:
2991 (KJS::PropertyMap::mark):
2992 (KJS::PropertyMap::addEnumerablesToReferenceList):
2993 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
2994 (KJS::PropertyMap::save):
2995 (KJS::PropertyMap::restore):
2996 * kjs/property_map.h:
2997 * kjs/property_slot.cpp:
2998 (KJS::PropertySlot::undefinedGetter):
2999 * kjs/property_slot.h:
3000 (KJS::PropertySlot::getValue):
3002 (KJS::gcUnprotectNullTolerant):
3003 (KJS::ProtectedValue::ProtectedValue):
3004 (KJS::ProtectedValue::~ProtectedValue):
3005 (KJS::ProtectedValue::operator=):
3006 (KJS::ProtectedValue::operator ValueImp *):
3007 (KJS::ProtectedValue::operator->):
3008 * kjs/protected_object.h:
3009 (KJS::ProtectedObject::ProtectedObject):
3010 (KJS::ProtectedObject::operator=):
3011 (KJS::ProtectedObject::operator ValueImp *):
3012 (KJS::ProtectedObject::operator ObjectImp *):
3013 (KJS::ProtectedObject::operator->):
3014 (KJS::ProtectedReference::ProtectedReference):
3015 (KJS::ProtectedReference::~ProtectedReference):
3016 (KJS::ProtectedReference::operator=):
3017 * kjs/protected_values.cpp:
3018 (KJS::ProtectedValues::getProtectCount):
3019 (KJS::ProtectedValues::increaseProtectCount):
3020 (KJS::ProtectedValues::insert):
3021 (KJS::ProtectedValues::decreaseProtectCount):
3022 * kjs/protected_values.h:
3023 * kjs/reference.cpp:
3024 (KJS::Reference::Reference):
3025 (KJS::Reference::makeValueReference):
3026 (KJS::Reference::getBase):
3027 (KJS::Reference::getValue):
3028 (KJS::Reference::putValue):
3029 (KJS::Reference::deleteValue):
3031 (KJS::Reference::baseIfMutable):
3032 * kjs/regexp_object.cpp:
3033 (RegExpPrototypeImp::RegExpPrototypeImp):
3034 (RegExpProtoFuncImp::RegExpProtoFuncImp):
3035 (RegExpProtoFuncImp::callAsFunction):
3036 (RegExpObjectImp::RegExpObjectImp):
3037 (RegExpObjectImp::arrayOfMatches):
3038 (RegExpObjectImp::backrefGetter):
3039 (RegExpObjectImp::construct):
3040 (RegExpObjectImp::callAsFunction):
3041 * kjs/regexp_object.h:
3042 * kjs/string_object.cpp:
3043 (StringInstanceImp::lengthGetter):
3044 (StringInstanceImp::indexGetter):
3045 (StringInstanceImp::getOwnPropertySlot):
3046 (StringInstanceImp::put):
3047 (StringPrototypeImp::StringPrototypeImp):
3048 (StringProtoFuncImp::StringProtoFuncImp):
3051 (StringProtoFuncImp::callAsFunction):
3052 (StringObjectImp::StringObjectImp):
3053 (StringObjectImp::construct):
3054 (StringObjectImp::callAsFunction):
3055 (StringObjectFuncImp::StringObjectFuncImp):
3056 (StringObjectFuncImp::callAsFunction):
3057 * kjs/string_object.h:
3059 (TestFunctionImp::callAsFunction):
3060 (VersionFunctionImp::callAsFunction):
3063 (KJS::AllocatedValueImp::operator new):
3064 (KJS::AllocatedValueImp::getUInt32):
3065 (KJS::ValueImp::toInteger):
3066 (KJS::ValueImp::toInt32):
3067 (KJS::ValueImp::toUInt32):
3068 (KJS::ValueImp::toUInt16):
3069 (KJS::ValueImp::toObject):
3070 (KJS::AllocatedValueImp::getBoolean):
3071 (KJS::AllocatedValueImp::getNumber):
3072 (KJS::AllocatedValueImp::getString):
3073 (KJS::AllocatedValueImp::getObject):
3076 (KJS::ConstantValues::init):
3077 (KJS::ConstantValues::clear):
3078 (KJS::ConstantValues::mark):
3085 (KJS::ValueImp::ValueImp):
3086 (KJS::ValueImp::~ValueImp):
3087 (KJS::AllocatedValueImp::AllocatedValueImp):
3088 (KJS::AllocatedValueImp::~AllocatedValueImp):
3089 (KJS::AllocatedValueImp::isBoolean):
3090 (KJS::AllocatedValueImp::isNumber):
3091 (KJS::AllocatedValueImp::isString):
3092 (KJS::AllocatedValueImp::isObject):
3093 (KJS::AllocatedValueImp::marked):
3094 (KJS::AllocatedValueImp::mark):
3095 (KJS::ValueImp::downcast):
3096 (KJS::ValueImp::isUndefined):
3097 (KJS::ValueImp::isNull):
3098 (KJS::ValueImp::isUndefinedOrNull):
3099 (KJS::ValueImp::isBoolean):
3100 (KJS::ValueImp::isNumber):
3101 (KJS::ValueImp::isString):
3102 (KJS::ValueImp::isObject):
3103 (KJS::ValueImp::getBoolean):
3104 (KJS::ValueImp::getNumber):
3105 (KJS::ValueImp::getString):
3106 (KJS::ValueImp::getObject):
3107 (KJS::ValueImp::getUInt32):
3108 (KJS::ValueImp::mark):
3109 (KJS::ValueImp::marked):
3110 (KJS::ValueImp::type):
3111 (KJS::ValueImp::toPrimitive):
3112 (KJS::ValueImp::toBoolean):
3113 (KJS::ValueImp::toNumber):
3114 (KJS::ValueImp::toString):
3124 2005-08-06 Maciej Stachowiak <mjs@apple.com>
3128 Change over to the new PropertySlot mechanism for property
3129 lookup. This allows the elimination of hasOwnProperty
3130 methods. Also did some of the performance tuning enabled by this
3131 (but not yet all the possible improvements for function calls,
3132 assignment, ++, and so forth). And also much code cleanup.
3134 Net result is about a 2% speedup on the JS iBench.
3136 Also redid Geoff's fix for the chrashing applet by avoiding a NULL
3137 prototype in the bindings code and using the default of Null()
3140 * JavaScriptCore.xcodeproj/project.pbxproj:
3141 * bindings/objc/objc_runtime.h:
3142 * bindings/objc/objc_runtime.mm:
3143 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3144 (ObjcFallbackObjectImp::getOwnPropertySlot):
3145 * bindings/runtime_array.cpp:
3146 (RuntimeArrayImp::lengthGetter):
3147 (RuntimeArrayImp::indexGetter):
3148 (RuntimeArrayImp::getOwnPropertySlot):
3149 * bindings/runtime_array.h:
3150 * bindings/runtime_method.cpp:
3151 (RuntimeMethodImp::lengthGetter):
3152 (RuntimeMethodImp::getOwnPropertySlot):
3153 * bindings/runtime_method.h:
3154 * bindings/runtime_object.cpp:
3155 (RuntimeObjectImp::RuntimeObjectImp):
3156 (RuntimeObjectImp::fallbackObjectGetter):
3157 (RuntimeObjectImp::fieldGetter):
3158 (RuntimeObjectImp::methodGetter):
3159 (RuntimeObjectImp::getOwnPropertySlot):
3160 * bindings/runtime_object.h:
3161 * bindings/runtime_root.h:
3162 * kjs/array_instance.h:
3163 * kjs/array_object.cpp:
3164 (ArrayInstanceImp::lengthGetter):
3165 (ArrayInstanceImp::getOwnPropertySlot):
3166 (ArrayPrototypeImp::getOwnPropertySlot):
3167 * kjs/array_object.h:
3168 * kjs/date_object.cpp:
3169 (DatePrototypeImp::getOwnPropertySlot):
3170 * kjs/date_object.h:
3172 (KJS::FunctionImp::argumentsGetter):
3173 (KJS::FunctionImp::lengthGetter):
3174 (KJS::FunctionImp::getOwnPropertySlot):
3175 (KJS::FunctionImp::put):
3176 (KJS::FunctionImp::deleteProperty):
3177 (KJS::ArgumentsImp::mappedIndexGetter):
3178 (KJS::ArgumentsImp::getOwnPropertySlot):
3179 (KJS::ActivationImp::argumentsGetter):
3180 (KJS::ActivationImp::getArgumentsGetter):
3181 (KJS::ActivationImp::getOwnPropertySlot):
3182 (KJS::ActivationImp::deleteProperty):
3185 (InterpreterImp::InterpreterImp):
3186 (InterpreterImp::initGlobalObject):
3187 (InterpreterImp::~InterpreterImp):
3188 (InterpreterImp::evaluate):
3190 (KJS::InterpreterImp::globalExec):
3191 * kjs/interpreter.cpp:
3192 (Interpreter::Interpreter):
3193 (Interpreter::createLanguageInstanceForValue):
3194 * kjs/interpreter.h:
3195 (KJS::Interpreter::argumentsIdentifier):
3196 (KJS::Interpreter::specialPrototypeIdentifier):
3198 (KJS::staticFunctionGetter):
3199 (KJS::staticValueGetter):
3200 (KJS::getStaticPropertySlot):
3201 (KJS::getStaticFunctionSlot):
3202 (KJS::getStaticValueSlot):
3203 * kjs/math_object.cpp:
3204 (MathObjectImp::getOwnPropertySlot):
3205 * kjs/math_object.h:
3207 (ResolveNode::evaluate):
3208 (ResolveNode::evaluateReference):
3209 (AccessorNode1::evaluate):
3210 (AccessorNode2::evaluate):
3211 * kjs/number_object.cpp:
3212 (NumberObjectImp::getOwnPropertySlot):
3213 * kjs/number_object.h:
3215 (KJS::ObjectImp::get):
3216 (KJS::ObjectImp::getProperty):
3217 (KJS::ObjectImp::getPropertySlot):
3218 (KJS::ObjectImp::getOwnPropertySlot):
3219 (KJS::ObjectImp::put):
3220 (KJS::ObjectImp::hasProperty):
3221 (KJS::ObjectImp::hasOwnProperty):
3223 (KJS::ObjectImp::getDirectLocation):
3224 (KJS::ObjectImp::getPropertySlot):
3225 (KJS::ObjectImp::getOwnPropertySlot):
3226 * kjs/object_wrapper.h: Added.
3228 (KJS::Object::Object):
3229 (KJS::Object::operator ObjectImp *):
3230 * kjs/property_map.cpp:
3231 (KJS::PropertyMap::getLocation):
3232 * kjs/property_map.h:
3233 * kjs/property_slot.cpp: Added.
3234 (KJS::PropertySlot::undefinedGetter):
3235 * kjs/property_slot.h: Added.
3236 (KJS::PropertySlot::isSet):
3237 (KJS::PropertySlot::getValue):
3238 (KJS::PropertySlot::setValueSlot):
3239 (KJS::PropertySlot::setStaticEntry):
3240 (KJS::PropertySlot::setCustom):
3241 (KJS::PropertySlot::setCustomIndex):
3242 (KJS::PropertySlot::setUndefined):
3243 (KJS::PropertySlot::slotBase):
3244 (KJS::PropertySlot::staticEntry):
3245 (KJS::PropertySlot::index):
3246 (KJS::PropertySlot::):
3248 * kjs/protected_object.h: Added.
3249 (KJS::ProtectedObject::ProtectedObject):
3250 (KJS::ProtectedObject::~ProtectedObject):
3251 (KJS::ProtectedObject::operator=):
3252 (KJS::ProtectedReference::ProtectedReference):
3253 (KJS::ProtectedReference::~ProtectedReference):
3254 (KJS::ProtectedReference::operator=):
3256 * kjs/reference_list.cpp:
3257 * kjs/regexp_object.cpp:
3258 (RegExpObjectImp::backrefGetter):
3259 (RegExpObjectImp::getOwnPropertySlot):
3260 * kjs/regexp_object.h:
3261 * kjs/string_object.cpp:
3262 (StringInstanceImp::lengthGetter):
3263 (StringInstanceImp::indexGetter):
3264 (StringInstanceImp::getOwnPropertySlot):
3265 (StringPrototypeImp::getOwnPropertySlot):
3266 * kjs/string_object.h:
3268 2005-08-05 Adele Peterson <adele@apple.com>
3272 * JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
3274 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3276 -fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs
3277 after clicking on Hangman applet
3282 (KJS::ObjectImp::hasProperty): added check for null prototype.
3284 FIXME: The long-term plan is to make runtime objects use JS Null()
3285 instead of null pointers, which will allow us to eliminate null
3286 checks, improving performance.
3288 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3290 Fix by darin, reviewed by me.
3292 - rolled in fix for: <rdar://problem/4161606> JavaScript regular
3293 expressions with certain ranges of Unicode characters cause a crash
3297 * layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
3298 * layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
3301 (compile_branch): added checks for characters > 255
3303 2005-08-04 Maciej Stachowiak <mjs@apple.com>
3305 - updated expected test results now that we no longer exlude the
3306 date tests (apparently this was overlooked)
3308 * tests/mozilla/expected.html:
3310 2005-07-31 Darin Adler <darin@apple.com>
3314 - remove uses of Mac-OS-X-specific MAX macro
3315 - remove one of the many excess "APPLE_CHANGES" ifdefs
3317 * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
3318 * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
3320 (KJS::UChar::toLower): Take out non-ICU code path.
3321 (KJS::UChar::toUpper): Ditto.
3322 (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
3324 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3326 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4147
3327 Array.toString() and toLocaleString() improvements from KDE KJS
3328 (rolled in KDE changes)
3332 * layout-tests/fast/js/toString-overrides-expected.txt: Added.
3333 * layout-tests/fast/js/toString-overrides.html: Added.
3335 * kjs/array_object.cpp:
3336 (ArrayProtoFuncImp::call):
3338 2005-07-27 Maciej Stachowiak <mjs@apple.com>
3340 Changes by Michael Kahl, reviewed by me.
3342 - fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
3344 * JavaScriptCore.xcodeproj/project.pbxproj:
3346 (KJS::AttachedInterpreter::AttachedInterpreter):
3347 (KJS::AttachedInterpreter::~AttachedInterpreter):
3348 (Debugger::~Debugger):
3351 (Debugger::sourceParsed):
3354 (KJS::FunctionImp::call):
3355 (KJS::GlobalFuncImp::call):
3356 * kjs/function_object.cpp:
3357 (FunctionObjectImp::construct):
3361 (InterpreterImp::evaluate):
3363 (KJS::InterpreterImp::setDebugger):
3364 * kjs/interpreter.cpp:
3365 * kjs/interpreter.h:
3366 (KJS::Interpreter::imp):
3369 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3371 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3381
3372 Date.prototype.setDate() incorrect for values >=128
3376 * layout-tests/fast/js/date-big-setdate-expected.txt: Added.
3377 * layout-tests/fast/js/date-big-setdate.html: Added.
3381 * kjs/date_object.cpp:
3382 (DateProtoFuncImp::call):
3384 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3386 -rolled in patch by Carsten Guenther <cguenther@gmail.com>
3387 for http://bugzilla.opendarwin.org/show_bug.cgi?id=3759
3388 Date object enhancements
3392 * layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
3393 * layout-tests/fast/js/date-preserve-milliseconds.html: Added.
3397 * kjs/date_object.cpp:
3399 (DateProtoFuncImp::call):
3400 (DateObjectImp::construct):
3401 (DateObjectFuncImp::call):
3403 * kjs/date_object.h:
3404 * tests/mozilla/expected.html:
3406 2005-07-26 Justin Garcia <justin.garcia@apple.com>
3408 Added a forward declaration to fix gcc4 build error
3412 2005-07-25 Geoffrey Garen <ggaren@apple.com>
3413 - fixed mistake in my last checkin -- the expected results included
3414 results from a patch that hasn't landed yet.
3416 * tests/mozilla/expected.html:
3418 2005-07-25 Maciej Stachowiak <mjs@apple.com>
3420 - fix mistake in last change that leads to assertion failure in the Development build
3423 (KJS::lookupGetOwnValue):
3425 2005-07-24 Maciej Stachowiak <mjs@apple.com>
3429 - http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
3430 (change JavaScript property access to avoid double lookup)
3432 - 10% speedup on JavaScript iBench
3433 - 5% speedup on 24fun BenchJS benchmark
3435 Changed all get methods to getOwnProperty - they are no longer
3436 responsible for prototype lookup, and determine if the property
3437 was found as a side efect.
3439 get() is now a nonvirtual ObjectImp method which calls the virtual
3440 getOwnProperty and walks the prototype chain. A few selected
3441 methods were inlined.
3443 Changed ResolveNode::evaluate plus some other places to use
3444 getProperty which does get() and hasProperty() in one lookup.
3446 Also miscellaneous code cleanup.
3448 * bindings/objc/objc_runtime.h:
3449 * bindings/objc/objc_runtime.mm:
3450 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3451 (ObjcFallbackObjectImp::getOwnProperty):
3452 * bindings/runtime_array.cpp:
3453 (RuntimeArrayImp::RuntimeArrayImp):
3454 (RuntimeArrayImp::getOwnProperty):
3455 * bindings/runtime_array.h:
3456 * bindings/runtime_method.cpp:
3457 (RuntimeMethodImp::getOwnProperty):
3458 * bindings/runtime_method.h:
3459 * bindings/runtime_object.cpp:
3460 (RuntimeObjectImp::getOwnProperty):
3461 * bindings/runtime_object.h:
3462 * kjs/array_instance.h:
3463 * kjs/array_object.cpp:
3464 (ArrayInstanceImp::getOwnProperty):
3465 (ArrayPrototypeImp::getOwnProperty):
3466 (ArrayProtoFuncImp::call):
3467 * kjs/array_object.h:
3468 * kjs/date_object.cpp:
3469 (DatePrototypeImp::getOwnProperty):
3470 * kjs/date_object.h:
3472 (KJS::FunctionImp::getOwnProperty):
3473 (KJS::ArgumentsImp::getOwnProperty):
3474 (KJS::ActivationImp::getOwnProperty):
3477 (KJS::lookupGetOwnProperty):
3478 (KJS::lookupGetOwnFunction):
3479 (KJS::lookupGetOwnValue):
3480 * kjs/math_object.cpp:
3481 (MathObjectImp::getOwnProperty):
3482 (MathObjectImp::getValueProperty):
3483 * kjs/math_object.h:
3485 (ResolveNode::evaluate):
3486 * kjs/number_object.cpp:
3487 (NumberObjectImp::getOwnProperty):
3488 * kjs/number_object.h:
3490 (KJS::ObjectImp::get):