2007-11-05 Mark Rowe <mrowe@apple.com>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2007-11-05  Mark Rowe  <mrowe@apple.com>
2
3         Mac build fix.
4
5         * kjs/array_object.cpp:
6         (KJS::ArrayProtoFunc::callAsFunction):
7
8 2007-11-05  Adam Roben  <aroben@apple.com>
9
10         Windows build fix
11
12         * kjs/list.h:
13
14 2007-11-05  Mark Rowe  <mrowe@apple.com>
15
16         Build fix.  Add missing #include.
17
18         * kjs/operations.cpp:
19
20 2007-11-05  Eric Seidel  <eric@webkit.org>
21
22         Reviewed by mjs.
23         
24         Remove another call to toString(exec)
25         
26         SunSpider claims this is a 0.5% speedup.
27
28         * kjs/operations.cpp:
29         (KJS::equal): remove another toString
30
31 2007-11-05  Eric Seidel  <eric@webkit.org>
32
33         * kjs/operations.cpp:
34         (KJS::equal): correct broken change.
35
36 2007-11-05  Eric Seidel  <eric@webkit.org>
37
38         Reviewed by mjs.
39
40         Remove one more call to toString(exec).
41         
42         SunSpider claims this is a 0.7% speedup.
43
44         * kjs/operations.cpp:
45         (KJS::equal): remove a call to toString()
46
47 2007-11-05  Mark Rowe  <mrowe@apple.com>
48
49         Gtk build fix.
50
51         * pcre/pcre.pri:
52
53 2007-11-05  Mark Rowe  <mrowe@apple.com>
54
55         Gtk build fix.
56
57         * kjs/list.cpp:
58
59 2007-11-05  Geoffrey Garen  <ggaren@apple.com>
60
61         Touched a file to test my new HTTP access.
62
63         * kjs/scope_chain.cpp:
64
65 2007-11-05  Alp Toker  <alp@atoker.com>
66
67         Unreviewed build fix for qmake-based ports.
68
69         Someone with a better understanding of qmake still needs to sort out
70         the INCLUDEPATH/DEPENDPATH mess.
71
72         * JavaScriptCore.pri:
73
74 2007-11-05  Geoffrey Garen  <ggaren@apple.com>
75
76         Reviewed by Darin Adler.
77         
78         http://bugs.webkit.org/show_bug.cgi?id=15835
79
80         Switched List implementation from a custom heap allocator to an inline
81         Vector, for a disappointing .5% SunSpider speedup.
82         
83         Also renamed List::slice to List::getSlice because "get" is the 
84         conventional prefix for functions returning a value through an out 
85         parameter.
86
87         * kjs/array_object.cpp:
88         (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
89         calls and memory accesses.
90
91         * kjs/bool_object.cpp:
92         (BooleanObjectImp::construct): Removed questionable use of iterator.
93
94         * kjs/list.cpp:
95         * kjs/list.h: New List class, implemented in terms of Vector. Two 
96         interesting differences:
97             1. The inline capacity is 8, not 5. Many of the Lists constructed 
98             during a SunSpider run are larger than 5; almost none are larger
99             than 8.
100
101             2. The growth factor is 4, not 2. Since we can guarantee that Lists
102             aren't long-lived, we can grow them more aggressively, to avoid
103             excessive copying.
104
105         * kjs/regexp_object.cpp:
106         (RegExpObjectImp::construct): Removed redundant function calls.
107
108         * kjs/string_object.cpp:
109         (KJS::StringObjectImp::construct): Removed questionable use of iterator.
110
111         * wtf/Vector.h:
112         (WTF::::uncheckedAppend): Added a fast, unchecked version of append.
113
114 2007-11-05  Mark Rowe  <mrowe@apple.com>
115
116         Reviewed by Alp Toker.
117
118         Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.
119
120         * JavaScriptCore.pri:
121         * pcre/pcre.pri:
122
123 2007-11-04  Darin Adler  <darin@apple.com>
124
125         Reviewed by Maciej.
126
127         - http://bugs.webkit.org/show_bug.cgi?id=15826
128           optimize opcode loop and case insensitive ASCII compares for a 30% speedup
129
130         SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
131
132         * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
133
134         * pcre/pcre_compile.c:
135         (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
136         added OP_NOT since there was no reason it should not be in here.
137         (could_be_empty_branch): Ditto.
138         (compile_branch): Streamlined all the single-character cases; there was a bit of
139         duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
140         But in particular, compile to those opcodes when the single character match is
141         ASCII.
142         (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
143
144         * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
145         the matchframe, after I discovered that none of them needed to be saved and restored
146         across recursive match calls. Also eliminated the ignored result field from the
147         matchframe, since I discovered that rrc ("recursive result code") was already the
148         exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
149         statement of the switch instead of doing them before the switch. This removes a
150         branch from each iteration of the opcode interpreter, just as removal of "op"
151         removed at least one store from each iteration. Last, but not least, add the
152         OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
153         surrogate pair and the letter case can be handled efficiently.
154
155 2007-11-04  Darin Adler  <darin@apple.com>
156
157         * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.
158
159 2007-11-03  Darin Adler  <darin@apple.com>
160
161         - fix non-Mac builds; remove some more unused PCRE stuff
162
163         * pcre/pcre_compile.c:
164         (compile_branch): Removed branch chain and some unused ESC values.
165         (compile_regex): Ditto.
166         (jsRegExpCompile): Ditto.
167         * pcre/pcre_exec.c:
168         (match): Removed unused branch targets. Don't use macros any more.
169         (jsRegExpExecute): More of the same.
170
171         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
172         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
173         * pcre/pcre.pri: Ditto.
174
175         * pcre/MERGING: Removed.
176         * pcre/pcre_fullinfo.c: Removed.
177         * pcre/pcre_get.c: Removed.
178         * pcre/pcre_internal.h:
179         * pcre/ucp.h: Removed.
180
181 2007-11-03  Darin Adler  <darin@apple.com>
182
183         Reviewed by Maciej.
184
185         - http://bugs.webkit.org/show_bug.cgi?id=15821
186           remove unused PCRE features for speed
187
188         A first step toward removing the PCRE features we don't use.
189         This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
190         the SunSpider regular expression test.
191
192         Replaced the public interface with one that doesn't use the
193         name PCRE. Removed code we don't need for JavaScript and various
194         configurations we don't use. This is in preparation for still
195         more changes in the future. We'll probably switch to C++ and
196         make some even more significant changes to the regexp engine
197         to get some additional speed.
198
199         There's probably additional unused stuff that I haven't
200         deleted yet.
201
202         This does mean that our PCRE is now a fork, but I think that's
203         not really a big deal.
204
205         * JavaScriptCore.exp: Remove the 5 old entry points and add
206         the 3 new entry points for WebCore's direct use of the regular
207         expression engine.
208
209         * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
210         its sense and now there's a USE(POSIX_REGEX) instead, which should
211         probably not be set by anyone. Maybe later we'll just get rid of it
212         altogether.
213
214         * kjs/regexp.h:
215         * kjs/regexp.cpp:
216         (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
217         defines. Cut down on the number of functions used.
218         (KJS::RegExp::~RegExp): Ditto.
219         (KJS::RegExp::match): Ditto.
220
221         * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
222         which are unused.
223
224         * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
225         size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
226         POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
227         and JAVASCRIPT. These are all no longer configurable in our copy
228         of the library.
229
230         * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
231         version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
232         the include of <stdlib.h>, and most of the constants and
233         functions defined in this header. Changed the naming scheme to
234         use a JSRegExp prefix rather than a pcre prefix. In the future,
235         we'll probably change this to be a C++ header.
236
237         * pcre/pcre_compile.c: Removed all unused code branches,
238         including many whole functions and various byte codes.
239         Kept changes outside of removal to a minimum.
240         (check_escape):
241         (first_significant_code):
242         (find_fixedlength):
243         (find_recurse):
244         (could_be_empty_branch):
245         (compile_branch):
246         (compile_regex):
247         (is_anchored):
248         (is_startline):
249         (find_firstassertedchar):
250         (jsRegExpCompile): Renamed from pcre_compile2 and changed the
251         parameters around a bit.
252         (jsRegExpFree): Added.
253
254         * pcre/pcre_exec.c: Removed many unused opcodes and variables.
255         Also started tearing down the NO_RECURSE mechanism since it's
256         now the default. In some cases there were things in the explicit
257         frame that could be turned into plain old local variables and
258         other small like optimizations.
259         (pchars):
260         (match_ref):
261         (match): Changed parameters quite a bit since it's now not used
262         recursively.
263         (jsRegExpExecute): Renamed from pcre_exec.
264
265         * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
266         PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
267         PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
268         PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
269         _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
270         and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
271
272         * pcre/pcre_maketables.c: Changed to only compile in dftables.
273         Also got rid of many of the tables that we don't use.
274
275         * pcre/pcre_tables.c: Removed the unused Unicode property tables.
276
277         * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
278         _pcre_ucp_othercase.
279
280         * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
281         for classes based on Unicode properties.
282
283         * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
284         to eliminate this completely, but we need the regular expression
285         code to be C++ first.
286
287         * pcre/pcre_fullinfo.c:
288         * pcre/pcre_get.c:
289         * pcre/ucp.h:
290         Files that are no longer needed. I didn't remove them with this
291         check-in, because I didn't want to modify all the project files.
292
293 2007-11-03  Maciej Stachowiak  <mjs@apple.com>
294
295         Reviewed by Sam.
296         
297         - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
298
299         It turns out that doing this check costs more than it saves.
300         
301         * kjs/JSImmediate.h:
302         (KJS::JSImmediate::fromDouble):
303
304 2007-11-03  Sam Weinig  <sam@webkit.org>
305
306         Reviewed by Oliver.
307
308         Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
309         The variable had been kept around for binary compatibility, but since nothing
310         else is there is no point in continuing to keep it around.
311
312         * API/JSCallbackConstructor.cpp:
313         (KJS::):
314         * API/JSCallbackFunction.cpp:
315         (KJS::):
316         * API/JSCallbackObject.cpp:
317         (KJS::):
318         * bindings/objc/objc_runtime.mm:
319         * bindings/runtime_array.cpp:
320         * bindings/runtime_object.cpp:
321         * kjs/array_instance.cpp:
322         (KJS::):
323         * kjs/array_object.cpp:
324         (KJS::):
325         * kjs/bool_object.cpp:
326         * kjs/date_object.cpp:
327         (KJS::):
328         * kjs/error_object.cpp:
329         * kjs/function.cpp:
330         (KJS::):
331         * kjs/internal.cpp:
332         (KJS::):
333         * kjs/lookup.h:
334         * kjs/math_object.cpp:
335         * kjs/number_object.cpp:
336         * kjs/object.h:
337         * kjs/regexp_object.cpp:
338         * kjs/string_object.cpp:
339         (KJS::):
340
341 2007-11-03  Kevin McCullough  <kmccullough@apple.com>
342
343         - Updated testkjs results to make the build bots green until we
344         can fix the tests that are failing.  The new failures are in DST.
345
346         * tests/mozilla/expected.html:
347
348 2007-11-03  Maciej Stachowiak  <mjs@apple.com>
349
350         Reviewed by Adam.
351         
352         - don't print the var twice for ForInNodes with a var declaration
353
354         * kjs/nodes2string.cpp:
355         (KJS::ForInNode::streamTo):
356
357 2007-11-03  Darin Adler  <darin@apple.com>
358
359         * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
360         C-incompatible declaration.
361
362 2007-11-03  Mark Rowe  <mrowe@apple.com>
363
364         Gtk build fix.
365
366         * kjs/nodes.cpp:  Add missing include.
367
368 2007-11-03  Darin Adler  <darin@apple.com>
369
370         Reviewed by Maciej.
371
372         - fix http://bugs.webkit.org/show_bug.cgi?id=15814
373           <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
374
375         These changes cause us to match the JavaScript specification and pass the
376         fast/js/kde/encode_decode_uri.html test.
377
378         * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
379         new strict mode, throwing an exception if there are malformed UTF-16 surrogate
380         pairs in the text.
381
382         * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
383         * kjs/ustring.cpp:
384         (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
385         those might be illegal in some sense, they aren't supposed to get any special
386         handling in the place where this function is currently used.
387         (KJS::UString::UTF8String): Added the strictness.
388
389 2007-11-03  Darin Adler  <darin@apple.com>
390
391         Reviewed by Maciej.
392
393         - http://bugs.webkit.org/show_bug.cgi?id=15812
394           some JavaScript tests (from the Mozilla test suite) are failing
395
396         Two or three fixes get 7 more of the Mozilla tests passing.
397         This gets us down from 61 failing tests to 54.
398
399         * kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
400         Made this inline and gave it a more specific type. Some day we should
401         probably do that for all of these -- might even get a bit of a speed
402         boost from it.
403         * kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
404         inline in the header.
405
406         * kjs/regexp_object.h:
407         * kjs/regexp_object.cpp:
408         (KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
409         switch statement into the RegExpImp object, so they can be shared with
410         RegExpImp::callAsFunction.
411         (KJS::RegExpImp::match): Added. Common code used by both test and exec.
412         (KJS::RegExpImp::test): Added.
413         (KJS::RegExpImp::exec): Added.
414         (KJS::RegExpImp::implementsCall): Added.
415         (KJS::RegExpImp::callAsFunction): Added.
416         (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
417         lastInput to null rather than empty string -- we take advantage of the
418         difference in RegExpImp::match.
419         (KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
420         just to get at a field like this.
421
422         * pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
423         the JavaScript specification. If there are not 4 hex digits after the \u,
424         then it's processed as if it wasn't an escape sequence at all.
425
426         * pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
427         for JavaScript (4 specific Unicode values).
428         * pcre/pcre_exec.c:
429         (match): Changed all call sites to use IS_NEWLINE.
430         (pcre_exec): Ditto.
431
432         * tests/mozilla/expected.html: Updated to expect 7 more successful tests.
433
434 2007-11-03  David D. Kilzer  <ddkilzer@webkit.org>
435
436         Sort files(...); sections of Xcode project files.
437
438         Rubber-stamped by Darin.
439
440         * JavaScriptCore.xcodeproj/project.pbxproj:
441
442 2007-11-03  Maciej Stachowiak  <mjs@apple.com>
443
444         Reviewed by Oliver.
445         
446         - remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup
447
448         * kjs/grammar.y:
449         * kjs/nodes.cpp:
450         (KJS::VarDeclNode::optimizeVariableAccess):
451         (KJS::VarDeclNode::getDeclarations):
452         (KJS::VarDeclNode::handleSlowCase):
453         (KJS::VarDeclNode::evaluateSingle):
454         (KJS::VarDeclNode::evaluate):
455         (KJS::VarStatementNode::execute):
456         * kjs/nodes.h:
457         (KJS::VarDeclNode::):
458         (KJS::VarStatementNode::):
459         * kjs/nodes2string.cpp:
460         (KJS::VarDeclNode::streamTo):
461
462 2007-11-03  Alexey Proskuryakov  <ap@webkit.org>
463
464         Reviewed by Darin.
465
466         http://bugs.webkit.org/show_bug.cgi?id=15800
467         REGRESSION (r27303): RegExp leaks
468
469         * kjs/regexp_object.h:
470         (KJS::RegExpImp::setRegExp):
471         (KJS::RegExpImp::regExp):
472         (KJS::RegExpImp::classInfo):
473         * kjs/regexp_object.cpp:
474         (RegExpImp::RegExpImp):
475         (RegExpImp::~RegExpImp):
476         Renamed reg member variable to m_regExp, changed it to use OwnPtr.
477
478 2007-11-02  Maciej Stachowiak  <mjs@apple.com>
479
480         Reviewed by Oliver.
481         
482         - add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.
483
484         * kjs/grammar.y:
485         * kjs/nodes.cpp:
486         (KJS::statementListPushFIFO):
487         (KJS::statementListGetDeclarations):
488         (KJS::statementListInitializeDeclarationStacks):
489         (KJS::statementListInitializeVariableAccessStack):
490         (KJS::statementListExecute):
491         (KJS::BlockNode::BlockNode):
492         (KJS::FunctionBodyNode::FunctionBodyNode):
493         (KJS::ProgramNode::ProgramNode):
494         * kjs/nodes.h:
495         (KJS::CaseClauseNode::):
496
497 2007-11-02  Darin Adler  <darin@apple.com>
498
499         Reviewed by Maciej.
500
501         - http://bugs.webkit.org/show_bug.cgi?id=15791
502           change property map data structure for less memory use, better speed
503
504         The property map now has an array of indices and a separate array of
505         property map entries. This slightly slows down lookup because of a second
506         memory acess, but makes property maps smaller and faster to iterate in
507         functions like mark().
508
509         SunSpider says this is 1.2% faster, although it makes the bitwise-end test
510         more than 10% slower. To fix that we'll need to optimize global variable lookup.
511
512         * kjs/property_map.cpp:
513         (KJS::PropertyMapEntry::PropertyMapEntry):
514         (KJS::PropertyMapHashTable::entries):
515         (KJS::PropertyMapHashTable::allocationSize):
516         (KJS::SavedProperties::SavedProperties):
517         (KJS::SavedProperties::~SavedProperties):
518         (KJS::PropertyMap::checkConsistency):
519         (KJS::PropertyMap::~PropertyMap):
520         (KJS::PropertyMap::clear):
521         (KJS::PropertyMap::get):
522         (KJS::PropertyMap::getLocation):
523         (KJS::PropertyMap::put):
524         (KJS::PropertyMap::insert):
525         (KJS::PropertyMap::createTable):
526         (KJS::PropertyMap::rehash):
527         (KJS::PropertyMap::remove):
528         (KJS::PropertyMap::mark):
529         (KJS::comparePropertyMapEntryIndices):
530         (KJS::PropertyMap::containsGettersOrSetters):
531         (KJS::PropertyMap::getEnumerablePropertyNames):
532         (KJS::PropertyMap::save):
533         (KJS::PropertyMap::restore):
534         * kjs/property_map.h:
535
536 2007-11-02  Darin Adler  <darin@apple.com>
537
538         Reviewed by Maciej.
539
540         - http://bugs.webkit.org/show_bug.cgi?id=15807
541           HashMap needs a take() function that combines get and remove
542
543         * wtf/HashMap.h: Added take function. Simplistic implementation for now,
544         but still does only one hash table lookup.
545
546         * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
547         a find followed by a remove.
548
549 2007-11-02  David Carson  <dacarson@gmail.com>
550
551         Reviewed by Darin.
552
553         Fix compiler warning "warning: suggest parentheses around && within ||"
554         http://bugs.webkit.org/show_bug.cgi?id=15764
555
556         * kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.
557
558 2007-11-01  Geoffrey Garen  <ggaren@apple.com>
559
560         Reviewed by Maciej Stachowiak.
561         
562         In preparation for making List a simple stack-allocated Vector:
563
564         Removed all instances of List copying and/or assignment, and made List 
565         inherit from Noncopyable.
566         
567         Functions that used to return a List by copy now take List& out 
568         parameters.
569         
570         Layout tests and JS tests pass.
571
572         * kjs/list.cpp:
573         (KJS::List::slice): Replaced copyTail with a more generic slice 
574         alternative. (JavaScriptCore only calls slice(1), but WebCore calls 
575         slice(2)).
576
577 2007-11-01  Geoffrey Garen  <ggaren@apple.com>
578
579         Reviewed by Maciej Stachowiak.
580
581         Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
582         REGRESSION(r27344): Crash on load at finance.yahoo.com
583         
584         Reverted a small portion of my last check-in. (The speedup and the List 
585         removal are still there, though.)
586         
587         ActivationImp needs to hold a pointer to its function, and mark that 
588         pointer (rather than accessing its function through its ExecState, and 
589         counting on the active scope to mark its function) because a closure 
590         can cause an ActivationImp to outlive its ExecState along with any 
591         active scope.
592
593         * kjs/ExecState.cpp:
594         (KJS::ExecState::ExecState):
595         * kjs/function.cpp:
596         (KJS::FunctionImp::~FunctionImp):
597         (KJS::ActivationImp::ActivationImp):
598         * kjs/function.h:
599         (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
600
601         Also made HashTable a little more crash-happy in debug builds, so 
602         problems like this will show up earlier:
603         
604         * wtf/HashTable.h:
605         (WTF::HashTable::~HashTable):
606
607 2007-11-01  Geoffrey Garen  <ggaren@apple.com>
608
609         Reviewed by Adam Roben.
610         
611         Addressed some of Darin's review comments.
612         
613         Used perl -p, which is the shorthand while(<>) {}.
614         
615         Made sure not to suppress bison's output.
616         
617         Added line to removed bison_out.txt, since this script removes other 
618         intermediate files, too.
619
620         * DerivedSources.make:
621
622 2007-11-01  Geoffrey Garen  <ggaren@apple.com>
623
624         Reviewed by Oliver Hunt.
625         
626         Removed List from ActivationImp, in preparation for making all lists
627         stack-allocated.
628         
629         Tests pass.
630         
631         1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.
632
633         * kjs/ExecState.cpp:
634         (KJS::ExecState::ExecState):
635         (KJS::ExecState::~ExecState):
636         * kjs/function.cpp:
637         (KJS::ActivationImp::ActivationImp):
638         (KJS::ActivationImp::createArgumentsObject):
639         * kjs/function.h:
640         (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
641
642 2007-11-01  Adam Roben  <aroben@apple.com>
643
644         Use jsNumberCell instead of jsNumber when converting double constants to JSValues
645
646         This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
647         ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.
648
649         It also gets rid of an MSVC warning that we previously had to silence.
650
651         Reviewed by Geoff.
652
653         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
654         back on the "overflow in constant arithmetic" warning.
655         * kjs/number_object.cpp:
656         (NumberObjectImp::getValueProperty): Use jsNumberCell instead of
657         jsNumber.
658
659 2007-10-31  Adam Roben  <aroben@apple.com>
660
661         Windows build fix
662
663         * kjs/ExecState.h:
664
665 2007-10-31  Maciej Stachowiak  <mjs@apple.com>
666
667         Reviewed by Oliver.
668         
669         - shave some cycles off of local storage access for a 1% SunSpider speedup
670         
671         Keep the LocalStorage pointer in the ExecState, instead of getting
672         it from the ActivationImp all the time.
673
674         * kjs/ExecState.cpp:
675         (KJS::ExecState::updateLocalStorage):
676         * kjs/ExecState.h:
677         (KJS::ExecState::localStorage):
678         * kjs/nodes.cpp:
679         (KJS::LocalVarAccessNode::evaluate):
680         (KJS::LocalVarFunctionCallNode::evaluate):
681         (KJS::PostIncLocalVarNode::evaluate):
682         (KJS::PostDecLocalVarNode::evaluate):
683         (KJS::LocalVarTypeOfNode::evaluate):
684         (KJS::PreIncLocalVarNode::evaluate):
685         (KJS::PreDecLocalVarNode::evaluate):
686         (KJS::ReadModifyLocalVarNode::evaluate):
687         (KJS::AssignLocalVarNode::evaluate):
688         (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
689
690 2007-10-31  Adam Roben  <aroben@apple.com>
691
692         Fix a crash on launch due to a static initializer race
693
694         We now use fast inline assembler spinlocks which can be statically
695         initialized at compile time.
696
697         As a side benefit, this speeds up SunSpider by 0.4%.
698
699         Reviewed by Oliver.
700
701         * wtf/FastMalloc.cpp:
702         * wtf/TCSpinLock.h:
703         (TCMalloc_SpinLock::Lock):
704         (TCMalloc_SpinLock::Unlock):
705         (TCMalloc_SlowLock):
706         * wtf/TCSystemAlloc.cpp:
707
708 2007-10-31  Kevin McCullough  <kmccullough@apple.com>
709
710         Reviewed by Sam.
711
712         - Corrected spelling.
713
714         * wtf/HashTraits.h:
715
716 2007-10-31  Mark Rowe  <mrowe@apple.com>
717
718         Further Gtk build fixage.
719
720         * kjs/regexp_object.cpp:
721
722 2007-10-31  Mark Rowe  <mrowe@apple.com>
723
724         Gtk build fix.
725
726         * kjs/regexp.h:
727
728 2007-10-31  Darin Adler  <darin@apple.com>
729
730         Reviewed by Maciej.
731
732         - fix http://bugs.webkit.org/show_bug.cgi?id=15749
733           RegExp/RegExpObjectImp cause needless UString creation
734
735         Speeds things up 0.4% according to SunSpider.
736
737         * kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
738         because this library doesn't use the real PCRE -- it uses its
739         own PCRE that works on UTF-16.
740
741         * kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
742         Use Noncopyable. Change the return value of match.
743         * kjs/regexp.cpp:
744         (KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
745         (KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
746         (KJS::RegExp::match): Change to return the position as an int and the
747         ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.
748
749         * kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
750         require a result string.
751         * kjs/regexp_object.cpp:
752         (RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
753         (RegExpObjectImp::performMatch): Change so it doesn't return a string.
754         (RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
755         the main result with the backreferences; now it doesn't need to take
756         a result parameter.
757         (RegExpObjectImp::getBackref): Minor tweaks.
758         (RegExpObjectImp::getLastParen): Ditto.
759         (RegExpObjectImp::getLeftContext): Ditto.
760         (RegExpObjectImp::getRightContext): Ditto.
761         (RegExpObjectImp::getValueProperty): Change LastMatch case to call
762         getBackref(0) so we don't need a separate getLastMatch function.
763
764         * kjs/string_object.cpp:
765         (KJS::replace): Update to use new performMatch, including merging the
766         matched string section with the other substrings.
767         (KJS::StringProtoFunc::callAsFunction): Update functions to use the
768         new performMatch and match. Also change to use OwnArrayPtr.
769
770 2007-10-31  Oliver Hunt  <oliver@apple.com>
771
772         * kjs/nodes.h: include OwnPtr.h
773
774 2007-10-31  Oliver Hunt  <oliver@apple.com>
775
776         Reviewed by Maciej.
777
778         Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider
779
780         * kjs/grammar.y:
781         * kjs/nodes.cpp:
782         (KJS::statementListPushFIFO):
783         (KJS::statementListGetDeclarations):
784         (KJS::statementListInitializeDeclarationStacks):
785         (KJS::statementListInitializeVariableAccessStack):
786         (KJS::statementListExecute):
787         (KJS::BlockNode::optimizeVariableAccess):
788         (KJS::BlockNode::BlockNode):
789         (KJS::BlockNode::getDeclarations):
790         (KJS::BlockNode::execute):
791         (KJS::CaseClauseNode::optimizeVariableAccess):
792         (KJS::CaseClauseNode::getDeclarations):
793         (KJS::CaseClauseNode::evalStatements):
794         (KJS::FunctionBodyNode::initializeDeclarationStacks):
795         (KJS::FunctionBodyNode::optimizeVariableAccess):
796         * kjs/nodes.h:
797         * kjs/nodes2string.cpp:
798         (KJS::statementListStreamTo):
799         (KJS::BlockNode::streamTo):
800         (KJS::CaseClauseNode::streamTo):
801
802 2007-10-30  Mark Rowe  <mrowe@apple.com>
803
804         * kjs/property_map.cpp: Added a missing using directive to fix the build
805         for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
806
807 2007-10-31  Maciej Stachowiak  <mjs@apple.com>
808
809         * kjs/property_map.cpp: Include HashTable.h the right way to fix the build
810         for non-Mac ports.
811
812 2007-10-31  Alexey Proskuryakov  <ap@webkit.org>
813
814         Reviewed by Darin.
815
816         http://bugs.webkit.org/show_bug.cgi?id=11001
817         WebKit doesn't support RegExp.compile method
818
819         Test: fast/js/regexp-compile.html
820
821         * kjs/regexp_object.cpp:
822         (RegExpPrototype::RegExpPrototype):
823         (RegExpProtoFunc::callAsFunction):
824         * kjs/regexp_object.h:
825         (KJS::RegExpProtoFunc::):
826         Added RegExp.compile.
827
828         * tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.
829
830 2007-10-31  Maciej Stachowiak  <mjs@apple.com>
831
832         Reviewed by Oliver.
833         
834         - get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
835         
836         Integer divide sucks. Fortunately, a bunch of shifts and XORs
837         biased towards the high bits is sufficient to provide a good
838         double hash. Besides the SunSpider win, I used the dump statistics
839         mode for both to verify that collisions did not increase and that
840         the longest collision chain is not any longer.
841
842         * kjs/property_map.cpp:
843         (KJS::doubleHash):
844         (KJS::PropertyMap::get):
845         (KJS::PropertyMap::getLocation):
846         (KJS::PropertyMap::put):
847         (KJS::PropertyMap::insert):
848         (KJS::PropertyMap::remove):
849         (KJS::PropertyMap::checkConsistency):
850         * wtf/HashTable.h:
851         (WTF::doubleHash):
852         (WTF::::lookup):
853         (WTF::::lookupForWriting):
854         (WTF::::fullLookupForWriting):
855         (WTF::::add):
856
857 2007-10-30  Adam Roben  <aroben@apple.com>
858
859         * kjs/collector.h: Make HeapType public so it can be used for non-member
860         things like the HeapConstants struct template. Fixes the build on Windows.
861
862 2007-10-30  Adam Roben  <aroben@apple.com>
863
864         Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows
865
866         Speeds up SunSpider by 0.4%.
867
868         Reviewed by Steve and Maciej.
869
870         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
871         a warning during LTCG in release builds about double -> float
872         conversion.
873         * wtf/AlwaysInline.h:
874         * wtf/FastMalloc.h:
875
876 2007-10-30  Adam Roben  <aroben@apple.com>
877
878         Use GetCurrentThreadId instead of pthread_self in FastMalloc
879
880         Speeds up SunSpider by 0.3%.
881
882         Reviewed by Steve.
883
884         * wtf/FastMalloc.cpp:
885         (WTF::TCMalloc_ThreadCache::InitTSD):
886         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
887
888 2007-10-30  Adam Roben  <aroben@apple.com>
889
890         Switch to a Win32 critical section implementation of spinlocks
891         
892         Speeds up SunSpider by 0.4%.
893         
894         Reviewed by Steve.
895         
896         * wtf/FastMalloc.cpp:
897         * wtf/TCSpinLock.h:
898         (TCMalloc_SpinLock::TCMalloc_SpinLock):
899         (TCMalloc_SpinLock::Init):
900         (TCMalloc_SpinLock::Finalize):
901         (TCMalloc_SpinLock::Lock):
902         (TCMalloc_SpinLock::Unlock):
903         * wtf/TCSystemAlloc.cpp:
904
905 2007-10-30  Adam Roben  <aroben@apple.com>
906
907         Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta
908
909         http://bugs.webkit.org/show_bug.cgi?id=15586
910
911         Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll
912
913         Use Win32 TLS functions instead of __declspec(thread), which breaks
914         delay-loading.
915
916         Reviewed by Steve.
917
918         * wtf/FastMalloc.cpp:
919         (WTF::getThreadHeap):
920         (WTF::TCMalloc_ThreadCache::InitModule):
921
922 2007-10-30  Maciej Stachowiak  <mjs@apple.com>
923
924         Reviewed by Oliver.
925         
926         - allocate numbers in half-size cells, for an 0.5% SunSpider speedup
927         http://bugs.webkit.org/show_bug.cgi?id=15772
928         
929         We do this by using a single mark bit per two number cells, and
930         tweaking marking.
931         
932         Besides being an 0.5% win overall, this is a 7.1% win on morph.
933
934         * kjs/collector.cpp:
935         (KJS::):
936         (KJS::Collector::heapAllocate):
937         (KJS::Collector::markStackObjectsConservatively):
938         (KJS::Collector::sweep):
939         * kjs/collector.h:
940         (KJS::SmallCollectorCell::):
941
942 2007-10-30  Geoffrey Garen  <ggaren@apple.com>
943
944         Reviewed by Adam Roben, Sam Weinig.
945         
946         Made conflicts in grammar.y a persistent build failure.
947
948         * DerivedSources.make:
949
950 2007-10-30  Kevin McCullough  <kmccullough@apple.com>
951
952         Reviewed by Adam and Geoff.
953
954         - Added a new cast so all the casts are in the same place.
955
956         * API/APICast.h:
957         (toGlobalRef):
958
959 2007-10-30  Geoffrey Garen  <ggaren@apple.com>
960
961         Reviewed by Darin Adler.
962
963         Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
964         
965         JS tests, including 
966
967             ecma_2/Statements/dowhile-001.js
968             ecma_2/Statements/dowhile-002.js
969             ecma_2/Statements/dowhile-003.js
970             ecma_2/Statements/dowhile-004.js
971             ecma_2/Statements/dowhile-005.js
972             ecma_2/Statements/dowhile-006.js
973             ecma_2/Statements/dowhile-007.js
974             js1_2/statements/do_while.js
975
976         and layout tests, including
977
978             do-while-expression-value.html
979             do-while-semicolon.html
980             do-while-without-semicolon.html
981         
982         pass.
983         
984         * kjs/grammar.y: Use the explicit "error" production, as we do with other
985         automatic semicolon insertions, to disambiguate "do { } while();" from
986         "do { } while()" followed by ";" (the empty statement).
987
988 2007-10-29  Oliver Hunt  <oliver@apple.com>
989
990         Reviewed by Maciej.
991
992         Debranching remaining assignment nodes, and miscellaneous cleanup
993         
994         Split read-modify code paths out of AssignBracketNode and AssignDotNode
995         Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode 
996         and ReadModifyResolveNode evaluate methods
997
998         Leads to a 1% gain in SunSpider.
999
1000         * kjs/grammar.y:
1001         * kjs/nodes.cpp:
1002         (KJS::ReadModifyLocalVarNode::evaluate):
1003         (KJS::ReadModifyResolveNode::evaluate):
1004         (KJS::AssignDotNode::evaluate):
1005         (KJS::ReadModifyDotNode::optimizeVariableAccess):
1006         (KJS::ReadModifyDotNode::evaluate):
1007         (KJS::AssignBracketNode::evaluate):
1008         (KJS::ReadModifyBracketNode::optimizeVariableAccess):
1009         (KJS::ReadModifyBracketNode::evaluate):
1010         * kjs/nodes.h:
1011         (KJS::AssignBracketNode::):
1012         (KJS::AssignBracketNode::precedence):
1013         (KJS::AssignDotNode::):
1014         (KJS::AssignDotNode::precedence):
1015         * kjs/nodes2string.cpp:
1016         (KJS::ReadModifyBracketNode::streamTo):
1017         (KJS::AssignBracketNode::streamTo):
1018         (KJS::ReadModifyDotNode::streamTo):
1019         (KJS::AssignDotNode::streamTo):
1020
1021 2007-10-29  Oliver Hunt  <oliver@apple.com>
1022
1023         Debranching various Node::evaluate implementations
1024         
1025         Reviewed by Maciej.
1026         
1027         Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
1028         Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
1029         
1030         Gains 1.6% on SunSpider
1031
1032         * JavaScriptCore.xcodeproj/project.pbxproj:
1033         * kjs/grammar.y:
1034         * kjs/nodes.cpp:
1035         (KJS::PostIncResolveNode::optimizeVariableAccess):
1036         (KJS::PostIncResolveNode::evaluate):
1037         (KJS::PostIncLocalVarNode::evaluate):
1038         (KJS::PostDecResolveNode::optimizeVariableAccess):
1039         (KJS::PostDecResolveNode::evaluate):
1040         (KJS::PostDecLocalVarNode::evaluate):
1041         (KJS::PostIncBracketNode::evaluate):
1042         (KJS::PostDecBracketNode::evaluate):
1043         (KJS::PostIncDotNode::evaluate):
1044         (KJS::PostDecDotNode::evaluate):
1045         (KJS::PreIncResolveNode::optimizeVariableAccess):
1046         (KJS::PreIncLocalVarNode::evaluate):
1047         (KJS::PreIncResolveNode::evaluate):
1048         (KJS::PreDecResolveNode::optimizeVariableAccess):
1049         (KJS::PreDecLocalVarNode::evaluate):
1050         (KJS::PreDecResolveNode::evaluate):
1051         (KJS::PreIncBracketNode::evaluate):
1052         (KJS::PreDecBracketNode::evaluate):
1053         (KJS::PreIncDotNode::evaluate):
1054         (KJS::PreDecDotNode::evaluate):
1055         (KJS::ReadModifyResolveNode::optimizeVariableAccess):
1056         (KJS::AssignResolveNode::optimizeVariableAccess):
1057         (KJS::AssignLocalVarNode::evaluate):
1058         (KJS::AssignResolveNode::evaluate):
1059         * kjs/nodes.h:
1060         (KJS::PostDecResolveNode::):
1061         (KJS::PostDecResolveNode::precedence):
1062         (KJS::PostDecLocalVarNode::):
1063         (KJS::PostfixBracketNode::):
1064         (KJS::PostfixBracketNode::precedence):
1065         (KJS::PostIncBracketNode::):
1066         (KJS::PostIncBracketNode::isIncrement):
1067         (KJS::PostDecBracketNode::):
1068         (KJS::PostDecBracketNode::isIncrement):
1069         (KJS::PostfixDotNode::):
1070         (KJS::PostfixDotNode::precedence):
1071         (KJS::PostIncDotNode::):
1072         (KJS::PostIncDotNode::isIncrement):
1073         (KJS::PostDecDotNode::):
1074         (KJS::PreIncResolveNode::):
1075         (KJS::PreDecResolveNode::):
1076         (KJS::PreDecResolveNode::precedence):
1077         (KJS::PreDecLocalVarNode::):
1078         (KJS::PrefixBracketNode::):
1079         (KJS::PrefixBracketNode::precedence):
1080         (KJS::PreIncBracketNode::):
1081         (KJS::PreIncBracketNode::isIncrement):
1082         (KJS::PreDecBracketNode::):
1083         (KJS::PreDecBracketNode::isIncrement):
1084         (KJS::PrefixDotNode::):
1085         (KJS::PrefixDotNode::precedence):
1086         (KJS::PreIncDotNode::):
1087         (KJS::PreIncDotNode::isIncrement):
1088         (KJS::PreDecDotNode::):
1089         (KJS::ReadModifyResolveNode::):
1090         (KJS::ReadModifyLocalVarNode::):
1091         (KJS::AssignResolveNode::):
1092         (KJS::AssignResolveNode::precedence):
1093         * kjs/nodes2string.cpp:
1094         (KJS::PostIncResolveNode::streamTo):
1095         (KJS::PostDecResolveNode::streamTo):
1096         (KJS::PostfixBracketNode::streamTo):
1097         (KJS::PostfixDotNode::streamTo):
1098         (KJS::PreIncResolveNode::streamTo):
1099         (KJS::PreDecResolveNode::streamTo):
1100         (KJS::ReadModifyResolveNode::streamTo):
1101         (KJS::AssignResolveNode::streamTo):
1102
1103 2007-10-29  Maciej Stachowiak  <mjs@apple.com>
1104
1105         Not reviewed, build fix.
1106         
1107         - Include Vector.h in a way that actually works.
1108
1109         * kjs/LocalStorage.h:
1110
1111 2007-10-29  Maciej Stachowiak  <mjs@apple.com>
1112
1113         Not reviewed, build fix.
1114         
1115         - Install LocalStorage.h as a private header.
1116
1117         * JavaScriptCore.xcodeproj/project.pbxproj:
1118
1119 2007-10-29  Maciej Stachowiak  <mjs@apple.com>
1120
1121         Reviewed by Darin.
1122         
1123         - Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.
1124
1125         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1126         * JavaScriptCore.xcodeproj/project.pbxproj:
1127         * kjs/LocalStorage.h: Added.
1128         (KJS::LocalStorageEntry::LocalStorageEntry):
1129         (WTF::):
1130         * kjs/function.h:
1131         * kjs/nodes.cpp:
1132         (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
1133
1134 2007-10-29  Geoffrey Garen  <ggaren@apple.com>
1135
1136         Reviewed by Oliver Hunt.
1137         
1138         Some small tweaks that I notice while reviewing Oliver's last patch.
1139         
1140         Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
1141         
1142         No change in SunSpider because SunSpider doesn't take the code path that
1143         would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.
1144
1145         * kjs/nodes.cpp:
1146         (KJS::LocalVarPostfixNode::evaluate):
1147         (KJS::TypeOfResolveNode::optimizeVariableAccess):
1148         (KJS::LocalVarTypeOfNode::evaluate):
1149         (KJS::PrefixResolveNode::optimizeVariableAccess):
1150         (KJS::LocalVarPrefixNode::evaluate):
1151         (KJS::AssignResolveNode::optimizeVariableAccess):
1152         (KJS::LocalVarAssignNode::evaluate):
1153         * kjs/nodes.h:
1154         (KJS::LocalVarTypeOfNode::):
1155         (KJS::PrefixResolveNode::):
1156         (KJS::LocalVarPrefixNode::):
1157         (KJS::AssignResolveNode::):
1158         (KJS::LocalVarAssignNode::):
1159
1160 2007-10-29  Eric Seidel  <eric@webkit.org>
1161
1162         Reviewed by Maciej.
1163         
1164         SunSpider claims this was a 0.7% speedup.
1165
1166         * kjs/string_object.cpp:
1167         (KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case
1168
1169 2007-10-29  Maciej Stachowiak  <mjs@apple.com>
1170
1171         Reviewed by Mark.
1172         
1173         - re-enable asserts for access to empty or deleted keys
1174
1175         * wtf/HashTable.h:
1176         (WTF::::lookup):
1177         (WTF::::lookupForWriting):
1178         (WTF::::fullLookupForWriting):
1179         (WTF::::add):
1180
1181 2007-10-29  Eric Seidel  <eric@webkit.org>
1182
1183         Build fix only, no review.
1184
1185         * JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot
1186
1187 2007-10-29  Mark Rowe  <mrowe@apple.com>
1188
1189         Gtk build fix.  Move struct declarations into nodes.h.
1190
1191         * kjs/grammar.y:
1192         * kjs/nodes.h:
1193
1194 2007-10-29  Eric Seidel  <eric@webkit.org>
1195
1196         Reviewed by darin.
1197         
1198         Give StringInstance a getOwnPropertySlot(ExecState, unsigned, PropertySlot) fastpath, just like Arrays.
1199         Make it a compile time error to use toString(ExecState) on a StringInstance
1200         
1201         SunSpider claims this was a 6.6% speedup overall (22% on string-base64)
1202
1203         * kjs/internal.h:
1204         (KJS::StringImp::getLength):
1205         * kjs/string_object.cpp:
1206         (KJS::StringInstance::lengthGetter):
1207         (KJS::StringInstance::inlineGetOwnPropertySlot):
1208         (KJS::StringInstance::getOwnPropertySlot):
1209         * kjs/string_object.h:
1210
1211 2007-10-28  Oliver Hunt  <oliver@apple.com>
1212
1213         Reviewed by Darin.
1214
1215         Add nodes to allow Assignment, TypeOf, and prefix operators to 
1216         make use of the new optimised local variable look up.
1217
1218         5% gain on sunspider
1219
1220         * kjs/nodes.cpp:
1221         (KJS::TypeOfResolveNode::optimizeVariableAccess):
1222         (KJS::LocalTypeOfAccessNode::evaluate):
1223         (KJS::PrefixResolveNode::optimizeVariableAccess):
1224         (KJS::PrefixLocalAccessNode::evaluate):
1225         (KJS::AssignResolveNode::optimizeVariableAccess):
1226         (KJS::AssignLocalAccessNode::evaluate):
1227         * kjs/nodes.h:
1228         (KJS::TypeOfResolveNode::):
1229         (KJS::TypeOfResolveNode::precedence):
1230         (KJS::LocalTypeOfAccessNode::):
1231         (KJS::PrefixResolveNode::):
1232         (KJS::PrefixResolveNode::precedence):
1233         (KJS::PrefixLocalAccessNode::):
1234         (KJS::AssignResolveNode::):
1235         (KJS::AssignLocalAccessNode::):
1236
1237 2007-10-28  Maciej Stachowiak  <mjs@apple.com>
1238
1239         Reviewed by Darin.
1240         
1241         - avoid creating and then breaking circular lists in the parser, instead track head and tail pointers at parse time
1242         http://bugs.webkit.org/show_bug.cgi?id=15748
1243         
1244         Not a significant speedup or slowdown on SunSpider.
1245
1246         * kjs/Parser.cpp:
1247         (KJS::clearNewNodes):
1248         * kjs/Parser.h:
1249         * kjs/grammar.y:
1250         * kjs/nodes.cpp:
1251         (KJS::BlockNode::BlockNode):
1252         (KJS::CaseBlockNode::CaseBlockNode):
1253         (KJS::FunctionBodyNode::FunctionBodyNode):
1254         (KJS::SourceElementsNode::SourceElementsNode):
1255         (KJS::ProgramNode::ProgramNode):
1256         * kjs/nodes.h:
1257         (KJS::ElementNode::):
1258         (KJS::ArrayNode::):
1259         (KJS::PropertyListNode::):
1260         (KJS::ObjectLiteralNode::):
1261         (KJS::ArgumentListNode::):
1262         (KJS::ArgumentsNode::):
1263         (KJS::VarDeclListNode::):
1264         (KJS::VarStatementNode::):
1265         (KJS::ForNode::):
1266         (KJS::ParameterNode::):
1267         (KJS::FuncExprNode::):
1268         (KJS::FuncDeclNode::):
1269         (KJS::SourceElementsNode::):
1270         (KJS::CaseClauseNode::):
1271         (KJS::ClauseListNode::):
1272
1273 2007-10-28  Mark Rowe  <mrowe@apple.com>
1274
1275         Disable assertions in a manner that doesn't break the Qt Windows build.
1276
1277         * wtf/HashTable.h:
1278         (WTF::::lookup):
1279         (WTF::::lookupForWriting):
1280         (WTF::::fullLookupForWriting):
1281
1282 2007-10-28  Geoffrey Garen  <ggaren@apple.com>
1283
1284         Temporarily disabling some ASSERTs I introduced in my last check-in 
1285         because of http://bugs.webkit.org/show_bug.cgi?id=15747
1286         Lots of layout tests fail the !HashTranslator::equal(KeyTraits::emptyValue() ASSERT
1287
1288         * wtf/HashTable.h:
1289         (WTF::::lookup):
1290         (WTF::::lookupForWriting):
1291         (WTF::::fullLookupForWriting):
1292         (WTF::::add):
1293
1294 2007-10-28  Geoffrey Garen  <ggaren@apple.com>
1295
1296         Reviewed by Darin Adler.
1297         
1298         Fixed http://bugs.webkit.org/show_bug.cgi?id=15746
1299         #ifndef ASSERT_DISABLED is no good!
1300         
1301         Replaced with #if !ASSERT_DISABLED.
1302
1303         * wtf/HashTable.h:
1304         (WTF::::lookup):
1305         (WTF::::lookupForWriting):
1306         (WTF::::fullLookupForWriting):
1307         (WTF::::add):
1308
1309 2007-10-28  Geoffrey Garen  <ggaren@apple.com>
1310
1311         Reviewed by Darin Adler.
1312         
1313         Added FunctionCallResolveNode, PostfixResolveNode, and DeleteResolveNode
1314         to the AST transfom that replaces slow resolve nodes with fast local 
1315         variable alternatives.
1316         
1317         2.5% speedup on SunSpider.
1318         
1319         Also added some missing copyright notices.
1320         
1321         * kjs/nodes.cpp:
1322         (KJS::FunctionCallResolveNode::optimizeVariableAccess):
1323         (KJS::FunctionCallResolveNode::evaluate):
1324         (KJS::LocalVarFunctionCallNode::evaluate):
1325         (KJS::PostfixResolveNode::optimizeVariableAccess):
1326         (KJS::PostfixResolveNode::evaluate):
1327         (KJS::LocalVarPostfixNode::evaluate):
1328         (KJS::DeleteResolveNode::optimizeVariableAccess):
1329         (KJS::DeleteResolveNode::evaluate):
1330         (KJS::LocalVarDeleteNode::evaluate):
1331         * kjs/nodes.h:
1332         (KJS::FunctionCallResolveNode::):
1333         (KJS::LocalVarFunctionCallNode::LocalVarFunctionCallNode):
1334         (KJS::PostfixResolveNode::):
1335         (KJS::LocalVarPostfixNode::LocalVarPostfixNode):
1336         (KJS::DeleteResolveNode::):
1337         (KJS::LocalVarDeleteNode::LocalVarDeleteNode):
1338
1339 2007-10-28  Eric Seidel  <eric@webkit.org>
1340
1341         Reviewed by darin.
1342         
1343         Inline UString::Rep::deref() for a 0.8% improvement in SunSpider
1344         Add virtual keyword to a few virtual functions previously unmarked.
1345
1346         * kjs/internal.h:
1347         (KJS::StringImp::type):
1348         (KJS::NumberImp::type):
1349         * kjs/ustring.h:
1350         (KJS::UString::Rep::deref):
1351
1352 2007-10-28  Darin Adler  <darin@apple.com>
1353
1354         - fix "broken everything" from the storage leak fix
1355
1356         * wtf/RefPtr.h: (WTF::RefPtr::RefPtr): Added a PlacementNewAdopt constructor.
1357         * kjs/ustring.h: (KJS::UString::UString): Pass PlacementNewAdopt along to RefPtr.
1358
1359 2007-10-28  Darin Adler  <darin@apple.com>
1360
1361         Reviewed by Adam.
1362
1363         - turn on unused parameter waring on Mac OS X because it's already on elsewhere
1364
1365         * Configurations/Base.xcconfig: Took out -wno-unused-parameter.
1366
1367         * API/JSNode.c:
1368         * API/JSNodeList.c:
1369         * API/minidom.c:
1370         * API/testapi.c:
1371         Fixed unused variables by using them or marked them with UNUSED_PARAM.
1372
1373         * kjs/CollectorHeapIntrospector.h: (KJS::CollectorHeapIntrospector::zoneCalloc):
1374         Removed parameter names to indicate they are unused.
1375
1376 2007-10-28  Darin Adler  <darin@apple.com>
1377
1378         Reviewed by Maciej.
1379
1380         - fix a storage leak where we ref the UString every time we replace
1381           a ResolveNode with a LocalVarAccessNode
1382
1383         * kjs/identifier.h: (KJS::Identifier::Identifier): Added a constructor
1384         that takes PlacementNewAdopt.
1385
1386         * kjs/nodes.h: (KJS::ResolveNode::ResolveNode): Initialize the ident
1387         with PlacementNewAdopt instead of the old value of ident.
1388
1389         * kjs/ustring.h: (KJS::UString::UString): Added a constructor that
1390         takes PlacementNewAdopt.
1391
1392 2007-10-28  Darin Adler  <darin@apple.com>
1393
1394         - Windows build fix; get rid of unused parameter
1395
1396         * kjs/nodes.cpp: (KJS::ResolveNode::optimizeVariableAccess): Don't pass it.
1397         * kjs/nodes.h: (KJS::LocalVarAccessNode::LocalVarAccessNode): Remove it.
1398         The assertions weren't all that helpful.
1399
1400 2007-10-28  Mark Rowe  <mrowe@apple.com>
1401
1402         Gtk build fix.  Add include of MathExtras.h.
1403
1404         * kjs/string_object.cpp:
1405
1406 2007-10-28  Mark Rowe  <mrowe@apple.com>
1407
1408         Reviewed by Maciej and Tim.
1409
1410         Replace uses of isNaN and isInf with isnan and isinf, and
1411         remove isNaN and isInf.
1412
1413         * kjs/config.h: Remove unused HAVE_'s.
1414         * kjs/date_object.cpp:
1415         (KJS::DateInstance::getTime):
1416         (KJS::DateInstance::getUTCTime):
1417         (KJS::DateProtoFunc::callAsFunction):
1418         (KJS::DateObjectImp::construct):
1419         (KJS::DateObjectFuncImp::callAsFunction):
1420         * kjs/function.cpp:
1421         (KJS::GlobalFuncImp::callAsFunction):
1422         * kjs/math_object.cpp:
1423         (MathFuncImp::callAsFunction):
1424         * kjs/nodes2string.cpp:
1425         (KJS::isParserRoundTripNumber):
1426         * kjs/number_object.cpp:
1427         (NumberProtoFunc::callAsFunction):
1428         * kjs/operations.cpp:
1429         * kjs/operations.h:
1430         * kjs/string_object.cpp:
1431         (KJS::StringProtoFunc::callAsFunction):
1432         * kjs/ustring.cpp:
1433         (KJS::UString::from):
1434         * kjs/value.cpp:
1435         (KJS::JSValue::toInteger):
1436         (KJS::JSValue::toInt32SlowCase):
1437         (KJS::JSValue::toUInt32SlowCase):
1438
1439 2007-10-28  Geoffrey Garen  <ggaren@apple.com>
1440
1441         Build fix: use the new-fangled missingSymbolMarker().
1442
1443         * kjs/nodes.cpp:
1444         (KJS::ResolveNode::optimizeVariableAccess):
1445         * kjs/nodes.h:
1446         (KJS::LocalVarAccessNode::LocalVarAccessNode):
1447
1448 2007-10-28  Geoffrey Garen  <ggaren@apple.com>
1449
1450         Reviewed by Maciej Stachowiak, Darin Adler.
1451         
1452         Much supporting work done by Maciej Stachowiak, Maks Orlovich, and 
1453         Cameron Zwarich.
1454         
1455         AST transfom to replace slow resolve nodes with fast local variable
1456         alternatives that do direct memory access. Currently, only ResolveNode
1457         provides a fast local variable alternative. 6 others are soon to come.
1458         
1459         16.7% speedup on SunSpider.
1460         
1461         Most of this patch is just scaffolding to support iterating all the 
1462         resolve nodes in the AST through optimizeResolveNodes(). In 
1463         optimizeResolveNodes(), most classes just push their child nodes onto 
1464         the processing stack, while ResolveNodes actually replace themselves in 
1465         the tree with more optimized alternatives, if possible.
1466
1467         Here are the interesting bits:
1468
1469         * kjs/nodes.h: Added PlacementNewAdoptTag, along with implementations 
1470         in Node and ResolveNode. This tag allows you to use placement new to 
1471         swap out a base class Node in favor of a subclass copy that holds the
1472         same data. (Without this tag, default initialization would NULL out
1473         RefPtrs, change line numbers, etc.)
1474
1475         * kjs/nodes.cpp:
1476         (KJS::ResolveNode::evaluate): Since we're taking the slow path, ASSERT
1477         that the fast path is impossible, to make sure we didn't leave anything
1478         on the table.
1479
1480         (KJS::FunctionBodyNode::optimizeResolveNodes): Here's where the AST 
1481         transformation happens.
1482         
1483         (KJS::ResolveNode::optimizeResolveNodes): Here's where the ResolveNode
1484         optimization happens.
1485
1486         * kjs/function.h: Added symbolTable() accessor for, for the sake of 
1487         an ASSERT.
1488
1489 2007-10-28  Mark Rowe  <mrowe@apple.com>
1490
1491         Reviewed by Maciej.
1492
1493         Fix "AllInOneFile.o has a global initializer in it".
1494
1495         Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
1496         We can avoid this by moving it inside an inline function.
1497
1498         * kjs/SymbolTable.h:
1499         (KJS::missingSymbolMarker):
1500         * kjs/function.cpp:
1501         (KJS::ActivationImp::getOwnPropertySlot):
1502         (KJS::ActivationImp::put):
1503
1504 2007-10-28  Maciej Stachowiak  <mjs@apple.com>
1505
1506         Reviewed by Mark.
1507         
1508         - Added assertions to protect against adding empty or deleted keys to a HashTable
1509
1510         * wtf/HashTable.h:
1511         (WTF::HashTable::lookup):
1512         (WTF::HashTable::lookupForWriting):
1513         (WTF::HashTable::fullLookupForWriting):
1514         (WTF::HashTable::add):
1515
1516 2007-10-28  Darin Adler  <darin@apple.com>
1517
1518         - fix GTK build
1519
1520         * kjs/nodes2string.cpp: (KJS::isParserRoundTripNumber):
1521         Use isNaN and isInf instead of isnan and isinf.
1522
1523 2007-10-28  Darin Adler  <darin@apple.com>
1524
1525         Reviewed by Maciej.
1526
1527         - http://bugs.webkit.org/show_bug.cgi?id=15735
1528           remove GroupNode to simplify AST and possibly get a modest speedup
1529
1530         This patch removes 4 node types: GroupNode, PropertyNameNode,
1531         FunctionCallParenBracketNode, and FunctionCallParenDotNode.
1532
1533         To remove GroupNode, we add knowledge of precedence to the tree nodes,
1534         and use that when serializing to determine where parentheses are needed.
1535         This means we no longer have to represent parentheses in the tree.
1536
1537         The precedence values are named after productions in the grammar from the
1538         JavaScript standard.
1539
1540         SunSpider says this is an 0.4% speedup.
1541
1542         * kjs/function.h:
1543         * kjs/function.cpp: Removed escapeStringForPrettyPrinting -- it's part of
1544         serialization, so I moved it to the file that takes care of that.
1545
1546         * kjs/grammar.y: Changed makeGetterOrSetterPropertyNode to use 0 to
1547         indicate failure instead of a separate boolean. Got rid of PropertyNameNode
1548         by merging the PropertyName rule into the Property rule (which was easier
1549         than figuring out how to pass the Identifier from one node to another).
1550         Got rid of GroupNode, nodeInsideAllParens(), FunctionCallParenBracketNode,
1551         and FunctionCallParenDotNode.
1552
1553         * kjs/nodes.h: Removed unused forward declarations and Operator values.
1554         Added Precedence enum, and precedence function to all nodes. Removed
1555         nodeInsideAllParens. Added streamBinaryOperator function for serialization.
1556         Removed GroupNode and PropertyNameNode. Made PropertyNode store an Identifier.
1557         Removed FunctionCallParenBracketNode and FunctionCallParenDotNode.
1558
1559         * kjs/nodes.cpp: Removed Node::nodinsideAllParens, GroupNode, and PropertyNameNode.
1560         (KJS::PropertyListNode::evaluate): Changed code to get name directly instead
1561         of converting it from an Identifier to a jsString then back to a UString
1562         then into an Identifier again!
1563
1564         * kjs/nodes2string.cpp: Changed special-token implementation to use a separate
1565         function for each of Endl, Indent, Unindent, and DotExpr instead of using a
1566         single function with a switch. Added a precedence that you can stream in, to
1567         cause the next node serialized to add parentheses based on that precedence value.
1568         (KJS::operatorString): Moved to the top of the file.
1569         (KJS::escapeStringForPrettyPrinting): Moved here from function.cpp. Removed old
1570         workaround for snprintf, since StringExtras.h takes care of that.
1571         (KJS::operator<<): Made the char and char* versions faster by using UString's
1572         character append functions instead of constructing a UString. Added the logic
1573         to the Node* version to add parentheses if needed.
1574         (KJS::Node::streamLeftAssociativeBinaryOperator): Added helper function.
1575         (KJS::ElementNode::streamTo): Use PrecAssignment for the elements.
1576         (KJS::BracketAccessorNode::streamTo): Use PrecCall for the expression before
1577         the bracket.
1578         (KJS::DotAccessorNode::streamTo): Use PrecCall for the expression before the dot.
1579         (KJS::ArgumentListNode::streamTo): Use PrecAssignment for the arguments.
1580         (KJS::NewExprNode::streamTo): Use PrecMember for the expression.
1581         (KJS::FunctionCallValueNode::streamTo): Use PrecCall.
1582         (KJS::FunctionCallBracketNode::streamTo): Ditto.
1583         (KJS::FunctionCallDotNode::streamTo): Ditto.
1584         (KJS::PostfixBracketNode::streamTo): Ditto.
1585         (KJS::PostfixDotNode::streamTo): Ditto.
1586         (KJS::PostfixErrorNode::streamTo): Use PrecLeftHandSide.
1587         (KJS::DeleteBracketNode::streamTo): Use PrecCall.
1588         (KJS::DeleteDotNode::streamTo): Ditto.
1589         (KJS::DeleteValueNode::streamTo): Use PrecUnary.
1590         (KJS::VoidNode::streamTo): Ditto.
1591         (KJS::TypeOfValueNode::streamTo): Ditto.
1592         (KJS::PrefixBracketNode::streamTo): Use PrecCall.
1593         (KJS::PrefixDotNode::streamTo): Ditto.
1594         (KJS::PrefixErrorNode::streamTo): Use PrecUnary.
1595         (KJS::UnaryPlusNode::streamTo): Ditto.
1596         (KJS::NegateNode::streamTo): Ditto.
1597         (KJS::BitwiseNotNode::streamTo): Ditto.
1598         (KJS::LogicalNotNode::streamTo): Ditto.
1599         (KJS::MultNode::streamTo): Use streamLeftAssociativeBinaryOperator.
1600         (KJS::DivNode::streamTo): Ditto.
1601         (KJS::ModNode::streamTo): Ditto.
1602         (KJS::AddNode::streamTo): Ditto.
1603         (KJS::SubNode::streamTo): Ditto.
1604         (KJS::LeftShiftNode::streamTo): Ditto.
1605         (KJS::RightShiftNode::streamTo): Ditto.
1606         (KJS::UnsignedRightShiftNode::streamTo): Ditto.
1607         (KJS::LessNode::streamTo): Ditto.
1608         (KJS::GreaterNode::streamTo): Ditto.
1609         (KJS::LessEqNode::streamTo): Ditto.
1610         (KJS::GreaterEqNode::streamTo): Ditto.
1611         (KJS::InstanceOfNode::streamTo): Ditto.
1612         (KJS::InNode::streamTo): Ditto.
1613         (KJS::EqualNode::streamTo): Ditto.
1614         (KJS::NotEqualNode::streamTo): Ditto.
1615         (KJS::StrictEqualNode::streamTo): Ditto.
1616         (KJS::NotStrictEqualNode::streamTo): Ditto.
1617         (KJS::BitAndNode::streamTo): Ditto.
1618         (KJS::BitXOrNode::streamTo): Ditto.
1619         (KJS::BitOrNode::streamTo): Ditto.
1620         (KJS::LogicalAndNode::streamTo): Ditto.
1621         (KJS::LogicalOrNode::streamTo): Ditto.
1622         (KJS::ConditionalNode::streamTo): Ditto.
1623         (KJS::AssignResolveNode::streamTo): Use PrecAssignment for the right side.
1624         (KJS::AssignBracketNode::streamTo): Use PrecCall for the expression before
1625         the bracket and PrecAssignment for the right side.
1626         (KJS::AssignDotNode::streamTo): Ditto.
1627         (KJS::AssignErrorNode::streamTo): Use PrecLeftHandSide for the left side
1628         and PrecAssignment for the right side.
1629         (KJS::CommaNode::streamTo): Use PrecAssignment for both expressions.
1630         (KJS::AssignExprNode::streamTo): Use PrecAssignment.
1631
1632 2007-10-28  Kevin Ollivier  <kevino@theolliviers.com>
1633
1634         Define wx port and set wx port USE options.
1635
1636         Reviewed by Adam Roben.
1637
1638         * wtf/Platform.h:
1639
1640 2007-10-28  Mark Rowe  <mrowe@apple.com>
1641
1642         We don't include "config.h" in headers.
1643
1644         * bindings/jni/jni_instance.h:
1645         * kjs/regexp.h:
1646         * wtf/TCPageMap.h:
1647         * wtf/TCSpinLock.h:
1648
1649 2007-10-28  Maciej Stachowiak  <mjs@apple.com>
1650
1651         Rubber stamped by Mark.
1652         
1653         - avoid using non-portable SIZE_T_MAX in favor of std::numeric_limits
1654
1655         * kjs/SymbolTable.h:
1656         (KJS::SymbolTableIndexHashTraits::emptyValue):
1657         * kjs/function.cpp:
1658         (KJS::ActivationImp::getOwnPropertySlot):
1659         (KJS::ActivationImp::put):
1660
1661 2007-10-28  Maciej Stachowiak  <mjs@apple.com>
1662
1663         Reviewed by Eric.
1664         
1665         - switch SymbolTable to be a HashMap instead of a PropertyMap for 3% SunSpider speedup
1666
1667         * kjs/SymbolTable.h:
1668         (KJS::IdentifierRepHash::hash): Special hash function for identifier reps.
1669         (KJS::IdentifierRepHash::equal): ditto
1670         (KJS::SymbolTableIndexHashTraits::emptyValue): Special HashTraits for the index value.
1671         (KJS::SymbolTable): change to a typedef for a HashMap.
1672         * kjs/function.cpp:
1673         (KJS::ActivationImp::getOwnPropertySlot): Adjusted for new SymbolTable API.
1674         (KJS::ActivationImp::deleteProperty): ditto
1675         (KJS::ActivationImp::put): ditto
1676
1677         * kjs/nodes.cpp:
1678         (KJS::FunctionBodyNode::initializesymbolTable): Adjusted, since
1679         you now have to store a UString::rep, not an identifier.
1680
1681 2007-10-27  Maciej Stachowiak  <mjs@apple.com>
1682
1683         Reviewed by Oliver.
1684         
1685         - numerous HashTable performance improvements
1686         
1687         This does not quite add up to a measurable win on SunSpider, but it allows a
1688         follow-on > 3% improvement and probably helps WebCore too.
1689         
1690         I made the following improvements, among others:
1691         
1692         - Made HashFunctions note whether it is ok to compare a real value with the equal() function
1693         to the empty or deleted value, and used this to optimize the comparisons done in hash lookup.
1694         
1695         - Specialized lookup so it doesn't have to do so many extra branches and build so many extra
1696         std::pairs for cases that don't need them. There are now four versions, one for read-only access,
1697         two for writing, and one folded directly into add() (these all were improvments).
1698         
1699         - Made HashMap::get() use lookup() directly instead of find() to avoid having to build iterators.
1700         
1701         - Made a special constructor for iterators that knows it points to
1702         a valid filled cell and so skips updating itself.
1703
1704         - Reordered memory accesses in the various lookup functions for better code generation
1705         
1706         - Made simple translators avoid passing a hash code around
1707         
1708         - Other minor tweaks
1709         
1710         * wtf/HashTable.h:
1711         (WTF::):
1712         (WTF::HashTableConstIterator::HashTableConstIterator):
1713         (WTF::HashTableIterator::HashTableIterator):
1714         (WTF::IdentityHashTranslator::translate):
1715         (WTF::HashTable::end):
1716         (WTF::HashTable::lookup):
1717         (WTF::HashTable::lookupForWriting):
1718         (WTF::HashTable::makeKnownGoodIterator):
1719         (WTF::HashTable::makeKnownGoodConstIterator):
1720         (WTF::::lookup):
1721         (WTF::::lookupForWriting):
1722         (WTF::::fullLookupForWriting):
1723         (WTF::::add):
1724         (WTF::::addPassingHashCode):
1725         (WTF::::reinsert):
1726         (WTF::::find):
1727         (WTF::::contains):
1728         * kjs/identifier.cpp:
1729         (WTF::):
1730         * wtf/HashFunctions.h:
1731         (WTF::):
1732         * wtf/HashMap.h:
1733         (WTF::):
1734         (WTF::::get):
1735         * wtf/HashSet.h:
1736         (WTF::):
1737         (WTF::::add):
1738         * wtf/ListHashSet.h:
1739         (WTF::ListHashSetTranslator::translate):
1740
1741 2007-10-27  Darin Adler  <darin@apple.com>
1742
1743         Reviewed by Eric.
1744
1745         - fix ASCIICType.h for some Windows compiles
1746
1747         * wtf/ASCIICType.h: Check the compiler, not the OS, since it's the
1748         compiler/library that has the wchar_t that is just a typedef.
1749
1750 2007-10-27  Kevin McCullough  <kmccullough@apple.com>
1751
1752         - BuildFix
1753         - Forgot to change the build step when I changed the filename.
1754
1755         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1756
1757 2007-10-27  Geoffrey Garen  <ggaren@apple.com>
1758
1759         Reviewed by Darin Adler.
1760         
1761         Fixed the rest of "ASSERTION FAILED: _hash in KJS::UString::Rep::
1762         computedHash()"
1763         http://bugs.webkit.org/show_bug.cgi?id=15718
1764
1765         * kjs/identifier.cpp: Fixed more cases where an Identifier didn't get a 
1766         hash value. Also changed O(n) strlen to O(1) check for empty string.
1767         (KJS::Identifier::add):
1768
1769         * kjs/ustring.cpp: Changed O(n) strlens to O(1) checks for empty string.
1770         (KJS::UString::UString):
1771         (KJS::UString::operator=):
1772
1773 2007-10-27  Darin Adler  <darin@apple.com>
1774
1775         Reviewed by Eric.
1776
1777         - fix pow on Windows
1778
1779         * wtf/MathExtras.h: (wtf_pow): Add a special case for MSVC, which has
1780         a "pow" function that does not properly handle the case where arg1 is
1781         NaN and arg2 is 0.
1782
1783         * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Don't explicity
1784         specify "::pow" -- just "pow" is fine.
1785
1786 2007-10-27  Darin Adler  <darin@apple.com>
1787
1788         Reviewed by Maciej.
1789
1790         - http://bugs.webkit.org/show_bug.cgi?id=15711
1791           force JSImmediate to be inlined for roughly 1.2% SunSpider speedup
1792
1793         * kjs/JSImmediate.h: Put ALWAYS_INLINE on everything.
1794
1795         * kjs/object.h: Removed redundant includes.
1796         * kjs/value.h: Ditto.
1797
1798 2007-10-27  Maciej Stachowiak  <mjs@apple.com>
1799
1800         Reviewed by Mark.
1801         
1802         - fixed "ASSERTION FAILED: _hash in KJS::UString::Rep::computedHash()"
1803         http://bugs.webkit.org/show_bug.cgi?id=15718
1804
1805         * kjs/identifier.cpp:
1806         (KJS::Identifier::addSlowCase): Ensure that empty Identifiers have a hash computed,
1807         now that we count on all Identifiers already having one.
1808
1809 2007-10-27  Mark Rowe  <mrowe@apple.com>
1810
1811         Silence a warning.
1812
1813         * kjs/SymbolTable.h:
1814
1815 2007-10-27  Mark Rowe  <mrowe@apple.com>
1816
1817         Gtk build fix.
1818
1819         * kjs/function.h:
1820
1821 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
1822
1823        Rubber stamp by Adam. 
1824
1825         - Renamed JSStringRefCOM to JSStringRefBSTR since it he only thing the
1826         files contain are functions that operate on BSTRs.
1827
1828         * API/JSStringRefBSTR.cpp: Copied from API/JSStringRefCOM.cpp.
1829         * API/JSStringRefBSTR.h: Copied from API/JSStringRefCOM.h.
1830         * API/JSStringRefCOM.cpp: Removed.
1831         * API/JSStringRefCOM.h: Removed.
1832         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1833
1834 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
1835
1836         Reviewed by Adam.
1837
1838         - Made JSStringCreateWithBSTR capable of handling null BSTRs.
1839
1840         * API/JSStringRefCOM.cpp:
1841         (JSStringCreateWithBSTR):
1842
1843 2007-10-26  Sam Weinig  <sam@webkit.org>
1844
1845         Windows build fix.
1846
1847         * kjs/SymbolTable.h: Add header gaurd.
1848         * kjs/nodes.h: #include "SymbolTable.h"
1849
1850 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
1851
1852         Suggested by Anders Carlsson.
1853         
1854         Fixed tyop.
1855
1856         * kjs/function.cpp:
1857         (KJS::ActivationImp::getOwnPropertySlot):
1858
1859 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
1860
1861         Suggested by Darin Adler.
1862         
1863         Use computedHash(), which is safer than just directly accessing _hash.
1864
1865         * kjs/lookup.cpp:
1866         (KJS::Lookup::findEntry):
1867         (KJS::Lookup::find):
1868
1869 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
1870
1871         Build fix: svn add SymbolTable.h
1872
1873         * kjs/SymbolTable.h: Added.
1874         (KJS::SymbolTable::set):
1875         (KJS::SymbolTable::get):
1876
1877 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
1878
1879         Build fix: export SymbolTable.h to WebCore.
1880
1881         * JavaScriptCore.xcodeproj/project.pbxproj:
1882
1883 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
1884
1885         Comment tweak suggested by Maciej.
1886
1887         * kjs/function.cpp:
1888         (KJS::ActivationImp::getOwnPropertySlot):
1889
1890 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
1891
1892         Reviewed by Maciej Stachowiak.
1893         
1894         Tweaked property maps to remove 2 branches. 2.5% speedup on SunSpider.
1895
1896         * kjs/property_map.cpp: Use a special no branch accessor to the UString's
1897         hash value. Also, return immediately instead of branching to the end
1898         of the loop if the value is not found.
1899         (KJS::PropertyMap::get):
1900         (KJS::PropertyMap::getLocation):
1901         (KJS::PropertyMap::put):
1902         (KJS::PropertyMap::insert):
1903         (KJS::PropertyMap::remove):
1904         (KJS::PropertyMap::checkConsistency):
1905
1906         * kjs/ustring.h:
1907         (KJS::UString::Rep::computedHash): Special no branch accessor to the
1908         UString's hash value. Used when the caller knows that the hash value
1909         has already been computed. (For example, if the caller got the UString
1910         from an Identifier.)
1911
1912 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
1913
1914         Reviewed by Maciej Stachowiak.
1915         
1916         Switched ActivationImp to using a symbol table. For now, though, all
1917         clients take the slow path.
1918         
1919         Net .6% speedup on SunSpider.
1920         
1921         Slowdowns:
1922             - ActivationImp now mallocs in its constructor
1923             - Local variable hits use an extra level of indirection to retrieve 
1924             data
1925             - Local variable misses do two lookups
1926
1927         Speedups:
1928             - Fast initialization of local variables upon function entry
1929
1930         * JavaScriptCore.xcodeproj/project.pbxproj: Added SymbolTable.h
1931         
1932         * kjs/function.cpp:
1933         (KJS::ActivationImp::ActivationImp): Malloc a private structure to hold
1934         data that won't fit in a JSCell.
1935         (KJS::ActivationImp::argumentsGetter): Use slow symbol table path for 
1936         lookup.
1937         (KJS::ActivationImp::getOwnPropertySlot): ditto
1938         (KJS::ActivationImp::deleteProperty): ditto
1939         (KJS::ActivationImp::put): ditto
1940         (KJS::ActivationImp::createArgumentsObject): ditto
1941
1942         (KJS::ActivationImp::mark): Call JSObject::mark first so that one of
1943         our properties doesn't try to recursively mark us. (This caused a crash
1944         in earlier testing. Not sure why we haven't run into it before.)
1945
1946         * kjs/nodes.cpp: Functions now build a symbol table the first time 
1947         they're called.
1948         (KJS::VarDeclNode::evaluate):
1949         (KJS::FunctionBodyNode::FunctionBodyNode):
1950         (KJS::FunctionBodyNode::initializeSymbolTable):
1951         (KJS::FunctionBodyNode::processDeclarations):
1952         (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
1953         (KJS::FunctionBodyNode::processDeclarationsForProgramCode):
1954
1955         * kjs/nodes.h:
1956         (KJS::FunctionBodyNode::symbolTable):
1957
1958         * wtf/Forward.h: Added Vector.
1959
1960 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
1961
1962         - Corrected function name mistake in this changelog.
1963
1964 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
1965         Reviewed by Sam and Steve.
1966
1967         - Added convenience methods for converting between BSTR and JSStringRefs
1968
1969         * API/JSStringRefCOM.cpp: Added.
1970         (JSStringCreateWithBSTR):
1971         (JSStringCopyBSTR):
1972         * API/JSStringRefCOM.h: Added.
1973         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1974
1975 2007-10-26  Mark Rowe  <mrowe@apple.com>
1976
1977         Windows build fix.
1978
1979         * kjs/collector.cpp:
1980         (KJS::Collector::collect):
1981
1982 2007-10-26  Oliver Hunt  <oliver@apple.com>
1983
1984         Reviewed by Maciej.
1985
1986         Make the JSC GC use a separate heap for JSNumbers to get a 0.7-1.4% progression in SunSpider.
1987
1988         * kjs/CollectorHeapIntrospector.cpp:
1989         (KJS::CollectorHeapIntrospector::init):
1990         (KJS::CollectorHeapIntrospector::enumerate):
1991         * kjs/CollectorHeapIntrospector.h:
1992         * kjs/collector.cpp:
1993         (KJS::Collector::recordExtraCost):
1994         (KJS::Collector::heapAllocate):
1995         (KJS::Collector::allocate):
1996         (KJS::Collector::allocateNumber):
1997         (KJS::Collector::registerThread):
1998         (KJS::Collector::markStackObjectsConservatively):
1999         (KJS::Collector::markMainThreadOnlyObjects):
2000         (KJS::Collector::sweep):
2001         (KJS::Collector::collect):
2002         * kjs/collector.h:
2003         * kjs/internal.h:
2004         (KJS::NumberImp::operator new):
2005           Force numbers to be allocated in the secondary heap.
2006
2007 2007-10-26  Maciej Stachowiak  <mjs@apple.com>
2008
2009         Reviewed by Oliver.
2010         
2011         - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
2012
2013         * kjs/value.h:
2014         (KJS::JSValue::getUInt32):
2015         (KJS::JSValue::getTruncatedInt32):
2016         (KJS::JSValue::toNumber):
2017         * wtf/PassRefPtr.h:
2018         (WTF::PassRefPtr::~PassRefPtr):
2019         * wtf/RefPtr.h:
2020         (WTF::RefPtr::operator->):
2021
2022 2007-10-26  Mark Rowe  <mrowe@apple.com>
2023
2024         Gtk build fix.
2025
2026         * kjs/ExecState.h:
2027
2028 2007-10-26  Maciej Stachowiak  <mjs@apple.com>
2029
2030         Reviewed by Mark.
2031
2032         - Merge Context class fully into ExecState, since they are always created and used together.
2033
2034         No measurable performance impact but this is a useful cleanup.
2035
2036         * JavaScriptCore.pri:
2037         * kjs/ExecState.cpp:
2038         (KJS::ExecState::ExecState):
2039         (KJS::ExecState::~ExecState):
2040         (KJS::ExecState::mark):
2041         (KJS::ExecState::lexicalInterpreter):
2042         * kjs/ExecState.h:
2043         (KJS::ExecState::dynamicInterpreter):
2044         (KJS::ExecState::setException):
2045         (KJS::ExecState::clearException):
2046         (KJS::ExecState::exception):
2047         (KJS::ExecState::exceptionSlot):
2048         (KJS::ExecState::hadException):
2049         (KJS::ExecState::scopeChain):
2050         (KJS::ExecState::callingExecState):
2051         (KJS::ExecState::propertyNames):
2052         * kjs/collector.cpp:
2053         (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2054         * kjs/function.cpp:
2055         (KJS::FunctionImp::callAsFunction):
2056         (KJS::FunctionImp::argumentsGetter):
2057         (KJS::FunctionImp::callerGetter):
2058         (KJS::GlobalFuncImp::callAsFunction):
2059         * kjs/interpreter.cpp:
2060         (KJS::Interpreter::Interpreter):
2061         (KJS::Interpreter::init):
2062         (KJS::Interpreter::evaluate):
2063         (KJS::Interpreter::mark):
2064         * kjs/interpreter.h:
2065         (KJS::Interpreter::setCurrentExec):
2066         (KJS::Interpreter::currentExec):
2067         * kjs/nodes.cpp:
2068         (KJS::currentSourceId):
2069         (KJS::currentSourceURL):
2070         (KJS::ThisNode::evaluate):
2071         (KJS::ResolveNode::evaluate):
2072         (KJS::FunctionCallResolveNode::evaluate):
2073         (KJS::PostfixResolveNode::evaluate):
2074         (KJS::DeleteResolveNode::evaluate):
2075         (KJS::TypeOfResolveNode::evaluate):
2076         (KJS::PrefixResolveNode::evaluate):
2077         (KJS::AssignResolveNode::evaluate):
2078         (KJS::VarDeclNode::evaluate):
2079         (KJS::DoWhileNode::execute):
2080         (KJS::WhileNode::execute):
2081         (KJS::ForNode::execute):
2082         (KJS::ForInNode::execute):
2083         (KJS::ContinueNode::execute):
2084         (KJS::BreakNode::execute):
2085         (KJS::ReturnNode::execute):
2086         (KJS::WithNode::execute):
2087         (KJS::SwitchNode::execute):
2088         (KJS::LabelNode::execute):
2089         (KJS::TryNode::execute):
2090         (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2091         (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2092         (KJS::FunctionBodyNode::processDeclarations):
2093         (KJS::FuncDeclNode::makeFunction):
2094         (KJS::FuncExprNode::evaluate):
2095
2096 2007-10-26  Mark Rowe  <mrowe@apple.com>
2097
2098         Windows build fix.
2099
2100         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2101
2102 2007-10-26  Mark Rowe  <mrowe@apple.com>
2103
2104         Gtk build fix.
2105
2106         * JavaScriptCore.pri:
2107         * kjs/ExecState.cpp:
2108
2109 2007-10-26  Maciej Stachowiak  <mjs@apple.com>
2110
2111         Reviewed by Oliver.
2112         
2113         - moved Context class into ExecState.{h,cpp} in preparation for merging 
2114         ExecState and Context classes.
2115
2116         * kjs/ExecState.h: Moved CodeType enum and Context class here in
2117         preparation for merging ExecState and Context.
2118         * kjs/ExecState.cpp: Moved Context class here from Context.cpp.
2119         (KJS::Context::Context):
2120         (KJS::Context::~Context):
2121         (KJS::Context::mark):
2122         * kjs/context.h: Removed.
2123         * kjs/Context.cpp: Removed.
2124         * kjs/function.h: Removed CodeType enum.
2125         * kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
2126         * kjs/internal.h: Removed LabelStack.
2127         * JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
2128         * kjs/collector.cpp: Fixed includes.
2129         * kjs/function.cpp: ditto
2130         * kjs/internal.cpp: ditto
2131         * kjs/interpreter.cpp: ditto
2132         * kjs/lookup.h: ditto
2133         * kjs/nodes.cpp: ditto
2134
2135 2007-10-26  Mark Rowe  <mrowe@apple.com>
2136
2137         Windows build fix.
2138
2139         * kjs/string_object.cpp:
2140         (KJS::StringObjectFuncImp::callAsFunction):
2141
2142 2007-10-25  Darin Adler  <darin@apple.com>
2143
2144         Reviewed by Maciej.
2145
2146         - http://bugs.webkit.org/show_bug.cgi?id=15703
2147           fix numeric functions -- improve correctness and speed
2148
2149         Gives about 1% gain on SunSpider.
2150
2151         * kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
2152         (KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
2153         with both immediate and number values.
2154         (KJS::JSValue::toUInt32): Ditto.
2155         * kjs/value.cpp:
2156         (KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
2157         differences. One is that it now correctly returns 0 for NaN, and another is that
2158         there's no special case for 0 or infinity, since the general case already handles
2159         those correctly.
2160         (KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
2161         check for NaN.
2162         (KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
2163         truncation done by the typecast already does the necessary truncation that
2164         roundValue was doing.
2165         (KJS::JSValue::toUInt32SlowCase): Ditto.
2166         (KJS::JSValue::toUInt16): Removed.
2167
2168         * kjs/internal.h: Removed roundValue.
2169         * kjs/internal.cpp: Ditto.
2170
2171         * kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
2172         code to handle NaN in Array.slice; toInteger now never returns NaN as specified.
2173
2174         * kjs/date_object.cpp:
2175         (KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
2176         toNumber as specified.
2177         (KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
2178         with a call to toNumber and timeClip as specified.
2179         (KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
2180         where the default behavior of toInt32 (returning 0) was already correct. Replaced
2181         call to roundValue with a call to toNumber as specified.
2182         (KJS::DateObjectFuncImp::callAsFunction): Ditto.
2183
2184         * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
2185         cases for the pow function that the library already handles correctly.
2186
2187         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
2188         call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
2189         The real toInteger now returns 0 for NaN. Took out unneeded special case in
2190         ToFixed for undefined; was only needed because our toInteger was wrong. Same
2191         thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.
2192
2193         * kjs/string_object.cpp:
2194         (KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
2195         cases for undefined that were only needed because toInteger was wrong. Same in
2196         IndexOf, and was able to remove some special cases. In LastIndexOf, used
2197         toIntegerPreserveNaN, but was able to remove some special cases there too.
2198         Changed Substr implementation to preserve correct behavior with the change
2199         to toInteger and match the specification. Also made sure we weren't converting
2200         an out of range double to an int.
2201         (KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
2202         toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
2203         no reason to have toUInt16 as a second, less-optimized function that's only
2204         called at this one call site.
2205
2206         * wtf/MathExtras.h: Added trunc function for Windows.
2207
2208 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
2209
2210         Reviewed by Maciej Stachowiak.
2211         
2212         Tweaked the inner hashtable lookup loop to remove a branch in the "not 
2213         found" case. .5% speedup on SunSpider.
2214
2215         * JavaScriptCore.xcodeproj/project.pbxproj:
2216         * wtf/HashTable.h:
2217         (WTF::::lookup):
2218
2219 2007-10-25  Maciej Stachowiak  <mjs@apple.com>
2220
2221         Reviewed by Oliver.
2222
2223         - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider
2224
2225         * kjs/nodes.cpp:
2226         (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
2227         adding any value over toNumber() here.
2228         (KJS::valueForReadModifyAssignment): Ditto.
2229         (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
2230         and branches.
2231         (KJS::lessThanEq): Ditto.
2232         * JavaScriptCore.exp: Export new functions as needed.
2233         * kjs/value.h:
2234         (KJS::JSValue::toPrimitive): Fixed formatting.
2235         (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
2236         to number and tells you whether a toPrimitive() conversion with a Number hint
2237         would have given a string.
2238         * kjs/internal.cpp:
2239         (KJS::StringImp::getPrimitiveNumber): Implemented. 
2240         (KJS::NumberImp::getPrimitiveNumber): ditto
2241         (KJS::GetterSetterImp::getPrimitiveNumber): ditto
2242         (KJS::StringImp::toPrimitive): Fixed formatting.
2243         (KJS::NumberImp::toPrimitive): ditto
2244         (KJS::GetterSetterImp::toPrimitive): ditto
2245         * kjs/internal.h:
2246         * kjs/object.cpp:
2247         (KJS::JSObject::getPrimitiveNumber): Implemented.
2248         * kjs/object.h:
2249
2250 2007-10-25  Sam Weinig  <sam@webkit.org>
2251
2252         Reviewed by Adam Roben.
2253
2254         Remove JSStringRefCFHack from windows as it is no longer needed.
2255
2256         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2257
2258 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
2259
2260         Reviewed by Oliver Hunt.
2261         
2262         Rolled out my last patch. It turns out that I needed 2 words, not 1,
2263         so it didn't help.
2264
2265 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
2266
2267         Reviewed by Oliver Hunt.
2268         
2269         Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
2270         Shrink the size of an activation object by 1 word
2271         
2272         This is in preparation for adding a symbol table to the activation 
2273         object.
2274         
2275         The basic strategy here is to rely on the mutual exclusion between
2276         the arguments object pointer and the function pointer (you only need
2277         the latter in order to create the former), and store them in the same 
2278         place. The LazyArgumentsObject class encapsulates this strategy.
2279         
2280         Also inlined the ArgumentsImp constructor, for good measure.
2281         
2282         SunSpider reports no regression. Regression tests pass.
2283
2284         * JavaScriptCore.xcodeproj/project.pbxproj:
2285         * kjs/Context.cpp:
2286         (KJS::Context::~Context):
2287         * kjs/function.cpp:
2288         (KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
2289         (KJS::ActivationImp::LazyArgumentsObject::mark):
2290         (KJS::):
2291         (KJS::ActivationImp::argumentsGetter):
2292         (KJS::ActivationImp::mark):
2293         * kjs/function.h:
2294         (KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
2295         (KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
2296         (KJS::ActivationImp::LazyArgumentsObject::resetArguments):
2297         (KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
2298         (KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
2299         (KJS::ActivationImp::LazyArgumentsObject::setFunction):
2300         (KJS::ActivationImp::LazyArgumentsObject::function):
2301         (KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
2302         (KJS::ActivationImp::LazyArgumentsObject::):
2303         (KJS::ActivationImp::ActivationImp::ActivationImp):
2304         (KJS::ActivationImp::resetArguments):
2305
2306 2007-10-25  Adam Roben  <aroben@apple.com>
2307
2308         Change JavaScriptCore.vcproj to use DerivedSources.make
2309
2310         We were trying to emulate the logic of make in
2311         build-generated-files.sh, but we got it wrong. We now use a
2312         build-generated-files very much like the one that WebCore uses to
2313         invoke make.
2314
2315         We also now only have a Debug configuration of dftables which we build
2316         even when doing a Release build of JavaScriptCore. dftables also no
2317         longer has the "_debug" name suffix.
2318
2319         Changes mostly made by Darin, reviewed by me.
2320
2321         * DerivedSources.make: Add a variable to set the extension used for
2322         the dftables executable.
2323         * JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
2324         dftables in Release configurations.
2325         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
2326         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2327            - Updated include path to point to the new location of the derived
2328              sources.
2329            - Modified pre-build event to pass the right arguments to
2330              build-generated-files.sh and not call dftables directly.
2331            - Added the derived source files to the project.
2332            - Removed grammarWrapper.cpp, which isn't needed now that we're
2333              compiling grammar.cpp directly.
2334         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2335         Slightly modified from the WebCore version.
2336         * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
2337         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2338             - Changed the output location to match Mac.
2339             - Removed the Release configuration.
2340             - Removed the _debug suffix.
2341
2342 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
2343
2344         Reviewed by Eric Seidel.
2345         
2346         Slightly elaborated the differences between declaration procesing in 
2347         Function Code and Program Code.
2348         
2349         .3% speedup on SunSpider.
2350
2351         * kjs/nodes.cpp:
2352         (KJS::FunctionBodyNode::processDeclarationsFunctionCode): 
2353         (KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a 
2354         minimum set of attributes instead of recomputing all the time. Also,
2355         ignore m_parameters, since programs don't have arguments.
2356
2357 2007-10-25  Eric Seidel  <eric@webkit.org>
2358
2359         Reviewed by Maciej.
2360         
2361         More preparation work before adding long-running mode to testkjs.
2362
2363         * kjs/testkjs.cpp:
2364         (TestFunctionImp::callAsFunction):
2365         (prettyPrintScript):
2366         (runWithScripts):
2367         (parseArguments):
2368         (kjsmain):
2369         (fillBufferWithContentsOfFile):
2370
2371 2007-10-25  Eric Seidel  <eric@webkit.org>
2372
2373         Reviewed by Maciej.
2374         
2375         Bring testkjs code out of the dark ages in preparation for more
2376         radical improvements (like long-running testing support!)
2377
2378         * kjs/testkjs.cpp:
2379         (TestFunctionImp::callAsFunction):
2380         (setupInterpreter):
2381         (doIt):
2382         (fillBufferWithContentsOfFile):
2383
2384 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
2385
2386         Reviewed by Maciej Stachowiak.
2387         
2388         Make a fast path for declaration processing inside Function Code.
2389         
2390         Lifted declaration processing code up from individual declaration nodes
2391         and into processDeclarations.
2392         
2393         Broke out processDeclarations into two cases, depending on the type of 
2394         code. This eliminates 2 branches, and facilitates more radical 
2395         divergeance in the future.
2396         
2397         2.5% SunSpider speedup.
2398
2399         * JavaScriptCore.xcodeproj/project.pbxproj:
2400         * kjs/nodes.cpp:
2401         (KJS::FunctionBodyNode::initializeDeclarationStacks):
2402         (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
2403         (KJS::FunctionBodyNode::processDeclarationsProgramCode):
2404         (KJS::FunctionBodyNode::execute):
2405         (KJS::FuncDeclNode::makeFunction):
2406         * kjs/nodes.h:
2407         (KJS::):
2408
2409 2007-10-25  Maciej Stachowiak  <mjs@apple.com>
2410
2411         Reviewed by Adam.
2412         
2413         - add header includes needed on platforms that don't use AllInOneFile.cpp
2414
2415         * API/JSCallbackObject.cpp:
2416         * kjs/Context.cpp:
2417         * kjs/ExecState.cpp:
2418         * kjs/array_instance.cpp:
2419         * kjs/function_object.cpp:
2420         * kjs/interpreter.cpp:
2421         * kjs/nodes.cpp:
2422
2423 2007-10-25  Eric Seidel  <eric@webkit.org>
2424
2425         Reviewed by Geoff.
2426
2427         * JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private
2428
2429 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
2430
2431         Reviewed by Maciej Stachowiak.
2432         
2433         Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
2434         Re-order declaration initialization to avoid calling hasProperty inside
2435         VarDeclNode::processDeclaration
2436         
2437         .7% speedup on SunSpider.
2438
2439         * kjs/function.h:
2440         * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
2441         other processing of declared symbols, so the order of execution could 
2442         change.
2443
2444         * kjs/nodes.cpp:
2445         (KJS::VarDeclNode::getDeclarations): Added special case for the 
2446         "arguments" property name, explained in the comment.
2447
2448         (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
2449         in the case of function code, since we know the declared symbol
2450         management will resolve conflicts between symbols. Yay!
2451
2452         (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's 
2453         implementation of getDeclarations is non-trivial, we can't take a 
2454         short-cut here any longer -- we need to put the VarDecl node on the 
2455         stack so it gets processed normally.
2456
2457         (KJS::FunctionBodyNode::processDeclarations): Changed the order of 
2458         processing to enforce mutual exclusion rules.
2459
2460         * kjs/nodes.h:
2461         (KJS::DeclarationStacks::DeclarationStacks): Structure includes an 
2462         ExecState now, for fast access to the "arguments" property name.
2463
2464 2007-10-24  Eric Seidel  <eric@webkit.org>
2465
2466         Reviewed by Maciej.
2467         
2468         Add a JSGlobalObject class and remove the InterpreterMap
2469         http://bugs.webkit.org/show_bug.cgi?id=15681
2470         
2471         This required making JSCallbackObject a template class to allow for
2472         JSGlobalObjects with JSCallbackObject functionality.
2473         
2474         SunSpider claims this was a 0.5% speedup.
2475
2476         * API/JSCallbackObject.cpp:
2477         (KJS::):
2478         * API/JSCallbackObject.h:
2479         * API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
2480         (KJS::::JSCallbackObject):
2481         (KJS::::init):
2482         (KJS::::~JSCallbackObject):
2483         (KJS::::initializeIfNeeded):
2484         (KJS::::className):
2485         (KJS::::getOwnPropertySlot):
2486         (KJS::::put):
2487         (KJS::::deleteProperty):
2488         (KJS::::implementsConstruct):
2489         (KJS::::construct):
2490         (KJS::::implementsHasInstance):
2491         (KJS::::hasInstance):
2492         (KJS::::implementsCall):
2493         (KJS::::callAsFunction):
2494         (KJS::::getPropertyNames):
2495         (KJS::::toNumber):
2496         (KJS::::toString):
2497         (KJS::::setPrivate):
2498         (KJS::::getPrivate):
2499         (KJS::::inherits):
2500         (KJS::::cachedValueGetter):
2501         (KJS::::staticValueGetter):
2502         (KJS::::staticFunctionGetter):
2503         (KJS::::callbackGetter):
2504         * API/JSClassRef.cpp:
2505         (OpaqueJSClass::prototype):
2506         * API/JSContextRef.cpp:
2507         (JSGlobalContextCreate):
2508         * API/JSObjectRef.cpp:
2509         (JSObjectMake):
2510         (JSObjectGetPrivate):
2511         (JSObjectSetPrivate):
2512         * API/JSValueRef.cpp:
2513         (JSValueIsObjectOfClass):
2514         * JavaScriptCore.exp:
2515         * JavaScriptCore.xcodeproj/project.pbxproj:
2516         * bindings/c/c_utility.cpp:
2517         (KJS::Bindings::convertValueToNPVariant):
2518         * bindings/jni/jni_jsobject.cpp:
2519         * bindings/objc/objc_utility.mm:
2520         (KJS::Bindings::convertValueToObjcValue):
2521         * kjs/Context.cpp:
2522         (KJS::Context::Context):
2523         * kjs/ExecState.cpp:
2524         (KJS::ExecState::lexicalInterpreter):
2525         * kjs/JSGlobalObject.h: Added.
2526         (KJS::JSGlobalObject::JSGlobalObject):
2527         (KJS::JSGlobalObject::isGlobalObject):
2528         (KJS::JSGlobalObject::interpreter):
2529         (KJS::JSGlobalObject::setInterpreter):
2530         * kjs/array_instance.cpp:
2531         * kjs/context.h:
2532         * kjs/function.cpp:
2533         (KJS::FunctionImp::callAsFunction):
2534         (KJS::GlobalFuncImp::callAsFunction):
2535         * kjs/interpreter.cpp:
2536         (KJS::Interpreter::Interpreter):
2537         (KJS::Interpreter::init):
2538         (KJS::Interpreter::~Interpreter):
2539         (KJS::Interpreter::globalObject):
2540         (KJS::Interpreter::initGlobalObject):
2541         (KJS::Interpreter::evaluate):
2542         * kjs/interpreter.h:
2543         * kjs/lookup.h:
2544         (KJS::cacheGlobalObject):
2545         * kjs/object.h:
2546         (KJS::JSObject::isGlobalObject):
2547         * kjs/testkjs.cpp:
2548
2549 2007-10-24  Eric Seidel  <eric@webkit.org>
2550
2551         Build fix for Gtk, no review.
2552
2553         * kjs/collector.cpp: #include "context.h"
2554
2555 2007-10-24  Eric Seidel  <eric@webkit.org>
2556
2557         Reviewed by Maciej.
2558         
2559         Stop checking isOutOfMemory after every allocation, instead let the collector
2560         notify all ExecStates if we ever hit this rare condition.
2561         
2562         SunSpider claims this was a 2.2% speedup.
2563
2564         * kjs/collector.cpp:
2565         (KJS::Collector::collect):
2566         (KJS::Collector::reportOutOfMemoryToAllInterpreters):
2567         * kjs/collector.h:
2568         * kjs/nodes.cpp:
2569         (KJS::TryNode::execute):
2570
2571 2007-10-24  Mark Rowe  <mrowe@apple.com>
2572
2573         Gtk build fix.
2574
2575         * kjs/identifier.h:  Remove extra qualification.
2576
2577 2007-10-24  Geoffrey Garen  <ggaren@apple.com>
2578
2579         Reviewed by Sam Weinig.
2580         
2581         Disable ALWAYS_INLINE in debug builds, since it drives the debugger
2582         crazy.
2583
2584         * wtf/AlwaysInline.h:
2585
2586 2007-10-24  Geoffrey Garen  <ggaren@apple.com>
2587
2588         Reviewed by Sam Weinig.
2589         
2590         Inlined the fast path for creating an Identifier from an Identifier. 
2591         
2592         This is a .4% speedup on SunSpider overall, but as big as a 2.5% 
2593         speedup on certain individual tests. 65% of the Identifiers creating 
2594         by SunSpider are already Identifiers.
2595         
2596         (The main reason I'm making this change is that it resolves a large
2597         regression in a patch I haven't checked in yet.)
2598
2599         * JavaScriptCore.exp:
2600         * kjs/identifier.cpp:
2601         (KJS::Identifier::addSlowCase):
2602         * kjs/identifier.h:
2603         (KJS::Identifier::Identifier::add):
2604
2605 2007-10-24  Lars Knoll  <lars@trolltech.com>
2606
2607         Reviewed by Simon.
2608
2609         some changes to the way JS values are converted to Qt values in the script bindings. Added support for converting JS arrays into QStringList's.
2610
2611         * bindings/qt/qt_instance.cpp:
2612         (KJS::Bindings::QtInstance::invokeMethod):
2613         * bindings/qt/qt_runtime.cpp:
2614         (KJS::Bindings::convertValueToQVariant):
2615         (KJS::Bindings::QtField::setValueToInstance):
2616
2617 2007-10-24  Oliver Hunt  <oliver@apple.com>
2618
2619         Reviewed by Darin.
2620
2621         Remove old relation method, replace with specialised LessThan and lessThenEq functions for a 0.5-0.6% improvement in SunSpider
2622
2623         * kjs/nodes.cpp:
2624         (KJS::lessThan):
2625         (KJS::lessThanEq):
2626         (KJS::LessNode::evaluate):
2627         (KJS::GreaterNode::evaluate):
2628         (KJS::LessEqNode::evaluate):
2629         (KJS::GreaterEqNode::evaluate):
2630         * kjs/operations.cpp:
2631         * kjs/operations.h:
2632
2633 2007-10-24  Eric Seidel  <eric@webkit.org>
2634
2635         Reviewed by darin.
2636
2637         * kjs/nodes.h:
2638         (KJS::ImmediateNumberNode::): Fix ASSERT correctness (and debug build!)
2639
2640 2007-10-24  Darin Adler  <darin@apple.com>
2641
2642         Reviewed by Eric.
2643
2644         * kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little
2645         Identifier ref/deref for what SunSpider claims is a 0.4% speedup.
2646
2647 2007-10-24  Darin Adler  <darin@apple.com>
2648
2649         Reviewed by Maciej.
2650
2651         - separate out the code to create a hash table the first time from the code
2652           to rehash
2653
2654         SunSpider claims this was a 0.7% speedup.
2655
2656         * kjs/property_map.cpp:
2657         (KJS::PropertyMap::expand): Changed to call either createTable or rehash.
2658         (KJS::PropertyMap::createTable): Added. For the case where we had no table.
2659         (KJS::PropertyMap::rehash): Removed code needed only in the case where we
2660         had no table.
2661         * kjs/property_map.h: Added createTable.
2662
2663 2007-10-24  Eric Seidel  <eric@webkit.org>
2664
2665         Reviewed by darin.
2666         
2667         Add ImmediateNumberNode to hold a JSValue* instead of a double for numbers
2668         which can be represented by JSImmediate.
2669         
2670         SunSpider claims this was a 0.6% speedup.
2671
2672         * kjs/grammar.y:
2673         * kjs/nodes.cpp:
2674         (KJS::NumberNode::evaluate):
2675         (KJS::ImmediateNumberNode::evaluate):
2676         * kjs/nodes.h:
2677         (KJS::Node::):
2678         (KJS::ImmediateNumberNode::):
2679         * kjs/nodes2string.cpp:
2680         (ImmediateNumberNode::streamTo):
2681
2682 2007-10-24  Darin Adler  <darin@apple.com>
2683
2684         Reviewed by Maciej.
2685
2686         - http://bugs.webkit.org/show_bug.cgi?id=15657
2687           change static hash tables to use powers of two for speed
2688
2689         Seems to give 0.7% SunSpider speedup.
2690
2691         * kjs/create_hash_table: Updated to generate new format.
2692         * kjs/lookup.cpp:
2693         (KJS::keysMatch): Took out unneeded typecast.
2694         (KJS::findEntry): Updated to expect table type 3 -- changed the printf to a plain old assert.
2695         Replaced the modulus with a bit mask.
2696         (KJS::Lookup::findEntry): Get the hash directly, since we know identifiers already have computed
2697         their hash -- saves a branch.
2698         (KJS::Lookup::find): Ditto.
2699         * kjs/lookup.h: Changed attr from 2-byte value to one-byte value. Replaced hashSize with hashSizeMask.
2700
2701 2007-10-24  Maciej Stachowiak  <mjs@apple.com>
2702
2703         Reviewed by Darin.
2704         
2705         - remove KJS_CHECKEXCEPTIONs in places where exceptions can't happen for 0.6% SunSpider speedup
2706
2707         * kjs/nodes.cpp:
2708         (KJS::DoWhileNode::execute):
2709         (KJS::WhileNode::execute):
2710         (KJS::ForNode::execute):
2711         (KJS::ForInNode::execute):
2712         (KJS::SourceElementsNode::execute):
2713
2714 2007-10-23  Darin Adler  <darin@apple.com>
2715
2716         Reviewed by Maciej.
2717
2718         * kjs/JSImmediate.h: (KJS::JSImmediate::getUInt32):
2719         Changed an && to an & for a 1% gain in SunSpider.
2720
2721 2007-10-23  Oliver Hunt  <oliver@apple.com>
2722
2723         Reviewed by Maciej.
2724
2725         Reduce branching in implementations of some operator implementations, yielding 1.3% boost to SunSpider.
2726
2727         * kjs/nodes.cpp:
2728         (KJS::MultNode::evaluate):
2729         (KJS::DivNode::evaluate):
2730         (KJS::ModNode::evaluate):
2731         (KJS::add):
2732         (KJS::sub):
2733         (KJS::AddNode::evaluate):
2734         (KJS::SubNode::evaluate):
2735         (KJS::valueForReadModifyAssignment):
2736         * kjs/operations.cpp:
2737         * kjs/operations.h:
2738
2739 2007-10-23  Oliver Hunt  <oliver@apple.com>
2740
2741         Reviewed by Maciej.
2742
2743         Separating all of the simple (eg. non-read-modify-write) binary operators
2744         into separate classes in preparation for further JS optimisations.
2745         
2746         Happily this produces a 0.8% to 1.0% performance increase in SunSpider with
2747         no further work.
2748
2749         * JavaScriptCore.xcodeproj/project.pbxproj:
2750         * kjs/grammar.y:
2751         * kjs/nodes.cpp:
2752         (KJS::MultNode::evaluate):
2753         (KJS::DivNode::evaluate):
2754         (KJS::ModNode::evaluate):
2755         (KJS::AddNode::evaluate):
2756         (KJS::SubNode::evaluate):
2757         (KJS::LeftShiftNode::evaluate):
2758         (KJS::RightShiftNode::evaluate):
2759         (KJS::UnsignedRightShiftNode::evaluate):
2760         (KJS::LessNode::evaluate):
2761         (KJS::GreaterNode::evaluate):
2762         (KJS::LessEqNode::evaluate):
2763         (KJS::GreaterEqNode::evaluate):
2764         (KJS::InstanceOfNode::evaluate):
2765         (KJS::InNode::evaluate):
2766         (KJS::EqualNode::evaluate):
2767         (KJS::NotEqualNode::evaluate):
2768         (KJS::StrictEqualNode::evaluate):
2769         (KJS::NotStrictEqualNode::evaluate):
2770         (KJS::BitAndNode::evaluate):
2771         (KJS::BitXOrNode::evaluate):
2772         (KJS::BitOrNode::evaluate):
2773         (KJS::LogicalAndNode::evaluate):
2774         (KJS::LogicalOrNode::evaluate):
2775         * kjs/nodes.h:
2776         (KJS::MultNode::):
2777         (KJS::DivNode::):
2778         (KJS::ModNode::):
2779         (KJS::AddNode::):
2780         (KJS::SubNode::):
2781         (KJS::LeftShiftNode::):
2782         (KJS::RightShiftNode::):
2783         (KJS::UnsignedRightShiftNode::):
2784         (KJS::LessNode::):
2785         (KJS::GreaterNode::):
2786         (KJS::LessEqNode::):
2787         (KJS::GreaterEqNode::):
2788         (KJS::InstanceOfNode::):
2789         (KJS::InNode::):
2790         (KJS::EqualNode::):
2791         (KJS::NotEqualNode::):
2792         (KJS::StrictEqualNode::):
2793         (KJS::NotStrictEqualNode::):
2794         (KJS::BitAndNode::):
2795         (KJS::BitOrNode::):
2796         (KJS::BitXOrNode::):
2797         (KJS::LogicalAndNode::):
2798         (KJS::LogicalOrNode::):
2799         * kjs/nodes2string.cpp:
2800         (MultNode::streamTo):
2801         (DivNode::streamTo):
2802         (ModNode::streamTo):
2803         (AddNode::streamTo):
2804         (SubNode::streamTo):
2805         (LeftShiftNode::streamTo):
2806         (RightShiftNode::streamTo):
2807         (UnsignedRightShiftNode::streamTo):
2808         (LessNode::streamTo):
2809         (GreaterNode::streamTo):
2810         (LessEqNode::streamTo):
2811         (GreaterEqNode::streamTo):
2812         (InstanceOfNode::streamTo):
2813         (InNode::streamTo):
2814         (EqualNode::streamTo):
2815         (NotEqualNode::streamTo):
2816         (StrictEqualNode::streamTo):
2817         (NotStrictEqualNode::streamTo):
2818         (BitAndNode::streamTo):
2819         (BitXOrNode::streamTo):
2820         (BitOrNode::streamTo):
2821         (LogicalAndNode::streamTo):
2822
2823 2007-10-23  Darin Adler  <darin@apple.com>
2824
2825         Reviewed by Maciej.
2826
2827         - fix http://bugs.webkit.org/show_bug.cgi?id=15639
2828           fix Math.abs(0), Math.ceil(-0), and Math.floor(-0)
2829
2830         Test: fast/js/math.html
2831
2832         * kjs/math_object.cpp: (MathFuncImp::callAsFunction):
2833         Fix abs to look at the sign bit. Add a special case for values in the range
2834         between -0 and -1 and a special case for ceil and for -0 for floor.
2835
2836 2007-10-23  Darin Adler  <darin@apple.com>
2837
2838         Reviewed by Eric.
2839
2840         - streamline exception handling code for a >1% speed-up of SunSpider
2841
2842         * kjs/nodes.cpp: Changed macros to use functions for everything that's not
2843         part of normal execution. We'll take function call overhead when propagating
2844         an exception or out of memory.
2845         (KJS::createOutOfMemoryCompletion): Added.
2846         (KJS::substitute): Use append instead of the relatively inefficient + operator.
2847         (KJS::Node::rethrowException): Added.
2848         * kjs/nodes.h: Added rethrowException.
2849
2850 2007-10-22  Darin Adler  <darin@apple.com>
2851
2852         Reviewed by Maciej.
2853
2854         - fix http://bugs.webkit.org/show_bug.cgi?id=15636
2855           some JavaScriptCore regression tests are failing due to numeric conversion
2856
2857         This should restore correctness and make speed better too, restoring some
2858         of the optimization we lost in my last check-in.
2859
2860         * kjs/JSImmediate.h:
2861         (KJS::JSImmediate::getTruncatedInt32): Added. Uses the range checking idiom
2862         I used in my patch yesterday.
2863         (KJS::JSImmediate::getTruncatedUInt32): Ditto.
2864
2865         * kjs/internal.h: Removed getInt32 and added getTruncatedInt/UInt32.
2866         * kjs/internal.cpp:
2867         (KJS::NumberImp::getUInt32): Changed to always use double, since I can't find
2868         a way to write this more efficiently for float.
2869         (KJS::NumberImp::getTruncatedInt32): Added.
2870         (KJS::NumberImp::getTruncatedUInt32): Added.
2871
2872         * kjs/value.h: Removed getInt32 and added getTruncatedInt/UInt32.
2873         (KJS::JSValue::getUInt32):
2874         (KJS::JSValue::getTruncatedInt32): Added.
2875         (KJS::JSValue::getTruncatedUInt32): Added.
2876         (KJS::JSValue::toInt32): Changed getInt32 call to getTruncatedInt32.
2877         (KJS::JSValue::toUInt32): Changed getUInt32 call to getTruncatedUInt32.
2878         * kjs/value.cpp:
2879         (KJS::JSCell::getTruncatedInt32): Added.
2880         (KJS::JSCell::getTruncatedUInt32): Added.
2881         (KJS::JSValue::toInteger): Changed getUInt32 call to getTruncatedInt32.
2882         (KJS::JSValue::toInt32SlowCase): Removed extra getInt32 call I accidentally
2883         had left in here.
2884         (KJS::JSValue::toUInt32SlowCase): Ditto.
2885         (KJS::JSValue::toUInt16): Changed getUInt32 call to getTruncatedUInt32.
2886
2887         * JavaScriptCore.exp: Updated.
2888
2889 2007-10-22  Darin Adler  <darin@apple.com>
2890
2891         Reviewed by Geoff.
2892
2893         - fix http://bugs.webkit.org/show_bug.cgi?id=15632
2894           js1_5/Array/array-001.js test failing
2895
2896         One of the JavaScriptCore tests was failing; it failed because of
2897         my change to NumberImp::getUInt32. The incorrect code I copied was
2898         from JSImmediate::getUInt32, and was a pre-existing bug.
2899
2900         This patch fixes correctness, but will surely slow down SunSpider.
2901         We may be able to code this tighter and get the speed back.
2902
2903         * kjs/JSImmediate.h:
2904         (KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
2905         reflect the fact that this function only returns true if the value is
2906         accurate (no fractional part, etc.). Changed code so that it returns
2907         false when the value has a fraction.
2908         (KJS::JSImmediate::getUInt32): Ditto.
2909
2910         * kjs/internal.cpp:
2911         (KJS::NumberImp::getInt32): Changed code so that it returns false when
2912         the value has a fraction. Restores the old behavior.
2913         (KJS::NumberImp::getUInt32): Ditto.
2914
2915         * kjs/value.h:
2916         (KJS::JSValue::getInt32): Updated for name change.
2917         (KJS::JSValue::getUInt32): Ditto.
2918         (KJS::JSValue::toInt32): Ditto.
2919         (KJS::JSValue::toUInt32): Ditto.
2920
2921 2007-10-22  Darin Adler  <darin@apple.com>
2922
2923         Reviewed by Brady.
2924
2925         - fix crash seen when running JavaScriptCore tests
2926
2927         * kjs/array_instance.cpp: (KJS::ArrayInstance::mark):
2928         Copy and paste error: I accidentally had code here that was
2929         making a copy of the HashMap -- that's illegal inside a mark
2930         function and was unnecessary. The other callsite was modifying
2931         the map as it iterated it, but this function is not.
2932
2933 2007-10-22  Maciej Stachowiak  <mjs@apple.com>
2934
2935         Reviewed by Oliver.
2936         
2937         - Avoid moving floats into integer registers in jsNumber() for 3% speedup on SunSpider
2938         http://bugs.webkit.org/show_bug.cgi?id=15627
2939
2940         * kjs/JSImmediate.h:
2941         (KJS::JSImmediate::fromDouble): Avoid moving floats to integer
2942         registers since this is very slow.
2943
2944 2007-10-22  Darin Adler  <darin@apple.com>
2945
2946         Reviewed by Eric Seidel.
2947
2948         - http://bugs.webkit.org/show_bug.cgi?id=15617
2949           improve speed of integer conversions
2950
2951         Makes SunSpider 6% faster.
2952
2953         * kjs/JSImmediate.h: Added toInt32 and toUInt32, with separate versions for
2954         32-bit and 64-bit.
2955         * kjs/value.h:
2956         (KJS::JSValue::getUInt32): Call JSImmediate::toUInt32.
2957
2958         * kjs/internal.h: Added getInt32.
2959         * kjs/internal.cpp:
2960         (KJS::NumberImp::getInt32): Added.
2961         (KJS::NumberImp::getUInt32): Replaced with more-optimal implementation
2962         stolen from JSValue.
2963
2964         * kjs/value.h:
2965         (KJS::jsNumber): Marked ALWAYS_INLINE, because this wasn't getting
2966         inlined.
2967         (KJS::JSValue::getInt32): Added.
2968         (KJS::JSValue::getUInt32): Changed to call the new JSImmediate::toUInt32
2969         to avoid converting from float to double.
2970         (KJS::JSValue::toInt32): Made inline, separated out the slow case.
2971         (KJS::JSValue::toUInt32): Ditto.
2972         * kjs/value.cpp:
2973         (KJS::JSCell::getInt32): Added.
2974         (KJS::JSValue::toInt32SlowCase): Renamed from toInt32. Changed to use the
2975         new getInt32. Added a faster case for in-range numbers.
2976         (KJS::JSValue::toUInt32SlowCase): Ditto.
2977         (KJS::JSValue::toUInt16): Added a faster case for in-range numbers.
2978
2979         * JavaScriptCore.exp: Updated for changes.
2980
2981 2007-10-22  Adam Roben  <aroben@apple.com>
2982
2983         Windows build fix
2984
2985         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn off
2986         warning about implicit conversion to bool.
2987
2988 2007-10-22  Mark Rowe  <mrowe@apple.com>
2989
2990         Gtk build fix.
2991
2992         * kjs/array_instance.cpp:
2993
2994 2007-10-22  Darin Adler  <darin@apple.com>
2995
2996         Reviewed by Maciej.
2997
2998         - http://bugs.webkit.org/show_bug.cgi?id=15606
2999           make cut-off for sparse vs. dense arrays smarter for speed with large arrays
3000
3001         Makes the morph test in SunSpider 26% faster, and the overall
3002         benchmark 3% faster.
3003
3004         This also fixes some small problems we had with the distinction
3005         between nonexistent and undefined values in arrays.
3006
3007         * kjs/array_instance.h: Tweaked formatting and naming.
3008         * kjs/array_instance.cpp: Copied from kjs/array_object.cpp.
3009         (KJS::storageSize): Added. Computes the size of the storage given a vector length.
3010         (KJS::increasedVectorLength): Added. Implements the rule for resizing the vector.
3011         (KJS::isDenseEnoughForVector): Added.
3012         (KJS::ArrayInstance::ArrayInstance): Initialize the new fields.
3013         (KJS::ArrayInstance::~ArrayInstance): Since m_storage is now never 0, delete it.
3014         (KJS::ArrayInstance::getItem): Updated for name changes.
3015         (KJS::ArrayInstance::lengthGetter): Ditto.
3016         (KJS::ArrayInstance::inlineGetOwnPropertySlot): Added. Allows both versions of
3017         getOwnPropertySlot to share more code.
3018         (KJS::ArrayInstance::getOwnPropertySlot): Just refactored, no code change.
3019         (KJS::ArrayInstance::put): Added logic for extending the vector as long as the
3020         array is dense enough. Also keep m_numValuesInVector up to date.
3021         (KJS::ArrayInstance::deleteProperty): Added code to keep m_numValuesInVector
3022         up to date.
3023         (KJS::ArrayInstance::getPropertyNames): Fixed bug where this would omit names
3024         for array indices with undefined values.
3025         (KJS::ArrayInstance::increaseVectorLength): Renamed from resizeStorage. Also
3026         simplified to only handle getting larger.
3027         (KJS::ArrayInstance::setLength): Added code to update m_numValuesInVector, to
3028         zero out the unused part of the vector and to delete the map if it's no longer
3029         needed.
3030         (KJS::ArrayInstance::mark): Tweaked formatting.
3031         (KJS::compareByStringForQSort): Ditto.
3032         (KJS::ArrayInstance::sort): Ditto.
3033         (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
3034         Ditto.
3035         (KJS::compareWithCompareFunctionForQSort): Ditto.
3036         (KJS::ArrayInstance::compactForSorting): Fixed bug where this would turn
3037         undefined values into nonexistent values in some cases.
3038
3039         * kjs/array_object.h: Removed MAX_ARRAY_INDEX.
3040         * kjs/array_object.cpp: Removed ArrayInstance. Moved to a separate file.
3041
3042         * JavaScriptCore.pri: Added array_instance.cpp.
3043         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3044         * kjs/AllInOneFile.cpp: Ditto.
3045
3046 2007-10-22  Andrew Wellington  <proton@wiretapped.net>
3047
3048         Reviewed by Mark Rowe.
3049         
3050         Fix for local database support after r26879
3051         Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set
3052
3053         * Configurations/JavaScriptCore.xcconfig:
3054
3055 2007-10-22  Simon Hausmann  <hausmann@kde.org>
3056
3057         Reviewed by Alp.
3058
3059         Build fix for the non-qmake builds.
3060
3061         * wtf/Platform.h: Default to enabling the database features unless
3062         otherwise specified. (similar to ENABLE_ICONDATABASE)
3063
3064 2007-10-22  Holger Freyther  <zecke@selfish.org>
3065
3066         Reviewed by Simon Hausmann <hausmann@kde.org>.
3067
3068         * Do not build testkjs as an application bundle. This is
3069         needed for run-javascriptcore-tests on OSX.
3070         * Also, based on r26633, allow to test the WebKit/Qt port on OSX.
3071         * Set DYLD_LIBRARY_PATH if it was set in the environment. It must be set
3072         as we do not have -rpath on OSX.
3073
3074         * kjs/testkjs.pro:
3075
3076 2007-10-21  Mark Rowe  <mrowe@apple.com>
3077
3078         Reviewed by Alp.
3079
3080         http://bugs.webkit.org/show_bug.cgi?id=15575
3081         Bug 15575: [GTK] Implement threading using GThread
3082
3083         * wtf/Platform.h: Do not enable pthreads for Gtk.
3084
3085 2007-10-21  Mark Rowe  <mrowe@apple.com>
3086
3087         Reviewed by Mitz.
3088
3089         Fix http://bugs.webkit.org/show_bug.cgi?id=15603
3090         Bug 15603: Regression(r26847): Crash when sorting an empty array from JavaScript
3091
3092         * kjs/array_object.cpp:
3093         (KJS::freeStorage): Reinstate null-check that was removed in r26847.
3094
3095 2007-10-21  Darin Adler  <darin@apple.com>
3096
3097         - fix Windows build
3098
3099         * kjs/array_instance.h: Removed unused ExecState parameter.
3100         * kjs/array_object.cpp:
3101         (KJS::ArrayInstance::put): Ditto.
3102         (KJS::ArrayInstance::setLength): Ditto.
3103
3104 2007-10-21  Darin Adler  <darin@apple.com>
3105
3106         * kjs/array_object.cpp: (KJS::ArrayInstance::put):
3107         Add missing assignment that was causing regression test crash.
3108
3109 2007-10-21  Darin Adler  <darin@apple.com>
3110
3111         Reviewed by Maciej.
3112
3113         - http://bugs.webkit.org/show_bug.cgi?id=15585
3114           speed up sparse arrays by using a custom map
3115     
3116         Speeds up SunSpider by 10%.
3117
3118         * kjs/array_object.cpp:
3119         (allocateStorage): Leave room for an additional pointer.
3120         (reallocateStorage): Ditto.
3121         (freeStorage): Ditto.
3122         (ArrayInstance::~ArrayInstance): Delete the overflow map if present.
3123         (ArrayInstance::getItem): Read values from the overflow map if present.
3124         Removed the check of length, since it slows down the common case.
3125         (ArrayInstance::getOwnPropertySlot): Ditto. Also removed the fallback
3126         to the property map.
3127         (ArrayInstance::put): Write values into the overflow map as needed.
3128         Also create overflow map when needed.
3129         (ArrayInstance::deleteProperty): Remove values from the overflow map
3130         as appropriate.
3131         (ArrayInstance::getPropertyNames): Add a name for each identifier in
3132         the property map. This is extremely inefficient.
3133         (ArrayInstance::setLength): Remove any values in the overflow map
3134         that are past the new length, as we formerly did with the property map.
3135         (ArrayInstance::mark): Mark any values in the overflow map.
3136         (compareByStringForQSort): Removed unneeded undefined case, since
3137         compactForSorting guarantees we will have no undefined values.
3138         (compareWithCompareFunctionForQSort): Ditto.
3139         (ArrayInstance::compactForSorting): Copy all the values out of the
3140         overflow map and destroy it.
3141
3142         * kjs/property_map.h: Removed now-unused getSparseArrayPropertyNames.
3143         * kjs/property_map.cpp: Ditto.
3144
3145 2007-10-20  Darin Adler  <darin@apple.com>
3146
3147         Reviewed by Maciej.
3148
3149         - http://bugs.webkit.org/show_bug.cgi?id=15579
3150           stop churning identifier reference counts copying Completion objects
3151
3152         * kjs/completion.h: Replace the Identifier with an Identifier*.
3153         * kjs/nodes.cpp:
3154         (ForInNode::execute): Update for change to Completion constructor.
3155         (ContinueNode::execute): Ditto.
3156         (BreakNode::execute): Ditto.
3157
3158 2007-10-20  Mark Rowe  <mrowe@apple.com>
3159
3160         Reviewed by Alp.
3161
3162         Gtk changes needed to enable HTML 5 client-side database storage.
3163
3164         * wtf/Platform.h: Have Gtk use pthreads for now.
3165
3166 2007-10-20  Geoffrey Garen  <ggaren@apple.com>
3167
3168         Reviewed by Maciej Stachowiak.
3169
3170         Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
3171         Store gathered declaration nodes in the function body node.
3172         
3173         This means that you only have to gather the declaration nodes the first 
3174         time the function executes. Performance gain of 2.10% on SunSpider, 
3175         0.90% on command-line JS iBench.
3176
3177         * kjs/nodes.cpp: Split declaration stack initialization code off into 
3178         initializeDeclarationStacks().
3179         (FunctionBodyNode::FunctionBodyNode):
3180         (FunctionBodyNode::initializeDeclarationStacks):
3181         (FunctionBodyNode::processDeclarations):
3182
3183         * kjs/nodes.h: Changed DeclarationStacks structure to hold references, 
3184         since the actual Vectors are now stored either on the stack or in the 
3185         function body node.
3186
3187 2007-10-19  Geoffrey Garen  <ggaren@apple.com>
3188
3189         Reviewed by Darin Adler.
3190         
3191         http://bugs.webkit.org/show_bug.cgi?id=15559
3192         Moved processDeclarations call into FunctionBodyNode::execute
3193
3194         To improve encapsulation, moved processDeclarations call into
3195         FunctionBodyNode::execute. Also marked processDeclarations 
3196         ALWAYS_INLINE, since it has only 1 caller now. This is a .71% speedup 
3197         on command-line JS iBench.
3198
3199         * kjs/function.cpp:
3200         (KJS::FunctionImp::callAsFunction):
3201         (KJS::GlobalFuncImp::callAsFunction):
3202         * kjs/function.h:
3203         * kjs/interpreter.cpp:
3204         (KJS::Interpreter::evaluate):
3205         * kjs/nodes.cpp:
3206         (FunctionBodyNode::execute):
3207         * kjs/nodes.h:
3208
3209 2007-10-19  Brady Eidson  <beidson@apple.com>
3210
3211         Reviewed by Sam
3212
3213         Queue -> Deque! and small style tweaks
3214
3215         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3216         * JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
3217         * wtf/Deque.h: Added.
3218         (WTF::DequeNode::DequeNode):
3219         (WTF::Deque::Deque):
3220         (WTF::Deque::~Deque):
3221         (WTF::Deque::size):
3222         (WTF::Deque::isEmpty):
3223         (WTF::Deque::append):
3224         (WTF::Deque::prepend):
3225         (WTF::Deque::first):
3226         (WTF::Deque::last):
3227         (WTF::Deque::removeFirst):
3228         (WTF::Deque::clear):
3229         * wtf/Queue.h: Removed.
3230
3231
3232 2007-10-19  Brady Eidson <beidson@apple.com>
3233
3234         Reviewed by Oliver
3235
3236         Added a simple LinkedList based Queue to wtf
3237         We can make a better, more sophisticated an efficient one later, but have
3238         needed one for some time, now!
3239
3240         * JavaScriptCore.xcodeproj/project.pbxproj:
3241         * wtf/Queue.h: Added.
3242         (WTF::QueueNode::QueueNode):
3243         (WTF::Queue::Queue):
3244         (WTF::Queue::~Queue):
3245         (WTF::Queue::size):
3246         (WTF::Queue::isEmpty):
3247         (WTF::Queue::append):
3248         (WTF::Queue::prepend):
3249         (WTF::Queue::first):
3250         (WTF::Queue::last):
3251         (WTF::Queue::removeFirst):
3252         (WTF::Queue::clear):
3253
3254 2007-10-19  Nikolas Zimmermann  <zimmermann@kde.org>
3255
3256         Reviewed by Anders.
3257
3258         Try to fix Qt/Win build slave, by including windows.h also on Qt/Win.
3259
3260         * kjs/testkjs.cpp: Change PLATFORM(WIN) to PLATFORM(WIN_OS)
3261
3262 2007-10-19  Simon Hausmann  <hausmann@kde.org>
3263
3264         Reviewed by Lars.
3265
3266         Fix compilation on Windows when wchar_t is a typedef instead of a native type (triggered by -Zc:wchar_t-).
3267         Don't provide the wchar_t overloads then as they conflict with the unsigned short ones.
3268
3269         * wtf/ASCIICType.h:
3270         (WTF::isASCIIAlpha):
3271         (WTF::isASCIIAlphanumeric):
3272         (WTF::isASCIIDigit):
3273         (WTF::isASCIIHexDigit):
3274         (WTF::isASCIILower):
3275         (WTF::isASCIISpace):
3276         (WTF::toASCIILower):
3277         (WTF::toASCIIUpper):
3278
3279 2007-10-19  Simon Hausmann  <hausmann@kde.org>
3280
3281         Reviewed by Lars.
3282
3283         Another build fix for the windows/qt build: Apply the same fix as in revision 26686 also to kjs/config.h to disable the disallowctype feature.
3284
3285         * kjs/config.h:
3286
3287 2007-10-18  Maciej Stachowiak  <mjs@apple.com>
3288
3289         Reviewed by Adam.
3290         
3291         - use __declspec(thread) for fast thread-local storage on Windows
3292         
3293         - 2.2% speedup on sunspider (on Windows)
3294         - 7% speedup on the string section
3295         - 6% speedup on JS iBench
3296         
3297         - fixed <rdar://problem/5473084> PLT on Windows got 2.5% slower between r25406 and r25422
3298         - fixed at least some of <rdar://5527965? i-Bench JS was 14% slower in 310A11 than 310A10
3299         
3300         
3301         * wtf/FastMalloc.cpp:
3302         (WTF::getThreadHeap):
3303         (WTF::setThreadHeap):
3304         (WTF::TCMalloc_ThreadCache::GetCache):
3305         (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
3306         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3307
3308 2007-10-17  Darin Adler  <darin@apple.com>
3309
3310         Reviewed by Mark Rowe.
3311
3312         - fix http://bugs.webkit.org/show_bug.cgi?id=15543
3313           <rdar://problem/5545639> REGRESSION (r26697):
3314           GoogleDocs: Can't create new documents or open existing ones
3315
3316         Test: fast/js/regexp-non-character.html
3317
3318         * pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
3319         in the \u sequences -- not needed and actively harmful.
3320
3321 2007-10-17  Anders Carlsson  <andersca@apple.com>
3322
3323         Reviewed by Oliver.
3324
3325         * wtf/Platform.h:
3326         #define USE_PTHREADS on Mac.
3327
3328 2007-10-17  Geoffrey Garen  <ggaren@apple.com>
3329
3330         Reviewed by Darin Adler.
3331         
3332         Merged DeclaredFunctionImp into FunctionImp (the base class) because 
3333         the distinction between the two was unused.
3334         
3335         Removed codeType() from FunctionImp because FunctionImp and its 
3336         subclasses all returned FunctionCode, so it was unused, practically 
3337         speaking.
3338         
3339         Removed a different codeType() from GlobalFuncImp because it was unused.
3340         (Perhaps it was vestigial from a time when GlobalFuncImp used to 
3341         inherit from FunctionImp.)
3342
3343         * bindings/runtime_method.cpp:
3344         * bindings/runtime_method.h:
3345         * kjs/function.cpp:
3346         (KJS::):
3347         (KJS::FunctionImp::FunctionImp):
3348         (KJS::FunctionImp::callAsFunction):
3349         (KJS::FunctionImp::construct):
3350         (KJS::FunctionImp::execute):
3351         (KJS::FunctionImp::processVarDecls):
3352         * kjs/function.h:
3353         (KJS::FunctionImp::implementsConstruct):
3354         (KJS::FunctionImp::scope):
3355         * kjs/function_object.cpp:
3356         (FunctionProtoFunc::callAsFunction):
3357         (FunctionObjectImp::construct):
3358         * kjs/nodes.cpp:
3359         (FuncDeclNode::processFuncDecl):
3360         (FuncExprNode::evaluate):
3361
3362 2007-10-17  Adam Roben  <aroben@apple.com>
3363
3364         Windows build fix part 2.
3365
3366         Fix was by Darin, reviewed by Anders and Adam.
3367
3368         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
3369         FastMallocPCRE.cpp to the project, and let Visual Studio have its way
3370         with the post-build step.
3371         * pcre/pcre.h: Don't DLL export the entry points just because this
3372         is Win32 -- this is an internal copy of PCRE and should be private.
3373         * pcre/pcre_compile.c: Fix an uninitialized variable warning --
3374         there's no real problem but it's better to quiet the compiler by
3375         tweaking the code slightly than turn off the warning entirely.
3376
3377 2007-10-17  Adam Roben  <aroben@apple.com>
3378
3379         Windows build fix.
3380
3381         Reviewed by Anders.
3382
3383         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
3384         some mismatched signed/unsigned comparison warnings.
3385         * pcre/pcre_exec.c:
3386         (match): #if-out some labels that don't seem to exist.
3387
3388 2007-10-17  Mark Rowe  <mrowe@apple.com>
3389
3390         Gtk build fix.
3391
3392         * JavaScriptCore.pri: Add FastMallocPCRE.cpp.
3393         * pcre/pcre_get. #if out two functions that depend on pcre_get_stringnumber, which
3394         is currently unavailable for UTF-16.
3395
3396 2007-10-16  Darin Adler  <darin@apple.com>
3397
3398         Reviewed by Geoff.
3399
3400         - merged PCRE changes between 6.4 and 6.5
3401
3402         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3403         * JavaScriptCore.xcodeproj/project.pbxproj:
3404         Removed pcre_config.c, pcre_globals.c, pcre_info.c, pcre_maketables.c,
3405         pcre_printint.src, pcre_refcount.c, pcre_study.c, pcre_try_flipped.c,
3406         pcre_ucp_findchar.c, pcre_version.c, and ucptable.c. Added pcre_ucp_searchfuncs.c.
3407
3408         * pcre/AUTHORS:
3409         * pcre/LICENCE:
3410         * pcre/MERGING:
3411         * pcre/dftables.c:
3412         * pcre/pcre-config.h:
3413         * pcre/pcre.h:
3414         * pcre/pcre.pri:
3415         * pcre/pcre_compile.c:
3416         * pcre/pcre_exec.c:
3417         * pcre/pcre_fullinfo.c:
3418         * pcre/pcre_get.c:
3419         * pcre/pcre_internal.h:
3420         * pcre/pcre_maketables.c:
3421         * pcre/pcre_ord2utf8.c:
3422         * pcre/pcre_tables.c:
3423         * pcre/pcre_ucp_searchfuncs.c: Copied from pcre/pcre_ucp_findchar.c.
3424         * pcre/pcre_xclass.c:
3425         * pcre/ucp.h:
3426         * pcre/ucpinternal.h:
3427         * pcre/ucptable.c:
3428         Updated with new versions from the PCRE 6.5 release, merged with changes.
3429
3430         * pcre/pcre_config.c: Removed.
3431         * pcre/pcre_globals.c: Removed.
3432         * pcre/pcre_info.c: Removed.
3433         * pcre/pcre_printint.src: Removed.
3434         * pcre/pcre_refcount.c: Removed.
3435         * pcre/pcre_study.c: Removed.
3436         * pcre/pcre_try_flipped.c: Removed.
3437         * pcre/pcre_ucp_findchar.c: Removed.
3438         * pcre/pcre_version.c: Removed.
3439
3440 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
3441
3442         Reviewed by Darin Adler.
3443
3444         Removed KJS_VERBOSE because it was getting in the way of readability, 
3445         and the messages didn't seem very helpful.
3446
3447         * kjs/function.cpp:
3448         (KJS::FunctionImp::callAsFunction):
3449         (KJS::FunctionImp::passInParameters):
3450         * kjs/lookup.h:
3451         (KJS::lookupPut):
3452         * kjs/object.cpp:
3453         (KJS::JSObject::put):
3454         * kjs/value.h:
3455
3456 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
3457
3458         Reviewed by Darin Adler.
3459         
3460         Removed the Parameter class because it was a redundant wrapper around 
3461         Identifier.
3462
3463         * kjs/function.cpp:
3464         (KJS::FunctionImp::passInParameters):
3465         (KJS::FunctionImp::getParameterName):
3466         * kjs/nodes.cpp:
3467         (FunctionBodyNode::addParam):
3468         * kjs/nodes.h:
3469         (KJS::FunctionBodyNode::):
3470
3471 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
3472
3473         Reviewed by Darin Adler.
3474         
3475         Global replace of assert with ASSERT.
3476
3477 2007-10-16  Adam Roben  <aroben@apple.com>
3478
3479         Make testkjs not delay-load WebKit
3480
3481         Soon, delay-loading WebKit will be impossible (because we will be
3482         using __declspec(thread) for thread-local storage). This change
3483         prepares testkjs for the future.
3484
3485         Reviewed by Sam.
3486
3487         * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed WebKitInitializer,
3488         added FindSafari.
3489         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Don't link against
3490         WebKitInitializer, don't delay-load WebKit.
3491         * kjs/testkjs.cpp: Don't use WebKitInitializer.
3492
3493 2007-10-16  Adam Roben  <aroben@apple.com>
3494
3495         Updated testkjs for the rename of WebKit_debug.dll to WebKit.dll for the Debug configuration
3496
3497         Reviewed by Kevin McCullough.
3498
3499         * JavaScriptCore.vcproj/debug.vsprops: Added WebKitDLLConfigSuffix.
3500         * JavaScriptCore.vcproj/debug_internal.vsprops: Ditto.
3501         * JavaScriptCore.vcproj/release.vsprops: Ditto.
3502         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Use
3503         WebKitDLLConfigSuffix when referring to WebKit.dll, and fixed a typo
3504         in the name of icuuc36[_debug].dll.
3505
3506 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
3507
3508         Reviewed by Maciej Stachowiak.
3509         
3510         Re-structured variable and function declaration code.
3511         
3512         Command-line JS iBench shows no regression.
3513         
3514         Here are the changes:
3515
3516         1. Function declarations are now processed at the same time as var 
3517         declarations -- namely, immediately upon entry to an execution context. 
3518         This does not match Firefox, which waits to process a function
3519         declaration until the declaration's containing block executes, but it 
3520         does match IE and the ECMA spec. (10.1.3 states that var and function 
3521         declarations should be processed at the same time -- namely, "On 
3522         entering an execution context." 12.2 states that "A Block does not 
3523         define a new execution scope.")
3524
3525         2. Declaration processing proceeds iteratively now, rather than 
3526         recursively, storing the nodes is finds in stacks. This will later 
3527         facilitate an optimization to hold on to the gathered declaration nodes, 
3528         rather than re-fetching them in every function call. 
3529         [ http://bugs.webkit.org/show_bug.cgi?id=14868 ]
3530
3531         Modified these tests because they expected the incorrect Mozilla 
3532         behavior described above:
3533
3534         * tests/mozilla/ecma_3/Function/scope-001.js:
3535         * tests/mozilla/js1_5/Scope/regress-184107.js:
3536
3537 2007-10-16  Darin Adler  <darin@apple.com>
3538
3539         - try to fix the GTK build
3540
3541         * kjs/ustring.cpp: Include ASCIICType.h, not ASCIICtype.h.
3542
3543 2007-10-16  Darin Adler  <darin@apple.com>
3544
3545         - try to fix the Windows build
3546
3547         * kjs/date_object.cpp: (KJS::parseDate): A couple instances of isspace were
3548         in here. Not sure why it wasn't failing elsewhere. Changed to isASCIISpace.
3549
35