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