comparison src/share/vm/oops/method.hpp @ 20465:7301840ea20e

8023461: Thread holding lock at safepoint that vm can block on: MethodCompileQueue_lock Reviewed-by: kvn, iveresov
author vlivanov
date Tue, 11 Mar 2014 15:06:34 +0400
parents 7384f6a12fc1
children 966205f0e717
comparison
equal deleted inserted replaced
20464:b2029969cc16 20465:7301840ea20e
231 void clear_breakpoint(int bci); 231 void clear_breakpoint(int bci);
232 void clear_all_breakpoints(); 232 void clear_all_breakpoints();
233 // Tracking number of breakpoints, for fullspeed debugging. 233 // Tracking number of breakpoints, for fullspeed debugging.
234 // Only mutated by VM thread. 234 // Only mutated by VM thread.
235 u2 number_of_breakpoints() const { 235 u2 number_of_breakpoints() const {
236 if (method_counters() == NULL) { 236 MethodCounters* mcs = method_counters();
237 if (mcs == NULL) {
237 return 0; 238 return 0;
238 } else { 239 } else {
239 return method_counters()->number_of_breakpoints(); 240 return mcs->number_of_breakpoints();
240 } 241 }
241 } 242 }
242 void incr_number_of_breakpoints(TRAPS) { 243 void incr_number_of_breakpoints(TRAPS) {
243 MethodCounters* mcs = get_method_counters(CHECK); 244 MethodCounters* mcs = get_method_counters(CHECK);
244 if (mcs != NULL) { 245 if (mcs != NULL) {
251 mcs->decr_number_of_breakpoints(); 252 mcs->decr_number_of_breakpoints();
252 } 253 }
253 } 254 }
254 // Initialization only 255 // Initialization only
255 void clear_number_of_breakpoints() { 256 void clear_number_of_breakpoints() {
256 if (method_counters() != NULL) { 257 MethodCounters* mcs = method_counters();
257 method_counters()->clear_number_of_breakpoints(); 258 if (mcs != NULL) {
259 mcs->clear_number_of_breakpoints();
258 } 260 }
259 } 261 }
260 262
261 // index into InstanceKlass methods() array 263 // index into InstanceKlass methods() array
262 // note: also used by jfr 264 // note: also used by jfr
299 mcs->interpreter_throwout_increment(); 301 mcs->interpreter_throwout_increment();
300 } 302 }
301 } 303 }
302 304
303 int interpreter_throwout_count() const { 305 int interpreter_throwout_count() const {
304 if (method_counters() == NULL) { 306 MethodCounters* mcs = method_counters();
307 if (mcs == NULL) {
305 return 0; 308 return 0;
306 } else { 309 } else {
307 return method_counters()->interpreter_throwout_count(); 310 return mcs->interpreter_throwout_count();
308 } 311 }
309 } 312 }
310 313
311 // size of parameters 314 // size of parameters
312 int size_of_parameters() const { return constMethod()->size_of_parameters(); } 315 int size_of_parameters() const { return constMethod()->size_of_parameters(); }
377 return 0; 380 return 0;
378 } else { 381 } else {
379 return method_counters()->interpreter_invocation_count(); 382 return method_counters()->interpreter_invocation_count();
380 } 383 }
381 } 384 }
382 void set_prev_event_count(int count, TRAPS) { 385 void set_prev_event_count(int count) {
383 MethodCounters* mcs = get_method_counters(CHECK); 386 MethodCounters* mcs = method_counters();
384 if (mcs != NULL) { 387 if (mcs != NULL) {
385 mcs->set_interpreter_invocation_count(count); 388 mcs->set_interpreter_invocation_count(count);
386 } 389 }
387 } 390 }
388 jlong prev_time() const { 391 jlong prev_time() const {
389 return method_counters() == NULL ? 0 : method_counters()->prev_time(); 392 MethodCounters* mcs = method_counters();
390 } 393 return mcs == NULL ? 0 : mcs->prev_time();
391 void set_prev_time(jlong time, TRAPS) { 394 }
392 MethodCounters* mcs = get_method_counters(CHECK); 395 void set_prev_time(jlong time) {
396 MethodCounters* mcs = method_counters();
393 if (mcs != NULL) { 397 if (mcs != NULL) {
394 mcs->set_prev_time(time); 398 mcs->set_prev_time(time);
395 } 399 }
396 } 400 }
397 float rate() const { 401 float rate() const {
398 return method_counters() == NULL ? 0 : method_counters()->rate(); 402 MethodCounters* mcs = method_counters();
399 } 403 return mcs == NULL ? 0 : mcs->rate();
400 void set_rate(float rate, TRAPS) { 404 }
401 MethodCounters* mcs = get_method_counters(CHECK); 405 void set_rate(float rate) {
406 MethodCounters* mcs = method_counters();
402 if (mcs != NULL) { 407 if (mcs != NULL) {
403 mcs->set_rate(rate); 408 mcs->set_rate(rate);
404 } 409 }
405 } 410 }
406 #endif 411 #endif
414 static void build_interpreter_method_data(methodHandle method, TRAPS); 419 static void build_interpreter_method_data(methodHandle method, TRAPS);
415 420
416 static MethodCounters* build_method_counters(Method* m, TRAPS); 421 static MethodCounters* build_method_counters(Method* m, TRAPS);
417 422
418 int interpreter_invocation_count() { 423 int interpreter_invocation_count() {
419 if (TieredCompilation) return invocation_count(); 424 if (TieredCompilation) {
420 else return (method_counters() == NULL) ? 0 : 425 return invocation_count();
421 method_counters()->interpreter_invocation_count(); 426 } else {
427 MethodCounters* mcs = method_counters();
428 return (mcs == NULL) ? 0 : mcs->interpreter_invocation_count();
429 }
422 } 430 }
423 int increment_interpreter_invocation_count(TRAPS) { 431 int increment_interpreter_invocation_count(TRAPS) {
424 if (TieredCompilation) ShouldNotReachHere(); 432 if (TieredCompilation) ShouldNotReachHere();
425 MethodCounters* mcs = get_method_counters(CHECK_0); 433 MethodCounters* mcs = get_method_counters(CHECK_0);
426 return (mcs == NULL) ? 0 : mcs->increment_interpreter_invocation_count(); 434 return (mcs == NULL) ? 0 : mcs->increment_interpreter_invocation_count();