/* * Copyright (c) 2001, 2021, 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. *
*/
class HeapRegionRemSet : public CHeapObj<mtGC> { friendclass VMStructs;
Mutex _m; // A set of code blobs (nmethods) whose code contains pointers into // the region that owns this RSet.
G1CodeRootSet _code_roots;
G1CardSetMemoryManager _card_set_mm;
// The set of cards in the Java heap
G1CardSet _card_set;
HeapRegion* _hr;
// Cached value of heap base address. static HeapWord* _heap_base_address;
// Split the given address into region of that card and the card within that // region. inlinevoid split_card(OopOrNarrowOopStar from, uint& card_region, uint& card_within_region) const; void clear_fcc();
// Iterate the card based remembered set for merging them into the card table. // The passed closure must be a CardOrRangeVisitor; we use a template parameter // to pass it in to facilitate inlining as much as possible. template <class CardOrRangeVisitor> inlinevoid iterate_for_merge(CardOrRangeVisitor& cl);
// The region is being reclaimed; clear its remset, and any mention of // entries for this region in other remsets. void clear(bool only_cardset = false); void clear_locked(bool only_cardset = false);
// The actual # of bytes this hr_remset takes up. Also includes the code // root set.
size_t mem_size() { return _card_set.mem_size()
+ (sizeof(HeapRegionRemSet) - sizeof(G1CardSet)) // Avoid double-counting G1CardSet.
+ code_roots_mem_size();
}
// Returns the memory occupancy of all static data structures associated // with remembered sets. static size_t static_mem_size() { return G1CardSet::static_mem_size() + G1CodeRootSet::static_mem_size();
}
// Routines for managing the list of code roots that point into // the heap region that owns this RSet. void add_code_root(nmethod* nm); void add_code_root_locked(nmethod* nm); void remove_code_root(nmethod* nm);
// Applies blk->do_code_blob() to each of the entries in _code_roots void code_roots_do(CodeBlobClosure* blk) const;
void clean_code_roots(HeapRegion* hr);
// Returns the number of elements in _code_roots
size_t code_roots_list_length() const { return _code_roots.length();
}
// Returns true if the code roots contains the given // nmethod. bool code_roots_list_contains(nmethod* nm) { return _code_roots.contains(nm);
}
// Returns the amount of memory, in bytes, currently // consumed by the code roots.
size_t code_roots_mem_size();
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 und die Messung sind noch experimentell.