Index: runtime/vm/intermediate_language.cc |
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc |
index 79e5100a6b77a1d780817340c9e4f3bd93e64e7a..8be4b6927b07d4de27fc76c5ad9b44dc35fff6ef 100644 |
--- a/runtime/vm/intermediate_language.cc |
+++ b/runtime/vm/intermediate_language.cc |
@@ -3345,16 +3345,6 @@ intptr_t PolymorphicInstanceCallInstr::CallCount() const { |
// PolymorphicInstanceCallInstr. |
#if !defined(TARGET_ARCH_DBC) |
void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
- if (!with_checks()) { |
- ASSERT(targets().HasSingleTarget()); |
- const Function& target = targets().FirstTarget(); |
- compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), |
- target, instance_call()->ArgumentCount(), |
- instance_call()->argument_names(), locs(), |
- ICData::Handle()); |
- return; |
- } |
- |
compiler->EmitPolymorphicInstanceCall( |
targets_, *instance_call(), instance_call()->ArgumentCount(), |
instance_call()->argument_names(), deopt_id(), |
@@ -3415,10 +3405,15 @@ Definition* InstanceCallInstr::Canonicalize(FlowGraph* flow_graph) { |
return this; |
} |
- const bool with_checks = false; |
- const bool complete = false; |
- PolymorphicInstanceCallInstr* specialized = new PolymorphicInstanceCallInstr( |
- this, *new_target, with_checks, complete); |
+ ASSERT(new_target->HasSingleTarget()); |
Vyacheslav Egorov (Google)
2017/05/18 07:03:11
similar pattern
|
+ const Function& target = new_target->FirstTarget(); |
+ ZoneGrowableArray<PushArgumentInstr*>* args = new (flow_graph->zone()) |
+ ZoneGrowableArray<PushArgumentInstr*>(ArgumentCount()); |
+ for (intptr_t i = 0; i < ArgumentCount(); i++) { |
+ args->Add(PushArgumentAt(i)); |
+ } |
+ StaticCallInstr* specialized = new (flow_graph->zone()) StaticCallInstr( |
+ token_pos(), target, argument_names(), args, deopt_id(), CallCount()); |
flow_graph->InsertBefore(this, specialized, env(), FlowGraph::kValue); |
return specialized; |
} |
@@ -3443,7 +3438,7 @@ Definition* PolymorphicInstanceCallInstr::Canonicalize(FlowGraph* flow_graph) { |
bool PolymorphicInstanceCallInstr::IsSureToCallSingleRecognizedTarget() const { |
- if (FLAG_precompiled_mode && with_checks()) return false; |
+ if (FLAG_precompiled_mode) return false; |
Vyacheslav Egorov (Google)
2017/05/18 07:03:11
You can check for && !complete() here to make this
|
return targets_.HasSingleRecognizedTarget(); |
} |