Skip to content

Commit 10da767

Browse files
author
Igor Veresov
committed
8257847: Tiered should publish MDO data pointer for interpreter after profile start
Reviewed-by: thartmann, kvn, dlong
1 parent 2a62d5d commit 10da767

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/hotspot/share/compiler/tieredThresholdPolicy.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ bool TieredThresholdPolicy::is_mature(Method* method) {
790790
// start profiling without waiting for the compiled method to arrive.
791791
// We also take the load on compilers into the account.
792792
bool TieredThresholdPolicy::should_create_mdo(const methodHandle& method, CompLevel cur_level) {
793-
if (cur_level != CompLevel_none || force_comp_at_level_simple(method)) {
793+
if (cur_level != CompLevel_none || force_comp_at_level_simple(method) || !ProfileInterpreter) {
794794
return false;
795795
}
796796
int i = method->invocation_count();
@@ -826,6 +826,18 @@ void TieredThresholdPolicy::create_mdo(const methodHandle& mh, Thread* THREAD) {
826826
if (mh->method_data() == NULL) {
827827
Method::build_interpreter_method_data(mh, CHECK_AND_CLEAR);
828828
}
829+
if (ProfileInterpreter) {
830+
MethodData* mdo = mh->method_data();
831+
if (mdo != NULL) {
832+
JavaThread* jt = THREAD->as_Java_thread();
833+
frame last_frame = jt->last_frame();
834+
if (last_frame.is_interpreted_frame() && mh == last_frame.interpreter_frame_method()) {
835+
int bci = last_frame.interpreter_frame_bci();
836+
address dp = mdo->bci_to_dp(bci);
837+
last_frame.interpreter_frame_set_mdp(dp);
838+
}
839+
}
840+
}
829841
}
830842

831843

0 commit comments

Comments
 (0)