| Index: src/heap-inl.h
|
| ===================================================================
|
| --- src/heap-inl.h (revision 10927)
|
| +++ src/heap-inl.h (working copy)
|
| @@ -433,8 +433,10 @@
|
| }
|
|
|
|
|
| -bool Heap::CollectGarbage(AllocationSpace space) {
|
| - return CollectGarbage(space, SelectGarbageCollector(space));
|
| +bool Heap::CollectGarbage(AllocationSpace space, const char* gc_reason) {
|
| + const char* collector_reason = NULL;
|
| + GarbageCollector collector = SelectGarbageCollector(space, &collector_reason);
|
| + return CollectGarbage(space, collector, gc_reason, collector_reason);
|
| }
|
|
|
|
|
| @@ -469,7 +471,7 @@
|
| amount_of_external_allocated_memory_ -
|
| amount_of_external_allocated_memory_at_last_global_gc_;
|
| if (amount_since_last_global_gc > external_allocation_limit_) {
|
| - CollectAllGarbage(kNoGCFlags);
|
| + CollectAllGarbage(kNoGCFlags, "external memory allocation limit reached");
|
| }
|
| } else {
|
| // Avoid underflow.
|
| @@ -518,7 +520,8 @@
|
| } \
|
| if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY; \
|
| ISOLATE->heap()->CollectGarbage(Failure::cast(__maybe_object__)-> \
|
| - allocation_space()); \
|
| + allocation_space(), \
|
| + "allocation failure"); \
|
| __maybe_object__ = FUNCTION_CALL; \
|
| if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE; \
|
| if (__maybe_object__->IsOutOfMemory()) { \
|
| @@ -526,7 +529,7 @@
|
| } \
|
| if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY; \
|
| ISOLATE->counters()->gc_last_resort_from_handles()->Increment(); \
|
| - ISOLATE->heap()->CollectAllAvailableGarbage(); \
|
| + ISOLATE->heap()->CollectAllAvailableGarbage("last resort gc"); \
|
| { \
|
| AlwaysAllocateScope __scope__; \
|
| __maybe_object__ = FUNCTION_CALL; \
|
|
|