Skip to content

Commit c36200b

Browse files
committed
8347721: Replace SIZE_FORMAT in compiler directories
Reviewed-by: kvn, dlong
1 parent af3f5d8 commit c36200b

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/hotspot/share/code/codeCache.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ GrowableArray<CodeHeap*>* CodeCache::_allocable_heaps = new(mtCode) GrowableArra
178178

179179
static void check_min_size(const char* codeheap, size_t size, size_t required_size) {
180180
if (size < required_size) {
181-
log_debug(codecache)("Code heap (%s) size " SIZE_FORMAT "K below required minimal size " SIZE_FORMAT "K",
181+
log_debug(codecache)("Code heap (%s) size %zuK below required minimal size %zuK",
182182
codeheap, size/K, required_size/K);
183183
err_msg title("Not enough space in %s to run VM", codeheap);
184-
err_msg message(SIZE_FORMAT "K < " SIZE_FORMAT "K", size/K, required_size/K);
184+
err_msg message(SIZE_FORMAT "K < %zuK", size/K, required_size/K);
185185
vm_exit_during_initialization(title, message);
186186
}
187187
}
@@ -256,15 +256,15 @@ void CodeCache::initialize_heaps() {
256256

257257
size_t total = non_nmethod.size + profiled.size + non_profiled.size;
258258
if (total != cache_size && !cache_size_set) {
259-
log_info(codecache)("ReservedCodeCache size " SIZE_FORMAT "K changed to total segments size NonNMethod "
260-
SIZE_FORMAT "K NonProfiled " SIZE_FORMAT "K Profiled " SIZE_FORMAT "K = " SIZE_FORMAT "K",
259+
log_info(codecache)("ReservedCodeCache size %zuK changed to total segments size NonNMethod "
260+
"%zuK NonProfiled %zuK Profiled %zuK = %zuK",
261261
cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K, total/K);
262262
// Adjust ReservedCodeCacheSize as necessary because it was not set explicitly
263263
cache_size = total;
264264
}
265265

266-
log_debug(codecache)("Initializing code heaps ReservedCodeCache " SIZE_FORMAT "K NonNMethod " SIZE_FORMAT "K"
267-
" NonProfiled " SIZE_FORMAT "K Profiled " SIZE_FORMAT "K",
266+
log_debug(codecache)("Initializing code heaps ReservedCodeCache %zuK NonNMethod %zuK"
267+
" NonProfiled %zuK Profiled %zuK",
268268
cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K);
269269

270270
// Validation
@@ -282,16 +282,16 @@ void CodeCache::initialize_heaps() {
282282

283283
// ReservedCodeCacheSize was set explicitly, so report an error and abort if it doesn't match the segment sizes
284284
if (total != cache_size && cache_size_set) {
285-
err_msg message("NonNMethodCodeHeapSize (" SIZE_FORMAT "K)", non_nmethod.size/K);
285+
err_msg message("NonNMethodCodeHeapSize (%zuK)", non_nmethod.size/K);
286286
if (profiled.enabled) {
287-
message.append(" + ProfiledCodeHeapSize (" SIZE_FORMAT "K)", profiled.size/K);
287+
message.append(" + ProfiledCodeHeapSize (%zuK)", profiled.size/K);
288288
}
289289
if (non_profiled.enabled) {
290-
message.append(" + NonProfiledCodeHeapSize (" SIZE_FORMAT "K)", non_profiled.size/K);
290+
message.append(" + NonProfiledCodeHeapSize (%zuK)", non_profiled.size/K);
291291
}
292-
message.append(" = " SIZE_FORMAT "K", total/K);
292+
message.append(" = %zuK", total/K);
293293
message.append((total > cache_size) ? " is greater than " : " is less than ");
294-
message.append("ReservedCodeCacheSize (" SIZE_FORMAT "K).", cache_size/K);
294+
message.append("ReservedCodeCacheSize (%zuK).", cache_size/K);
295295

296296
vm_exit_during_initialization("Invalid code heap sizes", message);
297297
}
@@ -356,7 +356,7 @@ ReservedSpace CodeCache::reserve_heap_memory(size_t size, size_t rs_ps) {
356356

357357
ReservedSpace rs = CodeMemoryReserver::reserve(rs_size, rs_align, rs_ps);
358358
if (!rs.is_reserved()) {
359-
vm_exit_during_initialization(err_msg("Could not reserve enough space for code cache (" SIZE_FORMAT "K)",
359+
vm_exit_during_initialization(err_msg("Could not reserve enough space for code cache (%zuK)",
360360
rs_size/K));
361361
}
362362

@@ -437,7 +437,7 @@ void CodeCache::add_heap(ReservedSpace rs, const char* name, CodeBlobType code_b
437437
size_t size_initial = MIN2((size_t)InitialCodeCacheSize, rs.size());
438438
size_initial = align_up(size_initial, rs.page_size());
439439
if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
440-
vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
440+
vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (%zuK)",
441441
heap->name(), size_initial/K));
442442
}
443443

@@ -1727,8 +1727,8 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
17271727
total_used += used;
17281728
total_max_used += max_used;
17291729
total_free += free;
1730-
st->print_cr(" size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT
1731-
"Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb",
1730+
st->print_cr(" size=%zuKb used=%zu"
1731+
"Kb max_used=%zuKb free=%zuKb",
17321732
size, used, max_used, free);
17331733

17341734
if (detailed) {
@@ -1788,7 +1788,7 @@ void CodeCache::print_layout(outputStream* st) {
17881788

17891789
void CodeCache::log_state(outputStream* st) {
17901790
st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
1791-
" adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
1791+
" adapters='" UINT32_FORMAT "' free_code_cache='%zu'",
17921792
blob_count(), nmethod_count(), adapter_count(),
17931793
unallocated_capacity());
17941794
}

src/hotspot/share/code/codeHeapState.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -370,7 +370,7 @@ void CodeHeapState::prepare_StatArray(outputStream* out, size_t nElem, size_t gr
370370
if (StatArray == nullptr) {
371371
//---< just do nothing if allocation failed >---
372372
out->print_cr("Statistics could not be collected for %s, probably out of memory.", heapName);
373-
out->print_cr("Current granularity is " SIZE_FORMAT " bytes. Try a coarser granularity.", granularity);
373+
out->print_cr("Current granularity is %zu bytes. Try a coarser granularity.", granularity);
374374
alloc_granules = 0;
375375
granule_size = 0;
376376
} else {
@@ -621,11 +621,11 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
621621
" collected data to be consistent. Only the method names and signatures\n"
622622
" are retrieved at print time. That may lead to rare cases where the\n"
623623
" name of a method is no longer available, e.g. because it was unloaded.\n");
624-
ast->print_cr(" CodeHeap committed size " SIZE_FORMAT "K (" SIZE_FORMAT "M), reserved size " SIZE_FORMAT "K (" SIZE_FORMAT "M), %d%% occupied.",
624+
ast->print_cr(" CodeHeap committed size %zuK (%zuM), reserved size %zuK (%zuM), %d%% occupied.",
625625
size/(size_t)K, size/(size_t)M, res_size/(size_t)K, res_size/(size_t)M, (unsigned int)(100.0*size/res_size));
626-
ast->print_cr(" CodeHeap allocation segment size is " SIZE_FORMAT " bytes. This is the smallest possible granularity.", seg_size);
627-
ast->print_cr(" CodeHeap (committed part) is mapped to " SIZE_FORMAT " granules of size " SIZE_FORMAT " bytes.", granules, granularity);
628-
ast->print_cr(" Each granule takes " SIZE_FORMAT " bytes of C heap, that is " SIZE_FORMAT "K in total for statistics data.", sizeof(StatElement), (sizeof(StatElement)*granules)/(size_t)K);
626+
ast->print_cr(" CodeHeap allocation segment size is %zu bytes. This is the smallest possible granularity.", seg_size);
627+
ast->print_cr(" CodeHeap (committed part) is mapped to %zu granules of size %zu bytes.", granules, granularity);
628+
ast->print_cr(" Each granule takes %zu bytes of C heap, that is %zuK in total for statistics data.", sizeof(StatElement), (sizeof(StatElement)*granules)/(size_t)K);
629629
ast->print_cr(" The number of granules is limited to %dk, requiring a granules size of at least %d bytes for a 1GB heap.", (unsigned int)(max_granules/K), (unsigned int)(G/max_granules));
630630
BUFFEREDSTREAM_FLUSH("\n")
631631

@@ -697,10 +697,10 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
697697
insane = true; ast->print_cr("Sanity check: HeapBlock @%p outside used range (%p)", (char*)h, low_bound + size);
698698
}
699699
if (ix_end >= granules) {
700-
insane = true; ast->print_cr("Sanity check: end index (%d) out of bounds (" SIZE_FORMAT ")", ix_end, granules);
700+
insane = true; ast->print_cr("Sanity check: end index (%d) out of bounds (%zu)", ix_end, granules);
701701
}
702702
if (size != heap->capacity()) {
703-
insane = true; ast->print_cr("Sanity check: code heap capacity has changed (" SIZE_FORMAT "K to " SIZE_FORMAT "K)", size/(size_t)K, heap->capacity()/(size_t)K);
703+
insane = true; ast->print_cr("Sanity check: code heap capacity has changed (%zuK to %zuK)", size/(size_t)K, heap->capacity()/(size_t)K);
704704
}
705705
if (ix_beg > ix_end) {
706706
insane = true; ast->print_cr("Sanity check: end index (%d) lower than begin index (%d)", ix_end, ix_beg);
@@ -1134,7 +1134,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
11341134
ast->print_cr(" The aggregate step collects information about all free blocks in CodeHeap.\n"
11351135
" Subsequent print functions create their output based on this snapshot.\n");
11361136
ast->print_cr(" Free space in %s is distributed over %d free blocks.", heapName, nBlocks_free);
1137-
ast->print_cr(" Each free block takes " SIZE_FORMAT " bytes of C heap for statistics data, that is " SIZE_FORMAT "K in total.", sizeof(FreeBlk), (sizeof(FreeBlk)*nBlocks_free)/K);
1137+
ast->print_cr(" Each free block takes %zu bytes of C heap for statistics data, that is %zuK in total.", sizeof(FreeBlk), (sizeof(FreeBlk)*nBlocks_free)/K);
11381138
BUFFEREDSTREAM_FLUSH("\n")
11391139

11401140
//----------------------------------------
@@ -2101,7 +2101,7 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
21012101
size_t end_ix = (ix+granules_per_line <= alloc_granules) ? ix+granules_per_line : alloc_granules;
21022102
ast->cr();
21032103
ast->print_cr("--------------------------------------------------------------------");
2104-
ast->print_cr("Address range [" INTPTR_FORMAT "," INTPTR_FORMAT "), " SIZE_FORMAT "k", p2i(low_bound+ix*granule_size), p2i(low_bound + end_ix*granule_size), (end_ix - ix)*granule_size/(size_t)K);
2104+
ast->print_cr("Address range [" INTPTR_FORMAT "," INTPTR_FORMAT "), %zuk", p2i(low_bound+ix*granule_size), p2i(low_bound + end_ix*granule_size), (end_ix - ix)*granule_size/(size_t)K);
21052105
ast->print_cr("--------------------------------------------------------------------");
21062106
BUFFEREDSTREAM_FLUSH_AUTO("")
21072107
}

src/hotspot/share/code/nmethod.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ void nmethod::purge(bool unregister_nmethod) {
21102110
// completely deallocate this method
21112111
Events::log_nmethod_flush(Thread::current(), "flushing %s nmethod " INTPTR_FORMAT, is_osr_method() ? "osr" : "", p2i(this));
21122112
log_debug(codecache)("*flushing %s nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT
2113-
"/Free CodeCache:" SIZE_FORMAT "Kb",
2113+
"/Free CodeCache:%zuKb",
21142114
is_osr_method() ? "osr" : "",_compile_id, p2i(this), CodeCache::blob_count(),
21152115
CodeCache::unallocated_capacity(CodeCache::get_code_blob_type(this))/1024);
21162116

src/hotspot/share/code/vtableStubs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) {
226226

227227
enter(is_vtable_stub, vtable_index, s);
228228
if (PrintAdapterHandlers) {
229-
tty->print_cr("Decoding VtableStub %s[%d]@" PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (" SIZE_FORMAT " bytes)",
229+
tty->print_cr("Decoding VtableStub %s[%d]@" PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (%zu bytes)",
230230
is_vtable_stub? "vtbl": "itbl", vtable_index, p2i(VtableStub::receiver_location()),
231231
p2i(s->code_begin()), p2i(s->code_end()), pointer_delta(s->code_end(), s->code_begin(), 1));
232232
Disassembler::decode(s->code_begin(), s->code_end());

src/hotspot/share/opto/parse1.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -642,7 +642,7 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses)
642642
// for exiting control flow still refers to the inlined method.
643643
C->set_default_node_notes(caller_nn);
644644

645-
if (log) log->done("parse nodes='%d' live='%d' memory='" SIZE_FORMAT "'",
645+
if (log) log->done("parse nodes='%d' live='%d' memory='%zu'",
646646
C->unique(), C->live_nodes(), C->node_arena()->used());
647647
}
648648

0 commit comments

Comments
 (0)