aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Igor Veresov <iveresov@openjdk.org> 2021-03-26 01:54:38 +0000
committerGravatar Igor Veresov <iveresov@openjdk.org> 2021-03-26 01:54:38 +0000
commitfe8ef3223d3ef93c822980c84e01afabd046d399 (patch)
tree3f1c0ef367b78483b3634830cb6a5178c854c575
parent4e708e58dcd2cfa54807e8e412b7c6b472467efe (diff)
downloadjdk-fe8ef3223d3ef93c822980c84e01afabd046d399.tar.gz
jdk-fe8ef3223d3ef93c822980c84e01afabd046d399.zip
8264151: ciMethod::ensure_method_data() should return false is loading resulted in empty state
Reviewed-by: dlong, kvn
-rw-r--r--src/hotspot/share/ci/ciMethod.cpp3
-rw-r--r--src/hotspot/share/ci/ciMethodData.cpp8
-rw-r--r--src/hotspot/share/ci/ciMethodData.hpp2
3 files changed, 8 insertions, 5 deletions
diff --git a/src/hotspot/share/ci/ciMethod.cpp b/src/hotspot/share/ci/ciMethod.cpp
index 19ba5205f8f..699705f1bdf 100644
--- a/src/hotspot/share/ci/ciMethod.cpp
+++ b/src/hotspot/share/ci/ciMethod.cpp
@@ -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;
diff --git a/src/hotspot/share/ci/ciMethodData.cpp b/src/hotspot/share/ci/ciMethodData.cpp
index 8f61ce744dc..8d71bbd5229 100644
--- a/src/hotspot/share/ci/ciMethodData.cpp
+++ b/src/hotspot/share/ci/ciMethodData.cpp
@@ -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 #
@@ -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) {
diff --git a/src/hotspot/share/ci/ciMethodData.hpp b/src/hotspot/share/ci/ciMethodData.hpp
index bf372701250..c19bbfc2dc4 100644
--- a/src/hotspot/share/ci/ciMethodData.hpp
+++ b/src/hotspot/share/ci/ciMethodData.hpp
@@ -507,7 +507,7 @@ public:
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) {