Index: runtime/vm/precompiler.cc |
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc |
index 16304750a0134f1699f6632778dc8e780b93637c..8686638d04ea052f54166bd9bb4f2f3b4d0edb31 100644 |
--- a/runtime/vm/precompiler.cc |
+++ b/runtime/vm/precompiler.cc |
@@ -823,11 +823,13 @@ void Precompiler::CollectCallbackFields() { |
// Create arguments descriptor with fixed parameters from |
// signature of field_type. |
function = Type::Cast(field_type).signature(); |
+ if (function.IsGeneric()) continue; |
if (function.HasOptionalParameters()) continue; |
if (FLAG_trace_precompiler) { |
THR_Print("Found callback field %s\n", field_name.ToCString()); |
} |
- args_desc = ArgumentsDescriptor::New(function.num_fixed_parameters()); |
+ args_desc = ArgumentsDescriptor::New(0, // No type argument vector. |
+ function.num_fixed_parameters()); |
cids.Clear(); |
if (T->cha()->ConcreteSubclasses(cls, &cids)) { |
for (intptr_t j = 0; j < cids.length(); ++j) { |
@@ -2514,8 +2516,11 @@ void Precompiler::PopulateWithICData(const Function& function, |
InstanceCallInstr* call = instr->AsInstanceCall(); |
if (!call->HasICData()) { |
const Array& arguments_descriptor = Array::Handle( |
- zone, ArgumentsDescriptor::New(call->ArgumentCount(), |
- call->argument_names())); |
+ zone, |
+ ArgumentsDescriptor::New( |
+ call->type_args_len(), |
+ call->ArgumentCount() - (call->type_args_len() > 0 ? 1 : 0), |
+ call->argument_names())); |
const ICData& ic_data = ICData::ZoneHandle( |
zone, ICData::New(function, call->function_name(), |
arguments_descriptor, call->deopt_id(), |
@@ -2526,8 +2531,11 @@ void Precompiler::PopulateWithICData(const Function& function, |
StaticCallInstr* call = instr->AsStaticCall(); |
if (!call->HasICData()) { |
const Array& arguments_descriptor = Array::Handle( |
- zone, ArgumentsDescriptor::New(call->ArgumentCount(), |
- call->argument_names())); |
+ zone, |
+ ArgumentsDescriptor::New( |
+ call->type_args_len(), |
+ call->ArgumentCount() - (call->type_args_len() > 0 ? 1 : 0), |
+ call->argument_names())); |
const Function& target = call->function(); |
MethodRecognizer::Kind recognized_kind = |
MethodRecognizer::RecognizeKind(target); |