src/share/vm/oops/oop.hpp
Print this page
rev 6796 : [mq]: templateOopIterate
rev 6801 : imported patch defaultToTrue
*** 334,358 ****
// Fast access to barrier set
static BarrierSet* bs() { return _bs; }
static void set_bs(BarrierSet* bs) { _bs = bs; }
! // iterators, returns size of object
! #define OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
! int oop_iterate(OopClosureType* blk); \
! int oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr.
! ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL)
! ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL)
#if INCLUDE_ALL_GCS
!
! #define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \
int oop_iterate_backwards(OopClosureType* blk);
-
- ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL)
- ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL)
#endif
int oop_iterate_no_header(OopClosure* bk);
int oop_iterate_no_header(OopClosure* bk, MemRegion mr);
--- 334,372 ----
// Fast access to barrier set
static BarrierSet* bs() { return _bs; }
static void set_bs(BarrierSet* bs) { _bs = bs; }
! // Oop iterators
! // The oop iterates applies an ExtendedOopClosure to all the oops
! // (and maybe also iterates over the metadata).
! // See the comments in ExtendedOopClosures.
! //
! // The oop iterators use templates to get rid of the virtual calls.
! // If 'nv' is set to true the call to the virtual OopClosure::do_oop,
! // will be replaced with a non-virtual call to OopClosureType::do_oop_nv.
!
! template <bool nv, typename OopClosureType>
! int oop_iterate(OopClosureType* blk);
!
! template <typename OopClosureType>
! int oop_iterate(OopClosureType* blk) {
! oop_iterate<true>(blk);
! }
!
! template <bool nv, typename OopClosureType>
! int oop_iterate(OopClosureType* blk, MemRegion mr);
!
! template <typename OopClosureType>
! int oop_iterate(OopClosureType* blk, MemRegion mr) {
! oop_iterate<true>(blk, mr);
! }
#if INCLUDE_ALL_GCS
! template <bool nv, typename OopClosureType>
int oop_iterate_backwards(OopClosureType* blk);
#endif
int oop_iterate_no_header(OopClosure* bk);
int oop_iterate_no_header(OopClosure* bk, MemRegion mr);
*** 374,379 ****
--- 388,405 ----
static int mark_offset_in_bytes() { return offset_of(oopDesc, _mark); }
static int klass_offset_in_bytes() { return offset_of(oopDesc, _metadata._klass); }
static int klass_gap_offset_in_bytes();
};
+
+ #ifdef ASSERT
+ template <class T> void assert_is_in(T *p);
+ template <class T> void assert_is_in_closed_subset(T *p);
+ template <class T> void assert_is_in_reserved(T *p);
+ #else
+ template <class T> void assert_is_in(T *p) {}
+ template <class T> void assert_is_in_closed_subset(T *p) {}
+ template <class T> void assert_is_in_reserved(T *p) {}
+ #endif // ASSERT
+ template <class T> void assert_nothing(T *p) {}
+
#endif // SHARE_VM_OOPS_OOP_HPP