Mercurial > hg > openjdk > jdk7u > hotspot
changeset 5813:2a2721def4a0
8197510: fastdebug builds fail due to lack of p2i
8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas
Summary: Backport p2i/intptr and string format changes from 8037816. Also include pragma push/pop handling.
Reviewed-by: aph
line wrap: on
line diff
--- a/make/linux/makefiles/gcc.make Thu Feb 08 00:59:32 2018 +0000 +++ b/make/linux/makefiles/gcc.make Mon Feb 12 19:50:02 2018 +0000 @@ -149,10 +149,6 @@ else ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare endif -# Only GCC 4.6 and later have the GCC diagnostic push/pop pragmas -ifneq "$(shell expr \( $(CC_VER_MAJOR) \<= 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \< 6 \) \))" "0" -ACCEPTABLE_WARNINGS += -Wno-pragmas -endif CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) # Special cases
--- a/src/cpu/x86/vm/assembler_x86.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/cpu/x86/vm/assembler_x86.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -538,11 +538,11 @@ // 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;
--- a/src/os/aix/vm/os_aix.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/os/aix/vm/os_aix.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1495,11 +1495,11 @@ st->print("uname:"); struct utsname name; uname(&name); - st->print(name.sysname); st->print(" "); - st->print(name.nodename); 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.nodename); + st->print("%s ", name.release); + st->print("%s ", name.version); + st->print("%s", name.machine); st->cr(); // rlimit
--- a/src/os/bsd/vm/decoder_machO.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/os/bsd/vm/decoder_machO.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -53,7 +53,7 @@ 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) */
--- a/src/os/bsd/vm/perfMemory_bsd.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/os/bsd/vm/perfMemory_bsd.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -1133,7 +1133,7 @@ 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)); } }
--- a/src/os/linux/vm/os_linux.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/os/linux/vm/os_linux.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -2197,7 +2197,7 @@ // 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); @@ -2232,8 +2232,8 @@ 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"); } @@ -3454,7 +3454,7 @@ // 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; } @@ -3472,7 +3472,7 @@ 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; } @@ -3492,7 +3492,7 @@ 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); } }
--- a/src/os/linux/vm/os_linux.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/os/linux/vm/os_linux.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -135,7 +135,7 @@ // readdir_r has been deprecated since glibc 2.24. // See https://sourceware.org/bugzilla/show_bug.cgi?id=19056 for more details. -#pragma GCC diagnostic push +PRAGMA_DIAG_PUSH #pragma GCC diagnostic ignored "-Wdeprecated-declarations" inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) { @@ -155,7 +155,7 @@ return p; } -#pragma GCC diagnostic pop +PRAGMA_DIAG_POP inline int os::closedir(DIR *dirp) { assert(dirp != NULL, "argument is NULL");
--- a/src/os/linux/vm/perfMemory_linux.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/os/linux/vm/perfMemory_linux.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1142,7 +1142,7 @@ 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)); } }
--- a/src/os/posix/vm/os_posix.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/os/posix/vm/os_posix.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -195,10 +195,10 @@ 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(); } @@ -503,7 +503,7 @@ 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 @@ -563,7 +563,7 @@ 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_...():
--- a/src/share/vm/asm/codeBuffer.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/asm/codeBuffer.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -902,7 +902,7 @@ 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; @@ -1012,7 +1012,7 @@ while (c && c->offset() == offset) { stream->bol(); stream->print(" ;; "); - stream->print_cr(c->string()); + stream->print_cr("%s", c->string()); c = c->next_comment(); } } @@ -1068,10 +1068,10 @@ 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();
--- a/src/share/vm/asm/codeBuffer.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/asm/codeBuffer.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -178,7 +178,7 @@ 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");
--- a/src/share/vm/asm/register.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/asm/register.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, 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 @@ -103,8 +103,8 @@ ) { 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)) ); } @@ -117,8 +117,9 @@ 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)) ); } @@ -133,8 +134,9 @@ 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)) ); } @@ -151,8 +153,9 @@ && 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)) ); } @@ -171,8 +174,10 @@ && 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)) ); } @@ -193,8 +198,10 @@ && 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)) ); } @@ -217,8 +224,10 @@ && 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)) ); } @@ -243,8 +252,11 @@ && 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)) ); }
--- a/src/share/vm/c1/c1_InstructionPrinter.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/c1/c1_InstructionPrinter.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -132,26 +132,26 @@ 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 if (value->is_method()) { ciMethod* m = (ciMethod*)value; output()->print("<method %s.%s>", m->holder()->name()->as_utf8(), m->name()->as_utf8()); } 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()) { @@ -261,7 +261,7 @@ void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) { - output()->print(name); + output()->print("%s", name); output()->print(".("); }
--- a/src/share/vm/c1/c1_LIR.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/c1/c1_LIR.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -1504,15 +1504,15 @@ } 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()) { @@ -1524,9 +1524,9 @@ 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()) { @@ -1552,8 +1552,8 @@ 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; - default: out->print("%3d:0x%x",type(), as_jdouble()); break; + case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject())); break; + default: out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break; } } @@ -1569,7 +1569,7 @@ 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 @@ -1643,7 +1643,7 @@ } 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 @@ -1765,7 +1765,7 @@ // 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("]"); } @@ -1776,7 +1776,7 @@ // 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 @@ -1836,7 +1836,7 @@ // 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); } @@ -1859,10 +1859,10 @@ } 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()); @@ -1929,7 +1929,7 @@ 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 { @@ -1962,7 +1962,7 @@ 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())); } @@ -1999,7 +1999,7 @@ if (_scratch->is_valid()) { _scratch->print(out); out->print(" "); } - out->print("[lbl:0x%x]", stub()->entry()); + out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry())); }
--- a/src/share/vm/c1/c1_Runtime1.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/c1/c1_Runtime1.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -531,8 +531,8 @@ 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 @@ 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; @@ -944,8 +944,8 @@ 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");
--- a/src/share/vm/ci/ciInstanceKlass.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/ci/ciInstanceKlass.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -262,7 +262,7 @@ // 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()),
--- a/src/share/vm/ci/ciObject.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/ci/ciObject.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -228,10 +228,10 @@ void ciObject::print(outputStream* st) { st->print("<%s", type_string()); GUARDED_VM_ENTRY(print_impl(st);) - st->print(" ident=%d %s%s address=0x%x>", ident(), + st->print(" ident=%d %s%s address=" INTPTR_FORMAT ">", ident(), is_perm() ? "PERM" : "", is_scavengable() ? "SCAVENGABLE" : "", - (address)this); + p2i((address)this)); } // ------------------------------------------------------------------
--- a/src/share/vm/ci/ciSignature.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/ci/ciSignature.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ print_signature(); tty->print(" accessing_klass="); _accessing_klass->print(); - tty->print(" address=0x%x>", (address)this); + tty->print(" address=" INTPTR_FORMAT ">", p2i((address)this)); }
--- a/src/share/vm/ci/ciType.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/ci/ciType.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, 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 @@ -91,7 +91,7 @@ // Print the name of this type void ciType::print_name_on(outputStream* st) { ResourceMark rm; - st->print(name()); + st->print("%s", name()); }
--- a/src/share/vm/classfile/classLoader.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/classfile/classLoader.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ 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("]"); }
--- a/src/share/vm/classfile/dictionary.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/classfile/dictionary.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, 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 @@ -268,7 +268,7 @@ } if (property_data() != NULL) { if (printed) st->print(" and "); - st->print(INTPTR_FORMAT, property_data()); + st->print(INTPTR_FORMAT, p2i(property_data())); printed = true; } st->print_cr(printed ? "" : "(empty)");
--- a/src/share/vm/classfile/javaClasses.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/classfile/javaClasses.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1271,7 +1271,7 @@ 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; }
--- a/src/share/vm/classfile/systemDictionary.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/classfile/systemDictionary.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -2294,7 +2294,7 @@ 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();
--- a/src/share/vm/classfile/vmSymbols.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/classfile/vmSymbols.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -533,7 +533,7 @@ 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):",
--- a/src/share/vm/code/codeBlob.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/code/codeBlob.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -523,7 +523,7 @@ } 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); } @@ -541,7 +541,7 @@ } 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() { @@ -551,13 +551,13 @@ 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() { @@ -567,12 +567,12 @@ 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 {
--- a/src/share/vm/code/codeCache.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/code/codeCache.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -79,7 +79,7 @@ tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %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, @@ -183,7 +183,7 @@ } 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->begin(), (intptr_t)_heap->end(), (address)_heap->end() - (address)_heap->begin()); } @@ -807,7 +807,7 @@ 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); } }
--- a/src/share/vm/code/compiledIC.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/code/compiledIC.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -56,7 +56,7 @@ if (TraceCompiledIC) { tty->print(" "); print_compiled_ic(); - tty->print_cr(" changing oop to " INTPTR_FORMAT, (address)cache); + tty->print_cr(" changing oop to " INTPTR_FORMAT, p2i((address)cache)); } if (cache == NULL) cache = (oop)Universe::non_oop_word(); @@ -162,7 +162,7 @@ if (TraceICs) { ResourceMark rm; tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT, - instruction_address(), method->print_value_string(), entry); + p2i(instruction_address()), method->print_value_string(), p2i(entry)); } // We can't check this anymore. With lazy deopt we could have already @@ -246,7 +246,7 @@ 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(); } @@ -325,7 +325,7 @@ 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 { @@ -335,7 +335,7 @@ if (TraceICs) { ResourceMark rm(thread); - tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via mkh", instruction_address()); + tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via mkh", p2i(instruction_address())); } } } else { @@ -362,7 +362,7 @@ ResourceMark rm(thread); assert(info.cached_oop() == NULL || info.cached_oop()()->is_klass(), "must be"); tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s", - instruction_address(), + p2i(instruction_address()), ((klassOop)info.cached_oop()())->print_value_string(), (safe) ? "" : "via stub"); } @@ -520,7 +520,7 @@ 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()); } @@ -555,8 +555,8 @@ 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"); @@ -640,12 +640,12 @@ void CompiledIC::print_compiled_ic() { tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT, - instruction_address(), is_call_to_interpreted() ? "interpreted " : "", ic_destination()); + p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", ic_destination()); } 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()) {
--- a/src/share/vm/compiler/compileBroker.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/compiler/compileBroker.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -209,7 +209,7 @@ 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) { @@ -1644,7 +1644,7 @@ ttyLocker ttyl; // Record any per thread log files - xtty->elem("thread_logfile thread='%d' filename='%s'", thread_id, file); + xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file); } } } @@ -1672,7 +1672,7 @@ 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()); } @@ -1870,7 +1870,7 @@ // 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(); }
--- a/src/share/vm/compiler/compileLog.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/compiler/compileLog.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, 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 @@ -304,7 +304,7 @@ // Print about successful method inlining. void CompileLog::inline_success(const char* reason) { begin_elem("inline_success reason='"); - text(reason); + text("%s", reason); end_elem("'"); } @@ -314,7 +314,7 @@ // Print about failed method inlining. void CompileLog::inline_fail(const char* reason) { begin_elem("inline_fail reason='"); - text(reason); + text("%s", reason); end_elem("'"); } @@ -340,5 +340,5 @@ void CompileLog::code_cache_state() { begin_elem("code_cache"); CodeCache::log_state(this); - end_elem(""); + end_elem("%s", ""); }
--- a/src/share/vm/compiler/compilerOracle.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/compiler/compilerOracle.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, 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 @@ -546,7 +546,7 @@ 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); } } } @@ -668,7 +668,7 @@ char method_sep = have_colon ? ':' : '.'; if (Verbose) { - tty->print_cr(line); + tty->print_cr("%s", line); } ResourceMark rm;
--- a/src/share/vm/compiler/oopMap.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/compiler/oopMap.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -646,8 +646,8 @@ 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. @@ -674,8 +674,8 @@ 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
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -429,7 +429,7 @@ 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 { @@ -460,7 +460,7 @@ 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" : ""); } } @@ -504,7 +504,7 @@ 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) ? ":" : "."); @@ -514,7 +514,7 @@ } } 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("--------------------------------------"); @@ -2025,7 +2025,7 @@ 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"); @@ -2254,7 +2254,7 @@ 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(); @@ -2403,8 +2403,8 @@ 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!"); }
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -418,7 +418,7 @@ 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(
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -1190,7 +1190,7 @@ 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) { @@ -1218,7 +1218,7 @@ 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(); @@ -1235,7 +1235,7 @@ 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(); @@ -1513,7 +1513,7 @@ 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()); @@ -3555,7 +3555,7 @@ _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,
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -111,7 +111,7 @@ // 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() {
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, 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 @@ -249,7 +249,7 @@ 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); } } @@ -281,7 +281,7 @@ 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); } } };
--- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -466,7 +466,7 @@ 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)); } _markStack.allocate(MarkStackSize); @@ -696,7 +696,7 @@ 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); } } @@ -1297,7 +1297,7 @@ 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); @@ -1482,7 +1482,7 @@ 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()); } @@ -2111,7 +2111,7 @@ if (_cm->verbose_high()) { gclog_or_tty->print_cr("\t[%d] we're looking at location " "*"PTR_FORMAT" = "PTR_FORMAT, - _task->task_id(), p, (void*) obj); + _task->task_id(), p2i(p), p2i((void*) obj)); } _task->deal_with_reference(obj); @@ -2554,7 +2554,7 @@ } _out->print_cr(" "PTR_FORMAT": "PTR_FORMAT"%s%s", - p, (void*) obj, str, str2); + p2i(p), p2i((void*) obj), str, str2); } }; @@ -2581,7 +2581,7 @@ if (print_it) { _out->print_cr(" "PTR_FORMAT"%s", - o, (over_tams) ? " >" : (marked) ? " M" : ""); + p2i(o), (over_tams) ? " >" : (marked) ? " M" : ""); PrintReachableOopClosure oopCl(_out, _vo, _all); o->oop_iterate(&oopCl); } @@ -2602,14 +2602,14 @@ 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); @@ -2725,7 +2725,7 @@ gclog_or_tty->print_cr("[%d] curr_region = "PTR_FORMAT" " "["PTR_FORMAT", "PTR_FORMAT"), " "limit = "PTR_FORMAT, - task_num, curr_region, bottom, end, limit); + task_num, p2i(curr_region), p2i(bottom), p2i(end), p2i(limit)); } // Is the gap between reading the finger and doing the CAS too long? @@ -2739,13 +2739,13 @@ if (verbose_low()) { gclog_or_tty->print_cr("[%d] we were successful with region = " - PTR_FORMAT, task_num, curr_region); + PTR_FORMAT, task_num, p2i(curr_region)); } if (limit > bottom) { if (verbose_low()) { gclog_or_tty->print_cr("[%d] region "PTR_FORMAT" is not empty, " - "returning it ", task_num, curr_region); + "returning it ", task_num, p2i(curr_region)); } return curr_region; } else { @@ -2753,7 +2753,7 @@ "the region limit should be at bottom"); if (verbose_low()) { gclog_or_tty->print_cr("[%d] region "PTR_FORMAT" is empty, " - "returning NULL", task_num, curr_region); + "returning NULL", task_num, p2i(curr_region)); } // we return NULL and the caller should try calling // claim_region() again. @@ -2765,7 +2765,7 @@ gclog_or_tty->print_cr("[%d] somebody else moved the finger, " "global finger = "PTR_FORMAT", " "our finger = "PTR_FORMAT, - task_num, _finger, finger); + task_num, p2i(_finger), p2i(finger)); } // read it again @@ -2804,7 +2804,7 @@ 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: @@ -2883,7 +2883,7 @@ 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 @@ -2897,7 +2897,7 @@ 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))); } } } @@ -2941,7 +2941,7 @@ 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"); @@ -3207,11 +3207,11 @@ // 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 (int i = 0; i < (int) _max_task_num; ++i) { - gclog_or_tty->print(" %d: "PTR_FORMAT, i, _tasks[i]->finger()); + gclog_or_tty->print(" %d: " PTR_FORMAT, i, p2i(_tasks[i]->finger())); } - gclog_or_tty->print_cr(""); + gclog_or_tty->cr(); } #endif @@ -3220,7 +3220,7 @@ if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] we're scanning object "PTR_FORMAT, - _task_id, (void*) obj); + _task_id, p2i((void*) obj)); } size_t obj_size = obj->size(); @@ -3300,7 +3300,7 @@ if (_cm->verbose_low()) { gclog_or_tty->print_cr("[%d] setting up for region "PTR_FORMAT, - _task_id, hr); + _task_id, p2i(hr)); } _curr_region = hr; @@ -3317,7 +3317,7 @@ if (_cm->verbose_low()) { gclog_or_tty->print_cr("[%d] found an empty region " "["PTR_FORMAT", "PTR_FORMAT")", - _task_id, bottom, limit); + _task_id, p2i(bottom), p2i(limit)); } // The region was collected underneath our feet. // We set the finger to bottom to ensure that the bitmap @@ -3349,7 +3349,7 @@ assert(_curr_region != NULL, "invariant"); if (_cm->verbose_low()) { gclog_or_tty->print_cr("[%d] giving up region "PTR_FORMAT, - _task_id, _curr_region); + _task_id, p2i(_curr_region)); } clear_region_fields(); } @@ -3640,7 +3640,7 @@ if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] popped "PTR_FORMAT, _task_id, - (void*) obj); + p2i((void*) obj)); } assert(_g1h->is_in_g1_reserved((HeapWord*) obj), "invariant" ); @@ -4025,7 +4025,8 @@ gclog_or_tty->print_cr("[%d] we're scanning part " "["PTR_FORMAT", "PTR_FORMAT") " "of region "PTR_FORMAT, - _task_id, _finger, _region_limit, _curr_region); + _task_id, p2i(_finger), p2i(_region_limit), + _curr_region); } // Let's iterate over the bitmap of the part of the @@ -4091,7 +4092,7 @@ if (_cm->verbose_low()) { gclog_or_tty->print_cr("[%d] we successfully claimed " "region "PTR_FORMAT, - _task_id, claimed_region); + _task_id, p2i(claimed_region)); } setup_for_region(claimed_region); @@ -4152,7 +4153,7 @@ if (_cm->try_stealing(_task_id, &_hash_seed, obj)) { if (_cm->verbose_medium()) { gclog_or_tty->print_cr("[%d] stolen "PTR_FORMAT" successfully", - _task_id, (void*) obj); + _task_id, p2i((void*) obj)); } statsOnly( ++_steals ); @@ -4400,8 +4401,8 @@ 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 @@ -4518,7 +4519,7 @@ 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);
--- a/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -279,7 +279,7 @@ assert(_nextMarkBitMap->isMarked(objAddr), "invariant"); if (_cm->verbose_high()) { - gclog_or_tty->print_cr("[%d] pushing "PTR_FORMAT, _task_id, (void*) obj); + gclog_or_tty->print_cr("[%d] pushing "PTR_FORMAT, _task_id, p2i((void*) obj)); } if (!_task_queue->push(obj)) { @@ -319,7 +319,7 @@ inline void CMTask::deal_with_reference(oop obj) { if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] we're dealing with reference = "PTR_FORMAT, - _task_id, (void*) obj); + _task_id, p2i((void*) obj)); } ++_refs_reached; @@ -336,7 +336,7 @@ if (!hr->obj_allocated_since_next_marking(obj)) { if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] "PTR_FORMAT" is not considered marked", - _task_id, (void*) obj); + _task_id, p2i((void*) obj)); } // we need to mark it first @@ -351,7 +351,7 @@ if (_finger != NULL && objAddr < _finger) { if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] below the local finger ("PTR_FORMAT"), " - "pushing it", _task_id, _finger); + "pushing it", _task_id, p2i(_finger)); } push(obj); } else if (_curr_region != NULL && objAddr < _region_limit) { @@ -369,7 +369,7 @@ if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] below the global finger " "("PTR_FORMAT"), pushing it", - _task_id, global_finger); + _task_id, p2i(global_finger)); } push(obj); } else { @@ -384,7 +384,7 @@ if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] below the global finger " "("PTR_FORMAT"), pushing it", - _task_id, global_finger); + _task_id, p2i(global_finger)); } push(obj); }
--- a/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -142,7 +142,7 @@ 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() {
--- a/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -188,7 +188,7 @@ 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); } };
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ 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)); }
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ 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");
--- a/src/share/vm/gc_implementation/g1/g1CardCounts.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/g1CardCounts.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -78,13 +78,13 @@ size_t ptr_2_card_num(const jbyte* card_ptr) { assert(card_ptr >= _ct_bot, - err_msg("Inavalied card pointer: " + 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)); check_card_num(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; }
--- a/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ if (_cm->verbose_high()) { gclog_or_tty->print_cr("[%d] we're looking at location " "*"PTR_FORMAT" = "PTR_FORMAT, - _task->task_id(), p, (void*) obj); + _task->task_id(), p2i(p), p2i((void*) obj)); } _task->deal_with_reference(obj); }
--- a/src/share/vm/gc_implementation/g1/heapRegion.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -60,7 +60,7 @@ (_hr_)->startsHumongous() ? "HS" : \ (_hr_)->continuesHumongous() ? "HC" : \ !(_hr_)->is_empty() ? "O" : "F", \ - (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end() + p2i((_hr_)->bottom()), p2i((_hr_)->top()), p2i((_hr_)->end()) // sentinel value for hrs_index #define G1_NULL_HRS_INDEX ((uint) -1) @@ -550,7 +550,7 @@ (containing_set != NULL && _containing_set == NULL), err_msg("containing_set: "PTR_FORMAT" " "_containing_set: "PTR_FORMAT, - containing_set, _containing_set)); + p2i(containing_set), p2i(_containing_set))); _containing_set = containing_set; }
--- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1264,7 +1264,7 @@ while (cur_evnt < _n_recorded_events && i == cur_evnt_ind) { gclog_or_tty->print("Event: "); print_event(gclog_or_tty, cur_evnt_kind); - gclog_or_tty->print_cr(""); + gclog_or_tty->cr(); cur_evnt++; if (cur_evnt < MaxRecordedEvents) { cur_evnt_kind = _recorded_events[cur_evnt];
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -260,7 +260,7 @@ guarantee(hr != NULL, err_msg("invariant: i: %u", i)); guarantee(hr->bottom() == prev_end, err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT, - i, HR_FORMAT_PARAMS(hr), prev_end)); + i, HR_FORMAT_PARAMS(hr), p2i(prev_end))); guarantee(hr->hrs_index() == i, err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index())); if (i < _length) {
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -31,7 +31,7 @@ inline uintx HeapRegionSeq::addr_to_index_biased(HeapWord* addr) const { assert(_heap_bottom <= addr && addr < _heap_end, err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT" end: "PTR_FORMAT, - addr, _heap_bottom, _heap_end)); + p2i(addr), p2i(_heap_bottom), p2i(_heap_end))); uintx index = (uintx) addr >> _region_shift; return index; } @@ -39,7 +39,7 @@ inline HeapRegion* HeapRegionSeq::addr_to_region_unsafe(HeapWord* addr) const { assert(_heap_bottom <= addr && addr < _heap_end, err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT" end: "PTR_FORMAT, - addr, _heap_bottom, _heap_end)); + p2i(addr), p2i(_heap_bottom), p2i(_heap_end))); uintx index_biased = addr_to_index_biased(addr); HeapRegion* hr = _regions_biased[index_biased]; assert(hr != NULL, "invariant"); @@ -49,7 +49,7 @@ inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const { if (addr != NULL && addr < _heap_end) { assert(addr >= _heap_bottom, - err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, _heap_bottom)); + err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, p2i(addr), p2i(_heap_bottom))); return addr_to_region_unsafe(addr); } return NULL;
--- a/src/share/vm/gc_implementation/g1/heapRegionSet.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/heapRegionSet.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -190,7 +190,7 @@ class hrs_ext_msg : public hrs_err_msg { public: - hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") { + hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("%s","") { set->fill_in_ext_msg(this, message); } };
--- a/src/share/vm/gc_implementation/g1/survRateGroup.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/g1/survRateGroup.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -202,7 +202,7 @@ if (length == 0) return; - gclog_or_tty->print_cr(""); + gclog_or_tty->cr(); gclog_or_tty->print_cr("%s Rate Summary (for up to age %d)", _name, length-1); gclog_or_tty->print_cr(" age range survival rate (avg) samples (avg)"); gclog_or_tty->print_cr(" ---------------------------------------------------------");
--- a/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, 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 @@ -259,22 +259,22 @@ requested_eden_size, requested_survivor_size); gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, - eden()->bottom(), - eden()->end(), + p2i(eden()->bottom()), + p2i(eden()->end()), pointer_delta(eden()->end(), eden()->bottom(), sizeof(char))); gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, - from()->bottom(), - from()->end(), + p2i(from()->bottom()), + p2i(from()->end()), pointer_delta(from()->end(), from()->bottom(), sizeof(char))); gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, - to()->bottom(), - to()->end(), + p2i(to()->bottom()), + p2i(to()->end()), pointer_delta( to()->end(), to()->bottom(), sizeof(char))); @@ -382,18 +382,18 @@ if (PrintAdaptiveSizePolicy && Verbose) { gclog_or_tty->print_cr(" [eden_start .. eden_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - eden_start, - eden_end, + p2i(eden_start), + p2i(eden_end), pointer_delta(eden_end, eden_start, sizeof(char))); gclog_or_tty->print_cr(" [from_start .. from_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - from_start, - from_end, + p2i(from_start), + p2i(from_end), pointer_delta(from_end, from_start, sizeof(char))); gclog_or_tty->print_cr(" [ to_start .. to_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - to_start, - to_end, + p2i(to_start), + p2i(to_end), pointer_delta( to_end, to_start, sizeof(char))); } } else { @@ -473,18 +473,18 @@ if (PrintAdaptiveSizePolicy && Verbose) { gclog_or_tty->print_cr(" [eden_start .. eden_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - eden_start, - eden_end, + p2i(eden_start), + p2i(eden_end), pointer_delta(eden_end, eden_start, sizeof(char))); gclog_or_tty->print_cr(" [ to_start .. to_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - to_start, - to_end, + p2i(to_start), + p2i(to_end), pointer_delta( to_end, to_start, sizeof(char))); gclog_or_tty->print_cr(" [from_start .. from_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - from_start, - from_end, + p2i(from_start), + p2i(from_end), pointer_delta(from_end, from_start, sizeof(char))); } }
--- a/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -79,12 +79,12 @@ if ((HeapWord*)obj < _boundary) { #ifndef PRODUCT if (_g->to()->is_in_reserved(obj)) { - tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p); + tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p2i(p)); GenCollectedHeap* gch = (GenCollectedHeap*)Universe::heap(); Space* sp = gch->space_containing(p); oop obj = oop(sp->block_start(p)); assert((HeapWord*)obj < (HeapWord*)p, "Error"); - tty->print_cr("Object: " PTR_FORMAT, obj); + tty->print_cr("Object: " PTR_FORMAT, p2i(obj)); tty->print_cr("-------"); obj->print(); tty->print_cr("-----");
--- a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -255,22 +255,22 @@ requested_eden_size, requested_survivor_size); gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, - eden_space()->bottom(), - eden_space()->end(), + p2i(eden_space()->bottom()), + p2i(eden_space()->end()), pointer_delta(eden_space()->end(), eden_space()->bottom(), sizeof(char))); gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, - from_space()->bottom(), - from_space()->end(), + p2i(from_space()->bottom()), + p2i(from_space()->end()), pointer_delta(from_space()->end(), from_space()->bottom(), sizeof(char))); gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, - to_space()->bottom(), - to_space()->end(), + p2i(to_space()->bottom()), + p2i(to_space()->end()), pointer_delta( to_space()->end(), to_space()->bottom(), sizeof(char))); @@ -376,18 +376,18 @@ if (PrintAdaptiveSizePolicy && Verbose) { gclog_or_tty->print_cr(" [eden_start .. eden_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - eden_start, - eden_end, + p2i(eden_start), + p2i(eden_end), pointer_delta(eden_end, eden_start, sizeof(char))); gclog_or_tty->print_cr(" [from_start .. from_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - from_start, - from_end, + p2i(from_start), + p2i(from_end), pointer_delta(from_end, from_start, sizeof(char))); gclog_or_tty->print_cr(" [ to_start .. to_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - to_start, - to_end, + p2i(to_start), + p2i(to_end), pointer_delta( to_end, to_start, sizeof(char))); } } else { @@ -430,18 +430,18 @@ if (PrintAdaptiveSizePolicy && Verbose) { gclog_or_tty->print_cr(" [eden_start .. eden_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - eden_start, - eden_end, + p2i(eden_start), + p2i(eden_end), pointer_delta(eden_end, eden_start, sizeof(char))); gclog_or_tty->print_cr(" [ to_start .. to_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - to_start, - to_end, + p2i(to_start), + p2i(to_end), pointer_delta( to_end, to_start, sizeof(char))); gclog_or_tty->print_cr(" [from_start .. from_end): " "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - from_start, - from_end, + p2i(from_start), + p2i(from_end), pointer_delta(from_end, from_start, sizeof(char))); } }
--- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -562,23 +562,23 @@ gclog_or_tty->print_cr(" " " _covered[%d].start(): " INTPTR_FORMAT " _covered[%d].last(): " INTPTR_FORMAT, - ind, _covered[ind].start(), - ind, _covered[ind].last()); + ind, p2i(_covered[ind].start()), + ind, p2i(_covered[ind].last())); gclog_or_tty->print_cr(" " " _committed[%d].start(): " INTPTR_FORMAT " _committed[%d].last(): " INTPTR_FORMAT, - ind, _committed[ind].start(), - ind, _committed[ind].last()); + ind, p2i(_committed[ind].start()), + ind, p2i(_committed[ind].last())); gclog_or_tty->print_cr(" " " byte_for(start): " INTPTR_FORMAT " byte_for(last): " INTPTR_FORMAT, - byte_for(_covered[ind].start()), - byte_for(_covered[ind].last())); + p2i(byte_for(_covered[ind].start())), + p2i(byte_for(_covered[ind].last()))); gclog_or_tty->print_cr(" " " addr_for(start): " INTPTR_FORMAT " addr_for(last): " INTPTR_FORMAT, - addr_for((jbyte*) _committed[ind].start()), - addr_for((jbyte*) _committed[ind].last())); + p2i(addr_for((jbyte*) _committed[ind].start())), + p2i(addr_for((jbyte*) _committed[ind].last()))); } debug_only(verify_guard();) }
--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -516,7 +516,7 @@ if ((result == NULL) && (QueuedAllocationWarningCount > 0) && (loop_count % QueuedAllocationWarningCount == 0)) { warning("ParallelScavengeHeap::mem_allocate retries %d times \n\t" - " size=%d", loop_count, size); + " size=" SIZE_FORMAT, loop_count, size); } }
--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -61,7 +61,7 @@ const void* loc = (void*) p; bool result = ((HeapWord*)p) >= young_gen()->reserved().start(); assert(result == young_gen()->is_in_reserved(p), - err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p)); + err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p))); return result; }
--- a/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, 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 @@ -847,7 +847,7 @@ "AdaptiveSizePolicy::compute_generation_free_space " "adjusting tenured gen for footprint. " "starting promo size " SIZE_FORMAT - " reduced promo size " SIZE_FORMAT, + " reduced promo size " SIZE_FORMAT " promo delta " SIZE_FORMAT, desired_promo_size, reduced_size, change ); }
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, 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 @@ -137,7 +137,7 @@ } const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]); - for (uint i = 0; i < hlines; ++i) tty->print_cr(pm_stats_hdr[i]); + for (uint i = 0; i < hlines; ++i) tty->print_cr("%s", pm_stats_hdr[i]); for (uint i = 0; i < ParallelGCThreads + 1; ++i) { manager_array(i)->print_local_stats(i); }
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, 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 @@ -219,7 +219,7 @@ if (TraceScavenge) { gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (" SIZE_FORMAT ")}", PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring", - new_obj->blueprint()->internal_name(), o, new_obj, new_obj->size()); + new_obj->blueprint()->internal_name(), p2i(o), p2i(new_obj), new_obj->size()); } #endif
--- a/src/share/vm/gc_implementation/shared/ageTable.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/shared/ageTable.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -106,8 +106,8 @@ total += sizes[age]; if (sizes[age] > 0) { if (PrintTenuringDistribution) { - gclog_or_tty->print_cr("- age %3u: %10ld bytes, %10ld total", - age, sizes[age]*oopSize, total*oopSize); + gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", + age, sizes[age]*oopSize, total*oopSize); } } if (UsePerfData) {
--- a/src/share/vm/gc_implementation/shared/allocationStats.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/shared/allocationStats.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, 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 @@ -108,7 +108,7 @@ assert(demand >= 0, err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for " PTR_FORMAT " (size=" SIZE_FORMAT ")", - demand, this, count)); + demand, p2i(this), count)); // Defensive: adjust for imprecision in event counting if (demand < 0) { demand = 0;
--- a/src/share/vm/gc_implementation/shared/immutableSpace.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_implementation/shared/immutableSpace.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -65,7 +65,7 @@ void ImmutableSpace::print() const { print_short(); - tty->print_cr(" [%#-6lx,%#-6lx)", bottom(), end()); + tty->print_cr(" [" INTPTR_FORMAT_W(#-6) "," INTPTR_FORMAT_W(#-6) ")", p2i(bottom()), p2i(end())); } #endif
--- a/src/share/vm/gc_interface/collectedHeap.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/gc_interface/collectedHeap.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -608,12 +608,12 @@ assert(heap_start >= ((uintptr_t)NULL + epsilon), "sanity"); void* before_heap = (void*)(heap_start - epsilon); assert(!heap->is_in(before_heap), - err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", before_heap)); + err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap))); // Test that a pointer to after the heap end is reported as outside the heap. assert(heap_end <= ((uintptr_t)-1 - epsilon), "sanity"); void* after_heap = (void*)(heap_end + epsilon); assert(!heap->is_in(after_heap), - err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", after_heap)); + err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap))); } #endif
--- a/src/share/vm/interpreter/bytecodeTracer.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/interpreter/bytecodeTracer.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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,7 +212,7 @@ st->print_cr(" %s", buf); } } else { - st->print_cr(" " PTR_FORMAT, (intptr_t) value); + st->print_cr(" " INTPTR_FORMAT, p2i(value)); } } @@ -244,7 +244,7 @@ i = cache->entry_at(i)->main_entry_index() + constantPoolOopDesc::CPCACHE_INDEX_TAG; goto check_cache_index; } else { - st->print_cr(" not in cache[*]?", i); + st->print_cr("%d not in cache[*]?", i); return false; } } @@ -283,7 +283,7 @@ i = cache->entry_at(i)->constant_pool_index(); goto check_cp_index; } - st->print_cr(" not in CP[*]?", i); + st->print_cr("%d not in CP[*]?", i); return false; } @@ -322,7 +322,7 @@ } else if (tag.is_method_handle()) { int kind = constants->method_handle_ref_kind_at(i); int i2 = constants->method_handle_index_at(i); - st->print(" <MethodHandle of kind %d>", kind, i2); + st->print(" <MethodHandle of kind %d index at %d>", kind, i2); print_field_or_method(-i, i2, st); } else { st->print_cr(" bad tag=%d at %d", tag.value(), i);
--- a/src/share/vm/interpreter/interpreter.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/interpreter/interpreter.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -70,7 +70,7 @@ if (description() != NULL) st->print("%s ", description()); if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode())); st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes", - code_begin(), code_end(), code_size()); + p2i(code_begin()), p2i(code_end()), code_size()); if (PrintInterpreter) { st->cr();
--- a/src/share/vm/interpreter/linkResolver.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/interpreter/linkResolver.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1283,7 +1283,7 @@ THREAD); if (HAS_PENDING_EXCEPTION) { if (TraceMethodHandles) { - tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, PENDING_EXCEPTION); + tty->print_cr("invokedynamic throws BSME for " INTPTR_FORMAT, p2i(PENDING_EXCEPTION)); PENDING_EXCEPTION->print(); } if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) {
--- a/src/share/vm/interpreter/templateInterpreter.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/interpreter/templateInterpreter.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -106,7 +106,7 @@ tty->print("["); for (int i = 0; i < number_of_states; i++) { if (i > 0) tty->print(", "); - tty->print(INTPTR_FORMAT, _entry[i]); + tty->print(INTPTR_FORMAT, p2i(_entry[i])); } tty->print("]"); }
--- a/src/share/vm/libadt/set.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/libadt/set.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -116,7 +116,7 @@ void Set::print() const { char *printable_set = setstr(); - tty->print_cr(printable_set); + tty->print_cr("%s", printable_set); FreeHeap(printable_set); }
--- a/src/share/vm/memory/allocation.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/allocation.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -119,7 +119,7 @@ // Operator new() was called and type was set. assert(!allocated_on_stack(), err_msg("not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); } else { // Operator new() was not called. // Assume that it is embedded or stack object. @@ -133,7 +133,7 @@ // Note: garbage may resembles valid value. assert(~(_allocation_t[0] | allocation_mask) != (uintptr_t)this || !is_type_set(), err_msg("embedded or stack only, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); set_allocation_type((address)this, STACK_OR_EMBEDDED); _allocation_t[1] = 0; // Zap verification value } @@ -142,7 +142,7 @@ // Used in InlineTree::ok_to_inline() for WarmCallInfo. assert(allocated_on_stack(), err_msg("copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); // Keep current _allocation_t value; return *this; } @@ -158,13 +158,13 @@ void trace_heap_malloc(size_t size, const char* name, void* p) { // A lock is not needed here - tty uses a lock internally - tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p, size, name == NULL ? "" : name); + tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p2i(p), size, name == NULL ? "" : name); } void trace_heap_free(void* p) { // A lock is not needed here - tty uses a lock internally - tty->print_cr("Heap free " INTPTR_FORMAT, p); + tty->print_cr("Heap free " INTPTR_FORMAT, p2i(p)); } bool warn_new_operator = false; // see vm_main @@ -637,11 +637,11 @@ void AllocatedObj::print_value() const { print_value_on(tty); } void AllocatedObj::print_on(outputStream* st) const { - st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", this); + st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", p2i(this)); } void AllocatedObj::print_value_on(outputStream* st) const { - st->print("AllocatedObj(" INTPTR_FORMAT ")", this); + st->print("AllocatedObj(" INTPTR_FORMAT ")", p2i(this)); } julong Arena::_bytes_allocated = 0;
--- a/src/share/vm/memory/binaryTreeDictionary.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/binaryTreeDictionary.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1263,7 +1263,7 @@ for (Chunk* fc = fl->head(); fc != NULL; fc = fc->next()) { _st->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", - fc, (HeapWord*)fc + sz, + p2i(fc), p2i((HeapWord*)fc + sz), fc->cantCoalesce() ? "\t CC" : ""); } }
--- a/src/share/vm/memory/blockOffsetTable.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/blockOffsetTable.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, 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 @@ -59,12 +59,12 @@ " rs.base(): " INTPTR_FORMAT " rs.size(): " INTPTR_FORMAT " rs end(): " INTPTR_FORMAT, - rs.base(), rs.size(), rs.base() + rs.size()); + p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); gclog_or_tty->print_cr(" " " _vs.low_boundary(): " INTPTR_FORMAT " _vs.high_boundary(): " INTPTR_FORMAT, - _vs.low_boundary(), - _vs.high_boundary()); + p2i(_vs.low_boundary()), + p2i(_vs.high_boundary())); } } @@ -547,10 +547,10 @@ q -= (N_words * n_cards_back); assert(q >= _sp->bottom(), err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT, - q, _sp->bottom())); + p2i(q), p2i(_sp->bottom()))); assert(q < _sp->end(), err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT, - q, _sp->end())); + p2i(q), p2i(_sp->end()))); index -= n_cards_back; offset = _array->offset_array(index); } @@ -559,10 +559,10 @@ q -= offset; assert(q >= _sp->bottom(), err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT, - q, _sp->bottom())); + p2i(q), p2i(_sp->bottom()))); assert(q < _sp->end(), err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT, - q, _sp->end())); + p2i(q), p2i(_sp->end()))); HeapWord* n = q; while (n <= addr) { @@ -573,14 +573,14 @@ err_msg("Looping at n = " PTR_FORMAT " with last = " PTR_FORMAT"," " while querying blk_start(" PTR_FORMAT ")" " on _sp = [" PTR_FORMAT "," PTR_FORMAT ")", - n, last, addr, _sp->bottom(), _sp->end())); + p2i(n), p2i(last), p2i(addr), p2i(_sp->bottom()), p2i(_sp->end()))); } assert(q <= addr, err_msg("wrong order for current (" INTPTR_FORMAT ")" " <= arg (" INTPTR_FORMAT ")", - q, addr)); + p2i(q), p2i(addr))); assert(addr <= n, err_msg("wrong order for arg (" INTPTR_FORMAT ") <= next (" INTPTR_FORMAT ")", - addr, n)); + p2i(addr), p2i(n))); return q; }
--- a/src/share/vm/memory/cardTableModRefBS.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/cardTableModRefBS.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -142,11 +142,11 @@ gclog_or_tty->print_cr(" " " &_byte_map[0]: " INTPTR_FORMAT " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, - &_byte_map[0], - &_byte_map[_last_valid_index]); + p2i(&_byte_map[0]), + p2i(&_byte_map[_last_valid_index])); gclog_or_tty->print_cr(" " " byte_map_base: " INTPTR_FORMAT, - byte_map_base); + p2i(byte_map_base)); } } @@ -369,23 +369,23 @@ gclog_or_tty->print_cr(" " " _covered[%d].start(): " INTPTR_FORMAT " _covered[%d].last(): " INTPTR_FORMAT, - ind, _covered[ind].start(), - ind, _covered[ind].last()); + ind, p2i(_covered[ind].start()), + ind, p2i(_covered[ind].last())); gclog_or_tty->print_cr(" " " _committed[%d].start(): " INTPTR_FORMAT " _committed[%d].last(): " INTPTR_FORMAT, - ind, _committed[ind].start(), - ind, _committed[ind].last()); + ind, p2i(_committed[ind].start()), + ind, p2i(_committed[ind].last())); gclog_or_tty->print_cr(" " " byte_for(start): " INTPTR_FORMAT " byte_for(last): " INTPTR_FORMAT, - byte_for(_covered[ind].start()), - byte_for(_covered[ind].last())); + p2i(byte_for(_covered[ind].start())), + p2i(byte_for(_covered[ind].last()))); gclog_or_tty->print_cr(" " " addr_for(start): " INTPTR_FORMAT " addr_for(last): " INTPTR_FORMAT, - addr_for((jbyte*) _committed[ind].start()), - addr_for((jbyte*) _committed[ind].last())); + p2i(addr_for((jbyte*) _committed[ind].start())), + p2i(addr_for((jbyte*) _committed[ind].last()))); } // Touch the last card of the covered region to show that it // is committed (or SEGV). @@ -634,14 +634,14 @@ if (failed) { if (!failures) { tty->cr(); - tty->print_cr("== CT verification failed: ["PTR_FORMAT","PTR_FORMAT"]", start, end); + tty->print_cr("== CT verification failed: [" INTPTR_FORMAT "," INTPTR_FORMAT "]", p2i(start), p2i(end)); tty->print_cr("== %sexpecting value: %d", (val_equals) ? "" : "not ", val); failures = true; } tty->print_cr("== card "PTR_FORMAT" ["PTR_FORMAT","PTR_FORMAT"], " - "val: %d", curr, addr_for(curr), - (HeapWord*) (((size_t) addr_for(curr)) + card_size), + "val: %d", p2i(curr), p2i(addr_for(curr)), + p2i((HeapWord*) (((size_t) addr_for(curr)) + card_size)), (int) curr_val); } } @@ -659,7 +659,7 @@ void CardTableModRefBS::print_on(outputStream* st) const { st->print_cr("Card table byte_map: [" INTPTR_FORMAT "," INTPTR_FORMAT "] byte_map_base: " INTPTR_FORMAT, - _byte_map, _byte_map + _byte_map_size, byte_map_base); + p2i(_byte_map), p2i(_byte_map + _byte_map_size), p2i(byte_map_base)); } bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
--- a/src/share/vm/memory/cardTableModRefBS.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/cardTableModRefBS.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -155,7 +155,7 @@ assert(_whole_heap.contains(p), err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", - p, _whole_heap.start(), _whole_heap.end())); + p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); jbyte* result = &byte_map_base[uintptr_t(p) >> card_shift]; assert(result >= _byte_map && result < _byte_map + _byte_map_size, "out of bounds accessor for card marking array"); @@ -436,7 +436,7 @@ assert(_whole_heap.contains(result), err_msg("Returning result = "PTR_FORMAT" out of bounds of " " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", - result, _whole_heap.start(), _whole_heap.end())); + p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); return result; } @@ -445,7 +445,7 @@ assert(_whole_heap.contains(p), err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", - p, _whole_heap.start(), _whole_heap.end())); + p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); return byte_for(p) - _byte_map; }
--- a/src/share/vm/memory/cardTableRS.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/cardTableRS.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -276,14 +276,14 @@ err_msg("Did you forget to call save_marks()? " "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in " "[" PTR_FORMAT ", " PTR_FORMAT ")", - urasm.start(), urasm.end(), ur.start(), ur.end())); + p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()))); // In the case of CMS+ParNew, issue a warning if (!ur.contains(urasm)) { assert(UseConcMarkSweepGC && UseParNewGC, "Tautology: see assert above"); warning("CMS+ParNew: Did you forget to call save_marks()? " "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in " "[" PTR_FORMAT ", " PTR_FORMAT ")", - urasm.start(), urasm.end(), ur.start(), ur.end()); + p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end())); MemRegion ur2 = sp->used_region(); MemRegion urasm2 = sp->used_region_at_save_marks(); if (!ur.equals(ur2)) { @@ -369,12 +369,12 @@ assert(jp >= _begin && jp < _end, err_msg("Error: jp " PTR_FORMAT " should be within " "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")", - jp, _begin, _end)); + p2i(jp), p2i(_begin), p2i(_end))); oop obj = oopDesc::load_decode_heap_oop(p); guarantee(obj == NULL || (HeapWord*)obj >= _boundary, err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on " "clean card crosses boundary" PTR_FORMAT, - (HeapWord*)obj, jp, _boundary)); + p2i((HeapWord*)obj), p2i(jp), p2i(_boundary))); } public: @@ -382,10 +382,10 @@ _boundary(b), _begin(begin), _end(end) { assert(b <= begin, err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT, - b, begin)); + p2i(b), p2i(begin))); assert(begin <= end, err_msg("Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT, - begin, end)); + p2i(begin), p2i(end))); } virtual void do_oop(oop* p) { VerifyCleanCardClosure::do_oop_work(p); }
--- a/src/share/vm/memory/gcLocker.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/gcLocker.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -52,7 +52,7 @@ tty->print_cr("critical counts don't match: %d != %d", _jni_lock_count, count); for (JavaThread* thr = Threads::first(); thr; thr = thr->next()) { if (thr->in_critical()) { - tty->print_cr(INTPTR_FORMAT " in_critical %d", thr, thr->in_critical()); + tty->print_cr(INTPTR_FORMAT " in_critical %d", p2i(thr), thr->in_critical()); } } }
--- a/src/share/vm/memory/genCollectedHeap.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/genCollectedHeap.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -933,7 +933,7 @@ bool GenCollectedHeap::is_in_young(oop p) { bool result = ((HeapWord*)p) < _gens[_n_gens - 1]->reserved().start(); assert(result == _gens[0]->is_in_reserved(p), - err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p)); + err_msg("incorrect test - result=%d, p=" INTPTR_FORMAT, result, p2i((void*)p))); return result; } @@ -1240,7 +1240,7 @@ for (int i = _n_gens-1; i >= 0; i--) { Generation* g = _gens[i]; if (!silent) { - gclog_or_tty->print(g->name()); + gclog_or_tty->print("%s", g->name()); gclog_or_tty->print(" "); } g->verify();
--- a/src/share/vm/memory/genOopClosures.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/genOopClosures.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, 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 @@ -175,7 +175,7 @@ protected: template <class T> inline void do_oop_work(T* p) { oop obj = oopDesc::load_decode_heap_oop(p); - guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, (oopDesc*) obj)); + guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj))); } public: virtual void do_oop(oop* p);
--- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -98,7 +98,7 @@ " obj: "SIZE_FORMAT " free: "SIZE_FORMAT " waste: "SIZE_FORMAT"\n", - "slow", thrd, thrd->osthread()->thread_id(), + "slow", p2i(thrd), thrd->osthread()->thread_id(), obj_size, free(), refill_waste_limit()); } }
--- a/src/share/vm/memory/universe.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/memory/universe.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -1405,7 +1405,7 @@ HandleMark hm; // Handles created during verification can be zapped _verify_count++; - if (!silent) gclog_or_tty->print(prefix); + if (!silent) gclog_or_tty->print("%s", prefix); if (!silent) gclog_or_tty->print("[Verifying "); if (!silent) gclog_or_tty->print("threads "); Threads::verify();
--- a/src/share/vm/oops/instanceKlass.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/oops/instanceKlass.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -695,7 +695,7 @@ if (TraceFinalizerRegistration) { tty->print("Registered "); i->print_value_on(tty); - tty->print_cr(" (" INTPTR_FORMAT ") as finalizable", (address)i); + tty->print_cr(" (" INTPTR_FORMAT ") as finalizable", p2i((address) i)); } instanceHandle h_i(THREAD, i); // Pass the handle as argument, JavaCalls::call expects oop as jobjects @@ -809,7 +809,7 @@ if (TraceClassInitialization) { tty->print("%d Initializing ", call_class_initializer_impl_counter++); this_oop->name()->print_value(); - tty->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", (address)this_oop()); + tty->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", p2i((address) this_oop())); } if (h_method() != NULL) { JavaCallArguments args; // No arguments @@ -2508,7 +2508,7 @@ guarantee(Universe::heap()->is_in_closed_subset(p), "should be in heap"); oop obj = oopDesc::load_decode_heap_oop(p); if (!obj->is_oop_or_null()) { - tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p, (address)obj); + tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p2i(p), p2i((address) obj)); Universe::print(); guarantee(false, "boom"); }
--- a/src/share/vm/oops/oop.inline.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/oops/oop.inline.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -225,7 +225,7 @@ inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { oop result = unsafe_decode_heap_oop_not_null(v); - assert(check_obj_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result)); + assert(check_obj_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result))); return result; }
--- a/src/share/vm/opto/block.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/block.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -354,7 +354,7 @@ st->print(" FRegPressure: %d",_freg_pressure); st->print(" FHRP Index: %d",_fhrp_index); } - st->print_cr(""); + st->cr(); } void Block::dump() const { dump(NULL); }
--- a/src/share/vm/opto/callnode.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/callnode.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -111,7 +111,7 @@ #ifndef PRODUCT void ParmNode::dump_spec(outputStream *st) const { if( _con < TypeFunc::Parms ) { - st->print(names[_con]); + st->print("%s", names[_con]); } else { st->print("Parm%d: ",_con-TypeFunc::Parms); // Verbose and WizardMode dump bottom_type for all nodes @@ -348,13 +348,13 @@ case Type::AryPtr: case Type::KlassPtr: case Type::InstPtr: - st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->isa_oopptr()->const_oop()); + st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->isa_oopptr()->const_oop())); break; case Type::NarrowOop: - st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_oopptr()->const_oop()); + st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_oopptr()->const_oop())); break; case Type::RawPtr: - st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,t->is_rawptr()); + st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,p2i(t->is_rawptr())); break; case Type::DoubleCon: st->print(" %s%d]=#%fD",msg,i,t->is_double_constant()->_d); @@ -422,7 +422,7 @@ for (i = 0; i < (uint)scobjs.length(); i++) { // Scalar replaced objects. - st->print_cr(""); + st->cr(); st->print(" # ScObj" INT32_FORMAT " ", i); SafePointScalarObjectNode* spobj = scobjs.at(i); ciKlass* cik = spobj->bottom_type()->is_oopptr()->klass(); @@ -479,7 +479,7 @@ st->print(" }"); } } - st->print_cr(""); + st->cr(); if (caller() != NULL) caller()->format(regalloc, n, st); } @@ -887,7 +887,7 @@ #ifndef PRODUCT void CallRuntimeNode::dump_spec(outputStream *st) const { st->print("# "); - st->print(_name); + st->print("%s", _name); CallNode::dump_spec(st); } #endif @@ -905,7 +905,7 @@ #ifndef PRODUCT void CallLeafNode::dump_spec(outputStream *st) const { st->print("# "); - st->print(_name); + st->print("%s", _name); CallNode::dump_spec(st); } #endif
--- a/src/share/vm/opto/chaitin.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/chaitin.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -1871,25 +1871,25 @@ if( i2 < _ifg->_maxlrg ) lrgs(i2).dump( ); else tty->print_cr("new LRG"); } - tty->print_cr(""); + tty->cr(); // Dump lo-degree list tty->print("Lo degree: "); for(uint i3 = _lo_degree; i3; i3 = lrgs(i3)._next ) tty->print("L%d ",i3); - tty->print_cr(""); + tty->cr(); // Dump lo-stk-degree list tty->print("Lo stk degree: "); for(uint i4 = _lo_stk_degree; i4; i4 = lrgs(i4)._next ) tty->print("L%d ",i4); - tty->print_cr(""); + tty->cr(); // Dump lo-degree list tty->print("Hi degree: "); for(uint i5 = _hi_degree; i5; i5 = lrgs(i5)._next ) tty->print("L%d ",i5); - tty->print_cr(""); + tty->cr(); } //------------------------------dump_degree_lists------------------------------ @@ -1898,19 +1898,19 @@ tty->print("Lo degree: "); for( uint i = _lo_degree; i; i = lrgs(i)._next ) tty->print("L%d ",i); - tty->print_cr(""); + tty->cr(); // Dump lo-stk-degree list tty->print("Lo stk degree: "); for(uint i2 = _lo_stk_degree; i2; i2 = lrgs(i2)._next ) tty->print("L%d ",i2); - tty->print_cr(""); + tty->cr(); // Dump lo-degree list tty->print("Hi degree: "); for(uint i3 = _hi_degree; i3; i3 = lrgs(i3)._next ) tty->print("L%d ",i3); - tty->print_cr(""); + tty->cr(); } //------------------------------dump_simplified-------------------------------- @@ -1918,7 +1918,7 @@ tty->print("Simplified: "); for( uint i = _simplified; i; i = lrgs(i)._next ) tty->print("L%d ",i); - tty->print_cr(""); + tty->cr(); } static char *print_reg( OptoReg::Name reg, const PhaseChaitin *pc, char *buf ) { @@ -2000,7 +2000,7 @@ } tty->print(" : parm %d: ", k); domain->field_at(k + TypeFunc::Parms)->dump(); - tty->print_cr(""); + tty->cr(); } } @@ -2022,7 +2022,7 @@ _matcher._parm_regs[j].second() == reg ) { tty->print("parm %d: ",j); domain->field_at(j + TypeFunc::Parms)->dump(); - tty->print_cr(""); + tty->cr(); break; } }
--- a/src/share/vm/opto/compile.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/compile.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -2329,7 +2329,7 @@ starts_bundle = ' '; tty->print("\t"); delay->format(_regalloc, tty); - tty->print_cr(""); + tty->cr(); delay = NULL; } @@ -2343,12 +2343,12 @@ if (pcs && n->_idx < pc_limit) tty->print_cr("%3.3x", pcs[n->_idx]); else - tty->print_cr(""); + tty->cr(); assert(cut_short || delay == NULL, "no unconditional delay branch"); } // End of per-block dump - tty->print_cr(""); + tty->cr(); if (cut_short) tty->print_cr("*** disassembly is cut short ***"); } @@ -3617,7 +3617,7 @@ for (uint i = 0; i < n->outcnt(); i++) { address* constant_addr = &jump_table_base[i]; - assert(*constant_addr == (((address) n) + i), err_msg_res("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, *constant_addr, (((address) n) + i))); + assert(*constant_addr == (((address) n) + i), err_msg_res("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, p2i(*constant_addr), p2i(((address) n) + i))); *constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr); cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type); } @@ -3648,7 +3648,7 @@ } } for (int i = 0; i < _print_inlining_list->length(); i++) { - tty->print(_print_inlining_list->adr_at(i)->ss()->as_string()); + tty->print("%s", _print_inlining_list->adr_at(i)->ss()->as_string()); } } }
--- a/src/share/vm/opto/compile.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/compile.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -430,7 +430,7 @@ void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) { stringStream ss; CompileTask::print_inlining(&ss, method, inline_level, bci, msg); - print_inlining_stream()->print(ss.as_string()); + print_inlining_stream()->print("%s", ss.as_string()); } private:
--- a/src/share/vm/opto/doCall.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/doCall.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -57,7 +57,7 @@ out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count); stringStream ss; prof_klass->name()->print_symbol_on(&ss); - out->print(ss.as_string()); + out->print("%s", ss.as_string()); out->cr(); } }
--- a/src/share/vm/opto/gcm.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/gcm.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -1984,7 +1984,7 @@ tty->print("%s: %d trip_count: %6.0f freq: %6.0f\n", _depth == 0 ? "Method" : "Loop", _id, trip_count(), _freq); for (int i = 0; i < _depth; i++) tty->print(" "); - tty->print(" members:", _id); + tty->print(" members:"); int k = 0; for (int i = 0; i < _members.length(); i++) { if (k++ >= 6) {
--- a/src/share/vm/opto/idealGraphPrinter.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/idealGraphPrinter.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -155,7 +155,7 @@ } else { // It would be nice if we could shut down cleanly but it should // be an error if we can't connect to the visualizer. - fatal(err_msg_res("Couldn't connect to visualizer at %s:%d", + fatal(err_msg_res("Couldn't connect to visualizer at %s:" INTX_FORMAT, PrintIdealGraphAddress, PrintIdealGraphPort)); } } @@ -195,7 +195,7 @@ void IdealGraphPrinter::begin_elem(const char *s) { - _xml->begin_elem(s); + _xml->begin_elem("%s", s); } void IdealGraphPrinter::end_elem() { @@ -203,7 +203,7 @@ } void IdealGraphPrinter::begin_head(const char *s) { - _xml->begin_head(s); + _xml->begin_head("%s", s); } void IdealGraphPrinter::end_head() { @@ -223,7 +223,7 @@ } void IdealGraphPrinter::head(const char *name) { - _xml->head(name); + _xml->head("%s", name); } void IdealGraphPrinter::tail(const char *name) { @@ -231,7 +231,7 @@ } void IdealGraphPrinter::text(const char *s) { - _xml->text(s); + _xml->text("%s", s); } void IdealGraphPrinter::print_prop(const char *name, int val) { @@ -359,7 +359,7 @@ void IdealGraphPrinter::print_indent() { tty->print_cr("printing ident %d", _depth); for (int i = 0; i < _depth; i++) { - _xml->print(INDENT); + _xml->print("%s", INDENT); } }
--- a/src/share/vm/opto/ifg.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/ifg.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, 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 @@ -275,7 +275,7 @@ for( i = 0; i < _maxlrg*2; i++ ) if( h_cnt[i] ) tty->print("%d/%d ",i,h_cnt[i]); - tty->print_cr(""); + tty->cr(); } //------------------------------verify-----------------------------------------
--- a/src/share/vm/opto/loopPredicate.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/loopPredicate.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -728,7 +728,7 @@ if (TraceLoopPredicate) { predString->print_cr("<u range"); - tty->print(predString->as_string()); + tty->print("%s", predString->as_string()); } return bol; }
--- a/src/share/vm/opto/loopnode.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/loopnode.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -3601,7 +3601,7 @@ #ifdef ASSERT void PhaseIdealLoop::dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA) { - tty->print_cr(msg); + tty->print_cr("%s", msg); tty->print("n: "); n->dump(); tty->print("early(n): "); early->dump(); if (n->in(0) != NULL && !n->in(0)->is_top() &&
--- a/src/share/vm/opto/matcher.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/matcher.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -2500,7 +2500,7 @@ tty->print_cr("%s %d %s", ruleName[i], _cost[i], ruleName[_rule[i]] ); } - tty->print_cr(""); + tty->cr(); for( i=0; i<2; i++ ) if( _kids[i] )
--- a/src/share/vm/opto/memnode.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/memnode.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -3869,7 +3869,7 @@ intptr_t st_off = get_store_offset(st, phase); if (st_off < 0) continue; // ignore dead garbage if (last_off > st_off) { - tty->print_cr("*** bad store offset at %d: %d > %d", i, last_off, st_off); + tty->print_cr("*** bad store offset at %d: " INTX_FORMAT " > " INTX_FORMAT, i, last_off, st_off); this->dump(2); assert(false, "ascending store offsets"); return false;
--- a/src/share/vm/opto/node.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/node.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1659,7 +1659,7 @@ } } } - if (suffix) st->print(suffix); + if (suffix) st->print("%s", suffix); C->_in_dump_cnt--; }
--- a/src/share/vm/opto/parse1.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/parse1.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -606,7 +606,7 @@ set_map(entry_map); do_exits(); - if (log) log->done("parse nodes='%d' live='%d' memory='%d'", + if (log) log->done("parse nodes='%d' live='%d' memory='" SIZE_FORMAT "'", C->unique(), C->live_nodes(), C->node_arena()->used()); } @@ -1406,7 +1406,7 @@ tty->print((( i < ns) ? " %d" : " %d(e)"), b->successor_at(i)->rpo()); } if (b->is_loop_head()) tty->print(" lphd"); - tty->print_cr(""); + tty->cr(); } assert(block()->is_merged(), "must be merged before being parsed");
--- a/src/share/vm/opto/parse2.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/parse2.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -638,7 +638,7 @@ for( r = lo; r <= hi; r++ ) { r->print(env()); } - tty->print_cr(""); + tty->cr(); } #endif }
--- a/src/share/vm/opto/regmask.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/regmask.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -116,7 +116,7 @@ case Special: st->print("r---"); break; case Bad: st->print("rBAD"); break; default: - if (r < _last_Mach_Reg) st->print(Matcher::regName[r]); + if (r < _last_Mach_Reg) st->print("%s", Matcher::regName[r]); else st->print("rS%d",r); break; }
--- a/src/share/vm/opto/runtime.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/runtime.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1357,7 +1357,7 @@ } else { tty->print("<unknown>"); } - tty->print(" at " INTPTR_FORMAT, exception_pc); + tty->print(" at " INTPTR_FORMAT, p2i(exception_pc)); tty->print_cr("]"); }
--- a/src/share/vm/opto/subnode.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/subnode.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -1122,7 +1122,7 @@ // Print special per-node info void BoolTest::dump_on(outputStream *st) const { const char *msg[] = {"eq","gt","??","lt","ne","le","??","ge"}; - st->print(msg[_test]); + st->print("%s", msg[_test]); } //=============================================================================
--- a/src/share/vm/opto/type.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/opto/type.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -738,7 +738,7 @@ #ifndef PRODUCT //------------------------------dump2------------------------------------------ void Type::dump2( Dict &d, uint depth, outputStream *st ) const { - st->print(msg[_base]); + st->print("%s", msg[_base]); } //------------------------------dump-------------------------------------------
--- a/src/share/vm/prims/jniCheck.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/prims/jniCheck.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, 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 @@ -100,7 +100,7 @@ result_type JNICALL header { \ JavaThread* thr = (JavaThread*)ThreadLocalStorage::get_thread_slow();\ if (thr == NULL || !thr->is_Java_thread()) { \ - tty->print_cr(fatal_using_jnienv_in_nonjava); \ + tty->print_cr("%s", fatal_using_jnienv_in_nonjava); \ os::abort(true); \ } \ JNIEnv* xenv = thr->jni_environment(); \ @@ -183,7 +183,7 @@ functionEnter(JavaThread* thr) { if (thr->in_critical()) { - tty->print_cr(warn_other_function_in_critical); + tty->print_cr("%s", warn_other_function_in_critical); } if (thr->has_pending_exception()) { NativeReportJNIWarning(thr, "JNI call made with exception pending"); @@ -194,7 +194,7 @@ functionEnterExceptionAllowed(JavaThread* thr) { if (thr->in_critical()) { - tty->print_cr(warn_other_function_in_critical); + tty->print_cr("%s", warn_other_function_in_critical); } }
--- a/src/share/vm/prims/jvmtiEnvThreadState.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/prims/jvmtiEnvThreadState.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -113,7 +113,7 @@ JvmtiFramePop fp = JvmtiFramePop(_pops->at(i)); tty->print("%d: ", i); fp.print(); - tty->print_cr(""); + tty->cr(); } } #endif
--- a/src/share/vm/prims/jvmtiImpl.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/prims/jvmtiImpl.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -417,7 +417,7 @@ JvmtiBreakpoint& bp = _bps.at(i); tty->print("%d: ", i); bp.print(); - tty->print_cr(""); + tty->cr(); } #endif }
--- a/src/share/vm/prims/methodHandles.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/prims/methodHandles.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -559,7 +559,7 @@ // unknown letter, or we don't want to know its name st->put(ch); } else { - st->print(n); + st->print("%s", n); prev_type = true; } break;
--- a/src/share/vm/runtime/arguments.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/arguments.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -820,7 +820,7 @@ for (int i=0; i < _num_jvm_flags; i++) { st->print("%s ", _jvm_flags_array[i]); } - st->print_cr(""); + st->cr(); } } @@ -829,7 +829,7 @@ for (int i=0; i < _num_jvm_args; i++) { st->print("%s ", _jvm_args_array[i]); } - st->print_cr(""); + st->cr(); } } @@ -2023,7 +2023,7 @@ // Using "else if" below to avoid printing two error messages if min > max. // This will also prevent us from reporting both min>100 and max>100 at the // same time, but that is less annoying than printing two identical errors IMHO. - FormatBuffer<80> err_msg(""); + FormatBuffer<80> err_msg("%s",""); if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) { jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer()); status = false;
--- a/src/share/vm/runtime/compilationPolicy.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/compilationPolicy.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, 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 @@ -140,7 +140,7 @@ void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) { if (TraceOnStackReplacement) { if (osr_nm == NULL) tty->print_cr("compilation failed"); - else tty->print_cr("nmethod " INTPTR_FORMAT, osr_nm); + else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm)); } } #endif // !PRODUCT @@ -439,7 +439,7 @@ if (TraceCompilationPolicy) { tty->print("method invocation trigger: "); m->print_short_name(tty); - tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)m(), m->code_size()); + tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)m()), m->code_size()); } RegisterMap reg_map(thread, false); javaVFrame* triggerVF = thread->last_java_vframe(®_map); @@ -448,7 +448,7 @@ if (first->top_method()->code() != NULL) { // called obsolete method/nmethod -- no need to recompile - if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, first->top_method()->code()); + if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, p2i(first->top_method()->code())); } else { if (TimeCompilationPolicy) accumulated_time()->start(); GrowableArray<RFrame*>* stack = new GrowableArray<RFrame*>(50); @@ -576,7 +576,7 @@ if (TraceCompilationPolicy && Verbose) { tty->print("\n\t check caller: "); next_m->print_short_name(tty); - tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)next_m(), next_m->code_size()); + tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m()), next_m->code_size()); } current = next;
--- a/src/share/vm/runtime/fprofiler.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/fprofiler.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -308,7 +308,7 @@ st->fill_to(col2); t->print_native(st); st->fill_to(col3); - st->print(msg); + st->print("%s", msg); st->cr(); }
--- a/src/share/vm/runtime/java.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/java.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -366,7 +366,7 @@ BaselineTTYOutputer outputer(tty); MemTracker::print_memory_usage(outputer, K, false); } else { - tty->print_cr(MemTracker::reason()); + tty->print_cr("%s", MemTracker::reason()); } } } @@ -393,7 +393,7 @@ BaselineTTYOutputer outputer(tty); MemTracker::print_memory_usage(outputer, K, false); } else { - tty->print_cr(MemTracker::reason()); + tty->print_cr("%s", MemTracker::reason()); } } }
--- a/src/share/vm/runtime/os.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/os.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -809,9 +809,9 @@ for (int i = 0; env_list[i] != NULL; i++) { if (getenv(env_list[i], buffer, len)) { - st->print(env_list[i]); + st->print("%s", env_list[i]); st->print("="); - st->print_cr(buffer); + st->print_cr("%s", buffer); } } }
--- a/src/share/vm/runtime/safepoint.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/safepoint.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -797,7 +797,7 @@ old_sp += incr*32; new_sp += incr*32; was_oops += incr*32; for( int i2=0; i2<16; i2++ ) { tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); } - tty->print_cr(""); + tty->cr(); } #endif // SPARC #endif // PRODUCT @@ -839,7 +839,7 @@ timeout_error_printed = true; // Print out the thread infor which didn't reach the safepoint for debugging // purposes (useful when there are lots of threads in the debugger). - tty->print_cr(""); + tty->cr(); tty->print_cr("# SafepointSynchronize::begin: Timeout detected:"); if (reason == _spinning_timeout) { tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint."); @@ -859,7 +859,7 @@ (reason == _blocking_timeout && !cur_state->has_called_back()))) { tty->print("# "); cur_thread->print(); - tty->print_cr(""); + tty->cr(); } } tty->print_cr("# SafepointSynchronize::begin: (End of list)"); @@ -1332,7 +1332,7 @@ spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) { print_statistics(); } - tty->print_cr(""); + tty->cr(); // Print out polling page sampling status. if (!need_to_track_page_armed_status) {
--- a/src/share/vm/runtime/stackValue.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/stackValue.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -196,7 +196,7 @@ case T_OBJECT: _o()->print_value_on(st); - st->print(" <" INTPTR_FORMAT ">", (address)_o()); + st->print(" <" INTPTR_FORMAT ">", p2i((address)_o())); break; case T_CONFLICT:
--- a/src/share/vm/runtime/stubCodeGenerator.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/stubCodeGenerator.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -72,10 +72,10 @@ void StubCodeDesc::print_on(outputStream* st) const { - st->print(group()); + st->print("%s", group()); st->print("::"); - st->print(name()); - st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes()); + st->print("%s", name()); + st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", p2i(begin()), p2i(end()), size_in_bytes()); } // Implementation of StubCodeGenerator
--- a/src/share/vm/runtime/sweeper.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/sweeper.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -621,7 +621,7 @@ tty->vprint(format, ap); va_end(ap); } - tty->print_cr(s.as_string()); + tty->print_cr("%s", s.as_string()); } if (LogCompilation && (xtty != NULL)) { @@ -638,7 +638,7 @@ xtty->vprint(format, ap); va_end(ap); } - xtty->print(s.as_string()); + xtty->print("%s", s.as_string()); xtty->stamp(); xtty->end_elem(); }
--- a/src/share/vm/runtime/thread.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/thread.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -4289,7 +4289,7 @@ // Threads::print_on() is called at safepoint by VM_PrintThreads operation. void Threads::print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks) { char buf[32]; - st->print_cr(os::local_time_string(buf, sizeof(buf))); + st->print_cr("%s", os::local_time_string(buf, sizeof(buf))); st->print_cr("Full thread dump %s (%s %s):", Abstract_VM_Version::vm_name(),
--- a/src/share/vm/runtime/timer.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/timer.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -204,7 +204,7 @@ _logfile->print("[Error in TraceCPUTime]"); } if (_print_cr) { - _logfile->print_cr(""); + _logfile->cr(); } _logfile->flush(); }
--- a/src/share/vm/runtime/vframe.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/runtime/vframe.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -398,7 +398,7 @@ if (WizardMode) { tty->print_cr("Error in fill_from_frame: pc_desc for " INTPTR_FORMAT " not found or invalid at %d", - _frame.pc(), decode_offset); + p2i(_frame.pc()), decode_offset); nm()->print(); nm()->method()->print_codes(); nm()->print_code();
--- a/src/share/vm/services/attachListener.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/services/attachListener.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -288,15 +288,15 @@ } if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) { - FormatBuffer<80> err_msg(""); + FormatBuffer<80> err_msg("%s", ""); if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) { - out->print_cr(err_msg.buffer()); + out->print_cr("%s", err_msg.buffer()); return JNI_ERR; } } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) { - FormatBuffer<80> err_msg(""); + FormatBuffer<80> err_msg("%s", ""); if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) { - out->print_cr(err_msg.buffer()); + out->print_cr("%s", err_msg.buffer()); return JNI_ERR; } } @@ -385,7 +385,7 @@ Flag* f = Flag::find_flag((char*)name, strlen(name)); if (f) { f->print_as_flag(out); - out->print_cr(""); + out->cr(); } else { out->print_cr("no such flag '%s'", name); }
--- a/src/share/vm/services/diagnosticCommand.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/services/diagnosticCommand.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -90,7 +90,7 @@ if (factory != NULL) { output()->print_cr("%s%s", factory->name(), factory->is_enabled() ? "" : " [disabled]"); - output()->print_cr(factory->description()); + output()->print_cr("%s", factory->description()); output()->print_cr("\nImpact: %s", factory->impact()); output()->cr(); cmd = factory->create_resource_instance(output());
--- a/src/share/vm/services/diagnosticFramework.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/services/diagnosticFramework.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -259,7 +259,7 @@ } arg = arg->next(); } - out->print_cr(""); + out->cr(); if (_arguments_list != NULL) { out->print_cr("\nArguments:"); arg = _arguments_list; @@ -268,7 +268,7 @@ arg->is_mandatory() ? "" : "[optional]", arg->description(), arg->type()); if (arg->has_default()) { - out->print(arg->default_string()); + out->print("%s", arg->default_string()); } else { out->print("no default value"); } @@ -284,7 +284,7 @@ arg->is_mandatory() ? "" : "[optional]", arg->description(), arg->type()); if (arg->has_default()) { - out->print(arg->default_string()); + out->print("%s", arg->default_string()); } else { out->print("no default value"); }
--- a/src/share/vm/services/management.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/services/management.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -1802,12 +1802,12 @@ uintx uvalue = (uintx)new_value.j; if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) { - FormatBuffer<80> err_msg(""); + FormatBuffer<80> err_msg("%s", ""); if (!Arguments::verify_MaxHeapFreeRatio(err_msg, uvalue)) { THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer()); } } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) { - FormatBuffer<80> err_msg(""); + FormatBuffer<80> err_msg("%s", ""); if (!Arguments::verify_MinHeapFreeRatio(err_msg, uvalue)) { THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer()); }
--- a/src/share/vm/services/memSnapshot.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/services/memSnapshot.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -733,7 +733,7 @@ if (os::dll_address_to_function_name(ex->pc(), buf, sizeof(buf), NULL)) { tty->print_cr("\t%s", buf); } else { - tty->print_cr(""); + tty->cr(); } } }
--- a/src/share/vm/services/nmtDCmd.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/services/nmtDCmd.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 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 @@ -128,7 +128,7 @@ // native memory tracking has to be on if (!MemTracker::is_on() || MemTracker::shutdown_in_progress()) { // if it is not on, what's the reason? - output()->print_cr(MemTracker::reason()); + output()->print_cr("%s", MemTracker::reason()); return; }
--- a/src/share/vm/trace/traceStream.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/trace/traceStream.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 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 @@ -113,7 +113,7 @@ } void print(const char* val) { - _st.print(val); + _st.print("%s", val); } };
--- a/src/share/vm/utilities/bitMap.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/bitMap.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -525,7 +525,7 @@ #ifndef PRODUCT void BitMap::print_on(outputStream* st) const { - tty->print("Bitmap(%d):", size()); + tty->print("Bitmap(" SIZE_FORMAT "):", size()); for (idx_t index = 0; index < size(); index++) { tty->print("%c", at(index) ? '1' : '0'); }
--- a/src/share/vm/utilities/constantTag.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/constantTag.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -28,7 +28,7 @@ #ifndef PRODUCT void constantTag::print_on(outputStream* st) const { - st->print(internal_name()); + st->print("%s", internal_name()); } #endif // PRODUCT
--- a/src/share/vm/utilities/events.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/events.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -128,7 +128,7 @@ void print(outputStream* out, EventRecord<T>& e) { out->print("Event: %.3f ", e.timestamp); if (e.thread != NULL) { - out->print("Thread " INTPTR_FORMAT " ", e.thread); + out->print("Thread " INTPTR_FORMAT " ", p2i(e.thread)); } print(out, e.data); }
--- a/src/share/vm/utilities/globalDefinitions.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/globalDefinitions.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -1214,6 +1214,11 @@ return ((int)((unsigned int)high << 16) | (unsigned int)low); } +// Convert pointer to intptr_t, for use in printing pointers. +inline intptr_t p2i(const void * p) { + return (intptr_t) p; +} + // Printf-style formatters for fixed- and variable-width types as pointers and // integers. These are derived from the definitions in inttypes.h. If the platform // doesn't provide appropriate definitions, they should be provided in @@ -1232,6 +1237,7 @@ // Format 64-bit quantities. #define INT64_FORMAT "%" PRId64 #define UINT64_FORMAT "%" PRIu64 +#define UINT64_FORMAT_X "%" PRIx64 #define INT64_FORMAT_W(width) "%" #width PRId64 #define UINT64_FORMAT_W(width) "%" #width PRIu64 @@ -1254,6 +1260,8 @@ #define PTR_FORMAT "0x%08" PRIxPTR #endif // _LP64 +#define INTPTR_FORMAT_W(width) "%" #width PRIxPTR + #define SSIZE_FORMAT "%" PRIdPTR #define SIZE_FORMAT "%" PRIuPTR #define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
--- a/src/share/vm/utilities/globalDefinitions_gcc.hpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -281,6 +281,18 @@ #define PRAGMA_IMPLEMENTATION #pragma implementation #define VALUE_OBJ_CLASS_SPEC +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +// Tested to work with clang version 3.1 and better. +#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push") +#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop") +#else +// Old versions of gcc don't do push/pop, also do not cope with this pragma within a function +// One method does so much varied printing that it is decorated with both internal and external +// versions of the macro-pragma to obtain better checking with newer compilers. +#define PRAGMA_DIAG_PUSH +#define PRAGMA_DIAG_POP +#endif + #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95) #define TEMPLATE_TABLE_BUG #endif
--- a/src/share/vm/utilities/numberSeq.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/numberSeq.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -258,5 +258,5 @@ } s->print("\t[%d]=%7.3f", i, _sequence[i]); } - s->print_cr(""); + s->cr(); }
--- a/src/share/vm/utilities/ostream.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/ostream.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -268,7 +268,7 @@ size_t limit = (len + 16) / 16 * 16; for (size_t i = 0; i < limit; ++i) { if (i % 16 == 0) { - indent().print("%07x:", i); + indent().print(INTPTR_FORMAT_W(07)":", i); } if (i % 2 == 0) { print(" "); @@ -289,7 +289,7 @@ } } } - print_cr(""); + cr(); } } } @@ -559,7 +559,7 @@ // memory usage and command line flags into header void gcLogFileStream::dump_loggc_header() { if (is_open()) { - print_cr(Abstract_VM_Version::internal_vm_info_string()); + print_cr("%s", Abstract_VM_Version::internal_vm_info_string()); os::print_memory_info(this); print("CommandLine flags: "); CommandLineFlags::printSetFlags(this); @@ -647,7 +647,7 @@ write(time_msg, strlen(time_msg)); if (out != NULL) { - out->print(time_msg); + out->print("%s", time_msg); } dump_loggc_header(); @@ -683,7 +683,7 @@ write(time_msg, strlen(time_msg)); if (out != NULL) { - out->print(time_msg); + out->print("%s", time_msg); } fclose(_file); @@ -732,7 +732,7 @@ write(time_msg, strlen(time_msg)); if (out != NULL) { - out->print(time_msg); + out->print("%s", time_msg); } dump_loggc_header();
--- a/src/share/vm/utilities/quickSort.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/quickSort.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -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 @@ -73,7 +73,7 @@ for (int i = 0; i < length; i++) { tty->print(" %d", array[i]); } - tty->print_cr(""); + tty->cr(); } bool QuickSort::compare_arrays(int* actual, int* expected, int length) {
--- a/src/share/vm/utilities/vmError.cpp Thu Feb 08 00:59:32 2018 +0000 +++ b/src/share/vm/utilities/vmError.cpp Mon Feb 12 19:50:02 2018 +0000 @@ -357,17 +357,17 @@ if (_size) { st->print("# Native memory allocation (malloc) failed to allocate "); jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); - st->print(buf); + st->print("%s", buf); st->print(" bytes"); if (_message != NULL) { st->print(" for "); - st->print(_message); + st->print("%s", _message); } st->cr(); } else { if (_message != NULL) st->print("# "); - st->print_cr(_message); + st->print_cr("%s", _message); } // In error file give some solutions if (_verbose) { @@ -484,7 +484,7 @@ } else { st->print("Failed to write core dump. %s", coredump_message); } - st->print_cr(""); + st->cr(); st->print_cr("#"); STEP(65, "(printing bug submit message)")