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