8256924: ppc, ppcle, s390: JVM crashes at VM init after JDK-8254231

Reviewed-by: shade
This commit is contained in:
Martin Doerr 2020-11-24 16:24:55 +00:00
parent ff6df15be3
commit 3b3e90ecad
4 changed files with 25 additions and 4 deletions

View File

@ -220,6 +220,13 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
return NULL;
}
// No need in interpreter entry for linkToNative for now.
// Interpreter calls compiled entry through i2c.
if (iid == vmIntrinsics::_linkToNative) {
__ stop("Should not reach here"); // empty stubs make SG sick
return NULL;
}
Register argbase = R15_esp; // parameter (preserved)
Register argslot = R3;
Register temp1 = R6;
@ -306,7 +313,10 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
if (receiver_reg != noreg) assert_different_registers(temp1, temp2, temp3, temp4, receiver_reg);
if (member_reg != noreg) assert_different_registers(temp1, temp2, temp3, temp4, member_reg);
if (iid == vmIntrinsics::_invokeBasic) {
if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
if (iid == vmIntrinsics::_linkToNative) {
assert(for_compiler_entry, "only compiler entry is supported");
}
// indirect through MH.form.vmentry.vmtarget
jump_to_lambda_form(_masm, receiver_reg, R19_method, temp1, temp2, for_compiler_entry);
} else {

View File

@ -1618,7 +1618,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
member_arg_pos = method->size_of_parameters() - 1; // trailing MemberName argument
member_reg = R19_method; // known to be free at this point
has_receiver = MethodHandles::ref_kind_has_receiver(ref_kind);
} else if (iid == vmIntrinsics::_invokeBasic) {
} else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
has_receiver = true;
} else {
fatal("unexpected intrinsic id %d", iid);

View File

@ -250,6 +250,13 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
return NULL;
}
// No need in interpreter entry for linkToNative for now.
// Interpreter calls compiled entry through i2c.
if (iid == vmIntrinsics::_linkToNative) {
__ should_not_reach_here(); // Empty stubs make SG sick.
return NULL;
}
// Z_R10: sender SP (must preserve; see prepare_to_jump_from_interprted)
// Z_method: method
// Z_ARG1 (Gargs): incoming argument list (must preserve)
@ -364,7 +371,10 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
assert_different_registers(temp1, temp2, temp3, temp4, Z_R10);
}
if (iid == vmIntrinsics::_invokeBasic) {
if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
if (iid == vmIntrinsics::_linkToNative) {
assert(for_compiler_entry, "only compiler entry is supported");
}
__ pc(); // Just for the block comment.
// Indirect through MH.form.vmentry.vmtarget.
jump_to_lambda_form(_masm, receiver_reg, Z_method, Z_R1, temp3, for_compiler_entry);

View File

@ -919,7 +919,8 @@ static void gen_special_dispatch(MacroAssembler *masm,
member_reg = Z_R9; // Known to be free at this point.
has_receiver = MethodHandles::ref_kind_has_receiver(ref_kind);
} else {
guarantee(special_dispatch == vmIntrinsics::_invokeBasic, "special_dispatch=%d", special_dispatch);
guarantee(special_dispatch == vmIntrinsics::_invokeBasic || special_dispatch == vmIntrinsics::_linkToNative,
"special_dispatch=%d", special_dispatch);
has_receiver = true;
}