Index: runtime/vm/intermediate_language_dbc.cc |
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc |
index f4a252f130cc1e8770032b5081b6df4df0b66e00..3838de2cbf23169b146711bf97fbfdd8a6d999b3 100644 |
--- a/runtime/vm/intermediate_language_dbc.cc |
+++ b/runtime/vm/intermediate_language_dbc.cc |
@@ -239,26 +239,21 @@ EMIT_NATIVE_CODE(PolymorphicInstanceCall, |
0, |
Location::RegisterLocation(0), |
LocationSummary::kCall) { |
- ASSERT(ic_data().NumArgsTested() == 1); |
const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New( |
instance_call()->ArgumentCount(), instance_call()->argument_names())); |
const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
+ const CallTargets& ic_data = targets(); |
// Push the target onto the stack. |
if (with_checks()) { |
- const intptr_t may_be_smi = |
- (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? 1 : 0; |
- GrowableArray<CidRangeTarget> sorted_ic_data; |
- FlowGraphCompiler::SortICDataByCount(ic_data(), &sorted_ic_data, |
- /* drop_smi = */ true); |
- const intptr_t sorted_length = sorted_ic_data.length(); |
- if (!Utils::IsUint(8, sorted_length)) { |
+ const intptr_t length = ic_data.length(); |
+ if (!Utils::IsUint(8, length)) { |
Unsupported(compiler); |
UNREACHABLE(); |
} |
bool using_ranges = false; |
- for (intptr_t i = 0; i < sorted_length; i++) { |
- if (sorted_ic_data[i].cid_start != sorted_ic_data[i].cid_end) { |
+ for (intptr_t i = 0; i < length; i++) { |
+ if (ic_data[i].cid_start != ic_data[i].cid_end) { |
using_ranges = true; |
break; |
} |
@@ -266,24 +261,14 @@ EMIT_NATIVE_CODE(PolymorphicInstanceCall, |
if (using_ranges) { |
__ PushPolymorphicInstanceCallByRange(instance_call()->ArgumentCount(), |
- sorted_length + may_be_smi); |
+ length); |
} else { |
- __ PushPolymorphicInstanceCall(instance_call()->ArgumentCount(), |
- sorted_length + may_be_smi); |
- } |
- if (may_be_smi == 1) { |
- const Function& target = |
- Function::ZoneHandle(compiler->zone(), ic_data().GetTargetAt(0)); |
- __ Nop(compiler->ToEmbeddableCid(kSmiCid, this)); |
- if (using_ranges) { |
- __ Nop(compiler->ToEmbeddableCid(1, this)); |
- } |
- __ Nop(__ AddConstant(target)); |
+ __ PushPolymorphicInstanceCall(instance_call()->ArgumentCount(), length); |
} |
- for (intptr_t i = 0; i < sorted_length; i++) { |
- const Function& target = *sorted_ic_data[i].target; |
- intptr_t cid_start = sorted_ic_data[i].cid_start; |
- intptr_t cid_end = sorted_ic_data[i].cid_end; |
+ for (intptr_t i = 0; i < length; i++) { |
+ const Function& target = *ic_data[i].target; |
+ intptr_t cid_start = ic_data[i].cid_start; |
+ intptr_t cid_end = ic_data[i].cid_end; |
__ Nop(compiler->ToEmbeddableCid(cid_start, this)); |
if (using_ranges) { |
@@ -294,8 +279,8 @@ EMIT_NATIVE_CODE(PolymorphicInstanceCall, |
compiler->EmitDeopt(deopt_id(), |
ICData::kDeoptPolymorphicInstanceCallTestFail, 0); |
} else { |
- ASSERT(ic_data().HasOneTarget()); |
- const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
+ ASSERT(targets().HasSingleTarget()); |
+ const Function& target = targets().FirstTarget(); |
__ PushConstant(target); |
} |