From: mikhail.naganov@gmail.com Date: Mon, 26 Sep 2011 15:59:27 +0000 (+0000) Subject: Add ObjectMoveEvent reporting for the Heap Profiler into MarkCompact. X-Git-Tag: upstream/4.7.83~18358 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5946d78c55c29878eaffa20e83d2aee0c838498;p=platform%2Fupstream%2Fv8.git 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 --- diff --git a/src/mark-compact.cc b/src/mark-compact.cc index b90ecf069..117da368e 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -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; diff --git a/src/profile-generator.cc b/src/profile-generator.cc index c075c031e..c1052e652 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -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; + } } }