JDK 10 RFR(S): 8173465: Introduce NearLabel for branches known to be short.
goetz.lindenmaier at sap.com
Thu Feb 16 06:40:56 UTC 2017
I changed the field to Boolean.
Thanks for looking at this!
> -----Original Message-----
> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com]
> Sent: Mittwoch, 15. Februar 2017 22:18
> To: Lindenmaier, Goetz <goetz.lindenmaier at sap.com>; 'hotspot-compiler-
> dev at openjdk.java.net' <hotspot-compiler-dev at openjdk.java.net>
> Subject: Re: JDK 10 RFR(S): 8173465: Introduce NearLabel for branches known
> to be short.
> Okay, than it makes sense. One comment about changes I have is to use bool
> field instead of bit field for _is_near.
> On 2/14/17 1:38 AM, Lindenmaier, Goetz wrote:
> > Hi Vladimir,
> > For forward branches the branch instruction is decided on before
> > the Label is fixed.
> > Sometimes the decision which branch instruction to use must
> > be taken far down a call chain. You would have to pass down a
> > boolean flag 'useShortBranch' all the call chain.
> > See emit_typecheck_helper in c1_LIRAssembler_s390.cpp
> > It gets a label from emit_opTypeCheck which can point to a stub entry.
> > This label is in some cases passed down
> > to check_class_subtype_fast_path. In other cases, a local label is
> > passed to this functions. We know for the local label the short
> > branch will suffice, not so for the label coming from extern.
> > So we use NearLable for the local one.
> > Check_class_subtype_fast_path passes the label on to a
> > s390 optimized branch emitter compare64_and_branch, which
> > then sees whether it's a NearLabel and uses the short branch.
> > Best regards,
> > Goetz.
> >> -----Original Message-----
> >> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com]
> >> Sent: Dienstag, 14. Februar 2017 00:21
> >> To: Lindenmaier, Goetz <goetz.lindenmaier at sap.com>; 'hotspot-
> >> dev at openjdk.java.net' <hotspot-compiler-dev at openjdk.java.net>
> >> Subject: Re: JDK 10 RFR(S): 8173465: Introduce NearLabel for branches
> >> to be short.
> >> I assume you are talking about hand written assembler code snippets
> >> etc.)
> >> Usually we use appropriate short branch instructions for short forward
> >> distance (and there is assert which check that it is correct). For back
> >> we do it automatically depending on distance.
> >> So why you need special NearLabel for s390? Can you just have general
> >> branch macroassembler method for this?
> >> Thanks,
> >> Vladimir
> >> On 1/30/17 2:57 AM, Lindenmaier, Goetz wrote:
> >>> Hi
> >>> please review this small optimization of Labels.
> >>> This so far targets s390, but could be used on other platforms as well.
> >>> I please need a sponsor.
> >>> http://cr.openjdk.java.net/~goetz/wr17/8173465-
> >> NearLbl/webrev.01/index.html
> >>> Some branches issued to assembly code are obviously of short distance.
> >> Due to separation into shared and platform code this not always is
> >> when the branch instruction is selected.
> >>> NearLabels indicate that a branch with short reach can be used.
> >>> Best regards,
> >>> Goetz
More information about the hotspot-compiler-dev