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 5804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5815 } | 5815 } |
5816 | 5816 |
5817 | 5817 |
5818 void CheckMapRetainingFor(int n) { | 5818 void CheckMapRetainingFor(int n) { |
5819 FLAG_retain_maps_for_n_gc = n; | 5819 FLAG_retain_maps_for_n_gc = n; |
5820 Isolate* isolate = CcTest::i_isolate(); | 5820 Isolate* isolate = CcTest::i_isolate(); |
5821 Heap* heap = isolate->heap(); | 5821 Heap* heap = isolate->heap(); |
5822 Handle<WeakCell> weak_cell = AddRetainedMap(isolate, heap); | 5822 Handle<WeakCell> weak_cell = AddRetainedMap(isolate, heap); |
5823 CHECK(!weak_cell->cleared()); | 5823 CHECK(!weak_cell->cleared()); |
5824 for (int i = 0; i < n; i++) { | 5824 for (int i = 0; i < n; i++) { |
| 5825 heap->StartIncrementalMarking(); |
| 5826 SimulateIncrementalMarking(heap); |
5825 heap->CollectGarbage(OLD_SPACE); | 5827 heap->CollectGarbage(OLD_SPACE); |
5826 } | 5828 } |
5827 CHECK(!weak_cell->cleared()); | 5829 CHECK(!weak_cell->cleared()); |
| 5830 heap->StartIncrementalMarking(); |
| 5831 SimulateIncrementalMarking(heap); |
5828 heap->CollectGarbage(OLD_SPACE); | 5832 heap->CollectGarbage(OLD_SPACE); |
5829 CHECK(weak_cell->cleared()); | 5833 CHECK(weak_cell->cleared()); |
5830 } | 5834 } |
5831 | 5835 |
5832 | 5836 |
5833 TEST(MapRetaining) { | 5837 TEST(MapRetaining) { |
5834 CcTest::InitializeVM(); | 5838 CcTest::InitializeVM(); |
5835 v8::HandleScope scope(CcTest::isolate()); | 5839 v8::HandleScope scope(CcTest::isolate()); |
5836 CheckMapRetainingFor(FLAG_retain_maps_for_n_gc); | 5840 CheckMapRetainingFor(FLAG_retain_maps_for_n_gc); |
5837 CheckMapRetainingFor(0); | 5841 CheckMapRetainingFor(0); |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6447 isolate->IncrementJsCallsFromApiCounter(); | 6451 isolate->IncrementJsCallsFromApiCounter(); |
6448 isolate->IncrementJsCallsFromApiCounter(); | 6452 isolate->IncrementJsCallsFromApiCounter(); |
6449 isolate->IncrementJsCallsFromApiCounter(); | 6453 isolate->IncrementJsCallsFromApiCounter(); |
6450 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); | 6454 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); |
6451 CheckDoubleEquals(2, calls_per_ms); | 6455 CheckDoubleEquals(2, calls_per_ms); |
6452 } | 6456 } |
6453 | 6457 |
6454 | 6458 |
6455 } // namespace internal | 6459 } // namespace internal |
6456 } // namespace v8 | 6460 } // namespace v8 |
OLD | NEW |