OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 796 |
797 DCHECK(!FLAG_never_compact || !FLAG_always_compact); | 797 DCHECK(!FLAG_never_compact || !FLAG_always_compact); |
798 | 798 |
799 if (sweeping_in_progress()) { | 799 if (sweeping_in_progress()) { |
800 // Instead of waiting we could also abort the sweeper threads here. | 800 // Instead of waiting we could also abort the sweeper threads here. |
801 EnsureSweepingCompleted(); | 801 EnsureSweepingCompleted(); |
802 } | 802 } |
803 | 803 |
804 // Clear marking bits if incremental marking is aborted. | 804 // Clear marking bits if incremental marking is aborted. |
805 if (was_marked_incrementally_ && abort_incremental_marking_) { | 805 if (was_marked_incrementally_ && abort_incremental_marking_) { |
806 heap()->incremental_marking()->Abort(); | 806 heap()->incremental_marking()->Stop(); |
807 ClearMarkbits(); | 807 ClearMarkbits(); |
808 AbortWeakCollections(); | 808 AbortWeakCollections(); |
809 AbortWeakCells(); | 809 AbortWeakCells(); |
810 AbortCompaction(); | 810 AbortCompaction(); |
811 was_marked_incrementally_ = false; | 811 was_marked_incrementally_ = false; |
812 } | 812 } |
813 | 813 |
814 // Don't start compaction if we are in the middle of incremental | 814 // Don't start compaction if we are in the middle of incremental |
815 // marking cycle. We did not collect any slots. | 815 // marking cycle. We did not collect any slots. |
816 if (!FLAG_never_compact && !was_marked_incrementally_) { | 816 if (!FLAG_never_compact && !was_marked_incrementally_) { |
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 // The recursive GC marker detects when it is nearing stack overflow, | 2235 // The recursive GC marker detects when it is nearing stack overflow, |
2236 // and switches to a different marking system. JS interrupts interfere | 2236 // and switches to a different marking system. JS interrupts interfere |
2237 // with the C stack limit check. | 2237 // with the C stack limit check. |
2238 PostponeInterruptsScope postpone(isolate()); | 2238 PostponeInterruptsScope postpone(isolate()); |
2239 | 2239 |
2240 IncrementalMarking* incremental_marking = heap_->incremental_marking(); | 2240 IncrementalMarking* incremental_marking = heap_->incremental_marking(); |
2241 if (was_marked_incrementally_) { | 2241 if (was_marked_incrementally_) { |
2242 incremental_marking->Finalize(); | 2242 incremental_marking->Finalize(); |
2243 } else { | 2243 } else { |
2244 // Abort any pending incremental activities e.g. incremental sweeping. | 2244 // Abort any pending incremental activities e.g. incremental sweeping. |
2245 incremental_marking->Abort(); | 2245 incremental_marking->Stop(); |
2246 if (marking_deque_.in_use()) { | 2246 if (marking_deque_.in_use()) { |
2247 marking_deque_.Uninitialize(true); | 2247 marking_deque_.Uninitialize(true); |
2248 } | 2248 } |
2249 } | 2249 } |
2250 | 2250 |
2251 #ifdef DEBUG | 2251 #ifdef DEBUG |
2252 DCHECK(state_ == PREPARE_GC); | 2252 DCHECK(state_ == PREPARE_GC); |
2253 state_ = MARK_LIVE_OBJECTS; | 2253 state_ = MARK_LIVE_OBJECTS; |
2254 #endif | 2254 #endif |
2255 | 2255 |
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4775 SlotsBuffer* buffer = *buffer_address; | 4775 SlotsBuffer* buffer = *buffer_address; |
4776 while (buffer != NULL) { | 4776 while (buffer != NULL) { |
4777 SlotsBuffer* next_buffer = buffer->next(); | 4777 SlotsBuffer* next_buffer = buffer->next(); |
4778 DeallocateBuffer(buffer); | 4778 DeallocateBuffer(buffer); |
4779 buffer = next_buffer; | 4779 buffer = next_buffer; |
4780 } | 4780 } |
4781 *buffer_address = NULL; | 4781 *buffer_address = NULL; |
4782 } | 4782 } |
4783 } // namespace internal | 4783 } // namespace internal |
4784 } // namespace v8 | 4784 } // namespace v8 |
OLD | NEW |