| 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 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 MarkObject(code, code_mark); | 1565 MarkObject(code, code_mark); |
| 1566 if (frame->is_optimized()) { | 1566 if (frame->is_optimized()) { |
| 1567 MarkCompactMarkingVisitor::MarkInlinedFunctionsCode(heap(), | 1567 MarkCompactMarkingVisitor::MarkInlinedFunctionsCode(heap(), |
| 1568 frame->LookupCode()); | 1568 frame->LookupCode()); |
| 1569 } | 1569 } |
| 1570 } | 1570 } |
| 1571 } | 1571 } |
| 1572 | 1572 |
| 1573 | 1573 |
| 1574 void MarkCompactCollector::PrepareForCodeFlushing() { | 1574 void MarkCompactCollector::PrepareForCodeFlushing() { |
| 1575 // Enable code flushing for non-incremental cycles. | |
| 1576 if (FLAG_flush_code && !FLAG_flush_code_incrementally) { | |
| 1577 EnableCodeFlushing(!was_marked_incrementally_); | |
| 1578 } | |
| 1579 | |
| 1580 // If code flushing is disabled, there is no need to prepare for it. | 1575 // If code flushing is disabled, there is no need to prepare for it. |
| 1581 if (!is_code_flushing_enabled()) return; | 1576 if (!is_code_flushing_enabled()) return; |
| 1582 | 1577 |
| 1583 // Ensure that empty descriptor array is marked. Method MarkDescriptorArray | 1578 // Ensure that empty descriptor array is marked. Method MarkDescriptorArray |
| 1584 // relies on it being marked before any other descriptor array. | 1579 // relies on it being marked before any other descriptor array. |
| 1585 HeapObject* descriptor_array = heap()->empty_descriptor_array(); | 1580 HeapObject* descriptor_array = heap()->empty_descriptor_array(); |
| 1586 MarkBit descriptor_array_mark = Marking::MarkBitFrom(descriptor_array); | 1581 MarkBit descriptor_array_mark = Marking::MarkBitFrom(descriptor_array); |
| 1587 MarkObject(descriptor_array, descriptor_array_mark); | 1582 MarkObject(descriptor_array, descriptor_array_mark); |
| 1588 | 1583 |
| 1589 // Make sure we are not referencing the code from the stack. | 1584 // Make sure we are not referencing the code from the stack. |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 MarkCompactWeakObjectRetainer mark_compact_object_retainer; | 2296 MarkCompactWeakObjectRetainer mark_compact_object_retainer; |
| 2302 heap()->ProcessAllWeakReferences(&mark_compact_object_retainer); | 2297 heap()->ProcessAllWeakReferences(&mark_compact_object_retainer); |
| 2303 | 2298 |
| 2304 // Remove object groups after marking phase. | 2299 // Remove object groups after marking phase. |
| 2305 heap()->isolate()->global_handles()->RemoveObjectGroups(); | 2300 heap()->isolate()->global_handles()->RemoveObjectGroups(); |
| 2306 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); | 2301 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); |
| 2307 | 2302 |
| 2308 // Flush code from collected candidates. | 2303 // Flush code from collected candidates. |
| 2309 if (is_code_flushing_enabled()) { | 2304 if (is_code_flushing_enabled()) { |
| 2310 code_flusher_->ProcessCandidates(); | 2305 code_flusher_->ProcessCandidates(); |
| 2311 // If incremental marker does not support code flushing, we need to | |
| 2312 // disable it before incremental marking steps for next cycle. | |
| 2313 if (FLAG_flush_code && !FLAG_flush_code_incrementally) { | |
| 2314 EnableCodeFlushing(false); | |
| 2315 } | |
| 2316 } | 2306 } |
| 2317 | 2307 |
| 2318 if (FLAG_track_gc_object_stats) { | 2308 if (FLAG_track_gc_object_stats) { |
| 2319 if (FLAG_trace_gc_object_stats) { | 2309 if (FLAG_trace_gc_object_stats) { |
| 2320 heap()->TraceObjectStats(); | 2310 heap()->TraceObjectStats(); |
| 2321 } | 2311 } |
| 2322 heap()->CheckpointObjectStats(); | 2312 heap()->CheckpointObjectStats(); |
| 2323 } | 2313 } |
| 2324 } | 2314 } |
| 2325 | 2315 |
| (...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4635 SlotsBuffer* buffer = *buffer_address; | 4625 SlotsBuffer* buffer = *buffer_address; |
| 4636 while (buffer != NULL) { | 4626 while (buffer != NULL) { |
| 4637 SlotsBuffer* next_buffer = buffer->next(); | 4627 SlotsBuffer* next_buffer = buffer->next(); |
| 4638 DeallocateBuffer(buffer); | 4628 DeallocateBuffer(buffer); |
| 4639 buffer = next_buffer; | 4629 buffer = next_buffer; |
| 4640 } | 4630 } |
| 4641 *buffer_address = NULL; | 4631 *buffer_address = NULL; |
| 4642 } | 4632 } |
| 4643 } // namespace internal | 4633 } // namespace internal |
| 4644 } // namespace v8 | 4634 } // namespace v8 |
| OLD | NEW |