[aarch64-port-dev ] RFR(S): 8237483: AArch64 C1 OopMap inserted twice fatal error
Nick Gasson
nick.gasson at arm.com
Tue Jul 28 05:56:54 UTC 2020
On 07/27/20 17:40 pm, Andrew Haley wrote:
>
> I would have thought it would make more sense, rather than asserting,
> simply to detect that we already have an oopmap so we don't need
> another one. Having said that, it's probably not worth worrying about
> so your fix is OK.
>
> It needs a better comment, though. The only way to find out why this
> code is here would be to trawl the email archives. Something like this
> would do:
>
> // In the method java.util.zip.Inflater::inflate C1 generates these two LIR
> // instructions:
>
> // 724 move [c_rarg3|I] [Base:[c_rarg1|L] Disp: 2147483647|I] [patch_normal] [bci:95]
> // 728 throw [c_rarg3|I] [c_rarg0|L] [bci:100]
>
> // The move instruction at 724 generates a runtime call to deoptimise the
> // method since this patching is not implemented on AArch64. An oop map is
> // inserted for the return PC of the runtime call
> // (LIR_Assembler::deoptimize_trap()). The following throw LIR instruction
> // then inserts another oop map at the same PC, triggering an assertion
> // failure.
Seems a bit too verbose? How about this:
--- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
@@ -2085,6 +2085,13 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
// get current pc information
// pc is only needed if the method has an exception handler, the unwind code does not need it.
+ if (compilation()->debug_info_recorder()->last_pc_offset() == __ offset()) {
+ // As no instructions have been generated yet for this LIR node it's
+ // possible that an oop map already exists for the current offset.
+ // In that case insert an dummy NOP here to ensure all oop map PCs
+ // are unique. See JDK-8237483.
+ __ nop();
+ }
int pc_for_athrow_offset = __ offset();
InternalAddress pc_for_athrow(__ pc());
__ adr(exceptionPC->as_register(), pc_for_athrow);
--
Thanks,
Nick
More information about the hotspot-compiler-dev
mailing list