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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2973633002: [kernel] Change how TypeParameterType is calculated. (Closed)
Patch Set: longjmp instead of UNREACHABLE (+ rebase) Created 3 years, 4 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
« no previous file with comments | « runtime/vm/kernel_to_il.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index bfa7743885e4a8fa5e6f9b3da7147297418bd1db..a315410cbc799b1997a922536404e94a65a05944 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -67,6 +67,25 @@ Fragment operator<<(const Fragment& fragment, Instruction* next) {
return result;
}
+intptr_t ActiveClass::MemberTypeParameterCount(Zone* zone) {
+ ASSERT(member != NULL);
+ if (member->IsFactory()) {
+ TypeArguments& class_types =
+ dart::TypeArguments::Handle(zone, klass->type_parameters());
+ return class_types.Length();
+ } else if (member->IsMethodExtractor()) {
+ Function& extracted =
+ Function::Handle(zone, member->extracted_method_closure());
+ TypeArguments& function_types =
+ dart::TypeArguments::Handle(zone, extracted.type_parameters());
+ return function_types.Length();
+ } else {
+ TypeArguments& function_types =
+ dart::TypeArguments::Handle(zone, member->type_parameters());
+ return function_types.Length();
+ }
+}
+
TranslationHelper::TranslationHelper(Thread* thread)
: thread_(thread),
zone_(thread->zone()),
@@ -761,7 +780,7 @@ Fragment FlowGraphBuilder::LoadInstantiatorTypeArguments() {
#endif
instructions += LoadLocal(scopes_->type_arguments_variable);
} else if (scopes_->this_variable != NULL &&
- active_class_.class_type_parameters > 0) {
+ active_class_.ClassTypeParameterCount(Z) > 0) {
ASSERT(!parsed_function_->function().IsFactory());
intptr_t type_arguments_field_offset =
active_class_.klass->type_arguments_field_offset();
« no previous file with comments | « runtime/vm/kernel_to_il.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698