changeset 9418:00e5743fd189

Merge
author jwilhelm
date Wed, 07 Oct 2015 01:03:24 +0200
parents f244d455e4dd a6499084ccd4
children 5f9da6c532fe 4d9b98fd9644
files src/cpu/aarch64/vm/macroAssembler_aarch64.cpp src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp src/cpu/sparc/vm/sparc.ad src/cpu/x86/vm/assembler_x86.cpp src/cpu/x86/vm/macroAssembler_x86.cpp src/share/vm/c1/c1_GraphBuilder.cpp src/share/vm/ci/ciMethod.cpp src/share/vm/compiler/compileBroker.cpp src/share/vm/interpreter/interpreter.cpp src/share/vm/interpreter/templateInterpreter.cpp src/share/vm/opto/chaitin.cpp src/share/vm/opto/compile.cpp src/share/vm/opto/compile.hpp src/share/vm/opto/memnode.cpp src/share/vm/opto/node.hpp src/share/vm/opto/output.cpp src/share/vm/opto/superword.cpp src/share/vm/runtime/frame.cpp
diffstat 308 files changed, 5797 insertions(+), 2261 deletions(-) [+]
line wrap: on
line diff
--- a/make/bsd/makefiles/jsig.make	Thu Oct 01 11:52:44 2015 -0700
+++ b/make/bsd/makefiles/jsig.make	Wed Oct 07 01:03:24 2015 +0200
@@ -62,7 +62,7 @@
 $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
 	@echo $(LOG_INFO) Making signal interposition lib...
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
-                         $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $<
+                         $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   ifeq ($(OS_VENDOR), Darwin)
 	$(DSYMUTIL) $@
--- a/make/linux/makefiles/gcc.make	Thu Oct 01 11:52:44 2015 -0700
+++ b/make/linux/makefiles/gcc.make	Wed Oct 07 01:03:24 2015 +0200
@@ -207,7 +207,7 @@
   WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
 endif
 
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual -Wno-format-zero-length
 
 ifeq ($(USE_CLANG),)
   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
--- a/make/windows/makefiles/compile.make	Thu Oct 01 11:52:44 2015 -0700
+++ b/make/windows/makefiles/compile.make	Wed Oct 07 01:03:24 2015 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 #   /nologo   Supress copyright message at every cl.exe startup
 #   /W3       Warning level 3
 #   /Zi       Include debugging information
+#   /d2Zi+    Extended debugging symbols for optimized code (/Zo in VS2013 Update 3 and later)
 #   /WX       Treat any warning error as a fatal error
 #   /MD       Use dynamic multi-threaded runtime (msvcrt.dll or msvc*NN.dll)
 #   /MTd      Use static multi-threaded runtime debug versions
@@ -57,7 +58,7 @@
 
 # Let's add debug information when Full Debug Symbols is enabled
 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
-CXX_FLAGS=$(CXX_FLAGS) /Zi
+CXX_FLAGS=$(CXX_FLAGS) /Zi /d2Zi+
 !endif
 
 # Based on BUILDARCH we add some flags and select the default compiler name
--- a/make/windows/makefiles/vm.make	Thu Oct 01 11:52:44 2015 -0700
+++ b/make/windows/makefiles/vm.make	Wed Oct 07 01:03:24 2015 +0200
@@ -163,6 +163,7 @@
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/gc/cms
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/gc/g1
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/asm
+VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/logging
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/memory
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/oops
 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/prims
@@ -250,6 +251,9 @@
 {$(COMMONSRC)\share\vm\asm}.cpp.obj::
         $(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
 
+{$(COMMONSRC)\share\vm\logging}.cpp.obj::
+        $(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
+
 {$(COMMONSRC)\share\vm\memory}.cpp.obj::
         $(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
 
@@ -330,6 +334,9 @@
 {$(ALTSRC)\share\vm\asm}.cpp.obj::
         $(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
 
+{$(ALTSRC)\share\vm\logging}.cpp.obj::
+        $(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
+
 {$(ALTSRC)\share\vm\memory}.cpp.obj::
         $(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
 
--- a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -2238,7 +2238,7 @@
     ttyLocker ttyl;
     ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n",
                     msg);
-    assert(false, err_msg("DEBUG MESSAGE: %s", msg));
+    assert(false, "DEBUG MESSAGE: %s", msg);
   }
 }
 
@@ -3075,11 +3075,15 @@
 
   if (UseCondCardMark) {
     Label L_already_dirty;
+    membar(StoreLoad);
     ldrb(rscratch2,  Address(obj, rscratch1));
     cbz(rscratch2, L_already_dirty);
     strb(zr, Address(obj, rscratch1));
     bind(L_already_dirty);
   } else {
+    if (UseConcMarkSweepGC && CMSPrecleaningEnabled) {
+      membar(StoreStore);
+    }
     strb(zr, Address(obj, rscratch1));
   }
 }
--- a/src/cpu/aarch64/vm/methodHandles_aarch64.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/aarch64/vm/methodHandles_aarch64.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -50,7 +50,7 @@
 
 #ifdef ASSERT
 static int check_nonzero(const char* xname, int x) {
-  assert(x != 0, err_msg("%s should be nonzero", xname));
+  assert(x != 0, "%s should be nonzero", xname);
   return x;
 }
 #define NONZERO(x) check_nonzero(#x, x)
@@ -407,7 +407,7 @@
     }
 
     default:
-      fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
+      fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
       break;
     }
 
--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1207,7 +1207,7 @@
   } else if (iid == vmIntrinsics::_invokeBasic) {
     has_receiver = true;
   } else {
-    fatal(err_msg_res("unexpected intrinsic id %d", iid));
+    fatal("unexpected intrinsic id %d", iid);
   }
 
   if (member_reg != noreg) {
--- a/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -746,6 +746,9 @@
           const Register count = end; // 'end' register contains bytes count now
           __ mov(scratch, (address)ct->byte_map_base);
           __ add(start, start, scratch);
+          if (UseConcMarkSweepGC) {
+            __ membar(__ StoreStore);
+          }
           __ BIND(L_loop);
           __ strb(zr, Address(start, count));
           __ subs(count, count, 1);
--- a/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -4292,7 +4292,7 @@
 
 static void stop_on_request(int tp, const char* msg) {
   tty->print("PPC assembly code requires stop: (%s) %s\n", stop_types[tp%/*stop_end*/4], msg);
-  guarantee(false, err_msg("PPC assembly code requires stop: %s", msg));
+  guarantee(false, "PPC assembly code requires stop: %s", msg);
 }
 
 // Call a C-function that prints output.
--- a/src/cpu/ppc/vm/methodHandles_ppc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/ppc/vm/methodHandles_ppc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -60,7 +60,7 @@
 
 #ifdef ASSERT
 static int check_nonzero(const char* xname, int x) {
-  assert(x != 0, err_msg("%s should be nonzero", xname));
+  assert(x != 0, "%s should be nonzero", xname);
   return x;
 }
 #define NONZERO(x) check_nonzero(#x, x)
@@ -434,7 +434,7 @@
     }
 
     default:
-      fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
+      fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
       break;
     }
 
--- a/src/cpu/ppc/vm/nativeInst_ppc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/ppc/vm/nativeInst_ppc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -149,7 +149,7 @@
   if (!NativeCall::is_call_at(addr)) {
     tty->print_cr("not a NativeCall at " PTR_FORMAT, p2i(addr));
     // TODO: PPC port: Disassembler::decode(addr - 20, addr + 20, tty);
-    fatal(err_msg("not a NativeCall at " PTR_FORMAT, p2i(addr)));
+    fatal("not a NativeCall at " PTR_FORMAT, p2i(addr));
   }
 }
 #endif // ASSERT
@@ -162,7 +162,7 @@
   if (!NativeFarCall::is_far_call_at(addr)) {
     tty->print_cr("not a NativeFarCall at " PTR_FORMAT, p2i(addr));
     // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
-    fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, p2i(addr)));
+    fatal("not a NativeFarCall at " PTR_FORMAT, p2i(addr));
   }
 }
 #endif // ASSERT
@@ -308,7 +308,7 @@
         ! MacroAssembler::is_bl(*((int*) addr))) {
       tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr));
       // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
-      fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr)));
+      fatal("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr));
     }
   }
 }
@@ -346,7 +346,7 @@
   if (!NativeJump::is_jump_at(addr)) {
     tty->print_cr("not a NativeJump at " PTR_FORMAT, p2i(addr));
     // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
-    fatal(err_msg("not a NativeJump at " PTR_FORMAT, p2i(addr)));
+    fatal("not a NativeJump at " PTR_FORMAT, p2i(addr));
   }
 }
 #endif // ASSERT
--- a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -475,9 +475,8 @@
 
 // Is vector's size (in bytes) bigger than a size saved by default?
 bool SharedRuntime::is_wide_vector(int size) {
-  ResourceMark rm;
   // Note, MaxVectorSize == 8 on PPC64.
-  assert(size <= 8, err_msg_res("%d bytes vectors are not supported", size));
+  assert(size <= 8, "%d bytes vectors are not supported", size);
   return size > 8;
 }
 #ifdef COMPILER2
@@ -1631,7 +1630,7 @@
   } else if (iid == vmIntrinsics::_invokeBasic) {
     has_receiver = true;
   } else {
-    fatal(err_msg_res("unexpected intrinsic id %d", iid));
+    fatal("unexpected intrinsic id %d", iid);
   }
 
   if (member_reg != noreg) {
--- a/src/cpu/sparc/vm/assembler_sparc.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/sparc/vm/assembler_sparc.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -389,7 +389,7 @@
 
   static void assert_signed_range(intptr_t x, int nbits) {
     assert(nbits == 32 || (-(1 << nbits-1) <= x  &&  x < ( 1 << nbits-1)),
-           err_msg("value out of range: x=" INTPTR_FORMAT ", nbits=%d", x, nbits));
+           "value out of range: x=" INTPTR_FORMAT ", nbits=%d", x, nbits);
   }
 
   static void assert_signed_word_disp_range(intptr_t x, int nbits) {
--- a/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1596,7 +1596,7 @@
   else {
      ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n", msg);
   }
-  assert(false, err_msg("DEBUG MESSAGE: %s", msg));
+  assert(false, "DEBUG MESSAGE: %s", msg);
 }
 
 
--- a/src/cpu/sparc/vm/methodHandles_sparc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -56,7 +56,7 @@
 
 #ifdef ASSERT
 static int check_nonzero(const char* xname, int x) {
-  assert(x != 0, err_msg("%s should be nonzero", xname));
+  assert(x != 0, "%s should be nonzero", xname);
   return x;
 }
 #define NONZERO(x) check_nonzero(#x, x)
@@ -453,7 +453,7 @@
     }
 
     default:
-      fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
+      fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
       break;
     }
 
--- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -316,7 +316,7 @@
 // 8 bytes FP registers are saved by default on SPARC.
 bool SharedRuntime::is_wide_vector(int size) {
   // Note, MaxVectorSize == 8 on SPARC.
-  assert(size <= 8, err_msg_res("%d bytes vectors are not supported", size));
+  assert(size <= 8, "%d bytes vectors are not supported", size);
   return size > 8;
 }
 
@@ -464,7 +464,7 @@
       break;
 
     default:
-      fatal(err_msg_res("unknown basic type %d", sig_bt[i]));
+      fatal("unknown basic type %d", sig_bt[i]);
       break;
     }
   }
@@ -1859,7 +1859,7 @@
   } else if (iid == vmIntrinsics::_invokeBasic) {
     has_receiver = true;
   } else {
-    fatal(err_msg_res("unexpected intrinsic id %d", iid));
+    fatal("unexpected intrinsic id %d", iid);
   }
 
   if (member_reg != noreg) {
--- a/src/cpu/sparc/vm/sparc.ad	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/sparc/vm/sparc.ad	Wed Oct 07 01:03:24 2015 +0200
@@ -1098,7 +1098,7 @@
   Register r = as_Register(ra_->get_encode(this));
   CodeSection* consts_section = __ code()->consts();
   int consts_size = consts_section->align_at_start(consts_section->size());
-  assert(constant_table.size() == consts_size, err_msg("must be: %d == %d", constant_table.size(), consts_size));
+  assert(constant_table.size() == consts_size, "must be: %d == %d", constant_table.size(), consts_size);
 
   if (UseRDPCForConstantTableBase) {
     // For the following RDPC logic to work correctly the consts
--- a/src/cpu/x86/vm/assembler_x86.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/x86/vm/assembler_x86.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -733,11 +733,11 @@
     // these asserts are somewhat nonsensical
 #ifndef _LP64
     assert(which == imm_operand || which == disp32_operand,
-           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
+           "which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip));
 #else
     assert((which == call32_operand || which == imm_operand) && is_64bit ||
            which == narrow_oop_operand && !is_64bit,
-           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
+           "which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip));
 #endif // _LP64
     return ip;
 
--- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -2684,7 +2684,7 @@
 #endif // _LP64
         }
       } else {
-        fatal(err_msg("unexpected type: %s", basictype_to_str(c->type())));
+        fatal("unexpected type: %s", basictype_to_str(c->type()));
       }
       // cpu register - address
     } else if (opr2->is_address()) {
--- a/src/cpu/x86/vm/macroAssembler_x86.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/x86/vm/macroAssembler_x86.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -418,7 +418,7 @@
     ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n", msg);
   }
   // Don't assert holding the ttyLock
-    assert(false, err_msg("DEBUG MESSAGE: %s", msg));
+    assert(false, "DEBUG MESSAGE: %s", msg);
   ThreadStateTransition::transition(thread, _thread_in_vm, saved_state);
 }
 
@@ -884,7 +884,7 @@
     ttyLocker ttyl;
     ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n",
                     msg);
-    assert(false, err_msg("DEBUG MESSAGE: %s", msg));
+    assert(false, "DEBUG MESSAGE: %s", msg);
   }
 }
 
--- a/src/cpu/x86/vm/methodHandles_x86.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -53,7 +53,7 @@
 
 #ifdef ASSERT
 static int check_nonzero(const char* xname, int x) {
-  assert(x != 0, err_msg("%s should be nonzero", xname));
+  assert(x != 0, "%s should be nonzero", xname);
   return x;
 }
 #define NONZERO(x) check_nonzero(#x, x)
@@ -456,7 +456,7 @@
     }
 
     default:
-      fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
+      fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
       break;
     }
 
--- a/src/cpu/x86/vm/register_x86.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/x86/vm/register_x86.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -162,7 +162,7 @@
   XMMRegister successor() const                          { return as_XMMRegister(encoding() + 1); }
 
   // accessors
-  int   encoding() const                          { assert(is_valid(), err_msg("invalid register (%d)", (int)(intptr_t)this )); return (intptr_t)this; }
+  int   encoding() const                          { assert(is_valid(), "invalid register (%d)", (int)(intptr_t)this ); return (intptr_t)this; }
   bool  is_valid() const                          { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
   const char* name() const;
 };
@@ -245,7 +245,7 @@
   KRegister successor() const                          { return as_KRegister(encoding() + 1); }
 
   // accessors
-  int   encoding() const                          { assert(is_valid(), err_msg("invalid register (%d)", (int)(intptr_t)this)); return (intptr_t)this; }
+  int   encoding() const                          { assert(is_valid(), "invalid register (%d)", (int)(intptr_t)this); return (intptr_t)this; }
   bool  is_valid() const                          { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
   const char* name() const;
 };
--- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1434,7 +1434,7 @@
   } else if (iid == vmIntrinsics::_invokeBasic) {
     has_receiver = true;
   } else {
-    fatal(err_msg_res("unexpected intrinsic id %d", iid));
+    fatal("unexpected intrinsic id %d", iid);
   }
 
   if (member_reg != noreg) {
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1695,7 +1695,7 @@
   } else if (iid == vmIntrinsics::_invokeBasic) {
     has_receiver = true;
   } else {
-    fatal(err_msg_res("unexpected intrinsic id %d", iid));
+    fatal("unexpected intrinsic id %d", iid);
   }
 
   if (member_reg != noreg) {
--- a/src/os/aix/vm/os_aix.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/aix/vm/os_aix.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -2286,7 +2286,7 @@
   if (!pd_commit_memory(addr, size, exec)) {
     // Add extra info in product mode for vm_exit_out_of_memory():
     PRODUCT_ONLY(warn_fail_commit_memory(addr, size, exec, errno);)
-    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
@@ -3120,8 +3120,8 @@
       // libjsig also interposes the sigaction() call below and saves the
       // old sigaction on it own.
     } else {
-      fatal(err_msg("Encountered unexpected pre-existing sigaction handler "
-                    "%#lx for signal %d.", (long)oldhand, sig));
+      fatal("Encountered unexpected pre-existing sigaction handler "
+            "%#lx for signal %d.", (long)oldhand, sig);
     }
   }
 
@@ -3699,7 +3699,7 @@
 void os::make_polling_page_readable(void) {
   // Changed according to os_linux.cpp.
   if (!checked_mprotect((char *)_polling_page, Aix::page_size(), PROT_READ)) {
-    fatal(err_msg("Could not enable polling page at " PTR_FORMAT, _polling_page));
+    fatal("Could not enable polling page at " PTR_FORMAT, _polling_page);
   }
 };
 
--- a/src/os/aix/vm/vmError_aix.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/aix/vm/vmError_aix.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -117,8 +117,7 @@
     return;
   }
 
-  VMError err(NULL, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(NULL, sig, pc, info, ucVoid);
 }
 
 void VMError::reset_signal_handlers() {
--- a/src/os/bsd/vm/os_bsd.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/bsd/vm/os_bsd.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1977,7 +1977,7 @@
 OSXSemaphore::OSXSemaphore(uint value) {
   kern_return_t ret = SEM_INIT(_semaphore, value);
 
-  guarantee(ret == KERN_SUCCESS, err_msg("Failed to create semaphore: %s", sem_init_strerror(ret)));
+  guarantee(ret == KERN_SUCCESS, "Failed to create semaphore: %s", sem_init_strerror(ret));
 }
 
 OSXSemaphore::~OSXSemaphore() {
@@ -2213,7 +2213,7 @@
   if (!pd_commit_memory(addr, size, exec)) {
     // add extra info in product mode for vm_exit_out_of_memory():
     PRODUCT_ONLY(warn_fail_commit_memory(addr, size, exec, errno);)
-    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
@@ -3100,8 +3100,8 @@
       // libjsig also interposes the sigaction() call below and saves the
       // old sigaction on it own.
     } else {
-      fatal(err_msg("Encountered unexpected pre-existing sigaction handler "
-                    "%#lx for signal %d.", (long)oldhand, sig));
+      fatal("Encountered unexpected pre-existing sigaction handler "
+            "%#lx for signal %d.", (long)oldhand, sig);
     }
   }
 
@@ -3459,8 +3459,7 @@
 
   Bsd::set_page_size(getpagesize());
   if (Bsd::page_size() == -1) {
-    fatal(err_msg("os_bsd.cpp: os::init: sysconf failed (%s)",
-                  strerror(errno)));
+    fatal("os_bsd.cpp: os::init: sysconf failed (%s)", strerror(errno));
   }
   init_page_sizes((size_t) Bsd::page_size());
 
--- a/src/os/bsd/vm/vmError_bsd.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/bsd/vm/vmError_bsd.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -121,8 +121,7 @@
     return;
   }
 
-  VMError err(NULL, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(NULL, sig, pc, info, ucVoid);
 }
 
 void VMError::reset_signal_handlers() {
--- a/src/os/linux/vm/os_linux.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/linux/vm/os_linux.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -2680,7 +2680,7 @@
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, size, exec, err);
-    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
@@ -2716,7 +2716,7 @@
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, size, alignment_hint, exec, err);
-    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
@@ -4278,8 +4278,8 @@
       // libjsig also interposes the sigaction() call below and saves the
       // old sigaction on it own.
     } else {
-      fatal(err_msg("Encountered unexpected pre-existing sigaction handler "
-                    "%#lx for signal %d.", (long)oldhand, sig));
+      fatal("Encountered unexpected pre-existing sigaction handler "
+            "%#lx for signal %d.", (long)oldhand, sig);
     }
   }
 
@@ -4611,8 +4611,8 @@
 
   Linux::set_page_size(sysconf(_SC_PAGESIZE));
   if (Linux::page_size() == -1) {
-    fatal(err_msg("os_linux.cpp: os::init: sysconf failed (%s)",
-                  strerror(errno)));
+    fatal("os_linux.cpp: os::init: sysconf failed (%s)",
+          strerror(errno));
   }
   init_page_sizes((size_t) Linux::page_size());
 
@@ -4628,7 +4628,7 @@
   int status;
   pthread_condattr_t* _condattr = os::Linux::condAttr();
   if ((status = pthread_condattr_init(_condattr)) != 0) {
-    fatal(err_msg("pthread_condattr_init: %s", strerror(status)));
+    fatal("pthread_condattr_init: %s", strerror(status));
   }
   // Only set the clock if CLOCK_MONOTONIC is available
   if (os::supports_monotonic_clock()) {
@@ -4637,7 +4637,7 @@
         warning("Unable to use monotonic clock with relative timed-waits" \
                 " - changes to the time-of-day clock may have adverse affects");
       } else {
-        fatal(err_msg("pthread_condattr_setclock: %s", strerror(status)));
+        fatal("pthread_condattr_setclock: %s", strerror(status));
       }
     }
   }
--- a/src/os/linux/vm/vmError_linux.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/linux/vm/vmError_linux.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -121,8 +121,7 @@
     return;
   }
 
-  VMError err(NULL, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(NULL, sig, pc, info, ucVoid);
 }
 
 void VMError::reset_signal_handlers() {
--- a/src/os/posix/vm/os_posix.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/posix/vm/os_posix.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1027,10 +1027,10 @@
   }
 }
 
-#define check_with_errno(check_type, cond, msg)                                      \
-  do {                                                                               \
-    int err = errno;                                                                 \
-    check_type(cond, err_msg("%s; error='%s' (errno=%d)", msg, strerror(err), err)); \
+#define check_with_errno(check_type, cond, msg)                             \
+  do {                                                                      \
+    int err = errno;                                                        \
+    check_type(cond, "%s; error='%s' (errno=%d)", msg, strerror(err), err); \
 } while (false)
 
 #define assert_with_errno(cond, msg)    check_with_errno(assert, cond, msg)
--- a/src/os/solaris/vm/os_solaris.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/solaris/vm/os_solaris.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1118,8 +1118,7 @@
 
 
 void _handle_uncaught_cxx_exception() {
-  VMError err("An uncaught C++ exception");
-  err.report_and_die();
+  VMError::report_and_die("An uncaught C++ exception");
 }
 
 
@@ -1330,7 +1329,7 @@
 jlong os::javaTimeMillis() {
   timeval t;
   if (gettimeofday(&t, NULL) == -1) {
-    fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno)));
+    fatal("os::javaTimeMillis: gettimeofday (%s)", strerror(errno));
   }
   return jlong(t.tv_sec) * 1000  +  jlong(t.tv_usec) / 1000;
 }
@@ -1338,7 +1337,7 @@
 void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) {
   timeval t;
   if (gettimeofday(&t, NULL) == -1) {
-    fatal(err_msg("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno)));
+    fatal("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno));
   }
   seconds = jlong(t.tv_sec);
   nanos = jlong(t.tv_usec) * 1000;
@@ -2392,14 +2391,14 @@
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, bytes, exec, err);
-    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
 size_t os::Solaris::page_size_for_alignment(size_t alignment) {
   assert(is_size_aligned(alignment, (size_t) vm_page_size()),
-         err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT,
-                 alignment, (size_t) vm_page_size()));
+         SIZE_FORMAT " is not aligned to " SIZE_FORMAT,
+         alignment, (size_t) vm_page_size());
 
   for (int i = 0; _page_sizes[i] != 0; i++) {
     if (is_size_aligned(alignment, _page_sizes[i])) {
@@ -2415,7 +2414,7 @@
   int err = Solaris::commit_memory_impl(addr, bytes, exec);
   if (err == 0 && UseLargePages && alignment_hint > 0) {
     assert(is_size_aligned(bytes, alignment_hint),
-           err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, alignment_hint));
+           SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, alignment_hint);
 
     // The syscall memcntl requires an exact page size (see man memcntl for details).
     size_t page_size = page_size_for_alignment(alignment_hint);
@@ -2439,7 +2438,7 @@
   if (err != 0) {
     // the caller wants all commit errors to exit with the specified mesg:
     warn_fail_commit_memory(addr, bytes, alignment_hint, exec, err);
-    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
@@ -2969,11 +2968,11 @@
 }
 
 bool os::Solaris::setup_large_pages(caddr_t start, size_t bytes, size_t align) {
-  assert(is_valid_page_size(align), err_msg(SIZE_FORMAT " is not a valid page size", align));
+  assert(is_valid_page_size(align), SIZE_FORMAT " is not a valid page size", align);
   assert(is_ptr_aligned((void*) start, align),
-         err_msg(PTR_FORMAT " is not aligned to " SIZE_FORMAT, p2i((void*) start), align));
+         PTR_FORMAT " is not aligned to " SIZE_FORMAT, p2i((void*) start), align);
   assert(is_size_aligned(bytes, align),
-         err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, align));
+         SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, align);
 
   // Signal to OS that we want large pages for addresses
   // from addr, addr + bytes
@@ -3956,8 +3955,8 @@
       // libjsig also interposes the sigaction() call below and saves the
       // old sigaction on it own.
     } else {
-      fatal(err_msg("Encountered unexpected pre-existing sigaction handler "
-                    "%#lx for signal %d.", (long)oldhand, sig));
+      fatal("Encountered unexpected pre-existing sigaction handler "
+            "%#lx for signal %d.", (long)oldhand, sig);
     }
   }
 
@@ -4403,8 +4402,7 @@
 
   page_size = sysconf(_SC_PAGESIZE);
   if (page_size == -1) {
-    fatal(err_msg("os_solaris.cpp: os::init: sysconf failed (%s)",
-                  strerror(errno)));
+    fatal("os_solaris.cpp: os::init: sysconf failed (%s)", strerror(errno));
   }
   init_page_sizes((size_t) page_size);
 
@@ -4416,7 +4414,7 @@
 
   int fd = ::open("/dev/zero", O_RDWR);
   if (fd < 0) {
-    fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno)));
+    fatal("os::init: cannot open /dev/zero (%s)", strerror(errno));
   } else {
     Solaris::set_dev_zero_fd(fd);
 
--- a/src/os/solaris/vm/threadCritical_solaris.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/solaris/vm/threadCritical_solaris.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -48,8 +48,8 @@
     thread_t owner = thr_self();
     if (global_mut_owner != owner) {
       if (os::Solaris::mutex_lock(&global_mut))
-        fatal(err_msg("ThreadCritical::ThreadCritical: mutex_lock failed (%s)",
-                      strerror(errno)));
+        fatal("ThreadCritical::ThreadCritical: mutex_lock failed (%s)",
+              strerror(errno));
       assert(global_mut_count == 0, "must have clean count");
       assert(global_mut_owner == -1, "must have clean owner");
     }
@@ -68,8 +68,7 @@
     if (global_mut_count == 0) {
       global_mut_owner = -1;
       if (os::Solaris::mutex_unlock(&global_mut))
-        fatal(err_msg("ThreadCritical::~ThreadCritical: mutex_unlock failed "
-                      "(%s)", strerror(errno)));
+        fatal("ThreadCritical::~ThreadCritical: mutex_unlock failed (%s)", strerror(errno));
     }
   } else {
     assert (Threads::number_of_threads() == 0, "valid only during initialization");
--- a/src/os/solaris/vm/vmError_solaris.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/solaris/vm/vmError_solaris.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -117,8 +117,7 @@
     return;
   }
 
-  VMError err(NULL, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(NULL, sig, pc, info, ucVoid);
 }
 
 void VMError::reset_signal_handlers() {
--- a/src/os/windows/vm/os_windows.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/windows/vm/os_windows.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -823,7 +823,7 @@
   java_origin.wMilliseconds  = 0;
   FILETIME jot;
   if (!SystemTimeToFileTime(&java_origin, &jot)) {
-    fatal(err_msg("Error = %d\nWindows error", GetLastError()));
+    fatal("Error = %d\nWindows error", GetLastError());
   }
   _calculated_offset = jlong_from(jot.dwHighDateTime, jot.dwLowDateTime);
   _has_calculated_offset = 1;
@@ -1936,7 +1936,7 @@
 WindowsSemaphore::WindowsSemaphore(uint value) {
   _semaphore = ::CreateSemaphore(NULL, value, LONG_MAX, NULL);
 
-  guarantee(_semaphore != NULL, err_msg("CreateSemaphore failed with error code: %lu", GetLastError()));
+  guarantee(_semaphore != NULL, "CreateSemaphore failed with error code: %lu", GetLastError());
 }
 
 WindowsSemaphore::~WindowsSemaphore() {
@@ -1947,14 +1947,14 @@
   if (count > 0) {
     BOOL ret = ::ReleaseSemaphore(_semaphore, count, NULL);
 
-    assert(ret != 0, err_msg("ReleaseSemaphore failed with error code: %lu", GetLastError()));
+    assert(ret != 0, "ReleaseSemaphore failed with error code: %lu", GetLastError());
   }
 }
 
 void WindowsSemaphore::wait() {
   DWORD ret = ::WaitForSingleObject(_semaphore, INFINITE);
-  assert(ret != WAIT_FAILED,   err_msg("WaitForSingleObject failed with error code: %lu", GetLastError()));
-  assert(ret == WAIT_OBJECT_0, err_msg("WaitForSingleObject failed with return value: %lu", ret));
+  assert(ret != WAIT_FAILED,   "WaitForSingleObject failed with error code: %lu", GetLastError());
+  assert(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with return value: %lu", ret);
 }
 
 // sun.misc.Signal
@@ -2344,8 +2344,7 @@
 
 static inline void report_error(Thread* t, DWORD exception_code,
                                 address addr, void* siginfo, void* context) {
-  VMError err(t, exception_code, addr, siginfo, context);
-  err.report_and_die();
+  VMError::report_and_die(t, exception_code, addr, siginfo, context);
 
   // If UseOsErrorReporting, this will return here and save the error file
   // somewhere where we can find it in the minidump.
@@ -3325,7 +3324,7 @@
   assert(mesg != NULL, "mesg must be specified");
   if (!pd_commit_memory(addr, size, exec)) {
     warn_fail_commit_memory(addr, size, exec);
-    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
+    vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "%s", mesg);
   }
 }
 
@@ -5259,7 +5258,7 @@
       }
       DWORD err = GetLastError();
       if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
-        fatal(err_msg("heap walk aborted with error %d", err));
+        fatal("heap walk aborted with error %d", err);
       }
       HeapUnlock(heap);
     }
@@ -5978,8 +5977,8 @@
       os::release_memory_special(actual_location, expected_allocation_size);
       // only now check, after releasing any memory to avoid any leaks.
       assert(actual_location == expected_location,
-             err_msg("Failed to allocate memory at requested location " PTR_FORMAT " of size " SIZE_FORMAT ", is " PTR_FORMAT " instead",
-             expected_location, expected_allocation_size, actual_location));
+             "Failed to allocate memory at requested location " PTR_FORMAT " of size " SIZE_FORMAT ", is " PTR_FORMAT " instead",
+             expected_location, expected_allocation_size, actual_location);
     }
   }
 
--- a/src/os/windows/vm/vmError_windows.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os/windows/vm/vmError_windows.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -70,9 +70,8 @@
 
 LONG WINAPI crash_handler(struct _EXCEPTION_POINTERS* exceptionInfo) {
   DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode;
-  VMError err(NULL, exception_code, NULL,
-                exceptionInfo->ExceptionRecord, exceptionInfo->ContextRecord);
-  err.report_and_die();
+  VMError::report_and_die(NULL, exception_code, NULL, exceptionInfo->ExceptionRecord,
+                          exceptionInfo->ContextRecord);
   return EXCEPTION_CONTINUE_SEARCH;
 }
 
--- a/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -468,8 +468,7 @@
   sigaddset(&newset, sig);
   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
   return 0;
--- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -731,8 +731,7 @@
   sigaddset(&newset, sig);
   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
   return false;
@@ -865,7 +864,7 @@
   int rslt = pthread_stackseg_np(pthread_self(), &ss);
 
   if (rslt != 0)
-    fatal(err_msg("pthread_stackseg_np failed with err = %d", rslt));
+    fatal("pthread_stackseg_np failed with err = %d", rslt);
 
   *bottom = (address)((char *)ss.ss_sp - ss.ss_size);
   *size   = ss.ss_size;
@@ -876,12 +875,12 @@
 
   // JVM needs to know exact stack location, abort if it fails
   if (rslt != 0)
-    fatal(err_msg("pthread_attr_init failed with err = %d", rslt));
+    fatal("pthread_attr_init failed with err = %d", rslt);
 
   rslt = pthread_attr_get_np(pthread_self(), &attr);
 
   if (rslt != 0)
-    fatal(err_msg("pthread_attr_get_np failed with err = %d", rslt));
+    fatal("pthread_attr_get_np failed with err = %d", rslt);
 
   if (pthread_attr_getstackaddr(&attr, (void **)bottom) != 0 ||
     pthread_attr_getstacksize(&attr, size) != 0) {
--- a/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -320,8 +320,7 @@
   int rslt = pthread_stackseg_np(pthread_self(), &ss);
 
   if (rslt != 0)
-    fatal(err_msg("pthread_stackseg_np failed with err = " INT32_FORMAT,
-          rslt));
+    fatal("pthread_stackseg_np failed with err = " INT32_FORMAT, rslt);
 
   stack_top = (address) ss.ss_sp;
   stack_bytes  = ss.ss_size;
@@ -333,13 +332,12 @@
 
   // JVM needs to know exact stack location, abort if it fails
   if (rslt != 0)
-    fatal(err_msg("pthread_attr_init failed with err = " INT32_FORMAT, rslt));
+    fatal("pthread_attr_init failed with err = " INT32_FORMAT, rslt);
 
   rslt = pthread_attr_get_np(pthread_self(), &attr);
 
   if (rslt != 0)
-    fatal(err_msg("pthread_attr_get_np failed with err = " INT32_FORMAT,
-          rslt));
+    fatal("pthread_attr_get_np failed with err = " INT32_FORMAT, rslt);
 
   if (pthread_attr_getstackaddr(&attr, (void **) &stack_bottom) != 0 ||
       pthread_attr_getstacksize(&attr, &stack_bytes) != 0) {
--- a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -464,8 +464,7 @@
   sigaddset(&newset, sig);
   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
   return true; // Mute compiler
@@ -558,7 +557,7 @@
        if (rslt == ENOMEM) {
          vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
        } else {
-         fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt));
+         fatal("pthread_getattr_np failed with errno = %d", rslt);
        }
      }
 
--- a/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -439,8 +439,7 @@
   sigaddset(&newset, sig);
   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
   return false;
@@ -531,7 +530,7 @@
       if (rslt == ENOMEM) {
         vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
       } else {
-        fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt));
+        fatal("pthread_getattr_np failed with errno = %d", rslt);
       }
     }
 
--- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -172,7 +172,7 @@
       if (rslt == ENOMEM) {
         vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
       } else {
-        fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt));
+        fatal("pthread_getattr_np failed with errno = %d", rslt);
       }
     }
 
@@ -692,8 +692,7 @@
   sigaddset(&newset, sig);
   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
 }
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -542,8 +542,7 @@
   sigaddset(&newset, sig);
   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
   return true; // Mute compiler
@@ -689,7 +688,7 @@
        if (rslt == ENOMEM) {
          vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
        } else {
-         fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt));
+         fatal("pthread_getattr_np failed with errno = %d", rslt);
        }
      }
 
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -328,7 +328,7 @@
       vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
     }
     else {
-      fatal(err_msg("pthread_getattr_np failed with errno = %d", res));
+      fatal("pthread_getattr_np failed with errno = %d", res);
     }
   }
 
@@ -336,7 +336,7 @@
   size_t stack_bytes;
   res = pthread_attr_getstack(&attr, (void **) &stack_bottom, &stack_bytes);
   if (res != 0) {
-    fatal(err_msg("pthread_attr_getstack failed with errno = %d", res));
+    fatal("pthread_attr_getstack failed with errno = %d", res);
   }
   address stack_top = stack_bottom + stack_bytes;
 
@@ -348,7 +348,7 @@
   size_t guard_bytes;
   res = pthread_attr_getguardsize(&attr, &guard_bytes);
   if (res != 0) {
-    fatal(err_msg("pthread_attr_getguardsize failed with errno = %d", res));
+    fatal("pthread_attr_getguardsize failed with errno = %d", res);
   }
   int guard_pages = align_size_up(guard_bytes, page_bytes) / page_bytes;
   assert(guard_bytes == guard_pages * page_bytes, "unaligned guard");
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -549,8 +549,7 @@
     vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack.");
   }
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
 }
--- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -707,8 +707,7 @@
     vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack.");
   }
 
-  VMError err(t, sig, pc, info, ucVoid);
-  err.report_and_die();
+  VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();
   return false;
--- a/src/share/vm/Xusage.txt	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/Xusage.txt	Wed Oct 07 01:03:24 2015 +0200
@@ -7,6 +7,7 @@
     -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                       prepend in front of bootstrap class path
     -Xnoclassgc       disable class garbage collection
+    -Xlog:<opts>      control JVM logging, use -Xlog:help for details
     -Xloggc:<file>    log GC status to a file with time stamps
     -Xbatch           disable background compilation
     -Xms<size>        set initial Java heap size
--- a/src/share/vm/asm/assembler.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/asm/assembler.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -43,8 +43,7 @@
   CodeSection* cs = code->insts();
   cs->clear_mark();   // new assembler kills old mark
   if (cs->start() == NULL)  {
-    vm_exit_out_of_memory(0, OOM_MMAP_ERROR, err_msg("CodeCache: no room for %s",
-                                     code->name()));
+    vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "CodeCache: no room for %s", code->name());
   }
   _code_section = cs;
   _oop_recorder= code->oop_recorder();
--- a/src/share/vm/asm/codeBuffer.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/asm/codeBuffer.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -173,7 +173,7 @@
   bool allocates(address pc) const  { return pc >= _start && pc <  _limit; }
   bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
 
-  void    set_end(address pc)       { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit))); _end = pc; }
+  void    set_end(address pc)       { assert(allocates2(pc), "not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit)); _end = pc; }
   void    set_mark(address pc)      { assert(contains2(pc), "not in codeBuffer");
                                       _mark = pc; }
   void    set_mark_off(int offset)  { assert(contains2(offset+_start),"not in codeBuffer");
--- a/src/share/vm/asm/register.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/asm/register.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -121,8 +121,7 @@
 ) {
   assert(
     a != b,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "",
-                p2i(a), p2i(b))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "", p2i(a), p2i(b)
   );
 }
 
@@ -135,9 +134,9 @@
   assert(
     a != b && a != c
            && b != c,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c)
   );
 }
 
@@ -152,9 +151,9 @@
     a != b && a != c && a != d
            && b != c && b != d
                      && c != d,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d)
   );
 }
 
@@ -171,9 +170,9 @@
            && b != c && b != d && b != e
                      && c != d && c != e
                                && d != e,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e)
   );
 }
 
@@ -192,10 +191,10 @@
                      && c != d && c != e && c != f
                                && d != e && d != f
                                          && e != f,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
-                ", f=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+    ", f=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f)
   );
 }
 
@@ -216,10 +215,10 @@
                                && d != e && d != f && d != g
                                          && e != f && e != g
                                                    && f != g,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
-                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+    ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g)
   );
 }
 
@@ -242,10 +241,10 @@
                                          && e != f && e != g && e != h
                                                    && f != g && f != h
                                                              && g != h,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
-                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+    ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h)
   );
 }
 
@@ -270,11 +269,11 @@
                                                    && f != g && f != h && f != i
                                                              && g != h && g != i
                                                                        && h != i,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
-                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
-                ", i=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+    ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
+    ", i=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i)
   );
 }
 
@@ -300,11 +299,11 @@
                                                              && g != h && g != i && g != j
                                                                        && h != i && h != j
                                                                                  && i != j,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
-                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
-                ", i=" INTPTR_FORMAT ", j=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i), p2i(j))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+    ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
+    ", i=" INTPTR_FORMAT ", j=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i), p2i(j)
   );
 }
 
@@ -332,11 +331,11 @@
                                                                        && h != i && h != j && h !=k
                                                                                  && i != j && i !=k
                                                                                            && j !=k,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
-                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
-                ", i=" INTPTR_FORMAT ", j=" INTPTR_FORMAT ", k=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i), p2i(j), p2i(k))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+    ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
+    ", i=" INTPTR_FORMAT ", j=" INTPTR_FORMAT ", k=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i), p2i(j), p2i(k)
   );
 }
 
@@ -366,12 +365,12 @@
                                                                                  && i != j && i !=k && i !=l
                                                                                            && j !=k && j !=l
                                                                                                     && k !=l,
-    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
-                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
-                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
-                ", i=" INTPTR_FORMAT ", j=" INTPTR_FORMAT ", k=" INTPTR_FORMAT
-                ", l=" INTPTR_FORMAT "",
-                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i), p2i(j), p2i(k), p2i(l))
+    "registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+    ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+    ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
+    ", i=" INTPTR_FORMAT ", j=" INTPTR_FORMAT ", k=" INTPTR_FORMAT
+    ", l=" INTPTR_FORMAT "",
+    p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i), p2i(j), p2i(k), p2i(l)
   );
 }
 
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -4018,7 +4018,7 @@
     break;
 
   default:
-    fatal(err_msg("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
+    fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
     break;
   }
   set_state(state_before);
--- a/src/share/vm/c1/c1_LIRAssembler.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/c1/c1_LIRAssembler.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -462,7 +462,7 @@
     vtable_call(op);
     break;
   default:
-    fatal(err_msg_res("unexpected op code: %s", op->name()));
+    fatal("unexpected op code: %s", op->name());
     break;
   }
 
--- a/src/share/vm/c1/c1_LIRGenerator.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -920,7 +920,7 @@
 
 LIR_Opr LIRGenerator::force_to_spill(LIR_Opr value, BasicType t) {
   assert(type2size[t] == type2size[value->type()],
-         err_msg_res("size mismatch: t=%s, value->type()=%s", type2name(t), type2name(value->type())));
+         "size mismatch: t=%s, value->type()=%s", type2name(t), type2name(value->type()));
   if (!value->is_register()) {
     // force into a register
     LIR_Opr r = new_register(value->type());
@@ -1630,6 +1630,9 @@
     __ move(dirty, card_addr);
     __ branch_destination(L_already_dirty->label());
   } else {
+    if (UseConcMarkSweepGC && CMSPrecleaningEnabled) {
+      __ membar_storestore();
+    }
     __ move(dirty, card_addr);
   }
 #endif
@@ -2829,7 +2832,7 @@
 
 void LIRGenerator::invoke_load_arguments(Invoke* x, LIRItemList* args, const LIR_OprList* arg_list) {
   assert(args->length() == arg_list->length(),
-         err_msg_res("args=%d, arg_list=%d", args->length(), arg_list->length()));
+         "args=%d, arg_list=%d", args->length(), arg_list->length());
   for (int i = x->has_receiver() ? 1 : 0; i < args->length(); i++) {
     LIRItem* param = args->at(i);
     LIR_Opr loc = arg_list->at(i);
@@ -2973,7 +2976,7 @@
       break;
     }
     default:
-      fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(x->code())));
+      fatal("unexpected bytecode: %s", Bytecodes::name(x->code()));
       break;
   }
 
--- a/src/share/vm/ci/ciKlass.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/ci/ciKlass.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -66,8 +66,8 @@
 // ------------------------------------------------------------------
 // ciKlass::is_subtype_of
 bool ciKlass::is_subtype_of(ciKlass* that) {
-  assert(this->is_loaded(), err_msg("must be loaded: %s", this->name()->as_quoted_ascii()));
-  assert(that->is_loaded(), err_msg("must be loaded: %s", that->name()->as_quoted_ascii()));
+  assert(this->is_loaded(), "must be loaded: %s", this->name()->as_quoted_ascii());
+  assert(that->is_loaded(), "must be loaded: %s", that->name()->as_quoted_ascii());
 
   // Check to see if the klasses are identical.
   if (this == that) {
@@ -85,8 +85,8 @@
 // ------------------------------------------------------------------
 // ciKlass::is_subclass_of
 bool ciKlass::is_subclass_of(ciKlass* that) {
-  assert(this->is_loaded(), err_msg("must be loaded: %s", this->name()->as_quoted_ascii()));
-  assert(that->is_loaded(), err_msg("must be loaded: %s", that->name()->as_quoted_ascii()));
+  assert(this->is_loaded(), "must be loaded: %s", this->name()->as_quoted_ascii());
+  assert(that->is_loaded(), "must be loaded: %s", that->name()->as_quoted_ascii());
 
   VM_ENTRY_MARK;
   Klass* this_klass = get_Klass();
--- a/src/share/vm/ci/ciMethod.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/ci/ciMethod.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -576,13 +576,13 @@
 
 void ciMethod::assert_virtual_call_type_ok(int bci) {
   assert(java_code_at_bci(bci) == Bytecodes::_invokevirtual ||
-         java_code_at_bci(bci) == Bytecodes::_invokeinterface, err_msg("unexpected bytecode %s", Bytecodes::name(java_code_at_bci(bci))));
+         java_code_at_bci(bci) == Bytecodes::_invokeinterface, "unexpected bytecode %s", Bytecodes::name(java_code_at_bci(bci)));
 }
 
 void ciMethod::assert_call_type_ok(int bci) {
   assert(java_code_at_bci(bci) == Bytecodes::_invokestatic ||
          java_code_at_bci(bci) == Bytecodes::_invokespecial ||
-         java_code_at_bci(bci) == Bytecodes::_invokedynamic, err_msg("unexpected bytecode %s", Bytecodes::name(java_code_at_bci(bci))));
+         java_code_at_bci(bci) == Bytecodes::_invokedynamic, "unexpected bytecode %s", Bytecodes::name(java_code_at_bci(bci)));
 }
 
 /**
--- a/src/share/vm/ci/ciMethodData.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/ci/ciMethodData.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -122,7 +122,7 @@
       // An empty slot or ArgInfoData entry marks the end of the trap data
       return;
     default:
-      fatal(err_msg("bad tag = %d", dp_dst->tag()));
+      fatal("bad tag = %d", dp_dst->tag());
     }
   }
 }
@@ -289,7 +289,7 @@
       break;
     }
     default:
-      fatal(err_msg("bad tag = %d", dp->tag()));
+      fatal("bad tag = %d", dp->tag());
     }
   }
   return NULL;
@@ -578,7 +578,7 @@
       break;
     }
     default:
-      fatal(err_msg("bad tag = %d", dp->tag()));
+      fatal("bad tag = %d", dp->tag());
     }
   }
 }
@@ -690,7 +690,7 @@
       data = new ciSpeculativeTrapData(dp);
       break;
     default:
-      fatal(err_msg("unexpected tag %d", dp->tag()));
+      fatal("unexpected tag %d", dp->tag());
     }
     st->print("%d", dp_to_di(data->dp()));
     st->fill_to(6);
--- a/src/share/vm/ci/ciReplay.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/ci/ciReplay.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -730,7 +730,7 @@
           if (parsed_two_word == i) continue;
 
         default:
-          fatal(err_msg_res("Unexpected tag: %d", cp->tag_at(i).value()));
+          fatal("Unexpected tag: %d", cp->tag_at(i).value());
           break;
       }
 
--- a/src/share/vm/ci/ciTypeFlow.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/ci/ciTypeFlow.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1964,7 +1964,7 @@
   _has_irreducible_entry = false;
   _osr_bci = osr_bci;
   _failure_reason = NULL;
-  assert(0 <= start_bci() && start_bci() < code_size() , err_msg("correct osr_bci argument: 0 <= %d < %d", start_bci(), code_size()));
+  assert(0 <= start_bci() && start_bci() < code_size() , "correct osr_bci argument: 0 <= %d < %d", start_bci(), code_size());
   _work_list = NULL;
 
   _ciblock_count = _methodBlocks->num_blocks();
--- a/src/share/vm/classfile/altHashing.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/classfile/altHashing.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -262,10 +262,9 @@
   juint final_hash = murmur3_32(hashes, 4*256);
 
   assert (MURMUR3_32_X86_CHECK_VALUE == final_hash,
-    err_msg(
-        "Calculated hash result not as expected. Expected %08X got %08X\n",
-        MURMUR3_32_X86_CHECK_VALUE,
-        final_hash));
+          "Calculated hash result not as expected. Expected %08X got %08X\n",
+          MURMUR3_32_X86_CHECK_VALUE,
+          final_hash);
 }
 
 void AltHashing::testEquivalentHashes() {
@@ -276,24 +275,24 @@
   jbytes = murmur3_32(TWO_BYTE, 2);
   jchars = murmur3_32(ONE_CHAR, 1);
   assert (jbytes == jchars,
-    err_msg("Hashes did not match. b:%08x != c:%08x\n", jbytes, jchars));
+          "Hashes did not match. b:%08x != c:%08x\n", jbytes, jchars);
 
   jbytes = murmur3_32(FOUR_BYTE, 4);
   jchars = murmur3_32(TWO_CHAR, 2);
   ints = murmur3_32(ONE_INT, 1);
   assert ((jbytes == jchars) && (jbytes == ints),
-    err_msg("Hashes did not match. b:%08x != c:%08x != i:%08x\n", jbytes, jchars, ints));
+          "Hashes did not match. b:%08x != c:%08x != i:%08x\n", jbytes, jchars, ints);
 
   jbytes = murmur3_32(SIX_BYTE, 6);
   jchars = murmur3_32(THREE_CHAR, 3);
   assert (jbytes == jchars,
-    err_msg("Hashes did not match. b:%08x != c:%08x\n", jbytes, jchars));
+         "Hashes did not match. b:%08x != c:%08x\n", jbytes, jchars);
 
   jbytes = murmur3_32(EIGHT_BYTE, 8);
   jchars = murmur3_32(FOUR_CHAR, 4);
   ints = murmur3_32(TWO_INT, 2);
   assert ((jbytes == jchars) && (jbytes == ints),
-    err_msg("Hashes did not match. b:%08x != c:%08x != i:%08x\n", jbytes, jchars, ints));
+          "Hashes did not match. b:%08x != c:%08x != i:%08x\n", jbytes, jchars, ints);
 }
 
 // Returns true if the alternate hashcode is correct
--- a/src/share/vm/classfile/classFileParser.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/classfile/classFileParser.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -319,12 +319,12 @@
 PRAGMA_FORMAT_NONLITERAL_IGNORED
 void ClassFileParser::report_assert_property_failure(const char* msg, TRAPS) {
   ResourceMark rm(THREAD);
-  fatal(err_msg(msg, _class_name->as_C_string()));
+  fatal(msg, _class_name->as_C_string());
 }
 
 void ClassFileParser::report_assert_property_failure(const char* msg, int index, TRAPS) {
   ResourceMark rm(THREAD);
-  fatal(err_msg(msg, index, _class_name->as_C_string()));
+  fatal(msg, index, _class_name->as_C_string());
 }
 PRAGMA_DIAG_POP
 
@@ -492,8 +492,7 @@
           break;
         }
       default:
-        fatal(err_msg("bad constant pool tag value %u",
-                      cp->tag_at(index).value()));
+        fatal("bad constant pool tag value %u", cp->tag_at(index).value());
         ShouldNotReachHere();
         break;
     } // end of switch
--- a/src/share/vm/classfile/classLoaderData.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/classfile/classLoaderData.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -913,7 +913,7 @@
   }
 
   // Nothing more for the iterator to hand out.
-  assert(head == NULL, err_msg("head is " PTR_FORMAT ", expected not null:", p2i(head)));
+  assert(head == NULL, "head is " PTR_FORMAT ", expected not null:", p2i(head));
   return NULL;
 }
 
--- a/src/share/vm/classfile/metadataOnStackMark.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/classfile/metadataOnStackMark.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -119,7 +119,7 @@
     allocated = new MetadataOnStackBuffer();
   }
 
-  assert(!allocated->is_full(), err_msg("Should not be full: " PTR_FORMAT, p2i(allocated)));
+  assert(!allocated->is_full(), "Should not be full: " PTR_FORMAT, p2i(allocated));
 
   return allocated;
 }
--- a/src/share/vm/classfile/stringTable.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/classfile/stringTable.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -312,12 +312,12 @@
   const int limit = the_table()->table_size();
 
   assert(0 <= start_idx && start_idx <= limit,
-         err_msg("start_idx (%d) is out of bounds", start_idx));
+         "start_idx (%d) is out of bounds", start_idx);
   assert(0 <= end_idx && end_idx <= limit,
-         err_msg("end_idx (%d) is out of bounds", end_idx));
+         "end_idx (%d) is out of bounds", end_idx);
   assert(start_idx <= end_idx,
-         err_msg("Index ordering: start_idx=%d, end_idx=%d",
-                 start_idx, end_idx));
+         "Index ordering: start_idx=%d, end_idx=%d",
+         start_idx, end_idx);
 
   for (int i = start_idx; i < end_idx; i += 1) {
     HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
@@ -335,12 +335,12 @@
   const int limit = the_table()->table_size();
 
   assert(0 <= start_idx && start_idx <= limit,
-         err_msg("start_idx (%d) is out of bounds", start_idx));
+         "start_idx (%d) is out of bounds", start_idx);
   assert(0 <= end_idx && end_idx <= limit,
-         err_msg("end_idx (%d) is out of bounds", end_idx));
+         "end_idx (%d) is out of bounds", end_idx);
   assert(start_idx <= end_idx,
-         err_msg("Index ordering: start_idx=%d, end_idx=%d",
-                 start_idx, end_idx));
+         "Index ordering: start_idx=%d, end_idx=%d",
+         start_idx, end_idx);
 
   for (int i = start_idx; i < end_idx; ++i) {
     HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
--- a/src/share/vm/classfile/systemDictionary.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/classfile/systemDictionary.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -229,9 +229,9 @@
 
 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {
   assert(!THREAD->is_Compiler_thread(),
-         err_msg("can not load classes with compiler thread: class=%s, classloader=%s",
-                 class_name->as_C_string(),
-                 class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
+         "can not load classes with compiler thread: class=%s, classloader=%s",
+         class_name->as_C_string(),
+         class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string());
   if (FieldType::is_array(class_name)) {
     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
   } else if (FieldType::is_obj(class_name)) {
@@ -2264,7 +2264,7 @@
   assert(MethodHandles::is_signature_polymorphic(iid) &&
          MethodHandles::is_signature_polymorphic_intrinsic(iid) &&
          iid != vmIntrinsics::_invokeGeneric,
-         err_msg("must be a known MH intrinsic iid=%d: %s", iid, vmIntrinsics::name_at(iid)));
+         "must be a known MH intrinsic iid=%d: %s", iid, vmIntrinsics::name_at(iid));
 
   unsigned int hash  = invoke_method_table()->compute_hash(signature, iid);
   int          index = invoke_method_table()->hash_to_index(hash);
@@ -2390,7 +2390,7 @@
   if (klass->oop_is_typeArray()) {
     return true; // primitive array
   }
-  assert(klass->oop_is_instance(), klass->external_name());
+  assert(klass->oop_is_instance(), "%s", klass->external_name());
   return klass->is_public() &&
          (InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::Object_klass()) ||       // java.lang
           InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::MethodHandle_klass()));  // java.lang.invoke
@@ -2443,7 +2443,7 @@
       mirror = ss.as_java_mirror(class_loader, protection_domain,
                                  SignatureStream::NCDFError, CHECK_(empty));
     }
-    assert(!oopDesc::is_null(mirror), ss.as_symbol(THREAD)->as_C_string());
+    assert(!oopDesc::is_null(mirror), "%s", ss.as_symbol(THREAD)->as_C_string());
     if (ss.at_return_type())
       rt = Handle(THREAD, mirror);
     else
--- a/src/share/vm/code/codeCache.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/code/codeCache.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -365,7 +365,7 @@
   // Possibly wakes up the sweeper thread.
   NMethodSweeper::notify(code_blob_type);
   assert_locked_or_safepoint(CodeCache_lock);
-  assert(size > 0, err_msg_res("Code cache allocation request must be > 0 but is %d", size));
+  assert(size > 0, "Code cache allocation request must be > 0 but is %d", size);
   if (size <= 0) {
     return NULL;
   }
@@ -817,7 +817,7 @@
   double max_capacity = (double)heap->max_capacity();
   double result = max_capacity / unallocated_capacity;
   assert (max_capacity >= unallocated_capacity, "Must be");
-  assert (result >= 1.0, err_msg_res("reverse_free_ratio must be at least 1. It is %f", result));
+  assert (result >= 1.0, "reverse_free_ratio must be at least 1. It is %f", result);
   return result;
 }
 
--- a/src/share/vm/code/dependencies.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/code/dependencies.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -400,7 +400,7 @@
 }
 
 void Dependencies::check_valid_dependency_type(DepType dept) {
-  guarantee(FIRST_TYPE <= dept && dept < TYPE_LIMIT, err_msg("invalid dependency type: %d", (int) dept));
+  guarantee(FIRST_TYPE <= dept && dept < TYPE_LIMIT, "invalid dependency type: %d", (int) dept);
 }
 
 // for the sake of the compiler log, print out current dependencies:
--- a/src/share/vm/code/exceptionHandlerTable.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/code/exceptionHandlerTable.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -225,6 +225,6 @@
   for (uint i = 0; i < len(); i++) {
      if ((*adr(i) > (unsigned int)nm->insts_size()) ||
          (*(adr(i)+1) > (unsigned int)nm->insts_size()))
-       fatal(err_msg("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, _data));
+       fatal("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, _data);
   }
 }
--- a/src/share/vm/code/nmethod.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/code/nmethod.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1709,7 +1709,7 @@
     // Clean inline caches pointing to both zombie and not_entrant methods
     if (!nm->is_in_use() || (nm->method()->code() != nm)) {
       ic->set_to_clean();
-      assert(ic->is_clean(), err_msg("nmethod " PTR_FORMAT "not clean %s", from, from->method()->name_and_sig_as_C_string()));
+      assert(ic->is_clean(), "nmethod " PTR_FORMAT "not clean %s", from, from->method()->name_and_sig_as_C_string());
     }
   }
 
@@ -2540,7 +2540,7 @@
   ResourceMark rm;
 
   if (!CodeCache::contains(this)) {
-    fatal(err_msg("nmethod at " INTPTR_FORMAT " not in zone", this));
+    fatal("nmethod at " INTPTR_FORMAT " not in zone", this);
   }
 
   if(is_native_method() )
@@ -2548,8 +2548,7 @@
 
   nmethod* nm = CodeCache::find_nmethod(verified_entry_point());
   if (nm != this) {
-    fatal(err_msg("findNMethod did not find this nmethod (" INTPTR_FORMAT ")",
-                  this));
+    fatal("findNMethod did not find this nmethod (" INTPTR_FORMAT ")", this);
   }
 
   for (PcDesc* p = scopes_pcs_begin(); p < scopes_pcs_end(); p++) {
--- a/src/share/vm/code/stubs.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/code/stubs.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -67,7 +67,7 @@
   intptr_t size = round_to(buffer_size, 2*BytesPerWord);
   BufferBlob* blob = BufferBlob::create(name, size);
   if( blob == NULL) {
-    vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, err_msg("CodeCache: no room for %s", name));
+    vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "CodeCache: no room for %s", name);
   }
   _stub_interface  = stub_interface;
   _buffer_size     = blob->content_size();
--- a/src/share/vm/code/vtableStubs.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/code/vtableStubs.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -222,9 +222,9 @@
   InstanceKlass* ik = InstanceKlass::cast(klass);
   klassVtable* vt = ik->vtable();
   ik->print();
-  fatal(err_msg("bad compiled vtable dispatch: receiver " INTPTR_FORMAT ", "
-                "index %d (vtable length %d)",
-                (address)receiver, index, vt->length()));
+  fatal("bad compiled vtable dispatch: receiver " INTPTR_FORMAT ", "
+        "index %d (vtable length %d)",
+        (address)receiver, index, vt->length());
 }
 
-#endif // Product
+#endif // PRODUCT
--- a/src/share/vm/compiler/compileBroker.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/compiler/compileBroker.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1669,8 +1669,8 @@
       }
       if (PrintCompilation) {
         FormatBufferResource msg = retry_message != NULL ?
-            err_msg_res("COMPILE SKIPPED: %s (%s)", ci_env.failure_reason(), retry_message) :
-            err_msg_res("COMPILE SKIPPED: %s",      ci_env.failure_reason());
+            FormatBufferResource("COMPILE SKIPPED: %s (%s)", ci_env.failure_reason(), retry_message) :
+            FormatBufferResource("COMPILE SKIPPED: %s",      ci_env.failure_reason());
         task->print(tty, msg);
       }
     } else {
--- a/src/share/vm/gc/cms/adaptiveFreeList.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/adaptiveFreeList.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -133,17 +133,17 @@
           + _allocation_stats.coal_births() + 1)   // Total Production Stock + 1
          >= (_allocation_stats.split_deaths() + _allocation_stats.coal_deaths()
              + (ssize_t)count()),                // Total Current Stock + depletion
-         err_msg("FreeList " PTR_FORMAT " of size " SIZE_FORMAT
-                 " violates Conservation Principle: "
-                 "prev_sweep(" SIZE_FORMAT ")"
-                 " + split_births(" SIZE_FORMAT ")"
-                 " + coal_births(" SIZE_FORMAT ") + 1 >= "
-                 " split_deaths(" SIZE_FORMAT ")"
-                 " coal_deaths(" SIZE_FORMAT ")"
-                 " + count(" SSIZE_FORMAT ")",
-                 p2i(this), size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
-                 _allocation_stats.coal_births(), _allocation_stats.split_deaths(),
-                 _allocation_stats.coal_deaths(), count()));
+         "FreeList " PTR_FORMAT " of size " SIZE_FORMAT
+         " violates Conservation Principle: "
+         "prev_sweep(" SIZE_FORMAT ")"
+         " + split_births(" SIZE_FORMAT ")"
+         " + coal_births(" SIZE_FORMAT ") + 1 >= "
+         " split_deaths(" SIZE_FORMAT ")"
+         " coal_deaths(" SIZE_FORMAT ")"
+         " + count(" SSIZE_FORMAT ")",
+         p2i(this), size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
+         _allocation_stats.coal_births(), _allocation_stats.split_deaths(),
+         _allocation_stats.coal_deaths(), count());
 }
 #endif
 
--- a/src/share/vm/gc/cms/allocationStats.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/allocationStats.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -105,9 +105,9 @@
       ssize_t demand = prev_sweep() - (ssize_t)count + split_births() + coal_births()
                        - split_deaths() - coal_deaths();
       assert(demand >= 0,
-             err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for "
-                     PTR_FORMAT " (size=" SIZE_FORMAT ")",
-                     demand, p2i(this), count));
+             "Demand (" SSIZE_FORMAT ") should be non-negative for "
+             PTR_FORMAT " (size=" SIZE_FORMAT ")",
+             demand, p2i(this), count);
       // Defensive: adjust for imprecision in event counting
       if (demand < 0) {
         demand = 0;
--- a/src/share/vm/gc/cms/compactibleFreeListSpace.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/compactibleFreeListSpace.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1959,9 +1959,9 @@
   MemRegion ur    = used_region();
   MemRegion urasm = used_region_at_save_marks();
   assert(ur.contains(urasm),
-         err_msg(" Error at save_marks(): [" PTR_FORMAT "," PTR_FORMAT ")"
-                 " should contain [" PTR_FORMAT "," PTR_FORMAT ")",
-                 p2i(ur.start()), p2i(ur.end()), p2i(urasm.start()), p2i(urasm.end())));
+         " Error at save_marks(): [" PTR_FORMAT "," PTR_FORMAT ")"
+         " should contain [" PTR_FORMAT "," PTR_FORMAT ")",
+         p2i(ur.start()), p2i(ur.end()), p2i(urasm.start()), p2i(urasm.end()));
 #endif
   // inform allocator that promotions should be tracked.
   assert(_promoInfo.noPromotions(), "_promoInfo inconsistency");
@@ -2875,9 +2875,9 @@
     smallSplitBirth(rem);
   }
   assert(n * word_sz == fc->size(),
-    err_msg("Chunk size " SIZE_FORMAT " is not exactly splittable by "
-    SIZE_FORMAT " sized chunks of size " SIZE_FORMAT,
-    fc->size(), n, word_sz));
+         "Chunk size " SIZE_FORMAT " is not exactly splittable by "
+         SIZE_FORMAT " sized chunks of size " SIZE_FORMAT,
+         fc->size(), n, word_sz);
   return fc;
 }
 
--- a/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -1593,7 +1593,7 @@
   SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
   gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
 
-  GCTraceTime t("CMS:MSC ", PrintGCDetails && Verbose, true, NULL, gc_tracer->gc_id());
+  GCTraceTime t("CMS:MSC ", PrintGCDetails && Verbose, true, NULL);
 
   // Temporarily widen the span of the weak reference processing to
   // the entire heap.
@@ -2825,7 +2825,6 @@
  public:
   CMSPhaseAccounting(CMSCollector *collector,
                      const char *phase,
-                     const GCId gc_id,
                      bool print_cr = true);
   ~CMSPhaseAccounting();
 
@@ -2834,7 +2833,6 @@
   const char *_phase;
   elapsedTimer _wallclock;
   bool _print_cr;
-  const GCId _gc_id;
 
  public:
   // Not MT-safe; so do not pass around these StackObj's
@@ -2850,15 +2848,14 @@
 
 CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector,
                                        const char *phase,
-                                       const GCId gc_id,
                                        bool print_cr) :
-  _collector(collector), _phase(phase), _print_cr(print_cr), _gc_id(gc_id) {
+  _collector(collector), _phase(phase), _print_cr(print_cr) {
 
   if (PrintCMSStatistics != 0) {
     _collector->resetYields();
   }
   if (PrintGCDetails) {
-    gclog_or_tty->gclog_stamp(_gc_id);
+    gclog_or_tty->gclog_stamp();
     gclog_or_tty->print_cr("[%s-concurrent-%s-start]",
       _collector->cmsGen()->short_name(), _phase);
   }
@@ -2872,7 +2869,7 @@
   _collector->stopTimer();
   _wallclock.stop();
   if (PrintGCDetails) {
-    gclog_or_tty->gclog_stamp(_gc_id);
+    gclog_or_tty->gclog_stamp();
     gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]",
                  _collector->cmsGen()->short_name(),
                  _phase, _collector->timerValue(), _wallclock.seconds());
@@ -2951,7 +2948,7 @@
   setup_cms_unloading_and_verification_state();
 
   NOT_PRODUCT(GCTraceTime t("\ncheckpointRootsInitialWork",
-    PrintGCDetails && Verbose, true, _gc_timer_cm, _gc_tracer_cm->gc_id());)
+    PrintGCDetails && Verbose, true, _gc_timer_cm);)
 
   // Reset all the PLAB chunk arrays if necessary.
   if (_survivor_plab_array != NULL && !CMSPLABRecordAlways) {
@@ -3054,7 +3051,7 @@
 
   CMSTokenSyncWithLocks ts(true, bitMapLock());
   TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-  CMSPhaseAccounting pa(this, "mark", _gc_tracer_cm->gc_id(), !PrintGCDetails);
+  CMSPhaseAccounting pa(this, "mark", !PrintGCDetails);
   bool res = markFromRootsWork();
   if (res) {
     _collectorState = Precleaning;
@@ -3476,7 +3473,7 @@
 // been published), so we do not need to check for
 // uninitialized objects before pushing here.
 void Par_ConcMarkingClosure::do_oop(oop obj) {
-  assert(obj->is_oop_or_null(true), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj)));
+  assert(obj->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj));
   HeapWord* addr = (HeapWord*)obj;
   // Check if oop points into the CMS generation
   // and is not marked
@@ -3751,7 +3748,7 @@
       _start_sampling = false;
     }
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    CMSPhaseAccounting pa(this, "preclean", _gc_tracer_cm->gc_id(), !PrintGCDetails);
+    CMSPhaseAccounting pa(this, "preclean", !PrintGCDetails);
     preclean_work(CMSPrecleanRefLists1, CMSPrecleanSurvivors1);
   }
   CMSTokenSync x(true); // is cms thread
@@ -3780,7 +3777,7 @@
   // we will never do an actual abortable preclean cycle.
   if (get_eden_used() > CMSScheduleRemarkEdenSizeThreshold) {
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    CMSPhaseAccounting pa(this, "abortable-preclean", _gc_tracer_cm->gc_id(), !PrintGCDetails);
+    CMSPhaseAccounting pa(this, "abortable-preclean", !PrintGCDetails);
     // We need more smarts in the abortable preclean
     // loop below to deal with cases where allocation
     // in young gen is very very slow, and our precleaning
@@ -3925,7 +3922,7 @@
     GCTimer *gc_timer = NULL; // Currently not tracing concurrent phases
     rp->preclean_discovered_references(
           rp->is_alive_non_header(), &keep_alive, &complete_trace, &yield_cl,
-          gc_timer, _gc_tracer_cm->gc_id());
+          gc_timer);
   }
 
   if (clean_survivor) {  // preclean the active survivor space(s)
@@ -4261,7 +4258,7 @@
       // expect it to be false and set to true
       FlagSetting fl(gch->_is_gc_active, false);
       NOT_PRODUCT(GCTraceTime t("Scavenge-Before-Remark",
-        PrintGCDetails && Verbose, true, _gc_timer_cm, _gc_tracer_cm->gc_id());)
+        PrintGCDetails && Verbose, true, _gc_timer_cm);)
       gch->do_collection(true,                      // full (i.e. force, see below)
                          false,                     // !clear_all_soft_refs
                          0,                         // size
@@ -4279,7 +4276,7 @@
 }
 
 void CMSCollector::checkpointRootsFinalWork() {
-  NOT_PRODUCT(GCTraceTime tr("checkpointRootsFinalWork", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());)
+  NOT_PRODUCT(GCTraceTime tr("checkpointRootsFinalWork", PrintGCDetails, false, _gc_timer_cm);)
 
   assert(haveFreelistLocks(), "must have free list locks");
   assert_lock_strong(bitMapLock());
@@ -4329,11 +4326,10 @@
     // the most recent young generation GC, minus those cleaned up by the
     // concurrent precleaning.
     if (CMSParallelRemarkEnabled) {
-      GCTraceTime t("Rescan (parallel) ", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+      GCTraceTime t("Rescan (parallel) ", PrintGCDetails, false, _gc_timer_cm);
       do_remark_parallel();
     } else {
-      GCTraceTime t("Rescan (non-parallel) ", PrintGCDetails, false,
-                  _gc_timer_cm, _gc_tracer_cm->gc_id());
+      GCTraceTime t("Rescan (non-parallel) ", PrintGCDetails, false, _gc_timer_cm);
       do_remark_non_parallel();
     }
   }
@@ -4341,7 +4337,7 @@
   verify_overflow_empty();
 
   {
-    NOT_PRODUCT(GCTraceTime ts("refProcessingWork", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());)
+    NOT_PRODUCT(GCTraceTime ts("refProcessingWork", PrintGCDetails, false, _gc_timer_cm);)
     refProcessingWork();
   }
   verify_work_stacks_empty();
@@ -5116,7 +5112,7 @@
                               NULL,  // space is set further below
                               &_markBitMap, &_markStack, &mrias_cl);
   {
-    GCTraceTime t("grey object rescan", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+    GCTraceTime t("grey object rescan", PrintGCDetails, false, _gc_timer_cm);
     // Iterate over the dirty cards, setting the corresponding bits in the
     // mod union table.
     {
@@ -5153,7 +5149,7 @@
     Universe::verify();
   }
   {
-    GCTraceTime t("root rescan", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+    GCTraceTime t("root rescan", PrintGCDetails, false, _gc_timer_cm);
 
     verify_work_stacks_empty();
 
@@ -5175,7 +5171,7 @@
   }
 
   {
-    GCTraceTime t("visit unhandled CLDs", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+    GCTraceTime t("visit unhandled CLDs", PrintGCDetails, false, _gc_timer_cm);
 
     verify_work_stacks_empty();
 
@@ -5194,7 +5190,7 @@
   }
 
   {
-    GCTraceTime t("dirty klass scan", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+    GCTraceTime t("dirty klass scan", PrintGCDetails, false, _gc_timer_cm);
 
     verify_work_stacks_empty();
 
@@ -5403,7 +5399,7 @@
                                 _span, &_markBitMap, &_markStack,
                                 &cmsKeepAliveClosure, false /* !preclean */);
   {
-    GCTraceTime t("weak refs processing", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+    GCTraceTime t("weak refs processing", PrintGCDetails, false, _gc_timer_cm);
 
     ReferenceProcessorStats stats;
     if (rp->processing_is_mt()) {
@@ -5428,15 +5424,13 @@
                                         &cmsKeepAliveClosure,
                                         &cmsDrainMarkingStackClosure,
                                         &task_executor,
-                                        _gc_timer_cm,
-                                        _gc_tracer_cm->gc_id());
+                                        _gc_timer_cm);
     } else {
       stats = rp->process_discovered_references(&_is_alive_closure,
                                         &cmsKeepAliveClosure,
                                         &cmsDrainMarkingStackClosure,
                                         NULL,
-                                        _gc_timer_cm,
-                                        _gc_tracer_cm->gc_id());
+                                        _gc_timer_cm);
     }
     _gc_tracer_cm->report_gc_reference_stats(stats);
 
@@ -5447,7 +5441,7 @@
 
   if (should_unload_classes()) {
     {
-      GCTraceTime t("class unloading", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+      GCTraceTime t("class unloading", PrintGCDetails, false, _gc_timer_cm);
 
       // Unload classes and purge the SystemDictionary.
       bool purged_class = SystemDictionary::do_unloading(&_is_alive_closure);
@@ -5460,13 +5454,13 @@
     }
 
     {
-      GCTraceTime t("scrub symbol table", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+      GCTraceTime t("scrub symbol table", PrintGCDetails, false, _gc_timer_cm);
       // Clean up unreferenced symbols in symbol table.
       SymbolTable::unlink();
     }
 
     {
-      GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+      GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm);
       // Delete entries for dead interned strings.
       StringTable::unlink(&_is_alive_closure);
     }
@@ -5534,7 +5528,7 @@
   _intra_sweep_timer.start();
   {
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    CMSPhaseAccounting pa(this, "sweep", _gc_tracer_cm->gc_id(), !PrintGCDetails);
+    CMSPhaseAccounting pa(this, "sweep", !PrintGCDetails);
     // First sweep the old gen
     {
       CMSTokenSyncWithLocks ts(true, _cmsGen->freelistLock(),
@@ -5719,7 +5713,7 @@
     // Clear the mark bitmap (no grey objects to start with)
     // for the next cycle.
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    CMSPhaseAccounting cmspa(this, "reset", _gc_tracer_cm->gc_id(), !PrintGCDetails);
+    CMSPhaseAccounting cmspa(this, "reset", !PrintGCDetails);
 
     HeapWord* curAddr = _markBitMap.startWord();
     while (curAddr < _markBitMap.endWord()) {
@@ -5771,7 +5765,7 @@
 
 void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
   TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-  GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer_cm->gc_id());
+  GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL);
   TraceCollectorStats tcs(counters());
 
   switch (op) {
@@ -6458,7 +6452,7 @@
 // isMarked() query is "safe".
 bool ScanMarkedObjectsAgainClosure::do_object_bm(oop p, MemRegion mr) {
   // Ignore mark word because we are running concurrent with mutators
-  assert(p->is_oop_or_null(true), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(p)));
+  assert(p->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(p));
   HeapWord* addr = (HeapWord*)p;
   assert(_span.contains(addr), "we are scanning the CMS generation");
   bool is_obj_array = false;
@@ -6893,7 +6887,7 @@
 }
 
 void PushAndMarkVerifyClosure::do_oop(oop obj) {
-  assert(obj->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj)));
+  assert(obj->is_oop_or_null(), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj));
   HeapWord* addr = (HeapWord*)obj;
   if (_span.contains(addr) && !_verification_bm->isMarked(addr)) {
     // Oop lies in _span and isn't yet grey or black
@@ -6991,7 +6985,7 @@
 
 void PushOrMarkClosure::do_oop(oop obj) {
   // Ignore mark word because we are running concurrent with mutators.
-  assert(obj->is_oop_or_null(true), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj)));
+  assert(obj->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj));
   HeapWord* addr = (HeapWord*)obj;
   if (_span.contains(addr) && !_bitMap->isMarked(addr)) {
     // Oop lies in _span and isn't yet grey or black
@@ -7029,7 +7023,7 @@
 
 void Par_PushOrMarkClosure::do_oop(oop obj) {
   // Ignore mark word because we are running concurrent with mutators.
-  assert(obj->is_oop_or_null(true), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj)));
+  assert(obj->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj));
   HeapWord* addr = (HeapWord*)obj;
   if (_whole_span.contains(addr) && !_bit_map->isMarked(addr)) {
     // Oop lies in _span and isn't yet grey or black
@@ -7106,7 +7100,7 @@
   // path and may be at the end of the global overflow list (so
   // the mark word may be NULL).
   assert(obj->is_oop_or_null(true /* ignore mark word */),
-         err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj)));
+         "Expected an oop or NULL at " PTR_FORMAT, p2i(obj));
   HeapWord* addr = (HeapWord*)obj;
   // Check if oop points into the CMS generation
   // and is not marked
@@ -7186,7 +7180,7 @@
   // the debugger, is_oop_or_null(false) may subsequently start
   // to hold.
   assert(obj->is_oop_or_null(true),
-         err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj)));
+         "Expected an oop or NULL at " PTR_FORMAT, p2i(obj));
   HeapWord* addr = (HeapWord*)obj;
   // Check if oop points into the CMS generation
   // and is not marked
@@ -7423,7 +7417,7 @@
     // coalesced chunk to the appropriate free list.
     if (inFreeRange()) {
       assert(freeFinger() >= _sp->bottom() && freeFinger() < _limit,
-             err_msg("freeFinger() " PTR_FORMAT " is out-of-bounds", p2i(freeFinger())));
+             "freeFinger() " PTR_FORMAT " is out-of-bounds", p2i(freeFinger()));
       flush_cur_free_chunk(freeFinger(),
                            pointer_delta(addr, freeFinger()));
       if (CMSTraceSweeper) {
@@ -7825,10 +7819,10 @@
   assert(inFreeRange(), "Should only be called if currently in a free range.");
   HeapWord* const eob = ((HeapWord*)fc) + chunk_size;
   assert(_sp->used_region().contains(eob - 1),
-         err_msg("eob = " PTR_FORMAT " eob-1 = " PTR_FORMAT " _limit = " PTR_FORMAT
-                 " out of bounds wrt _sp = [" PTR_FORMAT "," PTR_FORMAT ")"
-                 " when examining fc = " PTR_FORMAT "(" SIZE_FORMAT ")",
-                 p2i(eob), p2i(eob-1), p2i(_limit), p2i(_sp->bottom()), p2i(_sp->end()), p2i(fc), chunk_size));
+         "eob = " PTR_FORMAT " eob-1 = " PTR_FORMAT " _limit = " PTR_FORMAT
+         " out of bounds wrt _sp = [" PTR_FORMAT "," PTR_FORMAT ")"
+         " when examining fc = " PTR_FORMAT "(" SIZE_FORMAT ")",
+         p2i(eob), p2i(eob-1), p2i(_limit), p2i(_sp->bottom()), p2i(_sp->end()), p2i(fc), chunk_size);
   if (eob >= _limit) {
     assert(eob == _limit || fc->is_free(), "Only a free chunk should allow us to cross over the limit");
     if (CMSTraceSweeper) {
--- a/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -296,8 +296,8 @@
 
   size_t end() {
     assert(_index <= capacity(),
-           err_msg("_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT "): out of bounds",
-                   _index, _capacity));
+           "_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT "): out of bounds",
+           _index, _capacity);
     return _index;
   }  // exclusive
 
@@ -322,9 +322,9 @@
     } else {
       ++_overflows;
       assert(_index == _capacity,
-             err_msg("_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT
-                     "): out of bounds at overflow#" SIZE_FORMAT,
-                     _index, _capacity, _overflows));
+             "_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT
+             "): out of bounds at overflow#" SIZE_FORMAT,
+             _index, _capacity, _overflows);
     }
   }
 };
--- a/src/share/vm/gc/cms/concurrentMarkSweepThread.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/concurrentMarkSweepThread.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -26,6 +26,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "gc/cms/concurrentMarkSweepGeneration.inline.hpp"
 #include "gc/cms/concurrentMarkSweepThread.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
 #include "oops/instanceRefKlass.hpp"
 #include "oops/oop.inline.hpp"
@@ -124,6 +125,7 @@
   while (!_should_terminate) {
     sleepBeforeNextCycle();
     if (_should_terminate) break;
+    GCIdMark gc_id_mark;
     GCCause::Cause cause = _collector->_full_gc_requested ?
       _collector->_full_gc_cause : GCCause::_cms_concurrent_mark;
     _collector->collect_in_background(cause);
--- a/src/share/vm/gc/cms/parCardTableModRefBS.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/parCardTableModRefBS.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -43,7 +43,7 @@
                                      uint n_threads) {
   assert(n_threads > 0, "expected n_threads > 0");
   assert(n_threads <= ParallelGCThreads,
-         err_msg("n_threads: %u > ParallelGCThreads: %u", n_threads, ParallelGCThreads));
+         "n_threads: %u > ParallelGCThreads: %u", n_threads, ParallelGCThreads);
 
   // Make sure the LNC array is valid for the space.
   jbyte**   lowest_non_clean;
@@ -370,18 +370,18 @@
                                               - lowest_non_clean_base_chunk_index;
         if (last_chunk_index_to_check > last_chunk_index) {
           assert(last_block + last_block_size > used.end(),
-                 err_msg("Inconsistency detected: last_block [" PTR_FORMAT "," PTR_FORMAT "]"
-                         " does not exceed used.end() = " PTR_FORMAT ","
-                         " yet last_chunk_index_to_check " INTPTR_FORMAT
-                         " exceeds last_chunk_index " INTPTR_FORMAT,
-                         p2i(last_block), p2i(last_block + last_block_size),
-                         p2i(used.end()),
-                         last_chunk_index_to_check, last_chunk_index));
+                 "Inconsistency detected: last_block [" PTR_FORMAT "," PTR_FORMAT "]"
+                 " does not exceed used.end() = " PTR_FORMAT ","
+                 " yet last_chunk_index_to_check " INTPTR_FORMAT
+                 " exceeds last_chunk_index " INTPTR_FORMAT,
+                 p2i(last_block), p2i(last_block + last_block_size),
+                 p2i(used.end()),
+                 last_chunk_index_to_check, last_chunk_index);
           assert(sp->used_region().end() > used.end(),
-                 err_msg("Expansion did not happen: "
-                         "[" PTR_FORMAT "," PTR_FORMAT ") -> [" PTR_FORMAT "," PTR_FORMAT ")",
-                         p2i(sp->used_region().start()), p2i(sp->used_region().end()),
-                         p2i(used.start()), p2i(used.end())));
+                 "Expansion did not happen: "
+                 "[" PTR_FORMAT "," PTR_FORMAT ") -> [" PTR_FORMAT "," PTR_FORMAT ")",
+                 p2i(sp->used_region().start()), p2i(sp->used_region().end()),
+                 p2i(used.start()), p2i(used.end()));
           NOISY(tty->print_cr(" process_chunk_boundary: heap expanded; explicitly bounding last_chunk");)
           last_chunk_index_to_check = last_chunk_index;
         }
--- a/src/share/vm/gc/cms/parNewGeneration.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/parNewGeneration.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -896,7 +896,7 @@
     size_policy->minor_collection_begin();
   }
 
-  GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL, _gc_tracer.gc_id());
+  GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL);
   // Capture heap used before collection (for printing).
   size_t gch_prev_used = gch->used();
 
@@ -959,13 +959,13 @@
     ParNewRefProcTaskExecutor task_executor(*this, *_old_gen, thread_state_set);
     stats = rp->process_discovered_references(&is_alive, &keep_alive,
                                               &evacuate_followers, &task_executor,
-                                              _gc_timer, _gc_tracer.gc_id());
+                                              _gc_timer);
   } else {
     thread_state_set.flush();
     gch->save_marks();
     stats = rp->process_discovered_references(&is_alive, &keep_alive,
                                               &evacuate_followers, NULL,
-                                              _gc_timer, _gc_tracer.gc_id());
+                                              _gc_timer);
   }
   _gc_tracer.report_gc_reference_stats(stats);
   if (!promotion_failed()) {
--- a/src/share/vm/gc/cms/promotionInfo.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/promotionInfo.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -73,7 +73,7 @@
     } else {
       res = (PromotedObject*)(_next & next_mask);
     }
-    assert(oop(res)->is_oop_or_null(true /* ignore mark word */), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res))));
+    assert(oop(res)->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res)));
     return res;
   }
   inline void setNext(PromotedObject* x) {
--- a/src/share/vm/gc/cms/vmCMSOperations.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/vmCMSOperations.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -58,7 +58,7 @@
 void VM_CMS_Operation::verify_before_gc() {
   if (VerifyBeforeGC &&
       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
-    GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm, _collector->_gc_tracer_cm->gc_id());
+    GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm);
     HandleMark hm;
     FreelistLocker x(_collector);
     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
@@ -70,7 +70,7 @@
 void VM_CMS_Operation::verify_after_gc() {
   if (VerifyAfterGC &&
       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
-    GCTraceTime tm("Verify After", false, false, _collector->_gc_timer_cm, _collector->_gc_tracer_cm->gc_id());
+    GCTraceTime tm("Verify After", false, false, _collector->_gc_timer_cm);
     HandleMark hm;
     FreelistLocker x(_collector);
     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
@@ -134,6 +134,7 @@
     return;
   }
   HS_PRIVATE_CMS_INITMARK_BEGIN();
+  GCIdMark gc_id_mark(_gc_id);
 
   _collector->_gc_timer_cm->register_gc_pause_start("Initial Mark");
 
@@ -161,6 +162,7 @@
     return;
   }
   HS_PRIVATE_CMS_REMARK_BEGIN();
+  GCIdMark gc_id_mark(_gc_id);
 
   _collector->_gc_timer_cm->register_gc_pause_start("Final Mark");
 
--- a/src/share/vm/gc/cms/vmCMSOperations.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/vmCMSOperations.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -27,6 +27,7 @@
 
 #include "gc/cms/concurrentMarkSweepGeneration.hpp"
 #include "gc/shared/gcCause.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/vmGCOperations.hpp"
 #include "runtime/vm_operations.hpp"
 
@@ -53,6 +54,7 @@
  protected:
   CMSCollector*  _collector;                 // associated collector
   bool           _prologue_succeeded;     // whether doit_prologue succeeded
+  uint           _gc_id;
 
   bool lost_race() const;
 
@@ -63,7 +65,8 @@
  public:
   VM_CMS_Operation(CMSCollector* collector):
     _collector(collector),
-    _prologue_succeeded(false) {}
+    _prologue_succeeded(false),
+    _gc_id(GCId::current()) {}
   ~VM_CMS_Operation() {}
 
   // The legal collector state for executing this CMS op.
--- a/src/share/vm/gc/cms/yieldingWorkgroup.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/cms/yieldingWorkgroup.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/cms/yieldingWorkgroup.hpp"
+#include "gc/shared/gcId.hpp"
 #include "utilities/macros.hpp"
 
 YieldingFlexibleGangWorker::YieldingFlexibleGangWorker(YieldingFlexibleWorkGang* gang, int id)
@@ -340,6 +341,7 @@
         // Now, release the gang mutex and do the work.
         {
           MutexUnlockerEx mul(gang_monitor, Mutex::_no_safepoint_check_flag);
+          GCIdMark gc_id_mark(data.task()->gc_id());
           data.task()->work(id);   // This might include yielding
         }
         // Reacquire monitor and note completion of this worker
--- a/src/share/vm/gc/g1/bufferingOopClosure.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/bufferingOopClosure.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -153,10 +153,10 @@
 
     boc.done();
 
-    #define assert_testCount(got, expected)                                     \
-       assert((got) == (expected),                                              \
-           err_msg("Expected: %d, got: %d, when running testCount(%d, %d, %d)", \
-               (got), (expected), num_narrow, num_full, do_oop_order))
+    #define assert_testCount(got, expected)                                \
+       assert((got) == (expected),                                         \
+              "Expected: %d, got: %d, when running testCount(%d, %d, %d)", \
+              (got), (expected), num_narrow, num_full, do_oop_order)
 
     assert_testCount(num_narrow, coc.narrow_oop_count());
     assert_testCount(num_full, coc.full_oop_count());
@@ -190,11 +190,11 @@
 
     fr.oops_do(&boc, 0);
 
-    #define assert_testIsBufferEmptyOrFull(got, expected)                             \
-        assert((got) == (expected),                                                   \
-            err_msg("Expected: %d, got: %d. testIsBufferEmptyOrFull(%d, %d, %s, %s)", \
-                (got), (expected), num_narrow, num_full,                              \
-                BOOL_TO_STR(expect_empty), BOOL_TO_STR(expect_full)))
+    #define assert_testIsBufferEmptyOrFull(got, expected)                        \
+        assert((got) == (expected),                                              \
+               "Expected: %d, got: %d. testIsBufferEmptyOrFull(%d, %d, %s, %s)", \
+               (got), (expected), num_narrow, num_full,                          \
+               BOOL_TO_STR(expect_empty), BOOL_TO_STR(expect_full))
 
     assert_testIsBufferEmptyOrFull(expect_empty, boc.is_buffer_empty());
     assert_testIsBufferEmptyOrFull(expect_full, boc.is_buffer_full());
@@ -232,8 +232,8 @@
     boc.done();
 
     assert(boc.is_buffer_empty(),
-        err_msg("Should be empty after call to done(). testEmptyAfterDone(%d, %d)",
-            num_narrow, num_full));
+           "Should be empty after call to done(). testEmptyAfterDone(%d, %d)",
+           num_narrow, num_full);
   }
 
   static void testEmptyAfterDone() {
--- a/src/share/vm/gc/g1/collectionSetChooser.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/collectionSetChooser.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -91,10 +91,8 @@
 
 #ifndef PRODUCT
 void CollectionSetChooser::verify() {
-  guarantee(_end <= regions_length(),
-         err_msg("_end: %u regions length: %u", _end, regions_length()));
-  guarantee(_front <= _end,
-            err_msg("_front: %u _end: %u", _front, _end));
+  guarantee(_end <= regions_length(), "_end: %u regions length: %u", _end, regions_length());
+  guarantee(_front <= _end, "_front: %u _end: %u", _front, _end);
   uint index = 0;
   size_t sum_of_reclaimable_bytes = 0;
   while (index < _front) {
@@ -108,19 +106,19 @@
     guarantee(curr != NULL, "Regions in _regions array cannot be NULL");
     guarantee(!curr->is_young(), "should not be young!");
     guarantee(!curr->is_pinned(),
-              err_msg("Pinned region should not be in collection set (index %u)", curr->hrm_index()));
+              "Pinned region should not be in collection set (index %u)", curr->hrm_index());
     if (prev != NULL) {
       guarantee(order_regions(prev, curr) != 1,
-                err_msg("GC eff prev: %1.4f GC eff curr: %1.4f",
-                        prev->gc_efficiency(), curr->gc_efficiency()));
+                "GC eff prev: %1.4f GC eff curr: %1.4f",
+                prev->gc_efficiency(), curr->gc_efficiency());
     }
     sum_of_reclaimable_bytes += curr->reclaimable_bytes();
     prev = curr;
   }
   guarantee(sum_of_reclaimable_bytes == _remaining_reclaimable_bytes,
-            err_msg("reclaimable bytes inconsistent, "
-                    "remaining: " SIZE_FORMAT " sum: " SIZE_FORMAT,
-                    _remaining_reclaimable_bytes, sum_of_reclaimable_bytes));
+            "reclaimable bytes inconsistent, "
+            "remaining: " SIZE_FORMAT " sum: " SIZE_FORMAT,
+            _remaining_reclaimable_bytes, sum_of_reclaimable_bytes);
 }
 #endif // !PRODUCT
 
@@ -151,7 +149,7 @@
 
 void CollectionSetChooser::add_region(HeapRegion* hr) {
   assert(!hr->is_pinned(),
-         err_msg("Pinned region shouldn't be added to the collection set (index %u)", hr->hrm_index()));
+         "Pinned region shouldn't be added to the collection set (index %u)", hr->hrm_index());
   assert(!hr->is_young(), "should not be young!");
   _regions.append(hr);
   _end++;
--- a/src/share/vm/gc/g1/collectionSetChooser.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/collectionSetChooser.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -73,9 +73,7 @@
     HeapRegion* res = NULL;
     if (_front < _end) {
       res = regions_at(_front);
-      assert(res != NULL,
-             err_msg("Unexpected NULL hr in _regions at index %u",
-                     _front));
+      assert(res != NULL, "Unexpected NULL hr in _regions at index %u", _front);
     }
     return res;
   }
@@ -88,9 +86,9 @@
     assert(_front < _end, "pre-condition");
     regions_at_put(_front, NULL);
     assert(hr->reclaimable_bytes() <= _remaining_reclaimable_bytes,
-           err_msg("remaining reclaimable bytes inconsistent "
-                   "from region: " SIZE_FORMAT " remaining: " SIZE_FORMAT,
-                   hr->reclaimable_bytes(), _remaining_reclaimable_bytes));
+           "remaining reclaimable bytes inconsistent "
+           "from region: " SIZE_FORMAT " remaining: " SIZE_FORMAT,
+           hr->reclaimable_bytes(), _remaining_reclaimable_bytes);
     _remaining_reclaimable_bytes -= hr->reclaimable_bytes();
     _front += 1;
     return hr;
--- a/src/share/vm/gc/g1/concurrentMark.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/concurrentMark.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -41,6 +41,7 @@
 #include "gc/g1/heapRegionRemSet.hpp"
 #include "gc/g1/heapRegionSet.inline.hpp"
 #include "gc/g1/suspendibleThreadSet.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/gcTrace.hpp"
 #include "gc/shared/gcTraceTime.hpp"
@@ -245,10 +246,6 @@
 
 CMMarkStack::CMMarkStack(ConcurrentMark* cm) :
   _base(NULL), _cm(cm)
-#ifdef ASSERT
-  , _drain_in_progress(false)
-  , _drain_in_progress_yields(false)
-#endif
 {}
 
 bool CMMarkStack::allocate(size_t capacity) {
@@ -362,30 +359,6 @@
   }
 }
 
-template<class OopClosureClass>
-bool CMMarkStack::drain(OopClosureClass* cl, CMBitMap* bm, bool yield_after) {
-  assert(!_drain_in_progress || !_drain_in_progress_yields || yield_after
-         || SafepointSynchronize::is_at_safepoint(),
-         "Drain recursion must be yield-safe.");
-  bool res = true;
-  debug_only(_drain_in_progress = true);
-  debug_only(_drain_in_progress_yields = yield_after);
-  while (!isEmpty()) {
-    oop newOop = pop();
-    assert(G1CollectedHeap::heap()->is_in_reserved(newOop), "Bad pop");
-    assert(newOop->is_oop(), "Expected an oop");
-    assert(bm == NULL || bm->isMarked((HeapWord*)newOop),
-           "only grey objects on this stack");
-    newOop->oop_iterate(cl);
-    if (yield_after && _cm->do_yield_check()) {
-      res = false;
-      break;
-    }
-  }
-  debug_only(_drain_in_progress = false);
-  return res;
-}
-
 void CMMarkStack::note_start_of_gc() {
   assert(_saved_index == -1,
          "note_start_of_gc()/end_of_gc() bracketed incorrectly");
@@ -399,7 +372,7 @@
   // only check this once per GC anyway, so it won't be a performance
   // issue in any way.
   guarantee(_saved_index == _index,
-            err_msg("saved index: %d index: %d", _saved_index, _index));
+            "saved index: %d index: %d", _saved_index, _index);
   _saved_index = -1;
 }
 
@@ -520,7 +493,6 @@
   _has_overflown(false),
   _concurrent(false),
   _has_aborted(false),
-  _aborted_gc_id(GCId::undefined()),
   _restart_for_overflow(false),
   _concurrent_marking_in_progress(false),
 
@@ -794,8 +766,8 @@
     // in a STW phase.
     assert(!concurrent_marking_in_progress(), "invariant");
     assert(out_of_regions(),
-           err_msg("only way to get here: _finger: " PTR_FORMAT ", _heap_end: " PTR_FORMAT,
-                   p2i(_finger), p2i(_heap_end)));
+           "only way to get here: _finger: " PTR_FORMAT ", _heap_end: " PTR_FORMAT,
+           p2i(_finger), p2i(_heap_end));
   }
 }
 
@@ -991,7 +963,7 @@
       force_overflow()->update();
 
       if (G1Log::fine()) {
-        gclog_or_tty->gclog_stamp(concurrent_gc_id());
+        gclog_or_tty->gclog_stamp();
         gclog_or_tty->print_cr("[GC concurrent-mark-reset-for-overflow]");
       }
     }
@@ -1181,7 +1153,7 @@
   // should not attempt to do any further work.
   if (root_regions()->scan_in_progress()) {
     if (G1Log::fine()) {
-      gclog_or_tty->gclog_stamp(concurrent_gc_id());
+      gclog_or_tty->gclog_stamp();
       gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]");
     }
 
@@ -1195,7 +1167,7 @@
     _parallel_workers->run_task(&task);
 
     if (G1Log::fine()) {
-      gclog_or_tty->gclog_stamp(concurrent_gc_id());
+      gclog_or_tty->gclog_stamp();
       gclog_or_tty->print_cr("[GC concurrent-root-region-scan-end, %1.7lf secs]", os::elapsedTime() - scan_start);
     }
 
@@ -1235,7 +1207,8 @@
 }
 
 // Helper class to get rid of some boilerplate code.
-class G1CMTraceTime : public GCTraceTime {
+class G1CMTraceTime : public StackObj {
+  GCTraceTimeImpl _gc_trace_time;
   static bool doit_and_prepend(bool doit) {
     if (doit) {
       gclog_or_tty->put(' ');
@@ -1245,8 +1218,7 @@
 
  public:
   G1CMTraceTime(const char* title, bool doit)
-    : GCTraceTime(title, doit_and_prepend(doit), false, G1CollectedHeap::heap()->gc_timer_cm(),
-        G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id()) {
+    : _gc_trace_time(title, doit_and_prepend(doit), false, G1CollectedHeap::heap()->gc_timer_cm()) {
   }
 };
 
@@ -1415,9 +1387,9 @@
     HeapWord* start = hr->bottom();
 
     assert(start <= hr->end() && start <= ntams && ntams <= hr->end(),
-           err_msg("Preconditions not met - "
-                   "start: " PTR_FORMAT ", ntams: " PTR_FORMAT ", end: " PTR_FORMAT,
-                   p2i(start), p2i(ntams), p2i(hr->end())));
+           "Preconditions not met - "
+           "start: " PTR_FORMAT ", ntams: " PTR_FORMAT ", end: " PTR_FORMAT,
+           p2i(start), p2i(ntams), p2i(hr->end()));
 
     // Find the first marked object at or after "start".
     start = _bm->getNextMarkedWordAddress(start, ntams);
@@ -1717,11 +1689,11 @@
       }
 
       assert(end_idx <= _card_bm->size(),
-             err_msg("oob: end_idx=  " SIZE_FORMAT ", bitmap size= " SIZE_FORMAT,
-                     end_idx, _card_bm->size()));
+             "oob: end_idx=  " SIZE_FORMAT ", bitmap size= " SIZE_FORMAT,
+             end_idx, _card_bm->size());
       assert(start_idx < _card_bm->size(),
-             err_msg("oob: start_idx=  " SIZE_FORMAT ", bitmap size= " SIZE_FORMAT,
-                     start_idx, _card_bm->size()));
+             "oob: start_idx=  " SIZE_FORMAT ", bitmap size= " SIZE_FORMAT,
+             start_idx, _card_bm->size());
 
       _cm->set_card_bitmap_range(_card_bm, start_idx, end_idx, true /* is_par */);
     }
@@ -2391,8 +2363,7 @@
                                           &g1_keep_alive,
                                           &g1_drain_mark_stack,
                                           executor,
-                                          g1h->gc_timer_cm(),
-                                          concurrent_gc_id());
+                                          g1h->gc_timer_cm());
     g1h->gc_tracer_cm()->report_gc_reference_stats(stats);
 
     // The do_oop work routines of the keep_alive and drain_marking_stack
@@ -2471,7 +2442,7 @@
       // object; it could instead have been a stale reference.
       oop obj = static_cast<oop>(entry);
       assert(obj->is_oop(true /* ignore mark word */),
-             err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(obj)));
+             "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(obj));
       _task->make_reference_grey(obj, hr);
     }
   }
@@ -2588,9 +2559,9 @@
   SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
   guarantee(has_overflown() ||
             satb_mq_set.completed_buffers_num() == 0,
-            err_msg("Invariant: has_overflown = %s, num buffers = %d",
-                    BOOL_TO_STR(has_overflown()),
-                    satb_mq_set.completed_buffers_num()));
+            "Invariant: has_overflown = %s, num buffers = %d",
+            BOOL_TO_STR(has_overflown()),
+            satb_mq_set.completed_buffers_num());
 
   print_stats();
 }
@@ -2724,11 +2695,11 @@
 
   void operator()(oop obj) const {
     guarantee(obj->is_oop(),
-              err_msg("Non-oop " PTR_FORMAT ", phase: %s, info: %d",
-                      p2i(obj), _phase, _info));
+              "Non-oop " PTR_FORMAT ", phase: %s, info: %d",
+              p2i(obj), _phase, _info);
     guarantee(!_g1h->obj_in_cs(obj),
-              err_msg("obj: " PTR_FORMAT " in CSet, phase: %s, info: %d",
-                      p2i(obj), _phase, _info));
+              "obj: " PTR_FORMAT " in CSet, phase: %s, info: %d",
+              p2i(obj), _phase, _info);
   }
 };
 
@@ -2761,8 +2732,8 @@
     // here.
     HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
     guarantee(global_hr == NULL || global_finger == global_hr->bottom(),
-              err_msg("global finger: " PTR_FORMAT " region: " HR_FORMAT,
-                      p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
+              "global finger: " PTR_FORMAT " region: " HR_FORMAT,
+              p2i(global_finger), HR_FORMAT_PARAMS(global_hr));
   }
 
   // Verify the task fingers
@@ -2775,8 +2746,8 @@
       HeapRegion* task_hr = _g1h->heap_region_containing_raw(task_finger);
       guarantee(task_hr == NULL || task_finger == task_hr->bottom() ||
                 !task_hr->in_collection_set(),
-                err_msg("task finger: " PTR_FORMAT " region: " HR_FORMAT,
-                        p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
+                "task finger: " PTR_FORMAT " region: " HR_FORMAT,
+                p2i(task_finger), HR_FORMAT_PARAMS(task_hr));
     }
   }
 }
@@ -2816,10 +2787,10 @@
     HeapWord* end = hr->end();
 
     assert(start <= limit && limit <= hr->top() && hr->top() <= hr->end(),
-           err_msg("Preconditions not met - "
-                   "start: " PTR_FORMAT ", limit: " PTR_FORMAT ", "
-                   "top: " PTR_FORMAT ", end: " PTR_FORMAT,
-                   p2i(start), p2i(limit), p2i(hr->top()), p2i(hr->end())));
+           "Preconditions not met - "
+           "start: " PTR_FORMAT ", limit: " PTR_FORMAT ", "
+           "top: " PTR_FORMAT ", end: " PTR_FORMAT,
+           p2i(start), p2i(limit), p2i(hr->top()), p2i(hr->end()));
 
     assert(hr->next_marked_bytes() == 0, "Precondition");
 
@@ -2988,8 +2959,6 @@
   }
   _first_overflow_barrier_sync.abort();
   _second_overflow_barrier_sync.abort();
-  _aborted_gc_id = _g1h->gc_tracer_cm()->gc_id();
-  assert(!_aborted_gc_id.is_undefined(), "ConcurrentMark::abort() executed more than once?");
   _has_aborted = true;
 
   SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
@@ -3004,13 +2973,6 @@
   _g1h->register_concurrent_cycle_end();
 }
 
-const GCId& ConcurrentMark::concurrent_gc_id() {
-  if (has_aborted()) {
-    return _aborted_gc_id;
-  }
-  return _g1h->gc_tracer_cm()->gc_id();
-}
-
 static void print_ms_time_info(const char* prefix, const char* name,
                                NumberSeq& ns) {
   gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).",
--- a/src/share/vm/gc/g1/concurrentMark.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/concurrentMark.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -28,7 +28,6 @@
 #include "classfile/javaClasses.hpp"
 #include "gc/g1/g1RegionToSpaceMapper.hpp"
 #include "gc/g1/heapRegionSet.hpp"
-#include "gc/shared/gcId.hpp"
 #include "gc/shared/taskqueue.hpp"
 
 class G1CollectedHeap;
@@ -183,15 +182,6 @@
 
   bool  _overflow;
   bool  _should_expand;
-  DEBUG_ONLY(bool _drain_in_progress;)
-  DEBUG_ONLY(bool _drain_in_progress_yields;)
-
-  oop pop() {
-    if (!isEmpty()) {
-      return _base[--_index] ;
-    }
-    return NULL;
-  }
 
  public:
   CMMarkStack(ConcurrentMark* cm);
@@ -213,17 +203,6 @@
   // operations, which use the same locking strategy.
   bool par_pop_arr(oop* ptr_arr, int max, int* n);
 
-  // Drain the mark stack, applying the given closure to all fields of
-  // objects on the stack.  (That is, continue until the stack is empty,
-  // even if closure applications add entries to the stack.)  The "bm"
-  // argument, if non-null, may be used to verify that only marked objects
-  // are on the mark stack.  If "yield_after" is "true", then the
-  // concurrent marker performing the drain offers to yield after
-  // processing each object.  If a yield occurs, stops the drain operation
-  // and returns false.  Otherwise, returns true.
-  template<class OopClosureClass>
-  bool drain(OopClosureClass* cl, CMBitMap* bm, bool yield_after = false);
-
   bool isEmpty()    { return _index == 0; }
   int  maxElems()   { return _capacity; }
 
@@ -425,7 +404,6 @@
   volatile bool           _concurrent;
   // Set at the end of a Full GC so that marking aborts
   volatile bool           _has_aborted;
-  GCId                    _aborted_gc_id;
 
   // Used when remark aborts due to an overflow to indicate that
   // another concurrent marking phase should start
@@ -768,8 +746,6 @@
 
   bool has_aborted()      { return _has_aborted; }
 
-  const GCId& concurrent_gc_id();
-
   // This prints the global/local fingers. It is used for debugging.
   NOT_PRODUCT(void print_finger();)
 
--- a/src/share/vm/gc/g1/concurrentMark.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/concurrentMark.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -197,9 +197,9 @@
   assert(_bmStartWord <= (addr) && (addr) < (_bmStartWord + _bmWordSize),      \
          "outside underlying space?");                                         \
   assert(G1CollectedHeap::heap()->is_in_exact(addr),                           \
-         err_msg("Trying to access not available bitmap " PTR_FORMAT           \
-                 " corresponding to " PTR_FORMAT " (%u)",                      \
-                 p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr)));
+         "Trying to access not available bitmap " PTR_FORMAT                   \
+         " corresponding to " PTR_FORMAT " (%u)",                              \
+         p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr));
 
 inline void CMBitMap::mark(HeapWord* addr) {
   check_mark(addr);
@@ -225,8 +225,7 @@
 
 template<typename Fn>
 inline void CMMarkStack::iterate(Fn fn) {
-  assert(_saved_index == _index,
-         err_msg("saved index: %d index: %d", _saved_index, _index));
+  assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index);
   for (int i = 0; i < _index; ++i) {
     fn(_base[i]);
   }
@@ -385,7 +384,7 @@
   increment_refs_reached();
 
   HeapWord* objAddr = (HeapWord*) obj;
-  assert(obj->is_oop_or_null(true /* ignore mark word */), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj)));
+  assert(obj->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj));
   if (_g1h->is_in_g1_reserved(objAddr)) {
     assert(obj != NULL, "null check is implicit");
     if (!_nextMarkBitMap->isMarked(objAddr)) {
@@ -427,9 +426,9 @@
   // assert that word_size is under an upper bound which is its
   // containing region's capacity.
   assert(word_size * HeapWordSize <= hr->capacity(),
-         err_msg("size: " SIZE_FORMAT " capacity: " SIZE_FORMAT " " HR_FORMAT,
-                 word_size * HeapWordSize, hr->capacity(),
-                 HR_FORMAT_PARAMS(hr)));
+         "size: " SIZE_FORMAT " capacity: " SIZE_FORMAT " " HR_FORMAT,
+         word_size * HeapWordSize, hr->capacity(),
+         HR_FORMAT_PARAMS(hr));
 
   if (addr < hr->next_top_at_mark_start()) {
     if (!_nextMarkBitMap->isMarked(addr)) {
--- a/src/share/vm/gc/g1/concurrentMarkThread.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/concurrentMarkThread.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -30,6 +30,7 @@
 #include "gc/g1/g1MMUTracker.hpp"
 #include "gc/g1/suspendibleThreadSet.hpp"
 #include "gc/g1/vm_operations_g1.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/gcTrace.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/vmThread.hpp"
@@ -85,7 +86,7 @@
     SuspendibleThreadSetJoiner sts_joiner(join_sts);
     va_list args;
     va_start(args, fmt);
-    gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
+    gclog_or_tty->gclog_stamp();
     gclog_or_tty->vprint_cr(fmt, args);
     va_end(args);
   }
@@ -108,6 +109,7 @@
       break;
     }
 
+    GCIdMark gc_id_mark;
     {
       ResourceMark rm;
       HandleMark   hm;
@@ -194,7 +196,7 @@
         // reclaimed by cleanup.
 
         double cleanup_start_sec = os::elapsedTime();
-        cm_log(G1Log::fine(), true, "[GC concurrent-cleanup-start]");
+        cm_log(G1Log::fine(), false, "[GC concurrent-cleanup-start]");
 
         // Now do the concurrent cleanup operation.
         _cm->completeCleanup();
--- a/src/share/vm/gc/g1/g1AllocRegion.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1AllocRegion.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -91,7 +91,7 @@
 }
 
 size_t G1AllocRegion::retire(bool fill_up) {
-  assert(_alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));
+  assert_alloc_region(_alloc_region != NULL, "not initialized properly");
 
   size_t result = 0;
 
@@ -101,15 +101,14 @@
     // We never have to check whether the active region is empty or not,
     // and potentially free it if it is, given that it's guaranteed that
     // it will never be empty.
-    assert(!alloc_region->is_empty(),
-           ar_ext_msg(this, "the alloc region should never be empty"));
+    assert_alloc_region(!alloc_region->is_empty(),
+                           "the alloc region should never be empty");
 
     if (fill_up) {
       result = fill_up_remaining_space(alloc_region, _bot_updates);
     }
 
-    assert(alloc_region->used() >= _used_bytes_before,
-           ar_ext_msg(this, "invariant"));
+    assert_alloc_region(alloc_region->used() >= _used_bytes_before, "invariant");
     size_t allocated_bytes = alloc_region->used() - _used_bytes_before;
     retire_region(alloc_region, allocated_bytes);
     _used_bytes_before = 0;
@@ -122,8 +121,8 @@
 
 HeapWord* G1AllocRegion::new_alloc_region_and_allocate(size_t word_size,
                                                        bool force) {
-  assert(_alloc_region == _dummy_region, ar_ext_msg(this, "pre-condition"));
-  assert(_used_bytes_before == 0, ar_ext_msg(this, "pre-condition"));
+  assert_alloc_region(_alloc_region == _dummy_region, "pre-condition");
+  assert_alloc_region(_used_bytes_before == 0, "pre-condition");
 
   trace("attempting region allocation");
   HeapRegion* new_alloc_region = allocate_new_region(word_size, force);
@@ -132,7 +131,7 @@
     // Need to do this before the allocation
     _used_bytes_before = new_alloc_region->used();
     HeapWord* result = allocate(new_alloc_region, word_size, _bot_updates);
-    assert(result != NULL, ar_ext_msg(this, "the allocation should succeeded"));
+    assert_alloc_region(result != NULL, "the allocation should succeeded");
 
     OrderAccess::storestore();
     // Note that we first perform the allocation and then we store the
@@ -148,17 +147,10 @@
   ShouldNotReachHere();
 }
 
-void G1AllocRegion::fill_in_ext_msg(ar_ext_msg* msg, const char* message) {
-  msg->append("[%s] %s c: %u b: %s r: " PTR_FORMAT " u: " SIZE_FORMAT,
-              _name, message, _count, BOOL_TO_STR(_bot_updates),
-              p2i(_alloc_region), _used_bytes_before);
-}
-
 void G1AllocRegion::init() {
   trace("initializing");
-  assert(_alloc_region == NULL && _used_bytes_before == 0,
-         ar_ext_msg(this, "pre-condition"));
-  assert(_dummy_region != NULL, ar_ext_msg(this, "should have been set"));
+  assert_alloc_region(_alloc_region == NULL && _used_bytes_before == 0, "pre-condition");
+  assert_alloc_region(_dummy_region != NULL, "should have been set");
   _alloc_region = _dummy_region;
   _count = 0;
   trace("initialized");
@@ -168,11 +160,10 @@
   trace("setting");
   // We explicitly check that the region is not empty to make sure we
   // maintain the "the alloc region cannot be empty" invariant.
-  assert(alloc_region != NULL && !alloc_region->is_empty(),
-         ar_ext_msg(this, "pre-condition"));
-  assert(_alloc_region == _dummy_region &&
-         _used_bytes_before == 0 && _count == 0,
-         ar_ext_msg(this, "pre-condition"));
+  assert_alloc_region(alloc_region != NULL && !alloc_region->is_empty(), "pre-condition");
+  assert_alloc_region(_alloc_region == _dummy_region &&
+                         _used_bytes_before == 0 && _count == 0,
+                         "pre-condition");
 
   _used_bytes_before = alloc_region->used();
   _alloc_region = alloc_region;
@@ -184,8 +175,7 @@
   trace("update");
   // We explicitly check that the region is not empty to make sure we
   // maintain the "the alloc region cannot be empty" invariant.
-  assert(alloc_region != NULL && !alloc_region->is_empty(),
-         ar_ext_msg(this, "pre-condition"));
+  assert_alloc_region(alloc_region != NULL && !alloc_region->is_empty(), "pre-condition");
 
   _alloc_region = alloc_region;
   _alloc_region->set_allocation_context(allocation_context());
@@ -197,8 +187,7 @@
   trace("releasing");
   HeapRegion* alloc_region = _alloc_region;
   retire(false /* fill_up */);
-  assert(_alloc_region == _dummy_region,
-         ar_ext_msg(this, "post-condition of retire()"));
+  assert_alloc_region(_alloc_region == _dummy_region, "post-condition of retire()");
   _alloc_region = NULL;
   trace("released");
   return (alloc_region == _dummy_region) ? NULL : alloc_region;
--- a/src/share/vm/gc/g1/g1AllocRegion.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1AllocRegion.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -34,8 +34,6 @@
 // 0 -> no tracing, 1 -> basic tracing, 2 -> basic + allocation tracing
 #define G1_ALLOC_REGION_TRACING 0
 
-class ar_ext_msg;
-
 // A class that holds a region that is active in satisfying allocation
 // requests, potentially issued in parallel. When the active region is
 // full it will be retired and replaced with a new one. The
@@ -44,7 +42,6 @@
 // replaced.
 
 class G1AllocRegion VALUE_OBJ_CLASS_SPEC {
-  friend class ar_ext_msg;
 
 private:
   // The active allocating region we are currently allocating out
@@ -131,8 +128,6 @@
   // to allocate a new region even if the max has been reached.
   HeapWord* new_alloc_region_and_allocate(size_t word_size, bool force);
 
-  void fill_in_ext_msg(ar_ext_msg* msg, const char* message);
-
 protected:
   // Retire the active allocating region. If fill_up is true then make
   // sure that the region is full before we retire it so that no one
@@ -278,11 +273,4 @@
   virtual HeapRegion* release();
 };
 
-class ar_ext_msg : public err_msg {
-public:
-  ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("%s", "") {
-    alloc_region->fill_in_ext_msg(this, message);
-  }
-};
-
 #endif // SHARE_VM_GC_G1_G1ALLOCREGION_HPP
--- a/src/share/vm/gc/g1/g1AllocRegion.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1AllocRegion.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -28,10 +28,18 @@
 #include "gc/g1/g1AllocRegion.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
 
+#define assert_alloc_region(p, message)                                  \
+  do {                                                                   \
+    assert((p), "[%s] %s c: %u b: %s r: " PTR_FORMAT " u: " SIZE_FORMAT, \
+           _name, (message), _count, BOOL_TO_STR(_bot_updates),          \
+           p2i(_alloc_region), _used_bytes_before);                      \
+  } while (0)
+
+
 inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
                                          size_t word_size,
                                          bool bot_updates) {
-  assert(alloc_region != NULL, err_msg("pre-condition"));
+  assert(alloc_region != NULL, "pre-condition");
 
   if (!bot_updates) {
     return alloc_region->allocate_no_bot_updates(word_size);
@@ -50,8 +58,8 @@
                                              size_t desired_word_size,
                                              size_t* actual_word_size,
                                              bool bot_updates) {
-  assert(alloc_region != NULL, err_msg("pre-condition"));
-  assert(!alloc_region->is_empty(), err_msg("pre-condition"));
+  assert(alloc_region != NULL, "pre-condition");
+  assert(!alloc_region->is_empty(), "pre-condition");
 
   if (!bot_updates) {
     return alloc_region->par_allocate_no_bot_updates(min_word_size, desired_word_size, actual_word_size);
@@ -69,10 +77,10 @@
                                                    size_t desired_word_size,
                                                    size_t* actual_word_size,
                                                    bool bot_updates) {
-  assert(bot_updates == _bot_updates, ar_ext_msg(this, "pre-condition"));
+  assert_alloc_region(bot_updates == _bot_updates, "pre-condition");
 
   HeapRegion* alloc_region = _alloc_region;
-  assert(alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));
+  assert_alloc_region(alloc_region != NULL, "not initialized properly");
 
   HeapWord* result = par_allocate(alloc_region, min_word_size, desired_word_size, actual_word_size, bot_updates);
   if (result != NULL) {
@@ -113,8 +121,8 @@
 
 inline HeapWord* G1AllocRegion::attempt_allocation_force(size_t word_size,
                                                          bool bot_updates) {
-  assert(bot_updates == _bot_updates, ar_ext_msg(this, "pre-condition"));
-  assert(_alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));
+  assert_alloc_region(bot_updates == _bot_updates, "pre-condition");
+  assert_alloc_region(_alloc_region != NULL, "not initialized properly");
 
   trace("forcing alloc", word_size, word_size);
   HeapWord* result = new_alloc_region_and_allocate(word_size, true /* force */);
--- a/src/share/vm/gc/g1/g1Allocator.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1Allocator.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -54,7 +54,7 @@
   HeapRegion* retained_region = *retained_old;
   *retained_old = NULL;
   assert(retained_region == NULL || !retained_region->is_archive(),
-         err_msg("Archive region should not be alloc region (index %u)", retained_region->hrm_index()));
+         "Archive region should not be alloc region (index %u)", retained_region->hrm_index());
 
   // We will discard the current GC alloc region if:
   // a) it's in the collection set (it can happen!),
@@ -147,8 +147,8 @@
   size_t temp = 0;
   HeapWord* result = par_allocate_during_gc(dest, word_size, word_size, &temp, context);
   assert(result == NULL || temp == word_size,
-         err_msg("Requested " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT,
-                 word_size, temp, p2i(result)));
+         "Requested " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT,
+         word_size, temp, p2i(result));
   return result;
 }
 
@@ -276,16 +276,16 @@
                                                        context);
 
     assert(buf == NULL || ((actual_plab_size >= required_in_plab) && (actual_plab_size <= plab_word_size)),
-           err_msg("Requested at minimum " SIZE_FORMAT ", desired " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT,
-                   required_in_plab, plab_word_size, actual_plab_size, p2i(buf)));
+           "Requested at minimum " SIZE_FORMAT ", desired " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT,
+           required_in_plab, plab_word_size, actual_plab_size, p2i(buf));
 
     if (buf != NULL) {
       alloc_buf->set_buf(buf, actual_plab_size);
 
       HeapWord* const obj = alloc_buf->allocate(word_sz);
-      assert(obj != NULL, err_msg("PLAB should have been big enough, tried to allocate "
-                                  SIZE_FORMAT " requiring " SIZE_FORMAT " PLAB size " SIZE_FORMAT,
-                                  word_sz, required_in_plab, plab_word_size));
+      assert(obj != NULL, "PLAB should have been big enough, tried to allocate "
+                          SIZE_FORMAT " requiring " SIZE_FORMAT " PLAB size " SIZE_FORMAT,
+                          word_sz, required_in_plab, plab_word_size);
       return obj;
     }
     // Otherwise.
@@ -354,7 +354,7 @@
   if (hr == NULL) {
     return false;
   }
-  assert(hr->is_empty(), err_msg("expected empty region (index %u)", hr->hrm_index()));
+  assert(hr->is_empty(), "expected empty region (index %u)", hr->hrm_index());
   hr->set_archive();
   _g1h->old_set_add(hr);
   _g1h->hr_printer()->alloc(hr, G1HRPrinter::Archive);
@@ -383,15 +383,15 @@
   }
   HeapWord* old_top = _allocation_region->top();
   assert(_bottom >= _allocation_region->bottom(),
-         err_msg("inconsistent allocation state: " PTR_FORMAT " < " PTR_FORMAT,
-                 p2i(_bottom), p2i(_allocation_region->bottom())));
+         "inconsistent allocation state: " PTR_FORMAT " < " PTR_FORMAT,
+         p2i(_bottom), p2i(_allocation_region->bottom()));
   assert(_max <= _allocation_region->end(),
-         err_msg("inconsistent allocation state: " PTR_FORMAT " > " PTR_FORMAT,
-                 p2i(_max), p2i(_allocation_region->end())));
+         "inconsistent allocation state: " PTR_FORMAT " > " PTR_FORMAT,
+         p2i(_max), p2i(_allocation_region->end()));
   assert(_bottom <= old_top && old_top <= _max,
-         err_msg("inconsistent allocation state: expected "
-                 PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT,
-                 p2i(_bottom), p2i(old_top), p2i(_max)));
+         "inconsistent allocation state: expected "
+         PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT,
+         p2i(_bottom), p2i(old_top), p2i(_max));
 
   // Allocate the next word_size words in the current allocation chunk.
   // If allocation would cross the _max boundary, insert a filler and begin
@@ -430,9 +430,9 @@
 void G1ArchiveAllocator::complete_archive(GrowableArray<MemRegion>* ranges,
                                           size_t end_alignment_in_bytes) {
   assert((end_alignment_in_bytes >> LogHeapWordSize) < HeapRegion::min_region_size_in_words(),
-          err_msg("alignment " SIZE_FORMAT " too large", end_alignment_in_bytes));
+         "alignment " SIZE_FORMAT " too large", end_alignment_in_bytes);
   assert(is_size_aligned(end_alignment_in_bytes, HeapWordSize),
-         err_msg("alignment " SIZE_FORMAT " is not HeapWord (%u) aligned", end_alignment_in_bytes, HeapWordSize));
+         "alignment " SIZE_FORMAT " is not HeapWord (%u) aligned", end_alignment_in_bytes, HeapWordSize);
 
   // If we've allocated nothing, simply return.
   if (_allocation_region == NULL) {
@@ -465,8 +465,8 @@
   // MemRegions to the GrowableArray provided by the caller.
   int index = _allocated_regions.length() - 1;
   assert(_allocated_regions.at(index) == _allocation_region,
-         err_msg("expected region %u at end of array, found %u",
-                 _allocation_region->hrm_index(), _allocated_regions.at(index)->hrm_index()));
+         "expected region %u at end of array, found %u",
+         _allocation_region->hrm_index(), _allocated_regions.at(index)->hrm_index());
   HeapWord* base_address = _allocation_region->bottom();
   HeapWord* top = base_address;
 
@@ -482,7 +482,7 @@
     index = index - 1;
   }
 
-  assert(top != base_address, err_msg("zero-sized range, address " PTR_FORMAT, p2i(base_address)));
+  assert(top != base_address, "zero-sized range, address " PTR_FORMAT, p2i(base_address));
   ranges->append(MemRegion(base_address, pointer_delta(top, base_address)));
   _allocated_regions.clear();
   _allocation_region = NULL;
--- a/src/share/vm/gc/g1/g1Allocator.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1Allocator.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -295,9 +295,9 @@
 
   virtual G1PLAB* alloc_buffer(InCSetState dest, AllocationContext_t context) {
     assert(dest.is_valid(),
-           err_msg("Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value()));
+           "Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value());
     assert(_alloc_buffers[dest.value()] != NULL,
-           err_msg("Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value()));
+           "Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value());
     return _alloc_buffers[dest.value()];
   }
 
--- a/src/share/vm/gc/g1/g1Allocator.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1Allocator.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -36,7 +36,7 @@
 HeapWord* G1Allocator::attempt_allocation_locked(size_t word_size, AllocationContext_t context) {
   HeapWord* result = mutator_alloc_region(context)->attempt_allocation_locked(word_size, false /* bot_updates */);
   assert(result != NULL || mutator_alloc_region(context)->get() == NULL,
-         err_msg("Must not have a mutator alloc region if there is no memory, but is " PTR_FORMAT, p2i(mutator_alloc_region(context)->get())));
+         "Must not have a mutator alloc region if there is no memory, but is " PTR_FORMAT, p2i(mutator_alloc_region(context)->get()));
   return result;
 }
 
--- a/src/share/vm/gc/g1/g1BiasedArray.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1BiasedArray.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -36,19 +36,21 @@
 #ifndef PRODUCT
 void G1BiasedMappedArrayBase::verify_index(idx_t index) const {
   guarantee(_base != NULL, "Array not initialized");
-  guarantee(index < length(), err_msg("Index out of bounds index: " SIZE_FORMAT " length: " SIZE_FORMAT, index, length()));
+  guarantee(index < length(), "Index out of bounds index: " SIZE_FORMAT " length: " SIZE_FORMAT, index, length());
 }
 
 void G1BiasedMappedArrayBase::verify_biased_index(idx_t biased_index) const {
   guarantee(_biased_base != NULL, "Array not initialized");
   guarantee(biased_index >= bias() && biased_index < (bias() + length()),
-    err_msg("Biased index out of bounds, index: " SIZE_FORMAT " bias: " SIZE_FORMAT " length: " SIZE_FORMAT, biased_index, bias(), length()));
+            "Biased index out of bounds, index: " SIZE_FORMAT " bias: " SIZE_FORMAT " length: " SIZE_FORMAT,
+            biased_index, bias(), length());
 }
 
 void G1BiasedMappedArrayBase::verify_biased_index_inclusive_end(idx_t biased_index) const {
   guarantee(_biased_base != NULL, "Array not initialized");
   guarantee(biased_index >= bias() && biased_index <= (bias() + length()),
-    err_msg("Biased index out of inclusive bounds, index: " SIZE_FORMAT " bias: " SIZE_FORMAT " length: " SIZE_FORMAT, biased_index, bias(), length()));
+            "Biased index out of inclusive bounds, index: " SIZE_FORMAT " bias: " SIZE_FORMAT " length: " SIZE_FORMAT,
+            biased_index, bias(), length());
 }
 
 class TestMappedArray : public G1BiasedMappedArray<int> {
@@ -65,7 +67,7 @@
             REGION_SIZE_IN_WORDS * HeapWordSize);
     // Check address calculation (bounds)
     assert(array.bottom_address_mapped() == fake_heap,
-      err_msg("bottom mapped address should be " PTR_FORMAT ", but is " PTR_FORMAT, p2i(fake_heap), p2i(array.bottom_address_mapped())));
+           "bottom mapped address should be " PTR_FORMAT ", but is " PTR_FORMAT, p2i(fake_heap), p2i(array.bottom_address_mapped()));
     assert(array.end_address_mapped() == (fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS), "must be");
 
     int* bottom = array.address_mapped_to(fake_heap);
--- a/src/share/vm/gc/g1/g1BiasedArray.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1BiasedArray.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -56,7 +56,7 @@
   void initialize_base(address base, size_t length, size_t bias, size_t elem_size, uint shift_by) {
     assert(base != NULL, "just checking");
     assert(length > 0, "just checking");
-    assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %u, larger than word size?", shift_by));
+    assert(shift_by < sizeof(uintptr_t) * 8, "Shifting by %u, larger than word size?", shift_by);
     _base = base;
     _length = length;
     _biased_base = base - (bias * elem_size);
@@ -69,13 +69,13 @@
   void initialize(HeapWord* bottom, HeapWord* end, size_t target_elem_size_in_bytes, size_t mapping_granularity_in_bytes) {
     assert(mapping_granularity_in_bytes > 0, "just checking");
     assert(is_power_of_2(mapping_granularity_in_bytes),
-      err_msg("mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes));
+           "mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes);
     assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0,
-      err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is  " PTR_FORMAT,
-        mapping_granularity_in_bytes, p2i(bottom)));
+           "bottom mapping area address must be a multiple of mapping granularity %zd, is  " PTR_FORMAT,
+           mapping_granularity_in_bytes, p2i(bottom));
     assert((uintptr_t)end % mapping_granularity_in_bytes == 0,
-      err_msg("end mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT,
-        mapping_granularity_in_bytes, p2i(end)));
+           "end mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT,
+           mapping_granularity_in_bytes, p2i(end));
     size_t num_target_elems = pointer_delta(end, bottom, mapping_granularity_in_bytes);
     idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
     address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);
--- a/src/share/vm/gc/g1/g1BlockOffsetTable.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1BlockOffsetTable.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -69,14 +69,14 @@
 #ifdef ASSERT
 void G1BlockOffsetSharedArray::check_index(size_t index, const char* msg) const {
   assert((index) < (_reserved.word_size() >> LogN_words),
-         err_msg("%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT,
-                 msg, (index), (_reserved.word_size() >> LogN_words)));
+         "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT,
+         msg, (index), (_reserved.word_size() >> LogN_words));
   assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)),
-         err_msg("Index " SIZE_FORMAT " corresponding to " PTR_FORMAT
-                 " (%u) is not in committed area.",
-                 (index),
-                 p2i(address_for_index_raw(index)),
-                 G1CollectedHeap::heap()->addr_to_region(address_for_index_raw(index))));
+         "Index " SIZE_FORMAT " corresponding to " PTR_FORMAT
+         " (%u) is not in committed area.",
+         (index),
+         p2i(address_for_index_raw(index)),
+         G1CollectedHeap::heap()->addr_to_region(address_for_index_raw(index)));
 }
 #endif // ASSERT
 
@@ -192,27 +192,27 @@
     u_char entry = _array->offset_array(c);
     if (c - start_card > BlockOffsetArray::power_to_cards_back(1)) {
       guarantee(entry > N_words,
-                err_msg("Should be in logarithmic region - "
-                        "entry: %u, "
-                        "_array->offset_array(c): %u, "
-                        "N_words: %u",
-                        (uint)entry, (uint)_array->offset_array(c), (uint)N_words));
+                "Should be in logarithmic region - "
+                "entry: %u, "
+                "_array->offset_array(c): %u, "
+                "N_words: %u",
+                (uint)entry, (uint)_array->offset_array(c), (uint)N_words);
     }
     size_t backskip = BlockOffsetArray::entry_to_cards_back(entry);
     size_t landing_card = c - backskip;
     guarantee(landing_card >= (start_card - 1), "Inv");
     if (landing_card >= start_card) {
       guarantee(_array->offset_array(landing_card) <= entry,
-                err_msg("Monotonicity - landing_card offset: %u, "
-                        "entry: %u",
-                        (uint)_array->offset_array(landing_card), (uint)entry));
+                "Monotonicity - landing_card offset: %u, "
+                "entry: %u",
+                (uint)_array->offset_array(landing_card), (uint)entry);
     } else {
       guarantee(landing_card == start_card - 1, "Tautology");
       // Note that N_words is the maximum offset value
       guarantee(_array->offset_array(landing_card) <= N_words,
-                err_msg("landing card offset: %u, "
-                        "N_words: %u",
-                        (uint)_array->offset_array(landing_card), (uint)N_words));
+                "landing card offset: %u, "
+                "N_words: %u",
+                (uint)_array->offset_array(landing_card), (uint)N_words);
     }
   }
 }
@@ -271,9 +271,9 @@
   HeapWord* next_boundary = _array->address_for_index(n_index) +
                             (n_index == next_index ? 0 : N_words);
   assert(next_boundary <= _array->_end,
-         err_msg("next_boundary is beyond the end of the covered region "
-                 " next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT,
-                 p2i(next_boundary), p2i(_array->_end)));
+         "next_boundary is beyond the end of the covered region "
+         " next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT,
+         p2i(next_boundary), p2i(_array->_end));
   if (addr >= gsp()->top()) return gsp()->top();
   while (next_boundary < addr) {
     while (n <= next_boundary) {
@@ -361,25 +361,23 @@
   // is checked by an assertion above.
   size_t start_index = _array->index_for(blk_start);
   HeapWord* boundary = _array->address_for_index(start_index);
-  assert((_array->offset_array(orig_index) == 0 &&
-          blk_start == boundary) ||
-          (_array->offset_array(orig_index) > 0 &&
-         _array->offset_array(orig_index) <= N_words),
-         err_msg("offset array should have been set - "
-                  "orig_index offset: %u, "
-                  "blk_start: " PTR_FORMAT ", "
-                  "boundary: " PTR_FORMAT,
-                  (uint)_array->offset_array(orig_index),
-                  p2i(blk_start), p2i(boundary)));
+  assert((_array->offset_array(orig_index) == 0 && blk_start == boundary) ||
+         (_array->offset_array(orig_index) > 0 && _array->offset_array(orig_index) <= N_words),
+         "offset array should have been set - "
+         "orig_index offset: %u, "
+         "blk_start: " PTR_FORMAT ", "
+         "boundary: " PTR_FORMAT,
+         (uint)_array->offset_array(orig_index),
+         p2i(blk_start), p2i(boundary));
   for (size_t j = orig_index + 1; j <= end_index; j++) {
     assert(_array->offset_array(j) > 0 &&
            _array->offset_array(j) <=
              (u_char) (N_words+BlockOffsetArray::N_powers-1),
-           err_msg("offset array should have been set - "
-                   "%u not > 0 OR %u not <= %u",
-                   (uint) _array->offset_array(j),
-                   (uint) _array->offset_array(j),
-                   (uint) (N_words+BlockOffsetArray::N_powers-1)));
+           "offset array should have been set - "
+           "%u not > 0 OR %u not <= %u",
+           (uint) _array->offset_array(j),
+           (uint) _array->offset_array(j),
+           (uint) (N_words+BlockOffsetArray::N_powers-1));
   }
 #endif
 }
@@ -402,8 +400,8 @@
         size_t obj_size = block_size(obj);
         obj_end = obj + obj_size;
         guarantee(obj_end > obj && obj_end <= gsp()->top(),
-            err_msg("Invalid object end. obj: " PTR_FORMAT " obj_size: " SIZE_FORMAT " obj_end: " PTR_FORMAT " top: " PTR_FORMAT,
-                p2i(obj), obj_size, p2i(obj_end), p2i(gsp()->top())));
+                  "Invalid object end. obj: " PTR_FORMAT " obj_size: " SIZE_FORMAT " obj_end: " PTR_FORMAT " top: " PTR_FORMAT,
+                  p2i(obj), obj_size, p2i(obj_end), p2i(gsp()->top()));
       }
     } else {
       // Because we refine the BOT based on which cards are dirty there is not much we can verify here.
@@ -414,13 +412,13 @@
 
       size_t max_backskip = current_card - start_card;
       guarantee(backskip <= max_backskip,
-          err_msg("Going backwards beyond the start_card. start_card: " SIZE_FORMAT " current_card: " SIZE_FORMAT " backskip: " SIZE_FORMAT,
-              start_card, current_card, backskip));
+                "Going backwards beyond the start_card. start_card: " SIZE_FORMAT " current_card: " SIZE_FORMAT " backskip: " SIZE_FORMAT,
+                start_card, current_card, backskip);
 
       HeapWord* backskip_address = _array->address_for_index(current_card - backskip);
       guarantee(backskip_address >= gsp()->bottom(),
-          err_msg("Going backwards beyond bottom of the region: bottom: " PTR_FORMAT ", backskip_address: " PTR_FORMAT,
-              p2i(gsp()->bottom()), p2i(backskip_address)));
+                "Going backwards beyond bottom of the region: bottom: " PTR_FORMAT ", backskip_address: " PTR_FORMAT,
+                p2i(gsp()->bottom()), p2i(backskip_address));
     }
   }
 }
--- a/src/share/vm/gc/g1/g1BlockOffsetTable.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1BlockOffsetTable.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -80,8 +80,8 @@
 
   virtual void set_bottom(HeapWord* new_bottom) {
     assert(new_bottom <= _end,
-           err_msg("new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")",
-                   p2i(new_bottom), p2i(_end)));
+           "new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")",
+           p2i(new_bottom), p2i(_end));
     _bottom = new_bottom;
     resize(pointer_delta(_end, _bottom));
   }
@@ -149,9 +149,8 @@
 
   void check_offset(size_t offset, const char* msg) const {
     assert(offset <= N_words,
-           err_msg("%s - "
-                   "offset: " SIZE_FORMAT ", N_words: %u",
-                   msg, offset, (uint)N_words));
+           "%s - offset: " SIZE_FORMAT ", N_words: %u",
+           msg, offset, (uint)N_words);
   }
 
   // Bounds checking accessors:
--- a/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -81,8 +81,8 @@
   char* pc = (char*)p;
   assert(pc >= (char*)_reserved.start() &&
          pc <  (char*)_reserved.end(),
-         err_msg("p (" PTR_FORMAT ") not in reserved [" PTR_FORMAT ", " PTR_FORMAT ")",
-                 p2i(p), p2i(_reserved.start()), p2i(_reserved.end())));
+         "p (" PTR_FORMAT ") not in reserved [" PTR_FORMAT ", " PTR_FORMAT ")",
+         p2i(p), p2i(_reserved.start()), p2i(_reserved.end()));
   size_t result = index_for_raw(p);
   check_index(result, "bad index from address");
   return result;
@@ -93,10 +93,9 @@
   check_index(index, "index out of range");
   HeapWord* result = address_for_index_raw(index);
   assert(result >= _reserved.start() && result < _reserved.end(),
-         err_msg("bad address from index result " PTR_FORMAT
-                 " _reserved.start() " PTR_FORMAT " _reserved.end() "
-                 PTR_FORMAT,
-                 p2i(result), p2i(_reserved.start()), p2i(_reserved.end())));
+         "bad address from index result " PTR_FORMAT
+         " _reserved.start() " PTR_FORMAT " _reserved.end() " PTR_FORMAT,
+         p2i(result), p2i(_reserved.start()), p2i(_reserved.end()));
   return result;
 }
 
--- a/src/share/vm/gc/g1/g1CardCounts.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CardCounts.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -53,8 +53,8 @@
 void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
   if (has_count_table()) {
     assert(from_card_num < to_card_num,
-           err_msg("Wrong order? from: " SIZE_FORMAT ", to: " SIZE_FORMAT,
-                   from_card_num, to_card_num));
+           "Wrong order? from: " SIZE_FORMAT ", to: " SIZE_FORMAT,
+           from_card_num, to_card_num);
     Copy::fill_to_bytes(&_card_counts[from_card_num], (to_card_num - from_card_num));
   }
 }
@@ -96,8 +96,8 @@
   if (has_count_table()) {
     size_t card_num = ptr_2_card_num(card_ptr);
     assert(card_num < _reserved_max_card_num,
-           err_msg("Card " SIZE_FORMAT " outside of card counts table (max size " SIZE_FORMAT ")",
-                   card_num, _reserved_max_card_num));
+           "Card " SIZE_FORMAT " outside of card counts table (max size " SIZE_FORMAT ")",
+           card_num, _reserved_max_card_num);
     count = (uint) _card_counts[card_num];
     if (count < G1ConcRSHotCardLimit) {
       _card_counts[card_num] =
--- a/src/share/vm/gc/g1/g1CardCounts.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CardCounts.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -79,19 +79,19 @@
 
   size_t ptr_2_card_num(const jbyte* card_ptr) {
     assert(card_ptr >= _ct_bot,
-           err_msg("Invalid card pointer: "
-                   "card_ptr: " PTR_FORMAT ", "
-                   "_ct_bot: " PTR_FORMAT,
-                   p2i(card_ptr), p2i(_ct_bot)));
+           "Invalid card pointer: "
+           "card_ptr: " PTR_FORMAT ", "
+           "_ct_bot: " PTR_FORMAT,
+           p2i(card_ptr), p2i(_ct_bot));
     size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte));
     assert(card_num < _reserved_max_card_num,
-           err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr)));
+           "card pointer out of range: " PTR_FORMAT, p2i(card_ptr));
     return card_num;
   }
 
   jbyte* card_num_2_ptr(size_t card_num) {
     assert(card_num < _reserved_max_card_num,
-           err_msg("card num out of range: " SIZE_FORMAT, card_num));
+           "card num out of range: " SIZE_FORMAT, card_num);
     return (jbyte*) (_ct_bot + card_num);
   }
 
--- a/src/share/vm/gc/g1/g1CodeCacheRemSet.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CodeCacheRemSet.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -197,7 +197,9 @@
 }
 
 void G1CodeRootSet::allocate_small_table() {
-  _table = new CodeRootSetTable(SmallSize);
+  CodeRootSetTable* temp = new CodeRootSetTable(SmallSize);
+
+  OrderAccess::release_store_ptr(&_table, temp);
 }
 
 void CodeRootSetTable::purge_list_append(CodeRootSetTable* table) {
@@ -350,11 +352,11 @@
       assert(set1.is_empty(), "Code root set must be initially empty but is not.");
 
       assert(G1CodeRootSet::static_mem_size() == sizeof(void*),
-          err_msg("The code root set's static memory usage is incorrect, " SIZE_FORMAT " bytes", G1CodeRootSet::static_mem_size()));
+             "The code root set's static memory usage is incorrect, " SIZE_FORMAT " bytes", G1CodeRootSet::static_mem_size());
 
       set1.add((nmethod*)1);
-      assert(set1.length() == 1, err_msg("Added exactly one element, but set contains "
-          SIZE_FORMAT " elements", set1.length()));
+      assert(set1.length() == 1, "Added exactly one element, but set contains "
+             SIZE_FORMAT " elements", set1.length());
 
       const size_t num_to_add = (size_t)G1CodeRootSet::Threshold + 1;
 
@@ -362,16 +364,16 @@
         set1.add((nmethod*)1);
       }
       assert(set1.length() == 1,
-          err_msg("Duplicate detection should not have increased the set size but "
-              "is " SIZE_FORMAT, set1.length()));
+             "Duplicate detection should not have increased the set size but "
+             "is " SIZE_FORMAT, set1.length());
 
       for (size_t i = 2; i <= num_to_add; i++) {
         set1.add((nmethod*)(uintptr_t)(i));
       }
       assert(set1.length() == num_to_add,
-          err_msg("After adding in total " SIZE_FORMAT " distinct code roots, they "
-              "need to be in the set, but there are only " SIZE_FORMAT,
-              num_to_add, set1.length()));
+             "After adding in total " SIZE_FORMAT " distinct code roots, they "
+             "need to be in the set, but there are only " SIZE_FORMAT,
+             num_to_add, set1.length());
 
       assert(CodeRootSetTable::_purge_list != NULL, "should have grown to large hashtable");
 
@@ -385,8 +387,8 @@
         }
       }
       assert(num_popped == num_to_add,
-          err_msg("Managed to pop " SIZE_FORMAT " code roots, but only " SIZE_FORMAT " "
-              "were added", num_popped, num_to_add));
+             "Managed to pop " SIZE_FORMAT " code roots, but only " SIZE_FORMAT " "
+             "were added", num_popped, num_to_add);
       assert(CodeRootSetTable::_purge_list != NULL, "should have grown to large hashtable");
 
       G1CodeRootSet::purge();
--- a/src/share/vm/gc/g1/g1CollectedHeap.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CollectedHeap.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -53,6 +53,7 @@
 #include "gc/g1/suspendibleThreadSet.hpp"
 #include "gc/g1/vm_operations_g1.hpp"
 #include "gc/shared/gcHeapSummary.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.inline.hpp"
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/gcTrace.hpp"
@@ -971,11 +972,11 @@
     size_t commits = 0;
 
     guarantee(reserved.contains(start_address) && reserved.contains(last_address),
-              err_msg("MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]",
-              p2i(start_address), p2i(last_address)));
+              "MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]",
+              p2i(start_address), p2i(last_address));
     guarantee(start_address > prev_last_addr,
-              err_msg("Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT ,
-              p2i(start_address), p2i(prev_last_addr)));
+              "Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT ,
+              p2i(start_address), p2i(prev_last_addr));
     prev_last_addr = last_address;
 
     // Check for ranges that start in the same G1 region in which the previous
@@ -1017,7 +1018,7 @@
 
     while (curr_region != NULL) {
       assert(curr_region->is_empty() && !curr_region->is_pinned(),
-             err_msg("Region already in use (index %u)", curr_region->hrm_index()));
+             "Region already in use (index %u)", curr_region->hrm_index());
       _hr_printer.alloc(curr_region, G1HRPrinter::Archive);
       curr_region->set_allocation_context(AllocationContext::system());
       curr_region->set_archive();
@@ -1055,11 +1056,11 @@
     HeapWord* last_address = ranges[i].last();
 
     assert(reserved.contains(start_address) && reserved.contains(last_address),
-           err_msg("MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]",
-                   p2i(start_address), p2i(last_address)));
+           "MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]",
+           p2i(start_address), p2i(last_address));
     assert(start_address > prev_last_addr,
-           err_msg("Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT ,
-                   p2i(start_address), p2i(prev_last_addr)));
+           "Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT ,
+           p2i(start_address), p2i(prev_last_addr));
 
     HeapRegion* start_region = _hrm.addr_to_region(start_address);
     HeapRegion* last_region = _hrm.addr_to_region(last_address);
@@ -1076,7 +1077,7 @@
     HeapRegion* curr_region = start_region;
     while (curr_region != NULL) {
       guarantee(curr_region->is_archive(),
-                err_msg("Expected archive region at index %u", curr_region->hrm_index()));
+                "Expected archive region at index %u", curr_region->hrm_index());
       if (curr_region != last_region) {
         curr_region = _hrm.next_region_in_heap(curr_region);
       } else {
@@ -1139,11 +1140,11 @@
     HeapWord* last_address = ranges[i].last();
 
     assert(reserved.contains(start_address) && reserved.contains(last_address),
-           err_msg("MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]",
-                   p2i(start_address), p2i(last_address)));
+           "MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]",
+           p2i(start_address), p2i(last_address));
     assert(start_address > prev_last_addr,
-           err_msg("Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT ,
-                   p2i(start_address), p2i(prev_last_addr)));
+           "Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT ,
+           p2i(start_address), p2i(prev_last_addr));
     size_used += ranges[i].byte_size();
     prev_last_addr = last_address;
 
@@ -1168,7 +1169,7 @@
     HeapRegion* curr_region = start_region;
     while (curr_region != NULL) {
       guarantee(curr_region->is_archive(),
-                err_msg("Expected archive region at index %u", curr_region->hrm_index()));
+                "Expected archive region at index %u", curr_region->hrm_index());
       uint curr_index = curr_region->hrm_index();
       _old_set.remove(curr_region);
       curr_region->set_free();
@@ -1450,6 +1451,7 @@
   gc_timer->register_gc_start();
 
   SerialOldTracer* gc_tracer = G1MarkSweep::gc_tracer();
+  GCIdMark gc_id_mark;
   gc_tracer->report_gc_start(gc_cause(), gc_timer->gc_start());
 
   SvcGCMarker sgcm(SvcGCMarker::FULL);
@@ -1476,7 +1478,7 @@
     TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
 
     {
-      GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL, gc_tracer->gc_id());
+      GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL);
       TraceCollectorStats tcs(g1mm()->full_collection_counters());
       TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
 
@@ -1755,9 +1757,9 @@
   // This assert only makes sense here, before we adjust them
   // with respect to the min and max heap size.
   assert(minimum_desired_capacity <= maximum_desired_capacity,
-         err_msg("minimum_desired_capacity = " SIZE_FORMAT ", "
-                 "maximum_desired_capacity = " SIZE_FORMAT,
-                 minimum_desired_capacity, maximum_desired_capacity));
+         "minimum_desired_capacity = " SIZE_FORMAT ", "
+         "maximum_desired_capacity = " SIZE_FORMAT,
+         minimum_desired_capacity, maximum_desired_capacity);
 
   // Should not be greater than the heap max size. No need to adjust
   // it with respect to the heap min size as it's a lower bound (i.e.,
@@ -1799,21 +1801,20 @@
   }
 }
 
-
-HeapWord*
-G1CollectedHeap::satisfy_failed_allocation(size_t word_size,
-                                           AllocationContext_t context,
-                                           bool* succeeded) {
-  assert_at_safepoint(true /* should_be_vm_thread */);
-
-  *succeeded = true;
+HeapWord* G1CollectedHeap::satisfy_failed_allocation_helper(size_t word_size,
+                                                            AllocationContext_t context,
+                                                            bool do_gc,
+                                                            bool clear_all_soft_refs,
+                                                            bool expect_null_mutator_alloc_region,
+                                                            bool* gc_succeeded) {
+  *gc_succeeded = true;
   // Let's attempt the allocation first.
   HeapWord* result =
     attempt_allocation_at_safepoint(word_size,
                                     context,
-                                    false /* expect_null_mutator_alloc_region */);
+                                    expect_null_mutator_alloc_region);
   if (result != NULL) {
-    assert(*succeeded, "sanity");
+    assert(*gc_succeeded, "sanity");
     return result;
   }
 
@@ -1823,41 +1824,58 @@
   // do something smarter than full collection to satisfy a failed alloc.)
   result = expand_and_allocate(word_size, context);
   if (result != NULL) {
-    assert(*succeeded, "sanity");
+    assert(*gc_succeeded, "sanity");
     return result;
   }
 
-  // Expansion didn't work, we'll try to do a Full GC.
-  bool gc_succeeded = do_collection(false, /* explicit_gc */
-                                    false, /* clear_all_soft_refs */
-                                    word_size);
-  if (!gc_succeeded) {
-    *succeeded = false;
-    return NULL;
-  }
-
-  // Retry the allocation
-  result = attempt_allocation_at_safepoint(word_size,
-                                           context,
-                                           true /* expect_null_mutator_alloc_region */);
-  if (result != NULL) {
-    assert(*succeeded, "sanity");
+  if (do_gc) {
+    // Expansion didn't work, we'll try to do a Full GC.
+    *gc_succeeded = do_collection(false, /* explicit_gc */
+                                  clear_all_soft_refs,
+                                  word_size);
+  }
+
+  return NULL;
+}
+
+HeapWord* G1CollectedHeap::satisfy_failed_allocation(size_t word_size,
+                                                     AllocationContext_t context,
+                                                     bool* succeeded) {
+  assert_at_safepoint(true /* should_be_vm_thread */);
+
+  // Attempts to allocate followed by Full GC.
+  HeapWord* result =
+    satisfy_failed_allocation_helper(word_size,
+                                     context,
+                                     true,  /* do_gc */
+                                     false, /* clear_all_soft_refs */
+                                     false, /* expect_null_mutator_alloc_region */
+                                     succeeded);
+
+  if (result != NULL || !*succeeded) {
     return result;
   }
 
-  // Then, try a Full GC that will collect all soft references.
-  gc_succeeded = do_collection(false, /* explicit_gc */
-                               true,  /* clear_all_soft_refs */
-                               word_size);
-  if (!gc_succeeded) {
-    *succeeded = false;
-    return NULL;
-  }
-
-  // Retry the allocation once more
-  result = attempt_allocation_at_safepoint(word_size,
-                                           context,
-                                           true /* expect_null_mutator_alloc_region */);
+  // Attempts to allocate followed by Full GC that will collect all soft references.
+  result = satisfy_failed_allocation_helper(word_size,
+                                            context,
+                                            true, /* do_gc */
+                                            true, /* clear_all_soft_refs */
+                                            true, /* expect_null_mutator_alloc_region */
+                                            succeeded);
+
+  if (result != NULL || !*succeeded) {
+    return result;
+  }
+
+  // Attempts to allocate, no GC
+  result = satisfy_failed_allocation_helper(word_size,
+                                            context,
+                                            false, /* do_gc */
+                                            false, /* clear_all_soft_refs */
+                                            true,  /* expect_null_mutator_alloc_region */
+                                            succeeded);
+
   if (result != NULL) {
     assert(*succeeded, "sanity");
     return result;
@@ -2538,9 +2556,9 @@
 
 void G1CollectedHeap::increment_old_marking_cycles_started() {
   assert(_old_marking_cycles_started == _old_marking_cycles_completed ||
-    _old_marking_cycles_started == _old_marking_cycles_completed + 1,
-    err_msg("Wrong marking cycle count (started: %d, completed: %d)",
-    _old_marking_cycles_started, _old_marking_cycles_completed));
+         _old_marking_cycles_started == _old_marking_cycles_completed + 1,
+         "Wrong marking cycle count (started: %d, completed: %d)",
+         _old_marking_cycles_started, _old_marking_cycles_completed);
 
   _old_marking_cycles_started++;
 }
@@ -2564,17 +2582,17 @@
   assert(concurrent ||
          (_old_marking_cycles_started == _old_marking_cycles_completed + 1) ||
          (_old_marking_cycles_started == _old_marking_cycles_completed + 2),
-         err_msg("for inner caller (Full GC): _old_marking_cycles_started = %u "
-                 "is inconsistent with _old_marking_cycles_completed = %u",
-                 _old_marking_cycles_started, _old_marking_cycles_completed));
+         "for inner caller (Full GC): _old_marking_cycles_started = %u "
+         "is inconsistent with _old_marking_cycles_completed = %u",
+         _old_marking_cycles_started, _old_marking_cycles_completed);
 
   // This is the case for the outer caller, i.e. the concurrent cycle.
   assert(!concurrent ||
          (_old_marking_cycles_started == _old_marking_cycles_completed + 1),
-         err_msg("for outer caller (concurrent cycle): "
-                 "_old_marking_cycles_started = %u "
-                 "is inconsistent with _old_marking_cycles_completed = %u",
-                 _old_marking_cycles_started, _old_marking_cycles_completed));
+         "for outer caller (concurrent cycle): "
+         "_old_marking_cycles_started = %u "
+         "is inconsistent with _old_marking_cycles_completed = %u",
+         _old_marking_cycles_started, _old_marking_cycles_completed);
 
   _old_marking_cycles_completed += 1;
 
@@ -3124,7 +3142,7 @@
     _young_ref_counter_closure.reset_count();
     k->oops_do(&_young_ref_counter_closure);
     if (_young_ref_counter_closure.count() > 0) {
-      guarantee(k->has_modified_oops(), err_msg("Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k)));
+      guarantee(k->has_modified_oops(), "Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k));
     }
   }
 };
@@ -3194,8 +3212,8 @@
   template <class T> void do_oop_work(T *p) {
     oop obj = oopDesc::load_decode_heap_oop(p);
     guarantee(obj == NULL || G1MarkSweep::in_archive_range(obj),
-              err_msg("Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT,
-                      p2i(p), p2i(obj)));
+              "Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT,
+              p2i(p), p2i(obj));
   }
 };
 
@@ -3894,7 +3912,7 @@
     return;
   }
 
-  gclog_or_tty->gclog_stamp(_gc_tracer_stw->gc_id());
+  gclog_or_tty->gclog_stamp();
 
   GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause())
     .append(collector_state()->gcs_are_young() ? "(young)" : "(mixed)")
@@ -3952,6 +3970,7 @@
 
   _gc_timer_stw->register_gc_start();
 
+  GCIdMark gc_id_mark;
   _gc_tracer_stw->report_gc_start(gc_cause(), _gc_timer_stw->gc_start());
 
   SvcGCMarker sgcm(SvcGCMarker::MINOR);
@@ -4709,11 +4728,11 @@
 
   ~G1StringSymbolTableUnlinkTask() {
     guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size,
-              err_msg("claim value %d after unlink less than initial string table size %d",
-                      StringTable::parallel_claimed_index(), _initial_string_table_size));
+              "claim value %d after unlink less than initial string table size %d",
+              StringTable::parallel_claimed_index(), _initial_string_table_size);
     guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size,
-              err_msg("claim value %d after unlink less than initial symbol table size %d",
-                      SymbolTable::parallel_claimed_index(), _initial_symbol_table_size));
+              "claim value %d after unlink less than initial symbol table size %d",
+              SymbolTable::parallel_claimed_index(), _initial_symbol_table_size);
 
     if (G1TraceStringSymbolTableScrubbing) {
       gclog_or_tty->print_cr("Cleaned string and symbol table, "
@@ -5113,7 +5132,7 @@
     } else {
       assert(!obj->is_forwarded(), "invariant" );
       assert(cset_state.is_humongous(),
-             err_msg("Only allowed InCSet state is IsHumongous, but is %d", cset_state.value()));
+             "Only allowed InCSet state is IsHumongous, but is %d", cset_state.value());
       _g1->set_humongous_is_live(obj);
     }
   }
@@ -5167,7 +5186,7 @@
         _par_scan_state->push_on_queue(p);
       } else {
         assert(!Metaspace::contains((const void*)p),
-               err_msg("Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p)));
+               "Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p));
         _copy_non_heap_obj_cl->do_oop(p);
       }
     }
@@ -5501,8 +5520,7 @@
                                               &keep_alive,
                                               &drain_queue,
                                               NULL,
-                                              _gc_timer_stw,
-                                              _gc_tracer_stw->gc_id());
+                                              _gc_timer_stw);
   } else {
     // Parallel reference processing
     assert(rp->num_q() == no_of_gc_workers, "sanity");
@@ -5513,8 +5531,7 @@
                                               &keep_alive,
                                               &drain_queue,
                                               &par_task_executor,
-                                              _gc_timer_stw,
-                                              _gc_tracer_stw->gc_id());
+                                              _gc_timer_stw);
   }
 
   _gc_tracer_stw->report_gc_reference_stats(stats);
@@ -5823,7 +5840,7 @@
 bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
                                                HeapWord* tams, HeapWord* end) {
   guarantee(tams <= end,
-            err_msg("tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end)));
+            "tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end));
   HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end);
   if (result < end) {
     gclog_or_tty->cr();
@@ -6174,9 +6191,8 @@
     }
 
     guarantee(obj->is_typeArray(),
-              err_msg("Only eagerly reclaiming type arrays is supported, but the object "
-                      PTR_FORMAT " is not.",
-                      p2i(r->bottom())));
+              "Only eagerly reclaiming type arrays is supported, but the object "
+              PTR_FORMAT " is not.", p2i(r->bottom()));
 
     if (G1TraceEagerReclaimHumongousObjects) {
       gclog_or_tty->print_cr("Dead humongous region %u size " SIZE_FORMAT " start " PTR_FORMAT " length %u with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d",
@@ -6405,8 +6421,8 @@
 
 void G1CollectedHeap::decrease_used(size_t bytes) {
   assert(_summary_bytes_used >= bytes,
-         err_msg("invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT,
-                 _summary_bytes_used, bytes));
+         "invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT,
+         _summary_bytes_used, bytes);
   _summary_bytes_used -= bytes;
 }
 
@@ -6488,9 +6504,9 @@
     }
   }
   assert(used_unlocked() == recalculate_used(),
-         err_msg("inconsistent used_unlocked(), "
-                 "value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT,
-                 used_unlocked(), recalculate_used()));
+         "inconsistent used_unlocked(), "
+         "value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT,
+         used_unlocked(), recalculate_used());
 }
 
 void G1CollectedHeap::set_refine_cte_cl_concurrency(bool concurrent) {
@@ -6631,35 +6647,35 @@
     if (hr->is_young()) {
       // TODO
     } else if (hr->is_starts_humongous()) {
-      assert(hr->containing_set() == _humongous_set, err_msg("Heap region %u is starts humongous but not in humongous set.", hr->hrm_index()));
+      assert(hr->containing_set() == _humongous_set, "Heap region %u is starts humongous but not in humongous set.", hr->hrm_index());
       _humongous_count.increment(1u, hr->capacity());
     } else if (hr->is_empty()) {
-      assert(_hrm->is_free(hr), err_msg("Heap region %u is empty but not on the free list.", hr->hrm_index()));
+      assert(_hrm->is_free(hr), "Heap region %u is empty but not on the free list.", hr->hrm_index());
       _free_count.increment(1u, hr->capacity());
     } else if (hr->is_old()) {
-      assert(hr->containing_set() == _old_set, err_msg("Heap region %u is old but not in the old set.", hr->hrm_index()));
+      assert(hr->containing_set() == _old_set, "Heap region %u is old but not in the old set.", hr->hrm_index());
       _old_count.increment(1u, hr->capacity());
     } else {
       // There are no other valid region types. Check for one invalid
       // one we can identify: pinned without old or humongous set.
-      assert(!hr->is_pinned(), err_msg("Heap region %u is pinned but not old (archive) or humongous.", hr->hrm_index()));
+      assert(!hr->is_pinned(), "Heap region %u is pinned but not old (archive) or humongous.", hr->hrm_index());
       ShouldNotReachHere();
     }
     return false;
   }
 
   void verify_counts(HeapRegionSet* old_set, HeapRegionSet* humongous_set, HeapRegionManager* free_list) {
-    guarantee(old_set->length() == _old_count.length(), err_msg("Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count.length()));
-    guarantee(old_set->total_capacity_bytes() == _old_count.capacity(), err_msg("Old set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
-        old_set->total_capacity_bytes(), _old_count.capacity()));
-
-    guarantee(humongous_set->length() == _humongous_count.length(), err_msg("Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count.length()));
-    guarantee(humongous_set->total_capacity_bytes() == _humongous_count.capacity(), err_msg("Hum set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
-        humongous_set->total_capacity_bytes(), _humongous_count.capacity()));
-
-    guarantee(free_list->num_free_regions() == _free_count.length(), err_msg("Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count.length()));
-    guarantee(free_list->total_capacity_bytes() == _free_count.capacity(), err_msg("Free list capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
-        free_list->total_capacity_bytes(), _free_count.capacity()));
+    guarantee(old_set->length() == _old_count.length(), "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count.length());
+    guarantee(old_set->total_capacity_bytes() == _old_count.capacity(), "Old set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
+              old_set->total_capacity_bytes(), _old_count.capacity());
+
+    guarantee(humongous_set->length() == _humongous_count.length(), "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count.length());
+    guarantee(humongous_set->total_capacity_bytes() == _humongous_count.capacity(), "Hum set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
+              humongous_set->total_capacity_bytes(), _humongous_count.capacity());
+
+    guarantee(free_list->num_free_regions() == _free_count.length(), "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count.length());
+    guarantee(free_list->total_capacity_bytes() == _free_count.capacity(), "Free list capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
+              free_list->total_capacity_bytes(), _free_count.capacity());
   }
 };
 
@@ -6715,9 +6731,9 @@
       oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
       HeapRegion* hr = _g1h->heap_region_containing(obj);
       assert(!hr->is_continues_humongous(),
-             err_msg("trying to add code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT
-                     " starting at " HR_FORMAT,
-                     p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region())));
+             "trying to add code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT
+             " starting at " HR_FORMAT,
+             p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()));
 
       // HeapRegion::add_strong_code_root_locked() avoids adding duplicate entries.
       hr->add_strong_code_root_locked(_nm);
@@ -6742,9 +6758,9 @@
       oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
       HeapRegion* hr = _g1h->heap_region_containing(obj);
       assert(!hr->is_continues_humongous(),
-             err_msg("trying to remove code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT
-                     " starting at " HR_FORMAT,
-                     p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region())));
+             "trying to remove code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT
+             " starting at " HR_FORMAT,
+             p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()));
 
       hr->remove_strong_code_root(_nm);
     }
--- a/src/share/vm/gc/g1/g1CollectedHeap.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CollectedHeap.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -368,17 +368,17 @@
   // These are macros so that, if the assert fires, we get the correct
   // line number, file, etc.
 
-#define heap_locking_asserts_err_msg(_extra_message_)                         \
-  err_msg("%s : Heap_lock locked: %s, at safepoint: %s, is VM thread: %s",    \
-          (_extra_message_),                                                  \
-          BOOL_TO_STR(Heap_lock->owned_by_self()),                            \
-          BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()),               \
-          BOOL_TO_STR(Thread::current()->is_VM_thread()))
+#define heap_locking_asserts_params(_extra_message_)                          \
+  "%s : Heap_lock locked: %s, at safepoint: %s, is VM thread: %s",            \
+  (_extra_message_),                                                          \
+  BOOL_TO_STR(Heap_lock->owned_by_self()),                                    \
+  BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()),                       \
+  BOOL_TO_STR(Thread::current()->is_VM_thread())
 
 #define assert_heap_locked()                                                  \
   do {                                                                        \
     assert(Heap_lock->owned_by_self(),                                        \
-           heap_locking_asserts_err_msg("should be holding the Heap_lock"));  \
+           heap_locking_asserts_params("should be holding the Heap_lock"));   \
   } while (0)
 
 #define assert_heap_locked_or_at_safepoint(_should_be_vm_thread_)             \
@@ -386,7 +386,7 @@
     assert(Heap_lock->owned_by_self() ||                                      \
            (SafepointSynchronize::is_at_safepoint() &&                        \
              ((_should_be_vm_thread_) == Thread::current()->is_VM_thread())), \
-           heap_locking_asserts_err_msg("should be holding the Heap_lock or " \
+           heap_locking_asserts_params("should be holding the Heap_lock or "  \
                                         "should be at a safepoint"));         \
   } while (0)
 
@@ -394,21 +394,21 @@
   do {                                                                        \
     assert(Heap_lock->owned_by_self() &&                                      \
                                     !SafepointSynchronize::is_at_safepoint(), \
-          heap_locking_asserts_err_msg("should be holding the Heap_lock and " \
+          heap_locking_asserts_params("should be holding the Heap_lock and "  \
                                        "should not be at a safepoint"));      \
   } while (0)
 
 #define assert_heap_not_locked()                                              \
   do {                                                                        \
     assert(!Heap_lock->owned_by_self(),                                       \
-        heap_locking_asserts_err_msg("should not be holding the Heap_lock")); \
+        heap_locking_asserts_params("should not be holding the Heap_lock"));  \
   } while (0)
 
 #define assert_heap_not_locked_and_not_at_safepoint()                         \
   do {                                                                        \
     assert(!Heap_lock->owned_by_self() &&                                     \
                                     !SafepointSynchronize::is_at_safepoint(), \
-      heap_locking_asserts_err_msg("should not be holding the Heap_lock and " \
+      heap_locking_asserts_params("should not be holding the Heap_lock and "  \
                                    "should not be at a safepoint"));          \
   } while (0)
 
@@ -416,13 +416,13 @@
   do {                                                                        \
     assert(SafepointSynchronize::is_at_safepoint() &&                         \
               ((_should_be_vm_thread_) == Thread::current()->is_VM_thread()), \
-           heap_locking_asserts_err_msg("should be at a safepoint"));         \
+           heap_locking_asserts_params("should be at a safepoint"));          \
   } while (0)
 
 #define assert_not_at_safepoint()                                             \
   do {                                                                        \
     assert(!SafepointSynchronize::is_at_safepoint(),                          \
-           heap_locking_asserts_err_msg("should not be at a safepoint"));     \
+           heap_locking_asserts_params("should not be at a safepoint"));      \
   } while (0)
 
 protected:
@@ -571,7 +571,16 @@
   HeapWord* satisfy_failed_allocation(size_t word_size,
                                       AllocationContext_t context,
                                       bool* succeeded);
+private:
+  // Helper method for satisfy_failed_allocation()
+  HeapWord* satisfy_failed_allocation_helper(size_t word_size,
+                                             AllocationContext_t context,
+                                             bool do_gc,
+                                             bool clear_all_soft_refs,
+                                             bool expect_null_mutator_alloc_region,
+                                             bool* gc_succeeded);
 
+protected:
   // Attempting to expand the heap sufficiently
   // to support an allocation of the given "word_size".  If
   // successful, perform the allocation and return the address of the
--- a/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -67,8 +67,8 @@
 
 inline uint G1CollectedHeap::addr_to_region(HeapWord* addr) const {
   assert(is_in_reserved(addr),
-         err_msg("Cannot calculate region index for address " PTR_FORMAT " that is outside of the heap [" PTR_FORMAT ", " PTR_FORMAT ")",
-                 p2i(addr), p2i(reserved_region().start()), p2i(reserved_region().end())));
+         "Cannot calculate region index for address " PTR_FORMAT " that is outside of the heap [" PTR_FORMAT ", " PTR_FORMAT ")",
+         p2i(addr), p2i(reserved_region().start()), p2i(reserved_region().end()));
   return (uint)(pointer_delta(addr, reserved_region().start(), sizeof(uint8_t)) >> HeapRegion::LogOfHRGrainBytes);
 }
 
@@ -80,8 +80,8 @@
 inline HeapRegion* G1CollectedHeap::heap_region_containing_raw(const T addr) const {
   assert(addr != NULL, "invariant");
   assert(is_in_g1_reserved((const void*) addr),
-      err_msg("Address " PTR_FORMAT " is outside of the heap ranging from [" PTR_FORMAT " to " PTR_FORMAT ")",
-          p2i((void*)addr), p2i(g1_reserved().start()), p2i(g1_reserved().end())));
+         "Address " PTR_FORMAT " is outside of the heap ranging from [" PTR_FORMAT " to " PTR_FORMAT ")",
+         p2i((void*)addr), p2i(g1_reserved().start()), p2i(g1_reserved().end()));
   return _hrm.addr_to_region((HeapWord*) addr);
 }
 
--- a/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -813,8 +813,8 @@
   update_survivors_policy();
 
   assert(_g1->used() == _g1->recalculate_used(),
-         err_msg("sanity, used: " SIZE_FORMAT " recalculate_used: " SIZE_FORMAT,
-                 _g1->used(), _g1->recalculate_used()));
+         "sanity, used: " SIZE_FORMAT " recalculate_used: " SIZE_FORMAT,
+         _g1->used(), _g1->recalculate_used());
 
   double s_w_t_ms = (start_time_sec - _stop_world_start) * 1000.0;
   _trace_young_gen_time_data.record_start_collection(s_w_t_ms);
@@ -857,7 +857,7 @@
   _cur_mark_stop_world_time_ms += elapsed_time_ms;
   _prev_collection_pause_end_ms += elapsed_time_ms;
 
-  _mmu_tracker->add_pause(_mark_remark_start_sec, end_time_sec, _g1->gc_tracer_cm()->gc_id());
+  _mmu_tracker->add_pause(_mark_remark_start_sec, end_time_sec);
 }
 
 void G1CollectorPolicy::record_concurrent_mark_cleanup_start() {
@@ -952,8 +952,7 @@
     collector_state()->set_initiate_conc_mark_if_possible(true);
   }
 
-  _mmu_tracker->add_pause(end_time_sec - pause_time_ms/1000.0,
-                          end_time_sec, _g1->gc_tracer_stw()->gc_id());
+  _mmu_tracker->add_pause(end_time_sec - pause_time_ms/1000.0, end_time_sec);
 
   if (update_stats) {
     _trace_young_gen_time_data.record_end_collection(pause_time_ms, phase_times());
@@ -1584,7 +1583,7 @@
   _concurrent_mark_cleanup_times_ms->add(elapsed_time_ms);
   _cur_mark_stop_world_time_ms += elapsed_time_ms;
   _prev_collection_pause_end_ms += elapsed_time_ms;
-  _mmu_tracker->add_pause(_mark_cleanup_start_sec, end_sec, _g1->gc_tracer_cm()->gc_id());
+  _mmu_tracker->add_pause(_mark_cleanup_start_sec, end_sec);
 }
 
 // Add the heap region at the head of the non-incremental collection set
@@ -1876,8 +1875,7 @@
   finalize_incremental_cset_building();
 
   guarantee(target_pause_time_ms > 0.0,
-            err_msg("target_pause_time_ms = %1.6lf should be positive",
-                    target_pause_time_ms));
+            "target_pause_time_ms = %1.6lf should be positive", target_pause_time_ms);
   guarantee(_collection_set == NULL, "Precondition");
 
   double base_time_ms = predict_base_elapsed_time_ms(_pending_cards);
--- a/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -839,7 +839,7 @@
       case InCSetState::Old:
         return REGIONS_UNLIMITED;
       default:
-        assert(false, err_msg("Unknown dest state: " CSETSTATE_FORMAT, dest.value()));
+        assert(false, "Unknown dest state: " CSETSTATE_FORMAT, dest.value());
         break;
     }
     // keep some compilers happy
--- a/src/share/vm/gc/g1/g1EvacFailure.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1EvacFailure.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -165,9 +165,9 @@
         size_t size_second_obj = ((oop)end_first_obj)->size();
         HeapWord* end_of_second_obj = end_first_obj + size_second_obj;
         assert(end == end_of_second_obj,
-               err_msg("More than two objects were used to fill the area from " PTR_FORMAT " to " PTR_FORMAT ", "
-                       "second objects size " SIZE_FORMAT " ends at " PTR_FORMAT,
-                       p2i(start), p2i(end), size_second_obj, p2i(end_of_second_obj)));
+               "More than two objects were used to fill the area from " PTR_FORMAT " to " PTR_FORMAT ", "
+               "second objects size " SIZE_FORMAT " ends at " PTR_FORMAT,
+               p2i(start), p2i(end), size_second_obj, p2i(end_of_second_obj));
 #endif
       }
     }
@@ -215,7 +215,7 @@
     bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
     bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
 
-    assert(!hr->is_pinned(), err_msg("Unexpected pinned region at index %u", hr->hrm_index()));
+    assert(!hr->is_pinned(), "Unexpected pinned region at index %u", hr->hrm_index());
     assert(hr->in_collection_set(), "bad CS");
 
     if (_hrclaimer->claim_region(hr->hrm_index())) {
--- a/src/share/vm/gc/g1/g1EvacStats.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1EvacStats.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -45,13 +45,13 @@
 
     if (_allocated == 0) {
       assert((_unused == 0),
-             err_msg("Inconsistency in PLAB stats: "
-                     "_allocated: " SIZE_FORMAT ", "
-                     "_wasted: " SIZE_FORMAT ", "
-                     "_region_end_waste: " SIZE_FORMAT ", "
-                     "_unused: " SIZE_FORMAT ", "
-                     "_used  : " SIZE_FORMAT,
-                     _allocated, _wasted, _region_end_waste, _unused, used()));
+             "Inconsistency in PLAB stats: "
+             "_allocated: " SIZE_FORMAT ", "
+             "_wasted: " SIZE_FORMAT ", "
+             "_region_end_waste: " SIZE_FORMAT ", "
+             "_unused: " SIZE_FORMAT ", "
+             "_used  : " SIZE_FORMAT,
+             _allocated, _wasted, _region_end_waste, _unused, used());
       _allocated = 1;
     }
     // The size of the PLAB caps the amount of space that can be wasted at the
--- a/src/share/vm/gc/g1/g1GCPhaseTimes.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1GCPhaseTimes.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -130,8 +130,8 @@
   WorkerDataArray<size_t>* thread_work_items() { return _thread_work_items; }
 
   void set(uint worker_i, T value) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] == WorkerDataArray<T>::uninitialized(), err_msg("Overwriting data for worker %d in %s", worker_i, _title));
+    assert(worker_i < _length, "Worker %d is greater than max: %d", worker_i, _length);
+    assert(_data[worker_i] == WorkerDataArray<T>::uninitialized(), "Overwriting data for worker %d in %s", worker_i, _title);
     _data[worker_i] = value;
     _has_new_data = true;
   }
@@ -142,14 +142,14 @@
   }
 
   T get(uint worker_i) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data added for worker %d", worker_i));
+    assert(worker_i < _length, "Worker %d is greater than max: %d", worker_i, _length);
+    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), "No data added for worker %d", worker_i);
     return _data[worker_i];
   }
 
   void add(uint worker_i, T value) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data to add to for worker %d", worker_i));
+    assert(worker_i < _length, "Worker %d is greater than max: %d", worker_i, _length);
+    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), "No data to add to for worker %d", worker_i);
     _data[worker_i] += value;
     _has_new_data = true;
   }
@@ -235,7 +235,7 @@
   assert(active_threads <= _length, "Wrong number of active threads");
   for (uint i = 0; i < active_threads; i++) {
     assert(_data[i] != WorkerDataArray<T>::uninitialized(),
-        err_msg("Invalid data for worker %u in '%s'", i, _title));
+           "Invalid data for worker %u in '%s'", i, _title);
   }
   if (_thread_work_items != NULL) {
     _thread_work_items->verify(active_threads);
@@ -479,7 +479,7 @@
       print_count_values(buf, phase_id, thread_work_items);
     }
 
-    assert(thread_work_items->_print_sum, err_msg("%s does not have print sum true even though it is a count", thread_work_items->_title));
+    assert(thread_work_items->_print_sum, "%s does not have print sum true even though it is a count", thread_work_items->_title);
 
     buf.append_and_print_cr(" Min: " SIZE_FORMAT ", Avg: %.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT "]",
         _phase_times->min_thread_work_items(phase_id), _phase_times->average_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id),
--- a/src/share/vm/gc/g1/g1HotCardCache.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1HotCardCache.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -112,8 +112,7 @@
           // RSet updating while within an evacuation pause.
           // In this case worker_i should be the id of a GC worker thread
           assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
-          assert(worker_i < ParallelGCThreads,
-                 err_msg("incorrect worker id: %u", worker_i));
+          assert(worker_i < ParallelGCThreads, "incorrect worker id: %u", worker_i);
 
           into_cset_dcq->enqueue(card_ptr);
         }
--- a/src/share/vm/gc/g1/g1InCSetState.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1InCSetState.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -67,7 +67,7 @@
   };
 
   InCSetState(in_cset_state_t value = NotInCSet) : _value(value) {
-    assert(is_valid(), err_msg("Invalid state %d", _value));
+    assert(is_valid(), "Invalid state %d", _value);
   }
 
   in_cset_state_t value() const        { return _value; }
@@ -104,7 +104,7 @@
  public:
   void set_humongous(uintptr_t index) {
     assert(get_by_index(index).is_default(),
-           err_msg("State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()));
+           "State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value());
     set_by_index(index, InCSetState::Humongous);
   }
 
@@ -114,13 +114,13 @@
 
   void set_in_young(uintptr_t index) {
     assert(get_by_index(index).is_default(),
-           err_msg("State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()));
+           "State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value());
     set_by_index(index, InCSetState::Young);
   }
 
   void set_in_old(uintptr_t index) {
     assert(get_by_index(index).is_default(),
-           err_msg("State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()));
+           "State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value());
     set_by_index(index, InCSetState::Old);
   }
 
--- a/src/share/vm/gc/g1/g1MMUTracker.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1MMUTracker.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -76,7 +76,7 @@
   return gc_time;
 }
 
-void G1MMUTrackerQueue::add_pause(double start, double end, const GCId& gcId) {
+void G1MMUTrackerQueue::add_pause(double start, double end) {
   double duration = end - start;
 
   remove_expired_entries(end);
@@ -106,7 +106,7 @@
 
   // Current entry needs to be added before calculating the value
   double slice_time = calculate_gc_time(end);
-  G1MMUTracer::report_mmu(gcId, _time_slice, slice_time, _max_gc_time);
+  G1MMUTracer::report_mmu(_time_slice, slice_time, _max_gc_time);
 }
 
 // basically the _internal call does not remove expired entries
--- a/src/share/vm/gc/g1/g1MMUTracker.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1MMUTracker.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -43,7 +43,7 @@
 public:
   G1MMUTracker(double time_slice, double max_gc_time);
 
-  virtual void add_pause(double start, double end, const GCId& gcId) = 0;
+  virtual void add_pause(double start, double end) = 0;
   virtual double when_sec(double current_time, double pause_time) = 0;
 
   double max_gc_time() {
@@ -127,7 +127,7 @@
 public:
   G1MMUTrackerQueue(double time_slice, double max_gc_time);
 
-  virtual void add_pause(double start, double end, const GCId& gcId);
+  virtual void add_pause(double start, double end);
 
   virtual double when_sec(double current_time, double pause_time);
 };
--- a/src/share/vm/gc/g1/g1MarkSweep.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1MarkSweep.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -121,7 +121,7 @@
 void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
                                     bool clear_all_softrefs) {
   // Recursively traverse all live objects and mark them
-  GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
+  GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer());
 
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
@@ -146,8 +146,7 @@
                                       &GenMarkSweep::keep_alive,
                                       &GenMarkSweep::follow_stack_closure,
                                       NULL,
-                                      gc_timer(),
-                                      gc_tracer()->gc_id());
+                                      gc_timer());
   gc_tracer()->report_gc_reference_stats(stats);
 
 
@@ -200,7 +199,7 @@
   // phase2, phase3 and phase4, but the ValidateMarkSweep live oops
   // tracking expects us to do so. See comment under phase4.
 
-  GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
+  GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer());
 
   prepare_compaction();
 }
@@ -233,7 +232,7 @@
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
   // Adjust the pointers to reflect the new locations
-  GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
+  GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer());
 
   // Need cleared claim bits for the roots processing
   ClassLoaderDataGraph::clear_claimed_marks();
@@ -294,7 +293,7 @@
   // to use a higher index (saved from phase2) when verifying perm_gen.
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
-  GCTraceTime tm("phase 4", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
+  GCTraceTime tm("phase 4", G1Log::fine() && Verbose, true, gc_timer());
 
   G1SpaceCompactClosure blk;
   g1h->heap_region_iterate(&blk);
--- a/src/share/vm/gc/g1/g1OopClosures.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1OopClosures.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -55,7 +55,7 @@
   _worker_id = par_scan_state->worker_id();
 
   assert(_worker_id < ParallelGCThreads,
-         err_msg("The given worker id %u must be less than the number of threads %u", _worker_id, ParallelGCThreads));
+         "The given worker id %u must be less than the number of threads %u", _worker_id, ParallelGCThreads);
 }
 
 // Generate G1 specialized oop_oop_iterate functions.
--- a/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -57,13 +57,13 @@
   vmassert(page_size > 0, "Page size must be non-zero.");
 
   guarantee(is_ptr_aligned(rs.base(), page_size),
-            err_msg("Reserved space base " PTR_FORMAT " is not aligned to requested page size " SIZE_FORMAT, p2i(rs.base()), page_size));
+            "Reserved space base " PTR_FORMAT " is not aligned to requested page size " SIZE_FORMAT, p2i(rs.base()), page_size);
   guarantee(is_size_aligned(used_size, os::vm_page_size()),
-            err_msg("Given used reserved space size needs to be OS page size aligned (%d bytes) but is " SIZE_FORMAT, os::vm_page_size(), used_size));
+            "Given used reserved space size needs to be OS page size aligned (%d bytes) but is " SIZE_FORMAT, os::vm_page_size(), used_size);
   guarantee(used_size <= rs.size(),
-            err_msg("Used size of reserved space " SIZE_FORMAT " bytes is smaller than reservation at " SIZE_FORMAT " bytes", used_size, rs.size()));
+            "Used size of reserved space " SIZE_FORMAT " bytes is smaller than reservation at " SIZE_FORMAT " bytes", used_size, rs.size());
   guarantee(is_size_aligned(rs.size(), page_size),
-            err_msg("Expected that the virtual space is size aligned, but " SIZE_FORMAT " is not aligned to page size " SIZE_FORMAT, rs.size(), page_size));
+            "Expected that the virtual space is size aligned, but " SIZE_FORMAT " is not aligned to page size " SIZE_FORMAT, rs.size(), page_size);
 
   _low_boundary  = rs.base();
   _high_boundary = _low_boundary + used_size;
@@ -137,23 +137,23 @@
 
 bool G1PageBasedVirtualSpace::is_after_last_page(size_t index) const {
   guarantee(index <= _committed.size(),
-            err_msg("Given boundary page " SIZE_FORMAT " is beyond managed page count " SIZE_FORMAT, index, _committed.size()));
+            "Given boundary page " SIZE_FORMAT " is beyond managed page count " SIZE_FORMAT, index, _committed.size());
   return index == _committed.size();
 }
 
 void G1PageBasedVirtualSpace::commit_preferred_pages(size_t start, size_t num_pages) {
   vmassert(num_pages > 0, "No full pages to commit");
   vmassert(start + num_pages <= _committed.size(),
-           err_msg("Tried to commit area from page " SIZE_FORMAT " to page " SIZE_FORMAT " "
-                   "that is outside of managed space of " SIZE_FORMAT " pages",
-                   start, start + num_pages, _committed.size()));
+           "Tried to commit area from page " SIZE_FORMAT " to page " SIZE_FORMAT " "
+           "that is outside of managed space of " SIZE_FORMAT " pages",
+           start, start + num_pages, _committed.size());
 
   char* start_addr = page_start(start);
   size_t size = num_pages * _page_size;
 
   os::commit_memory_or_exit(start_addr, size, _page_size, _executable,
                             err_msg("Failed to commit area from " PTR_FORMAT " to " PTR_FORMAT " of length " SIZE_FORMAT ".",
-                                    p2i(start_addr), p2i(start_addr + size), size));
+                            p2i(start_addr), p2i(start_addr + size), size));
 }
 
 void G1PageBasedVirtualSpace::commit_tail() {
@@ -162,14 +162,14 @@
   char* const aligned_end_address = (char*)align_ptr_down(_high_boundary, _page_size);
   os::commit_memory_or_exit(aligned_end_address, _tail_size, os::vm_page_size(), _executable,
                             err_msg("Failed to commit tail area from " PTR_FORMAT " to " PTR_FORMAT " of length " SIZE_FORMAT ".",
-                                    p2i(aligned_end_address), p2i(_high_boundary), _tail_size));
+                            p2i(aligned_end_address), p2i(_high_boundary), _tail_size));
 }
 
 void G1PageBasedVirtualSpace::commit_internal(size_t start_page, size_t end_page) {
   guarantee(start_page < end_page,
-            err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page));
+            "Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page);
   guarantee(end_page <= _committed.size(),
-            err_msg("Given end page " SIZE_FORMAT " is beyond end of managed page amount of " SIZE_FORMAT, end_page, _committed.size()));
+            "Given end page " SIZE_FORMAT " is beyond end of managed page amount of " SIZE_FORMAT, end_page, _committed.size());
 
   size_t pages = end_page - start_page;
   bool need_to_commit_tail = is_after_last_page(end_page) && is_last_page_partial();
@@ -195,7 +195,7 @@
 
 void G1PageBasedVirtualSpace::pretouch_internal(size_t start_page, size_t end_page) {
   guarantee(start_page < end_page,
-            err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page));
+            "Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page);
 
   os::pretouch_memory(page_start(start_page), bounded_end_addr(end_page));
 }
@@ -226,7 +226,7 @@
 
 void G1PageBasedVirtualSpace::uncommit_internal(size_t start_page, size_t end_page) {
   guarantee(start_page < end_page,
-            err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page));
+            "Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page);
 
   char* start_addr = page_start(start_page);
   os::uncommit_memory(start_addr, pointer_delta(bounded_end_addr(end_page), start_addr, sizeof(char)));
--- a/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -97,10 +97,10 @@
 bool G1ParScanThreadState::verify_ref(narrowOop* ref) const {
   assert(ref != NULL, "invariant");
   assert(UseCompressedOops, "sanity");
-  assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, p2i(ref)));
+  assert(!has_partial_array_mask(ref), "ref=" PTR_FORMAT, p2i(ref));
   oop p = oopDesc::load_decode_heap_oop(ref);
   assert(_g1h->is_in_g1_reserved(p),
-         err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p)));
+         "ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p));
   return true;
 }
 
@@ -110,11 +110,11 @@
     // Must be in the collection set--it's already been copied.
     oop p = clear_partial_array_mask(ref);
     assert(_g1h->obj_in_cs(p),
-           err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p)));
+           "ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p));
   } else {
     oop p = oopDesc::load_decode_heap_oop(ref);
     assert(_g1h->is_in_g1_reserved(p),
-           err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p)));
+           "ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p));
   }
   return true;
 }
@@ -147,8 +147,8 @@
                                                       size_t word_sz,
                                                       AllocationContext_t const context,
                                                       bool previous_plab_refill_failed) {
-  assert(state.is_in_cset_or_humongous(), err_msg("Unexpected state: " CSETSTATE_FORMAT, state.value()));
-  assert(dest->is_in_cset_or_humongous(), err_msg("Unexpected dest: " CSETSTATE_FORMAT, dest->value()));
+  assert(state.is_in_cset_or_humongous(), "Unexpected state: " CSETSTATE_FORMAT, state.value());
+  assert(dest->is_in_cset_or_humongous(), "Unexpected dest: " CSETSTATE_FORMAT, dest->value());
 
   // Right now we only have two types of regions (young / old) so
   // let's keep the logic here simple. We can generalize it when necessary.
@@ -177,7 +177,7 @@
     return obj_ptr;
   } else {
     _old_gen_is_full = previous_plab_refill_failed;
-    assert(dest->is_old(), err_msg("Unexpected dest: " CSETSTATE_FORMAT, dest->value()));
+    assert(dest->is_old(), "Unexpected dest: " CSETSTATE_FORMAT, dest->value());
     // no other space to try.
     return NULL;
   }
@@ -359,8 +359,7 @@
 }
 
 oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
-  assert(_g1h->obj_in_cs(old),
-         err_msg("Object " PTR_FORMAT " should be in the CSet", p2i(old)));
+  assert(_g1h->obj_in_cs(old), "Object " PTR_FORMAT " should be in the CSet", p2i(old));
 
   oop forward_ptr = old->forward_to_atomic(old);
   if (forward_ptr == NULL) {
@@ -383,9 +382,9 @@
     // space for this object (old != forward_ptr) or they beat us in
     // self-forwarding it (old == forward_ptr).
     assert(old == forward_ptr || !_g1h->obj_in_cs(forward_ptr),
-           err_msg("Object " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
-                   "should not be in the CSet",
-                   p2i(old), p2i(forward_ptr)));
+           "Object " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
+           "should not be in the CSet",
+           p2i(old), p2i(forward_ptr));
     return forward_ptr;
   }
 }
--- a/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -75,9 +75,9 @@
 
   InCSetState dest(InCSetState original) const {
     assert(original.is_valid(),
-           err_msg("Original state invalid: " CSETSTATE_FORMAT, original.value()));
+           "Original state invalid: " CSETSTATE_FORMAT, original.value());
     assert(_dest[original.value()].is_valid_gen(),
-           err_msg("Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value()));
+           "Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value());
     return _dest[original.value()];
   }
 
--- a/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -52,7 +52,7 @@
     _g1h->set_humongous_is_live(obj);
   } else {
     assert(!in_cset_state.is_in_cset_or_humongous(),
-           err_msg("In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value()));
+           "In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value());
   }
 
   assert(obj != NULL, "Must be");
@@ -82,7 +82,7 @@
   // to-space object.
   int next_index             = to_obj_array->length();
   assert(0 <= next_index && next_index < length,
-         err_msg("invariant, next index: %d, length: %d", next_index, length));
+         "invariant, next index: %d, length: %d", next_index, length);
 
   int start                  = next_index;
   int end                    = length;
--- a/src/share/vm/gc/g1/g1RegionToSpaceMapper.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1RegionToSpaceMapper.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -113,7 +113,7 @@
 
   virtual void commit_regions(uint start_idx, size_t num_regions) {
     for (uint i = start_idx; i < start_idx + num_regions; i++) {
-      assert(!_commit_map.at(i), err_msg("Trying to commit storage at region %u that is already committed", i));
+      assert(!_commit_map.at(i), "Trying to commit storage at region %u that is already committed", i);
       size_t idx = region_idx_to_page_idx(i);
       uint old_refcount = _refcounts.get_by_index(idx);
       bool zero_filled = false;
@@ -128,7 +128,7 @@
 
   virtual void uncommit_regions(uint start_idx, size_t num_regions) {
     for (uint i = start_idx; i < start_idx + num_regions; i++) {
-      assert(_commit_map.at(i), err_msg("Trying to uncommit storage at region %u that is not committed", i));
+      assert(_commit_map.at(i), "Trying to uncommit storage at region %u that is not committed", i);
       size_t idx = region_idx_to_page_idx(i);
       uint old_refcount = _refcounts.get_by_index(idx);
       assert(old_refcount > 0, "must be");
--- a/src/share/vm/gc/g1/g1RemSet.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/g1RemSet.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -413,11 +413,11 @@
 bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
                            bool check_for_refs_into_cset) {
   assert(_g1->is_in_exact(_ct_bs->addr_for(card_ptr)),
-         err_msg("Card at " PTR_FORMAT " index " SIZE_FORMAT " representing heap at " PTR_FORMAT " (%u) must be in committed heap",
-                 p2i(card_ptr),
-                 _ct_bs->index_for(_ct_bs->addr_for(card_ptr)),
-                 p2i(_ct_bs->addr_for(card_ptr)),
-                 _g1->addr_to_region(_ct_bs->addr_for(card_ptr))));
+         "Card at " PTR_FORMAT " index " SIZE_FORMAT " representing heap at " PTR_FORMAT " (%u) must be in committed heap",
+         p2i(card_ptr),
+         _ct_bs->index_for(_ct_bs->addr_for(card_ptr)),
+         p2i(_ct_bs->addr_for(card_ptr)),
+         _g1->addr_to_region(_ct_bs->addr_for(card_ptr)));
 
   // If the card is no longer dirty, nothing to do.
   if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
--- a/src/share/vm/gc/g1/heapRegion.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegion.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -165,7 +165,7 @@
   assert(_end == orig_end(),
          "we should have already filtered out humongous regions");
   assert(!in_collection_set(),
-         err_msg("Should not clear heap region %u in the collection set", hrm_index()));
+         "Should not clear heap region %u in the collection set", hrm_index());
 
   set_allocation_context(AllocationContext::system());
   set_young_index_in_cset(-1);
@@ -292,9 +292,9 @@
   record_timestamp();
 
   assert(mr.end() == orig_end(),
-         err_msg("Given region end address " PTR_FORMAT " should match exactly "
-                 "bottom plus one region size, i.e. " PTR_FORMAT,
-                 p2i(mr.end()), p2i(orig_end())));
+         "Given region end address " PTR_FORMAT " should match exactly "
+         "bottom plus one region size, i.e. " PTR_FORMAT,
+         p2i(mr.end()), p2i(orig_end()));
 }
 
 CompactibleSpace* HeapRegion::next_compaction_space() const {
@@ -327,7 +327,7 @@
                                                   bool during_conc_mark,
                                                   size_t marked_bytes) {
   assert(marked_bytes <= used(),
-         err_msg("marked: " SIZE_FORMAT " used: " SIZE_FORMAT, marked_bytes, used()));
+         "marked: " SIZE_FORMAT " used: " SIZE_FORMAT, marked_bytes, used());
   _prev_top_at_mark_start = top();
   _prev_marked_bytes = marked_bytes;
 }
--- a/src/share/vm/gc/g1/heapRegion.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegion.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -542,9 +542,9 @@
   void set_containing_set(HeapRegionSetBase* containing_set) {
     assert((containing_set == NULL && _containing_set != NULL) ||
            (containing_set != NULL && _containing_set == NULL),
-           err_msg("containing_set: " PTR_FORMAT " "
-                   "_containing_set: " PTR_FORMAT,
-                   p2i(containing_set), p2i(_containing_set)));
+           "containing_set: " PTR_FORMAT " "
+           "_containing_set: " PTR_FORMAT,
+           p2i(containing_set), p2i(_containing_set));
 
     _containing_set = containing_set;
   }
--- a/src/share/vm/gc/g1/heapRegion.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegion.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -132,10 +132,10 @@
   }
 
   assert(ClassUnloadingWithConcurrentMark,
-      err_msg("All blocks should be objects if G1 Class Unloading isn't used. "
-              "HR: [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ") "
-              "addr: " PTR_FORMAT,
-              p2i(bottom()), p2i(top()), p2i(end()), p2i(addr)));
+         "All blocks should be objects if G1 Class Unloading isn't used. "
+         "HR: [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ") "
+         "addr: " PTR_FORMAT,
+         p2i(bottom()), p2i(top()), p2i(end()), p2i(addr));
 
   // Old regions' dead objects may have dead classes
   // We need to find the next live object in some other
--- a/src/share/vm/gc/g1/heapRegionManager.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegionManager.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -92,7 +92,7 @@
 }
 
 void HeapRegionManager::uncommit_regions(uint start, size_t num_regions) {
-  guarantee(num_regions >= 1, err_msg("Need to specify at least one region to uncommit, tried to uncommit zero regions at %u", start));
+  guarantee(num_regions >= 1, "Need to specify at least one region to uncommit, tried to uncommit zero regions at %u", start);
   guarantee(_num_committed >= num_regions, "pre-condition");
 
   // Print before uncommitting.
@@ -132,7 +132,7 @@
   _available_map.par_set_range(start, start + num_regions, BitMap::unknown_range);
 
   for (uint i = start; i < start + num_regions; i++) {
-    assert(is_available(i), err_msg("Just made region %u available but is apparently not.", i));
+    assert(is_available(i), "Just made region %u available but is apparently not.", i);
     HeapRegion* hr = at(i);
     if (G1CollectedHeap::heap()->hr_printer()->is_active()) {
       G1CollectedHeap::heap()->hr_printer()->commit(hr->bottom(), hr->end());
@@ -213,8 +213,8 @@
       HeapRegion* hr = _regions.get_by_index(i);
       // sanity check
       guarantee((!empty_only && !is_available(i)) || (is_available(i) && hr != NULL && hr->is_empty()),
-                err_msg("Found region sequence starting at " UINT32_FORMAT ", length " SIZE_FORMAT
-                        " that is not empty at " UINT32_FORMAT ". Hr is " PTR_FORMAT, found, num, i, p2i(hr)));
+                "Found region sequence starting at " UINT32_FORMAT ", length " SIZE_FORMAT
+                " that is not empty at " UINT32_FORMAT ". Hr is " PTR_FORMAT, found, num, i, p2i(hr));
     }
     return found;
   } else {
@@ -224,7 +224,7 @@
 
 HeapRegion* HeapRegionManager::next_region_in_heap(const HeapRegion* r) const {
   guarantee(r != NULL, "Start region must be a valid region");
-  guarantee(is_available(r->hrm_index()), err_msg("Trying to iterate starting from region %u which is not in the heap", r->hrm_index()));
+  guarantee(is_available(r->hrm_index()), "Trying to iterate starting from region %u which is not in the heap", r->hrm_index());
   for (uint i = r->hrm_index() + 1; i < _allocated_heapregions_length; i++) {
     HeapRegion* hr = _regions.get_by_index(i);
     if (is_available(i)) {
@@ -241,7 +241,7 @@
     if (!is_available(i)) {
       continue;
     }
-    guarantee(at(i) != NULL, err_msg("Tried to access region %u that has a NULL HeapRegion*", i));
+    guarantee(at(i) != NULL, "Tried to access region %u that has a NULL HeapRegion*", i);
     bool res = blk->doHeapRegion(at(i));
     if (res) {
       blk->incomplete();
@@ -273,7 +273,7 @@
     assert(!is_available(i), "just checking");
   }
   assert(cur == max_length() || num_regions == 0 || is_available(cur),
-         err_msg("The region at the current position %u must be available or at the end of the heap.", cur));
+         "The region at the current position %u must be available or at the end of the heap.", cur);
 #endif
   return num_regions;
 }
@@ -374,8 +374,8 @@
 
         assert(chr->is_continues_humongous(), "Must be humongous region");
         assert(chr->humongous_start_region() == r,
-               err_msg("Must work on humongous continuation of the original start region "
-                       PTR_FORMAT ", but is " PTR_FORMAT, p2i(r), p2i(chr)));
+               "Must work on humongous continuation of the original start region "
+               PTR_FORMAT ", but is " PTR_FORMAT, p2i(r), p2i(chr));
         assert(!hrclaimer->is_region_claimed(ch_index),
                "Must not have been claimed yet because claiming of humongous continuation first claims the start region");
 
@@ -440,9 +440,9 @@
 void HeapRegionManager::shrink_at(uint index, size_t num_regions) {
 #ifdef ASSERT
   for (uint i = index; i < (index + num_regions); i++) {
-    assert(is_available(i), err_msg("Expected available region at index %u", i));
-    assert(at(i)->is_empty(), err_msg("Expected empty region at index %u", i));
-    assert(at(i)->is_free(), err_msg("Expected free region at index %u", i));
+    assert(is_available(i), "Expected available region at index %u", i);
+    assert(at(i)->is_empty(), "Expected empty region at index %u", i);
+    assert(at(i)->is_free(), "Expected free region at index %u", i);
   }
 #endif
   uncommit_regions(index, num_regions);
@@ -479,11 +479,11 @@
 
 void HeapRegionManager::verify() {
   guarantee(length() <= _allocated_heapregions_length,
-            err_msg("invariant: _length: %u _allocated_length: %u",
-                    length(), _allocated_heapregions_length));
+            "invariant: _length: %u _allocated_length: %u",
+            length(), _allocated_heapregions_length);
   guarantee(_allocated_heapregions_length <= max_length(),
-            err_msg("invariant: _allocated_length: %u _max_length: %u",
-                    _allocated_heapregions_length, max_length()));
+            "invariant: _allocated_length: %u _max_length: %u",
+            _allocated_heapregions_length, max_length());
 
   bool prev_committed = true;
   uint num_committed = 0;
@@ -495,12 +495,12 @@
     }
     num_committed++;
     HeapRegion* hr = _regions.get_by_index(i);
-    guarantee(hr != NULL, err_msg("invariant: i: %u", i));
+    guarantee(hr != NULL, "invariant: i: %u", i);
     guarantee(!prev_committed || hr->bottom() == prev_end,
-              err_msg("invariant i: %u " HR_FORMAT " prev_end: " PTR_FORMAT,
-                      i, HR_FORMAT_PARAMS(hr), p2i(prev_end)));
+              "invariant i: %u " HR_FORMAT " prev_end: " PTR_FORMAT,
+              i, HR_FORMAT_PARAMS(hr), p2i(prev_end));
     guarantee(hr->hrm_index() == i,
-              err_msg("invariant: i: %u hrm_index(): %u", i, hr->hrm_index()));
+              "invariant: i: %u hrm_index(): %u", i, hr->hrm_index());
     // Asserts will fire if i is >= _length
     HeapWord* addr = hr->bottom();
     guarantee(addr_to_region(addr) == hr, "sanity");
@@ -515,10 +515,10 @@
     }
   }
   for (uint i = _allocated_heapregions_length; i < max_length(); i++) {
-    guarantee(_regions.get_by_index(i) == NULL, err_msg("invariant i: %u", i));
+    guarantee(_regions.get_by_index(i) == NULL, "invariant i: %u", i);
   }
 
-  guarantee(num_committed == _num_committed, err_msg("Found %u committed regions, but should be %u", num_committed, _num_committed));
+  guarantee(num_committed == _num_committed, "Found %u committed regions, but should be %u", num_committed, _num_committed);
   _free_list.verify();
 }
 
--- a/src/share/vm/gc/g1/heapRegionManager.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegionManager.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -31,9 +31,9 @@
 
 inline HeapRegion* HeapRegionManager::addr_to_region(HeapWord* addr) const {
   assert(addr < heap_end(),
-        err_msg("addr: " PTR_FORMAT " end: " PTR_FORMAT, p2i(addr), p2i(heap_end())));
+        "addr: " PTR_FORMAT " end: " PTR_FORMAT, p2i(addr), p2i(heap_end()));
   assert(addr >= heap_bottom(),
-        err_msg("addr: " PTR_FORMAT " bottom: " PTR_FORMAT, p2i(addr), p2i(heap_bottom())));
+        "addr: " PTR_FORMAT " bottom: " PTR_FORMAT, p2i(addr), p2i(heap_bottom()));
 
   HeapRegion* hr = _regions.get_by_address(addr);
   return hr;
--- a/src/share/vm/gc/g1/heapRegionRemSet.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegionRemSet.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -376,8 +376,8 @@
 
 void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {
   guarantee((size_t)start_idx + new_num_regions <= max_uintx,
-            err_msg("Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT,
-                    start_idx, new_num_regions));
+            "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT,
+            start_idx, new_num_regions);
   for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) {
     uint end_idx = (start_idx + (uint)new_num_regions);
     assert(end_idx <= _max_regions, "Must be within max.");
@@ -1013,7 +1013,7 @@
 
   card_index = _cur_region_card_offset + _cur_card_in_prt;
   guarantee(_cur_card_in_prt < HeapRegion::CardsPerRegion,
-            err_msg("Card index " SIZE_FORMAT " must be within the region", _cur_card_in_prt));
+            "Card index " SIZE_FORMAT " must be within the region", _cur_card_in_prt);
   return true;
 }
 
@@ -1182,8 +1182,8 @@
 
   size_t min_prt_size = sizeof(void*) + dummy->bm()->size_in_words() * HeapWordSize;
   assert(dummy->mem_size() > min_prt_size,
-         err_msg("PerRegionTable memory usage is suspiciously small, only has " SIZE_FORMAT " bytes. "
-                 "Should be at least " SIZE_FORMAT " bytes.", dummy->mem_size(), min_prt_size));
+         "PerRegionTable memory usage is suspiciously small, only has " SIZE_FORMAT " bytes. "
+         "Should be at least " SIZE_FORMAT " bytes.", dummy->mem_size(), min_prt_size);
   free(dummy);
   guarantee(dummy->mem_size() == fl_mem_size(), "fl_mem_size() does not return the correct element size");
   // try to reset the state
--- a/src/share/vm/gc/g1/heapRegionSet.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegionSet.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -37,14 +37,14 @@
 
 #ifndef PRODUCT
 void HeapRegionSetBase::verify_region(HeapRegion* hr) {
-  assert(hr->containing_set() == this, err_msg("Inconsistent containing set for %u", hr->hrm_index()));
-  assert(!hr->is_young(), err_msg("Adding young region %u", hr->hrm_index())); // currently we don't use these sets for young regions
-  assert(hr->is_humongous() == regions_humongous(), err_msg("Wrong humongous state for region %u and set %s", hr->hrm_index(), name()));
-  assert(hr->is_free() == regions_free(), err_msg("Wrong free state for region %u and set %s", hr->hrm_index(), name()));
-  assert(!hr->is_free() || hr->is_empty(), err_msg("Free region %u is not empty for set %s", hr->hrm_index(), name()));
+  assert(hr->containing_set() == this, "Inconsistent containing set for %u", hr->hrm_index());
+  assert(!hr->is_young(), "Adding young region %u", hr->hrm_index()); // currently we don't use these sets for young regions
+  assert(hr->is_humongous() == regions_humongous(), "Wrong humongous state for region %u and set %s", hr->hrm_index(), name());
+  assert(hr->is_free() == regions_free(), "Wrong free state for region %u and set %s", hr->hrm_index(), name());
+  assert(!hr->is_free() || hr->is_empty(), "Free region %u is not empty for set %s", hr->hrm_index(), name());
   assert(!hr->is_empty() || hr->is_free() || hr->is_archive(),
-         err_msg("Empty region %u is not free or archive for set %s", hr->hrm_index(), name()));
-  assert(hr->rem_set()->verify_ready_for_par_iteration(), err_msg("Wrong iteration state %u", hr->hrm_index()));
+         "Empty region %u is not free or archive for set %s", hr->hrm_index(), name());
+  assert(hr->rem_set()->verify_ready_for_par_iteration(), "Wrong iteration state %u", hr->hrm_index());
 }
 #endif
 
@@ -57,14 +57,14 @@
 
   guarantee(( is_empty() && length() == 0 && total_capacity_bytes() == 0) ||
             (!is_empty() && length() > 0  && total_capacity_bytes() > 0) ,
-            hrs_ext_msg(this, "invariant"));
+            "%s", hrs_ext_msg(this, "invariant").buffer());
 }
 
 void HeapRegionSetBase::verify_start() {
   // See comment in verify() about MT safety and verification.
   check_mt_safety();
   assert(!_verify_in_progress,
-         hrs_ext_msg(this, "verification should not be in progress"));
+         "%s", hrs_ext_msg(this, "verification should not be in progress").buffer());
 
   // Do the basic verification first before we do the checks over the regions.
   HeapRegionSetBase::verify();
@@ -76,7 +76,7 @@
   // See comment in verify() about MT safety and verification.
   check_mt_safety();
   assert(_verify_in_progress,
-         hrs_ext_msg(this, "verification should be in progress"));
+         "%s", hrs_ext_msg(this, "verification should be in progress").buffer());
 
   _verify_in_progress = false;
 }
@@ -151,7 +151,7 @@
   #endif // ASSERT
 
   if (is_empty()) {
-    assert(length() == 0 && _tail == NULL, hrs_ext_msg(this, "invariant"));
+    assert(length() == 0 && _tail == NULL, "%s", hrs_ext_msg(this, "invariant").buffer());
     _head = from_list->_head;
     _tail = from_list->_tail;
   } else {
@@ -198,8 +198,8 @@
 
 void FreeRegionList::remove_starting_at(HeapRegion* first, uint num_regions) {
   check_mt_safety();
-  assert(num_regions >= 1, hrs_ext_msg(this, "pre-condition"));
-  assert(!is_empty(), hrs_ext_msg(this, "pre-condition"));
+  assert(num_regions >= 1, "%s", hrs_ext_msg(this, "pre-condition").buffer());
+  assert(!is_empty(), "%s", hrs_ext_msg(this, "pre-condition").buffer());
 
   verify_optional();
   DEBUG_ONLY(uint old_length = length();)
@@ -212,22 +212,22 @@
     HeapRegion* prev = curr->prev();
 
     assert(count < num_regions,
-           hrs_err_msg("[%s] should not come across more regions "
-                       "pending for removal than num_regions: %u",
-                       name(), num_regions));
+           "%s", hrs_err_msg("[%s] should not come across more regions "
+                             "pending for removal than num_regions: %u",
+                             name(), num_regions).buffer());
 
     if (prev == NULL) {
-      assert(_head == curr, hrs_ext_msg(this, "invariant"));
+      assert(_head == curr, "%s", hrs_ext_msg(this, "invariant").buffer());
       _head = next;
     } else {
-      assert(_head != curr, hrs_ext_msg(this, "invariant"));
+      assert(_head != curr, "%s", hrs_ext_msg(this, "invariant").buffer());
       prev->set_next(next);
     }
     if (next == NULL) {
-      assert(_tail == curr, hrs_ext_msg(this, "invariant"));
+      assert(_tail == curr, "%s", hrs_ext_msg(this, "invariant").buffer());
       _tail = prev;
     } else {
-      assert(_tail != curr, hrs_ext_msg(this, "invariant"));
+      assert(_tail != curr, "%s", hrs_ext_msg(this, "invariant").buffer());
       next->set_prev(prev);
     }
     if (_last = curr) {
@@ -243,12 +243,12 @@
   }
 
   assert(count == num_regions,
-         hrs_err_msg("[%s] count: %u should be == num_regions: %u",
-                     name(), count, num_regions));
+         "%s", hrs_err_msg("[%s] count: %u should be == num_regions: %u",
+                           name(), count, num_regions).buffer());
   assert(length() + num_regions == old_length,
-         hrs_err_msg("[%s] new length should be consistent "
-                     "new length: %u old length: %u num_regions: %u",
-                     name(), length(), old_length, num_regions));
+         "%s", hrs_err_msg("[%s] new length should be consistent "
+                           "new length: %u old length: %u num_regions: %u",
+                           name(), length(), old_length, num_regions).buffer());
 
   verify_optional();
 }
@@ -305,8 +305,8 @@
 
     count++;
     guarantee(count < _unrealistically_long_length,
-        hrs_err_msg("[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: " PTR_FORMAT " prev0: " PTR_FORMAT " " "prev1: " PTR_FORMAT " length: %u",
-            name(), count, p2i(curr), p2i(prev0), p2i(prev1), length()));
+        "%s", hrs_err_msg("[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: " PTR_FORMAT " prev0: " PTR_FORMAT " " "prev1: " PTR_FORMAT " length: %u",
+              name(), count, p2i(curr), p2i(prev0), p2i(prev1), length()).buffer());
 
     if (curr->next() != NULL) {
       guarantee(curr->next()->prev() == curr, "Next or prev pointers messed up");
@@ -321,11 +321,11 @@
     curr = curr->next();
   }
 
-  guarantee(_tail == prev0, err_msg("Expected %s to end with %u but it ended with %u.", name(), _tail->hrm_index(), prev0->hrm_index()));
+  guarantee(_tail == prev0, "Expected %s to end with %u but it ended with %u.", name(), _tail->hrm_index(), prev0->hrm_index());
   guarantee(_tail == NULL || _tail->next() == NULL, "_tail should not have a next");
-  guarantee(length() == count, err_msg("%s count mismatch. Expected %u, actual %u.", name(), length(), count));
-  guarantee(total_capacity_bytes() == capacity, err_msg("%s capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
-      name(), total_capacity_bytes(), capacity));
+  guarantee(length() == count, "%s count mismatch. Expected %u, actual %u.", name(), length(), count);
+  guarantee(total_capacity_bytes() == capacity, "%s capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
+            name(), total_capacity_bytes(), capacity);
 }
 
 // Note on the check_mt_safety() methods below:
--- a/src/share/vm/gc/g1/heapRegionSet.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegionSet.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -29,9 +29,9 @@
 
 inline void HeapRegionSetBase::add(HeapRegion* hr) {
   check_mt_safety();
-  assert(hr->containing_set() == NULL, hrs_ext_msg(this, "should not already have a containing set %u"));
-  assert(hr->next() == NULL, hrs_ext_msg(this, "should not already be linked"));
-  assert(hr->prev() == NULL, hrs_ext_msg(this, "should not already be linked"));
+  assert(hr->containing_set() == NULL, "%s", hrs_ext_msg(this, "should not already have a containing set %u").buffer());
+  assert(hr->next() == NULL, "%s", hrs_ext_msg(this, "should not already be linked").buffer());
+  assert(hr->prev() == NULL, "%s", hrs_ext_msg(this, "should not already be linked").buffer());
 
   _count.increment(1u, hr->capacity());
   hr->set_containing_set(this);
@@ -41,18 +41,18 @@
 inline void HeapRegionSetBase::remove(HeapRegion* hr) {
   check_mt_safety();
   verify_region(hr);
-  assert(hr->next() == NULL, hrs_ext_msg(this, "should already be unlinked"));
-  assert(hr->prev() == NULL, hrs_ext_msg(this, "should already be unlinked"));
+  assert(hr->next() == NULL, "%s", hrs_ext_msg(this, "should already be unlinked").buffer());
+  assert(hr->prev() == NULL, "%s", hrs_ext_msg(this, "should already be unlinked").buffer());
 
   hr->set_containing_set(NULL);
-  assert(_count.length() > 0, hrs_ext_msg(this, "pre-condition"));
+  assert(_count.length() > 0, "%s", hrs_ext_msg(this, "pre-condition").buffer());
   _count.decrement(1u, hr->capacity());
 }
 
 inline void FreeRegionList::add_ordered(HeapRegion* hr) {
   assert((length() == 0 && _head == NULL && _tail == NULL && _last == NULL) ||
          (length() >  0 && _head != NULL && _tail != NULL),
-         hrs_ext_msg(this, "invariant"));
+         "%s", hrs_ext_msg(this, "invariant").buffer());
   // add() will verify the region and check mt safety.
   add(hr);
 
@@ -129,7 +129,7 @@
     return NULL;
   }
   assert(length() > 0 && _head != NULL && _tail != NULL,
-         hrs_ext_msg(this, "invariant"));
+         "%s", hrs_ext_msg(this, "invariant").buffer());
 
   HeapRegion* hr;
 
--- a/src/share/vm/gc/g1/heapRegionType.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/heapRegionType.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -28,7 +28,7 @@
 #include "memory/allocation.hpp"
 
 #define hrt_assert_is_valid(tag) \
-  assert(is_valid((tag)), err_msg("invalid HR type: %u", (uint) (tag)))
+  assert(is_valid((tag)), "invalid HR type: %u", (uint) (tag))
 
 class HeapRegionType VALUE_OBJ_CLASS_SPEC {
 private:
@@ -97,8 +97,7 @@
     hrt_assert_is_valid(tag);
     hrt_assert_is_valid(before);
     hrt_assert_is_valid(_tag);
-    assert(_tag == before,
-           err_msg("HR tag: %u, expected: %u new tag; %u", _tag, before, tag));
+    assert(_tag == before, "HR tag: %u, expected: %u new tag; %u", _tag, before, tag);
     _tag = tag;
   }
 
--- a/src/share/vm/gc/g1/satbQueue.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/satbQueue.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -77,16 +77,16 @@
 inline bool requires_marking(const void* entry, G1CollectedHeap* heap) {
   // Includes rejection of NULL pointers.
   assert(heap->is_in_reserved(entry),
-         err_msg("Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry)));
+         "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry));
 
   HeapRegion* region = heap->heap_region_containing_raw(entry);
-  assert(region != NULL, err_msg("No region for " PTR_FORMAT, p2i(entry)));
+  assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry));
   if (entry >= region->next_top_at_mark_start()) {
     return false;
   }
 
   assert(((oop)entry)->is_oop(true /* ignore mark word */),
-         err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry)));
+         "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry));
 
   return true;
 }
--- a/src/share/vm/gc/g1/vm_operations_g1.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/vm_operations_g1.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -26,6 +26,7 @@
 #include "gc/g1/concurrentMarkThread.inline.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1CollectorPolicy.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/g1/g1Log.hpp"
 #include "gc/g1/vm_operations_g1.hpp"
 #include "gc/shared/gcTimer.hpp"
@@ -66,8 +67,8 @@
     _should_retry_gc(false),
     _old_marking_cycles_completed_before(0) {
   guarantee(target_pause_time_ms > 0.0,
-            err_msg("target_pause_time_ms = %1.6lf should be positive",
-                    target_pause_time_ms));
+            "target_pause_time_ms = %1.6lf should be positive",
+            target_pause_time_ms);
   _gc_cause = gc_cause;
 }
 
@@ -227,7 +228,8 @@
 void VM_CGC_Operation::doit() {
   TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
-  GCTraceTime t(_printGCMessage, G1Log::fine(), true, g1h->gc_timer_cm(), g1h->concurrent_mark()->concurrent_gc_id());
+  GCIdMark gc_id_mark(_gc_id);
+  GCTraceTime t(_printGCMessage, G1Log::fine(), true, g1h->gc_timer_cm());
   IsGCActiveMark x;
   _cl->do_void();
 }
--- a/src/share/vm/gc/g1/vm_operations_g1.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/g1/vm_operations_g1.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -26,6 +26,7 @@
 #define SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP
 
 #include "gc/g1/g1AllocationContext.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/vmGCOperations.hpp"
 
 // VM_operations for the G1 collector.
@@ -104,6 +105,7 @@
   VoidClosure* _cl;
   const char* _printGCMessage;
   bool _needs_pll;
+  uint _gc_id;
 
 protected:
   // java.lang.ref.Reference support
@@ -112,7 +114,7 @@
 
 public:
   VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg, bool needs_pll)
-    : _cl(cl), _printGCMessage(printGCMsg), _needs_pll(needs_pll) { }
+    : _cl(cl), _printGCMessage(printGCMsg), _needs_pll(needs_pll), _gc_id(GCId::current()) { }
   virtual VMOp_Type type() const { return VMOp_CGC_Operation; }
   virtual void doit();
   virtual bool doit_prologue();
--- a/src/share/vm/gc/parallel/cardTableExtension.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/cardTableExtension.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -285,7 +285,7 @@
           while (p < to) {
             Prefetch::write(p, interval);
             oop m = oop(p);
-            assert(m->is_oop_or_null(), err_msg("Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m)));
+            assert(m->is_oop_or_null(), "Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m));
             pm->push_contents(m);
             p += m->size();
           }
@@ -293,7 +293,7 @@
         } else {
           while (p < to) {
             oop m = oop(p);
-            assert(m->is_oop_or_null(), err_msg("Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m)));
+            assert(m->is_oop_or_null(), "Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m));
             pm->push_contents(m);
             p += m->size();
           }
--- a/src/share/vm/gc/parallel/gcTaskManager.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/gcTaskManager.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -26,6 +26,7 @@
 #include "gc/parallel/gcTaskManager.hpp"
 #include "gc/parallel/gcTaskThread.hpp"
 #include "gc/shared/adaptiveSizePolicy.hpp"
+#include "gc/shared/gcId.hpp"
 #include "memory/allocation.hpp"
 #include "memory/allocation.inline.hpp"
 #include "runtime/mutex.hpp"
@@ -48,8 +49,8 @@
   case ordinary_task:
     result = "ordinary task";
     break;
-  case barrier_task:
-    result = "barrier task";
+  case wait_for_barrier_task:
+    result = "wait for barrier task";
     break;
   case noop_task:
     result = "noop task";
@@ -61,33 +62,24 @@
   return result;
 };
 
-GCTask::GCTask() :
-  _kind(Kind::ordinary_task),
-  _affinity(GCTaskManager::sentinel_worker()){
-  initialize();
+GCTask::GCTask() {
+  initialize(Kind::ordinary_task, GCId::current());
 }
 
-GCTask::GCTask(Kind::kind kind) :
-  _kind(kind),
-  _affinity(GCTaskManager::sentinel_worker()) {
-  initialize();
+GCTask::GCTask(Kind::kind kind) {
+  initialize(kind, GCId::current());
 }
 
-GCTask::GCTask(uint affinity) :
-  _kind(Kind::ordinary_task),
-  _affinity(affinity) {
-  initialize();
+GCTask::GCTask(Kind::kind kind, uint gc_id) {
+  initialize(kind, gc_id);
 }
 
-GCTask::GCTask(Kind::kind kind, uint affinity) :
-  _kind(kind),
-  _affinity(affinity) {
-  initialize();
-}
-
-void GCTask::initialize() {
+void GCTask::initialize(Kind::kind kind, uint gc_id) {
+  _kind = kind;
+  _affinity = GCTaskManager::sentinel_worker();
   _older = NULL;
   _newer = NULL;
+  _gc_id = gc_id;
 }
 
 void GCTask::destruct() {
@@ -378,16 +370,7 @@
 GCTaskManager::GCTaskManager(uint workers) :
   _workers(workers),
   _active_workers(0),
-  _idle_workers(0),
-  _ndc(NULL) {
-  initialize();
-}
-
-GCTaskManager::GCTaskManager(uint workers, NotifyDoneClosure* ndc) :
-  _workers(workers),
-  _active_workers(0),
-  _idle_workers(0),
-  _ndc(ndc) {
+  _idle_workers(0) {
   initialize();
 }
 
@@ -404,7 +387,6 @@
   GCTaskQueue* unsynchronized_queue = GCTaskQueue::create_on_c_heap();
   _queue = SynchronizedGCTaskQueue::create(unsynchronized_queue, lock());
   _noop_task = NoopGCTask::create_on_c_heap();
-  _idle_inactive_task = WaitForBarrierGCTask::create_on_c_heap();
   _resource_flag = NEW_C_HEAP_ARRAY(bool, workers(), mtGC);
   {
     // Set up worker threads.
@@ -437,7 +419,6 @@
   }
   reset_delivered_tasks();
   reset_completed_tasks();
-  reset_noop_tasks();
   reset_barriers();
   reset_emptied_queue();
   for (uint s = 0; s < workers(); s += 1) {
@@ -450,8 +431,6 @@
   assert(queue()->is_empty(), "still have queued work");
   NoopGCTask::destroy(_noop_task);
   _noop_task = NULL;
-  WaitForBarrierGCTask::destroy(_idle_inactive_task);
-  _idle_inactive_task = NULL;
   if (_thread != NULL) {
     for (uint i = 0; i < workers(); i += 1) {
       GCTaskThread::destroy(thread(i));
@@ -483,9 +462,9 @@
                                  Threads::number_of_non_daemon_threads());
 
   assert(!all_workers_active() || active_workers() == ParallelGCThreads,
-         err_msg("all_workers_active() is  incorrect: "
-                 "active %d  ParallelGCThreads %u", active_workers(),
-                 ParallelGCThreads));
+         "all_workers_active() is  incorrect: "
+         "active %d  ParallelGCThreads %u", active_workers(),
+         ParallelGCThreads);
   if (TraceDynamicGCThreads) {
     gclog_or_tty->print_cr("GCTaskManager::set_active_gang(): "
                            "all_workers_active()  %d  workers %d  "
@@ -507,7 +486,7 @@
       // the GCTaskManager's monitor so that the "more_inactive_workers"
       // count is correct.
       MutexLockerEx ml(monitor(), Mutex::_no_safepoint_check_flag);
-      _idle_inactive_task->set_should_wait(true);
+      _wait_helper.set_should_wait(true);
       // active_workers are a number being requested.  idle_workers
       // are the number currently idle.  If all the workers are being
       // requested to be active but some are already idle, reduce
@@ -550,7 +529,7 @@
   {
     MutexLockerEx ml(monitor(),
       Mutex::_no_safepoint_check_flag);
-    _idle_inactive_task->set_should_wait(false);
+    _wait_helper.set_should_wait(false);
     monitor()->notify_all();
   // Release monitor
   }
@@ -671,7 +650,6 @@
     // Just hand back a Noop task,
     // in case someone wanted us to release resources, or whatever.
     result = noop_task();
-    increment_noop_tasks();
   }
   assert(result != NULL, "shouldn't have null task");
   if (TraceGCTaskManager) {
@@ -706,11 +684,6 @@
     if (TraceGCTaskManager) {
       tty->print_cr("    GCTaskManager::note_completion(%u) done", which);
     }
-    // Notify client that we are done.
-    NotifyDoneClosure* ndc = notify_done_closure();
-    if (ndc != NULL) {
-      ndc->notify(this);
-    }
   }
   if (TraceGCTaskManager) {
     tty->print_cr("    GCTaskManager::note_completion(%u) (%s)->notify_all",
@@ -751,7 +724,7 @@
 }
 
 void GCTaskManager::release_all_resources() {
-  // If you want this to be done atomically, do it in a BarrierGCTask.
+  // If you want this to be done atomically, do it in a WaitForBarrierGCTask.
   for (uint i = 0; i < workers(); i += 1) {
     set_resource_flag(i, true);
   }
@@ -813,25 +786,22 @@
 // NoopGCTask
 //
 
-NoopGCTask* NoopGCTask::create() {
-  NoopGCTask* result = new NoopGCTask(false);
-  return result;
-}
-
 NoopGCTask* NoopGCTask::create_on_c_heap() {
-  NoopGCTask* result = new(ResourceObj::C_HEAP, mtGC) NoopGCTask(true);
+  NoopGCTask* result = new(ResourceObj::C_HEAP, mtGC) NoopGCTask();
   return result;
 }
 
 void NoopGCTask::destroy(NoopGCTask* that) {
   if (that != NULL) {
     that->destruct();
-    if (that->is_c_heap_obj()) {
-      FreeHeap(that);
-    }
+    FreeHeap(that);
   }
 }
 
+// This task should never be performing GC work that require
+// a valid GC id.
+NoopGCTask::NoopGCTask() : GCTask(GCTask::Kind::noop_task, GCId::undefined()) { }
+
 void NoopGCTask::destruct() {
   // This has to know it's superclass structure, just like the constructor.
   this->GCTask::destruct();
@@ -857,12 +827,12 @@
 }
 
 void IdleGCTask::do_it(GCTaskManager* manager, uint which) {
-  WaitForBarrierGCTask* wait_for_task = manager->idle_inactive_task();
+  WaitHelper* wait_helper = manager->wait_helper();
   if (TraceGCTaskManager) {
     tty->print_cr("[" INTPTR_FORMAT "]"
                   " IdleGCTask:::do_it()"
       "  should_wait: %s",
-      p2i(this), wait_for_task->should_wait() ? "true" : "false");
+      p2i(this), wait_helper->should_wait() ? "true" : "false");
   }
   MutexLockerEx ml(manager->monitor(), Mutex::_no_safepoint_check_flag);
   if (TraceDynamicGCThreads) {
@@ -871,7 +841,7 @@
   // Increment has to be done when the idle tasks are created.
   // manager->increment_idle_workers();
   manager->monitor()->notify_all();
-  while (wait_for_task->should_wait()) {
+  while (wait_helper->should_wait()) {
     if (TraceGCTaskManager) {
       tty->print_cr("[" INTPTR_FORMAT "]"
                     " IdleGCTask::do_it()"
@@ -888,7 +858,7 @@
     tty->print_cr("[" INTPTR_FORMAT "]"
                   " IdleGCTask::do_it() returns"
       "  should_wait: %s",
-      p2i(this), wait_for_task->should_wait() ? "true" : "false");
+      p2i(this), wait_helper->should_wait() ? "true" : "false");
   }
   // Release monitor().
 }
@@ -909,140 +879,52 @@
 }
 
 //
-// BarrierGCTask
+// WaitForBarrierGCTask
 //
-
-void BarrierGCTask::do_it(GCTaskManager* manager, uint which) {
-  // Wait for this to be the only busy worker.
-  // ??? I thought of having a StackObj class
-  //     whose constructor would grab the lock and come to the barrier,
-  //     and whose destructor would release the lock,
-  //     but that seems like too much mechanism for two lines of code.
-  MutexLockerEx ml(manager->lock(), Mutex::_no_safepoint_check_flag);
-  do_it_internal(manager, which);
-  // Release manager->lock().
+WaitForBarrierGCTask* WaitForBarrierGCTask::create() {
+  WaitForBarrierGCTask* result = new WaitForBarrierGCTask();
+  return result;
 }
 
-void BarrierGCTask::do_it_internal(GCTaskManager* manager, uint which) {
+WaitForBarrierGCTask::WaitForBarrierGCTask() : GCTask(GCTask::Kind::wait_for_barrier_task) { }
+
+void WaitForBarrierGCTask::destroy(WaitForBarrierGCTask* that) {
+  if (that != NULL) {
+    if (TraceGCTaskManager) {
+      tty->print_cr("[" INTPTR_FORMAT "] WaitForBarrierGCTask::destroy()", p2i(that));
+    }
+    that->destruct();
+  }
+}
+
+void WaitForBarrierGCTask::destruct() {
+  if (TraceGCTaskManager) {
+    tty->print_cr("[" INTPTR_FORMAT "] WaitForBarrierGCTask::destruct()", p2i(this));
+  }
+  this->GCTask::destruct();
+  // Clean up that should be in the destructor,
+  // except that ResourceMarks don't call destructors.
+  _wait_helper.release_monitor();
+}
+
+void WaitForBarrierGCTask::do_it_internal(GCTaskManager* manager, uint which) {
   // Wait for this to be the only busy worker.
   assert(manager->monitor()->owned_by_self(), "don't own the lock");
   assert(manager->is_blocked(), "manager isn't blocked");
   while (manager->busy_workers() > 1) {
     if (TraceGCTaskManager) {
-      tty->print_cr("BarrierGCTask::do_it(%u) waiting on %u workers",
+      tty->print_cr("WaitForBarrierGCTask::do_it(%u) waiting on %u workers",
                     which, manager->busy_workers());
     }
     manager->monitor()->wait(Mutex::_no_safepoint_check_flag, 0);
   }
 }
 
-void BarrierGCTask::destruct() {
-  this->GCTask::destruct();
-  // Nothing else to do.
-}
-
-//
-// ReleasingBarrierGCTask
-//
-
-void ReleasingBarrierGCTask::do_it(GCTaskManager* manager, uint which) {
-  MutexLockerEx ml(manager->lock(), Mutex::_no_safepoint_check_flag);
-  do_it_internal(manager, which);
-  manager->release_all_resources();
-  // Release manager->lock().
-}
-
-void ReleasingBarrierGCTask::destruct() {
-  this->BarrierGCTask::destruct();
-  // Nothing else to do.
-}
-
-//
-// NotifyingBarrierGCTask
-//
-
-void NotifyingBarrierGCTask::do_it(GCTaskManager* manager, uint which) {
-  MutexLockerEx ml(manager->lock(), Mutex::_no_safepoint_check_flag);
-  do_it_internal(manager, which);
-  NotifyDoneClosure* ndc = notify_done_closure();
-  if (ndc != NULL) {
-    ndc->notify(manager);
-  }
-  // Release manager->lock().
-}
-
-void NotifyingBarrierGCTask::destruct() {
-  this->BarrierGCTask::destruct();
-  // Nothing else to do.
-}
-
-//
-// WaitForBarrierGCTask
-//
-WaitForBarrierGCTask* WaitForBarrierGCTask::create() {
-  WaitForBarrierGCTask* result = new WaitForBarrierGCTask(false);
-  return result;
-}
-
-WaitForBarrierGCTask* WaitForBarrierGCTask::create_on_c_heap() {
-  WaitForBarrierGCTask* result =
-    new (ResourceObj::C_HEAP, mtGC) WaitForBarrierGCTask(true);
-  return result;
-}
-
-WaitForBarrierGCTask::WaitForBarrierGCTask(bool on_c_heap) :
-  _is_c_heap_obj(on_c_heap) {
-  _monitor = MonitorSupply::reserve();
-  set_should_wait(true);
-  if (TraceGCTaskManager) {
-    tty->print_cr("[" INTPTR_FORMAT "]"
-                  " WaitForBarrierGCTask::WaitForBarrierGCTask()"
-                  "  monitor: " INTPTR_FORMAT,
-                  p2i(this), p2i(monitor()));
-  }
-}
-
-void WaitForBarrierGCTask::destroy(WaitForBarrierGCTask* that) {
-  if (that != NULL) {
-    if (TraceGCTaskManager) {
-      tty->print_cr("[" INTPTR_FORMAT "]"
-                    " WaitForBarrierGCTask::destroy()"
-                    "  is_c_heap_obj: %s"
-                    "  monitor: " INTPTR_FORMAT,
-                    p2i(that),
-                    that->is_c_heap_obj() ? "true" : "false",
-                    p2i(that->monitor()));
-    }
-    that->destruct();
-    if (that->is_c_heap_obj()) {
-      FreeHeap(that);
-    }
-  }
-}
-
-void WaitForBarrierGCTask::destruct() {
-  assert(monitor() != NULL, "monitor should not be NULL");
-  if (TraceGCTaskManager) {
-    tty->print_cr("[" INTPTR_FORMAT "]"
-                  " WaitForBarrierGCTask::destruct()"
-                  "  monitor: " INTPTR_FORMAT,
-                  p2i(this), p2i(monitor()));
-  }
-  this->BarrierGCTask::destruct();
-  // Clean up that should be in the destructor,
-  // except that ResourceMarks don't call destructors.
-   if (monitor() != NULL) {
-     MonitorSupply::release(monitor());
-  }
-  _monitor = (Monitor*) 0xDEAD000F;
-}
-
 void WaitForBarrierGCTask::do_it(GCTaskManager* manager, uint which) {
   if (TraceGCTaskManager) {
     tty->print_cr("[" INTPTR_FORMAT "]"
-                  " WaitForBarrierGCTask::do_it() waiting for idle"
-                  "  monitor: " INTPTR_FORMAT,
-                  p2i(this), p2i(monitor()));
+                  " WaitForBarrierGCTask::do_it() waiting for idle",
+                  p2i(this));
   }
   {
     // First, wait for the barrier to arrive.
@@ -1050,24 +932,30 @@
     do_it_internal(manager, which);
     // Release manager->lock().
   }
-  {
-    // Then notify the waiter.
-    MutexLockerEx ml(monitor(), Mutex::_no_safepoint_check_flag);
-    set_should_wait(false);
-    // Waiter doesn't miss the notify in the wait_for method
-    // since it checks the flag after grabbing the monitor.
-    if (TraceGCTaskManager) {
-      tty->print_cr("[" INTPTR_FORMAT "]"
-                    " WaitForBarrierGCTask::do_it()"
-                    "  [" INTPTR_FORMAT "] (%s)->notify_all()",
-                    p2i(this), p2i(monitor()), monitor()->name());
-    }
-    monitor()->notify_all();
-    // Release monitor().
+  // Then notify the waiter.
+  _wait_helper.notify();
+}
+
+WaitHelper::WaitHelper() : _should_wait(true), _monitor(MonitorSupply::reserve()) {
+  if (TraceGCTaskManager) {
+    tty->print_cr("[" INTPTR_FORMAT "]"
+                  " WaitHelper::WaitHelper()"
+                  "  monitor: " INTPTR_FORMAT,
+                  p2i(this), p2i(monitor()));
   }
 }
 
-void WaitForBarrierGCTask::wait_for(bool reset) {
+void WaitHelper::release_monitor() {
+  assert(_monitor != NULL, "");
+  MonitorSupply::release(_monitor);
+  _monitor = NULL;
+}
+
+WaitHelper::~WaitHelper() {
+  release_monitor();
+}
+
+void WaitHelper::wait_for(bool reset) {
   if (TraceGCTaskManager) {
     tty->print_cr("[" INTPTR_FORMAT "]"
                   " WaitForBarrierGCTask::wait_for()"
@@ -1100,6 +988,20 @@
   }
 }
 
+void WaitHelper::notify() {
+  MutexLockerEx ml(monitor(), Mutex::_no_safepoint_check_flag);
+  set_should_wait(false);
+  // Waiter doesn't miss the notify in the wait_for method
+  // since it checks the flag after grabbing the monitor.
+  if (TraceGCTaskManager) {
+    tty->print_cr("[" INTPTR_FORMAT "]"
+                  " WaitForBarrierGCTask::do_it()"
+                  "  [" INTPTR_FORMAT "] (%s)->notify_all()",
+                  p2i(this), p2i(monitor()), monitor()->name());
+  }
+  monitor()->notify_all();
+}
+
 Mutex*                   MonitorSupply::_lock     = NULL;
 GrowableArray<Monitor*>* MonitorSupply::_freelist = NULL;
 
--- a/src/share/vm/gc/parallel/gcTaskManager.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/gcTaskManager.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -38,12 +38,8 @@
 class GCTaskQueue;
 class SynchronizedGCTaskQueue;
 class GCTaskManager;
-class NotifyDoneClosure;
 // Some useful subclasses of GCTask.  You can also make up your own.
 class NoopGCTask;
-class BarrierGCTask;
-class ReleasingBarrierGCTask;
-class NotifyingBarrierGCTask;
 class WaitForBarrierGCTask;
 class IdleGCTask;
 // A free list of Monitor*'s.
@@ -64,7 +60,7 @@
     enum kind {
       unknown_task,
       ordinary_task,
-      barrier_task,
+      wait_for_barrier_task,
       noop_task,
       idle_task
     };
@@ -72,13 +68,16 @@
   };
 private:
   // Instance state.
-  const Kind::kind _kind;               // For runtime type checking.
-  const uint       _affinity;           // Which worker should run task.
+  Kind::kind       _kind;               // For runtime type checking.
+  uint             _affinity;           // Which worker should run task.
   GCTask*          _newer;              // Tasks are on doubly-linked ...
   GCTask*          _older;              // ... lists.
+  uint             _gc_id;              // GC Id to use for the thread that executes this task
 public:
   virtual char* name() { return (char *)"task"; }
 
+  uint gc_id() { return _gc_id; }
+
   // Abstract do_it method
   virtual void do_it(GCTaskManager* manager, uint which) = 0;
   // Accessors
@@ -105,7 +104,7 @@
     return kind()==Kind::ordinary_task;
   }
   bool is_barrier_task() const {
-    return kind()==Kind::barrier_task;
+    return kind()==Kind::wait_for_barrier_task;
   }
   bool is_noop_task() const {
     return kind()==Kind::noop_task;
@@ -120,17 +119,14 @@
   GCTask();
   //     A GCTask of a particular kind, usually barrier or noop.
   GCTask(Kind::kind kind);
-  //     An ordinary GCTask with an affinity.
-  GCTask(uint affinity);
-  //     A GCTask of a particular kind, with and affinity.
-  GCTask(Kind::kind kind, uint affinity);
+  GCTask(Kind::kind kind, uint gc_id);
   // We want a virtual destructor because virtual methods,
   // but since ResourceObj's don't have their destructors
   // called, we don't have one at all.  Instead we have
   // this method, which gets called by subclasses to clean up.
   virtual void destruct();
   // Methods.
-  void initialize();
+  void initialize(Kind::kind kind, uint gc_id);
 };
 
 // A doubly-linked list of GCTasks.
@@ -276,21 +272,26 @@
   ~SynchronizedGCTaskQueue();
 };
 
-// This is an abstract base class for getting notifications
-// when a GCTaskManager is done.
-class NotifyDoneClosure : public CHeapObj<mtGC> {
-public:
-  // The notification callback method.
-  virtual void notify(GCTaskManager* manager) = 0;
-protected:
-  // Constructor.
-  NotifyDoneClosure() {
-    // Nothing to do.
+class WaitHelper VALUE_OBJ_CLASS_SPEC {
+ private:
+  Monitor*      _monitor;
+  volatile bool _should_wait;
+ public:
+  WaitHelper();
+  ~WaitHelper();
+  void wait_for(bool reset);
+  void notify();
+  void set_should_wait(bool value) {
+    _should_wait = value;
   }
-  // Virtual destructor because virtual methods.
-  virtual ~NotifyDoneClosure() {
-    // Nothing to do.
+
+  Monitor* monitor() const {
+    return _monitor;
   }
+  bool should_wait() const {
+    return _should_wait;
+  }
+  void release_monitor();
 };
 
 // Dynamic number of GC threads
@@ -365,7 +366,6 @@
  friend class IdleGCTask;
 private:
   // Instance state.
-  NotifyDoneClosure*        _ndc;               // Notify on completion.
   const uint                _workers;           // Number of workers.
   Monitor*                  _monitor;           // Notification of changes.
   SynchronizedGCTaskQueue*  _queue;             // Queue of tasks.
@@ -379,17 +379,13 @@
   uint                      _barriers;          // Count of barrier tasks.
   uint                      _emptied_queue;     // Times we emptied the queue.
   NoopGCTask*               _noop_task;         // The NoopGCTask instance.
-  uint                      _noop_tasks;        // Count of noop tasks.
-  WaitForBarrierGCTask*     _idle_inactive_task;// Task for inactive workers
+  WaitHelper                _wait_helper;       // Used by inactive worker
   volatile uint             _idle_workers;      // Number of idled workers
 public:
   // Factory create and destroy methods.
   static GCTaskManager* create(uint workers) {
     return new GCTaskManager(workers);
   }
-  static GCTaskManager* create(uint workers, NotifyDoneClosure* ndc) {
-    return new GCTaskManager(workers, ndc);
-  }
   static void destroy(GCTaskManager* that) {
     if (that != NULL) {
       delete that;
@@ -409,8 +405,8 @@
   Monitor * lock() const {
     return _monitor;
   }
-  WaitForBarrierGCTask* idle_inactive_task() {
-    return _idle_inactive_task;
+  WaitHelper* wait_helper() {
+    return &_wait_helper;
   }
   // Methods.
   //     Add the argument task to be run.
@@ -452,8 +448,6 @@
   // Constructors.  Clients use factory, but there might be subclasses.
   //     Create a GCTaskManager with the appropriate number of workers.
   GCTaskManager(uint workers);
-  //     Create a GCTaskManager that calls back when there's no more work.
-  GCTaskManager(uint workers, NotifyDoneClosure* ndc);
   //     Make virtual if necessary.
   ~GCTaskManager();
   // Accessors.
@@ -469,9 +463,6 @@
   // Sets the number of threads that will be used in a collection
   void set_active_gang();
 
-  NotifyDoneClosure* notify_done_closure() const {
-    return _ndc;
-  }
   SynchronizedGCTaskQueue* queue() const {
     return _queue;
   }
@@ -540,17 +531,6 @@
   void reset_emptied_queue() {
     _emptied_queue = 0;
   }
-  //     Count of the number of noop tasks we've handed out,
-  //     e.g., to handle resource release requests.
-  uint noop_tasks() const {
-    return _noop_tasks;
-  }
-  void increment_noop_tasks() {
-    _noop_tasks += 1;
-  }
-  void reset_noop_tasks() {
-    _noop_tasks = 0;
-  }
   void increment_idle_workers() {
     _idle_workers++;
   }
@@ -575,11 +555,8 @@
 // A noop task that does nothing,
 // except take us around the GCTaskThread loop.
 class NoopGCTask : public GCTask {
-private:
-  const bool _is_c_heap_obj;            // Is this a CHeapObj?
 public:
   // Factory create and destroy methods.
-  static NoopGCTask* create();
   static NoopGCTask* create_on_c_heap();
   static void destroy(NoopGCTask* that);
 
@@ -590,147 +567,39 @@
   }
 protected:
   // Constructor.
-  NoopGCTask(bool on_c_heap) :
-    GCTask(GCTask::Kind::noop_task),
-    _is_c_heap_obj(on_c_heap) {
-    // Nothing to do.
-  }
-  // Destructor-like method.
-  void destruct();
-  // Accessors.
-  bool is_c_heap_obj() const {
-    return _is_c_heap_obj;
-  }
-};
-
-// A BarrierGCTask blocks other tasks from starting,
-// and waits until it is the only task running.
-class BarrierGCTask : public GCTask {
-public:
-  // Factory create and destroy methods.
-  static BarrierGCTask* create() {
-    return new BarrierGCTask();
-  }
-  static void destroy(BarrierGCTask* that) {
-    if (that != NULL) {
-      that->destruct();
-      delete that;
-    }
-  }
-  // Methods from GCTask.
-  void do_it(GCTaskManager* manager, uint which);
-protected:
-  // Constructor.  Clients use factory, but there might be subclasses.
-  BarrierGCTask() :
-    GCTask(GCTask::Kind::barrier_task) {
-    // Nothing to do.
-  }
-  // Destructor-like method.
-  void destruct();
-
-  virtual char* name() { return (char *)"barrier task"; }
-  // Methods.
-  //     Wait for this to be the only task running.
-  void do_it_internal(GCTaskManager* manager, uint which);
-};
-
-// A ReleasingBarrierGCTask is a BarrierGCTask
-// that tells all the tasks to release their resource areas.
-class ReleasingBarrierGCTask : public BarrierGCTask {
-public:
-  // Factory create and destroy methods.
-  static ReleasingBarrierGCTask* create() {
-    return new ReleasingBarrierGCTask();
-  }
-  static void destroy(ReleasingBarrierGCTask* that) {
-    if (that != NULL) {
-      that->destruct();
-      delete that;
-    }
-  }
-  // Methods from GCTask.
-  void do_it(GCTaskManager* manager, uint which);
-protected:
-  // Constructor.  Clients use factory, but there might be subclasses.
-  ReleasingBarrierGCTask() :
-    BarrierGCTask() {
-    // Nothing to do.
-  }
+  NoopGCTask();
   // Destructor-like method.
   void destruct();
 };
 
-// A NotifyingBarrierGCTask is a BarrierGCTask
-// that calls a notification method when it is the only task running.
-class NotifyingBarrierGCTask : public BarrierGCTask {
-private:
-  // Instance state.
-  NotifyDoneClosure* _ndc;              // The callback object.
-public:
-  // Factory create and destroy methods.
-  static NotifyingBarrierGCTask* create(NotifyDoneClosure* ndc) {
-    return new NotifyingBarrierGCTask(ndc);
-  }
-  static void destroy(NotifyingBarrierGCTask* that) {
-    if (that != NULL) {
-      that->destruct();
-      delete that;
-    }
-  }
-  // Methods from GCTask.
-  void do_it(GCTaskManager* manager, uint which);
-protected:
-  // Constructor.  Clients use factory, but there might be subclasses.
-  NotifyingBarrierGCTask(NotifyDoneClosure* ndc) :
-    BarrierGCTask(),
-    _ndc(ndc) {
-    assert(notify_done_closure() != NULL, "can't notify on NULL");
-  }
-  // Destructor-like method.
-  void destruct();
-  // Accessor.
-  NotifyDoneClosure* notify_done_closure() const { return _ndc; }
-};
-
-// A WaitForBarrierGCTask is a BarrierGCTask
+// A WaitForBarrierGCTask is a GCTask
 // with a method you can call to wait until
 // the BarrierGCTask is done.
-// This may cover many of the uses of NotifyingBarrierGCTasks.
-class WaitForBarrierGCTask : public BarrierGCTask {
+class WaitForBarrierGCTask : public GCTask {
   friend class GCTaskManager;
   friend class IdleGCTask;
 private:
   // Instance state.
-  Monitor*      _monitor;                  // Guard and notify changes.
-  volatile bool _should_wait;              // true=>wait, false=>proceed.
-  const bool    _is_c_heap_obj;            // Was allocated on the heap.
+  WaitHelper    _wait_helper;
+  WaitForBarrierGCTask();
 public:
   virtual char* name() { return (char *) "waitfor-barrier-task"; }
 
   // Factory create and destroy methods.
   static WaitForBarrierGCTask* create();
-  static WaitForBarrierGCTask* create_on_c_heap();
   static void destroy(WaitForBarrierGCTask* that);
   // Methods.
   void     do_it(GCTaskManager* manager, uint which);
-  void     wait_for(bool reset);
-  void set_should_wait(bool value) {
-    _should_wait = value;
-  }
 protected:
-  // Constructor.  Clients use factory, but there might be subclasses.
-  WaitForBarrierGCTask(bool on_c_heap);
   // Destructor-like method.
   void destruct();
-  // Accessors.
-  Monitor* monitor() const {
-    return _monitor;
-  }
-  bool should_wait() const {
-    return _should_wait;
-  }
-  bool is_c_heap_obj() {
-    return _is_c_heap_obj;
+
+  // Methods.
+  //     Wait for this to be the only task running.
+  void do_it_internal(GCTaskManager* manager, uint which);
+
+  void wait_for(bool reset) {
+    _wait_helper.wait_for(reset);
   }
 };
 
--- a/src/share/vm/gc/parallel/gcTaskThread.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/gcTaskThread.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -26,6 +26,7 @@
 #include "precompiled.hpp"
 #include "gc/parallel/gcTaskManager.hpp"
 #include "gc/parallel/gcTaskThread.hpp"
+#include "gc/shared/gcId.hpp"
 #include "memory/allocation.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
@@ -124,6 +125,7 @@
     for (; /* break */; ) {
       // This will block until there is a task to be gotten.
       GCTask* task = manager()->get_task(which());
+      GCIdMark gc_id_mark(task->gc_id());
       // Record if this is an idle task for later use.
       bool is_idle_task = task->is_idle_task();
       // In case the update is costly
--- a/src/share/vm/gc/parallel/mutableNUMASpace.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/mutableNUMASpace.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -85,8 +85,8 @@
         while (words_left_to_fill > 0) {
           size_t words_to_fill = MIN2(words_left_to_fill, CollectedHeap::filler_array_max_size());
           assert(words_to_fill >= CollectedHeap::min_fill_size(),
-            err_msg("Remaining size (" SIZE_FORMAT ") is too small to fill (based on " SIZE_FORMAT " and " SIZE_FORMAT ")",
-            words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size()));
+                 "Remaining size (" SIZE_FORMAT ") is too small to fill (based on " SIZE_FORMAT " and " SIZE_FORMAT ")",
+                 words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size());
           CollectedHeap::fill_with_object((HeapWord*)cur_top, words_to_fill);
           if (!os::numa_has_static_binding()) {
             size_t touched_words = words_to_fill;
@@ -971,7 +971,7 @@
       break;
     }
     if (e != scan_end) {
-      assert(e < scan_end, err_msg("e: " PTR_FORMAT " scan_end: " PTR_FORMAT, p2i(e), p2i(scan_end)));
+      assert(e < scan_end, "e: " PTR_FORMAT " scan_end: " PTR_FORMAT, p2i(e), p2i(scan_end));
 
       if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id())
           && page_expected.size != 0) {
--- a/src/share/vm/gc/parallel/objectStartArray.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/objectStartArray.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -127,8 +127,8 @@
 bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
                                               HeapWord* end_addr) const {
   assert(start_addr <= end_addr,
-         err_msg("Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
-                 p2i(start_addr), p2i(end_addr)));
+         "Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
+         p2i(start_addr), p2i(end_addr));
   if (start_addr > end_addr) {
     return false;
   }
--- a/src/share/vm/gc/parallel/objectStartArray.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/objectStartArray.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -121,8 +121,8 @@
 
 #define assert_covered_region_contains(addr)                                                                 \
         assert(_covered_region.contains(addr),                                                               \
-               err_msg(#addr " (" PTR_FORMAT ") is not in covered region [" PTR_FORMAT ", " PTR_FORMAT "]",  \
-                       p2i(addr), p2i(_covered_region.start()), p2i(_covered_region.end())))
+               #addr " (" PTR_FORMAT ") is not in covered region [" PTR_FORMAT ", " PTR_FORMAT "]",          \
+               p2i(addr), p2i(_covered_region.start()), p2i(_covered_region.end()))
 
   void allocate_block(HeapWord* p) {
     assert_covered_region_contains(p);
--- a/src/share/vm/gc/parallel/parMarkBitMap.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/parMarkBitMap.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -390,9 +390,9 @@
 inline void ParMarkBitMap::verify_addr(HeapWord* addr) const {
   // Allow one past the last valid address; useful for loop bounds.
   assert(addr >= region_start(),
-      err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, p2i(addr), p2i(region_start())));
+         "addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, p2i(addr), p2i(region_start()));
   assert(addr <= region_end(),
-      err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, p2i(addr), p2i(region_end())));
+         "addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, p2i(addr), p2i(region_end()));
 }
 #endif  // #ifdef ASSERT
 
--- a/src/share/vm/gc/parallel/parallelScavengeHeap.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/parallelScavengeHeap.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -48,7 +48,7 @@
   // Assumes the the old gen address range is lower than that of the young gen.
   bool result = ((HeapWord*)p) >= young_gen()->reserved().start();
   assert(result == young_gen()->is_in_reserved(p),
-        err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p)));
+         "incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p));
   return result;
 }
 #endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_INLINE_HPP
--- a/src/share/vm/gc/parallel/pcTasks.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/pcTasks.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -53,7 +53,7 @@
   ResourceMark rm;
 
   NOT_PRODUCT(GCTraceTime tm("ThreadRootsMarkingTask",
-    PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
+    PrintGCDetails && TraceParallelOldGCTasks, true, NULL));
   ParCompactionManager* cm =
     ParCompactionManager::gc_thread_compaction_manager(which);
 
@@ -82,7 +82,7 @@
   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 
   NOT_PRODUCT(GCTraceTime tm("MarkFromRootsTask",
-    PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
+    PrintGCDetails && TraceParallelOldGCTasks, true, NULL));
   ParCompactionManager* cm =
     ParCompactionManager::gc_thread_compaction_manager(which);
   ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
@@ -153,7 +153,7 @@
   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 
   NOT_PRODUCT(GCTraceTime tm("RefProcTask",
-    PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
+    PrintGCDetails && TraceParallelOldGCTasks, true, NULL));
   ParCompactionManager* cm =
     ParCompactionManager::gc_thread_compaction_manager(which);
   ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
@@ -209,7 +209,7 @@
   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 
   NOT_PRODUCT(GCTraceTime tm("StealMarkingTask",
-    PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
+    PrintGCDetails && TraceParallelOldGCTasks, true, NULL));
 
   ParCompactionManager* cm =
     ParCompactionManager::gc_thread_compaction_manager(which);
@@ -241,7 +241,7 @@
   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 
   NOT_PRODUCT(GCTraceTime tm("StealRegionCompactionTask",
-    PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
+    PrintGCDetails && TraceParallelOldGCTasks, true, NULL));
 
   ParCompactionManager* cm =
     ParCompactionManager::gc_thread_compaction_manager(which);
@@ -254,9 +254,9 @@
   if (use_all_workers) {
     which_stack_index = which;
     assert(manager->active_workers() == ParallelGCThreads,
-           err_msg("all_workers_active has been incorrectly set: "
-                   " active %d  ParallelGCThreads %u", manager->active_workers(),
-                   ParallelGCThreads));
+           "all_workers_active has been incorrectly set: "
+           " active %d  ParallelGCThreads %u", manager->active_workers(),
+           ParallelGCThreads);
   } else {
     which_stack_index = ParCompactionManager::pop_recycled_stack_index();
   }
@@ -308,7 +308,7 @@
 void UpdateDensePrefixTask::do_it(GCTaskManager* manager, uint which) {
 
   NOT_PRODUCT(GCTraceTime tm("UpdateDensePrefixTask",
-    PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
+    PrintGCDetails && TraceParallelOldGCTasks, true, NULL));
 
   ParCompactionManager* cm =
     ParCompactionManager::gc_thread_compaction_manager(which);
@@ -323,7 +323,7 @@
   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 
   NOT_PRODUCT(GCTraceTime tm("DrainStacksCompactionTask",
-    PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
+    PrintGCDetails && TraceParallelOldGCTasks, true, NULL));
 
   ParCompactionManager* cm =
     ParCompactionManager::gc_thread_compaction_manager(which);
@@ -333,9 +333,9 @@
   if (use_all_workers) {
     which_stack_index = which;
     assert(manager->active_workers() == ParallelGCThreads,
-           err_msg("all_workers_active has been incorrectly set: "
-                   " active %d  ParallelGCThreads %u", manager->active_workers(),
-                   ParallelGCThreads));
+           "all_workers_active has been incorrectly set: "
+           " active %d  ParallelGCThreads %u", manager->active_workers(),
+           ParallelGCThreads);
   } else {
     which_stack_index = stack_index();
   }
--- a/src/share/vm/gc/parallel/psMarkSweep.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/psMarkSweep.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -36,6 +36,7 @@
 #include "gc/serial/markSweep.hpp"
 #include "gc/shared/gcCause.hpp"
 #include "gc/shared/gcHeapSummary.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.inline.hpp"
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/gcTrace.hpp"
@@ -113,6 +114,7 @@
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
   GCCause::Cause gc_cause = heap->gc_cause();
 
+  GCIdMark gc_id_mark;
   _gc_timer->register_gc_start();
   _gc_tracer->report_gc_start(gc_cause, _gc_timer->gc_start());
 
@@ -165,7 +167,7 @@
     HandleMark hm;
 
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer->gc_id());
+    GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL);
     TraceCollectorStats tcs(counters());
     TraceMemoryManagerStats tms(true /* Full GC */,gc_cause);
 
@@ -508,7 +510,7 @@
 
 void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
   // Recursively traverse all live objects and mark them
-  GCTraceTime tm("phase 1", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 1", PrintGCDetails && Verbose, true, _gc_timer);
 
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 
@@ -541,7 +543,7 @@
     ref_processor()->setup_policy(clear_all_softrefs);
     const ReferenceProcessorStats& stats =
       ref_processor()->process_discovered_references(
-        is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL, _gc_timer, _gc_tracer->gc_id());
+        is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL, _gc_timer);
     gc_tracer()->report_gc_reference_stats(stats);
   }
 
@@ -567,7 +569,7 @@
 
 
 void PSMarkSweep::mark_sweep_phase2() {
-  GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer);
 
   // Now all live objects are marked, compute the new object addresses.
 
@@ -594,7 +596,7 @@
 
 void PSMarkSweep::mark_sweep_phase3() {
   // Adjust the pointers to reflect the new locations
-  GCTraceTime tm("phase 3", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 3", PrintGCDetails && Verbose, true, _gc_timer);
 
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
   PSYoungGen* young_gen = heap->young_gen();
@@ -634,7 +636,7 @@
 
 void PSMarkSweep::mark_sweep_phase4() {
   EventMark m("4 compact heap");
-  GCTraceTime tm("phase 4", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 4", PrintGCDetails && Verbose, true, _gc_timer);
 
   // All pointers are now adjusted, move objects accordingly
 
--- a/src/share/vm/gc/parallel/psOldGen.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/psOldGen.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -65,15 +65,15 @@
     // Explictly capture current covered_region in a local
     MemRegion covered_region = this->start_array()->covered_region();
     assert(covered_region.contains(new_memregion),
-           err_msg("new region is not in covered_region [ " PTR_FORMAT ", " PTR_FORMAT " ], "
-                   "new region [ " PTR_FORMAT ", " PTR_FORMAT " ], "
-                   "object space [ " PTR_FORMAT ", " PTR_FORMAT " ]",
-                   p2i(covered_region.start()),
-                   p2i(covered_region.end()),
-                   p2i(new_memregion.start()),
-                   p2i(new_memregion.end()),
-                   p2i(this->object_space()->used_region().start()),
-                   p2i(this->object_space()->used_region().end())));
+           "new region is not in covered_region [ " PTR_FORMAT ", " PTR_FORMAT " ], "
+           "new region [ " PTR_FORMAT ", " PTR_FORMAT " ], "
+           "object space [ " PTR_FORMAT ", " PTR_FORMAT " ]",
+           p2i(covered_region.start()),
+           p2i(covered_region.end()),
+           p2i(new_memregion.start()),
+           p2i(new_memregion.end()),
+           p2i(this->object_space()->used_region().start()),
+           p2i(this->object_space()->used_region().end()));
   }
 #endif
 
--- a/src/share/vm/gc/parallel/psParallelCompact.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/psParallelCompact.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -40,6 +40,7 @@
 #include "gc/parallel/psYoungGen.hpp"
 #include "gc/shared/gcCause.hpp"
 #include "gc/shared/gcHeapSummary.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.inline.hpp"
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/gcTrace.hpp"
@@ -960,7 +961,7 @@
   // at each young gen gc.  Do the update unconditionally (even though a
   // promotion failure does not swap spaces) because an unknown number of young
   // collections will have swapped the spaces an unknown number of times.
-  GCTraceTime tm("pre compact", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("pre compact", print_phases(), true, &_gc_timer);
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
   _space_info[from_space_id].set_space(heap->young_gen()->from_space());
   _space_info[to_space_id].set_space(heap->young_gen()->to_space());
@@ -1003,7 +1004,7 @@
 
 void PSParallelCompact::post_compact()
 {
-  GCTraceTime tm("post compact", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("post compact", print_phases(), true, &_gc_timer);
 
   for (unsigned int id = old_space_id; id < last_space_id; ++id) {
     // Clear the marking bitmap, summary data and split info.
@@ -1824,7 +1825,7 @@
 void PSParallelCompact::summary_phase(ParCompactionManager* cm,
                                       bool maximum_compaction)
 {
-  GCTraceTime tm("summary phase", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("summary phase", print_phases(), true, &_gc_timer);
   // trace("2");
 
 #ifdef  ASSERT
@@ -1984,6 +1985,7 @@
 
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 
+  GCIdMark gc_id_mark;
   _gc_timer.register_gc_start();
   _gc_tracer.report_gc_start(heap->gc_cause(), _gc_timer.gc_start());
 
@@ -2031,7 +2033,7 @@
     gc_task_manager()->task_idle_workers();
 
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer.gc_id());
+    GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL);
     TraceCollectorStats tcs(counters());
     TraceMemoryManagerStats tms(true /* Full GC */,gc_cause);
 
@@ -2331,7 +2333,7 @@
                                       bool maximum_heap_compaction,
                                       ParallelOldTracer *gc_tracer) {
   // Recursively traverse all live objects and mark them
-  GCTraceTime tm("marking phase", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("marking phase", print_phases(), true, &_gc_timer);
 
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
   uint parallel_gc_threads = heap->gc_task_manager()->workers();
@@ -2346,7 +2348,7 @@
   ClassLoaderDataGraph::clear_claimed_marks();
 
   {
-    GCTraceTime tm_m("par mark", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+    GCTraceTime tm_m("par mark", print_phases(), true, &_gc_timer);
 
     ParallelScavengeHeap::ParStrongRootsScope psrs;
 
@@ -2375,24 +2377,24 @@
 
   // Process reference objects found during marking
   {
-    GCTraceTime tm_r("reference processing", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+    GCTraceTime tm_r("reference processing", print_phases(), true, &_gc_timer);
 
     ReferenceProcessorStats stats;
     if (ref_processor()->processing_is_mt()) {
       RefProcTaskExecutor task_executor;
       stats = ref_processor()->process_discovered_references(
         is_alive_closure(), &mark_and_push_closure, &follow_stack_closure,
-        &task_executor, &_gc_timer, _gc_tracer.gc_id());
+        &task_executor, &_gc_timer);
     } else {
       stats = ref_processor()->process_discovered_references(
         is_alive_closure(), &mark_and_push_closure, &follow_stack_closure, NULL,
-        &_gc_timer, _gc_tracer.gc_id());
+        &_gc_timer);
     }
 
     gc_tracer->report_gc_reference_stats(stats);
   }
 
-  GCTraceTime tm_c("class unloading", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm_c("class unloading", print_phases(), true, &_gc_timer);
 
   // This is the point where the entire marking should have completed.
   assert(cm->marking_stacks_empty(), "Marking should have completed");
@@ -2423,7 +2425,7 @@
 
 void PSParallelCompact::adjust_roots() {
   // Adjust the pointers to reflect the new locations
-  GCTraceTime tm("adjust roots", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("adjust roots", print_phases(), true, &_gc_timer);
 
   // Need new claim bits when tracing through and adjusting pointers.
   ClassLoaderDataGraph::clear_claimed_marks();
@@ -2459,7 +2461,7 @@
 void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q,
                                                       uint parallel_gc_threads)
 {
-  GCTraceTime tm("drain task setup", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("drain task setup", print_phases(), true, &_gc_timer);
 
   // Find the threads that are active
   unsigned int which = 0;
@@ -2533,7 +2535,7 @@
 
 void PSParallelCompact::enqueue_dense_prefix_tasks(GCTaskQueue* q,
                                                     uint parallel_gc_threads) {
-  GCTraceTime tm("dense prefix task setup", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("dense prefix task setup", print_phases(), true, &_gc_timer);
 
   ParallelCompactData& sd = PSParallelCompact::summary_data();
 
@@ -2615,7 +2617,7 @@
                                      GCTaskQueue* q,
                                      ParallelTaskTerminator* terminator_ptr,
                                      uint parallel_gc_threads) {
-  GCTraceTime tm("steal task setup", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("steal task setup", print_phases(), true, &_gc_timer);
 
   // Once a thread has drained it's stack, it should try to steal regions from
   // other threads.
@@ -2663,7 +2665,7 @@
 
 void PSParallelCompact::compact() {
   // trace("5");
-  GCTraceTime tm("compaction phase", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+  GCTraceTime tm("compaction phase", print_phases(), true, &_gc_timer);
 
   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
   PSOldGen* old_gen = heap->old_gen();
@@ -2679,7 +2681,7 @@
   enqueue_region_stealing_tasks(q, &terminator, active_gc_threads);
 
   {
-    GCTraceTime tm_pc("par compact", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+    GCTraceTime tm_pc("par compact", print_phases(), true, &_gc_timer);
 
     gc_task_manager()->execute_and_wait(q);
 
@@ -2693,7 +2695,7 @@
 
   {
     // Update the deferred objects, if any.  Any compaction manager can be used.
-    GCTraceTime tm_du("deferred updates", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
+    GCTraceTime tm_du("deferred updates", print_phases(), true, &_gc_timer);
     ParCompactionManager* cm = ParCompactionManager::manager_array(0);
     for (unsigned int id = old_space_id; id < last_space_id; ++id) {
       update_deferred_objects(cm, SpaceId(id));
@@ -2851,7 +2853,7 @@
         start_array->allocate_block(addr);
       }
       cm->update_contents(oop(addr));
-      assert(oop(addr)->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(oop(addr))));
+      assert(oop(addr)->is_oop_or_null(), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(addr)));
     }
   }
 }
@@ -3400,7 +3402,7 @@
 
   oop moved_oop = (oop) destination();
   compaction_manager()->update_contents(moved_oop);
-  assert(moved_oop->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(moved_oop)));
+  assert(moved_oop->is_oop_or_null(), "Expected an oop or NULL at " PTR_FORMAT, p2i(moved_oop));
 
   update_state(words);
   assert(destination() == (HeapWord*)moved_oop + moved_oop->size(), "sanity");
--- a/src/share/vm/gc/parallel/psScavenge.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/parallel/psScavenge.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -36,6 +36,7 @@
 #include "gc/shared/collectorPolicy.hpp"
 #include "gc/shared/gcCause.hpp"
 #include "gc/shared/gcHeapSummary.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.inline.hpp"
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/gcTrace.hpp"
@@ -278,6 +279,7 @@
     return false;
   }
 
+  GCIdMark gc_id_mark;
   _gc_tracer.report_gc_start(heap->gc_cause(), _gc_timer.gc_start());
 
   bool promotion_failure_occurred = false;
@@ -322,7 +324,7 @@
     HandleMark hm;
 
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    GCTraceTime t1(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer.gc_id());
+    GCTraceTime t1(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL);
     TraceCollectorStats tcs(counters());
     TraceMemoryManagerStats tms(false /* not full GC */,gc_cause);
 
@@ -387,7 +389,7 @@
     // We'll use the promotion manager again later.
     PSPromotionManager* promotion_manager = PSPromotionManager::vm_thread_promotion_manager();
     {
-      GCTraceTime tm("Scavenge", false, false, &_gc_timer, _gc_tracer.gc_id());
+      GCTraceTime tm("Scavenge", false, false, &_gc_timer);
       ParallelScavengeHeap::ParStrongRootsScope psrs;
 
       GCTaskQueue* q = GCTaskQueue::create();
@@ -429,7 +431,7 @@
 
     // Process reference objects discovered during scavenge
     {
-      GCTraceTime tm("References", false, false, &_gc_timer, _gc_tracer.gc_id());
+      GCTraceTime tm("References", false, false, &_gc_timer);
 
       reference_processor()->setup_policy(false); // not always_clear
       reference_processor()->set_active_mt_degree(active_workers);
@@ -440,10 +442,10 @@
         PSRefProcTaskExecutor task_executor;
         stats = reference_processor()->process_discovered_references(
           &_is_alive_closure, &keep_alive, &evac_followers, &task_executor,
-          &_gc_timer, _gc_tracer.gc_id());
+          &_gc_timer);
       } else {
         stats = reference_processor()->process_discovered_references(
-          &_is_alive_closure, &keep_alive, &evac_followers, NULL, &_gc_timer, _gc_tracer.gc_id());
+          &_is_alive_closure, &keep_alive, &evac_followers, NULL, &_gc_timer);
       }
 
       _gc_tracer.report_gc_reference_stats(stats);
@@ -458,7 +460,7 @@
     }
 
     {
-      GCTraceTime tm("StringTable", false, false, &_gc_timer, _gc_tracer.gc_id());
+      GCTraceTime tm("StringTable", false, false, &_gc_timer);
       // Unlink any dead interned Strings and process the remaining live ones.
       PSScavengeRootsClosure root_closure(promotion_manager);
       StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
@@ -628,7 +630,7 @@
     NOT_PRODUCT(reference_processor()->verify_no_references_recorded());
 
     {
-      GCTraceTime tm("Prune Scavenge Root Methods", false, false, &_gc_timer, _gc_tracer.gc_id());
+      GCTraceTime tm("Prune Scavenge Root Methods", false, false, &_gc_timer);
 
       CodeCache::prune_scavenge_root_nmethods();
     }
@@ -819,7 +821,7 @@
 
   if (AlwaysTenure || NeverTenure) {
     assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1,
-        err_msg("MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is %d", (int) MaxTenuringThreshold));
+           "MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is %d", (int) MaxTenuringThreshold);
     _tenuring_threshold = MaxTenuringThreshold;
   } else {
     // We want to smooth out our startup times for the AdaptiveSizePolicy
--- a/src/share/vm/gc/serial/defNewGeneration.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/serial/defNewGeneration.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -583,7 +583,7 @@
 
   init_assuming_no_promotion_failure();
 
-  GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL, gc_tracer.gc_id());
+  GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL);
   // Capture heap used before collection (for printing).
   size_t gch_prev_used = gch->used();
 
@@ -646,7 +646,7 @@
   rp->setup_policy(clear_all_soft_refs);
   const ReferenceProcessorStats& stats =
   rp->process_discovered_references(&is_alive, &keep_alive, &evacuate_followers,
-                                    NULL, _gc_timer, gc_tracer.gc_id());
+                                    NULL, _gc_timer);
   gc_tracer.report_gc_reference_stats(stats);
 
   if (!_promotion_failed) {
--- a/src/share/vm/gc/serial/genMarkSweep.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/serial/genMarkSweep.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -70,7 +70,7 @@
   set_ref_processor(rp);
   rp->setup_policy(clear_all_softrefs);
 
-  GCTraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL, _gc_tracer->gc_id());
+  GCTraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL);
 
   gch->trace_heap_before_gc(_gc_tracer);
 
@@ -186,7 +186,7 @@
 
 void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
   // Recursively traverse all live objects and mark them
-  GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer);
 
   GenCollectedHeap* gch = GenCollectedHeap::heap();
 
@@ -217,7 +217,7 @@
     ref_processor()->setup_policy(clear_all_softrefs);
     const ReferenceProcessorStats& stats =
       ref_processor()->process_discovered_references(
-        &is_alive, &keep_alive, &follow_stack_closure, NULL, _gc_timer, _gc_tracer->gc_id());
+        &is_alive, &keep_alive, &follow_stack_closure, NULL, _gc_timer);
     gc_tracer()->report_gc_reference_stats(stats);
   }
 
@@ -259,7 +259,7 @@
 
   GenCollectedHeap* gch = GenCollectedHeap::heap();
 
-  GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer);
 
   gch->prepare_for_compaction();
 }
@@ -275,7 +275,7 @@
   GenCollectedHeap* gch = GenCollectedHeap::heap();
 
   // Adjust the pointers to reflect the new locations
-  GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer);
 
   // Need new claim bits for the pointer adjustment tracing.
   ClassLoaderDataGraph::clear_claimed_marks();
@@ -327,7 +327,7 @@
   // to use a higher index (saved from phase2) when verifying perm_gen.
   GenCollectedHeap* gch = GenCollectedHeap::heap();
 
-  GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
+  GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer);
 
   GenCompactClosure blk;
   gch->generation_iterate(&blk, true);
--- a/src/share/vm/gc/serial/tenuredGeneration.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/serial/tenuredGeneration.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -129,8 +129,8 @@
   CardGeneration::compute_new_size();
 
   assert(used() == used_after_gc && used_after_gc <= capacity(),
-         err_msg("used: " SIZE_FORMAT " used_after_gc: " SIZE_FORMAT
-         " capacity: " SIZE_FORMAT, used(), used_after_gc, capacity()));
+         "used: " SIZE_FORMAT " used_after_gc: " SIZE_FORMAT
+         " capacity: " SIZE_FORMAT, used(), used_after_gc, capacity());
 }
 
 void TenuredGeneration::update_gc_stats(Generation* current_generation,
--- a/src/share/vm/gc/shared/ageTable.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/ageTable.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -78,7 +78,7 @@
 
   if (AlwaysTenure || NeverTenure) {
     assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1,
-        err_msg("MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold));
+           "MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold);
     result = MaxTenuringThreshold;
   } else {
     size_t total = 0;
--- a/src/share/vm/gc/shared/blockOffsetTable.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/blockOffsetTable.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -543,11 +543,11 @@
     size_t n_cards_back = entry_to_cards_back(offset);
     q -= (N_words * n_cards_back);
     assert(q >= _sp->bottom(),
-           err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
-                   p2i(q), p2i(_sp->bottom())));
+           "q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
+           p2i(q), p2i(_sp->bottom()));
     assert(q < _sp->end(),
-           err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
-                   p2i(q), p2i(_sp->end())));
+           "q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
+           p2i(q), p2i(_sp->end()));
     index -= n_cards_back;
     offset = _array->offset_array(index);
   }
@@ -555,11 +555,11 @@
   index--;
   q -= offset;
   assert(q >= _sp->bottom(),
-         err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
-                 p2i(q), p2i(_sp->bottom())));
+         "q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
+         p2i(q), p2i(_sp->bottom()));
   assert(q < _sp->end(),
-         err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
-                 p2i(q), p2i(_sp->end())));
+         "q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
+         p2i(q), p2i(_sp->end()));
   HeapWord* n = q;
 
   while (n <= addr) {
@@ -567,17 +567,17 @@
     q = n;
     n += _sp->block_size(n);
     assert(n > q,
-           err_msg("Looping at n = " PTR_FORMAT " with last = " PTR_FORMAT ","
-                   " while querying blk_start(" PTR_FORMAT ")"
-                   " on _sp = [" PTR_FORMAT "," PTR_FORMAT ")",
-                   p2i(n), p2i(last), p2i(addr), p2i(_sp->bottom()), p2i(_sp->end())));
+           "Looping at n = " PTR_FORMAT " with last = " PTR_FORMAT ","
+           " while querying blk_start(" PTR_FORMAT ")"
+           " on _sp = [" PTR_FORMAT "," PTR_FORMAT ")",
+           p2i(n), p2i(last), p2i(addr), p2i(_sp->bottom()), p2i(_sp->end()));
   }
   assert(q <= addr,
-         err_msg("wrong order for current (" INTPTR_FORMAT ")" " <= arg (" INTPTR_FORMAT ")",
-                 p2i(q), p2i(addr)));
+         "wrong order for current (" INTPTR_FORMAT ")" " <= arg (" INTPTR_FORMAT ")",
+         p2i(q), p2i(addr));
   assert(addr <= n,
-         err_msg("wrong order for arg (" INTPTR_FORMAT ") <= next (" INTPTR_FORMAT ")",
-                 p2i(addr), p2i(n)));
+         "wrong order for arg (" INTPTR_FORMAT ") <= next (" INTPTR_FORMAT ")",
+         p2i(addr), p2i(n));
   return q;
 }
 
--- a/src/share/vm/gc/shared/cardTableModRefBS.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/cardTableModRefBS.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -126,9 +126,9 @@
   // Mapping from address to card marking array entry
   jbyte* byte_for(const void* p) const {
     assert(_whole_heap.contains(p),
-           err_msg("Attempt to access p = " PTR_FORMAT " out of bounds of "
-                   " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
-                   p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
+           "Attempt to access p = " PTR_FORMAT " out of bounds of "
+           " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
+           p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()));
     jbyte* result = &byte_map_base[uintptr_t(p) >> card_shift];
     assert(result >= _byte_map && result < _byte_map + _byte_map_size,
            "out of bounds accessor for card marking array");
@@ -294,18 +294,18 @@
     size_t delta = pointer_delta(p, byte_map_base, sizeof(jbyte));
     HeapWord* result = (HeapWord*) (delta << card_shift);
     assert(_whole_heap.contains(result),
-           err_msg("Returning result = " PTR_FORMAT " out of bounds of "
-                   " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
-                   p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
+           "Returning result = " PTR_FORMAT " out of bounds of "
+           " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
+           p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end()));
     return result;
   }
 
   // Mapping from address to card marking array index.
   size_t index_for(void* p) {
     assert(_whole_heap.contains(p),
-           err_msg("Attempt to access p = " PTR_FORMAT " out of bounds of "
-                   " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
-                   p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
+           "Attempt to access p = " PTR_FORMAT " out of bounds of "
+           " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
+           p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()));
     return byte_for(p) - _byte_map;
   }
 
--- a/src/share/vm/gc/shared/cardTableRS.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/cardTableRS.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -278,10 +278,10 @@
   // CMS+ParNew until related bug is fixed.
   MemRegion ur    = sp->used_region();
   assert(ur.contains(urasm) || (UseConcMarkSweepGC),
-         err_msg("Did you forget to call save_marks()? "
-                 "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
-                 "[" PTR_FORMAT ", " PTR_FORMAT ")",
-                 p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end())));
+         "Did you forget to call save_marks()? "
+         "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
+         "[" PTR_FORMAT ", " PTR_FORMAT ")",
+         p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()));
   // In the case of CMS+ParNew, issue a warning
   if (!ur.contains(urasm)) {
     assert(UseConcMarkSweepGC, "Tautology: see assert above");
@@ -342,25 +342,25 @@
   template <class T> void do_oop_work(T* p) {
     HeapWord* jp = (HeapWord*)p;
     assert(jp >= _begin && jp < _end,
-           err_msg("Error: jp " PTR_FORMAT " should be within "
-                   "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")",
-                   p2i(jp), p2i(_begin), p2i(_end)));
+           "Error: jp " PTR_FORMAT " should be within "
+           "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")",
+           p2i(jp), p2i(_begin), p2i(_end));
     oop obj = oopDesc::load_decode_heap_oop(p);
     guarantee(obj == NULL || (HeapWord*)obj >= _boundary,
-              err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on "
-                      "clean card crosses boundary" PTR_FORMAT,
-                      p2i((HeapWord*)obj), p2i(jp), p2i(_boundary)));
+              "pointer " PTR_FORMAT " at " PTR_FORMAT " on "
+              "clean card crosses boundary" PTR_FORMAT,
+              p2i((HeapWord*)obj), p2i(jp), p2i(_boundary));
   }
 
 public:
   VerifyCleanCardClosure(HeapWord* b, HeapWord* begin, HeapWord* end) :
     _boundary(b), _begin(begin), _end(end) {
     assert(b <= begin,
-           err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT,
-                   p2i(b), p2i(begin)));
+           "Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT,
+           p2i(b), p2i(begin));
     assert(begin <= end,
-           err_msg("Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT,
-                   p2i(begin), p2i(end)));
+           "Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT,
+           p2i(begin), p2i(end));
   }
 
   virtual void do_oop(oop* p)       { VerifyCleanCardClosure::do_oop_work(p); }
--- a/src/share/vm/gc/shared/collectedHeap.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/collectedHeap.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -459,7 +459,7 @@
 
   const size_t payload_size = words - filler_array_hdr_size();
   const size_t len = payload_size * HeapWordSize / sizeof(jint);
-  assert((int)len >= 0, err_msg("size too large " SIZE_FORMAT " becomes %d", words, (int)len));
+  assert((int)len >= 0, "size too large " SIZE_FORMAT " becomes %d", words, (int)len);
 
   // Set the length first for concurrent GC.
   ((arrayOop)start)->set_length((int)len);
@@ -573,13 +573,13 @@
 
 void CollectedHeap::pre_full_gc_dump(GCTimer* timer) {
   if (HeapDumpBeforeFullGC) {
-    GCTraceTime tt("Heap Dump (before full gc): ", PrintGCDetails, false, timer, GCId::create());
+    GCTraceTime tt("Heap Dump (before full gc): ", PrintGCDetails, false, timer);
     // We are doing a full collection and a heap dump before
     // full collection has been requested.
     HeapDumper::dump_heap();
   }
   if (PrintClassHistogramBeforeFullGC) {
-    GCTraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, timer, GCId::create());
+    GCTraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, timer);
     VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
     inspector.doit();
   }
@@ -587,11 +587,11 @@
 
 void CollectedHeap::post_full_gc_dump(GCTimer* timer) {
   if (HeapDumpAfterFullGC) {
-    GCTraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, timer, GCId::create());
+    GCTraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, timer);
     HeapDumper::dump_heap();
   }
   if (PrintClassHistogramAfterFullGC) {
-    GCTraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, timer, GCId::create());
+    GCTraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, timer);
     VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
     inspector.doit();
   }
@@ -622,12 +622,12 @@
   assert(heap_start >= ((uintptr_t)NULL + epsilon), "sanity");
   void* before_heap = (void*)(heap_start - epsilon);
   assert(!heap->is_in(before_heap),
-      err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap)));
+         "before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap));
 
   // Test that a pointer to after the heap end is reported as outside the heap.
   assert(heap_end <= ((uintptr_t)-1 - epsilon), "sanity");
   void* after_heap = (void*)(heap_end + epsilon);
   assert(!heap->is_in(after_heap),
-      err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap)));
+         "after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap));
 }
 #endif
--- a/src/share/vm/gc/shared/collectedHeap.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/collectedHeap.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -244,9 +244,9 @@
   }
 
   assert(is_ptr_aligned(addr, HeapWordSize),
-    err_msg("Address " PTR_FORMAT " is not properly aligned.", p2i(addr)));
+         "Address " PTR_FORMAT " is not properly aligned.", p2i(addr));
   assert(is_size_aligned(alignment_in_bytes, HeapWordSize),
-    err_msg("Alignment size %u is incorrect.", alignment_in_bytes));
+         "Alignment size %u is incorrect.", alignment_in_bytes);
 
   HeapWord* new_addr = (HeapWord*) align_pointer_up(addr, alignment_in_bytes);
   size_t padding = pointer_delta(new_addr, addr);
@@ -258,13 +258,13 @@
   if (padding < CollectedHeap::min_fill_size()) {
     padding += alignment_in_bytes / HeapWordSize;
     assert(padding >= CollectedHeap::min_fill_size(),
-      err_msg("alignment_in_bytes %u is expect to be larger "
-      "than the minimum object size", alignment_in_bytes));
+           "alignment_in_bytes %u is expect to be larger "
+           "than the minimum object size", alignment_in_bytes);
     new_addr = addr + padding;
   }
 
-  assert(new_addr > addr, err_msg("Unexpected arithmetic overflow "
-    PTR_FORMAT " not greater than " PTR_FORMAT, p2i(new_addr), p2i(addr)));
+  assert(new_addr > addr, "Unexpected arithmetic overflow "
+         PTR_FORMAT " not greater than " PTR_FORMAT, p2i(new_addr), p2i(addr));
   if(new_addr < end) {
     CollectedHeap::fill_with_object(addr, padding);
     return new_addr;
--- a/src/share/vm/gc/shared/collectorPolicy.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/collectorPolicy.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -78,11 +78,11 @@
   assert(_space_alignment != 0, "Space alignment not set up properly");
   assert(_heap_alignment != 0, "Heap alignment not set up properly");
   assert(_heap_alignment >= _space_alignment,
-         err_msg("heap_alignment: " SIZE_FORMAT " less than space_alignment: " SIZE_FORMAT,
-                 _heap_alignment, _space_alignment));
+         "heap_alignment: " SIZE_FORMAT " less than space_alignment: " SIZE_FORMAT,
+         _heap_alignment, _space_alignment);
   assert(_heap_alignment % _space_alignment == 0,
-         err_msg("heap_alignment: " SIZE_FORMAT " not aligned by space_alignment: " SIZE_FORMAT,
-                 _heap_alignment, _space_alignment));
+         "heap_alignment: " SIZE_FORMAT " not aligned by space_alignment: " SIZE_FORMAT,
+         _heap_alignment, _space_alignment);
 
   if (FLAG_IS_CMDLINE(MaxHeapSize)) {
     if (FLAG_IS_CMDLINE(InitialHeapSize) && InitialHeapSize > MaxHeapSize) {
@@ -275,14 +275,14 @@
 
   assert(_gen_alignment != 0, "Generation alignment not set up properly");
   assert(_heap_alignment >= _gen_alignment,
-         err_msg("heap_alignment: " SIZE_FORMAT " less than gen_alignment: " SIZE_FORMAT,
-                 _heap_alignment, _gen_alignment));
+         "heap_alignment: " SIZE_FORMAT " less than gen_alignment: " SIZE_FORMAT,
+         _heap_alignment, _gen_alignment);
   assert(_gen_alignment % _space_alignment == 0,
-         err_msg("gen_alignment: " SIZE_FORMAT " not aligned by space_alignment: " SIZE_FORMAT,
-                 _gen_alignment, _space_alignment));
+         "gen_alignment: " SIZE_FORMAT " not aligned by space_alignment: " SIZE_FORMAT,
+         _gen_alignment, _space_alignment);
   assert(_heap_alignment % _gen_alignment == 0,
-         err_msg("heap_alignment: " SIZE_FORMAT " not aligned by gen_alignment: " SIZE_FORMAT,
-                 _heap_alignment, _gen_alignment));
+         "heap_alignment: " SIZE_FORMAT " not aligned by gen_alignment: " SIZE_FORMAT,
+         _heap_alignment, _gen_alignment);
 
   // All generational heaps have a youngest gen; handle those flags here
 
@@ -1012,14 +1012,14 @@
     MarkSweepPolicy msp;
     msp.initialize_all();
 
-    assert(msp.min_young_size() <= expected, err_msg("%zu  > %zu", msp.min_young_size(), expected));
+    assert(msp.min_young_size() <= expected, "%zu  > %zu", msp.min_young_size(), expected);
   }
 
   static void verify_young_initial(size_t expected) {
     MarkSweepPolicy msp;
     msp.initialize_all();
 
-    assert(msp.initial_young_size() == expected, err_msg("%zu != %zu", msp.initial_young_size(), expected));
+    assert(msp.initial_young_size() == expected, "%zu != %zu", msp.initial_young_size(), expected);
   }
 
   static void verify_scaled_young_initial(size_t initial_heap_size) {
@@ -1033,23 +1033,23 @@
     }
 
     size_t expected = msp.scale_by_NewRatio_aligned(initial_heap_size);
-    assert(msp.initial_young_size() == expected, err_msg("%zu != %zu", msp.initial_young_size(), expected));
+    assert(msp.initial_young_size() == expected, "%zu != %zu", msp.initial_young_size(), expected);
     assert(FLAG_IS_ERGO(NewSize) && NewSize == expected,
-        err_msg("NewSize should have been set ergonomically to %zu, but was %zu", expected, NewSize));
+        "NewSize should have been set ergonomically to %zu, but was %zu", expected, NewSize);
   }
 
   static void verify_old_min(size_t expected) {
     MarkSweepPolicy msp;
     msp.initialize_all();
 
-    assert(msp.min_old_size() <= expected, err_msg("%zu  > %zu", msp.min_old_size(), expected));
+    assert(msp.min_old_size() <= expected, "%zu  > %zu", msp.min_old_size(), expected);
   }
 
   static void verify_old_initial(size_t expected) {
     MarkSweepPolicy msp;
     msp.initialize_all();
 
-    assert(msp.initial_old_size() == expected, err_msg("%zu != %zu", msp.initial_old_size(), expected));
+    assert(msp.initial_old_size() == expected, "%zu != %zu", msp.initial_old_size(), expected);
   }
 
 
--- a/src/share/vm/gc/shared/concurrentGCThread.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/concurrentGCThread.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -33,10 +33,6 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/os.hpp"
 
-// CopyrightVersion 1.2
-
-int  ConcurrentGCThread::_CGC_flag            = CGC_nil;
-
 ConcurrentGCThread::ConcurrentGCThread() :
   _should_terminate(false), _has_terminated(false) {
 };
--- a/src/share/vm/gc/shared/concurrentGCThread.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/concurrentGCThread.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -35,19 +35,6 @@
   bool _should_terminate;
   bool _has_terminated;
 
-  enum CGC_flag_type {
-    CGC_nil           = 0x0,
-    CGC_dont_suspend  = 0x1,
-    CGC_CGC_safepoint = 0x2,
-    CGC_VM_safepoint  = 0x4
-  };
-
-  static int _CGC_flag;
-
-  static bool CGC_flag_is_set(int b)       { return (_CGC_flag & b) != 0; }
-  static int set_CGC_flag(int b)           { return _CGC_flag |= b; }
-  static int reset_CGC_flag(int b)         { return _CGC_flag &= ~b; }
-
   // Create and start the thread (setting it's priority high.)
   void create_and_start();
 
@@ -63,13 +50,10 @@
   void terminate();
 
 public:
-  // Constructor
-
   ConcurrentGCThread();
-  ~ConcurrentGCThread() {} // Exists to call NamedThread destructor.
 
   // Tester
-  bool is_ConcurrentGC_thread() const          { return true;       }
+  bool is_ConcurrentGC_thread() const { return true; }
 };
 
 // The SurrogateLockerThread is used by concurrent GC threads for
--- a/src/share/vm/gc/shared/gcCause.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcCause.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -95,9 +95,9 @@
   // Causes for collection of the tenured gernation
   inline static bool is_tenured_allocation_failure_gc(GCCause::Cause cause) {
     assert(cause != GCCause::_old_generation_too_full_to_scavenge &&
-      cause != GCCause::_old_generation_expanded_on_last_scavenge,
-      err_msg("This GCCause may be correct but is not expected yet: %s",
-      to_string(cause)));
+           cause != GCCause::_old_generation_expanded_on_last_scavenge,
+           "This GCCause may be correct but is not expected yet: %s",
+           to_string(cause));
     // _tenured_generation_full or _cms_generation_full for full tenured generations
     // _adaptive_size_policy for a full collection after a young GC
     // _allocation_failure is the generic cause a collection which could result
@@ -141,14 +141,14 @@
       _position = jio_snprintf(_buffer, _length, "%s ", prefix);
      }
      assert(_position >= 0 && _position <= _length,
-       err_msg("Need to increase the buffer size in GCCauseString? %d", _position));
+            "Need to increase the buffer size in GCCauseString? %d", _position);
    }
 
    GCCauseString& append(const char* str) {
      int res = jio_snprintf(_buffer + _position, _length - _position, "%s", str);
      _position += res;
      assert(res >= 0 && _position <= _length,
-       err_msg("Need to increase the buffer size in GCCauseString? %d", res));
+            "Need to increase the buffer size in GCCauseString? %d", res);
      return *this;
    }
 
--- a/src/share/vm/gc/shared/gcId.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcId.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -25,18 +25,37 @@
 #include "precompiled.hpp"
 #include "gc/shared/gcId.hpp"
 #include "runtime/safepoint.hpp"
+#include "runtime/thread.inline.hpp"
 
 uint GCId::_next_id = 0;
 
-const GCId GCId::create() {
-  return GCId(_next_id++);
+NamedThread* currentNamedthread() {
+  assert(Thread::current()->is_Named_thread(), "This thread must be NamedThread");
+  return (NamedThread*)Thread::current();
 }
-const GCId GCId::peek() {
-  return GCId(_next_id);
+
+const uint GCId::create() {
+  return _next_id++;
 }
-const GCId GCId::undefined() {
-  return GCId(UNDEFINED);
+
+const uint GCId::current() {
+  assert(currentNamedthread()->gc_id() != undefined(), "Using undefined GC id.");
+  return current_raw();
 }
-bool GCId::is_undefined() const {
-  return _id == UNDEFINED;
+
+const uint GCId::current_raw() {
+  return currentNamedthread()->gc_id();
 }
+
+GCIdMark::GCIdMark() : _gc_id(GCId::create()) {
+  currentNamedthread()->set_gc_id(_gc_id);
+}
+
+GCIdMark::GCIdMark(uint gc_id) : _gc_id(gc_id) {
+  currentNamedthread()->set_gc_id(_gc_id);
+}
+
+GCIdMark::~GCIdMark() {
+  currentNamedthread()->set_gc_id(GCId::undefined());
+}
+
--- a/src/share/vm/gc/shared/gcId.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcId.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -27,25 +27,26 @@
 
 #include "memory/allocation.hpp"
 
-class GCId VALUE_OBJ_CLASS_SPEC {
- private:
-  uint _id;
-  GCId(uint id) : _id(id) {}
-  GCId() { } // Unused
-
+class GCId : public AllStatic {
+  friend class GCIdMark;
   static uint _next_id;
   static const uint UNDEFINED = (uint)-1;
+  static const uint create();
 
  public:
-  uint id() const {
-    assert(_id != UNDEFINED, "Using undefined GC ID");
-    return _id;
-  }
-  bool is_undefined() const;
+  // Returns the currently active GC id. Asserts that there is an active GC id.
+  static const uint current();
+  // Same as current() but can return undefined() if no GC id is currently active
+  static const uint current_raw();
+  static const uint undefined() { return UNDEFINED; }
+};
 
-  static const GCId create();
-  static const GCId peek();
-  static const GCId undefined();
+class GCIdMark : public StackObj {
+  uint _gc_id;
+ public:
+  GCIdMark();
+  GCIdMark(uint gc_id);
+  ~GCIdMark();
 };
 
 #endif // SHARE_VM_GC_SHARED_GCID_HPP
--- a/src/share/vm/gc/shared/gcTrace.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcTrace.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -40,31 +40,16 @@
 #include "gc/g1/evacuationInfo.hpp"
 #endif
 
-#define assert_unset_gc_id() assert(_shared_gc_info.gc_id().is_undefined(), "GC already started?")
-#define assert_set_gc_id() assert(!_shared_gc_info.gc_id().is_undefined(), "GC not started?")
-
 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
-  assert_unset_gc_id();
-
-  GCId gc_id = GCId::create();
-  _shared_gc_info.set_gc_id(gc_id);
   _shared_gc_info.set_cause(cause);
   _shared_gc_info.set_start_timestamp(timestamp);
 }
 
 void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
-  assert_unset_gc_id();
-
   report_gc_start_impl(cause, timestamp);
 }
 
-bool GCTracer::has_reported_gc_start() const {
-  return !_shared_gc_info.gc_id().is_undefined();
-}
-
 void GCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
-  assert_set_gc_id();
-
   _shared_gc_info.set_sum_of_pauses(time_partitions->sum_of_pauses());
   _shared_gc_info.set_longest_pause(time_partitions->longest_pause());
   _shared_gc_info.set_end_timestamp(timestamp);
@@ -74,16 +59,10 @@
 }
 
 void GCTracer::report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions) {
-  assert_set_gc_id();
-
   report_gc_end_impl(timestamp, time_partitions);
-
-  _shared_gc_info.set_gc_id(GCId::undefined());
 }
 
 void GCTracer::report_gc_reference_stats(const ReferenceProcessorStats& rps) const {
-  assert_set_gc_id();
-
   send_reference_stats_event(REF_SOFT, rps.soft_count());
   send_reference_stats_event(REF_WEAK, rps.weak_count());
   send_reference_stats_event(REF_FINAL, rps.final_count());
@@ -92,14 +71,12 @@
 
 #if INCLUDE_SERVICES
 class ObjectCountEventSenderClosure : public KlassInfoClosure {
-  const GCId _gc_id;
   const double _size_threshold_percentage;
   const size_t _total_size_in_words;
   const Ticks _timestamp;
 
  public:
-  ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words, const Ticks& timestamp) :
-    _gc_id(gc_id),
+  ObjectCountEventSenderClosure(size_t total_size_in_words, const Ticks& timestamp) :
     _size_threshold_percentage(ObjectCountCutOffPercent / 100),
     _total_size_in_words(total_size_in_words),
     _timestamp(timestamp)
@@ -107,7 +84,7 @@
 
   virtual void do_cinfo(KlassInfoEntry* entry) {
     if (should_send_event(entry)) {
-      ObjectCountEventSender::send(entry, _gc_id, _timestamp);
+      ObjectCountEventSender::send(entry, _timestamp);
     }
   }
 
@@ -119,7 +96,6 @@
 };
 
 void GCTracer::report_object_count_after_gc(BoolObjectClosure* is_alive_cl) {
-  assert_set_gc_id();
   assert(is_alive_cl != NULL, "Must supply function to check liveness");
 
   if (ObjectCountEventSender::should_send_event()) {
@@ -129,7 +105,7 @@
     if (!cit.allocation_failed()) {
       HeapInspection hi(false, false, false, NULL);
       hi.populate_table(&cit, is_alive_cl);
-      ObjectCountEventSenderClosure event_sender(_shared_gc_info.gc_id(), cit.size_of_instances_in_words(), Ticks::now());
+      ObjectCountEventSenderClosure event_sender(cit.size_of_instances_in_words(), Ticks::now());
       cit.iterate(&event_sender);
     }
   }
@@ -137,14 +113,10 @@
 #endif // INCLUDE_SERVICES
 
 void GCTracer::report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const {
-  assert_set_gc_id();
-
   send_gc_heap_summary_event(when, heap_summary);
 }
 
 void GCTracer::report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& summary) const {
-  assert_set_gc_id();
-
   send_meta_space_summary_event(when, summary);
 
   send_metaspace_chunk_free_list_summary(when, Metaspace::NonClassType, summary.metaspace_chunk_free_list_summary());
@@ -154,7 +126,6 @@
 }
 
 void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
-  assert_set_gc_id();
   assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
 
   GCTracer::report_gc_end_impl(timestamp, time_partitions);
@@ -164,8 +135,6 @@
 }
 
 void YoungGCTracer::report_promotion_failed(const PromotionFailedInfo& pf_info) const {
-  assert_set_gc_id();
-
   send_promotion_failed_event(pf_info);
 }
 
@@ -189,78 +158,56 @@
 void YoungGCTracer::report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
                                                        uint age, bool tenured,
                                                        size_t plab_size) const {
-  assert_set_gc_id();
   send_promotion_in_new_plab_event(klass, obj_size, age, tenured, plab_size);
 }
 
 void YoungGCTracer::report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
                                                         uint age, bool tenured) const {
-  assert_set_gc_id();
   send_promotion_outside_plab_event(klass, obj_size, age, tenured);
 }
 
 void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
-  assert_set_gc_id();
-
   GCTracer::report_gc_end_impl(timestamp, time_partitions);
   send_old_gc_event();
 }
 
 void ParallelOldTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
-  assert_set_gc_id();
-
   OldGCTracer::report_gc_end_impl(timestamp, time_partitions);
   send_parallel_old_event();
 }
 
 void ParallelOldTracer::report_dense_prefix(void* dense_prefix) {
-  assert_set_gc_id();
-
   _parallel_old_gc_info.report_dense_prefix(dense_prefix);
 }
 
 void OldGCTracer::report_concurrent_mode_failure() {
-  assert_set_gc_id();
-
   send_concurrent_mode_failure_event();
 }
 
 #if INCLUDE_ALL_GCS
-void G1MMUTracer::report_mmu(const GCId& gcId, double timeSlice, double gcTime, double maxTime) {
-  assert(!gcId.is_undefined(), "Undefined GC id");
-
-  send_g1_mmu_event(gcId, timeSlice, gcTime, maxTime);
+void G1MMUTracer::report_mmu(double timeSlice, double gcTime, double maxTime) {
+  send_g1_mmu_event(timeSlice, gcTime, maxTime);
 }
 
 void G1NewTracer::report_yc_type(G1YCType type) {
-  assert_set_gc_id();
-
   _g1_young_gc_info.set_type(type);
 }
 
 void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
-  assert_set_gc_id();
-
   YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);
   send_g1_young_gc_event();
 }
 
 void G1NewTracer::report_evacuation_info(EvacuationInfo* info) {
-  assert_set_gc_id();
-
   send_evacuation_info_event(info);
 }
 
 void G1NewTracer::report_evacuation_failed(EvacuationFailedInfo& ef_info) {
-  assert_set_gc_id();
-
   send_evacuation_failed_event(ef_info);
   ef_info.reset();
 }
 
 void G1NewTracer::report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const {
-  assert_set_gc_id();
-
   send_young_evacuation_statistics(young_summary);
   send_old_evacuation_statistics(old_summary);
 }
--- a/src/share/vm/gc/shared/gcTrace.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcTrace.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -52,7 +52,6 @@
 
 class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
  private:
-  GCId _gc_id;
   GCName _name;
   GCCause::Cause _cause;
   Ticks     _start_timestamp;
@@ -62,7 +61,6 @@
 
  public:
   SharedGCInfo(GCName name) :
-    _gc_id(GCId::undefined()),
     _name(name),
     _cause(GCCause::_last_gc_cause),
     _start_timestamp(),
@@ -71,9 +69,6 @@
     _longest_pause() {
   }
 
-  void set_gc_id(GCId gc_id) { _gc_id = gc_id; }
-  const GCId& gc_id() const { return _gc_id; }
-
   void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; }
   const Ticks start_timestamp() const { return _start_timestamp; }
 
@@ -128,8 +123,6 @@
   void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
-  bool has_reported_gc_start() const;
-  const GCId& gc_id() { return _shared_gc_info.gc_id(); }
 
  protected:
   GCTracer(GCName name) : _shared_gc_info(name) {}
@@ -242,10 +235,10 @@
 
 #if INCLUDE_ALL_GCS
 class G1MMUTracer : public AllStatic {
-  static void send_g1_mmu_event(const GCId& gcId, double timeSlice, double gcTime, double maxTime);
+  static void send_g1_mmu_event(double timeSlice, double gcTime, double maxTime);
 
  public:
-  static void report_mmu(const GCId& gcId, double timeSlice, double gcTime, double maxTime);
+  static void report_mmu(double timeSlice, double gcTime, double maxTime);
 };
 
 class G1NewTracer : public YoungGCTracer {
--- a/src/share/vm/gc/shared/gcTraceSend.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcTraceSend.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -44,7 +44,7 @@
 void GCTracer::send_garbage_collection_event() const {
   EventGCGarbageCollection event(UNTIMED);
   if (event.should_commit()) {
-    event.set_gcId(_shared_gc_info.gc_id().id());
+    event.set_gcId(GCId::current());
     event.set_name(_shared_gc_info.name());
     event.set_cause((u2) _shared_gc_info.cause());
     event.set_sumOfPauses(_shared_gc_info.sum_of_pauses());
@@ -58,7 +58,7 @@
 void GCTracer::send_reference_stats_event(ReferenceType type, size_t count) const {
   EventGCReferenceStatistics e;
   if (e.should_commit()) {
-      e.set_gcId(_shared_gc_info.gc_id().id());
+      e.set_gcId(GCId::current());
       e.set_type((u1)type);
       e.set_count(count);
       e.commit();
@@ -69,7 +69,7 @@
                                                       const MetaspaceChunkFreeListSummary& summary) const {
   EventMetaspaceChunkFreeListSummary e;
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_when(when);
     e.set_metadataType(mdtype);
 
@@ -92,7 +92,7 @@
 void ParallelOldTracer::send_parallel_old_event() const {
   EventGCParallelOld e(UNTIMED);
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_densePrefix((TraceAddress)_parallel_old_gc_info.dense_prefix());
     e.set_starttime(_shared_gc_info.start_timestamp());
     e.set_endtime(_shared_gc_info.end_timestamp());
@@ -103,7 +103,7 @@
 void YoungGCTracer::send_young_gc_event() const {
   EventGCYoungGarbageCollection e(UNTIMED);
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_tenuringThreshold(_tenuring_threshold);
     e.set_starttime(_shared_gc_info.start_timestamp());
     e.set_endtime(_shared_gc_info.end_timestamp());
@@ -125,7 +125,7 @@
 
   EventPromoteObjectInNewPLAB event;
   if (event.should_commit()) {
-    event.set_gcId(_shared_gc_info.gc_id().id());
+    event.set_gcId(GCId::current());
     event.set_class(klass);
     event.set_objectSize(obj_size);
     event.set_tenured(tenured);
@@ -140,7 +140,7 @@
 
   EventPromoteObjectOutsidePLAB event;
   if (event.should_commit()) {
-    event.set_gcId(_shared_gc_info.gc_id().id());
+    event.set_gcId(GCId::current());
     event.set_class(klass);
     event.set_objectSize(obj_size);
     event.set_tenured(tenured);
@@ -152,7 +152,7 @@
 void OldGCTracer::send_old_gc_event() const {
   EventGCOldGarbageCollection e(UNTIMED);
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_starttime(_shared_gc_info.start_timestamp());
     e.set_endtime(_shared_gc_info.end_timestamp());
     e.commit();
@@ -171,7 +171,7 @@
 void YoungGCTracer::send_promotion_failed_event(const PromotionFailedInfo& pf_info) const {
   EventPromotionFailed e;
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_data(to_trace_struct(pf_info));
     e.set_thread(pf_info.thread()->thread_id());
     e.commit();
@@ -182,7 +182,7 @@
 void OldGCTracer::send_concurrent_mode_failure_event() {
   EventConcurrentModeFailure e;
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.commit();
   }
 }
@@ -191,7 +191,7 @@
 void G1NewTracer::send_g1_young_gc_event() {
   EventGCG1GarbageCollection e(UNTIMED);
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_type(_g1_young_gc_info.type());
     e.set_starttime(_shared_gc_info.start_timestamp());
     e.set_endtime(_shared_gc_info.end_timestamp());
@@ -199,10 +199,10 @@
   }
 }
 
-void G1MMUTracer::send_g1_mmu_event(const GCId& gcId, double timeSlice, double gcTime, double maxTime) {
+void G1MMUTracer::send_g1_mmu_event(double timeSlice, double gcTime, double maxTime) {
   EventGCG1MMU e;
   if (e.should_commit()) {
-    e.set_gcId(gcId.id());
+    e.set_gcId(GCId::current());
     e.set_timeSlice(timeSlice);
     e.set_gcTime(gcTime);
     e.set_maxGcTime(maxTime);
@@ -213,7 +213,7 @@
 void G1NewTracer::send_evacuation_info_event(EvacuationInfo* info) {
   EventEvacuationInfo e;
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_cSetRegions(info->collectionset_regions());
     e.set_cSetUsedBefore(info->collectionset_used_before());
     e.set_cSetUsedAfter(info->collectionset_used_after());
@@ -229,7 +229,7 @@
 void G1NewTracer::send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const {
   EventEvacuationFailed e;
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_data(to_trace_struct(ef_info));
     e.commit();
   }
@@ -253,7 +253,7 @@
 void G1NewTracer::send_young_evacuation_statistics(const G1EvacSummary& summary) const {
   EventGCG1EvacuationYoungStatistics surv_evt;
   if (surv_evt.should_commit()) {
-    surv_evt.set_stats(create_g1_evacstats(_shared_gc_info.gc_id().id(), summary));
+    surv_evt.set_stats(create_g1_evacstats(GCId::current(), summary));
     surv_evt.commit();
   }
 }
@@ -261,7 +261,7 @@
 void G1NewTracer::send_old_evacuation_statistics(const G1EvacSummary& summary) const {
   EventGCG1EvacuationOldStatistics old_evt;
   if (old_evt.should_commit()) {
-    old_evt.set_stats(create_g1_evacstats(_shared_gc_info.gc_id().id(), summary));
+    old_evt.set_stats(create_g1_evacstats(GCId::current(), summary));
     old_evt.commit();
   }
 }
@@ -287,17 +287,16 @@
 }
 
 class GCHeapSummaryEventSender : public GCHeapSummaryVisitor {
-  GCId _gc_id;
   GCWhen::Type _when;
  public:
-  GCHeapSummaryEventSender(GCId gc_id, GCWhen::Type when) : _gc_id(gc_id), _when(when) {}
+  GCHeapSummaryEventSender(GCWhen::Type when) : _when(when) {}
 
   void visit(const GCHeapSummary* heap_summary) const {
     const VirtualSpaceSummary& heap_space = heap_summary->heap();
 
     EventGCHeapSummary e;
     if (e.should_commit()) {
-      e.set_gcId(_gc_id.id());
+      e.set_gcId(GCId::current());
       e.set_when((u1)_when);
       e.set_heapSpace(to_trace_struct(heap_space));
       e.set_heapUsed(heap_summary->used());
@@ -310,7 +309,7 @@
 
     EventG1HeapSummary e;
     if (e.should_commit()) {
-      e.set_gcId(_gc_id.id());
+      e.set_gcId(GCId::current());
       e.set_when((u1)_when);
       e.set_edenUsedSize(g1_heap_summary->edenUsed());
       e.set_edenTotalSize(g1_heap_summary->edenCapacity());
@@ -331,7 +330,7 @@
 
     EventPSHeapSummary e;
     if (e.should_commit()) {
-      e.set_gcId(_gc_id.id());
+      e.set_gcId(GCId::current());
       e.set_when((u1)_when);
 
       e.set_oldSpace(to_trace_struct(ps_heap_summary->old()));
@@ -346,7 +345,7 @@
 };
 
 void GCTracer::send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const {
-  GCHeapSummaryEventSender visitor(_shared_gc_info.gc_id(), when);
+  GCHeapSummaryEventSender visitor(when);
   heap_summary.accept(&visitor);
 }
 
@@ -363,7 +362,7 @@
 void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const {
   EventMetaspaceSummary e;
   if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.gc_id().id());
+    e.set_gcId(GCId::current());
     e.set_when((u1) when);
     e.set_gcThreshold(meta_space_summary.capacity_until_GC());
     e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
@@ -374,15 +373,12 @@
 }
 
 class PhaseSender : public PhaseVisitor {
-  GCId _gc_id;
  public:
-  PhaseSender(GCId gc_id) : _gc_id(gc_id) {}
-
   template<typename T>
   void send_phase(PausePhase* pause) {
     T event(UNTIMED);
     if (event.should_commit()) {
-      event.set_gcId(_gc_id.id());
+      event.set_gcId(GCId::current());
       event.set_name(pause->name());
       event.set_starttime(pause->start());
       event.set_endtime(pause->end());
@@ -406,7 +402,7 @@
 };
 
 void GCTracer::send_phase_events(TimePartitions* time_partitions) const {
-  PhaseSender phase_reporter(_shared_gc_info.gc_id());
+  PhaseSender phase_reporter;
 
   TimePartitionPhasesIterator iter(time_partitions);
   while (iter.has_next()) {
--- a/src/share/vm/gc/shared/gcTraceTime.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcTraceTime.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -35,7 +35,7 @@
 #include "utilities/ticks.inline.hpp"
 
 
-GCTraceTime::GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer, GCId gc_id) :
+GCTraceTimeImpl::GCTraceTimeImpl(const char* title, bool doit, bool print_cr, GCTimer* timer) :
     _title(title), _doit(doit), _print_cr(print_cr), _timer(timer), _start_counter() {
   if (_doit || _timer != NULL) {
     _start_counter.stamp();
@@ -49,17 +49,13 @@
   }
 
   if (_doit) {
-    gclog_or_tty->date_stamp(PrintGCDateStamps);
-    gclog_or_tty->stamp(PrintGCTimeStamps);
-    if (PrintGCID) {
-      gclog_or_tty->print("#%u: ", gc_id.id());
-    }
+    gclog_or_tty->gclog_stamp();
     gclog_or_tty->print("[%s", title);
     gclog_or_tty->flush();
   }
 }
 
-GCTraceTime::~GCTraceTime() {
+GCTraceTimeImpl::~GCTraceTimeImpl() {
   Ticks stop_counter;
 
   if (_doit || _timer != NULL) {
--- a/src/share/vm/gc/shared/gcTraceTime.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/gcTraceTime.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -26,12 +26,13 @@
 #define SHARE_VM_GC_SHARED_GCTRACETIME_HPP
 
 #include "gc/shared/gcTrace.hpp"
+#include "memory/allocation.hpp"
 #include "prims/jni_md.h"
 #include "utilities/ticks.hpp"
 
 class GCTimer;
 
-class GCTraceTime {
+class GCTraceTimeImpl VALUE_OBJ_CLASS_SPEC {
   const char* _title;
   bool _doit;
   bool _print_cr;
@@ -39,8 +40,16 @@
   Ticks _start_counter;
 
  public:
-  GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer, GCId gc_id);
-  ~GCTraceTime();
+  GCTraceTimeImpl(const char* title, bool doit, bool print_cr, GCTimer* timer);
+  ~GCTraceTimeImpl();
+};
+
+class GCTraceTime : public StackObj {
+  GCTraceTimeImpl _gc_trace_time_impl;
+
+ public:
+  GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer) :
+    _gc_trace_time_impl(title, doit, print_cr, timer) {};
 };
 
 #endif // SHARE_VM_GC_SHARED_GCTRACETIME_HPP
--- a/src/share/vm/gc/shared/genCollectedHeap.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/genCollectedHeap.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -30,6 +30,7 @@
 #include "code/icBuffer.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "gc/shared/collectorCounters.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.inline.hpp"
 #include "gc/shared/gcTrace.hpp"
 #include "gc/shared/gcTraceTime.hpp"
@@ -162,8 +163,8 @@
                                   "the maximum representable size");
   }
   assert(total_reserved % alignment == 0,
-         err_msg("Gen size; total_reserved=" SIZE_FORMAT ", alignment="
-                 SIZE_FORMAT, total_reserved, alignment));
+         "Gen size; total_reserved=" SIZE_FORMAT ", alignment="
+         SIZE_FORMAT, total_reserved, alignment);
 
   *heap_rs = Universe::reserve_heap(total_reserved, alignment);
   return heap_rs->base();
@@ -315,9 +316,7 @@
                                           bool restore_marks_for_biased_locking) {
   // Timer for individual generations. Last argument is false: no CR
   // FIXME: We should try to start the timing earlier to cover more of the GC pause
-  // The PrintGCDetails logging starts before we have incremented the GC id. We will do that later
-  // so we can assume here that the next GC id is what we want.
-  GCTraceTime t1(gen->short_name(), PrintGCDetails, false, NULL, GCId::peek());
+  GCTraceTime t1(gen->short_name(), PrintGCDetails, false, NULL);
   TraceCollectorStats tcs(gen->counters());
   TraceMemoryManagerStats tmms(gen->kind(),gc_cause());
 
@@ -434,6 +433,8 @@
     return; // GC is disabled (e.g. JNI GetXXXCritical operation)
   }
 
+  GCIdMark gc_id_mark;
+
   const bool do_clear_all_soft_refs = clear_all_soft_refs ||
                           collector_policy()->should_clear_all_soft_refs();
 
@@ -449,9 +450,7 @@
     bool complete = full && (max_generation == OldGen);
     const char* gc_cause_prefix = complete ? "Full GC" : "GC";
     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
-    // The PrintGCDetails logging starts before we have incremented the GC id. We will do that later
-    // so we can assume here that the next GC id is what we want.
-    GCTraceTime t(GCCauseString(gc_cause_prefix, gc_cause()), PrintGCDetails, false, NULL, GCId::peek());
+    GCTraceTime t(GCCauseString(gc_cause_prefix, gc_cause()), PrintGCDetails, false, NULL);
 
     gc_prologue(complete);
     increment_total_collections(complete);
@@ -489,6 +488,7 @@
     bool must_restore_marks_for_biased_locking = false;
 
     if (max_generation == OldGen && _old_gen->should_collect(full, size, is_tlab)) {
+      GCIdMark gc_id_mark;
       if (!complete) {
         // The full_collections increment was missed above.
         increment_total_full_collections();
@@ -891,7 +891,7 @@
 bool GenCollectedHeap::is_in_young(oop p) {
   bool result = ((HeapWord*)p) < _old_gen->reserved().start();
   assert(result == _young_gen->is_in_reserved(p),
-         err_msg("incorrect test - result=%d, p=" INTPTR_FORMAT, result, p2i((void*)p)));
+         "incorrect test - result=%d, p=" INTPTR_FORMAT, result, p2i((void*)p));
   return result;
 }
 
--- a/src/share/vm/gc/shared/objectCountEventSender.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/objectCountEventSender.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -33,13 +33,13 @@
 #include "utilities/ticks.hpp"
 #if INCLUDE_SERVICES
 
-void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, const Ticks& timestamp) {
+void ObjectCountEventSender::send(const KlassInfoEntry* entry, const Ticks& timestamp) {
 #if INCLUDE_TRACE
   assert(Tracing::is_event_enabled(EventObjectCountAfterGC::eventId),
          "Only call this method if the event is enabled");
 
   EventObjectCountAfterGC event(UNTIMED);
-  event.set_gcId(gc_id.id());
+  event.set_gcId(GCId::current());
   event.set_class(entry->klass());
   event.set_count(entry->count());
   event.set_totalSize(entry->words() * BytesPerWord);
--- a/src/share/vm/gc/shared/objectCountEventSender.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/objectCountEventSender.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -36,7 +36,7 @@
 
 class ObjectCountEventSender : public AllStatic {
  public:
-  static void send(const KlassInfoEntry* entry, GCId gc_id, const Ticks& timestamp);
+  static void send(const KlassInfoEntry* entry, const Ticks& timestamp);
   static bool should_send_event();
 };
 
--- a/src/share/vm/gc/shared/plab.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/plab.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -45,8 +45,8 @@
   // ArrayOopDesc::header_size depends on command line initialization.
   AlignmentReserve = oopDesc::header_size() > MinObjAlignment ? align_object_size(arrayOopDesc::header_size(T_INT)) : 0;
   assert(min_size() > AlignmentReserve,
-         err_msg("Minimum PLAB size " SIZE_FORMAT " must be larger than alignment reserve " SIZE_FORMAT " "
-                 "to be able to contain objects", min_size(), AlignmentReserve));
+         "Minimum PLAB size " SIZE_FORMAT " must be larger than alignment reserve " SIZE_FORMAT " "
+         "to be able to contain objects", min_size(), AlignmentReserve);
 }
 
 // If the minimum object size is greater than MinObjAlignment, we can
@@ -125,12 +125,12 @@
 
   if (_allocated == 0) {
     assert(_unused == 0,
-           err_msg("Inconsistency in PLAB stats: "
-                   "_allocated: " SIZE_FORMAT ", "
-                   "_wasted: " SIZE_FORMAT ", "
-                   "_unused: " SIZE_FORMAT ", "
-                   "_undo_wasted: " SIZE_FORMAT,
-                   _allocated, _wasted, _unused, _undo_wasted));
+           "Inconsistency in PLAB stats: "
+           "_allocated: " SIZE_FORMAT ", "
+           "_wasted: " SIZE_FORMAT ", "
+           "_unused: " SIZE_FORMAT ", "
+           "_undo_wasted: " SIZE_FORMAT,
+           _allocated, _wasted, _unused, _undo_wasted);
 
     _allocated = 1;
   }
--- a/src/share/vm/gc/shared/referenceProcessor.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/referenceProcessor.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -31,6 +31,7 @@
 #include "gc/shared/gcTraceTime.hpp"
 #include "gc/shared/referencePolicy.hpp"
 #include "gc/shared/referenceProcessor.hpp"
+#include "memory/allocation.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/jniHandles.hpp"
@@ -182,13 +183,27 @@
   return total;
 }
 
+static void log_ref_count(size_t count, bool doit) {
+  if (doit) {
+    gclog_or_tty->print(", " SIZE_FORMAT " refs", count);
+  }
+}
+
+class GCRefTraceTime : public StackObj {
+  GCTraceTimeImpl _gc_trace_time;
+ public:
+  GCRefTraceTime(const char* title, bool doit, GCTimer* timer, size_t count) :
+    _gc_trace_time(title, doit, false, timer) {
+    log_ref_count(count, doit);
+  }
+};
+
 ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
   BoolObjectClosure*           is_alive,
   OopClosure*                  keep_alive,
   VoidClosure*                 complete_gc,
   AbstractRefProcTaskExecutor* task_executor,
-  GCTimer*                     gc_timer,
-  GCId                         gc_id) {
+  GCTimer*                     gc_timer) {
 
   assert(!enqueuing_is_done(), "If here enqueuing should not be complete");
   // Stop treating discovered references specially.
@@ -206,48 +221,48 @@
 
   bool trace_time = PrintGCDetails && PrintReferenceGC;
 
+  // Include cleaners in phantom statistics.  We expect Cleaner
+  // references to be temporary, and don't want to deal with
+  // possible incompatibilities arising from making it more visible.
+  ReferenceProcessorStats stats(
+      total_count(_discoveredSoftRefs),
+      total_count(_discoveredWeakRefs),
+      total_count(_discoveredFinalRefs),
+      total_count(_discoveredPhantomRefs) + total_count(_discoveredCleanerRefs));
+
   // Soft references
-  size_t soft_count = 0;
   {
-    GCTraceTime tt("SoftReference", trace_time, false, gc_timer, gc_id);
-    soft_count =
-      process_discovered_reflist(_discoveredSoftRefs, _current_soft_ref_policy, true,
-                                 is_alive, keep_alive, complete_gc, task_executor);
+    GCRefTraceTime tt("SoftReference", trace_time, gc_timer, stats.soft_count());
+    process_discovered_reflist(_discoveredSoftRefs, _current_soft_ref_policy, true,
+                               is_alive, keep_alive, complete_gc, task_executor);
   }
 
   update_soft_ref_master_clock();
 
   // Weak references
-  size_t weak_count = 0;
   {
-    GCTraceTime tt("WeakReference", trace_time, false, gc_timer, gc_id);
-    weak_count =
-      process_discovered_reflist(_discoveredWeakRefs, NULL, true,
-                                 is_alive, keep_alive, complete_gc, task_executor);
+    GCRefTraceTime tt("WeakReference", trace_time, gc_timer, stats.weak_count());
+    process_discovered_reflist(_discoveredWeakRefs, NULL, true,
+                               is_alive, keep_alive, complete_gc, task_executor);
   }
 
   // Final references
-  size_t final_count = 0;
   {
-    GCTraceTime tt("FinalReference", trace_time, false, gc_timer, gc_id);
-    final_count =
-      process_discovered_reflist(_discoveredFinalRefs, NULL, false,
-                                 is_alive, keep_alive, complete_gc, task_executor);
+    GCRefTraceTime tt("FinalReference", trace_time, gc_timer, stats.final_count());
+    process_discovered_reflist(_discoveredFinalRefs, NULL, false,
+                               is_alive, keep_alive, complete_gc, task_executor);
   }
 
   // Phantom references
-  size_t phantom_count = 0;
   {
-    GCTraceTime tt("PhantomReference", trace_time, false, gc_timer, gc_id);
-    phantom_count =
-      process_discovered_reflist(_discoveredPhantomRefs, NULL, false,
-                                 is_alive, keep_alive, complete_gc, task_executor);
+    GCRefTraceTime tt("PhantomReference", trace_time, gc_timer, stats.phantom_count());
+    process_discovered_reflist(_discoveredPhantomRefs, NULL, false,
+                               is_alive, keep_alive, complete_gc, task_executor);
 
-    // Process cleaners, but include them in phantom statistics.  We expect
+    // Process cleaners, but include them in phantom timing.  We expect
     // Cleaner references to be temporary, and don't want to deal with
     // possible incompatibilities arising from making it more visible.
-    phantom_count +=
-      process_discovered_reflist(_discoveredCleanerRefs, NULL, true,
+    process_discovered_reflist(_discoveredCleanerRefs, NULL, true,
                                  is_alive, keep_alive, complete_gc, task_executor);
   }
 
@@ -257,14 +272,15 @@
   // thus use JNI weak references to circumvent the phantom references and
   // resurrect a "post-mortem" object.
   {
-    GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer, gc_id);
+    GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer);
+    NOT_PRODUCT(log_ref_count(count_jni_refs(), trace_time);)
     if (task_executor != NULL) {
       task_executor->set_single_threaded_mode();
     }
     process_phaseJNI(is_alive, keep_alive, complete_gc);
   }
 
-  return ReferenceProcessorStats(soft_count, weak_count, final_count, phantom_count);
+  return stats;
 }
 
 #ifndef PRODUCT
@@ -294,12 +310,6 @@
 void ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive,
                                           OopClosure*        keep_alive,
                                           VoidClosure*       complete_gc) {
-#ifndef PRODUCT
-  if (PrintGCDetails && PrintReferenceGC) {
-    unsigned int count = count_jni_refs();
-    gclog_or_tty->print(", %u refs", count);
-  }
-#endif
   JNIHandles::weak_oops_do(is_alive, keep_alive);
   complete_gc->do_void();
 }
@@ -437,7 +447,7 @@
   _discovered_addr = java_lang_ref_Reference::discovered_addr(_ref);
   oop discovered = java_lang_ref_Reference::discovered(_ref);
   assert(_discovered_addr && discovered->is_oop_or_null(),
-         err_msg("Expected an oop or NULL for discovered field at " PTR_FORMAT, p2i(discovered)));
+         "Expected an oop or NULL for discovered field at " PTR_FORMAT, p2i(discovered));
   _next = discovered;
   _referent_addr = java_lang_ref_Reference::referent_addr(_ref);
   _referent = java_lang_ref_Reference::referent(_ref);
@@ -446,9 +456,9 @@
   assert(allow_null_referent ?
              _referent->is_oop_or_null()
            : _referent->is_oop(),
-         err_msg("Expected an oop%s for referent field at " PTR_FORMAT,
-                 (allow_null_referent ? " or NULL" : ""),
-                 p2i(_referent)));
+         "Expected an oop%s for referent field at " PTR_FORMAT,
+         (allow_null_referent ? " or NULL" : ""),
+         p2i(_referent));
 }
 
 void DiscoveredListIterator::remove() {
@@ -578,7 +588,7 @@
     oop next = java_lang_ref_Reference::next(iter.obj());
     if ((iter.referent() == NULL || iter.is_referent_alive() ||
          next != NULL)) {
-      assert(next->is_oop_or_null(), err_msg("Expected an oop or NULL for next field at " PTR_FORMAT, p2i(next)));
+      assert(next->is_oop_or_null(), "Expected an oop or NULL for next field at " PTR_FORMAT, p2i(next));
       // Remove Reference object from list
       iter.remove();
       // Trace the cohorts
@@ -826,8 +836,7 @@
   balance_queues(_discoveredCleanerRefs);
 }
 
-size_t
-ReferenceProcessor::process_discovered_reflist(
+void ReferenceProcessor::process_discovered_reflist(
   DiscoveredList               refs_lists[],
   ReferencePolicy*             policy,
   bool                         clear_referent,
@@ -850,12 +859,6 @@
     balance_queues(refs_lists);
   }
 
-  size_t total_list_count = total_count(refs_lists);
-
-  if (PrintReferenceGC && PrintGCDetails) {
-    gclog_or_tty->print(", " SIZE_FORMAT " refs", total_list_count);
-  }
-
   // Phase 1 (soft refs only):
   // . Traverse the list and remove any SoftReferences whose
   //   referents are not alive, but that should be kept alive for
@@ -898,8 +901,6 @@
                      is_alive, keep_alive, complete_gc);
     }
   }
-
-  return total_list_count;
 }
 
 inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt) {
@@ -993,9 +994,9 @@
   bool da = discovery_is_atomic();
   oop referent = java_lang_ref_Reference::referent(obj);
   assert(da ? referent->is_oop() : referent->is_oop_or_null(),
-         err_msg("Bad referent " INTPTR_FORMAT " found in Reference "
-                 INTPTR_FORMAT " during %satomic discovery ",
-                 p2i(referent), p2i(obj), da ? "" : "non-"));
+         "Bad referent " INTPTR_FORMAT " found in Reference "
+         INTPTR_FORMAT " during %satomic discovery ",
+         p2i(referent), p2i(obj), da ? "" : "non-");
 }
 #endif
 
@@ -1070,7 +1071,7 @@
 
   HeapWord* const discovered_addr = java_lang_ref_Reference::discovered_addr(obj);
   const oop  discovered = java_lang_ref_Reference::discovered(obj);
-  assert(discovered->is_oop_or_null(), err_msg("Expected an oop or NULL for discovered field at " PTR_FORMAT, p2i(discovered)));
+  assert(discovered->is_oop_or_null(), "Expected an oop or NULL for discovered field at " PTR_FORMAT, p2i(discovered));
   if (discovered != NULL) {
     // The reference has already been discovered...
     if (TraceReferenceGC) {
@@ -1150,13 +1151,12 @@
   OopClosure* keep_alive,
   VoidClosure* complete_gc,
   YieldClosure* yield,
-  GCTimer* gc_timer,
-  GCId     gc_id) {
+  GCTimer* gc_timer) {
 
   // Soft references
   {
     GCTraceTime tt("Preclean SoftReferences", PrintGCDetails && PrintReferenceGC,
-              false, gc_timer, gc_id);
+              false, gc_timer);
     for (uint i = 0; i < _max_num_q; i++) {
       if (yield->should_return()) {
         return;
@@ -1169,7 +1169,7 @@
   // Weak references
   {
     GCTraceTime tt("Preclean WeakReferences", PrintGCDetails && PrintReferenceGC,
-              false, gc_timer, gc_id);
+              false, gc_timer);
     for (uint i = 0; i < _max_num_q; i++) {
       if (yield->should_return()) {
         return;
@@ -1182,7 +1182,7 @@
   // Final references
   {
     GCTraceTime tt("Preclean FinalReferences", PrintGCDetails && PrintReferenceGC,
-              false, gc_timer, gc_id);
+              false, gc_timer);
     for (uint i = 0; i < _max_num_q; i++) {
       if (yield->should_return()) {
         return;
@@ -1195,7 +1195,7 @@
   // Phantom references
   {
     GCTraceTime tt("Preclean PhantomReferences", PrintGCDetails && PrintReferenceGC,
-              false, gc_timer, gc_id);
+              false, gc_timer);
     for (uint i = 0; i < _max_num_q; i++) {
       if (yield->should_return()) {
         return;
--- a/src/share/vm/gc/shared/referenceProcessor.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/referenceProcessor.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -263,13 +263,13 @@
   }
 
   // Process references with a certain reachability level.
-  size_t process_discovered_reflist(DiscoveredList               refs_lists[],
-                                    ReferencePolicy*             policy,
-                                    bool                         clear_referent,
-                                    BoolObjectClosure*           is_alive,
-                                    OopClosure*                  keep_alive,
-                                    VoidClosure*                 complete_gc,
-                                    AbstractRefProcTaskExecutor* task_executor);
+  void process_discovered_reflist(DiscoveredList               refs_lists[],
+                                  ReferencePolicy*             policy,
+                                  bool                         clear_referent,
+                                  BoolObjectClosure*           is_alive,
+                                  OopClosure*                  keep_alive,
+                                  VoidClosure*                 complete_gc,
+                                  AbstractRefProcTaskExecutor* task_executor);
 
   void process_phaseJNI(BoolObjectClosure* is_alive,
                         OopClosure*        keep_alive,
@@ -331,8 +331,7 @@
                                       OopClosure*        keep_alive,
                                       VoidClosure*       complete_gc,
                                       YieldClosure*      yield,
-                                      GCTimer*           gc_timer,
-                                      GCId               gc_id);
+                                      GCTimer*           gc_timer);
 
   // Returns the name of the discovered reference list
   // occupying the i / _num_q slot.
@@ -441,8 +440,7 @@
                                 OopClosure*                  keep_alive,
                                 VoidClosure*                 complete_gc,
                                 AbstractRefProcTaskExecutor* task_executor,
-                                GCTimer *gc_timer,
-                                GCId    gc_id);
+                                GCTimer *gc_timer);
 
   // Enqueue references at end of GC (called by the garbage collector)
   bool enqueue_discovered_references(AbstractRefProcTaskExecutor* task_executor = NULL);
--- a/src/share/vm/gc/shared/space.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/space.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -592,8 +592,8 @@
 // Very general, slow implementation.
 HeapWord* ContiguousSpace::block_start_const(const void* p) const {
   assert(MemRegion(bottom(), end()).contains(p),
-         err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
-                  p2i(p), p2i(bottom()), p2i(end())));
+         "p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
+         p2i(p), p2i(bottom()), p2i(end()));
   if (p >= top()) {
     return top();
   } else {
@@ -603,24 +603,23 @@
       last = cur;
       cur += oop(cur)->size();
     }
-    assert(oop(last)->is_oop(),
-           err_msg(PTR_FORMAT " should be an object start", p2i(last)));
+    assert(oop(last)->is_oop(), PTR_FORMAT " should be an object start", p2i(last));
     return last;
   }
 }
 
 size_t ContiguousSpace::block_size(const HeapWord* p) const {
   assert(MemRegion(bottom(), end()).contains(p),
-         err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
-                  p2i(p), p2i(bottom()), p2i(end())));
+         "p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
+         p2i(p), p2i(bottom()), p2i(end()));
   HeapWord* current_top = top();
   assert(p <= current_top,
-         err_msg("p > current top - p: " PTR_FORMAT ", current top: " PTR_FORMAT,
-                  p2i(p), p2i(current_top)));
+         "p > current top - p: " PTR_FORMAT ", current top: " PTR_FORMAT,
+         p2i(p), p2i(current_top));
   assert(p == current_top || oop(p)->is_oop(),
-         err_msg("p (" PTR_FORMAT ") is not a block start - "
-                 "current_top: " PTR_FORMAT ", is_oop: %s",
-                 p2i(p), p2i(current_top), BOOL_TO_STR(oop(p)->is_oop())));
+         "p (" PTR_FORMAT ") is not a block start - "
+         "current_top: " PTR_FORMAT ", is_oop: %s",
+         p2i(p), p2i(current_top), BOOL_TO_STR(oop(p)->is_oop()));
   if (p < current_top) {
     return oop(p)->size();
   } else {
--- a/src/share/vm/gc/shared/taskqueue.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/taskqueue.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -92,20 +92,20 @@
 void TaskQueueStats::verify() const
 {
   assert(get(push) == get(pop) + get(steal),
-         err_msg("push=" SIZE_FORMAT " pop=" SIZE_FORMAT " steal=" SIZE_FORMAT,
-                 get(push), get(pop), get(steal)));
+         "push=" SIZE_FORMAT " pop=" SIZE_FORMAT " steal=" SIZE_FORMAT,
+         get(push), get(pop), get(steal));
   assert(get(pop_slow) <= get(pop),
-         err_msg("pop_slow=" SIZE_FORMAT " pop=" SIZE_FORMAT,
-                 get(pop_slow), get(pop)));
+         "pop_slow=" SIZE_FORMAT " pop=" SIZE_FORMAT,
+         get(pop_slow), get(pop));
   assert(get(steal) <= get(steal_attempt),
-         err_msg("steal=" SIZE_FORMAT " steal_attempt=" SIZE_FORMAT,
-                 get(steal), get(steal_attempt)));
+         "steal=" SIZE_FORMAT " steal_attempt=" SIZE_FORMAT,
+         get(steal), get(steal_attempt));
   assert(get(overflow) == 0 || get(push) != 0,
-         err_msg("overflow=" SIZE_FORMAT " push=" SIZE_FORMAT,
-                 get(overflow), get(push)));
+         "overflow=" SIZE_FORMAT " push=" SIZE_FORMAT,
+         get(overflow), get(push));
   assert(get(overflow_max_len) == 0 || get(overflow) != 0,
-         err_msg("overflow_max_len=" SIZE_FORMAT " overflow=" SIZE_FORMAT,
-                 get(overflow_max_len), get(overflow)));
+         "overflow_max_len=" SIZE_FORMAT " overflow=" SIZE_FORMAT,
+         get(overflow_max_len), get(overflow));
 }
 #endif // ASSERT
 #endif // TASKQUEUE_STATS
--- a/src/share/vm/gc/shared/workgroup.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/workgroup.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/shared/workgroup.hpp"
 #include "memory/allocation.hpp"
 #include "memory/allocation.inline.hpp"
@@ -140,7 +141,7 @@
     _end_semaphore->wait();
 
     // No workers are allowed to read the state variables after the coordinator has been signaled.
-    assert(_not_finished == 0, err_msg("%d not finished workers?", _not_finished));
+    assert(_not_finished == 0, "%d not finished workers?", _not_finished);
     _task    = NULL;
     _started = 0;
 
@@ -328,6 +329,7 @@
 void GangWorker::run_task(WorkData data) {
   print_task_started(data);
 
+  GCIdMark gc_id_mark(data._task->gc_id());
   data._task->work(data._worker_id);
 
   print_task_done(data);
--- a/src/share/vm/gc/shared/workgroup.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/gc/shared/workgroup.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -28,6 +28,7 @@
 #include "memory/allocation.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/thread.hpp"
+#include "gc/shared/gcId.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
 
@@ -54,9 +55,13 @@
 // You subclass this to supply your own work() method
 class AbstractGangTask VALUE_OBJ_CLASS_SPEC {
   const char* _name;
+  const uint _gc_id;
 
  public:
-  AbstractGangTask(const char* name) : _name(name) {}
+  AbstractGangTask(const char* name) :
+    _name(name),
+    _gc_id(GCId::current_raw())
+ {}
 
   // The abstract work method.
   // The argument tells you which member of the gang you are.
@@ -64,6 +69,7 @@
 
   // Debugging accessor for the name.
   const char* name() const { return _name; }
+  const uint gc_id() const { return _gc_id; }
 };
 
 struct WorkData {
@@ -132,7 +138,7 @@
 
   virtual uint active_workers() const {
     assert(_active_workers <= _total_workers,
-           err_msg("_active_workers: %u > _total_workers: %u", _active_workers, _total_workers));
+           "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers);
     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
            "Unless dynamic should use total workers");
     return _active_workers;
--- a/src/share/vm/interpreter/bytecodeInterpreter.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -2734,8 +2734,8 @@
       }
 
       DEFAULT:
-          fatal(err_msg("Unimplemented opcode %d = %s", opcode,
-                        Bytecodes::name((Bytecodes::Code)opcode)));
+          fatal("Unimplemented opcode %d = %s", opcode,
+                Bytecodes::name((Bytecodes::Code)opcode));
           goto finish;
 
       } /* switch(opc) */
--- a/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -35,7 +35,7 @@
 #ifdef ASSERT
 #define VERIFY_OOP(o_) \
       if (VerifyOops) { \
-        assert((oop(o_))->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(oop(o_)))); \
+        assert((oop(o_))->is_oop_or_null(), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(o_))); \
         StubRoutines::_verify_oop_count++;  \
       }
 #else
--- a/src/share/vm/interpreter/bytecodes.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/bytecodes.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -542,8 +542,7 @@
           Code code = cast(i);
           Code java = java_code(code);
           if (can_trap(code) && !can_trap(java))
-            fatal(err_msg("%s can trap => %s can trap, too", name(code),
-                          name(java)));
+            fatal("%s can trap => %s can trap, too", name(code), name(java));
         }
       }
     }
--- a/src/share/vm/interpreter/bytecodes.hpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/bytecodes.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -353,8 +353,8 @@
 
  public:
   // Conversion
-  static void        check          (Code code)    { assert(is_defined(code),      err_msg("illegal code: %d", (int)code)); }
-  static void        wide_check     (Code code)    { assert(wide_is_defined(code), err_msg("illegal code: %d", (int)code)); }
+  static void        check          (Code code)    { assert(is_defined(code),      "illegal code: %d", (int)code); }
+  static void        wide_check     (Code code)    { assert(wide_is_defined(code), "illegal code: %d", (int)code); }
   static Code        cast           (int  code)    { return (Code)code; }
 
 
--- a/src/share/vm/interpreter/interpreter.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/interpreter.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -605,7 +605,7 @@
 #endif // defined(TARGET_ARCH_x86) && !defined(_LP64)
 #endif // CC_INTERP
   default:
-    fatal(err_msg("unexpected method kind: %d", kind));
+    fatal("unexpected method kind: %d", kind);
     break;
   }
 
--- a/src/share/vm/interpreter/interpreterRuntime.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -858,7 +858,7 @@
     resolve_invokedynamic(thread);
     break;
   default:
-    fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(bytecode)));
+    fatal("unexpected bytecode: %s", Bytecodes::name(bytecode));
     break;
   }
 }
--- a/src/share/vm/interpreter/linkResolver.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/linkResolver.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -179,11 +179,11 @@
     KlassHandle object_klass = SystemDictionary::Object_klass();
     Method * object_resolved_method = object_klass()->vtable()->method_at(index);
     assert(object_resolved_method->name() == resolved_method->name(),
-      err_msg("Object and interface method names should match at vtable index %d, %s != %s",
-      index, object_resolved_method->name()->as_C_string(), resolved_method->name()->as_C_string()));
+      "Object and interface method names should match at vtable index %d, %s != %s",
+      index, object_resolved_method->name()->as_C_string(), resolved_method->name()->as_C_string());
     assert(object_resolved_method->signature() == resolved_method->signature(),
-      err_msg("Object and interface method signatures should match at vtable index %d, %s != %s",
-      index, object_resolved_method->signature()->as_C_string(), resolved_method->signature()->as_C_string()));
+      "Object and interface method signatures should match at vtable index %d, %s != %s",
+      index, object_resolved_method->signature()->as_C_string(), resolved_method->signature()->as_C_string());
 #endif // ASSERT
 
     kind = CallInfo::vtable_call;
@@ -192,7 +192,7 @@
     kind = CallInfo::itable_call;
     index = resolved_method->itable_index();
   }
-  assert(index == Method::nonvirtual_vtable_index || index >= 0, err_msg("bad index %d", index));
+  assert(index == Method::nonvirtual_vtable_index || index >= 0, "bad index %d", index);
   _call_kind  = kind;
   _call_index = index;
   _resolved_appendix = Handle();
@@ -215,7 +215,7 @@
     assert(call_kind() != CallInfo::unknown_kind, "CallInfo must be set");
     break;
   default:
-    fatal(err_msg_res("Unexpected call kind %d", call_kind()));
+    fatal("Unexpected call kind %d", call_kind());
   }
 }
 #endif //ASSERT
@@ -499,7 +499,7 @@
           result->print();
         }
         assert(actual_size_of_params == expected_size_of_params,
-               err_msg("%d != %d", actual_size_of_params, expected_size_of_params));
+               "%d != %d", actual_size_of_params, expected_size_of_params);
 #endif //ASSERT
 
         assert(appendix_result_or_null != NULL, "");
--- a/src/share/vm/interpreter/templateInterpreter.cpp	Thu Oct 01 11:52:44 2015 -0700
+++ b/src/share/vm/interpreter/templateInterpreter.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -607,7 +607,7 @@
   case Bytecodes::_invokedynamic:
     return Interpreter::invokedynamic_return_entry_table();
   default:
-    fatal(err_msg("invalid bytecode: %s", Bytecodes::name(code)));
+    fatal("invalid bytecode: %s", Bytecodes::name(code));
     return NULL;
   }
 }
@@ -629,7 +629,7 @@
   case Bytecodes::_invokedynamic:
     return _invokedynamic_return_entry[index];
   default:
-    assert(!Bytecodes::is_invoke(code), err_msg("invoke instructions should be handled separately: %s", Bytecodes::name(code)));
+    assert(!Bytecodes::is_invoke(code), "invoke instructions should be handled separately: %s", Bytecodes::name(code));
     return _return_entry[length].entry(state);
   }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/logging/log.hpp	Wed Oct 07 01:03:24 2015 +0200
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+#ifndef SHARE_VM_LOGGING_LOG_HPP
+#define SHARE_VM_LOGGING_LOG_HPP
+
+#include "logging/logLevel.hpp"
+#include "logging/logPrefix.hpp"
+#include "logging/logTagSet.hpp"
+#include "logging/logTag.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/ostream.hpp"
+
+//
+// Logging macros
+//
+// Usage:
+//   log_<level>(<comma separated log tags>)(<printf-style log arguments>);
+// e.g.
+//   log_debug(logging)("message %d", i);
+//
+// Note that these macros will not evaluate the arguments unless the logging is enabled.
+//
+#define log_error(...)   (!log_is_enabled(Error, __VA_ARGS__))   ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Error>
+#define log_warning(...) (!log_is_enabled(Warning, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Warning>
+#define log_info(...)    (!log_is_enabled(Info, __VA_ARGS__))    ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
+#define log_debug(...)   (!log_is_enabled(Debug, __VA_ARGS__))   ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
+#define log_trace(...)   (!log_is_enabled(Trace, __VA_ARGS__))   ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>
+#ifndef PRODUCT
+#define log_develop(...) (!log_is_enabled(Develop, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Develop>
+#else
+#define DUMMY_ARGUMENT_CONSUMER(...)
+#define log_develop(...) DUMMY_ARGUMENT_CONSUMER
+#endif
+
+// Convenience macro to test if the logging is enabled on the specified level for given tags.
+#define log_is_enabled(level, ...) (Log<LOG_TAGS(__VA_ARGS__)>::is_level(LogLevel::level))
+
+//
+// Log class for more advanced logging scenarios.
+// Has printf-style member functions for each log level (trace(), debug(), etc).
+//
+// Also has outputStream compatible API for the different log-levels.
+// The streams are resource allocated when requested and are accessed through
+// calls to <level>_stream() functions (trace_stream(), debug_stream(), etc).
+//
+// Example usage:
+//   LogHandle(logging) log;
+//   if (log.is_debug()) {
+//     ...
+//     log.debug("result = %d", result).trace(" tracing info");
+//     obj->print_on(log.debug_stream());
+//   }
+//
+#define LogHandle(...)  Log<LOG_TAGS(__VA_ARGS__)>
+
+template <LogTagType T0, LogTagType T1 = LogTag::__NO_TAG, LogTagType T2 = LogTag::__NO_TAG, LogTagType T3 = LogTag::__NO_TAG,
+          LogTagType T4 = LogTag::__NO_TAG, LogTagType GuardTag = LogTag::__NO_TAG>
+class Log VALUE_OBJ_CLASS_SPEC {
+ private:
+  static const size_t LogBufferSize = 512;
+ public:
+  // Make sure no more than the maximum number of tags have been given.
+  // The GuardTag allows this to be detected if/when it happens. If the GuardTag
+  // is not __NO_TAG, the number of tags given exceeds the maximum allowed.
+  STATIC_ASSERT(GuardTag == LogTag::__NO_TAG); // Number of logging tags exceeds maximum supported!
+
+  static bool is_level(LogLevelType level) {
+    return LogTagSetMapping<T0, T1, T2, T3, T4>::tagset().is_level(level);
+  }
+
+  template <LogLevelType Level>
+  ATTRIBUTE_PRINTF(1, 2)
+  static void write(const char* fmt, ...) {
+    va_list args;
+    va_start(args, fmt);
+    vwrite<Level>(fmt, args);
+    va_end(args);
+  };
+
+  template <LogLevelType Level>
+  ATTRIBUTE_PRINTF(1, 0)
+  static void vwrite(const char* fmt, va_list args) {
+    char buf[LogBufferSize];
+    size_t prefix_len = LogPrefix<T0, T1, T2, T3, T4>::prefix(buf, sizeof(buf));
+    int ret = vsnprintf(buf + prefix_len, sizeof(buf) - prefix_len, fmt, args);
+    assert(ret >= 0 && (size_t)ret < sizeof(buf), "Log message too long");
+    puts<Level>(buf);
+  }
+
+  template <LogLevelType Level>
+  static void puts(const char* string) {
+    LogTagSetMapping<T0, T1, T2, T3, T4>::tagset().log(Level, string);
+  }
+
+#define LOG_LEVEL(level, name) ATTRIBUTE_PRINTF(2, 0) \
+  Log& v##name(const char* fmt, va_list args) { \
+    vwrite<LogLevel::level>(fmt, args); \
+    return *this; \
+  } \
+  Log& name(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3) { \
+    va_list args; \
+    va_start(args, fmt); \
+    vwrite<LogLevel::level>(fmt, args); \
+    va_end(args); \
+    return *this; \
+  } \
+  static bool is_##name() { \
+    return is_level(LogLevel::level); \
+  } \
+  static outputStream* name##_stream() { \
+    return new logStream(write<LogLevel::level>); \
+  }
+  LOG_LEVEL_LIST
+#undef LOG_LEVEL
+};
+
+#endif // SHARE_VM_LOGGING_LOG_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/logging/logConfiguration.cpp	Wed Oct 07 01:03:24 2015 +0200
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+#include "precompiled.hpp"
+#include "logging/log.hpp"
+#include "logging/logConfiguration.hpp"
+#include "logging/logDecorations.hpp"
+#include "logging/logDecorators.hpp"
+#include "logging/logDiagnosticCommand.hpp"
+#include "logging/logFileOutput.hpp"
+#include "logging/logOutput.hpp"
+#include "logging/logTagLevelExpression.hpp"
+#include "logging/logTagSet.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/os.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+LogOutput** LogConfiguration::_outputs = NULL;
+size_t      LogConfiguration::_n_outputs = 0;
+
+void LogConfiguration::post_initialize() {
+  assert(LogConfiguration_lock != NULL, "Lock must be initialized before post-initialization");
+  LogDiagnosticCommand::registerCommand();
+  LogHandle(logging) log;
+  log.info("Log configuration fully initialized.");
+  if (log.is_trace()) {
+    ResourceMark rm;
+    MutexLocker ml(LogConfiguration_lock);
+    describe(log.trace_stream());
+  }
+}
+
+void LogConfiguration::initialize(jlong vm_start_time) {
+  LogFileOutput::set_file_name_parameters(vm_start_time);
+  LogDecorations::set_vm_start_time_millis(vm_start_time);
+
+  assert(_outputs == NULL, "Should not initialize _outputs before this function, initialize called twice?");
+  _outputs = NEW_C_HEAP_ARRAY(LogOutput*, 2, mtLogging);
+  _outputs[0] = LogOutput::Stdout;
+  _outputs[1] = LogOutput::Stderr;
+  _n_outputs = 2;
+}
+
+void LogConfiguration::finalize() {
+  for (size_t i = 2; i < _n_outputs; i++) {
+    delete _outputs[i];
+  }
+  FREE_C_HEAP_ARRAY(LogOutput*, _outputs);
+}
+
+size_t LogConfiguration::find_output(const char* name) {
+  for (size_t i = 0; i < _n_outputs; i++) {
+    if (strcmp(_outputs[i]->name(), name) == 0) {
+      return i;
+    }
+  }
+  return SIZE_MAX;
+}
+
+LogOutput* LogConfiguration::new_output(char* name, const char* options) {
+  const char* type;
+  char* equals_pos = strchr(name, '=');
+  if (equals_pos == NULL) {
+    type = "file";
+  } else {
+    *equals_pos = '\0';
+    type = name;
+    name = equals_pos + 1;
+  }
+
+  LogOutput* output;
+  if (strcmp(type, "file") == 0) {
+    output = new LogFileOutput(name);
+  } else {
+    // unsupported log output type
+    return NULL;
+  }
+
+  bool success = output->initialize(options);
+  if (!success) {
+    delete output;
+    return NULL;
+  }
+  return output;
+}
+
+size_t LogConfiguration::add_output(LogOutput* output) {
+  size_t idx = _n_outputs++;
+  _outputs = REALLOC_C_HEAP_ARRAY(LogOutput*, _outputs, _n_outputs, mtLogging);
+  _outputs[idx] = output;
+  return idx;
+}
+
+void LogConfiguration::delete_output(size_t idx) {
+  assert(idx > 1 && idx < _n_outputs,
+         "idx must be in range 1 < idx < _n_outputs, but idx = " SIZE_FORMAT
+         " and _n_outputs = " SIZE_FORMAT, idx, _n_outputs);
+  LogOutput* output = _outputs[idx];
+  // Swap places with the last output and shrink the array
+  _outputs[idx] = _outputs[--_n_outputs];
+  _outputs = REALLOC_C_HEAP_ARRAY(LogOutput*, _outputs, _n_outputs, mtLogging);
+  delete output;
+}
+
+void LogConfiguration::configure_output(size_t idx, const LogTagLevelExpression& tag_level_expression, const LogDecorators& decorators) {
+  assert(idx < _n_outputs, "Invalid index, idx = " SIZE_FORMAT " and _n_outputs = " SIZE_FORMAT, idx, _n_outputs);
+  LogOutput* output = _outputs[idx];
+  output->set_decorators(decorators);
+  output->set_config_string(tag_level_expression.to_string());
+  bool enabled = false;
+  for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) {
+    LogLevelType level = tag_level_expression.level_for(*ts);
+    if (level != LogLevel::Off) {
+      enabled = true;
+    }
+    ts->update_decorators(decorators);
+    ts->set_output_level(output, level);
+  }
+
+  // If the output is not used by any tagset it should be removed, unless it is stdout/stderr.
+  if (!enabled && idx > 1) {
+    delete_output(idx);