< prev index next >

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

Print this page




   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 #include "precompiled.hpp"
  25 #include "gc/shenandoah/shenandoahAsserts.hpp"
  26 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  27 #include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
  28 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"

  29 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"

  30 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  31 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  32 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  33 #include "memory/iterator.inline.hpp"
  34 #include "runtime/interfaceSupport.inline.hpp"
  35 #ifdef COMPILER1
  36 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
  37 #endif
  38 #ifdef COMPILER2
  39 #include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp"
  40 #endif
  41 
  42 class ShenandoahBarrierSetC1;
  43 class ShenandoahBarrierSetC2;
  44 








  45 ShenandoahBarrierSet::ShenandoahBarrierSet(ShenandoahHeap* heap) :
  46   BarrierSet(make_barrier_set_assembler<ShenandoahBarrierSetAssembler>(),
  47              make_barrier_set_c1<ShenandoahBarrierSetC1>(),
  48              make_barrier_set_c2<ShenandoahBarrierSetC2>(),
  49              NULL /* barrier_set_nmethod */,
  50              BarrierSet::FakeRtti(BarrierSet::ShenandoahBarrierSet)),
  51   _heap(heap),
  52   _satb_mark_queue_buffer_allocator("SATB Buffer Allocator", ShenandoahSATBBufferSize),
  53   _satb_mark_queue_set(&_satb_mark_queue_buffer_allocator)
  54 {
  55 }
  56 
  57 ShenandoahBarrierSetAssembler* ShenandoahBarrierSet::assembler() {
  58   BarrierSetAssembler* const bsa = BarrierSet::barrier_set()->barrier_set_assembler();
  59   return reinterpret_cast<ShenandoahBarrierSetAssembler*>(bsa);
  60 }
  61 
  62 void ShenandoahBarrierSet::print_on(outputStream* st) const {
  63   st->print("ShenandoahBarrierSet");
  64 }
  65 
  66 bool ShenandoahBarrierSet::is_a(BarrierSet::Name bsn) {
  67   return bsn == BarrierSet::ShenandoahBarrierSet;
  68 }
  69 




   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 #include "precompiled.hpp"
  25 #include "gc/shenandoah/shenandoahAsserts.hpp"
  26 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  27 #include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
  28 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
  29 #include "gc/shenandoah/shenandoahBarrierSetNMethod.hpp"
  30 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
  31 #include "gc/shenandoah/shenandoahConcurrentRoots.hpp"
  32 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  33 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  34 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  35 #include "memory/iterator.inline.hpp"
  36 #include "runtime/interfaceSupport.inline.hpp"
  37 #ifdef COMPILER1
  38 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
  39 #endif
  40 #ifdef COMPILER2
  41 #include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp"
  42 #endif
  43 
  44 class ShenandoahBarrierSetC1;
  45 class ShenandoahBarrierSetC2;
  46 
  47 static BarrierSetNMethod* make_barrier_set_nmethod(ShenandoahHeap* heap) {
  48   // NMethod barriers are only used when concurrent nmethod unloading is enabled
  49   if (!ShenandoahConcurrentRoots::can_do_concurrent_class_unloading()) {
  50     return NULL;
  51   }
  52   return new ShenandoahBarrierSetNMethod(heap);
  53 }
  54 
  55 ShenandoahBarrierSet::ShenandoahBarrierSet(ShenandoahHeap* heap) :
  56   BarrierSet(make_barrier_set_assembler<ShenandoahBarrierSetAssembler>(),
  57              make_barrier_set_c1<ShenandoahBarrierSetC1>(),
  58              make_barrier_set_c2<ShenandoahBarrierSetC2>(),
  59              make_barrier_set_nmethod(heap),
  60              BarrierSet::FakeRtti(BarrierSet::ShenandoahBarrierSet)),
  61   _heap(heap),
  62   _satb_mark_queue_buffer_allocator("SATB Buffer Allocator", ShenandoahSATBBufferSize),
  63   _satb_mark_queue_set(&_satb_mark_queue_buffer_allocator)
  64 {
  65 }
  66 
  67 ShenandoahBarrierSetAssembler* ShenandoahBarrierSet::assembler() {
  68   BarrierSetAssembler* const bsa = BarrierSet::barrier_set()->barrier_set_assembler();
  69   return reinterpret_cast<ShenandoahBarrierSetAssembler*>(bsa);
  70 }
  71 
  72 void ShenandoahBarrierSet::print_on(outputStream* st) const {
  73   st->print("ShenandoahBarrierSet");
  74 }
  75 
  76 bool ShenandoahBarrierSet::is_a(BarrierSet::Name bsn) {
  77   return bsn == BarrierSet::ShenandoahBarrierSet;
  78 }
  79 


< prev index next >