[jdk18] RFR: 8275638: GraphKit::combine_exception_states fails with "matching stack sizes" assert
Vladimir Ivanov
vlivanov at openjdk.java.net
Thu Dec 23 18:35:21 UTC 2021
On Wed, 15 Dec 2021 10:24:59 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> The bug and fix were discussed in a previous PR:
>
> https://github.com/openjdk/jdk/pull/6572
>
> I pushed all commits from that PR on top of jdk 18 and added a couple
> extra tests as suggested in:
>
> https://github.com/openjdk/jdk/pull/6572#issuecomment-994086590
I'm late to the party, but still would like to clarify one thing.
It seems the root cause of the bug comes from the fact that the same JVM state is used by both `GraphKit::uncommon_trap()` and `GraphKit::builtin_throw()` while `GraphKit::null_check_receiver_before_call()` deliberately adjusts the state to please the former case. If the original state (after the call) is used for `GraphKit::builtin_throw()`, it should fix the bug as well, shouldn't it?
// Do a null check on the receiver as it would happen before the call to
// callee (with all arguments still on the stack).
Node* null_check_receiver_before_call(ciMethod* callee) {
assert(!callee->is_static(), "must be a virtual method");
// Callsite signature can be different from actual method being called (i.e _linkTo* sites).
// Use callsite signature always.
ciMethod* declared_method = method()->get_method_at_bci(bci());
const int nargs = declared_method->arg_size();
inc_sp(nargs);
Node* n = null_check_receiver();
dec_sp(nargs);
return n;
}
-------------
PR: https://git.openjdk.java.net/jdk18/pull/29
More information about the hotspot-compiler-dev
mailing list