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

Unified Diff: runtime/vm/become.cc

Issue 2912863006: Inline instance object hash code into object header on 64 bit. (Closed)
Patch Set: Use visitor to give objects in VM isolate hash codes. 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
« no previous file with comments | « runtime/vm/become.h ('k') | runtime/vm/heap.h » ('j') | runtime/vm/heap.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/become.cc
diff --git a/runtime/vm/become.cc b/runtime/vm/become.cc
index 0fddef218f80624f6e39e8f8d80266c4805453ef..7704a4abb61a4b039fb5b1cbc97acd06f4af3c95 100644
--- a/runtime/vm/become.cc
+++ b/runtime/vm/become.cc
@@ -262,12 +262,16 @@ void Become::ElementsForwardIdentity(const Array& before, const Array& after) {
ForwardObjectTo(before_obj, after_obj);
+#if defined(HASH_IN_OBJECT_HEADER)
+ Object::SetCachedHash(after_obj, Object::GetCachedHash(before_obj));
+#else
// Forward the identity hash too if it has one.
intptr_t hash = heap->GetHash(before_obj);
if (hash != 0) {
ASSERT(heap->GetHash(after_obj) == 0);
heap->SetHash(after_obj, hash);
}
+#endif
}
{
« no previous file with comments | « runtime/vm/become.h ('k') | runtime/vm/heap.h » ('j') | runtime/vm/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698