< prev index next >

src/share/vm/oops/methodData.hpp

Print this page




2134 // mdp is adjusted to point to the next appropriate DataLayout.  If mdp
2135 // is NULL to begin with, the interpreter assumes that the current method
2136 // is not (yet) being profiled.
2137 //
2138 // In MethodData* parlance, "dp" is a "data pointer", the actual address
2139 // of a DataLayout element.  A "di" is a "data index", the offset in bytes
2140 // from the base of the data entry array.  A "displacement" is the byte offset
2141 // in certain ProfileData objects that indicate the amount the mdp must be
2142 // adjusted in the event of a change in control flow.
2143 //
2144 
2145 CC_INTERP_ONLY(class BytecodeInterpreter;)
2146 class CleanExtraDataClosure;
2147 
2148 class MethodData : public Metadata {
2149   friend class VMStructs;
2150   friend class JVMCIVMStructs;
2151   CC_INTERP_ONLY(friend class BytecodeInterpreter;)
2152 private:
2153   friend class ProfileData;

2154 
2155   // Back pointer to the Method*
2156   Method* _method;
2157 
2158   // Size of this oop in bytes
2159   int _size;
2160 
2161   // Cached hint for bci_to_dp and bci_to_data
2162   int _hint_di;
2163 
2164   Mutex _extra_data_lock;
2165 
2166   MethodData(const methodHandle& method, int size, TRAPS);
2167 public:
2168   static MethodData* allocate(ClassLoaderData* loader_data, const methodHandle& method, TRAPS);
2169   MethodData() : _extra_data_lock(Monitor::leaf, "MDO extra data lock") {}; // For ciMethodData
2170 
2171   bool is_methodData() const volatile { return true; }
2172   void initialize();
2173 
2174   // Whole-method sticky bits and flags
2175   enum {
2176     _trap_hist_limit    = 22 JVMCI_ONLY(+5),   // decoupled from Deoptimization::Reason_LIMIT
2177     _trap_hist_mask     = max_jubyte,
2178     _extra_data_count   = 4     // extra DataLayout headers, for trap history
2179   }; // Public flag values
2180 private:
2181   uint _nof_decompiles;             // count of all nmethod removals
2182   uint _nof_overflow_recompiles;    // recompile count, excluding recomp. bits
2183   uint _nof_overflow_traps;         // trap count, excluding _trap_hist
2184   union {
2185     intptr_t _align;
2186     u1 _array[JVMCI_ONLY(2 *) _trap_hist_limit];
2187   } _trap_hist;
2188 
2189   // Support for interprocedural escape analysis, from Thomas Kotzmann.
2190   intx              _eflags;          // flags on escape information
2191   intx              _arg_local;       // bit set of non-escaping arguments
2192   intx              _arg_stack;       // bit set of stack-allocatable arguments
2193   intx              _arg_returned;    // bit set of returned arguments
2194 
2195   int _creation_mileage;              // method mileage at MDO creation
2196 


2285     return first_data();
2286   }
2287 
2288   // What is the index of the first data entry?
2289   int first_di() const { return 0; }
2290 
2291   ProfileData* bci_to_extra_data_helper(int bci, Method* m, DataLayout*& dp, bool concurrent);
2292   // Find or create an extra ProfileData:
2293   ProfileData* bci_to_extra_data(int bci, Method* m, bool create_if_missing);
2294 
2295   // return the argument info cell
2296   ArgInfoData *arg_info();
2297 
2298   enum {
2299     no_type_profile = 0,
2300     type_profile_jsr292 = 1,
2301     type_profile_all = 2
2302   };
2303 
2304   static bool profile_jsr292(const methodHandle& m, int bci);

2305   static int profile_arguments_flag();
2306   static bool profile_all_arguments();
2307   static bool profile_arguments_for_invoke(const methodHandle& m, int bci);
2308   static int profile_return_flag();
2309   static bool profile_all_return();
2310   static bool profile_return_for_invoke(const methodHandle& m, int bci);
2311   static int profile_parameters_flag();
2312   static bool profile_parameters_jsr292_only();
2313   static bool profile_all_parameters();
2314 
2315   void clean_extra_data(CleanExtraDataClosure* cl);
2316   void clean_extra_data_helper(DataLayout* dp, int shift, bool reset = false);
2317   void verify_extra_data_clean(CleanExtraDataClosure* cl);
2318 
2319 public:
2320   static int header_size() {
2321     return sizeof(MethodData)/wordSize;
2322   }
2323 
2324   // Compute the size of a MethodData* before it is created.




2134 // mdp is adjusted to point to the next appropriate DataLayout.  If mdp
2135 // is NULL to begin with, the interpreter assumes that the current method
2136 // is not (yet) being profiled.
2137 //
2138 // In MethodData* parlance, "dp" is a "data pointer", the actual address
2139 // of a DataLayout element.  A "di" is a "data index", the offset in bytes
2140 // from the base of the data entry array.  A "displacement" is the byte offset
2141 // in certain ProfileData objects that indicate the amount the mdp must be
2142 // adjusted in the event of a change in control flow.
2143 //
2144 
2145 CC_INTERP_ONLY(class BytecodeInterpreter;)
2146 class CleanExtraDataClosure;
2147 
2148 class MethodData : public Metadata {
2149   friend class VMStructs;
2150   friend class JVMCIVMStructs;
2151   CC_INTERP_ONLY(friend class BytecodeInterpreter;)
2152 private:
2153   friend class ProfileData;
2154   friend class TypeEntriesAtCall;
2155 
2156   // Back pointer to the Method*
2157   Method* _method;
2158 
2159   // Size of this oop in bytes
2160   int _size;
2161 
2162   // Cached hint for bci_to_dp and bci_to_data
2163   int _hint_di;
2164 
2165   Mutex _extra_data_lock;
2166 
2167   MethodData(const methodHandle& method, int size, TRAPS);
2168 public:
2169   static MethodData* allocate(ClassLoaderData* loader_data, const methodHandle& method, TRAPS);
2170   MethodData() : _extra_data_lock(Monitor::leaf, "MDO extra data lock") {}; // For ciMethodData
2171 
2172   bool is_methodData() const volatile { return true; }
2173   void initialize();
2174 
2175   // Whole-method sticky bits and flags
2176   enum {
2177     _trap_hist_limit    = 23 JVMCI_ONLY(+5),   // decoupled from Deoptimization::Reason_LIMIT
2178     _trap_hist_mask     = max_jubyte,
2179     _extra_data_count   = 4     // extra DataLayout headers, for trap history
2180   }; // Public flag values
2181 private:
2182   uint _nof_decompiles;             // count of all nmethod removals
2183   uint _nof_overflow_recompiles;    // recompile count, excluding recomp. bits
2184   uint _nof_overflow_traps;         // trap count, excluding _trap_hist
2185   union {
2186     intptr_t _align;
2187     u1 _array[JVMCI_ONLY(2 *) _trap_hist_limit];
2188   } _trap_hist;
2189 
2190   // Support for interprocedural escape analysis, from Thomas Kotzmann.
2191   intx              _eflags;          // flags on escape information
2192   intx              _arg_local;       // bit set of non-escaping arguments
2193   intx              _arg_stack;       // bit set of stack-allocatable arguments
2194   intx              _arg_returned;    // bit set of returned arguments
2195 
2196   int _creation_mileage;              // method mileage at MDO creation
2197 


2286     return first_data();
2287   }
2288 
2289   // What is the index of the first data entry?
2290   int first_di() const { return 0; }
2291 
2292   ProfileData* bci_to_extra_data_helper(int bci, Method* m, DataLayout*& dp, bool concurrent);
2293   // Find or create an extra ProfileData:
2294   ProfileData* bci_to_extra_data(int bci, Method* m, bool create_if_missing);
2295 
2296   // return the argument info cell
2297   ArgInfoData *arg_info();
2298 
2299   enum {
2300     no_type_profile = 0,
2301     type_profile_jsr292 = 1,
2302     type_profile_all = 2
2303   };
2304 
2305   static bool profile_jsr292(const methodHandle& m, int bci);
2306   static bool profile_unsafe(const methodHandle& m, int bci);
2307   static int profile_arguments_flag();
2308   static bool profile_all_arguments();
2309   static bool profile_arguments_for_invoke(const methodHandle& m, int bci);
2310   static int profile_return_flag();
2311   static bool profile_all_return();
2312   static bool profile_return_for_invoke(const methodHandle& m, int bci);
2313   static int profile_parameters_flag();
2314   static bool profile_parameters_jsr292_only();
2315   static bool profile_all_parameters();
2316 
2317   void clean_extra_data(CleanExtraDataClosure* cl);
2318   void clean_extra_data_helper(DataLayout* dp, int shift, bool reset = false);
2319   void verify_extra_data_clean(CleanExtraDataClosure* cl);
2320 
2321 public:
2322   static int header_size() {
2323     return sizeof(MethodData)/wordSize;
2324   }
2325 
2326   // Compute the size of a MethodData* before it is created.


< prev index next >