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

Unified Diff: runtime/vm/object.h

Issue 25569002: Do not share type arguments of mixin types, but clone them to avoid finalization (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 28104)
+++ runtime/vm/object.h (working copy)
@@ -1139,6 +1139,9 @@
// InstantiatedTypeArguments.
class AbstractTypeArguments : public Object {
public:
+ // Returns true if all types of this vector are finalized.
+ virtual bool IsFinalized() const { return true; }
+
// Returns true if both arguments represent vectors of equal types.
static bool AreEqual(const AbstractTypeArguments& arguments,
const AbstractTypeArguments& other_arguments);
@@ -1152,7 +1155,13 @@
const AbstractTypeArguments& instantiator_type_arguments,
Error* bound_error) const;
- // Do not canonicalize InstantiatedTypeArguments or NULL objects
+ // Do not clone InstantiatedTypeArguments or null vectors, since they are
+ // considered finalized.
+ virtual RawAbstractTypeArguments* CloneUnfinalized() const {
+ return this->raw();
+ }
+
+ // Do not canonicalize InstantiatedTypeArguments or null vectors.
virtual RawAbstractTypeArguments* Canonicalize() const { return this->raw(); }
// The name of this type argument vector, e.g. "<T, dynamic, List<T>, Smi>".
@@ -1251,7 +1260,9 @@
virtual bool IsUninstantiatedIdentity() const;
virtual bool CanShareInstantiatorTypeArguments(
const Class& instantiator_class) const;
+ virtual bool IsFinalized() const;
virtual bool IsBounded() const;
+ virtual RawAbstractTypeArguments* CloneUnfinalized() const;
// Canonicalize only if instantiated, otherwise returns 'this'.
virtual RawAbstractTypeArguments* Canonicalize() const;
@@ -3867,6 +3878,11 @@
const AbstractTypeArguments& instantiator_type_arguments,
Error* bound_error) const;
+ // Return a clone of this unfinalized type or the type itself if it is
+ // already finalized. Apply recursively to type arguments, i.e. finalized
+ // type arguments of an unfinalized type are not cloned, but shared.
+ virtual RawAbstractType* CloneUnfinalized() const;
+
virtual RawInstance* CheckAndCanonicalize(const char** error_str) const {
return Canonicalize();
}
@@ -4004,6 +4020,7 @@
virtual RawAbstractType* InstantiateFrom(
const AbstractTypeArguments& instantiator_type_arguments,
Error* malformed_error) const;
+ virtual RawAbstractType* CloneUnfinalized() const;
virtual RawAbstractType* Canonicalize() const;
virtual intptr_t Hash() const;
@@ -4118,6 +4135,7 @@
virtual RawAbstractType* InstantiateFrom(
const AbstractTypeArguments& instantiator_type_arguments,
Error* bound_error) const;
+ virtual RawAbstractType* CloneUnfinalized() const;
virtual RawAbstractType* Canonicalize() const { return raw(); }
virtual intptr_t Hash() const;
@@ -4190,6 +4208,7 @@
virtual RawAbstractType* InstantiateFrom(
const AbstractTypeArguments& instantiator_type_arguments,
Error* bound_error) const;
+ virtual RawAbstractType* CloneUnfinalized() const;
virtual RawAbstractType* Canonicalize() const { return raw(); }
virtual intptr_t Hash() const;
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698