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

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
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
===================================================================
--- runtime/vm/raw_object.h (revision 22392)
+++ runtime/vm/raw_object.h (working copy)
@@ -223,8 +223,9 @@
kMarkBit = 1,
kCanonicalBit = 2,
kFromSnapshotBit = 3,
- kReservedTagBit = 4, // kReservedBit{1K, 10K,100K,1M,10M}
- kReservedTagSize = 4,
+ kRememberedBit = 4,
+ kReservedTagBit = 5, // kReservedBit{10K,100K,1M,10M}
+ kReservedTagSize = 3,
kSizeTagBit = 8,
kSizeTagSize = 8,
kClassIdTagBit = kSizeTagBit + kSizeTagSize,
@@ -329,6 +330,20 @@
ptr()->tags_ = CreatedFromSnapshotTag::update(true, tags);
}
+ // Support for GC remembered bit.
+ bool IsRemembered() const {
+ return RememberedBit::decode(ptr()->tags_);
+ }
+ void SetRememberedBit() {
+ ASSERT(!IsRemembered());
+ uword tags = ptr()->tags_;
+ ptr()->tags_ = RememberedBit::update(true, tags);
+ }
+ void ClearRememberedBit() {
+ uword tags = ptr()->tags_;
+ ptr()->tags_ = RememberedBit::update(false, tags);
+ }
+
bool IsDartInstance() {
return (!IsHeapObject() || (GetClassId() >= kInstanceCid));
}
@@ -389,6 +404,8 @@
class MarkBit : public BitField<bool, kMarkBit, 1> {};
+ class RememberedBit : public BitField<bool, kRememberedBit, 1> {};
+
class CanonicalObjectTag : public BitField<bool, kCanonicalBit, 1> {};
class CreatedFromSnapshotTag : public BitField<bool, kFromSnapshotBit, 1> {};
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698