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

Unified Diff: runtime/vm/object.h

Issue 14238036: Improve type optimization reusing the type argument vector of the instantiator (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/intermediate_language_x64.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 22056)
+++ runtime/vm/object.h (working copy)
@@ -4781,7 +4781,10 @@
return raw_ptr()->type_arguments_;
}
virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
- ASSERT(value.IsNull() || ((value.Length() == 1) && value.IsInstantiated()));
+ // An Array is raw or takes one type argument. However, its type argument
+ // vector may be longer than 1 due to a type optimization reusing the type
+ // argument vector of the instantiator.
+ ASSERT(value.IsNull() || ((value.Length() >= 1) && value.IsInstantiated()));
StorePointer(&raw_ptr()->type_arguments_, value.raw());
}
@@ -4909,7 +4912,10 @@
return raw_ptr()->type_arguments_;
}
virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
- ASSERT(value.IsNull() || ((value.Length() == 1) && value.IsInstantiated()));
+ // A GrowableObjectArray is raw or takes one type argument. However, its
+ // type argument vector may be longer than 1 due to a type optimization
+ // reusing the type argument vector of the instantiator.
+ ASSERT(value.IsNull() || ((value.Length() >= 1) && value.IsInstantiated()));
const Array& contents = Array::Handle(data());
contents.SetTypeArguments(value);
StorePointer(&raw_ptr()->type_arguments_, value.raw());
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698