Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: src/heap/mark-compact.h

Issue 2638803002: [heap] Remove markbits getter from raw address (Closed)
Patch Set: Fix LeftTrim Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 18 matching lines...) Expand all
29 29
30 // Forward declarations. 30 // Forward declarations.
31 class CodeFlusher; 31 class CodeFlusher;
32 class MarkCompactCollector; 32 class MarkCompactCollector;
33 class MarkingVisitor; 33 class MarkingVisitor;
34 template <MarkCompactMode mode> 34 template <MarkCompactMode mode>
35 class RootMarkingVisitor; 35 class RootMarkingVisitor;
36 36
37 class ObjectMarking : public AllStatic { 37 class ObjectMarking : public AllStatic {
38 public: 38 public:
39 INLINE(static MarkBit MarkBitFrom(Address addr)) { 39 V8_INLINE static MarkBit MarkBitFrom(HeapObject* obj) {
40 MemoryChunk* p = MemoryChunk::FromAddress(addr); 40 const Address address = obj->address();
41 return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr)); 41 MemoryChunk* p = MemoryChunk::FromAddress(address);
42 } 42 return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(address));
43
44 INLINE(static MarkBit MarkBitFrom(HeapObject* obj)) {
45 return MarkBitFrom(reinterpret_cast<Address>(obj));
46 } 43 }
47 44
48 static Marking::ObjectColor Color(HeapObject* obj) { 45 static Marking::ObjectColor Color(HeapObject* obj) {
49 return Marking::Color(ObjectMarking::MarkBitFrom(obj)); 46 return Marking::Color(ObjectMarking::MarkBitFrom(obj));
50 } 47 }
51 48
52 private: 49 private:
53 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectMarking); 50 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectMarking);
54 }; 51 };
55 52
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 778
782 private: 779 private:
783 MarkCompactCollector* collector_; 780 MarkCompactCollector* collector_;
784 }; 781 };
785 782
786 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); 783 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space);
787 } // namespace internal 784 } // namespace internal
788 } // namespace v8 785 } // namespace v8
789 786
790 #endif // V8_HEAP_MARK_COMPACT_H_ 787 #endif // V8_HEAP_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698