Add ObjectMoveEvent reporting for the Heap Profiler into MarkCompact.

R=vegorov@chromium.org
BUG=none
TEST=none

Review URL: http://codereview.chromium.org/8036024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9432 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 16ae2551
......@@ -2367,6 +2367,7 @@ void MarkCompactCollector::MigrateObject(Address dst,
Address src,
int size,
AllocationSpace dest) {
HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst));
if (dest == OLD_POINTER_SPACE || dest == LO_SPACE) {
Address src_slot = src;
Address dst_slot = dst;
......
......@@ -1403,10 +1403,12 @@ void HeapObjectsMap::MoveObject(Address from, Address to) {
if (entry != NULL) {
void* value = entry->value;
entries_map_.Remove(from, AddressHash(from));
entry = entries_map_.Lookup(to, AddressHash(to), true);
// 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;
if (to != NULL) {
entry = entries_map_.Lookup(to, AddressHash(to), true);
// 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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment