| 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; |
| 6 |
| 5 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); | 7 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); |
| 6 | 8 |
| 7 class BitNotOperation implements UnaryOperation { | 9 class BitNotOperation implements UnaryOperation { |
| 8 final SourceString name = const SourceString('~'); | 10 final SourceString name = const SourceString('~'); |
| 9 bool isUserDefinable() => true; | 11 bool isUserDefinable() => true; |
| 10 const BitNotOperation(); | 12 const BitNotOperation(); |
| 11 Constant fold(Constant constant) { | 13 Constant fold(Constant constant) { |
| 12 if (constant.isInt()) { | 14 if (constant.isInt()) { |
| 13 IntConstant intConstant = constant; | 15 IntConstant intConstant = constant; |
| 14 return DART_CONSTANT_SYSTEM.createInt(~intConstant.value); | 16 return DART_CONSTANT_SYSTEM.createInt(~intConstant.value); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 bool isInt(Constant constant) => constant.isInt(); | 364 bool isInt(Constant constant) => constant.isInt(); |
| 363 bool isDouble(Constant constant) => constant.isDouble(); | 365 bool isDouble(Constant constant) => constant.isDouble(); |
| 364 bool isString(Constant constant) => constant.isString(); | 366 bool isString(Constant constant) => constant.isString(); |
| 365 bool isBool(Constant constant) => constant.isBool(); | 367 bool isBool(Constant constant) => constant.isBool(); |
| 366 bool isNull(Constant constant) => constant.isNull(); | 368 bool isNull(Constant constant) => constant.isNull(); |
| 367 | 369 |
| 368 bool isSubtype(Compiler compiler, DartType s, DartType t) { | 370 bool isSubtype(Compiler compiler, DartType s, DartType t) { |
| 369 return compiler.types.isSubtype(s, t); | 371 return compiler.types.isSubtype(s, t); |
| 370 } | 372 } |
| 371 } | 373 } |
| OLD | NEW |