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, ...@@ -2367,6 +2367,7 @@ void MarkCompactCollector::MigrateObject(Address dst,
Address src, Address src,
int size, int size,
AllocationSpace dest) { AllocationSpace dest) {
HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst));
if (dest == OLD_POINTER_SPACE || dest == LO_SPACE) { if (dest == OLD_POINTER_SPACE || dest == LO_SPACE) {
Address src_slot = src; Address src_slot = src;
Address dst_slot = dst; Address dst_slot = dst;
......
...@@ -1403,10 +1403,12 @@ void HeapObjectsMap::MoveObject(Address from, Address to) { ...@@ -1403,10 +1403,12 @@ void HeapObjectsMap::MoveObject(Address from, Address to) {
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); if (to != NULL) {
// We can have an entry at the new location, it is OK, as GC can overwrite entry = entries_map_.Lookup(to, AddressHash(to), true);
// dead objects with alive objects being moved. // We can have an entry at the new location, it is OK, as GC can overwrite
entry->value = value; // 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