Thu, 29 May 2014 09:56:06 -0700
Merge
1.1 --- a/.hgtags Wed May 28 12:07:21 2014 -0700 1.2 +++ b/.hgtags Thu May 29 09:56:06 2014 -0700 1.3 @@ -476,3 +476,7 @@ 1.4 798f5b02be897151fdad44d695446088b1cca6b1 hs25.20-b13 1.5 28bbbecff5f08c1e343fc0c40923c05d86b7cf82 hs25.20-b14 1.6 c20d8a452574c85c8fc1f7f2d4e788cd6b156bc9 jdk8u20-b14 1.7 +87bdb86f0aedbd9b9ef8e9999b273114c8be4748 hs25.20-b15 1.8 +8c785f9bde6f603cbd13eecd2ee6acd699b376f8 jdk8u20-b15 1.9 +50e5d560367b94275a91d5d579c32f1164eb5fa5 hs25.20-b16 1.10 +c36ef639e6d3c2d238f4e4f8b2f5803a60de8be8 jdk8u20-b16
2.1 --- a/agent/src/os/linux/libproc.h Wed May 28 12:07:21 2014 -0700 2.2 +++ b/agent/src/os/linux/libproc.h Thu May 29 09:56:06 2014 -0700 2.3 @@ -34,19 +34,7 @@ 2.4 #include "libproc_md.h" 2.5 #endif 2.6 2.7 -#if defined(sparc) || defined(sparcv9) 2.8 -/* 2.9 - If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64 2.10 - otherwise it should be from /usr/include/asm-sparc 2.11 - These two files define pt_regs structure differently 2.12 -*/ 2.13 -#ifdef _LP64 2.14 -#include "asm-sparc64/ptrace.h" 2.15 -#else 2.16 -#include "asm-sparc/ptrace.h" 2.17 -#endif 2.18 - 2.19 -#endif //sparc or sparcv9 2.20 +#include <linux/ptrace.h> 2.21 2.22 /************************************************************************************ 2.23
3.1 --- a/make/hotspot_version Wed May 28 12:07:21 2014 -0700 3.2 +++ b/make/hotspot_version Thu May 29 09:56:06 2014 -0700 3.3 @@ -35,7 +35,7 @@ 3.4 3.5 HS_MAJOR_VER=25 3.6 HS_MINOR_VER=20 3.7 -HS_BUILD_NUMBER=14 3.8 +HS_BUILD_NUMBER=16 3.9 3.10 JDK_MAJOR_VER=1 3.11 JDK_MINOR_VER=8
4.1 --- a/src/cpu/ppc/vm/vm_version_ppc.cpp Wed May 28 12:07:21 2014 -0700 4.2 +++ b/src/cpu/ppc/vm/vm_version_ppc.cpp Thu May 29 09:56:06 2014 -0700 4.3 @@ -1,5 +1,5 @@ 4.4 /* 4.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 4.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 4.7 * Copyright 2012, 2014 SAP AG. All rights reserved. 4.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.9 * 4.10 @@ -149,7 +149,7 @@ 4.11 } 4.12 4.13 void VM_Version::print_features() { 4.14 - tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), get_cache_line_size()); 4.15 + tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size()); 4.16 } 4.17 4.18 #ifdef COMPILER2
5.1 --- a/src/cpu/sparc/vm/frame_sparc.hpp Wed May 28 12:07:21 2014 -0700 5.2 +++ b/src/cpu/sparc/vm/frame_sparc.hpp Thu May 29 09:56:06 2014 -0700 5.3 @@ -259,8 +259,8 @@ 5.4 5.5 // next two fns read and write Lmonitors value, 5.6 private: 5.7 - BasicObjectLock* interpreter_frame_monitors() const { return *interpreter_frame_monitors_addr(); } 5.8 - void interpreter_frame_set_monitors(BasicObjectLock* monitors) { *interpreter_frame_monitors_addr() = monitors; } 5.9 + BasicObjectLock* interpreter_frame_monitors() const; 5.10 + void interpreter_frame_set_monitors(BasicObjectLock* monitors); 5.11 #else 5.12 public: 5.13 inline interpreterState get_interpreterState() const {
6.1 --- a/src/cpu/sparc/vm/frame_sparc.inline.hpp Wed May 28 12:07:21 2014 -0700 6.2 +++ b/src/cpu/sparc/vm/frame_sparc.inline.hpp Thu May 29 09:56:06 2014 -0700 6.3 @@ -226,6 +226,13 @@ 6.4 return (Method**)sp_addr_at( Lmethod->sp_offset_in_saved_window()); 6.5 } 6.6 6.7 +inline BasicObjectLock* frame::interpreter_frame_monitors() const { 6.8 + return *interpreter_frame_monitors_addr(); 6.9 +} 6.10 + 6.11 +inline void frame::interpreter_frame_set_monitors(BasicObjectLock* monitors) { 6.12 + *interpreter_frame_monitors_addr() = monitors; 6.13 +} 6.14 6.15 // Constant pool cache 6.16
7.1 --- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp Wed May 28 12:07:21 2014 -0700 7.2 +++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp Thu May 29 09:56:06 2014 -0700 7.3 @@ -83,7 +83,7 @@ 7.4 private: 7.5 7.6 #ifdef PRODUCT 7.7 -#define inc_counter_np(a,b,c) (0) 7.8 +#define inc_counter_np(a,b,c) 7.9 #else 7.10 #define inc_counter_np(counter, t1, t2) \ 7.11 BLOCK_COMMENT("inc_counter " #counter); \ 7.12 @@ -1055,7 +1055,7 @@ 7.13 Label& L_loop, bool use_prefetch, bool use_bis); 7.14 7.15 void disjoint_copy_core(Register from, Register to, Register count, int log2_elem_size, 7.16 - int iter_size, CopyLoopFunc copy_loop_func) { 7.17 + int iter_size, StubGenerator::CopyLoopFunc copy_loop_func) { 7.18 Label L_copy; 7.19 7.20 assert(log2_elem_size <= 3, "the following code should be changed"); 7.21 @@ -1206,7 +1206,7 @@ 7.22 __ inc(from, 8); 7.23 __ sllx(O3, left_shift, O3); 7.24 7.25 - disjoint_copy_core(from, to, count, log2_elem_size, 16, copy_16_bytes_shift_loop); 7.26 + disjoint_copy_core(from, to, count, log2_elem_size, 16, &StubGenerator::copy_16_bytes_shift_loop); 7.27 7.28 __ inccc(count, count_dec>>1 ); // + 8 bytes 7.29 __ brx(Assembler::negative, true, Assembler::pn, L_copy_last_bytes); 7.30 @@ -2085,7 +2085,7 @@ 7.31 __ dec(count, 4); // The cmp at the beginning guaranty count >= 4 7.32 __ sllx(O3, 32, O3); 7.33 7.34 - disjoint_copy_core(from, to, count, 2, 16, copy_16_bytes_loop); 7.35 + disjoint_copy_core(from, to, count, 2, 16, &StubGenerator::copy_16_bytes_loop); 7.36 7.37 __ br(Assembler::always, false, Assembler::pt, L_copy_4_bytes); 7.38 __ delayed()->inc(count, 4); // restore 'count' 7.39 @@ -2366,7 +2366,7 @@ 7.40 // count >= 0 (original count - 8) 7.41 __ mov(from, from64); 7.42 7.43 - disjoint_copy_core(from64, to64, count, 3, 64, copy_64_bytes_loop); 7.44 + disjoint_copy_core(from64, to64, count, 3, 64, &StubGenerator::copy_64_bytes_loop); 7.45 7.46 // Restore O4(offset0), O5(offset8) 7.47 __ sub(from64, from, offset0);
8.1 --- a/src/cpu/sparc/vm/vm_version_sparc.cpp Wed May 28 12:07:21 2014 -0700 8.2 +++ b/src/cpu/sparc/vm/vm_version_sparc.cpp Thu May 29 09:56:06 2014 -0700 8.3 @@ -318,22 +318,22 @@ 8.4 tty->print("BIS"); 8.5 } 8.6 if (AllocatePrefetchLines > 1) { 8.7 - tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize); 8.8 + tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize); 8.9 } else { 8.10 - tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize); 8.11 + tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize); 8.12 } 8.13 } 8.14 if (PrefetchCopyIntervalInBytes > 0) { 8.15 - tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes); 8.16 + tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes); 8.17 } 8.18 if (PrefetchScanIntervalInBytes > 0) { 8.19 - tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes); 8.20 + tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes); 8.21 } 8.22 if (PrefetchFieldsAhead > 0) { 8.23 - tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead); 8.24 + tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead); 8.25 } 8.26 if (ContendedPaddingWidth > 0) { 8.27 - tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth); 8.28 + tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth); 8.29 } 8.30 } 8.31 #endif // PRODUCT
9.1 --- a/src/cpu/x86/vm/assembler_x86.cpp Wed May 28 12:07:21 2014 -0700 9.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp Thu May 29 09:56:06 2014 -0700 9.3 @@ -1,5 +1,5 @@ 9.4 /* 9.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 9.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 9.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.8 * 9.9 * This code is free software; you can redistribute it and/or modify it 9.10 @@ -522,11 +522,11 @@ 9.11 // these asserts are somewhat nonsensical 9.12 #ifndef _LP64 9.13 assert(which == imm_operand || which == disp32_operand, 9.14 - err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip)); 9.15 + err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip))); 9.16 #else 9.17 assert((which == call32_operand || which == imm_operand) && is_64bit || 9.18 which == narrow_oop_operand && !is_64bit, 9.19 - err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip)); 9.20 + err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip))); 9.21 #endif // _LP64 9.22 return ip; 9.23
10.1 --- a/src/cpu/x86/vm/c1_LinearScan_x86.cpp Wed May 28 12:07:21 2014 -0700 10.2 +++ b/src/cpu/x86/vm/c1_LinearScan_x86.cpp Thu May 29 09:56:06 2014 -0700 10.3 @@ -1,5 +1,5 @@ 10.4 /* 10.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 10.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 10.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 10.8 * 10.9 * This code is free software; you can redistribute it and/or modify it 10.10 @@ -95,7 +95,7 @@ 10.11 10.12 #ifndef PRODUCT 10.13 if (TraceFPURegisterUsage) { 10.14 - tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->print_cr(""); 10.15 + tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->cr(); 10.16 } 10.17 #endif 10.18 }
11.1 --- a/src/cpu/x86/vm/compiledIC_x86.cpp Wed May 28 12:07:21 2014 -0700 11.2 +++ b/src/cpu/x86/vm/compiledIC_x86.cpp Thu May 29 09:56:06 2014 -0700 11.3 @@ -1,5 +1,5 @@ 11.4 /* 11.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 11.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 11.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 11.8 * 11.9 * This code is free software; you can redistribute it and/or modify it 11.10 @@ -122,7 +122,7 @@ 11.11 if (TraceICs) { 11.12 ResourceMark rm; 11.13 tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", 11.14 - instruction_address(), 11.15 + p2i(instruction_address()), 11.16 callee->name_and_sig_as_C_string()); 11.17 } 11.18
12.1 --- a/src/cpu/x86/vm/frame_x86.cpp Wed May 28 12:07:21 2014 -0700 12.2 +++ b/src/cpu/x86/vm/frame_x86.cpp Thu May 29 09:56:06 2014 -0700 12.3 @@ -1,5 +1,5 @@ 12.4 /* 12.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 12.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 12.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 12.8 * 12.9 * This code is free software; you can redistribute it and/or modify it 12.10 @@ -48,6 +48,7 @@ 12.11 } 12.12 #endif 12.13 12.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 12.15 12.16 // Profiling/safepoint support 12.17
13.1 --- a/src/cpu/x86/vm/interpreter_x86_64.cpp Wed May 28 12:07:21 2014 -0700 13.2 +++ b/src/cpu/x86/vm/interpreter_x86_64.cpp Thu May 29 09:56:06 2014 -0700 13.3 @@ -1,5 +1,5 @@ 13.4 /* 13.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 13.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 13.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 13.8 * 13.9 * This code is free software; you can redistribute it and/or modify it 13.10 @@ -51,6 +51,7 @@ 13.11 13.12 #define __ _masm-> 13.13 13.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 13.15 13.16 #ifdef _WIN64 13.17 address AbstractInterpreterGenerator::generate_slow_signature_handler() {
14.1 --- a/src/cpu/x86/vm/macroAssembler_x86.cpp Wed May 28 12:07:21 2014 -0700 14.2 +++ b/src/cpu/x86/vm/macroAssembler_x86.cpp Thu May 29 09:56:06 2014 -0700 14.3 @@ -1,5 +1,5 @@ 14.4 /* 14.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 14.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 14.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 14.8 * 14.9 * This code is free software; you can redistribute it and/or modify it 14.10 @@ -55,6 +55,7 @@ 14.11 14.12 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":") 14.13 14.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 14.15 14.16 #ifdef ASSERT 14.17 bool AbstractAssembler::pd_check_instruction_mark() { return true; } 14.18 @@ -3152,10 +3153,12 @@ 14.19 // if fast computation is not possible, result is NaN. Requires 14.20 // fallback from user of this macro. 14.21 // increase precision for intermediate steps of the computation 14.22 + BLOCK_COMMENT("fast_pow {"); 14.23 increase_precision(); 14.24 fyl2x(); // Stack: (Y*log2(X)) ... 14.25 pow_exp_core_encoding(); // Stack: exp(X) ... 14.26 restore_precision(); 14.27 + BLOCK_COMMENT("} fast_pow"); 14.28 } 14.29 14.30 void MacroAssembler::fast_exp() {
15.1 --- a/src/cpu/x86/vm/methodHandles_x86.cpp Wed May 28 12:07:21 2014 -0700 15.2 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp Thu May 29 09:56:06 2014 -0700 15.3 @@ -1,5 +1,5 @@ 15.4 /* 15.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 15.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 15.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 15.8 * 15.9 * This code is free software; you can redistribute it and/or modify it 15.10 @@ -29,6 +29,8 @@ 15.11 #include "memory/allocation.inline.hpp" 15.12 #include "prims/methodHandles.hpp" 15.13 15.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 15.15 + 15.16 #define __ _masm-> 15.17 15.18 #ifdef PRODUCT
16.1 --- a/src/cpu/x86/vm/nativeInst_x86.cpp Wed May 28 12:07:21 2014 -0700 16.2 +++ b/src/cpu/x86/vm/nativeInst_x86.cpp Thu May 29 09:56:06 2014 -0700 16.3 @@ -1,5 +1,5 @@ 16.4 /* 16.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 16.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 16.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 16.8 * 16.9 * This code is free software; you can redistribute it and/or modify it 16.10 @@ -35,6 +35,8 @@ 16.11 #include "c1/c1_Runtime1.hpp" 16.12 #endif 16.13 16.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 16.15 + 16.16 void NativeInstruction::wrote(int offset) { 16.17 ICache::invalidate_word(addr_at(offset)); 16.18 }
17.1 --- a/src/cpu/x86/vm/vm_version_x86.cpp Wed May 28 12:07:21 2014 -0700 17.2 +++ b/src/cpu/x86/vm/vm_version_x86.cpp Thu May 29 09:56:06 2014 -0700 17.3 @@ -1,5 +1,5 @@ 17.4 /* 17.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 17.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 17.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 17.8 * 17.9 * This code is free software; you can redistribute it and/or modify it 17.10 @@ -925,16 +925,16 @@ 17.11 if (PrintMiscellaneous && Verbose) { 17.12 tty->print_cr("Logical CPUs per core: %u", 17.13 logical_processors_per_package()); 17.14 - tty->print("UseSSE=%d",UseSSE); 17.15 + tty->print("UseSSE=%d", (int) UseSSE); 17.16 if (UseAVX > 0) { 17.17 - tty->print(" UseAVX=%d",UseAVX); 17.18 + tty->print(" UseAVX=%d", (int) UseAVX); 17.19 } 17.20 if (UseAES) { 17.21 tty->print(" UseAES=1"); 17.22 } 17.23 #ifdef COMPILER2 17.24 if (MaxVectorSize > 0) { 17.25 - tty->print(" MaxVectorSize=%d", MaxVectorSize); 17.26 + tty->print(" MaxVectorSize=%d", (int) MaxVectorSize); 17.27 } 17.28 #endif 17.29 tty->cr(); 17.30 @@ -957,23 +957,23 @@ 17.31 } 17.32 } 17.33 if (AllocatePrefetchLines > 1) { 17.34 - tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize); 17.35 + tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize); 17.36 } else { 17.37 - tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize); 17.38 + tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize); 17.39 } 17.40 } 17.41 17.42 if (PrefetchCopyIntervalInBytes > 0) { 17.43 - tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes); 17.44 + tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes); 17.45 } 17.46 if (PrefetchScanIntervalInBytes > 0) { 17.47 - tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes); 17.48 + tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes); 17.49 } 17.50 if (PrefetchFieldsAhead > 0) { 17.51 - tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead); 17.52 + tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead); 17.53 } 17.54 if (ContendedPaddingWidth > 0) { 17.55 - tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth); 17.56 + tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth); 17.57 } 17.58 } 17.59 #endif // !PRODUCT
18.1 --- a/src/cpu/x86/vm/vtableStubs_x86_32.cpp Wed May 28 12:07:21 2014 -0700 18.2 +++ b/src/cpu/x86/vm/vtableStubs_x86_32.cpp Thu May 29 09:56:06 2014 -0700 18.3 @@ -1,5 +1,5 @@ 18.4 /* 18.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 18.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 18.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 18.8 * 18.9 * This code is free software; you can redistribute it and/or modify it 18.10 @@ -118,7 +118,7 @@ 18.11 18.12 if (PrintMiscellaneous && (WizardMode || Verbose)) { 18.13 tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d", 18.14 - vtable_index, s->entry_point(), 18.15 + vtable_index, p2i(s->entry_point()), 18.16 (int)(s->code_end() - s->entry_point()), 18.17 (int)(s->code_end() - __ pc())); 18.18 } 18.19 @@ -199,7 +199,7 @@ 18.20 18.21 if (PrintMiscellaneous && (WizardMode || Verbose)) { 18.22 tty->print_cr("itable #%d at "PTR_FORMAT"[%d] left over: %d", 18.23 - itable_index, s->entry_point(), 18.24 + itable_index, p2i(s->entry_point()), 18.25 (int)(s->code_end() - s->entry_point()), 18.26 (int)(s->code_end() - __ pc())); 18.27 }
19.1 --- a/src/cpu/x86/vm/vtableStubs_x86_64.cpp Wed May 28 12:07:21 2014 -0700 19.2 +++ b/src/cpu/x86/vm/vtableStubs_x86_64.cpp Thu May 29 09:56:06 2014 -0700 19.3 @@ -1,5 +1,5 @@ 19.4 /* 19.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 19.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 19.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 19.8 * 19.9 * This code is free software; you can redistribute it and/or modify it 19.10 @@ -35,6 +35,8 @@ 19.11 #include "opto/runtime.hpp" 19.12 #endif 19.13 19.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 19.15 + 19.16 // machine-dependent part of VtableStubs: create VtableStub of correct size and 19.17 // initialize its code 19.18
20.1 --- a/src/os/bsd/vm/decoder_machO.cpp Wed May 28 12:07:21 2014 -0700 20.2 +++ b/src/os/bsd/vm/decoder_machO.cpp Thu May 29 09:56:06 2014 -0700 20.3 @@ -1,5 +1,5 @@ 20.4 /* 20.5 - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 20.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 20.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 20.8 * 20.9 * This code is free software; you can redistribute it and/or modify it 20.10 @@ -53,7 +53,7 @@ 20.11 struct symtab_command * symt = (struct symtab_command *) 20.12 mach_find_command((struct mach_header_64 *)mach_base, LC_SYMTAB); 20.13 if (symt == NULL) { 20.14 - DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", mach_base)); 20.15 + DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", p2i(mach_base))); 20.16 return false; 20.17 } 20.18 uint32_t off = symt->symoff; /* symbol table offset (within this mach file) */
21.1 --- a/src/os/bsd/vm/os_bsd.cpp Wed May 28 12:07:21 2014 -0700 21.2 +++ b/src/os/bsd/vm/os_bsd.cpp Thu May 29 09:56:06 2014 -0700 21.3 @@ -123,12 +123,19 @@ 21.4 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF) 21.5 21.6 #define LARGEPAGES_BIT (1 << 6) 21.7 + 21.8 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 21.9 + 21.10 //////////////////////////////////////////////////////////////////////////////// 21.11 // global variables 21.12 julong os::Bsd::_physical_memory = 0; 21.13 21.14 - 21.15 +#ifdef __APPLE__ 21.16 +mach_timebase_info_data_t os::Bsd::_timebase_info = {0, 0}; 21.17 +volatile uint64_t os::Bsd::_max_abstime = 0; 21.18 +#else 21.19 int (*os::Bsd::_clock_gettime)(clockid_t, struct timespec *) = NULL; 21.20 +#endif 21.21 pthread_t os::Bsd::_main_thread; 21.22 int os::Bsd::_page_size = -1; 21.23 21.24 @@ -986,13 +993,15 @@ 21.25 return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); 21.26 } 21.27 21.28 +#ifndef __APPLE__ 21.29 #ifndef CLOCK_MONOTONIC 21.30 #define CLOCK_MONOTONIC (1) 21.31 #endif 21.32 +#endif 21.33 21.34 #ifdef __APPLE__ 21.35 void os::Bsd::clock_init() { 21.36 - // XXXDARWIN: Investigate replacement monotonic clock 21.37 + mach_timebase_info(&_timebase_info); 21.38 } 21.39 #else 21.40 void os::Bsd::clock_init() { 21.41 @@ -1007,10 +1016,38 @@ 21.42 #endif 21.43 21.44 21.45 +#ifdef __APPLE__ 21.46 + 21.47 +jlong os::javaTimeNanos() { 21.48 + const uint64_t tm = mach_absolute_time(); 21.49 + const uint64_t now = (tm * Bsd::_timebase_info.numer) / Bsd::_timebase_info.denom; 21.50 + const uint64_t prev = Bsd::_max_abstime; 21.51 + if (now <= prev) { 21.52 + return prev; // same or retrograde time; 21.53 + } 21.54 + const uint64_t obsv = Atomic::cmpxchg(now, (volatile jlong*)&Bsd::_max_abstime, prev); 21.55 + assert(obsv >= prev, "invariant"); // Monotonicity 21.56 + // If the CAS succeeded then we're done and return "now". 21.57 + // If the CAS failed and the observed value "obsv" is >= now then 21.58 + // we should return "obsv". If the CAS failed and now > obsv > prv then 21.59 + // some other thread raced this thread and installed a new value, in which case 21.60 + // we could either (a) retry the entire operation, (b) retry trying to install now 21.61 + // or (c) just return obsv. We use (c). No loop is required although in some cases 21.62 + // we might discard a higher "now" value in deference to a slightly lower but freshly 21.63 + // installed obsv value. That's entirely benign -- it admits no new orderings compared 21.64 + // to (a) or (b) -- and greatly reduces coherence traffic. 21.65 + // We might also condition (c) on the magnitude of the delta between obsv and now. 21.66 + // Avoiding excessive CAS operations to hot RW locations is critical. 21.67 + // See https://blogs.oracle.com/dave/entry/cas_and_cache_trivia_invalidate 21.68 + return (prev == obsv) ? now : obsv; 21.69 +} 21.70 + 21.71 +#else // __APPLE__ 21.72 + 21.73 jlong os::javaTimeNanos() { 21.74 if (Bsd::supports_monotonic_clock()) { 21.75 struct timespec tp; 21.76 - int status = Bsd::clock_gettime(CLOCK_MONOTONIC, &tp); 21.77 + int status = Bsd::_clock_gettime(CLOCK_MONOTONIC, &tp); 21.78 assert(status == 0, "gettime error"); 21.79 jlong result = jlong(tp.tv_sec) * (1000 * 1000 * 1000) + jlong(tp.tv_nsec); 21.80 return result; 21.81 @@ -1023,6 +1060,8 @@ 21.82 } 21.83 } 21.84 21.85 +#endif // __APPLE__ 21.86 + 21.87 void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) { 21.88 if (Bsd::supports_monotonic_clock()) { 21.89 info_ptr->max_value = ALL_64_BITS; 21.90 @@ -2351,7 +2390,6 @@ 21.91 (!FLAG_IS_DEFAULT(UseLargePages) || 21.92 !FLAG_IS_DEFAULT(LargePageSizeInBytes) 21.93 ); 21.94 - char msg[128]; 21.95 21.96 // Create a large shared memory region to attach to based on size. 21.97 // Currently, size is the total size of the heap 21.98 @@ -2372,8 +2410,7 @@ 21.99 // coalesce into large pages. Try to reserve large pages when 21.100 // the system is still "fresh". 21.101 if (warn_on_failure) { 21.102 - jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno); 21.103 - warning(msg); 21.104 + warning("Failed to reserve shared memory (errno = %d).", errno); 21.105 } 21.106 return NULL; 21.107 } 21.108 @@ -2390,8 +2427,7 @@ 21.109 21.110 if ((intptr_t)addr == -1) { 21.111 if (warn_on_failure) { 21.112 - jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err); 21.113 - warning(msg); 21.114 + warning("Failed to attach shared memory (errno = %d).", err); 21.115 } 21.116 return NULL; 21.117 } 21.118 @@ -3890,6 +3926,7 @@ 21.119 return true; 21.120 } 21.121 21.122 +ATTRIBUTE_PRINTF(3, 0) 21.123 int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) { 21.124 return ::vsnprintf(buf, count, format, args); 21.125 }
22.1 --- a/src/os/bsd/vm/os_bsd.hpp Wed May 28 12:07:21 2014 -0700 22.2 +++ b/src/os/bsd/vm/os_bsd.hpp Thu May 29 09:56:06 2014 -0700 22.3 @@ -58,7 +58,13 @@ 22.4 // For signal flags diagnostics 22.5 static int sigflags[MAXSIGNUM]; 22.6 22.7 +#ifdef __APPLE__ 22.8 + // mach_absolute_time 22.9 + static mach_timebase_info_data_t _timebase_info; 22.10 + static volatile uint64_t _max_abstime; 22.11 +#else 22.12 static int (*_clock_gettime)(clockid_t, struct timespec *); 22.13 +#endif 22.14 22.15 static GrowableArray<int>* _cpu_to_node; 22.16 22.17 @@ -135,11 +141,11 @@ 22.18 static void clock_init(void); 22.19 22.20 static inline bool supports_monotonic_clock() { 22.21 +#ifdef __APPLE__ 22.22 + return true; 22.23 +#else 22.24 return _clock_gettime != NULL; 22.25 - } 22.26 - 22.27 - static int clock_gettime(clockid_t clock_id, struct timespec *tp) { 22.28 - return _clock_gettime ? _clock_gettime(clock_id, tp) : -1; 22.29 +#endif 22.30 } 22.31 22.32 // Stack repair handling
23.1 --- a/src/os/bsd/vm/perfMemory_bsd.cpp Wed May 28 12:07:21 2014 -0700 23.2 +++ b/src/os/bsd/vm/perfMemory_bsd.cpp Thu May 29 09:56:06 2014 -0700 23.3 @@ -1,5 +1,5 @@ 23.4 /* 23.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 23.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 23.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 23.8 * 23.9 * This code is free software; you can redistribute it and/or modify it 23.10 @@ -925,7 +925,7 @@ 23.11 23.12 if (PerfTraceMemOps) { 23.13 tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at " 23.14 - INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress); 23.15 + INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress)); 23.16 } 23.17 } 23.18
24.1 --- a/src/os/linux/vm/os_linux.cpp Wed May 28 12:07:21 2014 -0700 24.2 +++ b/src/os/linux/vm/os_linux.cpp Thu May 29 09:56:06 2014 -0700 24.3 @@ -101,6 +101,8 @@ 24.4 # include <inttypes.h> 24.5 # include <sys/ioctl.h> 24.6 24.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 24.8 + 24.9 // if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling 24.10 // getrusage() is prepared to handle the associated failure. 24.11 #ifndef RUSAGE_THREAD 24.12 @@ -2134,7 +2136,7 @@ 24.13 // Print warning if unsafe chroot environment detected 24.14 if (unsafe_chroot_detected) { 24.15 st->print("WARNING!! "); 24.16 - st->print_cr(unstable_chroot_error); 24.17 + st->print_cr("%s", unstable_chroot_error); 24.18 } 24.19 24.20 os::Linux::print_libversion_info(st); 24.21 @@ -2195,8 +2197,8 @@ 24.22 void os::Linux::print_libversion_info(outputStream* st) { 24.23 // libc, pthread 24.24 st->print("libc:"); 24.25 - st->print(os::Linux::glibc_version()); st->print(" "); 24.26 - st->print(os::Linux::libpthread_version()); st->print(" "); 24.27 + st->print("%s ", os::Linux::glibc_version()); 24.28 + st->print("%s ", os::Linux::libpthread_version()); 24.29 if (os::Linux::is_LinuxThreads()) { 24.30 st->print("(%s stack)", os::Linux::is_floating_stack() ? "floating" : "fixed"); 24.31 } 24.32 @@ -3413,7 +3415,7 @@ 24.33 // the system is still "fresh". 24.34 if (warn_on_failure) { 24.35 jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno); 24.36 - warning(msg); 24.37 + warning("%s", msg); 24.38 } 24.39 return NULL; 24.40 } 24.41 @@ -3431,7 +3433,7 @@ 24.42 if ((intptr_t)addr == -1) { 24.43 if (warn_on_failure) { 24.44 jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err); 24.45 - warning(msg); 24.46 + warning("%s", msg); 24.47 } 24.48 return NULL; 24.49 } 24.50 @@ -3451,7 +3453,7 @@ 24.51 char msg[128]; 24.52 jio_snprintf(msg, sizeof(msg), "Failed to reserve large pages memory req_addr: " 24.53 PTR_FORMAT " bytes: " SIZE_FORMAT " (errno = %d).", req_addr, bytes, error); 24.54 - warning(msg); 24.55 + warning("%s", msg); 24.56 } 24.57 } 24.58 24.59 @@ -5390,6 +5392,8 @@ 24.60 // -1 on error. 24.61 // 24.62 24.63 +PRAGMA_DIAG_PUSH 24.64 +PRAGMA_FORMAT_NONLITERAL_IGNORED 24.65 static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { 24.66 static bool proc_task_unchecked = true; 24.67 static const char *proc_stat_path = "/proc/%d/stat"; 24.68 @@ -5451,6 +5455,7 @@ 24.69 return (jlong)user_time * (1000000000 / clock_tics_per_sec); 24.70 } 24.71 } 24.72 +PRAGMA_DIAG_POP 24.73 24.74 void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) { 24.75 info_ptr->max_value = ALL_64_BITS; // will not wrap in less than 64 bits
25.1 --- a/src/os/linux/vm/perfMemory_linux.cpp Wed May 28 12:07:21 2014 -0700 25.2 +++ b/src/os/linux/vm/perfMemory_linux.cpp Thu May 29 09:56:06 2014 -0700 25.3 @@ -931,7 +931,7 @@ 25.4 25.5 if (PerfTraceMemOps) { 25.6 tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at " 25.7 - INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress); 25.8 + INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress)); 25.9 } 25.10 } 25.11
26.1 --- a/src/os/posix/vm/os_posix.cpp Wed May 28 12:07:21 2014 -0700 26.2 +++ b/src/os/posix/vm/os_posix.cpp Thu May 29 09:56:06 2014 -0700 26.3 @@ -1,5 +1,5 @@ 26.4 /* 26.5 -* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 26.6 +* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 26.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 26.8 * 26.9 * This code is free software; you can redistribute it and/or modify it 26.10 @@ -35,6 +35,8 @@ 26.11 #include <pthread.h> 26.12 #include <signal.h> 26.13 26.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 26.15 + 26.16 // Todo: provide a os::get_max_process_id() or similar. Number of processes 26.17 // may have been configured, can be read more accurately from proc fs etc. 26.18 #ifndef MAX_PID 26.19 @@ -191,10 +193,10 @@ 26.20 st->print("uname:"); 26.21 struct utsname name; 26.22 uname(&name); 26.23 - st->print(name.sysname); st->print(" "); 26.24 - st->print(name.release); st->print(" "); 26.25 - st->print(name.version); st->print(" "); 26.26 - st->print(name.machine); 26.27 + st->print("%s ", name.sysname); 26.28 + st->print("%s ", name.release); 26.29 + st->print("%s ", name.version); 26.30 + st->print("%s", name.machine); 26.31 st->cr(); 26.32 } 26.33 26.34 @@ -552,7 +554,7 @@ 26.35 void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) { 26.36 char buf[NUM_IMPORTANT_SIGS + 1]; 26.37 os::Posix::describe_signal_set_short(set, buf, sizeof(buf)); 26.38 - st->print(buf); 26.39 + st->print("%s", buf); 26.40 } 26.41 26.42 // Writes one-line description of a combination of sigaction.sa_flags into a user 26.43 @@ -612,7 +614,7 @@ 26.44 void os::Posix::print_sa_flags(outputStream* st, int flags) { 26.45 char buffer[0x100]; 26.46 os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer)); 26.47 - st->print(buffer); 26.48 + st->print("%s", buffer); 26.49 } 26.50 26.51 // Helper function for os::Posix::print_siginfo_...():
27.1 --- a/src/os/solaris/vm/os_solaris.cpp Wed May 28 12:07:21 2014 -0700 27.2 +++ b/src/os/solaris/vm/os_solaris.cpp Thu May 29 09:56:06 2014 -0700 27.3 @@ -415,11 +415,7 @@ 27.4 27.5 static hrtime_t first_hrtime = 0; 27.6 static const hrtime_t hrtime_hz = 1000*1000*1000; 27.7 -const int LOCK_BUSY = 1; 27.8 -const int LOCK_FREE = 0; 27.9 -const int LOCK_INVALID = -1; 27.10 static volatile hrtime_t max_hrtime = 0; 27.11 -static volatile int max_hrtime_lock = LOCK_FREE; // Update counter with LSB as lock-in-progress 27.12 27.13 27.14 void os::Solaris::initialize_system_info() { 27.15 @@ -1534,58 +1530,31 @@ 27.16 } 27.17 27.18 27.19 -// gethrtime can move backwards if read from one cpu and then a different cpu 27.20 -// getTimeNanos is guaranteed to not move backward on Solaris 27.21 -// local spinloop created as faster for a CAS on an int than 27.22 -// a CAS on a 64bit jlong. Also Atomic::cmpxchg for jlong is not 27.23 -// supported on sparc v8 or pre supports_cx8 intel boxes. 27.24 -// oldgetTimeNanos for systems which do not support CAS on 64bit jlong 27.25 -// i.e. sparc v8 and pre supports_cx8 (i486) intel boxes 27.26 -inline hrtime_t oldgetTimeNanos() { 27.27 - int gotlock = LOCK_INVALID; 27.28 - hrtime_t newtime = gethrtime(); 27.29 - 27.30 - for (;;) { 27.31 -// grab lock for max_hrtime 27.32 - int curlock = max_hrtime_lock; 27.33 - if (curlock & LOCK_BUSY) continue; 27.34 - if (gotlock = Atomic::cmpxchg(LOCK_BUSY, &max_hrtime_lock, LOCK_FREE) != LOCK_FREE) continue; 27.35 - if (newtime > max_hrtime) { 27.36 - max_hrtime = newtime; 27.37 - } else { 27.38 - newtime = max_hrtime; 27.39 - } 27.40 - // release lock 27.41 - max_hrtime_lock = LOCK_FREE; 27.42 - return newtime; 27.43 - } 27.44 -} 27.45 -// gethrtime can move backwards if read from one cpu and then a different cpu 27.46 -// getTimeNanos is guaranteed to not move backward on Solaris 27.47 +// gethrtime() should be monotonic according to the documentation, 27.48 +// but some virtualized platforms are known to break this guarantee. 27.49 +// getTimeNanos() must be guaranteed not to move backwards, so we 27.50 +// are forced to add a check here. 27.51 inline hrtime_t getTimeNanos() { 27.52 - if (VM_Version::supports_cx8()) { 27.53 - const hrtime_t now = gethrtime(); 27.54 - // Use atomic long load since 32-bit x86 uses 2 registers to keep long. 27.55 - const hrtime_t prev = Atomic::load((volatile jlong*)&max_hrtime); 27.56 - if (now <= prev) return prev; // same or retrograde time; 27.57 - const hrtime_t obsv = Atomic::cmpxchg(now, (volatile jlong*)&max_hrtime, prev); 27.58 - assert(obsv >= prev, "invariant"); // Monotonicity 27.59 - // If the CAS succeeded then we're done and return "now". 27.60 - // If the CAS failed and the observed value "obs" is >= now then 27.61 - // we should return "obs". If the CAS failed and now > obs > prv then 27.62 - // some other thread raced this thread and installed a new value, in which case 27.63 - // we could either (a) retry the entire operation, (b) retry trying to install now 27.64 - // or (c) just return obs. We use (c). No loop is required although in some cases 27.65 - // we might discard a higher "now" value in deference to a slightly lower but freshly 27.66 - // installed obs value. That's entirely benign -- it admits no new orderings compared 27.67 - // to (a) or (b) -- and greatly reduces coherence traffic. 27.68 - // We might also condition (c) on the magnitude of the delta between obs and now. 27.69 - // Avoiding excessive CAS operations to hot RW locations is critical. 27.70 - // See http://blogs.sun.com/dave/entry/cas_and_cache_trivia_invalidate 27.71 - return (prev == obsv) ? now : obsv ; 27.72 - } else { 27.73 - return oldgetTimeNanos(); 27.74 - } 27.75 + const hrtime_t now = gethrtime(); 27.76 + const hrtime_t prev = max_hrtime; 27.77 + if (now <= prev) { 27.78 + return prev; // same or retrograde time; 27.79 + } 27.80 + const hrtime_t obsv = Atomic::cmpxchg(now, (volatile jlong*)&max_hrtime, prev); 27.81 + assert(obsv >= prev, "invariant"); // Monotonicity 27.82 + // If the CAS succeeded then we're done and return "now". 27.83 + // If the CAS failed and the observed value "obsv" is >= now then 27.84 + // we should return "obsv". If the CAS failed and now > obsv > prv then 27.85 + // some other thread raced this thread and installed a new value, in which case 27.86 + // we could either (a) retry the entire operation, (b) retry trying to install now 27.87 + // or (c) just return obsv. We use (c). No loop is required although in some cases 27.88 + // we might discard a higher "now" value in deference to a slightly lower but freshly 27.89 + // installed obsv value. That's entirely benign -- it admits no new orderings compared 27.90 + // to (a) or (b) -- and greatly reduces coherence traffic. 27.91 + // We might also condition (c) on the magnitude of the delta between obsv and now. 27.92 + // Avoiding excessive CAS operations to hot RW locations is critical. 27.93 + // See https://blogs.oracle.com/dave/entry/cas_and_cache_trivia_invalidate 27.94 + return (prev == obsv) ? now : obsv; 27.95 } 27.96 27.97 // Time since start-up in seconds to a fine granularity.
28.1 --- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Wed May 28 12:07:21 2014 -0700 28.2 +++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Thu May 29 09:56:06 2014 -0700 28.3 @@ -1,5 +1,5 @@ 28.4 /* 28.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 28.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 28.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 28.8 * 28.9 * This code is free software; you can redistribute it and/or modify it 28.10 @@ -276,6 +276,8 @@ 28.11 # endif 28.12 #endif 28.13 28.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 28.15 + 28.16 address os::current_stack_pointer() { 28.17 #if defined(__clang__) || defined(__llvm__) 28.18 register void *esp;
29.1 --- a/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp Wed May 28 12:07:21 2014 -0700 29.2 +++ b/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp Thu May 29 09:56:06 2014 -0700 29.3 @@ -78,12 +78,12 @@ 29.4 __asm__ volatile( 29.5 "1: \n\t" 29.6 " ldx [%2], %%o2\n\t" 29.7 - " add %0, %%o2, %%o3\n\t" 29.8 + " add %1, %%o2, %%o3\n\t" 29.9 " casx [%2], %%o2, %%o3\n\t" 29.10 " cmp %%o2, %%o3\n\t" 29.11 " bne %%xcc, 1b\n\t" 29.12 " nop\n\t" 29.13 - " add %0, %%o2, %0\n\t" 29.14 + " add %1, %%o2, %0\n\t" 29.15 : "=r" (rv) 29.16 : "r" (add_value), "r" (dest) 29.17 : "memory", "o2", "o3");
30.1 --- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Wed May 28 12:07:21 2014 -0700 30.2 +++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Thu May 29 09:56:06 2014 -0700 30.3 @@ -302,29 +302,30 @@ 30.4 if (context == NULL) return; 30.5 30.6 ucontext_t *uc = (ucontext_t*)context; 30.7 + sigcontext* sc = (sigcontext*)context; 30.8 intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc); 30.9 30.10 st->print_cr("Register to memory mapping:"); 30.11 st->cr(); 30.12 30.13 // this is only for the "general purpose" registers 30.14 - st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON__G1]); 30.15 - st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON__G2]); 30.16 - st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON__G3]); 30.17 - st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON__G4]); 30.18 - st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON__G5]); 30.19 - st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON__G6]); 30.20 - st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON__G7]); 30.21 + st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON_G1]); 30.22 + st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON_G2]); 30.23 + st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON_G3]); 30.24 + st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON_G4]); 30.25 + st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON_G5]); 30.26 + st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON_G6]); 30.27 + st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON_G7]); 30.28 st->cr(); 30.29 30.30 - st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON__O0]); 30.31 - st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON__O1]); 30.32 - st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON__O2]); 30.33 - st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON__O3]); 30.34 - st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON__O4]); 30.35 - st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON__O5]); 30.36 - st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON__O6]); 30.37 - st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON__O7]); 30.38 + st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON_O0]); 30.39 + st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON_O1]); 30.40 + st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON_O2]); 30.41 + st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON_O3]); 30.42 + st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON_O4]); 30.43 + st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON_O5]); 30.44 + st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON_O6]); 30.45 + st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON_O7]); 30.46 st->cr(); 30.47 30.48 st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]); 30.49 @@ -516,7 +517,7 @@ 30.50 if (nativeInstruction_at(*pc)->is_ic_miss_trap()) { 30.51 #ifdef ASSERT 30.52 #ifdef TIERED 30.53 - CodeBlob* cb = CodeCache::find_blob_unsafe(pc); 30.54 + CodeBlob* cb = CodeCache::find_blob_unsafe(*pc); 30.55 assert(cb->is_compiled_by_c2(), "Wrong compiler"); 30.56 #endif // TIERED 30.57 #endif // ASSERT
31.1 --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed May 28 12:07:21 2014 -0700 31.2 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Thu May 29 09:56:06 2014 -0700 31.3 @@ -1,5 +1,5 @@ 31.4 /* 31.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 31.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 31.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 31.8 * 31.9 * This code is free software; you can redistribute it and/or modify it 31.10 @@ -88,6 +88,8 @@ 31.11 #define SPELL_REG_FP "ebp" 31.12 #endif // AMD64 31.13 31.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 31.15 + 31.16 address os::current_stack_pointer() { 31.17 #ifdef SPARC_WORKS 31.18 register void *esp;
32.1 --- a/src/share/vm/adlc/formssel.cpp Wed May 28 12:07:21 2014 -0700 32.2 +++ b/src/share/vm/adlc/formssel.cpp Thu May 29 09:56:06 2014 -0700 32.3 @@ -1,5 +1,5 @@ 32.4 /* 32.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 32.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 32.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 32.8 * 32.9 * This code is free software; you can redistribute it and/or modify it 32.10 @@ -1322,7 +1322,7 @@ 32.11 OperandForm* oper = form->is_operand(); 32.12 if (oper != NULL && oper->is_bound_register()) { 32.13 const RegDef* first = oper->get_RegClass()->find_first_elem(); 32.14 - fprintf(fp, " st->print(\"%s\");\n", first->_regname); 32.15 + fprintf(fp, " st->print_raw(\"%s\");\n", first->_regname); 32.16 } else { 32.17 globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var); 32.18 } 32.19 @@ -2530,7 +2530,7 @@ 32.20 case Form::idealP: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break; 32.21 case Form::idealNKlass: 32.22 case Form::idealN: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break; 32.23 - case Form::idealL: fprintf(fp," st->print(\"#%%lld\", _c%d);\n", const_index); break; 32.24 + case Form::idealL: fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", const_index); break; 32.25 case Form::idealF: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break; 32.26 case Form::idealD: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break; 32.27 default:
33.1 --- a/src/share/vm/adlc/output_h.cpp Wed May 28 12:07:21 2014 -0700 33.2 +++ b/src/share/vm/adlc/output_h.cpp Thu May 29 09:56:06 2014 -0700 33.3 @@ -1,5 +1,5 @@ 33.4 /* 33.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 33.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 33.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 33.8 * 33.9 * This code is free software; you can redistribute it and/or modify it 33.10 @@ -386,14 +386,14 @@ 33.11 static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) { 33.12 assert(oper != NULL, "what"); 33.13 CondInterface* cond = oper->_interface->is_CondInterface(); 33.14 - fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format); 33.15 - fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format); 33.16 - fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format); 33.17 - fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format); 33.18 - fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format); 33.19 - fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format); 33.20 - fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print(\"%s\");\n",i,cond->_overflow_format); 33.21 - fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print(\"%s\");\n",i,cond->_no_overflow_format); 33.22 + fprintf(fp, " if( _c%d == BoolTest::eq ) st->print_raw(\"%s\");\n",i,cond->_equal_format); 33.23 + fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print_raw(\"%s\");\n",i,cond->_not_equal_format); 33.24 + fprintf(fp, " else if( _c%d == BoolTest::le ) st->print_raw(\"%s\");\n",i,cond->_less_equal_format); 33.25 + fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print_raw(\"%s\");\n",i,cond->_greater_equal_format); 33.26 + fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print_raw(\"%s\");\n",i,cond->_less_format); 33.27 + fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print_raw(\"%s\");\n",i,cond->_greater_format); 33.28 + fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print_raw(\"%s\");\n",i,cond->_overflow_format); 33.29 + fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print_raw(\"%s\");\n",i,cond->_no_overflow_format); 33.30 } 33.31 33.32 // Output code that dumps constant values, increment "i" if type is constant 33.33 @@ -416,8 +416,8 @@ 33.34 ++i; 33.35 } 33.36 else if (!strcmp(ideal_type, "ConL")) { 33.37 - fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i); 33.38 - fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%d);\n", i); 33.39 + fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", i); 33.40 + fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%d);\n", i); 33.41 ++i; 33.42 } 33.43 else if (!strcmp(ideal_type, "ConF")) { 33.44 @@ -429,7 +429,7 @@ 33.45 else if (!strcmp(ideal_type, "ConD")) { 33.46 fprintf(fp," st->print(\"#%%f\", _c%d);\n", i); 33.47 fprintf(fp," jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i); 33.48 - fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i); 33.49 + fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%dl);\n", i); 33.50 ++i; 33.51 } 33.52 else if (!strcmp(ideal_type, "Bool")) { 33.53 @@ -471,7 +471,7 @@ 33.54 if ( string != NameList::_signal ) { 33.55 // Normal string 33.56 // Pass through to st->print 33.57 - fprintf(fp," st->print(\"%s\");\n", string); 33.58 + fprintf(fp," st->print_raw(\"%s\");\n", string); 33.59 } else { 33.60 // Replacement variable 33.61 const char *rep_var = oper._format->_rep_vars.iter(); 33.62 @@ -542,7 +542,7 @@ 33.63 if ( string != NameList::_signal ) { 33.64 // Normal string 33.65 // Pass through to st->print 33.66 - fprintf(fp," st->print(\"%s\");\n", string); 33.67 + fprintf(fp," st->print_raw(\"%s\");\n", string); 33.68 } else { 33.69 // Replacement variable 33.70 const char *rep_var = oper._format->_rep_vars.iter(); 33.71 @@ -669,7 +669,7 @@ 33.72 } else if( string == NameList::_signal2 ) // Raw program text 33.73 fputs(inst._format->_strings.iter(), fp); 33.74 else 33.75 - fprintf(fp,"st->print(\"%s\");\n", string); 33.76 + fprintf(fp,"st->print_raw(\"%s\");\n", string); 33.77 } // Done with all format strings 33.78 } // Done generating the user-defined portion of the format 33.79 33.80 @@ -696,13 +696,13 @@ 33.81 default: 33.82 assert(0,"ShouldNotReachHere"); 33.83 } 33.84 - fprintf(fp, " st->print_cr(\"\");\n" ); 33.85 + fprintf(fp, " st->cr();\n" ); 33.86 fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" ); 33.87 fprintf(fp, " st->print(\" # \");\n" ); 33.88 fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n"); 33.89 } 33.90 else if(inst.is_ideal_safepoint()) { 33.91 - fprintf(fp, " st->print(\"\");\n" ); 33.92 + fprintf(fp, " st->print_raw(\"\");\n" ); 33.93 fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" ); 33.94 fprintf(fp, " st->print(\" # \");\n" ); 33.95 fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
34.1 --- a/src/share/vm/asm/codeBuffer.cpp Wed May 28 12:07:21 2014 -0700 34.2 +++ b/src/share/vm/asm/codeBuffer.cpp Thu May 29 09:56:06 2014 -0700 34.3 @@ -1,5 +1,5 @@ 34.4 /* 34.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 34.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 34.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.8 * 34.9 * This code is free software; you can redistribute it and/or modify it 34.10 @@ -987,7 +987,7 @@ 34.11 for (csize_t step; ptr < end(); ptr += step) { 34.12 step = end() - ptr; 34.13 if (step > jintSize * 4) step = jintSize * 4; 34.14 - tty->print(PTR_FORMAT ": ", ptr); 34.15 + tty->print(INTPTR_FORMAT ": ", p2i(ptr)); 34.16 while (step > 0) { 34.17 tty->print(" " PTR32_FORMAT, *(jint*)ptr); 34.18 ptr += jintSize; 34.19 @@ -1097,7 +1097,7 @@ 34.20 while (c && c->offset() == offset) { 34.21 stream->bol(); 34.22 stream->print(" ;; "); 34.23 - stream->print_cr(c->string()); 34.24 + stream->print_cr("%s", c->string()); 34.25 c = c->next_comment(); 34.26 } 34.27 } 34.28 @@ -1153,10 +1153,10 @@ 34.29 void CodeSection::print(const char* name) { 34.30 csize_t locs_size = locs_end() - locs_start(); 34.31 tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s", 34.32 - name, start(), end(), limit(), size(), capacity(), 34.33 + name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(), 34.34 is_frozen()? " [frozen]": ""); 34.35 tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d", 34.36 - name, locs_start(), locs_end(), locs_limit(), locs_size, locs_capacity(), locs_point_off()); 34.37 + name, p2i(locs_start()), p2i(locs_end()), p2i(locs_limit()), locs_size, locs_capacity(), locs_point_off()); 34.38 if (PrintRelocations) { 34.39 RelocIterator iter(this); 34.40 iter.print();
35.1 --- a/src/share/vm/asm/codeBuffer.hpp Wed May 28 12:07:21 2014 -0700 35.2 +++ b/src/share/vm/asm/codeBuffer.hpp Thu May 29 09:56:06 2014 -0700 35.3 @@ -1,5 +1,5 @@ 35.4 /* 35.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 35.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 35.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 35.8 * 35.9 * This code is free software; you can redistribute it and/or modify it 35.10 @@ -173,7 +173,7 @@ 35.11 bool allocates(address pc) const { return pc >= _start && pc < _limit; } 35.12 bool allocates2(address pc) const { return pc >= _start && pc <= _limit; } 35.13 35.14 - 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; } 35.15 + void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit))); _end = pc; } 35.16 void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer"); 35.17 _mark = pc; } 35.18 void set_mark_off(int offset) { assert(contains2(offset+_start),"not in codeBuffer");
36.1 --- a/src/share/vm/asm/register.hpp Wed May 28 12:07:21 2014 -0700 36.2 +++ b/src/share/vm/asm/register.hpp Thu May 29 09:56:06 2014 -0700 36.3 @@ -1,5 +1,5 @@ 36.4 /* 36.5 - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 36.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 36.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 36.8 * 36.9 * This code is free software; you can redistribute it and/or modify it 36.10 @@ -118,8 +118,8 @@ 36.11 ) { 36.12 assert( 36.13 a != b, 36.14 - err_msg_res("registers must be different: a=%d, b=%d", 36.15 - a, b) 36.16 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "", 36.17 + p2i(a), p2i(b)) 36.18 ); 36.19 } 36.20 36.21 @@ -132,8 +132,9 @@ 36.22 assert( 36.23 a != b && a != c 36.24 && b != c, 36.25 - err_msg_res("registers must be different: a=%d, b=%d, c=%d", 36.26 - a, b, c) 36.27 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT 36.28 + ", c=" INTPTR_FORMAT "", 36.29 + p2i(a), p2i(b), p2i(c)) 36.30 ); 36.31 } 36.32 36.33 @@ -148,8 +149,9 @@ 36.34 a != b && a != c && a != d 36.35 && b != c && b != d 36.36 && c != d, 36.37 - err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d", 36.38 - a, b, c, d) 36.39 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT 36.40 + ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "", 36.41 + p2i(a), p2i(b), p2i(c), p2i(d)) 36.42 ); 36.43 } 36.44 36.45 @@ -166,8 +168,9 @@ 36.46 && b != c && b != d && b != e 36.47 && c != d && c != e 36.48 && d != e, 36.49 - err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d", 36.50 - a, b, c, d, e) 36.51 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT 36.52 + ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "", 36.53 + p2i(a), p2i(b), p2i(c), p2i(d), p2i(e)) 36.54 ); 36.55 } 36.56 36.57 @@ -186,8 +189,10 @@ 36.58 && c != d && c != e && c != f 36.59 && d != e && d != f 36.60 && e != f, 36.61 - err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d", 36.62 - a, b, c, d, e, f) 36.63 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT 36.64 + ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT 36.65 + ", f=" INTPTR_FORMAT "", 36.66 + p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f)) 36.67 ); 36.68 } 36.69 36.70 @@ -208,8 +213,10 @@ 36.71 && d != e && d != f && d != g 36.72 && e != f && e != g 36.73 && f != g, 36.74 - err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d", 36.75 - a, b, c, d, e, f, g) 36.76 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT 36.77 + ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT 36.78 + ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "", 36.79 + p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g)) 36.80 ); 36.81 } 36.82 36.83 @@ -232,8 +239,10 @@ 36.84 && e != f && e != g && e != h 36.85 && f != g && f != h 36.86 && g != h, 36.87 - err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d", 36.88 - a, b, c, d, e, f, g, h) 36.89 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT 36.90 + ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT 36.91 + ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "", 36.92 + p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h)) 36.93 ); 36.94 } 36.95 36.96 @@ -258,8 +267,11 @@ 36.97 && f != g && f != h && f != i 36.98 && g != h && g != i 36.99 && h != i, 36.100 - 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", 36.101 - a, b, c, d, e, f, g, h, i) 36.102 + err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT 36.103 + ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT 36.104 + ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT 36.105 + ", i=" INTPTR_FORMAT "", 36.106 + p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i)) 36.107 ); 36.108 } 36.109
37.1 --- a/src/share/vm/c1/c1_CFGPrinter.cpp Wed May 28 12:07:21 2014 -0700 37.2 +++ b/src/share/vm/c1/c1_CFGPrinter.cpp Thu May 29 09:56:06 2014 -0700 37.3 @@ -1,5 +1,5 @@ 37.4 /* 37.5 - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 37.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 37.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 37.8 * 37.9 * This code is free software; you can redistribute it and/or modify it 37.10 @@ -50,7 +50,7 @@ 37.11 37.12 void inc_indent(); 37.13 void dec_indent(); 37.14 - void print(const char* format, ...); 37.15 + void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 37.16 void print_begin(const char* tag); 37.17 void print_end(const char* tag); 37.18 37.19 @@ -161,7 +161,7 @@ 37.20 37.21 print("name \"%s\"", method_name(_compilation->method(), true)); 37.22 print("method \"%s\"", method_name(_compilation->method())); 37.23 - print("date "INT64_FORMAT, os::javaTimeMillis()); 37.24 + print("date "INT64_FORMAT, (int64_t) os::javaTimeMillis()); 37.25 37.26 print_end("compilation"); 37.27 }
38.1 --- a/src/share/vm/c1/c1_GraphBuilder.cpp Wed May 28 12:07:21 2014 -0700 38.2 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Thu May 29 09:56:06 2014 -0700 38.3 @@ -1697,6 +1697,15 @@ 38.4 return NULL; 38.5 } 38.6 38.7 +void GraphBuilder::check_args_for_profiling(Values* obj_args, int expected) { 38.8 +#ifdef ASSERT 38.9 + bool ignored_will_link; 38.10 + ciSignature* declared_signature = NULL; 38.11 + ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature); 38.12 + assert(expected == obj_args->length() || real_target->is_method_handle_intrinsic(), "missed on arg?"); 38.13 +#endif 38.14 +} 38.15 + 38.16 // Collect arguments that we want to profile in a list 38.17 Values* GraphBuilder::collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver) { 38.18 int start = 0; 38.19 @@ -1705,13 +1714,14 @@ 38.20 return NULL; 38.21 } 38.22 int s = obj_args->size(); 38.23 - for (int i = start, j = 0; j < s; i++) { 38.24 + // if called through method handle invoke, some arguments may have been popped 38.25 + for (int i = start, j = 0; j < s && i < args->length(); i++) { 38.26 if (args->at(i)->type()->is_object_kind()) { 38.27 obj_args->push(args->at(i)); 38.28 j++; 38.29 } 38.30 } 38.31 - assert(s == obj_args->length(), "missed on arg?"); 38.32 + check_args_for_profiling(obj_args, s); 38.33 return obj_args; 38.34 } 38.35 38.36 @@ -3843,14 +3853,7 @@ 38.37 j++; 38.38 } 38.39 } 38.40 -#ifdef ASSERT 38.41 - { 38.42 - bool ignored_will_link; 38.43 - ciSignature* declared_signature = NULL; 38.44 - ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature); 38.45 - assert(s == obj_args->length() || real_target->is_method_handle_intrinsic(), "missed on arg?"); 38.46 - } 38.47 -#endif 38.48 + check_args_for_profiling(obj_args, s); 38.49 } 38.50 profile_call(callee, recv, holder_known ? callee->holder() : NULL, obj_args, true); 38.51 }
39.1 --- a/src/share/vm/c1/c1_GraphBuilder.hpp Wed May 28 12:07:21 2014 -0700 39.2 +++ b/src/share/vm/c1/c1_GraphBuilder.hpp Thu May 29 09:56:06 2014 -0700 39.3 @@ -392,6 +392,7 @@ 39.4 39.5 Values* args_list_for_profiling(ciMethod* target, int& start, bool may_have_receiver); 39.6 Values* collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver); 39.7 + void check_args_for_profiling(Values* obj_args, int expected); 39.8 39.9 public: 39.10 NOT_PRODUCT(void print_stats();)
40.1 --- a/src/share/vm/c1/c1_InstructionPrinter.cpp Wed May 28 12:07:21 2014 -0700 40.2 +++ b/src/share/vm/c1/c1_InstructionPrinter.cpp Thu May 29 09:56:06 2014 -0700 40.3 @@ -1,5 +1,5 @@ 40.4 /* 40.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 40.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 40.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 40.8 * 40.9 * This code is free software; you can redistribute it and/or modify it 40.10 @@ -134,23 +134,23 @@ 40.11 if (value->is_null_object()) { 40.12 output()->print("null"); 40.13 } else if (!value->is_loaded()) { 40.14 - output()->print("<unloaded object " PTR_FORMAT ">", value); 40.15 + output()->print("<unloaded object " INTPTR_FORMAT ">", p2i(value)); 40.16 } else { 40.17 - output()->print("<object " PTR_FORMAT " klass=", value->constant_encoding()); 40.18 + output()->print("<object " INTPTR_FORMAT " klass=", p2i(value->constant_encoding())); 40.19 print_klass(value->klass()); 40.20 output()->print(">"); 40.21 } 40.22 } else if (type->as_InstanceConstant() != NULL) { 40.23 ciInstance* value = type->as_InstanceConstant()->value(); 40.24 if (value->is_loaded()) { 40.25 - output()->print("<instance " PTR_FORMAT " klass=", value->constant_encoding()); 40.26 + output()->print("<instance " INTPTR_FORMAT " klass=", p2i(value->constant_encoding())); 40.27 print_klass(value->klass()); 40.28 output()->print(">"); 40.29 } else { 40.30 - output()->print("<unloaded instance " PTR_FORMAT ">", value); 40.31 + output()->print("<unloaded instance " INTPTR_FORMAT ">", p2i(value)); 40.32 } 40.33 } else if (type->as_ArrayConstant() != NULL) { 40.34 - output()->print("<array " PTR_FORMAT ">", type->as_ArrayConstant()->value()->constant_encoding()); 40.35 + output()->print("<array " INTPTR_FORMAT ">", p2i(type->as_ArrayConstant()->value()->constant_encoding())); 40.36 } else if (type->as_ClassConstant() != NULL) { 40.37 ciInstanceKlass* klass = type->as_ClassConstant()->value(); 40.38 if (!klass->is_loaded()) { 40.39 @@ -268,7 +268,7 @@ 40.40 40.41 40.42 void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) { 40.43 - output()->print(name); 40.44 + output()->print("%s", name); 40.45 output()->print(".("); 40.46 } 40.47 40.48 @@ -479,7 +479,7 @@ 40.49 if (x->declared_type()->is_klass()) 40.50 print_klass(x->declared_type()->as_klass()); 40.51 else 40.52 - output()->print(type2name(x->declared_type()->basic_type())); 40.53 + output()->print("%s", type2name(x->declared_type()->basic_type())); 40.54 } 40.55 40.56
41.1 --- a/src/share/vm/c1/c1_LIR.cpp Wed May 28 12:07:21 2014 -0700 41.2 +++ b/src/share/vm/c1/c1_LIR.cpp Thu May 29 09:56:06 2014 -0700 41.3 @@ -1,5 +1,5 @@ 41.4 /* 41.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 41.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 41.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 41.8 * 41.9 * This code is free software; you can redistribute it and/or modify it 41.10 @@ -1563,15 +1563,15 @@ 41.11 } else if (is_virtual()) { 41.12 out->print("R%d", vreg_number()); 41.13 } else if (is_single_cpu()) { 41.14 - out->print(as_register()->name()); 41.15 + out->print("%s", as_register()->name()); 41.16 } else if (is_double_cpu()) { 41.17 - out->print(as_register_hi()->name()); 41.18 - out->print(as_register_lo()->name()); 41.19 + out->print("%s", as_register_hi()->name()); 41.20 + out->print("%s", as_register_lo()->name()); 41.21 #if defined(X86) 41.22 } else if (is_single_xmm()) { 41.23 - out->print(as_xmm_float_reg()->name()); 41.24 + out->print("%s", as_xmm_float_reg()->name()); 41.25 } else if (is_double_xmm()) { 41.26 - out->print(as_xmm_double_reg()->name()); 41.27 + out->print("%s", as_xmm_double_reg()->name()); 41.28 } else if (is_single_fpu()) { 41.29 out->print("fpu%d", fpu_regnr()); 41.30 } else if (is_double_fpu()) { 41.31 @@ -1583,9 +1583,9 @@ 41.32 out->print("d%d", fpu_regnrLo() >> 1); 41.33 #else 41.34 } else if (is_single_fpu()) { 41.35 - out->print(as_float_reg()->name()); 41.36 + out->print("%s", as_float_reg()->name()); 41.37 } else if (is_double_fpu()) { 41.38 - out->print(as_double_reg()->name()); 41.39 + out->print("%s", as_double_reg()->name()); 41.40 #endif 41.41 41.42 } else if (is_illegal()) { 41.43 @@ -1611,9 +1611,9 @@ 41.44 case T_LONG: out->print("lng:" JLONG_FORMAT, as_jlong()); break; 41.45 case T_FLOAT: out->print("flt:%f", as_jfloat()); break; 41.46 case T_DOUBLE: out->print("dbl:%f", as_jdouble()); break; 41.47 - case T_OBJECT: out->print("obj:0x%x", as_jobject()); break; 41.48 - case T_METADATA: out->print("metadata:0x%x", as_metadata());break; 41.49 - default: out->print("%3d:0x%x",type(), as_jdouble()); break; 41.50 + case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject())); break; 41.51 + case T_METADATA: out->print("metadata:" INTPTR_FORMAT, p2i(as_metadata()));break; 41.52 + default: out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break; 41.53 } 41.54 } 41.55 41.56 @@ -1629,7 +1629,7 @@ 41.57 case times_8: out->print(" * 8"); break; 41.58 } 41.59 } 41.60 - out->print(" Disp: %d", _disp); 41.61 + out->print(" Disp: " INTX_FORMAT, _disp); 41.62 } 41.63 41.64 // debug output of block header without InstructionPrinter 41.65 @@ -1703,7 +1703,7 @@ 41.66 } else { 41.67 out->print(" "); 41.68 } 41.69 - out->print(name()); out->print(" "); 41.70 + out->print("%s ", name()); 41.71 print_instr(out); 41.72 if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci()); 41.73 #ifdef ASSERT 41.74 @@ -1833,7 +1833,7 @@ 41.75 // LIR_OpJavaCall 41.76 void LIR_OpJavaCall::print_instr(outputStream* out) const { 41.77 out->print("call: "); 41.78 - out->print("[addr: 0x%x]", address()); 41.79 + out->print("[addr: " INTPTR_FORMAT "]", p2i(address())); 41.80 if (receiver()->is_valid()) { 41.81 out->print(" [recv: "); receiver()->print(out); out->print("]"); 41.82 } 41.83 @@ -1844,7 +1844,7 @@ 41.84 41.85 // LIR_OpLabel 41.86 void LIR_OpLabel::print_instr(outputStream* out) const { 41.87 - out->print("[label:0x%x]", _label); 41.88 + out->print("[label:" INTPTR_FORMAT "]", p2i(_label)); 41.89 } 41.90 41.91 // LIR_OpArrayCopy 41.92 @@ -1911,7 +1911,7 @@ 41.93 // LIR_Op1 41.94 void LIR_OpRTCall::print_instr(outputStream* out) const { 41.95 intx a = (intx)addr(); 41.96 - out->print(Runtime1::name_for_address(addr())); 41.97 + out->print("%s", Runtime1::name_for_address(addr())); 41.98 out->print(" "); 41.99 tmp()->print(out); 41.100 } 41.101 @@ -1934,10 +1934,10 @@ 41.102 } else if (stub() != NULL) { 41.103 out->print("["); 41.104 stub()->print_name(out); 41.105 - out->print(": 0x%x]", stub()); 41.106 + out->print(": " INTPTR_FORMAT "]", p2i(stub())); 41.107 if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci()); 41.108 } else { 41.109 - out->print("[label:0x%x] ", label()); 41.110 + out->print("[label:" INTPTR_FORMAT "] ", p2i(label())); 41.111 } 41.112 if (ublock() != NULL) { 41.113 out->print("unordered: [B%d] ", ublock()->block_id()); 41.114 @@ -2004,7 +2004,7 @@ 41.115 tmp4()->print(out); out->print(" "); 41.116 out->print("[hdr:%d]", header_size()); out->print(" "); 41.117 out->print("[obj:%d]", object_size()); out->print(" "); 41.118 - out->print("[lbl:0x%x]", stub()->entry()); 41.119 + out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry())); 41.120 } 41.121 41.122 void LIR_OpRoundFP::print_instr(outputStream* out) const { 41.123 @@ -2037,7 +2037,7 @@ 41.124 tmp3()->print(out); out->print(" "); 41.125 tmp4()->print(out); out->print(" "); 41.126 out->print("[type:0x%x]", type()); out->print(" "); 41.127 - out->print("[label:0x%x]", stub()->entry()); 41.128 + out->print("[label:" INTPTR_FORMAT "]", p2i(stub()->entry())); 41.129 } 41.130 41.131 41.132 @@ -2074,7 +2074,7 @@ 41.133 if (_scratch->is_valid()) { 41.134 _scratch->print(out); out->print(" "); 41.135 } 41.136 - out->print("[lbl:0x%x]", stub()->entry()); 41.137 + out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry())); 41.138 } 41.139 41.140 #ifdef ASSERT 41.141 @@ -2082,7 +2082,7 @@ 41.142 print_condition(out, condition()); out->print(" "); 41.143 in_opr1()->print(out); out->print(" "); 41.144 in_opr2()->print(out); out->print(", \""); 41.145 - out->print(msg()); out->print("\""); 41.146 + out->print("%s", msg()); out->print("\""); 41.147 } 41.148 #endif 41.149
42.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp Wed May 28 12:07:21 2014 -0700 42.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp Thu May 29 09:56:06 2014 -0700 42.3 @@ -2634,8 +2634,10 @@ 42.4 // LIR_Assembler::emit_profile_type() from emitting useless code 42.5 profiled_k = ciTypeEntries::with_status(result, profiled_k); 42.6 } 42.7 - if (exact_signature_k != NULL && exact_klass != exact_signature_k) { 42.8 - assert(exact_klass == NULL, "obj and signature disagree?"); 42.9 + // exact_klass and exact_signature_k can be both non NULL but 42.10 + // different if exact_klass is loaded after the ciObject for 42.11 + // exact_signature_k is created. 42.12 + if (exact_klass == NULL && exact_signature_k != NULL && exact_klass != exact_signature_k) { 42.13 // sometimes the type of the signature is better than the best type 42.14 // the compiler has 42.15 exact_klass = exact_signature_k; 42.16 @@ -2646,8 +2648,7 @@ 42.17 if (improved_klass == NULL) { 42.18 improved_klass = comp->cha_exact_type(callee_signature_k); 42.19 } 42.20 - if (improved_klass != NULL && exact_klass != improved_klass) { 42.21 - assert(exact_klass == NULL, "obj and signature disagree?"); 42.22 + if (exact_klass == NULL && improved_klass != NULL && exact_klass != improved_klass) { 42.23 exact_klass = exact_signature_k; 42.24 } 42.25 }
43.1 --- a/src/share/vm/c1/c1_RangeCheckElimination.cpp Wed May 28 12:07:21 2014 -0700 43.2 +++ b/src/share/vm/c1/c1_RangeCheckElimination.cpp Thu May 29 09:56:06 2014 -0700 43.3 @@ -1,5 +1,5 @@ 43.4 /* 43.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 43.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 43.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 43.8 * 43.9 * This code is free software; you can redistribute it and/or modify it 43.10 @@ -62,10 +62,10 @@ 43.11 _optimistic = ir->compilation()->is_optimistic(); 43.12 43.13 TRACE_RANGE_CHECK_ELIMINATION( 43.14 - tty->print_cr(""); 43.15 + tty->cr(); 43.16 tty->print_cr("Range check elimination"); 43.17 ir->method()->print_name(tty); 43.18 - tty->print_cr(""); 43.19 + tty->cr(); 43.20 ); 43.21 43.22 TRACE_RANGE_CHECK_ELIMINATION( 43.23 @@ -1024,7 +1024,7 @@ 43.24 tty->print("i%d", phi->id()); 43.25 tty->print(": "); 43.26 bound->print(); 43.27 - tty->print_cr(""); 43.28 + tty->cr(); 43.29 ); 43.30 } 43.31 }); 43.32 @@ -1039,7 +1039,7 @@ 43.33 tty->print("i%d", instr->id()); 43.34 tty->print(": "); 43.35 bound->print(); 43.36 - tty->print_cr(""); 43.37 + tty->cr(); 43.38 ); 43.39 } 43.40 } 43.41 @@ -1400,7 +1400,7 @@ 43.42 43.43 // print 43.44 void RangeCheckEliminator::Bound::print() { 43.45 - tty->print(""); 43.46 + tty->print("%s", ""); 43.47 if (this->_lower_instr || this->_lower != min_jint) { 43.48 if (this->_lower_instr) { 43.49 tty->print("i%d", this->_lower_instr->id());
44.1 --- a/src/share/vm/c1/c1_Runtime1.cpp Wed May 28 12:07:21 2014 -0700 44.2 +++ b/src/share/vm/c1/c1_Runtime1.cpp Thu May 29 09:56:06 2014 -0700 44.3 @@ -1,5 +1,5 @@ 44.4 /* 44.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 44.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 44.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 44.8 * 44.9 * This code is free software; you can redistribute it and/or modify it 44.10 @@ -532,8 +532,8 @@ 44.11 if (TraceExceptions) { 44.12 ttyLocker ttyl; 44.13 ResourceMark rm; 44.14 - tty->print_cr("Exception <%s> (0x%x) thrown in compiled method <%s> at PC " PTR_FORMAT " for thread 0x%x", 44.15 - exception->print_value_string(), (address)exception(), nm->method()->print_value_string(), pc, thread); 44.16 + tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "", 44.17 + exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); 44.18 } 44.19 // for AbortVMOnException flag 44.20 NOT_PRODUCT(Exceptions::debug_check_abort(exception)); 44.21 @@ -563,7 +563,7 @@ 44.22 ttyLocker ttyl; 44.23 ResourceMark rm; 44.24 tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT, 44.25 - thread, continuation, pc); 44.26 + p2i(thread), p2i(continuation), p2i(pc)); 44.27 } 44.28 44.29 return continuation; 44.30 @@ -970,8 +970,8 @@ 44.31 address copy_buff = stub_location - *byte_skip - *byte_count; 44.32 address being_initialized_entry = stub_location - *being_initialized_entry_offset; 44.33 if (TracePatching) { 44.34 - tty->print_cr(" Patching %s at bci %d at address 0x%x (%s)", Bytecodes::name(code), bci, 44.35 - instr_pc, (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass"); 44.36 + tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci, 44.37 + p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass"); 44.38 nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc()); 44.39 assert(caller_code != NULL, "nmethod not found"); 44.40 44.41 @@ -1430,7 +1430,7 @@ 44.42 methodHandle inlinee = methodHandle(vfst.method()); 44.43 inlinee->print_short_name(&ss1); 44.44 m->print_short_name(&ss2); 44.45 - tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc %x", ss1.as_string(), vfst.bci(), ss2.as_string(), caller_frame.pc()); 44.46 + tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc " INTPTR_FORMAT, ss1.as_string(), vfst.bci(), ss2.as_string(), p2i(caller_frame.pc())); 44.47 } 44.48 44.49
45.1 --- a/src/share/vm/c1/c1_ValueType.hpp Wed May 28 12:07:21 2014 -0700 45.2 +++ b/src/share/vm/c1/c1_ValueType.hpp Thu May 29 09:56:06 2014 -0700 45.3 @@ -1,5 +1,5 @@ 45.4 /* 45.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 45.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 45.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 45.8 * 45.9 * This code is free software; you can redistribute it and/or modify it 45.10 @@ -175,7 +175,7 @@ 45.11 ValueType* join(ValueType* y) const; 45.12 45.13 // debugging 45.14 - void print(outputStream* s = tty) { s->print(name()); } 45.15 + void print(outputStream* s = tty) { s->print("%s", name()); } 45.16 }; 45.17 45.18
46.1 --- a/src/share/vm/ci/bcEscapeAnalyzer.cpp Wed May 28 12:07:21 2014 -0700 46.2 +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp Thu May 29 09:56:06 2014 -0700 46.3 @@ -1,5 +1,5 @@ 46.4 /* 46.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 46.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 46.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 46.8 * 46.9 * This code is free software; you can redistribute it and/or modify it 46.10 @@ -1287,10 +1287,10 @@ 46.11 tty->print_cr("class of method is not initialized."); 46.12 else if (_level > MaxBCEAEstimateLevel) 46.13 tty->print_cr("level (%d) exceeds MaxBCEAEstimateLevel (%d).", 46.14 - _level, MaxBCEAEstimateLevel); 46.15 + _level, (int) MaxBCEAEstimateLevel); 46.16 else if (method()->code_size() > MaxBCEAEstimateSize) 46.17 - tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize.", 46.18 - method()->code_size(), MaxBCEAEstimateSize); 46.19 + tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize (%d).", 46.20 + method()->code_size(), (int) MaxBCEAEstimateSize); 46.21 else 46.22 ShouldNotReachHere(); 46.23 }
47.1 --- a/src/share/vm/ci/ciConstant.cpp Wed May 28 12:07:21 2014 -0700 47.2 +++ b/src/share/vm/ci/ciConstant.cpp Thu May 29 09:56:06 2014 -0700 47.3 @@ -1,5 +1,5 @@ 47.4 /* 47.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 47.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 47.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 47.8 * 47.9 * This code is free software; you can redistribute it and/or modify it 47.10 @@ -48,7 +48,7 @@ 47.11 tty->print("%d", _value._int); 47.12 break; 47.13 case T_LONG: 47.14 - tty->print(INT64_FORMAT, _value._long); 47.15 + tty->print(INT64_FORMAT, (int64_t)(_value._long)); 47.16 break; 47.17 case T_FLOAT: 47.18 tty->print("%f", _value._float);
48.1 --- a/src/share/vm/ci/ciEnv.cpp Wed May 28 12:07:21 2014 -0700 48.2 +++ b/src/share/vm/ci/ciEnv.cpp Thu May 29 09:56:06 2014 -0700 48.3 @@ -1,5 +1,5 @@ 48.4 /* 48.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 48.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 48.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 48.8 * 48.9 * This code is free software; you can redistribute it and/or modify it 48.10 @@ -1220,8 +1220,7 @@ 48.11 if (replay_data_file != NULL) { 48.12 fileStream replay_data_stream(replay_data_file, /*need_close=*/true); 48.13 dump_replay_data(&replay_data_stream); 48.14 - tty->print("# Compiler replay data is saved as: "); 48.15 - tty->print_cr(buffer); 48.16 + tty->print_cr("# Compiler replay data is saved as: %s", buffer); 48.17 } else { 48.18 tty->print_cr("# Can't open file to dump replay data."); 48.19 } 48.20 @@ -1244,7 +1243,7 @@ 48.21 ) 48.22 replay_data_stream.flush(); 48.23 tty->print("# Compiler inline data is saved as: "); 48.24 - tty->print_cr(buffer); 48.25 + tty->print_cr("%s", buffer); 48.26 } else { 48.27 tty->print_cr("# Can't open file to dump inline data."); 48.28 }
49.1 --- a/src/share/vm/ci/ciInstanceKlass.cpp Wed May 28 12:07:21 2014 -0700 49.2 +++ b/src/share/vm/ci/ciInstanceKlass.cpp Thu May 29 09:56:06 2014 -0700 49.3 @@ -1,5 +1,5 @@ 49.4 /* 49.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 49.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 49.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 49.8 * 49.9 * This code is free software; you can redistribute it and/or modify it 49.10 @@ -292,7 +292,7 @@ 49.11 // Implementation of the print method. 49.12 void ciInstanceKlass::print_impl(outputStream* st) { 49.13 ciKlass::print_impl(st); 49.14 - GUARDED_VM_ENTRY(st->print(" loader=0x%x", (address)loader());) 49.15 + GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));) 49.16 if (is_loaded()) { 49.17 st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=", 49.18 bool_to_str(is_initialized()), 49.19 @@ -618,7 +618,7 @@ 49.20 case T_SHORT: _out->print_cr("%d", mirror->short_field(fd->offset())); break; 49.21 case T_CHAR: _out->print_cr("%d", mirror->char_field(fd->offset())); break; 49.22 case T_INT: _out->print_cr("%d", mirror->int_field(fd->offset())); break; 49.23 - case T_LONG: _out->print_cr(INT64_FORMAT, mirror->long_field(fd->offset())); break; 49.24 + case T_LONG: _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break; 49.25 case T_FLOAT: { 49.26 float f = mirror->float_field(fd->offset()); 49.27 _out->print_cr("%d", *(int*)&f); 49.28 @@ -626,7 +626,7 @@ 49.29 } 49.30 case T_DOUBLE: { 49.31 double d = mirror->double_field(fd->offset()); 49.32 - _out->print_cr(INT64_FORMAT, *(jlong*)&d); 49.33 + _out->print_cr(INT64_FORMAT, *(int64_t*)&d); 49.34 break; 49.35 } 49.36 case T_ARRAY: { 49.37 @@ -656,7 +656,7 @@ 49.38 _out->print_cr("\""); 49.39 } else { 49.40 const char* klass_name = value->klass()->name()->as_quoted_ascii(); 49.41 - _out->print_cr(klass_name); 49.42 + _out->print_cr("%s", klass_name); 49.43 } 49.44 } else { 49.45 ShouldNotReachHere();
50.1 --- a/src/share/vm/ci/ciMetadata.cpp Wed May 28 12:07:21 2014 -0700 50.2 +++ b/src/share/vm/ci/ciMetadata.cpp Thu May 29 09:56:06 2014 -0700 50.3 @@ -1,5 +1,5 @@ 50.4 /* 50.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 50.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 50.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 50.8 * 50.9 * This code is free software; you can redistribute it and/or modify it 50.10 @@ -38,7 +38,7 @@ 50.11 void ciMetadata::print(outputStream* st) { 50.12 st->print("<%s", type_string()); 50.13 GUARDED_VM_ENTRY(print_impl(st);) 50.14 - st->print(" ident=%d address=0x%x>", ident(), (address)this); 50.15 + st->print(" ident=%d address=" INTPTR_FORMAT ">", ident(), p2i((address)this)); 50.16 } 50.17 50.18
51.1 --- a/src/share/vm/ci/ciMethodData.cpp Wed May 28 12:07:21 2014 -0700 51.2 +++ b/src/share/vm/ci/ciMethodData.cpp Thu May 29 09:56:06 2014 -0700 51.3 @@ -1,5 +1,5 @@ 51.4 /* 51.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 51.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 51.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 51.8 * 51.9 * This code is free software; you can redistribute it and/or modify it 51.10 @@ -557,7 +557,7 @@ 51.11 if (round == 0) { 51.12 count++; 51.13 } else { 51.14 - out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii()); 51.15 + out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii()); 51.16 } 51.17 } 51.18 } 51.19 @@ -569,7 +569,7 @@ 51.20 if (round == 0) { 51.21 count++; 51.22 } else { 51.23 - out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii()); 51.24 + out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii()); 51.25 } 51.26 } 51.27 }
52.1 --- a/src/share/vm/ci/ciObject.cpp Wed May 28 12:07:21 2014 -0700 52.2 +++ b/src/share/vm/ci/ciObject.cpp Thu May 29 09:56:06 2014 -0700 52.3 @@ -1,5 +1,5 @@ 52.4 /* 52.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 52.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 52.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 52.8 * 52.9 * This code is free software; you can redistribute it and/or modify it 52.10 @@ -214,9 +214,9 @@ 52.11 void ciObject::print(outputStream* st) { 52.12 st->print("<%s", type_string()); 52.13 GUARDED_VM_ENTRY(print_impl(st);) 52.14 - st->print(" ident=%d %s address=0x%x>", ident(), 52.15 + st->print(" ident=%d %s address=" INTPTR_FORMAT ">", ident(), 52.16 is_scavengable() ? "SCAVENGABLE" : "", 52.17 - (address)this); 52.18 + p2i((address)this)); 52.19 } 52.20 52.21 // ------------------------------------------------------------------
53.1 --- a/src/share/vm/ci/ciSignature.cpp Wed May 28 12:07:21 2014 -0700 53.2 +++ b/src/share/vm/ci/ciSignature.cpp Thu May 29 09:56:06 2014 -0700 53.3 @@ -1,5 +1,5 @@ 53.4 /* 53.5 - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 53.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 53.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 53.8 * 53.9 * This code is free software; you can redistribute it and/or modify it 53.10 @@ -148,5 +148,5 @@ 53.11 print_signature(); 53.12 tty->print(" accessing_klass="); 53.13 _accessing_klass->print(); 53.14 - tty->print(" address=0x%x>", (address)this); 53.15 + tty->print(" address=" INTPTR_FORMAT ">", p2i((address)this)); 53.16 }
54.1 --- a/src/share/vm/ci/ciType.cpp Wed May 28 12:07:21 2014 -0700 54.2 +++ b/src/share/vm/ci/ciType.cpp Thu May 29 09:56:06 2014 -0700 54.3 @@ -1,5 +1,5 @@ 54.4 /* 54.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 54.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 54.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 54.8 * 54.9 * This code is free software; you can redistribute it and/or modify it 54.10 @@ -87,7 +87,7 @@ 54.11 // Print the name of this type 54.12 void ciType::print_name_on(outputStream* st) { 54.13 ResourceMark rm; 54.14 - st->print(name()); 54.15 + st->print("%s", name()); 54.16 } 54.17 54.18
55.1 --- a/src/share/vm/classfile/classFileError.cpp Wed May 28 12:07:21 2014 -0700 55.2 +++ b/src/share/vm/classfile/classFileError.cpp Thu May 29 09:56:06 2014 -0700 55.3 @@ -1,5 +1,5 @@ 55.4 /* 55.5 - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 55.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 55.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 55.8 * 55.9 * This code is free software; you can redistribute it and/or modify it 55.10 @@ -29,6 +29,9 @@ 55.11 55.12 // Keep these in a separate file to prevent inlining 55.13 55.14 +PRAGMA_DIAG_PUSH 55.15 +PRAGMA_FORMAT_NONLITERAL_IGNORED 55.16 + 55.17 void ClassFileParser::classfile_parse_error(const char* msg, TRAPS) { 55.18 ResourceMark rm(THREAD); 55.19 Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_ClassFormatError(), 55.20 @@ -53,6 +56,8 @@ 55.21 msg, index, name, _class_name->as_C_string()); 55.22 } 55.23 55.24 +PRAGMA_DIAG_POP 55.25 + 55.26 void StackMapStream::stackmap_format_error(const char* msg, TRAPS) { 55.27 ResourceMark rm(THREAD); 55.28 Exceptions::fthrow(
56.1 --- a/src/share/vm/classfile/classFileParser.cpp Wed May 28 12:07:21 2014 -0700 56.2 +++ b/src/share/vm/classfile/classFileParser.cpp Thu May 29 09:56:06 2014 -0700 56.3 @@ -2793,6 +2793,11 @@ 56.4 "Short length on BootstrapMethods in class file %s", 56.5 CHECK); 56.6 56.7 + guarantee_property(attribute_byte_length >= sizeof(u2), 56.8 + "Invalid BootstrapMethods attribute length %u in class file %s", 56.9 + attribute_byte_length, 56.10 + CHECK); 56.11 + 56.12 // The attribute contains a counted array of counted tuples of shorts, 56.13 // represending bootstrap specifiers: 56.14 // length*{bootstrap_method_index, argument_count*{argument_index}}
57.1 --- a/src/share/vm/classfile/classFileParser.hpp Wed May 28 12:07:21 2014 -0700 57.2 +++ b/src/share/vm/classfile/classFileParser.hpp Thu May 29 09:56:06 2014 -0700 57.3 @@ -313,7 +313,9 @@ 57.4 if (!b) { classfile_parse_error(msg, CHECK); } 57.5 } 57.6 57.7 - inline void assert_property(bool b, const char* msg, TRAPS) { 57.8 +PRAGMA_DIAG_PUSH 57.9 +PRAGMA_FORMAT_NONLITERAL_IGNORED 57.10 +inline void assert_property(bool b, const char* msg, TRAPS) { 57.11 #ifdef ASSERT 57.12 if (!b) { 57.13 ResourceMark rm(THREAD); 57.14 @@ -330,6 +332,7 @@ 57.15 } 57.16 #endif 57.17 } 57.18 +PRAGMA_DIAG_POP 57.19 57.20 inline void check_property(bool property, const char* msg, int index, TRAPS) { 57.21 if (_need_verify) {
58.1 --- a/src/share/vm/classfile/classLoader.cpp Wed May 28 12:07:21 2014 -0700 58.2 +++ b/src/share/vm/classfile/classLoader.cpp Thu May 29 09:56:06 2014 -0700 58.3 @@ -1,5 +1,5 @@ 58.4 /* 58.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 58.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 58.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 58.8 * 58.9 * This code is free software; you can redistribute it and/or modify it 58.10 @@ -343,7 +343,7 @@ 58.11 tty->print("[Meta index for %s=", entry->name()); 58.12 for (int i = 0; i < meta_packages.length(); i++) { 58.13 if (i > 0) tty->print(" "); 58.14 - tty->print(meta_packages.at(i)); 58.15 + tty->print("%s", meta_packages.at(i)); 58.16 } 58.17 tty->print_cr("]"); 58.18 } 58.19 @@ -1299,7 +1299,7 @@ 58.20 e = e->next(); 58.21 } 58.22 jlong end = os::javaTimeMillis(); 58.23 - tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, %d ms)", 58.24 + tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, " JLONG_FORMAT " ms)", 58.25 _compile_the_world_class_counter, _compile_the_world_method_counter, (end - start)); 58.26 { 58.27 // Print statistics as if before normal exit:
59.1 --- a/src/share/vm/classfile/classLoaderData.cpp Wed May 28 12:07:21 2014 -0700 59.2 +++ b/src/share/vm/classfile/classLoaderData.cpp Thu May 29 09:56:06 2014 -0700 59.3 @@ -269,10 +269,10 @@ 59.4 ResourceMark rm; 59.5 tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: " 59.6 PTR_FORMAT " loader: " PTR_FORMAT " %s", 59.7 - k, 59.8 + p2i(k), 59.9 k->external_name(), 59.10 - k->class_loader_data(), 59.11 - (void *)k->class_loader(), 59.12 + p2i(k->class_loader_data()), 59.13 + p2i((void *)k->class_loader()), 59.14 loader_name()); 59.15 } 59.16 } 59.17 @@ -307,11 +307,11 @@ 59.18 59.19 if (TraceClassLoaderData) { 59.20 ResourceMark rm; 59.21 - tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this); 59.22 - tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(), 59.23 + tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this)); 59.24 + tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()), 59.25 loader_name()); 59.26 if (is_anonymous()) { 59.27 - tty->print(" for anonymous class "PTR_FORMAT " ", _klasses); 59.28 + tty->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses)); 59.29 } 59.30 tty->print_cr("]"); 59.31 } 59.32 @@ -469,14 +469,14 @@ 59.33 void ClassLoaderData::dump(outputStream * const out) { 59.34 ResourceMark rm; 59.35 out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {", 59.36 - this, (void *)class_loader(), 59.37 - class_loader() != NULL ? class_loader()->klass() : NULL, loader_name()); 59.38 + p2i(this), p2i((void *)class_loader()), 59.39 + p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name()); 59.40 if (claimed()) out->print(" claimed "); 59.41 if (is_unloading()) out->print(" unloading "); 59.42 - out->print(" handles " INTPTR_FORMAT, handles()); 59.43 + out->print(" handles " INTPTR_FORMAT, p2i(handles())); 59.44 out->cr(); 59.45 if (metaspace_or_null() != NULL) { 59.46 - out->print_cr("metaspace: " PTR_FORMAT, metaspace_or_null()); 59.47 + out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null())); 59.48 metaspace_or_null()->dump(out); 59.49 } else { 59.50 out->print_cr("metaspace: NULL"); 59.51 @@ -533,6 +533,8 @@ 59.52 ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL; 59.53 ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL; 59.54 59.55 +bool ClassLoaderDataGraph::_should_purge = false; 59.56 + 59.57 // Add a new class loader data node to the list. Assign the newly created 59.58 // ClassLoaderData into the java/lang/ClassLoader object as a hidden field 59.59 ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRAPS) { 59.60 @@ -570,8 +572,8 @@ 59.61 if (TraceClassLoaderData) { 59.62 ResourceMark rm; 59.63 tty->print("[ClassLoaderData: "); 59.64 - tty->print("create class loader data "PTR_FORMAT, cld); 59.65 - tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(), 59.66 + tty->print("create class loader data " INTPTR_FORMAT, p2i(cld)); 59.67 + tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()), 59.68 cld->loader_name()); 59.69 tty->print_cr("]"); 59.70 } 59.71 @@ -655,32 +657,6 @@ 59.72 return array; 59.73 } 59.74 59.75 -// For profiling and hsfind() only. Otherwise, this is unsafe (and slow). This 59.76 -// is done lock free to avoid lock inversion problems. It is safe because 59.77 -// new ClassLoaderData are added to the end of the CLDG, and only removed at 59.78 -// safepoint. The _unloading list can be deallocated concurrently with CMS so 59.79 -// this doesn't look in metaspace for classes that have been unloaded. 59.80 -bool ClassLoaderDataGraph::contains(const void* x) { 59.81 - if (DumpSharedSpaces) { 59.82 - // There are only two metaspaces to worry about. 59.83 - ClassLoaderData* ncld = ClassLoaderData::the_null_class_loader_data(); 59.84 - return (ncld->ro_metaspace()->contains(x) || ncld->rw_metaspace()->contains(x)); 59.85 - } 59.86 - 59.87 - if (UseSharedSpaces && MetaspaceShared::is_in_shared_space(x)) { 59.88 - return true; 59.89 - } 59.90 - 59.91 - for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) { 59.92 - if (cld->metaspace_or_null() != NULL && cld->metaspace_or_null()->contains(x)) { 59.93 - return true; 59.94 - } 59.95 - } 59.96 - 59.97 - // Do not check unloading list because deallocation can be concurrent. 59.98 - return false; 59.99 -} 59.100 - 59.101 #ifndef PRODUCT 59.102 bool ClassLoaderDataGraph::contains_loader_data(ClassLoaderData* loader_data) { 59.103 for (ClassLoaderData* data = _head; data != NULL; data = data->next()) { 59.104 @@ -739,6 +715,7 @@ 59.105 } 59.106 59.107 void ClassLoaderDataGraph::purge() { 59.108 + assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); 59.109 ClassLoaderData* list = _unloading; 59.110 _unloading = NULL; 59.111 ClassLoaderData* next = list; 59.112 @@ -827,7 +804,7 @@ 59.113 if (class_loader() == NULL) { 59.114 out->print("NULL class_loader"); 59.115 } else { 59.116 - out->print("class loader "PTR_FORMAT, this); 59.117 + out->print("class loader " INTPTR_FORMAT, p2i(this)); 59.118 class_loader()->print_value_on(out); 59.119 } 59.120 }
60.1 --- a/src/share/vm/classfile/classLoaderData.hpp Wed May 28 12:07:21 2014 -0700 60.2 +++ b/src/share/vm/classfile/classLoaderData.hpp Thu May 29 09:56:06 2014 -0700 60.3 @@ -66,6 +66,7 @@ 60.4 static ClassLoaderData* _unloading; 60.5 // CMS support. 60.6 static ClassLoaderData* _saved_head; 60.7 + static bool _should_purge; 60.8 60.9 static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS); 60.10 static void post_class_unload_events(void); 60.11 @@ -86,12 +87,20 @@ 60.12 static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); } 60.13 static GrowableArray<ClassLoaderData*>* new_clds(); 60.14 60.15 + static void set_should_purge(bool b) { _should_purge = b; } 60.16 + static void purge_if_needed() { 60.17 + // Only purge the CLDG for CMS if concurrent sweep is complete. 60.18 + if (_should_purge) { 60.19 + purge(); 60.20 + // reset for next time. 60.21 + set_should_purge(false); 60.22 + } 60.23 + } 60.24 + 60.25 static void dump_on(outputStream * const out) PRODUCT_RETURN; 60.26 static void dump() { dump_on(tty); } 60.27 static void verify(); 60.28 60.29 - // expensive test for pointer in metaspace for debugging 60.30 - static bool contains(const void* x); 60.31 #ifndef PRODUCT 60.32 static bool contains_loader_data(ClassLoaderData* loader_data); 60.33 #endif
61.1 --- a/src/share/vm/classfile/defaultMethods.cpp Wed May 28 12:07:21 2014 -0700 61.2 +++ b/src/share/vm/classfile/defaultMethods.cpp Thu May 29 09:56:06 2014 -0700 61.3 @@ -436,7 +436,7 @@ 61.4 _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError(); 61.5 if (TraceDefaultMethods) { 61.6 _exception_message->print_value_on(tty); 61.7 - tty->print_cr(""); 61.8 + tty->cr(); 61.9 } 61.10 } 61.11 } 61.12 @@ -463,7 +463,7 @@ 61.13 if (_members.at(i).second == DISQUALIFIED) { 61.14 str->print(" (disqualified)"); 61.15 } 61.16 - str->print_cr(""); 61.17 + str->cr(); 61.18 } 61.19 61.20 if (_selected_target != NULL) { 61.21 @@ -480,7 +480,7 @@ 61.22 if (!method_holder->is_interface()) { 61.23 tty->print(" : in superclass"); 61.24 } 61.25 - str->print_cr(""); 61.26 + str->cr(); 61.27 } 61.28 61.29 void print_exception(outputStream* str, int indent) { 61.30 @@ -688,7 +688,7 @@ 61.31 for (int i = 0; i < slots->length(); ++i) { 61.32 tty->indent(); 61.33 slots->at(i)->print_on(tty); 61.34 - tty->print_cr(""); 61.35 + tty->cr(); 61.36 } 61.37 } 61.38 #endif // ndef PRODUCT 61.39 @@ -828,7 +828,7 @@ 61.40 streamIndentor si(tty, 2); 61.41 tty->indent().print("Looking for default methods for slot "); 61.42 slot->print_on(tty); 61.43 - tty->print_cr(""); 61.44 + tty->cr(); 61.45 } 61.46 #endif // ndef PRODUCT 61.47 61.48 @@ -946,7 +946,7 @@ 61.49 if (TraceDefaultMethods) { 61.50 tty->print("for slot: "); 61.51 slot->print_on(tty); 61.52 - tty->print_cr(""); 61.53 + tty->cr(); 61.54 if (method->has_target()) { 61.55 method->print_selected(tty, 1); 61.56 } else if (method->throws_exception()) {
62.1 --- a/src/share/vm/classfile/dictionary.cpp Wed May 28 12:07:21 2014 -0700 62.2 +++ b/src/share/vm/classfile/dictionary.cpp Thu May 29 09:56:06 2014 -0700 62.3 @@ -30,6 +30,7 @@ 62.4 #include "prims/jvmtiRedefineClassesTrace.hpp" 62.5 #include "utilities/hashtable.inline.hpp" 62.6 62.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 62.8 62.9 DictionaryEntry* Dictionary::_current_class_entry = NULL; 62.10 int Dictionary::_current_class_index = 0;
63.1 --- a/src/share/vm/classfile/dictionary.hpp Wed May 28 12:07:21 2014 -0700 63.2 +++ b/src/share/vm/classfile/dictionary.hpp Thu May 29 09:56:06 2014 -0700 63.3 @@ -1,5 +1,5 @@ 63.4 /* 63.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 63.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 63.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 63.8 * 63.9 * This code is free software; you can redistribute it and/or modify it 63.10 @@ -379,7 +379,7 @@ 63.11 } 63.12 if (method_type() != NULL) { 63.13 if (printed) st->print(" and "); 63.14 - st->print(INTPTR_FORMAT, (void *)method_type()); 63.15 + st->print(INTPTR_FORMAT, p2i((void *)method_type())); 63.16 printed = true; 63.17 } 63.18 st->print_cr(printed ? "" : "(empty)");
64.1 --- a/src/share/vm/classfile/javaClasses.cpp Wed May 28 12:07:21 2014 -0700 64.2 +++ b/src/share/vm/classfile/javaClasses.cpp Thu May 29 09:56:06 2014 -0700 64.3 @@ -51,6 +51,8 @@ 64.4 #include "runtime/vframe.hpp" 64.5 #include "utilities/preserveException.hpp" 64.6 64.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 64.8 + 64.9 #define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java) \ 64.10 klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum); 64.11 64.12 @@ -1481,7 +1483,7 @@ 64.13 while (h_throwable.not_null()) { 64.14 objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable()))); 64.15 if (result.is_null()) { 64.16 - st->print_cr(no_stack_trace_message()); 64.17 + st->print_cr("%s", no_stack_trace_message()); 64.18 return; 64.19 } 64.20
65.1 --- a/src/share/vm/classfile/symbolTable.cpp Wed May 28 12:07:21 2014 -0700 65.2 +++ b/src/share/vm/classfile/symbolTable.cpp Thu May 29 09:56:06 2014 -0700 65.3 @@ -39,6 +39,8 @@ 65.4 #include "gc_implementation/g1/g1StringDedup.hpp" 65.5 #endif 65.6 65.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 65.8 + 65.9 // -------------------------------------------------------------------------- 65.10 65.11 // the number of buckets a thread claims
66.1 --- a/src/share/vm/classfile/systemDictionary.cpp Wed May 28 12:07:21 2014 -0700 66.2 +++ b/src/share/vm/classfile/systemDictionary.cpp Thu May 29 09:56:06 2014 -0700 66.3 @@ -2268,7 +2268,7 @@ 66.4 oop appendix = appendix_box->obj_at(0); 66.5 if (TraceMethodHandles) { 66.6 #ifndef PRODUCT 66.7 - tty->print("Linked method="INTPTR_FORMAT": ", m); 66.8 + tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m)); 66.9 m->print(); 66.10 if (appendix != NULL) { tty->print("appendix = "); appendix->print(); } 66.11 tty->cr();
67.1 --- a/src/share/vm/classfile/verifier.cpp Wed May 28 12:07:21 2014 -0700 67.2 +++ b/src/share/vm/classfile/verifier.cpp Thu May 29 09:56:06 2014 -0700 67.3 @@ -364,7 +364,7 @@ 67.4 67.5 void ErrorContext::details(outputStream* ss, const Method* method) const { 67.6 if (is_valid()) { 67.7 - ss->print_cr(""); 67.8 + ss->cr(); 67.9 ss->print_cr("Exception Details:"); 67.10 location_details(ss, method); 67.11 reason_details(ss); 67.12 @@ -379,7 +379,7 @@ 67.13 streamIndentor si(ss); 67.14 ss->indent().print_cr("Reason:"); 67.15 streamIndentor si2(ss); 67.16 - ss->indent().print(""); 67.17 + ss->indent().print("%s", ""); 67.18 switch (_fault) { 67.19 case INVALID_BYTECODE: 67.20 ss->print("Error exists in the bytecode"); 67.21 @@ -432,7 +432,7 @@ 67.22 ShouldNotReachHere(); 67.23 ss->print_cr("Unknown"); 67.24 } 67.25 - ss->print_cr(""); 67.26 + ss->cr(); 67.27 } 67.28 67.29 void ErrorContext::location_details(outputStream* ss, const Method* method) const { 67.30 @@ -507,7 +507,7 @@ 67.31 for (u2 i = 0; i < sm_table->number_of_entries(); ++i) { 67.32 ss->indent(); 67.33 sm_frame->print_on(ss, current_offset); 67.34 - ss->print_cr(""); 67.35 + ss->cr(); 67.36 current_offset += sm_frame->offset_delta(); 67.37 sm_frame = sm_frame->next(); 67.38 } 67.39 @@ -579,7 +579,8 @@ 67.40 tty->print_cr("Verifying method %s", m->name_and_sig_as_C_string()); 67.41 } 67.42 67.43 - const char* bad_type_msg = "Bad type on operand stack in %s"; 67.44 +// For clang, the only good constant format string is a literal constant format string. 67.45 +#define bad_type_msg "Bad type on operand stack in %s" 67.46 67.47 int32_t max_stack = m->verifier_max_stack(); 67.48 int32_t max_locals = m->max_locals(); 67.49 @@ -1679,6 +1680,8 @@ 67.50 } 67.51 } 67.52 67.53 +#undef bad_type_message 67.54 + 67.55 char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) { 67.56 char* code_data = NEW_RESOURCE_ARRAY(char, code_length); 67.57 memset(code_data, 0, sizeof(char) * code_length); 67.58 @@ -2393,11 +2396,12 @@ 67.59 if (opcode == Bytecodes::_invokedynamic) { 67.60 if (!EnableInvokeDynamic || 67.61 _klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) { 67.62 - class_format_error( 67.63 - (!EnableInvokeDynamic ? 67.64 - "invokedynamic instructions not enabled in this JVM" : 67.65 - "invokedynamic instructions not supported by this class file version"), 67.66 - _klass->external_name()); 67.67 + if (!EnableInvokeDynamic) { 67.68 + class_format_error("invokedynamic instructions not enabled in this JVM"); 67.69 + } else { 67.70 + class_format_error("invokedynamic instructions not supported by this class file version (%d), class %s", 67.71 + _klass->major_version(), _klass->external_name()); 67.72 + } 67.73 return; 67.74 } 67.75 } else {
68.1 --- a/src/share/vm/classfile/verifier.hpp Wed May 28 12:07:21 2014 -0700 68.2 +++ b/src/share/vm/classfile/verifier.hpp Thu May 29 09:56:06 2014 -0700 68.3 @@ -378,15 +378,15 @@ 68.4 bool has_error() const { return result() != NULL; } 68.5 char* exception_message() { 68.6 stringStream ss; 68.7 - ss.print(_message); 68.8 + ss.print("%s", _message); 68.9 _error_context.details(&ss, _method()); 68.10 return ss.as_string(); 68.11 } 68.12 68.13 // Called when verify or class format errors are encountered. 68.14 // May throw an exception based upon the mode. 68.15 - void verify_error(ErrorContext ctx, const char* fmt, ...); 68.16 - void class_format_error(const char* fmt, ...); 68.17 + void verify_error(ErrorContext ctx, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4); 68.18 + void class_format_error(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3); 68.19 68.20 Klass* load_class(Symbol* name, TRAPS); 68.21
69.1 --- a/src/share/vm/classfile/vmSymbols.cpp Wed May 28 12:07:21 2014 -0700 69.2 +++ b/src/share/vm/classfile/vmSymbols.cpp Thu May 29 09:56:06 2014 -0700 69.3 @@ -1,5 +1,5 @@ 69.4 /* 69.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 69.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 69.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 69.8 * 69.9 * This code is free software; you can redistribute it and/or modify it 69.10 @@ -533,7 +533,7 @@ 69.11 xtty->begin_elem("intrinsic_misdeclared actual='%s' declared='%s'", 69.12 actual_name, declared_name); 69.13 xtty->method(mh); 69.14 - xtty->end_elem(""); 69.15 + xtty->end_elem("%s", ""); 69.16 } 69.17 if (PrintMiscellaneous && (WizardMode || Verbose)) { 69.18 tty->print_cr("*** misidentified method; %s(%d) should be %s(%d):",
70.1 --- a/src/share/vm/code/codeBlob.cpp Wed May 28 12:07:21 2014 -0700 70.2 +++ b/src/share/vm/code/codeBlob.cpp Thu May 29 09:56:06 2014 -0700 70.3 @@ -1,5 +1,5 @@ 70.4 /* 70.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 70.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 70.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 70.8 * 70.9 * This code is free software; you can redistribute it and/or modify it 70.10 @@ -530,7 +530,7 @@ 70.11 } 70.12 70.13 void CodeBlob::print_on(outputStream* st) const { 70.14 - st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this); 70.15 + st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", p2i(this)); 70.16 st->print_cr("Framesize: %d", _frame_size); 70.17 } 70.18 70.19 @@ -548,7 +548,7 @@ 70.20 } 70.21 70.22 void BufferBlob::print_value_on(outputStream* st) const { 70.23 - st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", this, name()); 70.24 + st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", p2i(this), name()); 70.25 } 70.26 70.27 void RuntimeStub::verify() { 70.28 @@ -558,13 +558,13 @@ 70.29 void RuntimeStub::print_on(outputStream* st) const { 70.30 ttyLocker ttyl; 70.31 CodeBlob::print_on(st); 70.32 - st->print("Runtime Stub (" INTPTR_FORMAT "): ", this); 70.33 - st->print_cr(name()); 70.34 + st->print("Runtime Stub (" INTPTR_FORMAT "): ", p2i(this)); 70.35 + st->print_cr("%s", name()); 70.36 Disassembler::decode((CodeBlob*)this, st); 70.37 } 70.38 70.39 void RuntimeStub::print_value_on(outputStream* st) const { 70.40 - st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name()); 70.41 + st->print("RuntimeStub (" INTPTR_FORMAT "): ", p2i(this)); st->print("%s", name()); 70.42 } 70.43 70.44 void SingletonBlob::verify() { 70.45 @@ -574,12 +574,12 @@ 70.46 void SingletonBlob::print_on(outputStream* st) const { 70.47 ttyLocker ttyl; 70.48 CodeBlob::print_on(st); 70.49 - st->print_cr(name()); 70.50 + st->print_cr("%s", name()); 70.51 Disassembler::decode((CodeBlob*)this, st); 70.52 } 70.53 70.54 void SingletonBlob::print_value_on(outputStream* st) const { 70.55 - st->print_cr(name()); 70.56 + st->print_cr("%s", name()); 70.57 } 70.58 70.59 void DeoptimizationBlob::print_value_on(outputStream* st) const {
71.1 --- a/src/share/vm/code/codeCache.cpp Wed May 28 12:07:21 2014 -0700 71.2 +++ b/src/share/vm/code/codeCache.cpp Thu May 29 09:56:06 2014 -0700 71.3 @@ -1,5 +1,5 @@ 71.4 /* 71.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 71.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 71.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 71.8 * 71.9 * This code is free software; you can redistribute it and/or modify it 71.10 @@ -81,10 +81,10 @@ 71.11 bool is_empty() { return count == 0; } 71.12 71.13 void print(const char* title) { 71.14 - tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, data %d%%, pcs %d%%])", 71.15 + tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, metadata %d%%, data %d%%, pcs %d%%])", 71.16 count, 71.17 title, 71.18 - total() / K, 71.19 + (int)(total() / K), 71.20 header_size * 100 / total_size, 71.21 relocation_size * 100 / total_size, 71.22 code_size * 100 / total_size, 71.23 @@ -191,7 +191,7 @@ 71.24 } 71.25 if (PrintCodeCacheExtension) { 71.26 ResourceMark rm; 71.27 - tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)", 71.28 + tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)", 71.29 (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(), 71.30 (address)_heap->high() - (address)_heap->low_boundary()); 71.31 } 71.32 @@ -496,7 +496,7 @@ 71.33 if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) { 71.34 CompiledIC *ic = CompiledIC_at(iter.reloc()); 71.35 if (TraceCompiledIC) { 71.36 - tty->print("noticed icholder " INTPTR_FORMAT " ", ic->cached_icholder()); 71.37 + tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder())); 71.38 ic->print(); 71.39 } 71.40 assert(ic->cached_icholder() != NULL, "must be non-NULL"); 71.41 @@ -775,7 +775,7 @@ 71.42 if (PrintCodeCache2) { // Need to add a new flag 71.43 ResourceMark rm; 71.44 if (size == 0) size = cb->size(); 71.45 - tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, cb, size); 71.46 + tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, p2i(cb), size); 71.47 } 71.48 } 71.49 71.50 @@ -900,7 +900,7 @@ 71.51 71.52 tty->print_cr("CodeCache:"); 71.53 71.54 - tty->print_cr("nmethod dependency checking time %f", dependentCheckTime.seconds(), 71.55 + tty->print_cr("nmethod dependency checking time %f, per dependent %f", dependentCheckTime.seconds(), 71.56 dependentCheckTime.seconds() / dependentCheckCount); 71.57 71.58 if (!live.is_empty()) { 71.59 @@ -947,9 +947,9 @@ 71.60 71.61 if (detailed) { 71.62 st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]", 71.63 - _heap->low_boundary(), 71.64 - _heap->high(), 71.65 - _heap->high_boundary()); 71.66 + p2i(_heap->low_boundary()), 71.67 + p2i(_heap->high()), 71.68 + p2i(_heap->high_boundary())); 71.69 st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT 71.70 " adapters=" UINT32_FORMAT, 71.71 nof_blobs(), nof_nmethods(), nof_adapters());
72.1 --- a/src/share/vm/code/compiledIC.cpp Wed May 28 12:07:21 2014 -0700 72.2 +++ b/src/share/vm/code/compiledIC.cpp Thu May 29 09:56:06 2014 -0700 72.3 @@ -1,5 +1,5 @@ 72.4 /* 72.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 72.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 72.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 72.8 * 72.9 * This code is free software; you can redistribute it and/or modify it 72.10 @@ -88,9 +88,9 @@ 72.11 if (TraceCompiledIC) { 72.12 tty->print(" "); 72.13 print_compiled_ic(); 72.14 - tty->print(" changing destination to " INTPTR_FORMAT, entry_point); 72.15 + tty->print(" changing destination to " INTPTR_FORMAT, p2i(entry_point)); 72.16 if (!is_optimized()) { 72.17 - tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", (address)cache); 72.18 + tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", p2i((address)cache)); 72.19 } 72.20 if (is_icstub) { 72.21 tty->print(" (icstub)"); 72.22 @@ -195,7 +195,7 @@ 72.23 if (TraceICs) { 72.24 ResourceMark rm; 72.25 tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT, 72.26 - instruction_address(), call_info->selected_method()->print_value_string(), entry); 72.27 + p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry)); 72.28 } 72.29 72.30 // We can't check this anymore. With lazy deopt we could have already 72.31 @@ -272,7 +272,7 @@ 72.32 void CompiledIC::set_to_clean() { 72.33 assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call"); 72.34 if (TraceInlineCacheClearing || TraceICs) { 72.35 - tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", instruction_address()); 72.36 + tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address())); 72.37 print(); 72.38 } 72.39 72.40 @@ -354,7 +354,7 @@ 72.41 if (TraceICs) { 72.42 ResourceMark rm(thread); 72.43 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s", 72.44 - instruction_address(), 72.45 + p2i(instruction_address()), 72.46 method->print_value_string()); 72.47 } 72.48 } else { 72.49 @@ -362,7 +362,7 @@ 72.50 InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry()); 72.51 if (TraceICs) { 72.52 ResourceMark rm(thread); 72.53 - tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", instruction_address()); 72.54 + tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address())); 72.55 } 72.56 } 72.57 } else { 72.58 @@ -392,7 +392,7 @@ 72.59 ResourceMark rm(thread); 72.60 assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be"); 72.61 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s", 72.62 - instruction_address(), 72.63 + p2i(instruction_address()), 72.64 ((Klass*)info.cached_metadata())->print_value_string(), 72.65 (safe) ? "" : "via stub"); 72.66 } 72.67 @@ -530,8 +530,8 @@ 72.68 if (TraceICs) { 72.69 ResourceMark rm; 72.70 tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT, 72.71 - instruction_address(), 72.72 - info.entry()); 72.73 + p2i(instruction_address()), 72.74 + p2i(info.entry())); 72.75 } 72.76 // Call to compiled code 72.77 assert (CodeCache::contains(info.entry()), "wrong entry point"); 72.78 @@ -600,11 +600,11 @@ 72.79 72.80 void CompiledIC::print_compiled_ic() { 72.81 tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT, 72.82 - instruction_address(), is_call_to_interpreted() ? "interpreted " : "", ic_destination(), is_optimized() ? NULL : cached_value()); 72.83 + p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value())); 72.84 } 72.85 72.86 void CompiledStaticCall::print() { 72.87 - tty->print("static call at " INTPTR_FORMAT " -> ", instruction_address()); 72.88 + tty->print("static call at " INTPTR_FORMAT " -> ", p2i(instruction_address())); 72.89 if (is_clean()) { 72.90 tty->print("clean"); 72.91 } else if (is_call_to_compiled()) {
73.1 --- a/src/share/vm/code/compressedStream.cpp Wed May 28 12:07:21 2014 -0700 73.2 +++ b/src/share/vm/code/compressedStream.cpp Thu May 29 09:56:06 2014 -0700 73.3 @@ -1,5 +1,5 @@ 73.4 /* 73.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 73.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 73.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 73.8 * 73.9 * This code is free software; you can redistribute it and/or modify it 73.10 @@ -212,6 +212,8 @@ 73.11 return h ^ l; 73.12 } 73.13 73.14 +PRAGMA_DIAG_PUSH 73.15 +PRAGMA_FORMAT_IGNORED // Someone needs to deal with this. 73.16 void test_compressed_stream(int trace) { 73.17 CompressedWriteStream bytes(stretch_limit * 100); 73.18 jint n; 73.19 @@ -275,6 +277,7 @@ 73.20 guarantee(length == length2, "bad length"); 73.21 guarantee(fails == 0, "test failures"); 73.22 } 73.23 +PRAGMA_DIAG_POP 73.24 73.25 #if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64) 73.26 #pragma warning(default: 4748)
74.1 --- a/src/share/vm/code/debugInfo.cpp Wed May 28 12:07:21 2014 -0700 74.2 +++ b/src/share/vm/code/debugInfo.cpp Thu May 29 09:56:06 2014 -0700 74.3 @@ -1,5 +1,5 @@ 74.4 /* 74.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 74.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 74.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 74.8 * 74.9 * This code is free software; you can redistribute it and/or modify it 74.10 @@ -28,7 +28,9 @@ 74.11 #include "code/nmethod.hpp" 74.12 #include "runtime/handles.inline.hpp" 74.13 74.14 -// Comstructors 74.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 74.16 + 74.17 +// Constructors 74.18 74.19 DebugInfoWriteStream::DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size) 74.20 : CompressedWriteStream(initial_size) {
75.1 --- a/src/share/vm/code/exceptionHandlerTable.cpp Wed May 28 12:07:21 2014 -0700 75.2 +++ b/src/share/vm/code/exceptionHandlerTable.cpp Thu May 29 09:56:06 2014 -0700 75.3 @@ -1,5 +1,5 @@ 75.4 /* 75.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 75.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 75.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 75.8 * 75.9 * This code is free software; you can redistribute it and/or modify it 75.10 @@ -27,6 +27,8 @@ 75.11 #include "code/nmethod.hpp" 75.12 #include "memory/allocation.inline.hpp" 75.13 75.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 75.15 + 75.16 void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) { 75.17 _nesting.check(); 75.18 if (_length >= _size) {
76.1 --- a/src/share/vm/code/icBuffer.cpp Wed May 28 12:07:21 2014 -0700 76.2 +++ b/src/share/vm/code/icBuffer.cpp Thu May 29 09:56:06 2014 -0700 76.3 @@ -1,5 +1,5 @@ 76.4 /* 76.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 76.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 76.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 76.8 * 76.9 * This code is free software; you can redistribute it and/or modify it 76.10 @@ -39,6 +39,7 @@ 76.11 #include "runtime/mutexLocker.hpp" 76.12 #include "runtime/stubRoutines.hpp" 76.13 76.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 76.15 76.16 DEF_STUB_INTERFACE(ICStub); 76.17
77.1 --- a/src/share/vm/code/nmethod.cpp Wed May 28 12:07:21 2014 -0700 77.2 +++ b/src/share/vm/code/nmethod.cpp Thu May 29 09:56:06 2014 -0700 77.3 @@ -1,5 +1,5 @@ 77.4 /* 77.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 77.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 77.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 77.8 * 77.9 * This code is free software; you can redistribute it and/or modify it 77.10 @@ -46,6 +46,8 @@ 77.11 #include "shark/sharkCompiler.hpp" 77.12 #endif 77.13 77.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 77.15 + 77.16 #ifdef DTRACE_ENABLED 77.17 77.18 // Only bother with this argument setup if dtrace is available
78.1 --- a/src/share/vm/code/pcDesc.cpp Wed May 28 12:07:21 2014 -0700 78.2 +++ b/src/share/vm/code/pcDesc.cpp Thu May 29 09:56:06 2014 -0700 78.3 @@ -1,5 +1,5 @@ 78.4 /* 78.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 78.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 78.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 78.8 * 78.9 * This code is free software; you can redistribute it and/or modify it 78.10 @@ -29,6 +29,8 @@ 78.11 #include "code/scopeDesc.hpp" 78.12 #include "memory/resourceArea.hpp" 78.13 78.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 78.15 + 78.16 PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) { 78.17 _pc_offset = pc_offset; 78.18 _scope_decode_offset = scope_decode_offset;
79.1 --- a/src/share/vm/code/relocInfo.cpp Wed May 28 12:07:21 2014 -0700 79.2 +++ b/src/share/vm/code/relocInfo.cpp Thu May 29 09:56:06 2014 -0700 79.3 @@ -1,5 +1,5 @@ 79.4 /* 79.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 79.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 79.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 79.8 * 79.9 * This code is free software; you can redistribute it and/or modify it 79.10 @@ -31,6 +31,7 @@ 79.11 #include "runtime/stubCodeGenerator.hpp" 79.12 #include "utilities/copy.hpp" 79.13 79.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 79.15 79.16 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none 79.17
80.1 --- a/src/share/vm/code/scopeDesc.cpp Wed May 28 12:07:21 2014 -0700 80.2 +++ b/src/share/vm/code/scopeDesc.cpp Thu May 29 09:56:06 2014 -0700 80.3 @@ -1,5 +1,5 @@ 80.4 /* 80.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 80.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 80.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 80.8 * 80.9 * This code is free software; you can redistribute it and/or modify it 80.10 @@ -30,6 +30,7 @@ 80.11 #include "oops/oop.inline.hpp" 80.12 #include "runtime/handles.inline.hpp" 80.13 80.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 80.15 80.16 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) { 80.17 _code = code;
81.1 --- a/src/share/vm/code/vtableStubs.cpp Wed May 28 12:07:21 2014 -0700 81.2 +++ b/src/share/vm/code/vtableStubs.cpp Thu May 29 09:56:06 2014 -0700 81.3 @@ -1,5 +1,5 @@ 81.4 /* 81.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 81.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 81.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 81.8 * 81.9 * This code is free software; you can redistribute it and/or modify it 81.10 @@ -39,6 +39,8 @@ 81.11 #include "opto/matcher.hpp" 81.12 #endif 81.13 81.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 81.15 + 81.16 // ----------------------------------------------------------------------------------------- 81.17 // Implementation of VtableStub 81.18
82.1 --- a/src/share/vm/compiler/compileBroker.cpp Wed May 28 12:07:21 2014 -0700 82.2 +++ b/src/share/vm/compiler/compileBroker.cpp Thu May 29 09:56:06 2014 -0700 82.3 @@ -206,7 +206,7 @@ 82.4 void log_nmethod(JavaThread* thread, nmethod* nm) { 82.5 log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]", 82.6 nm->compile_id(), nm->is_osr_method() ? "%" : "", 82.7 - nm, nm->code_begin(), nm->code_end()); 82.8 + p2i(nm), p2i(nm->code_begin()), p2i(nm->code_end())); 82.9 } 82.10 82.11 void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) { 82.12 @@ -1791,7 +1791,7 @@ 82.13 if (xtty != NULL) { 82.14 ttyLocker ttyl; 82.15 // Record any per thread log files 82.16 - xtty->elem("thread_logfile thread='%d' filename='%s'", thread_id, file_name); 82.17 + xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name); 82.18 } 82.19 return; 82.20 } 82.21 @@ -1822,7 +1822,7 @@ 82.22 if (_should_block) { 82.23 #ifndef PRODUCT 82.24 if (PrintCompilation && (Verbose || WizardMode)) 82.25 - tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", Thread::current()); 82.26 + tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", p2i(Thread::current())); 82.27 #endif 82.28 ThreadInVMfromNative tivfn(JavaThread::current()); 82.29 } 82.30 @@ -1839,7 +1839,7 @@ 82.31 CodeCache::print_summary(&s, detailed); 82.32 } 82.33 ttyLocker ttyl; 82.34 - tty->print(s.as_string()); 82.35 + tty->print("%s", s.as_string()); 82.36 } 82.37 82.38 // ------------------------------------------------------------------ 82.39 @@ -2044,7 +2044,7 @@ 82.40 // Lock to prevent tearing 82.41 ttyLocker ttyl; 82.42 xtty->begin_elem("code_cache_full"); 82.43 - xtty->print(s.as_string()); 82.44 + xtty->print("%s", s.as_string()); 82.45 xtty->stamp(); 82.46 xtty->end_elem(); 82.47 }
83.1 --- a/src/share/vm/compiler/compileLog.cpp Wed May 28 12:07:21 2014 -0700 83.2 +++ b/src/share/vm/compiler/compileLog.cpp Thu May 29 09:56:06 2014 -0700 83.3 @@ -1,5 +1,5 @@ 83.4 /* 83.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 83.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 83.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 83.8 * 83.9 * This code is free software; you can redistribute it and/or modify it 83.10 @@ -294,7 +294,7 @@ 83.11 // Print about successful method inlining. 83.12 void CompileLog::inline_success(const char* reason) { 83.13 begin_elem("inline_success reason='"); 83.14 - text(reason); 83.15 + text("%s", reason); 83.16 end_elem("'"); 83.17 } 83.18 83.19 @@ -304,7 +304,7 @@ 83.20 // Print about failed method inlining. 83.21 void CompileLog::inline_fail(const char* reason) { 83.22 begin_elem("inline_fail reason='"); 83.23 - text(reason); 83.24 + text("%s", reason); 83.25 end_elem("'"); 83.26 } 83.27 83.28 @@ -330,5 +330,5 @@ 83.29 void CompileLog::code_cache_state() { 83.30 begin_elem("code_cache"); 83.31 CodeCache::log_state(this); 83.32 - end_elem(""); 83.33 + end_elem("%s", ""); 83.34 }
84.1 --- a/src/share/vm/compiler/compileLog.hpp Wed May 28 12:07:21 2014 -0700 84.2 +++ b/src/share/vm/compiler/compileLog.hpp Thu May 29 09:56:06 2014 -0700 84.3 @@ -1,5 +1,5 @@ 84.4 /* 84.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 84.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 84.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 84.8 * 84.9 * This code is free software; you can redistribute it and/or modify it 84.10 @@ -54,7 +54,7 @@ 84.11 84.12 static CompileLog* _first; // head of static chain 84.13 84.14 - void va_tag(bool push, const char* format, va_list ap); 84.15 + void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0); 84.16 84.17 public: 84.18 CompileLog(const char* file_name, FILE* fp, intx thread_id); 84.19 @@ -68,7 +68,7 @@ 84.20 // or reset, context string will be silently ignored 84.21 stringStream* context() { return &_context; } 84.22 void clear_context() { context()->reset(); } 84.23 - void set_context(const char* format, ...); 84.24 + void set_context(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 84.25 84.26 void name(ciSymbol* s); // name='s' 84.27 void name(Symbol* s) { xmlStream::name(s); }
85.1 --- a/src/share/vm/compiler/compilerOracle.cpp Wed May 28 12:07:21 2014 -0700 85.2 +++ b/src/share/vm/compiler/compilerOracle.cpp Thu May 29 09:56:06 2014 -0700 85.3 @@ -1,5 +1,5 @@ 85.4 /* 85.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 85.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 85.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 85.8 * 85.9 * This code is free software; you can redistribute it and/or modify it 85.10 @@ -539,7 +539,7 @@ 85.11 tty->print_cr("CompilerOracle: unrecognized line"); 85.12 tty->print_cr(" \"%s\"", original_line); 85.13 if (error_msg != NULL) { 85.14 - tty->print_cr(error_msg); 85.15 + tty->print_cr("%s", error_msg); 85.16 } 85.17 } 85.18 } 85.19 @@ -661,7 +661,7 @@ 85.20 char method_sep = have_colon ? ':' : '.'; 85.21 85.22 if (Verbose) { 85.23 - tty->print_cr(line); 85.24 + tty->print_cr("%s", line); 85.25 } 85.26 85.27 ResourceMark rm;
86.1 --- a/src/share/vm/compiler/disassembler.cpp Wed May 28 12:07:21 2014 -0700 86.2 +++ b/src/share/vm/compiler/disassembler.cpp Thu May 29 09:56:06 2014 -0700 86.3 @@ -1,5 +1,5 @@ 86.4 /* 86.5 - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. 86.6 + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. 86.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 86.8 * 86.9 * This code is free software; you can redistribute it and/or modify it 86.10 @@ -51,6 +51,8 @@ 86.11 #include "shark/sharkEntry.hpp" 86.12 #endif 86.13 86.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 86.15 + 86.16 void* Disassembler::_library = NULL; 86.17 bool Disassembler::_tried_to_load_library = false; 86.18 86.19 @@ -411,6 +413,7 @@ 86.20 return env->handle_event(event, (address) arg); 86.21 } 86.22 86.23 +ATTRIBUTE_PRINTF(2, 3) 86.24 static int printf_to_env(void* env_pv, const char* format, ...) { 86.25 decode_env* env = (decode_env*) env_pv; 86.26 outputStream* st = env->output();
87.1 --- a/src/share/vm/compiler/methodLiveness.cpp Wed May 28 12:07:21 2014 -0700 87.2 +++ b/src/share/vm/compiler/methodLiveness.cpp Thu May 29 09:56:06 2014 -0700 87.3 @@ -1,5 +1,5 @@ 87.4 /* 87.5 - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. 87.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 87.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 87.8 * 87.9 * This code is free software; you can redistribute it and/or modify it 87.10 @@ -32,6 +32,8 @@ 87.11 #include "memory/allocation.inline.hpp" 87.12 #include "utilities/bitMap.inline.hpp" 87.13 87.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 87.15 + 87.16 // The MethodLiveness class performs a simple liveness analysis on a method 87.17 // in order to decide which locals are live (that is, will be used again) at 87.18 // a particular bytecode index (bci).
88.1 --- a/src/share/vm/compiler/oopMap.cpp Wed May 28 12:07:21 2014 -0700 88.2 +++ b/src/share/vm/compiler/oopMap.cpp Thu May 29 09:56:06 2014 -0700 88.3 @@ -1,5 +1,5 @@ 88.4 /* 88.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 88.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 88.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 88.8 * 88.9 * This code is free software; you can redistribute it and/or modify it 88.10 @@ -646,8 +646,8 @@ 88.11 tty->print_cr( 88.12 "Add derived pointer@" INTPTR_FORMAT 88.13 " - Derived: " INTPTR_FORMAT 88.14 - " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: %d)", 88.15 - derived_loc, (address)*derived_loc, (address)*base_loc, base_loc, offset 88.16 + " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: " INTX_FORMAT ")", 88.17 + p2i(derived_loc), p2i((address)*derived_loc), p2i((address)*base_loc), p2i(base_loc), offset 88.18 ); 88.19 } 88.20 // Set derived oop location to point to base. 88.21 @@ -674,8 +674,8 @@ 88.22 88.23 if (TraceDerivedPointers) { 88.24 tty->print_cr("Updating derived pointer@" INTPTR_FORMAT 88.25 - " - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: %d)", 88.26 - derived_loc, (address)*derived_loc, (address)base, offset); 88.27 + " - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: " INTX_FORMAT ")", 88.28 + p2i(derived_loc), p2i((address)*derived_loc), p2i((address)base), offset); 88.29 } 88.30 88.31 // Delete entry
89.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp Wed May 28 12:07:21 2014 -0700 89.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp Thu May 29 09:56:06 2014 -0700 89.3 @@ -1,5 +1,5 @@ 89.4 /* 89.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 89.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 89.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 89.8 * 89.9 * This code is free software; you can redistribute it and/or modify it 89.10 @@ -157,7 +157,7 @@ 89.11 " split_deaths(" SIZE_FORMAT ")" 89.12 " coal_deaths(" SIZE_FORMAT ")" 89.13 " + count(" SSIZE_FORMAT ")", 89.14 - this, size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(), 89.15 + p2i(this), size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(), 89.16 _allocation_stats.split_births(), _allocation_stats.split_deaths(), 89.17 _allocation_stats.coal_deaths(), count())); 89.18 }
90.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Wed May 28 12:07:21 2014 -0700 90.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu May 29 09:56:06 2014 -0700 90.3 @@ -1,5 +1,5 @@ 90.4 /* 90.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 90.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 90.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 90.8 * 90.9 * This code is free software; you can redistribute it and/or modify it 90.10 @@ -427,7 +427,7 @@ 90.11 void LinearAllocBlock::print_on(outputStream* st) const { 90.12 st->print_cr(" LinearAllocBlock: ptr = " PTR_FORMAT ", word_size = " SIZE_FORMAT 90.13 ", refillsize = " SIZE_FORMAT ", allocation_size_limit = " SIZE_FORMAT, 90.14 - _ptr, _word_size, _refillSize, _allocation_size_limit); 90.15 + p2i(_ptr), _word_size, _refillSize, _allocation_size_limit); 90.16 } 90.17 90.18 void CompactibleFreeListSpace::print_on(outputStream* st) const { 90.19 @@ -458,7 +458,7 @@ 90.20 for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL; 90.21 fc = fc->next()) { 90.22 gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", 90.23 - fc, (HeapWord*)fc + i, 90.24 + p2i(fc), p2i((HeapWord*)fc + i), 90.25 fc->cantCoalesce() ? "\t CC" : ""); 90.26 } 90.27 } 90.28 @@ -502,7 +502,7 @@ 90.29 if (_sp->block_is_obj(addr)) { 90.30 const bool dead = _post_remark && !_live_bit_map->isMarked(addr); 90.31 _st->print_cr(PTR_FORMAT ": %s object of size " SIZE_FORMAT "%s", 90.32 - addr, 90.33 + p2i(addr), 90.34 dead ? "dead" : "live", 90.35 sz, 90.36 (!dead && CMSPrintObjectsInDump) ? ":" : "."); 90.37 @@ -512,7 +512,7 @@ 90.38 } 90.39 } else { // free block 90.40 _st->print_cr(PTR_FORMAT ": free block of size " SIZE_FORMAT "%s", 90.41 - addr, sz, CMSPrintChunksInDump ? ":" : "."); 90.42 + p2i(addr), sz, CMSPrintChunksInDump ? ":" : "."); 90.43 if (CMSPrintChunksInDump) { 90.44 ((FreeChunk*)addr)->print_on(_st); 90.45 _st->print_cr("--------------------------------------"); 90.46 @@ -564,11 +564,11 @@ 90.47 "--------------------------------\n"); 90.48 size_t total_size = totalSizeInIndexedFreeLists(); 90.49 size_t free_blocks = numFreeBlocksInIndexedFreeLists(); 90.50 - gclog_or_tty->print("Total Free Space: %d\n", total_size); 90.51 - gclog_or_tty->print("Max Chunk Size: %d\n", maxChunkSizeInIndexedFreeLists()); 90.52 - gclog_or_tty->print("Number of Blocks: %d\n", free_blocks); 90.53 + gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size); 90.54 + gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", maxChunkSizeInIndexedFreeLists()); 90.55 + gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks); 90.56 if (free_blocks != 0) { 90.57 - gclog_or_tty->print("Av. Block Size: %d\n", total_size/free_blocks); 90.58 + gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks); 90.59 } 90.60 } 90.61 90.62 @@ -2011,7 +2011,7 @@ 90.63 assert(ur.contains(urasm), 90.64 err_msg(" Error at save_marks(): [" PTR_FORMAT "," PTR_FORMAT ")" 90.65 " should contain [" PTR_FORMAT "," PTR_FORMAT ")", 90.66 - ur.start(), ur.end(), urasm.start(), urasm.end())); 90.67 + p2i(ur.start()), p2i(ur.end()), p2i(urasm.start()), p2i(urasm.end()))); 90.68 #endif 90.69 // inform allocator that promotions should be tracked. 90.70 assert(_promoInfo.noPromotions(), "_promoInfo inconsistency"); 90.71 @@ -2181,7 +2181,7 @@ 90.72 for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { 90.73 AdaptiveFreeList<FreeChunk>* fl = &_indexedFreeList[i]; 90.74 if (PrintFLSStatistics > 1) { 90.75 - gclog_or_tty->print("size[%d] : ", i); 90.76 + gclog_or_tty->print("size[" SIZE_FORMAT "] : ", i); 90.77 } 90.78 fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate); 90.79 fl->set_coal_desired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent)); 90.80 @@ -2234,7 +2234,7 @@ 90.81 if (PrintFLSStatistics > 0) { 90.82 HeapWord* largestAddr = (HeapWord*) dictionary()->find_largest_dict(); 90.83 gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT, 90.84 - largestAddr); 90.85 + p2i(largestAddr)); 90.86 } 90.87 setFLSurplus(); 90.88 setFLHints(); 90.89 @@ -2383,8 +2383,8 @@ 90.90 gclog_or_tty->print_cr( 90.91 " Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n" 90.92 " Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n", 90.93 - addr, res, was_obj ?"true":"false", was_live ?"true":"false", 90.94 - _last_addr, _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false"); 90.95 + p2i(addr), res, was_obj ?"true":"false", was_live ?"true":"false", 90.96 + p2i(_last_addr), _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false"); 90.97 _sp->print_on(gclog_or_tty); 90.98 guarantee(false, "Seppuku!"); 90.99 } 90.100 @@ -2712,7 +2712,7 @@ 90.101 _global_num_workers[i] = 0; 90.102 _global_num_blocks[i] = 0; 90.103 if (PrintOldPLAB) { 90.104 - gclog_or_tty->print_cr("[%d]: %d", i, (size_t)_blocks_to_claim[i].average()); 90.105 + gclog_or_tty->print_cr("[" SIZE_FORMAT "]: " SIZE_FORMAT, i, (size_t)_blocks_to_claim[i].average()); 90.106 } 90.107 } 90.108 } 90.109 @@ -2751,7 +2751,7 @@ 90.110 } 90.111 } 90.112 if (PrintOldPLAB) { 90.113 - gclog_or_tty->print_cr("%d[%d]: %d/%d/%d", 90.114 + gclog_or_tty->print_cr("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT, 90.115 tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average()); 90.116 } 90.117 // Reset stats for next round
91.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Wed May 28 12:07:21 2014 -0700 91.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Thu May 29 09:56:06 2014 -0700 91.3 @@ -1,5 +1,5 @@ 91.4 /* 91.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 91.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 91.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 91.8 * 91.9 * This code is free software; you can redistribute it and/or modify it 91.10 @@ -404,7 +404,7 @@ 91.11 if (CMSTraceSweeper) { 91.12 gclog_or_tty->print_cr(">>>>> Saving sweep limit " PTR_FORMAT 91.13 " for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<", 91.14 - _sweep_limit, bottom(), end()); 91.15 + p2i(_sweep_limit), p2i(bottom()), p2i(end())); 91.16 } 91.17 } 91.18 NOT_PRODUCT(
92.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed May 28 12:07:21 2014 -0700 92.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Thu May 29 09:56:06 2014 -0700 92.3 @@ -1,5 +1,5 @@ 92.4 /* 92.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 92.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 92.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 92.8 * 92.9 * This code is free software; you can redistribute it and/or modify it 92.10 @@ -63,6 +63,8 @@ 92.11 #include "services/memoryService.hpp" 92.12 #include "services/runtimeService.hpp" 92.13 92.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 92.15 + 92.16 // statics 92.17 CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL; 92.18 bool CMSCollector::_full_gc_requested = false; 92.19 @@ -1181,7 +1183,7 @@ 92.20 gclog_or_tty->print(" icms alloc limits: " 92.21 PTR_FORMAT "," PTR_FORMAT 92.22 " (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ", 92.23 - _icms_start_limit, _icms_stop_limit, 92.24 + p2i(_icms_start_limit), p2i(_icms_stop_limit), 92.25 percent_of_space(eden, _icms_start_limit), 92.26 percent_of_space(eden, _icms_stop_limit)); 92.27 if (Verbose) { 92.28 @@ -1209,7 +1211,7 @@ 92.29 gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT 92.30 ", new limit=" PTR_FORMAT 92.31 " (" SIZE_FORMAT "%%)", 92.32 - top, _icms_stop_limit, 92.33 + p2i(top), p2i(_icms_stop_limit), 92.34 percent_of_space(space, _icms_stop_limit)); 92.35 } 92.36 ConcurrentMarkSweepThread::start_icms(); 92.37 @@ -1226,7 +1228,7 @@ 92.38 gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT 92.39 ", new limit=" PTR_FORMAT 92.40 " (" SIZE_FORMAT "%%)", 92.41 - top, space->end(), 92.42 + p2i(top), p2i(space->end()), 92.43 percent_of_space(space, space->end())); 92.44 } 92.45 ConcurrentMarkSweepThread::stop_icms(); 92.46 @@ -1501,7 +1503,7 @@ 92.47 if (PrintCMSInitiationStatistics && stats().valid()) { 92.48 gclog_or_tty->print("CMSCollector shouldConcurrentCollect: "); 92.49 gclog_or_tty->stamp(); 92.50 - gclog_or_tty->print_cr(""); 92.51 + gclog_or_tty->cr(); 92.52 stats().print_on(gclog_or_tty); 92.53 gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f", 92.54 stats().time_until_cms_gen_full()); 92.55 @@ -3577,7 +3579,7 @@ 92.56 _collector->cmsGen()->short_name(), 92.57 _phase, _collector->timerValue(), _wallclock.seconds()); 92.58 if (_print_cr) { 92.59 - gclog_or_tty->print_cr(""); 92.60 + gclog_or_tty->cr(); 92.61 } 92.62 if (PrintCMSStatistics != 0) { 92.63 gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase, 92.64 @@ -6363,7 +6365,9 @@ 92.65 verify_overflow_empty(); 92.66 92.67 if (should_unload_classes()) { 92.68 - ClassLoaderDataGraph::purge(); 92.69 + // Delay purge to the beginning of the next safepoint. Metaspace::contains 92.70 + // requires that the virtual spaces are stable and not deleted. 92.71 + ClassLoaderDataGraph::set_should_purge(true); 92.72 } 92.73 92.74 _intra_sweep_timer.stop();
93.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Wed May 28 12:07:21 2014 -0700 93.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Thu May 29 09:56:06 2014 -0700 93.3 @@ -1,5 +1,5 @@ 93.4 /* 93.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 93.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 93.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 93.8 * 93.9 * This code is free software; you can redistribute it and/or modify it 93.10 @@ -111,7 +111,7 @@ 93.11 // From this time Thread::current() should be working. 93.12 assert(this == Thread::current(), "just checking"); 93.13 if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) { 93.14 - warning("Couldn't bind CMS thread to processor %u", CPUForCMSThread); 93.15 + warning("Couldn't bind CMS thread to processor " UINTX_FORMAT, CPUForCMSThread); 93.16 } 93.17 // Wait until Universe::is_fully_initialized() 93.18 {
94.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp Wed May 28 12:07:21 2014 -0700 94.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp Thu May 29 09:56:06 2014 -0700 94.3 @@ -1,5 +1,5 @@ 94.4 /* 94.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 94.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 94.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 94.8 * 94.9 * This code is free software; you can redistribute it and/or modify it 94.10 @@ -241,7 +241,7 @@ 94.11 jio_snprintf(buf, sizeof(buf), " [%.3f: CMSThread %s] ", 94.12 ts.seconds(), desc); 94.13 buf[sizeof(buf) - 1] = '\0'; 94.14 - gclog_or_tty->print(buf); 94.15 + gclog_or_tty->print("%s", buf); 94.16 } 94.17 } 94.18 94.19 @@ -273,7 +273,7 @@ 94.20 inline void tick() { 94.21 _ticks++; 94.22 if (CMSLoopWarn && _ticks % _threshold == 0) { 94.23 - warning("%s has looped %d times %s", _src, _ticks, _msg); 94.24 + warning("%s has looped " INTX_FORMAT " times %s", _src, _ticks, _msg); 94.25 } 94.26 } 94.27 };
95.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp Wed May 28 12:07:21 2014 -0700 95.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp Thu May 29 09:56:06 2014 -0700 95.3 @@ -1,5 +1,5 @@ 95.4 /* 95.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 95.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 95.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 95.8 * 95.9 * This code is free software; you can redistribute it and/or modify it 95.10 @@ -27,6 +27,8 @@ 95.11 #include "memory/freeBlockDictionary.hpp" 95.12 #include "utilities/copy.hpp" 95.13 95.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 95.15 + 95.16 #ifndef PRODUCT 95.17 95.18 #define baadbabeHeapWord badHeapWordVal
96.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp Wed May 28 12:07:21 2014 -0700 96.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp Thu May 29 09:56:06 2014 -0700 96.3 @@ -1,5 +1,5 @@ 96.4 /* 96.5 - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 96.6 + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 96.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 96.8 * 96.9 * This code is free software; you can redistribute it and/or modify it 96.10 @@ -28,6 +28,8 @@ 96.11 #include "oops/markOop.inline.hpp" 96.12 #include "oops/oop.inline.hpp" 96.13 96.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 96.15 + 96.16 ///////////////////////////////////////////////////////////////////////// 96.17 //// PromotionInfo 96.18 /////////////////////////////////////////////////////////////////////////
97.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp Wed May 28 12:07:21 2014 -0700 97.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp Thu May 29 09:56:06 2014 -0700 97.3 @@ -1,5 +1,5 @@ 97.4 /* 97.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 97.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 97.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 97.8 * 97.9 * This code is free software; you can redistribute it and/or modify it 97.10 @@ -34,6 +34,7 @@ 97.11 #include "runtime/os.hpp" 97.12 #include "utilities/dtrace.hpp" 97.13 97.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 97.15 97.16 #ifndef USDT2 97.17 HS_DTRACE_PROBE_DECL(hs_private, cms__initmark__begin);
98.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed May 28 12:07:21 2014 -0700 98.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu May 29 09:56:06 2014 -0700 98.3 @@ -1,5 +1,5 @@ 98.4 /* 98.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 98.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 98.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 98.8 * 98.9 * This code is free software; you can redistribute it and/or modify it 98.10 @@ -537,7 +537,7 @@ 98.11 98.12 if (verbose_low()) { 98.13 gclog_or_tty->print_cr("[global] init, heap start = "PTR_FORMAT", " 98.14 - "heap end = "PTR_FORMAT, _heap_start, _heap_end); 98.15 + "heap end = " INTPTR_FORMAT, p2i(_heap_start), p2i(_heap_end)); 98.16 } 98.17 98.18 if (!_markBitMap1.allocate(heap_rs)) { 98.19 @@ -567,8 +567,8 @@ 98.20 _root_regions.init(_g1h, this); 98.21 98.22 if (ConcGCThreads > ParallelGCThreads) { 98.23 - warning("Can't have more ConcGCThreads (" UINT32_FORMAT ") " 98.24 - "than ParallelGCThreads (" UINT32_FORMAT ").", 98.25 + warning("Can't have more ConcGCThreads (" UINTX_FORMAT ") " 98.26 + "than ParallelGCThreads (" UINTX_FORMAT ").", 98.27 ConcGCThreads, ParallelGCThreads); 98.28 return; 98.29 } 98.30 @@ -651,7 +651,7 @@ 98.31 if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) { 98.32 warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): " 98.33 "must be between " UINTX_FORMAT " and " UINTX_FORMAT, 98.34 - mark_stack_size, 1, MarkStackSizeMax); 98.35 + mark_stack_size, (uintx) 1, MarkStackSizeMax); 98.36 return; 98.37 } 98.38 FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size); 98.39 @@ -662,7 +662,7 @@ 98.40 if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) { 98.41 warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): " 98.42 "must be between " UINTX_FORMAT " and " UINTX_FORMAT, 98.43 - MarkStackSize, 1, MarkStackSizeMax); 98.44 + MarkStackSize, (uintx) 1, MarkStackSizeMax); 98.45 return; 98.46 } 98.47 } else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) { 98.48 @@ -821,7 +821,7 @@ 98.49 assert(!concurrent_marking_in_progress(), "invariant"); 98.50 assert(_finger == _heap_end, 98.51 err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT, 98.52 - _finger, _heap_end)); 98.53 + p2i(_finger), p2i(_heap_end))); 98.54 update_g1_committed(true); 98.55 } 98.56 } 98.57 @@ -1422,7 +1422,7 @@ 98.58 assert(start <= hr->end() && start <= ntams && ntams <= hr->end(), 98.59 err_msg("Preconditions not met - " 98.60 "start: "PTR_FORMAT", ntams: "PTR_FORMAT", end: "PTR_FORMAT, 98.61 - start, ntams, hr->end())); 98.62 + p2i(start), p2i(ntams), p2i(hr->end()))); 98.63 98.64 // Find the first marked object at or after "start". 98.65 start = _bm->getNextMarkedWordAddress(start, ntams); 98.66 @@ -1607,7 +1607,7 @@ 98.67 if (failures > 0 && _verbose) { 98.68 gclog_or_tty->print_cr("Region " HR_FORMAT ", ntams: " PTR_FORMAT ", " 98.69 "marked_bytes: calc/actual " SIZE_FORMAT "/" SIZE_FORMAT, 98.70 - HR_FORMAT_PARAMS(hr), hr->next_top_at_mark_start(), 98.71 + HR_FORMAT_PARAMS(hr), p2i(hr->next_top_at_mark_start()), 98.72 _calc_cl.region_marked_bytes(), hr->next_marked_bytes()); 98.73 } 98.74 98.75 @@ -2237,7 +2237,7 @@ 98.76 if (_cm->verbose_high()) { 98.77 gclog_or_tty->print_cr("\t[%u] we're looking at location " 98.78 "*"PTR_FORMAT" = "PTR_FORMAT, 98.79 - _task->worker_id(), p, (void*) obj); 98.80 + _task->worker_id(), p2i(p), p2i((void*) obj)); 98.81 } 98.82 98.83 _task->deal_with_reference(obj); 98.84 @@ -2672,7 +2672,7 @@ 98.85 } 98.86 98.87 _out->print_cr(" "PTR_FORMAT": "PTR_FORMAT"%s%s", 98.88 - p, (void*) obj, str, str2); 98.89 + p2i(p), p2i((void*) obj), str, str2); 98.90 } 98.91 }; 98.92 98.93 @@ -2699,7 +2699,7 @@ 98.94 98.95 if (print_it) { 98.96 _out->print_cr(" "PTR_FORMAT"%s", 98.97 - (void *)o, (over_tams) ? " >" : (marked) ? " M" : ""); 98.98 + p2i((void *)o), (over_tams) ? " >" : (marked) ? " M" : ""); 98.99 PrintReachableOopClosure oopCl(_out, _vo, _all); 98.100 o->oop_iterate_no_header(&oopCl); 98.101 } 98.102 @@ -2720,14 +2720,14 @@ 98.103 HeapWord* t = hr->top(); 98.104 HeapWord* p = _g1h->top_at_mark_start(hr, _vo); 98.105 _out->print_cr("** ["PTR_FORMAT", "PTR_FORMAT"] top: "PTR_FORMAT" " 98.106 - "TAMS: "PTR_FORMAT, b, e, t, p); 98.107 + "TAMS: " PTR_FORMAT, p2i(b), p2i(e), p2i(t), p2i(p)); 98.108 _out->cr(); 98.109 98.110 HeapWord* from = b; 98.111 HeapWord* to = t; 98.112 98.113 if (to > from) { 98.114 - _out->print_cr("Objects in ["PTR_FORMAT", "PTR_FORMAT"]", from, to); 98.115 + _out->print_cr("Objects in [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(from), p2i(to)); 98.116 _out->cr(); 98.117 PrintReachableObjectClosure ocl(_out, _vo, _all, hr); 98.118 hr->object_iterate_mem_careful(MemRegion(from, to), &ocl); 98.119 @@ -2843,7 +2843,7 @@ 98.120 gclog_or_tty->print_cr("[%u] curr_region = "PTR_FORMAT" " 98.121 "["PTR_FORMAT", "PTR_FORMAT"), " 98.122 "limit = "PTR_FORMAT, 98.123 - worker_id, curr_region, bottom, end, limit); 98.124 + worker_id, p2i(curr_region), p2i(bottom), p2i(end), p2i(limit)); 98.125 } 98.126 98.127 // Is the gap between reading the finger and doing the CAS too long? 98.128 @@ -2857,13 +2857,13 @@ 98.129 98.130 if (verbose_low()) { 98.131 gclog_or_tty->print_cr("[%u] we were successful with region = " 98.132 - PTR_FORMAT, worker_id, curr_region); 98.133 + PTR_FORMAT, worker_id, p2i(curr_region)); 98.134 } 98.135 98.136 if (limit > bottom) { 98.137 if (verbose_low()) { 98.138 gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is not empty, " 98.139 - "returning it ", worker_id, curr_region); 98.140 + "returning it ", worker_id, p2i(curr_region)); 98.141 } 98.142 return curr_region; 98.143 } else { 98.144 @@ -2871,7 +2871,7 @@ 98.145 "the region limit should be at bottom"); 98.146 if (verbose_low()) { 98.147 gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is empty, " 98.148 - "returning NULL", worker_id, curr_region); 98.149 + "returning NULL", worker_id, p2i(curr_region)); 98.150 } 98.151 // we return NULL and the caller should try calling 98.152 // claim_region() again. 98.153 @@ -2883,7 +2883,7 @@ 98.154 gclog_or_tty->print_cr("[%u] somebody else moved the finger, " 98.155 "global finger = "PTR_FORMAT", " 98.156 "our finger = "PTR_FORMAT, 98.157 - worker_id, _finger, finger); 98.158 + worker_id, p2i(_finger), p2i(finger)); 98.159 } 98.160 98.161 // read it again 98.162 @@ -2922,7 +2922,7 @@ 98.163 void do_object_work(oop obj) { 98.164 guarantee(!_g1h->obj_in_cs(obj), 98.165 err_msg("obj: "PTR_FORMAT" in CSet, phase: %s, info: %d", 98.166 - (void*) obj, phase_str(), _info)); 98.167 + p2i((void*) obj), phase_str(), _info)); 98.168 } 98.169 98.170 public: 98.171 @@ -3001,7 +3001,7 @@ 98.172 HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger); 98.173 guarantee(global_finger == global_hr->bottom(), 98.174 err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT, 98.175 - global_finger, HR_FORMAT_PARAMS(global_hr))); 98.176 + p2i(global_finger), HR_FORMAT_PARAMS(global_hr))); 98.177 } 98.178 98.179 // Verify the task fingers 98.180 @@ -3015,7 +3015,7 @@ 98.181 guarantee(task_finger == task_hr->bottom() || 98.182 !task_hr->in_collection_set(), 98.183 err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT, 98.184 - task_finger, HR_FORMAT_PARAMS(task_hr))); 98.185 + p2i(task_finger), HR_FORMAT_PARAMS(task_hr))); 98.186 } 98.187 } 98.188 } 98.189 @@ -3059,7 +3059,7 @@ 98.190 err_msg("Preconditions not met - " 98.191 "start: "PTR_FORMAT", limit: "PTR_FORMAT", " 98.192 "top: "PTR_FORMAT", end: "PTR_FORMAT, 98.193 - start, limit, hr->top(), hr->end())); 98.194 + p2i(start), p2i(limit), p2i(hr->top()), p2i(hr->end()))); 98.195 98.196 assert(hr->next_marked_bytes() == 0, "Precondition"); 98.197 98.198 @@ -3295,7 +3295,7 @@ 98.199 98.200 void ConcurrentMark::print_on_error(outputStream* st) const { 98.201 st->print_cr("Marking Bits (Prev, Next): (CMBitMap*) " PTR_FORMAT ", (CMBitMap*) " PTR_FORMAT, 98.202 - _prevMarkBitMap, _nextMarkBitMap); 98.203 + p2i(_prevMarkBitMap), p2i(_nextMarkBitMap)); 98.204 _prevMarkBitMap->print_on_error(st, " Prev Bits: "); 98.205 _nextMarkBitMap->print_on_error(st, " Next Bits: "); 98.206 } 98.207 @@ -3332,11 +3332,11 @@ 98.208 // for debugging purposes 98.209 void ConcurrentMark::print_finger() { 98.210 gclog_or_tty->print_cr("heap ["PTR_FORMAT", "PTR_FORMAT"), global finger = "PTR_FORMAT, 98.211 - _heap_start, _heap_end, _finger); 98.212 + p2i(_heap_start), p2i(_heap_end), p2i(_finger)); 98.213 for (uint i = 0; i < _max_worker_id; ++i) { 98.214 - gclog_or_tty->print(" %u: "PTR_FORMAT, i, _tasks[i]->finger()); 98.215 + gclog_or_tty->print(" %u: " PTR_FORMAT, i, p2i(_tasks[i]->finger())); 98.216 } 98.217 - gclog_or_tty->print_cr(""); 98.218 + gclog_or_tty->cr(); 98.219 } 98.220 #endif 98.221 98.222 @@ -3345,7 +3345,7 @@ 98.223 98.224 if (_cm->verbose_high()) { 98.225 gclog_or_tty->print_cr("[%u] we're scanning object "PTR_FORMAT, 98.226 - _worker_id, (void*) obj); 98.227 + _worker_id, p2i((void*) obj)); 98.228 } 98.229 98.230 size_t obj_size = obj->size(); 98.231 @@ -3425,7 +3425,7 @@ 98.232 98.233 if (_cm->verbose_low()) { 98.234 gclog_or_tty->print_cr("[%u] setting up for region "PTR_FORMAT, 98.235 - _worker_id, hr); 98.236 + _worker_id, p2i(hr)); 98.237 } 98.238 98.239 _curr_region = hr; 98.240 @@ -3442,7 +3442,7 @@ 98.241 if (_cm->verbose_low()) { 98.242 gclog_or_tty->print_cr("[%u] found an empty region " 98.243 "["PTR_FORMAT", "PTR_FORMAT")", 98.244 - _worker_id, bottom, limit); 98.245 + _worker_id, p2i(bottom), p2i(limit)); 98.246 } 98.247 // The region was collected underneath our feet. 98.248 // We set the finger to bottom to ensure that the bitmap 98.249 @@ -3474,7 +3474,7 @@ 98.250 assert(_curr_region != NULL, "invariant"); 98.251 if (_cm->verbose_low()) { 98.252 gclog_or_tty->print_cr("[%u] giving up region "PTR_FORMAT, 98.253 - _worker_id, _curr_region); 98.254 + _worker_id, p2i(_curr_region)); 98.255 } 98.256 clear_region_fields(); 98.257 } 98.258 @@ -3754,7 +3754,7 @@ 98.259 98.260 if (_task_queue->size() > target_size) { 98.261 if (_cm->verbose_high()) { 98.262 - gclog_or_tty->print_cr("[%u] draining local queue, target size = %d", 98.263 + gclog_or_tty->print_cr("[%u] draining local queue, target size = " SIZE_FORMAT, 98.264 _worker_id, target_size); 98.265 } 98.266 98.267 @@ -3765,7 +3765,7 @@ 98.268 98.269 if (_cm->verbose_high()) { 98.270 gclog_or_tty->print_cr("[%u] popped "PTR_FORMAT, _worker_id, 98.271 - (void*) obj); 98.272 + p2i((void*) obj)); 98.273 } 98.274 98.275 assert(_g1h->is_in_g1_reserved((HeapWord*) obj), "invariant" ); 98.276 @@ -3810,7 +3810,7 @@ 98.277 98.278 if (_cm->mark_stack_size() > target_size) { 98.279 if (_cm->verbose_low()) { 98.280 - gclog_or_tty->print_cr("[%u] draining global_stack, target size %d", 98.281 + gclog_or_tty->print_cr("[%u] draining global_stack, target size " SIZE_FORMAT, 98.282 _worker_id, target_size); 98.283 } 98.284 98.285 @@ -3820,7 +3820,7 @@ 98.286 } 98.287 98.288 if (_cm->verbose_low()) { 98.289 - gclog_or_tty->print_cr("[%u] drained global stack, size = %d", 98.290 + gclog_or_tty->print_cr("[%u] drained global stack, size = " SIZE_FORMAT, 98.291 _worker_id, _cm->mark_stack_size()); 98.292 } 98.293 } 98.294 @@ -4150,7 +4150,7 @@ 98.295 gclog_or_tty->print_cr("[%u] we're scanning part " 98.296 "["PTR_FORMAT", "PTR_FORMAT") " 98.297 "of region "HR_FORMAT, 98.298 - _worker_id, _finger, _region_limit, 98.299 + _worker_id, p2i(_finger), p2i(_region_limit), 98.300 HR_FORMAT_PARAMS(_curr_region)); 98.301 } 98.302 98.303 @@ -4237,7 +4237,7 @@ 98.304 if (_cm->verbose_low()) { 98.305 gclog_or_tty->print_cr("[%u] we successfully claimed " 98.306 "region "PTR_FORMAT, 98.307 - _worker_id, claimed_region); 98.308 + _worker_id, p2i(claimed_region)); 98.309 } 98.310 98.311 setup_for_region(claimed_region); 98.312 @@ -4298,7 +4298,7 @@ 98.313 if (_cm->try_stealing(_worker_id, &_hash_seed, obj)) { 98.314 if (_cm->verbose_medium()) { 98.315 gclog_or_tty->print_cr("[%u] stolen "PTR_FORMAT" successfully", 98.316 - _worker_id, (void*) obj); 98.317 + _worker_id, p2i((void*) obj)); 98.318 } 98.319 98.320 statsOnly( ++_steals ); 98.321 @@ -4546,8 +4546,8 @@ 98.322 G1PPRL_SUM_ADDR_FORMAT("committed") 98.323 G1PPRL_SUM_ADDR_FORMAT("reserved") 98.324 G1PPRL_SUM_BYTE_FORMAT("region-size"), 98.325 - g1_committed.start(), g1_committed.end(), 98.326 - g1_reserved.start(), g1_reserved.end(), 98.327 + p2i(g1_committed.start()), p2i(g1_committed.end()), 98.328 + p2i(g1_reserved.start()), p2i(g1_reserved.end()), 98.329 HeapRegion::GrainBytes); 98.330 _out->print_cr(G1PPRL_LINE_PREFIX); 98.331 _out->print_cr(G1PPRL_LINE_PREFIX 98.332 @@ -4664,7 +4664,7 @@ 98.333 G1PPRL_DOUBLE_FORMAT 98.334 G1PPRL_BYTE_FORMAT 98.335 G1PPRL_BYTE_FORMAT, 98.336 - type, bottom, end, 98.337 + type, p2i(bottom), p2i(end), 98.338 used_bytes, prev_live_bytes, next_live_bytes, gc_eff, 98.339 remset_bytes, strong_code_roots_bytes); 98.340
99.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Wed May 28 12:07:21 2014 -0700 99.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Thu May 29 09:56:06 2014 -0700 99.3 @@ -1,5 +1,5 @@ 99.4 /* 99.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 99.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 99.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 99.8 * 99.9 * This code is free software; you can redistribute it and/or modify it 99.10 @@ -277,7 +277,7 @@ 99.11 assert(_nextMarkBitMap->isMarked(objAddr), "invariant"); 99.12 99.13 if (_cm->verbose_high()) { 99.14 - gclog_or_tty->print_cr("[%u] pushing "PTR_FORMAT, _worker_id, (void*) obj); 99.15 + gclog_or_tty->print_cr("[%u] pushing " PTR_FORMAT, _worker_id, p2i((void*) obj)); 99.16 } 99.17 99.18 if (!_task_queue->push(obj)) { 99.19 @@ -317,7 +317,7 @@ 99.20 inline void CMTask::deal_with_reference(oop obj) { 99.21 if (_cm->verbose_high()) { 99.22 gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT, 99.23 - _worker_id, (void*) obj); 99.24 + _worker_id, p2i((void*) obj)); 99.25 } 99.26 99.27 ++_refs_reached; 99.28 @@ -334,7 +334,7 @@ 99.29 if (!hr->obj_allocated_since_next_marking(obj)) { 99.30 if (_cm->verbose_high()) { 99.31 gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked", 99.32 - _worker_id, (void*) obj); 99.33 + _worker_id, p2i((void*) obj)); 99.34 } 99.35 99.36 // we need to mark it first 99.37 @@ -349,7 +349,7 @@ 99.38 if (_finger != NULL && objAddr < _finger) { 99.39 if (_cm->verbose_high()) { 99.40 gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), " 99.41 - "pushing it", _worker_id, _finger); 99.42 + "pushing it", _worker_id, p2i(_finger)); 99.43 } 99.44 push(obj); 99.45 } else if (_curr_region != NULL && objAddr < _region_limit) { 99.46 @@ -367,7 +367,7 @@ 99.47 if (_cm->verbose_high()) { 99.48 gclog_or_tty->print_cr("[%u] below the global finger " 99.49 "("PTR_FORMAT"), pushing it", 99.50 - _worker_id, global_finger); 99.51 + _worker_id, p2i(global_finger)); 99.52 } 99.53 push(obj); 99.54 } else { 99.55 @@ -382,7 +382,7 @@ 99.56 if (_cm->verbose_high()) { 99.57 gclog_or_tty->print_cr("[%u] below the global finger " 99.58 "("PTR_FORMAT"), pushing it", 99.59 - _worker_id, global_finger); 99.60 + _worker_id, p2i(global_finger)); 99.61 } 99.62 push(obj); 99.63 }
100.1 --- a/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp Wed May 28 12:07:21 2014 -0700 100.2 +++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp Thu May 29 09:56:06 2014 -0700 100.3 @@ -1,5 +1,5 @@ 100.4 /* 100.5 - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 100.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 100.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 100.8 * 100.9 * This code is free software; you can redistribute it and/or modify it 100.10 @@ -142,7 +142,7 @@ 100.11 void G1AllocRegion::fill_in_ext_msg(ar_ext_msg* msg, const char* message) { 100.12 msg->append("[%s] %s c: %u b: %s r: "PTR_FORMAT" u: "SIZE_FORMAT, 100.13 _name, message, _count, BOOL_TO_STR(_bot_updates), 100.14 - _alloc_region, _used_bytes_before); 100.15 + p2i(_alloc_region), _used_bytes_before); 100.16 } 100.17 100.18 void G1AllocRegion::init() {
101.1 --- a/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp Wed May 28 12:07:21 2014 -0700 101.2 +++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp Thu May 29 09:56:06 2014 -0700 101.3 @@ -1,5 +1,5 @@ 101.4 /* 101.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 101.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 101.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 101.8 * 101.9 * This code is free software; you can redistribute it and/or modify it 101.10 @@ -184,7 +184,7 @@ 101.11 101.12 class ar_ext_msg : public err_msg { 101.13 public: 101.14 - ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("") { 101.15 + ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("%s", "") { 101.16 alloc_region->fill_in_ext_msg(this, message); 101.17 } 101.18 };
102.1 --- a/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp Wed May 28 12:07:21 2014 -0700 102.2 +++ b/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp Thu May 29 09:56:06 2014 -0700 102.3 @@ -1,5 +1,5 @@ 102.4 /* 102.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 102.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 102.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 102.8 * 102.9 * This code is free software; you can redistribute it and/or modify it 102.10 @@ -65,7 +65,7 @@ 102.11 REGION_SIZE_IN_WORDS * HeapWordSize); 102.12 // Check address calculation (bounds) 102.13 assert(array.bottom_address_mapped() == fake_heap, 102.14 - err_msg("bottom mapped address should be "PTR_FORMAT", but is "PTR_FORMAT, fake_heap, array.bottom_address_mapped())); 102.15 + err_msg("bottom mapped address should be " PTR_FORMAT ", but is " PTR_FORMAT, p2i(fake_heap), p2i(array.bottom_address_mapped()))); 102.16 assert(array.end_address_mapped() == (fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS), "must be"); 102.17 102.18 int* bottom = array.address_mapped_to(fake_heap);
103.1 --- a/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp Wed May 28 12:07:21 2014 -0700 103.2 +++ b/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp Thu May 29 09:56:06 2014 -0700 103.3 @@ -1,5 +1,5 @@ 103.4 /* 103.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 103.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 103.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 103.8 * 103.9 * This code is free software; you can redistribute it and/or modify it 103.10 @@ -55,7 +55,7 @@ 103.11 void initialize_base(address base, size_t length, size_t bias, size_t elem_size, uint shift_by) { 103.12 assert(base != NULL, "just checking"); 103.13 assert(length > 0, "just checking"); 103.14 - assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %zd, larger than word size?", shift_by)); 103.15 + assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by " SSIZE_FORMAT ", larger than word size?", (size_t) shift_by)); 103.16 _base = base; 103.17 _length = length; 103.18 _biased_base = base - (bias * elem_size); 103.19 @@ -70,11 +70,11 @@ 103.20 assert(is_power_of_2(mapping_granularity_in_bytes), 103.21 err_msg("mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes)); 103.22 assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0, 103.23 - err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT, 103.24 - mapping_granularity_in_bytes, bottom)); 103.25 + err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT, 103.26 + mapping_granularity_in_bytes, p2i(bottom))); 103.27 assert((uintptr_t)end % mapping_granularity_in_bytes == 0, 103.28 - err_msg("end mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT, 103.29 - mapping_granularity_in_bytes, end)); 103.30 + err_msg("end mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT, 103.31 + mapping_granularity_in_bytes, p2i(end))); 103.32 size_t num_target_elems = (end - bottom) / (mapping_granularity_in_bytes / HeapWordSize); 103.33 idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes; 103.34 address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);
104.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Wed May 28 12:07:21 2014 -0700 104.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Thu May 29 09:56:06 2014 -0700 104.3 @@ -1,5 +1,5 @@ 104.4 /* 104.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 104.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 104.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 104.8 * 104.9 * This code is free software; you can redistribute it and/or modify it 104.10 @@ -29,6 +29,8 @@ 104.11 #include "runtime/java.hpp" 104.12 #include "services/memTracker.hpp" 104.13 104.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 104.15 + 104.16 ////////////////////////////////////////////////////////////////////// 104.17 // G1BlockOffsetSharedArray 104.18 //////////////////////////////////////////////////////////////////////
105.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp Wed May 28 12:07:21 2014 -0700 105.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp Thu May 29 09:56:06 2014 -0700 105.3 @@ -1,5 +1,5 @@ 105.4 /* 105.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 105.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 105.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 105.8 * 105.9 * This code is free software; you can redistribute it and/or modify it 105.10 @@ -80,7 +80,7 @@ 105.11 virtual void set_bottom(HeapWord* new_bottom) { 105.12 assert(new_bottom <= _end, 105.13 err_msg("new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")", 105.14 - new_bottom, _end)); 105.15 + p2i(new_bottom), p2i(_end))); 105.16 _bottom = new_bottom; 105.17 resize(pointer_delta(_end, _bottom)); 105.18 } 105.19 @@ -146,7 +146,7 @@ 105.20 void check_offset(size_t offset, const char* msg) const { 105.21 assert(offset <= N_words, 105.22 err_msg("%s - " 105.23 - "offset: " UINT32_FORMAT", N_words: " UINT32_FORMAT, 105.24 + "offset: " SIZE_FORMAT ", N_words: " UINT32_FORMAT, 105.25 msg, offset, N_words)); 105.26 } 105.27
106.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp Wed May 28 12:07:21 2014 -0700 106.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp Thu May 29 09:56:06 2014 -0700 106.3 @@ -1,5 +1,5 @@ 106.4 /* 106.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 106.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 106.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 106.8 * 106.9 * This code is free software; you can redistribute it and/or modify it 106.10 @@ -50,7 +50,7 @@ 106.11 assert(pc >= (char*)_reserved.start() && 106.12 pc < (char*)_reserved.end(), 106.13 err_msg("p (" PTR_FORMAT ") not in reserved [" PTR_FORMAT ", " PTR_FORMAT ")", 106.14 - p, (char*)_reserved.start(), (char*)_reserved.end())); 106.15 + p2i(p), p2i(_reserved.start()), p2i(_reserved.end()))); 106.16 size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char)); 106.17 size_t result = delta >> LogN; 106.18 check_index(result, "bad index from address"); 106.19 @@ -65,7 +65,7 @@ 106.20 err_msg("bad address from index result " PTR_FORMAT 106.21 " _reserved.start() " PTR_FORMAT " _reserved.end() " 106.22 PTR_FORMAT, 106.23 - result, _reserved.start(), _reserved.end())); 106.24 + p2i(result), p2i(_reserved.start()), p2i(_reserved.end()))); 106.25 return result; 106.26 } 106.27
107.1 --- a/src/share/vm/gc_implementation/g1/g1CardCounts.cpp Wed May 28 12:07:21 2014 -0700 107.2 +++ b/src/share/vm/gc_implementation/g1/g1CardCounts.cpp Thu May 29 09:56:06 2014 -0700 107.3 @@ -1,5 +1,5 @@ 107.4 /* 107.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 107.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 107.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 107.8 * 107.9 * This code is free software; you can redistribute it and/or modify it 107.10 @@ -31,6 +31,8 @@ 107.11 #include "services/memTracker.hpp" 107.12 #include "utilities/copy.hpp" 107.13 107.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 107.15 + 107.16 void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) { 107.17 if (has_count_table()) { 107.18 assert(from_card_num >= 0 && from_card_num < _committed_max_card_num,
108.1 --- a/src/share/vm/gc_implementation/g1/g1CardCounts.hpp Wed May 28 12:07:21 2014 -0700 108.2 +++ b/src/share/vm/gc_implementation/g1/g1CardCounts.hpp Thu May 29 09:56:06 2014 -0700 108.3 @@ -1,5 +1,5 @@ 108.4 /* 108.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 108.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 108.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 108.8 * 108.9 * This code is free software; you can redistribute it and/or modify it 108.10 @@ -77,10 +77,10 @@ 108.11 err_msg("Invalid card pointer: " 108.12 "card_ptr: " PTR_FORMAT ", " 108.13 "_ct_bot: " PTR_FORMAT, 108.14 - card_ptr, _ct_bot)); 108.15 + p2i(card_ptr), p2i(_ct_bot))); 108.16 size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte)); 108.17 assert(card_num >= 0 && card_num < _committed_max_card_num, 108.18 - err_msg("card pointer out of range: " PTR_FORMAT, card_ptr)); 108.19 + err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr))); 108.20 return card_num; 108.21 } 108.22
109.1 --- a/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp Wed May 28 12:07:21 2014 -0700 109.2 +++ b/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp Thu May 29 09:56:06 2014 -0700 109.3 @@ -28,6 +28,8 @@ 109.4 #include "gc_implementation/g1/g1CodeCacheRemSet.hpp" 109.5 #include "memory/iterator.hpp" 109.6 109.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 109.8 + 109.9 G1CodeRootChunk::G1CodeRootChunk() : _top(NULL), _next(NULL), _prev(NULL) { 109.10 _top = bottom(); 109.11 }
110.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed May 28 12:07:21 2014 -0700 110.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu May 29 09:56:06 2014 -0700 110.3 @@ -22,6 +22,10 @@ 110.4 * 110.5 */ 110.6 110.7 +#if !defined(__clang_major__) && defined(__GNUC__) 110.8 +#define ATTRIBUTE_PRINTF(x,y) // FIXME, formats are a mess. 110.9 +#endif 110.10 + 110.11 #include "precompiled.hpp" 110.12 #include "code/codeCache.hpp" 110.13 #include "code/icBuffer.hpp" 110.14 @@ -372,7 +376,7 @@ 110.15 } 110.16 } 110.17 110.18 - gclog_or_tty->print_cr(""); 110.19 + gclog_or_tty->cr(); 110.20 } 110.21 110.22 void G1CollectedHeap::push_dirty_cards_region(HeapRegion* hr) 110.23 @@ -3488,7 +3492,7 @@ 110.24 // help us track down what went wrong. This is why we call 110.25 // print_extended_on() instead of print_on(). 110.26 print_extended_on(gclog_or_tty); 110.27 - gclog_or_tty->print_cr(""); 110.28 + gclog_or_tty->cr(); 110.29 #ifndef PRODUCT 110.30 if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) { 110.31 concurrent_mark()->print_reachable("at-verification-failure", 110.32 @@ -3682,7 +3686,7 @@ 110.33 PrintRSetsClosure(const char* msg) : _msg(msg), _occupied_sum(0) { 110.34 gclog_or_tty->cr(); 110.35 gclog_or_tty->print_cr("========================================"); 110.36 - gclog_or_tty->print_cr(msg); 110.37 + gclog_or_tty->print_cr("%s", msg); 110.38 gclog_or_tty->cr(); 110.39 } 110.40 110.41 @@ -5416,7 +5420,7 @@ 110.42 if (_g1h->is_in_g1_reserved(p)) { 110.43 _par_scan_state->push_on_queue(p); 110.44 } else { 110.45 - assert(!ClassLoaderDataGraph::contains((address)p), 110.46 + assert(!Metaspace::contains((const void*)p), 110.47 err_msg("Otherwise need to call _copy_metadata_obj_cl->do_oop(p) " 110.48 PTR_FORMAT, p)); 110.49 _copy_non_heap_obj_cl->do_oop(p);
111.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp Wed May 28 12:07:21 2014 -0700 111.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp Thu May 29 09:56:06 2014 -0700 111.3 @@ -1,5 +1,5 @@ 111.4 /* 111.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 111.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 111.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 111.8 * 111.9 * This code is free software; you can redistribute it and/or modify it 111.10 @@ -165,7 +165,7 @@ 111.11 // points into the heap. 111.12 inline bool G1CollectedHeap::in_cset_fast_test(oop obj) { 111.13 assert(_in_cset_fast_test != NULL, "sanity"); 111.14 - assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, (HeapWord*)obj)); 111.15 + assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, p2i((HeapWord*)obj))); 111.16 // no need to subtract the bottom of the heap from obj, 111.17 // _in_cset_fast_test is biased 111.18 uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes;
112.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Wed May 28 12:07:21 2014 -0700 112.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Thu May 29 09:56:06 2014 -0700 112.3 @@ -1,5 +1,5 @@ 112.4 /* 112.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 112.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 112.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 112.8 * 112.9 * This code is free software; you can redistribute it and/or modify it 112.10 @@ -22,6 +22,10 @@ 112.11 * 112.12 */ 112.13 112.14 +#ifndef __clang_major__ 112.15 +#define ATTRIBUTE_PRINTF(x,y) // FIXME, formats are a mess. 112.16 +#endif 112.17 + 112.18 #include "precompiled.hpp" 112.19 #include "gc_implementation/g1/concurrentG1Refine.hpp" 112.20 #include "gc_implementation/g1/concurrentMark.hpp" 112.21 @@ -965,7 +969,7 @@ 112.22 112.23 #ifndef PRODUCT 112.24 if (G1YoungSurvRateVerbose) { 112.25 - gclog_or_tty->print_cr(""); 112.26 + gclog_or_tty->cr(); 112.27 _short_lived_surv_rate_group->print(); 112.28 // do that for any other surv rate groups too 112.29 } 112.30 @@ -2222,11 +2226,11 @@ 112.31 112.32 gclog_or_tty->print_cr("ALL PAUSES"); 112.33 print_summary_sd(" Total", &_total); 112.34 - gclog_or_tty->print_cr(""); 112.35 - gclog_or_tty->print_cr(""); 112.36 + gclog_or_tty->cr(); 112.37 + gclog_or_tty->cr(); 112.38 gclog_or_tty->print_cr(" Young GC Pauses: %8d", _young_pause_num); 112.39 gclog_or_tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num); 112.40 - gclog_or_tty->print_cr(""); 112.41 + gclog_or_tty->cr(); 112.42 112.43 gclog_or_tty->print_cr("EVACUATION PAUSES"); 112.44 112.45 @@ -2246,7 +2250,7 @@ 112.46 print_summary(" Clear CT", &_clear_ct); 112.47 print_summary(" Other", &_other); 112.48 } 112.49 - gclog_or_tty->print_cr(""); 112.50 + gclog_or_tty->cr(); 112.51 112.52 gclog_or_tty->print_cr("MISC"); 112.53 print_summary_sd(" Stop World", &_all_stop_world_times_ms);
113.1 --- a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp Wed May 28 12:07:21 2014 -0700 113.2 +++ b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp Thu May 29 09:56:06 2014 -0700 113.3 @@ -39,7 +39,7 @@ 113.4 int _indent_level; 113.5 int _cur; 113.6 113.7 - void vappend(const char* format, va_list ap) { 113.8 + void vappend(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0) { 113.9 int res = vsnprintf(&_buffer[_cur], BUFFER_LEN - _cur, format, ap); 113.10 if (res != -1) { 113.11 _cur += res; 113.12 @@ -63,14 +63,14 @@ 113.13 } 113.14 #endif 113.15 113.16 - void append(const char* format, ...) { 113.17 + void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) { 113.18 va_list ap; 113.19 va_start(ap, format); 113.20 vappend(format, ap); 113.21 va_end(ap); 113.22 } 113.23 113.24 - void append_and_print_cr(const char* format, ...) { 113.25 + void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) { 113.26 va_list ap; 113.27 va_start(ap, format); 113.28 vappend(format, ap); 113.29 @@ -80,6 +80,8 @@ 113.30 } 113.31 }; 113.32 113.33 +PRAGMA_DIAG_PUSH 113.34 +PRAGMA_FORMAT_NONLITERAL_IGNORED 113.35 template <class T> 113.36 void WorkerDataArray<T>::print(int level, const char* title) { 113.37 if (_length == 1) { 113.38 @@ -109,7 +111,7 @@ 113.39 } 113.40 113.41 if (G1Log::finest()) { 113.42 - buf.append_and_print_cr(""); 113.43 + buf.append_and_print_cr("%s", ""); 113.44 } 113.45 113.46 double avg = (double)sum / (double)_length; 113.47 @@ -129,6 +131,7 @@ 113.48 } 113.49 buf.append_and_print_cr("]"); 113.50 } 113.51 +PRAGMA_DIAG_POP 113.52 113.53 #ifndef PRODUCT 113.54
114.1 --- a/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp Wed May 28 12:07:21 2014 -0700 114.2 +++ b/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp Thu May 29 09:56:06 2014 -0700 114.3 @@ -1,5 +1,5 @@ 114.4 /* 114.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 114.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 114.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 114.8 * 114.9 * This code is free software; you can redistribute it and/or modify it 114.10 @@ -27,6 +27,8 @@ 114.11 #include "gc_implementation/g1/heapRegion.hpp" 114.12 #include "utilities/ostream.hpp" 114.13 114.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 114.15 + 114.16 const char* G1HRPrinter::action_name(ActionType action) { 114.17 switch(action) { 114.18 case Alloc: return "ALLOC";
115.1 --- a/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp Wed May 28 12:07:21 2014 -0700 115.2 +++ b/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp Thu May 29 09:56:06 2014 -0700 115.3 @@ -1,5 +1,5 @@ 115.4 /* 115.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 115.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 115.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 115.8 * 115.9 * This code is free software; you can redistribute it and/or modify it 115.10 @@ -114,7 +114,7 @@ 115.11 if (_cm->verbose_high()) { 115.12 gclog_or_tty->print_cr("[%u] we're looking at location " 115.13 "*"PTR_FORMAT" = "PTR_FORMAT, 115.14 - _task->worker_id(), p, (void*) obj); 115.15 + _task->worker_id(), p2i(p), p2i((void*) obj)); 115.16 } 115.17 _task->deal_with_reference(obj); 115.18 }
116.1 --- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp Wed May 28 12:07:21 2014 -0700 116.2 +++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp Thu May 29 09:56:06 2014 -0700 116.3 @@ -1,5 +1,5 @@ 116.4 /* 116.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 116.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 116.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 116.8 * 116.9 * This code is free software; you can redistribute it and/or modify it 116.10 @@ -39,6 +39,8 @@ 116.11 #include "oops/oop.inline.hpp" 116.12 #include "utilities/intHisto.hpp" 116.13 116.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 116.15 + 116.16 #define CARD_REPEAT_HISTO 0 116.17 116.18 #if CARD_REPEAT_HISTO
117.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp Wed May 28 12:07:21 2014 -0700 117.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu May 29 09:56:06 2014 -0700 117.3 @@ -34,6 +34,8 @@ 117.4 #include "memory/iterator.hpp" 117.5 #include "oops/oop.inline.hpp" 117.6 117.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 117.8 + 117.9 int HeapRegion::LogOfHRGrainBytes = 0; 117.10 int HeapRegion::LogOfHRGrainWords = 0; 117.11 size_t HeapRegion::GrainBytes = 0; 117.12 @@ -829,7 +831,7 @@ 117.13 Mutex::_no_safepoint_check_flag); 117.14 117.15 if (!_failures) { 117.16 - gclog_or_tty->print_cr(""); 117.17 + gclog_or_tty->cr(); 117.18 gclog_or_tty->print_cr("----------"); 117.19 } 117.20 if (!_g1h->is_in_closed_subset(obj)) { 117.21 @@ -884,7 +886,7 @@ 117.22 Mutex::_no_safepoint_check_flag); 117.23 117.24 if (!_failures) { 117.25 - gclog_or_tty->print_cr(""); 117.26 + gclog_or_tty->cr(); 117.27 gclog_or_tty->print_cr("----------"); 117.28 } 117.29 gclog_or_tty->print_cr("Missing rem set entry:");
118.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp Wed May 28 12:07:21 2014 -0700 118.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp Thu May 29 09:56:06 2014 -0700 118.3 @@ -1,5 +1,5 @@ 118.4 /* 118.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 118.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 118.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 118.8 * 118.9 * This code is free software; you can redistribute it and/or modify it 118.10 @@ -61,7 +61,7 @@ 118.11 (_hr_)->startsHumongous() ? "HS" : \ 118.12 (_hr_)->continuesHumongous() ? "HC" : \ 118.13 !(_hr_)->is_empty() ? "O" : "F", \ 118.14 - (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end() 118.15 + p2i((_hr_)->bottom()), p2i((_hr_)->top()), p2i((_hr_)->end()) 118.16 118.17 // sentinel value for hrs_index 118.18 #define G1_NULL_HRS_INDEX ((uint) -1) 118.19 @@ -550,7 +550,7 @@ 118.20 (containing_set != NULL && _containing_set == NULL), 118.21 err_msg("containing_set: "PTR_FORMAT" " 118.22 "_containing_set: "PTR_FORMAT, 118.23 - containing_set, _containing_set)); 118.24 + p2i(containing_set), p2i(_containing_set))); 118.25 118.26 _containing_set = containing_set; 118.27 }
119.1 --- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Wed May 28 12:07:21 2014 -0700 119.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Thu May 29 09:56:06 2014 -0700 119.3 @@ -36,6 +36,8 @@ 119.4 #include "utilities/globalDefinitions.hpp" 119.5 #include "utilities/growableArray.hpp" 119.6 119.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 119.8 + 119.9 class PerRegionTable: public CHeapObj<mtGC> { 119.10 friend class OtherRegionsTable; 119.11 friend class HeapRegionRemSetIterator; 119.12 @@ -1244,7 +1246,7 @@ 119.13 while (cur_evnt < _n_recorded_events && i == cur_evnt_ind) { 119.14 gclog_or_tty->print("Event: "); 119.15 print_event(gclog_or_tty, cur_evnt_kind); 119.16 - gclog_or_tty->print_cr(""); 119.17 + gclog_or_tty->cr(); 119.18 cur_evnt++; 119.19 if (cur_evnt < MaxRecordedEvents) { 119.20 cur_evnt_kind = _recorded_events[cur_evnt];
120.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Wed May 28 12:07:21 2014 -0700 120.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Thu May 29 09:56:06 2014 -0700 120.3 @@ -1,5 +1,5 @@ 120.4 /* 120.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 120.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 120.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 120.8 * 120.9 * This code is free software; you can redistribute it and/or modify it 120.10 @@ -233,7 +233,7 @@ 120.11 guarantee(hr != NULL, err_msg("invariant: i: %u", i)); 120.12 guarantee(hr->bottom() == prev_end, 120.13 err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT, 120.14 - i, HR_FORMAT_PARAMS(hr), prev_end)); 120.15 + i, HR_FORMAT_PARAMS(hr), p2i(prev_end))); 120.16 guarantee(hr->hrs_index() == i, 120.17 err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index())); 120.18 if (i < length()) {
121.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp Wed May 28 12:07:21 2014 -0700 121.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp Thu May 29 09:56:06 2014 -0700 121.3 @@ -1,5 +1,5 @@ 121.4 /* 121.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 121.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 121.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 121.8 * 121.9 * This code is free software; you can redistribute it and/or modify it 121.10 @@ -37,7 +37,7 @@ 121.11 inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const { 121.12 if (addr != NULL && addr < heap_end()) { 121.13 assert(addr >= heap_bottom(), 121.14 - err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, heap_bottom())); 121.15 + err_msg("addr: " PTR_FORMAT " bottom: " PTR_FORMAT, p2i(addr), p2i(heap_bottom()))); 121.16 return addr_to_region_unsafe(addr); 121.17 } 121.18 return NULL;
122.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSet.cpp Wed May 28 12:07:21 2014 -0700 122.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSet.cpp Thu May 29 09:56:06 2014 -0700 122.3 @@ -26,6 +26,8 @@ 122.4 #include "gc_implementation/g1/heapRegionRemSet.hpp" 122.5 #include "gc_implementation/g1/heapRegionSet.inline.hpp" 122.6 122.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 122.8 + 122.9 uint FreeRegionList::_unrealistically_long_length = 0; 122.10 122.11 void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) {
123.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSet.hpp Wed May 28 12:07:21 2014 -0700 123.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSet.hpp Thu May 29 09:56:06 2014 -0700 123.3 @@ -162,7 +162,7 @@ 123.4 // diagnosing failures. 123.5 class hrs_ext_msg : public hrs_err_msg { 123.6 public: 123.7 - hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") { 123.8 + hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("%s","") { 123.9 set->fill_in_ext_msg(this, message); 123.10 } 123.11 };
124.1 --- a/src/share/vm/gc_implementation/g1/satbQueue.cpp Wed May 28 12:07:21 2014 -0700 124.2 +++ b/src/share/vm/gc_implementation/g1/satbQueue.cpp Thu May 29 09:56:06 2014 -0700 124.3 @@ -1,5 +1,5 @@ 124.4 /* 124.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 124.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 124.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 124.8 * 124.9 * This code is free software; you can redistribute it and/or modify it 124.10 @@ -32,6 +32,8 @@ 124.11 #include "runtime/thread.hpp" 124.12 #include "runtime/vmThread.hpp" 124.13 124.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 124.15 + 124.16 void ObjPtrQueue::flush() { 124.17 // The buffer might contain refs into the CSet. We have to filter it 124.18 // first before we flush it, otherwise we might end up with an
125.1 --- a/src/share/vm/gc_implementation/g1/survRateGroup.cpp Wed May 28 12:07:21 2014 -0700 125.2 +++ b/src/share/vm/gc_implementation/g1/survRateGroup.cpp Thu May 29 09:56:06 2014 -0700 125.3 @@ -1,5 +1,5 @@ 125.4 /* 125.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 125.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 125.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 125.8 * 125.9 * This code is free software; you can redistribute it and/or modify it 125.10 @@ -29,6 +29,8 @@ 125.11 #include "gc_implementation/g1/survRateGroup.hpp" 125.12 #include "memory/allocation.hpp" 125.13 125.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 125.15 + 125.16 SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p, 125.17 const char* name, 125.18 size_t summary_surv_rates_len) : 125.19 @@ -202,7 +204,7 @@ 125.20 if (length == 0) 125.21 return; 125.22 125.23 - gclog_or_tty->print_cr(""); 125.24 + gclog_or_tty->cr(); 125.25 gclog_or_tty->print_cr("%s Rate Summary (for up to age %d)", _name, length-1); 125.26 gclog_or_tty->print_cr(" age range survival rate (avg) samples (avg)"); 125.27 gclog_or_tty->print_cr(" ---------------------------------------------------------");
126.1 --- a/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp Wed May 28 12:07:21 2014 -0700 126.2 +++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp Thu May 29 09:56:06 2014 -0700 126.3 @@ -1,5 +1,5 @@ 126.4 /* 126.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 126.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 126.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 126.8 * 126.9 * This code is free software; you can redistribute it and/or modify it 126.10 @@ -259,22 +259,22 @@ 126.11 requested_eden_size, requested_survivor_size); 126.12 gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " 126.13 SIZE_FORMAT, 126.14 - eden()->bottom(), 126.15 - eden()->end(), 126.16 + p2i(eden()->bottom()), 126.17 + p2i(eden()->end()), 126.18 pointer_delta(eden()->end(), 126.19 eden()->bottom(), 126.20 sizeof(char))); 126.21 gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " 126.22 SIZE_FORMAT, 126.23 - from()->bottom(), 126.24 - from()->end(), 126.25 + p2i(from()->bottom()), 126.26 + p2i(from()->end()), 126.27 pointer_delta(from()->end(), 126.28 from()->bottom(), 126.29 sizeof(char))); 126.30 gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " 126.31 SIZE_FORMAT, 126.32 - to()->bottom(), 126.33 - to()->end(), 126.34 + p2i(to()->bottom()), 126.35 + p2i(to()->end()), 126.36 pointer_delta( to()->end(), 126.37 to()->bottom(), 126.38 sizeof(char))); 126.39 @@ -382,18 +382,18 @@ 126.40 if (PrintAdaptiveSizePolicy && Verbose) { 126.41 gclog_or_tty->print_cr(" [eden_start .. eden_end): " 126.42 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 126.43 - eden_start, 126.44 - eden_end, 126.45 + p2i(eden_start), 126.46 + p2i(eden_end), 126.47 pointer_delta(eden_end, eden_start, sizeof(char))); 126.48 gclog_or_tty->print_cr(" [from_start .. from_end): " 126.49 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 126.50 - from_start, 126.51 - from_end, 126.52 + p2i(from_start), 126.53 + p2i(from_end), 126.54 pointer_delta(from_end, from_start, sizeof(char))); 126.55 gclog_or_tty->print_cr(" [ to_start .. to_end): " 126.56 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 126.57 - to_start, 126.58 - to_end, 126.59 + p2i(to_start), 126.60 + p2i(to_end), 126.61 pointer_delta( to_end, to_start, sizeof(char))); 126.62 } 126.63 } else { 126.64 @@ -473,18 +473,18 @@ 126.65 if (PrintAdaptiveSizePolicy && Verbose) { 126.66 gclog_or_tty->print_cr(" [eden_start .. eden_end): " 126.67 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 126.68 - eden_start, 126.69 - eden_end, 126.70 + p2i(eden_start), 126.71 + p2i(eden_end), 126.72 pointer_delta(eden_end, eden_start, sizeof(char))); 126.73 gclog_or_tty->print_cr(" [ to_start .. to_end): " 126.74 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 126.75 - to_start, 126.76 - to_end, 126.77 + p2i(to_start), 126.78 + p2i(to_end), 126.79 pointer_delta( to_end, to_start, sizeof(char))); 126.80 gclog_or_tty->print_cr(" [from_start .. from_end): " 126.81 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 126.82 - from_start, 126.83 - from_end, 126.84 + p2i(from_start), 126.85 + p2i(from_end), 126.86 pointer_delta(from_end, from_start, sizeof(char))); 126.87 } 126.88 }
127.1 --- a/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Wed May 28 12:07:21 2014 -0700 127.2 +++ b/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Thu May 29 09:56:06 2014 -0700 127.3 @@ -1,5 +1,5 @@ 127.4 /* 127.5 - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 127.6 + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. 127.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 127.8 * 127.9 * This code is free software; you can redistribute it and/or modify it 127.10 @@ -35,6 +35,8 @@ 127.11 #include "runtime/virtualspace.hpp" 127.12 #include "runtime/vmThread.hpp" 127.13 127.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 127.15 + 127.16 void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr, 127.17 OopsInGenClosure* cl, 127.18 CardTableRS* ct,
128.1 --- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Wed May 28 12:07:21 2014 -0700 128.2 +++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Thu May 29 09:56:06 2014 -0700 128.3 @@ -1,5 +1,5 @@ 128.4 /* 128.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 128.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 128.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 128.8 * 128.9 * This code is free software; you can redistribute it and/or modify it 128.10 @@ -55,6 +55,8 @@ 128.11 #include "utilities/globalDefinitions.hpp" 128.12 #include "utilities/workgroup.hpp" 128.13 128.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 128.15 + 128.16 #ifdef _MSC_VER 128.17 #pragma warning( push ) 128.18 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list
129.1 --- a/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp Wed May 28 12:07:21 2014 -0700 129.2 +++ b/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp Thu May 29 09:56:06 2014 -0700 129.3 @@ -1,5 +1,5 @@ 129.4 /* 129.5 - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 129.6 + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. 129.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 129.8 * 129.9 * This code is free software; you can redistribute it and/or modify it 129.10 @@ -79,12 +79,12 @@ 129.11 if ((HeapWord*)obj < _boundary) { 129.12 #ifndef PRODUCT 129.13 if (_g->to()->is_in_reserved(obj)) { 129.14 - tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p); 129.15 + tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p2i(p)); 129.16 GenCollectedHeap* gch = (GenCollectedHeap*)Universe::heap(); 129.17 Space* sp = gch->space_containing(p); 129.18 oop obj = oop(sp->block_start(p)); 129.19 assert((HeapWord*)obj < (HeapWord*)p, "Error"); 129.20 - tty->print_cr("Object: " PTR_FORMAT, (void *)obj); 129.21 + tty->print_cr("Object: " PTR_FORMAT, p2i((void *)obj)); 129.22 tty->print_cr("-------"); 129.23 obj->print(); 129.24 tty->print_cr("-----"); 129.25 @@ -110,7 +110,7 @@ 129.26 if (TraceScavenge) { 129.27 gclog_or_tty->print_cr("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", 129.28 "forwarded ", 129.29 - new_obj->klass()->internal_name(), p, (void *)obj, (void *)new_obj, new_obj->size()); 129.30 + new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size()); 129.31 } 129.32 #endif 129.33
130.1 --- a/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp Wed May 28 12:07:21 2014 -0700 130.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp Thu May 29 09:56:06 2014 -0700 130.3 @@ -1,5 +1,5 @@ 130.4 /* 130.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 130.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 130.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 130.8 * 130.9 * This code is free software; you can redistribute it and/or modify it 130.10 @@ -143,7 +143,7 @@ 130.11 130.12 if (TraceAdaptiveGCBoundary) { 130.13 gclog_or_tty->print_cr("Before expansion of old gen with boundary move"); 130.14 - gclog_or_tty->print_cr(" Requested change: 0x%x Attempted change: 0x%x", 130.15 + gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX, 130.16 expand_in_bytes, change_in_bytes); 130.17 if (!PrintHeapAtGC) { 130.18 Universe::print_on(gclog_or_tty); 130.19 @@ -201,7 +201,7 @@ 130.20 130.21 if (TraceAdaptiveGCBoundary) { 130.22 gclog_or_tty->print_cr("Before expansion of young gen with boundary move"); 130.23 - gclog_or_tty->print_cr(" Requested change: 0x%x Attempted change: 0x%x", 130.24 + gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX, 130.25 expand_in_bytes, change_in_bytes); 130.26 if (!PrintHeapAtGC) { 130.27 Universe::print_on(gclog_or_tty);
131.1 --- a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Wed May 28 12:07:21 2014 -0700 131.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Thu May 29 09:56:06 2014 -0700 131.3 @@ -1,5 +1,5 @@ 131.4 /* 131.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 131.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 131.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 131.8 * 131.9 * This code is free software; you can redistribute it and/or modify it 131.10 @@ -127,22 +127,22 @@ 131.11 size_t result_aligned = align_size_down(result, gen_alignment); 131.12 if (PrintAdaptiveSizePolicy && Verbose) { 131.13 gclog_or_tty->print_cr("\nASPSOldGen::available_for_contraction:" 131.14 - " %d K / 0x%x", result_aligned/K, result_aligned); 131.15 - gclog_or_tty->print_cr(" reserved().byte_size() %d K / 0x%x ", 131.16 - reserved().byte_size()/K, reserved().byte_size()); 131.17 + " " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX, (result_aligned/K), result_aligned); 131.18 + gclog_or_tty->print_cr(" reserved().byte_size() " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX " ", 131.19 + (reserved().byte_size()/K), reserved().byte_size()); 131.20 size_t working_promoted = (size_t) policy->avg_promoted()->padded_average(); 131.21 - gclog_or_tty->print_cr(" padded promoted %d K / 0x%x", 131.22 - working_promoted/K, working_promoted); 131.23 - gclog_or_tty->print_cr(" used %d K / 0x%x", 131.24 - used_in_bytes()/K, used_in_bytes()); 131.25 - gclog_or_tty->print_cr(" min_gen_size() %d K / 0x%x", 131.26 - min_gen_size()/K, min_gen_size()); 131.27 - gclog_or_tty->print_cr(" max_contraction %d K / 0x%x", 131.28 - max_contraction/K, max_contraction); 131.29 - gclog_or_tty->print_cr(" without alignment %d K / 0x%x", 131.30 - policy->promo_increment(max_contraction)/K, 131.31 + gclog_or_tty->print_cr(" padded promoted " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX, 131.32 + (working_promoted/K), working_promoted); 131.33 + gclog_or_tty->print_cr(" used " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX, 131.34 + (used_in_bytes()/K), used_in_bytes()); 131.35 + gclog_or_tty->print_cr(" min_gen_size() " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX, 131.36 + (min_gen_size()/K), min_gen_size()); 131.37 + gclog_or_tty->print_cr(" max_contraction " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX, 131.38 + (max_contraction/K), max_contraction); 131.39 + gclog_or_tty->print_cr(" without alignment " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX, 131.40 + (policy->promo_increment(max_contraction)/K), 131.41 policy->promo_increment(max_contraction)); 131.42 - gclog_or_tty->print_cr(" alignment 0x%x", gen_alignment); 131.43 + gclog_or_tty->print_cr(" alignment " SIZE_FORMAT_HEX, gen_alignment); 131.44 } 131.45 assert(result_aligned <= max_contraction, "arithmetic is wrong"); 131.46 return result_aligned;
132.1 --- a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Wed May 28 12:07:21 2014 -0700 132.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Thu May 29 09:56:06 2014 -0700 132.3 @@ -1,5 +1,5 @@ 132.4 /* 132.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 132.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 132.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 132.8 * 132.9 * This code is free software; you can redistribute it and/or modify it 132.10 @@ -112,11 +112,11 @@ 132.11 size_t result = policy->eden_increment_aligned_down(max_contraction); 132.12 size_t result_aligned = align_size_down(result, gen_alignment); 132.13 if (PrintAdaptiveSizePolicy && Verbose) { 132.14 - gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: %d K", 132.15 + gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K", 132.16 result_aligned/K); 132.17 - gclog_or_tty->print_cr(" max_contraction %d K", max_contraction/K); 132.18 - gclog_or_tty->print_cr(" eden_avail %d K", eden_avail/K); 132.19 - gclog_or_tty->print_cr(" gen_avail %d K", gen_avail/K); 132.20 + gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K", max_contraction/K); 132.21 + gclog_or_tty->print_cr(" eden_avail " SIZE_FORMAT " K", eden_avail/K); 132.22 + gclog_or_tty->print_cr(" gen_avail " SIZE_FORMAT " K", gen_avail/K); 132.23 } 132.24 return result_aligned; 132.25 } 132.26 @@ -252,22 +252,22 @@ 132.27 requested_eden_size, requested_survivor_size); 132.28 gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " 132.29 SIZE_FORMAT, 132.30 - eden_space()->bottom(), 132.31 - eden_space()->end(), 132.32 + p2i(eden_space()->bottom()), 132.33 + p2i(eden_space()->end()), 132.34 pointer_delta(eden_space()->end(), 132.35 eden_space()->bottom(), 132.36 sizeof(char))); 132.37 gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " 132.38 SIZE_FORMAT, 132.39 - from_space()->bottom(), 132.40 - from_space()->end(), 132.41 + p2i(from_space()->bottom()), 132.42 + p2i(from_space()->end()), 132.43 pointer_delta(from_space()->end(), 132.44 from_space()->bottom(), 132.45 sizeof(char))); 132.46 gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " 132.47 SIZE_FORMAT, 132.48 - to_space()->bottom(), 132.49 - to_space()->end(), 132.50 + p2i(to_space()->bottom()), 132.51 + p2i(to_space()->end()), 132.52 pointer_delta( to_space()->end(), 132.53 to_space()->bottom(), 132.54 sizeof(char))); 132.55 @@ -373,18 +373,18 @@ 132.56 if (PrintAdaptiveSizePolicy && Verbose) { 132.57 gclog_or_tty->print_cr(" [eden_start .. eden_end): " 132.58 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 132.59 - eden_start, 132.60 - eden_end, 132.61 + p2i(eden_start), 132.62 + p2i(eden_end), 132.63 pointer_delta(eden_end, eden_start, sizeof(char))); 132.64 gclog_or_tty->print_cr(" [from_start .. from_end): " 132.65 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 132.66 - from_start, 132.67 - from_end, 132.68 + p2i(from_start), 132.69 + p2i(from_end), 132.70 pointer_delta(from_end, from_start, sizeof(char))); 132.71 gclog_or_tty->print_cr(" [ to_start .. to_end): " 132.72 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 132.73 - to_start, 132.74 - to_end, 132.75 + p2i(to_start), 132.76 + p2i(to_end), 132.77 pointer_delta( to_end, to_start, sizeof(char))); 132.78 } 132.79 } else { 132.80 @@ -427,18 +427,18 @@ 132.81 if (PrintAdaptiveSizePolicy && Verbose) { 132.82 gclog_or_tty->print_cr(" [eden_start .. eden_end): " 132.83 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 132.84 - eden_start, 132.85 - eden_end, 132.86 + p2i(eden_start), 132.87 + p2i(eden_end), 132.88 pointer_delta(eden_end, eden_start, sizeof(char))); 132.89 gclog_or_tty->print_cr(" [ to_start .. to_end): " 132.90 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 132.91 - to_start, 132.92 - to_end, 132.93 + p2i(to_start), 132.94 + p2i(to_end), 132.95 pointer_delta( to_end, to_start, sizeof(char))); 132.96 gclog_or_tty->print_cr(" [from_start .. from_end): " 132.97 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 132.98 - from_start, 132.99 - from_end, 132.100 + p2i(from_start), 132.101 + p2i(from_end), 132.102 pointer_delta(from_end, from_start, sizeof(char))); 132.103 } 132.104 }
133.1 --- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Wed May 28 12:07:21 2014 -0700 133.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Thu May 29 09:56:06 2014 -0700 133.3 @@ -1,5 +1,5 @@ 133.4 /* 133.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 133.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 133.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 133.8 * 133.9 * This code is free software; you can redistribute it and/or modify it 133.10 @@ -478,23 +478,23 @@ 133.11 gclog_or_tty->print_cr(" " 133.12 " _covered[%d].start(): " INTPTR_FORMAT 133.13 " _covered[%d].last(): " INTPTR_FORMAT, 133.14 - ind, _covered[ind].start(), 133.15 - ind, _covered[ind].last()); 133.16 + ind, p2i(_covered[ind].start()), 133.17 + ind, p2i(_covered[ind].last())); 133.18 gclog_or_tty->print_cr(" " 133.19 " _committed[%d].start(): " INTPTR_FORMAT 133.20 " _committed[%d].last(): " INTPTR_FORMAT, 133.21 - ind, _committed[ind].start(), 133.22 - ind, _committed[ind].last()); 133.23 + ind, p2i(_committed[ind].start()), 133.24 + ind, p2i(_committed[ind].last())); 133.25 gclog_or_tty->print_cr(" " 133.26 " byte_for(start): " INTPTR_FORMAT 133.27 " byte_for(last): " INTPTR_FORMAT, 133.28 - byte_for(_covered[ind].start()), 133.29 - byte_for(_covered[ind].last())); 133.30 + p2i(byte_for(_covered[ind].start())), 133.31 + p2i(byte_for(_covered[ind].last()))); 133.32 gclog_or_tty->print_cr(" " 133.33 " addr_for(start): " INTPTR_FORMAT 133.34 " addr_for(last): " INTPTR_FORMAT, 133.35 - addr_for((jbyte*) _committed[ind].start()), 133.36 - addr_for((jbyte*) _committed[ind].last())); 133.37 + p2i(addr_for((jbyte*) _committed[ind].start())), 133.38 + p2i(addr_for((jbyte*) _committed[ind].last()))); 133.39 } 133.40 debug_only(verify_guard();) 133.41 }
134.1 --- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Wed May 28 12:07:21 2014 -0700 134.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Thu May 29 09:56:06 2014 -0700 134.3 @@ -1,5 +1,5 @@ 134.4 /* 134.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. 134.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 134.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 134.8 * 134.9 * This code is free software; you can redistribute it and/or modify it 134.10 @@ -31,6 +31,8 @@ 134.11 #include "runtime/mutex.hpp" 134.12 #include "runtime/mutexLocker.hpp" 134.13 134.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 134.15 + 134.16 // 134.17 // GCTask 134.18 //
135.1 --- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Wed May 28 12:07:21 2014 -0700 135.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Thu May 29 09:56:06 2014 -0700 135.3 @@ -1,6 +1,6 @@ 135.4 135.5 /* 135.6 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 135.7 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 135.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 135.9 * 135.10 * This code is free software; you can redistribute it and/or modify it 135.11 @@ -34,6 +34,8 @@ 135.12 #include "runtime/os.hpp" 135.13 #include "runtime/thread.hpp" 135.14 135.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 135.16 + 135.17 GCTaskThread::GCTaskThread(GCTaskManager* manager, 135.18 uint which, 135.19 uint processor_id) :
136.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp Wed May 28 12:07:21 2014 -0700 136.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp Thu May 29 09:56:06 2014 -0700 136.3 @@ -1,5 +1,5 @@ 136.4 /* 136.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 136.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 136.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 136.8 * 136.9 * This code is free software; you can redistribute it and/or modify it 136.10 @@ -155,7 +155,7 @@ 136.11 static inline idx_t bits_required(MemRegion covered_region); 136.12 136.13 void print_on_error(outputStream* st) const { 136.14 - st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this); 136.15 + st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, p2i(this)); 136.16 _beg_bits.print_on_error(st, " Begin Bits: "); 136.17 _end_bits.print_on_error(st, " End Bits: "); 136.18 } 136.19 @@ -390,9 +390,9 @@ 136.20 inline void ParMarkBitMap::verify_addr(HeapWord* addr) const { 136.21 // Allow one past the last valid address; useful for loop bounds. 136.22 assert(addr >= region_start(), 136.23 - err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, addr, region_start())); 136.24 + err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, p2i(addr), p2i(region_start()))); 136.25 assert(addr <= region_end(), 136.26 - err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, addr, region_end())); 136.27 + err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, p2i(addr), p2i(region_end()))); 136.28 } 136.29 #endif // #ifdef ASSERT 136.30
137.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Wed May 28 12:07:21 2014 -0700 137.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Thu May 29 09:56:06 2014 -0700 137.3 @@ -1,5 +1,5 @@ 137.4 /* 137.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 137.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 137.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 137.8 * 137.9 * This code is free software; you can redistribute it and/or modify it 137.10 @@ -373,7 +373,7 @@ 137.11 if ((result == NULL) && (QueuedAllocationWarningCount > 0) && 137.12 (loop_count % QueuedAllocationWarningCount == 0)) { 137.13 warning("ParallelScavengeHeap::mem_allocate retries %d times \n\t" 137.14 - " size=%d", loop_count, size); 137.15 + " size=" SIZE_FORMAT, loop_count, size); 137.16 } 137.17 } 137.18
138.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp Wed May 28 12:07:21 2014 -0700 138.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp Thu May 29 09:56:06 2014 -0700 138.3 @@ -1,5 +1,5 @@ 138.4 /* 138.5 - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. 138.6 + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. 138.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 138.8 * 138.9 * This code is free software; you can redistribute it and/or modify it 138.10 @@ -52,7 +52,7 @@ 138.11 const void* loc = (void*) p; 138.12 bool result = ((HeapWord*)p) >= young_gen()->reserved().start(); 138.13 assert(result == young_gen()->is_in_reserved(p), 138.14 - err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p)); 138.15 + err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p))); 138.16 return result; 138.17 } 138.18 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP
139.1 --- a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Wed May 28 12:07:21 2014 -0700 139.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Thu May 29 09:56:06 2014 -0700 139.3 @@ -1,5 +1,5 @@ 139.4 /* 139.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 139.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 139.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 139.8 * 139.9 * This code is free software; you can redistribute it and/or modify it 139.10 @@ -41,6 +41,8 @@ 139.11 #include "runtime/vmThread.hpp" 139.12 #include "services/management.hpp" 139.13 139.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 139.15 + 139.16 // 139.17 // ThreadRootsMarkingTask 139.18 //
140.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp Wed May 28 12:07:21 2014 -0700 140.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp Thu May 29 09:56:06 2014 -0700 140.3 @@ -1,5 +1,5 @@ 140.4 /* 140.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 140.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 140.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 140.8 * 140.9 * This code is free software; you can redistribute it and/or modify it 140.10 @@ -35,6 +35,8 @@ 140.11 140.12 #include <math.h> 140.13 140.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 140.15 + 140.16 PSAdaptiveSizePolicy::PSAdaptiveSizePolicy(size_t init_eden_size, 140.17 size_t init_promo_size, 140.18 size_t init_survivor_size, 140.19 @@ -1033,7 +1035,7 @@ 140.20 "AdaptiveSizePolicy::adjust_promo_for_footprint " 140.21 "adjusting tenured gen for footprint. " 140.22 "starting promo size " SIZE_FORMAT 140.23 - " reduced promo size " SIZE_FORMAT, 140.24 + " reduced promo size " SIZE_FORMAT 140.25 " promo delta " SIZE_FORMAT, 140.26 desired_promo_size, reduced_size, change ); 140.27 }
141.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Wed May 28 12:07:21 2014 -0700 141.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Thu May 29 09:56:06 2014 -0700 141.3 @@ -1,5 +1,5 @@ 141.4 /* 141.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 141.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 141.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 141.8 * 141.9 * This code is free software; you can redistribute it and/or modify it 141.10 @@ -54,6 +54,8 @@ 141.11 #include "utilities/events.hpp" 141.12 #include "utilities/stack.inline.hpp" 141.13 141.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 141.15 + 141.16 elapsedTimer PSMarkSweep::_accumulated_time; 141.17 jlong PSMarkSweep::_time_of_last_gc = 0; 141.18 CollectorCounters* PSMarkSweep::_counters = NULL;
142.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Wed May 28 12:07:21 2014 -0700 142.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Thu May 29 09:56:06 2014 -0700 142.3 @@ -1,5 +1,5 @@ 142.4 /* 142.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 142.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 142.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 142.8 * 142.9 * This code is free software; you can redistribute it and/or modify it 142.10 @@ -33,6 +33,8 @@ 142.11 #include "oops/oop.inline.hpp" 142.12 #include "runtime/java.hpp" 142.13 142.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 142.15 + 142.16 inline const char* PSOldGen::select_name() { 142.17 return UseParallelOldGC ? "ParOldGen" : "PSOldGen"; 142.18 }
143.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed May 28 12:07:21 2014 -0700 143.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Thu May 29 09:56:06 2014 -0700 143.3 @@ -1,5 +1,5 @@ 143.4 /* 143.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 143.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 143.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 143.8 * 143.9 * This code is free software; you can redistribute it and/or modify it 143.10 @@ -61,6 +61,8 @@ 143.11 143.12 #include <math.h> 143.13 143.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 143.15 + 143.16 // All sizes are in HeapWords. 143.17 const size_t ParallelCompactData::Log2RegionSize = 16; // 64K words 143.18 const size_t ParallelCompactData::RegionSize = (size_t)1 << Log2RegionSize;
144.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Wed May 28 12:07:21 2014 -0700 144.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Thu May 29 09:56:06 2014 -0700 144.3 @@ -1,5 +1,5 @@ 144.4 /* 144.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 144.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 144.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 144.8 * 144.9 * This code is free software; you can redistribute it and/or modify it 144.10 @@ -35,6 +35,8 @@ 144.11 #include "oops/oop.inline.hpp" 144.12 #include "oops/oop.psgc.inline.hpp" 144.13 144.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 144.15 + 144.16 PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL; 144.17 OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL; 144.18 PSOldGen* PSPromotionManager::_old_gen = NULL; 144.19 @@ -136,7 +138,7 @@ 144.20 } 144.21 144.22 const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]); 144.23 - for (uint i = 0; i < hlines; ++i) tty->print_cr(pm_stats_hdr[i]); 144.24 + for (uint i = 0; i < hlines; ++i) tty->print_cr("%s", pm_stats_hdr[i]); 144.25 for (uint i = 0; i < ParallelGCThreads + 1; ++i) { 144.26 manager_array(i)->print_local_stats(i); 144.27 }
145.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp Wed May 28 12:07:21 2014 -0700 145.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp Thu May 29 09:56:06 2014 -0700 145.3 @@ -1,5 +1,5 @@ 145.4 /* 145.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 145.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 145.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 145.8 * 145.9 * This code is free software; you can redistribute it and/or modify it 145.10 @@ -226,7 +226,7 @@ 145.11 if (TraceScavenge) { 145.12 gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", 145.13 PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring", 145.14 - new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size()); 145.15 + new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); 145.16 } 145.17 #endif 145.18
146.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Wed May 28 12:07:21 2014 -0700 146.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Thu May 29 09:56:06 2014 -0700 146.3 @@ -56,6 +56,7 @@ 146.4 #include "services/memoryService.hpp" 146.5 #include "utilities/stack.inline.hpp" 146.6 146.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 146.8 146.9 HeapWord* PSScavenge::_to_space_top_before_gc = NULL; 146.10 int PSScavenge::_consecutive_skipped_scavenges = 0;
147.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp Wed May 28 12:07:21 2014 -0700 147.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp Thu May 29 09:56:06 2014 -0700 147.3 @@ -1,5 +1,5 @@ 147.4 /* 147.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 147.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 147.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 147.8 * 147.9 * This code is free software; you can redistribute it and/or modify it 147.10 @@ -81,7 +81,7 @@ 147.11 if (TraceScavenge && o->is_forwarded()) { 147.12 gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", 147.13 "forwarding", 147.14 - new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size()); 147.15 + new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); 147.16 } 147.17 #endif 147.18
148.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp Wed May 28 12:07:21 2014 -0700 148.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp Thu May 29 09:56:06 2014 -0700 148.3 @@ -1,5 +1,5 @@ 148.4 /* 148.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 148.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 148.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 148.8 * 148.9 * This code is free software; you can redistribute it and/or modify it 148.10 @@ -42,6 +42,8 @@ 148.11 # include "os_bsd.inline.hpp" 148.12 #endif 148.13 148.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 148.15 + 148.16 // PSVirtualSpace 148.17 148.18 PSVirtualSpace::PSVirtualSpace(ReservedSpace rs, size_t alignment) :
149.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Wed May 28 12:07:21 2014 -0700 149.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Thu May 29 09:56:06 2014 -0700 149.3 @@ -1,5 +1,5 @@ 149.4 /* 149.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 149.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 149.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 149.8 * 149.9 * This code is free software; you can redistribute it and/or modify it 149.10 @@ -33,6 +33,8 @@ 149.11 #include "oops/oop.inline.hpp" 149.12 #include "runtime/java.hpp" 149.13 149.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 149.15 + 149.16 PSYoungGen::PSYoungGen(size_t initial_size, 149.17 size_t min_size, 149.18 size_t max_size) :
150.1 --- a/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp Wed May 28 12:07:21 2014 -0700 150.2 +++ b/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp Thu May 29 09:56:06 2014 -0700 150.3 @@ -1,5 +1,5 @@ 150.4 /* 150.5 - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. 150.6 + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. 150.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 150.8 * 150.9 * This code is free software; you can redistribute it and/or modify it 150.10 @@ -171,8 +171,8 @@ 150.11 "active_workers(): %d new_acitve_workers: %d " 150.12 "prev_active_workers: %d\n" 150.13 " active_workers_by_JT: %d active_workers_by_heap_size: %d", 150.14 - active_workers, new_active_workers, prev_active_workers, 150.15 - active_workers_by_JT, active_workers_by_heap_size); 150.16 + (int) active_workers, (int) new_active_workers, (int) prev_active_workers, 150.17 + (int) active_workers_by_JT, (int) active_workers_by_heap_size); 150.18 } 150.19 assert(new_active_workers > 0, "Always need at least 1"); 150.20 return new_active_workers; 150.21 @@ -545,13 +545,13 @@ 150.22 if (UseGCOverheadLimit && PrintGCDetails && Verbose) { 150.23 if (gc_overhead_limit_exceeded()) { 150.24 gclog_or_tty->print_cr(" GC is exceeding overhead limit " 150.25 - "of %d%%", GCTimeLimit); 150.26 + "of %d%%", (int) GCTimeLimit); 150.27 reset_gc_overhead_limit_count(); 150.28 } else if (print_gc_overhead_limit_would_be_exceeded) { 150.29 assert(gc_overhead_limit_count() > 0, "Should not be printing"); 150.30 gclog_or_tty->print_cr(" GC would exceed overhead limit " 150.31 "of %d%% %d consecutive time(s)", 150.32 - GCTimeLimit, gc_overhead_limit_count()); 150.33 + (int) GCTimeLimit, gc_overhead_limit_count()); 150.34 } 150.35 } 150.36 }
151.1 --- a/src/share/vm/gc_implementation/shared/ageTable.cpp Wed May 28 12:07:21 2014 -0700 151.2 +++ b/src/share/vm/gc_implementation/shared/ageTable.cpp Thu May 29 09:56:06 2014 -0700 151.3 @@ -1,5 +1,5 @@ 151.4 /* 151.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 151.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 151.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 151.8 * 151.9 * This code is free software; you can redistribute it and/or modify it 151.10 @@ -97,7 +97,7 @@ 151.11 if (PrintTenuringDistribution) { 151.12 gclog_or_tty->cr(); 151.13 gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u (max %u)", 151.14 - desired_survivor_size*oopSize, result, MaxTenuringThreshold); 151.15 + desired_survivor_size*oopSize, result, (int) MaxTenuringThreshold); 151.16 } 151.17 151.18 total = 0; 151.19 @@ -106,8 +106,8 @@ 151.20 total += sizes[age]; 151.21 if (sizes[age] > 0) { 151.22 if (PrintTenuringDistribution) { 151.23 - gclog_or_tty->print_cr("- age %3u: %10ld bytes, %10ld total", 151.24 - age, sizes[age]*oopSize, total*oopSize); 151.25 + gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", 151.26 + age, sizes[age]*oopSize, total*oopSize); 151.27 } 151.28 } 151.29 if (UsePerfData) {
152.1 --- a/src/share/vm/gc_implementation/shared/allocationStats.hpp Wed May 28 12:07:21 2014 -0700 152.2 +++ b/src/share/vm/gc_implementation/shared/allocationStats.hpp Thu May 29 09:56:06 2014 -0700 152.3 @@ -1,5 +1,5 @@ 152.4 /* 152.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 152.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 152.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 152.8 * 152.9 * This code is free software; you can redistribute it and/or modify it 152.10 @@ -107,7 +107,7 @@ 152.11 assert(demand >= 0, 152.12 err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for " 152.13 PTR_FORMAT " (size=" SIZE_FORMAT ")", 152.14 - demand, this, count)); 152.15 + demand, p2i(this), count)); 152.16 // Defensive: adjust for imprecision in event counting 152.17 if (demand < 0) { 152.18 demand = 0; 152.19 @@ -120,8 +120,9 @@ 152.20 float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0); 152.21 _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise)); 152.22 if (PrintFLSStatistics > 1) { 152.23 - gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d", 152.24 - demand, old_rate, rate, new_rate, old_desired, _desired); 152.25 + gclog_or_tty->print_cr( 152.26 + "demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT, 152.27 + demand, old_rate, rate, new_rate, old_desired, _desired); 152.28 } 152.29 } 152.30 }
153.1 --- a/src/share/vm/gc_implementation/shared/immutableSpace.cpp Wed May 28 12:07:21 2014 -0700 153.2 +++ b/src/share/vm/gc_implementation/shared/immutableSpace.cpp Thu May 29 09:56:06 2014 -0700 153.3 @@ -1,5 +1,5 @@ 153.4 /* 153.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 153.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 153.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 153.8 * 153.9 * This code is free software; you can redistribute it and/or modify it 153.10 @@ -66,7 +66,7 @@ 153.11 153.12 void ImmutableSpace::print() const { 153.13 print_short(); 153.14 - tty->print_cr(" [%#-6lx,%#-6lx)", bottom(), end()); 153.15 + tty->print_cr(" [" INTPTR_FORMAT_W(#-6) "," INTPTR_FORMAT_W(#-6) ")", p2i(bottom()), p2i(end())); 153.16 } 153.17 153.18 #endif
154.1 --- a/src/share/vm/gc_implementation/shared/markSweep.cpp Wed May 28 12:07:21 2014 -0700 154.2 +++ b/src/share/vm/gc_implementation/shared/markSweep.cpp Thu May 29 09:56:06 2014 -0700 154.3 @@ -1,5 +1,5 @@ 154.4 /* 154.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 154.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 154.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 154.8 * 154.9 * This code is free software; you can redistribute it and/or modify it 154.10 @@ -32,6 +32,8 @@ 154.11 #include "oops/objArrayKlass.inline.hpp" 154.12 #include "oops/oop.inline.hpp" 154.13 154.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 154.15 + 154.16 uint MarkSweep::_total_invocations = 0; 154.17 154.18 Stack<oop, mtGC> MarkSweep::_marking_stack;
155.1 --- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Wed May 28 12:07:21 2014 -0700 155.2 +++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Thu May 29 09:56:06 2014 -0700 155.3 @@ -1,6 +1,6 @@ 155.4 155.5 /* 155.6 - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. 155.7 + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. 155.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 155.9 * 155.10 * This code is free software; you can redistribute it and/or modify it 155.11 @@ -30,6 +30,8 @@ 155.12 #include "oops/oop.inline.hpp" 155.13 #include "runtime/thread.inline.hpp" 155.14 155.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 155.16 + 155.17 MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) { 155.18 _lgrp_spaces = new (ResourceObj::C_HEAP, mtGC) GrowableArray<LGRPSpace*>(0, true); 155.19 _page_size = os::vm_page_size();
156.1 --- a/src/share/vm/gc_implementation/shared/mutableSpace.cpp Wed May 28 12:07:21 2014 -0700 156.2 +++ b/src/share/vm/gc_implementation/shared/mutableSpace.cpp Thu May 29 09:56:06 2014 -0700 156.3 @@ -1,5 +1,5 @@ 156.4 /* 156.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 156.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 156.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 156.8 * 156.9 * This code is free software; you can redistribute it and/or modify it 156.10 @@ -32,6 +32,8 @@ 156.11 #include "runtime/thread.hpp" 156.12 #endif // INCLUDE_ALL_GCS 156.13 156.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 156.15 + 156.16 MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) { 156.17 assert(MutableSpace::alignment() >= 0 && 156.18 MutableSpace::alignment() % os::vm_page_size() == 0,
157.1 --- a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp Wed May 28 12:07:21 2014 -0700 157.2 +++ b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp Thu May 29 09:56:06 2014 -0700 157.3 @@ -1,5 +1,5 @@ 157.4 /* 157.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 157.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 157.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 157.8 * 157.9 * This code is free software; you can redistribute it and/or modify it 157.10 @@ -28,6 +28,8 @@ 157.11 #include "oops/arrayOop.hpp" 157.12 #include "oops/oop.inline.hpp" 157.13 157.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 157.15 + 157.16 ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) : 157.17 _word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL), 157.18 _end(NULL), _hard_end(NULL),
158.1 --- a/src/share/vm/gc_implementation/shared/spaceDecorator.cpp Wed May 28 12:07:21 2014 -0700 158.2 +++ b/src/share/vm/gc_implementation/shared/spaceDecorator.cpp Thu May 29 09:56:06 2014 -0700 158.3 @@ -1,5 +1,5 @@ 158.4 /* 158.5 - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 158.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 158.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 158.8 * 158.9 * This code is free software; you can redistribute it and/or modify it 158.10 @@ -27,6 +27,8 @@ 158.11 #include "memory/space.inline.hpp" 158.12 #include "utilities/copy.hpp" 158.13 158.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 158.15 + 158.16 // Catch-all file for utility classes 158.17 158.18 #ifndef PRODUCT
159.1 --- a/src/share/vm/gc_interface/collectedHeap.cpp Wed May 28 12:07:21 2014 -0700 159.2 +++ b/src/share/vm/gc_interface/collectedHeap.cpp Thu May 29 09:56:06 2014 -0700 159.3 @@ -599,12 +599,12 @@ 159.4 assert(heap_start >= ((uintptr_t)NULL + epsilon), "sanity"); 159.5 void* before_heap = (void*)(heap_start - epsilon); 159.6 assert(!heap->is_in(before_heap), 159.7 - err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", before_heap)); 159.8 + err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap))); 159.9 159.10 // Test that a pointer to after the heap end is reported as outside the heap. 159.11 assert(heap_end <= ((uintptr_t)-1 - epsilon), "sanity"); 159.12 void* after_heap = (void*)(heap_end + epsilon); 159.13 assert(!heap->is_in(after_heap), 159.14 - err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", after_heap)); 159.15 + err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap))); 159.16 } 159.17 #endif
160.1 --- a/src/share/vm/interpreter/bytecodeTracer.cpp Wed May 28 12:07:21 2014 -0700 160.2 +++ b/src/share/vm/interpreter/bytecodeTracer.cpp Thu May 29 09:56:06 2014 -0700 160.3 @@ -1,5 +1,5 @@ 160.4 /* 160.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 160.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 160.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 160.8 * 160.9 * This code is free software; you can redistribute it and/or modify it 160.10 @@ -215,7 +215,7 @@ 160.11 st->print_cr(" %s", buf); 160.12 } 160.13 } else { 160.14 - st->print_cr(" " PTR_FORMAT, (void *)value); 160.15 + st->print_cr(" " PTR_FORMAT, p2i((void *)value)); 160.16 } 160.17 } 160.18 160.19 @@ -284,7 +284,7 @@ 160.20 if (i >= 0 && i < climit) { 160.21 cp_index = cache->entry_at(i)->constant_pool_index(); 160.22 } else { 160.23 - st->print_cr(" not in CP[*]?", i); 160.24 + st->print_cr("%d not in CP[*]?", i); 160.25 return false; 160.26 } 160.27 return true; 160.28 @@ -299,7 +299,7 @@ 160.29 cp_index = constants->object_to_cp_index(i); 160.30 return true; 160.31 } else { 160.32 - st->print_cr(" not in OBJ[*]?", i); 160.33 + st->print_cr("%d not in OBJ[*]?", i); 160.34 return false; 160.35 } 160.36 } 160.37 @@ -323,7 +323,7 @@ 160.38 if (tag.is_int()) { 160.39 st->print_cr(" " INT32_FORMAT, constants->int_at(i)); 160.40 } else if (tag.is_long()) { 160.41 - st->print_cr(" " INT64_FORMAT, constants->long_at(i)); 160.42 + st->print_cr(" " INT64_FORMAT, (int64_t)(constants->long_at(i))); 160.43 } else if (tag.is_float()) { 160.44 st->print_cr(" %f", constants->float_at(i)); 160.45 } else if (tag.is_double()) { 160.46 @@ -342,7 +342,7 @@ 160.47 } else if (tag.is_method_handle()) { 160.48 int kind = constants->method_handle_ref_kind_at(i); 160.49 int i2 = constants->method_handle_index_at(i); 160.50 - st->print(" <MethodHandle of kind %d>", kind, i2); 160.51 + st->print(" <MethodHandle of kind %d index at %d>", kind, i2); 160.52 print_field_or_method(-i, i2, st); 160.53 } else { 160.54 st->print_cr(" bad tag=%d at %d", tag.value(), i); 160.55 @@ -391,6 +391,7 @@ 160.56 } 160.57 160.58 160.59 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 160.60 void BytecodePrinter::print_attributes(int bci, outputStream* st) { 160.61 // Show attributes of pre-rewritten codes 160.62 Bytecodes::Code code = Bytecodes::java_code(raw_code()); 160.63 @@ -517,7 +518,10 @@ 160.64 int idx = ll - lo; 160.65 const char *format = first ? " %d:" INT32_FORMAT " (delta: %d)" : 160.66 ", %d:" INT32_FORMAT " (delta: %d)"; 160.67 +PRAGMA_DIAG_PUSH 160.68 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 160.69 st->print(format, ll, dest[idx], dest[idx]-bci); 160.70 +PRAGMA_DIAG_POP 160.71 } 160.72 st->cr(); 160.73 } 160.74 @@ -537,7 +541,10 @@ 160.75 for (int ll = 0; ll < len; ll++, first = false) { 160.76 const char *format = first ? " " INT32_FORMAT ":" INT32_FORMAT : 160.77 ", " INT32_FORMAT ":" INT32_FORMAT ; 160.78 +PRAGMA_DIAG_PUSH 160.79 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 160.80 st->print(format, key[ll], dest[ll]); 160.81 +PRAGMA_DIAG_POP 160.82 } 160.83 st->cr(); 160.84 }
161.1 --- a/src/share/vm/interpreter/interpreter.cpp Wed May 28 12:07:21 2014 -0700 161.2 +++ b/src/share/vm/interpreter/interpreter.cpp Thu May 29 09:56:06 2014 -0700 161.3 @@ -1,5 +1,5 @@ 161.4 /* 161.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 161.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 161.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 161.8 * 161.9 * This code is free software; you can redistribute it and/or modify it 161.10 @@ -72,7 +72,7 @@ 161.11 if (description() != NULL) st->print("%s ", description()); 161.12 if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode())); 161.13 st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes", 161.14 - code_begin(), code_end(), code_size()); 161.15 + p2i(code_begin()), p2i(code_end()), code_size()); 161.16 161.17 if (PrintInterpreter) { 161.18 st->cr();
162.1 --- a/src/share/vm/interpreter/interpreterRuntime.cpp Wed May 28 12:07:21 2014 -0700 162.2 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp Thu May 29 09:56:06 2014 -0700 162.3 @@ -1,5 +1,5 @@ 162.4 /* 162.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 162.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 162.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 162.8 * 162.9 * This code is free software; you can redistribute it and/or modify it 162.10 @@ -75,6 +75,8 @@ 162.11 #include "opto/runtime.hpp" 162.12 #endif 162.13 162.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 162.15 + 162.16 class UnlockFlagSaver { 162.17 private: 162.18 JavaThread* _thread;
163.1 --- a/src/share/vm/interpreter/linkResolver.cpp Wed May 28 12:07:21 2014 -0700 163.2 +++ b/src/share/vm/interpreter/linkResolver.cpp Thu May 29 09:56:06 2014 -0700 163.3 @@ -1630,7 +1630,7 @@ 163.4 THREAD); 163.5 if (HAS_PENDING_EXCEPTION) { 163.6 if (TraceMethodHandles) { 163.7 - tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, (void *)PENDING_EXCEPTION); 163.8 + tty->print_cr("invokedynamic throws BSME for " INTPTR_FORMAT, p2i((void *)PENDING_EXCEPTION)); 163.9 PENDING_EXCEPTION->print(); 163.10 } 163.11 if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) {
164.1 --- a/src/share/vm/interpreter/oopMapCache.cpp Wed May 28 12:07:21 2014 -0700 164.2 +++ b/src/share/vm/interpreter/oopMapCache.cpp Thu May 29 09:56:06 2014 -0700 164.3 @@ -1,5 +1,5 @@ 164.4 /* 164.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 164.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 164.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 164.8 * 164.9 * This code is free software; you can redistribute it and/or modify it 164.10 @@ -31,6 +31,8 @@ 164.11 #include "runtime/handles.inline.hpp" 164.12 #include "runtime/signature.hpp" 164.13 164.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 164.15 + 164.16 class OopMapCacheEntry: private InterpreterOopMap { 164.17 friend class InterpreterOopMap; 164.18 friend class OopMapForCacheEntry;
165.1 --- a/src/share/vm/interpreter/templateInterpreter.cpp Wed May 28 12:07:21 2014 -0700 165.2 +++ b/src/share/vm/interpreter/templateInterpreter.cpp Thu May 29 09:56:06 2014 -0700 165.3 @@ -1,5 +1,5 @@ 165.4 /* 165.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 165.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 165.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 165.8 * 165.9 * This code is free software; you can redistribute it and/or modify it 165.10 @@ -104,7 +104,7 @@ 165.11 tty->print("["); 165.12 for (int i = 0; i < number_of_states; i++) { 165.13 if (i > 0) tty->print(", "); 165.14 - tty->print(INTPTR_FORMAT, _entry[i]); 165.15 + tty->print(INTPTR_FORMAT, p2i(_entry[i])); 165.16 } 165.17 tty->print("]"); 165.18 }
166.1 --- a/src/share/vm/libadt/dict.cpp Wed May 28 12:07:21 2014 -0700 166.2 +++ b/src/share/vm/libadt/dict.cpp Thu May 29 09:56:06 2014 -0700 166.3 @@ -1,5 +1,5 @@ 166.4 /* 166.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 166.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 166.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 166.8 * 166.9 * This code is free software; you can redistribute it and/or modify it 166.10 @@ -38,6 +38,8 @@ 166.11 166.12 #include <assert.h> 166.13 166.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 166.15 + 166.16 // The iostream is not needed and it gets confused for gcc by the 166.17 // define of bool. 166.18 //
167.1 --- a/src/share/vm/libadt/set.cpp Wed May 28 12:07:21 2014 -0700 167.2 +++ b/src/share/vm/libadt/set.cpp Thu May 29 09:56:06 2014 -0700 167.3 @@ -1,5 +1,5 @@ 167.4 /* 167.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 167.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 167.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 167.8 * 167.9 * This code is free software; you can redistribute it and/or modify it 167.10 @@ -116,7 +116,7 @@ 167.11 void Set::print() const 167.12 { 167.13 char *printable_set = setstr(); 167.14 - tty->print_cr(printable_set); 167.15 + tty->print_cr("%s", printable_set); 167.16 FreeHeap(printable_set); 167.17 } 167.18
168.1 --- a/src/share/vm/memory/allocation.cpp Wed May 28 12:07:21 2014 -0700 168.2 +++ b/src/share/vm/memory/allocation.cpp Thu May 29 09:56:06 2014 -0700 168.3 @@ -1,5 +1,5 @@ 168.4 /* 168.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 168.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 168.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 168.8 * 168.9 * This code is free software; you can redistribute it and/or modify it 168.10 @@ -75,11 +75,11 @@ 168.11 } 168.12 168.13 bool MetaspaceObj::is_metaspace_object() const { 168.14 - return ClassLoaderDataGraph::contains((void*)this); 168.15 + return Metaspace::contains((void*)this); 168.16 } 168.17 168.18 void MetaspaceObj::print_address_on(outputStream* st) const { 168.19 - st->print(" {"INTPTR_FORMAT"}", this); 168.20 + st->print(" {" INTPTR_FORMAT "}", p2i(this)); 168.21 } 168.22 168.23 void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() { 168.24 @@ -142,7 +142,7 @@ 168.25 void ResourceObj::set_allocation_type(address res, allocation_type type) { 168.26 // Set allocation type in the resource object 168.27 uintptr_t allocation = (uintptr_t)res; 168.28 - assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " PTR_FORMAT, res)); 168.29 + assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res))); 168.30 assert(type <= allocation_mask, "incorrect allocation type"); 168.31 ResourceObj* resobj = (ResourceObj *)res; 168.32 resobj->_allocation_t[0] = ~(allocation + type); 168.33 @@ -179,7 +179,7 @@ 168.34 // Operator new() was called and type was set. 168.35 assert(!allocated_on_stack(), 168.36 err_msg("not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", 168.37 - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); 168.38 + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); 168.39 } else { 168.40 // Operator new() was not called. 168.41 // Assume that it is embedded or stack object. 168.42 @@ -193,7 +193,7 @@ 168.43 // Note: garbage may resembles valid value. 168.44 assert(~(_allocation_t[0] | allocation_mask) != (uintptr_t)this || !is_type_set(), 168.45 err_msg("embedded or stack only, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", 168.46 - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); 168.47 + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); 168.48 set_allocation_type((address)this, STACK_OR_EMBEDDED); 168.49 _allocation_t[1] = 0; // Zap verification value 168.50 } 168.51 @@ -202,7 +202,7 @@ 168.52 // Used in InlineTree::ok_to_inline() for WarmCallInfo. 168.53 assert(allocated_on_stack(), 168.54 err_msg("copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", 168.55 - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); 168.56 + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); 168.57 // Keep current _allocation_t value; 168.58 return *this; 168.59 } 168.60 @@ -218,13 +218,13 @@ 168.61 168.62 void trace_heap_malloc(size_t size, const char* name, void* p) { 168.63 // A lock is not needed here - tty uses a lock internally 168.64 - tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p, size, name == NULL ? "" : name); 168.65 + tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p2i(p), size, name == NULL ? "" : name); 168.66 } 168.67 168.68 168.69 void trace_heap_free(void* p) { 168.70 // A lock is not needed here - tty uses a lock internally 168.71 - tty->print_cr("Heap free " INTPTR_FORMAT, p); 168.72 + tty->print_cr("Heap free " INTPTR_FORMAT, p2i(p)); 168.73 } 168.74 168.75 //-------------------------------------------------------------------------------------- 168.76 @@ -723,11 +723,11 @@ 168.77 void AllocatedObj::print_value() const { print_value_on(tty); } 168.78 168.79 void AllocatedObj::print_on(outputStream* st) const { 168.80 - st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", this); 168.81 + st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", p2i(this)); 168.82 } 168.83 168.84 void AllocatedObj::print_value_on(outputStream* st) const { 168.85 - st->print("AllocatedObj(" INTPTR_FORMAT ")", this); 168.86 + st->print("AllocatedObj(" INTPTR_FORMAT ")", p2i(this)); 168.87 } 168.88 168.89 julong Arena::_bytes_allocated = 0;
169.1 --- a/src/share/vm/memory/binaryTreeDictionary.cpp Wed May 28 12:07:21 2014 -0700 169.2 +++ b/src/share/vm/memory/binaryTreeDictionary.cpp Thu May 29 09:56:06 2014 -0700 169.3 @@ -1,5 +1,5 @@ 169.4 /* 169.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 169.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 169.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 169.8 * 169.9 * This code is free software; you can redistribute it and/or modify it 169.10 @@ -1205,13 +1205,13 @@ 169.11 "------------------------------------\n"); 169.12 size_t total_size = total_chunk_size(debug_only(NULL)); 169.13 size_t free_blocks = num_free_blocks(); 169.14 - gclog_or_tty->print("Total Free Space: %d\n", total_size); 169.15 - gclog_or_tty->print("Max Chunk Size: %d\n", max_chunk_size()); 169.16 - gclog_or_tty->print("Number of Blocks: %d\n", free_blocks); 169.17 + gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size); 169.18 + gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", max_chunk_size()); 169.19 + gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks); 169.20 if (free_blocks > 0) { 169.21 - gclog_or_tty->print("Av. Block Size: %d\n", total_size/free_blocks); 169.22 + gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks); 169.23 } 169.24 - gclog_or_tty->print("Tree Height: %d\n", tree_height()); 169.25 + gclog_or_tty->print("Tree Height: " SIZE_FORMAT "\n", tree_height()); 169.26 } 169.27 169.28 // Print census information - counts, births, deaths, etc. 169.29 @@ -1318,7 +1318,7 @@ 169.30 for (Chunk_t* fc = fl->head(); fc != NULL; 169.31 fc = fc->next()) { 169.32 _st->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", 169.33 - fc, (HeapWord*)fc + sz, 169.34 + p2i(fc), p2i((HeapWord*)fc + sz), 169.35 fc->cantCoalesce() ? "\t CC" : ""); 169.36 } 169.37 }
170.1 --- a/src/share/vm/memory/blockOffsetTable.cpp Wed May 28 12:07:21 2014 -0700 170.2 +++ b/src/share/vm/memory/blockOffsetTable.cpp Thu May 29 09:56:06 2014 -0700 170.3 @@ -1,5 +1,5 @@ 170.4 /* 170.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 170.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 170.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 170.8 * 170.9 * This code is free software; you can redistribute it and/or modify it 170.10 @@ -59,12 +59,12 @@ 170.11 " rs.base(): " INTPTR_FORMAT 170.12 " rs.size(): " INTPTR_FORMAT 170.13 " rs end(): " INTPTR_FORMAT, 170.14 - rs.base(), rs.size(), rs.base() + rs.size()); 170.15 + p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); 170.16 gclog_or_tty->print_cr(" " 170.17 " _vs.low_boundary(): " INTPTR_FORMAT 170.18 " _vs.high_boundary(): " INTPTR_FORMAT, 170.19 - _vs.low_boundary(), 170.20 - _vs.high_boundary()); 170.21 + p2i(_vs.low_boundary()), 170.22 + p2i(_vs.high_boundary())); 170.23 } 170.24 } 170.25 170.26 @@ -537,10 +537,10 @@ 170.27 q -= (N_words * n_cards_back); 170.28 assert(q >= _sp->bottom(), 170.29 err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT, 170.30 - q, _sp->bottom())); 170.31 + p2i(q), p2i(_sp->bottom()))); 170.32 assert(q < _sp->end(), 170.33 err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT, 170.34 - q, _sp->end())); 170.35 + p2i(q), p2i(_sp->end()))); 170.36 index -= n_cards_back; 170.37 offset = _array->offset_array(index); 170.38 } 170.39 @@ -549,10 +549,10 @@ 170.40 q -= offset; 170.41 assert(q >= _sp->bottom(), 170.42 err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT, 170.43 - q, _sp->bottom())); 170.44 + p2i(q), p2i(_sp->bottom()))); 170.45 assert(q < _sp->end(), 170.46 err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT, 170.47 - q, _sp->end())); 170.48 + p2i(q), p2i(_sp->end()))); 170.49 HeapWord* n = q; 170.50 170.51 while (n <= addr) { 170.52 @@ -563,14 +563,14 @@ 170.53 err_msg("Looping at n = " PTR_FORMAT " with last = " PTR_FORMAT"," 170.54 " while querying blk_start(" PTR_FORMAT ")" 170.55 " on _sp = [" PTR_FORMAT "," PTR_FORMAT ")", 170.56 - n, last, addr, _sp->bottom(), _sp->end())); 170.57 + p2i(n), p2i(last), p2i(addr), p2i(_sp->bottom()), p2i(_sp->end()))); 170.58 } 170.59 assert(q <= addr, 170.60 err_msg("wrong order for current (" INTPTR_FORMAT ")" " <= arg (" INTPTR_FORMAT ")", 170.61 - q, addr)); 170.62 + p2i(q), p2i(addr))); 170.63 assert(addr <= n, 170.64 err_msg("wrong order for arg (" INTPTR_FORMAT ") <= next (" INTPTR_FORMAT ")", 170.65 - addr, n)); 170.66 + p2i(addr), p2i(n))); 170.67 return q; 170.68 } 170.69
171.1 --- a/src/share/vm/memory/cardTableModRefBS.cpp Wed May 28 12:07:21 2014 -0700 171.2 +++ b/src/share/vm/memory/cardTableModRefBS.cpp Thu May 29 09:56:06 2014 -0700 171.3 @@ -1,5 +1,5 @@ 171.4 /* 171.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 171.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 171.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 171.8 * 171.9 * This code is free software; you can redistribute it and/or modify it 171.10 @@ -138,11 +138,11 @@ 171.11 gclog_or_tty->print_cr(" " 171.12 " &_byte_map[0]: " INTPTR_FORMAT 171.13 " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, 171.14 - &_byte_map[0], 171.15 - &_byte_map[_last_valid_index]); 171.16 + p2i(&_byte_map[0]), 171.17 + p2i(&_byte_map[_last_valid_index])); 171.18 gclog_or_tty->print_cr(" " 171.19 " byte_map_base: " INTPTR_FORMAT, 171.20 - byte_map_base); 171.21 + p2i(byte_map_base)); 171.22 } 171.23 } 171.24 171.25 @@ -392,23 +392,23 @@ 171.26 gclog_or_tty->print_cr(" " 171.27 " _covered[%d].start(): " INTPTR_FORMAT 171.28 " _covered[%d].last(): " INTPTR_FORMAT, 171.29 - ind, _covered[ind].start(), 171.30 - ind, _covered[ind].last()); 171.31 + ind, p2i(_covered[ind].start()), 171.32 + ind, p2i(_covered[ind].last())); 171.33 gclog_or_tty->print_cr(" " 171.34 " _committed[%d].start(): " INTPTR_FORMAT 171.35 " _committed[%d].last(): " INTPTR_FORMAT, 171.36 - ind, _committed[ind].start(), 171.37 - ind, _committed[ind].last()); 171.38 + ind, p2i(_committed[ind].start()), 171.39 + ind, p2i(_committed[ind].last())); 171.40 gclog_or_tty->print_cr(" " 171.41 " byte_for(start): " INTPTR_FORMAT 171.42 " byte_for(last): " INTPTR_FORMAT, 171.43 - byte_for(_covered[ind].start()), 171.44 - byte_for(_covered[ind].last())); 171.45 + p2i(byte_for(_covered[ind].start())), 171.46 + p2i(byte_for(_covered[ind].last()))); 171.47 gclog_or_tty->print_cr(" " 171.48 " addr_for(start): " INTPTR_FORMAT 171.49 " addr_for(last): " INTPTR_FORMAT, 171.50 - addr_for((jbyte*) _committed[ind].start()), 171.51 - addr_for((jbyte*) _committed[ind].last())); 171.52 + p2i(addr_for((jbyte*) _committed[ind].start())), 171.53 + p2i(addr_for((jbyte*) _committed[ind].last()))); 171.54 } 171.55 // Touch the last card of the covered region to show that it 171.56 // is committed (or SEGV). 171.57 @@ -657,14 +657,14 @@ 171.58 if (failed) { 171.59 if (!failures) { 171.60 tty->cr(); 171.61 - tty->print_cr("== CT verification failed: ["PTR_FORMAT","PTR_FORMAT"]", start, end); 171.62 + tty->print_cr("== CT verification failed: [" INTPTR_FORMAT "," INTPTR_FORMAT "]", p2i(start), p2i(end)); 171.63 tty->print_cr("== %sexpecting value: %d", 171.64 (val_equals) ? "" : "not ", val); 171.65 failures = true; 171.66 } 171.67 tty->print_cr("== card "PTR_FORMAT" ["PTR_FORMAT","PTR_FORMAT"], " 171.68 - "val: %d", curr, addr_for(curr), 171.69 - (HeapWord*) (((size_t) addr_for(curr)) + card_size), 171.70 + "val: %d", p2i(curr), p2i(addr_for(curr)), 171.71 + p2i((HeapWord*) (((size_t) addr_for(curr)) + card_size)), 171.72 (int) curr_val); 171.73 } 171.74 } 171.75 @@ -682,7 +682,7 @@ 171.76 171.77 void CardTableModRefBS::print_on(outputStream* st) const { 171.78 st->print_cr("Card table byte_map: [" INTPTR_FORMAT "," INTPTR_FORMAT "] byte_map_base: " INTPTR_FORMAT, 171.79 - _byte_map, _byte_map + _byte_map_size, byte_map_base); 171.80 + p2i(_byte_map), p2i(_byte_map + _byte_map_size), p2i(byte_map_base)); 171.81 } 171.82 171.83 bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
172.1 --- a/src/share/vm/memory/cardTableModRefBS.hpp Wed May 28 12:07:21 2014 -0700 172.2 +++ b/src/share/vm/memory/cardTableModRefBS.hpp Thu May 29 09:56:06 2014 -0700 172.3 @@ -1,5 +1,5 @@ 172.4 /* 172.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 172.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 172.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 172.8 * 172.9 * This code is free software; you can redistribute it and/or modify it 172.10 @@ -155,7 +155,7 @@ 172.11 assert(_whole_heap.contains(p), 172.12 err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " 172.13 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", 172.14 - p, _whole_heap.start(), _whole_heap.end())); 172.15 + p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); 172.16 jbyte* result = &byte_map_base[uintptr_t(p) >> card_shift]; 172.17 assert(result >= _byte_map && result < _byte_map + _byte_map_size, 172.18 "out of bounds accessor for card marking array"); 172.19 @@ -431,7 +431,7 @@ 172.20 assert(_whole_heap.contains(result), 172.21 err_msg("Returning result = "PTR_FORMAT" out of bounds of " 172.22 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", 172.23 - result, _whole_heap.start(), _whole_heap.end())); 172.24 + p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); 172.25 return result; 172.26 } 172.27 172.28 @@ -440,7 +440,7 @@ 172.29 assert(_whole_heap.contains(p), 172.30 err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " 172.31 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", 172.32 - p, _whole_heap.start(), _whole_heap.end())); 172.33 + p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); 172.34 return byte_for(p) - _byte_map; 172.35 } 172.36
173.1 --- a/src/share/vm/memory/cardTableRS.cpp Wed May 28 12:07:21 2014 -0700 173.2 +++ b/src/share/vm/memory/cardTableRS.cpp Thu May 29 09:56:06 2014 -0700 173.3 @@ -1,5 +1,5 @@ 173.4 /* 173.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 173.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 173.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 173.8 * 173.9 * This code is free software; you can redistribute it and/or modify it 173.10 @@ -288,14 +288,14 @@ 173.11 err_msg("Did you forget to call save_marks()? " 173.12 "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in " 173.13 "[" PTR_FORMAT ", " PTR_FORMAT ")", 173.14 - urasm.start(), urasm.end(), ur.start(), ur.end())); 173.15 + p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()))); 173.16 // In the case of CMS+ParNew, issue a warning 173.17 if (!ur.contains(urasm)) { 173.18 assert(UseConcMarkSweepGC && UseParNewGC, "Tautology: see assert above"); 173.19 warning("CMS+ParNew: Did you forget to call save_marks()? " 173.20 "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in " 173.21 "[" PTR_FORMAT ", " PTR_FORMAT ")", 173.22 - urasm.start(), urasm.end(), ur.start(), ur.end()); 173.23 + p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end())); 173.24 MemRegion ur2 = sp->used_region(); 173.25 MemRegion urasm2 = sp->used_region_at_save_marks(); 173.26 if (!ur.equals(ur2)) { 173.27 @@ -349,12 +349,12 @@ 173.28 assert(jp >= _begin && jp < _end, 173.29 err_msg("Error: jp " PTR_FORMAT " should be within " 173.30 "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")", 173.31 - jp, _begin, _end)); 173.32 + p2i(jp), p2i(_begin), p2i(_end))); 173.33 oop obj = oopDesc::load_decode_heap_oop(p); 173.34 guarantee(obj == NULL || (HeapWord*)obj >= _boundary, 173.35 err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on " 173.36 "clean card crosses boundary" PTR_FORMAT, 173.37 - (HeapWord*)obj, jp, _boundary)); 173.38 + p2i((HeapWord*)obj), p2i(jp), p2i(_boundary))); 173.39 } 173.40 173.41 public: 173.42 @@ -362,10 +362,10 @@ 173.43 _boundary(b), _begin(begin), _end(end) { 173.44 assert(b <= begin, 173.45 err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT, 173.46 - b, begin)); 173.47 + p2i(b), p2i(begin))); 173.48 assert(begin <= end, 173.49 err_msg("Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT, 173.50 - begin, end)); 173.51 + p2i(begin), p2i(end))); 173.52 } 173.53 173.54 virtual void do_oop(oop* p) { VerifyCleanCardClosure::do_oop_work(p); }
174.1 --- a/src/share/vm/memory/collectorPolicy.cpp Wed May 28 12:07:21 2014 -0700 174.2 +++ b/src/share/vm/memory/collectorPolicy.cpp Thu May 29 09:56:06 2014 -0700 174.3 @@ -1,5 +1,5 @@ 174.4 /* 174.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 174.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 174.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 174.8 * 174.9 * This code is free software; you can redistribute it and/or modify it 174.10 @@ -769,7 +769,7 @@ 174.11 if ((QueuedAllocationWarningCount > 0) && 174.12 (try_count % QueuedAllocationWarningCount == 0)) { 174.13 warning("TwoGenerationCollectorPolicy::mem_allocate_work retries %d times \n\t" 174.14 - " size=%d %s", try_count, size, is_tlab ? "(TLAB)" : ""); 174.15 + " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : ""); 174.16 } 174.17 } 174.18 } 174.19 @@ -938,7 +938,7 @@ 174.20 if ((QueuedAllocationWarningCount > 0) && 174.21 (loop_count % QueuedAllocationWarningCount == 0)) { 174.22 warning("satisfy_failed_metadata_allocation() retries %d times \n\t" 174.23 - " size=%d", loop_count, word_size); 174.24 + " size=" SIZE_FORMAT, loop_count, word_size); 174.25 } 174.26 } while (true); // Until a GC is done 174.27 }
175.1 --- a/src/share/vm/memory/defNewGeneration.cpp Wed May 28 12:07:21 2014 -0700 175.2 +++ b/src/share/vm/memory/defNewGeneration.cpp Thu May 29 09:56:06 2014 -0700 175.3 @@ -1,5 +1,5 @@ 175.4 /* 175.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 175.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 175.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 175.8 * 175.9 * This code is free software; you can redistribute it and/or modify it 175.10 @@ -46,6 +46,8 @@ 175.11 #include "utilities/copy.hpp" 175.12 #include "utilities/stack.inline.hpp" 175.13 175.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 175.15 + 175.16 // 175.17 // DefNewGeneration functions. 175.18
176.1 --- a/src/share/vm/memory/filemap.cpp Wed May 28 12:07:21 2014 -0700 176.2 +++ b/src/share/vm/memory/filemap.cpp Thu May 29 09:56:06 2014 -0700 176.3 @@ -1,5 +1,5 @@ 176.4 /* 176.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 176.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 176.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 176.8 * 176.9 * This code is free software; you can redistribute it and/or modify it 176.10 @@ -40,6 +40,7 @@ 176.11 #define O_BINARY 0 // otherwise do nothing. 176.12 #endif 176.13 176.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 176.15 176.16 extern address JVM_FunctionAtStart(); 176.17 extern address JVM_FunctionAtEnd();
177.1 --- a/src/share/vm/memory/gcLocker.cpp Wed May 28 12:07:21 2014 -0700 177.2 +++ b/src/share/vm/memory/gcLocker.cpp Thu May 29 09:56:06 2014 -0700 177.3 @@ -1,5 +1,5 @@ 177.4 /* 177.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 177.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 177.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 177.8 * 177.9 * This code is free software; you can redistribute it and/or modify it 177.10 @@ -51,7 +51,7 @@ 177.11 tty->print_cr("critical counts don't match: %d != %d", _jni_lock_count, count); 177.12 for (JavaThread* thr = Threads::first(); thr; thr = thr->next()) { 177.13 if (thr->in_critical()) { 177.14 - tty->print_cr(INTPTR_FORMAT " in_critical %d", thr, thr->in_critical()); 177.15 + tty->print_cr(INTPTR_FORMAT " in_critical %d", p2i(thr), thr->in_critical()); 177.16 } 177.17 } 177.18 }
178.1 --- a/src/share/vm/memory/genCollectedHeap.cpp Wed May 28 12:07:21 2014 -0700 178.2 +++ b/src/share/vm/memory/genCollectedHeap.cpp Thu May 29 09:56:06 2014 -0700 178.3 @@ -1,5 +1,5 @@ 178.4 /* 178.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 178.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 178.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 178.8 * 178.9 * This code is free software; you can redistribute it and/or modify it 178.10 @@ -809,7 +809,7 @@ 178.11 bool GenCollectedHeap::is_in_young(oop p) { 178.12 bool result = ((HeapWord*)p) < _gens[_n_gens - 1]->reserved().start(); 178.13 assert(result == _gens[0]->is_in_reserved(p), 178.14 - err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p)); 178.15 + err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p))); 178.16 return result; 178.17 } 178.18 178.19 @@ -1088,7 +1088,7 @@ 178.20 for (int i = _n_gens-1; i >= 0; i--) { 178.21 Generation* g = _gens[i]; 178.22 if (!silent) { 178.23 - gclog_or_tty->print(g->name()); 178.24 + gclog_or_tty->print("%s", g->name()); 178.25 gclog_or_tty->print(" "); 178.26 } 178.27 g->verify(); 178.28 @@ -1291,7 +1291,7 @@ 178.29 // back a time later than 'now'. 178.30 jlong retVal = now - tolgc_cl.time(); 178.31 if (retVal < 0) { 178.32 - NOT_PRODUCT(warning("time warp: "INT64_FORMAT, retVal);) 178.33 + NOT_PRODUCT(warning("time warp: "INT64_FORMAT, (int64_t) retVal);) 178.34 return 0; 178.35 } 178.36 return retVal;
179.1 --- a/src/share/vm/memory/genOopClosures.hpp Wed May 28 12:07:21 2014 -0700 179.2 +++ b/src/share/vm/memory/genOopClosures.hpp Thu May 29 09:56:06 2014 -0700 179.3 @@ -1,5 +1,5 @@ 179.4 /* 179.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 179.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 179.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 179.8 * 179.9 * This code is free software; you can redistribute it and/or modify it 179.10 @@ -199,7 +199,7 @@ 179.11 protected: 179.12 template <class T> inline void do_oop_work(T* p) { 179.13 oop obj = oopDesc::load_decode_heap_oop(p); 179.14 - guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, (oopDesc*) obj)); 179.15 + guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj))); 179.16 } 179.17 public: 179.18 virtual void do_oop(oop* p);
180.1 --- a/src/share/vm/memory/generation.cpp Wed May 28 12:07:21 2014 -0700 180.2 +++ b/src/share/vm/memory/generation.cpp Thu May 29 09:56:06 2014 -0700 180.3 @@ -1,5 +1,5 @@ 180.4 /* 180.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 180.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 180.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 180.8 * 180.9 * This code is free software; you can redistribute it and/or modify it 180.10 @@ -43,6 +43,8 @@ 180.11 #include "utilities/copy.hpp" 180.12 #include "utilities/events.hpp" 180.13 180.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 180.15 + 180.16 Generation::Generation(ReservedSpace rs, size_t initial_size, int level) : 180.17 _level(level), 180.18 _ref_processor(NULL) {
181.1 --- a/src/share/vm/memory/generation.hpp Wed May 28 12:07:21 2014 -0700 181.2 +++ b/src/share/vm/memory/generation.hpp Thu May 29 09:56:06 2014 -0700 181.3 @@ -1,5 +1,5 @@ 181.4 /* 181.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 181.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 181.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 181.8 * 181.9 * This code is free software; you can redistribute it and/or modify it 181.10 @@ -422,7 +422,7 @@ 181.11 // have to guard against non-monotonicity. 181.12 NOT_PRODUCT( 181.13 if (now < _time_of_last_gc) { 181.14 - warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, _time_of_last_gc, now); 181.15 + warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, (int64_t)_time_of_last_gc, (int64_t)now); 181.16 } 181.17 ) 181.18 return _time_of_last_gc;
182.1 --- a/src/share/vm/memory/heapInspection.cpp Wed May 28 12:07:21 2014 -0700 182.2 +++ b/src/share/vm/memory/heapInspection.cpp Thu May 29 09:56:06 2014 -0700 182.3 @@ -1,5 +1,5 @@ 182.4 /* 182.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 182.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 182.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 182.8 * 182.9 * This code is free software; you can redistribute it and/or modify it 182.10 @@ -35,6 +35,8 @@ 182.11 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" 182.12 #endif // INCLUDE_ALL_GCS 182.13 182.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 182.15 + 182.16 // HeapInspection 182.17 182.18 int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) { 182.19 @@ -270,6 +272,7 @@ 182.20 return true; 182.21 } 182.22 182.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 182.24 void KlassInfoHisto::print_title(outputStream* st, bool csv_format, 182.25 bool selected[], int width_table[], 182.26 const char *name_table[]) { 182.27 @@ -282,7 +285,10 @@ 182.28 } else { 182.29 st->print("Index Super"); 182.30 for (int c=0; c<KlassSizeStats::_num_columns; c++) { 182.31 +PRAGMA_DIAG_PUSH 182.32 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 182.33 if (selected[c]) {st->print(str_fmt(width_table[c]), name_table[c]);} 182.34 +PRAGMA_DIAG_POP 182.35 } 182.36 st->print(" ClassName"); 182.37 } 182.38 @@ -395,12 +401,18 @@ 182.39 case KlassSizeStats::_index_inst_size: 182.40 case KlassSizeStats::_index_inst_count: 182.41 case KlassSizeStats::_index_method_count: 182.42 +PRAGMA_DIAG_PUSH 182.43 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 182.44 st->print(str_fmt(width_table[c]), "-"); 182.45 +PRAGMA_DIAG_POP 182.46 break; 182.47 default: 182.48 { 182.49 double perc = (double)(100) * (double)(colsum_table[c]) / (double)sz_sum._total_bytes; 182.50 +PRAGMA_DIAG_PUSH 182.51 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 182.52 st->print(perc_fmt(width_table[c]), perc); 182.53 +PRAGMA_DIAG_POP 182.54 } 182.55 } 182.56 }
183.1 --- a/src/share/vm/memory/heapInspection.hpp Wed May 28 12:07:21 2014 -0700 183.2 +++ b/src/share/vm/memory/heapInspection.hpp Thu May 29 09:56:06 2014 -0700 183.3 @@ -1,5 +1,5 @@ 183.4 /* 183.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 183.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 183.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 183.8 * 183.9 * This code is free software; you can redistribute it and/or modify it 183.10 @@ -295,6 +295,9 @@ 183.11 // returns a format string to print a julong with the given width. E.g, 183.12 // printf(num_fmt(6), julong(10)) would print out the number 10 with 4 183.13 // leading spaces. 183.14 +PRAGMA_DIAG_PUSH 183.15 +PRAGMA_FORMAT_NONLITERAL_IGNORED 183.16 + 183.17 static void print_julong(outputStream* st, int width, julong n) { 183.18 int num_spaces = width - julong_width(n); 183.19 if (num_spaces > 0) { 183.20 @@ -302,6 +305,7 @@ 183.21 } 183.22 st->print(JULONG_FORMAT, n); 183.23 } 183.24 +PRAGMA_DIAG_POP 183.25 183.26 static char* perc_fmt(int width) { 183.27 static char buf[32];
184.1 --- a/src/share/vm/memory/metachunk.cpp Wed May 28 12:07:21 2014 -0700 184.2 +++ b/src/share/vm/memory/metachunk.cpp Thu May 29 09:56:06 2014 -0700 184.3 @@ -1,5 +1,5 @@ 184.4 /* 184.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 184.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 184.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 184.8 * 184.9 * This code is free software; you can redistribute it and/or modify it 184.10 @@ -28,6 +28,8 @@ 184.11 #include "utilities/copy.hpp" 184.12 #include "utilities/debug.hpp" 184.13 184.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 184.15 + 184.16 class VirtualSpaceNode; 184.17 184.18 const size_t metadata_chunk_initialize = 0xf7f7f7f7;
185.1 --- a/src/share/vm/memory/metaspace.cpp Wed May 28 12:07:21 2014 -0700 185.2 +++ b/src/share/vm/memory/metaspace.cpp Thu May 29 09:56:06 2014 -0700 185.3 @@ -1,5 +1,5 @@ 185.4 /* 185.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 185.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 185.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 185.8 * 185.9 * This code is free software; you can redistribute it and/or modify it 185.10 @@ -48,6 +48,8 @@ 185.11 #include "utilities/copy.hpp" 185.12 #include "utilities/debug.hpp" 185.13 185.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 185.15 + 185.16 typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > BlockTreeDictionary; 185.17 typedef BinaryTreeDictionary<Metachunk, FreeList<Metachunk> > ChunkTreeDictionary; 185.18 185.19 @@ -314,6 +316,8 @@ 185.20 MetaWord* bottom() const { return (MetaWord*) _virtual_space.low(); } 185.21 MetaWord* end() const { return (MetaWord*) _virtual_space.high(); } 185.22 185.23 + bool contains(const void* ptr) { return ptr >= low() && ptr < high(); } 185.24 + 185.25 size_t reserved_words() const { return _virtual_space.reserved_size() / BytesPerWord; } 185.26 size_t committed_words() const { return _virtual_space.actual_committed_size() / BytesPerWord; } 185.27 185.28 @@ -555,6 +559,8 @@ 185.29 void inc_virtual_space_count(); 185.30 void dec_virtual_space_count(); 185.31 185.32 + bool contains(const void* ptr); 185.33 + 185.34 // Unlink empty VirtualSpaceNodes and free it. 185.35 void purge(ChunkManager* chunk_manager); 185.36 185.37 @@ -639,8 +645,6 @@ 185.38 // Accessors 185.39 Metachunk* chunks_in_use(ChunkIndex index) const { return _chunks_in_use[index]; } 185.40 void set_chunks_in_use(ChunkIndex index, Metachunk* v) { 185.41 - // ensure lock-free iteration sees fully initialized node 185.42 - OrderAccess::storestore(); 185.43 _chunks_in_use[index] = v; 185.44 } 185.45 185.46 @@ -755,8 +759,6 @@ 185.47 void print_on(outputStream* st) const; 185.48 void locked_print_chunks_in_use_on(outputStream* st) const; 185.49 185.50 - bool contains(const void *ptr); 185.51 - 185.52 void verify(); 185.53 void verify_chunk_size(Metachunk* chunk); 185.54 NOT_PRODUCT(void mangle_freed_chunks();) 185.55 @@ -1076,6 +1078,7 @@ 185.56 // nodes with a 0 container_count. Remove Metachunks in 185.57 // the node from their respective freelists. 185.58 void VirtualSpaceList::purge(ChunkManager* chunk_manager) { 185.59 + assert(SafepointSynchronize::is_at_safepoint(), "must be called at safepoint for contains to work"); 185.60 assert_lock_strong(SpaceManager::expand_lock()); 185.61 // Don't use a VirtualSpaceListIterator because this 185.62 // list is being changed and a straightforward use of an iterator is not safe. 185.63 @@ -1109,8 +1112,8 @@ 185.64 } 185.65 #ifdef ASSERT 185.66 if (purged_vsl != NULL) { 185.67 - // List should be stable enough to use an iterator here. 185.68 - VirtualSpaceListIterator iter(virtual_space_list()); 185.69 + // List should be stable enough to use an iterator here. 185.70 + VirtualSpaceListIterator iter(virtual_space_list()); 185.71 while (iter.repeat()) { 185.72 VirtualSpaceNode* vsl = iter.get_next(); 185.73 assert(vsl != purged_vsl, "Purge of vsl failed"); 185.74 @@ -1119,6 +1122,23 @@ 185.75 #endif 185.76 } 185.77 185.78 + 185.79 +// This function looks at the mmap regions in the metaspace without locking. 185.80 +// The chunks are added with store ordering and not deleted except for at 185.81 +// unloading time during a safepoint. 185.82 +bool VirtualSpaceList::contains(const void* ptr) { 185.83 + // List should be stable enough to use an iterator here because removing virtual 185.84 + // space nodes is only allowed at a safepoint. 185.85 + VirtualSpaceListIterator iter(virtual_space_list()); 185.86 + while (iter.repeat()) { 185.87 + VirtualSpaceNode* vsn = iter.get_next(); 185.88 + if (vsn->contains(ptr)) { 185.89 + return true; 185.90 + } 185.91 + } 185.92 + return false; 185.93 +} 185.94 + 185.95 void VirtualSpaceList::retire_current_virtual_space() { 185.96 assert_lock_strong(SpaceManager::expand_lock()); 185.97 185.98 @@ -1208,6 +1228,8 @@ 185.99 } else { 185.100 assert(new_entry->reserved_words() == vs_word_size, 185.101 "Reserved memory size differs from requested memory size"); 185.102 + // ensure lock-free iteration sees fully initialized node 185.103 + OrderAccess::storestore(); 185.104 link_vs(new_entry); 185.105 return true; 185.106 } 185.107 @@ -1960,7 +1982,7 @@ 185.108 st->print_cr(" free " SIZE_FORMAT, 185.109 chunk->free_word_size()); 185.110 } else { 185.111 - st->print_cr(""); 185.112 + st->cr(); 185.113 } 185.114 } 185.115 185.116 @@ -2244,7 +2266,7 @@ 185.117 humongous_chunks = next_humongous_chunks; 185.118 } 185.119 if (TraceMetadataChunkAllocation && Verbose) { 185.120 - gclog_or_tty->print_cr(""); 185.121 + gclog_or_tty->cr(); 185.122 gclog_or_tty->print_cr("updated dictionary count %d %s", 185.123 chunk_manager()->humongous_dictionary()->total_count(), 185.124 chunk_size_name(HumongousIndex)); 185.125 @@ -2431,21 +2453,6 @@ 185.126 return result; 185.127 } 185.128 185.129 -// This function looks at the chunks in the metaspace without locking. 185.130 -// The chunks are added with store ordering and not deleted except for at 185.131 -// unloading time. 185.132 -bool SpaceManager::contains(const void *ptr) { 185.133 - for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) 185.134 - { 185.135 - Metachunk* curr = chunks_in_use(i); 185.136 - while (curr != NULL) { 185.137 - if (curr->contains(ptr)) return true; 185.138 - curr = curr->next(); 185.139 - } 185.140 - } 185.141 - return false; 185.142 -} 185.143 - 185.144 void SpaceManager::verify() { 185.145 // If there are blocks in the dictionary, then 185.146 // verfication of chunks does not work since 185.147 @@ -3550,11 +3557,15 @@ 185.148 } 185.149 185.150 bool Metaspace::contains(const void* ptr) { 185.151 - if (vsm()->contains(ptr)) return true; 185.152 - if (using_class_space()) { 185.153 - return class_vsm()->contains(ptr); 185.154 + if (UseSharedSpaces && MetaspaceShared::is_in_shared_space(ptr)) { 185.155 + return true; 185.156 } 185.157 - return false; 185.158 + 185.159 + if (using_class_space() && get_space_list(ClassType)->contains(ptr)) { 185.160 + return true; 185.161 + } 185.162 + 185.163 + return get_space_list(NonClassType)->contains(ptr); 185.164 } 185.165 185.166 void Metaspace::verify() { 185.167 @@ -3799,5 +3810,4 @@ 185.168 TestVirtualSpaceNodeTest::test(); 185.169 TestVirtualSpaceNodeTest::test_is_available(); 185.170 } 185.171 - 185.172 #endif
186.1 --- a/src/share/vm/memory/metaspace.hpp Wed May 28 12:07:21 2014 -0700 186.2 +++ b/src/share/vm/memory/metaspace.hpp Thu May 29 09:56:06 2014 -0700 186.3 @@ -1,5 +1,5 @@ 186.4 /* 186.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 186.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 186.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 186.8 * 186.9 * This code is free software; you can redistribute it and/or modify it 186.10 @@ -232,7 +232,8 @@ 186.11 MetaWord* expand_and_allocate(size_t size, 186.12 MetadataType mdtype); 186.13 186.14 - bool contains(const void* ptr); 186.15 + static bool contains(const void* ptr); 186.16 + 186.17 void dump(outputStream* const out) const; 186.18 186.19 // Free empty virtualspaces
187.1 --- a/src/share/vm/memory/metaspaceShared.cpp Wed May 28 12:07:21 2014 -0700 187.2 +++ b/src/share/vm/memory/metaspaceShared.cpp Thu May 29 09:56:06 2014 -0700 187.3 @@ -1,5 +1,5 @@ 187.4 /* 187.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 187.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 187.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 187.8 * 187.9 * This code is free software; you can redistribute it and/or modify it 187.10 @@ -40,6 +40,7 @@ 187.11 #include "runtime/vmThread.hpp" 187.12 #include "utilities/hashtable.inline.hpp" 187.13 187.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 187.15 187.16 int MetaspaceShared::_max_alignment = 0; 187.17 187.18 @@ -337,13 +338,14 @@ 187.19 int all_rw_count = 0; 187.20 int all_rw_bytes = 0; 187.21 187.22 - const char *fmt = "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f"; 187.23 +// To make fmt_stats be a syntactic constant (for format warnings), use #define. 187.24 +#define fmt_stats "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f" 187.25 const char *sep = "--------------------+---------------------------+---------------------------+--------------------------"; 187.26 const char *hdr = " ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %"; 187.27 187.28 tty->print_cr("Detailed metadata info (rw includes md and mc):"); 187.29 - tty->print_cr(hdr); 187.30 - tty->print_cr(sep); 187.31 + tty->print_cr("%s", hdr); 187.32 + tty->print_cr("%s", sep); 187.33 for (int type = 0; type < int(_number_of_types); type ++) { 187.34 const char *name = type_name((Type)type); 187.35 int ro_count = _counts[RO][type]; 187.36 @@ -357,7 +359,7 @@ 187.37 double rw_perc = 100.0 * double(rw_bytes) / double(rw_all); 187.38 double perc = 100.0 * double(bytes) / double(ro_all + rw_all); 187.39 187.40 - tty->print_cr(fmt, name, 187.41 + tty->print_cr(fmt_stats, name, 187.42 ro_count, ro_bytes, ro_perc, 187.43 rw_count, rw_bytes, rw_perc, 187.44 count, bytes, perc); 187.45 @@ -375,14 +377,15 @@ 187.46 double all_rw_perc = 100.0 * double(all_rw_bytes) / double(rw_all); 187.47 double all_perc = 100.0 * double(all_bytes) / double(ro_all + rw_all); 187.48 187.49 - tty->print_cr(sep); 187.50 - tty->print_cr(fmt, "Total", 187.51 + tty->print_cr("%s", sep); 187.52 + tty->print_cr(fmt_stats, "Total", 187.53 all_ro_count, all_ro_bytes, all_ro_perc, 187.54 all_rw_count, all_rw_bytes, all_rw_perc, 187.55 all_count, all_bytes, all_perc); 187.56 187.57 assert(all_ro_bytes == ro_all, "everything should have been counted"); 187.58 assert(all_rw_bytes == rw_all, "everything should have been counted"); 187.59 +#undef fmt_stats 187.60 } 187.61 187.62 // Populate the shared space. 187.63 @@ -514,7 +517,8 @@ 187.64 md_top = wc.get_top(); 187.65 187.66 // Print shared spaces all the time 187.67 - const char* fmt = "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT; 187.68 +// To make fmt_space be a syntactic constant (for format warnings), use #define. 187.69 +#define fmt_space "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT 187.70 Metaspace* ro_space = _loader_data->ro_metaspace(); 187.71 Metaspace* rw_space = _loader_data->rw_metaspace(); 187.72 187.73 @@ -545,10 +549,10 @@ 187.74 const double mc_u_perc = mc_bytes / double(mc_alloced) * 100.0; 187.75 const double total_u_perc = total_bytes / double(total_alloced) * 100.0; 187.76 187.77 - tty->print_cr(fmt, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, ro_space->bottom()); 187.78 - tty->print_cr(fmt, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, rw_space->bottom()); 187.79 - tty->print_cr(fmt, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, md_low); 187.80 - tty->print_cr(fmt, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, mc_low); 187.81 + tty->print_cr(fmt_space, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, ro_space->bottom()); 187.82 + tty->print_cr(fmt_space, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, rw_space->bottom()); 187.83 + tty->print_cr(fmt_space, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, md_low); 187.84 + tty->print_cr(fmt_space, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, mc_low); 187.85 tty->print_cr("total : %9d [100.0%% of total] out of %9d bytes [%4.1f%% used]", 187.86 total_bytes, total_alloced, total_u_perc); 187.87 187.88 @@ -603,6 +607,7 @@ 187.89 187.90 dac.dump_stats(int(ro_bytes), int(rw_bytes), int(md_bytes), int(mc_bytes)); 187.91 } 187.92 +#undef fmt_space 187.93 } 187.94 187.95 static void link_shared_classes(Klass* obj, TRAPS) {
188.1 --- a/src/share/vm/memory/referenceProcessor.cpp Wed May 28 12:07:21 2014 -0700 188.2 +++ b/src/share/vm/memory/referenceProcessor.cpp Thu May 29 09:56:06 2014 -0700 188.3 @@ -1,5 +1,5 @@ 188.4 /* 188.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 188.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 188.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 188.8 * 188.9 * This code is free software; you can redistribute it and/or modify it 188.10 @@ -35,6 +35,8 @@ 188.11 #include "runtime/java.hpp" 188.12 #include "runtime/jniHandles.hpp" 188.13 188.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 188.15 + 188.16 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL; 188.17 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL; 188.18 bool ReferenceProcessor::_pending_list_uses_discovered_field = false;
189.1 --- a/src/share/vm/memory/sharedHeap.cpp Wed May 28 12:07:21 2014 -0700 189.2 +++ b/src/share/vm/memory/sharedHeap.cpp Thu May 29 09:56:06 2014 -0700 189.3 @@ -1,5 +1,5 @@ 189.4 /* 189.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 189.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 189.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 189.8 * 189.9 * This code is free software; you can redistribute it and/or modify it 189.10 @@ -35,6 +35,8 @@ 189.11 #include "utilities/copy.hpp" 189.12 #include "utilities/workgroup.hpp" 189.13 189.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 189.15 + 189.16 SharedHeap* SharedHeap::_sh; 189.17 189.18 // The set of potentially parallel tasks in strong root scanning.
190.1 --- a/src/share/vm/memory/space.cpp Wed May 28 12:07:21 2014 -0700 190.2 +++ b/src/share/vm/memory/space.cpp Thu May 29 09:56:06 2014 -0700 190.3 @@ -1,5 +1,5 @@ 190.4 /* 190.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 190.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 190.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 190.8 * 190.9 * This code is free software; you can redistribute it and/or modify it 190.10 @@ -45,6 +45,8 @@ 190.11 void SpaceMemRegionOopsIterClosure::do_oop(oop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); } 190.12 void SpaceMemRegionOopsIterClosure::do_oop(narrowOop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); } 190.13 190.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 190.15 + 190.16 HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top, 190.17 HeapWord* top_obj) { 190.18 if (top_obj != NULL) {
191.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.cpp Wed May 28 12:07:21 2014 -0700 191.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp Thu May 29 09:56:06 2014 -0700 191.3 @@ -1,5 +1,5 @@ 191.4 /* 191.5 - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 191.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 191.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 191.8 * 191.9 * This code is free software; you can redistribute it and/or modify it 191.10 @@ -31,6 +31,8 @@ 191.11 #include "runtime/thread.inline.hpp" 191.12 #include "utilities/copy.hpp" 191.13 191.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 191.15 + 191.16 // Thread-Local Edens support 191.17 191.18 // static member initialization
192.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp Wed May 28 12:07:21 2014 -0700 192.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp Thu May 29 09:56:06 2014 -0700 192.3 @@ -1,5 +1,5 @@ 192.4 /* 192.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 192.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 192.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 192.8 * 192.9 * This code is free software; you can redistribute it and/or modify it 192.10 @@ -98,7 +98,7 @@ 192.11 " obj: "SIZE_FORMAT 192.12 " free: "SIZE_FORMAT 192.13 " waste: "SIZE_FORMAT"\n", 192.14 - "slow", thrd, thrd->osthread()->thread_id(), 192.15 + "slow", p2i(thrd), thrd->osthread()->thread_id(), 192.16 obj_size, free(), refill_waste_limit()); 192.17 } 192.18 }
193.1 --- a/src/share/vm/memory/universe.cpp Wed May 28 12:07:21 2014 -0700 193.2 +++ b/src/share/vm/memory/universe.cpp Thu May 29 09:56:06 2014 -0700 193.3 @@ -1,5 +1,5 @@ 193.4 /* 193.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 193.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 193.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 193.8 * 193.9 * This code is free software; you can redistribute it and/or modify it 193.10 @@ -78,6 +78,8 @@ 193.11 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" 193.12 #endif // INCLUDE_ALL_GCS 193.13 193.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 193.15 + 193.16 // Known objects 193.17 Klass* Universe::_boolArrayKlassObj = NULL; 193.18 Klass* Universe::_byteArrayKlassObj = NULL; 193.19 @@ -1348,7 +1350,7 @@ 193.20 HandleMark hm; // Handles created during verification can be zapped 193.21 _verify_count++; 193.22 193.23 - if (!silent) gclog_or_tty->print(prefix); 193.24 + if (!silent) gclog_or_tty->print("%s", prefix); 193.25 if (!silent) gclog_or_tty->print("[Verifying "); 193.26 if (!silent) gclog_or_tty->print("threads "); 193.27 Threads::verify();
194.1 --- a/src/share/vm/oops/annotations.cpp Wed May 28 12:07:21 2014 -0700 194.2 +++ b/src/share/vm/oops/annotations.cpp Thu May 29 09:56:06 2014 -0700 194.3 @@ -1,5 +1,5 @@ 194.4 /* 194.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 194.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 194.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 194.8 * 194.9 * This code is free software; you can redistribute it and/or modify it 194.10 @@ -76,7 +76,7 @@ 194.11 194.12 194.13 void Annotations::print_value_on(outputStream* st) const { 194.14 - st->print("Anotations(" INTPTR_FORMAT ")", this); 194.15 + st->print("Anotations(" INTPTR_FORMAT ")", p2i(this)); 194.16 } 194.17 194.18 #if INCLUDE_SERVICES
195.1 --- a/src/share/vm/oops/constMethod.cpp Wed May 28 12:07:21 2014 -0700 195.2 +++ b/src/share/vm/oops/constMethod.cpp Thu May 29 09:56:06 2014 -0700 195.3 @@ -1,5 +1,5 @@ 195.4 /* 195.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 195.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 195.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 195.8 * 195.9 * This code is free software; you can redistribute it and/or modify it 195.10 @@ -388,8 +388,8 @@ 195.11 void ConstMethod::print_on(outputStream* st) const { 195.12 ResourceMark rm; 195.13 assert(is_constMethod(), "must be constMethod"); 195.14 - st->print_cr(internal_name()); 195.15 - st->print(" - method: " INTPTR_FORMAT " ", (address)method()); 195.16 + st->print_cr("%s", internal_name()); 195.17 + st->print(" - method: " INTPTR_FORMAT " ", p2i((address)method())); 195.18 method()->print_value_on(st); st->cr(); 195.19 if (has_stackmap_table()) { 195.20 st->print(" - stackmap data: ");
196.1 --- a/src/share/vm/oops/constantPool.cpp Wed May 28 12:07:21 2014 -0700 196.2 +++ b/src/share/vm/oops/constantPool.cpp Thu May 29 09:56:06 2014 -0700 196.3 @@ -1,5 +1,5 @@ 196.4 /* 196.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 196.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 196.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 196.8 * 196.9 * This code is free software; you can redistribute it and/or modify it 196.10 @@ -42,6 +42,8 @@ 196.11 #include "runtime/signature.hpp" 196.12 #include "runtime/vframe.hpp" 196.13 196.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 196.15 + 196.16 ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) { 196.17 // Tags are RW but comment below applies to tags also. 196.18 Array<u1>* tags = MetadataFactory::new_writeable_array<u1>(loader_data, length, 0, CHECK_NULL); 196.19 @@ -1884,7 +1886,7 @@ 196.20 void ConstantPool::print_on(outputStream* st) const { 196.21 EXCEPTION_MARK; 196.22 assert(is_constantPool(), "must be constantPool"); 196.23 - st->print_cr(internal_name()); 196.24 + st->print_cr("%s", internal_name()); 196.25 if (flags() != 0) { 196.26 st->print(" - flags: 0x%x", flags()); 196.27 if (has_preresolution()) st->print(" has_preresolution");
197.1 --- a/src/share/vm/oops/cpCache.cpp Wed May 28 12:07:21 2014 -0700 197.2 +++ b/src/share/vm/oops/cpCache.cpp Thu May 29 09:56:06 2014 -0700 197.3 @@ -1,5 +1,5 @@ 197.4 /* 197.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 197.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 197.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 197.8 * 197.9 * This code is free software; you can redistribute it and/or modify it 197.10 @@ -38,8 +38,9 @@ 197.11 # include "gc_implementation/parallelScavenge/psPromotionManager.hpp" 197.12 #endif // INCLUDE_ALL_GCS 197.13 197.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 197.15 197.16 -// Implememtation of ConstantPoolCacheEntry 197.17 +// Implementation of ConstantPoolCacheEntry 197.18 197.19 void ConstantPoolCacheEntry::initialize_entry(int index) { 197.20 assert(0 < index && index < 0x10000, "sanity check"); 197.21 @@ -667,7 +668,7 @@ 197.22 197.23 void ConstantPoolCache::print_on(outputStream* st) const { 197.24 assert(is_constantPoolCache(), "obj must be constant pool cache"); 197.25 - st->print_cr(internal_name()); 197.26 + st->print_cr("%s", internal_name()); 197.27 // print constant pool cache entries 197.28 for (int i = 0; i < length(); i++) entry_at(i)->print(st, i); 197.29 }
198.1 --- a/src/share/vm/oops/generateOopMap.hpp Wed May 28 12:07:21 2014 -0700 198.2 +++ b/src/share/vm/oops/generateOopMap.hpp Thu May 29 09:56:06 2014 -0700 198.3 @@ -1,5 +1,5 @@ 198.4 /* 198.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 198.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 198.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 198.8 * 198.9 * This code is free software; you can redistribute it and/or modify it 198.10 @@ -412,9 +412,9 @@ 198.11 int copy_cts (CellTypeState *dst, CellTypeState *src); 198.12 198.13 // Error handling 198.14 - void error_work (const char *format, va_list ap); 198.15 - void report_error (const char *format, ...); 198.16 - void verify_error (const char *format, ...); 198.17 + void error_work (const char *format, va_list ap) ATTRIBUTE_PRINTF(2, 0); 198.18 + void report_error (const char *format, ...) ATTRIBUTE_PRINTF(2, 3); 198.19 + void verify_error (const char *format, ...) ATTRIBUTE_PRINTF(2, 3); 198.20 bool got_error() { return _got_error; } 198.21 198.22 // Create result set
199.1 --- a/src/share/vm/oops/instanceKlass.cpp Wed May 28 12:07:21 2014 -0700 199.2 +++ b/src/share/vm/oops/instanceKlass.cpp Thu May 29 09:56:06 2014 -0700 199.3 @@ -75,6 +75,8 @@ 199.4 #include "c1/c1_Compiler.hpp" 199.5 #endif 199.6 199.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 199.8 + 199.9 #ifdef DTRACE_ENABLED 199.10 199.11 #ifndef USDT2 199.12 @@ -2895,7 +2897,7 @@ 199.13 st->print(BULLET"instance size: %d", size_helper()); st->cr(); 199.14 st->print(BULLET"klass size: %d", size()); st->cr(); 199.15 st->print(BULLET"access: "); access_flags().print_on(st); st->cr(); 199.16 - st->print(BULLET"state: "); st->print_cr(state_names[_init_state]); 199.17 + st->print(BULLET"state: "); st->print_cr("%s", state_names[_init_state]); 199.18 st->print(BULLET"name: "); name()->print_value_on(st); st->cr(); 199.19 st->print(BULLET"super: "); super()->print_value_on_maybe_null(st); st->cr(); 199.20 st->print(BULLET"sub: ");
200.1 --- a/src/share/vm/oops/instanceRefKlass.cpp Wed May 28 12:07:21 2014 -0700 200.2 +++ b/src/share/vm/oops/instanceRefKlass.cpp Thu May 29 09:56:06 2014 -0700 200.3 @@ -1,5 +1,5 @@ 200.4 /* 200.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 200.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 200.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 200.8 * 200.9 * This code is free software; you can redistribute it and/or modify it 200.10 @@ -45,6 +45,8 @@ 200.11 #include "oops/oop.pcgc.inline.hpp" 200.12 #endif // INCLUDE_ALL_GCS 200.13 200.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 200.15 + 200.16 template <class T> 200.17 void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) { 200.18 T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
201.1 --- a/src/share/vm/oops/klass.cpp Wed May 28 12:07:21 2014 -0700 201.2 +++ b/src/share/vm/oops/klass.cpp Thu May 29 09:56:06 2014 -0700 201.3 @@ -648,7 +648,7 @@ 201.4 201.5 // This can be expensive, but it is worth checking that this klass is actually 201.6 // in the CLD graph but not in production. 201.7 - assert(ClassLoaderDataGraph::contains((address)this), "Should be"); 201.8 + assert(Metaspace::contains((address)this), "Should be"); 201.9 201.10 guarantee(this->is_klass(),"should be klass"); 201.11
202.1 --- a/src/share/vm/oops/klass.inline.hpp Wed May 28 12:07:21 2014 -0700 202.2 +++ b/src/share/vm/oops/klass.inline.hpp Thu May 29 09:56:06 2014 -0700 202.3 @@ -1,5 +1,5 @@ 202.4 /* 202.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 202.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 202.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 202.8 * 202.9 * This code is free software; you can redistribute it and/or modify it 202.10 @@ -63,7 +63,7 @@ 202.11 assert(!is_null(v), "narrow klass value can never be zero"); 202.12 int shift = Universe::narrow_klass_shift(); 202.13 Klass* result = (Klass*)(void*)((uintptr_t)Universe::narrow_klass_base() + ((uintptr_t)v << shift)); 202.14 - assert(check_klass_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result)); 202.15 + assert(check_klass_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result))); 202.16 return result; 202.17 } 202.18
203.1 --- a/src/share/vm/oops/klassVtable.cpp Wed May 28 12:07:21 2014 -0700 203.2 +++ b/src/share/vm/oops/klassVtable.cpp Thu May 29 09:56:06 2014 -0700 203.3 @@ -39,6 +39,8 @@ 203.4 #include "runtime/handles.inline.hpp" 203.5 #include "utilities/copy.hpp" 203.6 203.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 203.8 + 203.9 inline InstanceKlass* klassVtable::ik() const { 203.10 Klass* k = _klass(); 203.11 assert(k->oop_is_instance(), "not an InstanceKlass");
204.1 --- a/src/share/vm/oops/markOop.cpp Wed May 28 12:07:21 2014 -0700 204.2 +++ b/src/share/vm/oops/markOop.cpp Thu May 29 09:56:06 2014 -0700 204.3 @@ -1,5 +1,5 @@ 204.4 /* 204.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 204.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 204.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 204.8 * 204.9 * This code is free software; you can redistribute it and/or modify it 204.10 @@ -26,9 +26,11 @@ 204.11 #include "oops/markOop.hpp" 204.12 #include "runtime/thread.inline.hpp" 204.13 204.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 204.15 + 204.16 void markOopDesc::print_on(outputStream* st) const { 204.17 if (is_locked()) { 204.18 - st->print("locked(0x%lx)->", value()); 204.19 + st->print("locked(" INTPTR_FORMAT ")->", value()); 204.20 markOop(*(markOop*)value())->print_on(st); 204.21 } else { 204.22 assert(is_unlocked() || has_bias_pattern(), "just checking");
205.1 --- a/src/share/vm/oops/method.cpp Wed May 28 12:07:21 2014 -0700 205.2 +++ b/src/share/vm/oops/method.cpp Thu May 29 09:56:06 2014 -0700 205.3 @@ -1,5 +1,5 @@ 205.4 /* 205.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 205.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 205.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 205.8 * 205.9 * This code is free software; you can redistribute it and/or modify it 205.10 @@ -55,6 +55,7 @@ 205.11 #include "utilities/quickSort.hpp" 205.12 #include "utilities/xmlstream.hpp" 205.13 205.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 205.15 205.16 // Implementation of Method 205.17 205.18 @@ -1426,7 +1427,7 @@ 205.19 205.20 void type_name(const char* name) { 205.21 if (_use_separator) _st->print(", "); 205.22 - _st->print(name); 205.23 + _st->print("%s", name); 205.24 _use_separator = true; 205.25 } 205.26 205.27 @@ -1873,6 +1874,14 @@ 205.28 loader_data->jmethod_ids()->clear_all_methods(); 205.29 } 205.30 205.31 +bool Method::has_method_vptr(const void* ptr) { 205.32 + Method m; 205.33 + // This assumes that the vtbl pointer is the first word of a C++ object. 205.34 + // This assumption is also in universe.cpp patch_klass_vtble 205.35 + void* vtbl2 = dereference_vptr((const void*)&m); 205.36 + void* this_vtbl = dereference_vptr(ptr); 205.37 + return vtbl2 == this_vtbl; 205.38 +} 205.39 205.40 // Check that this pointer is valid by checking that the vtbl pointer matches 205.41 bool Method::is_valid_method() const { 205.42 @@ -1881,12 +1890,7 @@ 205.43 } else if (!is_metaspace_object()) { 205.44 return false; 205.45 } else { 205.46 - Method m; 205.47 - // This assumes that the vtbl pointer is the first word of a C++ object. 205.48 - // This assumption is also in universe.cpp patch_klass_vtble 205.49 - void* vtbl2 = dereference_vptr((void*)&m); 205.50 - void* this_vtbl = dereference_vptr((void*)this); 205.51 - return vtbl2 == this_vtbl; 205.52 + return has_method_vptr((const void*)this); 205.53 } 205.54 } 205.55 205.56 @@ -1904,7 +1908,7 @@ 205.57 void Method::print_on(outputStream* st) const { 205.58 ResourceMark rm; 205.59 assert(is_method(), "must be method"); 205.60 - st->print_cr(internal_name()); 205.61 + st->print_cr("%s", internal_name()); 205.62 // get the effect of PrintOopAddress, always, for methods: 205.63 st->print_cr(" - this oop: "INTPTR_FORMAT, (intptr_t)this); 205.64 st->print (" - method holder: "); method_holder()->print_value_on(st); st->cr(); 205.65 @@ -1987,7 +1991,7 @@ 205.66 205.67 void Method::print_value_on(outputStream* st) const { 205.68 assert(is_method(), "must be method"); 205.69 - st->print(internal_name()); 205.70 + st->print("%s", internal_name()); 205.71 print_address_on(st); 205.72 st->print(" "); 205.73 name()->print_value_on(st);
206.1 --- a/src/share/vm/oops/method.hpp Wed May 28 12:07:21 2014 -0700 206.2 +++ b/src/share/vm/oops/method.hpp Thu May 29 09:56:06 2014 -0700 206.3 @@ -868,6 +868,7 @@ 206.4 const char* internal_name() const { return "{method}"; } 206.5 206.6 // Check for valid method pointer 206.7 + static bool has_method_vptr(const void* ptr); 206.8 bool is_valid_method() const; 206.9 206.10 // Verify
207.1 --- a/src/share/vm/oops/methodData.cpp Wed May 28 12:07:21 2014 -0700 207.2 +++ b/src/share/vm/oops/methodData.cpp Thu May 29 09:56:06 2014 -0700 207.3 @@ -1,5 +1,5 @@ 207.4 /* 207.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 207.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 207.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 207.8 * 207.9 * This code is free software; you can redistribute it and/or modify it 207.10 @@ -35,6 +35,8 @@ 207.11 #include "runtime/deoptimization.hpp" 207.12 #include "runtime/handles.inline.hpp" 207.13 207.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 207.15 + 207.16 // ================================================================== 207.17 // DataLayout 207.18 // 207.19 @@ -127,7 +129,7 @@ 207.20 st->print("trap(%s) ", Deoptimization::format_trap_state(buf, sizeof(buf), trap)); 207.21 } 207.22 if (extra != NULL) { 207.23 - st->print(extra); 207.24 + st->print("%s", extra); 207.25 } 207.26 int flags = data()->flags(); 207.27 if (flags != 0) { 207.28 @@ -656,7 +658,7 @@ 207.29 207.30 #ifndef PRODUCT 207.31 void ParametersTypeData::print_data_on(outputStream* st, const char* extra) const { 207.32 - st->print("parameter types", extra); 207.33 + st->print("parameter types"); // FIXME extra ignored? 207.34 _parameters.print_data_on(st); 207.35 } 207.36
208.1 --- a/src/share/vm/oops/oop.cpp Wed May 28 12:07:21 2014 -0700 208.2 +++ b/src/share/vm/oops/oop.cpp Thu May 29 09:56:06 2014 -0700 208.3 @@ -30,6 +30,8 @@ 208.4 #include "runtime/thread.inline.hpp" 208.5 #include "utilities/copy.hpp" 208.6 208.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 208.8 + 208.9 bool always_do_update_barrier = false; 208.10 208.11 BarrierSet* oopDesc::_bs = NULL;
209.1 --- a/src/share/vm/oops/oop.inline.hpp Wed May 28 12:07:21 2014 -0700 209.2 +++ b/src/share/vm/oops/oop.inline.hpp Thu May 29 09:56:06 2014 -0700 209.3 @@ -1,5 +1,5 @@ 209.4 /* 209.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 209.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 209.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 209.8 * 209.9 * This code is free software; you can redistribute it and/or modify it 209.10 @@ -209,7 +209,7 @@ 209.11 address base = Universe::narrow_oop_base(); 209.12 int shift = Universe::narrow_oop_shift(); 209.13 oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift)); 209.14 - assert(check_obj_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result)); 209.15 + assert(check_obj_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result))); 209.16 return result; 209.17 } 209.18
210.1 --- a/src/share/vm/opto/block.cpp Wed May 28 12:07:21 2014 -0700 210.2 +++ b/src/share/vm/opto/block.cpp Thu May 29 09:56:06 2014 -0700 210.3 @@ -1,5 +1,5 @@ 210.4 /* 210.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 210.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 210.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 210.8 * 210.9 * This code is free software; you can redistribute it and/or modify it 210.10 @@ -339,7 +339,7 @@ 210.11 st->print(" FRegPressure: %d",_freg_pressure); 210.12 st->print(" FHRP Index: %d",_fhrp_index); 210.13 } 210.14 - st->print_cr(""); 210.15 + st->cr(); 210.16 } 210.17 210.18 void Block::dump() const {
211.1 --- a/src/share/vm/opto/c2_globals.hpp Wed May 28 12:07:21 2014 -0700 211.2 +++ b/src/share/vm/opto/c2_globals.hpp Thu May 29 09:56:06 2014 -0700 211.3 @@ -455,7 +455,7 @@ 211.4 notproduct(bool, PrintEliminateLocks, false, \ 211.5 "Print out when locks are eliminated") \ 211.6 \ 211.7 - product(bool, EliminateAutoBox, false, \ 211.8 + product(bool, EliminateAutoBox, true, \ 211.9 "Control optimizations for autobox elimination") \ 211.10 \ 211.11 diagnostic(bool, UseImplicitStableValues, true, \
212.1 --- a/src/share/vm/opto/callGenerator.cpp Wed May 28 12:07:21 2014 -0700 212.2 +++ b/src/share/vm/opto/callGenerator.cpp Thu May 29 09:56:06 2014 -0700 212.3 @@ -381,7 +381,7 @@ 212.4 } 212.5 212.6 // Setup default node notes to be picked up by the inlining 212.7 - Node_Notes* old_nn = C->default_node_notes(); 212.8 + Node_Notes* old_nn = C->node_notes_at(call->_idx); 212.9 if (old_nn != NULL) { 212.10 Node_Notes* entry_nn = old_nn->clone(C); 212.11 entry_nn->set_jvms(jvms);
213.1 --- a/src/share/vm/opto/callnode.cpp Wed May 28 12:07:21 2014 -0700 213.2 +++ b/src/share/vm/opto/callnode.cpp Thu May 29 09:56:06 2014 -0700 213.3 @@ -1,5 +1,5 @@ 213.4 /* 213.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 213.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 213.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 213.8 * 213.9 * This code is free software; you can redistribute it and/or modify it 213.10 @@ -111,7 +111,7 @@ 213.11 #ifndef PRODUCT 213.12 void ParmNode::dump_spec(outputStream *st) const { 213.13 if( _con < TypeFunc::Parms ) { 213.14 - st->print(names[_con]); 213.15 + st->print("%s", names[_con]); 213.16 } else { 213.17 st->print("Parm%d: ",_con-TypeFunc::Parms); 213.18 // Verbose and WizardMode dump bottom_type for all nodes 213.19 @@ -347,19 +347,19 @@ 213.20 break; 213.21 case Type::AryPtr: 213.22 case Type::InstPtr: 213.23 - st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->isa_oopptr()->const_oop()); 213.24 + st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->isa_oopptr()->const_oop())); 213.25 break; 213.26 case Type::KlassPtr: 213.27 - st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_klassptr()->klass()); 213.28 + st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_klassptr()->klass())); 213.29 break; 213.30 case Type::MetadataPtr: 213.31 - st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_metadataptr()->metadata()); 213.32 + st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_metadataptr()->metadata())); 213.33 break; 213.34 case Type::NarrowOop: 213.35 - st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_oopptr()->const_oop()); 213.36 + st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_oopptr()->const_oop())); 213.37 break; 213.38 case Type::RawPtr: 213.39 - st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,t->is_rawptr()); 213.40 + st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,p2i(t->is_rawptr())); 213.41 break; 213.42 case Type::DoubleCon: 213.43 st->print(" %s%d]=#%fD",msg,i,t->is_double_constant()->_d); 213.44 @@ -368,7 +368,7 @@ 213.45 st->print(" %s%d]=#%fF",msg,i,t->is_float_constant()->_f); 213.46 break; 213.47 case Type::Long: 213.48 - st->print(" %s%d]=#"INT64_FORMAT,msg,i,t->is_long()->get_con()); 213.49 + st->print(" %s%d]=#"INT64_FORMAT,msg,i,(int64_t)(t->is_long()->get_con())); 213.50 break; 213.51 case Type::Half: 213.52 case Type::Top: 213.53 @@ -427,7 +427,7 @@ 213.54 213.55 for (i = 0; i < (uint)scobjs.length(); i++) { 213.56 // Scalar replaced objects. 213.57 - st->print_cr(""); 213.58 + st->cr(); 213.59 st->print(" # ScObj" INT32_FORMAT " ", i); 213.60 SafePointScalarObjectNode* spobj = scobjs.at(i); 213.61 ciKlass* cik = spobj->bottom_type()->is_oopptr()->klass(); 213.62 @@ -484,7 +484,7 @@ 213.63 st->print(" }"); 213.64 } 213.65 } 213.66 - st->print_cr(""); 213.67 + st->cr(); 213.68 if (caller() != NULL) caller()->format(regalloc, n, st); 213.69 } 213.70 213.71 @@ -947,7 +947,7 @@ 213.72 #ifndef PRODUCT 213.73 void CallRuntimeNode::dump_spec(outputStream *st) const { 213.74 st->print("# "); 213.75 - st->print(_name); 213.76 + st->print("%s", _name); 213.77 CallNode::dump_spec(st); 213.78 } 213.79 #endif 213.80 @@ -965,7 +965,7 @@ 213.81 #ifndef PRODUCT 213.82 void CallLeafNode::dump_spec(outputStream *st) const { 213.83 st->print("# "); 213.84 - st->print(_name); 213.85 + st->print("%s", _name); 213.86 CallNode::dump_spec(st); 213.87 } 213.88 #endif
214.1 --- a/src/share/vm/opto/chaitin.cpp Wed May 28 12:07:21 2014 -0700 214.2 +++ b/src/share/vm/opto/chaitin.cpp Thu May 29 09:56:06 2014 -0700 214.3 @@ -1,5 +1,5 @@ 214.4 /* 214.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 214.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 214.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 214.8 * 214.9 * This code is free software; you can redistribute it and/or modify it 214.10 @@ -2019,25 +2019,25 @@ 214.11 tty->print_cr("new LRG"); 214.12 } 214.13 } 214.14 - tty->print_cr(""); 214.15 + tty->cr(); 214.16 214.17 // Dump lo-degree list 214.18 tty->print("Lo degree: "); 214.19 for(uint i3 = _lo_degree; i3; i3 = lrgs(i3)._next ) 214.20 tty->print("L%d ",i3); 214.21 - tty->print_cr(""); 214.22 + tty->cr(); 214.23 214.24 // Dump lo-stk-degree list 214.25 tty->print("Lo stk degree: "); 214.26 for(uint i4 = _lo_stk_degree; i4; i4 = lrgs(i4)._next ) 214.27 tty->print("L%d ",i4); 214.28 - tty->print_cr(""); 214.29 + tty->cr(); 214.30 214.31 // Dump lo-degree list 214.32 tty->print("Hi degree: "); 214.33 for(uint i5 = _hi_degree; i5; i5 = lrgs(i5)._next ) 214.34 tty->print("L%d ",i5); 214.35 - tty->print_cr(""); 214.36 + tty->cr(); 214.37 } 214.38 214.39 void PhaseChaitin::dump_degree_lists() const { 214.40 @@ -2045,26 +2045,26 @@ 214.41 tty->print("Lo degree: "); 214.42 for( uint i = _lo_degree; i; i = lrgs(i)._next ) 214.43 tty->print("L%d ",i); 214.44 - tty->print_cr(""); 214.45 + tty->cr(); 214.46 214.47 // Dump lo-stk-degree list 214.48 tty->print("Lo stk degree: "); 214.49 for(uint i2 = _lo_stk_degree; i2; i2 = lrgs(i2)._next ) 214.50 tty->print("L%d ",i2); 214.51 - tty->print_cr(""); 214.52 + tty->cr(); 214.53 214.54 // Dump lo-degree list 214.55 tty->print("Hi degree: "); 214.56 for(uint i3 = _hi_degree; i3; i3 = lrgs(i3)._next ) 214.57 tty->print("L%d ",i3); 214.58 - tty->print_cr(""); 214.59 + tty->cr(); 214.60 } 214.61 214.62 void PhaseChaitin::dump_simplified() const { 214.63 tty->print("Simplified: "); 214.64 for( uint i = _simplified; i; i = lrgs(i)._next ) 214.65 tty->print("L%d ",i); 214.66 - tty->print_cr(""); 214.67 + tty->cr(); 214.68 } 214.69 214.70 static char *print_reg( OptoReg::Name reg, const PhaseChaitin *pc, char *buf ) { 214.71 @@ -2143,7 +2143,7 @@ 214.72 } 214.73 tty->print(" : parm %d: ", k); 214.74 domain->field_at(k + TypeFunc::Parms)->dump(); 214.75 - tty->print_cr(""); 214.76 + tty->cr(); 214.77 } 214.78 } 214.79 214.80 @@ -2165,7 +2165,7 @@ 214.81 _matcher._parm_regs[j].second() == reg ) { 214.82 tty->print("parm %d: ",j); 214.83 domain->field_at(j + TypeFunc::Parms)->dump(); 214.84 - tty->print_cr(""); 214.85 + tty->cr(); 214.86 break; 214.87 } 214.88 }
215.1 --- a/src/share/vm/opto/compile.cpp Wed May 28 12:07:21 2014 -0700 215.2 +++ b/src/share/vm/opto/compile.cpp Thu May 29 09:56:06 2014 -0700 215.3 @@ -1,5 +1,5 @@ 215.4 /* 215.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 215.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 215.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 215.8 * 215.9 * This code is free software; you can redistribute it and/or modify it 215.10 @@ -2411,7 +2411,7 @@ 215.11 starts_bundle = ' '; 215.12 tty->print("\t"); 215.13 delay->format(_regalloc, tty); 215.14 - tty->print_cr(""); 215.15 + tty->cr(); 215.16 delay = NULL; 215.17 } 215.18 215.19 @@ -2425,12 +2425,12 @@ 215.20 if (pcs && n->_idx < pc_limit) 215.21 tty->print_cr("%3.3x", pcs[n->_idx]); 215.22 else 215.23 - tty->print_cr(""); 215.24 + tty->cr(); 215.25 215.26 assert(cut_short || delay == NULL, "no unconditional delay branch"); 215.27 215.28 } // End of per-block dump 215.29 - tty->print_cr(""); 215.30 + tty->cr(); 215.31 215.32 if (cut_short) tty->print_cr("*** disassembly is cut short ***"); 215.33 } 215.34 @@ -3671,7 +3671,8 @@ 215.35 default: ShouldNotReachHere(); 215.36 } 215.37 assert(constant_addr, "consts section too small"); 215.38 - assert((constant_addr - _masm.code()->consts()->start()) == con.offset(), err_msg_res("must be: %d == %d", constant_addr - _masm.code()->consts()->start(), con.offset())); 215.39 + assert((constant_addr - _masm.code()->consts()->start()) == con.offset(), 215.40 + err_msg_res("must be: %d == %d", (int) (constant_addr - _masm.code()->consts()->start()), (int)(con.offset()))); 215.41 } 215.42 } 215.43 215.44 @@ -3751,7 +3752,7 @@ 215.45 215.46 for (uint i = 0; i < n->outcnt(); i++) { 215.47 address* constant_addr = &jump_table_base[i]; 215.48 - 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))); 215.49 + 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))); 215.50 *constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr); 215.51 cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type); 215.52 } 215.53 @@ -3782,7 +3783,7 @@ 215.54 } 215.55 } 215.56 for (int i = 0; i < _print_inlining_list->length(); i++) { 215.57 - tty->print(_print_inlining_list->adr_at(i)->ss()->as_string()); 215.58 + tty->print("%s", _print_inlining_list->adr_at(i)->ss()->as_string()); 215.59 } 215.60 } 215.61 }
216.1 --- a/src/share/vm/opto/compile.hpp Wed May 28 12:07:21 2014 -0700 216.2 +++ b/src/share/vm/opto/compile.hpp Thu May 29 09:56:06 2014 -0700 216.3 @@ -1,5 +1,5 @@ 216.4 /* 216.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 216.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 216.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 216.8 * 216.9 * This code is free software; you can redistribute it and/or modify it 216.10 @@ -465,7 +465,7 @@ 216.11 void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) { 216.12 stringStream ss; 216.13 CompileTask::print_inlining(&ss, method, inline_level, bci, msg); 216.14 - print_inlining_stream()->print(ss.as_string()); 216.15 + print_inlining_stream()->print("%s", ss.as_string()); 216.16 } 216.17 216.18 void* replay_inline_data() const { return _replay_inline_data; }
217.1 --- a/src/share/vm/opto/doCall.cpp Wed May 28 12:07:21 2014 -0700 217.2 +++ b/src/share/vm/opto/doCall.cpp Thu May 29 09:56:06 2014 -0700 217.3 @@ -1,5 +1,5 @@ 217.4 /* 217.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 217.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 217.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 217.8 * 217.9 * This code is free software; you can redistribute it and/or modify it 217.10 @@ -56,7 +56,7 @@ 217.11 out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count); 217.12 stringStream ss; 217.13 prof_klass->name()->print_symbol_on(&ss); 217.14 - out->print(ss.as_string()); 217.15 + out->print("%s", ss.as_string()); 217.16 out->cr(); 217.17 } 217.18 } 217.19 @@ -358,7 +358,7 @@ 217.20 bool Compile::should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms) { 217.21 if (eliminate_boxing() && call_method->is_boxing_method()) { 217.22 set_has_boxed_value(true); 217.23 - return true; 217.24 + return aggressive_unboxing(); 217.25 } 217.26 return false; 217.27 }
218.1 --- a/src/share/vm/opto/gcm.cpp Wed May 28 12:07:21 2014 -0700 218.2 +++ b/src/share/vm/opto/gcm.cpp Thu May 29 09:56:06 2014 -0700 218.3 @@ -1,5 +1,5 @@ 218.4 /* 218.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 218.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 218.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 218.8 * 218.9 * This code is free software; you can redistribute it and/or modify it 218.10 @@ -2014,7 +2014,7 @@ 218.11 tty->print("%s: %d trip_count: %6.0f freq: %6.0f\n", 218.12 _depth == 0 ? "Method" : "Loop", _id, trip_count(), _freq); 218.13 for (int i = 0; i < _depth; i++) tty->print(" "); 218.14 - tty->print(" members:", _id); 218.15 + tty->print(" members:"); 218.16 int k = 0; 218.17 for (int i = 0; i < _members.length(); i++) { 218.18 if (k++ >= 6) {
219.1 --- a/src/share/vm/opto/idealGraphPrinter.cpp Wed May 28 12:07:21 2014 -0700 219.2 +++ b/src/share/vm/opto/idealGraphPrinter.cpp Thu May 29 09:56:06 2014 -0700 219.3 @@ -1,5 +1,5 @@ 219.4 /* 219.5 - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 219.6 + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. 219.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 219.8 * 219.9 * This code is free software; you can redistribute it and/or modify it 219.10 @@ -155,7 +155,7 @@ 219.11 } else { 219.12 // It would be nice if we could shut down cleanly but it should 219.13 // be an error if we can't connect to the visualizer. 219.14 - fatal(err_msg_res("Couldn't connect to visualizer at %s:%d", 219.15 + fatal(err_msg_res("Couldn't connect to visualizer at %s:" INTX_FORMAT, 219.16 PrintIdealGraphAddress, PrintIdealGraphPort)); 219.17 } 219.18 } 219.19 @@ -195,7 +195,7 @@ 219.20 219.21 219.22 void IdealGraphPrinter::begin_elem(const char *s) { 219.23 - _xml->begin_elem(s); 219.24 + _xml->begin_elem("%s", s); 219.25 } 219.26 219.27 void IdealGraphPrinter::end_elem() { 219.28 @@ -203,7 +203,7 @@ 219.29 } 219.30 219.31 void IdealGraphPrinter::begin_head(const char *s) { 219.32 - _xml->begin_head(s); 219.33 + _xml->begin_head("%s", s); 219.34 } 219.35 219.36 void IdealGraphPrinter::end_head() { 219.37 @@ -223,7 +223,7 @@ 219.38 } 219.39 219.40 void IdealGraphPrinter::head(const char *name) { 219.41 - _xml->head(name); 219.42 + _xml->head("%s", name); 219.43 } 219.44 219.45 void IdealGraphPrinter::tail(const char *name) { 219.46 @@ -231,7 +231,7 @@ 219.47 } 219.48 219.49 void IdealGraphPrinter::text(const char *s) { 219.50 - _xml->text(s); 219.51 + _xml->text("%s", s); 219.52 } 219.53 219.54 void IdealGraphPrinter::print_prop(const char *name, int val) { 219.55 @@ -359,7 +359,7 @@ 219.56 void IdealGraphPrinter::print_indent() { 219.57 tty->print_cr("printing ident %d", _depth); 219.58 for (int i = 0; i < _depth; i++) { 219.59 - _xml->print(INDENT); 219.60 + _xml->print("%s", INDENT); 219.61 } 219.62 } 219.63
220.1 --- a/src/share/vm/opto/ifg.cpp Wed May 28 12:07:21 2014 -0700 220.2 +++ b/src/share/vm/opto/ifg.cpp Thu May 29 09:56:06 2014 -0700 220.3 @@ -1,5 +1,5 @@ 220.4 /* 220.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 220.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 220.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 220.8 * 220.9 * This code is free software; you can redistribute it and/or modify it 220.10 @@ -257,7 +257,7 @@ 220.11 for( i = 0; i < _maxlrg*2; i++ ) 220.12 if( h_cnt[i] ) 220.13 tty->print("%d/%d ",i,h_cnt[i]); 220.14 - tty->print_cr(""); 220.15 + tty->cr(); 220.16 } 220.17 220.18 void PhaseIFG::verify( const PhaseChaitin *pc ) const {
221.1 --- a/src/share/vm/opto/ifnode.cpp Wed May 28 12:07:21 2014 -0700 221.2 +++ b/src/share/vm/opto/ifnode.cpp Thu May 29 09:56:06 2014 -0700 221.3 @@ -673,7 +673,7 @@ 221.4 // / Region 221.5 // 221.6 Node* IfNode::fold_compares(PhaseGVN* phase) { 221.7 - if (!phase->C->eliminate_boxing() || Opcode() != Op_If) return NULL; 221.8 + if (Opcode() != Op_If) return NULL; 221.9 221.10 Node* this_cmp = in(1)->in(1); 221.11 if (this_cmp != NULL && this_cmp->Opcode() == Op_CmpI &&
222.1 --- a/src/share/vm/opto/library_call.cpp Wed May 28 12:07:21 2014 -0700 222.2 +++ b/src/share/vm/opto/library_call.cpp Thu May 29 09:56:06 2014 -0700 222.3 @@ -216,7 +216,7 @@ 222.4 bool inline_math_subtractExactL(bool is_decrement); 222.5 bool inline_exp(); 222.6 bool inline_pow(); 222.7 - void finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName); 222.8 + Node* finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName); 222.9 bool inline_min_max(vmIntrinsics::ID id); 222.10 Node* generate_min_max(vmIntrinsics::ID id, Node* x, Node* y); 222.11 // This returns Type::AnyPtr, RawPtr, or OopPtr. 222.12 @@ -1678,7 +1678,7 @@ 222.13 return true; 222.14 } 222.15 222.16 -void LibraryCallKit::finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName) { 222.17 +Node* LibraryCallKit::finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName) { 222.18 //------------------- 222.19 //result=(result.isNaN())? funcAddr():result; 222.20 // Check: If isNaN() by checking result!=result? then either trap 222.21 @@ -1694,7 +1694,7 @@ 222.22 uncommon_trap(Deoptimization::Reason_intrinsic, 222.23 Deoptimization::Action_make_not_entrant); 222.24 } 222.25 - set_result(result); 222.26 + return result; 222.27 } else { 222.28 // If this inlining ever returned NaN in the past, we compile a call 222.29 // to the runtime to properly handle corner cases 222.30 @@ -1724,9 +1724,10 @@ 222.31 222.32 result_region->init_req(2, control()); 222.33 result_val->init_req(2, value); 222.34 - set_result(result_region, result_val); 222.35 + set_control(_gvn.transform(result_region)); 222.36 + return _gvn.transform(result_val); 222.37 } else { 222.38 - set_result(result); 222.39 + return result; 222.40 } 222.41 } 222.42 } 222.43 @@ -1738,7 +1739,8 @@ 222.44 Node* arg = round_double_node(argument(0)); 222.45 Node* n = _gvn.transform(new (C) ExpDNode(C, control(), arg)); 222.46 222.47 - finish_pow_exp(n, arg, NULL, OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dexp), "EXP"); 222.48 + n = finish_pow_exp(n, arg, NULL, OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dexp), "EXP"); 222.49 + set_result(n); 222.50 222.51 C->set_has_split_ifs(true); // Has chance for split-if optimization 222.52 return true; 222.53 @@ -1748,27 +1750,48 @@ 222.54 // Inline power instructions, if possible. 222.55 bool LibraryCallKit::inline_pow() { 222.56 // Pseudocode for pow 222.57 - // if (x <= 0.0) { 222.58 - // long longy = (long)y; 222.59 - // if ((double)longy == y) { // if y is long 222.60 - // if (y + 1 == y) longy = 0; // huge number: even 222.61 - // result = ((1&longy) == 0)?-DPow(abs(x), y):DPow(abs(x), y); 222.62 + // if (y == 2) { 222.63 + // return x * x; 222.64 + // } else { 222.65 + // if (x <= 0.0) { 222.66 + // long longy = (long)y; 222.67 + // if ((double)longy == y) { // if y is long 222.68 + // if (y + 1 == y) longy = 0; // huge number: even 222.69 + // result = ((1&longy) == 0)?-DPow(abs(x), y):DPow(abs(x), y); 222.70 + // } else { 222.71 + // result = NaN; 222.72 + // } 222.73 // } else { 222.74 - // result = NaN; 222.75 + // result = DPow(x,y); 222.76 // } 222.77 - // } else { 222.78 - // result = DPow(x,y); 222.79 + // if (result != result)? { 222.80 + // result = uncommon_trap() or runtime_call(); 222.81 + // } 222.82 + // return result; 222.83 // } 222.84 - // if (result != result)? { 222.85 - // result = uncommon_trap() or runtime_call(); 222.86 - // } 222.87 - // return result; 222.88 222.89 Node* x = round_double_node(argument(0)); 222.90 Node* y = round_double_node(argument(2)); 222.91 222.92 Node* result = NULL; 222.93 222.94 + Node* const_two_node = makecon(TypeD::make(2.0)); 222.95 + Node* cmp_node = _gvn.transform(new (C) CmpDNode(y, const_two_node)); 222.96 + Node* bool_node = _gvn.transform(new (C) BoolNode(cmp_node, BoolTest::eq)); 222.97 + IfNode* if_node = create_and_xform_if(control(), bool_node, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); 222.98 + Node* if_true = _gvn.transform(new (C) IfTrueNode(if_node)); 222.99 + Node* if_false = _gvn.transform(new (C) IfFalseNode(if_node)); 222.100 + 222.101 + RegionNode* region_node = new (C) RegionNode(3); 222.102 + region_node->init_req(1, if_true); 222.103 + 222.104 + Node* phi_node = new (C) PhiNode(region_node, Type::DOUBLE); 222.105 + // special case for x^y where y == 2, we can convert it to x * x 222.106 + phi_node->init_req(1, _gvn.transform(new (C) MulDNode(x, x))); 222.107 + 222.108 + // set control to if_false since we will now process the false branch 222.109 + set_control(if_false); 222.110 + 222.111 if (!too_many_traps(Deoptimization::Reason_intrinsic)) { 222.112 // Short form: skip the fancy tests and just check for NaN result. 222.113 result = _gvn.transform(new (C) PowDNode(C, control(), x, y)); 222.114 @@ -1892,7 +1915,15 @@ 222.115 result = _gvn.transform(phi); 222.116 } 222.117 222.118 - finish_pow_exp(result, x, y, OptoRuntime::Math_DD_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dpow), "POW"); 222.119 + result = finish_pow_exp(result, x, y, OptoRuntime::Math_DD_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dpow), "POW"); 222.120 + 222.121 + // control from finish_pow_exp is now input to the region node 222.122 + region_node->set_req(2, control()); 222.123 + // the result from finish_pow_exp is now input to the phi node 222.124 + phi_node->init_req(2, result); 222.125 + set_control(_gvn.transform(region_node)); 222.126 + record_for_igvn(region_node); 222.127 + set_result(_gvn.transform(phi_node)); 222.128 222.129 C->set_has_split_ifs(true); // Has chance for split-if optimization 222.130 return true;
223.1 --- a/src/share/vm/opto/loopPredicate.cpp Wed May 28 12:07:21 2014 -0700 223.2 +++ b/src/share/vm/opto/loopPredicate.cpp Thu May 29 09:56:06 2014 -0700 223.3 @@ -1,5 +1,5 @@ 223.4 /* 223.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 223.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 223.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 223.8 * 223.9 * This code is free software; you can redistribute it and/or modify it 223.10 @@ -637,7 +637,7 @@ 223.11 223.12 if (TraceLoopPredicate) { 223.13 predString->print_cr("<u range"); 223.14 - tty->print(predString->as_string()); 223.15 + tty->print("%s", predString->as_string()); 223.16 } 223.17 return bol; 223.18 }
224.1 --- a/src/share/vm/opto/loopnode.cpp Wed May 28 12:07:21 2014 -0700 224.2 +++ b/src/share/vm/opto/loopnode.cpp Thu May 29 09:56:06 2014 -0700 224.3 @@ -1,5 +1,5 @@ 224.4 /* 224.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 224.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 224.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 224.8 * 224.9 * This code is free software; you can redistribute it and/or modify it 224.10 @@ -3568,7 +3568,7 @@ 224.11 224.12 #ifdef ASSERT 224.13 void PhaseIdealLoop::dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA) { 224.14 - tty->print_cr(msg); 224.15 + tty->print_cr("%s", msg); 224.16 tty->print("n: "); n->dump(); 224.17 tty->print("early(n): "); early->dump(); 224.18 if (n->in(0) != NULL && !n->in(0)->is_top() &&
225.1 --- a/src/share/vm/opto/matcher.cpp Wed May 28 12:07:21 2014 -0700 225.2 +++ b/src/share/vm/opto/matcher.cpp Thu May 29 09:56:06 2014 -0700 225.3 @@ -1,5 +1,5 @@ 225.4 /* 225.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 225.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 225.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 225.8 * 225.9 * This code is free software; you can redistribute it and/or modify it 225.10 @@ -2622,7 +2622,7 @@ 225.11 tty->print_cr("%s %d %s", 225.12 ruleName[i], _cost[i], ruleName[_rule[i]] ); 225.13 } 225.14 - tty->print_cr(""); 225.15 + tty->cr(); 225.16 225.17 for( i=0; i<2; i++ ) 225.18 if( _kids[i] )
226.1 --- a/src/share/vm/opto/memnode.cpp Wed May 28 12:07:21 2014 -0700 226.2 +++ b/src/share/vm/opto/memnode.cpp Thu May 29 09:56:06 2014 -0700 226.3 @@ -1,5 +1,5 @@ 226.4 /* 226.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 226.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 226.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 226.8 * 226.9 * This code is free software; you can redistribute it and/or modify it 226.10 @@ -4023,7 +4023,7 @@ 226.11 intptr_t st_off = get_store_offset(st, phase); 226.12 if (st_off < 0) continue; // ignore dead garbage 226.13 if (last_off > st_off) { 226.14 - tty->print_cr("*** bad store offset at %d: %d > %d", i, last_off, st_off); 226.15 + tty->print_cr("*** bad store offset at %d: " INTX_FORMAT " > " INTX_FORMAT, i, last_off, st_off); 226.16 this->dump(2); 226.17 assert(false, "ascending store offsets"); 226.18 return false;
227.1 --- a/src/share/vm/opto/node.cpp Wed May 28 12:07:21 2014 -0700 227.2 +++ b/src/share/vm/opto/node.cpp Thu May 29 09:56:06 2014 -0700 227.3 @@ -1,5 +1,5 @@ 227.4 /* 227.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 227.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 227.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 227.8 * 227.9 * This code is free software; you can redistribute it and/or modify it 227.10 @@ -1680,7 +1680,7 @@ 227.11 } 227.12 } 227.13 } 227.14 - if (suffix) st->print(suffix); 227.15 + if (suffix) st->print("%s", suffix); 227.16 C->_in_dump_cnt--; 227.17 } 227.18
228.1 --- a/src/share/vm/opto/parse1.cpp Wed May 28 12:07:21 2014 -0700 228.2 +++ b/src/share/vm/opto/parse1.cpp Thu May 29 09:56:06 2014 -0700 228.3 @@ -1,5 +1,5 @@ 228.4 /* 228.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 228.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 228.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 228.8 * 228.9 * This code is free software; you can redistribute it and/or modify it 228.10 @@ -607,7 +607,7 @@ 228.11 set_map(entry_map); 228.12 do_exits(); 228.13 228.14 - if (log) log->done("parse nodes='%d' live='%d' memory='%d'", 228.15 + if (log) log->done("parse nodes='%d' live='%d' memory='" SIZE_FORMAT "'", 228.16 C->unique(), C->live_nodes(), C->node_arena()->used()); 228.17 } 228.18 228.19 @@ -1369,7 +1369,7 @@ 228.20 tty->print((( i < ns) ? " %d" : " %d(e)"), b->successor_at(i)->rpo()); 228.21 } 228.22 if (b->is_loop_head()) tty->print(" lphd"); 228.23 - tty->print_cr(""); 228.24 + tty->cr(); 228.25 } 228.26 228.27 assert(block()->is_merged(), "must be merged before being parsed");
229.1 --- a/src/share/vm/opto/parse2.cpp Wed May 28 12:07:21 2014 -0700 229.2 +++ b/src/share/vm/opto/parse2.cpp Thu May 29 09:56:06 2014 -0700 229.3 @@ -1,5 +1,5 @@ 229.4 /* 229.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 229.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 229.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 229.8 * 229.9 * This code is free software; you can redistribute it and/or modify it 229.10 @@ -626,7 +626,7 @@ 229.11 _method->print_short_name(); 229.12 tty->print_cr(" switch decision tree"); 229.13 tty->print_cr(" %d ranges (%d singletons), max_depth=%d, est_depth=%d", 229.14 - hi-lo+1, nsing, _max_switch_depth, _est_switch_depth); 229.15 + (int) (hi-lo+1), nsing, _max_switch_depth, _est_switch_depth); 229.16 if (_max_switch_depth > _est_switch_depth) { 229.17 tty->print_cr("******** BAD SWITCH DEPTH ********"); 229.18 } 229.19 @@ -634,7 +634,7 @@ 229.20 for( r = lo; r <= hi; r++ ) { 229.21 r->print(); 229.22 } 229.23 - tty->print_cr(""); 229.24 + tty->cr(); 229.25 } 229.26 #endif 229.27 }
230.1 --- a/src/share/vm/opto/phaseX.cpp Wed May 28 12:07:21 2014 -0700 230.2 +++ b/src/share/vm/opto/phaseX.cpp Thu May 29 09:56:06 2014 -0700 230.3 @@ -1,5 +1,5 @@ 230.4 /* 230.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 230.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 230.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 230.8 * 230.9 * This code is free software; you can redistribute it and/or modify it 230.10 @@ -1002,10 +1002,10 @@ 230.11 if ( VerifyIterativeGVN && PrintOpto ) { 230.12 if ( _verify_counter == _verify_full_passes ) 230.13 tty->print_cr("VerifyIterativeGVN: %d transforms and verify passes", 230.14 - _verify_full_passes); 230.15 + (int) _verify_full_passes); 230.16 else 230.17 tty->print_cr("VerifyIterativeGVN: %d transforms, %d full verify passes", 230.18 - _verify_counter, _verify_full_passes); 230.19 + (int) _verify_counter, (int) _verify_full_passes); 230.20 } 230.21 #endif 230.22 } 230.23 @@ -1379,6 +1379,15 @@ 230.24 _worklist.push(u); 230.25 } 230.26 } 230.27 + // If changed AddI/SubI inputs, check CmpU for range check optimization. 230.28 + if (use_op == Op_AddI || use_op == Op_SubI) { 230.29 + for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { 230.30 + Node* u = use->fast_out(i2); 230.31 + if (u->is_Cmp() && (u->Opcode() == Op_CmpU)) { 230.32 + _worklist.push(u); 230.33 + } 230.34 + } 230.35 + } 230.36 // If changed AddP inputs, check Stores for loop invariant 230.37 if( use_op == Op_AddP ) { 230.38 for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
231.1 --- a/src/share/vm/opto/regmask.cpp Wed May 28 12:07:21 2014 -0700 231.2 +++ b/src/share/vm/opto/regmask.cpp Thu May 29 09:56:06 2014 -0700 231.3 @@ -1,5 +1,5 @@ 231.4 /* 231.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 231.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 231.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 231.8 * 231.9 * This code is free software; you can redistribute it and/or modify it 231.10 @@ -116,7 +116,7 @@ 231.11 case Special: st->print("r---"); break; 231.12 case Bad: st->print("rBAD"); break; 231.13 default: 231.14 - if (r < _last_Mach_Reg) st->print(Matcher::regName[r]); 231.15 + if (r < _last_Mach_Reg) st->print("%s", Matcher::regName[r]); 231.16 else st->print("rS%d",r); 231.17 break; 231.18 }
232.1 --- a/src/share/vm/opto/runtime.cpp Wed May 28 12:07:21 2014 -0700 232.2 +++ b/src/share/vm/opto/runtime.cpp Thu May 29 09:56:06 2014 -0700 232.3 @@ -1395,7 +1395,7 @@ 232.4 } else { 232.5 tty->print("<unknown>"); 232.6 } 232.7 - tty->print(" at " INTPTR_FORMAT, exception_pc); 232.8 + tty->print(" at " INTPTR_FORMAT, p2i(exception_pc)); 232.9 tty->print_cr("]"); 232.10 } 232.11
233.1 --- a/src/share/vm/opto/subnode.cpp Wed May 28 12:07:21 2014 -0700 233.2 +++ b/src/share/vm/opto/subnode.cpp Thu May 29 09:56:06 2014 -0700 233.3 @@ -1,5 +1,5 @@ 233.4 /* 233.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 233.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 233.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 233.8 * 233.9 * This code is free software; you can redistribute it and/or modify it 233.10 @@ -80,7 +80,7 @@ 233.11 233.12 //------------------------------Value------------------------------------------ 233.13 // A subtract node differences it's two inputs. 233.14 -const Type *SubNode::Value( PhaseTransform *phase ) const { 233.15 +const Type* SubNode::Value_common(PhaseTransform *phase) const { 233.16 const Node* in1 = in(1); 233.17 const Node* in2 = in(2); 233.18 // Either input is TOP ==> the result is TOP 233.19 @@ -97,6 +97,16 @@ 233.20 if( t1 == Type::BOTTOM || t2 == Type::BOTTOM ) 233.21 return bottom_type(); 233.22 233.23 + return NULL; 233.24 +} 233.25 + 233.26 +const Type* SubNode::Value(PhaseTransform *phase) const { 233.27 + const Type* t = Value_common(phase); 233.28 + if (t != NULL) { 233.29 + return t; 233.30 + } 233.31 + const Type* t1 = phase->type(in(1)); 233.32 + const Type* t2 = phase->type(in(2)); 233.33 return sub(t1,t2); // Local flavor of type subtraction 233.34 233.35 } 233.36 @@ -570,6 +580,81 @@ 233.37 return TypeInt::CC; // else use worst case results 233.38 } 233.39 233.40 +const Type* CmpUNode::Value(PhaseTransform *phase) const { 233.41 + const Type* t = SubNode::Value_common(phase); 233.42 + if (t != NULL) { 233.43 + return t; 233.44 + } 233.45 + const Node* in1 = in(1); 233.46 + const Node* in2 = in(2); 233.47 + const Type* t1 = phase->type(in1); 233.48 + const Type* t2 = phase->type(in2); 233.49 + assert(t1->isa_int(), "CmpU has only Int type inputs"); 233.50 + if (t2 == TypeInt::INT) { // Compare to bottom? 233.51 + return bottom_type(); 233.52 + } 233.53 + uint in1_op = in1->Opcode(); 233.54 + if (in1_op == Op_AddI || in1_op == Op_SubI) { 233.55 + // The problem rise when result of AddI(SubI) may overflow 233.56 + // signed integer value. Let say the input type is 233.57 + // [256, maxint] then +128 will create 2 ranges due to 233.58 + // overflow: [minint, minint+127] and [384, maxint]. 233.59 + // But C2 type system keep only 1 type range and as result 233.60 + // it use general [minint, maxint] for this case which we 233.61 + // can't optimize. 233.62 + // 233.63 + // Make 2 separate type ranges based on types of AddI(SubI) inputs 233.64 + // and compare results of their compare. If results are the same 233.65 + // CmpU node can be optimized. 233.66 + const Node* in11 = in1->in(1); 233.67 + const Node* in12 = in1->in(2); 233.68 + const Type* t11 = (in11 == in1) ? Type::TOP : phase->type(in11); 233.69 + const Type* t12 = (in12 == in1) ? Type::TOP : phase->type(in12); 233.70 + // Skip cases when input types are top or bottom. 233.71 + if ((t11 != Type::TOP) && (t11 != TypeInt::INT) && 233.72 + (t12 != Type::TOP) && (t12 != TypeInt::INT)) { 233.73 + const TypeInt *r0 = t11->is_int(); 233.74 + const TypeInt *r1 = t12->is_int(); 233.75 + jlong lo_r0 = r0->_lo; 233.76 + jlong hi_r0 = r0->_hi; 233.77 + jlong lo_r1 = r1->_lo; 233.78 + jlong hi_r1 = r1->_hi; 233.79 + if (in1_op == Op_SubI) { 233.80 + jlong tmp = hi_r1; 233.81 + hi_r1 = -lo_r1; 233.82 + lo_r1 = -tmp; 233.83 + // Note, for substructing [minint,x] type range 233.84 + // long arithmetic provides correct overflow answer. 233.85 + // The confusion come from the fact that in 32-bit 233.86 + // -minint == minint but in 64-bit -minint == maxint+1. 233.87 + } 233.88 + jlong lo_long = lo_r0 + lo_r1; 233.89 + jlong hi_long = hi_r0 + hi_r1; 233.90 + int lo_tr1 = min_jint; 233.91 + int hi_tr1 = (int)hi_long; 233.92 + int lo_tr2 = (int)lo_long; 233.93 + int hi_tr2 = max_jint; 233.94 + bool underflow = lo_long != (jlong)lo_tr2; 233.95 + bool overflow = hi_long != (jlong)hi_tr1; 233.96 + // Use sub(t1, t2) when there is no overflow (one type range) 233.97 + // or when both overflow and underflow (too complex). 233.98 + if ((underflow != overflow) && (hi_tr1 < lo_tr2)) { 233.99 + // Overflow only on one boundary, compare 2 separate type ranges. 233.100 + int w = MAX2(r0->_widen, r1->_widen); // _widen does not matter here 233.101 + const TypeInt* tr1 = TypeInt::make(lo_tr1, hi_tr1, w); 233.102 + const TypeInt* tr2 = TypeInt::make(lo_tr2, hi_tr2, w); 233.103 + const Type* cmp1 = sub(tr1, t2); 233.104 + const Type* cmp2 = sub(tr2, t2); 233.105 + if (cmp1 == cmp2) { 233.106 + return cmp1; // Hit! 233.107 + } 233.108 + } 233.109 + } 233.110 + } 233.111 + 233.112 + return sub(t1, t2); // Local flavor of type subtraction 233.113 +} 233.114 + 233.115 bool CmpUNode::is_index_range_check() const { 233.116 // Check for the "(X ModI Y) CmpU Y" shape 233.117 return (in(1)->Opcode() == Op_ModI && 233.118 @@ -1065,7 +1150,7 @@ 233.119 #ifndef PRODUCT 233.120 void BoolTest::dump_on(outputStream *st) const { 233.121 const char *msg[] = {"eq","gt","of","lt","ne","le","nof","ge"}; 233.122 - st->print(msg[_test]); 233.123 + st->print("%s", msg[_test]); 233.124 } 233.125 #endif 233.126
234.1 --- a/src/share/vm/opto/subnode.hpp Wed May 28 12:07:21 2014 -0700 234.2 +++ b/src/share/vm/opto/subnode.hpp Thu May 29 09:56:06 2014 -0700 234.3 @@ -50,6 +50,7 @@ 234.4 // Compute a new Type for this node. Basically we just do the pre-check, 234.5 // then call the virtual add() to set the type. 234.6 virtual const Type *Value( PhaseTransform *phase ) const; 234.7 + const Type* Value_common( PhaseTransform *phase ) const; 234.8 234.9 // Supplied function returns the subtractend of the inputs. 234.10 // This also type-checks the inputs for sanity. Guaranteed never to 234.11 @@ -158,6 +159,7 @@ 234.12 CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} 234.13 virtual int Opcode() const; 234.14 virtual const Type *sub( const Type *, const Type * ) const; 234.15 + const Type *Value( PhaseTransform *phase ) const; 234.16 bool is_index_range_check() const; 234.17 }; 234.18
235.1 --- a/src/share/vm/opto/type.cpp Wed May 28 12:07:21 2014 -0700 235.2 +++ b/src/share/vm/opto/type.cpp Thu May 29 09:56:06 2014 -0700 235.3 @@ -1,5 +1,5 @@ 235.4 /* 235.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 235.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 235.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 235.8 * 235.9 * This code is free software; you can redistribute it and/or modify it 235.10 @@ -41,6 +41,8 @@ 235.11 #include "opto/opcodes.hpp" 235.12 #include "opto/type.hpp" 235.13 235.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 235.15 + 235.16 // Portions of code courtesy of Clifford Click 235.17 235.18 // Optimization - Graph Style 235.19 @@ -842,7 +844,7 @@ 235.20 #ifndef PRODUCT 235.21 //------------------------------dump2------------------------------------------ 235.22 void Type::dump2( Dict &d, uint depth, outputStream *st ) const { 235.23 - st->print(_type_info[_base].msg); 235.24 + st->print("%s", _type_info[_base].msg); 235.25 } 235.26 235.27 //------------------------------dump-------------------------------------------
236.1 --- a/src/share/vm/prims/jni.cpp Wed May 28 12:07:21 2014 -0700 236.2 +++ b/src/share/vm/prims/jni.cpp Thu May 29 09:56:06 2014 -0700 236.3 @@ -1,5 +1,5 @@ 236.4 /* 236.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 236.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 236.7 * Copyright (c) 2012 Red Hat, Inc. 236.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 236.9 * 236.10 @@ -308,7 +308,7 @@ 236.11 236.12 class JNITraceWrapper : public StackObj { 236.13 public: 236.14 - JNITraceWrapper(const char* format, ...) { 236.15 + JNITraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) { 236.16 if (TraceJNICalls) { 236.17 va_list ap; 236.18 va_start(ap, format);
237.1 --- a/src/share/vm/prims/jniCheck.cpp Wed May 28 12:07:21 2014 -0700 237.2 +++ b/src/share/vm/prims/jniCheck.cpp Thu May 29 09:56:06 2014 -0700 237.3 @@ -1,5 +1,5 @@ 237.4 /* 237.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 237.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 237.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 237.8 * 237.9 * This code is free software; you can redistribute it and/or modify it 237.10 @@ -100,7 +100,7 @@ 237.11 result_type JNICALL header { \ 237.12 JavaThread* thr = (JavaThread*)ThreadLocalStorage::get_thread_slow();\ 237.13 if (thr == NULL || !thr->is_Java_thread()) { \ 237.14 - tty->print_cr(fatal_using_jnienv_in_nonjava); \ 237.15 + tty->print_cr("%s", fatal_using_jnienv_in_nonjava); \ 237.16 os::abort(true); \ 237.17 } \ 237.18 JNIEnv* xenv = thr->jni_environment(); \ 237.19 @@ -184,7 +184,7 @@ 237.20 functionEnter(JavaThread* thr) 237.21 { 237.22 if (thr->in_critical()) { 237.23 - tty->print_cr(warn_other_function_in_critical); 237.24 + tty->print_cr("%s", warn_other_function_in_critical); 237.25 } 237.26 if (thr->has_pending_exception()) { 237.27 NativeReportJNIWarning(thr, "JNI call made with exception pending"); 237.28 @@ -195,7 +195,7 @@ 237.29 functionEnterExceptionAllowed(JavaThread* thr) 237.30 { 237.31 if (thr->in_critical()) { 237.32 - tty->print_cr(warn_other_function_in_critical); 237.33 + tty->print_cr("%s", warn_other_function_in_critical); 237.34 } 237.35 } 237.36
238.1 --- a/src/share/vm/prims/jvm.cpp Wed May 28 12:07:21 2014 -0700 238.2 +++ b/src/share/vm/prims/jvm.cpp Thu May 29 09:56:06 2014 -0700 238.3 @@ -220,7 +220,7 @@ 238.4 #ifdef ASSERT 238.5 class JVMTraceWrapper : public StackObj { 238.6 public: 238.7 - JVMTraceWrapper(const char* format, ...) { 238.8 + JVMTraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) { 238.9 if (TraceJVMCalls) { 238.10 va_list ap; 238.11 va_start(ap, format); 238.12 @@ -2716,14 +2716,14 @@ 238.13 238.14 238.15 JVM_LEAF(jlong, JVM_Lseek(jint fd, jlong offset, jint whence)) 238.16 - JVMWrapper4("JVM_Lseek (0x%x, %Ld, %d)", fd, offset, whence); 238.17 + JVMWrapper4("JVM_Lseek (0x%x, " INT64_FORMAT ", %d)", fd, (int64_t) offset, whence); 238.18 //%note jvm_r6 238.19 return os::lseek(fd, offset, whence); 238.20 JVM_END 238.21 238.22 238.23 JVM_LEAF(jint, JVM_SetLength(jint fd, jlong length)) 238.24 - JVMWrapper3("JVM_SetLength (0x%x, %Ld)", fd, length); 238.25 + JVMWrapper3("JVM_SetLength (0x%x, " INT64_FORMAT ")", fd, (int64_t) length); 238.26 return os::ftruncate(fd, length); 238.27 JVM_END 238.28 238.29 @@ -2738,13 +2738,14 @@ 238.30 // Printing support ////////////////////////////////////////////////// 238.31 extern "C" { 238.32 238.33 +ATTRIBUTE_PRINTF(3, 0) 238.34 int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) { 238.35 // see bug 4399518, 4417214 238.36 if ((intptr_t)count <= 0) return -1; 238.37 return vsnprintf(str, count, fmt, args); 238.38 } 238.39 238.40 - 238.41 +ATTRIBUTE_PRINTF(3, 0) 238.42 int jio_snprintf(char *str, size_t count, const char *fmt, ...) { 238.43 va_list args; 238.44 int len; 238.45 @@ -2754,7 +2755,7 @@ 238.46 return len; 238.47 } 238.48 238.49 - 238.50 +ATTRIBUTE_PRINTF(2,3) 238.51 int jio_fprintf(FILE* f, const char *fmt, ...) { 238.52 int len; 238.53 va_list args; 238.54 @@ -2764,7 +2765,7 @@ 238.55 return len; 238.56 } 238.57 238.58 - 238.59 +ATTRIBUTE_PRINTF(2, 0) 238.60 int jio_vfprintf(FILE* f, const char *fmt, va_list args) { 238.61 if (Arguments::vfprintf_hook() != NULL) { 238.62 return Arguments::vfprintf_hook()(f, fmt, args); 238.63 @@ -2773,7 +2774,7 @@ 238.64 } 238.65 } 238.66 238.67 - 238.68 +ATTRIBUTE_PRINTF(1, 2) 238.69 JNIEXPORT int jio_printf(const char *fmt, ...) { 238.70 int len; 238.71 va_list args; 238.72 @@ -2910,7 +2911,7 @@ 238.73 JavaThread* receiver = java_lang_Thread::thread(java_thread); 238.74 Events::log_exception(JavaThread::current(), 238.75 "JVM_StopThread thread JavaThread " INTPTR_FORMAT " as oop " INTPTR_FORMAT " [exception " INTPTR_FORMAT "]", 238.76 - receiver, (address)java_thread, throwable); 238.77 + p2i(receiver), p2i((address)java_thread), p2i(throwable)); 238.78 // First check if thread is alive 238.79 if (receiver != NULL) { 238.80 // Check if exception is getting thrown at self (use oop equality, since the
239.1 --- a/src/share/vm/prims/jvmtiEnter.xsl Wed May 28 12:07:21 2014 -0700 239.2 +++ b/src/share/vm/prims/jvmtiEnter.xsl Thu May 29 09:56:06 2014 -0700 239.3 @@ -1,6 +1,6 @@ 239.4 <?xml version="1.0"?> 239.5 <!-- 239.6 - Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 239.7 + Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 239.8 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 239.9 239.10 This code is free software; you can redistribute it and/or modify it 239.11 @@ -43,6 +43,9 @@ 239.12 # include "prims/jvmtiRawMonitor.hpp" 239.13 # include "prims/jvmtiUtil.hpp" 239.14 239.15 +// There are known-bad format/arg pairings in the code generated by this file. 239.16 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 239.17 + 239.18 </xsl:text> 239.19 239.20 <xsl:if test="$trace = 'Trace'">
240.1 --- a/src/share/vm/prims/jvmtiEnvThreadState.cpp Wed May 28 12:07:21 2014 -0700 240.2 +++ b/src/share/vm/prims/jvmtiEnvThreadState.cpp Thu May 29 09:56:06 2014 -0700 240.3 @@ -113,7 +113,7 @@ 240.4 JvmtiFramePop fp = JvmtiFramePop(_pops->at(i)); 240.5 tty->print("%d: ", i); 240.6 fp.print(); 240.7 - tty->print_cr(""); 240.8 + tty->cr(); 240.9 } 240.10 } 240.11 #endif
241.1 --- a/src/share/vm/prims/jvmtiEventController.cpp Wed May 28 12:07:21 2014 -0700 241.2 +++ b/src/share/vm/prims/jvmtiEventController.cpp Thu May 29 09:56:06 2014 -0700 241.3 @@ -1,5 +1,5 @@ 241.4 /* 241.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 241.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 241.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 241.8 * 241.9 * This code is free software; you can redistribute it and/or modify it 241.10 @@ -38,6 +38,8 @@ 241.11 #include "runtime/vmThread.hpp" 241.12 #include "runtime/vm_operations.hpp" 241.13 241.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 241.15 + 241.16 #ifdef JVMTI_TRACE 241.17 #define EC_TRACE(out) do { \ 241.18 if (JvmtiTrace::trace_event_controller()) { \
242.1 --- a/src/share/vm/prims/jvmtiExport.cpp Wed May 28 12:07:21 2014 -0700 242.2 +++ b/src/share/vm/prims/jvmtiExport.cpp Thu May 29 09:56:06 2014 -0700 242.3 @@ -1,5 +1,5 @@ 242.4 /* 242.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 242.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 242.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 242.8 * 242.9 * This code is free software; you can redistribute it and/or modify it 242.10 @@ -56,6 +56,8 @@ 242.11 #include "gc_implementation/parallelScavenge/psMarkSweep.hpp" 242.12 #endif // INCLUDE_ALL_GCS 242.13 242.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 242.15 + 242.16 #ifdef JVMTI_TRACE 242.17 #define EVT_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_SENT) != 0) { SafeResourceMark rm; tty->print_cr out; } 242.18 #define EVT_TRIG_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_TRIGGER) != 0) { SafeResourceMark rm; tty->print_cr out; }
243.1 --- a/src/share/vm/prims/jvmtiImpl.cpp Wed May 28 12:07:21 2014 -0700 243.2 +++ b/src/share/vm/prims/jvmtiImpl.cpp Thu May 29 09:56:06 2014 -0700 243.3 @@ -1,5 +1,5 @@ 243.4 /* 243.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 243.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 243.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 243.8 * 243.9 * This code is free software; you can redistribute it and/or modify it 243.10 @@ -413,7 +413,7 @@ 243.11 JvmtiBreakpoint& bp = _bps.at(i); 243.12 tty->print("%d: ", i); 243.13 bp.print(); 243.14 - tty->print_cr(""); 243.15 + tty->cr(); 243.16 } 243.17 #endif 243.18 }
244.1 --- a/src/share/vm/prims/jvmtiRedefineClasses.cpp Wed May 28 12:07:21 2014 -0700 244.2 +++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp Thu May 29 09:56:06 2014 -0700 244.3 @@ -1,5 +1,5 @@ 244.4 /* 244.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 244.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 244.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 244.8 * 244.9 * This code is free software; you can redistribute it and/or modify it 244.10 @@ -43,6 +43,7 @@ 244.11 #include "runtime/relocator.hpp" 244.12 #include "utilities/bitMap.inline.hpp" 244.13 244.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 244.15 244.16 Array<Method*>* VM_RedefineClasses::_old_methods = NULL; 244.17 Array<Method*>* VM_RedefineClasses::_new_methods = NULL; 244.18 @@ -1904,6 +1905,8 @@ 244.19 // annotations_typeArray if needed. Returns the original constant 244.20 // pool reference if a rewrite was not needed or the new constant 244.21 // pool reference if a rewrite was needed. 244.22 +PRAGMA_DIAG_PUSH 244.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED 244.24 u2 VM_RedefineClasses::rewrite_cp_ref_in_annotation_data( 244.25 AnnotationArray* annotations_typeArray, int &byte_i_ref, 244.26 const char * trace_mesg, TRAPS) { 244.27 @@ -1920,6 +1923,7 @@ 244.28 byte_i_ref += 2; 244.29 return old_cp_index; 244.30 } 244.31 +PRAGMA_DIAG_POP 244.32 244.33 244.34 // Rewrite constant pool references in the element_value portion of an
245.1 --- a/src/share/vm/prims/methodHandles.cpp Wed May 28 12:07:21 2014 -0700 245.2 +++ b/src/share/vm/prims/methodHandles.cpp Thu May 29 09:56:06 2014 -0700 245.3 @@ -1,5 +1,5 @@ 245.4 /* 245.5 - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. 245.6 + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. 245.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 245.8 * 245.9 * This code is free software; you can redistribute it and/or modify it 245.10 @@ -536,7 +536,7 @@ 245.11 // unknown letter, or we don't want to know its name 245.12 st->put(ch); 245.13 } else { 245.14 - st->print(n); 245.15 + st->print("%s", n); 245.16 prev_type = true; 245.17 } 245.18 break;
246.1 --- a/src/share/vm/prims/privilegedStack.cpp Wed May 28 12:07:21 2014 -0700 246.2 +++ b/src/share/vm/prims/privilegedStack.cpp Thu May 29 09:56:06 2014 -0700 246.3 @@ -1,5 +1,5 @@ 246.4 /* 246.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 246.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 246.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 246.8 * 246.9 * This code is free software; you can redistribute it and/or modify it 246.10 @@ -30,6 +30,7 @@ 246.11 #include "prims/privilegedStack.hpp" 246.12 #include "runtime/vframe.hpp" 246.13 246.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 246.15 246.16 void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) { 246.17 Method* method = vfst->method();
247.1 --- a/src/share/vm/prims/unsafe.cpp Wed May 28 12:07:21 2014 -0700 247.2 +++ b/src/share/vm/prims/unsafe.cpp Thu May 29 09:56:06 2014 -0700 247.3 @@ -1,5 +1,5 @@ 247.4 /* 247.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 247.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 247.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 247.8 * 247.9 * This code is free software; you can redistribute it and/or modify it 247.10 @@ -40,6 +40,8 @@ 247.11 #include "utilities/copy.hpp" 247.12 #include "utilities/dtrace.hpp" 247.13 247.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 247.15 + 247.16 /* 247.17 * Implementation of class sun.misc.Unsafe 247.18 */
248.1 --- a/src/share/vm/prims/whitebox.cpp Wed May 28 12:07:21 2014 -0700 248.2 +++ b/src/share/vm/prims/whitebox.cpp Thu May 29 09:56:06 2014 -0700 248.3 @@ -53,6 +53,8 @@ 248.4 #include "compiler/compileBroker.hpp" 248.5 #include "runtime/compilationPolicy.hpp" 248.6 248.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 248.8 + 248.9 #define SIZE_T_MAX_VALUE ((size_t) -1) 248.10 248.11 bool WhiteBox::_used = false;
249.1 --- a/src/share/vm/runtime/arguments.cpp Wed May 28 12:07:21 2014 -0700 249.2 +++ b/src/share/vm/runtime/arguments.cpp Thu May 29 09:56:06 2014 -0700 249.3 @@ -1,5 +1,5 @@ 249.4 /* 249.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 249.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 249.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 249.8 * 249.9 * This code is free software; you can redistribute it and/or modify it 249.10 @@ -840,7 +840,7 @@ 249.11 for (int i=0; i < _num_jvm_flags; i++) { 249.12 st->print("%s ", _jvm_flags_array[i]); 249.13 } 249.14 - st->print_cr(""); 249.15 + st->cr(); 249.16 } 249.17 } 249.18 249.19 @@ -849,7 +849,7 @@ 249.20 for (int i=0; i < _num_jvm_args; i++) { 249.21 st->print("%s ", _jvm_args_array[i]); 249.22 } 249.23 - st->print_cr(""); 249.24 + st->cr(); 249.25 } 249.26 } 249.27 249.28 @@ -1341,8 +1341,8 @@ 249.29 } 249.30 if (PrintGCDetails && Verbose) { 249.31 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 249.32 - MarkStackSize / K, MarkStackSizeMax / K); 249.33 - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 249.34 + (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); 249.35 + tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads); 249.36 } 249.37 } 249.38 #endif // INCLUDE_ALL_GCS 249.39 @@ -1422,7 +1422,7 @@ 249.40 if (PrintGCDetails) { 249.41 // Cannot use gclog_or_tty yet. 249.42 tty->print_cr("Automatic selection of the low pause collector" 249.43 - " based on pause goal of %d (ms)", MaxGCPauseMillis); 249.44 + " based on pause goal of %d (ms)", (int) MaxGCPauseMillis); 249.45 } 249.46 return true; 249.47 } 249.48 @@ -1639,8 +1639,8 @@ 249.49 249.50 if (PrintGCDetails && Verbose) { 249.51 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 249.52 - MarkStackSize / K, MarkStackSizeMax / K); 249.53 - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 249.54 + (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); 249.55 + tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads); 249.56 } 249.57 } 249.58 249.59 @@ -1703,7 +1703,7 @@ 249.60 249.61 if (PrintGCDetails && Verbose) { 249.62 // Cannot use gclog_or_tty yet. 249.63 - tty->print_cr(" Maximum heap size " SIZE_FORMAT, reasonable_max); 249.64 + tty->print_cr(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max); 249.65 } 249.66 FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max); 249.67 } 249.68 @@ -2090,7 +2090,7 @@ 249.69 // Using "else if" below to avoid printing two error messages if min > max. 249.70 // This will also prevent us from reporting both min>100 and max>100 at the 249.71 // same time, but that is less annoying than printing two identical errors IMHO. 249.72 - FormatBuffer<80> err_msg(""); 249.73 + FormatBuffer<80> err_msg("%s",""); 249.74 if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) { 249.75 jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer()); 249.76 status = false;
250.1 --- a/src/share/vm/runtime/arguments.hpp Wed May 28 12:07:21 2014 -0700 250.2 +++ b/src/share/vm/runtime/arguments.hpp Thu May 29 09:56:06 2014 -0700 250.3 @@ -1,5 +1,5 @@ 250.4 /* 250.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 250.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 250.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 250.8 * 250.9 * This code is free software; you can redistribute it and/or modify it 250.10 @@ -36,7 +36,7 @@ 250.11 extern "C" { 250.12 typedef void (JNICALL *abort_hook_t)(void); 250.13 typedef void (JNICALL *exit_hook_t)(jint code); 250.14 - typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args); 250.15 + typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0); 250.16 } 250.17 250.18 // Forward declarations
251.1 --- a/src/share/vm/runtime/biasedLocking.cpp Wed May 28 12:07:21 2014 -0700 251.2 +++ b/src/share/vm/runtime/biasedLocking.cpp Thu May 29 09:56:06 2014 -0700 251.3 @@ -1,5 +1,5 @@ 251.4 /* 251.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 251.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 251.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 251.8 * 251.9 * This code is free software; you can redistribute it and/or modify it 251.10 @@ -161,7 +161,7 @@ 251.11 if (TraceBiasedLocking && (Verbose || !is_bulk)) { 251.12 ResourceMark rm; 251.13 tty->print_cr("Revoking bias of object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s , prototype header " INTPTR_FORMAT " , allow rebias %d , requesting thread " INTPTR_FORMAT, 251.14 - (void *)obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread); 251.15 + p2i((void *)obj), (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread); 251.16 } 251.17 251.18 JavaThread* biased_thread = mark->biased_locker(); 251.19 @@ -214,8 +214,8 @@ 251.20 if (mon_info->owner() == obj) { 251.21 if (TraceBiasedLocking && Verbose) { 251.22 tty->print_cr(" mon_info->owner (" PTR_FORMAT ") == obj (" PTR_FORMAT ")", 251.23 - (void *) mon_info->owner(), 251.24 - (void *) obj); 251.25 + p2i((void *) mon_info->owner()), 251.26 + p2i((void *) obj)); 251.27 } 251.28 // Assume recursive case and fix up highest lock later 251.29 markOop mark = markOopDesc::encode((BasicLock*) NULL); 251.30 @@ -224,8 +224,8 @@ 251.31 } else { 251.32 if (TraceBiasedLocking && Verbose) { 251.33 tty->print_cr(" mon_info->owner (" PTR_FORMAT ") != obj (" PTR_FORMAT ")", 251.34 - (void *) mon_info->owner(), 251.35 - (void *) obj); 251.36 + p2i((void *) mon_info->owner()), 251.37 + p2i((void *) obj)); 251.38 } 251.39 } 251.40 } 251.41 @@ -328,7 +328,7 @@ 251.42 tty->print_cr("* Beginning bulk revocation (kind == %s) because of object " 251.43 INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", 251.44 (bulk_rebias ? "rebias" : "revoke"), 251.45 - (void *) o, (intptr_t) o->mark(), o->klass()->external_name()); 251.46 + p2i((void *) o), (intptr_t) o->mark(), o->klass()->external_name()); 251.47 } 251.48 251.49 jlong cur_time = os::javaTimeMillis();
252.1 --- a/src/share/vm/runtime/compilationPolicy.cpp Wed May 28 12:07:21 2014 -0700 252.2 +++ b/src/share/vm/runtime/compilationPolicy.cpp Thu May 29 09:56:06 2014 -0700 252.3 @@ -1,5 +1,5 @@ 252.4 /* 252.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 252.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 252.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 252.8 * 252.9 * This code is free software; you can redistribute it and/or modify it 252.10 @@ -170,7 +170,7 @@ 252.11 void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) { 252.12 if (TraceOnStackReplacement) { 252.13 if (osr_nm == NULL) tty->print_cr("compilation failed"); 252.14 - else tty->print_cr("nmethod " INTPTR_FORMAT, osr_nm); 252.15 + else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm)); 252.16 } 252.17 } 252.18 #endif // !PRODUCT 252.19 @@ -417,6 +417,7 @@ 252.20 } 252.21 252.22 #ifndef PRODUCT 252.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 252.24 void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci) { 252.25 if (TraceInvocationCounterOverflow) { 252.26 MethodCounters* mcs = m->method_counters(); 252.27 @@ -428,7 +429,10 @@ 252.28 bci == InvocationEntryBci 252.29 ? "comp-policy cntr ovfl @ %d in entry of " 252.30 : "comp-policy cntr ovfl @ %d in loop of "; 252.31 +PRAGMA_DIAG_PUSH 252.32 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 252.33 tty->print(msg, bci); 252.34 +PRAGMA_DIAG_POP 252.35 m->print_value(); 252.36 tty->cr(); 252.37 ic->print(); 252.38 @@ -503,7 +507,7 @@ 252.39 if (TraceCompilationPolicy) { 252.40 tty->print("method invocation trigger: "); 252.41 m->print_short_name(tty); 252.42 - tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)m(), m->code_size()); 252.43 + tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)m()), m->code_size()); 252.44 } 252.45 RegisterMap reg_map(thread, false); 252.46 javaVFrame* triggerVF = thread->last_java_vframe(®_map); 252.47 @@ -512,7 +516,7 @@ 252.48 252.49 if (first->top_method()->code() != NULL) { 252.50 // called obsolete method/nmethod -- no need to recompile 252.51 - if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, first->top_method()->code()); 252.52 + if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, p2i(first->top_method()->code())); 252.53 } else { 252.54 if (TimeCompilationPolicy) accumulated_time()->start(); 252.55 GrowableArray<RFrame*>* stack = new GrowableArray<RFrame*>(50); 252.56 @@ -640,7 +644,7 @@ 252.57 if (TraceCompilationPolicy && Verbose) { 252.58 tty->print("\n\t check caller: "); 252.59 next_m->print_short_name(tty); 252.60 - tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)next_m(), next_m->code_size()); 252.61 + tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m()), next_m->code_size()); 252.62 } 252.63 252.64 current = next;
253.1 --- a/src/share/vm/runtime/deoptimization.cpp Wed May 28 12:07:21 2014 -0700 253.2 +++ b/src/share/vm/runtime/deoptimization.cpp Thu May 29 09:56:06 2014 -0700 253.3 @@ -1,5 +1,5 @@ 253.4 /* 253.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 253.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 253.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 253.8 * 253.9 * This code is free software; you can redistribute it and/or modify it 253.10 @@ -89,6 +89,8 @@ 253.11 #endif 253.12 #endif // COMPILER2 253.13 253.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 253.15 + 253.16 bool DeoptimizationMarker::_is_active = false; 253.17 253.18 Deoptimization::UnrollBlock::UnrollBlock(int size_of_deoptimized_frame,
254.1 --- a/src/share/vm/runtime/fprofiler.cpp Wed May 28 12:07:21 2014 -0700 254.2 +++ b/src/share/vm/runtime/fprofiler.cpp Thu May 29 09:56:06 2014 -0700 254.3 @@ -1,5 +1,5 @@ 254.4 /* 254.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 254.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 254.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 254.8 * 254.9 * This code is free software; you can redistribute it and/or modify it 254.10 @@ -41,6 +41,8 @@ 254.11 #include "runtime/vframe.hpp" 254.12 #include "utilities/macros.hpp" 254.13 254.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 254.15 + 254.16 // Static fields of FlatProfiler 254.17 int FlatProfiler::received_gc_ticks = 0; 254.18 int FlatProfiler::vm_operation_ticks = 0; 254.19 @@ -308,7 +310,7 @@ 254.20 st->fill_to(col2); 254.21 t->print_native(st); 254.22 st->fill_to(col3); 254.23 - st->print(msg); 254.24 + st->print("%s", msg); 254.25 st->cr(); 254.26 } 254.27
255.1 --- a/src/share/vm/runtime/frame.cpp Wed May 28 12:07:21 2014 -0700 255.2 +++ b/src/share/vm/runtime/frame.cpp Thu May 29 09:56:06 2014 -0700 255.3 @@ -1,5 +1,5 @@ 255.4 /* 255.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 255.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 255.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 255.8 * 255.9 * This code is free software; you can redistribute it and/or modify it 255.10 @@ -62,6 +62,8 @@ 255.11 # include "nativeInst_ppc.hpp" 255.12 #endif 255.13 255.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 255.15 + 255.16 RegisterMap::RegisterMap(JavaThread *thread, bool update_map) { 255.17 _thread = thread; 255.18 _update_map = update_map;
256.1 --- a/src/share/vm/runtime/globals.cpp Wed May 28 12:07:21 2014 -0700 256.2 +++ b/src/share/vm/runtime/globals.cpp Thu May 29 09:56:06 2014 -0700 256.3 @@ -1,5 +1,5 @@ 256.4 /* 256.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 256.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 256.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 256.8 * 256.9 * This code is free software; you can redistribute it and/or modify it 256.10 @@ -45,6 +45,8 @@ 256.11 #include "shark/shark_globals.hpp" 256.12 #endif 256.13 256.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 256.15 + 256.16 RUNTIME_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, \ 256.17 MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, \ 256.18 MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_EXPERIMENTAL_FLAG, \ 256.19 @@ -283,6 +285,7 @@ 256.20 // Length of format string (e.g. "%.1234s") for printing ccstr below 256.21 #define FORMAT_BUFFER_LEN 16 256.22 256.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 256.24 void Flag::print_on(outputStream* st, bool withComments) { 256.25 // Don't print notproduct and develop flags in a product build. 256.26 if (is_constant_in_binary()) { 256.27 @@ -315,7 +318,10 @@ 256.28 size_t llen = pointer_delta(eol, cp, sizeof(char)); 256.29 jio_snprintf(format_buffer, FORMAT_BUFFER_LEN, 256.30 "%%." SIZE_FORMAT "s", llen); 256.31 +PRAGMA_DIAG_PUSH 256.32 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 256.33 st->print(format_buffer, cp); 256.34 +PRAGMA_DIAG_POP 256.35 st->cr(); 256.36 cp = eol+1; 256.37 st->print("%5s %-35s += ", "", _name); 256.38 @@ -372,7 +378,7 @@ 256.39 } else { 256.40 st->print(" "); 256.41 } 256.42 - st->print(d.name); 256.43 + st->print("%s", d.name); 256.44 } 256.45 } 256.46
257.1 --- a/src/share/vm/runtime/globals.hpp Wed May 28 12:07:21 2014 -0700 257.2 +++ b/src/share/vm/runtime/globals.hpp Thu May 29 09:56:06 2014 -0700 257.3 @@ -523,13 +523,6 @@ 257.4 product_pd(bool, UseMembar, \ 257.5 "(Unstable) Issues membars on thread state transitions") \ 257.6 \ 257.7 - /* Temp PPC Flag to allow disabling the use of lwsync on ppc platforms \ 257.8 - * that don't support it. This will be replaced by processor detection \ 257.9 - * logic. \ 257.10 - */ \ 257.11 - product(bool, UsePPCLWSYNC, true, \ 257.12 - "Use lwsync instruction if true, else use slower sync") \ 257.13 - \ 257.14 develop(bool, CleanChunkPoolAsync, falseInEmbedded, \ 257.15 "Clean the chunk pool asynchronously") \ 257.16 \
258.1 --- a/src/share/vm/runtime/handles.cpp Wed May 28 12:07:21 2014 -0700 258.2 +++ b/src/share/vm/runtime/handles.cpp Thu May 29 09:56:06 2014 -0700 258.3 @@ -1,5 +1,5 @@ 258.4 /* 258.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 258.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 258.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 258.8 * 258.9 * This code is free software; you can redistribute it and/or modify it 258.10 @@ -41,6 +41,8 @@ 258.11 # include "os_bsd.inline.hpp" 258.12 #endif 258.13 258.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 258.15 + 258.16 #ifdef ASSERT 258.17 oop* HandleArea::allocate_handle(oop obj) { 258.18 assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark");
259.1 --- a/src/share/vm/runtime/interfaceSupport.cpp Wed May 28 12:07:21 2014 -0700 259.2 +++ b/src/share/vm/runtime/interfaceSupport.cpp Thu May 29 09:56:06 2014 -0700 259.3 @@ -1,5 +1,5 @@ 259.4 /* 259.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 259.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 259.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 259.8 * 259.9 * This code is free software; you can redistribute it and/or modify it 259.10 @@ -34,6 +34,7 @@ 259.11 #include "runtime/vframe.hpp" 259.12 #include "utilities/preserveException.hpp" 259.13 259.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 259.15 259.16 // Implementation of InterfaceSupport 259.17
260.1 --- a/src/share/vm/runtime/java.cpp Wed May 28 12:07:21 2014 -0700 260.2 +++ b/src/share/vm/runtime/java.cpp Thu May 29 09:56:06 2014 -0700 260.3 @@ -1,5 +1,5 @@ 260.4 /* 260.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 260.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 260.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 260.8 * 260.9 * This code is free software; you can redistribute it and/or modify it 260.10 @@ -113,6 +113,7 @@ 260.11 } 260.12 } 260.13 260.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 260.15 260.16 GrowableArray<Method*>* collected_profiled_methods; 260.17 260.18 @@ -367,7 +368,7 @@ 260.19 BaselineTTYOutputer outputer(tty); 260.20 MemTracker::print_memory_usage(outputer, K, false); 260.21 } else { 260.22 - tty->print_cr(MemTracker::reason()); 260.23 + tty->print_cr("%s", MemTracker::reason()); 260.24 } 260.25 } 260.26 } 260.27 @@ -404,7 +405,7 @@ 260.28 BaselineTTYOutputer outputer(tty); 260.29 MemTracker::print_memory_usage(outputer, K, false); 260.30 } else { 260.31 - tty->print_cr(MemTracker::reason()); 260.32 + tty->print_cr("%s", MemTracker::reason()); 260.33 } 260.34 } 260.35 }
261.1 --- a/src/share/vm/runtime/jniHandles.cpp Wed May 28 12:07:21 2014 -0700 261.2 +++ b/src/share/vm/runtime/jniHandles.cpp Thu May 29 09:56:06 2014 -0700 261.3 @@ -1,5 +1,5 @@ 261.4 /* 261.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 261.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 261.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 261.8 * 261.9 * This code is free software; you can redistribute it and/or modify it 261.10 @@ -30,6 +30,7 @@ 261.11 #include "runtime/mutexLocker.hpp" 261.12 #include "runtime/thread.inline.hpp" 261.13 261.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 261.15 261.16 JNIHandleBlock* JNIHandles::_global_handles = NULL; 261.17 JNIHandleBlock* JNIHandles::_weak_global_handles = NULL;
262.1 --- a/src/share/vm/runtime/mutex.cpp Wed May 28 12:07:21 2014 -0700 262.2 +++ b/src/share/vm/runtime/mutex.cpp Thu May 29 09:56:06 2014 -0700 262.3 @@ -1,6 +1,6 @@ 262.4 262.5 /* 262.6 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 262.7 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 262.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 262.9 * 262.10 * This code is free software; you can redistribute it and/or modify it 262.11 @@ -41,6 +41,8 @@ 262.12 # include "mutex_bsd.inline.hpp" 262.13 #endif 262.14 262.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 262.16 + 262.17 // o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o 262.18 // 262.19 // Native Monitor-Mutex locking - theory of operations
263.1 --- a/src/share/vm/runtime/os.cpp Wed May 28 12:07:21 2014 -0700 263.2 +++ b/src/share/vm/runtime/os.cpp Thu May 29 09:56:06 2014 -0700 263.3 @@ -1,5 +1,5 @@ 263.4 /* 263.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 263.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 263.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 263.8 * 263.9 * This code is free software; you can redistribute it and/or modify it 263.10 @@ -65,6 +65,8 @@ 263.11 263.12 # include <signal.h> 263.13 263.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 263.15 + 263.16 OSThread* os::_starting_thread = NULL; 263.17 address os::_polling_page = NULL; 263.18 volatile int32_t* os::_mem_serialize_page = NULL; 263.19 @@ -909,9 +911,9 @@ 263.20 263.21 for (int i = 0; env_list[i] != NULL; i++) { 263.22 if (getenv(env_list[i], buffer, len)) { 263.23 - st->print(env_list[i]); 263.24 + st->print("%s", env_list[i]); 263.25 st->print("="); 263.26 - st->print_cr(buffer); 263.27 + st->print_cr("%s", buffer); 263.28 } 263.29 } 263.30 } 263.31 @@ -1095,11 +1097,15 @@ 263.32 263.33 } 263.34 263.35 - // Check if in metaspace. 263.36 - if (ClassLoaderDataGraph::contains((address)addr)) { 263.37 - // Use addr->print() from the debugger instead (not here) 263.38 - st->print_cr(INTPTR_FORMAT 263.39 - " is pointing into metadata", addr); 263.40 + // Check if in metaspace and print types that have vptrs (only method now) 263.41 + if (Metaspace::contains(addr)) { 263.42 + if (Method::has_method_vptr((const void*)addr)) { 263.43 + ((Method*)addr)->print_value_on(st); 263.44 + st->cr(); 263.45 + } else { 263.46 + // Use addr->print() from the debugger instead (not here) 263.47 + st->print_cr(INTPTR_FORMAT " is pointing into metadata", addr); 263.48 + } 263.49 return; 263.50 } 263.51
264.1 --- a/src/share/vm/runtime/os.hpp Wed May 28 12:07:21 2014 -0700 264.2 +++ b/src/share/vm/runtime/os.hpp Thu May 29 09:56:06 2014 -0700 264.3 @@ -48,6 +48,9 @@ 264.4 #ifdef TARGET_OS_FAMILY_bsd 264.5 # include "jvm_bsd.h" 264.6 # include <setjmp.h> 264.7 +# ifdef __APPLE__ 264.8 +# include <mach/mach_time.h> 264.9 +# endif 264.10 #endif 264.11 264.12 class AgentLibrary;
265.1 --- a/src/share/vm/runtime/osThread.cpp Wed May 28 12:07:21 2014 -0700 265.2 +++ b/src/share/vm/runtime/osThread.cpp Thu May 29 09:56:06 2014 -0700 265.3 @@ -1,5 +1,5 @@ 265.4 /* 265.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 265.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 265.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 265.8 * 265.9 * This code is free software; you can redistribute it and/or modify it 265.10 @@ -26,6 +26,7 @@ 265.11 #include "oops/oop.inline.hpp" 265.12 #include "runtime/osThread.hpp" 265.13 265.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 265.15 265.16 OSThread::OSThread(OSThreadStartFunc start_proc, void* start_parm) { 265.17 pd_initialize();
266.1 --- a/src/share/vm/runtime/perfData.cpp Wed May 28 12:07:21 2014 -0700 266.2 +++ b/src/share/vm/runtime/perfData.cpp Thu May 29 09:56:06 2014 -0700 266.3 @@ -1,5 +1,5 @@ 266.4 /* 266.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 266.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 266.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 266.8 * 266.9 * This code is free software; you can redistribute it and/or modify it 266.10 @@ -34,6 +34,8 @@ 266.11 #include "utilities/exceptions.hpp" 266.12 #include "utilities/globalDefinitions.hpp" 266.13 266.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 266.15 + 266.16 PerfDataList* PerfDataManager::_all = NULL; 266.17 PerfDataList* PerfDataManager::_sampled = NULL; 266.18 PerfDataList* PerfDataManager::_constants = NULL;
267.1 --- a/src/share/vm/runtime/perfMemory.cpp Wed May 28 12:07:21 2014 -0700 267.2 +++ b/src/share/vm/runtime/perfMemory.cpp Thu May 29 09:56:06 2014 -0700 267.3 @@ -34,6 +34,8 @@ 267.4 #include "runtime/statSampler.hpp" 267.5 #include "utilities/globalDefinitions.hpp" 267.6 267.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 267.8 + 267.9 // Prefix of performance data file. 267.10 const char PERFDATA_NAME[] = "hsperfdata"; 267.11
268.1 --- a/src/share/vm/runtime/safepoint.cpp Wed May 28 12:07:21 2014 -0700 268.2 +++ b/src/share/vm/runtime/safepoint.cpp Thu May 29 09:56:06 2014 -0700 268.3 @@ -1,5 +1,5 @@ 268.4 /* 268.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 268.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 268.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 268.8 * 268.9 * This code is free software; you can redistribute it and/or modify it 268.10 @@ -81,6 +81,8 @@ 268.11 #include "c1/c1_globals.hpp" 268.12 #endif 268.13 268.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 268.15 + 268.16 // -------------------------------------------------------------------------------------------------- 268.17 // Implementation of Safepoint begin/end 268.18 268.19 @@ -538,6 +540,13 @@ 268.20 gclog_or_tty->rotate_log(false); 268.21 } 268.22 268.23 + { 268.24 + // CMS delays purging the CLDG until the beginning of the next safepoint and to 268.25 + // make sure concurrent sweep is done 268.26 + TraceTime t7("purging class loader data graph", TraceSafepointCleanupTime); 268.27 + ClassLoaderDataGraph::purge_if_needed(); 268.28 + } 268.29 + 268.30 if (MemTracker::is_on()) { 268.31 MemTracker::sync(); 268.32 } 268.33 @@ -786,7 +795,7 @@ 268.34 old_sp += incr*32; new_sp += incr*32; was_oops += incr*32; 268.35 for( int i2=0; i2<16; i2++ ) { 268.36 tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); } 268.37 - tty->print_cr(""); 268.38 + tty->cr(); 268.39 } 268.40 #endif // SPARC 268.41 #endif // PRODUCT 268.42 @@ -828,7 +837,7 @@ 268.43 timeout_error_printed = true; 268.44 // Print out the thread infor which didn't reach the safepoint for debugging 268.45 // purposes (useful when there are lots of threads in the debugger). 268.46 - tty->print_cr(""); 268.47 + tty->cr(); 268.48 tty->print_cr("# SafepointSynchronize::begin: Timeout detected:"); 268.49 if (reason == _spinning_timeout) { 268.50 tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint."); 268.51 @@ -848,7 +857,7 @@ 268.52 (reason == _blocking_timeout && !cur_state->has_called_back()))) { 268.53 tty->print("# "); 268.54 cur_thread->print(); 268.55 - tty->print_cr(""); 268.56 + tty->cr(); 268.57 } 268.58 } 268.59 tty->print_cr("# SafepointSynchronize::begin: (End of list)"); 268.60 @@ -1321,7 +1330,7 @@ 268.61 spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) { 268.62 print_statistics(); 268.63 } 268.64 - tty->print_cr(""); 268.65 + tty->cr(); 268.66 268.67 // Print out polling page sampling status. 268.68 if (!need_to_track_page_armed_status) {
269.1 --- a/src/share/vm/runtime/safepoint.hpp Wed May 28 12:07:21 2014 -0700 269.2 +++ b/src/share/vm/runtime/safepoint.hpp Thu May 29 09:56:06 2014 -0700 269.3 @@ -1,5 +1,5 @@ 269.4 /* 269.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 269.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 269.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 269.8 * 269.9 * This code is free software; you can redistribute it and/or modify it 269.10 @@ -174,7 +174,7 @@ 269.11 269.12 // debugging 269.13 static void print_state() PRODUCT_RETURN; 269.14 - static void safepoint_msg(const char* format, ...) PRODUCT_RETURN; 269.15 + static void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(1, 2) PRODUCT_RETURN; 269.16 269.17 static void deferred_initialize_stat(); 269.18 static void print_stat_on_exit(); 269.19 @@ -240,7 +240,7 @@ 269.20 static void create(JavaThread *thread); 269.21 static void destroy(JavaThread *thread); 269.22 269.23 - void safepoint_msg(const char* format, ...) { 269.24 + void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) { 269.25 if (ShowSafepointMsgs) { 269.26 va_list ap; 269.27 va_start(ap, format);
270.1 --- a/src/share/vm/runtime/sharedRuntime.cpp Wed May 28 12:07:21 2014 -0700 270.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp Thu May 29 09:56:06 2014 -0700 270.3 @@ -1,5 +1,5 @@ 270.4 /* 270.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 270.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 270.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 270.8 * 270.9 * This code is free software; you can redistribute it and/or modify it 270.10 @@ -82,6 +82,8 @@ 270.11 #include "c1/c1_Runtime1.hpp" 270.12 #endif 270.13 270.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 270.15 + 270.16 // Shared stub locations 270.17 RuntimeStub* SharedRuntime::_wrong_method_blob; 270.18 RuntimeStub* SharedRuntime::_wrong_method_abstract_blob;
271.1 --- a/src/share/vm/runtime/signature.cpp Wed May 28 12:07:21 2014 -0700 271.2 +++ b/src/share/vm/runtime/signature.cpp Thu May 29 09:56:06 2014 -0700 271.3 @@ -1,5 +1,5 @@ 271.4 /* 271.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 271.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 271.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 271.8 * 271.9 * This code is free software; you can redistribute it and/or modify it 271.10 @@ -32,6 +32,7 @@ 271.11 #include "oops/typeArrayKlass.hpp" 271.12 #include "runtime/signature.hpp" 271.13 271.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 271.15 271.16 // Implementation of SignatureIterator 271.17
272.1 --- a/src/share/vm/runtime/stackValue.cpp Wed May 28 12:07:21 2014 -0700 272.2 +++ b/src/share/vm/runtime/stackValue.cpp Thu May 29 09:56:06 2014 -0700 272.3 @@ -1,5 +1,5 @@ 272.4 /* 272.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 272.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 272.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 272.8 * 272.9 * This code is free software; you can redistribute it and/or modify it 272.10 @@ -196,7 +196,7 @@ 272.11 272.12 case T_OBJECT: 272.13 _o()->print_value_on(st); 272.14 - st->print(" <" INTPTR_FORMAT ">", (address)_o()); 272.15 + st->print(" <" INTPTR_FORMAT ">", p2i((address)_o())); 272.16 break; 272.17 272.18 case T_CONFLICT:
273.1 --- a/src/share/vm/runtime/stackValueCollection.cpp Wed May 28 12:07:21 2014 -0700 273.2 +++ b/src/share/vm/runtime/stackValueCollection.cpp Thu May 29 09:56:06 2014 -0700 273.3 @@ -1,5 +1,5 @@ 273.4 /* 273.5 - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 273.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 273.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 273.8 * 273.9 * This code is free software; you can redistribute it and/or modify it 273.10 @@ -40,6 +40,8 @@ 273.11 # include "jniTypes_ppc.hpp" 273.12 #endif 273.13 273.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 273.15 + 273.16 jint StackValueCollection::int_at(int slot) const { 273.17 intptr_t val = at(slot)->get_int(); 273.18 jint ival = *((jint*) (&val));
274.1 --- a/src/share/vm/runtime/stubCodeGenerator.cpp Wed May 28 12:07:21 2014 -0700 274.2 +++ b/src/share/vm/runtime/stubCodeGenerator.cpp Thu May 29 09:56:06 2014 -0700 274.3 @@ -1,5 +1,5 @@ 274.4 /* 274.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 274.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 274.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 274.8 * 274.9 * This code is free software; you can redistribute it and/or modify it 274.10 @@ -60,10 +60,10 @@ 274.11 274.12 274.13 void StubCodeDesc::print_on(outputStream* st) const { 274.14 - st->print(group()); 274.15 + st->print("%s", group()); 274.16 st->print("::"); 274.17 - st->print(name()); 274.18 - st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes()); 274.19 + st->print("%s", name()); 274.20 + st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", p2i(begin()), p2i(end()), size_in_bytes()); 274.21 } 274.22 274.23 // Implementation of StubCodeGenerator
275.1 --- a/src/share/vm/runtime/sweeper.cpp Wed May 28 12:07:21 2014 -0700 275.2 +++ b/src/share/vm/runtime/sweeper.cpp Thu May 29 09:56:06 2014 -0700 275.3 @@ -1,5 +1,5 @@ 275.4 /* 275.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 275.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 275.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 275.8 * 275.9 * This code is free software; you can redistribute it and/or modify it 275.10 @@ -41,6 +41,8 @@ 275.11 #include "utilities/ticks.inline.hpp" 275.12 #include "utilities/xmlstream.hpp" 275.13 275.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 275.15 + 275.16 #ifdef ASSERT 275.17 275.18 #define SWEEP(nm) record_sweep(nm, __LINE__) 275.19 @@ -625,7 +627,7 @@ 275.20 tty->vprint(format, ap); 275.21 va_end(ap); 275.22 } 275.23 - tty->print_cr(s.as_string()); 275.24 + tty->print_cr("%s", s.as_string()); 275.25 } 275.26 275.27 if (LogCompilation && (xtty != NULL)) { 275.28 @@ -642,7 +644,7 @@ 275.29 xtty->vprint(format, ap); 275.30 va_end(ap); 275.31 } 275.32 - xtty->print(s.as_string()); 275.33 + xtty->print("%s", s.as_string()); 275.34 xtty->stamp(); 275.35 xtty->end_elem(); 275.36 }
276.1 --- a/src/share/vm/runtime/sweeper.hpp Wed May 28 12:07:21 2014 -0700 276.2 +++ b/src/share/vm/runtime/sweeper.hpp Thu May 29 09:56:06 2014 -0700 276.3 @@ -1,5 +1,5 @@ 276.4 /* 276.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 276.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 276.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 276.8 * 276.9 * This code is free software; you can redistribute it and/or modify it 276.10 @@ -94,7 +94,7 @@ 276.11 static const Tickspan total_time_sweeping() { return _total_time_sweeping; } 276.12 static const Tickspan peak_sweep_time() { return _peak_sweep_time; } 276.13 static const Tickspan peak_sweep_fraction_time() { return _peak_sweep_fraction_time; } 276.14 - static void log_sweep(const char* msg, const char* format = NULL, ...); 276.15 + static void log_sweep(const char* msg, const char* format = NULL, ...) ATTRIBUTE_PRINTF(2, 3); 276.16 276.17 276.18 #ifdef ASSERT
277.1 --- a/src/share/vm/runtime/synchronizer.cpp Wed May 28 12:07:21 2014 -0700 277.2 +++ b/src/share/vm/runtime/synchronizer.cpp Thu May 29 09:56:06 2014 -0700 277.3 @@ -1,5 +1,5 @@ 277.4 /* 277.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 277.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 277.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 277.8 * 277.9 * This code is free software; you can redistribute it and/or modify it 277.10 @@ -60,6 +60,8 @@ 277.11 #define ATTR 277.12 #endif 277.13 277.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 277.15 + 277.16 // The "core" versions of monitor enter and exit reside in this file. 277.17 // The interpreter and compilers contain specialized transliterated 277.18 // variants of the enter-exit fast-path operations. See i486.ad fast_lock(),
278.1 --- a/src/share/vm/runtime/thread.cpp Wed May 28 12:07:21 2014 -0700 278.2 +++ b/src/share/vm/runtime/thread.cpp Thu May 29 09:56:06 2014 -0700 278.3 @@ -1,5 +1,5 @@ 278.4 /* 278.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 278.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 278.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 278.8 * 278.9 * This code is free software; you can redistribute it and/or modify it 278.10 @@ -111,6 +111,8 @@ 278.11 #include "runtime/rtmLocking.hpp" 278.12 #endif 278.13 278.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 278.15 + 278.16 #ifdef DTRACE_ENABLED 278.17 278.18 // Only bother with this argument setup if dtrace is available 278.19 @@ -4318,7 +4320,7 @@ 278.20 // Threads::print_on() is called at safepoint by VM_PrintThreads operation. 278.21 void Threads::print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks) { 278.22 char buf[32]; 278.23 - st->print_cr(os::local_time_string(buf, sizeof(buf))); 278.24 + st->print_cr("%s", os::local_time_string(buf, sizeof(buf))); 278.25 278.26 st->print_cr("Full thread dump %s (%s %s):", 278.27 Abstract_VM_Version::vm_name(),
279.1 --- a/src/share/vm/runtime/thread.hpp Wed May 28 12:07:21 2014 -0700 279.2 +++ b/src/share/vm/runtime/thread.hpp Thu May 29 09:56:06 2014 -0700 279.3 @@ -1,5 +1,5 @@ 279.4 /* 279.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 279.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 279.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 279.8 * 279.9 * This code is free software; you can redistribute it and/or modify it 279.10 @@ -695,7 +695,7 @@ 279.11 NamedThread(); 279.12 ~NamedThread(); 279.13 // May only be called once per thread. 279.14 - void set_name(const char* format, ...); 279.15 + void set_name(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 279.16 virtual bool is_Named_thread() const { return true; } 279.17 virtual char* name() const { return _name == NULL ? (char*)"Unknown Thread" : _name; } 279.18 JavaThread *processed_thread() { return _processed_thread; }
280.1 --- a/src/share/vm/runtime/timer.cpp Wed May 28 12:07:21 2014 -0700 280.2 +++ b/src/share/vm/runtime/timer.cpp Thu May 29 09:56:06 2014 -0700 280.3 @@ -1,5 +1,5 @@ 280.4 /* 280.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 280.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 280.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 280.8 * 280.9 * This code is free software; you can redistribute it and/or modify it 280.10 @@ -204,7 +204,7 @@ 280.11 _logfile->print("[Error in TraceCPUTime]"); 280.12 } 280.13 if (_print_cr) { 280.14 - _logfile->print_cr(""); 280.15 + _logfile->cr(); 280.16 } 280.17 _logfile->flush(); 280.18 }
281.1 --- a/src/share/vm/runtime/unhandledOops.cpp Wed May 28 12:07:21 2014 -0700 281.2 +++ b/src/share/vm/runtime/unhandledOops.cpp Thu May 29 09:56:06 2014 -0700 281.3 @@ -1,5 +1,5 @@ 281.4 /* 281.5 - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 281.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 281.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 281.8 * 281.9 * This code is free software; you can redistribute it and/or modify it 281.10 @@ -31,6 +31,8 @@ 281.11 #include "runtime/unhandledOops.hpp" 281.12 #include "utilities/globalDefinitions.hpp" 281.13 281.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 281.15 + 281.16 #ifdef CHECK_UNHANDLED_OOPS 281.17 const int free_list_size = 256; 281.18
282.1 --- a/src/share/vm/runtime/vframe.cpp Wed May 28 12:07:21 2014 -0700 282.2 +++ b/src/share/vm/runtime/vframe.cpp Thu May 29 09:56:06 2014 -0700 282.3 @@ -1,5 +1,5 @@ 282.4 /* 282.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 282.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 282.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 282.8 * 282.9 * This code is free software; you can redistribute it and/or modify it 282.10 @@ -46,6 +46,8 @@ 282.11 #include "runtime/vframeArray.hpp" 282.12 #include "runtime/vframe_hp.hpp" 282.13 282.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 282.15 + 282.16 vframe::vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread) 282.17 : _reg_map(reg_map), _thread(thread) { 282.18 assert(fr != NULL, "must have frame");
283.1 --- a/src/share/vm/runtime/vframe.hpp Wed May 28 12:07:21 2014 -0700 283.2 +++ b/src/share/vm/runtime/vframe.hpp Thu May 29 09:56:06 2014 -0700 283.3 @@ -1,5 +1,5 @@ 283.4 /* 283.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 283.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 283.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 283.8 * 283.9 * This code is free software; you can redistribute it and/or modify it 283.10 @@ -399,7 +399,7 @@ 283.11 if (WizardMode) { 283.12 tty->print_cr("Error in fill_from_frame: pc_desc for " 283.13 INTPTR_FORMAT " not found or invalid at %d", 283.14 - _frame.pc(), decode_offset); 283.15 + p2i(_frame.pc()), decode_offset); 283.16 nm()->print(); 283.17 nm()->method()->print_codes(); 283.18 nm()->print_code();
284.1 --- a/src/share/vm/runtime/vframeArray.cpp Wed May 28 12:07:21 2014 -0700 284.2 +++ b/src/share/vm/runtime/vframeArray.cpp Thu May 29 09:56:06 2014 -0700 284.3 @@ -1,5 +1,5 @@ 284.4 /* 284.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 284.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 284.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 284.8 * 284.9 * This code is free software; you can redistribute it and/or modify it 284.10 @@ -43,6 +43,7 @@ 284.11 #include "opto/runtime.hpp" 284.12 #endif 284.13 284.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 284.15 284.16 int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); } 284.17
285.1 --- a/src/share/vm/runtime/virtualspace.cpp Wed May 28 12:07:21 2014 -0700 285.2 +++ b/src/share/vm/runtime/virtualspace.cpp Thu May 29 09:56:06 2014 -0700 285.3 @@ -1,5 +1,5 @@ 285.4 /* 285.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 285.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 285.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 285.8 * 285.9 * This code is free software; you can redistribute it and/or modify it 285.10 @@ -43,6 +43,7 @@ 285.11 # include "os_bsd.inline.hpp" 285.12 #endif 285.13 285.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 285.15 285.16 // ReservedSpace 285.17
286.1 --- a/src/share/vm/runtime/vmThread.cpp Wed May 28 12:07:21 2014 -0700 286.2 +++ b/src/share/vm/runtime/vmThread.cpp Thu May 29 09:56:06 2014 -0700 286.3 @@ -1,5 +1,5 @@ 286.4 /* 286.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 286.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 286.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 286.8 * 286.9 * This code is free software; you can redistribute it and/or modify it 286.10 @@ -46,6 +46,8 @@ 286.11 HS_DTRACE_PROBE_DECL3(hotspot, vmops__end, char *, uintptr_t, int); 286.12 #endif /* !USDT2 */ 286.13 286.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 286.15 + 286.16 // Dummy VM operation to act as first element in our circular double-linked list 286.17 class VM_Dummy: public VM_Operation { 286.18 VMOp_Type type() const { return VMOp_Dummy; }
287.1 --- a/src/share/vm/runtime/vm_operations.cpp Wed May 28 12:07:21 2014 -0700 287.2 +++ b/src/share/vm/runtime/vm_operations.cpp Thu May 29 09:56:06 2014 -0700 287.3 @@ -1,5 +1,5 @@ 287.4 /* 287.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 287.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 287.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 287.8 * 287.9 * This code is free software; you can redistribute it and/or modify it 287.10 @@ -39,6 +39,8 @@ 287.11 #include "services/threadService.hpp" 287.12 #include "trace/tracing.hpp" 287.13 287.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 287.15 + 287.16 #define VM_OP_NAME_INITIALIZE(name) #name, 287.17 287.18 const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \
288.1 --- a/src/share/vm/services/attachListener.cpp Wed May 28 12:07:21 2014 -0700 288.2 +++ b/src/share/vm/services/attachListener.cpp Thu May 29 09:56:06 2014 -0700 288.3 @@ -1,5 +1,5 @@ 288.4 /* 288.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 288.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 288.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 288.8 * 288.9 * This code is free software; you can redistribute it and/or modify it 288.10 @@ -284,15 +284,15 @@ 288.11 } 288.12 288.13 if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) { 288.14 - FormatBuffer<80> err_msg(""); 288.15 + FormatBuffer<80> err_msg("%s", ""); 288.16 if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) { 288.17 - out->print_cr(err_msg.buffer()); 288.18 + out->print_cr("%s", err_msg.buffer()); 288.19 return JNI_ERR; 288.20 } 288.21 } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) { 288.22 - FormatBuffer<80> err_msg(""); 288.23 + FormatBuffer<80> err_msg("%s", ""); 288.24 if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) { 288.25 - out->print_cr(err_msg.buffer()); 288.26 + out->print_cr("%s", err_msg.buffer()); 288.27 return JNI_ERR; 288.28 } 288.29 } 288.30 @@ -381,7 +381,7 @@ 288.31 Flag* f = Flag::find_flag((char*)name, strlen(name)); 288.32 if (f) { 288.33 f->print_as_flag(out); 288.34 - out->print_cr(""); 288.35 + out->cr(); 288.36 } else { 288.37 out->print_cr("no such flag '%s'", name); 288.38 }
289.1 --- a/src/share/vm/services/classLoadingService.cpp Wed May 28 12:07:21 2014 -0700 289.2 +++ b/src/share/vm/services/classLoadingService.cpp Thu May 29 09:56:06 2014 -0700 289.3 @@ -1,5 +1,5 @@ 289.4 /* 289.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 289.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 289.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 289.8 * 289.9 * This code is free software; you can redistribute it and/or modify it 289.10 @@ -157,7 +157,7 @@ 289.11 289.12 if (TraceClassUnloading) { 289.13 ResourceMark rm; 289.14 - tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), k); 289.15 + tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), p2i(k)); 289.16 } 289.17 } 289.18
290.1 --- a/src/share/vm/services/diagnosticCommand.cpp Wed May 28 12:07:21 2014 -0700 290.2 +++ b/src/share/vm/services/diagnosticCommand.cpp Thu May 29 09:56:06 2014 -0700 290.3 @@ -1,5 +1,5 @@ 290.4 /* 290.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 290.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 290.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 290.8 * 290.9 * This code is free software; you can redistribute it and/or modify it 290.10 @@ -32,6 +32,8 @@ 290.11 #include "services/management.hpp" 290.12 #include "utilities/macros.hpp" 290.13 290.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 290.15 + 290.16 void DCmdRegistrant::register_dcmds(){ 290.17 // Registration of the diagnostic commands 290.18 // First argument specifies which interfaces will export the command 290.19 @@ -99,7 +101,7 @@ 290.20 if (factory != NULL) { 290.21 output()->print_cr("%s%s", factory->name(), 290.22 factory->is_enabled() ? "" : " [disabled]"); 290.23 - output()->print_cr(factory->description()); 290.24 + output()->print_cr("%s", factory->description()); 290.25 output()->print_cr("\nImpact: %s", factory->impact()); 290.26 JavaPermission p = factory->permission(); 290.27 if(p._class != NULL) {
291.1 --- a/src/share/vm/services/diagnosticFramework.cpp Wed May 28 12:07:21 2014 -0700 291.2 +++ b/src/share/vm/services/diagnosticFramework.cpp Thu May 29 09:56:06 2014 -0700 291.3 @@ -1,5 +1,5 @@ 291.4 /* 291.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 291.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 291.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 291.8 * 291.9 * This code is free software; you can redistribute it and/or modify it 291.10 @@ -259,7 +259,7 @@ 291.11 } 291.12 arg = arg->next(); 291.13 } 291.14 - out->print_cr(""); 291.15 + out->cr(); 291.16 if (_arguments_list != NULL) { 291.17 out->print_cr("\nArguments:"); 291.18 arg = _arguments_list; 291.19 @@ -268,7 +268,7 @@ 291.20 arg->is_mandatory() ? "" : "[optional]", 291.21 arg->description(), arg->type()); 291.22 if (arg->has_default()) { 291.23 - out->print(arg->default_string()); 291.24 + out->print("%s", arg->default_string()); 291.25 } else { 291.26 out->print("no default value"); 291.27 } 291.28 @@ -284,7 +284,7 @@ 291.29 arg->is_mandatory() ? "" : "[optional]", 291.30 arg->description(), arg->type()); 291.31 if (arg->has_default()) { 291.32 - out->print(arg->default_string()); 291.33 + out->print("%s", arg->default_string()); 291.34 } else { 291.35 out->print("no default value"); 291.36 }
292.1 --- a/src/share/vm/services/heapDumper.cpp Wed May 28 12:07:21 2014 -0700 292.2 +++ b/src/share/vm/services/heapDumper.cpp Thu May 29 09:56:06 2014 -0700 292.3 @@ -1,5 +1,5 @@ 292.4 /* 292.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 292.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 292.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 292.8 * 292.9 * This code is free software; you can redistribute it and/or modify it 292.10 @@ -1830,6 +1830,7 @@ 292.11 } 292.12 292.13 // dump the heap to given path. 292.14 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 292.15 int HeapDumper::dump(const char* path) { 292.16 assert(path != NULL && strlen(path) > 0, "path missing"); 292.17 292.18 @@ -1870,7 +1871,10 @@ 292.19 char msg[256]; 292.20 sprintf(msg, "Heap dump file created [%s bytes in %3.3f secs]", 292.21 JLONG_FORMAT, timer()->seconds()); 292.22 +PRAGMA_DIAG_PUSH 292.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 292.24 tty->print_cr(msg, writer.bytes_written()); 292.25 +PRAGMA_DIAG_POP 292.26 } else { 292.27 tty->print_cr("Dump file is incomplete: %s", writer.error()); 292.28 }
293.1 --- a/src/share/vm/services/lowMemoryDetector.cpp Wed May 28 12:07:21 2014 -0700 293.2 +++ b/src/share/vm/services/lowMemoryDetector.cpp Thu May 29 09:56:06 2014 -0700 293.3 @@ -1,5 +1,5 @@ 293.4 /* 293.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 293.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 293.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 293.8 * 293.9 * This code is free software; you can redistribute it and/or modify it 293.10 @@ -353,7 +353,7 @@ 293.11 293.12 #ifndef PRODUCT 293.13 void SensorInfo::print() { 293.14 - tty->print_cr("%s count = " SIZE_FORMAT " pending_triggers = %ld pending_clears = %ld", 293.15 + tty->print_cr("%s count = " SIZE_FORMAT " pending_triggers = %d pending_clears = %d", 293.16 (_sensor_on ? "on" : "off"), 293.17 _sensor_count, _pending_trigger_count, _pending_clear_count); 293.18 }
294.1 --- a/src/share/vm/services/management.cpp Wed May 28 12:07:21 2014 -0700 294.2 +++ b/src/share/vm/services/management.cpp Thu May 29 09:56:06 2014 -0700 294.3 @@ -1,5 +1,5 @@ 294.4 /* 294.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 294.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 294.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 294.8 * 294.9 * This code is free software; you can redistribute it and/or modify it 294.10 @@ -55,6 +55,8 @@ 294.11 #include "services/threadService.hpp" 294.12 #include "utilities/macros.hpp" 294.13 294.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 294.15 + 294.16 PerfVariable* Management::_begin_vm_creation_time = NULL; 294.17 PerfVariable* Management::_end_vm_creation_time = NULL; 294.18 PerfVariable* Management::_vm_init_done_time = NULL; 294.19 @@ -1832,12 +1834,12 @@ 294.20 uintx uvalue = (uintx)new_value.j; 294.21 294.22 if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) { 294.23 - FormatBuffer<80> err_msg(""); 294.24 + FormatBuffer<80> err_msg("%s", ""); 294.25 if (!Arguments::verify_MaxHeapFreeRatio(err_msg, uvalue)) { 294.26 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer()); 294.27 } 294.28 } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) { 294.29 - FormatBuffer<80> err_msg(""); 294.30 + FormatBuffer<80> err_msg("%s", ""); 294.31 if (!Arguments::verify_MinHeapFreeRatio(err_msg, uvalue)) { 294.32 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer()); 294.33 }
295.1 --- a/src/share/vm/services/memReporter.cpp Wed May 28 12:07:21 2014 -0700 295.2 +++ b/src/share/vm/services/memReporter.cpp Thu May 29 09:56:06 2014 -0700 295.3 @@ -1,5 +1,5 @@ 295.4 /* 295.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 295.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 295.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 295.8 * 295.9 * This code is free software; you can redistribute it and/or modify it 295.10 @@ -28,6 +28,8 @@ 295.11 #include "services/memPtrArray.hpp" 295.12 #include "services/memTracker.hpp" 295.13 295.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 295.15 + 295.16 const char* BaselineOutputer::memory_unit(size_t scale) { 295.17 switch(scale) { 295.18 case K: return "KB";
296.1 --- a/src/share/vm/services/memSnapshot.cpp Wed May 28 12:07:21 2014 -0700 296.2 +++ b/src/share/vm/services/memSnapshot.cpp Thu May 29 09:56:06 2014 -0700 296.3 @@ -1,5 +1,5 @@ 296.4 /* 296.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 296.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 296.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 296.8 * 296.9 * This code is free software; you can redistribute it and/or modify it 296.10 @@ -31,6 +31,8 @@ 296.11 #include "services/memSnapshot.hpp" 296.12 #include "services/memTracker.hpp" 296.13 296.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 296.15 + 296.16 #ifdef ASSERT 296.17 296.18 void decode_pointer_record(MemPointerRecord* rec) { 296.19 @@ -733,7 +735,7 @@ 296.20 if (os::dll_address_to_function_name(ex->pc(), buf, sizeof(buf), NULL)) { 296.21 tty->print_cr("\t%s", buf); 296.22 } else { 296.23 - tty->print_cr(""); 296.24 + tty->cr(); 296.25 } 296.26 } 296.27 }
297.1 --- a/src/share/vm/services/memTrackWorker.cpp Wed May 28 12:07:21 2014 -0700 297.2 +++ b/src/share/vm/services/memTrackWorker.cpp Thu May 29 09:56:06 2014 -0700 297.3 @@ -1,5 +1,5 @@ 297.4 /* 297.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 297.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 297.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 297.8 * 297.9 * This code is free software; you can redistribute it and/or modify it 297.10 @@ -43,7 +43,7 @@ 297.11 // create thread uses cgc thread type for now. We should revisit 297.12 // the option, or create new thread type. 297.13 _has_error = !os::create_thread(this, os::cgc_thread); 297.14 - set_name("MemTrackWorker", 0); 297.15 + set_name("MemTrackWorker"); 297.16 297.17 // initial generation circuit buffer 297.18 if (!has_error()) {
298.1 --- a/src/share/vm/services/nmtDCmd.cpp Wed May 28 12:07:21 2014 -0700 298.2 +++ b/src/share/vm/services/nmtDCmd.cpp Thu May 29 09:56:06 2014 -0700 298.3 @@ -1,5 +1,5 @@ 298.4 /* 298.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 298.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 298.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 298.8 * 298.9 * This code is free software; you can redistribute it and/or modify it 298.10 @@ -128,7 +128,7 @@ 298.11 // native memory tracking has to be on 298.12 if (!MemTracker::is_on() || MemTracker::shutdown_in_progress()) { 298.13 // if it is not on, what's the reason? 298.14 - output()->print_cr(MemTracker::reason()); 298.15 + output()->print_cr("%s", MemTracker::reason()); 298.16 return; 298.17 } 298.18
299.1 --- a/src/share/vm/services/threadService.cpp Wed May 28 12:07:21 2014 -0700 299.2 +++ b/src/share/vm/services/threadService.cpp Thu May 29 09:56:06 2014 -0700 299.3 @@ -1,5 +1,5 @@ 299.4 /* 299.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 299.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. 299.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 299.8 * 299.9 * This code is free software; you can redistribute it and/or modify it 299.10 @@ -37,6 +37,8 @@ 299.11 #include "runtime/vm_operations.hpp" 299.12 #include "services/threadService.hpp" 299.13 299.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 299.15 + 299.16 // TODO: we need to define a naming convention for perf counters 299.17 // to distinguish counters for: 299.18 // - standard JSR174 use
300.1 --- a/src/share/vm/trace/traceStream.hpp Wed May 28 12:07:21 2014 -0700 300.2 +++ b/src/share/vm/trace/traceStream.hpp Thu May 29 09:56:06 2014 -0700 300.3 @@ -1,5 +1,5 @@ 300.4 /* 300.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 300.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 300.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 300.8 * 300.9 * This code is free software; you can redistribute it and/or modify it 300.10 @@ -66,7 +66,7 @@ 300.11 } 300.12 300.13 void print_val(const char* label, s8 val) { 300.14 - _st.print("%s = "INT64_FORMAT, label, val); 300.15 + _st.print("%s = "INT64_FORMAT, label, (int64_t) val); 300.16 } 300.17 300.18 void print_val(const char* label, bool val) { 300.19 @@ -113,7 +113,7 @@ 300.20 } 300.21 300.22 void print(const char* val) { 300.23 - _st.print(val); 300.24 + _st.print("%s", val); 300.25 } 300.26 }; 300.27
301.1 --- a/src/share/vm/utilities/array.hpp Wed May 28 12:07:21 2014 -0700 301.2 +++ b/src/share/vm/utilities/array.hpp Thu May 29 09:56:06 2014 -0700 301.3 @@ -375,7 +375,7 @@ 301.4 301.5 // FIXME: How to handle this? 301.6 void print_value_on(outputStream* st) const { 301.7 - st->print("Array<T>(" INTPTR_FORMAT ")", this); 301.8 + st->print("Array<T>(" INTPTR_FORMAT ")", p2i(this)); 301.9 } 301.10 301.11 #ifndef PRODUCT
302.1 --- a/src/share/vm/utilities/bitMap.cpp Wed May 28 12:07:21 2014 -0700 302.2 +++ b/src/share/vm/utilities/bitMap.cpp Thu May 29 09:56:06 2014 -0700 302.3 @@ -1,5 +1,5 @@ 302.4 /* 302.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 302.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 302.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 302.8 * 302.9 * This code is free software; you can redistribute it and/or modify it 302.10 @@ -523,13 +523,13 @@ 302.11 302.12 void BitMap::print_on_error(outputStream* st, const char* prefix) const { 302.13 st->print_cr("%s[" PTR_FORMAT ", " PTR_FORMAT ")", 302.14 - prefix, map(), (char*)map() + (size() >> LogBitsPerByte)); 302.15 + prefix, p2i(map()), p2i((char*)map() + (size() >> LogBitsPerByte))); 302.16 } 302.17 302.18 #ifndef PRODUCT 302.19 302.20 void BitMap::print_on(outputStream* st) const { 302.21 - tty->print("Bitmap(%d):", size()); 302.22 + tty->print("Bitmap(" SIZE_FORMAT "):", size()); 302.23 for (idx_t index = 0; index < size(); index++) { 302.24 tty->print("%c", at(index) ? '1' : '0'); 302.25 }
303.1 --- a/src/share/vm/utilities/constantTag.cpp Wed May 28 12:07:21 2014 -0700 303.2 +++ b/src/share/vm/utilities/constantTag.cpp Thu May 29 09:56:06 2014 -0700 303.3 @@ -1,5 +1,5 @@ 303.4 /* 303.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 303.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 303.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 303.8 * 303.9 * This code is free software; you can redistribute it and/or modify it 303.10 @@ -28,7 +28,7 @@ 303.11 #ifndef PRODUCT 303.12 303.13 void constantTag::print_on(outputStream* st) const { 303.14 - st->print(internal_name()); 303.15 + st->print("%s", internal_name()); 303.16 } 303.17 303.18 #endif // PRODUCT
304.1 --- a/src/share/vm/utilities/debug.cpp Wed May 28 12:07:21 2014 -0700 304.2 +++ b/src/share/vm/utilities/debug.cpp Thu May 29 09:56:06 2014 -0700 304.3 @@ -1,5 +1,5 @@ 304.4 /* 304.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 304.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 304.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 304.8 * 304.9 * This code is free software; you can redistribute it and/or modify it 304.10 @@ -88,6 +88,8 @@ 304.11 # endif 304.12 #endif // PRODUCT 304.13 304.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 304.15 + 304.16 FormatBufferResource::FormatBufferResource(const char * format, ...) 304.17 : FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) { 304.18 va_list argp; 304.19 @@ -96,6 +98,7 @@ 304.20 va_end(argp); 304.21 } 304.22 304.23 +ATTRIBUTE_PRINTF(1, 2) 304.24 void warning(const char* format, ...) { 304.25 if (PrintWarnings) { 304.26 FILE* const err = defaultStream::error_stream();
305.1 --- a/src/share/vm/utilities/debug.hpp Wed May 28 12:07:21 2014 -0700 305.2 +++ b/src/share/vm/utilities/debug.hpp Thu May 29 09:56:06 2014 -0700 305.3 @@ -1,5 +1,5 @@ 305.4 /* 305.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 305.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 305.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 305.8 * 305.9 * This code is free software; you can redistribute it and/or modify it 305.10 @@ -43,17 +43,17 @@ 305.11 #define RES_BUFSZ 256 305.12 class FormatBufferResource : public FormatBufferBase { 305.13 public: 305.14 - FormatBufferResource(const char * format, ...); 305.15 + FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3); 305.16 }; 305.17 305.18 // Use stack for buffer 305.19 template <size_t bufsz = 256> 305.20 class FormatBuffer : public FormatBufferBase { 305.21 public: 305.22 - inline FormatBuffer(const char * format, ...); 305.23 - inline void append(const char* format, ...); 305.24 - inline void print(const char* format, ...); 305.25 - inline void printv(const char* format, va_list ap); 305.26 + inline FormatBuffer(const char * format, ...) ATTRIBUTE_PRINTF(2, 3); 305.27 + inline void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 305.28 + inline void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 305.29 + inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); 305.30 305.31 char* buffer() { return _buf; } 305.32 int size() { return bufsz; } 305.33 @@ -223,7 +223,7 @@ 305.34 void report_unimplemented(const char* file, int line); 305.35 void report_untested(const char* file, int line, const char* message); 305.36 305.37 -void warning(const char* format, ...); 305.38 +void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2); 305.39 305.40 #ifdef ASSERT 305.41 // Compile-time asserts.
306.1 --- a/src/share/vm/utilities/events.cpp Wed May 28 12:07:21 2014 -0700 306.2 +++ b/src/share/vm/utilities/events.cpp Thu May 29 09:56:06 2014 -0700 306.3 @@ -82,7 +82,7 @@ 306.4 va_start(ap, format); 306.5 // Save a copy of begin message and log it. 306.6 _buffer.printv(format, ap); 306.7 - Events::log(NULL, "%s", (const char*)_buffer); 306.8 + Events::log(NULL, "%s", _buffer.buffer()); 306.9 va_end(ap); 306.10 } 306.11 } 306.12 @@ -91,6 +91,6 @@ 306.13 if (LogEvents) { 306.14 // Append " done" to the begin message and log it 306.15 _buffer.append(" done"); 306.16 - Events::log(NULL, "%s", (const char*)_buffer); 306.17 + Events::log(NULL, "%s", _buffer.buffer()); 306.18 } 306.19 }
307.1 --- a/src/share/vm/utilities/events.hpp Wed May 28 12:07:21 2014 -0700 307.2 +++ b/src/share/vm/utilities/events.hpp Thu May 29 09:56:06 2014 -0700 307.3 @@ -1,5 +1,5 @@ 307.4 /* 307.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 307.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 307.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 307.8 * 307.9 * This code is free software; you can redistribute it and/or modify it 307.10 @@ -128,7 +128,7 @@ 307.11 void print(outputStream* out, EventRecord<T>& e) { 307.12 out->print("Event: %.3f ", e.timestamp); 307.13 if (e.thread != NULL) { 307.14 - out->print("Thread " INTPTR_FORMAT " ", e.thread); 307.15 + out->print("Thread " INTPTR_FORMAT " ", p2i(e.thread)); 307.16 } 307.17 print(out, e.data); 307.18 } 307.19 @@ -148,7 +148,7 @@ 307.20 public: 307.21 StringEventLog(const char* name, int count = LogEventsBufferEntries) : EventLogBase<StringLogMessage>(name, count) {} 307.22 307.23 - void logv(Thread* thread, const char* format, va_list ap) { 307.24 + void logv(Thread* thread, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0) { 307.25 if (!should_log()) return; 307.26 307.27 double timestamp = fetch_timestamp(); 307.28 @@ -159,7 +159,7 @@ 307.29 _records[index].data.printv(format, ap); 307.30 } 307.31 307.32 - void log(Thread* thread, const char* format, ...) { 307.33 + void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(3, 4) { 307.34 va_list ap; 307.35 va_start(ap, format); 307.36 logv(thread, format, ap); 307.37 @@ -193,18 +193,17 @@ 307.38 static void print(); 307.39 307.40 // Logs a generic message with timestamp and format as printf. 307.41 - static void log(Thread* thread, const char* format, ...); 307.42 + static void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 307.43 307.44 // Log exception related message 307.45 - static void log_exception(Thread* thread, const char* format, ...); 307.46 + static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 307.47 307.48 - static void log_deopt_message(Thread* thread, const char* format, ...); 307.49 + static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 307.50 307.51 // Register default loggers 307.52 static void init(); 307.53 }; 307.54 307.55 - 307.56 inline void Events::log(Thread* thread, const char* format, ...) { 307.57 if (LogEvents) { 307.58 va_list ap; 307.59 @@ -283,7 +282,7 @@ 307.60 307.61 public: 307.62 // log a begin event, format as printf 307.63 - EventMark(const char* format, ...); 307.64 + EventMark(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 307.65 // log an end event 307.66 ~EventMark(); 307.67 };
308.1 --- a/src/share/vm/utilities/exceptions.cpp Wed May 28 12:07:21 2014 -0700 308.2 +++ b/src/share/vm/utilities/exceptions.cpp Thu May 29 09:56:06 2014 -0700 308.3 @@ -1,5 +1,5 @@ 308.4 /* 308.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 308.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 308.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 308.8 * 308.9 * This code is free software; you can redistribute it and/or modify it 308.10 @@ -35,6 +35,7 @@ 308.11 #include "utilities/events.hpp" 308.12 #include "utilities/exceptions.hpp" 308.13 308.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 308.15 308.16 // Implementation of ThreadShadow 308.17 void check_ThreadShadow() { 308.18 @@ -237,6 +238,7 @@ 308.19 _throw_msg(thread, file, line, h_name, msg); 308.20 } 308.21 308.22 + 308.23 // Creates an exception oop, calls the <init> method with the given signature. 308.24 // and returns a Handle 308.25 Handle Exceptions::new_exception(Thread *thread, Symbol* name,
309.1 --- a/src/share/vm/utilities/exceptions.hpp Wed May 28 12:07:21 2014 -0700 309.2 +++ b/src/share/vm/utilities/exceptions.hpp Thu May 29 09:56:06 2014 -0700 309.3 @@ -1,5 +1,5 @@ 309.4 /* 309.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 309.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 309.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 309.8 * 309.9 * This code is free software; you can redistribute it and/or modify it 309.10 @@ -132,7 +132,7 @@ 309.11 // There is no THROW... macro for this method. Caller should remember 309.12 // to do a return after calling it. 309.13 static void fthrow(Thread* thread, const char* file, int line, Symbol* name, 309.14 - const char* format, ...); 309.15 + const char* format, ...) ATTRIBUTE_PRINTF(5, 6); 309.16 309.17 // Create and initialize a new exception 309.18 static Handle new_exception(Thread* thread, Symbol* name,
310.1 --- a/src/share/vm/utilities/globalDefinitions.hpp Wed May 28 12:07:21 2014 -0700 310.2 +++ b/src/share/vm/utilities/globalDefinitions.hpp Thu May 29 09:56:06 2014 -0700 310.3 @@ -1,5 +1,5 @@ 310.4 /* 310.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 310.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 310.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 310.8 * 310.9 * This code is free software; you can redistribute it and/or modify it 310.10 @@ -42,6 +42,32 @@ 310.11 # include "utilities/globalDefinitions_xlc.hpp" 310.12 #endif 310.13 310.14 +#ifndef PRAGMA_DIAG_PUSH 310.15 +#define PRAGMA_DIAG_PUSH 310.16 +#endif 310.17 +#ifndef PRAGMA_DIAG_POP 310.18 +#define PRAGMA_DIAG_POP 310.19 +#endif 310.20 +#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED 310.21 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED 310.22 +#endif 310.23 +#ifndef PRAGMA_FORMAT_IGNORED 310.24 +#define PRAGMA_FORMAT_IGNORED 310.25 +#endif 310.26 +#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 310.27 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 310.28 +#endif 310.29 +#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 310.30 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 310.31 +#endif 310.32 +#ifndef PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 310.33 +#define PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 310.34 +#endif 310.35 +#ifndef ATTRIBUTE_PRINTF 310.36 +#define ATTRIBUTE_PRINTF(fmt, vargs) 310.37 +#endif 310.38 + 310.39 + 310.40 #include "utilities/macros.hpp" 310.41 310.42 // This file holds all globally used constants & types, class (forward) 310.43 @@ -1284,6 +1310,11 @@ 310.44 return ((int)((unsigned int)high << 16) | (unsigned int)low); 310.45 } 310.46 310.47 +// Convert pointer to intptr_t, for use in printing pointers. 310.48 +inline intptr_t p2i(const void * p) { 310.49 + return (intptr_t) p; 310.50 +} 310.51 + 310.52 // Printf-style formatters for fixed- and variable-width types as pointers and 310.53 // integers. These are derived from the definitions in inttypes.h. If the platform 310.54 // doesn't provide appropriate definitions, they should be provided in 310.55 @@ -1302,6 +1333,7 @@ 310.56 // Format 64-bit quantities. 310.57 #define INT64_FORMAT "%" PRId64 310.58 #define UINT64_FORMAT "%" PRIu64 310.59 +#define UINT64_FORMAT_X "%" PRIx64 310.60 #define INT64_FORMAT_W(width) "%" #width PRId64 310.61 #define UINT64_FORMAT_W(width) "%" #width PRIu64 310.62 310.63 @@ -1324,10 +1356,14 @@ 310.64 #define PTR_FORMAT "0x%08" PRIxPTR 310.65 #endif // _LP64 310.66 310.67 -#define SSIZE_FORMAT "%" PRIdPTR 310.68 -#define SIZE_FORMAT "%" PRIuPTR 310.69 -#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR 310.70 -#define SIZE_FORMAT_W(width) "%" #width PRIuPTR 310.71 +#define INTPTR_FORMAT_W(width) "%" #width PRIxPTR 310.72 + 310.73 +#define SSIZE_FORMAT "%" PRIdPTR 310.74 +#define SIZE_FORMAT "%" PRIuPTR 310.75 +#define SIZE_FORMAT_HEX "0x%" PRIxPTR 310.76 +#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR 310.77 +#define SIZE_FORMAT_W(width) "%" #width PRIuPTR 310.78 +#define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR 310.79 310.80 #define INTX_FORMAT "%" PRIdPTR 310.81 #define UINTX_FORMAT "%" PRIuPTR 310.82 @@ -1349,11 +1385,10 @@ 310.83 // All C++ compilers that we know of have the vtbl pointer in the first 310.84 // word. If there are exceptions, this function needs to be made compiler 310.85 // specific. 310.86 -static inline void* dereference_vptr(void* addr) { 310.87 +static inline void* dereference_vptr(const void* addr) { 310.88 return *(void**)addr; 310.89 } 310.90 310.91 - 310.92 #ifndef PRODUCT 310.93 310.94 // For unit testing only
311.1 --- a/src/share/vm/utilities/globalDefinitions_gcc.hpp Wed May 28 12:07:21 2014 -0700 311.2 +++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp Thu May 29 09:56:06 2014 -0700 311.3 @@ -1,5 +1,5 @@ 311.4 /* 311.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 311.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. 311.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 311.8 * 311.9 * This code is free software; you can redistribute it and/or modify it 311.10 @@ -282,6 +282,47 @@ 311.11 #define PRAGMA_IMPLEMENTATION #pragma implementation 311.12 #define VALUE_OBJ_CLASS_SPEC 311.13 311.14 +#ifndef ATTRIBUTE_PRINTF 311.15 +// Diagnostic pragmas like the ones defined below in PRAGMA_FORMAT_NONLITERAL_IGNORED 311.16 +// were only introduced in GCC 4.2. Because we have no other possibility to ignore 311.17 +// these warnings for older versions of GCC, we simply don't decorate our printf-style 311.18 +// functions with __attribute__(format) in that case. 311.19 +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || (__GNUC__ > 4) 311.20 +#define ATTRIBUTE_PRINTF(fmt,vargs) __attribute__((format(printf, fmt, vargs))) 311.21 +#else 311.22 +#define ATTRIBUTE_PRINTF(fmt,vargs) 311.23 +#endif 311.24 +#endif 311.25 + 311.26 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \ 311.27 + _Pragma("GCC diagnostic ignored \"-Wformat-security\"") 311.28 +#define PRAGMA_FORMAT_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat\"") 311.29 + 311.30 +#if defined(__clang_major__) && \ 311.31 + (__clang_major__ >= 4 || \ 311.32 + (__clang_major__ >= 3 && __clang_minor__ >= 1)) || \ 311.33 + ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 311.34 +// Tested to work with clang version 3.1 and better. 311.35 +#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push") 311.36 +#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop") 311.37 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL 311.38 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL PRAGMA_FORMAT_NONLITERAL_IGNORED 311.39 + 311.40 +// Hack to deal with gcc yammering about non-security format stuff 311.41 +#else 311.42 +// Old versions of gcc don't do push/pop, also do not cope with this pragma within a function 311.43 +// One method does so much varied printing that it is decorated with both internal and external 311.44 +// versions of the macro-pragma to obtain better checking with newer compilers. 311.45 +#define PRAGMA_DIAG_PUSH 311.46 +#define PRAGMA_DIAG_POP 311.47 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL PRAGMA_FORMAT_NONLITERAL_IGNORED 311.48 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL 311.49 +#endif 311.50 + 311.51 +#ifndef __clang_major__ 311.52 +#define PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC _Pragma("GCC diagnostic ignored \"-Wformat\"") _Pragma("GCC diagnostic error \"-Wformat-nonliteral\"") _Pragma("GCC diagnostic error \"-Wformat-security\"") 311.53 +#endif 311.54 + 311.55 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95) 311.56 #define TEMPLATE_TABLE_BUG 311.57 #endif
312.1 --- a/src/share/vm/utilities/numberSeq.cpp Wed May 28 12:07:21 2014 -0700 312.2 +++ b/src/share/vm/utilities/numberSeq.cpp Thu May 29 09:56:06 2014 -0700 312.3 @@ -1,5 +1,5 @@ 312.4 /* 312.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 312.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 312.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 312.8 * 312.9 * This code is free software; you can redistribute it and/or modify it 312.10 @@ -258,5 +258,5 @@ 312.11 } 312.12 s->print("\t[%d]=%7.3f", i, _sequence[i]); 312.13 } 312.14 - s->print_cr(""); 312.15 + s->cr(); 312.16 }
313.1 --- a/src/share/vm/utilities/ostream.cpp Wed May 28 12:07:21 2014 -0700 313.2 +++ b/src/share/vm/utilities/ostream.cpp Thu May 29 09:56:06 2014 -0700 313.3 @@ -1,5 +1,5 @@ 313.4 /* 313.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 313.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 313.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 313.8 * 313.9 * This code is free software; you can redistribute it and/or modify it 313.10 @@ -268,7 +268,7 @@ 313.11 size_t limit = (len + 16) / 16 * 16; 313.12 for (size_t i = 0; i < limit; ++i) { 313.13 if (i % 16 == 0) { 313.14 - indent().print("%07x:", i); 313.15 + indent().print(SIZE_FORMAT_HEX_W(07)":", i); 313.16 } 313.17 if (i % 2 == 0) { 313.18 print(" "); 313.19 @@ -289,7 +289,7 @@ 313.20 } 313.21 } 313.22 } 313.23 - print_cr(""); 313.24 + cr(); 313.25 } 313.26 } 313.27 } 313.28 @@ -606,7 +606,7 @@ 313.29 // memory usage and command line flags into header 313.30 void gcLogFileStream::dump_loggc_header() { 313.31 if (is_open()) { 313.32 - print_cr(Abstract_VM_Version::internal_vm_info_string()); 313.33 + print_cr("%s", Abstract_VM_Version::internal_vm_info_string()); 313.34 os::print_memory_info(this); 313.35 print("CommandLine flags: "); 313.36 CommandLineFlags::printSetFlags(this); 313.37 @@ -687,7 +687,7 @@ 313.38 write(time_msg, strlen(time_msg)); 313.39 313.40 if (out != NULL) { 313.41 - out->print(time_msg); 313.42 + out->print("%s", time_msg); 313.43 } 313.44 313.45 dump_loggc_header(); 313.46 @@ -720,7 +720,7 @@ 313.47 write(time_msg, strlen(time_msg)); 313.48 313.49 if (out != NULL) { 313.50 - out->print(time_msg); 313.51 + out->print("%s", time_msg); 313.52 } 313.53 313.54 fclose(_file); 313.55 @@ -765,7 +765,7 @@ 313.56 write(time_msg, strlen(time_msg)); 313.57 313.58 if (out != NULL) { 313.59 - out->print(time_msg); 313.60 + out->print("%s", time_msg); 313.61 } 313.62 313.63 dump_loggc_header(); 313.64 @@ -845,7 +845,7 @@ 313.65 xs->head("hotspot_log version='%d %d'" 313.66 " process='%d' time_ms='"INT64_FORMAT"'", 313.67 LOG_MAJOR_VERSION, LOG_MINOR_VERSION, 313.68 - os::current_process_id(), time_ms); 313.69 + os::current_process_id(), (int64_t)time_ms); 313.70 // Write VM version header immediately. 313.71 xs->head("vm_version"); 313.72 xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr();
314.1 --- a/src/share/vm/utilities/ostream.hpp Wed May 28 12:07:21 2014 -0700 314.2 +++ b/src/share/vm/utilities/ostream.hpp Thu May 29 09:56:06 2014 -0700 314.3 @@ -1,5 +1,5 @@ 314.4 /* 314.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 314.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 314.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 314.8 * 314.9 * This code is free software; you can redistribute it and/or modify it 314.10 @@ -53,7 +53,7 @@ 314.11 static const char* do_vsnprintf(char* buffer, size_t buflen, 314.12 const char* format, va_list ap, 314.13 bool add_cr, 314.14 - size_t& result_len); 314.15 + size_t& result_len) ATTRIBUTE_PRINTF(3, 0); 314.16 314.17 public: 314.18 // creation 314.19 @@ -80,10 +80,10 @@ 314.20 void set_position(int pos) { _position = pos; } 314.21 314.22 // printing 314.23 - void print(const char* format, ...); 314.24 - void print_cr(const char* format, ...); 314.25 - void vprint(const char *format, va_list argptr); 314.26 - void vprint_cr(const char* format, va_list argptr); 314.27 + void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 314.28 + void print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 314.29 + void vprint(const char *format, va_list argptr) ATTRIBUTE_PRINTF(2, 0); 314.30 + void vprint_cr(const char* format, va_list argptr) ATTRIBUTE_PRINTF(2, 0); 314.31 void print_raw(const char* str) { write(str, strlen(str)); } 314.32 void print_raw(const char* str, int len) { write(str, len); } 314.33 void print_raw_cr(const char* str) { write(str, strlen(str)); cr(); } 314.34 @@ -275,10 +275,10 @@ 314.35 ~staticBufferStream() {}; 314.36 virtual void write(const char* c, size_t len); 314.37 void flush(); 314.38 - void print(const char* format, ...); 314.39 - void print_cr(const char* format, ...); 314.40 - void vprint(const char *format, va_list argptr); 314.41 - void vprint_cr(const char* format, va_list argptr); 314.42 + void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 314.43 + void print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 314.44 + void vprint(const char *format, va_list argptr) ATTRIBUTE_PRINTF(2, 0); 314.45 + void vprint_cr(const char* format, va_list argptr) ATTRIBUTE_PRINTF(2, 0); 314.46 }; 314.47 314.48 // In the non-fixed buffer case an underlying buffer will be created and
315.1 --- a/src/share/vm/utilities/quickSort.cpp Wed May 28 12:07:21 2014 -0700 315.2 +++ b/src/share/vm/utilities/quickSort.cpp Thu May 29 09:56:06 2014 -0700 315.3 @@ -1,5 +1,5 @@ 315.4 /* 315.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 315.6 + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 315.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 315.8 * 315.9 * This code is free software; you can redistribute it and/or modify it 315.10 @@ -77,7 +77,7 @@ 315.11 for (int i = 0; i < length; i++) { 315.12 tty->print(" %d", array[i]); 315.13 } 315.14 - tty->print_cr(""); 315.15 + tty->cr(); 315.16 } 315.17 315.18 bool QuickSort::compare_arrays(int* actual, int* expected, int length) {
316.1 --- a/src/share/vm/utilities/taskqueue.cpp Wed May 28 12:07:21 2014 -0700 316.2 +++ b/src/share/vm/utilities/taskqueue.cpp Thu May 29 09:56:06 2014 -0700 316.3 @@ -1,5 +1,5 @@ 316.4 /* 316.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 316.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 316.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 316.8 * 316.9 * This code is free software; you can redistribute it and/or modify it 316.10 @@ -30,6 +30,8 @@ 316.11 #include "utilities/stack.inline.hpp" 316.12 #include "utilities/taskqueue.hpp" 316.13 316.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 316.15 + 316.16 #ifdef TRACESPINNING 316.17 uint ParallelTaskTerminator::_total_yields = 0; 316.18 uint ParallelTaskTerminator::_total_spins = 0;
317.1 --- a/src/share/vm/utilities/vmError.cpp Wed May 28 12:07:21 2014 -0700 317.2 +++ b/src/share/vm/utilities/vmError.cpp Thu May 29 09:56:06 2014 -0700 317.3 @@ -42,6 +42,8 @@ 317.4 #include "utilities/top.hpp" 317.5 #include "utilities/vmError.hpp" 317.6 317.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 317.8 + 317.9 // List of environment variables that should be reported in error log file. 317.10 const char *env_list[] = { 317.11 // All platforms 317.12 @@ -358,17 +360,17 @@ 317.13 st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " : 317.14 "(mmap) failed to map "); 317.15 jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); 317.16 - st->print(buf); 317.17 + st->print("%s", buf); 317.18 st->print(" bytes"); 317.19 if (_message != NULL) { 317.20 st->print(" for "); 317.21 - st->print(_message); 317.22 + st->print("%s", _message); 317.23 } 317.24 st->cr(); 317.25 } else { 317.26 if (_message != NULL) 317.27 st->print("# "); 317.28 - st->print_cr(_message); 317.29 + st->print_cr("%s", _message); 317.30 } 317.31 // In error file give some solutions 317.32 if (_verbose) { 317.33 @@ -485,7 +487,7 @@ 317.34 } else { 317.35 st->print("Failed to write core dump. %s", coredump_message); 317.36 } 317.37 - st->print_cr(""); 317.38 + st->cr(); 317.39 st->print_cr("#"); 317.40 317.41 STEP(65, "(printing bug submit message)")
318.1 --- a/src/share/vm/utilities/workgroup.cpp Wed May 28 12:07:21 2014 -0700 318.2 +++ b/src/share/vm/utilities/workgroup.cpp Thu May 29 09:56:06 2014 -0700 318.3 @@ -1,5 +1,5 @@ 318.4 /* 318.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 318.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 318.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 318.8 * 318.9 * This code is free software; you can redistribute it and/or modify it 318.10 @@ -28,6 +28,8 @@ 318.11 #include "runtime/os.hpp" 318.12 #include "utilities/workgroup.hpp" 318.13 318.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 318.15 + 318.16 // Definitions of WorkGang methods. 318.17 318.18 AbstractWorkGang::AbstractWorkGang(const char* name,
319.1 --- a/src/share/vm/utilities/xmlstream.cpp Wed May 28 12:07:21 2014 -0700 319.2 +++ b/src/share/vm/utilities/xmlstream.cpp Thu May 29 09:56:06 2014 -0700 319.3 @@ -1,5 +1,5 @@ 319.4 /* 319.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. 319.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 319.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 319.8 * 319.9 * This code is free software; you can redistribute it and/or modify it 319.10 @@ -336,6 +336,8 @@ 319.11 print_raw_cr(">"); 319.12 } 319.13 319.14 +PRAGMA_DIAG_PUSH 319.15 +PRAGMA_FORMAT_NONLITERAL_IGNORED 319.16 // ------------------------------------------------------------------ 319.17 void xmlStream::va_done(const char* format, va_list ap) { 319.18 char buffer[200]; 319.19 @@ -354,6 +356,7 @@ 319.20 buffer[kind_len] = 0; 319.21 tail(buffer); 319.22 } 319.23 +PRAGMA_DIAG_POP 319.24 319.25 // Output a timestamp attribute. 319.26 void xmlStream::stamp() {
320.1 --- a/src/share/vm/utilities/xmlstream.hpp Wed May 28 12:07:21 2014 -0700 320.2 +++ b/src/share/vm/utilities/xmlstream.hpp Thu May 29 09:56:06 2014 -0700 320.3 @@ -1,5 +1,5 @@ 320.4 /* 320.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. 320.6 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 320.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 320.8 * 320.9 * This code is free software; you can redistribute it and/or modify it 320.10 @@ -80,7 +80,7 @@ 320.11 outputStream* out() { return _out; } 320.12 320.13 // helpers for writing XML elements 320.14 - void va_tag(bool push, const char* format, va_list ap); 320.15 + void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0); 320.16 virtual void see_tag(const char* tag, bool push) NOT_DEBUG({}); 320.17 virtual void pop_tag(const char* tag) NOT_DEBUG({}); 320.18 320.19 @@ -109,29 +109,29 @@ 320.20 int unflushed_count() { return (int)(out()->count() - _last_flush); } 320.21 320.22 // writing complete XML elements 320.23 - void elem(const char* format, ...); 320.24 - void begin_elem(const char* format, ...); 320.25 - void end_elem(const char* format, ...); 320.26 + void elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 320.27 + void begin_elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 320.28 + void end_elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 320.29 void end_elem(); 320.30 - void head(const char* format, ...); 320.31 - void begin_head(const char* format, ...); 320.32 - void end_head(const char* format, ...); 320.33 + void head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 320.34 + void begin_head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 320.35 + void end_head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 320.36 void end_head(); 320.37 - void done(const char* format, ...); // xxx_done event, plus tail 320.38 + void done(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); // xxx_done event, plus tail 320.39 void done_raw(const char * kind); 320.40 void tail(const char* kind); 320.41 320.42 // va_list versions 320.43 - void va_elem(const char* format, va_list ap); 320.44 - void va_begin_elem(const char* format, va_list ap); 320.45 - void va_head(const char* format, va_list ap); 320.46 - void va_begin_head(const char* format, va_list ap); 320.47 - void va_done(const char* format, va_list ap); 320.48 + void va_elem(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); 320.49 + void va_begin_elem(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); 320.50 + void va_head(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); 320.51 + void va_begin_head(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); 320.52 + void va_done(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0); 320.53 320.54 // write text (with quoting of special XML characters <>&'" etc.) 320.55 outputStream* text() { return _text; } 320.56 - void text(const char* format, ...); 320.57 - void va_text(const char* format, va_list ap) { 320.58 + void text(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); 320.59 + void va_text(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0) { 320.60 text()->vprint(format, ap); 320.61 } 320.62
321.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 321.2 +++ b/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java Thu May 29 09:56:06 2014 -0700 321.3 @@ -0,0 +1,92 @@ 321.4 +/* 321.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 321.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 321.7 + * 321.8 + * This code is free software; you can redistribute it and/or modify it 321.9 + * under the terms of the GNU General Public License version 2 only, as 321.10 + * published by the Free Software Foundation. 321.11 + * 321.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 321.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 321.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 321.15 + * version 2 for more details (a copy is included in the LICENSE file that 321.16 + * accompanied this code). 321.17 + * 321.18 + * You should have received a copy of the GNU General Public License version 321.19 + * 2 along with this work; if not, write to the Free Software Foundation, 321.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 321.21 + * 321.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 321.23 + * or visit www.oracle.com if you need additional information or have any 321.24 + * questions. 321.25 + */ 321.26 + 321.27 +/* 321.28 + * @test 321.29 + * @bug 8041458 321.30 + * @summary profiling of arguments in C1 at MethodHandle invoke of intrinsic tries to profile popped argument. 321.31 + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TieredStopAtLevel=3 TestMethodHandleInvokesIntrinsic 321.32 + * 321.33 + */ 321.34 + 321.35 +import java.lang.invoke.*; 321.36 + 321.37 +public class TestMethodHandleInvokesIntrinsic { 321.38 + 321.39 + static final MethodHandle mh_nanoTime; 321.40 + static final MethodHandle mh_getClass; 321.41 + static { 321.42 + MethodHandles.Lookup lookup = MethodHandles.lookup(); 321.43 + MethodType mt = MethodType.methodType(long.class); 321.44 + MethodHandle MH = null; 321.45 + try { 321.46 + MH = lookup.findStatic(System.class, "nanoTime", mt); 321.47 + } catch(NoSuchMethodException nsme) { 321.48 + nsme.printStackTrace(); 321.49 + throw new RuntimeException("TEST FAILED", nsme); 321.50 + } catch(IllegalAccessException iae) { 321.51 + iae.printStackTrace(); 321.52 + throw new RuntimeException("TEST FAILED", iae); 321.53 + } 321.54 + mh_nanoTime = MH; 321.55 + 321.56 + mt = MethodType.methodType(Class.class); 321.57 + MH = null; 321.58 + try { 321.59 + MH = lookup.findVirtual(Object.class, "getClass", mt); 321.60 + } catch(NoSuchMethodException nsme) { 321.61 + nsme.printStackTrace(); 321.62 + throw new RuntimeException("TEST FAILED", nsme); 321.63 + } catch(IllegalAccessException iae) { 321.64 + iae.printStackTrace(); 321.65 + throw new RuntimeException("TEST FAILED", iae); 321.66 + } 321.67 + mh_getClass = MH; 321.68 + } 321.69 + 321.70 + static long m1() throws Throwable { 321.71 + return (long)mh_nanoTime.invokeExact(); 321.72 + } 321.73 + 321.74 + static Class m2(Object o) throws Throwable { 321.75 + return (Class)mh_getClass.invokeExact(o); 321.76 + } 321.77 + 321.78 + static public void main(String[] args) { 321.79 + try { 321.80 + for (int i = 0; i < 20000; i++) { 321.81 + m1(); 321.82 + } 321.83 + TestMethodHandleInvokesIntrinsic o = new TestMethodHandleInvokesIntrinsic(); 321.84 + for (int i = 0; i < 20000; i++) { 321.85 + m2(o); 321.86 + } 321.87 + } catch(Throwable t) { 321.88 + System.out.println("Unexpected exception"); 321.89 + t.printStackTrace(); 321.90 + throw new RuntimeException("TEST FAILED", t); 321.91 + } 321.92 + 321.93 + System.out.println("TEST PASSED"); 321.94 + } 321.95 +}
322.1 --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java Wed May 28 12:07:21 2014 -0700 322.2 +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java Thu May 29 09:56:06 2014 -0700 322.3 @@ -72,7 +72,8 @@ 322.4 "-XX:-UseRTMLocking"); 322.5 // verify that it is off by default 322.6 CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", 322.7 - TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE); 322.8 + TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE, 322.9 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS); 322.10 } 322.11 322.12 public static void main(String args[]) throws Throwable {
323.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 323.2 +++ b/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java Thu May 29 09:56:06 2014 -0700 323.3 @@ -0,0 +1,75 @@ 323.4 +/* 323.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 323.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 323.7 + * 323.8 + * This code is free software; you can redistribute it and/or modify it 323.9 + * under the terms of the GNU General Public License version 2 only, as 323.10 + * published by the Free Software Foundation. 323.11 + * 323.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 323.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 323.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 323.15 + * version 2 for more details (a copy is included in the LICENSE file that 323.16 + * accompanied this code). 323.17 + * 323.18 + * You should have received a copy of the GNU General Public License version 323.19 + * 2 along with this work; if not, write to the Free Software Foundation, 323.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 323.21 + * 323.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 323.23 + * or visit www.oracle.com if you need additional information or have any 323.24 + * questions. 323.25 + */ 323.26 + 323.27 +/* 323.28 + * @test TestEmptyBootstrapMethodsAttr 323.29 + * @bug 8041918 323.30 + * @library /testlibrary 323.31 + * @summary Test empty bootstrap_methods table within BootstrapMethods attribute 323.32 + * @compile TestEmptyBootstrapMethodsAttr.java 323.33 + * @run main TestEmptyBootstrapMethodsAttr 323.34 + */ 323.35 + 323.36 +import java.io.File; 323.37 +import com.oracle.java.testlibrary.*; 323.38 + 323.39 +public class TestEmptyBootstrapMethodsAttr { 323.40 + 323.41 + public static void main(String args[]) throws Throwable { 323.42 + System.out.println("Regression test for bug 8041918"); 323.43 + String jarFile = System.getProperty("test.src") + File.separator + "emptynumbootstrapmethods.jar"; 323.44 + 323.45 + // ====== extract the test case 323.46 + ProcessBuilder pb = new ProcessBuilder(new String[] { JDKToolFinder.getJDKTool("jar"), "xvf", jarFile } ); 323.47 + OutputAnalyzer output = new OutputAnalyzer(pb.start()); 323.48 + output.shouldHaveExitValue(0); 323.49 + 323.50 + // Test case #1: 323.51 + // Try loading class with empty bootstrap_methods table where no 323.52 + // other attributes are following BootstrapMethods in attribute table. 323.53 + String className = "emptynumbootstrapmethods1"; 323.54 + 323.55 + // ======= execute test case #1 323.56 + // Expect a lack of main method, this implies that the class loaded correctly 323.57 + // with an empty bootstrap_methods and did not generate a ClassFormatError. 323.58 + pb = ProcessTools.createJavaProcessBuilder("-cp", ".", className); 323.59 + output = new OutputAnalyzer(pb.start()); 323.60 + output.shouldNotContain("java.lang.ClassFormatError"); 323.61 + output.shouldContain("Main method not found in class " + className); 323.62 + output.shouldHaveExitValue(1); 323.63 + 323.64 + // Test case #2: 323.65 + // Try loading class with empty bootstrap_methods table where an 323.66 + // AnnotationDefault attribute follows the BootstrapMethods in the attribute table. 323.67 + className = "emptynumbootstrapmethods2"; 323.68 + 323.69 + // ======= execute test case #2 323.70 + // Expect a lack of main method, this implies that the class loaded correctly 323.71 + // with an empty bootstrap_methods and did not generate ClassFormatError. 323.72 + pb = ProcessTools.createJavaProcessBuilder("-cp", ".", className); 323.73 + output = new OutputAnalyzer(pb.start()); 323.74 + output.shouldNotContain("java.lang.ClassFormatError"); 323.75 + output.shouldContain("Main method not found in class " + className); 323.76 + output.shouldHaveExitValue(1); 323.77 + } 323.78 +}
324.1 Binary file test/runtime/classFileParserBug/emptynumbootstrapmethods.jar has changed
325.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 325.2 +++ b/test/runtime/classFileParserBug/emptynumbootstrapmethods1.jcod Thu May 29 09:56:06 2014 -0700 325.3 @@ -0,0 +1,68 @@ 325.4 +/* 325.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 325.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325.7 + * 325.8 + * This code is free software; you can redistribute it and/or modify it 325.9 + * under the terms of the GNU General Public License version 2 only, as 325.10 + * published by the Free Software Foundation. 325.11 + * 325.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 325.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325.15 + * version 2 for more details (a copy is included in the LICENSE file that 325.16 + * accompanied this code). 325.17 + * 325.18 + * You should have received a copy of the GNU General Public License version 325.19 + * 2 along with this work; if not, write to the Free Software Foundation, 325.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325.21 + * 325.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325.23 + * or visit www.oracle.com if you need additional information or have any 325.24 + * questions. 325.25 + */ 325.26 + 325.27 +/* 325.28 + * This test contains a BootstrapMethods attribute with an empty 325.29 + * bootstrap_methods table. This yields a BootstrapMethods 325.30 + * attribute length of 2 and should not cause a 325.31 + * java.lang.ClassFormatError to be thrown. 325.32 + */ 325.33 +class emptynumbootstrapmethods1 { 325.34 + 0xCAFEBABE; 325.35 + 0; // minor version 325.36 + 51; // version 325.37 + [12] { // Constant Pool 325.38 + ; // first element is empty 325.39 + class #2; // #1 at 0x0A 325.40 + Utf8 "emptynumbootstrapmethods1"; // #2 at 0x0D 325.41 + class #4; // #3 at 0x1F 325.42 + Utf8 "java/lang/Object"; // #4 at 0x22 325.43 + MethodHandle 5b #9; // #5 at 0x35 325.44 + NameAndType #7 #8; // #6 at 0x39 325.45 + Utf8 "equals"; // #7 at 0x3E 325.46 + Utf8 "(Ljava/lang/Object;)Z"; // #8 at 0x47 325.47 + Method #3 #6; // #9 at 0x5F 325.48 + Utf8 "equalsx"; // #10 at 0x3E 325.49 + Utf8 "BootstrapMethods"; // #11 at 0x69 325.50 + } // Constant Pool 325.51 + 325.52 + 0x0001; // access 325.53 + #1;// this_cpx 325.54 + #3;// super_cpx 325.55 + 325.56 + [0] { // Interfaces 325.57 + } // Interfaces 325.58 + 325.59 + [0] { // fields 325.60 + } // fields 325.61 + 325.62 + [0] { // methods 325.63 + } // methods 325.64 + 325.65 + [1] { // Attributes 325.66 + Attr(#11, 2) { // BootstrapMethods at 0x8A 325.67 + [0] { // bootstrap_methods 325.68 + } 325.69 + } // end BootstrapMethods 325.70 + } // Attributes 325.71 +} // end class atrbsm00101m10p
326.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 326.2 +++ b/test/runtime/classFileParserBug/emptynumbootstrapmethods2.jcod Thu May 29 09:56:06 2014 -0700 326.3 @@ -0,0 +1,89 @@ 326.4 +/* 326.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 326.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 326.7 + * 326.8 + * This code is free software; you can redistribute it and/or modify it 326.9 + * under the terms of the GNU General Public License version 2 only, as 326.10 + * published by the Free Software Foundation. 326.11 + * 326.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 326.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 326.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 326.15 + * version 2 for more details (a copy is included in the LICENSE file that 326.16 + * accompanied this code). 326.17 + * 326.18 + * You should have received a copy of the GNU General Public License version 326.19 + * 2 along with this work; if not, write to the Free Software Foundation, 326.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 326.21 + * 326.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 326.23 + * or visit www.oracle.com if you need additional information or have any 326.24 + * questions. 326.25 + */ 326.26 + 326.27 +/* 326.28 + * This test contains a BootstrapMethods attribute with an empty 326.29 + * bootstrap_methods table. This yields a BootstrapMethods 326.30 + * attribute length of 2 and should not cause a 326.31 + * java.lang.ClassFormatError to be thrown. To ensure that an empty 326.32 + * bootstrap_methods table is parsed correctly, another attribute, 326.33 + * AnnotationDefault, follows the BootstrapMethods attribute in 326.34 + * the attribute table. 326.35 + */ 326.36 + 326.37 +class emptynumbootstrapmethods2 { 326.38 + 0xCAFEBABE; 326.39 + 0; // minor version 326.40 + 51; // version 326.41 + [14] { // Constant Pool 326.42 + ; // first element is empty 326.43 + class #2; // #1 at 0x0A 326.44 + Utf8 "emptynumbootstrapmethods2"; // #2 at 0x0D 326.45 + class #4; // #3 at 0x1F 326.46 + Utf8 "java/lang/Object"; // #4 at 0x22 326.47 + MethodHandle 5b #9; // #5 at 0x35 326.48 + NameAndType #7 #8; // #6 at 0x39 326.49 + Utf8 "equals"; // #7 at 0x3E 326.50 + Utf8 "(Ljava/lang/Object;)Z"; // #8 at 0x47 326.51 + Method #3 #6; // #9 at 0x5F 326.52 + Utf8 "equalsx"; // #10 at 0x3E 326.53 + Utf8 "BootstrapMethods"; // #11 at 0x69 326.54 + Utf8 "AnnotationDefault"; // #12 326.55 + Utf8 "LAnnotationDefaultI;"; // #13 326.56 + } // Constant Pool 326.57 + 326.58 + 0x0001; // access 326.59 + #1;// this_cpx 326.60 + #3;// super_cpx 326.61 + 326.62 + [0] { // Interfaces 326.63 + } // Interfaces 326.64 + 326.65 + [0] { // fields 326.66 + } // fields 326.67 + 326.68 + [0] { // methods 326.69 + } // methods 326.70 + 326.71 + [2] { // Attributes 326.72 + Attr(#11, 2) { // BootstrapMethods at 0x8A 326.73 + [0] { // bootstrap_methods 326.74 + } 326.75 + } // end BootstrapMethods 326.76 + ; 326.77 + Attr(#12) { // AnnotationDefault 326.78 + [] { // type annotations 326.79 + { // type annotation 326.80 + 0x00; // target_type 326.81 + 0x00; // type_parameter_index 326.82 + []b { // type_path 326.83 + } 326.84 + 326.85 + #13; // type_index 326.86 + [] { // element_value_pairs 326.87 + } // element_value_pairs 326.88 + } // type annotation 326.89 + } // type annotations 326.90 + } // end AnnotationDefault 326.91 + } // Attributes 326.92 +} // end class atrbsm00101m10p