< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp

Print this page




  75   assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
  76   assert(is_enabled(), "String deduplication not enabled");
  77 
  78   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
  79 
  80   StringDedupUnlinkOrOopsDoClosure sd_cl(is_alive, cl);
  81 
  82   {
  83     ShenandoahWorkerTimingsTracker x(worker_times, ShenandoahPhaseTimings::StringDedupQueueRoots, worker_id);
  84     StringDedupQueue::unlink_or_oops_do(&sd_cl);
  85   }
  86   {
  87     ShenandoahWorkerTimingsTracker x(worker_times, ShenandoahPhaseTimings::StringDedupTableRoots, worker_id);
  88     StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id);
  89   }
  90 }
  91 
  92 void ShenandoahStringDedup::oops_do_slow(OopClosure* cl) {
  93   assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
  94   assert(is_enabled(), "String deduplication not enabled");
  95   AlwaysTrueClosure always_true;
  96   StringDedupUnlinkOrOopsDoClosure sd_cl(&always_true, cl);
  97   StringDedupQueue::unlink_or_oops_do(&sd_cl);
  98   StringDedupTable::unlink_or_oops_do(&sd_cl, 0);
  99 }
 100 
 101 class ShenandoahIsMarkedNextClosure : public BoolObjectClosure {
 102 private:
 103   ShenandoahMarkingContext* const _mark_context;
 104 
 105 public:
 106   ShenandoahIsMarkedNextClosure() : _mark_context(ShenandoahHeap::heap()->marking_context()) { }
 107 
 108   bool do_object_b(oop obj) {
 109     return _mark_context->is_marked(obj);
 110   }
 111 };
 112 
 113 //
 114 // Task for parallel unlink_or_oops_do() operation on the deduplication queue
 115 // and table.




  75   assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
  76   assert(is_enabled(), "String deduplication not enabled");
  77 
  78   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
  79 
  80   StringDedupUnlinkOrOopsDoClosure sd_cl(is_alive, cl);
  81 
  82   {
  83     ShenandoahWorkerTimingsTracker x(worker_times, ShenandoahPhaseTimings::StringDedupQueueRoots, worker_id);
  84     StringDedupQueue::unlink_or_oops_do(&sd_cl);
  85   }
  86   {
  87     ShenandoahWorkerTimingsTracker x(worker_times, ShenandoahPhaseTimings::StringDedupTableRoots, worker_id);
  88     StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id);
  89   }
  90 }
  91 
  92 void ShenandoahStringDedup::oops_do_slow(OopClosure* cl) {
  93   assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
  94   assert(is_enabled(), "String deduplication not enabled");
  95   ShenandoahAlwaysTrueClosure always_true;
  96   StringDedupUnlinkOrOopsDoClosure sd_cl(&always_true, cl);
  97   StringDedupQueue::unlink_or_oops_do(&sd_cl);
  98   StringDedupTable::unlink_or_oops_do(&sd_cl, 0);
  99 }
 100 
 101 class ShenandoahIsMarkedNextClosure : public BoolObjectClosure {
 102 private:
 103   ShenandoahMarkingContext* const _mark_context;
 104 
 105 public:
 106   ShenandoahIsMarkedNextClosure() : _mark_context(ShenandoahHeap::heap()->marking_context()) { }
 107 
 108   bool do_object_b(oop obj) {
 109     return _mark_context->is_marked(obj);
 110   }
 111 };
 112 
 113 //
 114 // Task for parallel unlink_or_oops_do() operation on the deduplication queue
 115 // and table.


< prev index next >