Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(844)

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2809583002: Use off-heap data for type feedback in PolymorphicInstanceCallInstr (Closed)
Patch Set: More feedback from Slava Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index c3a2ac839c06958fb441b4b69970849de427906c..32e7faf7c8e19cad60f21ffdb2e556621770285a 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -238,26 +238,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;
}
@@ -265,24 +260,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) {
@@ -293,8 +278,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().HasSingleRecognizedTarget());
+ const Function& target = targets().FirstTarget();
__ PushConstant(target);
}
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698