Use the old handler for low frequency idle notifications.
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 6 Dec 2011 14:30:21 +0000 (14:30 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 6 Dec 2011 14:30:21 +0000 (14:30 +0000)
BUG=
TEST=

Review URL: http://codereview.chromium.org/8818005

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

src/heap.cc
test/cctest/test-api.cc
test/cctest/test-heap.cc

index 4feb70e..e96a87d 100644 (file)
@@ -4541,9 +4541,10 @@ void Heap::EnsureHeapIsIterable() {
 
 
 bool Heap::IdleNotification(int hint) {
+  if (hint >= 1000) return IdleGlobalGC();
   if (contexts_disposed_ > 0 || !FLAG_incremental_marking ||
       FLAG_expose_gc || Serializer::enabled()) {
-    return hint < 1000 ? true : IdleGlobalGC();
+    return true;
   }
 
   // By doing small chunks of GC work in each IdleNotification,
index 87e322c..3f444b3 100644 (file)
@@ -13454,16 +13454,12 @@ THREADED_TEST(IdleNotification) {
              "};"
              "binom(1000, 500)");
   bool rv = false;
-  intptr_t old_size = HEAP->SizeOfObjects();
-  bool no_idle_work = v8::V8::IdleNotification();
   for (int i = 0; i < 100; i++) {
     rv = v8::V8::IdleNotification();
     if (rv)
       break;
   }
   CHECK(rv == true);
-  intptr_t new_size = HEAP->SizeOfObjects();
-  CHECK(no_idle_work || new_size < 3 * old_size / 4);
 }
 
 // Test that idle notification can be handled and eventually returns true.
index 71f9ac5..da3ccb9 100644 (file)
@@ -1312,8 +1312,8 @@ TEST(IdleNotificationAdvancesIncrementalMarking) {
     CompileRun(source);
   }
   intptr_t old_size = HEAP->SizeOfObjects();
-  bool no_idle_work = v8::V8::IdleNotification();
-  while (!v8::V8::IdleNotification()) ;
+  bool no_idle_work = v8::V8::IdleNotification(900);
+  while (!v8::V8::IdleNotification(900)) ;
   intptr_t new_size = HEAP->SizeOfObjects();
   CHECK(no_idle_work || new_size < 3 * old_size / 4);
 }