2078 // These counters are used to determine the exact age of MDO.
2079 // We need those because in tiered a method can be concurrently
2080 // executed at different levels.
2081 InvocationCounter _invocation_counter;
2082 // Same for backedges.
2083 InvocationCounter _backedge_counter;
2084 // Counter values at the time profiling started.
2085 int _invocation_counter_start;
2086 int _backedge_counter_start;
2087 uint _tenure_traps;
2088
2089 #if INCLUDE_RTM_OPT
2090 // State of RTM code generation during compilation of the method
2091 int _rtm_state;
2092 #endif
2093
2094 // Number of loops and blocks is computed when compiling the first
2095 // time with C1. It is used to determine if method is trivial.
2096 short _num_loops;
2097 short _num_blocks;
2098 // Does this method contain anything worth profiling?
2099 bool _would_profile;
2100
2101 // Size of _data array in bytes. (Excludes header and extra_data fields.)
2102 int _data_size;
2103
2104 // data index for the area dedicated to parameters. -1 if no
2105 // parameter profiling.
2106 enum { no_parameters = -2, parameters_uninitialized = -1 };
2107 int _parameters_type_data_di;
2108 int parameters_size_in_bytes() const {
2109 ParametersTypeData* param = parameters_type_data();
2110 return param == NULL ? 0 : param->size_in_bytes();
2111 }
2112
2113 // Beginning of the data entries
2114 intptr_t _data[1];
2115
2116 // Helper for size computation
2117 static int compute_data_size(BytecodeStream* stream);
2260 }
2261 void set_rtm_state(RTMState rstate) {
2262 _rtm_state = (int)rstate;
2263 }
2264 void atomic_set_rtm_state(RTMState rstate) {
2265 Atomic::store((int)rstate, &_rtm_state);
2266 }
2267
2268 static int rtm_state_offset_in_bytes() {
2269 return offset_of(MethodData, _rtm_state);
2270 }
2271 #endif
2272
2273 void set_would_profile(bool p) { _would_profile = p; }
2274 bool would_profile() const { return _would_profile; }
2275
2276 int num_loops() const { return _num_loops; }
2277 void set_num_loops(int n) { _num_loops = n; }
2278 int num_blocks() const { return _num_blocks; }
2279 void set_num_blocks(int n) { _num_blocks = n; }
2280
2281 bool is_mature() const; // consult mileage and ProfileMaturityPercentage
2282 static int mileage_of(Method* m);
2283
2284 // Support for interprocedural escape analysis, from Thomas Kotzmann.
2285 enum EscapeFlag {
2286 estimated = 1 << 0,
2287 return_local = 1 << 1,
2288 return_allocated = 1 << 2,
2289 allocated_escapes = 1 << 3,
2290 unknown_modified = 1 << 4
2291 };
2292
2293 intx eflags() { return _eflags; }
2294 intx arg_local() { return _arg_local; }
2295 intx arg_stack() { return _arg_stack; }
2296 intx arg_returned() { return _arg_returned; }
2297 uint arg_modified(int a) { ArgInfoData *aid = arg_info();
2298 assert(aid != NULL, "arg_info must be not null");
2299 assert(a >= 0 && a < aid->number_of_args(), "valid argument number");
|
2078 // These counters are used to determine the exact age of MDO.
2079 // We need those because in tiered a method can be concurrently
2080 // executed at different levels.
2081 InvocationCounter _invocation_counter;
2082 // Same for backedges.
2083 InvocationCounter _backedge_counter;
2084 // Counter values at the time profiling started.
2085 int _invocation_counter_start;
2086 int _backedge_counter_start;
2087 uint _tenure_traps;
2088
2089 #if INCLUDE_RTM_OPT
2090 // State of RTM code generation during compilation of the method
2091 int _rtm_state;
2092 #endif
2093
2094 // Number of loops and blocks is computed when compiling the first
2095 // time with C1. It is used to determine if method is trivial.
2096 short _num_loops;
2097 short _num_blocks;
2098 bool _stats_valid; // determines if above values are set
2099 // Does this method contain anything worth profiling?
2100 bool _would_profile;
2101
2102 // Size of _data array in bytes. (Excludes header and extra_data fields.)
2103 int _data_size;
2104
2105 // data index for the area dedicated to parameters. -1 if no
2106 // parameter profiling.
2107 enum { no_parameters = -2, parameters_uninitialized = -1 };
2108 int _parameters_type_data_di;
2109 int parameters_size_in_bytes() const {
2110 ParametersTypeData* param = parameters_type_data();
2111 return param == NULL ? 0 : param->size_in_bytes();
2112 }
2113
2114 // Beginning of the data entries
2115 intptr_t _data[1];
2116
2117 // Helper for size computation
2118 static int compute_data_size(BytecodeStream* stream);
2261 }
2262 void set_rtm_state(RTMState rstate) {
2263 _rtm_state = (int)rstate;
2264 }
2265 void atomic_set_rtm_state(RTMState rstate) {
2266 Atomic::store((int)rstate, &_rtm_state);
2267 }
2268
2269 static int rtm_state_offset_in_bytes() {
2270 return offset_of(MethodData, _rtm_state);
2271 }
2272 #endif
2273
2274 void set_would_profile(bool p) { _would_profile = p; }
2275 bool would_profile() const { return _would_profile; }
2276
2277 int num_loops() const { return _num_loops; }
2278 void set_num_loops(int n) { _num_loops = n; }
2279 int num_blocks() const { return _num_blocks; }
2280 void set_num_blocks(int n) { _num_blocks = n; }
2281 bool stats_valid() const { return _stats_valid; }
2282 void set_stats_valid(bool valid) { _stats_valid = valid; }
2283
2284 bool is_mature() const; // consult mileage and ProfileMaturityPercentage
2285 static int mileage_of(Method* m);
2286
2287 // Support for interprocedural escape analysis, from Thomas Kotzmann.
2288 enum EscapeFlag {
2289 estimated = 1 << 0,
2290 return_local = 1 << 1,
2291 return_allocated = 1 << 2,
2292 allocated_escapes = 1 << 3,
2293 unknown_modified = 1 << 4
2294 };
2295
2296 intx eflags() { return _eflags; }
2297 intx arg_local() { return _arg_local; }
2298 intx arg_stack() { return _arg_stack; }
2299 intx arg_returned() { return _arg_returned; }
2300 uint arg_modified(int a) { ArgInfoData *aid = arg_info();
2301 assert(aid != NULL, "arg_info must be not null");
2302 assert(a >= 0 && a < aid->number_of_args(), "valid argument number");
|