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

Unified Diff: runtime/vm/raw_object.h

Issue 14307013: - Remember the fact that an object has been added to the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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: 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> {};
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | runtime/vm/stub_code_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698