RFR(M): 8167184: [s390] Extend relocations for pc-relative instructions.

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Oct 5 18:27:18 UTC 2016


When you say "constant pool" do you mean "conatant section" in code 
buffer? Or CP in class data? I assume first. It is confusing.

Can you implement this as S390 code (#ifdef)? I am not comfortable that 
code is executed on other platforms too (ctable setting).

Can you add _offset under #ifdef to runtime_call_Relocation instead? I 
see that s390 code use it this way:

+    if (type() == relocInfo::runtime_call_type) {
+      toc_offset = ((runtime_call_Relocation 
*)this)->get_constant_pool_offset();

Thanks,
Vladimir

On 10/5/16 8:16 AM, Lindenmaier, Goetz wrote:
> Hi,
>
>
>
> This extension to relocations is needed for the s390 port.
>
> Please review:
>
> http://cr.openjdk.java.net/~goetz/wr16/8167184-s390_relocations/webrev.01/
>
>
> This change implements two extensions to relocation to support
> pc-relative instructions.
>
> On s390, there are call instructions that branch to an address relative
> to the current pc. If the offset encodable in the instruction does not
> suffice,  our port uses a pc-relative load to load the target address
> from the constant pool into a register that is then used as branch
> target. Relocations must support switching between these two
> implementations. For this we need a relocation that stores the offset of
> the address in the constant pool, as this value can not be read from the
> instruction.
>
> Further the pc-relative instructions encode the offset from the
> instruction to the constant. If the constant pool is resized, or the
> instruction is moved (as during shorten branches), this offset must be
> adapted. To compute the new offset, the change in offset must be known.
> To compute this we store the position of the constant pool in the CodeBlob.
>
>
>
> Best regards,
>
>   Goetz.
>


More information about the hotspot-compiler-dev mailing list