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