Commit 0fbc34d5 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[cleanup] Replace %PRIuS by %zu

The 'z' length modifier for {size_t} in format strings was introduced
with C99, hence it is available in all environments we support.

R=jgruber@chromium.org, mlippautz@chromium.org

Bug: v8:9183
Change-Id: I1bc2abec3f9c7b38186128202fef4719853de7d4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613243Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61536}
parent b8c97dd2
...@@ -137,7 +137,7 @@ void ReportCompilationSuccess(Handle<Script> script, int position, ...@@ -137,7 +137,7 @@ void ReportCompilationSuccess(Handle<Script> script, int position,
if (FLAG_suppress_asm_messages || !FLAG_trace_asm_time) return; if (FLAG_suppress_asm_messages || !FLAG_trace_asm_time) return;
EmbeddedVector<char, 100> text; EmbeddedVector<char, 100> text;
int length = SNPrintF( int length = SNPrintF(
text, "success, asm->wasm: %0.3f ms, compile: %0.3f ms, %" PRIuS " bytes", text, "success, asm->wasm: %0.3f ms, compile: %0.3f ms, %zu bytes",
translate_time, compile_time, module_size); translate_time, compile_time, module_size);
CHECK_NE(-1, length); CHECK_NE(-1, length);
text.Truncate(length); text.Truncate(length);
...@@ -264,7 +264,7 @@ UnoptimizedCompilationJob::Status AsmJsCompilationJob::ExecuteJobImpl() { ...@@ -264,7 +264,7 @@ UnoptimizedCompilationJob::Status AsmJsCompilationJob::ExecuteJobImpl() {
if (FLAG_trace_asm_parser) { if (FLAG_trace_asm_parser) {
PrintF( PrintF(
"[asm.js translation successful: time=%0.3fms, " "[asm.js translation successful: time=%0.3fms, "
"translate_zone=%" PRIuS "KB, compile_zone+=%" PRIuS "KB]\n", "translate_zone=%zuKB, compile_zone+=%zuKB]\n",
translate_time_, translate_zone_size_ / KB, compile_zone_size / KB); translate_time_, translate_zone_size_ / KB, compile_zone_size / KB);
} }
return SUCCEEDED; return SUCCEEDED;
......
...@@ -15,11 +15,6 @@ ...@@ -15,11 +15,6 @@
// For wide strings, prepend "Wide" to the macro: // For wide strings, prepend "Wide" to the macro:
// int64_t value; // int64_t value;
// StringPrintf(L"xyz: %" WidePRId64, value); // StringPrintf(L"xyz: %" WidePRId64, value);
//
// To print a size_t value in a portable way:
// size_t size;
// printf("xyz: %" PRIuS, size);
// The "u" in the macro corresponds to %u, and S is for "size".
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
...@@ -46,10 +41,6 @@ ...@@ -46,10 +41,6 @@
#define WidePRIu64 PRIu64 #define WidePRIu64 PRIu64
#define WidePRIx64 PRIx64 #define WidePRIx64 PRIx64
#if !defined(PRIuS)
#define PRIuS "zu"
#endif
// The size of NSInteger and NSUInteger varies between 32-bit and 64-bit // The size of NSInteger and NSUInteger varies between 32-bit and 64-bit
// architectures and Apple does not provides standard format macros and // architectures and Apple does not provides standard format macros and
// recommends casting. This has many drawbacks, so instead define macros // recommends casting. This has many drawbacks, so instead define macros
...@@ -88,10 +79,6 @@ ...@@ -88,10 +79,6 @@
#define WidePRIu64 L"I64u" #define WidePRIu64 L"I64u"
#define WidePRIx64 L"I64x" #define WidePRIx64 L"I64x"
#if !defined(PRIuS)
#define PRIuS "Iu"
#endif
#endif #endif
#endif // V8_BASE_FORMAT_MACROS_H_ #endif // V8_BASE_FORMAT_MACROS_H_
...@@ -73,15 +73,15 @@ static void WriteLine(std::ostream& os, bool machine_format, const char* name, ...@@ -73,15 +73,15 @@ static void WriteLine(std::ostream& os, bool machine_format, const char* name,
static_cast<double>(total_stats.total_allocated_bytes_); static_cast<double>(total_stats.total_allocated_bytes_);
if (machine_format) { if (machine_format) {
base::OS::SNPrintF(buffer, kBufferSize, base::OS::SNPrintF(buffer, kBufferSize,
"\"%s_time\"=%.3f\n\"%s_space\"=%" PRIuS, name, ms, name, "\"%s_time\"=%.3f\n\"%s_space\"=%zu", name, ms, name,
stats.total_allocated_bytes_); stats.total_allocated_bytes_);
os << buffer; os << buffer;
} else { } else {
base::OS::SNPrintF( base::OS::SNPrintF(buffer, kBufferSize,
buffer, kBufferSize, "%34s %10.3f (%5.1f%%) %10zu (%5.1f%%) %10zu %10zu",
"%34s %10.3f (%5.1f%%) %10" PRIuS " (%5.1f%%) %10" PRIuS " %10" PRIuS, name, ms, percent, stats.total_allocated_bytes_,
name, ms, percent, stats.total_allocated_bytes_, size_percent, size_percent, stats.max_allocated_bytes_,
stats.max_allocated_bytes_, stats.absolute_max_allocated_bytes_); stats.absolute_max_allocated_bytes_);
os << buffer; os << buffer;
if (!stats.function_name_.empty()) { if (!stats.function_name_.empty()) {
......
...@@ -311,9 +311,9 @@ static int DecodeIt(Isolate* isolate, ExternalReferenceEncoder* ref_encoder, ...@@ -311,9 +311,9 @@ static int DecodeIt(Isolate* isolate, ExternalReferenceEncoder* ref_encoder,
it->rinfo()->rmode() == RelocInfo::INTERNAL_REFERENCE) { it->rinfo()->rmode() == RelocInfo::INTERNAL_REFERENCE) {
// raw pointer embedded in code stream, e.g., jump table // raw pointer embedded in code stream, e.g., jump table
byte* ptr = *reinterpret_cast<byte**>(pc); byte* ptr = *reinterpret_cast<byte**>(pc);
SNPrintF( SNPrintF(decode_buffer, "%08" V8PRIxPTR " jump table entry %4zu",
decode_buffer, "%08" V8PRIxPTR " jump table entry %4" PRIuS, reinterpret_cast<intptr_t>(ptr),
reinterpret_cast<intptr_t>(ptr), static_cast<size_t>(ptr - begin)); static_cast<size_t>(ptr - begin));
pc += sizeof(ptr); pc += sizeof(ptr);
} else { } else {
decode_buffer[0] = '\0'; decode_buffer[0] = '\0';
......
...@@ -1278,7 +1278,7 @@ void GlobalHandles::PrintStats() { ...@@ -1278,7 +1278,7 @@ void GlobalHandles::PrintStats() {
} }
PrintF("Global Handle Statistics:\n"); PrintF("Global Handle Statistics:\n");
PrintF(" allocated memory = %" PRIuS "B\n", total * sizeof(Node)); PrintF(" allocated memory = %zuB\n", total * sizeof(Node));
PrintF(" # weak = %d\n", weak); PrintF(" # weak = %d\n", weak);
PrintF(" # pending = %d\n", pending); PrintF(" # pending = %d\n", pending);
PrintF(" # near_death = %d\n", near_death); PrintF(" # near_death = %d\n", near_death);
......
...@@ -20,7 +20,7 @@ const size_t GCIdleTimeHandler::kMinTimeForOverApproximatingWeakClosureInMs = 1; ...@@ -20,7 +20,7 @@ const size_t GCIdleTimeHandler::kMinTimeForOverApproximatingWeakClosureInMs = 1;
void GCIdleTimeHeapState::Print() { void GCIdleTimeHeapState::Print() {
PrintF("contexts_disposed=%d ", contexts_disposed); PrintF("contexts_disposed=%d ", contexts_disposed);
PrintF("contexts_disposal_rate=%f ", contexts_disposal_rate); PrintF("contexts_disposal_rate=%f ", contexts_disposal_rate);
PrintF("size_of_objects=%" PRIuS " ", size_of_objects); PrintF("size_of_objects=%zu ", size_of_objects);
PrintF("incremental_marking_stopped=%d ", incremental_marking_stopped); PrintF("incremental_marking_stopped=%d ", incremental_marking_stopped);
} }
......
...@@ -530,20 +530,13 @@ void GCTracer::PrintNVP() const { ...@@ -530,20 +530,13 @@ void GCTracer::PrintNVP() const {
"incremental.steps_count=%d " "incremental.steps_count=%d "
"incremental.steps_took=%.1f " "incremental.steps_took=%.1f "
"scavenge_throughput=%.f " "scavenge_throughput=%.f "
"total_size_before=%" PRIuS "total_size_before=%zu "
" " "total_size_after=%zu "
"total_size_after=%" PRIuS "holes_size_before=%zu "
" " "holes_size_after=%zu "
"holes_size_before=%" PRIuS "allocated=%zu "
" " "promoted=%zu "
"holes_size_after=%" PRIuS "semi_space_copied=%zu "
" "
"allocated=%" PRIuS
" "
"promoted=%" PRIuS
" "
"semi_space_copied=%" PRIuS
" "
"nodes_died_in_new=%d " "nodes_died_in_new=%d "
"nodes_copied_in_new=%d " "nodes_copied_in_new=%d "
"nodes_promoted=%d " "nodes_promoted=%d "
...@@ -726,20 +719,13 @@ void GCTracer::PrintNVP() const { ...@@ -726,20 +719,13 @@ void GCTracer::PrintNVP() const {
"background.array_buffer_free=%.2f " "background.array_buffer_free=%.2f "
"background.store_buffer=%.2f " "background.store_buffer=%.2f "
"background.unmapper=%.1f " "background.unmapper=%.1f "
"total_size_before=%" PRIuS "total_size_before=%zu "
" " "total_size_after=%zu "
"total_size_after=%" PRIuS "holes_size_before=%zu "
" " "holes_size_after=%zu "
"holes_size_before=%" PRIuS "allocated=%zu "
" " "promoted=%zu "
"holes_size_after=%" PRIuS "semi_space_copied=%zu "
" "
"allocated=%" PRIuS
" "
"promoted=%" PRIuS
" "
"semi_space_copied=%" PRIuS
" "
"nodes_died_in_new=%d " "nodes_died_in_new=%d "
"nodes_copied_in_new=%d " "nodes_copied_in_new=%d "
"nodes_promoted=%d " "nodes_promoted=%d "
......
...@@ -107,7 +107,7 @@ size_t MemoryController::CalculateAllocationLimit( ...@@ -107,7 +107,7 @@ size_t MemoryController::CalculateAllocationLimit(
if (FLAG_trace_gc_verbose) { if (FLAG_trace_gc_verbose) {
Isolate::FromHeap(heap_)->PrintWithTimestamp( Isolate::FromHeap(heap_)->PrintWithTimestamp(
"%s Limit: old size: %" PRIuS " KB, new limit: %" PRIuS " KB (%.1f)\n", "%s Limit: old size: %zu KB, new limit: %zu KB (%.1f)\n",
ControllerName(), curr_size / KB, result / KB, factor); ControllerName(), curr_size / KB, result / KB, factor);
} }
......
...@@ -364,95 +364,76 @@ void Heap::SetGCState(HeapState state) { ...@@ -364,95 +364,76 @@ void Heap::SetGCState(HeapState state) {
void Heap::PrintShortHeapStatistics() { void Heap::PrintShortHeapStatistics() {
if (!FLAG_trace_gc_verbose) return; if (!FLAG_trace_gc_verbose) return;
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Memory allocator, used: %6" PRIuS "Memory allocator, used: %6zu KB,"
" KB," " available: %6zu KB\n",
" available: %6" PRIuS " KB\n",
memory_allocator()->Size() / KB, memory_allocator()->Size() / KB,
memory_allocator()->Available() / KB); memory_allocator()->Available() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Read-only space, used: %6" PRIuS "Read-only space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS " KB\n",
read_only_space_->Size() / KB, read_only_space_->Size() / KB,
read_only_space_->Available() / KB, read_only_space_->Available() / KB,
read_only_space_->CommittedMemory() / KB); read_only_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"New space, used: %6" PRIuS "New space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS " KB\n",
new_space_->Size() / KB, new_space_->Available() / KB, new_space_->Size() / KB, new_space_->Available() / KB,
new_space_->CommittedMemory() / KB); new_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"New large object space, used: %6" PRIuS "New large object space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS " KB\n",
new_lo_space_->SizeOfObjects() / KB, new_lo_space_->SizeOfObjects() / KB,
new_lo_space_->Available() / KB, new_lo_space_->Available() / KB,
new_lo_space_->CommittedMemory() / KB); new_lo_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Old space, used: %6" PRIuS "Old space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS " KB\n",
old_space_->SizeOfObjects() / KB, old_space_->Available() / KB, old_space_->SizeOfObjects() / KB, old_space_->Available() / KB,
old_space_->CommittedMemory() / KB); old_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Code space, used: %6" PRIuS "Code space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS "KB\n",
code_space_->SizeOfObjects() / KB, code_space_->Available() / KB, code_space_->SizeOfObjects() / KB, code_space_->Available() / KB,
code_space_->CommittedMemory() / KB); code_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Map space, used: %6" PRIuS "Map space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS " KB\n",
map_space_->SizeOfObjects() / KB, map_space_->Available() / KB, map_space_->SizeOfObjects() / KB, map_space_->Available() / KB,
map_space_->CommittedMemory() / KB); map_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Large object space, used: %6" PRIuS "Large object space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS " KB\n",
lo_space_->SizeOfObjects() / KB, lo_space_->Available() / KB, lo_space_->SizeOfObjects() / KB, lo_space_->Available() / KB,
lo_space_->CommittedMemory() / KB); lo_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Code large object space, used: %6" PRIuS "Code large object space, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS " KB\n",
code_lo_space_->SizeOfObjects() / KB, code_lo_space_->SizeOfObjects() / KB,
code_lo_space_->Available() / KB, code_lo_space_->Available() / KB,
code_lo_space_->CommittedMemory() / KB); code_lo_space_->CommittedMemory() / KB);
ReadOnlySpace* const ro_space = read_only_space_; ReadOnlySpace* const ro_space = read_only_space_;
PrintIsolate(isolate_, PrintIsolate(isolate_,
"All spaces, used: %6" PRIuS "All spaces, used: %6zu KB"
" KB" ", available: %6zu KB"
", available: %6" PRIuS ", committed: %6zu KB\n",
" KB"
", committed: %6" PRIuS "KB\n",
(this->SizeOfObjects() + ro_space->SizeOfObjects()) / KB, (this->SizeOfObjects() + ro_space->SizeOfObjects()) / KB,
(this->Available() + ro_space->Available()) / KB, (this->Available() + ro_space->Available()) / KB,
(this->CommittedMemory() + ro_space->CommittedMemory()) / KB); (this->CommittedMemory() + ro_space->CommittedMemory()) / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Unmapper buffering %zu chunks of committed: %6" PRIuS " KB\n", "Unmapper buffering %zu chunks of committed: %6zu KB\n",
memory_allocator()->unmapper()->NumberOfCommittedChunks(), memory_allocator()->unmapper()->NumberOfCommittedChunks(),
CommittedMemoryOfUnmapper() / KB); CommittedMemoryOfUnmapper() / KB);
PrintIsolate(isolate_, "External memory reported: %6" PRId64 " KB\n", PrintIsolate(isolate_, "External memory reported: %6" PRId64 " KB\n",
isolate()->isolate_data()->external_memory_ / KB); isolate()->isolate_data()->external_memory_ / KB);
PrintIsolate(isolate_, "Backing store memory: %6" PRIuS " KB\n", PrintIsolate(isolate_, "Backing store memory: %6zu KB\n",
backing_store_bytes_ / KB); backing_store_bytes_ / KB);
PrintIsolate(isolate_, "External memory global %zu KB\n", PrintIsolate(isolate_, "External memory global %zu KB\n",
external_memory_callback_() / KB); external_memory_callback_() / KB);
...@@ -2159,9 +2140,9 @@ void Heap::ComputeFastPromotionMode() { ...@@ -2159,9 +2140,9 @@ void Heap::ComputeFastPromotionMode() {
!ShouldReduceMemory() && new_space_->IsAtMaximumCapacity() && !ShouldReduceMemory() && new_space_->IsAtMaximumCapacity() &&
survived_in_new_space >= kMinPromotedPercentForFastPromotionMode; survived_in_new_space >= kMinPromotedPercentForFastPromotionMode;
if (FLAG_trace_gc_verbose && !FLAG_trace_gc_ignore_scavenger) { if (FLAG_trace_gc_verbose && !FLAG_trace_gc_ignore_scavenger) {
PrintIsolate( PrintIsolate(isolate(), "Fast promotion mode: %s survival rate: %zu%%\n",
isolate(), "Fast promotion mode: %s survival rate: %" PRIuS "%%\n", fast_promotion_mode_ ? "true" : "false",
fast_promotion_mode_ ? "true" : "false", survived_in_new_space); survived_in_new_space);
} }
} }
...@@ -4215,7 +4196,7 @@ void Heap::ConfigureHeap(size_t max_semi_space_size_in_kb, ...@@ -4215,7 +4196,7 @@ void Heap::ConfigureHeap(size_t max_semi_space_size_in_kb,
if (FLAG_trace_gc) { if (FLAG_trace_gc) {
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Min semi-space size cannot be more than the maximum " "Min semi-space size cannot be more than the maximum "
"semi-space size of %" PRIuS " MB\n", "semi-space size of %zu MB\n",
max_semi_space_size_ / MB); max_semi_space_size_ / MB);
} }
} else { } else {
......
...@@ -926,8 +926,8 @@ void IncrementalMarking::ScheduleBytesToMarkBasedOnTime(double time_ms) { ...@@ -926,8 +926,8 @@ void IncrementalMarking::ScheduleBytesToMarkBasedOnTime(double time_ms) {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
heap_->isolate()->PrintWithTimestamp( heap_->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Scheduled %" PRIuS "[IncrementalMarking] Scheduled %zuKB to mark based on time delta "
"KB to mark based on time delta %.1fms\n", "%.1fms\n",
bytes_to_mark / KB, delta_ms); bytes_to_mark / KB, delta_ms);
} }
} }
...@@ -1028,9 +1028,8 @@ void IncrementalMarking::ScheduleBytesToMarkBasedOnAllocation() { ...@@ -1028,9 +1028,8 @@ void IncrementalMarking::ScheduleBytesToMarkBasedOnAllocation() {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
heap_->isolate()->PrintWithTimestamp( heap_->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Scheduled %" PRIuS "[IncrementalMarking] Scheduled %zuKB to mark based on allocation "
"KB to mark based on allocation (progress=" "(progress=%zuKB, allocation=%zuKB)\n",
"%" PRIuS "KB, allocation=%" PRIuS "KB)\n",
bytes_to_mark / KB, progress_bytes / KB, allocation_bytes / KB); bytes_to_mark / KB, progress_bytes / KB, allocation_bytes / KB);
} }
} }
...@@ -1048,7 +1047,7 @@ void IncrementalMarking::FetchBytesMarkedConcurrently() { ...@@ -1048,7 +1047,7 @@ void IncrementalMarking::FetchBytesMarkedConcurrently() {
} }
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
heap_->isolate()->PrintWithTimestamp( heap_->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Marked %" PRIuS "KB on background threads\n", "[IncrementalMarking] Marked %zuKB on background threads\n",
heap_->concurrent_marking()->TotalMarkedBytes() / KB); heap_->concurrent_marking()->TotalMarkedBytes() / KB);
} }
} }
...@@ -1059,11 +1058,11 @@ size_t IncrementalMarking::ComputeStepSizeInBytes(StepOrigin step_origin) { ...@@ -1059,11 +1058,11 @@ size_t IncrementalMarking::ComputeStepSizeInBytes(StepOrigin step_origin) {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
if (scheduled_bytes_to_mark_ > bytes_marked_) { if (scheduled_bytes_to_mark_ > bytes_marked_) {
heap_->isolate()->PrintWithTimestamp( heap_->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Marker is %" PRIuS "KB behind schedule\n", "[IncrementalMarking] Marker is %zuKB behind schedule\n",
(scheduled_bytes_to_mark_ - bytes_marked_) / KB); (scheduled_bytes_to_mark_ - bytes_marked_) / KB);
} else { } else {
heap_->isolate()->PrintWithTimestamp( heap_->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Marker is %" PRIuS "KB ahead of schedule\n", "[IncrementalMarking] Marker is %zuKB ahead of schedule\n",
(bytes_marked_ - scheduled_bytes_to_mark_) / KB); (bytes_marked_ - scheduled_bytes_to_mark_) / KB);
} }
} }
...@@ -1171,7 +1170,7 @@ StepResult IncrementalMarking::V8Step(double max_step_size_in_ms, ...@@ -1171,7 +1170,7 @@ StepResult IncrementalMarking::V8Step(double max_step_size_in_ms,
heap_->tracer()->AddIncrementalMarkingStep(duration, bytes_processed); heap_->tracer()->AddIncrementalMarkingStep(duration, bytes_processed);
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
heap_->isolate()->PrintWithTimestamp( heap_->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Step %s %" PRIuS "KB (%" PRIuS "KB) in %.1f\n", "[IncrementalMarking] Step %s %zuKB (%zuKB) in %.1f\n",
step_origin == StepOrigin::kV8 ? "in v8" : "in task", step_origin == StepOrigin::kV8 ? "in v8" : "in task",
bytes_processed / KB, bytes_to_process / KB, duration); bytes_processed / KB, bytes_to_process / KB, duration);
} }
......
...@@ -732,8 +732,8 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) { ...@@ -732,8 +732,8 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
if (FLAG_trace_fragmentation_verbose) { if (FLAG_trace_fragmentation_verbose) {
PrintIsolate(isolate(), PrintIsolate(isolate(),
"compaction-selection-page: space=%s free_bytes_page=%zu " "compaction-selection-page: space=%s free_bytes_page=%zu "
"fragmentation_limit_kb=%" PRIuS "fragmentation_limit_kb=%zu "
" fragmentation_limit_percent=%d sum_compaction_kb=%zu " "fragmentation_limit_percent=%d sum_compaction_kb=%zu "
"compaction_limit_kb=%zu\n", "compaction_limit_kb=%zu\n",
space->name(), free_bytes / KB, free_bytes_threshold / KB, space->name(), free_bytes / KB, free_bytes_threshold / KB,
target_fragmentation_percent, total_live_bytes / KB, target_fragmentation_percent, total_live_bytes / KB,
......
...@@ -2790,8 +2790,7 @@ class VerboseAccountingAllocator : public AccountingAllocator { ...@@ -2790,8 +2790,7 @@ class VerboseAccountingAllocator : public AccountingAllocator {
"\"time\": %f, " "\"time\": %f, "
"\"ptr\": \"%p\", " "\"ptr\": \"%p\", "
"\"name\": \"%s\", " "\"name\": \"%s\", "
"\"size\": %" PRIuS "\"size\": %zu,"
","
"\"nesting\": %zu}\n", "\"nesting\": %zu}\n",
type, reinterpret_cast<void*>(heap_->isolate()), type, reinterpret_cast<void*>(heap_->isolate()),
heap_->isolate()->time_millis_since_init(), heap_->isolate()->time_millis_since_init(),
...@@ -2808,7 +2807,7 @@ class VerboseAccountingAllocator : public AccountingAllocator { ...@@ -2808,7 +2807,7 @@ class VerboseAccountingAllocator : public AccountingAllocator {
"\"type\": \"zone\", " "\"type\": \"zone\", "
"\"isolate\": \"%p\", " "\"isolate\": \"%p\", "
"\"time\": %f, " "\"time\": %f, "
"\"allocated\": %" PRIuS "}\n", "\"allocated\": %zu}\n",
reinterpret_cast<void*>(heap_->isolate()), time, malloced); reinterpret_cast<void*>(heap_->isolate()), time, malloced);
} }
......
...@@ -136,7 +136,7 @@ void AddressToTraceMap::Clear() { ...@@ -136,7 +136,7 @@ void AddressToTraceMap::Clear() {
void AddressToTraceMap::Print() { void AddressToTraceMap::Print() {
PrintF("[AddressToTraceMap (%" PRIuS "): \n", ranges_.size()); PrintF("[AddressToTraceMap (%zu): \n", ranges_.size());
for (RangeMap::iterator it = ranges_.begin(); it != ranges_.end(); ++it) { for (RangeMap::iterator it = ranges_.begin(); it != ranges_.end(); ++it) {
PrintF("[%p - %p] => %u\n", reinterpret_cast<void*>(it->second.start), PrintF("[%p - %p] => %u\n", reinterpret_cast<void*>(it->second.start),
reinterpret_cast<void*>(it->first), it->second.trace_node_id); reinterpret_cast<void*>(it->first), it->second.trace_node_id);
......
...@@ -104,7 +104,7 @@ void HeapEntry::SetNamedAutoIndexReference(HeapGraphEdge::Type type, ...@@ -104,7 +104,7 @@ void HeapEntry::SetNamedAutoIndexReference(HeapGraphEdge::Type type,
void HeapEntry::Print( void HeapEntry::Print(
const char* prefix, const char* edge_name, int max_depth, int indent) { const char* prefix, const char* edge_name, int max_depth, int indent) {
STATIC_ASSERT(sizeof(unsigned) == sizeof(id())); STATIC_ASSERT(sizeof(unsigned) == sizeof(id()));
base::OS::Print("%6" PRIuS " @%6u %*c %s%s: ", self_size(), id(), indent, ' ', base::OS::Print("%6zu @%6u %*c %s%s: ", self_size(), id(), indent, ' ',
prefix, edge_name); prefix, edge_name);
if (type() != kString) { if (type() != kString) {
base::OS::Print("%s %.40s\n", TypeAsString(), name_); base::OS::Print("%s %.40s\n", TypeAsString(), name_);
......
...@@ -325,13 +325,12 @@ void ProfileNode::Print(int indent) { ...@@ -325,13 +325,12 @@ void ProfileNode::Print(int indent) {
base::OS::Print("\n"); base::OS::Print("\n");
for (size_t i = 0; i < deopt_infos_.size(); ++i) { for (size_t i = 0; i < deopt_infos_.size(); ++i) {
CpuProfileDeoptInfo& info = deopt_infos_[i]; CpuProfileDeoptInfo& info = deopt_infos_[i];
base::OS::Print("%*s;;; deopted at script_id: %d position: %" PRIuS base::OS::Print(
" with reason '%s'.\n", "%*s;;; deopted at script_id: %d position: %zu with reason '%s'.\n",
indent + 10, "", info.stack[0].script_id, indent + 10, "", info.stack[0].script_id, info.stack[0].position,
info.stack[0].position, info.deopt_reason); info.deopt_reason);
for (size_t index = 1; index < info.stack.size(); ++index) { for (size_t index = 1; index < info.stack.size(); ++index) {
base::OS::Print("%*s;;; Inline point: script_id %d position: %" PRIuS base::OS::Print("%*s;;; Inline point: script_id %d position: %zu.\n",
".\n",
indent + 10, "", info.stack[index].script_id, indent + 10, "", info.stack[index].script_id,
info.stack[index].position); info.stack[index].position);
} }
......
...@@ -144,7 +144,7 @@ void SerializerAllocator::OutputStatistics() { ...@@ -144,7 +144,7 @@ void SerializerAllocator::OutputStatistics() {
for (int space = FIRST_SPACE; space < kNumberOfPreallocatedSpaces; space++) { for (int space = FIRST_SPACE; space < kNumberOfPreallocatedSpaces; space++) {
size_t s = pending_chunk_[space]; size_t s = pending_chunk_[space];
for (uint32_t chunk_size : completed_chunks_[space]) s += chunk_size; for (uint32_t chunk_size : completed_chunks_[space]) s += chunk_size;
PrintF("%16" PRIuS, s); PrintF("%16zu", s);
} }
STATIC_ASSERT(MAP_SPACE == kNumberOfPreallocatedSpaces); STATIC_ASSERT(MAP_SPACE == kNumberOfPreallocatedSpaces);
......
...@@ -75,8 +75,7 @@ void Serializer::OutputStatistics(const char* name) { ...@@ -75,8 +75,7 @@ void Serializer::OutputStatistics(const char* name) {
#define PRINT_INSTANCE_TYPE(Name) \ #define PRINT_INSTANCE_TYPE(Name) \
for (int space = 0; space < LAST_SPACE; ++space) { \ for (int space = 0; space < LAST_SPACE; ++space) { \
if (instance_type_count_[space][Name]) { \ if (instance_type_count_[space][Name]) { \
PrintF("%10d %10" PRIuS " %-10s %s\n", \ PrintF("%10d %10zu %-10s %s\n", instance_type_count_[space][Name], \
instance_type_count_[space][Name], \
instance_type_size_[space][Name], \ instance_type_size_[space][Name], \
Heap::GetSpaceName(static_cast<AllocationSpace>(space)), #Name); \ Heap::GetSpaceName(static_cast<AllocationSpace>(space)), #Name); \
} \ } \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment