RFR 8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleen.phillimore at oracle.com
Wed Mar 2 19:29:57 UTC 2016
Thank you for looking at this so quickly.
On 3/2/16 1:57 PM, Daniel Fuchs wrote:
> 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?
So I just removed the public keyword, and that seems good. Thanks!
> 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.
I had just copied the SharedSecrets comments. I'll make
getStackTraceElements private also.
> Please don't count me as (R)eviewer for the hotspot changes :-)
Oh, but you know this code in hotspot, now. That's ok, you don't need
to review hotspot code.
> 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
>> 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
>> 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
More information about the core-libs-dev