Fix flaky idle notification test.

Idle notification handler might not free more memory if there was a global GC before or incremental marking is not activated (and it's not worth activating).

BUG=
TEST=cctest/test-api/IdleNotificationWithHint

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10401 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ulan@chromium.org 2012-01-16 09:40:04 +00:00
parent ebb75c23a1
commit 08d77cbde4

View File

@ -13559,21 +13559,24 @@ THREADED_TEST(IdleNotification) {
// Test that idle notification can be handled and eventually returns true.
// This just checks the contract of the IdleNotification() function,
// and does not verify that it does reasonable work.
THREADED_TEST(IdleNotificationWithHint) {
TEST(IdleNotificationWithHint) {
v8::HandleScope scope;
LocalContext env;
CompileRun("function binom(n, m) {"
" var C = [[1]];"
" for (var i = 1; i <= n; ++i) {"
" C[i] = [1];"
" for (var j = 1; j < i; ++j) {"
" C[i][j] = C[i-1][j-1] + C[i-1][j];"
" }"
" C[i][i] = 1;"
" }"
" return C[n][m];"
"};"
"binom(1000, 500)");
{
i::AlwaysAllocateScope always_allocate;
CompileRun("function binom(n, m) {"
" var C = [[1]];"
" for (var i = 1; i <= n; ++i) {"
" C[i] = [1];"
" for (var j = 1; j < i; ++j) {"
" C[i][j] = C[i-1][j-1] + C[i-1][j];"
" }"
" C[i][i] = 1;"
" }"
" return C[n][m];"
"};"
"binom(1000, 500)");
}
bool rv = false;
intptr_t old_size = HEAP->SizeOfObjects();
bool no_idle_work = v8::V8::IdleNotification(10);