Fix TestHeapEntryIdsAndGC test. The assert was wrong.
TBR=ager@chromium.org Review URL: http://codereview.chromium.org/2861051 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5082 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
3471e873ab
commit
f2cf990de2
@ -1533,12 +1533,14 @@ uint64_t HeapObjectsMap::FindObject(Address addr) {
|
|||||||
|
|
||||||
|
|
||||||
void HeapObjectsMap::MoveObject(Address from, Address to) {
|
void HeapObjectsMap::MoveObject(Address from, Address to) {
|
||||||
|
if (from == to) return;
|
||||||
HashMap::Entry* entry = entries_map_.Lookup(from, AddressHash(from), false);
|
HashMap::Entry* entry = entries_map_.Lookup(from, AddressHash(from), false);
|
||||||
if (entry != NULL) {
|
if (entry != NULL) {
|
||||||
void* value = entry->value;
|
void* value = entry->value;
|
||||||
entries_map_.Remove(from, AddressHash(from));
|
entries_map_.Remove(from, AddressHash(from));
|
||||||
entry = entries_map_.Lookup(to, AddressHash(to), true);
|
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;
|
entry->value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user