| 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 | 7 import 'compiler.dart' show |
| 8 Compiler; | 8 Compiler; |
| 9 import 'constants/constant_system.dart'; | 9 import 'constants/constant_system.dart'; |
| 10 import 'constants/values.dart'; | 10 import 'constants/values.dart'; |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 List<ConstantValue> values) { | 427 List<ConstantValue> values) { |
| 428 return new MapConstantValue(type, keys, values); | 428 return new MapConstantValue(type, keys, values); |
| 429 } | 429 } |
| 430 | 430 |
| 431 @override | 431 @override |
| 432 ConstantValue createType(Compiler compiler, DartType type) { | 432 ConstantValue createType(Compiler compiler, DartType type) { |
| 433 // TODO(johnniwinther): Change the `Type` type to | 433 // TODO(johnniwinther): Change the `Type` type to |
| 434 // `compiler.coreTypes.typeType` and check the backend specific value in | 434 // `compiler.coreTypes.typeType` and check the backend specific value in |
| 435 // [checkConstMapKeysDontOverrideEquals] in 'members.dart'. | 435 // [checkConstMapKeysDontOverrideEquals] in 'members.dart'. |
| 436 return new TypeConstantValue(type, | 436 return new TypeConstantValue(type, |
| 437 compiler.backend.typeImplementation.computeType(compiler)); | 437 compiler.backend.typeImplementation.computeType(compiler.resolution)); |
| 438 } | 438 } |
| 439 | 439 |
| 440 bool isInt(ConstantValue constant) => constant.isInt; | 440 bool isInt(ConstantValue constant) => constant.isInt; |
| 441 bool isDouble(ConstantValue constant) => constant.isDouble; | 441 bool isDouble(ConstantValue constant) => constant.isDouble; |
| 442 bool isString(ConstantValue constant) => constant.isString; | 442 bool isString(ConstantValue constant) => constant.isString; |
| 443 bool isBool(ConstantValue constant) => constant.isBool; | 443 bool isBool(ConstantValue constant) => constant.isBool; |
| 444 bool isNull(ConstantValue constant) => constant.isNull; | 444 bool isNull(ConstantValue constant) => constant.isNull; |
| 445 | 445 |
| 446 bool isSubtype(DartTypes types, DartType s, DartType t) { | 446 bool isSubtype(DartTypes types, DartType s, DartType t) { |
| 447 return types.isSubtype(s, t); | 447 return types.isSubtype(s, t); |
| 448 } | 448 } |
| 449 } | 449 } |
| OLD | NEW |