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 |
} |
{ |