RFR (T): 8241852: Cleanup error message generation in LinkResolver::resolve_field

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Tue Mar 31 14:28:26 UTC 2020


Hi,

I think you can remove the ResourceMark altogether.
Instead of ss.as_string() use ss.base().
The char* is allocated with malloc (this was changed previously).
 The internal string is zero terminated.
The StringStream object itself is on the stack.

Best regards,
  Goetz.

> -----Original Message-----
> From: hotspot-runtime-dev <hotspot-runtime-dev-
> bounces at openjdk.java.net> On Behalf Of Claes Redestad
> Sent: Monday, March 30, 2020 6:45 PM
> To: daniel.daugherty at oracle.com; Hotspot dev runtime <hotspot-runtime-
> dev at openjdk.java.net>
> Subject: Re: RFR (T): 8241852: Cleanup error message generation in
> LinkResolver::resolve_field
> 
> On 2020-03-30 18:34, Daniel D. Daugherty wrote:
> > On 3/30/20 12:27 PM, Claes Redestad wrote:
> >> Hi,
> >>
> >> a couple of places in LinkResolver::resolve_field where we allocate
> >> ResourceMark and stringStream in a wider scope than necessary.
> Narrowing
> >> down the scope where they are declared in a similar way as done
> >> consistently in all other places in LinkResolver is a small and trivial
> >> optimization:
> >>
> >> http://cr.openjdk.java.net/~redestad/8241852/open.00/
> >
> > src/hotspot/share/interpreter/linkResolver.cpp
> >      Please update the copyright year before you push.
> >
> 
> Will do.
> 
> >
> > Thumbs up! I concur that this is a trivial fix.
> 
> Thanks!
> 
> /Claes


More information about the hotspot-runtime-dev mailing list