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

Unified Diff: runtime/lib/mirrors.cc

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: address comments Created 3 years, 7 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/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 89d4f7b2fdab88d282c649838118d1d56190cab7..489123657ee9068a2ecccd8f05e9107427b322b1 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -1346,8 +1346,9 @@ DEFINE_NATIVE_ENTRY(InstanceMirror_invoke, 5) {
Function& function = Function::Handle(
zone, Resolver::ResolveDynamicAnyArgs(zone, klass, function_name));
- const Array& args_descriptor =
- Array::Handle(zone, ArgumentsDescriptor::New(args.Length(), arg_names));
+ // TODO(regis): Support invocation of generic functions with type arguments.
+ const Array& args_descriptor = Array::Handle(
+ zone, ArgumentsDescriptor::New(0, args.Length(), arg_names));
zra 2017/05/11 04:14:20 Maybe to be consistent with other call-sites: con
regis 2017/05/11 09:55:10 Done here and below.
if (function.IsNull()) {
// Didn't find a method: try to find a getter and invoke call on its result.
@@ -1360,8 +1361,8 @@ DEFINE_NATIVE_ENTRY(InstanceMirror_invoke, 5) {
const int kNumArgs = 1;
const Array& getter_args = Array::Handle(zone, Array::New(kNumArgs));
getter_args.SetAt(0, reflectee);
- const Array& getter_args_descriptor =
- Array::Handle(zone, ArgumentsDescriptor::New(getter_args.Length()));
+ const Array& getter_args_descriptor = Array::Handle(
+ zone, ArgumentsDescriptor::New(0, getter_args.Length()));
const Instance& getter_result = Instance::Handle(
zone, InvokeDynamicFunction(reflectee, function, getter_name,
getter_args, getter_args_descriptor));
@@ -1411,7 +1412,7 @@ DEFINE_NATIVE_ENTRY(InstanceMirror_invokeGetter, 3) {
const Array& args = Array::Handle(zone, Array::New(kNumArgs));
args.SetAt(0, reflectee);
const Array& args_descriptor =
- Array::Handle(zone, ArgumentsDescriptor::New(args.Length()));
+ Array::Handle(zone, ArgumentsDescriptor::New(0, args.Length()));
// InvokeDynamic invokes NoSuchMethod if the provided function is null.
return InvokeDynamicFunction(reflectee, function, internal_getter_name, args,
@@ -1438,7 +1439,7 @@ DEFINE_NATIVE_ENTRY(InstanceMirror_invokeSetter, 4) {
args.SetAt(0, reflectee);
args.SetAt(1, value);
const Array& args_descriptor =
- Array::Handle(zone, ArgumentsDescriptor::New(args.Length()));
+ Array::Handle(zone, ArgumentsDescriptor::New(0, args.Length()));
return InvokeDynamicFunction(reflectee, setter, internal_setter_name, args,
args_descriptor);
@@ -1532,7 +1533,7 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invoke, 5) {
}
call_args.SetAt(0, getter_result);
const Array& call_args_descriptor_array = Array::Handle(
- ArgumentsDescriptor::New(call_args.Length(), arg_names));
+ ArgumentsDescriptor::New(0, call_args.Length(), arg_names));
// Call the closure.
const Object& call_result = Object::Handle(
DartEntry::InvokeClosure(call_args, call_args_descriptor_array));
@@ -1545,7 +1546,7 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invoke, 5) {
}
const Array& args_descriptor_array =
- Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
+ Array::Handle(ArgumentsDescriptor::New(0, args.Length(), arg_names));
ArgumentsDescriptor args_descriptor(args_descriptor_array);
@@ -1747,7 +1748,7 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 5) {
}
const Array& args_descriptor_array =
- Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
+ Array::Handle(ArgumentsDescriptor::New(0, args.Length(), arg_names));
ArgumentsDescriptor args_descriptor(args_descriptor_array);
if (!redirected_constructor.AreValidArguments(args_descriptor, NULL)) {
@@ -1825,7 +1826,7 @@ DEFINE_NATIVE_ENTRY(LibraryMirror_invoke, 5) {
}
call_args.SetAt(0, getter_result);
const Array& call_args_descriptor_array = Array::Handle(
- ArgumentsDescriptor::New(call_args.Length(), arg_names));
+ ArgumentsDescriptor::New(0, call_args.Length(), arg_names));
// Call closure.
const Object& call_result = Object::Handle(
DartEntry::InvokeClosure(call_args, call_args_descriptor_array));
@@ -1838,7 +1839,7 @@ DEFINE_NATIVE_ENTRY(LibraryMirror_invoke, 5) {
}
const Array& args_descriptor_array =
- Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
+ Array::Handle(ArgumentsDescriptor::New(0, args.Length(), arg_names));
ArgumentsDescriptor args_descriptor(args_descriptor_array);
if (function.IsNull() || !function.AreValidArguments(args_descriptor, NULL) ||

Powered by Google App Engine
This is Rietveld 408576698