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