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

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

Issue 2675103003: Refactor BackendHelpers to be reusageable with KernelWorldBuilder (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 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
« no previous file with comments | « pkg/compiler/lib/src/string_validator.dart ('k') | tests/compiler/dart2js/scanner_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 compiler.closeResolution();
215 asyncTest(() => compiler.run(uri).then((_) { 214 asyncTest(() => compiler.run(uri).then((_) {
215 compiler.closeResolution();
216 var keyType, valueType; 216 var keyType, valueType;
217 var typesInferrer = compiler.globalInference.typesInferrerInternal; 217 var typesInferrer = compiler.globalInference.typesInferrerInternal;
218 var closedWorld = typesInferrer.closedWorld; 218 var closedWorld = typesInferrer.closedWorld;
219 var commonMasks = closedWorld.commonMasks; 219 var commonMasks = closedWorld.commonMasks;
220 var emptyType = new TypeMask.nonNullEmpty(); 220 var emptyType = new TypeMask.nonNullEmpty();
221 var aKeyType = 221 var aKeyType =
222 typesInferrer.getTypeOfElement(findElement(compiler, 'aKey')); 222 typesInferrer.getTypeOfElement(findElement(compiler, 'aKey'));
223 if (keyElement != null) { 223 if (keyElement != null) {
224 keyType = 224 keyType =
225 typesInferrer.getTypeOfElement(findElement(compiler, keyElement)); 225 typesInferrer.getTypeOfElement(findElement(compiler, keyElement));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 checkType('mapStoredInListButEscapes', K(commonMasks.dynamicType), 279 checkType('mapStoredInListButEscapes', K(commonMasks.dynamicType),
280 V(commonMasks.dynamicType)); 280 V(commonMasks.dynamicType));
281 checkType('mapStoredInMap', K(aKeyType), V(commonMasks.uint31Type)); 281 checkType('mapStoredInMap', K(aKeyType), V(commonMasks.uint31Type));
282 checkType('mapStoredInMapButEscapes', K(commonMasks.dynamicType), 282 checkType('mapStoredInMapButEscapes', K(commonMasks.dynamicType),
283 V(commonMasks.dynamicType)); 283 V(commonMasks.dynamicType));
284 284
285 checkType('mapUnset', K(emptyType), V(emptyType)); 285 checkType('mapUnset', K(emptyType), V(emptyType));
286 checkType('mapOnlySetWithConstraint', K(aKeyType), V(emptyType)); 286 checkType('mapOnlySetWithConstraint', K(aKeyType), V(emptyType));
287 })); 287 }));
288 } 288 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/string_validator.dart ('k') | tests/compiler/dart2js/scanner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698