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

Unified Diff: runtime/vm/become.cc

Issue 2954453002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Incorporate last minute code review feedback Created 3 years, 6 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/clustered_snapshot.cc » ('j') | no next file with comments »
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..142169aae76bbfea2a4015231046f0ca29223134 100644
--- a/runtime/vm/become.cc
+++ b/runtime/vm/become.cc
@@ -23,7 +23,7 @@ ForwardingCorpse* ForwardingCorpse::AsForwarder(uword addr, intptr_t size) {
ForwardingCorpse* result = reinterpret_cast<ForwardingCorpse*>(addr);
- uword tags = 0;
+ uint32_t tags = 0;
tags = RawObject::SizeTag::update(size, tags);
tags = RawObject::ClassIdTag::update(kForwardingCorpse, tags);
@@ -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/clustered_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698