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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: sync and work in progress 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/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 79e5100a6b77a1d780817340c9e4f3bd93e64e7a..6dd99c7b2a3ff490761b03ad8c66d2086dbafc46 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3176,8 +3176,7 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const ICData* call_ic_data = NULL;
if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
(ic_data() == NULL)) {
- const Array& arguments_descriptor = Array::Handle(
- zone, ArgumentsDescriptor::New(ArgumentCount(), argument_names()));
+ const Array& arguments_descriptor = GetArgumentsDescriptor(zone);
call_ic_data = compiler->GetOrAddInstanceCallICData(
deopt_id(), function_name(), arguments_descriptor,
checked_argument_count());
@@ -3345,19 +3344,19 @@ intptr_t PolymorphicInstanceCallInstr::CallCount() const {
// PolymorphicInstanceCallInstr.
#if !defined(TARGET_ARCH_DBC)
void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ ArgumentsInfo args_info(instance_call()->type_args_len(),
+ instance_call()->ArgumentCount(),
+ instance_call()->argument_names());
if (!with_checks()) {
ASSERT(targets().HasSingleTarget());
const Function& target = targets().FirstTarget();
compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(),
- target, instance_call()->ArgumentCount(),
- instance_call()->argument_names(), locs(),
- ICData::Handle());
+ target, args_info, locs(), ICData::Handle());
return;
}
compiler->EmitPolymorphicInstanceCall(
- targets_, *instance_call(), instance_call()->ArgumentCount(),
- instance_call()->argument_names(), deopt_id(),
+ targets_, *instance_call(), args_info, deopt_id(),
instance_call()->token_pos(), locs(), complete(), total_call_count());
}
#endif
@@ -3472,11 +3471,11 @@ LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone,
void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Zone* zone = compiler->zone();
const ICData* call_ic_data = NULL;
if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
(ic_data() == NULL)) {
- const Array& arguments_descriptor = Array::Handle(
- ArgumentsDescriptor::New(ArgumentCount(), argument_names()));
+ const Array& arguments_descriptor = GetArgumentsDescriptor(zone);
MethodRecognizer::Kind recognized_kind =
MethodRecognizer::RecognizeKind(function());
int num_args_checked = 0;
@@ -3496,13 +3495,12 @@ void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
#if !defined(TARGET_ARCH_DBC)
- compiler->GenerateStaticCall(deopt_id(), token_pos(), function(),
- ArgumentCount(), argument_names(), locs(),
- *call_ic_data);
+ ArgumentsInfo args_info(type_args_len(), ArgumentCount(), argument_names());
+ compiler->GenerateStaticCall(deopt_id(), token_pos(), function(), args_info,
+ locs(), *call_ic_data);
#else
const Array& arguments_descriptor =
- (ic_data() == NULL) ? Array::Handle(ArgumentsDescriptor::New(
- ArgumentCount(), argument_names()))
+ (ic_data() == NULL) ? GetArgumentsDescriptor(zone)
: Array::Handle(ic_data()->arguments_descriptor());
const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor);
@@ -3783,13 +3781,14 @@ intptr_t CheckArrayBoundInstr::LengthOffsetFor(intptr_t class_id) {
const Function& StringInterpolateInstr::CallFunction() const {
if (function_.IsNull()) {
+ const int kTypeArgsLen = 0;
const int kNumberOfArguments = 1;
const Array& kNoArgumentNames = Object::null_array();
const Class& cls =
Class::Handle(Library::LookupCoreClass(Symbols::StringBase()));
ASSERT(!cls.IsNull());
function_ = Resolver::ResolveStatic(
- cls, Library::PrivateCoreLibName(Symbols::Interpolate()),
+ cls, Library::PrivateCoreLibName(Symbols::Interpolate()), kTypeArgsLen,
kNumberOfArguments, kNoArgumentNames);
}
ASSERT(!function_.IsNull());

Powered by Google App Engine
This is Rietveld 408576698