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