hotspot/src/share/vm/oops/methodData.hpp
changeset 24476 912595db2e75
parent 24442 4d4ae31dea26
child 24934 43a6fc13b7d4
--- a/hotspot/src/share/vm/oops/methodData.hpp	Wed May 14 14:28:09 2014 -0700
+++ b/hotspot/src/share/vm/oops/methodData.hpp	Thu May 15 09:09:28 2014 +0200
@@ -851,11 +851,10 @@
     return _base_off + stack_slot_local_offset(i);
   }
 
-protected:
   const int _number_of_entries;
 
   // offset of cell for type for entry i within ProfileData object
-  int type_offset(int i) const {
+  int type_offset_in_cells(int i) const {
     return _base_off + type_local_offset(i);
   }
 
@@ -868,6 +867,8 @@
 
   void post_initialize(Symbol* signature, bool has_receiver, bool include_receiver);
 
+  int number_of_entries() const { return _number_of_entries; }
+
   // offset of cell for stack slot for entry i within this block of cells for a TypeStackSlotEntries
   static int stack_slot_local_offset(int i) {
     return i * per_arg_cell_count + stack_slot_entry;
@@ -893,13 +894,13 @@
   // type for entry i
   intptr_t type(int i) const {
     assert(i >= 0 && i < _number_of_entries, "oob");
-    return _pd->intptr_at(type_offset(i));
+    return _pd->intptr_at(type_offset_in_cells(i));
   }
 
   // set type for entry i
   void set_type(int i, intptr_t k) {
     assert(i >= 0 && i < _number_of_entries, "oob");
-    _pd->set_intptr_at(type_offset(i), k);
+    _pd->set_intptr_at(type_offset_in_cells(i), k);
   }
 
   static ByteSize per_arg_size() {
@@ -907,7 +908,11 @@
   }
 
   static int per_arg_count() {
-    return per_arg_cell_count ;
+    return per_arg_cell_count;
+  }
+
+  ByteSize type_offset(int i) const {
+    return DataLayout::cell_offset(type_offset_in_cells(i));
   }
 
   // GC support
@@ -973,7 +978,7 @@
   }
 
   static int argument_type_local_offset(int i) {
-    return header_cell_count() + TypeStackSlotEntries::type_local_offset(i);;
+    return header_cell_count() + TypeStackSlotEntries::type_local_offset(i);
   }
 
 public:
@@ -1129,6 +1134,14 @@
     return cell_offset(CounterData::static_cell_count()) + TypeEntriesAtCall::args_data_offset();
   }
 
+  ByteSize argument_type_offset(int i) {
+    return _args.type_offset(i);
+  }
+
+  ByteSize return_type_offset() {
+    return _ret.type_offset();
+  }
+
   // GC support
   virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) {
     if (has_arguments()) {
@@ -1436,6 +1449,14 @@
     return cell_offset(VirtualCallData::static_cell_count()) + TypeEntriesAtCall::args_data_offset();
   }
 
+  ByteSize argument_type_offset(int i) {
+    return _args.type_offset(i);
+  }
+
+  ByteSize return_type_offset() {
+    return _ret.type_offset();
+  }
+
   // GC support
   virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) {
     ReceiverTypeData::clean_weak_klass_links(is_alive_closure);
@@ -1926,7 +1947,7 @@
 class SpeculativeTrapData : public ProfileData {
 protected:
   enum {
-    method_offset,
+    speculative_trap_method,
     speculative_trap_cell_count
   };
 public:
@@ -1946,11 +1967,15 @@
 
   // Direct accessor
   Method* method() const {
-    return (Method*)intptr_at(method_offset);
+    return (Method*)intptr_at(speculative_trap_method);
   }
 
   void set_method(Method* m) {
-    set_intptr_at(method_offset, (intptr_t)m);
+    set_intptr_at(speculative_trap_method, (intptr_t)m);
+  }
+
+  static ByteSize method_offset() {
+    return cell_offset(speculative_trap_method);
   }
 
   virtual void print_data_on(outputStream* st, const char* extra = NULL) const;