| Index: runtime/vm/flow_graph_compiler_x64.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_compiler_x64.cc (revision 20234)
|
| +++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
|
| @@ -1381,8 +1381,8 @@
|
|
|
| void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
|
| Register class_id_reg,
|
| - intptr_t arg_count,
|
| - const Array& arg_names,
|
| + intptr_t argument_count,
|
| + const Array& argument_names,
|
| Label* deopt,
|
| intptr_t deopt_id,
|
| intptr_t token_index,
|
| @@ -1392,6 +1392,12 @@
|
| const intptr_t len = ic_data.NumberOfChecks();
|
| GrowableArray<CidTarget> sorted(len);
|
| SortICDataByCount(ic_data, &sorted);
|
| + ASSERT(class_id_reg != R10);
|
| + ASSERT(len > 0); // Why bother otherwise.
|
| + const Array& arguments_descriptor =
|
| + Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
|
| + argument_names));
|
| + __ LoadObject(R10, arguments_descriptor);
|
| for (intptr_t i = 0; i < len; i++) {
|
| const bool is_last_check = (i == (len - 1));
|
| Label next_test;
|
| @@ -1401,12 +1407,16 @@
|
| } else {
|
| assembler()->j(NOT_EQUAL, &next_test);
|
| }
|
| - GenerateStaticCall(deopt_id,
|
| - token_index,
|
| - *sorted[i].target,
|
| - arg_count,
|
| - arg_names,
|
| - locs);
|
| + // Do not use the code from the function, but let the code be patched so
|
| + // that we can record the outgoing edges to other code.
|
| + GenerateDartCall(deopt_id,
|
| + token_index,
|
| + &StubCode::CallStaticFunctionLabel(),
|
| + PcDescriptors::kFuncCall,
|
| + locs);
|
| + const Function& function = *sorted[i].target;
|
| + AddStaticCallTarget(function);
|
| + __ Drop(argument_count);
|
| if (!is_last_check) {
|
| assembler()->jmp(&match_found);
|
| }
|
|
|