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

Unified Diff: src/mark-compact.cc

Issue 552089: A follow-up to fix 553: really report function object moves. (Closed)
Patch Set: Add an assertion to test Created 10 years, 11 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 | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index e9afdce9c5abe2177aa9dafd209ddae851822c3a..339ead46430c716714707aa35309c7ee66ba6720 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1195,7 +1195,7 @@ void MarkCompactCollector::EncodeForwardingAddresses() {
// Compute the forwarding pointers in each space.
EncodeForwardingAddressesInPagedSpace<MCAllocateFromOldPointerSpace,
- IgnoreNonLiveObject>(
+ ReportDeleteIfNeeded>(
Heap::old_pointer_space());
EncodeForwardingAddressesInPagedSpace<MCAllocateFromOldDataSpace,
@@ -1900,6 +1900,11 @@ int MarkCompactCollector::RelocateOldNonCodeObject(HeapObject* obj,
ASSERT(!HeapObject::FromAddress(new_addr)->IsCode());
+ HeapObject* copied_to = HeapObject::FromAddress(new_addr);
+ if (copied_to->IsJSFunction()) {
+ LOG(FunctionMoveEvent(old_addr, new_addr));
+ }
+
return obj_size;
}
@@ -1943,8 +1948,6 @@ int MarkCompactCollector::RelocateCodeObject(HeapObject* obj) {
Code::cast(copied_to)->Relocate(new_addr - old_addr);
// Notify the logger that compiled code has moved.
LOG(CodeMoveEvent(old_addr, new_addr));
- } else if (copied_to->IsJSFunction()) {
- LOG(FunctionMoveEvent(old_addr, new_addr));
}
return obj_size;
@@ -1982,6 +1985,11 @@ int MarkCompactCollector::RelocateNewObject(HeapObject* obj) {
}
#endif
+ HeapObject* copied_to = HeapObject::FromAddress(new_addr);
+ if (copied_to->IsJSFunction()) {
+ LOG(FunctionMoveEvent(old_addr, new_addr));
+ }
+
return obj_size;
}
« no previous file with comments | « no previous file | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698