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