8037816: Fix for 8036122 breaks build with Xcode5/clang

Repaired or selectively disabled offending formats; future-proofed with additional checking

Reviewed-by: kvn, jrose, stefank
This commit is contained in:
David Chase 2014-05-09 16:50:54 -04:00
parent 563feb9091
commit 305ec3bd3f
293 changed files with 1285 additions and 913 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -149,7 +149,7 @@ void VM_Version::initialize() {
}
void VM_Version::print_features() {
tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), get_cache_line_size());
tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size());
}
#ifdef COMPILER2

View File

@ -318,22 +318,22 @@ void VM_Version::initialize() {
tty->print("BIS");
}
if (AllocatePrefetchLines > 1) {
tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
} else {
tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
}
}
if (PrefetchCopyIntervalInBytes > 0) {
tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
}
if (PrefetchScanIntervalInBytes > 0) {
tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
}
if (PrefetchFieldsAhead > 0) {
tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
}
if (ContendedPaddingWidth > 0) {
tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
}
}
#endif // PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -522,11 +522,11 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
// these asserts are somewhat nonsensical
#ifndef _LP64
assert(which == imm_operand || which == disp32_operand,
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
#else
assert((which == call32_operand || which == imm_operand) && is_64bit ||
which == narrow_oop_operand && !is_64bit,
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
#endif // _LP64
return ip;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -95,7 +95,7 @@ void LinearScan::allocate_fpu_stack() {
#ifndef PRODUCT
if (TraceFPURegisterUsage) {
tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->print_cr("");
tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->cr();
}
#endif
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -122,7 +122,7 @@ void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry)
if (TraceICs) {
ResourceMark rm;
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
instruction_address(),
p2i(instruction_address()),
callee->name_and_sig_as_C_string());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -48,6 +48,7 @@ void RegisterMap::check_location_valid() {
}
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Profiling/safepoint support

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -51,6 +51,7 @@
#define __ _masm->
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifdef _WIN64
address AbstractInterpreterGenerator::generate_slow_signature_handler() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,6 +55,7 @@
#define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifdef ASSERT
bool AbstractAssembler::pd_check_instruction_mark() { return true; }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,8 @@
#include "memory/allocation.inline.hpp"
#include "prims/methodHandles.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#define __ _masm->
#ifdef PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -35,6 +35,8 @@
#include "c1/c1_Runtime1.hpp"
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void NativeInstruction::wrote(int offset) {
ICache::invalidate_word(addr_at(offset));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -925,16 +925,16 @@ void VM_Version::get_processor_features() {
if (PrintMiscellaneous && Verbose) {
tty->print_cr("Logical CPUs per core: %u",
logical_processors_per_package());
tty->print("UseSSE=%d",UseSSE);
tty->print("UseSSE=%d", (int) UseSSE);
if (UseAVX > 0) {
tty->print(" UseAVX=%d",UseAVX);
tty->print(" UseAVX=%d", (int) UseAVX);
}
if (UseAES) {
tty->print(" UseAES=1");
}
#ifdef COMPILER2
if (MaxVectorSize > 0) {
tty->print(" MaxVectorSize=%d", MaxVectorSize);
tty->print(" MaxVectorSize=%d", (int) MaxVectorSize);
}
#endif
tty->cr();
@ -957,23 +957,23 @@ void VM_Version::get_processor_features() {
}
}
if (AllocatePrefetchLines > 1) {
tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
} else {
tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
}
}
if (PrefetchCopyIntervalInBytes > 0) {
tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
}
if (PrefetchScanIntervalInBytes > 0) {
tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
}
if (PrefetchFieldsAhead > 0) {
tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
}
if (ContendedPaddingWidth > 0) {
tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
}
}
#endif // !PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -118,7 +118,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
if (PrintMiscellaneous && (WizardMode || Verbose)) {
tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d",
vtable_index, s->entry_point(),
vtable_index, p2i(s->entry_point()),
(int)(s->code_end() - s->entry_point()),
(int)(s->code_end() - __ pc()));
}
@ -199,7 +199,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
if (PrintMiscellaneous && (WizardMode || Verbose)) {
tty->print_cr("itable #%d at "PTR_FORMAT"[%d] left over: %d",
itable_index, s->entry_point(),
itable_index, p2i(s->entry_point()),
(int)(s->code_end() - s->entry_point()),
(int)(s->code_end() - __ pc()));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -35,6 +35,8 @@
#include "opto/runtime.hpp"
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// machine-dependent part of VtableStubs: create VtableStub of correct size and
// initialize its code

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -53,7 +53,7 @@ bool MachODecoder::decode(address addr, char *buf,
struct symtab_command * symt = (struct symtab_command *)
mach_find_command((struct mach_header_64 *)mach_base, LC_SYMTAB);
if (symt == NULL) {
DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", mach_base));
DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", p2i(mach_base)));
return false;
}
uint32_t off = symt->symoff; /* symbol table offset (within this mach file) */

View File

@ -124,6 +124,9 @@
#define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
#define LARGEPAGES_BIT (1 << 6)
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
////////////////////////////////////////////////////////////////////////////////
// global variables
julong os::Bsd::_physical_memory = 0;
@ -2394,7 +2397,6 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
(!FLAG_IS_DEFAULT(UseLargePages) ||
!FLAG_IS_DEFAULT(LargePageSizeInBytes)
);
char msg[128];
// Create a large shared memory region to attach to based on size.
// Currently, size is the total size of the heap
@ -2415,8 +2417,7 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
// coalesce into large pages. Try to reserve large pages when
// the system is still "fresh".
if (warn_on_failure) {
jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
warning(msg);
warning("Failed to reserve shared memory (errno = %d).", errno);
}
return NULL;
}
@ -2433,8 +2434,7 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
if ((intptr_t)addr == -1) {
if (warn_on_failure) {
jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
warning(msg);
warning("Failed to attach shared memory (errno = %d).", err);
}
return NULL;
}
@ -3810,6 +3810,7 @@ bool os::check_heap(bool force) {
return true;
}
ATTRIBUTE_PRINTF(3, 0)
int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
return ::vsnprintf(buf, count, format, args);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -925,7 +925,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
if (PerfTraceMemOps) {
tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
}
}

View File

@ -102,6 +102,8 @@
# include <inttypes.h>
# include <sys/ioctl.h>
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
// getrusage() is prepared to handle the associated failure.
#ifndef RUSAGE_THREAD
@ -2138,7 +2140,7 @@ void os::print_os_info(outputStream* st) {
// Print warning if unsafe chroot environment detected
if (unsafe_chroot_detected) {
st->print("WARNING!! ");
st->print_cr(unstable_chroot_error);
st->print_cr("%s", unstable_chroot_error);
}
os::Linux::print_libversion_info(st);
@ -2199,8 +2201,8 @@ void os::Linux::print_distro_info(outputStream* st) {
void os::Linux::print_libversion_info(outputStream* st) {
// libc, pthread
st->print("libc:");
st->print(os::Linux::glibc_version()); st->print(" ");
st->print(os::Linux::libpthread_version()); st->print(" ");
st->print("%s ", os::Linux::glibc_version());
st->print("%s ", os::Linux::libpthread_version());
if (os::Linux::is_LinuxThreads()) {
st->print("(%s stack)", os::Linux::is_floating_stack() ? "floating" : "fixed");
}
@ -3417,7 +3419,7 @@ char* os::Linux::reserve_memory_special_shm(size_t bytes, size_t alignment, char
// the system is still "fresh".
if (warn_on_failure) {
jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
warning(msg);
warning("%s", msg);
}
return NULL;
}
@ -3435,7 +3437,7 @@ char* os::Linux::reserve_memory_special_shm(size_t bytes, size_t alignment, char
if ((intptr_t)addr == -1) {
if (warn_on_failure) {
jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
warning(msg);
warning("%s", msg);
}
return NULL;
}
@ -3455,7 +3457,7 @@ static void warn_on_large_pages_failure(char* req_addr, size_t bytes, int error)
char msg[128];
jio_snprintf(msg, sizeof(msg), "Failed to reserve large pages memory req_addr: "
PTR_FORMAT " bytes: " SIZE_FORMAT " (errno = %d).", req_addr, bytes, error);
warning(msg);
warning("%s", msg);
}
}

View File

@ -931,7 +931,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
if (PerfTraceMemOps) {
tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
}
}

View File

@ -36,6 +36,8 @@
#include <pthread.h>
#include <signal.h>
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Todo: provide a os::get_max_process_id() or similar. Number of processes
// may have been configured, can be read more accurately from proc fs etc.
#ifndef MAX_PID
@ -192,10 +194,10 @@ void os::Posix::print_uname_info(outputStream* st) {
st->print("uname:");
struct utsname name;
uname(&name);
st->print(name.sysname); st->print(" ");
st->print(name.release); st->print(" ");
st->print(name.version); st->print(" ");
st->print(name.machine);
st->print("%s ", name.sysname);
st->print("%s ", name.release);
st->print("%s ", name.version);
st->print("%s", name.machine);
st->cr();
}
@ -682,7 +684,7 @@ const char* os::Posix::describe_signal_set_short(const sigset_t* set, char* buff
void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) {
char buf[NUM_IMPORTANT_SIGS + 1];
os::Posix::describe_signal_set_short(set, buf, sizeof(buf));
st->print(buf);
st->print("%s", buf);
}
// Writes one-line description of a combination of sigaction.sa_flags into a user
@ -742,7 +744,7 @@ const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) {
void os::Posix::print_sa_flags(outputStream* st, int flags) {
char buffer[0x100];
os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer));
st->print(buffer);
st->print("%s", buffer);
}
// Helper function for os::Posix::print_siginfo_...():

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -276,6 +276,8 @@
# endif
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
address os::current_stack_pointer() {
#if defined(__clang__) || defined(__llvm__)
register void *esp;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -89,6 +89,8 @@
#define SPELL_REG_FP "ebp"
#endif // AMD64
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
address os::current_stack_pointer() {
#ifdef SPARC_WORKS
register void *esp;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1322,7 +1322,7 @@ void InstructForm::rep_var_format(FILE *fp, const char *rep_var) {
OperandForm* oper = form->is_operand();
if (oper != NULL && oper->is_bound_register()) {
const RegDef* first = oper->get_RegClass()->find_first_elem();
fprintf(fp, " st->print(\"%s\");\n", first->_regname);
fprintf(fp, " st->print_raw(\"%s\");\n", first->_regname);
} else {
globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var);
}
@ -2530,7 +2530,7 @@ void OperandForm::format_constant(FILE *fp, uint const_index, uint const_type) {
case Form::idealP: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
case Form::idealNKlass:
case Form::idealN: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
case Form::idealL: fprintf(fp," st->print(\"#%%lld\", _c%d);\n", const_index); break;
case Form::idealL: fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", const_index); break;
case Form::idealF: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
case Form::idealD: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
default:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -386,14 +386,14 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
assert(oper != NULL, "what");
CondInterface* cond = oper->_interface->is_CondInterface();
fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print(\"%s\");\n",i,cond->_overflow_format);
fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print(\"%s\");\n",i,cond->_no_overflow_format);
fprintf(fp, " if( _c%d == BoolTest::eq ) st->print_raw(\"%s\");\n",i,cond->_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print_raw(\"%s\");\n",i,cond->_not_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::le ) st->print_raw(\"%s\");\n",i,cond->_less_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print_raw(\"%s\");\n",i,cond->_greater_equal_format);
fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print_raw(\"%s\");\n",i,cond->_less_format);
fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print_raw(\"%s\");\n",i,cond->_greater_format);
fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print_raw(\"%s\");\n",i,cond->_overflow_format);
fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print_raw(\"%s\");\n",i,cond->_no_overflow_format);
}
// Output code that dumps constant values, increment "i" if type is constant
@ -416,8 +416,8 @@ static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, Operand
++i;
}
else if (!strcmp(ideal_type, "ConL")) {
fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", i);
fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%d);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConF")) {
@ -429,7 +429,7 @@ static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, Operand
else if (!strcmp(ideal_type, "ConD")) {
fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
fprintf(fp," jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%dl);\n", i);
++i;
}
else if (!strcmp(ideal_type, "Bool")) {
@ -471,7 +471,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
fprintf(fp," st->print(\"%s\");\n", string);
fprintf(fp," st->print_raw(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@ -542,7 +542,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
fprintf(fp," st->print(\"%s\");\n", string);
fprintf(fp," st->print_raw(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@ -669,7 +669,7 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
} else if( string == NameList::_signal2 ) // Raw program text
fputs(inst._format->_strings.iter(), fp);
else
fprintf(fp,"st->print(\"%s\");\n", string);
fprintf(fp,"st->print_raw(\"%s\");\n", string);
} // Done with all format strings
} // Done generating the user-defined portion of the format
@ -696,13 +696,13 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
default:
assert(0,"ShouldNotReachHere");
}
fprintf(fp, " st->print_cr(\"\");\n" );
fprintf(fp, " st->cr();\n" );
fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
fprintf(fp, " st->print(\" # \");\n" );
fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
}
else if(inst.is_ideal_safepoint()) {
fprintf(fp, " st->print(\"\");\n" );
fprintf(fp, " st->print_raw(\"\");\n" );
fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
fprintf(fp, " st->print(\" # \");\n" );
fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -988,7 +988,7 @@ void CodeSection::dump() {
for (csize_t step; ptr < end(); ptr += step) {
step = end() - ptr;
if (step > jintSize * 4) step = jintSize * 4;
tty->print(PTR_FORMAT ": ", ptr);
tty->print(INTPTR_FORMAT ": ", p2i(ptr));
while (step > 0) {
tty->print(" " PTR32_FORMAT, *(jint*)ptr);
ptr += jintSize;
@ -1098,7 +1098,7 @@ void CodeStrings::print_block_comment(outputStream* stream, intptr_t offset) con
while (c && c->offset() == offset) {
stream->bol();
stream->print(" ;; ");
stream->print_cr(c->string());
stream->print_cr("%s", c->string());
c = c->next_comment();
}
}
@ -1154,10 +1154,10 @@ void CodeBuffer::decode_all() {
void CodeSection::print(const char* name) {
csize_t locs_size = locs_end() - locs_start();
tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
name, start(), end(), limit(), size(), capacity(),
name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
is_frozen()? " [frozen]": "");
tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d",
name, locs_start(), locs_end(), locs_limit(), locs_size, locs_capacity(), locs_point_off());
name, p2i(locs_start()), p2i(locs_end()), p2i(locs_limit()), locs_size, locs_capacity(), locs_point_off());
if (PrintRelocations) {
RelocIterator iter(this);
iter.print();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -173,7 +173,7 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
bool allocates(address pc) const { return pc >= _start && pc < _limit; }
bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT, _start, pc, _limit)); _end = pc; }
void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit))); _end = pc; }
void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer");
_mark = pc; }
void set_mark_off(int offset) { assert(contains2(offset+_start),"not in codeBuffer");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -118,8 +118,8 @@ inline void assert_different_registers(
) {
assert(
a != b,
err_msg_res("registers must be different: a=%d, b=%d",
a, b)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "",
p2i(a), p2i(b))
);
}
@ -132,8 +132,9 @@ inline void assert_different_registers(
assert(
a != b && a != c
&& b != c,
err_msg_res("registers must be different: a=%d, b=%d, c=%d",
a, b, c)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
", c=" INTPTR_FORMAT "",
p2i(a), p2i(b), p2i(c))
);
}
@ -148,8 +149,9 @@ inline void assert_different_registers(
a != b && a != c && a != d
&& b != c && b != d
&& c != d,
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d",
a, b, c, d)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "",
p2i(a), p2i(b), p2i(c), p2i(d))
);
}
@ -166,8 +168,9 @@ inline void assert_different_registers(
&& b != c && b != d && b != e
&& c != d && c != e
&& d != e,
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d",
a, b, c, d, e)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "",
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e))
);
}
@ -186,8 +189,10 @@ inline void assert_different_registers(
&& c != d && c != e && c != f
&& d != e && d != f
&& e != f,
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d",
a, b, c, d, e, f)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
", f=" INTPTR_FORMAT "",
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f))
);
}
@ -208,8 +213,10 @@ inline void assert_different_registers(
&& d != e && d != f && d != g
&& e != f && e != g
&& f != g,
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d",
a, b, c, d, e, f, g)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "",
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g))
);
}
@ -232,8 +239,10 @@ inline void assert_different_registers(
&& e != f && e != g && e != h
&& f != g && f != h
&& g != h,
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d",
a, b, c, d, e, f, g, h)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "",
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h))
);
}
@ -258,8 +267,11 @@ inline void assert_different_registers(
&& f != g && f != h && f != i
&& g != h && g != i
&& h != i,
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d",
a, b, c, d, e, f, g, h, i)
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
", i=" INTPTR_FORMAT "",
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i))
);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,7 @@ class CFGPrinterOutput : public CHeapObj<mtCompiler> {
void inc_indent();
void dec_indent();
void print(const char* format, ...);
void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
void print_begin(const char* tag);
void print_end(const char* tag);
@ -161,7 +161,7 @@ void CFGPrinterOutput::print_compilation() {
print("name \"%s\"", method_name(_compilation->method(), true));
print("method \"%s\"", method_name(_compilation->method()));
print("date "INT64_FORMAT, os::javaTimeMillis());
print("date "INT64_FORMAT, (int64_t) os::javaTimeMillis());
print_end("compilation");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -134,23 +134,23 @@ void InstructionPrinter::print_object(Value obj) {
if (value->is_null_object()) {
output()->print("null");
} else if (!value->is_loaded()) {
output()->print("<unloaded object " PTR_FORMAT ">", value);
output()->print("<unloaded object " INTPTR_FORMAT ">", p2i(value));
} else {
output()->print("<object " PTR_FORMAT " klass=", value->constant_encoding());
output()->print("<object " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
print_klass(value->klass());
output()->print(">");
}
} else if (type->as_InstanceConstant() != NULL) {
ciInstance* value = type->as_InstanceConstant()->value();
if (value->is_loaded()) {
output()->print("<instance " PTR_FORMAT " klass=", value->constant_encoding());
output()->print("<instance " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
print_klass(value->klass());
output()->print(">");
} else {
output()->print("<unloaded instance " PTR_FORMAT ">", value);
output()->print("<unloaded instance " INTPTR_FORMAT ">", p2i(value));
}
} else if (type->as_ArrayConstant() != NULL) {
output()->print("<array " PTR_FORMAT ">", type->as_ArrayConstant()->value()->constant_encoding());
output()->print("<array " INTPTR_FORMAT ">", p2i(type->as_ArrayConstant()->value()->constant_encoding()));
} else if (type->as_ClassConstant() != NULL) {
ciInstanceKlass* klass = type->as_ClassConstant()->value();
if (!klass->is_loaded()) {
@ -268,7 +268,7 @@ void InstructionPrinter::print_inline_level(BlockBegin* block) {
void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) {
output()->print(name);
output()->print("%s", name);
output()->print(".(");
}
@ -479,7 +479,7 @@ void InstructionPrinter::do_TypeCast(TypeCast* x) {
if (x->declared_type()->is_klass())
print_klass(x->declared_type()->as_klass());
else
output()->print(type2name(x->declared_type()->basic_type()));
output()->print("%s", type2name(x->declared_type()->basic_type()));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1563,15 +1563,15 @@ void LIR_OprDesc::print(outputStream* out) const {
} else if (is_virtual()) {
out->print("R%d", vreg_number());
} else if (is_single_cpu()) {
out->print(as_register()->name());
out->print("%s", as_register()->name());
} else if (is_double_cpu()) {
out->print(as_register_hi()->name());
out->print(as_register_lo()->name());
out->print("%s", as_register_hi()->name());
out->print("%s", as_register_lo()->name());
#if defined(X86)
} else if (is_single_xmm()) {
out->print(as_xmm_float_reg()->name());
out->print("%s", as_xmm_float_reg()->name());
} else if (is_double_xmm()) {
out->print(as_xmm_double_reg()->name());
out->print("%s", as_xmm_double_reg()->name());
} else if (is_single_fpu()) {
out->print("fpu%d", fpu_regnr());
} else if (is_double_fpu()) {
@ -1583,9 +1583,9 @@ void LIR_OprDesc::print(outputStream* out) const {
out->print("d%d", fpu_regnrLo() >> 1);
#else
} else if (is_single_fpu()) {
out->print(as_float_reg()->name());
out->print("%s", as_float_reg()->name());
} else if (is_double_fpu()) {
out->print(as_double_reg()->name());
out->print("%s", as_double_reg()->name());
#endif
} else if (is_illegal()) {
@ -1611,9 +1611,9 @@ void LIR_Const::print_value_on(outputStream* out) const {
case T_LONG: out->print("lng:" JLONG_FORMAT, as_jlong()); break;
case T_FLOAT: out->print("flt:%f", as_jfloat()); break;
case T_DOUBLE: out->print("dbl:%f", as_jdouble()); break;
case T_OBJECT: out->print("obj:0x%x", as_jobject()); break;
case T_METADATA: out->print("metadata:0x%x", as_metadata());break;
default: out->print("%3d:0x%x",type(), as_jdouble()); break;
case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject())); break;
case T_METADATA: out->print("metadata:" INTPTR_FORMAT, p2i(as_metadata()));break;
default: out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break;
}
}
@ -1629,7 +1629,7 @@ void LIR_Address::print_value_on(outputStream* out) const {
case times_8: out->print(" * 8"); break;
}
}
out->print(" Disp: %d", _disp);
out->print(" Disp: " INTX_FORMAT, _disp);
}
// debug output of block header without InstructionPrinter
@ -1703,7 +1703,7 @@ void LIR_Op::print_on(outputStream* out) const {
} else {
out->print(" ");
}
out->print(name()); out->print(" ");
out->print("%s ", name());
print_instr(out);
if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci());
#ifdef ASSERT
@ -1833,7 +1833,7 @@ const char * LIR_Op::name() const {
// LIR_OpJavaCall
void LIR_OpJavaCall::print_instr(outputStream* out) const {
out->print("call: ");
out->print("[addr: 0x%x]", address());
out->print("[addr: " INTPTR_FORMAT "]", p2i(address()));
if (receiver()->is_valid()) {
out->print(" [recv: "); receiver()->print(out); out->print("]");
}
@ -1844,7 +1844,7 @@ void LIR_OpJavaCall::print_instr(outputStream* out) const {
// LIR_OpLabel
void LIR_OpLabel::print_instr(outputStream* out) const {
out->print("[label:0x%x]", _label);
out->print("[label:" INTPTR_FORMAT "]", p2i(_label));
}
// LIR_OpArrayCopy
@ -1911,7 +1911,7 @@ void LIR_Op1::print_instr(outputStream* out) const {
// LIR_Op1
void LIR_OpRTCall::print_instr(outputStream* out) const {
intx a = (intx)addr();
out->print(Runtime1::name_for_address(addr()));
out->print("%s", Runtime1::name_for_address(addr()));
out->print(" ");
tmp()->print(out);
}
@ -1934,10 +1934,10 @@ void LIR_OpBranch::print_instr(outputStream* out) const {
} else if (stub() != NULL) {
out->print("[");
stub()->print_name(out);
out->print(": 0x%x]", stub());
out->print(": " INTPTR_FORMAT "]", p2i(stub()));
if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci());
} else {
out->print("[label:0x%x] ", label());
out->print("[label:" INTPTR_FORMAT "] ", p2i(label()));
}
if (ublock() != NULL) {
out->print("unordered: [B%d] ", ublock()->block_id());
@ -2004,7 +2004,7 @@ void LIR_OpAllocObj::print_instr(outputStream* out) const {
tmp4()->print(out); out->print(" ");
out->print("[hdr:%d]", header_size()); out->print(" ");
out->print("[obj:%d]", object_size()); out->print(" ");
out->print("[lbl:0x%x]", stub()->entry());
out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
}
void LIR_OpRoundFP::print_instr(outputStream* out) const {
@ -2037,7 +2037,7 @@ void LIR_OpAllocArray::print_instr(outputStream* out) const {
tmp3()->print(out); out->print(" ");
tmp4()->print(out); out->print(" ");
out->print("[type:0x%x]", type()); out->print(" ");
out->print("[label:0x%x]", stub()->entry());
out->print("[label:" INTPTR_FORMAT "]", p2i(stub()->entry()));
}
@ -2074,7 +2074,7 @@ void LIR_OpLock::print_instr(outputStream* out) const {
if (_scratch->is_valid()) {
_scratch->print(out); out->print(" ");
}
out->print("[lbl:0x%x]", stub()->entry());
out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
}
#ifdef ASSERT
@ -2082,7 +2082,7 @@ void LIR_OpAssert::print_instr(outputStream* out) const {
print_condition(out, condition()); out->print(" ");
in_opr1()->print(out); out->print(" ");
in_opr2()->print(out); out->print(", \"");
out->print(msg()); out->print("\"");
out->print("%s", msg()); out->print("\"");
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -62,10 +62,10 @@ RangeCheckEliminator::RangeCheckEliminator(IR *ir) :
_optimistic = ir->compilation()->is_optimistic();
TRACE_RANGE_CHECK_ELIMINATION(
tty->print_cr("");
tty->cr();
tty->print_cr("Range check elimination");
ir->method()->print_name(tty);
tty->print_cr("");
tty->cr();
);
TRACE_RANGE_CHECK_ELIMINATION(
@ -1024,7 +1024,7 @@ void RangeCheckEliminator::dump_condition_stack(BlockBegin *block) {
tty->print("i%d", phi->id());
tty->print(": ");
bound->print();
tty->print_cr("");
tty->cr();
);
}
});
@ -1039,7 +1039,7 @@ void RangeCheckEliminator::dump_condition_stack(BlockBegin *block) {
tty->print("i%d", instr->id());
tty->print(": ");
bound->print();
tty->print_cr("");
tty->cr();
);
}
}
@ -1400,7 +1400,7 @@ Value RangeCheckEliminator::Bound::lower_instr() {
// print
void RangeCheckEliminator::Bound::print() {
tty->print("");
tty->print("%s", "");
if (this->_lower_instr || this->_lower != min_jint) {
if (this->_lower_instr) {
tty->print("i%d", this->_lower_instr->id());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -532,8 +532,8 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
if (TraceExceptions) {
ttyLocker ttyl;
ResourceMark rm;
tty->print_cr("Exception <%s> (0x%x) thrown in compiled method <%s> at PC " PTR_FORMAT " for thread 0x%x",
exception->print_value_string(), (address)exception(), nm->method()->print_value_string(), pc, thread);
tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "",
exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
}
// for AbortVMOnException flag
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
@ -563,7 +563,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
ttyLocker ttyl;
ResourceMark rm;
tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT,
thread, continuation, pc);
p2i(thread), p2i(continuation), p2i(pc));
}
return continuation;
@ -988,8 +988,8 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
address copy_buff = stub_location - *byte_skip - *byte_count;
address being_initialized_entry = stub_location - *being_initialized_entry_offset;
if (TracePatching) {
tty->print_cr(" Patching %s at bci %d at address 0x%x (%s)", Bytecodes::name(code), bci,
instr_pc, (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci,
p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc());
assert(caller_code != NULL, "nmethod not found");
@ -1448,7 +1448,7 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* thread))
methodHandle inlinee = methodHandle(vfst.method());
inlinee->print_short_name(&ss1);
m->print_short_name(&ss2);
tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc %x", ss1.as_string(), vfst.bci(), ss2.as_string(), caller_frame.pc());
tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc " INTPTR_FORMAT, ss1.as_string(), vfst.bci(), ss2.as_string(), p2i(caller_frame.pc()));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -175,7 +175,7 @@ class ValueType: public CompilationResourceObj {
ValueType* join(ValueType* y) const;
// debugging
void print(outputStream* s = tty) { s->print(name()); }
void print(outputStream* s = tty) { s->print("%s", name()); }
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1287,10 +1287,10 @@ void BCEscapeAnalyzer::compute_escape_info() {
tty->print_cr("class of method is not initialized.");
else if (_level > MaxBCEAEstimateLevel)
tty->print_cr("level (%d) exceeds MaxBCEAEstimateLevel (%d).",
_level, MaxBCEAEstimateLevel);
_level, (int) MaxBCEAEstimateLevel);
else if (method()->code_size() > MaxBCEAEstimateSize)
tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize.",
method()->code_size(), MaxBCEAEstimateSize);
tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize (%d).",
method()->code_size(), (int) MaxBCEAEstimateSize);
else
ShouldNotReachHere();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -48,7 +48,7 @@ void ciConstant::print() {
tty->print("%d", _value._int);
break;
case T_LONG:
tty->print(INT64_FORMAT, _value._long);
tty->print(INT64_FORMAT, (int64_t)(_value._long));
break;
case T_FLOAT:
tty->print("%f", _value._float);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1250,8 +1250,7 @@ void ciEnv::dump_replay_data(int compile_id) {
if (replay_data_file != NULL) {
fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
dump_replay_data(&replay_data_stream);
tty->print("# Compiler replay data is saved as: ");
tty->print_cr(buffer);
tty->print_cr("# Compiler replay data is saved as: %s", buffer);
} else {
tty->print_cr("# Can't open file to dump replay data.");
}
@ -1274,7 +1273,7 @@ void ciEnv::dump_inline_data(int compile_id) {
)
replay_data_stream.flush();
tty->print("# Compiler inline data is saved as: ");
tty->print_cr(buffer);
tty->print_cr("%s", buffer);
} else {
tty->print_cr("# Can't open file to dump inline data.");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -292,7 +292,7 @@ bool ciInstanceKlass::is_in_package_impl(const char* packagename, int len) {
// Implementation of the print method.
void ciInstanceKlass::print_impl(outputStream* st) {
ciKlass::print_impl(st);
GUARDED_VM_ENTRY(st->print(" loader=0x%x", (address)loader());)
GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));)
if (is_loaded()) {
st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=",
bool_to_str(is_initialized()),
@ -618,7 +618,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
case T_SHORT: _out->print_cr("%d", mirror->short_field(fd->offset())); break;
case T_CHAR: _out->print_cr("%d", mirror->char_field(fd->offset())); break;
case T_INT: _out->print_cr("%d", mirror->int_field(fd->offset())); break;
case T_LONG: _out->print_cr(INT64_FORMAT, mirror->long_field(fd->offset())); break;
case T_LONG: _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break;
case T_FLOAT: {
float f = mirror->float_field(fd->offset());
_out->print_cr("%d", *(int*)&f);
@ -626,7 +626,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
}
case T_DOUBLE: {
double d = mirror->double_field(fd->offset());
_out->print_cr(INT64_FORMAT, *(jlong*)&d);
_out->print_cr(INT64_FORMAT, *(int64_t*)&d);
break;
}
case T_ARRAY: {
@ -656,7 +656,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
_out->print_cr("\"");
} else {
const char* klass_name = value->klass()->name()->as_quoted_ascii();
_out->print_cr(klass_name);
_out->print_cr("%s", klass_name);
}
} else {
ShouldNotReachHere();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,7 @@
void ciMetadata::print(outputStream* st) {
st->print("<%s", type_string());
GUARDED_VM_ENTRY(print_impl(st);)
st->print(" ident=%d address=0x%x>", ident(), (address)this);
st->print(" ident=%d address=" INTPTR_FORMAT ">", ident(), p2i((address)this));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -557,7 +557,7 @@ void ciMethodData::dump_replay_data(outputStream* out) {
if (round == 0) {
count++;
} else {
out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii());
}
}
}
@ -569,7 +569,7 @@ void ciMethodData::dump_replay_data(outputStream* out) {
if (round == 0) {
count++;
} else {
out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii());
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -213,9 +213,9 @@ void ciObject::init_flags_from(oop x) {
void ciObject::print(outputStream* st) {
st->print("<%s", type_string());
GUARDED_VM_ENTRY(print_impl(st);)
st->print(" ident=%d %s address=0x%x>", ident(),
st->print(" ident=%d %s address=" INTPTR_FORMAT ">", ident(),
is_scavengable() ? "SCAVENGABLE" : "",
(address)this);
p2i((address)this));
}
// ------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -148,5 +148,5 @@ void ciSignature::print() {
print_signature();
tty->print(" accessing_klass=");
_accessing_klass->print();
tty->print(" address=0x%x>", (address)this);
tty->print(" address=" INTPTR_FORMAT ">", p2i((address)this));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -87,7 +87,7 @@ void ciType::print_impl(outputStream* st) {
// Print the name of this type
void ciType::print_name_on(outputStream* st) {
ResourceMark rm;
st->print(name());
st->print("%s", name());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,9 @@
// Keep these in a separate file to prevent inlining
PRAGMA_DIAG_PUSH
PRAGMA_FORMAT_NONLITERAL_IGNORED
void ClassFileParser::classfile_parse_error(const char* msg, TRAPS) {
ResourceMark rm(THREAD);
Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_ClassFormatError(),
@ -53,6 +56,8 @@ void ClassFileParser::classfile_parse_error(const char* msg, int index, const ch
msg, index, name, _class_name->as_C_string());
}
PRAGMA_DIAG_POP
void StackMapStream::stackmap_format_error(const char* msg, TRAPS) {
ResourceMark rm(THREAD);
Exceptions::fthrow(

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -312,7 +312,9 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
if (!b) { classfile_parse_error(msg, CHECK); }
}
inline void assert_property(bool b, const char* msg, TRAPS) {
PRAGMA_DIAG_PUSH
PRAGMA_FORMAT_NONLITERAL_IGNORED
inline void assert_property(bool b, const char* msg, TRAPS) {
#ifdef ASSERT
if (!b) {
ResourceMark rm(THREAD);
@ -329,6 +331,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
}
#endif
}
PRAGMA_DIAG_POP
inline void check_property(bool property, const char* msg, int index, TRAPS) {
if (_need_verify) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -343,7 +343,7 @@ static void print_meta_index(LazyClassPathEntry* entry,
tty->print("[Meta index for %s=", entry->name());
for (int i = 0; i < meta_packages.length(); i++) {
if (i > 0) tty->print(" ");
tty->print(meta_packages.at(i));
tty->print("%s", meta_packages.at(i));
}
tty->print_cr("]");
}
@ -1299,7 +1299,7 @@ void ClassLoader::compile_the_world() {
e = e->next();
}
jlong end = os::javaTimeMillis();
tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, %d ms)",
tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, " JLONG_FORMAT " ms)",
_compile_the_world_class_counter, _compile_the_world_method_counter, (end - start));
{
// Print statistics as if before normal exit:

View File

@ -281,10 +281,10 @@ void ClassLoaderData::add_class(Klass* k) {
ResourceMark rm;
tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: "
PTR_FORMAT " loader: " PTR_FORMAT " %s",
k,
p2i(k),
k->external_name(),
k->class_loader_data(),
(void *)k->class_loader(),
p2i(k->class_loader_data()),
p2i((void *)k->class_loader()),
loader_name());
}
}
@ -319,11 +319,11 @@ void ClassLoaderData::unload() {
if (TraceClassLoaderData) {
ResourceMark rm;
tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this);
tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(),
tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this));
tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
loader_name());
if (is_anonymous()) {
tty->print(" for anonymous class "PTR_FORMAT " ", _klasses);
tty->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses));
}
tty->print_cr("]");
}
@ -485,14 +485,14 @@ const char* ClassLoaderData::loader_name() {
void ClassLoaderData::dump(outputStream * const out) {
ResourceMark rm;
out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {",
this, (void *)class_loader(),
class_loader() != NULL ? class_loader()->klass() : NULL, loader_name());
p2i(this), p2i((void *)class_loader()),
p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
if (claimed()) out->print(" claimed ");
if (is_unloading()) out->print(" unloading ");
out->print(" handles " INTPTR_FORMAT, handles());
out->print(" handles " INTPTR_FORMAT, p2i(handles()));
out->cr();
if (metaspace_or_null() != NULL) {
out->print_cr("metaspace: " PTR_FORMAT, metaspace_or_null());
out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
metaspace_or_null()->dump(out);
} else {
out->print_cr("metaspace: NULL");
@ -586,8 +586,8 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA
if (TraceClassLoaderData) {
ResourceMark rm;
tty->print("[ClassLoaderData: ");
tty->print("create class loader data "PTR_FORMAT, cld);
tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(),
tty->print("create class loader data " INTPTR_FORMAT, p2i(cld));
tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
cld->loader_name());
tty->print_cr("]");
}
@ -847,7 +847,7 @@ void ClassLoaderData::print_value_on(outputStream* out) const {
if (class_loader() == NULL) {
out->print("NULL class_loader");
} else {
out->print("class loader "PTR_FORMAT, this);
out->print("class loader " INTPTR_FORMAT, p2i(this));
class_loader()->print_value_on(out);
}
}

View File

@ -436,7 +436,7 @@ class MethodFamily : public ResourceObj {
_exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
if (TraceDefaultMethods) {
_exception_message->print_value_on(tty);
tty->print_cr("");
tty->cr();
}
}
}
@ -463,7 +463,7 @@ class MethodFamily : public ResourceObj {
if (_members.at(i).second == DISQUALIFIED) {
str->print(" (disqualified)");
}
str->print_cr("");
str->cr();
}
if (_selected_target != NULL) {
@ -480,7 +480,7 @@ class MethodFamily : public ResourceObj {
if (!method_holder->is_interface()) {
tty->print(" : in superclass");
}
str->print_cr("");
str->cr();
}
void print_exception(outputStream* str, int indent) {
@ -688,7 +688,7 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
for (int i = 0; i < slots->length(); ++i) {
tty->indent();
slots->at(i)->print_on(tty);
tty->print_cr("");
tty->cr();
}
}
#endif // ndef PRODUCT
@ -828,7 +828,7 @@ void DefaultMethods::generate_default_methods(
streamIndentor si(tty, 2);
tty->indent().print("Looking for default methods for slot ");
slot->print_on(tty);
tty->print_cr("");
tty->cr();
}
#endif // ndef PRODUCT
@ -946,7 +946,7 @@ static void create_defaults_and_exceptions(
if (TraceDefaultMethods) {
tty->print("for slot: ");
slot->print_on(tty);
tty->print_cr("");
tty->cr();
if (method->has_target()) {
method->print_selected(tty, 1);
} else if (method->throws_exception()) {

View File

@ -31,6 +31,7 @@
#include "runtime/orderAccess.inline.hpp"
#include "utilities/hashtable.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
DictionaryEntry* Dictionary::_current_class_entry = NULL;
int Dictionary::_current_class_index = 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -379,7 +379,7 @@ class SymbolPropertyEntry : public HashtableEntry<Symbol*, mtSymbol> {
}
if (method_type() != NULL) {
if (printed) st->print(" and ");
st->print(INTPTR_FORMAT, (void *)method_type());
st->print(INTPTR_FORMAT, p2i((void *)method_type()));
printed = true;
}
st->print_cr(printed ? "" : "(empty)");

View File

@ -51,6 +51,8 @@
#include "runtime/vframe.hpp"
#include "utilities/preserveException.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java) \
klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum);
@ -1490,7 +1492,7 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
while (h_throwable.not_null()) {
objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable())));
if (result.is_null()) {
st->print_cr(no_stack_trace_message());
st->print_cr("%s", no_stack_trace_message());
return;
}

View File

@ -39,6 +39,8 @@
#include "gc_implementation/g1/g1StringDedup.hpp"
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// --------------------------------------------------------------------------
// the number of buckets a thread claims

View File

@ -2269,7 +2269,7 @@ static methodHandle unpack_method_and_appendix(Handle mname,
oop appendix = appendix_box->obj_at(0);
if (TraceMethodHandles) {
#ifndef PRODUCT
tty->print("Linked method="INTPTR_FORMAT": ", m);
tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m));
m->print();
if (appendix != NULL) { tty->print("appendix = "); appendix->print(); }
tty->cr();

View File

@ -364,7 +364,7 @@ void TypeOrigin::print_on(outputStream* str) const {
void ErrorContext::details(outputStream* ss, const Method* method) const {
if (is_valid()) {
ss->print_cr("");
ss->cr();
ss->print_cr("Exception Details:");
location_details(ss, method);
reason_details(ss);
@ -379,7 +379,7 @@ void ErrorContext::reason_details(outputStream* ss) const {
streamIndentor si(ss);
ss->indent().print_cr("Reason:");
streamIndentor si2(ss);
ss->indent().print("");
ss->indent().print("%s", "");
switch (_fault) {
case INVALID_BYTECODE:
ss->print("Error exists in the bytecode");
@ -432,7 +432,7 @@ void ErrorContext::reason_details(outputStream* ss) const {
ShouldNotReachHere();
ss->print_cr("Unknown");
}
ss->print_cr("");
ss->cr();
}
void ErrorContext::location_details(outputStream* ss, const Method* method) const {
@ -507,7 +507,7 @@ void ErrorContext::stackmap_details(outputStream* ss, const Method* method) cons
for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
ss->indent();
sm_frame->print_on(ss, current_offset);
ss->print_cr("");
ss->cr();
current_offset += sm_frame->offset_delta();
sm_frame = sm_frame->next();
}
@ -579,7 +579,8 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
tty->print_cr("Verifying method %s", m->name_and_sig_as_C_string());
}
const char* bad_type_msg = "Bad type on operand stack in %s";
// For clang, the only good constant format string is a literal constant format string.
#define bad_type_msg "Bad type on operand stack in %s"
int32_t max_stack = m->verifier_max_stack();
int32_t max_locals = m->max_locals();
@ -1676,6 +1677,8 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
}
}
#undef bad_type_message
char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) {
char* code_data = NEW_RESOURCE_ARRAY(char, code_length);
memset(code_data, 0, sizeof(char) * code_length);
@ -2363,8 +2366,8 @@ void ClassVerifier::verify_invoke_instructions(
if (opcode == Bytecodes::_invokedynamic) {
if (_klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
class_format_error(
"invokedynamic instructions not supported by this class file version",
_klass->external_name());
"invokedynamic instructions not supported by this class file version (%d), class %s",
_klass->major_version(), _klass->external_name());
return;
}
} else {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -375,15 +375,15 @@ class ClassVerifier : public StackObj {
bool has_error() const { return result() != NULL; }
char* exception_message() {
stringStream ss;
ss.print(_message);
ss.print("%s", _message);
_error_context.details(&ss, _method());
return ss.as_string();
}
// Called when verify or class format errors are encountered.
// May throw an exception based upon the mode.
void verify_error(ErrorContext ctx, const char* fmt, ...);
void class_format_error(const char* fmt, ...);
void verify_error(ErrorContext ctx, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);
void class_format_error(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3);
Klass* load_class(Symbol* name, TRAPS);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -533,7 +533,7 @@ void vmIntrinsics::verify_method(ID actual_id, Method* m) {
xtty->begin_elem("intrinsic_misdeclared actual='%s' declared='%s'",
actual_name, declared_name);
xtty->method(mh);
xtty->end_elem("");
xtty->end_elem("%s", "");
}
if (PrintMiscellaneous && (WizardMode || Verbose)) {
tty->print_cr("*** misidentified method; %s(%d) should be %s(%d):",

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -530,7 +530,7 @@ void CodeBlob::verify() {
}
void CodeBlob::print_on(outputStream* st) const {
st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", p2i(this));
st->print_cr("Framesize: %d", _frame_size);
}
@ -548,7 +548,7 @@ void BufferBlob::print_on(outputStream* st) const {
}
void BufferBlob::print_value_on(outputStream* st) const {
st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", this, name());
st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", p2i(this), name());
}
void RuntimeStub::verify() {
@ -558,13 +558,13 @@ void RuntimeStub::verify() {
void RuntimeStub::print_on(outputStream* st) const {
ttyLocker ttyl;
CodeBlob::print_on(st);
st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
st->print_cr(name());
st->print("Runtime Stub (" INTPTR_FORMAT "): ", p2i(this));
st->print_cr("%s", name());
Disassembler::decode((CodeBlob*)this, st);
}
void RuntimeStub::print_value_on(outputStream* st) const {
st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name());
st->print("RuntimeStub (" INTPTR_FORMAT "): ", p2i(this)); st->print("%s", name());
}
void SingletonBlob::verify() {
@ -574,12 +574,12 @@ void SingletonBlob::verify() {
void SingletonBlob::print_on(outputStream* st) const {
ttyLocker ttyl;
CodeBlob::print_on(st);
st->print_cr(name());
st->print_cr("%s", name());
Disassembler::decode((CodeBlob*)this, st);
}
void SingletonBlob::print_value_on(outputStream* st) const {
st->print_cr(name());
st->print_cr("%s", name());
}
void DeoptimizationBlob::print_value_on(outputStream* st) const {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -81,10 +81,10 @@ class CodeBlob_sizes {
bool is_empty() { return count == 0; }
void print(const char* title) {
tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, data %d%%, pcs %d%%])",
tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, metadata %d%%, data %d%%, pcs %d%%])",
count,
title,
total() / K,
(int)(total() / K),
header_size * 100 / total_size,
relocation_size * 100 / total_size,
code_size * 100 / total_size,
@ -191,7 +191,7 @@ CodeBlob* CodeCache::allocate(int size, bool is_critical) {
}
if (PrintCodeCacheExtension) {
ResourceMark rm;
tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)",
tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
(intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(),
(address)_heap->high() - (address)_heap->low_boundary());
}
@ -487,7 +487,7 @@ void CodeCache::gc_epilogue() {
if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) {
CompiledIC *ic = CompiledIC_at(iter.reloc());
if (TraceCompiledIC) {
tty->print("noticed icholder " INTPTR_FORMAT " ", ic->cached_icholder());
tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
ic->print();
}
assert(ic->cached_icholder() != NULL, "must be non-NULL");
@ -741,10 +741,10 @@ void CodeCache::print_memory_overhead() {
}
// Print bytes that are allocated in the freelist
ttyLocker ttl;
tty->print_cr("Number of elements in freelist: %d", freelist_length());
tty->print_cr("Allocated in freelist: %dkB", bytes_allocated_in_freelist()/K);
tty->print_cr("Unused bytes in CodeBlobs: %dkB", (int)(wasted_bytes/K));
tty->print_cr("Segment map size: %dkB", allocated_segments()/K); // 1 byte per segment
tty->print_cr("Number of elements in freelist: " SSIZE_FORMAT, freelist_length());
tty->print_cr("Allocated in freelist: " SSIZE_FORMAT "kB", bytes_allocated_in_freelist()/K);
tty->print_cr("Unused bytes in CodeBlobs: " SSIZE_FORMAT "kB", (wasted_bytes/K));
tty->print_cr("Segment map size: " SSIZE_FORMAT "kB", allocated_segments()/K); // 1 byte per segment
}
//------------------------------------------------------------------------------------------------
@ -756,7 +756,7 @@ void CodeCache::print_trace(const char* event, CodeBlob* cb, int size) {
if (PrintCodeCache2) { // Need to add a new flag
ResourceMark rm;
if (size == 0) size = cb->size();
tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, cb, size);
tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, p2i(cb), size);
}
}
@ -926,9 +926,9 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
if (detailed) {
st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
_heap->low_boundary(),
_heap->high(),
_heap->high_boundary());
p2i(_heap->low_boundary()),
p2i(_heap->high()),
p2i(_heap->high_boundary()));
st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
" adapters=" UINT32_FORMAT,
nof_blobs(), nof_nmethods(), nof_adapters());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -88,9 +88,9 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub
if (TraceCompiledIC) {
tty->print(" ");
print_compiled_ic();
tty->print(" changing destination to " INTPTR_FORMAT, entry_point);
tty->print(" changing destination to " INTPTR_FORMAT, p2i(entry_point));
if (!is_optimized()) {
tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", (address)cache);
tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", p2i((address)cache));
}
if (is_icstub) {
tty->print(" (icstub)");
@ -195,7 +195,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
if (TraceICs) {
ResourceMark rm;
tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
instruction_address(), call_info->selected_method()->print_value_string(), entry);
p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
}
// We can't check this anymore. With lazy deopt we could have already
@ -272,7 +272,7 @@ bool CompiledIC::is_call_to_interpreted() const {
void CompiledIC::set_to_clean() {
assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call");
if (TraceInlineCacheClearing || TraceICs) {
tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", instruction_address());
tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address()));
print();
}
@ -354,7 +354,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
if (TraceICs) {
ResourceMark rm(thread);
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s",
instruction_address(),
p2i(instruction_address()),
method->print_value_string());
}
} else {
@ -362,7 +362,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry());
if (TraceICs) {
ResourceMark rm(thread);
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", instruction_address());
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address()));
}
}
} else {
@ -392,7 +392,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
ResourceMark rm(thread);
assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s",
instruction_address(),
p2i(instruction_address()),
((Klass*)info.cached_metadata())->print_value_string(),
(safe) ? "" : "via stub");
}
@ -530,8 +530,8 @@ void CompiledStaticCall::set(const StaticCallInfo& info) {
if (TraceICs) {
ResourceMark rm;
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT,
instruction_address(),
info.entry());
p2i(instruction_address()),
p2i(info.entry()));
}
// Call to compiled code
assert (CodeCache::contains(info.entry()), "wrong entry point");
@ -600,11 +600,11 @@ void CompiledIC::print() {
void CompiledIC::print_compiled_ic() {
tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT,
instruction_address(), is_call_to_interpreted() ? "interpreted " : "", ic_destination(), is_optimized() ? NULL : cached_value());
p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value()));
}
void CompiledStaticCall::print() {
tty->print("static call at " INTPTR_FORMAT " -> ", instruction_address());
tty->print("static call at " INTPTR_FORMAT " -> ", p2i(instruction_address()));
if (is_clean()) {
tty->print("clean");
} else if (is_call_to_compiled()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -212,6 +212,8 @@ static jlong stretch(jint x, int bits) {
return h ^ l;
}
PRAGMA_DIAG_PUSH
PRAGMA_FORMAT_IGNORED // Someone needs to deal with this.
void test_compressed_stream(int trace) {
CompressedWriteStream bytes(stretch_limit * 100);
jint n;
@ -275,6 +277,7 @@ void test_compressed_stream(int trace) {
guarantee(length == length2, "bad length");
guarantee(fails == 0, "test failures");
}
PRAGMA_DIAG_POP
#if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64)
#pragma warning(default: 4748)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,9 @@
#include "code/nmethod.hpp"
#include "runtime/handles.inline.hpp"
// Comstructors
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Constructors
DebugInfoWriteStream::DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size)
: CompressedWriteStream(initial_size) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,8 @@
#include "code/nmethod.hpp"
#include "memory/allocation.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) {
_nesting.check();
if (_length >= _size) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,6 +39,7 @@
#include "runtime/mutexLocker.hpp"
#include "runtime/stubRoutines.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
DEF_STUB_INTERFACE(ICStub);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -48,6 +48,8 @@
#include "shark/sharkCompiler.hpp"
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifdef DTRACE_ENABLED
// Only bother with this argument setup if dtrace is available

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,8 @@
#include "code/scopeDesc.hpp"
#include "memory/resourceArea.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) {
_pc_offset = pc_offset;
_scope_decode_offset = scope_decode_offset;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,7 @@
#include "runtime/stubCodeGenerator.hpp"
#include "utilities/copy.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
const RelocationHolder RelocationHolder::none; // its type is relocInfo::none

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,6 +30,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) {
_code = code;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,6 +39,8 @@
#include "opto/matcher.hpp"
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// -----------------------------------------------------------------------------------------
// Implementation of VtableStub

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -172,7 +172,7 @@ class CompilationLog : public StringEventLog {
void log_nmethod(JavaThread* thread, nmethod* nm) {
log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]",
nm->compile_id(), nm->is_osr_method() ? "%" : "",
nm, nm->code_begin(), nm->code_end());
p2i(nm), p2i(nm->code_begin()), p2i(nm->code_end()));
}
void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) {
@ -1786,7 +1786,7 @@ void CompileBroker::init_compiler_thread_log() {
if (xtty != NULL) {
ttyLocker ttyl;
// Record any per thread log files
xtty->elem("thread_logfile thread='%d' filename='%s'", thread_id, file_name);
xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name);
}
return;
}
@ -1817,7 +1817,7 @@ void CompileBroker::maybe_block() {
if (_should_block) {
#ifndef PRODUCT
if (PrintCompilation && (Verbose || WizardMode))
tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", Thread::current());
tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", p2i(Thread::current()));
#endif
ThreadInVMfromNative tivfn(JavaThread::current());
}
@ -1834,7 +1834,7 @@ static void codecache_print(bool detailed)
CodeCache::print_summary(&s, detailed);
}
ttyLocker ttyl;
tty->print(s.as_string());
tty->print("%s", s.as_string());
}
// ------------------------------------------------------------------
@ -2039,7 +2039,7 @@ void CompileBroker::handle_full_code_cache() {
// Lock to prevent tearing
ttyLocker ttyl;
xtty->begin_elem("code_cache_full");
xtty->print(s.as_string());
xtty->print("%s", s.as_string());
xtty->stamp();
xtty->end_elem();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -174,9 +174,9 @@ void CompileLog::name(ciSymbol* name) {
void CompileLog::name(ciKlass* k) {
print(" name='");
if (!k->is_loaded()) {
text()->print(k->name()->as_klass_external_name());
text()->print("%s", k->name()->as_klass_external_name());
} else {
text()->print(k->external_name());
text()->print("%s", k->external_name());
}
print("'");
}
@ -303,7 +303,7 @@ void CompileLog::finish_log(outputStream* file) {
// Print about successful method inlining.
void CompileLog::inline_success(const char* reason) {
begin_elem("inline_success reason='");
text(reason);
text("%s", reason);
end_elem("'");
}
@ -313,7 +313,7 @@ void CompileLog::inline_success(const char* reason) {
// Print about failed method inlining.
void CompileLog::inline_fail(const char* reason) {
begin_elem("inline_fail reason='");
text(reason);
text("%s", reason);
end_elem("'");
}
@ -339,5 +339,5 @@ void CompileLog::set_context(const char* format, ...) {
void CompileLog::code_cache_state() {
begin_elem("code_cache");
CodeCache::log_state(this);
end_elem("");
end_elem("%s", "");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,7 +55,7 @@ class CompileLog : public xmlStream {
static CompileLog* _first; // head of static chain
void va_tag(bool push, const char* format, va_list ap);
void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
public:
CompileLog(const char* file_name, FILE* fp, intx thread_id);
@ -69,7 +69,7 @@ class CompileLog : public xmlStream {
// or reset, context string will be silently ignored
stringStream* context() { return &_context; }
void clear_context() { context()->reset(); }
void set_context(const char* format, ...);
void set_context(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
void name(ciSymbol* s); // name='s'
void name(Symbol* s) { xmlStream::name(s); }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -520,7 +520,7 @@ void CompilerOracle::parse_from_line(char* line) {
tty->print_cr("CompilerOracle: unrecognized line");
tty->print_cr(" \"%s\"", original_line);
if (error_msg != NULL) {
tty->print_cr(error_msg);
tty->print_cr("%s", error_msg);
}
}
}
@ -642,7 +642,7 @@ void CompilerOracle::parse_compile_only(char * line) {
char method_sep = have_colon ? ':' : '.';
if (Verbose) {
tty->print_cr(line);
tty->print_cr("%s", line);
}
ResourceMark rm;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -51,6 +51,8 @@
#include "shark/sharkEntry.hpp"
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void* Disassembler::_library = NULL;
bool Disassembler::_tried_to_load_library = false;
@ -411,6 +413,7 @@ static void* event_to_env(void* env_pv, const char* event, void* arg) {
return env->handle_event(event, (address) arg);
}
ATTRIBUTE_PRINTF(2, 3)
static int printf_to_env(void* env_pv, const char* format, ...) {
decode_env* env = (decode_env*) env_pv;
outputStream* st = env->output();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,6 +32,8 @@
#include "memory/allocation.inline.hpp"
#include "utilities/bitMap.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// The MethodLiveness class performs a simple liveness analysis on a method
// in order to decide which locals are live (that is, will be used again) at
// a particular bytecode index (bci).

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -633,8 +633,8 @@ void DerivedPointerTable::add(oop *derived_loc, oop *base_loc) {
tty->print_cr(
"Add derived pointer@" INTPTR_FORMAT
" - Derived: " INTPTR_FORMAT
" Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: %d)",
derived_loc, (address)*derived_loc, (address)*base_loc, base_loc, offset
" Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: " INTX_FORMAT ")",
p2i(derived_loc), p2i((address)*derived_loc), p2i((address)*base_loc), p2i(base_loc), offset
);
}
// Set derived oop location to point to base.
@ -661,8 +661,8 @@ void DerivedPointerTable::update_pointers() {
if (TraceDerivedPointers) {
tty->print_cr("Updating derived pointer@" INTPTR_FORMAT
" - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: %d)",
derived_loc, (address)*derived_loc, (address)base, offset);
" - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: " INTX_FORMAT ")",
p2i(derived_loc), p2i((address)*derived_loc), p2i((address)base), offset);
}
// Delete entry

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -157,7 +157,7 @@ void AdaptiveFreeList<Chunk>::verify_stats() const {
" split_deaths(" SIZE_FORMAT ")"
" coal_deaths(" SIZE_FORMAT ")"
" + count(" SSIZE_FORMAT ")",
this, size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
p2i(this), size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
_allocation_stats.coal_births(), _allocation_stats.split_deaths(),
_allocation_stats.coal_deaths(), count()));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -428,7 +428,7 @@ size_t CompactibleFreeListSpace::max_alloc_in_words() const {
void LinearAllocBlock::print_on(outputStream* st) const {
st->print_cr(" LinearAllocBlock: ptr = " PTR_FORMAT ", word_size = " SIZE_FORMAT
", refillsize = " SIZE_FORMAT ", allocation_size_limit = " SIZE_FORMAT,
_ptr, _word_size, _refillSize, _allocation_size_limit);
p2i(_ptr), _word_size, _refillSize, _allocation_size_limit);
}
void CompactibleFreeListSpace::print_on(outputStream* st) const {
@ -459,7 +459,7 @@ const {
for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL;
fc = fc->next()) {
gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s",
fc, (HeapWord*)fc + i,
p2i(fc), p2i((HeapWord*)fc + i),
fc->cantCoalesce() ? "\t CC" : "");
}
}
@ -503,7 +503,7 @@ size_t BlkPrintingClosure::do_blk(HeapWord* addr) {
if (_sp->block_is_obj(addr)) {
const bool dead = _post_remark && !_live_bit_map->isMarked(addr);
_st->print_cr(PTR_FORMAT ": %s object of size " SIZE_FORMAT "%s",
addr,
p2i(addr),
dead ? "dead" : "live",
sz,
(!dead && CMSPrintObjectsInDump) ? ":" : ".");
@ -513,7 +513,7 @@ size_t BlkPrintingClosure::do_blk(HeapWord* addr) {
}
} else { // free block
_st->print_cr(PTR_FORMAT ": free block of size " SIZE_FORMAT "%s",
addr, sz, CMSPrintChunksInDump ? ":" : ".");
p2i(addr), sz, CMSPrintChunksInDump ? ":" : ".");
if (CMSPrintChunksInDump) {
((FreeChunk*)addr)->print_on(_st);
_st->print_cr("--------------------------------------");
@ -1983,7 +1983,7 @@ void CompactibleFreeListSpace::save_marks() {
assert(ur.contains(urasm),
err_msg(" Error at save_marks(): [" PTR_FORMAT "," PTR_FORMAT ")"
" should contain [" PTR_FORMAT "," PTR_FORMAT ")",
ur.start(), ur.end(), urasm.start(), urasm.end()));
p2i(ur.start()), p2i(ur.end()), p2i(urasm.start()), p2i(urasm.end())));
#endif
// inform allocator that promotions should be tracked.
assert(_promoInfo.noPromotions(), "_promoInfo inconsistency");
@ -2206,7 +2206,7 @@ void CompactibleFreeListSpace::endSweepFLCensus(size_t sweep_count) {
if (PrintFLSStatistics > 0) {
HeapWord* largestAddr = (HeapWord*) dictionary()->find_largest_dict();
gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT,
largestAddr);
p2i(largestAddr));
}
setFLSurplus();
setFLHints();
@ -2355,8 +2355,8 @@ class VerifyAllBlksClosure: public BlkClosure {
gclog_or_tty->print_cr(
" Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n"
" Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n",
addr, res, was_obj ?"true":"false", was_live ?"true":"false",
_last_addr, _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false");
p2i(addr), res, was_obj ?"true":"false", was_live ?"true":"false",
p2i(_last_addr), _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false");
_sp->print_on(gclog_or_tty);
guarantee(false, "Seppuku!");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -403,7 +403,7 @@ class CompactibleFreeListSpace: public CompactibleSpace {
if (CMSTraceSweeper) {
gclog_or_tty->print_cr(">>>>> Saving sweep limit " PTR_FORMAT
" for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<",
_sweep_limit, bottom(), end());
p2i(_sweep_limit), p2i(bottom()), p2i(end()));
}
}
NOT_PRODUCT(

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -64,6 +64,8 @@
#include "services/memoryService.hpp"
#include "services/runtimeService.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// statics
CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
bool CMSCollector::_full_gc_requested = false;
@ -1182,7 +1184,7 @@ void CMSCollector::icms_update_allocation_limits()
gclog_or_tty->print(" icms alloc limits: "
PTR_FORMAT "," PTR_FORMAT
" (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ",
_icms_start_limit, _icms_stop_limit,
p2i(_icms_start_limit), p2i(_icms_stop_limit),
percent_of_space(eden, _icms_start_limit),
percent_of_space(eden, _icms_stop_limit));
if (Verbose) {
@ -1210,7 +1212,7 @@ CMSCollector::allocation_limit_reached(Space* space, HeapWord* top,
gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT
", new limit=" PTR_FORMAT
" (" SIZE_FORMAT "%%)",
top, _icms_stop_limit,
p2i(top), p2i(_icms_stop_limit),
percent_of_space(space, _icms_stop_limit));
}
ConcurrentMarkSweepThread::start_icms();
@ -1227,7 +1229,7 @@ CMSCollector::allocation_limit_reached(Space* space, HeapWord* top,
gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT
", new limit=" PTR_FORMAT
" (" SIZE_FORMAT "%%)",
top, space->end(),
p2i(top), p2i(space->end()),
percent_of_space(space, space->end()));
}
ConcurrentMarkSweepThread::stop_icms();
@ -1502,7 +1504,7 @@ bool CMSCollector::shouldConcurrentCollect() {
if (PrintCMSInitiationStatistics && stats().valid()) {
gclog_or_tty->print("CMSCollector shouldConcurrentCollect: ");
gclog_or_tty->stamp();
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
stats().print_on(gclog_or_tty);
gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f",
stats().time_until_cms_gen_full());
@ -3588,7 +3590,7 @@ CMSPhaseAccounting::~CMSPhaseAccounting() {
_collector->cmsGen()->short_name(),
_phase, _collector->timerValue(), _wallclock.seconds());
if (_print_cr) {
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
}
if (PrintCMSStatistics != 0) {
gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -111,7 +111,7 @@ void ConcurrentMarkSweepThread::run() {
// From this time Thread::current() should be working.
assert(this == Thread::current(), "just checking");
if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
warning("Couldn't bind CMS thread to processor %u", CPUForCMSThread);
warning("Couldn't bind CMS thread to processor " UINTX_FORMAT, CPUForCMSThread);
}
// Wait until Universe::is_fully_initialized()
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -239,7 +239,7 @@ inline void ConcurrentMarkSweepThread::trace_state(const char* desc) {
jio_snprintf(buf, sizeof(buf), " [%.3f: CMSThread %s] ",
ts.seconds(), desc);
buf[sizeof(buf) - 1] = '\0';
gclog_or_tty->print(buf);
gclog_or_tty->print("%s", buf);
}
}
@ -271,7 +271,7 @@ class CMSLoopCountWarn: public StackObj {
inline void tick() {
_ticks++;
if (CMSLoopWarn && _ticks % _threshold == 0) {
warning("%s has looped %d times %s", _src, _ticks, _msg);
warning("%s has looped " INTX_FORMAT " times %s", _src, _ticks, _msg);
}
}
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,8 @@
#include "memory/freeBlockDictionary.hpp"
#include "utilities/copy.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifndef PRODUCT
#define baadbabeHeapWord badHeapWordVal

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,8 @@
#include "oops/markOop.inline.hpp"
#include "oops/oop.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
/////////////////////////////////////////////////////////////////////////
//// PromotionInfo
/////////////////////////////////////////////////////////////////////////

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,6 +34,7 @@
#include "runtime/os.hpp"
#include "utilities/dtrace.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
//////////////////////////////////////////////////////////
// Methods in abstract class VM_CMS_Operation

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -537,7 +537,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
if (verbose_low()) {
gclog_or_tty->print_cr("[global] init, heap start = "PTR_FORMAT", "
"heap end = "PTR_FORMAT, _heap_start, _heap_end);
"heap end = " PTR_FORMAT, p2i(_heap_start), p2i(_heap_end));
}
if (!_markBitMap1.allocate(heap_rs)) {
@ -651,7 +651,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
"must be between " UINTX_FORMAT " and " UINTX_FORMAT,
mark_stack_size, 1, MarkStackSizeMax);
mark_stack_size, (uintx) 1, MarkStackSizeMax);
return;
}
FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
@ -662,7 +662,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
"must be between " UINTX_FORMAT " and " UINTX_FORMAT,
MarkStackSize, 1, MarkStackSizeMax);
MarkStackSize, (uintx) 1, MarkStackSizeMax);
return;
}
} else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
@ -821,7 +821,7 @@ void ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurren
assert(!concurrent_marking_in_progress(), "invariant");
assert(_finger == _heap_end,
err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT,
_finger, _heap_end));
p2i(_finger), p2i(_heap_end)));
update_g1_committed(true);
}
}
@ -1424,7 +1424,7 @@ public:
assert(start <= hr->end() && start <= ntams && ntams <= hr->end(),
err_msg("Preconditions not met - "
"start: "PTR_FORMAT", ntams: "PTR_FORMAT", end: "PTR_FORMAT,
start, ntams, hr->end()));
p2i(start), p2i(ntams), p2i(hr->end())));
// Find the first marked object at or after "start".
start = _bm->getNextMarkedWordAddress(start, ntams);
@ -1609,7 +1609,7 @@ public:
if (failures > 0 && _verbose) {
gclog_or_tty->print_cr("Region " HR_FORMAT ", ntams: " PTR_FORMAT ", "
"marked_bytes: calc/actual " SIZE_FORMAT "/" SIZE_FORMAT,
HR_FORMAT_PARAMS(hr), hr->next_top_at_mark_start(),
HR_FORMAT_PARAMS(hr), p2i(hr->next_top_at_mark_start()),
_calc_cl.region_marked_bytes(), hr->next_marked_bytes());
}
@ -2241,7 +2241,7 @@ class G1CMKeepAliveAndDrainClosure: public OopClosure {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("\t[%u] we're looking at location "
"*"PTR_FORMAT" = "PTR_FORMAT,
_task->worker_id(), p, (void*) obj);
_task->worker_id(), p2i(p), p2i((void*) obj));
}
_task->deal_with_reference(obj);
@ -2675,7 +2675,7 @@ public:
}
_out->print_cr(" "PTR_FORMAT": "PTR_FORMAT"%s%s",
p, (void*) obj, str, str2);
p2i(p), p2i((void*) obj), str, str2);
}
};
@ -2702,7 +2702,7 @@ public:
if (print_it) {
_out->print_cr(" "PTR_FORMAT"%s",
(void *)o, (over_tams) ? " >" : (marked) ? " M" : "");
p2i((void *)o), (over_tams) ? " >" : (marked) ? " M" : "");
PrintReachableOopClosure oopCl(_out, _vo, _all);
o->oop_iterate_no_header(&oopCl);
}
@ -2723,14 +2723,14 @@ public:
HeapWord* t = hr->top();
HeapWord* p = _g1h->top_at_mark_start(hr, _vo);
_out->print_cr("** ["PTR_FORMAT", "PTR_FORMAT"] top: "PTR_FORMAT" "
"TAMS: "PTR_FORMAT, b, e, t, p);
"TAMS: " PTR_FORMAT, p2i(b), p2i(e), p2i(t), p2i(p));
_out->cr();
HeapWord* from = b;
HeapWord* to = t;
if (to > from) {
_out->print_cr("Objects in ["PTR_FORMAT", "PTR_FORMAT"]", from, to);
_out->print_cr("Objects in [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(from), p2i(to));
_out->cr();
PrintReachableObjectClosure ocl(_out, _vo, _all, hr);
hr->object_iterate_mem_careful(MemRegion(from, to), &ocl);
@ -2846,7 +2846,7 @@ ConcurrentMark::claim_region(uint worker_id) {
gclog_or_tty->print_cr("[%u] curr_region = "PTR_FORMAT" "
"["PTR_FORMAT", "PTR_FORMAT"), "
"limit = "PTR_FORMAT,
worker_id, curr_region, bottom, end, limit);
worker_id, p2i(curr_region), p2i(bottom), p2i(end), p2i(limit));
}
// Is the gap between reading the finger and doing the CAS too long?
@ -2860,13 +2860,13 @@ ConcurrentMark::claim_region(uint worker_id) {
if (verbose_low()) {
gclog_or_tty->print_cr("[%u] we were successful with region = "
PTR_FORMAT, worker_id, curr_region);
PTR_FORMAT, worker_id, p2i(curr_region));
}
if (limit > bottom) {
if (verbose_low()) {
gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is not empty, "
"returning it ", worker_id, curr_region);
"returning it ", worker_id, p2i(curr_region));
}
return curr_region;
} else {
@ -2874,7 +2874,7 @@ ConcurrentMark::claim_region(uint worker_id) {
"the region limit should be at bottom");
if (verbose_low()) {
gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is empty, "
"returning NULL", worker_id, curr_region);
"returning NULL", worker_id, p2i(curr_region));
}
// we return NULL and the caller should try calling
// claim_region() again.
@ -2886,7 +2886,7 @@ ConcurrentMark::claim_region(uint worker_id) {
gclog_or_tty->print_cr("[%u] somebody else moved the finger, "
"global finger = "PTR_FORMAT", "
"our finger = "PTR_FORMAT,
worker_id, _finger, finger);
worker_id, p2i(_finger), p2i(finger));
}
// read it again
@ -2925,7 +2925,7 @@ private:
void do_object_work(oop obj) {
guarantee(!_g1h->obj_in_cs(obj),
err_msg("obj: "PTR_FORMAT" in CSet, phase: %s, info: %d",
(void*) obj, phase_str(), _info));
p2i((void*) obj), phase_str(), _info));
}
public:
@ -3004,7 +3004,7 @@ void ConcurrentMark::verify_no_cset_oops(bool verify_stacks,
HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
guarantee(global_finger == global_hr->bottom(),
err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT,
global_finger, HR_FORMAT_PARAMS(global_hr)));
p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
}
// Verify the task fingers
@ -3018,7 +3018,7 @@ void ConcurrentMark::verify_no_cset_oops(bool verify_stacks,
guarantee(task_finger == task_hr->bottom() ||
!task_hr->in_collection_set(),
err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT,
task_finger, HR_FORMAT_PARAMS(task_hr)));
p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
}
}
}
@ -3062,7 +3062,7 @@ class AggregateCountDataHRClosure: public HeapRegionClosure {
err_msg("Preconditions not met - "
"start: "PTR_FORMAT", limit: "PTR_FORMAT", "
"top: "PTR_FORMAT", end: "PTR_FORMAT,
start, limit, hr->top(), hr->end()));
p2i(start), p2i(limit), p2i(hr->top()), p2i(hr->end())));
assert(hr->next_marked_bytes() == 0, "Precondition");
@ -3303,7 +3303,7 @@ void ConcurrentMark::print_worker_threads_on(outputStream* st) const {
void ConcurrentMark::print_on_error(outputStream* st) const {
st->print_cr("Marking Bits (Prev, Next): (CMBitMap*) " PTR_FORMAT ", (CMBitMap*) " PTR_FORMAT,
_prevMarkBitMap, _nextMarkBitMap);
p2i(_prevMarkBitMap), p2i(_nextMarkBitMap));
_prevMarkBitMap->print_on_error(st, " Prev Bits: ");
_nextMarkBitMap->print_on_error(st, " Next Bits: ");
}
@ -3336,11 +3336,11 @@ bool ConcurrentMark::containing_cards_are_marked(void* start,
// for debugging purposes
void ConcurrentMark::print_finger() {
gclog_or_tty->print_cr("heap ["PTR_FORMAT", "PTR_FORMAT"), global finger = "PTR_FORMAT,
_heap_start, _heap_end, _finger);
p2i(_heap_start), p2i(_heap_end), p2i(_finger));
for (uint i = 0; i < _max_worker_id; ++i) {
gclog_or_tty->print(" %u: "PTR_FORMAT, i, _tasks[i]->finger());
gclog_or_tty->print(" %u: " PTR_FORMAT, i, p2i(_tasks[i]->finger()));
}
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
}
#endif
@ -3349,7 +3349,7 @@ void CMTask::scan_object(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] we're scanning object "PTR_FORMAT,
_worker_id, (void*) obj);
_worker_id, p2i((void*) obj));
}
size_t obj_size = obj->size();
@ -3428,7 +3428,7 @@ void CMTask::setup_for_region(HeapRegion* hr) {
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] setting up for region "PTR_FORMAT,
_worker_id, hr);
_worker_id, p2i(hr));
}
_curr_region = hr;
@ -3445,7 +3445,7 @@ void CMTask::update_region_limit() {
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] found an empty region "
"["PTR_FORMAT", "PTR_FORMAT")",
_worker_id, bottom, limit);
_worker_id, p2i(bottom), p2i(limit));
}
// The region was collected underneath our feet.
// We set the finger to bottom to ensure that the bitmap
@ -3477,7 +3477,7 @@ void CMTask::giveup_current_region() {
assert(_curr_region != NULL, "invariant");
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] giving up region "PTR_FORMAT,
_worker_id, _curr_region);
_worker_id, p2i(_curr_region));
}
clear_region_fields();
}
@ -3768,7 +3768,7 @@ void CMTask::drain_local_queue(bool partially) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] popped "PTR_FORMAT, _worker_id,
(void*) obj);
p2i((void*) obj));
}
assert(_g1h->is_in_g1_reserved((HeapWord*) obj), "invariant" );
@ -4153,7 +4153,7 @@ void CMTask::do_marking_step(double time_target_ms,
gclog_or_tty->print_cr("[%u] we're scanning part "
"["PTR_FORMAT", "PTR_FORMAT") "
"of region "HR_FORMAT,
_worker_id, _finger, _region_limit,
_worker_id, p2i(_finger), p2i(_region_limit),
HR_FORMAT_PARAMS(_curr_region));
}
@ -4240,7 +4240,7 @@ void CMTask::do_marking_step(double time_target_ms,
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] we successfully claimed "
"region "PTR_FORMAT,
_worker_id, claimed_region);
_worker_id, p2i(claimed_region));
}
setup_for_region(claimed_region);
@ -4301,7 +4301,7 @@ void CMTask::do_marking_step(double time_target_ms,
if (_cm->try_stealing(_worker_id, &_hash_seed, obj)) {
if (_cm->verbose_medium()) {
gclog_or_tty->print_cr("[%u] stolen "PTR_FORMAT" successfully",
_worker_id, (void*) obj);
_worker_id, p2i((void*) obj));
}
statsOnly( ++_steals );
@ -4549,8 +4549,8 @@ G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name)
G1PPRL_SUM_ADDR_FORMAT("committed")
G1PPRL_SUM_ADDR_FORMAT("reserved")
G1PPRL_SUM_BYTE_FORMAT("region-size"),
g1_committed.start(), g1_committed.end(),
g1_reserved.start(), g1_reserved.end(),
p2i(g1_committed.start()), p2i(g1_committed.end()),
p2i(g1_reserved.start()), p2i(g1_reserved.end()),
HeapRegion::GrainBytes);
_out->print_cr(G1PPRL_LINE_PREFIX);
_out->print_cr(G1PPRL_LINE_PREFIX
@ -4667,7 +4667,7 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
G1PPRL_DOUBLE_FORMAT
G1PPRL_BYTE_FORMAT
G1PPRL_BYTE_FORMAT,
type, bottom, end,
type, p2i(bottom), p2i(end),
used_bytes, prev_live_bytes, next_live_bytes, gc_eff,
remset_bytes, strong_code_roots_bytes);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -277,7 +277,7 @@ inline void CMTask::push(oop obj) {
assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] pushing "PTR_FORMAT, _worker_id, (void*) obj);
gclog_or_tty->print_cr("[%u] pushing " PTR_FORMAT, _worker_id, p2i((void*) obj));
}
if (!_task_queue->push(obj)) {
@ -317,7 +317,7 @@ inline void CMTask::push(oop obj) {
inline void CMTask::deal_with_reference(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
_worker_id, (void*) obj);
_worker_id, p2i((void*) obj));
}
++_refs_reached;
@ -334,7 +334,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (!hr->obj_allocated_since_next_marking(obj)) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
_worker_id, (void*) obj);
_worker_id, p2i((void*) obj));
}
// we need to mark it first
@ -349,7 +349,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (_finger != NULL && objAddr < _finger) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
"pushing it", _worker_id, _finger);
"pushing it", _worker_id, p2i(_finger));
}
push(obj);
} else if (_curr_region != NULL && objAddr < _region_limit) {
@ -367,7 +367,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] below the global finger "
"("PTR_FORMAT"), pushing it",
_worker_id, global_finger);
_worker_id, p2i(global_finger));
}
push(obj);
} else {
@ -382,7 +382,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] below the global finger "
"("PTR_FORMAT"), pushing it",
_worker_id, global_finger);
_worker_id, p2i(global_finger));
}
push(obj);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -143,7 +143,7 @@ HeapWord* G1AllocRegion::new_alloc_region_and_allocate(size_t word_size,
void G1AllocRegion::fill_in_ext_msg(ar_ext_msg* msg, const char* message) {
msg->append("[%s] %s c: %u b: %s r: "PTR_FORMAT" u: "SIZE_FORMAT,
_name, message, _count, BOOL_TO_STR(_bot_updates),
_alloc_region, _used_bytes_before);
p2i(_alloc_region), _used_bytes_before);
}
void G1AllocRegion::init() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -184,7 +184,7 @@ public:
class ar_ext_msg : public err_msg {
public:
ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("") {
ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("%s", "") {
alloc_region->fill_in_ext_msg(this, message);
}
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -65,7 +65,7 @@ public:
REGION_SIZE_IN_WORDS * HeapWordSize);
// Check address calculation (bounds)
assert(array.bottom_address_mapped() == fake_heap,
err_msg("bottom mapped address should be "PTR_FORMAT", but is "PTR_FORMAT, fake_heap, array.bottom_address_mapped()));
err_msg("bottom mapped address should be " PTR_FORMAT ", but is " PTR_FORMAT, p2i(fake_heap), p2i(array.bottom_address_mapped())));
assert(array.end_address_mapped() == (fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS), "must be");
int* bottom = array.address_mapped_to(fake_heap);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,7 +55,7 @@ protected:
void initialize_base(address base, size_t length, size_t bias, size_t elem_size, uint shift_by) {
assert(base != NULL, "just checking");
assert(length > 0, "just checking");
assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %zd, larger than word size?", shift_by));
assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %u, larger than word size?", shift_by));
_base = base;
_length = length;
_biased_base = base - (bias * elem_size);
@ -71,10 +71,10 @@ protected:
err_msg("mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes));
assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0,
err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
mapping_granularity_in_bytes, bottom));
mapping_granularity_in_bytes, p2i(bottom)));
assert((uintptr_t)end % mapping_granularity_in_bytes == 0,
err_msg("end mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
mapping_granularity_in_bytes, end));
mapping_granularity_in_bytes, p2i(end)));
size_t num_target_elems = pointer_delta(end, bottom, mapping_granularity_in_bytes);
idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,8 @@
#include "runtime/java.hpp"
#include "services/memTracker.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
//////////////////////////////////////////////////////////////////////
// G1BlockOffsetSharedArray
//////////////////////////////////////////////////////////////////////

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -80,7 +80,7 @@ public:
virtual void set_bottom(HeapWord* new_bottom) {
assert(new_bottom <= _end,
err_msg("new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")",
new_bottom, _end));
p2i(new_bottom), p2i(_end)));
_bottom = new_bottom;
resize(pointer_delta(_end, _bottom));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,7 @@ inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const {
assert(pc >= (char*)_reserved.start() &&
pc < (char*)_reserved.end(),
err_msg("p (" PTR_FORMAT ") not in reserved [" PTR_FORMAT ", " PTR_FORMAT ")",
p, (char*)_reserved.start(), (char*)_reserved.end()));
p2i(p), p2i(_reserved.start()), p2i(_reserved.end())));
size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char));
size_t result = delta >> LogN;
check_index(result, "bad index from address");
@ -65,7 +65,7 @@ G1BlockOffsetSharedArray::address_for_index(size_t index) const {
err_msg("bad address from index result " PTR_FORMAT
" _reserved.start() " PTR_FORMAT " _reserved.end() "
PTR_FORMAT,
result, _reserved.start(), _reserved.end()));
p2i(result), p2i(_reserved.start()), p2i(_reserved.end())));
return result;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,8 @@
#include "services/memTracker.hpp"
#include "utilities/copy.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
if (has_count_table()) {
assert(from_card_num >= 0 && from_card_num < _committed_max_card_num,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -77,10 +77,10 @@ class G1CardCounts: public CHeapObj<mtGC> {
err_msg("Invalid card pointer: "
"card_ptr: " PTR_FORMAT ", "
"_ct_bot: " PTR_FORMAT,
card_ptr, _ct_bot));
p2i(card_ptr), p2i(_ct_bot)));
size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte));
assert(card_num >= 0 && card_num < _committed_max_card_num,
err_msg("card pointer out of range: " PTR_FORMAT, card_ptr));
err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr)));
return card_num;
}

View File

@ -28,6 +28,8 @@
#include "gc_implementation/g1/g1CodeCacheRemSet.hpp"
#include "memory/iterator.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
G1CodeRootChunk::G1CodeRootChunk() : _top(NULL), _next(NULL), _prev(NULL) {
_top = bottom();
}

View File

@ -22,6 +22,11 @@
*
*/
#if !defined(__clang_major__) && defined(__GNUC__)
// FIXME, formats have issues. Disable this macro definition, compile, and study warnings for more information.
#define ATTRIBUTE_PRINTF(x,y)
#endif
#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
@ -370,7 +375,7 @@ void YoungList::print() {
}
}
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
}
void G1CollectedHeap::push_dirty_cards_region(HeapRegion* hr)
@ -3470,7 +3475,7 @@ void G1CollectedHeap::verify(bool silent, VerifyOption vo) {
// help us track down what went wrong. This is why we call
// print_extended_on() instead of print_on().
print_extended_on(gclog_or_tty);
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
#ifndef PRODUCT
if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) {
concurrent_mark()->print_reachable("at-verification-failure",
@ -3664,7 +3669,7 @@ public:
PrintRSetsClosure(const char* msg) : _msg(msg), _occupied_sum(0) {
gclog_or_tty->cr();
gclog_or_tty->print_cr("========================================");
gclog_or_tty->print_cr(msg);
gclog_or_tty->print_cr("%s", msg);
gclog_or_tty->cr();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,7 @@ G1CollectedHeap::heap_region_containing_raw(const T addr) const {
assert(addr != NULL, "invariant");
assert(_g1_reserved.contains((const void*) addr),
err_msg("Address "PTR_FORMAT" is outside of the heap ranging from ["PTR_FORMAT" to "PTR_FORMAT")",
(void*)addr, _g1_reserved.start(), _g1_reserved.end()));
p2i((void*)addr), p2i(_g1_reserved.start()), p2i(_g1_reserved.end())));
return _hrs.addr_to_region((HeapWord*) addr);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,11 @@
*
*/
#ifndef __clang_major__
// FIXME, formats have issues. Disable this macro definition, compile, and study warnings for more information.
#define ATTRIBUTE_PRINTF(x,y)
#endif
#include "precompiled.hpp"
#include "gc_implementation/g1/concurrentG1Refine.hpp"
#include "gc_implementation/g1/concurrentMark.hpp"
@ -965,7 +970,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
#ifndef PRODUCT
if (G1YoungSurvRateVerbose) {
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
_short_lived_surv_rate_group->print();
// do that for any other surv rate groups too
}
@ -2222,11 +2227,11 @@ void TraceGen0TimeData::print() const {
gclog_or_tty->print_cr("ALL PAUSES");
print_summary_sd(" Total", &_total);
gclog_or_tty->print_cr("");
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
gclog_or_tty->cr();
gclog_or_tty->print_cr(" Young GC Pauses: %8d", _young_pause_num);
gclog_or_tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num);
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
gclog_or_tty->print_cr("EVACUATION PAUSES");
@ -2246,7 +2251,7 @@ void TraceGen0TimeData::print() const {
print_summary(" Clear CT", &_clear_ct);
print_summary(" Other", &_other);
}
gclog_or_tty->print_cr("");
gclog_or_tty->cr();
gclog_or_tty->print_cr("MISC");
print_summary_sd(" Stop World", &_all_stop_world_times_ms);

View File

@ -39,7 +39,7 @@ private:
int _indent_level;
int _cur;
void vappend(const char* format, va_list ap) {
void vappend(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0) {
int res = vsnprintf(&_buffer[_cur], BUFFER_LEN - _cur, format, ap);
if (res != -1) {
_cur += res;
@ -63,14 +63,14 @@ public:
}
#endif
void append(const char* format, ...) {
void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
va_list ap;
va_start(ap, format);
vappend(format, ap);
va_end(ap);
}
void append_and_print_cr(const char* format, ...) {
void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
va_list ap;
va_start(ap, format);
vappend(format, ap);
@ -80,6 +80,8 @@ public:
}
};
PRAGMA_DIAG_PUSH
PRAGMA_FORMAT_NONLITERAL_IGNORED
template <class T>
void WorkerDataArray<T>::print(int level, const char* title) {
if (_length == 1) {
@ -109,7 +111,7 @@ void WorkerDataArray<T>::print(int level, const char* title) {
}
if (G1Log::finest()) {
buf.append_and_print_cr("");
buf.append_and_print_cr("%s", "");
}
double avg = (double)sum / (double)_length;
@ -129,6 +131,7 @@ void WorkerDataArray<T>::print(int level, const char* title) {
}
buf.append_and_print_cr("]");
}
PRAGMA_DIAG_POP
#ifndef PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,8 @@
#include "gc_implementation/g1/heapRegion.hpp"
#include "utilities/ostream.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
const char* G1HRPrinter::action_name(ActionType action) {
switch(action) {
case Alloc: return "ALLOC";

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -114,7 +114,7 @@ inline void G1CMOopClosure::do_oop_nv(T* p) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] we're looking at location "
"*"PTR_FORMAT" = "PTR_FORMAT,
_task->worker_id(), p, (void*) obj);
_task->worker_id(), p2i(p), p2i((void*) obj));
}
_task->deal_with_reference(obj);
}

Some files were not shown because too many files have changed in this diff Show More