| 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 #ifndef V8_HEAP_MARK_COMPACT_INL_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_INL_H_ |
| 6 #define V8_HEAP_MARK_COMPACT_INL_H_ | 6 #define V8_HEAP_MARK_COMPACT_INL_H_ |
| 7 | 7 |
| 8 #include <memory.h> | 8 #include <memory.h> |
| 9 | 9 |
| 10 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
| 11 #include "src/isolate.h" | 11 #include "src/isolate.h" |
| 12 | 12 |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 | 17 |
| 18 MarkBit Marking::MarkBitFrom(Address addr) { | 18 MarkBit Marking::MarkBitFrom(Address addr) { |
| 19 MemoryChunk* p = MemoryChunk::FromAddress(addr); | 19 MemoryChunk* p = MemoryChunk::FromAddress(addr); |
| 20 return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr), | 20 return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr), |
| 21 p->ContainsOnlyData()); | 21 p->ContainsOnlyData()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 | 24 |
| 25 void MarkCompactCollector::SetFlags(int flags) { | 25 void MarkCompactCollector::SetFlags(int flags) { |
| 26 sweep_precisely_ = ((flags & Heap::kSweepPreciselyMask) != 0); | |
| 27 reduce_memory_footprint_ = ((flags & Heap::kReduceMemoryFootprintMask) != 0); | 26 reduce_memory_footprint_ = ((flags & Heap::kReduceMemoryFootprintMask) != 0); |
| 28 abort_incremental_marking_ = | 27 abort_incremental_marking_ = |
| 29 ((flags & Heap::kAbortIncrementalMarkingMask) != 0); | 28 ((flags & Heap::kAbortIncrementalMarkingMask) != 0); |
| 30 } | 29 } |
| 31 | 30 |
| 32 | 31 |
| 33 void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) { | 32 void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) { |
| 34 DCHECK(Marking::MarkBitFrom(obj) == mark_bit); | 33 DCHECK(Marking::MarkBitFrom(obj) == mark_bit); |
| 35 if (!mark_bit.Get()) { | 34 if (!mark_bit.Get()) { |
| 36 mark_bit.Set(); | 35 mark_bit.Set(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 66 if (!SlotsBuffer::AddTo(&slots_buffer_allocator_, | 65 if (!SlotsBuffer::AddTo(&slots_buffer_allocator_, |
| 67 object_page->slots_buffer_address(), slot, mode)) { | 66 object_page->slots_buffer_address(), slot, mode)) { |
| 68 EvictEvacuationCandidate(object_page); | 67 EvictEvacuationCandidate(object_page); |
| 69 } | 68 } |
| 70 } | 69 } |
| 71 } | 70 } |
| 72 } | 71 } |
| 73 } // namespace v8::internal | 72 } // namespace v8::internal |
| 74 | 73 |
| 75 #endif // V8_HEAP_MARK_COMPACT_INL_H_ | 74 #endif // V8_HEAP_MARK_COMPACT_INL_H_ |
| OLD | NEW |