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

Unified Diff: runtime/vm/object.h

Issue 8491055: Second attempt at finalizing all classes in the VM (fix issue 364). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/code_generator_ia32.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 1474)
+++ runtime/vm/object.h (working copy)
@@ -245,6 +245,14 @@
static RawClass* GetSingletonClass(int index);
static const char* GetSingletonClassName(int index);
+ static RawClass* CreateAndRegisterInterface(const char* cname,
+ const Script& script,
+ const Library& lib);
+ static void RegisterClass(const Class& cls,
+ const char* cname,
+ const Script& script,
+ const Library& lib);
+
static void Init(Isolate* isolate);
static void InitFromSnapshot(Isolate* isolate);
static void InitOnce();
@@ -410,7 +418,8 @@
void set_type_parameters(const Array& value) const;
intptr_t NumTypeParameters() const;
- // Type parameters may optionally extend a Type (DynamicType if no extends).
+ // Type parameters may optionally extend a Type (Dynamic if no extends).
+ // TODO(regis): Should it be Object instead of Dynamic?
RawTypeArray* type_parameter_extends() const {
return raw_ptr()->type_parameter_extends_;
}
@@ -420,8 +429,12 @@
// Return null otherwise.
RawTypeParameter* LookupTypeParameter(const String& type_name) const;
+ // The type argument vector is flattened and includes the type arguments of
+ // the super class.
+ bool HasTypeArguments() const;
+ intptr_t NumTypeArguments() const;
+
// If this class is parameterized, each instance has a type_arguments field.
- intptr_t NumTypeArguments() const;
static const intptr_t kNoTypeArguments = -1;
intptr_t type_arguments_instance_field_offset() const {
ASSERT(is_finalized() || is_prefinalized());
@@ -430,15 +443,6 @@
void set_type_arguments_instance_field_offset(intptr_t value) const {
raw_ptr()->type_arguments_instance_field_offset_ = value;
}
- bool HasTypeArguments() const {
- if (is_finalized() || is_prefinalized()) {
- // More efficient than calling NumTypeArguments().
- return type_arguments_instance_field_offset() != kNoTypeArguments;
- } else {
- // No need to check NumTypeArguments() if class has type parameters.
- return (NumTypeParameters() > 0) || (NumTypeArguments() > 0);
- }
- }
// The super type of this class, Object type if not explicitly specified.
RawType* super_type() const { return raw_ptr()->super_type_; }
« no previous file with comments | « runtime/vm/code_generator_ia32.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698