< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp

Print this page




  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
  25 #define SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
  26 
  27 #include "classfile/classLoaderDataGraph.hpp"
  28 #include "classfile/stringTable.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "gc/shared/oopStorageParState.inline.hpp"


  31 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  32 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
  33 #include "gc/shenandoah/shenandoahTimingTracker.hpp"
  34 #include "gc/shenandoah/shenandoahUtils.hpp"
  35 #include "memory/resourceArea.hpp"
  36 #include "prims/resolvedMethodTable.hpp"
  37 #include "runtime/safepoint.hpp"
  38 
  39 template <bool CONCURRENT>
  40 inline ShenandoahVMRoot<CONCURRENT>::ShenandoahVMRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase) :
  41   _itr(storage), _phase(phase) {
  42 }
  43 
  44 template <bool CONCURRENT>
  45 template <typename Closure>
  46 inline void ShenandoahVMRoot<CONCURRENT>::oops_do(Closure* cl, uint worker_id) {
  47   if (CONCURRENT) {
  48     _itr.oops_do(cl);
  49   } else {
  50     ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();


 248   if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
 249     _code_roots.code_blobs_do(code, worker_id);
 250   }
 251 }
 252 
 253 template <typename ITR>
 254 void ShenandoahRootScanner<ITR>::strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc) {
 255   assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading");
 256   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
 257   ResourceMark rm;
 258 
 259   _serial_roots.oops_do(oops, worker_id);
 260   _vm_roots.oops_do(oops, worker_id);
 261   _cld_roots.always_strong_cld_do(clds, worker_id);
 262   _thread_roots.threads_do(&tc_cl, worker_id);
 263 }
 264 
 265 template <typename IsAlive, typename KeepAlive>
 266 void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAlive* keep_alive) {
 267   CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);





 268   CLDToOopClosure clds(keep_alive, ClassLoaderData::_claim_strong);
 269 
 270   _serial_roots.oops_do(keep_alive, worker_id);
 271   _vm_roots.oops_do(keep_alive, worker_id);
 272 
 273   _thread_roots.oops_do(keep_alive, NULL, worker_id);
 274   _cld_roots.cld_do(&clds, worker_id);
 275   _code_roots.code_blobs_do(&update_blobs, worker_id);

 276 
 277   _serial_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
 278   _weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
 279   _dedup_roots.oops_do(is_alive, keep_alive, worker_id);
 280 }
 281 
 282 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP


  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
  25 #define SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
  26 
  27 #include "classfile/classLoaderDataGraph.hpp"
  28 #include "classfile/stringTable.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "gc/shared/oopStorageParState.inline.hpp"
  31 #include "gc/shenandoah/shenandoahClosures.inline.hpp"
  32 #include "gc/shenandoah/shenandoahConcurrentRoots.hpp"
  33 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  34 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
  35 #include "gc/shenandoah/shenandoahTimingTracker.hpp"
  36 #include "gc/shenandoah/shenandoahUtils.hpp"
  37 #include "memory/resourceArea.hpp"
  38 #include "prims/resolvedMethodTable.hpp"
  39 #include "runtime/safepoint.hpp"
  40 
  41 template <bool CONCURRENT>
  42 inline ShenandoahVMRoot<CONCURRENT>::ShenandoahVMRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase) :
  43   _itr(storage), _phase(phase) {
  44 }
  45 
  46 template <bool CONCURRENT>
  47 template <typename Closure>
  48 inline void ShenandoahVMRoot<CONCURRENT>::oops_do(Closure* cl, uint worker_id) {
  49   if (CONCURRENT) {
  50     _itr.oops_do(cl);
  51   } else {
  52     ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();


 250   if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
 251     _code_roots.code_blobs_do(code, worker_id);
 252   }
 253 }
 254 
 255 template <typename ITR>
 256 void ShenandoahRootScanner<ITR>::strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc) {
 257   assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading");
 258   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
 259   ResourceMark rm;
 260 
 261   _serial_roots.oops_do(oops, worker_id);
 262   _vm_roots.oops_do(oops, worker_id);
 263   _cld_roots.always_strong_cld_do(clds, worker_id);
 264   _thread_roots.threads_do(&tc_cl, worker_id);
 265 }
 266 
 267 template <typename IsAlive, typename KeepAlive>
 268 void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAlive* keep_alive) {
 269   CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
 270   ShenandoahCodeBlobAndDisarmClosure blobs_and_disarm_Cl(keep_alive);
 271   CodeBlobToOopClosure* codes_cl = ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() ?
 272                                   static_cast<CodeBlobToOopClosure*>(&blobs_and_disarm_Cl) :
 273                                   static_cast<CodeBlobToOopClosure*>(&update_blobs);
 274 
 275   CLDToOopClosure clds(keep_alive, ClassLoaderData::_claim_strong);
 276 
 277   _serial_roots.oops_do(keep_alive, worker_id);
 278   _vm_roots.oops_do(keep_alive, worker_id);
 279 

 280   _cld_roots.cld_do(&clds, worker_id);
 281   _code_roots.code_blobs_do(&update_blobs, worker_id);
 282   _thread_roots.oops_do(keep_alive, NULL, worker_id);
 283 
 284   _serial_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
 285   _weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
 286   _dedup_roots.oops_do(is_alive, keep_alive, worker_id);
 287 }
 288 
 289 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
< prev index next >