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

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 9874014: New CL for https://chromiumcodereview.appspot.com/9784002/: Support non-speculative type propagatio… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/optimize.dart
===================================================================
--- lib/compiler/implementation/ssa/optimize.dart (revision 5967)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -21,6 +21,8 @@
void optimize(WorkItem work, HGraph graph) {
measure(() {
List<OptimizationPhase> phases = <OptimizationPhase>[
+ new SsaTypePropagator(compiler, false),
+ new SsaCheckInserter(compiler),
new SsaConstantFolder(compiler),
new SsaRedundantPhiEliminator(),
new SsaDeadPhiEliminator(),
@@ -38,7 +40,7 @@
// types non-speculatively. For example, it propagates the type
// array for a call to the List constructor.
List<OptimizationPhase> phases = <OptimizationPhase>[
- new SsaTypePropagator(compiler),
+ new SsaTypePropagator(compiler, true),
Lasse Reichstein Nielsen 2012/03/29 11:46:55 Make the boolean parameter optional so you can giv
new SsaTypeGuardBuilder(compiler, work),
new SsaCheckInserter(compiler)];
runPhases(graph, phases);
@@ -99,7 +101,7 @@
// must update the type of this instruction manually. Later
// phases can then optimize this instruction based on its
// type.
Lasse Reichstein Nielsen 2012/03/29 11:46:55 Why don't we run the constant folder before type p
ngeoffray 2012/03/29 12:51:02 No reason, I added the type propagator as the firs
floitsch 2012/03/29 22:00:38 The constant-folder needs types to fold away booli
- replacement.updateType();
+ replacement.type = instruction.type;
}
instruction = next;
}
@@ -297,6 +299,7 @@
void visitIndex(HIndex node) {
if (!node.builtin) return;
+ if (node.index is HBoundsCheck) return;
HInstruction index = insertIntegerCheck(node, node.index);
index = insertBoundsCheck(node, node.receiver, index);
HIndex newInstruction = new HIndex(node.target, node.receiver, index);
@@ -307,6 +310,7 @@
void visitIndexAssign(HIndexAssign node) {
if (!node.builtin) return;
+ if (node.index is HBoundsCheck) return;
HInstruction index = insertIntegerCheck(node, node.index);
index = insertBoundsCheck(node, node.receiver, index);
HIndexAssign newInstruction =

Powered by Google App Engine
This is Rietveld 408576698