Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: test/cctest/test-api.cc

Issue 8519002: Start incremental marking on idle notification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments, tuned idle round starting conditions. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index b394e950dd45421f4851e14d8dee926032db1df3..126f3622d7b97e64ab20dbaf3878f57621bd195d 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -13385,6 +13385,19 @@ TEST(SourceURLInStackTrace) {
// Test that idle notification can be handled and eventually returns true.
THREADED_TEST(IdleNotification) {
+ v8::HandleScope scope;
+ LocalContext env;
+ CompileRun(
+ "function foo() {"
+ " var a = new Array(1000);"
+ " for (var i = 0; i < 1000; i++) {"
+ " a[i] = new Array(1000);"
+ " for (var j = 0; j < 1000; j++) {"
+ " a[i][j] = {tag1: i, tag2: j};"
+ " }"
+ " }"
+ "};"
+ "foo();");
bool rv = false;
for (int i = 0; i < 100; i++) {
rv = v8::V8::IdleNotification();
@@ -13394,6 +13407,30 @@ THREADED_TEST(IdleNotification) {
CHECK(rv == true);
}
+// Test that idle notification can be handled and eventually returns true.
+THREADED_TEST(IdleNotificationWithHint) {
+ v8::HandleScope scope;
+ LocalContext env;
+ CompileRun(
+ "function foo() {"
+ " var a = new Array(1000);"
+ " for (var i = 0; i < 1000; i++) {"
+ " a[i] = new Array(1000);"
+ " for (var j = 0; j < 1000; j++) {"
+ " a[i][j] = {tag1: i, tag2: j};"
+ " }"
+ " }"
+ "};"
+ "foo();");
+ bool rv = false;
+ for (int i = 0; i < 200; i++) {
+ rv = v8::V8::IdleNotification(10);
+ if (rv)
+ break;
+ }
Erik Corry 2011/11/25 09:21:30 Can we test that the heap is now much smaller?
+ CHECK(rv == true);
+}
+
static uint32_t* stack_limit;

Powered by Google App Engine
This is Rietveld 408576698