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

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

Issue 22871009: Address long-standing review comments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 26191)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -34,21 +34,18 @@
JavaScriptItemCompilationContext context = work.compilationContext;
measure(() {
List<OptimizationPhase> phases = <OptimizationPhase>[
- // Run trivial constant folding first to optimize
+ // Run trivial instruction simplification first to optimize
// some patterns useful for type conversion.
- new SsaConstantFolder(constantSystem, backend, work),
+ new SsaInstructionSimplifier(constantSystem, backend, work),
new SsaTypeConversionInserter(compiler),
new SsaNonSpeculativeTypePropagator(compiler),
- new SsaConstantFolder(constantSystem, backend, work),
- // The constant folder affects the types of instructions, so
- // we run the type propagator again. Note that this would
- // not be necessary if types were directly stored on
- // instructions.
- new SsaNonSpeculativeTypePropagator(compiler),
+ // After type propagation, more instructions can be
+ // simplified.
+ new SsaInstructionSimplifier(constantSystem, backend, work),
new SsaCheckInserter(backend, work, context.boundsChecked),
new SsaRedundantPhiEliminator(),
new SsaDeadPhiEliminator(),
- new SsaConstantFolder(constantSystem, backend, work),
+ new SsaInstructionSimplifier(constantSystem, backend, work),
new SsaNonSpeculativeTypePropagator(compiler),
// Run a dead code eliminator before LICM because dead
// interceptors are often in the way of LICM'able instructions.
@@ -57,8 +54,8 @@
new SsaCodeMotion(),
new SsaValueRangeAnalyzer(compiler, constantSystem, work),
// Previous optimizations may have generated new
- // opportunities for constant folding.
- new SsaConstantFolder(constantSystem, backend, work),
+ // opportunities for instruction simplification.
+ new SsaInstructionSimplifier(constantSystem, backend, work),
new SsaSimplifyInterceptors(compiler, constantSystem, work),
new SsaDeadCodeEliminator()];
runPhases(graph, phases);
@@ -122,15 +119,16 @@
* If both inputs to known operations are available execute the operation at
* compile-time.
*/
-class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
- final String name = "SsaConstantFolder";
+class SsaInstructionSimplifier extends HBaseVisitor
+ implements OptimizationPhase {
+ final String name = "SsaInstructionSimplifier";
final JavaScriptBackend backend;
final CodegenWorkItem work;
final ConstantSystem constantSystem;
HGraph graph;
Compiler get compiler => backend.compiler;
- SsaConstantFolder(this.constantSystem, this.backend, this.work);
+ SsaInstructionSimplifier(this.constantSystem, this.backend, this.work);
void visitGraph(HGraph visitee) {
graph = visitee;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698