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

Unified Diff: vm/snapshot.cc

Issue 9965042: - Add a class index to the classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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: vm/snapshot.cc
===================================================================
--- vm/snapshot.cc (revision 6994)
+++ vm/snapshot.cc (working copy)
@@ -219,7 +219,6 @@
cls_ = Object::class_class();
RawClass* obj = reinterpret_cast<RawClass*>(
AllocateUninitialized(cls_, Class::InstanceSize()));
- obj->ptr()->instance_kind_ = object_kind;
if (object_kind == kInstance) {
Instance fake;
obj->ptr()->handle_vtable_ = fake.vtable();
@@ -227,7 +226,11 @@
Closure fake;
obj->ptr()->handle_vtable_ = fake.vtable();
}
- return obj;
+ cls_ = obj;
+ cls_.set_instance_kind(object_kind);
+ cls_.set_index(kIllegalObjectKind);
+ isolate()->class_table()->Register(cls_);
+ return cls_.raw();
}
return Class::GetClass(object_kind);
}
@@ -363,6 +366,9 @@
RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);
raw_obj->ptr()->class_ = cls.raw();
uword tags = 0;
+ intptr_t index = cls.index();
+ ASSERT(index != kIllegalObjectKind);
+ tags = RawObject::ClassTag::update(index, tags);
tags = RawObject::SizeTag::update(size, tags);
raw_obj->ptr()->tags_ = tags;
return raw_obj;
« vm/raw_object.cc ('K') | « vm/raw_object.cc ('k') | vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698