Chromium Code Reviews| Index: runtime/vm/raw_object.h |
| =================================================================== |
| --- runtime/vm/raw_object.h (revision 22083) |
| +++ runtime/vm/raw_object.h (working copy) |
| @@ -224,8 +224,9 @@ |
| kCanonicalBit = 2, |
| kFromSnapshotBit = 3, |
| kWatchedBit = 4, |
|
siva
2013/04/27 00:49:37
The WatchedBit is only used during GC right so we
|
| - kReservedTagBit = 5, // kReservedBit{10K,100K,1M,10M} |
| - kReservedTagSize = 3, |
| + kRememberedBit = 5, |
| + kReservedTagBit = 6, // kReservedBit{10K,100K,1M,10M} |
| + kReservedTagSize = 2, |
| kSizeTagBit = 8, |
| kSizeTagSize = 8, |
| kClassIdTagBit = kSizeTagBit + kSizeTagSize, |
| @@ -299,19 +300,18 @@ |
| ptr()->tags_ = MarkBit::update(false, tags); |
| } |
| - // Support for GC watched bit. |
| - bool IsWatched() const { |
| - return WatchedBit::decode(ptr()->tags_); |
| + // Support for remembered bit. |
| + bool IsRemembered() const { |
| + return RememberedBit::decode(ptr()->tags_); |
| } |
| - void SetWatchedBit() { |
| - ASSERT(!IsWatched()); |
| + void SetRememberedBit() { |
| + ASSERT(!IsRemembered()); |
| uword tags = ptr()->tags_; |
| - ptr()->tags_ = WatchedBit::update(true, tags); |
| + ptr()->tags_ = RememberedBit::update(true, tags); |
| } |
| - void ClearWatchedBit() { |
| - ASSERT(IsWatched()); |
| + void ClearRememberedBit() { |
| uword tags = ptr()->tags_; |
| - ptr()->tags_ = WatchedBit::update(false, tags); |
| + ptr()->tags_ = RememberedBit::update(false, tags); |
| } |
| // Support for object tags. |
| @@ -330,6 +330,21 @@ |
| ptr()->tags_ = CreatedFromSnapshotTag::update(true, tags); |
| } |
| + // Support for GC watched bit. |
| + bool IsWatched() const { |
| + return WatchedBit::decode(ptr()->tags_); |
| + } |
| + void SetWatchedBit() { |
| + ASSERT(!IsWatched()); |
| + uword tags = ptr()->tags_; |
| + ptr()->tags_ = WatchedBit::update(true, tags); |
| + } |
| + void ClearWatchedBit() { |
| + ASSERT(IsWatched()); |
| + uword tags = ptr()->tags_; |
| + ptr()->tags_ = WatchedBit::update(false, tags); |
| + } |
| + |
| bool IsDartInstance() { |
| return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); |
| } |
| @@ -386,10 +401,10 @@ |
| private: |
| uword tags_; // Various object tags (bits). |
| - class FreeBit : public BitField<bool, kFreeBit, 1> {}; |
| - |
| class MarkBit : public BitField<bool, kMarkBit, 1> {}; |
| + class RememberedBit : public BitField<bool, kRememberedBit, 1> {}; |
| + |
| class WatchedBit : public BitField<bool, kWatchedBit, 1> {}; |
| class CanonicalObjectTag : public BitField<bool, kCanonicalBit, 1> {}; |