5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
26 #define SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
27
28 #include "memory/iterator.hpp"
29 #include "oops/oop.hpp"
30
31 class Generation;
32 class HeapWord;
33 class CardTableRS;
34 class CardTableModRefBS;
35 class DefNewGeneration;
36 class KlassRemSet;
37
38 template<class E, MEMFLAGS F, unsigned int N> class GenericTaskQueue;
39 typedef GenericTaskQueue<oop, mtGC, TASKQUEUE_SIZE> OopTaskQueue;
40 template<class T, MEMFLAGS F> class GenericTaskQueueSet;
41 typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
42
43 // Closure for iterating roots from a particular generation
44 // Note: all classes deriving from this MUST call this do_barrier
45 // method at the end of their own do_oop method!
46 // Note: no do_oop defined, this is an abstract class.
172 inline bool do_metadata_nv() { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; }
173 };
174
175 // Closure for scanning DefNewGeneration's weak references.
176 // NOTE: very much like ScanClosure but not derived from
177 // OopsInGenClosure -- weak references are processed all
178 // at once, with no notion of which generation they were in.
179 class ScanWeakRefClosure: public OopClosure {
180 protected:
181 DefNewGeneration* _g;
182 HeapWord* _boundary;
183 template <class T> inline void do_oop_work(T* p);
184 public:
185 ScanWeakRefClosure(DefNewGeneration* g);
186 virtual void do_oop(oop* p);
187 virtual void do_oop(narrowOop* p);
188 inline void do_oop_nv(oop* p);
189 inline void do_oop_nv(narrowOop* p);
190 };
191
192 #endif // SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP
26 #define SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP
27
28 #include "memory/iterator.hpp"
29 #include "oops/oop.hpp"
30
31 class Generation;
32 class HeapWord;
33 class CardTableRS;
34 class CardTableModRefBS;
35 class DefNewGeneration;
36 class KlassRemSet;
37
38 template<class E, MEMFLAGS F, unsigned int N> class GenericTaskQueue;
39 typedef GenericTaskQueue<oop, mtGC, TASKQUEUE_SIZE> OopTaskQueue;
40 template<class T, MEMFLAGS F> class GenericTaskQueueSet;
41 typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
42
43 // Closure for iterating roots from a particular generation
44 // Note: all classes deriving from this MUST call this do_barrier
45 // method at the end of their own do_oop method!
46 // Note: no do_oop defined, this is an abstract class.
172 inline bool do_metadata_nv() { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; }
173 };
174
175 // Closure for scanning DefNewGeneration's weak references.
176 // NOTE: very much like ScanClosure but not derived from
177 // OopsInGenClosure -- weak references are processed all
178 // at once, with no notion of which generation they were in.
179 class ScanWeakRefClosure: public OopClosure {
180 protected:
181 DefNewGeneration* _g;
182 HeapWord* _boundary;
183 template <class T> inline void do_oop_work(T* p);
184 public:
185 ScanWeakRefClosure(DefNewGeneration* g);
186 virtual void do_oop(oop* p);
187 virtual void do_oop(narrowOop* p);
188 inline void do_oop_nv(oop* p);
189 inline void do_oop_nv(narrowOop* p);
190 };
191
192 #endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP
|