Tue, 14 Oct 2014 16:11:07 +0200
8060471: DynamicLinker.getLinkedCallSiteLocation() is called even when logger is disabled, and it creates a stacktrace. This contributes unnecessarily to compile time.
Reviewed-by: lagergren, attila
Contributed-by: andreas.gabrielsson@oracle.com
src/jdk/nashorn/internal/runtime/GlobalConstants.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/jdk/nashorn/internal/runtime/GlobalConstants.java Tue Oct 14 16:16:12 2014 +0530 1.2 +++ b/src/jdk/nashorn/internal/runtime/GlobalConstants.java Tue Oct 14 16:11:07 2014 +0200 1.3 @@ -31,7 +31,6 @@ 1.4 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT; 1.5 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.getProgramPoint; 1.6 import static jdk.nashorn.internal.runtime.logging.DebugLogger.quote; 1.7 - 1.8 import java.lang.invoke.MethodHandle; 1.9 import java.lang.invoke.MethodHandles; 1.10 import java.lang.invoke.SwitchPoint; 1.11 @@ -328,7 +327,9 @@ 1.12 } 1.13 1.14 if (!acc.mayRetry()) { 1.15 - log.info("*** SET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); 1.16 + if (log.isEnabled()) { 1.17 + log.fine("*** SET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); 1.18 + } 1.19 return null; 1.20 } 1.21 1.22 @@ -404,7 +405,9 @@ 1.23 } 1.24 1.25 if (acc.hasBeenInvalidated() || acc.guardFailed()) { 1.26 - log.fine("*** GET: Giving up on " + quote(name) + " - retry count has exceeded"); 1.27 + if (log.isEnabled()) { 1.28 + log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); 1.29 + } 1.30 return null; 1.31 } 1.32