| 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 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 CHECK(old_capacity == 2 * new_capacity); | 1265 CHECK(old_capacity == 2 * new_capacity); |
| 1266 | 1266 |
| 1267 // Consecutive shrinking should not affect space capacity. | 1267 // Consecutive shrinking should not affect space capacity. |
| 1268 old_capacity = new_space->Capacity(); | 1268 old_capacity = new_space->Capacity(); |
| 1269 new_space->Shrink(); | 1269 new_space->Shrink(); |
| 1270 new_space->Shrink(); | 1270 new_space->Shrink(); |
| 1271 new_space->Shrink(); | 1271 new_space->Shrink(); |
| 1272 new_capacity = new_space->Capacity(); | 1272 new_capacity = new_space->Capacity(); |
| 1273 CHECK(old_capacity == new_capacity); | 1273 CHECK(old_capacity == new_capacity); |
| 1274 } | 1274 } |
| 1275 |
| 1276 TEST(IdleNotificationAdvancesIncrementalMarking) { |
| 1277 if (!FLAG_incremental_marking || !FLAG_incremental_marking_steps) return; |
| 1278 InitializeVM(); |
| 1279 v8::HandleScope scope; |
| 1280 const char* source = "function binom(n, m) {" |
| 1281 " var C = [[1]];" |
| 1282 " for (var i = 1; i <= n; ++i) {" |
| 1283 " C[i] = [1];" |
| 1284 " for (var j = 1; j < i; ++j) {" |
| 1285 " C[i][j] = C[i-1][j-1] + C[i-1][j];" |
| 1286 " }" |
| 1287 " C[i][i] = 1;" |
| 1288 " }" |
| 1289 " return C[n][m];" |
| 1290 "};" |
| 1291 "binom(1000, 500)"; |
| 1292 { |
| 1293 AlwaysAllocateScope aa_scope; |
| 1294 CompileRun(source); |
| 1295 } |
| 1296 intptr_t old_size = HEAP->SizeOfObjects(); |
| 1297 int old_steps = HEAP->incremental_marking()->steps_count(); |
| 1298 HEAP->IdleNotification(); |
| 1299 int new_steps = HEAP->incremental_marking()->steps_count(); |
| 1300 CHECK(new_steps > old_steps); |
| 1301 while (!HEAP->IdleNotification()); |
| 1302 intptr_t new_size = HEAP->SizeOfObjects(); |
| 1303 CHECK(new_size < old_size); |
| 1304 } |
| 1305 |
| OLD | NEW |