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.
67 Universe::serialize(soc, true);
68 soc->do_tag(--tag);
69
70 // Dump/restore references to commonly used names and signatures.
71 vmSymbols::serialize(soc);
72 soc->do_tag(--tag);
73
74 soc->do_tag(666);
75 }
|
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 // Verify the sizes of various metadata in the system.
56 soc->do_tag(sizeof(Method));
57 soc->do_tag(sizeof(ConstMethod));
58 soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE));
59 soc->do_tag(sizeof(ConstantPool));
60 soc->do_tag(sizeof(ConstantPoolCache));
61 soc->do_tag(objArrayOopDesc::base_offset_in_bytes());
62 soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE));
63 soc->do_tag(sizeof(Symbol));
64
65 // Dump/restore miscellaneous metadata.
66 Universe::serialize(soc, true);
67 soc->do_tag(--tag);
68
69 // Dump/restore references to commonly used names and signatures.
70 vmSymbols::serialize(soc);
71 soc->do_tag(--tag);
72
73 soc->do_tag(666);
74 }
|