annotate src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp @ 1972:f95d63e2154a

6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
author stefank
date Tue, 23 Nov 2010 13:22:55 -0800
parents c18cbe5936b8
children c760f78e0a53
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "memory/allocation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "memory/threadLocalAllocBuffer.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "utilities/globalDefinitions.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // Forward decl.
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 class PLABStats;
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // A per-thread allocation buffer used during GC.
a61af66fc99e Initial load
duke
parents:
diff changeset
37 class ParGCAllocBuffer: public CHeapObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
39 char head[32];
a61af66fc99e Initial load
duke
parents:
diff changeset
40 size_t _word_sz; // in HeapWord units
a61af66fc99e Initial load
duke
parents:
diff changeset
41 HeapWord* _bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 HeapWord* _top;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 HeapWord* _end; // last allocatable address + 1
a61af66fc99e Initial load
duke
parents:
diff changeset
44 HeapWord* _hard_end; // _end + AlignmentReserve
a61af66fc99e Initial load
duke
parents:
diff changeset
45 bool _retained; // whether we hold a _retained_filler
a61af66fc99e Initial load
duke
parents:
diff changeset
46 MemRegion _retained_filler;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // In support of ergonomic sizing of PLAB's
a61af66fc99e Initial load
duke
parents:
diff changeset
48 size_t _allocated; // in HeapWord units
a61af66fc99e Initial load
duke
parents:
diff changeset
49 size_t _wasted; // in HeapWord units
a61af66fc99e Initial load
duke
parents:
diff changeset
50 char tail[32];
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
51 static size_t FillerHeaderSize;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
52 static size_t AlignmentReserve;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // Initializes the buffer to be empty, but with the given "word_sz".
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Must get initialized with "set_buf" for an allocation to succeed.
a61af66fc99e Initial load
duke
parents:
diff changeset
57 ParGCAllocBuffer(size_t word_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static const size_t min_size() {
a61af66fc99e Initial load
duke
parents:
diff changeset
60 return ThreadLocalAllocBuffer::min_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
61 }
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static const size_t max_size() {
a61af66fc99e Initial load
duke
parents:
diff changeset
64 return ThreadLocalAllocBuffer::max_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // If an allocation of the given "word_sz" can be satisfied within the
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // buffer, do the allocation, returning a pointer to the start of the
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // allocated block. If the allocation request cannot be satisfied,
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // return NULL.
a61af66fc99e Initial load
duke
parents:
diff changeset
71 HeapWord* allocate(size_t word_sz) {
a61af66fc99e Initial load
duke
parents:
diff changeset
72 HeapWord* res = _top;
634
09f82af55c3e 6808322: ParNew, CMS, G1: ParGCAllocBuffer overflow
ysr
parents: 196
diff changeset
73 if (pointer_delta(_end, _top) >= word_sz) {
09f82af55c3e 6808322: ParNew, CMS, G1: ParGCAllocBuffer overflow
ysr
parents: 196
diff changeset
74 _top = _top + word_sz;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
75 return res;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
77 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 }
a61af66fc99e Initial load
duke
parents:
diff changeset
79 }
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // Undo the last allocation in the buffer, which is required to be of the
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // "obj" of the given "word_sz".
a61af66fc99e Initial load
duke
parents:
diff changeset
83 void undo_allocation(HeapWord* obj, size_t word_sz) {
634
09f82af55c3e 6808322: ParNew, CMS, G1: ParGCAllocBuffer overflow
ysr
parents: 196
diff changeset
84 assert(pointer_delta(_top, _bottom) >= word_sz, "Bad undo");
09f82af55c3e 6808322: ParNew, CMS, G1: ParGCAllocBuffer overflow
ysr
parents: 196
diff changeset
85 assert(pointer_delta(_top, obj) == word_sz, "Bad undo");
09f82af55c3e 6808322: ParNew, CMS, G1: ParGCAllocBuffer overflow
ysr
parents: 196
diff changeset
86 _top = obj;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
87 }
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // The total (word) size of the buffer, including both allocated and
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // unallocted space.
a61af66fc99e Initial load
duke
parents:
diff changeset
91 size_t word_sz() { return _word_sz; }
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // Should only be done if we are about to reset with a new buffer of the
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // given size.
a61af66fc99e Initial load
duke
parents:
diff changeset
95 void set_word_size(size_t new_word_sz) {
a61af66fc99e Initial load
duke
parents:
diff changeset
96 assert(new_word_sz > AlignmentReserve, "Too small");
a61af66fc99e Initial load
duke
parents:
diff changeset
97 _word_sz = new_word_sz;
a61af66fc99e Initial load
duke
parents:
diff changeset
98 }
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // The number of words of unallocated space remaining in the buffer.
a61af66fc99e Initial load
duke
parents:
diff changeset
101 size_t words_remaining() {
a61af66fc99e Initial load
duke
parents:
diff changeset
102 assert(_end >= _top, "Negative buffer");
a61af66fc99e Initial load
duke
parents:
diff changeset
103 return pointer_delta(_end, _top, HeapWordSize);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 bool contains(void* addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
107 return (void*)_bottom <= addr && addr < (void*)_hard_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
108 }
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // Sets the space of the buffer to be [buf, space+word_sz()).
a61af66fc99e Initial load
duke
parents:
diff changeset
111 void set_buf(HeapWord* buf) {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 _bottom = buf;
a61af66fc99e Initial load
duke
parents:
diff changeset
113 _top = _bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
114 _hard_end = _bottom + word_sz();
a61af66fc99e Initial load
duke
parents:
diff changeset
115 _end = _hard_end - AlignmentReserve;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 assert(_end >= _top, "Negative buffer");
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // In support of ergonomic sizing
a61af66fc99e Initial load
duke
parents:
diff changeset
118 _allocated += word_sz();
a61af66fc99e Initial load
duke
parents:
diff changeset
119 }
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // Flush the stats supporting ergonomic sizing of PLAB's
a61af66fc99e Initial load
duke
parents:
diff changeset
122 void flush_stats(PLABStats* stats);
a61af66fc99e Initial load
duke
parents:
diff changeset
123 void flush_stats_and_retire(PLABStats* stats, bool retain) {
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // We flush the stats first in order to get a reading of
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // unused space in the last buffer.
a61af66fc99e Initial load
duke
parents:
diff changeset
126 if (ResizePLAB) {
a61af66fc99e Initial load
duke
parents:
diff changeset
127 flush_stats(stats);
a61af66fc99e Initial load
duke
parents:
diff changeset
128 }
a61af66fc99e Initial load
duke
parents:
diff changeset
129 // Retire the last allocation buffer.
a61af66fc99e Initial load
duke
parents:
diff changeset
130 retire(true, retain);
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // Force future allocations to fail and queries for contains()
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // to return false
a61af66fc99e Initial load
duke
parents:
diff changeset
135 void invalidate() {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 assert(!_retained, "Shouldn't retain an invalidated buffer.");
a61af66fc99e Initial load
duke
parents:
diff changeset
137 _end = _hard_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 _wasted += pointer_delta(_end, _top); // unused space
a61af66fc99e Initial load
duke
parents:
diff changeset
139 _top = _end; // force future allocations to fail
a61af66fc99e Initial load
duke
parents:
diff changeset
140 _bottom = _end; // force future contains() queries to return false
a61af66fc99e Initial load
duke
parents:
diff changeset
141 }
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // Fills in the unallocated portion of the buffer with a garbage object.
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // If "end_of_gc" is TRUE, is after the last use in the GC. IF "retain"
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // is true, attempt to re-use the unused portion in the next GC.
a61af66fc99e Initial load
duke
parents:
diff changeset
146 void retire(bool end_of_gc, bool retain);
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 void print() PRODUCT_RETURN;
a61af66fc99e Initial load
duke
parents:
diff changeset
149 };
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151 // PLAB stats book-keeping
a61af66fc99e Initial load
duke
parents:
diff changeset
152 class PLABStats VALUE_OBJ_CLASS_SPEC {
a61af66fc99e Initial load
duke
parents:
diff changeset
153 size_t _allocated; // total allocated
a61af66fc99e Initial load
duke
parents:
diff changeset
154 size_t _wasted; // of which wasted (internal fragmentation)
a61af66fc99e Initial load
duke
parents:
diff changeset
155 size_t _unused; // Unused in last buffer
a61af66fc99e Initial load
duke
parents:
diff changeset
156 size_t _used; // derived = allocated - wasted - unused
a61af66fc99e Initial load
duke
parents:
diff changeset
157 size_t _desired_plab_sz;// output of filter (below), suitably trimmed and quantized
a61af66fc99e Initial load
duke
parents:
diff changeset
158 AdaptiveWeightedAverage
a61af66fc99e Initial load
duke
parents:
diff changeset
159 _filter; // integrator with decay
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
162 PLABStats(size_t desired_plab_sz_, unsigned wt) :
a61af66fc99e Initial load
duke
parents:
diff changeset
163 _allocated(0),
a61af66fc99e Initial load
duke
parents:
diff changeset
164 _wasted(0),
a61af66fc99e Initial load
duke
parents:
diff changeset
165 _unused(0),
a61af66fc99e Initial load
duke
parents:
diff changeset
166 _used(0),
a61af66fc99e Initial load
duke
parents:
diff changeset
167 _desired_plab_sz(desired_plab_sz_),
a61af66fc99e Initial load
duke
parents:
diff changeset
168 _filter(wt)
a61af66fc99e Initial load
duke
parents:
diff changeset
169 {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 size_t min_sz = min_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
171 size_t max_sz = max_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
172 size_t aligned_min_sz = align_object_size(min_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
173 size_t aligned_max_sz = align_object_size(max_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
174 assert(min_sz <= aligned_min_sz && max_sz >= aligned_max_sz &&
a61af66fc99e Initial load
duke
parents:
diff changeset
175 min_sz <= max_sz,
a61af66fc99e Initial load
duke
parents:
diff changeset
176 "PLAB clipping computation in adjust_desired_plab_sz()"
a61af66fc99e Initial load
duke
parents:
diff changeset
177 " may be incorrect");
a61af66fc99e Initial load
duke
parents:
diff changeset
178 }
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 static const size_t min_size() {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 return ParGCAllocBuffer::min_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
182 }
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 static const size_t max_size() {
a61af66fc99e Initial load
duke
parents:
diff changeset
185 return ParGCAllocBuffer::max_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
186 }
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 size_t desired_plab_sz() {
a61af66fc99e Initial load
duke
parents:
diff changeset
189 return _desired_plab_sz;
a61af66fc99e Initial load
duke
parents:
diff changeset
190 }
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 void adjust_desired_plab_sz(); // filter computation, latches output to
a61af66fc99e Initial load
duke
parents:
diff changeset
193 // _desired_plab_sz, clears sensor accumulators
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 void add_allocated(size_t v) {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 Atomic::add_ptr(v, &_allocated);
a61af66fc99e Initial load
duke
parents:
diff changeset
197 }
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 void add_unused(size_t v) {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 Atomic::add_ptr(v, &_unused);
a61af66fc99e Initial load
duke
parents:
diff changeset
201 }
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203 void add_wasted(size_t v) {
a61af66fc99e Initial load
duke
parents:
diff changeset
204 Atomic::add_ptr(v, &_wasted);
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206 };
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208 class ParGCAllocBufferWithBOT: public ParGCAllocBuffer {
a61af66fc99e Initial load
duke
parents:
diff changeset
209 BlockOffsetArrayContigSpace _bt;
a61af66fc99e Initial load
duke
parents:
diff changeset
210 BlockOffsetSharedArray* _bsa;
a61af66fc99e Initial load
duke
parents:
diff changeset
211 HeapWord* _true_end; // end of the whole ParGCAllocBuffer
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 static const size_t ChunkSizeInWords;
a61af66fc99e Initial load
duke
parents:
diff changeset
214 static const size_t ChunkSizeInBytes;
a61af66fc99e Initial load
duke
parents:
diff changeset
215 HeapWord* allocate_slow(size_t word_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 void fill_region_with_block(MemRegion mr, bool contig);
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
220 ParGCAllocBufferWithBOT(size_t word_sz, BlockOffsetSharedArray* bsa);
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 HeapWord* allocate(size_t word_sz) {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 HeapWord* res = ParGCAllocBuffer::allocate(word_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
224 if (res != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
225 _bt.alloc_block(res, word_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
226 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 res = allocate_slow(word_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 return res;
a61af66fc99e Initial load
duke
parents:
diff changeset
230 }
a61af66fc99e Initial load
duke
parents:
diff changeset
231
a61af66fc99e Initial load
duke
parents:
diff changeset
232 void undo_allocation(HeapWord* obj, size_t word_sz);
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234 void set_buf(HeapWord* buf_start) {
a61af66fc99e Initial load
duke
parents:
diff changeset
235 ParGCAllocBuffer::set_buf(buf_start);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 _true_end = _hard_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
237 _bt.set_region(MemRegion(buf_start, word_sz()));
a61af66fc99e Initial load
duke
parents:
diff changeset
238 _bt.initialize_threshold();
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 void retire(bool end_of_gc, bool retain);
a61af66fc99e Initial load
duke
parents:
diff changeset
242
a61af66fc99e Initial load
duke
parents:
diff changeset
243 MemRegion range() {
a61af66fc99e Initial load
duke
parents:
diff changeset
244 return MemRegion(_top, _true_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
247
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
248 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP