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

Unified Diff: runtime/vm/object.cc

Issue 2452563002: Create runtime type in new space and canonicalize to old space (fixes #27663). (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 9cbdac65e435a1b86ef574e31ebba14039616c37..959f5edb53d9a75df0fe4cc14302946e7348fbc7 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -15655,7 +15655,8 @@ RawAbstractType* Instance::GetType() const {
const Class& scope_cls = Class::Handle(type.type_class());
ASSERT(scope_cls.NumTypeArguments() > 0);
TypeArguments& type_arguments = TypeArguments::Handle(GetTypeArguments());
- type = Type::New(scope_cls, type_arguments, TokenPosition::kNoSource);
+ type = Type::New(
+ scope_cls, type_arguments, TokenPosition::kNoSource, Heap::kNew);
type.set_signature(signature);
type.SetIsFinalized();
type ^= type.Canonicalize();
@@ -17405,7 +17406,11 @@ RawAbstractType* Type::Canonicalize(TrailPtr trail) const {
type ^= table.GetOrNull(CanonicalTypeKey(*this));
if (type.IsNull()) {
// Add this Type into the canonical list of types.
- type ^= raw();
+ if (this->IsNew()) {
+ type ^= Object::Clone(*this, Heap::kOld);
+ } else {
+ type ^= this->raw();
+ }
ASSERT(type.IsOld());
type.SetCanonical(); // Mark object as being canonical.
bool present = table.Insert(type);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698