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