| 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 "src/heap/mark-compact.h" | 8 #include "src/heap/mark-compact.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 | |
| 15 void MarkCompactCollector::SetFlags(int flags) { | |
| 16 reduce_memory_footprint_ = ((flags & Heap::kReduceMemoryFootprintMask) != 0); | |
| 17 abort_incremental_marking_ = | |
| 18 ((flags & Heap::kAbortIncrementalMarkingMask) != 0); | |
| 19 finalize_incremental_marking_ = | |
| 20 ((flags & Heap::kFinalizeIncrementalMarkingMask) != 0); | |
| 21 DCHECK(!finalize_incremental_marking_ || !abort_incremental_marking_); | |
| 22 } | |
| 23 | |
| 24 | |
| 25 void MarkCompactCollector::PushBlack(HeapObject* obj) { | 14 void MarkCompactCollector::PushBlack(HeapObject* obj) { |
| 26 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj))); | 15 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj))); |
| 27 if (marking_deque_.Push(obj)) { | 16 if (marking_deque_.Push(obj)) { |
| 28 MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size()); | 17 MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size()); |
| 29 } else { | 18 } else { |
| 30 Marking::BlackToGrey(obj); | 19 Marking::BlackToGrey(obj); |
| 31 } | 20 } |
| 32 } | 21 } |
| 33 | 22 |
| 34 | 23 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 152 |
| 164 void CodeFlusher::ClearNextCodeMap(SharedFunctionInfo* holder) { | 153 void CodeFlusher::ClearNextCodeMap(SharedFunctionInfo* holder) { |
| 165 FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); | 154 FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); |
| 166 code_map->set_undefined(SharedFunctionInfo::kNextMapIndex); | 155 code_map->set_undefined(SharedFunctionInfo::kNextMapIndex); |
| 167 } | 156 } |
| 168 | 157 |
| 169 } // namespace internal | 158 } // namespace internal |
| 170 } // namespace v8 | 159 } // namespace v8 |
| 171 | 160 |
| 172 #endif // V8_HEAP_MARK_COMPACT_INL_H_ | 161 #endif // V8_HEAP_MARK_COMPACT_INL_H_ |
| OLD | NEW |