Skip to content

Commit

Permalink
8264151: ciMethod::ensure_method_data() should return false is loadin…
Browse files Browse the repository at this point in the history
…g resulted in empty state

Reviewed-by: dlong, kvn
  • Loading branch information
Igor Veresov committed Mar 26, 2021
1 parent 4e708e5 commit fe8ef32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/hotspot/share/ci/ciMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,7 @@ bool ciMethod::ensure_method_data(const methodHandle& h_m) {
}
if (h_m()->method_data() != NULL) {
_method_data = CURRENT_ENV->get_method_data(h_m()->method_data());
_method_data->load_data();
return true;
return _method_data->load_data();
} else {
_method_data = CURRENT_ENV->get_empty_methodData();
return false;
Expand Down
8 changes: 6 additions & 2 deletions src/hotspot/share/ci/ciMethodData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ void ciMethodData::load_remaining_extra_data() {
}
}

void ciMethodData::load_data() {
bool ciMethodData::load_data() {
MethodData* mdo = get_MethodData();
if (mdo == NULL) {
return;
return false;
}

// To do: don't copy the data if it is not "ripe" -- require a minimum #
Expand Down Expand Up @@ -263,8 +263,12 @@ void ciMethodData::load_data() {
#ifndef PRODUCT
if (ReplayCompiles) {
ciReplay::initialize(this);
if (is_empty()) {
return false;
}
}
#endif
return true;
}

void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/ci/ciMethodData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class ciMethodData : public ciMetadata {
void set_parameter_type(int i, 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).
int dp_to_di(address dp) {
Expand Down

1 comment on commit fe8ef32

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.