/
ChangeLog
17279 lines (12723 loc) · 731 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-09-01 Eric Carlson <eric.carlson@apple.com>
Switch HTMLMediaElement to release logging
https://bugs.webkit.org/show_bug.cgi?id=176065
Unreviewed build fix.
* TestWebKitAPI/Tests/WebCore/Logging.cpp:
2017-09-01 Filip Pizlo <fpizlo@apple.com>
WSL should have more tests of type checking failures
https://bugs.webkit.org/show_bug.cgi?id=176244
Reviewed by Myles Maxfield.
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/Test.js:
(TEST_typeMismatchReturn):
2017-09-01 Filip Pizlo <fpizlo@apple.com>
WSL should be be able to call a function declared in a protocol from a generic function
https://bugs.webkit.org/show_bug.cgi?id=176242
Reviewed by Myles Maxfield.
It turns out that we need to know when a function is resolved to a protocol signature, so we
need to have a type for this. This introduces ProtocolFuncDecl.
Also, this introduces parsing of protocol decls.
When instantiating a function, we need to rewrite its CallExpressions if they were previously
resolved to a PrtococolFuncDecl instead of a FuncDef or NativeFunc. In that case, we need to
rerun the resolution on the program. That resolution is guaranteed to succeed if the type
system works correctly.
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CallExpression.js:
(CallExpression.prototype.resolve):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype._createEPtr):
* WebGPUShadingLanguageRI/Func.js:
(Func):
(Func.prototype.get origin):
* WebGPUShadingLanguageRI/FuncDef.js:
(FuncDef):
(FuncDef.prototype.get origin): Deleted.
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator):
(FuncInstantiator.prototype.getUnique.InstantiationSubstitution.prototype.visitCallExpression):
(FuncInstantiator.prototype.getUnique.InstantiationSubstitution):
* WebGPUShadingLanguageRI/NativeFunc.js:
(NativeFunc):
(NativeFunc.prototype.get origin): Deleted.
* WebGPUShadingLanguageRI/NativeFuncInstance.js:
(NativeFuncInstance):
* WebGPUShadingLanguageRI/Node.js:
(Node.prototype.substitute):
* WebGPUShadingLanguageRI/Parse.js:
(parseProtocolFuncDecl):
(parseProtocolDecl):
(parse):
* WebGPUShadingLanguageRI/Program.js:
(Program):
(Program.prototype.get protocols):
(Program.prototype.add):
* WebGPUShadingLanguageRI/ProtocolDecl.js:
(ProtocolDecl.prototype.add):
(ProtocolDecl.prototype.hasHeir):
(ProtocolDecl.prototype.addSignature): Deleted.
* WebGPUShadingLanguageRI/ProtocolFuncDecl.js: Added.
(ProtocolFuncDecl):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitStructType):
(Rewriter.prototype.visitTypeVariable):
(Rewriter.prototype.visitProtocolFuncDecl):
(Rewriter.prototype.visitCallExpression):
* WebGPUShadingLanguageRI/StructType.js:
(StructType.prototype.instantiate):
* WebGPUShadingLanguageRI/Substitution.js:
(Substitution):
(Substitution.mapping): Deleted.
* WebGPUShadingLanguageRI/Test.js:
(TEST_simpleGeneric):
(TEST_simpleAssignment):
(TEST_simpleDefault):
(TEST_simpleDereference):
(TEST_dereferenceStore):
(TEST_simpleMakePtr):
(TEST_threadArrayLoad):
(TEST_deviceArrayLoad):
(TEST_threadArrayStore):
(TEST_deviceArrayStore):
(TEST_simpleProtocol):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolFuncDecl):
2017-09-01 Eric Carlson <eric.carlson@apple.com>
Switch HTMLMediaElement to release logging
https://bugs.webkit.org/show_bug.cgi?id=176065
Reviewed by Jer Noble.
* TestWebKitAPI/Tests/WebCore/Logging.cpp:
(TestWebKitAPI::LogObserver::level const):
2017-09-01 Ross Kirsling <ross.kirsling@sony.com>
download-latest-github-release.py should have friendlier output for non-404 errors
https://bugs.webkit.org/show_bug.cgi?id=176201
Reviewed by Brent Fulgham.
* Scripts/download-latest-github-release.py:
2017-09-01 Filip Pizlo <fpizlo@apple.com>
[WSL] Add tests for storing to arrays
https://bugs.webkit.org/show_bug.cgi?id=176237
Reviewed by Myles Maxfield.
Storing to arrays works now.
* WebGPUShadingLanguageRI/ArrayType.js:
(ArrayType):
* WebGPUShadingLanguageRI/Test.js:
(TEST_threadArrayStore):
(TEST_deviceArrayStore):
2017-09-01 Alex Christensen <achristensen@webkit.org>
Replace WKUIDelegatePrivate's isPlayingMediaDidChange with KVO _isPlayingAudio on WKWebView
https://bugs.webkit.org/show_bug.cgi?id=176212
Reviewed by Tim Horton.
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[AudioObserver observeValueForKeyPath:ofObject:change:context:]):
(TEST):
(-[MediaDelegate _webView:isPlayingMediaDidChange:]): Deleted.
2017-09-01 Filip Pizlo <fpizlo@apple.com>
WSL Rewriter should be an identity on things that aren't inside function bodies
https://bugs.webkit.org/show_bug.cgi?id=176208
Reviewed by Myles Maxfield.
Previously, if the Rewriter encountered a FunctionDef, StructType, NativeType, etc., then it
would either crash or try to rewrite them. That's unfortunate because we use the Rewriter to
rewrite struct and function bodies. If a function calls another function, then rewriting the
caller should not mean also rewriting the callee. Previously we "fixed" this by religiously
wrapping references to types with TypeDef and doing other such hacks. But that's subtly wrong.
It only worked because Rewriter wasn't rewriting TypeRef.type. I think that Rewriter has to
rewrite that in the long run because it may refer to another TypeRef, and it may be an
instantiation that is using types that themselves need to be rewritten.
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/NullType.js:
(NullType):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitFuncDef):
(Rewriter.prototype.visitNativeFunc):
(Rewriter.prototype.visitNativeFuncInstance):
(Rewriter.prototype.visitNativeType):
(Rewriter.prototype.visitTypeDef):
(Rewriter.prototype.visitStructType):
(Rewriter.prototype.visitTypeVariable):
(Rewriter.prototype.visitConstexprTypeParameter):
(Rewriter.prototype.visitNativeTypeInstance):
(Rewriter.prototype.visitTypeRef):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitNativeTypeInstance):
2017-09-01 Alex Christensen <achristensen@webkit.org>
Disable ObjC WebGL policy SPI on iOS
https://bugs.webkit.org/show_bug.cgi?id=176233
Reviewed by Tim Horton.
* TestWebKitAPI/Tests/WebKitCocoa/WebGLPolicy.mm:
2017-08-31 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Improve the way unit test are run and the results reported
https://bugs.webkit.org/show_bug.cgi?id=176104
Reviewed by Carlos Alberto Lopez Perez.
There are several issues with the way unit tests are run by run-gtk-tests and also with the way results are
reported:
- The results summary only mentions the test binaries, not the actual test cases, so you always have to scroll
up to find the actual test cases failing.
- The number of reported failures is the number of test binaries that failed, so if a new test case fails for
the same binary in a new revision, we won't notice it just looking at the number of failures.
- We show detailed information about skipped test in the results summary, which is just noise.
- In the case of glib tests, when a test case times out, we finish the test suite, instead of continuing with the
rest of the test cases like we do for normal failures or crashes. If a new test case fails after a test case that
timed out we will not notice it until we fix or skip the test cases timing out.
- In the case of glib tests, the timeout is applied to the whole suite, instead of per test case, we have a hack
to make it longer only for that. It has worked so far, but it doesn't scale, and it's an ugly hack.
- It's not currently possible to detect flaky tests, because again, we know the binaries/suites that failed but
not the actual test cases.
This patch fixes all these issues and makes it possible to add support for flaky tests in a follow up patch.
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunGtkAPITests.commandComplete): Update the RunGtkAPITests step to parse the new output.
* Scripts/run-gtk-tests:
(TestRunner._start_timeout): Helper to start the timeout if needed.
(TestRunner._start_timeout._alarm_handler): Raise timeout exception.
(TestRunner._stop_timeout): Helper to stop the timeout if needed.
(TestRunner._waitpid): Merged waitpid and return_code_from_exit_status.
(TestRunner._run_test_glib): Do not double the timeout anymore, we now start/stop the timeout for every test
case. Return a dictionary where keys are test cases and values the results only in case of failures.
(TestRunner._run_test_glib.parse_line): Update the parser to also detect test cases and the results.
(TestRunner._run_test_glib.parse_line.set_test_result): Helper to set the result of a test case.
(TestRunner._run_google_test): Return a dictionary where key is the test case and value is the result only in
case of failure.
(TestRunner._run_google_test_suite): Updated now that _run_google_test returns a dictionary.
(TestRunner.run_tests): Handle the results dictionary and show the results with information about test cases
failing and grouped by test binaries.
2017-08-31 Filip Pizlo <fpizlo@apple.com>
WSL should support loading from arrays
https://bugs.webkit.org/show_bug.cgi?id=176207
Reviewed by Saam Barati.
Getting a test that loads from arrays to work required doing a lot of things:
- a[i] now parses to ^(operator\[](a, i)).
- added operator\[] for four array reference types.
- to make thread|threadgroup|device T[] work, you need T:primitive.
- so this adds the magical primitive protocol.
This required a little bit of rejuggling in the name resolver and type checker. The main thing
is that to prevent the rewriter from copying the types referenced by some function, you need to
make sure that when you add a reference to a type, you wrap it in a TypeRef. This doesn't
completely feel right, but I'm sure we'll figure out the balance eventually. See bug 176208.
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/EArrayRef.js: Added.
(EArrayRef):
(EArrayRef.prototype.get ptr):
(EArrayRef.prototype.get length):
(EArrayRef.prototype.toString):
* WebGPUShadingLanguageRI/EPtr.js:
(EPtr.prototype.plus):
(EPtr.prototype.toString):
(EPtr):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitUintLiteral):
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitNativeFunc):
(FuncInstantiator.prototype.getUnique.Instantiate):
(FuncInstantiator.prototype.getUnique):
(FuncInstantiator):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/NameContext.js:
(NameContext.prototype.recognizeIntrinsics):
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.visitProtocolRef):
* WebGPUShadingLanguageRI/NativeFuncInstance.js:
(NativeFuncInstance.prototype.get isNative):
* WebGPUShadingLanguageRI/Parse.js:
(parseTerm):
(parseTypeDef):
(parseNative):
(parsePossibleSuffix):
(parse):
* WebGPUShadingLanguageRI/ProtocolDecl.js:
(ProtocolDecl):
* WebGPUShadingLanguageRI/ProtocolRef.js:
(ProtocolRef.prototype.get isPrimitive):
(ProtocolRef):
* WebGPUShadingLanguageRI/PtrType.js:
(PtrType.prototype.populateDefaultValue): Deleted.
* WebGPUShadingLanguageRI/ReferenceType.js:
(ReferenceType.prototype.populateDefaultValue):
(ReferenceType):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitUintLiteral):
(Rewriter.prototype.visitFunc): Deleted.
(Rewriter.prototype.visitTypeVariable): Deleted.
(Rewriter.prototype.visitConstexprTypeParameter): Deleted.
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/Test.js:
(TEST_threadArrayLoad):
(TEST_deviceArrayLoad):
* WebGPUShadingLanguageRI/TypeRef.js:
(TypeRef.prototype.get instantiatedType):
* WebGPUShadingLanguageRI/TypeVariable.js:
(TypeVariable.prototype.toString):
(TypeVariable):
* WebGPUShadingLanguageRI/UintLiteral.js: Added.
(UintLiteral):
(UintLiteral.prototype.get value):
(UintLiteral.prototype.get isConstexpr):
(UintLiteral.prototype.toString):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitNativeFuncInstance):
(Visitor.prototype.visitTypeVariable):
(Visitor.prototype.visitPtrType):
(Visitor.prototype.visitArrayRefType):
(Visitor.prototype.visitUintLiteral):
* WebGPUShadingLanguageRI/WTrapError.js: Added.
(WTrapError):
2017-08-31 Alex Christensen <achristensen@webkit.org>
Add WKUIDelegatePrivate equivalent of WKPageUIClient's isPlayingAudioDidChange
https://bugs.webkit.org/show_bug.cgi?id=176203
<rdar://problem/29270035>
Reviewed by Tim Horton.
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[MediaDelegate _webView:isPlayingMediaDidChange:]):
(-[MediaDelegate webView:didFinishNavigation:]):
(TEST):
2017-08-31 Alex Christensen <achristensen@webkit.org>
Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
https://bugs.webkit.org/show_bug.cgi?id=175779
<rdar://problem/22367975>
Reviewed by Tim Horton.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WebGLPolicy.mm: Added.
(-[WebGLTestDelegate webView:startURLSchemeTask:]):
(-[WebGLTestDelegate webView:stopURLSchemeTask:]):
(-[WebGLTestDelegate _webView:webGLLoadPolicyForURL:decisionHandler:]):
(-[WebGLTestDelegate _webView:resolveWebGLLoadPolicyForURL:decisionHandler:]):
(-[WebGLTestDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(urlsEqual):
(runTest):
(TEST):
2017-08-31 Don Olmstead <don.olmstead@sony.com>
[CMake] Make USE_CF conditional within Windows
https://bugs.webkit.org/show_bug.cgi?id=176173
Reviewed by Alex Christensen.
* DumpRenderTree/config.h:
* MiniBrowser/win/CMakeLists.txt:
* MiniBrowser/win/stdafx.h:
* TestWebKitAPI/PlatformWin.cmake:
2017-08-31 Filip Pizlo <fpizlo@apple.com>
WSL should support makeptr (\)
https://bugs.webkit.org/show_bug.cgi?id=176197
Reviewed by Saam Barati.
This required introducing some sanity about how pointers are carried around in the evaluator.
It turns out that we need to be careful about when a pointer to an rvalue is dereferenced. It
should be dereferenced basically immediately. If it cannot be, then we need to snapshot the
value. To do that, we need to know the types of things in a few more places. That's what this
change accomplishes.
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CallFunction.js:
(callFunction):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/DereferenceExpression.js:
(DereferenceExpression.prototype.get isLValue):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype._snapshot):
(Evaluator.prototype.runBody):
(Evaluator.prototype.visitFunctionLikeBlock):
(Evaluator.prototype.visitDereferenceExpression):
(Evaluator.prototype.visitMakePtrExpression):
(Evaluator.prototype.visitCommaExpression):
(Evaluator.prototype.visitCallExpression):
(Evaluator):
(Evaluator.prototype._dereference): Deleted.
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitFuncDef):
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitNativeFunc):
(FuncInstantiator.prototype.getUnique.Instantiate):
(FuncInstantiator.prototype.getUnique):
(FuncInstantiator):
* WebGPUShadingLanguageRI/FunctionLikeBlock.js:
(FunctionLikeBlock):
(FunctionLikeBlock.prototype.get returnType):
(FunctionLikeBlock.prototype.toString):
* WebGPUShadingLanguageRI/Inliner.js:
(Inliner.prototype.visitCallExpression):
(Inliner):
* WebGPUShadingLanguageRI/MakePtrExpression.js: Added.
(MakePtrExpression):
(MakePtrExpression.prototype.get lValue):
(MakePtrExpression.prototype.toString):
* WebGPUShadingLanguageRI/NativeFuncInstance.js: Added.
(NativeFuncInstance):
(NativeFuncInstance.prototype.get func):
(NativeFuncInstance.prototype.toString):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitMakePtrExpression):
(Rewriter.prototype.visitCallExpression):
* WebGPUShadingLanguageRI/Test.js:
(TEST_dereferenceStore):
(TEST_simpleMakePtr):
* WebGPUShadingLanguageRI/Value.js:
(Value.prototype.get isLValue):
(Value):
* WebGPUShadingLanguageRI/VariableRef.js:
(VariableRef.prototype.get isLValue):
(VariableRef.prototype.get addressSpace):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitMakePtrExpression):
(Visitor.prototype.visitCallExpression):
2017-08-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r221445.
This change broke Sierra Release builds.
Reverted changeset:
"Switch HTMLMediaElement to release logging"
https://bugs.webkit.org/show_bug.cgi?id=176065
http://trac.webkit.org/changeset/221445
2017-08-31 Filip Pizlo <fpizlo@apple.com>
WSL should support dereference (^)
https://bugs.webkit.org/show_bug.cgi?id=176192
Reviewed by Myles Maxfield.
This implements DereferenceExpression.
It also renames Evaluator.prototype.visitFunctionBody, because that name confusingly implies
that there is a class named FunctionBody. It's now called runBody.
I made the check to see if a type is a pointer type be the isPtr method, so that we can have
other pointer types that are implemented via something other than PtrType. We might want it if
for example we wanted a pointer type that is generic over address space.
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CallFunction.js:
(callFunction):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/DereferenceExpression.js: Added.
(DereferenceExpression):
(DereferenceExpression.prototype.get ptr):
(DereferenceExpression.prototype.toString):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitFunctionLikeBlock):
(Evaluator.prototype._dereference):
(Evaluator.prototype.visitDereferenceExpression):
(Evaluator.prototype.visitFunctionBody): Deleted.
* WebGPUShadingLanguageRI/PtrType.js:
(PtrType.prototype.get isPtr):
(PtrType.prototype.populateDefaultValue):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitAssignment):
(Rewriter.prototype.visitDereferenceExpression):
* WebGPUShadingLanguageRI/Test.js:
(TEST_simpleDereference):
* WebGPUShadingLanguageRI/Type.js:
(Type.prototype.get isPtr):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitDereferenceExpression):
2017-08-31 Filip Pizlo <fpizlo@apple.com>
There should only be one callFunction API in WSL
https://bugs.webkit.org/show_bug.cgi?id=176189
Reviewed by Saam Barati.
This removes the need for callFunctionByRef, which was weird. It's now the case the TypedValue
is always a tuple of type and ePtr, and TypedValue has a super simple API for boxing and
unboxing single-cell values like ints.
* WebGPUShadingLanguageRI/CallFunction.js:
(callFunction):
(callFunctionByRef): Deleted.
* WebGPUShadingLanguageRI/Test.js:
(makeInt):
* WebGPUShadingLanguageRI/TypedValue.js:
(TypedValue):
(TypedValue.prototype.get type):
(TypedValue.prototype.get ePtr):
(TypedValue.box):
(TypedValue.prototype.get value):
(TypedValue.prototype.toString):
2017-08-31 Filip Pizlo <fpizlo@apple.com>
WSL EPtr does not need to carry around the type
https://bugs.webkit.org/show_bug.cgi?id=176188
Reviewed by Saam Barati.
To validate that the interpreter is modeling a statically typed execution environment, it's
really best if values don't know their types at all. A pointer is just a pointer (i.e a buffer
and offset in our world), and it's the job of the AST node that uses it to figure out what its
type should be.
I think this makes the code simpler overall.
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CallFunction.js:
(callFunctionByRef):
(callFunction):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype._createEPtr):
* WebGPUShadingLanguageRI/EPtr.js:
(EPtr):
(EPtr.box):
(EPtr.prototype.copyFrom):
(EPtr.prototype.toString):
* WebGPUShadingLanguageRI/EValue.js: Removed.
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitFunctionLikeBlock):
(Evaluator.prototype.visitVariableDecl):
(Evaluator.prototype.visitAssignment):
(Evaluator.prototype.visitIntLiteral):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitAssignment):
* WebGPUShadingLanguageRI/StructType.js:
(StructType.prototype.instantiate):
* WebGPUShadingLanguageRI/Test.js:
(checkInt):
2017-08-31 Filip Pizlo <fpizlo@apple.com>
WSL doesn't need to wrap primitives like ints and floats in specialized classes like EInt and EFloat
https://bugs.webkit.org/show_bug.cgi?id=176184
Reviewed by Saam Barati.
The only use for EInt and EFloat was that users of the interpreter want to be able to reason
about values that know their type. But for the actual interpreter, it makes most sense for
EBuffer to hold values directly - for example, ints in the case of values of type int. Then,
all of the logic of doing math on those things can be implemented in Intrinsics.js.
So, this removes EInt and EFloat but introduces a new TypedValue class that is used only on the
boundary of the interpreter. You can either use the interpreter by speaking its internal
language (EPtr to an EBuffer that has the values) or by using the simple API (which uses
TypedValue as a trade-off between power and convenience).
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CallFunction.js:
(callFunction):
* WebGPUShadingLanguageRI/EFloat.js: Removed.
* WebGPUShadingLanguageRI/EInt.js: Removed.
* WebGPUShadingLanguageRI/EPtr.js:
(EPtr.box):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitIntLiteral):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/Test.js:
(makeInt):
(checkInt):
(TEST_add1):
(TEST_simpleGeneric):
(TEST_simpleAssignment):
(TEST_simpleDefault):
* WebGPUShadingLanguageRI/TypedValue.js: Added.
(TypedValue):
(TypedValue.prototype.toString):
2017-08-31 David Quesada <david_quesada@apple.com>
WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading
https://bugs.webkit.org/show_bug.cgi?id=176128
rdar://problem/34068476
Reviewed by Brady Eidson.
Removed API test for the deleted WKNavigationDelegatePrivate method,
and added two new tests for the two new methods.
* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(-[ClientRedirectNavigationDelegate _webView:willPerformClientRedirectToURL:delay:]):
(-[ClientRedirectNavigationDelegate _webViewDidCancelClientRedirect:]):
(-[ClientRedirectNavigationDelegate webView:didFinishNavigation:]):
(TEST):
2017-08-31 Filip Pizlo <fpizlo@apple.com>
WSL should handle variable assignments and variable declarations
https://bugs.webkit.org/show_bug.cgi?id=176180
Reviewed by Saam Barati.
Just fills in VariableDecl and Assignment logic so that we can test variables.
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype._createEPtrForNode):
(EBufferBuilder.prototype.visitFuncParameter):
(EBufferBuilder.prototype.visitVariableDecl):
(EBufferBuilder):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitVariableDecl):
(Evaluator.prototype.visitAssignment):
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.visitVariableDecl):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitFuncParameter):
(Rewriter.prototype.visitVariableDecl):
* WebGPUShadingLanguageRI/Test.js:
(makeInt):
(TEST_add1):
(TEST_simpleGeneric):
(TEST_simpleAssignment):
(TEST_simpleDefault):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitVariableDecl):
2017-08-31 Chris Dumez <cdumez@apple.com>
getFileMetadata() does not work as expected for symbolic links
https://bugs.webkit.org/show_bug.cgi?id=176143
Reviewed by Andreas Kling.
Add API test coverage.
* TestWebKitAPI/Tests/WebCore/FileSystem.cpp:
(TestWebKitAPI::TEST_F):
2017-08-31 Filip Pizlo <fpizlo@apple.com>
WSL parser should pass the token as the origin to the AST
https://bugs.webkit.org/show_bug.cgi?id=176177
Reviewed by Keith Miller.
Parse.js was sometimes passing token.origin as the origin, but that's just the filename
component of the origin. This fixes the problem and adds a test. The test previously failed
because instead of reporting the origin of the type error as "<test>:1", it reported undefined.
* WebGPUShadingLanguageRI/Parse.js:
(parseProtocolRef):
(consumeEndOfTypeArgs):
(parseTypeParameters):
(parseTerm):
(parseTypeArguments):
(parseType):
(parseTypeDef):
(parseNative):
(parseLeftOperatorCall):
(parsePossibleSuffix):
(parsePossiblePrefix):
(parsePossibleRelationalEquality):
(parseLeftLogicalExpression):
(parsePossibleTernaryConditional):
(parsePossibleAssignment):
(genericParseCommaExpression):
(parseReturn):
(parseVariableDecls):
(parseBlock):
* WebGPUShadingLanguageRI/Test.js:
(checkFail):
(TEST_nameResolutionFailure):
2017-08-31 Keith Miller <keith_miller@apple.com>
Add a filter argument to WSL test suite.
https://bugs.webkit.org/show_bug.cgi?id=176176
Reviewed by Filip Pizlo.
* WebGPUShadingLanguageRI/Test.js:
(this.string_appeared_here.i.switch):
(let.s.in.this.s.startsWith.string_appeared_here.s.match):
(let.s.in.this.s.startsWith): Deleted.
2017-08-30 Filip Pizlo <fpizlo@apple.com>
WSL should be able to run a program that uses generics
https://bugs.webkit.org/show_bug.cgi?id=176152
Reviewed by Keith Miller.
This fixes the WSL parser and type checker to the point that we can:
- Parse a function call!
- Type check a generic function call with an inferred type parameter.
- Instantiate a generic function.
- Inline a function call.
- Evaluate an inlined function call.
This also changes the test suite so that it's a little nicer to add new tests. Functions whose
names start with "TEST_" are tests.
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitFuncParameter):
(EBufferBuilder):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitFunctionLikeBlock):
* WebGPUShadingLanguageRI/FuncDef.js:
(FuncDef.prototype.toString):
(FuncDef):
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.getUnique):
(FuncInstantiator):
* WebGPUShadingLanguageRI/Inliner.js:
(Inliner.prototype.visitCallExpression):
(Inliner):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer):
* WebGPUShadingLanguageRI/NameContext.js:
(NameContext):
(NameContext.prototype.add):
(NameContext.prototype.get let):
(NameContext.prototype.defineAll):
(NameContext.get intrinsics): Deleted.
(NameContext.set program): Deleted.
(NameContext.get program): Deleted.
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.visitProgram):
* WebGPUShadingLanguageRI/Parse.js:
(parseTerm):
(parsePossibleSuffix):
(genericParseCommaExpression):
(parseReturn):
* WebGPUShadingLanguageRI/Program.js:
(Program.prototype.resolveFuncOverload):
* WebGPUShadingLanguageRI/ProtocolDecl.js:
(ProtocolDecl.prototype.inherits):
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js:
(resolveOverloadImpl):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitFuncParameter):
(Rewriter.prototype.visitCallExpression):
(Rewriter.prototype._map): Deleted.
* WebGPUShadingLanguageRI/Test.js:
(checkInt):
(TEST_add1):
(TEST_simpleGeneric):
(let.s.in.this.s.startsWith):
(load): Deleted.
* WebGPUShadingLanguageRI/TypeVariable.js:
(TypeVariable.prototype.typeVariableUnify):
* WebGPUShadingLanguageRI/UnificationContext.js:
(UnificationContext.prototype.union):
2017-08-30 Alex Christensen <achristensen@webkit.org>
Add WKUIDelegatePrivate equivalent of WKPageUIClient's didClickAutoFillButton
https://bugs.webkit.org/show_bug.cgi?id=176139
<rdar://problem/29270035>
Reviewed by Tim Horton.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/ClickAutoFillButton.mm: Added.
(didClickAutoFillButton):
(-[ClickAutoFillButton webProcessPlugIn:didCreateBrowserContextController:]):
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[AutoFillDelegate _webView:didClickAutoFillButtonWithUserInfo:]):
(-[AutoFillDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST):
2017-08-31 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Several InputMethodFilter tests are failing and crashing
https://bugs.webkit.org/show_bug.cgi?id=176158
Reviewed by Carlos Alberto Lopez Perez.
This started to happen after the GTK+ upgrade from 3.16 to 3.22 in the internal jhbuild. Now, GtkIMContext
doesn't emit the preedit signals when using the compose key (GDK_KEY_Multi_key). The composition results are
committed directly when they are ready. The test InputMethodFilterComposeKey was failing because it expected
preedit events that no longer happen. Tests InputMethodFilterContextFocusOutDuringOngoingComposition and
InputMethodFilterContextMouseClickDuringOngoingComposition were crashing because InputMethodFilter::confirmCurrentComposition()
accessed the WebPageProxy unconditionally, that is not available in testing mode. I wonder how this ever
worked. Other tests results have also been updated because logHandleKeyboardEventWithCompositionResultsForTesting()
now uses hexadecimal numbers for the key codes, for consistency with all other event logs.
* TestWebKitAPI/Tests/WebKit/gtk/InputMethodFilter.cpp:
(TestWebKitAPI::TestInputMethodFilter::TestInputMethodFilter):
(TestWebKitAPI::TEST):
(TestWebKitAPI::verifyCanceledComposition): Deleted.
2017-08-31 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][Wayland] Crash when gdk_keymap_get_entries_for_keyval returns TRUE but n_keys=0
https://bugs.webkit.org/show_bug.cgi?id=176154
Reviewed by Carlos Alberto Lopez Perez.
Also check the n_keys > 0 when using gdk_keymap_get_entries_for_keyval().
* TestWebKitAPI/Tests/WebKit/gtk/InputMethodFilter.cpp:
(TestWebKitAPI::TestInputMethodFilter::sendKeyEventToFilter):
* TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp: Remove duplicated code and use WebViewTest::keyStroke instead.
* TestWebKitAPI/glib/WebKitGLib/gtk/WebViewTestGtk.cpp:
(WebViewTest::keyStroke):
* TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
(TestWebKitAPI::doKeyStroke):
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::keyDown):
2017-08-31 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ test /webkit2/WebKitAutomationSession/request-session.
It fails when comparing the browser version if micro version is 0 (or if both micro and minor are 0 too).
* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: Use a helper method to convert major, minor, micro
numbers into a version string, using the same approach as WebKitAutomationSession.
2017-08-30 Dan Bernstein <mitz@apple.com>
[iOS] REGRESSION (r218144) -[WKContentView targetForAction:withSender:] returns the content view for actions implemented only by the WKWebView, causing a crash
https://bugs.webkit.org/show_bug.cgi?id=176077
<rdar://problem/34145200>
Reviewed by Sam Weinig.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKContentViewTargetForAction.mm: Added.
(-[TestWKContentViewTargetForActionView testAction:]):
(TEST):
* TestWebKitAPI/ios/UIKitSPI.h:
2017-08-30 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] install-dependencies script should install CUPS headers
https://bugs.webkit.org/show_bug.cgi?id=176129
Reviewed by Michael Catanzaro.
When building GTK+ on the JHBuild, it will enable the CUPS print
backend if the CUPS headers are installed. Having a print backend
on GTK+ is needed for the print-related API tests.
* gtk/install-dependencies:
2017-08-30 Filip Pizlo <fpizlo@apple.com>
Rename ArrayLang to WebGPU Shading Language, or WSL for short, pronounced "whistle"
https://bugs.webkit.org/show_bug.cgi?id=176117
Reviewed by Myles Maxfield.
Renamed ArrayLangRI to WebGPUShadingLanguageRI.
Renamed ALSyntaxError/ALTypeError to WSyntaxError/WTypeError.
Renamed all references to "ArrayLang" in the code to "WSL".
* ArrayLangRI: Removed.
* ArrayLangRI/ALSyntaxError.js: Removed.
* ArrayLangRI/ALTypeError.js: Removed.
* ArrayLangRI/AddressSpace.js: Removed.
* ArrayLangRI/All.js: Removed.
* ArrayLangRI/ArrayRefType.js: Removed.
* ArrayLangRI/ArrayType.js: Removed.
* ArrayLangRI/Assignment.js: Removed.
* ArrayLangRI/Block.js: Removed.
* ArrayLangRI/CallAssignment.js: Removed.
* ArrayLangRI/CallExpression.js: Removed.
* ArrayLangRI/CallFunction.js: Removed.
* ArrayLangRI/Check.js: Removed.
* ArrayLangRI/Checker.js: Removed.
* ArrayLangRI/CommaExpression.js: Removed.
* ArrayLangRI/ConstexprTypeParameter.js: Removed.
* ArrayLangRI/EBuffer.js: Removed.
* ArrayLangRI/EBufferBuilder.js: Removed.
* ArrayLangRI/EFloat.js: Removed.
* ArrayLangRI/EInt.js: Removed.
* ArrayLangRI/EPtr.js: Removed.
* ArrayLangRI/EValue.js: Removed.
* ArrayLangRI/EvaluationCommon.js: Removed.
* ArrayLangRI/Evaluator.js: Removed.
* ArrayLangRI/Expression.js: Removed.
* ArrayLangRI/Field.js: Removed.
* ArrayLangRI/Func.js: Removed.
* ArrayLangRI/FuncDef.js: Removed.
* ArrayLangRI/FuncInstantiator.js: Removed.
* ArrayLangRI/FuncParameter.js: Removed.
* ArrayLangRI/FunctionLikeBlock.js: Removed.
* ArrayLangRI/Inline.js: Removed.
* ArrayLangRI/Inliner.js: Removed.
* ArrayLangRI/InstantiateImmediates.js: Removed.
* ArrayLangRI/IntLiteral.js: Removed.
* ArrayLangRI/Intrinsics.js: Removed.
* ArrayLangRI/Lexer.js: Removed.
* ArrayLangRI/LexerToken.js: Removed.
* ArrayLangRI/NameContext.js: Removed.
* ArrayLangRI/NameResolver.js: Removed.
* ArrayLangRI/NativeFunc.js: Removed.
* ArrayLangRI/NativeType.js: Removed.
* ArrayLangRI/NativeTypeInstance.js: Removed.
* ArrayLangRI/Node.js: Removed.
* ArrayLangRI/NullType.js: Removed.
* ArrayLangRI/Parse.js: Removed.
* ArrayLangRI/Prepare.js: Removed.
* ArrayLangRI/Program.js: Removed.
* ArrayLangRI/Protocol.js: Removed.
* ArrayLangRI/ProtocolDecl.js: Removed.
* ArrayLangRI/ProtocolRef.js: Removed.
* ArrayLangRI/PtrType.js: Removed.
* ArrayLangRI/ReferenceType.js: Removed.
* ArrayLangRI/ResolveNames.js: Removed.
* ArrayLangRI/ResolveOverloadImpl.js: Removed.
* ArrayLangRI/ResolveTypeDefs.js: Removed.
* ArrayLangRI/Return.js: Removed.
* ArrayLangRI/ReturnException.js: Removed.
* ArrayLangRI/Rewriter.js: Removed.
* ArrayLangRI/StandardLibrary.js: Removed.
* ArrayLangRI/StructType.js: Removed.
* ArrayLangRI/Substitution.js: Removed.
* ArrayLangRI/SuffixCallAssignment.js: Removed.
* ArrayLangRI/Test.js: Removed.
* ArrayLangRI/Type.js: Removed.
* ArrayLangRI/TypeDef.js: Removed.
* ArrayLangRI/TypeDefResolver.js: Removed.
* ArrayLangRI/TypeOrVariableRef.js: Removed.
* ArrayLangRI/TypeRef.js: Removed.
* ArrayLangRI/TypeVariable.js: Removed.
* ArrayLangRI/UnificationContext.js: Removed.
* ArrayLangRI/Value.js: Removed.
* ArrayLangRI/VariableDecl.js: Removed.
* ArrayLangRI/VariableRef.js: Removed.
* ArrayLangRI/VisitingSet.js: Removed.
* ArrayLangRI/Visitor.js: Removed.
* WebGPUShadingLanguageRI: Copied from Tools/ArrayLangRI.
* WebGPUShadingLanguageRI/ALSyntaxError.js: Removed.
* WebGPUShadingLanguageRI/ALTypeError.js: Removed.
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CallFunction.js:
(callFunctionByRef):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProtocolDecl.set throw):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics.prototype.add):
(Intrinsics):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer):
* WebGPUShadingLanguageRI/NameContext.js:
(NameContext.prototype.add):
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype._resolveTypeArguments):
(NameResolver.prototype.visitTypeRef):
(NameResolver.prototype.visitVariableRef):
* WebGPUShadingLanguageRI/Parse.js:
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/StructType.js:
(StructType.prototype.add):
(StructType.prototype.instantiate):
* WebGPUShadingLanguageRI/TypeDefResolver.js:
(TypeDefResolver.prototype.visitTypeRef):
(TypeDefResolver):
* WebGPUShadingLanguageRI/VisitingSet.js:
(VisitingSet.prototype.doVisit):
(VisitingSet):
* WebGPUShadingLanguageRI/WSyntaxError.js: Copied from Tools/ArrayLangRI/ALSyntaxError.js.
(ALSyntaxError): Deleted.
* WebGPUShadingLanguageRI/WTypeError.js: Copied from Tools/ArrayLangRI/ALTypeError.js.
(ALTypeError): Deleted.
2017-08-30 Eric Carlson <eric.carlson@apple.com>
Add Logger observer and helper class
https://bugs.webkit.org/show_bug.cgi?id=176106
Reviewed by Andy Estes.