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

Unified Diff: runtime/vm/scavenger.cc

Issue 10521004: Eliminate RawObject::class_ field entirely. (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/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index b469d5fe2959d4beaf0cc5ffc7573e381e47c93b..3975c9d1aaefcaa7aba794fb0914051c0cf520ae 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -14,10 +14,14 @@
namespace dart {
+// Scavenger uses RawObject::kFreeBit to distinguish forwaded and non-forwarded
+// objects because scavenger can never encounter free list element during
+// evacuation and thus all objects scavenger encounters have
+// kFreeBit cleared.
enum {
- kForwardingMask = 3,
- kNotForwarded = 1, // Tagged pointer.
- kForwarded = 3, // Tagged pointer and forwarding bit set.
+ kForwardingMask = 1,
+ kNotForwarded = 0,
+ kForwarded = 1,
};
@@ -157,6 +161,11 @@ Scavenger::Scavenger(Heap* heap, intptr_t max_capacity, uword object_alignment)
object_alignment_(object_alignment),
count_(0),
scavenging_(false) {
+ // Verify assumptions about the first word in objects that scavenger is going
Ivan Posva 2012/06/06 13:42:11 objects which the scavenger
+ // to use for forwarding pointers.
+ ASSERT(Object::tags_offset() == 0);
+ ASSERT(kForwardingMask == (1 << RawObject::kFreeBit));
+
// Allocate the virtual memory for this scavenge heap.
space_ = VirtualMemory::Reserve(max_capacity);
ASSERT(space_ != NULL);

Powered by Google App Engine
This is Rietveld 408576698