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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: Created 3 years, 8 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/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index 001127cb58effbf73ae2f613a1aca387a704534a..cfae0fbd7faf647c9d964db70428044d9f616f95 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -1743,7 +1743,7 @@ RawObject* ConstantEvaluator::EvaluateConstConstructorCall(
}
arg_values.SetAt((0 + kNumExtraArgs), argument);
const Array& args_descriptor = Array::Handle(
- Z, ArgumentsDescriptor::New(num_arguments, Object::empty_array()));
+ Z, ArgumentsDescriptor::New(0, num_arguments, Object::empty_array()));
const Object& result = Object::Handle(
Z, DartEntry::InvokeFunction(constructor, arg_values, args_descriptor));
ASSERT(!result.IsError());
@@ -2157,7 +2157,7 @@ const Object& ConstantEvaluator::RunFunction(const Function& function,
const Array& arguments,
const Array& names) {
const Array& args_descriptor =
- Array::Handle(Z, ArgumentsDescriptor::New(arguments.Length(), names));
+ Array::Handle(Z, ArgumentsDescriptor::New(0, arguments.Length(), names));
const Object& result = Object::Handle(
Z, DartEntry::InvokeFunction(function, arguments, args_descriptor));
if (result.IsError()) {
@@ -2675,9 +2675,10 @@ Fragment FlowGraphBuilder::InstanceCall(TokenPosition position,
const Array& argument_names,
intptr_t num_args_checked) {
ArgumentArray arguments = GetArguments(argument_count);
- InstanceCallInstr* call =
- new (Z) InstanceCallInstr(position, name, kind, arguments, argument_names,
- num_args_checked, ic_data_array_);
+ const intptr_t kTypeArgsLen = 0; // Generic instance calls not yet supported.
+ InstanceCallInstr* call = new (Z)
+ InstanceCallInstr(position, name, kind, arguments, kTypeArgsLen,
+ argument_names, num_args_checked, ic_data_array_);
Push(call);
return Fragment(call);
}
@@ -2687,8 +2688,10 @@ Fragment FlowGraphBuilder::ClosureCall(int argument_count,
const Array& argument_names) {
Value* function = Pop();
ArgumentArray arguments = GetArguments(argument_count);
- ClosureCallInstr* call = new (Z) ClosureCallInstr(
- function, arguments, argument_names, TokenPosition::kNoSource);
+ const intptr_t kTypeArgsLen = 0; // Generic closures not yet supported.
+ ClosureCallInstr* call =
+ new (Z) ClosureCallInstr(function, arguments, kTypeArgsLen,
+ argument_names, TokenPosition::kNoSource);
Push(call);
return Fragment(call);
}
@@ -2901,8 +2904,10 @@ Fragment FlowGraphBuilder::StaticCall(TokenPosition position,
intptr_t argument_count,
const Array& argument_names) {
ArgumentArray arguments = GetArguments(argument_count);
- StaticCallInstr* call = new (Z) StaticCallInstr(
- position, target, argument_names, arguments, ic_data_array_);
+ const intptr_t kTypeArgsLen = 0; // Generic static calls not yet supported.
+ StaticCallInstr* call =
+ new (Z) StaticCallInstr(position, target, kTypeArgsLen, argument_names,
+ arguments, ic_data_array_);
const intptr_t list_cid =
GetResultCidOfListFactory(Z, target, argument_count);
if (list_cid != kDynamicCid) {
@@ -3023,15 +3028,17 @@ Fragment FlowGraphBuilder::StringInterpolate(TokenPosition position) {
Fragment FlowGraphBuilder::StringInterpolateSingle(TokenPosition position) {
+ const int kTypeArgsLen = 0;
const int kNumberOfArguments = 1;
const Array& kNoArgumentNames = Object::null_array();
const dart::Class& cls = dart::Class::Handle(
dart::Library::LookupCoreClass(Symbols::StringBase()));
ASSERT(!cls.IsNull());
const Function& function = dart::Function::ZoneHandle(
- Z, dart::Resolver::ResolveStatic(cls, dart::Library::PrivateCoreLibName(
- Symbols::InterpolateSingle()),
- kNumberOfArguments, kNoArgumentNames));
+ Z,
+ dart::Resolver::ResolveStatic(
+ cls, dart::Library::PrivateCoreLibName(Symbols::InterpolateSingle()),
+ kTypeArgsLen, kNumberOfArguments, kNoArgumentNames));
Fragment instructions;
instructions += PushArgument();
instructions += StaticCall(position, function, 1);
@@ -4235,7 +4242,7 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodDispatcher(
body += PushArgument(); // For the call to noSuchMethod.
ArgumentsDescriptor two_arguments(
- Array::Handle(Z, ArgumentsDescriptor::New(2)));
+ Array::Handle(Z, ArgumentsDescriptor::New(0, 2)));
Function& no_such_method =
Function::ZoneHandle(Z, Resolver::ResolveDynamicForReceiverClass(
dart::Class::Handle(Z, function.Owner()),
@@ -5096,7 +5103,9 @@ void FlowGraphBuilder::VisitStaticInvocation(StaticInvocation* node) {
const Array& argument_names = H.ArgumentNames(&named);
// The frontend ensures we the [StaticInvocation] has matching arguments.
- ASSERT(target.AreValidArguments(argument_count, argument_names, NULL));
+ const intptr_t kTypeArgsLen = 0; // Generic functions not yet supported.
+ ASSERT(target.AreValidArguments(kTypeArgsLen, argument_count, argument_names,
+ NULL));
Fragment instructions;
LocalVariable* instance_variable = NULL;

Powered by Google App Engine
This is Rietveld 408576698