Skip to content

Commit

Permalink
code refact2
Browse files Browse the repository at this point in the history
  • Loading branch information
weixlu committed Dec 2, 2024
1 parent 0c88e57 commit d44645f
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/hotspot/share/opto/doCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool
}
}

bool polymorphic_requirements_satisfied = true;

if (receiver_method == NULL &&
(have_major_receiver || morphism == 1 ||
(morphism == 2 && UseBimorphicInlining) ||
Expand All @@ -243,13 +241,9 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool
// Profiles do not suggest methods now. Look it up in the major receiver.
receiver_method = callee->resolve_invoke(jvms->method()->holder(),
profile.receiver(0));
if (!(have_major_receiver || morphism == 1 || (morphism == 2 && UseBimorphicInlining))) {
// triggerred by polymorphic, need additional check
polymorphic_requirements_satisfied = !(receiver_method->is_native() && cg_intrinsic);
}
}

if (receiver_method != NULL && polymorphic_requirements_satisfied) {
if (receiver_method != NULL) {
// The single majority receiver sufficiently outweighs the minority.
CallGenerator* hit_cg = this->call_generator(receiver_method,
vtable_index, !call_does_dispatch, jvms, allow_inline, prof_factor);
Expand All @@ -261,12 +255,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool
if ((morphism == 2 && UseBimorphicInlining) || (morphism >= 2 && PolymorphicInlining)) {
next_receiver_method = callee->resolve_invoke(jvms->method()->holder(),
profile.receiver(1));
if (!(morphism == 2 && UseBimorphicInlining)) {
// triggerred by polymorphic, need additional check
polymorphic_requirements_satisfied =
!(receiver_method->is_native() && cg_intrinsic);
}
if (next_receiver_method != NULL && polymorphic_requirements_satisfied) {
if (next_receiver_method != NULL) {
next_hit_cg = this->call_generator(next_receiver_method,
vtable_index, !call_does_dispatch, jvms,
allow_inline, prof_factor);
Expand Down

0 comments on commit d44645f

Please sign in to comment.