8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_G1_G1PARSCANTHREADSTATE_HPP
26 #define SHARE_GC_G1_G1PARSCANTHREADSTATE_HPP
27
28 #include "gc/g1/dirtyCardQueue.hpp"
29 #include "gc/g1/g1CardTable.hpp"
30 #include "gc/g1/g1CollectedHeap.hpp"
31 #include "gc/g1/g1OopClosures.hpp"
32 #include "gc/g1/g1Policy.hpp"
33 #include "gc/g1/g1RemSet.hpp"
34 #include "gc/g1/heapRegionRemSet.hpp"
35 #include "gc/shared/ageTable.hpp"
36 #include "memory/allocation.hpp"
37 #include "oops/oop.hpp"
38 #include "utilities/ticks.hpp"
39
40 class G1OopStarChunkedList;
41 class G1PLABAllocator;
42 class G1EvacuationRootClosures;
43 class HeapRegion;
44 class outputStream;
45
46 class G1ParScanThreadState : public CHeapObj<mtGC> {
47 G1CollectedHeap* _g1h;
48 RefToScanQueue* _refs;
49 DirtyCardQueue _dcq;
50 G1CardTable* _ct;
51 G1EvacuationRootClosures* _closures;
52
53 G1PLABAllocator* _plab_allocator;
54
55 AgeTable _age_table;
56 InCSetState _dest[InCSetState::Num];
57 // Local tenuring threshold.
58 uint _tenuring_threshold;
59 G1ScanEvacuatedObjClosure _scanner;
60
61 uint _worker_id;
62
63 // Upper and lower threshold to start and end work queue draining.
64 uint const _stack_trim_upper_threshold;
65 uint const _stack_trim_lower_threshold;
66
67 Tickspan _trim_ticks;
68 // Map from young-age-index (0 == not young, 1 is youngest) to
69 // surviving words. base is what we get back from the malloc call
70 size_t* _surviving_young_words_base;
71 // this points into the array, as we use the first few entries for padding
72 size_t* _surviving_young_words;
73
74 // Indicates whether in the last generation (old) there is no more space
75 // available for allocation.
76 bool _old_gen_is_full;
77
78 #define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
79
80 DirtyCardQueue& dirty_card_queue() { return _dcq; }
81 G1CardTable* ct() { return _ct; }
82
83 InCSetState dest(InCSetState original) const {
84 assert(original.is_valid(),
85 "Original state invalid: " CSETSTATE_FORMAT, original.value());
86 assert(_dest[original.value()].is_valid_gen(),
87 "Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value());
88 return _dest[original.value()];
89 }
90
91 size_t _num_optional_regions;
92 G1OopStarChunkedList* _oops_into_optional_regions;
93
94 public:
95 G1ParScanThreadState(G1CollectedHeap* g1h,
96 uint worker_id,
97 size_t young_cset_length,
98 size_t optional_cset_length);
99 virtual ~G1ParScanThreadState();
100
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_G1_G1PARSCANTHREADSTATE_HPP
26 #define SHARE_GC_G1_G1PARSCANTHREADSTATE_HPP
27
28 #include "gc/g1/g1CardTable.hpp"
29 #include "gc/g1/g1CollectedHeap.hpp"
30 #include "gc/g1/g1DirtyCardQueue.hpp"
31 #include "gc/g1/g1OopClosures.hpp"
32 #include "gc/g1/g1Policy.hpp"
33 #include "gc/g1/g1RemSet.hpp"
34 #include "gc/g1/heapRegionRemSet.hpp"
35 #include "gc/shared/ageTable.hpp"
36 #include "memory/allocation.hpp"
37 #include "oops/oop.hpp"
38 #include "utilities/ticks.hpp"
39
40 class G1OopStarChunkedList;
41 class G1PLABAllocator;
42 class G1EvacuationRootClosures;
43 class HeapRegion;
44 class outputStream;
45
46 class G1ParScanThreadState : public CHeapObj<mtGC> {
47 G1CollectedHeap* _g1h;
48 RefToScanQueue* _refs;
49 G1DirtyCardQueue _dcq;
50 G1CardTable* _ct;
51 G1EvacuationRootClosures* _closures;
52
53 G1PLABAllocator* _plab_allocator;
54
55 AgeTable _age_table;
56 InCSetState _dest[InCSetState::Num];
57 // Local tenuring threshold.
58 uint _tenuring_threshold;
59 G1ScanEvacuatedObjClosure _scanner;
60
61 uint _worker_id;
62
63 // Upper and lower threshold to start and end work queue draining.
64 uint const _stack_trim_upper_threshold;
65 uint const _stack_trim_lower_threshold;
66
67 Tickspan _trim_ticks;
68 // Map from young-age-index (0 == not young, 1 is youngest) to
69 // surviving words. base is what we get back from the malloc call
70 size_t* _surviving_young_words_base;
71 // this points into the array, as we use the first few entries for padding
72 size_t* _surviving_young_words;
73
74 // Indicates whether in the last generation (old) there is no more space
75 // available for allocation.
76 bool _old_gen_is_full;
77
78 #define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
79
80 G1DirtyCardQueue& dirty_card_queue() { return _dcq; }
81 G1CardTable* ct() { return _ct; }
82
83 InCSetState dest(InCSetState original) const {
84 assert(original.is_valid(),
85 "Original state invalid: " CSETSTATE_FORMAT, original.value());
86 assert(_dest[original.value()].is_valid_gen(),
87 "Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value());
88 return _dest[original.value()];
89 }
90
91 size_t _num_optional_regions;
92 G1OopStarChunkedList* _oops_into_optional_regions;
93
94 public:
95 G1ParScanThreadState(G1CollectedHeap* g1h,
96 uint worker_id,
97 size_t young_cset_length,
98 size_t optional_cset_length);
99 virtual ~G1ParScanThreadState();
100
|