Merge hs25.20-b16

Fri, 23 May 2014 14:12:52 -0700

author
amurillo
date
Fri, 23 May 2014 14:12:52 -0700
changeset 6684
50e5d560367b
parent 6672
fb9d124d9192
parent 6683
7f77d17d0f13
child 6685
c36ef639e6d3

Merge

     1.1 --- a/agent/src/os/linux/libproc.h	Wed May 21 10:56:41 2014 -0700
     1.2 +++ b/agent/src/os/linux/libproc.h	Fri May 23 14:12:52 2014 -0700
     1.3 @@ -34,19 +34,7 @@
     1.4  #include "libproc_md.h"
     1.5  #endif
     1.6  
     1.7 -#if defined(sparc) || defined(sparcv9)
     1.8 -/*
     1.9 -  If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
    1.10 -  otherwise it should be from /usr/include/asm-sparc
    1.11 -  These two files define pt_regs structure differently
    1.12 -*/
    1.13 -#ifdef _LP64
    1.14 -#include "asm-sparc64/ptrace.h"
    1.15 -#else
    1.16 -#include "asm-sparc/ptrace.h"
    1.17 -#endif
    1.18 -
    1.19 -#endif //sparc or sparcv9
    1.20 +#include <linux/ptrace.h>
    1.21  
    1.22  /************************************************************************************
    1.23  
     2.1 --- a/make/hotspot_version	Wed May 21 10:56:41 2014 -0700
     2.2 +++ b/make/hotspot_version	Fri May 23 14:12:52 2014 -0700
     2.3 @@ -35,7 +35,7 @@
     2.4  
     2.5  HS_MAJOR_VER=25
     2.6  HS_MINOR_VER=20
     2.7 -HS_BUILD_NUMBER=15
     2.8 +HS_BUILD_NUMBER=16
     2.9  
    2.10  JDK_MAJOR_VER=1
    2.11  JDK_MINOR_VER=8
     3.1 --- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Wed May 21 10:56:41 2014 -0700
     3.2 +++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Fri May 23 14:12:52 2014 -0700
     3.3 @@ -1,5 +1,5 @@
     3.4  /*
     3.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3.7   * Copyright 2012, 2014 SAP AG. All rights reserved.
     3.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.9   *
    3.10 @@ -149,7 +149,7 @@
    3.11  }
    3.12  
    3.13  void VM_Version::print_features() {
    3.14 -  tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), get_cache_line_size());
    3.15 +  tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size());
    3.16  }
    3.17  
    3.18  #ifdef COMPILER2
     4.1 --- a/src/cpu/sparc/vm/frame_sparc.hpp	Wed May 21 10:56:41 2014 -0700
     4.2 +++ b/src/cpu/sparc/vm/frame_sparc.hpp	Fri May 23 14:12:52 2014 -0700
     4.3 @@ -259,8 +259,8 @@
     4.4  
     4.5    // next two fns read and write Lmonitors value,
     4.6   private:
     4.7 -  BasicObjectLock* interpreter_frame_monitors()           const  { return *interpreter_frame_monitors_addr(); }
     4.8 -  void interpreter_frame_set_monitors(BasicObjectLock* monitors) {        *interpreter_frame_monitors_addr() = monitors; }
     4.9 +  BasicObjectLock* interpreter_frame_monitors() const;
    4.10 +  void interpreter_frame_set_monitors(BasicObjectLock* monitors);
    4.11  #else
    4.12   public:
    4.13    inline interpreterState get_interpreterState() const {
     5.1 --- a/src/cpu/sparc/vm/frame_sparc.inline.hpp	Wed May 21 10:56:41 2014 -0700
     5.2 +++ b/src/cpu/sparc/vm/frame_sparc.inline.hpp	Fri May 23 14:12:52 2014 -0700
     5.3 @@ -226,6 +226,13 @@
     5.4    return (Method**)sp_addr_at( Lmethod->sp_offset_in_saved_window());
     5.5  }
     5.6  
     5.7 +inline BasicObjectLock* frame::interpreter_frame_monitors() const {
     5.8 +  return *interpreter_frame_monitors_addr();
     5.9 +}
    5.10 +
    5.11 +inline void frame::interpreter_frame_set_monitors(BasicObjectLock* monitors) {
    5.12 +  *interpreter_frame_monitors_addr() = monitors;
    5.13 +}
    5.14  
    5.15  // Constant pool cache
    5.16  
     6.1 --- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Wed May 21 10:56:41 2014 -0700
     6.2 +++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Fri May 23 14:12:52 2014 -0700
     6.3 @@ -83,7 +83,7 @@
     6.4   private:
     6.5  
     6.6  #ifdef PRODUCT
     6.7 -#define inc_counter_np(a,b,c) (0)
     6.8 +#define inc_counter_np(a,b,c)
     6.9  #else
    6.10  #define inc_counter_np(counter, t1, t2) \
    6.11    BLOCK_COMMENT("inc_counter " #counter); \
    6.12 @@ -1055,7 +1055,7 @@
    6.13                                                Label& L_loop, bool use_prefetch, bool use_bis);
    6.14  
    6.15    void disjoint_copy_core(Register from, Register to, Register count, int log2_elem_size,
    6.16 -                          int iter_size, CopyLoopFunc copy_loop_func) {
    6.17 +                          int iter_size, StubGenerator::CopyLoopFunc copy_loop_func) {
    6.18      Label L_copy;
    6.19  
    6.20      assert(log2_elem_size <= 3, "the following code should be changed");
    6.21 @@ -1206,7 +1206,7 @@
    6.22      __ inc(from, 8);
    6.23      __ sllx(O3, left_shift,  O3);
    6.24  
    6.25 -    disjoint_copy_core(from, to, count, log2_elem_size, 16, copy_16_bytes_shift_loop);
    6.26 +    disjoint_copy_core(from, to, count, log2_elem_size, 16, &StubGenerator::copy_16_bytes_shift_loop);
    6.27  
    6.28      __ inccc(count, count_dec>>1 ); // + 8 bytes
    6.29      __ brx(Assembler::negative, true, Assembler::pn, L_copy_last_bytes);
    6.30 @@ -2085,7 +2085,7 @@
    6.31        __ dec(count, 4);   // The cmp at the beginning guaranty count >= 4
    6.32        __ sllx(O3, 32,  O3);
    6.33  
    6.34 -      disjoint_copy_core(from, to, count, 2, 16, copy_16_bytes_loop);
    6.35 +      disjoint_copy_core(from, to, count, 2, 16, &StubGenerator::copy_16_bytes_loop);
    6.36  
    6.37        __ br(Assembler::always, false, Assembler::pt, L_copy_4_bytes);
    6.38        __ delayed()->inc(count, 4); // restore 'count'
    6.39 @@ -2366,7 +2366,7 @@
    6.40      // count >= 0 (original count - 8)
    6.41      __ mov(from, from64);
    6.42  
    6.43 -    disjoint_copy_core(from64, to64, count, 3, 64, copy_64_bytes_loop);
    6.44 +    disjoint_copy_core(from64, to64, count, 3, 64, &StubGenerator::copy_64_bytes_loop);
    6.45  
    6.46        // Restore O4(offset0), O5(offset8)
    6.47        __ sub(from64, from, offset0);
     7.1 --- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Wed May 21 10:56:41 2014 -0700
     7.2 +++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri May 23 14:12:52 2014 -0700
     7.3 @@ -318,22 +318,22 @@
     7.4            tty->print("BIS");
     7.5        }
     7.6        if (AllocatePrefetchLines > 1) {
     7.7 -        tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
     7.8 +        tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
     7.9        } else {
    7.10 -        tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
    7.11 +        tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
    7.12        }
    7.13      }
    7.14      if (PrefetchCopyIntervalInBytes > 0) {
    7.15 -      tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
    7.16 +      tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
    7.17      }
    7.18      if (PrefetchScanIntervalInBytes > 0) {
    7.19 -      tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
    7.20 +      tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
    7.21      }
    7.22      if (PrefetchFieldsAhead > 0) {
    7.23 -      tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
    7.24 +      tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
    7.25      }
    7.26      if (ContendedPaddingWidth > 0) {
    7.27 -      tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
    7.28 +      tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
    7.29      }
    7.30    }
    7.31  #endif // PRODUCT
     8.1 --- a/src/cpu/x86/vm/assembler_x86.cpp	Wed May 21 10:56:41 2014 -0700
     8.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp	Fri May 23 14:12:52 2014 -0700
     8.3 @@ -1,5 +1,5 @@
     8.4  /*
     8.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     8.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     8.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8   *
     8.9   * This code is free software; you can redistribute it and/or modify it
    8.10 @@ -522,11 +522,11 @@
    8.11      // these asserts are somewhat nonsensical
    8.12  #ifndef _LP64
    8.13      assert(which == imm_operand || which == disp32_operand,
    8.14 -           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
    8.15 +           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
    8.16  #else
    8.17      assert((which == call32_operand || which == imm_operand) && is_64bit ||
    8.18             which == narrow_oop_operand && !is_64bit,
    8.19 -           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
    8.20 +           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
    8.21  #endif // _LP64
    8.22      return ip;
    8.23  
     9.1 --- a/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Wed May 21 10:56:41 2014 -0700
     9.2 +++ b/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Fri May 23 14:12:52 2014 -0700
     9.3 @@ -1,5 +1,5 @@
     9.4  /*
     9.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     9.6 + * Copyright (c) 2005, 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 @@ -95,7 +95,7 @@
    9.11  
    9.12  #ifndef PRODUCT
    9.13          if (TraceFPURegisterUsage) {
    9.14 -          tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->print_cr("");
    9.15 +          tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->cr();
    9.16          }
    9.17  #endif
    9.18        }
    10.1 --- a/src/cpu/x86/vm/compiledIC_x86.cpp	Wed May 21 10:56:41 2014 -0700
    10.2 +++ b/src/cpu/x86/vm/compiledIC_x86.cpp	Fri May 23 14:12:52 2014 -0700
    10.3 @@ -1,5 +1,5 @@
    10.4  /*
    10.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    10.6 + * Copyright (c) 1997, 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 @@ -122,7 +122,7 @@
   10.11    if (TraceICs) {
   10.12      ResourceMark rm;
   10.13      tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
   10.14 -                  instruction_address(),
   10.15 +                  p2i(instruction_address()),
   10.16                    callee->name_and_sig_as_C_string());
   10.17    }
   10.18  
    11.1 --- a/src/cpu/x86/vm/frame_x86.cpp	Wed May 21 10:56:41 2014 -0700
    11.2 +++ b/src/cpu/x86/vm/frame_x86.cpp	Fri May 23 14:12:52 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 @@ -48,6 +48,7 @@
   11.11  }
   11.12  #endif
   11.13  
   11.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   11.15  
   11.16  // Profiling/safepoint support
   11.17  
    12.1 --- a/src/cpu/x86/vm/interpreter_x86_64.cpp	Wed May 21 10:56:41 2014 -0700
    12.2 +++ b/src/cpu/x86/vm/interpreter_x86_64.cpp	Fri May 23 14:12:52 2014 -0700
    12.3 @@ -1,5 +1,5 @@
    12.4  /*
    12.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    12.6 + * Copyright (c) 2003, 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 @@ -51,6 +51,7 @@
   12.11  
   12.12  #define __ _masm->
   12.13  
   12.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   12.15  
   12.16  #ifdef _WIN64
   12.17  address AbstractInterpreterGenerator::generate_slow_signature_handler() {
    13.1 --- a/src/cpu/x86/vm/macroAssembler_x86.cpp	Wed May 21 10:56:41 2014 -0700
    13.2 +++ b/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri May 23 14:12:52 2014 -0700
    13.3 @@ -1,5 +1,5 @@
    13.4  /*
    13.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    13.6 + * Copyright (c) 1997, 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 @@ -55,6 +55,7 @@
   13.11  
   13.12  #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
   13.13  
   13.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   13.15  
   13.16  #ifdef ASSERT
   13.17  bool AbstractAssembler::pd_check_instruction_mark() { return true; }
    14.1 --- a/src/cpu/x86/vm/methodHandles_x86.cpp	Wed May 21 10:56:41 2014 -0700
    14.2 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Fri May 23 14:12:52 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 @@ -29,6 +29,8 @@
   14.11  #include "memory/allocation.inline.hpp"
   14.12  #include "prims/methodHandles.hpp"
   14.13  
   14.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   14.15 +
   14.16  #define __ _masm->
   14.17  
   14.18  #ifdef PRODUCT
    15.1 --- a/src/cpu/x86/vm/nativeInst_x86.cpp	Wed May 21 10:56:41 2014 -0700
    15.2 +++ b/src/cpu/x86/vm/nativeInst_x86.cpp	Fri May 23 14:12:52 2014 -0700
    15.3 @@ -1,5 +1,5 @@
    15.4  /*
    15.5 - * Copyright (c) 1997, 2010, 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 @@ -35,6 +35,8 @@
   15.11  #include "c1/c1_Runtime1.hpp"
   15.12  #endif
   15.13  
   15.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   15.15 +
   15.16  void NativeInstruction::wrote(int offset) {
   15.17    ICache::invalidate_word(addr_at(offset));
   15.18  }
    16.1 --- a/src/cpu/x86/vm/vm_version_x86.cpp	Wed May 21 10:56:41 2014 -0700
    16.2 +++ b/src/cpu/x86/vm/vm_version_x86.cpp	Fri May 23 14:12:52 2014 -0700
    16.3 @@ -1,5 +1,5 @@
    16.4  /*
    16.5 - * Copyright (c) 1997, 2013, 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 @@ -925,16 +925,16 @@
   16.11    if (PrintMiscellaneous && Verbose) {
   16.12      tty->print_cr("Logical CPUs per core: %u",
   16.13                    logical_processors_per_package());
   16.14 -    tty->print("UseSSE=%d",UseSSE);
   16.15 +    tty->print("UseSSE=%d", (int) UseSSE);
   16.16      if (UseAVX > 0) {
   16.17 -      tty->print("  UseAVX=%d",UseAVX);
   16.18 +      tty->print("  UseAVX=%d", (int) UseAVX);
   16.19      }
   16.20      if (UseAES) {
   16.21        tty->print("  UseAES=1");
   16.22      }
   16.23  #ifdef COMPILER2
   16.24      if (MaxVectorSize > 0) {
   16.25 -      tty->print("  MaxVectorSize=%d", MaxVectorSize);
   16.26 +      tty->print("  MaxVectorSize=%d", (int) MaxVectorSize);
   16.27      }
   16.28  #endif
   16.29      tty->cr();
   16.30 @@ -957,23 +957,23 @@
   16.31          }
   16.32        }
   16.33        if (AllocatePrefetchLines > 1) {
   16.34 -        tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
   16.35 +        tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
   16.36        } else {
   16.37 -        tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
   16.38 +        tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
   16.39        }
   16.40      }
   16.41  
   16.42      if (PrefetchCopyIntervalInBytes > 0) {
   16.43 -      tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
   16.44 +      tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
   16.45      }
   16.46      if (PrefetchScanIntervalInBytes > 0) {
   16.47 -      tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
   16.48 +      tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
   16.49      }
   16.50      if (PrefetchFieldsAhead > 0) {
   16.51 -      tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
   16.52 +      tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
   16.53      }
   16.54      if (ContendedPaddingWidth > 0) {
   16.55 -      tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
   16.56 +      tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
   16.57      }
   16.58    }
   16.59  #endif // !PRODUCT
    17.1 --- a/src/cpu/x86/vm/vtableStubs_x86_32.cpp	Wed May 21 10:56:41 2014 -0700
    17.2 +++ b/src/cpu/x86/vm/vtableStubs_x86_32.cpp	Fri May 23 14:12:52 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 @@ -118,7 +118,7 @@
   17.11  
   17.12    if (PrintMiscellaneous && (WizardMode || Verbose)) {
   17.13      tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d",
   17.14 -                  vtable_index, s->entry_point(),
   17.15 +                  vtable_index, p2i(s->entry_point()),
   17.16                    (int)(s->code_end() - s->entry_point()),
   17.17                    (int)(s->code_end() - __ pc()));
   17.18    }
   17.19 @@ -199,7 +199,7 @@
   17.20  
   17.21    if (PrintMiscellaneous && (WizardMode || Verbose)) {
   17.22      tty->print_cr("itable #%d at "PTR_FORMAT"[%d] left over: %d",
   17.23 -                  itable_index, s->entry_point(),
   17.24 +                  itable_index, p2i(s->entry_point()),
   17.25                    (int)(s->code_end() - s->entry_point()),
   17.26                    (int)(s->code_end() - __ pc()));
   17.27    }
    18.1 --- a/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Wed May 21 10:56:41 2014 -0700
    18.2 +++ b/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Fri May 23 14:12:52 2014 -0700
    18.3 @@ -1,5 +1,5 @@
    18.4  /*
    18.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
    18.6 + * Copyright (c) 2003, 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 @@ -35,6 +35,8 @@
   18.11  #include "opto/runtime.hpp"
   18.12  #endif
   18.13  
   18.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   18.15 +
   18.16  // machine-dependent part of VtableStubs: create VtableStub of correct size and
   18.17  // initialize its code
   18.18  
    19.1 --- a/src/os/bsd/vm/decoder_machO.cpp	Wed May 21 10:56:41 2014 -0700
    19.2 +++ b/src/os/bsd/vm/decoder_machO.cpp	Fri May 23 14:12:52 2014 -0700
    19.3 @@ -1,5 +1,5 @@
    19.4  /*
    19.5 - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    19.6 + * Copyright (c) 2011, 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 @@ -53,7 +53,7 @@
   19.11    struct symtab_command * symt = (struct symtab_command *)
   19.12      mach_find_command((struct mach_header_64 *)mach_base, LC_SYMTAB);
   19.13    if (symt == NULL) {
   19.14 -    DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", mach_base));
   19.15 +    DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", p2i(mach_base)));
   19.16      return false;
   19.17    }
   19.18    uint32_t off = symt->symoff;          /* symbol table offset (within this mach file) */
    20.1 --- a/src/os/bsd/vm/os_bsd.cpp	Wed May 21 10:56:41 2014 -0700
    20.2 +++ b/src/os/bsd/vm/os_bsd.cpp	Fri May 23 14:12:52 2014 -0700
    20.3 @@ -1,5 +1,5 @@
    20.4  /*
    20.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    20.6 + * Copyright (c) 1999, 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 @@ -123,6 +123,9 @@
   20.11  #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
   20.12  
   20.13  #define LARGEPAGES_BIT (1 << 6)
   20.14 +
   20.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   20.16 +
   20.17  ////////////////////////////////////////////////////////////////////////////////
   20.18  // global variables
   20.19  julong os::Bsd::_physical_memory = 0;
   20.20 @@ -2390,7 +2393,6 @@
   20.21                          (!FLAG_IS_DEFAULT(UseLargePages) ||
   20.22                           !FLAG_IS_DEFAULT(LargePageSizeInBytes)
   20.23                          );
   20.24 -  char msg[128];
   20.25  
   20.26    // Create a large shared memory region to attach to based on size.
   20.27    // Currently, size is the total size of the heap
   20.28 @@ -2411,8 +2413,7 @@
   20.29       //            coalesce into large pages. Try to reserve large pages when
   20.30       //            the system is still "fresh".
   20.31       if (warn_on_failure) {
   20.32 -       jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
   20.33 -       warning(msg);
   20.34 +       warning("Failed to reserve shared memory (errno = %d).", errno);
   20.35       }
   20.36       return NULL;
   20.37    }
   20.38 @@ -2429,8 +2430,7 @@
   20.39  
   20.40    if ((intptr_t)addr == -1) {
   20.41       if (warn_on_failure) {
   20.42 -       jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
   20.43 -       warning(msg);
   20.44 +       warning("Failed to attach shared memory (errno = %d).", err);
   20.45       }
   20.46       return NULL;
   20.47    }
   20.48 @@ -3929,6 +3929,7 @@
   20.49    return true;
   20.50  }
   20.51  
   20.52 +ATTRIBUTE_PRINTF(3, 0)
   20.53  int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
   20.54    return ::vsnprintf(buf, count, format, args);
   20.55  }
    21.1 --- a/src/os/bsd/vm/perfMemory_bsd.cpp	Wed May 21 10:56:41 2014 -0700
    21.2 +++ b/src/os/bsd/vm/perfMemory_bsd.cpp	Fri May 23 14:12:52 2014 -0700
    21.3 @@ -1,5 +1,5 @@
    21.4  /*
    21.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
    21.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
    21.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    21.8   *
    21.9   * This code is free software; you can redistribute it and/or modify it
   21.10 @@ -925,7 +925,7 @@
   21.11  
   21.12    if (PerfTraceMemOps) {
   21.13      tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
   21.14 -               INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
   21.15 +               INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
   21.16    }
   21.17  }
   21.18  
    22.1 --- a/src/os/linux/vm/os_linux.cpp	Wed May 21 10:56:41 2014 -0700
    22.2 +++ b/src/os/linux/vm/os_linux.cpp	Fri May 23 14:12:52 2014 -0700
    22.3 @@ -101,6 +101,8 @@
    22.4  # include <inttypes.h>
    22.5  # include <sys/ioctl.h>
    22.6  
    22.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
    22.8 +
    22.9  // if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
   22.10  // getrusage() is prepared to handle the associated failure.
   22.11  #ifndef RUSAGE_THREAD
   22.12 @@ -2137,7 +2139,7 @@
   22.13    // Print warning if unsafe chroot environment detected
   22.14    if (unsafe_chroot_detected) {
   22.15      st->print("WARNING!! ");
   22.16 -    st->print_cr(unstable_chroot_error);
   22.17 +    st->print_cr("%s", unstable_chroot_error);
   22.18    }
   22.19  
   22.20    os::Linux::print_libversion_info(st);
   22.21 @@ -2198,8 +2200,8 @@
   22.22  void os::Linux::print_libversion_info(outputStream* st) {
   22.23    // libc, pthread
   22.24    st->print("libc:");
   22.25 -  st->print(os::Linux::glibc_version()); st->print(" ");
   22.26 -  st->print(os::Linux::libpthread_version()); st->print(" ");
   22.27 +  st->print("%s ", os::Linux::glibc_version());
   22.28 +  st->print("%s ", os::Linux::libpthread_version());
   22.29    if (os::Linux::is_LinuxThreads()) {
   22.30       st->print("(%s stack)", os::Linux::is_floating_stack() ? "floating" : "fixed");
   22.31    }
   22.32 @@ -3415,7 +3417,7 @@
   22.33       //            the system is still "fresh".
   22.34       if (warn_on_failure) {
   22.35         jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
   22.36 -       warning(msg);
   22.37 +       warning("%s", msg);
   22.38       }
   22.39       return NULL;
   22.40    }
   22.41 @@ -3433,7 +3435,7 @@
   22.42    if ((intptr_t)addr == -1) {
   22.43       if (warn_on_failure) {
   22.44         jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
   22.45 -       warning(msg);
   22.46 +       warning("%s", msg);
   22.47       }
   22.48       return NULL;
   22.49    }
   22.50 @@ -3453,7 +3455,7 @@
   22.51      char msg[128];
   22.52      jio_snprintf(msg, sizeof(msg), "Failed to reserve large pages memory req_addr: "
   22.53          PTR_FORMAT " bytes: " SIZE_FORMAT " (errno = %d).", req_addr, bytes, error);
   22.54 -    warning(msg);
   22.55 +    warning("%s", msg);
   22.56    }
   22.57  }
   22.58  
   22.59 @@ -5392,6 +5394,8 @@
   22.60  //  -1 on error.
   22.61  //
   22.62  
   22.63 +PRAGMA_DIAG_PUSH
   22.64 +PRAGMA_FORMAT_NONLITERAL_IGNORED
   22.65  static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
   22.66    static bool proc_task_unchecked = true;
   22.67    static const char *proc_stat_path = "/proc/%d/stat";
   22.68 @@ -5453,6 +5457,7 @@
   22.69      return (jlong)user_time * (1000000000 / clock_tics_per_sec);
   22.70    }
   22.71  }
   22.72 +PRAGMA_DIAG_POP
   22.73  
   22.74  void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
   22.75    info_ptr->max_value = ALL_64_BITS;       // will not wrap in less than 64 bits
    23.1 --- a/src/os/linux/vm/perfMemory_linux.cpp	Wed May 21 10:56:41 2014 -0700
    23.2 +++ b/src/os/linux/vm/perfMemory_linux.cpp	Fri May 23 14:12:52 2014 -0700
    23.3 @@ -931,7 +931,7 @@
    23.4  
    23.5    if (PerfTraceMemOps) {
    23.6      tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
    23.7 -               INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
    23.8 +               INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
    23.9    }
   23.10  }
   23.11  
    24.1 --- a/src/os/posix/vm/os_posix.cpp	Wed May 21 10:56:41 2014 -0700
    24.2 +++ b/src/os/posix/vm/os_posix.cpp	Fri May 23 14:12:52 2014 -0700
    24.3 @@ -1,5 +1,5 @@
    24.4  /*
    24.5 -* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    24.6 +* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    24.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    24.8   *
    24.9   * This code is free software; you can redistribute it and/or modify it
   24.10 @@ -35,6 +35,8 @@
   24.11  #include <pthread.h>
   24.12  #include <signal.h>
   24.13  
   24.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   24.15 +
   24.16  // Todo: provide a os::get_max_process_id() or similar. Number of processes
   24.17  // may have been configured, can be read more accurately from proc fs etc.
   24.18  #ifndef MAX_PID
   24.19 @@ -191,10 +193,10 @@
   24.20    st->print("uname:");
   24.21    struct utsname name;
   24.22    uname(&name);
   24.23 -  st->print(name.sysname); st->print(" ");
   24.24 -  st->print(name.release); st->print(" ");
   24.25 -  st->print(name.version); st->print(" ");
   24.26 -  st->print(name.machine);
   24.27 +  st->print("%s ", name.sysname);
   24.28 +  st->print("%s ", name.release);
   24.29 +  st->print("%s ", name.version);
   24.30 +  st->print("%s", name.machine);
   24.31    st->cr();
   24.32  }
   24.33  
   24.34 @@ -552,7 +554,7 @@
   24.35  void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) {
   24.36    char buf[NUM_IMPORTANT_SIGS + 1];
   24.37    os::Posix::describe_signal_set_short(set, buf, sizeof(buf));
   24.38 -  st->print(buf);
   24.39 +  st->print("%s", buf);
   24.40  }
   24.41  
   24.42  // Writes one-line description of a combination of sigaction.sa_flags into a user
   24.43 @@ -612,7 +614,7 @@
   24.44  void os::Posix::print_sa_flags(outputStream* st, int flags) {
   24.45    char buffer[0x100];
   24.46    os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer));
   24.47 -  st->print(buffer);
   24.48 +  st->print("%s", buffer);
   24.49  }
   24.50  
   24.51  // Helper function for os::Posix::print_siginfo_...():
    25.1 --- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Wed May 21 10:56:41 2014 -0700
    25.2 +++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Fri May 23 14:12:52 2014 -0700
    25.3 @@ -1,5 +1,5 @@
    25.4  /*
    25.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    25.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    25.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    25.8   *
    25.9   * This code is free software; you can redistribute it and/or modify it
   25.10 @@ -276,6 +276,8 @@
   25.11  # endif
   25.12  #endif
   25.13  
   25.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   25.15 +
   25.16  address os::current_stack_pointer() {
   25.17  #if defined(__clang__) || defined(__llvm__)
   25.18    register void *esp;
    26.1 --- a/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp	Wed May 21 10:56:41 2014 -0700
    26.2 +++ b/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp	Fri May 23 14:12:52 2014 -0700
    26.3 @@ -78,12 +78,12 @@
    26.4    __asm__ volatile(
    26.5      "1: \n\t"
    26.6      " ldx    [%2], %%o2\n\t"
    26.7 -    " add    %0, %%o2, %%o3\n\t"
    26.8 +    " add    %1, %%o2, %%o3\n\t"
    26.9      " casx   [%2], %%o2, %%o3\n\t"
   26.10      " cmp    %%o2, %%o3\n\t"
   26.11      " bne    %%xcc, 1b\n\t"
   26.12      "  nop\n\t"
   26.13 -    " add    %0, %%o2, %0\n\t"
   26.14 +    " add    %1, %%o2, %0\n\t"
   26.15      : "=r" (rv)
   26.16      : "r" (add_value), "r" (dest)
   26.17      : "memory", "o2", "o3");
    27.1 --- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed May 21 10:56:41 2014 -0700
    27.2 +++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Fri May 23 14:12:52 2014 -0700
    27.3 @@ -302,29 +302,30 @@
    27.4    if (context == NULL) return;
    27.5  
    27.6    ucontext_t *uc = (ucontext_t*)context;
    27.7 +  sigcontext* sc = (sigcontext*)context;
    27.8    intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
    27.9  
   27.10    st->print_cr("Register to memory mapping:");
   27.11    st->cr();
   27.12  
   27.13    // this is only for the "general purpose" registers
   27.14 -  st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON__G1]);
   27.15 -  st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON__G2]);
   27.16 -  st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON__G3]);
   27.17 -  st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON__G4]);
   27.18 -  st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON__G5]);
   27.19 -  st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON__G6]);
   27.20 -  st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON__G7]);
   27.21 +  st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON_G1]);
   27.22 +  st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON_G2]);
   27.23 +  st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON_G3]);
   27.24 +  st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON_G4]);
   27.25 +  st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON_G5]);
   27.26 +  st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON_G6]);
   27.27 +  st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON_G7]);
   27.28    st->cr();
   27.29  
   27.30 -  st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON__O0]);
   27.31 -  st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON__O1]);
   27.32 -  st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON__O2]);
   27.33 -  st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON__O3]);
   27.34 -  st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON__O4]);
   27.35 -  st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON__O5]);
   27.36 -  st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON__O6]);
   27.37 -  st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON__O7]);
   27.38 +  st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON_O0]);
   27.39 +  st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON_O1]);
   27.40 +  st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON_O2]);
   27.41 +  st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON_O3]);
   27.42 +  st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON_O4]);
   27.43 +  st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON_O5]);
   27.44 +  st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON_O6]);
   27.45 +  st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON_O7]);
   27.46    st->cr();
   27.47  
   27.48    st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]);
   27.49 @@ -516,7 +517,7 @@
   27.50    if (nativeInstruction_at(*pc)->is_ic_miss_trap()) {
   27.51  #ifdef ASSERT
   27.52  #ifdef TIERED
   27.53 -    CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   27.54 +    CodeBlob* cb = CodeCache::find_blob_unsafe(*pc);
   27.55      assert(cb->is_compiled_by_c2(), "Wrong compiler");
   27.56  #endif // TIERED
   27.57  #endif // ASSERT
    28.1 --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Wed May 21 10:56:41 2014 -0700
    28.2 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri May 23 14:12:52 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 @@ -88,6 +88,8 @@
   28.11  #define SPELL_REG_FP "ebp"
   28.12  #endif // AMD64
   28.13  
   28.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   28.15 +
   28.16  address os::current_stack_pointer() {
   28.17  #ifdef SPARC_WORKS
   28.18    register void *esp;
    29.1 --- a/src/share/vm/adlc/formssel.cpp	Wed May 21 10:56:41 2014 -0700
    29.2 +++ b/src/share/vm/adlc/formssel.cpp	Fri May 23 14:12:52 2014 -0700
    29.3 @@ -1,5 +1,5 @@
    29.4  /*
    29.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    29.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    29.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    29.8   *
    29.9   * This code is free software; you can redistribute it and/or modify it
   29.10 @@ -1322,7 +1322,7 @@
   29.11      OperandForm* oper = form->is_operand();
   29.12      if (oper != NULL && oper->is_bound_register()) {
   29.13        const RegDef* first = oper->get_RegClass()->find_first_elem();
   29.14 -      fprintf(fp, "    st->print(\"%s\");\n", first->_regname);
   29.15 +      fprintf(fp, "    st->print_raw(\"%s\");\n", first->_regname);
   29.16      } else {
   29.17        globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var);
   29.18      }
   29.19 @@ -2530,7 +2530,7 @@
   29.20    case Form::idealP: fprintf(fp,"  if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
   29.21    case Form::idealNKlass:
   29.22    case Form::idealN: fprintf(fp,"  if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
   29.23 -  case Form::idealL: fprintf(fp,"  st->print(\"#%%lld\", _c%d);\n", const_index); break;
   29.24 +  case Form::idealL: fprintf(fp,"  st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", const_index); break;
   29.25    case Form::idealF: fprintf(fp,"  st->print(\"#%%f\", _c%d);\n", const_index); break;
   29.26    case Form::idealD: fprintf(fp,"  st->print(\"#%%f\", _c%d);\n", const_index); break;
   29.27    default:
    30.1 --- a/src/share/vm/adlc/output_h.cpp	Wed May 21 10:56:41 2014 -0700
    30.2 +++ b/src/share/vm/adlc/output_h.cpp	Fri May 23 14:12:52 2014 -0700
    30.3 @@ -1,5 +1,5 @@
    30.4  /*
    30.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    30.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    30.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    30.8   *
    30.9   * This code is free software; you can redistribute it and/or modify it
   30.10 @@ -386,14 +386,14 @@
   30.11  static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
   30.12    assert(oper != NULL, "what");
   30.13    CondInterface* cond = oper->_interface->is_CondInterface();
   30.14 -  fprintf(fp, "       if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
   30.15 -  fprintf(fp, "  else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
   30.16 -  fprintf(fp, "  else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
   30.17 -  fprintf(fp, "  else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
   30.18 -  fprintf(fp, "  else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
   30.19 -  fprintf(fp, "  else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
   30.20 -  fprintf(fp, "  else if( _c%d == BoolTest::overflow ) st->print(\"%s\");\n",i,cond->_overflow_format);
   30.21 -  fprintf(fp, "  else if( _c%d == BoolTest::no_overflow ) st->print(\"%s\");\n",i,cond->_no_overflow_format);
   30.22 +  fprintf(fp, "       if( _c%d == BoolTest::eq ) st->print_raw(\"%s\");\n",i,cond->_equal_format);
   30.23 +  fprintf(fp, "  else if( _c%d == BoolTest::ne ) st->print_raw(\"%s\");\n",i,cond->_not_equal_format);
   30.24 +  fprintf(fp, "  else if( _c%d == BoolTest::le ) st->print_raw(\"%s\");\n",i,cond->_less_equal_format);
   30.25 +  fprintf(fp, "  else if( _c%d == BoolTest::ge ) st->print_raw(\"%s\");\n",i,cond->_greater_equal_format);
   30.26 +  fprintf(fp, "  else if( _c%d == BoolTest::lt ) st->print_raw(\"%s\");\n",i,cond->_less_format);
   30.27 +  fprintf(fp, "  else if( _c%d == BoolTest::gt ) st->print_raw(\"%s\");\n",i,cond->_greater_format);
   30.28 +  fprintf(fp, "  else if( _c%d == BoolTest::overflow ) st->print_raw(\"%s\");\n",i,cond->_overflow_format);
   30.29 +  fprintf(fp, "  else if( _c%d == BoolTest::no_overflow ) st->print_raw(\"%s\");\n",i,cond->_no_overflow_format);
   30.30  }
   30.31  
   30.32  // Output code that dumps constant values, increment "i" if type is constant
   30.33 @@ -416,8 +416,8 @@
   30.34      ++i;
   30.35    }
   30.36    else if (!strcmp(ideal_type, "ConL")) {
   30.37 -    fprintf(fp,"    st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
   30.38 -    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
   30.39 +    fprintf(fp,"    st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", i);
   30.40 +    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%d);\n", i);
   30.41      ++i;
   30.42    }
   30.43    else if (!strcmp(ideal_type, "ConF")) {
   30.44 @@ -429,7 +429,7 @@
   30.45    else if (!strcmp(ideal_type, "ConD")) {
   30.46      fprintf(fp,"    st->print(\"#%%f\", _c%d);\n", i);
   30.47      fprintf(fp,"    jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
   30.48 -    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
   30.49 +    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%dl);\n", i);
   30.50      ++i;
   30.51    }
   30.52    else if (!strcmp(ideal_type, "Bool")) {
   30.53 @@ -471,7 +471,7 @@
   30.54          if ( string != NameList::_signal ) {
   30.55            // Normal string
   30.56            // Pass through to st->print
   30.57 -          fprintf(fp,"  st->print(\"%s\");\n", string);
   30.58 +          fprintf(fp,"  st->print_raw(\"%s\");\n", string);
   30.59          } else {
   30.60            // Replacement variable
   30.61            const char *rep_var = oper._format->_rep_vars.iter();
   30.62 @@ -542,7 +542,7 @@
   30.63          if ( string != NameList::_signal ) {
   30.64            // Normal string
   30.65            // Pass through to st->print
   30.66 -          fprintf(fp,"  st->print(\"%s\");\n", string);
   30.67 +          fprintf(fp,"  st->print_raw(\"%s\");\n", string);
   30.68          } else {
   30.69            // Replacement variable
   30.70            const char *rep_var = oper._format->_rep_vars.iter();
   30.71 @@ -669,7 +669,7 @@
   30.72        } else if( string == NameList::_signal2 ) // Raw program text
   30.73          fputs(inst._format->_strings.iter(), fp);
   30.74        else
   30.75 -        fprintf(fp,"st->print(\"%s\");\n", string);
   30.76 +        fprintf(fp,"st->print_raw(\"%s\");\n", string);
   30.77      } // Done with all format strings
   30.78    } // Done generating the user-defined portion of the format
   30.79  
   30.80 @@ -696,13 +696,13 @@
   30.81      default:
   30.82        assert(0,"ShouldNotReachHere");
   30.83      }
   30.84 -    fprintf(fp,  "  st->print_cr(\"\");\n" );
   30.85 +    fprintf(fp,  "  st->cr();\n" );
   30.86      fprintf(fp,  "  if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\"        No JVM State Info\");\n" );
   30.87      fprintf(fp,  "  st->print(\"        # \");\n" );
   30.88      fprintf(fp,  "  if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
   30.89    }
   30.90    else if(inst.is_ideal_safepoint()) {
   30.91 -    fprintf(fp,  "  st->print(\"\");\n" );
   30.92 +    fprintf(fp,  "  st->print_raw(\"\");\n" );
   30.93      fprintf(fp,  "  if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\"        No JVM State Info\");\n" );
   30.94      fprintf(fp,  "  st->print(\"        # \");\n" );
   30.95      fprintf(fp,  "  if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
    31.1 --- a/src/share/vm/asm/codeBuffer.cpp	Wed May 21 10:56:41 2014 -0700
    31.2 +++ b/src/share/vm/asm/codeBuffer.cpp	Fri May 23 14:12:52 2014 -0700
    31.3 @@ -1,5 +1,5 @@
    31.4  /*
    31.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    31.6 + * Copyright (c) 1997, 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 @@ -987,7 +987,7 @@
   31.11    for (csize_t step; ptr < end(); ptr += step) {
   31.12      step = end() - ptr;
   31.13      if (step > jintSize * 4)  step = jintSize * 4;
   31.14 -    tty->print(PTR_FORMAT ": ", ptr);
   31.15 +    tty->print(INTPTR_FORMAT ": ", p2i(ptr));
   31.16      while (step > 0) {
   31.17        tty->print(" " PTR32_FORMAT, *(jint*)ptr);
   31.18        ptr += jintSize;
   31.19 @@ -1097,7 +1097,7 @@
   31.20      while (c && c->offset() == offset) {
   31.21        stream->bol();
   31.22        stream->print("  ;; ");
   31.23 -      stream->print_cr(c->string());
   31.24 +      stream->print_cr("%s", c->string());
   31.25        c = c->next_comment();
   31.26      }
   31.27    }
   31.28 @@ -1153,10 +1153,10 @@
   31.29  void CodeSection::print(const char* name) {
   31.30    csize_t locs_size = locs_end() - locs_start();
   31.31    tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
   31.32 -                name, start(), end(), limit(), size(), capacity(),
   31.33 +                name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
   31.34                  is_frozen()? " [frozen]": "");
   31.35    tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d",
   31.36 -                name, locs_start(), locs_end(), locs_limit(), locs_size, locs_capacity(), locs_point_off());
   31.37 +                name, p2i(locs_start()), p2i(locs_end()), p2i(locs_limit()), locs_size, locs_capacity(), locs_point_off());
   31.38    if (PrintRelocations) {
   31.39      RelocIterator iter(this);
   31.40      iter.print();
    32.1 --- a/src/share/vm/asm/codeBuffer.hpp	Wed May 21 10:56:41 2014 -0700
    32.2 +++ b/src/share/vm/asm/codeBuffer.hpp	Fri May 23 14:12:52 2014 -0700
    32.3 @@ -1,5 +1,5 @@
    32.4  /*
    32.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    32.6 + * Copyright (c) 1997, 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 @@ -173,7 +173,7 @@
   32.11    bool allocates(address pc) const  { return pc >= _start && pc <  _limit; }
   32.12    bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
   32.13  
   32.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; }
   32.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; }
   32.16    void    set_mark(address pc)      { assert(contains2(pc), "not in codeBuffer");
   32.17                                        _mark = pc; }
   32.18    void    set_mark_off(int offset)  { assert(contains2(offset+_start),"not in codeBuffer");
    33.1 --- a/src/share/vm/asm/register.hpp	Wed May 21 10:56:41 2014 -0700
    33.2 +++ b/src/share/vm/asm/register.hpp	Fri May 23 14:12:52 2014 -0700
    33.3 @@ -1,5 +1,5 @@
    33.4  /*
    33.5 - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
    33.6 + * Copyright (c) 2000, 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 @@ -118,8 +118,8 @@
   33.11  ) {
   33.12    assert(
   33.13      a != b,
   33.14 -    err_msg_res("registers must be different: a=%d, b=%d",
   33.15 -                a, b)
   33.16 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "",
   33.17 +                p2i(a), p2i(b))
   33.18    );
   33.19  }
   33.20  
   33.21 @@ -132,8 +132,9 @@
   33.22    assert(
   33.23      a != b && a != c
   33.24             && b != c,
   33.25 -    err_msg_res("registers must be different: a=%d, b=%d, c=%d",
   33.26 -                a, b, c)
   33.27 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
   33.28 +                ", c=" INTPTR_FORMAT "",
   33.29 +                p2i(a), p2i(b), p2i(c))
   33.30    );
   33.31  }
   33.32  
   33.33 @@ -148,8 +149,9 @@
   33.34      a != b && a != c && a != d
   33.35             && b != c && b != d
   33.36                       && c != d,
   33.37 -    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d",
   33.38 -                a, b, c, d)
   33.39 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
   33.40 +                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "",
   33.41 +                p2i(a), p2i(b), p2i(c), p2i(d))
   33.42    );
   33.43  }
   33.44  
   33.45 @@ -166,8 +168,9 @@
   33.46             && b != c && b != d && b != e
   33.47                       && c != d && c != e
   33.48                                 && d != e,
   33.49 -    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d",
   33.50 -                a, b, c, d, e)
   33.51 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
   33.52 +                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "",
   33.53 +                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e))
   33.54    );
   33.55  }
   33.56  
   33.57 @@ -186,8 +189,10 @@
   33.58                       && c != d && c != e && c != f
   33.59                                 && d != e && d != f
   33.60                                           && e != f,
   33.61 -    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d",
   33.62 -                a, b, c, d, e, f)
   33.63 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
   33.64 +                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
   33.65 +                ", f=" INTPTR_FORMAT "",
   33.66 +                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f))
   33.67    );
   33.68  }
   33.69  
   33.70 @@ -208,8 +213,10 @@
   33.71                                 && d != e && d != f && d != g
   33.72                                           && e != f && e != g
   33.73                                                     && f != g,
   33.74 -    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d",
   33.75 -                a, b, c, d, e, f, g)
   33.76 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
   33.77 +                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
   33.78 +                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "",
   33.79 +                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g))
   33.80    );
   33.81  }
   33.82  
   33.83 @@ -232,8 +239,10 @@
   33.84                                           && e != f && e != g && e != h
   33.85                                                     && f != g && f != h
   33.86                                                               && g != h,
   33.87 -    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d",
   33.88 -                a, b, c, d, e, f, g, h)
   33.89 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
   33.90 +                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
   33.91 +                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "",
   33.92 +                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h))
   33.93    );
   33.94  }
   33.95  
   33.96 @@ -258,8 +267,11 @@
   33.97                                                     && f != g && f != h && f != i
   33.98                                                               && g != h && g != i
   33.99                                                                         && h != i,
  33.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",
  33.101 -                a, b, c, d, e, f, g, h, i)
  33.102 +    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
  33.103 +                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
  33.104 +                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
  33.105 +                ", i=" INTPTR_FORMAT "",
  33.106 +                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i))
  33.107    );
  33.108  }
  33.109  
    34.1 --- a/src/share/vm/c1/c1_CFGPrinter.cpp	Wed May 21 10:56:41 2014 -0700
    34.2 +++ b/src/share/vm/c1/c1_CFGPrinter.cpp	Fri May 23 14:12:52 2014 -0700
    34.3 @@ -1,5 +1,5 @@
    34.4  /*
    34.5 - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
    34.6 + * Copyright (c) 2005, 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 @@ -50,7 +50,7 @@
   34.11  
   34.12    void inc_indent();
   34.13    void dec_indent();
   34.14 -  void print(const char* format, ...);
   34.15 +  void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
   34.16    void print_begin(const char* tag);
   34.17    void print_end(const char* tag);
   34.18  
   34.19 @@ -161,7 +161,7 @@
   34.20  
   34.21    print("name \"%s\"", method_name(_compilation->method(), true));
   34.22    print("method \"%s\"", method_name(_compilation->method()));
   34.23 -  print("date "INT64_FORMAT, os::javaTimeMillis());
   34.24 +  print("date "INT64_FORMAT, (int64_t) os::javaTimeMillis());
   34.25  
   34.26    print_end("compilation");
   34.27  }
    35.1 --- a/src/share/vm/c1/c1_InstructionPrinter.cpp	Wed May 21 10:56:41 2014 -0700
    35.2 +++ b/src/share/vm/c1/c1_InstructionPrinter.cpp	Fri May 23 14:12:52 2014 -0700
    35.3 @@ -1,5 +1,5 @@
    35.4  /*
    35.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    35.6 + * Copyright (c) 1999, 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 @@ -134,23 +134,23 @@
   35.11      if (value->is_null_object()) {
   35.12        output()->print("null");
   35.13      } else if (!value->is_loaded()) {
   35.14 -      output()->print("<unloaded object " PTR_FORMAT ">", value);
   35.15 +      output()->print("<unloaded object " INTPTR_FORMAT ">", p2i(value));
   35.16      } else {
   35.17 -      output()->print("<object " PTR_FORMAT " klass=", value->constant_encoding());
   35.18 +      output()->print("<object " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
   35.19        print_klass(value->klass());
   35.20        output()->print(">");
   35.21      }
   35.22    } else if (type->as_InstanceConstant() != NULL) {
   35.23      ciInstance* value = type->as_InstanceConstant()->value();
   35.24      if (value->is_loaded()) {
   35.25 -      output()->print("<instance " PTR_FORMAT " klass=", value->constant_encoding());
   35.26 +      output()->print("<instance " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
   35.27        print_klass(value->klass());
   35.28        output()->print(">");
   35.29      } else {
   35.30 -      output()->print("<unloaded instance " PTR_FORMAT ">", value);
   35.31 +      output()->print("<unloaded instance " INTPTR_FORMAT ">", p2i(value));
   35.32      }
   35.33    } else if (type->as_ArrayConstant() != NULL) {
   35.34 -    output()->print("<array " PTR_FORMAT ">", type->as_ArrayConstant()->value()->constant_encoding());
   35.35 +    output()->print("<array " INTPTR_FORMAT ">", p2i(type->as_ArrayConstant()->value()->constant_encoding()));
   35.36    } else if (type->as_ClassConstant() != NULL) {
   35.37      ciInstanceKlass* klass = type->as_ClassConstant()->value();
   35.38      if (!klass->is_loaded()) {
   35.39 @@ -268,7 +268,7 @@
   35.40  
   35.41  
   35.42  void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) {
   35.43 -  output()->print(name);
   35.44 +  output()->print("%s", name);
   35.45    output()->print(".(");
   35.46  }
   35.47  
   35.48 @@ -479,7 +479,7 @@
   35.49    if (x->declared_type()->is_klass())
   35.50      print_klass(x->declared_type()->as_klass());
   35.51    else
   35.52 -    output()->print(type2name(x->declared_type()->basic_type()));
   35.53 +    output()->print("%s", type2name(x->declared_type()->basic_type()));
   35.54  }
   35.55  
   35.56  
    36.1 --- a/src/share/vm/c1/c1_LIR.cpp	Wed May 21 10:56:41 2014 -0700
    36.2 +++ b/src/share/vm/c1/c1_LIR.cpp	Fri May 23 14:12:52 2014 -0700
    36.3 @@ -1,5 +1,5 @@
    36.4  /*
    36.5 - * Copyright (c) 2000, 2013, 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 @@ -1563,15 +1563,15 @@
   36.11    } else if (is_virtual()) {
   36.12      out->print("R%d", vreg_number());
   36.13    } else if (is_single_cpu()) {
   36.14 -    out->print(as_register()->name());
   36.15 +    out->print("%s", as_register()->name());
   36.16    } else if (is_double_cpu()) {
   36.17 -    out->print(as_register_hi()->name());
   36.18 -    out->print(as_register_lo()->name());
   36.19 +    out->print("%s", as_register_hi()->name());
   36.20 +    out->print("%s", as_register_lo()->name());
   36.21  #if defined(X86)
   36.22    } else if (is_single_xmm()) {
   36.23 -    out->print(as_xmm_float_reg()->name());
   36.24 +    out->print("%s", as_xmm_float_reg()->name());
   36.25    } else if (is_double_xmm()) {
   36.26 -    out->print(as_xmm_double_reg()->name());
   36.27 +    out->print("%s", as_xmm_double_reg()->name());
   36.28    } else if (is_single_fpu()) {
   36.29      out->print("fpu%d", fpu_regnr());
   36.30    } else if (is_double_fpu()) {
   36.31 @@ -1583,9 +1583,9 @@
   36.32      out->print("d%d", fpu_regnrLo() >> 1);
   36.33  #else
   36.34    } else if (is_single_fpu()) {
   36.35 -    out->print(as_float_reg()->name());
   36.36 +    out->print("%s", as_float_reg()->name());
   36.37    } else if (is_double_fpu()) {
   36.38 -    out->print(as_double_reg()->name());
   36.39 +    out->print("%s", as_double_reg()->name());
   36.40  #endif
   36.41  
   36.42    } else if (is_illegal()) {
   36.43 @@ -1611,9 +1611,9 @@
   36.44      case T_LONG:   out->print("lng:" JLONG_FORMAT, as_jlong()); break;
   36.45      case T_FLOAT:  out->print("flt:%f",   as_jfloat());         break;
   36.46      case T_DOUBLE: out->print("dbl:%f",   as_jdouble());        break;
   36.47 -    case T_OBJECT: out->print("obj:0x%x", as_jobject());        break;
   36.48 -    case T_METADATA: out->print("metadata:0x%x", as_metadata());break;
   36.49 -    default:       out->print("%3d:0x%x",type(), as_jdouble()); break;
   36.50 +    case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject()));        break;
   36.51 +    case T_METADATA: out->print("metadata:" INTPTR_FORMAT, p2i(as_metadata()));break;
   36.52 +    default:       out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break;
   36.53    }
   36.54  }
   36.55  
   36.56 @@ -1629,7 +1629,7 @@
   36.57      case times_8: out->print(" * 8"); break;
   36.58      }
   36.59    }
   36.60 -  out->print(" Disp: %d", _disp);
   36.61 +  out->print(" Disp: " INTX_FORMAT, _disp);
   36.62  }
   36.63  
   36.64  // debug output of block header without InstructionPrinter
   36.65 @@ -1703,7 +1703,7 @@
   36.66    } else {
   36.67      out->print("     ");
   36.68    }
   36.69 -  out->print(name()); out->print(" ");
   36.70 +  out->print("%s ", name());
   36.71    print_instr(out);
   36.72    if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci());
   36.73  #ifdef ASSERT
   36.74 @@ -1833,7 +1833,7 @@
   36.75  // LIR_OpJavaCall
   36.76  void LIR_OpJavaCall::print_instr(outputStream* out) const {
   36.77    out->print("call: ");
   36.78 -  out->print("[addr: 0x%x]", address());
   36.79 +  out->print("[addr: " INTPTR_FORMAT "]", p2i(address()));
   36.80    if (receiver()->is_valid()) {
   36.81      out->print(" [recv: ");   receiver()->print(out);   out->print("]");
   36.82    }
   36.83 @@ -1844,7 +1844,7 @@
   36.84  
   36.85  // LIR_OpLabel
   36.86  void LIR_OpLabel::print_instr(outputStream* out) const {
   36.87 -  out->print("[label:0x%x]", _label);
   36.88 +  out->print("[label:" INTPTR_FORMAT "]", p2i(_label));
   36.89  }
   36.90  
   36.91  // LIR_OpArrayCopy
   36.92 @@ -1911,7 +1911,7 @@
   36.93  // LIR_Op1
   36.94  void LIR_OpRTCall::print_instr(outputStream* out) const {
   36.95    intx a = (intx)addr();
   36.96 -  out->print(Runtime1::name_for_address(addr()));
   36.97 +  out->print("%s", Runtime1::name_for_address(addr()));
   36.98    out->print(" ");
   36.99    tmp()->print(out);
  36.100  }
  36.101 @@ -1934,10 +1934,10 @@
  36.102    } else if (stub() != NULL) {
  36.103      out->print("[");
  36.104      stub()->print_name(out);
  36.105 -    out->print(": 0x%x]", stub());
  36.106 +    out->print(": " INTPTR_FORMAT "]", p2i(stub()));
  36.107      if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci());
  36.108    } else {
  36.109 -    out->print("[label:0x%x] ", label());
  36.110 +    out->print("[label:" INTPTR_FORMAT "] ", p2i(label()));
  36.111    }
  36.112    if (ublock() != NULL) {
  36.113      out->print("unordered: [B%d] ", ublock()->block_id());
  36.114 @@ -2004,7 +2004,7 @@
  36.115    tmp4()->print(out);                       out->print(" ");
  36.116    out->print("[hdr:%d]", header_size()); out->print(" ");
  36.117    out->print("[obj:%d]", object_size()); out->print(" ");
  36.118 -  out->print("[lbl:0x%x]", stub()->entry());
  36.119 +  out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
  36.120  }
  36.121  
  36.122  void LIR_OpRoundFP::print_instr(outputStream* out) const {
  36.123 @@ -2037,7 +2037,7 @@
  36.124    tmp3()->print(out);                    out->print(" ");
  36.125    tmp4()->print(out);                    out->print(" ");
  36.126    out->print("[type:0x%x]", type());     out->print(" ");
  36.127 -  out->print("[label:0x%x]", stub()->entry());
  36.128 +  out->print("[label:" INTPTR_FORMAT "]", p2i(stub()->entry()));
  36.129  }
  36.130  
  36.131  
  36.132 @@ -2074,7 +2074,7 @@
  36.133    if (_scratch->is_valid()) {
  36.134      _scratch->print(out);  out->print(" ");
  36.135    }
  36.136 -  out->print("[lbl:0x%x]", stub()->entry());
  36.137 +  out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
  36.138  }
  36.139  
  36.140  #ifdef ASSERT
  36.141 @@ -2082,7 +2082,7 @@
  36.142    print_condition(out, condition()); out->print(" ");
  36.143    in_opr1()->print(out);             out->print(" ");
  36.144    in_opr2()->print(out);             out->print(", \"");
  36.145 -  out->print(msg());                 out->print("\"");
  36.146 +  out->print("%s", msg());          out->print("\"");
  36.147  }
  36.148  #endif
  36.149  
    37.1 --- a/src/share/vm/c1/c1_RangeCheckElimination.cpp	Wed May 21 10:56:41 2014 -0700
    37.2 +++ b/src/share/vm/c1/c1_RangeCheckElimination.cpp	Fri May 23 14:12:52 2014 -0700
    37.3 @@ -1,5 +1,5 @@
    37.4  /*
    37.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    37.6 + * Copyright (c) 2012, 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 @@ -62,10 +62,10 @@
   37.11    _optimistic = ir->compilation()->is_optimistic();
   37.12  
   37.13    TRACE_RANGE_CHECK_ELIMINATION(
   37.14 -    tty->print_cr("");
   37.15 +    tty->cr();
   37.16      tty->print_cr("Range check elimination");
   37.17      ir->method()->print_name(tty);
   37.18 -    tty->print_cr("");
   37.19 +    tty->cr();
   37.20    );
   37.21  
   37.22    TRACE_RANGE_CHECK_ELIMINATION(
   37.23 @@ -1024,7 +1024,7 @@
   37.24                                                           tty->print("i%d", phi->id());
   37.25                                                           tty->print(": ");
   37.26                                                           bound->print();
   37.27 -                                                         tty->print_cr("");
   37.28 +                                                         tty->cr();
   37.29                             );
   37.30                           }
   37.31                       });
   37.32 @@ -1039,7 +1039,7 @@
   37.33                                              tty->print("i%d", instr->id());
   37.34                                              tty->print(": ");
   37.35                                              bound->print();
   37.36 -                                            tty->print_cr("");
   37.37 +                                            tty->cr();
   37.38                );
   37.39            }
   37.40          }
   37.41 @@ -1400,7 +1400,7 @@
   37.42  
   37.43  // print
   37.44  void RangeCheckEliminator::Bound::print() {
   37.45 -  tty->print("");
   37.46 +  tty->print("%s", "");
   37.47    if (this->_lower_instr || this->_lower != min_jint) {
   37.48      if (this->_lower_instr) {
   37.49        tty->print("i%d", this->_lower_instr->id());
    38.1 --- a/src/share/vm/c1/c1_Runtime1.cpp	Wed May 21 10:56:41 2014 -0700
    38.2 +++ b/src/share/vm/c1/c1_Runtime1.cpp	Fri May 23 14:12:52 2014 -0700
    38.3 @@ -1,5 +1,5 @@
    38.4  /*
    38.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    38.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    38.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    38.8   *
    38.9   * This code is free software; you can redistribute it and/or modify it
   38.10 @@ -532,8 +532,8 @@
   38.11      if (TraceExceptions) {
   38.12        ttyLocker ttyl;
   38.13        ResourceMark rm;
   38.14 -      tty->print_cr("Exception <%s> (0x%x) thrown in compiled method <%s> at PC " PTR_FORMAT " for thread 0x%x",
   38.15 -                    exception->print_value_string(), (address)exception(), nm->method()->print_value_string(), pc, thread);
   38.16 +      tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "",
   38.17 +                    exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
   38.18      }
   38.19      // for AbortVMOnException flag
   38.20      NOT_PRODUCT(Exceptions::debug_check_abort(exception));
   38.21 @@ -563,7 +563,7 @@
   38.22      ttyLocker ttyl;
   38.23      ResourceMark rm;
   38.24      tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT,
   38.25 -                  thread, continuation, pc);
   38.26 +                  p2i(thread), p2i(continuation), p2i(pc));
   38.27    }
   38.28  
   38.29    return continuation;
   38.30 @@ -970,8 +970,8 @@
   38.31          address copy_buff = stub_location - *byte_skip - *byte_count;
   38.32          address being_initialized_entry = stub_location - *being_initialized_entry_offset;
   38.33          if (TracePatching) {
   38.34 -          tty->print_cr(" Patching %s at bci %d at address 0x%x  (%s)", Bytecodes::name(code), bci,
   38.35 -                        instr_pc, (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
   38.36 +          tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT "  (%s)", Bytecodes::name(code), bci,
   38.37 +                        p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
   38.38            nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc());
   38.39            assert(caller_code != NULL, "nmethod not found");
   38.40  
   38.41 @@ -1430,7 +1430,7 @@
   38.42      methodHandle inlinee = methodHandle(vfst.method());
   38.43      inlinee->print_short_name(&ss1);
   38.44      m->print_short_name(&ss2);
   38.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());
   38.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()));
   38.47    }
   38.48  
   38.49  
    39.1 --- a/src/share/vm/c1/c1_ValueType.hpp	Wed May 21 10:56:41 2014 -0700
    39.2 +++ b/src/share/vm/c1/c1_ValueType.hpp	Fri May 23 14:12:52 2014 -0700
    39.3 @@ -1,5 +1,5 @@
    39.4  /*
    39.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
    39.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    39.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    39.8   *
    39.9   * This code is free software; you can redistribute it and/or modify it
   39.10 @@ -175,7 +175,7 @@
   39.11    ValueType* join(ValueType* y) const;
   39.12  
   39.13    // debugging
   39.14 -  void print(outputStream* s = tty)              { s->print(name()); }
   39.15 +  void print(outputStream* s = tty)              { s->print("%s", name()); }
   39.16  };
   39.17  
   39.18  
    40.1 --- a/src/share/vm/ci/bcEscapeAnalyzer.cpp	Wed May 21 10:56:41 2014 -0700
    40.2 +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp	Fri May 23 14:12:52 2014 -0700
    40.3 @@ -1,5 +1,5 @@
    40.4  /*
    40.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
    40.6 + * Copyright (c) 2005, 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 @@ -1287,10 +1287,10 @@
   40.11          tty->print_cr("class of method is not initialized.");
   40.12        else if (_level > MaxBCEAEstimateLevel)
   40.13          tty->print_cr("level (%d) exceeds MaxBCEAEstimateLevel (%d).",
   40.14 -                      _level, MaxBCEAEstimateLevel);
   40.15 +                      _level, (int) MaxBCEAEstimateLevel);
   40.16        else if (method()->code_size() > MaxBCEAEstimateSize)
   40.17 -        tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize.",
   40.18 -                      method()->code_size(), MaxBCEAEstimateSize);
   40.19 +        tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize (%d).",
   40.20 +                      method()->code_size(), (int) MaxBCEAEstimateSize);
   40.21        else
   40.22          ShouldNotReachHere();
   40.23      }
    41.1 --- a/src/share/vm/ci/ciConstant.cpp	Wed May 21 10:56:41 2014 -0700
    41.2 +++ b/src/share/vm/ci/ciConstant.cpp	Fri May 23 14:12:52 2014 -0700
    41.3 @@ -1,5 +1,5 @@
    41.4  /*
    41.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
    41.6 + * Copyright (c) 1999, 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 @@ -48,7 +48,7 @@
   41.11      tty->print("%d", _value._int);
   41.12      break;
   41.13    case T_LONG:
   41.14 -    tty->print(INT64_FORMAT, _value._long);
   41.15 +    tty->print(INT64_FORMAT, (int64_t)(_value._long));
   41.16      break;
   41.17    case T_FLOAT:
   41.18      tty->print("%f", _value._float);
    42.1 --- a/src/share/vm/ci/ciEnv.cpp	Wed May 21 10:56:41 2014 -0700
    42.2 +++ b/src/share/vm/ci/ciEnv.cpp	Fri May 23 14:12:52 2014 -0700
    42.3 @@ -1,5 +1,5 @@
    42.4  /*
    42.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    42.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    42.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    42.8   *
    42.9   * This code is free software; you can redistribute it and/or modify it
   42.10 @@ -1220,8 +1220,7 @@
   42.11        if (replay_data_file != NULL) {
   42.12          fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
   42.13          dump_replay_data(&replay_data_stream);
   42.14 -        tty->print("# Compiler replay data is saved as: ");
   42.15 -        tty->print_cr(buffer);
   42.16 +        tty->print_cr("# Compiler replay data is saved as: %s", buffer);
   42.17        } else {
   42.18          tty->print_cr("# Can't open file to dump replay data.");
   42.19        }
   42.20 @@ -1244,7 +1243,7 @@
   42.21          )
   42.22          replay_data_stream.flush();
   42.23          tty->print("# Compiler inline data is saved as: ");
   42.24 -        tty->print_cr(buffer);
   42.25 +        tty->print_cr("%s", buffer);
   42.26        } else {
   42.27          tty->print_cr("# Can't open file to dump inline data.");
   42.28        }
    43.1 --- a/src/share/vm/ci/ciInstanceKlass.cpp	Wed May 21 10:56:41 2014 -0700
    43.2 +++ b/src/share/vm/ci/ciInstanceKlass.cpp	Fri May 23 14:12:52 2014 -0700
    43.3 @@ -1,5 +1,5 @@
    43.4  /*
    43.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    43.6 + * Copyright (c) 1999, 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 @@ -292,7 +292,7 @@
   43.11  // Implementation of the print method.
   43.12  void ciInstanceKlass::print_impl(outputStream* st) {
   43.13    ciKlass::print_impl(st);
   43.14 -  GUARDED_VM_ENTRY(st->print(" loader=0x%x", (address)loader());)
   43.15 +  GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));)
   43.16    if (is_loaded()) {
   43.17      st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=",
   43.18                bool_to_str(is_initialized()),
   43.19 @@ -618,7 +618,7 @@
   43.20          case T_SHORT:   _out->print_cr("%d", mirror->short_field(fd->offset()));  break;
   43.21          case T_CHAR:    _out->print_cr("%d", mirror->char_field(fd->offset()));   break;
   43.22          case T_INT:     _out->print_cr("%d", mirror->int_field(fd->offset()));    break;
   43.23 -        case T_LONG:    _out->print_cr(INT64_FORMAT, mirror->long_field(fd->offset()));   break;
   43.24 +        case T_LONG:    _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset())));   break;
   43.25          case T_FLOAT: {
   43.26            float f = mirror->float_field(fd->offset());
   43.27            _out->print_cr("%d", *(int*)&f);
   43.28 @@ -626,7 +626,7 @@
   43.29          }
   43.30          case T_DOUBLE: {
   43.31            double d = mirror->double_field(fd->offset());
   43.32 -          _out->print_cr(INT64_FORMAT, *(jlong*)&d);
   43.33 +          _out->print_cr(INT64_FORMAT, *(int64_t*)&d);
   43.34            break;
   43.35          }
   43.36          case T_ARRAY: {
   43.37 @@ -656,7 +656,7 @@
   43.38                _out->print_cr("\"");
   43.39              } else {
   43.40                const char* klass_name  = value->klass()->name()->as_quoted_ascii();
   43.41 -              _out->print_cr(klass_name);
   43.42 +              _out->print_cr("%s", klass_name);
   43.43              }
   43.44            } else {
   43.45              ShouldNotReachHere();
    44.1 --- a/src/share/vm/ci/ciMetadata.cpp	Wed May 21 10:56:41 2014 -0700
    44.2 +++ b/src/share/vm/ci/ciMetadata.cpp	Fri May 23 14:12:52 2014 -0700
    44.3 @@ -1,5 +1,5 @@
    44.4  /*
    44.5 - * Copyright (c) 1999, 2012, 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 @@ -38,7 +38,7 @@
   44.11  void ciMetadata::print(outputStream* st) {
   44.12    st->print("<%s", type_string());
   44.13    GUARDED_VM_ENTRY(print_impl(st);)
   44.14 -  st->print(" ident=%d address=0x%x>", ident(), (address)this);
   44.15 +  st->print(" ident=%d address=" INTPTR_FORMAT ">", ident(), p2i((address)this));
   44.16  }
   44.17  
   44.18  
    45.1 --- a/src/share/vm/ci/ciMethodData.cpp	Wed May 21 10:56:41 2014 -0700
    45.2 +++ b/src/share/vm/ci/ciMethodData.cpp	Fri May 23 14:12:52 2014 -0700
    45.3 @@ -1,5 +1,5 @@
    45.4  /*
    45.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
    45.6 + * Copyright (c) 2001, 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 @@ -557,7 +557,7 @@
   45.11              if (round == 0) {
   45.12                count++;
   45.13              } else {
   45.14 -              out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
   45.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());
   45.16              }
   45.17            }
   45.18          }
   45.19 @@ -569,7 +569,7 @@
   45.20              if (round == 0) {
   45.21                count++;
   45.22              } else {
   45.23 -              out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
   45.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());
   45.25              }
   45.26            }
   45.27          }
    46.1 --- a/src/share/vm/ci/ciObject.cpp	Wed May 21 10:56:41 2014 -0700
    46.2 +++ b/src/share/vm/ci/ciObject.cpp	Fri May 23 14:12:52 2014 -0700
    46.3 @@ -1,5 +1,5 @@
    46.4  /*
    46.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
    46.6 + * Copyright (c) 1999, 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 @@ -214,9 +214,9 @@
   46.11  void ciObject::print(outputStream* st) {
   46.12    st->print("<%s", type_string());
   46.13    GUARDED_VM_ENTRY(print_impl(st);)
   46.14 -  st->print(" ident=%d %s address=0x%x>", ident(),
   46.15 +  st->print(" ident=%d %s address=" INTPTR_FORMAT ">", ident(),
   46.16          is_scavengable() ? "SCAVENGABLE" : "",
   46.17 -        (address)this);
   46.18 +        p2i((address)this));
   46.19  }
   46.20  
   46.21  // ------------------------------------------------------------------
    47.1 --- a/src/share/vm/ci/ciSignature.cpp	Wed May 21 10:56:41 2014 -0700
    47.2 +++ b/src/share/vm/ci/ciSignature.cpp	Fri May 23 14:12:52 2014 -0700
    47.3 @@ -1,5 +1,5 @@
    47.4  /*
    47.5 - * Copyright (c) 1999, 2011, 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 @@ -148,5 +148,5 @@
   47.11    print_signature();
   47.12   tty->print(" accessing_klass=");
   47.13    _accessing_klass->print();
   47.14 -  tty->print(" address=0x%x>", (address)this);
   47.15 +  tty->print(" address=" INTPTR_FORMAT ">", p2i((address)this));
   47.16  }
    48.1 --- a/src/share/vm/ci/ciType.cpp	Wed May 21 10:56:41 2014 -0700
    48.2 +++ b/src/share/vm/ci/ciType.cpp	Fri May 23 14:12:52 2014 -0700
    48.3 @@ -1,5 +1,5 @@
    48.4  /*
    48.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    48.6 + * Copyright (c) 2000, 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 @@ -87,7 +87,7 @@
   48.11  // Print the name of this type
   48.12  void ciType::print_name_on(outputStream* st) {
   48.13    ResourceMark rm;
   48.14 -  st->print(name());
   48.15 +  st->print("%s", name());
   48.16  }
   48.17  
   48.18  
    49.1 --- a/src/share/vm/classfile/classFileError.cpp	Wed May 21 10:56:41 2014 -0700
    49.2 +++ b/src/share/vm/classfile/classFileError.cpp	Fri May 23 14:12:52 2014 -0700
    49.3 @@ -1,5 +1,5 @@
    49.4  /*
    49.5 - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
    49.6 + * Copyright (c) 2005, 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 @@ -29,6 +29,9 @@
   49.11  
   49.12  // Keep these in a separate file to prevent inlining
   49.13  
   49.14 +PRAGMA_DIAG_PUSH
   49.15 +PRAGMA_FORMAT_NONLITERAL_IGNORED
   49.16 +
   49.17  void ClassFileParser::classfile_parse_error(const char* msg, TRAPS) {
   49.18      ResourceMark rm(THREAD);
   49.19      Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_ClassFormatError(),
   49.20 @@ -53,6 +56,8 @@
   49.21                         msg, index, name, _class_name->as_C_string());
   49.22  }
   49.23  
   49.24 +PRAGMA_DIAG_POP
   49.25 +
   49.26  void StackMapStream::stackmap_format_error(const char* msg, TRAPS) {
   49.27    ResourceMark rm(THREAD);
   49.28    Exceptions::fthrow(
    50.1 --- a/src/share/vm/classfile/classFileParser.cpp	Wed May 21 10:56:41 2014 -0700
    50.2 +++ b/src/share/vm/classfile/classFileParser.cpp	Fri May 23 14:12:52 2014 -0700
    50.3 @@ -2777,7 +2777,7 @@
    50.4                       "Short length on BootstrapMethods in class file %s",
    50.5                       CHECK);
    50.6  
    50.7 -  guarantee_property(attribute_byte_length > sizeof(u2),
    50.8 +  guarantee_property(attribute_byte_length >= sizeof(u2),
    50.9                       "Invalid BootstrapMethods attribute length %u in class file %s",
   50.10                       attribute_byte_length,
   50.11                       CHECK);
    51.1 --- a/src/share/vm/classfile/classFileParser.hpp	Wed May 21 10:56:41 2014 -0700
    51.2 +++ b/src/share/vm/classfile/classFileParser.hpp	Fri May 23 14:12:52 2014 -0700
    51.3 @@ -1,5 +1,5 @@
    51.4  /*
    51.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    51.6 + * Copyright (c) 1997, 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 @@ -312,7 +312,9 @@
   51.11      if (!b) { classfile_parse_error(msg, CHECK); }
   51.12    }
   51.13  
   51.14 -  inline void assert_property(bool b, const char* msg, TRAPS) {
   51.15 +PRAGMA_DIAG_PUSH
   51.16 +PRAGMA_FORMAT_NONLITERAL_IGNORED
   51.17 +inline void assert_property(bool b, const char* msg, TRAPS) {
   51.18  #ifdef ASSERT
   51.19      if (!b) {
   51.20        ResourceMark rm(THREAD);
   51.21 @@ -329,6 +331,7 @@
   51.22      }
   51.23  #endif
   51.24    }
   51.25 +PRAGMA_DIAG_POP
   51.26  
   51.27    inline void check_property(bool property, const char* msg, int index, TRAPS) {
   51.28      if (_need_verify) {
    52.1 --- a/src/share/vm/classfile/classLoader.cpp	Wed May 21 10:56:41 2014 -0700
    52.2 +++ b/src/share/vm/classfile/classLoader.cpp	Fri May 23 14:12:52 2014 -0700
    52.3 @@ -1,5 +1,5 @@
    52.4  /*
    52.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    52.6 + * Copyright (c) 1997, 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 @@ -343,7 +343,7 @@
   52.11    tty->print("[Meta index for %s=", entry->name());
   52.12    for (int i = 0; i < meta_packages.length(); i++) {
   52.13      if (i > 0) tty->print(" ");
   52.14 -    tty->print(meta_packages.at(i));
   52.15 +    tty->print("%s", meta_packages.at(i));
   52.16    }
   52.17    tty->print_cr("]");
   52.18  }
   52.19 @@ -1299,7 +1299,7 @@
   52.20      e = e->next();
   52.21    }
   52.22    jlong end = os::javaTimeMillis();
   52.23 -  tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, %d ms)",
   52.24 +  tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, " JLONG_FORMAT " ms)",
   52.25                  _compile_the_world_class_counter, _compile_the_world_method_counter, (end - start));
   52.26    {
   52.27      // Print statistics as if before normal exit:
    53.1 --- a/src/share/vm/classfile/classLoaderData.cpp	Wed May 21 10:56:41 2014 -0700
    53.2 +++ b/src/share/vm/classfile/classLoaderData.cpp	Fri May 23 14:12:52 2014 -0700
    53.3 @@ -269,10 +269,10 @@
    53.4      ResourceMark rm;
    53.5      tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: "
    53.6                    PTR_FORMAT " loader: " PTR_FORMAT " %s",
    53.7 -                  k,
    53.8 +                  p2i(k),
    53.9                    k->external_name(),
   53.10 -                  k->class_loader_data(),
   53.11 -                  (void *)k->class_loader(),
   53.12 +                  p2i(k->class_loader_data()),
   53.13 +                  p2i((void *)k->class_loader()),
   53.14                    loader_name());
   53.15    }
   53.16  }
   53.17 @@ -307,11 +307,11 @@
   53.18  
   53.19    if (TraceClassLoaderData) {
   53.20      ResourceMark rm;
   53.21 -    tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this);
   53.22 -    tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(),
   53.23 +    tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this));
   53.24 +    tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
   53.25                 loader_name());
   53.26      if (is_anonymous()) {
   53.27 -      tty->print(" for anonymous class  "PTR_FORMAT " ", _klasses);
   53.28 +      tty->print(" for anonymous class  " INTPTR_FORMAT " ", p2i(_klasses));
   53.29      }
   53.30      tty->print_cr("]");
   53.31    }
   53.32 @@ -469,14 +469,14 @@
   53.33  void ClassLoaderData::dump(outputStream * const out) {
   53.34    ResourceMark rm;
   53.35    out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {",
   53.36 -      this, (void *)class_loader(),
   53.37 -      class_loader() != NULL ? class_loader()->klass() : NULL, loader_name());
   53.38 +      p2i(this), p2i((void *)class_loader()),
   53.39 +      p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
   53.40    if (claimed()) out->print(" claimed ");
   53.41    if (is_unloading()) out->print(" unloading ");
   53.42 -  out->print(" handles " INTPTR_FORMAT, handles());
   53.43 +  out->print(" handles " INTPTR_FORMAT, p2i(handles()));
   53.44    out->cr();
   53.45    if (metaspace_or_null() != NULL) {
   53.46 -    out->print_cr("metaspace: " PTR_FORMAT, metaspace_or_null());
   53.47 +    out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
   53.48      metaspace_or_null()->dump(out);
   53.49    } else {
   53.50      out->print_cr("metaspace: NULL");
   53.51 @@ -533,6 +533,8 @@
   53.52  ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
   53.53  ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
   53.54  
   53.55 +bool ClassLoaderDataGraph::_should_purge = false;
   53.56 +
   53.57  // Add a new class loader data node to the list.  Assign the newly created
   53.58  // ClassLoaderData into the java/lang/ClassLoader object as a hidden field
   53.59  ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRAPS) {
   53.60 @@ -570,8 +572,8 @@
   53.61        if (TraceClassLoaderData) {
   53.62          ResourceMark rm;
   53.63          tty->print("[ClassLoaderData: ");
   53.64 -        tty->print("create class loader data "PTR_FORMAT, cld);
   53.65 -        tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(),
   53.66 +        tty->print("create class loader data " INTPTR_FORMAT, p2i(cld));
   53.67 +        tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
   53.68                     cld->loader_name());
   53.69          tty->print_cr("]");
   53.70        }
   53.71 @@ -655,32 +657,6 @@
   53.72    return array;
   53.73  }
   53.74  
   53.75 -// For profiling and hsfind() only.  Otherwise, this is unsafe (and slow).  This
   53.76 -// is done lock free to avoid lock inversion problems.  It is safe because
   53.77 -// new ClassLoaderData are added to the end of the CLDG, and only removed at
   53.78 -// safepoint.  The _unloading list can be deallocated concurrently with CMS so
   53.79 -// this doesn't look in metaspace for classes that have been unloaded.
   53.80 -bool ClassLoaderDataGraph::contains(const void* x) {
   53.81 -  if (DumpSharedSpaces) {
   53.82 -    // There are only two metaspaces to worry about.
   53.83 -    ClassLoaderData* ncld = ClassLoaderData::the_null_class_loader_data();
   53.84 -    return (ncld->ro_metaspace()->contains(x) || ncld->rw_metaspace()->contains(x));
   53.85 -  }
   53.86 -
   53.87 -  if (UseSharedSpaces && MetaspaceShared::is_in_shared_space(x)) {
   53.88 -    return true;
   53.89 -  }
   53.90 -
   53.91 -  for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
   53.92 -    if (cld->metaspace_or_null() != NULL && cld->metaspace_or_null()->contains(x)) {
   53.93 -      return true;
   53.94 -    }
   53.95 -  }
   53.96 -
   53.97 -  // Do not check unloading list because deallocation can be concurrent.
   53.98 -  return false;
   53.99 -}
  53.100 -
  53.101  #ifndef PRODUCT
  53.102  bool ClassLoaderDataGraph::contains_loader_data(ClassLoaderData* loader_data) {
  53.103    for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
  53.104 @@ -739,6 +715,7 @@
  53.105  }
  53.106  
  53.107  void ClassLoaderDataGraph::purge() {
  53.108 +  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
  53.109    ClassLoaderData* list = _unloading;
  53.110    _unloading = NULL;
  53.111    ClassLoaderData* next = list;
  53.112 @@ -827,7 +804,7 @@
  53.113    if (class_loader() == NULL) {
  53.114      out->print("NULL class_loader");
  53.115    } else {
  53.116 -    out->print("class loader "PTR_FORMAT, this);
  53.117 +    out->print("class loader " INTPTR_FORMAT, p2i(this));
  53.118      class_loader()->print_value_on(out);
  53.119    }
  53.120  }
    54.1 --- a/src/share/vm/classfile/classLoaderData.hpp	Wed May 21 10:56:41 2014 -0700
    54.2 +++ b/src/share/vm/classfile/classLoaderData.hpp	Fri May 23 14:12:52 2014 -0700
    54.3 @@ -66,6 +66,7 @@
    54.4    static ClassLoaderData* _unloading;
    54.5    // CMS support.
    54.6    static ClassLoaderData* _saved_head;
    54.7 +  static bool _should_purge;
    54.8  
    54.9    static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
   54.10    static void post_class_unload_events(void);
   54.11 @@ -86,12 +87,20 @@
   54.12    static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); }
   54.13    static GrowableArray<ClassLoaderData*>* new_clds();
   54.14  
   54.15 +  static void set_should_purge(bool b) { _should_purge = b; }
   54.16 +  static void purge_if_needed() {
   54.17 +    // Only purge the CLDG for CMS if concurrent sweep is complete.
   54.18 +    if (_should_purge) {
   54.19 +      purge();
   54.20 +      // reset for next time.
   54.21 +      set_should_purge(false);
   54.22 +    }
   54.23 +  }
   54.24 +
   54.25    static void dump_on(outputStream * const out) PRODUCT_RETURN;
   54.26    static void dump() { dump_on(tty); }
   54.27    static void verify();
   54.28  
   54.29 -  // expensive test for pointer in metaspace for debugging
   54.30 -  static bool contains(const void* x);
   54.31  #ifndef PRODUCT
   54.32    static bool contains_loader_data(ClassLoaderData* loader_data);
   54.33  #endif
    55.1 --- a/src/share/vm/classfile/defaultMethods.cpp	Wed May 21 10:56:41 2014 -0700
    55.2 +++ b/src/share/vm/classfile/defaultMethods.cpp	Fri May 23 14:12:52 2014 -0700
    55.3 @@ -436,7 +436,7 @@
    55.4        _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
    55.5        if (TraceDefaultMethods) {
    55.6          _exception_message->print_value_on(tty);
    55.7 -        tty->print_cr("");
    55.8 +        tty->cr();
    55.9        }
   55.10      }
   55.11    }
   55.12 @@ -463,7 +463,7 @@
   55.13        if (_members.at(i).second == DISQUALIFIED) {
   55.14          str->print(" (disqualified)");
   55.15        }
   55.16 -      str->print_cr("");
   55.17 +      str->cr();
   55.18      }
   55.19  
   55.20      if (_selected_target != NULL) {
   55.21 @@ -480,7 +480,7 @@
   55.22      if (!method_holder->is_interface()) {
   55.23        tty->print(" : in superclass");
   55.24      }
   55.25 -    str->print_cr("");
   55.26 +    str->cr();
   55.27    }
   55.28  
   55.29    void print_exception(outputStream* str, int indent) {
   55.30 @@ -688,7 +688,7 @@
   55.31      for (int i = 0; i < slots->length(); ++i) {
   55.32        tty->indent();
   55.33        slots->at(i)->print_on(tty);
   55.34 -      tty->print_cr("");
   55.35 +      tty->cr();
   55.36      }
   55.37    }
   55.38  #endif // ndef PRODUCT
   55.39 @@ -828,7 +828,7 @@
   55.40        streamIndentor si(tty, 2);
   55.41        tty->indent().print("Looking for default methods for slot ");
   55.42        slot->print_on(tty);
   55.43 -      tty->print_cr("");
   55.44 +      tty->cr();
   55.45      }
   55.46  #endif // ndef PRODUCT
   55.47  
   55.48 @@ -946,7 +946,7 @@
   55.49        if (TraceDefaultMethods) {
   55.50          tty->print("for slot: ");
   55.51          slot->print_on(tty);
   55.52 -        tty->print_cr("");
   55.53 +        tty->cr();
   55.54          if (method->has_target()) {
   55.55            method->print_selected(tty, 1);
   55.56          } else if (method->throws_exception()) {
    56.1 --- a/src/share/vm/classfile/dictionary.cpp	Wed May 21 10:56:41 2014 -0700
    56.2 +++ b/src/share/vm/classfile/dictionary.cpp	Fri May 23 14:12:52 2014 -0700
    56.3 @@ -30,6 +30,7 @@
    56.4  #include "prims/jvmtiRedefineClassesTrace.hpp"
    56.5  #include "utilities/hashtable.inline.hpp"
    56.6  
    56.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
    56.8  
    56.9  DictionaryEntry*  Dictionary::_current_class_entry = NULL;
   56.10  int               Dictionary::_current_class_index =    0;
    57.1 --- a/src/share/vm/classfile/dictionary.hpp	Wed May 21 10:56:41 2014 -0700
    57.2 +++ b/src/share/vm/classfile/dictionary.hpp	Fri May 23 14:12:52 2014 -0700
    57.3 @@ -1,5 +1,5 @@
    57.4  /*
    57.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
    57.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
    57.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    57.8   *
    57.9   * This code is free software; you can redistribute it and/or modify it
   57.10 @@ -379,7 +379,7 @@
   57.11      }
   57.12      if (method_type() != NULL) {
   57.13        if (printed)  st->print(" and ");
   57.14 -      st->print(INTPTR_FORMAT, (void *)method_type());
   57.15 +      st->print(INTPTR_FORMAT, p2i((void *)method_type()));
   57.16        printed = true;
   57.17      }
   57.18      st->print_cr(printed ? "" : "(empty)");
    58.1 --- a/src/share/vm/classfile/javaClasses.cpp	Wed May 21 10:56:41 2014 -0700
    58.2 +++ b/src/share/vm/classfile/javaClasses.cpp	Fri May 23 14:12:52 2014 -0700
    58.3 @@ -51,6 +51,8 @@
    58.4  #include "runtime/vframe.hpp"
    58.5  #include "utilities/preserveException.hpp"
    58.6  
    58.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
    58.8 +
    58.9  #define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java)    \
   58.10    klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum);
   58.11  
   58.12 @@ -1481,7 +1483,7 @@
   58.13    while (h_throwable.not_null()) {
   58.14      objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable())));
   58.15      if (result.is_null()) {
   58.16 -      st->print_cr(no_stack_trace_message());
   58.17 +      st->print_cr("%s", no_stack_trace_message());
   58.18        return;
   58.19      }
   58.20  
    59.1 --- a/src/share/vm/classfile/symbolTable.cpp	Wed May 21 10:56:41 2014 -0700
    59.2 +++ b/src/share/vm/classfile/symbolTable.cpp	Fri May 23 14:12:52 2014 -0700
    59.3 @@ -39,6 +39,8 @@
    59.4  #include "gc_implementation/g1/g1StringDedup.hpp"
    59.5  #endif
    59.6  
    59.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
    59.8 +
    59.9  // --------------------------------------------------------------------------
   59.10  
   59.11  // the number of buckets a thread claims
    60.1 --- a/src/share/vm/classfile/systemDictionary.cpp	Wed May 21 10:56:41 2014 -0700
    60.2 +++ b/src/share/vm/classfile/systemDictionary.cpp	Fri May 23 14:12:52 2014 -0700
    60.3 @@ -2268,7 +2268,7 @@
    60.4        oop appendix = appendix_box->obj_at(0);
    60.5        if (TraceMethodHandles) {
    60.6      #ifndef PRODUCT
    60.7 -        tty->print("Linked method="INTPTR_FORMAT": ", m);
    60.8 +        tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m));
    60.9          m->print();
   60.10          if (appendix != NULL) { tty->print("appendix = "); appendix->print(); }
   60.11          tty->cr();
    61.1 --- a/src/share/vm/classfile/verifier.cpp	Wed May 21 10:56:41 2014 -0700
    61.2 +++ b/src/share/vm/classfile/verifier.cpp	Fri May 23 14:12:52 2014 -0700
    61.3 @@ -364,7 +364,7 @@
    61.4  
    61.5  void ErrorContext::details(outputStream* ss, const Method* method) const {
    61.6    if (is_valid()) {
    61.7 -    ss->print_cr("");
    61.8 +    ss->cr();
    61.9      ss->print_cr("Exception Details:");
   61.10      location_details(ss, method);
   61.11      reason_details(ss);
   61.12 @@ -379,7 +379,7 @@
   61.13    streamIndentor si(ss);
   61.14    ss->indent().print_cr("Reason:");
   61.15    streamIndentor si2(ss);
   61.16 -  ss->indent().print("");
   61.17 +  ss->indent().print("%s", "");
   61.18    switch (_fault) {
   61.19      case INVALID_BYTECODE:
   61.20        ss->print("Error exists in the bytecode");
   61.21 @@ -432,7 +432,7 @@
   61.22        ShouldNotReachHere();
   61.23        ss->print_cr("Unknown");
   61.24    }
   61.25 -  ss->print_cr("");
   61.26 +  ss->cr();
   61.27  }
   61.28  
   61.29  void ErrorContext::location_details(outputStream* ss, const Method* method) const {
   61.30 @@ -507,7 +507,7 @@
   61.31      for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
   61.32        ss->indent();
   61.33        sm_frame->print_on(ss, current_offset);
   61.34 -      ss->print_cr("");
   61.35 +      ss->cr();
   61.36        current_offset += sm_frame->offset_delta();
   61.37        sm_frame = sm_frame->next();
   61.38      }
   61.39 @@ -579,7 +579,8 @@
   61.40      tty->print_cr("Verifying method %s", m->name_and_sig_as_C_string());
   61.41    }
   61.42  
   61.43 -  const char* bad_type_msg = "Bad type on operand stack in %s";
   61.44 +// For clang, the only good constant format string is a literal constant format string.
   61.45 +#define bad_type_msg "Bad type on operand stack in %s"
   61.46  
   61.47    int32_t max_stack = m->verifier_max_stack();
   61.48    int32_t max_locals = m->max_locals();
   61.49 @@ -1676,6 +1677,8 @@
   61.50    }
   61.51  }
   61.52  
   61.53 +#undef bad_type_message
   61.54 +
   61.55  char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) {
   61.56    char* code_data = NEW_RESOURCE_ARRAY(char, code_length);
   61.57    memset(code_data, 0, sizeof(char) * code_length);
   61.58 @@ -2363,11 +2366,12 @@
   61.59    if (opcode == Bytecodes::_invokedynamic) {
   61.60      if (!EnableInvokeDynamic ||
   61.61          _klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
   61.62 -      class_format_error(
   61.63 -        (!EnableInvokeDynamic ?
   61.64 -         "invokedynamic instructions not enabled in this JVM" :
   61.65 -         "invokedynamic instructions not supported by this class file version"),
   61.66 -        _klass->external_name());
   61.67 +        if (!EnableInvokeDynamic) {
   61.68 +            class_format_error("invokedynamic instructions not enabled in this JVM");
   61.69 +        } else {
   61.70 +            class_format_error("invokedynamic instructions not supported by this class file version (%d), class %s",
   61.71 +                               _klass->major_version(), _klass->external_name());
   61.72 +        }
   61.73        return;
   61.74      }
   61.75    } else {
    62.1 --- a/src/share/vm/classfile/verifier.hpp	Wed May 21 10:56:41 2014 -0700
    62.2 +++ b/src/share/vm/classfile/verifier.hpp	Fri May 23 14:12:52 2014 -0700
    62.3 @@ -1,5 +1,5 @@
    62.4  /*
    62.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    62.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    62.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    62.8   *
    62.9   * This code is free software; you can redistribute it and/or modify it
   62.10 @@ -375,15 +375,15 @@
   62.11    bool has_error() const { return result() != NULL; }
   62.12    char* exception_message() {
   62.13      stringStream ss;
   62.14 -    ss.print(_message);
   62.15 +    ss.print("%s", _message);
   62.16      _error_context.details(&ss, _method());
   62.17      return ss.as_string();
   62.18    }
   62.19  
   62.20    // Called when verify or class format errors are encountered.
   62.21    // May throw an exception based upon the mode.
   62.22 -  void verify_error(ErrorContext ctx, const char* fmt, ...);
   62.23 -  void class_format_error(const char* fmt, ...);
   62.24 +  void verify_error(ErrorContext ctx, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);
   62.25 +  void class_format_error(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3);
   62.26  
   62.27    Klass* load_class(Symbol* name, TRAPS);
   62.28  
    63.1 --- a/src/share/vm/classfile/vmSymbols.cpp	Wed May 21 10:56:41 2014 -0700
    63.2 +++ b/src/share/vm/classfile/vmSymbols.cpp	Fri May 23 14:12:52 2014 -0700
    63.3 @@ -1,5 +1,5 @@
    63.4  /*
    63.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    63.6 + * Copyright (c) 1997, 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 @@ -533,7 +533,7 @@
   63.11      xtty->begin_elem("intrinsic_misdeclared actual='%s' declared='%s'",
   63.12                       actual_name, declared_name);
   63.13      xtty->method(mh);
   63.14 -    xtty->end_elem("");
   63.15 +    xtty->end_elem("%s", "");
   63.16    }
   63.17    if (PrintMiscellaneous && (WizardMode || Verbose)) {
   63.18      tty->print_cr("*** misidentified method; %s(%d) should be %s(%d):",
    64.1 --- a/src/share/vm/code/codeBlob.cpp	Wed May 21 10:56:41 2014 -0700
    64.2 +++ b/src/share/vm/code/codeBlob.cpp	Fri May 23 14:12:52 2014 -0700
    64.3 @@ -1,5 +1,5 @@
    64.4  /*
    64.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    64.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    64.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    64.8   *
    64.9   * This code is free software; you can redistribute it and/or modify it
   64.10 @@ -530,7 +530,7 @@
   64.11  }
   64.12  
   64.13  void CodeBlob::print_on(outputStream* st) const {
   64.14 -  st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
   64.15 +  st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", p2i(this));
   64.16    st->print_cr("Framesize: %d", _frame_size);
   64.17  }
   64.18  
   64.19 @@ -548,7 +548,7 @@
   64.20  }
   64.21  
   64.22  void BufferBlob::print_value_on(outputStream* st) const {
   64.23 -  st->print_cr("BufferBlob (" INTPTR_FORMAT  ") used for %s", this, name());
   64.24 +  st->print_cr("BufferBlob (" INTPTR_FORMAT  ") used for %s", p2i(this), name());
   64.25  }
   64.26  
   64.27  void RuntimeStub::verify() {
   64.28 @@ -558,13 +558,13 @@
   64.29  void RuntimeStub::print_on(outputStream* st) const {
   64.30    ttyLocker ttyl;
   64.31    CodeBlob::print_on(st);
   64.32 -  st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
   64.33 -  st->print_cr(name());
   64.34 +  st->print("Runtime Stub (" INTPTR_FORMAT "): ", p2i(this));
   64.35 +  st->print_cr("%s", name());
   64.36    Disassembler::decode((CodeBlob*)this, st);
   64.37  }
   64.38  
   64.39  void RuntimeStub::print_value_on(outputStream* st) const {
   64.40 -  st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name());
   64.41 +  st->print("RuntimeStub (" INTPTR_FORMAT "): ", p2i(this)); st->print("%s", name());
   64.42  }
   64.43  
   64.44  void SingletonBlob::verify() {
   64.45 @@ -574,12 +574,12 @@
   64.46  void SingletonBlob::print_on(outputStream* st) const {
   64.47    ttyLocker ttyl;
   64.48    CodeBlob::print_on(st);
   64.49 -  st->print_cr(name());
   64.50 +  st->print_cr("%s", name());
   64.51    Disassembler::decode((CodeBlob*)this, st);
   64.52  }
   64.53  
   64.54  void SingletonBlob::print_value_on(outputStream* st) const {
   64.55 -  st->print_cr(name());
   64.56 +  st->print_cr("%s", name());
   64.57  }
   64.58  
   64.59  void DeoptimizationBlob::print_value_on(outputStream* st) const {
    65.1 --- a/src/share/vm/code/codeCache.cpp	Wed May 21 10:56:41 2014 -0700
    65.2 +++ b/src/share/vm/code/codeCache.cpp	Fri May 23 14:12:52 2014 -0700
    65.3 @@ -1,5 +1,5 @@
    65.4  /*
    65.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    65.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    65.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    65.8   *
    65.9   * This code is free software; you can redistribute it and/or modify it
   65.10 @@ -81,10 +81,10 @@
   65.11    bool is_empty()                                { return count == 0; }
   65.12  
   65.13    void print(const char* title) {
   65.14 -    tty->print_cr(" #%d %s = %dK (hdr %d%%,  loc %d%%, code %d%%, stub %d%%, [oops %d%%, data %d%%, pcs %d%%])",
   65.15 +    tty->print_cr(" #%d %s = %dK (hdr %d%%,  loc %d%%, code %d%%, stub %d%%, [oops %d%%, metadata %d%%, data %d%%, pcs %d%%])",
   65.16                    count,
   65.17                    title,
   65.18 -                  total() / K,
   65.19 +                  (int)(total() / K),
   65.20                    header_size             * 100 / total_size,
   65.21                    relocation_size         * 100 / total_size,
   65.22                    code_size               * 100 / total_size,
   65.23 @@ -191,7 +191,7 @@
   65.24      }
   65.25      if (PrintCodeCacheExtension) {
   65.26        ResourceMark rm;
   65.27 -      tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)",
   65.28 +      tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
   65.29                      (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(),
   65.30                      (address)_heap->high() - (address)_heap->low_boundary());
   65.31      }
   65.32 @@ -496,7 +496,7 @@
   65.33            if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) {
   65.34              CompiledIC *ic = CompiledIC_at(iter.reloc());
   65.35              if (TraceCompiledIC) {
   65.36 -              tty->print("noticed icholder " INTPTR_FORMAT " ", ic->cached_icholder());
   65.37 +              tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
   65.38                ic->print();
   65.39              }
   65.40              assert(ic->cached_icholder() != NULL, "must be non-NULL");
   65.41 @@ -775,7 +775,7 @@
   65.42    if (PrintCodeCache2) {  // Need to add a new flag
   65.43      ResourceMark rm;
   65.44      if (size == 0)  size = cb->size();
   65.45 -    tty->print_cr("CodeCache %s:  addr: " INTPTR_FORMAT ", size: 0x%x", event, cb, size);
   65.46 +    tty->print_cr("CodeCache %s:  addr: " INTPTR_FORMAT ", size: 0x%x", event, p2i(cb), size);
   65.47    }
   65.48  }
   65.49  
   65.50 @@ -900,7 +900,7 @@
   65.51  
   65.52    tty->print_cr("CodeCache:");
   65.53  
   65.54 -  tty->print_cr("nmethod dependency checking time %f", dependentCheckTime.seconds(),
   65.55 +  tty->print_cr("nmethod dependency checking time %f, per dependent %f", dependentCheckTime.seconds(),
   65.56                  dependentCheckTime.seconds() / dependentCheckCount);
   65.57  
   65.58    if (!live.is_empty()) {
   65.59 @@ -947,9 +947,9 @@
   65.60  
   65.61    if (detailed) {
   65.62      st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
   65.63 -                 _heap->low_boundary(),
   65.64 -                 _heap->high(),
   65.65 -                 _heap->high_boundary());
   65.66 +                 p2i(_heap->low_boundary()),
   65.67 +                 p2i(_heap->high()),
   65.68 +                 p2i(_heap->high_boundary()));
   65.69      st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
   65.70                   " adapters=" UINT32_FORMAT,
   65.71                   nof_blobs(), nof_nmethods(), nof_adapters());
    66.1 --- a/src/share/vm/code/compiledIC.cpp	Wed May 21 10:56:41 2014 -0700
    66.2 +++ b/src/share/vm/code/compiledIC.cpp	Fri May 23 14:12:52 2014 -0700
    66.3 @@ -1,5 +1,5 @@
    66.4  /*
    66.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    66.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    66.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    66.8   *
    66.9   * This code is free software; you can redistribute it and/or modify it
   66.10 @@ -88,9 +88,9 @@
   66.11    if (TraceCompiledIC) {
   66.12      tty->print("  ");
   66.13      print_compiled_ic();
   66.14 -    tty->print(" changing destination to " INTPTR_FORMAT, entry_point);
   66.15 +    tty->print(" changing destination to " INTPTR_FORMAT, p2i(entry_point));
   66.16      if (!is_optimized()) {
   66.17 -      tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", (address)cache);
   66.18 +      tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", p2i((address)cache));
   66.19      }
   66.20      if (is_icstub) {
   66.21        tty->print(" (icstub)");
   66.22 @@ -195,7 +195,7 @@
   66.23    if (TraceICs) {
   66.24      ResourceMark rm;
   66.25      tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
   66.26 -                   instruction_address(), call_info->selected_method()->print_value_string(), entry);
   66.27 +                   p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
   66.28    }
   66.29  
   66.30    // We can't check this anymore. With lazy deopt we could have already
   66.31 @@ -272,7 +272,7 @@
   66.32  void CompiledIC::set_to_clean() {
   66.33    assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call");
   66.34    if (TraceInlineCacheClearing || TraceICs) {
   66.35 -    tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", instruction_address());
   66.36 +    tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address()));
   66.37      print();
   66.38    }
   66.39  
   66.40 @@ -354,7 +354,7 @@
   66.41        if (TraceICs) {
   66.42           ResourceMark rm(thread);
   66.43           tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s",
   66.44 -           instruction_address(),
   66.45 +           p2i(instruction_address()),
   66.46             method->print_value_string());
   66.47        }
   66.48      } else {
   66.49 @@ -362,7 +362,7 @@
   66.50        InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry());
   66.51        if (TraceICs) {
   66.52           ResourceMark rm(thread);
   66.53 -         tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", instruction_address());
   66.54 +         tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address()));
   66.55        }
   66.56      }
   66.57    } else {
   66.58 @@ -392,7 +392,7 @@
   66.59        ResourceMark rm(thread);
   66.60        assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");
   66.61        tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s",
   66.62 -        instruction_address(),
   66.63 +        p2i(instruction_address()),
   66.64          ((Klass*)info.cached_metadata())->print_value_string(),
   66.65          (safe) ? "" : "via stub");
   66.66      }
   66.67 @@ -530,8 +530,8 @@
   66.68      if (TraceICs) {
   66.69        ResourceMark rm;
   66.70        tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT,
   66.71 -                    instruction_address(),
   66.72 -                    info.entry());
   66.73 +                    p2i(instruction_address()),
   66.74 +                    p2i(info.entry()));
   66.75      }
   66.76      // Call to compiled code
   66.77      assert (CodeCache::contains(info.entry()), "wrong entry point");
   66.78 @@ -600,11 +600,11 @@
   66.79  
   66.80  void CompiledIC::print_compiled_ic() {
   66.81    tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT,
   66.82 -             instruction_address(), is_call_to_interpreted() ? "interpreted " : "", ic_destination(), is_optimized() ? NULL : cached_value());
   66.83 +             p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value()));
   66.84  }
   66.85  
   66.86  void CompiledStaticCall::print() {
   66.87 -  tty->print("static call at " INTPTR_FORMAT " -> ", instruction_address());
   66.88 +  tty->print("static call at " INTPTR_FORMAT " -> ", p2i(instruction_address()));
   66.89    if (is_clean()) {
   66.90      tty->print("clean");
   66.91    } else if (is_call_to_compiled()) {
    67.1 --- a/src/share/vm/code/compressedStream.cpp	Wed May 21 10:56:41 2014 -0700
    67.2 +++ b/src/share/vm/code/compressedStream.cpp	Fri May 23 14:12:52 2014 -0700
    67.3 @@ -1,5 +1,5 @@
    67.4  /*
    67.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    67.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    67.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    67.8   *
    67.9   * This code is free software; you can redistribute it and/or modify it
   67.10 @@ -212,6 +212,8 @@
   67.11    return h ^ l;
   67.12  }
   67.13  
   67.14 +PRAGMA_DIAG_PUSH
   67.15 +PRAGMA_FORMAT_IGNORED // Someone needs to deal with this.
   67.16  void test_compressed_stream(int trace) {
   67.17    CompressedWriteStream bytes(stretch_limit * 100);
   67.18    jint n;
   67.19 @@ -275,6 +277,7 @@
   67.20    guarantee(length == length2, "bad length");
   67.21    guarantee(fails == 0, "test failures");
   67.22  }
   67.23 +PRAGMA_DIAG_POP
   67.24  
   67.25  #if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64)
   67.26  #pragma warning(default: 4748)
    68.1 --- a/src/share/vm/code/debugInfo.cpp	Wed May 21 10:56:41 2014 -0700
    68.2 +++ b/src/share/vm/code/debugInfo.cpp	Fri May 23 14:12:52 2014 -0700
    68.3 @@ -1,5 +1,5 @@
    68.4  /*
    68.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    68.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    68.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    68.8   *
    68.9   * This code is free software; you can redistribute it and/or modify it
   68.10 @@ -28,7 +28,9 @@
   68.11  #include "code/nmethod.hpp"
   68.12  #include "runtime/handles.inline.hpp"
   68.13  
   68.14 -// Comstructors
   68.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   68.16 +
   68.17 +// Constructors
   68.18  
   68.19  DebugInfoWriteStream::DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size)
   68.20  : CompressedWriteStream(initial_size) {
    69.1 --- a/src/share/vm/code/exceptionHandlerTable.cpp	Wed May 21 10:56:41 2014 -0700
    69.2 +++ b/src/share/vm/code/exceptionHandlerTable.cpp	Fri May 23 14:12:52 2014 -0700
    69.3 @@ -1,5 +1,5 @@
    69.4  /*
    69.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    69.6 + * Copyright (c) 1998, 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 @@ -27,6 +27,8 @@
   69.11  #include "code/nmethod.hpp"
   69.12  #include "memory/allocation.inline.hpp"
   69.13  
   69.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   69.15 +
   69.16  void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) {
   69.17    _nesting.check();
   69.18    if (_length >= _size) {
    70.1 --- a/src/share/vm/code/icBuffer.cpp	Wed May 21 10:56:41 2014 -0700
    70.2 +++ b/src/share/vm/code/icBuffer.cpp	Fri May 23 14:12:52 2014 -0700
    70.3 @@ -1,5 +1,5 @@
    70.4  /*
    70.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    70.6 + * Copyright (c) 1997, 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 @@ -39,6 +39,7 @@
   70.11  #include "runtime/mutexLocker.hpp"
   70.12  #include "runtime/stubRoutines.hpp"
   70.13  
   70.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   70.15  
   70.16  DEF_STUB_INTERFACE(ICStub);
   70.17  
    71.1 --- a/src/share/vm/code/nmethod.cpp	Wed May 21 10:56:41 2014 -0700
    71.2 +++ b/src/share/vm/code/nmethod.cpp	Fri May 23 14:12:52 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 @@ -46,6 +46,8 @@
   71.11  #include "shark/sharkCompiler.hpp"
   71.12  #endif
   71.13  
   71.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   71.15 +
   71.16  #ifdef DTRACE_ENABLED
   71.17  
   71.18  // Only bother with this argument setup if dtrace is available
    72.1 --- a/src/share/vm/code/pcDesc.cpp	Wed May 21 10:56:41 2014 -0700
    72.2 +++ b/src/share/vm/code/pcDesc.cpp	Fri May 23 14:12:52 2014 -0700
    72.3 @@ -1,5 +1,5 @@
    72.4  /*
    72.5 - * Copyright (c) 1997, 2010, 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 @@ -29,6 +29,8 @@
   72.11  #include "code/scopeDesc.hpp"
   72.12  #include "memory/resourceArea.hpp"
   72.13  
   72.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   72.15 +
   72.16  PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) {
   72.17    _pc_offset           = pc_offset;
   72.18    _scope_decode_offset = scope_decode_offset;
    73.1 --- a/src/share/vm/code/relocInfo.cpp	Wed May 21 10:56:41 2014 -0700
    73.2 +++ b/src/share/vm/code/relocInfo.cpp	Fri May 23 14:12:52 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 @@ -31,6 +31,7 @@
   73.11  #include "runtime/stubCodeGenerator.hpp"
   73.12  #include "utilities/copy.hpp"
   73.13  
   73.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   73.15  
   73.16  const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
   73.17  
    74.1 --- a/src/share/vm/code/scopeDesc.cpp	Wed May 21 10:56:41 2014 -0700
    74.2 +++ b/src/share/vm/code/scopeDesc.cpp	Fri May 23 14:12:52 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 @@ -30,6 +30,7 @@
   74.11  #include "oops/oop.inline.hpp"
   74.12  #include "runtime/handles.inline.hpp"
   74.13  
   74.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   74.15  
   74.16  ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) {
   74.17    _code          = code;
    75.1 --- a/src/share/vm/code/vtableStubs.cpp	Wed May 21 10:56:41 2014 -0700
    75.2 +++ b/src/share/vm/code/vtableStubs.cpp	Fri May 23 14:12:52 2014 -0700
    75.3 @@ -1,5 +1,5 @@
    75.4  /*
    75.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    75.6 + * Copyright (c) 1997, 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 @@ -39,6 +39,8 @@
   75.11  #include "opto/matcher.hpp"
   75.12  #endif
   75.13  
   75.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   75.15 +
   75.16  // -----------------------------------------------------------------------------------------
   75.17  // Implementation of VtableStub
   75.18  
    76.1 --- a/src/share/vm/compiler/compileBroker.cpp	Wed May 21 10:56:41 2014 -0700
    76.2 +++ b/src/share/vm/compiler/compileBroker.cpp	Fri May 23 14:12:52 2014 -0700
    76.3 @@ -1,5 +1,5 @@
    76.4  /*
    76.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    76.6 + * Copyright (c) 1999, 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 @@ -206,7 +206,7 @@
   76.11    void log_nmethod(JavaThread* thread, nmethod* nm) {
   76.12      log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]",
   76.13          nm->compile_id(), nm->is_osr_method() ? "%" : "",
   76.14 -        nm, nm->code_begin(), nm->code_end());
   76.15 +        p2i(nm), p2i(nm->code_begin()), p2i(nm->code_end()));
   76.16    }
   76.17  
   76.18    void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) {
   76.19 @@ -1791,7 +1791,7 @@
   76.20          if (xtty != NULL) {
   76.21            ttyLocker ttyl;
   76.22            // Record any per thread log files
   76.23 -          xtty->elem("thread_logfile thread='%d' filename='%s'", thread_id, file_name);
   76.24 +          xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name);
   76.25          }
   76.26          return;
   76.27        }
   76.28 @@ -1822,7 +1822,7 @@
   76.29    if (_should_block) {
   76.30  #ifndef PRODUCT
   76.31      if (PrintCompilation && (Verbose || WizardMode))
   76.32 -      tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", Thread::current());
   76.33 +      tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", p2i(Thread::current()));
   76.34  #endif
   76.35      ThreadInVMfromNative tivfn(JavaThread::current());
   76.36    }
   76.37 @@ -1839,7 +1839,7 @@
   76.38      CodeCache::print_summary(&s, detailed);
   76.39    }
   76.40    ttyLocker ttyl;
   76.41 -  tty->print(s.as_string());
   76.42 +  tty->print("%s", s.as_string());
   76.43  }
   76.44  
   76.45  // ------------------------------------------------------------------
   76.46 @@ -2044,7 +2044,7 @@
   76.47        // Lock to prevent tearing
   76.48        ttyLocker ttyl;
   76.49        xtty->begin_elem("code_cache_full");
   76.50 -      xtty->print(s.as_string());
   76.51 +      xtty->print("%s", s.as_string());
   76.52        xtty->stamp();
   76.53        xtty->end_elem();
   76.54      }
    77.1 --- a/src/share/vm/compiler/compileLog.cpp	Wed May 21 10:56:41 2014 -0700
    77.2 +++ b/src/share/vm/compiler/compileLog.cpp	Fri May 23 14:12:52 2014 -0700
    77.3 @@ -1,5 +1,5 @@
    77.4  /*
    77.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    77.6 + * Copyright (c) 2002, 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 @@ -294,7 +294,7 @@
   77.11  // Print about successful method inlining.
   77.12  void CompileLog::inline_success(const char* reason) {
   77.13    begin_elem("inline_success reason='");
   77.14 -  text(reason);
   77.15 +  text("%s", reason);
   77.16    end_elem("'");
   77.17  }
   77.18  
   77.19 @@ -304,7 +304,7 @@
   77.20  // Print about failed method inlining.
   77.21  void CompileLog::inline_fail(const char* reason) {
   77.22    begin_elem("inline_fail reason='");
   77.23 -  text(reason);
   77.24 +  text("%s", reason);
   77.25    end_elem("'");
   77.26  }
   77.27  
   77.28 @@ -330,5 +330,5 @@
   77.29  void CompileLog::code_cache_state() {
   77.30    begin_elem("code_cache");
   77.31    CodeCache::log_state(this);
   77.32 -  end_elem("");
   77.33 +  end_elem("%s", "");
   77.34  }
    78.1 --- a/src/share/vm/compiler/compileLog.hpp	Wed May 21 10:56:41 2014 -0700
    78.2 +++ b/src/share/vm/compiler/compileLog.hpp	Fri May 23 14:12:52 2014 -0700
    78.3 @@ -1,5 +1,5 @@
    78.4  /*
    78.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    78.6 + * Copyright (c) 2002, 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 @@ -54,7 +54,7 @@
   78.11  
   78.12    static CompileLog* _first;     // head of static chain
   78.13  
   78.14 -  void va_tag(bool push, const char* format, va_list ap);
   78.15 +  void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
   78.16  
   78.17   public:
   78.18    CompileLog(const char* file_name, FILE* fp, intx thread_id);
   78.19 @@ -68,7 +68,7 @@
   78.20    // or reset, context string will be silently ignored
   78.21    stringStream* context()                        { return &_context; }
   78.22    void    clear_context()                        { context()->reset(); }
   78.23 -  void      set_context(const char* format, ...);
   78.24 +  void      set_context(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
   78.25  
   78.26    void          name(ciSymbol* s);               // name='s'
   78.27    void          name(Symbol* s)                  { xmlStream::name(s); }
    79.1 --- a/src/share/vm/compiler/compilerOracle.cpp	Wed May 21 10:56:41 2014 -0700
    79.2 +++ b/src/share/vm/compiler/compilerOracle.cpp	Fri May 23 14:12:52 2014 -0700
    79.3 @@ -1,5 +1,5 @@
    79.4  /*
    79.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    79.6 + * Copyright (c) 1998, 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 @@ -539,7 +539,7 @@
   79.11      tty->print_cr("CompilerOracle: unrecognized line");
   79.12      tty->print_cr("  \"%s\"", original_line);
   79.13      if (error_msg != NULL) {
   79.14 -      tty->print_cr(error_msg);
   79.15 +      tty->print_cr("%s", error_msg);
   79.16      }
   79.17    }
   79.18  }
   79.19 @@ -661,7 +661,7 @@
   79.20    char method_sep = have_colon ? ':' : '.';
   79.21  
   79.22    if (Verbose) {
   79.23 -    tty->print_cr(line);
   79.24 +    tty->print_cr("%s", line);
   79.25    }
   79.26  
   79.27    ResourceMark rm;
    80.1 --- a/src/share/vm/compiler/disassembler.cpp	Wed May 21 10:56:41 2014 -0700
    80.2 +++ b/src/share/vm/compiler/disassembler.cpp	Fri May 23 14:12:52 2014 -0700
    80.3 @@ -1,5 +1,5 @@
    80.4  /*
    80.5 - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
    80.6 + * Copyright (c) 2008, 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 @@ -51,6 +51,8 @@
   80.11  #include "shark/sharkEntry.hpp"
   80.12  #endif
   80.13  
   80.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   80.15 +
   80.16  void*       Disassembler::_library               = NULL;
   80.17  bool        Disassembler::_tried_to_load_library = false;
   80.18  
   80.19 @@ -411,6 +413,7 @@
   80.20    return env->handle_event(event, (address) arg);
   80.21  }
   80.22  
   80.23 +ATTRIBUTE_PRINTF(2, 3)
   80.24  static int printf_to_env(void* env_pv, const char* format, ...) {
   80.25    decode_env* env = (decode_env*) env_pv;
   80.26    outputStream* st = env->output();
    81.1 --- a/src/share/vm/compiler/methodLiveness.cpp	Wed May 21 10:56:41 2014 -0700
    81.2 +++ b/src/share/vm/compiler/methodLiveness.cpp	Fri May 23 14:12:52 2014 -0700
    81.3 @@ -1,5 +1,5 @@
    81.4  /*
    81.5 - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
    81.6 + * Copyright (c) 1998, 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 @@ -32,6 +32,8 @@
   81.11  #include "memory/allocation.inline.hpp"
   81.12  #include "utilities/bitMap.inline.hpp"
   81.13  
   81.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   81.15 +
   81.16  // The MethodLiveness class performs a simple liveness analysis on a method
   81.17  // in order to decide which locals are live (that is, will be used again) at
   81.18  // a particular bytecode index (bci).
    82.1 --- a/src/share/vm/compiler/oopMap.cpp	Wed May 21 10:56:41 2014 -0700
    82.2 +++ b/src/share/vm/compiler/oopMap.cpp	Fri May 23 14:12:52 2014 -0700
    82.3 @@ -1,5 +1,5 @@
    82.4  /*
    82.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    82.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    82.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    82.8   *
    82.9   * This code is free software; you can redistribute it and/or modify it
   82.10 @@ -646,8 +646,8 @@
   82.11        tty->print_cr(
   82.12          "Add derived pointer@" INTPTR_FORMAT
   82.13          " - Derived: " INTPTR_FORMAT
   82.14 -        " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: %d)",
   82.15 -        derived_loc, (address)*derived_loc, (address)*base_loc, base_loc, offset
   82.16 +        " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: " INTX_FORMAT ")",
   82.17 +        p2i(derived_loc), p2i((address)*derived_loc), p2i((address)*base_loc), p2i(base_loc), offset
   82.18        );
   82.19      }
   82.20      // Set derived oop location to point to base.
   82.21 @@ -674,8 +674,8 @@
   82.22  
   82.23      if (TraceDerivedPointers) {
   82.24        tty->print_cr("Updating derived pointer@" INTPTR_FORMAT
   82.25 -                    " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: %d)",
   82.26 -          derived_loc, (address)*derived_loc, (address)base, offset);
   82.27 +                    " - Derived: " INTPTR_FORMAT "  Base: " INTPTR_FORMAT " (Offset: " INTX_FORMAT ")",
   82.28 +          p2i(derived_loc), p2i((address)*derived_loc), p2i((address)base), offset);
   82.29      }
   82.30  
   82.31      // Delete entry
    83.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp	Wed May 21 10:56:41 2014 -0700
    83.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp	Fri May 23 14:12:52 2014 -0700
    83.3 @@ -1,5 +1,5 @@
    83.4  /*
    83.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
    83.6 + * Copyright (c) 2012, 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 @@ -157,7 +157,7 @@
   83.11                   " split_deaths(" SIZE_FORMAT ")"
   83.12                   " coal_deaths(" SIZE_FORMAT ")"
   83.13                   " + count(" SSIZE_FORMAT ")",
   83.14 -                 this, size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
   83.15 +                 p2i(this), size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
   83.16                   _allocation_stats.split_births(), _allocation_stats.split_deaths(),
   83.17                   _allocation_stats.coal_deaths(), count()));
   83.18  }
    84.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Wed May 21 10:56:41 2014 -0700
    84.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Fri May 23 14:12:52 2014 -0700
    84.3 @@ -1,5 +1,5 @@
    84.4  /*
    84.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
    84.6 + * Copyright (c) 2001, 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 @@ -427,7 +427,7 @@
   84.11  void LinearAllocBlock::print_on(outputStream* st) const {
   84.12    st->print_cr(" LinearAllocBlock: ptr = " PTR_FORMAT ", word_size = " SIZE_FORMAT
   84.13              ", refillsize = " SIZE_FORMAT ", allocation_size_limit = " SIZE_FORMAT,
   84.14 -            _ptr, _word_size, _refillSize, _allocation_size_limit);
   84.15 +            p2i(_ptr), _word_size, _refillSize, _allocation_size_limit);
   84.16  }
   84.17  
   84.18  void CompactibleFreeListSpace::print_on(outputStream* st) const {
   84.19 @@ -458,7 +458,7 @@
   84.20      for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL;
   84.21           fc = fc->next()) {
   84.22        gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ")  %s",
   84.23 -                          fc, (HeapWord*)fc + i,
   84.24 +                          p2i(fc), p2i((HeapWord*)fc + i),
   84.25                            fc->cantCoalesce() ? "\t CC" : "");
   84.26      }
   84.27    }
   84.28 @@ -502,7 +502,7 @@
   84.29    if (_sp->block_is_obj(addr)) {
   84.30      const bool dead = _post_remark && !_live_bit_map->isMarked(addr);
   84.31      _st->print_cr(PTR_FORMAT ": %s object of size " SIZE_FORMAT "%s",
   84.32 -      addr,
   84.33 +      p2i(addr),
   84.34        dead ? "dead" : "live",
   84.35        sz,
   84.36        (!dead && CMSPrintObjectsInDump) ? ":" : ".");
   84.37 @@ -512,7 +512,7 @@
   84.38      }
   84.39    } else { // free block
   84.40      _st->print_cr(PTR_FORMAT ": free block of size " SIZE_FORMAT "%s",
   84.41 -      addr, sz, CMSPrintChunksInDump ? ":" : ".");
   84.42 +      p2i(addr), sz, CMSPrintChunksInDump ? ":" : ".");
   84.43      if (CMSPrintChunksInDump) {
   84.44        ((FreeChunk*)addr)->print_on(_st);
   84.45        _st->print_cr("--------------------------------------");
   84.46 @@ -564,11 +564,11 @@
   84.47                        "--------------------------------\n");
   84.48    size_t total_size = totalSizeInIndexedFreeLists();
   84.49    size_t   free_blocks = numFreeBlocksInIndexedFreeLists();
   84.50 -  gclog_or_tty->print("Total Free Space: %d\n", total_size);
   84.51 -  gclog_or_tty->print("Max   Chunk Size: %d\n", maxChunkSizeInIndexedFreeLists());
   84.52 -  gclog_or_tty->print("Number of Blocks: %d\n", free_blocks);
   84.53 +  gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size);
   84.54 +  gclog_or_tty->print("Max   Chunk Size: " SIZE_FORMAT "\n", maxChunkSizeInIndexedFreeLists());
   84.55 +  gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks);
   84.56    if (free_blocks != 0) {
   84.57 -    gclog_or_tty->print("Av.  Block  Size: %d\n", total_size/free_blocks);
   84.58 +    gclog_or_tty->print("Av.  Block  Size: " SIZE_FORMAT "\n", total_size/free_blocks);
   84.59    }
   84.60  }
   84.61  
   84.62 @@ -2011,7 +2011,7 @@
   84.63    assert(ur.contains(urasm),
   84.64           err_msg(" Error at save_marks(): [" PTR_FORMAT "," PTR_FORMAT ")"
   84.65                   " should contain [" PTR_FORMAT "," PTR_FORMAT ")",
   84.66 -                 ur.start(), ur.end(), urasm.start(), urasm.end()));
   84.67 +                 p2i(ur.start()), p2i(ur.end()), p2i(urasm.start()), p2i(urasm.end())));
   84.68  #endif
   84.69    // inform allocator that promotions should be tracked.
   84.70    assert(_promoInfo.noPromotions(), "_promoInfo inconsistency");
   84.71 @@ -2181,7 +2181,7 @@
   84.72    for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) {
   84.73      AdaptiveFreeList<FreeChunk>* fl    = &_indexedFreeList[i];
   84.74      if (PrintFLSStatistics > 1) {
   84.75 -      gclog_or_tty->print("size[%d] : ", i);
   84.76 +      gclog_or_tty->print("size[" SIZE_FORMAT "] : ", i);
   84.77      }
   84.78      fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate);
   84.79      fl->set_coal_desired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent));
   84.80 @@ -2234,7 +2234,7 @@
   84.81    if (PrintFLSStatistics > 0) {
   84.82      HeapWord* largestAddr = (HeapWord*) dictionary()->find_largest_dict();
   84.83      gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT,
   84.84 -                           largestAddr);
   84.85 +                           p2i(largestAddr));
   84.86    }
   84.87    setFLSurplus();
   84.88    setFLHints();
   84.89 @@ -2383,8 +2383,8 @@
   84.90        gclog_or_tty->print_cr(
   84.91          " Current:  addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n"
   84.92          " Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n",
   84.93 -        addr,       res,        was_obj      ?"true":"false", was_live      ?"true":"false",
   84.94 -        _last_addr, _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false");
   84.95 +        p2i(addr),       res,        was_obj      ?"true":"false", was_live      ?"true":"false",
   84.96 +        p2i(_last_addr), _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false");
   84.97        _sp->print_on(gclog_or_tty);
   84.98        guarantee(false, "Seppuku!");
   84.99      }
  84.100 @@ -2712,7 +2712,7 @@
  84.101        _global_num_workers[i] = 0;
  84.102        _global_num_blocks[i] = 0;
  84.103        if (PrintOldPLAB) {
  84.104 -        gclog_or_tty->print_cr("[%d]: %d", i, (size_t)_blocks_to_claim[i].average());
  84.105 +        gclog_or_tty->print_cr("[" SIZE_FORMAT "]: " SIZE_FORMAT, i, (size_t)_blocks_to_claim[i].average());
  84.106        }
  84.107      }
  84.108    }
  84.109 @@ -2751,7 +2751,7 @@
  84.110          }
  84.111        }
  84.112        if (PrintOldPLAB) {
  84.113 -        gclog_or_tty->print_cr("%d[%d]: %d/%d/%d",
  84.114 +        gclog_or_tty->print_cr("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT,
  84.115                                 tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average());
  84.116        }
  84.117        // Reset stats for next round
    85.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Wed May 21 10:56:41 2014 -0700
    85.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Fri May 23 14:12:52 2014 -0700
    85.3 @@ -1,5 +1,5 @@
    85.4  /*
    85.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
    85.6 + * Copyright (c) 2001, 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 @@ -404,7 +404,7 @@
   85.11      if (CMSTraceSweeper) {
   85.12        gclog_or_tty->print_cr(">>>>> Saving sweep limit " PTR_FORMAT
   85.13                               "  for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<",
   85.14 -                             _sweep_limit, bottom(), end());
   85.15 +                             p2i(_sweep_limit), p2i(bottom()), p2i(end()));
   85.16      }
   85.17    }
   85.18    NOT_PRODUCT(
    86.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed May 21 10:56:41 2014 -0700
    86.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Fri May 23 14:12:52 2014 -0700
    86.3 @@ -1,5 +1,5 @@
    86.4  /*
    86.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
    86.6 + * Copyright (c) 2001, 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 @@ -63,6 +63,8 @@
   86.11  #include "services/memoryService.hpp"
   86.12  #include "services/runtimeService.hpp"
   86.13  
   86.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   86.15 +
   86.16  // statics
   86.17  CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
   86.18  bool CMSCollector::_full_gc_requested = false;
   86.19 @@ -1181,7 +1183,7 @@
   86.20      gclog_or_tty->print(" icms alloc limits:  "
   86.21                             PTR_FORMAT "," PTR_FORMAT
   86.22                             " (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ",
   86.23 -                           _icms_start_limit, _icms_stop_limit,
   86.24 +                           p2i(_icms_start_limit), p2i(_icms_stop_limit),
   86.25                             percent_of_space(eden, _icms_start_limit),
   86.26                             percent_of_space(eden, _icms_stop_limit));
   86.27      if (Verbose) {
   86.28 @@ -1209,7 +1211,7 @@
   86.29          gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT
   86.30                                 ", new limit=" PTR_FORMAT
   86.31                                 " (" SIZE_FORMAT "%%)",
   86.32 -                               top, _icms_stop_limit,
   86.33 +                               p2i(top), p2i(_icms_stop_limit),
   86.34                                 percent_of_space(space, _icms_stop_limit));
   86.35        }
   86.36        ConcurrentMarkSweepThread::start_icms();
   86.37 @@ -1226,7 +1228,7 @@
   86.38          gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT
   86.39                                 ", new limit=" PTR_FORMAT
   86.40                                 " (" SIZE_FORMAT "%%)",
   86.41 -                               top, space->end(),
   86.42 +                               p2i(top), p2i(space->end()),
   86.43                                 percent_of_space(space, space->end()));
   86.44        }
   86.45        ConcurrentMarkSweepThread::stop_icms();
   86.46 @@ -1501,7 +1503,7 @@
   86.47    if (PrintCMSInitiationStatistics && stats().valid()) {
   86.48      gclog_or_tty->print("CMSCollector shouldConcurrentCollect: ");
   86.49      gclog_or_tty->stamp();
   86.50 -    gclog_or_tty->print_cr("");
   86.51 +    gclog_or_tty->cr();
   86.52      stats().print_on(gclog_or_tty);
   86.53      gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f",
   86.54        stats().time_until_cms_gen_full());
   86.55 @@ -3577,7 +3579,7 @@
   86.56                   _collector->cmsGen()->short_name(),
   86.57                   _phase, _collector->timerValue(), _wallclock.seconds());
   86.58      if (_print_cr) {
   86.59 -      gclog_or_tty->print_cr("");
   86.60 +      gclog_or_tty->cr();
   86.61      }
   86.62      if (PrintCMSStatistics != 0) {
   86.63        gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase,
   86.64 @@ -6363,7 +6365,9 @@
   86.65    verify_overflow_empty();
   86.66  
   86.67    if (should_unload_classes()) {
   86.68 -    ClassLoaderDataGraph::purge();
   86.69 +    // Delay purge to the beginning of the next safepoint.  Metaspace::contains
   86.70 +    // requires that the virtual spaces are stable and not deleted.
   86.71 +    ClassLoaderDataGraph::set_should_purge(true);
   86.72    }
   86.73  
   86.74    _intra_sweep_timer.stop();
    87.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp	Wed May 21 10:56:41 2014 -0700
    87.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp	Fri May 23 14:12:52 2014 -0700
    87.3 @@ -1,5 +1,5 @@
    87.4  /*
    87.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
    87.6 + * Copyright (c) 2001, 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 @@ -111,7 +111,7 @@
   87.11    // From this time Thread::current() should be working.
   87.12    assert(this == Thread::current(), "just checking");
   87.13    if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
   87.14 -    warning("Couldn't bind CMS thread to processor %u", CPUForCMSThread);
   87.15 +    warning("Couldn't bind CMS thread to processor " UINTX_FORMAT, CPUForCMSThread);
   87.16    }
   87.17    // Wait until Universe::is_fully_initialized()
   87.18    {
    88.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp	Wed May 21 10:56:41 2014 -0700
    88.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp	Fri May 23 14:12:52 2014 -0700
    88.3 @@ -1,5 +1,5 @@
    88.4  /*
    88.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
    88.6 + * Copyright (c) 2001, 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 @@ -241,7 +241,7 @@
   88.11      jio_snprintf(buf, sizeof(buf), " [%.3f:  CMSThread %s] ",
   88.12                   ts.seconds(), desc);
   88.13      buf[sizeof(buf) - 1] = '\0';
   88.14 -    gclog_or_tty->print(buf);
   88.15 +    gclog_or_tty->print("%s", buf);
   88.16    }
   88.17  }
   88.18  
   88.19 @@ -273,7 +273,7 @@
   88.20    inline void tick() {
   88.21      _ticks++;
   88.22      if (CMSLoopWarn && _ticks % _threshold == 0) {
   88.23 -      warning("%s has looped %d times %s", _src, _ticks, _msg);
   88.24 +      warning("%s has looped " INTX_FORMAT " times %s", _src, _ticks, _msg);
   88.25      }
   88.26    }
   88.27  };
    89.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp	Wed May 21 10:56:41 2014 -0700
    89.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp	Fri May 23 14:12:52 2014 -0700
    89.3 @@ -1,5 +1,5 @@
    89.4  /*
    89.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
    89.6 + * Copyright (c) 2001, 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 @@ -27,6 +27,8 @@
   89.11  #include "memory/freeBlockDictionary.hpp"
   89.12  #include "utilities/copy.hpp"
   89.13  
   89.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   89.15 +
   89.16  #ifndef PRODUCT
   89.17  
   89.18  #define baadbabeHeapWord badHeapWordVal
    90.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp	Wed May 21 10:56:41 2014 -0700
    90.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp	Fri May 23 14:12:52 2014 -0700
    90.3 @@ -1,5 +1,5 @@
    90.4  /*
    90.5 - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
    90.6 + * Copyright (c) 2010, 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 @@ -28,6 +28,8 @@
   90.11  #include "oops/markOop.inline.hpp"
   90.12  #include "oops/oop.inline.hpp"
   90.13  
   90.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   90.15 +
   90.16  /////////////////////////////////////////////////////////////////////////
   90.17  //// PromotionInfo
   90.18  /////////////////////////////////////////////////////////////////////////
    91.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Wed May 21 10:56:41 2014 -0700
    91.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Fri May 23 14:12:52 2014 -0700
    91.3 @@ -1,5 +1,5 @@
    91.4  /*
    91.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
    91.6 + * Copyright (c) 2005, 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 @@ -34,6 +34,7 @@
   91.11  #include "runtime/os.hpp"
   91.12  #include "utilities/dtrace.hpp"
   91.13  
   91.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   91.15  
   91.16  #ifndef USDT2
   91.17  HS_DTRACE_PROBE_DECL(hs_private, cms__initmark__begin);
    92.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed May 21 10:56:41 2014 -0700
    92.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Fri May 23 14:12:52 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 @@ -537,7 +537,7 @@
   92.11  
   92.12    if (verbose_low()) {
   92.13      gclog_or_tty->print_cr("[global] init, heap start = "PTR_FORMAT", "
   92.14 -                           "heap end = "PTR_FORMAT, _heap_start, _heap_end);
   92.15 +                           "heap end = " INTPTR_FORMAT, p2i(_heap_start), p2i(_heap_end));
   92.16    }
   92.17  
   92.18    if (!_markBitMap1.allocate(heap_rs)) {
   92.19 @@ -567,8 +567,8 @@
   92.20    _root_regions.init(_g1h, this);
   92.21  
   92.22    if (ConcGCThreads > ParallelGCThreads) {
   92.23 -    warning("Can't have more ConcGCThreads (" UINT32_FORMAT ") "
   92.24 -            "than ParallelGCThreads (" UINT32_FORMAT ").",
   92.25 +    warning("Can't have more ConcGCThreads (" UINTX_FORMAT ") "
   92.26 +            "than ParallelGCThreads (" UINTX_FORMAT ").",
   92.27              ConcGCThreads, ParallelGCThreads);
   92.28      return;
   92.29    }
   92.30 @@ -651,7 +651,7 @@
   92.31      if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
   92.32        warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
   92.33                "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
   92.34 -              mark_stack_size, 1, MarkStackSizeMax);
   92.35 +              mark_stack_size, (uintx) 1, MarkStackSizeMax);
   92.36        return;
   92.37      }
   92.38      FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
   92.39 @@ -662,7 +662,7 @@
   92.40          if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
   92.41            warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
   92.42                    "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
   92.43 -                  MarkStackSize, 1, MarkStackSizeMax);
   92.44 +                  MarkStackSize, (uintx) 1, MarkStackSizeMax);
   92.45            return;
   92.46          }
   92.47        } else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
   92.48 @@ -821,7 +821,7 @@
   92.49      assert(!concurrent_marking_in_progress(), "invariant");
   92.50      assert(_finger == _heap_end,
   92.51             err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT,
   92.52 -                   _finger, _heap_end));
   92.53 +                   p2i(_finger), p2i(_heap_end)));
   92.54      update_g1_committed(true);
   92.55    }
   92.56  }
   92.57 @@ -1422,7 +1422,7 @@
   92.58      assert(start <= hr->end() && start <= ntams && ntams <= hr->end(),
   92.59             err_msg("Preconditions not met - "
   92.60                     "start: "PTR_FORMAT", ntams: "PTR_FORMAT", end: "PTR_FORMAT,
   92.61 -                   start, ntams, hr->end()));
   92.62 +                   p2i(start), p2i(ntams), p2i(hr->end())));
   92.63  
   92.64      // Find the first marked object at or after "start".
   92.65      start = _bm->getNextMarkedWordAddress(start, ntams);
   92.66 @@ -1607,7 +1607,7 @@
   92.67      if (failures > 0 && _verbose)  {
   92.68        gclog_or_tty->print_cr("Region " HR_FORMAT ", ntams: " PTR_FORMAT ", "
   92.69                               "marked_bytes: calc/actual " SIZE_FORMAT "/" SIZE_FORMAT,
   92.70 -                             HR_FORMAT_PARAMS(hr), hr->next_top_at_mark_start(),
   92.71 +                             HR_FORMAT_PARAMS(hr), p2i(hr->next_top_at_mark_start()),
   92.72                               _calc_cl.region_marked_bytes(), hr->next_marked_bytes());
   92.73      }
   92.74  
   92.75 @@ -2237,7 +2237,7 @@
   92.76        if (_cm->verbose_high()) {
   92.77          gclog_or_tty->print_cr("\t[%u] we're looking at location "
   92.78                                 "*"PTR_FORMAT" = "PTR_FORMAT,
   92.79 -                               _task->worker_id(), p, (void*) obj);
   92.80 +                               _task->worker_id(), p2i(p), p2i((void*) obj));
   92.81        }
   92.82  
   92.83        _task->deal_with_reference(obj);
   92.84 @@ -2672,7 +2672,7 @@
   92.85      }
   92.86  
   92.87      _out->print_cr("  "PTR_FORMAT": "PTR_FORMAT"%s%s",
   92.88 -                   p, (void*) obj, str, str2);
   92.89 +                   p2i(p), p2i((void*) obj), str, str2);
   92.90    }
   92.91  };
   92.92  
   92.93 @@ -2699,7 +2699,7 @@
   92.94  
   92.95      if (print_it) {
   92.96        _out->print_cr(" "PTR_FORMAT"%s",
   92.97 -                     (void *)o, (over_tams) ? " >" : (marked) ? " M" : "");
   92.98 +                     p2i((void *)o), (over_tams) ? " >" : (marked) ? " M" : "");
   92.99        PrintReachableOopClosure oopCl(_out, _vo, _all);
  92.100        o->oop_iterate_no_header(&oopCl);
  92.101      }
  92.102 @@ -2720,14 +2720,14 @@
  92.103      HeapWord* t = hr->top();
  92.104      HeapWord* p = _g1h->top_at_mark_start(hr, _vo);
  92.105      _out->print_cr("** ["PTR_FORMAT", "PTR_FORMAT"] top: "PTR_FORMAT" "
  92.106 -                   "TAMS: "PTR_FORMAT, b, e, t, p);
  92.107 +                   "TAMS: " PTR_FORMAT, p2i(b), p2i(e), p2i(t), p2i(p));
  92.108      _out->cr();
  92.109  
  92.110      HeapWord* from = b;
  92.111      HeapWord* to   = t;
  92.112  
  92.113      if (to > from) {
  92.114 -      _out->print_cr("Objects in ["PTR_FORMAT", "PTR_FORMAT"]", from, to);
  92.115 +      _out->print_cr("Objects in [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(from), p2i(to));
  92.116        _out->cr();
  92.117        PrintReachableObjectClosure ocl(_out, _vo, _all, hr);
  92.118        hr->object_iterate_mem_careful(MemRegion(from, to), &ocl);
  92.119 @@ -2843,7 +2843,7 @@
  92.120        gclog_or_tty->print_cr("[%u] curr_region = "PTR_FORMAT" "
  92.121                               "["PTR_FORMAT", "PTR_FORMAT"), "
  92.122                               "limit = "PTR_FORMAT,
  92.123 -                             worker_id, curr_region, bottom, end, limit);
  92.124 +                             worker_id, p2i(curr_region), p2i(bottom), p2i(end), p2i(limit));
  92.125      }
  92.126  
  92.127      // Is the gap between reading the finger and doing the CAS too long?
  92.128 @@ -2857,13 +2857,13 @@
  92.129  
  92.130        if (verbose_low()) {
  92.131          gclog_or_tty->print_cr("[%u] we were successful with region = "
  92.132 -                               PTR_FORMAT, worker_id, curr_region);
  92.133 +                               PTR_FORMAT, worker_id, p2i(curr_region));
  92.134        }
  92.135  
  92.136        if (limit > bottom) {
  92.137          if (verbose_low()) {
  92.138            gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is not empty, "
  92.139 -                                 "returning it ", worker_id, curr_region);
  92.140 +                                 "returning it ", worker_id, p2i(curr_region));
  92.141          }
  92.142          return curr_region;
  92.143        } else {
  92.144 @@ -2871,7 +2871,7 @@
  92.145                 "the region limit should be at bottom");
  92.146          if (verbose_low()) {
  92.147            gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is empty, "
  92.148 -                                 "returning NULL", worker_id, curr_region);
  92.149 +                                 "returning NULL", worker_id, p2i(curr_region));
  92.150          }
  92.151          // we return NULL and the caller should try calling
  92.152          // claim_region() again.
  92.153 @@ -2883,7 +2883,7 @@
  92.154          gclog_or_tty->print_cr("[%u] somebody else moved the finger, "
  92.155                                 "global finger = "PTR_FORMAT", "
  92.156                                 "our finger = "PTR_FORMAT,
  92.157 -                               worker_id, _finger, finger);
  92.158 +                               worker_id, p2i(_finger), p2i(finger));
  92.159        }
  92.160  
  92.161        // read it again
  92.162 @@ -2922,7 +2922,7 @@
  92.163    void do_object_work(oop obj) {
  92.164      guarantee(!_g1h->obj_in_cs(obj),
  92.165                err_msg("obj: "PTR_FORMAT" in CSet, phase: %s, info: %d",
  92.166 -                      (void*) obj, phase_str(), _info));
  92.167 +                      p2i((void*) obj), phase_str(), _info));
  92.168    }
  92.169  
  92.170  public:
  92.171 @@ -3001,7 +3001,7 @@
  92.172        HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
  92.173        guarantee(global_finger == global_hr->bottom(),
  92.174                  err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT,
  92.175 -                        global_finger, HR_FORMAT_PARAMS(global_hr)));
  92.176 +                        p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
  92.177      }
  92.178  
  92.179      // Verify the task fingers
  92.180 @@ -3015,7 +3015,7 @@
  92.181          guarantee(task_finger == task_hr->bottom() ||
  92.182                    !task_hr->in_collection_set(),
  92.183                    err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT,
  92.184 -                          task_finger, HR_FORMAT_PARAMS(task_hr)));
  92.185 +                          p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
  92.186        }
  92.187      }
  92.188    }
  92.189 @@ -3059,7 +3059,7 @@
  92.190             err_msg("Preconditions not met - "
  92.191                     "start: "PTR_FORMAT", limit: "PTR_FORMAT", "
  92.192                     "top: "PTR_FORMAT", end: "PTR_FORMAT,
  92.193 -                   start, limit, hr->top(), hr->end()));
  92.194 +                   p2i(start), p2i(limit), p2i(hr->top()), p2i(hr->end())));
  92.195  
  92.196      assert(hr->next_marked_bytes() == 0, "Precondition");
  92.197  
  92.198 @@ -3295,7 +3295,7 @@
  92.199  
  92.200  void ConcurrentMark::print_on_error(outputStream* st) const {
  92.201    st->print_cr("Marking Bits (Prev, Next): (CMBitMap*) " PTR_FORMAT ", (CMBitMap*) " PTR_FORMAT,
  92.202 -      _prevMarkBitMap, _nextMarkBitMap);
  92.203 +      p2i(_prevMarkBitMap), p2i(_nextMarkBitMap));
  92.204    _prevMarkBitMap->print_on_error(st, " Prev Bits: ");
  92.205    _nextMarkBitMap->print_on_error(st, " Next Bits: ");
  92.206  }
  92.207 @@ -3332,11 +3332,11 @@
  92.208  // for debugging purposes
  92.209  void ConcurrentMark::print_finger() {
  92.210    gclog_or_tty->print_cr("heap ["PTR_FORMAT", "PTR_FORMAT"), global finger = "PTR_FORMAT,
  92.211 -                         _heap_start, _heap_end, _finger);
  92.212 +                         p2i(_heap_start), p2i(_heap_end), p2i(_finger));
  92.213    for (uint i = 0; i < _max_worker_id; ++i) {
  92.214 -    gclog_or_tty->print("   %u: "PTR_FORMAT, i, _tasks[i]->finger());
  92.215 +    gclog_or_tty->print("   %u: " PTR_FORMAT, i, p2i(_tasks[i]->finger()));
  92.216    }
  92.217 -  gclog_or_tty->print_cr("");
  92.218 +  gclog_or_tty->cr();
  92.219  }
  92.220  #endif
  92.221  
  92.222 @@ -3345,7 +3345,7 @@
  92.223  
  92.224    if (_cm->verbose_high()) {
  92.225      gclog_or_tty->print_cr("[%u] we're scanning object "PTR_FORMAT,
  92.226 -                           _worker_id, (void*) obj);
  92.227 +                           _worker_id, p2i((void*) obj));
  92.228    }
  92.229  
  92.230    size_t obj_size = obj->size();
  92.231 @@ -3425,7 +3425,7 @@
  92.232  
  92.233    if (_cm->verbose_low()) {
  92.234      gclog_or_tty->print_cr("[%u] setting up for region "PTR_FORMAT,
  92.235 -                           _worker_id, hr);
  92.236 +                           _worker_id, p2i(hr));
  92.237    }
  92.238  
  92.239    _curr_region  = hr;
  92.240 @@ -3442,7 +3442,7 @@
  92.241      if (_cm->verbose_low()) {
  92.242        gclog_or_tty->print_cr("[%u] found an empty region "
  92.243                               "["PTR_FORMAT", "PTR_FORMAT")",
  92.244 -                             _worker_id, bottom, limit);
  92.245 +                             _worker_id, p2i(bottom), p2i(limit));
  92.246      }
  92.247      // The region was collected underneath our feet.
  92.248      // We set the finger to bottom to ensure that the bitmap
  92.249 @@ -3474,7 +3474,7 @@
  92.250    assert(_curr_region != NULL, "invariant");
  92.251    if (_cm->verbose_low()) {
  92.252      gclog_or_tty->print_cr("[%u] giving up region "PTR_FORMAT,
  92.253 -                           _worker_id, _curr_region);
  92.254 +                           _worker_id, p2i(_curr_region));
  92.255    }
  92.256    clear_region_fields();
  92.257  }
  92.258 @@ -3754,7 +3754,7 @@
  92.259  
  92.260    if (_task_queue->size() > target_size) {
  92.261      if (_cm->verbose_high()) {
  92.262 -      gclog_or_tty->print_cr("[%u] draining local queue, target size = %d",
  92.263 +      gclog_or_tty->print_cr("[%u] draining local queue, target size = " SIZE_FORMAT,
  92.264                               _worker_id, target_size);
  92.265      }
  92.266  
  92.267 @@ -3765,7 +3765,7 @@
  92.268  
  92.269        if (_cm->verbose_high()) {
  92.270          gclog_or_tty->print_cr("[%u] popped "PTR_FORMAT, _worker_id,
  92.271 -                               (void*) obj);
  92.272 +                               p2i((void*) obj));
  92.273        }
  92.274  
  92.275        assert(_g1h->is_in_g1_reserved((HeapWord*) obj), "invariant" );
  92.276 @@ -3810,7 +3810,7 @@
  92.277  
  92.278    if (_cm->mark_stack_size() > target_size) {
  92.279      if (_cm->verbose_low()) {
  92.280 -      gclog_or_tty->print_cr("[%u] draining global_stack, target size %d",
  92.281 +      gclog_or_tty->print_cr("[%u] draining global_stack, target size " SIZE_FORMAT,
  92.282                               _worker_id, target_size);
  92.283      }
  92.284  
  92.285 @@ -3820,7 +3820,7 @@
  92.286      }
  92.287  
  92.288      if (_cm->verbose_low()) {
  92.289 -      gclog_or_tty->print_cr("[%u] drained global stack, size = %d",
  92.290 +      gclog_or_tty->print_cr("[%u] drained global stack, size = " SIZE_FORMAT,
  92.291                               _worker_id, _cm->mark_stack_size());
  92.292      }
  92.293    }
  92.294 @@ -4150,7 +4150,7 @@
  92.295          gclog_or_tty->print_cr("[%u] we're scanning part "
  92.296                                 "["PTR_FORMAT", "PTR_FORMAT") "
  92.297                                 "of region "HR_FORMAT,
  92.298 -                               _worker_id, _finger, _region_limit,
  92.299 +                               _worker_id, p2i(_finger), p2i(_region_limit),
  92.300                                 HR_FORMAT_PARAMS(_curr_region));
  92.301        }
  92.302  
  92.303 @@ -4237,7 +4237,7 @@
  92.304          if (_cm->verbose_low()) {
  92.305            gclog_or_tty->print_cr("[%u] we successfully claimed "
  92.306                                   "region "PTR_FORMAT,
  92.307 -                                 _worker_id, claimed_region);
  92.308 +                                 _worker_id, p2i(claimed_region));
  92.309          }
  92.310  
  92.311          setup_for_region(claimed_region);
  92.312 @@ -4298,7 +4298,7 @@
  92.313        if (_cm->try_stealing(_worker_id, &_hash_seed, obj)) {
  92.314          if (_cm->verbose_medium()) {
  92.315            gclog_or_tty->print_cr("[%u] stolen "PTR_FORMAT" successfully",
  92.316 -                                 _worker_id, (void*) obj);
  92.317 +                                 _worker_id, p2i((void*) obj));
  92.318          }
  92.319  
  92.320          statsOnly( ++_steals );
  92.321 @@ -4546,8 +4546,8 @@
  92.322                   G1PPRL_SUM_ADDR_FORMAT("committed")
  92.323                   G1PPRL_SUM_ADDR_FORMAT("reserved")
  92.324                   G1PPRL_SUM_BYTE_FORMAT("region-size"),
  92.325 -                 g1_committed.start(), g1_committed.end(),
  92.326 -                 g1_reserved.start(), g1_reserved.end(),
  92.327 +                 p2i(g1_committed.start()), p2i(g1_committed.end()),
  92.328 +                 p2i(g1_reserved.start()), p2i(g1_reserved.end()),
  92.329                   HeapRegion::GrainBytes);
  92.330    _out->print_cr(G1PPRL_LINE_PREFIX);
  92.331    _out->print_cr(G1PPRL_LINE_PREFIX
  92.332 @@ -4664,7 +4664,7 @@
  92.333                   G1PPRL_DOUBLE_FORMAT
  92.334                   G1PPRL_BYTE_FORMAT
  92.335                   G1PPRL_BYTE_FORMAT,
  92.336 -                 type, bottom, end,
  92.337 +                 type, p2i(bottom), p2i(end),
  92.338                   used_bytes, prev_live_bytes, next_live_bytes, gc_eff,
  92.339                   remset_bytes, strong_code_roots_bytes);
  92.340  
    93.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp	Wed May 21 10:56:41 2014 -0700
    93.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp	Fri May 23 14:12:52 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 @@ -277,7 +277,7 @@
   93.11    assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
   93.12  
   93.13    if (_cm->verbose_high()) {
   93.14 -    gclog_or_tty->print_cr("[%u] pushing "PTR_FORMAT, _worker_id, (void*) obj);
   93.15 +    gclog_or_tty->print_cr("[%u] pushing " PTR_FORMAT, _worker_id, p2i((void*) obj));
   93.16    }
   93.17  
   93.18    if (!_task_queue->push(obj)) {
   93.19 @@ -317,7 +317,7 @@
   93.20  inline void CMTask::deal_with_reference(oop obj) {
   93.21    if (_cm->verbose_high()) {
   93.22      gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
   93.23 -                           _worker_id, (void*) obj);
   93.24 +                           _worker_id, p2i((void*) obj));
   93.25    }
   93.26  
   93.27    ++_refs_reached;
   93.28 @@ -334,7 +334,7 @@
   93.29        if (!hr->obj_allocated_since_next_marking(obj)) {
   93.30          if (_cm->verbose_high()) {
   93.31            gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
   93.32 -                                 _worker_id, (void*) obj);
   93.33 +                                 _worker_id, p2i((void*) obj));
   93.34          }
   93.35  
   93.36          // we need to mark it first
   93.37 @@ -349,7 +349,7 @@
   93.38            if (_finger != NULL && objAddr < _finger) {
   93.39              if (_cm->verbose_high()) {
   93.40                gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
   93.41 -                                     "pushing it", _worker_id, _finger);
   93.42 +                                     "pushing it", _worker_id, p2i(_finger));
   93.43              }
   93.44              push(obj);
   93.45            } else if (_curr_region != NULL && objAddr < _region_limit) {
   93.46 @@ -367,7 +367,7 @@
   93.47              if (_cm->verbose_high()) {
   93.48                gclog_or_tty->print_cr("[%u] below the global finger "
   93.49                                       "("PTR_FORMAT"), pushing it",
   93.50 -                                     _worker_id, global_finger);
   93.51 +                                     _worker_id, p2i(global_finger));
   93.52              }
   93.53              push(obj);
   93.54            } else {
   93.55 @@ -382,7 +382,7 @@
   93.56              if (_cm->verbose_high()) {
   93.57                gclog_or_tty->print_cr("[%u] below the global finger "
   93.58                                       "("PTR_FORMAT"), pushing it",
   93.59 -                                     _worker_id, global_finger);
   93.60 +                                     _worker_id, p2i(global_finger));
   93.61              }
   93.62              push(obj);
   93.63            }
    94.1 --- a/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp	Wed May 21 10:56:41 2014 -0700
    94.2 +++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp	Fri May 23 14:12:52 2014 -0700
    94.3 @@ -1,5 +1,5 @@
    94.4  /*
    94.5 - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    94.6 + * Copyright (c) 2011, 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 @@ -142,7 +142,7 @@
   94.11  void G1AllocRegion::fill_in_ext_msg(ar_ext_msg* msg, const char* message) {
   94.12    msg->append("[%s] %s c: %u b: %s r: "PTR_FORMAT" u: "SIZE_FORMAT,
   94.13                _name, message, _count, BOOL_TO_STR(_bot_updates),
   94.14 -              _alloc_region, _used_bytes_before);
   94.15 +              p2i(_alloc_region), _used_bytes_before);
   94.16  }
   94.17  
   94.18  void G1AllocRegion::init() {
    95.1 --- a/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp	Wed May 21 10:56:41 2014 -0700
    95.2 +++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp	Fri May 23 14:12:52 2014 -0700
    95.3 @@ -1,5 +1,5 @@
    95.4  /*
    95.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
    95.6 + * Copyright (c) 2011, 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 @@ -184,7 +184,7 @@
   95.11  
   95.12  class ar_ext_msg : public err_msg {
   95.13  public:
   95.14 -  ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("") {
   95.15 +  ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("%s", "") {
   95.16      alloc_region->fill_in_ext_msg(this, message);
   95.17    }
   95.18  };
    96.1 --- a/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp	Wed May 21 10:56:41 2014 -0700
    96.2 +++ b/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp	Fri May 23 14:12:52 2014 -0700
    96.3 @@ -1,5 +1,5 @@
    96.4  /*
    96.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    96.6 + * Copyright (c) 2013, 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 @@ -65,7 +65,7 @@
   96.11              REGION_SIZE_IN_WORDS * HeapWordSize);
   96.12      // Check address calculation (bounds)
   96.13      assert(array.bottom_address_mapped() == fake_heap,
   96.14 -      err_msg("bottom mapped address should be "PTR_FORMAT", but is "PTR_FORMAT, fake_heap, array.bottom_address_mapped()));
   96.15 +      err_msg("bottom mapped address should be " PTR_FORMAT ", but is " PTR_FORMAT, p2i(fake_heap), p2i(array.bottom_address_mapped())));
   96.16      assert(array.end_address_mapped() == (fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS), "must be");
   96.17  
   96.18      int* bottom = array.address_mapped_to(fake_heap);
    97.1 --- a/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp	Wed May 21 10:56:41 2014 -0700
    97.2 +++ b/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp	Fri May 23 14:12:52 2014 -0700
    97.3 @@ -1,5 +1,5 @@
    97.4  /*
    97.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    97.6 + * Copyright (c) 2013, 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 @@ -55,7 +55,7 @@
   97.11    void initialize_base(address base, size_t length, size_t bias, size_t elem_size, uint shift_by) {
   97.12      assert(base != NULL, "just checking");
   97.13      assert(length > 0, "just checking");
   97.14 -    assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %zd, larger than word size?", shift_by));
   97.15 +    assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by " SSIZE_FORMAT ", larger than word size?", (size_t) shift_by));
   97.16      _base = base;
   97.17      _length = length;
   97.18      _biased_base = base - (bias * elem_size);
   97.19 @@ -70,11 +70,11 @@
   97.20      assert(is_power_of_2(mapping_granularity_in_bytes),
   97.21        err_msg("mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes));
   97.22      assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0,
   97.23 -      err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
   97.24 -        mapping_granularity_in_bytes, bottom));
   97.25 +      err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT,
   97.26 +        mapping_granularity_in_bytes, p2i(bottom)));
   97.27      assert((uintptr_t)end % mapping_granularity_in_bytes == 0,
   97.28 -      err_msg("end mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
   97.29 -        mapping_granularity_in_bytes, end));
   97.30 +      err_msg("end mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT,
   97.31 +        mapping_granularity_in_bytes, p2i(end)));
   97.32      size_t num_target_elems = (end - bottom) / (mapping_granularity_in_bytes / HeapWordSize);
   97.33      idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
   97.34      address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);
    98.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Wed May 21 10:56:41 2014 -0700
    98.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Fri May 23 14:12:52 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 @@ -29,6 +29,8 @@
   98.11  #include "runtime/java.hpp"
   98.12  #include "services/memTracker.hpp"
   98.13  
   98.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   98.15 +
   98.16  //////////////////////////////////////////////////////////////////////
   98.17  // G1BlockOffsetSharedArray
   98.18  //////////////////////////////////////////////////////////////////////
    99.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp	Wed May 21 10:56:41 2014 -0700
    99.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp	Fri May 23 14:12:52 2014 -0700
    99.3 @@ -1,5 +1,5 @@
    99.4  /*
    99.5 - * Copyright (c) 2001, 2012, 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 @@ -80,7 +80,7 @@
   99.11    virtual void set_bottom(HeapWord* new_bottom) {
   99.12      assert(new_bottom <= _end,
   99.13             err_msg("new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")",
   99.14 -                   new_bottom, _end));
   99.15 +                   p2i(new_bottom), p2i(_end)));
   99.16      _bottom = new_bottom;
   99.17      resize(pointer_delta(_end, _bottom));
   99.18    }
   99.19 @@ -146,7 +146,7 @@
   99.20    void check_offset(size_t offset, const char* msg) const {
   99.21      assert(offset <= N_words,
   99.22             err_msg("%s - "
   99.23 -                   "offset: " UINT32_FORMAT", N_words: " UINT32_FORMAT,
   99.24 +                   "offset: " SIZE_FORMAT ", N_words: " UINT32_FORMAT,
   99.25                     msg, offset, N_words));
   99.26    }
   99.27  
   100.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp	Wed May 21 10:56:41 2014 -0700
   100.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp	Fri May 23 14:12:52 2014 -0700
   100.3 @@ -1,5 +1,5 @@
   100.4  /*
   100.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   100.6 + * Copyright (c) 2001, 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 @@ -50,7 +50,7 @@
  100.11    assert(pc >= (char*)_reserved.start() &&
  100.12           pc <  (char*)_reserved.end(),
  100.13           err_msg("p (" PTR_FORMAT ") not in reserved [" PTR_FORMAT ", " PTR_FORMAT ")",
  100.14 -                 p, (char*)_reserved.start(), (char*)_reserved.end()));
  100.15 +                 p2i(p), p2i(_reserved.start()), p2i(_reserved.end())));
  100.16    size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char));
  100.17    size_t result = delta >> LogN;
  100.18    check_index(result, "bad index from address");
  100.19 @@ -65,7 +65,7 @@
  100.20           err_msg("bad address from index result " PTR_FORMAT
  100.21                   " _reserved.start() " PTR_FORMAT " _reserved.end() "
  100.22                   PTR_FORMAT,
  100.23 -                 result, _reserved.start(), _reserved.end()));
  100.24 +                 p2i(result), p2i(_reserved.start()), p2i(_reserved.end())));
  100.25    return result;
  100.26  }
  100.27  
   101.1 --- a/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Wed May 21 10:56:41 2014 -0700
   101.2 +++ b/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Fri May 23 14:12:52 2014 -0700
   101.3 @@ -1,5 +1,5 @@
   101.4  /*
   101.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
   101.6 + * Copyright (c) 2013, 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 @@ -31,6 +31,8 @@
  101.11  #include "services/memTracker.hpp"
  101.12  #include "utilities/copy.hpp"
  101.13  
  101.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  101.15 +
  101.16  void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
  101.17    if (has_count_table()) {
  101.18      assert(from_card_num >= 0 && from_card_num < _committed_max_card_num,
   102.1 --- a/src/share/vm/gc_implementation/g1/g1CardCounts.hpp	Wed May 21 10:56:41 2014 -0700
   102.2 +++ b/src/share/vm/gc_implementation/g1/g1CardCounts.hpp	Fri May 23 14:12:52 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 @@ -77,10 +77,10 @@
  102.11             err_msg("Invalid card pointer: "
  102.12                     "card_ptr: " PTR_FORMAT ", "
  102.13                     "_ct_bot: " PTR_FORMAT,
  102.14 -                   card_ptr, _ct_bot));
  102.15 +                   p2i(card_ptr), p2i(_ct_bot)));
  102.16      size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte));
  102.17      assert(card_num >= 0 && card_num < _committed_max_card_num,
  102.18 -           err_msg("card pointer out of range: " PTR_FORMAT, card_ptr));
  102.19 +           err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr)));
  102.20      return card_num;
  102.21    }
  102.22  
   103.1 --- a/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp	Wed May 21 10:56:41 2014 -0700
   103.2 +++ b/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp	Fri May 23 14:12:52 2014 -0700
   103.3 @@ -28,6 +28,8 @@
   103.4  #include "gc_implementation/g1/g1CodeCacheRemSet.hpp"
   103.5  #include "memory/iterator.hpp"
   103.6  
   103.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   103.8 +
   103.9  G1CodeRootChunk::G1CodeRootChunk() : _top(NULL), _next(NULL), _prev(NULL) {
  103.10    _top = bottom();
  103.11  }
   104.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed May 21 10:56:41 2014 -0700
   104.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri May 23 14:12:52 2014 -0700
   104.3 @@ -22,6 +22,10 @@
   104.4   *
   104.5   */
   104.6  
   104.7 +#if !defined(__clang_major__) && defined(__GNUC__)
   104.8 +#define ATTRIBUTE_PRINTF(x,y) // FIXME, formats are a mess.
   104.9 +#endif
  104.10 +
  104.11  #include "precompiled.hpp"
  104.12  #include "code/codeCache.hpp"
  104.13  #include "code/icBuffer.hpp"
  104.14 @@ -372,7 +376,7 @@
  104.15      }
  104.16    }
  104.17  
  104.18 -  gclog_or_tty->print_cr("");
  104.19 +  gclog_or_tty->cr();
  104.20  }
  104.21  
  104.22  void G1CollectedHeap::push_dirty_cards_region(HeapRegion* hr)
  104.23 @@ -3488,7 +3492,7 @@
  104.24        // help us track down what went wrong. This is why we call
  104.25        // print_extended_on() instead of print_on().
  104.26        print_extended_on(gclog_or_tty);
  104.27 -      gclog_or_tty->print_cr("");
  104.28 +      gclog_or_tty->cr();
  104.29  #ifndef PRODUCT
  104.30        if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) {
  104.31          concurrent_mark()->print_reachable("at-verification-failure",
  104.32 @@ -3682,7 +3686,7 @@
  104.33    PrintRSetsClosure(const char* msg) : _msg(msg), _occupied_sum(0) {
  104.34      gclog_or_tty->cr();
  104.35      gclog_or_tty->print_cr("========================================");
  104.36 -    gclog_or_tty->print_cr(msg);
  104.37 +    gclog_or_tty->print_cr("%s", msg);
  104.38      gclog_or_tty->cr();
  104.39    }
  104.40  
  104.41 @@ -5416,7 +5420,7 @@
  104.42        if (_g1h->is_in_g1_reserved(p)) {
  104.43          _par_scan_state->push_on_queue(p);
  104.44        } else {
  104.45 -        assert(!ClassLoaderDataGraph::contains((address)p),
  104.46 +        assert(!Metaspace::contains((const void*)p),
  104.47                 err_msg("Otherwise need to call _copy_metadata_obj_cl->do_oop(p) "
  104.48                                PTR_FORMAT, p));
  104.49            _copy_non_heap_obj_cl->do_oop(p);
   105.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Wed May 21 10:56:41 2014 -0700
   105.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Fri May 23 14:12:52 2014 -0700
   105.3 @@ -1,5 +1,5 @@
   105.4  /*
   105.5 - * Copyright (c) 2001, 2013, 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 @@ -165,7 +165,7 @@
  105.11  // points into the heap.
  105.12  inline bool G1CollectedHeap::in_cset_fast_test(oop obj) {
  105.13    assert(_in_cset_fast_test != NULL, "sanity");
  105.14 -  assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, (HeapWord*)obj));
  105.15 +  assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, p2i((HeapWord*)obj)));
  105.16    // no need to subtract the bottom of the heap from obj,
  105.17    // _in_cset_fast_test is biased
  105.18    uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes;
   106.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Wed May 21 10:56:41 2014 -0700
   106.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri May 23 14:12:52 2014 -0700
   106.3 @@ -1,5 +1,5 @@
   106.4  /*
   106.5 - * Copyright (c) 2001, 2013, 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 @@ -22,6 +22,10 @@
  106.11   *
  106.12   */
  106.13  
  106.14 +#ifndef __clang_major__
  106.15 +#define ATTRIBUTE_PRINTF(x,y) // FIXME, formats are a mess.
  106.16 +#endif
  106.17 +
  106.18  #include "precompiled.hpp"
  106.19  #include "gc_implementation/g1/concurrentG1Refine.hpp"
  106.20  #include "gc_implementation/g1/concurrentMark.hpp"
  106.21 @@ -965,7 +969,7 @@
  106.22  
  106.23  #ifndef PRODUCT
  106.24    if (G1YoungSurvRateVerbose) {
  106.25 -    gclog_or_tty->print_cr("");
  106.26 +    gclog_or_tty->cr();
  106.27      _short_lived_surv_rate_group->print();
  106.28      // do that for any other surv rate groups too
  106.29    }
  106.30 @@ -2222,11 +2226,11 @@
  106.31  
  106.32    gclog_or_tty->print_cr("ALL PAUSES");
  106.33    print_summary_sd("   Total", &_total);
  106.34 -  gclog_or_tty->print_cr("");
  106.35 -  gclog_or_tty->print_cr("");
  106.36 +  gclog_or_tty->cr();
  106.37 +  gclog_or_tty->cr();
  106.38    gclog_or_tty->print_cr("   Young GC Pauses: %8d", _young_pause_num);
  106.39    gclog_or_tty->print_cr("   Mixed GC Pauses: %8d", _mixed_pause_num);
  106.40 -  gclog_or_tty->print_cr("");
  106.41 +  gclog_or_tty->cr();
  106.42  
  106.43    gclog_or_tty->print_cr("EVACUATION PAUSES");
  106.44  
  106.45 @@ -2246,7 +2250,7 @@
  106.46      print_summary("      Clear CT", &_clear_ct);
  106.47      print_summary("      Other", &_other);
  106.48    }
  106.49 -  gclog_or_tty->print_cr("");
  106.50 +  gclog_or_tty->cr();
  106.51  
  106.52    gclog_or_tty->print_cr("MISC");
  106.53    print_summary_sd("   Stop World", &_all_stop_world_times_ms);
   107.1 --- a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Wed May 21 10:56:41 2014 -0700
   107.2 +++ b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Fri May 23 14:12:52 2014 -0700
   107.3 @@ -39,7 +39,7 @@
   107.4    int _indent_level;
   107.5    int _cur;
   107.6  
   107.7 -  void vappend(const char* format, va_list ap) {
   107.8 +  void vappend(const char* format, va_list ap)  ATTRIBUTE_PRINTF(2, 0) {
   107.9      int res = vsnprintf(&_buffer[_cur], BUFFER_LEN - _cur, format, ap);
  107.10      if (res != -1) {
  107.11        _cur += res;
  107.12 @@ -63,14 +63,14 @@
  107.13    }
  107.14  #endif
  107.15  
  107.16 -  void append(const char* format, ...) {
  107.17 +  void append(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3) {
  107.18      va_list ap;
  107.19      va_start(ap, format);
  107.20      vappend(format, ap);
  107.21      va_end(ap);
  107.22    }
  107.23  
  107.24 -  void append_and_print_cr(const char* format, ...) {
  107.25 +  void append_and_print_cr(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3) {
  107.26      va_list ap;
  107.27      va_start(ap, format);
  107.28      vappend(format, ap);
  107.29 @@ -80,6 +80,8 @@
  107.30    }
  107.31  };
  107.32  
  107.33 +PRAGMA_DIAG_PUSH
  107.34 +PRAGMA_FORMAT_NONLITERAL_IGNORED
  107.35  template <class T>
  107.36  void WorkerDataArray<T>::print(int level, const char* title) {
  107.37    if (_length == 1) {
  107.38 @@ -109,7 +111,7 @@
  107.39    }
  107.40  
  107.41    if (G1Log::finest()) {
  107.42 -    buf.append_and_print_cr("");
  107.43 +    buf.append_and_print_cr("%s", "");
  107.44    }
  107.45  
  107.46    double avg = (double)sum / (double)_length;
  107.47 @@ -129,6 +131,7 @@
  107.48    }
  107.49    buf.append_and_print_cr("]");
  107.50  }
  107.51 +PRAGMA_DIAG_POP
  107.52  
  107.53  #ifndef PRODUCT
  107.54  
   108.1 --- a/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp	Wed May 21 10:56:41 2014 -0700
   108.2 +++ b/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp	Fri May 23 14:12:52 2014 -0700
   108.3 @@ -1,5 +1,5 @@
   108.4  /*
   108.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
   108.6 + * Copyright (c) 2011, 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 @@ -27,6 +27,8 @@
  108.11  #include "gc_implementation/g1/heapRegion.hpp"
  108.12  #include "utilities/ostream.hpp"
  108.13  
  108.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  108.15 +
  108.16  const char* G1HRPrinter::action_name(ActionType action) {
  108.17    switch(action) {
  108.18      case Alloc:          return "ALLOC";
   109.1 --- a/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp	Wed May 21 10:56:41 2014 -0700
   109.2 +++ b/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp	Fri May 23 14:12:52 2014 -0700
   109.3 @@ -1,5 +1,5 @@
   109.4  /*
   109.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   109.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   109.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   109.8   *
   109.9   * This code is free software; you can redistribute it and/or modify it
  109.10 @@ -114,7 +114,7 @@
  109.11    if (_cm->verbose_high()) {
  109.12      gclog_or_tty->print_cr("[%u] we're looking at location "
  109.13                             "*"PTR_FORMAT" = "PTR_FORMAT,
  109.14 -                           _task->worker_id(), p, (void*) obj);
  109.15 +                           _task->worker_id(), p2i(p), p2i((void*) obj));
  109.16    }
  109.17    _task->deal_with_reference(obj);
  109.18  }
   110.1 --- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Wed May 21 10:56:41 2014 -0700
   110.2 +++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Fri May 23 14:12:52 2014 -0700
   110.3 @@ -1,5 +1,5 @@
   110.4  /*
   110.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   110.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   110.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   110.8   *
   110.9   * This code is free software; you can redistribute it and/or modify it
  110.10 @@ -39,6 +39,8 @@
  110.11  #include "oops/oop.inline.hpp"
  110.12  #include "utilities/intHisto.hpp"
  110.13  
  110.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  110.15 +
  110.16  #define CARD_REPEAT_HISTO 0
  110.17  
  110.18  #if CARD_REPEAT_HISTO
   111.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed May 21 10:56:41 2014 -0700
   111.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Fri May 23 14:12:52 2014 -0700
   111.3 @@ -34,6 +34,8 @@
   111.4  #include "memory/iterator.hpp"
   111.5  #include "oops/oop.inline.hpp"
   111.6  
   111.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   111.8 +
   111.9  int    HeapRegion::LogOfHRGrainBytes = 0;
  111.10  int    HeapRegion::LogOfHRGrainWords = 0;
  111.11  size_t HeapRegion::GrainBytes        = 0;
  111.12 @@ -829,7 +831,7 @@
  111.13                          Mutex::_no_safepoint_check_flag);
  111.14  
  111.15          if (!_failures) {
  111.16 -          gclog_or_tty->print_cr("");
  111.17 +          gclog_or_tty->cr();
  111.18            gclog_or_tty->print_cr("----------");
  111.19          }
  111.20          if (!_g1h->is_in_closed_subset(obj)) {
  111.21 @@ -884,7 +886,7 @@
  111.22                              Mutex::_no_safepoint_check_flag);
  111.23  
  111.24              if (!_failures) {
  111.25 -              gclog_or_tty->print_cr("");
  111.26 +              gclog_or_tty->cr();
  111.27                gclog_or_tty->print_cr("----------");
  111.28              }
  111.29              gclog_or_tty->print_cr("Missing rem set entry:");
   112.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed May 21 10:56:41 2014 -0700
   112.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Fri May 23 14:12:52 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 @@ -61,7 +61,7 @@
  112.11                  (_hr_)->startsHumongous() ? "HS" : \
  112.12                  (_hr_)->continuesHumongous() ? "HC" : \
  112.13                  !(_hr_)->is_empty() ? "O" : "F", \
  112.14 -                (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end()
  112.15 +                p2i((_hr_)->bottom()), p2i((_hr_)->top()), p2i((_hr_)->end())
  112.16  
  112.17  // sentinel value for hrs_index
  112.18  #define G1_NULL_HRS_INDEX ((uint) -1)
  112.19 @@ -550,7 +550,7 @@
  112.20             (containing_set != NULL && _containing_set == NULL),
  112.21             err_msg("containing_set: "PTR_FORMAT" "
  112.22                     "_containing_set: "PTR_FORMAT,
  112.23 -                   containing_set, _containing_set));
  112.24 +                   p2i(containing_set), p2i(_containing_set)));
  112.25  
  112.26      _containing_set = containing_set;
  112.27    }
   113.1 --- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Wed May 21 10:56:41 2014 -0700
   113.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Fri May 23 14:12:52 2014 -0700
   113.3 @@ -36,6 +36,8 @@
   113.4  #include "utilities/globalDefinitions.hpp"
   113.5  #include "utilities/growableArray.hpp"
   113.6  
   113.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   113.8 +
   113.9  class PerRegionTable: public CHeapObj<mtGC> {
  113.10    friend class OtherRegionsTable;
  113.11    friend class HeapRegionRemSetIterator;
  113.12 @@ -1244,7 +1246,7 @@
  113.13      while (cur_evnt < _n_recorded_events && i == cur_evnt_ind) {
  113.14        gclog_or_tty->print("Event: ");
  113.15        print_event(gclog_or_tty, cur_evnt_kind);
  113.16 -      gclog_or_tty->print_cr("");
  113.17 +      gclog_or_tty->cr();
  113.18        cur_evnt++;
  113.19        if (cur_evnt < MaxRecordedEvents) {
  113.20          cur_evnt_kind = _recorded_events[cur_evnt];
   114.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp	Wed May 21 10:56:41 2014 -0700
   114.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp	Fri May 23 14:12:52 2014 -0700
   114.3 @@ -1,5 +1,5 @@
   114.4  /*
   114.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   114.6 + * Copyright (c) 2001, 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 @@ -233,7 +233,7 @@
  114.11      guarantee(hr != NULL, err_msg("invariant: i: %u", i));
  114.12      guarantee(hr->bottom() == prev_end,
  114.13                err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT,
  114.14 -                      i, HR_FORMAT_PARAMS(hr), prev_end));
  114.15 +                      i, HR_FORMAT_PARAMS(hr), p2i(prev_end)));
  114.16      guarantee(hr->hrs_index() == i,
  114.17                err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index()));
  114.18      if (i < length()) {
   115.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp	Wed May 21 10:56:41 2014 -0700
   115.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp	Fri May 23 14:12:52 2014 -0700
   115.3 @@ -1,5 +1,5 @@
   115.4  /*
   115.5 - * Copyright (c) 2001, 2013, 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 @@ -37,7 +37,7 @@
  115.11  inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const {
  115.12    if (addr != NULL && addr < heap_end()) {
  115.13      assert(addr >= heap_bottom(),
  115.14 -          err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, heap_bottom()));
  115.15 +          err_msg("addr: " PTR_FORMAT " bottom: " PTR_FORMAT, p2i(addr), p2i(heap_bottom())));
  115.16      return addr_to_region_unsafe(addr);
  115.17    }
  115.18    return NULL;
   116.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Wed May 21 10:56:41 2014 -0700
   116.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Fri May 23 14:12:52 2014 -0700
   116.3 @@ -26,6 +26,8 @@
   116.4  #include "gc_implementation/g1/heapRegionRemSet.hpp"
   116.5  #include "gc_implementation/g1/heapRegionSet.inline.hpp"
   116.6  
   116.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   116.8 +
   116.9  uint FreeRegionList::_unrealistically_long_length = 0;
  116.10  
  116.11  void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) {
   117.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSet.hpp	Wed May 21 10:56:41 2014 -0700
   117.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSet.hpp	Fri May 23 14:12:52 2014 -0700
   117.3 @@ -162,7 +162,7 @@
   117.4  // diagnosing failures.
   117.5  class hrs_ext_msg : public hrs_err_msg {
   117.6  public:
   117.7 -  hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") {
   117.8 +  hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("%s","") {
   117.9      set->fill_in_ext_msg(this, message);
  117.10    }
  117.11  };
   118.1 --- a/src/share/vm/gc_implementation/g1/satbQueue.cpp	Wed May 21 10:56:41 2014 -0700
   118.2 +++ b/src/share/vm/gc_implementation/g1/satbQueue.cpp	Fri May 23 14:12:52 2014 -0700
   118.3 @@ -1,5 +1,5 @@
   118.4  /*
   118.5 - * Copyright (c) 2001, 2012, 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 @@ -32,6 +32,8 @@
  118.11  #include "runtime/thread.hpp"
  118.12  #include "runtime/vmThread.hpp"
  118.13  
  118.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  118.15 +
  118.16  void ObjPtrQueue::flush() {
  118.17    // The buffer might contain refs into the CSet. We have to filter it
  118.18    // first before we flush it, otherwise we might end up with an
   119.1 --- a/src/share/vm/gc_implementation/g1/survRateGroup.cpp	Wed May 21 10:56:41 2014 -0700
   119.2 +++ b/src/share/vm/gc_implementation/g1/survRateGroup.cpp	Fri May 23 14:12:52 2014 -0700
   119.3 @@ -1,5 +1,5 @@
   119.4  /*
   119.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   119.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   119.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   119.8   *
   119.9   * This code is free software; you can redistribute it and/or modify it
  119.10 @@ -29,6 +29,8 @@
  119.11  #include "gc_implementation/g1/survRateGroup.hpp"
  119.12  #include "memory/allocation.hpp"
  119.13  
  119.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  119.15 +
  119.16  SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p,
  119.17                               const char* name,
  119.18                               size_t summary_surv_rates_len) :
  119.19 @@ -202,7 +204,7 @@
  119.20    if (length == 0)
  119.21      return;
  119.22  
  119.23 -  gclog_or_tty->print_cr("");
  119.24 +  gclog_or_tty->cr();
  119.25    gclog_or_tty->print_cr("%s Rate Summary (for up to age %d)", _name, length-1);
  119.26    gclog_or_tty->print_cr("      age range     survival rate (avg)      samples (avg)");
  119.27    gclog_or_tty->print_cr("  ---------------------------------------------------------");
   120.1 --- a/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp	Wed May 21 10:56:41 2014 -0700
   120.2 +++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp	Fri May 23 14:12:52 2014 -0700
   120.3 @@ -1,5 +1,5 @@
   120.4  /*
   120.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   120.6 + * Copyright (c) 2005, 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 @@ -259,22 +259,22 @@
  120.11                    requested_eden_size, requested_survivor_size);
  120.12      gclog_or_tty->print_cr("    eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
  120.13                    SIZE_FORMAT,
  120.14 -                  eden()->bottom(),
  120.15 -                  eden()->end(),
  120.16 +                  p2i(eden()->bottom()),
  120.17 +                  p2i(eden()->end()),
  120.18                    pointer_delta(eden()->end(),
  120.19                                  eden()->bottom(),
  120.20                                  sizeof(char)));
  120.21      gclog_or_tty->print_cr("    from: [" PTR_FORMAT ".." PTR_FORMAT ") "
  120.22                    SIZE_FORMAT,
  120.23 -                  from()->bottom(),
  120.24 -                  from()->end(),
  120.25 +                  p2i(from()->bottom()),
  120.26 +                  p2i(from()->end()),
  120.27                    pointer_delta(from()->end(),
  120.28                                  from()->bottom(),
  120.29                                  sizeof(char)));
  120.30      gclog_or_tty->print_cr("      to: [" PTR_FORMAT ".." PTR_FORMAT ") "
  120.31                    SIZE_FORMAT,
  120.32 -                  to()->bottom(),
  120.33 -                  to()->end(),
  120.34 +                  p2i(to()->bottom()),
  120.35 +                  p2i(to()->end()),
  120.36                    pointer_delta(  to()->end(),
  120.37                                    to()->bottom(),
  120.38                                    sizeof(char)));
  120.39 @@ -382,18 +382,18 @@
  120.40      if (PrintAdaptiveSizePolicy && Verbose) {
  120.41        gclog_or_tty->print_cr("    [eden_start .. eden_end): "
  120.42                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  120.43 -                    eden_start,
  120.44 -                    eden_end,
  120.45 +                    p2i(eden_start),
  120.46 +                    p2i(eden_end),
  120.47                      pointer_delta(eden_end, eden_start, sizeof(char)));
  120.48        gclog_or_tty->print_cr("    [from_start .. from_end): "
  120.49                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  120.50 -                    from_start,
  120.51 -                    from_end,
  120.52 +                    p2i(from_start),
  120.53 +                    p2i(from_end),
  120.54                      pointer_delta(from_end, from_start, sizeof(char)));
  120.55        gclog_or_tty->print_cr("    [  to_start ..   to_end): "
  120.56                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  120.57 -                    to_start,
  120.58 -                    to_end,
  120.59 +                    p2i(to_start),
  120.60 +                    p2i(to_end),
  120.61                      pointer_delta(  to_end,   to_start, sizeof(char)));
  120.62      }
  120.63    } else {
  120.64 @@ -473,18 +473,18 @@
  120.65      if (PrintAdaptiveSizePolicy && Verbose) {
  120.66        gclog_or_tty->print_cr("    [eden_start .. eden_end): "
  120.67                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  120.68 -                    eden_start,
  120.69 -                    eden_end,
  120.70 +                    p2i(eden_start),
  120.71 +                    p2i(eden_end),
  120.72                      pointer_delta(eden_end, eden_start, sizeof(char)));
  120.73        gclog_or_tty->print_cr("    [  to_start ..   to_end): "
  120.74                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  120.75 -                    to_start,
  120.76 -                    to_end,
  120.77 +                    p2i(to_start),
  120.78 +                    p2i(to_end),
  120.79                      pointer_delta(  to_end,   to_start, sizeof(char)));
  120.80        gclog_or_tty->print_cr("    [from_start .. from_end): "
  120.81                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  120.82 -                    from_start,
  120.83 -                    from_end,
  120.84 +                    p2i(from_start),
  120.85 +                    p2i(from_end),
  120.86                      pointer_delta(from_end, from_start, sizeof(char)));
  120.87      }
  120.88    }
   121.1 --- a/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp	Wed May 21 10:56:41 2014 -0700
   121.2 +++ b/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp	Fri May 23 14:12:52 2014 -0700
   121.3 @@ -1,5 +1,5 @@
   121.4  /*
   121.5 - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
   121.6 + * Copyright (c) 2007, 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 @@ -35,6 +35,8 @@
  121.11  #include "runtime/virtualspace.hpp"
  121.12  #include "runtime/vmThread.hpp"
  121.13  
  121.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  121.15 +
  121.16  void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
  121.17                                                               OopsInGenClosure* cl,
  121.18                                                               CardTableRS* ct,
   122.1 --- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Wed May 21 10:56:41 2014 -0700
   122.2 +++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Fri May 23 14:12:52 2014 -0700
   122.3 @@ -1,5 +1,5 @@
   122.4  /*
   122.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   122.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   122.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   122.8   *
   122.9   * This code is free software; you can redistribute it and/or modify it
  122.10 @@ -55,6 +55,8 @@
  122.11  #include "utilities/globalDefinitions.hpp"
  122.12  #include "utilities/workgroup.hpp"
  122.13  
  122.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  122.15 +
  122.16  #ifdef _MSC_VER
  122.17  #pragma warning( push )
  122.18  #pragma warning( disable:4355 ) // 'this' : used in base member initializer list
   123.1 --- a/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Wed May 21 10:56:41 2014 -0700
   123.2 +++ b/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Fri May 23 14:12:52 2014 -0700
   123.3 @@ -1,5 +1,5 @@
   123.4  /*
   123.5 - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
   123.6 + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
   123.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   123.8   *
   123.9   * This code is free software; you can redistribute it and/or modify it
  123.10 @@ -79,12 +79,12 @@
  123.11      if ((HeapWord*)obj < _boundary) {
  123.12  #ifndef PRODUCT
  123.13        if (_g->to()->is_in_reserved(obj)) {
  123.14 -        tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p);
  123.15 +        tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
  123.16          GenCollectedHeap* gch =  (GenCollectedHeap*)Universe::heap();
  123.17          Space* sp = gch->space_containing(p);
  123.18          oop obj = oop(sp->block_start(p));
  123.19          assert((HeapWord*)obj < (HeapWord*)p, "Error");
  123.20 -        tty->print_cr("Object: " PTR_FORMAT, (void *)obj);
  123.21 +        tty->print_cr("Object: " PTR_FORMAT, p2i((void *)obj));
  123.22          tty->print_cr("-------");
  123.23          obj->print();
  123.24          tty->print_cr("-----");
  123.25 @@ -110,7 +110,7 @@
  123.26          if (TraceScavenge) {
  123.27            gclog_or_tty->print_cr("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
  123.28               "forwarded ",
  123.29 -             new_obj->klass()->internal_name(), p, (void *)obj, (void *)new_obj, new_obj->size());
  123.30 +             new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size());
  123.31          }
  123.32  #endif
  123.33  
   124.1 --- a/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp	Wed May 21 10:56:41 2014 -0700
   124.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp	Fri May 23 14:12:52 2014 -0700
   124.3 @@ -1,5 +1,5 @@
   124.4  /*
   124.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   124.6 + * Copyright (c) 2003, 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 @@ -143,7 +143,7 @@
  124.11  
  124.12    if (TraceAdaptiveGCBoundary) {
  124.13      gclog_or_tty->print_cr("Before expansion of old gen with boundary move");
  124.14 -    gclog_or_tty->print_cr("  Requested change: 0x%x  Attempted change: 0x%x",
  124.15 +    gclog_or_tty->print_cr("  Requested change: " SIZE_FORMAT_HEX "  Attempted change: " SIZE_FORMAT_HEX,
  124.16        expand_in_bytes, change_in_bytes);
  124.17      if (!PrintHeapAtGC) {
  124.18        Universe::print_on(gclog_or_tty);
  124.19 @@ -201,7 +201,7 @@
  124.20  
  124.21    if (TraceAdaptiveGCBoundary) {
  124.22      gclog_or_tty->print_cr("Before expansion of young gen with boundary move");
  124.23 -    gclog_or_tty->print_cr("  Requested change: 0x%x  Attempted change: 0x%x",
  124.24 +    gclog_or_tty->print_cr("  Requested change: " SIZE_FORMAT_HEX "  Attempted change: " SIZE_FORMAT_HEX,
  124.25        expand_in_bytes, change_in_bytes);
  124.26      if (!PrintHeapAtGC) {
  124.27        Universe::print_on(gclog_or_tty);
   125.1 --- a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp	Wed May 21 10:56:41 2014 -0700
   125.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp	Fri May 23 14:12:52 2014 -0700
   125.3 @@ -1,5 +1,5 @@
   125.4  /*
   125.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   125.6 + * Copyright (c) 2003, 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 @@ -127,22 +127,22 @@
  125.11    size_t result_aligned = align_size_down(result, gen_alignment);
  125.12    if (PrintAdaptiveSizePolicy && Verbose) {
  125.13      gclog_or_tty->print_cr("\nASPSOldGen::available_for_contraction:"
  125.14 -      " %d K / 0x%x", result_aligned/K, result_aligned);
  125.15 -    gclog_or_tty->print_cr(" reserved().byte_size() %d K / 0x%x ",
  125.16 -      reserved().byte_size()/K, reserved().byte_size());
  125.17 +      " " SSIZE_FORMAT "  K / " SIZE_FORMAT_HEX, (result_aligned/K), result_aligned);
  125.18 +    gclog_or_tty->print_cr(" reserved().byte_size() " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX " ",
  125.19 +      (reserved().byte_size()/K), reserved().byte_size());
  125.20      size_t working_promoted = (size_t) policy->avg_promoted()->padded_average();
  125.21 -    gclog_or_tty->print_cr(" padded promoted %d K / 0x%x",
  125.22 -      working_promoted/K, working_promoted);
  125.23 -    gclog_or_tty->print_cr(" used %d K / 0x%x",
  125.24 -      used_in_bytes()/K, used_in_bytes());
  125.25 -    gclog_or_tty->print_cr(" min_gen_size() %d K / 0x%x",
  125.26 -      min_gen_size()/K, min_gen_size());
  125.27 -    gclog_or_tty->print_cr(" max_contraction %d K / 0x%x",
  125.28 -      max_contraction/K, max_contraction);
  125.29 -    gclog_or_tty->print_cr("    without alignment %d K / 0x%x",
  125.30 -      policy->promo_increment(max_contraction)/K,
  125.31 +    gclog_or_tty->print_cr(" padded promoted " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
  125.32 +      (working_promoted/K), working_promoted);
  125.33 +    gclog_or_tty->print_cr(" used " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
  125.34 +      (used_in_bytes()/K), used_in_bytes());
  125.35 +    gclog_or_tty->print_cr(" min_gen_size() " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
  125.36 +      (min_gen_size()/K), min_gen_size());
  125.37 +    gclog_or_tty->print_cr(" max_contraction " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
  125.38 +      (max_contraction/K), max_contraction);
  125.39 +    gclog_or_tty->print_cr("    without alignment " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
  125.40 +      (policy->promo_increment(max_contraction)/K),
  125.41        policy->promo_increment(max_contraction));
  125.42 -    gclog_or_tty->print_cr(" alignment 0x%x", gen_alignment);
  125.43 +    gclog_or_tty->print_cr(" alignment " SIZE_FORMAT_HEX, gen_alignment);
  125.44    }
  125.45    assert(result_aligned <= max_contraction, "arithmetic is wrong");
  125.46    return result_aligned;
   126.1 --- a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp	Wed May 21 10:56:41 2014 -0700
   126.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp	Fri May 23 14:12:52 2014 -0700
   126.3 @@ -1,5 +1,5 @@
   126.4  /*
   126.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   126.6 + * Copyright (c) 2003, 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 @@ -112,11 +112,11 @@
  126.11      size_t result = policy->eden_increment_aligned_down(max_contraction);
  126.12      size_t result_aligned = align_size_down(result, gen_alignment);
  126.13      if (PrintAdaptiveSizePolicy && Verbose) {
  126.14 -      gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: %d K",
  126.15 +      gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K",
  126.16          result_aligned/K);
  126.17 -      gclog_or_tty->print_cr("  max_contraction %d K", max_contraction/K);
  126.18 -      gclog_or_tty->print_cr("  eden_avail %d K", eden_avail/K);
  126.19 -      gclog_or_tty->print_cr("  gen_avail %d K", gen_avail/K);
  126.20 +      gclog_or_tty->print_cr("  max_contraction " SIZE_FORMAT " K", max_contraction/K);
  126.21 +      gclog_or_tty->print_cr("  eden_avail " SIZE_FORMAT " K", eden_avail/K);
  126.22 +      gclog_or_tty->print_cr("  gen_avail " SIZE_FORMAT " K", gen_avail/K);
  126.23      }
  126.24      return result_aligned;
  126.25    }
  126.26 @@ -252,22 +252,22 @@
  126.27                    requested_eden_size, requested_survivor_size);
  126.28      gclog_or_tty->print_cr("    eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
  126.29                    SIZE_FORMAT,
  126.30 -                  eden_space()->bottom(),
  126.31 -                  eden_space()->end(),
  126.32 +                  p2i(eden_space()->bottom()),
  126.33 +                  p2i(eden_space()->end()),
  126.34                    pointer_delta(eden_space()->end(),
  126.35                                  eden_space()->bottom(),
  126.36                                  sizeof(char)));
  126.37      gclog_or_tty->print_cr("    from: [" PTR_FORMAT ".." PTR_FORMAT ") "
  126.38                    SIZE_FORMAT,
  126.39 -                  from_space()->bottom(),
  126.40 -                  from_space()->end(),
  126.41 +                  p2i(from_space()->bottom()),
  126.42 +                  p2i(from_space()->end()),
  126.43                    pointer_delta(from_space()->end(),
  126.44                                  from_space()->bottom(),
  126.45                                  sizeof(char)));
  126.46      gclog_or_tty->print_cr("      to: [" PTR_FORMAT ".." PTR_FORMAT ") "
  126.47                    SIZE_FORMAT,
  126.48 -                  to_space()->bottom(),
  126.49 -                  to_space()->end(),
  126.50 +                  p2i(to_space()->bottom()),
  126.51 +                  p2i(to_space()->end()),
  126.52                    pointer_delta(  to_space()->end(),
  126.53                                    to_space()->bottom(),
  126.54                                    sizeof(char)));
  126.55 @@ -373,18 +373,18 @@
  126.56      if (PrintAdaptiveSizePolicy && Verbose) {
  126.57        gclog_or_tty->print_cr("    [eden_start .. eden_end): "
  126.58                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  126.59 -                    eden_start,
  126.60 -                    eden_end,
  126.61 +                    p2i(eden_start),
  126.62 +                    p2i(eden_end),
  126.63                      pointer_delta(eden_end, eden_start, sizeof(char)));
  126.64        gclog_or_tty->print_cr("    [from_start .. from_end): "
  126.65                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  126.66 -                    from_start,
  126.67 -                    from_end,
  126.68 +                    p2i(from_start),
  126.69 +                    p2i(from_end),
  126.70                      pointer_delta(from_end, from_start, sizeof(char)));
  126.71        gclog_or_tty->print_cr("    [  to_start ..   to_end): "
  126.72                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  126.73 -                    to_start,
  126.74 -                    to_end,
  126.75 +                    p2i(to_start),
  126.76 +                    p2i(to_end),
  126.77                      pointer_delta(  to_end,   to_start, sizeof(char)));
  126.78      }
  126.79    } else {
  126.80 @@ -427,18 +427,18 @@
  126.81      if (PrintAdaptiveSizePolicy && Verbose) {
  126.82        gclog_or_tty->print_cr("    [eden_start .. eden_end): "
  126.83                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  126.84 -                    eden_start,
  126.85 -                    eden_end,
  126.86 +                    p2i(eden_start),
  126.87 +                    p2i(eden_end),
  126.88                      pointer_delta(eden_end, eden_start, sizeof(char)));
  126.89        gclog_or_tty->print_cr("    [  to_start ..   to_end): "
  126.90                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  126.91 -                    to_start,
  126.92 -                    to_end,
  126.93 +                    p2i(to_start),
  126.94 +                    p2i(to_end),
  126.95                      pointer_delta(  to_end,   to_start, sizeof(char)));
  126.96        gclog_or_tty->print_cr("    [from_start .. from_end): "
  126.97                      "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
  126.98 -                    from_start,
  126.99 -                    from_end,
 126.100 +                    p2i(from_start),
 126.101 +                    p2i(from_end),
 126.102                      pointer_delta(from_end, from_start, sizeof(char)));
 126.103      }
 126.104    }
   127.1 --- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp	Wed May 21 10:56:41 2014 -0700
   127.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp	Fri May 23 14:12:52 2014 -0700
   127.3 @@ -1,5 +1,5 @@
   127.4  /*
   127.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   127.6 + * Copyright (c) 2001, 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 @@ -478,23 +478,23 @@
  127.11      gclog_or_tty->print_cr("  "
  127.12                    "  _covered[%d].start(): " INTPTR_FORMAT
  127.13                    "  _covered[%d].last(): " INTPTR_FORMAT,
  127.14 -                  ind, _covered[ind].start(),
  127.15 -                  ind, _covered[ind].last());
  127.16 +                  ind, p2i(_covered[ind].start()),
  127.17 +                  ind, p2i(_covered[ind].last()));
  127.18      gclog_or_tty->print_cr("  "
  127.19                    "  _committed[%d].start(): " INTPTR_FORMAT
  127.20                    "  _committed[%d].last(): " INTPTR_FORMAT,
  127.21 -                  ind, _committed[ind].start(),
  127.22 -                  ind, _committed[ind].last());
  127.23 +                  ind, p2i(_committed[ind].start()),
  127.24 +                  ind, p2i(_committed[ind].last()));
  127.25      gclog_or_tty->print_cr("  "
  127.26                    "  byte_for(start): " INTPTR_FORMAT
  127.27                    "  byte_for(last): " INTPTR_FORMAT,
  127.28 -                  byte_for(_covered[ind].start()),
  127.29 -                  byte_for(_covered[ind].last()));
  127.30 +                  p2i(byte_for(_covered[ind].start())),
  127.31 +                  p2i(byte_for(_covered[ind].last())));
  127.32      gclog_or_tty->print_cr("  "
  127.33                    "  addr_for(start): " INTPTR_FORMAT
  127.34                    "  addr_for(last): " INTPTR_FORMAT,
  127.35 -                  addr_for((jbyte*) _committed[ind].start()),
  127.36 -                  addr_for((jbyte*) _committed[ind].last()));
  127.37 +                  p2i(addr_for((jbyte*) _committed[ind].start())),
  127.38 +                  p2i(addr_for((jbyte*) _committed[ind].last())));
  127.39    }
  127.40    debug_only(verify_guard();)
  127.41  }
   128.1 --- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp	Wed May 21 10:56:41 2014 -0700
   128.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp	Fri May 23 14:12:52 2014 -0700
   128.3 @@ -1,5 +1,5 @@
   128.4  /*
   128.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
   128.6 + * Copyright (c) 2002, 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 @@ -31,6 +31,8 @@
  128.11  #include "runtime/mutex.hpp"
  128.12  #include "runtime/mutexLocker.hpp"
  128.13  
  128.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  128.15 +
  128.16  //
  128.17  // GCTask
  128.18  //
   129.1 --- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp	Wed May 21 10:56:41 2014 -0700
   129.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp	Fri May 23 14:12:52 2014 -0700
   129.3 @@ -1,6 +1,6 @@
   129.4  
   129.5  /*
   129.6 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   129.7 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
   129.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   129.9   *
  129.10   * This code is free software; you can redistribute it and/or modify it
  129.11 @@ -34,6 +34,8 @@
  129.12  #include "runtime/os.hpp"
  129.13  #include "runtime/thread.hpp"
  129.14  
  129.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  129.16 +
  129.17  GCTaskThread::GCTaskThread(GCTaskManager* manager,
  129.18                             uint           which,
  129.19                             uint           processor_id) :
   130.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Wed May 21 10:56:41 2014 -0700
   130.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Fri May 23 14:12:52 2014 -0700
   130.3 @@ -1,5 +1,5 @@
   130.4  /*
   130.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   130.6 + * Copyright (c) 2005, 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 @@ -155,7 +155,7 @@
  130.11    static inline idx_t bits_required(MemRegion covered_region);
  130.12  
  130.13    void print_on_error(outputStream* st) const {
  130.14 -    st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this);
  130.15 +    st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, p2i(this));
  130.16      _beg_bits.print_on_error(st, " Begin Bits: ");
  130.17      _end_bits.print_on_error(st, " End Bits:   ");
  130.18    }
  130.19 @@ -390,9 +390,9 @@
  130.20  inline void ParMarkBitMap::verify_addr(HeapWord* addr) const {
  130.21    // Allow one past the last valid address; useful for loop bounds.
  130.22    assert(addr >= region_start(),
  130.23 -      err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, addr, region_start()));
  130.24 +      err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, p2i(addr), p2i(region_start())));
  130.25    assert(addr <= region_end(),
  130.26 -      err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, addr, region_end()));
  130.27 +      err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, p2i(addr), p2i(region_end())));
  130.28  }
  130.29  #endif  // #ifdef ASSERT
  130.30  
   131.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Wed May 21 10:56:41 2014 -0700
   131.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Fri May 23 14:12:52 2014 -0700
   131.3 @@ -1,5 +1,5 @@
   131.4  /*
   131.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   131.6 + * Copyright (c) 2001, 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 @@ -373,7 +373,7 @@
  131.11      if ((result == NULL) && (QueuedAllocationWarningCount > 0) &&
  131.12          (loop_count % QueuedAllocationWarningCount == 0)) {
  131.13        warning("ParallelScavengeHeap::mem_allocate retries %d times \n\t"
  131.14 -              " size=%d", loop_count, size);
  131.15 +              " size=" SIZE_FORMAT, loop_count, size);
  131.16      }
  131.17    }
  131.18  
   132.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp	Wed May 21 10:56:41 2014 -0700
   132.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp	Fri May 23 14:12:52 2014 -0700
   132.3 @@ -1,5 +1,5 @@
   132.4  /*
   132.5 - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
   132.6 + * Copyright (c) 2006, 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 @@ -52,7 +52,7 @@
  132.11    const void* loc = (void*) p;
  132.12    bool result = ((HeapWord*)p) >= young_gen()->reserved().start();
  132.13    assert(result == young_gen()->is_in_reserved(p),
  132.14 -        err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p));
  132.15 +        err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p)));
  132.16    return result;
  132.17  }
  132.18  #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP
   133.1 --- a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Wed May 21 10:56:41 2014 -0700
   133.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Fri May 23 14:12:52 2014 -0700
   133.3 @@ -1,5 +1,5 @@
   133.4  /*
   133.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   133.6 + * Copyright (c) 2005, 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 @@ -41,6 +41,8 @@
  133.11  #include "runtime/vmThread.hpp"
  133.12  #include "services/management.hpp"
  133.13  
  133.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  133.15 +
  133.16  //
  133.17  // ThreadRootsMarkingTask
  133.18  //
   134.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp	Wed May 21 10:56:41 2014 -0700
   134.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp	Fri May 23 14:12:52 2014 -0700
   134.3 @@ -1,5 +1,5 @@
   134.4  /*
   134.5 - * Copyright (c) 2002, 2013, 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 @@ -35,6 +35,8 @@
  134.11  
  134.12  #include <math.h>
  134.13  
  134.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  134.15 +
  134.16  PSAdaptiveSizePolicy::PSAdaptiveSizePolicy(size_t init_eden_size,
  134.17                                             size_t init_promo_size,
  134.18                                             size_t init_survivor_size,
  134.19 @@ -1033,7 +1035,7 @@
  134.20        "AdaptiveSizePolicy::adjust_promo_for_footprint "
  134.21        "adjusting tenured gen for footprint. "
  134.22        "starting promo size " SIZE_FORMAT
  134.23 -      " reduced promo size " SIZE_FORMAT,
  134.24 +      " reduced promo size " SIZE_FORMAT
  134.25        " promo delta " SIZE_FORMAT,
  134.26        desired_promo_size, reduced_size, change );
  134.27    }
   135.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Wed May 21 10:56:41 2014 -0700
   135.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Fri May 23 14:12:52 2014 -0700
   135.3 @@ -1,5 +1,5 @@
   135.4  /*
   135.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   135.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   135.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   135.8   *
   135.9   * This code is free software; you can redistribute it and/or modify it
  135.10 @@ -54,6 +54,8 @@
  135.11  #include "utilities/events.hpp"
  135.12  #include "utilities/stack.inline.hpp"
  135.13  
  135.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  135.15 +
  135.16  elapsedTimer        PSMarkSweep::_accumulated_time;
  135.17  jlong               PSMarkSweep::_time_of_last_gc   = 0;
  135.18  CollectorCounters*  PSMarkSweep::_counters = NULL;
   136.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp	Wed May 21 10:56:41 2014 -0700
   136.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp	Fri May 23 14:12:52 2014 -0700
   136.3 @@ -1,5 +1,5 @@
   136.4  /*
   136.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   136.6 + * Copyright (c) 2001, 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 @@ -33,6 +33,8 @@
  136.11  #include "oops/oop.inline.hpp"
  136.12  #include "runtime/java.hpp"
  136.13  
  136.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  136.15 +
  136.16  inline const char* PSOldGen::select_name() {
  136.17    return UseParallelOldGC ? "ParOldGen" : "PSOldGen";
  136.18  }
   137.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Wed May 21 10:56:41 2014 -0700
   137.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Fri May 23 14:12:52 2014 -0700
   137.3 @@ -1,5 +1,5 @@
   137.4  /*
   137.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   137.6 + * Copyright (c) 2005, 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 @@ -61,6 +61,8 @@
  137.11  
  137.12  #include <math.h>
  137.13  
  137.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  137.15 +
  137.16  // All sizes are in HeapWords.
  137.17  const size_t ParallelCompactData::Log2RegionSize  = 16; // 64K words
  137.18  const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
   138.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Wed May 21 10:56:41 2014 -0700
   138.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Fri May 23 14:12:52 2014 -0700
   138.3 @@ -1,5 +1,5 @@
   138.4  /*
   138.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   138.6 + * Copyright (c) 2002, 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 @@ -35,6 +35,8 @@
  138.11  #include "oops/oop.inline.hpp"
  138.12  #include "oops/oop.psgc.inline.hpp"
  138.13  
  138.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  138.15 +
  138.16  PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
  138.17  OopStarTaskQueueSet*           PSPromotionManager::_stack_array_depth = NULL;
  138.18  PSOldGen*                      PSPromotionManager::_old_gen = NULL;
  138.19 @@ -136,7 +138,7 @@
  138.20    }
  138.21  
  138.22    const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
  138.23 -  for (uint i = 0; i < hlines; ++i) tty->print_cr(pm_stats_hdr[i]);
  138.24 +  for (uint i = 0; i < hlines; ++i) tty->print_cr("%s", pm_stats_hdr[i]);
  138.25    for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
  138.26      manager_array(i)->print_local_stats(i);
  138.27    }
   139.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp	Wed May 21 10:56:41 2014 -0700
   139.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp	Fri May 23 14:12:52 2014 -0700
   139.3 @@ -1,5 +1,5 @@
   139.4  /*
   139.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   139.6 + * Copyright (c) 2002, 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 @@ -226,7 +226,7 @@
  139.11    if (TraceScavenge) {
  139.12      gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
  139.13         PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring",
  139.14 -       new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size());
  139.15 +       new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
  139.16    }
  139.17  #endif
  139.18  
   140.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Wed May 21 10:56:41 2014 -0700
   140.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Fri May 23 14:12:52 2014 -0700
   140.3 @@ -56,6 +56,7 @@
   140.4  #include "services/memoryService.hpp"
   140.5  #include "utilities/stack.inline.hpp"
   140.6  
   140.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   140.8  
   140.9  HeapWord*                  PSScavenge::_to_space_top_before_gc = NULL;
  140.10  int                        PSScavenge::_consecutive_skipped_scavenges = 0;
   141.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp	Wed May 21 10:56:41 2014 -0700
   141.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp	Fri May 23 14:12:52 2014 -0700
   141.3 @@ -1,5 +1,5 @@
   141.4  /*
   141.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   141.6 + * Copyright (c) 2002, 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 @@ -81,7 +81,7 @@
  141.11    if (TraceScavenge &&  o->is_forwarded()) {
  141.12      gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
  141.13         "forwarding",
  141.14 -       new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size());
  141.15 +       new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
  141.16    }
  141.17  #endif
  141.18  
   142.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Wed May 21 10:56:41 2014 -0700
   142.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Fri May 23 14:12:52 2014 -0700
   142.3 @@ -1,5 +1,5 @@
   142.4  /*
   142.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   142.6 + * Copyright (c) 2003, 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 @@ -42,6 +42,8 @@
  142.11  # include "os_bsd.inline.hpp"
  142.12  #endif
  142.13  
  142.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  142.15 +
  142.16  // PSVirtualSpace
  142.17  
  142.18  PSVirtualSpace::PSVirtualSpace(ReservedSpace rs, size_t alignment) :
   143.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp	Wed May 21 10:56:41 2014 -0700
   143.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp	Fri May 23 14:12:52 2014 -0700
   143.3 @@ -1,5 +1,5 @@
   143.4  /*
   143.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   143.6 + * Copyright (c) 2001, 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 @@ -33,6 +33,8 @@
  143.11  #include "oops/oop.inline.hpp"
  143.12  #include "runtime/java.hpp"
  143.13  
  143.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  143.15 +
  143.16  PSYoungGen::PSYoungGen(size_t        initial_size,
  143.17                         size_t        min_size,
  143.18                         size_t        max_size) :
   144.1 --- a/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp	Wed May 21 10:56:41 2014 -0700
   144.2 +++ b/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp	Fri May 23 14:12:52 2014 -0700
   144.3 @@ -1,5 +1,5 @@
   144.4  /*
   144.5 - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
   144.6 + * Copyright (c) 2004, 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 @@ -171,8 +171,8 @@
  144.11         "active_workers(): %d  new_acitve_workers: %d  "
  144.12         "prev_active_workers: %d\n"
  144.13         " active_workers_by_JT: %d  active_workers_by_heap_size: %d",
  144.14 -       active_workers, new_active_workers, prev_active_workers,
  144.15 -       active_workers_by_JT, active_workers_by_heap_size);
  144.16 +       (int) active_workers, (int) new_active_workers, (int) prev_active_workers,
  144.17 +       (int) active_workers_by_JT, (int) active_workers_by_heap_size);
  144.18    }
  144.19    assert(new_active_workers > 0, "Always need at least 1");
  144.20    return new_active_workers;
  144.21 @@ -545,13 +545,13 @@
  144.22    if (UseGCOverheadLimit && PrintGCDetails && Verbose) {
  144.23      if (gc_overhead_limit_exceeded()) {
  144.24        gclog_or_tty->print_cr("      GC is exceeding overhead limit "
  144.25 -        "of %d%%", GCTimeLimit);
  144.26 +        "of %d%%", (int) GCTimeLimit);
  144.27        reset_gc_overhead_limit_count();
  144.28      } else if (print_gc_overhead_limit_would_be_exceeded) {
  144.29        assert(gc_overhead_limit_count() > 0, "Should not be printing");
  144.30        gclog_or_tty->print_cr("      GC would exceed overhead limit "
  144.31          "of %d%% %d consecutive time(s)",
  144.32 -        GCTimeLimit, gc_overhead_limit_count());
  144.33 +        (int) GCTimeLimit, gc_overhead_limit_count());
  144.34      }
  144.35    }
  144.36  }
   145.1 --- a/src/share/vm/gc_implementation/shared/ageTable.cpp	Wed May 21 10:56:41 2014 -0700
   145.2 +++ b/src/share/vm/gc_implementation/shared/ageTable.cpp	Fri May 23 14:12:52 2014 -0700
   145.3 @@ -1,5 +1,5 @@
   145.4  /*
   145.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   145.6 + * Copyright (c) 1997, 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 @@ -97,7 +97,7 @@
  145.11      if (PrintTenuringDistribution) {
  145.12        gclog_or_tty->cr();
  145.13        gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u (max %u)",
  145.14 -        desired_survivor_size*oopSize, result, MaxTenuringThreshold);
  145.15 +        desired_survivor_size*oopSize, result, (int) MaxTenuringThreshold);
  145.16      }
  145.17  
  145.18      total = 0;
  145.19 @@ -106,8 +106,8 @@
  145.20        total += sizes[age];
  145.21        if (sizes[age] > 0) {
  145.22          if (PrintTenuringDistribution) {
  145.23 -          gclog_or_tty->print_cr("- age %3u: %10ld bytes, %10ld total",
  145.24 -            age, sizes[age]*oopSize, total*oopSize);
  145.25 +          gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total",
  145.26 +                                        age,    sizes[age]*oopSize,          total*oopSize);
  145.27          }
  145.28        }
  145.29        if (UsePerfData) {
   146.1 --- a/src/share/vm/gc_implementation/shared/allocationStats.hpp	Wed May 21 10:56:41 2014 -0700
   146.2 +++ b/src/share/vm/gc_implementation/shared/allocationStats.hpp	Fri May 23 14:12:52 2014 -0700
   146.3 @@ -1,5 +1,5 @@
   146.4  /*
   146.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   146.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   146.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   146.8   *
   146.9   * This code is free software; you can redistribute it and/or modify it
  146.10 @@ -107,7 +107,7 @@
  146.11        assert(demand >= 0,
  146.12               err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for "
  146.13                       PTR_FORMAT " (size=" SIZE_FORMAT ")",
  146.14 -                     demand, this, count));
  146.15 +                     demand, p2i(this), count));
  146.16        // Defensive: adjust for imprecision in event counting
  146.17        if (demand < 0) {
  146.18          demand = 0;
  146.19 @@ -120,8 +120,9 @@
  146.20        float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0);
  146.21        _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise));
  146.22        if (PrintFLSStatistics > 1) {
  146.23 -        gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d",
  146.24 -                                demand,     old_rate,     rate,             new_rate,     old_desired,     _desired);
  146.25 +        gclog_or_tty->print_cr(
  146.26 +        "demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT,
  146.27 +                           demand,     old_rate,             rate,     new_rate,                 old_desired,                   _desired);
  146.28        }
  146.29      }
  146.30    }
   147.1 --- a/src/share/vm/gc_implementation/shared/immutableSpace.cpp	Wed May 21 10:56:41 2014 -0700
   147.2 +++ b/src/share/vm/gc_implementation/shared/immutableSpace.cpp	Fri May 23 14:12:52 2014 -0700
   147.3 @@ -1,5 +1,5 @@
   147.4  /*
   147.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   147.6 + * Copyright (c) 2001, 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 @@ -66,7 +66,7 @@
  147.11  
  147.12  void ImmutableSpace::print() const {
  147.13    print_short();
  147.14 -  tty->print_cr(" [%#-6lx,%#-6lx)", bottom(), end());
  147.15 +  tty->print_cr(" [" INTPTR_FORMAT_W(#-6) "," INTPTR_FORMAT_W(#-6) ")", p2i(bottom()), p2i(end()));
  147.16  }
  147.17  
  147.18  #endif
   148.1 --- a/src/share/vm/gc_implementation/shared/markSweep.cpp	Wed May 21 10:56:41 2014 -0700
   148.2 +++ b/src/share/vm/gc_implementation/shared/markSweep.cpp	Fri May 23 14:12:52 2014 -0700
   148.3 @@ -1,5 +1,5 @@
   148.4  /*
   148.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   148.6 + * Copyright (c) 1997, 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 @@ -32,6 +32,8 @@
  148.11  #include "oops/objArrayKlass.inline.hpp"
  148.12  #include "oops/oop.inline.hpp"
  148.13  
  148.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  148.15 +
  148.16  uint                    MarkSweep::_total_invocations = 0;
  148.17  
  148.18  Stack<oop, mtGC>              MarkSweep::_marking_stack;
   149.1 --- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Wed May 21 10:56:41 2014 -0700
   149.2 +++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Fri May 23 14:12:52 2014 -0700
   149.3 @@ -1,6 +1,6 @@
   149.4  
   149.5  /*
   149.6 - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
   149.7 + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
   149.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   149.9   *
  149.10   * This code is free software; you can redistribute it and/or modify it
  149.11 @@ -30,6 +30,8 @@
  149.12  #include "oops/oop.inline.hpp"
  149.13  #include "runtime/thread.inline.hpp"
  149.14  
  149.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  149.16 +
  149.17  MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) {
  149.18    _lgrp_spaces = new (ResourceObj::C_HEAP, mtGC) GrowableArray<LGRPSpace*>(0, true);
  149.19    _page_size = os::vm_page_size();
   150.1 --- a/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Wed May 21 10:56:41 2014 -0700
   150.2 +++ b/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Fri May 23 14:12:52 2014 -0700
   150.3 @@ -1,5 +1,5 @@
   150.4  /*
   150.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   150.6 + * Copyright (c) 2001, 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 @@ -32,6 +32,8 @@
  150.11  #include "runtime/thread.hpp"
  150.12  #endif // INCLUDE_ALL_GCS
  150.13  
  150.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  150.15 +
  150.16  MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
  150.17    assert(MutableSpace::alignment() >= 0 &&
  150.18           MutableSpace::alignment() % os::vm_page_size() == 0,
   151.1 --- a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp	Wed May 21 10:56:41 2014 -0700
   151.2 +++ b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp	Fri May 23 14:12:52 2014 -0700
   151.3 @@ -1,5 +1,5 @@
   151.4  /*
   151.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   151.6 + * Copyright (c) 2001, 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 @@ -28,6 +28,8 @@
  151.11  #include "oops/arrayOop.hpp"
  151.12  #include "oops/oop.inline.hpp"
  151.13  
  151.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  151.15 +
  151.16  ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) :
  151.17    _word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
  151.18    _end(NULL), _hard_end(NULL),
   152.1 --- a/src/share/vm/gc_implementation/shared/spaceDecorator.cpp	Wed May 21 10:56:41 2014 -0700
   152.2 +++ b/src/share/vm/gc_implementation/shared/spaceDecorator.cpp	Fri May 23 14:12:52 2014 -0700
   152.3 @@ -1,5 +1,5 @@
   152.4  /*
   152.5 - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
   152.6 + * Copyright (c) 2002, 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 @@ -27,6 +27,8 @@
  152.11  #include "memory/space.inline.hpp"
  152.12  #include "utilities/copy.hpp"
  152.13  
  152.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  152.15 +
  152.16  // Catch-all file for utility classes
  152.17  
  152.18  #ifndef PRODUCT
   153.1 --- a/src/share/vm/gc_interface/collectedHeap.cpp	Wed May 21 10:56:41 2014 -0700
   153.2 +++ b/src/share/vm/gc_interface/collectedHeap.cpp	Fri May 23 14:12:52 2014 -0700
   153.3 @@ -599,12 +599,12 @@
   153.4    assert(heap_start >= ((uintptr_t)NULL + epsilon), "sanity");
   153.5    void* before_heap = (void*)(heap_start - epsilon);
   153.6    assert(!heap->is_in(before_heap),
   153.7 -      err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", before_heap));
   153.8 +      err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap)));
   153.9  
  153.10    // Test that a pointer to after the heap end is reported as outside the heap.
  153.11    assert(heap_end <= ((uintptr_t)-1 - epsilon), "sanity");
  153.12    void* after_heap = (void*)(heap_end + epsilon);
  153.13    assert(!heap->is_in(after_heap),
  153.14 -      err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", after_heap));
  153.15 +      err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap)));
  153.16  }
  153.17  #endif
   154.1 --- a/src/share/vm/interpreter/bytecodeTracer.cpp	Wed May 21 10:56:41 2014 -0700
   154.2 +++ b/src/share/vm/interpreter/bytecodeTracer.cpp	Fri May 23 14:12:52 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 @@ -215,7 +215,7 @@
  154.11        st->print_cr(" %s", buf);
  154.12      }
  154.13    } else {
  154.14 -    st->print_cr(" " PTR_FORMAT, (void *)value);
  154.15 +    st->print_cr(" " PTR_FORMAT, p2i((void *)value));
  154.16    }
  154.17  }
  154.18  
  154.19 @@ -284,7 +284,7 @@
  154.20    if (i >= 0 && i < climit) {
  154.21      cp_index = cache->entry_at(i)->constant_pool_index();
  154.22    } else {
  154.23 -    st->print_cr(" not in CP[*]?", i);
  154.24 +    st->print_cr("%d not in CP[*]?", i);
  154.25        return false;
  154.26      }
  154.27    return true;
  154.28 @@ -299,7 +299,7 @@
  154.29       cp_index = constants->object_to_cp_index(i);
  154.30       return true;
  154.31    } else {
  154.32 -    st->print_cr(" not in OBJ[*]?", i);
  154.33 +    st->print_cr("%d not in OBJ[*]?", i);
  154.34    return false;
  154.35  }
  154.36  }
  154.37 @@ -323,7 +323,7 @@
  154.38    if (tag.is_int()) {
  154.39      st->print_cr(" " INT32_FORMAT, constants->int_at(i));
  154.40    } else if (tag.is_long()) {
  154.41 -    st->print_cr(" " INT64_FORMAT, constants->long_at(i));
  154.42 +    st->print_cr(" " INT64_FORMAT, (int64_t)(constants->long_at(i)));
  154.43    } else if (tag.is_float()) {
  154.44      st->print_cr(" %f", constants->float_at(i));
  154.45    } else if (tag.is_double()) {
  154.46 @@ -342,7 +342,7 @@
  154.47    } else if (tag.is_method_handle()) {
  154.48      int kind = constants->method_handle_ref_kind_at(i);
  154.49      int i2 = constants->method_handle_index_at(i);
  154.50 -    st->print(" <MethodHandle of kind %d>", kind, i2);
  154.51 +    st->print(" <MethodHandle of kind %d index at %d>", kind, i2);
  154.52      print_field_or_method(-i, i2, st);
  154.53    } else {
  154.54      st->print_cr(" bad tag=%d at %d", tag.value(), i);
  154.55 @@ -391,6 +391,7 @@
  154.56  }
  154.57  
  154.58  
  154.59 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  154.60  void BytecodePrinter::print_attributes(int bci, outputStream* st) {
  154.61    // Show attributes of pre-rewritten codes
  154.62    Bytecodes::Code code = Bytecodes::java_code(raw_code());
  154.63 @@ -517,7 +518,10 @@
  154.64            int idx = ll - lo;
  154.65            const char *format = first ? " %d:" INT32_FORMAT " (delta: %d)" :
  154.66                                         ", %d:" INT32_FORMAT " (delta: %d)";
  154.67 +PRAGMA_DIAG_PUSH
  154.68 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  154.69            st->print(format, ll, dest[idx], dest[idx]-bci);
  154.70 +PRAGMA_DIAG_POP
  154.71          }
  154.72          st->cr();
  154.73        }
  154.74 @@ -537,7 +541,10 @@
  154.75          for (int ll = 0; ll < len; ll++, first = false)  {
  154.76            const char *format = first ? " " INT32_FORMAT ":" INT32_FORMAT :
  154.77                                         ", " INT32_FORMAT ":" INT32_FORMAT ;
  154.78 +PRAGMA_DIAG_PUSH
  154.79 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  154.80            st->print(format, key[ll], dest[ll]);
  154.81 +PRAGMA_DIAG_POP
  154.82          }
  154.83          st->cr();
  154.84        }
   155.1 --- a/src/share/vm/interpreter/interpreter.cpp	Wed May 21 10:56:41 2014 -0700
   155.2 +++ b/src/share/vm/interpreter/interpreter.cpp	Fri May 23 14:12:52 2014 -0700
   155.3 @@ -1,5 +1,5 @@
   155.4  /*
   155.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   155.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   155.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   155.8   *
   155.9   * This code is free software; you can redistribute it and/or modify it
  155.10 @@ -72,7 +72,7 @@
  155.11    if (description() != NULL) st->print("%s  ", description());
  155.12    if (bytecode()    >= 0   ) st->print("%d %s  ", bytecode(), Bytecodes::name(bytecode()));
  155.13    st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "]  %d bytes",
  155.14 -                code_begin(), code_end(), code_size());
  155.15 +                p2i(code_begin()), p2i(code_end()), code_size());
  155.16  
  155.17    if (PrintInterpreter) {
  155.18      st->cr();
   156.1 --- a/src/share/vm/interpreter/interpreterRuntime.cpp	Wed May 21 10:56:41 2014 -0700
   156.2 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Fri May 23 14:12:52 2014 -0700
   156.3 @@ -1,5 +1,5 @@
   156.4  /*
   156.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   156.6 + * Copyright (c) 1997, 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 @@ -75,6 +75,8 @@
  156.11  #include "opto/runtime.hpp"
  156.12  #endif
  156.13  
  156.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  156.15 +
  156.16  class UnlockFlagSaver {
  156.17    private:
  156.18      JavaThread* _thread;
   157.1 --- a/src/share/vm/interpreter/linkResolver.cpp	Wed May 21 10:56:41 2014 -0700
   157.2 +++ b/src/share/vm/interpreter/linkResolver.cpp	Fri May 23 14:12:52 2014 -0700
   157.3 @@ -1630,7 +1630,7 @@
   157.4                                                       THREAD);
   157.5    if (HAS_PENDING_EXCEPTION) {
   157.6      if (TraceMethodHandles) {
   157.7 -      tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, (void *)PENDING_EXCEPTION);
   157.8 +      tty->print_cr("invokedynamic throws BSME for " INTPTR_FORMAT, p2i((void *)PENDING_EXCEPTION));
   157.9        PENDING_EXCEPTION->print();
  157.10      }
  157.11      if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) {
   158.1 --- a/src/share/vm/interpreter/oopMapCache.cpp	Wed May 21 10:56:41 2014 -0700
   158.2 +++ b/src/share/vm/interpreter/oopMapCache.cpp	Fri May 23 14:12:52 2014 -0700
   158.3 @@ -1,5 +1,5 @@
   158.4  /*
   158.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   158.6 + * Copyright (c) 1997, 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 @@ -31,6 +31,8 @@
  158.11  #include "runtime/handles.inline.hpp"
  158.12  #include "runtime/signature.hpp"
  158.13  
  158.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  158.15 +
  158.16  class OopMapCacheEntry: private InterpreterOopMap {
  158.17    friend class InterpreterOopMap;
  158.18    friend class OopMapForCacheEntry;
   159.1 --- a/src/share/vm/interpreter/templateInterpreter.cpp	Wed May 21 10:56:41 2014 -0700
   159.2 +++ b/src/share/vm/interpreter/templateInterpreter.cpp	Fri May 23 14:12:52 2014 -0700
   159.3 @@ -1,5 +1,5 @@
   159.4  /*
   159.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   159.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   159.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   159.8   *
   159.9   * This code is free software; you can redistribute it and/or modify it
  159.10 @@ -104,7 +104,7 @@
  159.11    tty->print("[");
  159.12    for (int i = 0; i < number_of_states; i++) {
  159.13      if (i > 0) tty->print(", ");
  159.14 -    tty->print(INTPTR_FORMAT, _entry[i]);
  159.15 +    tty->print(INTPTR_FORMAT, p2i(_entry[i]));
  159.16    }
  159.17    tty->print("]");
  159.18  }
   160.1 --- a/src/share/vm/libadt/dict.cpp	Wed May 21 10:56:41 2014 -0700
   160.2 +++ b/src/share/vm/libadt/dict.cpp	Fri May 23 14:12:52 2014 -0700
   160.3 @@ -1,5 +1,5 @@
   160.4  /*
   160.5 - * Copyright (c) 1997, 2010, 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 @@ -38,6 +38,8 @@
  160.11  
  160.12  #include <assert.h>
  160.13  
  160.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  160.15 +
  160.16  // The iostream is not needed and it gets confused for gcc by the
  160.17  // define of bool.
  160.18  //
   161.1 --- a/src/share/vm/libadt/set.cpp	Wed May 21 10:56:41 2014 -0700
   161.2 +++ b/src/share/vm/libadt/set.cpp	Fri May 23 14:12:52 2014 -0700
   161.3 @@ -1,5 +1,5 @@
   161.4  /*
   161.5 - * Copyright (c) 1997, 2012, 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 @@ -116,7 +116,7 @@
  161.11  void Set::print() const
  161.12  {
  161.13    char *printable_set = setstr();
  161.14 -  tty->print_cr(printable_set);
  161.15 +  tty->print_cr("%s", printable_set);
  161.16    FreeHeap(printable_set);
  161.17  }
  161.18  
   162.1 --- a/src/share/vm/memory/allocation.cpp	Wed May 21 10:56:41 2014 -0700
   162.2 +++ b/src/share/vm/memory/allocation.cpp	Fri May 23 14:12:52 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,11 +75,11 @@
  162.11  }
  162.12  
  162.13  bool MetaspaceObj::is_metaspace_object() const {
  162.14 -  return ClassLoaderDataGraph::contains((void*)this);
  162.15 +  return Metaspace::contains((void*)this);
  162.16  }
  162.17  
  162.18  void MetaspaceObj::print_address_on(outputStream* st) const {
  162.19 -  st->print(" {"INTPTR_FORMAT"}", this);
  162.20 +  st->print(" {" INTPTR_FORMAT "}", p2i(this));
  162.21  }
  162.22  
  162.23  void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() {
  162.24 @@ -142,7 +142,7 @@
  162.25  void ResourceObj::set_allocation_type(address res, allocation_type type) {
  162.26      // Set allocation type in the resource object
  162.27      uintptr_t allocation = (uintptr_t)res;
  162.28 -    assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " PTR_FORMAT, res));
  162.29 +    assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res)));
  162.30      assert(type <= allocation_mask, "incorrect allocation type");
  162.31      ResourceObj* resobj = (ResourceObj *)res;
  162.32      resobj->_allocation_t[0] = ~(allocation + type);
  162.33 @@ -179,7 +179,7 @@
  162.34        // Operator new() was called and type was set.
  162.35        assert(!allocated_on_stack(),
  162.36               err_msg("not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
  162.37 -                     this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
  162.38 +                     p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]));
  162.39      } else {
  162.40        // Operator new() was not called.
  162.41        // Assume that it is embedded or stack object.
  162.42 @@ -193,7 +193,7 @@
  162.43      // Note: garbage may resembles valid value.
  162.44      assert(~(_allocation_t[0] | allocation_mask) != (uintptr_t)this || !is_type_set(),
  162.45             err_msg("embedded or stack only, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
  162.46 -                   this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
  162.47 +                   p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]));
  162.48      set_allocation_type((address)this, STACK_OR_EMBEDDED);
  162.49      _allocation_t[1] = 0; // Zap verification value
  162.50  }
  162.51 @@ -202,7 +202,7 @@
  162.52      // Used in InlineTree::ok_to_inline() for WarmCallInfo.
  162.53      assert(allocated_on_stack(),
  162.54             err_msg("copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
  162.55 -                   this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
  162.56 +                   p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]));
  162.57      // Keep current _allocation_t value;
  162.58      return *this;
  162.59  }
  162.60 @@ -218,13 +218,13 @@
  162.61  
  162.62  void trace_heap_malloc(size_t size, const char* name, void* p) {
  162.63    // A lock is not needed here - tty uses a lock internally
  162.64 -  tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p, size, name == NULL ? "" : name);
  162.65 +  tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p2i(p), size, name == NULL ? "" : name);
  162.66  }
  162.67  
  162.68  
  162.69  void trace_heap_free(void* p) {
  162.70    // A lock is not needed here - tty uses a lock internally
  162.71 -  tty->print_cr("Heap free   " INTPTR_FORMAT, p);
  162.72 +  tty->print_cr("Heap free   " INTPTR_FORMAT, p2i(p));
  162.73  }
  162.74  
  162.75  //--------------------------------------------------------------------------------------
  162.76 @@ -723,11 +723,11 @@
  162.77  void AllocatedObj::print_value() const { print_value_on(tty); }
  162.78  
  162.79  void AllocatedObj::print_on(outputStream* st) const {
  162.80 -  st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", this);
  162.81 +  st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", p2i(this));
  162.82  }
  162.83  
  162.84  void AllocatedObj::print_value_on(outputStream* st) const {
  162.85 -  st->print("AllocatedObj(" INTPTR_FORMAT ")", this);
  162.86 +  st->print("AllocatedObj(" INTPTR_FORMAT ")", p2i(this));
  162.87  }
  162.88  
  162.89  julong Arena::_bytes_allocated = 0;
   163.1 --- a/src/share/vm/memory/binaryTreeDictionary.cpp	Wed May 21 10:56:41 2014 -0700
   163.2 +++ b/src/share/vm/memory/binaryTreeDictionary.cpp	Fri May 23 14:12:52 2014 -0700
   163.3 @@ -1,5 +1,5 @@
   163.4  /*
   163.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   163.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   163.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   163.8   *
   163.9   * This code is free software; you can redistribute it and/or modify it
  163.10 @@ -1205,13 +1205,13 @@
  163.11           "------------------------------------\n");
  163.12    size_t total_size = total_chunk_size(debug_only(NULL));
  163.13    size_t    free_blocks = num_free_blocks();
  163.14 -  gclog_or_tty->print("Total Free Space: %d\n", total_size);
  163.15 -  gclog_or_tty->print("Max   Chunk Size: %d\n", max_chunk_size());
  163.16 -  gclog_or_tty->print("Number of Blocks: %d\n", free_blocks);
  163.17 +  gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size);
  163.18 +  gclog_or_tty->print("Max   Chunk Size: " SIZE_FORMAT "\n", max_chunk_size());
  163.19 +  gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks);
  163.20    if (free_blocks > 0) {
  163.21 -    gclog_or_tty->print("Av.  Block  Size: %d\n", total_size/free_blocks);
  163.22 +    gclog_or_tty->print("Av.  Block  Size: " SIZE_FORMAT "\n", total_size/free_blocks);
  163.23    }
  163.24 -  gclog_or_tty->print("Tree      Height: %d\n", tree_height());
  163.25 +  gclog_or_tty->print("Tree      Height: " SIZE_FORMAT "\n", tree_height());
  163.26  }
  163.27  
  163.28  // Print census information - counts, births, deaths, etc.
  163.29 @@ -1318,7 +1318,7 @@
  163.30      for (Chunk_t* fc = fl->head(); fc != NULL;
  163.31           fc = fc->next()) {
  163.32        _st->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ")  %s",
  163.33 -                    fc, (HeapWord*)fc + sz,
  163.34 +                    p2i(fc), p2i((HeapWord*)fc + sz),
  163.35                      fc->cantCoalesce() ? "\t CC" : "");
  163.36      }
  163.37    }
   164.1 --- a/src/share/vm/memory/blockOffsetTable.cpp	Wed May 21 10:56:41 2014 -0700
   164.2 +++ b/src/share/vm/memory/blockOffsetTable.cpp	Fri May 23 14:12:52 2014 -0700
   164.3 @@ -1,5 +1,5 @@
   164.4  /*
   164.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   164.6 + * Copyright (c) 2000, 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 @@ -59,12 +59,12 @@
  164.11                    "  rs.base(): " INTPTR_FORMAT
  164.12                    "  rs.size(): " INTPTR_FORMAT
  164.13                    "  rs end(): " INTPTR_FORMAT,
  164.14 -                  rs.base(), rs.size(), rs.base() + rs.size());
  164.15 +                  p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size()));
  164.16      gclog_or_tty->print_cr("  "
  164.17                    "  _vs.low_boundary(): " INTPTR_FORMAT
  164.18                    "  _vs.high_boundary(): " INTPTR_FORMAT,
  164.19 -                  _vs.low_boundary(),
  164.20 -                  _vs.high_boundary());
  164.21 +                  p2i(_vs.low_boundary()),
  164.22 +                  p2i(_vs.high_boundary()));
  164.23    }
  164.24  }
  164.25  
  164.26 @@ -537,10 +537,10 @@
  164.27      q -= (N_words * n_cards_back);
  164.28      assert(q >= _sp->bottom(),
  164.29             err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
  164.30 -                   q, _sp->bottom()));
  164.31 +                   p2i(q), p2i(_sp->bottom())));
  164.32      assert(q < _sp->end(),
  164.33             err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
  164.34 -                   q, _sp->end()));
  164.35 +                   p2i(q), p2i(_sp->end())));
  164.36      index -= n_cards_back;
  164.37      offset = _array->offset_array(index);
  164.38    }
  164.39 @@ -549,10 +549,10 @@
  164.40    q -= offset;
  164.41    assert(q >= _sp->bottom(),
  164.42           err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
  164.43 -                 q, _sp->bottom()));
  164.44 +                 p2i(q), p2i(_sp->bottom())));
  164.45    assert(q < _sp->end(),
  164.46           err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
  164.47 -                 q, _sp->end()));
  164.48 +                 p2i(q), p2i(_sp->end())));
  164.49    HeapWord* n = q;
  164.50  
  164.51    while (n <= addr) {
  164.52 @@ -563,14 +563,14 @@
  164.53             err_msg("Looping at n = " PTR_FORMAT " with last = " PTR_FORMAT","
  164.54                     " while querying blk_start(" PTR_FORMAT ")"
  164.55                     " on _sp = [" PTR_FORMAT "," PTR_FORMAT ")",
  164.56 -                   n, last, addr, _sp->bottom(), _sp->end()));
  164.57 +                   p2i(n), p2i(last), p2i(addr), p2i(_sp->bottom()), p2i(_sp->end())));
  164.58    }
  164.59    assert(q <= addr,
  164.60           err_msg("wrong order for current (" INTPTR_FORMAT ")" " <= arg (" INTPTR_FORMAT ")",
  164.61 -                 q, addr));
  164.62 +                 p2i(q), p2i(addr)));
  164.63    assert(addr <= n,
  164.64           err_msg("wrong order for arg (" INTPTR_FORMAT ") <= next (" INTPTR_FORMAT ")",
  164.65 -                 addr, n));
  164.66 +                 p2i(addr), p2i(n)));
  164.67    return q;
  164.68  }
  164.69  
   165.1 --- a/src/share/vm/memory/cardTableModRefBS.cpp	Wed May 21 10:56:41 2014 -0700
   165.2 +++ b/src/share/vm/memory/cardTableModRefBS.cpp	Fri May 23 14:12:52 2014 -0700
   165.3 @@ -1,5 +1,5 @@
   165.4  /*
   165.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   165.6 + * Copyright (c) 2000, 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 @@ -138,11 +138,11 @@
  165.11      gclog_or_tty->print_cr("  "
  165.12                    "  &_byte_map[0]: " INTPTR_FORMAT
  165.13                    "  &_byte_map[_last_valid_index]: " INTPTR_FORMAT,
  165.14 -                  &_byte_map[0],
  165.15 -                  &_byte_map[_last_valid_index]);
  165.16 +                  p2i(&_byte_map[0]),
  165.17 +                  p2i(&_byte_map[_last_valid_index]));
  165.18      gclog_or_tty->print_cr("  "
  165.19                    "  byte_map_base: " INTPTR_FORMAT,
  165.20 -                  byte_map_base);
  165.21 +                  p2i(byte_map_base));
  165.22    }
  165.23  }
  165.24  
  165.25 @@ -392,23 +392,23 @@
  165.26      gclog_or_tty->print_cr("  "
  165.27                    "  _covered[%d].start(): " INTPTR_FORMAT
  165.28                    "  _covered[%d].last(): " INTPTR_FORMAT,
  165.29 -                  ind, _covered[ind].start(),
  165.30 -                  ind, _covered[ind].last());
  165.31 +                  ind, p2i(_covered[ind].start()),
  165.32 +                  ind, p2i(_covered[ind].last()));
  165.33      gclog_or_tty->print_cr("  "
  165.34                    "  _committed[%d].start(): " INTPTR_FORMAT
  165.35                    "  _committed[%d].last(): " INTPTR_FORMAT,
  165.36 -                  ind, _committed[ind].start(),
  165.37 -                  ind, _committed[ind].last());
  165.38 +                  ind, p2i(_committed[ind].start()),
  165.39 +                  ind, p2i(_committed[ind].last()));
  165.40      gclog_or_tty->print_cr("  "
  165.41                    "  byte_for(start): " INTPTR_FORMAT
  165.42                    "  byte_for(last): " INTPTR_FORMAT,
  165.43 -                  byte_for(_covered[ind].start()),
  165.44 -                  byte_for(_covered[ind].last()));
  165.45 +                  p2i(byte_for(_covered[ind].start())),
  165.46 +                  p2i(byte_for(_covered[ind].last())));
  165.47      gclog_or_tty->print_cr("  "
  165.48                    "  addr_for(start): " INTPTR_FORMAT
  165.49                    "  addr_for(last): " INTPTR_FORMAT,
  165.50 -                  addr_for((jbyte*) _committed[ind].start()),
  165.51 -                  addr_for((jbyte*) _committed[ind].last()));
  165.52 +                  p2i(addr_for((jbyte*) _committed[ind].start())),
  165.53 +                  p2i(addr_for((jbyte*) _committed[ind].last())));
  165.54    }
  165.55    // Touch the last card of the covered region to show that it
  165.56    // is committed (or SEGV).
  165.57 @@ -657,14 +657,14 @@
  165.58      if (failed) {
  165.59        if (!failures) {
  165.60          tty->cr();
  165.61 -        tty->print_cr("== CT verification failed: ["PTR_FORMAT","PTR_FORMAT"]", start, end);
  165.62 +        tty->print_cr("== CT verification failed: [" INTPTR_FORMAT "," INTPTR_FORMAT "]", p2i(start), p2i(end));
  165.63          tty->print_cr("==   %sexpecting value: %d",
  165.64                        (val_equals) ? "" : "not ", val);
  165.65          failures = true;
  165.66        }
  165.67        tty->print_cr("==   card "PTR_FORMAT" ["PTR_FORMAT","PTR_FORMAT"], "
  165.68 -                    "val: %d", curr, addr_for(curr),
  165.69 -                    (HeapWord*) (((size_t) addr_for(curr)) + card_size),
  165.70 +                    "val: %d", p2i(curr), p2i(addr_for(curr)),
  165.71 +                    p2i((HeapWord*) (((size_t) addr_for(curr)) + card_size)),
  165.72                      (int) curr_val);
  165.73      }
  165.74    }
  165.75 @@ -682,7 +682,7 @@
  165.76  
  165.77  void CardTableModRefBS::print_on(outputStream* st) const {
  165.78    st->print_cr("Card table byte_map: [" INTPTR_FORMAT "," INTPTR_FORMAT "] byte_map_base: " INTPTR_FORMAT,
  165.79 -               _byte_map, _byte_map + _byte_map_size, byte_map_base);
  165.80 +               p2i(_byte_map), p2i(_byte_map + _byte_map_size), p2i(byte_map_base));
  165.81  }
  165.82  
  165.83  bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
   166.1 --- a/src/share/vm/memory/cardTableModRefBS.hpp	Wed May 21 10:56:41 2014 -0700
   166.2 +++ b/src/share/vm/memory/cardTableModRefBS.hpp	Fri May 23 14:12:52 2014 -0700
   166.3 @@ -1,5 +1,5 @@
   166.4  /*
   166.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   166.6 + * Copyright (c) 2000, 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 @@ -155,7 +155,7 @@
  166.11      assert(_whole_heap.contains(p),
  166.12             err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of "
  166.13                     " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")",
  166.14 -                   p, _whole_heap.start(), _whole_heap.end()));
  166.15 +                   p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
  166.16      jbyte* result = &byte_map_base[uintptr_t(p) >> card_shift];
  166.17      assert(result >= _byte_map && result < _byte_map + _byte_map_size,
  166.18             "out of bounds accessor for card marking array");
  166.19 @@ -431,7 +431,7 @@
  166.20      assert(_whole_heap.contains(result),
  166.21             err_msg("Returning result = "PTR_FORMAT" out of bounds of "
  166.22                     " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")",
  166.23 -                   result, _whole_heap.start(), _whole_heap.end()));
  166.24 +                   p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
  166.25      return result;
  166.26    }
  166.27  
  166.28 @@ -440,7 +440,7 @@
  166.29      assert(_whole_heap.contains(p),
  166.30             err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of "
  166.31                     " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")",
  166.32 -                   p, _whole_heap.start(), _whole_heap.end()));
  166.33 +                   p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
  166.34      return byte_for(p) - _byte_map;
  166.35    }
  166.36  
   167.1 --- a/src/share/vm/memory/cardTableRS.cpp	Wed May 21 10:56:41 2014 -0700
   167.2 +++ b/src/share/vm/memory/cardTableRS.cpp	Fri May 23 14:12:52 2014 -0700
   167.3 @@ -1,5 +1,5 @@
   167.4  /*
   167.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   167.6 + * Copyright (c) 2001, 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 @@ -288,14 +288,14 @@
  167.11           err_msg("Did you forget to call save_marks()? "
  167.12                   "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
  167.13                   "[" PTR_FORMAT ", " PTR_FORMAT ")",
  167.14 -                 urasm.start(), urasm.end(), ur.start(), ur.end()));
  167.15 +                 p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end())));
  167.16    // In the case of CMS+ParNew, issue a warning
  167.17    if (!ur.contains(urasm)) {
  167.18      assert(UseConcMarkSweepGC && UseParNewGC, "Tautology: see assert above");
  167.19      warning("CMS+ParNew: Did you forget to call save_marks()? "
  167.20              "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
  167.21              "[" PTR_FORMAT ", " PTR_FORMAT ")",
  167.22 -             urasm.start(), urasm.end(), ur.start(), ur.end());
  167.23 +             p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()));
  167.24      MemRegion ur2 = sp->used_region();
  167.25      MemRegion urasm2 = sp->used_region_at_save_marks();
  167.26      if (!ur.equals(ur2)) {
  167.27 @@ -349,12 +349,12 @@
  167.28      assert(jp >= _begin && jp < _end,
  167.29             err_msg("Error: jp " PTR_FORMAT " should be within "
  167.30                     "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")",
  167.31 -                   jp, _begin, _end));
  167.32 +                   p2i(jp), p2i(_begin), p2i(_end)));
  167.33      oop obj = oopDesc::load_decode_heap_oop(p);
  167.34      guarantee(obj == NULL || (HeapWord*)obj >= _boundary,
  167.35                err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on "
  167.36                        "clean card crosses boundary" PTR_FORMAT,
  167.37 -                      (HeapWord*)obj, jp, _boundary));
  167.38 +                      p2i((HeapWord*)obj), p2i(jp), p2i(_boundary)));
  167.39    }
  167.40  
  167.41  public:
  167.42 @@ -362,10 +362,10 @@
  167.43      _boundary(b), _begin(begin), _end(end) {
  167.44      assert(b <= begin,
  167.45             err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT,
  167.46 -                   b, begin));
  167.47 +                   p2i(b), p2i(begin)));
  167.48      assert(begin <= end,
  167.49             err_msg("Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT,
  167.50 -                   begin, end));
  167.51 +                   p2i(begin), p2i(end)));
  167.52    }
  167.53  
  167.54    virtual void do_oop(oop* p)       { VerifyCleanCardClosure::do_oop_work(p); }
   168.1 --- a/src/share/vm/memory/collectorPolicy.cpp	Wed May 21 10:56:41 2014 -0700
   168.2 +++ b/src/share/vm/memory/collectorPolicy.cpp	Fri May 23 14:12:52 2014 -0700
   168.3 @@ -1,5 +1,5 @@
   168.4  /*
   168.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   168.6 + * Copyright (c) 2001, 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 @@ -769,7 +769,7 @@
  168.11      if ((QueuedAllocationWarningCount > 0) &&
  168.12          (try_count % QueuedAllocationWarningCount == 0)) {
  168.13            warning("TwoGenerationCollectorPolicy::mem_allocate_work retries %d times \n\t"
  168.14 -                  " size=%d %s", try_count, size, is_tlab ? "(TLAB)" : "");
  168.15 +                  " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
  168.16      }
  168.17    }
  168.18  }
  168.19 @@ -938,7 +938,7 @@
  168.20      if ((QueuedAllocationWarningCount > 0) &&
  168.21          (loop_count % QueuedAllocationWarningCount == 0)) {
  168.22        warning("satisfy_failed_metadata_allocation() retries %d times \n\t"
  168.23 -              " size=%d", loop_count, word_size);
  168.24 +              " size=" SIZE_FORMAT, loop_count, word_size);
  168.25      }
  168.26    } while (true);  // Until a GC is done
  168.27  }
   169.1 --- a/src/share/vm/memory/defNewGeneration.cpp	Wed May 21 10:56:41 2014 -0700
   169.2 +++ b/src/share/vm/memory/defNewGeneration.cpp	Fri May 23 14:12:52 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 @@ -46,6 +46,8 @@
  169.11  #include "utilities/copy.hpp"
  169.12  #include "utilities/stack.inline.hpp"
  169.13  
  169.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  169.15 +
  169.16  //
  169.17  // DefNewGeneration functions.
  169.18  
   170.1 --- a/src/share/vm/memory/filemap.cpp	Wed May 21 10:56:41 2014 -0700
   170.2 +++ b/src/share/vm/memory/filemap.cpp	Fri May 23 14:12:52 2014 -0700
   170.3 @@ -1,5 +1,5 @@
   170.4  /*
   170.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   170.6 + * Copyright (c) 2003, 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 @@ -40,6 +40,7 @@
  170.11  #define O_BINARY 0     // otherwise do nothing.
  170.12  #endif
  170.13  
  170.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  170.15  
  170.16  extern address JVM_FunctionAtStart();
  170.17  extern address JVM_FunctionAtEnd();
   171.1 --- a/src/share/vm/memory/gcLocker.cpp	Wed May 21 10:56:41 2014 -0700
   171.2 +++ b/src/share/vm/memory/gcLocker.cpp	Fri May 23 14:12:52 2014 -0700
   171.3 @@ -1,5 +1,5 @@
   171.4  /*
   171.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   171.6 + * Copyright (c) 1997, 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 @@ -51,7 +51,7 @@
  171.11        tty->print_cr("critical counts don't match: %d != %d", _jni_lock_count, count);
  171.12        for (JavaThread* thr = Threads::first(); thr; thr = thr->next()) {
  171.13          if (thr->in_critical()) {
  171.14 -          tty->print_cr(INTPTR_FORMAT " in_critical %d", thr, thr->in_critical());
  171.15 +          tty->print_cr(INTPTR_FORMAT " in_critical %d", p2i(thr), thr->in_critical());
  171.16          }
  171.17        }
  171.18      }
   172.1 --- a/src/share/vm/memory/genCollectedHeap.cpp	Wed May 21 10:56:41 2014 -0700
   172.2 +++ b/src/share/vm/memory/genCollectedHeap.cpp	Fri May 23 14:12:52 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 @@ -809,7 +809,7 @@
  172.11  bool GenCollectedHeap::is_in_young(oop p) {
  172.12    bool result = ((HeapWord*)p) < _gens[_n_gens - 1]->reserved().start();
  172.13    assert(result == _gens[0]->is_in_reserved(p),
  172.14 -         err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p));
  172.15 +         err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p)));
  172.16    return result;
  172.17  }
  172.18  
  172.19 @@ -1088,7 +1088,7 @@
  172.20    for (int i = _n_gens-1; i >= 0; i--) {
  172.21      Generation* g = _gens[i];
  172.22      if (!silent) {
  172.23 -      gclog_or_tty->print(g->name());
  172.24 +      gclog_or_tty->print("%s", g->name());
  172.25        gclog_or_tty->print(" ");
  172.26      }
  172.27      g->verify();
  172.28 @@ -1291,7 +1291,7 @@
  172.29    // back a time later than 'now'.
  172.30    jlong retVal = now - tolgc_cl.time();
  172.31    if (retVal < 0) {
  172.32 -    NOT_PRODUCT(warning("time warp: "INT64_FORMAT, retVal);)
  172.33 +    NOT_PRODUCT(warning("time warp: "INT64_FORMAT, (int64_t) retVal);)
  172.34      return 0;
  172.35    }
  172.36    return retVal;
   173.1 --- a/src/share/vm/memory/genOopClosures.hpp	Wed May 21 10:56:41 2014 -0700
   173.2 +++ b/src/share/vm/memory/genOopClosures.hpp	Fri May 23 14:12:52 2014 -0700
   173.3 @@ -1,5 +1,5 @@
   173.4  /*
   173.5 - * Copyright (c) 2001, 2012, 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 @@ -199,7 +199,7 @@
  173.11   protected:
  173.12    template <class T> inline void do_oop_work(T* p) {
  173.13      oop obj = oopDesc::load_decode_heap_oop(p);
  173.14 -    guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, (oopDesc*) obj));
  173.15 +    guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
  173.16    }
  173.17   public:
  173.18    virtual void do_oop(oop* p);
   174.1 --- a/src/share/vm/memory/generation.cpp	Wed May 21 10:56:41 2014 -0700
   174.2 +++ b/src/share/vm/memory/generation.cpp	Fri May 23 14:12:52 2014 -0700
   174.3 @@ -1,5 +1,5 @@
   174.4  /*
   174.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   174.6 + * Copyright (c) 1997, 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 @@ -43,6 +43,8 @@
  174.11  #include "utilities/copy.hpp"
  174.12  #include "utilities/events.hpp"
  174.13  
  174.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  174.15 +
  174.16  Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
  174.17    _level(level),
  174.18    _ref_processor(NULL) {
   175.1 --- a/src/share/vm/memory/generation.hpp	Wed May 21 10:56:41 2014 -0700
   175.2 +++ b/src/share/vm/memory/generation.hpp	Fri May 23 14:12:52 2014 -0700
   175.3 @@ -1,5 +1,5 @@
   175.4  /*
   175.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   175.6 + * Copyright (c) 1997, 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 @@ -422,7 +422,7 @@
  175.11      // have to guard against non-monotonicity.
  175.12      NOT_PRODUCT(
  175.13        if (now < _time_of_last_gc) {
  175.14 -        warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, _time_of_last_gc, now);
  175.15 +        warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, (int64_t)_time_of_last_gc, (int64_t)now);
  175.16        }
  175.17      )
  175.18      return _time_of_last_gc;
   176.1 --- a/src/share/vm/memory/heapInspection.cpp	Wed May 21 10:56:41 2014 -0700
   176.2 +++ b/src/share/vm/memory/heapInspection.cpp	Fri May 23 14:12:52 2014 -0700
   176.3 @@ -1,5 +1,5 @@
   176.4  /*
   176.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   176.6 + * Copyright (c) 2002, 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 @@ -35,6 +35,8 @@
  176.11  #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
  176.12  #endif // INCLUDE_ALL_GCS
  176.13  
  176.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  176.15 +
  176.16  // HeapInspection
  176.17  
  176.18  int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) {
  176.19 @@ -270,6 +272,7 @@
  176.20    return true;
  176.21  }
  176.22  
  176.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  176.24  void KlassInfoHisto::print_title(outputStream* st, bool csv_format,
  176.25                                   bool selected[], int width_table[],
  176.26                                   const char *name_table[]) {
  176.27 @@ -282,7 +285,10 @@
  176.28    } else {
  176.29      st->print("Index Super");
  176.30      for (int c=0; c<KlassSizeStats::_num_columns; c++) {
  176.31 +PRAGMA_DIAG_PUSH
  176.32 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  176.33        if (selected[c]) {st->print(str_fmt(width_table[c]), name_table[c]);}
  176.34 +PRAGMA_DIAG_POP
  176.35      }
  176.36      st->print(" ClassName");
  176.37    }
  176.38 @@ -395,12 +401,18 @@
  176.39            case KlassSizeStats::_index_inst_size:
  176.40            case KlassSizeStats::_index_inst_count:
  176.41            case KlassSizeStats::_index_method_count:
  176.42 +PRAGMA_DIAG_PUSH
  176.43 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  176.44              st->print(str_fmt(width_table[c]), "-");
  176.45 +PRAGMA_DIAG_POP
  176.46              break;
  176.47            default:
  176.48              {
  176.49                double perc = (double)(100) * (double)(colsum_table[c]) / (double)sz_sum._total_bytes;
  176.50 +PRAGMA_DIAG_PUSH
  176.51 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  176.52                st->print(perc_fmt(width_table[c]), perc);
  176.53 +PRAGMA_DIAG_POP
  176.54              }
  176.55            }
  176.56          }
   177.1 --- a/src/share/vm/memory/heapInspection.hpp	Wed May 21 10:56:41 2014 -0700
   177.2 +++ b/src/share/vm/memory/heapInspection.hpp	Fri May 23 14:12:52 2014 -0700
   177.3 @@ -1,5 +1,5 @@
   177.4  /*
   177.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   177.6 + * Copyright (c) 2002, 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 @@ -295,6 +295,9 @@
  177.11    // returns a format string to print a julong with the given width. E.g,
  177.12    // printf(num_fmt(6), julong(10)) would print out the number 10 with 4
  177.13    // leading spaces.
  177.14 +PRAGMA_DIAG_PUSH
  177.15 +PRAGMA_FORMAT_NONLITERAL_IGNORED
  177.16 +
  177.17    static void print_julong(outputStream* st, int width, julong n) {
  177.18      int num_spaces = width - julong_width(n);
  177.19      if (num_spaces > 0) {
  177.20 @@ -302,6 +305,7 @@
  177.21      }
  177.22      st->print(JULONG_FORMAT, n);
  177.23    }
  177.24 +PRAGMA_DIAG_POP
  177.25  
  177.26    static char* perc_fmt(int width) {
  177.27      static char buf[32];
   178.1 --- a/src/share/vm/memory/metachunk.cpp	Wed May 21 10:56:41 2014 -0700
   178.2 +++ b/src/share/vm/memory/metachunk.cpp	Fri May 23 14:12:52 2014 -0700
   178.3 @@ -1,5 +1,5 @@
   178.4  /*
   178.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   178.6 + * Copyright (c) 2012, 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 @@ -28,6 +28,8 @@
  178.11  #include "utilities/copy.hpp"
  178.12  #include "utilities/debug.hpp"
  178.13  
  178.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  178.15 +
  178.16  class VirtualSpaceNode;
  178.17  
  178.18  const size_t metadata_chunk_initialize = 0xf7f7f7f7;
   179.1 --- a/src/share/vm/memory/metaspace.cpp	Wed May 21 10:56:41 2014 -0700
   179.2 +++ b/src/share/vm/memory/metaspace.cpp	Fri May 23 14:12:52 2014 -0700
   179.3 @@ -1,5 +1,5 @@
   179.4  /*
   179.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
   179.6 + * Copyright (c) 2011, 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 @@ -48,6 +48,8 @@
  179.11  #include "utilities/copy.hpp"
  179.12  #include "utilities/debug.hpp"
  179.13  
  179.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  179.15 +
  179.16  typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > BlockTreeDictionary;
  179.17  typedef BinaryTreeDictionary<Metachunk, FreeList<Metachunk> > ChunkTreeDictionary;
  179.18  
  179.19 @@ -314,6 +316,8 @@
  179.20    MetaWord* bottom() const { return (MetaWord*) _virtual_space.low(); }
  179.21    MetaWord* end() const { return (MetaWord*) _virtual_space.high(); }
  179.22  
  179.23 +  bool contains(const void* ptr) { return ptr >= low() && ptr < high(); }
  179.24 +
  179.25    size_t reserved_words() const  { return _virtual_space.reserved_size() / BytesPerWord; }
  179.26    size_t committed_words() const { return _virtual_space.actual_committed_size() / BytesPerWord; }
  179.27  
  179.28 @@ -555,6 +559,8 @@
  179.29    void inc_virtual_space_count();
  179.30    void dec_virtual_space_count();
  179.31  
  179.32 +  bool contains(const void* ptr);
  179.33 +
  179.34    // Unlink empty VirtualSpaceNodes and free it.
  179.35    void purge(ChunkManager* chunk_manager);
  179.36  
  179.37 @@ -639,8 +645,6 @@
  179.38    // Accessors
  179.39    Metachunk* chunks_in_use(ChunkIndex index) const { return _chunks_in_use[index]; }
  179.40    void set_chunks_in_use(ChunkIndex index, Metachunk* v) {
  179.41 -    // ensure lock-free iteration sees fully initialized node
  179.42 -    OrderAccess::storestore();
  179.43      _chunks_in_use[index] = v;
  179.44    }
  179.45  
  179.46 @@ -755,8 +759,6 @@
  179.47    void print_on(outputStream* st) const;
  179.48    void locked_print_chunks_in_use_on(outputStream* st) const;
  179.49  
  179.50 -  bool contains(const void *ptr);
  179.51 -
  179.52    void verify();
  179.53    void verify_chunk_size(Metachunk* chunk);
  179.54    NOT_PRODUCT(void mangle_freed_chunks();)
  179.55 @@ -1076,6 +1078,7 @@
  179.56  // nodes with a 0 container_count.  Remove Metachunks in
  179.57  // the node from their respective freelists.
  179.58  void VirtualSpaceList::purge(ChunkManager* chunk_manager) {
  179.59 +  assert(SafepointSynchronize::is_at_safepoint(), "must be called at safepoint for contains to work");
  179.60    assert_lock_strong(SpaceManager::expand_lock());
  179.61    // Don't use a VirtualSpaceListIterator because this
  179.62    // list is being changed and a straightforward use of an iterator is not safe.
  179.63 @@ -1109,8 +1112,8 @@
  179.64    }
  179.65  #ifdef ASSERT
  179.66    if (purged_vsl != NULL) {
  179.67 -  // List should be stable enough to use an iterator here.
  179.68 -  VirtualSpaceListIterator iter(virtual_space_list());
  179.69 +    // List should be stable enough to use an iterator here.
  179.70 +    VirtualSpaceListIterator iter(virtual_space_list());
  179.71      while (iter.repeat()) {
  179.72        VirtualSpaceNode* vsl = iter.get_next();
  179.73        assert(vsl != purged_vsl, "Purge of vsl failed");
  179.74 @@ -1119,6 +1122,23 @@
  179.75  #endif
  179.76  }
  179.77  
  179.78 +
  179.79 +// This function looks at the mmap regions in the metaspace without locking.
  179.80 +// The chunks are added with store ordering and not deleted except for at
  179.81 +// unloading time during a safepoint.
  179.82 +bool VirtualSpaceList::contains(const void* ptr) {
  179.83 +  // List should be stable enough to use an iterator here because removing virtual
  179.84 +  // space nodes is only allowed at a safepoint.
  179.85 +  VirtualSpaceListIterator iter(virtual_space_list());
  179.86 +  while (iter.repeat()) {
  179.87 +    VirtualSpaceNode* vsn = iter.get_next();
  179.88 +    if (vsn->contains(ptr)) {
  179.89 +      return true;
  179.90 +    }
  179.91 +  }
  179.92 +  return false;
  179.93 +}
  179.94 +
  179.95  void VirtualSpaceList::retire_current_virtual_space() {
  179.96    assert_lock_strong(SpaceManager::expand_lock());
  179.97  
  179.98 @@ -1208,6 +1228,8 @@
  179.99    } else {
 179.100      assert(new_entry->reserved_words() == vs_word_size,
 179.101          "Reserved memory size differs from requested memory size");
 179.102 +    // ensure lock-free iteration sees fully initialized node
 179.103 +    OrderAccess::storestore();
 179.104      link_vs(new_entry);
 179.105      return true;
 179.106    }
 179.107 @@ -1960,7 +1982,7 @@
 179.108        st->print_cr(" free " SIZE_FORMAT,
 179.109                     chunk->free_word_size());
 179.110      } else {
 179.111 -      st->print_cr("");
 179.112 +      st->cr();
 179.113      }
 179.114    }
 179.115  
 179.116 @@ -2244,7 +2266,7 @@
 179.117      humongous_chunks = next_humongous_chunks;
 179.118    }
 179.119    if (TraceMetadataChunkAllocation && Verbose) {
 179.120 -    gclog_or_tty->print_cr("");
 179.121 +    gclog_or_tty->cr();
 179.122      gclog_or_tty->print_cr("updated dictionary count %d %s",
 179.123                       chunk_manager()->humongous_dictionary()->total_count(),
 179.124                       chunk_size_name(HumongousIndex));
 179.125 @@ -2431,21 +2453,6 @@
 179.126    return result;
 179.127  }
 179.128  
 179.129 -// This function looks at the chunks in the metaspace without locking.
 179.130 -// The chunks are added with store ordering and not deleted except for at
 179.131 -// unloading time.
 179.132 -bool SpaceManager::contains(const void *ptr) {
 179.133 -  for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i))
 179.134 -  {
 179.135 -    Metachunk* curr = chunks_in_use(i);
 179.136 -    while (curr != NULL) {
 179.137 -      if (curr->contains(ptr)) return true;
 179.138 -      curr = curr->next();
 179.139 -    }
 179.140 -  }
 179.141 -  return false;
 179.142 -}
 179.143 -
 179.144  void SpaceManager::verify() {
 179.145    // If there are blocks in the dictionary, then
 179.146    // verfication of chunks does not work since
 179.147 @@ -3550,11 +3557,15 @@
 179.148  }
 179.149  
 179.150  bool Metaspace::contains(const void* ptr) {
 179.151 -  if (vsm()->contains(ptr)) return true;
 179.152 -  if (using_class_space()) {
 179.153 -    return class_vsm()->contains(ptr);
 179.154 +  if (UseSharedSpaces && MetaspaceShared::is_in_shared_space(ptr)) {
 179.155 +    return true;
 179.156    }
 179.157 -  return false;
 179.158 +
 179.159 +  if (using_class_space() && get_space_list(ClassType)->contains(ptr)) {
 179.160 +     return true;
 179.161 +  }
 179.162 +
 179.163 +  return get_space_list(NonClassType)->contains(ptr);
 179.164  }
 179.165  
 179.166  void Metaspace::verify() {
 179.167 @@ -3799,5 +3810,4 @@
 179.168    TestVirtualSpaceNodeTest::test();
 179.169    TestVirtualSpaceNodeTest::test_is_available();
 179.170  }
 179.171 -
 179.172  #endif
   180.1 --- a/src/share/vm/memory/metaspace.hpp	Wed May 21 10:56:41 2014 -0700
   180.2 +++ b/src/share/vm/memory/metaspace.hpp	Fri May 23 14:12:52 2014 -0700
   180.3 @@ -1,5 +1,5 @@
   180.4  /*
   180.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
   180.6 + * Copyright (c) 2011, 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 @@ -232,7 +232,8 @@
  180.11    MetaWord* expand_and_allocate(size_t size,
  180.12                                  MetadataType mdtype);
  180.13  
  180.14 -  bool contains(const void* ptr);
  180.15 +  static bool contains(const void* ptr);
  180.16 +
  180.17    void dump(outputStream* const out) const;
  180.18  
  180.19    // Free empty virtualspaces
   181.1 --- a/src/share/vm/memory/metaspaceShared.cpp	Wed May 21 10:56:41 2014 -0700
   181.2 +++ b/src/share/vm/memory/metaspaceShared.cpp	Fri May 23 14:12:52 2014 -0700
   181.3 @@ -1,5 +1,5 @@
   181.4  /*
   181.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   181.6 + * Copyright (c) 2012, 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 @@ -40,6 +40,7 @@
  181.11  #include "runtime/vmThread.hpp"
  181.12  #include "utilities/hashtable.inline.hpp"
  181.13  
  181.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  181.15  
  181.16  int MetaspaceShared::_max_alignment = 0;
  181.17  
  181.18 @@ -337,13 +338,14 @@
  181.19    int all_rw_count = 0;
  181.20    int all_rw_bytes = 0;
  181.21  
  181.22 -  const char *fmt = "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f";
  181.23 +// To make fmt_stats be a syntactic constant (for format warnings), use #define.
  181.24 +#define fmt_stats "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f"
  181.25    const char *sep = "--------------------+---------------------------+---------------------------+--------------------------";
  181.26    const char *hdr = "                        ro_cnt   ro_bytes     % |   rw_cnt   rw_bytes     % |  all_cnt  all_bytes     %";
  181.27  
  181.28    tty->print_cr("Detailed metadata info (rw includes md and mc):");
  181.29 -  tty->print_cr(hdr);
  181.30 -  tty->print_cr(sep);
  181.31 +  tty->print_cr("%s", hdr);
  181.32 +  tty->print_cr("%s", sep);
  181.33    for (int type = 0; type < int(_number_of_types); type ++) {
  181.34      const char *name = type_name((Type)type);
  181.35      int ro_count = _counts[RO][type];
  181.36 @@ -357,7 +359,7 @@
  181.37      double rw_perc = 100.0 * double(rw_bytes) / double(rw_all);
  181.38      double perc    = 100.0 * double(bytes)    / double(ro_all + rw_all);
  181.39  
  181.40 -    tty->print_cr(fmt, name,
  181.41 +    tty->print_cr(fmt_stats, name,
  181.42                    ro_count, ro_bytes, ro_perc,
  181.43                    rw_count, rw_bytes, rw_perc,
  181.44                    count, bytes, perc);
  181.45 @@ -375,14 +377,15 @@
  181.46    double all_rw_perc = 100.0 * double(all_rw_bytes) / double(rw_all);
  181.47    double all_perc    = 100.0 * double(all_bytes)    / double(ro_all + rw_all);
  181.48  
  181.49 -  tty->print_cr(sep);
  181.50 -  tty->print_cr(fmt, "Total",
  181.51 +  tty->print_cr("%s", sep);
  181.52 +  tty->print_cr(fmt_stats, "Total",
  181.53                  all_ro_count, all_ro_bytes, all_ro_perc,
  181.54                  all_rw_count, all_rw_bytes, all_rw_perc,
  181.55                  all_count, all_bytes, all_perc);
  181.56  
  181.57    assert(all_ro_bytes == ro_all, "everything should have been counted");
  181.58    assert(all_rw_bytes == rw_all, "everything should have been counted");
  181.59 +#undef fmt_stats
  181.60  }
  181.61  
  181.62  // Populate the shared space.
  181.63 @@ -514,7 +517,8 @@
  181.64    md_top = wc.get_top();
  181.65  
  181.66    // Print shared spaces all the time
  181.67 -  const char* fmt = "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT;
  181.68 +// To make fmt_space be a syntactic constant (for format warnings), use #define.
  181.69 +#define fmt_space "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT
  181.70    Metaspace* ro_space = _loader_data->ro_metaspace();
  181.71    Metaspace* rw_space = _loader_data->rw_metaspace();
  181.72  
  181.73 @@ -545,10 +549,10 @@
  181.74    const double mc_u_perc = mc_bytes / double(mc_alloced) * 100.0;
  181.75    const double total_u_perc = total_bytes / double(total_alloced) * 100.0;
  181.76  
  181.77 -  tty->print_cr(fmt, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, ro_space->bottom());
  181.78 -  tty->print_cr(fmt, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, rw_space->bottom());
  181.79 -  tty->print_cr(fmt, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, md_low);
  181.80 -  tty->print_cr(fmt, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, mc_low);
  181.81 +  tty->print_cr(fmt_space, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, ro_space->bottom());
  181.82 +  tty->print_cr(fmt_space, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, rw_space->bottom());
  181.83 +  tty->print_cr(fmt_space, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, md_low);
  181.84 +  tty->print_cr(fmt_space, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, mc_low);
  181.85    tty->print_cr("total   : %9d [100.0%% of total] out of %9d bytes [%4.1f%% used]",
  181.86                   total_bytes, total_alloced, total_u_perc);
  181.87  
  181.88 @@ -603,6 +607,7 @@
  181.89  
  181.90      dac.dump_stats(int(ro_bytes), int(rw_bytes), int(md_bytes), int(mc_bytes));
  181.91    }
  181.92 +#undef fmt_space
  181.93  }
  181.94  
  181.95  static void link_shared_classes(Klass* obj, TRAPS) {
   182.1 --- a/src/share/vm/memory/referenceProcessor.cpp	Wed May 21 10:56:41 2014 -0700
   182.2 +++ b/src/share/vm/memory/referenceProcessor.cpp	Fri May 23 14:12:52 2014 -0700
   182.3 @@ -1,5 +1,5 @@
   182.4  /*
   182.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   182.6 + * Copyright (c) 2001, 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 "runtime/java.hpp"
  182.12  #include "runtime/jniHandles.hpp"
  182.13  
  182.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  182.15 +
  182.16  ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL;
  182.17  ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy      = NULL;
  182.18  bool             ReferenceProcessor::_pending_list_uses_discovered_field = false;
   183.1 --- a/src/share/vm/memory/sharedHeap.cpp	Wed May 21 10:56:41 2014 -0700
   183.2 +++ b/src/share/vm/memory/sharedHeap.cpp	Fri May 23 14:12:52 2014 -0700
   183.3 @@ -1,5 +1,5 @@
   183.4  /*
   183.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   183.6 + * Copyright (c) 2000, 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 @@ -35,6 +35,8 @@
  183.11  #include "utilities/copy.hpp"
  183.12  #include "utilities/workgroup.hpp"
  183.13  
  183.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  183.15 +
  183.16  SharedHeap* SharedHeap::_sh;
  183.17  
  183.18  // The set of potentially parallel tasks in strong root scanning.
   184.1 --- a/src/share/vm/memory/space.cpp	Wed May 21 10:56:41 2014 -0700
   184.2 +++ b/src/share/vm/memory/space.cpp	Fri May 23 14:12:52 2014 -0700
   184.3 @@ -1,5 +1,5 @@
   184.4  /*
   184.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   184.6 + * Copyright (c) 1997, 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 @@ -45,6 +45,8 @@
  184.11  void SpaceMemRegionOopsIterClosure::do_oop(oop* p)       { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
  184.12  void SpaceMemRegionOopsIterClosure::do_oop(narrowOop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
  184.13  
  184.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  184.15 +
  184.16  HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
  184.17                                                  HeapWord* top_obj) {
  184.18    if (top_obj != NULL) {
   185.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.cpp	Wed May 21 10:56:41 2014 -0700
   185.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp	Fri May 23 14:12:52 2014 -0700
   185.3 @@ -1,5 +1,5 @@
   185.4  /*
   185.5 - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
   185.6 + * Copyright (c) 1999, 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 @@ -31,6 +31,8 @@
  185.11  #include "runtime/thread.inline.hpp"
  185.12  #include "utilities/copy.hpp"
  185.13  
  185.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  185.15 +
  185.16  // Thread-Local Edens support
  185.17  
  185.18  // static member initialization
   186.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Wed May 21 10:56:41 2014 -0700
   186.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Fri May 23 14:12:52 2014 -0700
   186.3 @@ -1,5 +1,5 @@
   186.4  /*
   186.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   186.6 + * Copyright (c) 1999, 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 @@ -98,7 +98,7 @@
  186.11                          " obj: "SIZE_FORMAT
  186.12                          " free: "SIZE_FORMAT
  186.13                          " waste: "SIZE_FORMAT"\n",
  186.14 -                        "slow", thrd, thrd->osthread()->thread_id(),
  186.15 +                        "slow", p2i(thrd), thrd->osthread()->thread_id(),
  186.16                          obj_size, free(), refill_waste_limit());
  186.17    }
  186.18  }
   187.1 --- a/src/share/vm/memory/universe.cpp	Wed May 21 10:56:41 2014 -0700
   187.2 +++ b/src/share/vm/memory/universe.cpp	Fri May 23 14:12:52 2014 -0700
   187.3 @@ -1,5 +1,5 @@
   187.4  /*
   187.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   187.6 + * Copyright (c) 1997, 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 @@ -78,6 +78,8 @@
  187.11  #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
  187.12  #endif // INCLUDE_ALL_GCS
  187.13  
  187.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  187.15 +
  187.16  // Known objects
  187.17  Klass* Universe::_boolArrayKlassObj                 = NULL;
  187.18  Klass* Universe::_byteArrayKlassObj                 = NULL;
  187.19 @@ -1348,7 +1350,7 @@
  187.20    HandleMark hm;  // Handles created during verification can be zapped
  187.21    _verify_count++;
  187.22  
  187.23 -  if (!silent) gclog_or_tty->print(prefix);
  187.24 +  if (!silent) gclog_or_tty->print("%s", prefix);
  187.25    if (!silent) gclog_or_tty->print("[Verifying ");
  187.26    if (!silent) gclog_or_tty->print("threads ");
  187.27    Threads::verify();
   188.1 --- a/src/share/vm/oops/annotations.cpp	Wed May 21 10:56:41 2014 -0700
   188.2 +++ b/src/share/vm/oops/annotations.cpp	Fri May 23 14:12:52 2014 -0700
   188.3 @@ -1,5 +1,5 @@
   188.4  /*
   188.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   188.6 + * Copyright (c) 2012, 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 @@ -76,7 +76,7 @@
  188.11  
  188.12  
  188.13  void Annotations::print_value_on(outputStream* st) const {
  188.14 -  st->print("Anotations(" INTPTR_FORMAT ")", this);
  188.15 +  st->print("Anotations(" INTPTR_FORMAT ")", p2i(this));
  188.16  }
  188.17  
  188.18  #if INCLUDE_SERVICES
   189.1 --- a/src/share/vm/oops/constMethod.cpp	Wed May 21 10:56:41 2014 -0700
   189.2 +++ b/src/share/vm/oops/constMethod.cpp	Fri May 23 14:12:52 2014 -0700
   189.3 @@ -1,5 +1,5 @@
   189.4  /*
   189.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   189.6 + * Copyright (c) 2003, 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 @@ -388,8 +388,8 @@
  189.11  void ConstMethod::print_on(outputStream* st) const {
  189.12    ResourceMark rm;
  189.13    assert(is_constMethod(), "must be constMethod");
  189.14 -  st->print_cr(internal_name());
  189.15 -  st->print(" - method:       " INTPTR_FORMAT " ", (address)method());
  189.16 +  st->print_cr("%s", internal_name());
  189.17 +  st->print(" - method:       " INTPTR_FORMAT " ", p2i((address)method()));
  189.18    method()->print_value_on(st); st->cr();
  189.19    if (has_stackmap_table()) {
  189.20      st->print(" - stackmap data:       ");
   190.1 --- a/src/share/vm/oops/constantPool.cpp	Wed May 21 10:56:41 2014 -0700
   190.2 +++ b/src/share/vm/oops/constantPool.cpp	Fri May 23 14:12:52 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 @@ -42,6 +42,8 @@
  190.11  #include "runtime/signature.hpp"
  190.12  #include "runtime/vframe.hpp"
  190.13  
  190.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  190.15 +
  190.16  ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
  190.17    // Tags are RW but comment below applies to tags also.
  190.18    Array<u1>* tags = MetadataFactory::new_writeable_array<u1>(loader_data, length, 0, CHECK_NULL);
  190.19 @@ -1884,7 +1886,7 @@
  190.20  void ConstantPool::print_on(outputStream* st) const {
  190.21    EXCEPTION_MARK;
  190.22    assert(is_constantPool(), "must be constantPool");
  190.23 -  st->print_cr(internal_name());
  190.24 +  st->print_cr("%s", internal_name());
  190.25    if (flags() != 0) {
  190.26      st->print(" - flags: 0x%x", flags());
  190.27      if (has_preresolution()) st->print(" has_preresolution");
   191.1 --- a/src/share/vm/oops/cpCache.cpp	Wed May 21 10:56:41 2014 -0700
   191.2 +++ b/src/share/vm/oops/cpCache.cpp	Fri May 23 14:12:52 2014 -0700
   191.3 @@ -1,5 +1,5 @@
   191.4  /*
   191.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   191.6 + * Copyright (c) 1998, 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 @@ -38,8 +38,9 @@
  191.11  # include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
  191.12  #endif // INCLUDE_ALL_GCS
  191.13  
  191.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  191.15  
  191.16 -// Implememtation of ConstantPoolCacheEntry
  191.17 +// Implementation of ConstantPoolCacheEntry
  191.18  
  191.19  void ConstantPoolCacheEntry::initialize_entry(int index) {
  191.20    assert(0 < index && index < 0x10000, "sanity check");
  191.21 @@ -667,7 +668,7 @@
  191.22  
  191.23  void ConstantPoolCache::print_on(outputStream* st) const {
  191.24    assert(is_constantPoolCache(), "obj must be constant pool cache");
  191.25 -  st->print_cr(internal_name());
  191.26 +  st->print_cr("%s", internal_name());
  191.27    // print constant pool cache entries
  191.28    for (int i = 0; i < length(); i++) entry_at(i)->print(st, i);
  191.29  }
   192.1 --- a/src/share/vm/oops/generateOopMap.hpp	Wed May 21 10:56:41 2014 -0700
   192.2 +++ b/src/share/vm/oops/generateOopMap.hpp	Fri May 23 14:12:52 2014 -0700
   192.3 @@ -1,5 +1,5 @@
   192.4  /*
   192.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   192.6 + * Copyright (c) 1997, 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 @@ -412,9 +412,9 @@
  192.11    int copy_cts                              (CellTypeState *dst, CellTypeState *src);
  192.12  
  192.13    // Error handling
  192.14 -  void  error_work                          (const char *format, va_list ap);
  192.15 -  void  report_error                        (const char *format, ...);
  192.16 -  void  verify_error                        (const char *format, ...);
  192.17 +  void  error_work                          (const char *format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
  192.18 +  void  report_error                        (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
  192.19 +  void  verify_error                        (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
  192.20    bool  got_error()                         { return _got_error; }
  192.21  
  192.22    // Create result set
   193.1 --- a/src/share/vm/oops/instanceKlass.cpp	Wed May 21 10:56:41 2014 -0700
   193.2 +++ b/src/share/vm/oops/instanceKlass.cpp	Fri May 23 14:12:52 2014 -0700
   193.3 @@ -75,6 +75,8 @@
   193.4  #include "c1/c1_Compiler.hpp"
   193.5  #endif
   193.6  
   193.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   193.8 +
   193.9  #ifdef DTRACE_ENABLED
  193.10  
  193.11  #ifndef USDT2
  193.12 @@ -2895,7 +2897,7 @@
  193.13    st->print(BULLET"instance size:     %d", size_helper());                        st->cr();
  193.14    st->print(BULLET"klass size:        %d", size());                               st->cr();
  193.15    st->print(BULLET"access:            "); access_flags().print_on(st);            st->cr();
  193.16 -  st->print(BULLET"state:             "); st->print_cr(state_names[_init_state]);
  193.17 +  st->print(BULLET"state:             "); st->print_cr("%s", state_names[_init_state]);
  193.18    st->print(BULLET"name:              "); name()->print_value_on(st);             st->cr();
  193.19    st->print(BULLET"super:             "); super()->print_value_on_maybe_null(st); st->cr();
  193.20    st->print(BULLET"sub:               ");
   194.1 --- a/src/share/vm/oops/instanceRefKlass.cpp	Wed May 21 10:56:41 2014 -0700
   194.2 +++ b/src/share/vm/oops/instanceRefKlass.cpp	Fri May 23 14:12:52 2014 -0700
   194.3 @@ -1,5 +1,5 @@
   194.4  /*
   194.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   194.6 + * Copyright (c) 1997, 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 @@ -45,6 +45,8 @@
  194.11  #include "oops/oop.pcgc.inline.hpp"
  194.12  #endif // INCLUDE_ALL_GCS
  194.13  
  194.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  194.15 +
  194.16  template <class T>
  194.17  void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
  194.18    T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
   195.1 --- a/src/share/vm/oops/klass.cpp	Wed May 21 10:56:41 2014 -0700
   195.2 +++ b/src/share/vm/oops/klass.cpp	Fri May 23 14:12:52 2014 -0700
   195.3 @@ -648,7 +648,7 @@
   195.4  
   195.5    // This can be expensive, but it is worth checking that this klass is actually
   195.6    // in the CLD graph but not in production.
   195.7 -  assert(ClassLoaderDataGraph::contains((address)this), "Should be");
   195.8 +  assert(Metaspace::contains((address)this), "Should be");
   195.9  
  195.10    guarantee(this->is_klass(),"should be klass");
  195.11  
   196.1 --- a/src/share/vm/oops/klass.inline.hpp	Wed May 21 10:56:41 2014 -0700
   196.2 +++ b/src/share/vm/oops/klass.inline.hpp	Fri May 23 14:12:52 2014 -0700
   196.3 @@ -1,5 +1,5 @@
   196.4  /*
   196.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   196.6 + * Copyright (c) 2005, 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 @@ -63,7 +63,7 @@
  196.11    assert(!is_null(v), "narrow klass value can never be zero");
  196.12    int    shift = Universe::narrow_klass_shift();
  196.13    Klass* result = (Klass*)(void*)((uintptr_t)Universe::narrow_klass_base() + ((uintptr_t)v << shift));
  196.14 -  assert(check_klass_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result));
  196.15 +  assert(check_klass_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result)));
  196.16    return result;
  196.17  }
  196.18  
   197.1 --- a/src/share/vm/oops/klassVtable.cpp	Wed May 21 10:56:41 2014 -0700
   197.2 +++ b/src/share/vm/oops/klassVtable.cpp	Fri May 23 14:12:52 2014 -0700
   197.3 @@ -39,6 +39,8 @@
   197.4  #include "runtime/handles.inline.hpp"
   197.5  #include "utilities/copy.hpp"
   197.6  
   197.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   197.8 +
   197.9  inline InstanceKlass* klassVtable::ik() const {
  197.10    Klass* k = _klass();
  197.11    assert(k->oop_is_instance(), "not an InstanceKlass");
   198.1 --- a/src/share/vm/oops/markOop.cpp	Wed May 21 10:56:41 2014 -0700
   198.2 +++ b/src/share/vm/oops/markOop.cpp	Fri May 23 14:12:52 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 @@ -26,9 +26,11 @@
  198.11  #include "oops/markOop.hpp"
  198.12  #include "runtime/thread.inline.hpp"
  198.13  
  198.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  198.15 +
  198.16  void markOopDesc::print_on(outputStream* st) const {
  198.17    if (is_locked()) {
  198.18 -    st->print("locked(0x%lx)->", value());
  198.19 +    st->print("locked(" INTPTR_FORMAT ")->", value());
  198.20      markOop(*(markOop*)value())->print_on(st);
  198.21    } else {
  198.22      assert(is_unlocked() || has_bias_pattern(), "just checking");
   199.1 --- a/src/share/vm/oops/method.cpp	Wed May 21 10:56:41 2014 -0700
   199.2 +++ b/src/share/vm/oops/method.cpp	Fri May 23 14:12:52 2014 -0700
   199.3 @@ -1,5 +1,5 @@
   199.4  /*
   199.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   199.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   199.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   199.8   *
   199.9   * This code is free software; you can redistribute it and/or modify it
  199.10 @@ -55,6 +55,7 @@
  199.11  #include "utilities/quickSort.hpp"
  199.12  #include "utilities/xmlstream.hpp"
  199.13  
  199.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  199.15  
  199.16  // Implementation of Method
  199.17  
  199.18 @@ -1426,7 +1427,7 @@
  199.19  
  199.20    void type_name(const char* name) {
  199.21      if (_use_separator) _st->print(", ");
  199.22 -    _st->print(name);
  199.23 +    _st->print("%s", name);
  199.24      _use_separator = true;
  199.25    }
  199.26  
  199.27 @@ -1873,6 +1874,14 @@
  199.28    loader_data->jmethod_ids()->clear_all_methods();
  199.29  }
  199.30  
  199.31 +bool Method::has_method_vptr(const void* ptr) {
  199.32 +  Method m;
  199.33 +  // This assumes that the vtbl pointer is the first word of a C++ object.
  199.34 +  // This assumption is also in universe.cpp patch_klass_vtble
  199.35 +  void* vtbl2 = dereference_vptr((const void*)&m);
  199.36 +  void* this_vtbl = dereference_vptr(ptr);
  199.37 +  return vtbl2 == this_vtbl;
  199.38 +}
  199.39  
  199.40  // Check that this pointer is valid by checking that the vtbl pointer matches
  199.41  bool Method::is_valid_method() const {
  199.42 @@ -1881,12 +1890,7 @@
  199.43    } else if (!is_metaspace_object()) {
  199.44      return false;
  199.45    } else {
  199.46 -    Method m;
  199.47 -    // This assumes that the vtbl pointer is the first word of a C++ object.
  199.48 -    // This assumption is also in universe.cpp patch_klass_vtble
  199.49 -    void* vtbl2 = dereference_vptr((void*)&m);
  199.50 -    void* this_vtbl = dereference_vptr((void*)this);
  199.51 -    return vtbl2 == this_vtbl;
  199.52 +    return has_method_vptr((const void*)this);
  199.53    }
  199.54  }
  199.55  
  199.56 @@ -1904,7 +1908,7 @@
  199.57  void Method::print_on(outputStream* st) const {
  199.58    ResourceMark rm;
  199.59    assert(is_method(), "must be method");
  199.60 -  st->print_cr(internal_name());
  199.61 +  st->print_cr("%s", internal_name());
  199.62    // get the effect of PrintOopAddress, always, for methods:
  199.63    st->print_cr(" - this oop:          "INTPTR_FORMAT, (intptr_t)this);
  199.64    st->print   (" - method holder:     "); method_holder()->print_value_on(st); st->cr();
  199.65 @@ -1987,7 +1991,7 @@
  199.66  
  199.67  void Method::print_value_on(outputStream* st) const {
  199.68    assert(is_method(), "must be method");
  199.69 -  st->print(internal_name());
  199.70 +  st->print("%s", internal_name());
  199.71    print_address_on(st);
  199.72    st->print(" ");
  199.73    name()->print_value_on(st);
   200.1 --- a/src/share/vm/oops/method.hpp	Wed May 21 10:56:41 2014 -0700
   200.2 +++ b/src/share/vm/oops/method.hpp	Fri May 23 14:12:52 2014 -0700
   200.3 @@ -868,6 +868,7 @@
   200.4    const char* internal_name() const { return "{method}"; }
   200.5  
   200.6    // Check for valid method pointer
   200.7 +  static bool has_method_vptr(const void* ptr);
   200.8    bool is_valid_method() const;
   200.9  
  200.10    // Verify
   201.1 --- a/src/share/vm/oops/methodData.cpp	Wed May 21 10:56:41 2014 -0700
   201.2 +++ b/src/share/vm/oops/methodData.cpp	Fri May 23 14:12:52 2014 -0700
   201.3 @@ -1,5 +1,5 @@
   201.4  /*
   201.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   201.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   201.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   201.8   *
   201.9   * This code is free software; you can redistribute it and/or modify it
  201.10 @@ -35,6 +35,8 @@
  201.11  #include "runtime/deoptimization.hpp"
  201.12  #include "runtime/handles.inline.hpp"
  201.13  
  201.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  201.15 +
  201.16  // ==================================================================
  201.17  // DataLayout
  201.18  //
  201.19 @@ -127,7 +129,7 @@
  201.20      st->print("trap(%s) ", Deoptimization::format_trap_state(buf, sizeof(buf), trap));
  201.21    }
  201.22    if (extra != NULL) {
  201.23 -    st->print(extra);
  201.24 +    st->print("%s", extra);
  201.25    }
  201.26    int flags = data()->flags();
  201.27    if (flags != 0) {
  201.28 @@ -656,7 +658,7 @@
  201.29  
  201.30  #ifndef PRODUCT
  201.31  void ParametersTypeData::print_data_on(outputStream* st, const char* extra) const {
  201.32 -  st->print("parameter types", extra);
  201.33 +  st->print("parameter types"); // FIXME extra ignored?
  201.34    _parameters.print_data_on(st);
  201.35  }
  201.36  
   202.1 --- a/src/share/vm/oops/oop.cpp	Wed May 21 10:56:41 2014 -0700
   202.2 +++ b/src/share/vm/oops/oop.cpp	Fri May 23 14:12:52 2014 -0700
   202.3 @@ -30,6 +30,8 @@
   202.4  #include "runtime/thread.inline.hpp"
   202.5  #include "utilities/copy.hpp"
   202.6  
   202.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   202.8 +
   202.9  bool always_do_update_barrier = false;
  202.10  
  202.11  BarrierSet* oopDesc::_bs = NULL;
   203.1 --- a/src/share/vm/oops/oop.inline.hpp	Wed May 21 10:56:41 2014 -0700
   203.2 +++ b/src/share/vm/oops/oop.inline.hpp	Fri May 23 14:12:52 2014 -0700
   203.3 @@ -1,5 +1,5 @@
   203.4  /*
   203.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   203.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   203.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   203.8   *
   203.9   * This code is free software; you can redistribute it and/or modify it
  203.10 @@ -209,7 +209,7 @@
  203.11    address base = Universe::narrow_oop_base();
  203.12    int    shift = Universe::narrow_oop_shift();
  203.13    oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift));
  203.14 -  assert(check_obj_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result));
  203.15 +  assert(check_obj_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result)));
  203.16    return result;
  203.17  }
  203.18  
   204.1 --- a/src/share/vm/opto/block.cpp	Wed May 21 10:56:41 2014 -0700
   204.2 +++ b/src/share/vm/opto/block.cpp	Fri May 23 14:12:52 2014 -0700
   204.3 @@ -1,5 +1,5 @@
   204.4  /*
   204.5 - * Copyright (c) 1997, 2013, 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 @@ -339,7 +339,7 @@
  204.11      st->print(" FRegPressure: %d",_freg_pressure);
  204.12      st->print(" FHRP Index: %d",_fhrp_index);
  204.13    }
  204.14 -  st->print_cr("");
  204.15 +  st->cr();
  204.16  }
  204.17  
  204.18  void Block::dump() const {
   205.1 --- a/src/share/vm/opto/c2_globals.hpp	Wed May 21 10:56:41 2014 -0700
   205.2 +++ b/src/share/vm/opto/c2_globals.hpp	Fri May 23 14:12:52 2014 -0700
   205.3 @@ -455,7 +455,7 @@
   205.4    notproduct(bool, PrintEliminateLocks, false,                              \
   205.5            "Print out when locks are eliminated")                            \
   205.6                                                                              \
   205.7 -  product(bool, EliminateAutoBox, false,                                    \
   205.8 +  product(bool, EliminateAutoBox, true,                                     \
   205.9            "Control optimizations for autobox elimination")                  \
  205.10                                                                              \
  205.11    diagnostic(bool, UseImplicitStableValues, true,                           \
   206.1 --- a/src/share/vm/opto/callGenerator.cpp	Wed May 21 10:56:41 2014 -0700
   206.2 +++ b/src/share/vm/opto/callGenerator.cpp	Fri May 23 14:12:52 2014 -0700
   206.3 @@ -381,7 +381,7 @@
   206.4    }
   206.5  
   206.6    // Setup default node notes to be picked up by the inlining
   206.7 -  Node_Notes* old_nn = C->default_node_notes();
   206.8 +  Node_Notes* old_nn = C->node_notes_at(call->_idx);
   206.9    if (old_nn != NULL) {
  206.10      Node_Notes* entry_nn = old_nn->clone(C);
  206.11      entry_nn->set_jvms(jvms);
   207.1 --- a/src/share/vm/opto/callnode.cpp	Wed May 21 10:56:41 2014 -0700
   207.2 +++ b/src/share/vm/opto/callnode.cpp	Fri May 23 14:12:52 2014 -0700
   207.3 @@ -1,5 +1,5 @@
   207.4  /*
   207.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   207.6 + * Copyright (c) 1997, 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 @@ -111,7 +111,7 @@
  207.11  #ifndef PRODUCT
  207.12  void ParmNode::dump_spec(outputStream *st) const {
  207.13    if( _con < TypeFunc::Parms ) {
  207.14 -    st->print(names[_con]);
  207.15 +    st->print("%s", names[_con]);
  207.16    } else {
  207.17      st->print("Parm%d: ",_con-TypeFunc::Parms);
  207.18      // Verbose and WizardMode dump bottom_type for all nodes
  207.19 @@ -347,19 +347,19 @@
  207.20        break;
  207.21      case Type::AryPtr:
  207.22      case Type::InstPtr:
  207.23 -      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->isa_oopptr()->const_oop());
  207.24 +      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->isa_oopptr()->const_oop()));
  207.25        break;
  207.26      case Type::KlassPtr:
  207.27 -      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_klassptr()->klass());
  207.28 +      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_klassptr()->klass()));
  207.29        break;
  207.30      case Type::MetadataPtr:
  207.31 -      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_metadataptr()->metadata());
  207.32 +      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_metadataptr()->metadata()));
  207.33        break;
  207.34      case Type::NarrowOop:
  207.35 -      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_oopptr()->const_oop());
  207.36 +      st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_oopptr()->const_oop()));
  207.37        break;
  207.38      case Type::RawPtr:
  207.39 -      st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,t->is_rawptr());
  207.40 +      st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,p2i(t->is_rawptr()));
  207.41        break;
  207.42      case Type::DoubleCon:
  207.43        st->print(" %s%d]=#%fD",msg,i,t->is_double_constant()->_d);
  207.44 @@ -368,7 +368,7 @@
  207.45        st->print(" %s%d]=#%fF",msg,i,t->is_float_constant()->_f);
  207.46        break;
  207.47      case Type::Long:
  207.48 -      st->print(" %s%d]=#"INT64_FORMAT,msg,i,t->is_long()->get_con());
  207.49 +      st->print(" %s%d]=#"INT64_FORMAT,msg,i,(int64_t)(t->is_long()->get_con()));
  207.50        break;
  207.51      case Type::Half:
  207.52      case Type::Top:
  207.53 @@ -427,7 +427,7 @@
  207.54  
  207.55      for (i = 0; i < (uint)scobjs.length(); i++) {
  207.56        // Scalar replaced objects.
  207.57 -      st->print_cr("");
  207.58 +      st->cr();
  207.59        st->print("        # ScObj" INT32_FORMAT " ", i);
  207.60        SafePointScalarObjectNode* spobj = scobjs.at(i);
  207.61        ciKlass* cik = spobj->bottom_type()->is_oopptr()->klass();
  207.62 @@ -484,7 +484,7 @@
  207.63        st->print(" }");
  207.64      }
  207.65    }
  207.66 -  st->print_cr("");
  207.67 +  st->cr();
  207.68    if (caller() != NULL) caller()->format(regalloc, n, st);
  207.69  }
  207.70  
  207.71 @@ -947,7 +947,7 @@
  207.72  #ifndef PRODUCT
  207.73  void CallRuntimeNode::dump_spec(outputStream *st) const {
  207.74    st->print("# ");
  207.75 -  st->print(_name);
  207.76 +  st->print("%s", _name);
  207.77    CallNode::dump_spec(st);
  207.78  }
  207.79  #endif
  207.80 @@ -965,7 +965,7 @@
  207.81  #ifndef PRODUCT
  207.82  void CallLeafNode::dump_spec(outputStream *st) const {
  207.83    st->print("# ");
  207.84 -  st->print(_name);
  207.85 +  st->print("%s", _name);
  207.86    CallNode::dump_spec(st);
  207.87  }
  207.88  #endif
   208.1 --- a/src/share/vm/opto/chaitin.cpp	Wed May 21 10:56:41 2014 -0700
   208.2 +++ b/src/share/vm/opto/chaitin.cpp	Fri May 23 14:12:52 2014 -0700
   208.3 @@ -1,5 +1,5 @@
   208.4  /*
   208.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   208.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   208.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   208.8   *
   208.9   * This code is free software; you can redistribute it and/or modify it
  208.10 @@ -2019,25 +2019,25 @@
  208.11        tty->print_cr("new LRG");
  208.12      }
  208.13    }
  208.14 -  tty->print_cr("");
  208.15 +  tty->cr();
  208.16  
  208.17    // Dump lo-degree list
  208.18    tty->print("Lo degree: ");
  208.19    for(uint i3 = _lo_degree; i3; i3 = lrgs(i3)._next )
  208.20      tty->print("L%d ",i3);
  208.21 -  tty->print_cr("");
  208.22 +  tty->cr();
  208.23  
  208.24    // Dump lo-stk-degree list
  208.25    tty->print("Lo stk degree: ");
  208.26    for(uint i4 = _lo_stk_degree; i4; i4 = lrgs(i4)._next )
  208.27      tty->print("L%d ",i4);
  208.28 -  tty->print_cr("");
  208.29 +  tty->cr();
  208.30  
  208.31    // Dump lo-degree list
  208.32    tty->print("Hi degree: ");
  208.33    for(uint i5 = _hi_degree; i5; i5 = lrgs(i5)._next )
  208.34      tty->print("L%d ",i5);
  208.35 -  tty->print_cr("");
  208.36 +  tty->cr();
  208.37  }
  208.38  
  208.39  void PhaseChaitin::dump_degree_lists() const {
  208.40 @@ -2045,26 +2045,26 @@
  208.41    tty->print("Lo degree: ");
  208.42    for( uint i = _lo_degree; i; i = lrgs(i)._next )
  208.43      tty->print("L%d ",i);
  208.44 -  tty->print_cr("");
  208.45 +  tty->cr();
  208.46  
  208.47    // Dump lo-stk-degree list
  208.48    tty->print("Lo stk degree: ");
  208.49    for(uint i2 = _lo_stk_degree; i2; i2 = lrgs(i2)._next )
  208.50      tty->print("L%d ",i2);
  208.51 -  tty->print_cr("");
  208.52 +  tty->cr();
  208.53  
  208.54    // Dump lo-degree list
  208.55    tty->print("Hi degree: ");
  208.56    for(uint i3 = _hi_degree; i3; i3 = lrgs(i3)._next )
  208.57      tty->print("L%d ",i3);
  208.58 -  tty->print_cr("");
  208.59 +  tty->cr();
  208.60  }
  208.61  
  208.62  void PhaseChaitin::dump_simplified() const {
  208.63    tty->print("Simplified: ");
  208.64    for( uint i = _simplified; i; i = lrgs(i)._next )
  208.65      tty->print("L%d ",i);
  208.66 -  tty->print_cr("");
  208.67 +  tty->cr();
  208.68  }
  208.69  
  208.70  static char *print_reg( OptoReg::Name reg, const PhaseChaitin *pc, char *buf ) {
  208.71 @@ -2143,7 +2143,7 @@
  208.72        }
  208.73        tty->print("   : parm %d: ", k);
  208.74        domain->field_at(k + TypeFunc::Parms)->dump();
  208.75 -      tty->print_cr("");
  208.76 +      tty->cr();
  208.77      }
  208.78    }
  208.79  
  208.80 @@ -2165,7 +2165,7 @@
  208.81            _matcher._parm_regs[j].second() == reg ) {
  208.82          tty->print("parm %d: ",j);
  208.83          domain->field_at(j + TypeFunc::Parms)->dump();
  208.84 -        tty->print_cr("");
  208.85 +        tty->cr();
  208.86          break;
  208.87        }
  208.88      }
   209.1 --- a/src/share/vm/opto/compile.cpp	Wed May 21 10:56:41 2014 -0700
   209.2 +++ b/src/share/vm/opto/compile.cpp	Fri May 23 14:12:52 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 @@ -2411,7 +2411,7 @@
  209.11          starts_bundle = ' ';
  209.12          tty->print("\t");
  209.13          delay->format(_regalloc, tty);
  209.14 -        tty->print_cr("");
  209.15 +        tty->cr();
  209.16          delay = NULL;
  209.17        }
  209.18  
  209.19 @@ -2425,12 +2425,12 @@
  209.20      if (pcs && n->_idx < pc_limit)
  209.21        tty->print_cr("%3.3x", pcs[n->_idx]);
  209.22      else
  209.23 -      tty->print_cr("");
  209.24 +      tty->cr();
  209.25  
  209.26      assert(cut_short || delay == NULL, "no unconditional delay branch");
  209.27  
  209.28    } // End of per-block dump
  209.29 -  tty->print_cr("");
  209.30 +  tty->cr();
  209.31  
  209.32    if (cut_short)  tty->print_cr("*** disassembly is cut short ***");
  209.33  }
  209.34 @@ -3671,7 +3671,8 @@
  209.35      default: ShouldNotReachHere();
  209.36      }
  209.37      assert(constant_addr, "consts section too small");
  209.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()));
  209.39 +    assert((constant_addr - _masm.code()->consts()->start()) == con.offset(),
  209.40 +            err_msg_res("must be: %d == %d", (int) (constant_addr - _masm.code()->consts()->start()), (int)(con.offset())));
  209.41    }
  209.42  }
  209.43  
  209.44 @@ -3751,7 +3752,7 @@
  209.45  
  209.46    for (uint i = 0; i < n->outcnt(); i++) {
  209.47      address* constant_addr = &jump_table_base[i];
  209.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)));
  209.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)));
  209.50      *constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr);
  209.51      cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type);
  209.52    }
  209.53 @@ -3782,7 +3783,7 @@
  209.54        }
  209.55      }
  209.56      for (int i = 0; i < _print_inlining_list->length(); i++) {
  209.57 -      tty->print(_print_inlining_list->adr_at(i)->ss()->as_string());
  209.58 +      tty->print("%s", _print_inlining_list->adr_at(i)->ss()->as_string());
  209.59      }
  209.60    }
  209.61  }
   210.1 --- a/src/share/vm/opto/compile.hpp	Wed May 21 10:56:41 2014 -0700
   210.2 +++ b/src/share/vm/opto/compile.hpp	Fri May 23 14:12:52 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 @@ -465,7 +465,7 @@
  210.11    void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {
  210.12      stringStream ss;
  210.13      CompileTask::print_inlining(&ss, method, inline_level, bci, msg);
  210.14 -    print_inlining_stream()->print(ss.as_string());
  210.15 +    print_inlining_stream()->print("%s", ss.as_string());
  210.16    }
  210.17  
  210.18    void* replay_inline_data() const { return _replay_inline_data; }
   211.1 --- a/src/share/vm/opto/doCall.cpp	Wed May 21 10:56:41 2014 -0700
   211.2 +++ b/src/share/vm/opto/doCall.cpp	Fri May 23 14:12:52 2014 -0700
   211.3 @@ -1,5 +1,5 @@
   211.4  /*
   211.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   211.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
   211.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   211.8   *
   211.9   * This code is free software; you can redistribute it and/or modify it
  211.10 @@ -56,7 +56,7 @@
  211.11      out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
  211.12      stringStream ss;
  211.13      prof_klass->name()->print_symbol_on(&ss);
  211.14 -    out->print(ss.as_string());
  211.15 +    out->print("%s", ss.as_string());
  211.16      out->cr();
  211.17    }
  211.18  }
  211.19 @@ -358,7 +358,7 @@
  211.20  bool Compile::should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms) {
  211.21    if (eliminate_boxing() && call_method->is_boxing_method()) {
  211.22      set_has_boxed_value(true);
  211.23 -    return true;
  211.24 +    return aggressive_unboxing();
  211.25    }
  211.26    return false;
  211.27  }
   212.1 --- a/src/share/vm/opto/gcm.cpp	Wed May 21 10:56:41 2014 -0700
   212.2 +++ b/src/share/vm/opto/gcm.cpp	Fri May 23 14:12:52 2014 -0700
   212.3 @@ -1,5 +1,5 @@
   212.4  /*
   212.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   212.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   212.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   212.8   *
   212.9   * This code is free software; you can redistribute it and/or modify it
  212.10 @@ -2014,7 +2014,7 @@
  212.11    tty->print("%s: %d  trip_count: %6.0f freq: %6.0f\n",
  212.12               _depth == 0 ? "Method" : "Loop", _id, trip_count(), _freq);
  212.13    for (int i = 0; i < _depth; i++) tty->print("   ");
  212.14 -  tty->print("         members:", _id);
  212.15 +  tty->print("         members:");
  212.16    int k = 0;
  212.17    for (int i = 0; i < _members.length(); i++) {
  212.18      if (k++ >= 6) {
   213.1 --- a/src/share/vm/opto/idealGraphPrinter.cpp	Wed May 21 10:56:41 2014 -0700
   213.2 +++ b/src/share/vm/opto/idealGraphPrinter.cpp	Fri May 23 14:12:52 2014 -0700
   213.3 @@ -1,5 +1,5 @@
   213.4  /*
   213.5 - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
   213.6 + * Copyright (c) 2007, 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 @@ -155,7 +155,7 @@
  213.11      } else {
  213.12        // It would be nice if we could shut down cleanly but it should
  213.13        // be an error if we can't connect to the visualizer.
  213.14 -      fatal(err_msg_res("Couldn't connect to visualizer at %s:%d",
  213.15 +      fatal(err_msg_res("Couldn't connect to visualizer at %s:" INTX_FORMAT,
  213.16                          PrintIdealGraphAddress, PrintIdealGraphPort));
  213.17      }
  213.18    }
  213.19 @@ -195,7 +195,7 @@
  213.20  
  213.21  
  213.22  void IdealGraphPrinter::begin_elem(const char *s) {
  213.23 -  _xml->begin_elem(s);
  213.24 +  _xml->begin_elem("%s", s);
  213.25  }
  213.26  
  213.27  void IdealGraphPrinter::end_elem() {
  213.28 @@ -203,7 +203,7 @@
  213.29  }
  213.30  
  213.31  void IdealGraphPrinter::begin_head(const char *s) {
  213.32 -  _xml->begin_head(s);
  213.33 +  _xml->begin_head("%s", s);
  213.34  }
  213.35  
  213.36  void IdealGraphPrinter::end_head() {
  213.37 @@ -223,7 +223,7 @@
  213.38  }
  213.39  
  213.40  void IdealGraphPrinter::head(const char *name) {
  213.41 -  _xml->head(name);
  213.42 +  _xml->head("%s", name);
  213.43  }
  213.44  
  213.45  void IdealGraphPrinter::tail(const char *name) {
  213.46 @@ -231,7 +231,7 @@
  213.47  }
  213.48  
  213.49  void IdealGraphPrinter::text(const char *s) {
  213.50 -  _xml->text(s);
  213.51 +  _xml->text("%s", s);
  213.52  }
  213.53  
  213.54  void IdealGraphPrinter::print_prop(const char *name, int val) {
  213.55 @@ -359,7 +359,7 @@
  213.56  void IdealGraphPrinter::print_indent() {
  213.57    tty->print_cr("printing ident %d", _depth);
  213.58    for (int i = 0; i < _depth; i++) {
  213.59 -    _xml->print(INDENT);
  213.60 +    _xml->print("%s", INDENT);
  213.61    }
  213.62  }
  213.63  
   214.1 --- a/src/share/vm/opto/ifg.cpp	Wed May 21 10:56:41 2014 -0700
   214.2 +++ b/src/share/vm/opto/ifg.cpp	Fri May 23 14:12:52 2014 -0700
   214.3 @@ -1,5 +1,5 @@
   214.4  /*
   214.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   214.6 + * Copyright (c) 1998, 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 @@ -257,7 +257,7 @@
  214.11    for( i = 0; i < _maxlrg*2; i++ )
  214.12      if( h_cnt[i] )
  214.13        tty->print("%d/%d ",i,h_cnt[i]);
  214.14 -  tty->print_cr("");
  214.15 +  tty->cr();
  214.16  }
  214.17  
  214.18  void PhaseIFG::verify( const PhaseChaitin *pc ) const {
   215.1 --- a/src/share/vm/opto/ifnode.cpp	Wed May 21 10:56:41 2014 -0700
   215.2 +++ b/src/share/vm/opto/ifnode.cpp	Fri May 23 14:12:52 2014 -0700
   215.3 @@ -673,7 +673,7 @@
   215.4  //           /    Region
   215.5  //
   215.6  Node* IfNode::fold_compares(PhaseGVN* phase) {
   215.7 -  if (!phase->C->eliminate_boxing() || Opcode() != Op_If) return NULL;
   215.8 +  if (Opcode() != Op_If) return NULL;
   215.9  
  215.10    Node* this_cmp = in(1)->in(1);
  215.11    if (this_cmp != NULL && this_cmp->Opcode() == Op_CmpI &&
   216.1 --- a/src/share/vm/opto/loopPredicate.cpp	Wed May 21 10:56:41 2014 -0700
   216.2 +++ b/src/share/vm/opto/loopPredicate.cpp	Fri May 23 14:12:52 2014 -0700
   216.3 @@ -1,5 +1,5 @@
   216.4  /*
   216.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
   216.6 + * Copyright (c) 2011, 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 @@ -637,7 +637,7 @@
  216.11  
  216.12    if (TraceLoopPredicate) {
  216.13      predString->print_cr("<u range");
  216.14 -    tty->print(predString->as_string());
  216.15 +    tty->print("%s", predString->as_string());
  216.16    }
  216.17    return bol;
  216.18  }
   217.1 --- a/src/share/vm/opto/loopnode.cpp	Wed May 21 10:56:41 2014 -0700
   217.2 +++ b/src/share/vm/opto/loopnode.cpp	Fri May 23 14:12:52 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 @@ -3568,7 +3568,7 @@
  217.11  
  217.12  #ifdef ASSERT
  217.13  void PhaseIdealLoop::dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA) {
  217.14 -  tty->print_cr(msg);
  217.15 +  tty->print_cr("%s", msg);
  217.16    tty->print("n: "); n->dump();
  217.17    tty->print("early(n): "); early->dump();
  217.18    if (n->in(0) != NULL  && !n->in(0)->is_top() &&
   218.1 --- a/src/share/vm/opto/matcher.cpp	Wed May 21 10:56:41 2014 -0700
   218.2 +++ b/src/share/vm/opto/matcher.cpp	Fri May 23 14:12:52 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 @@ -2622,7 +2622,7 @@
  218.11          tty->print_cr("%s  %d  %s",
  218.12                        ruleName[i], _cost[i], ruleName[_rule[i]] );
  218.13        }
  218.14 -  tty->print_cr("");
  218.15 +  tty->cr();
  218.16  
  218.17    for( i=0; i<2; i++ )
  218.18      if( _kids[i] )
   219.1 --- a/src/share/vm/opto/memnode.cpp	Wed May 21 10:56:41 2014 -0700
   219.2 +++ b/src/share/vm/opto/memnode.cpp	Fri May 23 14:12:52 2014 -0700
   219.3 @@ -1,5 +1,5 @@
   219.4  /*
   219.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   219.6 + * Copyright (c) 1997, 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 @@ -4023,7 +4023,7 @@
  219.11      intptr_t st_off = get_store_offset(st, phase);
  219.12      if (st_off < 0)  continue;  // ignore dead garbage
  219.13      if (last_off > st_off) {
  219.14 -      tty->print_cr("*** bad store offset at %d: %d > %d", i, last_off, st_off);
  219.15 +      tty->print_cr("*** bad store offset at %d: " INTX_FORMAT " > " INTX_FORMAT, i, last_off, st_off);
  219.16        this->dump(2);
  219.17        assert(false, "ascending store offsets");
  219.18        return false;
   220.1 --- a/src/share/vm/opto/node.cpp	Wed May 21 10:56:41 2014 -0700
   220.2 +++ b/src/share/vm/opto/node.cpp	Fri May 23 14:12:52 2014 -0700
   220.3 @@ -1,5 +1,5 @@
   220.4  /*
   220.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   220.6 + * Copyright (c) 1997, 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 @@ -1680,7 +1680,7 @@
  220.11        }
  220.12      }
  220.13    }
  220.14 -  if (suffix) st->print(suffix);
  220.15 +  if (suffix) st->print("%s", suffix);
  220.16    C->_in_dump_cnt--;
  220.17  }
  220.18  
   221.1 --- a/src/share/vm/opto/parse1.cpp	Wed May 21 10:56:41 2014 -0700
   221.2 +++ b/src/share/vm/opto/parse1.cpp	Fri May 23 14:12:52 2014 -0700
   221.3 @@ -1,5 +1,5 @@
   221.4  /*
   221.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   221.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   221.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   221.8   *
   221.9   * This code is free software; you can redistribute it and/or modify it
  221.10 @@ -607,7 +607,7 @@
  221.11    set_map(entry_map);
  221.12    do_exits();
  221.13  
  221.14 -  if (log)  log->done("parse nodes='%d' live='%d' memory='%d'",
  221.15 +  if (log)  log->done("parse nodes='%d' live='%d' memory='" SIZE_FORMAT "'",
  221.16                        C->unique(), C->live_nodes(), C->node_arena()->used());
  221.17  }
  221.18  
  221.19 @@ -1369,7 +1369,7 @@
  221.20        tty->print((( i < ns) ? " %d" : " %d(e)"), b->successor_at(i)->rpo());
  221.21      }
  221.22      if (b->is_loop_head()) tty->print("  lphd");
  221.23 -    tty->print_cr("");
  221.24 +    tty->cr();
  221.25    }
  221.26  
  221.27    assert(block()->is_merged(), "must be merged before being parsed");
   222.1 --- a/src/share/vm/opto/parse2.cpp	Wed May 21 10:56:41 2014 -0700
   222.2 +++ b/src/share/vm/opto/parse2.cpp	Fri May 23 14:12:52 2014 -0700
   222.3 @@ -1,5 +1,5 @@
   222.4  /*
   222.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   222.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
   222.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   222.8   *
   222.9   * This code is free software; you can redistribute it and/or modify it
  222.10 @@ -626,7 +626,7 @@
  222.11      _method->print_short_name();
  222.12      tty->print_cr(" switch decision tree");
  222.13      tty->print_cr("    %d ranges (%d singletons), max_depth=%d, est_depth=%d",
  222.14 -                  hi-lo+1, nsing, _max_switch_depth, _est_switch_depth);
  222.15 +                  (int) (hi-lo+1), nsing, _max_switch_depth, _est_switch_depth);
  222.16      if (_max_switch_depth > _est_switch_depth) {
  222.17        tty->print_cr("******** BAD SWITCH DEPTH ********");
  222.18      }
  222.19 @@ -634,7 +634,7 @@
  222.20      for( r = lo; r <= hi; r++ ) {
  222.21        r->print();
  222.22      }
  222.23 -    tty->print_cr("");
  222.24 +    tty->cr();
  222.25    }
  222.26  #endif
  222.27  }
   223.1 --- a/src/share/vm/opto/phaseX.cpp	Wed May 21 10:56:41 2014 -0700
   223.2 +++ b/src/share/vm/opto/phaseX.cpp	Fri May 23 14:12:52 2014 -0700
   223.3 @@ -1,5 +1,5 @@
   223.4  /*
   223.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   223.6 + * Copyright (c) 1997, 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 @@ -1002,10 +1002,10 @@
  223.11    if ( VerifyIterativeGVN && PrintOpto ) {
  223.12      if ( _verify_counter == _verify_full_passes )
  223.13        tty->print_cr("VerifyIterativeGVN: %d transforms and verify passes",
  223.14 -                    _verify_full_passes);
  223.15 +                    (int) _verify_full_passes);
  223.16      else
  223.17        tty->print_cr("VerifyIterativeGVN: %d transforms, %d full verify passes",
  223.18 -                  _verify_counter, _verify_full_passes);
  223.19 +                  (int) _verify_counter, (int) _verify_full_passes);
  223.20    }
  223.21  #endif
  223.22  }
  223.23 @@ -1379,6 +1379,15 @@
  223.24            _worklist.push(u);
  223.25        }
  223.26      }
  223.27 +    // If changed AddI/SubI inputs, check CmpU for range check optimization.
  223.28 +    if (use_op == Op_AddI || use_op == Op_SubI) {
  223.29 +      for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
  223.30 +        Node* u = use->fast_out(i2);
  223.31 +        if (u->is_Cmp() && (u->Opcode() == Op_CmpU)) {
  223.32 +          _worklist.push(u);
  223.33 +        }
  223.34 +      }
  223.35 +    }
  223.36      // If changed AddP inputs, check Stores for loop invariant
  223.37      if( use_op == Op_AddP ) {
  223.38        for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
   224.1 --- a/src/share/vm/opto/regmask.cpp	Wed May 21 10:56:41 2014 -0700
   224.2 +++ b/src/share/vm/opto/regmask.cpp	Fri May 23 14:12:52 2014 -0700
   224.3 @@ -1,5 +1,5 @@
   224.4  /*
   224.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   224.6 + * Copyright (c) 1997, 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 @@ -116,7 +116,7 @@
  224.11    case Special: st->print("r---"); break;
  224.12    case Bad:     st->print("rBAD"); break;
  224.13    default:
  224.14 -    if (r < _last_Mach_Reg) st->print(Matcher::regName[r]);
  224.15 +    if (r < _last_Mach_Reg) st->print("%s", Matcher::regName[r]);
  224.16      else st->print("rS%d",r);
  224.17      break;
  224.18    }
   225.1 --- a/src/share/vm/opto/runtime.cpp	Wed May 21 10:56:41 2014 -0700
   225.2 +++ b/src/share/vm/opto/runtime.cpp	Fri May 23 14:12:52 2014 -0700
   225.3 @@ -1395,7 +1395,7 @@
   225.4    } else {
   225.5      tty->print("<unknown>");
   225.6    }
   225.7 -  tty->print(" at " INTPTR_FORMAT,  exception_pc);
   225.8 +  tty->print(" at " INTPTR_FORMAT,  p2i(exception_pc));
   225.9    tty->print_cr("]");
  225.10  }
  225.11  
   226.1 --- a/src/share/vm/opto/subnode.cpp	Wed May 21 10:56:41 2014 -0700
   226.2 +++ b/src/share/vm/opto/subnode.cpp	Fri May 23 14:12:52 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 @@ -80,7 +80,7 @@
  226.11  
  226.12  //------------------------------Value------------------------------------------
  226.13  // A subtract node differences it's two inputs.
  226.14 -const Type *SubNode::Value( PhaseTransform *phase ) const {
  226.15 +const Type* SubNode::Value_common(PhaseTransform *phase) const {
  226.16    const Node* in1 = in(1);
  226.17    const Node* in2 = in(2);
  226.18    // Either input is TOP ==> the result is TOP
  226.19 @@ -97,6 +97,16 @@
  226.20    if( t1 == Type::BOTTOM || t2 == Type::BOTTOM )
  226.21      return bottom_type();
  226.22  
  226.23 +  return NULL;
  226.24 +}
  226.25 +
  226.26 +const Type* SubNode::Value(PhaseTransform *phase) const {
  226.27 +  const Type* t = Value_common(phase);
  226.28 +  if (t != NULL) {
  226.29 +    return t;
  226.30 +  }
  226.31 +  const Type* t1 = phase->type(in(1));
  226.32 +  const Type* t2 = phase->type(in(2));
  226.33    return sub(t1,t2);            // Local flavor of type subtraction
  226.34  
  226.35  }
  226.36 @@ -570,6 +580,81 @@
  226.37    return TypeInt::CC;                   // else use worst case results
  226.38  }
  226.39  
  226.40 +const Type* CmpUNode::Value(PhaseTransform *phase) const {
  226.41 +  const Type* t = SubNode::Value_common(phase);
  226.42 +  if (t != NULL) {
  226.43 +    return t;
  226.44 +  }
  226.45 +  const Node* in1 = in(1);
  226.46 +  const Node* in2 = in(2);
  226.47 +  const Type* t1 = phase->type(in1);
  226.48 +  const Type* t2 = phase->type(in2);
  226.49 +  assert(t1->isa_int(), "CmpU has only Int type inputs");
  226.50 +  if (t2 == TypeInt::INT) { // Compare to bottom?
  226.51 +    return bottom_type();
  226.52 +  }
  226.53 +  uint in1_op = in1->Opcode();
  226.54 +  if (in1_op == Op_AddI || in1_op == Op_SubI) {
  226.55 +    // The problem rise when result of AddI(SubI) may overflow
  226.56 +    // signed integer value. Let say the input type is
  226.57 +    // [256, maxint] then +128 will create 2 ranges due to
  226.58 +    // overflow: [minint, minint+127] and [384, maxint].
  226.59 +    // But C2 type system keep only 1 type range and as result
  226.60 +    // it use general [minint, maxint] for this case which we
  226.61 +    // can't optimize.
  226.62 +    //
  226.63 +    // Make 2 separate type ranges based on types of AddI(SubI) inputs
  226.64 +    // and compare results of their compare. If results are the same
  226.65 +    // CmpU node can be optimized.
  226.66 +    const Node* in11 = in1->in(1);
  226.67 +    const Node* in12 = in1->in(2);
  226.68 +    const Type* t11 = (in11 == in1) ? Type::TOP : phase->type(in11);
  226.69 +    const Type* t12 = (in12 == in1) ? Type::TOP : phase->type(in12);
  226.70 +    // Skip cases when input types are top or bottom.
  226.71 +    if ((t11 != Type::TOP) && (t11 != TypeInt::INT) &&
  226.72 +        (t12 != Type::TOP) && (t12 != TypeInt::INT)) {
  226.73 +      const TypeInt *r0 = t11->is_int();
  226.74 +      const TypeInt *r1 = t12->is_int();
  226.75 +      jlong lo_r0 = r0->_lo;
  226.76 +      jlong hi_r0 = r0->_hi;
  226.77 +      jlong lo_r1 = r1->_lo;
  226.78 +      jlong hi_r1 = r1->_hi;
  226.79 +      if (in1_op == Op_SubI) {
  226.80 +        jlong tmp = hi_r1;
  226.81 +        hi_r1 = -lo_r1;
  226.82 +        lo_r1 = -tmp;
  226.83 +        // Note, for substructing [minint,x] type range
  226.84 +        // long arithmetic provides correct overflow answer.
  226.85 +        // The confusion come from the fact that in 32-bit
  226.86 +        // -minint == minint but in 64-bit -minint == maxint+1.
  226.87 +      }
  226.88 +      jlong lo_long = lo_r0 + lo_r1;
  226.89 +      jlong hi_long = hi_r0 + hi_r1;
  226.90 +      int lo_tr1 = min_jint;
  226.91 +      int hi_tr1 = (int)hi_long;
  226.92 +      int lo_tr2 = (int)lo_long;
  226.93 +      int hi_tr2 = max_jint;
  226.94 +      bool underflow = lo_long != (jlong)lo_tr2;
  226.95 +      bool overflow  = hi_long != (jlong)hi_tr1;
  226.96 +      // Use sub(t1, t2) when there is no overflow (one type range)
  226.97 +      // or when both overflow and underflow (too complex).
  226.98 +      if ((underflow != overflow) && (hi_tr1 < lo_tr2)) {
  226.99 +        // Overflow only on one boundary, compare 2 separate type ranges.
 226.100 +        int w = MAX2(r0->_widen, r1->_widen); // _widen does not matter here
 226.101 +        const TypeInt* tr1 = TypeInt::make(lo_tr1, hi_tr1, w);
 226.102 +        const TypeInt* tr2 = TypeInt::make(lo_tr2, hi_tr2, w);
 226.103 +        const Type* cmp1 = sub(tr1, t2);
 226.104 +        const Type* cmp2 = sub(tr2, t2);
 226.105 +        if (cmp1 == cmp2) {
 226.106 +          return cmp1; // Hit!
 226.107 +        }
 226.108 +      }
 226.109 +    }
 226.110 +  }
 226.111 +
 226.112 +  return sub(t1, t2);            // Local flavor of type subtraction
 226.113 +}
 226.114 +
 226.115  bool CmpUNode::is_index_range_check() const {
 226.116    // Check for the "(X ModI Y) CmpU Y" shape
 226.117    return (in(1)->Opcode() == Op_ModI &&
 226.118 @@ -1065,7 +1150,7 @@
 226.119  #ifndef PRODUCT
 226.120  void BoolTest::dump_on(outputStream *st) const {
 226.121    const char *msg[] = {"eq","gt","of","lt","ne","le","nof","ge"};
 226.122 -  st->print(msg[_test]);
 226.123 +  st->print("%s", msg[_test]);
 226.124  }
 226.125  #endif
 226.126  
   227.1 --- a/src/share/vm/opto/subnode.hpp	Wed May 21 10:56:41 2014 -0700
   227.2 +++ b/src/share/vm/opto/subnode.hpp	Fri May 23 14:12:52 2014 -0700
   227.3 @@ -50,6 +50,7 @@
   227.4    // Compute a new Type for this node.  Basically we just do the pre-check,
   227.5    // then call the virtual add() to set the type.
   227.6    virtual const Type *Value( PhaseTransform *phase ) const;
   227.7 +  const Type* Value_common( PhaseTransform *phase ) const;
   227.8  
   227.9    // Supplied function returns the subtractend of the inputs.
  227.10    // This also type-checks the inputs for sanity.  Guaranteed never to
  227.11 @@ -158,6 +159,7 @@
  227.12    CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
  227.13    virtual int Opcode() const;
  227.14    virtual const Type *sub( const Type *, const Type * ) const;
  227.15 +  const Type *Value( PhaseTransform *phase ) const;
  227.16    bool is_index_range_check() const;
  227.17  };
  227.18  
   228.1 --- a/src/share/vm/opto/type.cpp	Wed May 21 10:56:41 2014 -0700
   228.2 +++ b/src/share/vm/opto/type.cpp	Fri May 23 14:12:52 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 @@ -41,6 +41,8 @@
  228.11  #include "opto/opcodes.hpp"
  228.12  #include "opto/type.hpp"
  228.13  
  228.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  228.15 +
  228.16  // Portions of code courtesy of Clifford Click
  228.17  
  228.18  // Optimization - Graph Style
  228.19 @@ -842,7 +844,7 @@
  228.20  #ifndef PRODUCT
  228.21  //------------------------------dump2------------------------------------------
  228.22  void Type::dump2( Dict &d, uint depth, outputStream *st ) const {
  228.23 -  st->print(_type_info[_base].msg);
  228.24 +  st->print("%s", _type_info[_base].msg);
  228.25  }
  228.26  
  228.27  //------------------------------dump-------------------------------------------
   229.1 --- a/src/share/vm/prims/jni.cpp	Wed May 21 10:56:41 2014 -0700
   229.2 +++ b/src/share/vm/prims/jni.cpp	Fri May 23 14:12:52 2014 -0700
   229.3 @@ -1,5 +1,5 @@
   229.4  /*
   229.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   229.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   229.7   * Copyright (c) 2012 Red Hat, Inc.
   229.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   229.9   *
  229.10 @@ -308,7 +308,7 @@
  229.11  
  229.12    class JNITraceWrapper : public StackObj {
  229.13     public:
  229.14 -    JNITraceWrapper(const char* format, ...) {
  229.15 +    JNITraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
  229.16        if (TraceJNICalls) {
  229.17          va_list ap;
  229.18          va_start(ap, format);
   230.1 --- a/src/share/vm/prims/jniCheck.cpp	Wed May 21 10:56:41 2014 -0700
   230.2 +++ b/src/share/vm/prims/jniCheck.cpp	Fri May 23 14:12:52 2014 -0700
   230.3 @@ -1,5 +1,5 @@
   230.4  /*
   230.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   230.6 + * Copyright (c) 2001, 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 @@ -100,7 +100,7 @@
  230.11    result_type JNICALL header {                                           \
  230.12      JavaThread* thr = (JavaThread*)ThreadLocalStorage::get_thread_slow();\
  230.13      if (thr == NULL || !thr->is_Java_thread()) {                         \
  230.14 -      tty->print_cr(fatal_using_jnienv_in_nonjava);                      \
  230.15 +      tty->print_cr("%s", fatal_using_jnienv_in_nonjava);                      \
  230.16        os::abort(true);                                                   \
  230.17      }                                                                    \
  230.18      JNIEnv* xenv = thr->jni_environment();                               \
  230.19 @@ -184,7 +184,7 @@
  230.20  functionEnter(JavaThread* thr)
  230.21  {
  230.22    if (thr->in_critical()) {
  230.23 -    tty->print_cr(warn_other_function_in_critical);
  230.24 +    tty->print_cr("%s", warn_other_function_in_critical);
  230.25    }
  230.26    if (thr->has_pending_exception()) {
  230.27      NativeReportJNIWarning(thr, "JNI call made with exception pending");
  230.28 @@ -195,7 +195,7 @@
  230.29  functionEnterExceptionAllowed(JavaThread* thr)
  230.30  {
  230.31    if (thr->in_critical()) {
  230.32 -    tty->print_cr(warn_other_function_in_critical);
  230.33 +    tty->print_cr("%s", warn_other_function_in_critical);
  230.34    }
  230.35  }
  230.36  
   231.1 --- a/src/share/vm/prims/jvm.cpp	Wed May 21 10:56:41 2014 -0700
   231.2 +++ b/src/share/vm/prims/jvm.cpp	Fri May 23 14:12:52 2014 -0700
   231.3 @@ -220,7 +220,7 @@
   231.4  #ifdef ASSERT
   231.5    class JVMTraceWrapper : public StackObj {
   231.6     public:
   231.7 -    JVMTraceWrapper(const char* format, ...) {
   231.8 +    JVMTraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
   231.9        if (TraceJVMCalls) {
  231.10          va_list ap;
  231.11          va_start(ap, format);
  231.12 @@ -2716,14 +2716,14 @@
  231.13  
  231.14  
  231.15  JVM_LEAF(jlong, JVM_Lseek(jint fd, jlong offset, jint whence))
  231.16 -  JVMWrapper4("JVM_Lseek (0x%x, %Ld, %d)", fd, offset, whence);
  231.17 +  JVMWrapper4("JVM_Lseek (0x%x, " INT64_FORMAT ", %d)", fd, (int64_t) offset, whence);
  231.18    //%note jvm_r6
  231.19    return os::lseek(fd, offset, whence);
  231.20  JVM_END
  231.21  
  231.22  
  231.23  JVM_LEAF(jint, JVM_SetLength(jint fd, jlong length))
  231.24 -  JVMWrapper3("JVM_SetLength (0x%x, %Ld)", fd, length);
  231.25 +  JVMWrapper3("JVM_SetLength (0x%x, " INT64_FORMAT ")", fd, (int64_t) length);
  231.26    return os::ftruncate(fd, length);
  231.27  JVM_END
  231.28  
  231.29 @@ -2738,13 +2738,14 @@
  231.30  // Printing support //////////////////////////////////////////////////
  231.31  extern "C" {
  231.32  
  231.33 +ATTRIBUTE_PRINTF(3, 0)
  231.34  int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
  231.35    // see bug 4399518, 4417214
  231.36    if ((intptr_t)count <= 0) return -1;
  231.37    return vsnprintf(str, count, fmt, args);
  231.38  }
  231.39  
  231.40 -
  231.41 +ATTRIBUTE_PRINTF(3, 0)
  231.42  int jio_snprintf(char *str, size_t count, const char *fmt, ...) {
  231.43    va_list args;
  231.44    int len;
  231.45 @@ -2754,7 +2755,7 @@
  231.46    return len;
  231.47  }
  231.48  
  231.49 -
  231.50 +ATTRIBUTE_PRINTF(2,3)
  231.51  int jio_fprintf(FILE* f, const char *fmt, ...) {
  231.52    int len;
  231.53    va_list args;
  231.54 @@ -2764,7 +2765,7 @@
  231.55    return len;
  231.56  }
  231.57  
  231.58 -
  231.59 +ATTRIBUTE_PRINTF(2, 0)
  231.60  int jio_vfprintf(FILE* f, const char *fmt, va_list args) {
  231.61    if (Arguments::vfprintf_hook() != NULL) {
  231.62       return Arguments::vfprintf_hook()(f, fmt, args);
  231.63 @@ -2773,7 +2774,7 @@
  231.64    }
  231.65  }
  231.66  
  231.67 -
  231.68 +ATTRIBUTE_PRINTF(1, 2)
  231.69  JNIEXPORT int jio_printf(const char *fmt, ...) {
  231.70    int len;
  231.71    va_list args;
  231.72 @@ -2910,7 +2911,7 @@
  231.73    JavaThread* receiver = java_lang_Thread::thread(java_thread);
  231.74    Events::log_exception(JavaThread::current(),
  231.75                          "JVM_StopThread thread JavaThread " INTPTR_FORMAT " as oop " INTPTR_FORMAT " [exception " INTPTR_FORMAT "]",
  231.76 -                        receiver, (address)java_thread, throwable);
  231.77 +                        p2i(receiver), p2i((address)java_thread), p2i(throwable));
  231.78    // First check if thread is alive
  231.79    if (receiver != NULL) {
  231.80      // Check if exception is getting thrown at self (use oop equality, since the
   232.1 --- a/src/share/vm/prims/jvmtiEnter.xsl	Wed May 21 10:56:41 2014 -0700
   232.2 +++ b/src/share/vm/prims/jvmtiEnter.xsl	Fri May 23 14:12:52 2014 -0700
   232.3 @@ -1,6 +1,6 @@
   232.4  <?xml version="1.0"?> 
   232.5  <!--
   232.6 - Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   232.7 + Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
   232.8   DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   232.9  
  232.10   This code is free software; you can redistribute it and/or modify it
  232.11 @@ -43,6 +43,9 @@
  232.12  # include "prims/jvmtiRawMonitor.hpp"
  232.13  # include "prims/jvmtiUtil.hpp"
  232.14  
  232.15 +// There are known-bad format/arg pairings in the code generated by this file.
  232.16 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  232.17 +
  232.18  </xsl:text>
  232.19  
  232.20    <xsl:if test="$trace = 'Trace'">
   233.1 --- a/src/share/vm/prims/jvmtiEnvThreadState.cpp	Wed May 21 10:56:41 2014 -0700
   233.2 +++ b/src/share/vm/prims/jvmtiEnvThreadState.cpp	Fri May 23 14:12:52 2014 -0700
   233.3 @@ -113,7 +113,7 @@
   233.4      JvmtiFramePop fp = JvmtiFramePop(_pops->at(i));
   233.5      tty->print("%d: ", i);
   233.6      fp.print();
   233.7 -    tty->print_cr("");
   233.8 +    tty->cr();
   233.9    }
  233.10  }
  233.11  #endif
   234.1 --- a/src/share/vm/prims/jvmtiEventController.cpp	Wed May 21 10:56:41 2014 -0700
   234.2 +++ b/src/share/vm/prims/jvmtiEventController.cpp	Fri May 23 14:12:52 2014 -0700
   234.3 @@ -1,5 +1,5 @@
   234.4  /*
   234.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   234.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
   234.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   234.8   *
   234.9   * This code is free software; you can redistribute it and/or modify it
  234.10 @@ -38,6 +38,8 @@
  234.11  #include "runtime/vmThread.hpp"
  234.12  #include "runtime/vm_operations.hpp"
  234.13  
  234.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  234.15 +
  234.16  #ifdef JVMTI_TRACE
  234.17  #define EC_TRACE(out) do { \
  234.18    if (JvmtiTrace::trace_event_controller()) { \
   235.1 --- a/src/share/vm/prims/jvmtiExport.cpp	Wed May 21 10:56:41 2014 -0700
   235.2 +++ b/src/share/vm/prims/jvmtiExport.cpp	Fri May 23 14:12:52 2014 -0700
   235.3 @@ -1,5 +1,5 @@
   235.4  /*
   235.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   235.6 + * Copyright (c) 2003, 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 @@ -56,6 +56,8 @@
  235.11  #include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
  235.12  #endif // INCLUDE_ALL_GCS
  235.13  
  235.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  235.15 +
  235.16  #ifdef JVMTI_TRACE
  235.17  #define EVT_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_SENT) != 0) { SafeResourceMark rm; tty->print_cr out; }
  235.18  #define EVT_TRIG_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_TRIGGER) != 0) { SafeResourceMark rm; tty->print_cr out; }
   236.1 --- a/src/share/vm/prims/jvmtiImpl.cpp	Wed May 21 10:56:41 2014 -0700
   236.2 +++ b/src/share/vm/prims/jvmtiImpl.cpp	Fri May 23 14:12:52 2014 -0700
   236.3 @@ -1,5 +1,5 @@
   236.4  /*
   236.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   236.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
   236.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   236.8   *
   236.9   * This code is free software; you can redistribute it and/or modify it
  236.10 @@ -413,7 +413,7 @@
  236.11      JvmtiBreakpoint& bp = _bps.at(i);
  236.12      tty->print("%d: ", i);
  236.13      bp.print();
  236.14 -    tty->print_cr("");
  236.15 +    tty->cr();
  236.16    }
  236.17  #endif
  236.18  }
   237.1 --- a/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed May 21 10:56:41 2014 -0700
   237.2 +++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri May 23 14:12:52 2014 -0700
   237.3 @@ -1,5 +1,5 @@
   237.4  /*
   237.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   237.6 + * Copyright (c) 2003, 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 @@ -43,6 +43,7 @@
  237.11  #include "runtime/relocator.hpp"
  237.12  #include "utilities/bitMap.inline.hpp"
  237.13  
  237.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  237.15  
  237.16  Array<Method*>* VM_RedefineClasses::_old_methods = NULL;
  237.17  Array<Method*>* VM_RedefineClasses::_new_methods = NULL;
  237.18 @@ -1904,6 +1905,8 @@
  237.19  // annotations_typeArray if needed. Returns the original constant
  237.20  // pool reference if a rewrite was not needed or the new constant
  237.21  // pool reference if a rewrite was needed.
  237.22 +PRAGMA_DIAG_PUSH
  237.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED
  237.24  u2 VM_RedefineClasses::rewrite_cp_ref_in_annotation_data(
  237.25       AnnotationArray* annotations_typeArray, int &byte_i_ref,
  237.26       const char * trace_mesg, TRAPS) {
  237.27 @@ -1920,6 +1923,7 @@
  237.28    byte_i_ref += 2;
  237.29    return old_cp_index;
  237.30  }
  237.31 +PRAGMA_DIAG_POP
  237.32  
  237.33  
  237.34  // Rewrite constant pool references in the element_value portion of an
   238.1 --- a/src/share/vm/prims/methodHandles.cpp	Wed May 21 10:56:41 2014 -0700
   238.2 +++ b/src/share/vm/prims/methodHandles.cpp	Fri May 23 14:12:52 2014 -0700
   238.3 @@ -1,5 +1,5 @@
   238.4  /*
   238.5 - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
   238.6 + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
   238.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   238.8   *
   238.9   * This code is free software; you can redistribute it and/or modify it
  238.10 @@ -536,7 +536,7 @@
  238.11            // unknown letter, or we don't want to know its name
  238.12            st->put(ch);
  238.13          } else {
  238.14 -          st->print(n);
  238.15 +          st->print("%s", n);
  238.16            prev_type = true;
  238.17          }
  238.18          break;
   239.1 --- a/src/share/vm/prims/privilegedStack.cpp	Wed May 21 10:56:41 2014 -0700
   239.2 +++ b/src/share/vm/prims/privilegedStack.cpp	Fri May 23 14:12:52 2014 -0700
   239.3 @@ -1,5 +1,5 @@
   239.4  /*
   239.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   239.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   239.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   239.8   *
   239.9   * This code is free software; you can redistribute it and/or modify it
  239.10 @@ -30,6 +30,7 @@
  239.11  #include "prims/privilegedStack.hpp"
  239.12  #include "runtime/vframe.hpp"
  239.13  
  239.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  239.15  
  239.16  void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) {
  239.17    Method* method        = vfst->method();
   240.1 --- a/src/share/vm/prims/unsafe.cpp	Wed May 21 10:56:41 2014 -0700
   240.2 +++ b/src/share/vm/prims/unsafe.cpp	Fri May 23 14:12:52 2014 -0700
   240.3 @@ -1,5 +1,5 @@
   240.4  /*
   240.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   240.6 + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   240.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   240.8   *
   240.9   * This code is free software; you can redistribute it and/or modify it
  240.10 @@ -40,6 +40,8 @@
  240.11  #include "utilities/copy.hpp"
  240.12  #include "utilities/dtrace.hpp"
  240.13  
  240.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  240.15 +
  240.16  /*
  240.17   *      Implementation of class sun.misc.Unsafe
  240.18   */
   241.1 --- a/src/share/vm/prims/whitebox.cpp	Wed May 21 10:56:41 2014 -0700
   241.2 +++ b/src/share/vm/prims/whitebox.cpp	Fri May 23 14:12:52 2014 -0700
   241.3 @@ -53,6 +53,8 @@
   241.4  #include "compiler/compileBroker.hpp"
   241.5  #include "runtime/compilationPolicy.hpp"
   241.6  
   241.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   241.8 +
   241.9  #define SIZE_T_MAX_VALUE ((size_t) -1)
  241.10  
  241.11  bool WhiteBox::_used = false;
   242.1 --- a/src/share/vm/runtime/arguments.cpp	Wed May 21 10:56:41 2014 -0700
   242.2 +++ b/src/share/vm/runtime/arguments.cpp	Fri May 23 14:12:52 2014 -0700
   242.3 @@ -1,5 +1,5 @@
   242.4  /*
   242.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   242.6 + * Copyright (c) 1997, 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 @@ -840,7 +840,7 @@
  242.11      for (int i=0; i < _num_jvm_flags; i++) {
  242.12        st->print("%s ", _jvm_flags_array[i]);
  242.13      }
  242.14 -    st->print_cr("");
  242.15 +    st->cr();
  242.16    }
  242.17  }
  242.18  
  242.19 @@ -849,7 +849,7 @@
  242.20      for (int i=0; i < _num_jvm_args; i++) {
  242.21        st->print("%s ", _jvm_args_array[i]);
  242.22      }
  242.23 -    st->print_cr("");
  242.24 +    st->cr();
  242.25    }
  242.26  }
  242.27  
  242.28 @@ -1341,8 +1341,8 @@
  242.29    }
  242.30    if (PrintGCDetails && Verbose) {
  242.31      tty->print_cr("MarkStackSize: %uk  MarkStackSizeMax: %uk",
  242.32 -      MarkStackSize / K, MarkStackSizeMax / K);
  242.33 -    tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
  242.34 +      (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
  242.35 +    tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
  242.36    }
  242.37  }
  242.38  #endif // INCLUDE_ALL_GCS
  242.39 @@ -1422,7 +1422,7 @@
  242.40      if (PrintGCDetails) {
  242.41        // Cannot use gclog_or_tty yet.
  242.42        tty->print_cr("Automatic selection of the low pause collector"
  242.43 -       " based on pause goal of %d (ms)", MaxGCPauseMillis);
  242.44 +       " based on pause goal of %d (ms)", (int) MaxGCPauseMillis);
  242.45      }
  242.46      return true;
  242.47    }
  242.48 @@ -1639,8 +1639,8 @@
  242.49  
  242.50    if (PrintGCDetails && Verbose) {
  242.51      tty->print_cr("MarkStackSize: %uk  MarkStackSizeMax: %uk",
  242.52 -      MarkStackSize / K, MarkStackSizeMax / K);
  242.53 -    tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
  242.54 +      (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
  242.55 +    tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
  242.56    }
  242.57  }
  242.58  
  242.59 @@ -1703,7 +1703,7 @@
  242.60  
  242.61      if (PrintGCDetails && Verbose) {
  242.62        // Cannot use gclog_or_tty yet.
  242.63 -      tty->print_cr("  Maximum heap size " SIZE_FORMAT, reasonable_max);
  242.64 +      tty->print_cr("  Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
  242.65      }
  242.66      FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
  242.67    }
  242.68 @@ -2090,7 +2090,7 @@
  242.69      // Using "else if" below to avoid printing two error messages if min > max.
  242.70      // This will also prevent us from reporting both min>100 and max>100 at the
  242.71      // same time, but that is less annoying than printing two identical errors IMHO.
  242.72 -    FormatBuffer<80> err_msg("");
  242.73 +    FormatBuffer<80> err_msg("%s","");
  242.74      if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) {
  242.75        jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
  242.76        status = false;
   243.1 --- a/src/share/vm/runtime/arguments.hpp	Wed May 21 10:56:41 2014 -0700
   243.2 +++ b/src/share/vm/runtime/arguments.hpp	Fri May 23 14:12:52 2014 -0700
   243.3 @@ -1,5 +1,5 @@
   243.4  /*
   243.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   243.6 + * Copyright (c) 1997, 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 @@ -36,7 +36,7 @@
  243.11  extern "C" {
  243.12    typedef void (JNICALL *abort_hook_t)(void);
  243.13    typedef void (JNICALL *exit_hook_t)(jint code);
  243.14 -  typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args);
  243.15 +  typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args)  ATTRIBUTE_PRINTF(2, 0);
  243.16  }
  243.17  
  243.18  // Forward declarations
   244.1 --- a/src/share/vm/runtime/biasedLocking.cpp	Wed May 21 10:56:41 2014 -0700
   244.2 +++ b/src/share/vm/runtime/biasedLocking.cpp	Fri May 23 14:12:52 2014 -0700
   244.3 @@ -1,5 +1,5 @@
   244.4  /*
   244.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   244.6 + * Copyright (c) 2005, 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 @@ -161,7 +161,7 @@
  244.11    if (TraceBiasedLocking && (Verbose || !is_bulk)) {
  244.12      ResourceMark rm;
  244.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,
  244.14 -                  (void *)obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread);
  244.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);
  244.16    }
  244.17  
  244.18    JavaThread* biased_thread = mark->biased_locker();
  244.19 @@ -214,8 +214,8 @@
  244.20      if (mon_info->owner() == obj) {
  244.21        if (TraceBiasedLocking && Verbose) {
  244.22          tty->print_cr("   mon_info->owner (" PTR_FORMAT ") == obj (" PTR_FORMAT ")",
  244.23 -                      (void *) mon_info->owner(),
  244.24 -                      (void *) obj);
  244.25 +                      p2i((void *) mon_info->owner()),
  244.26 +                      p2i((void *) obj));
  244.27        }
  244.28        // Assume recursive case and fix up highest lock later
  244.29        markOop mark = markOopDesc::encode((BasicLock*) NULL);
  244.30 @@ -224,8 +224,8 @@
  244.31      } else {
  244.32        if (TraceBiasedLocking && Verbose) {
  244.33          tty->print_cr("   mon_info->owner (" PTR_FORMAT ") != obj (" PTR_FORMAT ")",
  244.34 -                      (void *) mon_info->owner(),
  244.35 -                      (void *) obj);
  244.36 +                      p2i((void *) mon_info->owner()),
  244.37 +                      p2i((void *) obj));
  244.38        }
  244.39      }
  244.40    }
  244.41 @@ -328,7 +328,7 @@
  244.42      tty->print_cr("* Beginning bulk revocation (kind == %s) because of object "
  244.43                    INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
  244.44                    (bulk_rebias ? "rebias" : "revoke"),
  244.45 -                  (void *) o, (intptr_t) o->mark(), o->klass()->external_name());
  244.46 +                  p2i((void *) o), (intptr_t) o->mark(), o->klass()->external_name());
  244.47    }
  244.48  
  244.49    jlong cur_time = os::javaTimeMillis();
   245.1 --- a/src/share/vm/runtime/compilationPolicy.cpp	Wed May 21 10:56:41 2014 -0700
   245.2 +++ b/src/share/vm/runtime/compilationPolicy.cpp	Fri May 23 14:12:52 2014 -0700
   245.3 @@ -1,5 +1,5 @@
   245.4  /*
   245.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   245.6 + * Copyright (c) 2000, 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 @@ -170,7 +170,7 @@
  245.11  void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) {
  245.12    if (TraceOnStackReplacement) {
  245.13      if (osr_nm == NULL) tty->print_cr("compilation failed");
  245.14 -    else tty->print_cr("nmethod " INTPTR_FORMAT, osr_nm);
  245.15 +    else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm));
  245.16    }
  245.17  }
  245.18  #endif // !PRODUCT
  245.19 @@ -417,6 +417,7 @@
  245.20  }
  245.21  
  245.22  #ifndef PRODUCT
  245.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  245.24  void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci) {
  245.25    if (TraceInvocationCounterOverflow) {
  245.26      MethodCounters* mcs = m->method_counters();
  245.27 @@ -428,7 +429,10 @@
  245.28        bci == InvocationEntryBci
  245.29        ? "comp-policy cntr ovfl @ %d in entry of "
  245.30        : "comp-policy cntr ovfl @ %d in loop of ";
  245.31 +PRAGMA_DIAG_PUSH
  245.32 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  245.33      tty->print(msg, bci);
  245.34 +PRAGMA_DIAG_POP
  245.35      m->print_value();
  245.36      tty->cr();
  245.37      ic->print();
  245.38 @@ -503,7 +507,7 @@
  245.39      if (TraceCompilationPolicy) {
  245.40        tty->print("method invocation trigger: ");
  245.41        m->print_short_name(tty);
  245.42 -      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)m(), m->code_size());
  245.43 +      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)m()), m->code_size());
  245.44      }
  245.45      RegisterMap reg_map(thread, false);
  245.46      javaVFrame* triggerVF = thread->last_java_vframe(&reg_map);
  245.47 @@ -512,7 +516,7 @@
  245.48  
  245.49      if (first->top_method()->code() != NULL) {
  245.50        // called obsolete method/nmethod -- no need to recompile
  245.51 -      if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, first->top_method()->code());
  245.52 +      if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, p2i(first->top_method()->code()));
  245.53      } else {
  245.54        if (TimeCompilationPolicy) accumulated_time()->start();
  245.55        GrowableArray<RFrame*>* stack = new GrowableArray<RFrame*>(50);
  245.56 @@ -640,7 +644,7 @@
  245.57      if (TraceCompilationPolicy && Verbose) {
  245.58        tty->print("\n\t     check caller: ");
  245.59        next_m->print_short_name(tty);
  245.60 -      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)next_m(), next_m->code_size());
  245.61 +      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m()), next_m->code_size());
  245.62      }
  245.63  
  245.64      current = next;
   246.1 --- a/src/share/vm/runtime/deoptimization.cpp	Wed May 21 10:56:41 2014 -0700
   246.2 +++ b/src/share/vm/runtime/deoptimization.cpp	Fri May 23 14:12:52 2014 -0700
   246.3 @@ -1,5 +1,5 @@
   246.4  /*
   246.5 - * Copyright (c) 1997, 2013, 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 @@ -89,6 +89,8 @@
  246.11  #endif
  246.12  #endif // COMPILER2
  246.13  
  246.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  246.15 +
  246.16  bool DeoptimizationMarker::_is_active = false;
  246.17  
  246.18  Deoptimization::UnrollBlock::UnrollBlock(int  size_of_deoptimized_frame,
   247.1 --- a/src/share/vm/runtime/fprofiler.cpp	Wed May 21 10:56:41 2014 -0700
   247.2 +++ b/src/share/vm/runtime/fprofiler.cpp	Fri May 23 14:12:52 2014 -0700
   247.3 @@ -1,5 +1,5 @@
   247.4  /*
   247.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   247.6 + * Copyright (c) 1997, 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 @@ -41,6 +41,8 @@
  247.11  #include "runtime/vframe.hpp"
  247.12  #include "utilities/macros.hpp"
  247.13  
  247.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  247.15 +
  247.16  // Static fields of FlatProfiler
  247.17  int               FlatProfiler::received_gc_ticks   = 0;
  247.18  int               FlatProfiler::vm_operation_ticks  = 0;
  247.19 @@ -308,7 +310,7 @@
  247.20      st->fill_to(col2);
  247.21      t->print_native(st);
  247.22      st->fill_to(col3);
  247.23 -    st->print(msg);
  247.24 +    st->print("%s", msg);
  247.25      st->cr();
  247.26    }
  247.27  
   248.1 --- a/src/share/vm/runtime/frame.cpp	Wed May 21 10:56:41 2014 -0700
   248.2 +++ b/src/share/vm/runtime/frame.cpp	Fri May 23 14:12:52 2014 -0700
   248.3 @@ -1,5 +1,5 @@
   248.4  /*
   248.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   248.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   248.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   248.8   *
   248.9   * This code is free software; you can redistribute it and/or modify it
  248.10 @@ -62,6 +62,8 @@
  248.11  # include "nativeInst_ppc.hpp"
  248.12  #endif
  248.13  
  248.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  248.15 +
  248.16  RegisterMap::RegisterMap(JavaThread *thread, bool update_map) {
  248.17    _thread         = thread;
  248.18    _update_map     = update_map;
   249.1 --- a/src/share/vm/runtime/globals.cpp	Wed May 21 10:56:41 2014 -0700
   249.2 +++ b/src/share/vm/runtime/globals.cpp	Fri May 23 14:12:52 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 @@ -45,6 +45,8 @@
  249.11  #include "shark/shark_globals.hpp"
  249.12  #endif
  249.13  
  249.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  249.15 +
  249.16  RUNTIME_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, \
  249.17                MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, \
  249.18                MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_EXPERIMENTAL_FLAG, \
  249.19 @@ -283,6 +285,7 @@
  249.20  // Length of format string (e.g. "%.1234s") for printing ccstr below
  249.21  #define FORMAT_BUFFER_LEN 16
  249.22  
  249.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  249.24  void Flag::print_on(outputStream* st, bool withComments) {
  249.25    // Don't print notproduct and develop flags in a product build.
  249.26    if (is_constant_in_binary()) {
  249.27 @@ -315,7 +318,10 @@
  249.28          size_t llen = pointer_delta(eol, cp, sizeof(char));
  249.29          jio_snprintf(format_buffer, FORMAT_BUFFER_LEN,
  249.30              "%%." SIZE_FORMAT "s", llen);
  249.31 +PRAGMA_DIAG_PUSH
  249.32 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  249.33          st->print(format_buffer, cp);
  249.34 +PRAGMA_DIAG_POP
  249.35          st->cr();
  249.36          cp = eol+1;
  249.37          st->print("%5s %-35s += ", "", _name);
  249.38 @@ -372,7 +378,7 @@
  249.39          } else {
  249.40            st->print(" ");
  249.41          }
  249.42 -        st->print(d.name);
  249.43 +        st->print("%s", d.name);
  249.44        }
  249.45      }
  249.46  
   250.1 --- a/src/share/vm/runtime/globals.hpp	Wed May 21 10:56:41 2014 -0700
   250.2 +++ b/src/share/vm/runtime/globals.hpp	Fri May 23 14:12:52 2014 -0700
   250.3 @@ -523,13 +523,6 @@
   250.4    product_pd(bool, UseMembar,                                               \
   250.5            "(Unstable) Issues membars on thread state transitions")          \
   250.6                                                                              \
   250.7 -  /* Temp PPC Flag to allow disabling the use of lwsync on ppc platforms    \
   250.8 -   * that don't support it.  This will be replaced by processor detection   \
   250.9 -   * logic.                                                                 \
  250.10 -   */                                                                       \
  250.11 -  product(bool, UsePPCLWSYNC, true,                                         \
  250.12 -          "Use lwsync instruction if true, else use slower sync")           \
  250.13 -                                                                            \
  250.14    develop(bool, CleanChunkPoolAsync, falseInEmbedded,                       \
  250.15            "Clean the chunk pool asynchronously")                            \
  250.16                                                                              \
   251.1 --- a/src/share/vm/runtime/handles.cpp	Wed May 21 10:56:41 2014 -0700
   251.2 +++ b/src/share/vm/runtime/handles.cpp	Fri May 23 14:12:52 2014 -0700
   251.3 @@ -1,5 +1,5 @@
   251.4  /*
   251.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   251.6 + * Copyright (c) 1997, 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 @@ -41,6 +41,8 @@
  251.11  # include "os_bsd.inline.hpp"
  251.12  #endif
  251.13  
  251.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  251.15 +
  251.16  #ifdef ASSERT
  251.17  oop* HandleArea::allocate_handle(oop obj) {
  251.18    assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark");
   252.1 --- a/src/share/vm/runtime/interfaceSupport.cpp	Wed May 21 10:56:41 2014 -0700
   252.2 +++ b/src/share/vm/runtime/interfaceSupport.cpp	Fri May 23 14:12:52 2014 -0700
   252.3 @@ -1,5 +1,5 @@
   252.4  /*
   252.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
   252.6 + * Copyright (c) 1997, 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 @@ -34,6 +34,7 @@
  252.11  #include "runtime/vframe.hpp"
  252.12  #include "utilities/preserveException.hpp"
  252.13  
  252.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  252.15  
  252.16  // Implementation of InterfaceSupport
  252.17  
   253.1 --- a/src/share/vm/runtime/java.cpp	Wed May 21 10:56:41 2014 -0700
   253.2 +++ b/src/share/vm/runtime/java.cpp	Fri May 23 14:12:52 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 @@ -113,6 +113,7 @@
  253.11    }
  253.12  }
  253.13  
  253.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  253.15  
  253.16  GrowableArray<Method*>* collected_profiled_methods;
  253.17  
  253.18 @@ -367,7 +368,7 @@
  253.19        BaselineTTYOutputer outputer(tty);
  253.20        MemTracker::print_memory_usage(outputer, K, false);
  253.21      } else {
  253.22 -      tty->print_cr(MemTracker::reason());
  253.23 +      tty->print_cr("%s", MemTracker::reason());
  253.24      }
  253.25    }
  253.26  }
  253.27 @@ -404,7 +405,7 @@
  253.28        BaselineTTYOutputer outputer(tty);
  253.29        MemTracker::print_memory_usage(outputer, K, false);
  253.30      } else {
  253.31 -      tty->print_cr(MemTracker::reason());
  253.32 +      tty->print_cr("%s", MemTracker::reason());
  253.33      }
  253.34    }
  253.35  }
   254.1 --- a/src/share/vm/runtime/jniHandles.cpp	Wed May 21 10:56:41 2014 -0700
   254.2 +++ b/src/share/vm/runtime/jniHandles.cpp	Fri May 23 14:12:52 2014 -0700
   254.3 @@ -1,5 +1,5 @@
   254.4  /*
   254.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   254.6 + * Copyright (c) 1998, 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 @@ -30,6 +30,7 @@
  254.11  #include "runtime/mutexLocker.hpp"
  254.12  #include "runtime/thread.inline.hpp"
  254.13  
  254.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  254.15  
  254.16  JNIHandleBlock* JNIHandles::_global_handles       = NULL;
  254.17  JNIHandleBlock* JNIHandles::_weak_global_handles  = NULL;
   255.1 --- a/src/share/vm/runtime/mutex.cpp	Wed May 21 10:56:41 2014 -0700
   255.2 +++ b/src/share/vm/runtime/mutex.cpp	Fri May 23 14:12:52 2014 -0700
   255.3 @@ -1,6 +1,6 @@
   255.4  
   255.5  /*
   255.6 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   255.7 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
   255.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   255.9   *
  255.10   * This code is free software; you can redistribute it and/or modify it
  255.11 @@ -41,6 +41,8 @@
  255.12  # include "mutex_bsd.inline.hpp"
  255.13  #endif
  255.14  
  255.15 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  255.16 +
  255.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
  255.18  //
  255.19  // Native Monitor-Mutex locking - theory of operations
   256.1 --- a/src/share/vm/runtime/os.cpp	Wed May 21 10:56:41 2014 -0700
   256.2 +++ b/src/share/vm/runtime/os.cpp	Fri May 23 14:12:52 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 @@ -65,6 +65,8 @@
  256.11  
  256.12  # include <signal.h>
  256.13  
  256.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  256.15 +
  256.16  OSThread*         os::_starting_thread    = NULL;
  256.17  address           os::_polling_page       = NULL;
  256.18  volatile int32_t* os::_mem_serialize_page = NULL;
  256.19 @@ -909,9 +911,9 @@
  256.20  
  256.21      for (int i = 0; env_list[i] != NULL; i++) {
  256.22        if (getenv(env_list[i], buffer, len)) {
  256.23 -        st->print(env_list[i]);
  256.24 +        st->print("%s", env_list[i]);
  256.25          st->print("=");
  256.26 -        st->print_cr(buffer);
  256.27 +        st->print_cr("%s", buffer);
  256.28        }
  256.29      }
  256.30    }
  256.31 @@ -1095,11 +1097,15 @@
  256.32  
  256.33    }
  256.34  
  256.35 -  // Check if in metaspace.
  256.36 -  if (ClassLoaderDataGraph::contains((address)addr)) {
  256.37 -    // Use addr->print() from the debugger instead (not here)
  256.38 -    st->print_cr(INTPTR_FORMAT
  256.39 -                 " is pointing into metadata", addr);
  256.40 +  // Check if in metaspace and print types that have vptrs (only method now)
  256.41 +  if (Metaspace::contains(addr)) {
  256.42 +    if (Method::has_method_vptr((const void*)addr)) {
  256.43 +      ((Method*)addr)->print_value_on(st);
  256.44 +      st->cr();
  256.45 +    } else {
  256.46 +      // Use addr->print() from the debugger instead (not here)
  256.47 +      st->print_cr(INTPTR_FORMAT " is pointing into metadata", addr);
  256.48 +    }
  256.49      return;
  256.50    }
  256.51  
   257.1 --- a/src/share/vm/runtime/osThread.cpp	Wed May 21 10:56:41 2014 -0700
   257.2 +++ b/src/share/vm/runtime/osThread.cpp	Fri May 23 14:12:52 2014 -0700
   257.3 @@ -1,5 +1,5 @@
   257.4  /*
   257.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   257.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   257.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   257.8   *
   257.9   * This code is free software; you can redistribute it and/or modify it
  257.10 @@ -26,6 +26,7 @@
  257.11  #include "oops/oop.inline.hpp"
  257.12  #include "runtime/osThread.hpp"
  257.13  
  257.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  257.15  
  257.16  OSThread::OSThread(OSThreadStartFunc start_proc, void* start_parm) {
  257.17    pd_initialize();
   258.1 --- a/src/share/vm/runtime/perfData.cpp	Wed May 21 10:56:41 2014 -0700
   258.2 +++ b/src/share/vm/runtime/perfData.cpp	Fri May 23 14:12:52 2014 -0700
   258.3 @@ -1,5 +1,5 @@
   258.4  /*
   258.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   258.6 + * Copyright (c) 2001, 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 @@ -34,6 +34,8 @@
  258.11  #include "utilities/exceptions.hpp"
  258.12  #include "utilities/globalDefinitions.hpp"
  258.13  
  258.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  258.15 +
  258.16  PerfDataList*   PerfDataManager::_all = NULL;
  258.17  PerfDataList*   PerfDataManager::_sampled = NULL;
  258.18  PerfDataList*   PerfDataManager::_constants = NULL;
   259.1 --- a/src/share/vm/runtime/perfMemory.cpp	Wed May 21 10:56:41 2014 -0700
   259.2 +++ b/src/share/vm/runtime/perfMemory.cpp	Fri May 23 14:12:52 2014 -0700
   259.3 @@ -34,6 +34,8 @@
   259.4  #include "runtime/statSampler.hpp"
   259.5  #include "utilities/globalDefinitions.hpp"
   259.6  
   259.7 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
   259.8 +
   259.9  // Prefix of performance data file.
  259.10  const char               PERFDATA_NAME[] = "hsperfdata";
  259.11  
   260.1 --- a/src/share/vm/runtime/safepoint.cpp	Wed May 21 10:56:41 2014 -0700
   260.2 +++ b/src/share/vm/runtime/safepoint.cpp	Fri May 23 14:12:52 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 @@ -81,6 +81,8 @@
  260.11  #include "c1/c1_globals.hpp"
  260.12  #endif
  260.13  
  260.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  260.15 +
  260.16  // --------------------------------------------------------------------------------------------------
  260.17  // Implementation of Safepoint begin/end
  260.18  
  260.19 @@ -538,6 +540,13 @@
  260.20      gclog_or_tty->rotate_log(false);
  260.21    }
  260.22  
  260.23 +  {
  260.24 +    // CMS delays purging the CLDG until the beginning of the next safepoint and to
  260.25 +    // make sure concurrent sweep is done
  260.26 +    TraceTime t7("purging class loader data graph", TraceSafepointCleanupTime);
  260.27 +    ClassLoaderDataGraph::purge_if_needed();
  260.28 +  }
  260.29 +
  260.30    if (MemTracker::is_on()) {
  260.31      MemTracker::sync();
  260.32    }
  260.33 @@ -786,7 +795,7 @@
  260.34    old_sp += incr*32;  new_sp += incr*32;  was_oops += incr*32;
  260.35    for( int i2=0; i2<16; i2++ ) {
  260.36      tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); }
  260.37 -  tty->print_cr("");
  260.38 +  tty->cr();
  260.39  }
  260.40  #endif  // SPARC
  260.41  #endif  // PRODUCT
  260.42 @@ -828,7 +837,7 @@
  260.43      timeout_error_printed = true;
  260.44      // Print out the thread infor which didn't reach the safepoint for debugging
  260.45      // purposes (useful when there are lots of threads in the debugger).
  260.46 -    tty->print_cr("");
  260.47 +    tty->cr();
  260.48      tty->print_cr("# SafepointSynchronize::begin: Timeout detected:");
  260.49      if (reason ==  _spinning_timeout) {
  260.50        tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.");
  260.51 @@ -848,7 +857,7 @@
  260.52             (reason == _blocking_timeout && !cur_state->has_called_back()))) {
  260.53          tty->print("# ");
  260.54          cur_thread->print();
  260.55 -        tty->print_cr("");
  260.56 +        tty->cr();
  260.57        }
  260.58      }
  260.59      tty->print_cr("# SafepointSynchronize::begin: (End of list)");
  260.60 @@ -1321,7 +1330,7 @@
  260.61         spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
  260.62      print_statistics();
  260.63    }
  260.64 -  tty->print_cr("");
  260.65 +  tty->cr();
  260.66  
  260.67    // Print out polling page sampling status.
  260.68    if (!need_to_track_page_armed_status) {
   261.1 --- a/src/share/vm/runtime/safepoint.hpp	Wed May 21 10:56:41 2014 -0700
   261.2 +++ b/src/share/vm/runtime/safepoint.hpp	Fri May 23 14:12:52 2014 -0700
   261.3 @@ -1,5 +1,5 @@
   261.4  /*
   261.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   261.6 + * Copyright (c) 1997, 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 @@ -174,7 +174,7 @@
  261.11  
  261.12    // debugging
  261.13    static void print_state()                                PRODUCT_RETURN;
  261.14 -  static void safepoint_msg(const char* format, ...)       PRODUCT_RETURN;
  261.15 +  static void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(1, 2) PRODUCT_RETURN;
  261.16  
  261.17    static void deferred_initialize_stat();
  261.18    static void print_stat_on_exit();
  261.19 @@ -240,7 +240,7 @@
  261.20    static void create(JavaThread *thread);
  261.21    static void destroy(JavaThread *thread);
  261.22  
  261.23 -  void safepoint_msg(const char* format, ...) {
  261.24 +  void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
  261.25      if (ShowSafepointMsgs) {
  261.26        va_list ap;
  261.27        va_start(ap, format);
   262.1 --- a/src/share/vm/runtime/sharedRuntime.cpp	Wed May 21 10:56:41 2014 -0700
   262.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp	Fri May 23 14:12:52 2014 -0700
   262.3 @@ -1,5 +1,5 @@
   262.4  /*
   262.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   262.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   262.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   262.8   *
   262.9   * This code is free software; you can redistribute it and/or modify it
  262.10 @@ -82,6 +82,8 @@
  262.11  #include "c1/c1_Runtime1.hpp"
  262.12  #endif
  262.13  
  262.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  262.15 +
  262.16  // Shared stub locations
  262.17  RuntimeStub*        SharedRuntime::_wrong_method_blob;
  262.18  RuntimeStub*        SharedRuntime::_wrong_method_abstract_blob;
   263.1 --- a/src/share/vm/runtime/signature.cpp	Wed May 21 10:56:41 2014 -0700
   263.2 +++ b/src/share/vm/runtime/signature.cpp	Fri May 23 14:12:52 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 @@ -32,6 +32,7 @@
  263.11  #include "oops/typeArrayKlass.hpp"
  263.12  #include "runtime/signature.hpp"
  263.13  
  263.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  263.15  
  263.16  // Implementation of SignatureIterator
  263.17  
   264.1 --- a/src/share/vm/runtime/stackValue.cpp	Wed May 21 10:56:41 2014 -0700
   264.2 +++ b/src/share/vm/runtime/stackValue.cpp	Fri May 23 14:12:52 2014 -0700
   264.3 @@ -1,5 +1,5 @@
   264.4  /*
   264.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   264.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   264.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   264.8   *
   264.9   * This code is free software; you can redistribute it and/or modify it
  264.10 @@ -196,7 +196,7 @@
  264.11  
  264.12      case T_OBJECT:
  264.13       _o()->print_value_on(st);
  264.14 -      st->print(" <" INTPTR_FORMAT ">", (address)_o());
  264.15 +      st->print(" <" INTPTR_FORMAT ">", p2i((address)_o()));
  264.16       break;
  264.17  
  264.18      case T_CONFLICT:
   265.1 --- a/src/share/vm/runtime/stackValueCollection.cpp	Wed May 21 10:56:41 2014 -0700
   265.2 +++ b/src/share/vm/runtime/stackValueCollection.cpp	Fri May 23 14:12:52 2014 -0700
   265.3 @@ -1,5 +1,5 @@
   265.4  /*
   265.5 - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
   265.6 + * Copyright (c) 2001, 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 @@ -40,6 +40,8 @@
  265.11  # include "jniTypes_ppc.hpp"
  265.12  #endif
  265.13  
  265.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  265.15 +
  265.16  jint StackValueCollection::int_at(int slot) const {
  265.17    intptr_t val =  at(slot)->get_int();
  265.18    jint ival = *((jint*) (&val));
   266.1 --- a/src/share/vm/runtime/stubCodeGenerator.cpp	Wed May 21 10:56:41 2014 -0700
   266.2 +++ b/src/share/vm/runtime/stubCodeGenerator.cpp	Fri May 23 14:12:52 2014 -0700
   266.3 @@ -1,5 +1,5 @@
   266.4  /*
   266.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   266.6 + * Copyright (c) 1997, 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 @@ -60,10 +60,10 @@
  266.11  
  266.12  
  266.13  void StubCodeDesc::print_on(outputStream* st) const {
  266.14 -  st->print(group());
  266.15 +  st->print("%s", group());
  266.16    st->print("::");
  266.17 -  st->print(name());
  266.18 -  st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes());
  266.19 +  st->print("%s", name());
  266.20 +  st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", p2i(begin()), p2i(end()), size_in_bytes());
  266.21  }
  266.22  
  266.23  // Implementation of StubCodeGenerator
   267.1 --- a/src/share/vm/runtime/sweeper.cpp	Wed May 21 10:56:41 2014 -0700
   267.2 +++ b/src/share/vm/runtime/sweeper.cpp	Fri May 23 14:12:52 2014 -0700
   267.3 @@ -1,5 +1,5 @@
   267.4  /*
   267.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   267.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   267.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   267.8   *
   267.9   * This code is free software; you can redistribute it and/or modify it
  267.10 @@ -41,6 +41,8 @@
  267.11  #include "utilities/ticks.inline.hpp"
  267.12  #include "utilities/xmlstream.hpp"
  267.13  
  267.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  267.15 +
  267.16  #ifdef ASSERT
  267.17  
  267.18  #define SWEEP(nm) record_sweep(nm, __LINE__)
  267.19 @@ -625,7 +627,7 @@
  267.20        tty->vprint(format, ap);
  267.21        va_end(ap);
  267.22      }
  267.23 -    tty->print_cr(s.as_string());
  267.24 +    tty->print_cr("%s", s.as_string());
  267.25    }
  267.26  
  267.27    if (LogCompilation && (xtty != NULL)) {
  267.28 @@ -642,7 +644,7 @@
  267.29        xtty->vprint(format, ap);
  267.30        va_end(ap);
  267.31      }
  267.32 -    xtty->print(s.as_string());
  267.33 +    xtty->print("%s", s.as_string());
  267.34      xtty->stamp();
  267.35      xtty->end_elem();
  267.36    }
   268.1 --- a/src/share/vm/runtime/sweeper.hpp	Wed May 21 10:56:41 2014 -0700
   268.2 +++ b/src/share/vm/runtime/sweeper.hpp	Fri May 23 14:12:52 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 @@ -94,7 +94,7 @@
  268.11    static const Tickspan total_time_sweeping()      { return _total_time_sweeping; }
  268.12    static const Tickspan peak_sweep_time()          { return _peak_sweep_time; }
  268.13    static const Tickspan peak_sweep_fraction_time() { return _peak_sweep_fraction_time; }
  268.14 -  static void log_sweep(const char* msg, const char* format = NULL, ...);
  268.15 +  static void log_sweep(const char* msg, const char* format = NULL, ...) ATTRIBUTE_PRINTF(2, 3);
  268.16  
  268.17  
  268.18  #ifdef ASSERT
   269.1 --- a/src/share/vm/runtime/synchronizer.cpp	Wed May 21 10:56:41 2014 -0700
   269.2 +++ b/src/share/vm/runtime/synchronizer.cpp	Fri May 23 14:12:52 2014 -0700
   269.3 @@ -1,5 +1,5 @@
   269.4  /*
   269.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   269.6 + * Copyright (c) 1998, 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 @@ -60,6 +60,8 @@
  269.11    #define ATTR
  269.12  #endif
  269.13  
  269.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  269.15 +
  269.16  // The "core" versions of monitor enter and exit reside in this file.
  269.17  // The interpreter and compilers contain specialized transliterated
  269.18  // variants of the enter-exit fast-path operations.  See i486.ad fast_lock(),
   270.1 --- a/src/share/vm/runtime/thread.cpp	Wed May 21 10:56:41 2014 -0700
   270.2 +++ b/src/share/vm/runtime/thread.cpp	Fri May 23 14:12:52 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 @@ -111,6 +111,8 @@
  270.11  #include "runtime/rtmLocking.hpp"
  270.12  #endif
  270.13  
  270.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  270.15 +
  270.16  #ifdef DTRACE_ENABLED
  270.17  
  270.18  // Only bother with this argument setup if dtrace is available
  270.19 @@ -4318,7 +4320,7 @@
  270.20  // Threads::print_on() is called at safepoint by VM_PrintThreads operation.
  270.21  void Threads::print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks) {
  270.22    char buf[32];
  270.23 -  st->print_cr(os::local_time_string(buf, sizeof(buf)));
  270.24 +  st->print_cr("%s", os::local_time_string(buf, sizeof(buf)));
  270.25  
  270.26    st->print_cr("Full thread dump %s (%s %s):",
  270.27                  Abstract_VM_Version::vm_name(),
   271.1 --- a/src/share/vm/runtime/thread.hpp	Wed May 21 10:56:41 2014 -0700
   271.2 +++ b/src/share/vm/runtime/thread.hpp	Fri May 23 14:12:52 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 @@ -695,7 +695,7 @@
  271.11    NamedThread();
  271.12    ~NamedThread();
  271.13    // May only be called once per thread.
  271.14 -  void set_name(const char* format, ...);
  271.15 +  void set_name(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3);
  271.16    virtual bool is_Named_thread() const { return true; }
  271.17    virtual char* name() const { return _name == NULL ? (char*)"Unknown Thread" : _name; }
  271.18    JavaThread *processed_thread() { return _processed_thread; }
   272.1 --- a/src/share/vm/runtime/timer.cpp	Wed May 21 10:56:41 2014 -0700
   272.2 +++ b/src/share/vm/runtime/timer.cpp	Fri May 23 14:12:52 2014 -0700
   272.3 @@ -1,5 +1,5 @@
   272.4  /*
   272.5 - * Copyright (c) 1997, 2013, 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 @@ -204,7 +204,7 @@
  272.11        _logfile->print("[Error in TraceCPUTime]");
  272.12      }
  272.13      if (_print_cr) {
  272.14 -      _logfile->print_cr("");
  272.15 +      _logfile->cr();
  272.16      }
  272.17      _logfile->flush();
  272.18    }
   273.1 --- a/src/share/vm/runtime/unhandledOops.cpp	Wed May 21 10:56:41 2014 -0700
   273.2 +++ b/src/share/vm/runtime/unhandledOops.cpp	Fri May 23 14:12:52 2014 -0700
   273.3 @@ -1,5 +1,5 @@
   273.4  /*
   273.5 - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
   273.6 + * Copyright (c) 2005, 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 @@ -31,6 +31,8 @@
  273.11  #include "runtime/unhandledOops.hpp"
  273.12  #include "utilities/globalDefinitions.hpp"
  273.13  
  273.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  273.15 +
  273.16  #ifdef CHECK_UNHANDLED_OOPS
  273.17  const int free_list_size = 256;
  273.18  
   274.1 --- a/src/share/vm/runtime/vframe.cpp	Wed May 21 10:56:41 2014 -0700
   274.2 +++ b/src/share/vm/runtime/vframe.cpp	Fri May 23 14:12:52 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 @@ -46,6 +46,8 @@
  274.11  #include "runtime/vframeArray.hpp"
  274.12  #include "runtime/vframe_hp.hpp"
  274.13  
  274.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  274.15 +
  274.16  vframe::vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
  274.17  : _reg_map(reg_map), _thread(thread) {
  274.18    assert(fr != NULL, "must have frame");
   275.1 --- a/src/share/vm/runtime/vframe.hpp	Wed May 21 10:56:41 2014 -0700
   275.2 +++ b/src/share/vm/runtime/vframe.hpp	Fri May 23 14:12:52 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 @@ -399,7 +399,7 @@
  275.11      if (WizardMode) {
  275.12        tty->print_cr("Error in fill_from_frame: pc_desc for "
  275.13                      INTPTR_FORMAT " not found or invalid at %d",
  275.14 -                    _frame.pc(), decode_offset);
  275.15 +                    p2i(_frame.pc()), decode_offset);
  275.16        nm()->print();
  275.17        nm()->method()->print_codes();
  275.18        nm()->print_code();
   276.1 --- a/src/share/vm/runtime/vframeArray.cpp	Wed May 21 10:56:41 2014 -0700
   276.2 +++ b/src/share/vm/runtime/vframeArray.cpp	Fri May 23 14:12:52 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 @@ -43,6 +43,7 @@
  276.11  #include "opto/runtime.hpp"
  276.12  #endif
  276.13  
  276.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  276.15  
  276.16  int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); }
  276.17  
   277.1 --- a/src/share/vm/runtime/virtualspace.cpp	Wed May 21 10:56:41 2014 -0700
   277.2 +++ b/src/share/vm/runtime/virtualspace.cpp	Fri May 23 14:12:52 2014 -0700
   277.3 @@ -1,5 +1,5 @@
   277.4  /*
   277.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   277.6 + * Copyright (c) 1997, 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 @@ -43,6 +43,7 @@
  277.11  # include "os_bsd.inline.hpp"
  277.12  #endif
  277.13  
  277.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  277.15  
  277.16  // ReservedSpace
  277.17  
   278.1 --- a/src/share/vm/runtime/vmThread.cpp	Wed May 21 10:56:41 2014 -0700
   278.2 +++ b/src/share/vm/runtime/vmThread.cpp	Fri May 23 14:12:52 2014 -0700
   278.3 @@ -1,5 +1,5 @@
   278.4  /*
   278.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   278.6 + * Copyright (c) 1998, 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 @@ -46,6 +46,8 @@
  278.11  HS_DTRACE_PROBE_DECL3(hotspot, vmops__end, char *, uintptr_t, int);
  278.12  #endif /* !USDT2 */
  278.13  
  278.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  278.15 +
  278.16  // Dummy VM operation to act as first element in our circular double-linked list
  278.17  class VM_Dummy: public VM_Operation {
  278.18    VMOp_Type type() const { return VMOp_Dummy; }
   279.1 --- a/src/share/vm/runtime/vm_operations.cpp	Wed May 21 10:56:41 2014 -0700
   279.2 +++ b/src/share/vm/runtime/vm_operations.cpp	Fri May 23 14:12:52 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 @@ -39,6 +39,8 @@
  279.11  #include "services/threadService.hpp"
  279.12  #include "trace/tracing.hpp"
  279.13  
  279.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  279.15 +
  279.16  #define VM_OP_NAME_INITIALIZE(name) #name,
  279.17  
  279.18  const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \
   280.1 --- a/src/share/vm/services/attachListener.cpp	Wed May 21 10:56:41 2014 -0700
   280.2 +++ b/src/share/vm/services/attachListener.cpp	Fri May 23 14:12:52 2014 -0700
   280.3 @@ -1,5 +1,5 @@
   280.4  /*
   280.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   280.6 + * Copyright (c) 2005, 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 @@ -284,15 +284,15 @@
  280.11    }
  280.12  
  280.13    if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {
  280.14 -    FormatBuffer<80> err_msg("");
  280.15 +    FormatBuffer<80> err_msg("%s", "");
  280.16      if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) {
  280.17 -      out->print_cr(err_msg.buffer());
  280.18 +      out->print_cr("%s", err_msg.buffer());
  280.19        return JNI_ERR;
  280.20      }
  280.21    } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) {
  280.22 -    FormatBuffer<80> err_msg("");
  280.23 +    FormatBuffer<80> err_msg("%s", "");
  280.24      if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) {
  280.25 -      out->print_cr(err_msg.buffer());
  280.26 +      out->print_cr("%s", err_msg.buffer());
  280.27        return JNI_ERR;
  280.28      }
  280.29    }
  280.30 @@ -381,7 +381,7 @@
  280.31    Flag* f = Flag::find_flag((char*)name, strlen(name));
  280.32    if (f) {
  280.33      f->print_as_flag(out);
  280.34 -    out->print_cr("");
  280.35 +    out->cr();
  280.36    } else {
  280.37      out->print_cr("no such flag '%s'", name);
  280.38    }
   281.1 --- a/src/share/vm/services/classLoadingService.cpp	Wed May 21 10:56:41 2014 -0700
   281.2 +++ b/src/share/vm/services/classLoadingService.cpp	Fri May 23 14:12:52 2014 -0700
   281.3 @@ -1,5 +1,5 @@
   281.4  /*
   281.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   281.6 + * Copyright (c) 2003, 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 @@ -157,7 +157,7 @@
  281.11  
  281.12    if (TraceClassUnloading) {
  281.13      ResourceMark rm;
  281.14 -    tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), k);
  281.15 +    tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), p2i(k));
  281.16    }
  281.17  }
  281.18  
   282.1 --- a/src/share/vm/services/diagnosticCommand.cpp	Wed May 21 10:56:41 2014 -0700
   282.2 +++ b/src/share/vm/services/diagnosticCommand.cpp	Fri May 23 14:12:52 2014 -0700
   282.3 @@ -1,5 +1,5 @@
   282.4  /*
   282.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
   282.6 + * Copyright (c) 2011, 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 @@ -32,6 +32,8 @@
  282.11  #include "services/management.hpp"
  282.12  #include "utilities/macros.hpp"
  282.13  
  282.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  282.15 +
  282.16  void DCmdRegistrant::register_dcmds(){
  282.17    // Registration of the diagnostic commands
  282.18    // First argument specifies which interfaces will export the command
  282.19 @@ -99,7 +101,7 @@
  282.20      if (factory != NULL) {
  282.21        output()->print_cr("%s%s", factory->name(),
  282.22                           factory->is_enabled() ? "" : " [disabled]");
  282.23 -      output()->print_cr(factory->description());
  282.24 +      output()->print_cr("%s", factory->description());
  282.25        output()->print_cr("\nImpact: %s", factory->impact());
  282.26        JavaPermission p = factory->permission();
  282.27        if(p._class != NULL) {
   283.1 --- a/src/share/vm/services/diagnosticFramework.cpp	Wed May 21 10:56:41 2014 -0700
   283.2 +++ b/src/share/vm/services/diagnosticFramework.cpp	Fri May 23 14:12:52 2014 -0700
   283.3 @@ -1,5 +1,5 @@
   283.4  /*
   283.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
   283.6 + * Copyright (c) 2011, 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 @@ -259,7 +259,7 @@
  283.11      }
  283.12      arg = arg->next();
  283.13    }
  283.14 -  out->print_cr("");
  283.15 +  out->cr();
  283.16    if (_arguments_list != NULL) {
  283.17      out->print_cr("\nArguments:");
  283.18      arg = _arguments_list;
  283.19 @@ -268,7 +268,7 @@
  283.20                   arg->is_mandatory() ? "" : "[optional]",
  283.21                   arg->description(), arg->type());
  283.22        if (arg->has_default()) {
  283.23 -        out->print(arg->default_string());
  283.24 +        out->print("%s", arg->default_string());
  283.25        } else {
  283.26          out->print("no default value");
  283.27        }
  283.28 @@ -284,7 +284,7 @@
  283.29                   arg->is_mandatory() ? "" : "[optional]",
  283.30                   arg->description(), arg->type());
  283.31        if (arg->has_default()) {
  283.32 -        out->print(arg->default_string());
  283.33 +        out->print("%s", arg->default_string());
  283.34        } else {
  283.35          out->print("no default value");
  283.36        }
   284.1 --- a/src/share/vm/services/heapDumper.cpp	Wed May 21 10:56:41 2014 -0700
   284.2 +++ b/src/share/vm/services/heapDumper.cpp	Fri May 23 14:12:52 2014 -0700
   284.3 @@ -1,5 +1,5 @@
   284.4  /*
   284.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
   284.6 + * Copyright (c) 2005, 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 @@ -1830,6 +1830,7 @@
  284.11  }
  284.12  
  284.13  // dump the heap to given path.
  284.14 +PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  284.15  int HeapDumper::dump(const char* path) {
  284.16    assert(path != NULL && strlen(path) > 0, "path missing");
  284.17  
  284.18 @@ -1870,7 +1871,10 @@
  284.19        char msg[256];
  284.20        sprintf(msg, "Heap dump file created [%s bytes in %3.3f secs]",
  284.21          JLONG_FORMAT, timer()->seconds());
  284.22 +PRAGMA_DIAG_PUSH
  284.23 +PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  284.24        tty->print_cr(msg, writer.bytes_written());
  284.25 +PRAGMA_DIAG_POP
  284.26      } else {
  284.27        tty->print_cr("Dump file is incomplete: %s", writer.error());
  284.28      }
   285.1 --- a/src/share/vm/services/lowMemoryDetector.cpp	Wed May 21 10:56:41 2014 -0700
   285.2 +++ b/src/share/vm/services/lowMemoryDetector.cpp	Fri May 23 14:12:52 2014 -0700
   285.3 @@ -1,5 +1,5 @@
   285.4  /*
   285.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   285.6 + * Copyright (c) 2003, 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 @@ -353,7 +353,7 @@
  285.11  
  285.12  #ifndef PRODUCT
  285.13  void SensorInfo::print() {
  285.14 -  tty->print_cr("%s count = " SIZE_FORMAT " pending_triggers = %ld pending_clears = %ld",
  285.15 +  tty->print_cr("%s count = " SIZE_FORMAT " pending_triggers = %d pending_clears = %d",
  285.16                  (_sensor_on ? "on" : "off"),
  285.17                  _sensor_count, _pending_trigger_count, _pending_clear_count);
  285.18  }
   286.1 --- a/src/share/vm/services/management.cpp	Wed May 21 10:56:41 2014 -0700
   286.2 +++ b/src/share/vm/services/management.cpp	Fri May 23 14:12:52 2014 -0700
   286.3 @@ -1,5 +1,5 @@
   286.4  /*
   286.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   286.6 + * Copyright (c) 2003, 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 @@ -55,6 +55,8 @@
  286.11  #include "services/threadService.hpp"
  286.12  #include "utilities/macros.hpp"
  286.13  
  286.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  286.15 +
  286.16  PerfVariable* Management::_begin_vm_creation_time = NULL;
  286.17  PerfVariable* Management::_end_vm_creation_time = NULL;
  286.18  PerfVariable* Management::_vm_init_done_time = NULL;
  286.19 @@ -1832,12 +1834,12 @@
  286.20      uintx uvalue = (uintx)new_value.j;
  286.21  
  286.22      if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {
  286.23 -      FormatBuffer<80> err_msg("");
  286.24 +      FormatBuffer<80> err_msg("%s", "");
  286.25        if (!Arguments::verify_MaxHeapFreeRatio(err_msg, uvalue)) {
  286.26          THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer());
  286.27        }
  286.28      } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) {
  286.29 -      FormatBuffer<80> err_msg("");
  286.30 +      FormatBuffer<80> err_msg("%s", "");
  286.31        if (!Arguments::verify_MinHeapFreeRatio(err_msg, uvalue)) {
  286.32          THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer());
  286.33        }
   287.1 --- a/src/share/vm/services/memReporter.cpp	Wed May 21 10:56:41 2014 -0700
   287.2 +++ b/src/share/vm/services/memReporter.cpp	Fri May 23 14:12:52 2014 -0700
   287.3 @@ -1,5 +1,5 @@
   287.4  /*
   287.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   287.6 + * Copyright (c) 2012, 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 @@ -28,6 +28,8 @@
  287.11  #include "services/memPtrArray.hpp"
  287.12  #include "services/memTracker.hpp"
  287.13  
  287.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  287.15 +
  287.16  const char* BaselineOutputer::memory_unit(size_t scale) {
  287.17    switch(scale) {
  287.18      case K: return "KB";
   288.1 --- a/src/share/vm/services/memSnapshot.cpp	Wed May 21 10:56:41 2014 -0700
   288.2 +++ b/src/share/vm/services/memSnapshot.cpp	Fri May 23 14:12:52 2014 -0700
   288.3 @@ -1,5 +1,5 @@
   288.4  /*
   288.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   288.6 + * Copyright (c) 2012, 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 @@ -31,6 +31,8 @@
  288.11  #include "services/memSnapshot.hpp"
  288.12  #include "services/memTracker.hpp"
  288.13  
  288.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  288.15 +
  288.16  #ifdef ASSERT
  288.17  
  288.18  void decode_pointer_record(MemPointerRecord* rec) {
  288.19 @@ -733,7 +735,7 @@
  288.20          if (os::dll_address_to_function_name(ex->pc(), buf, sizeof(buf), NULL)) {
  288.21            tty->print_cr("\t%s", buf);
  288.22          } else {
  288.23 -          tty->print_cr("");
  288.24 +          tty->cr();
  288.25          }
  288.26        }
  288.27      }
   289.1 --- a/src/share/vm/services/memTrackWorker.cpp	Wed May 21 10:56:41 2014 -0700
   289.2 +++ b/src/share/vm/services/memTrackWorker.cpp	Fri May 23 14:12:52 2014 -0700
   289.3 @@ -1,5 +1,5 @@
   289.4  /*
   289.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
   289.6 + * Copyright (c) 2013, 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 @@ -43,7 +43,7 @@
  289.11    // create thread uses cgc thread type for now. We should revisit
  289.12    // the option, or create new thread type.
  289.13    _has_error = !os::create_thread(this, os::cgc_thread);
  289.14 -  set_name("MemTrackWorker", 0);
  289.15 +  set_name("MemTrackWorker");
  289.16  
  289.17    // initial generation circuit buffer
  289.18    if (!has_error()) {
   290.1 --- a/src/share/vm/services/nmtDCmd.cpp	Wed May 21 10:56:41 2014 -0700
   290.2 +++ b/src/share/vm/services/nmtDCmd.cpp	Fri May 23 14:12:52 2014 -0700
   290.3 @@ -1,5 +1,5 @@
   290.4  /*
   290.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   290.6 + * Copyright (c) 2012, 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 @@ -128,7 +128,7 @@
  290.11    // native memory tracking has to be on
  290.12    if (!MemTracker::is_on() || MemTracker::shutdown_in_progress()) {
  290.13      // if it is not on, what's the reason?
  290.14 -    output()->print_cr(MemTracker::reason());
  290.15 +    output()->print_cr("%s", MemTracker::reason());
  290.16      return;
  290.17    }
  290.18  
   291.1 --- a/src/share/vm/services/threadService.cpp	Wed May 21 10:56:41 2014 -0700
   291.2 +++ b/src/share/vm/services/threadService.cpp	Fri May 23 14:12:52 2014 -0700
   291.3 @@ -1,5 +1,5 @@
   291.4  /*
   291.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   291.6 + * Copyright (c) 2003, 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 @@ -37,6 +37,8 @@
  291.11  #include "runtime/vm_operations.hpp"
  291.12  #include "services/threadService.hpp"
  291.13  
  291.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  291.15 +
  291.16  // TODO: we need to define a naming convention for perf counters
  291.17  // to distinguish counters for:
  291.18  //   - standard JSR174 use
   292.1 --- a/src/share/vm/trace/traceStream.hpp	Wed May 21 10:56:41 2014 -0700
   292.2 +++ b/src/share/vm/trace/traceStream.hpp	Fri May 23 14:12:52 2014 -0700
   292.3 @@ -1,5 +1,5 @@
   292.4  /*
   292.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   292.6 + * Copyright (c) 2012, 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 @@ -66,7 +66,7 @@
  292.11    }
  292.12  
  292.13    void print_val(const char* label, s8 val) {
  292.14 -    _st.print("%s = "INT64_FORMAT, label, val);
  292.15 +    _st.print("%s = "INT64_FORMAT, label, (int64_t) val);
  292.16    }
  292.17  
  292.18    void print_val(const char* label, bool val) {
  292.19 @@ -113,7 +113,7 @@
  292.20    }
  292.21  
  292.22    void print(const char* val) {
  292.23 -    _st.print(val);
  292.24 +    _st.print("%s", val);
  292.25    }
  292.26  };
  292.27  
   293.1 --- a/src/share/vm/utilities/array.hpp	Wed May 21 10:56:41 2014 -0700
   293.2 +++ b/src/share/vm/utilities/array.hpp	Fri May 23 14:12:52 2014 -0700
   293.3 @@ -375,7 +375,7 @@
   293.4  
   293.5    // FIXME: How to handle this?
   293.6    void print_value_on(outputStream* st) const {
   293.7 -    st->print("Array<T>(" INTPTR_FORMAT ")", this);
   293.8 +    st->print("Array<T>(" INTPTR_FORMAT ")", p2i(this));
   293.9    }
  293.10  
  293.11  #ifndef PRODUCT
   294.1 --- a/src/share/vm/utilities/bitMap.cpp	Wed May 21 10:56:41 2014 -0700
   294.2 +++ b/src/share/vm/utilities/bitMap.cpp	Fri May 23 14:12:52 2014 -0700
   294.3 @@ -1,5 +1,5 @@
   294.4  /*
   294.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   294.6 + * Copyright (c) 1997, 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 @@ -523,13 +523,13 @@
  294.11  
  294.12  void BitMap::print_on_error(outputStream* st, const char* prefix) const {
  294.13    st->print_cr("%s[" PTR_FORMAT ", " PTR_FORMAT ")",
  294.14 -      prefix, map(), (char*)map() + (size() >> LogBitsPerByte));
  294.15 +      prefix, p2i(map()), p2i((char*)map() + (size() >> LogBitsPerByte)));
  294.16  }
  294.17  
  294.18  #ifndef PRODUCT
  294.19  
  294.20  void BitMap::print_on(outputStream* st) const {
  294.21 -  tty->print("Bitmap(%d):", size());
  294.22 +  tty->print("Bitmap(" SIZE_FORMAT "):", size());
  294.23    for (idx_t index = 0; index < size(); index++) {
  294.24      tty->print("%c", at(index) ? '1' : '0');
  294.25    }
   295.1 --- a/src/share/vm/utilities/constantTag.cpp	Wed May 21 10:56:41 2014 -0700
   295.2 +++ b/src/share/vm/utilities/constantTag.cpp	Fri May 23 14:12:52 2014 -0700
   295.3 @@ -1,5 +1,5 @@
   295.4  /*
   295.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   295.6 + * Copyright (c) 1997, 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,7 +28,7 @@
  295.11  #ifndef PRODUCT
  295.12  
  295.13  void constantTag::print_on(outputStream* st) const {
  295.14 -  st->print(internal_name());
  295.15 +  st->print("%s", internal_name());
  295.16  }
  295.17  
  295.18  #endif // PRODUCT
   296.1 --- a/src/share/vm/utilities/debug.cpp	Wed May 21 10:56:41 2014 -0700
   296.2 +++ b/src/share/vm/utilities/debug.cpp	Fri May 23 14:12:52 2014 -0700
   296.3 @@ -1,5 +1,5 @@
   296.4  /*
   296.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   296.6 + * Copyright (c) 1997, 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 @@ -88,6 +88,8 @@
  296.11  #  endif
  296.12  #endif // PRODUCT
  296.13  
  296.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  296.15 +
  296.16  FormatBufferResource::FormatBufferResource(const char * format, ...)
  296.17    : FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) {
  296.18    va_list argp;
  296.19 @@ -96,6 +98,7 @@
  296.20    va_end(argp);
  296.21  }
  296.22  
  296.23 +ATTRIBUTE_PRINTF(1, 2)
  296.24  void warning(const char* format, ...) {
  296.25    if (PrintWarnings) {
  296.26      FILE* const err = defaultStream::error_stream();
   297.1 --- a/src/share/vm/utilities/debug.hpp	Wed May 21 10:56:41 2014 -0700
   297.2 +++ b/src/share/vm/utilities/debug.hpp	Fri May 23 14:12:52 2014 -0700
   297.3 @@ -1,5 +1,5 @@
   297.4  /*
   297.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   297.6 + * Copyright (c) 1997, 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,17 +43,17 @@
  297.11  #define RES_BUFSZ 256
  297.12  class FormatBufferResource : public FormatBufferBase {
  297.13   public:
  297.14 -  FormatBufferResource(const char * format, ...);
  297.15 +  FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
  297.16  };
  297.17  
  297.18  // Use stack for buffer
  297.19  template <size_t bufsz = 256>
  297.20  class FormatBuffer : public FormatBufferBase {
  297.21   public:
  297.22 -  inline FormatBuffer(const char * format, ...);
  297.23 -  inline void append(const char* format, ...);
  297.24 -  inline void print(const char* format, ...);
  297.25 -  inline void printv(const char* format, va_list ap);
  297.26 +  inline FormatBuffer(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
  297.27 +  inline void append(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3);
  297.28 +  inline void print(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3);
  297.29 +  inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
  297.30  
  297.31    char* buffer() { return _buf; }
  297.32    int size() { return bufsz; }
  297.33 @@ -223,7 +223,7 @@
  297.34  void report_unimplemented(const char* file, int line);
  297.35  void report_untested(const char* file, int line, const char* message);
  297.36  
  297.37 -void warning(const char* format, ...);
  297.38 +void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2);
  297.39  
  297.40  #ifdef ASSERT
  297.41  // Compile-time asserts.
   298.1 --- a/src/share/vm/utilities/events.cpp	Wed May 21 10:56:41 2014 -0700
   298.2 +++ b/src/share/vm/utilities/events.cpp	Fri May 23 14:12:52 2014 -0700
   298.3 @@ -1,5 +1,5 @@
   298.4  /*
   298.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   298.6 + * Copyright (c) 1997, 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 @@ -82,7 +82,7 @@
  298.11      va_start(ap, format);
  298.12      // Save a copy of begin message and log it.
  298.13      _buffer.printv(format, ap);
  298.14 -    Events::log(NULL, _buffer);
  298.15 +    Events::log(NULL, "%s", _buffer.buffer());
  298.16      va_end(ap);
  298.17    }
  298.18  }
  298.19 @@ -91,6 +91,6 @@
  298.20    if (LogEvents) {
  298.21      // Append " done" to the begin message and log it
  298.22      _buffer.append(" done");
  298.23 -    Events::log(NULL, _buffer);
  298.24 +    Events::log(NULL, "%s", _buffer.buffer());
  298.25    }
  298.26  }
   299.1 --- a/src/share/vm/utilities/events.hpp	Wed May 21 10:56:41 2014 -0700
   299.2 +++ b/src/share/vm/utilities/events.hpp	Fri May 23 14:12:52 2014 -0700
   299.3 @@ -1,5 +1,5 @@
   299.4  /*
   299.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   299.6 + * Copyright (c) 1997, 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 @@ -128,7 +128,7 @@
  299.11    void print(outputStream* out, EventRecord<T>& e) {
  299.12      out->print("Event: %.3f ", e.timestamp);
  299.13      if (e.thread != NULL) {
  299.14 -      out->print("Thread " INTPTR_FORMAT " ", e.thread);
  299.15 +      out->print("Thread " INTPTR_FORMAT " ", p2i(e.thread));
  299.16      }
  299.17      print(out, e.data);
  299.18    }
  299.19 @@ -148,7 +148,7 @@
  299.20   public:
  299.21    StringEventLog(const char* name, int count = LogEventsBufferEntries) : EventLogBase<StringLogMessage>(name, count) {}
  299.22  
  299.23 -  void logv(Thread* thread, const char* format, va_list ap) {
  299.24 +  void logv(Thread* thread, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0) {
  299.25      if (!should_log()) return;
  299.26  
  299.27      double timestamp = fetch_timestamp();
  299.28 @@ -159,7 +159,7 @@
  299.29      _records[index].data.printv(format, ap);
  299.30    }
  299.31  
  299.32 -  void log(Thread* thread, const char* format, ...) {
  299.33 +  void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(3, 4) {
  299.34      va_list ap;
  299.35      va_start(ap, format);
  299.36      logv(thread, format, ap);
  299.37 @@ -193,18 +193,17 @@
  299.38    static void print();
  299.39  
  299.40    // Logs a generic message with timestamp and format as printf.
  299.41 -  static void log(Thread* thread, const char* format, ...);
  299.42 +  static void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  299.43  
  299.44    // Log exception related message
  299.45 -  static void log_exception(Thread* thread, const char* format, ...);
  299.46 +  static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  299.47  
  299.48 -  static void log_deopt_message(Thread* thread, const char* format, ...);
  299.49 +  static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  299.50  
  299.51    // Register default loggers
  299.52    static void init();
  299.53  };
  299.54  
  299.55 -
  299.56  inline void Events::log(Thread* thread, const char* format, ...) {
  299.57    if (LogEvents) {
  299.58      va_list ap;
  299.59 @@ -283,7 +282,7 @@
  299.60  
  299.61   public:
  299.62    // log a begin event, format as printf
  299.63 -  EventMark(const char* format, ...);
  299.64 +  EventMark(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  299.65    // log an end event
  299.66    ~EventMark();
  299.67  };
   300.1 --- a/src/share/vm/utilities/exceptions.cpp	Wed May 21 10:56:41 2014 -0700
   300.2 +++ b/src/share/vm/utilities/exceptions.cpp	Fri May 23 14:12:52 2014 -0700
   300.3 @@ -1,5 +1,5 @@
   300.4  /*
   300.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   300.6 + * Copyright (c) 1998, 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 @@ -35,6 +35,7 @@
  300.11  #include "utilities/events.hpp"
  300.12  #include "utilities/exceptions.hpp"
  300.13  
  300.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  300.15  
  300.16  // Implementation of ThreadShadow
  300.17  void check_ThreadShadow() {
  300.18 @@ -237,6 +238,7 @@
  300.19    _throw_msg(thread, file, line, h_name, msg);
  300.20  }
  300.21  
  300.22 +
  300.23  // Creates an exception oop, calls the <init> method with the given signature.
  300.24  // and returns a Handle
  300.25  Handle Exceptions::new_exception(Thread *thread, Symbol* name,
   301.1 --- a/src/share/vm/utilities/exceptions.hpp	Wed May 21 10:56:41 2014 -0700
   301.2 +++ b/src/share/vm/utilities/exceptions.hpp	Fri May 23 14:12:52 2014 -0700
   301.3 @@ -1,5 +1,5 @@
   301.4  /*
   301.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   301.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
   301.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   301.8   *
   301.9   * This code is free software; you can redistribute it and/or modify it
  301.10 @@ -132,7 +132,7 @@
  301.11    // There is no THROW... macro for this method. Caller should remember
  301.12    // to do a return after calling it.
  301.13    static void fthrow(Thread* thread, const char* file, int line, Symbol* name,
  301.14 -                     const char* format, ...);
  301.15 +                     const char* format, ...) ATTRIBUTE_PRINTF(5, 6);
  301.16  
  301.17    // Create and initialize a new exception
  301.18    static Handle new_exception(Thread* thread, Symbol* name,
   302.1 --- a/src/share/vm/utilities/globalDefinitions.hpp	Wed May 21 10:56:41 2014 -0700
   302.2 +++ b/src/share/vm/utilities/globalDefinitions.hpp	Fri May 23 14:12:52 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 @@ -42,6 +42,32 @@
  302.11  # include "utilities/globalDefinitions_xlc.hpp"
  302.12  #endif
  302.13  
  302.14 +#ifndef PRAGMA_DIAG_PUSH
  302.15 +#define PRAGMA_DIAG_PUSH
  302.16 +#endif
  302.17 +#ifndef PRAGMA_DIAG_POP
  302.18 +#define PRAGMA_DIAG_POP
  302.19 +#endif
  302.20 +#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED
  302.21 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED
  302.22 +#endif
  302.23 +#ifndef PRAGMA_FORMAT_IGNORED
  302.24 +#define PRAGMA_FORMAT_IGNORED
  302.25 +#endif
  302.26 +#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  302.27 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  302.28 +#endif
  302.29 +#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  302.30 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  302.31 +#endif
  302.32 +#ifndef PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  302.33 +#define PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  302.34 +#endif
  302.35 +#ifndef ATTRIBUTE_PRINTF
  302.36 +#define ATTRIBUTE_PRINTF(fmt, vargs)
  302.37 +#endif
  302.38 +
  302.39 +
  302.40  #include "utilities/macros.hpp"
  302.41  
  302.42  // This file holds all globally used constants & types, class (forward)
  302.43 @@ -1284,6 +1310,11 @@
  302.44    return ((int)((unsigned int)high << 16) | (unsigned int)low);
  302.45  }
  302.46  
  302.47 +// Convert pointer to intptr_t, for use in printing pointers.
  302.48 +inline intptr_t p2i(const void * p) {
  302.49 +  return (intptr_t) p;
  302.50 +}
  302.51 +
  302.52  // Printf-style formatters for fixed- and variable-width types as pointers and
  302.53  // integers.  These are derived from the definitions in inttypes.h.  If the platform
  302.54  // doesn't provide appropriate definitions, they should be provided in
  302.55 @@ -1302,6 +1333,7 @@
  302.56  // Format 64-bit quantities.
  302.57  #define INT64_FORMAT           "%" PRId64
  302.58  #define UINT64_FORMAT          "%" PRIu64
  302.59 +#define UINT64_FORMAT_X        "%" PRIx64
  302.60  #define INT64_FORMAT_W(width)  "%" #width PRId64
  302.61  #define UINT64_FORMAT_W(width) "%" #width PRIu64
  302.62  
  302.63 @@ -1324,10 +1356,14 @@
  302.64  #define PTR_FORMAT    "0x%08"  PRIxPTR
  302.65  #endif  // _LP64
  302.66  
  302.67 -#define SSIZE_FORMAT          "%" PRIdPTR
  302.68 -#define SIZE_FORMAT           "%" PRIuPTR
  302.69 -#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
  302.70 -#define SIZE_FORMAT_W(width)  "%" #width PRIuPTR
  302.71 +#define INTPTR_FORMAT_W(width)   "%" #width PRIxPTR
  302.72 +
  302.73 +#define SSIZE_FORMAT          "%"   PRIdPTR
  302.74 +#define SIZE_FORMAT           "%"   PRIuPTR
  302.75 +#define SIZE_FORMAT_HEX       "0x%" PRIxPTR
  302.76 +#define SSIZE_FORMAT_W(width) "%"   #width PRIdPTR
  302.77 +#define SIZE_FORMAT_W(width)  "%"   #width PRIuPTR
  302.78 +#define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR
  302.79  
  302.80  #define INTX_FORMAT           "%" PRIdPTR
  302.81  #define UINTX_FORMAT          "%" PRIuPTR
  302.82 @@ -1349,11 +1385,10 @@
  302.83  // All C++ compilers that we know of have the vtbl pointer in the first
  302.84  // word.  If there are exceptions, this function needs to be made compiler
  302.85  // specific.
  302.86 -static inline void* dereference_vptr(void* addr) {
  302.87 +static inline void* dereference_vptr(const void* addr) {
  302.88    return *(void**)addr;
  302.89  }
  302.90  
  302.91 -
  302.92  #ifndef PRODUCT
  302.93  
  302.94  // For unit testing only
   303.1 --- a/src/share/vm/utilities/globalDefinitions_gcc.hpp	Wed May 21 10:56:41 2014 -0700
   303.2 +++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp	Fri May 23 14:12:52 2014 -0700
   303.3 @@ -1,5 +1,5 @@
   303.4  /*
   303.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   303.6 + * Copyright (c) 1998, 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 @@ -282,6 +282,47 @@
  303.11  #define PRAGMA_IMPLEMENTATION        #pragma implementation
  303.12  #define VALUE_OBJ_CLASS_SPEC
  303.13  
  303.14 +#ifndef ATTRIBUTE_PRINTF
  303.15 +// Diagnostic pragmas like the ones defined below in PRAGMA_FORMAT_NONLITERAL_IGNORED
  303.16 +// were only introduced in GCC 4.2. Because we have no other possibility to ignore
  303.17 +// these warnings for older versions of GCC, we simply don't decorate our printf-style
  303.18 +// functions with __attribute__(format) in that case.
  303.19 +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || (__GNUC__ > 4)
  303.20 +#define ATTRIBUTE_PRINTF(fmt,vargs)  __attribute__((format(printf, fmt, vargs)))
  303.21 +#else
  303.22 +#define ATTRIBUTE_PRINTF(fmt,vargs)
  303.23 +#endif
  303.24 +#endif
  303.25 +
  303.26 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \
  303.27 +                                         _Pragma("GCC diagnostic ignored \"-Wformat-security\"")
  303.28 +#define PRAGMA_FORMAT_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat\"")
  303.29 +
  303.30 +#if defined(__clang_major__) && \
  303.31 +      (__clang_major__ >= 4 || \
  303.32 +      (__clang_major__ >= 3 && __clang_minor__ >= 1)) || \
  303.33 +    ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  303.34 +// Tested to work with clang version 3.1 and better.
  303.35 +#define PRAGMA_DIAG_PUSH             _Pragma("GCC diagnostic push")
  303.36 +#define PRAGMA_DIAG_POP              _Pragma("GCC diagnostic pop")
  303.37 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
  303.38 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL PRAGMA_FORMAT_NONLITERAL_IGNORED
  303.39 +
  303.40 +// Hack to deal with gcc yammering about non-security format stuff
  303.41 +#else
  303.42 +// Old versions of gcc don't do push/pop, also do not cope with this pragma within a function
  303.43 +// One method does so much varied printing that it is decorated with both internal and external
  303.44 +// versions of the macro-pragma to obtain better checking with newer compilers.
  303.45 +#define PRAGMA_DIAG_PUSH
  303.46 +#define PRAGMA_DIAG_POP
  303.47 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL PRAGMA_FORMAT_NONLITERAL_IGNORED
  303.48 +#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
  303.49 +#endif
  303.50 +
  303.51 +#ifndef __clang_major__
  303.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\"")
  303.53 +#endif
  303.54 +
  303.55  #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
  303.56  #define TEMPLATE_TABLE_BUG
  303.57  #endif
   304.1 --- a/src/share/vm/utilities/numberSeq.cpp	Wed May 21 10:56:41 2014 -0700
   304.2 +++ b/src/share/vm/utilities/numberSeq.cpp	Fri May 23 14:12:52 2014 -0700
   304.3 @@ -1,5 +1,5 @@
   304.4  /*
   304.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   304.6 + * Copyright (c) 2001, 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 @@ -258,5 +258,5 @@
  304.11      }
  304.12      s->print("\t[%d]=%7.3f", i, _sequence[i]);
  304.13    }
  304.14 -  s->print_cr("");
  304.15 +  s->cr();
  304.16  }
   305.1 --- a/src/share/vm/utilities/ostream.cpp	Wed May 21 10:56:41 2014 -0700
   305.2 +++ b/src/share/vm/utilities/ostream.cpp	Fri May 23 14:12:52 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 @@ -268,7 +268,7 @@
  305.11    size_t limit = (len + 16) / 16 * 16;
  305.12    for (size_t i = 0; i < limit; ++i) {
  305.13      if (i % 16 == 0) {
  305.14 -      indent().print("%07x:", i);
  305.15 +      indent().print(SIZE_FORMAT_HEX_W(07)":", i);
  305.16      }
  305.17      if (i % 2 == 0) {
  305.18        print(" ");
  305.19 @@ -289,7 +289,7 @@
  305.20            }
  305.21          }
  305.22        }
  305.23 -      print_cr("");
  305.24 +      cr();
  305.25      }
  305.26    }
  305.27  }
  305.28 @@ -606,7 +606,7 @@
  305.29  // memory usage and command line flags into header
  305.30  void gcLogFileStream::dump_loggc_header() {
  305.31    if (is_open()) {
  305.32 -    print_cr(Abstract_VM_Version::internal_vm_info_string());
  305.33 +    print_cr("%s", Abstract_VM_Version::internal_vm_info_string());
  305.34      os::print_memory_info(this);
  305.35      print("CommandLine flags: ");
  305.36      CommandLineFlags::printSetFlags(this);
  305.37 @@ -687,7 +687,7 @@
  305.38      write(time_msg, strlen(time_msg));
  305.39  
  305.40      if (out != NULL) {
  305.41 -      out->print(time_msg);
  305.42 +      out->print("%s", time_msg);
  305.43      }
  305.44  
  305.45      dump_loggc_header();
  305.46 @@ -720,7 +720,7 @@
  305.47      write(time_msg, strlen(time_msg));
  305.48  
  305.49      if (out != NULL) {
  305.50 -      out->print(time_msg);
  305.51 +      out->print("%s", time_msg);
  305.52      }
  305.53  
  305.54      fclose(_file);
  305.55 @@ -765,7 +765,7 @@
  305.56      write(time_msg, strlen(time_msg));
  305.57  
  305.58      if (out != NULL) {
  305.59 -      out->print(time_msg);
  305.60 +      out->print("%s", time_msg);
  305.61      }
  305.62  
  305.63      dump_loggc_header();
  305.64 @@ -845,7 +845,7 @@
  305.65      xs->head("hotspot_log version='%d %d'"
  305.66               " process='%d' time_ms='"INT64_FORMAT"'",
  305.67               LOG_MAJOR_VERSION, LOG_MINOR_VERSION,
  305.68 -             os::current_process_id(), time_ms);
  305.69 +             os::current_process_id(), (int64_t)time_ms);
  305.70      // Write VM version header immediately.
  305.71      xs->head("vm_version");
  305.72      xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr();
   306.1 --- a/src/share/vm/utilities/ostream.hpp	Wed May 21 10:56:41 2014 -0700
   306.2 +++ b/src/share/vm/utilities/ostream.hpp	Fri May 23 14:12:52 2014 -0700
   306.3 @@ -1,5 +1,5 @@
   306.4  /*
   306.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   306.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   306.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   306.8   *
   306.9   * This code is free software; you can redistribute it and/or modify it
  306.10 @@ -53,7 +53,7 @@
  306.11     static const char* do_vsnprintf(char* buffer, size_t buflen,
  306.12                                     const char* format, va_list ap,
  306.13                                     bool add_cr,
  306.14 -                                   size_t& result_len);
  306.15 +                                   size_t& result_len)  ATTRIBUTE_PRINTF(3, 0);
  306.16  
  306.17   public:
  306.18     // creation
  306.19 @@ -80,10 +80,10 @@
  306.20     void set_position(int pos)   { _position = pos; }
  306.21  
  306.22     // printing
  306.23 -   void print(const char* format, ...);
  306.24 -   void print_cr(const char* format, ...);
  306.25 -   void vprint(const char *format, va_list argptr);
  306.26 -   void vprint_cr(const char* format, va_list argptr);
  306.27 +   void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  306.28 +   void print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  306.29 +   void vprint(const char *format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
  306.30 +   void vprint_cr(const char* format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
  306.31     void print_raw(const char* str)            { write(str, strlen(str)); }
  306.32     void print_raw(const char* str, int len)   { write(str,         len); }
  306.33     void print_raw_cr(const char* str)         { write(str, strlen(str)); cr(); }
  306.34 @@ -275,10 +275,10 @@
  306.35    ~staticBufferStream() {};
  306.36    virtual void write(const char* c, size_t len);
  306.37    void flush();
  306.38 -  void print(const char* format, ...);
  306.39 -  void print_cr(const char* format, ...);
  306.40 -  void vprint(const char *format, va_list argptr);
  306.41 -  void vprint_cr(const char* format, va_list argptr);
  306.42 +  void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  306.43 +  void print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  306.44 +  void vprint(const char *format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
  306.45 +  void vprint_cr(const char* format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
  306.46  };
  306.47  
  306.48  // In the non-fixed buffer case an underlying buffer will be created and
   307.1 --- a/src/share/vm/utilities/quickSort.cpp	Wed May 21 10:56:41 2014 -0700
   307.2 +++ b/src/share/vm/utilities/quickSort.cpp	Fri May 23 14:12:52 2014 -0700
   307.3 @@ -1,5 +1,5 @@
   307.4  /*
   307.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
   307.6 + * Copyright (c) 2011, 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 @@ -77,7 +77,7 @@
  307.11    for (int i = 0; i < length; i++) {
  307.12      tty->print(" %d", array[i]);
  307.13    }
  307.14 -  tty->print_cr("");
  307.15 +  tty->cr();
  307.16  }
  307.17  
  307.18  bool QuickSort::compare_arrays(int* actual, int* expected, int length) {
   308.1 --- a/src/share/vm/utilities/taskqueue.cpp	Wed May 21 10:56:41 2014 -0700
   308.2 +++ b/src/share/vm/utilities/taskqueue.cpp	Fri May 23 14:12:52 2014 -0700
   308.3 @@ -1,5 +1,5 @@
   308.4  /*
   308.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   308.6 + * Copyright (c) 2001, 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 @@ -30,6 +30,8 @@
  308.11  #include "utilities/stack.inline.hpp"
  308.12  #include "utilities/taskqueue.hpp"
  308.13  
  308.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  308.15 +
  308.16  #ifdef TRACESPINNING
  308.17  uint ParallelTaskTerminator::_total_yields = 0;
  308.18  uint ParallelTaskTerminator::_total_spins = 0;
   309.1 --- a/src/share/vm/utilities/vmError.cpp	Wed May 21 10:56:41 2014 -0700
   309.2 +++ b/src/share/vm/utilities/vmError.cpp	Fri May 23 14:12:52 2014 -0700
   309.3 @@ -1,5 +1,5 @@
   309.4  /*
   309.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   309.6 + * Copyright (c) 2003, 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 @@ -42,6 +42,8 @@
  309.11  #include "utilities/top.hpp"
  309.12  #include "utilities/vmError.hpp"
  309.13  
  309.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  309.15 +
  309.16  // List of environment variables that should be reported in error log file.
  309.17  const char *env_list[] = {
  309.18    // All platforms
  309.19 @@ -358,17 +360,17 @@
  309.20             st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " :
  309.21                                                   "(mmap) failed to map ");
  309.22             jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size);
  309.23 -           st->print(buf);
  309.24 +           st->print("%s", buf);
  309.25             st->print(" bytes");
  309.26             if (_message != NULL) {
  309.27               st->print(" for ");
  309.28 -             st->print(_message);
  309.29 +             st->print("%s", _message);
  309.30             }
  309.31             st->cr();
  309.32           } else {
  309.33             if (_message != NULL)
  309.34               st->print("# ");
  309.35 -             st->print_cr(_message);
  309.36 +             st->print_cr("%s", _message);
  309.37           }
  309.38           // In error file give some solutions
  309.39           if (_verbose) {
  309.40 @@ -485,7 +487,7 @@
  309.41      } else {
  309.42        st->print("Failed to write core dump. %s", coredump_message);
  309.43      }
  309.44 -    st->print_cr("");
  309.45 +    st->cr();
  309.46      st->print_cr("#");
  309.47  
  309.48    STEP(65, "(printing bug submit message)")
   310.1 --- a/src/share/vm/utilities/workgroup.cpp	Wed May 21 10:56:41 2014 -0700
   310.2 +++ b/src/share/vm/utilities/workgroup.cpp	Fri May 23 14:12:52 2014 -0700
   310.3 @@ -1,5 +1,5 @@
   310.4  /*
   310.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   310.6 + * Copyright (c) 2001, 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 @@ -28,6 +28,8 @@
  310.11  #include "runtime/os.hpp"
  310.12  #include "utilities/workgroup.hpp"
  310.13  
  310.14 +PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  310.15 +
  310.16  // Definitions of WorkGang methods.
  310.17  
  310.18  AbstractWorkGang::AbstractWorkGang(const char* name,
   311.1 --- a/src/share/vm/utilities/xmlstream.cpp	Wed May 21 10:56:41 2014 -0700
   311.2 +++ b/src/share/vm/utilities/xmlstream.cpp	Fri May 23 14:12:52 2014 -0700
   311.3 @@ -1,5 +1,5 @@
   311.4  /*
   311.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
   311.6 + * Copyright (c) 2002, 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 @@ -336,6 +336,8 @@
  311.11    print_raw_cr(">");
  311.12  }
  311.13  
  311.14 +PRAGMA_DIAG_PUSH
  311.15 +PRAGMA_FORMAT_NONLITERAL_IGNORED
  311.16  // ------------------------------------------------------------------
  311.17  void xmlStream::va_done(const char* format, va_list ap) {
  311.18    char buffer[200];
  311.19 @@ -354,6 +356,7 @@
  311.20    buffer[kind_len] = 0;
  311.21    tail(buffer);
  311.22  }
  311.23 +PRAGMA_DIAG_POP
  311.24  
  311.25  // Output a timestamp attribute.
  311.26  void xmlStream::stamp() {
   312.1 --- a/src/share/vm/utilities/xmlstream.hpp	Wed May 21 10:56:41 2014 -0700
   312.2 +++ b/src/share/vm/utilities/xmlstream.hpp	Fri May 23 14:12:52 2014 -0700
   312.3 @@ -1,5 +1,5 @@
   312.4  /*
   312.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
   312.6 + * Copyright (c) 2002, 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 @@ -80,7 +80,7 @@
  312.11    outputStream* out()                            { return _out; }
  312.12  
  312.13    // helpers for writing XML elements
  312.14 -  void          va_tag(bool push, const char* format, va_list ap);
  312.15 +  void          va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
  312.16    virtual void see_tag(const char* tag, bool push) NOT_DEBUG({});
  312.17    virtual void pop_tag(const char* tag) NOT_DEBUG({});
  312.18  
  312.19 @@ -109,29 +109,29 @@
  312.20    int unflushed_count() { return (int)(out()->count() - _last_flush); }
  312.21  
  312.22    // writing complete XML elements
  312.23 -  void          elem(const char* format, ...);
  312.24 -  void    begin_elem(const char* format, ...);
  312.25 -  void      end_elem(const char* format, ...);
  312.26 +  void          elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  312.27 +  void    begin_elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  312.28 +  void      end_elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  312.29    void      end_elem();
  312.30 -  void          head(const char* format, ...);
  312.31 -  void    begin_head(const char* format, ...);
  312.32 -  void      end_head(const char* format, ...);
  312.33 +  void          head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  312.34 +  void    begin_head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  312.35 +  void      end_head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  312.36    void      end_head();
  312.37 -  void          done(const char* format, ...);  // xxx_done event, plus tail
  312.38 +  void          done(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);  // xxx_done event, plus tail
  312.39    void          done_raw(const char * kind);
  312.40    void          tail(const char* kind);
  312.41  
  312.42    // va_list versions
  312.43 -  void       va_elem(const char* format, va_list ap);
  312.44 -  void va_begin_elem(const char* format, va_list ap);
  312.45 -  void       va_head(const char* format, va_list ap);
  312.46 -  void va_begin_head(const char* format, va_list ap);
  312.47 -  void       va_done(const char* format, va_list ap);
  312.48 +  void       va_elem(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
  312.49 +  void va_begin_elem(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
  312.50 +  void       va_head(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
  312.51 +  void va_begin_head(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
  312.52 +  void       va_done(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
  312.53  
  312.54    // write text (with quoting of special XML characters <>&'" etc.)
  312.55    outputStream* text() { return _text; }
  312.56 -  void          text(const char* format, ...);
  312.57 -  void       va_text(const char* format, va_list ap) {
  312.58 +  void          text(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
  312.59 +  void       va_text(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0) {
  312.60      text()->vprint(format, ap);
  312.61    }
  312.62  
   313.1 --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java	Wed May 21 10:56:41 2014 -0700
   313.2 +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java	Fri May 23 14:12:52 2014 -0700
   313.3 @@ -72,7 +72,8 @@
   313.4                  "-XX:-UseRTMLocking");
   313.5          // verify that it is off by default
   313.6          CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
   313.7 -                TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE);
   313.8 +                TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE,
   313.9 +                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
  313.10      }
  313.11  
  313.12      public static void main(String args[]) throws Throwable {
   314.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   314.2 +++ b/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java	Fri May 23 14:12:52 2014 -0700
   314.3 @@ -0,0 +1,75 @@
   314.4 +/*
   314.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   314.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   314.7 + *
   314.8 + * This code is free software; you can redistribute it and/or modify it
   314.9 + * under the terms of the GNU General Public License version 2 only, as
  314.10 + * published by the Free Software Foundation.
  314.11 + *
  314.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
  314.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  314.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  314.15 + * version 2 for more details (a copy is included in the LICENSE file that
  314.16 + * accompanied this code).
  314.17 + *
  314.18 + * You should have received a copy of the GNU General Public License version
  314.19 + * 2 along with this work; if not, write to the Free Software Foundation,
  314.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  314.21 + *
  314.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  314.23 + * or visit www.oracle.com if you need additional information or have any
  314.24 + * questions.
  314.25 + */
  314.26 +
  314.27 +/*
  314.28 + * @test TestEmptyBootstrapMethodsAttr
  314.29 + * @bug 8041918
  314.30 + * @library /testlibrary
  314.31 + * @summary Test empty bootstrap_methods table within BootstrapMethods attribute
  314.32 + * @compile TestEmptyBootstrapMethodsAttr.java
  314.33 + * @run main TestEmptyBootstrapMethodsAttr
  314.34 + */
  314.35 +
  314.36 +import java.io.File;
  314.37 +import com.oracle.java.testlibrary.*;
  314.38 +
  314.39 +public class TestEmptyBootstrapMethodsAttr {
  314.40 +
  314.41 +    public static void main(String args[]) throws Throwable {
  314.42 +        System.out.println("Regression test for bug 8041918");
  314.43 +        String jarFile = System.getProperty("test.src") + File.separator + "emptynumbootstrapmethods.jar";
  314.44 +
  314.45 +        // ====== extract the test case
  314.46 +        ProcessBuilder pb = new ProcessBuilder(new String[] { JDKToolFinder.getJDKTool("jar"), "xvf", jarFile } );
  314.47 +        OutputAnalyzer output = new OutputAnalyzer(pb.start());
  314.48 +        output.shouldHaveExitValue(0);
  314.49 +
  314.50 +        // Test case #1:
  314.51 +        // Try loading class with empty bootstrap_methods table where no
  314.52 +        // other attributes are following BootstrapMethods in attribute table.
  314.53 +        String className = "emptynumbootstrapmethods1";
  314.54 +
  314.55 +        // ======= execute test case #1
  314.56 +        // Expect a lack of main method, this implies that the class loaded correctly
  314.57 +        // with an empty bootstrap_methods and did not generate a ClassFormatError.
  314.58 +        pb = ProcessTools.createJavaProcessBuilder("-cp", ".", className);
  314.59 +        output = new OutputAnalyzer(pb.start());
  314.60 +        output.shouldNotContain("java.lang.ClassFormatError");
  314.61 +        output.shouldContain("Main method not found in class " + className);
  314.62 +        output.shouldHaveExitValue(1);
  314.63 +
  314.64 +        // Test case #2:
  314.65 +        // Try loading class with empty bootstrap_methods table where an
  314.66 +        // AnnotationDefault attribute follows the BootstrapMethods in the attribute table.
  314.67 +        className = "emptynumbootstrapmethods2";
  314.68 +
  314.69 +        // ======= execute test case #2
  314.70 +        // Expect a lack of main method, this implies that the class loaded correctly
  314.71 +        // with an empty bootstrap_methods and did not generate ClassFormatError.
  314.72 +        pb = ProcessTools.createJavaProcessBuilder("-cp", ".", className);
  314.73 +        output = new OutputAnalyzer(pb.start());
  314.74 +        output.shouldNotContain("java.lang.ClassFormatError");
  314.75 +        output.shouldContain("Main method not found in class " + className);
  314.76 +        output.shouldHaveExitValue(1);
  314.77 +    }
  314.78 +}
   315.1 Binary file test/runtime/classFileParserBug/emptynumbootstrapmethods.jar has changed
   316.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   316.2 +++ b/test/runtime/classFileParserBug/emptynumbootstrapmethods1.jcod	Fri May 23 14:12:52 2014 -0700
   316.3 @@ -0,0 +1,68 @@
   316.4 +/*
   316.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   316.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   316.7 + *
   316.8 + * This code is free software; you can redistribute it and/or modify it
   316.9 + * under the terms of the GNU General Public License version 2 only, as
  316.10 + * published by the Free Software Foundation.
  316.11 + *
  316.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
  316.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  316.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  316.15 + * version 2 for more details (a copy is included in the LICENSE file that
  316.16 + * accompanied this code).
  316.17 + *
  316.18 + * You should have received a copy of the GNU General Public License version
  316.19 + * 2 along with this work; if not, write to the Free Software Foundation,
  316.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  316.21 + *
  316.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  316.23 + * or visit www.oracle.com if you need additional information or have any
  316.24 + * questions.
  316.25 + */
  316.26 +
  316.27 +/*
  316.28 + * This test contains a BootstrapMethods attribute with an empty
  316.29 + * bootstrap_methods table.  This yields a BootstrapMethods
  316.30 + * attribute length of 2 and should not cause a
  316.31 + * java.lang.ClassFormatError to be thrown.
  316.32 + */
  316.33 +class emptynumbootstrapmethods1 {
  316.34 +  0xCAFEBABE;
  316.35 +  0; // minor version
  316.36 +  51; // version
  316.37 +  [12] { // Constant Pool
  316.38 +    ; // first element is empty
  316.39 +    class #2; // #1     at 0x0A
  316.40 +    Utf8 "emptynumbootstrapmethods1"; // #2     at 0x0D
  316.41 +    class #4; // #3     at 0x1F
  316.42 +    Utf8 "java/lang/Object"; // #4     at 0x22
  316.43 +    MethodHandle 5b #9; // #5     at 0x35
  316.44 +    NameAndType #7 #8; // #6     at 0x39
  316.45 +    Utf8 "equals"; // #7     at 0x3E
  316.46 +    Utf8 "(Ljava/lang/Object;)Z"; // #8     at 0x47
  316.47 +    Method #3 #6; // #9     at 0x5F
  316.48 +    Utf8 "equalsx"; // #10    at 0x3E
  316.49 +    Utf8 "BootstrapMethods"; // #11     at 0x69
  316.50 +  } // Constant Pool
  316.51 +
  316.52 +  0x0001; // access
  316.53 +  #1;// this_cpx
  316.54 +  #3;// super_cpx
  316.55 +
  316.56 +  [0] { // Interfaces
  316.57 +  } // Interfaces
  316.58 +
  316.59 +  [0] { // fields
  316.60 +  } // fields
  316.61 +
  316.62 +  [0] { // methods
  316.63 +  } // methods
  316.64 +
  316.65 +  [1] { // Attributes
  316.66 +    Attr(#11, 2) { // BootstrapMethods at 0x8A
  316.67 +      [0] { // bootstrap_methods
  316.68 +      }
  316.69 +    } // end BootstrapMethods
  316.70 +  } // Attributes
  316.71 +} // end class atrbsm00101m10p
   317.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   317.2 +++ b/test/runtime/classFileParserBug/emptynumbootstrapmethods2.jcod	Fri May 23 14:12:52 2014 -0700
   317.3 @@ -0,0 +1,89 @@
   317.4 +/*
   317.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   317.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   317.7 + *
   317.8 + * This code is free software; you can redistribute it and/or modify it
   317.9 + * under the terms of the GNU General Public License version 2 only, as
  317.10 + * published by the Free Software Foundation.
  317.11 + *
  317.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
  317.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  317.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  317.15 + * version 2 for more details (a copy is included in the LICENSE file that
  317.16 + * accompanied this code).
  317.17 + *
  317.18 + * You should have received a copy of the GNU General Public License version
  317.19 + * 2 along with this work; if not, write to the Free Software Foundation,
  317.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  317.21 + *
  317.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  317.23 + * or visit www.oracle.com if you need additional information or have any
  317.24 + * questions.
  317.25 + */
  317.26 +
  317.27 +/*
  317.28 + * This test contains a BootstrapMethods attribute with an empty
  317.29 + * bootstrap_methods table.  This yields a BootstrapMethods
  317.30 + * attribute length of 2 and should not cause a
  317.31 + * java.lang.ClassFormatError to be thrown. To ensure that an empty
  317.32 + * bootstrap_methods table is parsed correctly, another attribute,
  317.33 + * AnnotationDefault, follows the BootstrapMethods attribute in 
  317.34 + * the attribute table.
  317.35 + */
  317.36 +
  317.37 +class emptynumbootstrapmethods2 {
  317.38 +  0xCAFEBABE;
  317.39 +  0; // minor version
  317.40 +  51; // version
  317.41 +  [14] { // Constant Pool
  317.42 +    ; // first element is empty
  317.43 +    class #2; // #1     at 0x0A
  317.44 +    Utf8 "emptynumbootstrapmethods2"; // #2     at 0x0D
  317.45 +    class #4; // #3     at 0x1F
  317.46 +    Utf8 "java/lang/Object"; // #4     at 0x22
  317.47 +    MethodHandle 5b #9; // #5     at 0x35
  317.48 +    NameAndType #7 #8; // #6     at 0x39
  317.49 +    Utf8 "equals"; // #7     at 0x3E
  317.50 +    Utf8 "(Ljava/lang/Object;)Z"; // #8     at 0x47
  317.51 +    Method #3 #6; // #9     at 0x5F
  317.52 +    Utf8 "equalsx"; // #10    at 0x3E
  317.53 +    Utf8 "BootstrapMethods"; // #11     at 0x69
  317.54 +    Utf8 "AnnotationDefault"; // #12
  317.55 +    Utf8 "LAnnotationDefaultI;"; // #13
  317.56 +  } // Constant Pool
  317.57 +
  317.58 +  0x0001; // access
  317.59 +  #1;// this_cpx
  317.60 +  #3;// super_cpx
  317.61 +
  317.62 +  [0] { // Interfaces
  317.63 +  } // Interfaces
  317.64 +
  317.65 +  [0] { // fields
  317.66 +  } // fields
  317.67 +
  317.68 +  [0] { // methods
  317.69 +  } // methods
  317.70 +
  317.71 +  [2] { // Attributes
  317.72 +    Attr(#11, 2) { // BootstrapMethods at 0x8A
  317.73 +      [0] { // bootstrap_methods
  317.74 +      }
  317.75 +    } // end BootstrapMethods
  317.76 +    ;
  317.77 +    Attr(#12) { // AnnotationDefault
  317.78 +      [] { // type annotations
  317.79 +        { // type annotation
  317.80 +          0x00;  // target_type
  317.81 +          0x00;  // type_parameter_index
  317.82 +          []b { //  type_path
  317.83 +          }
  317.84 +
  317.85 +          #13; // type_index
  317.86 +          [] { // element_value_pairs
  317.87 +          } // element_value_pairs
  317.88 +        } // type annotation
  317.89 +      } // type annotations
  317.90 +    } // end AnnotationDefault
  317.91 +  } // Attributes
  317.92 +} // end class atrbsm00101m10p

mercurial