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