Index: runtime/vm/flow_graph_compiler.cc |
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc |
index 3fbeb86ece5f866050f9c32d51969abdfe0c183b..d68d951c402624bb8d9216c1039206fc6d4767ac 100644 |
--- a/runtime/vm/flow_graph_compiler.cc |
+++ b/runtime/vm/flow_graph_compiler.cc |
@@ -1197,15 +1197,18 @@ void FlowGraphCompiler::GenerateInstanceCall(intptr_t deopt_id, |
void FlowGraphCompiler::GenerateStaticCall(intptr_t deopt_id, |
TokenPosition token_pos, |
const Function& function, |
+ intptr_t type_args_len, |
Vyacheslav Egorov (Google)
2017/05/04 12:12:22
I wonder if triple of <type-args-len, pushed_argc,
regis
2017/05/09 18:31:23
Done.
|
intptr_t argument_count, |
const Array& argument_names, |
LocationSummary* locs, |
const ICData& ic_data_in) { |
const ICData& ic_data = ICData::ZoneHandle(ic_data_in.Original()); |
- const Array& arguments_descriptor = |
- Array::ZoneHandle(ic_data.IsNull() ? ArgumentsDescriptor::New( |
- argument_count, argument_names) |
- : ic_data.arguments_descriptor()); |
+ const Array& arguments_descriptor = Array::ZoneHandle( |
+ ic_data.IsNull() |
+ ? ArgumentsDescriptor::New( |
+ type_args_len, argument_count - (type_args_len > 0 ? 1 : 0), |
+ argument_names) |
+ : ic_data.arguments_descriptor()); |
if (is_optimizing()) { |
EmitOptimizedStaticCall(function, arguments_descriptor, argument_count, |
deopt_id, token_pos, locs); |
@@ -1843,6 +1846,7 @@ bool FlowGraphCompiler::LookupMethodFor(int class_id, |
void FlowGraphCompiler::EmitPolymorphicInstanceCall( |
const CallTargets& targets, |
const InstanceCallInstr& original_call, |
+ intptr_t type_args_len, |
intptr_t argument_count, |
const Array& argument_names, |
intptr_t deopt_id, |
@@ -1854,8 +1858,8 @@ void FlowGraphCompiler::EmitPolymorphicInstanceCall( |
Label* deopt = |
AddDeoptStub(deopt_id, ICData::kDeoptPolymorphicInstanceCallTestFail); |
Label ok; |
- EmitTestAndCall(targets, original_call.function_name(), argument_count, |
- argument_names, |
+ EmitTestAndCall(targets, original_call.function_name(), type_args_len, |
+ argument_count, argument_names, |
deopt, // No cid match. |
&ok, // Found cid. |
deopt_id, token_pos, locs, complete, total_ic_calls); |
@@ -1863,8 +1867,8 @@ void FlowGraphCompiler::EmitPolymorphicInstanceCall( |
} else { |
if (complete) { |
Label ok; |
- EmitTestAndCall(targets, original_call.function_name(), argument_count, |
- argument_names, |
+ EmitTestAndCall(targets, original_call.function_name(), type_args_len, |
+ argument_count, argument_names, |
NULL, // No cid match. |
&ok, // Found cid. |
deopt_id, token_pos, locs, true, total_ic_calls); |
@@ -1882,6 +1886,7 @@ void FlowGraphCompiler::EmitPolymorphicInstanceCall( |
#define __ assembler()-> |
void FlowGraphCompiler::EmitTestAndCall(const CallTargets& targets, |
const String& function_name, |
+ intptr_t type_args_len, |
intptr_t argument_count, |
const Array& argument_names, |
Label* failed, |
@@ -1894,7 +1899,9 @@ void FlowGraphCompiler::EmitTestAndCall(const CallTargets& targets, |
ASSERT(is_optimizing()); |
const Array& arguments_descriptor = Array::ZoneHandle( |
- zone(), ArgumentsDescriptor::New(argument_count, argument_names)); |
+ zone(), ArgumentsDescriptor::New( |
+ type_args_len, argument_count - (type_args_len > 0 ? 1 : 0), |
+ argument_names)); |
EmitTestAndCallLoadReceiver(argument_count, arguments_descriptor); |