/* * Copyright (c) 2018, 2022, 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 FileMapInfo; struct LoadedArchiveHeapRegion;
class ArchiveHeapLoader : AllStatic { public: // At runtime, heap regions in the CDS archive can be used in two different ways, // depending on the GC type: // - Mapped: (G1 only) the regions are directly mapped into the Java heap // - Loaded: At VM start-up, the objects in the heap regions are copied into the // Java heap. This is easier to implement than mapping but // slightly less efficient, as the embedded pointers need to be relocated. staticbool can_use() { return can_map() || can_load(); }
// Can this VM map archived heap regions? Currently only G1+compressed{oops,cp} staticbool can_map() {
CDS_JAVA_HEAP_ONLY(return (UseG1GC && UseCompressedClassPointers);)
NOT_CDS_JAVA_HEAP(returnfalse;)
} staticbool is_mapped() { return closed_regions_mapped() && open_regions_mapped();
}
// Can this VM load the objects from archived heap regions into the heap at start-up? staticbool can_load() NOT_CDS_JAVA_HEAP_RETURN_(false); staticvoid finish_initialization() NOT_CDS_JAVA_HEAP_RETURN; staticbool is_loaded() {
CDS_JAVA_HEAP_ONLY(return _is_loaded;)
NOT_CDS_JAVA_HEAP(returnfalse;)
}
// NarrowOops stored in the CDS archive may use a different encoding scheme // than CompressedOops::{base,shift} -- see FileMapInfo::map_heap_regions_impl. // To decode them, do not use CompressedOops::decode_not_null. Use this // function instead. inlinestatic oop decode_from_archive(narrowOop v) NOT_CDS_JAVA_HEAP_RETURN_(NULL);
// UseCompressedOops only: Used by decode_from_archive staticbool _narrow_oop_base_initialized; static address _narrow_oop_base; staticint _narrow_oop_shift;
// is_mapped() only: the mapped address of each region is offset by this amount from // their requested address. static ptrdiff_t _mapped_heap_delta; staticbool _mapped_heap_relocation_initialized;
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.