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
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,
"};"
"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.
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);
}