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