Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2355 CHECK_GT(size_of_objects_2 / 20, delta); | 2355 CHECK_GT(size_of_objects_2 / 20, delta); |
| 2356 } | 2356 } |
| 2357 } | 2357 } |
| 2358 | 2358 |
| 2359 TEST(GrowAndShrinkNewSpace) { | 2359 TEST(GrowAndShrinkNewSpace) { |
| 2360 // Avoid shrinking new space in GC epilogue. This can happen if allocation | 2360 // Avoid shrinking new space in GC epilogue. This can happen if allocation |
| 2361 // throughput samples have been taken while executing the benchmark. | 2361 // throughput samples have been taken while executing the benchmark. |
| 2362 FLAG_predictable = true; | 2362 FLAG_predictable = true; |
| 2363 | 2363 |
| 2364 CcTest::InitializeVM(); | 2364 CcTest::InitializeVM(); |
| 2365 v8::HandleScope scope(CcTest::isolate()); | |
|
Hannes Payer (out of office)
2016/09/27 08:28:32
Why?
Michael Lippautz
2016/09/27 11:13:47
Left-over from fixing the test. Removed.
| |
| 2366 | |
| 2365 Heap* heap = CcTest::heap(); | 2367 Heap* heap = CcTest::heap(); |
| 2366 NewSpace* new_space = heap->new_space(); | 2368 NewSpace* new_space = heap->new_space(); |
| 2367 | 2369 |
| 2368 if (heap->MaxSemiSpaceSize() == heap->InitialSemiSpaceSize()) { | 2370 if (heap->MaxSemiSpaceSize() == heap->InitialSemiSpaceSize()) { |
| 2369 return; | 2371 return; |
| 2370 } | 2372 } |
| 2371 | 2373 |
| 2372 // Explicitly growing should double the space capacity. | 2374 // Explicitly growing should double the space capacity. |
| 2373 intptr_t old_capacity, new_capacity; | 2375 intptr_t old_capacity, new_capacity; |
| 2374 old_capacity = new_space->TotalCapacity(); | 2376 old_capacity = new_space->TotalCapacity(); |
| (...skipping 4730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7105 chunk, chunk->area_end() - kPointerSize, chunk->area_end()); | 7107 chunk, chunk->area_end() - kPointerSize, chunk->area_end()); |
| 7106 slots[chunk->area_end() - kPointerSize] = false; | 7108 slots[chunk->area_end() - kPointerSize] = false; |
| 7107 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) { | 7109 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) { |
| 7108 CHECK(slots[addr]); | 7110 CHECK(slots[addr]); |
| 7109 return KEEP_SLOT; | 7111 return KEEP_SLOT; |
| 7110 }); | 7112 }); |
| 7111 } | 7113 } |
| 7112 | 7114 |
| 7113 } // namespace internal | 7115 } // namespace internal |
| 7114 } // namespace v8 | 7116 } // namespace v8 |
| OLD | NEW |