RFR 8153123 : Streamline StackWalker code

Claes Redestad claes.redestad at oracle.com
Tue Apr 5 18:10:56 UTC 2016


Hi,

On 04/05/2016 01:45 AM, Brent Christian wrote:
> Hi,
>
> I'd like to check in some footprint and code reduction changes to the 
> java.lang.StackWalker implementation.
>
> Webrev:
> http://cr.openjdk.java.net/~bchristi/8153123/webrev.00/

this looks really good to me.

It seems the new implementation of StackFrameInfo::toStackTraceElement 
reads the volatile field ste twice on the fast path, though, so perhaps 
consider something like this:

+ StackTraceElement s = ste; + if (s == null) {
+ synchronized(this) { + s = ste; + if (s == null) {
+ s = new StackTraceElement();
+ toStackTraceElement0(s);
+ ste = s;
+ }
+ }
+ }
+ return s;


Thanks!

/Claes

> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8153123
>
> A summary of the changes:
>
> * remove the "stackwalk.newThrowable" system property and 
> "MemberNameInStackFrame" VM flag, originally left in to aid benchmarking
>
> * Streamline StackFrameInfo fields
>
> * Refactor/streamline StackStreamFactory (no more separate 
> classes[]/StackFrame[] arrays, remove unneeded (for now) 
> StackStreamFactory.StackTrace class)
>
>
> Given the hotspot changes, I plan to push this through hs-rt.
>
> Thanks,
> -Brent
>



More information about the hotspot-dev mailing list