36 class MetaspaceShared : AllStatic { |
36 class MetaspaceShared : AllStatic { |
37 |
37 |
38 // CDS support |
38 // CDS support |
39 static ReservedSpace* _shared_rs; |
39 static ReservedSpace* _shared_rs; |
40 static int _max_alignment; |
40 static int _max_alignment; |
41 |
41 static bool _link_classes_made_progress; |
|
42 static bool _check_classes_made_progress; |
|
43 static bool _has_error_classes; |
|
44 static bool _archive_loading_failed; |
42 public: |
45 public: |
43 enum { |
46 enum { |
44 vtbl_list_size = 17, // number of entries in the shared space vtable list. |
47 vtbl_list_size = 17, // number of entries in the shared space vtable list. |
45 num_virtuals = 200 // maximum number of virtual functions |
48 num_virtuals = 200 // maximum number of virtual functions |
46 // If virtual functions are added to Metadata, |
49 // If virtual functions are added to Metadata, |
65 static int max_alignment() { |
68 static int max_alignment() { |
66 CDS_ONLY(return _max_alignment); |
69 CDS_ONLY(return _max_alignment); |
67 NOT_CDS(return 0); |
70 NOT_CDS(return 0); |
68 } |
71 } |
69 |
72 |
|
73 static void prepare_for_dumping() NOT_CDS_RETURN; |
70 static void preload_and_dump(TRAPS) NOT_CDS_RETURN; |
74 static void preload_and_dump(TRAPS) NOT_CDS_RETURN; |
|
75 static int preload_and_dump(const char * class_list_path, |
|
76 GrowableArray<Klass*>* class_promote_order, |
|
77 TRAPS) NOT_CDS_RETURN; |
71 |
78 |
72 static ReservedSpace* shared_rs() { |
79 static ReservedSpace* shared_rs() { |
73 CDS_ONLY(return _shared_rs); |
80 CDS_ONLY(return _shared_rs); |
74 NOT_CDS(return NULL); |
81 NOT_CDS(return NULL); |
75 } |
82 } |
76 |
83 |
77 static void set_shared_rs(ReservedSpace* rs) { |
84 static void set_shared_rs(ReservedSpace* rs) { |
78 CDS_ONLY(_shared_rs = rs;) |
85 CDS_ONLY(_shared_rs = rs;) |
79 } |
86 } |
80 |
87 |
|
88 static void set_archive_loading_failed() { |
|
89 _archive_loading_failed = true; |
|
90 } |
81 static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false); |
91 static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false); |
82 static void initialize_shared_spaces() NOT_CDS_RETURN; |
92 static void initialize_shared_spaces() NOT_CDS_RETURN; |
83 |
93 |
84 // Return true if given address is in the mapped shared space. |
94 // Return true if given address is in the mapped shared space. |
85 static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false); |
95 static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false); |
95 // sharing is enabled. Simply returns true if sharing is not enabled |
105 // sharing is enabled. Simply returns true if sharing is not enabled |
96 // or if the remapping has already been done by a prior call. |
106 // or if the remapping has already been done by a prior call. |
97 static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true); |
107 static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true); |
98 |
108 |
99 static void print_shared_spaces(); |
109 static void print_shared_spaces(); |
|
110 |
|
111 static bool try_link_class(InstanceKlass* ik, TRAPS); |
|
112 static void link_one_shared_class(Klass* obj, TRAPS); |
|
113 static void check_one_shared_class(Klass* obj); |
|
114 static void link_and_cleanup_shared_classes(TRAPS); |
100 }; |
115 }; |
101 #endif // SHARE_VM_MEMORY_METASPACE_SHARED_HPP |
116 #endif // SHARE_VM_MEMORY_METASPACE_SHARED_HPP |