d5112576c4bcd450b8fe4434ddd0df6ceaa0b1f0
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
2
3         - now fix mac build again
4
5         * kjs/identifier.cpp:
6
7 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
8
9         Rubber stamped by Anders and Eric.
10
11         - add fpconst.cpp to win32 build, it is now needed
12
13         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
14         * kjs/fpconst.cpp:
15
16 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
17
18         Reviewed by Eric.
19
20         - fix windows build, broken by my last patch
21
22         * kjs/JSImmediate.cpp:
23         * kjs/identifier.cpp:
24         * kxmlcore/FastMalloc.cpp:
25         * kxmlcore/Platform.h:
26
27 2006-03-01  Maciej Stachowiak  <mjs@apple.com>
28
29         Reviewed by Darin.
30         
31         - Set up new prototype macros and avoid using #if without defined() in JSC
32         
33         Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
34         are defined, and to separate core OS-level dependencies from operating environment
35         dependencies so you can, e.g., build KDE on Mac or Windows.
36
37         * kxmlcore/Platform.h: Added.
38
39         - deploy them everywhere in JavaScriptCore
40         
41         * JavaScriptCore.xcodeproj/project.pbxproj:
42         * bindings/jni/jni_utility.cpp:
43         (KJS::Bindings::convertValueToJValue):
44         * bindings/objc/WebScriptObject.mm:
45         * bindings/objc/objc_instance.mm:
46         (ObjcInstance::end):
47         * bindings/softlinking.h:
48         * bindings/testbindings.mm:
49         (main):
50         * kjs/JSLock.cpp:
51         * kjs/collector.cpp:
52         (KJS::Collector::markCurrentThreadConservatively):
53         (KJS::Collector::markOtherThreadConservatively):
54         (KJS::Collector::markStackObjectsConservatively):
55         * kjs/config.h:
56         * kjs/date_object.cpp:
57         (gmtoffset):
58         (KJS::formatTime):
59         (KJS::DateProtoFunc::callAsFunction):
60         (KJS::DateObjectImp::construct):
61         (KJS::makeTime):
62         * kjs/dtoa.cpp:
63         * kjs/fpconst.cpp:
64         (KJS::sizeof):
65         (KJS::):
66         * kjs/grammar.y:
67         * kjs/identifier.cpp:
68         * kjs/internal.cpp:
69         * kjs/interpreter.cpp:
70         (KJS::Interpreter::evaluate):
71         (KJS::Interpreter::createLanguageInstanceForValue):
72         * kjs/interpreter.h:
73         * kjs/lookup.cpp:
74         * kjs/lookup.h:
75         * kjs/math_object.cpp:
76         * kjs/object.cpp:
77         * kjs/object.h:
78         * kjs/operations.cpp:
79         (KJS::isNaN):
80         (KJS::isInf):
81         (KJS::isPosInf):
82         (KJS::isNegInf):
83         * kjs/operations.h:
84         * kjs/regexp.cpp:
85         (KJS::RegExp::RegExp):
86         (KJS::RegExp::~RegExp):
87         (KJS::RegExp::match):
88         * kjs/regexp.h:
89         * kjs/testkjs.cpp:
90         (StopWatch::start):
91         (StopWatch::stop):
92         (StopWatch::getElapsedMS):
93         * kjs/ustring.cpp:
94         * kjs/ustring.h:
95         * kxmlcore/AlwaysInline.h:
96         * kxmlcore/Assertions.cpp:
97         * kxmlcore/Assertions.h:
98         * kxmlcore/FastMalloc.cpp:
99         (KXMLCore::):
100         * kxmlcore/FastMalloc.h:
101         * kxmlcore/FastMallocInternal.h:
102         * kxmlcore/HashTable.h:
103         * kxmlcore/TCPageMap.h:
104         * kxmlcore/TCSpinLock.h:
105         (TCMalloc_SpinLock::Lock):
106         (TCMalloc_SpinLock::Unlock):
107         (TCMalloc_SlowLock):
108         * kxmlcore/TCSystemAlloc.cpp:
109         (TCMalloc_SystemAlloc):
110         * os-win32/stdint.h:
111
112 2006-02-28  Geoffrey Garen  <ggaren@apple.com>
113
114         Reviewed by Darin.
115
116         - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry 
117         placeholder to -1 from UString::Rep::null
118
119         This turned out to be only a small speedup (.12%). That's within the 
120         margin of error for super accurate JS iBench, but Shark confirms the 
121         same, so I think it's worth landing.
122
123         FYI, I also confirmed that the single entry optimization in 
124         PropertyMap is a 3.2% speedup.
125
126         * kjs/property_map.cpp:
127         (KJS::PropertyMap::~PropertyMap):
128         (KJS::PropertyMap::clear):
129         (KJS::PropertyMap::put):
130         (KJS::PropertyMap::insert):
131         (KJS::PropertyMap::rehash):
132         (KJS::PropertyMap::remove):
133         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
134         (KJS::PropertyMap::checkConsistency):
135         * kjs/property_map.h:
136         (KJS::PropertyMap::deletedSentinel):
137
138 2006-02-27  Eric Seidel  <eseidel@apple.com>
139
140         Rubber-stamped by darin.
141
142         Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
143
144         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
145
146 2006-02-27  Eric Seidel  <eseidel@apple.com>
147
148         Reviewed by mjs.
149
150         Fix Assertions.cpp to compile on win32.
151
152         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
153         * kxmlcore/Assertions.cpp:
154
155 2006-02-27  Eric Seidel  <eseidel@apple.com>
156
157         Reviewed by mjs.
158
159         Made Assertions.cpp platform independent.
160         Moved mac-specific logging logic up into WebCore.
161         http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
162
163         * JavaScriptCore.xcodeproj/project.pbxproj:
164         * kxmlcore/Assertions.cpp: Added.
165         * kxmlcore/Assertions.h:
166         * kxmlcore/Assertions.mm: Removed.
167
168 2006-02-27  Darin Adler  <darin@apple.com>
169
170         - fixed Mac Debug build, there was an unused parameter
171
172         * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
173         Remove parameter name.
174
175         * kjs/debugger.h: Fixed comment.
176
177 2006-02-27  Eric Seidel  <eseidel@apple.com>
178
179         Reviewed by darin.
180
181         * kxmlcore/Vector.h:
182         (KXMLCore::deleteAllValues): fix unused variable warning
183
184 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
185
186         Reviewed by Darin.
187         
188         - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
189         http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
190
191         * JavaScriptCore.xcodeproj/project.pbxproj:
192         * bindings/NP_jsobject.cpp:
193         (jsAllocate):
194         (_NPN_InvokeDefault):
195         (_NPN_Evaluate):
196         (_NPN_GetProperty):
197         (_NPN_SetProperty):
198         (_NPN_RemoveProperty):
199         (_NPN_HasProperty):
200         (_NPN_HasMethod):
201         * bindings/c/c_class.h:
202         (KJS::Bindings::CClass::constructorAt):
203         * bindings/c/c_utility.cpp:
204         (KJS::Bindings::convertNPVariantToValue):
205         * bindings/jni/jni_class.cpp:
206         (JavaClass::methodsNamed):
207         (JavaClass::fieldNamed):
208         * bindings/jni/jni_instance.cpp:
209         (JavaInstance::invokeDefaultMethod):
210         * bindings/jni/jni_jsobject.cpp:
211         * bindings/jni/jni_objc.mm:
212         (-[NSObject KJS::Bindings::]):
213         * bindings/objc/WebScriptObject.mm:
214         (+[WebUndefined allocWithZone:]):
215         (-[WebUndefined initWithCoder:]):
216         (-[WebUndefined encodeWithCoder:]):
217         (-[WebUndefined copyWithZone:]):
218         * bindings/objc/objc_class.h:
219         (KJS::Bindings::ObjcClass::constructorAt):
220         * bindings/objc/objc_class.mm:
221         (KJS::Bindings::ObjcClass::methodsNamed):
222         (KJS::Bindings::ObjcClass::fallbackObject):
223         * bindings/objc/objc_instance.mm:
224         (ObjcInstance::getValueOfUndefinedField):
225         * bindings/objc/objc_runtime.mm:
226         (ObjcFallbackObjectImp::getOwnPropertySlot):
227         (ObjcFallbackObjectImp::put):
228         (ObjcFallbackObjectImp::canPut):
229         (ObjcFallbackObjectImp::deleteProperty):
230         (ObjcFallbackObjectImp::toBoolean):
231         * bindings/runtime.cpp:
232         (KJS::Bindings::Instance::createLanguageInstanceForValue):
233         * bindings/runtime.h:
234         (KJS::Bindings::Instance::getValueOfUndefinedField):
235         (KJS::Bindings::Instance::setValueOfUndefinedField):
236         * bindings/runtime_array.cpp:
237         (RuntimeArray::lengthGetter):
238         (RuntimeArray::indexGetter):
239         (RuntimeArray::put):
240         (RuntimeArray::deleteProperty):
241         * bindings/runtime_method.cpp:
242         (RuntimeMethod::lengthGetter):
243         (RuntimeMethod::execute):
244         * bindings/runtime_object.cpp:
245         (RuntimeObjectImp::fallbackObjectGetter):
246         (RuntimeObjectImp::fieldGetter):
247         (RuntimeObjectImp::methodGetter):
248         (RuntimeObjectImp::put):
249         (RuntimeObjectImp::canPut):
250         (RuntimeObjectImp::deleteProperty):
251         (RuntimeObjectImp::defaultValue):
252         (RuntimeObjectImp::callAsFunction):
253         * bindings/runtime_root.cpp:
254         (performJavaScriptAccess):
255         * kjs/array_object.cpp:
256         (ArrayInstance::lengthGetter):
257         (ArrayInstance::getOwnPropertySlot):
258         (ArrayPrototype::ArrayPrototype):
259         (ArrayPrototype::getOwnPropertySlot):
260         * kjs/bool_object.cpp:
261         (BooleanObjectImp::BooleanObjectImp):
262         * kjs/date_object.cpp:
263         (KJS::DateObjectFuncImp::DateObjectFuncImp):
264         (KJS::DateObjectFuncImp::callAsFunction):
265         * kjs/error_object.cpp:
266         (ErrorObjectImp::ErrorObjectImp):
267         (NativeErrorPrototype::NativeErrorPrototype):
268         (NativeErrorImp::NativeErrorImp):
269         * kjs/function.cpp:
270         (KJS::FunctionImp::argumentsGetter):
271         (KJS::FunctionImp::lengthGetter):
272         (KJS::Arguments::mappedIndexGetter):
273         (KJS::ActivationImp::argumentsGetter):
274         (KJS::ActivationImp::put):
275         * kjs/function_object.cpp:
276         (FunctionObjectImp::FunctionObjectImp):
277         * kjs/internal.cpp:
278         (KJS::GetterSetterImp::toPrimitive):
279         (KJS::GetterSetterImp::toBoolean):
280         * kjs/interpreter.cpp:
281         (KJS::Interpreter::evaluate):
282         * kjs/interpreter.h:
283         (KJS::Interpreter::isGlobalObject):
284         (KJS::Interpreter::interpreterForGlobalObject):
285         (KJS::Interpreter::isSafeScript):
286         * kjs/lexer.cpp:
287         (Lexer::makeIdentifier):
288         (Lexer::makeUString):
289         * kjs/lookup.h:
290         (KJS::staticFunctionGetter):
291         (KJS::staticValueGetter):
292         * kjs/nodes.cpp:
293         (StatementNode::processFuncDecl):
294         (PropertyNode::evaluate):
295         (PropertyNameNode::evaluate):
296         * kjs/number_object.cpp:
297         (NumberObjectImp::NumberObjectImp):
298         (NumberObjectImp::getOwnPropertySlot):
299         * kjs/object.cpp:
300         (KJS::JSObject::defineGetter):
301         (KJS::JSObject::defineSetter):
302         (KJS::JSObject::hasInstance):
303         (KJS::JSObject::propertyIsEnumerable):
304         * kjs/object_object.cpp:
305         (ObjectObjectImp::ObjectObjectImp):
306         * kjs/property_slot.cpp:
307         (KJS::PropertySlot::undefinedGetter):
308         (KJS::PropertySlot::functionGetter):
309         * kjs/reference.cpp:
310         (KJS::Reference::getPropertyName):
311         * kjs/reference_list.cpp:
312         (ReferenceListIterator::operator++):
313         * kjs/regexp_object.cpp:
314         (RegExpObjectImp::RegExpObjectImp):
315         (RegExpObjectImp::getValueProperty):
316         (RegExpObjectImp::putValueProperty):
317         * kjs/string_object.cpp:
318         (StringInstance::lengthGetter):
319         (StringInstance::indexGetter):
320         (StringPrototype::StringPrototype):
321         * kxmlcore/Assertions.mm:
322         * kxmlcore/FastMalloc.cpp:
323         (KXMLCore::TCMalloc_PageHeap::CheckList):
324         * kxmlcore/HashTable.h:
325         (KXMLCore::HashTableConstIterator::checkValidity):
326         (KXMLCore::IdentityHashTranslator::translate):
327         * pcre/pcre_get.c:
328         (pcre_get_stringnumber):
329
330 2006-02-23  Darin Adler  <darin@apple.com>
331
332         - try to fix buildbot failure
333
334         * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
335         recompiled after additional inlining was introduced (Xcode bug?).
336
337 2006-02-23  Geoffrey Garen  <ggaren@apple.com>
338
339         Reviewed by Darin, Maciej.
340
341         - Inline some functions suggested by Shark. 2.9% speedup on super
342         accurate JS iBench.
343
344         http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
345         <rdar://problem/4448116>
346
347         * kjs/nodes.h:
348         (KJS::ArgumentsNode::evaluateList):
349         * kjs/object.cpp:
350         * kjs/object.h:
351         (KJS::ScopeChain::release):
352         (KJS::JSObject::toPrimitive):
353         * kjs/scope_chain.cpp:
354         * kjs/ustring.cpp:
355         * kjs/ustring.h:
356         (KJS::UString::toArrayIndex):
357         * kjs/value.cpp:
358         * kjs/value.h:
359         (KJS::JSValue::toObject):
360         * kxmlcore/FastMalloc.cpp:
361         (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
362         (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
363
364 2006-02-21  Eric Seidel  <eseidel@apple.com>
365
366         Added *.user to ignore list.
367
368 2006-02-21  Eric Seidel  <eseidel@apple.com>
369
370         Reviewed by ggaren.
371
372         Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
373
374         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
375         * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
376
377 2006-02-21  Eric Seidel  <eseidel@apple.com>
378
379         Reviewed by ggaren.
380
381         * kjs/testkjs.cpp: #if out timeval code on win32
382
383 2006-02-21  Michael Emmel  <mike.emmel@gmail.com>
384
385         Reviewed by Darin.
386
387         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
388           TCPageMap.h would not compile for me because string.h was missing
389
390         * kxmlcore/TCPageMap.h: Added <string.h> include.
391
392 2006-02-21  Darin Adler  <darin@apple.com>
393
394         Reviewed by John Sullivan.
395
396         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
397           remove a bunch of extra implementsCall overrides
398
399         * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
400
401         * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
402         we'll get a compile error if some derived class neglects to implement it.
403
404         * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
405         of param, which is an OwnPtr so it gets initialized by default.
406
407         * bindings/runtime_method.cpp:
408         * bindings/runtime_method.h:
409         * kjs/array_object.cpp:
410         * kjs/array_object.h:
411         * kjs/bool_object.cpp:
412         * kjs/bool_object.h:
413         * kjs/date_object.cpp:
414         * kjs/date_object.h:
415         * kjs/error_object.cpp:
416         * kjs/error_object.h:
417         * kjs/function.cpp:
418         * kjs/function.h:
419         * kjs/function_object.cpp:
420         * kjs/function_object.h:
421         * kjs/math_object.cpp:
422         * kjs/math_object.h:
423         * kjs/number_object.cpp:
424         * kjs/number_object.h:
425         * kjs/object_object.cpp:
426         * kjs/object_object.h:
427         * kjs/regexp_object.cpp:
428         * kjs/regexp_object.h:
429         * kjs/string_object.cpp:
430         * kjs/string_object.h:
431         Removed many rendundant implementations of implementsCall from subclasses of
432         InternalFunctionImp.
433
434 2006-02-21  Darin Adler  <darin@apple.com>
435
436         - fixed build
437
438         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
439         Oops, fixed name.
440
441 2006-02-21  Darin Adler  <darin@apple.com>
442
443         Change suggested by Mitz.
444
445         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
446           REGRESSION: Methods do not execute
447
448         * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
449         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
450         Return true. All the classes derived from InternalFunctionImp need
451         to return true from this -- later we can remove all the extra
452         implementations too.
453
454 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
455
456         - fix build breakage caused by last-minute change to my patch
457
458         * kjs/lookup.h:
459
460 2006-02-20  Maciej Stachowiak  <mjs@apple.com>
461
462         Reviewed by Geoff and Darin.
463         
464         Patch from Maks Orlovich, based on work by David Faure, hand-applied and 
465         significantly reworked by me.
466         
467         - Patch: give internal function names (KJS merge)
468         http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
469
470         * tests/mozilla/expected.html: Updated for newly fixed test.
471
472         * kjs/array_object.cpp:
473         (ArrayProtoFunc::ArrayProtoFunc):
474         * kjs/array_object.h:
475         * kjs/bool_object.cpp:
476         (BooleanPrototype::BooleanPrototype):
477         (BooleanProtoFunc::BooleanProtoFunc):
478         * kjs/bool_object.h:
479         * kjs/date_object.cpp:
480         (KJS::DateProtoFunc::DateProtoFunc):
481         (KJS::DateObjectImp::DateObjectImp):
482         (KJS::DateObjectFuncImp::DateObjectFuncImp):
483         * kjs/error_object.cpp:
484         (ErrorPrototype::ErrorPrototype):
485         (ErrorProtoFunc::ErrorProtoFunc):
486         * kjs/error_object.h:
487         * kjs/function.cpp:
488         (KJS::FunctionImp::FunctionImp):
489         (KJS::GlobalFuncImp::GlobalFuncImp):
490         * kjs/function.h:
491         * kjs/function_object.cpp:
492         (FunctionPrototype::FunctionPrototype):
493         (FunctionProtoFunc::FunctionProtoFunc):
494         (FunctionProtoFunc::callAsFunction):
495         * kjs/function_object.h:
496         * kjs/internal.cpp:
497         (KJS::InterpreterImp::initGlobalObject):
498         (KJS::InternalFunctionImp::InternalFunctionImp):
499         * kjs/internal.h:
500         (KJS::InternalFunctionImp::functionName):
501         * kjs/lookup.h:
502         (KJS::staticFunctionGetter):
503         (KJS::HashEntryFunction::HashEntryFunction):
504         (KJS::HashEntryFunction::implementsCall):
505         (KJS::HashEntryFunction::toBoolean):
506         (KJS::HashEntryFunction::implementsHasInstance):
507         (KJS::HashEntryFunction::hasInstance):
508         * kjs/math_object.cpp:
509         (MathFuncImp::MathFuncImp):
510         * kjs/math_object.h:
511         * kjs/number_object.cpp:
512         (NumberPrototype::NumberPrototype):
513         (NumberProtoFunc::NumberProtoFunc):
514         * kjs/number_object.h:
515         * kjs/object.cpp:
516         (KJS::JSObject::putDirectFunction):
517         (KJS::Error::create):
518         * kjs/object.h:
519         * kjs/object_object.cpp:
520         (ObjectPrototype::ObjectPrototype):
521         (ObjectProtoFunc::ObjectProtoFunc):
522         * kjs/object_object.h:
523         * kjs/regexp_object.cpp:
524         (RegExpPrototype::RegExpPrototype):
525         (RegExpProtoFunc::RegExpProtoFunc):
526         * kjs/regexp_object.h:
527         * kjs/string_object.cpp:
528         (StringProtoFunc::StringProtoFunc):
529         (StringObjectImp::StringObjectImp):
530         (StringObjectFuncImp::StringObjectFuncImp):
531         * kjs/string_object.h:
532         
533 2006-02-20  Geoffrey Garen  <ggaren@apple.com>
534
535         Reviewed by Darin, with help from Eric, Maciej.
536
537         - More changes to support super-accurate JS iBench. Doesn't work on 
538         Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
539         opendarwin.org/show_bug.cgi?id= 7399] about that. 
540
541         * kjs/interpreter.cpp:
542         (KJS::Interpreter::evaluate): Print line numbers with exception output
543         * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the 
544         way we roll with .cpp files.
545         (StopWatch::StopWatch): New class. Provides microsecond-accurate 
546         timings.
547         (StopWatch::~StopWatch):
548         (StopWatch::start):
549         (StopWatch::stop):
550         (StopWatch::getElapsedMS):
551         (TestFunctionImp::callAsFunction): Added missing return statement. 
552         Fixed up "run" to use refactored helper functions. Removed bogus 
553         return statement from "quit" case. Made "print" output to stdout 
554         instead of stderr because that makes more sense, and PERL handles 
555         stdout better.
556         (main): Factored out KXMLCore unit tests. Removed custom exception 
557         printing code because the interpreter prints exceptions for you. Added 
558         a "delete" call for the GlobalImp we allocate.
559         (testIsInteger): New function, result of refacotring.
560         (createStringWithContentsOfFile): New function, result of refactoring. 
561         Renamed "code" to "buffer" to match factored-out-ness.
562
563 2006-02-20  Eric Seidel  <eseidel@apple.com>
564
565         Reviewed by hyatt.
566
567         Fix "Copy ICU DLLs..." phase.
568
569         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
570         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
571
572 2006-02-19  Darin Adler  <darin@apple.com>
573
574         - renamed ERROR to LOG_ERROR to fix build
575           presumably Maciej had this change and forgot to land it
576
577         * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
578         * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
579         * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
580
581 2006-02-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
582
583         Test: fast/js/toString-exception.html
584
585         Reviewed by Maciej.
586
587         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
588           REGRESSION: fast/js/toString-overrides.html fails when run multiple times
589
590         * kjs/array_object.cpp:
591         (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
592         returning an error.
593
594 2006-02-18  Darin Adler  <darin@apple.com>
595
596         Reviewed by Maciej.
597
598         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
599           add insert and remove to KXMLCore::Vector
600
601         * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
602         insert and remove to slide elements within the vector. Also added
603         "insert" and "remove" functions.
604
605 2006-02-16  Geoffrey Garen  <ggaren@apple.com>
606
607         Reviewed by John.
608
609         - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
610         Bindings::Instance::deref when leaving page @ gigaom.com
611
612         * bindings/c/c_instance.cpp:
613         (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
614         globally, we shouldn't delete it, so don't.
615
616 2006-02-16  Timothy Hatcher  <timothy@apple.com>
617
618         Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
619         warnings. Using <rdar://problem/4448350> to track this.
620
621         * JavaScriptCore.xcodeproj/project.pbxproj:
622         * bindings/objc/objc_jsobject.h: Removed empty file.
623         * bindings/objc/objc_jsobject.mm: Removed empty file.
624
625 2006-02-16  Tim Omernick  <timo@apple.com>
626
627         Reviewed by Geoff.
628
629         <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
630         javascript disabled (7015)
631
632         * bindings/NP_jsobject.cpp:
633         (_NPN_CreateNoScriptObject):
634         Returns an NPObject which is not bound to a JavaScript object.  This kind of NPObject
635         can be given to a plugin as the "window script object" when JavaScript is disabled.
636         The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
637         Because of this, none of the NPN_* functions called by the plugin on this "no script
638         object" will cause entry into JavaScript code.
639         (_NPN_InvokeDefault):
640         Make sure the NPVariant is filled before returning from this function.  This never
641         mattered before because we never reached this case, having only created NPObjects of
642         the class NPScriptObjectClass.
643         (_NPN_Invoke):
644         ditto
645         (_NPN_Evaluate):
646         ditto
647         (_NPN_GetProperty):
648         ditto
649
650         * bindings/NP_jsobject.h:
651         Declared _NPN_CreateNoScriptObject().
652
653 2006-02-16  Darin Adler  <darin@apple.com>
654
655         Reviewed by me, change by Peter Kuemmel.
656
657         * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
658         checking for positive infinity (rolling in fix from KDE side).
659
660 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
661
662         Reviewed by Maciej, Eric.
663
664         - WebCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
665         crashes in DashboardClient at com.apple.JavaScriptCore:
666         KJS::Bindings::ObjcFallbackObjectImp::type()
667
668         WebCore and JavaScriptCore weren't sharing Instance objects very
669         nicely. I made them use RefPtrs, and sent them to bed without dessert.
670
671         * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
672         (JavaInstance::~JavaInstance):
673         (JObjectWrapper::JObjectWrapper):
674         * bindings/jni/jni_instance.h:
675         (KJS::Bindings::JObjectWrapper::ref):
676         (KJS::Bindings::JObjectWrapper::deref):
677         * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
678         (JavaArray::~JavaArray):
679         (JavaArray::JavaArray):
680         * bindings/jni/jni_runtime.h:
681         (KJS::Bindings::JavaArray::operator=):
682         * bindings/objc/objc_runtime.h:
683         - Prohibited copying because that would muss the ref count.
684         - Prohibited construction without instance because an instance wrapper
685         without an instance is almost certainly a bug.
686         * bindings/objc/objc_runtime.mm:
687         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
688         * bindings/runtime.cpp:
689         (KJS::Bindings::Instance::Instance):
690         (KJS::Bindings::Instance::createBindingForLanguageInstance):
691         (KJS::Bindings::Instance::createRuntimeObject):
692         * bindings/runtime.h:
693         (KJS::Bindings::Instance::ref):
694         (KJS::Bindings::Instance::deref):
695         * bindings/runtime_object.cpp:
696         (RuntimeObjectImp::RuntimeObjectImp):
697         (RuntimeObjectImp::fallbackObjectGetter):
698         (RuntimeObjectImp::fieldGetter):
699         (RuntimeObjectImp::methodGetter):
700         (RuntimeObjectImp::getOwnPropertySlot):
701         (RuntimeObjectImp::put):
702         (RuntimeObjectImp::canPut):
703         * bindings/runtime_object.h: 
704         - Removed ownsInstance data member because RefPtr takes care of 
705         instance lifetime now. 
706         - Prohibited copying because that would muss the ref count.
707         - Prohibited construction without instance because an instance wrapper
708         without an instance is almost certainly a bug.
709         (KJS::RuntimeObjectImp::getInternalInstance):
710
711 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
712
713         Reviewed by John.
714
715         - Applied the 4330457 change to CClass and ObjcClass as well.
716
717         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
718         will catch this. 
719
720         This change isn't as critical because CClass and ObjcClass objects get 
721         cached globally and never deleted, but it's good practice, in case we 
722         ever do decide to delete CClass and ObjcClass objects.
723
724         This change requires prohibiting copying, because we don't do any 
725         intelligent ref-counting -- when a Class is destroyed, it destroys its 
726         methods and fields unconditionally. (Java classes already prohibited
727         copying.)
728
729         * bindings/c/c_class.cpp:
730         - Merged _commonInit and _commonDelete into constructor and destructor.
731         (CClass::CClass):
732         (CClass::~CClass):
733         (CClass::methodsNamed): Added delete callbacks
734         (CClass::fieldNamed): Added delete callbacks
735         * bindings/c/c_class.h: Prohibited copying
736         * bindings/c/c_instance.cpp: 
737         (KJS::Bindings::CInstance::getClass): Changed to use the preferred 
738         class factory method, to take advantage of the global cache.
739
740         [ Repeated changes applied to CClass for ObjcClass: ]
741
742         * bindings/objc/objc_class.h: 
743         * bindings/objc/objc_class.mm:
744         (KJS::Bindings::ObjcClass::ObjcClass):
745         (KJS::Bindings::ObjcClass::~ObjcClass):
746         (KJS::Bindings::ObjcClass::methodsNamed):
747         (KJS::Bindings::ObjcClass::fieldNamed):
748         * bindings/objc/objc_runtime.h:
749         (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
750         variable to prevent bad CFRelease.
751         (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
752         if statement to prevent bad CFRelease.
753         * bindings/objc/objc_runtime.cpp: Changed to use the preferred
754         ObjectStructPtr, for clarity.
755
756 2006-02-14  Geoffrey Garen  <ggaren@apple.com>
757
758         Reviewed by John.
759
760         - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
761         in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
762         getClass const + 56
763
764         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
765         will catch this. 
766
767         This was a memory leak in the bindings code. The leak was so extreme
768         that it would cause Safari or the JVM to abort from lack of memory.
769         Upon construction, Class objects create field and method objects, 
770         storing them in CFDictionaries. The bug was that upon destruction, the 
771         class objects released the dictionaries but didn't destroy the stored 
772         objects.
773
774         The fix is to supply CFDictionary callbacks for destroying the values
775         added to the dictionary. 
776         
777         * bindings/jni/jni_class.cpp: 
778         (JavaClass::JavaClass): Added delete callbacks
779         * bindings/runtime.cpp: Added definitions for delete callbacks
780         (KJS::Bindings::deleteMethodList):
781         (KJS::Bindings::deleteMethod):
782         (KJS::Bindings::deleteField):
783         * bindings/runtime.h: Added declarations for delete callbacks
784
785 2006-02-14  Timothy Hatcher  <timothy@apple.com>
786
787         Reviewed by Justin.
788
789         Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
790         behavior due to POSIX version of sh
791
792         * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
793
794 2006-02-13   Dave Hyatt <hyatt@apple.com>
795
796         Fix Win32 bustage in JavaScriptCore.
797
798         Reviewed by darin
799
800         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
801         Add JSImmediate to the Win32 project.
802
803         * kjs/JSImmediate.h:
804         (KJS::JSImmediate::fromDouble):
805         (KJS::JSImmediate::toDouble):
806         (KJS::JSImmediate::NanAsBits):
807         (KJS::JSImmediate::oneAsBits):
808         Win32 needs explicit returns after abort() for non-void functions.
809
810         * kjs/testkjs.cpp:
811         (run):
812         Win32 catches a bug in testkjs!  The "return 2" should actually
813         have been a return false.
814
815         * kjs/value.h:
816         The extern decls of NaN and Inf need to be const.
817
818 === JavaScriptCore-521.7 ===
819
820 2006-02-13  Timothy Hatcher  <timothy@apple.com>
821
822         Reviewed by Darin.
823
824         Replaced the old NS_DURING exception blocking with @try/@catch.
825
826         * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
827         * bindings/objc/objc_instance.mm:
828         (ObjcInstance::invokeMethod):
829         (ObjcInstance::invokeDefaultMethod):
830         (ObjcInstance::setValueOfUndefinedField):
831         (ObjcInstance::getValueOfUndefinedField):
832         * bindings/objc/objc_runtime.mm:
833         (ObjcField::valueFromInstance):
834         (ObjcField::setValueToInstance):
835         (ObjcArray::setValueAt):
836         (ObjcArray::valueAt):
837
838 2006-02-13  Darin Adler  <darin@apple.com>
839
840         - fix a couple problems building on Windows, based on requests
841           from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
842
843         * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
844         to the standard uint32/64_t. Also removed curious "isIEEE()" function
845         that checked the sizes of some types (and type sizes alone don't tell you if
846         the floating point conforms to the IEEE-standard). Added missing include
847         of <stdint.h>.
848
849         * kjs/property_slot.h: Added missing include of <assert.h>.
850
851 2006-02-12  Geoffrey Garen  <ggaren@apple.com>
852
853         Reviewed by darin.
854
855         Cleaned up testkjs, added new "run" functionality to allow scripting 
856         tests from within JS. ("run" is a part of my new super-accurate
857         JS iBench.)
858
859         No regressions in run-javascriptcore-tests.
860
861         * kjs/testkjs.cpp:
862         (GlobalImp::className):
863         (TestFunctionImp::):
864         (TestFunctionImp::callAsFunction):
865         (main):
866         (run):
867
868 2006-02-11  Alexey Proskuryakov  <ap@nypop.com>
869
870         Reviewed by Darin.
871
872         - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
873         RealPlayer.GetTitle() Crashes Safari/Dashboard
874
875         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
876         Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1, 
877         because the latter encoding has holes, and conversion can still fail.
878
879 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
880
881         Reviewed by Darin.
882
883         - Inlined RefPtr assignment operators. .7% performance win on 
884         super-accurate JS iBench.
885
886         * kxmlcore/RefPtr.h:
887         (KXMLCore::::operator):
888
889 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
890
891         No review needed, just a build fix. This time for sure.
892
893         * kjs/JSType.h:
894
895 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
896
897         Reviewed by eric.
898         
899         - Fixed build. As it goes without saying, I will not mention that I
900         blame Kevin.
901
902         * JavaScriptCore.xcodeproj/project.pbxproj:
903         * kjs/JSImmediate.cpp:
904         (KJS::JSImmediate::toObject):
905
906 2006-02-09  Geoffrey Garen  <ggaren@apple.com>
907
908         Reviewed by mjs.
909
910         - Fixed <rdar://problem/4343730> Should switch ConstantValues (null, 
911         undefined, true, false) from JS objects to immediate values similar to
912         SimpleNumber
913
914         2.0% performance gain on my new super-accurate version of JS iBench.
915         (I promise to land a version of it soon.)
916
917         The gist of the change:
918         (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
919         class (JSImmediate.h/.cpp), and it handles not only numbers but also 
920         null, undefined, true, and false. 
921         (2) JSImmediate provides convenience methods for the bit masking
922         necessary to encode and decode immediate values.
923         (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
924         (4) JSCell no longer implements functions like getBoolean, because
925         only a JSImmediate can be a boolean.
926         (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
927         and ALWAYS_INLINE is a non-portable option of last resort.
928         (6) Type is now JSType, and it resides in its own file, JSType.h.
929         Since I was there, I did some header include sorting as part of this
930         change.
931
932         The rest pretty much explains itself.
933
934         * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
935         added JSImmediate.h/.cpp.
936         * bindings/c/c_instance.cpp:
937         (KJS::Bindings::CInstance::defaultValue):
938         * bindings/c/c_instance.h:
939         * bindings/c/c_utility.cpp:
940         (KJS::Bindings::convertValueToNPVariant):
941         * bindings/jni/jni_instance.cpp:
942         (JavaInstance::defaultValue):
943         * bindings/jni/jni_instance.h:
944         * bindings/jni/jni_jsobject.cpp:
945         (JavaJSObject::convertValueToJObject):
946         * bindings/objc/WebScriptObject.mm:
947         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
948         Standardized calls to use getXXX instead of hand-rolling JSValue 
949         functionality.
950         * bindings/objc/objc_instance.h:
951         * bindings/objc/objc_instance.mm:
952         (ObjcInstance::getValueOfUndefinedField):
953         (ObjcInstance::defaultValue):
954         * bindings/objc/objc_runtime.h:
955         * bindings/objc/objc_runtime.mm:
956         (ObjcFallbackObjectImp::type):
957         (ObjcFallbackObjectImp::defaultValue):
958         * bindings/runtime.h:
959         (KJS::Bindings::Instance::getValueOfUndefinedField):
960         * bindings/runtime_object.cpp:
961         (RuntimeObjectImp::defaultValue):
962         * bindings/runtime_object.h:
963         * kjs/JSImmediate.h: Added.
964         (KJS::JSImmediate::isImmediate):
965         (KJS::JSImmediate::isNumber):
966         (KJS::JSImmediate::isBoolean):
967         (KJS::JSImmediate::isUndefinedOrNull):
968         (KJS::JSImmediate::fromDouble):
969         (KJS::JSImmediate::toDouble):
970         (KJS::JSImmediate::toBoolean):
971         (KJS::JSImmediate::trueImmediate):
972         (KJS::JSImmediate::falseImmediate):
973         (KJS::JSImmediate::NaNImmediate):
974         (KJS::JSImmediate::undefinedImmediate):
975         (KJS::JSImmediate::nullImmediate):
976         (KJS::JSImmediate::tag):
977         (KJS::JSImmediate::unTag):
978         (KJS::JSImmediate::getTag):
979         (KJS::JSImmediate::):
980         (KJS::JSImmediate::isIEEE):
981         (KJS::JSImmediate::is32bit):
982         (KJS::JSImmediate::is64bit):
983         (KJS::JSImmediate::NanAsBits):
984         (KJS::JSImmediate::zeroAsBits):
985         (KJS::JSImmediate::oneAsBits):
986         * kjs/JSLock.cpp:
987         (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
988         * kjs/JSType.h: Added.
989         * kjs/collector.cpp:
990         (KJS::Collector::protect):
991         (KJS::Collector::unprotect):
992         (KJS::Collector::collect):
993         * kjs/internal.cpp:
994         (KJS::StringImp::toPrimitive):
995         (KJS::NumberImp::toPrimitive):
996         (KJS::NumberImp::toBoolean):
997         (KJS::GetterSetterImp::toPrimitive):
998         * kjs/internal.h:
999         (KJS::StringImp::type):
1000         (KJS::NumberImp::type):
1001         * kjs/object.cpp:
1002         (KJS::JSObject::type):
1003         (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
1004         I'm looking for?" test with "Are you not the one thing I'm not looking
1005         for" test.
1006         (KJS::JSObject::defaultValue):
1007         (KJS::JSObject::toPrimitive):
1008         * kjs/object.h:
1009         (KJS::GetterSetterImp::type):
1010         (KJS::JSValue::isObject):
1011         * kjs/operations.cpp:
1012         (KJS::equal):
1013         (KJS::strictEqual):
1014         (KJS::add):
1015         * kjs/reference.cpp:
1016         (KJS::Reference::deleteValue):
1017         * kjs/simple_number.h: Removed.
1018         * kjs/string_object.cpp:
1019         (StringInstance::getOwnPropertySlot): fixed indentation
1020         * kjs/value.cpp:
1021         (KJS::JSValue::toObject):
1022         (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
1023         us to inline jsNumber without adding PIC branches to callers.
1024         * kjs/value.h:
1025         (KJS::jsUndefined):
1026         (KJS::jsNull):
1027         (KJS::jsNaN):
1028         (KJS::jsBoolean):
1029         (KJS::jsNumber):
1030         (KJS::JSValue::downcast):
1031         (KJS::JSValue::isUndefinedOrNull):
1032         (KJS::JSValue::isBoolean):
1033         (KJS::JSValue::isNumber):
1034         (KJS::JSValue::isString):
1035         (KJS::JSValue::isObject):
1036         (KJS::JSValue::getBoolean):
1037         (KJS::JSValue::getNumber):
1038         (KJS::JSValue::getString):
1039         (KJS::JSValue::getObject):
1040         (KJS::JSValue::getUInt32):
1041         (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
1042         resulting in a slight performance gain. Callers should always check
1043         !marked() before calling mark(), so it's impossible to call mark on
1044         a JSImmediate.
1045         (KJS::JSValue::marked):
1046         (KJS::JSValue::type):
1047         (KJS::JSValue::toPrimitive):
1048         (KJS::JSValue::toBoolean):
1049         (KJS::JSValue::toNumber):
1050         (KJS::JSValue::toString):
1051
1052 2006-02-06  Eric Seidel  <eseidel@apple.com>
1053
1054         Add svn:ignore properties for visual studio internals.
1055
1056 2006-02-06  Alexey Proskuryakov  <ap@nypop.com>
1057
1058         Reviewed by Darin.
1059
1060         - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
1061         http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
1062
1063         - No tests added - only changed functionality on WIN32, which should be covered by 
1064         existing tests.
1065
1066         * kjs/date_object.cpp:
1067         (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
1068         Updated comments. 
1069         (KJS::timeZoneOffset): Removed, was basically the same as the above.
1070         (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
1071         Windows based on struct tm itself.
1072         (KJS::DateInstance::getTime): Added.
1073         (KJS::DateInstance::getUTCTime): Added.
1074         (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
1075         (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
1076         (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
1077         GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
1078         with daylight savings time being in effect.
1079
1080         * kjs/date_object.h: Added prototypes for new functions.
1081
1082 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
1083
1084         Reviewed by Anders.
1085         
1086         - fixed ~1100 KJS::Node leaked on layout tests
1087         http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
1088
1089         * kjs/internal.cpp:
1090         (KJS::Parser::noteNodeCycle):
1091         (KJS::Parser::removeNodeCycle):
1092         (KJS::clearNewNodes):
1093         * kjs/internal.h:
1094         * kjs/nodes.cpp:
1095         (ElementNode::breakCycle):
1096         (PropertyListNode::breakCycle):
1097         (ArgumentListNode::breakCycle):
1098         (StatListNode::StatListNode):
1099         (StatListNode::breakCycle):
1100         (VarDeclListNode::breakCycle):
1101         (BlockNode::BlockNode):
1102         (ClauseListNode::breakCycle):
1103         (CaseBlockNode::CaseBlockNode):
1104         (ParameterNode::breakCycle):
1105         (SourceElementsNode::SourceElementsNode):
1106         (SourceElementsNode::breakCycle):
1107         * kjs/nodes.h:
1108         (KJS::Node::breakCycle):
1109         (KJS::ElementNode::ElementNode):
1110         (KJS::ArrayNode::ArrayNode):
1111         (KJS::PropertyListNode::PropertyListNode):
1112         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1113         (KJS::ArgumentListNode::ArgumentListNode):
1114         (KJS::ArgumentsNode::ArgumentsNode):
1115         (KJS::VarDeclListNode::VarDeclListNode):
1116         (KJS::VarStatementNode::VarStatementNode):
1117         (KJS::ForNode::ForNode):
1118         (KJS::CaseClauseNode::CaseClauseNode):
1119         (KJS::ClauseListNode::ClauseListNode):
1120         (KJS::ParameterNode::ParameterNode):
1121         (KJS::FuncExprNode::FuncExprNode):
1122         (KJS::FuncDeclNode::FuncDeclNode):
1123
1124 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
1125
1126         Reviewed by Hyatt.
1127         
1128         - fix default traits for classes to make sure default constructors get called
1129
1130         * kxmlcore/VectorTraits.h:
1131         (KXMLCore::):
1132
1133 2006-02-04  Darin Adler  <darin@apple.com>
1134
1135         Reviewed by Maciej.
1136
1137         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
1138           REGRESSION: for/in loop with var changes global variable instead of making local
1139
1140         Test: fast/js/for-in-var-scope.html
1141
1142         * kjs/nodes.cpp:
1143         (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
1144         (ForInNode::execute): Break out of the scope chain loop once we find and set the
1145         loop variable. We don't want to set multiple loop variables.
1146         (ForInNode::processVarDecls): Process the declaration of the loop variable.
1147
1148         - other cleanup
1149
1150         * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
1151         * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
1152         instead of defining it here a second time.
1153
1154 2006-02-04  Maciej Stachowiak  <mjs@apple.com>
1155
1156         Reviewed by Hyatt.
1157         
1158         - change JavaScript collector statistics calls to use HashCountedSet instead
1159         of CFSet; other misc cleanup
1160         http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
1161         
1162         * kjs/collector.cpp:
1163         (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
1164         (KJS::typeName):
1165         (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
1166         use HashSet
1167         * kjs/collector.h:
1168         (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
1169         * kjs/nodes.cpp:
1170
1171 2006-02-03  Timothy Hatcher  <timothy@apple.com>
1172
1173         Reviewed by Justin.
1174
1175         Renamed configuration names to Debug, Release and Production.
1176
1177         * JavaScriptCore.xcodeproj/project.pbxproj:
1178
1179 2006-02-02  George Staikos <staikos@opensource.apple.com>
1180
1181         Reviewed by Maciej.
1182
1183         * kjs/lookup.h: Fix compile, merged from KDE.
1184
1185 2006-02-02  Darin Adler  <darin@apple.com>
1186
1187         Reviewed by Maciej.
1188
1189         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
1190           add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
1191
1192         * kxmlcore/Noncopyable.h: Added.
1193         * kxmlcore/OwnArrayPtr.h: Added.
1194         * kxmlcore/OwnPtr.h: Added.
1195
1196         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
1197
1198         * kjs/function.h:
1199         * kjs/function.cpp: Use OwnPtr for Parameter pointers.
1200
1201         * kjs/internal.h: Use Noncopyable for LabelStack.
1202
1203         * kjs/list.cpp: Use OwnArrayPtr for overflow.
1204
1205         * kjs/property_map.h:
1206         * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
1207         Use Vector for some stack buffers.
1208
1209         * kjs/regexp_object.h:
1210         * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
1211
1212 2006-01-31  Maciej Stachowiak  <mjs@apple.com>
1213
1214         Reviewed by Darin.
1215         
1216         - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
1217         that would catch them
1218
1219         * kjs/nodes.cpp:
1220         (NodeCounter::~NodeCounter): Added debug-only node counter.
1221         (Node::Node):
1222         (Node::~Node):
1223         * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
1224
1225 2006-01-31  Darin Adler  <darin@apple.com>
1226
1227         Reviewed by Maciej.
1228
1229         - added deleteAllValues for HashSet as well as HashMap
1230         - fixed conversion from const_iterator to iterator, which I broke a while back
1231
1232         * kxmlcore/HashMap.h: Updated copyright date.
1233         * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
1234         * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
1235
1236 2006-01-31  Tim Omernick  <timo@apple.com>
1237
1238         Reviewed by Geoff Garen.
1239
1240         * bindings/c/c_utility.cpp:
1241         (KJS::Bindings::convertUTF8ToUTF16):
1242         Fixed an invalid assertion that UTF8Chars is not NULL.  It is valid for it to be NULL as long as
1243         UTF8Length is 0.
1244         This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
1245         where JavaScript is getting a NULL string back from some call on the Real Player plugin.
1246
1247 2006-01-30  Anders Carlsson  <andersca@mac.com>
1248
1249         Reviewed by Darin.
1250
1251         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
1252         REGRESSION: United.com menus messed up due to document.all/MSIE sniff
1253         
1254         * kjs/nodes.cpp:
1255         (typeStringForValue):
1256         Return "undefined" if the given object should masquerade as undefined.
1257         
1258         * kjs/object.h:
1259         (KJS::JSObject::masqueradeAsUndefined):
1260         Rename from isEqualToNull.
1261         
1262         * kjs/operations.cpp:
1263         (KJS::equal):
1264         Update for name change.
1265
1266 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
1267
1268         Reviewed by Darin.
1269         
1270         - properly define Vector assignment operator; the private version was accidentally left
1271         in, and the template version is not enough to replace the default
1272
1273         * kxmlcore/Vector.h:
1274         (KXMLCore::Vector::operator=):
1275
1276 2006-01-29  Eric Seidel  <eseidel@apple.com>
1277
1278         Reviewed by darin.
1279
1280         Fix the build by applying a GCC-specific namespace hack.
1281
1282         * kjs/lookup.h:
1283
1284 2006-01-29  Eric Seidel <eseidel@apple.com>
1285
1286         Reviewed by hyatt.
1287
1288         Fix build on Win32.
1289
1290         * kjs/lookup.h: fixed ::cacheGlobalObject
1291         * kxmlcore/Vector.h:
1292         (KXMLCore::Vector::operator[]): use unsigned long
1293
1294 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
1295
1296         Reviewed by Dave Hyatt.
1297
1298         * kxmlcore/Vector.h:
1299         (KXMLCore::Vector::operator[]): Add unsigned overload
1300
1301 2006-01-28  Darin Adler  <darin@apple.com>
1302
1303         Reviewed by John Sullivan.
1304
1305         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
1306           include exception names in JavaScript form of DOM exception
1307
1308         * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
1309         exception in the error message.
1310
1311 2006-01-28  Maciej Stachowiak  <mjs@apple.com>
1312
1313         Reviewed by Darin.
1314         
1315         - miscellaneous Vector improvements
1316
1317         * kxmlcore/Vector.h:
1318         (KXMLCore::Vector::at): Add range-checking asserts.
1319         (KXMLCore::Vector::first): Added as a convenience.
1320         (KXMLCore::Vector::last): Convenience for stack-style use.
1321         (KXMLCore::Vector::removeLast): ditto
1322
1323 2006-01-28  Darin Adler  <darin@apple.com>
1324
1325         Reviewed by John Sullivan
1326
1327         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
1328           REGRESSION: JavaScript Date constructor won't accept another Date object
1329
1330         Test: fast/js/date-constructor.html
1331
1332         * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
1333         Added a special case for constructing one date from another (to avoid losing
1334         milliseconds, which are not in the text form, to match Firefox), and changed
1335         the base code to convert to primitive before checking for string to match
1336         the standard. Also corrected a couple silly things in the "construct from
1337         current time" code path (removed a floor that does no good, and changed
1338         the constant used to convert microseconds to milliseconds to be a 1000
1339         rather than "msPerSecond").
1340
1341 2006-01-28  Darin Adler  <darin@apple.com>
1342
1343         * kjs/create_hash_table: Added missing license.
1344
1345 2006-01-28  Maciej Stachowiak  <mjs@apple.com>
1346
1347         Reviewed by Dave Hyatt.
1348         
1349         - added a Vector class
1350         http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
1351
1352         * JavaScriptCore.xcodeproj/project.pbxproj:
1353         * kjs/internal.cpp:
1354         (KJS::Parser::saveNewNode): Apply Vector.
1355         (KJS::clearNewNodes): ditto
1356         * kjs/number_object.cpp:
1357         (integer_part_noexp): ditto
1358         (char_sequence): ditto
1359         * kjs/ustring.cpp:
1360         (KJS::UString::UTF8String): ditto
1361         * kxmlcore/HashMap.h:
1362         (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
1363         other versions are useful for other containers.
1364         * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
1365         be usable for all Array/QVector style purposes, and also as a stack buffer
1366         with oversize handling. Also some helper classes to make vector operations
1367         as efficient as possible for POD types and for simple non-PODs like RefPtr.
1368         (KXMLCore::):
1369         (KXMLCore::VectorTypeOperations::destruct):
1370         (KXMLCore::VectorTypeOperations::initialize):
1371         (KXMLCore::VectorTypeOperations::move):
1372         (KXMLCore::VectorTypeOperations::uninitializedCopy):
1373         (KXMLCore::VectorTypeOperations::uninitializedFill):
1374         (KXMLCore::VectorBuffer::VectorBuffer):
1375         (KXMLCore::VectorBuffer::~VectorBuffer):
1376         (KXMLCore::VectorBuffer::deallocateBuffer):
1377         (KXMLCore::VectorBuffer::inlineBuffer):
1378         (KXMLCore::Vector::Vector):
1379         (KXMLCore::Vector::~Vector):
1380         (KXMLCore::Vector::size):
1381         (KXMLCore::Vector::capacity):
1382         (KXMLCore::Vector::isEmpty):
1383         (KXMLCore::Vector::at):
1384         (KXMLCore::Vector::operator[]):
1385         (KXMLCore::Vector::data):
1386         (KXMLCore::Vector::operator T*):
1387         (KXMLCore::Vector::operator const T*):
1388         (KXMLCore::Vector::begin):
1389         (KXMLCore::Vector::end):
1390         (KXMLCore::Vector::clear):
1391         (KXMLCore::Vector::fill):
1392         (KXMLCore::Vector::operator=):
1393         (KXMLCore::::Vector):
1394         (KXMLCore::::operator):
1395         (KXMLCore::::fill):
1396         (KXMLCore::::expandCapacity):
1397         (KXMLCore::::resize):
1398         (KXMLCore::::reserveCapacity):
1399         (KXMLCore::::append):
1400         (KXMLCore::deleteAllValues):
1401         * kxmlcore/VectorTraits.h: Added.
1402         (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
1403         simple types.
1404
1405 2006-01-28  Alexey Proskuryakov  <ap@nypop.com>
1406
1407         Reviewed by Darin.
1408
1409         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
1410         RealPlayer.GetTitle() Crashes Safari/Dashboard
1411
1412         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
1413         Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
1414
1415 2006-01-25  George Staikos <staikos@opensource.apple.com>
1416
1417         Reviewed by Darin.
1418
1419         * kxmlcore/HashFunctions.h: Merge build fix from KDE.
1420
1421 2006-01-25  Darin Adler  <darin@apple.com>
1422
1423         - removed an unused source file
1424
1425         * kjs/pointer_hash.h: Removed.
1426         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
1427
1428 2006-01-23  Anders Carlsson  <andersca@mac.com>
1429
1430         Reviewed by Maciej.
1431
1432         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
1433         KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
1434         
1435         * kjs/lookup.h:
1436         Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
1437         
1438         (cacheGlobalObject):
1439         Move this out of the KJS namespace.
1440
1441 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
1442
1443         Reviewed by Eric.
1444
1445         - renamed PointerHash to PtrHash
1446         - made PtrHash the default hash function for int and pointer types that aren't further specialized
1447         - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
1448         - did appropriate consequent cleanup (very few places now need to declare a hash function)
1449         http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
1450         
1451         * kjs/array_object.cpp:
1452         (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
1453         * kjs/collector.cpp: ditto
1454         * kjs/identifier.cpp:
1455         (KXMLCore::): declare DefaultHash the new way
1456         * kjs/internal.cpp: no need to mention PointerHash
1457         * kjs/ustring.h:
1458         * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
1459         easier to specialize on PtrHash
1460         * kxmlcore/HashFunctions.h:
1461         (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
1462         a Hash typedef rather than being a hash function class itself; declared DefaultHash
1463         for int and partializy specialized for pointer types
1464         * kxmlcore/HashMapPtrSpec.h:
1465         (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
1466         way of handling pointer hash
1467         (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
1468         (KXMLCore::): ditto
1469         * kxmlcore/HashMap.h: ditto
1470         * kxmlcore/HashSet.h: ditto
1471
1472 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
1473
1474         Reviewed by Tim Omernick.
1475         
1476         - use classes instead of free functions for extractors, this better matches how other
1477         things work and should avoid the need for hacky workarounds on other compilers
1478         http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
1479
1480         * kjs/array_object.cpp:
1481         * kjs/identifier.cpp:
1482         * kjs/internal.cpp:
1483         * kxmlcore/HashMap.h:
1484         (KXMLCore::PairFirstExtractor::extract):
1485         * kxmlcore/HashMapPtrSpec.h:
1486         (KXMLCore::):
1487         * kxmlcore/HashSet.h:
1488         (KXMLCore::IdentityExtractor::extract):
1489         * kxmlcore/HashTable.h:
1490         (KXMLCore::addIterator):
1491         (KXMLCore::removeIterator):
1492         (KXMLCore::HashTable::add):
1493         (KXMLCore::HashTable::isEmptyBucket):
1494         (KXMLCore::HashTable::isDeletedBucket):
1495         (KXMLCore::HashTable::HashTable):
1496         (KXMLCore::HashTable::lookup):
1497         (KXMLCore::HashTable::add):
1498         (KXMLCore::HashTable::reinsert):
1499         (KXMLCore::HashTable::find):
1500         (KXMLCore::HashTable::contains):
1501         (KXMLCore::HashTable::remove):
1502         (KXMLCore::HashTable::allocateTable):
1503         (KXMLCore::HashTable::deallocateTable):
1504         (KXMLCore::HashTable::expand):
1505         (KXMLCore::HashTable::rehash):
1506         (KXMLCore::HashTable::clear):
1507         (KXMLCore::HashTable::swap):
1508         (KXMLCore::HashTable::operator):
1509         (KXMLCore::HashTable::checkTableConsistency):
1510         (KXMLCore::HashTable::checkTableConsistencyExceptSize):
1511         (KXMLCore::HashTable::invalidateIterators):
1512
1513 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
1514
1515         Rubber stamped by Tim Hatcher.
1516         
1517         - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
1518         for consistency with HashMap
1519
1520         * kjs/array_object.cpp:
1521         (ArrayProtoFunc::callAsFunction):
1522         * kjs/collector.cpp:
1523         (KJS::Collector::protect):
1524         * kjs/identifier.cpp:
1525         (KJS::Identifier::add):
1526         * kxmlcore/HashCountedSet.h:
1527         (KXMLCore::::add):
1528         * kxmlcore/HashMap.h:
1529         (KXMLCore::::inlineAdd):
1530         * kxmlcore/HashSet.h:
1531         (KXMLCore::::add):
1532         * kxmlcore/HashTable.h:
1533         (KXMLCore::HashTable::add):
1534         (KXMLCore::::add):
1535         (KXMLCore::::HashTable):
1536
1537 2006-01-23  Justin Garcia  <justin.garcia@apple.com>
1538
1539         Reviewed by thatcher
1540         
1541         Turned on -O2 for B&I build.
1542
1543         * JavaScriptCore.xcodeproj/project.pbxproj:
1544
1545 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
1546
1547         Reviewed by Tim Hatcher.
1548         
1549         - it's "Franklin Street", not "Franklin Steet"
1550
1551         * kjs/array_instance.h:
1552         * kjs/array_object.cpp:
1553         * kjs/array_object.h:
1554         * kjs/bool_object.cpp:
1555         * kjs/bool_object.h:
1556         * kjs/collector.cpp:
1557         * kjs/collector.h:
1558         * kjs/completion.h:
1559         * kjs/context.h:
1560         * kjs/date_object.cpp:
1561         * kjs/date_object.h:
1562         * kjs/debugger.cpp:
1563         * kjs/debugger.h:
1564         * kjs/dtoa.h:
1565         * kjs/error_object.cpp:
1566         * kjs/error_object.h:
1567         * kjs/function.cpp:
1568         * kjs/function.h:
1569         * kjs/function_object.cpp:
1570         * kjs/function_object.h:
1571         * kjs/grammar.y:
1572         * kjs/identifier.cpp:
1573         * kjs/identifier.h:
1574         * kjs/internal.cpp:
1575         * kjs/internal.h:
1576         * kjs/interpreter.cpp:
1577         * kjs/interpreter.h:
1578         * kjs/lexer.cpp:
1579         * kjs/lexer.h:
1580         * kjs/list.cpp:
1581         * kjs/list.h:
1582         * kjs/lookup.cpp:
1583         * kjs/lookup.h:
1584         * kjs/math_object.cpp:
1585         * kjs/math_object.h:
1586         * kjs/nodes.cpp:
1587         * kjs/nodes.h:
1588         * kjs/nodes2string.cpp:
1589         * kjs/number_object.cpp:
1590         * kjs/number_object.h:
1591         * kjs/object.cpp:
1592         * kjs/object.h:
1593         * kjs/object_object.cpp:
1594         * kjs/object_object.h:
1595         * kjs/operations.cpp:
1596         * kjs/operations.h:
1597         * kjs/property_map.cpp:
1598         * kjs/property_map.h:
1599         * kjs/property_slot.cpp:
1600         * kjs/property_slot.h:
1601         * kjs/reference.cpp:
1602         * kjs/reference.h:
1603         * kjs/reference_list.cpp:
1604         * kjs/reference_list.h:
1605         * kjs/regexp.cpp:
1606         * kjs/regexp.h:
1607         * kjs/regexp_object.cpp:
1608         * kjs/regexp_object.h:
1609         * kjs/scope_chain.cpp:
1610         * kjs/scope_chain.h:
1611         * kjs/simple_number.h:
1612         * kjs/string_object.cpp:
1613         * kjs/string_object.h:
1614         * kjs/testkjs.cpp:
1615         * kjs/types.h:
1616         * kjs/ustring.cpp:
1617         * kjs/ustring.h:
1618         * kjs/value.cpp:
1619         * kjs/value.h:
1620         * kxmlcore/AlwaysInline.h:
1621         * kxmlcore/ListRefPtr.h:
1622         * kxmlcore/PassRefPtr.h:
1623         * kxmlcore/RefPtr.h:
1624
1625 2006-01-23  Darin Adler  <darin@apple.com>
1626
1627         Reviewed by John Sullivan.
1628
1629         - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
1630           REGRESSION: Crash in cloneChildNodes when clicking element
1631
1632         * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
1633         type by calling get() instead of going directly at m_ptr.
1634         * kxmlcore/RefPtr.h: Ditto.
1635
1636         - other changes
1637
1638         * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
1639         It's just a resorted list of keys in a dictionary.
1640
1641         * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
1642         in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
1643         routine" property we want to have on OS X.
1644
1645 2006-01-22  Maciej Stachowiak  <mjs@apple.com>
1646
1647         Reviewed by Darin.
1648
1649         - Set up Page class and invert Frame / WebCoreFrameBridge ownership
1650         http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
1651
1652         * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can 
1653         override it
1654
1655 2006-01-23  George Staikos <staikos@opensource.apple.com>
1656
1657         Reviewed by Maciej and Darin.
1658
1659         * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
1660         * kjs/interpreter.cpp: ditto
1661         * kjs/simple_number.h: Add assert.h and remove from config.h
1662         * kjs/array_object.cpp: Use relative paths for kxmlcore includes
1663         * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
1664
1665 2006-01-23  George Staikos <staikos@opensource.apple.com>
1666
1667         Reviewed by Maciej.
1668
1669         * kjs/config.h: unbreak preprocessor change
1670
1671 2006-01-23  George Staikos <staikos@opensource.apple.com>
1672
1673         Approved by Maciej and Darin.
1674
1675         * kjs/:
1676         * kxmlcore/:
1677              Update FSF address in license to make merging easier
1678
1679 2006-01-22  George Staikos <staikos@opensource.apple.com>
1680
1681         Reviewed by Maciej.
1682
1683         * kjs/collector.cpp: merge major speedup from KDE on Linux
1684                              patch by Maks Orlovich, bug #6145
1685                              Also unify cpu detection
1686         * kjs/config.h: define simpler CPU macros
1687
1688 2006-01-22  George Staikos <staikos@opensource.apple.com>
1689
1690         Reviewed by Maciej.
1691
1692         * kjs/collector.cpp: merge FreeBSD compile fix from KDE
1693                              -> requires build magic for use
1694
1695 2006-01-21  George Staikos <staikos@opensource.apple.com>
1696
1697         Reviewed by Maciej.
1698
1699         * kjs/nodes2string.cpp
1700         * kjs/operations.h
1701         * kjs/debugger.h
1702           Fix pedantic compile with some gcc versions (Merge from KDE)
1703
1704         * kjs/create_hash_table:
1705           Fix build with Perl 5.8.0 (Merge from KDE)
1706
1707 2006-01-18  Darin Adler  <darin@apple.com>
1708
1709         Reviewed by Hyatt.
1710
1711         - hash table fixes needed for my WebCore changes
1712
1713         * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
1714         Added a missing return statement.
1715
1716         * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
1717         can't instantiate with a 0 by using traits rather than ? : to select the default
1718         emtpy value of hash table keys.
1719
1720         - small cleanup of "runtime" code left over from recent JavaScript crash fix
1721
1722         * bindings/runtime_root.h:
1723         (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
1724         since it's now a ProtectedPtr.
1725         (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
1726         fact that _imp was 0 and replaced with use of ProtectedPtr.
1727         (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
1728
1729 2006-01-17  Darin Adler  <darin@apple.com>
1730
1731         Reviewed by Anders.
1732
1733         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
1734           add assertions to check correct use of hash table iterators
1735
1736         * kxmlcore/HashTable.h:
1737         (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
1738         maintained by the specified hash table.
1739         (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
1740         the list maintained by the hash table it's in.
1741         (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
1742         parameter, ignored when not debugging. Call addIterator.
1743         (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
1744         (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
1745         (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
1746         (KXMLCore::HashTableConstIterator::operator->): Ditto.
1747         (KXMLCore::HashTableConstIterator::operator++): Ditto.
1748         (KXMLCore::HashTableConstIterator::operator==): Ditto.
1749         (KXMLCore::HashTableConstIterator::operator!=): Ditto.
1750         (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
1751         pointer is not 0 and if there are two iterators that both point at the same table.
1752         (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
1753         as an implementation detail, to avoid having two separate iterator implementations.
1754         (KXMLCore::HashTableIterator::operator*): Ditto.
1755         (KXMLCore::HashTableIterator::operator->): Ditto.
1756         (KXMLCore::HashTableIterator::operator++): Ditto.
1757         (KXMLCore::HashTableIterator::operator==): Ditto.
1758         (KXMLCore::HashTableIterator::operator!=): Ditto.
1759         (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
1760         (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
1761         (KXMLCore::HashTable::makeIterator): Pass this pointer.
1762         (KXMLCore::HashTable::makeConstIterator): Ditto.
1763         (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
1764         entry point that modifies the hash table.
1765         (KXMLCore::HashTable::remove): Ditto.
1766         (KXMLCore::HashTable::clear): Ditto.
1767         (KXMLCore::HashTable::swap): Ditto.
1768         (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
1769         clears out the table, next, and previous pointers in all of them, and then clears
1770         the head so we have an empty list.
1771         (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
1772         passed-in table, and points the iterator at the table.
1773         (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
1774         the passed-in table.
1775
1776         * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
1777
1778 2006-01-17  Justin Garcia  <justin.garcia@apple.com>
1779
1780         Reviewed by eric
1781         
1782         Deployment builds now use -O2
1783
1784         * JavaScriptCore.xcodeproj/project.pbxproj:
1785
1786 2006-01-17  Darin Adler  <darin@apple.com>
1787
1788         Reviewed by Anders.
1789
1790         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
1791           change RefPtr so that it works when deref ends up deleting the RefPtr
1792
1793         * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
1794         * kxmlcore/RefPtr.h: Ditto.
1795
1796 2006-01-16  Geoffrey Garen  <ggaren@apple.com>
1797
1798         Reviewed by darin.
1799
1800         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
1801         DateProtoFuncImp::callAsFunction can crash due to lack of type checking
1802
1803         * kjs/date_object.cpp:
1804         (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods. 
1805         This matches section 15.9.5 in the spec.
1806
1807 2006-01-16  Tim Omernick  <timo@apple.com>
1808
1809         Reviewed by John Sullivan.
1810
1811         JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
1812
1813         * bindings/npruntime.cpp:
1814         (_NPN_ReleaseObject):
1815         Refactored part of this function out into _NPN_DeallocateObject.
1816         (_NPN_DeallocateObject):
1817         Forcibly deallocates the passed object, even if its refcount is
1818         greater than zero.
1819         
1820         * bindings/npruntime_impl.h:
1821         Declared _NPN_DeallocateObject().
1822
1823 2006-01-16  Darin Adler  <darin@apple.com>
1824
1825         Reviewed by Maciej.
1826
1827         - fix problem with ++, ==, and != on const iterators in
1828           HashMaps that are using the pointer specialization
1829
1830         * kxmlcore/HashMapPtrSpec.h:
1831         (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
1832         (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
1833         (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
1834
1835 2006-01-15  Alexey Proskuryakov  <ap@nypop.com>
1836
1837         Reviewed by Anders.
1838
1839         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
1840         run-javascriptcore-tests doesn't work
1841
1842         * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm: 
1843         Changed revision number to 1.8 (broken by svn migration).
1844
1845 2006-01-14  David Kilzer  <ddkilzer@kilzer.net>
1846
1847         Reviewed and landed by Anders.
1848
1849         * kjs/create_hash_table: Fixed comment typo.
1850
1851 2006-01-13  Maks Orlovich   <maksim@kde.org>
1852
1853         Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
1854
1855         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
1856         Misc. array object fixes from KJS
1857
1858         * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
1859         (ArrayInstance::getOwnPropertySlot): Ditto.
1860         (ArrayInstance::deleteProperty): Ditto.
1861         (ArrayInstance::put): Ditto.
1862         (ArrayInstance::propList): Added a FIXME comment.
1863         (ArrayInstance::put): Throw exception on trying to set invalid array length.
1864         (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
1865         * kjs/array_object.h: Added MAX_ARRAY_INDEX.
1866
1867 2006-01-13  Darin Adler  <darin@apple.com>
1868
1869         - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
1870         - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
1871
1872 2006-01-13  Anders Carlsson  <andersca@mac.com>
1873
1874         Reviewed by Eric.
1875
1876         * kjs/create_hash_table:
1877         Use correct size variables.
1878
1879 2006-01-13  Anders Carlsson  <andersca@mac.com>
1880
1881         Reviewed by Darin.
1882
1883         * kjs/create_hash_table:
1884         Don't create an empty entry array, instead add a entry with all fields
1885         set to null and set the hash table size to 1.
1886         
1887         * kjs/lookup.cpp:
1888         (findEntry):
1889         Remove the hash table size check
1890
1891 2006-01-12  Anders Carlsson  <andersca@mac.com>
1892
1893         Reviewed by Maciej.
1894
1895         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
1896         Crash when assigning a new function to a DOMParser object
1897         
1898         * JavaScriptCore.xcodeproj/project.pbxproj:
1899         Move lookup.cpp before lookup.h
1900         
1901         * kjs/lookup.cpp:
1902         (findEntry):
1903         If the hash table is empty, return 0 early.
1904
1905 2006-01-12  George Staikos <staikos@kde.org>
1906
1907         Reviewed by Darin.
1908
1909         * kjs/interpreter.cpp:
1910         * kjs/testkjs.cpp:
1911         * kjs/interpreter.h:
1912         Add helper to interpreter to call the collector in order to facilitate
1913         visibility rules in KDE.
1914
1915 2006-01-12  George Staikos <staikos@kde.org>
1916
1917         Reviewed by Maciej.
1918
1919         * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
1920
1921         * kxmlcore/HashTable.h: Add missing assert.h
1922
1923 2006-01-12  Darin Adler  <darin@apple.com>
1924
1925         Reviewed by Geoff.
1926
1927         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
1928           retire APPLE_CHANGES from JavaScriptCore
1929
1930         * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
1931         APPLE_CHANGES and HAVE_CONFIG_H from all targets.
1932
1933         * README: Removed. This had obsolete information in it
1934         and it wasn't clear what to replace it with.
1935
1936         * kjs/collector.h: Removed an APPLE_CHANGES if around something
1937         that's not really platform-specific (although it does use a
1938         platform-specific API at the moment).
1939         * kjs/collector.cpp: Removed a mistaken comment.
1940
1941         * kjs/grammar.y:
1942         * kjs/internal.cpp:
1943         * kjs/object.h:
1944         * kjs/operations.cpp:
1945         * kjs/operations.h:
1946         * kjs/ustring.h:
1947         Use __APPLE__ instead of APPLE_CHANGES for code that should be
1948         used only on Mac OS X.
1949
1950         * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
1951         of the runtime.h header. Even though that header isn't needed at the
1952         moment on platforms other than Mac OS X, the conditional stuff should
1953         be in the header itself, not in this one client.
1954
1955         * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
1956         code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
1957         any platform where pow is implemented corrrectly according to the IEEE
1958         standard. If it is needed on some, we can add it back with an appropriate
1959         #if for the platforms where it is needed.
1960
1961 2006-01-12  Justin Haygood  <justin@xiondigital.net>
1962
1963         Reviewed, tweaked, and landed by Darin.
1964
1965         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
1966           lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
1967
1968         * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
1969         quotes instead of angle brackets. Moved dtoa.h include to the top.
1970         Changed system header includes to use angle brackets instead of quotes.
1971         * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
1972         quotes instead of angle brackets.
1973         * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
1974         quotes instead of angle brackets. Moved lexer.h include to the top.
1975         * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
1976         quotes instead of angle brackets. Moved ustring.h include to the top.
1977
1978 2006-01-12  George Staikos <staikos@kde.org>
1979
1980         Reviewed by Maciej
1981
1982         - Import initial QMake file.  Doesn't fully work yet.
1983
1984 2006-01-11  Ricci Adams  <ricciadams@apple.com>
1985
1986         Reviewed by Maciej and Darin, landed by Darin.
1987
1988         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
1989           final comma in javascript object prevents parsing
1990
1991         * kjs/grammar.y: Added rule to allow trailing comma in
1992         object construction.
1993
1994 2006-01-11  Ricci Adams  <ricciadams@apple.com>
1995
1996         Reviewed by Geoff, landed by Darin.
1997
1998         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
1999           Number.toFixed doesn't include leading 0
2000
2001         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2002         Fixed a "<" that should have been a "<=".
2003
2004 2006-01-11  Ricci Adams  <ricciadams@apple.com>
2005
2006         Reviewed by Geoff, landed by Darin.
2007
2008         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
2009           Number.toFixed doesn't round 0.5 up
2010
2011         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2012         Fixed a ">" that should have been a ">=".
2013
2014 2006-01-11  Justin Haygood  <justin@xiondigital.net>
2015
2016         Reviewed and landed by Darin.
2017
2018         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6486
2019           JavaScriptCore should use system malloc on Windows
2020
2021         * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
2022
2023 2006-01-10  Darin Adler  <darin@apple.com>
2024
2025         * Makefile: Took out unneeded "export" line.
2026         * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
2027           MIME types, other small corrections).
2028
2029 2006-01-09  Darin Adler  <darin@apple.com>
2030
2031         * Makefile.am: Removed.
2032
2033 2006-01-07  Anders Carlsson  <andersca@mac.com>
2034
2035         Reviewed by Maciej.
2036         
2037         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
2038         REGRESSION: JavaScript hang when comparing large array to null
2039         
2040         * kjs/object.h:
2041         (KJS::JSObject::isEqualToNull):
2042         Add new function which returns true if an object should be treated as null when
2043         doing comparisons.
2044         
2045         * kjs/operations.cpp:
2046         (KJS::equal):
2047         Use isEqualToNull.
2048
2049 2006-01-07  Alexey Proskuryakov  <ap@nypop.com>
2050
2051         Reviewed by Maciej.
2052
2053         - Fix WebCore development build
2054         http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
2055
2056         * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
2057
2058 2006-01-06  Maciej Stachowiak  <mjs@apple.com>
2059
2060         Reviewed by Darin.
2061
2062         - miscellaneous changes for 4% speedup on the JavaScript iBench
2063         http://bugzilla.opendarwin.org/show_bug.cgi?id=6396
2064         
2065         Changes mostly thanks to Maks Orlovich, tweaked a little by me.
2066
2067         * kjs/create_hash_table: Use the same hash as the one used by Identifier.
2068         * kjs/function.cpp:
2069         (KJS::FunctionImp::processParameters): Use the new List::copyFrom
2070         (KJS::ActivationImp::ActivationImp): track variable while iterating
2071         * kjs/internal.cpp:
2072         (KJS::StringImp::toObject): create StringInstance directly
2073         * kjs/list.cpp:
2074         (KJS::List::copy): implement in terms of copyFrom
2075         (KJS::List::copyFrom): more efficient way to copy in another list
2076         * kjs/list.h:
2077         * kjs/lookup.cpp:
2078         (keysMatch): updated to work with identifier hash
2079         (findEntry): ditto
2080         (Lookup::findEntry): ditto
2081         (Lookup::find): ditto
2082         * kjs/lookup.h:
2083
2084 2006-01-06  Maciej Stachowiak  <mjs@apple.com>
2085
2086         - fix development build failure from the previous checkin
2087
2088         * kjs/function.cpp:
2089         (KJS::ActivationImp::put): Use prototype() accessor in assert.
2090
2091 2006-01-05  Maciej Stachowiak  <mjs@apple.com>
2092
2093         Reviewed by Eric.
2094
2095         - fix remaining performance regression from Getter/Setter change
2096         http://bugzilla.opendarwin.org/show_bug.cgi?id=6249
2097
2098         - Activation objects should not have __proto__ property
2099         http://bugzilla.opendarwin.org/show_bug.cgi?id=6395
2100
2101         * kjs/function.cpp:
2102         (KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
2103         skipping getter/setter handling and __proto__ handling, as well
2104         as inlining needed superclass stuff.
2105         (KJS::ActivationImp::put): Implement directly, skipping getter/setter,
2106         __proto__, and do canPut directly in PropertyMap::put since there's no
2107         static property table either.
2108         * kjs/function.h:
2109         * kjs/property_map.cpp:
2110         (KJS::PropertyMap::put): Allow optionally inlining canPut check.
2111         * kjs/property_map.h:
2112
2113 2006-01-04  Geoffrey Garen  <ggaren@apple.com>
2114
2115         Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
2116
2117         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4921
2118         \u escape sequences in JavaScript identifiers
2119
2120         * kjs/function_object.cpp:
2121         (FunctionObjectImp::construct):
2122         * kjs/lexer.cpp:
2123         (Lexer::shift):
2124         (Lexer::lex):
2125         (Lexer::isWhiteSpace):
2126         (Lexer::isLineTerminator):
2127         (Lexer::isIdentStart):
2128         (Lexer::isIdentPart):
2129         (isDecimalDigit):
2130         (Lexer::scanRegExp):
2131         * kjs/lexer.h:
2132         (KJS::Lexer::):
2133
2134         * tests/mozilla/expected.html: Updated test results.
2135
2136 2005-12-30  Maciej Stachowiak  <mjs@apple.com>
2137
2138         No review, just test result update.
2139
2140         * tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
2141
2142 2005-12-30  Anders Carlsson  <andersca@mac.com>
2143
2144         Reviewed by Maciej.
2145
2146         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6298
2147         Getter setter test is failing
2148                 
2149         * kjs/object.cpp:
2150         (KJS::JSObject::put):
2151         Rework the getter setter part. We now walk the prototype chain, checking for
2152         getter/setter properties and only take the slow path if any are found. 
2153
2154 2005-12-30  Maks Orlovich <maksim@kde.org>
2155
2156         Reviewed and committed by Maciej.
2157
2158         - Handle negative, FP numbers with non-10 radix in toString
2159         http://bugzilla.opendarwin.org/show_bug.cgi?id=6259
2160
2161         (Merged from KJS, original work by Harri Porten)
2162         
2163         * kjs/number_object.cpp:
2164         (NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with  
2165         negative numbers, floating point and very large numbers.
2166
2167 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2168
2169         Patch by Maks Orlovich, reviewed and landed by me.
2170
2171         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6267
2172         Fix Number.prototype.toFixed/toExponential(undefined)
2173
2174         * kjs/number_object.cpp:
2175         (NumberProtoFunc::callAsFunction):
2176
2177 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2178
2179         Patch by Maks Orlovich, Reviewed and landed by me.
2180
2181         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6266
2182         Minor object naming updates (to match Mozilla, KJS)
2183
2184         * kjs/number_object.cpp:
2185         * kjs/regexp_object.cpp:
2186
2187 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2188
2189         Patch by Maks Orlovich, reviewed by mjs.
2190
2191         This has 2 very minor fixes, covered by KJS testsuite:    
2192         1. Enumerates string indices in property list (with the same bug as array    
2193            object has in corresponding code). This is a mozilla emulation thing. 
2194         2. Permits properties with integer names in prototypes to be found    
2195
2196         * kjs/string_object.cpp:
2197         (StringInstance::getOwnPropertySlot):
2198         (StringInstanceImp::propList):
2199         * kjs/string_object.h:
2200
2201 2005-12-26  Geoffrey Garen  <ggaren@apple.com>
2202
2203         Reviewed by mjs.
2204
2205         - Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in 
2206         KJS::BlockNode::deref 
2207         AKA 
2208         http://bugzilla.opendarwin.org/show_bug.cgi?id=6233
2209         Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in 
2210         linked lists
2211
2212         This patch does four things: 
2213         (1) Standardizes all our linked list nodes to use "next" as their next 
2214         pointers. 
2215         (2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
2216         to iteratively deref "next" pointers.
2217         (3) Standardizes our linked list nodes to use ListRefPtr<T> and 
2218         implement the releaseNext() function used by ~ListRefPtr<T>().
2219         (4) Adds to RefPtr<T> the release() method used by releaseNext().
2220
2221         - Modified existing mozilla test to ensure it would make deployment 
2222         builds crash as well.
2223
2224         * JavaScriptCore.xcodeproj/project.pbxproj:
2225         * kjs/nodes.cpp:
2226         (ElementNode::evaluate):
2227         (PropertyListNode::evaluate):
2228         (ArgumentListNode::evaluateList):
2229         (StatListNode::StatListNode):
2230         (StatListNode::execute):
2231         (StatListNode::processVarDecls):
2232         (VarDeclListNode::evaluate):
2233         (VarDeclListNode::processVarDecls):
2234         (VarStatementNode::execute):
2235         (VarStatementNode::processVarDecls):
2236         (BlockNode::BlockNode):
2237         (CaseClauseNode::evalStatements):
2238         (CaseClauseNode::processVarDecls):
2239         (ClauseListNode::processVarDecls):
2240         (CaseBlockNode::CaseBlockNode):
2241         (CaseBlockNode::evalBlock):
2242         (SourceElementsNode::SourceElementsNode):
2243         (SourceElementsNode::execute):
2244         (SourceElementsNode::processFuncDecl):
2245         (SourceElementsNode::processVarDecls):
2246         * kjs/nodes.h:
2247         (KJS::ElementNode::ElementNode):
2248         (KJS::ElementNode::releaseNext):
2249         (KJS::ArrayNode::ArrayNode):
2250         (KJS::PropertyListNode::PropertyListNode):
2251         (KJS::PropertyListNode::releaseNext):
2252         (KJS::ObjectLiteralNode::ObjectLiteralNode):
2253         (KJS::ArgumentListNode::ArgumentListNode):
2254         (KJS::ArgumentListNode::releaseNext):
2255         (KJS::ArgumentsNode::ArgumentsNode):
2256         (KJS::StatListNode::releaseNext):
2257         (KJS::VarDeclListNode::VarDeclListNode):
2258         (KJS::VarDeclListNode::releaseNext):
2259         (KJS::VarStatementNode::VarStatementNode):
2260         (KJS::ForNode::ForNode):
2261         (KJS::CaseClauseNode::CaseClauseNode):
2262         (KJS::ClauseListNode::ClauseListNode):
2263         (KJS::ClauseListNode::getClause):
2264         (KJS::ClauseListNode::getNext):
2265         (KJS::ClauseListNode::releaseNext):
2266         (KJS::ParameterNode::ParameterNode):
2267         (KJS::ParameterNode::releaseNext):
2268         (KJS::SourceElementsNode::releaseNext):
2269         * kjs/nodes2string.cpp:
2270         (ElementNode::streamTo):
2271         (PropertyListNode::streamTo):
2272         (ArgumentListNode::streamTo):
2273         (StatListNode::streamTo):
2274         (VarDeclListNode::streamTo):
2275         (VarStatementNode::streamTo):
2276         (CaseClauseNode::streamTo):
2277         (ClauseListNode::streamTo):
2278         (CaseBlockNode::streamTo):
2279         (SourceElementsNode::streamTo):
2280         * kxmlcore/ListRefPtr.h: Added.
2281         (KXMLCore::ListRefPtr::ListRefPtr):
2282         (KXMLCore::ListRefPtr::~ListRefPtr):
2283         (KXMLCore::ListRefPtr::operator=):
2284         * kxmlcore/RefPtr.h:
2285         (KXMLCore::RefPtr::release):
2286
2287 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2288
2289         Reviewed by mjs.
2290
2291         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4026
2292         Math.random() not seeded.
2293
2294         Added call to sranddev() -- it executes the first time a process
2295         calls Math.random().
2296
2297         * kjs/math_object.cpp:
2298         (MathFuncImp::callAsFunction):
2299
2300 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2301
2302         Reviewed by darin.
2303
2304         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6265
2305         Name change regression: Java doesn't know what JavaJSObject is
2306
2307         Changed strings passed to Java back to original "JSObject".
2308
2309         * bindings/jni/jni_jsobject.cpp:
2310         (JavaJSObject::convertValueToJObject):
2311         (JavaJSObject::convertJObjectToValue):
2312
2313 2005-12-28  Anders Carlsson  <andersca@mac.com>
2314
2315         Reviewed by Maciej.
2316
2317         - The JSC part of http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
2318         Add undetectable document.all
2319         
2320         * kjs/operations.cpp:
2321         (KJS::equal):
2322         When comparing an object with null or undefined, call toPrimitive with 
2323         NullType as the preferred type.
2324
2325 2005-12-27  Anders Carlsson  <andersca@mac.com>
2326
2327         Reviewed by Darin.
2328
2329         * kjs/array_object.cpp:
2330         (ArrayProtoFunc::callAsFunction):
2331         Implement filter and map. Also, make the existing
2332         array iteration functions not invoke the callback for
2333         non-existing properties, just as Mozilla does now.
2334         
2335         * kjs/array_object.h:
2336         (KJS::ArrayProtoFunc::):
2337         Add filter and map.
2338         
2339         * tests/mozilla/expected.html:
2340         Update, two 1.6 tests now pass.
2341
2342 2005-12-27  Maciej Stachowiak  <mjs@apple.com>
2343
2344         - updated test results for new JS 1.6 tests
2345
2346         * tests/mozilla/expected.html:
2347
2348 2005-12-27  Anders Carlsson  <andersca@mac.com>
2349
2350         Reviewed by Maciej.
2351
2352         Add Mozilla JS 1.6 tests.
2353         
2354         * tests/mozilla/js1_6/Array/browser.js: Added.
2355         * tests/mozilla/js1_6/Array/regress-290592.js: Added.
2356         * tests/mozilla/js1_6/Array/regress-304828.js: Added.
2357         * tests/mozilla/js1_6/Array/regress-305002.js: Added.
2358         * tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
2359         * tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
2360         * tests/mozilla/js1_6/Array/regress-320887.js: Added.
2361         * tests/mozilla/js1_6/Array/shell.js: Added.
2362         * tests/mozilla/js1_6/README: Added.
2363         * tests/mozilla/js1_6/Regress/browser.js: Added.
2364         * tests/mozilla/js1_6/Regress/regress-301574.js: Added.
2365         * tests/mozilla/js1_6/Regress/regress-309242.js: Added.
2366         * tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
2367         * tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
2368         * tests/mozilla/js1_6/Regress/regress-314887.js: Added.
2369         * tests/mozilla/js1_6/Regress/regress-320172.js: Added.
2370         * tests/mozilla/js1_6/Regress/shell.js: Added.
2371         * tests/mozilla/js1_6/String/browser.js: Added.
2372         * tests/mozilla/js1_6/String/regress-306591.js: Added.
2373         * tests/mozilla/js1_6/String/shell.js: Added.
2374         * tests/mozilla/js1_6/browser.js: Added.
2375         * tests/mozilla/js1_6/shell.js: Added.
2376         * tests/mozilla/js1_6/template.js: Added.
2377
2378 2005-12-27  Maks Orlovich <maksim@kde.org>
2379
2380         Reviewed and landed by Maciej.
2381
2382         - fixed 6234: Can delete array index property incorrectly.
2383         http://bugzilla.opendarwin.org/show_bug.cgi?id=6234
2384
2385         * kjs/array_object.cpp:
2386         (ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
2387         looking for array properties.
2388
2389 2005-12-27  Anders Carlsson  <andersca@mac.com>
2390
2391         Reviewed by Maciej.
2392
2393         * kjs/object.cpp:
2394         (KJS::JSObject::defineSetter):
2395         Remove duplicate call to putDirect.
2396
2397 2005-12-26  Maciej Stachowiak  <mjs@apple.com>
2398
2399         Reviewed by Darin and Geoff.
2400
2401         Changes by me and Anders.
2402
2403         - mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
2404         http://bugzilla.opendarwin.org/show_bug.cgi?id=6083
2405
2406         - also fixed some warnings reported by -Winline
2407         
2408         * JavaScriptCorePrefix.h: Move new and delete definitions higher so there
2409         aren't conflicts with use in standard C++ headers
2410         * kjs/object.cpp:
2411         (KJS::throwSetterError): Moved this piece of put into a seprate function
2412         to avoid the PIC branch.
2413         (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
2414         when not needed. Also use GetterSetter properties attribute.
2415         (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
2416         properties any more, if this one was one.
2417         (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
2418         properties now (and use the new attribute).
2419         (KJS::JSObject::defineSetter): Ditto.
2420         (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
2421         to avoid global variable access in the hot code path.
2422         * kjs/object.h:
2423         (KJS::): Added GetterSetter attribute.
2424         (KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
2425         (KJS::JSValue::isObject): ditto
2426         (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
2427         as much as possible in the case where they are not being used
2428         * kjs/property_map.cpp:
2429         (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
2430         * kjs/property_map.h:
2431         (KJS::PropertyMap::hasGetterSetterProperties): Ditto
2432         (KJS::PropertyMap::setHasGetterSetterProperties): Ditto
2433         (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
2434         global "has getter/setter properties" flag in the property map
2435         single entry, to avoid making objects any bigger.
2436         * kjs/value.h: Moved some things to object.h to make -Winline happier
2437
2438 2005-12-24  Maciej Stachowiak  <mjs@apple.com>
2439
2440         Reviewed by Eric and Dave Hyatt.
2441
2442         - make even const PassRefPtrs give transfer of ownership semantics
2443         http://bugzilla.opendarwin.org/show_bug.cgi?id=6238
2444         
2445         This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
2446         in assignment and copy construction. And this makes life way easier and removes
2447         the need for pass(). It is not really correct, but we pretty much never need a real
2448         const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
2449         
2450         * kjs/identifier.cpp:
2451         (KJS::Identifier::add): No more need for pass()
2452         * kjs/property_map.cpp:
2453         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
2454         * kjs/ustring.cpp:
2455         (KJS::UString::Rep::create): Use adoptRef
2456         (KJS::UString::UString): No more need for pass
2457         (KJS::UString::append): No more need for pass
2458         (KJS::UString::substr): No more need for pass
2459         * kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
2460         (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
2461         (KXMLCore::PassRefPtr::release): Made this a const method (ugh)
2462         (KXMLCore::PassRefPtr::operator=): clean up appropriately
2463         (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
2464         it makes the behavior more clear and it is less verbose.
2465         (KXMLCore::static_pointer_cast): use adoptRef
2466         (KXMLCore::const_pointer_cast): use adoptRef
2467         * kxmlcore/RefPtr.h:
2468         (KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
2469         (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
2470
2471 2005-12-25  Eric Seidel  <eseidel@apple.com>
2472
2473         Reviewed by mjs.
2474
2475         Unbreak HashTableConstIterator++ by returning const_iterator
2476
2477         * kxmlcore/HashTable.h:
2478         (KXMLCore::HashTableConstIterator::operator++): use const_iterator
2479
2480 2005-12-25  Eric Seidel  <eseidel@apple.com>
2481
2482         Reviewed by mjs.
2483
2484         Un-break HashTable copy constructor.
2485
2486         * kxmlcore/HashTable.h:
2487         (KXMLCore::::HashTable): use const_iterator instead
2488
2489 2005-12-23  Maciej Stachowiak  <mjs@apple.com>
2490
2491         Reviewed by Eric.
2492
2493         - fixed "HashMap does not work with const pointer keys or values"
2494         http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
2495         
2496         * kxmlcore/HashMapPtrSpec.h:
2497         (KXMLCore::HashMap): In all methods, explicitly cast all pointers
2498         to void * before passing to internal implementation. Use C-style
2499         casts instead of new-style casts, because the real solution would
2500         require a combo of reinterpret_cast anc const_cast.
2501
2502
2503 2005-12-23  Maciej Stachowiak  <mjs@apple.com>
2504
2505         - this time for sure
2506
2507         * kxmlcore/RefPtr.h:
2508         (KXMLCore::::swap):
2509
2510 2005-12-22  Maciej Stachowiak  <mjs@apple.com>
2511
2512         - fix build problem from last commit.
2513
2514         * kxmlcore/RefPtr.h:
2515         (KXMLCore::::swap):
2516
2517 2005-12-21  Maciej Stachowiak  <mjs@apple.com>
2518
2519         Reviewed by Darin.
2520
2521         - Make HashMap/HashSet support non-POD types
2522         http://bugzilla.opendarwin.org/show_bug.cgi?id=5332
2523
2524         The changes for support are relatively simple, but I also made extensive changes to
2525         avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
2526
2527         * kxmlcore/HashTable.h:
2528         (KXMLCore::swap): specialize swap for pairs, to swap elements individually,
2529         so that excess copies can be avoided.
2530         (KXMLCore::Mover::move): Template function to either copy or swap, used
2531         when transferring elements from old table to new.
2532         (KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
2533         that took two or three function parameters now take a class parameter, this is
2534         the class used to do a normal lookup.
2535         (KXMLCore::IdentityHashTranslator::equal): Ditto.
2536         (KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
2537         to write into instead of returning a value to avoid redundant copies.
2538         (KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
2539         (KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
2540         functions. Added a FIXME about a remaining rare excess copy.
2541         (KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
2542         the key from Traits, to avoid creating and destroying pair, which copies.
2543         (KXMLCore::HashTable::isDeletedBucket): ditto
2544         (KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
2545         (KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
2546         work right for non-POD types.
2547         (KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
2548         (KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
2549         (KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
2550         (KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
2551         (KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
2552         (KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
2553         (KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
2554         work right
2555         * kxmlcore/HashFunctions.h:
2556         (KXMLCore::PointerHash): Specialize PointerHash for RefPtr
2557         * kxmlcore/HashMap.h:
2558         (KXMLCore::extractFirst): Return a reference not a full object to avoid
2559         copies.
2560         (KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
2561         to defer making the pair as long as possible, thus avoiding needless copies.
2562         (KXMLCore::HashMapTranslator::equal): ditto
2563         (KXMLCore::HashMapTranslator::translate): ditto
2564         (KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
2565         (KXMLCore::::set): Use inlineAdd
2566         (KXMLCore::::add): Use inlineAdd
2567         * kxmlcore/HashMapPtrSpec.h:
2568         (KXMLCore::): Pass KeyTraits along
2569         * kxmlcore/HashSet.h:
2570         (KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
2571         (KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
2572         the new HashTranslator approach.
2573         (KXMLCore::HashSetTranslatorAdapter::equal): ditto
2574         (KXMLCore::HashSetTranslatorAdapter::translate): ditto
2575         (KXMLCore::::insert): ditto
2576         * kxmlcore/HashTraits.h:
2577         (KXMLCore::GenericHashTraits): This is intended be used as a base class for
2578         customized traits: sensible defaults.
2579         (KXMLCore::): Use it a bunch
2580         (KXMLCore::assignDeleted): template function to allow pairs to be assigned the
2581         deleted value w/o excess copies.
2582         (KXMLCore::PairHashTraits::emptyValue): Updated
2583         (KXMLCore::PairHashTraits::deletedValue): Updated
2584         (KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
2585         (KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
2586         to either use use deletedValue or assignDeletedValue for the cases where we care.
2587         * kxmlcore/RefPtr.h:
2588         (KXMLCore::RefPtr::swap): Added swap method.
2589         (KXMLCore::swap): Added swap free function.
2590         * kjs/identifier.cpp:
2591         (KJS::CStringTranslator::hash): Use new HashTranslator class approach to
2592         alternate type based insertion.
2593         (KJS::CStringTranslator::equal): ditto
2594         (KJS::CStringTranslator::translate): ditto
2595         (KJS::Identifier::add): ditto
2596         (KJS::UCharBufferTranslator::hash): ditto
2597         (KJS::UCharBufferTranslator::equal): ditto
2598         (KJS::UCharBufferTranslator::translate): ditto
2599
2600         - irrelevant change:
2601         
2602         * kjs/array_object.cpp:
2603         (ArrayProtoFunc::callAsFunction): Removed a stray space.
2604
2605 2005-12-22  Anders Carlsson  <andersca@mac.com>
2606
2607         Reviewed by Eric and Darin.
2608
2609         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
2610         Would like to be able to define prototypes in headers
2611         
2612         * kjs/lookup.h:
2613         Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
2614         Also, namespace all macros by prefixing them with KJS_. 
2615
2616 2005-12-22  Darin Adler  <darin@apple.com>
2617
2618         Reviewed by Maciej.
2619
2620         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6191
2621           RefPtr/PassRefPtr have a leak issue, operator== issues
2622
2623         * kxmlcore/PassRefPtr.h:
2624         (KXMLCore::PassRefPtr::PassRefPtr): Remove non-template constructor that takes RefPtr
2625         since the constructor template that takes RefPtr should be sufficient. Add a constructor
2626         template that takes PassRefPtr&.
2627         (KXMLCore::PassRefPtr::adopt): Use PassRefPtr_Ref to avoid setting pointer first to
2628         0 and then to the pointer.
2629         (KXMLCore::PassRefPtr::operator=): Added template versions that take PassRefPtr& and
2630         RefPtr parameters.
2631         (KXMLCore::PassRefPtr::operator PassRefPtr<U>): Changed to fix leak -- old version
2632         would release and then ref.
2633         (KXMLCore::operator==): Make templates have two parameters so you can mix types.
2634         Also remove unneeded const in raw pointer versions.
2635         (KXMLCore::operator!=): Ditto.
2636
2637         * kxmlcore/RefPtr.h:
2638         (KXMLCore::RefPtr::RefPtr): Add constructor template that takes PassRefPtr.
2639         (KXMLCore::RefPtr::operator=): Add assignment operator templates that take
2640         RefPtr and PassRefPtr.
2641         (KXMLCore::operator==): Make templates have two parameters so you can mix types.
2642         Also remove unneeded const in raw pointer versions.
2643         (KXMLCore::operator!=): Ditto.
2644
2645 2005-12-21  Timothy Hatcher  <timothy@apple.com>
2646
2647         * JavaScriptCore.xcodeproj/project.pbxproj:
2648           Set tab width to 8, indent width to 4 and uses tabs to false per file.
2649
2650 2005-12-21  Geoffrey Garen  <ggaren@apple.com>
2651
2652         Reviewed by Darin.
2653
2654         Removed evil hack for determining if a type is an integer, replaced
2655         with template metaprogramming.
2656
2657         * JavaScriptCore.xcodeproj/project.pbxproj: Set tab size to 2 for
2658         testkjs.cpp
2659         * kjs/testkjs.cpp:
2660         (main): Inserted asserts to test IsInteger. FIXME: Move these to
2661         KXMLCore unit tests directory when we create one.
2662         * kxmlcore/HashTraits.h:
2663         (KXMLCore::): Added IsInteger class for querying types.
2664
2665 2005-12-20  Maciej Stachowiak  <mjs@apple.com>
2666
2667         Reviewed by Darin.
2668
2669         - made ALWAYS_INLINE declare things inline as well as __attribute__((always_inline))
2670         http://bugzilla.opendarwin.org/show_bug.cgi?id=6159
2671
2672         * kxmlcore/AlwaysInline.h:
2673
2674 2005-12-19  Maciej Stachowiak  <mjs@apple.com>
2675
2676         Reviewed by Darin.
2677
2678         - fixed a leak in the assignment operator from PassRefPtr to RefPtr
2679         http://bugzilla.opendarwin.org/show_bug.cgi?id=6158
2680
2681         * kxmlcore/RefPtr.h:
2682         (KXMLCore::RefPtr::operator=):
2683
2684         - fix problem with PassRefPtr that darin spotted - it lacked a copy constructor
2685         and therefore was using the default one, which can lead to excess derefs
2686
2687         I fixed this by adding a copy constructor from non-const
2688         reference, and by adding a template pass() function that you have
2689         to use when raw pointer or RefPtr are passed where PassRefPtr is
2690         expected.
2691
2692         * kjs/identifier.cpp:
2693         (KJS::Identifier::add): Changed to have PassRefPtr return type and
2694         pass() the results.     
2695         * kjs/identifier.h:
2696         * kjs/property_map.cpp:
2697         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Use pass()
2698         where required.
2699         * kjs/ustring.cpp:
2700         (KJS::UString::UString): Use pass() as needed.
2701         (KJS::UString::append): ditto
2702         (KJS::UString::substr): ditto
2703         * kjs/ustring.h:
2704         (KJS::UString::UString): Use initializer instead of assignment
2705         * kxmlcore/PassRefPtr.h:
2706         (KXMLCore::PassRefPtr::PassRefPtr): Added copy constructor
2707         (KXMLCore::pass): new template function to make it convenient to pass
2708         a PassRefPtr
2709
2710 2005-12-19  Geoffrey Garen  <ggaren@apple.com>
2711   
2712         Reviewed by Maciej.
2713
2714         Fixed <rdar://problem/4370397> Missing return statement in
2715         JSMethodNameToObjcMethodName.
2716
2717         JSMethodNameToObjcMethodName had a check for a name being too long, but
2718         the check was missing a return statement.
2719
2720         A lot of this code was confusing and some of it was wrong, so I fixed
2721         it up, added some asserts to catch this type of bug in the future, 
2722         changed some comments, and renamed some variables.
2723
2724         The two advantages of the new algorithm are (1) It makes writing past
2725         the end of the buffer virtually impossible because the test on the main
2726         loop is "while (not past end of buffer)" and (2) It's twice as fast
2727         because it doesn't call strlen. (There's no need to call strlen when
2728         we're walking the string ourselves.) 
2729         
2730         methodsNamed also supports arbitrary-length method names now. Just in 
2731         case the AppKit folks start getting REALLY verbose...
2732
2733         * bindings/objc/objc_class.mm:
2734         (KJS::Bindings::ObjcClass::methodsNamed):
2735         * bindings/objc/objc_utility.h:
2736         * bindings/objc/objc_utility.mm:
2737         (KJS::Bindings::JSMethodNameToObjcMethodName):
2738
2739 2005-12-19  Darin Adler  <darin@apple.com>
2740
2741         Originally done by both George Staikos and Alexey Proskuryakov.
2742
2743         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5706
2744           Sharedptr dependency can be removed
2745
2746         Our coding guidelines say "use 0 instead of NULL" and both RefPtr and
2747         PassRefPtr were using NULL, which required including a header that
2748         defines NULL.
2749
2750         * kxmlcore/PassRefPtr.h:
2751         (KXMLCore::PassRefPtr::PassRefPtr): Use 0 instead of NULL.
2752         (KXMLCore::PassRefPtr::operator!): Use ! instead of == NULL.
2753         * kxmlcore/RefPtr.h:
2754         (KXMLCore::RefPtr::RefPtr): Use 0 instead of NULL.
2755         (KXMLCore::RefPtr::operator!): Use ! instead of == NULL.
2756         Also did some reformatting.
2757
2758 2005-12-19  Darin Adler  <darin@apple.com>
2759
2760         Reviewed by Geoff Garen and Eric Seidel.
2761
2762         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4923
2763           stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
2764
2765         * kjs/simple_number.h: Removed many unnecessary includes, including
2766         the <cmath> one to work around GCC library header bugs. We may have to
2767         add some includes elsewhere for platforms other than OS X, since our
2768         prefix header takes care of some things.
2769
2770         * kxmlcore/AlwaysInline.h: Added. Now clients that don't include
2771         simple_number.h can still get the ALWAYS_INLINE macro.
2772         * JavaScriptCore.xcodeproj/project.pbxproj: Added AlwaysInline.h.
2773
2774         * bindings/NP_jsobject.h: Removed a lot of unnecessary includes
2775         and removed C-specific stuff from this C++-only header.
2776         * bindings/jni/jni_jsobject.h: Removed a lot of unnecessary includes
2777         and did some reformatting.
2778         * bindings/objc/objc_runtime.h:  Removed an unnecessary include.
2779         * bindings/runtime.h: Removed some unneeded includes. Reformatted.
2780         * bindings/runtime.cpp: Updated to compile with header changes,
2781         including a lot of reformatting.
2782         * bindings/runtime_object.h: Removed an unnecessary include.
2783
2784 2005-12-13  Maciej Stachowiak  <mjs@apple.com>
2785
2786         Reviewed by Geoff and Adele
2787
2788         - replaced custom Identifier hashtable with HashSet
2789
2790         * kjs/identifier.cpp:
2791         (KXMLCore::):
2792         (KJS::identifierTable):
2793         (KJS::Identifier::equal):
2794         (KJS::hash):
2795         (KJS::equal):
2796         (KJS::convert):
2797         (KJS::Identifier::add):
2798         (KJS::Identifier::remove):
2799         * kjs/identifier.h:
2800         * kjs/internal.cpp:
2801         (KJS::InterpreterImp::initGlobalObject):
2802
2803 2005-12-18  Justin Haygood  <justin@xiondigital.net>
2804
2805         Reviewed, tweaked, and landed by Darin.
2806
2807         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5227
2808           Array indexOf() extension for JavaScript 1.5 Core
2809
2810         * kjs/array_object.h:
2811         * kjs/array_object.cpp: (ArrayProtoFunc::callAsFunction): Added implementation of indexOf.
2812
2813 2005-12-18  Anders Carlsson  <andersca@mac.com>
2814
2815         Reviewed by Darin and Geoffrey.
2816
2817         - fix for <http://bugzilla.opendarwin.org/show_bug.cgi?id=4000>
2818         Object.prototype is missing isPrototypeOf
2819         
2820         * kjs/object_object.cpp:
2821         (ObjectPrototype::ObjectPrototype):
2822         Add isPrototypeOf to object prototype.
2823         
2824         (ObjectProtoFunc::callAsFunction):
2825         Implement isPrototypeOf
2826         
2827         * kjs/object_object.h:
2828         (KJS::ObjectProtoFunc::):
2829         Add id for isPrototypeOf.
2830
2831 2005-12-17  Geoffrey Garen  <ggaren@apple.com>
2832
2833         Reviewed by Darin.
2834
2835         Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6119
2836         split() function ignores case insensitive modifier.
2837
2838         Glossary:
2839         RegExpImp: The C++ object you get when JavaScript executes
2840                    "new RegExp()".
2841         RegExp:    A C++ wrapper object that performs regular expression
2842                    matching on behalf of a RegExpImp.
2843
2844         Instead of unnecessarily constructing a RegExp which (wrongly) lacks
2845         any modifiers, String.split() now uses the RegExp built in to the 
2846         RegExpImp passed to it, which has the right modifiers already.
2847
2848         I also cleaned up other bits of the string code to standardized how
2849         we handle RegExpImp arguments.
2850
2851         * ChangeLog:
2852         * kjs/string_object.cpp:
2853         (replace):
2854         (StringProtoFunc::callAsFunction):
2855
2856 2005-12-16  David Hyatt  <hyatt@apple.com>
2857
2858         Remove unused RefPtr constructors that can create an ambiguity in ustring on some platforms.
2859         
2860         Reviewed by mjs
2861
2862         * kxmlcore/RefPtr.h:
2863         (KXMLCore::RefPtr::RefPtr):
2864
2865 2005-12-15  Darin Adler  <darin@apple.com>
2866
2867         Reviewed by Maciej.
2868
2869         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5688
2870           speed up JavaScript parsing by not creating a UString just to parse
2871
2872         * kjs/internal.h:
2873         * kjs/internal.cpp: (KJS::InterpreterImp::evaluate): Change to take a character pointer
2874         and length rather than a UString.
2875
2876         * kjs/interpreter.h:
2877         * kjs/interpreter.cpp: (Interpreter::evaluate): Ditto.
2878
2879         * kjs/protect.h: Remove uneeded "convert to bool" operator since we already have a
2880         "convert to raw pointer" operator in this class.
2881
2882 === Safari-521~5 ===
2883
2884 2005-12-13  Geoffrey Garen  <ggaren@apple.com>
2885
2886         Updated test results to match Anders's last fix.
2887
2888         * tests/mozilla/expected.html:
2889
2890 2005-12-13  Anders Carlsson  <andersca@mac.com>
2891
2892         * ChangeLog: Add titles for my bugzilla bugs.
2893
2894 2005-12-13  Anders Carlsson  <andersca@mac.com>
2895
2896         Reviewed by Darin.
2897
2898         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=6041>
2899         Support property getters and setters.
2900         
2901         * bindings/runtime_array.cpp:
2902         (RuntimeArray::lengthGetter):
2903         (RuntimeArray::indexGetter):
2904         * bindings/runtime_array.h:
2905         * bindings/runtime_method.cpp:
2906         (RuntimeMethod::lengthGetter):
2907         * bindings/runtime_method.h:
2908         * bindings/runtime_object.cpp:
2909         (RuntimeObjectImp::fallbackObjectGetter):
2910         (RuntimeObjectImp::fieldGetter):
2911         (RuntimeObjectImp::methodGetter):
2912         * bindings/runtime_object.h:
2913         * kjs/array_instance.h:
2914         * kjs/array_object.cpp:
2915         (ArrayInstance::lengthGetter):
2916         (getProperty):
2917         Update for changes to PropertySlot::getValue and
2918         PropertySlot::GetValueFunc.
2919         
2920         * kjs/collector.cpp:
2921         (KJS::className):
2922         Handle GetterSetterType.
2923         
2924         * kjs/function.cpp:
2925         (KJS::FunctionImp::argumentsGetter):
2926         (KJS::FunctionImp::lengthGetter):
2927         (KJS::Arguments::mappedIndexGetter):
2928         (KJS::ActivationImp::argumentsGetter):
2929         * kjs/function.h:
2930         Update for changes to PropertySlot::getValue and
2931         PropertySlot::GetValueFunc.
2932         
2933         * kjs/grammar.y:
2934         Rework grammar parts for get set declarations directly
2935         in the object literal.
2936         
2937         * kjs/internal.cpp:
2938         (KJS::GetterSetterImp::mark):
2939         (KJS::GetterSetterImp::toPrimitive):
2940         (KJS::GetterSetterImp::toBoolean):
2941         (KJS::GetterSetterImp::toNumber):
2942         (KJS::GetterSetterImp::toString):
2943         (KJS::GetterSetterImp::toObject):
2944         Add type conversion functions. These aren't meant to be called.
2945         
2946         (KJS::printInfo):
2947         Handle GetterSetterType.
2948         
2949         * kjs/lookup.h:        
2950         (KJS::staticFunctionGetter):
2951         (KJS::staticValueGetter):
2952         Update for changes to PropertySlot::GetValueFunc.
2953         
2954         * kjs/nodes.cpp:
2955         Refactor they way properties nodes are implemented.
2956         We now have a PropertyListNode which is a list of PropertyNodes.
2957         Each PropertyNode has a name (which is a PropertyNameNode) and an associated
2958         value node. PropertyNodes can be of different types. The Constant type is the
2959         old constant declaration and the Getter and Setter types are for property getters
2960         and setters.
2961         (ResolveNode::evaluate):
2962         Update for changes to PropertySlot::getValue.
2963         
2964         (PropertyListNode::evaluate):
2965         Go through all property nodes and set them on the newly created object. If the
2966         property nodes are of type Getter or Setter, define getters and setters. Otherwise,
2967         just add the properties like before.
2968         
2969         (PropertyNode::evaluate):
2970         This should never be called directly.
2971         
2972         (PropertyNameNode::evaluate):
2973         Rename from PropertyNode::evaluate.
2974         
2975         (FunctionCallResolveNode::evaluate):
2976         (FunctionCallBracketNode::evaluate):
2977         (FunctionCallDotNode::evaluate):
2978         (PostfixResolveNode::evaluate):
2979         (PostfixBracketNode::evaluate):
2980         (PostfixDotNode::evaluate):
2981         (TypeOfResolveNode::evaluate):
2982         (PrefixResolveNode::evaluate):
2983         (PrefixBracketNode::evaluate):
2984         (PrefixDotNode::evaluate):
2985         (AssignResolveNode::evaluate):
2986         (AssignDotNode::evaluate):
2987         (AssignBracketNode::evaluate):
2988         Update for changes to PropertySlot::getValue.
2989         
2990         * kjs/nodes.h:
2991         (KJS::PropertyNameNode::PropertyNameNode):
2992         Rename from PropertyNode.
2993         
2994         (KJS::PropertyNode::):
2995         (KJS::PropertyNode::PropertyNode):
2996         New class, representing a single property.
2997         
2998         (KJS::PropertyListNode::PropertyListNode):
2999         Rename from PropertyValueNode.
3000         
3001         (KJS::FuncExprNode::FuncExprNode):
3002         Put ParameterNode parameter last, and make it optional.
3003         
3004         (KJS::ObjectLiteralNode::ObjectLiteralNode):
3005         Use a PropertyListNode here now.
3006         
3007         * kjs/nodes2string.cpp:
3008         (PropertyListNode::streamTo):
3009         Iterate through all property nodes.
3010         
3011         (PropertyNode::streamTo):
3012         Print out the name and value. Doesn't handle getters and setters currently.
3013         
3014         (PropertyNameNode::streamTo):
3015         Rename from PropertyNode::streamTo.
3016         
3017         * kjs/object.cpp:
3018         (KJS::JSObject::get):
3019         Update for changes to PropertySlot::getValue.
3020         
3021         (KJS::JSObject::put):
3022         If the property already exists and has a Setter, invoke
3023         the setter function instead of setting the property directly.
3024         
3025         (KJS::JSObject::defineGetter):
3026         (KJS::JSObject::defineSetter):
3027         New functions for defining property getters and setters on the object.
3028         
3029         * kjs/object.h:
3030         (KJS::GetterSetterImp::type):
3031         (KJS::GetterSetterImp::GetterSetterImp):
3032         (KJS::GetterSetterImp::getGetter):
3033         (KJS::GetterSetterImp::setGetter):
3034         (KJS::GetterSetterImp::getSetter):
3035         (KJS::GetterSetterImp::setSetter):
3036         New class for properties which have getters and setters defined.
3037         This class is only used internally and should never be seen from the outside.
3038         
3039         (KJS::JSObject::getOwnPropertySlot):
3040          If the property is a getter, call setGetterSlot on the property slot.
3041          
3042         * kjs/object_object.cpp:
3043         (ObjectPrototype::ObjectPrototype):
3044         Add __defineGetter__, __defineSetter, __lookupGetter__, __lookupSetter__
3045         to prototype.
3046         
3047         (ObjectProtoFunc::callAsFunction):
3048         Implement handlers for new functions.
3049         
3050         * kjs/object_object.h:
3051         (KJS::ObjectProtoFunc::):
3052         Add ids for new functions.
3053         
3054         * kjs/property_slot.cpp:
3055         (KJS::PropertySlot::undefinedGetter):
3056         Update for changes to PropertySlot::GetValueFunc.
3057         
3058         (KJS::PropertySlot::functionGetter):
3059         Call the function getter object and return its value.
3060         
3061         * kjs/property_slot.h:
3062         (KJS::PropertySlot::getValue):
3063         Add a new argument which is the original object that
3064         getPropertySlot was called on.
3065         
3066         (KJS::PropertySlot::setGetterSlot):
3067         (KJS::PropertySlot::):
3068         New function which sets a getter slot. When getValue is called on a 
3069         getter slot, the getter function object is invoked.
3070         
3071         * kjs/string_object.cpp:
3072         (StringInstance::lengthGetter):
3073         (StringInstance::indexGetter):
3074         * kjs/string_object.h:
3075         Update for changes to PropertySlot::GetValueFunc.
3076         
3077         * kjs/value.h:
3078         (KJS::):
3079         Add GetterSetterType and make GetterSetterImp a friend class of JSCell.
3080
3081 2005-12-12  Maciej Stachowiak  <mjs@apple.com>
3082
3083         Reviewed by Eric.
3084
3085         - added a new HashCountedSet class for the common pattern of mapping items to counts that can change
3086         
3087         * kxmlcore/HashCountedSet.h: Added.
3088         (KXMLCore::HashCountedSet::*): Implemented, on top of HashMap.
3089         * kxmlcore/HashMap.h:
3090         (KXMLCore::HashMap::add): New method - does not replace existing value if key already present
3091         but otherwise like set().
3092         (KXMLCore::HashMap::set): Improved comments.
3093         * kxmlcore/HashMapPtrSpec.h:
3094         (KXMLCore::HashMap::add): Added to specializations too.
3095         * JavaScriptCore.xcodeproj/project.pbxproj: Add new  file.
3096         * kxmlcore/HashFunctions.h: Added include of stdint.h
3097         
3098         - replaced the custom hashtable for values protected from GC with HashCountedSet
3099
3100         * kjs/collector.cpp:
3101         (KJS::Collector::protect): Moved code here from ProtectedValues::increaseProtectCount
3102         since the code is so simple now.
3103         (KJS::Collector::unprotect): Ditto for ProtectedValues::decreaseProtectCount.
3104         (KJS::Collector::markProtectedObjects): Updated for new way of doing things, now
3105         simpler and safer.
3106         (KJS::Collector::numReferencedObjects): ditto
3107         (KJS::Collector::rootObjectClasses): ditto
3108         * kjs/collector.h: Added protect and unprotect static methods
3109         * kjs/protect.h:
3110         (KJS::gcProtect): Updated for removal of ProtectedValues class
3111         (KJS::gcUnprotect): likewise
3112         * kjs/protected_values.cpp: Removed.
3113         * kjs/protected_values.h: Removed.
3114
3115 2005-12-10  Darin Adler  <darin@apple.com>
3116
3117         Rubber stamped by Maciej.
3118
3119         - did long-promised KJS renaming:
3120         
3121             ValueImp -> JSValue
3122             ObjectImp -> JSObject
3123             AllocatedValueImp -> JSCell
3124         
3125         A renaming to get a class out of the way
3126         
3127             KJS::Bindings::JSObject -> JavaJSObject
3128  
3129         and some other "imp-reduction" renaming
3130         
3131             *InstanceImp -> *Instance
3132             *ProtoFuncImp -> *ProtoFunc
3133             *PrototypeImp -> *Prototype
3134             ArgumentsImp -> Arguments
3135             RuntimeArrayImp -> RuntimeArray
3136             RuntimeMethodImp -> RuntimeMethod
3137
3138         * most files and functions
3139
3140 2005-12-10  Darin Adler  <darin@apple.com>
3141
3142         Reviewed by Maciej.
3143
3144         - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
3145
3146         Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().
3147
3148         * bindings/NP_jsobject.cpp:
3149         (_NPN_Evaluate):
3150         * bindings/c/c_instance.cpp:
3151         (KJS::Bindings::CInstance::invokeMethod):
3152         (KJS::Bindings::CInstance::invokeDefaultMethod):
3153         * bindings/c/c_runtime.cpp:
3154         (CField::valueFromInstance):
3155         * bindings/c/c_utility.cpp:
3156         (KJS::Bindings::convertNPVariantToValue):
3157         * bindings/jni/jni_instance.cpp:
3158         (JavaInstance::invokeMethod):
3159         (JavaInstance::invokeDefaultMethod):
3160         * bindings/jni/jni_jsobject.cpp:
3161         (JSObject::eval):
3162         (JSObject::convertJObjectToValue):
3163         * bindings/jni/jni_runtime.cpp:
3164         (JavaArray::convertJObjectToArray):
3165         (JavaField::valueFromInstance):
3166         (JavaArray::valueAt):
3167         * bindings/objc/WebScriptObject.mm:
3168         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3169         (-[WebScriptObject evaluateWebScript:]):
3170         (-[WebScriptObject valueForKey:]):
3171         (-[WebScriptObject webScriptValueAtIndex:]):
3172         * bindings/objc/objc_instance.mm:
3173         (ObjcInstance::invokeMethod):
3174         (ObjcInstance::invokeDefaultMethod):
3175         (ObjcInstance::getValueOfUndefinedField):
3176         * bindings/objc/objc_runtime.mm:
3177         (ObjcField::valueFromInstance):
3178         (ObjcFallbackObjectImp::callAsFunction):
3179         * bindings/objc/objc_utility.mm:
3180         (KJS::Bindings::convertNSStringToString):
3181         (KJS::Bindings::convertObjcValueToValue):
3182         * bindings/runtime.h:
3183         (KJS::Bindings::Class::fallbackObject):
3184         (KJS::Bindings::Instance::getValueOfUndefinedField):
3185         (KJS::Bindings::Instance::valueOf):
3186         * bindings/runtime_array.cpp:
3187         (RuntimeArrayImp::lengthGetter):
3188         * bindings/runtime_method.cpp:
3189         (RuntimeMethodImp::lengthGetter):
3190         (RuntimeMethodImp::callAsFunction):
3191         (RuntimeMethodImp::execute):
3192         * kjs/array_object.cpp:
3193         (ArrayInstanceImp::lengthGetter):
3194         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
3195         (ArrayPrototypeImp::ArrayPrototypeImp):
3196         (ArrayProtoFuncImp::ArrayProtoFuncImp):
3197         (ArrayProtoFuncImp::callAsFunction):
3198         (ArrayObjectImp::ArrayObjectImp):
3199         * kjs/bool_object.cpp:
3200         (BooleanPrototypeImp::BooleanPrototypeImp):
3201         (BooleanProtoFuncImp::callAsFunction):
3202         (BooleanObjectImp::BooleanObjectImp):
3203         (BooleanObjectImp::callAsFunction):
3204         * kjs/error_object.cpp:
3205         (ErrorPrototypeImp::ErrorPrototypeImp):
3206         (ErrorProtoFuncImp::ErrorProtoFuncImp):
3207         (ErrorProtoFuncImp::callAsFunction):
3208         (ErrorObjectImp::ErrorObjectImp):
3209         (NativeErrorImp::NativeErrorImp):
3210         * kjs/function.cpp:
3211         (KJS::FunctionImp::callAsFunction):
3212         (KJS::FunctionImp::processParameters):
3213         (KJS::FunctionImp::argumentsGetter):
3214         (KJS::FunctionImp::lengthGetter):
3215         (KJS::DeclaredFunctionImp::execute):
3216         (KJS::encode):
3217         (KJS::decode):
3218         (KJS::GlobalFuncImp::callAsFunction):
3219         * kjs/function_object.cpp:
3220         (FunctionPrototypeImp::FunctionPrototypeImp):
3221         (FunctionPrototypeImp::callAsFunction):
3222         (FunctionProtoFuncImp::callAsFunction):
3223         (FunctionObjectImp::FunctionObjectImp):
3224         * kjs/internal.cpp:
3225         (KJS::InterpreterImp::initGlobalObject):
3226         * kjs/interpreter.h:
3227         * kjs/lookup.h:
3228         * kjs/math_object.cpp:
3229         (MathObjectImp::getValueProperty):
3230         (MathFuncImp::callAsFunction):
3231         * kjs/nodes.cpp:
3232         (Node::setExceptionDetailsIfNeeded):
3233         (NullNode::evaluate):
3234         (PropertyNode::evaluate):
3235         (FunctionCallBracketNode::evaluate):
3236         (FunctionCallDotNode::evaluate):
3237         (PostfixBracketNode::evaluate):
3238         (PostfixDotNode::evaluate):
3239         (VoidNode::evaluate):
3240         (PrefixBracketNode::evaluate):
3241         (PrefixDotNode::evaluate):
3242         (ShiftNode::evaluate):
3243         (valueForReadModifyAssignment):
3244         (AssignDotNode::evaluate):
3245         (AssignBracketNode::evaluate):
3246         (VarDeclNode::evaluate):
3247         (VarDeclNode::processVarDecls):
3248         (VarDeclListNode::evaluate):
3249         (ReturnNode::execute):
3250         (CaseClauseNode::evalStatements):
3251         (ParameterNode::evaluate):
3252         (FuncDeclNode::processFuncDecl):
3253         * kjs/nodes.h:
3254         (KJS::StatementNode::evaluate):
3255         * kjs/number_object.cpp:
3256         (NumberPrototypeImp::NumberPrototypeImp):
3257         (NumberProtoFuncImp::callAsFunction):
3258         (NumberObjectImp::NumberObjectImp):
3259         (NumberObjectImp::getValueProperty):
3260         (NumberObjectImp::callAsFunction):
3261         * kjs/object.cpp:
3262         (KJS::ObjectImp::get):
3263         (KJS::Error::create):
3264         * kjs/object_object.cpp:
3265         (ObjectPrototypeImp::ObjectPrototypeImp):
3266         (ObjectProtoFuncImp::callAsFunction):
3267         (ObjectObjectImp::ObjectObjectImp):
3268         * kjs/property_slot.cpp:
3269         (KJS::PropertySlot::undefinedGetter):
3270         * kjs/regexp_object.cpp:
3271         (RegExpPrototypeImp::RegExpPrototypeImp):
3272         (RegExpProtoFuncImp::callAsFunction):
3273         (RegExpObjectImp::RegExpObjectImp):
3274         (RegExpObjectImp::arrayOfMatches):
3275         (RegExpObjectImp::getBackref):
3276         (RegExpObjectImp::getLastMatch):
3277         (RegExpObjectImp::getLastParen):
3278         (RegExpObjectImp::getLeftContext):
3279         (RegExpObjectImp::getRightContext):
3280         (RegExpObjectImp::getValueProperty):
3281         (RegExpObjectImp::construct):
3282         * kjs/string_object.cpp:
3283         (StringInstanceImp::StringInstanceImp):
3284         (StringPrototypeImp::StringPrototypeImp):
3285         (replace):
3286         (StringProtoFuncImp::callAsFunction):
3287         (StringObjectImp::StringObjectImp):
3288         (StringObjectImp::callAsFunction):
3289         (StringObjectFuncImp::StringObjectFuncImp):
3290         (StringObjectFuncImp::callAsFunction):
3291         * kjs/testkjs.cpp:
3292         (TestFunctionImp::callAsFunction):
3293         (VersionFunctionImp::callAsFunction):
3294         * kjs/value.h:
3295
3296 2005-12-10  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
3297
3298         Reviewed by Maciej, landed by Darin.
3299
3300         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3539
3301           Array join and toString methods do not support circular references
3302
3303         * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction):
3304         Added set of visited objects -- don't recurse if item is already in the set.
3305
3306 2005-12-08  Maciej Stachowiak  <mjs@apple.com>
3307
3308         Reviewed by John.
3309
3310         - fix major memory leak and resultant slowdown on JavaScript iBench from
3311         my PassRefPtr changes
3312         
3313         * kjs/ustring.cpp:
3314         (KJS::UString::Rep::create): I forgot to change one of the two overloads to create
3315         with a refcount of 0 instead of 1 (the smart pointer then bumps it. But instead of
3316         changing it, I changed both to start with a refcounter of 1 and use PassRefPtr::adopt
3317         to adopt the initial refcount, this may be a hair more efficient.
3318
3319         - made the assignment operators for smart pointers inline because Shark said so
3320         
3321         * kxmlcore/PassRefPtr.h:
3322         (KXMLCore::::operator=):
3323         * kxmlcore/RefPtr.h:
3324         (KXMLCore::::operator=):
3325
3326 2005-12-06  Anders Carlsson  <andersca@mac.com>
3327
3328         Reviewed by Darin.
3329
3330         - fix build when using gcc 4
3331                 
3332         * kjs/ustring.h:
3333         Make Rep public.
3334
3335         * kxmlcore/PassRefPtr.h:
3336         (KXMLCore::::operator):
3337         Fix a typo.
3338
3339 2005-12-05  Maciej Stachowiak  <mjs@apple.com>
3340
3341         Reviewed by Eric.
3342
3343         - add PassRefPtr, a smart pointer class that works in conjunction
3344         with RefPtr but has transfer-of-ownership semantics
3345         - apply RefPtr and PassRefPtr to UString
3346         - cleaned up UString a little so that it doesn't need to have so many friend classes
3347
3348         * JavaScriptCore.xcodeproj/project.pbxproj:
3349         * kjs/identifier.cpp:
3350         (KJS::Identifier::add):
3351         * kjs/identifier.h:
3352         (KJS::Identifier::Identifier):
3353         (KJS::Identifier::equal):
3354         * kjs/property_map.cpp:
3355         (KJS::PropertyMap::get):
3356         (KJS::PropertyMap::getLocation):
3357         (KJS::PropertyMap::put):
3358         (KJS::PropertyMap::remove):
3359         * kjs/ustring.cpp:
3360         (KJS::UCharReference::operator=):
3361         (KJS::UCharReference::ref):
3362         (KJS::UString::Rep::createCopying):
3363         (KJS::UString::Rep::create):
3364         (KJS::UString::usedCapacity):
3365         (KJS::UString::usedPreCapacity):
3366         (KJS::UString::expandCapacity):
3367         (KJS::UString::expandPreCapacity):
3368         (KJS::UString::UString):
3369         (KJS::UString::spliceSubstringsWithSeparators):
3370         (KJS::UString::append):
3371         (KJS::UString::operator=):
3372         (KJS::UString::toStrictUInt32):
3373         (KJS::UString::substr):
3374         (KJS::UString::copyForWriting):
3375         (KJS::operator==):
3376         * kjs/ustring.h:
3377         (KJS::UString::UString):
3378         (KJS::UString::~UString):
3379         (KJS::UString::data):
3380         (KJS::UString::isNull):
3381         (KJS::UString::isEmpty):
3382         (KJS::UString::size):
3383         (KJS::UString::rep):
3384         * kxmlcore/RefPtr.h:
3385         (KXMLCore::RefPtr::RefPtr):
3386         (KXMLCore::RefPtr::operator*):
3387         (KXMLCore::::operator):
3388         (KXMLCore::operator==):
3389         (KXMLCore::operator!=):
3390         (KXMLCore::static_pointer_cast):
3391         (KXMLCore::const_pointer_cast):
3392
3393 2005-12-04  Geoffrey Garen  <ggaren@apple.com>
3394
3395         Update test results to match Anders's last checkin.
3396
3397         * tests/mozilla/expected.html:
3398
3399 2005-12-04  Anders Carlsson  <andersca@mac.com>
3400
3401         Reviewed by Geoffrey.
3402
3403         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3999>
3404         Object.prototype is missing propertyIsEnumerable
3405         
3406         * kjs/object.cpp:
3407         (KJS::ObjectImp::canPut):
3408         Refactor to use getPropertyAttributes.
3409
3410         (KJS::ObjectImp::propertyIsEnumerable):
3411         New function which checks if a property is enumerable.
3412
3413         (KJS::ObjectImp::getPropertyAttributes):
3414         * kjs/object.h:
3415         Add getPropertyAttributes and propertyIsEnumerable.
3416
3417         * kjs/object_object.cpp:
3418         (ObjectPrototypeImp::ObjectPrototypeImp):
3419         (ObjectProtoFuncImp::callAsFunction):
3420         * kjs/object_object.h:
3421         (KJS::ObjectProtoFuncImp::):
3422         Add propertyIsEnumerable to the Object prototype.
3423
3424 2005-12-01  Maciej Stachowiak  <mjs@apple.com>
3425
3426         Reviewed by Tim Hatcher.
3427
3428         - removed deprecated reset, isNull and nonNull methods
3429
3430         * kxmlcore/RefPtr.h:
3431
3432 2005-12-01  Anders Carlsson  <andersca@mac.com>
3433
3434         Reviewed by Darin.
3435
3436         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3382>
3437         nodes2strings.cpp fails to print left expression of ForInNode when 'var' is not used
3438         
3439         Patch by Mark Rowe.
3440
3441         * kjs/nodes2string.cpp:
3442         (ForInNode::streamTo):
3443         Add lexpr if there's no varDecl.
3444
3445 2005-12-01  Maciej Stachowiak  <mjs@apple.com>
3446
3447         Rubber stamped by Eric.
3448
3449         - renamed SharedPtr to RefPtr via script
3450
3451         * JavaScriptCore.xcodeproj/project.pbxproj:
3452         * kjs/function.cpp:
3453         (KJS::GlobalFuncImp::callAsFunction):
3454         * kjs/function.h:
3455         * kjs/function_object.cpp:
3456         (FunctionObjectImp::construct):
3457         * kjs/internal.cpp:
3458         (KJS::Parser::parse):
3459         (KJS::InterpreterImp::checkSyntax):
3460         (KJS::InterpreterImp::evaluate):
3461         * kjs/internal.h:
3462         * kjs/nodes.h:
3463         * kjs/nodes2string.cpp:
3464         (KJS::SourceStream::operator<<):
3465         * kjs/protect.h:
3466         * kxmlcore/RefPtr.h: Added.
3467         (KXMLCore::RefPtr::RefPtr):
3468         (KXMLCore::RefPtr::~RefPtr):
3469         (KXMLCore::RefPtr::isNull):
3470         (KXMLCore::RefPtr::notNull):
3471         (KXMLCore::RefPtr::reset):
3472         (KXMLCore::RefPtr::get):
3473         (KXMLCore::RefPtr::operator*):
3474         (KXMLCore::RefPtr::operator->):
3475         (KXMLCore::RefPtr::operator!):
3476         (KXMLCore::RefPtr::operator UnspecifiedBoolType):
3477         (KXMLCore::::operator):
3478         (KXMLCore::operator==):
3479         (KXMLCore::operator!=):
3480         (KXMLCore::static_pointer_cast):
3481         (KXMLCore::const_pointer_cast):
3482         * kxmlcore/SharedPtr.h: Removed.
3483
3484 2005-11-30  Maciej Stachowiak  <mjs@apple.com>
3485
3486         Reviewed by Dave Hyatt.
3487
3488         - change idiom used for implicit bool conversion of smart pointers, because the old one gives weird error messages sometimes
3489
3490         * kjs/protect.h:
3491         (KJS::ProtectedPtr::operator UnspecifiedBoolType):
3492         * kxmlcore/SharedPtr.h:
3493         (KXMLCore::SharedPtr::operator UnspecifiedBoolType):
3494
3495 2005-11-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3496
3497         Reviewed by ggaren.  Committed by eseidel.
3498
3499         Date conversion to local time gets the DST flag wrong sometimes
3500         http://bugzilla.opendarwin.org/show_bug.cgi?id=5514
3501
3502         * kjs/date_object.cpp:
3503         (KJS::isTime_tSigned):
3504         (KJS::DateProtoFuncImp::callAsFunction):
3505
3506 2005-11-26  Maciej Stachowiak  <mjs@apple.com>
3507
3508         Rubber stamped by Eric.
3509
3510         - renamed InterpreterLock to JSLock
3511
3512         * bindings/NP_jsobject.cpp:
3513         (_NPN_Invoke):
3514         (_NPN_Evaluate):
3515         (_NPN_GetProperty):
3516         (_NPN_SetProperty):
3517         (_NPN_RemoveProperty):
3518         (_NPN_HasProperty):
3519         (_NPN_HasMethod):
3520         (_NPN_SetException):
3521         * bindings/jni/jni_jsobject.cpp:
3522         (JSObject::call):
3523         (JSObject::eval):
3524         (JSObject::getMember):
3525         (JSObject::setMember):
3526         (JSObject::removeMember):
3527         (JSObject::getSlot):
3528         (JSObject::setSlot):
3529         (JSObject::toString):
3530         (JSObject::convertJObjectToValue):
3531         * bindings/objc/WebScriptObject.mm:
3532         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3533         (-[WebScriptObject evaluateWebScript:]):
3534         (-[WebScriptObject setValue:forKey:]):
3535         (-[WebScriptObject valueForKey:]):
3536         (-[WebScriptObject removeWebScriptKey:]):
3537         (-[WebScriptObject stringRepresentation]):
3538         (-[WebScriptObject webScriptValueAtIndex:]):
3539         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
3540         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
3541         * bindings/runtime.cpp:
3542         (Instance::createRuntimeObject):
3543         * bindings/runtime_root.cpp:
3544         (KJS::Bindings::addNativeReference):
3545         (KJS::Bindings::removeNativeReference):
3546         (RootObject::removeAllNativeReferences):
3547         * bindings/runtime_root.h:
3548         (KJS::Bindings::RootObject::~RootObject):
3549         (KJS::Bindings::RootObject::setRootObjectImp):
3550         * bindings/testbindings.cpp:
3551         (main):
3552         * bindings/testbindings.mm:
3553         (main):
3554         * kjs/JSLock.cpp:
3555         (KJS::initializeJSLock):
3556         (KJS::JSLock::lock):
3557         (KJS::JSLock::unlock):
3558         (KJS::JSLock::lockCount):
3559         (KJS::JSLock::DropAllLocks::DropAllLocks):
3560         (KJS::JSLock::DropAllLocks::~DropAllLocks):
3561         * kjs/JSLock.h:
3562         (KJS::JSLock::JSLock):
3563         (KJS::JSLock::~JSLock):
3564         * kjs/collector.cpp:
3565         (KJS::Collector::allocate):
3566         (KJS::Collector::collect):
3567         * kjs/internal.cpp:
3568         (KJS::InterpreterImp::InterpreterImp):
3569         (KJS::InterpreterImp::clear):
3570         (KJS::InterpreterImp::checkSyntax):
3571         (KJS::InterpreterImp::evaluate):
3572         * kjs/interpreter.cpp:
3573         (Interpreter::evaluate):
3574         * kjs/protect.h:
3575         (KJS::::ProtectedPtr):
3576         (KJS::::~ProtectedPtr):
3577         (KJS::::operator):
3578         * kjs/protected_reference.h:
3579         (KJS::ProtectedReference::ProtectedReference):
3580         (KJS::ProtectedReference::~ProtectedReference):
3581         (KJS::ProtectedReference::operator=):
3582         * kjs/protected_values.cpp:
3583         (KJS::ProtectedValues::getProtectCount):
3584         (KJS::ProtectedValues::increaseProtectCount):
3585         (KJS::ProtectedValues::decreaseProtectCount):
3586         * kjs/testkjs.cpp:
3587         (TestFunctionImp::callAsFunction):
3588         (main):
3589
3590 2005-11-26  Darin Adler  <darin@apple.com>
3591
3592         Reviewed by eseidel.  Committed by eseidel.
3593
3594         Inline ScopeChain functions for speed.
3595         http://bugzilla.opendarwin.org/show_bug.cgi?id=5687
3596
3597         * kjs/object.h:
3598         (KJS::ScopeChain::mark):
3599         * kjs/scope_chain.cpp:
3600         * kjs/scope_chain.h:
3601         (KJS::ScopeChain::ref):
3602         (KJS::ScopeChain::operator=):
3603         (KJS::ScopeChain::bottom):
3604         (KJS::ScopeChain::push):
3605         (KJS::ScopeChain::pop):
3606
3607 2005-11-21  Maciej Stachowiak  <mjs@apple.com>
3608
3609         Reviewed by Geoff.
3610
3611         <rdar://problem/4139620> Seed: WebKit: hang when sending XMLHttpRequest if automatic proxy config is used
3612
3613         Also factored locking code completely into a separate class, and
3614         added a convenient packaged way to temporarily drop locks.
3615
3616         * JavaScriptCore.xcodeproj/project.pbxproj:
3617         * kjs/JSLock.cpp: Added.
3618         (KJS::initializeInterpreterLock):
3619         (KJS::InterpreterLock::lock):
3620         (KJS::InterpreterLock::unlock):
3621         (KJS::InterpreterLock::lockCount):
3622         (KJS::InterpreterLock::DropAllLocks::DropAllLocks):
3623         (KJS::InterpreterLock::DropAllLocks::~DropAllLocks):
3624         * kjs/JSLock.h: Added.
3625         (KJS::InterpreterLock::InterpreterLock):
3626         (KJS::InterpreterLock::~InterpreterLock):
3627         * kjs/internal.cpp:
3628         * kjs/internal.h:
3629         * kjs/interpreter.cpp:
3630         * kjs/interpreter.h:
3631         * kjs/protect.h:
3632         * kjs/testkjs.cpp:
3633         (TestFunctionImp::callAsFunction):
3634
3635 2005-11-21  Eric Seidel  <eseidel@apple.com>
3636
3637         Rubber-stamped by hyatt.
3638         
3639         Removed JavaScriptCore+SVG target.
3640
3641         * JavaScriptCore.xcodeproj/project.pbxproj:
3642
3643 2005-11-15  Geoffrey Garen  <ggaren@apple.com>
3644
3645         Reviewed by mjs.
3646         
3647         - Fixed <rdar://problem/4342216> Installer crash in 
3648           KJS::ValueImp::marked() when garbage collector runs inside call to 
3649           ConstantValues::init()
3650           
3651         I took responsibility for initializing and marking ConstantValues away 
3652         from InterpreterImp, since it's possible to reference such a value 
3653         before any interpreter has been created and after the last interpreter 
3654         has been destroyed.
3655
3656         InterpreterImp::lock now initializes ConstantValues. It's a good
3657         place for the initialization because you have to call it before
3658         creating any objects. Since ::lock can be called more than once,
3659         I added a check in ConstantValues::init to ensure that it executes 
3660         only once.
3661
3662         Collector:collect is now responsible for marking ConstantValues.
3663
3664         We no longer clear the ConstantValues since we can't guarantee that no 
3665         one has a reference to them.
3666
3667         FIXME: This is hackery. The long-term plan is to make ConstantValues
3668         use immediate values that require no initialization.
3669
3670         * ChangeLog:
3671         * kjs/collector.cpp:
3672         (KJS::Collector::collect):
3673         * kjs/internal.cpp:
3674         (KJS::InterpreterImp::InterpreterImp):
3675         (KJS::InterpreterImp::lock):
3676         (KJS::InterpreterImp::clear):
3677         (KJS::InterpreterImp::mark):
3678         * kjs/internal.h:
3679         * kjs/value.cpp:
3680         (KJS::ConstantValues::initIfNeeded):
3681         * kjs/value.h:
3682
3683 2005-11-08  Geoffrey Garen  <ggaren@apple.com>
3684
3685         Reviewed by Darin.
3686
3687         This patch fixes some naughty naughty code -- 5 crashes and 2 
3688         may-go-haywire-in-the-futures.
3689         
3690         One such crash is <rdar://problem/4247330> 8C46 Crash with with 
3691         incomplete parameter list to webScript object function.
3692         
3693         I replaced early returns from within NS_DURINGs with calls to
3694         NS_VALUERETURN because the doc says, "You cannot use goto or 
3695         return to exit an exception handling domain -- errors will result."
3696         
3697         I replaced hard-coded analyses of -[NSMethodSignature 
3698         methodReturnType] with more abstracted alternatives, since
3699         the documentation says "This encoding is implementation-specific, 
3700         so applications should use it with caution," and then emits an
3701         evil cackle.
3702         
3703         I removed the early return in the case where a JavaScript caller
3704         supplies an insufficient number of arguments, because the right
3705         thing to do in such a case is to use JavaScript's defined behavior
3706         of supplying "undefined" for any missing arguments.
3707         
3708         I also changed ObjcInstance::invokeMethod so that it no longer
3709         deletes the method passed to it. It doesn't create the method,
3710         so it shouldn't delete it. A friend of mine named
3711         KERNEL_PROTECTION_FAILURE agrees with me on this point.
3712         
3713         Finally, I changed an assert(true) to assert(false) because
3714         all the other asserts were making fun of it.
3715
3716         * bindings/objc/objc_instance.mm:
3717         (ObjcInstance::invokeMethod):
3718         (ObjcInstance::invokeDefaultMethod):
3719
3720 2005-11-06  Geoffrey Garen  <ggaren@apple.com>
3721
3722         Reviewed by Darin.
3723
3724         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5571
3725           REGRESSION (412.5-TOT): duplicated words/sentences at 
3726           shakespeer.sourceforge.net
3727
3728         Our UTF16-modified PCRE didn't work with extended character classes
3729         (classes involving characters > 255) because it used the GETCHARINC
3730         macro to read through them. In UTF16 mode, GETCHARINC expects UTF16 
3731         input, but PCRE encodes character classes in UTF8 regardless of the
3732         input mode of the subject string.
3733
3734         The fix is to explicitly define GETUTF8CHARINC, and to use it,
3735         rather than GETCHARINC, when reading extended character classes. 
3736         
3737         In UTF8 mode, we simply define GETCHARINC to be GETUTF8CHARINC.
3738
3739         * pcre/pcre_internal.h:
3740         * pcre/pcre_xclass.c:
3741         (_pcre_xclass):
3742
3743 2005-11-05  Geoffrey Garen  <ggaren@apple.com>
3744
3745         Patch by Mitz Pettel, reviewed by Maciej.
3746
3747         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5357
3748           REGRESSION: Scriptable plugin hides properties of OBJECT element
3749
3750         * bindings/objc/objc_class.mm:
3751         (KJS::Bindings::ObjcClass::fallbackObject):
3752
3753 2005-11-05  Geoffrey Garen  <ggaren@apple.com>
3754
3755         Reviewed by Darin.
3756
3757         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5409
3758         slice() testcase doesn't pass
3759
3760         Modified String.slice to deal with funky values.
3761         Updated test results. We now pass <js1_2/String/slice.js>.
3762
3763         * kjs/string_object.cpp:
3764         (StringProtoFuncImp::callAsFunction):
3765         * tests/mozilla/expected.html:
3766
3767 2005-11-04  Darin Adler  <darin@apple.com>
3768
3769         Reviewed by Tim Hatcher.
3770
3771         * kxmlcore/HashSet.h: Fixed case of "hashfunctions.h" -- needs to be "HashFunctions.h".
3772
3773 2005-11-03  Timothy Hatcher  <timothy@apple.com>
3774
3775         Reviewed by Darin and Vicki.
3776
3777         * JavaScriptCore.xcodeproj/project.pbxproj:
3778           Change to use $(SYSTEM_LIBRARY_DIR) consistently and place
3779           $(NEXT_ROOT) in a few spots to make build-root work.
3780
3781 2005-11-03  Geoffrey Garen  <ggaren@apple.com>
3782
3783         - Updated JavaScriptCore test results to reflect recent fixes.
3784
3785         * tests/mozilla/expected.html:
3786
3787 2005-11-03  Geoffrey Garen  <ggaren@apple.com>
3788
3789         Reviewed by darin.
3790
3791         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5602
3792           REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
3793
3794         We now update lastIndex relative to the start of the last match,
3795         rather than the start of the last search. We used to assume that
3796         the two were equal, but that is not the case when a pattern
3797         matches at a character after the first in the string.
3798
3799         * kjs/regexp_object.cpp:
3800         (RegExpProtoFuncImp::callAsFunction):
3801
3802 2005-10-24  John Sullivan  <sullivan@apple.com>
3803
3804         Reviewed by Darin Adler. Code changes by Alexey Proskuryakov.
3805         
3806         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4931
3807         Unicode format characters (Cf) should be removed from JavaScript source
3808
3809         * kjs/lexer.cpp:
3810         include <unicode/uchar.h>
3811         (Lexer::Lexer):
3812         use KJS::UChar instead of UChar to avoid ambiguity caused by new include
3813         (Lexer::setCode):
3814         ditto; also, use shift(4) to skip first 4 chars to take advantage of new
3815         logic there.
3816         (Lexer::shift):
3817         skip chars of type U_FORMAT_CHAR
3818         (Lexer::convertUnicode):
3819         use KJS::UChar instead of UChar to avoid ambiguity caused by new include
3820         (Lexer::record16):
3821         ditto
3822         (Lexer::makeIdentifier):
3823         ditto
3824         (Lexer::makeUString):
3825         ditto
3826         
3827         * tests/mozilla/ecma/Array/15.4.5.1-1.js:
3828         updated to skip soft hyphens
3829
3830 2005-10-24  John Sullivan  <sullivan@apple.com>
3831
3832         Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
3833         
3834         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4142
3835         Date object does not always adjust daylight savings correctly
3836
3837         * kjs/date_object.cpp:
3838         (KJS::makeTime):
3839         Fix the case where a time change crosses the daylight savings start/end dates.
3840
3841 2005-10-17  Maciej Stachowiak  <mjs@apple.com>
3842
3843         Reviewed by Geoff. Code changes by Darin.
3844
3845         - some micro-optimizations to FastMalloc to reduce math and branches.
3846
3847         * kxmlcore/FastMalloc.cpp:
3848         (KXMLCore::TCMalloc_Central_FreeList::Populate):
3849         (KXMLCore::fastMallocRegisterThread):
3850         (KXMLCore::TCMalloc_ThreadCache::GetCache):
3851         (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
3852
3853 2005-10-15  Maciej Stachowiak  <mjs@apple.com>
3854
3855         Reverted fix for this bug, because it was part of a time range that caused a performance
3856         regression:
3857         
3858         <rdar://problem/4260481> Remove Reference type from JavaScriptCore
3859
3860 2005-10-15  Darin Adler  <darin@apple.com>
3861
3862         * kxmlcore/HashTable.cpp: Fixed build failure (said hashtable.h instead of HashTable.h).
3863
3864 2005-10-14  Geoffrey Garen  <ggaren@apple.com>
3865
3866         Style changes recommended by Darin.
3867         
3868         Changed to camelCase, changed ValueImp* to ValueImp *.
3869
3870         * kjs/simple_number.h:
3871         (KJS::SimpleNumber::make):
3872         (KJS::SimpleNumber::value):
3873
3874 2005-10-11  Geoffrey Garen  <ggaren@apple.com>
3875
3876         Added regexp_object.lut.h build phase from JavaScriptCore
3877         to JavaScriptCore+SVG.
3878
3879         Reviewed by mitz.
3880
3881         * JavaScriptCore.xcodeproj/project.pbxproj:
3882
3883 2005-10-11  Geoffrey Garen  <ggaren@apple.com>
3884
3885         Fixed build bustage from last checkin (stray characters
3886         in the project file).
3887
3888         Reviewed by mitz.
3889
3890         * JavaScriptCore.xcodeproj/project.pbxproj:
3891
3892 2005-10-11  Geoffrey Garen  <ggaren@apple.com>
3893
3894         New JavaScriptCore test results to reflect the last change.
3895
3896         * tests/mozilla/expected.html:
3897
3898 2005-10-10  Geoffrey Garen  <ggaren@apple.com>
3899
3900         - Implemented caching of match state inside the global RegExp object
3901           (lastParen, leftContext, rightContext, lastMatch, input).
3902
3903           exec(), test(), match(), search(), and replace() now dipatch regular
3904           expression matching through the RegExp object's performMatch function, 
3905           to facilitate caching. This replaces registerRegexp and 
3906           setSubPatterns.
3907         
3908         - Implemented the special '$' aliases (e.g. RegExp.input aliases to 
3909           RegExp.$_).
3910
3911         - Moved support for backreferences into the new static hash table
3912           used for other special RegExp properties. Truncated backreferences
3913           at $9 to match IE, FF, and the "What's New in Netscape 1.2?" doc.
3914           (String.replace still supports double-digit backreferences.)
3915
3916         - Tweaked RegExp.prototype.exec to handle ginormous values in lastIndex.
3917
3918         Fixes 11 -- count em, 11 -- JavaScriptCore tests.
3919
3920         * fast/js/regexp-caching-expected.txt: Added.
3921         * fast/js/regexp-caching.html: Added.
3922
3923         Reviewed by mjs.
3924
3925         * JavaScriptCore.xcodeproj/project.pbxproj: Added regexp_object.lut.h
3926         * kjs/create_hash_table: Tweaked to allow for more exotic characters.
3927                                  We now rely on the compiler to catch illegal
3928                                  identifiers.
3929         * kjs/regexp.cpp:
3930         (KJS::RegExp::RegExp):
3931         * kjs/regexp_object.cpp:
3932         (RegExpProtoFuncImp::callAsFunction):
3933         (RegExpObjectImp::RegExpObjectImp):
3934         (RegExpObjectImp::performMatch):
3935         (RegExpObjectImp::arrayOfMatches):
3936         (RegExpObjectImp::backrefGetter):
3937         (RegExpObjectImp::getLastMatch):
3938         (RegExpObjectImp::getLastParen):
3939         (RegExpObjectImp::getLeftContext):
3940         (RegExpObjectImp::getRightContext):
3941         (RegExpObjectImp::getOwnPropertySlot):
3942         (RegExpObjectImp::getValueProperty):
3943         (RegExpObjectImp::put):
3944         (RegExpObjectImp::putValueProperty):
3945         * kjs/regexp_object.h:
3946         (KJS::RegExpObjectImp::):
3947         * kjs/string_object.cpp:
3948         (substituteBackreferences):
3949         (replace):
3950         (StringProtoFuncImp::callAsFunction):
3951
3952 2005-10-09  Darin Adler  <darin@apple.com>
3953
3954         Reviewed by Maciej; some changes done after review.
3955
3956         - fixed <rdar://problem/4092064> hanging loading page; rte.ie (works in IE and Firefox)
3957         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5280
3958           Date.setMonth fails with negative values
3959         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5154
3960           JSC should switch to _r variants of unix time/date functions
3961         - fixed a few possible overflow cases
3962
3963         Retested all tests to be sure nothing broke; added layout test for bug 5280.
3964
3965         * kjs/config.h: Removed TIME_WITH_SYS_TIME define. Also set HAVE_SYS_TIMEB_H
3966         for the __APPLE__ case (the latter is accurate but irrelevant).
3967
3968         * kjs/date_object.h: Reformatted. Removed unnecessary include of "function_object.h".
3969         Moved declarations of helper classes and functions into the cpp file.
3970
3971         * kjs/date_object.cpp: Removed code at top to define macros to use CoreFoundation instead of
3972         POSIX date functions.
3973         (KJS::styleFromArgString): Tweaked to return early instead of using a variable.
3974         (KJS::formatLocaleDate): Tweaked to check for undefined rather than checking argument count.
3975         (KJS::formatDate): Made parameter const.
3976         (KJS::formatDateUTCVariant): Ditto.
3977         (KJS::formatTime): Ditto.
3978         (KJS::DateProtoFuncImp::callAsFunction): Use gmtime_r and localtime_r instead of gmtime and
3979         localtime.
3980         (KJS::DateObjectImp::callAsFunction): Use localtime_r instead of localtime.
3981         (KJS::ymdhmsToSeconds): Renamed from ymdhms_to_seconds. Changed computation to avoid possible
3982         overflow if year is an extremely large or small number.
3983         (KJS::makeTime): Removed code to move large month numbers from tm_mon to tm_year; this was
3984         to accomodate CFGregorianDate, which is no longer used (and didn't handle negative values).
3985         (KJS::parseDate): Renamed from KRFCDate_parseDate; changed to return a value in milliseconds
3986         rather than in seconds. Reformatted the code. Changed to use UTF8String() instead of ascii(),
3987         since ascii() is not thread safe. Changed some variables back from int to long to avoid
3988         trouble if the result of strtol does not fit in an int (64-bit issue only).
3989
3990 2005-10-08  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3991
3992         Reviewed by Geoff.
3993         Tweaked and landed by Darin.
3994
3995         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5266
3996           Support parenthesized comments in Date.parse()
3997
3998         * kjs/date_object.cpp:
3999         (KJS::skipSpacesAndComments): Take a pointer, and advance it past spaces,
4000         and also past anything enclosed in parentheses.
4001         (KJS::KRFCDate_parseDate): Use skipSpacesAndComments wherever we formerly had
4002         code to skip spaces.
4003
4004 2005-10-08  Justin Haygood  <justin@xiondigital.net>
4005
4006         Reviewed, tweaked, and landed by Darin.
4007
4008         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5189
4009           pcre_exec.c fails to compile using MSVC
4010         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5190
4011           KJS config.h adjustment for Win32
4012         
4013         * kjs/config.h: Make sure HAVE_MMAP and HAVE_SBRK are off for Win32.
4014         Turn HAVE_ERRNO_H on for Mac OS X. Sort defines so they are easy to compare
4015         with each other. Remove #undef of DEBUG_COLLECTOR.
4016         * pcre/pcre_exec.c: (match): Work around strange MSVC complaint by splitting
4017         the definition of a local variable into a separate declaration and
4018         initialization.
4019
4020 2005-10-05  Geoffrey Garen  <ggaren@apple.com>
4021  
4022         - Darin and I rewrote our implementation of the SimpleNumber class
4023           to store number bit patterns in their floating point formats.
4024  
4025         My tweaks reviewed by Darin.
4026         
4027         ~1% speedup on JS iBench.
4028         
4029         * kjs/internal.h: removed obsolete jsNumber declarations.
4030         * kjs/math_object.cpp:
4031         (MathFuncImp::callAsFunction): changed KJS::isNaN to isNaN
4032         * kjs/nodes.cpp:
4033         (PostfixResolveNode::evaluate): removed obsolete knownToBeInteger
4034         (PostfixBracketNode::evaluate): ditto
4035         (PostfixDotNode::evaluate): ditto
4036         (PrefixResolveNode::evaluate): ditto
4037         (PrefixBracketNode::evaluate): ditto
4038         (PrefixDotNode::evaluate): ditto
4039         (NegateNode::evaluate): ditto
4040         (valueForReadModifyAssignment): ditto
4041         * kjs/number_object.cpp: removed obsolete comment
4042         * kjs/operations.cpp:
4043         (KJS::equal): removed unnecessary isNaN checks
4044         (KJS::strictEqual): ditto
4045         (KJS::add): removed obsolete knownToBeInteger
4046         (KJS::mult): ditto
4047         * kjs/operations.h: removed include of "value.h" to prevent circular reference
4048         * kjs/simple_number.h: removed unnecessary #includes
4049         (KJS::SimpleNumber::make): see above
4050         (KJS::SimpleNumber::is): ditto
4051         (KJS::SimpleNumber::value): ditto
4052         * kjs/string_object.cpp:
4053         (StringProtoFuncImp::callAsFunction): changed KJS::isNaN to isNaN
4054         * kjs/ustring.cpp: removed unnecessary isNaN check
4055         (KJS::UString::toUInt32): ditto
4056         * kjs/value.cpp:
4057         (KJS::jsNumber): removed obsolete jsNumber definitions
4058         (KJS::ConstantValues::init): NaN is no longer a ConstantValue
4059         (KJS::ConstantValues::clear): ditto
4060         (KJS::ConstantValues::mark): ditto
4061         * kjs/value.h: removed obsolete knownToBeInteger
4062         (KJS::jsNaN): now returns a SimpleNumber
4063         (KJS::ValueImp::getUInt32): changed to account for NaN being a SimpleNumber
4064         (KJS::ValueImp::toBoolean): ditto
4065         (KJS::ValueImp::toString): changed to account for +/- 0.0
4066         (KJS::jsZero): changed to reflect that SimpleNumber::make takes a double
4067         (KJS::jsOne): ditto
4068         (KJS::jsTwo): ditto
4069         (KJS::Number): removed obsolete non-double constructor declarations
4070
4071 2005-10-05  Maciej Stachowiak  <mjs@apple.com>
4072
4073         Reviewed by Eric.
4074
4075         - fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
4076
4077         Also fixed some bugs with for..in enumeration while I was at it. object
4078         properties now come before prototype properties and duplicates
4079         between object and prototype are listed only once.
4080
4081         * JavaScriptCore.xcodeproj/project.pbxproj:
4082         * kjs/IdentifierSequencedSet.cpp: Added.
4083         (KJS::IdentifierSequencedSet::IdentifierSequencedSet):
4084         (KJS::IdentifierSequencedSet::deallocateVector):
4085         (KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
4086         (KJS::IdentifierSequencedSet::insert):
4087         * kjs/IdentifierSequencedSet.h: Added.
4088         (KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
4089         (KJS::IdentifierSequencedSetIterator::operator*):
4090         (KJS::IdentifierSequencedSetIterator::operator->):
4091         (KJS::IdentifierSequencedSetIterator::operator++):
4092         (KJS::IdentifierSequencedSetIterator::operator==):
4093         (KJS::IdentifierSequencedSetIterator::operator!=):
4094         (KJS::IdentifierSequencedSet::begin):
4095         (KJS::IdentifierSequencedSet::end):
4096         (KJS::IdentifierSequencedSet::size):
4097         * kjs/array_instance.h:
4098         * kjs/array_object.cpp:
4099         (ArrayInstanceImp::getPropertyNames):
4100         (ArrayInstanceImp::setLength):
4101         (ArrayInstanceImp::pushUndefinedObjectsToEnd):
4102         * kjs/nodes.cpp:
4103         (ForInNode::execute):
4104         * kjs/nodes.h:
4105         * kjs/object.cpp:
4106         (KJS::ObjectImp::getPropertyNames):
4107         * kjs/object.h:
4108         * kjs/property_map.cpp:
4109         (KJS::PropertyMap::getEnumerablePropertyNames):
4110         (KJS::PropertyMap::getSparseArrayPropertyNames):
4111         * kjs/property_map.h:
4112         * kjs/protect.h:
4113         * kjs/protected_reference.h: Removed.
4114         * kjs/reference.cpp: Removed.
4115         * kjs/reference.h: Removed.
4116         * kjs/reference_list.cpp: Removed.
4117         * kjs/reference_list.h: Removed.
4118         * kjs/ustring.h:
4119         (KJS::UString::impl):
4120         * kxmlcore/HashSet.h:
4121
4122 2005-10-04  Eric Seidel  <eseidel@apple.com>
4123
4124         Reviewed by mjs.
4125
4126         Code cleanup, which resulted in a small win on iBench.
4127
4128         * kjs/object.cpp:
4129         (KJS::tryGetAndCallProperty): new static inline
4130         (KJS::ObjectImp::defaultValue): code cleanup
4131
4132 2005-10-03  Maciej Stachowiak  <mjs@apple.com>
4133
4134         Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
4135
4136         - more Linux build fixes
4137         
4138         * kjs/operations.cpp:
4139         * kxmlcore/FastMalloc.h:
4140         * kxmlcore/TCSystemAlloc.cpp:
4141         (TCMalloc_SystemAlloc):
4142