< prev index next >

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

Print this page
rev 55406 : 8225582: Shenandoah: Enable concurrent evacuation of JNIHandles


   7  *
   8  * This code is distributed in the hope that it will be useful, but WITHOUT
   9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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 "gc/shenandoah/shenandoahHeuristics.hpp"
  28 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
  29 #include "gc/shenandoah/shenandoahTimingTracker.hpp"
  30 #include "gc/shenandoah/shenandoahUtils.hpp"
  31 #include "memory/resourceArea.hpp"

















  32 
  33 template <typename IsAlive, typename KeepAlive>
  34 void ShenandoahWeakRoots::oops_do(IsAlive* is_alive, KeepAlive* keep_alive, uint worker_id) {
  35   _task.work<IsAlive, KeepAlive>(worker_id, is_alive, keep_alive);
  36 }
  37 
  38 template <typename ITR>
  39 ShenandoahCodeCacheRoots<ITR>::ShenandoahCodeCacheRoots() {
  40   nmethod::oops_do_marking_prologue();
  41 }
  42 
  43 template <typename ITR>
  44 void ShenandoahCodeCacheRoots<ITR>::code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id) {
  45   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
  46   ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::CodeCacheRoots, worker_id);
  47   _coderoots_iterator.possibly_parallel_blobs_do(blob_cl);
  48 }
  49 
  50 template <typename ITR>
  51 ShenandoahCodeCacheRoots<ITR>::~ShenandoahCodeCacheRoots() {




   7  *
   8  * This code is distributed in the hope that it will be useful, but WITHOUT
   9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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 "gc/shared/oopStorageParState.inline.hpp"
  29 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  30 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
  31 #include "gc/shenandoah/shenandoahTimingTracker.hpp"
  32 #include "gc/shenandoah/shenandoahUtils.hpp"
  33 #include "memory/resourceArea.hpp"
  34 
  35 template <bool CONCURRENT>
  36 ShenandoahJNIHandleRoots<CONCURRENT>::ShenandoahJNIHandleRoots() :
  37   _itr(JNIHandles::global_handles()) {
  38 }
  39 
  40 template <bool CONCURRENT>
  41 template <typename T>
  42 void ShenandoahJNIHandleRoots<CONCURRENT>::oops_do(T* cl, uint worker_id) {
  43   if (CONCURRENT) {
  44     _itr.oops_do(cl);
  45   } else {
  46     ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
  47     ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::JNIRoots, worker_id);
  48     _itr.oops_do(cl);
  49   }
  50 }
  51 
  52 template <typename IsAlive, typename KeepAlive>
  53 void ShenandoahWeakRoots::oops_do(IsAlive* is_alive, KeepAlive* keep_alive, uint worker_id) {
  54   _task.work<IsAlive, KeepAlive>(worker_id, is_alive, keep_alive);
  55 }
  56 
  57 template <typename ITR>
  58 ShenandoahCodeCacheRoots<ITR>::ShenandoahCodeCacheRoots() {
  59   nmethod::oops_do_marking_prologue();
  60 }
  61 
  62 template <typename ITR>
  63 void ShenandoahCodeCacheRoots<ITR>::code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id) {
  64   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
  65   ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::CodeCacheRoots, worker_id);
  66   _coderoots_iterator.possibly_parallel_blobs_do(blob_cl);
  67 }
  68 
  69 template <typename ITR>
  70 ShenandoahCodeCacheRoots<ITR>::~ShenandoahCodeCacheRoots() {


< prev index next >