Bug #: 5179
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2005-09-29  Eric Seidel  <eseidel@apple.com>
2         Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
3
4         Reviewed by mjs.
5
6         * JavaScriptCore.xcodeproj/project.pbxproj:
7         Build fix for JSC+SVG after 5161.
8         http://bugzilla.opendarwin.org/show_bug.cgi?id=5179
9
10 2005-09-28  Geoffrey Garen  <ggaren@apple.com>
11
12         - Fixed <rdar://problem/4275206> Denver Regression: Seed: Past Editions of Opinions display 
13           "NAN/Undefined" for www.washingtonpost.com
14           
15         Reviewed by darin.
16
17         * kjs/date_object.cpp:
18         (KJS::KRFCDate_parseDate): If the timezone isn't specified, rather than returning
19         invalidDate, substitute the local timezone. This matches the behavior of FF/IE.
20
21 2005-09-28  Maciej Stachowiak  <mjs@apple.com>
22
23         Patch from George Staikos, reviewed by me.
24
25         - fixed some compile issues on Linux
26         
27         * kjs/property_slot.h:
28         * kjs/simple_number.h:
29
30 2005-09-27  Maciej Stachowiak  <mjs@apple.com>
31
32         Reviewed by Eric.
33
34         - move HashMap/HashSet code down to JavaScriptCore
35         http://bugzilla.opendarwin.org/show_bug.cgi?id=5161
36         
37         * JavaScriptCore.xcodeproj/project.pbxproj:
38         * kjs/internal.cpp:
39         (KJS::interpreterMap): Function that fetches the interpreter map on demand. 
40         (KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
41         class with an appropriate HashMap.
42         (KJS::InterpreterImp::clear): ditto
43         (KJS::InterpreterImp::interpreterWithGlobalObject): ditto
44         * kjs/interpreter_map.cpp: Removed.
45         * kjs/interpreter_map.h: Removed.
46
47         The HashMap/HashSet code (copied and slightly tweaked from WebCore)
48         
49         * kxmlcore/HashFunctions.h: Added.
50         (KXMLCore::4):
51         (KXMLCore::8):
52         (KXMLCore::):
53         (KXMLCore::PointerHash::hash):
54         (KXMLCore::PointerHash::equal):
55         * kxmlcore/HashMap.h: Added.
56         (KXMLCore::extractFirst):
57         (KXMLCore::HashMap::HashMap):
58         (KXMLCore::::size):
59         (KXMLCore::::capacity):
60         (KXMLCore::::isEmpty):
61         (KXMLCore::::begin):
62         (KXMLCore::::end):
63         (KXMLCore::::find):
64         (KXMLCore::::contains):
65         (KXMLCore::::set):
66         (KXMLCore::::get):
67         (KXMLCore::::remove):
68         (KXMLCore::::clear):
69         (KXMLCore::deleteAllValues):
70         * kxmlcore/HashMapPtrSpec.h: Added.
71         (KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
72         (KXMLCore::PointerHashIteratorAdapter::operator*):
73         (KXMLCore::PointerHashIteratorAdapter::operator->):
74         (KXMLCore::PointerHashIteratorAdapter::operator++):
75         (KXMLCore::PointerHashIteratorAdapter::operator==):
76         (KXMLCore::PointerHashIteratorAdapter::operator!=):
77         (KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
78         (KXMLCore::PointerHashConstIteratorAdapter::operator*):
79         (KXMLCore::PointerHashConstIteratorAdapter::operator->):
80         (KXMLCore::PointerHashConstIteratorAdapter::operator++):
81         (KXMLCore::PointerHashConstIteratorAdapter::operator==):
82         (KXMLCore::PointerHashConstIteratorAdapter::operator!=):
83         (KXMLCore::):
84         * kxmlcore/HashSet.h: Added.
85         (KXMLCore::identityExtract):
86         (KXMLCore::convertAdapter):
87         (KXMLCore::HashSet::HashSet):
88         (KXMLCore::::size):
89         (KXMLCore::::capacity):
90         (KXMLCore::::isEmpty):
91         (KXMLCore::::begin):
92         (KXMLCore::::end):
93         (KXMLCore::::find):
94         (KXMLCore::::contains):
95         (KXMLCore::::insert):
96         (KXMLCore::::remove):
97         (KXMLCore::::clear):
98         * kxmlcore/HashTable.cpp: Added.
99         (KXMLCore::HashTableStats::~HashTableStats):
100         (KXMLCore::HashTableStats::recordCollisionAtCount):
101         * kxmlcore/HashTable.h: Added.
102         (KXMLCore::HashTableIterator::skipEmptyBuckets):
103         (KXMLCore::HashTableIterator::HashTableIterator):
104         (KXMLCore::HashTableIterator::operator*):
105         (KXMLCore::HashTableIterator::operator->):
106         (KXMLCore::HashTableIterator::operator++):
107         (KXMLCore::HashTableIterator::operator==):
108         (KXMLCore::HashTableIterator::operator!=):
109         (KXMLCore::HashTableConstIterator::HashTableConstIterator):
110         (KXMLCore::HashTableConstIterator::operator*):
111         (KXMLCore::HashTableConstIterator::operator->):
112         (KXMLCore::HashTableConstIterator::skipEmptyBuckets):
113         (KXMLCore::HashTableConstIterator::operator++):
114         (KXMLCore::HashTableConstIterator::operator==):
115         (KXMLCore::HashTableConstIterator::operator!=):
116         (KXMLCore::HashTable::HashTable):
117         (KXMLCore::HashTable::~HashTable):
118         (KXMLCore::HashTable::begin):
119         (KXMLCore::HashTable::end):
120         (KXMLCore::HashTable::size):
121         (KXMLCore::HashTable::capacity):
122         (KXMLCore::HashTable::insert):
123         (KXMLCore::HashTable::isEmptyBucket):
124         (KXMLCore::HashTable::isDeletedBucket):
125         (KXMLCore::HashTable::isEmptyOrDeletedBucket):
126         (KXMLCore::HashTable::hash):
127         (KXMLCore::HashTable::equal):
128         (KXMLCore::HashTable::identityConvert):
129         (KXMLCore::HashTable::extractKey):
130         (KXMLCore::HashTable::lookup):
131         (KXMLCore::HashTable::shouldExpand):
132         (KXMLCore::HashTable::mustRehashInPlace):
133         (KXMLCore::HashTable::shouldShrink):
134         (KXMLCore::HashTable::shrink):
135         (KXMLCore::HashTable::clearBucket):
136         (KXMLCore::HashTable::deleteBucket):
137         (KXMLCore::HashTable::makeLookupResult):
138         (KXMLCore::HashTable::makeIterator):
139         (KXMLCore::HashTable::makeConstIterator):
140         (KXMLCore::::lookup):
141         (KXMLCore::::insert):
142         (KXMLCore::::reinsert):
143         (KXMLCore::::find):
144         (KXMLCore::::contains):
145         (KXMLCore::::remove):
146         (KXMLCore::::allocateTable):
147         (KXMLCore::::expand):
148         (KXMLCore::::rehash):
149         (KXMLCore::::clear):
150         (KXMLCore::::HashTable):
151         (KXMLCore::::swap):
152         (KXMLCore::::operator):
153         (KXMLCore::::checkTableConsistency):
154         (KXMLCore::::checkTableConsistencyExceptSize):
155         * kxmlcore/HashTraits.h: Added.
156         (KXMLCore::HashTraits::emptyValue):
157         (KXMLCore::):
158         (KXMLCore::PairHashTraits::emptyValue):
159         (KXMLCore::PairHashTraits::deletedValue):
160
161 2005-09-27  Darin Adler  <darin@apple.com>
162
163         Reviewed by Maciej.
164
165         - update grammar to fix conflicts; fixes one of our test cases
166           because it resolves the relationship between function expressions
167           and declarations in the way required by the ECMA specification
168
169         * kjs/grammar.y: Added lots of new grammar rules so we have no conflicts.
170         A new set of rules for "no bracket or function at start of expression" and
171         another set of rules for "no in anywhere in expression". Also simplified the
172         handling of try to use only a single node and used operator precedence to
173         get rid of the conflict in handling of if and else. Also used a macro to
174         streamline the handling of automatic semicolons and changed parenthesis
175         handling to use a virtual function.
176
177         * kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement.
178         (KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead
179         of using a special node for each.
180         * kjs/nodes.cpp:
181         (Node::createErrorCompletion): Added. Used instead of throwError when creating errors
182         that should not be in a completion rather than an ExecState.
183         (Node::throwUndefinedVariableError): Added. Sets source location unlike the call it
184         replaces.
185         (Node::nodeInsideAllParens): Added.
186         (GroupNode::nodeInsideAllParens): Added.
187         (StatListNode::execute): Removed code to move exceptions into completion objects;
188         that's now done solely by the KJS_CHECKEXCEPTION macro.
189         (TryNode::execute): Include execution of catch and finally here rather than using
190         separate nodes.
191         (FuncDeclNode::execute): Moved here, no longer inline.
192         * kjs/nodes2string.cpp:
193         (TryNode::streamTo): Updated for change.
194         (FuncDeclNode::streamTo): Ditto.
195         (FuncExprNode::streamTo): Ditto.
196
197         * kjs/kjs-test: Removed. Was part of "make check".
198         * kjs/kjs-test.chk: Ditto.
199         * kjs/test.js: Ditto.
200
201         * tests/mozilla/expected.html: Updated because one more test succeeds.
202
203 2005-09-27  Adele Peterson  <adele@apple.com>
204
205         Reviewed by Maciej.
206
207         Changed ints to size_t where appropriate.
208
209         * kjs/collector.cpp:
210         (KJS::Collector::allocate):
211         (KJS::Collector::markStackObjectsConservatively):
212         (KJS::Collector::collect):
213         (KJS::Collector::size):
214         (KJS::Collector::numInterpreters):
215         (KJS::Collector::numGCNotAllowedObjects):
216         (KJS::Collector::numReferencedObjects):
217         * kjs/collector.h:
218
219 2005-09-27  Eric Seidel  <eseidel@apple.com>
220
221         Reviewed by kevin.
222
223         * JavaScriptCore.xcodeproj/project.pbxproj: fix after malloc changes.
224
225 2005-09-27  Eric Seidel  <eseidel@apple.com>
226
227         Reviewed by mjs.
228
229         * kjs/nodes.cpp:
230         (FuncExprNode::evaluate): Now sets .constructor properly.
231         Test cases added to WebCore/layout-tests.
232         http://bugzilla.opendarwin.org/show_bug.cgi?id=3537
233
234 2005-09-26  Maciej Stachowiak  <mjs@apple.com>
235
236         Reviewed by John.
237
238         - replace dlmalloc with tcmalloc
239         http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
240
241         I also moved SharedPtr and the assertion code from WebCore into a
242         new kxmlcore directory.
243         
244         * JavaScriptCore.xcodeproj/project.pbxproj:
245         * kjs/collector.cpp:
246         (KJS::Collector::allocate):
247         (KJS::Collector::collect):
248         * kjs/config.h:
249         * kjs/fast_malloc.cpp: Removed.
250         * kjs/fast_malloc.h: Removed.
251         * kjs/function.cpp:
252         * kjs/function.h:
253         * kjs/function_object.cpp:
254         * kjs/identifier.cpp:
255         (KJS::Identifier::add):
256         * kjs/internal.cpp:
257         * kjs/internal.h:
258         * kjs/nodes.h:
259         * kjs/nodes2string.cpp:
260         * kjs/property_map.cpp:
261         (KJS::PropertyMap::~PropertyMap):
262         (KJS::PropertyMap::rehash):
263         * kjs/scope_chain.h:
264         * kjs/shared_ptr.h: Removed.
265         * kjs/string_object.cpp:
266         (StringObjectFuncImp::callAsFunction):
267         * kjs/ustring.cpp:
268         (KJS::UString::Rep::createCopying):
269         (KJS::UString::Rep::destroy):
270         (KJS::UString::expandCapacity):
271         (KJS::UString::expandPreCapacity):
272         (KJS::UString::UString):
273         (KJS::UString::spliceSubstringsWithSeparators):
274         (KJS::UString::append):
275         (KJS::UString::operator=):
276         (KJS::UString::detach):
277         * kjs/ustring.h:
278         * kxmlcore/Assertions.h: Added.
279         * kxmlcore/Assertions.mm: Added.
280         * kxmlcore/FastMalloc.cpp: Added.
281         (KXMLCore::LgFloor):
282         (KXMLCore::SizeClass):
283         (KXMLCore::ByteSizeForClass):
284         (KXMLCore::InitSizeClasses):
285         (KXMLCore::MetaDataAlloc):
286         (KXMLCore::PageHeapAllocator::Init):
287         (KXMLCore::PageHeapAllocator::New):
288         (KXMLCore::PageHeapAllocator::Delete):
289         (KXMLCore::PageHeapAllocator::inuse):
290         (KXMLCore::pages):
291         (KXMLCore::AllocationSize):
292         (KXMLCore::Event):
293         (KXMLCore::NewSpan):
294         (KXMLCore::DeleteSpan):
295         (KXMLCore::DLL_Init):
296         (KXMLCore::DLL_Remove):
297         (KXMLCore::DLL_IsEmpty):
298         (KXMLCore::DLL_Length):
299         (KXMLCore::DLL_Print):
300         (KXMLCore::DLL_Prepend):
301         (KXMLCore::DLL_InsertOrdered):
302         (KXMLCore::):
303         (KXMLCore::TCMalloc_PageHeap::GetDescriptor):
304         (KXMLCore::TCMalloc_PageHeap::SystemBytes):
305         (KXMLCore::TCMalloc_PageHeap::FreeBytes):
306         (KXMLCore::TCMalloc_PageHeap::RecordSpan):
307         (KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
308         (KXMLCore::TCMalloc_PageHeap::New):
309         (KXMLCore::TCMalloc_PageHeap::Split):
310         (KXMLCore::TCMalloc_PageHeap::Carve):
311         (KXMLCore::TCMalloc_PageHeap::Delete):
312         (KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
313         (KXMLCore::TCMalloc_PageHeap::Dump):
314         (KXMLCore::TCMalloc_PageHeap::GrowHeap):
315         (KXMLCore::TCMalloc_PageHeap::Check):
316         (KXMLCore::TCMalloc_PageHeap::CheckList):
317         (KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
318         (KXMLCore::TCMalloc_ThreadCache_FreeList::length):
319         (KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
320         (KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
321         (KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
322         (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
323         (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
324         (KXMLCore::TCMalloc_ThreadCache::freelist_length):
325         (KXMLCore::TCMalloc_ThreadCache::Size):
326         (KXMLCore::TCMalloc_Central_FreeList::length):
327         (KXMLCore::TCMalloc_Central_FreeList::Init):
328         (KXMLCore::TCMalloc_Central_FreeList::Insert):
329         (KXMLCore::TCMalloc_Central_FreeList::Remove):
330         (KXMLCore::TCMalloc_Central_FreeList::Populate):
331         (KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
332         (KXMLCore::TCMalloc_ThreadCache::Init):
333         (KXMLCore::TCMalloc_ThreadCache::Cleanup):
334         (KXMLCore::TCMalloc_ThreadCache::Allocate):
335         (KXMLCore::TCMalloc_ThreadCache::Deallocate):
336         (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
337         (KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
338         (KXMLCore::TCMalloc_ThreadCache::Scavenge):
339         (KXMLCore::TCMalloc_ThreadCache::GetCache):
340         (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
341         (KXMLCore::TCMalloc_ThreadCache::PickNextSample):
342         (KXMLCore::TCMalloc_ThreadCache::InitModule):
343         (KXMLCore::TCMalloc_ThreadCache::InitTSD):
344         (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
345         (KXMLCore::TCMalloc_ThreadCache::DeleteCache):
346         (KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
347         (KXMLCore::TCMalloc_ThreadCache::Print):
348         (KXMLCore::ExtractStats):
349         (KXMLCore::DumpStats):
350         (KXMLCore::PrintStats):
351         (KXMLCore::DumpStackTraces):
352         (KXMLCore::TCMallocImplementation::GetStats):
353         (KXMLCore::TCMallocImplementation::ReadStackTraces):
354         (KXMLCore::TCMallocImplementation::GetNumericProperty):
355         (KXMLCore::TCMallocImplementation::SetNumericProperty):
356         (KXMLCore::DoSampledAllocation):
357         (KXMLCore::do_malloc):
358         (KXMLCore::do_free):
359         (KXMLCore::do_memalign):
360         (KXMLCore::TCMallocGuard::TCMallocGuard):
361         (KXMLCore::TCMallocGuard::~TCMallocGuard):
362         (KXMLCore::malloc):
363         (KXMLCore::free):
364         (KXMLCore::calloc):
365         (KXMLCore::cfree):
366         (KXMLCore::realloc):
367         (KXMLCore::memalign):
368         (KXMLCore::posix_memalign):
369         (KXMLCore::valloc):
370         (KXMLCore::pvalloc):
371         (KXMLCore::malloc_stats):
372         (KXMLCore::mallopt):
373         (KXMLCore::mallinfo):
374         * kxmlcore/FastMalloc.h: Added.
375         (KXMLCore::FastAllocated::operator new):
376         (KXMLCore::FastAllocated::operator delete):
377         (KXMLCore::FastAllocated::operator new[]):
378         (KXMLCore::FastAllocated::operator delete[]):
379         * kxmlcore/SharedPtr.h: Added.
380         (KXMLCore::SharedPtr::SharedPtr):
381         (KXMLCore::SharedPtr::~SharedPtr):
382         (KXMLCore::SharedPtr::isNull):
383         (KXMLCore::SharedPtr::notNull):
384         (KXMLCore::SharedPtr::reset):
385         (KXMLCore::SharedPtr::get):
386         (KXMLCore::SharedPtr::operator*):
387         (KXMLCore::SharedPtr::operator->):
388         (KXMLCore::SharedPtr::operator!):
389         (KXMLCore::SharedPtr::operator bool):
390         (KXMLCore::::operator):
391         (KXMLCore::operator==):
392         (KXMLCore::operator!=):
393         (KXMLCore::static_pointer_cast):
394         (KXMLCore::const_pointer_cast):
395         * kxmlcore/TCPageMap.h: Added.
396         (TCMalloc_PageMap1::TCMalloc_PageMap1):
397         (TCMalloc_PageMap1::Ensure):
398         (TCMalloc_PageMap1::get):
399         (TCMalloc_PageMap1::set):
400         (TCMalloc_PageMap2::TCMalloc_PageMap2):
401         (TCMalloc_PageMap2::get):
402         (TCMalloc_PageMap2::set):
403         (TCMalloc_PageMap2::Ensure):
404         (TCMalloc_PageMap3::NewNode):
405         (TCMalloc_PageMap3::TCMalloc_PageMap3):
406         (TCMalloc_PageMap3::get):
407         (TCMalloc_PageMap3::set):
408         (TCMalloc_PageMap3::Ensure):
409         * kxmlcore/TCSpinLock.h: Added.
410         (TCMalloc_SpinLock::Init):
411         (TCMalloc_SpinLock::Finalize):
412         (TCMalloc_SpinLock::Lock):
413         (TCMalloc_SpinLock::Unlock):
414         (TCMalloc_SlowLock):
415         (TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
416         (TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
417         * kxmlcore/TCSystemAlloc.cpp: Added.
418         (TrySbrk):
419         (TryMmap):
420         (TryDevMem):
421         (TCMalloc_SystemAlloc):
422         * kxmlcore/TCSystemAlloc.h: Added.
423
424 2005-09-23  Maciej Stachowiak  <mjs@apple.com>
425
426         Reviewed by Darin.
427
428         <rdar://problem/4260479> Finish deploying PropertySlot in the interpreter
429         http://bugzilla.opendarwin.org/show_bug.cgi?id=5112
430         
431         Convert postfix, prefix, delete, prefix, and for..in expressions to use
432         PropertySlot-based lookup instead of evaluateReference.
433
434         3% speedup on JS iBench.
435
436         Fixed two of the JS tests:
437         * tests/mozilla/expected.html:
438
439         * kjs/grammar.y:
440         * kjs/nodes.cpp:
441         (PostfixResolveNode::evaluate):
442         (PostfixBracketNode::evaluate):
443         (PostfixDotNode::evaluate):
444         (DeleteResolveNode::evaluate):
445         (DeleteBracketNode::evaluate):
446         (DeleteDotNode::evaluate):
447         (DeleteValueNode::evaluate):
448         (typeStringForValue):
449         (TypeOfResolveNode::evaluate):
450         (TypeOfValueNode::evaluate):
451         (PrefixResolveNode::evaluate):
452         (PrefixBracketNode::evaluate):
453         (PrefixDotNode::evaluate):
454         (ForInNode::execute):
455         * kjs/nodes.h:
456         (KJS::PostfixResolveNode::PostfixResolveNode):
457         (KJS::PostfixBracketNode::PostfixBracketNode):
458         (KJS::PostfixDotNode::PostfixDotNode):
459         (KJS::DeleteResolveNode::DeleteResolveNode):
460         (KJS::DeleteBracketNode::DeleteBracketNode):
461         (KJS::DeleteDotNode::DeleteDotNode):
462         (KJS::DeleteValueNode::DeleteValueNode):
463         (KJS::TypeOfResolveNode::TypeOfResolveNode):
464         (KJS::TypeOfValueNode::TypeOfValueNode):
465         (KJS::PrefixResolveNode::PrefixResolveNode):
466         (KJS::PrefixBracketNode::PrefixBracketNode):
467         (KJS::PrefixDotNode::PrefixDotNode):
468         * kjs/nodes2string.cpp:
469         (PostfixResolveNode::streamTo):
470         (PostfixBracketNode::streamTo):
471         (PostfixDotNode::streamTo):
472         (DeleteResolveNode::streamTo):
473         (DeleteBracketNode::streamTo):
474         (DeleteDotNode::streamTo):
475         (DeleteValueNode::streamTo):
476         (TypeOfValueNode::streamTo):
477         (TypeOfResolveNode::streamTo):
478         (PrefixResolveNode::streamTo):
479         (PrefixBracketNode::streamTo):
480         (PrefixDotNode::streamTo):
481         * kjs/reference.cpp:
482         (KJS::Reference::Reference):
483         (KJS::Reference::getPropertyName):
484         (KJS::Reference::getValue):
485         (KJS::Reference::deleteValue):
486         * kjs/reference.h:
487
488 2005-09-23  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
489
490         Reviewed and landed by Darin.
491
492         - a Windows-specific file
493
494         * os-win32/stdint.h: Added. We plan to remove dependency on the <stdint.h> types,
495         and if we do so, we will remove this file.
496
497 2005-09-22  Geoffrey Garen  <ggaren@apple.com>
498
499         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
500         Need to restore int/long changes to simple_number.h
501         
502         Reviewed by darin and mjs.
503
504         * kjs/simple_number.h: changed enums to indenpendent constants to clarify types
505         (KJS::isNegativeZero): changed to static function - no reason to export
506         (KJS::SimpleNumber::rightShiftSignExtended): new function for clarity
507         (KJS::SimpleNumber::make): specified cast as reinterpret_cast
508         (KJS::SimpleNumber::is): changed to use uintptr_t for portability
509         (KJS::SimpleNumber::value): changed to use uintptr_t and rightShiftSignExtended
510         (KJS::SimpleNumber::fits): inverted tests - probably only a performance win for double
511         (KJS::SimpleNumber::integerFits): ditto
512
513 2005-09-20  Maciej Stachowiak  <mjs@apple.com>
514
515         Reviewed by Geoff and partly by Darin.
516
517         - fixed http://bugzilla.opendarwin.org/post_bug.cgi
518         (Reduce conflicts in JavaScriptCore grammar)
519
520         This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
521         9 shift/reduce and 45 reduce/reduce.
522
523         * kjs/grammar.y:
524         * kjs/grammar_types.h: Removed.
525         * kjs/lexer.cpp:
526         * kjs/nodes.h:
527         (KJS::Node::isGroupNode):
528         (KJS::Node::isLocation):
529         (KJS::Node::isResolveNode):
530         (KJS::Node::isBracketAccessorNode):
531         (KJS::Node::isDotAccessorNode):
532         (KJS::ResolveNode::isLocation):
533         (KJS::ResolveNode::isResolveNode):
534         (KJS::ResolveNode::identifier):
535         (KJS::GroupNode::isGroupNode):
536         (KJS::GroupNode::leafNode):
537         (KJS::BracketAccessorNode::isLocation):
538         (KJS::BracketAccessorNode::isBracketAccessorNode):
539         (KJS::BracketAccessorNode::base):
540         (KJS::BracketAccessorNode::subscript):
541         (KJS::DotAccessorNode::isLocation):
542         (KJS::DotAccessorNode::isDotAccessorNode):
543         (KJS::DotAccessorNode::base):
544         (KJS::DotAccessorNode::identifier):
545         (KJS::FuncExprNode::FuncExprNode):
546         (KJS::FuncExprNode::identifier):
547         (KJS::FuncDeclNode::FuncDeclNode):
548         (KJS::FuncDeclNode::execute):
549
550 2005-09-20  Geoffrey Garen  <ggaren@apple.com>
551
552         - Oops. The 4263434 change was only appropriate on the branch. Rolling out.
553         
554         Reviewed by eric.
555         
556         * kjs/internal.cpp:
557         (KJS::InterpreterImp::mark):
558
559 2005-09-20  Geoffrey Garen  <ggaren@apple.com>
560
561         - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
562           kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
563           the installer)
564           
565         Added InterpreterLocks in some places in the bindings we missed before.
566         
567         Reviewed by john.
568
569         * bindings/runtime_root.cpp:
570         (KJS::Bindings::addNativeReference):
571         (KJS::Bindings::removeNativeReference):
572         (RootObject::removeAllNativeReferences):
573         * bindings/runtime_root.h:
574         (KJS::Bindings::RootObject::~RootObject):
575         (KJS::Bindings::RootObject::setRootObjectImp):
576
577 2005-09-20  Geoffrey Garen  <ggaren@apple.com>
578
579         - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
580           KJS::InterpreterImp::mark() crash
581           
582         Fix by mjs, review by me.
583
584         * kjs/internal.cpp:
585         (KJS::InterpreterImp::mark): Added a null check on globExec in case a
586         garbage collection occurs inside InterpreterImp::globalInit (called
587         from InterpreterImp::InterpreterImp), at which point globExec has not yet been initialized.
588
589 2005-09-20  Geoffrey Garen  <ggaren@apple.com>
590
591         - Rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4892
592           Date constructor has problems with months larger than 11
593
594         Test cases added:
595
596         * layout-tests/fast/js/date-big-constructor-expected.txt: Added.
597         * layout-tests/fast/js/date-big-constructor.html: Added.
598
599         Reviewed by darin.
600
601         * kjs/date_object.cpp:
602         (KJS::fillStructuresUsingDateArgs):
603         (KJS::makeTime):
604
605 2005-09-19  Geoffrey Garen  <ggaren@apple.com>
606
607         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5028
608           9 layout tests fail following the change from long to int
609           
610         - Rolled out changes to simple_number.h, and added fits(long long) 
611           and SimpleNumber::fits(unsigned long long) to the old system.
612         
613         Reviewed by mjs.
614
615         * kjs/simple_number.h:
616         (KJS::SimpleNumber::):
617         (KJS::SimpleNumber::value):
618         (KJS::SimpleNumber::fits):
619         (KJS::SimpleNumber::integerFits):
620         (KJS::SimpleNumber::make):
621
622 2005-09-14  Maciej Stachowiak  <mjs@apple.com>
623
624         Reviewed by Geoff.
625
626         - fixed <rdar://problem/4214783> REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer)
627
628         Make sure to lock using the InterpreterLock class in all places that need it
629         (including anything that uses the collector, the parser, the protect count hash table,
630         and anything that allocates via fast_malloc).
631
632         Also added assertions to ensure that the locking rules are followed for the relevant
633         resources.
634
635         * Makefile.am:
636         * bindings/NP_jsobject.cpp:
637         (identifierFromNPIdentifier):
638         (_NPN_Invoke):
639         (_NPN_Evaluate):
640         (_NPN_GetProperty):
641         (_NPN_SetProperty):
642         (_NPN_RemoveProperty):
643         (_NPN_HasProperty):
644         (_NPN_HasMethod):
645         (_NPN_SetException):
646         * bindings/jni/jni_jsobject.cpp:
647         (JSObject::call):
648         (JSObject::eval):
649         (JSObject::getMember):
650         (JSObject::setMember):
651         (JSObject::removeMember):
652         (JSObject::getSlot):
653         (JSObject::setSlot):
654         (JSObject::toString):
655         (JSObject::convertJObjectToValue):
656         * bindings/objc/WebScriptObject.mm:
657         (-[WebScriptObject callWebScriptMethod:withArguments:]):
658         (-[WebScriptObject evaluateWebScript:]):
659         (-[WebScriptObject setValue:forKey:]):
660         (-[WebScriptObject valueForKey:]):
661         (-[WebScriptObject removeWebScriptKey:]):
662         (-[WebScriptObject stringRepresentation]):
663         (-[WebScriptObject webScriptValueAtIndex:]):
664         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
665         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
666         * bindings/runtime.cpp:
667         (Instance::createRuntimeObject):
668         * bindings/runtime_root.h:
669         * bindings/testbindings.cpp:
670         (main):
671         * bindings/testbindings.mm:
672         (main):
673         * kjs/fast_malloc.cpp:
674         (KJS::kjs_fast_malloc):
675         (KJS::kjs_fast_calloc):
676         (KJS::kjs_fast_free):
677         (KJS::kjs_fast_realloc):
678         * kjs/fast_malloc.h:
679         * kjs/identifier.h:
680         * kjs/internal.cpp:
681         (InterpreterImp::InterpreterImp):
682         (InterpreterImp::clear):
683         (InterpreterImp::mark):
684         (InterpreterImp::checkSyntax):
685         (InterpreterImp::evaluate):
686         * kjs/internal.h:
687         (KJS::InterpreterImp::globalObject):
688         * kjs/interpreter.cpp:
689         (Interpreter::evaluate):
690         * kjs/interpreter.h:
691         (KJS::InterpreterLock::InterpreterLock):
692         (KJS::InterpreterLock::~InterpreterLock):
693         * kjs/nodes.h:
694         * kjs/protect.h:
695         (KJS::ProtectedValue::ProtectedValue):
696         (KJS::ProtectedValue::~ProtectedValue):
697         (KJS::ProtectedValue::operator=):
698         (KJS::ProtectedObject::ProtectedObject):
699         (KJS::ProtectedObject::~ProtectedObject):
700         (KJS::ProtectedObject::operator=):
701         (KJS::ProtectedReference::ProtectedReference):
702         (KJS::ProtectedReference::~ProtectedReference):
703         (KJS::ProtectedReference::operator=):
704         * kjs/protected_object.h:
705         * kjs/protected_values.cpp:
706         (KJS::ProtectedValues::getProtectCount):
707         (KJS::ProtectedValues::increaseProtectCount):
708         (KJS::ProtectedValues::decreaseProtectCount):
709         * kjs/string_object.cpp:
710         (StringObjectImp::StringObjectImp):
711         * kjs/testkjs.cpp:
712         (main):
713
714 2005-09-16  Adele Peterson  <adele@apple.com>
715
716         Change by Darin, reviewed by me and Maciej.
717
718         Fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=4547
719         use int instead of long for 32-bit (to prepare for LP64 compiling)
720
721         * bindings/c/c_class.h:
722         (KJS::Bindings::CClass::constructorAt):
723         (KJS::Bindings::CClass::numConstructors):
724         * bindings/c/c_runtime.h:
725         (KJS::Bindings::CMethod::numParameters):
726         * bindings/jni/jni_class.cpp:
727         (JavaClass::JavaClass):
728         * bindings/jni/jni_class.h:
729         (KJS::Bindings::JavaClass::constructorAt):
730         (KJS::Bindings::JavaClass::numConstructors):
731         * bindings/jni/jni_instance.cpp:
732         (JavaInstance::invokeMethod):
733         * bindings/jni/jni_jsobject.cpp:
734         (JSObject::convertJObjectToValue):
735         (JSObject::listFromJArray):
736         * bindings/jni/jni_runtime.cpp:
737         (JavaMethod::JavaMethod):
738         * bindings/jni/jni_runtime.h:
739         (KJS::Bindings::JavaConstructor::_commonCopy):
740         (KJS::Bindings::JavaConstructor::parameterAt):
741         (KJS::Bindings::JavaConstructor::numParameters):
742         (KJS::Bindings::JavaMethod::_commonCopy):
743         (KJS::Bindings::JavaMethod::parameterAt):
744         (KJS::Bindings::JavaMethod::numParameters):
745         * bindings/npapi.h:
746         * bindings/objc/WebScriptObject.mm:
747         (listFromNSArray):
748         * bindings/objc/objc_class.h:
749         (KJS::Bindings::ObjcClass::constructorAt):
750         (KJS::Bindings::ObjcClass::numConstructors):
751         * bindings/objc/objc_instance.h:
752         * bindings/objc/objc_runtime.h:
753         * bindings/objc/objc_runtime.mm:
754         (ObjcMethod::numParameters):
755         * bindings/runtime.h:
756         * kjs/identifier.h:
757         * kjs/internal.h:
758         * kjs/property_slot.h:
759         (KJS::PropertySlot::setCustomIndex):
760         (KJS::PropertySlot::index):
761         (KJS::PropertySlot::):
762         * kjs/regexp_object.cpp:
763         (RegExpObjectImp::backrefGetter):
764         (RegExpObjectImp::getOwnPropertySlot):
765         * kjs/simple_number.h:
766         (KJS::SimpleNumber::):
767         (KJS::SimpleNumber::value):
768         (KJS::SimpleNumber::fits):
769         (KJS::SimpleNumber::integerFits):
770         (KJS::SimpleNumber::make):
771         * kjs/string_object.cpp:
772         (substituteBackreferences):
773         * kjs/ustring.cpp:
774         (KJS::UString::from):
775         (KJS::UString::toUInt32):
776         (KJS::UString::find):
777         (KJS::UString::rfind):
778         * kjs/ustring.h:
779         * kjs/value.cpp:
780         (KJS::jsNumber):
781         * kjs/value.h:
782
783 2005-09-11  Eric Seidel  <eseidel@apple.com>
784
785         No review requested, build fix affects only SVG.
786
787         * JavaScriptCore.xcodeproj/project.pbxproj: Fixed JSC+SVG
788         Fixed JavaScriptCore+SVG after PCRE 6.1 merger.
789         http://bugzilla.opendarwin.org/show_bug.cgi?id=4932
790
791 2005-09-10  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
792
793         Reviewed and landed by Darin.
794
795         * Makefile.vc: Added.
796         * README-Win32.txt: Added.
797
798 2005-09-10  Darin Adler  <darin@apple.com>
799
800         - fixed compilation for WebCore (another try)
801
802         * kjs/simple_number.h: Added more "using" lines.
803
804 2005-09-10  Darin Adler  <darin@apple.com>
805
806         - fixed compilation for WebCore
807
808         * kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
809         standard C++ library headers.
810
811 2005-09-10  Darin Adler  <darin@apple.com>
812
813         Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
814
815         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
816           win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
817
818         * kjs/simple_number.h:
819         (KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
820         uses _fpclass and a case for other platforms that uses signbit.
821         (KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
822
823         * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
824
825         * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
826         recompile it.
827
828         - improved test engine
829
830         * tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
831         a plain-ASCII sort; now test 33 will be after test 5 in any given set of
832         numbered tests.
833
834 2005-09-08  Darin Adler  <darin@apple.com>
835
836         - fixed overloaded versions of throwError so that they substitute *all* 
837           expected parameters into the message string -- some versions used to
838           skip parameters, resulting in "%s" being printed in the error message.
839         
840         Reviewed by Geoff.
841
842         * kjs/nodes.h: Updated declarations to use "const &" and not to name parameters
843         * kjs/nodes.cpp: (Node::throwError): Updated to match above and add one missing
844         call to substitute.
845
846 2005-09-08  Darin Adler  <darin@apple.com>
847
848         Reviewed by Geoff.
849
850         - updated to PCRE 6.1
851
852         The original PCRE 6.1 sources are checked into the tree with the tag
853         "pcre-6-1" for reference. What we're checking in right now is the original
854         plus our changes to make it support UTF-16 and at least one other tweak
855         (vertical tab considered whitespace). Our work to get our changes was
856         done on "pcre-6-1-branch", with an anchor at "pcre-6-1-anchor" so you can
857         see the evolution of the UTF-16 changes.
858         
859         Note also that there was one small change made here that's not on the branch
860         in pcre_compile.c.
861
862         * Info.plist: Updated the part of the copyright message that's about PCRE.
863
864         * JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
865         removed obsolete ones.
866
867         * pcre/AUTHORS: Updated to PCRE 6.1. Includes credits for Apple's UTF-16
868         changes, but not the credits for Google's C++ wrapper, since we don't include that.
869         * pcre/COPYING: Updated to PCRE 6.1.
870         * pcre/LICENCE: Ditto.
871         * pcre/dftables.c: Ditto.
872         * pcre/pcre-config.h: Ditto.
873         * pcre/pcre.h: Ditto.
874
875         * pcre/pcre_compile.c: Added for PCRE 6.1.
876         * pcre/pcre_config.c: Ditto.
877         * pcre/pcre_exec.c: Ditto.
878         * pcre/pcre_fullinfo.c: Ditto.
879         * pcre/pcre_get.c: Ditto.
880         * pcre/pcre_globals.c: Ditto.
881         * pcre/pcre_info.c: Ditto.
882         * pcre/pcre_internal.h: Ditto.
883         * pcre/pcre_maketables.c: Ditto.
884         * pcre/pcre_ord2utf8.c: Ditto.
885         * pcre/pcre_printint.c: Ditto.
886         * pcre/pcre_refcount.c: Ditto.
887         * pcre/pcre_study.c: Ditto.
888         * pcre/pcre_tables.c: Ditto.
889         * pcre/pcre_try_flipped.c: Ditto.
890         * pcre/pcre_ucp_findchar.c: Ditto.
891         * pcre/pcre_version.c: Ditto.
892         * pcre/pcre_xclass.c: Ditto.
893         * pcre/ucp.h: Ditto.
894         * pcre/ucp_findchar.c: Ditto.
895         * pcre/ucpinternal.h: Ditto.
896         * pcre/ucptable.c: Ditto.
897
898         * pcre/get.c: Removed.
899         * pcre/internal.h: Removed.
900         * pcre/maketables.c: Removed.
901         * pcre/pcre.c: Removed.
902         * pcre/study.c: Removed.
903
904 2005-09-07  Geoffrey Garen  <ggaren@apple.com>
905
906         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4781
907         Date.setMonth fails with big values due to overflow
908
909         Reviewed by darin.
910
911         * kjs/date_object.cpp:
912         (timetUsingCF): for consistency, changed return statement to invalidDate instead of LONG_MAX
913         (KJS::fillStructuresUsingTimeArgs): modified for readability
914         (KJS::fillStructuresUsingDateArgs): new function analogous to fillStructuresUsingTimeArgs
915         (KJS::DateProtoFuncImp::callAsFunction): modified to use fillStructuresUsingDateArgs
916         (KJS::DateObjectImp::construct): moved variable declaration to proper scope
917         (KJS::DateObjectFuncImp::callAsFunction): moved variable declaration to proper scope
918
919 2005-09-07  Geoffrey Garen  <ggaren@apple.com>
920         -updated expected test results to reflect fix for 
921         http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
922         kjs does not allow named functions in function expressions
923  
924         * tests/mozilla/expected.html:
925
926 2005-09-04  Darin Adler  <darin@apple.com>
927
928         * kjs/identifier.cpp: Fix comment, add missing include.
929         (Follow-on to changes from yesterday.)
930
931 2005-09-03  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
932
933         Reviewed, tweaked and landed by Darin.
934
935         - another try at some of the Windows compilation fixes
936           should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
937
938         * kjs/collector.cpp: Add missing <setjmp.h> include.
939         * kjs/date_object.cpp: Fix broken copysign macro.
940         * kjs/dtoa.cpp: Move macro definitions down after all header includes.
941         * kjs/fast_malloc.cpp: Add missing <assert.h> and <stddef.h> includes.
942         * kjs/function.cpp: Remove broken isxdigit definition.
943         * kjs/grammar.y: Add a missing semicolon (and remove an excess one).
944         * kjs/identifier.cpp: Turn off AVOID_STATIC_CONSTRUCTORS because the placement new syntax
945         doesn't seem to work in Visual C++ (I'm surprised to hear that, by the way).
946         * kjs/value.h: Made ValueImp's destructor virtual because otherwise pointers to ValueImp
947         on the stack aren't right for garbage collection on Windows (don't think it works that
948         way with gcc's virtual table scheme, but it's a harmless change).
949
950 2005-09-03  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
951
952         Reviewed, tweaked and landed by Darin.
953
954         - some Windows compilation fixes, hoping to fix the problems reported in these bugs:
955           4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
956
957         * kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside
958         KJS_MULTIPLE_THREADS #if directives.
959         (KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
960
961         * kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
962
963         * kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
964         copysign for Win32.
965         (KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe
966         that on Win32 there's some other call before that setting errno.
967
968         * kjs/date_object.h: Remove unneeded include of <sys/time.h>.
969
970         * kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
971
972         * kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32.
973         (KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++.
974         (KJS::sbrk): Change parameter type to match the declaration.
975
976         * kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
977
978         * kjs/function.h: Remove unneeded friend class Function for FunctionImp.
979
980         * kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS
981         define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the
982         non-AVOID_STATIC_CONSTRUCTORS code path.
983
984         * kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>!
985         Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
986
987         * kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this
988         specific to Mac OS X if we like.
989
990         * kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
991
992         * kjs/list.cpp:
993         (KJS::ListImp::markValues): Use std::min instead of MIN.
994         (KJS::List::copy): Ditto.
995         (KJS::List::copyTail): Ditto.
996
997         * kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
998
999         * kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
1000         Put the use of always_inline inside __GNUC__.
1001
1002         * kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10"
1003         inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen
1004         when passing an int rather than a double or float.
1005
1006         * kjs/operations.cpp:
1007         (KJS::isInf): Add Win32 implementation.
1008         (KJS::isPosInf): Add Win32 implementation.
1009         (KJS::isNegInf): Add Win32 implementation.
1010
1011         * kjs/regexp.cpp: Use unsigned instead of uint.
1012         * kjs/regexp.h: Ditto.
1013         * kjs/regexp_object.cpp: Ditto.
1014         * kjs/regexp_object.h: Ditto.
1015
1016 2005-09-02  Beth Dakin  <bdakin@apple.com>
1017
1018         Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
1019         The other half of the fix is in WebCore.
1020
1021         Fix written by Maciej and Darin.
1022         Reviewed by me/Maciej
1023
1024         As Maciej said in Radar: These problems was caused by a conflict between some of our custom 
1025         allocators, causing them to return null. Symptom is typically a null pointer dereference in 
1026         a place where it might be expected an allocation has just occurred.
1027
1028         * kjs/fast_malloc.cpp:  Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM, 
1029                                 and MALLOC_FAILURE_ACTION.
1030
1031 2005-08-31  Geoffrey Garen  <ggaren@apple.com>
1032
1033         -rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1034         kjs does not allow named functions in function expressions
1035         
1036         Fix by Arthur Langereis.
1037         
1038         Reviewed by darin.
1039         
1040         * kjs/grammar.y:
1041         * kjs/nodes.cpp:
1042         (FuncExprNode::evaluate):
1043         * kjs/nodes.h:
1044         (KJS::FuncExprNode::FuncExprNode):
1045
1046         Test cases added:
1047
1048         * layout-tests/fast/js/named-function-expression-expected.txt: Added.
1049         * layout-tests/fast/js/named-function-expression.html: Added.
1050         
1051 2005-08-31  Justin Haygood  <justin@xiondigital.net>
1052
1053         Reviewed, tweaked, and landed by Darin.
1054
1055         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4085
1056         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4087
1057         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4096
1058           Some fixes for compiling on windows.
1059
1060         * kjs/config.h: Added a WIN32 case in here, with suitable defines.
1061         (To be tweaked as necessary.)
1062         * kjs/function.cpp: Took out APPLE_CHANGES around use of ICU.
1063         * kjs/operations.cpp: Removed some bogus code that always set HAVE_FLOAT_H.
1064
1065 2005-08-30  Darin Adler  <darin@apple.com>
1066
1067         Reviewed by John Sullivan.
1068
1069         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4758
1070           unify SharedPtr in WebCore and JavaScriptCore
1071
1072         * kjs/shared_ptr.h: Updated namespace to KXMLCore instead of kxhmlcore.
1073         Made a few small improvements to use local variables a bit more and added
1074         an "operator int" to reduce the chance that we'll convert a SharedPtr to
1075         an int by accident. Also made the == operators normal functions rather than
1076         friend functions, added a couple of comemnts.
1077
1078         * kjs/function.h: Updated for namespace change.
1079         * kjs/function.cpp: Ditto.
1080         * kjs/function_object.cpp: Ditto.
1081         * kjs/internal.h: Ditto.
1082         * kjs/internal.cpp: Ditto.
1083         * kjs/nodes.h: Ditto.
1084         * kjs/nodes2string.cpp: Ditto.
1085
1086 2005-08-26  Maciej Stachowiak  <mjs@apple.com>
1087
1088         Reviewed by John.
1089
1090         <rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript        
1091
1092         Record all nodes that are created during parsing, and delete any
1093         that are left floating with a refcount of 0.
1094         
1095         * kjs/internal.cpp:
1096         (KJS::Parser::saveNewNode):
1097         (KJS::clearNewNodes):
1098         (KJS::Parser::parse):
1099         * kjs/internal.h:
1100         * kjs/nodes.cpp:
1101         (Node::Node):
1102         * kjs/nodes.h:
1103         (KJS::Node::refcount):
1104
1105 2005-08-26  Maciej Stachowiak  <mjs@apple.com>
1106
1107         Reviewed by John.
1108
1109         - fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
1110         
1111         Fixed by changing the refcounting scheme for nodes. Instead of each node implementing a custom ref and
1112         deref for all its children (and being responsible for deleting them), nodes use a smart pointer to
1113         hold their children, and smart pointers are used outside the node tree as well. This change mostly
1114         removes code.
1115         
1116         * JavaScriptCore.xcodeproj/project.pbxproj:
1117         * kjs/function.cpp:
1118         (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
1119         (KJS::GlobalFuncImp::callAsFunction):
1120         * kjs/function.h:
1121         * kjs/function_object.cpp:
1122         (FunctionObjectImp::construct):
1123         * kjs/grammar.y:
1124         * kjs/internal.cpp:
1125         (KJS::Parser::parse):
1126         (KJS::Parser::accept):
1127         (KJS::InterpreterImp::checkSyntax):
1128         (KJS::InterpreterImp::evaluate):
1129         * kjs/internal.h:
1130         * kjs/nodes.cpp:
1131         (Node::Node):
1132         (Node::~Node):
1133         (ElementNode::evaluate):
1134         (PropertyValueNode::evaluate):
1135         (ArgumentListNode::evaluateList):
1136         (NewExprNode::evaluate):
1137         (FunctionCallValueNode::evaluate):
1138         (FunctionCallBracketNode::evaluate):
1139         (FunctionCallDotNode::evaluate):
1140         (RelationalNode::evaluate):
1141         (StatListNode::execute):
1142         (StatListNode::processVarDecls):
1143         (VarDeclListNode::evaluate):
1144         (VarDeclListNode::processVarDecls):
1145         (ForInNode::ForInNode):
1146         (ClauseListNode::processVarDecls):
1147         (CaseBlockNode::evalBlock):
1148         (FuncDeclNode::processFuncDecl):
1149         (FuncExprNode::evaluate):
1150         (SourceElementsNode::execute):
1151         (SourceElementsNode::processFuncDecl):
1152         (SourceElementsNode::processVarDecls):
1153         * kjs/nodes.h:
1154         (KJS::Node::ref):
1155         (KJS::Node::deref):
1156         (KJS::NumberNode::NumberNode):
1157         (KJS::GroupNode::GroupNode):
1158         (KJS::ElementNode::ElementNode):
1159         (KJS::ArrayNode::ArrayNode):
1160         (KJS::PropertyValueNode::PropertyValueNode):
1161         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1162         (KJS::BracketAccessorNode::BracketAccessorNode):
1163         (KJS::DotAccessorNode::DotAccessorNode):
1164         (KJS::ArgumentListNode::ArgumentListNode):
1165         (KJS::ArgumentsNode::ArgumentsNode):
1166         (KJS::NewExprNode::NewExprNode):
1167         (KJS::FunctionCallValueNode::FunctionCallValueNode):
1168         (KJS::FunctionCallResolveNode::FunctionCallResolveNode):
1169         (KJS::FunctionCallBracketNode::FunctionCallBracketNode):
1170         (KJS::FunctionCallDotNode::FunctionCallDotNode):
1171         (KJS::PostfixNode::PostfixNode):
1172         (KJS::DeleteNode::DeleteNode):
1173         (KJS::VoidNode::VoidNode):
1174         (KJS::TypeOfNode::TypeOfNode):
1175         (KJS::PrefixNode::PrefixNode):
1176         (KJS::UnaryPlusNode::UnaryPlusNode):
1177         (KJS::NegateNode::NegateNode):
1178         (KJS::BitwiseNotNode::BitwiseNotNode):
1179         (KJS::LogicalNotNode::LogicalNotNode):
1180         (KJS::MultNode::MultNode):
1181         (KJS::AddNode::AddNode):
1182         (KJS::ShiftNode::ShiftNode):
1183         (KJS::RelationalNode::RelationalNode):
1184         (KJS::EqualNode::EqualNode):
1185         (KJS::BitOperNode::BitOperNode):
1186         (KJS::BinaryLogicalNode::BinaryLogicalNode):
1187         (KJS::ConditionalNode::ConditionalNode):
1188         (KJS::AssignResolveNode::AssignResolveNode):
1189         (KJS::AssignBracketNode::AssignBracketNode):
1190         (KJS::AssignDotNode::AssignDotNode):
1191         (KJS::CommaNode::CommaNode):
1192         (KJS::AssignExprNode::AssignExprNode):
1193         (KJS::VarDeclListNode::VarDeclListNode):
1194         (KJS::VarStatementNode::VarStatementNode):
1195         (KJS::ExprStatementNode::ExprStatementNode):
1196         (KJS::IfNode::IfNode):
1197         (KJS::DoWhileNode::DoWhileNode):
1198         (KJS::WhileNode::WhileNode):
1199         (KJS::ForNode::ForNode):
1200         (KJS::ReturnNode::ReturnNode):
1201         (KJS::WithNode::WithNode):
1202         (KJS::CaseClauseNode::CaseClauseNode):
1203         (KJS::ClauseListNode::ClauseListNode):
1204         (KJS::ClauseListNode::clause):
1205         (KJS::ClauseListNode::next):
1206         (KJS::SwitchNode::SwitchNode):
1207         (KJS::LabelNode::LabelNode):
1208         (KJS::ThrowNode::ThrowNode):
1209         (KJS::CatchNode::CatchNode):
1210         (KJS::FinallyNode::FinallyNode):
1211         (KJS::TryNode::TryNode):
1212         (KJS::ParameterNode::ParameterNode):
1213         (KJS::ParameterNode::nextParam):
1214         (KJS::FuncDeclNode::FuncDeclNode):
1215         (KJS::FuncExprNode::FuncExprNode):
1216         * kjs/nodes2string.cpp:
1217         (KJS::SourceStream::operator<<):
1218         (ElementNode::streamTo):
1219         (PropertyValueNode::streamTo):
1220         (ArgumentListNode::streamTo):
1221         (StatListNode::streamTo):
1222         (VarDeclListNode::streamTo):
1223         (CaseBlockNode::streamTo):
1224         (ParameterNode::streamTo):
1225         (SourceElementsNode::streamTo):
1226         * kjs/shared_ptr.h: Added.
1227         (kxmlcore::SharedPtr::SharedPtr):
1228         (kxmlcore::SharedPtr::~SharedPtr):
1229         (kxmlcore::SharedPtr::isNull):
1230         (kxmlcore::SharedPtr::notNull):
1231         (kxmlcore::SharedPtr::reset):
1232         (kxmlcore::SharedPtr::get):
1233         (kxmlcore::SharedPtr::operator*):
1234         (kxmlcore::SharedPtr::operator->):
1235         (kxmlcore::SharedPtr::operator!):
1236         (kxmlcore::SharedPtr::operator bool):
1237         (kxmlcore::SharedPtr::operator==):
1238         (kxmlcore::::operator):
1239         (kxmlcore::operator!=):
1240         (kxmlcore::static_pointer_cast):
1241         (kxmlcore::const_pointer_cast):
1242
1243 2005-08-26  Geoff Garen  <ggaren@apple.com>
1244
1245         Reviewed by John.
1246         Landed by Darin.
1247
1248         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4664
1249           TOT Crash from backwards null check in WebScriptObject.mm
1250
1251         * bindings/objc/WebScriptObject.mm:
1252         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1253         Remove bogus !.
1254
1255 2005-08-25  Darin Adler  <darin@apple.com>
1256
1257         Reviewed by John Sullivan.
1258
1259         - rename KJS::UString::string() to KJS::UString::domString()
1260         - rename KJS::Identifier::string() to KJS::Identifier::domString()
1261
1262         * kjs/identifier.h: Renamed.
1263         * kjs/ustring.h: Ditto.
1264
1265 2005-08-19  Darin Adler  <darin@apple.com>
1266
1267         Reviewed by Maciej.
1268
1269         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4435
1270           speed up JavaScript by tweaking the Identifier class
1271
1272         * kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
1273         that returns it.
1274         * kjs/identifier.cpp: (KJS::Identifier::init): Initialize a global for the null identifier
1275         as well as all the other globals for special identifiers.
1276
1277         * kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
1278         * kjs/ustring.cpp: Remove the old non-inline version.
1279
1280 2005-08-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1281
1282         Reviewed by Maciej.
1283         Revised and landed by Darin.
1284
1285         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4474
1286           REGRESSION: Crash when using in-place operator on uninitialized array element
1287
1288         * kjs/nodes.cpp:
1289         (AssignResolveNode::evaluate): Remove unneeded "isSet" assertion.
1290         (AssignBracketNode::evaluate): Replace code that tested "isSet" with code that
1291         tests the return value of getPropertySlot.
1292
1293         * kjs/property_slot.h: Removed unneeded "isSet" function. Property slots are
1294         either uninitialized or set. There's no "initialized and not set" state.
1295
1296 2005-08-18  Adele Peterson  <adele@apple.com>
1297
1298         Checked "Inline Functions Hidden" box
1299
1300         * JavaScriptCore.xcodeproj/project.pbxproj:
1301
1302 2005-08-16  Darin Adler  <darin@apple.com>
1303
1304         Reviewed by Geoff.
1305
1306         - fixed crash in one of the JavaScript tests (introduced by my throwError change)
1307
1308         * kjs/nodes.cpp: (Node::setExceptionDetailsIfNeeded): Check if the exception is an
1309         object before setting the file and line number properties on it. Something to think
1310         about in the future -- do we really want to do this on any object that's thrown?
1311         How about limiting it to error objects that were created by the JavaScript engine?
1312
1313         - changed kjs_fast_malloc so we don't have two conflicting versions of the same function
1314
1315         * kjs/fast_malloc.h: Took out all the ifdefs from this header.
1316         * kjs/fast_malloc.cpp: Added non-NDEBUG versions of the functions that just call
1317         the system malloc, and put the NDEBUG versions in an #else.
1318
1319 2005-08-16  Darin Adler  <darin@apple.com>
1320
1321         Reviewed by Geoff.
1322
1323         - clean up exported symbols that are not in a "KJS" namespace
1324
1325         * bindings/NP_jsobject.cpp: (identiferFromNPIdentifier): Marked this function static
1326         so it no longer has external linkage.
1327         * bindings/c/c_utility.h: Put all this stuff inside the KJS namespace.
1328         * bindings/c/c_utility.cpp: Also marked some globals static so they don't have external
1329         linkage; not as important given the namespace.
1330         * bindings/npruntime.cpp: Marked functions static so they no longer have internal linkage.
1331         Also removed unused _NPN_SetExceptionWithUTF8 function (not in header, had C++ linkage!).
1332
1333         * bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): Call KJS_GetCreatedJavaVMs
1334         using the soft linking header, instead of calling the JNI call. This allows processes
1335         to link both JavaScriptCore and JavaVM without a symbol conflict.
1336         * bindings/softlinking.c:
1337         (loadFramework): Marked this function static so it no longer has external linkage.
1338         (getFunctionPointer): Ditto.
1339         (KJS_GetCreatedJavaVMs): Renamed this so it has a KJS prefix.
1340
1341         * JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
1342         * bindings/softlinking.h: Added.
1343
1344         * kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
1345         no longer has external linkage.
1346
1347 2005-08-15  Darin Adler  <darin@apple.com>
1348
1349         Reviewed by Geoff.
1350
1351         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4437
1352           clean up error creation with new throwError function
1353
1354         * bindings/NP_jsobject.cpp:
1355         (_NPN_SetException):
1356         * bindings/jni/jni_instance.cpp:
1357         (JavaInstance::invokeMethod):
1358         * bindings/jni/jni_runtime.cpp:
1359         (JavaField::dispatchValueFromInstance):
1360         (JavaField::dispatchSetValueToInstance):
1361         * bindings/objc/WebScriptObject.mm:
1362         (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:executionContext:]):
1363         (-[WebScriptObject _initWithObjectImp:originExecutionContext:executionContext:]):
1364         (+[WebScriptObject throwException:]):
1365         (-[WebScriptObject setException:]):
1366         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1367         * bindings/objc/objc_class.h:
1368         (KJS::Bindings::ObjcClass::~ObjcClass):
1369         (KJS::Bindings::ObjcClass::ObjcClass):
1370         (KJS::Bindings::ObjcClass::operator=):
1371         (KJS::Bindings::ObjcClass::constructorAt):
1372         (KJS::Bindings::ObjcClass::numConstructors):
1373         * bindings/objc/objc_header.h:
1374         * bindings/objc/objc_runtime.h:
1375         (KJS::Bindings::ObjcField::~ObjcField):
1376         (KJS::Bindings::ObjcField::ObjcField):
1377         (KJS::Bindings::ObjcField::operator=):
1378         (KJS::Bindings::ObjcMethod::ObjcMethod):
1379         (KJS::Bindings::ObjcMethod::~ObjcMethod):
1380         (KJS::Bindings::ObjcMethod::operator=):
1381         * bindings/objc/objc_runtime.mm:
1382         (ObjcField::valueFromInstance):
1383         (ObjcField::setValueToInstance):
1384         (ObjcArray::setValueAt):
1385         (ObjcArray::valueAt):
1386         * bindings/objc/objc_utility.h:
1387         * bindings/objc/objc_utility.mm:
1388         (KJS::Bindings::JSMethodNameToObjCMethodName):
1389         (KJS::Bindings::convertValueToObjcValue):
1390         (KJS::Bindings::convertNSStringToString):
1391         (KJS::Bindings::convertObjcValueToValue):
1392         (KJS::Bindings::objcValueTypeForType):
1393         (KJS::Bindings::createObjcInstanceForValue):
1394         (KJS::Bindings::throwError):
1395         * bindings/runtime.h:
1396         (KJS::Bindings::Parameter::~Parameter):
1397         (KJS::Bindings::Method::~Method):
1398         (KJS::Bindings::Instance::Instance):
1399         (KJS::Bindings::Instance::begin):
1400         (KJS::Bindings::Instance::end):
1401         (KJS::Bindings::Instance::getValueOfUndefinedField):
1402         (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
1403         (KJS::Bindings::Instance::setValueOfUndefinedField):
1404         (KJS::Bindings::Instance::valueOf):
1405         * bindings/runtime_array.cpp:
1406         (RuntimeArrayImp::put):
1407         * bindings/runtime_object.h:
1408         (KJS::RuntimeObjectImp::setInternalInstance):
1409         (KJS::RuntimeObjectImp::getInternalInstance):
1410         * kjs/array_object.cpp:
1411         (getProperty):
1412         (ArrayProtoFuncImp::callAsFunction):
1413         (ArrayObjectImp::construct):
1414         * kjs/bool_object.cpp:
1415         (BooleanProtoFuncImp::callAsFunction):
1416         * kjs/date_object.cpp:
1417         (KJS::DateProtoFuncImp::callAsFunction):
1418         * kjs/function.cpp:
1419         (KJS::decode):
1420         (KJS::GlobalFuncImp::callAsFunction):
1421         * kjs/function_object.cpp:
1422         (FunctionProtoFuncImp::callAsFunction):
1423         (FunctionObjectImp::construct):
1424         * kjs/internal.cpp:
1425         (KJS::UndefinedImp::toObject):
1426         (KJS::NullImp::toObject):
1427         (KJS::InterpreterImp::evaluate):
1428         (KJS::InternalFunctionImp::hasInstance):
1429         * kjs/nodes.cpp:
1430         (Node::throwError):
1431         (substitute):
1432         (Node::setExceptionDetailsIfNeeded):
1433         (undefinedVariableError):
1434         (ProgramNode::ProgramNode):
1435         * kjs/number_object.cpp:
1436         (NumberProtoFuncImp::callAsFunction):
1437         * kjs/object.cpp:
1438         (KJS::ObjectImp::call):
1439         (KJS::ObjectImp::defaultValue):
1440         (KJS::Error::create):
1441         (KJS::throwError):
1442         * kjs/object.h:
1443         (KJS::ObjectImp::clearProperties):
1444         (KJS::ObjectImp::getPropertySlot):
1445         (KJS::ObjectImp::getOwnPropertySlot):
1446         * kjs/object_object.cpp:
1447         (ObjectProtoFuncImp::callAsFunction):
1448         * kjs/reference.cpp:
1449         (KJS::Reference::getBase):
1450         (KJS::Reference::getValue):
1451         (KJS::Reference::putValue):
1452         (KJS::Reference::deleteValue):
1453         * kjs/regexp_object.cpp:
1454         (RegExpProtoFuncImp::callAsFunction):
1455         (RegExpObjectImp::construct):
1456         * kjs/string_object.cpp:
1457         (StringProtoFuncImp::callAsFunction):
1458
1459 2005-08-15  Anders Carlsson  <andersca@mac.com>
1460
1461         Reviewed by Darin.
1462
1463         * tests/mozilla/ecma_3/Date/15.9.5.5.js:
1464         Remove the code which tests that Date.toLocaleString should be parsable
1465         by Date.parse. That is not true according to the spec.
1466
1467 2005-08-15  Darin Adler  <darin@apple.com>
1468
1469         Reviewed by Geoff.
1470
1471         * kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
1472         more place; slight speedup.
1473
1474 2005-08-14  Darin Adler  <darin@apple.com>
1475
1476         Reviewed by Maciej.
1477
1478         - fixed crash observed on one of the Apple-only layout tests
1479
1480         * kjs/property_map.cpp: (KJS::PropertyMap::mark): Change code to understand that deleted
1481         entries have a value of NULL, so the deleted sentinel count doesn't need to be included
1482         in the count of things to mark since we're ignoring the keys.
1483
1484 2005-08-14  Darin Adler  <darin@apple.com>
1485
1486         Reviewed by Maciej.
1487
1488         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4421
1489           speed up JavaScript by inlining some label stack functions
1490
1491         * kjs/internal.h: Removed the copy constructor and assignment operator for LabelStack.
1492         They were unused, and the implementations had bugs; I removed them rather than fixing them.
1493         Also removed the clear function, since that was only needed to help the assignment operator
1494         share code with the destructor, and was not efficient enough for the destructor.
1495         (KJS::LabelStack::~LabelStack): Made this inline. Also used an efficient implementation
1496         that's nice and fast when the stack is empty, better than the old clear() function which
1497         used to keep updating and refetching "tos" each time through the loop.
1498         (KJS::LabelStack::pop): Made this inline.
1499
1500         * kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
1501         deleted a commented-out line of code.
1502
1503 2005-08-14  Darin Adler  <darin@apple.com>
1504
1505         Reviewed by Maciej.
1506
1507         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4419
1508           speed up JavaScript by improving KJS::List
1509
1510         my measurements show an improvement of 1% on iBench JavaScript
1511
1512         * kjs/list.cpp: Rearrange list to make the values and free list share the same storage,
1513         which saves 4 bytes per list. Also remove the pointers used only on the heap from the
1514         lists that are in the pool, which saves 8 bytes per list. Moving the free list pointer
1515         closer to the start of the list object also speeds up access to the free list. New
1516         "HeapListImp" struct is used only for the lists on the heap.
1517         (KJS::List::markProtectedLists): Shadowed global variable in local and updated for the
1518         new terminology ("heap" instead of "outside pool").
1519         (KJS::allocateListImp): Updated for new terminology.
1520         (KJS::List::release): Moved the code from deallocateListImp in here -- it wasn't being
1521         inlined and didn't need to be in a separate function.
1522
1523 2005-08-14  Darin Adler  <darin@apple.com>
1524
1525         Reviewed by Maciej.
1526
1527         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4417
1528           speed up JavaScript with some small changes to the property map code
1529
1530         my measurements show an improvement of 2% on iBench JavaScript
1531
1532         * kjs/property_map.h: (KJS::PropertyMap::PropertyMap): Made the default constructor inline.
1533         * kjs/property_map.cpp:
1534         (KJS::PropertyMap::~PropertyMap): Changed loop to exit early once we know we've processed
1535         all the hash table entries, based on the count.
1536         (KJS::PropertyMap::mark): Ditto.
1537
1538         * kjs/object.h: Made an arbitrary change here to force recompiling so we pick up changes to
1539         property_map.h. Works around what seems to be an Xcode header dependency bug.
1540
1541 2005-08-14  Darin Adler  <darin@apple.com>
1542
1543         Reviewed by Maciej.
1544
1545         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4416
1546           speed up JavaScript with some improvements to the garbage collector
1547
1548         my measurements show an improvement of 2% on iBench JavaScript
1549
1550         * kjs/collector.cpp:
1551         (KJS::Collector::allocate): Use local variables to shadow globals instead of repeatedly
1552         going at global variables. Tighten up loop implementations to make the common case fast.
1553         (KJS::Collector::markStackObjectsConservatively): Use local variables to shadow globals.
1554         Used a goto to eliminate a boolean since it was showing up in the profile.
1555         (KJS::Collector::markProtectedObjects): Iterate through the table using pointer rather
1556         than an index since the profile showed that generating better code.
1557         (KJS::Collector::collect): Added a special case for blocks where all cells are used,
1558         Use local variables to shadow globals. Eliminated a boolean by computing it another
1559         way (checking to see if the number of live objects changed). Also used local variables
1560         to shadow fields in the current cell when sweeping.
1561         (KJS::Collector::numReferencedObjects): Use AllocatedValueImp instead of ValueImp
1562         in one place -- means we get faster versions of various functions that don't worry
1563         about SimpleNumber.
1564         (KJS::className): Ditto.
1565         (KJS::Collector::rootObjectClasses): Ditto.
1566
1567 2005-08-14  Darin Adler  <darin@apple.com>
1568
1569         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
1570           REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
1571
1572         * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
1573         straightforward way. The old code set the proto to 0 and then to the correct value.
1574         This showed up as a "false positive" when searching for places that set prototype
1575         to NULL/0 so I fixed it.
1576
1577         * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
1578         not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
1579
1580         * kjs/internal.h: Added a default constructor for InternalFunctionImp.
1581         * kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
1582         default constructor (empty body, just calls base class's default constructor).
1583
1584         * kjs/object.h:
1585         (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
1586         in Development builds.
1587         (KJS::ObjectImp::setPrototype): Ditto.
1588
1589 2005-08-12  Maciej Stachowiak  <mjs@apple.com>
1590
1591         Reviewed by John.
1592
1593         - two simple speed improvements for a 3% speed gain
1594         
1595         * JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
1596
1597         * kjs/scope_chain.h:
1598         (KJS::ScopeChainIterator::ScopeChainIterator): Add a scope chain iterator
1599         so you can walk a scope chain without having to make a copy that you then mutate.
1600         (KJS::ScopeChainIterator::operator*): standard iterator operation
1601         (KJS::ScopeChainIterator::operator->): ditto
1602         (KJS::ScopeChainIterator::operator++): ditto
1603         (KJS::ScopeChainIterator::operator==): ditto
1604         (KJS::ScopeChainIterator::operator!=): ditto
1605         (KJS::ScopeChain::begin): Iterator for the top of the scope chain
1606         (KJS::ScopeChain::end): Iterator for one past the bottom (i.e. null)
1607         * kjs/nodes.cpp:
1608         (ResolveNode::evaluate): Use scope chain iterator instead of copying
1609         a scope chain and then modifying the copy
1610         (ResolveNode::evaluateReference): ditto
1611         (FunctionCallResolveNode::evaluate): ditto
1612         (AssignResolveNode::evaluate): ditto
1613
1614 2005-08-12  Maciej Stachowiak  <mjs@apple.com>
1615
1616         Patch from Anders Carlsson, reviewed by me.
1617
1618         * kjs/nodes.h: Fix build breakage.
1619
1620 2005-08-12  Maciej Stachowiak  <mjs@apple.com>
1621
1622         Reviewed by hyatt.
1623
1624         - refactor function calls, 3% speedup on JS iBench.
1625
1626         * kjs/grammar.y:
1627         * kjs/nodes.cpp:
1628         (Node::throwError): Added new useful variants.
1629         (FunctionCallValueNode::evaluate): New node to handle calls on expressions
1630         that are strictly values, not references.
1631         (FunctionCallValueNode::ref):  ditto
1632         (FunctionCallValueNode::deref): ditto
1633         (FunctionCallResolveNode::evaluate): New node to handle calls on identifier
1634         expressions, so that they are looked up in the scope chain.
1635         (FunctionCallResolveNode::ref): ditto
1636         (FunctionCallResolveNode::deref): ditto
1637         (FunctionCallBracketNode::evaluate): New node to handle calls on bracket
1638         dereferences, so that the expression before brackets is used as the this
1639         object.
1640         (FunctionCallBracketNode::ref): ditto
1641         (FunctionCallBracketNode::deref): ditto
1642         (FunctionCallDotNode::evaluate): New node to handle calls on dot
1643         dereferences, so that the expression before the dot is used as the this
1644         object.
1645         (FunctionCallDotNode::ref): ditto
1646         (FunctionCallDotNode::deref): ditto
1647         (dotExprNotAnObjectString): helper function to avoid global variable access.
1648         (dotExprDoesNotAllowCallsString): ditto
1649         * kjs/nodes.h: Declared new classes.
1650         * kjs/nodes2string.cpp:
1651         (FunctionCallValueNode::streamTo): Added - serializes the appropriate function call
1652         (FunctionCallResolveNode::streamTo): ditto
1653         (FunctionCallBracketNode::streamTo): ditto
1654         (FunctionCallParenBracketNode::streamTo): ditto
1655         (FunctionCallDotNode::streamTo): ditto
1656         (FunctionCallParenDotNode::streamTo): ditto
1657         * kjs/object.h:
1658         (KJS::ObjectImp::isActivation): Change how activation objects are
1659         detected in the scope chain, a virtual function is cheaper than the
1660         old inheritance test.
1661         * kjs/function.h:
1662         (KJS::ActivationImp::isActivation): Ditto.
1663
1664 2005-08-11  Maciej Stachowiak  <mjs@apple.com>
1665
1666         - added missing file from earlier checkin
1667
1668         * kjs/grammar_types.h: Added.
1669         (KJS::makeNodePair):
1670         (KJS::makeNodeWithIdent):
1671
1672 2005-08-11  Maciej Stachowiak  <mjs@apple.com>
1673
1674         Reviewed by Geoff.
1675
1676         * kjs/date_object.cpp:
1677         (timetUsingCF): Fix one of the date tests my making the CF version of mktime
1678         have the same quirk about the DST field as the real mktime.
1679         * tests/mozilla/expected.html: Updated for newly fixed test.
1680
1681 2005-08-11  Maciej Stachowiak  <mjs@apple.com>
1682
1683         - updated for one of the tests that Darin incidentally fixed.
1684
1685         * tests/mozilla/expected.html:
1686
1687 2005-08-10  Maciej Stachowiak  <mjs@apple.com>
1688
1689         Reviewed by Geoff.
1690
1691         Refactor assignment grammar to avoid Reference type, and to later
1692         be able to take advantage of writeable PropertySlots, when those
1693         are added. I also fixed a minor bug, turning a function to a
1694         string lost parentheses, I made sure they are printed at least
1695         where semantically significant.
1696         
1697         Test cases: see WebCore
1698         
1699         * kjs/grammar.y: Change grammar so that assignment expressions are parsed
1700         directly to nodes that know how to set the kind of location being assigned, instead
1701         of having a generic assign node that counts on evaluateReference.
1702         * kjs/lexer.cpp: Include grammar_types.h.
1703         * kjs/nodes.cpp:
1704         (BracketAccessorNode): Renamed from AccessorNode1 for clarity.
1705         (DotAccessorNode): Renamed from AccessorNode2 for clarity.
1706         (combineForAssignment): Inline function for doing the proper kind of
1707         operation for various update assignments like += or *=.
1708         (AssignResolveNode): Node that handles assignment to a bare identifier.
1709         (AssignDotNode): Node that handles assignments of the form EXPR . IDENT = EXPR
1710         (AssignBracketNode): EXPR [ IDENT ] = EXPR
1711         * kjs/nodes.h: Updated for declarations/renames of new classes.
1712         * kjs/nodes2string.cpp:
1713         (GroupNode::streamTo): Fixed to print parens around the expression.
1714         (BracketAccessorNode::streamTo): Renamed.
1715         (DotAccessorNode::streamTo): Renamed.
1716         (AssignResolveNode::streamTo): Added.
1717         (AssignBracketNode::streamTo): Added.
1718         (AssignDotNode::streamTo): Added.
1719         (streamAssignmentOperatorTo): helper function for the above
1720         * kjs/property_slot.h:
1721         (KJS::PropertySlot::isSet): Made this const.
1722
1723 2005-08-10  Adele Peterson  <adele@apple.com>
1724
1725         Bumping version to 420+
1726
1727         * Info.plist:
1728
1729 2005-08-10  Geoffrey Garen  <ggaren@apple.com>
1730
1731         -fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls 
1732         throws privilege exception.
1733         
1734         Reviewed by richard and mjs.
1735
1736         -I removed the global static JavaClass cache, since it violated Java
1737         security to cache classes between websites and applets.
1738         
1739         * bindings/jni/jni_class.cpp: 
1740             -removed global static cache dictionary
1741             -instance constructor and destructor now do the work that used to 
1742             be done by static factory methods
1743             -removed obsolete functions
1744         (JavaClass::JavaClass):
1745         (JavaClass::~JavaClass):
1746         * bindings/jni/jni_class.h:
1747             -removed obsolete function declarations
1748             -made copying private since it's unused and it's also not clear
1749             excatly how copying would work with Java security
1750             -made default construction private since it's meaningless
1751         * bindings/jni/jni_instance.cpp:
1752             -removed obsolete functions
1753         (JavaInstance::~JavaInstance):
1754         (JavaInstance::getClass):
1755         * bindings/jni/jni_instance.h:
1756            -made copying private since it's unused and it's also not clear
1757             excatly how copying would work with Java security
1758             -made default construction private since it's meaningless
1759
1760 2005-08-08  Geoffrey Garen  <ggaren@apple.com>
1761
1762         -fixed crash caused by fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
1763         
1764         - exceptionDescription now gets explicitly initialized to NULL in all
1765         the places listed below -- our wrapper classes used to take care of this 
1766         automagically
1767         
1768         * bindings/jni/jni_instance.cpp:
1769         (JavaInstance::invokeMethod):
1770         * bindings/jni/jni_runtime.cpp:
1771         (JavaField::dispatchValueFromInstance):
1772         (JavaField::dispatchSetValueToInstance):
1773
1774 2005-08-08  Darin Adler  <darin@apple.com>
1775
1776         Reviewed by John Sullivan.
1777
1778         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4325
1779           Mozilla Date tests have an unnecessary loop that runs 1970 times before each test
1780
1781         * tests/mozilla/ecma/shell.js: Added TIME_YEAR_0 constant.
1782
1783         * tests/mozilla/ecma/Date/15.9.5.10-1.js: Removed the loop and changed code to use the constant.
1784         * tests/mozilla/ecma/Date/15.9.5.10-10.js: Ditto.
1785         * tests/mozilla/ecma/Date/15.9.5.10-11.js: Ditto.
1786         * tests/mozilla/ecma/Date/15.9.5.10-12.js: Ditto.
1787         * tests/mozilla/ecma/Date/15.9.5.10-13.js: Ditto.
1788         * tests/mozilla/ecma/Date/15.9.5.10-2.js: Ditto.
1789         * tests/mozilla/ecma/Date/15.9.5.10-3.js: Ditto.
1790         * tests/mozilla/ecma/Date/15.9.5.10-4.js: Ditto.
1791         * tests/mozilla/ecma/Date/15.9.5.10-5.js: Ditto.
1792         * tests/mozilla/ecma/Date/15.9.5.10-6.js: Ditto.
1793         * tests/mozilla/ecma/Date/15.9.5.10-7.js: Ditto.
1794         * tests/mozilla/ecma/Date/15.9.5.10-8.js: Ditto.
1795         * tests/mozilla/ecma/Date/15.9.5.10-9.js: Ditto.
1796         * tests/mozilla/ecma/Date/15.9.5.11-2.js: Ditto.
1797         * tests/mozilla/ecma/Date/15.9.5.12-1.js: Ditto.
1798         * tests/mozilla/ecma/Date/15.9.5.12-2.js: Ditto.
1799         * tests/mozilla/ecma/Date/15.9.5.12-3.js: Ditto.
1800         * tests/mozilla/ecma/Date/15.9.5.12-4.js: Ditto.
1801         * tests/mozilla/ecma/Date/15.9.5.12-5.js: Ditto.
1802         * tests/mozilla/ecma/Date/15.9.5.12-6.js: Ditto.
1803         * tests/mozilla/ecma/Date/15.9.5.12-7.js: Ditto.
1804         * tests/mozilla/ecma/Date/15.9.5.12-8.js: Ditto.
1805         * tests/mozilla/ecma/Date/15.9.5.13-2.js: Ditto.
1806         * tests/mozilla/ecma/Date/15.9.5.13-8.js: Ditto.
1807         * tests/mozilla/ecma/Date/15.9.5.14.js: Ditto.
1808         * tests/mozilla/ecma/Date/15.9.5.15.js: Ditto.
1809         * tests/mozilla/ecma/Date/15.9.5.16.js: Ditto.
1810         * tests/mozilla/ecma/Date/15.9.5.17.js: Ditto.
1811         * tests/mozilla/ecma/Date/15.9.5.18.js: Ditto.
1812         * tests/mozilla/ecma/Date/15.9.5.19.js: Ditto.
1813         * tests/mozilla/ecma/Date/15.9.5.20.js: Ditto.
1814         * tests/mozilla/ecma/Date/15.9.5.21-1.js: Ditto.
1815         * tests/mozilla/ecma/Date/15.9.5.21-2.js: Ditto.
1816         * tests/mozilla/ecma/Date/15.9.5.21-3.js: Ditto.
1817         * tests/mozilla/ecma/Date/15.9.5.21-4.js: Ditto.
1818         * tests/mozilla/ecma/Date/15.9.5.21-5.js: Ditto.
1819         * tests/mozilla/ecma/Date/15.9.5.21-6.js: Ditto.
1820         * tests/mozilla/ecma/Date/15.9.5.21-7.js: Ditto.
1821         * tests/mozilla/ecma/Date/15.9.5.21-8.js: Ditto.
1822         * tests/mozilla/ecma/Date/15.9.5.22-1.js: Ditto.
1823         * tests/mozilla/ecma/Date/15.9.5.22-2.js: Ditto.
1824         * tests/mozilla/ecma/Date/15.9.5.22-3.js: Ditto.
1825         * tests/mozilla/ecma/Date/15.9.5.22-4.js: Ditto.
1826         * tests/mozilla/ecma/Date/15.9.5.22-5.js: Ditto.
1827         * tests/mozilla/ecma/Date/15.9.5.22-6.js: Ditto.
1828         * tests/mozilla/ecma/Date/15.9.5.22-7.js: Ditto.
1829         * tests/mozilla/ecma/Date/15.9.5.22-8.js: Ditto.
1830         * tests/mozilla/ecma/Date/15.9.5.23-4.js: Ditto.
1831         * tests/mozilla/ecma/Date/15.9.5.23-5.js: Ditto.
1832         * tests/mozilla/ecma/Date/15.9.5.23-6.js: Ditto.
1833         * tests/mozilla/ecma/Date/15.9.5.23-7.js: Ditto.
1834         * tests/mozilla/ecma/Date/15.9.5.23-8.js: Ditto.
1835         * tests/mozilla/ecma/Date/15.9.5.23-9.js: Ditto.
1836         * tests/mozilla/ecma/Date/15.9.5.5.js: Ditto.
1837         * tests/mozilla/ecma/Date/15.9.5.6.js: Ditto.
1838         * tests/mozilla/ecma/Date/15.9.5.7.js: Ditto.
1839         * tests/mozilla/ecma/Date/15.9.5.8.js: Ditto.
1840         * tests/mozilla/ecma/Date/15.9.5.9.js: Ditto.
1841
1842 2005-08-08  Darin Adler  <darin@apple.com>
1843
1844         - forgot to delete an obsolete file
1845
1846         * kjs/object_wrapper.h: Deleted.
1847
1848 2005-08-07  Darin Adler  <darin@apple.com>
1849
1850         - fixed two problems compiling with gcc 4.0
1851
1852         * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction): Initialized a
1853         variable to quiet an erroneous warning.
1854         * kjs/date_object.cpp: (KJS::makeTime): Removed extraneous KJS:: prefix.
1855
1856 2005-08-07  Darin Adler  <darin@apple.com>
1857
1858         Rubber stamped by Maciej.
1859
1860         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
1861           eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
1862
1863         * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
1864
1865         Global replaces and other wonderful stuff.
1866
1867         * bindings/NP_jsobject.cpp:
1868         (_NPN_Invoke):
1869         (_NPN_Evaluate):
1870         (_NPN_GetProperty):
1871         (_NPN_SetProperty):
1872         (_NPN_HasMethod):
1873         (_NPN_SetException):
1874         * bindings/c/c_instance.cpp:
1875         (KJS::Bindings::CInstance::CInstance):
1876         (KJS::Bindings::CInstance::invokeMethod):
1877         (KJS::Bindings::CInstance::invokeDefaultMethod):
1878         (KJS::Bindings::CInstance::defaultValue):
1879         (KJS::Bindings::CInstance::stringValue):
1880         (KJS::Bindings::CInstance::numberValue):
1881         (KJS::Bindings::CInstance::booleanValue):
1882         (KJS::Bindings::CInstance::valueOf):
1883         * bindings/c/c_instance.h:
1884         * bindings/c/c_runtime.cpp:
1885         (CField::valueFromInstance):
1886         (CField::setValueToInstance):
1887         * bindings/c/c_runtime.h:
1888         * bindings/c/c_utility.cpp:
1889         (convertNPStringToUTF16):
1890         (convertUTF8ToUTF16):
1891         (coerceValueToNPVariantStringType):
1892         (convertValueToNPVariant):
1893         (convertNPVariantToValue):
1894         * bindings/c/c_utility.h:
1895         * bindings/jni/jni_instance.cpp:
1896         (JavaInstance::stringValue):
1897         (JavaInstance::numberValue):
1898         (JavaInstance::booleanValue):
1899         (JavaInstance::invokeMethod):
1900         (JavaInstance::invokeDefaultMethod):
1901         (JavaInstance::defaultValue):
1902         (JavaInstance::valueOf):
1903         * bindings/jni/jni_instance.h:
1904         * bindings/jni/jni_jsobject.cpp:
1905         (JSObject::invoke):
1906         (JSObject::call):
1907         (JSObject::eval):
1908         (JSObject::getMember):
1909         (JSObject::getSlot):
1910         (JSObject::toString):
1911         (JSObject::convertValueToJObject):
1912         (JSObject::convertJObjectToValue):
1913         (JSObject::listFromJArray):
1914         * bindings/jni/jni_jsobject.h:
1915         * bindings/jni/jni_objc.mm:
1916         (KJS::Bindings::dispatchJNICall):
1917         * bindings/jni/jni_runtime.cpp:
1918         (JavaArray::convertJObjectToArray):
1919         (JavaField::dispatchValueFromInstance):
1920         (JavaField::valueFromInstance):
1921         (JavaField::dispatchSetValueToInstance):
1922         (JavaField::setValueToInstance):
1923         (JavaArray::setValueAt):
1924         (JavaArray::valueAt):
1925         * bindings/jni/jni_runtime.h:
1926         (KJS::Bindings::JavaString::ustring):
1927         * bindings/jni/jni_utility.cpp:
1928         (KJS::Bindings::getJavaVM):
1929         (KJS::Bindings::getJNIEnv):
1930         (KJS::Bindings::getMethodID):
1931         (KJS::Bindings::callJNIVoidMethod):
1932         (KJS::Bindings::callJNIObjectMethod):
1933         (KJS::Bindings::callJNIBooleanMethod):
1934         (KJS::Bindings::callJNIStaticBooleanMethod):
1935         (KJS::Bindings::callJNIByteMethod):
1936         (KJS::Bindings::callJNICharMethod):
1937         (KJS::Bindings::callJNIShortMethod):
1938         (KJS::Bindings::callJNIIntMethod):
1939         (KJS::Bindings::callJNILongMethod):
1940         (KJS::Bindings::callJNIFloatMethod):
1941         (KJS::Bindings::callJNIDoubleMethod):
1942         (KJS::Bindings::callJNIVoidMethodA):
1943         (KJS::Bindings::callJNIObjectMethodA):
1944         (KJS::Bindings::callJNIByteMethodA):
1945         (KJS::Bindings::callJNICharMethodA):
1946         (KJS::Bindings::callJNIShortMethodA):
1947         (KJS::Bindings::callJNIIntMethodA):
1948         (KJS::Bindings::callJNILongMethodA):
1949         (KJS::Bindings::callJNIFloatMethodA):
1950         (KJS::Bindings::callJNIDoubleMethodA):
1951         (KJS::Bindings::callJNIBooleanMethodA):
1952         (KJS::Bindings::callJNIVoidMethodIDA):
1953         (KJS::Bindings::callJNIObjectMethodIDA):
1954         (KJS::Bindings::callJNIByteMethodIDA):
1955         (KJS::Bindings::callJNICharMethodIDA):
1956         (KJS::Bindings::callJNIShortMethodIDA):
1957         (KJS::Bindings::callJNIIntMethodIDA):
1958         (KJS::Bindings::callJNILongMethodIDA):
1959         (KJS::Bindings::callJNIFloatMethodIDA):
1960         (KJS::Bindings::callJNIDoubleMethodIDA):
1961         (KJS::Bindings::callJNIBooleanMethodIDA):
1962         (KJS::Bindings::getCharactersFromJString):
1963         (KJS::Bindings::releaseCharactersForJString):
1964         (KJS::Bindings::getCharactersFromJStringInEnv):
1965         (KJS::Bindings::releaseCharactersForJStringInEnv):
1966         (KJS::Bindings::getUCharactersFromJStringInEnv):
1967         (KJS::Bindings::releaseUCharactersForJStringInEnv):
1968         (KJS::Bindings::JNITypeFromClassName):
1969         (KJS::Bindings::signatureFromPrimitiveType):
1970         (KJS::Bindings::JNITypeFromPrimitiveType):
1971         (KJS::Bindings::getJNIField):
1972         (KJS::Bindings::convertValueToJValue):
1973         * bindings/jni/jni_utility.h:
1974         * bindings/objc/WebScriptObject.mm:
1975         (_didExecute):
1976         (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
1977         (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
1978         (-[WebScriptObject _imp]):
1979         (-[WebScriptObject _executionContext]):
1980         (-[WebScriptObject _setExecutionContext:]):
1981         (-[WebScriptObject _originExecutionContext]):
1982         (-[WebScriptObject _setOriginExecutionContext:]):
1983         (+[WebScriptObject throwException:]):
1984         (listFromNSArray):
1985         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1986         (-[WebScriptObject evaluateWebScript:]):
1987         (-[WebScriptObject setValue:forKey:]):
1988         (-[WebScriptObject valueForKey:]):
1989         (-[WebScriptObject removeWebScriptKey:]):
1990         (-[WebScriptObject stringRepresentation]):
1991         (-[WebScriptObject webScriptValueAtIndex:]):
1992         (-[WebScriptObject setException:]):
1993         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
1994         * bindings/objc/WebScriptObjectPrivate.h:
1995         * bindings/objc/objc_class.h:
1996         * bindings/objc/objc_class.mm:
1997         (KJS::Bindings::ObjcClass::fallbackObject):
1998         * bindings/objc/objc_instance.h:
1999         * bindings/objc/objc_instance.mm:
2000         (ObjcInstance::invokeMethod):
2001         (ObjcInstance::invokeDefaultMethod):
2002         (ObjcInstance::setValueOfField):
2003         (ObjcInstance::setValueOfUndefinedField):
2004         (ObjcInstance::getValueOfField):
2005         (ObjcInstance::getValueOfUndefinedField):
2006         (ObjcInstance::defaultValue):
2007         (ObjcInstance::stringValue):
2008         (ObjcInstance::numberValue):
2009         (ObjcInstance::booleanValue):
2010         (ObjcInstance::valueOf):
2011         * bindings/objc/objc_runtime.h:
2012         * bindings/objc/objc_runtime.mm:
2013         (ObjcField::valueFromInstance):
2014         (convertValueToObjcObject):
2015         (ObjcField::setValueToInstance):
2016         (ObjcArray::setValueAt):
2017         (ObjcArray::valueAt):
2018         (ObjcFallbackObjectImp::put):
2019         (ObjcFallbackObjectImp::callAsFunction):
2020         (ObjcFallbackObjectImp::defaultValue):
2021         * bindings/objc/objc_utility.h:
2022         * bindings/objc/objc_utility.mm:
2023         (Bindings::JSMethodNameToObjCMethodName):
2024         (Bindings::convertValueToObjcValue):
2025         (Bindings::convertNSStringToString):
2026         (Bindings::convertObjcValueToValue):
2027         (Bindings::objcValueTypeForType):
2028         (Bindings::createObjcInstanceForValue):
2029         * bindings/runtime.cpp:
2030         (Instance::getValueOfField):
2031         (Instance::setValueOfField):
2032         (Instance::createRuntimeObject):
2033         (Instance::createLanguageInstanceForValue):
2034         * bindings/runtime.h:
2035         (KJS::Bindings::Constructor::~Constructor):
2036         (KJS::Bindings::Field::~Field):
2037         (KJS::Bindings::MethodList::MethodList):
2038         (KJS::Bindings::Class::fallbackObject):
2039         (KJS::Bindings::Class::~Class):
2040         (KJS::Bindings::Instance::Instance):
2041         (KJS::Bindings::Instance::getValueOfUndefinedField):
2042         (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
2043         (KJS::Bindings::Instance::setValueOfUndefinedField):
2044         (KJS::Bindings::Instance::valueOf):
2045         (KJS::Bindings::Instance::setExecutionContext):
2046         (KJS::Bindings::Instance::~Instance):
2047         (KJS::Bindings::Array::~Array):
2048         * bindings/runtime_array.cpp:
2049         (RuntimeArrayImp::RuntimeArrayImp):
2050         (RuntimeArrayImp::lengthGetter):
2051         (RuntimeArrayImp::indexGetter):
2052         (RuntimeArrayImp::put):
2053         * bindings/runtime_array.h:
2054         * bindings/runtime_method.cpp:
2055         (RuntimeMethodImp::lengthGetter):
2056         (RuntimeMethodImp::callAsFunction):
2057         * bindings/runtime_method.h:
2058         * bindings/runtime_object.cpp:
2059         (RuntimeObjectImp::fallbackObjectGetter):
2060         (RuntimeObjectImp::fieldGetter):
2061         (RuntimeObjectImp::methodGetter):
2062         (RuntimeObjectImp::getOwnPropertySlot):
2063         (RuntimeObjectImp::put):
2064         (RuntimeObjectImp::defaultValue):
2065         (RuntimeObjectImp::callAsFunction):
2066         * bindings/runtime_object.h:
2067         * kjs/array_instance.h:
2068         * kjs/array_object.cpp:
2069         (ArrayInstanceImp::ArrayInstanceImp):
2070         (ArrayInstanceImp::lengthGetter):
2071         (ArrayInstanceImp::getOwnPropertySlot):
2072         (ArrayInstanceImp::put):
2073         (ArrayInstanceImp::propList):
2074         (ArrayInstanceImp::setLength):
2075         (compareByStringForQSort):
2076         (compareWithCompareFunctionForQSort):
2077         (ArrayInstanceImp::sort):
2078         (ArrayInstanceImp::pushUndefinedObjectsToEnd):
2079         (ArrayPrototypeImp::ArrayPrototypeImp):
2080         (ArrayProtoFuncImp::ArrayProtoFuncImp):
2081         (ArrayProtoFuncImp::callAsFunction):
2082         (ArrayObjectImp::ArrayObjectImp):
2083         (ArrayObjectImp::construct):
2084         (ArrayObjectImp::callAsFunction):
2085         * kjs/array_object.h:
2086         * kjs/bool_object.cpp:
2087         (BooleanPrototypeImp::BooleanPrototypeImp):
2088         (BooleanProtoFuncImp::BooleanProtoFuncImp):
2089         (BooleanProtoFuncImp::callAsFunction):
2090         (BooleanObjectImp::BooleanObjectImp):
2091         (BooleanObjectImp::construct):
2092         (BooleanObjectImp::callAsFunction):
2093         * kjs/bool_object.h:
2094         * kjs/collector.cpp:
2095         (KJS::Collector::markStackObjectsConservatively):
2096         (KJS::Collector::collect):
2097         (KJS::className):
2098         * kjs/completion.h:
2099         (KJS::Completion::Completion):
2100         (KJS::Completion::value):
2101         (KJS::Completion::isValueCompletion):
2102         * kjs/context.h:
2103         (KJS::ContextImp::variableObject):
2104         (KJS::ContextImp::setVariableObject):
2105         (KJS::ContextImp::thisValue):
2106         (KJS::ContextImp::activationObject):
2107         (KJS::ContextImp::pushScope):
2108         * kjs/date_object.cpp:
2109         (formatLocaleDate):
2110         (KJS::timeFromArgs):
2111         (KJS::DatePrototypeImp::DatePrototypeImp):
2112         (KJS::DateProtoFuncImp::DateProtoFuncImp):
2113         (KJS::DateProtoFuncImp::callAsFunction):
2114         (KJS::DateObjectImp::DateObjectImp):
2115         (KJS::DateObjectImp::construct):
2116         (KJS::DateObjectImp::callAsFunction):
2117         (KJS::DateObjectFuncImp::DateObjectFuncImp):
2118         (KJS::DateObjectFuncImp::callAsFunction):
2119         (KJS::parseDate):
2120         (KJS::KRFCDate_parseDate):
2121         (KJS::timeClip):
2122         * kjs/date_object.h:
2123         * kjs/debugger.cpp:
2124         (Debugger::exception):
2125         (Debugger::callEvent):
2126         (Debugger::returnEvent):
2127         * kjs/debugger.h:
2128         * kjs/error_object.cpp:
2129         (ErrorPrototypeImp::ErrorPrototypeImp):
2130         (ErrorProtoFuncImp::ErrorProtoFuncImp):
2131         (ErrorProtoFuncImp::callAsFunction):
2132         (ErrorObjectImp::ErrorObjectImp):
2133         (ErrorObjectImp::construct):
2134         (ErrorObjectImp::callAsFunction):
2135         (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
2136         (NativeErrorImp::NativeErrorImp):
2137         (NativeErrorImp::construct):
2138         (NativeErrorImp::callAsFunction):
2139         * kjs/error_object.h:
2140         * kjs/function.cpp:
2141         (KJS::FunctionImp::FunctionImp):
2142         (KJS::FunctionImp::callAsFunction):
2143         (KJS::FunctionImp::processParameters):
2144         (KJS::FunctionImp::argumentsGetter):
2145         (KJS::FunctionImp::lengthGetter):
2146         (KJS::FunctionImp::put):
2147         (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
2148         (KJS::DeclaredFunctionImp::construct):
2149         (KJS::ArgumentsImp::ArgumentsImp):
2150         (KJS::ArgumentsImp::mappedIndexGetter):
2151         (KJS::ArgumentsImp::put):
2152         (KJS::ActivationImp::argumentsGetter):
2153         (KJS::GlobalFuncImp::GlobalFuncImp):
2154         (KJS::encode):
2155         (KJS::decode):
2156         (KJS::GlobalFuncImp::callAsFunction):
2157         * kjs/function.h:
2158         * kjs/function_object.cpp:
2159         (FunctionPrototypeImp::FunctionPrototypeImp):
2160         (FunctionPrototypeImp::callAsFunction):
2161         (FunctionProtoFuncImp::FunctionProtoFuncImp):
2162         (FunctionProtoFuncImp::callAsFunction):
2163         (FunctionObjectImp::FunctionObjectImp):
2164         (FunctionObjectImp::construct):
2165         (FunctionObjectImp::callAsFunction):
2166         * kjs/function_object.h:
2167         * kjs/internal.cpp:
2168         (KJS::UndefinedImp::toPrimitive):
2169         (KJS::UndefinedImp::toObject):
2170         (KJS::NullImp::toPrimitive):
2171         (KJS::NullImp::toObject):
2172         (KJS::BooleanImp::toPrimitive):
2173         (KJS::BooleanImp::toObject):
2174         (KJS::StringImp::toPrimitive):
2175         (KJS::StringImp::toObject):
2176         (KJS::NumberImp::toPrimitive):
2177         (KJS::NumberImp::toObject):
2178         (KJS::NumberImp::getUInt32):
2179         (KJS::LabelStack::push):
2180         (KJS::ContextImp::ContextImp):
2181         (KJS::InterpreterImp::globalInit):
2182         (KJS::InterpreterImp::globalClear):
2183         (KJS::InterpreterImp::InterpreterImp):
2184         (KJS::InterpreterImp::initGlobalObject):
2185         (KJS::InterpreterImp::clear):
2186         (KJS::InterpreterImp::mark):
2187         (KJS::InterpreterImp::evaluate):
2188         (KJS::InternalFunctionImp::hasInstance):
2189         (KJS::roundValue):
2190         (KJS::printInfo):
2191         * kjs/internal.h:
2192         (KJS::InterpreterImp::builtinObject):
2193         (KJS::InterpreterImp::builtinFunction):
2194         (KJS::InterpreterImp::builtinArray):
2195         (KJS::InterpreterImp::builtinBoolean):
2196         (KJS::InterpreterImp::builtinString):
2197         (KJS::InterpreterImp::builtinNumber):
2198         (KJS::InterpreterImp::builtinDate):
2199         (KJS::InterpreterImp::builtinRegExp):
2200         (KJS::InterpreterImp::builtinError):
2201         (KJS::InterpreterImp::builtinObjectPrototype):
2202         (KJS::InterpreterImp::builtinFunctionPrototype):
2203         (KJS::InterpreterImp::builtinArrayPrototype):
2204         (KJS::InterpreterImp::builtinBooleanPrototype):
2205         (KJS::InterpreterImp::builtinStringPrototype):
2206         (KJS::InterpreterImp::builtinNumberPrototype):
2207         (KJS::InterpreterImp::builtinDatePrototype):
2208         (KJS::InterpreterImp::builtinRegExpPrototype):
2209         (KJS::InterpreterImp::builtinErrorPrototype):
2210         (KJS::InterpreterImp::builtinEvalError):
2211         (KJS::InterpreterImp::builtinRangeError):
2212         (KJS::InterpreterImp::builtinReferenceError):
2213         (KJS::InterpreterImp::builtinSyntaxError):
2214         (KJS::InterpreterImp::builtinTypeError):
2215         (KJS::InterpreterImp::builtinURIError):
2216         (KJS::InterpreterImp::builtinEvalErrorPrototype):
2217         (KJS::InterpreterImp::builtinRangeErrorPrototype):
2218         (KJS::InterpreterImp::builtinReferenceErrorPrototype):
2219         (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
2220         (KJS::InterpreterImp::builtinTypeErrorPrototype):
2221         (KJS::InterpreterImp::builtinURIErrorPrototype):
2222         * kjs/interpreter.cpp:
2223         (Context::variableObject):
2224         (Context::thisValue):
2225         (Interpreter::Interpreter):
2226         (Interpreter::globalObject):
2227         (Interpreter::evaluate):
2228         (Interpreter::builtinObject):
2229         (Interpreter::builtinFunction):
2230         (Interpreter::builtinArray):
2231         (Interpreter::builtinBoolean):
2232         (Interpreter::builtinString):
2233         (Interpreter::builtinNumber):
2234         (Interpreter::builtinDate):
2235         (Interpreter::builtinRegExp):
2236         (Interpreter::builtinError):
2237         (Interpreter::builtinObjectPrototype):
2238         (Interpreter::builtinFunctionPrototype):
2239         (Interpreter::builtinArrayPrototype):
2240         (Interpreter::builtinBooleanPrototype):
2241         (Interpreter::builtinStringPrototype):
2242         (Interpreter::builtinNumberPrototype):
2243         (Interpreter::builtinDatePrototype):
2244         (Interpreter::builtinRegExpPrototype):
2245         (Interpreter::builtinErrorPrototype):
2246         (Interpreter::builtinEvalError):
2247         (Interpreter::builtinRangeError):
2248         (Interpreter::builtinReferenceError):
2249         (Interpreter::builtinSyntaxError):
2250         (Interpreter::builtinTypeError):
2251         (Interpreter::builtinURIError):
2252         (Interpreter::builtinEvalErrorPrototype):
2253         (Interpreter::builtinRangeErrorPrototype):
2254         (Interpreter::builtinReferenceErrorPrototype):
2255         (Interpreter::builtinSyntaxErrorPrototype):
2256         (Interpreter::builtinTypeErrorPrototype):
2257         (Interpreter::builtinURIErrorPrototype):
2258         (Interpreter::createLanguageInstanceForValue):
2259         * kjs/interpreter.h:
2260         (KJS::Interpreter::isGlobalObject):
2261         (KJS::ExecState::setException):
2262         (KJS::ExecState::clearException):
2263         (KJS::ExecState::exception):
2264         (KJS::ExecState::hadException):
2265         (KJS::ExecState::ExecState):
2266         * kjs/list.cpp:
2267         (KJS::List::at):
2268         * kjs/list.h:
2269         (KJS::List::operator[]):
2270         (KJS::ListIterator::operator->):
2271         (KJS::ListIterator::operator*):
2272         (KJS::ListIterator::operator++):
2273         (KJS::ListIterator::operator--):
2274         * kjs/lookup.h:
2275         (KJS::staticFunctionGetter):
2276         (KJS::staticValueGetter):
2277         (KJS::lookupPut):
2278         (KJS::cacheGlobalObject):
2279         * kjs/math_object.cpp:
2280         (MathObjectImp::getValueProperty):
2281         (MathFuncImp::MathFuncImp):
2282         (MathFuncImp::callAsFunction):
2283         * kjs/math_object.h:
2284         * kjs/nodes.cpp:
2285         (Node::evaluateReference):
2286         (Node::throwError):
2287         (Node::setExceptionDetailsIfNeeded):
2288         (NullNode::evaluate):
2289         (BooleanNode::evaluate):
2290         (NumberNode::evaluate):
2291         (StringNode::evaluate):
2292         (RegExpNode::evaluate):
2293         (ThisNode::evaluate):
2294         (ResolveNode::evaluate):
2295         (ResolveNode::evaluateReference):
2296         (GroupNode::evaluate):
2297         (ElementNode::evaluate):
2298         (ArrayNode::evaluate):
2299         (ObjectLiteralNode::evaluate):
2300         (PropertyValueNode::evaluate):
2301         (PropertyNode::evaluate):
2302         (AccessorNode1::evaluate):
2303         (AccessorNode1::evaluateReference):
2304         (AccessorNode2::evaluate):
2305         (AccessorNode2::evaluateReference):
2306         (ArgumentListNode::evaluate):
2307         (ArgumentListNode::evaluateList):
2308         (ArgumentsNode::evaluate):
2309         (NewExprNode::evaluate):
2310         (FunctionCallNode::evaluate):
2311         (PostfixNode::evaluate):
2312         (DeleteNode::evaluate):
2313         (VoidNode::evaluate):
2314         (TypeOfNode::evaluate):
2315         (PrefixNode::evaluate):
2316         (UnaryPlusNode::evaluate):
2317         (NegateNode::evaluate):
2318         (BitwiseNotNode::evaluate):
2319         (LogicalNotNode::evaluate):
2320         (MultNode::evaluate):
2321         (AddNode::evaluate):
2322         (ShiftNode::evaluate):
2323         (RelationalNode::evaluate):
2324         (EqualNode::evaluate):
2325         (BitOperNode::evaluate):
2326         (BinaryLogicalNode::evaluate):
2327         (ConditionalNode::evaluate):
2328         (AssignNode::evaluate):
2329         (CommaNode::evaluate):
2330         (StatListNode::execute):
2331         (AssignExprNode::evaluate):
2332         (VarDeclNode::evaluate):
2333         (VarDeclNode::processVarDecls):
2334         (VarDeclListNode::evaluate):
2335         (ExprStatementNode::execute):
2336         (IfNode::execute):
2337         (DoWhileNode::execute):
2338         (WhileNode::execute):
2339         (ForNode::execute):
2340         (ForInNode::execute):
2341         (ContinueNode::execute):
2342         (BreakNode::execute):
2343         (ReturnNode::execute):
2344         (WithNode::execute):
2345         (CaseClauseNode::evaluate):
2346         (ClauseListNode::evaluate):
2347         (CaseBlockNode::evaluate):
2348         (CaseBlockNode::evalBlock):
2349         (SwitchNode::execute):
2350         (ThrowNode::execute):
2351         (CatchNode::execute):
2352         (TryNode::execute):
2353         (ParameterNode::evaluate):
2354         (FuncDeclNode::processFuncDecl):
2355         (FuncExprNode::evaluate):
2356         (SourceElementsNode::execute):
2357         * kjs/nodes.h:
2358         (KJS::StatementNode::evaluate):
2359         * kjs/number_object.cpp:
2360         (NumberPrototypeImp::NumberPrototypeImp):
2361         (NumberProtoFuncImp::NumberProtoFuncImp):
2362         (NumberProtoFuncImp::callAsFunction):
2363         (NumberObjectImp::NumberObjectImp):
2364         (NumberObjectImp::getValueProperty):
2365         (NumberObjectImp::construct):
2366         (NumberObjectImp::callAsFunction):
2367         * kjs/number_object.h:
2368         * kjs/object.cpp:
2369         (KJS::ObjectImp::call):
2370         (KJS::ObjectImp::mark):
2371         (KJS::ObjectImp::classInfo):
2372         (KJS::ObjectImp::get):
2373         (KJS::ObjectImp::getProperty):
2374         (KJS::ObjectImp::getPropertySlot):
2375         (KJS::ObjectImp::put):
2376         (KJS::ObjectImp::hasOwnProperty):
2377         (KJS::ObjectImp::defaultValue):
2378         (KJS::ObjectImp::findPropertyHashEntry):
2379         (KJS::ObjectImp::construct):
2380         (KJS::ObjectImp::callAsFunction):
2381         (KJS::ObjectImp::hasInstance):
2382         (KJS::ObjectImp::propList):
2383         (KJS::ObjectImp::toPrimitive):
2384         (KJS::ObjectImp::toNumber):
2385         (KJS::ObjectImp::toString):
2386         (KJS::ObjectImp::toObject):
2387         (KJS::ObjectImp::putDirect):
2388         (KJS::Error::create):
2389         (KJS::error):
2390         * kjs/object.h:
2391         (KJS::):
2392         (KJS::ObjectImp::getPropertySlot):
2393         (KJS::AllocatedValueImp::isObject):
2394         (KJS::ObjectImp::ObjectImp):
2395         (KJS::ObjectImp::internalValue):
2396         (KJS::ObjectImp::setInternalValue):
2397         (KJS::ObjectImp::prototype):
2398         (KJS::ObjectImp::setPrototype):
2399         (KJS::ObjectImp::inherits):
2400         * kjs/object_object.cpp:
2401         (ObjectPrototypeImp::ObjectPrototypeImp):
2402         (ObjectProtoFuncImp::ObjectProtoFuncImp):
2403         (ObjectProtoFuncImp::callAsFunction):
2404         (ObjectObjectImp::ObjectObjectImp):
2405         (ObjectObjectImp::construct):
2406         (ObjectObjectImp::callAsFunction):
2407         * kjs/object_object.h:
2408         * kjs/operations.cpp:
2409         (KJS::equal):
2410         (KJS::strictEqual):
2411         (KJS::relation):
2412         (KJS::add):
2413         (KJS::mult):
2414         * kjs/operations.h:
2415         * kjs/property_map.cpp:
2416         (KJS::PropertyMap::mark):
2417         (KJS::PropertyMap::addEnumerablesToReferenceList):
2418         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
2419         (KJS::PropertyMap::save):
2420         (KJS::PropertyMap::restore):
2421         * kjs/property_map.h:
2422         * kjs/property_slot.cpp:
2423         (KJS::PropertySlot::undefinedGetter):
2424         * kjs/property_slot.h:
2425         (KJS::PropertySlot::getValue):
2426         * kjs/protect.h:
2427         (KJS::gcUnprotectNullTolerant):
2428         (KJS::ProtectedValue::ProtectedValue):
2429         (KJS::ProtectedValue::~ProtectedValue):
2430         (KJS::ProtectedValue::operator=):
2431         (KJS::ProtectedValue::operator ValueImp *):
2432         (KJS::ProtectedValue::operator->):
2433         * kjs/protected_object.h:
2434         (KJS::ProtectedObject::ProtectedObject):
2435         (KJS::ProtectedObject::operator=):
2436         (KJS::ProtectedObject::operator ValueImp *):
2437         (KJS::ProtectedObject::operator ObjectImp *):
2438         (KJS::ProtectedObject::operator->):
2439         (KJS::ProtectedReference::ProtectedReference):
2440         (KJS::ProtectedReference::~ProtectedReference):
2441         (KJS::ProtectedReference::operator=):
2442         * kjs/protected_values.cpp:
2443         (KJS::ProtectedValues::getProtectCount):
2444         (KJS::ProtectedValues::increaseProtectCount):
2445         (KJS::ProtectedValues::insert):
2446         (KJS::ProtectedValues::decreaseProtectCount):
2447         * kjs/protected_values.h:
2448         * kjs/reference.cpp:
2449         (KJS::Reference::Reference):
2450         (KJS::Reference::makeValueReference):
2451         (KJS::Reference::getBase):
2452         (KJS::Reference::getValue):
2453         (KJS::Reference::putValue):
2454         (KJS::Reference::deleteValue):
2455         * kjs/reference.h:
2456         (KJS::Reference::baseIfMutable):
2457         * kjs/regexp_object.cpp:
2458         (RegExpPrototypeImp::RegExpPrototypeImp):
2459         (RegExpProtoFuncImp::RegExpProtoFuncImp):
2460         (RegExpProtoFuncImp::callAsFunction):
2461         (RegExpObjectImp::RegExpObjectImp):
2462         (RegExpObjectImp::arrayOfMatches):
2463         (RegExpObjectImp::backrefGetter):
2464         (RegExpObjectImp::construct):
2465         (RegExpObjectImp::callAsFunction):
2466         * kjs/regexp_object.h:
2467         * kjs/string_object.cpp:
2468         (StringInstanceImp::lengthGetter):
2469         (StringInstanceImp::indexGetter):
2470         (StringInstanceImp::getOwnPropertySlot):
2471         (StringInstanceImp::put):
2472         (StringPrototypeImp::StringPrototypeImp):
2473         (StringProtoFuncImp::StringProtoFuncImp):
2474         (regExpIsGlobal):
2475         (replace):
2476         (StringProtoFuncImp::callAsFunction):
2477         (StringObjectImp::StringObjectImp):
2478         (StringObjectImp::construct):
2479         (StringObjectImp::callAsFunction):
2480         (StringObjectFuncImp::StringObjectFuncImp):
2481         (StringObjectFuncImp::callAsFunction):
2482         * kjs/string_object.h:
2483         * kjs/testkjs.cpp:
2484         (TestFunctionImp::callAsFunction):
2485         (VersionFunctionImp::callAsFunction):
2486         (main):
2487         * kjs/value.cpp:
2488         (KJS::AllocatedValueImp::operator new):
2489         (KJS::AllocatedValueImp::getUInt32):
2490         (KJS::ValueImp::toInteger):
2491         (KJS::ValueImp::toInt32):
2492         (KJS::ValueImp::toUInt32):
2493         (KJS::ValueImp::toUInt16):
2494         (KJS::ValueImp::toObject):
2495         (KJS::AllocatedValueImp::getBoolean):
2496         (KJS::AllocatedValueImp::getNumber):
2497         (KJS::AllocatedValueImp::getString):
2498         (KJS::AllocatedValueImp::getObject):
2499         (KJS::jsString):
2500         (KJS::jsNumber):
2501         (KJS::ConstantValues::init):
2502         (KJS::ConstantValues::clear):
2503         (KJS::ConstantValues::mark):
2504         * kjs/value.h:
2505         (KJS::):
2506         (KJS::jsUndefined):
2507         (KJS::jsNull):
2508         (KJS::jsBoolean):
2509         (KJS::jsNaN):
2510         (KJS::ValueImp::ValueImp):
2511         (KJS::ValueImp::~ValueImp):
2512         (KJS::AllocatedValueImp::AllocatedValueImp):
2513         (KJS::AllocatedValueImp::~AllocatedValueImp):
2514         (KJS::AllocatedValueImp::isBoolean):
2515         (KJS::AllocatedValueImp::isNumber):
2516         (KJS::AllocatedValueImp::isString):
2517         (KJS::AllocatedValueImp::isObject):
2518         (KJS::AllocatedValueImp::marked):
2519         (KJS::AllocatedValueImp::mark):
2520         (KJS::ValueImp::downcast):
2521         (KJS::ValueImp::isUndefined):
2522         (KJS::ValueImp::isNull):
2523         (KJS::ValueImp::isUndefinedOrNull):
2524         (KJS::ValueImp::isBoolean):
2525         (KJS::ValueImp::isNumber):
2526         (KJS::ValueImp::isString):
2527         (KJS::ValueImp::isObject):
2528         (KJS::ValueImp::getBoolean):
2529         (KJS::ValueImp::getNumber):
2530         (KJS::ValueImp::getString):
2531         (KJS::ValueImp::getObject):
2532         (KJS::ValueImp::getUInt32):
2533         (KJS::ValueImp::mark):
2534         (KJS::ValueImp::marked):
2535         (KJS::ValueImp::type):
2536         (KJS::ValueImp::toPrimitive):
2537         (KJS::ValueImp::toBoolean):
2538         (KJS::ValueImp::toNumber):
2539         (KJS::ValueImp::toString):
2540         (KJS::jsZero):
2541         (KJS::jsOne):
2542         (KJS::jsTwo):
2543         (KJS::Undefined):
2544         (KJS::Null):
2545         (KJS::Boolean):
2546         (KJS::Number):
2547         (KJS::String):
2548
2549 2005-08-06  Maciej Stachowiak  <mjs@apple.com>
2550
2551         Reviewed by Darin.
2552
2553         Change over to the new PropertySlot mechanism for property
2554         lookup. This allows the elimination of hasOwnProperty
2555         methods. Also did some of the performance tuning enabled by this
2556         (but not yet all the possible improvements for function calls,
2557         assignment, ++, and so forth). And also much code cleanup.
2558
2559         Net result is about a 2% speedup on the JS iBench.
2560         
2561         Also redid Geoff's fix for the chrashing applet by avoiding a NULL
2562         prototype in the bindings code and using the default of Null()
2563         instead.
2564         
2565         * JavaScriptCore.xcodeproj/project.pbxproj:
2566         * bindings/objc/objc_runtime.h:
2567         * bindings/objc/objc_runtime.mm:
2568         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2569         (ObjcFallbackObjectImp::getOwnPropertySlot):
2570         * bindings/runtime_array.cpp:
2571         (RuntimeArrayImp::lengthGetter):
2572         (RuntimeArrayImp::indexGetter):
2573         (RuntimeArrayImp::getOwnPropertySlot):
2574         * bindings/runtime_array.h:
2575         * bindings/runtime_method.cpp:
2576         (RuntimeMethodImp::lengthGetter):
2577         (RuntimeMethodImp::getOwnPropertySlot):
2578         * bindings/runtime_method.h:
2579         * bindings/runtime_object.cpp:
2580         (RuntimeObjectImp::RuntimeObjectImp):
2581         (RuntimeObjectImp::fallbackObjectGetter):
2582         (RuntimeObjectImp::fieldGetter):
2583         (RuntimeObjectImp::methodGetter):
2584         (RuntimeObjectImp::getOwnPropertySlot):
2585         * bindings/runtime_object.h:
2586         * bindings/runtime_root.h:
2587         * kjs/array_instance.h:
2588         * kjs/array_object.cpp:
2589         (ArrayInstanceImp::lengthGetter):
2590         (ArrayInstanceImp::getOwnPropertySlot):
2591         (ArrayPrototypeImp::getOwnPropertySlot):
2592         * kjs/array_object.h:
2593         * kjs/date_object.cpp:
2594         (DatePrototypeImp::getOwnPropertySlot):
2595         * kjs/date_object.h:
2596         * kjs/function.cpp:
2597         (KJS::FunctionImp::argumentsGetter):
2598         (KJS::FunctionImp::lengthGetter):
2599         (KJS::FunctionImp::getOwnPropertySlot):
2600         (KJS::FunctionImp::put):
2601         (KJS::FunctionImp::deleteProperty):
2602         (KJS::ArgumentsImp::mappedIndexGetter):
2603         (KJS::ArgumentsImp::getOwnPropertySlot):
2604         (KJS::ActivationImp::argumentsGetter):
2605         (KJS::ActivationImp::getArgumentsGetter):
2606         (KJS::ActivationImp::getOwnPropertySlot):
2607         (KJS::ActivationImp::deleteProperty):
2608         * kjs/function.h:
2609         * kjs/internal.cpp:
2610         (InterpreterImp::InterpreterImp):
2611         (InterpreterImp::initGlobalObject):
2612         (InterpreterImp::~InterpreterImp):
2613         (InterpreterImp::evaluate):
2614         * kjs/internal.h:
2615         (KJS::InterpreterImp::globalExec):
2616         * kjs/interpreter.cpp:
2617         (Interpreter::Interpreter):
2618         (Interpreter::createLanguageInstanceForValue):
2619         * kjs/interpreter.h:
2620         (KJS::Interpreter::argumentsIdentifier):
2621         (KJS::Interpreter::specialPrototypeIdentifier):
2622         * kjs/lookup.h:
2623         (KJS::staticFunctionGetter):
2624         (KJS::staticValueGetter):
2625         (KJS::getStaticPropertySlot):
2626         (KJS::getStaticFunctionSlot):
2627         (KJS::getStaticValueSlot):
2628         * kjs/math_object.cpp:
2629         (MathObjectImp::getOwnPropertySlot):
2630         * kjs/math_object.h:
2631         * kjs/nodes.cpp:
2632         (ResolveNode::evaluate):
2633         (ResolveNode::evaluateReference):
2634         (AccessorNode1::evaluate):
2635         (AccessorNode2::evaluate):
2636         * kjs/number_object.cpp:
2637         (NumberObjectImp::getOwnPropertySlot):
2638         * kjs/number_object.h:
2639         * kjs/object.cpp:
2640         (KJS::ObjectImp::get):
2641         (KJS::ObjectImp::getProperty):
2642         (KJS::ObjectImp::getPropertySlot):
2643         (KJS::ObjectImp::getOwnPropertySlot):
2644         (KJS::ObjectImp::put):
2645         (KJS::ObjectImp::hasProperty):
2646         (KJS::ObjectImp::hasOwnProperty):
2647         * kjs/object.h:
2648         (KJS::ObjectImp::getDirectLocation):
2649         (KJS::ObjectImp::getPropertySlot):
2650         (KJS::ObjectImp::getOwnPropertySlot):
2651         * kjs/object_wrapper.h: Added.
2652         (KJS::):
2653         (KJS::Object::Object):
2654         (KJS::Object::operator ObjectImp *):
2655         * kjs/property_map.cpp:
2656         (KJS::PropertyMap::getLocation):
2657         * kjs/property_map.h:
2658         * kjs/property_slot.cpp: Added.
2659         (KJS::PropertySlot::undefinedGetter):
2660         * kjs/property_slot.h: Added.
2661         (KJS::PropertySlot::isSet):
2662         (KJS::PropertySlot::getValue):
2663         (KJS::PropertySlot::setValueSlot):
2664         (KJS::PropertySlot::setStaticEntry):
2665         (KJS::PropertySlot::setCustom):
2666         (KJS::PropertySlot::setCustomIndex):
2667         (KJS::PropertySlot::setUndefined):
2668         (KJS::PropertySlot::slotBase):
2669         (KJS::PropertySlot::staticEntry):
2670         (KJS::PropertySlot::index):
2671         (KJS::PropertySlot::):
2672         * kjs/protect.h:
2673         * kjs/protected_object.h: Added.
2674         (KJS::ProtectedObject::ProtectedObject):
2675         (KJS::ProtectedObject::~ProtectedObject):
2676         (KJS::ProtectedObject::operator=):
2677         (KJS::ProtectedReference::ProtectedReference):
2678         (KJS::ProtectedReference::~ProtectedReference):
2679         (KJS::ProtectedReference::operator=):
2680         * kjs/reference.h:
2681         * kjs/reference_list.cpp:
2682         * kjs/regexp_object.cpp:
2683         (RegExpObjectImp::backrefGetter):
2684         (RegExpObjectImp::getOwnPropertySlot):
2685         * kjs/regexp_object.h:
2686         * kjs/string_object.cpp:
2687         (StringInstanceImp::lengthGetter):
2688         (StringInstanceImp::indexGetter):
2689         (StringInstanceImp::getOwnPropertySlot):
2690         (StringPrototypeImp::getOwnPropertySlot):
2691         * kjs/string_object.h:
2692
2693 2005-08-05  Adele Peterson  <adele@apple.com>
2694
2695         Reviewed by Darin.
2696
2697         * JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
2698
2699 2005-08-05  Geoffrey Garen  <ggaren@apple.com>
2700
2701         -fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs 
2702         after clicking on Hangman applet
2703
2704         Reviewed by darin.
2705
2706         * kjs/object.cpp:
2707         (KJS::ObjectImp::hasProperty): added check for null prototype.
2708
2709         FIXME: The long-term plan is to make runtime objects use JS Null()
2710         instead of null pointers, which will allow us to eliminate null
2711         checks, improving performance.
2712
2713 2005-08-05  Geoffrey Garen  <ggaren@apple.com>
2714
2715         Fix by darin, reviewed by me.
2716         
2717         - rolled in fix for: <rdar://problem/4161606> JavaScript regular 
2718         expressions with certain ranges of Unicode characters cause a crash
2719
2720         Test cases added:
2721
2722         * layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
2723         * layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
2724
2725         * pcre/pcre.c:
2726         (compile_branch): added checks for characters > 255
2727
2728 2005-08-04  Maciej Stachowiak  <mjs@apple.com>
2729
2730         - updated expected test results now that we no longer exlude the
2731         date tests (apparently this was overlooked)
2732
2733         * tests/mozilla/expected.html:
2734
2735 2005-07-31  Darin Adler  <darin@apple.com>
2736
2737         Reviewed by Maciej.
2738
2739         - remove uses of Mac-OS-X-specific MAX macro
2740         - remove one of the many excess "APPLE_CHANGES" ifdefs
2741
2742         * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
2743         * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
2744         * kjs/ustring.cpp:
2745         (KJS::UChar::toLower): Take out non-ICU code path.
2746         (KJS::UChar::toUpper): Ditto.
2747         (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
2748
2749 2005-07-27  Geoffrey Garen  <ggaren@apple.com>
2750
2751         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4147
2752         Array.toString() and toLocaleString() improvements from KDE KJS
2753         (rolled in KDE changes)
2754
2755         Test cases added:
2756
2757         * layout-tests/fast/js/toString-overrides-expected.txt: Added.
2758         * layout-tests/fast/js/toString-overrides.html: Added.
2759         
2760         * kjs/array_object.cpp:
2761         (ArrayProtoFuncImp::call):
2762
2763 2005-07-27  Maciej Stachowiak  <mjs@apple.com>
2764
2765         Changes by Michael Kahl, reviewed by me.
2766
2767         - fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
2768         
2769         * JavaScriptCore.xcodeproj/project.pbxproj:
2770         * kjs/debugger.cpp:
2771         (KJS::AttachedInterpreter::AttachedInterpreter):
2772         (KJS::AttachedInterpreter::~AttachedInterpreter):
2773         (Debugger::~Debugger):
2774         (Debugger::attach):
2775         (Debugger::detach):
2776         (Debugger::sourceParsed):
2777         * kjs/debugger.h:
2778         * kjs/function.cpp:
2779         (KJS::FunctionImp::call):
2780         (KJS::GlobalFuncImp::call):
2781         * kjs/function_object.cpp:
2782         (FunctionObjectImp::construct):
2783         * kjs/grammar.y:
2784         * kjs/internal.cpp:
2785         (Parser::parse):
2786         (InterpreterImp::evaluate):
2787         * kjs/internal.h:
2788         (KJS::InterpreterImp::setDebugger):
2789         * kjs/interpreter.cpp:
2790         * kjs/interpreter.h:
2791         (KJS::Interpreter::imp):
2792         * kjs/nodes.cpp:
2793
2794 2005-07-27  Geoffrey Garen  <ggaren@apple.com>
2795
2796         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3381
2797         Date.prototype.setDate() incorrect for values >=128
2798         
2799         - Test cases added:
2800
2801         * layout-tests/fast/js/date-big-setdate-expected.txt: Added.
2802         * layout-tests/fast/js/date-big-setdate.html: Added.
2803
2804         Reviewed by darin.
2805
2806         * kjs/date_object.cpp:
2807         (DateProtoFuncImp::call):
2808
2809 2005-07-27  Geoffrey Garen  <ggaren@apple.com>
2810
2811         -rolled in patch by Carsten Guenther <cguenther@gmail.com>
2812         for http://bugzilla.opendarwin.org/show_bug.cgi?id=3759
2813         Date object enhancements
2814         
2815         Test cases added:
2816
2817         * layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
2818         * layout-tests/fast/js/date-preserve-milliseconds.html: Added.
2819
2820         Reviewed by darin.
2821
2822         * kjs/date_object.cpp:
2823         (timeFromArgs):
2824         (DateProtoFuncImp::call):
2825         (DateObjectImp::construct):
2826         (DateObjectFuncImp::call):
2827         (KJS::makeTime):
2828         * kjs/date_object.h:
2829         * tests/mozilla/expected.html:
2830
2831 2005-07-26  Justin Garcia  <justin.garcia@apple.com>
2832
2833         Added a forward declaration to fix gcc4 build error
2834
2835         * kjs/function.h:
2836
2837 2005-07-25  Geoffrey Garen  <ggaren@apple.com>
2838         - fixed mistake in my last checkin -- the expected results included
2839         results from a patch that hasn't landed yet.
2840         
2841         * tests/mozilla/expected.html:
2842
2843 2005-07-25  Maciej Stachowiak  <mjs@apple.com>
2844
2845         - fix mistake in last change that leads to assertion failure in the Development build
2846
2847         * kjs/lookup.h:
2848         (KJS::lookupGetOwnValue):
2849
2850 2005-07-24  Maciej Stachowiak  <mjs@apple.com>
2851
2852         Reviewed by Darin.
2853
2854         - http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
2855         (change JavaScript property access to avoid double lookup)
2856
2857         - 10% speedup on JavaScript iBench
2858         - 5% speedup on 24fun BenchJS benchmark
2859
2860         Changed all get methods to getOwnProperty - they are no longer
2861         responsible for prototype lookup, and determine if the property
2862         was found as a side efect. 
2863
2864         get() is now a nonvirtual ObjectImp method which calls the virtual
2865         getOwnProperty and walks the prototype chain. A few selected
2866         methods were inlined.
2867
2868         Changed ResolveNode::evaluate plus some other places to use
2869         getProperty which does get() and hasProperty() in one lookup.
2870
2871         Also miscellaneous code cleanup.
2872         
2873         * bindings/objc/objc_runtime.h:
2874         * bindings/objc/objc_runtime.mm:
2875         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2876         (ObjcFallbackObjectImp::getOwnProperty):
2877         * bindings/runtime_array.cpp:
2878         (RuntimeArrayImp::RuntimeArrayImp):
2879         (RuntimeArrayImp::getOwnProperty):
2880         * bindings/runtime_array.h:
2881         * bindings/runtime_method.cpp:
2882         (RuntimeMethodImp::getOwnProperty):
2883         * bindings/runtime_method.h:
2884         * bindings/runtime_object.cpp:
2885         (RuntimeObjectImp::getOwnProperty):
2886         * bindings/runtime_object.h:
2887         * kjs/array_instance.h:
2888         * kjs/array_object.cpp:
2889         (ArrayInstanceImp::getOwnProperty):
2890         (ArrayPrototypeImp::getOwnProperty):
2891         (ArrayProtoFuncImp::call):
2892         * kjs/array_object.h:
2893         * kjs/date_object.cpp:
2894         (DatePrototypeImp::getOwnProperty):
2895         * kjs/date_object.h:
2896         * kjs/function.cpp:
2897         (KJS::FunctionImp::getOwnProperty):
2898         (KJS::ArgumentsImp::getOwnProperty):
2899         (KJS::ActivationImp::getOwnProperty):
2900         * kjs/function.h:
2901         * kjs/lookup.h:
2902         (KJS::lookupGetOwnProperty):
2903         (KJS::lookupGetOwnFunction):
2904         (KJS::lookupGetOwnValue):
2905         * kjs/math_object.cpp:
2906         (MathObjectImp::getOwnProperty):
2907         (MathObjectImp::getValueProperty):
2908         * kjs/math_object.h:
2909         * kjs/nodes.cpp:
2910         (ResolveNode::evaluate):
2911         * kjs/number_object.cpp:
2912         (NumberObjectImp::getOwnProperty):
2913         * kjs/number_object.h:
2914         * kjs/object.cpp:
2915         (KJS::ObjectImp::get):
2916         (KJS::ObjectImp::getOwnProperty):
2917         (KJS::ObjectImp::getProperty):
2918         * kjs/object.h:
2919         (KJS::ObjectImp::getProperty):
2920         (KJS::ObjectImp::getOwnProperty):
2921         * kjs/object_object.cpp:
2922         (ObjectProtoFuncImp::call):
2923         * kjs/regexp_object.cpp:
2924         (RegExpObjectImp::getOwnProperty):
2925         * kjs/regexp_object.h:
2926         * kjs/string_object.cpp:
2927         (StringInstanceImp::getOwnProperty):
2928         (StringPrototypeImp::getOwnProperty):
2929         * kjs/string_object.h:
2930
2931 2005-07-25  Geoffrey Garen  <ggaren@apple.com>
2932
2933         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3971
2934         JS test suite depends on JS 1.2 behavior
2935         
2936         Reviewed by darin.
2937
2938         * tests/mozilla/js1_2/Array/tostring_1.js: now tests only for JS 1.5 behavior
2939         * tests/mozilla/js1_2/Array/tostring_2.js: ditto
2940         * tests/mozilla/expected.html:
2941
2942 2005-07-24  Justin Garcia  <justin.garcia@apple.com>
2943
2944         Reviewed by kevin.
2945
2946         Fixes make clean problem introduced in xcode2.1 transition
2947
2948         * Makefile.am:
2949
2950 2005-07-22  Geoffrey Garen  <ggaren@apple.com>
2951
2952         Reviewed by darin.
2953
2954         * kjs/date_object.cpp: DatePrototypeImp now identifies itself as a
2955         child class of DateInstanceImp -- this enables calls to Date.ValueOf().
2956         
2957         fixes: ecma/Date/15.9.5.js (once we enable the date tests).
2958
2959 2005-07-22  Geoffrey Garen  <ggaren@apple.com>
2960
2961         
2962         Reviewed by darin.
2963
2964         * tests/mozilla/jsDriver.pl: now takes the path to testkjs as a command-line argument
2965         * tests/mozilla/run-mozilla-tests: Removed.
2966
2967 2005-07-21  Geoffrey Garen  <ggaren@apple.com>
2968
2969         * JavaScriptCore.xcodeproj/.cvsignore: Added.
2970
2971 2005-07-21  Geoffrey Garen  <ggaren@apple.com>
2972
2973         * JavaScriptCore.pbproj/project.pbxproj: Removed.
2974         * JavaScriptCore.xcodeproj/ggaren.pbxuser: Added.
2975         * JavaScriptCore.xcodeproj/ggaren.perspective: Added.
2976         * JavaScriptCore.xcodeproj/project.pbxproj: Added.
2977         * Makefile.am:
2978
2979 2005-07-20  Maciej Stachowiak  <mjs@apple.com>
2980
2981         Patch from Trey Matteson <trey@usa.net>, reviewed by me.
2982
2983         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3956
2984         some of WebKit builds with symbols, some doesn't
2985         
2986         * JavaScriptCore.pbproj/project.pbxproj: Generate symbols even for
2987         Deployment.
2988
2989 2005-07-19  Geoffrey Garen  <ggaren@apple.com>
2990
2991         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3991
2992         JSC doesn't implement Array.prototype.toLocaleString()
2993
2994         -test failure: ecma_3/Array/15.4.4.3-1.js
2995
2996         Reviewed by mjs.
2997
2998         * kjs/array_object.cpp:
2999         (ArrayProtoFuncImp::call): now searches for toString and
3000         toLocaleString overrides in the array's elements
3001
3002         * tests/mozilla/expected.html: failures are under 100! woohoo!
3003
3004 2005-07-19  Darin Adler  <darin@apple.com>
3005
3006         - fixed the build
3007
3008         * kjs/lookup.h: (KJS::lookupPut): Remove bogus const; was preventing WebCore from
3009         compiling (not sure why this didn't affect my other build machine).
3010
3011         - one other tiny tweak (so sue me)
3012
3013         * bindings/runtime_root.cpp: Remove unneeded declaration.
3014
3015 2005-07-19  Darin Adler  <darin@apple.com>
3016
3017         Reviewed by Geoff Garen.
3018
3019         - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
3020
3021         * kjs/lookup.h: Changed tryCall in IMPLEMENT_PROTOFUNC here to call. It doesn't make
3022         sense for this macro to use the name tryCall anyway, since that's specific to how
3023         WebCore used this, so this is good anyway. On the other hand, it might be a problem
3024         for KDOM or KSVG, in which case we'll need another macro for them, since JavaScriptCore
3025         should presumably not have the C++ exception support.
3026
3027 2005-07-18  Geoffrey Garen  <ggaren@apple.com>
3028
3029         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4008
3030         Error objects report incorrect length
3031         
3032         Reviewed by darin.
3033
3034         * kjs/error_object.cpp: Error objects now include a length property
3035         (ErrorObjectImp::ErrorObjectImp):
3036
3037         * tests/mozilla/expected.html: updated expected results to reflect fix
3038         * tests/mozilla/js1_5/Exceptions/regress-123002.js: test now expects 
3039         ecma compliant results
3040
3041 2005-07-15  Geoffrey Garen  <ggaren@apple.com>
3042
3043         -rolled in KDE fixes for http://bugzilla.opendarwin.org/show_bug.cgi?id=3601
3044         Error instance type info
3045         
3046         Reviewed by mjs.
3047
3048         * kjs/error_object.cpp:
3049         - Created ErrorInstanceImp class for Error() objects. 
3050         - Changed parent object for Native Errors to "Function" (matches
3051         ECMA spec).
3052         (ErrorInstanceImp::ErrorInstanceImp):
3053         (ErrorProtoFuncImp::call):
3054         (ErrorObjectImp::construct):
3055         (NativeErrorImp::construct):
3056
3057         * kjs/error_object.h:
3058         (KJS::ErrorInstanceImp::classInfo):
3059         * kjs/object.h: made comment more informative about ClassInfo
3060
3061         * tests/mozilla/expected.html:
3062
3063 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
3064
3065         - fixed: JS test suite expects an out of memory error
3066         that our memory efficiency avoids
3067         
3068         Reviewed by mjs.
3069
3070         * tests/mozilla/js1_5/Array/regress-157652.js:
3071         test now expects normal execution
3072         
3073         * tests/mozilla/expected.html:
3074
3075 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
3076         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4006
3077         testkjs doesn't implement gc()
3078         
3079         - test failure:
3080         ecma_3/Function/regress-104584.js
3081         
3082         Reviewed by mjs.
3083
3084         * kjs/interpreter.cpp:
3085         (Interpreter::finalCheck): removed misleading while && comment
3086
3087         * kjs/testkjs.cpp: added "gc" function to global object
3088         (TestFunctionImp::):
3089         (TestFunctionImp::call):
3090         (main):
3091
3092         * tests/mozilla/expected.html:
3093
3094 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
3095
3096         -rolled in patches for http://bugzilla.opendarwin.org/show_bug.cgi?id=3945
3097         [PATCH] Safe merges of comments and other trivialities from KDE's kjs
3098         
3099         -patch by Martijn Klingens <klingens@kde.org>
3100         
3101         * kjs/array_instance.h:
3102         * kjs/array_object.cpp:
3103         * kjs/array_object.h:
3104         * kjs/bool_object.cpp:
3105         * kjs/bool_object.h:
3106         * kjs/collector.cpp:
3107         * kjs/collector.h:
3108         * kjs/completion.h:
3109         * kjs/context.h:
3110         * kjs/date_object.cpp:
3111         * kjs/date_object.h:
3112         * kjs/debugger.cpp:
3113         * kjs/debugger.h:
3114         * kjs/dtoa.h:
3115         * kjs/error_object.cpp:
3116         * kjs/error_object.h:
3117         * kjs/function.cpp:
3118         * kjs/function.h:
3119         * kjs/function_object.cpp:
3120         * kjs/function_object.h:
3121         * kjs/grammar.y:
3122         * kjs/identifier.cpp:
3123         * kjs/identifier.h:
3124         * kjs/internal.cpp:
3125         * kjs/internal.h:
3126         * kjs/interpreter.cpp:
3127         * kjs/interpreter.h:
3128         * kjs/interpreter_map.cpp:
3129         * kjs/interpreter_map.h:
3130         * kjs/lexer.cpp:
3131         * kjs/lexer.h:
3132         * kjs/list.cpp:
3133         * kjs/list.h:
3134         * kjs/lookup.cpp:
3135         * kjs/lookup.h:
3136         * kjs/math_object.cpp:
3137         * kjs/math_object.h:
3138         * kjs/nodes.cpp:
3139         * kjs/nodes.h:
3140         * kjs/nodes2string.cpp:
3141         * kjs/number_object.cpp:
3142         * kjs/number_object.h:
3143         * kjs/object.cpp:
3144         * kjs/object.h:
3145         * kjs/object_object.cpp:
3146         * kjs/object_object.h:
3147         * kjs/operations.cpp:
3148         * kjs/operations.h:
3149         * kjs/property_map.cpp:
3150         * kjs/property_map.h:
3151         * kjs/reference.cpp:
3152         * kjs/reference.h:
3153         * kjs/reference_list.cpp:
3154         * kjs/reference_list.h:
3155         * kjs/regexp.cpp:
3156         * kjs/regexp.h:
3157         * kjs/regexp_object.cpp:
3158         * kjs/regexp_object.h:
3159         * kjs/scope_chain.cpp:
3160         * kjs/scope_chain.h:
3161         * kjs/simple_number.h:
3162         * kjs/string_object.cpp:
3163         * kjs/string_object.h:
3164         * kjs/testkjs.cpp:
3165         * kjs/types.h:
3166         * kjs/ustring.cpp:
3167         * kjs/ustring.h:
3168         * kjs/value.cpp:
3169         * kjs/value.h:
3170
3171 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
3172
3173         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
3174         throw statements fail inside eval statements
3175         
3176         Reviewed by mjs.
3177
3178         * kjs/function.cpp:
3179         (KJS::GlobalFuncImp::call):
3180         Big change since I fixed the tabbing. The important part is:
3181         if (c.complType() == Throw)
3182           exec->setException(c.value());
3183
3184         * kjs/nodes.cpp:
3185         (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
3186         (TryNode::execute): 
3187         try now clears the exception state before the finally block executes,
3188         and checks the state after the block executes, so that exceptions in
3189         finally code get caught.
3190
3191         * tests/mozilla/expected.html:
3192
3193 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
3194         
3195         -landed fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3412
3196         Object.prototype is missing toLocaleString
3197
3198         - patch by Mark Rowe (bdash) <opendarwin.org@bdash.net.nz>
3199         
3200         -layout test info in webcore changelog
3201
3202         Reviewed by mjs.
3203
3204         * kjs/object_object.cpp:
3205         (ObjectPrototypeImp::ObjectPrototypeImp):
3206         (ObjectProtoFuncImp::call):
3207         * kjs/object_object.h:
3208         (KJS::ObjectProtoFuncImp::):
3209
3210 2005-07-12  Geoffrey Garen  <ggaren@apple.com>
3211
3212         Reviewed by mjs.
3213
3214         * kjs/function.cpp:
3215         (KJS::IndexToNameMap::operator[]): fixed infinite recursion
3216         bug in last checkin
3217
3218 2005-07-12  Geoffrey Garen  <ggaren@apple.com>
3219
3220         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3881
3221         arguments object should share values with function parameters
3222
3223         Reviewed by mjs.
3224
3225         ArgumentsImp now uses a simple hash lookup to share values
3226         with the activation object.
3227
3228         * kjs/function.cpp:
3229         (KJS::FunctionImp::getParameterName):
3230         (KJS::IndexToNameMap::IndexToNameMap):
3231         (KJS::IndexToNameMap::~IndexToNameMap):
3232         (KJS::IndexToNameMap::isMapped):
3233         (KJS::IndexToNameMap::unMap):
3234         (KJS::IndexToNameMap::operator[]):
3235         (KJS::ArgumentsImp::ArgumentsImp):
3236         (KJS::ArgumentsImp::mark):
3237         (KJS::ArgumentsImp::get):
3238         (KJS::ArgumentsImp::put):
3239         (KJS::ArgumentsImp::deleteProperty):
3240         (KJS::ArgumentsImp::hasOwnProperty):
3241         (KJS::ActivationImp::createArgumentsObject):
3242         * kjs/function.h:
3243         * tests/mozilla/expected.html: updated results
3244
3245 2005-07-09  Maciej Stachowiak  <mjs@apple.com>
3246
3247         - backing out my earlier collector change, it causes a performance regression in TOT
3248
3249         * kjs/collector.cpp:
3250         (KJS::Collector::allocate):
3251
3252 2005-07-08  Eric Seidel  <eseidel@apple.com>
3253
3254         Reviewed by mjs/hyatt (only in concept).
3255
3256         * JavaScriptCore.pbproj/project.pbxproj: Added JavaScriptCore+SVG
3257         Turns on RTTI support for JavaScriptCore.framework when
3258         building the JavaScriptCore+SVG target.  This is needed as
3259         kdom (part of WebCore+SVG) requires RTTI for the time being.
3260
3261 2005-07-08  Maciej Stachowiak  <mjs@apple.com>
3262
3263         Reviewed by hyatt.
3264
3265         - When there are many live objects, GC less often, to try to make
3266         GC cost proportional to garbage, not proportional to total memory used.
3267
3268         * kjs/collector.cpp:
3269         (KJS::Collector::allocate):
3270
3271 2005-07-08  Vicki Murley  <vicki@apple.com>
3272
3273         Fix from Carsten Guenther, reviewed by Maciej
3274
3275         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3644 (Error string representation)
3276
3277         Switch from "-" to ":" in error strings.
3278
3279         * kjs/error_object.cpp:
3280         (ErrorProtoFuncImp::call):
3281         * tests/mozilla/expected.html:
3282
3283 2005-07-08  Geoffrey Garen  <ggaren@apple.com>
3284
3285         -rolled in patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=3878
3286         arguments object should be an object not an array
3287
3288         Reviewed by mjs.
3289
3290         * kjs/function.cpp:
3291         (KJS::ArgumentsImp::ArgumentsImp): now manually handles initialization
3292         we used to get for free by inheriting from ArrayInstanceImp
3293         * kjs/function.h: ArgumentsImp now inherits from ObjectImp
3294         * tests/mozilla/expected.html: updated expected test results
3295
3296 2005-07-07  Eric Seidel  <eseidel@apple.com>
3297
3298         Reviewed by mjs.
3299
3300         * kjs/grammar.y: removed #define YYMAXDEPTH 0 for bison 2.0
3301         http://bugzilla.opendarwin.org/show_bug.cgi?id=3882
3302
3303 2005-07-03  Maciej Stachowiak  <mjs@apple.com>
3304
3305         Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
3306         Fixes to patch by me, reviewed by John Sullivan.
3307
3308         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
3309
3310         Test cases added:
3311         * tests/mozilla/expected.html: Two tests newly pass.
3312
3313         * bindings/objc/objc_runtime.h:
3314         * bindings/objc/objc_runtime.mm:
3315         (ObjcFallbackObjectImp::hasOwnProperty):
3316         * bindings/runtime_array.cpp:
3317         (RuntimeArrayImp::hasOwnProperty):
3318         * bindings/runtime_array.h:
3319         * bindings/runtime_object.cpp:
3320         (RuntimeObjectImp::hasOwnProperty):
3321         * bindings/runtime_object.h:
3322         * kjs/array_instance.h:
3323         * kjs/array_object.cpp:
3324         (ArrayInstanceImp::hasOwnProperty):
3325         * kjs/function.cpp:
3326         (KJS::FunctionImp::hasOwnProperty):
3327         (KJS::ActivationImp::hasOwnProperty):
3328         * kjs/function.h:
3329         * kjs/lookup.h:
3330         * kjs/object.cpp:
3331         (KJS::ObjectImp::hasProperty):
3332         (KJS::ObjectImp::hasOwnProperty):
3333         * kjs/object.h:
3334         (KJS::Object::hasOwnProperty):
3335         * kjs/object_object.cpp:
3336         (ObjectPrototypeImp::ObjectPrototypeImp):
3337         (ObjectProtoFuncImp::call):
3338         * kjs/object_object.h:
3339         (KJS::ObjectProtoFuncImp::):
3340         * kjs/string_object.cpp:
3341         (StringInstanceImp::hasOwnProperty):
3342         * kjs/string_object.h:
3343
3344 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
3345
3346         -landed patch by Eric Seidel <macdome@opendarwin.org>
3347         
3348         -for http://bugzilla.opendarwin.org/show_bug.cgi?id=3657
3349         GroundWork:  Moving some functions from khtml->jsc following kjs TOT
3350         
3351         - no layout test necessary yet - only groundwork
3352
3353         Reviewed by darin.
3354
3355         * kjs/lookup.h:
3356         (KJS::cacheGlobalObject):
3357
3358 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
3359
3360         -landed patch by Carsten Guenther <cguenther@gmail.com>
3361
3362         -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
3363         some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
3364
3365         -relevant tests:
3366                mozilla/ecma_3/Date/15.9.5.5.js 
3367                layout-tests/fast/js/date-parse-test.html
3368
3369         Reviewed by darin.
3370
3371         * kjs/date_object.cpp:
3372         (formatLocaleDate):
3373         (day):
3374         (dayFromYear):
3375         (daysInYear):
3376         (timeFromYear):
3377         (yearFromTime):
3378         (weekDay):
3379         (timeZoneOffset):
3380         (DateProtoFuncImp::call):
3381         (DateObjectImp::construct):
3382         (KJS::parseDate):
3383         (ymdhms_to_seconds):
3384         (KJS::makeTime):
3385         (findMonth):
3386         (KJS::KRFCDate_parseDate):
3387         * kjs/date_object.h:
3388         * tests/mozilla/expected.html: updated expected results to reflect fix
3389
3390 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
3391
3392         -fixed <rdar://problem/4168186> JavaScript fails to throw exceptions 
3393         for invalid return statements
3394         
3395         relevant tests:
3396             ecma/Statements/12.9-1-n.js
3397             ecma_2/Exceptions/lexical-052.js
3398             ecma_2/Exceptions/statement-009.js
3399
3400         Reviewed by sullivan.
3401
3402         * kjs/nodes.cpp:
3403         (ReturnNode::execute): now throws exception if return is not inside
3404         a function.
3405
3406         * tests/mozilla/expected.html: updated to reflect fix
3407
3408 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
3409
3410         Reviewed by sullivan.
3411
3412         * tests/mozilla/expected.html: Updated test results for last fix.
3413
3414 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
3415
3416         -fixed <rdar://problem/4168161> JavaScript fails to throw an exception 
3417         for invalid function calls
3418         
3419         Reviewed by sullivan.
3420
3421         Relevant mozilla test: ecma_3/Exceptions/regress-95101.js 
3422
3423         * kjs/nodes.cpp:
3424         (FunctionCallNode::evaluate): evaluate now checks for an exception
3425         after resolving a function name (in case the function is undefined)
3426
3427 2005-07-01  Eric Seidel  <eseidel@apple.com>
3428
3429         Reviewed by darin.
3430
3431         * kjs/interpreter.h:
3432         (KJS::Context::curStmtFirstLine): stub for compatibility with KDE
3433         * kjs/value.h:
3434         (KJS::Value::isValid): compatibility with KDE
3435         http://bugzilla.opendarwin.org/show_bug.cgi?id=3687
3436
3437 2005-07-01  Eric Seidel  <eseidel@apple.com>
3438
3439         Reviewed by darin.
3440
3441         * kjs/create_hash_table: rolled in changes from KDE, including
3442         -n <namespace> support from KDOM and support for newer comments
3443         http://bugzilla.opendarwin.org/show_bug.cgi?id=3771
3444
3445 2005-06-30  Geoffrey Garen  <ggaren@apple.com>
3446
3447         -rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to 
3448         throw exceptions for invalid break/continue statements
3449
3450         No layout tests because it's already covered by the Mozilla suite
3451
3452         Reviewed by mjs.
3453
3454         * kjs/internal.h: LabelStack now tracks where you are relative to
3455         switch and iteration (loop) statements
3456         
3457         (KJS::LabelStack::LabelStack):
3458         (KJS::LabelStack::pushIteration):
3459         (KJS::LabelStack::popIteration):
3460         (KJS::LabelStack::inIteration):
3461         (KJS::LabelStack::pushSwitch):
3462         (KJS::LabelStack::popSwitch):
3463         (KJS::LabelStack::inSwitch):
3464
3465         * kjs/nodes.cpp: 
3466         These files were updated to use the new LabelStack:
3467         (DoWhileNode::execute): 
3468         (WhileNode::execute):
3469         (ForNode::execute):
3470         (ForInNode::execute):
3471         (SwitchNode::execute):
3472         
3473         These files were updated to throw exceptions for invalid
3474         break/continue statements:
3475         (BreakNode::execute): 
3476         (ContinueNode::execute):
3477
3478         * tests/mozilla/expected.html: Updated expected results to reflect fix
3479
3480 2005-06-30  Kevin Decker  <kdecker@apple.com>
3481
3482         Reviewed by rjw.
3483
3484         fixed: <rdar://problem/4166838> failed assertion in`Interpreter::lockCount() > 0
3485
3486         no layout test added; this is in the bindings code.
3487
3488         * bindings/objc/WebScriptObject.mm:
3489         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]): make sure to lock and unlock the interpreter around allocations. 
3490
3491 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
3492
3493         Patch by Francisco Tolmasky <tolmasky@gmail.com>
3494
3495         - fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3667
3496         Core JavaScript 1.5 Reference:Objects:Array:forEach
3497
3498         See WebCore Changelog for layout tests added.
3499
3500         Reviewed by darin.
3501
3502         * kjs/array_object.cpp:
3503         (ArrayProtoFuncImp::call):
3504         * kjs/array_object.h:
3505         (KJS::ArrayProtoFuncImp::):
3506
3507 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
3508
3509         Patch contributed by Oliver Hunt <ojh16@student.canterbury.ac.nz>
3510
3511         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3743
3512         Incorrect error message given for certain calls
3513
3514         See WebCore Changelog for layout test added.
3515
3516         Reviewed by mjs.
3517