RFR: 8286636: MacroAssembler::post_call_nop should have InstructionMark

Aleksey Shipilev shade at openjdk.java.net
Thu May 12 15:07:49 UTC 2022


On Thu, 12 May 2022 13:19:53 GMT, Andrew Haley <aph-open at littlepinkcloud.com> wrote:

> On 5/12/22 14:00, Aleksey Shipilev wrote:
> > `InstructionMark` checks the instruction boundaries, which is important for relocatable instructions. Everywhere where we do any (?) sort of relocation, we do `InstructionMark`. I found that newly ad
> 
> What is the meaning of "checks the instruction boundaries"? Just that we make sure that we cannot ever have multiple relocations of the same address, or something more subtle than that?

AFAICS, among other things, yes, we are making sure no more than one relocation per instruction happens.

> Or, how would overlapping instructions happen?

Pretty easy, this is what I had in x86_32 and AArch64: we expand the "instruction" through the .ad / macroAssembler, and then circle back to `MacroAssembler::post_call_nop`, which is a relocation-bearing instruction in its own right. `InstructionMark` in `post_call_nop` then rightfully asserts that we are in the middle of emitting another "instruction". AFAICS, this whole thing is an optional check that protects us from calling into `Assembler`/`MacroAssembler` haphazardly.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8678


More information about the hotspot-dev mailing list