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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 1513883002: Polymorphic calls in precompilation invoke megamorphic calls when tests fail (instead of deoptimizi… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: g Created 5 years 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
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 6d4795751651e2f07d85452a2268b42be977d77b..3d64ef1fc3abfd10415e14edf76fe3388adf7559 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -55,7 +55,7 @@ DECLARE_FLAG(bool, disassemble);
DECLARE_FLAG(bool, disassemble_optimized);
DECLARE_FLAG(bool, emit_edge_counters);
DECLARE_FLAG(bool, fields_may_be_reset);
-DECLARE_FLAG(bool, guess_other_cid);
+DECLARE_FLAG(bool, guess_icdata_cid);
DECLARE_FLAG(bool, ic_range_profiling);
DECLARE_FLAG(bool, intrinsify);
DECLARE_FLAG(bool, load_deferred_eagerly);
@@ -97,7 +97,6 @@ static void PrecompilationModeHandler(bool value) {
FLAG_load_deferred_eagerly = true;
FLAG_deoptimize_alot = false; // Used in some tests.
FLAG_deoptimize_every = 0; // Used in some tests.
- FLAG_guess_other_cid = true;
Compiler::set_always_optimize(true);
// Triggers assert if we try to recompile (e.g., because of deferred
// loading, deoptimization, ...). Noopt mode simulates behavior
@@ -1769,16 +1768,17 @@ void FlowGraphCompiler::EmitPolymorphicInstanceCall(
} else {
// Instead of deoptimizing, do a megamorphic call when no matching
// cid found.
- Label megamorphic, ok;
+ 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,
- &megamorphic, // No cid match.
- &ok, // Found cid.
+ slow_path->entry_label(), // No cid match.
+ &ok, // Found cid.
deopt_id, token_pos, locs);
- // Fall through if last test is match.
- assembler()->Jump(&ok);
- assembler()->Bind(&megamorphic);
- EmitMegamorphicInstanceCall(ic_data, argument_count, deopt_id,
- token_pos, locs);
+
+ assembler()->Bind(slow_path->exit_label());
assembler()->Bind(&ok);
}
}

Powered by Google App Engine
This is Rietveld 408576698