0 /*
1 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
|
0 /*
1 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
|
251
252 // Requires "addr" to be the start of a chunk, and returns its size.
253 // "addr + size" is required to be the start of a new chunk, or the end
254 // of the active area of the heap. Assumes (and verifies in non-product
255 // builds) that addr is in the allocated part of the heap and is
256 // the start of a chunk.
257 virtual size_t block_size(const HeapWord* addr) const;
258
259 // Requires "addr" to be the start of a block, and returns "TRUE" iff
260 // the block is an object. Assumes (and verifies in non-product
261 // builds) that addr is in the allocated part of the heap and is
262 // the start of a chunk.
263 virtual bool block_is_obj(const HeapWord* addr) const;
264
265 // Section on TLAB's.
266 virtual bool supports_tlab_allocation() const;
267 virtual size_t tlab_capacity(Thread* thr) const;
268 virtual size_t tlab_used(Thread* thr) const;
269 virtual size_t unsafe_max_tlab_alloc(Thread* thr) const;
270 virtual HeapWord* allocate_new_tlab(size_t size);
271
272 // Can a compiler initialize a new object without store barriers?
273 // This permission only extends from the creation of a new object
274 // via a TLAB up to the first subsequent safepoint.
275 virtual bool can_elide_tlab_store_barriers() const {
276 return true;
277 }
278
279 // We don't need barriers for stores to objects in the
280 // young gen and, a fortiori, for initializing stores to
281 // objects therein. This applies to DefNew+Tenured and ParNew+CMS
282 // only and may need to be re-examined in case other
283 // kinds of collectors are implemented in the future.
284 virtual bool can_elide_initializing_store_barrier(oop new_obj) {
285 return is_in_young(new_obj);
286 }
287
288 // The "requestor" generation is performing some garbage collection
289 // action for which it would be useful to have scratch space. The
290 // requestor promises to allocate no more than "max_alloc_words" in any
291 // older generation (via promotion say.) Any blocks of space that can
292 // be provided are returned as a list of ScratchBlocks, sorted by
293 // decreasing size.
294 ScratchBlock* gather_scratch(Generation* requestor, size_t max_alloc_words);
295 // Allow each generation to reset any scratch space that it has
296 // contributed as it needs.
297 void release_scratch();
298
299 // Ensure parsability: override
300 virtual void ensure_parsability(bool retire_tlabs);
301
302 // Time in ms since the longest time a collector ran in
303 // in any generation.
304 virtual jlong millis_since_last_gc();
305
|
251
252 // Requires "addr" to be the start of a chunk, and returns its size.
253 // "addr + size" is required to be the start of a new chunk, or the end
254 // of the active area of the heap. Assumes (and verifies in non-product
255 // builds) that addr is in the allocated part of the heap and is
256 // the start of a chunk.
257 virtual size_t block_size(const HeapWord* addr) const;
258
259 // Requires "addr" to be the start of a block, and returns "TRUE" iff
260 // the block is an object. Assumes (and verifies in non-product
261 // builds) that addr is in the allocated part of the heap and is
262 // the start of a chunk.
263 virtual bool block_is_obj(const HeapWord* addr) const;
264
265 // Section on TLAB's.
266 virtual bool supports_tlab_allocation() const;
267 virtual size_t tlab_capacity(Thread* thr) const;
268 virtual size_t tlab_used(Thread* thr) const;
269 virtual size_t unsafe_max_tlab_alloc(Thread* thr) const;
270 virtual HeapWord* allocate_new_tlab(size_t size);
271
272 // The "requestor" generation is performing some garbage collection
273 // action for which it would be useful to have scratch space. The
274 // requestor promises to allocate no more than "max_alloc_words" in any
275 // older generation (via promotion say.) Any blocks of space that can
276 // be provided are returned as a list of ScratchBlocks, sorted by
277 // decreasing size.
278 ScratchBlock* gather_scratch(Generation* requestor, size_t max_alloc_words);
279 // Allow each generation to reset any scratch space that it has
280 // contributed as it needs.
281 void release_scratch();
282
283 // Ensure parsability: override
284 virtual void ensure_parsability(bool retire_tlabs);
285
286 // Time in ms since the longest time a collector ran in
287 // in any generation.
288 virtual jlong millis_since_last_gc();
289
|