Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart

Issue 1276843008: dart2js cps: Change rewriting of equality operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update test + minor improvement in logical rewriter Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698