Make test-heap resilient against GC stress.

R=yangguo@chromium.org
TEST=cctest/test-heap --stress-compaction

Review URL: https://codereview.chromium.org/11464021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13170 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2012-12-07 13:01:38 +00:00
parent 4d73627313
commit d11558c9b8

View File

@ -981,8 +981,8 @@ TEST(TestCodeFlushing) {
CHECK(function->shared()->is_compiled());
// The code will survive at least two GCs.
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
CHECK(function->shared()->is_compiled());
// Simulate several GCs that use full marking.
@ -1028,8 +1028,8 @@ TEST(TestCodeFlushingIncremental) {
CHECK(function->shared()->is_compiled());
// The code will survive at least two GCs.
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
CHECK(function->shared()->is_compiled());
// Simulate several GCs that use incremental marking.
@ -1089,7 +1089,7 @@ TEST(TestCodeFlushingIncrementalScavenge) {
Handle<String> bar_name = FACTORY->LookupAsciiSymbol("bar");
// Perfrom one initial GC to enable code flushing.
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
// This compile will add the code to the compilation cache.
{ v8::HandleScope scope;
@ -1162,8 +1162,8 @@ TEST(TestCodeFlushingIncrementalAbort) {
CHECK(function->shared()->is_compiled());
// The code will survive at least two GCs.
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
CHECK(function->shared()->is_compiled());
// Bump the code age so that flushing is triggered.
@ -2517,7 +2517,7 @@ TEST(Regress159140) {
v8::HandleScope scope;
// Perform one initial GC to enable code flushing.
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
// Prepare several closures that are all eligible for code flushing
// because all reachable ones are not optimized. Make sure that the