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

Unified Diff: runtime/vm/object.h

Issue 1556113002: Use the fast canonical type cache for non-generic classes, even if their (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 12 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 | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 61e6ea069663c92b867a2d60afd93dfb2a170557..456cb62684f7ae683f6936626f657289bf618947 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -6829,7 +6829,10 @@ class Array : public Instance {
// 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()));
+ ASSERT(value.IsNull() ||
+ ((value.Length() >= 1) &&
+ value.IsInstantiated() &&
+ value.IsCanonical()));
StorePointer(&raw_ptr()->type_arguments_, value.raw());
}
@@ -6992,7 +6995,10 @@ class GrowableObjectArray : public Instance {
// 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()));
+ ASSERT(value.IsNull() ||
+ ((value.Length() >= 1) &&
+ value.IsInstantiated() &&
+ value.IsCanonical()));
const Array& contents = Array::Handle(data());
contents.SetTypeArguments(value);
StorePointer(&raw_ptr()->type_arguments_, value.raw());
@@ -7540,7 +7546,10 @@ class LinkedHashMap : public Instance {
return raw_ptr()->type_arguments_;
}
virtual void SetTypeArguments(const TypeArguments& value) const {
- ASSERT(value.IsNull() || ((value.Length() >= 2) && value.IsInstantiated()));
+ ASSERT(value.IsNull() ||
+ ((value.Length() >= 2) &&
+ value.IsInstantiated() &&
+ value.IsCanonical()));
StorePointer(&raw_ptr()->type_arguments_, value.raw());
}
static intptr_t type_arguments_offset() {
@@ -7681,6 +7690,7 @@ class Closure : public AllStatic {
}
static void SetTypeArguments(const Instance& closure,
const TypeArguments& value) {
+ ASSERT(value.IsNull() || value.IsCanonical());
closure.StorePointer(TypeArgumentsAddr(closure), value.raw());
}
static intptr_t type_arguments_offset() {
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698