1 2005-11-03 Geoffrey Garen <ggaren@apple.com>
3 - Updated JavaScriptCore test results to reflect recent fixes.
5 * tests/mozilla/expected.html:
7 2005-11-03 Geoffrey Garen <ggaren@apple.com>
11 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5602
12 REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
14 We now update lastIndex relative to the start of the last match,
15 rather than the start of the last search. We used to assume that
16 the two were equal, but that may not be the case in $ matches.
18 * kjs/regexp_object.cpp:
19 (RegExpProtoFuncImp::callAsFunction):
21 2005-10-24 John Sullivan <sullivan@apple.com>
23 Reviewed by Darin Adler. Code changes by Alexey Proskuryakov.
25 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4931
26 Unicode format characters (Cf) should be removed from JavaScript source
29 include <unicode/uchar.h>
31 use KJS::UChar instead of UChar to avoid ambiguity caused by new include
33 ditto; also, use shift(4) to skip first 4 chars to take advantage of new
36 skip chars of type U_FORMAT_CHAR
37 (Lexer::convertUnicode):
38 use KJS::UChar instead of UChar to avoid ambiguity caused by new include
41 (Lexer::makeIdentifier):
46 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
47 updated to skip soft hyphens
49 2005-10-24 John Sullivan <sullivan@apple.com>
51 Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
53 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4142
54 Date object does not always adjust daylight savings correctly
56 * kjs/date_object.cpp:
58 Fix the case where a time change crosses the daylight savings start/end dates.
60 2005-10-17 Maciej Stachowiak <mjs@apple.com>
62 Reviewed by Geoff. Code changes by Darin.
64 - some micro-optimizations to FastMalloc to reduce math and branches.
66 * kxmlcore/FastMalloc.cpp:
67 (KXMLCore::TCMalloc_Central_FreeList::Populate):
68 (KXMLCore::fastMallocRegisterThread):
69 (KXMLCore::TCMalloc_ThreadCache::GetCache):
70 (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
72 2005-10-15 Maciej Stachowiak <mjs@apple.com>
74 Reverted fix for this bug, because it was part of a time range that caused a performance
77 <rdar://problem/4260481> Remove Reference type from JavaScriptCore
79 2005-10-15 Darin Adler <darin@apple.com>
81 * kxmlcore/HashTable.cpp: Fixed build failure (said hashtable.h instead of HashTable.h).
83 2005-10-14 Geoffrey Garen <ggaren@apple.com>
85 Style changes recommended by Darin.
87 Changed to camelCase, changed ValueImp* to ValueImp *.
89 * kjs/simple_number.h:
90 (KJS::SimpleNumber::make):
91 (KJS::SimpleNumber::value):
93 2005-10-11 Geoffrey Garen <ggaren@apple.com>
95 Added regexp_object.lut.h build phase from JavaScriptCore
96 to JavaScriptCore+SVG.
100 * JavaScriptCore.xcodeproj/project.pbxproj:
102 2005-10-11 Geoffrey Garen <ggaren@apple.com>
104 Fixed build bustage from last checkin (stray characters
105 in the project file).
109 * JavaScriptCore.xcodeproj/project.pbxproj:
111 2005-10-11 Geoffrey Garen <ggaren@apple.com>
113 New JavaScriptCore test results to reflect the last change.
115 * tests/mozilla/expected.html:
117 2005-10-10 Geoffrey Garen <ggaren@apple.com>
119 - Implemented caching of match state inside the global RegExp object
120 (lastParen, leftContext, rightContext, lastMatch, input).
122 exec(), test(), match(), search(), and replace() now dipatch regular
123 expression matching through the RegExp object's performMatch function,
124 to facilitate caching. This replaces registerRegexp and
127 - Implemented the special '$' aliases (e.g. RegExp.input aliases to
130 - Moved support for backreferences into the new static hash table
131 used for other special RegExp properties. Truncated backreferences
132 at $9 to match IE, FF, and the "What's New in Netscape 1.2?" doc.
133 (String.replace still supports double-digit backreferences.)
135 - Tweaked RegExp.prototype.exec to handle ginormous values in lastIndex.
137 Fixes 11 -- count em, 11 -- JavaScriptCore tests.
139 * fast/js/regexp-caching-expected.txt: Added.
140 * fast/js/regexp-caching.html: Added.
144 * JavaScriptCore.xcodeproj/project.pbxproj: Added regexp_object.lut.h
145 * kjs/create_hash_table: Tweaked to allow for more exotic characters.
146 We now rely on the compiler to catch illegal
149 (KJS::RegExp::RegExp):
150 * kjs/regexp_object.cpp:
151 (RegExpProtoFuncImp::callAsFunction):
152 (RegExpObjectImp::RegExpObjectImp):
153 (RegExpObjectImp::performMatch):
154 (RegExpObjectImp::arrayOfMatches):
155 (RegExpObjectImp::backrefGetter):
156 (RegExpObjectImp::getLastMatch):
157 (RegExpObjectImp::getLastParen):
158 (RegExpObjectImp::getLeftContext):
159 (RegExpObjectImp::getRightContext):
160 (RegExpObjectImp::getOwnPropertySlot):
161 (RegExpObjectImp::getValueProperty):
162 (RegExpObjectImp::put):
163 (RegExpObjectImp::putValueProperty):
164 * kjs/regexp_object.h:
165 (KJS::RegExpObjectImp::):
166 * kjs/string_object.cpp:
167 (substituteBackreferences):
169 (StringProtoFuncImp::callAsFunction):
171 2005-10-09 Darin Adler <darin@apple.com>
173 Reviewed by Maciej; some changes done after review.
175 - fixed <rdar://problem/4092064> hanging loading page; rte.ie (works in IE and Firefox)
176 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5280
177 Date.setMonth fails with negative values
178 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5154
179 JSC should switch to _r variants of unix time/date functions
180 - fixed a few possible overflow cases
182 Retested all tests to be sure nothing broke; added layout test for bug 5280.
184 * kjs/config.h: Removed TIME_WITH_SYS_TIME define. Also set HAVE_SYS_TIMEB_H
185 for the __APPLE__ case (the latter is accurate but irrelevant).
187 * kjs/date_object.h: Reformatted. Removed unnecessary include of "function_object.h".
188 Moved declarations of helper classes and functions into the cpp file.
190 * kjs/date_object.cpp: Removed code at top to define macros to use CoreFoundation instead of
191 POSIX date functions.
192 (KJS::styleFromArgString): Tweaked to return early instead of using a variable.
193 (KJS::formatLocaleDate): Tweaked to check for undefined rather than checking argument count.
194 (KJS::formatDate): Made parameter const.
195 (KJS::formatDateUTCVariant): Ditto.
196 (KJS::formatTime): Ditto.
197 (KJS::DateProtoFuncImp::callAsFunction): Use gmtime_r and localtime_r instead of gmtime and
199 (KJS::DateObjectImp::callAsFunction): Use localtime_r instead of localtime.
200 (KJS::ymdhmsToSeconds): Renamed from ymdhms_to_seconds. Changed computation to avoid possible
201 overflow if year is an extremely large or small number.
202 (KJS::makeTime): Removed code to move large month numbers from tm_mon to tm_year; this was
203 to accomodate CFGregorianDate, which is no longer used (and didn't handle negative values).
204 (KJS::parseDate): Renamed from KRFCDate_parseDate; changed to return a value in milliseconds
205 rather than in seconds. Reformatted the code. Changed to use UTF8String() instead of ascii(),
206 since ascii() is not thread safe. Changed some variables back from int to long to avoid
207 trouble if the result of strtol does not fit in an int (64-bit issue only).
209 2005-10-08 Mitz Pettel <opendarwin.org@mitzpettel.com>
212 Tweaked and landed by Darin.
214 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5266
215 Support parenthesized comments in Date.parse()
217 * kjs/date_object.cpp:
218 (KJS::skipSpacesAndComments): Take a pointer, and advance it past spaces,
219 and also past anything enclosed in parentheses.
220 (KJS::KRFCDate_parseDate): Use skipSpacesAndComments wherever we formerly had
223 2005-10-08 Justin Haygood <justin@xiondigital.net>
225 Reviewed, tweaked, and landed by Darin.
227 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5189
228 pcre_exec.c fails to compile using MSVC
229 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5190
230 KJS config.h adjustment for Win32
232 * kjs/config.h: Make sure HAVE_MMAP and HAVE_SBRK are off for Win32.
233 Turn HAVE_ERRNO_H on for Mac OS X. Sort defines so they are easy to compare
234 with each other. Remove #undef of DEBUG_COLLECTOR.
235 * pcre/pcre_exec.c: (match): Work around strange MSVC complaint by splitting
236 the definition of a local variable into a separate declaration and
239 2005-10-05 Geoffrey Garen <ggaren@apple.com>
241 - Darin and I rewrote our implementation of the SimpleNumber class
242 to store number bit patterns in their floating point formats.
244 My tweaks reviewed by Darin.
246 ~1% speedup on JS iBench.
248 * kjs/internal.h: removed obsolete jsNumber declarations.
249 * kjs/math_object.cpp:
250 (MathFuncImp::callAsFunction): changed KJS::isNaN to isNaN
252 (PostfixResolveNode::evaluate): removed obsolete knownToBeInteger
253 (PostfixBracketNode::evaluate): ditto
254 (PostfixDotNode::evaluate): ditto
255 (PrefixResolveNode::evaluate): ditto
256 (PrefixBracketNode::evaluate): ditto
257 (PrefixDotNode::evaluate): ditto
258 (NegateNode::evaluate): ditto
259 (valueForReadModifyAssignment): ditto
260 * kjs/number_object.cpp: removed obsolete comment
261 * kjs/operations.cpp:
262 (KJS::equal): removed unnecessary isNaN checks
263 (KJS::strictEqual): ditto
264 (KJS::add): removed obsolete knownToBeInteger
266 * kjs/operations.h: removed include of "value.h" to prevent circular reference
267 * kjs/simple_number.h: removed unnecessary #includes
268 (KJS::SimpleNumber::make): see above
269 (KJS::SimpleNumber::is): ditto
270 (KJS::SimpleNumber::value): ditto
271 * kjs/string_object.cpp:
272 (StringProtoFuncImp::callAsFunction): changed KJS::isNaN to isNaN
273 * kjs/ustring.cpp: removed unnecessary isNaN check
274 (KJS::UString::toUInt32): ditto
276 (KJS::jsNumber): removed obsolete jsNumber definitions
277 (KJS::ConstantValues::init): NaN is no longer a ConstantValue
278 (KJS::ConstantValues::clear): ditto
279 (KJS::ConstantValues::mark): ditto
280 * kjs/value.h: removed obsolete knownToBeInteger
281 (KJS::jsNaN): now returns a SimpleNumber
282 (KJS::ValueImp::getUInt32): changed to account for NaN being a SimpleNumber
283 (KJS::ValueImp::toBoolean): ditto
284 (KJS::ValueImp::toString): changed to account for +/- 0.0
285 (KJS::jsZero): changed to reflect that SimpleNumber::make takes a double
288 (KJS::Number): removed obsolete non-double constructor declarations
290 2005-10-05 Maciej Stachowiak <mjs@apple.com>
294 - fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
296 Also fixed some bugs with for..in enumeration while I was at it. object
297 properties now come before prototype properties and duplicates
298 between object and prototype are listed only once.
300 * JavaScriptCore.xcodeproj/project.pbxproj:
301 * kjs/IdentifierSequencedSet.cpp: Added.
302 (KJS::IdentifierSequencedSet::IdentifierSequencedSet):
303 (KJS::IdentifierSequencedSet::deallocateVector):
304 (KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
305 (KJS::IdentifierSequencedSet::insert):
306 * kjs/IdentifierSequencedSet.h: Added.
307 (KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
308 (KJS::IdentifierSequencedSetIterator::operator*):
309 (KJS::IdentifierSequencedSetIterator::operator->):
310 (KJS::IdentifierSequencedSetIterator::operator++):
311 (KJS::IdentifierSequencedSetIterator::operator==):
312 (KJS::IdentifierSequencedSetIterator::operator!=):
313 (KJS::IdentifierSequencedSet::begin):
314 (KJS::IdentifierSequencedSet::end):
315 (KJS::IdentifierSequencedSet::size):
316 * kjs/array_instance.h:
317 * kjs/array_object.cpp:
318 (ArrayInstanceImp::getPropertyNames):
319 (ArrayInstanceImp::setLength):
320 (ArrayInstanceImp::pushUndefinedObjectsToEnd):
322 (ForInNode::execute):
325 (KJS::ObjectImp::getPropertyNames):
327 * kjs/property_map.cpp:
328 (KJS::PropertyMap::getEnumerablePropertyNames):
329 (KJS::PropertyMap::getSparseArrayPropertyNames):
330 * kjs/property_map.h:
332 * kjs/protected_reference.h: Removed.
333 * kjs/reference.cpp: Removed.
334 * kjs/reference.h: Removed.
335 * kjs/reference_list.cpp: Removed.
336 * kjs/reference_list.h: Removed.
338 (KJS::UString::impl):
339 * kxmlcore/HashSet.h:
341 2005-10-04 Eric Seidel <eseidel@apple.com>
345 Code cleanup, which resulted in a small win on iBench.
348 (KJS::tryGetAndCallProperty): new static inline
349 (KJS::ObjectImp::defaultValue): code cleanup
351 2005-10-03 Maciej Stachowiak <mjs@apple.com>
353 Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
355 - more Linux build fixes
357 * kjs/operations.cpp:
358 * kxmlcore/FastMalloc.h:
359 * kxmlcore/TCSystemAlloc.cpp:
360 (TCMalloc_SystemAlloc):
362 2005-10-03 Maciej Stachowiak <mjs@apple.com>
364 Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
366 http://bugzilla.opendarwin.org/show_bug.cgi?id=5174
367 Add support for compiling on Linux (likely to help for other POSIX systems too)
370 (KJS::Collector::markCurrentThreadConservatively):
371 (KJS::Collector::markOtherThreadConservatively):
373 * kjs/date_object.cpp:
375 (KJS::formatDateUTCVariant):
377 (KJS::timeZoneOffset):
378 (KJS::DateProtoFuncImp::callAsFunction):
379 (KJS::DateObjectImp::construct):
380 (KJS::DateObjectImp::callAsFunction):
382 * kjs/identifier.cpp:
384 (KJS::initializeInterpreterLock):
385 (KJS::lockInterpreter):
386 (KJS::unlockInterpreter):
387 (KJS::UndefinedImp::toPrimitive):
388 (KJS::UndefinedImp::toBoolean):
389 (KJS::UndefinedImp::toNumber):
390 (KJS::UndefinedImp::toString):
391 (KJS::NullImp::toPrimitive):
392 (KJS::NullImp::toBoolean):
393 (KJS::NullImp::toNumber):
394 (KJS::NullImp::toString):
395 (KJS::BooleanImp::toPrimitive):
396 (KJS::BooleanImp::toBoolean):
397 (KJS::BooleanImp::toNumber):
398 (KJS::BooleanImp::toString):
399 (KJS::StringImp::toPrimitive):
400 (KJS::StringImp::toBoolean):
401 (KJS::StringImp::toNumber):
402 (KJS::StringImp::toString):
404 * kjs/protected_values.cpp:
406 2005-10-03 Maciej Stachowiak <mjs@apple.com>
408 - fix Development build after last checkin
410 * kxmlcore/FastMalloc.cpp:
411 (KXMLCore::fastMallocRegisterThread):
413 2005-10-02 Maciej Stachowiak <mjs@apple.com>
417 <rdar://problem/4283967> REGRESSION: 3% regression on PLT from new FastMalloc
418 http://bugzilla.opendarwin.org/show_bug.cgi?id=5243
420 A number of optimizations to the new threadsafe malloc that make it actually as fast
421 as dlmalloc (I measured wrong before) and as memory-efficient as the system malloc.
423 - use fastMalloc for everything - it now gets applied to all new/delete allocations
424 via a private inline operator new that is now included into every file via config.h.
426 - tweaked some of the numeric parameters for size classes and amount of wasted memory
427 allowed per allocation - this saves on memory use and consequently improves speed.
429 - so long as the allocator is not being used on background threads, get the per-thread
430 cache from a global variable instead of from pthread_getspecific, since the latter is slow.
432 - inline more functions, and force the ones GCC refuses to inline with
433 attribute(always_inline), nearly all of these have one call site so inlining them has
436 - use some tricks to calculate allocation size more efficiently and fewer times for small
437 allocations, to avoid hitting the huge size table array.
439 - avoid hitting the per-thread cache on code paths that don't need it.
441 - implement inline assembly version of spinlock for PowerPC (was already done for x86)
443 * bindings/NP_jsobject.cpp:
444 * bindings/c/c_class.cpp:
445 * bindings/c/c_instance.cpp:
446 * bindings/c/c_runtime.cpp:
447 * bindings/c/c_utility.cpp:
448 * bindings/jni/jni_class.cpp:
449 * bindings/jni/jni_instance.cpp:
450 * bindings/jni/jni_jsobject.cpp:
451 * bindings/jni/jni_objc.mm:
452 * bindings/jni/jni_runtime.cpp:
453 * bindings/jni/jni_utility.cpp:
454 * bindings/npruntime.cpp:
455 * bindings/objc/WebScriptObject.mm:
456 * bindings/objc/objc_class.mm:
457 * bindings/objc/objc_instance.mm:
458 * bindings/objc/objc_runtime.mm:
459 * bindings/objc/objc_utility.mm:
460 * bindings/runtime.cpp:
461 * bindings/runtime_array.cpp:
462 * bindings/runtime_method.cpp:
463 * bindings/runtime_object.cpp:
464 * bindings/runtime_root.cpp:
465 * bindings/testbindings.cpp:
466 * bindings/testbindings.mm:
467 * kjs/array_object.cpp:
468 (ArrayInstanceImp::ArrayInstanceImp):
469 (ArrayInstanceImp::~ArrayInstanceImp):
470 (ArrayInstanceImp::resizeStorage):
471 * kjs/bool_object.cpp:
473 (KJS::Collector::registerThread):
476 * kjs/error_object.cpp:
478 * kjs/function_object.cpp:
479 * kjs/identifier.cpp:
480 (KJS::Identifier::rehash):
482 (KJS::Parser::saveNewNode):
483 (KJS::clearNewNodes):
484 * kjs/interpreter.cpp:
486 (Lexer::doneParsing):
487 (Lexer::makeIdentifier):
488 (Lexer::makeUString):
490 * kjs/math_object.cpp:
493 * kjs/nodes2string.cpp:
494 * kjs/number_object.cpp:
495 (integer_part_noexp):
498 * kjs/object_object.cpp:
499 * kjs/property_map.cpp:
500 * kjs/property_slot.cpp:
501 * kjs/protected_values.cpp:
502 (KJS::ProtectedValues::rehash):
504 * kjs/reference_list.cpp:
506 * kjs/regexp_object.cpp:
507 * kjs/scope_chain.cpp:
509 * kjs/string_object.cpp:
513 * kxmlcore/Assertions.mm:
514 * kxmlcore/FastMalloc.cpp:
515 (KXMLCore::InitSizeClasses):
516 (KXMLCore::DLL_IsEmpty):
517 (KXMLCore::DLL_Prepend):
518 (KXMLCore::TCMalloc_Central_FreeList::Insert):
519 (KXMLCore::TCMalloc_Central_FreeList::Remove):
520 (KXMLCore::TCMalloc_Central_FreeList::Populate):
521 (KXMLCore::TCMalloc_ThreadCache::Allocate):
522 (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
523 (KXMLCore::fastMallocRegisterThread):
524 (KXMLCore::TCMalloc_ThreadCache::GetCache):
525 (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
526 (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
527 (KXMLCore::do_malloc):
530 * kxmlcore/FastMalloc.h:
535 * kxmlcore/HashTable.cpp:
536 * kxmlcore/TCSpinLock.h:
537 (TCMalloc_SpinLock::Lock):
538 (TCMalloc_SpinLock::Unlock):
540 * kxmlcore/TCSystemAlloc.cpp:
542 2005-09-30 Geoffrey Garen <ggaren@apple.com>
544 - Second cut at fixing <rdar://problem/4275206> Denver Regression: Seed:
545 Past Editions of Opinions display "NAN/Undefined" for www.washingtonpost.com
549 * kjs/date_object.cpp:
550 (KJS::KRFCDate_parseDate): Intead of creating a timezone when one isn't specified,
551 just rely on the fallback logic, which will do it for you. Also, return invalidDate
552 if the date includes trailing garbage. (Somewhat accidentally, the timezone logic
553 used to catch trailing garbage.)
555 Added test case to fast/js/date-parse-test.html.
557 2005-09-29 Eric Seidel <eseidel@apple.com>
558 Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
562 Fix JSC memory smasher in TOT.
563 http://bugzilla.opendarwin.org/show_bug.cgi?id=5176
568 2005-09-29 Eric Seidel <eseidel@apple.com>
569 Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
573 * JavaScriptCore.xcodeproj/project.pbxproj:
574 Build fix for JSC+SVG after 5161.
575 http://bugzilla.opendarwin.org/show_bug.cgi?id=5179
577 2005-09-28 Geoffrey Garen <ggaren@apple.com>
579 - Fixed <rdar://problem/4275206> Denver Regression: Seed: Past Editions of Opinions display
580 "NAN/Undefined" for www.washingtonpost.com
584 * kjs/date_object.cpp:
585 (KJS::KRFCDate_parseDate): If the timezone isn't specified, rather than returning
586 invalidDate, substitute the local timezone. This matches the behavior of FF/IE.
588 2005-09-28 Maciej Stachowiak <mjs@apple.com>
590 Patch from George Staikos, reviewed by me.
592 - fixed some compile issues on Linux
594 * kjs/property_slot.h:
595 * kjs/simple_number.h:
597 2005-09-27 Maciej Stachowiak <mjs@apple.com>
601 - move HashMap/HashSet code down to JavaScriptCore
602 http://bugzilla.opendarwin.org/show_bug.cgi?id=5161
604 * JavaScriptCore.xcodeproj/project.pbxproj:
606 (KJS::interpreterMap): Function that fetches the interpreter map on demand.
607 (KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
608 class with an appropriate HashMap.
609 (KJS::InterpreterImp::clear): ditto
610 (KJS::InterpreterImp::interpreterWithGlobalObject): ditto
611 * kjs/interpreter_map.cpp: Removed.
612 * kjs/interpreter_map.h: Removed.
614 The HashMap/HashSet code (copied and slightly tweaked from WebCore)
616 * kxmlcore/HashFunctions.h: Added.
620 (KXMLCore::PointerHash::hash):
621 (KXMLCore::PointerHash::equal):
622 * kxmlcore/HashMap.h: Added.
623 (KXMLCore::extractFirst):
624 (KXMLCore::HashMap::HashMap):
626 (KXMLCore::::capacity):
627 (KXMLCore::::isEmpty):
631 (KXMLCore::::contains):
634 (KXMLCore::::remove):
636 (KXMLCore::deleteAllValues):
637 * kxmlcore/HashMapPtrSpec.h: Added.
638 (KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
639 (KXMLCore::PointerHashIteratorAdapter::operator*):
640 (KXMLCore::PointerHashIteratorAdapter::operator->):
641 (KXMLCore::PointerHashIteratorAdapter::operator++):
642 (KXMLCore::PointerHashIteratorAdapter::operator==):
643 (KXMLCore::PointerHashIteratorAdapter::operator!=):
644 (KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
645 (KXMLCore::PointerHashConstIteratorAdapter::operator*):
646 (KXMLCore::PointerHashConstIteratorAdapter::operator->):
647 (KXMLCore::PointerHashConstIteratorAdapter::operator++):
648 (KXMLCore::PointerHashConstIteratorAdapter::operator==):
649 (KXMLCore::PointerHashConstIteratorAdapter::operator!=):
651 * kxmlcore/HashSet.h: Added.
652 (KXMLCore::identityExtract):
653 (KXMLCore::convertAdapter):
654 (KXMLCore::HashSet::HashSet):
656 (KXMLCore::::capacity):
657 (KXMLCore::::isEmpty):
661 (KXMLCore::::contains):
662 (KXMLCore::::insert):
663 (KXMLCore::::remove):
665 * kxmlcore/HashTable.cpp: Added.
666 (KXMLCore::HashTableStats::~HashTableStats):
667 (KXMLCore::HashTableStats::recordCollisionAtCount):
668 * kxmlcore/HashTable.h: Added.
669 (KXMLCore::HashTableIterator::skipEmptyBuckets):
670 (KXMLCore::HashTableIterator::HashTableIterator):
671 (KXMLCore::HashTableIterator::operator*):
672 (KXMLCore::HashTableIterator::operator->):
673 (KXMLCore::HashTableIterator::operator++):
674 (KXMLCore::HashTableIterator::operator==):
675 (KXMLCore::HashTableIterator::operator!=):
676 (KXMLCore::HashTableConstIterator::HashTableConstIterator):
677 (KXMLCore::HashTableConstIterator::operator*):
678 (KXMLCore::HashTableConstIterator::operator->):
679 (KXMLCore::HashTableConstIterator::skipEmptyBuckets):
680 (KXMLCore::HashTableConstIterator::operator++):
681 (KXMLCore::HashTableConstIterator::operator==):
682 (KXMLCore::HashTableConstIterator::operator!=):
683 (KXMLCore::HashTable::HashTable):
684 (KXMLCore::HashTable::~HashTable):
685 (KXMLCore::HashTable::begin):
686 (KXMLCore::HashTable::end):
687 (KXMLCore::HashTable::size):
688 (KXMLCore::HashTable::capacity):
689 (KXMLCore::HashTable::insert):
690 (KXMLCore::HashTable::isEmptyBucket):
691 (KXMLCore::HashTable::isDeletedBucket):
692 (KXMLCore::HashTable::isEmptyOrDeletedBucket):
693 (KXMLCore::HashTable::hash):
694 (KXMLCore::HashTable::equal):
695 (KXMLCore::HashTable::identityConvert):
696 (KXMLCore::HashTable::extractKey):
697 (KXMLCore::HashTable::lookup):
698 (KXMLCore::HashTable::shouldExpand):
699 (KXMLCore::HashTable::mustRehashInPlace):
700 (KXMLCore::HashTable::shouldShrink):
701 (KXMLCore::HashTable::shrink):
702 (KXMLCore::HashTable::clearBucket):
703 (KXMLCore::HashTable::deleteBucket):
704 (KXMLCore::HashTable::makeLookupResult):
705 (KXMLCore::HashTable::makeIterator):
706 (KXMLCore::HashTable::makeConstIterator):
707 (KXMLCore::::lookup):
708 (KXMLCore::::insert):
709 (KXMLCore::::reinsert):
711 (KXMLCore::::contains):
712 (KXMLCore::::remove):
713 (KXMLCore::::allocateTable):
714 (KXMLCore::::expand):
715 (KXMLCore::::rehash):
717 (KXMLCore::::HashTable):
719 (KXMLCore::::operator):
720 (KXMLCore::::checkTableConsistency):
721 (KXMLCore::::checkTableConsistencyExceptSize):
722 * kxmlcore/HashTraits.h: Added.
723 (KXMLCore::HashTraits::emptyValue):
725 (KXMLCore::PairHashTraits::emptyValue):
726 (KXMLCore::PairHashTraits::deletedValue):
728 2005-09-27 Darin Adler <darin@apple.com>
732 - update grammar to fix conflicts; fixes one of our test cases
733 because it resolves the relationship between function expressions
734 and declarations in the way required by the ECMA specification
736 * kjs/grammar.y: Added lots of new grammar rules so we have no conflicts.
737 A new set of rules for "no bracket or function at start of expression" and
738 another set of rules for "no in anywhere in expression". Also simplified the
739 handling of try to use only a single node and used operator precedence to
740 get rid of the conflict in handling of if and else. Also used a macro to
741 streamline the handling of automatic semicolons and changed parenthesis
742 handling to use a virtual function.
744 * kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement.
745 (KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead
746 of using a special node for each.
748 (Node::createErrorCompletion): Added. Used instead of throwError when creating errors
749 that should not be in a completion rather than an ExecState.
750 (Node::throwUndefinedVariableError): Added. Sets source location unlike the call it
752 (Node::nodeInsideAllParens): Added.
753 (GroupNode::nodeInsideAllParens): Added.
754 (StatListNode::execute): Removed code to move exceptions into completion objects;
755 that's now done solely by the KJS_CHECKEXCEPTION macro.
756 (TryNode::execute): Include execution of catch and finally here rather than using
758 (FuncDeclNode::execute): Moved here, no longer inline.
759 * kjs/nodes2string.cpp:
760 (TryNode::streamTo): Updated for change.
761 (FuncDeclNode::streamTo): Ditto.
762 (FuncExprNode::streamTo): Ditto.
764 * kjs/kjs-test: Removed. Was part of "make check".
765 * kjs/kjs-test.chk: Ditto.
766 * kjs/test.js: Ditto.
768 * tests/mozilla/expected.html: Updated because one more test succeeds.
770 2005-09-27 Adele Peterson <adele@apple.com>
774 Changed ints to size_t where appropriate.
777 (KJS::Collector::allocate):
778 (KJS::Collector::markStackObjectsConservatively):
779 (KJS::Collector::collect):
780 (KJS::Collector::size):
781 (KJS::Collector::numInterpreters):
782 (KJS::Collector::numGCNotAllowedObjects):
783 (KJS::Collector::numReferencedObjects):
786 2005-09-27 Eric Seidel <eseidel@apple.com>
790 * JavaScriptCore.xcodeproj/project.pbxproj: fix after malloc changes.
792 2005-09-27 Eric Seidel <eseidel@apple.com>
797 (FuncExprNode::evaluate): Now sets .constructor properly.
798 Test cases added to WebCore/layout-tests.
799 http://bugzilla.opendarwin.org/show_bug.cgi?id=3537
801 2005-09-26 Maciej Stachowiak <mjs@apple.com>
805 - replace dlmalloc with tcmalloc
806 http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
808 I also moved SharedPtr and the assertion code from WebCore into a
809 new kxmlcore directory.
811 * JavaScriptCore.xcodeproj/project.pbxproj:
813 (KJS::Collector::allocate):
814 (KJS::Collector::collect):
816 * kjs/fast_malloc.cpp: Removed.
817 * kjs/fast_malloc.h: Removed.
820 * kjs/function_object.cpp:
821 * kjs/identifier.cpp:
822 (KJS::Identifier::add):
826 * kjs/nodes2string.cpp:
827 * kjs/property_map.cpp:
828 (KJS::PropertyMap::~PropertyMap):
829 (KJS::PropertyMap::rehash):
831 * kjs/shared_ptr.h: Removed.
832 * kjs/string_object.cpp:
833 (StringObjectFuncImp::callAsFunction):
835 (KJS::UString::Rep::createCopying):
836 (KJS::UString::Rep::destroy):
837 (KJS::UString::expandCapacity):
838 (KJS::UString::expandPreCapacity):
839 (KJS::UString::UString):
840 (KJS::UString::spliceSubstringsWithSeparators):
841 (KJS::UString::append):
842 (KJS::UString::operator=):
843 (KJS::UString::detach):
845 * kxmlcore/Assertions.h: Added.
846 * kxmlcore/Assertions.mm: Added.
847 * kxmlcore/FastMalloc.cpp: Added.
849 (KXMLCore::SizeClass):
850 (KXMLCore::ByteSizeForClass):
851 (KXMLCore::InitSizeClasses):
852 (KXMLCore::MetaDataAlloc):
853 (KXMLCore::PageHeapAllocator::Init):
854 (KXMLCore::PageHeapAllocator::New):
855 (KXMLCore::PageHeapAllocator::Delete):
856 (KXMLCore::PageHeapAllocator::inuse):
858 (KXMLCore::AllocationSize):
861 (KXMLCore::DeleteSpan):
862 (KXMLCore::DLL_Init):
863 (KXMLCore::DLL_Remove):
864 (KXMLCore::DLL_IsEmpty):
865 (KXMLCore::DLL_Length):
866 (KXMLCore::DLL_Print):
867 (KXMLCore::DLL_Prepend):
868 (KXMLCore::DLL_InsertOrdered):
870 (KXMLCore::TCMalloc_PageHeap::GetDescriptor):
871 (KXMLCore::TCMalloc_PageHeap::SystemBytes):
872 (KXMLCore::TCMalloc_PageHeap::FreeBytes):
873 (KXMLCore::TCMalloc_PageHeap::RecordSpan):
874 (KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
875 (KXMLCore::TCMalloc_PageHeap::New):
876 (KXMLCore::TCMalloc_PageHeap::Split):
877 (KXMLCore::TCMalloc_PageHeap::Carve):
878 (KXMLCore::TCMalloc_PageHeap::Delete):
879 (KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
880 (KXMLCore::TCMalloc_PageHeap::Dump):
881 (KXMLCore::TCMalloc_PageHeap::GrowHeap):
882 (KXMLCore::TCMalloc_PageHeap::Check):
883 (KXMLCore::TCMalloc_PageHeap::CheckList):
884 (KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
885 (KXMLCore::TCMalloc_ThreadCache_FreeList::length):
886 (KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
887 (KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
888 (KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
889 (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
890 (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
891 (KXMLCore::TCMalloc_ThreadCache::freelist_length):
892 (KXMLCore::TCMalloc_ThreadCache::Size):
893 (KXMLCore::TCMalloc_Central_FreeList::length):
894 (KXMLCore::TCMalloc_Central_FreeList::Init):
895 (KXMLCore::TCMalloc_Central_FreeList::Insert):
896 (KXMLCore::TCMalloc_Central_FreeList::Remove):
897 (KXMLCore::TCMalloc_Central_FreeList::Populate):
898 (KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
899 (KXMLCore::TCMalloc_ThreadCache::Init):
900 (KXMLCore::TCMalloc_ThreadCache::Cleanup):
901 (KXMLCore::TCMalloc_ThreadCache::Allocate):
902 (KXMLCore::TCMalloc_ThreadCache::Deallocate):
903 (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
904 (KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
905 (KXMLCore::TCMalloc_ThreadCache::Scavenge):
906 (KXMLCore::TCMalloc_ThreadCache::GetCache):
907 (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
908 (KXMLCore::TCMalloc_ThreadCache::PickNextSample):
909 (KXMLCore::TCMalloc_ThreadCache::InitModule):
910 (KXMLCore::TCMalloc_ThreadCache::InitTSD):
911 (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
912 (KXMLCore::TCMalloc_ThreadCache::DeleteCache):
913 (KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
914 (KXMLCore::TCMalloc_ThreadCache::Print):
915 (KXMLCore::ExtractStats):
916 (KXMLCore::DumpStats):
917 (KXMLCore::PrintStats):
918 (KXMLCore::DumpStackTraces):
919 (KXMLCore::TCMallocImplementation::GetStats):
920 (KXMLCore::TCMallocImplementation::ReadStackTraces):
921 (KXMLCore::TCMallocImplementation::GetNumericProperty):
922 (KXMLCore::TCMallocImplementation::SetNumericProperty):
923 (KXMLCore::DoSampledAllocation):
924 (KXMLCore::do_malloc):
926 (KXMLCore::do_memalign):
927 (KXMLCore::TCMallocGuard::TCMallocGuard):
928 (KXMLCore::TCMallocGuard::~TCMallocGuard):
934 (KXMLCore::memalign):
935 (KXMLCore::posix_memalign):
938 (KXMLCore::malloc_stats):
940 (KXMLCore::mallinfo):
941 * kxmlcore/FastMalloc.h: Added.
942 (KXMLCore::FastAllocated::operator new):
943 (KXMLCore::FastAllocated::operator delete):
944 (KXMLCore::FastAllocated::operator new[]):
945 (KXMLCore::FastAllocated::operator delete[]):
946 * kxmlcore/SharedPtr.h: Added.
947 (KXMLCore::SharedPtr::SharedPtr):
948 (KXMLCore::SharedPtr::~SharedPtr):
949 (KXMLCore::SharedPtr::isNull):
950 (KXMLCore::SharedPtr::notNull):
951 (KXMLCore::SharedPtr::reset):
952 (KXMLCore::SharedPtr::get):
953 (KXMLCore::SharedPtr::operator*):
954 (KXMLCore::SharedPtr::operator->):
955 (KXMLCore::SharedPtr::operator!):
956 (KXMLCore::SharedPtr::operator bool):
957 (KXMLCore::::operator):
958 (KXMLCore::operator==):
959 (KXMLCore::operator!=):
960 (KXMLCore::static_pointer_cast):
961 (KXMLCore::const_pointer_cast):
962 * kxmlcore/TCPageMap.h: Added.
963 (TCMalloc_PageMap1::TCMalloc_PageMap1):
964 (TCMalloc_PageMap1::Ensure):
965 (TCMalloc_PageMap1::get):
966 (TCMalloc_PageMap1::set):
967 (TCMalloc_PageMap2::TCMalloc_PageMap2):
968 (TCMalloc_PageMap2::get):
969 (TCMalloc_PageMap2::set):
970 (TCMalloc_PageMap2::Ensure):
971 (TCMalloc_PageMap3::NewNode):
972 (TCMalloc_PageMap3::TCMalloc_PageMap3):
973 (TCMalloc_PageMap3::get):
974 (TCMalloc_PageMap3::set):
975 (TCMalloc_PageMap3::Ensure):
976 * kxmlcore/TCSpinLock.h: Added.
977 (TCMalloc_SpinLock::Init):
978 (TCMalloc_SpinLock::Finalize):
979 (TCMalloc_SpinLock::Lock):
980 (TCMalloc_SpinLock::Unlock):
982 (TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
983 (TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
984 * kxmlcore/TCSystemAlloc.cpp: Added.
988 (TCMalloc_SystemAlloc):
989 * kxmlcore/TCSystemAlloc.h: Added.
991 2005-09-23 Maciej Stachowiak <mjs@apple.com>
995 <rdar://problem/4260479> Finish deploying PropertySlot in the interpreter
996 http://bugzilla.opendarwin.org/show_bug.cgi?id=5112
998 Convert postfix, prefix, delete, prefix, and for..in expressions to use
999 PropertySlot-based lookup instead of evaluateReference.
1001 3% speedup on JS iBench.
1003 Fixed two of the JS tests:
1004 * tests/mozilla/expected.html:
1008 (PostfixResolveNode::evaluate):
1009 (PostfixBracketNode::evaluate):
1010 (PostfixDotNode::evaluate):
1011 (DeleteResolveNode::evaluate):
1012 (DeleteBracketNode::evaluate):
1013 (DeleteDotNode::evaluate):
1014 (DeleteValueNode::evaluate):
1015 (typeStringForValue):
1016 (TypeOfResolveNode::evaluate):
1017 (TypeOfValueNode::evaluate):
1018 (PrefixResolveNode::evaluate):
1019 (PrefixBracketNode::evaluate):
1020 (PrefixDotNode::evaluate):
1021 (ForInNode::execute):
1023 (KJS::PostfixResolveNode::PostfixResolveNode):
1024 (KJS::PostfixBracketNode::PostfixBracketNode):
1025 (KJS::PostfixDotNode::PostfixDotNode):
1026 (KJS::DeleteResolveNode::DeleteResolveNode):
1027 (KJS::DeleteBracketNode::DeleteBracketNode):
1028 (KJS::DeleteDotNode::DeleteDotNode):
1029 (KJS::DeleteValueNode::DeleteValueNode):
1030 (KJS::TypeOfResolveNode::TypeOfResolveNode):
1031 (KJS::TypeOfValueNode::TypeOfValueNode):
1032 (KJS::PrefixResolveNode::PrefixResolveNode):
1033 (KJS::PrefixBracketNode::PrefixBracketNode):
1034 (KJS::PrefixDotNode::PrefixDotNode):
1035 * kjs/nodes2string.cpp:
1036 (PostfixResolveNode::streamTo):
1037 (PostfixBracketNode::streamTo):
1038 (PostfixDotNode::streamTo):
1039 (DeleteResolveNode::streamTo):
1040 (DeleteBracketNode::streamTo):
1041 (DeleteDotNode::streamTo):
1042 (DeleteValueNode::streamTo):
1043 (TypeOfValueNode::streamTo):
1044 (TypeOfResolveNode::streamTo):
1045 (PrefixResolveNode::streamTo):
1046 (PrefixBracketNode::streamTo):
1047 (PrefixDotNode::streamTo):
1048 * kjs/reference.cpp:
1049 (KJS::Reference::Reference):
1050 (KJS::Reference::getPropertyName):
1051 (KJS::Reference::getValue):
1052 (KJS::Reference::deleteValue):
1055 2005-09-23 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1057 Reviewed and landed by Darin.
1059 - a Windows-specific file
1061 * os-win32/stdint.h: Added. We plan to remove dependency on the <stdint.h> types,
1062 and if we do so, we will remove this file.
1064 2005-09-22 Geoffrey Garen <ggaren@apple.com>
1066 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
1067 Need to restore int/long changes to simple_number.h
1069 Reviewed by darin and mjs.
1071 * kjs/simple_number.h: changed enums to indenpendent constants to clarify types
1072 (KJS::isNegativeZero): changed to static function - no reason to export
1073 (KJS::SimpleNumber::rightShiftSignExtended): new function for clarity
1074 (KJS::SimpleNumber::make): specified cast as reinterpret_cast
1075 (KJS::SimpleNumber::is): changed to use uintptr_t for portability
1076 (KJS::SimpleNumber::value): changed to use uintptr_t and rightShiftSignExtended
1077 (KJS::SimpleNumber::fits): inverted tests - probably only a performance win for double
1078 (KJS::SimpleNumber::integerFits): ditto
1080 2005-09-20 Maciej Stachowiak <mjs@apple.com>
1082 Reviewed by Geoff and partly by Darin.
1084 - fixed http://bugzilla.opendarwin.org/post_bug.cgi
1085 (Reduce conflicts in JavaScriptCore grammar)
1087 This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
1088 9 shift/reduce and 45 reduce/reduce.
1091 * kjs/grammar_types.h: Removed.
1094 (KJS::Node::isGroupNode):
1095 (KJS::Node::isLocation):
1096 (KJS::Node::isResolveNode):
1097 (KJS::Node::isBracketAccessorNode):
1098 (KJS::Node::isDotAccessorNode):
1099 (KJS::ResolveNode::isLocation):
1100 (KJS::ResolveNode::isResolveNode):
1101 (KJS::ResolveNode::identifier):
1102 (KJS::GroupNode::isGroupNode):
1103 (KJS::GroupNode::leafNode):
1104 (KJS::BracketAccessorNode::isLocation):
1105 (KJS::BracketAccessorNode::isBracketAccessorNode):
1106 (KJS::BracketAccessorNode::base):
1107 (KJS::BracketAccessorNode::subscript):
1108 (KJS::DotAccessorNode::isLocation):
1109 (KJS::DotAccessorNode::isDotAccessorNode):
1110 (KJS::DotAccessorNode::base):
1111 (KJS::DotAccessorNode::identifier):
1112 (KJS::FuncExprNode::FuncExprNode):
1113 (KJS::FuncExprNode::identifier):
1114 (KJS::FuncDeclNode::FuncDeclNode):
1115 (KJS::FuncDeclNode::execute):
1117 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1119 - Oops. The 4263434 change was only appropriate on the branch. Rolling out.
1124 (KJS::InterpreterImp::mark):
1126 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1128 - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
1129 kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
1132 Added InterpreterLocks in some places in the bindings we missed before.
1136 * bindings/runtime_root.cpp:
1137 (KJS::Bindings::addNativeReference):
1138 (KJS::Bindings::removeNativeReference):
1139 (RootObject::removeAllNativeReferences):
1140 * bindings/runtime_root.h:
1141 (KJS::Bindings::RootObject::~RootObject):
1142 (KJS::Bindings::RootObject::setRootObjectImp):
1144 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1146 - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
1147 KJS::InterpreterImp::mark() crash
1149 Fix by mjs, review by me.
1152 (KJS::InterpreterImp::mark): Added a null check on globExec in case a
1153 garbage collection occurs inside InterpreterImp::globalInit (called
1154 from InterpreterImp::InterpreterImp), at which point globExec has not yet been initialized.
1156 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1158 - Rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4892
1159 Date constructor has problems with months larger than 11
1163 * layout-tests/fast/js/date-big-constructor-expected.txt: Added.
1164 * layout-tests/fast/js/date-big-constructor.html: Added.
1168 * kjs/date_object.cpp:
1169 (KJS::fillStructuresUsingDateArgs):
1172 2005-09-19 Geoffrey Garen <ggaren@apple.com>
1174 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5028
1175 9 layout tests fail following the change from long to int
1177 - Rolled out changes to simple_number.h, and added fits(long long)
1178 and SimpleNumber::fits(unsigned long long) to the old system.
1182 * kjs/simple_number.h:
1183 (KJS::SimpleNumber::):
1184 (KJS::SimpleNumber::value):
1185 (KJS::SimpleNumber::fits):
1186 (KJS::SimpleNumber::integerFits):
1187 (KJS::SimpleNumber::make):
1189 2005-09-14 Maciej Stachowiak <mjs@apple.com>
1193 - fixed <rdar://problem/4214783> REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer)
1195 Make sure to lock using the InterpreterLock class in all places that need it
1196 (including anything that uses the collector, the parser, the protect count hash table,
1197 and anything that allocates via fast_malloc).
1199 Also added assertions to ensure that the locking rules are followed for the relevant
1203 * bindings/NP_jsobject.cpp:
1204 (identifierFromNPIdentifier):
1209 (_NPN_RemoveProperty):
1212 (_NPN_SetException):
1213 * bindings/jni/jni_jsobject.cpp:
1216 (JSObject::getMember):
1217 (JSObject::setMember):
1218 (JSObject::removeMember):
1219 (JSObject::getSlot):
1220 (JSObject::setSlot):
1221 (JSObject::toString):
1222 (JSObject::convertJObjectToValue):
1223 * bindings/objc/WebScriptObject.mm:
1224 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1225 (-[WebScriptObject evaluateWebScript:]):
1226 (-[WebScriptObject setValue:forKey:]):
1227 (-[WebScriptObject valueForKey:]):
1228 (-[WebScriptObject removeWebScriptKey:]):
1229 (-[WebScriptObject stringRepresentation]):
1230 (-[WebScriptObject webScriptValueAtIndex:]):
1231 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
1232 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
1233 * bindings/runtime.cpp:
1234 (Instance::createRuntimeObject):
1235 * bindings/runtime_root.h:
1236 * bindings/testbindings.cpp:
1238 * bindings/testbindings.mm:
1240 * kjs/fast_malloc.cpp:
1241 (KJS::kjs_fast_malloc):
1242 (KJS::kjs_fast_calloc):
1243 (KJS::kjs_fast_free):
1244 (KJS::kjs_fast_realloc):
1245 * kjs/fast_malloc.h:
1248 (InterpreterImp::InterpreterImp):
1249 (InterpreterImp::clear):
1250 (InterpreterImp::mark):
1251 (InterpreterImp::checkSyntax):
1252 (InterpreterImp::evaluate):
1254 (KJS::InterpreterImp::globalObject):
1255 * kjs/interpreter.cpp:
1256 (Interpreter::evaluate):
1257 * kjs/interpreter.h:
1258 (KJS::InterpreterLock::InterpreterLock):
1259 (KJS::InterpreterLock::~InterpreterLock):
1262 (KJS::ProtectedValue::ProtectedValue):
1263 (KJS::ProtectedValue::~ProtectedValue):
1264 (KJS::ProtectedValue::operator=):
1265 (KJS::ProtectedObject::ProtectedObject):
1266 (KJS::ProtectedObject::~ProtectedObject):
1267 (KJS::ProtectedObject::operator=):
1268 (KJS::ProtectedReference::ProtectedReference):
1269 (KJS::ProtectedReference::~ProtectedReference):
1270 (KJS::ProtectedReference::operator=):
1271 * kjs/protected_object.h:
1272 * kjs/protected_values.cpp:
1273 (KJS::ProtectedValues::getProtectCount):
1274 (KJS::ProtectedValues::increaseProtectCount):
1275 (KJS::ProtectedValues::decreaseProtectCount):
1276 * kjs/string_object.cpp:
1277 (StringObjectImp::StringObjectImp):
1281 2005-09-16 Adele Peterson <adele@apple.com>
1283 Change by Darin, reviewed by me and Maciej.
1285 Fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=4547
1286 use int instead of long for 32-bit (to prepare for LP64 compiling)
1288 * bindings/c/c_class.h:
1289 (KJS::Bindings::CClass::constructorAt):
1290 (KJS::Bindings::CClass::numConstructors):
1291 * bindings/c/c_runtime.h:
1292 (KJS::Bindings::CMethod::numParameters):
1293 * bindings/jni/jni_class.cpp:
1294 (JavaClass::JavaClass):
1295 * bindings/jni/jni_class.h:
1296 (KJS::Bindings::JavaClass::constructorAt):
1297 (KJS::Bindings::JavaClass::numConstructors):
1298 * bindings/jni/jni_instance.cpp:
1299 (JavaInstance::invokeMethod):
1300 * bindings/jni/jni_jsobject.cpp:
1301 (JSObject::convertJObjectToValue):
1302 (JSObject::listFromJArray):
1303 * bindings/jni/jni_runtime.cpp:
1304 (JavaMethod::JavaMethod):
1305 * bindings/jni/jni_runtime.h:
1306 (KJS::Bindings::JavaConstructor::_commonCopy):
1307 (KJS::Bindings::JavaConstructor::parameterAt):
1308 (KJS::Bindings::JavaConstructor::numParameters):
1309 (KJS::Bindings::JavaMethod::_commonCopy):
1310 (KJS::Bindings::JavaMethod::parameterAt):
1311 (KJS::Bindings::JavaMethod::numParameters):
1313 * bindings/objc/WebScriptObject.mm:
1315 * bindings/objc/objc_class.h:
1316 (KJS::Bindings::ObjcClass::constructorAt):
1317 (KJS::Bindings::ObjcClass::numConstructors):
1318 * bindings/objc/objc_instance.h:
1319 * bindings/objc/objc_runtime.h:
1320 * bindings/objc/objc_runtime.mm:
1321 (ObjcMethod::numParameters):
1322 * bindings/runtime.h:
1325 * kjs/property_slot.h:
1326 (KJS::PropertySlot::setCustomIndex):
1327 (KJS::PropertySlot::index):
1328 (KJS::PropertySlot::):
1329 * kjs/regexp_object.cpp:
1330 (RegExpObjectImp::backrefGetter):
1331 (RegExpObjectImp::getOwnPropertySlot):
1332 * kjs/simple_number.h:
1333 (KJS::SimpleNumber::):
1334 (KJS::SimpleNumber::value):
1335 (KJS::SimpleNumber::fits):
1336 (KJS::SimpleNumber::integerFits):
1337 (KJS::SimpleNumber::make):
1338 * kjs/string_object.cpp:
1339 (substituteBackreferences):
1341 (KJS::UString::from):
1342 (KJS::UString::toUInt32):
1343 (KJS::UString::find):
1344 (KJS::UString::rfind):
1350 2005-09-11 Eric Seidel <eseidel@apple.com>
1352 No review requested, build fix affects only SVG.
1354 * JavaScriptCore.xcodeproj/project.pbxproj: Fixed JSC+SVG
1355 Fixed JavaScriptCore+SVG after PCRE 6.1 merger.
1356 http://bugzilla.opendarwin.org/show_bug.cgi?id=4932
1358 2005-09-10 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1360 Reviewed and landed by Darin.
1362 * Makefile.vc: Added.
1363 * README-Win32.txt: Added.
1365 2005-09-10 Darin Adler <darin@apple.com>
1367 - fixed compilation for WebCore (another try)
1369 * kjs/simple_number.h: Added more "using" lines.
1371 2005-09-10 Darin Adler <darin@apple.com>
1373 - fixed compilation for WebCore
1375 * kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
1376 standard C++ library headers.
1378 2005-09-10 Darin Adler <darin@apple.com>
1380 Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
1382 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
1383 win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
1385 * kjs/simple_number.h:
1386 (KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
1387 uses _fpclass and a case for other platforms that uses signbit.
1388 (KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
1390 * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
1392 * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
1395 - improved test engine
1397 * tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
1398 a plain-ASCII sort; now test 33 will be after test 5 in any given set of
1401 2005-09-08 Darin Adler <darin@apple.com>
1403 - fixed overloaded versions of throwError so that they substitute *all*
1404 expected parameters into the message string -- some versions used to
1405 skip parameters, resulting in "%s" being printed in the error message.
1409 * kjs/nodes.h: Updated declarations to use "const &" and not to name parameters
1410 * kjs/nodes.cpp: (Node::throwError): Updated to match above and add one missing
1413 2005-09-08 Darin Adler <darin@apple.com>
1417 - updated to PCRE 6.1
1419 The original PCRE 6.1 sources are checked into the tree with the tag
1420 "pcre-6-1" for reference. What we're checking in right now is the original
1421 plus our changes to make it support UTF-16 and at least one other tweak
1422 (vertical tab considered whitespace). Our work to get our changes was
1423 done on "pcre-6-1-branch", with an anchor at "pcre-6-1-anchor" so you can
1424 see the evolution of the UTF-16 changes.
1426 Note also that there was one small change made here that's not on the branch
1429 * Info.plist: Updated the part of the copyright message that's about PCRE.
1431 * JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
1432 removed obsolete ones.
1434 * pcre/AUTHORS: Updated to PCRE 6.1. Includes credits for Apple's UTF-16
1435 changes, but not the credits for Google's C++ wrapper, since we don't include that.
1436 * pcre/COPYING: Updated to PCRE 6.1.
1437 * pcre/LICENCE: Ditto.
1438 * pcre/dftables.c: Ditto.
1439 * pcre/pcre-config.h: Ditto.
1440 * pcre/pcre.h: Ditto.
1442 * pcre/pcre_compile.c: Added for PCRE 6.1.
1443 * pcre/pcre_config.c: Ditto.
1444 * pcre/pcre_exec.c: Ditto.
1445 * pcre/pcre_fullinfo.c: Ditto.
1446 * pcre/pcre_get.c: Ditto.
1447 * pcre/pcre_globals.c: Ditto.
1448 * pcre/pcre_info.c: Ditto.
1449 * pcre/pcre_internal.h: Ditto.
1450 * pcre/pcre_maketables.c: Ditto.
1451 * pcre/pcre_ord2utf8.c: Ditto.
1452 * pcre/pcre_printint.c: Ditto.
1453 * pcre/pcre_refcount.c: Ditto.
1454 * pcre/pcre_study.c: Ditto.
1455 * pcre/pcre_tables.c: Ditto.
1456 * pcre/pcre_try_flipped.c: Ditto.
1457 * pcre/pcre_ucp_findchar.c: Ditto.
1458 * pcre/pcre_version.c: Ditto.
1459 * pcre/pcre_xclass.c: Ditto.
1460 * pcre/ucp.h: Ditto.
1461 * pcre/ucp_findchar.c: Ditto.
1462 * pcre/ucpinternal.h: Ditto.
1463 * pcre/ucptable.c: Ditto.
1465 * pcre/get.c: Removed.
1466 * pcre/internal.h: Removed.
1467 * pcre/maketables.c: Removed.
1468 * pcre/pcre.c: Removed.
1469 * pcre/study.c: Removed.
1471 2005-09-07 Geoffrey Garen <ggaren@apple.com>
1473 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4781
1474 Date.setMonth fails with big values due to overflow
1478 * kjs/date_object.cpp:
1479 (timetUsingCF): for consistency, changed return statement to invalidDate instead of LONG_MAX
1480 (KJS::fillStructuresUsingTimeArgs): modified for readability
1481 (KJS::fillStructuresUsingDateArgs): new function analogous to fillStructuresUsingTimeArgs
1482 (KJS::DateProtoFuncImp::callAsFunction): modified to use fillStructuresUsingDateArgs
1483 (KJS::DateObjectImp::construct): moved variable declaration to proper scope
1484 (KJS::DateObjectFuncImp::callAsFunction): moved variable declaration to proper scope
1486 2005-09-07 Geoffrey Garen <ggaren@apple.com>
1487 -updated expected test results to reflect fix for
1488 http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1489 kjs does not allow named functions in function expressions
1491 * tests/mozilla/expected.html:
1493 2005-09-04 Darin Adler <darin@apple.com>
1495 * kjs/identifier.cpp: Fix comment, add missing include.
1496 (Follow-on to changes from yesterday.)
1498 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1500 Reviewed, tweaked and landed by Darin.
1502 - another try at some of the Windows compilation fixes
1503 should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
1505 * kjs/collector.cpp: Add missing <setjmp.h> include.
1506 * kjs/date_object.cpp: Fix broken copysign macro.
1507 * kjs/dtoa.cpp: Move macro definitions down after all header includes.
1508 * kjs/fast_malloc.cpp: Add missing <assert.h> and <stddef.h> includes.
1509 * kjs/function.cpp: Remove broken isxdigit definition.
1510 * kjs/grammar.y: Add a missing semicolon (and remove an excess one).
1511 * kjs/identifier.cpp: Turn off AVOID_STATIC_CONSTRUCTORS because the placement new syntax
1512 doesn't seem to work in Visual C++ (I'm surprised to hear that, by the way).
1513 * kjs/value.h: Made ValueImp's destructor virtual because otherwise pointers to ValueImp
1514 on the stack aren't right for garbage collection on Windows (don't think it works that
1515 way with gcc's virtual table scheme, but it's a harmless change).
1517 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1519 Reviewed, tweaked and landed by Darin.
1521 - some Windows compilation fixes, hoping to fix the problems reported in these bugs:
1522 4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
1524 * kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside
1525 KJS_MULTIPLE_THREADS #if directives.
1526 (KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
1528 * kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
1530 * kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
1532 (KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe
1533 that on Win32 there's some other call before that setting errno.
1535 * kjs/date_object.h: Remove unneeded include of <sys/time.h>.
1537 * kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
1539 * kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32.
1540 (KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++.
1541 (KJS::sbrk): Change parameter type to match the declaration.
1543 * kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
1545 * kjs/function.h: Remove unneeded friend class Function for FunctionImp.
1547 * kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS
1548 define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the
1549 non-AVOID_STATIC_CONSTRUCTORS code path.
1551 * kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>!
1552 Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
1554 * kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this
1555 specific to Mac OS X if we like.
1557 * kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
1560 (KJS::ListImp::markValues): Use std::min instead of MIN.
1561 (KJS::List::copy): Ditto.
1562 (KJS::List::copyTail): Ditto.
1564 * kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
1566 * kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
1567 Put the use of always_inline inside __GNUC__.
1569 * kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10"
1570 inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen
1571 when passing an int rather than a double or float.
1573 * kjs/operations.cpp:
1574 (KJS::isInf): Add Win32 implementation.
1575 (KJS::isPosInf): Add Win32 implementation.
1576 (KJS::isNegInf): Add Win32 implementation.
1578 * kjs/regexp.cpp: Use unsigned instead of uint.
1579 * kjs/regexp.h: Ditto.
1580 * kjs/regexp_object.cpp: Ditto.
1581 * kjs/regexp_object.h: Ditto.
1583 2005-09-02 Beth Dakin <bdakin@apple.com>
1585 Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
1586 The other half of the fix is in WebCore.
1588 Fix written by Maciej and Darin.
1589 Reviewed by me/Maciej
1591 As Maciej said in Radar: These problems was caused by a conflict between some of our custom
1592 allocators, causing them to return null. Symptom is typically a null pointer dereference in
1593 a place where it might be expected an allocation has just occurred.
1595 * kjs/fast_malloc.cpp: Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM,
1596 and MALLOC_FAILURE_ACTION.
1598 2005-08-31 Geoffrey Garen <ggaren@apple.com>
1600 -rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1601 kjs does not allow named functions in function expressions
1603 Fix by Arthur Langereis.
1609 (FuncExprNode::evaluate):
1611 (KJS::FuncExprNode::FuncExprNode):
1615 * layout-tests/fast/js/named-function-expression-expected.txt: Added.
1616 * layout-tests/fast/js/named-function-expression.html: Added.
1618 2005-08-31 Justin Haygood <justin@xiondigital.net>
1620 Reviewed, tweaked, and landed by Darin.
1622 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4085
1623 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4087
1624 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4096
1625 Some fixes for compiling on windows.
1627 * kjs/config.h: Added a WIN32 case in here, with suitable defines.
1628 (To be tweaked as necessary.)
1629 * kjs/function.cpp: Took out APPLE_CHANGES around use of ICU.
1630 * kjs/operations.cpp: Removed some bogus code that always set HAVE_FLOAT_H.
1632 2005-08-30 Darin Adler <darin@apple.com>
1634 Reviewed by John Sullivan.
1636 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4758
1637 unify SharedPtr in WebCore and JavaScriptCore
1639 * kjs/shared_ptr.h: Updated namespace to KXMLCore instead of kxhmlcore.
1640 Made a few small improvements to use local variables a bit more and added
1641 an "operator int" to reduce the chance that we'll convert a SharedPtr to
1642 an int by accident. Also made the == operators normal functions rather than
1643 friend functions, added a couple of comemnts.
1645 * kjs/function.h: Updated for namespace change.
1646 * kjs/function.cpp: Ditto.
1647 * kjs/function_object.cpp: Ditto.
1648 * kjs/internal.h: Ditto.
1649 * kjs/internal.cpp: Ditto.
1650 * kjs/nodes.h: Ditto.
1651 * kjs/nodes2string.cpp: Ditto.
1653 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1657 <rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript
1659 Record all nodes that are created during parsing, and delete any
1660 that are left floating with a refcount of 0.
1663 (KJS::Parser::saveNewNode):
1664 (KJS::clearNewNodes):
1665 (KJS::Parser::parse):
1670 (KJS::Node::refcount):
1672 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1676 - fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
1678 Fixed by changing the refcounting scheme for nodes. Instead of each node implementing a custom ref and
1679 deref for all its children (and being responsible for deleting them), nodes use a smart pointer to
1680 hold their children, and smart pointers are used outside the node tree as well. This change mostly
1683 * JavaScriptCore.xcodeproj/project.pbxproj:
1685 (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
1686 (KJS::GlobalFuncImp::callAsFunction):
1688 * kjs/function_object.cpp:
1689 (FunctionObjectImp::construct):
1692 (KJS::Parser::parse):
1693 (KJS::Parser::accept):
1694 (KJS::InterpreterImp::checkSyntax):
1695 (KJS::InterpreterImp::evaluate):
1700 (ElementNode::evaluate):
1701 (PropertyValueNode::evaluate):
1702 (ArgumentListNode::evaluateList):
1703 (NewExprNode::evaluate):
1704 (FunctionCallValueNode::evaluate):
1705 (FunctionCallBracketNode::evaluate):
1706 (FunctionCallDotNode::evaluate):
1707 (RelationalNode::evaluate):
1708 (StatListNode::execute):
1709 (StatListNode::processVarDecls):
1710 (VarDeclListNode::evaluate):
1711 (VarDeclListNode::processVarDecls):
1712 (ForInNode::ForInNode):
1713 (ClauseListNode::processVarDecls):
1714 (CaseBlockNode::evalBlock):
1715 (FuncDeclNode::processFuncDecl):
1716 (FuncExprNode::evaluate):
1717 (SourceElementsNode::execute):
1718 (SourceElementsNode::processFuncDecl):
1719 (SourceElementsNode::processVarDecls):
1723 (KJS::NumberNode::NumberNode):
1724 (KJS::GroupNode::GroupNode):
1725 (KJS::ElementNode::ElementNode):
1726 (KJS::ArrayNode::ArrayNode):
1727 (KJS::PropertyValueNode::PropertyValueNode):
1728 (KJS::ObjectLiteralNode::ObjectLiteralNode):
1729 (KJS::BracketAccessorNode::BracketAccessorNode):
1730 (KJS::DotAccessorNode::DotAccessorNode):
1731 (KJS::ArgumentListNode::ArgumentListNode):
1732 (KJS::ArgumentsNode::ArgumentsNode):
1733 (KJS::NewExprNode::NewExprNode):
1734 (KJS::FunctionCallValueNode::FunctionCallValueNode):
1735 (KJS::FunctionCallResolveNode::FunctionCallResolveNode):
1736 (KJS::FunctionCallBracketNode::FunctionCallBracketNode):
1737 (KJS::FunctionCallDotNode::FunctionCallDotNode):
1738 (KJS::PostfixNode::PostfixNode):
1739 (KJS::DeleteNode::DeleteNode):
1740 (KJS::VoidNode::VoidNode):
1741 (KJS::TypeOfNode::TypeOfNode):
1742 (KJS::PrefixNode::PrefixNode):
1743 (KJS::UnaryPlusNode::UnaryPlusNode):
1744 (KJS::NegateNode::NegateNode):
1745 (KJS::BitwiseNotNode::BitwiseNotNode):
1746 (KJS::LogicalNotNode::LogicalNotNode):
1747 (KJS::MultNode::MultNode):
1748 (KJS::AddNode::AddNode):
1749 (KJS::ShiftNode::ShiftNode):
1750 (KJS::RelationalNode::RelationalNode):
1751 (KJS::EqualNode::EqualNode):
1752 (KJS::BitOperNode::BitOperNode):
1753 (KJS::BinaryLogicalNode::BinaryLogicalNode):
1754 (KJS::ConditionalNode::ConditionalNode):
1755 (KJS::AssignResolveNode::AssignResolveNode):
1756 (KJS::AssignBracketNode::AssignBracketNode):
1757 (KJS::AssignDotNode::AssignDotNode):
1758 (KJS::CommaNode::CommaNode):
1759 (KJS::AssignExprNode::AssignExprNode):
1760 (KJS::VarDeclListNode::VarDeclListNode):
1761 (KJS::VarStatementNode::VarStatementNode):
1762 (KJS::ExprStatementNode::ExprStatementNode):
1763 (KJS::IfNode::IfNode):
1764 (KJS::DoWhileNode::DoWhileNode):
1765 (KJS::WhileNode::WhileNode):
1766 (KJS::ForNode::ForNode):
1767 (KJS::ReturnNode::ReturnNode):
1768 (KJS::WithNode::WithNode):
1769 (KJS::CaseClauseNode::CaseClauseNode):
1770 (KJS::ClauseListNode::ClauseListNode):
1771 (KJS::ClauseListNode::clause):
1772 (KJS::ClauseListNode::next):
1773 (KJS::SwitchNode::SwitchNode):
1774 (KJS::LabelNode::LabelNode):
1775 (KJS::ThrowNode::ThrowNode):
1776 (KJS::CatchNode::CatchNode):
1777 (KJS::FinallyNode::FinallyNode):
1778 (KJS::TryNode::TryNode):
1779 (KJS::ParameterNode::ParameterNode):
1780 (KJS::ParameterNode::nextParam):
1781 (KJS::FuncDeclNode::FuncDeclNode):
1782 (KJS::FuncExprNode::FuncExprNode):
1783 * kjs/nodes2string.cpp:
1784 (KJS::SourceStream::operator<<):
1785 (ElementNode::streamTo):
1786 (PropertyValueNode::streamTo):
1787 (ArgumentListNode::streamTo):
1788 (StatListNode::streamTo):
1789 (VarDeclListNode::streamTo):
1790 (CaseBlockNode::streamTo):
1791 (ParameterNode::streamTo):
1792 (SourceElementsNode::streamTo):
1793 * kjs/shared_ptr.h: Added.
1794 (kxmlcore::SharedPtr::SharedPtr):
1795 (kxmlcore::SharedPtr::~SharedPtr):
1796 (kxmlcore::SharedPtr::isNull):
1797 (kxmlcore::SharedPtr::notNull):
1798 (kxmlcore::SharedPtr::reset):
1799 (kxmlcore::SharedPtr::get):
1800 (kxmlcore::SharedPtr::operator*):
1801 (kxmlcore::SharedPtr::operator->):
1802 (kxmlcore::SharedPtr::operator!):
1803 (kxmlcore::SharedPtr::operator bool):
1804 (kxmlcore::SharedPtr::operator==):
1805 (kxmlcore::::operator):
1806 (kxmlcore::operator!=):
1807 (kxmlcore::static_pointer_cast):
1808 (kxmlcore::const_pointer_cast):
1810 2005-08-26 Geoff Garen <ggaren@apple.com>
1815 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4664
1816 TOT Crash from backwards null check in WebScriptObject.mm
1818 * bindings/objc/WebScriptObject.mm:
1819 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1822 2005-08-25 Darin Adler <darin@apple.com>
1824 Reviewed by John Sullivan.
1826 - rename KJS::UString::string() to KJS::UString::domString()
1827 - rename KJS::Identifier::string() to KJS::Identifier::domString()
1829 * kjs/identifier.h: Renamed.
1830 * kjs/ustring.h: Ditto.
1832 2005-08-19 Darin Adler <darin@apple.com>
1836 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4435
1837 speed up JavaScript by tweaking the Identifier class
1839 * kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
1841 * kjs/identifier.cpp: (KJS::Identifier::init): Initialize a global for the null identifier
1842 as well as all the other globals for special identifiers.
1844 * kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
1845 * kjs/ustring.cpp: Remove the old non-inline version.
1847 2005-08-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
1850 Revised and landed by Darin.
1852 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4474
1853 REGRESSION: Crash when using in-place operator on uninitialized array element
1856 (AssignResolveNode::evaluate): Remove unneeded "isSet" assertion.
1857 (AssignBracketNode::evaluate): Replace code that tested "isSet" with code that
1858 tests the return value of getPropertySlot.
1860 * kjs/property_slot.h: Removed unneeded "isSet" function. Property slots are
1861 either uninitialized or set. There's no "initialized and not set" state.
1863 2005-08-18 Adele Peterson <adele@apple.com>
1865 Checked "Inline Functions Hidden" box
1867 * JavaScriptCore.xcodeproj/project.pbxproj:
1869 2005-08-16 Darin Adler <darin@apple.com>
1873 - fixed crash in one of the JavaScript tests (introduced by my throwError change)
1875 * kjs/nodes.cpp: (Node::setExceptionDetailsIfNeeded): Check if the exception is an
1876 object before setting the file and line number properties on it. Something to think
1877 about in the future -- do we really want to do this on any object that's thrown?
1878 How about limiting it to error objects that were created by the JavaScript engine?
1880 - changed kjs_fast_malloc so we don't have two conflicting versions of the same function
1882 * kjs/fast_malloc.h: Took out all the ifdefs from this header.
1883 * kjs/fast_malloc.cpp: Added non-NDEBUG versions of the functions that just call
1884 the system malloc, and put the NDEBUG versions in an #else.
1886 2005-08-16 Darin Adler <darin@apple.com>
1890 - clean up exported symbols that are not in a "KJS" namespace
1892 * bindings/NP_jsobject.cpp: (identiferFromNPIdentifier): Marked this function static
1893 so it no longer has external linkage.
1894 * bindings/c/c_utility.h: Put all this stuff inside the KJS namespace.
1895 * bindings/c/c_utility.cpp: Also marked some globals static so they don't have external
1896 linkage; not as important given the namespace.
1897 * bindings/npruntime.cpp: Marked functions static so they no longer have internal linkage.
1898 Also removed unused _NPN_SetExceptionWithUTF8 function (not in header, had C++ linkage!).
1900 * bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): Call KJS_GetCreatedJavaVMs
1901 using the soft linking header, instead of calling the JNI call. This allows processes
1902 to link both JavaScriptCore and JavaVM without a symbol conflict.
1903 * bindings/softlinking.c:
1904 (loadFramework): Marked this function static so it no longer has external linkage.
1905 (getFunctionPointer): Ditto.
1906 (KJS_GetCreatedJavaVMs): Renamed this so it has a KJS prefix.
1908 * JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
1909 * bindings/softlinking.h: Added.
1911 * kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
1912 no longer has external linkage.
1914 2005-08-15 Darin Adler <darin@apple.com>
1918 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4437
1919 clean up error creation with new throwError function
1921 * bindings/NP_jsobject.cpp:
1922 (_NPN_SetException):
1923 * bindings/jni/jni_instance.cpp:
1924 (JavaInstance::invokeMethod):
1925 * bindings/jni/jni_runtime.cpp:
1926 (JavaField::dispatchValueFromInstance):
1927 (JavaField::dispatchSetValueToInstance):
1928 * bindings/objc/WebScriptObject.mm:
1929 (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:executionContext:]):
1930 (-[WebScriptObject _initWithObjectImp:originExecutionContext:executionContext:]):
1931 (+[WebScriptObject throwException:]):
1932 (-[WebScriptObject setException:]):
1933 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1934 * bindings/objc/objc_class.h:
1935 (KJS::Bindings::ObjcClass::~ObjcClass):
1936 (KJS::Bindings::ObjcClass::ObjcClass):
1937 (KJS::Bindings::ObjcClass::operator=):
1938 (KJS::Bindings::ObjcClass::constructorAt):
1939 (KJS::Bindings::ObjcClass::numConstructors):
1940 * bindings/objc/objc_header.h:
1941 * bindings/objc/objc_runtime.h:
1942 (KJS::Bindings::ObjcField::~ObjcField):
1943 (KJS::Bindings::ObjcField::ObjcField):
1944 (KJS::Bindings::ObjcField::operator=):
1945 (KJS::Bindings::ObjcMethod::ObjcMethod):
1946 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1947 (KJS::Bindings::ObjcMethod::operator=):
1948 * bindings/objc/objc_runtime.mm:
1949 (ObjcField::valueFromInstance):
1950 (ObjcField::setValueToInstance):
1951 (ObjcArray::setValueAt):
1952 (ObjcArray::valueAt):
1953 * bindings/objc/objc_utility.h:
1954 * bindings/objc/objc_utility.mm:
1955 (KJS::Bindings::JSMethodNameToObjCMethodName):
1956 (KJS::Bindings::convertValueToObjcValue):
1957 (KJS::Bindings::convertNSStringToString):
1958 (KJS::Bindings::convertObjcValueToValue):
1959 (KJS::Bindings::objcValueTypeForType):
1960 (KJS::Bindings::createObjcInstanceForValue):
1961 (KJS::Bindings::throwError):
1962 * bindings/runtime.h:
1963 (KJS::Bindings::Parameter::~Parameter):
1964 (KJS::Bindings::Method::~Method):
1965 (KJS::Bindings::Instance::Instance):
1966 (KJS::Bindings::Instance::begin):
1967 (KJS::Bindings::Instance::end):
1968 (KJS::Bindings::Instance::getValueOfUndefinedField):
1969 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
1970 (KJS::Bindings::Instance::setValueOfUndefinedField):
1971 (KJS::Bindings::Instance::valueOf):
1972 * bindings/runtime_array.cpp:
1973 (RuntimeArrayImp::put):
1974 * bindings/runtime_object.h:
1975 (KJS::RuntimeObjectImp::setInternalInstance):
1976 (KJS::RuntimeObjectImp::getInternalInstance):
1977 * kjs/array_object.cpp:
1979 (ArrayProtoFuncImp::callAsFunction):
1980 (ArrayObjectImp::construct):
1981 * kjs/bool_object.cpp:
1982 (BooleanProtoFuncImp::callAsFunction):
1983 * kjs/date_object.cpp:
1984 (KJS::DateProtoFuncImp::callAsFunction):
1987 (KJS::GlobalFuncImp::callAsFunction):
1988 * kjs/function_object.cpp:
1989 (FunctionProtoFuncImp::callAsFunction):
1990 (FunctionObjectImp::construct):
1992 (KJS::UndefinedImp::toObject):
1993 (KJS::NullImp::toObject):
1994 (KJS::InterpreterImp::evaluate):
1995 (KJS::InternalFunctionImp::hasInstance):
1999 (Node::setExceptionDetailsIfNeeded):
2000 (undefinedVariableError):
2001 (ProgramNode::ProgramNode):
2002 * kjs/number_object.cpp:
2003 (NumberProtoFuncImp::callAsFunction):
2005 (KJS::ObjectImp::call):
2006 (KJS::ObjectImp::defaultValue):
2007 (KJS::Error::create):
2010 (KJS::ObjectImp::clearProperties):
2011 (KJS::ObjectImp::getPropertySlot):
2012 (KJS::ObjectImp::getOwnPropertySlot):
2013 * kjs/object_object.cpp:
2014 (ObjectProtoFuncImp::callAsFunction):
2015 * kjs/reference.cpp:
2016 (KJS::Reference::getBase):
2017 (KJS::Reference::getValue):
2018 (KJS::Reference::putValue):
2019 (KJS::Reference::deleteValue):
2020 * kjs/regexp_object.cpp:
2021 (RegExpProtoFuncImp::callAsFunction):
2022 (RegExpObjectImp::construct):
2023 * kjs/string_object.cpp:
2024 (StringProtoFuncImp::callAsFunction):
2026 2005-08-15 Anders Carlsson <andersca@mac.com>
2030 * tests/mozilla/ecma_3/Date/15.9.5.5.js:
2031 Remove the code which tests that Date.toLocaleString should be parsable
2032 by Date.parse. That is not true according to the spec.
2034 2005-08-15 Darin Adler <darin@apple.com>
2038 * kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
2039 more place; slight speedup.
2041 2005-08-14 Darin Adler <darin@apple.com>
2045 - fixed crash observed on one of the Apple-only layout tests
2047 * kjs/property_map.cpp: (KJS::PropertyMap::mark): Change code to understand that deleted
2048 entries have a value of NULL, so the deleted sentinel count doesn't need to be included
2049 in the count of things to mark since we're ignoring the keys.
2051 2005-08-14 Darin Adler <darin@apple.com>
2055 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4421
2056 speed up JavaScript by inlining some label stack functions
2058 * kjs/internal.h: Removed the copy constructor and assignment operator for LabelStack.
2059 They were unused, and the implementations had bugs; I removed them rather than fixing them.
2060 Also removed the clear function, since that was only needed to help the assignment operator
2061 share code with the destructor, and was not efficient enough for the destructor.
2062 (KJS::LabelStack::~LabelStack): Made this inline. Also used an efficient implementation
2063 that's nice and fast when the stack is empty, better than the old clear() function which
2064 used to keep updating and refetching "tos" each time through the loop.
2065 (KJS::LabelStack::pop): Made this inline.
2067 * kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
2068 deleted a commented-out line of code.
2070 2005-08-14 Darin Adler <darin@apple.com>
2074 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4419
2075 speed up JavaScript by improving KJS::List
2077 my measurements show an improvement of 1% on iBench JavaScript
2079 * kjs/list.cpp: Rearrange list to make the values and free list share the same storage,
2080 which saves 4 bytes per list. Also remove the pointers used only on the heap from the
2081 lists that are in the pool, which saves 8 bytes per list. Moving the free list pointer
2082 closer to the start of the list object also speeds up access to the free list. New
2083 "HeapListImp" struct is used only for the lists on the heap.
2084 (KJS::List::markProtectedLists): Shadowed global variable in local and updated for the
2085 new terminology ("heap" instead of "outside pool").
2086 (KJS::allocateListImp): Updated for new terminology.
2087 (KJS::List::release): Moved the code from deallocateListImp in here -- it wasn't being
2088 inlined and didn't need to be in a separate function.
2090 2005-08-14 Darin Adler <darin@apple.com>
2094 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4417
2095 speed up JavaScript with some small changes to the property map code
2097 my measurements show an improvement of 2% on iBench JavaScript
2099 * kjs/property_map.h: (KJS::PropertyMap::PropertyMap): Made the default constructor inline.
2100 * kjs/property_map.cpp:
2101 (KJS::PropertyMap::~PropertyMap): Changed loop to exit early once we know we've processed
2102 all the hash table entries, based on the count.
2103 (KJS::PropertyMap::mark): Ditto.
2105 * kjs/object.h: Made an arbitrary change here to force recompiling so we pick up changes to
2106 property_map.h. Works around what seems to be an Xcode header dependency bug.
2108 2005-08-14 Darin Adler <darin@apple.com>
2112 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4416
2113 speed up JavaScript with some improvements to the garbage collector
2115 my measurements show an improvement of 2% on iBench JavaScript
2117 * kjs/collector.cpp:
2118 (KJS::Collector::allocate): Use local variables to shadow globals instead of repeatedly
2119 going at global variables. Tighten up loop implementations to make the common case fast.
2120 (KJS::Collector::markStackObjectsConservatively): Use local variables to shadow globals.
2121 Used a goto to eliminate a boolean since it was showing up in the profile.
2122 (KJS::Collector::markProtectedObjects): Iterate through the table using pointer rather
2123 than an index since the profile showed that generating better code.
2124 (KJS::Collector::collect): Added a special case for blocks where all cells are used,
2125 Use local variables to shadow globals. Eliminated a boolean by computing it another
2126 way (checking to see if the number of live objects changed). Also used local variables
2127 to shadow fields in the current cell when sweeping.
2128 (KJS::Collector::numReferencedObjects): Use AllocatedValueImp instead of ValueImp
2129 in one place -- means we get faster versions of various functions that don't worry
2131 (KJS::className): Ditto.
2132 (KJS::Collector::rootObjectClasses): Ditto.
2134 2005-08-14 Darin Adler <darin@apple.com>
2136 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
2137 REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
2139 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
2140 straightforward way. The old code set the proto to 0 and then to the correct value.
2141 This showed up as a "false positive" when searching for places that set prototype
2142 to NULL/0 so I fixed it.
2144 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
2145 not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
2147 * kjs/internal.h: Added a default constructor for InternalFunctionImp.
2148 * kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
2149 default constructor (empty body, just calls base class's default constructor).
2152 (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
2153 in Development builds.
2154 (KJS::ObjectImp::setPrototype): Ditto.
2156 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2160 - two simple speed improvements for a 3% speed gain
2162 * JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
2164 * kjs/scope_chain.h:
2165 (KJS::ScopeChainIterator::ScopeChainIterator): Add a scope chain iterator
2166 so you can walk a scope chain without having to make a copy that you then mutate.
2167 (KJS::ScopeChainIterator::operator*): standard iterator operation
2168 (KJS::ScopeChainIterator::operator->): ditto
2169 (KJS::ScopeChainIterator::operator++): ditto
2170 (KJS::ScopeChainIterator::operator==): ditto
2171 (KJS::ScopeChainIterator::operator!=): ditto
2172 (KJS::ScopeChain::begin): Iterator for the top of the scope chain
2173 (KJS::ScopeChain::end): Iterator for one past the bottom (i.e. null)
2175 (ResolveNode::evaluate): Use scope chain iterator instead of copying
2176 a scope chain and then modifying the copy
2177 (ResolveNode::evaluateReference): ditto
2178 (FunctionCallResolveNode::evaluate): ditto
2179 (AssignResolveNode::evaluate): ditto
2181 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2183 Patch from Anders Carlsson, reviewed by me.
2185 * kjs/nodes.h: Fix build breakage.
2187 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2191 - refactor function calls, 3% speedup on JS iBench.
2195 (Node::throwError): Added new useful variants.
2196 (FunctionCallValueNode::evaluate): New node to handle calls on expressions
2197 that are strictly values, not references.
2198 (FunctionCallValueNode::ref): ditto
2199 (FunctionCallValueNode::deref): ditto
2200 (FunctionCallResolveNode::evaluate): New node to handle calls on identifier
2201 expressions, so that they are looked up in the scope chain.
2202 (FunctionCallResolveNode::ref): ditto
2203 (FunctionCallResolveNode::deref): ditto
2204 (FunctionCallBracketNode::evaluate): New node to handle calls on bracket
2205 dereferences, so that the expression before brackets is used as the this
2207 (FunctionCallBracketNode::ref): ditto
2208 (FunctionCallBracketNode::deref): ditto
2209 (FunctionCallDotNode::evaluate): New node to handle calls on dot
2210 dereferences, so that the expression before the dot is used as the this
2212 (FunctionCallDotNode::ref): ditto
2213 (FunctionCallDotNode::deref): ditto
2214 (dotExprNotAnObjectString): helper function to avoid global variable access.
2215 (dotExprDoesNotAllowCallsString): ditto
2216 * kjs/nodes.h: Declared new classes.
2217 * kjs/nodes2string.cpp:
2218 (FunctionCallValueNode::streamTo): Added - serializes the appropriate function call
2219 (FunctionCallResolveNode::streamTo): ditto
2220 (FunctionCallBracketNode::streamTo): ditto
2221 (FunctionCallParenBracketNode::streamTo): ditto
2222 (FunctionCallDotNode::streamTo): ditto
2223 (FunctionCallParenDotNode::streamTo): ditto
2225 (KJS::ObjectImp::isActivation): Change how activation objects are
2226 detected in the scope chain, a virtual function is cheaper than the
2227 old inheritance test.
2229 (KJS::ActivationImp::isActivation): Ditto.
2231 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2233 - added missing file from earlier checkin
2235 * kjs/grammar_types.h: Added.
2236 (KJS::makeNodePair):
2237 (KJS::makeNodeWithIdent):
2239 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2243 * kjs/date_object.cpp:
2244 (timetUsingCF): Fix one of the date tests my making the CF version of mktime
2245 have the same quirk about the DST field as the real mktime.
2246 * tests/mozilla/expected.html: Updated for newly fixed test.
2248 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2250 - updated for one of the tests that Darin incidentally fixed.
2252 * tests/mozilla/expected.html:
2254 2005-08-10 Maciej Stachowiak <mjs@apple.com>
2258 Refactor assignment grammar to avoid Reference type, and to later
2259 be able to take advantage of writeable PropertySlots, when those
2260 are added. I also fixed a minor bug, turning a function to a
2261 string lost parentheses, I made sure they are printed at least
2262 where semantically significant.
2264 Test cases: see WebCore
2266 * kjs/grammar.y: Change grammar so that assignment expressions are parsed
2267 directly to nodes that know how to set the kind of location being assigned, instead
2268 of having a generic assign node that counts on evaluateReference.
2269 * kjs/lexer.cpp: Include grammar_types.h.
2271 (BracketAccessorNode): Renamed from AccessorNode1 for clarity.
2272 (DotAccessorNode): Renamed from AccessorNode2 for clarity.
2273 (combineForAssignment): Inline function for doing the proper kind of
2274 operation for various update assignments like += or *=.
2275 (AssignResolveNode): Node that handles assignment to a bare identifier.
2276 (AssignDotNode): Node that handles assignments of the form EXPR . IDENT = EXPR
2277 (AssignBracketNode): EXPR [ IDENT ] = EXPR
2278 * kjs/nodes.h: Updated for declarations/renames of new classes.
2279 * kjs/nodes2string.cpp:
2280 (GroupNode::streamTo): Fixed to print parens around the expression.
2281 (BracketAccessorNode::streamTo): Renamed.
2282 (DotAccessorNode::streamTo): Renamed.
2283 (AssignResolveNode::streamTo): Added.
2284 (AssignBracketNode::streamTo): Added.
2285 (AssignDotNode::streamTo): Added.
2286 (streamAssignmentOperatorTo): helper function for the above
2287 * kjs/property_slot.h:
2288 (KJS::PropertySlot::isSet): Made this const.
2290 2005-08-10 Adele Peterson <adele@apple.com>
2292 Bumping version to 420+
2296 2005-08-10 Geoffrey Garen <ggaren@apple.com>
2298 -fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls
2299 throws privilege exception.
2301 Reviewed by richard and mjs.
2303 -I removed the global static JavaClass cache, since it violated Java
2304 security to cache classes between websites and applets.
2306 * bindings/jni/jni_class.cpp:
2307 -removed global static cache dictionary
2308 -instance constructor and destructor now do the work that used to
2309 be done by static factory methods
2310 -removed obsolete functions
2311 (JavaClass::JavaClass):
2312 (JavaClass::~JavaClass):
2313 * bindings/jni/jni_class.h:
2314 -removed obsolete function declarations
2315 -made copying private since it's unused and it's also not clear
2316 excatly how copying would work with Java security
2317 -made default construction private since it's meaningless
2318 * bindings/jni/jni_instance.cpp:
2319 -removed obsolete functions
2320 (JavaInstance::~JavaInstance):
2321 (JavaInstance::getClass):
2322 * bindings/jni/jni_instance.h:
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
2327 2005-08-08 Geoffrey Garen <ggaren@apple.com>
2329 -fixed crash caused by fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
2331 - exceptionDescription now gets explicitly initialized to NULL in all
2332 the places listed below -- our wrapper classes used to take care of this
2335 * bindings/jni/jni_instance.cpp:
2336 (JavaInstance::invokeMethod):
2337 * bindings/jni/jni_runtime.cpp:
2338 (JavaField::dispatchValueFromInstance):
2339 (JavaField::dispatchSetValueToInstance):
2341 2005-08-08 Darin Adler <darin@apple.com>
2343 Reviewed by John Sullivan.
2345 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4325
2346 Mozilla Date tests have an unnecessary loop that runs 1970 times before each test
2348 * tests/mozilla/ecma/shell.js: Added TIME_YEAR_0 constant.
2350 * tests/mozilla/ecma/Date/15.9.5.10-1.js: Removed the loop and changed code to use the constant.
2351 * tests/mozilla/ecma/Date/15.9.5.10-10.js: Ditto.
2352 * tests/mozilla/ecma/Date/15.9.5.10-11.js: Ditto.
2353 * tests/mozilla/ecma/Date/15.9.5.10-12.js: Ditto.
2354 * tests/mozilla/ecma/Date/15.9.5.10-13.js: Ditto.
2355 * tests/mozilla/ecma/Date/15.9.5.10-2.js: Ditto.
2356 * tests/mozilla/ecma/Date/15.9.5.10-3.js: Ditto.
2357 * tests/mozilla/ecma/Date/15.9.5.10-4.js: Ditto.
2358 * tests/mozilla/ecma/Date/15.9.5.10-5.js: Ditto.
2359 * tests/mozilla/ecma/Date/15.9.5.10-6.js: Ditto.
2360 * tests/mozilla/ecma/Date/15.9.5.10-7.js: Ditto.
2361 * tests/mozilla/ecma/Date/15.9.5.10-8.js: Ditto.
2362 * tests/mozilla/ecma/Date/15.9.5.10-9.js: Ditto.
2363 * tests/mozilla/ecma/Date/15.9.5.11-2.js: Ditto.
2364 * tests/mozilla/ecma/Date/15.9.5.12-1.js: Ditto.
2365 * tests/mozilla/ecma/Date/15.9.5.12-2.js: Ditto.
2366 * tests/mozilla/ecma/Date/15.9.5.12-3.js: Ditto.
2367 * tests/mozilla/ecma/Date/15.9.5.12-4.js: Ditto.
2368 * tests/mozilla/ecma/Date/15.9.5.12-5.js: Ditto.
2369 * tests/mozilla/ecma/Date/15.9.5.12-6.js: Ditto.
2370 * tests/mozilla/ecma/Date/15.9.5.12-7.js: Ditto.
2371 * tests/mozilla/ecma/Date/15.9.5.12-8.js: Ditto.
2372 * tests/mozilla/ecma/Date/15.9.5.13-2.js: Ditto.
2373 * tests/mozilla/ecma/Date/15.9.5.13-8.js: Ditto.
2374 * tests/mozilla/ecma/Date/15.9.5.14.js: Ditto.
2375 * tests/mozilla/ecma/Date/15.9.5.15.js: Ditto.
2376 * tests/mozilla/ecma/Date/15.9.5.16.js: Ditto.
2377 * tests/mozilla/ecma/Date/15.9.5.17.js: Ditto.
2378 * tests/mozilla/ecma/Date/15.9.5.18.js: Ditto.
2379 * tests/mozilla/ecma/Date/15.9.5.19.js: Ditto.
2380 * tests/mozilla/ecma/Date/15.9.5.20.js: Ditto.
2381 * tests/mozilla/ecma/Date/15.9.5.21-1.js: Ditto.
2382 * tests/mozilla/ecma/Date/15.9.5.21-2.js: Ditto.
2383 * tests/mozilla/ecma/Date/15.9.5.21-3.js: Ditto.
2384 * tests/mozilla/ecma/Date/15.9.5.21-4.js: Ditto.
2385 * tests/mozilla/ecma/Date/15.9.5.21-5.js: Ditto.
2386 * tests/mozilla/ecma/Date/15.9.5.21-6.js: Ditto.
2387 * tests/mozilla/ecma/Date/15.9.5.21-7.js: Ditto.
2388 * tests/mozilla/ecma/Date/15.9.5.21-8.js: Ditto.
2389 * tests/mozilla/ecma/Date/15.9.5.22-1.js: Ditto.
2390 * tests/mozilla/ecma/Date/15.9.5.22-2.js: Ditto.
2391 * tests/mozilla/ecma/Date/15.9.5.22-3.js: Ditto.
2392 * tests/mozilla/ecma/Date/15.9.5.22-4.js: Ditto.
2393 * tests/mozilla/ecma/Date/15.9.5.22-5.js: Ditto.
2394 * tests/mozilla/ecma/Date/15.9.5.22-6.js: Ditto.
2395 * tests/mozilla/ecma/Date/15.9.5.22-7.js: Ditto.
2396 * tests/mozilla/ecma/Date/15.9.5.22-8.js: Ditto.
2397 * tests/mozilla/ecma/Date/15.9.5.23-4.js: Ditto.
2398 * tests/mozilla/ecma/Date/15.9.5.23-5.js: Ditto.
2399 * tests/mozilla/ecma/Date/15.9.5.23-6.js: Ditto.
2400 * tests/mozilla/ecma/Date/15.9.5.23-7.js: Ditto.
2401 * tests/mozilla/ecma/Date/15.9.5.23-8.js: Ditto.
2402 * tests/mozilla/ecma/Date/15.9.5.23-9.js: Ditto.
2403 * tests/mozilla/ecma/Date/15.9.5.5.js: Ditto.
2404 * tests/mozilla/ecma/Date/15.9.5.6.js: Ditto.
2405 * tests/mozilla/ecma/Date/15.9.5.7.js: Ditto.
2406 * tests/mozilla/ecma/Date/15.9.5.8.js: Ditto.
2407 * tests/mozilla/ecma/Date/15.9.5.9.js: Ditto.
2409 2005-08-08 Darin Adler <darin@apple.com>
2411 - forgot to delete an obsolete file
2413 * kjs/object_wrapper.h: Deleted.
2415 2005-08-07 Darin Adler <darin@apple.com>
2417 - fixed two problems compiling with gcc 4.0
2419 * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction): Initialized a
2420 variable to quiet an erroneous warning.
2421 * kjs/date_object.cpp: (KJS::makeTime): Removed extraneous KJS:: prefix.
2423 2005-08-07 Darin Adler <darin@apple.com>
2425 Rubber stamped by Maciej.
2427 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
2428 eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
2430 * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
2432 Global replaces and other wonderful stuff.
2434 * bindings/NP_jsobject.cpp:
2440 (_NPN_SetException):
2441 * bindings/c/c_instance.cpp:
2442 (KJS::Bindings::CInstance::CInstance):
2443 (KJS::Bindings::CInstance::invokeMethod):
2444 (KJS::Bindings::CInstance::invokeDefaultMethod):
2445 (KJS::Bindings::CInstance::defaultValue):
2446 (KJS::Bindings::CInstance::stringValue):
2447 (KJS::Bindings::CInstance::numberValue):
2448 (KJS::Bindings::CInstance::booleanValue):
2449 (KJS::Bindings::CInstance::valueOf):
2450 * bindings/c/c_instance.h:
2451 * bindings/c/c_runtime.cpp:
2452 (CField::valueFromInstance):
2453 (CField::setValueToInstance):
2454 * bindings/c/c_runtime.h:
2455 * bindings/c/c_utility.cpp:
2456 (convertNPStringToUTF16):
2457 (convertUTF8ToUTF16):
2458 (coerceValueToNPVariantStringType):
2459 (convertValueToNPVariant):
2460 (convertNPVariantToValue):
2461 * bindings/c/c_utility.h:
2462 * bindings/jni/jni_instance.cpp:
2463 (JavaInstance::stringValue):
2464 (JavaInstance::numberValue):
2465 (JavaInstance::booleanValue):
2466 (JavaInstance::invokeMethod):
2467 (JavaInstance::invokeDefaultMethod):
2468 (JavaInstance::defaultValue):
2469 (JavaInstance::valueOf):
2470 * bindings/jni/jni_instance.h:
2471 * bindings/jni/jni_jsobject.cpp:
2475 (JSObject::getMember):
2476 (JSObject::getSlot):
2477 (JSObject::toString):
2478 (JSObject::convertValueToJObject):
2479 (JSObject::convertJObjectToValue):
2480 (JSObject::listFromJArray):
2481 * bindings/jni/jni_jsobject.h:
2482 * bindings/jni/jni_objc.mm:
2483 (KJS::Bindings::dispatchJNICall):
2484 * bindings/jni/jni_runtime.cpp:
2485 (JavaArray::convertJObjectToArray):
2486 (JavaField::dispatchValueFromInstance):
2487 (JavaField::valueFromInstance):
2488 (JavaField::dispatchSetValueToInstance):
2489 (JavaField::setValueToInstance):
2490 (JavaArray::setValueAt):
2491 (JavaArray::valueAt):
2492 * bindings/jni/jni_runtime.h:
2493 (KJS::Bindings::JavaString::ustring):
2494 * bindings/jni/jni_utility.cpp:
2495 (KJS::Bindings::getJavaVM):
2496 (KJS::Bindings::getJNIEnv):
2497 (KJS::Bindings::getMethodID):
2498 (KJS::Bindings::callJNIVoidMethod):
2499 (KJS::Bindings::callJNIObjectMethod):
2500 (KJS::Bindings::callJNIBooleanMethod):
2501 (KJS::Bindings::callJNIStaticBooleanMethod):
2502 (KJS::Bindings::callJNIByteMethod):
2503 (KJS::Bindings::callJNICharMethod):
2504 (KJS::Bindings::callJNIShortMethod):
2505 (KJS::Bindings::callJNIIntMethod):
2506 (KJS::Bindings::callJNILongMethod):
2507 (KJS::Bindings::callJNIFloatMethod):
2508 (KJS::Bindings::callJNIDoubleMethod):
2509 (KJS::Bindings::callJNIVoidMethodA):
2510 (KJS::Bindings::callJNIObjectMethodA):
2511 (KJS::Bindings::callJNIByteMethodA):
2512 (KJS::Bindings::callJNICharMethodA):
2513 (KJS::Bindings::callJNIShortMethodA):
2514 (KJS::Bindings::callJNIIntMethodA):
2515 (KJS::Bindings::callJNILongMethodA):
2516 (KJS::Bindings::callJNIFloatMethodA):
2517 (KJS::Bindings::callJNIDoubleMethodA):
2518 (KJS::Bindings::callJNIBooleanMethodA):
2519 (KJS::Bindings::callJNIVoidMethodIDA):
2520 (KJS::Bindings::callJNIObjectMethodIDA):
2521 (KJS::Bindings::callJNIByteMethodIDA):
2522 (KJS::Bindings::callJNICharMethodIDA):
2523 (KJS::Bindings::callJNIShortMethodIDA):
2524 (KJS::Bindings::callJNIIntMethodIDA):
2525 (KJS::Bindings::callJNILongMethodIDA):
2526 (KJS::Bindings::callJNIFloatMethodIDA):
2527 (KJS::Bindings::callJNIDoubleMethodIDA):
2528 (KJS::Bindings::callJNIBooleanMethodIDA):
2529 (KJS::Bindings::getCharactersFromJString):
2530 (KJS::Bindings::releaseCharactersForJString):
2531 (KJS::Bindings::getCharactersFromJStringInEnv):
2532 (KJS::Bindings::releaseCharactersForJStringInEnv):
2533 (KJS::Bindings::getUCharactersFromJStringInEnv):
2534 (KJS::Bindings::releaseUCharactersForJStringInEnv):
2535 (KJS::Bindings::JNITypeFromClassName):
2536 (KJS::Bindings::signatureFromPrimitiveType):
2537 (KJS::Bindings::JNITypeFromPrimitiveType):
2538 (KJS::Bindings::getJNIField):
2539 (KJS::Bindings::convertValueToJValue):
2540 * bindings/jni/jni_utility.h:
2541 * bindings/objc/WebScriptObject.mm:
2543 (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
2544 (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
2545 (-[WebScriptObject _imp]):
2546 (-[WebScriptObject _executionContext]):
2547 (-[WebScriptObject _setExecutionContext:]):
2548 (-[WebScriptObject _originExecutionContext]):
2549 (-[WebScriptObject _setOriginExecutionContext:]):
2550 (+[WebScriptObject throwException:]):
2552 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2553 (-[WebScriptObject evaluateWebScript:]):
2554 (-[WebScriptObject setValue:forKey:]):
2555 (-[WebScriptObject valueForKey:]):
2556 (-[WebScriptObject removeWebScriptKey:]):
2557 (-[WebScriptObject stringRepresentation]):
2558 (-[WebScriptObject webScriptValueAtIndex:]):
2559 (-[WebScriptObject setException:]):
2560 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
2561 * bindings/objc/WebScriptObjectPrivate.h:
2562 * bindings/objc/objc_class.h:
2563 * bindings/objc/objc_class.mm:
2564 (KJS::Bindings::ObjcClass::fallbackObject):
2565 * bindings/objc/objc_instance.h:
2566 * bindings/objc/objc_instance.mm:
2567 (ObjcInstance::invokeMethod):
2568 (ObjcInstance::invokeDefaultMethod):
2569 (ObjcInstance::setValueOfField):
2570 (ObjcInstance::setValueOfUndefinedField):
2571 (ObjcInstance::getValueOfField):
2572 (ObjcInstance::getValueOfUndefinedField):
2573 (ObjcInstance::defaultValue):
2574 (ObjcInstance::stringValue):
2575 (ObjcInstance::numberValue):
2576 (ObjcInstance::booleanValue):
2577 (ObjcInstance::valueOf):
2578 * bindings/objc/objc_runtime.h:
2579 * bindings/objc/objc_runtime.mm:
2580 (ObjcField::valueFromInstance):
2581 (convertValueToObjcObject):
2582 (ObjcField::setValueToInstance):
2583 (ObjcArray::setValueAt):
2584 (ObjcArray::valueAt):
2585 (ObjcFallbackObjectImp::put):
2586 (ObjcFallbackObjectImp::callAsFunction):
2587 (ObjcFallbackObjectImp::defaultValue):
2588 * bindings/objc/objc_utility.h:
2589 * bindings/objc/objc_utility.mm:
2590 (Bindings::JSMethodNameToObjCMethodName):
2591 (Bindings::convertValueToObjcValue):
2592 (Bindings::convertNSStringToString):
2593 (Bindings::convertObjcValueToValue):
2594 (Bindings::objcValueTypeForType):
2595 (Bindings::createObjcInstanceForValue):
2596 * bindings/runtime.cpp:
2597 (Instance::getValueOfField):
2598 (Instance::setValueOfField):
2599 (Instance::createRuntimeObject):
2600 (Instance::createLanguageInstanceForValue):
2601 * bindings/runtime.h:
2602 (KJS::Bindings::Constructor::~Constructor):
2603 (KJS::Bindings::Field::~Field):
2604 (KJS::Bindings::MethodList::MethodList):
2605 (KJS::Bindings::Class::fallbackObject):
2606 (KJS::Bindings::Class::~Class):
2607 (KJS::Bindings::Instance::Instance):
2608 (KJS::Bindings::Instance::getValueOfUndefinedField):
2609 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
2610 (KJS::Bindings::Instance::setValueOfUndefinedField):
2611 (KJS::Bindings::Instance::valueOf):
2612 (KJS::Bindings::Instance::setExecutionContext):
2613 (KJS::Bindings::Instance::~Instance):
2614 (KJS::Bindings::Array::~Array):
2615 * bindings/runtime_array.cpp:
2616 (RuntimeArrayImp::RuntimeArrayImp):
2617 (RuntimeArrayImp::lengthGetter):
2618 (RuntimeArrayImp::indexGetter):
2619 (RuntimeArrayImp::put):
2620 * bindings/runtime_array.h:
2621 * bindings/runtime_method.cpp:
2622 (RuntimeMethodImp::lengthGetter):
2623 (RuntimeMethodImp::callAsFunction):
2624 * bindings/runtime_method.h:
2625 * bindings/runtime_object.cpp:
2626 (RuntimeObjectImp::fallbackObjectGetter):
2627 (RuntimeObjectImp::fieldGetter):
2628 (RuntimeObjectImp::methodGetter):
2629 (RuntimeObjectImp::getOwnPropertySlot):
2630 (RuntimeObjectImp::put):
2631 (RuntimeObjectImp::defaultValue):
2632 (RuntimeObjectImp::callAsFunction):
2633 * bindings/runtime_object.h:
2634 * kjs/array_instance.h:
2635 * kjs/array_object.cpp:
2636 (ArrayInstanceImp::ArrayInstanceImp):
2637 (ArrayInstanceImp::lengthGetter):
2638 (ArrayInstanceImp::getOwnPropertySlot):
2639 (ArrayInstanceImp::put):
2640 (ArrayInstanceImp::propList):
2641 (ArrayInstanceImp::setLength):
2642 (compareByStringForQSort):
2643 (compareWithCompareFunctionForQSort):
2644 (ArrayInstanceImp::sort):
2645 (ArrayInstanceImp::pushUndefinedObjectsToEnd):
2646 (ArrayPrototypeImp::ArrayPrototypeImp):
2647 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2648 (ArrayProtoFuncImp::callAsFunction):
2649 (ArrayObjectImp::ArrayObjectImp):
2650 (ArrayObjectImp::construct):
2651 (ArrayObjectImp::callAsFunction):
2652 * kjs/array_object.h:
2653 * kjs/bool_object.cpp:
2654 (BooleanPrototypeImp::BooleanPrototypeImp):
2655 (BooleanProtoFuncImp::BooleanProtoFuncImp):
2656 (BooleanProtoFuncImp::callAsFunction):
2657 (BooleanObjectImp::BooleanObjectImp):
2658 (BooleanObjectImp::construct):
2659 (BooleanObjectImp::callAsFunction):
2660 * kjs/bool_object.h:
2661 * kjs/collector.cpp:
2662 (KJS::Collector::markStackObjectsConservatively):
2663 (KJS::Collector::collect):
2666 (KJS::Completion::Completion):
2667 (KJS::Completion::value):
2668 (KJS::Completion::isValueCompletion):
2670 (KJS::ContextImp::variableObject):
2671 (KJS::ContextImp::setVariableObject):
2672 (KJS::ContextImp::thisValue):
2673 (KJS::ContextImp::activationObject):
2674 (KJS::ContextImp::pushScope):
2675 * kjs/date_object.cpp:
2677 (KJS::timeFromArgs):
2678 (KJS::DatePrototypeImp::DatePrototypeImp):
2679 (KJS::DateProtoFuncImp::DateProtoFuncImp):
2680 (KJS::DateProtoFuncImp::callAsFunction):
2681 (KJS::DateObjectImp::DateObjectImp):
2682 (KJS::DateObjectImp::construct):
2683 (KJS::DateObjectImp::callAsFunction):
2684 (KJS::DateObjectFuncImp::DateObjectFuncImp):
2685 (KJS::DateObjectFuncImp::callAsFunction):
2687 (KJS::KRFCDate_parseDate):
2689 * kjs/date_object.h:
2691 (Debugger::exception):
2692 (Debugger::callEvent):
2693 (Debugger::returnEvent):
2695 * kjs/error_object.cpp:
2696 (ErrorPrototypeImp::ErrorPrototypeImp):
2697 (ErrorProtoFuncImp::ErrorProtoFuncImp):
2698 (ErrorProtoFuncImp::callAsFunction):
2699 (ErrorObjectImp::ErrorObjectImp):
2700 (ErrorObjectImp::construct):
2701 (ErrorObjectImp::callAsFunction):
2702 (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
2703 (NativeErrorImp::NativeErrorImp):
2704 (NativeErrorImp::construct):
2705 (NativeErrorImp::callAsFunction):
2706 * kjs/error_object.h:
2708 (KJS::FunctionImp::FunctionImp):
2709 (KJS::FunctionImp::callAsFunction):
2710 (KJS::FunctionImp::processParameters):
2711 (KJS::FunctionImp::argumentsGetter):
2712 (KJS::FunctionImp::lengthGetter):
2713 (KJS::FunctionImp::put):
2714 (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
2715 (KJS::DeclaredFunctionImp::construct):
2716 (KJS::ArgumentsImp::ArgumentsImp):
2717 (KJS::ArgumentsImp::mappedIndexGetter):
2718 (KJS::ArgumentsImp::put):
2719 (KJS::ActivationImp::argumentsGetter):
2720 (KJS::GlobalFuncImp::GlobalFuncImp):
2723 (KJS::GlobalFuncImp::callAsFunction):
2725 * kjs/function_object.cpp:
2726 (FunctionPrototypeImp::FunctionPrototypeImp):
2727 (FunctionPrototypeImp::callAsFunction):
2728 (FunctionProtoFuncImp::FunctionProtoFuncImp):
2729 (FunctionProtoFuncImp::callAsFunction):
2730 (FunctionObjectImp::FunctionObjectImp):
2731 (FunctionObjectImp::construct):
2732 (FunctionObjectImp::callAsFunction):
2733 * kjs/function_object.h:
2735 (KJS::UndefinedImp::toPrimitive):
2736 (KJS::UndefinedImp::toObject):
2737 (KJS::NullImp::toPrimitive):
2738 (KJS::NullImp::toObject):
2739 (KJS::BooleanImp::toPrimitive):
2740 (KJS::BooleanImp::toObject):
2741 (KJS::StringImp::toPrimitive):
2742 (KJS::StringImp::toObject):
2743 (KJS::NumberImp::toPrimitive):
2744 (KJS::NumberImp::toObject):
2745 (KJS::NumberImp::getUInt32):
2746 (KJS::LabelStack::push):
2747 (KJS::ContextImp::ContextImp):
2748 (KJS::InterpreterImp::globalInit):
2749 (KJS::InterpreterImp::globalClear):
2750 (KJS::InterpreterImp::InterpreterImp):
2751 (KJS::InterpreterImp::initGlobalObject):
2752 (KJS::InterpreterImp::clear):
2753 (KJS::InterpreterImp::mark):
2754 (KJS::InterpreterImp::evaluate):
2755 (KJS::InternalFunctionImp::hasInstance):
2759 (KJS::InterpreterImp::builtinObject):
2760 (KJS::InterpreterImp::builtinFunction):
2761 (KJS::InterpreterImp::builtinArray):
2762 (KJS::InterpreterImp::builtinBoolean):
2763 (KJS::InterpreterImp::builtinString):
2764 (KJS::InterpreterImp::builtinNumber):
2765 (KJS::InterpreterImp::builtinDate):
2766 (KJS::InterpreterImp::builtinRegExp):
2767 (KJS::InterpreterImp::builtinError):
2768 (KJS::InterpreterImp::builtinObjectPrototype):
2769 (KJS::InterpreterImp::builtinFunctionPrototype):
2770 (KJS::InterpreterImp::builtinArrayPrototype):
2771 (KJS::InterpreterImp::builtinBooleanPrototype):
2772 (KJS::InterpreterImp::builtinStringPrototype):
2773 (KJS::InterpreterImp::builtinNumberPrototype):
2774 (KJS::InterpreterImp::builtinDatePrototype):
2775 (KJS::InterpreterImp::builtinRegExpPrototype):
2776 (KJS::InterpreterImp::builtinErrorPrototype):
2777 (KJS::InterpreterImp::builtinEvalError):
2778 (KJS::InterpreterImp::builtinRangeError):
2779 (KJS::InterpreterImp::builtinReferenceError):
2780 (KJS::InterpreterImp::builtinSyntaxError):
2781 (KJS::InterpreterImp::builtinTypeError):
2782 (KJS::InterpreterImp::builtinURIError):
2783 (KJS::InterpreterImp::builtinEvalErrorPrototype):
2784 (KJS::InterpreterImp::builtinRangeErrorPrototype):
2785 (KJS::InterpreterImp::builtinReferenceErrorPrototype):
2786 (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
2787 (KJS::InterpreterImp::builtinTypeErrorPrototype):
2788 (KJS::InterpreterImp::builtinURIErrorPrototype):
2789 * kjs/interpreter.cpp:
2790 (Context::variableObject):
2791 (Context::thisValue):
2792 (Interpreter::Interpreter):
2793 (Interpreter::globalObject):
2794 (Interpreter::evaluate):
2795 (Interpreter::builtinObject):
2796 (Interpreter::builtinFunction):
2797 (Interpreter::builtinArray):
2798 (Interpreter::builtinBoolean):
2799 (Interpreter::builtinString):
2800 (Interpreter::builtinNumber):
2801 (Interpreter::builtinDate):
2802 (Interpreter::builtinRegExp):
2803 (Interpreter::builtinError):
2804 (Interpreter::builtinObjectPrototype):
2805 (Interpreter::builtinFunctionPrototype):
2806 (Interpreter::builtinArrayPrototype):
2807 (Interpreter::builtinBooleanPrototype):
2808 (Interpreter::builtinStringPrototype):
2809 (Interpreter::builtinNumberPrototype):
2810 (Interpreter::builtinDatePrototype):
2811 (Interpreter::builtinRegExpPrototype):
2812 (Interpreter::builtinErrorPrototype):
2813 (Interpreter::builtinEvalError):
2814 (Interpreter::builtinRangeError):
2815 (Interpreter::builtinReferenceError):
2816 (Interpreter::builtinSyntaxError):
2817 (Interpreter::builtinTypeError):
2818 (Interpreter::builtinURIError):
2819 (Interpreter::builtinEvalErrorPrototype):
2820 (Interpreter::builtinRangeErrorPrototype):
2821 (Interpreter::builtinReferenceErrorPrototype):
2822 (Interpreter::builtinSyntaxErrorPrototype):
2823 (Interpreter::builtinTypeErrorPrototype):
2824 (Interpreter::builtinURIErrorPrototype):
2825 (Interpreter::createLanguageInstanceForValue):
2826 * kjs/interpreter.h:
2827 (KJS::Interpreter::isGlobalObject):
2828 (KJS::ExecState::setException):
2829 (KJS::ExecState::clearException):
2830 (KJS::ExecState::exception):
2831 (KJS::ExecState::hadException):
2832 (KJS::ExecState::ExecState):
2836 (KJS::List::operator[]):
2837 (KJS::ListIterator::operator->):
2838 (KJS::ListIterator::operator*):
2839 (KJS::ListIterator::operator++):
2840 (KJS::ListIterator::operator--):
2842 (KJS::staticFunctionGetter):
2843 (KJS::staticValueGetter):
2845 (KJS::cacheGlobalObject):
2846 * kjs/math_object.cpp:
2847 (MathObjectImp::getValueProperty):
2848 (MathFuncImp::MathFuncImp):
2849 (MathFuncImp::callAsFunction):
2850 * kjs/math_object.h:
2852 (Node::evaluateReference):
2854 (Node::setExceptionDetailsIfNeeded):
2855 (NullNode::evaluate):
2856 (BooleanNode::evaluate):
2857 (NumberNode::evaluate):
2858 (StringNode::evaluate):
2859 (RegExpNode::evaluate):
2860 (ThisNode::evaluate):
2861 (ResolveNode::evaluate):
2862 (ResolveNode::evaluateReference):
2863 (GroupNode::evaluate):
2864 (ElementNode::evaluate):
2865 (ArrayNode::evaluate):
2866 (ObjectLiteralNode::evaluate):
2867 (PropertyValueNode::evaluate):
2868 (PropertyNode::evaluate):
2869 (AccessorNode1::evaluate):
2870 (AccessorNode1::evaluateReference):
2871 (AccessorNode2::evaluate):
2872 (AccessorNode2::evaluateReference):
2873 (ArgumentListNode::evaluate):
2874 (ArgumentListNode::evaluateList):
2875 (ArgumentsNode::evaluate):
2876 (NewExprNode::evaluate):
2877 (FunctionCallNode::evaluate):
2878 (PostfixNode::evaluate):
2879 (DeleteNode::evaluate):
2880 (VoidNode::evaluate):
2881 (TypeOfNode::evaluate):
2882 (PrefixNode::evaluate):
2883 (UnaryPlusNode::evaluate):
2884 (NegateNode::evaluate):
2885 (BitwiseNotNode::evaluate):
2886 (LogicalNotNode::evaluate):
2887 (MultNode::evaluate):
2888 (AddNode::evaluate):
2889 (ShiftNode::evaluate):
2890 (RelationalNode::evaluate):
2891 (EqualNode::evaluate):
2892 (BitOperNode::evaluate):
2893 (BinaryLogicalNode::evaluate):
2894 (ConditionalNode::evaluate):
2895 (AssignNode::evaluate):
2896 (CommaNode::evaluate):
2897 (StatListNode::execute):
2898 (AssignExprNode::evaluate):
2899 (VarDeclNode::evaluate):
2900 (VarDeclNode::processVarDecls):
2901 (VarDeclListNode::evaluate):
2902 (ExprStatementNode::execute):
2904 (DoWhileNode::execute):
2905 (WhileNode::execute):
2907 (ForInNode::execute):
2908 (ContinueNode::execute):
2909 (BreakNode::execute):
2910 (ReturnNode::execute):
2911 (WithNode::execute):
2912 (CaseClauseNode::evaluate):
2913 (ClauseListNode::evaluate):
2914 (CaseBlockNode::evaluate):
2915 (CaseBlockNode::evalBlock):
2916 (SwitchNode::execute):
2917 (ThrowNode::execute):
2918 (CatchNode::execute):
2920 (ParameterNode::evaluate):
2921 (FuncDeclNode::processFuncDecl):
2922 (FuncExprNode::evaluate):
2923 (SourceElementsNode::execute):
2925 (KJS::StatementNode::evaluate):
2926 * kjs/number_object.cpp:
2927 (NumberPrototypeImp::NumberPrototypeImp):
2928 (NumberProtoFuncImp::NumberProtoFuncImp):
2929 (NumberProtoFuncImp::callAsFunction):
2930 (NumberObjectImp::NumberObjectImp):
2931 (NumberObjectImp::getValueProperty):
2932 (NumberObjectImp::construct):
2933 (NumberObjectImp::callAsFunction):
2934 * kjs/number_object.h:
2936 (KJS::ObjectImp::call):
2937 (KJS::ObjectImp::mark):
2938 (KJS::ObjectImp::classInfo):
2939 (KJS::ObjectImp::get):
2940 (KJS::ObjectImp::getProperty):
2941 (KJS::ObjectImp::getPropertySlot):
2942 (KJS::ObjectImp::put):
2943 (KJS::ObjectImp::hasOwnProperty):
2944 (KJS::ObjectImp::defaultValue):
2945 (KJS::ObjectImp::findPropertyHashEntry):
2946 (KJS::ObjectImp::construct):
2947 (KJS::ObjectImp::callAsFunction):
2948 (KJS::ObjectImp::hasInstance):
2949 (KJS::ObjectImp::propList):
2950 (KJS::ObjectImp::toPrimitive):
2951 (KJS::ObjectImp::toNumber):
2952 (KJS::ObjectImp::toString):
2953 (KJS::ObjectImp::toObject):
2954 (KJS::ObjectImp::putDirect):
2955 (KJS::Error::create):
2959 (KJS::ObjectImp::getPropertySlot):
2960 (KJS::AllocatedValueImp::isObject):
2961 (KJS::ObjectImp::ObjectImp):
2962 (KJS::ObjectImp::internalValue):
2963 (KJS::ObjectImp::setInternalValue):
2964 (KJS::ObjectImp::prototype):
2965 (KJS::ObjectImp::setPrototype):
2966 (KJS::ObjectImp::inherits):
2967 * kjs/object_object.cpp:
2968 (ObjectPrototypeImp::ObjectPrototypeImp):
2969 (ObjectProtoFuncImp::ObjectProtoFuncImp):
2970 (ObjectProtoFuncImp::callAsFunction):
2971 (ObjectObjectImp::ObjectObjectImp):
2972 (ObjectObjectImp::construct):
2973 (ObjectObjectImp::callAsFunction):
2974 * kjs/object_object.h:
2975 * kjs/operations.cpp:
2982 * kjs/property_map.cpp:
2983 (KJS::PropertyMap::mark):
2984 (KJS::PropertyMap::addEnumerablesToReferenceList):
2985 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
2986 (KJS::PropertyMap::save):
2987 (KJS::PropertyMap::restore):
2988 * kjs/property_map.h:
2989 * kjs/property_slot.cpp:
2990 (KJS::PropertySlot::undefinedGetter):
2991 * kjs/property_slot.h:
2992 (KJS::PropertySlot::getValue):
2994 (KJS::gcUnprotectNullTolerant):
2995 (KJS::ProtectedValue::ProtectedValue):
2996 (KJS::ProtectedValue::~ProtectedValue):
2997 (KJS::ProtectedValue::operator=):
2998 (KJS::ProtectedValue::operator ValueImp *):
2999 (KJS::ProtectedValue::operator->):
3000 * kjs/protected_object.h:
3001 (KJS::ProtectedObject::ProtectedObject):
3002 (KJS::ProtectedObject::operator=):
3003 (KJS::ProtectedObject::operator ValueImp *):
3004 (KJS::ProtectedObject::operator ObjectImp *):
3005 (KJS::ProtectedObject::operator->):
3006 (KJS::ProtectedReference::ProtectedReference):
3007 (KJS::ProtectedReference::~ProtectedReference):
3008 (KJS::ProtectedReference::operator=):
3009 * kjs/protected_values.cpp:
3010 (KJS::ProtectedValues::getProtectCount):
3011 (KJS::ProtectedValues::increaseProtectCount):
3012 (KJS::ProtectedValues::insert):
3013 (KJS::ProtectedValues::decreaseProtectCount):
3014 * kjs/protected_values.h:
3015 * kjs/reference.cpp:
3016 (KJS::Reference::Reference):
3017 (KJS::Reference::makeValueReference):
3018 (KJS::Reference::getBase):
3019 (KJS::Reference::getValue):
3020 (KJS::Reference::putValue):
3021 (KJS::Reference::deleteValue):
3023 (KJS::Reference::baseIfMutable):
3024 * kjs/regexp_object.cpp:
3025 (RegExpPrototypeImp::RegExpPrototypeImp):
3026 (RegExpProtoFuncImp::RegExpProtoFuncImp):
3027 (RegExpProtoFuncImp::callAsFunction):
3028 (RegExpObjectImp::RegExpObjectImp):
3029 (RegExpObjectImp::arrayOfMatches):
3030 (RegExpObjectImp::backrefGetter):
3031 (RegExpObjectImp::construct):
3032 (RegExpObjectImp::callAsFunction):
3033 * kjs/regexp_object.h:
3034 * kjs/string_object.cpp:
3035 (StringInstanceImp::lengthGetter):
3036 (StringInstanceImp::indexGetter):
3037 (StringInstanceImp::getOwnPropertySlot):
3038 (StringInstanceImp::put):
3039 (StringPrototypeImp::StringPrototypeImp):
3040 (StringProtoFuncImp::StringProtoFuncImp):
3043 (StringProtoFuncImp::callAsFunction):
3044 (StringObjectImp::StringObjectImp):
3045 (StringObjectImp::construct):
3046 (StringObjectImp::callAsFunction):
3047 (StringObjectFuncImp::StringObjectFuncImp):
3048 (StringObjectFuncImp::callAsFunction):
3049 * kjs/string_object.h:
3051 (TestFunctionImp::callAsFunction):
3052 (VersionFunctionImp::callAsFunction):
3055 (KJS::AllocatedValueImp::operator new):
3056 (KJS::AllocatedValueImp::getUInt32):
3057 (KJS::ValueImp::toInteger):
3058 (KJS::ValueImp::toInt32):
3059 (KJS::ValueImp::toUInt32):
3060 (KJS::ValueImp::toUInt16):
3061 (KJS::ValueImp::toObject):
3062 (KJS::AllocatedValueImp::getBoolean):
3063 (KJS::AllocatedValueImp::getNumber):
3064 (KJS::AllocatedValueImp::getString):
3065 (KJS::AllocatedValueImp::getObject):
3068 (KJS::ConstantValues::init):
3069 (KJS::ConstantValues::clear):
3070 (KJS::ConstantValues::mark):
3077 (KJS::ValueImp::ValueImp):
3078 (KJS::ValueImp::~ValueImp):
3079 (KJS::AllocatedValueImp::AllocatedValueImp):
3080 (KJS::AllocatedValueImp::~AllocatedValueImp):
3081 (KJS::AllocatedValueImp::isBoolean):
3082 (KJS::AllocatedValueImp::isNumber):
3083 (KJS::AllocatedValueImp::isString):
3084 (KJS::AllocatedValueImp::isObject):
3085 (KJS::AllocatedValueImp::marked):
3086 (KJS::AllocatedValueImp::mark):
3087 (KJS::ValueImp::downcast):
3088 (KJS::ValueImp::isUndefined):
3089 (KJS::ValueImp::isNull):
3090 (KJS::ValueImp::isUndefinedOrNull):
3091 (KJS::ValueImp::isBoolean):
3092 (KJS::ValueImp::isNumber):
3093 (KJS::ValueImp::isString):
3094 (KJS::ValueImp::isObject):
3095 (KJS::ValueImp::getBoolean):
3096 (KJS::ValueImp::getNumber):
3097 (KJS::ValueImp::getString):
3098 (KJS::ValueImp::getObject):
3099 (KJS::ValueImp::getUInt32):
3100 (KJS::ValueImp::mark):
3101 (KJS::ValueImp::marked):
3102 (KJS::ValueImp::type):
3103 (KJS::ValueImp::toPrimitive):
3104 (KJS::ValueImp::toBoolean):
3105 (KJS::ValueImp::toNumber):
3106 (KJS::ValueImp::toString):
3116 2005-08-06 Maciej Stachowiak <mjs@apple.com>
3120 Change over to the new PropertySlot mechanism for property
3121 lookup. This allows the elimination of hasOwnProperty
3122 methods. Also did some of the performance tuning enabled by this
3123 (but not yet all the possible improvements for function calls,
3124 assignment, ++, and so forth). And also much code cleanup.
3126 Net result is about a 2% speedup on the JS iBench.
3128 Also redid Geoff's fix for the chrashing applet by avoiding a NULL
3129 prototype in the bindings code and using the default of Null()
3132 * JavaScriptCore.xcodeproj/project.pbxproj:
3133 * bindings/objc/objc_runtime.h:
3134 * bindings/objc/objc_runtime.mm:
3135 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3136 (ObjcFallbackObjectImp::getOwnPropertySlot):
3137 * bindings/runtime_array.cpp:
3138 (RuntimeArrayImp::lengthGetter):
3139 (RuntimeArrayImp::indexGetter):
3140 (RuntimeArrayImp::getOwnPropertySlot):
3141 * bindings/runtime_array.h:
3142 * bindings/runtime_method.cpp:
3143 (RuntimeMethodImp::lengthGetter):
3144 (RuntimeMethodImp::getOwnPropertySlot):
3145 * bindings/runtime_method.h:
3146 * bindings/runtime_object.cpp:
3147 (RuntimeObjectImp::RuntimeObjectImp):
3148 (RuntimeObjectImp::fallbackObjectGetter):
3149 (RuntimeObjectImp::fieldGetter):
3150 (RuntimeObjectImp::methodGetter):
3151 (RuntimeObjectImp::getOwnPropertySlot):
3152 * bindings/runtime_object.h:
3153 * bindings/runtime_root.h:
3154 * kjs/array_instance.h:
3155 * kjs/array_object.cpp:
3156 (ArrayInstanceImp::lengthGetter):
3157 (ArrayInstanceImp::getOwnPropertySlot):
3158 (ArrayPrototypeImp::getOwnPropertySlot):
3159 * kjs/array_object.h:
3160 * kjs/date_object.cpp:
3161 (DatePrototypeImp::getOwnPropertySlot):
3162 * kjs/date_object.h:
3164 (KJS::FunctionImp::argumentsGetter):
3165 (KJS::FunctionImp::lengthGetter):
3166 (KJS::FunctionImp::getOwnPropertySlot):
3167 (KJS::FunctionImp::put):
3168 (KJS::FunctionImp::deleteProperty):
3169 (KJS::ArgumentsImp::mappedIndexGetter):
3170 (KJS::ArgumentsImp::getOwnPropertySlot):
3171 (KJS::ActivationImp::argumentsGetter):
3172 (KJS::ActivationImp::getArgumentsGetter):
3173 (KJS::ActivationImp::getOwnPropertySlot):
3174 (KJS::ActivationImp::deleteProperty):
3177 (InterpreterImp::InterpreterImp):
3178 (InterpreterImp::initGlobalObject):
3179 (InterpreterImp::~InterpreterImp):
3180 (InterpreterImp::evaluate):
3182 (KJS::InterpreterImp::globalExec):
3183 * kjs/interpreter.cpp:
3184 (Interpreter::Interpreter):
3185 (Interpreter::createLanguageInstanceForValue):
3186 * kjs/interpreter.h:
3187 (KJS::Interpreter::argumentsIdentifier):
3188 (KJS::Interpreter::specialPrototypeIdentifier):
3190 (KJS::staticFunctionGetter):
3191 (KJS::staticValueGetter):
3192 (KJS::getStaticPropertySlot):
3193 (KJS::getStaticFunctionSlot):
3194 (KJS::getStaticValueSlot):
3195 * kjs/math_object.cpp:
3196 (MathObjectImp::getOwnPropertySlot):
3197 * kjs/math_object.h:
3199 (ResolveNode::evaluate):
3200 (ResolveNode::evaluateReference):
3201 (AccessorNode1::evaluate):
3202 (AccessorNode2::evaluate):
3203 * kjs/number_object.cpp:
3204 (NumberObjectImp::getOwnPropertySlot):
3205 * kjs/number_object.h:
3207 (KJS::ObjectImp::get):
3208 (KJS::ObjectImp::getProperty):
3209 (KJS::ObjectImp::getPropertySlot):
3210 (KJS::ObjectImp::getOwnPropertySlot):
3211 (KJS::ObjectImp::put):
3212 (KJS::ObjectImp::hasProperty):
3213 (KJS::ObjectImp::hasOwnProperty):
3215 (KJS::ObjectImp::getDirectLocation):
3216 (KJS::ObjectImp::getPropertySlot):
3217 (KJS::ObjectImp::getOwnPropertySlot):
3218 * kjs/object_wrapper.h: Added.
3220 (KJS::Object::Object):
3221 (KJS::Object::operator ObjectImp *):
3222 * kjs/property_map.cpp:
3223 (KJS::PropertyMap::getLocation):
3224 * kjs/property_map.h:
3225 * kjs/property_slot.cpp: Added.
3226 (KJS::PropertySlot::undefinedGetter):
3227 * kjs/property_slot.h: Added.
3228 (KJS::PropertySlot::isSet):
3229 (KJS::PropertySlot::getValue):
3230 (KJS::PropertySlot::setValueSlot):
3231 (KJS::PropertySlot::setStaticEntry):
3232 (KJS::PropertySlot::setCustom):
3233 (KJS::PropertySlot::setCustomIndex):
3234 (KJS::PropertySlot::setUndefined):
3235 (KJS::PropertySlot::slotBase):
3236 (KJS::PropertySlot::staticEntry):
3237 (KJS::PropertySlot::index):
3238 (KJS::PropertySlot::):
3240 * kjs/protected_object.h: Added.
3241 (KJS::ProtectedObject::ProtectedObject):
3242 (KJS::ProtectedObject::~ProtectedObject):
3243 (KJS::ProtectedObject::operator=):
3244 (KJS::ProtectedReference::ProtectedReference):
3245 (KJS::ProtectedReference::~ProtectedReference):
3246 (KJS::ProtectedReference::operator=):
3248 * kjs/reference_list.cpp:
3249 * kjs/regexp_object.cpp:
3250 (RegExpObjectImp::backrefGetter):
3251 (RegExpObjectImp::getOwnPropertySlot):
3252 * kjs/regexp_object.h:
3253 * kjs/string_object.cpp:
3254 (StringInstanceImp::lengthGetter):
3255 (StringInstanceImp::indexGetter):
3256 (StringInstanceImp::getOwnPropertySlot):
3257 (StringPrototypeImp::getOwnPropertySlot):
3258 * kjs/string_object.h:
3260 2005-08-05 Adele Peterson <adele@apple.com>
3264 * JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
3266 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3268 -fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs
3269 after clicking on Hangman applet
3274 (KJS::ObjectImp::hasProperty): added check for null prototype.
3276 FIXME: The long-term plan is to make runtime objects use JS Null()
3277 instead of null pointers, which will allow us to eliminate null
3278 checks, improving performance.
3280 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3282 Fix by darin, reviewed by me.
3284 - rolled in fix for: <rdar://problem/4161606> JavaScript regular
3285 expressions with certain ranges of Unicode characters cause a crash
3289 * layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
3290 * layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
3293 (compile_branch): added checks for characters > 255
3295 2005-08-04 Maciej Stachowiak <mjs@apple.com>
3297 - updated expected test results now that we no longer exlude the
3298 date tests (apparently this was overlooked)
3300 * tests/mozilla/expected.html:
3302 2005-07-31 Darin Adler <darin@apple.com>
3306 - remove uses of Mac-OS-X-specific MAX macro
3307 - remove one of the many excess "APPLE_CHANGES" ifdefs
3309 * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
3310 * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
3312 (KJS::UChar::toLower): Take out non-ICU code path.
3313 (KJS::UChar::toUpper): Ditto.
3314 (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
3316 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3318 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4147
3319 Array.toString() and toLocaleString() improvements from KDE KJS
3320 (rolled in KDE changes)
3324 * layout-tests/fast/js/toString-overrides-expected.txt: Added.
3325 * layout-tests/fast/js/toString-overrides.html: Added.
3327 * kjs/array_object.cpp:
3328 (ArrayProtoFuncImp::call):
3330 2005-07-27 Maciej Stachowiak <mjs@apple.com>
3332 Changes by Michael Kahl, reviewed by me.
3334 - fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
3336 * JavaScriptCore.xcodeproj/project.pbxproj:
3338 (KJS::AttachedInterpreter::AttachedInterpreter):
3339 (KJS::AttachedInterpreter::~AttachedInterpreter):
3340 (Debugger::~Debugger):
3343 (Debugger::sourceParsed):
3346 (KJS::FunctionImp::call):
3347 (KJS::GlobalFuncImp::call):
3348 * kjs/function_object.cpp:
3349 (FunctionObjectImp::construct):
3353 (InterpreterImp::evaluate):
3355 (KJS::InterpreterImp::setDebugger):
3356 * kjs/interpreter.cpp:
3357 * kjs/interpreter.h:
3358 (KJS::Interpreter::imp):
3361 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3363 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3381
3364 Date.prototype.setDate() incorrect for values >=128
3368 * layout-tests/fast/js/date-big-setdate-expected.txt: Added.
3369 * layout-tests/fast/js/date-big-setdate.html: Added.
3373 * kjs/date_object.cpp:
3374 (DateProtoFuncImp::call):
3376 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3378 -rolled in patch by Carsten Guenther <cguenther@gmail.com>
3379 for http://bugzilla.opendarwin.org/show_bug.cgi?id=3759
3380 Date object enhancements
3384 * layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
3385 * layout-tests/fast/js/date-preserve-milliseconds.html: Added.
3389 * kjs/date_object.cpp:
3391 (DateProtoFuncImp::call):
3392 (DateObjectImp::construct):
3393 (DateObjectFuncImp::call):
3395 * kjs/date_object.h:
3396 * tests/mozilla/expected.html:
3398 2005-07-26 Justin Garcia <justin.garcia@apple.com>
3400 Added a forward declaration to fix gcc4 build error
3404 2005-07-25 Geoffrey Garen <ggaren@apple.com>
3405 - fixed mistake in my last checkin -- the expected results included
3406 results from a patch that hasn't landed yet.
3408 * tests/mozilla/expected.html:
3410 2005-07-25 Maciej Stachowiak <mjs@apple.com>
3412 - fix mistake in last change that leads to assertion failure in the Development build
3415 (KJS::lookupGetOwnValue):
3417 2005-07-24 Maciej Stachowiak <mjs@apple.com>
3421 - http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
3422 (change JavaScript property access to avoid double lookup)
3424 - 10% speedup on JavaScript iBench
3425 - 5% speedup on 24fun BenchJS benchmark
3427 Changed all get methods to getOwnProperty - they are no longer
3428 responsible for prototype lookup, and determine if the property
3429 was found as a side efect.
3431 get() is now a nonvirtual ObjectImp method which calls the virtual
3432 getOwnProperty and walks the prototype chain. A few selected
3433 methods were inlined.
3435 Changed ResolveNode::evaluate plus some other places to use
3436 getProperty which does get() and hasProperty() in one lookup.
3438 Also miscellaneous code cleanup.
3440 * bindings/objc/objc_runtime.h:
3441 * bindings/objc/objc_runtime.mm:
3442 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3443 (ObjcFallbackObjectImp::getOwnProperty):
3444 * bindings/runtime_array.cpp:
3445 (RuntimeArrayImp::RuntimeArrayImp):
3446 (RuntimeArrayImp::getOwnProperty):
3447 * bindings/runtime_array.h:
3448 * bindings/runtime_method.cpp:
3449 (RuntimeMethodImp::getOwnProperty):
3450 * bindings/runtime_method.h:
3451 * bindings/runtime_object.cpp:
3452 (RuntimeObjectImp::getOwnProperty):
3453 * bindings/runtime_object.h:
3454 * kjs/array_instance.h:
3455 * kjs/array_object.cpp:
3456 (ArrayInstanceImp::getOwnProperty):
3457 (ArrayPrototypeImp::getOwnProperty):
3458 (ArrayProtoFuncImp::call):
3459 * kjs/array_object.h:
3460 * kjs/date_object.cpp:
3461 (DatePrototypeImp::getOwnProperty):
3462 * kjs/date_object.h:
3464 (KJS::FunctionImp::getOwnProperty):
3465 (KJS::ArgumentsImp::getOwnProperty):
3466 (KJS::ActivationImp::getOwnProperty):
3469 (KJS::lookupGetOwnProperty):
3470 (KJS::lookupGetOwnFunction):
3471 (KJS::lookupGetOwnValue):
3472 * kjs/math_object.cpp:
3473 (MathObjectImp::getOwnProperty):
3474 (MathObjectImp::getValueProperty):
3475 * kjs/math_object.h:
3477 (ResolveNode::evaluate):
3478 * kjs/number_object.cpp:
3479 (NumberObjectImp::getOwnProperty):
3480 * kjs/number_object.h:
3482 (KJS::ObjectImp::get):
3483 (KJS::ObjectImp::getOwnProperty):
3484 (KJS::ObjectImp::getProperty):
3486 (KJS::ObjectImp::getProperty):
3487 (KJS::ObjectImp::getOwnProperty):
3488 * kjs/object_object.cpp:
3489 (ObjectProtoFuncImp::call):
3490 * kjs/regexp_object.cpp: