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

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

Issue 11498012: Make unit tests resilient against GC Stress. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 | test/cctest/test-heap.cc » ('j') | 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 6db74960aec42791b5d2ce113da64059c7ba3c63..bbae5ebd3ed815eb165e9abecaf655d04f0565de 100644
--- a/test/cctest/test-alloc.cc
+++ b/test/cctest/test-alloc.cc
@@ -40,18 +40,7 @@ static MaybeObject* AllocateAfterFailures() {
Heap* heap = Isolate::Current()->heap();
// New space.
- NewSpace* new_space = heap->new_space();
- static const int kNewSpaceFillerSize = ByteArray::SizeFor(0);
- while (new_space->Available() > kNewSpaceFillerSize) {
- int available_before = static_cast<int>(new_space->Available());
- CHECK(!heap->AllocateByteArray(0)->IsFailure());
- if (available_before == new_space->Available()) {
- // It seems that we are avoiding new space allocations when
- // allocation is forced, so no need to fill up new space
- // in order to make the test harder.
- break;
- }
- }
+ SimulateFullSpace(heap->new_space());
CHECK(!heap->AllocateByteArray(100)->IsFailure());
CHECK(!heap->AllocateFixedArray(100, NOT_TENURED)->IsFailure());
@@ -90,6 +79,7 @@ static MaybeObject* AllocateAfterFailures() {
CHECK(!heap->AllocateMap(JS_OBJECT_TYPE, instance_size)->IsFailure());
// Test that we can allocate in old pointer space and code space.
+ SimulateFullSpace(heap->code_space());
CHECK(!heap->AllocateFixedArray(100, TENURED)->IsFailure());
CHECK(!heap->CopyCode(Isolate::Current()->builtins()->builtin(
Builtins::kIllegal))->IsFailure());
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698