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

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

Issue 11364176: Use the work element instead of the current element to satisfy unit tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 14732)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -39,7 +39,7 @@
new SsaConstantFolder(constantSystem, backend, work, types),
new SsaTypeConversionInserter(compiler),
new SsaTypePropagator(compiler, types),
- new SsaCheckInserter(backend, types, context.boundsChecked),
+ new SsaCheckInserter(backend, work, types, context.boundsChecked),
new SsaConstantFolder(constantSystem, backend, work, types),
new SsaRedundantPhiEliminator(),
new SsaDeadPhiEliminator(),
@@ -81,7 +81,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, types, context.boundsChecked)];
+ new SsaCheckInserter(backend, work, types, context.boundsChecked)];
runPhases(graph, phases);
return !work.guards.isEmpty;
});
@@ -102,7 +102,7 @@
// Also run the type propagator, to please the codegen in case
// no other optimization is run.
runPhases(graph, <OptimizationPhase>[
- new SsaCheckInserter(backend, types, context.boundsChecked),
+ new SsaCheckInserter(backend, work, types, context.boundsChecked),
new SsaTypePropagator(compiler, types)]);
});
}
@@ -651,17 +651,20 @@
final HTypeMap types;
final ConstantSystem constantSystem;
final Set<HInstruction> boundsChecked;
+ final WorkItem work;
final String name = "SsaCheckInserter";
HGraph graph;
Element lengthInterceptor;
Selector lengthSelector;
- SsaCheckInserter(JavaScriptBackend backend, this.types, this.boundsChecked)
+ SsaCheckInserter(JavaScriptBackend backend,
+ this.work,
+ this.types,
+ this.boundsChecked)
: constantSystem = backend.constantSystem {
SourceString lengthString = const SourceString('length');
- lengthSelector = new Selector.getter(
- lengthString,
- backend.compiler.currentElement.getLibrary());
+ lengthSelector =
+ new Selector.getter(lengthString, work.element.getLibrary());
lengthInterceptor =
backend.builder.interceptors.getStaticInterceptor(lengthSelector);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698