| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 return new StringConstantValue(string); | 426 return new StringConstantValue(string); |
| 427 } | 427 } |
| 428 | 428 |
| 429 @override | 429 @override |
| 430 BoolConstantValue createBool(bool value) => new BoolConstantValue(value); | 430 BoolConstantValue createBool(bool value) => new BoolConstantValue(value); |
| 431 | 431 |
| 432 @override | 432 @override |
| 433 NullConstantValue createNull() => new NullConstantValue(); | 433 NullConstantValue createNull() => new NullConstantValue(); |
| 434 | 434 |
| 435 @override | 435 @override |
| 436 ListConstantValue createList(InterfaceType type, List<ConstantValue> values) { | 436 ListConstantValue createList( |
| 437 ResolutionInterfaceType type, List<ConstantValue> values) { |
| 437 return new ListConstantValue(type, values); | 438 return new ListConstantValue(type, values); |
| 438 } | 439 } |
| 439 | 440 |
| 440 @override | 441 @override |
| 441 MapConstantValue createMap(Compiler compiler, InterfaceType type, | 442 MapConstantValue createMap(Compiler compiler, ResolutionInterfaceType type, |
| 442 List<ConstantValue> keys, List<ConstantValue> values) { | 443 List<ConstantValue> keys, List<ConstantValue> values) { |
| 443 return new MapConstantValue(type, keys, values); | 444 return new MapConstantValue(type, keys, values); |
| 444 } | 445 } |
| 445 | 446 |
| 446 @override | 447 @override |
| 447 ConstantValue createType(Compiler compiler, DartType type) { | 448 ConstantValue createType(Compiler compiler, ResolutionDartType type) { |
| 448 // TODO(johnniwinther): Change the `Type` type to | 449 // TODO(johnniwinther): Change the `Type` type to |
| 449 // `compiler.commonElements.typeType` and check the backend specific value | 450 // `compiler.commonElements.typeType` and check the backend specific value |
| 450 // in [checkConstMapKeysDontOverrideEquals] in 'members.dart'. | 451 // in [checkConstMapKeysDontOverrideEquals] in 'members.dart'. |
| 451 return new TypeConstantValue( | 452 return new TypeConstantValue( |
| 452 type, | 453 type, |
| 453 compiler.backend.backendClasses.typeImplementation | 454 compiler.backend.backendClasses.typeImplementation |
| 454 .computeType(compiler.resolution)); | 455 .computeType(compiler.resolution)); |
| 455 } | 456 } |
| 456 | 457 |
| 457 @override | 458 @override |
| 458 ConstantValue createSymbol(Compiler compiler, String text) { | 459 ConstantValue createSymbol(Compiler compiler, String text) { |
| 459 throw new UnsupportedError('DartConstantSystem.evaluate'); | 460 throw new UnsupportedError('DartConstantSystem.evaluate'); |
| 460 } | 461 } |
| 461 | 462 |
| 462 bool isInt(ConstantValue constant) => constant.isInt; | 463 bool isInt(ConstantValue constant) => constant.isInt; |
| 463 bool isDouble(ConstantValue constant) => constant.isDouble; | 464 bool isDouble(ConstantValue constant) => constant.isDouble; |
| 464 bool isString(ConstantValue constant) => constant.isString; | 465 bool isString(ConstantValue constant) => constant.isString; |
| 465 bool isBool(ConstantValue constant) => constant.isBool; | 466 bool isBool(ConstantValue constant) => constant.isBool; |
| 466 bool isNull(ConstantValue constant) => constant.isNull; | 467 bool isNull(ConstantValue constant) => constant.isNull; |
| 467 | 468 |
| 468 bool isSubtype(DartTypes types, DartType s, DartType t) { | 469 bool isSubtype(DartTypes types, ResolutionDartType s, ResolutionDartType t) { |
| 469 return types.isSubtype(s, t); | 470 return types.isSubtype(s, t); |
| 470 } | 471 } |
| 471 } | 472 } |
| OLD | NEW |