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

Unified Diff: test/cctest/test-heap.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
« test/cctest/test-api.cc ('K') | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 9e3eea4e7957dbfe66648014693ff9374cf84f68..7b936e63bce7ad4e6d1264b1af02a58e20c6f1fd 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1289,3 +1289,33 @@ TEST(CollectingAllAvailableGarbageShrinksNewSpace) {
new_capacity = new_space->Capacity();
CHECK(old_capacity == new_capacity);
}
+
+
+TEST(IdleNotificationAdvancesIncrementalMarking) {
+ if (!FLAG_incremental_marking || !FLAG_incremental_marking_steps) return;
+ InitializeVM();
+ v8::HandleScope scope;
+ const char* source = "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)";
+ {
+ AlwaysAllocateScope aa_scope;
+ CompileRun(source);
+ }
+ if (HEAP->incremental_marking()->IsStopped()) {
+ HEAP->incremental_marking()->Start();
+ }
+ intptr_t old_size = HEAP->SizeOfObjects();
+ while (!v8::V8::IdleNotification());
+ intptr_t new_size = HEAP->SizeOfObjects();
+ CHECK(new_size < old_size);
Erik Corry 2011/11/25 09:21:30 Can we tighten this assertion? It should have co
+}
« test/cctest/test-api.cc ('K') | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698