src/hotspot/share/gc/shared/oopStorage.inline.hpp
changeset 49392 2956d0ece7a9
parent 49333 489f1dd40582
child 49977 9f758f0bb058
equal deleted inserted replaced
49391:02076019c25d 49392:2956d0ece7a9
    24 
    24 
    25 #ifndef SHARE_GC_SHARED_OOPSTORAGE_INLINE_HPP
    25 #ifndef SHARE_GC_SHARED_OOPSTORAGE_INLINE_HPP
    26 #define SHARE_GC_SHARED_OOPSTORAGE_INLINE_HPP
    26 #define SHARE_GC_SHARED_OOPSTORAGE_INLINE_HPP
    27 
    27 
    28 #include "gc/shared/oopStorage.hpp"
    28 #include "gc/shared/oopStorage.hpp"
    29 #include "memory/allocation.hpp"
       
    30 #include "metaprogramming/conditional.hpp"
    29 #include "metaprogramming/conditional.hpp"
    31 #include "metaprogramming/isConst.hpp"
    30 #include "metaprogramming/isConst.hpp"
    32 #include "oops/oop.hpp"
    31 #include "oops/oop.hpp"
    33 #include "runtime/safepoint.hpp"
    32 #include "runtime/safepoint.hpp"
    34 #include "utilities/count_trailing_zeros.hpp"
    33 #include "utilities/count_trailing_zeros.hpp"
   125 inline const OopStorage::Block* OopStorage::BlockList::next(const Block& block) const {
   124 inline const OopStorage::Block* OopStorage::BlockList::next(const Block& block) const {
   126   return _get_entry(block)._next;
   125   return _get_entry(block)._next;
   127 }
   126 }
   128 
   127 
   129 template<typename Closure>
   128 template<typename Closure>
   130 class OopStorage::OopFn VALUE_OBJ_CLASS_SPEC {
   129 class OopStorage::OopFn {
   131 public:
   130 public:
   132   explicit OopFn(Closure* cl) : _cl(cl) {}
   131   explicit OopFn(Closure* cl) : _cl(cl) {}
   133 
   132 
   134   template<typename OopPtr>     // [const] oop*
   133   template<typename OopPtr>     // [const] oop*
   135   bool operator()(OopPtr ptr) const {
   134   bool operator()(OopPtr ptr) const {
   145 inline OopStorage::OopFn<Closure> OopStorage::oop_fn(Closure* cl) {
   144 inline OopStorage::OopFn<Closure> OopStorage::oop_fn(Closure* cl) {
   146   return OopFn<Closure>(cl);
   145   return OopFn<Closure>(cl);
   147 }
   146 }
   148 
   147 
   149 template<typename IsAlive, typename F>
   148 template<typename IsAlive, typename F>
   150 class OopStorage::IfAliveFn VALUE_OBJ_CLASS_SPEC {
   149 class OopStorage::IfAliveFn {
   151 public:
   150 public:
   152   IfAliveFn(IsAlive* is_alive, F f) : _is_alive(is_alive), _f(f) {}
   151   IfAliveFn(IsAlive* is_alive, F f) : _is_alive(is_alive), _f(f) {}
   153 
   152 
   154   bool operator()(oop* ptr) const {
   153   bool operator()(oop* ptr) const {
   155     bool result = true;
   154     bool result = true;
   173 inline OopStorage::IfAliveFn<IsAlive, F> OopStorage::if_alive_fn(IsAlive* is_alive, F f) {
   172 inline OopStorage::IfAliveFn<IsAlive, F> OopStorage::if_alive_fn(IsAlive* is_alive, F f) {
   174   return IfAliveFn<IsAlive, F>(is_alive, f);
   173   return IfAliveFn<IsAlive, F>(is_alive, f);
   175 }
   174 }
   176 
   175 
   177 template<typename F>
   176 template<typename F>
   178 class OopStorage::SkipNullFn VALUE_OBJ_CLASS_SPEC {
   177 class OopStorage::SkipNullFn {
   179 public:
   178 public:
   180   SkipNullFn(F f) : _f(f) {}
   179   SkipNullFn(F f) : _f(f) {}
   181 
   180 
   182   template<typename OopPtr>     // [const] oop*
   181   template<typename OopPtr>     // [const] oop*
   183   bool operator()(OopPtr ptr) const {
   182   bool operator()(OopPtr ptr) const {