Mercurial > hg > graal-compiler
comparison src/share/vm/memory/space.hpp @ 20264:30c99d8e0f02
8038399: Remove dead oop_iterate MemRegion variants from SharedHeap, Generation and Space classes
Reviewed-by: tschatzl, stefank
author | mgerdin |
---|---|
date | Thu, 06 Mar 2014 09:08:18 +0100 |
parents | c49dcaf78a65 |
children | 5255b195f828 |
comparison
equal
deleted
inserted
replaced
20263:4dfab3faf5e7 | 20264:30c99d8e0f02 |
---|---|
63 class BlockOffsetTable; | 63 class BlockOffsetTable; |
64 class GenRemSet; | 64 class GenRemSet; |
65 class CardTableRS; | 65 class CardTableRS; |
66 class DirtyCardToOopClosure; | 66 class DirtyCardToOopClosure; |
67 | 67 |
68 // An oop closure that is circumscribed by a filtering memory region. | |
69 class SpaceMemRegionOopsIterClosure: public ExtendedOopClosure { | |
70 private: | |
71 ExtendedOopClosure* _cl; | |
72 MemRegion _mr; | |
73 protected: | |
74 template <class T> void do_oop_work(T* p) { | |
75 if (_mr.contains(p)) { | |
76 _cl->do_oop(p); | |
77 } | |
78 } | |
79 public: | |
80 SpaceMemRegionOopsIterClosure(ExtendedOopClosure* cl, MemRegion mr): | |
81 _cl(cl), _mr(mr) {} | |
82 virtual void do_oop(oop* p); | |
83 virtual void do_oop(narrowOop* p); | |
84 virtual bool do_metadata() { | |
85 // _cl is of type ExtendedOopClosure instead of OopClosure, so that we can check this. | |
86 assert(!_cl->do_metadata(), "I've checked all call paths, this shouldn't happen."); | |
87 return false; | |
88 } | |
89 virtual void do_klass(Klass* k) { ShouldNotReachHere(); } | |
90 virtual void do_class_loader_data(ClassLoaderData* cld) { ShouldNotReachHere(); } | |
91 }; | |
92 | |
93 // A Space describes a heap area. Class Space is an abstract | 68 // A Space describes a heap area. Class Space is an abstract |
94 // base class. | 69 // base class. |
95 // | 70 // |
96 // Space supports allocation, size computation and GC support is provided. | 71 // Space supports allocation, size computation and GC support is provided. |
97 // | 72 // |
202 | 177 |
203 // Iterate over all the ref-containing fields of all objects in the | 178 // Iterate over all the ref-containing fields of all objects in the |
204 // space, calling "cl.do_oop" on each. Fields in objects allocated by | 179 // space, calling "cl.do_oop" on each. Fields in objects allocated by |
205 // applications of the closure are not included in the iteration. | 180 // applications of the closure are not included in the iteration. |
206 virtual void oop_iterate(ExtendedOopClosure* cl); | 181 virtual void oop_iterate(ExtendedOopClosure* cl); |
207 | |
208 // Same as above, restricted to the intersection of a memory region and | |
209 // the space. Fields in objects allocated by applications of the closure | |
210 // are not included in the iteration. | |
211 virtual void oop_iterate(MemRegion mr, ExtendedOopClosure* cl) = 0; | |
212 | 182 |
213 // Iterate over all objects in the space, calling "cl.do_object" on | 183 // Iterate over all objects in the space, calling "cl.do_object" on |
214 // each. Objects allocated by applications of the closure are not | 184 // each. Objects allocated by applications of the closure are not |
215 // included in the iteration. | 185 // included in the iteration. |
216 virtual void object_iterate(ObjectClosure* blk) = 0; | 186 virtual void object_iterate(ObjectClosure* blk) = 0; |
582 return (HeapWord*)obj >= saved_mark_word(); | 552 return (HeapWord*)obj >= saved_mark_word(); |
583 } | 553 } |
584 | 554 |
585 // Iteration | 555 // Iteration |
586 void oop_iterate(ExtendedOopClosure* cl); | 556 void oop_iterate(ExtendedOopClosure* cl); |
587 void oop_iterate(MemRegion mr, ExtendedOopClosure* cl); | |
588 void object_iterate(ObjectClosure* blk); | 557 void object_iterate(ObjectClosure* blk); |
589 // For contiguous spaces this method will iterate safely over objects | 558 // For contiguous spaces this method will iterate safely over objects |
590 // in the space (i.e., between bottom and top) when at a safepoint. | 559 // in the space (i.e., between bottom and top) when at a safepoint. |
591 void safe_object_iterate(ObjectClosure* blk); | 560 void safe_object_iterate(ObjectClosure* blk); |
592 void object_iterate_mem(MemRegion mr, UpwardsObjectClosure* cl); | 561 void object_iterate_mem(MemRegion mr, UpwardsObjectClosure* cl); |