RFR 8169389 : Use a bitmap to control StackTraceElement::toString format and save footprint

Mandy Chung mandy.chung at oracle.com
Thu Dec 8 00:05:09 UTC 2016

> On Dec 7, 2016, at 1:56 PM, Brent Christian <brent.christian at oracle.com> wrote:
> Hi,
> Please review my fix for 8169389.
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8169389
> Webrev:
> http://cr.openjdk.java.net/~bchristi/8169389/webrev.03/
> :

Thanks for making this good change. Claes would be happy with the footprint saving.

I suggest to add two utility methods rather than the has method:
  boolean dropClassLoaderName()
  boolean dropModuleVersion()

 430    if (m != null && m.isNamed() &&
 431          (isHashedInJavaBase(m) || !m.getDescriptor().version().isPresent())) {
 432        bits |= JDK_NON_UPGRADEABLE_MODULE;
 433    }

I think this should simply be:
   if (isHashedInJavaBase(m)) {..}

Can you retain the javadoc of toLoaderModuleClassName, revised if appropriate, in the computeFormat method?

line 322-325: what about:

The toString method may return two different values on two 
StackTraceElement instances that are equal for example when
one created via the constructor and one obtained from Throwable 
or StackFrame where an implementation may choose to omit some
element in the returned string.

Is @apiNote in equals necessary?  Maybe the one added in toString is adequate?


More information about the hotspot-dev mailing list