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

Unified Diff: runtime/vm/heap.h

Issue 2912863006: Inline instance object hash code into object header on 64 bit. (Closed)
Patch Set: Created 3 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/heap.h
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index 64b7499d7962a25f0b85cf721737264c3ca1aa5c..4f88d2202ad5e36e753de689b87e6e61de0afca7 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -33,7 +33,11 @@ class Heap {
kCode,
};
+#if defined(HASH_IN_OBJECT_HEADER)
+ enum WeakSelector { kPeers = 0, kObjectIds, kNumWeakSelectors };
+#else
enum WeakSelector { kPeers = 0, kHashes, kObjectIds, kNumWeakSelectors };
+#endif
enum ApiCallbacks { kIgnoreApiCallbacks, kInvokeApiCallbacks };
@@ -167,6 +171,7 @@ class Heap {
}
int64_t PeerCount() const;
+#if !defined(HASH_IN_OBJECT_HEADER)
// Associate an identity hashCode with an object. An non-existent hashCode
// is equal to 0.
void SetHash(RawObject* raw_obj, intptr_t hash) {
@@ -175,6 +180,7 @@ class Heap {
intptr_t GetHash(RawObject* raw_obj) const {
return GetWeakEntry(raw_obj, kHashes);
}
+#endif
int64_t HashCount() const;
// Associate an id with an object (used when serializing an object).
« no previous file with comments | « runtime/vm/become.cc ('k') | runtime/vm/heap.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698