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

Unified Diff: runtime/vm/heap.h

Issue 1399783002: Add a hash map for a raw object to id mapping, this table will be used during snapshot writing in o… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 5 years, 2 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 | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698