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

Unified Diff: runtime/vm/raw_object.h

Issue 1965493004: Canonicalize generic types in an isolate specific hash table (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-merge-conflicts Created 4 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
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index ded9eff28c8053fdae92bc30164d31f5b1d5ed75..ef5924e9f97533018301026464af053e5e5bce07 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -698,9 +698,8 @@ class RawClass : public RawObject {
RawAbstractType* super_type_;
RawType* mixin_; // Generic mixin type, e.g. M<T>, not M<int>.
RawFunction* signature_function_; // Associated function for typedef class.
- RawArray* constants_; // Canonicalized values of this class.
- RawObject* canonical_types_; // An array of canonicalized types of this class
- // or the canonical type.
+ RawArray* constants_; // Canonicalized const instances of this class.
+ RawType* canonical_type_; // Canonical type for this class.
RawArray* invocation_dispatcher_cache_; // Cache for dispatcher functions.
RawCode* allocation_stub_; // Stub code for allocation of instances.
RawGrowableObjectArray* direct_subclasses_; // Array of Class.
@@ -773,6 +772,8 @@ class RawTypeArguments : public RawObject {
// Instantiations leading to bound errors do not get cached.
RawSmi* length_;
+ RawSmi* hash_;
+
// Variable length data follows here.
RawAbstractType* const* types() const {
OPEN_ARRAY_START(RawAbstractType*, RawAbstractType*);
@@ -1691,6 +1692,7 @@ class RawType : public RawAbstractType {
// Either the id of the resolved class as a Smi or an UnresolvedClass.
RawObject* type_class_id_;
RawTypeArguments* arguments_;
+ RawSmi* hash_;
// This type object represents a function type if its signature field is a
// non-null function object.
// If this type is malformed or malbounded, the signature field gets
@@ -1731,6 +1733,7 @@ class RawTypeParameter : public RawAbstractType {
return reinterpret_cast<RawObject**>(&ptr()->name_);
}
RawString* name_;
+ RawSmi* hash_;
RawAbstractType* bound_; // ObjectType if no explicit bound specified.
RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->bound_); }
classid_t parameterized_class_id_;
@@ -1749,6 +1752,7 @@ class RawBoundedType : public RawAbstractType {
}
RawAbstractType* type_;
RawAbstractType* bound_;
+ RawSmi* hash_;
RawTypeParameter* type_parameter_; // For more detailed error reporting.
RawObject** to() {
return reinterpret_cast<RawObject**>(&ptr()->type_parameter_);
@@ -1764,6 +1768,7 @@ class RawMixinAppType : public RawAbstractType {
return reinterpret_cast<RawObject**>(&ptr()->super_type_);
}
RawAbstractType* super_type_;
+ RawSmi* hash_;
RawArray* mixin_types_; // Array of AbstractType.
RawObject** to() {
return reinterpret_cast<RawObject**>(&ptr()->mixin_types_);
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698