Reviewed by Darin.
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2006-01-25  George Staikos <staikos@opensource.apple.com>
2
3         Reviewed by Darin.
4
5         * kxmlcore/HashFunctions.h: Merge build fix from KDE.
6
7 2006-01-25  Darin Adler  <darin@apple.com>
8
9         - removed an unused source file
10
11         * kjs/pointer_hash.h: Removed.
12         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
13
14 2006-01-23  Anders Carlsson  <andersca@mac.com>
15
16         Reviewed by Maciej.
17
18         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
19         KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
20         
21         * kjs/lookup.h:
22         Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
23         
24         (cacheGlobalObject):
25         Move this out of the KJS namespace.
26
27 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
28
29         Reviewed by Eric.
30
31         - renamed PointerHash to PtrHash
32         - made PtrHash the default hash function for int and pointer types that aren't further specialized
33         - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
34         - did appropriate consequent cleanup (very few places now need to declare a hash function)
35         http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
36         
37         * kjs/array_object.cpp:
38         (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
39         * kjs/collector.cpp: ditto
40         * kjs/identifier.cpp:
41         (KXMLCore::): declare DefaultHash the new way
42         * kjs/internal.cpp: no need to mention PointerHash
43         * kjs/ustring.h:
44         * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
45         easier to specialize on PtrHash
46         * kxmlcore/HashFunctions.h:
47         (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
48         a Hash typedef rather than being a hash function class itself; declared DefaultHash
49         for int and partializy specialized for pointer types
50         * kxmlcore/HashMapPtrSpec.h:
51         (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
52         way of handling pointer hash
53         (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
54         (KXMLCore::): ditto
55         * kxmlcore/HashMap.h: ditto
56         * kxmlcore/HashSet.h: ditto
57
58 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
59
60         Reviewed by Tim Omernick.
61         
62         - use classes instead of free functions for extractors, this better matches how other
63         things work and should avoid the need for hacky workarounds on other compilers
64         http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
65
66         * kjs/array_object.cpp:
67         * kjs/identifier.cpp:
68         * kjs/internal.cpp:
69         * kxmlcore/HashMap.h:
70         (KXMLCore::PairFirstExtractor::extract):
71         * kxmlcore/HashMapPtrSpec.h:
72         (KXMLCore::):
73         * kxmlcore/HashSet.h:
74         (KXMLCore::IdentityExtractor::extract):
75         * kxmlcore/HashTable.h:
76         (KXMLCore::addIterator):
77         (KXMLCore::removeIterator):
78         (KXMLCore::HashTable::add):
79         (KXMLCore::HashTable::isEmptyBucket):
80         (KXMLCore::HashTable::isDeletedBucket):
81         (KXMLCore::HashTable::HashTable):
82         (KXMLCore::HashTable::lookup):
83         (KXMLCore::HashTable::add):
84         (KXMLCore::HashTable::reinsert):
85         (KXMLCore::HashTable::find):
86         (KXMLCore::HashTable::contains):
87         (KXMLCore::HashTable::remove):
88         (KXMLCore::HashTable::allocateTable):
89         (KXMLCore::HashTable::deallocateTable):
90         (KXMLCore::HashTable::expand):
91         (KXMLCore::HashTable::rehash):
92         (KXMLCore::HashTable::clear):
93         (KXMLCore::HashTable::swap):
94         (KXMLCore::HashTable::operator):
95         (KXMLCore::HashTable::checkTableConsistency):
96         (KXMLCore::HashTable::checkTableConsistencyExceptSize):
97         (KXMLCore::HashTable::invalidateIterators):
98
99 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
100
101         Rubber stamped by Tim Hatcher.
102         
103         - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
104         for consistency with HashMap
105
106         * kjs/array_object.cpp:
107         (ArrayProtoFunc::callAsFunction):
108         * kjs/collector.cpp:
109         (KJS::Collector::protect):
110         * kjs/identifier.cpp:
111         (KJS::Identifier::add):
112         * kxmlcore/HashCountedSet.h:
113         (KXMLCore::::add):
114         * kxmlcore/HashMap.h:
115         (KXMLCore::::inlineAdd):
116         * kxmlcore/HashSet.h:
117         (KXMLCore::::add):
118         * kxmlcore/HashTable.h:
119         (KXMLCore::HashTable::add):
120         (KXMLCore::::add):
121         (KXMLCore::::HashTable):
122
123 2006-01-23  Justin Garcia  <justin.garcia@apple.com>
124
125         Reviewed by thatcher
126         
127         Turned on -O2 for B&I build.
128
129         * JavaScriptCore.xcodeproj/project.pbxproj:
130
131 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
132
133         Reviewed by Tim Hatcher.
134         
135         - it's "Franklin Street", not "Franklin Steet"
136
137         * kjs/array_instance.h:
138         * kjs/array_object.cpp:
139         * kjs/array_object.h:
140         * kjs/bool_object.cpp:
141         * kjs/bool_object.h:
142         * kjs/collector.cpp:
143         * kjs/collector.h:
144         * kjs/completion.h:
145         * kjs/context.h:
146         * kjs/date_object.cpp:
147         * kjs/date_object.h:
148         * kjs/debugger.cpp:
149         * kjs/debugger.h:
150         * kjs/dtoa.h:
151         * kjs/error_object.cpp:
152         * kjs/error_object.h:
153         * kjs/function.cpp:
154         * kjs/function.h:
155         * kjs/function_object.cpp:
156         * kjs/function_object.h:
157         * kjs/grammar.y:
158         * kjs/identifier.cpp:
159         * kjs/identifier.h:
160         * kjs/internal.cpp:
161         * kjs/internal.h:
162         * kjs/interpreter.cpp:
163         * kjs/interpreter.h:
164         * kjs/lexer.cpp:
165         * kjs/lexer.h:
166         * kjs/list.cpp:
167         * kjs/list.h:
168         * kjs/lookup.cpp:
169         * kjs/lookup.h:
170         * kjs/math_object.cpp:
171         * kjs/math_object.h:
172         * kjs/nodes.cpp:
173         * kjs/nodes.h:
174         * kjs/nodes2string.cpp:
175         * kjs/number_object.cpp:
176         * kjs/number_object.h:
177         * kjs/object.cpp:
178         * kjs/object.h:
179         * kjs/object_object.cpp:
180         * kjs/object_object.h:
181         * kjs/operations.cpp:
182         * kjs/operations.h:
183         * kjs/property_map.cpp:
184         * kjs/property_map.h:
185         * kjs/property_slot.cpp:
186         * kjs/property_slot.h:
187         * kjs/reference.cpp:
188         * kjs/reference.h:
189         * kjs/reference_list.cpp:
190         * kjs/reference_list.h:
191         * kjs/regexp.cpp:
192         * kjs/regexp.h:
193         * kjs/regexp_object.cpp:
194         * kjs/regexp_object.h:
195         * kjs/scope_chain.cpp:
196         * kjs/scope_chain.h:
197         * kjs/simple_number.h:
198         * kjs/string_object.cpp:
199         * kjs/string_object.h:
200         * kjs/testkjs.cpp:
201         * kjs/types.h:
202         * kjs/ustring.cpp:
203         * kjs/ustring.h:
204         * kjs/value.cpp:
205         * kjs/value.h:
206         * kxmlcore/AlwaysInline.h:
207         * kxmlcore/ListRefPtr.h:
208         * kxmlcore/PassRefPtr.h:
209         * kxmlcore/RefPtr.h:
210
211 2006-01-23  Darin Adler  <darin@apple.com>
212
213         Reviewed by John Sullivan.
214
215         - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
216           REGRESSION: Crash in cloneChildNodes when clicking element
217
218         * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
219         type by calling get() instead of going directly at m_ptr.
220         * kxmlcore/RefPtr.h: Ditto.
221
222         - other changes
223
224         * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
225         It's just a resorted list of keys in a dictionary.
226
227         * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
228         in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
229         routine" property we want to have on OS X.
230
231 2006-01-22  Maciej Stachowiak  <mjs@apple.com>
232
233         Reviewed by Darin.
234
235         - Set up Page class and invert Frame / WebCoreFrameBridge ownership
236         http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
237
238         * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can 
239         override it
240
241 2006-01-23  George Staikos <staikos@opensource.apple.com>
242
243         Reviewed by Maciej and Darin.
244
245         * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
246         * kjs/interpreter.cpp: ditto
247         * kjs/simple_number.h: Add assert.h and remove from config.h
248         * kjs/array_object.cpp: Use relative paths for kxmlcore includes
249         * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
250
251 2006-01-23  George Staikos <staikos@opensource.apple.com>
252
253         Reviewed by Maciej.
254
255         * kjs/config.h: unbreak preprocessor change
256
257 2006-01-23  George Staikos <staikos@opensource.apple.com>
258
259         Approved by Maciej and Darin.
260
261         * kjs/:
262         * kxmlcore/:
263              Update FSF address in license to make merging easier
264
265 2006-01-22  George Staikos <staikos@opensource.apple.com>
266
267         Reviewed by Maciej.
268
269         * kjs/collector.cpp: merge major speedup from KDE on Linux
270                              patch by Maks Orlovich, bug #6145
271                              Also unify cpu detection
272         * kjs/config.h: define simpler CPU macros
273
274 2006-01-22  George Staikos <staikos@opensource.apple.com>
275
276         Reviewed by Maciej.
277
278         * kjs/collector.cpp: merge FreeBSD compile fix from KDE
279                              -> requires build magic for use
280
281 2006-01-21  George Staikos <staikos@opensource.apple.com>
282
283         Reviewed by Maciej.
284
285         * kjs/nodes2string.cpp
286         * kjs/operations.h
287         * kjs/debugger.h
288           Fix pedantic compile with some gcc versions (Merge from KDE)
289
290         * kjs/create_hash_table:
291           Fix build with Perl 5.8.0 (Merge from KDE)
292
293 2006-01-18  Darin Adler  <darin@apple.com>
294
295         Reviewed by Hyatt.
296
297         - hash table fixes needed for my WebCore changes
298
299         * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
300         Added a missing return statement.
301
302         * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
303         can't instantiate with a 0 by using traits rather than ? : to select the default
304         emtpy value of hash table keys.
305
306         - small cleanup of "runtime" code left over from recent JavaScript crash fix
307
308         * bindings/runtime_root.h:
309         (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
310         since it's now a ProtectedPtr.
311         (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
312         fact that _imp was 0 and replaced with use of ProtectedPtr.
313         (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
314
315 2006-01-17  Darin Adler  <darin@apple.com>
316
317         Reviewed by Anders.
318
319         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
320           add assertions to check correct use of hash table iterators
321
322         * kxmlcore/HashTable.h:
323         (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
324         maintained by the specified hash table.
325         (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
326         the list maintained by the hash table it's in.
327         (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
328         parameter, ignored when not debugging. Call addIterator.
329         (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
330         (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
331         (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
332         (KXMLCore::HashTableConstIterator::operator->): Ditto.
333         (KXMLCore::HashTableConstIterator::operator++): Ditto.
334         (KXMLCore::HashTableConstIterator::operator==): Ditto.
335         (KXMLCore::HashTableConstIterator::operator!=): Ditto.
336         (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
337         pointer is not 0 and if there are two iterators that both point at the same table.
338         (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
339         as an implementation detail, to avoid having two separate iterator implementations.
340         (KXMLCore::HashTableIterator::operator*): Ditto.
341         (KXMLCore::HashTableIterator::operator->): Ditto.
342         (KXMLCore::HashTableIterator::operator++): Ditto.
343         (KXMLCore::HashTableIterator::operator==): Ditto.
344         (KXMLCore::HashTableIterator::operator!=): Ditto.
345         (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
346         (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
347         (KXMLCore::HashTable::makeIterator): Pass this pointer.
348         (KXMLCore::HashTable::makeConstIterator): Ditto.
349         (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
350         entry point that modifies the hash table.
351         (KXMLCore::HashTable::remove): Ditto.
352         (KXMLCore::HashTable::clear): Ditto.
353         (KXMLCore::HashTable::swap): Ditto.
354         (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
355         clears out the table, next, and previous pointers in all of them, and then clears
356         the head so we have an empty list.
357         (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
358         passed-in table, and points the iterator at the table.
359         (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
360         the passed-in table.
361
362         * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
363
364 2006-01-17  Justin Garcia  <justin.garcia@apple.com>
365
366         Reviewed by eric
367         
368         Deployment builds now use -O2
369
370         * JavaScriptCore.xcodeproj/project.pbxproj:
371
372 2006-01-17  Darin Adler  <darin@apple.com>
373
374         Reviewed by Anders.
375
376         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
377           change RefPtr so that it works when deref ends up deleting the RefPtr
378
379         * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
380         * kxmlcore/RefPtr.h: Ditto.
381
382 2006-01-16  Geoffrey Garen  <ggaren@apple.com>
383
384         Reviewed by darin.
385
386         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
387         DateProtoFuncImp::callAsFunction can crash due to lack of type checking
388
389         * kjs/date_object.cpp:
390         (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods. 
391         This matches section 15.9.5 in the spec.
392
393 2006-01-16  Tim Omernick  <timo@apple.com>
394
395         Reviewed by John Sullivan.
396
397         JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
398
399         * bindings/npruntime.cpp:
400         (_NPN_ReleaseObject):
401         Refactored part of this function out into _NPN_DeallocateObject.
402         (_NPN_DeallocateObject):
403         Forcibly deallocates the passed object, even if its refcount is
404         greater than zero.
405         
406         * bindings/npruntime_impl.h:
407         Declared _NPN_DeallocateObject().
408
409 2006-01-16  Darin Adler  <darin@apple.com>
410
411         Reviewed by Maciej.
412
413         - fix problem with ++, ==, and != on const iterators in
414           HashMaps that are using the pointer specialization
415
416         * kxmlcore/HashMapPtrSpec.h:
417         (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
418         (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
419         (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
420
421 2006-01-15  Alexey Proskuryakov  <ap@nypop.com>
422
423         Reviewed by Anders.
424
425         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
426         run-javascriptcore-tests doesn't work
427
428         * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm: 
429         Changed revision number to 1.8 (broken by svn migration).
430
431 2006-01-14  David Kilzer  <ddkilzer@kilzer.net>
432
433         Reviewed and landed by Anders.
434
435         * kjs/create_hash_table: Fixed comment typo.
436
437 2006-01-13  Maks Orlovich   <maksim@kde.org>
438
439         Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
440
441         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
442         Misc. array object fixes from KJS
443
444         * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
445         (ArrayInstance::getOwnPropertySlot): Ditto.
446         (ArrayInstance::deleteProperty): Ditto.
447         (ArrayInstance::put): Ditto.
448         (ArrayInstance::propList): Added a FIXME comment.
449         (ArrayInstance::put): Throw exception on trying to set invalid array length.
450         (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
451         * kjs/array_object.h: Added MAX_ARRAY_INDEX.
452
453 2006-01-13  Darin Adler  <darin@apple.com>
454
455         - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
456         - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
457
458 2006-01-13  Anders Carlsson  <andersca@mac.com>
459
460         Reviewed by Eric.
461
462         * kjs/create_hash_table:
463         Use correct size variables.
464
465 2006-01-13  Anders Carlsson  <andersca@mac.com>
466
467         Reviewed by Darin.
468
469         * kjs/create_hash_table:
470         Don't create an empty entry array, instead add a entry with all fields
471         set to null and set the hash table size to 1.
472         
473         * kjs/lookup.cpp:
474         (findEntry):
475         Remove the hash table size check
476
477 2006-01-12  Anders Carlsson  <andersca@mac.com>
478
479         Reviewed by Maciej.
480
481         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
482         Crash when assigning a new function to a DOMParser object
483         
484         * JavaScriptCore.xcodeproj/project.pbxproj:
485         Move lookup.cpp before lookup.h
486         
487         * kjs/lookup.cpp:
488         (findEntry):
489         If the hash table is empty, return 0 early.
490
491 2006-01-12  George Staikos <staikos@kde.org>
492
493         Reviewed by Darin.
494
495         * kjs/interpreter.cpp:
496         * kjs/testkjs.cpp:
497         * kjs/interpreter.h:
498         Add helper to interpreter to call the collector in order to facilitate
499         visibility rules in KDE.
500
501 2006-01-12  George Staikos <staikos@kde.org>
502
503         Reviewed by Maciej.
504
505         * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
506
507         * kxmlcore/HashTable.h: Add missing assert.h
508
509 2006-01-12  Darin Adler  <darin@apple.com>
510
511         Reviewed by Geoff.
512
513         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
514           retire APPLE_CHANGES from JavaScriptCore
515
516         * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
517         APPLE_CHANGES and HAVE_CONFIG_H from all targets.
518
519         * README: Removed. This had obsolete information in it
520         and it wasn't clear what to replace it with.
521
522         * kjs/collector.h: Removed an APPLE_CHANGES if around something
523         that's not really platform-specific (although it does use a
524         platform-specific API at the moment).
525         * kjs/collector.cpp: Removed a mistaken comment.
526
527         * kjs/grammar.y:
528         * kjs/internal.cpp:
529         * kjs/object.h:
530         * kjs/operations.cpp:
531         * kjs/operations.h:
532         * kjs/ustring.h:
533         Use __APPLE__ instead of APPLE_CHANGES for code that should be
534         used only on Mac OS X.
535
536         * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
537         of the runtime.h header. Even though that header isn't needed at the
538         moment on platforms other than Mac OS X, the conditional stuff should
539         be in the header itself, not in this one client.
540
541         * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
542         code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
543         any platform where pow is implemented corrrectly according to the IEEE
544         standard. If it is needed on some, we can add it back with an appropriate
545         #if for the platforms where it is needed.
546
547 2006-01-12  Justin Haygood  <justin@xiondigital.net>
548
549         Reviewed, tweaked, and landed by Darin.
550
551         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
552           lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
553
554         * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
555         quotes instead of angle brackets. Moved dtoa.h include to the top.
556         Changed system header includes to use angle brackets instead of quotes.
557         * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
558         quotes instead of angle brackets.
559         * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
560         quotes instead of angle brackets. Moved lexer.h include to the top.
561         * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
562         quotes instead of angle brackets. Moved ustring.h include to the top.
563
564 2006-01-12  George Staikos <staikos@kde.org>
565
566         Reviewed by Maciej
567
568         - Import initial QMake file.  Doesn't fully work yet.
569
570 2006-01-11  Ricci Adams  <ricciadams@apple.com>
571
572         Reviewed by Maciej and Darin, landed by Darin.
573
574         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
575           final comma in javascript object prevents parsing
576
577         * kjs/grammar.y: Added rule to allow trailing comma in
578         object construction.
579
580 2006-01-11  Ricci Adams  <ricciadams@apple.com>
581
582         Reviewed by Geoff, landed by Darin.
583
584         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
585           Number.toFixed doesn't include leading 0
586
587         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
588         Fixed a "<" that should have been a "<=".
589
590 2006-01-11  Ricci Adams  <ricciadams@apple.com>
591
592         Reviewed by Geoff, landed by Darin.
593
594         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
595           Number.toFixed doesn't round 0.5 up
596
597         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
598         Fixed a ">" that should have been a ">=".
599
600 2006-01-11  Justin Haygood  <justin@xiondigital.net>
601
602         Reviewed and landed by Darin.
603
604         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6486
605           JavaScriptCore should use system malloc on Windows
606
607         * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
608
609 2006-01-10  Darin Adler  <darin@apple.com>
610
611         * Makefile: Took out unneeded "export" line.
612         * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
613           MIME types, other small corrections).
614
615 2006-01-09  Darin Adler  <darin@apple.com>
616
617         * Makefile.am: Removed.
618
619 2006-01-07  Anders Carlsson  <andersca@mac.com>
620
621         Reviewed by Maciej.
622         
623         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
624         REGRESSION: JavaScript hang when comparing large array to null
625         
626         * kjs/object.h:
627         (KJS::JSObject::isEqualToNull):
628         Add new function which returns true if an object should be treated as null when
629         doing comparisons.
630         
631         * kjs/operations.cpp:
632         (KJS::equal):
633         Use isEqualToNull.
634
635 2006-01-07  Alexey Proskuryakov  <ap@nypop.com>
636
637         Reviewed by Maciej.
638
639         - Fix WebCore development build
640         http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
641
642         * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
643
644 2006-01-06  Maciej Stachowiak  <mjs@apple.com>
645
646         Reviewed by Darin.
647
648         - miscellaneous changes for 4% speedup on the JavaScript iBench
649         http://bugzilla.opendarwin.org/show_bug.cgi?id=6396
650         
651         Changes mostly thanks to Maks Orlovich, tweaked a little by me.
652
653         * kjs/create_hash_table: Use the same hash as the one used by Identifier.
654         * kjs/function.cpp:
655         (KJS::FunctionImp::processParameters): Use the new List::copyFrom
656         (KJS::ActivationImp::ActivationImp): track variable while iterating
657         * kjs/internal.cpp:
658         (KJS::StringImp::toObject): create StringInstance directly
659         * kjs/list.cpp:
660         (KJS::List::copy): implement in terms of copyFrom
661         (KJS::List::copyFrom): more efficient way to copy in another list
662         * kjs/list.h:
663         * kjs/lookup.cpp:
664         (keysMatch): updated to work with identifier hash
665         (findEntry): ditto
666         (Lookup::findEntry): ditto
667         (Lookup::find): ditto
668         * kjs/lookup.h:
669
670 2006-01-06  Maciej Stachowiak  <mjs@apple.com>
671
672         - fix development build failure from the previous checkin
673
674         * kjs/function.cpp:
675         (KJS::ActivationImp::put): Use prototype() accessor in assert.
676
677 2006-01-05  Maciej Stachowiak  <mjs@apple.com>
678
679         Reviewed by Eric.
680
681         - fix remaining performance regression from Getter/Setter change
682         http://bugzilla.opendarwin.org/show_bug.cgi?id=6249
683
684         - Activation objects should not have __proto__ property
685         http://bugzilla.opendarwin.org/show_bug.cgi?id=6395
686
687         * kjs/function.cpp:
688         (KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
689         skipping getter/setter handling and __proto__ handling, as well
690         as inlining needed superclass stuff.
691         (KJS::ActivationImp::put): Implement directly, skipping getter/setter,
692         __proto__, and do canPut directly in PropertyMap::put since there's no
693         static property table either.
694         * kjs/function.h:
695         * kjs/property_map.cpp:
696         (KJS::PropertyMap::put): Allow optionally inlining canPut check.
697         * kjs/property_map.h:
698
699 2006-01-04  Geoffrey Garen  <ggaren@apple.com>
700
701         Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
702
703         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4921
704         \u escape sequences in JavaScript identifiers
705
706         * kjs/function_object.cpp:
707         (FunctionObjectImp::construct):
708         * kjs/lexer.cpp:
709         (Lexer::shift):
710         (Lexer::lex):
711         (Lexer::isWhiteSpace):
712         (Lexer::isLineTerminator):
713         (Lexer::isIdentStart):
714         (Lexer::isIdentPart):
715         (isDecimalDigit):
716         (Lexer::scanRegExp):
717         * kjs/lexer.h:
718         (KJS::Lexer::):
719
720         * tests/mozilla/expected.html: Updated test results.
721
722 2005-12-30  Maciej Stachowiak  <mjs@apple.com>
723
724         No review, just test result update.
725
726         * tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
727
728 2005-12-30  Anders Carlsson  <andersca@mac.com>
729
730         Reviewed by Maciej.
731
732         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6298
733         Getter setter test is failing
734                 
735         * kjs/object.cpp:
736         (KJS::JSObject::put):
737         Rework the getter setter part. We now walk the prototype chain, checking for
738         getter/setter properties and only take the slow path if any are found. 
739
740 2005-12-30  Maks Orlovich <maksim@kde.org>
741
742         Reviewed and committed by Maciej.
743
744         - Handle negative, FP numbers with non-10 radix in toString
745         http://bugzilla.opendarwin.org/show_bug.cgi?id=6259
746
747         (Merged from KJS, original work by Harri Porten)
748         
749         * kjs/number_object.cpp:
750         (NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with  
751         negative numbers, floating point and very large numbers.
752
753 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
754
755         Patch by Maks Orlovich, reviewed and landed by me.
756
757         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6267
758         Fix Number.prototype.toFixed/toExponential(undefined)
759
760         * kjs/number_object.cpp:
761         (NumberProtoFunc::callAsFunction):
762
763 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
764
765         Patch by Maks Orlovich, Reviewed and landed by me.
766
767         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6266
768         Minor object naming updates (to match Mozilla, KJS)
769
770         * kjs/number_object.cpp:
771         * kjs/regexp_object.cpp:
772
773 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
774
775         Patch by Maks Orlovich, reviewed by mjs.
776
777         This has 2 very minor fixes, covered by KJS testsuite:    
778         1. Enumerates string indices in property list (with the same bug as array    
779            object has in corresponding code). This is a mozilla emulation thing. 
780         2. Permits properties with integer names in prototypes to be found    
781
782         * kjs/string_object.cpp:
783         (StringInstance::getOwnPropertySlot):
784         (StringInstanceImp::propList):
785         * kjs/string_object.h:
786
787 2005-12-26  Geoffrey Garen  <ggaren@apple.com>
788
789         Reviewed by mjs.
790
791         - Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in 
792         KJS::BlockNode::deref 
793         AKA 
794         http://bugzilla.opendarwin.org/show_bug.cgi?id=6233
795         Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in 
796         linked lists
797
798         This patch does four things: 
799         (1) Standardizes all our linked list nodes to use "next" as their next 
800         pointers. 
801         (2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
802         to iteratively deref "next" pointers.
803         (3) Standardizes our linked list nodes to use ListRefPtr<T> and 
804         implement the releaseNext() function used by ~ListRefPtr<T>().
805         (4) Adds to RefPtr<T> the release() method used by releaseNext().
806
807         - Modified existing mozilla test to ensure it would make deployment 
808         builds crash as well.
809
810         * JavaScriptCore.xcodeproj/project.pbxproj:
811         * kjs/nodes.cpp:
812         (ElementNode::evaluate):
813         (PropertyListNode::evaluate):
814         (ArgumentListNode::evaluateList):
815         (StatListNode::StatListNode):
816         (StatListNode::execute):
817         (StatListNode::processVarDecls):
818         (VarDeclListNode::evaluate):
819         (VarDeclListNode::processVarDecls):
820         (VarStatementNode::execute):
821         (VarStatementNode::processVarDecls):
822         (BlockNode::BlockNode):
823         (CaseClauseNode::evalStatements):
824         (CaseClauseNode::processVarDecls):
825         (ClauseListNode::processVarDecls):
826         (CaseBlockNode::CaseBlockNode):
827         (CaseBlockNode::evalBlock):
828         (SourceElementsNode::SourceElementsNode):
829         (SourceElementsNode::execute):
830         (SourceElementsNode::processFuncDecl):
831         (SourceElementsNode::processVarDecls):
832         * kjs/nodes.h:
833         (KJS::ElementNode::ElementNode):
834         (KJS::ElementNode::releaseNext):
835         (KJS::ArrayNode::ArrayNode):
836         (KJS::PropertyListNode::PropertyListNode):
837         (KJS::PropertyListNode::releaseNext):
838         (KJS::ObjectLiteralNode::ObjectLiteralNode):
839         (KJS::ArgumentListNode::ArgumentListNode):
840         (KJS::ArgumentListNode::releaseNext):
841         (KJS::ArgumentsNode::ArgumentsNode):
842         (KJS::StatListNode::releaseNext):
843         (KJS::VarDeclListNode::VarDeclListNode):
844         (KJS::VarDeclListNode::releaseNext):
845         (KJS::VarStatementNode::VarStatementNode):
846         (KJS::ForNode::ForNode):
847         (KJS::CaseClauseNode::CaseClauseNode):
848         (KJS::ClauseListNode::ClauseListNode):
849         (KJS::ClauseListNode::getClause):
850         (KJS::ClauseListNode::getNext):
851         (KJS::ClauseListNode::releaseNext):
852         (KJS::ParameterNode::ParameterNode):
853         (KJS::ParameterNode::releaseNext):
854         (KJS::SourceElementsNode::releaseNext):
855         * kjs/nodes2string.cpp:
856         (ElementNode::streamTo):
857         (PropertyListNode::streamTo):
858         (ArgumentListNode::streamTo):
859         (StatListNode::streamTo):
860         (VarDeclListNode::streamTo):
861         (VarStatementNode::streamTo):
862         (CaseClauseNode::streamTo):
863         (ClauseListNode::streamTo):
864         (CaseBlockNode::streamTo):
865         (SourceElementsNode::streamTo):
866         * kxmlcore/ListRefPtr.h: Added.
867         (KXMLCore::ListRefPtr::ListRefPtr):
868         (KXMLCore::ListRefPtr::~ListRefPtr):
869         (KXMLCore::ListRefPtr::operator=):
870         * kxmlcore/RefPtr.h:
871         (KXMLCore::RefPtr::release):
872
873 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
874
875         Reviewed by mjs.
876
877         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4026
878         Math.random() not seeded.
879
880         Added call to sranddev() -- it executes the first time a process
881         calls Math.random().
882
883         * kjs/math_object.cpp:
884         (MathFuncImp::callAsFunction):
885
886 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
887
888         Reviewed by darin.
889
890         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6265
891         Name change regression: Java doesn't know what JavaJSObject is
892
893         Changed strings passed to Java back to original "JSObject".
894
895         * bindings/jni/jni_jsobject.cpp:
896         (JavaJSObject::convertValueToJObject):
897         (JavaJSObject::convertJObjectToValue):
898
899 2005-12-28  Anders Carlsson  <andersca@mac.com>
900
901         Reviewed by Maciej.
902
903         - The JSC part of http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
904         Add undetectable document.all
905         
906         * kjs/operations.cpp:
907         (KJS::equal):
908         When comparing an object with null or undefined, call toPrimitive with 
909         NullType as the preferred type.
910
911 2005-12-27  Anders Carlsson  <andersca@mac.com>
912
913         Reviewed by Darin.
914
915         * kjs/array_object.cpp:
916         (ArrayProtoFunc::callAsFunction):
917         Implement filter and map. Also, make the existing
918         array iteration functions not invoke the callback for
919         non-existing properties, just as Mozilla does now.
920         
921         * kjs/array_object.h:
922         (KJS::ArrayProtoFunc::):
923         Add filter and map.
924         
925         * tests/mozilla/expected.html:
926         Update, two 1.6 tests now pass.
927
928 2005-12-27  Maciej Stachowiak  <mjs@apple.com>
929
930         - updated test results for new JS 1.6 tests
931
932         * tests/mozilla/expected.html:
933
934 2005-12-27  Anders Carlsson  <andersca@mac.com>
935
936         Reviewed by Maciej.
937
938         Add Mozilla JS 1.6 tests.
939         
940         * tests/mozilla/js1_6/Array/browser.js: Added.
941         * tests/mozilla/js1_6/Array/regress-290592.js: Added.
942         * tests/mozilla/js1_6/Array/regress-304828.js: Added.
943         * tests/mozilla/js1_6/Array/regress-305002.js: Added.
944         * tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
945         * tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
946         * tests/mozilla/js1_6/Array/regress-320887.js: Added.
947         * tests/mozilla/js1_6/Array/shell.js: Added.
948         * tests/mozilla/js1_6/README: Added.
949         * tests/mozilla/js1_6/Regress/browser.js: Added.
950         * tests/mozilla/js1_6/Regress/regress-301574.js: Added.
951         * tests/mozilla/js1_6/Regress/regress-309242.js: Added.
952         * tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
953         * tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
954         * tests/mozilla/js1_6/Regress/regress-314887.js: Added.
955         * tests/mozilla/js1_6/Regress/regress-320172.js: Added.
956         * tests/mozilla/js1_6/Regress/shell.js: Added.
957         * tests/mozilla/js1_6/String/browser.js: Added.
958         * tests/mozilla/js1_6/String/regress-306591.js: Added.
959         * tests/mozilla/js1_6/String/shell.js: Added.
960         * tests/mozilla/js1_6/browser.js: Added.
961         * tests/mozilla/js1_6/shell.js: Added.
962         * tests/mozilla/js1_6/template.js: Added.
963
964 2005-12-27  Maks Orlovich <maksim@kde.org>
965
966         Reviewed and landed by Maciej.
967
968         - fixed 6234: Can delete array index property incorrectly.
969         http://bugzilla.opendarwin.org/show_bug.cgi?id=6234
970
971         * kjs/array_object.cpp:
972         (ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
973         looking for array properties.
974
975 2005-12-27  Anders Carlsson  <andersca@mac.com>
976
977         Reviewed by Maciej.
978
979         * kjs/object.cpp:
980         (KJS::JSObject::defineSetter):
981         Remove duplicate call to putDirect.
982
983 2005-12-26  Maciej Stachowiak  <mjs@apple.com>
984
985         Reviewed by Darin and Geoff.
986
987         Changes by me and Anders.
988
989         - mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
990         http://bugzilla.opendarwin.org/show_bug.cgi?id=6083
991
992         - also fixed some warnings reported by -Winline
993         
994         * JavaScriptCorePrefix.h: Move new and delete definitions higher so there
995         aren't conflicts with use in standard C++ headers
996         * kjs/object.cpp:
997         (KJS::throwSetterError): Moved this piece of put into a seprate function
998         to avoid the PIC branch.
999         (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
1000         when not needed. Also use GetterSetter properties attribute.
1001         (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
1002         properties any more, if this one was one.
1003         (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
1004         properties now (and use the new attribute).
1005         (KJS::JSObject::defineSetter): Ditto.
1006         (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
1007         to avoid global variable access in the hot code path.
1008         * kjs/object.h:
1009         (KJS::): Added GetterSetter attribute.
1010         (KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
1011         (KJS::JSValue::isObject): ditto
1012         (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
1013         as much as possible in the case where they are not being used
1014         * kjs/property_map.cpp:
1015         (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
1016         * kjs/property_map.h:
1017         (KJS::PropertyMap::hasGetterSetterProperties): Ditto
1018         (KJS::PropertyMap::setHasGetterSetterProperties): Ditto
1019         (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
1020         global "has getter/setter properties" flag in the property map
1021         single entry, to avoid making objects any bigger.
1022         * kjs/value.h: Moved some things to object.h to make -Winline happier
1023
1024 2005-12-24  Maciej Stachowiak  <mjs@apple.com>
1025
1026         Reviewed by Eric and Dave Hyatt.
1027
1028         - make even const PassRefPtrs give transfer of ownership semantics
1029         http://bugzilla.opendarwin.org/show_bug.cgi?id=6238
1030         
1031         This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
1032         in assignment and copy construction. And this makes life way easier and removes
1033         the need for pass(). It is not really correct, but we pretty much never need a real
1034         const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
1035         
1036         * kjs/identifier.cpp:
1037         (KJS::Identifier::add): No more need for pass()
1038         * kjs/property_map.cpp:
1039         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
1040         * kjs/ustring.cpp:
1041         (KJS::UString::Rep::create): Use adoptRef
1042         (KJS::UString::UString): No more need for pass
1043         (KJS::UString::append): No more need for pass
1044         (KJS::UString::substr): No more need for pass
1045         * kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
1046         (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
1047         (KXMLCore::PassRefPtr::release): Made this a const method (ugh)
1048         (KXMLCore::PassRefPtr::operator=): clean up appropriately
1049         (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
1050         it makes the behavior more clear and it is less verbose.
1051         (KXMLCore::static_pointer_cast): use adoptRef
1052         (KXMLCore::const_pointer_cast): use adoptRef
1053         * kxmlcore/RefPtr.h:
1054         (KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
1055         (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
1056
1057 2005-12-25  Eric Seidel  <eseidel@apple.com>
1058
1059         Reviewed by mjs.
1060
1061         Unbreak HashTableConstIterator++ by returning const_iterator
1062
1063         * kxmlcore/HashTable.h:
1064         (KXMLCore::HashTableConstIterator::operator++): use const_iterator
1065
1066 2005-12-25  Eric Seidel  <eseidel@apple.com>
1067
1068         Reviewed by mjs.
1069
1070         Un-break HashTable copy constructor.
1071
1072         * kxmlcore/HashTable.h:
1073         (KXMLCore::::HashTable): use const_iterator instead
1074
1075 2005-12-23  Maciej Stachowiak  <mjs@apple.com>
1076
1077         Reviewed by Eric.
1078
1079         - fixed "HashMap does not work with const pointer keys or values"
1080         http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
1081         
1082         * kxmlcore/HashMapPtrSpec.h:
1083         (KXMLCore::HashMap): In all methods, explicitly cast all pointers
1084         to void * before passing to internal implementation. Use C-style
1085         casts instead of new-style casts, because the real solution would
1086         require a combo of reinterpret_cast anc const_cast.
1087
1088
1089 2005-12-23  Maciej Stachowiak  <mjs@apple.com>
1090
1091         - this time for sure
1092
1093         * kxmlcore/RefPtr.h:
1094         (KXMLCore::::swap):
1095
1096 2005-12-22  Maciej Stachowiak  <mjs@apple.com>
1097
1098         - fix build problem from last commit.
1099
1100         * kxmlcore/RefPtr.h:
1101         (KXMLCore::::swap):
1102
1103 2005-12-21  Maciej Stachowiak  <mjs@apple.com>
1104
1105         Reviewed by Darin.
1106
1107         - Make HashMap/HashSet support non-POD types
1108         http://bugzilla.opendarwin.org/show_bug.cgi?id=5332
1109
1110         The changes for support are relatively simple, but I also made extensive changes to
1111         avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
1112
1113         * kxmlcore/HashTable.h:
1114         (KXMLCore::swap): specialize swap for pairs, to swap elements individually,
1115         so that excess copies can be avoided.
1116         (KXMLCore::Mover::move): Template function to either copy or swap, used
1117         when transferring elements from old table to new.
1118         (KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
1119         that took two or three function parameters now take a class parameter, this is
1120         the class used to do a normal lookup.
1121         (KXMLCore::IdentityHashTranslator::equal): Ditto.
1122         (KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
1123         to write into instead of returning a value to avoid redundant copies.
1124         (KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
1125         (KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
1126         functions. Added a FIXME about a remaining rare excess copy.
1127         (KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
1128         the key from Traits, to avoid creating and destroying pair, which copies.
1129         (KXMLCore::HashTable::isDeletedBucket): ditto
1130         (KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
1131         (KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
1132         work right for non-POD types.
1133         (KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
1134         (KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
1135         (KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
1136         (KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
1137         (KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
1138         (KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
1139         (KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
1140         work right
1141         * kxmlcore/HashFunctions.h:
1142         (KXMLCore::PointerHash): Specialize PointerHash for RefPtr
1143         * kxmlcore/HashMap.h:
1144         (KXMLCore::extractFirst): Return a reference not a full object to avoid
1145         copies.
1146         (KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
1147         to defer making the pair as long as possible, thus avoiding needless copies.
1148         (KXMLCore::HashMapTranslator::equal): ditto
1149         (KXMLCore::HashMapTranslator::translate): ditto
1150         (KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
1151         (KXMLCore::::set): Use inlineAdd
1152         (KXMLCore::::add): Use inlineAdd
1153         * kxmlcore/HashMapPtrSpec.h:
1154         (KXMLCore::): Pass KeyTraits along
1155         * kxmlcore/HashSet.h:
1156         (KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
1157         (KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
1158         the new HashTranslator approach.
1159         (KXMLCore::HashSetTranslatorAdapter::equal): ditto
1160         (KXMLCore::HashSetTranslatorAdapter::translate): ditto
1161         (KXMLCore::::insert): ditto
1162         * kxmlcore/HashTraits.h:
1163         (KXMLCore::GenericHashTraits): This is intended be used as a base class for
1164         customized traits: sensible defaults.
1165         (KXMLCore::): Use it a bunch
1166         (KXMLCore::assignDeleted): template function to allow pairs to be assigned the
1167         deleted value w/o excess copies.
1168         (KXMLCore::PairHashTraits::emptyValue): Updated
1169         (KXMLCore::PairHashTraits::deletedValue): Updated
1170         (KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
1171         (KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
1172         to either use use deletedValue or assignDeletedValue for the cases where we care.
1173         * kxmlcore/RefPtr.h:
1174         (KXMLCore::RefPtr::swap): Added swap method.
1175         (KXMLCore::swap): Added swap free function.
1176         * kjs/identifier.cpp:
1177         (KJS::CStringTranslator::hash): Use new HashTranslator class approach to
1178         alternate type based insertion.
1179         (KJS::CStringTranslator::equal): ditto
1180         (KJS::CStringTranslator::translate): ditto
1181         (KJS::Identifier::add): ditto
1182         (KJS::UCharBufferTranslator::hash): ditto
1183         (KJS::UCharBufferTranslator::equal): ditto
1184         (KJS::UCharBufferTranslator::translate): ditto
1185
1186         - irrelevant change:
1187         
1188         * kjs/array_object.cpp:
1189         (ArrayProtoFunc::callAsFunction): Removed a stray space.
1190
1191 2005-12-22  Anders Carlsson  <andersca@mac.com>
1192
1193         Reviewed by Eric and Darin.
1194
1195         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
1196         Would like to be able to define prototypes in headers
1197         
1198         * kjs/lookup.h:
1199         Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
1200         Also, namespace all macros by prefixing them with KJS_. 
1201
1202 2005-12-22  Darin Adler  <darin@apple.com>
1203
1204         Reviewed by Maciej.
1205
1206         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6191
1207           RefPtr/PassRefPtr have a leak issue, operator== issues
1208
1209         * kxmlcore/PassRefPtr.h:
1210         (KXMLCore::PassRefPtr::PassRefPtr): Remove non-template constructor that takes RefPtr
1211         since the constructor template that takes RefPtr should be sufficient. Add a constructor
1212         template that takes PassRefPtr&.
1213         (KXMLCore::PassRefPtr::adopt): Use PassRefPtr_Ref to avoid setting pointer first to
1214         0 and then to the pointer.
1215         (KXMLCore::PassRefPtr::operator=): Added template versions that take PassRefPtr& and
1216         RefPtr parameters.
1217         (KXMLCore::PassRefPtr::operator PassRefPtr<U>): Changed to fix leak -- old version
1218         would release and then ref.
1219         (KXMLCore::operator==): Make templates have two parameters so you can mix types.
1220         Also remove unneeded const in raw pointer versions.
1221         (KXMLCore::operator!=): Ditto.
1222
1223         * kxmlcore/RefPtr.h:
1224         (KXMLCore::RefPtr::RefPtr): Add constructor template that takes PassRefPtr.
1225         (KXMLCore::RefPtr::operator=): Add assignment operator templates that take
1226         RefPtr and PassRefPtr.
1227         (KXMLCore::operator==): Make templates have two parameters so you can mix types.
1228         Also remove unneeded const in raw pointer versions.
1229         (KXMLCore::operator!=): Ditto.
1230
1231 2005-12-21  Timothy Hatcher  <timothy@apple.com>
1232
1233         * JavaScriptCore.xcodeproj/project.pbxproj:
1234           Set tab width to 8, indent width to 4 and uses tabs to false per file.
1235
1236 2005-12-21  Geoffrey Garen  <ggaren@apple.com>
1237
1238         Reviewed by Darin.
1239
1240         Removed evil hack for determining if a type is an integer, replaced
1241         with template metaprogramming.
1242
1243         * JavaScriptCore.xcodeproj/project.pbxproj: Set tab size to 2 for
1244         testkjs.cpp
1245         * kjs/testkjs.cpp:
1246         (main): Inserted asserts to test IsInteger. FIXME: Move these to
1247         KXMLCore unit tests directory when we create one.
1248         * kxmlcore/HashTraits.h:
1249         (KXMLCore::): Added IsInteger class for querying types.
1250
1251 2005-12-20  Maciej Stachowiak  <mjs@apple.com>
1252
1253         Reviewed by Darin.
1254
1255         - made ALWAYS_INLINE declare things inline as well as __attribute__((always_inline))
1256         http://bugzilla.opendarwin.org/show_bug.cgi?id=6159
1257
1258         * kxmlcore/AlwaysInline.h:
1259
1260 2005-12-19  Maciej Stachowiak  <mjs@apple.com>
1261
1262         Reviewed by Darin.
1263
1264         - fixed a leak in the assignment operator from PassRefPtr to RefPtr
1265         http://bugzilla.opendarwin.org/show_bug.cgi?id=6158
1266
1267         * kxmlcore/RefPtr.h:
1268         (KXMLCore::RefPtr::operator=):
1269
1270         - fix problem with PassRefPtr that darin spotted - it lacked a copy constructor
1271         and therefore was using the default one, which can lead to excess derefs
1272
1273         I fixed this by adding a copy constructor from non-const
1274         reference, and by adding a template pass() function that you have
1275         to use when raw pointer or RefPtr are passed where PassRefPtr is
1276         expected.
1277
1278         * kjs/identifier.cpp:
1279         (KJS::Identifier::add): Changed to have PassRefPtr return type and
1280         pass() the results.     
1281         * kjs/identifier.h:
1282         * kjs/property_map.cpp:
1283         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Use pass()
1284         where required.
1285         * kjs/ustring.cpp:
1286         (KJS::UString::UString): Use pass() as needed.
1287         (KJS::UString::append): ditto
1288         (KJS::UString::substr): ditto
1289         * kjs/ustring.h:
1290         (KJS::UString::UString): Use initializer instead of assignment
1291         * kxmlcore/PassRefPtr.h:
1292         (KXMLCore::PassRefPtr::PassRefPtr): Added copy constructor
1293         (KXMLCore::pass): new template function to make it convenient to pass
1294         a PassRefPtr
1295
1296 2005-12-19  Geoffrey Garen  <ggaren@apple.com>
1297   
1298         Reviewed by Maciej.
1299
1300         Fixed <rdar://problem/4370397> Missing return statement in
1301         JSMethodNameToObjcMethodName.
1302
1303         JSMethodNameToObjcMethodName had a check for a name being too long, but
1304         the check was missing a return statement.
1305
1306         A lot of this code was confusing and some of it was wrong, so I fixed
1307         it up, added some asserts to catch this type of bug in the future, 
1308         changed some comments, and renamed some variables.
1309
1310         The two advantages of the new algorithm are (1) It makes writing past
1311         the end of the buffer virtually impossible because the test on the main
1312         loop is "while (not past end of buffer)" and (2) It's twice as fast
1313         because it doesn't call strlen. (There's no need to call strlen when
1314         we're walking the string ourselves.) 
1315         
1316         methodsNamed also supports arbitrary-length method names now. Just in 
1317         case the AppKit folks start getting REALLY verbose...
1318
1319         * bindings/objc/objc_class.mm:
1320         (KJS::Bindings::ObjcClass::methodsNamed):
1321         * bindings/objc/objc_utility.h:
1322         * bindings/objc/objc_utility.mm:
1323         (KJS::Bindings::JSMethodNameToObjcMethodName):
1324
1325 2005-12-19  Darin Adler  <darin@apple.com>
1326
1327         Originally done by both George Staikos and Alexey Proskuryakov.
1328
1329         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5706
1330           Sharedptr dependency can be removed
1331
1332         Our coding guidelines say "use 0 instead of NULL" and both RefPtr and
1333         PassRefPtr were using NULL, which required including a header that
1334         defines NULL.
1335
1336         * kxmlcore/PassRefPtr.h:
1337         (KXMLCore::PassRefPtr::PassRefPtr): Use 0 instead of NULL.
1338         (KXMLCore::PassRefPtr::operator!): Use ! instead of == NULL.
1339         * kxmlcore/RefPtr.h:
1340         (KXMLCore::RefPtr::RefPtr): Use 0 instead of NULL.
1341         (KXMLCore::RefPtr::operator!): Use ! instead of == NULL.
1342         Also did some reformatting.
1343
1344 2005-12-19  Darin Adler  <darin@apple.com>
1345
1346         Reviewed by Geoff Garen and Eric Seidel.
1347
1348         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4923
1349           stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
1350
1351         * kjs/simple_number.h: Removed many unnecessary includes, including
1352         the <cmath> one to work around GCC library header bugs. We may have to
1353         add some includes elsewhere for platforms other than OS X, since our
1354         prefix header takes care of some things.
1355
1356         * kxmlcore/AlwaysInline.h: Added. Now clients that don't include
1357         simple_number.h can still get the ALWAYS_INLINE macro.
1358         * JavaScriptCore.xcodeproj/project.pbxproj: Added AlwaysInline.h.
1359
1360         * bindings/NP_jsobject.h: Removed a lot of unnecessary includes
1361         and removed C-specific stuff from this C++-only header.
1362         * bindings/jni/jni_jsobject.h: Removed a lot of unnecessary includes
1363         and did some reformatting.
1364         * bindings/objc/objc_runtime.h:  Removed an unnecessary include.
1365         * bindings/runtime.h: Removed some unneeded includes. Reformatted.
1366         * bindings/runtime.cpp: Updated to compile with header changes,
1367         including a lot of reformatting.
1368         * bindings/runtime_object.h: Removed an unnecessary include.
1369
1370 2005-12-13  Maciej Stachowiak  <mjs@apple.com>
1371
1372         Reviewed by Geoff and Adele
1373
1374         - replaced custom Identifier hashtable with HashSet
1375
1376         * kjs/identifier.cpp:
1377         (KXMLCore::):
1378         (KJS::identifierTable):
1379         (KJS::Identifier::equal):
1380         (KJS::hash):
1381         (KJS::equal):
1382         (KJS::convert):
1383         (KJS::Identifier::add):
1384         (KJS::Identifier::remove):
1385         * kjs/identifier.h:
1386         * kjs/internal.cpp:
1387         (KJS::InterpreterImp::initGlobalObject):
1388
1389 2005-12-18  Justin Haygood  <justin@xiondigital.net>
1390
1391         Reviewed, tweaked, and landed by Darin.
1392
1393         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5227
1394           Array indexOf() extension for JavaScript 1.5 Core
1395
1396         * kjs/array_object.h:
1397         * kjs/array_object.cpp: (ArrayProtoFunc::callAsFunction): Added implementation of indexOf.
1398
1399 2005-12-18  Anders Carlsson  <andersca@mac.com>
1400
1401         Reviewed by Darin and Geoffrey.
1402
1403         - fix for <http://bugzilla.opendarwin.org/show_bug.cgi?id=4000>
1404         Object.prototype is missing isPrototypeOf
1405         
1406         * kjs/object_object.cpp:
1407         (ObjectPrototype::ObjectPrototype):
1408         Add isPrototypeOf to object prototype.
1409         
1410         (ObjectProtoFunc::callAsFunction):
1411         Implement isPrototypeOf
1412         
1413         * kjs/object_object.h:
1414         (KJS::ObjectProtoFunc::):
1415         Add id for isPrototypeOf.
1416
1417 2005-12-17  Geoffrey Garen  <ggaren@apple.com>
1418
1419         Reviewed by Darin.
1420
1421         Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6119
1422         split() function ignores case insensitive modifier.
1423
1424         Glossary:
1425         RegExpImp: The C++ object you get when JavaScript executes
1426                    "new RegExp()".
1427         RegExp:    A C++ wrapper object that performs regular expression
1428                    matching on behalf of a RegExpImp.
1429
1430         Instead of unnecessarily constructing a RegExp which (wrongly) lacks
1431         any modifiers, String.split() now uses the RegExp built in to the 
1432         RegExpImp passed to it, which has the right modifiers already.
1433
1434         I also cleaned up other bits of the string code to standardized how
1435         we handle RegExpImp arguments.
1436
1437         * ChangeLog:
1438         * kjs/string_object.cpp:
1439         (replace):
1440         (StringProtoFunc::callAsFunction):
1441
1442 2005-12-16  David Hyatt  <hyatt@apple.com>
1443
1444         Remove unused RefPtr constructors that can create an ambiguity in ustring on some platforms.
1445         
1446         Reviewed by mjs
1447
1448         * kxmlcore/RefPtr.h:
1449         (KXMLCore::RefPtr::RefPtr):
1450
1451 2005-12-15  Darin Adler  <darin@apple.com>
1452
1453         Reviewed by Maciej.
1454
1455         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5688
1456           speed up JavaScript parsing by not creating a UString just to parse
1457
1458         * kjs/internal.h:
1459         * kjs/internal.cpp: (KJS::InterpreterImp::evaluate): Change to take a character pointer
1460         and length rather than a UString.
1461
1462         * kjs/interpreter.h:
1463         * kjs/interpreter.cpp: (Interpreter::evaluate): Ditto.
1464
1465         * kjs/protect.h: Remove uneeded "convert to bool" operator since we already have a
1466         "convert to raw pointer" operator in this class.
1467
1468 === Safari-521~5 ===
1469
1470 2005-12-13  Geoffrey Garen  <ggaren@apple.com>
1471
1472         Updated test results to match Anders's last fix.
1473
1474         * tests/mozilla/expected.html:
1475
1476 2005-12-13  Anders Carlsson  <andersca@mac.com>
1477
1478         * ChangeLog: Add titles for my bugzilla bugs.
1479
1480 2005-12-13  Anders Carlsson  <andersca@mac.com>
1481
1482         Reviewed by Darin.
1483
1484         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=6041>
1485         Support property getters and setters.
1486         
1487         * bindings/runtime_array.cpp:
1488         (RuntimeArray::lengthGetter):
1489         (RuntimeArray::indexGetter):
1490         * bindings/runtime_array.h:
1491         * bindings/runtime_method.cpp:
1492         (RuntimeMethod::lengthGetter):
1493         * bindings/runtime_method.h:
1494         * bindings/runtime_object.cpp:
1495         (RuntimeObjectImp::fallbackObjectGetter):
1496         (RuntimeObjectImp::fieldGetter):
1497         (RuntimeObjectImp::methodGetter):
1498         * bindings/runtime_object.h:
1499         * kjs/array_instance.h:
1500         * kjs/array_object.cpp:
1501         (ArrayInstance::lengthGetter):
1502         (getProperty):
1503         Update for changes to PropertySlot::getValue and
1504         PropertySlot::GetValueFunc.
1505         
1506         * kjs/collector.cpp:
1507         (KJS::className):
1508         Handle GetterSetterType.
1509         
1510         * kjs/function.cpp:
1511         (KJS::FunctionImp::argumentsGetter):
1512         (KJS::FunctionImp::lengthGetter):
1513         (KJS::Arguments::mappedIndexGetter):
1514         (KJS::ActivationImp::argumentsGetter):
1515         * kjs/function.h:
1516         Update for changes to PropertySlot::getValue and
1517         PropertySlot::GetValueFunc.
1518         
1519         * kjs/grammar.y:
1520         Rework grammar parts for get set declarations directly
1521         in the object literal.
1522         
1523         * kjs/internal.cpp:
1524         (KJS::GetterSetterImp::mark):
1525         (KJS::GetterSetterImp::toPrimitive):
1526         (KJS::GetterSetterImp::toBoolean):
1527         (KJS::GetterSetterImp::toNumber):
1528         (KJS::GetterSetterImp::toString):
1529         (KJS::GetterSetterImp::toObject):
1530         Add type conversion functions. These aren't meant to be called.
1531         
1532         (KJS::printInfo):
1533         Handle GetterSetterType.
1534         
1535         * kjs/lookup.h:        
1536         (KJS::staticFunctionGetter):
1537         (KJS::staticValueGetter):
1538         Update for changes to PropertySlot::GetValueFunc.
1539         
1540         * kjs/nodes.cpp:
1541         Refactor they way properties nodes are implemented.
1542         We now have a PropertyListNode which is a list of PropertyNodes.
1543         Each PropertyNode has a name (which is a PropertyNameNode) and an associated
1544         value node. PropertyNodes can be of different types. The Constant type is the
1545         old constant declaration and the Getter and Setter types are for property getters
1546         and setters.
1547         (ResolveNode::evaluate):
1548         Update for changes to PropertySlot::getValue.
1549         
1550         (PropertyListNode::evaluate):
1551         Go through all property nodes and set them on the newly created object. If the
1552         property nodes are of type Getter or Setter, define getters and setters. Otherwise,
1553         just add the properties like before.
1554         
1555         (PropertyNode::evaluate):
1556         This should never be called directly.
1557         
1558         (PropertyNameNode::evaluate):
1559         Rename from PropertyNode::evaluate.
1560         
1561         (FunctionCallResolveNode::evaluate):
1562         (FunctionCallBracketNode::evaluate):
1563         (FunctionCallDotNode::evaluate):
1564         (PostfixResolveNode::evaluate):
1565         (PostfixBracketNode::evaluate):
1566         (PostfixDotNode::evaluate):
1567         (TypeOfResolveNode::evaluate):
1568         (PrefixResolveNode::evaluate):
1569         (PrefixBracketNode::evaluate):
1570         (PrefixDotNode::evaluate):
1571         (AssignResolveNode::evaluate):
1572         (AssignDotNode::evaluate):
1573         (AssignBracketNode::evaluate):
1574         Update for changes to PropertySlot::getValue.
1575         
1576         * kjs/nodes.h:
1577         (KJS::PropertyNameNode::PropertyNameNode):
1578         Rename from PropertyNode.
1579         
1580         (KJS::PropertyNode::):
1581         (KJS::PropertyNode::PropertyNode):
1582         New class, representing a single property.
1583         
1584         (KJS::PropertyListNode::PropertyListNode):
1585         Rename from PropertyValueNode.
1586         
1587         (KJS::FuncExprNode::FuncExprNode):
1588         Put ParameterNode parameter last, and make it optional.
1589         
1590         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1591         Use a PropertyListNode here now.
1592         
1593         * kjs/nodes2string.cpp:
1594         (PropertyListNode::streamTo):
1595         Iterate through all property nodes.
1596         
1597         (PropertyNode::streamTo):
1598         Print out the name and value. Doesn't handle getters and setters currently.
1599         
1600         (PropertyNameNode::streamTo):
1601         Rename from PropertyNode::streamTo.
1602         
1603         * kjs/object.cpp:
1604         (KJS::JSObject::get):
1605         Update for changes to PropertySlot::getValue.
1606         
1607         (KJS::JSObject::put):
1608         If the property already exists and has a Setter, invoke
1609         the setter function instead of setting the property directly.
1610         
1611         (KJS::JSObject::defineGetter):
1612         (KJS::JSObject::defineSetter):
1613         New functions for defining property getters and setters on the object.
1614         
1615         * kjs/object.h:
1616         (KJS::GetterSetterImp::type):
1617         (KJS::GetterSetterImp::GetterSetterImp):
1618         (KJS::GetterSetterImp::getGetter):
1619         (KJS::GetterSetterImp::setGetter):
1620         (KJS::GetterSetterImp::getSetter):
1621         (KJS::GetterSetterImp::setSetter):
1622         New class for properties which have getters and setters defined.
1623         This class is only used internally and should never be seen from the outside.
1624         
1625         (KJS::JSObject::getOwnPropertySlot):
1626          If the property is a getter, call setGetterSlot on the property slot.
1627          
1628         * kjs/object_object.cpp:
1629         (ObjectPrototype::ObjectPrototype):
1630         Add __defineGetter__, __defineSetter, __lookupGetter__, __lookupSetter__
1631         to prototype.
1632         
1633         (ObjectProtoFunc::callAsFunction):
1634         Implement handlers for new functions.
1635         
1636         * kjs/object_object.h:
1637         (KJS::ObjectProtoFunc::):
1638         Add ids for new functions.
1639         
1640         * kjs/property_slot.cpp:
1641         (KJS::PropertySlot::undefinedGetter):
1642         Update for changes to PropertySlot::GetValueFunc.
1643         
1644         (KJS::PropertySlot::functionGetter):
1645         Call the function getter object and return its value.
1646         
1647         * kjs/property_slot.h:
1648         (KJS::PropertySlot::getValue):
1649         Add a new argument which is the original object that
1650         getPropertySlot was called on.
1651         
1652         (KJS::PropertySlot::setGetterSlot):
1653         (KJS::PropertySlot::):
1654         New function which sets a getter slot. When getValue is called on a 
1655         getter slot, the getter function object is invoked.
1656         
1657         * kjs/string_object.cpp:
1658         (StringInstance::lengthGetter):
1659         (StringInstance::indexGetter):
1660         * kjs/string_object.h:
1661         Update for changes to PropertySlot::GetValueFunc.
1662         
1663         * kjs/value.h:
1664         (KJS::):
1665         Add GetterSetterType and make GetterSetterImp a friend class of JSCell.
1666
1667 2005-12-12  Maciej Stachowiak  <mjs@apple.com>
1668
1669         Reviewed by Eric.
1670
1671         - added a new HashCountedSet class for the common pattern of mapping items to counts that can change
1672         
1673         * kxmlcore/HashCountedSet.h: Added.
1674         (KXMLCore::HashCountedSet::*): Implemented, on top of HashMap.
1675         * kxmlcore/HashMap.h:
1676         (KXMLCore::HashMap::add): New method - does not replace existing value if key already present
1677         but otherwise like set().
1678         (KXMLCore::HashMap::set): Improved comments.
1679         * kxmlcore/HashMapPtrSpec.h:
1680         (KXMLCore::HashMap::add): Added to specializations too.
1681         * JavaScriptCore.xcodeproj/project.pbxproj: Add new  file.
1682         * kxmlcore/HashFunctions.h: Added include of stdint.h
1683         
1684         - replaced the custom hashtable for values protected from GC with HashCountedSet
1685
1686         * kjs/collector.cpp:
1687         (KJS::Collector::protect): Moved code here from ProtectedValues::increaseProtectCount
1688         since the code is so simple now.
1689         (KJS::Collector::unprotect): Ditto for ProtectedValues::decreaseProtectCount.
1690         (KJS::Collector::markProtectedObjects): Updated for new way of doing things, now
1691         simpler and safer.
1692         (KJS::Collector::numReferencedObjects): ditto
1693         (KJS::Collector::rootObjectClasses): ditto
1694         * kjs/collector.h: Added protect and unprotect static methods
1695         * kjs/protect.h:
1696         (KJS::gcProtect): Updated for removal of ProtectedValues class
1697         (KJS::gcUnprotect): likewise
1698         * kjs/protected_values.cpp: Removed.
1699         * kjs/protected_values.h: Removed.
1700
1701 2005-12-10  Darin Adler  <darin@apple.com>
1702
1703         Rubber stamped by Maciej.
1704
1705         - did long-promised KJS renaming:
1706         
1707             ValueImp -> JSValue
1708             ObjectImp -> JSObject
1709             AllocatedValueImp -> JSCell
1710         
1711         A renaming to get a class out of the way
1712         
1713             KJS::Bindings::JSObject -> JavaJSObject
1714  
1715         and some other "imp-reduction" renaming
1716         
1717             *InstanceImp -> *Instance
1718             *ProtoFuncImp -> *ProtoFunc
1719             *PrototypeImp -> *Prototype
1720             ArgumentsImp -> Arguments
1721             RuntimeArrayImp -> RuntimeArray
1722             RuntimeMethodImp -> RuntimeMethod
1723
1724         * most files and functions
1725
1726 2005-12-10  Darin Adler  <darin@apple.com>
1727
1728         Reviewed by Maciej.
1729
1730         - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
1731
1732         Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().
1733
1734         * bindings/NP_jsobject.cpp:
1735         (_NPN_Evaluate):
1736         * bindings/c/c_instance.cpp:
1737         (KJS::Bindings::CInstance::invokeMethod):
1738         (KJS::Bindings::CInstance::invokeDefaultMethod):
1739         * bindings/c/c_runtime.cpp:
1740         (CField::valueFromInstance):
1741         * bindings/c/c_utility.cpp:
1742         (KJS::Bindings::convertNPVariantToValue):
1743         * bindings/jni/jni_instance.cpp:
1744         (JavaInstance::invokeMethod):
1745         (JavaInstance::invokeDefaultMethod):
1746         * bindings/jni/jni_jsobject.cpp:
1747         (JSObject::eval):
1748         (JSObject::convertJObjectToValue):
1749         * bindings/jni/jni_runtime.cpp:
1750         (JavaArray::convertJObjectToArray):
1751         (JavaField::valueFromInstance):
1752         (JavaArray::valueAt):
1753         * bindings/objc/WebScriptObject.mm:
1754         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1755         (-[WebScriptObject evaluateWebScript:]):
1756         (-[WebScriptObject valueForKey:]):
1757         (-[WebScriptObject webScriptValueAtIndex:]):
1758         * bindings/objc/objc_instance.mm:
1759         (ObjcInstance::invokeMethod):
1760         (ObjcInstance::invokeDefaultMethod):
1761         (ObjcInstance::getValueOfUndefinedField):
1762         * bindings/objc/objc_runtime.mm:
1763         (ObjcField::valueFromInstance):
1764         (ObjcFallbackObjectImp::callAsFunction):
1765         * bindings/objc/objc_utility.mm:
1766         (KJS::Bindings::convertNSStringToString):
1767         (KJS::Bindings::convertObjcValueToValue):
1768         * bindings/runtime.h:
1769         (KJS::Bindings::Class::fallbackObject):
1770         (KJS::Bindings::Instance::getValueOfUndefinedField):
1771         (KJS::Bindings::Instance::valueOf):
1772         * bindings/runtime_array.cpp:
1773         (RuntimeArrayImp::lengthGetter):
1774         * bindings/runtime_method.cpp:
1775         (RuntimeMethodImp::lengthGetter):
1776         (RuntimeMethodImp::callAsFunction):
1777         (RuntimeMethodImp::execute):
1778         * kjs/array_object.cpp:
1779         (ArrayInstanceImp::lengthGetter):
1780         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1781         (ArrayPrototypeImp::ArrayPrototypeImp):
1782         (ArrayProtoFuncImp::ArrayProtoFuncImp):
1783         (ArrayProtoFuncImp::callAsFunction):
1784         (ArrayObjectImp::ArrayObjectImp):
1785         * kjs/bool_object.cpp:
1786         (BooleanPrototypeImp::BooleanPrototypeImp):
1787         (BooleanProtoFuncImp::callAsFunction):
1788         (BooleanObjectImp::BooleanObjectImp):
1789         (BooleanObjectImp::callAsFunction):
1790         * kjs/error_object.cpp:
1791         (ErrorPrototypeImp::ErrorPrototypeImp):
1792         (ErrorProtoFuncImp::ErrorProtoFuncImp):
1793         (ErrorProtoFuncImp::callAsFunction):
1794         (ErrorObjectImp::ErrorObjectImp):
1795         (NativeErrorImp::NativeErrorImp):
1796         * kjs/function.cpp:
1797         (KJS::FunctionImp::callAsFunction):
1798         (KJS::FunctionImp::processParameters):
1799         (KJS::FunctionImp::argumentsGetter):
1800         (KJS::FunctionImp::lengthGetter):
1801         (KJS::DeclaredFunctionImp::execute):
1802         (KJS::encode):
1803         (KJS::decode):
1804         (KJS::GlobalFuncImp::callAsFunction):
1805         * kjs/function_object.cpp:
1806         (FunctionPrototypeImp::FunctionPrototypeImp):
1807         (FunctionPrototypeImp::callAsFunction):
1808         (FunctionProtoFuncImp::callAsFunction):
1809         (FunctionObjectImp::FunctionObjectImp):
1810         * kjs/internal.cpp:
1811         (KJS::InterpreterImp::initGlobalObject):
1812         * kjs/interpreter.h:
1813         * kjs/lookup.h:
1814         * kjs/math_object.cpp:
1815         (MathObjectImp::getValueProperty):
1816         (MathFuncImp::callAsFunction):
1817         * kjs/nodes.cpp:
1818         (Node::setExceptionDetailsIfNeeded):
1819         (NullNode::evaluate):
1820         (PropertyNode::evaluate):
1821         (FunctionCallBracketNode::evaluate):
1822         (FunctionCallDotNode::evaluate):
1823         (PostfixBracketNode::evaluate):
1824         (PostfixDotNode::evaluate):
1825         (VoidNode::evaluate):
1826         (PrefixBracketNode::evaluate):
1827         (PrefixDotNode::evaluate):
1828         (ShiftNode::evaluate):
1829         (valueForReadModifyAssignment):
1830         (AssignDotNode::evaluate):
1831         (AssignBracketNode::evaluate):
1832         (VarDeclNode::evaluate):
1833         (VarDeclNode::processVarDecls):
1834         (VarDeclListNode::evaluate):
1835         (ReturnNode::execute):
1836         (CaseClauseNode::evalStatements):
1837         (ParameterNode::evaluate):
1838         (FuncDeclNode::processFuncDecl):
1839         * kjs/nodes.h:
1840         (KJS::StatementNode::evaluate):
1841         * kjs/number_object.cpp:
1842         (NumberPrototypeImp::NumberPrototypeImp):
1843         (NumberProtoFuncImp::callAsFunction):
1844         (NumberObjectImp::NumberObjectImp):
1845         (NumberObjectImp::getValueProperty):
1846         (NumberObjectImp::callAsFunction):
1847         * kjs/object.cpp:
1848         (KJS::ObjectImp::get):
1849         (KJS::Error::create):
1850         * kjs/object_object.cpp:
1851         (ObjectPrototypeImp::ObjectPrototypeImp):
1852         (ObjectProtoFuncImp::callAsFunction):
1853         (ObjectObjectImp::ObjectObjectImp):
1854         * kjs/property_slot.cpp:
1855         (KJS::PropertySlot::undefinedGetter):
1856         * kjs/regexp_object.cpp:
1857         (RegExpPrototypeImp::RegExpPrototypeImp):
1858         (RegExpProtoFuncImp::callAsFunction):
1859         (RegExpObjectImp::RegExpObjectImp):
1860         (RegExpObjectImp::arrayOfMatches):
1861         (RegExpObjectImp::getBackref):
1862         (RegExpObjectImp::getLastMatch):
1863         (RegExpObjectImp::getLastParen):
1864         (RegExpObjectImp::getLeftContext):
1865         (RegExpObjectImp::getRightContext):
1866         (RegExpObjectImp::getValueProperty):
1867         (RegExpObjectImp::construct):
1868         * kjs/string_object.cpp:
1869         (StringInstanceImp::StringInstanceImp):
1870         (StringPrototypeImp::StringPrototypeImp):
1871         (replace):
1872         (StringProtoFuncImp::callAsFunction):
1873         (StringObjectImp::StringObjectImp):
1874         (StringObjectImp::callAsFunction):
1875         (StringObjectFuncImp::StringObjectFuncImp):
1876         (StringObjectFuncImp::callAsFunction):
1877         * kjs/testkjs.cpp:
1878         (TestFunctionImp::callAsFunction):
1879         (VersionFunctionImp::callAsFunction):
1880         * kjs/value.h:
1881
1882 2005-12-10  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
1883
1884         Reviewed by Maciej, landed by Darin.
1885
1886         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3539
1887           Array join and toString methods do not support circular references
1888
1889         * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction):
1890         Added set of visited objects -- don't recurse if item is already in the set.
1891
1892 2005-12-08  Maciej Stachowiak  <mjs@apple.com>
1893
1894         Reviewed by John.
1895
1896         - fix major memory leak and resultant slowdown on JavaScript iBench from
1897         my PassRefPtr changes
1898         
1899         * kjs/ustring.cpp:
1900         (KJS::UString::Rep::create): I forgot to change one of the two overloads to create
1901         with a refcount of 0 instead of 1 (the smart pointer then bumps it. But instead of
1902         changing it, I changed both to start with a refcounter of 1 and use PassRefPtr::adopt
1903         to adopt the initial refcount, this may be a hair more efficient.
1904
1905         - made the assignment operators for smart pointers inline because Shark said so
1906         
1907         * kxmlcore/PassRefPtr.h:
1908         (KXMLCore::::operator=):
1909         * kxmlcore/RefPtr.h:
1910         (KXMLCore::::operator=):
1911
1912 2005-12-06  Anders Carlsson  <andersca@mac.com>
1913
1914         Reviewed by Darin.
1915
1916         - fix build when using gcc 4
1917                 
1918         * kjs/ustring.h:
1919         Make Rep public.
1920
1921         * kxmlcore/PassRefPtr.h:
1922         (KXMLCore::::operator):
1923         Fix a typo.
1924
1925 2005-12-05  Maciej Stachowiak  <mjs@apple.com>
1926
1927         Reviewed by Eric.
1928
1929         - add PassRefPtr, a smart pointer class that works in conjunction
1930         with RefPtr but has transfer-of-ownership semantics
1931         - apply RefPtr and PassRefPtr to UString
1932         - cleaned up UString a little so that it doesn't need to have so many friend classes
1933
1934         * JavaScriptCore.xcodeproj/project.pbxproj:
1935         * kjs/identifier.cpp:
1936         (KJS::Identifier::add):
1937         * kjs/identifier.h:
1938         (KJS::Identifier::Identifier):
1939         (KJS::Identifier::equal):
1940         * kjs/property_map.cpp:
1941         (KJS::PropertyMap::get):
1942         (KJS::PropertyMap::getLocation):
1943         (KJS::PropertyMap::put):
1944         (KJS::PropertyMap::remove):
1945         * kjs/ustring.cpp:
1946         (KJS::UCharReference::operator=):
1947         (KJS::UCharReference::ref):
1948         (KJS::UString::Rep::createCopying):
1949         (KJS::UString::Rep::create):
1950         (KJS::UString::usedCapacity):
1951         (KJS::UString::usedPreCapacity):
1952         (KJS::UString::expandCapacity):
1953         (KJS::UString::expandPreCapacity):
1954         (KJS::UString::UString):
1955         (KJS::UString::spliceSubstringsWithSeparators):
1956         (KJS::UString::append):
1957         (KJS::UString::operator=):
1958         (KJS::UString::toStrictUInt32):
1959         (KJS::UString::substr):
1960         (KJS::UString::copyForWriting):
1961         (KJS::operator==):
1962         * kjs/ustring.h:
1963         (KJS::UString::UString):
1964         (KJS::UString::~UString):
1965         (KJS::UString::data):
1966         (KJS::UString::isNull):
1967         (KJS::UString::isEmpty):
1968         (KJS::UString::size):
1969         (KJS::UString::rep):
1970         * kxmlcore/RefPtr.h:
1971         (KXMLCore::RefPtr::RefPtr):
1972         (KXMLCore::RefPtr::operator*):
1973         (KXMLCore::::operator):
1974         (KXMLCore::operator==):
1975         (KXMLCore::operator!=):
1976         (KXMLCore::static_pointer_cast):
1977         (KXMLCore::const_pointer_cast):
1978
1979 2005-12-04  Geoffrey Garen  <ggaren@apple.com>
1980
1981         Update test results to match Anders's last checkin.
1982
1983         * tests/mozilla/expected.html:
1984
1985 2005-12-04  Anders Carlsson  <andersca@mac.com>
1986
1987         Reviewed by Geoffrey.
1988
1989         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3999>
1990         Object.prototype is missing propertyIsEnumerable
1991         
1992         * kjs/object.cpp:
1993         (KJS::ObjectImp::canPut):
1994         Refactor to use getPropertyAttributes.
1995
1996         (KJS::ObjectImp::propertyIsEnumerable):
1997         New function which checks if a property is enumerable.
1998
1999         (KJS::ObjectImp::getPropertyAttributes):
2000         * kjs/object.h:
2001         Add getPropertyAttributes and propertyIsEnumerable.
2002
2003         * kjs/object_object.cpp:
2004         (ObjectPrototypeImp::ObjectPrototypeImp):
2005         (ObjectProtoFuncImp::callAsFunction):
2006         * kjs/object_object.h:
2007         (KJS::ObjectProtoFuncImp::):
2008         Add propertyIsEnumerable to the Object prototype.
2009
2010 2005-12-01  Maciej Stachowiak  <mjs@apple.com>
2011
2012         Reviewed by Tim Hatcher.
2013
2014         - removed deprecated reset, isNull and nonNull methods
2015
2016         * kxmlcore/RefPtr.h:
2017
2018 2005-12-01  Anders Carlsson  <andersca@mac.com>
2019
2020         Reviewed by Darin.
2021
2022         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3382>
2023         nodes2strings.cpp fails to print left expression of ForInNode when 'var' is not used
2024         
2025         Patch by Mark Rowe.
2026
2027         * kjs/nodes2string.cpp:
2028         (ForInNode::streamTo):
2029         Add lexpr if there's no varDecl.
2030
2031 2005-12-01  Maciej Stachowiak  <mjs@apple.com>
2032
2033         Rubber stamped by Eric.
2034
2035         - renamed SharedPtr to RefPtr via script
2036
2037         * JavaScriptCore.xcodeproj/project.pbxproj:
2038         * kjs/function.cpp:
2039         (KJS::GlobalFuncImp::callAsFunction):
2040         * kjs/function.h:
2041         * kjs/function_object.cpp:
2042         (FunctionObjectImp::construct):
2043         * kjs/internal.cpp:
2044         (KJS::Parser::parse):
2045         (KJS::InterpreterImp::checkSyntax):
2046         (KJS::InterpreterImp::evaluate):
2047         * kjs/internal.h:
2048         * kjs/nodes.h:
2049         * kjs/nodes2string.cpp:
2050         (KJS::SourceStream::operator<<):
2051         * kjs/protect.h:
2052         * kxmlcore/RefPtr.h: Added.
2053         (KXMLCore::RefPtr::RefPtr):
2054         (KXMLCore::RefPtr::~RefPtr):
2055         (KXMLCore::RefPtr::isNull):
2056         (KXMLCore::RefPtr::notNull):
2057         (KXMLCore::RefPtr::reset):
2058         (KXMLCore::RefPtr::get):
2059         (KXMLCore::RefPtr::operator*):
2060         (KXMLCore::RefPtr::operator->):
2061         (KXMLCore::RefPtr::operator!):
2062         (KXMLCore::RefPtr::operator UnspecifiedBoolType):
2063         (KXMLCore::::operator):
2064         (KXMLCore::operator==):
2065         (KXMLCore::operator!=):
2066         (KXMLCore::static_pointer_cast):
2067         (KXMLCore::const_pointer_cast):
2068         * kxmlcore/SharedPtr.h: Removed.
2069
2070 2005-11-30  Maciej Stachowiak  <mjs@apple.com>
2071
2072         Reviewed by Dave Hyatt.
2073
2074         - change idiom used for implicit bool conversion of smart pointers, because the old one gives weird error messages sometimes
2075
2076         * kjs/protect.h:
2077         (KJS::ProtectedPtr::operator UnspecifiedBoolType):
2078         * kxmlcore/SharedPtr.h:
2079         (KXMLCore::SharedPtr::operator UnspecifiedBoolType):
2080
2081 2005-11-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2082
2083         Reviewed by ggaren.  Committed by eseidel.
2084
2085         Date conversion to local time gets the DST flag wrong sometimes
2086         http://bugzilla.opendarwin.org/show_bug.cgi?id=5514
2087
2088         * kjs/date_object.cpp:
2089         (KJS::isTime_tSigned):
2090         (KJS::DateProtoFuncImp::callAsFunction):
2091
2092 2005-11-26  Maciej Stachowiak  <mjs@apple.com>
2093
2094         Rubber stamped by Eric.
2095
2096         - renamed InterpreterLock to JSLock
2097
2098         * bindings/NP_jsobject.cpp:
2099         (_NPN_Invoke):
2100         (_NPN_Evaluate):
2101         (_NPN_GetProperty):
2102         (_NPN_SetProperty):
2103         (_NPN_RemoveProperty):
2104         (_NPN_HasProperty):
2105         (_NPN_HasMethod):
2106         (_NPN_SetException):
2107         * bindings/jni/jni_jsobject.cpp:
2108         (JSObject::call):
2109         (JSObject::eval):
2110         (JSObject::getMember):
2111         (JSObject::setMember):
2112         (JSObject::removeMember):
2113         (JSObject::getSlot):
2114         (JSObject::setSlot):
2115         (JSObject::toString):
2116         (JSObject::convertJObjectToValue):
2117         * bindings/objc/WebScriptObject.mm:
2118         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2119         (-[WebScriptObject evaluateWebScript:]):
2120         (-[WebScriptObject setValue:forKey:]):
2121         (-[WebScriptObject valueForKey:]):
2122         (-[WebScriptObject removeWebScriptKey:]):
2123         (-[WebScriptObject stringRepresentation]):
2124         (-[WebScriptObject webScriptValueAtIndex:]):
2125         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2126         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
2127         * bindings/runtime.cpp:
2128         (Instance::createRuntimeObject):
2129         * bindings/runtime_root.cpp:
2130         (KJS::Bindings::addNativeReference):
2131         (KJS::Bindings::removeNativeReference):
2132         (RootObject::removeAllNativeReferences):
2133         * bindings/runtime_root.h:
2134         (KJS::Bindings::RootObject::~RootObject):
2135         (KJS::Bindings::RootObject::setRootObjectImp):
2136         * bindings/testbindings.cpp:
2137         (main):
2138         * bindings/testbindings.mm:
2139         (main):
2140         * kjs/JSLock.cpp:
2141         (KJS::initializeJSLock):
2142         (KJS::JSLock::lock):
2143         (KJS::JSLock::unlock):
2144         (KJS::JSLock::lockCount):
2145         (KJS::JSLock::DropAllLocks::DropAllLocks):
2146         (KJS::JSLock::DropAllLocks::~DropAllLocks):
2147         * kjs/JSLock.h:
2148         (KJS::JSLock::JSLock):
2149         (KJS::JSLock::~JSLock):
2150         * kjs/collector.cpp:
2151         (KJS::Collector::allocate):
2152         (KJS::Collector::collect):
2153         * kjs/internal.cpp:
2154         (KJS::InterpreterImp::InterpreterImp):
2155         (KJS::InterpreterImp::clear):
2156         (KJS::InterpreterImp::checkSyntax):
2157         (KJS::InterpreterImp::evaluate):
2158         * kjs/interpreter.cpp:
2159         (Interpreter::evaluate):
2160         * kjs/protect.h:
2161         (KJS::::ProtectedPtr):
2162         (KJS::::~ProtectedPtr):
2163         (KJS::::operator):
2164         * kjs/protected_reference.h:
2165         (KJS::ProtectedReference::ProtectedReference):
2166         (KJS::ProtectedReference::~ProtectedReference):
2167         (KJS::ProtectedReference::operator=):
2168         * kjs/protected_values.cpp:
2169         (KJS::ProtectedValues::getProtectCount):
2170         (KJS::ProtectedValues::increaseProtectCount):
2171         (KJS::ProtectedValues::decreaseProtectCount):
2172         * kjs/testkjs.cpp:
2173         (TestFunctionImp::callAsFunction):
2174         (main):
2175
2176 2005-11-26  Darin Adler  <darin@apple.com>
2177
2178         Reviewed by eseidel.  Committed by eseidel.
2179
2180         Inline ScopeChain functions for speed.
2181         http://bugzilla.opendarwin.org/show_bug.cgi?id=5687
2182
2183         * kjs/object.h:
2184         (KJS::ScopeChain::mark):
2185         * kjs/scope_chain.cpp:
2186         * kjs/scope_chain.h:
2187         (KJS::ScopeChain::ref):
2188         (KJS::ScopeChain::operator=):
2189         (KJS::ScopeChain::bottom):
2190         (KJS::ScopeChain::push):
2191         (KJS::ScopeChain::pop):
2192
2193 2005-11-21  Maciej Stachowiak  <mjs@apple.com>
2194
2195         Reviewed by Geoff.
2196
2197         <rdar://problem/4139620> Seed: WebKit: hang when sending XMLHttpRequest if automatic proxy config is used
2198
2199         Also factored locking code completely into a separate class, and
2200         added a convenient packaged way to temporarily drop locks.
2201
2202         * JavaScriptCore.xcodeproj/project.pbxproj:
2203         * kjs/JSLock.cpp: Added.
2204         (KJS::initializeInterpreterLock):
2205         (KJS::InterpreterLock::lock):
2206         (KJS::InterpreterLock::unlock):
2207         (KJS::InterpreterLock::lockCount):
2208         (KJS::InterpreterLock::DropAllLocks::DropAllLocks):
2209         (KJS::InterpreterLock::DropAllLocks::~DropAllLocks):
2210         * kjs/JSLock.h: Added.
2211         (KJS::InterpreterLock::InterpreterLock):
2212         (KJS::InterpreterLock::~InterpreterLock):
2213         * kjs/internal.cpp:
2214         * kjs/internal.h:
2215         * kjs/interpreter.cpp:
2216         * kjs/interpreter.h:
2217         * kjs/protect.h:
2218         * kjs/testkjs.cpp:
2219         (TestFunctionImp::callAsFunction):
2220
2221 2005-11-21  Eric Seidel  <eseidel@apple.com>
2222
2223         Rubber-stamped by hyatt.
2224         
2225         Removed JavaScriptCore+SVG target.
2226
2227         * JavaScriptCore.xcodeproj/project.pbxproj:
2228
2229 2005-11-15  Geoffrey Garen  <ggaren@apple.com>
2230
2231         Reviewed by mjs.
2232         
2233         - Fixed <rdar://problem/4342216> Installer crash in 
2234           KJS::ValueImp::marked() when garbage collector runs inside call to 
2235           ConstantValues::init()
2236           
2237         I took responsibility for initializing and marking ConstantValues away 
2238         from InterpreterImp, since it's possible to reference such a value 
2239         before any interpreter has been created and after the last interpreter 
2240         has been destroyed.
2241
2242         InterpreterImp::lock now initializes ConstantValues. It's a good
2243         place for the initialization because you have to call it before
2244         creating any objects. Since ::lock can be called more than once,
2245         I added a check in ConstantValues::init to ensure that it executes 
2246         only once.
2247
2248         Collector:collect is now responsible for marking ConstantValues.
2249
2250         We no longer clear the ConstantValues since we can't guarantee that no 
2251         one has a reference to them.
2252
2253         FIXME: This is hackery. The long-term plan is to make ConstantValues
2254         use immediate values that require no initialization.
2255
2256         * ChangeLog:
2257         * kjs/collector.cpp:
2258         (KJS::Collector::collect):
2259         * kjs/internal.cpp:
2260         (KJS::InterpreterImp::InterpreterImp):
2261         (KJS::InterpreterImp::lock):
2262         (KJS::InterpreterImp::clear):
2263         (KJS::InterpreterImp::mark):
2264         * kjs/internal.h:
2265         * kjs/value.cpp:
2266         (KJS::ConstantValues::initIfNeeded):
2267         * kjs/value.h:
2268
2269 2005-11-08  Geoffrey Garen  <ggaren@apple.com>
2270
2271         Reviewed by Darin.
2272
2273         This patch fixes some naughty naughty code -- 5 crashes and 2 
2274         may-go-haywire-in-the-futures.
2275         
2276         One such crash is <rdar://problem/4247330> 8C46 Crash with with 
2277         incomplete parameter list to webScript object function.
2278         
2279         I replaced early returns from within NS_DURINGs with calls to
2280         NS_VALUERETURN because the doc says, "You cannot use goto or 
2281         return to exit an exception handling domain -- errors will result."
2282         
2283         I replaced hard-coded analyses of -[NSMethodSignature 
2284         methodReturnType] with more abstracted alternatives, since
2285         the documentation says "This encoding is implementation-specific, 
2286         so applications should use it with caution," and then emits an
2287         evil cackle.
2288         
2289         I removed the early return in the case where a JavaScript caller
2290         supplies an insufficient number of arguments, because the right
2291         thing to do in such a case is to use JavaScript's defined behavior
2292         of supplying "undefined" for any missing arguments.
2293         
2294         I also changed ObjcInstance::invokeMethod so that it no longer
2295         deletes the method passed to it. It doesn't create the method,
2296         so it shouldn't delete it. A friend of mine named
2297         KERNEL_PROTECTION_FAILURE agrees with me on this point.
2298         
2299         Finally, I changed an assert(true) to assert(false) because
2300         all the other asserts were making fun of it.
2301
2302         * bindings/objc/objc_instance.mm:
2303         (ObjcInstance::invokeMethod):
2304         (ObjcInstance::invokeDefaultMethod):
2305
2306 2005-11-06  Geoffrey Garen  <ggaren@apple.com>
2307
2308         Reviewed by Darin.
2309
2310         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5571
2311           REGRESSION (412.5-TOT): duplicated words/sentences at 
2312           shakespeer.sourceforge.net
2313
2314         Our UTF16-modified PCRE didn't work with extended character classes
2315         (classes involving characters > 255) because it used the GETCHARINC
2316         macro to read through them. In UTF16 mode, GETCHARINC expects UTF16 
2317         input, but PCRE encodes character classes in UTF8 regardless of the
2318         input mode of the subject string.
2319
2320         The fix is to explicitly define GETUTF8CHARINC, and to use it,
2321         rather than GETCHARINC, when reading extended character classes. 
2322         
2323         In UTF8 mode, we simply define GETCHARINC to be GETUTF8CHARINC.
2324
2325         * pcre/pcre_internal.h:
2326         * pcre/pcre_xclass.c:
2327         (_pcre_xclass):
2328
2329 2005-11-05  Geoffrey Garen  <ggaren@apple.com>
2330
2331         Patch by Mitz Pettel, reviewed by Maciej.
2332
2333         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5357
2334           REGRESSION: Scriptable plugin hides properties of OBJECT element
2335
2336         * bindings/objc/objc_class.mm:
2337         (KJS::Bindings::ObjcClass::fallbackObject):
2338
2339 2005-11-05  Geoffrey Garen  <ggaren@apple.com>
2340
2341         Reviewed by Darin.
2342
2343         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5409
2344         slice() testcase doesn't pass
2345
2346         Modified String.slice to deal with funky values.
2347         Updated test results. We now pass <js1_2/String/slice.js>.
2348
2349         * kjs/string_object.cpp:
2350         (StringProtoFuncImp::callAsFunction):
2351         * tests/mozilla/expected.html:
2352
2353 2005-11-04  Darin Adler  <darin@apple.com>
2354
2355         Reviewed by Tim Hatcher.
2356
2357         * kxmlcore/HashSet.h: Fixed case of "hashfunctions.h" -- needs to be "HashFunctions.h".
2358
2359 2005-11-03  Timothy Hatcher  <timothy@apple.com>
2360
2361         Reviewed by Darin and Vicki.
2362
2363         * JavaScriptCore.xcodeproj/project.pbxproj:
2364           Change to use $(SYSTEM_LIBRARY_DIR) consistently and place
2365           $(NEXT_ROOT) in a few spots to make build-root work.
2366
2367 2005-11-03  Geoffrey Garen  <ggaren@apple.com>
2368
2369         - Updated JavaScriptCore test results to reflect recent fixes.
2370
2371         * tests/mozilla/expected.html:
2372
2373 2005-11-03  Geoffrey Garen  <ggaren@apple.com>
2374
2375         Reviewed by darin.
2376
2377         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5602
2378           REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
2379
2380         We now update lastIndex relative to the start of the last match,
2381         rather than the start of the last search. We used to assume that
2382         the two were equal, but that is not the case when a pattern
2383         matches at a character after the first in the string.
2384
2385         * kjs/regexp_object.cpp:
2386         (RegExpProtoFuncImp::callAsFunction):
2387
2388 2005-10-24  John Sullivan  <sullivan@apple.com>
2389
2390         Reviewed by Darin Adler. Code changes by Alexey Proskuryakov.
2391         
2392         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4931
2393         Unicode format characters (Cf) should be removed from JavaScript source
2394
2395         * kjs/lexer.cpp:
2396         include <unicode/uchar.h>
2397         (Lexer::Lexer):
2398         use KJS::UChar instead of UChar to avoid ambiguity caused by new include
2399         (Lexer::setCode):
2400         ditto; also, use shift(4) to skip first 4 chars to take advantage of new
2401         logic there.
2402         (Lexer::shift):
2403         skip chars of type U_FORMAT_CHAR
2404         (Lexer::convertUnicode):
2405         use KJS::UChar instead of UChar to avoid ambiguity caused by new include
2406         (Lexer::record16):
2407         ditto
2408         (Lexer::makeIdentifier):
2409         ditto
2410         (Lexer::makeUString):
2411         ditto
2412         
2413         * tests/mozilla/ecma/Array/15.4.5.1-1.js:
2414         updated to skip soft hyphens
2415
2416 2005-10-24  John Sullivan  <sullivan@apple.com>
2417
2418         Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
2419         
2420         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4142
2421         Date object does not always adjust daylight savings correctly
2422
2423         * kjs/date_object.cpp:
2424         (KJS::makeTime):
2425         Fix the case where a time change crosses the daylight savings start/end dates.
2426
2427 2005-10-17  Maciej Stachowiak  <mjs@apple.com>
2428
2429         Reviewed by Geoff. Code changes by Darin.
2430
2431         - some micro-optimizations to FastMalloc to reduce math and branches.
2432
2433         * kxmlcore/FastMalloc.cpp:
2434         (KXMLCore::TCMalloc_Central_FreeList::Populate):
2435         (KXMLCore::fastMallocRegisterThread):
2436         (KXMLCore::TCMalloc_ThreadCache::GetCache):
2437         (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
2438
2439 2005-10-15  Maciej Stachowiak  <mjs@apple.com>
2440
2441         Reverted fix for this bug, because it was part of a time range that caused a performance
2442         regression:
2443         
2444         <rdar://problem/4260481> Remove Reference type from JavaScriptCore
2445
2446 2005-10-15  Darin Adler  <darin@apple.com>
2447
2448         * kxmlcore/HashTable.cpp: Fixed build failure (said hashtable.h instead of HashTable.h).
2449
2450 2005-10-14  Geoffrey Garen  <ggaren@apple.com>
2451
2452         Style changes recommended by Darin.
2453         
2454         Changed to camelCase, changed ValueImp* to ValueImp *.
2455
2456         * kjs/simple_number.h:
2457         (KJS::SimpleNumber::make):
2458         (KJS::SimpleNumber::value):
2459
2460 2005-10-11  Geoffrey Garen  <ggaren@apple.com>
2461
2462         Added regexp_object.lut.h build phase from JavaScriptCore
2463         to JavaScriptCore+SVG.
2464
2465         Reviewed by mitz.
2466
2467         * JavaScriptCore.xcodeproj/project.pbxproj:
2468
2469 2005-10-11  Geoffrey Garen  <ggaren@apple.com>
2470
2471         Fixed build bustage from last checkin (stray characters
2472         in the project file).
2473
2474         Reviewed by mitz.
2475
2476         * JavaScriptCore.xcodeproj/project.pbxproj:
2477
2478 2005-10-11  Geoffrey Garen  <ggaren@apple.com>
2479
2480         New JavaScriptCore test results to reflect the last change.
2481
2482         * tests/mozilla/expected.html:
2483
2484 2005-10-10  Geoffrey Garen  <ggaren@apple.com>
2485
2486         - Implemented caching of match state inside the global RegExp object
2487           (lastParen, leftContext, rightContext, lastMatch, input).
2488
2489           exec(), test(), match(), search(), and replace() now dipatch regular
2490           expression matching through the RegExp object's performMatch function, 
2491           to facilitate caching. This replaces registerRegexp and 
2492           setSubPatterns.
2493         
2494         - Implemented the special '$' aliases (e.g. RegExp.input aliases to 
2495           RegExp.$_).
2496
2497         - Moved support for backreferences into the new static hash table
2498           used for other special RegExp properties. Truncated backreferences
2499           at $9 to match IE, FF, and the "What's New in Netscape 1.2?" doc.
2500           (String.replace still supports double-digit backreferences.)
2501
2502         - Tweaked RegExp.prototype.exec to handle ginormous values in lastIndex.
2503
2504         Fixes 11 -- count em, 11 -- JavaScriptCore tests.
2505
2506         * fast/js/regexp-caching-expected.txt: Added.
2507         * fast/js/regexp-caching.html: Added.
2508
2509         Reviewed by mjs.
2510
2511         * JavaScriptCore.xcodeproj/project.pbxproj: Added regexp_object.lut.h
2512         * kjs/create_hash_table: Tweaked to allow for more exotic characters.
2513                                  We now rely on the compiler to catch illegal
2514                                  identifiers.
2515         * kjs/regexp.cpp:
2516         (KJS::RegExp::RegExp):
2517         * kjs/regexp_object.cpp:
2518         (RegExpProtoFuncImp::callAsFunction):
2519         (RegExpObjectImp::RegExpObjectImp):
2520         (RegExpObjectImp::performMatch):
2521         (RegExpObjectImp::arrayOfMatches):
2522         (RegExpObjectImp::backrefGetter):
2523         (RegExpObjectImp::getLastMatch):
2524         (RegExpObjectImp::getLastParen):
2525         (RegExpObjectImp::getLeftContext):
2526         (RegExpObjectImp::getRightContext):
2527         (RegExpObjectImp::getOwnPropertySlot):
2528         (RegExpObjectImp::getValueProperty):
2529         (RegExpObjectImp::put):
2530         (RegExpObjectImp::putValueProperty):
2531         * kjs/regexp_object.h:
2532         (KJS::RegExpObjectImp::):
2533         * kjs/string_object.cpp:
2534         (substituteBackreferences):
2535         (replace):
2536         (StringProtoFuncImp::callAsFunction):
2537
2538 2005-10-09  Darin Adler  <darin@apple.com>
2539
2540         Reviewed by Maciej; some changes done after review.
2541
2542         - fixed <rdar://problem/4092064> hanging loading page; rte.ie (works in IE and Firefox)
2543         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5280
2544           Date.setMonth fails with negative values
2545         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5154
2546           JSC should switch to _r variants of unix time/date functions
2547         - fixed a few possible overflow cases
2548
2549         Retested all tests to be sure nothing broke; added layout test for bug 5280.
2550
2551         * kjs/config.h: Removed TIME_WITH_SYS_TIME define. Also set HAVE_SYS_TIMEB_H
2552         for the __APPLE__ case (the latter is accurate but irrelevant).
2553
2554         * kjs/date_object.h: Reformatted. Removed unnecessary include of "function_object.h".
2555         Moved declarations of helper classes and functions into the cpp file.
2556
2557         * kjs/date_object.cpp: Removed code at top to define macros to use CoreFoundation instead of
2558         POSIX date functions.
2559         (KJS::styleFromArgString): Tweaked to return early instead of using a variable.
2560         (KJS::formatLocaleDate): Tweaked to check for undefined rather than checking argument count.
2561         (KJS::formatDate): Made parameter const.
2562         (KJS::formatDateUTCVariant): Ditto.
2563         (KJS::formatTime): Ditto.
2564         (KJS::DateProtoFuncImp::callAsFunction): Use gmtime_r and localtime_r instead of gmtime and
2565         localtime.
2566         (KJS::DateObjectImp::callAsFunction): Use localtime_r instead of localtime.
2567         (KJS::ymdhmsToSeconds): Renamed from ymdhms_to_seconds. Changed computation to avoid possible
2568         overflow if year is an extremely large or small number.
2569         (KJS::makeTime): Removed code to move large month numbers from tm_mon to tm_year; this was
2570         to accomodate CFGregorianDate, which is no longer used (and didn't handle negative values).
2571         (KJS::parseDate): Renamed from KRFCDate_parseDate; changed to return a value in milliseconds
2572         rather than in seconds. Reformatted the code. Changed to use UTF8String() instead of ascii(),
2573         since ascii() is not thread safe. Changed some variables back from int to long to avoid
2574         trouble if the result of strtol does not fit in an int (64-bit issue only).
2575
2576 2005-10-08  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2577
2578         Reviewed by Geoff.
2579         Tweaked and landed by Darin.
2580
2581         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5266
2582           Support parenthesized comments in Date.parse()
2583
2584         * kjs/date_object.cpp:
2585         (KJS::skipSpacesAndComments): Take a pointer, and advance it past spaces,
2586         and also past anything enclosed in parentheses.
2587         (KJS::KRFCDate_parseDate): Use skipSpacesAndComments wherever we formerly had
2588         code to skip spaces.
2589
2590 2005-10-08  Justin Haygood  <justin@xiondigital.net>
2591
2592         Reviewed, tweaked, and landed by Darin.
2593
2594         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5189
2595           pcre_exec.c fails to compile using MSVC
2596         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5190
2597           KJS config.h adjustment for Win32
2598         
2599         * kjs/config.h: Make sure HAVE_MMAP and HAVE_SBRK are off for Win32.
2600         Turn HAVE_ERRNO_H on for Mac OS X. Sort defines so they are easy to compare
2601         with each other. Remove #undef of DEBUG_COLLECTOR.
2602         * pcre/pcre_exec.c: (match): Work around strange MSVC complaint by splitting
2603         the definition of a local variable into a separate declaration and
2604         initialization.
2605
2606 2005-10-05  Geoffrey Garen  <ggaren@apple.com>
2607  
2608         - Darin and I rewrote our implementation of the SimpleNumber class
2609           to store number bit patterns in their floating point formats.
2610  
2611         My tweaks reviewed by Darin.
2612         
2613         ~1% speedup on JS iBench.
2614         
2615         * kjs/internal.h: removed obsolete jsNumber declarations.
2616         * kjs/math_object.cpp:
2617         (MathFuncImp::callAsFunction): changed KJS::isNaN to isNaN
2618         * kjs/nodes.cpp:
2619         (PostfixResolveNode::evaluate): removed obsolete knownToBeInteger
2620         (PostfixBracketNode::evaluate): ditto
2621         (PostfixDotNode::evaluate): ditto
2622         (PrefixResolveNode::evaluate): ditto
2623         (PrefixBracketNode::evaluate): ditto
2624         (PrefixDotNode::evaluate): ditto
2625         (NegateNode::evaluate): ditto
2626         (valueForReadModifyAssignment): ditto
2627         * kjs/number_object.cpp: removed obsolete comment
2628         * kjs/operations.cpp:
2629         (KJS::equal): removed unnecessary isNaN checks
2630         (KJS::strictEqual): ditto
2631         (KJS::add): removed obsolete knownToBeInteger
2632         (KJS::mult): ditto
2633         * kjs/operations.h: removed include of "value.h" to prevent circular reference
2634         * kjs/simple_number.h: removed unnecessary #includes
2635         (KJS::SimpleNumber::make): see above
2636         (KJS::SimpleNumber::is): ditto
2637         (KJS::SimpleNumber::value): ditto
2638         * kjs/string_object.cpp:
2639         (StringProtoFuncImp::callAsFunction): changed KJS::isNaN to isNaN
2640         * kjs/ustring.cpp: removed unnecessary isNaN check
2641         (KJS::UString::toUInt32): ditto
2642         * kjs/value.cpp:
2643         (KJS::jsNumber): removed obsolete jsNumber definitions
2644         (KJS::ConstantValues::init): NaN is no longer a ConstantValue
2645         (KJS::ConstantValues::clear): ditto
2646         (KJS::ConstantValues::mark): ditto
2647         * kjs/value.h: removed obsolete knownToBeInteger
2648         (KJS::jsNaN): now returns a SimpleNumber
2649         (KJS::ValueImp::getUInt32): changed to account for NaN being a SimpleNumber
2650         (KJS::ValueImp::toBoolean): ditto
2651         (KJS::ValueImp::toString): changed to account for +/- 0.0
2652         (KJS::jsZero): changed to reflect that SimpleNumber::make takes a double
2653         (KJS::jsOne): ditto
2654         (KJS::jsTwo): ditto
2655         (KJS::Number): removed obsolete non-double constructor declarations
2656
2657 2005-10-05  Maciej Stachowiak  <mjs@apple.com>
2658
2659         Reviewed by Eric.
2660
2661         - fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
2662
2663         Also fixed some bugs with for..in enumeration while I was at it. object
2664         properties now come before prototype properties and duplicates
2665         between object and prototype are listed only once.
2666
2667         * JavaScriptCore.xcodeproj/project.pbxproj:
2668         * kjs/IdentifierSequencedSet.cpp: Added.
2669         (KJS::IdentifierSequencedSet::IdentifierSequencedSet):
2670         (KJS::IdentifierSequencedSet::deallocateVector):
2671         (KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
2672         (KJS::IdentifierSequencedSet::insert):
2673         * kjs/IdentifierSequencedSet.h: Added.
2674         (KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
2675         (KJS::IdentifierSequencedSetIterator::operator*):
2676         (KJS::IdentifierSequencedSetIterator::operator->):
2677         (KJS::IdentifierSequencedSetIterator::operator++):
2678         (KJS::IdentifierSequencedSetIterator::operator==):
2679         (KJS::IdentifierSequencedSetIterator::operator!=):
2680         (KJS::IdentifierSequencedSet::begin):
2681         (KJS::IdentifierSequencedSet::end):
2682         (KJS::IdentifierSequencedSet::size):
2683         * kjs/array_instance.h:
2684         * kjs/array_object.cpp:
2685         (ArrayInstanceImp::getPropertyNames):
2686         (ArrayInstanceImp::setLength):
2687         (ArrayInstanceImp::pushUndefinedObjectsToEnd):
2688         * kjs/nodes.cpp:
2689         (ForInNode::execute):
2690         * kjs/nodes.h:
2691         * kjs/object.cpp:
2692         (KJS::ObjectImp::getPropertyNames):
2693         * kjs/object.h:
2694         * kjs/property_map.cpp:
2695         (KJS::PropertyMap::getEnumerablePropertyNames):
2696         (KJS::PropertyMap::getSparseArrayPropertyNames):
2697         * kjs/property_map.h:
2698         * kjs/protect.h:
2699         * kjs/protected_reference.h: Removed.
2700         * kjs/reference.cpp: Removed.
2701         * kjs/reference.h: Removed.
2702         * kjs/reference_list.cpp: Removed.
2703         * kjs/reference_list.h: Removed.
2704         * kjs/ustring.h:
2705         (KJS::UString::impl):
2706         * kxmlcore/HashSet.h:
2707
2708 2005-10-04  Eric Seidel  <eseidel@apple.com>
2709
2710         Reviewed by mjs.
2711
2712         Code cleanup, which resulted in a small win on iBench.
2713
2714         * kjs/object.cpp:
2715         (KJS::tryGetAndCallProperty): new static inline
2716         (KJS::ObjectImp::defaultValue): code cleanup
2717
2718 2005-10-03  Maciej Stachowiak  <mjs@apple.com>
2719
2720         Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
2721
2722         - more Linux build fixes
2723         
2724         * kjs/operations.cpp:
2725         * kxmlcore/FastMalloc.h:
2726         * kxmlcore/TCSystemAlloc.cpp:
2727         (TCMalloc_SystemAlloc):
2728
2729 2005-10-03  Maciej Stachowiak  <mjs@apple.com>
2730
2731         Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
2732
2733         http://bugzilla.opendarwin.org/show_bug.cgi?id=5174
2734         Add support for compiling on Linux (likely to help for other POSIX systems too)
2735
2736         * kjs/collector.cpp:
2737         (KJS::Collector::markCurrentThreadConservatively):
2738         (KJS::Collector::markOtherThreadConservatively):
2739         * kjs/config.h:
2740         * kjs/date_object.cpp:
2741         (KJS::formatDate):
2742         (KJS::formatDateUTCVariant):
2743         (KJS::formatTime):
2744         (KJS::timeZoneOffset):
2745         (KJS::DateProtoFuncImp::callAsFunction):
2746         (KJS::DateObjectImp::construct):
2747         (KJS::DateObjectImp::callAsFunction):
2748         (KJS::makeTime):
2749         * kjs/identifier.cpp:
2750         * kjs/internal.cpp:
2751         (KJS::initializeInterpreterLock):
2752         (KJS::lockInterpreter):
2753         (KJS::unlockInterpreter):
2754         (KJS::UndefinedImp::toPrimitive):
2755         (KJS::UndefinedImp::toBoolean):
2756         (KJS::UndefinedImp::toNumber):
2757         (KJS::UndefinedImp::toString):
2758         (KJS::NullImp::toPrimitive):
2759         (KJS::NullImp::toBoolean):
2760         (KJS::NullImp::toNumber):
2761         (KJS::NullImp::toString):
2762         (KJS::BooleanImp::toPrimitive):
2763         (KJS::BooleanImp::toBoolean):
2764         (KJS::BooleanImp::toNumber):
2765         (KJS::BooleanImp::toString):
2766         (KJS::StringImp::toPrimitive):
2767         (KJS::StringImp::toBoolean):
2768         (KJS::StringImp::toNumber):
2769         (KJS::StringImp::toString):
2770         * kjs/internal.h:
2771         * kjs/protected_values.cpp:
2772
2773 2005-10-03  Maciej Stachowiak  <mjs@apple.com>
2774
2775         - fix Development build after last checkin
2776
2777         * kxmlcore/FastMalloc.cpp:
2778         (KXMLCore::fastMallocRegisterThread):
2779
2780 2005-10-02  Maciej Stachowiak  <mjs@apple.com>
2781
2782         Reviewed by Darin.
2783
2784         <rdar://problem/4283967> REGRESSION: 3% regression on PLT from new FastMalloc
2785         http://bugzilla.opendarwin.org/show_bug.cgi?id=5243
2786         
2787         A number of optimizations to the new threadsafe malloc that make it actually as fast
2788         as dlmalloc (I measured wrong before) and as memory-efficient as the system malloc.
2789
2790         - use fastMalloc for everything - it now gets applied to all new/delete allocations
2791         via a private inline operator new that is now included into every file via config.h.
2792
2793         - tweaked some of the numeric parameters for size classes and amount of wasted memory
2794         allowed per allocation - this saves on memory use and consequently improves speed.
2795
2796         - so long as the allocator is not being used on background threads, get the per-thread
2797         cache from a global variable instead of from pthread_getspecific, since the latter is slow.
2798
2799         - inline more functions, and force the ones GCC refuses to inline with 
2800         attribute(always_inline), nearly all of these have one call site so inlining them has 
2801         to be a win.
2802
2803         - use some tricks to calculate allocation size more efficiently and fewer times for small
2804         allocations, to avoid hitting the huge size table array.
2805
2806         - avoid hitting the per-thread cache on code paths that don't need it.
2807
2808         - implement inline assembly version of spinlock for PowerPC (was already done for x86)
2809
2810         * bindings/NP_jsobject.cpp:
2811         * bindings/c/c_class.cpp:
2812         * bindings/c/c_instance.cpp:
2813         * bindings/c/c_runtime.cpp:
2814         * bindings/c/c_utility.cpp:
2815         * bindings/jni/jni_class.cpp:
2816         * bindings/jni/jni_instance.cpp:
2817         * bindings/jni/jni_jsobject.cpp:
2818         * bindings/jni/jni_objc.mm:
2819         * bindings/jni/jni_runtime.cpp:
2820         * bindings/jni/jni_utility.cpp:
2821         * bindings/npruntime.cpp:
2822         * bindings/objc/WebScriptObject.mm:
2823         * bindings/objc/objc_class.mm:
2824         * bindings/objc/objc_instance.mm:
2825         * bindings/objc/objc_runtime.mm:
2826         * bindings/objc/objc_utility.mm:
2827         * bindings/runtime.cpp:
2828         * bindings/runtime_array.cpp:
2829         * bindings/runtime_method.cpp:
2830         * bindings/runtime_object.cpp:
2831         * bindings/runtime_root.cpp:
2832         * bindings/testbindings.cpp:
2833         * bindings/testbindings.mm:
2834         * kjs/array_object.cpp:
2835         (ArrayInstanceImp::ArrayInstanceImp):
2836         (ArrayInstanceImp::~ArrayInstanceImp):
2837         (ArrayInstanceImp::resizeStorage):
2838         * kjs/bool_object.cpp:
2839         * kjs/collector.cpp:
2840         (KJS::Collector::registerThread):
2841         * kjs/config.h:
2842         * kjs/debugger.cpp:
2843         * kjs/error_object.cpp:
2844         * kjs/function.cpp:
2845         * kjs/function_object.cpp:
2846         * kjs/identifier.cpp:
2847         (KJS::Identifier::rehash):
2848         * kjs/internal.cpp:
2849         (KJS::Parser::saveNewNode):
2850         (KJS::clearNewNodes):
2851         * kjs/interpreter.cpp:
2852         * kjs/lexer.cpp:
2853         (Lexer::doneParsing):
2854         (Lexer::makeIdentifier):
2855         (Lexer::makeUString):
2856         * kjs/list.cpp:
2857         * kjs/math_object.cpp:
2858         * kjs/nodes.cpp:
2859         * kjs/nodes.h:
2860         * kjs/nodes2string.cpp:
2861         * kjs/number_object.cpp:
2862         (integer_part_noexp):
2863         (char_sequence):
2864         * kjs/object.cpp:
2865         * kjs/object_object.cpp:
2866         * kjs/property_map.cpp:
2867         * kjs/property_slot.cpp:
2868         * kjs/protected_values.cpp:
2869         (KJS::ProtectedValues::rehash):
2870         * kjs/reference.cpp:
2871         * kjs/reference_list.cpp:
2872         * kjs/regexp.cpp:
2873         * kjs/regexp_object.cpp:
2874         * kjs/scope_chain.cpp:
2875         * kjs/scope_chain.h:
2876         * kjs/string_object.cpp:
2877         * kjs/testkjs.cpp:
2878         * kjs/ustring.h:
2879         * kjs/value.cpp:
2880         * kxmlcore/Assertions.mm:
2881         * kxmlcore/FastMalloc.cpp:
2882         (KXMLCore::InitSizeClasses):
2883         (KXMLCore::DLL_IsEmpty):
2884         (KXMLCore::DLL_Prepend):
2885         (KXMLCore::TCMalloc_Central_FreeList::Insert):
2886         (KXMLCore::TCMalloc_Central_FreeList::Remove):
2887         (KXMLCore::TCMalloc_Central_FreeList::Populate):
2888         (KXMLCore::TCMalloc_ThreadCache::Allocate):
2889         (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
2890         (KXMLCore::fastMallocRegisterThread):
2891         (KXMLCore::TCMalloc_ThreadCache::GetCache):
2892         (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
2893         (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2894         (KXMLCore::do_malloc):
2895         (KXMLCore::do_free):
2896         (KXMLCore::realloc):
2897         * kxmlcore/FastMalloc.h:
2898         (operator new):
2899         (operator delete):
2900         (operator new[]):
2901         (operator delete[]):
2902         * kxmlcore/HashTable.cpp:
2903         * kxmlcore/TCSpinLock.h:
2904         (TCMalloc_SpinLock::Lock):
2905         (TCMalloc_SpinLock::Unlock):
2906         (TCMalloc_SlowLock):
2907         * kxmlcore/TCSystemAlloc.cpp:
2908
2909 2005-09-30  Geoffrey Garen  <ggaren@apple.com>
2910
2911         - Second cut at fixing <rdar://problem/4275206> Denver Regression: Seed: 
2912           Past Editions of Opinions display "NAN/Undefined" for www.washingtonpost.com
2913                 
2914         Reviewed by john.
2915
2916         * kjs/date_object.cpp:
2917         (KJS::KRFCDate_parseDate): Intead of creating a timezone when one isn't specified,
2918         just rely on the fallback logic, which will do it for you. Also, return invalidDate
2919         if the date includes trailing garbage. (Somewhat accidentally, the timezone logic
2920         used to catch trailing garbage.)
2921
2922         Added test case to fast/js/date-parse-test.html.
2923
2924 2005-09-29  Eric Seidel  <eseidel@apple.com>
2925         Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
2926
2927         Reviewed by darin.
2928
2929         Fix JSC memory smasher in TOT.
2930         http://bugzilla.opendarwin.org/show_bug.cgi?id=5176
2931
2932         * pcre/pcre_exec.c:
2933         (match):
2934
2935 2005-09-29  Eric Seidel  <eseidel@apple.com>
2936         Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
2937
2938         Reviewed by mjs.
2939
2940         * JavaScriptCore.xcodeproj/project.pbxproj:
2941         Build fix for JSC+SVG after 5161.
2942         http://bugzilla.opendarwin.org/show_bug.cgi?id=5179
2943
2944 2005-09-28  Geoffrey Garen  <ggaren@apple.com>
2945
2946         - Fixed <rdar://problem/4275206> Denver Regression: Seed: Past Editions of Opinions display 
2947           "NAN/Undefined" for www.washingtonpost.com
2948           
2949         Reviewed by darin.
2950
2951         * kjs/date_object.cpp:
2952         (KJS::KRFCDate_parseDate): If the timezone isn't specified, rather than returning
2953         invalidDate, substitute the local timezone. This matches the behavior of FF/IE.
2954
2955 2005-09-28  Maciej Stachowiak  <mjs@apple.com>
2956
2957         Patch from George Staikos, reviewed by me.
2958
2959         - fixed some compile issues on Linux
2960         
2961         * kjs/property_slot.h:
2962         * kjs/simple_number.h:
2963
2964 2005-09-27  Maciej Stachowiak  <mjs@apple.com>
2965
2966         Reviewed by Eric.
2967
2968         - move HashMap/HashSet code down to JavaScriptCore
2969         http://bugzilla.opendarwin.org/show_bug.cgi?id=5161
2970         
2971         * JavaScriptCore.xcodeproj/project.pbxproj:
2972         * kjs/internal.cpp:
2973         (KJS::interpreterMap): Function that fetches the interpreter map on demand. 
2974         (KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
2975         class with an appropriate HashMap.
2976         (KJS::InterpreterImp::clear): ditto
2977         (KJS::InterpreterImp::interpreterWithGlobalObject): ditto
2978         * kjs/interpreter_map.cpp: Removed.
2979         * kjs/interpreter_map.h: Removed.
2980
2981         The HashMap/HashSet code (copied and slightly tweaked from WebCore)
2982         
2983         * kxmlcore/HashFunctions.h: Added.
2984         (KXMLCore::4):
2985         (KXMLCore::8):
2986         (KXMLCore::):
2987         (KXMLCore::PointerHash::hash):
2988         (KXMLCore::PointerHash::equal):
2989         * kxmlcore/HashMap.h: Added.
2990         (KXMLCore::extractFirst):
2991         (KXMLCore::HashMap::HashMap):
2992         (KXMLCore::::size):
2993         (KXMLCore::::capacity):
2994         (KXMLCore::::isEmpty):
2995         (KXMLCore::::begin):
2996         (KXMLCore::::end):
2997         (KXMLCore::::find):
2998         (KXMLCore::::contains):
2999         (KXMLCore::::set):
3000         (KXMLCore::::get):
3001         (KXMLCore::::remove):
3002         (KXMLCore::::clear):
3003         (KXMLCore::deleteAllValues):
3004         * kxmlcore/HashMapPtrSpec.h: Added.
3005         (KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
3006         (KXMLCore::PointerHashIteratorAdapter::operator*):
3007         (KXMLCore::PointerHashIteratorAdapter::operator->):
3008         (KXMLCore::PointerHashIteratorAdapter::operator++):
3009         (KXMLCore::PointerHashIteratorAdapter::operator==):
3010         (KXMLCore::PointerHashIteratorAdapter::operator!=):
3011         (KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
3012         (KXMLCore::PointerHashConstIteratorAdapter::operator*):
3013         (KXMLCore::PointerHashConstIteratorAdapter::operator->):
3014         (KXMLCore::PointerHashConstIteratorAdapter::operator++):
3015         (KXMLCore::PointerHashConstIteratorAdapter::operator==):
3016         (KXMLCore::PointerHashConstIteratorAdapter::operator!=):
3017         (KXMLCore::):
3018         * kxmlcore/HashSet.h: Added.
3019         (KXMLCore::identityExtract):
3020         (KXMLCore::convertAdapter):
3021         (KXMLCore::HashSet::HashSet):
3022         (KXMLCore::::size):
3023         (KXMLCore::::capacity):
3024         (KXMLCore::::isEmpty):
3025         (KXMLCore::::begin):
3026         (KXMLCore::::end):
3027         (KXMLCore::::find):
3028         (KXMLCore::::contains):
3029         (KXMLCore::::insert):
3030         (KXMLCore::::remove):
3031         (KXMLCore::::clear):
3032         * kxmlcore/HashTable.cpp: Added.
3033         (KXMLCore::HashTableStats::~HashTableStats):
3034         (KXMLCore::HashTableStats::recordCollisionAtCount):
3035         * kxmlcore/HashTable.h: Added.
3036         (KXMLCore::HashTableIterator::skipEmptyBuckets):
3037         (KXMLCore::HashTableIterator::HashTableIterator):
3038         (KXMLCore::HashTableIterator::operator*):
3039         (KXMLCore::HashTableIterator::operator->):
3040         (KXMLCore::HashTableIterator::operator++):
3041         (KXMLCore::HashTableIterator::operator==):
3042         (KXMLCore::HashTableIterator::operator!=):
3043         (KXMLCore::HashTableConstIterator::HashTableConstIterator):
3044         (KXMLCore::HashTableConstIterator::operator*):
3045         (KXMLCore::HashTableConstIterator::operator->):
3046         (KXMLCore::HashTableConstIterator::skipEmptyBuckets):
3047         (KXMLCore::HashTableConstIterator::operator++):
3048         (KXMLCore::HashTableConstIterator::operator==):
3049         (KXMLCore::HashTableConstIterator::operator!=):
3050         (KXMLCore::HashTable::HashTable):
3051         (KXMLCore::HashTable::~HashTable):
3052         (KXMLCore::HashTable::begin):
3053         (KXMLCore::HashTable::end):
3054         (KXMLCore::HashTable::size):
3055         (KXMLCore::HashTable::capacity):
3056         (KXMLCore::HashTable::insert):
3057         (KXMLCore::HashTable::isEmptyBucket):
3058         (KXMLCore::HashTable::isDeletedBucket):
3059         (KXMLCore::HashTable::isEmptyOrDeletedBucket):
3060         (KXMLCore::HashTable::hash):
3061         (KXMLCore::HashTable::equal):
3062         (KXMLCore::HashTable::identityConvert):
3063         (KXMLCore::HashTable::extractKey):
3064         (KXMLCore::HashTable::lookup):
3065         (KXMLCore::HashTable::shouldExpand):
3066         (KXMLCore::HashTable::mustRehashInPlace):
3067         (KXMLCore::HashTable::shouldShrink):
3068         (KXMLCore::HashTable::shrink):
3069         (KXMLCore::HashTable::clearBucket):
3070         (KXMLCore::HashTable::deleteBucket):
3071         (KXMLCore::HashTable::makeLookupResult):
3072         (KXMLCore::HashTable::makeIterator):
3073         (KXMLCore::HashTable::makeConstIterator):
3074         (KXMLCore::::lookup):
3075         (KXMLCore::::insert):
3076         (KXMLCore::::reinsert):
3077         (KXMLCore::::find):
3078         (KXMLCore::::contains):
3079         (KXMLCore::::remove):
3080         (KXMLCore::::allocateTable):
3081         (KXMLCore::::expand):
3082         (KXMLCore::::rehash):
3083         (KXMLCore::::clear):
3084         (KXMLCore::::HashTable):
3085         (KXMLCore::::swap):
3086         (KXMLCore::::operator):
3087         (KXMLCore::::checkTableConsistency):
3088         (KXMLCore::::checkTableConsistencyExceptSize):
3089         * kxmlcore/HashTraits.h: Added.
3090         (KXMLCore::HashTraits::emptyValue):
3091         (KXMLCore::):
3092         (KXMLCore::PairHashTraits::emptyValue):
3093         (KXMLCore::PairHashTraits::deletedValue):
3094
3095 2005-09-27  Darin Adler  <darin@apple.com>
3096
3097         Reviewed by Maciej.
3098
3099         - update grammar to fix conflicts; fixes one of our test cases
3100           because it resolves the relationship between function expressions
3101           and declarations in the way required by the ECMA specification
3102
3103         * kjs/grammar.y: Added lots of new grammar rules so we have no conflicts.
3104         A new set of rules for "no bracket or function at start of expression" and
3105         another set of rules for "no in anywhere in expression". Also simplified the
3106         handling of try to use only a single node and used operator precedence to
3107         get rid of the conflict in handling of if and else. Also used a macro to
3108         streamline the handling of automatic semicolons and changed parenthesis
3109         handling to use a virtual function.
3110
3111         * kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement.
3112         (KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead
3113         of using a special node for each.
3114         * kjs/nodes.cpp:
3115         (Node::createErrorCompletion): Added. Used instead of throwError when creating errors
3116         that should not be in a completion rather than an ExecState.
3117         (Node::throwUndefinedVariableError): Added. Sets source location unlike the call it
3118         replaces.
3119         (Node::nodeInsideAllParens): Added.
3120         (GroupNode::nodeInsideAllParens): Added.
3121         (StatListNode::execute): Removed code to move exceptions into completion objects;
3122         that's now done solely by the KJS_CHECKEXCEPTION macro.
3123         (TryNode::execute): Include execution of catch and finally here rather than using
3124         separate nodes.
3125         (FuncDeclNode::execute): Moved here, no longer inline.
3126         * kjs/nodes2string.cpp:
3127         (TryNode::streamTo): Updated for change.
3128         (FuncDeclNode::streamTo): Ditto.
3129         (FuncExprNode::streamTo): Ditto.
3130
3131         * kjs/kjs-test: Removed. Was part of "make check".
3132         * kjs/kjs-test.chk: Ditto.
3133         * kjs/test.js: Ditto.
3134
3135         * tests/mozilla/expected.html: Updated because one more test succeeds.
3136
3137 2005-09-27  Adele Peterson  <adele@apple.com>
3138
3139         Reviewed by Maciej.
3140
3141         Changed ints to size_t where appropriate.
3142
3143         * kjs/collector.cpp:
3144         (KJS::Collector::allocate):
3145         (KJS::Collector::markStackObjectsConservatively):
3146         (KJS::Collector::collect):
3147         (KJS::Collector::size):
3148         (KJS::Collector::numInterpreters):
3149         (KJS::Collector::numGCNotAllowedObjects):
3150         (KJS::Collector::numReferencedObjects):
3151         * kjs/collector.h:
3152
3153 2005-09-27  Eric Seidel  <eseidel@apple.com>
3154
3155         Reviewed by kevin.
3156
3157         * JavaScriptCore.xcodeproj/project.pbxproj: fix after malloc changes.
3158
3159 2005-09-27  Eric Seidel  <eseidel@apple.com>
3160
3161         Reviewed by mjs.
3162
3163         * kjs/nodes.cpp:
3164         (FuncExprNode::evaluate): Now sets .constructor properly.
3165         Test cases added to WebCore/layout-tests.
3166         http://bugzilla.opendarwin.org/show_bug.cgi?id=3537
3167
3168 2005-09-26  Maciej Stachowiak  <mjs@apple.com>
3169
3170         Reviewed by John.
3171
3172         - replace dlmalloc with tcmalloc
3173         http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
3174
3175         I also moved SharedPtr and the assertion code from WebCore into a
3176         new kxmlcore directory.
3177         
3178         * JavaScriptCore.xcodeproj/project.pbxproj:
3179         * kjs/collector.cpp:
3180         (KJS::Collector::allocate):
3181         (KJS::Collector::collect):
3182         * kjs/config.h:
3183         * kjs/fast_malloc.cpp: Removed.
3184         * kjs/fast_malloc.h: Removed.
3185         * kjs/function.cpp:
3186         * kjs/function.h:
3187         * kjs/function_object.cpp:
3188         * kjs/identifier.cpp:
3189         (KJS::Identifier::add):
3190         * kjs/internal.cpp:
3191         * kjs/internal.h:
3192         * kjs/nodes.h:
3193         * kjs/nodes2string.cpp:
3194         * kjs/property_map.cpp:
3195         (KJS::PropertyMap::~PropertyMap):
3196         (KJS::PropertyMap::rehash):
3197         * kjs/scope_chain.h:
3198         * kjs/shared_ptr.h: Removed.
3199         * kjs/string_object.cpp:
3200         (StringObjectFuncImp::callAsFunction):
3201         * kjs/ustring.cpp:
3202         (KJS::UString::Rep::createCopying):
3203         (KJS::UString::Rep::destroy):
3204         (KJS::UString::expandCapacity):
3205         (KJS::UString::expandPreCapacity):
3206         (KJS::UString::UString):
3207         (KJS::UString::spliceSubstringsWithSeparators):
3208         (KJS::UString::append):
3209         (KJS::UString::operator=):
3210         (KJS::UString::detach):
3211         * kjs/ustring.h:
3212         * kxmlcore/Assertions.h: Added.
3213         * kxmlcore/Assertions.mm: Added.
3214         * kxmlcore/FastMalloc.cpp: Added.
3215         (KXMLCore::LgFloor):
3216         (KXMLCore::SizeClass):
3217         (KXMLCore::ByteSizeForClass):
3218         (KXMLCore::InitSizeClasses):
3219         (KXMLCore::MetaDataAlloc):
3220         (KXMLCore::PageHeapAllocator::Init):
3221         (KXMLCore::PageHeapAllocator::New):
3222         (KXMLCore::PageHeapAllocator::Delete):
3223         (KXMLCore::PageHeapAllocator::inuse):
3224         (KXMLCore::pages):
3225         (KXMLCore::AllocationSize):
3226         (KXMLCore::Event):
3227         (KXMLCore::NewSpan):
3228         (KXMLCore::DeleteSpan):
3229         (KXMLCore::DLL_Init):
3230         (KXMLCore::DLL_Remove):
3231         (KXMLCore::DLL_IsEmpty):
3232         (KXMLCore::DLL_Length):
3233         (KXMLCore::DLL_Print):
3234         (KXMLCore::DLL_Prepend):
3235         (KXMLCore::DLL_InsertOrdered):
3236         (KXMLCore::):
3237         (KXMLCore::TCMalloc_PageHeap::GetDescriptor):
3238         (KXMLCore::TCMalloc_PageHeap::SystemBytes):
3239         (KXMLCore::TCMalloc_PageHeap::FreeBytes):
3240         (KXMLCore::TCMalloc_PageHeap::RecordSpan):
3241         (KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
3242         (KXMLCore::TCMalloc_PageHeap::New):
3243         (KXMLCore::TCMalloc_PageHeap::Split):
3244         (KXMLCore::TCMalloc_PageHeap::Carve):
3245         (KXMLCore::TCMalloc_PageHeap::Delete):
3246         (KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
3247         (KXMLCore::TCMalloc_PageHeap::Dump):
3248         (KXMLCore::TCMalloc_PageHeap::GrowHeap):
3249         (KXMLCore::TCMalloc_PageHeap::Check):
3250         (KXMLCore::TCMalloc_PageHeap::CheckList):
3251         (KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
3252         (KXMLCore::TCMalloc_ThreadCache_FreeList::length):
3253         (KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
3254         (KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
3255         (KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
3256         (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
3257         (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
3258         (KXMLCore::TCMalloc_ThreadCache::freelist_length):
3259         (KXMLCore::TCMalloc_ThreadCache::Size):
3260         (KXMLCore::TCMalloc_Central_FreeList::length):
3261         (KXMLCore::TCMalloc_Central_FreeList::Init):
3262         (KXMLCore::TCMalloc_Central_FreeList::Insert):
3263         (KXMLCore::TCMalloc_Central_FreeList::Remove):
3264         (KXMLCore::TCMalloc_Central_FreeList::Populate):
3265         (KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
3266         (KXMLCore::TCMalloc_ThreadCache::Init):
3267         (KXMLCore::TCMalloc_ThreadCache::Cleanup):
3268         (KXMLCore::TCMalloc_ThreadCache::Allocate):
3269         (KXMLCore::TCMalloc_ThreadCache::Deallocate):
3270         (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
3271         (KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
3272         (KXMLCore::TCMalloc_ThreadCache::Scavenge):
3273         (KXMLCore::TCMalloc_ThreadCache::GetCache):
3274         (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
3275         (KXMLCore::TCMalloc_ThreadCache::PickNextSample):
3276         (KXMLCore::TCMalloc_ThreadCache::InitModule):
3277         (KXMLCore::TCMalloc_ThreadCache::InitTSD):
3278         (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3279         (KXMLCore::TCMalloc_ThreadCache::DeleteCache):
3280         (KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
3281         (KXMLCore::TCMalloc_ThreadCache::Print):
3282         (KXMLCore::ExtractStats):
3283         (KXMLCore::DumpStats):
3284         (KXMLCore::PrintStats):
3285         (KXMLCore::DumpStackTraces):
3286         (KXMLCore::TCMallocImplementation::GetStats):
3287         (KXMLCore::TCMallocImplementation::ReadStackTraces):
3288         (KXMLCore::TCMallocImplementation::GetNumericProperty):
3289         (KXMLCore::TCMallocImplementation::SetNumericProperty):
3290         (KXMLCore::DoSampledAllocation):
3291         (KXMLCore::do_malloc):
3292         (KXMLCore::do_free):
3293         (KXMLCore::do_memalign):
3294         (KXMLCore::TCMallocGuard::TCMallocGuard):
3295         (KXMLCore::TCMallocGuard::~TCMallocGuard):
3296         (KXMLCore::malloc):
3297         (KXMLCore::free):
3298         (KXMLCore::calloc):
3299         (KXMLCore::cfree):
3300         (KXMLCore::realloc):
3301         (KXMLCore::memalign):
3302         (KXMLCore::posix_memalign):
3303         (KXMLCore::valloc):
3304         (KXMLCore::pvalloc):
3305         (KXMLCore::malloc_stats):
3306         (KXMLCore::mallopt):
3307         (KXMLCore::mallinfo):
3308         * kxmlcore/FastMalloc.h: Added.
3309         (KXMLCore::FastAllocated::operator new):
3310         (KXMLCore::FastAllocated::operator delete):
3311         (KXMLCore::FastAllocated::operator new[]):
3312         (KXMLCore::FastAllocated::operator delete[]):
3313         * kxmlcore/SharedPtr.h: Added.
3314         (KXMLCore::SharedPtr::SharedPtr):
3315         (KXMLCore::SharedPtr::~SharedPtr):
3316         (KXMLCore::SharedPtr::isNull):
3317         (KXMLCore::SharedPtr::notNull):
3318         (KXMLCore::SharedPtr::reset):
3319         (KXMLCore::SharedPtr::get):
3320         (KXMLCore::SharedPtr::operator*):
3321         (KXMLCore::SharedPtr::operator->):
3322         (KXMLCore::SharedPtr::operator!):
3323         (KXMLCore::SharedPtr::operator bool):
3324         (KXMLCore::::operator):
3325         (KXMLCore::operator==):
3326         (KXMLCore::operator!=):
3327         (KXMLCore::static_pointer_cast):
3328         (KXMLCore::const_pointer_cast):
3329         * kxmlcore/TCPageMap.h: Added.
3330         (TCMalloc_PageMap1::TCMalloc_PageMap1):
3331         (TCMalloc_PageMap1::Ensure):
3332         (TCMalloc_PageMap1::get):
3333         (TCMalloc_PageMap1::set):
3334         (TCMalloc_PageMap2::TCMalloc_PageMap2):
3335         (TCMalloc_PageMap2::get):
3336         (TCMalloc_PageMap2::set):
3337         (TCMalloc_PageMap2::Ensure):
3338         (TCMalloc_PageMap3::NewNode):
3339         (TCMalloc_PageMap3::TCMalloc_PageMap3):
3340         (TCMalloc_PageMap3::get):
3341         (TCMalloc_PageMap3::set):
3342         (TCMalloc_PageMap3::Ensure):
3343         * kxmlcore/TCSpinLock.h: Added.
3344         (TCMalloc_SpinLock::Init):
3345         (TCMalloc_SpinLock::Finalize):
3346         (TCMalloc_SpinLock::Lock):
3347         (TCMalloc_SpinLock::Unlock):
3348         (TCMalloc_SlowLock):
3349         (TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
3350         (TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
3351         * kxmlcore/TCSystemAlloc.cpp: Added.
3352         (TrySbrk):
3353         (TryMmap):
3354         (TryDevMem):
3355         (TCMalloc_SystemAlloc):
3356         * kxmlcore/TCSystemAlloc.h: Added.
3357
3358 2005-09-23  Maciej Stachowiak  <mjs@apple.com>
3359
3360         Reviewed by Darin.
3361
3362         <rdar://problem/4260479> Finish deploying PropertySlot in the interpreter
3363         http://bugzilla.opendarwin.org/show_bug.cgi?id=5112
3364         
3365         Convert postfix, prefix, delete, prefix, and for..in expressions to use
3366         PropertySlot-based lookup instead of evaluateReference.
3367
3368         3% speedup on JS iBench.
3369
3370         Fixed two of the JS tests:
3371         * tests/mozilla/expected.html:
3372
3373         * kjs/grammar.y:
3374         * kjs/nodes.cpp:
3375         (PostfixResolveNode::evaluate):
3376         (PostfixBracketNode::evaluate):
3377         (PostfixDotNode::evaluate):
3378         (DeleteResolveNode::evaluate):
3379         (DeleteBracketNode::evaluate):
3380         (DeleteDotNode::evaluate):
3381         (DeleteValueNode::evaluate):
3382         (typeStringForValue):
3383         (TypeOfResolveNode::evaluate):
3384         (TypeOfValueNode::evaluate):
3385         (PrefixResolveNode::evaluate):
3386         (PrefixBracketNode::evaluate):
3387         (PrefixDotNode::evaluate):
3388         (ForInNode::execute):
3389         * kjs/nodes.h:
3390         (KJS::PostfixResolveNode::PostfixResolveNode):
3391         (KJS::PostfixBracketNode::PostfixBracketNode):
3392         (KJS::PostfixDotNode::PostfixDotNode):
3393         (KJS::DeleteResolveNode::DeleteResolveNode):
3394         (KJS::DeleteBracketNode::DeleteBracketNode):
3395         (KJS::DeleteDotNode::DeleteDotNode):
3396         (KJS::DeleteValueNode::DeleteValueNode):
3397         (KJS::TypeOfResolveNode::TypeOfResolveNode):
3398         (KJS::TypeOfValueNode::TypeOfValueNode):
3399         (KJS::PrefixResolveNode::PrefixResolveNode):
3400         (KJS::PrefixBracketNode::PrefixBracketNode):
3401         (KJS::PrefixDotNode::PrefixDotNode):
3402         * kjs/nodes2string.cpp:
3403         (PostfixResolveNode::streamTo):
3404         (PostfixBracketNode::streamTo):
3405         (PostfixDotNode::streamTo):
3406         (DeleteResolveNode::streamTo):
3407         (DeleteBracketNode::streamTo):
3408         (DeleteDotNode::streamTo):
3409         (DeleteValueNode::streamTo):
3410         (TypeOfValueNode::streamTo):
3411         (TypeOfResolveNode::streamTo):
3412         (PrefixResolveNode::streamTo):
3413         (PrefixBracketNode::streamTo):
3414         (PrefixDotNode::streamTo):
3415         * kjs/reference.cpp:
3416         (KJS::Reference::Reference):
3417         (KJS::Reference::getPropertyName):
3418         (KJS::Reference::getValue):
3419         (KJS::Reference::deleteValue):
3420         * kjs/reference.h:
3421
3422 2005-09-23  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3423
3424         Reviewed and landed by Darin.
3425
3426         - a Windows-specific file
3427
3428         * os-win32/stdint.h: Added. We plan to remove dependency on the <stdint.h> types,
3429         and if we do so, we will remove this file.
3430
3431 2005-09-22  Geoffrey Garen  <ggaren@apple.com>
3432
3433         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
3434         Need to restore int/long changes to simple_number.h
3435         
3436         Reviewed by darin and mjs.
3437
3438         * kjs/simple_number.h: changed enums to indenpendent constants to clarify types
3439         (KJS::isNegativeZero): changed to static function - no reason to export
3440         (KJS::SimpleNumber::rightShiftSignExtended): new function for clarity
3441         (KJS::SimpleNumber::make): specified cast as reinterpret_cast
3442         (KJS::SimpleNumber::is): changed to use uintptr_t for portability
3443         (KJS::SimpleNumber::value): changed to use uintptr_t and rightShiftSignExtended
3444         (KJS::SimpleNumber::fits): inverted tests - probably only a performance win for double
3445         (KJS::SimpleNumber::integerFits): ditto
3446
3447 2005-09-20  Maciej Stachowiak  <mjs@apple.com>
3448
3449         Reviewed by Geoff and partly by Darin.
3450
3451         - fixed http://bugzilla.opendarwin.org/post_bug.cgi
3452         (Reduce conflicts in JavaScriptCore grammar)
3453
3454         This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
3455         9 shift/reduce and 45 reduce/reduce.
3456
3457         * kjs/grammar.y:
3458         * kjs/grammar_types.h: Removed.
3459         * kjs/lexer.cpp:
3460         * kjs/nodes.h:
3461         (KJS::Node::isGroupNode):
3462         (KJS::Node::isLocation):
3463         (KJS::Node::isResolveNode):
3464         (KJS::Node::isBracketAccessorNode):
3465         (KJS::Node::isDotAccessorNode):
3466         (KJS::ResolveNode::isLocation):
3467         (KJS::ResolveNode::isResolveNode):
3468         (KJS::ResolveNode::identifier):
3469         (KJS::GroupNode::isGroupNode):
3470         (KJS::GroupNode::leafNode):
3471         (KJS::BracketAccessorNode::isLocation):
3472         (KJS::BracketAccessorNode::isBracketAccessorNode):
3473         (KJS::BracketAccessorNode::base):
3474         (KJS::BracketAccessorNode::subscript):
3475         (KJS::DotAccessorNode::isLocation):
3476         (KJS::DotAccessorNode::isDotAccessorNode):
3477         (KJS::DotAccessorNode::base):
3478         (KJS::DotAccessorNode::identifier):
3479         (KJS::FuncExprNode::FuncExprNode):
3480         (KJS::FuncExprNode::identifier):
3481         (KJS::FuncDeclNode::FuncDeclNode):
3482         (KJS::FuncDeclNode::execute):
3483
3484 2005-09-20  Geoffrey Garen  <ggaren@apple.com>
3485
3486         - Oops. The 4263434 change was only appropriate on the branch. Rolling out.
3487         
3488         Reviewed by eric.
3489         
3490         * kjs/internal.cpp:
3491         (KJS::InterpreterImp::mark):
3492
3493 2005-09-20  Geoffrey Garen  <ggaren@apple.com>
3494
3495         - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
3496           kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
3497           the installer)
3498           
3499         Added InterpreterLocks in some places in the bindings we missed before.
3500         
3501         Reviewed by john.
3502
3503         * bindings/runtime_root.cpp:
3504         (KJS::Bindings::addNativeReference):
3505         (KJS::Bindings::removeNativeReference):
3506         (RootObject::removeAllNativeReferences):
3507         * bindings/runtime_root.h:
3508         (KJS::Bindings::RootObject::~RootObject):
3509         (KJS::Bindings::RootObject::setRootObjectImp):
3510