8076319: jstat verified class fix
authorhseigel
Fri, 29 May 2015 15:23:41 -0400
changeset 31021 1dbe2a0324d6
parent 30886 d2a0ec86d6ef
child 31022 4e771cf1a3f1
8076319: jstat verified class fix Summary: Move verify perf data so that it only counts classes that actually get verified. Reviewed-by: acorn, coleenp, gtriantafill
hotspot/src/share/vm/classfile/verifier.cpp
hotspot/src/share/vm/oops/instanceKlass.cpp
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Thu May 28 11:37:13 2015 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Fri May 29 15:23:41 2015 -0400
@@ -45,6 +45,8 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "services/threadService.hpp"
 #include "utilities/bytes.hpp"
 
 #define NOFAILOVER_MAJOR_VERSION                       51
@@ -130,6 +132,16 @@
     return true;
   }
 
+  // Timer includes any side effects of class verification (resolution,
+  // etc), but not recursive calls to Verifier::verify().
+  JavaThread* jt = (JavaThread*)THREAD;
+  PerfClassTraceTime timer(ClassLoader::perf_class_verify_time(),
+                           ClassLoader::perf_class_verify_selftime(),
+                           ClassLoader::perf_classes_verified(),
+                           jt->get_thread_stat()->perf_recursion_counts_addr(),
+                           jt->get_thread_stat()->perf_timers_addr(),
+                           PerfClassTraceTime::CLASS_VERIFY);
+
   // If the class should be verified, first see if we can use the split
   // verifier.  If not, or if verification fails and FailOverToOldVerifier
   // is set, then call the inference verifier.
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Thu May 28 11:37:13 2015 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri May 29 15:23:41 2015 -0400
@@ -622,14 +622,6 @@
     if (!this_k->is_linked()) {
       if (!this_k->is_rewritten()) {
         {
-          // Timer includes any side effects of class verification (resolution,
-          // etc), but not recursive entry into verify_code().
-          PerfClassTraceTime timer(ClassLoader::perf_class_verify_time(),
-                                   ClassLoader::perf_class_verify_selftime(),
-                                   ClassLoader::perf_classes_verified(),
-                                   jt->get_thread_stat()->perf_recursion_counts_addr(),
-                                   jt->get_thread_stat()->perf_timers_addr(),
-                                   PerfClassTraceTime::CLASS_VERIFY);
           bool verify_ok = verify_code(this_k, throw_verifyerror, THREAD);
           if (!verify_ok) {
             return false;