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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 1867913004: Specialize instance calls when the call receiver is the method receiver and the method class has a … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 260a3c79de1e19801d5059d00de349c5fb428343..cfdf133f10800f65a9b02ca5d425f155a2a0737b 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -1843,7 +1843,8 @@ void FlowGraphCompiler::EmitPolymorphicInstanceCall(
const Array& argument_names,
intptr_t deopt_id,
TokenPosition token_pos,
- LocationSummary* locs) {
+ LocationSummary* locs,
+ bool complete) {
if (FLAG_polymorphic_with_deopt) {
Label* deopt = AddDeoptStub(deopt_id,
ICData::kDeoptPolymorphicInstanceCallTestFail);
@@ -1851,23 +1852,32 @@ void FlowGraphCompiler::EmitPolymorphicInstanceCall(
EmitTestAndCall(ic_data, argument_count, argument_names,
deopt, // No cid match.
&ok, // Found cid.
- deopt_id, token_pos, locs);
+ deopt_id, token_pos, locs, complete);
assembler()->Bind(&ok);
} else {
- // Instead of deoptimizing, do a megamorphic call when no matching
- // cid found.
- Label ok;
- MegamorphicSlowPath* slow_path =
+ if (complete) {
+ Label ok;
+ EmitTestAndCall(ic_data, argument_count, argument_names,
+ NULL, // No cid match.
+ &ok, // Found cid.
+ deopt_id, token_pos, locs, true);
+ assembler()->Bind(&ok);
+ } else {
+ // Instead of deoptimizing, do a megamorphic call when no matching
+ // cid found.
+ Label ok;
+ MegamorphicSlowPath* slow_path =
new MegamorphicSlowPath(ic_data, argument_count, deopt_id,
token_pos, locs, CurrentTryIndex());
- AddSlowPathCode(slow_path);
- EmitTestAndCall(ic_data, argument_count, argument_names,
- slow_path->entry_label(), // No cid match.
- &ok, // Found cid.
- deopt_id, token_pos, locs);
-
- assembler()->Bind(slow_path->exit_label());
- assembler()->Bind(&ok);
+ AddSlowPathCode(slow_path);
+ EmitTestAndCall(ic_data, argument_count, argument_names,
+ slow_path->entry_label(), // No cid match.
+ &ok, // Found cid.
+ deopt_id, token_pos, locs, false);
+
+ assembler()->Bind(slow_path->exit_label());
+ assembler()->Bind(&ok);
+ }
}
}
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698