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

Unified Diff: test/cctest/test-alloc.cc

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: Fix test-alloc 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 | « src/heap/heap-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-alloc.cc
diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc
index 66f69f8b574d68ab57147c2f739bc8cb64aef851..74388d1785047b9319a5a521791a3bb14fc98c09 100644
--- a/test/cctest/test-alloc.cc
+++ b/test/cctest/test-alloc.cc
@@ -38,9 +38,16 @@ using namespace v8::internal;
static AllocationResult AllocateAfterFailures() {
static int attempts = 0;
- if (++attempts < 3) return AllocationResult::Retry();
+ // The first 4 times we simulate a full heap, by returning retry.
+ if (++attempts < 4) return AllocationResult::Retry();
+
+ // Expose some private stuff on Heap.
TestHeap* heap = CcTest::test_heap();
+ // Now that we have returned 'retry' 4 times, we are in a last-chance
+ // scenario, with always_allocate. See CALL_AND_RETRY. Test that all
+ // allocations succeed.
+
// New space.
SimulateFullSpace(heap->new_space());
heap->AllocateByteArray(100).ToObjectChecked();
« no previous file with comments | « src/heap/heap-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698