Mercurial > hg > graal-compiler
comparison src/share/vm/oops/methodData.cpp @ 13108:d84fa69a9874
added support for printing method profiles for virtual calls
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 22 Nov 2013 01:30:06 +0100 |
parents | ec3e4f35e466 |
children | 389d40d7d99f |
comparison
equal
deleted
inserted
replaced
13107:91933915d1d0 | 13108:d84fa69a9874 |
---|---|
395 uint row; | 395 uint row; |
396 int entries = 0; | 396 int entries = 0; |
397 for (row = 0; row < row_limit(); row++) { | 397 for (row = 0; row < row_limit(); row++) { |
398 if (receiver(row) != NULL) entries++; | 398 if (receiver(row) != NULL) entries++; |
399 } | 399 } |
400 #ifdef GRAAL | |
401 st->print_cr("count(%u) nonprofiled_count(%u) entries(%u)", count(), nonprofiled_count(), entries); | |
402 #else | |
400 st->print_cr("count(%u) entries(%u)", count(), entries); | 403 st->print_cr("count(%u) entries(%u)", count(), entries); |
404 #endif | |
401 int total = count(); | 405 int total = count(); |
402 for (row = 0; row < row_limit(); row++) { | 406 for (row = 0; row < row_limit(); row++) { |
403 if (receiver(row) != NULL) { | 407 if (receiver(row) != NULL) { |
404 total += receiver_count(row); | 408 total += receiver_count(row); |
405 } | 409 } |
414 } | 418 } |
415 void ReceiverTypeData::print_data_on(outputStream* st) const { | 419 void ReceiverTypeData::print_data_on(outputStream* st) const { |
416 print_shared(st, "ReceiverTypeData"); | 420 print_shared(st, "ReceiverTypeData"); |
417 print_receiver_data_on(st); | 421 print_receiver_data_on(st); |
418 } | 422 } |
423 | |
424 #ifdef GRAAL | |
425 void VirtualCallData::print_method_data_on(outputStream* st) const { | |
426 uint row; | |
427 int entries = 0; | |
428 for (row = 0; row < method_row_limit(); row++) { | |
429 if (method(row) != NULL) entries++; | |
430 } | |
431 tab(st); | |
432 st->print_cr("method_entries(%u)", entries); | |
433 int total = count(); | |
434 for (row = 0; row < method_row_limit(); row++) { | |
435 if (method(row) != NULL) { | |
436 total += method_count(row); | |
437 } | |
438 } | |
439 for (row = 0; row < method_row_limit(); row++) { | |
440 if (method(row) != NULL) { | |
441 tab(st); | |
442 method(row)->print_value_on(st); | |
443 st->print_cr("(%u %4.2f)", method_count(row), (float) method_count(row) / (float) total); | |
444 } | |
445 } | |
446 } | |
447 #endif | |
448 | |
419 void VirtualCallData::print_data_on(outputStream* st) const { | 449 void VirtualCallData::print_data_on(outputStream* st) const { |
420 print_shared(st, "VirtualCallData"); | 450 print_shared(st, "VirtualCallData"); |
421 print_receiver_data_on(st); | 451 print_receiver_data_on(st); |
452 #ifdef GRAAL | |
453 print_method_data_on(st); | |
454 #endif | |
422 } | 455 } |
423 #endif // !PRODUCT | 456 #endif // !PRODUCT |
424 | 457 |
425 // ================================================================== | 458 // ================================================================== |
426 // RetData | 459 // RetData |