25 #include "precompiled.hpp" 26 #include "classfile/dictionary.hpp" 27 #include "classfile/loaderConstraints.hpp" 28 #include "classfile/placeholders.hpp" 29 #include "classfile/symbolTable.hpp" 30 #include "classfile/systemDictionary.hpp" 31 #include "code/codeCache.hpp" 32 #include "memory/filemap.hpp" 33 #include "memory/gcLocker.hpp" 34 #include "memory/metaspace.hpp" 35 #include "memory/metaspaceShared.hpp" 36 #include "oops/objArrayOop.hpp" 37 #include "oops/oop.inline.hpp" 38 #include "runtime/signature.hpp" 39 #include "runtime/vm_operations.hpp" 40 #include "runtime/vmThread.hpp" 41 #include "utilities/hashtable.inline.hpp" 42 43 44 int MetaspaceShared::_max_alignment = 0; 45 int MetaspaceShared::max_alignment() { return _max_alignment; } 46 void MetaspaceShared::set_max_alignment(int alignment) { _max_alignment = alignment; } 47 48 // Accessor functions to save shared space created for metadata, which has 49 // extra space allocated at the end for miscellaneous data and code. 50 ReservedSpace* MetaspaceShared::_shared_rs = NULL; 51 ReservedSpace* MetaspaceShared::shared_rs() { return _shared_rs; } 52 void MetaspaceShared::set_shared_rs(ReservedSpace* rs) { _shared_rs = rs; } 53 54 // Read/write a data stream for restoring/preserving metadata pointers and 55 // miscellaneous data from/to the shared archive file. 56 57 void MetaspaceShared::serialize(SerializeClosure* soc) { 58 int tag = 0; 59 soc->do_tag(--tag); 60 61 assert(!UseCompressedOops, "UseCompressedOops doesn't work with shared archive"); 62 // Verify the sizes of various metadata in the system. 63 soc->do_tag(sizeof(Method)); 64 soc->do_tag(sizeof(ConstMethod)); 65 soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE)); 66 soc->do_tag(sizeof(ConstantPool)); 67 soc->do_tag(sizeof(ConstantPoolCache)); 68 soc->do_tag(objArrayOopDesc::base_offset_in_bytes()); 69 soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE)); 70 soc->do_tag(sizeof(Symbol)); 71 72 // Dump/restore miscellaneous metadata. | 25 #include "precompiled.hpp" 26 #include "classfile/dictionary.hpp" 27 #include "classfile/loaderConstraints.hpp" 28 #include "classfile/placeholders.hpp" 29 #include "classfile/symbolTable.hpp" 30 #include "classfile/systemDictionary.hpp" 31 #include "code/codeCache.hpp" 32 #include "memory/filemap.hpp" 33 #include "memory/gcLocker.hpp" 34 #include "memory/metaspace.hpp" 35 #include "memory/metaspaceShared.hpp" 36 #include "oops/objArrayOop.hpp" 37 #include "oops/oop.inline.hpp" 38 #include "runtime/signature.hpp" 39 #include "runtime/vm_operations.hpp" 40 #include "runtime/vmThread.hpp" 41 #include "utilities/hashtable.inline.hpp" 42 43 44 int MetaspaceShared::_max_alignment = 0; 45 46 ReservedSpace* MetaspaceShared::_shared_rs = NULL; 47 48 // Read/write a data stream for restoring/preserving metadata pointers and 49 // miscellaneous data from/to the shared archive file. 50 51 void MetaspaceShared::serialize(SerializeClosure* soc) { 52 int tag = 0; 53 soc->do_tag(--tag); 54 55 assert(!UseCompressedOops, "UseCompressedOops doesn't work with shared archive"); 56 // Verify the sizes of various metadata in the system. 57 soc->do_tag(sizeof(Method)); 58 soc->do_tag(sizeof(ConstMethod)); 59 soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE)); 60 soc->do_tag(sizeof(ConstantPool)); 61 soc->do_tag(sizeof(ConstantPoolCache)); 62 soc->do_tag(objArrayOopDesc::base_offset_in_bytes()); 63 soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE)); 64 soc->do_tag(sizeof(Symbol)); 65 66 // Dump/restore miscellaneous metadata. |