Index: runtime/vm/raw_object.h |
=================================================================== |
--- runtime/vm/raw_object.h (revision 44565) |
+++ runtime/vm/raw_object.h (working copy) |
@@ -395,6 +395,7 @@ |
return ((GetClassId() == kFreeListElement)); |
} |
+ // Uses the class table of the current isolate, when needed. |
intptr_t Size() const { |
uword tags = ptr()->tags_; |
intptr_t result = SizeTag::decode(tags); |
@@ -407,6 +408,19 @@ |
return result; |
} |
+ // Like above, but avoids Thread/Isolate::Current. |
+ intptr_t Size(const ClassTable* class_table) const { |
+ uword tags = ptr()->tags_; |
+ intptr_t result = SizeTag::decode(tags); |
+ if (result != 0) { |
+ ASSERT(result == SizeFromClass(class_table)); |
+ return result; |
+ } |
+ result = SizeFromClass(class_table); |
+ ASSERT(result > SizeTag::kMaxSizeTag); |
+ return result; |
+ } |
+ |
bool Contains(uword addr) const { |
intptr_t this_size = Size(); |
uword this_addr = RawObject::ToAddr(this); |
@@ -477,6 +491,7 @@ |
} |
intptr_t SizeFromClass() const; |
+ intptr_t SizeFromClass(const ClassTable* class_table) const; |
intptr_t GetClassId() const { |
uword tags = ptr()->tags_; |