| 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);
|
| }
|
|
|