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

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

Issue 14404004: Throw NoSuchMethod or ArgumentError instead of generating a bailout, when we know the next instruct… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 21860)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -73,15 +73,24 @@
}
JavaScriptItemCompilationContext context = work.compilationContext;
return measure(() {
+ SsaTypeGuardInserter inserter = new SsaTypeGuardInserter(compiler, work);
+
// Run the phases that will generate type guards.
List<OptimizationPhase> phases = <OptimizationPhase>[
- new SsaTypeGuardInserter(compiler, work),
+ inserter,
new SsaEnvironmentBuilder(compiler),
// Then run the [SsaCheckInserter] because the type propagator also
// propagated types non-speculatively. For example, it might have
// propagated the type array for a call to the List constructor.
new SsaCheckInserter(backend, work, context.boundsChecked)];
runPhases(graph, phases);
+
+ if (work.guards.isEmpty && inserter.hasInsertedChecks) {
+ // If there is no guard, and we have inserted type checks
+ // instead, we can do the optimizations right away and avoid
+ // the bailout method.
+ optimize(work, graph, false);
+ }
return !work.guards.isEmpty;
});
}
@@ -950,10 +959,7 @@
HIntegerCheck insertIntegerCheck(HInstruction node, HInstruction value) {
HIntegerCheck check = new HIntegerCheck(value);
node.block.addBefore(node, check);
- Set<HInstruction> dominatedUsers = value.dominatedUsers(node);
- for (HInstruction user in dominatedUsers) {
- user.changeUse(value, check);
- }
+ value.replaceAllUsersDominatedBy(node, check);
return check;
}

Powered by Google App Engine
This is Rietveld 408576698