diff src/share/vm/oops/methodData.hpp @ 13108:d84fa69a9874

added support for printing method profiles for virtual calls
author Doug Simon <doug.simon@oracle.com>
date Fri, 22 Nov 2013 01:30:06 +0100
parents 096c224171c4
children 389d40d7d99f
line wrap: on
line diff
--- a/src/share/vm/oops/methodData.hpp	Fri Nov 22 01:22:34 2013 +0100
+++ b/src/share/vm/oops/methodData.hpp	Fri Nov 22 01:30:06 2013 +0100
@@ -1079,7 +1079,7 @@
     //          TODO (chaeubl): in fact, Graal should also increment the count for failed type checks to mimic the C1/C2 behavior
     // VirtualCallData for invokevirtual/invokeinterface:
     //   C1/C2: count is incremented on type overflow
-    //   Graal: count is incremented on type overflow, nonprofiled_count is increment on method overflow
+    //   Graal: count is incremented on type overflow, nonprofiled_count is incremented on method overflow
 
     // Graal is interested in knowing the percentage of type checks involving a type not explicitly in the profile
     nonprofiled_count_off_set = counter_cell_count,
@@ -1183,6 +1183,9 @@
   static ByteSize nonprofiled_receiver_count_offset() {
     return cell_offset(nonprofiled_count_off_set);
   }
+  uint nonprofiled_count() const {
+    return uint_at(nonprofiled_count_off_set);
+  }
   void set_nonprofiled_count(uint count) {
     set_uint_at(nonprofiled_count_off_set, count);
   }
@@ -1245,7 +1248,7 @@
     return MethodProfileWidth;
   }
 
-  Method* method(uint row) {
+  Method* method(uint row) const {
     assert(row < method_row_limit(), "oob");
 
     Method* method = (Method*)intptr_at(method_cell_index(row));
@@ -1253,6 +1256,11 @@
     return method;
   }
 
+  uint method_count(uint row) const {
+    assert(row < method_row_limit(), "oob");
+    return uint_at(method_count_cell_index(row));
+  }
+
   void set_method(uint row, Method* m) {
     assert((uint)row < method_row_limit(), "oob");
     set_intptr_at(method_cell_index(row), (uintptr_t)m);
@@ -1276,6 +1284,9 @@
 #endif
 
 #ifndef PRODUCT
+#ifdef GRAAL
+  void print_method_data_on(outputStream* st) const;
+#endif
   void print_data_on(outputStream* st) const;
 #endif
 };