1206 // first_di() may be out of bounds if data_size is 0. 1207 // In that situation, _hint_di is never used, but at 1208 // least well-defined. 1209 _hint_di = first_di(); 1210 1211 post_initialize(&stream); 1212 1213 assert(object_size == compute_allocation_size_in_bytes(methodHandle(_method)), "MethodData: computed size != initialized size"); 1214 set_size(object_size); 1215 } 1216 1217 void MethodData::init() { 1218 _invocation_counter.init(); 1219 _backedge_counter.init(); 1220 _invocation_counter_start = 0; 1221 _backedge_counter_start = 0; 1222 1223 // Set per-method invoke- and backedge mask. 1224 double scale = 1.0; 1225 CompilerOracle::has_option_value(_method, "CompileThresholdScaling", scale); 1226 _invoke_mask = right_n_bits(Arguments::scaled_freq_log(Tier0InvokeNotifyFreqLog, scale)) << InvocationCounter::count_shift; 1227 _backedge_mask = right_n_bits(Arguments::scaled_freq_log(Tier0BackedgeNotifyFreqLog, scale)) << InvocationCounter::count_shift; 1228 1229 _tenure_traps = 0; 1230 _num_loops = 0; 1231 _num_blocks = 0; 1232 _would_profile = unknown; 1233 1234 #if INCLUDE_JVMCI 1235 _jvmci_ir_size = 0; 1236 #endif 1237 1238 #if INCLUDE_RTM_OPT 1239 _rtm_state = NoRTM; // No RTM lock eliding by default 1240 if (UseRTMLocking && 1241 !CompilerOracle::has_option_string(_method, "NoRTMLockEliding")) { 1242 if (CompilerOracle::has_option_string(_method, "UseRTMLockEliding") || !UseRTMDeopt) { 1243 // Generate RTM lock eliding code without abort ratio calculation code. 1244 _rtm_state = UseRTM; 1245 } else if (UseRTMDeopt) { 1246 // Generate RTM lock eliding code and include abort ratio calculation 1247 // code if UseRTMDeopt is on. | 1206 // first_di() may be out of bounds if data_size is 0. 1207 // In that situation, _hint_di is never used, but at 1208 // least well-defined. 1209 _hint_di = first_di(); 1210 1211 post_initialize(&stream); 1212 1213 assert(object_size == compute_allocation_size_in_bytes(methodHandle(_method)), "MethodData: computed size != initialized size"); 1214 set_size(object_size); 1215 } 1216 1217 void MethodData::init() { 1218 _invocation_counter.init(); 1219 _backedge_counter.init(); 1220 _invocation_counter_start = 0; 1221 _backedge_counter_start = 0; 1222 1223 // Set per-method invoke- and backedge mask. 1224 double scale = 1.0; 1225 CompilerOracle::has_option_value(_method, "CompileThresholdScaling", scale); 1226 _invoke_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0InvokeNotifyFreqLog, scale)) << InvocationCounter::count_shift; 1227 _backedge_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0BackedgeNotifyFreqLog, scale)) << InvocationCounter::count_shift; 1228 1229 _tenure_traps = 0; 1230 _num_loops = 0; 1231 _num_blocks = 0; 1232 _would_profile = unknown; 1233 1234 #if INCLUDE_JVMCI 1235 _jvmci_ir_size = 0; 1236 #endif 1237 1238 #if INCLUDE_RTM_OPT 1239 _rtm_state = NoRTM; // No RTM lock eliding by default 1240 if (UseRTMLocking && 1241 !CompilerOracle::has_option_string(_method, "NoRTMLockEliding")) { 1242 if (CompilerOracle::has_option_string(_method, "UseRTMLockEliding") || !UseRTMDeopt) { 1243 // Generate RTM lock eliding code without abort ratio calculation code. 1244 _rtm_state = UseRTM; 1245 } else if (UseRTMDeopt) { 1246 // Generate RTM lock eliding code and include abort ratio calculation 1247 // code if UseRTMDeopt is on. |