changeset 8534:0e505de1dff4

8076161: Runtime stub for throw_null_pointer_exception always constructs log messages Summary: A LogEvents filter has been added to avoid unnecessary string construction. Reviewed-by: coleenp, hseigel, dholmes
author mockner
date Tue, 09 Jun 2015 12:22:21 -0400
parents 8207729d4dff
children 045e847705db
files src/share/vm/utilities/exceptions.cpp
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/utilities/exceptions.cpp	Mon Jun 08 15:40:28 2015 +0200
+++ b/src/share/vm/utilities/exceptions.cpp	Tue Jun 09 12:22:21 2015 -0400
@@ -160,9 +160,11 @@
   thread->set_pending_exception(h_exception(), file, line);
 
   // vm log
-  Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]",
-                        h_exception->print_value_string(), message ? ": " : "", message ? message : "",
-                        (address)h_exception(), file, line);
+  if (LogEvents){
+    Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]",
+                          h_exception->print_value_string(), message ? ": " : "", message ? message : "",
+                          (address)h_exception(), file, line);
+  }
 }