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 6743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6754 } | 6754 } |
6755 } | 6755 } |
6756 CHECK(marking->IsComplete()); | 6756 CHECK(marking->IsComplete()); |
6757 intptr_t size_before = heap->SizeOfObjects(); | 6757 intptr_t size_before = heap->SizeOfObjects(); |
6758 CcTest::heap()->CollectAllGarbage(); | 6758 CcTest::heap()->CollectAllGarbage(); |
6759 intptr_t size_after = heap->SizeOfObjects(); | 6759 intptr_t size_after = heap->SizeOfObjects(); |
6760 // Live size does not increase after garbage collection. | 6760 // Live size does not increase after garbage collection. |
6761 CHECK_LE(size_after, size_before); | 6761 CHECK_LE(size_after, size_before); |
6762 } | 6762 } |
6763 | 6763 |
| 6764 TEST(Regress618958) { |
| 6765 CcTest::InitializeVM(); |
| 6766 v8::HandleScope scope(CcTest::isolate()); |
| 6767 Heap* heap = CcTest::heap(); |
| 6768 bool isolate_is_locked = true; |
| 6769 heap->update_amount_of_external_allocated_memory(100 * MB); |
| 6770 int mark_sweep_count_before = heap->ms_count(); |
| 6771 heap->MemoryPressureNotification(MemoryPressureLevel::kCritical, |
| 6772 isolate_is_locked); |
| 6773 int mark_sweep_count_after = heap->ms_count(); |
| 6774 int mark_sweeps_performed = mark_sweep_count_after - mark_sweep_count_before; |
| 6775 // The memory pressuer handler either performed two GCs or performed one and |
| 6776 // started incremental marking. |
| 6777 CHECK(mark_sweeps_performed == 2 || |
| 6778 (mark_sweeps_performed == 1 && |
| 6779 !heap->incremental_marking()->IsStopped())); |
| 6780 } |
| 6781 |
6764 } // namespace internal | 6782 } // namespace internal |
6765 } // namespace v8 | 6783 } // namespace v8 |
OLD | NEW |