Index: runtime/vm/heap.h |
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h |
index 4639c2602b5803deacf23486e9740704088fef84..22a109ecfece5909be36e3ea415148d391a1ae6d 100644 |
--- a/runtime/vm/heap.h |
+++ b/runtime/vm/heap.h |
@@ -42,6 +42,7 @@ class Heap { |
enum WeakSelector { |
kPeers = 0, |
kHashes, |
+ kObjectIds, |
kNumWeakSelectors |
}; |
@@ -189,6 +190,17 @@ class Heap { |
} |
int64_t HashCount() const; |
+ // Associate an id with an object (used when serializing an object). |
+ // A non-existant id is equal to 0. |
+ void SetObjectId(RawObject* raw_obj, intptr_t object_id) { |
+ SetWeakEntry(raw_obj, kObjectIds, object_id); |
+ } |
+ intptr_t GetObjectId(RawObject* raw_obj) const { |
+ return GetWeakEntry(raw_obj, kObjectIds); |
+ } |
+ int64_t ObjectIdCount() const; |
+ void ResetObjectIdTable(); |
+ |
// Used by the GC algorithms to propagate weak entries. |
intptr_t GetWeakEntry(RawObject* raw_obj, WeakSelector sel) const; |
void SetWeakEntry(RawObject* raw_obj, WeakSelector sel, intptr_t val); |