| OLD | NEW |
| 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 Loading... |
| 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 ResolutionInterfaceType implementationType = compiler | 461 ResolutionInterfaceType implementationType = |
| 462 .backend.backendClasses.typeImplementation | 462 compiler.backend.backendClasses.typeType; |
| 463 .computeType(compiler.resolution); | |
| 464 return new TypeConstantValue(type, implementationType); | 463 return new TypeConstantValue(type, implementationType); |
| 465 } | 464 } |
| 466 | 465 |
| 467 @override | 466 @override |
| 468 ConstantValue createSymbol(Compiler compiler, String text) { | 467 ConstantValue createSymbol(Compiler compiler, String text) { |
| 469 throw new UnsupportedError('DartConstantSystem.evaluate'); | 468 throw new UnsupportedError('DartConstantSystem.evaluate'); |
| 470 } | 469 } |
| 471 | 470 |
| 472 bool isInt(ConstantValue constant) => constant.isInt; | 471 bool isInt(ConstantValue constant) => constant.isInt; |
| 473 bool isDouble(ConstantValue constant) => constant.isDouble; | 472 bool isDouble(ConstantValue constant) => constant.isDouble; |
| 474 bool isString(ConstantValue constant) => constant.isString; | 473 bool isString(ConstantValue constant) => constant.isString; |
| 475 bool isBool(ConstantValue constant) => constant.isBool; | 474 bool isBool(ConstantValue constant) => constant.isBool; |
| 476 bool isNull(ConstantValue constant) => constant.isNull; | 475 bool isNull(ConstantValue constant) => constant.isNull; |
| 477 | 476 |
| 478 bool isSubtype(DartTypes types, ResolutionDartType s, ResolutionDartType t) { | 477 bool isSubtype(DartTypes types, ResolutionDartType s, ResolutionDartType t) { |
| 479 return types.isSubtype(s, t); | 478 return types.isSubtype(s, t); |
| 480 } | 479 } |
| 481 } | 480 } |
| OLD | NEW |