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