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

Unified Diff: runtime/vm/object.h

Issue 10444091: Avoid reading RawObject::class_ directly in the runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 31c0fbc4a3ca519100ab126baa8ed6fe59535243..d6b2516cee60f8f4e6a06af88ec7eaa59c1f41a9 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -4886,12 +4886,7 @@ RawClass* Object::clazz() const {
if ((raw_value & kSmiTagMask) == kSmiTag) {
return Smi::Class();
}
- RawClass* result = raw_->ptr()->class_;
- ASSERT(result->ptr()->index_ ==
- RawObject::ClassTag::decode(raw_->ptr()->tags_));
- ASSERT(Isolate::Current()->class_table()->At(
- RawObject::ClassTag::decode(raw_->ptr()->tags_)) == result);
- return result;
+ return Isolate::Current()->class_table()->At(raw()->GetClassIndex());
}
@@ -4910,8 +4905,13 @@ void Object::SetRaw(RawObject* value) {
ASSERT(isolate_heap->Contains(reinterpret_cast<uword>(raw_->ptr())) ||
vm_isolate_heap->Contains(reinterpret_cast<uword>(raw_->ptr())));
#endif
- set_vtable((raw_ == null_) ?
- handle_vtable_ : raw_->ptr()->class_->ptr()->handle_vtable_);
+ if (raw_ == null_) {
+ set_vtable(handle_vtable_);
+ } else {
+ RawClass* raw_class =
+ Isolate::Current()->class_table()->At(raw_->GetClassIndex());
+ set_vtable(raw_class->ptr()->handle_vtable_);
+ }
}
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/raw_object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698