Skip to content

Commit 0b50e47

Browse files
author
Vladimir Kozlov
committed
8349753: Incorrect use of CodeBlob::is_buffer_blob() in few places
Reviewed-by: dlong, shade
1 parent 18958c6 commit 0b50e47

File tree

4 files changed

+47
-2
lines changed

4 files changed

+47
-2
lines changed

src/hotspot/share/code/codeBlob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ void CodeBlob::print_value_on(outputStream* st) const {
656656
}
657657

658658
void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const {
659-
if (is_buffer_blob()) {
659+
if (is_buffer_blob() || is_adapter_blob() || is_vtable_blob() || is_method_handles_adapter_blob()) {
660660
// the interpreter is generated into a buffer blob
661661
InterpreterCodelet* i = Interpreter::codelet_containing(addr);
662662
if (i != nullptr) {

src/hotspot/share/code/codeCache.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,9 +1516,14 @@ void CodeCache::print_trace(const char* event, CodeBlob* cb, uint size) {
15161516
void CodeCache::print_internals() {
15171517
int nmethodCount = 0;
15181518
int runtimeStubCount = 0;
1519+
int upcallStubCount = 0;
15191520
int adapterCount = 0;
1521+
int mhAdapterCount = 0;
1522+
int vtableBlobCount = 0;
15201523
int deoptimizationStubCount = 0;
15211524
int uncommonTrapStubCount = 0;
1525+
int exceptionStubCount = 0;
1526+
int safepointStubCount = 0;
15221527
int bufferBlobCount = 0;
15231528
int total = 0;
15241529
int nmethodNotEntrant = 0;
@@ -1555,12 +1560,22 @@ void CodeCache::print_internals() {
15551560
}
15561561
} else if (cb->is_runtime_stub()) {
15571562
runtimeStubCount++;
1563+
} else if (cb->is_upcall_stub()) {
1564+
upcallStubCount++;
15581565
} else if (cb->is_deoptimization_stub()) {
15591566
deoptimizationStubCount++;
15601567
} else if (cb->is_uncommon_trap_stub()) {
15611568
uncommonTrapStubCount++;
1569+
} else if (cb->is_exception_stub()) {
1570+
exceptionStubCount++;
1571+
} else if (cb->is_safepoint_stub()) {
1572+
safepointStubCount++;
15621573
} else if (cb->is_adapter_blob()) {
15631574
adapterCount++;
1575+
} else if (cb->is_method_handles_adapter_blob()) {
1576+
mhAdapterCount++;
1577+
} else if (cb->is_vtable_blob()) {
1578+
vtableBlobCount++;
15641579
} else if (cb->is_buffer_blob()) {
15651580
bufferBlobCount++;
15661581
}
@@ -1587,10 +1602,15 @@ void CodeCache::print_internals() {
15871602
tty->print_cr("\tjava: %d",nmethodJava);
15881603
tty->print_cr("\tnative: %d",nmethodNative);
15891604
tty->print_cr("runtime_stubs: %d",runtimeStubCount);
1605+
tty->print_cr("upcall_stubs: %d",upcallStubCount);
15901606
tty->print_cr("adapters: %d",adapterCount);
1607+
tty->print_cr("MH adapters: %d",mhAdapterCount);
1608+
tty->print_cr("VTables: %d",vtableBlobCount);
15911609
tty->print_cr("buffer blobs: %d",bufferBlobCount);
15921610
tty->print_cr("deoptimization_stubs: %d",deoptimizationStubCount);
15931611
tty->print_cr("uncommon_traps: %d",uncommonTrapStubCount);
1612+
tty->print_cr("exception_stubs: %d",exceptionStubCount);
1613+
tty->print_cr("safepoint_stubs: %d",safepointStubCount);
15941614
tty->print_cr("\nnmethod size distribution");
15951615
tty->print_cr("-------------------------------------------------");
15961616

@@ -1616,9 +1636,14 @@ void CodeCache::print() {
16161636

16171637
CodeBlob_sizes live[CompLevel_full_optimization + 1];
16181638
CodeBlob_sizes runtimeStub;
1639+
CodeBlob_sizes upcallStub;
16191640
CodeBlob_sizes uncommonTrapStub;
16201641
CodeBlob_sizes deoptimizationStub;
1642+
CodeBlob_sizes exceptionStub;
1643+
CodeBlob_sizes safepointStub;
16211644
CodeBlob_sizes adapter;
1645+
CodeBlob_sizes mhAdapter;
1646+
CodeBlob_sizes vtableBlob;
16221647
CodeBlob_sizes bufferBlob;
16231648
CodeBlob_sizes other;
16241649

@@ -1630,12 +1655,22 @@ void CodeCache::print() {
16301655
live[level].add(cb);
16311656
} else if (cb->is_runtime_stub()) {
16321657
runtimeStub.add(cb);
1658+
} else if (cb->is_upcall_stub()) {
1659+
upcallStub.add(cb);
16331660
} else if (cb->is_deoptimization_stub()) {
16341661
deoptimizationStub.add(cb);
16351662
} else if (cb->is_uncommon_trap_stub()) {
16361663
uncommonTrapStub.add(cb);
1664+
} else if (cb->is_exception_stub()) {
1665+
exceptionStub.add(cb);
1666+
} else if (cb->is_safepoint_stub()) {
1667+
safepointStub.add(cb);
16371668
} else if (cb->is_adapter_blob()) {
16381669
adapter.add(cb);
1670+
} else if (cb->is_method_handles_adapter_blob()) {
1671+
mhAdapter.add(cb);
1672+
} else if (cb->is_vtable_blob()) {
1673+
vtableBlob.add(cb);
16391674
} else if (cb->is_buffer_blob()) {
16401675
bufferBlob.add(cb);
16411676
} else {
@@ -1666,9 +1701,14 @@ void CodeCache::print() {
16661701
const CodeBlob_sizes* sizes;
16671702
} non_nmethod_blobs[] = {
16681703
{ "runtime", &runtimeStub },
1704+
{ "upcall", &upcallStub },
16691705
{ "uncommon trap", &uncommonTrapStub },
16701706
{ "deoptimization", &deoptimizationStub },
1707+
{ "exception", &exceptionStub },
1708+
{ "safepoint", &safepointStub },
16711709
{ "adapter", &adapter },
1710+
{ "mh_adapter", &mhAdapter },
1711+
{ "vtable", &vtableBlob },
16721712
{ "buffer blob", &bufferBlob },
16731713
{ "other", &other },
16741714
};

src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void CodeBlobCollector::do_blob(CodeBlob* cb) {
124124
return;
125125
}
126126
// exclude VtableStubs, which are processed separately
127-
if (cb->is_buffer_blob() && strcmp(cb->name(), "vtable chunks") == 0) {
127+
if (cb->is_vtable_blob()) {
128128
return;
129129
}
130130

test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ public class CheckCodeCacheInfo {
5656
+ pair
5757
+ "Non-nmethod blobs:\\n"
5858
+ " #\\d+ runtime = " + entry
59+
+ " #\\d+ upcall = " + entry
5960
+ " #\\d+ uncommon trap = " + entry
6061
+ " #\\d+ deoptimization = " + entry
62+
+ " #\\d+ exception = " + entry
63+
+ " #\\d+ safepoint = " + entry
6164
+ " #\\d+ adapter = " + entry
65+
+ " #\\d+ mh_adapter = " + entry
66+
+ " #\\d+ vtable = " + entry
6267
+ " #\\d+ buffer blob = " + entry
6368
+ " #\\d+ other = " + entry;
6469
}

0 commit comments

Comments
 (0)