ChangeLog 144 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
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):

58
59
60
61
62
63
64
65
66
67
68
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):

69
70
71
72
73
74
2007-11-07  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/regexp_object.cpp:

ggaren@apple.com's avatar
ggaren@apple.com committed
75
76
77
78
79
80
81
82
83
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
2007-11-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861 
        15% of string-validate-input.js is spent compiling the same regular expression.

        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.)

119
120
121
122
123
124
125
126
127
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:

128
129
130
131
132
133
134
135
136
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
137
138
139
140
141
142
143
144
145
146
147
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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.

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
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):

190
191
192
193
194
195
196
197
198
199
200
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
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.

243
244
245
246
247
248
249
250
251
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):

252
253
254
255
256
257
258
259
260
261
262
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):

263
264
265
266
267
268
269
270
271
272
273
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 + *

274
275
276
277
278
279
280
281
282
283
284
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)

285
286
287
288
289
290
291
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Mac build fix.

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

aroben's avatar
aroben committed
292
293
294
295
296
297
2007-11-05  Adam Roben  <aroben@apple.com>

        Windows build fix

        * kjs/list.h:

298
299
300
301
302
303
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Build fix.  Add missing #include.

        * kjs/operations.cpp:

304
305
306
307
308
309
310
311
312
313
314
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

315
316
317
318
319
2007-11-05  Eric Seidel  <eric@webkit.org>

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

320
321
322
323
324
325
326
327
328
329
330
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()

331
332
333
334
335
336
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * pcre/pcre.pri:

337
338
339
340
341
342
2007-11-05  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/list.cpp:

343
344
345
346
347
348
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
349
350
351
352
353
354
355
356
357
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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
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.

398
399
400
401
402
403
404
405
406
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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
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.

439
440
441
442
2007-11-04  Darin Adler  <darin@apple.com>

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

443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
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
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
566
567
568
569
570
571
572
573
574
575
576
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
577
578
579
580
581
582
583
584
585
586
587
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
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
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::):

625
626
627
628
629
630
631
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
632
633
634
635
636
637
638
639
640
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):

641
642
643
644
645
2007-11-03  Darin Adler  <darin@apple.com>

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

646
647
648
649
650
651
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
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
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
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
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
718
719
720
721
722
723
724
725
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
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
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
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
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
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
806
807
808
809
810
811
812
813
814
815
816
817
818
819
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
820
821
822
823
824
825
826
827
828
829
830
831
832
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
833
834
835
836
837
838
839
840
841
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
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
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
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
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
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
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
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
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):

926
927
928
929
2007-11-01  Adam Roben  <aroben@apple.com>

        Use jsNumberCell instead of jsNumber when converting double constants to JSValues

aroben's avatar
aroben committed
930
931
932
        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.

933
934
935
936
937
938
939
940
941
942
        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
943
944
945
946
947
948
2007-10-31  Adam Roben  <aroben@apple.com>

        Windows build fix

        * kjs/ExecState.h:

mjs's avatar
mjs committed
949
950
951
952
953
954
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
955
956
        Keep the LocalStorage pointer in the ExecState, instead of getting
        it from the ActivationImp all the time.
mjs's avatar
mjs committed
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973

        * 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):

974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
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
992
993
994
995
996
997
998
999
2007-10-31  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Sam.

        - Corrected spelling.

        * wtf/HashTraits.h:

1000
1001
1002
1003
1004
1005
2007-10-31  Mark Rowe  <mrowe@apple.com>

        Further Gtk build fixage.

        * kjs/regexp_object.cpp:

1006
1007
1008
1009
1010
1011
2007-10-31  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/regexp.h:

darin's avatar
darin committed
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
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
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
1054
1055
1056
1057
2007-10-31  Oliver Hunt  <oliver@apple.com>

        * kjs/nodes.h: include OwnPtr.h

1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
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
1086
1087
2007-10-30  Mark Rowe  <mrowe@apple.com>

1088
1089
        * 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
1090

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

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

ap's avatar
ap committed
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
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
1114
1115
2007-10-31  Maciej Stachowiak  <mjs@apple.com>

1116
        Reviewed by Oliver.
mjs's avatar
mjs committed
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
        
        - 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
1141
1142
2007-10-30  Adam Roben  <aroben@apple.com>

1143
1144
        * 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
1145

1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
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:

1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
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):

1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
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:

1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
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
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
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::):

1226
1227
1228
1229
1230
1231
1232
1233
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
1234
1235
1236
1237
1238
1239
1240
1241
1242
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
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
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).

1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
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):

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
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
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
1387
1388
1389
1390
1391
1392
1393
1394
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
1395
1396
1397
1398
1399
1400
1401
1402
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
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
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
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
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::):

1444
1445
1446
1447
1448
1449
1450
1451
1452
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
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
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):

1465
1466
1467
1468
1469
1470
2007-10-29  Eric Seidel  <eric@webkit.org>

        Build fix only, no review.

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

1471
1472
1473
1474
1475
1476
1477
2007-10-29  Mark Rowe  <mrowe@apple.com>

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

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

1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
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:

1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
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
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
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::):

1557
1558
1559
1560
1561
1562
1563
1564
1565
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):

1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
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
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
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
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
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):

1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
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):

1636
1637
1638
1639
1640
1641
1642
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
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
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
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
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.

1676
1677
1678
1679
1680
1681
1682
1683
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.

1684
1685
1686
1687
1688
1689
2007-10-28  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.  Add include of MathExtras.h.

        * kjs/string_object.cpp:

1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
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):

1723
1724
1725
1726
1727
1728
1729
1730
1731
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):

1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
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.

1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
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
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
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
1800
1801
1802
1803
1804
1805
1806
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
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
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
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
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.

1916
1917
1918
1919
1920
1921
1922
1923
2007-10-28  Kevin Ollivier  <kevino@theolliviers.com>

        Define wx port and set wx port USE options.

        Reviewed by Adam Roben.

        * wtf/Platform.h:

1924
1925
1926
1927
1928
1929
1930
1931
1932
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
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
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
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
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
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
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
1988
        - Reordered memory accesses in the various lookup functions for better code generation
mjs's avatar
mjs committed
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
        
        - 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
2025
2026
2027
2028
2029
2030
2031
2032
2033
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
2034
2035
2036
2037
2038
2039
2040
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
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
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
2057
2058
2059
2060
2007-10-27  Darin Adler  <darin@apple.com>

        Reviewed by Eric.

darin's avatar
darin committed
2061
        - fix pow on Windows
darin's avatar
darin committed
2062
2063
2064
2065
2066
2067
2068
2069

        * 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
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
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
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
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.

2093
2094
2095
2096
2097
2098
2007-10-27  Mark Rowe  <mrowe@apple.com>

        Silence a warning.

        * kjs/SymbolTable.h:

2099
2100
2101
2102
2103
2104
2007-10-27  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/function.h:

kmccullo's avatar
kmccullo committed
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
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
2118
2119
2120
2121
2122
2123
2124
2125
2126
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
2127
2128
2129
2130
2131
2132
2133
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
2134
2135
2136
2137
2138
2139
2140
2141
2142
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
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
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
2153
2154
2155
2156
2157
2158
2159
2160
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Build fix: svn add SymbolTable.h

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

2161
2162
2163
2164
2165
2166
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Build fix: export SymbolTable.h to WebCore.

        * JavaScriptCore.xcodeproj/project.pbxproj:

ggaren's avatar
ggaren committed
2167
2168
2169
2170
2171
2172
2173
2007-10-26  Geoffrey Garen  <ggaren@apple.com>

        Comment tweak suggested by Maciej.

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

ggaren's avatar
ggaren committed
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
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
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
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
2239
2240
2241
2242
2243
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.
        
        Slowdowns:
            - ActivationImp now mallocs in its constructor
            - Local variable hits use an extra level of indirection to retrieve 
            data
            - Local variable misses do two lookups

        Speedups:
            - Fast initialization of local variables upon function entry

        * JavaScriptCore.xcodeproj/project.pbxproj: Added SymbolTable.h
        
        * kjs/function.cpp:
        (KJS::ActivationImp::ActivationImp): Malloc a private structure to hold
        data that won't fit in a JSCell.
        (KJS::ActivationImp::argumentsGetter): Use slow symbol table path for 
        lookup.
        (KJS::ActivationImp::getOwnPropertySlot): ditto
        (KJS::ActivationImp::deleteProperty): ditto
        (KJS::ActivationImp::put): ditto
        (KJS::ActivationImp::createArgumentsObject): ditto

        (KJS::ActivationImp::mark): Call JSObject::mark first so that one of
        our properties doesn't try to recursively mark us. (This caused a crash
        in earlier testing. Not sure why we haven't run into it before.)

        * kjs/nodes.cpp: Functions now build a symbol table the first time 
        they're called.
        (KJS::VarDeclNode::evaluate):
        (KJS::FunctionBodyNode::FunctionBodyNode):
        (KJS::FunctionBodyNode::initializeSymbolTable):
        (KJS::FunctionBodyNode::processDeclarations):
        (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
        (KJS::FunctionBodyNode::processDeclarationsForProgramCode):

        * kjs/nodes.h:
        (KJS::FunctionBodyNode::symbolTable):

        * wtf/Forward.h: Added Vector.

kmccullo's avatar
kmccullo committed
2244
2245
2007-10-26  Kevin McCullough  <kmccullough@apple.com>

2246
2247
2248
        - Corrected function name mistake in this changelog.

2007-10-26  Kevin McCullough  <kmccullough@apple.com>
kmccullo's avatar
kmccullo committed
2249
2250
2251
2252
2253
        Reviewed by Sam and Steve.

        - Added convenience methods for converting between BSTR and JSStringRefs

        * API/JSStringRefCOM.cpp: Added.
2254
2255
        (JSStringCreateWithBSTR):
        (JSStringCopyBSTR):
kmccullo's avatar
kmccullo committed
2256
2257
2258
        * API/JSStringRefCOM.h: Added.
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

2259
2260
2261
2262
2263
2264
2265
2007-10-26  Mark Rowe  <mrowe@apple.com>

        Windows build fix.

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

2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2007-10-26  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Make the JSC GC use a separate heap for JSNumbers to get a 0.7-1.4% progression in SunSpider.

        * kjs/CollectorHeapIntrospector.cpp:
        (KJS::CollectorHeapIntrospector::init):
        (KJS::CollectorHeapIntrospector::enumerate):
        * kjs/CollectorHeapIntrospector.h:
        * kjs/collector.cpp:
        (KJS::Collector::recordExtraCost):
        (KJS::Collector::heapAllocate):
        (KJS::Collector::allocate):
        (KJS::Collector::allocateNumber):
        (KJS::Collector::registerThread):
        (KJS::Collector::markStackObjectsConservatively):
        (KJS::Collector::markMainThreadOnlyObjects):
        (KJS::Collector::sweep):
        (KJS::Collector::collect):
        * kjs/collector.h:
        * kjs/internal.h:
        (KJS::NumberImp::operator new):
          Force numbers to be allocated in the secondary heap.

mjs's avatar
mjs committed
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2007-10-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.

        * kjs/value.h:
        (KJS::JSValue::getUInt32):
        (KJS::JSValue::getTruncatedInt32):
        (KJS::JSValue::toNumber):
        * wtf/PassRefPtr.h:
        (WTF::PassRefPtr::~PassRefPtr):
        * wtf/RefPtr.h:
        (WTF::RefPtr::operator->):

2306
2307
2308
2309
2310
2311
2007-10-26  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/ExecState.h:

mjs's avatar
mjs committed
2312
2313
2314
2007-10-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Mark.
mrowe@apple.com's avatar
mrowe@apple.com committed
2315

mjs's avatar
mjs committed
2316
        - Merge Context class fully into ExecState, since they are always created and used together.
mrowe@apple.com's avatar
mrowe@apple.com committed
2317

mjs's avatar
mjs committed
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
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
        No measurable performance impact but this is a useful cleanup.

        * JavaScriptCore.pri:
        * kjs/ExecState.cpp:
        (KJS::ExecState::ExecState):
        (KJS::ExecState::~ExecState):
        (KJS::ExecState::mark):
        (KJS::ExecState::lexicalInterpreter):
        * kjs/ExecState.h:
        (KJS::ExecState::dynamicInterpreter):
        (KJS::ExecState::setException):
        (KJS::ExecState::clearException):
        (KJS::ExecState::exception):
        (KJS::ExecState::exceptionSlot):
        (KJS::ExecState::hadException):
        (KJS::ExecState::scopeChain):
        (KJS::ExecState::callingExecState):
        (KJS::ExecState::propertyNames):
        * kjs/collector.cpp:
        (KJS::Collector::reportOutOfMemoryToAllInterpreters):
        * kjs/function.cpp:
        (KJS::FunctionImp::callAsFunction):
        (KJS::FunctionImp::argumentsGetter):
        (KJS::FunctionImp::callerGetter):
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/interpreter.cpp:
        (KJS::Interpreter::Interpreter):
        (KJS::Interpreter::init):
        (KJS::Interpreter::evaluate):
        (KJS::Interpreter::mark):
        * kjs/interpreter.h:
        (KJS::Interpreter::setCurrentExec):
        (KJS::Interpreter::currentExec):
        * kjs/nodes.cpp:
        (KJS::currentSourceId):
        (KJS::currentSourceURL):
        (KJS::ThisNode::evaluate):
        (KJS::ResolveNode::evaluate):
        (KJS::FunctionCallResolveNode::evaluate):
        (KJS::PostfixResolveNode::evaluate):
        (KJS::DeleteResolveNode::evaluate):
        (KJS::TypeOfResolveNode::evaluate):
        (KJS::PrefixResolveNode::evaluate):
        (KJS::AssignResolveNode::evaluate):
        (KJS::VarDeclNode::evaluate):
        (KJS::DoWhileNode::execute):
        (KJS::WhileNode::execute):
        (KJS::ForNode::execute):
        (KJS::ForInNode::execute):
        (KJS::ContinueNode::execute):
        (KJS::BreakNode::execute):
        (KJS::ReturnNode::execute):
        (KJS::WithNode::execute):
        (KJS::SwitchNode::execute):
        (KJS::LabelNode::execute):
        (KJS::TryNode::execute):
        (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
        (KJS::FunctionBodyNode::processDeclarationsProgramCode):
        (KJS::FunctionBodyNode::processDeclarations):
        (KJS::FuncDeclNode::makeFunction):
        (KJS::FuncExprNode::evaluate):

mrowe@apple.com's avatar
mrowe@apple.com committed
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2007-10-26  Mark Rowe  <mrowe@apple.com>

        Windows build fix.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

2007-10-26  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * JavaScriptCore.pri:
        * kjs/ExecState.cpp:

mjs's avatar
mjs committed
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2007-10-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - moved Context class into ExecState.{h,cpp} in preparation for merging 
        ExecState and Context classes.

        * kjs/ExecState.h: Moved CodeType enum and Context class here in
        preparation for merging ExecState and Context.
        * kjs/ExecState.cpp: Moved Context class here from Context.cpp.
        (KJS::Context::Context):
        (KJS::Context::~Context):
        (KJS::Context::mark):
        * kjs/context.h: Removed.
        * kjs/Context.cpp: Removed.
        * kjs/function.h: Removed CodeType enum.
        * kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
        * kjs/internal.h: Removed LabelStack.
        * JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
        * kjs/collector.cpp: Fixed includes.
        * kjs/function.cpp: ditto
        * kjs/internal.cpp: ditto
        * kjs/interpreter.cpp: ditto
        * kjs/lookup.h: ditto
        * kjs/nodes.cpp: ditto

2419
2420
2421
2422
2423
2424
2425
2007-10-26  Mark Rowe  <mrowe@apple.com>

        Windows build fix.

        * kjs/string_object.cpp:
        (KJS::StringObjectFuncImp::callAsFunction):

darin's avatar
darin committed
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
2007-10-25  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15703
          fix numeric functions -- improve correctness and speed

        Gives about 1% gain on SunSpider.

        * kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
        (KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
        with both immediate and number values.
        (KJS::JSValue::toUInt32): Ditto.
        * kjs/value.cpp:
        (KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
        differences. One is that it now correctly returns 0 for NaN, and another is that
        there's no special case for 0 or infinity, since the general case already handles
        those correctly.
        (KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
        check for NaN.
        (KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
        truncation done by the typecast already does the necessary truncation that
        roundValue was doing.
        (KJS::JSValue::toUInt32SlowCase): Ditto.
        (KJS::JSValue::toUInt16): Removed.

        * kjs/internal.h: Removed roundValue.
        * kjs/internal.cpp: Ditto.

        * kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
        code to handle NaN in Array.slice; toInteger now never returns NaN as specified.

        * kjs/date_object.cpp:
        (KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
        toNumber as specified.
        (KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
        with a call to toNumber and timeClip as specified.
        (KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
        where the default behavior of toInt32 (returning 0) was already correct. Replaced
        call to roundValue with a call to toNumber as specified.
        (KJS::DateObjectFuncImp::callAsFunction): Ditto.

        * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
        cases for the pow function that the library already handles correctly.

        * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
        call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
        The real toInteger now returns 0 for NaN. Took out unneeded special case in
        ToFixed for undefined; was only needed because our toInteger was wrong. Same
        thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.

        * kjs/string_object.cpp:
        (KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
        cases for undefined that were only needed because toInteger was wrong. Same in
        IndexOf, and was able to remove some special cases. In LastIndexOf, used
        toIntegerPreserveNaN, but was able to remove some special cases there too.
        Changed Substr implementation to preserve correct behavior with the change
        to toInteger and match the specification. Also made sure we weren't converting
        an out of range double to an int.
        (KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
        toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
        no reason to have toUInt16 as a second, less-optimized function that's only
        called at this one call site.

        * wtf/MathExtras.h: Added trunc function for Windows.

ggaren's avatar
ggaren committed
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Tweaked the inner hashtable lookup loop to remove a branch in the "not 
        found" case. .5% speedup on SunSpider.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * wtf/HashTable.h:
        (WTF::::lookup):

mjs's avatar
mjs committed
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
2532
2533
2007-10-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.

        - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider

        * kjs/nodes.cpp:
        (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
        adding any value over toNumber() here.
        (KJS::valueForReadModifyAssignment): Ditto.
        (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
        and branches.
        (KJS::lessThanEq): Ditto.
        * JavaScriptCore.exp: Export new functions as needed.
        * kjs/value.h:
        (KJS::JSValue::toPrimitive): Fixed formatting.
        (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
        to number and tells you whether a toPrimitive() conversion with a Number hint
        would have given a string.
        * kjs/internal.cpp:
        (KJS::StringImp::getPrimitiveNumber): Implemented. 
        (KJS::NumberImp::getPrimitiveNumber): ditto
        (KJS::GetterSetterImp::getPrimitiveNumber): ditto
        (KJS::StringImp::toPrimitive): Fixed formatting.
        (KJS::NumberImp::toPrimitive): ditto
        (KJS::GetterSetterImp::toPrimitive): ditto
        * kjs/internal.h:
        * kjs/object.cpp:
        (KJS::JSObject::getPrimitiveNumber): Implemented.
        * kjs/object.h:

weinig's avatar
weinig committed
2534
2535
2536
2537
2538
2539
2540
2541
2007-10-25  Sam Weinig  <sam@webkit.org>

        Reviewed by Adam Roben.

        Remove JSStringRefCFHack from windows as it is no longer needed.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

ggaren's avatar
ggaren committed
2542
2543
2544
2545
2546
2547
2548
2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Rolled out my last patch. It turns out that I needed 2 words, not 1,
        so it didn't help.

ggaren's avatar
ggaren committed
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
        Shrink the size of an activation object by 1 word
        
        This is in preparation for adding a symbol table to the activation 
        object.
        
        The basic strategy here is to rely on the mutual exclusion between
        the arguments object pointer and the function pointer (you only need
        the latter in order to create the former), and store them in the same 
        place. The LazyArgumentsObject class encapsulates this strategy.
        
        Also inlined the ArgumentsImp constructor, for good measure.
        
        SunSpider reports no regression. Regression tests pass.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/Context.cpp:
        (KJS::Context::~Context):
        * kjs/function.cpp:
        (KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::mark):
        (KJS::):
        (KJS::ActivationImp::argumentsGetter):
        (KJS::ActivationImp::mark):
        * kjs/function.h:
        (KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
        (KJS::ActivationImp::LazyArgumentsObject::resetArguments):
        (KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::setFunction):
        (KJS::ActivationImp::LazyArgumentsObject::function):
        (KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::):
        (KJS::ActivationImp::ActivationImp::ActivationImp):
        (KJS::ActivationImp::resetArguments):

aroben's avatar
aroben committed
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2007-10-25  Adam Roben  <aroben@apple.com>

        Change JavaScriptCore.vcproj to use DerivedSources.make

        We were trying to emulate the logic of make in
        build-generated-files.sh, but we got it wrong. We now use a
        build-generated-files very much like the one that WebCore uses to
        invoke make.

        We also now only have a Debug configuration of dftables which we build
        even when doing a Release build of JavaScriptCore. dftables also no
        longer has the "_debug" name suffix.

        Changes mostly made by Darin, reviewed by me.

        * DerivedSources.make: Add a variable to set the extension used for
        the dftables executable.
        * JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
        dftables in Release configurations.
        * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
           - Updated include path to point to the new location of the derived
             sources.
           - Modified pre-build event to pass the right arguments to
             build-generated-files.sh and not call dftables directly.
           - Added the derived source files to the project.
           - Removed grammarWrapper.cpp, which isn't needed now that we're
             compiling grammar.cpp directly.
        * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
        Slightly modified from the WebCore version.
        * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
        * JavaScriptCore.vcproj/dftables/dftables.vcproj:
            - Changed the output location to match Mac.
            - Removed the Release configuration.
            - Removed the _debug suffix.

ggaren's avatar
ggaren committed
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Eric Seidel.
        
        Slightly elaborated the differences between declaration procesing in 
        Function Code and Program Code.
        
        .3% speedup on SunSpider.

        * kjs/nodes.cpp:
        (KJS::FunctionBodyNode::processDeclarationsFunctionCode): 
        (KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a 
        minimum set of attributes instead of recomputing all the time. Also,
        ignore m_parameters, since programs don't have arguments.

2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2007-10-25  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        More preparation work before adding long-running mode to testkjs.

        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction):
        (prettyPrintScript):
        (runWithScripts):
        (parseArguments):
        (kjsmain):
        (fillBufferWithContentsOfFile):

2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2007-10-25  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        Bring testkjs code out of the dark ages in preparation for more
        radical improvements (like long-running testing support!)

        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction):
        (setupInterpreter):
        (doIt):
        (fillBufferWithContentsOfFile):

ggaren's avatar
ggaren committed
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Make a fast path for declaration processing inside Function Code.
        
        Lifted declaration processing code up from individual declaration nodes
        and into processDeclarations.
        
        Broke out processDeclarations into two cases, depending on the type of 
        code. This eliminates 2 branches, and facilitates more radical 
        divergeance in the future.
        
        2.5% SunSpider speedup.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/nodes.cpp:
        (KJS::FunctionBodyNode::initializeDeclarationStacks):
        (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
        (KJS::FunctionBodyNode::processDeclarationsProgramCode):
        (KJS::FunctionBodyNode::execute):
        (KJS::FuncDeclNode::makeFunction):
        * kjs/nodes.h:
        (KJS::):

mjs's avatar
mjs committed
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2007-10-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Adam.
        
        - add header includes needed on platforms that don't use AllInOneFile.cpp

        * API/JSCallbackObject.cpp:
        * kjs/Context.cpp:
        * kjs/ExecState.cpp:
        * kjs/array_instance.cpp:
        * kjs/function_object.cpp:
        * kjs/interpreter.cpp:
        * kjs/nodes.cpp:

2707
2708
2709
2710
2711
2712
2007-10-25  Eric Seidel  <eric@webkit.org>

        Reviewed by Geoff.

        * JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private

ggaren's avatar
ggaren committed
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
        Re-order declaration initialization to avoid calling hasProperty inside
        VarDeclNode::processDeclaration
        
        .7% speedup on SunSpider.

        * kjs/function.h:
        * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
        other processing of declared symbols, so the order of execution could 
        change.

        * kjs/nodes.cpp:
        (KJS::VarDeclNode::getDeclarations): Added special case for the 
        "arguments" property name, explained in the comment.

        (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
        in the case of function code, since we know the declared symbol
        management will resolve conflicts between symbols. Yay!

        (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's 
        implementation of getDeclarations is non-trivial, we can't take a 
        short-cut here any longer -- we need to put the VarDecl node on the 
        stack so it gets processed normally.

        (KJS::FunctionBodyNode::processDeclarations): Changed the order of 
        processing to enforce mutual exclusion rules.

        * kjs/nodes.h:
        (KJS::DeclarationStacks::DeclarationStacks): Structure includes an 
        ExecState now, for fast access to the "arguments" property name.

2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808