changeset 1051:3c57bcd0c73f

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
author lagergren
date Tue, 14 Oct 2014 16:11:07 +0200
parents a35c8136c045
children 3736ebef15e9
files src/jdk/nashorn/internal/runtime/GlobalConstants.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/runtime/GlobalConstants.java	Tue Oct 14 16:16:12 2014 +0530
+++ b/src/jdk/nashorn/internal/runtime/GlobalConstants.java	Tue Oct 14 16:11:07 2014 +0200
@@ -31,7 +31,6 @@
 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.getProgramPoint;
 import static jdk.nashorn.internal.runtime.logging.DebugLogger.quote;
-
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.SwitchPoint;
@@ -328,7 +327,9 @@
         }
 
         if (!acc.mayRetry()) {
-            log.info("*** SET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation());
+            if (log.isEnabled()) {
+                log.fine("*** SET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation());
+            }
             return null;
         }
 
@@ -404,7 +405,9 @@
         }
 
         if (acc.hasBeenInvalidated() || acc.guardFailed()) {
-            log.fine("*** GET: Giving up on " + quote(name) + " - retry count has exceeded");
+            if (log.isEnabled()) {
+                log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation());
+            }
             return null;
         }