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

Side by Side Diff: tests/compiler/dart2js/map_tracer_test.dart

Issue 2488353004: Remove Compiler access from ResolutionEnqueuer (Closed)
Patch Set: Updated cf. comments. Created 4 years, 1 month 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 'package:compiler/src/types/types.dart' show MapTypeMask, TypeMask; 7 import 'package:compiler/src/types/types.dart' show MapTypeMask, TypeMask;
8 8
9 import 'compiler_helper.dart'; 9 import 'compiler_helper.dart';
10 import 'type_mask_test_helper.dart'; 10 import 'type_mask_test_helper.dart';
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // Test preset map of <String,uint32> 204 // Test preset map of <String,uint32>
205 doTest('{presetKey : anInt}', "presetKey", "anInt"); 205 doTest('{presetKey : anInt}', "presetKey", "anInt");
206 // Test preset map of <Double,uint32> 206 // Test preset map of <Double,uint32>
207 doTest('{aDouble : anInt}', "aDouble", "anInt"); 207 doTest('{aDouble : anInt}', "aDouble", "anInt");
208 } 208 }
209 209
210 void doTest(String allocation, [String keyElement, String valueElement]) { 210 void doTest(String allocation, [String keyElement, String valueElement]) {
211 Uri uri = new Uri(scheme: 'source'); 211 Uri uri = new Uri(scheme: 'source');
212 var compiler = compilerFor(generateTest(allocation), uri, 212 var compiler = compilerFor(generateTest(allocation), uri,
213 expectedErrors: 0, expectedWarnings: 1); 213 expectedErrors: 0, expectedWarnings: 1);
214 var closedWorld = compiler.openWorld.closeWorld(); 214 var closedWorld = compiler.openWorld.closeWorld(compiler.reporter);
215 asyncTest(() => compiler.run(uri).then((_) { 215 asyncTest(() => compiler.run(uri).then((_) {
216 var keyType, valueType; 216 var keyType, valueType;
217 var commonMasks = compiler.commonMasks; 217 var commonMasks = compiler.closedWorld.commonMasks;
218 var typesInferrer = compiler.globalInference.typesInferrer; 218 var typesInferrer = compiler.globalInference.typesInferrerInternal;
219 var emptyType = new TypeMask.nonNullEmpty(); 219 var emptyType = new TypeMask.nonNullEmpty();
220 var aKeyType = 220 var aKeyType =
221 typesInferrer.getTypeOfElement(findElement(compiler, 'aKey')); 221 typesInferrer.getTypeOfElement(findElement(compiler, 'aKey'));
222 if (keyElement != null) { 222 if (keyElement != null) {
223 keyType = 223 keyType =
224 typesInferrer.getTypeOfElement(findElement(compiler, keyElement)); 224 typesInferrer.getTypeOfElement(findElement(compiler, keyElement));
225 } 225 }
226 if (valueElement != null) { 226 if (valueElement != null) {
227 valueType = typesInferrer 227 valueType = typesInferrer
228 .getTypeOfElement(findElement(compiler, valueElement)); 228 .getTypeOfElement(findElement(compiler, valueElement));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 checkType('mapStoredInListButEscapes', K(commonMasks.dynamicType), 277 checkType('mapStoredInListButEscapes', K(commonMasks.dynamicType),
278 V(commonMasks.dynamicType)); 278 V(commonMasks.dynamicType));
279 checkType('mapStoredInMap', K(aKeyType), V(commonMasks.uint31Type)); 279 checkType('mapStoredInMap', K(aKeyType), V(commonMasks.uint31Type));
280 checkType('mapStoredInMapButEscapes', K(commonMasks.dynamicType), 280 checkType('mapStoredInMapButEscapes', K(commonMasks.dynamicType),
281 V(commonMasks.dynamicType)); 281 V(commonMasks.dynamicType));
282 282
283 checkType('mapUnset', K(emptyType), V(emptyType)); 283 checkType('mapUnset', K(emptyType), V(emptyType));
284 checkType('mapOnlySetWithConstraint', K(aKeyType), V(emptyType)); 284 checkType('mapOnlySetWithConstraint', K(aKeyType), V(emptyType));
285 })); 285 }));
286 } 286 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/map_tracer_keys_test.dart ('k') | tests/compiler/dart2js/mirror_final_field_inferrer2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698