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

Side by Side Diff: pkg/compiler/lib/src/constant_system_dart.dart

Issue 2620023002: Use elements/types in constants/values (Closed)
Patch Set: Created 3 years, 11 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library dart2js.constant_system.dart; 5 library dart2js.constant_system.dart;
6 6
7 import 'compiler.dart' show Compiler; 7 import 'compiler.dart' show Compiler;
8 import 'constants/constant_system.dart'; 8 import 'constants/constant_system.dart';
9 import 'constants/values.dart'; 9 import 'constants/values.dart';
10 import 'elements/resolution_types.dart'; 10 import 'elements/resolution_types.dart';
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 MapConstantValue createMap(Compiler compiler, ResolutionInterfaceType type, 451 MapConstantValue createMap(Compiler compiler, ResolutionInterfaceType type,
452 List<ConstantValue> keys, List<ConstantValue> values) { 452 List<ConstantValue> keys, List<ConstantValue> values) {
453 return new MapConstantValue(type, keys, values); 453 return new MapConstantValue(type, keys, values);
454 } 454 }
455 455
456 @override 456 @override
457 ConstantValue createType(Compiler compiler, ResolutionDartType type) { 457 ConstantValue createType(Compiler compiler, ResolutionDartType type) {
458 // TODO(johnniwinther): Change the `Type` type to 458 // TODO(johnniwinther): Change the `Type` type to
459 // `compiler.commonElements.typeType` and check the backend specific value 459 // `compiler.commonElements.typeType` and check the backend specific value
460 // in [checkConstMapKeysDontOverrideEquals] in 'members.dart'. 460 // in [checkConstMapKeysDontOverrideEquals] in 'members.dart'.
461 return new TypeConstantValue( 461 ResolutionInterfaceType implementationType = compiler
462 type, 462 .backend.backendClasses.typeImplementation
463 compiler.backend.backendClasses.typeImplementation 463 .computeType(compiler.resolution);
464 .computeType(compiler.resolution)); 464 return new TypeConstantValue(type, implementationType);
465 } 465 }
466 466
467 @override 467 @override
468 ConstantValue createSymbol(Compiler compiler, String text) { 468 ConstantValue createSymbol(Compiler compiler, String text) {
469 throw new UnsupportedError('DartConstantSystem.evaluate'); 469 throw new UnsupportedError('DartConstantSystem.evaluate');
470 } 470 }
471 471
472 bool isInt(ConstantValue constant) => constant.isInt; 472 bool isInt(ConstantValue constant) => constant.isInt;
473 bool isDouble(ConstantValue constant) => constant.isDouble; 473 bool isDouble(ConstantValue constant) => constant.isDouble;
474 bool isString(ConstantValue constant) => constant.isString; 474 bool isString(ConstantValue constant) => constant.isString;
475 bool isBool(ConstantValue constant) => constant.isBool; 475 bool isBool(ConstantValue constant) => constant.isBool;
476 bool isNull(ConstantValue constant) => constant.isNull; 476 bool isNull(ConstantValue constant) => constant.isNull;
477 477
478 bool isSubtype(DartTypes types, ResolutionDartType s, ResolutionDartType t) { 478 bool isSubtype(DartTypes types, ResolutionDartType s, ResolutionDartType t) {
479 return types.isSubtype(s, t); 479 return types.isSubtype(s, t);
480 } 480 }
481 } 481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698