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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1190473004: Add flag polymorphic_with_deopt (default true) and handle case when false: use megamorphic instead … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: r Created 5 years, 6 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
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index f78c295c013bd5a883c5aa97a4b186e92b456f8a..fb55f660f397e597849ddd6bd71d4f0e290e08bf 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -28,13 +28,13 @@
namespace dart {
+DEFINE_FLAG(bool, ic_range_profiling, true,
+ "Generate special IC stubs collecting range information "
+ "for binary and unary arithmetic operations");
DEFINE_FLAG(bool, propagate_ic_data, true,
"Propagate IC data from unoptimized to optimized IC calls.");
DEFINE_FLAG(bool, two_args_smi_icd, true,
"Generate special IC stubs for two args Smi operations");
-DEFINE_FLAG(bool, ic_range_profiling, true,
- "Generate special IC stubs collecting range information "
- "for binary and unary arithmetic operations");
DEFINE_FLAG(bool, unbox_numeric_fields, true,
"Support unboxed double and float32x4 fields.");
DECLARE_FLAG(bool, eliminate_type_checks);
@@ -3058,6 +3058,29 @@ bool PolymorphicInstanceCallInstr::HasOnlyDispatcherTargets() const {
return true;
}
+void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ ASSERT(ic_data().NumArgsTested() == 1);
+ if (!with_checks()) {
+ ASSERT(ic_data().HasOneTarget());
+ const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0));
+ compiler->GenerateStaticCall(deopt_id(),
+ instance_call()->token_pos(),
+ target,
+ instance_call()->ArgumentCount(),
+ instance_call()->argument_names(),
+ locs(),
+ ICData::Handle());
+ return;
+ }
+
+ compiler->EmitPolymorphicInstanceCall(ic_data(),
+ instance_call()->ArgumentCount(),
+ instance_call()->argument_names(),
+ deopt_id(),
+ instance_call()->token_pos(),
+ locs());
+}
+
LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone,
bool optimizing) const {

Powered by Google App Engine
This is Rietveld 408576698