| 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 6699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6710 intptr_t size_after = heap->SizeOfObjects(); | 6710 intptr_t size_after = heap->SizeOfObjects(); |
| 6711 // Live size does not increase after garbage collection. | 6711 // Live size does not increase after garbage collection. |
| 6712 CHECK_LE(size_after, size_before); | 6712 CHECK_LE(size_after, size_before); |
| 6713 } | 6713 } |
| 6714 | 6714 |
| 6715 TEST(Regress618958) { | 6715 TEST(Regress618958) { |
| 6716 CcTest::InitializeVM(); | 6716 CcTest::InitializeVM(); |
| 6717 v8::HandleScope scope(CcTest::isolate()); | 6717 v8::HandleScope scope(CcTest::isolate()); |
| 6718 Heap* heap = CcTest::heap(); | 6718 Heap* heap = CcTest::heap(); |
| 6719 bool isolate_is_locked = true; | 6719 bool isolate_is_locked = true; |
| 6720 heap->update_amount_of_external_allocated_memory(100 * MB); | 6720 heap->update_external_memory(100 * MB); |
| 6721 int mark_sweep_count_before = heap->ms_count(); | 6721 int mark_sweep_count_before = heap->ms_count(); |
| 6722 heap->MemoryPressureNotification(MemoryPressureLevel::kCritical, | 6722 heap->MemoryPressureNotification(MemoryPressureLevel::kCritical, |
| 6723 isolate_is_locked); | 6723 isolate_is_locked); |
| 6724 int mark_sweep_count_after = heap->ms_count(); | 6724 int mark_sweep_count_after = heap->ms_count(); |
| 6725 int mark_sweeps_performed = mark_sweep_count_after - mark_sweep_count_before; | 6725 int mark_sweeps_performed = mark_sweep_count_after - mark_sweep_count_before; |
| 6726 // The memory pressuer handler either performed two GCs or performed one and | 6726 // The memory pressuer handler either performed two GCs or performed one and |
| 6727 // started incremental marking. | 6727 // started incremental marking. |
| 6728 CHECK(mark_sweeps_performed == 2 || | 6728 CHECK(mark_sweeps_performed == 2 || |
| 6729 (mark_sweeps_performed == 1 && | 6729 (mark_sweeps_performed == 1 && |
| 6730 !heap->incremental_marking()->IsStopped())); | 6730 !heap->incremental_marking()->IsStopped())); |
| 6731 } | 6731 } |
| 6732 | 6732 |
| 6733 } // namespace internal | 6733 } // namespace internal |
| 6734 } // namespace v8 | 6734 } // namespace v8 |
| OLD | NEW |