| Index: runtime/vm/compiler.cc
|
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
|
| index 103792a44df86dc6a3c4d750a61f933f00561e66..e11ab462349dfd64ab91b2ca1122e749f7019e6f 100644
|
| --- a/runtime/vm/compiler.cc
|
| +++ b/runtime/vm/compiler.cc
|
| @@ -753,10 +753,10 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
|
|
| // Do optimizations that depend on the propagated type information.
|
| - if (optimizer.Canonicalize()) {
|
| + if (flow_graph->Canonicalize()) {
|
| // Invoke Canonicalize twice in order to fully canonicalize patterns
|
| // like "if (a & const == 0) { }".
|
| - optimizer.Canonicalize();
|
| + flow_graph->Canonicalize();
|
| }
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
|
|
| @@ -782,7 +782,7 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
| ConstantPropagator::Optimize(flow_graph);
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| // A canonicalization pass to remove e.g. smi checks on smi constants.
|
| - optimizer.Canonicalize();
|
| + flow_graph->Canonicalize();
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| // Canonicalization introduced more opportunities for constant
|
| // propagation.
|
| @@ -812,12 +812,12 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
| #endif // !PRODUCT
|
| // Where beneficial convert Smi operations into Int32 operations.
|
| // Only meanigful for 32bit platforms right now.
|
| - optimizer.WidenSmiToInt32();
|
| + flow_graph->WidenSmiToInt32();
|
|
|
| // Unbox doubles. Performed after constant propagation to minimize
|
| // interference from phis merging double values and tagged
|
| // values coming from dead paths.
|
| - optimizer.SelectRepresentations();
|
| + flow_graph->SelectRepresentations();
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| }
|
|
|
| @@ -835,12 +835,12 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
| if (FLAG_common_subexpression_elimination) {
|
| if (DominatorBasedCSE::Optimize(flow_graph)) {
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| - optimizer.Canonicalize();
|
| + flow_graph->Canonicalize();
|
| // Do another round of CSE to take secondary effects into account:
|
| // e.g. when eliminating dependent loads (a.x[0] + a.x[0])
|
| // TODO(fschneider): Change to a one-pass optimization pass.
|
| if (DominatorBasedCSE::Optimize(flow_graph)) {
|
| - optimizer.Canonicalize();
|
| + flow_graph->Canonicalize();
|
| }
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| }
|
| @@ -922,7 +922,7 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
| // Detach environments from the instructions that can't deoptimize.
|
| // Do it before we attempt to perform allocation sinking to minimize
|
| // amount of materializations it has to perform.
|
| - optimizer.EliminateEnvironments();
|
| + flow_graph->EliminateEnvironments();
|
|
|
| {
|
| #ifndef PRODUCT
|
| @@ -934,8 +934,8 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| }
|
|
|
| - if (optimizer.Canonicalize()) {
|
| - optimizer.Canonicalize();
|
| + if (flow_graph->Canonicalize()) {
|
| + flow_graph->Canonicalize();
|
| }
|
|
|
| // Attempt to sink allocations of temporary non-escaping objects to
|
| @@ -968,16 +968,16 @@ bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
| #endif // !PRODUCT
|
| // Ensure that all phis inserted by optimization passes have
|
| // consistent representations.
|
| - optimizer.SelectRepresentations();
|
| + flow_graph->SelectRepresentations();
|
| }
|
|
|
| - if (optimizer.Canonicalize()) {
|
| + if (flow_graph->Canonicalize()) {
|
| // To fully remove redundant boxing (e.g. BoxDouble used only in
|
| // environments and UnboxDouble instructions) instruction we
|
| // first need to replace all their uses and then fold them away.
|
| // For now we just repeat Canonicalize twice to do that.
|
| // TODO(vegorov): implement a separate representation folding pass.
|
| - optimizer.Canonicalize();
|
| + flow_graph->Canonicalize();
|
| }
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
|
|
|
|