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

Unified Diff: runtime/vm/object.h

Issue 8372041: Canonicalize types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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/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 1042)
+++ runtime/vm/object.h (working copy)
@@ -614,6 +614,12 @@
void set_num_constants(intptr_t value) const;
intptr_t num_constants() const;
+ void set_canonical_types(const Array& value) const;
+ RawArray* canonical_types() const;
+
+ void set_num_canonical_types(intptr_t value) const;
+ intptr_t num_canonical_types() const;
+
void CalculateFieldOffsets() const;
// Check the subtype or assignability relationship.
@@ -628,6 +634,7 @@
HEAP_OBJECT_IMPLEMENTATION(Class, Object);
friend class Object;
friend class Instance;
+ friend class ParameterizedType;
};
@@ -677,6 +684,7 @@
virtual RawUnresolvedClass* unresolved_class() const;
virtual RawTypeArguments* arguments() const;
virtual bool IsInstantiated() const;
+ virtual bool Equals(const Type& other) const;
// Instantiate this type using the given type argument vector starting at the
// given offset.
@@ -685,6 +693,9 @@
const TypeArguments& instantiator_type_arguments,
intptr_t offset) const;
+ // Return the canonical version of this type.
+ virtual RawType* Canonicalize() const;
+
// The name of this type, including the names of its type arguments, if any.
virtual RawString* Name() const;
@@ -781,8 +792,8 @@
static RawType* FunctionInterface();
// The least specific valid raw type of the given class.
- // For example, type A<DynamicType> would be returned for class A<T>, and type
- // B<DynamicType, A<DynamicType>> would be returned for B<U, V extends A>.
+ // For example, type A<Dynamic> would be returned for class A<T>, and type
+ // B<Dynamic, A<Dynamic>> would be returned for B<U, V extends A>.
static RawType* NewRawType(const Class& type_class);
// The finalized type of the given non-parameterized class.
@@ -827,9 +838,11 @@
virtual RawTypeArguments* arguments() const;
void set_arguments(const TypeArguments& value) const;
virtual bool IsInstantiated() const;
+ virtual bool Equals(const Type& other) const;
virtual RawType* InstantiateFrom(
const TypeArguments& instantiator_type_arguments,
intptr_t offset) const;
+ virtual RawType* Canonicalize() const;
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawParameterizedType));
@@ -862,9 +875,11 @@
virtual RawString* Name() const { return raw_ptr()->name_; }
virtual intptr_t Index() const { return raw_ptr()->index_; }
virtual bool IsInstantiated() const { return false; }
+ virtual bool Equals(const Type& other) const;
virtual RawType* InstantiateFrom(
const TypeArguments& instantiator_type_arguments,
intptr_t offset) const;
+ virtual RawType* Canonicalize() const { return raw(); }
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawTypeParameter));
@@ -936,6 +951,9 @@
virtual bool IsResolved() const;
virtual bool IsInstantiated() const;
virtual bool IsUninstantiatedIdentity() const;
+ virtual bool Equals(const TypeArguments& other) const;
+ static bool AreEqual(const TypeArguments& arguments,
+ const TypeArguments& other_arguments);
// Return 'this' if this type argument vector is instantiated, i.e. if it does
// not refer to type parameters. Otherwise, return a new type argument vector
@@ -974,6 +992,8 @@
virtual bool IsResolved() const;
virtual bool IsInstantiated() const;
virtual bool IsUninstantiatedIdentity() const;
+ virtual bool Equals(const TypeArguments& other) const;
+
virtual RawTypeArguments* InstantiateFrom(
const TypeArguments& instantiator_type_arguments,
intptr_t offset) const;
« 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