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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 108363003: We run phases in-between GVN and code motion, so we have to handle cases in the SsaCodeMotion phase… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
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 ssa; 5 part of ssa;
6 6
7 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 1441
1442 bool canBeMoved = true; 1442 bool canBeMoved = true;
1443 for (final HInstruction input in current.inputs) { 1443 for (final HInstruction input in current.inputs) {
1444 if (input.block == block) { 1444 if (input.block == block) {
1445 canBeMoved = false; 1445 canBeMoved = false;
1446 break; 1446 break;
1447 } 1447 }
1448 } 1448 }
1449 if (!canBeMoved) continue; 1449 if (!canBeMoved) continue;
1450 1450
1451 // This is safe because we are running after GVN. 1451 HInstruction existing = set_.lookup(current);
1452 // TODO(ngeoffray): ensure GVN has been run. 1452 if (existing == null) {
1453 set_.add(current); 1453 set_.add(current);
1454 } else {
1455 block.rewriteWithBetterUser(current, existing);
1456 block.remove(current);
1457 }
1454 } 1458 }
1455 } 1459 }
1456 } 1460 }
1457 1461
1458 class SsaTypeConversionInserter extends HBaseVisitor 1462 class SsaTypeConversionInserter extends HBaseVisitor
1459 implements OptimizationPhase { 1463 implements OptimizationPhase {
1460 final String name = "SsaTypeconversionInserter"; 1464 final String name = "SsaTypeconversionInserter";
1461 final Compiler compiler; 1465 final Compiler compiler;
1462 1466
1463 SsaTypeConversionInserter(this.compiler); 1467 SsaTypeConversionInserter(this.compiler);
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 1941
1938 keyedValues.forEach((receiver, values) { 1942 keyedValues.forEach((receiver, values) {
1939 result.keyedValues[receiver] = 1943 result.keyedValues[receiver] =
1940 new Map<HInstruction, HInstruction>.from(values); 1944 new Map<HInstruction, HInstruction>.from(values);
1941 }); 1945 });
1942 1946
1943 result.nonEscapingReceivers.addAll(nonEscapingReceivers); 1947 result.nonEscapingReceivers.addAll(nonEscapingReceivers);
1944 return result; 1948 return result;
1945 } 1949 }
1946 } 1950 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart ('k') | tests/language/code_motion_crash_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698