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

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 703083002: --trust-primitives: Remove bounds checks and receiver and argument type checks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen_helpers.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 28f0632fd1ad6a96d65176f166615ed9a5305a26..3672a9b135ef0aad3e12576af994aaba3d0e16d1 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -46,9 +46,9 @@ class SsaOptimizerTask extends CompilerTask {
// After type propagation, more instructions can be
// simplified.
new SsaInstructionSimplifier(constantSystem, backend, work),
- new SsaCheckInserter(backend, work, context.boundsChecked),
+ new SsaCheckInserter(compiler, backend, work, context.boundsChecked),
new SsaInstructionSimplifier(constantSystem, backend, work),
- new SsaCheckInserter(backend, work, context.boundsChecked),
+ new SsaCheckInserter(compiler, backend, work, context.boundsChecked),
new SsaTypePropagator(compiler),
// Run a dead code eliminator before LICM because dead
// interceptors are often in the way of LICM'able instructions.
@@ -65,7 +65,7 @@ class SsaOptimizerTask extends CompilerTask {
// Previous optimizations may have generated new
// opportunities for instruction simplification.
new SsaInstructionSimplifier(constantSystem, backend, work),
- new SsaCheckInserter(backend, work, context.boundsChecked),
+ new SsaCheckInserter(compiler, backend, work, context.boundsChecked),
new SsaSimplifyInterceptors(compiler, constantSystem, work),
dce = new SsaDeadCodeEliminator(compiler),
new SsaTypePropagator(compiler)];
@@ -76,7 +76,8 @@ class SsaOptimizerTask extends CompilerTask {
new SsaCodeMotion(),
new SsaValueRangeAnalyzer(compiler, constantSystem, work),
new SsaInstructionSimplifier(constantSystem, backend, work),
- new SsaCheckInserter(backend, work, context.boundsChecked),
+ new SsaCheckInserter(
+ compiler, backend, work, context.boundsChecked),
new SsaSimplifyInterceptors(compiler, constantSystem, work),
new SsaDeadCodeEliminator(compiler)];
} else {
@@ -886,16 +887,24 @@ class SsaInstructionSimplifier extends HBaseVisitor
class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase {
final Set<HInstruction> boundsChecked;
final CodegenWorkItem work;
+ final Compiler compiler;
final JavaScriptBackend backend;
final String name = "SsaCheckInserter";
HGraph graph;
- SsaCheckInserter(this.backend,
+ SsaCheckInserter(this.compiler,
+ this.backend,
this.work,
this.boundsChecked);
void visitGraph(HGraph graph) {
this.graph = graph;
+
+ // In --trust-primitives mode we don't add bounds checks. This is better
+ // than trying to remove them later as the limit expression would become
+ // dead and require DCE.
+ if (compiler.trustPrimitives) return;
floitsch 2014/11/11 10:02:04 Ok for this CL, but in the future (i.e. the CPS IR
sra1 2014/11/12 02:27:37 I passed the bool.
+
visitDominatorTree(graph);
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen_helpers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698