| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); | 7 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); |
| 8 | 8 |
| 9 class BitNotOperation implements UnaryOperation { | 9 class BitNotOperation implements UnaryOperation { |
| 10 final SourceString name = const SourceString('~'); | 10 final SourceString name = const SourceString('~'); |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 328 } |
| 329 apply(left, right) => identical(left, right); | 329 apply(left, right) => identical(left, right); |
| 330 } | 330 } |
| 331 | 331 |
| 332 /** | 332 /** |
| 333 * A constant system implementing the Dart semantics. This system relies on | 333 * A constant system implementing the Dart semantics. This system relies on |
| 334 * the underlying runtime-system. That is, if dart2js is run in an environment | 334 * the underlying runtime-system. That is, if dart2js is run in an environment |
| 335 * that doesn't correctly implement Dart's semantics this constant system will | 335 * that doesn't correctly implement Dart's semantics this constant system will |
| 336 * not return the correct values. | 336 * not return the correct values. |
| 337 */ | 337 */ |
| 338 class DartConstantSystem implements ConstantSystem { | 338 class DartConstantSystem extends ConstantSystem { |
| 339 const add = const AddOperation(); | 339 const add = const AddOperation(); |
| 340 const bitAnd = const BitAndOperation(); | 340 const bitAnd = const BitAndOperation(); |
| 341 const bitNot = const BitNotOperation(); | 341 const bitNot = const BitNotOperation(); |
| 342 const bitOr = const BitOrOperation(); | 342 const bitOr = const BitOrOperation(); |
| 343 const bitXor = const BitXorOperation(); | 343 const bitXor = const BitXorOperation(); |
| 344 const booleanAnd = const BooleanAndOperation(); | 344 const booleanAnd = const BooleanAndOperation(); |
| 345 const booleanOr = const BooleanOrOperation(); | 345 const booleanOr = const BooleanOrOperation(); |
| 346 const divide = const DivideOperation(); | 346 const divide = const DivideOperation(); |
| 347 const equal = const EqualsOperation(); | 347 const equal = const EqualsOperation(); |
| 348 const greaterEqual = const GreaterEqualOperation(); | 348 const greaterEqual = const GreaterEqualOperation(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 371 bool isInt(Constant constant) => constant.isInt(); | 371 bool isInt(Constant constant) => constant.isInt(); |
| 372 bool isDouble(Constant constant) => constant.isDouble(); | 372 bool isDouble(Constant constant) => constant.isDouble(); |
| 373 bool isString(Constant constant) => constant.isString(); | 373 bool isString(Constant constant) => constant.isString(); |
| 374 bool isBool(Constant constant) => constant.isBool(); | 374 bool isBool(Constant constant) => constant.isBool(); |
| 375 bool isNull(Constant constant) => constant.isNull(); | 375 bool isNull(Constant constant) => constant.isNull(); |
| 376 | 376 |
| 377 bool isSubtype(Compiler compiler, DartType s, DartType t) { | 377 bool isSubtype(Compiler compiler, DartType s, DartType t) { |
| 378 return compiler.types.isSubtype(s, t); | 378 return compiler.types.isSubtype(s, t); |
| 379 } | 379 } |
| 380 } | 380 } |
| OLD | NEW |