6f43a5baff19cd85cfa34bf0b8ac5b24055ae6ee
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
2
3        Rubber stamp by Adam. 
4
5         - Renamed JSStringRefCOM to JSStringRefBSTR since it he only thing the
6         files contain are functions that operate on BSTRs.
7
8         * API/JSStringRefBSTR.cpp: Copied from API/JSStringRefCOM.cpp.
9         * API/JSStringRefBSTR.h: Copied from API/JSStringRefCOM.h.
10         * API/JSStringRefCOM.cpp: Removed.
11         * API/JSStringRefCOM.h: Removed.
12         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
13
14 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
15
16         Reviewed by Adam.
17
18         - Made JSStringCreateWithBSTR capable of handling null BSTRs.
19
20         * API/JSStringRefCOM.cpp:
21         (JSStringCreateWithBSTR):
22
23 2007-10-26  Sam Weinig  <sam@webkit.org>
24
25         Windows build fix.
26
27         * kjs/SymbolTable.h: Add header gaurd.
28         * kjs/nodes.h: #include "SymbolTable.h"
29
30 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
31
32         Suggested by Anders Carlsson.
33         
34         Fixed tyop.
35
36         * kjs/function.cpp:
37         (KJS::ActivationImp::getOwnPropertySlot):
38
39 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
40
41         Suggested by Darin Adler.
42         
43         Use computedHash(), which is safer than just directly accessing _hash.
44
45         * kjs/lookup.cpp:
46         (KJS::Lookup::findEntry):
47         (KJS::Lookup::find):
48
49 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
50
51         Build fix: svn add SymbolTable.h
52
53         * kjs/SymbolTable.h: Added.
54         (KJS::SymbolTable::set):
55         (KJS::SymbolTable::get):
56
57 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
58
59         Build fix: export SymbolTable.h to WebCore.
60
61         * JavaScriptCore.xcodeproj/project.pbxproj:
62
63 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
64
65         Comment tweak suggested by Maciej.
66
67         * kjs/function.cpp:
68         (KJS::ActivationImp::getOwnPropertySlot):
69
70 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
71
72         Reviewed by Maciej Stachowiak.
73         
74         Tweaked property maps to remove 2 branches. 2.5% speedup on SunSpider.
75
76         * kjs/property_map.cpp: Use a special no branch accessor to the UString's
77         hash value. Also, return immediately instead of branching to the end
78         of the loop if the value is not found.
79         (KJS::PropertyMap::get):
80         (KJS::PropertyMap::getLocation):
81         (KJS::PropertyMap::put):
82         (KJS::PropertyMap::insert):
83         (KJS::PropertyMap::remove):
84         (KJS::PropertyMap::checkConsistency):
85
86         * kjs/ustring.h:
87         (KJS::UString::Rep::computedHash): Special no branch accessor to the
88         UString's hash value. Used when the caller knows that the hash value
89         has already been computed. (For example, if the caller got the UString
90         from an Identifier.)
91
92 2007-10-26  Geoffrey Garen  <ggaren@apple.com>
93
94         Reviewed by Maciej Stachowiak.
95         
96         Switched ActivationImp to using a symbol table. For now, though, all
97         clients take the slow path.
98         
99         Net .6% speedup on SunSpider.
100         
101         Slowdowns:
102             - ActivationImp now mallocs in its constructor
103             - Local variable hits use an extra level of indirection to retrieve 
104             data
105             - Local variable misses do two lookups
106
107         Speedups:
108             - Fast initialization of local variables upon function entry
109
110         * JavaScriptCore.xcodeproj/project.pbxproj: Added SymbolTable.h
111         
112         * kjs/function.cpp:
113         (KJS::ActivationImp::ActivationImp): Malloc a private structure to hold
114         data that won't fit in a JSCell.
115         (KJS::ActivationImp::argumentsGetter): Use slow symbol table path for 
116         lookup.
117         (KJS::ActivationImp::getOwnPropertySlot): ditto
118         (KJS::ActivationImp::deleteProperty): ditto
119         (KJS::ActivationImp::put): ditto
120         (KJS::ActivationImp::createArgumentsObject): ditto
121
122         (KJS::ActivationImp::mark): Call JSObject::mark first so that one of
123         our properties doesn't try to recursively mark us. (This caused a crash
124         in earlier testing. Not sure why we haven't run into it before.)
125
126         * kjs/nodes.cpp: Functions now build a symbol table the first time 
127         they're called.
128         (KJS::VarDeclNode::evaluate):
129         (KJS::FunctionBodyNode::FunctionBodyNode):
130         (KJS::FunctionBodyNode::initializeSymbolTable):
131         (KJS::FunctionBodyNode::processDeclarations):
132         (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
133         (KJS::FunctionBodyNode::processDeclarationsForProgramCode):
134
135         * kjs/nodes.h:
136         (KJS::FunctionBodyNode::symbolTable):
137
138         * wtf/Forward.h: Added Vector.
139
140 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
141
142         - Corrected function name mistake in this changelog.
143
144 2007-10-26  Kevin McCullough  <kmccullough@apple.com>
145         Reviewed by Sam and Steve.
146
147         - Added convenience methods for converting between BSTR and JSStringRefs
148
149         * API/JSStringRefCOM.cpp: Added.
150         (JSStringCreateWithBSTR):
151         (JSStringCopyBSTR):
152         * API/JSStringRefCOM.h: Added.
153         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
154
155 2007-10-26  Mark Rowe  <mrowe@apple.com>
156
157         Windows build fix.
158
159         * kjs/collector.cpp:
160         (KJS::Collector::collect):
161
162 2007-10-26  Oliver Hunt  <oliver@apple.com>
163
164         Reviewed by Maciej.
165
166         Make the JSC GC use a separate heap for JSNumbers to get a 0.7-1.4% progression in SunSpider.
167
168         * kjs/CollectorHeapIntrospector.cpp:
169         (KJS::CollectorHeapIntrospector::init):
170         (KJS::CollectorHeapIntrospector::enumerate):
171         * kjs/CollectorHeapIntrospector.h:
172         * kjs/collector.cpp:
173         (KJS::Collector::recordExtraCost):
174         (KJS::Collector::heapAllocate):
175         (KJS::Collector::allocate):
176         (KJS::Collector::allocateNumber):
177         (KJS::Collector::registerThread):
178         (KJS::Collector::markStackObjectsConservatively):
179         (KJS::Collector::markMainThreadOnlyObjects):
180         (KJS::Collector::sweep):
181         (KJS::Collector::collect):
182         * kjs/collector.h:
183         * kjs/internal.h:
184         (KJS::NumberImp::operator new):
185           Force numbers to be allocated in the secondary heap.
186
187 2007-10-26  Maciej Stachowiak  <mjs@apple.com>
188
189         Reviewed by Oliver.
190         
191         - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
192
193         * kjs/value.h:
194         (KJS::JSValue::getUInt32):
195         (KJS::JSValue::getTruncatedInt32):
196         (KJS::JSValue::toNumber):
197         * wtf/PassRefPtr.h:
198         (WTF::PassRefPtr::~PassRefPtr):
199         * wtf/RefPtr.h:
200         (WTF::RefPtr::operator->):
201
202 2007-10-26  Mark Rowe  <mrowe@apple.com>
203
204         Gtk build fix.
205
206         * kjs/ExecState.h:
207
208 2007-10-26  Maciej Stachowiak  <mjs@apple.com>
209
210         Reviewed by Mark.
211
212         - Merge Context class fully into ExecState, since they are always created and used together.
213
214         No measurable performance impact but this is a useful cleanup.
215
216         * JavaScriptCore.pri:
217         * kjs/ExecState.cpp:
218         (KJS::ExecState::ExecState):
219         (KJS::ExecState::~ExecState):
220         (KJS::ExecState::mark):
221         (KJS::ExecState::lexicalInterpreter):
222         * kjs/ExecState.h:
223         (KJS::ExecState::dynamicInterpreter):
224         (KJS::ExecState::setException):
225         (KJS::ExecState::clearException):
226         (KJS::ExecState::exception):
227         (KJS::ExecState::exceptionSlot):
228         (KJS::ExecState::hadException):
229         (KJS::ExecState::scopeChain):
230         (KJS::ExecState::callingExecState):
231         (KJS::ExecState::propertyNames):
232         * kjs/collector.cpp:
233         (KJS::Collector::reportOutOfMemoryToAllInterpreters):
234         * kjs/function.cpp:
235         (KJS::FunctionImp::callAsFunction):
236         (KJS::FunctionImp::argumentsGetter):
237         (KJS::FunctionImp::callerGetter):
238         (KJS::GlobalFuncImp::callAsFunction):
239         * kjs/interpreter.cpp:
240         (KJS::Interpreter::Interpreter):
241         (KJS::Interpreter::init):
242         (KJS::Interpreter::evaluate):
243         (KJS::Interpreter::mark):
244         * kjs/interpreter.h:
245         (KJS::Interpreter::setCurrentExec):
246         (KJS::Interpreter::currentExec):
247         * kjs/nodes.cpp:
248         (KJS::currentSourceId):
249         (KJS::currentSourceURL):
250         (KJS::ThisNode::evaluate):
251         (KJS::ResolveNode::evaluate):
252         (KJS::FunctionCallResolveNode::evaluate):
253         (KJS::PostfixResolveNode::evaluate):
254         (KJS::DeleteResolveNode::evaluate):
255         (KJS::TypeOfResolveNode::evaluate):
256         (KJS::PrefixResolveNode::evaluate):
257         (KJS::AssignResolveNode::evaluate):
258         (KJS::VarDeclNode::evaluate):
259         (KJS::DoWhileNode::execute):
260         (KJS::WhileNode::execute):
261         (KJS::ForNode::execute):
262         (KJS::ForInNode::execute):
263         (KJS::ContinueNode::execute):
264         (KJS::BreakNode::execute):
265         (KJS::ReturnNode::execute):
266         (KJS::WithNode::execute):
267         (KJS::SwitchNode::execute):
268         (KJS::LabelNode::execute):
269         (KJS::TryNode::execute):
270         (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
271         (KJS::FunctionBodyNode::processDeclarationsProgramCode):
272         (KJS::FunctionBodyNode::processDeclarations):
273         (KJS::FuncDeclNode::makeFunction):
274         (KJS::FuncExprNode::evaluate):
275
276 2007-10-26  Mark Rowe  <mrowe@apple.com>
277
278         Windows build fix.
279
280         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
281
282 2007-10-26  Mark Rowe  <mrowe@apple.com>
283
284         Gtk build fix.
285
286         * JavaScriptCore.pri:
287         * kjs/ExecState.cpp:
288
289 2007-10-26  Maciej Stachowiak  <mjs@apple.com>
290
291         Reviewed by Oliver.
292         
293         - moved Context class into ExecState.{h,cpp} in preparation for merging 
294         ExecState and Context classes.
295
296         * kjs/ExecState.h: Moved CodeType enum and Context class here in
297         preparation for merging ExecState and Context.
298         * kjs/ExecState.cpp: Moved Context class here from Context.cpp.
299         (KJS::Context::Context):
300         (KJS::Context::~Context):
301         (KJS::Context::mark):
302         * kjs/context.h: Removed.
303         * kjs/Context.cpp: Removed.
304         * kjs/function.h: Removed CodeType enum.
305         * kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
306         * kjs/internal.h: Removed LabelStack.
307         * JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
308         * kjs/collector.cpp: Fixed includes.
309         * kjs/function.cpp: ditto
310         * kjs/internal.cpp: ditto
311         * kjs/interpreter.cpp: ditto
312         * kjs/lookup.h: ditto
313         * kjs/nodes.cpp: ditto
314
315 2007-10-26  Mark Rowe  <mrowe@apple.com>
316
317         Windows build fix.
318
319         * kjs/string_object.cpp:
320         (KJS::StringObjectFuncImp::callAsFunction):
321
322 2007-10-25  Darin Adler  <darin@apple.com>
323
324         Reviewed by Maciej.
325
326         - http://bugs.webkit.org/show_bug.cgi?id=15703
327           fix numeric functions -- improve correctness and speed
328
329         Gives about 1% gain on SunSpider.
330
331         * kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
332         (KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
333         with both immediate and number values.
334         (KJS::JSValue::toUInt32): Ditto.
335         * kjs/value.cpp:
336         (KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
337         differences. One is that it now correctly returns 0 for NaN, and another is that
338         there's no special case for 0 or infinity, since the general case already handles
339         those correctly.
340         (KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
341         check for NaN.
342         (KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
343         truncation done by the typecast already does the necessary truncation that
344         roundValue was doing.
345         (KJS::JSValue::toUInt32SlowCase): Ditto.
346         (KJS::JSValue::toUInt16): Removed.
347
348         * kjs/internal.h: Removed roundValue.
349         * kjs/internal.cpp: Ditto.
350
351         * kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
352         code to handle NaN in Array.slice; toInteger now never returns NaN as specified.
353
354         * kjs/date_object.cpp:
355         (KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
356         toNumber as specified.
357         (KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
358         with a call to toNumber and timeClip as specified.
359         (KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
360         where the default behavior of toInt32 (returning 0) was already correct. Replaced
361         call to roundValue with a call to toNumber as specified.
362         (KJS::DateObjectFuncImp::callAsFunction): Ditto.
363
364         * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
365         cases for the pow function that the library already handles correctly.
366
367         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
368         call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
369         The real toInteger now returns 0 for NaN. Took out unneeded special case in
370         ToFixed for undefined; was only needed because our toInteger was wrong. Same
371         thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.
372
373         * kjs/string_object.cpp:
374         (KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
375         cases for undefined that were only needed because toInteger was wrong. Same in
376         IndexOf, and was able to remove some special cases. In LastIndexOf, used
377         toIntegerPreserveNaN, but was able to remove some special cases there too.
378         Changed Substr implementation to preserve correct behavior with the change
379         to toInteger and match the specification. Also made sure we weren't converting
380         an out of range double to an int.
381         (KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
382         toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
383         no reason to have toUInt16 as a second, less-optimized function that's only
384         called at this one call site.
385
386         * wtf/MathExtras.h: Added trunc function for Windows.
387
388 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
389
390         Reviewed by Maciej Stachowiak.
391         
392         Tweaked the inner hashtable lookup loop to remove a branch in the "not 
393         found" case. .5% speedup on SunSpider.
394
395         * JavaScriptCore.xcodeproj/project.pbxproj:
396         * wtf/HashTable.h:
397         (WTF::::lookup):
398
399 2007-10-25  Maciej Stachowiak  <mjs@apple.com>
400
401         Reviewed by Oliver.
402
403         - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider
404
405         * kjs/nodes.cpp:
406         (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
407         adding any value over toNumber() here.
408         (KJS::valueForReadModifyAssignment): Ditto.
409         (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
410         and branches.
411         (KJS::lessThanEq): Ditto.
412         * JavaScriptCore.exp: Export new functions as needed.
413         * kjs/value.h:
414         (KJS::JSValue::toPrimitive): Fixed formatting.
415         (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
416         to number and tells you whether a toPrimitive() conversion with a Number hint
417         would have given a string.
418         * kjs/internal.cpp:
419         (KJS::StringImp::getPrimitiveNumber): Implemented. 
420         (KJS::NumberImp::getPrimitiveNumber): ditto
421         (KJS::GetterSetterImp::getPrimitiveNumber): ditto
422         (KJS::StringImp::toPrimitive): Fixed formatting.
423         (KJS::NumberImp::toPrimitive): ditto
424         (KJS::GetterSetterImp::toPrimitive): ditto
425         * kjs/internal.h:
426         * kjs/object.cpp:
427         (KJS::JSObject::getPrimitiveNumber): Implemented.
428         * kjs/object.h:
429
430 2007-10-25  Sam Weinig  <sam@webkit.org>
431
432         Reviewed by Adam Roben.
433
434         Remove JSStringRefCFHack from windows as it is no longer needed.
435
436         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
437
438 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
439
440         Reviewed by Oliver Hunt.
441         
442         Rolled out my last patch. It turns out that I needed 2 words, not 1,
443         so it didn't help.
444
445 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
446
447         Reviewed by Oliver Hunt.
448         
449         Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
450         Shrink the size of an activation object by 1 word
451         
452         This is in preparation for adding a symbol table to the activation 
453         object.
454         
455         The basic strategy here is to rely on the mutual exclusion between
456         the arguments object pointer and the function pointer (you only need
457         the latter in order to create the former), and store them in the same 
458         place. The LazyArgumentsObject class encapsulates this strategy.
459         
460         Also inlined the ArgumentsImp constructor, for good measure.
461         
462         SunSpider reports no regression. Regression tests pass.
463
464         * JavaScriptCore.xcodeproj/project.pbxproj:
465         * kjs/Context.cpp:
466         (KJS::Context::~Context):
467         * kjs/function.cpp:
468         (KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
469         (KJS::ActivationImp::LazyArgumentsObject::mark):
470         (KJS::):
471         (KJS::ActivationImp::argumentsGetter):
472         (KJS::ActivationImp::mark):
473         * kjs/function.h:
474         (KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
475         (KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
476         (KJS::ActivationImp::LazyArgumentsObject::resetArguments):
477         (KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
478         (KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
479         (KJS::ActivationImp::LazyArgumentsObject::setFunction):
480         (KJS::ActivationImp::LazyArgumentsObject::function):
481         (KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
482         (KJS::ActivationImp::LazyArgumentsObject::):
483         (KJS::ActivationImp::ActivationImp::ActivationImp):
484         (KJS::ActivationImp::resetArguments):
485
486 2007-10-25  Adam Roben  <aroben@apple.com>
487
488         Change JavaScriptCore.vcproj to use DerivedSources.make
489
490         We were trying to emulate the logic of make in
491         build-generated-files.sh, but we got it wrong. We now use a
492         build-generated-files very much like the one that WebCore uses to
493         invoke make.
494
495         We also now only have a Debug configuration of dftables which we build
496         even when doing a Release build of JavaScriptCore. dftables also no
497         longer has the "_debug" name suffix.
498
499         Changes mostly made by Darin, reviewed by me.
500
501         * DerivedSources.make: Add a variable to set the extension used for
502         the dftables executable.
503         * JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
504         dftables in Release configurations.
505         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
506         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
507            - Updated include path to point to the new location of the derived
508              sources.
509            - Modified pre-build event to pass the right arguments to
510              build-generated-files.sh and not call dftables directly.
511            - Added the derived source files to the project.
512            - Removed grammarWrapper.cpp, which isn't needed now that we're
513              compiling grammar.cpp directly.
514         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
515         Slightly modified from the WebCore version.
516         * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
517         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
518             - Changed the output location to match Mac.
519             - Removed the Release configuration.
520             - Removed the _debug suffix.
521
522 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
523
524         Reviewed by Eric Seidel.
525         
526         Slightly elaborated the differences between declaration procesing in 
527         Function Code and Program Code.
528         
529         .3% speedup on SunSpider.
530
531         * kjs/nodes.cpp:
532         (KJS::FunctionBodyNode::processDeclarationsFunctionCode): 
533         (KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a 
534         minimum set of attributes instead of recomputing all the time. Also,
535         ignore m_parameters, since programs don't have arguments.
536
537 2007-10-25  Eric Seidel  <eric@webkit.org>
538
539         Reviewed by Maciej.
540         
541         More preparation work before adding long-running mode to testkjs.
542
543         * kjs/testkjs.cpp:
544         (TestFunctionImp::callAsFunction):
545         (prettyPrintScript):
546         (runWithScripts):
547         (parseArguments):
548         (kjsmain):
549         (fillBufferWithContentsOfFile):
550
551 2007-10-25  Eric Seidel  <eric@webkit.org>
552
553         Reviewed by Maciej.
554         
555         Bring testkjs code out of the dark ages in preparation for more
556         radical improvements (like long-running testing support!)
557
558         * kjs/testkjs.cpp:
559         (TestFunctionImp::callAsFunction):
560         (setupInterpreter):
561         (doIt):
562         (fillBufferWithContentsOfFile):
563
564 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
565
566         Reviewed by Maciej Stachowiak.
567         
568         Make a fast path for declaration processing inside Function Code.
569         
570         Lifted declaration processing code up from individual declaration nodes
571         and into processDeclarations.
572         
573         Broke out processDeclarations into two cases, depending on the type of 
574         code. This eliminates 2 branches, and facilitates more radical 
575         divergeance in the future.
576         
577         2.5% SunSpider speedup.
578
579         * JavaScriptCore.xcodeproj/project.pbxproj:
580         * kjs/nodes.cpp:
581         (KJS::FunctionBodyNode::initializeDeclarationStacks):
582         (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
583         (KJS::FunctionBodyNode::processDeclarationsProgramCode):
584         (KJS::FunctionBodyNode::execute):
585         (KJS::FuncDeclNode::makeFunction):
586         * kjs/nodes.h:
587         (KJS::):
588
589 2007-10-25  Maciej Stachowiak  <mjs@apple.com>
590
591         Reviewed by Adam.
592         
593         - add header includes needed on platforms that don't use AllInOneFile.cpp
594
595         * API/JSCallbackObject.cpp:
596         * kjs/Context.cpp:
597         * kjs/ExecState.cpp:
598         * kjs/array_instance.cpp:
599         * kjs/function_object.cpp:
600         * kjs/interpreter.cpp:
601         * kjs/nodes.cpp:
602
603 2007-10-25  Eric Seidel  <eric@webkit.org>
604
605         Reviewed by Geoff.
606
607         * JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private
608
609 2007-10-25  Geoffrey Garen  <ggaren@apple.com>
610
611         Reviewed by Maciej Stachowiak.
612         
613         Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
614         Re-order declaration initialization to avoid calling hasProperty inside
615         VarDeclNode::processDeclaration
616         
617         .7% speedup on SunSpider.
618
619         * kjs/function.h:
620         * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
621         other processing of declared symbols, so the order of execution could 
622         change.
623
624         * kjs/nodes.cpp:
625         (KJS::VarDeclNode::getDeclarations): Added special case for the 
626         "arguments" property name, explained in the comment.
627
628         (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
629         in the case of function code, since we know the declared symbol
630         management will resolve conflicts between symbols. Yay!
631
632         (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's 
633         implementation of getDeclarations is non-trivial, we can't take a 
634         short-cut here any longer -- we need to put the VarDecl node on the 
635         stack so it gets processed normally.
636
637         (KJS::FunctionBodyNode::processDeclarations): Changed the order of 
638         processing to enforce mutual exclusion rules.
639
640         * kjs/nodes.h:
641         (KJS::DeclarationStacks::DeclarationStacks): Structure includes an 
642         ExecState now, for fast access to the "arguments" property name.
643
644 2007-10-24  Eric Seidel  <eric@webkit.org>
645
646         Reviewed by Maciej.
647         
648         Add a JSGlobalObject class and remove the InterpreterMap
649         http://bugs.webkit.org/show_bug.cgi?id=15681
650         
651         This required making JSCallbackObject a template class to allow for
652         JSGlobalObjects with JSCallbackObject functionality.
653         
654         SunSpider claims this was a 0.5% speedup.
655
656         * API/JSCallbackObject.cpp:
657         (KJS::):
658         * API/JSCallbackObject.h:
659         * API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
660         (KJS::::JSCallbackObject):
661         (KJS::::init):
662         (KJS::::~JSCallbackObject):
663         (KJS::::initializeIfNeeded):
664         (KJS::::className):
665         (KJS::::getOwnPropertySlot):
666         (KJS::::put):
667         (KJS::::deleteProperty):
668         (KJS::::implementsConstruct):
669         (KJS::::construct):
670         (KJS::::implementsHasInstance):
671         (KJS::::hasInstance):
672         (KJS::::implementsCall):
673         (KJS::::callAsFunction):
674         (KJS::::getPropertyNames):
675         (KJS::::toNumber):
676         (KJS::::toString):
677         (KJS::::setPrivate):
678         (KJS::::getPrivate):
679         (KJS::::inherits):
680         (KJS::::cachedValueGetter):
681         (KJS::::staticValueGetter):
682         (KJS::::staticFunctionGetter):
683         (KJS::::callbackGetter):
684         * API/JSClassRef.cpp:
685         (OpaqueJSClass::prototype):
686         * API/JSContextRef.cpp:
687         (JSGlobalContextCreate):
688         * API/JSObjectRef.cpp:
689         (JSObjectMake):
690         (JSObjectGetPrivate):
691         (JSObjectSetPrivate):
692         * API/JSValueRef.cpp:
693         (JSValueIsObjectOfClass):
694         * JavaScriptCore.exp:
695         * JavaScriptCore.xcodeproj/project.pbxproj:
696         * bindings/c/c_utility.cpp:
697         (KJS::Bindings::convertValueToNPVariant):
698         * bindings/jni/jni_jsobject.cpp:
699         * bindings/objc/objc_utility.mm:
700         (KJS::Bindings::convertValueToObjcValue):
701         * kjs/Context.cpp:
702         (KJS::Context::Context):
703         * kjs/ExecState.cpp:
704         (KJS::ExecState::lexicalInterpreter):
705         * kjs/JSGlobalObject.h: Added.
706         (KJS::JSGlobalObject::JSGlobalObject):
707         (KJS::JSGlobalObject::isGlobalObject):
708         (KJS::JSGlobalObject::interpreter):
709         (KJS::JSGlobalObject::setInterpreter):
710         * kjs/array_instance.cpp:
711         * kjs/context.h:
712         * kjs/function.cpp:
713         (KJS::FunctionImp::callAsFunction):
714         (KJS::GlobalFuncImp::callAsFunction):
715         * kjs/interpreter.cpp:
716         (KJS::Interpreter::Interpreter):
717         (KJS::Interpreter::init):
718         (KJS::Interpreter::~Interpreter):
719         (KJS::Interpreter::globalObject):
720         (KJS::Interpreter::initGlobalObject):
721         (KJS::Interpreter::evaluate):
722         * kjs/interpreter.h:
723         * kjs/lookup.h:
724         (KJS::cacheGlobalObject):
725         * kjs/object.h:
726         (KJS::JSObject::isGlobalObject):
727         * kjs/testkjs.cpp:
728
729 2007-10-24  Eric Seidel  <eric@webkit.org>
730
731         Build fix for Gtk, no review.
732
733         * kjs/collector.cpp: #include "context.h"
734
735 2007-10-24  Eric Seidel  <eric@webkit.org>
736
737         Reviewed by Maciej.
738         
739         Stop checking isOutOfMemory after every allocation, instead let the collector
740         notify all ExecStates if we ever hit this rare condition.
741         
742         SunSpider claims this was a 2.2% speedup.
743
744         * kjs/collector.cpp:
745         (KJS::Collector::collect):
746         (KJS::Collector::reportOutOfMemoryToAllInterpreters):
747         * kjs/collector.h:
748         * kjs/nodes.cpp:
749         (KJS::TryNode::execute):
750
751 2007-10-24  Mark Rowe  <mrowe@apple.com>
752
753         Gtk build fix.
754
755         * kjs/identifier.h:  Remove extra qualification.
756
757 2007-10-24  Geoffrey Garen  <ggaren@apple.com>
758
759         Reviewed by Sam Weinig.
760         
761         Disable ALWAYS_INLINE in debug builds, since it drives the debugger
762         crazy.
763
764         * wtf/AlwaysInline.h:
765
766 2007-10-24  Geoffrey Garen  <ggaren@apple.com>
767
768         Reviewed by Sam Weinig.
769         
770         Inlined the fast path for creating an Identifier from an Identifier. 
771         
772         This is a .4% speedup on SunSpider overall, but as big as a 2.5% 
773         speedup on certain individual tests. 65% of the Identifiers creating 
774         by SunSpider are already Identifiers.
775         
776         (The main reason I'm making this change is that it resolves a large
777         regression in a patch I haven't checked in yet.)
778
779         * JavaScriptCore.exp:
780         * kjs/identifier.cpp:
781         (KJS::Identifier::addSlowCase):
782         * kjs/identifier.h:
783         (KJS::Identifier::Identifier::add):
784
785 2007-10-24  Lars Knoll  <lars@trolltech.com>
786
787         Reviewed by Simon.
788
789         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.
790
791         * bindings/qt/qt_instance.cpp:
792         (KJS::Bindings::QtInstance::invokeMethod):
793         * bindings/qt/qt_runtime.cpp:
794         (KJS::Bindings::convertValueToQVariant):
795         (KJS::Bindings::QtField::setValueToInstance):
796
797 2007-10-24  Oliver Hunt  <oliver@apple.com>
798
799         Reviewed by Darin.
800
801         Remove old relation method, replace with specialised LessThan and lessThenEq functions for a 0.5-0.6% improvement in SunSpider
802
803         * kjs/nodes.cpp:
804         (KJS::lessThan):
805         (KJS::lessThanEq):
806         (KJS::LessNode::evaluate):
807         (KJS::GreaterNode::evaluate):
808         (KJS::LessEqNode::evaluate):
809         (KJS::GreaterEqNode::evaluate):
810         * kjs/operations.cpp:
811         * kjs/operations.h:
812
813 2007-10-24  Eric Seidel  <eric@webkit.org>
814
815         Reviewed by darin.
816
817         * kjs/nodes.h:
818         (KJS::ImmediateNumberNode::): Fix ASSERT correctness (and debug build!)
819
820 2007-10-24  Darin Adler  <darin@apple.com>
821
822         Reviewed by Eric.
823
824         * kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little
825         Identifier ref/deref for what SunSpider claims is a 0.4% speedup.
826
827 2007-10-24  Darin Adler  <darin@apple.com>
828
829         Reviewed by Maciej.
830
831         - separate out the code to create a hash table the first time from the code
832           to rehash
833
834         SunSpider claims this was a 0.7% speedup.
835
836         * kjs/property_map.cpp:
837         (KJS::PropertyMap::expand): Changed to call either createTable or rehash.
838         (KJS::PropertyMap::createTable): Added. For the case where we had no table.
839         (KJS::PropertyMap::rehash): Removed code needed only in the case where we
840         had no table.
841         * kjs/property_map.h: Added createTable.
842
843 2007-10-24  Eric Seidel  <eric@webkit.org>
844
845         Reviewed by darin.
846         
847         Add ImmediateNumberNode to hold a JSValue* instead of a double for numbers
848         which can be represented by JSImmediate.
849         
850         SunSpider claims this was a 0.6% speedup.
851
852         * kjs/grammar.y:
853         * kjs/nodes.cpp:
854         (KJS::NumberNode::evaluate):
855         (KJS::ImmediateNumberNode::evaluate):
856         * kjs/nodes.h:
857         (KJS::Node::):
858         (KJS::ImmediateNumberNode::):
859         * kjs/nodes2string.cpp:
860         (ImmediateNumberNode::streamTo):
861
862 2007-10-24  Darin Adler  <darin@apple.com>
863
864         Reviewed by Maciej.
865
866         - http://bugs.webkit.org/show_bug.cgi?id=15657
867           change static hash tables to use powers of two for speed
868
869         Seems to give 0.7% SunSpider speedup.
870
871         * kjs/create_hash_table: Updated to generate new format.
872         * kjs/lookup.cpp:
873         (KJS::keysMatch): Took out unneeded typecast.
874         (KJS::findEntry): Updated to expect table type 3 -- changed the printf to a plain old assert.
875         Replaced the modulus with a bit mask.
876         (KJS::Lookup::findEntry): Get the hash directly, since we know identifiers already have computed
877         their hash -- saves a branch.
878         (KJS::Lookup::find): Ditto.
879         * kjs/lookup.h: Changed attr from 2-byte value to one-byte value. Replaced hashSize with hashSizeMask.
880
881 2007-10-24  Maciej Stachowiak  <mjs@apple.com>
882
883         Reviewed by Darin.
884         
885         - remove KJS_CHECKEXCEPTIONs in places where exceptions can't happen for 0.6% SunSpider speedup
886
887         * kjs/nodes.cpp:
888         (KJS::DoWhileNode::execute):
889         (KJS::WhileNode::execute):
890         (KJS::ForNode::execute):
891         (KJS::ForInNode::execute):
892         (KJS::SourceElementsNode::execute):
893
894 2007-10-23  Darin Adler  <darin@apple.com>
895
896         Reviewed by Maciej.
897
898         * kjs/JSImmediate.h: (KJS::JSImmediate::getUInt32):
899         Changed an && to an & for a 1% gain in SunSpider.
900
901 2007-10-23  Oliver Hunt  <oliver@apple.com>
902
903         Reviewed by Maciej.
904
905         Reduce branching in implementations of some operator implementations, yielding 1.3% boost to SunSpider.
906
907         * kjs/nodes.cpp:
908         (KJS::MultNode::evaluate):
909         (KJS::DivNode::evaluate):
910         (KJS::ModNode::evaluate):
911         (KJS::add):
912         (KJS::sub):
913         (KJS::AddNode::evaluate):
914         (KJS::SubNode::evaluate):
915         (KJS::valueForReadModifyAssignment):
916         * kjs/operations.cpp:
917         * kjs/operations.h:
918
919 2007-10-23  Oliver Hunt  <oliver@apple.com>
920
921         Reviewed by Maciej.
922
923         Separating all of the simple (eg. non-read-modify-write) binary operators
924         into separate classes in preparation for further JS optimisations.
925         
926         Happily this produces a 0.8% to 1.0% performance increase in SunSpider with
927         no further work.
928
929         * JavaScriptCore.xcodeproj/project.pbxproj:
930         * kjs/grammar.y:
931         * kjs/nodes.cpp:
932         (KJS::MultNode::evaluate):
933         (KJS::DivNode::evaluate):
934         (KJS::ModNode::evaluate):
935         (KJS::AddNode::evaluate):
936         (KJS::SubNode::evaluate):
937         (KJS::LeftShiftNode::evaluate):
938         (KJS::RightShiftNode::evaluate):
939         (KJS::UnsignedRightShiftNode::evaluate):
940         (KJS::LessNode::evaluate):
941         (KJS::GreaterNode::evaluate):
942         (KJS::LessEqNode::evaluate):
943         (KJS::GreaterEqNode::evaluate):
944         (KJS::InstanceOfNode::evaluate):
945         (KJS::InNode::evaluate):
946         (KJS::EqualNode::evaluate):
947         (KJS::NotEqualNode::evaluate):
948         (KJS::StrictEqualNode::evaluate):
949         (KJS::NotStrictEqualNode::evaluate):
950         (KJS::BitAndNode::evaluate):
951         (KJS::BitXOrNode::evaluate):
952         (KJS::BitOrNode::evaluate):
953         (KJS::LogicalAndNode::evaluate):
954         (KJS::LogicalOrNode::evaluate):
955         * kjs/nodes.h:
956         (KJS::MultNode::):
957         (KJS::DivNode::):
958         (KJS::ModNode::):
959         (KJS::AddNode::):
960         (KJS::SubNode::):
961         (KJS::LeftShiftNode::):
962         (KJS::RightShiftNode::):
963         (KJS::UnsignedRightShiftNode::):
964         (KJS::LessNode::):
965         (KJS::GreaterNode::):
966         (KJS::LessEqNode::):
967         (KJS::GreaterEqNode::):
968         (KJS::InstanceOfNode::):
969         (KJS::InNode::):
970         (KJS::EqualNode::):
971         (KJS::NotEqualNode::):
972         (KJS::StrictEqualNode::):
973         (KJS::NotStrictEqualNode::):
974         (KJS::BitAndNode::):
975         (KJS::BitOrNode::):
976         (KJS::BitXOrNode::):
977         (KJS::LogicalAndNode::):
978         (KJS::LogicalOrNode::):
979         * kjs/nodes2string.cpp:
980         (MultNode::streamTo):
981         (DivNode::streamTo):
982         (ModNode::streamTo):
983         (AddNode::streamTo):
984         (SubNode::streamTo):
985         (LeftShiftNode::streamTo):
986         (RightShiftNode::streamTo):
987         (UnsignedRightShiftNode::streamTo):
988         (LessNode::streamTo):
989         (GreaterNode::streamTo):
990         (LessEqNode::streamTo):
991         (GreaterEqNode::streamTo):
992         (InstanceOfNode::streamTo):
993         (InNode::streamTo):
994         (EqualNode::streamTo):
995         (NotEqualNode::streamTo):
996         (StrictEqualNode::streamTo):
997         (NotStrictEqualNode::streamTo):
998         (BitAndNode::streamTo):
999         (BitXOrNode::streamTo):
1000         (BitOrNode::streamTo):
1001         (LogicalAndNode::streamTo):
1002
1003 2007-10-23  Darin Adler  <darin@apple.com>
1004
1005         Reviewed by Maciej.
1006
1007         - fix http://bugs.webkit.org/show_bug.cgi?id=15639
1008           fix Math.abs(0), Math.ceil(-0), and Math.floor(-0)
1009
1010         Test: fast/js/math.html
1011
1012         * kjs/math_object.cpp: (MathFuncImp::callAsFunction):
1013         Fix abs to look at the sign bit. Add a special case for values in the range
1014         between -0 and -1 and a special case for ceil and for -0 for floor.
1015
1016 2007-10-23  Darin Adler  <darin@apple.com>
1017
1018         Reviewed by Eric.
1019
1020         - streamline exception handling code for a >1% speed-up of SunSpider
1021
1022         * kjs/nodes.cpp: Changed macros to use functions for everything that's not
1023         part of normal execution. We'll take function call overhead when propagating
1024         an exception or out of memory.
1025         (KJS::createOutOfMemoryCompletion): Added.
1026         (KJS::substitute): Use append instead of the relatively inefficient + operator.
1027         (KJS::Node::rethrowException): Added.
1028         * kjs/nodes.h: Added rethrowException.
1029
1030 2007-10-22  Darin Adler  <darin@apple.com>
1031
1032         Reviewed by Maciej.
1033
1034         - fix http://bugs.webkit.org/show_bug.cgi?id=15636
1035           some JavaScriptCore regression tests are failing due to numeric conversion
1036
1037         This should restore correctness and make speed better too, restoring some
1038         of the optimization we lost in my last check-in.
1039
1040         * kjs/JSImmediate.h:
1041         (KJS::JSImmediate::getTruncatedInt32): Added. Uses the range checking idiom
1042         I used in my patch yesterday.
1043         (KJS::JSImmediate::getTruncatedUInt32): Ditto.
1044
1045         * kjs/internal.h: Removed getInt32 and added getTruncatedInt/UInt32.
1046         * kjs/internal.cpp:
1047         (KJS::NumberImp::getUInt32): Changed to always use double, since I can't find
1048         a way to write this more efficiently for float.
1049         (KJS::NumberImp::getTruncatedInt32): Added.
1050         (KJS::NumberImp::getTruncatedUInt32): Added.
1051
1052         * kjs/value.h: Removed getInt32 and added getTruncatedInt/UInt32.
1053         (KJS::JSValue::getUInt32):
1054         (KJS::JSValue::getTruncatedInt32): Added.
1055         (KJS::JSValue::getTruncatedUInt32): Added.
1056         (KJS::JSValue::toInt32): Changed getInt32 call to getTruncatedInt32.
1057         (KJS::JSValue::toUInt32): Changed getUInt32 call to getTruncatedUInt32.
1058         * kjs/value.cpp:
1059         (KJS::JSCell::getTruncatedInt32): Added.
1060         (KJS::JSCell::getTruncatedUInt32): Added.
1061         (KJS::JSValue::toInteger): Changed getUInt32 call to getTruncatedInt32.
1062         (KJS::JSValue::toInt32SlowCase): Removed extra getInt32 call I accidentally
1063         had left in here.
1064         (KJS::JSValue::toUInt32SlowCase): Ditto.
1065         (KJS::JSValue::toUInt16): Changed getUInt32 call to getTruncatedUInt32.
1066
1067         * JavaScriptCore.exp: Updated.
1068
1069 2007-10-22  Darin Adler  <darin@apple.com>
1070
1071         Reviewed by Geoff.
1072
1073         - fix http://bugs.webkit.org/show_bug.cgi?id=15632
1074           js1_5/Array/array-001.js test failing
1075
1076         One of the JavaScriptCore tests was failing; it failed because of
1077         my change to NumberImp::getUInt32. The incorrect code I copied was
1078         from JSImmediate::getUInt32, and was a pre-existing bug.
1079
1080         This patch fixes correctness, but will surely slow down SunSpider.
1081         We may be able to code this tighter and get the speed back.
1082
1083         * kjs/JSImmediate.h:
1084         (KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
1085         reflect the fact that this function only returns true if the value is
1086         accurate (no fractional part, etc.). Changed code so that it returns
1087         false when the value has a fraction.
1088         (KJS::JSImmediate::getUInt32): Ditto.
1089
1090         * kjs/internal.cpp:
1091         (KJS::NumberImp::getInt32): Changed code so that it returns false when
1092         the value has a fraction. Restores the old behavior.
1093         (KJS::NumberImp::getUInt32): Ditto.
1094
1095         * kjs/value.h:
1096         (KJS::JSValue::getInt32): Updated for name change.
1097         (KJS::JSValue::getUInt32): Ditto.
1098         (KJS::JSValue::toInt32): Ditto.
1099         (KJS::JSValue::toUInt32): Ditto.
1100
1101 2007-10-22  Darin Adler  <darin@apple.com>
1102
1103         Reviewed by Brady.
1104
1105         - fix crash seen when running JavaScriptCore tests
1106
1107         * kjs/array_instance.cpp: (KJS::ArrayInstance::mark):
1108         Copy and paste error: I accidentally had code here that was
1109         making a copy of the HashMap -- that's illegal inside a mark
1110         function and was unnecessary. The other callsite was modifying
1111         the map as it iterated it, but this function is not.
1112
1113 2007-10-22  Maciej Stachowiak  <mjs@apple.com>
1114
1115         Reviewed by Oliver.
1116         
1117         - Avoid moving floats into integer registers in jsNumber() for 3% speedup on SunSpider
1118         http://bugs.webkit.org/show_bug.cgi?id=15627
1119
1120         * kjs/JSImmediate.h:
1121         (KJS::JSImmediate::fromDouble): Avoid moving floats to integer
1122         registers since this is very slow.
1123
1124 2007-10-22  Darin Adler  <darin@apple.com>
1125
1126         Reviewed by Eric Seidel.
1127
1128         - http://bugs.webkit.org/show_bug.cgi?id=15617
1129           improve speed of integer conversions
1130
1131         Makes SunSpider 6% faster.
1132
1133         * kjs/JSImmediate.h: Added toInt32 and toUInt32, with separate versions for
1134         32-bit and 64-bit.
1135         * kjs/value.h:
1136         (KJS::JSValue::getUInt32): Call JSImmediate::toUInt32.
1137
1138         * kjs/internal.h: Added getInt32.
1139         * kjs/internal.cpp:
1140         (KJS::NumberImp::getInt32): Added.
1141         (KJS::NumberImp::getUInt32): Replaced with more-optimal implementation
1142         stolen from JSValue.
1143
1144         * kjs/value.h:
1145         (KJS::jsNumber): Marked ALWAYS_INLINE, because this wasn't getting
1146         inlined.
1147         (KJS::JSValue::getInt32): Added.
1148         (KJS::JSValue::getUInt32): Changed to call the new JSImmediate::toUInt32
1149         to avoid converting from float to double.
1150         (KJS::JSValue::toInt32): Made inline, separated out the slow case.
1151         (KJS::JSValue::toUInt32): Ditto.
1152         * kjs/value.cpp:
1153         (KJS::JSCell::getInt32): Added.
1154         (KJS::JSValue::toInt32SlowCase): Renamed from toInt32. Changed to use the
1155         new getInt32. Added a faster case for in-range numbers.
1156         (KJS::JSValue::toUInt32SlowCase): Ditto.
1157         (KJS::JSValue::toUInt16): Added a faster case for in-range numbers.
1158
1159         * JavaScriptCore.exp: Updated for changes.
1160
1161 2007-10-22  Adam Roben  <aroben@apple.com>
1162
1163         Windows build fix
1164
1165         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn off
1166         warning about implicit conversion to bool.
1167
1168 2007-10-22  Mark Rowe  <mrowe@apple.com>
1169
1170         Gtk build fix.
1171
1172         * kjs/array_instance.cpp:
1173
1174 2007-10-22  Darin Adler  <darin@apple.com>
1175
1176         Reviewed by Maciej.
1177
1178         - http://bugs.webkit.org/show_bug.cgi?id=15606
1179           make cut-off for sparse vs. dense arrays smarter for speed with large arrays
1180
1181         Makes the morph test in SunSpider 26% faster, and the overall
1182         benchmark 3% faster.
1183
1184         This also fixes some small problems we had with the distinction
1185         between nonexistent and undefined values in arrays.
1186
1187         * kjs/array_instance.h: Tweaked formatting and naming.
1188         * kjs/array_instance.cpp: Copied from kjs/array_object.cpp.
1189         (KJS::storageSize): Added. Computes the size of the storage given a vector length.
1190         (KJS::increasedVectorLength): Added. Implements the rule for resizing the vector.
1191         (KJS::isDenseEnoughForVector): Added.
1192         (KJS::ArrayInstance::ArrayInstance): Initialize the new fields.
1193         (KJS::ArrayInstance::~ArrayInstance): Since m_storage is now never 0, delete it.
1194         (KJS::ArrayInstance::getItem): Updated for name changes.
1195         (KJS::ArrayInstance::lengthGetter): Ditto.
1196         (KJS::ArrayInstance::inlineGetOwnPropertySlot): Added. Allows both versions of
1197         getOwnPropertySlot to share more code.
1198         (KJS::ArrayInstance::getOwnPropertySlot): Just refactored, no code change.
1199         (KJS::ArrayInstance::put): Added logic for extending the vector as long as the
1200         array is dense enough. Also keep m_numValuesInVector up to date.
1201         (KJS::ArrayInstance::deleteProperty): Added code to keep m_numValuesInVector
1202         up to date.
1203         (KJS::ArrayInstance::getPropertyNames): Fixed bug where this would omit names
1204         for array indices with undefined values.
1205         (KJS::ArrayInstance::increaseVectorLength): Renamed from resizeStorage. Also
1206         simplified to only handle getting larger.
1207         (KJS::ArrayInstance::setLength): Added code to update m_numValuesInVector, to
1208         zero out the unused part of the vector and to delete the map if it's no longer
1209         needed.
1210         (KJS::ArrayInstance::mark): Tweaked formatting.
1211         (KJS::compareByStringForQSort): Ditto.
1212         (KJS::ArrayInstance::sort): Ditto.
1213         (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1214         Ditto.
1215         (KJS::compareWithCompareFunctionForQSort): Ditto.
1216         (KJS::ArrayInstance::compactForSorting): Fixed bug where this would turn
1217         undefined values into nonexistent values in some cases.
1218
1219         * kjs/array_object.h: Removed MAX_ARRAY_INDEX.
1220         * kjs/array_object.cpp: Removed ArrayInstance. Moved to a separate file.
1221
1222         * JavaScriptCore.pri: Added array_instance.cpp.
1223         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
1224         * kjs/AllInOneFile.cpp: Ditto.
1225
1226 2007-10-22  Andrew Wellington  <proton@wiretapped.net>
1227
1228         Reviewed by Mark Rowe.
1229         
1230         Fix for local database support after r26879
1231         Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set
1232
1233         * Configurations/JavaScriptCore.xcconfig:
1234
1235 2007-10-22  Simon Hausmann  <hausmann@kde.org>
1236
1237         Reviewed by Alp.
1238
1239         Build fix for the non-qmake builds.
1240
1241         * wtf/Platform.h: Default to enabling the database features unless
1242         otherwise specified. (similar to ENABLE_ICONDATABASE)
1243
1244 2007-10-22  Holger Freyther  <zecke@selfish.org>
1245
1246         Reviewed by Simon Hausmann <hausmann@kde.org>.
1247
1248         * Do not build testkjs as an application bundle. This is
1249         needed for run-javascriptcore-tests on OSX.
1250         * Also, based on r26633, allow to test the WebKit/Qt port on OSX.
1251         * Set DYLD_LIBRARY_PATH if it was set in the environment. It must be set
1252         as we do not have -rpath on OSX.
1253
1254         * kjs/testkjs.pro:
1255
1256 2007-10-21  Mark Rowe  <mrowe@apple.com>
1257
1258         Reviewed by Alp.
1259
1260         http://bugs.webkit.org/show_bug.cgi?id=15575
1261         Bug 15575: [GTK] Implement threading using GThread
1262
1263         * wtf/Platform.h: Do not enable pthreads for Gtk.
1264
1265 2007-10-21  Mark Rowe  <mrowe@apple.com>
1266
1267         Reviewed by Mitz.
1268
1269         Fix http://bugs.webkit.org/show_bug.cgi?id=15603
1270         Bug 15603: Regression(r26847): Crash when sorting an empty array from JavaScript
1271
1272         * kjs/array_object.cpp:
1273         (KJS::freeStorage): Reinstate null-check that was removed in r26847.
1274
1275 2007-10-21  Darin Adler  <darin@apple.com>
1276
1277         - fix Windows build
1278
1279         * kjs/array_instance.h: Removed unused ExecState parameter.
1280         * kjs/array_object.cpp:
1281         (KJS::ArrayInstance::put): Ditto.
1282         (KJS::ArrayInstance::setLength): Ditto.
1283
1284 2007-10-21  Darin Adler  <darin@apple.com>
1285
1286         * kjs/array_object.cpp: (KJS::ArrayInstance::put):
1287         Add missing assignment that was causing regression test crash.
1288
1289 2007-10-21  Darin Adler  <darin@apple.com>
1290
1291         Reviewed by Maciej.
1292
1293         - http://bugs.webkit.org/show_bug.cgi?id=15585
1294           speed up sparse arrays by using a custom map
1295     
1296         Speeds up SunSpider by 10%.
1297
1298         * kjs/array_object.cpp:
1299         (allocateStorage): Leave room for an additional pointer.
1300         (reallocateStorage): Ditto.
1301         (freeStorage): Ditto.
1302         (ArrayInstance::~ArrayInstance): Delete the overflow map if present.
1303         (ArrayInstance::getItem): Read values from the overflow map if present.
1304         Removed the check of length, since it slows down the common case.
1305         (ArrayInstance::getOwnPropertySlot): Ditto. Also removed the fallback
1306         to the property map.
1307         (ArrayInstance::put): Write values into the overflow map as needed.
1308         Also create overflow map when needed.
1309         (ArrayInstance::deleteProperty): Remove values from the overflow map
1310         as appropriate.
1311         (ArrayInstance::getPropertyNames): Add a name for each identifier in
1312         the property map. This is extremely inefficient.
1313         (ArrayInstance::setLength): Remove any values in the overflow map
1314         that are past the new length, as we formerly did with the property map.
1315         (ArrayInstance::mark): Mark any values in the overflow map.
1316         (compareByStringForQSort): Removed unneeded undefined case, since
1317         compactForSorting guarantees we will have no undefined values.
1318         (compareWithCompareFunctionForQSort): Ditto.
1319         (ArrayInstance::compactForSorting): Copy all the values out of the
1320         overflow map and destroy it.
1321
1322         * kjs/property_map.h: Removed now-unused getSparseArrayPropertyNames.
1323         * kjs/property_map.cpp: Ditto.
1324
1325 2007-10-20  Darin Adler  <darin@apple.com>
1326
1327         Reviewed by Maciej.
1328
1329         - http://bugs.webkit.org/show_bug.cgi?id=15579
1330           stop churning identifier reference counts copying Completion objects
1331
1332         * kjs/completion.h: Replace the Identifier with an Identifier*.
1333         * kjs/nodes.cpp:
1334         (ForInNode::execute): Update for change to Completion constructor.
1335         (ContinueNode::execute): Ditto.
1336         (BreakNode::execute): Ditto.
1337
1338 2007-10-20  Mark Rowe  <mrowe@apple.com>
1339
1340         Reviewed by Alp.
1341
1342         Gtk changes needed to enable HTML 5 client-side database storage.
1343
1344         * wtf/Platform.h: Have Gtk use pthreads for now.
1345
1346 2007-10-20  Geoffrey Garen  <ggaren@apple.com>
1347
1348         Reviewed by Maciej Stachowiak.
1349
1350         Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
1351         Store gathered declaration nodes in the function body node.
1352         
1353         This means that you only have to gather the declaration nodes the first 
1354         time the function executes. Performance gain of 2.10% on SunSpider, 
1355         0.90% on command-line JS iBench.
1356
1357         * kjs/nodes.cpp: Split declaration stack initialization code off into 
1358         initializeDeclarationStacks().
1359         (FunctionBodyNode::FunctionBodyNode):
1360         (FunctionBodyNode::initializeDeclarationStacks):
1361         (FunctionBodyNode::processDeclarations):
1362
1363         * kjs/nodes.h: Changed DeclarationStacks structure to hold references, 
1364         since the actual Vectors are now stored either on the stack or in the 
1365         function body node.
1366
1367 2007-10-19  Geoffrey Garen  <ggaren@apple.com>
1368
1369         Reviewed by Darin Adler.
1370         
1371         http://bugs.webkit.org/show_bug.cgi?id=15559
1372         Moved processDeclarations call into FunctionBodyNode::execute
1373
1374         To improve encapsulation, moved processDeclarations call into
1375         FunctionBodyNode::execute. Also marked processDeclarations 
1376         ALWAYS_INLINE, since it has only 1 caller now. This is a .71% speedup 
1377         on command-line JS iBench.
1378
1379         * kjs/function.cpp:
1380         (KJS::FunctionImp::callAsFunction):
1381         (KJS::GlobalFuncImp::callAsFunction):
1382         * kjs/function.h:
1383         * kjs/interpreter.cpp:
1384         (KJS::Interpreter::evaluate):
1385         * kjs/nodes.cpp:
1386         (FunctionBodyNode::execute):
1387         * kjs/nodes.h:
1388
1389 2007-10-19  Brady Eidson  <beidson@apple.com>
1390
1391         Reviewed by Sam
1392
1393         Queue -> Deque! and small style tweaks
1394
1395         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1396         * JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
1397         * wtf/Deque.h: Added.
1398         (WTF::DequeNode::DequeNode):
1399         (WTF::Deque::Deque):
1400         (WTF::Deque::~Deque):
1401         (WTF::Deque::size):
1402         (WTF::Deque::isEmpty):
1403         (WTF::Deque::append):
1404         (WTF::Deque::prepend):
1405         (WTF::Deque::first):
1406         (WTF::Deque::last):
1407         (WTF::Deque::removeFirst):
1408         (WTF::Deque::clear):
1409         * wtf/Queue.h: Removed.
1410
1411
1412 2007-10-19  Brady Eidson <beidson@apple.com>
1413
1414         Reviewed by Oliver
1415
1416         Added a simple LinkedList based Queue to wtf
1417         We can make a better, more sophisticated an efficient one later, but have
1418         needed one for some time, now!
1419
1420         * JavaScriptCore.xcodeproj/project.pbxproj:
1421         * wtf/Queue.h: Added.
1422         (WTF::QueueNode::QueueNode):
1423         (WTF::Queue::Queue):
1424         (WTF::Queue::~Queue):
1425         (WTF::Queue::size):
1426         (WTF::Queue::isEmpty):
1427         (WTF::Queue::append):
1428         (WTF::Queue::prepend):
1429         (WTF::Queue::first):
1430         (WTF::Queue::last):
1431         (WTF::Queue::removeFirst):
1432         (WTF::Queue::clear):
1433
1434 2007-10-19  Nikolas Zimmermann  <zimmermann@kde.org>
1435
1436         Reviewed by Anders.
1437
1438         Try to fix Qt/Win build slave, by including windows.h also on Qt/Win.
1439
1440         * kjs/testkjs.cpp: Change PLATFORM(WIN) to PLATFORM(WIN_OS)
1441
1442 2007-10-19  Simon Hausmann  <hausmann@kde.org>
1443
1444         Reviewed by Lars.
1445
1446         Fix compilation on Windows when wchar_t is a typedef instead of a native type (triggered by -Zc:wchar_t-).
1447         Don't provide the wchar_t overloads then as they conflict with the unsigned short ones.
1448
1449         * wtf/ASCIICType.h:
1450         (WTF::isASCIIAlpha):
1451         (WTF::isASCIIAlphanumeric):
1452         (WTF::isASCIIDigit):
1453         (WTF::isASCIIHexDigit):
1454         (WTF::isASCIILower):
1455         (WTF::isASCIISpace):
1456         (WTF::toASCIILower):
1457         (WTF::toASCIIUpper):
1458
1459 2007-10-19  Simon Hausmann  <hausmann@kde.org>
1460
1461         Reviewed by Lars.
1462
1463         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.
1464
1465         * kjs/config.h:
1466
1467 2007-10-18  Maciej Stachowiak  <mjs@apple.com>
1468
1469         Reviewed by Adam.
1470         
1471         - use __declspec(thread) for fast thread-local storage on Windows
1472         
1473         - 2.2% speedup on sunspider (on Windows)
1474         - 7% speedup on the string section
1475         - 6% speedup on JS iBench
1476         
1477         - fixed <rdar://problem/5473084> PLT on Windows got 2.5% slower between r25406 and r25422
1478         - fixed at least some of <rdar://5527965? i-Bench JS was 14% slower in 310A11 than 310A10
1479         
1480         
1481         * wtf/FastMalloc.cpp:
1482         (WTF::getThreadHeap):
1483         (WTF::setThreadHeap):
1484         (WTF::TCMalloc_ThreadCache::GetCache):
1485         (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
1486         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
1487
1488 2007-10-17  Darin Adler  <darin@apple.com>
1489
1490         Reviewed by Mark Rowe.
1491
1492         - fix http://bugs.webkit.org/show_bug.cgi?id=15543
1493           <rdar://problem/5545639> REGRESSION (r26697):
1494           GoogleDocs: Can't create new documents or open existing ones
1495
1496         Test: fast/js/regexp-non-character.html
1497
1498         * pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
1499         in the \u sequences -- not needed and actively harmful.
1500
1501 2007-10-17  Anders Carlsson  <andersca@apple.com>
1502
1503         Reviewed by Oliver.
1504
1505         * wtf/Platform.h:
1506         #define USE_PTHREADS on Mac.
1507
1508 2007-10-17  Geoffrey Garen  <ggaren@apple.com>
1509
1510         Reviewed by Darin Adler.
1511         
1512         Merged DeclaredFunctionImp into FunctionImp (the base class) because 
1513         the distinction between the two was unused.
1514         
1515         Removed codeType() from FunctionImp because FunctionImp and its 
1516         subclasses all returned FunctionCode, so it was unused, practically 
1517         speaking.
1518         
1519         Removed a different codeType() from GlobalFuncImp because it was unused.
1520         (Perhaps it was vestigial from a time when GlobalFuncImp used to 
1521         inherit from FunctionImp.)
1522
1523         * bindings/runtime_method.cpp:
1524         * bindings/runtime_method.h:
1525         * kjs/function.cpp:
1526         (KJS::):
1527         (KJS::FunctionImp::FunctionImp):
1528         (KJS::FunctionImp::callAsFunction):
1529         (KJS::FunctionImp::construct):
1530         (KJS::FunctionImp::execute):
1531         (KJS::FunctionImp::processVarDecls):
1532         * kjs/function.h:
1533         (KJS::FunctionImp::implementsConstruct):
1534         (KJS::FunctionImp::scope):
1535         * kjs/function_object.cpp:
1536         (FunctionProtoFunc::callAsFunction):
1537         (FunctionObjectImp::construct):
1538         * kjs/nodes.cpp:
1539         (FuncDeclNode::processFuncDecl):
1540         (FuncExprNode::evaluate):
1541
1542 2007-10-17  Adam Roben  <aroben@apple.com>
1543
1544         Windows build fix part 2.
1545
1546         Fix was by Darin, reviewed by Anders and Adam.
1547
1548         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
1549         FastMallocPCRE.cpp to the project, and let Visual Studio have its way
1550         with the post-build step.
1551         * pcre/pcre.h: Don't DLL export the entry points just because this
1552         is Win32 -- this is an internal copy of PCRE and should be private.
1553         * pcre/pcre_compile.c: Fix an uninitialized variable warning --
1554         there's no real problem but it's better to quiet the compiler by
1555         tweaking the code slightly than turn off the warning entirely.
1556
1557 2007-10-17  Adam Roben  <aroben@apple.com>
1558
1559         Windows build fix.
1560
1561         Reviewed by Anders.
1562
1563         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
1564         some mismatched signed/unsigned comparison warnings.
1565         * pcre/pcre_exec.c:
1566         (match): #if-out some labels that don't seem to exist.
1567
1568 2007-10-17  Mark Rowe  <mrowe@apple.com>
1569
1570         Gtk build fix.
1571
1572         * JavaScriptCore.pri: Add FastMallocPCRE.cpp.
1573         * pcre/pcre_get. #if out two functions that depend on pcre_get_stringnumber, which
1574         is currently unavailable for UTF-16.
1575
1576 2007-10-16  Darin Adler  <darin@apple.com>
1577
1578         Reviewed by Geoff.
1579
1580         - merged PCRE changes between 6.4 and 6.5
1581
1582         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1583         * JavaScriptCore.xcodeproj/project.pbxproj:
1584         Removed pcre_config.c, pcre_globals.c, pcre_info.c, pcre_maketables.c,
1585         pcre_printint.src, pcre_refcount.c, pcre_study.c, pcre_try_flipped.c,
1586         pcre_ucp_findchar.c, pcre_version.c, and ucptable.c. Added pcre_ucp_searchfuncs.c.
1587
1588         * pcre/AUTHORS:
1589         * pcre/LICENCE:
1590         * pcre/MERGING:
1591         * pcre/dftables.c:
1592         * pcre/pcre-config.h:
1593         * pcre/pcre.h:
1594         * pcre/pcre.pri:
1595         * pcre/pcre_compile.c:
1596         * pcre/pcre_exec.c:
1597         * pcre/pcre_fullinfo.c:
1598         * pcre/pcre_get.c:
1599         * pcre/pcre_internal.h:
1600         * pcre/pcre_maketables.c:
1601         * pcre/pcre_ord2utf8.c:
1602         * pcre/pcre_tables.c:
1603         * pcre/pcre_ucp_searchfuncs.c: Copied from pcre/pcre_ucp_findchar.c.
1604         * pcre/pcre_xclass.c:
1605         * pcre/ucp.h:
1606         * pcre/ucpinternal.h:
1607         * pcre/ucptable.c:
1608         Updated with new versions from the PCRE 6.5 release, merged with changes.
1609
1610         * pcre/pcre_config.c: Removed.
1611         * pcre/pcre_globals.c: Removed.
1612         * pcre/pcre_info.c: Removed.
1613         * pcre/pcre_printint.src: Removed.
1614         * pcre/pcre_refcount.c: Removed.
1615         * pcre/pcre_study.c: Removed.
1616         * pcre/pcre_try_flipped.c: Removed.
1617         * pcre/pcre_ucp_findchar.c: Removed.
1618         * pcre/pcre_version.c: Removed.
1619
1620 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
1621
1622         Reviewed by Darin Adler.
1623
1624         Removed KJS_VERBOSE because it was getting in the way of readability, 
1625         and the messages didn't seem very helpful.
1626
1627         * kjs/function.cpp:
1628         (KJS::FunctionImp::callAsFunction):
1629         (KJS::FunctionImp::passInParameters):
1630         * kjs/lookup.h:
1631         (KJS::lookupPut):
1632         * kjs/object.cpp:
1633         (KJS::JSObject::put):
1634         * kjs/value.h:
1635
1636 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
1637
1638         Reviewed by Darin Adler.
1639         
1640         Removed the Parameter class because it was a redundant wrapper around 
1641         Identifier.
1642
1643         * kjs/function.cpp:
1644         (KJS::FunctionImp::passInParameters):
1645         (KJS::FunctionImp::getParameterName):
1646         * kjs/nodes.cpp:
1647         (FunctionBodyNode::addParam):
1648         * kjs/nodes.h:
1649         (KJS::FunctionBodyNode::):
1650
1651 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
1652
1653         Reviewed by Darin Adler.
1654         
1655         Global replace of assert with ASSERT.
1656
1657 2007-10-16  Adam Roben  <aroben@apple.com>
1658
1659         Make testkjs not delay-load WebKit
1660
1661         Soon, delay-loading WebKit will be impossible (because we will be
1662         using __declspec(thread) for thread-local storage). This change
1663         prepares testkjs for the future.
1664
1665         Reviewed by Sam.
1666
1667         * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed WebKitInitializer,
1668         added FindSafari.
1669         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Don't link against
1670         WebKitInitializer, don't delay-load WebKit.
1671         * kjs/testkjs.cpp: Don't use WebKitInitializer.
1672
1673 2007-10-16  Adam Roben  <aroben@apple.com>
1674
1675         Updated testkjs for the rename of WebKit_debug.dll to WebKit.dll for the Debug configuration
1676
1677         Reviewed by Kevin McCullough.
1678
1679         * JavaScriptCore.vcproj/debug.vsprops: Added WebKitDLLConfigSuffix.
1680         * JavaScriptCore.vcproj/debug_internal.vsprops: Ditto.
1681         * JavaScriptCore.vcproj/release.vsprops: Ditto.
1682         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Use
1683         WebKitDLLConfigSuffix when referring to WebKit.dll, and fixed a typo
1684         in the name of icuuc36[_debug].dll.
1685
1686 2007-10-16  Geoffrey Garen  <ggaren@apple.com>
1687
1688         Reviewed by Maciej Stachowiak.
1689         
1690         Re-structured variable and function declaration code.
1691         
1692         Command-line JS iBench shows no regression.
1693         
1694         Here are the changes:
1695
1696         1. Function declarations are now processed at the same time as var 
1697         declarations -- namely, immediately upon entry to an execution context. 
1698         This does not match Firefox, which waits to process a function
1699         declaration until the declaration's containing block executes, but it 
1700         does match IE and the ECMA spec. (10.1.3 states that var and function 
1701         declarations should be processed at the same time -- namely, "On 
1702         entering an execution context." 12.2 states that "A Block does not 
1703         define a new execution scope.")
1704
1705         2. Declaration processing proceeds iteratively now, rather than 
1706         recursively, storing the nodes is finds in stacks. This will later 
1707         facilitate an optimization to hold on to the gathered declaration nodes, 
1708         rather than re-fetching them in every function call. 
1709         [ http://bugs.webkit.org/show_bug.cgi?id=14868 ]
1710
1711         Modified these tests because they expected the incorrect Mozilla 
1712         behavior described above:
1713
1714         * tests/mozilla/ecma_3/Function/scope-001.js:
1715         * tests/mozilla/js1_5/Scope/regress-184107.js:
1716
1717 2007-10-16  Darin Adler  <darin@apple.com>
1718
1719         - try to fix the GTK build
1720
1721         * kjs/ustring.cpp: Include ASCIICType.h, not ASCIICtype.h.
1722
1723 2007-10-16  Darin Adler  <darin@apple.com>
1724
1725         - try to fix the Windows build
1726
1727         * kjs/date_object.cpp: (KJS::parseDate): A couple instances of isspace were
1728         in here. Not sure why it wasn't failing elsewhere. Changed to isASCIISpace.
1729
1730 2007-10-16  Darin Adler  <darin@apple.com>
1731
1732         - try to fix the GTK build
1733
1734         * kjs/ustring.cpp: Include ASCIICType.h.
1735
1736 2007-10-16  Darin Adler  <darin@apple.com>
1737
1738         Reviewed by Maciej and Geoff (and looked over by Eric).
1739
1740         - http://bugs.webkit.org/show_bug.cgi?id=15519
1741           eliminate use of <ctype.h> for processing ASCII
1742
1743         * wtf/ASCIICType.h: Added.
1744         * wtf/DisallowCType.h: Added.
1745
1746         * kjs/config.h: Include DisallowCType.h.
1747
1748         * kjs/date_object.cpp:
1749         (KJS::skipSpacesAndComments):
1750         (KJS::findMonth):
1751         (KJS::parseDate):
1752         * kjs/function.cpp:
1753         (KJS::decode):
1754         * kjs/ustring.cpp:
1755         (KJS::UString::toDouble):
1756         Use ASCIICType.h functions instead of ctype.h ones.
1757
1758 2007-10-14  Maciej Stachowiak  <mjs@apple.com>
1759
1760         Reviewed by Darin.
1761
1762         - fixes for "New JavaScript benchmark"
1763         http://bugs.webkit.org/show_bug.cgi?id=15515
1764         
1765         * kjs/testkjs.cpp:
1766         (TestFunctionImp::callAsFunction): Implement "load" for compatibility
1767         with SpiderMonkey.
1768         (TestFunctionImp::): ditto
1769         (doIt): ditto
1770         (kjsmain): Drop useless --> from output.
1771
1772 2007-10-15  Geoffrey Garen  <ggaren@apple.com>
1773
1774         Removed unnecessary #include.
1775
1776         * API/JSObjectRef.cpp:
1777
1778 2007-10-15  Geoffrey Garen  <ggaren@apple.com>
1779
1780         Double-reverse build fix. My tree was out of date.
1781
1782         * kjs/nodes.cpp:
1783         (NumberNode::evaluate):
1784
1785 2007-10-15  Geoffrey Garen  <ggaren@apple.com>
1786
1787         Build fix.
1788
1789         * kjs/nodes.cpp:
1790         (NumberNode::evaluate):
1791
1792 2007-10-15  Geoffrey Garen  <ggaren@apple.com>
1793
1794         Reviewed by Darin Adler.
1795         
1796         Removed surprising self-named "hack" that made nested functions 
1797         available as named properties of their containing functions, and placed
1798         containing function objects in the scope chains of nested functions.
1799         
1800         There were a few reasons to remove this "hack:"
1801
1802         1. It contradicted FF, IE, and the ECMA spec.
1803
1804         2. It incurred a performance penalty, since merely parsing a function 
1805         required parsing its body for nested functions (and so on).
1806
1807         3. SVN history contains no explanation for why it was added. It was just
1808         legacy code in a large merge a long, long time ago.
1809
1810         [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
1811
1812         * kjs/nodes.cpp:
1813         (FuncDeclNode::processFuncDecl):
1814
1815 2007-10-15  Geoffrey Garen  <ggaren@apple.com>
1816
1817         Reviewed by Darin Adler.
1818         
1819         Removed the concept of AnonymousCode. It was unused, and it doesn't
1820         exist in the ECMA spec.
1821         
1822         [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
1823
1824         * kjs/Context.cpp:
1825         (KJS::Context::Context):
1826         * kjs/function.h:
1827         (KJS::):
1828         * kjs/nodes.cpp:
1829         (ReturnNode::execute):
1830
1831 2007-10-15  Geoffrey Garen  <ggaren@apple.com>
1832
1833         Reviewed by Darin Adler.
1834         
1835         Made function parameters DontDelete. This matches FF and the vague
1836         description in ECMA 10.1.3. It's also required in order to make
1837         symbol table based lookup of function parameters valid. (If the 
1838         parameters aren't DontDelete, you can't guarantee that you'll find
1839         them later in the symbol table.)
1840
1841         [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
1842
1843         * kjs/function.cpp:
1844         (KJS::FunctionImp::passInParameters):
1845
1846 2007-10-15  Geoffrey Garen  <ggaren@apple.com>
1847
1848         Reviewed by Maciej Stachowiak.
1849         
1850         Some Vector optimizations. These are especially important when using
1851         Vector as a stack for implementing recursive algorithms iteratively.
1852         
1853         [ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
1854
1855         1. Added shrink(), which is a version of resize() that you can call
1856         to save a branch / improve code generation and inlining when you know 
1857         that the vector is not getting bigger.
1858         
1859         2. Changed subclassing relationship in VectorBuffer to remove a call to
1860         fastFree() in the destructor for the inlineCapacity != 0 template
1861         specialization. This brings inline Vectors one step closer to true
1862         stack-allocated arrays.
1863         
1864         Also changed abort() to CRASH(), since the latter works better.
1865
1866         * wtf/Vector.h:
1867         (WTF::VectorBufferBase::allocateBuffer):
1868         (WTF::VectorBufferBase::deallocateBuffer):
1869         (WTF::VectorBufferBase::VectorBufferBase):
1870         (WTF::VectorBufferBase::~VectorBufferBase):
1871         (WTF::):
1872         (WTF::VectorBuffer::VectorBuffer):
1873         (WTF::VectorBuffer::~VectorBuffer):
1874         (WTF::VectorBuffer::deallocateBuffer):
1875         (WTF::VectorBuffer::releaseBuffer):
1876         (WTF::Vector::clear):
1877         (WTF::Vector::removeLast):
1878         (WTF::::operator):
1879         (WTF::::fill):
1880         (WTF::::shrink):
1881
1882 2007-10-12  Geoffrey Garen  <ggaren@apple.com>
1883
1884         Reviewed by Maciej Stachowiak.
1885         
1886         Fixed http://bugs.webkit.org/show_bug.cgi?id=15490
1887         Iteration statements sometimes incorrectly evaluate to the empty value 
1888         (KDE r670547). 
1889         
1890         [ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
1891         
1892         This patch is a merge of KDE r670547, with substantial modification 
1893         for performance.
1894         
1895         It fixes do-while statements to evaluate to a value. (They used
1896         to evaluate to the empty value in all cases.) 
1897
1898         It also fixes SourceElementsNode to maintain the value of abnormal 
1899         completions like "break" and "continue."
1900         
1901         It also re-works the main execution loop in SourceElementsNode so that
1902         it (1) makes a little more sense and (2) avoids unnecessary work. This 
1903         is a .28% speedup on command-line JS iBench.
1904
1905         * kjs/nodes.cpp:
1906         (DoWhileNode::execute):
1907         (SourceElementsNode::execute):
1908
1909 2007-10-15  Simon Hausmann  <hausmann@kde.org>
1910
1911         Reviewed by Lars.
1912
1913         Fix compilation with gcc 4.3 by including 'limits' due to the use of std::numeric_limits.
1914
1915         * wtf/HashTraits.h:
1916
1917 2007-10-5  Kevin Ollivier  <kevino@theolliviers.com>
1918  
1919         Reviewed by Adam.
1920         
1921         Add support for MSVC7, and fix cases where PLATFORM(WIN) should
1922         be PLATFORM(WIN_OS) for other ports building on Windows.
1923  
1924         * kjs/DateMath.cpp:
1925         (KJS::getDSTOffsetSimple):
1926         * kjs/JSImmediate.h:
1927         * wtf/Assertions.cpp:
1928         * wtf/Assertions.h:
1929         * wtf/Platform.h:
1930         * wtf/StringExtras.h:
1931         (snprintf):
1932         (vsnprintf):
1933
1934 2007-10-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1935
1936         Reviewed by Darin.
1937
1938         Adds NegateNode optimization from KJS. The relevant revision in KDE
1939         is 666736.
1940
1941         * kjs/grammar.y:
1942         * kjs/nodes.cpp:
1943         (NumberNode::evaluate):
1944         * kjs/nodes.h:
1945         (KJS::Node::):
1946         (KJS::NumberNode::):
1947         * kjs/nodes2string.cpp:
1948         (NumberNode::streamTo):
1949
1950 2007-10-14  Jason Foreman  <jason@threeve.org>
1951
1952         Reviewed by Maciej.
1953
1954         Fix http://bugs.webkit.org/show_bug.cgi?id=15145
1955         
1956         Ensure that if adjusting n to minimize the difference of n*intPow10(e-p+1) to x,
1957         that the property n < intPow10(p) is maintained.
1958
1959         * kjs/number_object.cpp:
1960         (NumberProtoFunc::callAsFunction):
1961
1962 == Rolled over to ChangeLog-2007-10-14 ==