Commit 5fc90eb3 authored by ager@chromium.org's avatar ager@chromium.org

Pass in isolate when reporting deletion of objects.

R=erik.corry@gmail.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5c3b4224
...@@ -1690,7 +1690,7 @@ inline void EncodeForwardingAddressInPagedSpace(Heap* heap, ...@@ -1690,7 +1690,7 @@ inline void EncodeForwardingAddressInPagedSpace(Heap* heap,
// Most non-live objects are ignored. // 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 // Function template that, given a range of addresses (eg, a semispace or a
...@@ -1744,7 +1744,7 @@ inline void EncodeForwardingAddressesInRange(MarkCompactCollector* collector, ...@@ -1744,7 +1744,7 @@ inline void EncodeForwardingAddressesInRange(MarkCompactCollector* collector,
} }
} else { // Non-live object. } else { // Non-live object.
object_size = object->Size(); object_size = object->Size();
ProcessNonLive(object); ProcessNonLive(object, collector->heap()->isolate());
if (is_prev_alive) { // Transition from live to non-live. if (is_prev_alive) { // Transition from live to non-live.
free_start = current; free_start = current;
is_prev_alive = false; is_prev_alive = false;
...@@ -2089,7 +2089,8 @@ static void SweepSpace(Heap* heap, PagedSpace* space) { ...@@ -2089,7 +2089,8 @@ static void SweepSpace(Heap* heap, PagedSpace* space) {
is_previous_alive = true; is_previous_alive = true;
} }
} else { } else {
heap->mark_compact_collector()->ReportDeleteIfNeeded(object); heap->mark_compact_collector()->ReportDeleteIfNeeded(
object, heap->isolate());
if (is_previous_alive) { // Transition from live to free. if (is_previous_alive) { // Transition from live to free.
free_start = current; free_start = current;
is_previous_alive = false; is_previous_alive = false;
...@@ -3046,7 +3047,8 @@ void MarkCompactCollector::EnableCodeFlushing(bool enable) { ...@@ -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 #ifdef ENABLE_GDB_JIT_INTERFACE
if (obj->IsCode()) { if (obj->IsCode()) {
GDBJITInterface::RemoveCode(reinterpret_cast<Code*>(obj)); GDBJITInterface::RemoveCode(reinterpret_cast<Code*>(obj));
...@@ -3054,7 +3056,7 @@ void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) { ...@@ -3054,7 +3056,7 @@ void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) {
#endif #endif
#ifdef ENABLE_LOGGING_AND_PROFILING #ifdef ENABLE_LOGGING_AND_PROFILING
if (obj->IsCode()) { if (obj->IsCode()) {
PROFILE(ISOLATE, CodeDeleteEvent(obj->address())); PROFILE(isolate, CodeDeleteEvent(obj->address()));
} }
#endif #endif
} }
......
...@@ -129,7 +129,7 @@ class MarkCompactCollector { ...@@ -129,7 +129,7 @@ class MarkCompactCollector {
int* offset); int* offset);
// Type of functions to process non-live objects. // 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. // Pointer to member function, used in IterateLiveObjects.
typedef int (MarkCompactCollector::*LiveObjectCallback)(HeapObject* obj); typedef int (MarkCompactCollector::*LiveObjectCallback)(HeapObject* obj);
...@@ -179,7 +179,7 @@ class MarkCompactCollector { ...@@ -179,7 +179,7 @@ class MarkCompactCollector {
#endif #endif
// Determine type of object and emit deletion log event. // 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. // Returns size of a possibly marked object.
static int SizeOfMarkedObject(HeapObject* obj); static int SizeOfMarkedObject(HeapObject* obj);
......
...@@ -3014,7 +3014,8 @@ void LargeObjectSpace::FreeUnmarkedObjects() { ...@@ -3014,7 +3014,8 @@ void LargeObjectSpace::FreeUnmarkedObjects() {
} }
// Free the chunk. // Free the chunk.
heap()->mark_compact_collector()->ReportDeleteIfNeeded(object); heap()->mark_compact_collector()->ReportDeleteIfNeeded(
object, heap()->isolate());
LiveObjectList::ProcessNonLive(object); LiveObjectList::ProcessNonLive(object);
size_ -= static_cast<int>(chunk_size); size_ -= static_cast<int>(chunk_size);
......
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