| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 tree_ir.optimization.logical_rewriter; | 5 library tree_ir.optimization.logical_rewriter; |
| 6 | 6 |
| 7 import '../tree_ir_nodes.dart'; | 7 import '../tree_ir_nodes.dart'; |
| 8 import 'optimization.dart' show Pass; | 8 import 'optimization.dart' show Pass; |
| 9 import '../../constants/values.dart' as values; | 9 import '../../constants/values.dart' as values; |
| 10 | 10 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 case BuiltinOperator.LooseEq: | 335 case BuiltinOperator.LooseEq: |
| 336 case BuiltinOperator.LooseNeq: | 336 case BuiltinOperator.LooseNeq: |
| 337 case BuiltinOperator.NumLt: | 337 case BuiltinOperator.NumLt: |
| 338 case BuiltinOperator.NumLe: | 338 case BuiltinOperator.NumLe: |
| 339 case BuiltinOperator.NumGt: | 339 case BuiltinOperator.NumGt: |
| 340 case BuiltinOperator.NumGe: | 340 case BuiltinOperator.NumGe: |
| 341 case BuiltinOperator.IsNumber: | 341 case BuiltinOperator.IsNumber: |
| 342 case BuiltinOperator.IsNotNumber: | 342 case BuiltinOperator.IsNotNumber: |
| 343 case BuiltinOperator.IsFloor: | 343 case BuiltinOperator.IsFloor: |
| 344 case BuiltinOperator.IsNumberAndFloor: | 344 case BuiltinOperator.IsNumberAndFloor: |
| 345 case BuiltinOperator.Identical: |
| 345 return true; | 346 return true; |
| 346 default: | 347 default: |
| 347 return false; | 348 return false; |
| 348 } | 349 } |
| 349 } | 350 } |
| 350 | 351 |
| 351 BuiltinOperator negateBuiltin(BuiltinOperator operator) { | 352 BuiltinOperator negateBuiltin(BuiltinOperator operator) { |
| 352 switch (operator) { | 353 switch (operator) { |
| 353 case BuiltinOperator.StrictEq: return BuiltinOperator.StrictNeq; | 354 case BuiltinOperator.StrictEq: return BuiltinOperator.StrictNeq; |
| 354 case BuiltinOperator.StrictNeq: return BuiltinOperator.StrictEq; | 355 case BuiltinOperator.StrictNeq: return BuiltinOperator.StrictEq; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 504 |
| 504 Expression makeOr(Expression e1, Expression e2, {bool liftNots: true}) { | 505 Expression makeOr(Expression e1, Expression e2, {bool liftNots: true}) { |
| 505 if (e1 is Not && e2 is Not && liftNots) { | 506 if (e1 is Not && e2 is Not && liftNots) { |
| 506 return new Not(new LogicalOperator.and(e1.operand, e2.operand)); | 507 return new Not(new LogicalOperator.and(e1.operand, e2.operand)); |
| 507 } else { | 508 } else { |
| 508 return new LogicalOperator.or(e1, e2); | 509 return new LogicalOperator.or(e1, e2); |
| 509 } | 510 } |
| 510 } | 511 } |
| 511 } | 512 } |
| 512 | 513 |
| OLD | NEW |