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