8264151: ciMethod::ensure_method_data() should return false is loading resulted in empty state

Reviewed-by: dlong, kvn
This commit is contained in:
Igor Veresov 2021-03-26 01:54:38 +00:00
parent 4e708e58dc
commit fe8ef3223d
3 changed files with 8 additions and 5 deletions

View File

@ -965,8 +965,7 @@ bool ciMethod::ensure_method_data(const methodHandle& h_m) {
} }
if (h_m()->method_data() != NULL) { if (h_m()->method_data() != NULL) {
_method_data = CURRENT_ENV->get_method_data(h_m()->method_data()); _method_data = CURRENT_ENV->get_method_data(h_m()->method_data());
_method_data->load_data(); return _method_data->load_data();
return true;
} else { } else {
_method_data = CURRENT_ENV->get_empty_methodData(); _method_data = CURRENT_ENV->get_empty_methodData();
return false; return false;

View File

@ -170,10 +170,10 @@ void ciMethodData::load_remaining_extra_data() {
} }
} }
void ciMethodData::load_data() { bool ciMethodData::load_data() {
MethodData* mdo = get_MethodData(); MethodData* mdo = get_MethodData();
if (mdo == NULL) { if (mdo == NULL) {
return; return false;
} }
// To do: don't copy the data if it is not "ripe" -- require a minimum # // To do: don't copy the data if it is not "ripe" -- require a minimum #
@ -263,8 +263,12 @@ void ciMethodData::load_data() {
#ifndef PRODUCT #ifndef PRODUCT
if (ReplayCompiles) { if (ReplayCompiles) {
ciReplay::initialize(this); ciReplay::initialize(this);
if (is_empty()) {
return false;
}
} }
#endif #endif
return true;
} }
void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) { void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {

View File

@ -507,7 +507,7 @@ public:
void set_parameter_type(int i, ciKlass* k); void set_parameter_type(int i, ciKlass* k);
void set_return_type(int bci, ciKlass* k); void set_return_type(int bci, ciKlass* k);
void load_data(); bool load_data();
// Convert a dp (data pointer) to a di (data index). // Convert a dp (data pointer) to a di (data index).
int dp_to_di(address dp) { int dp_to_di(address dp) {