| 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 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); | 5 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); |
| 6 | 6 |
| 7 class BitNotOperation implements UnaryOperation { | 7 class BitNotOperation implements UnaryOperation { |
| 8 final SourceString name = const SourceString('~'); | 8 final SourceString name = const SourceString('~'); |
| 9 bool isUserDefinable() => true; | 9 bool isUserDefinable() => true; |
| 10 const BitNotOperation(); | 10 const BitNotOperation(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 final SourceString name = const SourceString('>'); | 273 final SourceString name = const SourceString('>'); |
| 274 const GreaterOperation(); | 274 const GreaterOperation(); |
| 275 bool foldNums(num left, num right) => left > right; | 275 bool foldNums(num left, num right) => left > right; |
| 276 apply(left, right) => left > right; | 276 apply(left, right) => left > right; |
| 277 } | 277 } |
| 278 | 278 |
| 279 class GreaterEqualOperation extends RelationalNumOperation { | 279 class GreaterEqualOperation extends RelationalNumOperation { |
| 280 final SourceString name = const SourceString('>='); | 280 final SourceString name = const SourceString('>='); |
| 281 const GreaterEqualOperation(); | 281 const GreaterEqualOperation(); |
| 282 bool foldNums(num left, num right) => left >= right; | 282 bool foldNums(num left, num right) => left >= right; |
| 283 apply(left, right) => left <= right; | 283 apply(left, right) => left >= right; |
| 284 } | 284 } |
| 285 | 285 |
| 286 class EqualsOperation implements BinaryOperation { | 286 class EqualsOperation implements BinaryOperation { |
| 287 final SourceString name = const SourceString('=='); | 287 final SourceString name = const SourceString('=='); |
| 288 bool isUserDefinable() => true; | 288 bool isUserDefinable() => true; |
| 289 const EqualsOperation(); | 289 const EqualsOperation(); |
| 290 Constant fold(Constant left, Constant right) { | 290 Constant fold(Constant left, Constant right) { |
| 291 if (left.isNum() && right.isNum()) { | 291 if (left.isNum() && right.isNum()) { |
| 292 // Numbers need to be treated specially because: NaN != NaN, -0.0 == 0.0, | 292 // Numbers need to be treated specially because: NaN != NaN, -0.0 == 0.0, |
| 293 // and 1 == 1.0. | 293 // and 1 == 1.0. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 bool isInt(Constant constant) => constant.isInt(); | 362 bool isInt(Constant constant) => constant.isInt(); |
| 363 bool isDouble(Constant constant) => constant.isDouble(); | 363 bool isDouble(Constant constant) => constant.isDouble(); |
| 364 bool isString(Constant constant) => constant.isString(); | 364 bool isString(Constant constant) => constant.isString(); |
| 365 bool isBool(Constant constant) => constant.isBool(); | 365 bool isBool(Constant constant) => constant.isBool(); |
| 366 bool isNull(Constant constant) => constant.isNull(); | 366 bool isNull(Constant constant) => constant.isNull(); |
| 367 | 367 |
| 368 bool isSubtype(Compiler compiler, DartType s, DartType t) { | 368 bool isSubtype(Compiler compiler, DartType s, DartType t) { |
| 369 return compiler.types.isSubtype(s, t); | 369 return compiler.types.isSubtype(s, t); |
| 370 } | 370 } |
| 371 } | 371 } |
| OLD | NEW |