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