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

Unified Diff: vm/raw_object.cc

Issue 8727015: - Ignore marking bits when visiting pointers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years, 1 month 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: vm/raw_object.cc
===================================================================
--- vm/raw_object.cc (revision 1880)
+++ vm/raw_object.cc (working copy)
@@ -150,10 +150,20 @@
ASSERT(IsHeapObject());
// Read the necessary data out of the class before visting the class itself.
- ObjectKind kind = ptr()->class_->ptr()->instance_kind_;
+ RawClass* raw_class = ptr()->class_;
+ if (IsMarked()) {
+ // If the object is marked we need to remove the marking bits from the
+ // raw_class which we loaded above.
+ uword header_bits = reinterpret_cast<uword>(raw_class);
+ header_bits = (header_bits & ~kMarkingMask) | kNotMarked;
+ raw_class = reinterpret_cast<RawClass*>(header_bits);
+ }
+ ObjectKind kind = raw_class->ptr()->instance_kind_;
// Visit the class before visting the fields.
- visitor->VisitPointer(reinterpret_cast<RawObject**>(&ptr()->class_));
+ if (!IsMarked()) {
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(&ptr()->class_));
+ }
switch (kind) {
#define RAW_VISITPOINTERS(clazz) \
« 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