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

Unified Diff: runtime/vm/become.cc

Issue 2259013002: Become: Also forward identity hashes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 4 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/isolate_reload_test.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 0850584e86ce0431ef41917da73ad5bf34bf9d45..5424805bb65ec83d4f20d46eff2529edfe15127d 100644
--- a/runtime/vm/become.cc
+++ b/runtime/vm/become.cc
@@ -261,6 +261,13 @@ void Become::ElementsForwardIdentity(const Array& before, const Array& after) {
}
ForwardObjectTo(before_obj, after_obj);
+
+ // 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);
+ }
siva 2016/08/19 00:08:15 How does this work for internal VM objects, for ex
rmacnak 2016/08/19 00:16:54 A String's usual hash is the one inline in the obj
}
{
« no previous file with comments | « no previous file | runtime/vm/isolate_reload_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698