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

Unified Diff: runtime/vm/raw_object.cc

Issue 2026643004: Don't overload FreeListElement for become. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/raw_object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.cc
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index cc880e94ff1e6a9295ca3c5f13b4839657b9571c..8f92e9dfae0e1cd5d592891c5fb1eaa562b3969c 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -4,6 +4,7 @@
#include "vm/raw_object.h"
+#include "vm/become.h"
#include "vm/class_table.h"
#include "vm/dart.h"
#include "vm/freelist.h"
@@ -177,6 +178,12 @@ intptr_t RawObject::SizeFromClass() const {
instance_size = element->Size();
break;
}
+ case kForwardingCorpse: {
+ uword addr = RawObject::ToAddr(this);
+ ForwardingCorpse* element = reinterpret_cast<ForwardingCorpse*>(addr);
+ instance_size = element->Size();
+ break;
+ }
default: {
// Get the (constant) instance size out of the class object.
// TODO(koda): Add Size(ClassTable*) interface to allow caching in loops.
@@ -288,6 +295,12 @@ intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) {
size = element->Size();
break;
}
+ case kForwardingCorpse: {
+ uword addr = RawObject::ToAddr(this);
+ ForwardingCorpse* forwarder = reinterpret_cast<ForwardingCorpse*>(addr);
+ size = forwarder->Size();
+ break;
+ }
case kNullCid:
size = Size();
break;
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698