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; | 5 library dart2js.constant_system; |
6 | 6 |
7 import '../dart_types.dart'; | 7 import '../dart_types.dart'; |
8 import '../dart2jslib.dart' show Compiler; | 8 import '../compiler.dart' show |
| 9 Compiler; |
9 import '../resolution/operators.dart'; | 10 import '../resolution/operators.dart'; |
10 import '../tree/tree.dart' show DartString; | 11 import '../tree/tree.dart' show |
| 12 DartString; |
11 import 'values.dart'; | 13 import 'values.dart'; |
12 | 14 |
13 abstract class Operation { | 15 abstract class Operation { |
14 String get name; | 16 String get name; |
15 } | 17 } |
16 | 18 |
17 abstract class UnaryOperation extends Operation { | 19 abstract class UnaryOperation extends Operation { |
18 /** Returns [:null:] if it was unable to fold the operation. */ | 20 /** Returns [:null:] if it was unable to fold the operation. */ |
19 ConstantValue fold(ConstantValue constant); | 21 ConstantValue fold(ConstantValue constant); |
20 } | 22 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 case BinaryOperatorKind.SHR: return shiftRight; | 115 case BinaryOperatorKind.SHR: return shiftRight; |
114 case BinaryOperatorKind.LT: return less; | 116 case BinaryOperatorKind.LT: return less; |
115 case BinaryOperatorKind.LTEQ: return lessEqual; | 117 case BinaryOperatorKind.LTEQ: return lessEqual; |
116 case BinaryOperatorKind.GT: return greater; | 118 case BinaryOperatorKind.GT: return greater; |
117 case BinaryOperatorKind.GTEQ: return greaterEqual; | 119 case BinaryOperatorKind.GTEQ: return greaterEqual; |
118 case BinaryOperatorKind.EQ: return equal; | 120 case BinaryOperatorKind.EQ: return equal; |
119 default: return null; | 121 default: return null; |
120 } | 122 } |
121 } | 123 } |
122 } | 124 } |
OLD | NEW |