RFR(M): 8139040: Fix initializations before ShouldNotReachHere()
Lindenmaier, Goetz
goetz.lindenmaier at sap.com
Thu Oct 22 06:31:58 UTC 2015
Hi Coleen,
that fix looks good, thanks. Sorry I can't avoid these.
The warnings depend on the compiler optimizations, they
probably differ slightly on the closed platform.
Best regards,
Goetz.
> -----Original Message-----
> From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-
> bounces at openjdk.java.net] On Behalf Of Coleen Phillimore
> Sent: Mittwoch, 21. Oktober 2015 21:26
> To: hotspot-runtime-dev at openjdk.java.net
> Subject: Re: RFR(M): 8139040: Fix initializations before
> ShouldNotReachHere()
>
>
> I had to add one more initialization for some internal platform for some
> reason I don't quite know. See threadService.hpp.
>
> open webrev at http://cr.openjdk.java.net/~coleenp/8139040.01/
>
>
> Coleen
>
> On 10/20/15 3:24 AM, Lindenmaier, Goetz wrote:
> > Hi David,
> >
> > yes, I assume the compiler optimizes it.
> > If the compiler issues a warning, it has all information it needs to
> > optimize it. So I'm sure gcc does so. I don't know about the solaris
> > compiler, though.
> >
> > Other locations in that file also initialize at the declaration
> > (e.g., c1_LIRAssembler_x86.cpp:3917).
> > I fixed these two anyways:
> > http://cr.openjdk.java.net/~goetz/webrevs/8139040-init/webrev.05/
> >
> > Best regards,
> > Goetz.
> >
> >
> >> -----Original Message-----
> >> From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-
> >> bounces at openjdk.java.net] On Behalf Of David Holmes
> >> Sent: Dienstag, 20. Oktober 2015 02:46
> >> To: hotspot-runtime-dev at openjdk.java.net
> >> Subject: Re: RFR(M): 8139040: Fix initializations before
> >> ShouldNotReachHere()
> >>
> >> Hi Goetz,
> >>
> >> src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
> >>
> >> I'd prefer to see the missing initialization added to the default of the
> >> switch:
> >>
> >> ! Assembler::Condition acond = Assembler::equal, ncond =
> >> Assembler::notEqual;
> >> switch (condition) {
> >>
> >> otherwise we're just wasting instructions (or assuming the compiler will
> >> optimize it away).
> >>
> >> Same with:
> >>
> >> 3189 Address::ScaleFactor scale = Address::no_scale;
> >>
> >> More generally if something is complaining about an uninitialized
> >> variable on a ShouldNotReachHere/fatal path then put the initialization
> >> in that path, not the common code that will cause it to be unnecessarily
> >> executed.
> >>
> >> Cheers,
> >> David
More information about the hotspot-runtime-dev
mailing list