Index: runtime/vm/flow_graph_optimizer.cc |
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc |
index 888017e80581f9685a948aedb6f75092c17cfcf7..4c6b0a78d4c24ba20024a09ad6483d83a4a3662d 100644 |
--- a/runtime/vm/flow_graph_optimizer.cc |
+++ b/runtime/vm/flow_graph_optimizer.cc |
@@ -626,7 +626,7 @@ static void EnsureSSATempIndex(FlowGraph* graph, |
Definition* replacement) { |
if ((replacement->ssa_temp_index() == -1) && |
(defn->ssa_temp_index() != -1)) { |
- replacement->set_ssa_temp_index(graph->alloc_ssa_temp_index()); |
+ graph->AllocateSSAIndexes(replacement); |
} |
} |
@@ -838,7 +838,7 @@ static void UnboxPhi(PhiInstr* phi) { |
if ((kSmiBits < 32) && |
(unboxed == kTagged) && |
phi->Type()->IsInt() && |
- RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)) { |
+ RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt64)) { |
// On 32-bit platforms conservatively unbox phis that: |
// - are proven to be of type Int; |
// - fit into 32bits range; |
@@ -850,7 +850,7 @@ static void UnboxPhi(PhiInstr* phi) { |
Definition* input = phi->InputAt(i)->definition(); |
if (input->IsBox() && |
RangeUtils::Fits(input->range(), |
- RangeBoundary::kRangeBoundaryInt32)) { |
+ RangeBoundary::kRangeBoundaryInt64)) { |
should_unbox = true; |
} else if (!input->IsConstant()) { |
should_unbox = false; |
@@ -882,7 +882,9 @@ static void UnboxPhi(PhiInstr* phi) { |
} |
if (should_unbox) { |
- unboxed = kUnboxedInt32; |
+ unboxed = |
+ RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32) |
+ ? kUnboxedInt32 : kUnboxedMint; |
} |
} |
@@ -7073,7 +7075,7 @@ class LoadOptimizer : public ValueObject { |
replacement->AddInputUse(input); |
} |
- phi->set_ssa_temp_index(graph_->alloc_ssa_temp_index()); |
+ graph_->AllocateSSAIndexes(phi); |
phis_.Add(phi); // Postpone phi insertion until after load forwarding. |
if (FLAG_trace_load_optimization) { |