-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathChangeLog-2002-12-03
executable file
·2271 lines (1691 loc) · 83.5 KB
/
ChangeLog-2002-12-03
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
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
398
399
400
401
402
403
404
405
406
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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
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
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
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
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
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
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2002-12-03 Maciej Stachowiak <[email protected]>
Reviewed by: Darin Adler
- fixed Deployment build.
* kjs/dtoa.cpp: Work around warnings.
2002-12-03 Maciej Stachowiak <[email protected]>
- fixed 3114790 - Gamespot reviews pages badly mis-rendering
because floating point numbers format wide
Reviewed by: David Hyatt
* kjs/dtoa.cpp: Imported float <--> string conversion routines
from David M. Gay. I changed this to fix warnings and avoid
colliding with names of standard library functions.
* kjs/dtoa.h: Added a header I made up for dtoa.cpp
* kjs/ustring.cpp:
(UString::from): Use new double to string routine (kjs_strtod).
(UString::toDouble): Use new string to double routine (kjs_dtoa).
* JavaScriptCore.pbproj/project.pbxproj: Added new files
2002-11-27 John Sullivan <[email protected]>
* kjs/collector.cpp:
removed puts("COLLECT") leftover debugging spam that was
buggin' gramps
=== Alexander-34 ===
2002-11-26 Maciej Stachowiak <[email protected]>
Change ActivationImp to be allocated via the garbage collector
again instead of on the stack. This fixes the following four
regressions but sadly it causes a 6% performance hit. It's
probably possibly to reduce the hit a bit by being smarter about
inlining and the way the marking list variant is implemented, but
I'll look into that later.
- fixed 3111500 - REGRESSION: crash in "KJS::ScopeChain::mark()" on www.posci.com
- fixed 3111145 - REGRESSION: reproducible crash in KJS hashtable lookup at time.com
- fixed 3110897 - REGRESSION: javascript crasher on http://bmwgallery.tripod.com/
- fixed 3109987 - REGRESSION: Reproducible crash in KJS ObjectImp at live365.com
Also:
- improved DEBUG_COLLECTOR mode a bit by never giving memory back
to the system.
* kjs/collector.cpp:
* kjs/context.h:
* kjs/function.cpp:
(ActivationImp::ActivationImp):
(ActivationImp::mark):
(ActivationImp::createArgumentsObject):
* kjs/function.h:
* kjs/internal.cpp:
(ContextImp::ContextImp):
(ContextImp::mark):
* kjs/list.cpp:
* kjs/list.h:
* kjs/value.cpp:
(Value::Value):
2002-11-26 Darin Adler <[email protected]>
* kjs/property_map.cpp:
(PropertyMap::save): Look at the attributes the same way in the single hash entry
case as in the actual hash table case. Change the rule for which attributes to save
to "attributes that don't have the ReadOnly, DontEnum, or Function bit set".
Also fix bug where saving an empty property map would leave the count set to the old value.
2002-11-26 Richard Williamson <[email protected]>
Remove debugging code. Could be cause of performance regresssion.
* kjs/nodes.cpp:
(FunctionCallNode::evaluate):
Restire attributes correctly.
* kjs/property_map.cpp:
2002-11-25 Richard Williamson <[email protected]>
Use delete[] (not delete) operator to delete array.
* kjs/property_map.cpp:
2002-11-25 Richard Williamson <[email protected]>
Added debugging info. Fixed property map save function.
* kjs/nodes.cpp:
(FunctionCallNode::evaluate):
* kjs/property_map.cpp:
2002-11-25 Richard Williamson <[email protected]>
Changes for back/forward. Currently disabled.
* kjs/property_map.cpp:
* kjs/property_map.h:
2002-11-25 Darin Adler <[email protected]>
* kjs/property_map.cpp: Rearrange code a little bit and tweak indentation.
This might provide a tiny speedup because we don't look at the single entry
any more in cases where the _table pointer is non-0.
2002-11-24 Darin Adler <[email protected]>
- changed ScopeChain to not ref each item in the chain, and use
marking instead; gains 1% on JavaScript iBench
* kjs/context.h: Return chain by reference.
* kjs/internal.cpp: (ContextImp::mark): Mark the scope chain.
* kjs/interpreter.cpp: (Context::scopeChain): Return chain by reference.
* kjs/interpreter.h: Make some Context methods inline.
* kjs/nodes.cpp:
(ThisNode::evaluate): Get at ContextImp directly.
(ResolveNode::evaluateReference): Ditto.
(VarDeclNode::evaluate): Ditto.
(VarDeclNode::processVarDecls): Ditto.
(FuncDeclNode::processFuncDecl): Pass ScopeChain directly to avoid copying.
(FuncExprNode::evaluate): Ditto.
* kjs/object.cpp: Make scope and setScope inline.
* kjs/object.h: Make scope return a chain by reference. Make scope and
setScope both be inline. Use a normal ScopeChain instead of NoRefScopeChain
since they are now one and the same.
* kjs/scope_chain.cpp: Remove all the code to ref and deref objects.
Merge NoRefScopeChain in with ScopeChain since they both work this way now.
* kjs/scope_chain.h: Remove NoRefScopeChain and simplify the ref counts.
Make more functions inline.
2002-11-24 Maciej Stachowiak <[email protected]>
- fixed 3098356 - Hard hang on movie search at www.movietickets.com
* kjs/string_object.cpp:
(StringProtoFuncImp::call): When doing a regexp replacement that
results in an empty match, always move on to the next character
after doing the replacement. The previous code would hit an
infinite loop if an initial empty match was replaced with the
empty string.
2002-11-24 Maciej Stachowiak <[email protected]>
- fixed 3095446 - Crash on AppleScript page due to very long argument list
* kjs/grammar.y: Don't try to construct the argument list in the
right order, since that blows out the parser stack.
* kjs/nodes.cpp:
(ArgumentsNode::ArgumentsNode): Instead reverse the argument list
here.
* kjs/nodes.h: Make ArgumentsNode a friend of ArgumentListNode.
* kjs/grammar.cpp: Updated from grammar.y.
2002-11-23 Maciej Stachowiak <[email protected]>
- completed Darin's mostly-fix for 3037795 - Resource use
increases when accessing very high index value in array
The two missing pieces were handling sparse properties when
shrinking the array, and when sorting. Thse are now both taken
care of.
* kjs/array_instance.h:
* kjs/array_object.cpp:
(ArrayInstanceImp::put):
(ArrayInstanceImp::deleteProperty):
(ArrayInstanceImp::resizeStorage):
(ArrayInstanceImp::setLength):
(ArrayInstanceImp::sort):
(ArrayInstanceImp::pushUndefinedObjectsToEnd):
* kjs/identifier.h:
* kjs/object.h:
* kjs/property_map.cpp:
* kjs/property_map.h:
* kjs/reference_list.cpp:
(ReferenceList::append):
(ReferenceList::length):
* kjs/reference_list.h:
* kjs/ustring.cpp:
(UString::toUInt32):
* kjs/ustring.h:
2002-11-23 Maciej Stachowiak <[email protected]>
Numerous collector changes for a net gain of 3% on JS ibench:
- Replaced per-block bitmap with free list.
- Increased number of empty blocks kept around to 2.
- Doubled block size.
- When scanning heap in collector, skip scanning the rest of a
block as soon as we see as many live cells as the the number of
used cells it had originally.
Also the following collector changes unrelated to performance:
- Made constants `const int' instead of `static const int'.
- Miscellaneous code cleanup.
* kjs/collector.cpp:
- Added debugging mode enabled by defining DEBUG_GC which asserts
when a destroyed ValueImp
* kjs/internal.cpp:
(ContextImp::mark):
* kjs/value.cpp:
(Value::Value):
* kjs/value.h:
* kjs/config.h:
2002-11-22 Darin Adler <[email protected]>
- replaced List class with a vector rather than a linked list, changed it
to use a pool of instances instead of all the nodes allocated off of the
heap; gives 10% gain on iBench
* kjs/list.h: Complete rewrite.
* kjs/list.cpp: Ditto.
* kjs/array_object.cpp: (compareWithCompareFunctionForQSort): Go back to
doing a clear and two appends here. Fast with the new list implementation.
* kjs/collector.h: Remove _COLLECTOR hack and just make rootObjectClasses
return a const void *.
* kjs/collector.cpp: Remove _COLLECTOR hack, and various other minor tweaks.
2002-11-22 Darin Adler <[email protected]>
- prepare to reimplement KJS::List; move to its own file, add statistics
* kjs/function_object.cpp: (FunctionProtoFuncImp::call): Use new copyTail()
function rather than copy() and removeFirst().
* kjs/identifier.cpp: Add statistics, off by default.
* kjs/property_map.cpp: Add statistics, off by default.
* kjs/list.cpp: Added. Moved code here. To be rewritten.
* kjs/list.h: Added. Moved interface here. To be rewritten.
* kjs/types.cpp: Removed.
* kjs/types.h: Now just an empty header that includes other headers.
* JavaScriptCore.pbproj/project.pbxproj: Add new files, rearrange.
2002-11-22 Maciej Stachowiak <[email protected]>
- reduce cell size to 56 bytes from 64, now that nearly all
objects fit in that size. .5% speed gain and probably some
footprint gain.
* kjs/collector.cpp: Change CELL_SIZE from 64 to 56.
2002-11-22 Darin Adler <[email protected]>
- change ScopeChain to be a singly linked list shares tails, gives 11% gain on iBench
* kjs/context.h:
(ContextImp::pushScope): Make inline, use push instead of prepend, and pass imp pointer.
(ContextImp::popScope): Make inline, use pop instead of removeFirst.
* kjs/function.cpp: (DeclaredFunctionImp::DeclaredFunctionImp): No need to copy.
* kjs/function_object.cpp: (FunctionObjectImp::construct): Use push instead of
prepend, and pass imp pointer.
* kjs/internal.cpp: (ContextImp::ContextImp): Use clear, push instead of prepend,
and pass imp pointers.
* kjs/nodes.cpp: (ResolveNode::evaluateReference): Use isEmpty, pop, and top instead
of ScopeChainIterator.
* kjs/object.h: Change _scope to be a NoRefScopeChain.
* kjs/object.cpp: No need to initialize _scope any more, since it's not a NoRefScopeChain.
* kjs/scope_chain.h: Rewrite, different implementation and interface.
* kjs/scope_chain.cpp: More of the same.
2002-11-22 Maciej Stachowiak <[email protected]>
- a simple change for .4% gain on ibench - instead of unmarking
all objects at the start of collection, instead unmark as part of
the sweep phase
* kjs/collector.cpp:
(Collector::collect): Remove separate unmarking pass and instead
unmark the objects that don't get collected during the sweep
phase.
2002-11-21 Darin Adler <[email protected]>
- stop garbage collecting the ActivationImp objects, gets 3% on iBench
- pave the way to separate the argument lists from scope chains
* kjs/context.h: Added. Moved ContextImp here so it can use things defined
in function.h
* kjs/scope_chain.h: Added. Starting as a copy of List, to be improved.
* kjs/scope_chain.cpp: Added. Starting as a copy of List, to be improved.
* JavaScriptCore.pbproj/project.pbxproj: Rearranged things, added context.h.
* kjs/function.cpp:
(FunctionImp::call): Pass InterpreterImp, not ExecState, to ContextImp.
(DeclaredFunctionImp::DeclaredFunctionImp): List -> ScopeChain.
(ActivationImp::createArgumentsObject): ArgumentList -> List.
(GlobalFuncImp::call): Pass InterpreterImp, not an ExecState, to ContextImp.
* kjs/function.h: List -> ScopeChain.
* kjs/function_object.cpp: (FunctionObjectImp::construct): List -> ScopeChain.
* kjs/internal.cpp:
(ContextImp::ContextImp): Set the context in the interpreter.
(ContextImp::~ContextImp): Set the context in the interpreter to the caller.
(ContextImp::mark): Mark all the activation objects.
(InterpreterImp::InterpreterImp): Initialize context to 0.
(InterpreterImp::mark): Mark the top context.
(InterpreterImp::evaluate): Pass InterpreterImp to ContextImp.
* kjs/internal.h: Move ContextImp to its own header. Add setContext to InterpreterImp.
* kjs/interpreter.cpp: (Context::scopeChain): List -> ScopeChain.
* kjs/interpreter.h: List -> ScopeChain.
* kjs/nodes.cpp:
(ResolveNode::evaluateReference): List -> ScopeChain.
(FuncDeclNode::processFuncDecl): List -> ScopeChain.
(FuncExprNode::evaluate): List -> ScopeChain.
* kjs/object.cpp: List -> ScopeChain.
* kjs/object.h: List -> ScopeChain.
* kjs/types.h: Remove needsMarking features from List.
* kjs/types.cpp: Ditto.
2002-11-21 Maciej Stachowiak <[email protected]>
- reduced the size of PropertyMap by storing sizes and such in the
dynamically allocated part of the object to reduce the size of
ObjectImp - .5% speed improvement on JS iBench.
* kjs/property_map.cpp:
* kjs/property_map.h:
2002-11-21 Maciej Stachowiak <[email protected]>
* Makefile.am: Pass symroots for this tree to pbxbuild.
=== Alexander-33 ===
2002-11-21 Darin Adler <[email protected]>
* kjs/property_map.cpp: More assertions.
2002-11-21 Darin Adler <[email protected]>
* kjs/property_map.cpp: Turn that consistency check back off.
2002-11-21 Darin Adler <[email protected]>
- someone somewhere must be defining a macro named check, causing a compile failure in WebCore
Rename check() to checkConsistency().
* kjs/property_map.h: Rename.
* kjs/property_map.cpp: Yes, rename.
2002-11-21 Darin Adler <[email protected]>
- add self-check to property map in hopes of finding the cnet.com bug
* kjs/property_map.h: Add check() function.
* kjs/property_map.cpp: Add the checking, controlled by DO_CONSISTENCY_CHECK.
- fixed UChar interface so it's not so slow in debug builds
* kjs/ustring.h: Nothing in UChar needs to be private.
* kjs/function.cpp: (GlobalFuncImp::call):
* kjs/function_object.cpp: (FunctionObjectImp::construct):
* kjs/identifier.cpp:
* kjs/lexer.cpp: (Lexer::setCode), (Lexer::shift):
* kjs/lookup.cpp: (keysMatch):
* kjs/ustring.cpp: (UString::Rep::computeHash), (KJS::compare):
Use the "uc" field instead of the "unicode()" inline function.
2002-11-21 Darin Adler <[email protected]>
- fixed a null-dereference I ran into while trying to reproduce bug 3107351
* kjs/function.h: Change ActivationImp constructor to take context parameter.
* kjs/function.cpp: (ActivationImp::ActivationImp): Take context parameter,
not execution state parameter.
* kjs/internal.cpp: (ContextImp::ContextImp): Initialize activation object
from context, not execution state, because the new context is not yet in the
execution state.
2002-11-20 Darin Adler <[email protected]>
- added a feature for Richard to use in his back/forward cache
* kjs/object.h: Added save/restoreProperties.
* kjs/property_map.h: Here too.
* kjs/property_map.cpp: Here too.
2002-11-20 Darin Adler <[email protected]>
- created argument list objects only on demand for a 7.5% speedup
* kjs/function.h: Change ActivationImp around.
* kjs/function.cpp:
(FunctionImp::call): Pass a pointer to the arguments list to avoid ref/unref.
(FunctionImp::get): Get the function pointer from the context directly,
not the activation object.
(ArgumentsImp::ArgumentsImp): Add an overload that takes no arguments.
(ActivationImp::ActivationImp): Store a context pointer and an arguments object pointer.
(ActivationImp::get): Special case for arguments, create it and return it.
(ActivationImp::put): Special case for arguments, can't be set.
(ActivationImp::hasProperty): Special case for arguments, return true.
(ActivationImp::deleteProperty): Special case for arguments, refuse to delete.
(ActivationImp::mark): Mark the arguments object.
(ActivationImp::createArgumentsObject): Do the work of actually creating it.
(GlobalFuncImp::call): Use stack-based objects for the ContextImp and ExecState.
* kjs/internal.h: Keep function and arguments pointer in the context.
* kjs/internal.cpp:
(ContextImp::ContextImp): Don't pass in the func and args when making an ActivationImp.
(InterpreterImp::evaluate): Use stack-based objects here.
* kjs/types.h: Add ArgumentList as a synonym for List, soon to be separate.
2002-11-20 Maciej Stachowiak <[email protected]>
Reduced the size of ValueImp by 8 bytes for a .5% speedup.
* kjs/value.h: Removed destructed flag. Made refcount and flag 16
bits each.
* kjs/value.cpp:
(ValueImp::~ValueImp): Don't set destructed flag.
2002-11-20 Darin Adler <[email protected]>
* kjs/types.cpp: Keep ref count for the whole lists of nodes.
Doesn't speed things up much, less than 1%.
2002-11-20 Maciej Stachowiak <[email protected]>
* kjs/collector.cpp:
(Collector::allocate): Clear the flags on newly allocated objects.
2002-11-20 Darin Adler <[email protected]>
- oops, checked in big regression instead of 5% speedup
* kjs/function.cpp: (ActivationImp::ActivationImp): Make a marking
list, not a refing list.
- a cut at the sparse array implementation
* kjs/array_instance.h: Keep storageLength separate from length.
* kjs/array_object.cpp:
(ArrayInstanceImp::ArrayInstanceImp): Start with storageLength == length.
(ArrayInstanceImp::get): Check against storage length.
(ArrayInstanceImp::put): Ditto.
(ArrayInstanceImp::hasProperty): Ditto.
(ArrayInstanceImp::deleteProperty): Ditto.
(ArrayInstanceImp::setLength): Only enlarge storage length up to a cutoff.
(ArrayInstanceImp::mark): Use storageLength.
(ArrayInstanceImp::pushUndefinedObjectsToEnd): Added FIXME.
2002-11-20 Darin Adler <[email protected]>
- decrease ref/deref -- 5% speedup in iBench
* JavaScriptCore.pbproj/project.pbxproj: Added array_instance.h
* kjs/array_instance.h: Added so it can be shared by function.h.
* kjs/array_object.cpp:
* kjs/array_object.h:
* kjs/bool_object.cpp:
* kjs/bool_object.h:
* kjs/collector.cpp:
* kjs/date_object.cpp:
* kjs/date_object.h:
* kjs/error_object.cpp:
* kjs/function.cpp:
* kjs/function.h:
* kjs/function_object.cpp:
* kjs/internal.cpp:
* kjs/internal.h:
* kjs/math_object.cpp:
* kjs/nodes.cpp:
* kjs/number_object.cpp:
* kjs/object.cpp:
* kjs/object.h:
* kjs/object_object.cpp:
* kjs/property_map.cpp:
* kjs/reference.cpp:
* kjs/reference.h:
* kjs/regexp_object.cpp:
* kjs/string_object.cpp:
* kjs/string_object.h:
* kjs/value.cpp:
* kjs/value.h:
Switched lots of interfaces so they don't require ref/deref.
2002-11-20 Maciej Stachowiak <[email protected]>
Fixed the two most obvious problems with the new GC for another 6%
improvement.
* kjs/collector.cpp:
(Collector::allocate): Don't bother doing the bit tests on a bitmap word if
all it's bits are on.
(Collector::collect): Track memoryFull boolean.
* kjs/collector.h: Inlined outOfMemory since it was showing up on profiles.
2002-11-20 Maciej Stachowiak <[email protected]>
Rewrote garbage collector to make blocks of actual memory instead
of blocks of pointers. 7% improvement on JavaScript
iBench. There's still lots of room to tune the new GC, this is
just my first cut.
* kjs/collector.cpp:
(Collector::allocate):
(Collector::collect):
(Collector::size):
(Collector::outOfMemory):
(Collector::finalCheck):
(Collector::numGCNotAllowedObjects):
(Collector::numReferencedObjects):
(Collector::liveObjectClasses):
* kjs/collector.h:
* kjs/function.cpp:
(ActivationImp::ActivationImp):
* kjs/function.h:
2002-11-20 Darin Adler <[email protected]>
- on the road to killing ActivationImp
* kjs/function.h: Add get/put to FunctionImp. Remove argumentsObject() from
ActivationImp. Add function() to ActivationImp.
* kjs/function.cpp:
(FunctionImp::FunctionImp): No arguments property.
(FunctionImp::call): No need to set up the arguments property.
(FunctionImp::parameterString): Remove ** strangeness.
(FunctionImp::processParameters): Ditto.
(FunctionImp::get): Added, handles arguments and length properties.
(FunctionImp::put): Ditto.
(FunctionImp::hasProperty): Ditto.
(FunctionImp::deleteProperty): Ditto.
(ActivationImp::ActivationImp): Store a function pointer so we can find it
in the context.
* kjs/function_object.cpp: (FunctionObjectImp::construct): No need to set up
arguments property.
* kjs/nodes.cpp: (FuncExprNode::evaluate): No need to set up length property.
* kjs/internal.h: Return ObjectImp * for activation object.
* kjs/interpreter.h: Remove stray declaration of ExecStateImp.
2002-11-20 Darin Adler <[email protected]>
- add a couple of list operations to avoid clearing lists so much during sorting; gives 1.5% iBench
* kjs/types.h: Added replaceFirst/replaceLast.
* kjs/types.cpp: (List::replaceFirst), (List::replaceLast): Added.
* kjs/array_object.cpp: (compareWithCompareFunctionForQSort): Use replaceFirst/replaceLast.
* kjs/property_map.cpp: Put in an ifdef so I can re-add/remove the single entry to see if
it has outlived its usefulness. (It hasn't yet.)
2002-11-20 Darin Adler <[email protected]>
- atomic identifiers; gives another 6.5% in the iBench suite
* kjs/identifier.h: Did the real thing.
* kjs/identifier.cpp: Ditto.
* kjs/property_map.h: _tableSizeHashMask -> _tableSizeMask
* kjs/property_map.cpp: The above, plus take advantage of comparing
by pointer instead of by comparing bytes.
2002-11-19 Darin Adler <[email protected]>
- a few more globals for often-used property names
- conversion to Identifier from UString must now be explicit
* kjs/error_object.cpp:
* kjs/function.cpp:
* kjs/function_object.cpp:
* kjs/identifier.cpp:
* kjs/identifier.h:
* kjs/lexer.cpp:
* kjs/nodes.cpp:
* kjs/number_object.cpp:
* kjs/object.cpp:
* kjs/object.h:
* kjs/string_object.cpp:
* kjs/testkjs.cpp:
* kjs/ustring.cpp:
* kjs/ustring.h:
2002-11-19 Darin Adler <[email protected]>
- another step towards atomic identifiers; storing hash in the string rep. gives about
a 1.5% speedup in the JavaScript iBench
* kjs/ustring.h: Add a hash field to UString::Rep.
* kjs/ustring.cpp:
(UString::Rep::create): Set hash to uninitialized value.
(UString::Rep::destroy): Do the deleting in her, and call Identifier if needed.
(UString::Rep::computeHash): Added.
(UString::append): Set hash to 0 when modifying the string in place.
(UString::operator=): Ditto.
* kjs/property_map.cpp: Use the hash from UString.
* kjs/identifier.h: Added aboutToDestroyUStringRep.
* kjs/identifier.cpp: (Identifier::aboutToDestroyUStringRep): Added.
2002-11-19 Darin Adler <[email protected]>
- next step towards atomic identifiers; Identifier is no longer derived from UString
* kjs/identifier.h: Remove base class and add _ustring member.
* kjs/identifier.cpp: Add null and an == that works with const char *.
* kjs/property_map.cpp: Get rep through _ustring.
* kjs/function.cpp: (FunctionImp::parameterString): Call ustring().
* kjs/function_object.cpp: (FunctionProtoFuncImp::call): Ditto.
* kjs/nodes.cpp:
(PropertyNode::evaluate): Ditto.
(VarDeclNode::evaluate): Ditto.
(ForInNode::execute): Ditto.
* kjs/nodes2string.cpp: (SourceStream::operator<<): Add overload for Identifier.
* kjs/reference.cpp: (Reference::getValue): Call ustring().
* kjs/regexp_object.cpp: (RegExpObjectImp::get): Call ustring().
2002-11-19 Darin Adler <[email protected]>
- fixed memory trasher
* kjs/ustring.cpp: (UString::from): Fix "end of buffer" computation.
2002-11-19 Darin Adler <[email protected]>
- a first step towards atomic identifiers in JavaScript
Most places that work with identifiers now use Identifier
instead of UString.
* kjs/identifier.cpp: Added.
* kjs/identifier.h: Added.
* JavaScriptCore.pbproj/project.pbxproj: Added files.
* kjs/array_object.cpp:
* kjs/array_object.h:
* kjs/completion.cpp:
* kjs/completion.h:
* kjs/date_object.cpp:
* kjs/date_object.h:
* kjs/function.cpp:
* kjs/function.h:
* kjs/function_object.cpp:
* kjs/grammar.cpp:
* kjs/grammar.cpp.h:
* kjs/grammar.h:
* kjs/grammar.y:
* kjs/internal.cpp:
* kjs/internal.h:
* kjs/lexer.cpp:
* kjs/lookup.cpp:
* kjs/lookup.h:
* kjs/math_object.cpp:
* kjs/math_object.h:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/number_object.cpp:
* kjs/number_object.h:
* kjs/object.cpp:
* kjs/object.h:
* kjs/property_map.cpp:
* kjs/property_map.h:
* kjs/reference.cpp:
* kjs/reference.h:
* kjs/regexp_object.cpp:
* kjs/regexp_object.h:
* kjs/string_object.cpp:
* kjs/string_object.h:
2002-11-19 Darin Adler <[email protected]>
- fix hash function and key comparison for the other kind of hash table; yields 3%
* kjs/lookup.cpp:
(keysMatch): Added.
(Lookup::findEntry): Don't allocate and convert to ASCII just to search.
2002-11-19 Darin Adler <[email protected]>
- another hash table fix; yields a 2% improvement on iBench JavaScript
* kjs/property_map.cpp: A few more places where we use & instead of %.
- some List changes that don't affect speed yet
* kjs/types.cpp:
(List::prependList): Tighten up a tiny bit.
(List::copy): Use prependList.
* kjs/types.h: Remove appendList and globalClear.
* kjs/interpreter.cpp: (Interpreter::finalCheck): Remove List::globalClear().
2002-11-19 Darin Adler <[email protected]>
- fixed 3105026 -- REGRESSION: DHTML menus are broken all over the place
* kjs/types.cpp: (List::prepend): Fix backwards links in new node.
2002-11-19 Darin Adler <[email protected]>
- a fix that gives another 1.5% on the iBench JavaScript test
* kjs/ustring.cpp: (UString::from): Stop using sprintf to format integers.
2002-11-18 Darin Adler <[email protected]>
- reduced the creation of Value objects and hoisted the property map
into Object for another gain of about 6%
* JavaScriptCore.pbproj/project.pbxproj: Made property_map.h public.
* kjs/array_object.cpp:
(compareWithCompareFunctionForQSort): Don't wrap the ValueImp * in a Value
just to add it to a list.
(ArrayProtoFuncImp::call): Pass the globalObject directly so we don't have
to ref/deref.
* kjs/function.cpp:
(FunctionImp::call): Use a reference for the global object to avoid ref/deref.
(GlobalFuncImp::call): Ditto.
* kjs/internal.cpp:
(BooleanImp::toObject): Put the object directly into the list, don't create a Value.
(StringImp::toObject): Ditto.
(NumberImp::toObject): Ditto.
(InterpreterImp::evaluate): Use a reference for the global object.
* kjs/internal.h: Return a reference for the global object.
* kjs/interpreter.cpp: (Interpreter::globalObject): Ditto.
* kjs/interpreter.h: Ditto.
* kjs/object.cpp: Use _prop directly in the object, not a separate pointer.
* kjs/object.h: Ditto.
* kjs/types.cpp: Added List methods that work directly with ValueImp.
(List::append): Added a ValueImp version.
(List::prepend): Ditto.
(List::appendList): Work directly with the ValueImp's.
(List::prependList): Ditto.
(List::copy): Use appendList.
(List::empty): Use a shared global List.
* kjs/types.h: Update for above changes.
2002-11-18 Darin Adler <[email protected]>
* kjs/property_map.cpp: Oops, copyright goes to Apple, not me.
* kjs/property_map.h: Ditto.
2002-11-18 Darin Adler <[email protected]>
- property and string improvements giving a 7% or so improvement in JavaScript iBench
* kjs/property_map.h: Rewrite to use a hash table.
* kjs/property_map.cpp: Ditto.
* kjs/string_object.h:
* kjs/string_object.cpp:
(StringInstanceImp::StringInstanceImp): Construct a string with the right value
instead of putting the string in later.
(StringInstanceImp::get): Get the length from the string, not a separate property.
(StringInstanceImp::put): Ignore attempts to set length, since we don't put it in
the property map.
(StringInstanceImp::hasProperty): Return true for length.
(StringInstanceImp::deleteProperty): Return false for length.
(StringObjectImp::construct): Call new StringInstanceImp constructor. Don't try
to set a length property.
* kjs/ustring.h: Make the rep deref know how to deallocate the rep.
* kjs/ustring.cpp:
(UString::release): Move the real work to the rep's deref, since the hash table
now uses the rep directly.
* kjs/object.h: Remove unused field.
2002-11-18 Maciej Stachowiak <[email protected]>
Change List to completely avoid going through the GC
allocator. 3.6% performance improvement on JavaScript iBench.
* kjs/internal.cpp:
(InterpreterImp::mark): Don't mark the empty list.
For all the methods below I basically lifted the ListImp version
up to the List method with minor tweaks.
* kjs/types.cpp:
(ListIterator::ListIterator):
(List::List):
(List::operator=):
(List::~List):
(List::mark):
(List::append):
(List::prepend):
(List::appendList):
(List::prependList):
(List::removeFirst):
(List::removeLast):
(List::remove):
(List::clear):
(List::clearInternal):
(List::copy):
(List::begin):
(List::end):
(List::isEmpty):
(List::size):
(List::at):
(List::operator[]):
(List::empty):
(List::erase):
(List::refAll):
(List::derefAll):
(List::swap):
(List::globalClear):
* kjs/types.h:
2002-11-18 Maciej Stachowiak <[email protected]>
Fixed a horrible leak introduced with my last change that
somehow did not show up on my machine.
* kjs/types.cpp:
(List::List): Mark ListImp as GC allowed.
2002-11-18 Maciej Stachowiak <[email protected]>
Another step towards the List conversion: stop inheriting from Value.
* kjs/types.cpp:
(ListIterator::ListIterator):
(List::List):
(List::operator=):
(List::~List):
(List::mark):
(List::append):
(List::prepend):
(List::appendList):
(List::prependList):
(List::removeFirst):
(List::removeLast):
(List::remove):
(List::clear):
(List::copy):
(List::begin):
(List::end):
(List::isEmpty):
(List::size):
(List::at):
(List::operator[]):
* kjs/types.h:
2002-11-18 Maciej Stachowiak <[email protected]>
Partway to removing Value from List. Created a marking List
variant, used it in place of ListImp.
* kjs/internal.h: Removed List stuff.
* kjs/internal.cpp:
(InterpreterImp::mark): Call appropriate List method to do marking of
empty ListImp.
* kjs/object.h:
* kjs/object.cpp: Use marking List instead of ListImp *.
* kjs/types.h:
* kjs/types.cpp:
(List::List): New boolean needsMarking parameter.
(List::operator=): Perform trickery related to needsMarking.
(List::~List): Likewise.
(List::mark): Mark the ListImp.
(List::markEmptyList):
(ListImp::*): Moved here fron internal.cpp, they will be
integrated into the relevant List methods soon.
2002-11-18 Darin Adler <[email protected]>
- another string constant discovered that can be optimized
* kjs/object.h: Add a property name constant for "__proto__".
* kjs/object.cpp: Define it.
(ObjectImp::get): Use it.
(ObjectImp::hasProperty): Use it.
- prepare to turn PropertyMap into a hash table
* kjs/object.cpp:
(ObjectImp::mark): Use the new PropertyMap::mark().
(ObjectImp::put): Use the new overload of PropertyMap::get().
(ObjectImp::deleteProperty): Use the new overload of PropertyMap::get().
(ObjectImp::propList): Use PropertyMap::addEnumerablesToReferenceList().
* kjs/property_map.h: Remove PropertyMapNode and make all node-related methods private.
Add mark(), a new overload of get() that returns attributes, a clear() that takes no attributes,
and addEnumerablesToReferenceList().
* kjs/property_map.cpp:
(PropertyMap::get): Added new overload.
(PropertyMap::clear): Added new overload.
(PropertyMap::mark): Added.
(PropertyMap::addEnumerablesToReferenceList): Added.
* kjs/ustring.h: Added a hash function.
* kjs/ustring.cpp: (KJS::hash): Added.
2002-11-18 Darin Adler <[email protected]>
- simplified the ExecState class, which was showing up in profiles
Sped up JavaScript iBench by 6%.
* kjs/interpreter.h: Removed the level of indirection, and made it all inline.
* kjs/interpreter.cpp: Removed ExecState implementation from here altogether.
- fixed an oversight in my sort speedup
* kjs/array_object.h: Add pushUndefinedObjectsToEnd.
* kjs/array_object.cpp:
(ArrayInstanceImp::sort): Call pushUndefinedObjectsToEnd.
(ArrayInstanceImp::pushUndefinedObjectsToEnd): Added.
Pushes all undefined to the end of the array.
2002-11-18 Darin Adler <[email protected]>
- fix worst speed problems on the sort page of the iBench JavaScript test
Sped up JavaScript iBench by 70%, the sort page by 88%.
* kjs/array_object.h: Add array-specific sort functions.
* kjs/array_object.cpp:
(compareByStringForQSort): Added.
(ArrayInstanceImp::sort): Added.
(compareWithCompareFunctionForQSort): Added.
(ArrayProtoFuncImp::call): Use ArrayInstanceImp::sort if the object being
sorted is actually an array.
* kjs/object.h: Add argumentsPropertyName.
* kjs/object.cpp: Add argumentsPropertyName.
* kjs/function.cpp:
(FunctionImp::FunctionImp): Use argumentsPropertyName to avoid making a UString.
(FunctionImp::call): Ditto.
(ActivationImp::ActivationImp): Ditto.
* kjs/function_object.cpp: (FunctionObjectImp::construct): Ditto.
* kjs/ustring.h: Added compare function for -1/0/+1 comparison.
* kjs/ustring.cpp: (KJS::compare): Added.
2002-11-18 Maciej Stachowiak <[email protected]>
Change ArgumentListNode operations to be iterative instead of
recursive. This probably fixes 3095446 (Crash in
KJS::ArgumentListNode::ref()) but I can't reproduce it myself so
I'm not 100% sure. I think the original bug was a stack overflow
and this change would remove that possibility.
* kjs/nodes.cpp:
(ArgumentListNode::ref): Make iterative.
(ArgumentListNode::deref): Make iterative.
(ArgumentListNode::evaluateList): Make iterative.
=== Alexander-32 ===
2002-11-14 Darin Adler <[email protected]>
- fixed 3101243 -- excite passes date that can't be parsed, results in bogus date at top right corner
* kjs/date_object.cpp: (KJS::KRFCDate_parseDate): Handle errors from strtol
by checking errno. Check the "string in a haystack" to be sure it's a multiple
of 3. Add case that allows year to be after time.
2002-11-14 Darin Adler <[email protected]>
- fixed 3101191 -- REGRESSION: Hang loading excite.com
* kjs/date_object.cpp:
(mktimeUsingCF): Pick an arbitrary cutoff of 3000, and return -1 if the
year passed in is that big so we don't infinite loop. Also validate the
rest of the date with CFGregorianDateIsValid.
(DateProtoFuncImp::call): Handle a -1 result from mktime.
(DateObjectImp::construct): Check for NaN before calling mktime, and also
handle a -1 result from mktime.
(DateObjectFuncImp::call): Check for NaN before calling mktime, and also
handle a -1 result from mktime.
2002-11-13 Darin Adler <[email protected]>
- fixed 3099930 -- dates/times without time zones are parsed as UTC by kjs,
local time by other browsers
* kjs/date_object.cpp:
(DateProtoFuncImp::call): Handle the NaN case better, like Mozilla and OmniWeb.