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

Unified Diff: runtime/vm/kernel_to_il.h

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_reader.cc ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.h
diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h
index 2c719c2264ea66d86a4442cf872893d0c5b37889..7dac63910fa3afc047a95c9ed2a6fd8198e41298 100644
--- a/runtime/vm/kernel_to_il.h
+++ b/runtime/vm/kernel_to_il.h
@@ -190,42 +190,44 @@ typedef ZoneGrowableArray<PushArgumentInstr*>* ArgumentArray;
class ActiveClass {
public:
- ActiveClass()
- : kernel_class(NULL),
- class_type_parameters(0),
- class_type_parameters_offset_start(-1),
- klass(NULL),
- member_is_procedure(false),
- member_is_factory_procedure(false),
- member_type_parameters(0),
- member_type_parameters_offset_start(-1) {}
-
- // The current enclosing kernel class (if available, otherwise NULL).
- Class* kernel_class;
- intptr_t class_type_parameters;
- intptr_t class_type_parameters_offset_start;
-
- // The current enclosing class (or the library top-level class). When this is
- // a library's top-level class, the kernel_class will be NULL.
+ ActiveClass() : klass(NULL), member(NULL) {}
+
+ bool HasMember() { return member != NULL; }
+
+ bool MemberIsProcedure() {
+ ASSERT(member != NULL);
+ RawFunction::Kind function_kind = member->kind();
+ return function_kind == RawFunction::kRegularFunction ||
+ function_kind == RawFunction::kGetterFunction ||
+ function_kind == RawFunction::kSetterFunction ||
+ function_kind == RawFunction::kMethodExtractor ||
+ member->IsFactory();
+ }
+
+ bool MemberIsFactoryProcedure() {
+ ASSERT(member != NULL);
+ return member->IsFactory();
+ }
+
+ intptr_t MemberTypeParameterCount(Zone* zone);
+
+ intptr_t ClassTypeParameterCount(Zone* zone) {
+ ASSERT(member != NULL);
+ TypeArguments& class_types =
+ dart::TypeArguments::Handle(zone, klass->type_parameters());
+ return class_types.Length();
+ }
+
+ // The current enclosing class (or the library top-level class).
const dart::Class* klass;
- bool member_is_procedure;
- bool member_is_factory_procedure;
- intptr_t member_type_parameters;
- intptr_t member_type_parameters_offset_start;
+ const dart::Function* member;
};
class ActiveClassScope {
public:
- ActiveClassScope(ActiveClass* active_class,
- intptr_t class_type_parameters,
- intptr_t class_type_parameters_offset_start,
- const dart::Class* klass)
+ ActiveClassScope(ActiveClass* active_class, const dart::Class* klass)
: active_class_(active_class), saved_(*active_class) {
- active_class_->kernel_class = NULL;
- active_class_->class_type_parameters = class_type_parameters;
- active_class_->class_type_parameters_offset_start =
- class_type_parameters_offset_start;
active_class_->klass = klass;
}
@@ -238,18 +240,10 @@ class ActiveClassScope {
class ActiveMemberScope {
public:
- ActiveMemberScope(ActiveClass* active_class,
- bool member_is_procedure,
- bool member_is_factory_procedure,
- intptr_t member_type_parameters,
- intptr_t member_type_parameters_offset_start)
+ ActiveMemberScope(ActiveClass* active_class, const Function* member)
: active_class_(active_class), saved_(*active_class) {
- // The class and kernel_class is inherited.
- active_class_->member_is_procedure = member_is_procedure;
- active_class_->member_is_factory_procedure = member_is_factory_procedure;
- active_class_->member_type_parameters = member_type_parameters;
- active_class_->member_type_parameters_offset_start =
- member_type_parameters_offset_start;
+ // The class is inherited.
+ active_class_->member = member;
}
~ActiveMemberScope() { *active_class_ = saved_; }
« no previous file with comments | « runtime/vm/kernel_reader.cc ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698