hotspot/src/share/vm/memory/sharedHeap.cpp
changeset 30152 5fe1c8494b49
parent 30147 af9a41999c6e
child 30153 596ed88949ad
equal deleted inserted replaced
30151:c7cdaa576875 30152:5fe1c8494b49
    34 #include "runtime/java.hpp"
    34 #include "runtime/java.hpp"
    35 #include "utilities/copy.hpp"
    35 #include "utilities/copy.hpp"
    36 #include "utilities/workgroup.hpp"
    36 #include "utilities/workgroup.hpp"
    37 
    37 
    38 SharedHeap::SharedHeap() :
    38 SharedHeap::SharedHeap() :
    39   CollectedHeap(),
    39   CollectedHeap()
    40   _workers(NULL)
    40 {}
    41 {
       
    42   if (UseConcMarkSweepGC || UseG1GC) {
       
    43     _workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads,
       
    44                             /* are_GC_task_threads */true,
       
    45                             /* are_ConcurrentGC_threads */false);
       
    46     if (_workers == NULL) {
       
    47       vm_exit_during_initialization("Failed necessary allocation.");
       
    48     } else {
       
    49       _workers->initialize_workers();
       
    50     }
       
    51   }
       
    52 }
       
    53 
       
    54 void SharedHeap::set_par_threads(uint t) {
       
    55   assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
       
    56   _n_par_threads = t;
       
    57 }
       
    58 
    41 
    59 SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
    42 SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
    60   : MarkScope(activate), _sh(heap)
    43   : MarkScope(activate), _sh(heap)
    61 {
    44 {
    62   if (_active) {
    45   if (_active) {
    67 }
    50 }
    68 
    51 
    69 SharedHeap::StrongRootsScope::~StrongRootsScope() {
    52 SharedHeap::StrongRootsScope::~StrongRootsScope() {
    70   Threads::assert_all_threads_claimed();
    53   Threads::assert_all_threads_claimed();
    71 }
    54 }
    72 
       
    73 void SharedHeap::set_barrier_set(BarrierSet* bs) {
       
    74   _barrier_set = bs;
       
    75   // Cached barrier set for fast access in oops
       
    76   oopDesc::set_bs(bs);
       
    77 }
       
    78 
       
    79 void SharedHeap::post_initialize() {
       
    80   CollectedHeap::post_initialize();
       
    81   ref_processing_init();
       
    82 }
       
    83 
       
    84 void SharedHeap::ref_processing_init() {}