/
ChangeLog
19817 lines (15995 loc) · 815 KB
/
ChangeLog
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
2017-08-09 Oleksandr Skachkov <gskachkov@gmail.com>
REGRESSION: 2 test262/test/language/statements/async-function failures
https://bugs.webkit.org/show_bug.cgi?id=175334
Reviewed by Yusuke Suzuki.
Switch off useAsyncIterator by default
* runtime/Options.h:
2017-08-08 Filip Pizlo <fpizlo@apple.com>
ICs should do caging
https://bugs.webkit.org/show_bug.cgi?id=175295
Reviewed by Saam Barati.
Adds the appropriate cage() calls in our inline caches.
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/InlineAccess.cpp:
(JSC::InlineAccess::dumpCacheSizesAndCrash):
(JSC::InlineAccess::generateSelfPropertyAccess):
(JSC::InlineAccess::generateSelfPropertyReplace):
(JSC::InlineAccess::generateArrayLength):
2017-08-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: support editing WebGL shaders
https://bugs.webkit.org/show_bug.cgi?id=124211
<rdar://problem/15448958>
Reviewed by Matt Baker.
* inspector/protocol/Canvas.json:
Add `updateShader` command that will change the given shader's source to the provided string,
recompile, and relink it to its associated program.
Drive-by: add description to `requestShaderSource` command.
2017-08-08 Robin Morisset <rmorisset@apple.com>
Make JSC_validateExceptionChecks=1 succeed on JSTests/slowMicrobenchmarks/spread-small-array.js.
https://bugs.webkit.org/show_bug.cgi?id=175347
Reviewed by Saam Barati.
This is done by making finishCreation explicitely check for exceptions after setConstantRegister and setConstantIdentifiersSetRegisters.
I chose to have this check replace the boolean returned previously by these functions for readability. The performance impact should be
negligible considering how much more finishCreation does.
This fix then caused another issue to appear as it was now clear that finishCreation can throw. And since it is called by ProgramCodeBlock::create(),
FunctionCodeBlock::create() and friends, that are in turn called by ScriptExecutable::newCodeBlockFor, this last function also required a few tweaks.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::setConstantIdentifierSetRegisters):
(JSC::CodeBlock::setConstantRegisters):
* bytecode/CodeBlock.h:
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
2017-08-08 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix Ubuntu LTS build
https://bugs.webkit.org/show_bug.cgi?id=174490
* inspector/remote/glib/RemoteInspectorGlib.cpp:
* inspector/remote/glib/RemoteInspectorServer.cpp:
2017-08-08 Filip Pizlo <fpizlo@apple.com>
Baseline JIT should do caging
https://bugs.webkit.org/show_bug.cgi?id=175037
Reviewed by Mark Lam.
Adds a AssemblyHelpers::cage and cageConditionally. Uses it in the baseline JIT.
Also modifies FTL caging to be more defensive when caging is disabled.
Relanded with fixed AssemblyHelpers::cageConditionally().
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/InlineAccess.cpp:
(JSC::InlineAccess::dumpCacheSizesAndCrash):
(JSC::InlineAccess::generateSelfPropertyAccess):
(JSC::InlineAccess::generateSelfPropertyReplace):
(JSC::InlineAccess::generateArrayLength):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::caged):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::cage):
(JSC::AssemblyHelpers::cageConditionally):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitDoubleLoad):
(JSC::JIT::emitContiguousLoad):
(JSC::JIT::emitArrayStorageLoad):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emitIntTypedArrayGetByVal):
(JSC::JIT::emitFloatTypedArrayGetByVal):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* jsc.cpp:
(jscmain):
(primitiveGigacageDisabled): Deleted.
2017-08-08 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r220368.
This change caused WK1 tests to exit early with crashes.
Reverted changeset:
"Baseline JIT should do caging"
https://bugs.webkit.org/show_bug.cgi?id=175037
http://trac.webkit.org/changeset/220368
2017-08-08 Michael Catanzaro <mcatanzaro@igalia.com>
[CMake] Properly test if compiler supports compiler flags
https://bugs.webkit.org/show_bug.cgi?id=174490
Reviewed by Konstantin Tokarev.
* API/tests/PingPongStackOverflowTest.cpp:
(testPingPongStackOverflow):
* API/tests/testapi.c:
* b3/testb3.cpp:
(JSC::B3::testPatchpointLotsOfLateAnys):
2017-08-06 Yusuke Suzuki <utatane.tea@gmail.com>
[Linux] Clear WasmMemory with madvice instead of memset
https://bugs.webkit.org/show_bug.cgi?id=175150
Reviewed by Filip Pizlo.
In Linux, zeroing pages with memset populates backing store.
Instead, we should use madvise with MADV_DONTNEED. It discards
pages. And if you access these pages, on-demand-zero-pages will
be shown.
We also commit grown pages in all OSes.
* wasm/WasmMemory.cpp:
(JSC::Wasm::commitZeroPages):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::grow):
2017-08-07 Robin Morisset <rmorisset@apple.com>
GetOwnProperty of TypedArray indexed fields is wrongly configurable
https://bugs.webkit.org/show_bug.cgi?id=175307
Reviewed by Saam Barati.
```
let a = new Uint8Array(10);
let b = Object.getOwnPropertyDescriptor(a, 0);
assert(b.configurable === false);
```
should not fail: by section 9.4.5.1 (https://tc39.github.io/ecma262/#sec-integer-indexed-exotic-objects-getownproperty-p)
that applies to integer indexed exotic objects, and section 22.2.7 (https://tc39.github.io/ecma262/#sec-properties-of-typedarray-instances)
that says that typed arrays are integer indexed exotic objects.
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlotByIndex):
2017-08-07 Filip Pizlo <fpizlo@apple.com>
Baseline JIT should do caging
https://bugs.webkit.org/show_bug.cgi?id=175037
Reviewed by Mark Lam.
Adds a AssemblyHelpers::cage and cageConditionally. Uses it in the baseline JIT.
Also modifies FTL caging to be more defensive when caging is disabled.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::caged):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::cage):
(JSC::AssemblyHelpers::cageConditionally):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitDoubleLoad):
(JSC::JIT::emitContiguousLoad):
(JSC::JIT::emitArrayStorageLoad):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emitIntTypedArrayGetByVal):
(JSC::JIT::emitFloatTypedArrayGetByVal):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* jsc.cpp:
(jscmain):
(primitiveGigacageDisabled): Deleted.
2017-08-06 Filip Pizlo <fpizlo@apple.com>
Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
https://bugs.webkit.org/show_bug.cgi?id=174919
Reviewed by Keith Miller.
This adapts JSC to there being two gigacages.
To make matters simpler, this turns AlignedMemoryAllocators into per-VM instances rather than
singletons. I don't think we were gaining anything by making them be singletons.
This makes it easy to teach GigacageAlignedMemoryAllocator that there are multiple kinds of
gigacages. We'll have one of those allocators per cage.
From there, this change teaches everyone who previously knew about cages that there are two cages.
This means having to specify either Gigacage::Primitive or Gigacage::JSValue. In most places, this is
easy: typed arrays are Primitive and butterflies are JSValue. But there are a few places where it's
not so obvious, so this change introduces some helpers to make it easy to define what cage you want
to use in one place and refer to it abstractly. We do this in DirectArguments and GenericArguments.h
A lot of the magic of this change is due to CagedBarrierPtr, which combines AuxiliaryBarrier and
CagedPtr. This removes one layer of "get()" calls from a bunch of places.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileNewTypedArray):
(JSC::DFG::SpeculativeJIT::emitAllocateButterfly):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetButterfly):
(JSC::FTL::DFG::LowerDFGToB3::compileGetIndexedPropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::compileNewTypedArray):
(JSC::FTL::DFG::LowerDFGToB3::compileGetDirectPname):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorageWithSizeImpl):
(JSC::FTL::DFG::LowerDFGToB3::allocateJSArray):
(JSC::FTL::DFG::LowerDFGToB3::caged):
* heap/FastMallocAlignedMemoryAllocator.cpp:
(JSC::FastMallocAlignedMemoryAllocator::instance): Deleted.
* heap/FastMallocAlignedMemoryAllocator.h:
* heap/GigacageAlignedMemoryAllocator.cpp:
(JSC::GigacageAlignedMemoryAllocator::GigacageAlignedMemoryAllocator):
(JSC::GigacageAlignedMemoryAllocator::tryAllocateAlignedMemory):
(JSC::GigacageAlignedMemoryAllocator::freeAlignedMemory):
(JSC::GigacageAlignedMemoryAllocator::dump const):
(JSC::GigacageAlignedMemoryAllocator::instance): Deleted.
* heap/GigacageAlignedMemoryAllocator.h:
* jsc.cpp:
(primitiveGigacageDisabled):
(jscmain):
(gigacageDisabled): Deleted.
* llint/LowLevelInterpreter64.asm:
* runtime/ArrayBuffer.cpp:
(JSC::ArrayBufferContents::tryAllocate):
(JSC::ArrayBuffer::createAdopted):
(JSC::ArrayBuffer::createFromBytes):
* runtime/AuxiliaryBarrier.h:
* runtime/ButterflyInlines.h:
(JSC::Butterfly::createUninitialized):
(JSC::Butterfly::tryCreate):
(JSC::Butterfly::growArrayRight):
* runtime/CagedBarrierPtr.h: Added.
(JSC::CagedBarrierPtr::CagedBarrierPtr):
(JSC::CagedBarrierPtr::clear):
(JSC::CagedBarrierPtr::set):
(JSC::CagedBarrierPtr::get const):
(JSC::CagedBarrierPtr::getMayBeNull const):
(JSC::CagedBarrierPtr::operator== const):
(JSC::CagedBarrierPtr::operator!= const):
(JSC::CagedBarrierPtr::operator bool const):
(JSC::CagedBarrierPtr::setWithoutBarrier):
(JSC::CagedBarrierPtr::operator* const):
(JSC::CagedBarrierPtr::operator-> const):
(JSC::CagedBarrierPtr::operator[] const):
* runtime/DirectArguments.cpp:
(JSC::DirectArguments::overrideThings):
(JSC::DirectArguments::unmapArgument):
* runtime/DirectArguments.h:
(JSC::DirectArguments::isMappedArgument const):
* runtime/GenericArguments.h:
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::initModifiedArgumentsDescriptor):
(JSC::GenericArguments<Type>::setModifiedArgumentDescriptor):
(JSC::GenericArguments<Type>::isModifiedArgumentDescriptor):
* runtime/HashMapImpl.cpp:
(JSC::HashMapImpl<HashMapBucket>::visitChildren):
* runtime/HashMapImpl.h:
(JSC::HashMapBuffer::create):
(JSC::HashMapImpl::buffer const):
(JSC::HashMapImpl::rehash):
* runtime/JSArray.cpp:
(JSC::JSArray::tryCreateUninitializedRestricted):
(JSC::JSArray::unshiftCountSlowCase):
(JSC::JSArray::setLength):
(JSC::JSArray::pop):
(JSC::JSArray::push):
(JSC::JSArray::fastSlice):
(JSC::JSArray::shiftCountWithArrayStorage):
(JSC::JSArray::shiftCountWithAnyIndexingType):
(JSC::JSArray::unshiftCountWithAnyIndexingType):
(JSC::JSArray::fillArgList):
(JSC::JSArray::copyToArguments):
* runtime/JSArray.h:
(JSC::JSArray::tryCreate):
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
(JSC::JSArrayBufferView::finalize):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
* runtime/JSObject.cpp:
(JSC::JSObject::heapSnapshot):
(JSC::JSObject::getOwnPropertySlotByIndex):
(JSC::JSObject::putByIndex):
(JSC::JSObject::enterDictionaryIndexingMode):
(JSC::JSObject::createInitialIndexedStorage):
(JSC::JSObject::createArrayStorage):
(JSC::JSObject::convertUndecidedToInt32):
(JSC::JSObject::convertUndecidedToDouble):
(JSC::JSObject::convertUndecidedToContiguous):
(JSC::JSObject::constructConvertedArrayStorageWithoutCopyingElements):
(JSC::JSObject::convertUndecidedToArrayStorage):
(JSC::JSObject::convertInt32ToDouble):
(JSC::JSObject::convertInt32ToContiguous):
(JSC::JSObject::convertInt32ToArrayStorage):
(JSC::JSObject::convertDoubleToContiguous):
(JSC::JSObject::convertDoubleToArrayStorage):
(JSC::JSObject::convertContiguousToArrayStorage):
(JSC::JSObject::setIndexQuicklyToUndecided):
(JSC::JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode):
(JSC::JSObject::deletePropertyByIndex):
(JSC::JSObject::getOwnPropertyNames):
(JSC::JSObject::putIndexedDescriptor):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes):
(JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength):
(JSC::JSObject::getNewVectorLength):
(JSC::JSObject::ensureLengthSlow):
(JSC::JSObject::reallocateAndShrinkButterfly):
(JSC::JSObject::allocateMoreOutOfLineStorage):
(JSC::JSObject::getEnumerableLength):
* runtime/JSObject.h:
(JSC::JSObject::getArrayLength const):
(JSC::JSObject::getVectorLength):
(JSC::JSObject::putDirectIndex):
(JSC::JSObject::canGetIndexQuickly):
(JSC::JSObject::getIndexQuickly):
(JSC::JSObject::tryGetIndexQuickly const):
(JSC::JSObject::canSetIndexQuickly):
(JSC::JSObject::setIndexQuickly):
(JSC::JSObject::initializeIndex):
(JSC::JSObject::initializeIndexWithoutBarrier):
(JSC::JSObject::hasSparseMap):
(JSC::JSObject::inSparseIndexingMode):
(JSC::JSObject::butterfly const):
(JSC::JSObject::butterfly):
(JSC::JSObject::outOfLineStorage const):
(JSC::JSObject::outOfLineStorage):
(JSC::JSObject::ensureInt32):
(JSC::JSObject::ensureDouble):
(JSC::JSObject::ensureContiguous):
(JSC::JSObject::ensureArrayStorage):
(JSC::JSObject::arrayStorage):
(JSC::JSObject::arrayStorageOrNull):
(JSC::JSObject::ensureLength):
* runtime/RegExpMatchesArray.h:
(JSC::tryCreateUninitializedRegExpMatchesArray):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
(JSC::VM::primitiveGigacageDisabledCallback):
(JSC::VM::primitiveGigacageDisabled):
(JSC::VM::gigacageDisabledCallback): Deleted.
(JSC::VM::gigacageDisabled): Deleted.
* runtime/VM.h:
(JSC::VM::gigacageAuxiliarySpace):
(JSC::VM::firePrimitiveGigacageEnabledIfNecessary):
(JSC::VM::primitiveGigacageEnabled):
(JSC::VM::fireGigacageEnabledIfNecessary): Deleted.
(JSC::VM::gigacageEnabled): Deleted.
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::grow):
2017-08-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r220144.
https://bugs.webkit.org/show_bug.cgi?id=175276
"It did not actually speed things up in the way I expected"
(Requested by saamyjoon on #webkit).
Reverted changeset:
"On memory-constrained iOS devices, reduce the rate at which
the JS heap grows before a GC to try to keep more memory
available for the system"
https://bugs.webkit.org/show_bug.cgi?id=175041
http://trac.webkit.org/changeset/220144
2017-08-07 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r220299.
This change caused LayoutTest inspector/dom-debugger/dom-
breakpoints.html to fail.
Reverted changeset:
"Web Inspector: capture async stack trace when workers/main
context posts a message"
https://bugs.webkit.org/show_bug.cgi?id=167084
http://trac.webkit.org/changeset/220299
2017-08-07 Brian Burg <bburg@apple.com>
Remove CANVAS_PATH compilation guard
https://bugs.webkit.org/show_bug.cgi?id=175207
Reviewed by Sam Weinig.
* Configurations/FeatureDefines.xcconfig:
2017-08-07 Keith Miller <keith_miller@apple.com>
REGRESSION: wasm.yaml/wasm/js-api/dont-mmap-zero-byte-memory.js failing on JSC Debug bots
https://bugs.webkit.org/show_bug.cgi?id=175256
Reviewed by Saam Barati.
The check in createFromBytes just needed to check that the buffer was not null before
calling isCaged.
* runtime/ArrayBuffer.cpp:
(JSC::ArrayBuffer::createFromBytes):
2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add API to provide browser information required by automation
https://bugs.webkit.org/show_bug.cgi?id=175130
Reviewed by Brian Burg.
Add browserName and browserVersion to RemoteInspector::Client::Capabilities and virtual methods to the Client to
get them.
* inspector/remote/RemoteInspector.cpp:
(Inspector::RemoteInspector::updateClientCapabilities): Update also browserName and browserVersion.
* inspector/remote/RemoteInspector.h:
* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::requestAutomationSession): Call updateClientCapabilities() after the session is
requested to ensure they are updated before StartAutomationSession reply is sent.
* inspector/remote/glib/RemoteInspectorServer.cpp: Add browserName and browserVersion as return values of
StartAutomationSession mesasage.
2017-08-06 Yusuke Suzuki <utatane.tea@gmail.com>
Promise resolve and reject function should have length = 1
https://bugs.webkit.org/show_bug.cgi?id=175242
Reviewed by Saam Barati.
Previously we have separate system for "length" and "name" for builtin functions.
The builtin functions do not use lazy reifying system. Instead, they have direct
properties when instantiating it. While the function created for properties (like
Array.prototype.filter) is created by JSFunction::createBuiltin(), function inside
these builtin functions are just created by JSFunction::create(). Since it does
not set any values for "length", these functions do not have "length" property.
So, the resolve and reject functions passed to Promise's executor do not have
"length" property.
This patch make builtin functions use standard lazy reifying system for "length".
So, "length" property of the builtin function just works as if the normal functions
do.
* runtime/JSFunction.cpp:
(JSC::JSFunction::createBuiltinFunction):
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::reifyLazyPropertyForHostOrBuiltinIfNeeded):
(JSC::JSFunction::reifyLazyLengthIfNeeded):
(JSC::JSFunction::reifyLazyBoundNameIfNeeded):
(JSC::JSFunction::reifyBoundNameIfNeeded): Deleted.
* runtime/JSFunction.h:
2017-08-06 Oleksandr Skachkov <gskachkov@gmail.com>
[ESNext] Async iteration - Implement Async Generator - parser
https://bugs.webkit.org/show_bug.cgi?id=175210
Reviewed by Yusuke Suzuki.
Current implementation is draft version of Async Iteration.
Link to spec https://tc39.github.io/proposal-async-iteration/
Current patch implement only parser part of the Async generator
Runtime part will be in next ptches
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionMetadata):
* parser/Parser.cpp:
(JSC::getAsynFunctionBodyParseMode):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseAsyncFunctionSourceElements):
(JSC::Parser<LexerType>::parseAsyncGeneratorFunctionSourceElements):
(JSC::stringArticleForFunctionMode):
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseAsyncFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parseAsyncFunctionExpression):
* parser/Parser.h:
(JSC::Scope::setSourceParseMode):
* parser/ParserModes.h:
(JSC::isFunctionParseMode):
(JSC::isAsyncFunctionParseMode):
(JSC::isAsyncArrowFunctionParseMode):
(JSC::isAsyncGeneratorFunctionParseMode):
(JSC::isAsyncFunctionOrAsyncGeneratorWrapperParseMode):
(JSC::isAsyncFunctionWrapperParseMode):
(JSC::isAsyncFunctionBodyParseMode):
(JSC::isGeneratorMethodParseMode):
(JSC::isAsyncMethodParseMode):
(JSC::isAsyncGeneratorMethodParseMode):
(JSC::isMethodParseMode):
(JSC::isGeneratorOrAsyncFunctionBodyParseMode):
(JSC::isGeneratorOrAsyncFunctionWrapperParseMode):
2017-08-05 Filip Pizlo <fpizlo@apple.com>
REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
https://bugs.webkit.org/show_bug.cgi?id=175083
Reviewed by Oliver Hunt.
This fixes the leak by making MarkedBlock::specializedSweep call destructors when the block is empty,
even if we are using the pop path.
Also, this fixes HeapCellInlines.h to no longer include MarkedBlockInlines.h. That's pretty
important, since MarkedBlockInlines.h is the GC's internal guts - we don't want to have to recompile
the world just because we changed it.
Finally, this adds a new testing SPI for waiting for all VMs to finish destructing. This makes it
easier to debug leaks.
* bytecode/AccessCase.cpp:
* bytecode/PolymorphicAccess.cpp:
* heap/HeapCell.cpp:
(JSC::HeapCell::isLive):
* heap/HeapCellInlines.h:
(JSC::HeapCell::isLive): Deleted.
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::tryAllocateWithoutCollecting):
(JSC::MarkedAllocator::endMarking):
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
* jit/AssemblyHelpers.cpp:
* jit/Repatch.cpp:
* runtime/TestRunnerUtils.h:
* runtime/VM.cpp:
(JSC::waitForVMDestruction):
(JSC::VM::~VM):
2017-08-05 Mark Lam <mark.lam@apple.com>
Move DFG::OSRExitCompiler methods into DFG::OSRExit [step 3].
https://bugs.webkit.org/show_bug.cgi?id=175228
<rdar://problem/33735737>
Reviewed by Saam Barati.
Merge the 32-bit OSRExit::compileExit() method into the 64-bit version, and
delete OSRExit32_64.cpp.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGOSRExit32_64.cpp: Removed.
* jit/GPRInfo.h:
(JSC::JSValueSource::payloadGPR const):
2017-08-04 Youenn Fablet <youenn@apple.com>
[Cache API] Add Cache and CacheStorage IDL definitions
https://bugs.webkit.org/show_bug.cgi?id=175201
Reviewed by Brady Eidson.
* runtime/CommonIdentifiers.h:
2017-08-04 Mark Lam <mark.lam@apple.com>
Fix typo in testmasm.cpp: ENABLE(JSVALUE64) should be USE(JSVALUE64).
https://bugs.webkit.org/show_bug.cgi?id=175230
<rdar://problem/33735857>
Reviewed by Saam Barati.
* assembler/testmasm.cpp:
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
2017-08-04 Mark Lam <mark.lam@apple.com>
Move DFG::OSRExitCompiler methods into DFG::OSRExit [step 2].
https://bugs.webkit.org/show_bug.cgi?id=175214
<rdar://problem/33733308>
Rubber-stamped by Michael Saboff.
Copy the 64-bit and common methods into DFGOSRExit.cpp, and delete the unused
DFGOSRExitCompiler files.
Also renamed DFGOSRExitCompiler32_64.cpp to DFGOSRExit32_64.cpp.
Also move debugOperationPrintSpeculationFailure() into DFGOSRExit.cpp. It's only
used by compileOSRExit(), and will be changed to not be a DFG operation function
when we use JIT probes for DFG OSR exits later in
https://bugs.webkit.org/show_bug.cgi?id=175144.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGJITCompiler.cpp:
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::emitRestoreArguments):
(JSC::DFG::OSRExit::compileOSRExit):
(JSC::DFG::OSRExit::compileExit):
(JSC::DFG::OSRExit::debugOperationPrintSpeculationFailure):
* dfg/DFGOSRExit.h:
* dfg/DFGOSRExit32_64.cpp: Copied from Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp.
* dfg/DFGOSRExitCompiler.cpp: Removed.
* dfg/DFGOSRExitCompiler.h: Removed.
* dfg/DFGOSRExitCompiler32_64.cpp: Removed.
* dfg/DFGOSRExitCompiler64.cpp: Removed.
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGThunks.cpp:
2017-08-04 Matt Baker <mattbaker@apple.com>
Web Inspector: capture async stack trace when workers/main context posts a message
https://bugs.webkit.org/show_bug.cgi?id=167084
<rdar://problem/30033673>
Reviewed by Brian Burg.
* inspector/agents/InspectorDebuggerAgent.h:
Add `PostMessage` async call type.
2017-08-04 Mark Lam <mark.lam@apple.com>
Move DFG::OSRExitCompiler methods into DFG::OSRExit [step 1].
https://bugs.webkit.org/show_bug.cgi?id=175208
<rdar://problem/33732402>
Reviewed by Saam Barati.
This will minimize the code diff and make it easier to review the patch for
https://bugs.webkit.org/show_bug.cgi?id=175144 later. We'll do this patch in 3
steps:
1. Do the code changes to move methods into OSRExit.
2. Copy the 64-bit and common methods into DFGOSRExit.cpp, and delete the unused DFGOSRExitCompiler files.
3. Merge the 32-bit OSRExitCompiler methods into the 64-bit version, and delete DFGOSRExitCompiler32_64.cpp.
Splitting this refactoring into these 3 steps also makes it easier to review this
patch and understand what is being changed.
* dfg/DFGOSRExit.h:
* dfg/DFGOSRExitCompiler.cpp:
(JSC::DFG::OSRExit::emitRestoreArguments):
(JSC::DFG::OSRExit::compileOSRExit):
(JSC::DFG::OSRExitCompiler::emitRestoreArguments): Deleted.
(): Deleted.
* dfg/DFGOSRExitCompiler.h:
(JSC::DFG::OSRExitCompiler::OSRExitCompiler): Deleted.
(): Deleted.
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExit::compileExit):
(JSC::DFG::OSRExitCompiler::compileExit): Deleted.
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExit::compileExit):
(JSC::DFG::OSRExitCompiler::compileExit): Deleted.
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
2017-08-04 Devin Rousso <drousso@apple.com>
Web Inspector: add source view for WebGL shader programs
https://bugs.webkit.org/show_bug.cgi?id=138593
<rdar://problem/18936194>
Reviewed by Matt Baker.
* inspector/protocol/Canvas.json:
- Add `ShaderType` enum that contains "vertex" and "fragment".
- Add `requestShaderSource` command that will return the original source code for a given
shader program and shader type.
2017-08-03 Filip Pizlo <fpizlo@apple.com>
The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself
https://bugs.webkit.org/show_bug.cgi?id=175141
Reviewed by Mark Lam.
To make it easier to have multiple gigacages and maybe even fancier methods of allocating, this
decouples the allocator used to allocate memory from the GC Subspace. This means we no longer have
to create a new Subspace subclass to allocate memory a different way. Instead, the allocator is now
determined by the AlignedMemoryAllocator object.
This also simplifies trading of blocks. Before, Subspaces had to determine if other Subspaces could
trade blocks with them using canTradeBlocksWith(). This makes it difficult for two different
Subspaces that both use the same underlying allocator to realize that they can trade blocks with
each other. Now, you just need to ask the block being stolen and the subspace doing the stealing if
they use the same AlignedMemoryAllocator.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/AlignedMemoryAllocator.cpp: Added.
(JSC::AlignedMemoryAllocator::AlignedMemoryAllocator):
(JSC::AlignedMemoryAllocator::~AlignedMemoryAllocator):
* heap/AlignedMemoryAllocator.h: Added.
* heap/FastMallocAlignedMemoryAllocator.cpp: Added.
(JSC::FastMallocAlignedMemoryAllocator::singleton):
(JSC::FastMallocAlignedMemoryAllocator::FastMallocAlignedMemoryAllocator):
(JSC::FastMallocAlignedMemoryAllocator::~FastMallocAlignedMemoryAllocator):
(JSC::FastMallocAlignedMemoryAllocator::tryAllocateAlignedMemory):
(JSC::FastMallocAlignedMemoryAllocator::freeAlignedMemory):
(JSC::FastMallocAlignedMemoryAllocator::dump const):
* heap/FastMallocAlignedMemoryAllocator.h: Added.
* heap/GigacageAlignedMemoryAllocator.cpp: Added.
(JSC::GigacageAlignedMemoryAllocator::singleton):
(JSC::GigacageAlignedMemoryAllocator::GigacageAlignedMemoryAllocator):
(JSC::GigacageAlignedMemoryAllocator::~GigacageAlignedMemoryAllocator):
(JSC::GigacageAlignedMemoryAllocator::tryAllocateAlignedMemory):
(JSC::GigacageAlignedMemoryAllocator::freeAlignedMemory):
(JSC::GigacageAlignedMemoryAllocator::dump const):
* heap/GigacageAlignedMemoryAllocator.h: Added.
* heap/GigacageSubspace.cpp: Removed.
* heap/GigacageSubspace.h: Removed.
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::tryCreate):
(JSC::LargeAllocation::destroy):
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::tryAllocateWithoutCollecting):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::tryCreate):
(JSC::MarkedBlock::Handle::Handle):
(JSC::MarkedBlock::Handle::~Handle):
(JSC::MarkedBlock::Handle::didAddToAllocator):
(JSC::MarkedBlock::Handle::subspace const):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::Handle::alignedMemoryAllocator const):
(JSC::MarkedBlock::Handle::subspace const): Deleted.
* heap/Subspace.cpp:
(JSC::Subspace::Subspace):
(JSC::Subspace::findEmptyBlockToSteal):
(JSC::Subspace::canTradeBlocksWith): Deleted.
(JSC::Subspace::tryAllocateAlignedMemory): Deleted.
(JSC::Subspace::freeAlignedMemory): Deleted.
* heap/Subspace.h:
(JSC::Subspace::name const):
(JSC::Subspace::alignedMemoryAllocator const):
* runtime/JSDestructibleObjectSubspace.cpp:
(JSC::JSDestructibleObjectSubspace::JSDestructibleObjectSubspace):
* runtime/JSDestructibleObjectSubspace.h:
* runtime/JSSegmentedVariableObjectSubspace.cpp:
(JSC::JSSegmentedVariableObjectSubspace::JSSegmentedVariableObjectSubspace):
* runtime/JSSegmentedVariableObjectSubspace.h:
* runtime/JSStringSubspace.cpp:
(JSC::JSStringSubspace::JSStringSubspace):
* runtime/JSStringSubspace.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/js/JSWebAssemblyCodeBlockSubspace.cpp:
(JSC::JSWebAssemblyCodeBlockSubspace::JSWebAssemblyCodeBlockSubspace):
* wasm/js/JSWebAssemblyCodeBlockSubspace.h:
2017-08-04 Oleksandr Skachkov <gskachkov@gmail.com>
[ESNext] Async iteration - update feature.json
https://bugs.webkit.org/show_bug.cgi?id=175197
Reviewed by Yusuke Suzuki.
Update feature.json to add status of the Async Iteration
* features.json:
2017-08-04 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r220271.
Rolling out due to Layout Test failing on iOS Simulator.
Reverted changeset:
"Remove STREAMS_API compilation guard"
https://bugs.webkit.org/show_bug.cgi?id=175165
http://trac.webkit.org/changeset/220271
2017-08-04 Youenn Fablet <youenn@apple.com>
Remove STREAMS_API compilation guard
https://bugs.webkit.org/show_bug.cgi?id=175165
Reviewed by Darin Adler.
* Configurations/FeatureDefines.xcconfig:
2017-08-04 Oleksandr Skachkov <gskachkov@gmail.com>
[EsNext] Async iteration - Add feature flag
https://bugs.webkit.org/show_bug.cgi?id=166694
Reviewed by Yusuke Suzuki.
Add feature flag to JSC to switch on/off Async Iterator
* runtime/Options.h:
2017-08-03 Brian Burg <bburg@apple.com>
Remove ENABLE(WEB_SOCKET) guards
https://bugs.webkit.org/show_bug.cgi?id=167044
Reviewed by Joseph Pecoraro.
* Configurations/FeatureDefines.xcconfig:
2017-08-03 Youenn Fablet <youenn@apple.com>
Remove FETCH_API compilation guard
https://bugs.webkit.org/show_bug.cgi?id=175154
Reviewed by Chris Dumez.
* Configurations/FeatureDefines.xcconfig:
2017-08-03 Matt Baker <mattbaker@apple.com>
Web Inspector: Instrument WebGLProgram created/deleted
https://bugs.webkit.org/show_bug.cgi?id=175059
Reviewed by Devin Rousso.
Extend the Canvas protocol with types/events for tracking WebGLPrograms.
* inspector/protocol/Canvas.json:
2017-08-03 Brady Eidson <beidson@apple.com>
Add SW IDLs and stub out basic functionality.
https://bugs.webkit.org/show_bug.cgi?id=175115
Reviewed by Chris Dumez.
* Configurations/FeatureDefines.xcconfig:
* runtime/CommonIdentifiers.h:
2017-08-03 Mark Lam <mark.lam@apple.com>
Rename ScratchBuffer::activeLengthPtr to addressOfActiveLength.
https://bugs.webkit.org/show_bug.cgi?id=175142
<rdar://problem/33704528>
Reviewed by Filip Pizlo.
The convention in the rest of of JSC for such methods which return the address of
a field is to name them "addressOf<field name>". We'll rename
ScratchBuffer::activeLengthPtr to be consistent with this convention.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSpread):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewArray):
(JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSpread):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::debugCall):
* jit/ScratchRegisterAllocator.cpp:
(JSC::ScratchRegisterAllocator::preserveUsedRegistersToScratchBufferForCall):
(JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBufferForCall):
* runtime/VM.h:
(JSC::ScratchBuffer::addressOfActiveLength):
(JSC::ScratchBuffer::activeLengthPtr): Deleted.
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
2017-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: add stack trace information for each RecordingAction
https://bugs.webkit.org/show_bug.cgi?id=174663
Reviewed by Joseph Pecoraro.
* inspector/ScriptCallFrame.h:
Add `operator==` so that when a ScriptCallFrame object is held in a Vector, calling `find`
with an existing value doesn't need require a functor and can use existing code.
* interpreter/StackVisitor.h:
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::isWasmFrame const): Inlined in header.
2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
Merge WTFThreadData to Thread::current
https://bugs.webkit.org/show_bug.cgi?id=174716
Reviewed by Mark Lam.
Use Thread::current() instead.
* API/JSContext.mm:
(+[JSContext currentContext]):
(+[JSContext currentThis]):
(+[JSContext currentCallee]):
(+[JSContext currentArguments]):
(-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]):
(-[JSContext endCallbackWithData:]):
* heap/Heap.cpp:
(JSC::Heap::requestCollection):
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
(JSC::evaluate):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::importModule):
* runtime/Identifier.cpp:
(JSC::Identifier::checkCurrentAtomicStringTable):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
(JSC::JSLock::willReleaseLock):
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::grabAllLocks):
* runtime/JSLock.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::updateStackLimits):
(JSC::VM::committedStackByteCount):
* runtime/VM.h:
(JSC::VM::isSafeToRecurse const):
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const):
2017-08-02 Filip Pizlo <fpizlo@apple.com>
LLInt should do pointer caging
https://bugs.webkit.org/show_bug.cgi?id=175036
Reviewed by Keith Miller.
Implementing this in the LLInt was challenging because offlineasm did not previously know
how to load from globals. This teaches it how to do that on Darwin/x86_64, which happens
to be where the Gigacage is enabled right now.
* llint/LLIntOfflineAsmConfig.h:
* llint/LowLevelInterpreter64.asm:
* offlineasm/ast.rb:
* offlineasm/x86.rb:
2017-08-02 Filip Pizlo <fpizlo@apple.com>
Sweeping should only scribble when sweeping to free list