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