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