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 "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Forward declarations. | 22 // Forward declarations. |
23 class CodeFlusher; | 23 class CodeFlusher; |
24 class MarkCompactCollector; | 24 class MarkCompactCollector; |
25 class MarkingVisitor; | 25 class MarkingVisitor; |
26 class RootMarkingVisitor; | 26 class RootMarkingVisitor; |
27 | 27 |
28 | 28 |
29 class Marking : public AllStatic { | 29 class Marking : public AllStatic { |
30 public: | 30 public: |
31 INLINE(static MarkBit MarkBitFrom(Address addr)); | 31 INLINE(static MarkBit MarkBitFrom(Address addr)) { |
| 32 MemoryChunk* p = MemoryChunk::FromAddress(addr); |
| 33 return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr)); |
| 34 } |
32 | 35 |
33 INLINE(static MarkBit MarkBitFrom(HeapObject* obj)) { | 36 INLINE(static MarkBit MarkBitFrom(HeapObject* obj)) { |
34 return MarkBitFrom(reinterpret_cast<Address>(obj)); | 37 return MarkBitFrom(reinterpret_cast<Address>(obj)); |
35 } | 38 } |
36 | 39 |
37 // Impossible markbits: 01 | 40 // Impossible markbits: 01 |
38 static const char* kImpossibleBitPattern; | 41 static const char* kImpossibleBitPattern; |
39 INLINE(static bool IsImpossible(MarkBit mark_bit)) { | 42 INLINE(static bool IsImpossible(MarkBit mark_bit)) { |
40 return !mark_bit.Get() && mark_bit.Next().Get(); | 43 return !mark_bit.Get() && mark_bit.Next().Get(); |
41 } | 44 } |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 private: | 1037 private: |
1035 MarkCompactCollector* collector_; | 1038 MarkCompactCollector* collector_; |
1036 }; | 1039 }; |
1037 | 1040 |
1038 | 1041 |
1039 const char* AllocationSpaceName(AllocationSpace space); | 1042 const char* AllocationSpaceName(AllocationSpace space); |
1040 } | 1043 } |
1041 } // namespace v8::internal | 1044 } // namespace v8::internal |
1042 | 1045 |
1043 #endif // V8_HEAP_MARK_COMPACT_H_ | 1046 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |