-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChangeLog-2007-10-14
26221 lines (20174 loc) · 956 KB
/
ChangeLog-2007-10-14
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
=== Start merge of feature-branch 2007-10-12 ===
2007-10-11 Andrew Wellington <[email protected]>
Reviewed by Eric Seidel.
Fix for http://bugs.webkit.org/show_bug.cgi?id=15076
"deg2rad has multiple definitions"
Define deg2rad, rad2deg, deg2grad, grad2deg, rad2grad, grad2rad
These are used through WebKit.
Change based on original patch by Rob Buis.
* wtf/MathExtras.h:
(deg2rad):
(rad2deg):
(deg2grad):
(grad2deg):
(rad2grad):
(grad2rad):
2007-10-10 Maciej Stachowiak <[email protected]>
Reviewed by Eric.
- fix assertion failures on quit.
* kjs/array_object.cpp:
(ArrayProtoFunc::callAsFunction): Dynamically alocate function-scope static
UStrings to avoid the static destructor getting called later.
* kjs/lookup.h: Dynamically alocate function-scope static
Identifiers to avoid the static destructor getting called later.
2007-10-07 Ed Schouten <[email protected]>
Reviewed and landed by Alexey Proskuryakov.
Add PLATFORM(FREEBSD), so we can fix the build on FreeBSD-like
systems by including <pthread_np.h>. Also fix some (disabled)
regcomp()/regexec() code; it seems some variable names have
changed.
* kjs/config.h:
* kjs/regexp.cpp:
(KJS::RegExp::RegExp):
* wtf/Platform.h:
2007-10-02 Alexey Proskuryakov <[email protected]>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=10370
RegExp fails to match non-ASCII characters against [\S\s]
Test: fast/js/regexp-negative-special-characters.html
* pcre/pcre_compile.c:
(compile_branch): Adjust opcode and bitmap as necessary to include (or exclude)
character codes >255. Fix suggested by Philip Hazel.
* pcre/pcre_exec.c:
(match): Merged fix for PCRE bug 580 (\S\S vs. \S{2}).
* tests/mozilla/expected.html: One test was fixed.
* pcre/MERGING: Added information about this fix.
2007-10-02 Maciej Stachowiak <[email protected]>
Reviewed by Oliver.
- skip extra hash lookup and avoid converting char* to UString for 19% speedup on CK JS array test
http://bugs.webkit.org/show_bug.cgi?id=15350
* kjs/array_object.cpp:
(ArrayProtoFunc::callAsFunction): Implement the two mentioned optimizations.
2007-10-02 Maciej Stachowiak <[email protected]>
Reviewed by Mark.
- Efficiently handle regexp property identifiers for 19% speedup on Celtic Kane regexp test
http://bugs.webkit.org/show_bug.cgi?id=15337
* kjs/CommonIdentifiers.h:
* kjs/regexp_object.cpp:
(RegExpProtoFunc::callAsFunction):
(RegExpObjectImp::arrayOfMatches):
(RegExpObjectImp::construct):
2007-10-02 Maciej Stachowiak <[email protected]>
Reviewed by Mark.
- Cache global prorotypes more efficiently for 10% speedup on CK AJAX benchmark
http://bugs.webkit.org/show_bug.cgi?id=15335
* kjs/lookup.h:
2007-10-01 Oliver Hunt <[email protected]>
Reviewed by Mark.
Enable Experimental SVG features by default when building from Xcode
* Configurations/JavaScriptCore.xcconfig:
2007-09-29 Rob Buis <[email protected]>
Reviewed by Adam.
http://bugs.webkit.org/show_bug.cgi?id=13472
Misparsing date in javascript leads to year value of -1
http://bugs.webkit.org/show_bug.cgi?id=14176
Some date values not handled consistently with IE/Firefox
Allow an optional comma between month and year, and year and time.
* kjs/date_object.cpp:
(KJS::parseDate):
2007-07-11 Nikolas Zimmermann <[email protected]>
Reviewed by Mark.
Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
* kjs/create_hash_table:
2007-06-25 Antti Koivisto <[email protected]>
Reviewed by Maciej.
Use intHash to hash floats and doubles too.
* ChangeLog:
* wtf/HashFunctions.h:
(WTF::FloatHash::hash):
(WTF::FloatHash::equal):
(WTF::):
* wtf/HashTraits.h:
(WTF::FloatHashTraits::emptyValue):
(WTF::FloatHashTraits::deletedValue):
(WTF::):
=== End merge of feature-branch 2007-10-12 ===
2007-10-11 Mark Rowe <[email protected]>
Reviewed by Tim Hatcher.
Fix for <rdar://problem/5488678>. Disable debugging symbols in production builds for 10.4
PowerPC to prevent a huge STABS section from being generated.
* Configurations/Base.xcconfig:
2007-10-08 George Staikos <[email protected]>
Reviewed by Adam Roben.
Fix Qt build on Win32.
* kjs/testkjs.cpp:
(main):
2007-10-10 Simon Hausmann <[email protected]>
Reviewed by Lars.
Fix compilation using gcc 4.3. Header files have been reorganized and as a result some extra
includes are needed for INT_MAX, std::auto_ptr and the like.
* kjs/collector.cpp:
* kjs/collector.h:
* kjs/lexer.cpp:
* kjs/scope_chain.cpp:
* kjs/ustring.cpp:
* wtf/Vector.h:
2007-10-09 Lars Knoll <[email protected]>
Reviewed by Simon.
fix the invokation of slots with return types. Add a JSLock around the conversion from QVariant to JSValue.
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtInstance::invokeMethod):
* bindings/qt/qt_runtime.cpp:
(KJS::Bindings::convertValueToQVariant):
(KJS::Bindings::convertQVariantToValue):
2007-10-05 Geoffrey Garen <[email protected]>
Reviewed by Sam Weinig.
Added JSObject::removeDirect, to support the fix for
<rdar://problem/5522487> REGRESSION: With JavaScript disabled, any
page load causes a crash in PropertyMap::put
* kjs/object.cpp:
(KJS::JSObject::removeDirect):
* kjs/object.h:
2007-10-04 Mark Rowe <[email protected]>
Reviewed by Oliver.
Switch to default level of debugging symbols to resolve <rdar://problem/5488678>.
The "full" level appears to offer no observable benefits even though the documentation
suggests it be used for dead code stripping. This should also decrease link times.
* Configurations/Base.xcconfig:
2007-10-03 Lars Knoll <[email protected]>
Reviewed by Rob.
Fix a stupid bug in Unicode::toUpper/toLower.
Fixes all three test failures in the JavaScriptCore test
suite.
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::toLower):
(WTF::Unicode::toUpper):
2007-10-02 Darin Adler <[email protected]>
Reviewed by Adam.
- add support for GDI objects to OwnPtr; I plan to use this
to fix some GDI handle leaks
* kjs/grammar.y: Change parser to avoid macros that conflict
with macros defined in Windows system headers: THIS, DELETE,
VOID, IN, and CONST. This is needed because OwnPtr.h will now
include <windows.h>.
* kjs/keywords.table: Ditto.
* wtf/OwnPtr.h: For PLATFORM(WIN), add support so that OwnPtr can be
a GDI handle, and it will call DeleteObject. Also change to use the
RemovePointer technique used by RetainPtr, so you can say OwnPtr<HBITMAP>
rather than having to pass in the type pointed to by HBITMAP.
* wtf/OwnPtrWin.cpp: Added.
(WebCore::deleteOwnedPtr): Put this in a separate file so that we
don't have to include <windows.h> in OwnPtr.h.
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OwnPtrWin.cpp.
2007-09-29 Holger Hans Peter Freyther <[email protected]>
Reviewed by Mark.
-Fix http://bugs.webkit.org/show_bug.cgi?id=13226.
Remove Bakefiles from svn.
* JavaScriptCoreSources.bkl: Removed.
* jscore.bkl: Removed.
2007-09-27 Kevin Decker <[email protected]>
Rubber stamped by John Sullivan.
<rdar://problem/5493093>
* JavaScriptCore.order: Added.
* JavaScriptCore.xcodeproj/project.pbxproj: We're changing from using an order file built by
another team to using one we actually check into our project repository. Linker settings for
Symbol Ordering Flags have been updated accordingly.
2007-09-26 Adam Roben <[email protected]>
Make testkjs delay-load WebKit.dll so WebKitInitializer can work its magic
Rubberstamped by Anders.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2007-09-25 Adam Roben <[email protected]>
Make testkjs delay-load its dependencies
This lets WebKitInitializer re-route the dependencies to be loaded out
of the Safari installation directory.
Rubberstamped by Sam.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2007-09-25 David Kilzer <[email protected]>
Reviewed by Adam.
- Fix http://bugs.webkit.org/show_bug.cgi?id=14885
LGPL'ed files contain incorrect FSF address
* COPYING.LIB:
* bindings/testbindings.cpp:
* kjs/AllInOneFile.cpp:
* kjs/DateMath.cpp:
* kjs/PropertyNameArray.cpp:
* kjs/PropertyNameArray.h:
* kjs/config.h:
2007-09-25 Sam Weinig <[email protected]>
Fix location for build products for Debug_Internal.
Reviewed by Adam Roben.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2007-09-25 Adam Roben <[email protected]>
Make testkjs use WebKitInitializer
Reviewed by Sam.
* JavaScriptCore.vcproj/JavaScriptCore.sln: Add WebKitInitializer and
make testkjs depend on it.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
WebKitInitializer.lib.
* kjs/testkjs.cpp:
(main): Call initializeWebKit.
2007-09-24 Kevin McCullough <[email protected]>
Reviewed by Sam.
- Continued to update project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
2007-09-21 Kevin McCullough <[email protected]>
Reviewed by Sam.
- Updated project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2007-09-20 Holger Hans Peter Freyther <[email protected]>
Rubber stamped by Adam.
Renamed files from *Gdk to *Gtk (see #14732) using the
work of Juan A. Suarez Romero as a base.
GDK -> GTK
* JavaScriptCore.pri:
* kjs/testkjs.pro:
* pcre/dftables.pro:
* wtf/Platform.h: PLATFORM(GDK) to PLATFORM(GTK)
2007-09-21 Mark Rowe <[email protected]>
Reviewed by Antti Koivisto.
http://bugs.webkit.org/show_bug.cgi?id=15250
<rdar://problem/5496942> REGRESSION: Reproducible crash in Safari when evaluating script in Drosera console (15250)
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction): Null-check thisObj before passing it to interpreterForGlobalObject.
2007-09-19 Holger Hans Peter Freyther <[email protected]>
Rubber stamped by Adam.
Make the guard/#if use the same name (ENABLE_FTPDIR) as the #define. This follows
the ENABLE_ICONDATABASE example from a couple of lines above.
* wtf/Platform.h:
2007-09-19 Mark Rowe <[email protected]>
Reviewed by Maciej.
<rdar://problem/5487107> NULL dereference crash in FastMallocZone::enumerate when running leaks against Safari
Storing remote pointers to their local equivalents in mapped memory was leading to the local pointer being
interpreted as a remote pointer. This caused a crash when using the result of mapping this invalid remote pointer.
The fix is to follow the pattern used elsewhere in FastMallocZone by always doing the mapping after reading and
never storing the mapped pointer.
* wtf/FastMalloc.cpp:
(WTF::FastMallocZone::enumerate):
2007-09-15 Darin Adler <[email protected]>
- fix Mac build
* JavaScriptCore.exp: Export WTFLogVerbose.
2007-09-14 Kevin McCullough <[email protected]>
Reviewed by Sam.
- Copy JSRetainPtr to include folder.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-09-13 Geoffrey Garen <[email protected]>
Try to fix GDK build.
* wtf/MathExtras.h:
(wtf_random_init):
2007-09-12 Geoff Garen <[email protected]>
Reviewed by Sam Weinig.
Fixed <rdar://problem/5429064> 141885 Safari JavaScript: Math.random() slightly less randomly distributed than on Safari / Mac
Math.random was skewed slightly upward because it assumed that RAND_MAX was outside the range of
values that rand() might return. This problem was particularly pronounced on Windows because
the range of values returned by rand() on Windows is 2^16 smaller than the range of values
return by rand() on Mac.
Fixed by accounting for RAND_MAX return values. Also, switched Windows over to rand_s, which has
a range that's equal to rand()'s range on Mac.
* kjs/config.h:
* kjs/math_object.cpp:
(MathFuncImp::callAsFunction): Use the new new thing.
* wtf/MathExtras.h: Platform abstraction for random numbers, to cover over differences on Windows.
(wtf_random_init):
(wtf_random):
2007-09-13 Antti Koivisto <[email protected]>
Reviewed by Maciej.
Small addition to previous path to cover
http://bugs.webkit.org/show_bug.cgi?id=11399
window.eval runs in the global scope of the calling window
Switch variable scope as well.
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction):
2007-09-12 Antti Koivisto <[email protected]>
Reviewed by Geoff, Maciej.
Fix <rdar://problem/5445058>
REGRESSION: Unable to upload picture to eBay auction due to domain security check
eBay uses window.eval() between windows. In Firefox window.eval() switches execution
and security context to the target window, something WebKit did not do. With WebKit
security tightening in r24781, this broke picture uploads.
Fix by making WebKit switch context in window.eval().
* kjs/Context.cpp:
(KJS::Context::Context):
(KJS::Context::~Context):
* kjs/context.h:
Save and restore interpreter context independently from calling context.
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction):
If eval is called for global object different than current one, switch execution context
to that object and push it to scope.
2007-09-12 Sam Weinig <[email protected]>
Reviewed by Geoffrey Garen.
<rdar://problem/5478717> JSStringCreateWithCFString leaks when passed a zero length CFStringRef
* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString): Special case the zero length string and remove the
UTF16 optimized path since it will always leak due to the fact that we won't be
able to free the backing store that the CFStringRef provides.
2007-09-10 Timothy Hatcher <[email protected]>
Reviewed by Darin Adler.
<rdar://problem/5456224> CrashTracer: [USER] 2 crashes in Toast Titanium at com.apple.CoreServices.CarbonCore: CSMemDisposePtr + 37
Removed the implementation of these malloc zone functions. We do not have the ability to
check if a pointer is valid or not, so we can't correctly implement them. The system free
does not fail if you pass in a bad pointer.
* wtf/FastMalloc.cpp:
(WTF::FastMallocZone::size):
(WTF::FastMallocZone::zoneMalloc):
(WTF::FastMallocZone::zoneCalloc):
(WTF::FastMallocZone::zoneFree):
(WTF::FastMallocZone::zoneRealloc):
2007-09-07 Darin Adler <[email protected]>
Reviewed by Steve Falkenburg.
- fix crash seen on Windows release builds
* wtf/FastMalloc.cpp: Change pthread_getspecific optimization to be done only
on the DARWIN platform. Also correct a couple reinterpret_cast that should be
static_cast instead.
2007-09-06 Kevin McCullough <[email protected]>
Reviewed by Maciej.
- Moved JSRetainPtr to the API.
* API/JSRetainPtr.h: Copied from kjs/JSRetainPtr.h.
(JSRetain):
(JSRelease):
(JSRetainPtr::JSRetainPtr):
(JSRetainPtr::~JSRetainPtr):
(JSRetainPtr::get):
(JSRetainPtr::releaseRef):
(JSRetainPtr::operator->):
(JSRetainPtr::operator!):
(JSRetainPtr::operator UnspecifiedBoolType):
(::operator):
(::adopt):
(::swap):
(swap):
(operator==):
(operator!=):
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/JSRetainPtr.h: Removed.
2007-09-05 Maciej Stachowiak <[email protected]>
Reviewed by Darin.
- Remove single-threaded optimization for FastMalloc.
It does not appear to help anywhere but Mac OS X on PPC, due to
pthread_getspecific being slow there. On Intel, removing the
optimization results in a ~1.5% PLT speedup, a ~1-5% JS iBench
speedup, and a ~1.5% HTML iBench speedup. On PPC this change is a
speedup on some benchmarks, a slight hit on others.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/collector.cpp:
(KJS::Collector::registerThread):
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_ThreadCache::GetCache):
(WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
(WTF::do_malloc):
* wtf/FastMallocInternal.h: Removed.
2007-09-05 Kevin McCullough <[email protected]>
Reviewed by Adam, Sam, Darin.
- Created a JSRetainPtr specifically for JSStringRefs so they can be automatically refed and derefed.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/JSRetainPtr.h: Copied from wtf/RetainPtr.h.
(KJS::JSRetain):
(KJS::JSRelease):
(KJS::):
(KJS::JSRetainPtr::JSRetainPtr):
(KJS::JSRetainPtr::~JSRetainPtr):
(KJS::JSRetainPtr::get):
(KJS::JSRetainPtr::releaseRef):
(KJS::JSRetainPtr::operator->):
(KJS::JSRetainPtr::operator UnspecifiedBoolType):
(KJS::::operator):
(KJS::::adopt):
(KJS::::swap):
(KJS::swap):
(KJS::operator==):
(KJS::operator!=):
2007-09-05 Mark Rowe <[email protected]>
Unreviewed Qt build fix.
* wtf/unicode/qt4/UnicodeQt4.h: Fix the constness of the src argument to toUpper to prevent build failures.
2007-09-04 Maciej Stachowiak <[email protected]>
Back out accidentally committed change.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/collector.cpp:
(KJS::Collector::registerThread):
* wtf/FastMalloc.cpp:
(WTF::fastMallocSetIsMultiThreaded):
(WTF::TCMalloc_ThreadCache::GetCache):
(WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
(WTF::do_malloc):
* wtf/FastMallocInternal.h: Added.
2007-09-04 Maciej Stachowiak <[email protected]>
Reviewed by Darin.
- Added Vector::appendRange(), which appends to a vector based on a given start and end iterator
- Added keys() and values() functions to HashMap iterators, which give keys-only and values-only iterators
Together, these allow easy copying of a set, or the keys or values of a map, into a Vector. Examples:
HashMap<int, int> map;
HashSet<int> set;
Vector<int> vec;
// ...
vec.appendRange(set.begin(), set.end());
vec.appendRange(map.begin().keys(), map.end().keys());
vec.appendRange(map.begin().values(), map.end().values());
This also allows for a slightly nicer syntax when iterating a map. Instead of saying
(*it)->first, you can say *it.values(). Similarly for keys. Example:
HashMap<int, int>::const_iterator end = map.end();
for (HashMap<int, int>::const_iterator it = map.begin(); it != end; ++it)
printf(" [%d => %d]", *it.keys(), *it.values());
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/HashIterators.h: Added.
(WTF::):
(WTF::HashTableConstKeysIterator::HashTableConstKeysIterator):
(WTF::HashTableConstKeysIterator::get):
(WTF::HashTableConstKeysIterator::operator*):
(WTF::HashTableConstKeysIterator::operator->):
(WTF::HashTableConstKeysIterator::operator++):
(WTF::HashTableConstValuesIterator::HashTableConstValuesIterator):
(WTF::HashTableConstValuesIterator::get):
(WTF::HashTableConstValuesIterator::operator*):
(WTF::HashTableConstValuesIterator::operator->):
(WTF::HashTableConstValuesIterator::operator++):
(WTF::HashTableKeysIterator::HashTableKeysIterator):
(WTF::HashTableKeysIterator::get):
(WTF::HashTableKeysIterator::operator*):
(WTF::HashTableKeysIterator::operator->):
(WTF::HashTableKeysIterator::operator++):
(WTF::HashTableKeysIterator::operator HashTableConstKeysIterator<HashTableType, KeyType, MappedType>):
(WTF::HashTableValuesIterator::HashTableValuesIterator):
(WTF::HashTableValuesIterator::get):
(WTF::HashTableValuesIterator::operator*):
(WTF::HashTableValuesIterator::operator->):
(WTF::HashTableValuesIterator::operator++):
(WTF::HashTableValuesIterator::operator HashTableConstValuesIterator<HashTableType, KeyType, MappedType>):
(WTF::operator==):
(WTF::operator!=):
* wtf/HashTable.h:
* wtf/Vector.h:
(WTF::::appendRange):
2007-09-04 Maciej Stachowiak <[email protected]>
Reviewed by Darin.
- Remove single-threaded optimization for FastMalloc.
It does not appear to help anywhere but Mac OS X on PPC, due to
pthread_getspecific being slow there. On Intel, removing the
optimization results in a 1% PLT speedup, a 2% JS iBench speedup,
and no measurable effect on HTML iBench (maybe a slight speedup).
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/collector.cpp:
(KJS::Collector::registerThread):
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_ThreadCache::GetCache):
(WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
(WTF::do_malloc):
* wtf/FastMallocInternal.h: Removed.
2007-09-03 Mark Rowe <[email protected]>
Reviewed by Tim Hatcher.
<rdar://problem/5452164> Production build with in symbols directory has no debug info
Enable debug symbol generation on all build configurations. Production builds are stripped
of symbols by Xcode during deployment post-processing.
* Configurations/Base.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
2007-08-30 Riku Voipio <[email protected]>
Reviewed by Dave Kilzer.
Better ARM defines.
* kjs/ustring.h: Update comments to reflect the change and update test
to fit changes to Platform.h.
* wtf/Platform.h: Forced packing is only needed on oldabi ARM.
Set middle-endian floats only for little-endian oldabi ARM.
Set big-endian define for big-endian ARM.
2007-08-29 Ryan Leavengood <[email protected]>
Reviewed by Maciej.
http://bugs.webkit.org/show_bug.cgi?id=15043
- posix_memalign takes a void** as its first parameter. My port makes use of this function call.
* kjs/collector.cpp:
(KJS::allocateBlock):
2007-08-26 Darin Adler <[email protected]>
- quick follow on to that last check-in
* API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject):
Need to initialize m_class to 0.
2007-08-26 Mark Rowe <[email protected]>
Reviewed by Darin Adler.
<rdar://problem/4949002> JSGlobalContextCreate can cause crashes because it passes a NULL JSContextRef to the globalObjectClass's initialize callback
JSCallbackObject now tracks whether it was constructed with a null ExecState. This will happen when the object is being used as the global object,
as the Interpreter needs to be created after the global object. In this situation the initialization is deferred until after the Interpreter's
ExecState is available to be passed down to the initialize callbacks.
* API/JSCallbackObject.cpp:
(KJS::JSCallbackObject::init): Track whether we successfully initialized.
(KJS::JSCallbackObject::initializeIfNeeded): Attempt to initialize with the new ExecState.
* API/JSCallbackObject.h:
* API/JSContextRef.cpp:
(JSGlobalContextCreate): Initialize the JSCallbackObject with the Interpreter's ExecState.
* API/testapi.c:
(testInitializeOfGlobalObjectClassHasNonNullContext):
(main): Verify that the context passed to the initialize callback is non-null.
2007-08-26 Mark Rowe <[email protected]>
Reviewed by Darin Adler.
<rdar://problem/5438496> JSGlobalContextCreate crashes when passed a custom class
* API/JSContextRef.cpp:
(JSGlobalContextCreate): Specify jsNull() as the prototype and let Interpreter's constructor fix it up to point at builtinObjectPrototype().
* API/testapi.c:
(main): Use an instance of a custom class as the global object to ensure the code path is exercised in the test.
2007-08-26 Mike Hommey <[email protected]>
Reviewed by Mark Rowe and David Kilzer.
Fix build failure on arm.
* wtf/Platform.h: Also test if __arm__ is defined.
2007-08-25 Peter Kasting <[email protected]>
Reviewed by Maciej Stachowiak.
Part 3 of http://bugs.webkit.org/show_bug.cgi?id=14967
Bug 14967: Reduce wtf::Vector::operator[]() overloads
* wtf/Vector.h:
(WTF::Vector::operator[]): Only provide versions of operator[] that takes a size_t argument.
2007-08-25 Peter Kasting <[email protected]>
Reviewed by Sam Weinig.
Part 2 of http://bugs.webkit.org/show_bug.cgi?id=14967.
Eliminate all remaining implicit conversions of wtf::Vector<T> to T*. Where code was
previously checking that the Vector's data pointer was non-NULL, check !Vector::isEmpty()
instead.
* wtf/Vector.h:
(WTF::Vector::data):
2007-08-16 Kevin McCullough <[email protected]>
Reviewed by Geoff and Adam.
- Changing stack depth to 500 (from 100 on mac and win) to help out some apps specifically gmail. <rdar://problem/3590522> JavaScript call stack limit of 99 is too small for some applications; needs to be closer to 500 (4045)
* kjs/object.cpp:
2007-08-15 Peter Kasting <[email protected]>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
conversions of wtf::Vector<T> to T* by explicitly calling .data()
* API/JSCallbackConstructor.cpp:
(KJS::JSCallbackConstructor::construct):
* API/JSCallbackFunction.cpp:
(KJS::JSCallbackFunction::callAsFunction):
* API/JSCallbackObject.cpp:
(KJS::JSCallbackObject::construct):
(KJS::JSCallbackObject::callAsFunction):
* bindings/c/c_instance.cpp:
(KJS::Bindings::CInstance::invokeMethod):
(KJS::Bindings::CInstance::invokeDefaultMethod):
* kjs/number_object.cpp:
(integer_part_noexp):
(char_sequence):
* kjs/ustring.cpp:
(KJS::UString::UTF8String):
2007-08-14 Darin Adler <[email protected]>
Reviewed by Sam.
- fix <rdar://problem/5410570> Global initializer introduced by use of std::numeric_limits in r24919
* kjs/ustring.cpp:
(KJS::overflowIndicator): Turned into a function.
(KJS::maxUChars): Ditto.
(KJS::allocChars): Use the functions.
(KJS::reallocChars): Ditto.
(KJS::UString::expandedSize): Ditto.
2007-08-12 Darin Adler <[email protected]>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=14931
<rdar://problem/5403816> JavaScript regular expression non-participating capturing parentheses
fail in 3 different ways
Test: fast/js/regexp-non-capturing-groups.html
* kjs/string_object.cpp:
(KJS::replace): Add missing code to handle undefined backreferences; before we'd get the empty string
instead of a JavaScript "undefined" value.
(KJS::StringProtoFunc::callAsFunction): Implemented backreference support for split.
* pcre/pcre_exec.c: (match): Made backreferences to undefined groups match the empty string instead
of always failing. Only in JAVASCRIPT mode.
* tests/mozilla/expected.html: Add a new expected test success, since this fixed one test result.
2007-08-10 Timothy Hatcher <[email protected]>
Reviewed by Adam.
<rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
Disable the NPAPI for 64-bit on Mac OS X.
* Configurations/JavaScriptCore.xcconfig: Use the 64-bit export file.
* JavaScriptCore.xcodeproj/project.pbxproj: Create a 64-bit export file
that filters out the NPN fnctions.
* bindings/NP_jsobject.cpp: #ifdef out this for 64-bit on Mac OS X
* bindings/NP_jsobject.h: Ditto.
* bindings/c/c_class.cpp: Ditto.
* bindings/c/c_class.h: Ditto.
* bindings/c/c_instance.cpp: Ditto.
* bindings/c/c_instance.h: Ditto.
* bindings/c/c_runtime.cpp: Ditto.
* bindings/c/c_runtime.h: Ditto.
* bindings/c/c_utility.cpp: Ditto.
* bindings/c/c_utility.h: Ditto.
* bindings/npapi.h: Ditto.
* bindings/npruntime.cpp: Ditto.
* bindings/npruntime.h: Ditto.
* bindings/npruntime_impl.h: Ditto.
* bindings/npruntime_priv.h: Ditto.
* bindings/runtime.cpp:
(KJS::Bindings::Instance::createBindingForLanguageInstance):
don't creat an NPObject on Mac OS X in 64-bit.
2007-08-09 Mark Rowe <[email protected]>
Reviewed by Antti.
<rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
* Configurations/Version.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
Version.xcconfig and Info.plist explicit to Xcode.
2007-08-08 George Staikos <[email protected]>
Make it compile with Qt again.
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::toUpper):
2007-08-07 Sam Weinig <[email protected]>
Reviewed by Oliver.
Fix for http://bugs.webkit.org/show_bug.cgi?id=14897
Decompilation of double negation fails and produces invalid or incorrect code
Test: fast/js/function-decompilation-operators.html
* kjs/nodes2string.cpp:
(UnaryPlusNode::streamTo): Put space after unary operator. Matches Firefox.
(NegateNode::streamTo): Diito.
(MultNode::streamTo): Put spaces around binary operator. Matches Firefox.
(AddNode::streamTo): Ditto.
2007-08-07 Darin Adler <[email protected]>
Reviewed by Adele.
- fix <rdar://problem/5383104> REGRESSION: XHR.responseText is null instead of empty string
in http/tests/xmlhttprequest/zero-length-response.html
The new code to handle out of memory conditions was turning a "" into a null string.
* kjs/ustring.h: Removed UCharReference, which has long been obsolete and unused.
Removed copyForWriting, which was only used for the upper/lowercasing code and for
UCharReference.
* kjs/ustring.cpp:
(KJS::allocChars): Removed special case that made this fail (return 0) when passed 0.
Instead assert that we're not passed 0. Also added an overflow check for two reasons:
1) for sizes that aren't checked this prevents us from allocating a buffer that's too
small, and 2) for sizes where we overflowed in the expandedSize function and returned
overflowIndicator, it guarantees we fail.
(KJS::reallocChars): Ditto.
(KJS::UString::expandedSize): Return a large number, overflowIndicator, rather than 0
for cases where we overflow.
(KJS::UString::spliceSubstringsWithSeparators): Added a special case for empty string so
we don't call allocChars with a length of 0.
(KJS::UString::operator=): Added special characters for both 0 and empty string so we
match the behavior of the constructor. This avoids calling allocChars with a length of 0
and making a null string rather than an empty string in that case, and also matches the
pattern used in the rest of the functions.
(KJS::UString::operator[]): Made the return value const so code that tries to use the
operator to modify the string will fail.
* kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction): Rewrote uppercasing and
lowercasing functions so they don't need copyForWriting any more -- it wasn't really doing
any good for optimization purposes. Instead use a Vector and releaseBuffer.
* wtf/unicode/icu/UnicodeIcu.h: Eliminate one of the versions of toLower/toUpper -- we now
only need the version where both a source and destination buffer is passed in, not the one
that works in place.
* wtf/unicode/qt4/UnicodeQt4.h: Ditto.
2007-08-06 Sam Weinig <[email protected]>
Reviewed by Oliver.
Fix for http://bugs.webkit.org/show_bug.cgi?id=14891
Decompilation of try block immediately following "else" fails
Test: fast/js/toString-try-else.html
* kjs/nodes2string.cpp:
(TryNode::streamTo): Add newline before "try".
2007-08-07 Mark Rowe <[email protected]>
Reviewed by Maciej.
<rdar://problem/5388774> REGRESSION: Hang occurs after clicking "Attach a file " link in a new .Mac message
Attempting to acquire the JSLock inside CollectorHeap::forceLock can lead to a deadlock if the thread currently
holding the lock is waiting on the thread that is forking. It is not considered safe to use system frameworks
after a fork without first execing[*] so it is not particularly important to ensure that the collector and
fastMalloc allocators are unlocked in the child process. If the child process wishes to use JavaScriptCore it
should exec after forking like it would to use any other system framework.
[*]: <http://lists.apple.com/archives/Cocoa-dev/2005/Jan/msg00676.html>
* kjs/CollectorHeapIntrospector.cpp: Remove forceLock and forceUnlock implementations.
* kjs/CollectorHeapIntrospector.h: Stub out forceLock and forceUnlock methods.
* wtf/FastMalloc.cpp: Ditto.
2007-08-06 Darin Adler <[email protected]>
Rubber stamped by Geoff.
* kjs/ustring.h: Added an assertion which would have helped us find the
previous bug more easily.
2007-08-06 Darin Adler <[email protected]>
Reviewed by Anders.
- fix <rdar://problem/5387589> 9A514: Quartz Composer crash on launch in KJS::jsString
* API/JSBase.cpp:
(JSEvaluateScript): Turn NULL for sourceURL into UString::null(), just as JSObjectMakeFunction already does.
(JSCheckScriptSyntax): Ditto.
2007-08-06 Matt Lilek <[email protected]>
Not reviewed, build fix.
* kjs/string_object.cpp:
(KJS::StringProtoFunc::callAsFunction):
2007-08-04 Darin Adler <[email protected]>
Reviewed by Maciej.