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

Side by Side Diff: src/heap/scavenger.h

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 years, 7 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/object-stats.cc ('k') | src/heap/scavenger.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_SCAVENGER_H_ 5 #ifndef V8_HEAP_SCAVENGER_H_
6 #define V8_HEAP_SCAVENGER_H_ 6 #define V8_HEAP_SCAVENGER_H_
7 7
8 #include "src/heap/objects-visiting.h" 8 #include "src/heap/objects-visiting.h"
9 #include "src/heap/slot-set.h" 9 #include "src/heap/slot-set.h"
10 10
(...skipping 26 matching lines...) Expand all
37 void SelectScavengingVisitorsTable(); 37 void SelectScavengingVisitorsTable();
38 38
39 Isolate* isolate(); 39 Isolate* isolate();
40 Heap* heap() { return heap_; } 40 Heap* heap() { return heap_; }
41 41
42 private: 42 private:
43 Heap* heap_; 43 Heap* heap_;
44 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; 44 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
45 }; 45 };
46 46
47
48 // Helper class for turning the scavenger into an object visitor that is also 47 // Helper class for turning the scavenger into an object visitor that is also
49 // filtering out non-HeapObjects and objects which do not reside in new space. 48 // filtering out non-HeapObjects and objects which do not reside in new space.
50 class ScavengeVisitor : public ObjectVisitor { 49 // TODO(ulan): ObjectVisitor is needed only for code flusher. Remove it after
50 // changing the scanvenger to treat JSFunction->next_link strongly.
51 class RootScavengeVisitor : public ObjectVisitor, public RootVisitor {
51 public: 52 public:
52 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {} 53 explicit RootScavengeVisitor(Heap* heap) : heap_(heap) {}
53 54
54 void VisitPointer(Object** p) override; 55 void VisitPointer(Object** p) override;
55 void VisitPointers(Object** start, Object** end) override; 56 void VisitPointers(Object** start, Object** end) override;
56 57
58 void VisitRootPointer(Root root, Object** p) override;
59 void VisitRootPointers(Root root, Object** start, Object** end) override;
60
57 private: 61 private:
58 inline void ScavengePointer(Object** p); 62 inline void ScavengePointer(Object** p);
59 63
60 Heap* heap_; 64 Heap* heap_;
61 }; 65 };
62 66
63 67
64 // Helper class for turning the scavenger into an object visitor that is also 68 // Helper class for turning the scavenger into an object visitor that is also
65 // filtering out non-HeapObjects and objects which do not reside in new space. 69 // filtering out non-HeapObjects and objects which do not reside in new space.
66 class StaticScavengeVisitor 70 class StaticScavengeVisitor
67 : public StaticNewSpaceVisitor<StaticScavengeVisitor> { 71 : public StaticNewSpaceVisitor<StaticScavengeVisitor> {
68 public: 72 public:
69 static inline void VisitPointer(Heap* heap, HeapObject* object, Object** p); 73 static inline void VisitPointer(Heap* heap, HeapObject* object, Object** p);
70 }; 74 };
71 75
72 } // namespace internal 76 } // namespace internal
73 } // namespace v8 77 } // namespace v8
74 78
75 #endif // V8_HEAP_SCAVENGER_H_ 79 #endif // V8_HEAP_SCAVENGER_H_
OLDNEW
« no previous file with comments | « src/heap/object-stats.cc ('k') | src/heap/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698