hotspot/src/share/vm/oops/methodData.hpp
changeset 35123 b0b89d83bcf5
parent 33638 ef49ed90010b
child 35898 ddc274f0052f
equal deleted inserted replaced
35121:e8900e5763ff 35123:b0b89d83bcf5
    71 // DataLayout
    71 // DataLayout
    72 //
    72 //
    73 // Overlay for generic profiling data.
    73 // Overlay for generic profiling data.
    74 class DataLayout VALUE_OBJ_CLASS_SPEC {
    74 class DataLayout VALUE_OBJ_CLASS_SPEC {
    75   friend class VMStructs;
    75   friend class VMStructs;
       
    76   friend class JVMCIVMStructs;
    76 
    77 
    77 private:
    78 private:
    78   // Every data layout begins with a header.  This header
    79   // Every data layout begins with a header.  This header
    79   // contains a tag, which is used to indicate the size/layout
    80   // contains a tag, which is used to indicate the size/layout
    80   // of the data, 4 bits of flags, which can be used in any way,
    81   // of the data, 4 bits of flags, which can be used in any way,
   534 // BitData
   535 // BitData
   535 //
   536 //
   536 // A BitData holds a flag or two in its header.
   537 // A BitData holds a flag or two in its header.
   537 class BitData : public ProfileData {
   538 class BitData : public ProfileData {
   538   friend class VMStructs;
   539   friend class VMStructs;
       
   540   friend class JVMCIVMStructs;
   539 protected:
   541 protected:
   540   enum {
   542   enum {
   541     // null_seen:
   543     // null_seen:
   542     //  saw a null operand (cast/aastore/instanceof)
   544     //  saw a null operand (cast/aastore/instanceof)
   543       null_seen_flag              = DataLayout::first_flag + 0
   545       null_seen_flag              = DataLayout::first_flag + 0
   603 // CounterData
   605 // CounterData
   604 //
   606 //
   605 // A CounterData corresponds to a simple counter.
   607 // A CounterData corresponds to a simple counter.
   606 class CounterData : public BitData {
   608 class CounterData : public BitData {
   607   friend class VMStructs;
   609   friend class VMStructs;
       
   610   friend class JVMCIVMStructs;
   608 protected:
   611 protected:
   609   enum {
   612   enum {
   610     count_off,
   613     count_off,
   611     counter_cell_count
   614     counter_cell_count
   612   };
   615   };
   668 // branch.  It is a counter, used for counting the number of branches,
   671 // branch.  It is a counter, used for counting the number of branches,
   669 // plus a data displacement, used for realigning the data pointer to
   672 // plus a data displacement, used for realigning the data pointer to
   670 // the corresponding target bci.
   673 // the corresponding target bci.
   671 class JumpData : public ProfileData {
   674 class JumpData : public ProfileData {
   672   friend class VMStructs;
   675   friend class VMStructs;
       
   676   friend class JVMCIVMStructs;
   673 protected:
   677 protected:
   674   enum {
   678   enum {
   675     taken_off_set,
   679     taken_off_set,
   676     displacement_off_set,
   680     displacement_off_set,
   677     jump_cell_count
   681     jump_cell_count
  1175 // dynamic type check.  It consists of a counter which counts the total times
  1179 // dynamic type check.  It consists of a counter which counts the total times
  1176 // that the check is reached, and a series of (Klass*, count) pairs
  1180 // that the check is reached, and a series of (Klass*, count) pairs
  1177 // which are used to store a type profile for the receiver of the check.
  1181 // which are used to store a type profile for the receiver of the check.
  1178 class ReceiverTypeData : public CounterData {
  1182 class ReceiverTypeData : public CounterData {
  1179   friend class VMStructs;
  1183   friend class VMStructs;
       
  1184   friend class JVMCIVMStructs;
  1180 protected:
  1185 protected:
  1181   enum {
  1186   enum {
  1182 #if INCLUDE_JVMCI
  1187 #if INCLUDE_JVMCI
  1183     // Description of the different counters
  1188     // Description of the different counters
  1184     // ReceiverTypeData for instanceof/checkcast/aastore:
  1189     // ReceiverTypeData for instanceof/checkcast/aastore:
  1681 // A BranchData is used to access profiling data for a two-way branch.
  1686 // A BranchData is used to access profiling data for a two-way branch.
  1682 // It consists of taken and not_taken counts as well as a data displacement
  1687 // It consists of taken and not_taken counts as well as a data displacement
  1683 // for the taken case.
  1688 // for the taken case.
  1684 class BranchData : public JumpData {
  1689 class BranchData : public JumpData {
  1685   friend class VMStructs;
  1690   friend class VMStructs;
       
  1691   friend class JVMCIVMStructs;
  1686 protected:
  1692 protected:
  1687   enum {
  1693   enum {
  1688     not_taken_off_set = jump_cell_count,
  1694     not_taken_off_set = jump_cell_count,
  1689     branch_cell_count
  1695     branch_cell_count
  1690   };
  1696   };
  1758 // A ArrayData is a base class for accessing profiling data which does
  1764 // A ArrayData is a base class for accessing profiling data which does
  1759 // not have a statically known size.  It consists of an array length
  1765 // not have a statically known size.  It consists of an array length
  1760 // and an array start.
  1766 // and an array start.
  1761 class ArrayData : public ProfileData {
  1767 class ArrayData : public ProfileData {
  1762   friend class VMStructs;
  1768   friend class VMStructs;
       
  1769   friend class JVMCIVMStructs;
  1763 protected:
  1770 protected:
  1764   friend class DataLayout;
  1771   friend class DataLayout;
  1765 
  1772 
  1766   enum {
  1773   enum {
  1767     array_len_off_set,
  1774     array_len_off_set,
  1836 // a multi-way branch (*switch bytecodes).  It consists of a series
  1843 // a multi-way branch (*switch bytecodes).  It consists of a series
  1837 // of (count, displacement) pairs, which count the number of times each
  1844 // of (count, displacement) pairs, which count the number of times each
  1838 // case was taken and specify the data displacment for each branch target.
  1845 // case was taken and specify the data displacment for each branch target.
  1839 class MultiBranchData : public ArrayData {
  1846 class MultiBranchData : public ArrayData {
  1840   friend class VMStructs;
  1847   friend class VMStructs;
       
  1848   friend class JVMCIVMStructs;
  1841 protected:
  1849 protected:
  1842   enum {
  1850   enum {
  1843     default_count_off_set,
  1851     default_count_off_set,
  1844     default_disaplacement_off_set,
  1852     default_disaplacement_off_set,
  1845     case_array_start
  1853     case_array_start
  2135 CC_INTERP_ONLY(class BytecodeInterpreter;)
  2143 CC_INTERP_ONLY(class BytecodeInterpreter;)
  2136 class CleanExtraDataClosure;
  2144 class CleanExtraDataClosure;
  2137 
  2145 
  2138 class MethodData : public Metadata {
  2146 class MethodData : public Metadata {
  2139   friend class VMStructs;
  2147   friend class VMStructs;
       
  2148   friend class JVMCIVMStructs;
  2140   CC_INTERP_ONLY(friend class BytecodeInterpreter;)
  2149   CC_INTERP_ONLY(friend class BytecodeInterpreter;)
  2141 private:
  2150 private:
  2142   friend class ProfileData;
  2151   friend class ProfileData;
  2143 
  2152 
  2144   // Back pointer to the Method*
  2153   // Back pointer to the Method*