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