RFR: 8005885: enhance PrintCodeCache to print more data

Xin Liu xliu at openjdk.java.net
Wed Feb 16 07:15:22 UTC 2022


On Tue, 8 Feb 2022 19:17:32 GMT, Yi-Fan Tsai <duke at openjdk.java.net> wrote:

> 8005885: enhance PrintCodeCache to print more data

src/hotspot/share/code/codeCache.cpp line 1445:

> 1443:     FOR_ALL_BLOBS(cb, *heap) {
> 1444:       if (cb->is_nmethod()) {
> 1445:         const int level = cb->as_nmethod_or_null()->comp_level();

is cb->as_nmethod() better?

src/hotspot/share/code/codeCache.cpp line 1470:

> 1468:   for (int i = CompLevel_simple; i <= CompLevel_full_optimization; i++) {
> 1469:     tty->print_cr("Tier %d:", i);
> 1470:     if (!live[i - 1].is_empty()) {

your policy is to skip empty entries. I suggest you move is_empty() logic to CodeBlob_sizes::print(). 
one side, it would print out "#0 live: empty"  instead of skipping it. that's informative. 
secondly, it should simplify your code here.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7389


More information about the hotspot-compiler-dev mailing list