8038268: VM Crashes in MetaspaceShared::generate_vtable_methods while creating CDS archive with limiting SharedMiscCodeSize

Estimate the minimum required size for the misc code region and check if the specified misc code region size meets the minimum size requirement

Reviewed-by: jiangli, dholmes
This commit is contained in:
Calvin Cheung 2014-10-23 10:08:02 -07:00
parent 397e42b775
commit 1aa3da1067
5 changed files with 33 additions and 12 deletions

View file

@ -57,11 +57,16 @@ class MetaspaceShared : AllStatic {
static bool _archive_loading_failed;
public:
enum {
vtbl_list_size = 17, // number of entries in the shared space vtable list.
num_virtuals = 200 // maximum number of virtual functions
// If virtual functions are added to Metadata,
// this number needs to be increased. Also,
// SharedMiscCodeSize will need to be increased.
vtbl_list_size = 17, // number of entries in the shared space vtable list.
num_virtuals = 200, // maximum number of virtual functions
// If virtual functions are added to Metadata,
// this number needs to be increased. Also,
// SharedMiscCodeSize will need to be increased.
// The following 2 sizes were based on
// MetaspaceShared::generate_vtable_methods()
vtbl_method_size = 16, // conservative size of the mov1 and jmp instructions
// for the x64 platform
vtbl_common_code_size = (1*K) // conservative size of the "common_code" for the x64 platform
};
enum {