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

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: address comments Created 4 years, 11 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') | no next file with comments »
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..1ebe8314f305b61fe85f7a25312ee6b621e6403e 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -6829,7 +6829,11 @@ 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()*/));
+ // TODO(asiva): Values read from a message snapshot are not properly marked
+ // as canonical. See for example tests/isolate/mandel_isolate_test.dart.
StorePointer(&raw_ptr()->type_arguments_, value.raw());
}
@@ -6992,7 +6996,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 +7547,11 @@ 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()*/));
+ // TODO(asiva): Values read from a message snapshot are not properly marked
+ // as canonical. See for example tests/isolate/message3_test.dart.
StorePointer(&raw_ptr()->type_arguments_, value.raw());
}
static intptr_t type_arguments_offset() {
@@ -7681,6 +7692,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698