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

Unified Diff: src/profile-generator.cc

Issue 2861051: Fix TestHeapEntryIdsAndGC test. The assert was wrong. (Closed)
Patch Set: Created 10 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index 4e0cb7111ba5dffba88e5e79c04ba95f97314349..9ec6b7d2d0b90eca556853ceec787d4036e5324d 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -1533,12 +1533,14 @@ uint64_t HeapObjectsMap::FindObject(Address addr) {
void HeapObjectsMap::MoveObject(Address from, Address to) {
+ if (from == to) return;
HashMap::Entry* entry = entries_map_.Lookup(from, AddressHash(from), false);
if (entry != NULL) {
void* value = entry->value;
entries_map_.Remove(from, AddressHash(from));
entry = entries_map_.Lookup(to, AddressHash(to), true);
- ASSERT(entry->value == NULL);
+ // We can have an entry at the new location, it is OK, as GC can overwrite
+ // dead objects with alive objects being moved.
entry->value = value;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698