Index: runtime/vm/flow_graph_compiler_mips.cc |
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc |
index ff0ec98ff619300cb72648234ff6a59fdb5a5d00..3ec27561dfec76e128bb6b7db4ae10d6db2b3c24 100644 |
--- a/runtime/vm/flow_graph_compiler_mips.cc |
+++ b/runtime/vm/flow_graph_compiler_mips.cc |
@@ -1620,7 +1620,8 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data, |
Label* match_found, |
intptr_t deopt_id, |
TokenPosition token_index, |
- LocationSummary* locs) { |
+ LocationSummary* locs, |
+ bool complete) { |
ASSERT(is_optimizing()); |
__ Comment("EmitTestAndCall"); |
const Array& arguments_descriptor = |
@@ -1637,8 +1638,8 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data, |
ASSERT(!ic_data.IsNull() && (kNumChecks > 0)); |
Label after_smi_test; |
- __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); |
if (kFirstCheckIsSmi) { |
+ __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); |
// Jump if receiver is not Smi. |
if (kNumChecks == 1) { |
__ bne(CMPRES1, ZR, failed); |
@@ -1662,7 +1663,10 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data, |
} else { |
// Receiver is Smi, but Smi is not a valid class therefore fail. |
// (Smi class must be first in the list). |
- __ beq(CMPRES1, ZR, failed); |
+ if (!complete) { |
+ __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); |
+ __ beq(CMPRES1, ZR, failed); |
+ } |
} |
__ Bind(&after_smi_test); |
@@ -1681,10 +1685,16 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data, |
const bool kIsLastCheck = (i == (kSortedLen - 1)); |
ASSERT(sorted[i].cid != kSmiCid); |
Label next_test; |
- if (kIsLastCheck) { |
- __ BranchNotEqual(T2, Immediate(sorted[i].cid), failed); |
+ if (!complete) { |
+ if (kIsLastCheck) { |
+ __ BranchNotEqual(T2, Immediate(sorted[i].cid), failed); |
+ } else { |
+ __ BranchNotEqual(T2, Immediate(sorted[i].cid), &next_test); |
+ } |
} else { |
- __ BranchNotEqual(T2, Immediate(sorted[i].cid), &next_test); |
+ if (!kIsLastCheck) { |
+ __ BranchNotEqual(T2, Immediate(sorted[i].cid), &next_test); |
+ } |
} |
// Do not use the code from the function, but let the code be patched so |
// that we can record the outgoing edges to other code. |