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