提交 383c1960 编写于 作者: R roland

8162384: Performance regression: bimorphic inlining may be bypassed by type speculation

Summary: when speculation fails at a call fallback to profile data at the call site
Reviewed-by: kvn
上级 ae9fdc36
...@@ -205,16 +205,22 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool ...@@ -205,16 +205,22 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool
int morphism = profile.morphism(); int morphism = profile.morphism();
if (speculative_receiver_type != NULL) { if (speculative_receiver_type != NULL) {
// We have a speculative type, we should be able to resolve if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) {
// the call. We do that before looking at the profiling at // We have a speculative type, we should be able to resolve
// this invoke because it may lead to bimorphic inlining which // the call. We do that before looking at the profiling at
// a speculative type should help us avoid. // this invoke because it may lead to bimorphic inlining which
receiver_method = callee->resolve_invoke(jvms->method()->holder(), // a speculative type should help us avoid.
speculative_receiver_type); receiver_method = callee->resolve_invoke(jvms->method()->holder(),
if (receiver_method == NULL) { speculative_receiver_type);
speculative_receiver_type = NULL; if (receiver_method == NULL) {
speculative_receiver_type = NULL;
} else {
morphism = 1;
}
} else { } else {
morphism = 1; // speculation failed before. Use profiling at the call
// (could allow bimorphic inlining for instance).
speculative_receiver_type = NULL;
} }
} }
if (receiver_method == NULL && if (receiver_method == NULL &&
...@@ -252,7 +258,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool ...@@ -252,7 +258,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool
Deoptimization::Reason_bimorphic : Deoptimization::Reason_bimorphic :
(speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check);
if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) &&
!too_many_traps(jvms->method(), jvms->bci(), reason) !too_many_traps(caller, bci, reason)
) { ) {
// Generate uncommon trap for class check failure path // Generate uncommon trap for class check failure path
// in case of monomorphic or bimorphic virtual call site. // in case of monomorphic or bimorphic virtual call site.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册