Revision: 10401 Author: [email protected] Date: Mon Jan 16 01:40:04 2012 Log: 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 http://code.google.com/p/v8/source/detail?r=10401 Modified: /branches/bleeding_edge/test/cctest/test-api.cc ======================================= --- /branches/bleeding_edge/test/cctest/test-api.cc Fri Jan 13 07:14:45 2012 +++ /branches/bleeding_edge/test/cctest/test-api.cc Mon Jan 16 01:40:04 2012 @@ -13559,21 +13559,24 @@ // 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); -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
