ChangeLog 168 KB
Newer Older
darin@apple.com's avatar
darin@apple.com committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2007-11-10  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15927
          REGRESSION(r27487): delete a.c followed by __defineGetter__("c", ...) incorrectly deletes another property
          and <rdar://problem/5586384> REGRESSION (r27487): Can't switch out of Edit HTML Source mode on Leopard Wiki

        Test: fast/js/delete-then-put.html

        * kjs/property_map.cpp:
        (KJS::PropertyMap::put): Added a missing "- 1"; code to find an empty slot was not working.
        (KJS::PropertyMap::checkConsistency): Added a missing range check that would have caught this
        problem before.

        - roll out a last-minute change to my evaluateToBoolean patch that was incorrect.

        * kjs/nodes.h: (KJS::ExprStatementNode::ExprStatementNode): Take out call to
        optimizeForUnnecessaryResult, since the result is used in some cases.

aroben@apple.com's avatar
aroben@apple.com committed
21
22
23
24
25
26
27
28
29
2007-11-10  Adam Roben  <aroben@apple.com>

        Windows build fix

        Roll out some changes that were (seemingly accidentally) checked in
        with r27664.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

darin@apple.com's avatar
darin@apple.com committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
2007-11-10  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - http://bugs.webkit.org/show_bug.cgi?id=15915
          add an evaluation path for booleans like the one we have for numbers

        Gives 1.1% on SunSpider.

        * kjs/grammar.y: Create TrueNode and FalseNode instead of BooleanNode.

        * kjs/nodes.h: Changed to use Noncopyable. Moved optimizeForUnnecessaryResult
        down from Node to ExpressionNode. Changed some classes to not inherit from
        ExpressionNode where not necessary, and removed unnneeded evaluate functions
        as well as evaluate functions that need not be virtual. Call the
        optimizeForUnnecessaryResult function on the start of a for loop too.
        * kjs/nodes.cpp:
        (KJS::ExpressionNode::evaluateToBoolean): Added.
        (KJS::FalseNode::evaluate): Added.
        (KJS::TrueNode::evaluate): Added.
        (KJS::NumberNode::evaluateToBoolean): Added.
        (KJS::StringNode::evaluateToBoolean): Added.
        (KJS::LocalVarAccessNode::evaluateToBoolean): Added.
        (KJS::BracketAccessorNode::evaluateToBoolean): Added.
        (KJS::LogicalNotNode::evaluate): Changed to call evaluateToBoolean.
        (KJS::LogicalNotNode::evaluateToBoolean): Added.
        (KJS::lessThan): Changed to return bool.
        (KJS::lessThanEq): Ditto.
        (KJS::LessNode::evaluate): Changed since lessThan returns bool.
        (KJS::LessNode::evaluateToBoolean): Added.
        (KJS::GreaterNode::evaluate): Changed since lessThanEq returns bool.
        (KJS::GreaterNode::evaluateToBoolean): Added.
        (KJS::LessEqNode::evaluate): Changed since lessThanEq returns bool.
        (KJS::LessEqNode::evaluateToBoolean): Added.
        (KJS::GreaterEqNode::evaluate): Changed since lessThan returns bool.
        (KJS::GreaterEqNode::evaluateToBoolean): Added.
        (KJS::InstanceOfNode::evaluateToBoolean): Added.
        (KJS::InNode::evaluateToBoolean): Added.
        (KJS::EqualNode::evaluateToBoolean): Added.
        (KJS::NotEqualNode::evaluateToBoolean): Added.
        (KJS::StrictEqualNode::evaluateToBoolean): Added.
        (KJS::NotStrictEqualNode::evaluateToBoolean): Added.
        (KJS::ConditionalNode::evaluate): Changed to call evaluateToBoolean.
        (KJS::IfNode::execute): Ditto.
        (KJS::DoWhileNode::execute): Ditto.
        (KJS::WhileNode::execute): Ditto.
        (KJS::ForNode::execute): Ditto.

        * kjs/nodes2string.cpp:
        (KJS::FalseNode::streamTo): Added.
        (KJS::TrueNode::streamTo): Added.

aroben@apple.com's avatar
aroben@apple.com committed
82
83
84
85
86
87
88
89
90
2007-11-09  Adam Roben  <aroben@apple.com>

        Windows build fix

        Reviewed by Darin.

        * kjs/value.h:
        (KJS::jsNumber): Add some explicit casts.

darin@apple.com's avatar
darin@apple.com committed
91
92
93
94
95
96
97
98
2007-11-08  Darin Adler  <darin@apple.com>

        - fix build

        * kjs/grammar.y:
        * kjs/nodes.h:
        * kjs/property_map.cpp:

99
100
101
102
103
104
2007-11-08  Darin Adler  <darin@apple.com>

        - roll out accidentally-checked in changes

        * kjs/nodes.cpp: Back to previous version.
        * kjs/nodes.h: Ditto.
105
        * kjs/grammar.y: Ditto.
106

darin@apple.com's avatar
darin@apple.com committed
107
108
109
110
111
112
113
114
115
116
117
118
119
2007-11-08  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15912
          fasta spends a lot of time in qsort

        * kjs/property_map.cpp:
        (KJS::PropertyMap::getEnumerablePropertyNames):
        Use insertion sort instead of qsort for small sets of property names.
        We can probably do some even-better speedups of for/in, but this nets
        0.6% overall and 6.7% on fasta.

darin@apple.com's avatar
darin@apple.com committed
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
2007-11-08  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15906
          getting characters by indexing into a string is very slow

        This fixes one source of the slowness -- the conversion to an unused
        Identifier as we call the get function from the slot -- but doesn't
        fix others, such as the fact that we have to allocate a new UString::Rep
        for every single character.

        Speeds up string-base64 30%, and at least 0.5% overall.
        But does slow down access-fannkuch quite a bit. Might be worth
        revisiting in the future to see what we can do about that (although
        I did look at a profile for a while).

        * kjs/property_slot.h: Add a new marker for "numeric" property slots;
        slots where we don't need to pass the identifier to the get function.
        (KJS::PropertySlot::getValue): Added code to call the numeric get function.
        (KJS::PropertySlot::setCustomNumeric): Added.
        * kjs/string_object.cpp:
        (KJS::StringInstance::indexGetter): Changed to use substr() instead
        of constructing a wholly new UString each time.
        (KJS::stringInstanceNumericPropertyGetter): Added. Like indexGetter, but
        takes advantage of setCustomNumeric to avoid creating an Identifier.
        (KJS::StringInstance::getOwnPropertySlot): Changed to use setCustomNumeric.

darin@apple.com's avatar
darin@apple.com committed
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
2007-11-08  Darin Adler  <darin@apple.com>

        Reviewed by Oliver.

        - http://bugs.webkit.org/show_bug.cgi?id=15904
          more speed-ups possible by tightening up int version of JSImmediate

        1% improvement of SunSpider

        * kjs/JSImmediate.h: Eliminate the now-unneeded FPBitValues struct template.
        (KJS::JSImmediate::from): Overload for most numeric types; many types can
        do fewer branches and checks.
        (KJS::JSImmediate::getUInt32): Removed unneeded check for undefined.
        (KJS::JSImmediate::getTruncatedInt32): Ditto.
        (KJS::JSImmediate::getTruncatedUInt32): Ditto. There's no difference any more
        between getUInt32 and getTruncatedUInt32, so that's worth a rename and merge later.

        * kjs/grammar.y: Update since fromDouble is now just from.
        * kjs/nodes.h: Ditto.

        * kjs/value.h: (KJS::jsNumber): Overload for most numeric types.

170
171
172
173
174
175
176
177
178
2007-11-08  Kevin Ollivier  <kevino@theolliviers.com>

        Bakefiles for building JavaScriptCore, needed by wx port.

        Reviewed by Mark Rowe.

        * JavaScriptCoreSources.bkl: Added.
        * jscore.bkl: Added.

179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
2007-11-08  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Fix regression caused by earlier bitwise and optimisation.  1 & undefined != 1.

        The implementation of JSImmediate::areBothImmediateNumbers relies on 
        (JSImmediate::getTag(immediate1) & JSImmediate::getTag(immediate2)) having 
        a unique result when both immediate values are numbers.

        The regression was due to UndefinedType & NumberType returning NumberType (3 & 1).
        By swapping the value of NumberType and UndefinedType this ceases to be a problem.

        * kjs/JSType.h:
        (KJS::):

darin@apple.com's avatar
darin@apple.com committed
195
196
197
198
199
200
2007-11-08  Darin Adler  <darin@apple.com>

        - fix build

        * kjs/nodes.h: Add missing parameter name.

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
2007-11-08  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.

        Add ExpressionNode subclass of Node, use it.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::ForInNode::ForInNode):
        * kjs/nodes.h:
        (KJS::ExpressionNode::):
        (KJS::NullNode::):
        (KJS::NullNode::precedence):
        (KJS::BooleanNode::):
        (KJS::BooleanNode::precedence):
        (KJS::RegExpNode::):
        (KJS::RegExpNode::precedence):
        (KJS::ThisNode::):
        (KJS::ThisNode::precedence):
        (KJS::ResolveNode::):
        (KJS::ElementNode::):
        (KJS::ArrayNode::):
        (KJS::PropertyNode::):
        (KJS::PropertyNode::precedence):
        (KJS::PropertyNode::name):
        (KJS::PropertyListNode::):
        (KJS::ObjectLiteralNode::):
        (KJS::ObjectLiteralNode::precedence):
        (KJS::BracketAccessorNode::):
        (KJS::DotAccessorNode::):
        (KJS::DotAccessorNode::precedence):
        (KJS::ArgumentListNode::):
        (KJS::ArgumentsNode::):
        (KJS::NewExprNode::):
        (KJS::NewExprNode::precedence):
        (KJS::FunctionCallValueNode::):
        (KJS::FunctionCallValueNode::precedence):
        (KJS::FunctionCallResolveNode::):
        (KJS::FunctionCallBracketNode::):
        (KJS::FunctionCallBracketNode::precedence):
        (KJS::FunctionCallDotNode::):
        (KJS::FunctionCallDotNode::precedence):
        (KJS::PrePostResolveNode::):
        (KJS::PostfixBracketNode::):
        (KJS::PostfixBracketNode::precedence):
        (KJS::PostIncBracketNode::):
        (KJS::PostIncBracketNode::isIncrement):
        (KJS::PostDecBracketNode::):
        (KJS::PostDecBracketNode::isIncrement):
        (KJS::PostfixDotNode::):
        (KJS::PostfixDotNode::precedence):
        (KJS::PostIncDotNode::):
        (KJS::PostIncDotNode::isIncrement):
        (KJS::PostDecDotNode::):
        (KJS::PostDecDotNode::isIncrement):
        (KJS::PostfixErrorNode::):
        (KJS::PostfixErrorNode::precedence):
        (KJS::DeleteResolveNode::):
        (KJS::DeleteBracketNode::):
        (KJS::DeleteBracketNode::precedence):
        (KJS::DeleteDotNode::):
        (KJS::DeleteDotNode::precedence):
        (KJS::DeleteValueNode::):
        (KJS::DeleteValueNode::precedence):
        (KJS::VoidNode::):
        (KJS::VoidNode::precedence):
        (KJS::TypeOfResolveNode::):
        (KJS::TypeOfValueNode::):
        (KJS::PrefixBracketNode::):
        (KJS::PrefixBracketNode::precedence):
        (KJS::PreIncBracketNode::):
        (KJS::PreIncBracketNode::isIncrement):
        (KJS::PreDecBracketNode::):
        (KJS::PreDecBracketNode::isIncrement):
        (KJS::PrefixDotNode::):
        (KJS::PrefixDotNode::precedence):
        (KJS::PreIncDotNode::):
        (KJS::PreIncDotNode::isIncrement):
        (KJS::PreDecDotNode::):
        (KJS::PreDecDotNode::isIncrement):
        (KJS::PrefixErrorNode::):
        (KJS::PrefixErrorNode::precedence):
        (KJS::UnaryPlusNode::):
        (KJS::UnaryPlusNode::precedence):
        (KJS::NegateNode::):
        (KJS::NegateNode::precedence):
        (KJS::BitwiseNotNode::):
        (KJS::BitwiseNotNode::precedence):
        (KJS::LogicalNotNode::):
        (KJS::LogicalNotNode::precedence):
        (KJS::AddNode::):
        (KJS::AddNode::precedence):
        (KJS::LeftShiftNode::):
        (KJS::LeftShiftNode::precedence):
        (KJS::RightShiftNode::):
        (KJS::RightShiftNode::precedence):
        (KJS::UnsignedRightShiftNode::):
        (KJS::UnsignedRightShiftNode::precedence):
        (KJS::LessNode::):
        (KJS::LessNode::precedence):
        (KJS::GreaterNode::):
        (KJS::GreaterNode::precedence):
        (KJS::LessEqNode::):
        (KJS::LessEqNode::precedence):
        (KJS::GreaterEqNode::):
        (KJS::GreaterEqNode::precedence):
        (KJS::InstanceOfNode::):
        (KJS::InstanceOfNode::precedence):
        (KJS::InNode::):
        (KJS::InNode::precedence):
        (KJS::EqualNode::):
        (KJS::EqualNode::precedence):
        (KJS::NotEqualNode::):
        (KJS::NotEqualNode::precedence):
        (KJS::StrictEqualNode::):
        (KJS::StrictEqualNode::precedence):
        (KJS::NotStrictEqualNode::):
        (KJS::NotStrictEqualNode::precedence):
        (KJS::BitAndNode::):
        (KJS::BitAndNode::precedence):
        (KJS::BitOrNode::):
        (KJS::BitOrNode::precedence):
        (KJS::BitXOrNode::):
        (KJS::BitXOrNode::precedence):
        (KJS::LogicalAndNode::):
        (KJS::LogicalAndNode::precedence):
        (KJS::LogicalOrNode::):
        (KJS::LogicalOrNode::precedence):
        (KJS::ConditionalNode::):
        (KJS::ConditionalNode::precedence):
        (KJS::ReadModifyResolveNode::):
        (KJS::ReadModifyResolveNode::precedence):
        (KJS::AssignResolveNode::):
        (KJS::AssignResolveNode::precedence):
        (KJS::ReadModifyBracketNode::):
        (KJS::ReadModifyBracketNode::precedence):
        (KJS::AssignBracketNode::):
        (KJS::AssignBracketNode::precedence):
        (KJS::AssignDotNode::):
        (KJS::AssignDotNode::precedence):
        (KJS::ReadModifyDotNode::):
        (KJS::ReadModifyDotNode::precedence):
        (KJS::AssignErrorNode::):
        (KJS::AssignErrorNode::precedence):
        (KJS::CommaNode::):
        (KJS::CommaNode::precedence):
        (KJS::AssignExprNode::):
        (KJS::AssignExprNode::precedence):
        (KJS::ExprStatementNode::):
        (KJS::IfNode::):
        (KJS::DoWhileNode::):
        (KJS::WhileNode::):
        (KJS::ReturnNode::):
        (KJS::WithNode::):
        (KJS::ThrowNode::):
        (KJS::ParameterNode::):
        (KJS::CaseClauseNode::):
        (KJS::CaseClauseNode::precedence):
        (KJS::ClauseListNode::):
        (KJS::SwitchNode::):

362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
2007-11-08  Oliver Hunt  <oliver@apple.com>

        Reviewed by Sam.

        Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).

        This only improves bitwise-and performance, as the additional logic required 
        for similar code paths on or, xor, and shifting requires additional operations
        and branches that negate (and in certain cases, regress) any advantage we might
        otherwise receive.

        This improves performance on all bitop tests, the cryptography tests, as well as 
        the string-base64 and string-unpack-code tests.  No significant degradation on 
        any other tests.

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::areBothImmediateNumbers):
        (KJS::JSImmediate::andImmediateNumbers):
        * kjs/nodes.cpp:
        (KJS::BitAndNode::evaluate):
        * kjs/value.h:
        (KJS::jsNumberFromAnd):

385
386
387
388
389
390
391
392
393
394
2007-11-08  Adam Roben  <aroben@apple.com>

        Stop using KJS inside of MathExtras.h

        Reviewed by Darin.

        * wtf/MathExtras.h: Removed an unused header, and a now-unused
        forward-declaration.
        (wtf_atan2): Use std::numeric_limits intead of KJS.

weinig@apple.com's avatar
weinig@apple.com committed
395
396
397
398
399
400
401
402
403
2007-11-08  Sam Weinig  <sam@webkit.org>

        Windows build fix.

        * kjs/date_object.cpp:
        (KJS::DateProtoFuncToLocaleString::callAsFunction): Fix unused arg warning.
        (KJS::DateProtoFuncToLocaleDateString::callAsFunction): ditto
        (KJS::DateProtoFuncToLocaleTimeString::callAsFunction): ditto

404
405
406
407
408
409
2007-11-08  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/lookup.h: Add missing include.

weinig@apple.com's avatar
weinig@apple.com committed
410
411
412
413
414
415
416
417
418
419
420
421
422
423
2007-11-08  Sam Weinig  <sam@webkit.org>

        Reviewed by Darin.

        Convert JavaScript internal function objects to use one class per
        function.  This avoids a switch statement inside what used to be
        the shared function classes and will allow Shark to better analyze
        the code.

        To make this switch, the value property of the HashEntry was changed
        to a union of an intptr_t (which is used to continue handle valueGetters)
        and function pointer which points to a static constructor for the
        individual new function objects.

424
        SunSpider claims this is a 1.0% speedup.
weinig@apple.com's avatar
weinig@apple.com committed
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565

        * kjs/array_object.cpp:
        (KJS::ArrayPrototype::getOwnPropertySlot):
        (KJS::getProperty):
        (KJS::ArrayProtoFuncToString::callAsFunction):
        (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
        (KJS::ArrayProtoFuncJoin::callAsFunction):
        (KJS::ArrayProtoFuncConcat::callAsFunction):
        (KJS::ArrayProtoFuncPop::callAsFunction):
        (KJS::ArrayProtoFuncPush::callAsFunction):
        (KJS::ArrayProtoFuncReverse::callAsFunction):
        (KJS::ArrayProtoFuncShift::callAsFunction):
        (KJS::ArrayProtoFuncSlice::callAsFunction):
        (KJS::ArrayProtoFuncSort::callAsFunction):
        (KJS::ArrayProtoFuncSplice::callAsFunction):
        (KJS::ArrayProtoFuncUnShift::callAsFunction):
        (KJS::ArrayProtoFuncFilter::callAsFunction):
        (KJS::ArrayProtoFuncMap::callAsFunction):
        (KJS::ArrayProtoFuncEvery::callAsFunction):
        (KJS::ArrayProtoFuncForEach::callAsFunction):
        (KJS::ArrayProtoFuncSome::callAsFunction):
        (KJS::ArrayProtoFuncIndexOf::callAsFunction):
        (KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
        * kjs/array_object.h:
        (KJS::ArrayPrototype::classInfo):
        * kjs/create_hash_table:
        * kjs/date_object.cpp:
        (KJS::DatePrototype::getOwnPropertySlot):
        (KJS::DateProtoFuncToString::callAsFunction):
        (KJS::DateProtoFuncToUTCString::callAsFunction):
        (KJS::DateProtoFuncToDateString::callAsFunction):
        (KJS::DateProtoFuncToTimeString::callAsFunction):
        (KJS::DateProtoFuncToLocaleString::callAsFunction):
        (KJS::DateProtoFuncToLocaleDateString::callAsFunction):
        (KJS::DateProtoFuncToLocaleTimeString::callAsFunction):
        (KJS::DateProtoFuncValueOf::callAsFunction):
        (KJS::DateProtoFuncGetTime::callAsFunction):
        (KJS::DateProtoFuncGetFullYear::callAsFunction):
        (KJS::DateProtoFuncGetUTCFullYear::callAsFunction):
        (KJS::DateProtoFuncToGMTString::callAsFunction):
        (KJS::DateProtoFuncGetMonth::callAsFunction):
        (KJS::DateProtoFuncGetUTCMonth::callAsFunction):
        (KJS::DateProtoFuncGetDate::callAsFunction):
        (KJS::DateProtoFuncGetUTCDate::callAsFunction):
        (KJS::DateProtoFuncGetDay::callAsFunction):
        (KJS::DateProtoFuncGetUTCDay::callAsFunction):
        (KJS::DateProtoFuncGetHours::callAsFunction):
        (KJS::DateProtoFuncGetUTCHours::callAsFunction):
        (KJS::DateProtoFuncGetMinutes::callAsFunction):
        (KJS::DateProtoFuncGetUTCMinutes::callAsFunction):
        (KJS::DateProtoFuncGetSeconds::callAsFunction):
        (KJS::DateProtoFuncGetUTCSeconds::callAsFunction):
        (KJS::DateProtoFuncGetMilliSeconds::callAsFunction):
        (KJS::DateProtoFuncGetUTCMilliseconds::callAsFunction):
        (KJS::DateProtoFuncGetTimezoneOffset::callAsFunction):
        (KJS::DateProtoFuncSetTime::callAsFunction):
        (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
        (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
        (KJS::DateProtoFuncSetSeconds::callAsFunction):
        (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
        (KJS::DateProtoFuncSetMinutes::callAsFunction):
        (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
        (KJS::DateProtoFuncSetHours::callAsFunction):
        (KJS::DateProtoFuncSetUTCHours::callAsFunction):
        (KJS::DateProtoFuncSetDate::callAsFunction):
        (KJS::DateProtoFuncSetUTCDate::callAsFunction):
        (KJS::DateProtoFuncSetMonth::callAsFunction):
        (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
        (KJS::DateProtoFuncSetFullYear::callAsFunction):
        (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
        (KJS::DateProtoFuncSetYear::callAsFunction):
        (KJS::DateProtoFuncGetYear::callAsFunction):
        * kjs/date_object.h:
        * kjs/lookup.cpp:
        (KJS::Lookup::find):
        * kjs/lookup.h:
        (KJS::HashEntry::):
        (KJS::staticFunctionGetter):
        (KJS::staticValueGetter):
        (KJS::getStaticPropertySlot):
        (KJS::getStaticFunctionSlot):
        (KJS::lookupPut):
        * kjs/math_object.cpp:
        (KJS::MathObjectImp::getOwnPropertySlot):
        (KJS::MathProtoFuncAbs::callAsFunction):
        (KJS::MathProtoFuncACos::callAsFunction):
        (KJS::MathProtoFuncASin::callAsFunction):
        (KJS::MathProtoFuncATan::callAsFunction):
        (KJS::MathProtoFuncATan2::callAsFunction):
        (KJS::MathProtoFuncCeil::callAsFunction):
        (KJS::MathProtoFuncCos::callAsFunction):
        (KJS::MathProtoFuncExp::callAsFunction):
        (KJS::MathProtoFuncFloor::callAsFunction):
        (KJS::MathProtoFuncLog::callAsFunction):
        (KJS::MathProtoFuncMax::callAsFunction):
        (KJS::MathProtoFuncMin::callAsFunction):
        (KJS::MathProtoFuncPow::callAsFunction):
        (KJS::MathProtoFuncRandom::callAsFunction):
        (KJS::MathProtoFuncRound::callAsFunction):
        (KJS::MathProtoFuncSin::callAsFunction):
        (KJS::MathProtoFuncSqrt::callAsFunction):
        (KJS::MathProtoFuncTan::callAsFunction):
        * kjs/math_object.h:
        (KJS::MathObjectImp::classInfo):
        (KJS::MathObjectImp::):
        * kjs/string_object.cpp:
        (KJS::StringPrototype::getOwnPropertySlot):
        (KJS::StringProtoFuncToString::callAsFunction):
        (KJS::StringProtoFuncValueOf::callAsFunction):
        (KJS::StringProtoFuncCharAt::callAsFunction):
        (KJS::StringProtoFuncCharCodeAt::callAsFunction):
        (KJS::StringProtoFuncConcat::callAsFunction):
        (KJS::StringProtoFuncIndexOf::callAsFunction):
        (KJS::StringProtoFuncLastIndexOf::callAsFunction):
        (KJS::StringProtoFuncMatch::callAsFunction):
        (KJS::StringProtoFuncSearch::callAsFunction):
        (KJS::StringProtoFuncReplace::callAsFunction):
        (KJS::StringProtoFuncSlice::callAsFunction):
        (KJS::StringProtoFuncSplit::callAsFunction):
        (KJS::StringProtoFuncSubstr::callAsFunction):
        (KJS::StringProtoFuncSubstring::callAsFunction):
        (KJS::StringProtoFuncToLowerCase::callAsFunction):
        (KJS::StringProtoFuncToUpperCase::callAsFunction):
        (KJS::StringProtoFuncToLocaleLowerCase::callAsFunction):
        (KJS::StringProtoFuncToLocaleUpperCase::callAsFunction):
        (KJS::StringProtoFuncLocaleCompare::callAsFunction):
        (KJS::StringProtoFuncBig::callAsFunction):
        (KJS::StringProtoFuncSmall::callAsFunction):
        (KJS::StringProtoFuncBlink::callAsFunction):
        (KJS::StringProtoFuncBold::callAsFunction):
        (KJS::StringProtoFuncFixed::callAsFunction):
        (KJS::StringProtoFuncItalics::callAsFunction):
        (KJS::StringProtoFuncStrike::callAsFunction):
        (KJS::StringProtoFuncSub::callAsFunction):
        (KJS::StringProtoFuncSup::callAsFunction):
        (KJS::StringProtoFuncFontcolor::callAsFunction):
        (KJS::StringProtoFuncFontsize::callAsFunction):
        (KJS::StringProtoFuncAnchor::callAsFunction):
        (KJS::StringProtoFuncLink::callAsFunction):
        * kjs/string_object.h:

aroben@apple.com's avatar
aroben@apple.com committed
566
567
568
569
570
571
572
573
574
2007-11-08  Adam Roben  <aroben@apple.com>

        Windows build fix

        Reviewed by Sam and Ada.

        * wtf/MathExtras.h: Get rid of a circular #include dependency to fix
        the build.

575
576
577
578
579
580
581
2007-11-08  Adam Roben  <aroben@apple.com>

        Fix a precedence warning on Windows

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::toBoolean):

582
583
584
585
586
587
2007-11-08  Mark Rowe  <mrowe@apple.com>

        Build fix for JavaScriptGlue.

        * wtf/MathExtras.h: Include stdlib.h for srand and RAND_MAX.

darin@apple.com's avatar
darin@apple.com committed
588
589
590
591
592
593
2007-11-08  Darin Adler  <darin@apple.com>

        - Windows build fix

        * kjs/JSImmediate.h: Include MathExtras.h rather than math.h since this file uses "signbit".

594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
2007-11-08  Oliver Hunt  <oliver@apple.com>

        Reviewed by Darin.

        Replace the use of floats for immediate values with the use of integers for a 4.5% improvement in SunSpider.

        Unfortunately this change results in NaN, +Inf, -Inf, and -0 being heap allocated now, but
        we should now have faster array access, faster immediate to double conversion, and the 
        potential to further improve bitwise operators in future.

        This also removes the need for unions to avoid strict aliasing problems when extracting 
        a value from immediates.

        * kjs/JSImmediate.h:
        (KJS::):
        (KJS::JSImmediate::trueImmediate):
        (KJS::JSImmediate::falseImmediate):
        (KJS::JSImmediate::undefinedImmediate):
        (KJS::JSImmediate::nullImmediate):
        (KJS::JSImmediate::toBoolean):
        * kjs/value.h:
        (KJS::jsNaN):

617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
2007-11-07  Eric Seidel  <eric@webkit.org>

        Reviewed by Darin and Oliver.
        
        Add evaluateToNumber parallel evaluation tree to speed up number operations.
        Make ImmediateNumberNode a subclass of NumberNode.
        Share evaluate logic between evaluate and evaluateToNumber using inline functions
        There is still a lot of improvement to be made here.
        
        SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
        Given the huge win that this prepares us for with simple type inferencing I see the small
        regression in base64 being worth the substantial overall improvement.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::Node::evaluateToNumber):
        (KJS::NumberNode::evaluate):
        (KJS::NumberNode::evaluateToNumber):
        (KJS::StringNode::evaluateToNumber):
        (KJS::LocalVarAccessNode::inlineEvaluate):
        (KJS::LocalVarAccessNode::evaluate):
        (KJS::LocalVarAccessNode::evaluateToNumber):
        (KJS::BracketAccessorNode::inlineEvaluate):
        (KJS::BracketAccessorNode::evaluate):
        (KJS::BracketAccessorNode::evaluateToNumber):
        (KJS::NegateNode::evaluate):
        (KJS::NegateNode::evaluateToNumber):
        (KJS::MultNode::inlineEvaluateToNumber):
        (KJS::MultNode::evaluate):
        (KJS::MultNode::evaluateToNumber):
        (KJS::DivNode::inlineEvaluateToNumber):
        (KJS::DivNode::evaluate):
        (KJS::DivNode::evaluateToNumber):
        (KJS::ModNode::inlineEvaluateToNumber):
        (KJS::ModNode::evaluate):
        (KJS::ModNode::evaluateToNumber):
        (KJS::throwOutOfMemoryErrorToNumber):
        (KJS::addSlowCaseToNumber):
        (KJS::add):
        (KJS::addToNumber):
        (KJS::AddNode::evaluateToNumber):
        (KJS::SubNode::inlineEvaluateToNumber):
        (KJS::SubNode::evaluate):
        (KJS::SubNode::evaluateToNumber):
        (KJS::valueForReadModifyAssignment):
        (KJS::ReadModifyLocalVarNode::evaluate):
        (KJS::ReadModifyResolveNode::evaluate):
        (KJS::ReadModifyDotNode::evaluate):
        (KJS::ReadModifyBracketNode::evaluate):
        * kjs/nodes.h:
        (KJS::Node::):
        (KJS::NumberNode::):
        (KJS::ImmediateNumberNode::):
        (KJS::AddNode::precedence):
        * kjs/nodes2string.cpp:
        (KJS::NumberNode::streamTo):

674
675
676
677
678
679
680
681
682
683
684
2007-11-07  Mark Rowe  <mrowe@apple.com>

        Reviewed by Eric.

        Fix up initialization after being mangled in r27572, and remove the
        ternary expression as extraCost will always be zero for the numeric
        heap.

        * kjs/collector.cpp:
        (KJS::Collector::heapAllocate):

685
686
687
688
689
690
2007-11-07  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/regexp_object.cpp:

ggaren@apple.com's avatar
ggaren@apple.com committed
691
692
693
694
695
696
697
698
699
2007-11-07  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Beth Dakin.
        
        Eliminated a bogus (though compiled-out) branch in the collector.

        * kjs/collector.cpp:
        (KJS::Collector::heapAllocate):

ggaren@apple.com's avatar
ggaren@apple.com committed
700
701
702
703
704
2007-11-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861 
705
        5.8% of string-validate-input.js is spent creating RegExpImps
ggaren@apple.com's avatar
ggaren@apple.com committed
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734

        Put RegExpImp properties into a static hashtable to avoid a slew of
        PropertyMap churn when creating a RegExpImp.
        
        Factored important bits of regular expression implementation out of
        RegExpImp (the JS object) and into RegExp (the PCRE wrapper class), 
        making RegExp a ref-counted class. (This will help later.)

        Removed PCRE_POSIX support because I didn't quite know how to test it 
        and keep it working with these changes.
        
        1.1% SunSpider speedup. 5.8% speedup on string-validate-input.js.

        * kjs/regexp.h: A few interface changes:
        1. Renamed "subpatterns()" => "numSubpatterns()"
        2. Made flag enumeration private and replaced it with public getters for
        specific flags.
        3. Made RegExp ref-counted so RegExps can be shared by RegExpImps.
        4. Made RegExp take a string of flags instead of an int, eliminating 
        duplicated flag parsing code elsewhere.

        * kjs/regexp_object.cpp:
        (KJS::RegExpProtoFunc::callAsFunction): For RegExp.compile: 
        - Fixed a bug where compile(undefined) would throw an exception. 
        - Removed some now-redundant code.
        - Used RegExp sharing to eliminate an allocation and a bunch of 
        PropertyMap thrash. (Not a big win since compile is a deprecated 
        function. I mainly did this to test the plubming.)

735
736
737
738
739
740
741
742
743
2007-11-07  Simon Hausmann  <hausmann@kde.org>

        Reviewed by nobody, Qt/Windows build fix.

        JavaScriptCore.pri expects OBJECTS_DIR to be set, so set it in
        testkjs.pro, too, where it's included from.

        * kjs/testkjs.pro:

744
745
746
747
748
749
750
751
752
2007-11-07  Simon Hausmann  <shausman@trolltech.com>

        Reviewed by Lars.

        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.

        * JavaScriptCore.pri:
        * pcre/pcre.pri:

hausmann's avatar
hausmann committed
753
754
755
756
757
758
759
760
761
762
763
2007-11-07  Lars Knoll  <lars@trolltech.com>

        Reviewed by Simon.

        fix umemcasecmp
        
        Pretty embarrassing bug. Has the potential to fix quite a few test failures.

        * wtf/unicode/qt4/UnicodeQt4.h:
        (WTF::Unicode::umemcasecmp):

mjs's avatar
mjs committed
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
2007-11-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Eric.        
        
        - only collect when the heap is full, unless we have lots of extra cost garbage
        
        1.1% SunSpider speedup.
        
        This shouldn't hit memory use much since the extra space in those
        blocks hangs around either way.

        * kjs/collector.cpp:
        (KJS::Collector::heapAllocate):
        (KJS::Collector::collect): Fix logic error that reversed the sense of collect's 
        return value.

780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
2007-11-06  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Avoid unnecessarily boxing the result from post inc/decrement for 0.3% gain in sunspider
        
        We now convert the common 'for (...; ...; <var>++) ...' to the semantically identical
        'for (...; ...; ++<var>) ...'.

        * kjs/nodes.cpp:
        (KJS::PostIncResolveNode::optimizeForUnnecessaryResult):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostIncLocalVarNode::optimizeForUnnecessaryResult):
        (KJS::PostDecResolveNode::optimizeForUnnecessaryResult):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::PostDecLocalVarNode::optimizeForUnnecessaryResult):
        * kjs/nodes.h:
        (KJS::PrePostResolveNode::):
        (KJS::PostIncResolveNode::):
        (KJS::PostIncLocalVarNode::):
        (KJS::PostDecResolveNode::):
        (KJS::PostDecLocalVarNode::):
        (KJS::PreIncResolveNode::):
        (KJS::PreDecResolveNode::):
        (KJS::ForNode::ForNode):

806
807
808
809
810
811
812
813
814
815
816
2007-11-06  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.

        This fixes a regressed layout test for string + object
        
        SunSpider claims this was an overall 0.3% speedup, although some individual tests were slower.

        * kjs/nodes.cpp:
        (KJS::add): remove erroneous "fast path" for string + *

ggaren@apple.com's avatar
ggaren@apple.com committed
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
2007-11-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Eric Seidel.
        
        Added toJSNumber, a fast path for converting a JSValue to a JS number,
        and deployed it in postfix expressions. In the fast case this 
        eliminates a call to jsNumber.
        
        0.4% speedup on SunSpider.

        * ChangeLog:
        * kjs/nodes.cpp:
        (KJS::PostIncResolveNode::evaluate):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostDecResolveNode::evaluate):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::PostIncBracketNode::evaluate):
        (KJS::PostDecBracketNode::evaluate):
        (KJS::PostIncDotNode::evaluate):
        (KJS::PostDecDotNode::evaluate):
        (KJS::UnaryPlusNode::evaluate):
        * kjs/value.h:
        (KJS::JSValue::toJSNumber):

darin@apple.com's avatar
darin@apple.com committed
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
2007-11-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15846
          REGRESSION (r27387): Memory corruption when running fast/js/kde/delete.html

        There was a mistake in the algorithm used to find an empty slot in the property
        map entries vector; when we were putting in a new property value and not overwriting
        an existing deleted sentinel, we would enlarge the entries vector, but would not
        overwrite the stale data that's in the new part. It was easy to pin this down by
        turning on property map consistency checks -- I never would have landed with this
        bug if I had run the regression tests once with consistency checks on!

        * kjs/property_map.cpp: (KJS::PropertyMap::put): Changed logic for the case where
        foundDeletedElement is false to always use the item at the end of the entries vector.
        Also allowed me to merge with the logic for the "no deleted sentinels at all" case.

859
860
861
862
863
864
865
866
867
2007-11-06  Oliver Hunt  <oliver@apple.com>

        RS=Darin.

        Fix previous patch to use a 3 bit shift, a 16 bit shift causes a regression in sunspider.

        * kjs/nodes.cpp:
        (KJS::add):

868
869
870
871
872
873
874
875
876
877
878
2007-11-06  Oliver Hunt  <oliver@apple.com>

        Reviewed by Darin.

        Replace boolean comparisons in AddNode with mask
        comparisons for a 0.2% improvement in sunspider.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/nodes.cpp:
        (KJS::add):

879
880
881
882
883
884
885
886
887
888
889
2007-11-06  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.
        
        SunSpider claims this is a 1.1% speedup.

        * kjs/nodes.cpp:
        (KJS::throwOutOfMemoryError): Added, non inline.
        (KJS::addSlowCase): renamed from add(), non inline.
        (KJS::add): add fast path for String + String, Number + Number and String + *

890
891
892
893
894
895
896
897
898
899
900
2007-11-06  Eric Seidel  <eric@webkit.org>

        Reviewed by mjs.
        
        Avoid more UString creation.
        
        SunSpider claims this is a 0.4% speedup.

        * kjs/regexp_object.cpp:
        (KJS::RegExpObjectImp::construct): use UString::find(UChar)

901
902
903
904
905
906
907
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Mac build fix.

        * kjs/array_object.cpp:
        (KJS::ArrayProtoFunc::callAsFunction):

aroben's avatar
aroben committed
908
909
910
911
912
913
2007-11-05  Adam Roben  <aroben@apple.com>

        Windows build fix

        * kjs/list.h:

914
915
916
917
918
919
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Build fix.  Add missing #include.

        * kjs/operations.cpp:

920
921
922
923
924
925
926
927
928
929
930
2007-11-05  Eric Seidel  <eric@webkit.org>

        Reviewed by mjs.
        
        Remove another call to toString(exec)
        
        SunSpider claims this is a 0.5% speedup.

        * kjs/operations.cpp:
        (KJS::equal): remove another toString

931
932
933
934
935
2007-11-05  Eric Seidel  <eric@webkit.org>

        * kjs/operations.cpp:
        (KJS::equal): correct broken change.

936
937
938
939
940
941
942
943
944
945
946
2007-11-05  Eric Seidel  <eric@webkit.org>

        Reviewed by mjs.

        Remove one more call to toString(exec).
        
        SunSpider claims this is a 0.7% speedup.

        * kjs/operations.cpp:
        (KJS::equal): remove a call to toString()

947
948
949
950
951
952
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * pcre/pcre.pri:

953
954
955
956
957
958
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/list.cpp:

959
960
961
962
963
964
2007-11-05  Geoffrey Garen  <ggaren@apple.com>

        Touched a file to test my new HTTP access.

        * kjs/scope_chain.cpp:

alp's avatar
alp committed
965
966
967
968
969
970
971
972
973
2007-11-05  Alp Toker  <alp@atoker.com>

        Unreviewed build fix for qmake-based ports.

        Someone with a better understanding of qmake still needs to sort out
        the INCLUDEPATH/DEPENDPATH mess.

        * JavaScriptCore.pri:

ggaren's avatar
ggaren committed
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
2007-11-05  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        http://bugs.webkit.org/show_bug.cgi?id=15835

        Switched List implementation from a custom heap allocator to an inline
        Vector, for a disappointing .5% SunSpider speedup.
        
        Also renamed List::slice to List::getSlice because "get" is the 
        conventional prefix for functions returning a value through an out 
        parameter.

        * kjs/array_object.cpp:
        (KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
        calls and memory accesses.

        * kjs/bool_object.cpp:
        (BooleanObjectImp::construct): Removed questionable use of iterator.

        * kjs/list.cpp:
        * kjs/list.h: New List class, implemented in terms of Vector. Two 
        interesting differences:
            1. The inline capacity is 8, not 5. Many of the Lists constructed 
            during a SunSpider run are larger than 5; almost none are larger
            than 8.

            2. The growth factor is 4, not 2. Since we can guarantee that Lists
            aren't long-lived, we can grow them more aggressively, to avoid
            excessive copying.

        * kjs/regexp_object.cpp:
        (RegExpObjectImp::construct): Removed redundant function calls.

        * kjs/string_object.cpp:
        (KJS::StringObjectImp::construct): Removed questionable use of iterator.

        * wtf/Vector.h:
        (WTF::::uncheckedAppend): Added a fast, unchecked version of append.

1014
1015
1016
1017
1018
1019
1020
1021
1022
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Reviewed by Alp Toker.

        Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.

        * JavaScriptCore.pri:
        * pcre/pcre.pri:

darin@apple.com's avatar
darin@apple.com committed
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
2007-11-04  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15826
          optimize opcode loop and case insensitive ASCII compares for a 30% speedup

        SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.

        * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.

        * pcre/pcre_compile.c:
        (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
        added OP_NOT since there was no reason it should not be in here.
        (could_be_empty_branch): Ditto.
        (compile_branch): Streamlined all the single-character cases; there was a bit of
        duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
        But in particular, compile to those opcodes when the single character match is
        ASCII.
        (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.

        * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
        the matchframe, after I discovered that none of them needed to be saved and restored
        across recursive match calls. Also eliminated the ignored result field from the
        matchframe, since I discovered that rrc ("recursive result code") was already the
        exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
        statement of the switch instead of doing them before the switch. This removes a
        branch from each iteration of the opcode interpreter, just as removal of "op"
        removed at least one store from each iteration. Last, but not least, add the
        OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
        surrogate pair and the letter case can be handled efficiently.

1055
1056
1057
1058
2007-11-04  Darin Adler  <darin@apple.com>

        * pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.

1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
2007-11-03  Darin Adler  <darin@apple.com>

        - fix non-Mac builds; remove some more unused PCRE stuff

        * pcre/pcre_compile.c:
        (compile_branch): Removed branch chain and some unused ESC values.
        (compile_regex): Ditto.
        (jsRegExpCompile): Ditto.
        * pcre/pcre_exec.c:
        (match): Removed unused branch targets. Don't use macros any more.
        (jsRegExpExecute): More of the same.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
        * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
        * pcre/pcre.pri: Ditto.

        * pcre/MERGING: Removed.
        * pcre/pcre_fullinfo.c: Removed.
        * pcre/pcre_get.c: Removed.
        * pcre/pcre_internal.h:
        * pcre/ucp.h: Removed.

darin@apple.com's avatar
darin@apple.com committed
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
2007-11-03  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15821
          remove unused PCRE features for speed

        A first step toward removing the PCRE features we don't use.
        This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
        the SunSpider regular expression test.

        Replaced the public interface with one that doesn't use the
        name PCRE. Removed code we don't need for JavaScript and various
        configurations we don't use. This is in preparation for still
        more changes in the future. We'll probably switch to C++ and
        make some even more significant changes to the regexp engine
        to get some additional speed.

        There's probably additional unused stuff that I haven't
        deleted yet.

        This does mean that our PCRE is now a fork, but I think that's
        not really a big deal.

        * JavaScriptCore.exp: Remove the 5 old entry points and add
        the 3 new entry points for WebCore's direct use of the regular
        expression engine.

        * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
        its sense and now there's a USE(POSIX_REGEX) instead, which should
        probably not be set by anyone. Maybe later we'll just get rid of it
        altogether.

        * kjs/regexp.h:
        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
        defines. Cut down on the number of functions used.
        (KJS::RegExp::~RegExp): Ditto.
        (KJS::RegExp::match): Ditto.

        * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
        which are unused.

        * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
        size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
        POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
        and JAVASCRIPT. These are all no longer configurable in our copy
        of the library.

        * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
        version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
        the include of <stdlib.h>, and most of the constants and
        functions defined in this header. Changed the naming scheme to
        use a JSRegExp prefix rather than a pcre prefix. In the future,
        we'll probably change this to be a C++ header.

        * pcre/pcre_compile.c: Removed all unused code branches,
        including many whole functions and various byte codes.
        Kept changes outside of removal to a minimum.
        (check_escape):
        (first_significant_code):
        (find_fixedlength):
        (find_recurse):
        (could_be_empty_branch):
        (compile_branch):
        (compile_regex):
        (is_anchored):
        (is_startline):
        (find_firstassertedchar):
        (jsRegExpCompile): Renamed from pcre_compile2 and changed the
        parameters around a bit.
        (jsRegExpFree): Added.

        * pcre/pcre_exec.c: Removed many unused opcodes and variables.
        Also started tearing down the NO_RECURSE mechanism since it's
        now the default. In some cases there were things in the explicit
        frame that could be turned into plain old local variables and
        other small like optimizations.
        (pchars):
        (match_ref):
        (match): Changed parameters quite a bit since it's now not used
        recursively.
        (jsRegExpExecute): Renamed from pcre_exec.

        * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
        PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
        PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
        PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
        _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
        and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.

        * pcre/pcre_maketables.c: Changed to only compile in dftables.
        Also got rid of many of the tables that we don't use.

        * pcre/pcre_tables.c: Removed the unused Unicode property tables.

        * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
        _pcre_ucp_othercase.

        * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
        for classes based on Unicode properties.

        * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
        to eliminate this completely, but we need the regular expression
        code to be C++ first.

        * pcre/pcre_fullinfo.c:
        * pcre/pcre_get.c:
        * pcre/ucp.h:
        Files that are no longer needed. I didn't remove them with this
        check-in, because I didn't want to modify all the project files.

mjs's avatar
mjs committed
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
2007-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Sam.
        
        - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup

        It turns out that doing this check costs more than it saves.
        
        * kjs/JSImmediate.h:
        (KJS::JSImmediate::fromDouble):

weinig@apple.com's avatar
weinig@apple.com committed
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
2007-11-03  Sam Weinig  <sam@webkit.org>

        Reviewed by Oliver.

        Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
        The variable had been kept around for binary compatibility, but since nothing
        else is there is no point in continuing to keep it around.

        * API/JSCallbackConstructor.cpp:
        (KJS::):
        * API/JSCallbackFunction.cpp:
        (KJS::):
        * API/JSCallbackObject.cpp:
        (KJS::):
        * bindings/objc/objc_runtime.mm:
        * bindings/runtime_array.cpp:
        * bindings/runtime_object.cpp:
        * kjs/array_instance.cpp:
        (KJS::):
        * kjs/array_object.cpp:
        (KJS::):
        * kjs/bool_object.cpp:
        * kjs/date_object.cpp:
        (KJS::):
        * kjs/error_object.cpp:
        * kjs/function.cpp:
        (KJS::):
        * kjs/internal.cpp:
        (KJS::):
        * kjs/lookup.h:
        * kjs/math_object.cpp:
        * kjs/number_object.cpp:
        * kjs/object.h:
        * kjs/regexp_object.cpp:
        * kjs/string_object.cpp:
        (KJS::):

1241
1242
1243
1244
1245
1246
1247
2007-11-03  Kevin McCullough  <kmccullough@apple.com>

        - Updated testkjs results to make the build bots green until we
        can fix the tests that are failing.  The new failures are in DST.

        * tests/mozilla/expected.html:

mjs's avatar
mjs committed
1248
1249
1250
1251
1252
1253
1254
1255
1256
2007-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Adam.
        
        - don't print the var twice for ForInNodes with a var declaration

        * kjs/nodes2string.cpp:
        (KJS::ForInNode::streamTo):

1257
1258
1259
1260
1261
2007-11-03  Darin Adler  <darin@apple.com>

        * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
        C-incompatible declaration.

1262
1263
1264
1265
1266
1267
2007-11-03  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/nodes.cpp:  Add missing include.

darin@apple.com's avatar
darin@apple.com committed
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
2007-11-03  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15814
          <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails

        These changes cause us to match the JavaScript specification and pass the
        fast/js/kde/encode_decode_uri.html test.

        * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
        new strict mode, throwing an exception if there are malformed UTF-16 surrogate
        pairs in the text.

        * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
        * kjs/ustring.cpp:
        (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
        those might be illegal in some sense, they aren't supposed to get any special
        handling in the place where this function is currently used.
        (KJS::UString::UTF8String): Added the strictness.

darin@apple.com's avatar
darin@apple.com committed
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
2007-11-03  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15812
          some JavaScript tests (from the Mozilla test suite) are failing

        Two or three fixes get 7 more of the Mozilla tests passing.
        This gets us down from 61 failing tests to 54.

        * kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
        Made this inline and gave it a more specific type. Some day we should
        probably do that for all of these -- might even get a bit of a speed
        boost from it.
        * kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
        inline in the header.

        * kjs/regexp_object.h:
        * kjs/regexp_object.cpp:
        (KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
        switch statement into the RegExpImp object, so they can be shared with
        RegExpImp::callAsFunction.
        (KJS::RegExpImp::match): Added. Common code used by both test and exec.
        (KJS::RegExpImp::test): Added.
        (KJS::RegExpImp::exec): Added.
        (KJS::RegExpImp::implementsCall): Added.
        (KJS::RegExpImp::callAsFunction): Added.
        (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
        lastInput to null rather than empty string -- we take advantage of the
        difference in RegExpImp::match.
        (KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
        just to get at a field like this.

        * pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
        the JavaScript specification. If there are not 4 hex digits after the \u,
        then it's processed as if it wasn't an escape sequence at all.

        * pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
        for JavaScript (4 specific Unicode values).
        * pcre/pcre_exec.c:
        (match): Changed all call sites to use IS_NEWLINE.
        (pcre_exec): Ditto.

        * tests/mozilla/expected.html: Updated to expect 7 more successful tests.

ddkilzer's avatar
ddkilzer committed
1334
1335
1336
1337
1338
1339
1340
1341
2007-11-03  David D. Kilzer  <ddkilzer@webkit.org>

        Sort files(...); sections of Xcode project files.

        Rubber-stamped by Darin.

        * JavaScriptCore.xcodeproj/project.pbxproj:

mjs's avatar
mjs committed
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
2007-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::VarDeclNode::optimizeVariableAccess):
        (KJS::VarDeclNode::getDeclarations):
        (KJS::VarDeclNode::handleSlowCase):
        (KJS::VarDeclNode::evaluateSingle):
        (KJS::VarDeclNode::evaluate):
        (KJS::VarStatementNode::execute):
        * kjs/nodes.h:
        (KJS::VarDeclNode::):
        (KJS::VarStatementNode::):
        * kjs/nodes2string.cpp:
        (KJS::VarDeclNode::streamTo):

ap's avatar
ap committed
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
2007-11-03  Alexey Proskuryakov  <ap@webkit.org>

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=15800
        REGRESSION (r27303): RegExp leaks

        * kjs/regexp_object.h:
        (KJS::RegExpImp::setRegExp):
        (KJS::RegExpImp::regExp):
        (KJS::RegExpImp::classInfo):
        * kjs/regexp_object.cpp:
        (RegExpImp::RegExpImp):
        (RegExpImp::~RegExpImp):
        Renamed reg member variable to m_regExp, changed it to use OwnPtr.

mjs's avatar
mjs committed
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
2007-11-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::statementListPushFIFO):
        (KJS::statementListGetDeclarations):
        (KJS::statementListInitializeDeclarationStacks):
        (KJS::statementListInitializeVariableAccessStack):
        (KJS::statementListExecute):
        (KJS::BlockNode::BlockNode):
        (KJS::FunctionBodyNode::FunctionBodyNode):
        (KJS::ProgramNode::ProgramNode):
        * kjs/nodes.h:
        (KJS::CaseClauseNode::):

darin@apple.com's avatar
darin@apple.com committed
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
2007-11-02  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15791
          change property map data structure for less memory use, better speed

        The property map now has an array of indices and a separate array of
        property map entries. This slightly slows down lookup because of a second
        memory acess, but makes property maps smaller and faster to iterate in
        functions like mark().

        SunSpider says this is 1.2% faster, although it makes the bitwise-end test
        more than 10% slower. To fix that we'll need to optimize global variable lookup.

        * kjs/property_map.cpp:
        (KJS::PropertyMapEntry::PropertyMapEntry):
        (KJS::PropertyMapHashTable::entries):
        (KJS::PropertyMapHashTable::allocationSize):
        (KJS::SavedProperties::SavedProperties):
        (KJS::SavedProperties::~SavedProperties):
        (KJS::PropertyMap::checkConsistency):
        (KJS::PropertyMap::~PropertyMap):
        (KJS::PropertyMap::clear):
        (KJS::PropertyMap::get):
        (KJS::PropertyMap::getLocation):
        (KJS::PropertyMap::put):
        (KJS::PropertyMap::insert):
        (KJS::PropertyMap::createTable):
        (KJS::PropertyMap::rehash):
        (KJS::PropertyMap::remove):
        (KJS::PropertyMap::mark):
        (KJS::comparePropertyMapEntryIndices):
        (KJS::PropertyMap::containsGettersOrSetters):
        (KJS::PropertyMap::getEnumerablePropertyNames):
        (KJS::PropertyMap::save):
        (KJS::PropertyMap::restore):
        * kjs/property_map.h:

darin@apple.com's avatar
darin@apple.com committed
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
2007-11-02  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15807
          HashMap needs a take() function that combines get and remove

        * wtf/HashMap.h: Added take function. Simplistic implementation for now,
        but still does only one hash table lookup.

        * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
        a find followed by a remove.

darin@apple.com's avatar
darin@apple.com committed
1449
1450
1451
1452
1453
1454
1455
1456
1457
2007-11-02  David Carson  <dacarson@gmail.com>

        Reviewed by Darin.

        Fix compiler warning "warning: suggest parentheses around && within ||"
        http://bugs.webkit.org/show_bug.cgi?id=15764

        * kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.

ggaren's avatar
ggaren committed
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        In preparation for making List a simple stack-allocated Vector:

        Removed all instances of List copying and/or assignment, and made List 
        inherit from Noncopyable.
        
        Functions that used to return a List by copy now take List& out 
        parameters.
        
        Layout tests and JS tests pass.

        * kjs/list.cpp:
        (KJS::List::slice): Replaced copyTail with a more generic slice 
        alternative. (JavaScriptCore only calls slice(1), but WebCore calls 
        slice(2)).

ggaren's avatar
ggaren committed
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.

        Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
        REGRESSION(r27344): Crash on load at finance.yahoo.com
        
        Reverted a small portion of my last check-in. (The speedup and the List 
        removal are still there, though.)
        
        ActivationImp needs to hold a pointer to its function, and mark that 
        pointer (rather than accessing its function through its ExecState, and 
        counting on the active scope to mark its function) because a closure 
        can cause an ActivationImp to outlive its ExecState along with any 
        active scope.

        * kjs/ExecState.cpp:
        (KJS::ExecState::ExecState):
        * kjs/function.cpp:
        (KJS::FunctionImp::~FunctionImp):
        (KJS::ActivationImp::ActivationImp):
        * kjs/function.h:
        (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):

        Also made HashTable a little more crash-happy in debug builds, so 
        problems like this will show up earlier:
        
        * wtf/HashTable.h:
        (WTF::HashTable::~HashTable):

ggaren's avatar
ggaren committed
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Adam Roben.
        
        Addressed some of Darin's review comments.
        
        Used perl -p, which is the shorthand while(<>) {}.
        
        Made sure not to suppress bison's output.
        
        Added line to removed bison_out.txt, since this script removes other 
        intermediate files, too.

        * DerivedSources.make:

ggaren's avatar
ggaren committed
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
2007-11-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Removed List from ActivationImp, in preparation for making all lists
        stack-allocated.
        
        Tests pass.
        
        1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.

        * kjs/ExecState.cpp:
        (KJS::ExecState::ExecState):
        (KJS::ExecState::~ExecState):
        * kjs/function.cpp:
        (KJS::ActivationImp::ActivationImp):
        (KJS::ActivationImp::createArgumentsObject):
        * kjs/function.h:
        (KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):

1542
1543
1544
1545
2007-11-01  Adam Roben  <aroben@apple.com>

        Use jsNumberCell instead of jsNumber when converting double constants to JSValues

aroben's avatar
aroben committed
1546
1547
1548
        This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
        ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.

1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
        It also gets rid of an MSVC warning that we previously had to silence.

        Reviewed by Geoff.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
        back on the "overflow in constant arithmetic" warning.
        * kjs/number_object.cpp:
        (NumberObjectImp::getValueProperty): Use jsNumberCell instead of
        jsNumber.

aroben's avatar
aroben committed
1559
1560
1561
1562
1563
1564
2007-10-31  Adam Roben  <aroben@apple.com>

        Windows build fix

        * kjs/ExecState.h:

mjs's avatar
mjs committed
1565
1566
1567
1568
1569
1570
2007-10-31  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - shave some cycles off of local storage access for a 1% SunSpider speedup
        
mjs's avatar
mjs committed
1571
1572
        Keep the LocalStorage pointer in the ExecState, instead of getting
        it from the ActivationImp all the time.
mjs's avatar
mjs committed
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589

        * kjs/ExecState.cpp:
        (KJS::ExecState::updateLocalStorage):
        * kjs/ExecState.h:
        (KJS::ExecState::localStorage):
        * kjs/nodes.cpp:
        (KJS::LocalVarAccessNode::evaluate):
        (KJS::LocalVarFunctionCallNode::evaluate):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::LocalVarTypeOfNode::evaluate):
        (KJS::PreIncLocalVarNode::evaluate):
        (KJS::PreDecLocalVarNode::evaluate):
        (KJS::ReadModifyLocalVarNode::evaluate):
        (KJS::AssignLocalVarNode::evaluate):
        (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):

1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
2007-10-31  Adam Roben  <aroben@apple.com>

        Fix a crash on launch due to a static initializer race

        We now use fast inline assembler spinlocks which can be statically
        initialized at compile time.

        As a side benefit, this speeds up SunSpider by 0.4%.

        Reviewed by Oliver.

        * wtf/FastMalloc.cpp:
        * wtf/TCSpinLock.h:
        (TCMalloc_SpinLock::Lock):
        (TCMalloc_SpinLock::Unlock):
        (TCMalloc_SlowLock):
        * wtf/TCSystemAlloc.cpp:

kmccullo's avatar
kmccullo committed
1608
1609
1610
1611
1612
1613
1614
1615
2007-10-31  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Sam.

        - Corrected spelling.

        * wtf/HashTraits.h:

1616
1617
1618
1619
1620
1621
2007-10-31  Mark Rowe  <mrowe@apple.com>

        Further Gtk build fixage.

        * kjs/regexp_object.cpp:

1622
1623
1624
1625
1626
1627
2007-10-31  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/regexp.h:

darin's avatar
darin committed
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
2007-10-31  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15749
          RegExp/RegExpObjectImp cause needless UString creation

        Speeds things up 0.4% according to SunSpider.

        * kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
        because this library doesn't use the real PCRE -- it uses its
        own PCRE that works on UTF-16.

        * kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
        Use Noncopyable. Change the return value of match.
        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
        (KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
        (KJS::RegExp::match): Change to return the position as an int and the
        ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.

        * kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
        require a result string.
        * kjs/regexp_object.cpp:
        (RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
        (RegExpObjectImp::performMatch): Change so it doesn't return a string.
        (RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
        the main result with the backreferences; now it doesn't need to take
        a result parameter.
        (RegExpObjectImp::getBackref): Minor tweaks.
        (RegExpObjectImp::getLastParen): Ditto.
        (RegExpObjectImp::getLeftContext): Ditto.
        (RegExpObjectImp::getRightContext): Ditto.
        (RegExpObjectImp::getValueProperty): Change LastMatch case to call
        getBackref(0) so we don't need a separate getLastMatch function.

        * kjs/string_object.cpp:
        (KJS::replace): Update to use new performMatch, including merging the
        matched string section with the other substrings.
        (KJS::StringProtoFunc::callAsFunction): Update functions to use the
        new performMatch and match. Also change to use OwnArrayPtr.

oliver's avatar
oliver committed
1670
1671
1672
1673
2007-10-31  Oliver Hunt  <oliver@apple.com>

        * kjs/nodes.h: include OwnPtr.h

1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
2007-10-31  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::statementListPushFIFO):
        (KJS::statementListGetDeclarations):
        (KJS::statementListInitializeDeclarationStacks):
        (KJS::statementListInitializeVariableAccessStack):
        (KJS::statementListExecute):
        (KJS::BlockNode::optimizeVariableAccess):
        (KJS::BlockNode::BlockNode):
        (KJS::BlockNode::getDeclarations):
        (KJS::BlockNode::execute):
        (KJS::CaseClauseNode::optimizeVariableAccess):
        (KJS::CaseClauseNode::getDeclarations):
        (KJS::CaseClauseNode::evalStatements):
        (KJS::FunctionBodyNode::initializeDeclarationStacks):
        (KJS::FunctionBodyNode::optimizeVariableAccess):
        * kjs/nodes.h:
        * kjs/nodes2string.cpp:
        (KJS::statementListStreamTo):
        (KJS::BlockNode::streamTo):
        (KJS::CaseClauseNode::streamTo):

bdash's avatar
bdash committed
1702
1703
2007-10-30  Mark Rowe  <mrowe@apple.com>

1704
1705
        * kjs/property_map.cpp: Added a missing using directive to fix the build
        for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
bdash's avatar
bdash committed
1706

mjs's avatar
mjs committed
1707
1708
2007-10-31  Maciej Stachowiak  <mjs@apple.com>

1709
1710
        * kjs/property_map.cpp: Include HashTable.h the right way to fix the build
        for non-Mac ports.
mjs's avatar
mjs committed
1711

ap's avatar
ap committed
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
2007-10-31  Alexey Proskuryakov  <ap@webkit.org>

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=11001
        WebKit doesn't support RegExp.compile method

        Test: fast/js/regexp-compile.html

        * kjs/regexp_object.cpp:
        (RegExpPrototype::RegExpPrototype):
        (RegExpProtoFunc::callAsFunction):
        * kjs/regexp_object.h:
        (KJS::RegExpProtoFunc::):
        Added RegExp.compile.

        * tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.

mjs's avatar
mjs committed
1730
1731
2007-10-31  Maciej Stachowiak  <mjs@apple.com>

1732
        Reviewed by Oliver.
mjs's avatar
mjs committed
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
        
        - get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
        
        Integer divide sucks. Fortunately, a bunch of shifts and XORs
        biased towards the high bits is sufficient to provide a good
        double hash. Besides the SunSpider win, I used the dump statistics
        mode for both to verify that collisions did not increase and that
        the longest collision chain is not any longer.

        * kjs/property_map.cpp:
        (KJS::doubleHash):
        (KJS::PropertyMap::get):
        (KJS::PropertyMap::getLocation):
        (KJS::PropertyMap::put):
        (KJS::PropertyMap::insert):
        (KJS::PropertyMap::remove):
        (KJS::PropertyMap::checkConsistency):
        * wtf/HashTable.h:
        (WTF::doubleHash):
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):
        (WTF::::add):

aroben's avatar
aroben committed
1757
1758
2007-10-30  Adam Roben  <aroben@apple.com>

1759
1760
        * kjs/collector.h: Make HeapType public so it can be used for non-member
        things like the HeapConstants struct template. Fixes the build on Windows.
aroben's avatar
aroben committed
1761

1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
2007-10-30  Adam Roben  <aroben@apple.com>

        Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows

        Speeds up SunSpider by 0.4%.

        Reviewed by Steve and Maciej.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
        a warning during LTCG in release builds about double -> float
        conversion.
        * wtf/AlwaysInline.h:
        * wtf/FastMalloc.h:

1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
2007-10-30  Adam Roben  <aroben@apple.com>

        Use GetCurrentThreadId instead of pthread_self in FastMalloc

        Speeds up SunSpider by 0.3%.

        Reviewed by Steve.

        * wtf/FastMalloc.cpp:
        (WTF::TCMalloc_ThreadCache::InitTSD):
        (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):

1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
2007-10-30  Adam Roben  <aroben@apple.com>

        Switch to a Win32 critical section implementation of spinlocks
        
        Speeds up SunSpider by 0.4%.
        
        Reviewed by Steve.
        
        * wtf/FastMalloc.cpp:
        * wtf/TCSpinLock.h:
        (TCMalloc_SpinLock::TCMalloc_SpinLock):
        (TCMalloc_SpinLock::Init):
        (TCMalloc_SpinLock::Finalize):
        (TCMalloc_SpinLock::Lock):
        (TCMalloc_SpinLock::Unlock):
        * wtf/TCSystemAlloc.cpp:

1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
2007-10-30  Adam Roben  <aroben@apple.com>

        Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta

        http://bugs.webkit.org/show_bug.cgi?id=15586

        Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll

        Use Win32 TLS functions instead of __declspec(thread), which breaks
        delay-loading.

        Reviewed by Steve.

        * wtf/FastMalloc.cpp:
        (WTF::getThreadHeap):
        (WTF::TCMalloc_ThreadCache::InitModule):

mjs's avatar
mjs committed
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
2007-10-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - allocate numbers in half-size cells, for an 0.5% SunSpider speedup
        http://bugs.webkit.org/show_bug.cgi?id=15772
        
        We do this by using a single mark bit per two number cells, and
        tweaking marking.
        
        Besides being an 0.5% win overall, this is a 7.1% win on morph.

        * kjs/collector.cpp:
        (KJS::):
        (KJS::Collector::heapAllocate):
        (KJS::Collector::markStackObjectsConservatively):
        (KJS::Collector::sweep):
        * kjs/collector.h:
        (KJS::SmallCollectorCell::):

1842
1843
1844
1845
1846
1847
1848
1849
2007-10-30  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Adam Roben, Sam Weinig.
        
        Made conflicts in grammar.y a persistent build failure.

        * DerivedSources.make:

kmccullo's avatar
kmccullo committed
1850
1851
1852
1853
1854
1855
1856
1857
1858
2007-10-30  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Adam and Geoff.

        - Added a new cast so all the casts are in the same place.

        * API/APICast.h:
        (toGlobalRef):

ggaren's avatar
ggaren committed
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
2007-10-30  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.

        Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
        
        JS tests, including 

            ecma_2/Statements/dowhile-001.js
            ecma_2/Statements/dowhile-002.js
            ecma_2/Statements/dowhile-003.js
            ecma_2/Statements/dowhile-004.js
            ecma_2/Statements/dowhile-005.js
            ecma_2/Statements/dowhile-006.js
            ecma_2/Statements/dowhile-007.js
            js1_2/statements/do_while.js

        and layout tests, including

            do-while-expression-value.html
            do-while-semicolon.html
            do-while-without-semicolon.html
        
        pass.
        
        * kjs/grammar.y: Use the explicit "error" production, as we do with other
        automatic semicolon insertions, to disambiguate "do { } while();" from
        "do { } while()" followed by ";" (the empty statement).

1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
2007-10-29  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Debranching remaining assignment nodes, and miscellaneous cleanup
        
        Split read-modify code paths out of AssignBracketNode and AssignDotNode
        Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode 
        and ReadModifyResolveNode evaluate methods

        Leads to a 1% gain in SunSpider.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::ReadModifyLocalVarNode::evaluate):
        (KJS::ReadModifyResolveNode::evaluate):
        (KJS::AssignDotNode::evaluate):
        (KJS::ReadModifyDotNode::optimizeVariableAccess):
        (KJS::ReadModifyDotNode::evaluate):
        (KJS::AssignBracketNode::evaluate):
        (KJS::ReadModifyBracketNode::optimizeVariableAccess):
        (KJS::ReadModifyBracketNode::evaluate):
        * kjs/nodes.h:
        (KJS::AssignBracketNode::):
        (KJS::AssignBracketNode::precedence):
        (KJS::AssignDotNode::):
        (KJS::AssignDotNode::precedence):
        * kjs/nodes2string.cpp:
        (KJS::ReadModifyBracketNode::streamTo):
        (KJS::AssignBracketNode::streamTo):
        (KJS::ReadModifyDotNode::streamTo):
        (KJS::AssignDotNode::streamTo):

1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2007-10-29  Oliver Hunt  <oliver@apple.com>

        Debranching various Node::evaluate implementations
        
        Reviewed by Maciej.
        
        Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
        Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
        
        Gains 1.6% on SunSpider

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::PostIncResolveNode::optimizeVariableAccess):
        (KJS::PostIncResolveNode::evaluate):
        (KJS::PostIncLocalVarNode::evaluate):
        (KJS::PostDecResolveNode::optimizeVariableAccess):
        (KJS::PostDecResolveNode::evaluate):
        (KJS::PostDecLocalVarNode::evaluate):
        (KJS::PostIncBracketNode::evaluate):
        (KJS::PostDecBracketNode::evaluate):
        (KJS::PostIncDotNode::evaluate):
        (KJS::PostDecDotNode::evaluate):
        (KJS::PreIncResolveNode::optimizeVariableAccess):
        (KJS::PreIncLocalVarNode::evaluate):
        (KJS::PreIncResolveNode::evaluate):
        (KJS::PreDecResolveNode::optimizeVariableAccess):
        (KJS::PreDecLocalVarNode::evaluate):
        (KJS::PreDecResolveNode::evaluate):
        (KJS::PreIncBracketNode::evaluate):
        (KJS::PreDecBracketNode::evaluate):
        (KJS::PreIncDotNode::evaluate):
        (KJS::PreDecDotNode::evaluate):
        (KJS::ReadModifyResolveNode::optimizeVariableAccess):
        (KJS::AssignResolveNode::optimizeVariableAccess):
        (KJS::AssignLocalVarNode::evaluate):
        (KJS::AssignResolveNode::evaluate):
        * kjs/nodes.h:
        (KJS::PostDecResolveNode::):
        (KJS::PostDecResolveNode::precedence):
        (KJS::PostDecLocalVarNode::):
        (KJS::PostfixBracketNode::):
        (KJS::PostfixBracketNode::precedence):
        (KJS::PostIncBracketNode::):
        (KJS::PostIncBracketNode::isIncrement):
        (KJS::PostDecBracketNode::):
        (KJS::PostDecBracketNode::isIncrement):
        (KJS::PostfixDotNode::):
        (KJS::PostfixDotNode::precedence):
        (KJS::PostIncDotNode::):
        (KJS::PostIncDotNode::isIncrement):
        (KJS::PostDecDotNode::):
        (KJS::PreIncResolveNode::):
        (KJS::PreDecResolveNode::):
        (KJS::PreDecResolveNode::precedence):
        (KJS::PreDecLocalVarNode::):
        (KJS::PrefixBracketNode::):
        (KJS::PrefixBracketNode::precedence):
        (KJS::PreIncBracketNode::):
        (KJS::PreIncBracketNode::isIncrement):
        (KJS::PreDecBracketNode::):
        (KJS::PreDecBracketNode::isIncrement):
        (KJS::PrefixDotNode::):
        (KJS::PrefixDotNode::precedence):
        (KJS::PreIncDotNode::):
        (KJS::PreIncDotNode::isIncrement):
        (KJS::PreDecDotNode::):
        (KJS::ReadModifyResolveNode::):
        (KJS::ReadModifyLocalVarNode::):
        (KJS::AssignResolveNode::):
        (KJS::AssignResolveNode::precedence):
        * kjs/nodes2string.cpp:
        (KJS::PostIncResolveNode::streamTo):
        (KJS::PostDecResolveNode::streamTo):
        (KJS::PostfixBracketNode::streamTo):
        (KJS::PostfixDotNode::streamTo):
        (KJS::PreIncResolveNode::streamTo):
        (KJS::PreDecResolveNode::streamTo):
        (KJS::ReadModifyResolveNode::streamTo):
        (KJS::AssignResolveNode::streamTo):

mjs's avatar
mjs committed
2003
2004
2005
2006
2007
2008
2009
2010
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed, build fix.
        
        - Include Vector.h in a way that actually works.

        * kjs/LocalStorage.h:

mjs's avatar
mjs committed
2011
2012
2013
2014
2015
2016
2017
2018
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed, build fix.
        
        - Install LocalStorage.h as a private header.

        * JavaScriptCore.xcodeproj/project.pbxproj:

mjs's avatar
mjs committed
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/LocalStorage.h: Added.
        (KJS::LocalStorageEntry::LocalStorageEntry):
        (WTF::):
        * kjs/function.h:
        * kjs/nodes.cpp:
        (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):

ggaren's avatar
ggaren committed
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2007-10-29  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Some small tweaks that I notice while reviewing Oliver's last patch.
        
        Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
        
        No change in SunSpider because SunSpider doesn't take the code path that
        would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.

        * kjs/nodes.cpp:
        (KJS::LocalVarPostfixNode::evaluate):
        (KJS::TypeOfResolveNode::optimizeVariableAccess):
        (KJS::LocalVarTypeOfNode::evaluate):
        (KJS::PrefixResolveNode::optimizeVariableAccess):
        (KJS::LocalVarPrefixNode::evaluate):
        (KJS::AssignResolveNode::optimizeVariableAccess):
        (KJS::LocalVarAssignNode::evaluate):
        * kjs/nodes.h:
        (KJS::LocalVarTypeOfNode::):
        (KJS::PrefixResolveNode::):
        (KJS::LocalVarPrefixNode::):
        (KJS::AssignResolveNode::):
        (KJS::LocalVarAssignNode::):

2060
2061
2062
2063
2064
2065
2066
2067
2068
2007-10-29  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        SunSpider claims this was a 0.7% speedup.

        * kjs/string_object.cpp:
        (KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case

mjs's avatar
mjs committed
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2007-10-29  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Mark.
        
        - re-enable asserts for access to empty or deleted keys

        * wtf/HashTable.h:
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):
        (WTF::::add):

2081
2082
2083
2084
2085
2086
2007-10-29  Eric Seidel  <eric@webkit.org>

        Build fix only, no review.

        * JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot

2087
2088
2089
2090
2091
2092
2093
2007-10-29  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.  Move struct declarations into nodes.h.

        * kjs/grammar.y:
        * kjs/nodes.h:

2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2007-10-29  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.
        
        Give StringInstance a getOwnPropertySlot(ExecState, unsigned, PropertySlot) fastpath, just like Arrays.
        Make it a compile time error to use toString(ExecState) on a StringInstance
        
        SunSpider claims this was a 6.6% speedup overall (22% on string-base64)

        * kjs/internal.h:
        (KJS::StringImp::getLength):
        * kjs/string_object.cpp:
        (KJS::StringInstance::lengthGetter):
        (KJS::StringInstance::inlineGetOwnPropertySlot):
        (KJS::StringInstance::getOwnPropertySlot):
        * kjs/string_object.h:

2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2007-10-28  Oliver Hunt  <oliver@apple.com>

        Reviewed by Darin.

        Add nodes to allow Assignment, TypeOf, and prefix operators to 
        make use of the new optimised local variable look up.

        5% gain on sunspider

        * kjs/nodes.cpp:
        (KJS::TypeOfResolveNode::optimizeVariableAccess):
        (KJS::LocalTypeOfAccessNode::evaluate):
        (KJS::PrefixResolveNode::optimizeVariableAccess):
        (KJS::PrefixLocalAccessNode::evaluate):
        (KJS::AssignResolveNode::optimizeVariableAccess):
        (KJS::AssignLocalAccessNode::evaluate):
        * kjs/nodes.h:
        (KJS::TypeOfResolveNode::):
        (KJS::TypeOfResolveNode::precedence):
        (KJS::LocalTypeOfAccessNode::):
        (KJS::PrefixResolveNode::):
        (KJS::PrefixResolveNode::precedence):
        (KJS::PrefixLocalAccessNode::):
        (KJS::AssignResolveNode::):
        (KJS::AssignLocalAccessNode::):

mjs's avatar
mjs committed
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2007-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - avoid creating and then breaking circular lists in the parser, instead track head and tail pointers at parse time
        http://bugs.webkit.org/show_bug.cgi?id=15748
        
        Not a significant speedup or slowdown on SunSpider.

        * kjs/Parser.cpp:
        (KJS::clearNewNodes):
        * kjs/Parser.h:
        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::BlockNode::BlockNode):
        (KJS::CaseBlockNode::CaseBlockNode):
        (KJS::FunctionBodyNode::FunctionBodyNode):
        (KJS::SourceElementsNode::SourceElementsNode):
        (KJS::ProgramNode::ProgramNode):
        * kjs/nodes.h:
        (KJS::ElementNode::):
        (KJS::ArrayNode::):
        (KJS::PropertyListNode::):
        (KJS::ObjectLiteralNode::):
        (KJS::ArgumentListNode::):
        (KJS::ArgumentsNode::):
        (KJS::VarDeclListNode::):
        (KJS::VarStatementNode::):
        (KJS::ForNode::):
        (KJS::ParameterNode::):
        (KJS::FuncExprNode::):
        (KJS::FuncDeclNode::):
        (KJS::SourceElementsNode::):
        (KJS::CaseClauseNode::):
        (KJS::ClauseListNode::):

2173
2174
2175
2176
2177
2178
2179
2180
2181
2007-10-28  Mark Rowe  <mrowe@apple.com>

        Disable assertions in a manner that doesn't break the Qt Windows build.

        * wtf/HashTable.h:
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):

2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2007-10-28  Geoffrey Garen  <ggaren@apple.com>

        Temporarily disabling some ASSERTs I introduced in my last check-in 
        because of http://bugs.webkit.org/show_bug.cgi?id=15747
        Lots of layout tests fail the !HashTranslator::equal(KeyTraits::emptyValue() ASSERT

        * wtf/HashTable.h:
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):
        (WTF::::add):

ggaren's avatar
ggaren committed
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2007-10-28  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=15746
        #ifndef ASSERT_DISABLED is no good!
        
        Replaced with #if !ASSERT_DISABLED.

        * wtf/HashTable.h:
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):
        (WTF::::add):

ggaren's avatar
ggaren committed
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2007-10-28  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Added FunctionCallResolveNode, PostfixResolveNode, and DeleteResolveNode
        to the AST transfom that replaces slow resolve nodes with fast local 
        variable alternatives.
        
        2.5% speedup on SunSpider.
        
        Also added some missing copyright notices.
        
        * kjs/nodes.cpp:
        (KJS::FunctionCallResolveNode::optimizeVariableAccess):
        (KJS::FunctionCallResolveNode::evaluate):
        (KJS::LocalVarFunctionCallNode::evaluate):
        (KJS::PostfixResolveNode::optimizeVariableAccess):
        (KJS::PostfixResolveNode::evaluate):
        (KJS::LocalVarPostfixNode::evaluate):
        (KJS::DeleteResolveNode::optimizeVariableAccess):
        (KJS::DeleteResolveNode::evaluate):
        (KJS::LocalVarDeleteNode::evaluate):
        * kjs/nodes.h:
        (KJS::FunctionCallResolveNode::):
        (KJS::LocalVarFunctionCallNode::LocalVarFunctionCallNode):
        (KJS::PostfixResolveNode::):
        (KJS::LocalVarPostfixNode::LocalVarPostfixNode):
        (KJS::DeleteResolveNode::):
        (KJS::LocalVarDeleteNode::LocalVarDeleteNode):

2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2007-10-28  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.
        
        Inline UString::Rep::deref() for a 0.8% improvement in SunSpider
        Add virtual keyword to a few virtual functions previously unmarked.

        * kjs/internal.h:
        (KJS::StringImp::type):
        (KJS::NumberImp::type):
        * kjs/ustring.h:
        (KJS::UString::Rep::deref):

2252
2253
2254
2255
2256
2257
2258
2007-10-28  Darin Adler  <darin@apple.com>

        - fix "broken everything" from the storage leak fix

        * wtf/RefPtr.h: (WTF::RefPtr::RefPtr): Added a PlacementNewAdopt constructor.
        * kjs/ustring.h: (KJS::UString::UString): Pass PlacementNewAdopt along to RefPtr.

darin's avatar
darin committed
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2007-10-28  Darin Adler  <darin@apple.com>

        Reviewed by Adam.

        - turn on unused parameter waring on Mac OS X because it's already on elsewhere

        * Configurations/Base.xcconfig: Took out -wno-unused-parameter.

        * API/JSNode.c:
        * API/JSNodeList.c:
        * API/minidom.c:
        * API/testapi.c:
        Fixed unused variables by using them or marked them with UNUSED_PARAM.

        * kjs/CollectorHeapIntrospector.h: (KJS::CollectorHeapIntrospector::zoneCalloc):
        Removed parameter names to indicate they are unused.

darin's avatar
darin committed
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2007-10-28  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix a storage leak where we ref the UString every time we replace
          a ResolveNode with a LocalVarAccessNode

        * kjs/identifier.h: (KJS::Identifier::Identifier): Added a constructor
        that takes PlacementNewAdopt.

        * kjs/nodes.h: (KJS::ResolveNode::ResolveNode): Initialize the ident
        with PlacementNewAdopt instead of the old value of ident.

        * kjs/ustring.h: (KJS::UString::UString): Added a constructor that
        takes PlacementNewAdopt.

2292
2293
2294
2295
2296
2297
2298
2299
2007-10-28  Darin Adler  <darin@apple.com>

        - Windows build fix; get rid of unused parameter

        * kjs/nodes.cpp: (KJS::ResolveNode::optimizeVariableAccess): Don't pass it.
        * kjs/nodes.h: (KJS::LocalVarAccessNode::LocalVarAccessNode): Remove it.
        The assertions weren't all that helpful.

2300
2301
2302
2303
2304
2305
2007-10-28  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.  Add include of MathExtras.h.

        * kjs/string_object.cpp:

2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2007-10-28  Mark Rowe  <mrowe@apple.com>

        Reviewed by Maciej and Tim.

        Replace uses of isNaN and isInf with isnan and isinf, and
        remove isNaN and isInf.

        * kjs/config.h: Remove unused HAVE_'s.
        * kjs/date_object.cpp:
        (KJS::DateInstance::getTime):
        (KJS::DateInstance::getUTCTime):
        (KJS::DateProtoFunc::callAsFunction):
        (KJS::DateObjectImp::construct):
        (KJS::DateObjectFuncImp::callAsFunction):
        * kjs/function.cpp:
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/math_object.cpp:
        (MathFuncImp::callAsFunction):
        * kjs/nodes2string.cpp:
        (KJS::isParserRoundTripNumber):
        * kjs/number_object.cpp:
        (NumberProtoFunc::callAsFunction):
        * kjs/operations.cpp:
        * kjs/operations.h:
        * kjs/string_object.cpp:
        (KJS::StringProtoFunc::callAsFunction):
        * kjs/ustring.cpp:
        (KJS::UString::from):
        * kjs/value.cpp:
        (KJS::JSValue::toInteger):
        (KJS::JSValue::toInt32SlowCase):
        (KJS::JSValue::toUInt32SlowCase):

2339
2340
2341
2342
2343
2344
2345
2346
2347
2007-10-28  Geoffrey Garen  <ggaren@apple.com>

        Build fix: use the new-fangled missingSymbolMarker().

        * kjs/nodes.cpp:
        (KJS::ResolveNode::optimizeVariableAccess):
        * kjs/nodes.h:
        (KJS::LocalVarAccessNode::LocalVarAccessNode):

2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2007-10-28  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak, Darin Adler.
        
        Much supporting work done by Maciej Stachowiak, Maks Orlovich, and 
        Cameron Zwarich.
        
        AST transfom to replace slow resolve nodes with fast local variable
        alternatives that do direct memory access. Currently, only ResolveNode
        provides a fast local variable alternative. 6 others are soon to come.
        
        16.7% speedup on SunSpider.
        
        Most of this patch is just scaffolding to support iterating all the 
        resolve nodes in the AST through optimizeResolveNodes(). In 
        optimizeResolveNodes(), most classes just push their child nodes onto 
        the processing stack, while ResolveNodes actually replace themselves in 
        the tree with more optimized alternatives, if possible.

        Here are the interesting bits:

        * kjs/nodes.h: Added PlacementNewAdoptTag, along with implementations 
        in Node and ResolveNode. This tag allows you to use placement new to 
        swap out a base class Node in favor of a subclass copy that holds the
        same data. (Without this tag, default initialization would NULL out
        RefPtrs, change line numbers, etc.)

        * kjs/nodes.cpp:
        (KJS::ResolveNode::evaluate): Since we're taking the slow path, ASSERT
        that the fast path is impossible, to make sure we didn't leave anything
        on the table.

        (KJS::FunctionBodyNode::optimizeResolveNodes): Here's where the AST 
        transformation happens.
        
        (KJS::ResolveNode::optimizeResolveNodes): Here's where the ResolveNode
        optimization happens.

        * kjs/function.h: Added symbolTable() accessor for, for the sake of 
        an ASSERT.

2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2007-10-28  Mark Rowe  <mrowe@apple.com>

        Reviewed by Maciej.

        Fix "AllInOneFile.o has a global initializer in it".

        Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
        We can avoid this by moving it inside an inline function.

        * kjs/SymbolTable.h:
        (KJS::missingSymbolMarker):
        * kjs/function.cpp:
        (KJS::ActivationImp::getOwnPropertySlot):
        (KJS::ActivationImp::put):

mjs's avatar
mjs committed
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2007-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Mark.
        
        - Added assertions to protect against adding empty or deleted keys to a HashTable

        * wtf/HashTable.h:
        (WTF::HashTable::lookup):
        (WTF::HashTable::lookupForWriting):
        (WTF::HashTable::fullLookupForWriting):
        (WTF::HashTable::add):

darin's avatar
darin committed
2416
2417
2418
2419
2420
2421
2422
2007-10-28  Darin Adler  <darin@apple.com>

        - fix GTK build

        * kjs/nodes2string.cpp: (KJS::isParserRoundTripNumber):
        Use isNaN and isInf instead of isnan and isinf.

darin's avatar
darin committed
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2007-10-28  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15735
          remove GroupNode to simplify AST and possibly get a modest speedup

        This patch removes 4 node types: GroupNode, PropertyNameNode,
        FunctionCallParenBracketNode, and FunctionCallParenDotNode.

        To remove GroupNode, we add knowledge of precedence to the tree nodes,
        and use that when serializing to determine where parentheses are needed.
        This means we no longer have to represent parentheses in the tree.

        The precedence values are named after productions in the grammar from the
        JavaScript standard.

        SunSpider says this is an 0.4% speedup.

        * kjs/function.h:
        * kjs/function.cpp: Removed escapeStringForPrettyPrinting -- it's part of
        serialization, so I moved it to the file that takes care of that.

        * kjs/grammar.y: Changed makeGetterOrSetterPropertyNode to use 0 to
        indicate failure instead of a separate boolean. Got rid of PropertyNameNode
        by merging the PropertyName rule into the Property rule (which was easier
        than figuring out how to pass the Identifier from one node to another).
        Got rid of GroupNode, nodeInsideAllParens(), FunctionCallParenBracketNode,
        and FunctionCallParenDotNode.

        * kjs/nodes.h: Removed unused forward declarations and Operator values.
        Added Precedence enum, and precedence function to all nodes. Removed
        nodeInsideAllParens. Added streamBinaryOperator function for serialization.
        Removed GroupNode and PropertyNameNode. Made PropertyNode store an Identifier.
        Removed FunctionCallParenBracketNode and FunctionCallParenDotNode.

        * kjs/nodes.cpp: Removed Node::nodinsideAllParens, GroupNode, and PropertyNameNode.
        (KJS::PropertyListNode::evaluate): Changed code to get name directly instead
        of converting it from an Identifier to a jsString then back to a UString
        then into an Identifier again!

        * kjs/nodes2string.cpp: Changed special-token implementation to use a separate
        function for each of Endl, Indent, Unindent, and DotExpr instead of using a
        single function with a switch. Added a precedence that you can stream in, to
        cause the next node serialized to add parentheses based on that precedence value.
        (KJS::operatorString): Moved to the top of the file.
        (KJS::escapeStringForPrettyPrinting): Moved here from function.cpp. Removed old
        workaround for snprintf, since StringExtras.h takes care of that.
        (KJS::operator<<): Made the char and char* versions faster by using UString's
        character append functions instead of constructing a UString. Added the logic
        to the Node* version to add parentheses if needed.
        (KJS::Node::streamLeftAssociativeBinaryOperator): Added helper function.
        (KJS::ElementNode::streamTo): Use PrecAssignment for the elements.
        (KJS::BracketAccessorNode::streamTo): Use PrecCall for the expression before
        the bracket.
        (KJS::DotAccessorNode::streamTo): Use PrecCall for the expression before the dot.
        (KJS::ArgumentListNode::streamTo): Use PrecAssignment for the arguments.
        (KJS::NewExprNode::streamTo): Use PrecMember for the expression.
        (KJS::FunctionCallValueNode::streamTo): Use PrecCall.
        (KJS::FunctionCallBracketNode::streamTo): Ditto.
        (KJS::FunctionCallDotNode::streamTo): Ditto.
        (KJS::PostfixBracketNode::streamTo): Ditto.
        (KJS::PostfixDotNode::streamTo): Ditto.
        (KJS::PostfixErrorNode::streamTo): Use PrecLeftHandSide.
        (KJS::DeleteBracketNode::streamTo): Use PrecCall.
        (KJS::DeleteDotNode::streamTo): Ditto.
        (KJS::DeleteValueNode::streamTo): Use PrecUnary.
        (KJS::VoidNode::streamTo): Ditto.
        (KJS::TypeOfValueNode::streamTo): Ditto.
        (KJS::PrefixBracketNode::streamTo): Use PrecCall.
        (KJS::PrefixDotNode::streamTo): Ditto.
        (KJS::PrefixErrorNode::streamTo): Use PrecUnary.
        (KJS::UnaryPlusNode::streamTo): Ditto.
        (KJS::NegateNode::streamTo): Ditto.
        (KJS::BitwiseNotNode::streamTo): Ditto.
        (KJS::LogicalNotNode::streamTo): Ditto.
        (KJS::MultNode::streamTo): Use streamLeftAssociativeBinaryOperator.
        (KJS::DivNode::streamTo): Ditto.
        (KJS::ModNode::streamTo): Ditto.
        (KJS::AddNode::streamTo): Ditto.
        (KJS::SubNode::streamTo): Ditto.
        (KJS::LeftShiftNode::streamTo): Ditto.
        (KJS::RightShiftNode::streamTo): Ditto.
        (KJS::UnsignedRightShiftNode::streamTo): Ditto.
        (KJS::LessNode::streamTo): Ditto.
        (KJS::GreaterNode::streamTo): Ditto.
        (KJS::LessEqNode::streamTo): Ditto.
        (KJS::GreaterEqNode::streamTo): Ditto.
        (KJS::InstanceOfNode::streamTo): Ditto.
        (KJS::InNode::streamTo): Ditto.
        (KJS::EqualNode::streamTo): Ditto.
        (KJS::NotEqualNode::streamTo): Ditto.
        (KJS::StrictEqualNode::streamTo): Ditto.
        (KJS::NotStrictEqualNode::streamTo): Ditto.
        (KJS::BitAndNode::streamTo): Ditto.
        (KJS::BitXOrNode::streamTo): Ditto.
        (KJS::BitOrNode::streamTo): Ditto.
        (KJS::LogicalAndNode::streamTo): Ditto.
        (KJS::LogicalOrNode::streamTo): Ditto.
        (KJS::ConditionalNode::streamTo): Ditto.
        (KJS::AssignResolveNode::streamTo): Use PrecAssignment for the right side.
        (KJS::AssignBracketNode::streamTo): Use PrecCall for the expression before
        the bracket and PrecAssignment for the right side.
        (KJS::AssignDotNode::streamTo): Ditto.
        (KJS::AssignErrorNode::streamTo): Use PrecLeftHandSide for the left side
        and PrecAssignment for the right side.
        (KJS::CommaNode::streamTo): Use PrecAssignment for both expressions.
        (KJS::AssignExprNode::streamTo): Use PrecAssignment.

2532
2533
2534
2535
2536
2537
2538
2539
2007-10-28  Kevin Ollivier  <kevino@theolliviers.com>

        Define wx port and set wx port USE options.

        Reviewed by Adam Roben.

        * wtf/Platform.h:

2540
2541
2542
2543
2544
2545
2546
2547
2548
2007-10-28  Mark Rowe  <mrowe@apple.com>

        We don't include "config.h" in headers.

        * bindings/jni/jni_instance.h:
        * kjs/regexp.h:
        * wtf/TCPageMap.h:
        * wtf/TCSpinLock.h:

mjs's avatar
mjs committed
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2007-10-28  Maciej Stachowiak  <mjs@apple.com>

        Rubber stamped by Mark.
        
        - avoid using non-portable SIZE_T_MAX in favor of std::numeric_limits

        * kjs/SymbolTable.h:
        (KJS::SymbolTableIndexHashTraits::emptyValue):
        * kjs/function.cpp:
        (KJS::ActivationImp::getOwnPropertySlot):
        (KJS::ActivationImp::put):

mjs's avatar
mjs committed
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2007-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Eric.
        
        - switch SymbolTable to be a HashMap instead of a PropertyMap for 3% SunSpider speedup

        * kjs/SymbolTable.h:
        (KJS::IdentifierRepHash::hash): Special hash function for identifier reps.
        (KJS::IdentifierRepHash::equal): ditto
        (KJS::SymbolTableIndexHashTraits::emptyValue): Special HashTraits for the index value.
        (KJS::SymbolTable): change to a typedef for a HashMap.
        * kjs/function.cpp:
        (KJS::ActivationImp::getOwnPropertySlot): Adjusted for new SymbolTable API.
        (KJS::ActivationImp::deleteProperty): ditto
        (KJS::ActivationImp::put): ditto

        * kjs/nodes.cpp:
        (KJS::FunctionBodyNode::initializesymbolTable): Adjusted, since
        you now have to store a UString::rep, not an identifier.

mjs's avatar
mjs committed
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2007-10-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - numerous HashTable performance improvements
        
        This does not quite add up to a measurable win on SunSpider, but it allows a
        follow-on > 3% improvement and probably helps WebCore too.
        
        I made the following improvements, among others:
        
        - Made HashFunctions note whether it is ok to compare a real value with the equal() function
        to the empty or deleted value, and used this to optimize the comparisons done in hash lookup.
        
        - Specialized lookup so it doesn't have to do so many extra branches and build so many extra
        std::pairs for cases that don't need them. There are now four versions, one for read-only access,
        two for writing, and one folded directly into add() (these all were improvments).
        
        - Made HashMap::get() use lookup() directly instead of find() to avoid having to build iterators.
        
        - Made a special constructor for iterators that knows it points to
        a valid filled cell and so skips updating itself.

darin's avatar
darin committed
2604
        - Reordered memory accesses in the various lookup functions for better code generation
mjs's avatar
mjs committed
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
        
        - Made simple translators avoid passing a hash code around
        
        - Other minor tweaks
        
        * wtf/HashTable.h:
        (WTF::):
        (WTF::HashTableConstIterator::HashTableConstIterator):
        (WTF::HashTableIterator::HashTableIterator):
        (WTF::IdentityHashTranslator::translate):
        (WTF::HashTable::end):
        (WTF::HashTable::lookup):
        (WTF::HashTable::lookupForWriting):
        (WTF::HashTable::makeKnownGoodIterator):
        (WTF::HashTable::makeKnownGoodConstIterator):
        (WTF::::lookup):
        (WTF::::lookupForWriting):
        (WTF::::fullLookupForWriting):
        (WTF::::add):
        (WTF::::addPassingHashCode):
        (WTF::::reinsert):
        (WTF::::find):
        (WTF::::contains):
        * kjs/identifier.cpp:
        (WTF::):
        * wtf/HashFunctions.h:
        (WTF::):
        * wtf/HashMap.h:
        (WTF::):
        (WTF::::get):
        * wtf/HashSet.h:
        (WTF::):
        (WTF::::add):
        * wtf/ListHashSet.h:
        (WTF::ListHashSetTranslator::translate):

darin's avatar
darin committed
2641
2642
2643
2644
2645
2646
2647
2648
2649
2007-10-27  Darin Adler  <darin@apple.com>

        Reviewed by Eric.

        - fix ASCIICType.h for some Windows compiles

        * wtf/ASCIICType.h: Check the compiler, not the OS, since it's the
        compiler/library that has the wchar_t that is just a typedef.

kmccullo's avatar
kmccullo committed
2650
2651
2652
2653
2654
2655
2656
2007-10-27  Kevin McCullough  <kmccullough@apple.com>

        - BuildFix
        - Forgot to change the build step when I changed the filename.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

ggaren's avatar
ggaren committed
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2007-10-27  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Fixed the rest of "ASSERTION FAILED: _hash in KJS::UString::Rep::
        computedHash()"
        http://bugs.webkit.org/show_bug.cgi?id=15718

        * kjs/identifier.cpp: Fixed more cases where an Identifier didn't get a 
        hash value. Also changed O(n) strlen to O(1) check for empty string.
        (KJS::Identifier::add):

        * kjs/ustring.cpp: Changed O(n) strlens to O(1) checks for empty string.
        (KJS::UString::UString):
        (KJS::UString::operator=):

darin's avatar
darin committed
2673
2674
2675
2676
2007-10-27  Darin Adler  <darin@apple.com>

        Reviewed by Eric.

darin's avatar
darin committed
2677
        - fix pow on Windows
darin's avatar
darin committed
2678
2679
2680
2681
2682
2683
2684
2685

        * wtf/MathExtras.h: (wtf_pow): Add a special case for MSVC, which has
        a "pow" function that does not properly handle the case where arg1 is
        NaN and arg2 is 0.

        * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Don't explicity
        specify "::pow" -- just "pow" is fine.

darin's avatar
darin committed
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2007-10-27  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15711
          force JSImmediate to be inlined for roughly 1.2% SunSpider speedup

        * kjs/JSImmediate.h: Put ALWAYS_INLINE on everything.

        * kjs/object.h: Removed redundant includes.
        * kjs/value.h: Ditto.

mjs's avatar
mjs committed
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2007-10-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Mark.
        
        - fixed "ASSERTION FAILED: _hash in KJS::UString::Rep::computedHash()"
        http://bugs.webkit.org/show_bug.cgi?id=15718

        * kjs/identifier.cpp:
        (KJS::Identifier::addSlowCase): Ensure that empty Identifiers have a hash computed,
        now that we count on all Identifiers already having one.

2709
2710
2711
2712
2713
2714
2007-10-27  Mark Rowe  <mrowe@apple.com>

        Silence a warning.

        * kjs/SymbolTable.h:

2715
2716
2717
2718
2719
2720
2007-10-27  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/function.h:

kmccullo's avatar
kmccullo committed
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2007-10-26  Kevin McCullough  <kmccullough@apple.com>

       Rubber stamp by Adam. 

        - Renamed JSStringRefCOM to JSStringRefBSTR since it he only thing the
        files contain are functions that operate on BSTRs.

        * API/JSStringRefBSTR.cpp: Copied from API/JSStringRefCOM.cpp.
        * API/JSStringRefBSTR.h: Copied from API/JSStringRefCOM.h.
        * API/JSStringRefCOM.cpp: Removed.
        * API/JSStringRefCOM.h: Removed.
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

kmccullo's avatar
kmccullo committed
2734
2735
2736
2737
2738
2739
2740
2741
2742
2007-10-26  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Adam.

        - Made JSStringCreateWithBSTR capable of handling null BSTRs.

        * API/JSStringRefCOM.cpp:
        (JSStringCreateWithBSTR):

weinig's avatar
weinig committed
2743
2744
2745
2746
2747
2748
2749
2007-10-26  Sam Weinig  <sam@webkit.org>

        Windows build fix.

        * kjs/SymbolTable.h: Add header gaurd.
        * kjs/nodes.h: #include "SymbolTable.h"

ggaren's avatar
ggaren committed
2750
2751
2752
2753
2754
2755
2756
2757
2758
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Suggested by Anders Carlsson.
        
        Fixed tyop.

        * kjs/function.cpp:
        (KJS::ActivationImp::getOwnPropertySlot):

ggaren's avatar
ggaren committed
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Suggested by Darin Adler.
        
        Use computedHash(), which is safer than just directly accessing _hash.

        * kjs/lookup.cpp:
        (KJS::Lookup::findEntry):
        (KJS::Lookup::find):

ggaren's avatar
ggaren committed
2769
2770
2771
2772
2773
2774
2775
2776
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Build fix: svn add SymbolTable.h

        * kjs/SymbolTable.h: Added.
        (KJS::SymbolTable::set):
        (KJS::SymbolTable::get):

2777
2778
2779
2780
2781
2782
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Build fix: export SymbolTable.h to WebCore.

        * JavaScriptCore.xcodeproj/project.pbxproj:

ggaren's avatar
ggaren committed
2783
2784
2785
2786
2787
2788
2789
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Comment tweak suggested by Maciej.

        * kjs/function.cpp:
        (KJS::ActivationImp::getOwnPropertySlot):

ggaren's avatar
ggaren committed
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Tweaked property maps to remove 2 branches. 2.5% speedup on SunSpider.

        * kjs/property_map.cpp: Use a special no branch accessor to the UString's
        hash value. Also, return immediately instead of branching to the end
        of the loop if the value is not found.
        (KJS::PropertyMap::get):
        (KJS::PropertyMap::getLocation):
        (KJS::PropertyMap::put):
        (KJS::PropertyMap::insert):
        (KJS::PropertyMap::remove):
        (KJS::PropertyMap::checkConsistency):

        * kjs/ustring.h:
        (KJS::UString::Rep::computedHash): Special no branch accessor to the
        UString's hash value. Used when the caller knows that the hash value
        has already been computed. (For example, if the caller got the UString
        from an Identifier.)

ggaren's avatar
ggaren committed
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Switched ActivationImp to using a symbol table. For now, though, all
        clients take the slow path.
        
        Net .6% speedup on SunSpider.
        </