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_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_H_ |
6 #define V8_HEAP_MARK_COMPACT_H_ | 6 #define V8_HEAP_MARK_COMPACT_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 void AddEvacuationCandidate(Page* p); | 559 void AddEvacuationCandidate(Page* p); |
560 | 560 |
561 // Prepares for GC by resetting relocation info in old and map spaces and | 561 // Prepares for GC by resetting relocation info in old and map spaces and |
562 // choosing spaces to compact. | 562 // choosing spaces to compact. |
563 void Prepare(); | 563 void Prepare(); |
564 | 564 |
565 bool StartCompaction(); | 565 bool StartCompaction(); |
566 | 566 |
567 void AbortCompaction(); | 567 void AbortCompaction(); |
568 | 568 |
569 // Determine type of object and emit deletion log event. | |
570 static void ReportDeleteIfNeeded(HeapObject* obj, Isolate* isolate); | |
571 | |
572 // Distinguishable invalid map encodings (for single word and multiple words) | |
573 // that indicate free regions. | |
574 static const uint32_t kSingleFreeEncoding = 0; | |
575 static const uint32_t kMultiFreeEncoding = 1; | |
576 | |
577 inline Isolate* isolate() const; | |
578 | |
579 CodeFlusher* code_flusher() { return code_flusher_; } | 569 CodeFlusher* code_flusher() { return code_flusher_; } |
580 inline bool is_code_flushing_enabled() const { return code_flusher_ != NULL; } | 570 inline bool is_code_flushing_enabled() const { return code_flusher_ != NULL; } |
581 | 571 |
582 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object* host)) { | 572 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object* host)) { |
583 return Page::FromAddress(reinterpret_cast<Address>(host)) | 573 return Page::FromAddress(reinterpret_cast<Address>(host)) |
584 ->ShouldSkipEvacuationSlotRecording(); | 574 ->ShouldSkipEvacuationSlotRecording(); |
585 } | 575 } |
586 | 576 |
587 static inline bool IsOnEvacuationCandidate(HeapObject* obj) { | 577 static inline bool IsOnEvacuationCandidate(HeapObject* obj) { |
588 return Page::FromAddress(reinterpret_cast<Address>(obj)) | 578 return Page::FromAddress(reinterpret_cast<Address>(obj)) |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 ~EvacuationScope() { collector_->set_evacuation(false); } | 834 ~EvacuationScope() { collector_->set_evacuation(false); } |
845 | 835 |
846 private: | 836 private: |
847 MarkCompactCollector* collector_; | 837 MarkCompactCollector* collector_; |
848 }; | 838 }; |
849 | 839 |
850 } // namespace internal | 840 } // namespace internal |
851 } // namespace v8 | 841 } // namespace v8 |
852 | 842 |
853 #endif // V8_HEAP_MARK_COMPACT_H_ | 843 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |