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