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

Unified Diff: runtime/vm/raw_object.h

Issue 10538022: Do not reuse tags_ field to store next_ pointer of FreeListElement. (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/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index a62bbd0955500234594b75ca51c56adbb9239189..460c7c641bfec10957b421dc628004f83bad8924 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -189,6 +189,8 @@ class RawObject {
kClassIdTagSize = 16
};
+ class FreeBit : public BitField<bool, kFreeBit, 1> {};
+
// Encodes the object size in the tag in units of object alignment.
class SizeTag {
public:
@@ -272,12 +274,12 @@ class RawObject {
intptr_t Size() const {
uword tags = ptr()->tags_;
intptr_t result = SizeTag::decode(tags);
- if ((result != 0) && !FreeBit::decode(tags)) {
+ if (result != 0) {
ASSERT(result == SizeFromClass());
return result;
}
result = SizeFromClass();
- ASSERT((result > SizeTag::kMaxSizeTag) || FreeBit::decode(tags));
+ ASSERT(result > SizeTag::kMaxSizeTag);
return result;
}
@@ -318,8 +320,6 @@ class RawObject {
uword tags_; // Various object tags (bits).
private:
- class FreeBit : public BitField<bool, kFreeBit, 1> {};
-
class MarkBit : public BitField<bool, kMarkBit, 1> {};
class CanonicalObjectTag : public BitField<bool, kCanonicalBit, 1> {};
@@ -336,8 +336,6 @@ class RawObject {
intptr_t GetClassId() const {
uword tags = ptr()->tags_;
- // TODO(vegorov): stop destroying tags_ when creating FreeListElement.
- ASSERT(!FreeBit::decode(tags));
return ClassIdTag::decode(tags);
}
« runtime/vm/freelist.h ('K') | « runtime/vm/freelist.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698