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