OLD | NEW |
---|---|
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 Loading... | |
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 } | |
OLD | NEW |