/* * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// Atomically mark an object as live. bool mark_obj(HeapWord* addr, size_t size); inlinebool mark_obj(oop obj, size_t size);
// Return whether the specified begin or end bit is set. inlinebool is_obj_beg(idx_t bit) const; inlinebool is_obj_end(idx_t bit) const;
// Traditional interface for testing whether an object is marked or not (these // test only the begin bits). inlinebool is_marked(idx_t bit) const; inlinebool is_marked(HeapWord* addr) const; inlinebool is_marked(oop obj) const;
// Convert sizes from bits to HeapWords and back. An object that is n bits // long will be bits_to_words(n) words long. An object that is m words long // will take up words_to_bits(m) bits in the bitmap. inlinestatic size_t bits_to_words(idx_t bits); inlinestatic idx_t words_to_bits(size_t words);
// Return the size in words of an object given a begin bit and an end bit, or // the equivalent beg_addr and end_addr. inline size_t obj_size(idx_t beg_bit, idx_t end_bit) const; inline size_t obj_size(HeapWord* beg_addr, HeapWord* end_addr) const;
// Return the size in words of the object (a search is done for the end bit). inline size_t obj_size(idx_t beg_bit) const; inline size_t obj_size(HeapWord* addr) const;
// Apply live_closure to each live object that lies completely within the // range [live_range_beg, live_range_end). This is used to iterate over the // compacted region of the heap. Return values: // // incomplete The iteration is not complete. The last object that // begins in the range does not end in the range; // closure->source() is set to the start of that object. // // complete The iteration is complete. All objects in the range // were processed and the closure is not full; // closure->source() is set one past the end of the range. // // full The closure is full; closure->source() is set to one // past the end of the last object processed. // // would_overflow The next object in the range would overflow the closure; // closure->source() is set to the start of that object.
IterationStatus iterate(ParMarkBitMapClosure* live_closure,
idx_t range_beg, idx_t range_end) const; inline IterationStatus iterate(ParMarkBitMapClosure* live_closure,
HeapWord* range_beg,
HeapWord* range_end) const;
// Apply live closure as above and additionally apply dead_closure to all dead // space in the range [range_beg, dead_range_end). Note that dead_range_end // must be >= range_end. This is used to iterate over the dense prefix. // // This method assumes that if the first bit in the range (range_beg) is not // marked, then dead space begins at that point and the dead_closure is // applied. Thus callers must ensure that range_beg is not in the middle of a // live object.
IterationStatus iterate(ParMarkBitMapClosure* live_closure,
ParMarkBitMapClosure* dead_closure,
idx_t range_beg, idx_t range_end,
idx_t dead_range_end) const; inline IterationStatus iterate(ParMarkBitMapClosure* live_closure,
ParMarkBitMapClosure* dead_closure,
HeapWord* range_beg,
HeapWord* range_end,
HeapWord* dead_range_end) const;
// Return the number of live words in the range [beg_addr, end_obj) due to // objects that start in the range. If a live object extends onto the range, // the caller must detect and account for any live words due to that object. // If a live object extends beyond the end of the range, only the words within // the range are included in the result. The end of the range must be a live object, // which is the case when updating pointers. This allows a branch to be removed // from inside the loop.
size_t live_words_in_range(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const;
// Convert a heap address to/from a bit index. inline idx_t addr_to_bit(HeapWord* addr) const; inline HeapWord* bit_to_addr(idx_t bit) const;
// Return word-aligned up range_end, which must not be greater than size(). inline idx_t align_range_end(idx_t range_end) const;
// Return the bit index of the first marked object that begins (or ends, // respectively) in the range [beg, end). If no object is found, return end. // end must be word-aligned. inline idx_t find_obj_beg(idx_t beg, idx_t end) const; inline idx_t find_obj_end(idx_t beg, idx_t end) const;
// Clear a range of bits or the entire bitmap (both begin and end bits are // cleared). inlinevoid clear_range(idx_t beg, idx_t end);
// Return the number of bits required to represent the specified number of // HeapWords, or the specified region. staticinline idx_t bits_required(size_t words); staticinline idx_t bits_required(MemRegion covered_region);
bool is_live_words_in_range_in_cache(ParCompactionManager* cm, HeapWord* beg_addr) const;
size_t live_words_in_range_use_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const; void update_live_words_in_range_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj, size_t result) const;
// Each bit in the bitmap represents one unit of 'object granularity.' Objects // are double-word aligned in 32-bit VMs, but not in 64-bit VMs, so the 32-bit // granularity is 2, 64-bit is 1. staticinline size_t obj_granularity() { return size_t(MinObjAlignment); } staticinlineint obj_granularity_shift() { return LogMinObjAlignment; }
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.