Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: tests/compiler/dart2js/kernel/closed_world2_test.dart

Issue 2997033002: Revert "Implement .getCallType" and "Update status" (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Partial test that the closed world computed from [WorldImpact]s derived from 5 // Partial test that the closed world computed from [WorldImpact]s derived from
6 // kernel is equivalent to the original computed from resolution. 6 // kernel is equivalent to the original computed from resolution.
7 library dart2js.kernel.closed_world2_test; 7 library dart2js.kernel.closed_world2_test;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 method2() {} 44 method2() {}
45 method3() {} 45 method3() {}
46 } 46 }
47 class Class1 = Object with Mixin; 47 class Class1 = Object with Mixin;
48 class Class2 extends Object with Mixin { 48 class Class2 extends Object with Mixin {
49 method3() {} 49 method3() {}
50 } 50 }
51 51
52 method1() {} // Deliberately the same name as the instance member in Mixin. 52 method1() {} // Deliberately the same name as the instance member in Mixin.
53 53
54 class ClassWithCallBase {
55 void call() {}
56 }
57
58 class ClassWithCallRequired {
59 void call(int i) {}
60 }
61
62 class ClassWithCallGeneric<T> {
63 void call(T t) {}
64 }
65
66 class ClassWithCallOptional<T> {
67 void call([T t]) {}
68 }
69
70 class ClassWithCallNamed<T> {
71 void call({T t}) {}
72 }
73
74 class ClassWithCallGetter {
75 int get call => 0;
76 }
77
78 class ClassWithCallSetter {
79 void set call(int i) {}
80 }
81
82 // Inherits the call type:
83 class ClassWithCall1 extends ClassWithCallBase {}
84 class ClassWithCall2 extends ClassWithCallRequired {}
85 class ClassWithCall3 extends ClassWithCallGeneric<String> {}
86 class ClassWithCall4 extends ClassWithCallOptional<String> {}
87 class ClassWithCall5 extends ClassWithCallNamed<String> {}
88
89 // Inherits the same call type twice:
90 class ClassWithCall6 extends ClassWithCallRequired
91 implements ClassWithCallGeneric<int> {}
92
93 // Inherits different but compatible call types:
94 class ClassWithCall7 extends ClassWithCallRequired
95 implements ClassWithCallGeneric<String> {}
96 class ClassWithCall8 extends ClassWithCallRequired
97 implements ClassWithCallOptional<int> {}
98 class ClassWithCall9 extends ClassWithCallRequired
99 implements ClassWithCallOptional<String> {}
100 class ClassWithCall10 extends ClassWithCallBase
101 implements ClassWithCallNamed<String> {}
102
103 // Inherits incompatible call types:
104 class ClassWithCall11 extends ClassWithCallNamed<int>
105 implements ClassWithCallOptional<int> {}
106 class ClassWithCall12 extends ClassWithCallGetter {}
107 class ClassWithCall13 extends ClassWithCallSetter {}
108 class ClassWithCall14 extends ClassWithCallBase
109 implements ClassWithCallGetter {}
110 class ClassWithCall15 extends ClassWithCallBase
111 implements ClassWithCallSetter {}
112
113 class ClassImplementsFunction implements Function {}
114
115 @NoInline() 54 @NoInline()
116 main() { 55 main() {
117 print('Hello World'); 56 print('Hello World');
118 ''.contains; // Trigger member closurization. 57 ''.contains; // Trigger member closurization.
119 new Element.div(); 58 new Element.div();
120 new ClassWithSetter().setter = null; 59 new ClassWithSetter().setter = null;
121 new Class1().method1(); 60 new Class1().method1();
122 new Class2().method2(); 61 new Class2().method2();
123 new Class2().method3(); 62 new Class2().method3();
124 null is List<int>; // Use generic test 63 null is List<int>; // Use generic test
125 method1(); // Both top level and instance method named 'method1' are live. 64 method1(); // Both top level and instance method named 'method1' are live.
126 #main; // Use a const symbol. 65 #main; // Use a const symbol.
127 const Symbol('foo'); // Use the const Symbol constructor directly 66 const Symbol('foo'); // Use the const Symbol constructor directly
128 new Int8List(0); // Use redirect factory to abstract native class 67 new Int8List(0); // Use redirect factory to abstract native class
129
130 new ClassWithCall1();
131 new ClassWithCall2();
132 new ClassWithCall3();
133 new ClassWithCall4();
134 new ClassWithCall5();
135 new ClassWithCall6();
136 new ClassWithCall7();
137 new ClassWithCall8();
138 new ClassWithCall9();
139 new ClassWithCall10();
140 new ClassWithCall11();
141 new ClassWithCall12();
142 new ClassWithCall13();
143 new ClassWithCall14();
144 new ClassWithCall15();
145 new ClassImplementsFunction();
146 } 68 }
147 ''' 69 '''
148 }; 70 };
149 71
150 main(List<String> args) { 72 main(List<String> args) {
151 asyncTest(() async { 73 asyncTest(() async {
152 await mainInternal(args); 74 await mainInternal(args);
153 }); 75 });
154 } 76 }
155 77
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 Compiler compiler2 = compilers.b; 129 Compiler compiler2 = compilers.b;
208 KernelFrontEndStrategy frontendStrategy = compiler2.frontendStrategy; 130 KernelFrontEndStrategy frontendStrategy = compiler2.frontendStrategy;
209 KernelToElementMapForImpact elementMap = frontendStrategy.elementMap; 131 KernelToElementMapForImpact elementMap = frontendStrategy.elementMap;
210 Expect.isFalse(compiler2.compilationFailed); 132 Expect.isFalse(compiler2.compilationFailed);
211 133
212 KernelEquivalence equivalence = new KernelEquivalence(elementMap); 134 KernelEquivalence equivalence = new KernelEquivalence(elementMap);
213 TestStrategy strategy = equivalence.defaultStrategy; 135 TestStrategy strategy = equivalence.defaultStrategy;
214 136
215 ElementEnvironment environment2 = 137 ElementEnvironment environment2 =
216 compiler2.frontendStrategy.elementEnvironment; 138 compiler2.frontendStrategy.elementEnvironment;
217 checkElementEnvironment( 139 checkElementEnvironment(environment1, environment2, strategy);
218 environment1,
219 environment2,
220 compiler1.frontendStrategy.dartTypes,
221 compiler2.frontendStrategy.dartTypes,
222 strategy);
223 140
224 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; 141 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution;
225 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); 142 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld();
226 BackendUsage backendUsage2 = closedWorld2.backendUsage; 143 BackendUsage backendUsage2 = closedWorld2.backendUsage;
227 144
228 checkNativeClasses(compiler1, compiler2, strategy); 145 checkNativeClasses(compiler1, compiler2, strategy);
229 146
230 checkBackendUsage(backendUsage1, backendUsage2, strategy); 147 checkBackendUsage(backendUsage1, backendUsage2, strategy);
231 148
232 checkResolutionEnqueuers(backendUsage1, backendUsage2, enqueuer1, enqueuer2, 149 checkResolutionEnqueuers(backendUsage1, backendUsage2, enqueuer1, enqueuer2,
233 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), 150 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b),
234 typeEquivalence: (DartType a, DartType b) { 151 typeEquivalence: (DartType a, DartType b) {
235 return equivalence.typeEquivalence(unalias(a), b); 152 return equivalence.typeEquivalence(unalias(a), b);
236 }, 153 },
237 elementFilter: elementFilter, 154 elementFilter: elementFilter,
238 verbose: arguments.verbose); 155 verbose: arguments.verbose);
239 156
240 checkClosedWorlds(closedWorld1, closedWorld2, 157 checkClosedWorlds(closedWorld1, closedWorld2,
241 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); 158 strategy: equivalence.defaultStrategy, verbose: arguments.verbose);
242 159
243 return ResultKind.success; 160 return ResultKind.success;
244 } 161 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/equivalence/check_functions.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698