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

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

Issue 10398044: Reverting 7667 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
===================================================================
--- lib/compiler/implementation/ssa/optimize.dart (revision 7672)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -8,12 +8,8 @@
}
class SsaOptimizerTask extends CompilerTask {
- final JavaScriptBackend backend;
- SsaOptimizerTask(JavaScriptBackend backend)
- : this.backend = backend,
- super(backend.compiler);
+ SsaOptimizerTask(Compiler compiler) : super(compiler);
String get name() => 'SSA optimizer';
- Compiler get compiler() => backend.compiler;
void runPhases(HGraph graph, List<OptimizationPhase> phases) {
for (OptimizationPhase phase in phases) {
@@ -27,11 +23,11 @@
List<OptimizationPhase> phases = <OptimizationPhase>[
// Run trivial constant folding first to optimize
// some patterns useful for type conversion.
- new SsaConstantFolder(backend),
+ new SsaConstantFolder(compiler),
new SsaTypeConversionInserter(compiler),
new SsaTypePropagator(compiler),
- new SsaCheckInserter(backend),
- new SsaConstantFolder(backend),
+ new SsaCheckInserter(compiler),
+ new SsaConstantFolder(compiler),
new SsaRedundantPhiEliminator(),
new SsaDeadPhiEliminator(),
new SsaGlobalValueNumberer(compiler),
@@ -58,7 +54,7 @@
// 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)];
+ new SsaCheckInserter(compiler)];
runPhases(graph, phases);
return !work.guards.isEmpty();
});
@@ -77,7 +73,7 @@
// Also run the type propagator, to please the codegen in case
// no other optimization is run.
runPhases(graph,
- <OptimizationPhase>[new SsaCheckInserter(backend),
+ <OptimizationPhase>[new SsaCheckInserter(compiler),
new SsaTypePropagator(compiler)]);
});
}
@@ -89,11 +85,10 @@
*/
class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
final String name = "SsaConstantFolder";
- final JavaScriptBackend backend;
+ final Compiler compiler;
HGraph graph;
- Compiler get compiler() => backend.compiler;
- SsaConstantFolder(this.backend);
+ SsaConstantFolder(this.compiler);
void visitGraph(HGraph visitee) {
graph = visitee;
@@ -338,7 +333,7 @@
HInstruction visitRelational(HRelational node) {
if (allUsersAreBoolifies(node)) {
- Interceptors interceptors = backend.builder.interceptors;
+ Interceptors interceptors = compiler.builder.interceptors;
HStatic oldTarget = node.target;
Element boolifiedInterceptor =
interceptors.getBoolifiedVersionOf(oldTarget.element);
@@ -408,7 +403,7 @@
HInstruction newInstruction = handleIdentityCheck(node);
if (newInstruction === null) {
HStatic target = new HStatic(
- backend.builder.interceptors.getTripleEqualsInterceptor());
+ compiler.builder.interceptors.getTripleEqualsInterceptor());
node.block.addBefore(node, target);
return new HIdentity(target, node.left, node.right);
} else {
@@ -450,7 +445,7 @@
return graph.addConstantBool(false);
} else {
// TODO(floitsch): cache interceptors.
- Interceptors interceptors = backend.builder.interceptors;
+ Interceptors interceptors = compiler.builder.interceptors;
Element equalsElement = interceptors.getEqualsInterceptor();
// If we have a different element than [equalsElement], we
// don't need to optimize this instruction to use another
@@ -589,10 +584,10 @@
final String name = "SsaCheckInserter";
Element lengthInterceptor;
- SsaCheckInserter(JavaScriptBackend backend) {
+ SsaCheckInserter(Compiler compiler) {
SourceString lengthString = const SourceString('length');
lengthInterceptor =
- backend.builder.interceptors.getStaticGetInterceptor(lengthString);
+ compiler.builder.interceptors.getStaticGetInterceptor(lengthString);
}
void visitGraph(HGraph graph) {
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698