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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« test/cctest/test-api.cc ('K') | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 intptr_t old_capacity, new_capacity; 1282 intptr_t old_capacity, new_capacity;
1283 old_capacity = new_space->Capacity(); 1283 old_capacity = new_space->Capacity();
1284 new_space->Grow(); 1284 new_space->Grow();
1285 new_capacity = new_space->Capacity(); 1285 new_capacity = new_space->Capacity();
1286 CHECK(2 * old_capacity == new_capacity); 1286 CHECK(2 * old_capacity == new_capacity);
1287 FillUpNewSpace(new_space); 1287 FillUpNewSpace(new_space);
1288 HEAP->CollectAllAvailableGarbage(); 1288 HEAP->CollectAllAvailableGarbage();
1289 new_capacity = new_space->Capacity(); 1289 new_capacity = new_space->Capacity();
1290 CHECK(old_capacity == new_capacity); 1290 CHECK(old_capacity == new_capacity);
1291 } 1291 }
1292
1293
1294 TEST(IdleNotificationAdvancesIncrementalMarking) {
1295 if (!FLAG_incremental_marking || !FLAG_incremental_marking_steps) return;
1296 InitializeVM();
1297 v8::HandleScope scope;
1298 const char* source = "function binom(n, m) {"
1299 " var C = [[1]];"
1300 " for (var i = 1; i <= n; ++i) {"
1301 " C[i] = [1];"
1302 " for (var j = 1; j < i; ++j) {"
1303 " C[i][j] = C[i-1][j-1] + C[i-1][j];"
1304 " }"
1305 " C[i][i] = 1;"
1306 " }"
1307 " return C[n][m];"
1308 "};"
1309 "binom(1000, 500)";
1310 {
1311 AlwaysAllocateScope aa_scope;
1312 CompileRun(source);
1313 }
1314 if (HEAP->incremental_marking()->IsStopped()) {
1315 HEAP->incremental_marking()->Start();
1316 }
1317 intptr_t old_size = HEAP->SizeOfObjects();
1318 while (!v8::V8::IdleNotification());
1319 intptr_t new_size = HEAP->SizeOfObjects();
1320 CHECK(new_size < old_size);
Erik Corry 2011/11/25 09:21:30 Can we tighten this assertion? It should have co
1321 }
OLDNEW
« 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