hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp
changeset 36369 f4c151403480
parent 35492 c8c0273e6b91
child 37985 539c597ee0fa
equal deleted inserted replaced
36368:569d6e8072a9 36369:f4c151403480
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   198   G1CollectedHeap* _g1h;
   198   G1CollectedHeap* _g1h;
   199   G1ParScanThreadState** _states;
   199   G1ParScanThreadState** _states;
   200   size_t* _surviving_young_words_total;
   200   size_t* _surviving_young_words_total;
   201   size_t* _cards_scanned;
   201   size_t* _cards_scanned;
   202   size_t _total_cards_scanned;
   202   size_t _total_cards_scanned;
       
   203   size_t _young_cset_length;
   203   uint _n_workers;
   204   uint _n_workers;
   204   bool _flushed;
   205   bool _flushed;
   205 
   206 
   206  public:
   207  public:
   207   G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length) :
   208   G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length) :
   208       _g1h(g1h),
   209       _g1h(g1h),
   209       _states(NEW_C_HEAP_ARRAY(G1ParScanThreadState*, n_workers, mtGC)),
   210       _states(NEW_C_HEAP_ARRAY(G1ParScanThreadState*, n_workers, mtGC)),
   210       _surviving_young_words_total(NEW_C_HEAP_ARRAY(size_t, young_cset_length, mtGC)),
   211       _surviving_young_words_total(NEW_C_HEAP_ARRAY(size_t, young_cset_length, mtGC)),
   211       _cards_scanned(NEW_C_HEAP_ARRAY(size_t, n_workers, mtGC)),
   212       _cards_scanned(NEW_C_HEAP_ARRAY(size_t, n_workers, mtGC)),
   212       _total_cards_scanned(0),
   213       _total_cards_scanned(0),
       
   214       _young_cset_length(young_cset_length),
   213       _n_workers(n_workers),
   215       _n_workers(n_workers),
   214       _flushed(false) {
   216       _flushed(false) {
   215     for (uint i = 0; i < n_workers; ++i) {
   217     for (uint i = 0; i < n_workers; ++i) {
   216       _states[i] = new_par_scan_state(i, young_cset_length);
   218       _states[i] = NULL;
   217     }
   219     }
   218     memset(_surviving_young_words_total, 0, young_cset_length * sizeof(size_t));
   220     memset(_surviving_young_words_total, 0, young_cset_length * sizeof(size_t));
   219     memset(_cards_scanned, 0, n_workers * sizeof(size_t));
   221     memset(_cards_scanned, 0, n_workers * sizeof(size_t));
   220   }
   222   }
   221 
   223