Reviewers: Erik Corry,
Description:
Pass in isolate when reporting deletion of objects.
[email protected]
Please review this at http://codereview.chromium.org/6756021/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/mark-compact.h
M src/mark-compact.cc
M src/spaces.cc
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index
6e0dbf16cc3b8c5e35b8d15af314ff55e7549d36..38f9239b781984780c1f67e8141411fb2e2f41f9
100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1690,7 +1690,7 @@ inline void EncodeForwardingAddressInPagedSpace(Heap*
heap,
// Most non-live objects are ignored.
-inline void IgnoreNonLiveObject(HeapObject* object) {}
+inline void IgnoreNonLiveObject(HeapObject* object, Isolate* isolate) {}
// Function template that, given a range of addresses (eg, a semispace or a
@@ -1744,7 +1744,7 @@ inline void
EncodeForwardingAddressesInRange(MarkCompactCollector* collector,
}
} else { // Non-live object.
object_size = object->Size();
- ProcessNonLive(object);
+ ProcessNonLive(object, collector->heap()->isolate());
if (is_prev_alive) { // Transition from live to non-live.
free_start = current;
is_prev_alive = false;
@@ -2089,7 +2089,8 @@ static void SweepSpace(Heap* heap, PagedSpace* space)
{
is_previous_alive = true;
}
} else {
- heap->mark_compact_collector()->ReportDeleteIfNeeded(object);
+ heap->mark_compact_collector()->ReportDeleteIfNeeded(
+ object, heap->isolate());
if (is_previous_alive) { // Transition from live to free.
free_start = current;
is_previous_alive = false;
@@ -3046,7 +3047,8 @@ void MarkCompactCollector::EnableCodeFlushing(bool
enable) {
}
-void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) {
+void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj,
+ Isolate* isolate) {
#ifdef ENABLE_GDB_JIT_INTERFACE
if (obj->IsCode()) {
GDBJITInterface::RemoveCode(reinterpret_cast<Code*>(obj));
@@ -3054,7 +3056,7 @@ void
MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) {
#endif
#ifdef ENABLE_LOGGING_AND_PROFILING
if (obj->IsCode()) {
- PROFILE(ISOLATE, CodeDeleteEvent(obj->address()));
+ PROFILE(isolate, CodeDeleteEvent(obj->address()));
}
#endif
}
Index: src/mark-compact.h
diff --git a/src/mark-compact.h b/src/mark-compact.h
index
3c9d28ba5352c98b3807ff7e7f04a856a83203cd..35c71fa8fbbc3b30752017bc4d1893fc90b76121
100644
--- a/src/mark-compact.h
+++ b/src/mark-compact.h
@@ -129,7 +129,7 @@ class MarkCompactCollector {
int* offset);
// Type of functions to process non-live objects.
- typedef void (*ProcessNonLiveFunction)(HeapObject* object);
+ typedef void (*ProcessNonLiveFunction)(HeapObject* object, Isolate*
isolate);
// Pointer to member function, used in IterateLiveObjects.
typedef int (MarkCompactCollector::*LiveObjectCallback)(HeapObject* obj);
@@ -179,7 +179,7 @@ class MarkCompactCollector {
#endif
// Determine type of object and emit deletion log event.
- static void ReportDeleteIfNeeded(HeapObject* obj);
+ static void ReportDeleteIfNeeded(HeapObject* obj, Isolate* isolate);
// Returns size of a possibly marked object.
static int SizeOfMarkedObject(HeapObject* obj);
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index
20700e1ddb3f5aa5d4bf40f629a8277efcf5a797..eb4fa7d8e5a1109337ee26ad24d76b8d8d79a3de
100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -3014,7 +3014,8 @@ void LargeObjectSpace::FreeUnmarkedObjects() {
}
// Free the chunk.
- heap()->mark_compact_collector()->ReportDeleteIfNeeded(object);
+ heap()->mark_compact_collector()->ReportDeleteIfNeeded(
+ object, heap()->isolate());
LiveObjectList::ProcessNonLive(object);
size_ -= static_cast<int>(chunk_size);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev