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

Unified Diff: runtime/vm/object.cc

Issue 10521004: Eliminate RawObject::class_ field entirely. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 4eb4155997db22a0b268f4e955aeca970f794f4d..b8390b460102f8981ea8df351aa2cd198a9d5bcd 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -272,8 +272,6 @@ void Object::InitOnce() {
uword address = heap->Allocate(size, Heap::kOld);
class_class_ = reinterpret_cast<RawClass*>(address + kHeapObjectTag);
InitializeObject(address, Class::kInstanceKind, size);
- // Make the class_ field point to itself.
- class_class_->ptr()->class_ = class_class_;
Class fake;
// Initialization from Class::New<Class>.
@@ -300,10 +298,6 @@ void Object::InitOnce() {
cls.set_is_finalized();
null_class_ = cls.raw();
- // Complete initialization of null_ instance, i.e. initialize its class_
- // field.
- null_->ptr()->class_ = null_class_;
-
// Allocate and initialize the sentinel values of Null class.
{
cls = null_class_;
@@ -995,7 +989,6 @@ RawObject* Object::Allocate(const Class& cls,
NoGCScope no_gc;
InitializeObject(address, cls.id(), size);
RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);
- raw_obj->ptr()->class_ = cls.raw();
ASSERT(cls.id() == RawObject::ClassIdTag::decode(raw_obj->ptr()->tags_));
return raw_obj;
}
@@ -9033,7 +9026,6 @@ void Array::MakeImmutable() const {
isolate, isolate->object_store()->immutable_array_class());
{
NoGCScope no_gc;
- raw_ptr()->class_ = cls.raw();
uword tags = raw_ptr()->tags_;
tags = RawObject::ClassIdTag::update(cls.id(), tags);
raw_ptr()->tags_ = tags;
@@ -9104,7 +9096,6 @@ RawArray* Array::MakeArray(const GrowableObjectArray& growable_array) {
// space as an Array object.
RawArray* raw = reinterpret_cast<RawArray*>(RawObject::FromAddr(addr));
const Class& cls = Class::Handle(isolate->object_store()->array_class());
- raw->ptr()->class_ = cls.raw();
tags = 0;
tags = RawObject::SizeTag::update(leftover_size, tags);
tags = RawObject::ClassIdTag::update(cls.id(), tags);
@@ -9118,7 +9109,6 @@ RawArray* Array::MakeArray(const GrowableObjectArray& growable_array) {
ASSERT(leftover_size == Object::InstanceSize());
RawObject* raw = reinterpret_cast<RawObject*>(RawObject::FromAddr(addr));
const Class& cls = Class::Handle(isolate->object_store()->object_class());
- raw->ptr()->class_ = cls.raw();
tags = 0;
tags = RawObject::SizeTag::update(leftover_size, tags);
tags = RawObject::ClassIdTag::update(cls.id(), tags);

Powered by Google App Engine
This is Rietveld 408576698