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

Unified Diff: frog/leg/ssa/optimize.dart

Issue 9784002: Support non-speculative type propagation. (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: frog/leg/ssa/optimize.dart
===================================================================
--- frog/leg/ssa/optimize.dart (revision 5905)
+++ frog/leg/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),
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.
- 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 =
« no previous file with comments | « frog/leg/ssa/nodes.dart ('k') | frog/leg/ssa/types.dart » ('j') | frog/leg/ssa/types.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698