RFR 8150778: Reduce Throwable.getStackTrace() calls to the JVM

Daniel Fuchs daniel.fuchs at oracle.com
Wed Mar 2 18:57:32 UTC 2016

Hi Coleen,

Nice improvement!

Two remarks on http://cr.openjdk.java.net/~coleenp/8150778_jdk/

1. StackTraceElement.java

Does the new constructor in StackTraceElement really need to be
public? Can't we keep that package protected?

2. Throwable.java:902

902      * package-protection for use by SharedSecrets.

If I'm not mistaken we removed the shared secrets access - IIRC that
was used by java.util.logging.LogRecord  - which now uses the
StackWalker API instead.

So maybe you could make the method private and remove the comment
as further cleanup.

Please don't count me as (R)eviewer for the hotspot changes :-)

best regards,

-- daniel

On 02/03/16 19:44, Coleen Phillimore wrote:
> Summary: replace JVM_GetStackTraceDepth and JVM_GetStackTraceElement,
> with JVM_GetStackTraceElements that gets all the elements in the
> StackTraceElement[]
> These improvements were found during the investigation for replacing
> Throwable with the StackWalkAPI.   This change also adds iterator for
> BacktraceBuilder to make changing format of backtrace easier.
> Tested with -testset core, RBT nightly hotspot nightly tests on all
> platforms, and jck tests on linux x64.  Compatibility request is approved.
> open webrev at http://cr.openjdk.java.net/~coleenp/8150778_jdk/
> open webrev at http://cr.openjdk.java.net/~coleenp/8150778_hotspot
> bug link https://bugs.openjdk.java.net/browse/JDK-8150778
> Thanks,
> Coleen

More information about the core-libs-dev mailing list