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