< prev index next >

src/hotspot/share/gc/z/zRootsIterator.hpp

Print this page




   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 #ifndef SHARE_GC_Z_ZROOTSITERATOR_HPP
  25 #define SHARE_GC_Z_ZROOTSITERATOR_HPP
  26 

  27 #include "memory/allocation.hpp"
  28 #include "memory/iterator.hpp"
  29 #include "utilities/globalDefinitions.hpp"
  30 
  31 template <typename T, void (T::*F)(OopClosure*)>
  32 class ZSerialOopsDo VALUE_OBJ_CLASS_SPEC {
  33 private:
  34   T* const      _iter;
  35   volatile bool _claimed;
  36 
  37 public:
  38   ZSerialOopsDo(T* iter);
  39   void oops_do(OopClosure* cl);
  40 };
  41 
  42 template <typename T, void (T::*F)(OopClosure*)>
  43 class ZParallelOopsDo VALUE_OBJ_CLASS_SPEC {
  44 private:
  45   T* const      _iter;
  46   volatile bool _completed;


 111 
 112 class ZWeakRootsIterator VALUE_OBJ_CLASS_SPEC {
 113 private:
 114   void do_jni_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
 115   void do_jvmti_weak_export(BoolObjectClosure* is_alive, OopClosure* cl);
 116   void do_trace(BoolObjectClosure* is_alive, OopClosure* cl);
 117   void do_symbol_table(BoolObjectClosure* is_alive, OopClosure* cl);
 118   void do_string_table(BoolObjectClosure* is_alive, OopClosure* cl);
 119 
 120   ZSerialUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jni_weak_handles>  _jni_weak_handles;
 121   ZSerialUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
 122   ZSerialUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_trace>             _trace;
 123   ZParallelUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_symbol_table>    _symbol_table;
 124   ZParallelUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_string_table>    _string_table;
 125 
 126 public:
 127   ZWeakRootsIterator();
 128   ~ZWeakRootsIterator();
 129 
 130   void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* cl);















 131   void oops_do(OopClosure* cl);
 132 };
 133 
 134 class ZThreadRootsIterator VALUE_OBJ_CLASS_SPEC {
 135 private:
 136   void do_threads(OopClosure* cl);
 137 
 138   ZParallelOopsDo<ZThreadRootsIterator, &ZThreadRootsIterator::do_threads> _threads;
 139 
 140 public:
 141   ZThreadRootsIterator();
 142   ~ZThreadRootsIterator();
 143 
 144   void oops_do(OopClosure* cl);
 145 };
 146 
 147 #endif // SHARE_GC_Z_ZROOTSITERATOR_HPP


   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 #ifndef SHARE_GC_Z_ZROOTSITERATOR_HPP
  25 #define SHARE_GC_Z_ZROOTSITERATOR_HPP
  26 
  27 #include "gc/shared/oopStorage.hpp"
  28 #include "memory/allocation.hpp"
  29 #include "memory/iterator.hpp"
  30 #include "utilities/globalDefinitions.hpp"
  31 
  32 template <typename T, void (T::*F)(OopClosure*)>
  33 class ZSerialOopsDo VALUE_OBJ_CLASS_SPEC {
  34 private:
  35   T* const      _iter;
  36   volatile bool _claimed;
  37 
  38 public:
  39   ZSerialOopsDo(T* iter);
  40   void oops_do(OopClosure* cl);
  41 };
  42 
  43 template <typename T, void (T::*F)(OopClosure*)>
  44 class ZParallelOopsDo VALUE_OBJ_CLASS_SPEC {
  45 private:
  46   T* const      _iter;
  47   volatile bool _completed;


 112 
 113 class ZWeakRootsIterator VALUE_OBJ_CLASS_SPEC {
 114 private:
 115   void do_jni_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
 116   void do_jvmti_weak_export(BoolObjectClosure* is_alive, OopClosure* cl);
 117   void do_trace(BoolObjectClosure* is_alive, OopClosure* cl);
 118   void do_symbol_table(BoolObjectClosure* is_alive, OopClosure* cl);
 119   void do_string_table(BoolObjectClosure* is_alive, OopClosure* cl);
 120 
 121   ZSerialUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jni_weak_handles>  _jni_weak_handles;
 122   ZSerialUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
 123   ZSerialUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_trace>             _trace;
 124   ZParallelUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_symbol_table>    _symbol_table;
 125   ZParallelUnlinkOrOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_string_table>    _string_table;
 126 
 127 public:
 128   ZWeakRootsIterator();
 129   ~ZWeakRootsIterator();
 130 
 131   void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* cl);
 132   void oops_do(OopClosure* cl);
 133 };
 134 
 135 class ZConcurrentWeakRootsIterator VALUE_OBJ_CLASS_SPEC {
 136 private:
 137   OopStorage::ParState<true /* concurrent */, false /* is_const */> _par_state;
 138 
 139   void do_jni_weak_handles(OopClosure* cl);
 140 
 141   ZParallelOopsDo<ZConcurrentWeakRootsIterator, &ZConcurrentWeakRootsIterator::do_jni_weak_handles>  _jni_weak_handles;
 142 
 143 public:
 144   ZConcurrentWeakRootsIterator();
 145   ~ZConcurrentWeakRootsIterator();
 146 
 147   void oops_do(OopClosure* cl);
 148 };
 149 
 150 class ZThreadRootsIterator VALUE_OBJ_CLASS_SPEC {
 151 private:
 152   void do_threads(OopClosure* cl);
 153 
 154   ZParallelOopsDo<ZThreadRootsIterator, &ZThreadRootsIterator::do_threads> _threads;
 155 
 156 public:
 157   ZThreadRootsIterator();
 158   ~ZThreadRootsIterator();
 159 
 160   void oops_do(OopClosure* cl);
 161 };
 162 
 163 #endif // SHARE_GC_Z_ZROOTSITERATOR_HPP
< prev index next >