Make PrototypeTransitionClearing work with GC interval.
authormstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 Nov 2012 11:39:32 +0000 (11:39 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 Nov 2012 11:39:32 +0000 (11:39 +0000)
R=verwaest@chromium.org
TEST=cctest/test-heap/PrototypeTransitionClearing

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12987 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/test-heap.cc

index 5f26098..8dee692 100644 (file)
@@ -1781,6 +1781,10 @@ TEST(InstanceOfStubWriteBarrier) {
 }
 
 
+// Implemented in the test-alloc.cc test suite.
+void SimulateFullSpace(PagedSpace* space);
+
+
 TEST(PrototypeTransitionClearing) {
   InitializeVM();
   v8::HandleScope scope;
@@ -1819,10 +1823,11 @@ TEST(PrototypeTransitionClearing) {
   // Make sure next prototype is placed on an old-space evacuation candidate.
   Handle<JSObject> prototype;
   PagedSpace* space = HEAP->old_pointer_space();
-  do {
+  {
+    AlwaysAllocateScope always_allocate;
+    SimulateFullSpace(space);
     prototype = FACTORY->NewJSArray(32 * KB, FAST_HOLEY_ELEMENTS, TENURED);
-  } while (space->FirstPage() == space->LastPage() ||
-      !space->LastPage()->Contains(prototype->address()));
+  }
 
   // Add a prototype on an evacuation candidate and verify that transition
   // clearing correctly records slots in prototype transition array.
@@ -2094,10 +2099,6 @@ TEST(Regress2143b) {
 }
 
 
-// Implemented in the test-alloc.cc test suite.
-void SimulateFullSpace(PagedSpace* space);
-
-
 TEST(ReleaseOverReservedPages) {
   i::FLAG_trace_gc = true;
   // The optimizer can allocate stuff, messing up the test.