hotspot/src/share/vm/gc/g1/g1ParScanThreadState.cpp
changeset 33213 b937f634f56e
parent 33105 294e48b4f704
child 33224 bc5da96c1f0e
equal deleted inserted replaced
33212:906b3d079b13 33213:b937f634f56e
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "gc/g1/g1Allocator.inline.hpp"
    26 #include "gc/g1/g1Allocator.inline.hpp"
    27 #include "gc/g1/g1CollectedHeap.inline.hpp"
    27 #include "gc/g1/g1CollectedHeap.inline.hpp"
    28 #include "gc/g1/g1OopClosures.inline.hpp"
    28 #include "gc/g1/g1OopClosures.inline.hpp"
    29 #include "gc/g1/g1ParScanThreadState.inline.hpp"
    29 #include "gc/g1/g1ParScanThreadState.inline.hpp"
       
    30 #include "gc/g1/g1RootClosures.hpp"
    30 #include "gc/g1/g1StringDedup.hpp"
    31 #include "gc/g1/g1StringDedup.hpp"
    31 #include "gc/shared/taskqueue.inline.hpp"
    32 #include "gc/shared/taskqueue.inline.hpp"
    32 #include "oops/oop.inline.hpp"
    33 #include "oops/oop.inline.hpp"
    33 #include "runtime/prefetch.inline.hpp"
    34 #include "runtime/prefetch.inline.hpp"
    34 
    35 
    35 G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint worker_id, size_t young_cset_length)
    36 G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint worker_id, size_t young_cset_length)
    36   : _g1h(g1h),
    37   : _g1h(g1h),
    37     _refs(g1h->task_queue(worker_id)),
    38     _refs(g1h->task_queue(worker_id)),
    38     _dcq(&g1h->dirty_card_queue_set()),
    39     _dcq(&g1h->dirty_card_queue_set()),
    39     _ct_bs(g1h->g1_barrier_set()),
    40     _ct_bs(g1h->g1_barrier_set()),
    40     _g1_rem(g1h->g1_rem_set()),
    41     _closures(NULL),
    41     _hash_seed(17),
    42     _hash_seed(17),
    42     _worker_id(worker_id),
    43     _worker_id(worker_id),
    43     _tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
    44     _tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
    44     _age_table(false),
    45     _age_table(false),
    45     _scanner(g1h),
    46     _scanner(g1h),
    67   _dest[InCSetState::NotInCSet]    = InCSetState::NotInCSet;
    68   _dest[InCSetState::NotInCSet]    = InCSetState::NotInCSet;
    68   // The dest for Young is used when the objects are aged enough to
    69   // The dest for Young is used when the objects are aged enough to
    69   // need to be moved to the next space.
    70   // need to be moved to the next space.
    70   _dest[InCSetState::Young]        = InCSetState::Old;
    71   _dest[InCSetState::Young]        = InCSetState::Old;
    71   _dest[InCSetState::Old]          = InCSetState::Old;
    72   _dest[InCSetState::Old]          = InCSetState::Old;
       
    73 
       
    74   _closures = G1EvacuationRootClosures::create_root_closures(this, _g1h);
    72 }
    75 }
    73 
    76 
    74 // Pass locally gathered statistics to global state.
    77 // Pass locally gathered statistics to global state.
    75 void G1ParScanThreadState::flush(size_t* surviving_young_words) {
    78 void G1ParScanThreadState::flush(size_t* surviving_young_words) {
    76   _dcq.flush();
    79   _dcq.flush();
    84   }
    87   }
    85 }
    88 }
    86 
    89 
    87 G1ParScanThreadState::~G1ParScanThreadState() {
    90 G1ParScanThreadState::~G1ParScanThreadState() {
    88   delete _plab_allocator;
    91   delete _plab_allocator;
       
    92   delete _closures;
    89   FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base);
    93   FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base);
    90 }
    94 }
    91 
    95 
    92 void G1ParScanThreadState::waste(size_t& wasted, size_t& undo_wasted) {
    96 void G1ParScanThreadState::waste(size_t& wasted, size_t& undo_wasted) {
    93   _plab_allocator->waste(wasted, undo_wasted);
    97   _plab_allocator->waste(wasted, undo_wasted);