hotspot/src/share/vm/oops/methodData.hpp
changeset 26440 0c9e5ee0083a
parent 25714 87fa6860b5ae
child 26586 992efa57514f
equal deleted inserted replaced
26439:0fa6c2cb6007 26440:0c9e5ee0083a
  2105   // Size of _data array in bytes.  (Excludes header and extra_data fields.)
  2105   // Size of _data array in bytes.  (Excludes header and extra_data fields.)
  2106   int _data_size;
  2106   int _data_size;
  2107 
  2107 
  2108   // data index for the area dedicated to parameters. -1 if no
  2108   // data index for the area dedicated to parameters. -1 if no
  2109   // parameter profiling.
  2109   // parameter profiling.
       
  2110   enum { no_parameters = -2, parameters_uninitialized = -1 };
  2110   int _parameters_type_data_di;
  2111   int _parameters_type_data_di;
       
  2112   int parameters_size_in_bytes() const {
       
  2113     ParametersTypeData* param = parameters_type_data();
       
  2114     return param == NULL ? 0 : param->size_in_bytes();
       
  2115   }
  2111 
  2116 
  2112   // Beginning of the data entries
  2117   // Beginning of the data entries
  2113   intptr_t _data[1];
  2118   intptr_t _data[1];
  2114 
  2119 
  2115   // Helper for size computation
  2120   // Helper for size computation
  2128   // the segment in bytes.
  2133   // the segment in bytes.
  2129   int initialize_data(BytecodeStream* stream, int data_index);
  2134   int initialize_data(BytecodeStream* stream, int data_index);
  2130 
  2135 
  2131   // Helper for data_at
  2136   // Helper for data_at
  2132   DataLayout* limit_data_position() const {
  2137   DataLayout* limit_data_position() const {
  2133     return (DataLayout*)((address)data_base() + _data_size);
  2138     return data_layout_at(_data_size);
  2134   }
  2139   }
  2135   bool out_of_bounds(int data_index) const {
  2140   bool out_of_bounds(int data_index) const {
  2136     return data_index >= data_size();
  2141     return data_index >= data_size();
  2137   }
  2142   }
  2138 
  2143 
  2369     }
  2374     }
  2370     return bci_to_extra_data(bci, NULL, true);
  2375     return bci_to_extra_data(bci, NULL, true);
  2371   }
  2376   }
  2372 
  2377 
  2373   // Add a handful of extra data records, for trap tracking.
  2378   // Add a handful of extra data records, for trap tracking.
  2374   DataLayout* extra_data_base() const { return limit_data_position(); }
  2379   DataLayout* extra_data_base() const  { return limit_data_position(); }
  2375   DataLayout* extra_data_limit() const { return (DataLayout*)((address)this + size_in_bytes()); }
  2380   DataLayout* extra_data_limit() const { return (DataLayout*)((address)this + size_in_bytes()); }
  2376   int extra_data_size() const { return (address)extra_data_limit()
  2381   DataLayout* args_data_limit() const  { return (DataLayout*)((address)this + size_in_bytes() -
  2377                                - (address)extra_data_base(); }
  2382                                                               parameters_size_in_bytes()); }
       
  2383   int extra_data_size() const          { return (address)extra_data_limit() - (address)extra_data_base(); }
  2378   static DataLayout* next_extra(DataLayout* dp);
  2384   static DataLayout* next_extra(DataLayout* dp);
  2379 
  2385 
  2380   // Return (uint)-1 for overflow.
  2386   // Return (uint)-1 for overflow.
  2381   uint trap_count(int reason) const {
  2387   uint trap_count(int reason) const {
  2382     assert((uint)reason < _trap_hist_limit, "oob");
  2388     assert((uint)reason < _trap_hist_limit, "oob");
  2427     _tenure_traps += 1;
  2433     _tenure_traps += 1;
  2428   }
  2434   }
  2429 
  2435 
  2430   // Return pointer to area dedicated to parameters in MDO
  2436   // Return pointer to area dedicated to parameters in MDO
  2431   ParametersTypeData* parameters_type_data() const {
  2437   ParametersTypeData* parameters_type_data() const {
  2432     return _parameters_type_data_di != -1 ? data_layout_at(_parameters_type_data_di)->data_in()->as_ParametersTypeData() : NULL;
  2438     assert(_parameters_type_data_di != parameters_uninitialized, "called too early");
       
  2439     return _parameters_type_data_di != no_parameters ? data_layout_at(_parameters_type_data_di)->data_in()->as_ParametersTypeData() : NULL;
  2433   }
  2440   }
  2434 
  2441 
  2435   int parameters_type_data_di() const {
  2442   int parameters_type_data_di() const {
  2436     assert(_parameters_type_data_di != -1, "no args type data");
  2443     assert(_parameters_type_data_di != parameters_uninitialized && _parameters_type_data_di != no_parameters, "no args type data");
  2437     return _parameters_type_data_di;
  2444     return _parameters_type_data_di;
  2438   }
  2445   }
  2439 
  2446 
  2440   // Support for code generation
  2447   // Support for code generation
  2441   static ByteSize data_offset() {
  2448   static ByteSize data_offset() {
  2478   static bool profile_return();
  2485   static bool profile_return();
  2479   static bool profile_parameters();
  2486   static bool profile_parameters();
  2480   static bool profile_return_jsr292_only();
  2487   static bool profile_return_jsr292_only();
  2481 
  2488 
  2482   void clean_method_data(BoolObjectClosure* is_alive);
  2489   void clean_method_data(BoolObjectClosure* is_alive);
  2483 
       
  2484   void clean_weak_method_links();
  2490   void clean_weak_method_links();
       
  2491   Mutex* extra_data_lock() { return &_extra_data_lock; }
  2485 };
  2492 };
  2486 
  2493 
  2487 #endif // SHARE_VM_OOPS_METHODDATAOOP_HPP
  2494 #endif // SHARE_VM_OOPS_METHODDATAOOP_HPP