Reviewers: Yang,

Description:
Make test-heap resilient against GC stress.

[email protected]
TEST=cctest/test-heap --stress-compaction


Please review this at https://codereview.chromium.org/11464021/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M test/cctest/test-heap.cc


Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 48a69deab3f75964b772a9a04b3af215bbc8800b..957d795918a54393f3743986304523f158f5b2e3 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -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


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to