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

Unified Diff: runtime/vm/raw_object.h

Issue 10450014: Request for comments on overall approach. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix scavenger and freelist handling Created 8 years, 7 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 db7191d1b36e7c9c9bfde9c4fea7d296ae6bd181..d5a3129600bd7a747d98be74463cbca7445dc891 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -236,6 +236,10 @@ class RawObject {
return (addr & kNewObjectAlignmentOffset) == kOldObjectAlignmentOffset;
}
+ bool IsFree() const {
+ return FreeBit::decode(ptr()->tags_);
+ }
+
// Support for GC marking bit.
bool IsMarked() const {
return MarkBit::decode(ptr()->tags_);
@@ -312,8 +316,15 @@ class RawObject {
static bool IsBuiltinListClassIndex(intptr_t index);
static bool IsByteArrayClassIndex(intptr_t index);
+ RawClass* GetClass() const {
+ return GetClass(ptr()->tags_);
Ivan Posva 2012/05/26 04:34:46 If anything then all we should have here is GetCla
Vyacheslav Egorov (Google) 2012/05/26 16:48:22 Will do.
+ }
+
+ static RawClass* GetClass(uword tags);
Ivan Posva 2012/05/26 04:34:46 Does not belong here. Please move to Object, or Cl
Vyacheslav Egorov (Google) 2012/05/26 16:48:22 Will do.
+
+ class CreatedFromSnapshotTag : public BitField<bool, kFromSnapshotBit, 1> {};
+
protected:
- RawClass* class_;
uword tags_; // Various object tags (bits).
private:
@@ -323,7 +334,6 @@ class RawObject {
class CanonicalObjectTag : public BitField<bool, kCanonicalBit, 1> {};
- class CreatedFromSnapshotTag : public BitField<bool, kFromSnapshotBit, 1> {};
RawObject* ptr() const {
ASSERT(IsHeapObject());
@@ -401,6 +411,7 @@ class RawClass : public RawObject {
friend class RawInstructions;
friend RawClass* AllocateFakeClass();
friend class SnapshotReader;
+ friend class ClassTable;
};

Powered by Google App Engine
This is Rietveld 408576698