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

Unified Diff: src/heap/heap-inl.h

Issue 1104113002: Do more to avoid last-resort stop-the-world GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index 426e4326331cd84ced6fd02fc02deb00f3f1a912..d07025d432b6737a29d1f6b841b87d175f7f2b7c 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -538,10 +538,18 @@ Isolate* Heap::isolate() {
AllocationResult __allocation__ = FUNCTION_CALL; \
Object* __object__ = NULL; \
RETURN_OBJECT_UNLESS_RETRY(ISOLATE, RETURN_VALUE) \
+ bool __scavenge__ = (__allocation__.RetrySpace() == NEW_SPACE); \
(ISOLATE)->heap()->CollectGarbage(__allocation__.RetrySpace(), \
"allocation failure"); \
__allocation__ = FUNCTION_CALL; \
RETURN_OBJECT_UNLESS_RETRY(ISOLATE, RETURN_VALUE) \
+ if (__scavenge__) { /* Second scavenge in a row will empty newspace */ \
+ (ISOLATE)->heap()->CollectGarbage(__allocation__.RetrySpace(), \
+ "insufficient newspace freed"); \
Hannes Payer (out of office) 2015/04/27 12:33:22 Let's do unconditionally a retry with the same spa
+ __allocation__ = FUNCTION_CALL; \
+ RETURN_OBJECT_UNLESS_RETRY(ISOLATE, RETURN_VALUE) \
+ \
+ } \
(ISOLATE)->counters()->gc_last_resort_from_handles()->Increment(); \
(ISOLATE)->heap()->CollectAllAvailableGarbage("last resort gc"); \
{ \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698