changeset 6745:b23fa46cfc38

Merge
author jmasa
date Fri, 11 Jul 2014 05:59:08 -0700
parents 7fdf4173cde4 24840b59c6df
children 700946707a7c
files
diffstat 139 files changed, 826 insertions(+), 1033 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -421,3 +421,5 @@
 b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
 14b656df31c2cb09c505921061e79977823de71a jdk9-b17
 871fd128548480095e0dc3fc34c422666baeec75 jdk9-b18
+d4cffb3ae6213c66c7522ebffe0349360a45f0ef jdk9-b19
+c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20
--- a/make/bsd/makefiles/gcc.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/make/bsd/makefiles/gcc.make	Fri Jul 11 05:59:08 2014 -0700
@@ -280,16 +280,7 @@
 
 # optimization control flags (Used by fastdebug and release variants)
 OPT_CFLAGS/NOOPT=-O0
-ifeq ($(USE_CLANG), true)
-  # Clang does not support -Og
-  OPT_CFLAGS/DEBUG=-O0
-else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  OPT_CFLAGS/DEBUG=-Og
-else
-  # Allow no optimizations.
- OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
 OPT_CFLAGS/SIZE=-Os
 OPT_CFLAGS/SPEED=-O3
 
@@ -457,16 +448,8 @@
   CFLAGS += -flimit-debug-info
 endif
 
-ifeq ($(USE_CLANG), true)
-  # Clang does not support -Og
-  DEBUG_CFLAGS=-O0
-else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  DEBUG_CFLAGS=-Og
-else
-  # Allow no optimizations.
-  DEBUG_CFLAGS=-O0
-endif
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
 
 # DEBUG_BINARIES uses full -g debug information for all configs
 ifeq ($(DEBUG_BINARIES), true)
--- a/make/linux/Makefile	Wed Jul 09 16:44:30 2014 +0200
+++ b/make/linux/Makefile	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -67,8 +67,12 @@
   endif
 endif
 # C1 is not ported on ppc64, so we cannot build a tiered VM:
-ifeq ($(ARCH),ppc64)
-  FORCE_TIERED=0
+# Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but
+# 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here!
+ifneq (,$(findstring $(ARCH), ppc ppc64))
+  ifeq ($(ARCH_DATA_MODEL), 64)
+    FORCE_TIERED=0
+  endif
 endif
 
 ifdef LP64
--- a/make/linux/makefiles/defs.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/make/linux/makefiles/defs.make	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -108,7 +108,9 @@
 endif
 
 # PPC
-ifneq (,$(findstring $(ARCH), ppc))
+# Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but
+# 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here!
+ifneq (,$(findstring $(ARCH), ppc ppc64))
   ifeq ($(ARCH_DATA_MODEL), 64)
     MAKE_ARGS        += LP64=1
     PLATFORM         = linux-ppc64
--- a/make/linux/makefiles/dtrace.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/make/linux/makefiles/dtrace.make	Fri Jul 11 05:59:08 2014 -0700
@@ -40,7 +40,14 @@
 ifneq ($(ALT_SDT_H),)
   SDT_H_FILE = $(ALT_SDT_H)
 else
-  SDT_H_FILE = /usr/include/sys/sdt.h
+  ifeq ($(USE_CLANG), true)
+    # Clang doesn't support the -print-sysroot option and there is no known equivalent
+    # option, so fall back to using / as sysroot
+    SDT_SYSROOT=
+  else
+    SDT_SYSROOT=$(shell $(CXX) -print-sysroot)
+  endif
+  SDT_H_FILE = $(SDT_SYSROOT)/usr/include/sys/sdt.h
 endif
 
 DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))
--- a/make/linux/makefiles/gcc.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/make/linux/makefiles/gcc.make	Fri Jul 11 05:59:08 2014 -0700
@@ -231,13 +231,7 @@
 
 # optimization control flags (Used by fastdebug and release variants)
 OPT_CFLAGS/NOOPT=-O0
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  OPT_CFLAGS/DEBUG=-Og
-else
-  # Allow no optimizations.
-  OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
 OPT_CFLAGS/SIZE=-Os
 OPT_CFLAGS/SPEED=-O3
 
@@ -344,13 +338,8 @@
   CFLAGS += -flimit-debug-info
 endif
 
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  DEBUG_CFLAGS=-Og
-else
-  # Allow no optimizations.
-  DEBUG_CFLAGS=-O0
-endif
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
 
 # DEBUG_BINARIES uses full -g debug information for all configs
 ifeq ($(DEBUG_BINARIES), true)
--- a/make/solaris/makefiles/gcc.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/make/solaris/makefiles/gcc.make	Fri Jul 11 05:59:08 2014 -0700
@@ -127,13 +127,7 @@
 
 # optimization control flags (Used by fastdebug and release variants)
 OPT_CFLAGS/NOOPT=-O0
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  OPT_CFLAGS/DEBUG=-Og
-+else
-  # Allow no optimizations.
-  OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
 OPT_CFLAGS/SIZE=-Os
 OPT_CFLAGS/SPEED=-O3
 
@@ -229,14 +223,8 @@
 #------------------------------------------------------------------------
 # Debug flags
 
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  DEBUG_CFLAGS=-Og
-else
-  # Allow no optimizations.
-  DEBUG_CFLAGS=-O0
-endif
-
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
 
 # Use the stabs format for debugging information (this is the default
 # on gcc-2.91). It's good enough, has all the information about line
--- a/src/cpu/ppc/vm/assembler_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/assembler_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -693,7 +693,7 @@
   // PPC 1, section 4.6.7 Floating-Point Compare Instructions
   fcmpu( CCR7, F24, F25);
 
-  tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", code()->insts_begin(), code()->insts_end());
+  tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end()));
   code()->decode();
 }
 
--- a/src/cpu/ppc/vm/compiledIC_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/compiledIC_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -175,7 +175,7 @@
   if (TraceICs) {
     ResourceMark rm;
     tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
-                  instruction_address(),
+                  p2i(instruction_address()),
                   callee->name_and_sig_as_C_string());
   }
 
--- a/src/cpu/ppc/vm/frame_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/frame_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -140,7 +140,7 @@
 void frame::patch_pc(Thread* thread, address pc) {
   if (TracePcPatching) {
     tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]",
-                  &((address*) _sp)[-1], ((address*) _sp)[-1], pc);
+                  p2i(&((address*) _sp)[-1]), p2i(((address*) _sp)[-1]), p2i(pc));
   }
   own_abi()->lr = (uint64_t)pc;
   _cb = CodeCache::find_blob(pc);
--- a/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -3099,7 +3099,7 @@
 };
 
 static void stop_on_request(int tp, const char* msg) {
-  tty->print("PPC assembly code requires stop: (%s) %s\n", (void *)stop_types[tp%/*stop_end*/4], 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));
 }
 
--- a/src/cpu/ppc/vm/methodHandles_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/methodHandles_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -464,7 +464,7 @@
                  strstr(adaptername, "linkTo") == NULL);    // static linkers don't have MH
   const char* mh_reg_name = has_mh ? "R23_method_handle" : "G23";
   tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
-                adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
+                adaptername, mh_reg_name, (intptr_t) mh, (intptr_t) entry_sp);
 
   if (Verbose) {
     tty->print_cr("Registers:");
--- a/src/cpu/ppc/vm/nativeInst_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/nativeInst_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -147,9 +147,9 @@
   address addr = addr_at(0);
 
   if (!NativeCall::is_call_at(addr)) {
-    tty->print_cr("not a NativeCall at " PTR_FORMAT, 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, addr));
+    fatal(err_msg("not a NativeCall at " PTR_FORMAT, p2i(addr)));
   }
 }
 #endif // ASSERT
@@ -160,9 +160,9 @@
 
   NativeInstruction::verify();
   if (!NativeFarCall::is_far_call_at(addr)) {
-    tty->print_cr("not a NativeFarCall at " PTR_FORMAT, 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, addr));
+    fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, p2i(addr)));
   }
 }
 #endif // ASSERT
@@ -306,9 +306,9 @@
     if (! (cb != NULL && MacroAssembler::is_calculate_address_from_global_toc_at(addr, cb->content_begin())) &&
         ! (cb != NULL && MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) &&
         ! MacroAssembler::is_bl(*((int*) addr))) {
-      tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, 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, addr));
+      fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr)));
     }
   }
 }
@@ -344,9 +344,9 @@
 
   NativeInstruction::verify();
   if (!NativeJump::is_jump_at(addr)) {
-    tty->print_cr("not a NativeJump at " PTR_FORMAT, 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, addr));
+    fatal(err_msg("not a NativeJump at " PTR_FORMAT, p2i(addr)));
   }
 }
 #endif // ASSERT
--- a/src/cpu/ppc/vm/ppc.ad	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/ppc.ad	Fri Jul 11 05:59:08 2014 -0700
@@ -1329,7 +1329,7 @@
 
   if (!false /* TODO: PPC port C->is_frameless_method()*/) {
     st->print("save return pc\n\t");
-    st->print("push frame %d\n\t", -framesize);
+    st->print("push frame %ld\n\t", -framesize);
   }
 }
 #endif
--- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -32,12 +32,6 @@
 #include "runtime/stubCodeGenerator.hpp"
 #include "utilities/defaultStream.hpp"
 #include "vm_version_ppc.hpp"
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
 
 # include <sys/sysinfo.h>
 
@@ -352,7 +346,7 @@
 
   if (PrintAssembly) {
     ttyLocker ttyl;
-    tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", code);
+    tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
     Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
     tty->print_cr("Time loop1 :%f", loop1_seconds);
     tty->print_cr("Time loop2 :%f", loop2_seconds);
@@ -435,7 +429,7 @@
   // Print the detection code.
   if (PrintAssembly) {
     ttyLocker ttyl;
-    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", code);
+    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
     Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
   }
 
@@ -468,7 +462,7 @@
   // Print the detection code.
   if (PrintAssembly) {
     ttyLocker ttyl;
-    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", code);
+    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", p2i(code));
     Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
   }
 
--- a/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 #include "runtime/biasedLocking.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
--- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -28,12 +28,6 @@
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_sparc.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
 
 int VM_Version::_features = VM_Version::unknown_m;
 const char* VM_Version::_features_str = "";
--- a/src/cpu/x86/vm/frame_x86.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/x86/vm/frame_x86.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -33,7 +33,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/monitorChunk.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/src/cpu/x86/vm/vm_version_x86.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/x86/vm/vm_version_x86.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,18 +29,6 @@
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_x86.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 
 int VM_Version::_cpu;
--- a/src/cpu/zero/vm/vm_version_zero.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/cpu/zero/vm/vm_version_zero.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,11 +29,5 @@
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_zero.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // This file is intentionally empty
--- a/src/os/aix/vm/attachListener_aix.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/aix/vm/attachListener_aix.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -25,7 +25,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/src/os/aix/vm/os_aix.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/aix/vm/os_aix.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -42,6 +42,7 @@
 #include "memory/filemap.hpp"
 #include "mutex_aix.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "os_aix.inline.hpp"
 #include "os_share_aix.hpp"
 #include "porting_aix.hpp"
 #include "prims/jniFastGetField.hpp"
@@ -2807,12 +2808,10 @@
   return DontYieldALot;
 }
 
-void os::yield() {
+void os::naked_yield() {
   sched_yield();
 }
 
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
 ////////////////////////////////////////////////////////////////////////////////
 // thread priority support
 
@@ -3069,7 +3068,7 @@
 
   for (int n = 0; !osthread->sr.is_suspended(); n++) {
     for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
-      os::yield();
+      os::naked_yield();
     }
 
     // timeout, try to cancel the request
@@ -3103,7 +3102,7 @@
     if (sr_notify(osthread) == 0) {
       for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
         for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
-          os::yield();
+          os::naked_yield();
         }
       }
     } else {
--- a/src/os/aix/vm/os_aix.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/aix/vm/os_aix.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -26,8 +26,6 @@
 #ifndef OS_AIX_VM_OS_AIX_INLINE_HPP
 #define OS_AIX_VM_OS_AIX_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -45,18 +43,6 @@
   return pthread_getspecific((pthread_key_t)index);
 }
 
-inline const char* os::file_separator() {
-  return "/";
-}
-
-inline const char* os::line_separator() {
-  return "\n";
-}
-
-inline const char* os::path_separator() {
-  return ":";
-}
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/src/os/bsd/vm/attachListener_bsd.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/bsd/vm/attachListener_bsd.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/src/os/bsd/vm/os_bsd.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/bsd/vm/os_bsd.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -36,6 +36,7 @@
 #include "memory/filemap.hpp"
 #include "mutex_bsd.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "os_bsd.inline.hpp"
 #include "os_share_bsd.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
@@ -2595,12 +2596,10 @@
   return DontYieldALot;
 }
 
-void os::yield() {
+void os::naked_yield() {
   sched_yield();
 }
 
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
 ////////////////////////////////////////////////////////////////////////////////
 // thread priority support
 
@@ -4217,22 +4216,12 @@
   return abstime;
 }
 
-
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
-  for (;;) {
-    const int v = _Event;
-    guarantee((v == 0) || (v == 1), "invariant");
-    if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
-  }
-}
-
 void os::PlatformEvent::park() {       // AKA "down()"
   // Invariant: Only the thread associated with the Event/PlatformEvent
   // may call park().
   // TODO: assert that _Assoc != NULL or _Assoc == Self
+  assert(_nParked == 0, "invariant");
+
   int v;
   for (;;) {
       v = _Event;
@@ -4332,8 +4321,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -4540,10 +4528,9 @@
 }
 
 void Parker::unpark() {
-  int s, status;
-  status = pthread_mutex_lock(_mutex);
+  int status = pthread_mutex_lock(_mutex);
   assert(status == 0, "invariant");
-  s = _counter;
+  const int s = _counter;
   _counter = 1;
   if (s < 1) {
      if (WorkAroundNPTLTimedWaitHang) {
--- a/src/os/bsd/vm/os_bsd.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/bsd/vm/os_bsd.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -219,7 +219,6 @@
     int  fired() { return _Event; }
     void park();
     void unpark();
-    int  TryPark();
     int  park(jlong millis);
     void SetAssociation(Thread * a) { _Assoc = a; }
 };
--- a/src/os/bsd/vm/os_bsd.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/bsd/vm/os_bsd.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,8 +25,6 @@
 #ifndef OS_BSD_VM_OS_BSD_INLINE_HPP
 #define OS_BSD_VM_OS_BSD_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -40,18 +38,6 @@
   return pthread_getspecific((pthread_key_t)index);
 }
 
-inline const char* os::file_separator() {
-  return "/";
-}
-
-inline const char* os::line_separator() {
-  return "\n";
-}
-
-inline const char* os::path_separator() {
-  return ":";
-}
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/src/os/linux/vm/attachListener_linux.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/linux/vm/attachListener_linux.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/src/os/linux/vm/os_linux.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/linux/vm/os_linux.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -36,6 +36,7 @@
 #include "memory/filemap.hpp"
 #include "mutex_linux.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "os_linux.inline.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
@@ -3790,12 +3791,10 @@
   return DontYieldALot;
 }
 
-void os::yield() {
+void os::naked_yield() {
   sched_yield();
 }
 
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
 ////////////////////////////////////////////////////////////////////////////////
 // thread priority support
 
@@ -5456,22 +5455,12 @@
   return abstime;
 }
 
-
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
-  for (;;) {
-    const int v = _Event;
-    guarantee((v == 0) || (v == 1), "invariant");
-    if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
-  }
-}
-
 void os::PlatformEvent::park() {       // AKA "down()"
   // Invariant: Only the thread associated with the Event/PlatformEvent
   // may call park().
   // TODO: assert that _Assoc != NULL or _Assoc == Self
+  assert(_nParked == 0, "invariant");
+
   int v;
   for (;;) {
       v = _Event;
@@ -5571,8 +5560,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -5800,10 +5788,9 @@
 }
 
 void Parker::unpark() {
-  int s, status;
-  status = pthread_mutex_lock(_mutex);
+  int status = pthread_mutex_lock(_mutex);
   assert(status == 0, "invariant");
-  s = _counter;
+  const int s = _counter;
   _counter = 1;
   if (s < 1) {
     // thread might be parked
--- a/src/os/linux/vm/os_linux.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/linux/vm/os_linux.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -315,7 +315,6 @@
     int  fired() { return _Event; }
     void park();
     void unpark();
-    int  TryPark();
     int  park(jlong millis); // relative timed-wait only
     void SetAssociation(Thread * a) { _Assoc = a; }
 };
--- a/src/os/linux/vm/os_linux.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/linux/vm/os_linux.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,8 +25,6 @@
 #ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
 #define OS_LINUX_VM_OS_LINUX_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -40,18 +38,6 @@
   return pthread_getspecific((pthread_key_t)index);
 }
 
-inline const char* os::file_separator() {
-  return "/";
-}
-
-inline const char* os::line_separator() {
-  return "\n";
-}
-
-inline const char* os::path_separator() {
-  return ":";
-}
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/src/os/posix/vm/os_posix.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/posix/vm/os_posix.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
+#include "runtime/os.hpp"
+
 #ifndef OS_POSIX_VM_OS_POSIX_HPP
 #define OS_POSIX_VM_OS_POSIX_HPP
+
+// File conventions
+static const char* file_separator() { return "/"; }
+static const char* line_separator() { return "\n"; }
+static const char* path_separator() { return ":"; }
+
 class Posix {
   friend class os;
 
--- a/src/os/solaris/vm/attachListener_solaris.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/solaris/vm/attachListener_solaris.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/src/os/solaris/vm/os_solaris.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/solaris/vm/os_solaris.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -37,6 +37,7 @@
 #include "mutex_solaris.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_solaris.hpp"
+#include "os_solaris.inline.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
 #include "prims/jvm_misc.hpp"
@@ -3172,20 +3173,14 @@
   }
 }
 
-// Caveat: Solaris os::yield() causes a thread-state transition whereas
-// the linux and win32 implementations do not.  This should be checked.
-
-void os::yield() {
-  // Yields to all threads with same or greater priority
-  os::sleep(Thread::current(), 0, false);
-}
-
 // Note that yield semantics are defined by the scheduling class to which
 // the thread currently belongs.  Typically, yield will _not yield to
 // other equal or higher priority threads that reside on the dispatch queues
 // of other CPUs.
 
-os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
+void os::naked_yield() {
+  thr_yield();
+}
 
 // Interface for setting lwp priorities.  If we are using T2 libthread,
 // which forces the use of BoundThreads or we manually set UseBoundThreads,
@@ -5439,20 +5434,11 @@
   return abstime;
 }
 
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
-  for (;;) {
-    const int v = _Event;
-    guarantee((v == 0) || (v == 1), "invariant");
-    if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
-  }
-}
-
 void os::PlatformEvent::park() {           // AKA: down()
   // Invariant: Only the thread associated with the Event/PlatformEvent
   // may call park().
+  assert(_nParked == 0, "invariant");
+
   int v;
   for (;;) {
       v = _Event;
@@ -5539,8 +5525,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -5744,10 +5729,9 @@
 }
 
 void Parker::unpark() {
-  int s, status;
-  status = os::Solaris::mutex_lock(_mutex);
+  int status = os::Solaris::mutex_lock(_mutex);
   assert(status == 0, "invariant");
-  s = _counter;
+  const int s = _counter;
   _counter = 1;
   status = os::Solaris::mutex_unlock(_mutex);
   assert(status == 0, "invariant");
--- a/src/os/solaris/vm/os_solaris.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/solaris/vm/os_solaris.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -332,7 +332,6 @@
     int  fired() { return _Event; }
     void park();
     int  park(jlong millis);
-    int  TryPark();
     void unpark();
 };
 
--- a/src/os/solaris/vm/os_solaris.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/solaris/vm/os_solaris.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,8 +25,6 @@
 #ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
 #define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -39,10 +37,6 @@
 #include <netdb.h>
 #include <setjmp.h>
 
-inline const char* os::file_separator() { return "/"; }
-inline const char* os::line_separator() { return "\n"; }
-inline const char* os::path_separator() { return ":"; }
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/src/os/windows/vm/decoder_windows.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/windows/vm/decoder_windows.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "prims/jvm.h"
 #include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
 #include "decoder_windows.hpp"
 
 WindowsDecoder::WindowsDecoder() {
--- a/src/os/windows/vm/os_windows.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/windows/vm/os_windows.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -40,6 +40,7 @@
 #include "mutex_windows.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_windows.hpp"
+#include "os_windows.inline.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
 #include "prims/jvm_misc.hpp"
@@ -3514,18 +3515,15 @@
 
 typedef BOOL (WINAPI * STTSignature)(void);
 
-os::YieldResult os::NakedYield() {
+void os::naked_yield() {
   // Use either SwitchToThread() or Sleep(0)
   // Consider passing back the return value from SwitchToThread().
   if (os::Kernel32Dll::SwitchToThreadAvailable()) {
-    return SwitchToThread() ? os::YIELD_SWITCHED : os::YIELD_NONEREADY;
+    SwitchToThread();
   } else {
     Sleep(0);
   }
-  return os::YIELD_UNKNOWN;
-}
-
-void os::yield() {  os::NakedYield(); }
+}
 
 // Win32 only gives you access to seven real priorities at a time,
 // so we compress Java's ten down to seven.  It would be better
@@ -4875,8 +4873,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
--- a/src/os/windows/vm/os_windows.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/windows/vm/os_windows.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,6 +29,11 @@
 // Information about the protection of the page at address '0' on this os.
 static bool zero_page_read_protected() { return true; }
 
+// File conventions
+static const char* file_separator() { return "\\"; }
+static const char* line_separator() { return "\r\n"; }
+static const char* path_separator() { return ";"; }
+
 class win32 {
   friend class os;
 
--- a/src/os/windows/vm/os_windows.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os/windows/vm/os_windows.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,13 +25,8 @@
 #ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
 #define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
-inline const char* os::file_separator()                { return "\\"; }
-inline const char* os::line_separator()                { return "\r\n"; }
-inline const char* os::path_separator()                { return ";"; }
 inline const char* os::dll_file_extension()            { return ".dll"; }
 
 inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;}
--- a/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -307,7 +307,7 @@
                // doesn't work for us. We use:
                ((NativeInstruction*)pc)->is_safepoint_poll()) {
         if (TraceTraps) {
-          tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
+          tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
         }
         stub = SharedRuntime::get_poll_stub(pc);
       }
@@ -316,7 +316,7 @@
       else if (sig == SIGTRAP && TrapBasedICMissChecks &&
                nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
         if (TraceTraps) {
-          tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
+          tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
         }
         stub = SharedRuntime::get_ic_miss_stub();
       }
@@ -325,7 +325,7 @@
       else if (sig == SIGTRAP && TrapBasedNullChecks &&
                nativeInstruction_at(pc)->is_sigtrap_null_check()) {
         if (TraceTraps) {
-          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
+          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
         }
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -335,7 +335,7 @@
                CodeCache::contains((void*) pc) &&
                !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
         if (TraceTraps) {
-          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc);
+          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
         }
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -345,7 +345,7 @@
       else if (sig == SIGTRAP && TrapBasedRangeChecks &&
                nativeInstruction_at(pc)->is_sigtrap_range_check()) {
         if (TraceTraps) {
-          tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
+          tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
         }
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -572,7 +572,7 @@
   st->cr();
 
   intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
-  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
+  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
   print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
   st->cr();
 
@@ -580,7 +580,7 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
+  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
   print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
   st->cr();
 }
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1997,7 +1997,13 @@
   if (!UseInlineCaches && is_loaded && code == Bytecodes::_invokevirtual
       && !target->can_be_statically_bound()) {
     // Find a vtable index if one is available
-    vtable_index = target->resolve_vtable_index(calling_klass, callee_holder);
+    // For arrays, callee_holder is Object. Resolving the call with
+    // Object would allow an illegal call to finalize() on an
+    // array. We use holder instead: illegal calls to finalize() won't
+    // be compiled as vtable calls (IC call resolution will catch the
+    // illegal call) and the few legal calls on array types won't be
+    // either.
+    vtable_index = target->resolve_vtable_index(calling_klass, holder);
   }
 #endif
 
--- a/src/share/vm/ci/ciConstantPoolCache.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/ci/ciConstantPoolCache.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -38,7 +38,7 @@
                                  int expected_size) {
   _elements =
     new (arena) GrowableArray<void*>(arena, expected_size, 0, 0);
-  _keys = new (arena) GrowableArray<intptr_t>(arena, expected_size, 0, 0);
+  _keys = new (arena) GrowableArray<int>(arena, expected_size, 0, 0);
 }
 
 // ------------------------------------------------------------------
--- a/src/share/vm/ci/ciConstantPoolCache.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/ci/ciConstantPoolCache.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -35,7 +35,7 @@
 // Usage note: this klass has nothing to do with ConstantPoolCache*.
 class ciConstantPoolCache : public ResourceObj {
 private:
-  GrowableArray<intptr_t>*   _keys;
+  GrowableArray<int>*   _keys;
   GrowableArray<void*>* _elements;
 
   int find(int index);
--- a/src/share/vm/classfile/classFileParser.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/classfile/classFileParser.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -4590,8 +4590,9 @@
             Exceptions::fthrow(
               THREAD_AND_LOCATION,
               vmSymbols::java_lang_VerifyError(),
-              "class %s overrides final method %s.%s",
+              "class %s overrides final method %s.%s%s",
               this_klass->external_name(),
+              super_m->method_holder()->external_name(),
               name->as_C_string(),
               signature->as_C_string()
             );
--- a/src/share/vm/classfile/classLoader.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/classfile/classLoader.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -52,6 +52,7 @@
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
+#include "runtime/os.hpp"
 #include "runtime/threadCritical.hpp"
 #include "runtime/timer.hpp"
 #include "services/management.hpp"
@@ -59,22 +60,6 @@
 #include "utilities/events.hpp"
 #include "utilities/hashtable.hpp"
 #include "utilities/hashtable.inline.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 
 // Entry points in zip.dll for loading zip/jar file entries
 
--- a/src/share/vm/classfile/classLoaderData.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/classfile/classLoaderData.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -579,6 +579,7 @@
 // GC root of class loader data created.
 ClassLoaderData* ClassLoaderDataGraph::_head = NULL;
 ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
+ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL;
 ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
 
 bool ClassLoaderDataGraph::_should_purge = false;
@@ -707,7 +708,9 @@
 
 void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) {
   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
-  for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
+  // Only walk the head until any clds not purged from prior unloading
+  // (CMS doesn't purge right away).
+  for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) {
     cld->classes_do(f);
   }
 }
@@ -765,6 +768,11 @@
   ClassLoaderData* data = _head;
   ClassLoaderData* prev = NULL;
   bool seen_dead_loader = false;
+
+  // Save previous _unloading pointer for CMS which may add to unloading list before
+  // purging and we don't want to rewalk the previously unloaded class loader data.
+  _saved_unloading = _unloading;
+
   // mark metadata seen on the stack and code cache so we can delete
   // unneeded entries.
   bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();
--- a/src/share/vm/classfile/classLoaderData.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/classfile/classLoaderData.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -66,6 +66,7 @@
   static ClassLoaderData* _unloading;
   // CMS support.
   static ClassLoaderData* _saved_head;
+  static ClassLoaderData* _saved_unloading;
   static bool _should_purge;
 
   static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
--- a/src/share/vm/classfile/javaClasses.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/classfile/javaClasses.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -618,6 +618,8 @@
       assert(comp_mirror.not_null(), "must have a mirror");
 
       // Two-way link between the array klass and its component mirror:
+      // (array_klass) k -> mirror -> component_mirror -> array_klass -> k
+      set_component_mirror(mirror(), comp_mirror());
       ArrayKlass::cast(k())->set_component_mirror(comp_mirror());
       set_array_klass(comp_mirror(), k());
     } else {
@@ -679,6 +681,16 @@
   java_class->obj_field_put(_protection_domain_offset, pd);
 }
 
+void java_lang_Class::set_component_mirror(oop java_class, oop comp_mirror) {
+  if (_component_mirror_offset != 0) {
+    java_class->obj_field_put(_component_mirror_offset, comp_mirror);
+  }
+}
+oop java_lang_Class::component_mirror(oop java_class) {
+  assert(_component_mirror_offset != 0, "must be set");
+  return java_class->obj_field(_component_mirror_offset);
+}
+
 oop java_lang_Class::init_lock(oop java_class) {
   assert(_init_lock_offset != 0, "must be set");
   return java_class->obj_field(_init_lock_offset);
@@ -875,6 +887,10 @@
                  klass_oop, vmSymbols::classLoader_name(),
                  vmSymbols::classloader_signature());
 
+  compute_optional_offset(_component_mirror_offset,
+                 klass_oop, vmSymbols::componentType_name(),
+                 vmSymbols::class_signature());
+
   CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
 }
 
@@ -3097,6 +3113,7 @@
 int java_lang_Class::_static_oop_field_count_offset;
 int java_lang_Class::_class_loader_offset;
 int java_lang_Class::_protection_domain_offset;
+int java_lang_Class::_component_mirror_offset;
 int java_lang_Class::_init_lock_offset;
 int java_lang_Class::_signers_offset;
 GrowableArray<Klass*>* java_lang_Class::_fixup_mirror_list = NULL;
--- a/src/share/vm/classfile/javaClasses.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/classfile/javaClasses.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -241,6 +241,7 @@
   static int _init_lock_offset;
   static int _signers_offset;
   static int _class_loader_offset;
+  static int _component_mirror_offset;
 
   static bool offsets_computed;
   static int classRedefinedCount_offset;
@@ -250,6 +251,7 @@
   static void set_init_lock(oop java_class, oop init_lock);
   static void set_protection_domain(oop java_class, oop protection_domain);
   static void set_class_loader(oop java_class, oop class_loader);
+  static void set_component_mirror(oop java_class, oop comp_mirror);
   static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS);
  public:
   static void compute_offsets();
@@ -291,6 +293,7 @@
   // Support for embedded per-class oops
   static oop  protection_domain(oop java_class);
   static oop  init_lock(oop java_class);
+  static oop  component_mirror(oop java_class);
   static objArrayOop  signers(oop java_class);
   static void set_signers(oop java_class, objArrayOop signers);
 
--- a/src/share/vm/classfile/vmSymbols.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -573,6 +573,7 @@
   template(serializeAgentPropertiesToByteArray_name,   "serializeAgentPropertiesToByteArray")                     \
   template(classRedefinedCount_name,                   "classRedefinedCount")                                     \
   template(classLoader_name,                           "classLoader")                                             \
+  template(componentType_name,                         "componentType")                                           \
                                                                                                                   \
   /* trace signatures */                                                                                          \
   TRACE_TEMPLATES(template)                                                                                       \
--- a/src/share/vm/code/stubs.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/code/stubs.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,21 +27,6 @@
 
 #include "asm/codeBuffer.hpp"
 #include "memory/allocation.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // The classes in this file provide a simple framework for the
 // management of little pieces of machine code - or stubs -
--- a/src/share/vm/code/vtableStubs.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/code/vtableStubs.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
 #include "compiler/disassembler.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
@@ -62,6 +63,7 @@
    // If changing the name, update the other file accordingly.
     BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
     if (blob == NULL) {
+      CompileBroker::handle_full_code_cache();
       return NULL;
     }
     _chunk = blob->content_begin();
--- a/src/share/vm/compiler/compileBroker.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/compiler/compileBroker.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1048,7 +1048,7 @@
   }
 
   // Let go of Threads_lock before yielding
-  os::yield(); // make sure that the compiler thread is started early (especially helpful on SOLARIS)
+  os::naked_yield(); // make sure that the compiler thread is started early (especially helpful on SOLARIS)
 
   return compiler_thread;
 }
--- a/src/share/vm/compiler/disassembler.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/compiler/disassembler.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -30,6 +30,7 @@
 #include "memory/cardTableModRefBS.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
+#include "runtime/os.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
 #ifdef TARGET_ARCH_x86
--- a/src/share/vm/compiler/disassembler.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/compiler/disassembler.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,21 +27,6 @@
 
 #include "asm/codeBuffer.hpp"
 #include "runtime/globals.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 class decode_env;
 
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,6 +29,7 @@
 #include "memory/sharedHeap.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/mutex.hpp"
+#include "runtime/orderAccess.inline.hpp"
 #include "runtime/vmThread.hpp"
 
 template <>
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 #include "memory/memRegion.hpp"
 #include "oops/markOop.hpp"
 #include "runtime/mutex.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/ostream.hpp"
--- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,21 +30,6 @@
 #include "runtime/os.hpp"
 #include "utilities/bitMap.inline.hpp"
 #include "services/memTracker.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 bool
 ParMarkBitMap::initialize(MemRegion covered_region)
--- a/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -26,21 +26,6 @@
 #include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
 #include "runtime/os.hpp"
 #include "runtime/virtualspace.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@
     Threads::add(res);
     Thread::start(res);
   }
-  os::yield(); // This seems to help with initial start-up of SLT
+  os::naked_yield(); // This seems to help with initial start-up of SLT
   return res;
 }
 
--- a/src/share/vm/interpreter/bytecodeInterpreter.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2783,11 +2783,11 @@
       if (TraceExceptions) {
         ttyLocker ttyl;
         ResourceMark rm;
-        tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), (void*)except_oop());
+        tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop()));
         tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
         tty->print_cr(" at bci %d, continuing at %d for thread " INTPTR_FORMAT,
-                      istate->bcp() - (intptr_t)METHOD->code_base(),
-                      continuation_bci, THREAD);
+                      (int)(istate->bcp() - METHOD->code_base()),
+                      (int)continuation_bci, p2i(THREAD));
       }
       // for AbortVMOnException flag
       NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
@@ -2799,11 +2799,11 @@
     if (TraceExceptions) {
       ttyLocker ttyl;
       ResourceMark rm;
-      tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), (void*)except_oop());
+      tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop()));
       tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
       tty->print_cr(" at bci %d, unwinding for thread " INTPTR_FORMAT,
-                    istate->bcp() - (intptr_t)METHOD->code_base(),
-                    THREAD);
+                    (int)(istate->bcp() - METHOD->code_base()),
+                    p2i(THREAD));
     }
     // for AbortVMOnException flag
     NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
@@ -3402,7 +3402,7 @@
   tty->print_cr("osr._osr_buf: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_buf);
   tty->print_cr("osr._osr_entry: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_entry);
   tty->print_cr("prev_link: " INTPTR_FORMAT, (uintptr_t) this->_prev_link);
-  tty->print_cr("native_mirror: " INTPTR_FORMAT, (void*) this->_oop_temp);
+  tty->print_cr("native_mirror: " INTPTR_FORMAT, (uintptr_t) this->_oop_temp);
   tty->print_cr("stack_base: " INTPTR_FORMAT, (uintptr_t) this->_stack_base);
   tty->print_cr("stack_limit: " INTPTR_FORMAT, (uintptr_t) this->_stack_limit);
   tty->print_cr("monitor_base: " INTPTR_FORMAT, (uintptr_t) this->_monitor_base);
--- a/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,11 +86,11 @@
                   " \t-> " PTR_FORMAT "(%d)",                                  \
                 (int) THREAD->osthread()->thread_id(),                         \
                 BCI(),                                                         \
-                MDX(),                                                         \
+                p2i(MDX()),                                                    \
                 (MDX() == NULL                                                 \
                  ? 0                                                           \
                  : istate->method()->method_data()->dp_to_di((address)MDX())), \
-                mdx,                                                           \
+                p2i(mdx),                                                      \
                 istate->method()->method_data()->dp_to_di((address)mdx)        \
                 );                                                             \
   };                                                                           \
@@ -107,7 +107,7 @@
     MethodData *md = istate->method()->method_data();                          \
     tty->cr();                                                                 \
     tty->print("method data at mdx " PTR_FORMAT "(0) for",                     \
-               md->data_layout_at(md->bci_to_di(0)));                          \
+               p2i(md->data_layout_at(md->bci_to_di(0))));                     \
     istate->method()->print_short_name(tty);                                   \
     tty->cr();                                                                 \
     if (md != NULL) {                                                          \
@@ -115,7 +115,7 @@
       address mdx = (address) MDX();                                           \
       if (mdx != NULL) {                                                       \
         tty->print_cr("current mdx " PTR_FORMAT "(%d)",                        \
-                      mdx,                                                     \
+                      p2i(mdx),                                                \
                       istate->method()->method_data()->dp_to_di(mdx));         \
       }                                                                        \
     } else {                                                                   \
--- a/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1093,6 +1093,7 @@
 address SignatureHandlerLibrary::set_handler_blob() {
   BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
   if (handler_blob == NULL) {
+    CompileBroker::handle_full_code_cache();
     return NULL;
   }
   address handler = handler_blob->code_begin();
--- a/src/share/vm/interpreter/oopMapCache.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/interpreter/oopMapCache.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -180,7 +180,7 @@
   }
 }
 
-bool InterpreterOopMap::is_empty() {
+bool InterpreterOopMap::is_empty() const {
   bool result = _method == NULL;
   assert(_method != NULL || (_bci == 0 &&
     (_mask_size == 0 || _mask_size == USHRT_MAX) &&
@@ -196,7 +196,7 @@
   for (int i = 0; i < N; i++) _bit_mask[i] = 0;
 }
 
-void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) {
+void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) const {
   int n = number_of_entries();
   int word_index = 0;
   uintptr_t value = 0;
@@ -238,7 +238,7 @@
 #endif
 
 
-void InterpreterOopMap::print() {
+void InterpreterOopMap::print() const {
   int n = number_of_entries();
   tty->print("oop map for ");
   method()->print_value();
@@ -469,7 +469,7 @@
   }
 }
 
-inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) {
+inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) const {
   // We use method->code_size() rather than method->identity_hash() below since
   // the mark may not be present if a pointer to the method is already reversed.
   return   ((unsigned int) bci)
@@ -522,7 +522,7 @@
 
 void OopMapCache::lookup(methodHandle method,
                          int bci,
-                         InterpreterOopMap* entry_for) {
+                         InterpreterOopMap* entry_for) const {
   MutexLocker x(&_mut);
 
   OopMapCacheEntry* entry = NULL;
--- a/src/share/vm/interpreter/oopMapCache.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/interpreter/oopMapCache.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -101,32 +101,31 @@
 
   // access methods
   Method*        method() const                  { return _method; }
-  void           set_method(Method* v)         { _method = v; }
+  void           set_method(Method* v)           { _method = v; }
   int            bci() const                     { return _bci; }
   void           set_bci(int v)                  { _bci = v; }
   int            mask_size() const               { return _mask_size; }
   void           set_mask_size(int v)            { _mask_size = v; }
-  int            number_of_entries() const       { return mask_size() / bits_per_entry; }
   // Test bit mask size and return either the in-line bit mask or allocated
   // bit mask.
-  uintptr_t*  bit_mask()                         { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
+  uintptr_t*  bit_mask() const                   { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
 
   // return the word size of_bit_mask.  mask_size() <= 4 * MAX_USHORT
-  size_t mask_word_size() {
+  size_t mask_word_size() const {
     return (mask_size() + BitsPerWord - 1) / BitsPerWord;
   }
 
-  uintptr_t entry_at(int offset)            { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
+  uintptr_t entry_at(int offset) const           { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
 
-  void set_expression_stack_size(int sz)    { _expression_stack_size = sz; }
+  void set_expression_stack_size(int sz)         { _expression_stack_size = sz; }
 
 #ifdef ENABLE_ZAP_DEAD_LOCALS
-  bool is_dead(int offset)                       { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
+  bool is_dead(int offset) const                 { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
 #endif
 
   // Lookup
-  bool match(methodHandle method, int bci)       { return _method == method() && _bci == bci; }
-  bool is_empty();
+  bool match(methodHandle method, int bci) const { return _method == method() && _bci == bci; }
+  bool is_empty() const;
 
   // Initialization
   void initialize();
@@ -141,12 +140,13 @@
   // in-line), allocate the space from a Resource area.
   void resource_copy(OopMapCacheEntry* from);
 
-  void iterate_oop(OffsetClosure* oop_closure);
-  void print();
+  void iterate_oop(OffsetClosure* oop_closure) const;
+  void print() const;
 
-  bool is_oop  (int offset)                      { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
+  int number_of_entries() const                  { return mask_size() / bits_per_entry; }
+  bool is_oop (int offset) const                 { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
 
-  int expression_stack_size()                    { return _expression_stack_size; }
+  int expression_stack_size() const              { return _expression_stack_size; }
 
 #ifdef ENABLE_ZAP_DEAD_LOCALS
   void iterate_all(OffsetClosure* oop_closure, OffsetClosure* value_closure, OffsetClosure* dead_closure);
@@ -161,10 +161,10 @@
 
   OopMapCacheEntry* _array;
 
-  unsigned int hash_value_for(methodHandle method, int bci);
+  unsigned int hash_value_for(methodHandle method, int bci) const;
   OopMapCacheEntry* entry_at(int i) const;
 
-  Mutex _mut;
+  mutable Mutex _mut;
 
   void flush();
 
@@ -177,7 +177,7 @@
 
   // Returns the oopMap for (method, bci) in parameter "entry".
   // Returns false if an oop map was not found.
-  void lookup(methodHandle method, int bci, InterpreterOopMap* entry);
+  void lookup(methodHandle method, int bci, InterpreterOopMap* entry) const;
 
   // Compute an oop map without updating the cache or grabbing any locks (for debugging)
   static void compute_one_oop_map(methodHandle method, int bci, InterpreterOopMap* entry);
--- a/src/share/vm/memory/allocation.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/memory/allocation.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -36,22 +36,6 @@
 #include "services/memTracker.hpp"
 #include "utilities/ostream.hpp"
 
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 void* StackObj::operator new(size_t size)     throw() { ShouldNotCallThis(); return 0; }
 void  StackObj::operator delete(void* p)              { ShouldNotCallThis(); }
 void* StackObj::operator new [](size_t size)  throw() { ShouldNotCallThis(); return 0; }
--- a/src/share/vm/memory/gcLocker.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/memory/gcLocker.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,19 +29,6 @@
 #include "memory/genCollectedHeap.hpp"
 #include "memory/universe.hpp"
 #include "oops/oop.hpp"
-#include "runtime/thread.inline.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // The direct lock/unlock calls do not force a collection if an unlock
 // decrements the count to zero. Avoid calling these if at all possible.
--- a/src/share/vm/memory/metaspaceShared.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/memory/metaspaceShared.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -35,6 +35,7 @@
 #include "memory/metaspaceShared.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/os.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/vm_operations.hpp"
 #include "runtime/vmThread.hpp"
--- a/src/share/vm/oops/oopsHierarchy.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/oops/oopsHierarchy.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -124,7 +124,7 @@
   operator oopDesc* () const volatile { return obj(); }
   operator intptr_t* () const         { return (intptr_t*)obj(); }
   operator PromotedObject* () const   { return (PromotedObject*)obj(); }
-  operator markOop () const           { return markOop(obj()); }
+  operator markOop () const volatile  { return markOop(obj()); }
   operator address   () const         { return (address)obj(); }
 
   // from javaCalls.cpp
--- a/src/share/vm/opto/callGenerator.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/opto/callGenerator.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -871,8 +871,11 @@
           Node*             receiver_node = kit.argument(0);
           const TypeOopPtr* receiver_type = gvn.type(receiver_node)->isa_oopptr();
           // call_does_dispatch and vtable_index are out-parameters.  They might be changed.
-          target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type,
-                                            is_virtual,
+          // optimize_virtual_call() takes 2 different holder
+          // arguments for a corner case that doesn't apply here (see
+          // Parse::do_call())
+          target = C->optimize_virtual_call(caller, jvms->bci(), klass, klass,
+                                            target, receiver_type, is_virtual,
                                             call_does_dispatch, vtable_index);  // out-parameters
           // We lack profiling at this call but type speculation may
           // provide us with a type
--- a/src/share/vm/opto/compile.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/opto/compile.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,6 +29,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "code/exceptionHandlerTable.hpp"
 #include "code/nmethod.hpp"
+#include "compiler/compileBroker.hpp"
 #include "compiler/compileLog.hpp"
 #include "compiler/disassembler.hpp"
 #include "compiler/oopMap.hpp"
@@ -555,6 +556,7 @@
     if (scratch_buffer_blob() == NULL) {
       // Let CompilerBroker disable further compilations.
       record_failure("Not enough space for scratch buffer in CodeCache");
+      CompileBroker::handle_full_code_cache();
       return;
     }
   }
--- a/src/share/vm/opto/compile.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/opto/compile.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -852,8 +852,8 @@
 
   // Helper functions to identify inlining potential at call-site
   ciMethod* optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
-                                  ciMethod* callee, const TypeOopPtr* receiver_type,
-                                  bool is_virtual,
+                                  ciKlass* holder, ciMethod* callee,
+                                  const TypeOopPtr* receiver_type, bool is_virtual,
                                   bool &call_does_dispatch, int &vtable_index);
   ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass,
                               ciMethod* callee, const TypeOopPtr* receiver_type);
--- a/src/share/vm/opto/doCall.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/opto/doCall.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -468,8 +468,14 @@
     Node* receiver_node             = stack(sp() - nargs);
     const TypeOopPtr* receiver_type = _gvn.type(receiver_node)->isa_oopptr();
     // call_does_dispatch and vtable_index are out-parameters.  They might be changed.
-    callee = C->optimize_virtual_call(method(), bci(), klass, orig_callee, receiver_type,
-                                      is_virtual,
+    // For arrays, klass below is Object. When vtable calls are used,
+    // resolving the call with Object would allow an illegal call to
+    // finalize() on an array. We use holder instead: illegal calls to
+    // finalize() won't be compiled as vtable calls (IC call
+    // resolution will catch the illegal call) and the few legal calls
+    // on array types won't be either.
+    callee = C->optimize_virtual_call(method(), bci(), klass, holder, orig_callee,
+                                      receiver_type, is_virtual,
                                       call_does_dispatch, vtable_index);  // out-parameters
     speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL;
   }
@@ -940,8 +946,8 @@
 
 
 ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
-                                         ciMethod* callee, const TypeOopPtr* receiver_type,
-                                         bool is_virtual,
+                                         ciKlass* holder, ciMethod* callee,
+                                         const TypeOopPtr* receiver_type, bool is_virtual,
                                          bool& call_does_dispatch, int& vtable_index) {
   // Set default values for out-parameters.
   call_does_dispatch = true;
@@ -956,7 +962,7 @@
     call_does_dispatch = false;
   } else if (!UseInlineCaches && is_virtual && callee->is_loaded()) {
     // We can make a vtable call at this site
-    vtable_index = callee->resolve_vtable_index(caller->holder(), klass);
+    vtable_index = callee->resolve_vtable_index(caller->holder(), holder);
   }
   return callee;
 }
@@ -979,8 +985,10 @@
   ciInstanceKlass* actual_receiver = klass;
   if (receiver_type != NULL) {
     // Array methods are all inherited from Object, and are monomorphic.
+    // finalize() call on array is not allowed.
     if (receiver_type->isa_aryptr() &&
-        callee->holder() == env()->Object_klass()) {
+        callee->holder() == env()->Object_klass() &&
+        callee->name() != ciSymbol::finalize_method_name()) {
       return callee;
     }
 
--- a/src/share/vm/opto/output.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/opto/output.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1163,6 +1163,7 @@
   // Have we run out of code space?
   if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
     C->record_failure("CodeCache is full");
+    CompileBroker::handle_full_code_cache();
     return NULL;
   }
   // Configure the code buffer.
@@ -1487,6 +1488,7 @@
       cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size);
       if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
         C->record_failure("CodeCache is full");
+        CompileBroker::handle_full_code_cache();
         return;
       }
 
@@ -1643,6 +1645,7 @@
   // One last check for failed CodeBuffer::expand:
   if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
     C->record_failure("CodeCache is full");
+    CompileBroker::handle_full_code_cache();
     return;
   }
 
--- a/src/share/vm/opto/parse.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/opto/parse.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -557,8 +557,9 @@
 
   float   dynamic_branch_prediction(float &cnt);
   float   branch_prediction(float &cnt, BoolTest::mask btest, int target_bci);
-  bool    seems_never_taken(float prob);
-  bool    seems_stable_comparison(BoolTest::mask btest, Node* c);
+  bool    seems_never_taken(float prob) const;
+  bool    path_is_suitable_for_uncommon_trap(float prob) const;
+  bool    seems_stable_comparison() const;
 
   void    do_ifnull(BoolTest::mask btest, Node* c);
   void    do_if(BoolTest::mask btest, Node* c);
--- a/src/share/vm/opto/parse2.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/opto/parse2.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -886,7 +886,7 @@
 // some branches (e.g., _213_javac.Assembler.eliminate) validly produce
 // very small but nonzero probabilities, which if confused with zero
 // counts would keep the program recompiling indefinitely.
-bool Parse::seems_never_taken(float prob) {
+bool Parse::seems_never_taken(float prob) const {
   return prob < PROB_MIN;
 }
 
@@ -898,7 +898,7 @@
 // already acting in a stable fashion.  If the comparison
 // seems stable, we will put an expensive uncommon trap
 // on the untaken path.
-bool Parse::seems_stable_comparison(BoolTest::mask btest, Node* cmp) {
+bool Parse::seems_stable_comparison() const {
   if (C->too_many_traps(method(), bci(), Deoptimization::Reason_unstable_if)) {
     return false;
   }
@@ -1127,6 +1127,14 @@
   }
 }
 
+bool Parse::path_is_suitable_for_uncommon_trap(float prob) const {
+  // Don't want to speculate on uncommon traps when running with -Xcomp
+  if (!UseInterpreter) {
+    return false;
+  }
+  return (seems_never_taken(prob) && seems_stable_comparison());
+}
+
 //----------------------------adjust_map_after_if------------------------------
 // Adjust the JVM state to reflect the result of taking this path.
 // Basically, it means inspecting the CmpNode controlling this
@@ -1140,7 +1148,7 @@
 
   bool is_fallthrough = (path == successor_for_bci(iter().next_bci()));
 
-  if (seems_never_taken(prob) && seems_stable_comparison(btest, c)) {
+  if (path_is_suitable_for_uncommon_trap(prob)) {
     repush_if_args();
     uncommon_trap(Deoptimization::Reason_unstable_if,
                   Deoptimization::Action_reinterpret,
--- a/src/share/vm/prims/jni.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/prims/jni.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -80,18 +80,6 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 static jint CurrentVersion = JNI_VERSION_1_8;
 
@@ -3337,7 +3325,7 @@
     directBufferSupportInitializeEnded = 1;
   } else {
     while (!directBufferSupportInitializeEnded && !directBufferSupportInitializeFailed) {
-      os::yield();
+      os::naked_yield();
     }
   }
 
--- a/src/share/vm/prims/jvm.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/prims/jvm.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -53,7 +53,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
 #include "runtime/orderAccess.inline.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/thread.inline.hpp"
@@ -3042,7 +3042,7 @@
   if (ConvertYieldToSleep) {
     os::sleep(thread, MinSleepInterval, false);
   } else {
-    os::yield();
+    os::naked_yield();
   }
 JVM_END
 
@@ -3072,7 +3072,7 @@
     // It appears that in certain GUI contexts, it may be beneficial to do a short sleep
     // for SOLARIS
     if (ConvertSleepToYield) {
-      os::yield();
+      os::naked_yield();
     } else {
       ThreadState old_state = thread->osthread()->get_state();
       thread->osthread()->set_state(SLEEPING);
--- a/src/share/vm/prims/jvmtiExport.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/prims/jvmtiExport.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -47,6 +47,7 @@
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/objectMonitor.hpp"
 #include "runtime/objectMonitor.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/vframe.hpp"
 #include "services/attachListener.hpp"
--- a/src/share/vm/prims/nativeLookup.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/prims/nativeLookup.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -41,21 +41,6 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "utilities/macros.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 
 static void mangle_name_on(outputStream* st, Symbol* name, int begin, int end) {
--- a/src/share/vm/runtime/arguments.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/arguments.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -37,26 +37,12 @@
 #include "runtime/arguments.hpp"
 #include "runtime/globals_extension.hpp"
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "services/management.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/taskqueue.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
--- a/src/share/vm/runtime/arguments.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/arguments.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 #define SHARE_VM_RUNTIME_ARGUMENTS_HPP
 
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "runtime/perfData.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/top.hpp"
--- a/src/share/vm/runtime/atomic.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/atomic.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,23 +23,6 @@
  */
 
 #include "precompiled.hpp"
-#include "runtime/atomic.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 #include "runtime/atomic.inline.hpp"
 
 jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
--- a/src/share/vm/runtime/frame.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/frame.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -40,6 +40,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/monitorChunk.hpp"
+#include "runtime/os.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
--- a/src/share/vm/runtime/globals.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/globals.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1130,29 +1130,30 @@
           "Use LWP-based instead of libthread-based synchronization "       \
           "(SPARC only)")                                                   \
                                                                             \
-  product(ccstr, SyncKnobs, NULL,                                           \
-          "(Unstable) Various monitor synchronization tunables")            \
-                                                                            \
-  product(intx, EmitSync, 0,                                                \
-          "(Unsafe, Unstable) "                                             \
-          "Control emission of inline sync fast-path code")                 \
+  experimental(ccstr, SyncKnobs, NULL,                                      \
+               "(Unstable) Various monitor synchronization tunables")       \
+                                                                            \
+  experimental(intx, EmitSync, 0,                                           \
+               "(Unsafe, Unstable) "                                        \
+               "Control emission of inline sync fast-path code")            \
                                                                             \
   product(intx, MonitorBound, 0, "Bound Monitor population")                \
                                                                             \
   product(bool, MonitorInUseLists, false, "Track Monitors for Deflation")   \
                                                                             \
-  product(intx, SyncFlags, 0, "(Unsafe, Unstable) Experimental Sync flags") \
-                                                                            \
-  product(intx, SyncVerbose, 0, "(Unstable)")                               \
-                                                                            \
-  product(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)")                    \
-                                                                            \
-  product(intx, hashCode, 5,                                                \
-          "(Unstable) select hashCode generation algorithm")                \
-                                                                            \
-  product(intx, WorkAroundNPTLTimedWaitHang, 1,                             \
-          "(Unstable, Linux-specific) "                                     \
-          "avoid NPTL-FUTEX hang pthread_cond_timedwait")                   \
+  experimental(intx, SyncFlags, 0, "(Unsafe, Unstable) "                    \
+               "Experimental Sync flags")                                   \
+                                                                            \
+  experimental(intx, SyncVerbose, 0, "(Unstable)")                          \
+                                                                            \
+  experimental(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)")               \
+                                                                            \
+  experimental(intx, hashCode, 5,                                           \
+               "(Unstable) select hashCode generation algorithm")           \
+                                                                            \
+  experimental(intx, WorkAroundNPTLTimedWaitHang, 1,                        \
+               "(Unstable, Linux-specific) "                                \
+               "avoid NPTL-FUTEX hang pthread_cond_timedwait")              \
                                                                             \
   product(bool, FilterSpuriousWakeups, true,                                \
           "When true prevents OS-level spurious, or premature, wakeups "    \
--- a/src/share/vm/runtime/handles.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/handles.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,18 +29,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/thread.inline.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/src/share/vm/runtime/icache.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/icache.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -34,6 +34,9 @@
   ResourceMark rm;
 
   BufferBlob* b = BufferBlob::create("flush_icache_stub", ICache::stub_size);
+  if (b == NULL) {
+    vm_exit_out_of_memory(ICache::stub_size, OOM_MALLOC_ERROR, "CodeCache: no space for flush_icache_stub");
+  }
   CodeBuffer c(b);
 
   ICacheStubGenerator g(&c);
--- a/src/share/vm/runtime/interfaceSupport.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/interfaceSupport.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -32,6 +32,7 @@
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/orderAccess.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/threadLocalStorage.hpp"
 #include "runtime/vframe.hpp"
 #include "utilities/preserveException.hpp"
--- a/src/share/vm/runtime/javaCalls.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/javaCalls.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
--- a/src/share/vm/runtime/mutex.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/mutex.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -488,7 +487,6 @@
   for (;;) {
     assert(_OnDeck == ESelf, "invariant");
     if (TrySpin(Self)) break;
-    // CONSIDER: if ESelf->TryPark() && TryLock() break ...
     // It's probably wise to spin only if we *actually* blocked
     // CONSIDER: check the lockbyte, if it remains set then
     // preemptively drain the cxq into the EntryList.
--- a/src/share/vm/runtime/mutexLocker.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/mutexLocker.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/mutexLocker.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadLocalStorage.hpp"
--- a/src/share/vm/runtime/mutexLocker.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/mutexLocker.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -27,21 +27,6 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/mutex.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // Mutexes used in the VM.
 
--- a/src/share/vm/runtime/objectMonitor.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/objectMonitor.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -43,24 +43,12 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 #if defined(__GNUC__) && !defined(IA64) && !defined(PPC64)
   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
-  #define ATTR __attribute__((noinline))
+  #define NOINLINE __attribute__((noinline))
 #else
-  #define ATTR
+  #define NOINLINE
 #endif
 
 
@@ -115,38 +103,39 @@
 // The knob* variables are effectively final.  Once set they should
 // never be modified hence.  Consider using __read_mostly with GCC.
 
-int ObjectMonitor::Knob_Verbose    = 0;
-int ObjectMonitor::Knob_SpinLimit  = 5000;    // derived by an external tool -
-static int Knob_LogSpins           = 0;       // enable jvmstat tally for spins
-static int Knob_HandOff            = 0;
-static int Knob_ReportSettings     = 0;
+int ObjectMonitor::Knob_Verbose     = 0;
+int ObjectMonitor::Knob_VerifyInUse = 0;
+int ObjectMonitor::Knob_SpinLimit   = 5000;    // derived by an external tool -
+static int Knob_LogSpins            = 0;       // enable jvmstat tally for spins
+static int Knob_HandOff             = 0;
+static int Knob_ReportSettings      = 0;
 
-static int Knob_SpinBase           = 0;       // Floor AKA SpinMin
-static int Knob_SpinBackOff        = 0;       // spin-loop backoff
-static int Knob_CASPenalty         = -1;      // Penalty for failed CAS
-static int Knob_OXPenalty          = -1;      // Penalty for observed _owner change
-static int Knob_SpinSetSucc        = 1;       // spinners set the _succ field
-static int Knob_SpinEarly          = 1;
-static int Knob_SuccEnabled        = 1;       // futile wake throttling
-static int Knob_SuccRestrict       = 0;       // Limit successors + spinners to at-most-one
-static int Knob_MaxSpinners        = -1;      // Should be a function of # CPUs
-static int Knob_Bonus              = 100;     // spin success bonus
-static int Knob_BonusB             = 100;     // spin success bonus
-static int Knob_Penalty            = 200;     // spin failure penalty
-static int Knob_Poverty            = 1000;
-static int Knob_SpinAfterFutile    = 1;       // Spin after returning from park()
-static int Knob_FixedSpin          = 0;
-static int Knob_OState             = 3;       // Spinner checks thread state of _owner
-static int Knob_UsePause           = 1;
-static int Knob_ExitPolicy         = 0;
-static int Knob_PreSpin            = 10;      // 20-100 likely better
-static int Knob_ResetEvent         = 0;
-static int BackOffMask             = 0;
+static int Knob_SpinBase            = 0;       // Floor AKA SpinMin
+static int Knob_SpinBackOff         = 0;       // spin-loop backoff
+static int Knob_CASPenalty          = -1;      // Penalty for failed CAS
+static int Knob_OXPenalty           = -1;      // Penalty for observed _owner change
+static int Knob_SpinSetSucc         = 1;       // spinners set the _succ field
+static int Knob_SpinEarly           = 1;
+static int Knob_SuccEnabled         = 1;       // futile wake throttling
+static int Knob_SuccRestrict        = 0;       // Limit successors + spinners to at-most-one
+static int Knob_MaxSpinners         = -1;      // Should be a function of # CPUs
+static int Knob_Bonus               = 100;     // spin success bonus
+static int Knob_BonusB              = 100;     // spin success bonus
+static int Knob_Penalty             = 200;     // spin failure penalty
+static int Knob_Poverty             = 1000;
+static int Knob_SpinAfterFutile     = 1;       // Spin after returning from park()
+static int Knob_FixedSpin           = 0;
+static int Knob_OState              = 3;       // Spinner checks thread state of _owner
+static int Knob_UsePause            = 1;
+static int Knob_ExitPolicy          = 0;
+static int Knob_PreSpin             = 10;      // 20-100 likely better
+static int Knob_ResetEvent          = 0;
+static int BackOffMask              = 0;
 
-static int Knob_FastHSSEC          = 0;
-static int Knob_MoveNotifyee       = 2;       // notify() - disposition of notifyee
-static int Knob_QMode              = 0;       // EntryList-cxq policy - queue discipline
-static volatile int InitDone       = 0;
+static int Knob_FastHSSEC           = 0;
+static int Knob_MoveNotifyee        = 2;       // notify() - disposition of notifyee
+static int Knob_QMode               = 0;       // EntryList-cxq policy - queue discipline
+static volatile int InitDone        = 0;
 
 #define TrySpin TrySpin_VaryDuration
 
@@ -211,7 +200,7 @@
 //   on EntryList|cxq.  That is, spinning relieves contention on the "inner"
 //   locks and monitor metadata.
 //
-//   Cxq points to the the set of Recently Arrived Threads attempting entry.
+//   Cxq points to the set of Recently Arrived Threads attempting entry.
 //   Because we push threads onto _cxq with CAS, the RATs must take the form of
 //   a singly-linked LIFO.  We drain _cxq into EntryList  at unlock-time when
 //   the unlocking thread notices that EntryList is null but _cxq is != null.
@@ -281,13 +270,12 @@
   }
 }
 
-void ATTR ObjectMonitor::enter(TRAPS) {
+void NOINLINE ObjectMonitor::enter(TRAPS) {
   // The following code is ordered to check the most common cases first
   // and to reduce RTS->RTO cache line upgrades on SPARC and IA32 processors.
   Thread * const Self = THREAD;
-  void * cur;
 
-  cur = Atomic::cmpxchg_ptr(Self, &_owner, NULL);
+  void * cur = Atomic::cmpxchg_ptr (Self, &_owner, NULL);
   if (cur == NULL) {
      // Either ASSERT _recursions == 0 or explicitly set _recursions = 0.
      assert(_recursions == 0   , "invariant");
@@ -447,26 +435,24 @@
 // Callers must compensate as needed.
 
 int ObjectMonitor::TryLock (Thread * Self) {
-   for (;;) {
-      void * own = _owner;
-      if (own != NULL) return 0;
-      if (Atomic::cmpxchg_ptr (Self, &_owner, NULL) == NULL) {
-         // Either guarantee _recursions == 0 or set _recursions = 0.
-         assert(_recursions == 0, "invariant");
-         assert(_owner == Self, "invariant");
-         // CONSIDER: set or assert that OwnerIsThread == 1
-         return 1;
-      }
-      // The lock had been free momentarily, but we lost the race to the lock.
-      // Interference -- the CAS failed.
-      // We can either return -1 or retry.
-      // Retry doesn't make as much sense because the lock was just acquired.
-      if (true) return -1;
-   }
+  void * own = _owner;
+  if (own != NULL) return 0;
+  if (Atomic::cmpxchg_ptr (Self, &_owner, NULL) == NULL) {
+    // Either guarantee _recursions == 0 or set _recursions = 0.
+    assert(_recursions == 0, "invariant");
+    assert(_owner == Self, "invariant");
+    // CONSIDER: set or assert that OwnerIsThread == 1
+    return 1;
+  }
+  // The lock had been free momentarily, but we lost the race to the lock.
+  // Interference -- the CAS failed.
+  // We can either return -1 or retry.
+  // Retry doesn't make as much sense because the lock was just acquired.
+  return -1;
 }
 
-void ATTR ObjectMonitor::EnterI (TRAPS) {
-    Thread * Self = THREAD;
+void NOINLINE ObjectMonitor::EnterI (TRAPS) {
+    Thread * const Self = THREAD;
     assert(Self->is_Java_thread(), "invariant");
     assert(((JavaThread *) Self)->thread_state() == _thread_blocked   , "invariant");
 
@@ -562,7 +548,7 @@
         Atomic::cmpxchg_ptr(Self, &_Responsible, NULL);
     }
 
-    // The lock have been released while this thread was occupied queueing
+    // The lock might have been released while this thread was occupied queueing
     // itself onto _cxq.  To close the race and avoid "stranding" and
     // progress-liveness failure we must resample-retry _owner before parking.
     // Note the Dekker/Lamport duality: ST cxq; MEMBAR; LD Owner.
@@ -714,7 +700,7 @@
 // Knob_Reset and Knob_SpinAfterFutile support and restructuring the
 // loop accordingly.
 
-void ATTR ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
+void NOINLINE ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
     assert(Self != NULL                , "invariant");
     assert(SelfNode != NULL            , "invariant");
     assert(SelfNode->_thread == Self   , "invariant");
@@ -802,6 +788,7 @@
     OrderAccess::fence();      // see comments at the end of EnterI()
 }
 
+// By convention we unlink a contending thread from EntryList|cxq immediately
 // after the thread acquires the lock in ::enter().  Equally, we could defer
 // unlinking the thread until ::exit()-time.
 
@@ -822,7 +809,7 @@
         assert(prv == NULL || prv->TState == ObjectWaiter::TS_ENTER, "invariant");
         TEVENT(Unlink from EntryList);
     } else {
-        guarantee(SelfNode->TState == ObjectWaiter::TS_CXQ, "invariant");
+        assert(SelfNode->TState == ObjectWaiter::TS_CXQ, "invariant");
         // Inopportune interleaving -- Self is still on the cxq.
         // This usually means the enqueue of self raced an exiting thread.
         // Normally we'll find Self near the front of the cxq, so
@@ -862,10 +849,12 @@
         TEVENT(Unlink from cxq);
     }
 
+#ifdef ASSERT
     // Diagnostic hygiene ...
     SelfNode->_prev  = (ObjectWaiter *) 0xBAD;
     SelfNode->_next  = (ObjectWaiter *) 0xBAD;
     SelfNode->TState = ObjectWaiter::TS_RUN;
+#endif
 }
 
 // -----------------------------------------------------------------------------
@@ -918,9 +907,15 @@
 // the integral of the # of active timers at any instant over time).
 // Both impinge on OS scalability.  Given that, at most one thread parked on
 // a monitor will use a timer.
+//
+// There is also the risk of a futile wake-up. If we drop the lock
+// another thread can reacquire the lock immediately, and we can
+// then wake a thread unnecessarily. This is benign, and we've
+// structured the code so the windows are short and the frequency
+// of such futile wakups is low.
 
-void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) {
-   Thread * Self = THREAD;
+void NOINLINE ObjectMonitor::exit(bool not_suspended, TRAPS) {
+   Thread * const Self = THREAD;
    if (THREAD != _owner) {
      if (THREAD->is_lock_owned((address) _owner)) {
        // Transmute _owner from a BasicLock pointer to a Thread address.
@@ -932,14 +927,17 @@
        _recursions = 0;
        OwnerIsThread = 1;
      } else {
-       // NOTE: we need to handle unbalanced monitor enter/exit
-       // in native code by throwing an exception.
-       // TODO: Throw an IllegalMonitorStateException ?
+       // Apparent unbalanced locking ...
+       // Naively we'd like to throw IllegalMonitorStateException.
+       // As a practical matter we can neither allocate nor throw an
+       // exception as ::exit() can be called from leaf routines.
+       // see x86_32.ad Fast_Unlock() and the I1 and I2 properties.
+       // Upon deeper reflection, however, in a properly run JVM the only
+       // way we should encounter this situation is in the presence of
+       // unbalanced JNI locking. TODO: CheckJNICalls.
+       // See also: CR4414101
        TEVENT(Exit - Throw IMSX);
-       assert(false, "Non-balanced monitor enter/exit!");
-       if (false) {
-          THROW(vmSymbols::java_lang_IllegalMonitorStateException());
-       }
+       assert(false, "Non-balanced monitor enter/exit! Likely JNI locking");
        return;
      }
    }
@@ -988,6 +986,7 @@
             return;
          }
          TEVENT(Inflated exit - complex egress);
+         // Other threads are blocked trying to acquire the lock.
 
          // Normally the exiting thread is responsible for ensuring succession,
          // but if other successors are ready or other entering threads are spinning
@@ -1154,9 +1153,9 @@
       if (w != NULL) {
           // I'd like to write: guarantee (w->_thread != Self).
           // But in practice an exiting thread may find itself on the EntryList.
-          // Lets say thread T1 calls O.wait().  Wait() enqueues T1 on O's waitset and
+          // Let's say thread T1 calls O.wait().  Wait() enqueues T1 on O's waitset and
           // then calls exit().  Exit release the lock by setting O._owner to NULL.
-          // Lets say T1 then stalls.  T2 acquires O and calls O.notify().  The
+          // Let's say T1 then stalls.  T2 acquires O and calls O.notify().  The
           // notify() operation moves T1 from O's waitset to O's EntryList. T2 then
           // release the lock "O".  T2 resumes immediately after the ST of null into
           // _owner, above.  T2 notices that the EntryList is populated, so it
@@ -1273,10 +1272,13 @@
 //       MEMBAR
 //       LD Self_>_suspend_flags
 //
+// UPDATE 2007-10-6: since I've replaced the native Mutex/Monitor subsystem
+// with a more efficient implementation, the need to use "FastHSSEC" has
+// decreased. - Dave
 
 
 bool ObjectMonitor::ExitSuspendEquivalent (JavaThread * jSelf) {
-   int Mode = Knob_FastHSSEC;
+   const int Mode = Knob_FastHSSEC;
    if (Mode && !jSelf->is_external_suspend()) {
       assert(jSelf->is_suspend_equivalent(), "invariant");
       jSelf->clear_suspend_equivalent();
@@ -1425,7 +1427,7 @@
 // Wait/Notify/NotifyAll
 //
 // Note: a subset of changes to ObjectMonitor::wait()
-// will need to be replicated in complete_exit above
+// will need to be replicated in complete_exit
 void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
    Thread * const Self = THREAD;
    assert(Self->is_Java_thread(), "Must be Java thread!");
@@ -2280,12 +2282,12 @@
   assert(_event != NULL, "invariant");
 }
 
-void ObjectWaiter::wait_reenter_begin(ObjectMonitor *mon) {
+void ObjectWaiter::wait_reenter_begin(ObjectMonitor * const mon) {
   JavaThread *jt = (JavaThread *)this->_thread;
   _active = JavaThreadBlockedOnMonitorEnterState::wait_reenter_begin(jt, mon);
 }
 
-void ObjectWaiter::wait_reenter_end(ObjectMonitor *mon) {
+void ObjectWaiter::wait_reenter_end(ObjectMonitor * const mon) {
   JavaThread *jt = (JavaThread *)this->_thread;
   JavaThreadBlockedOnMonitorEnterState::wait_reenter_end(jt, _active);
 }
@@ -2467,6 +2469,7 @@
   #define SETKNOB(x) { Knob_##x = kvGetInt (knobs, #x, Knob_##x); }
   SETKNOB(ReportSettings);
   SETKNOB(Verbose);
+  SETKNOB(VerifyInUse);
   SETKNOB(FixedSpin);
   SETKNOB(SpinLimit);
   SETKNOB(SpinBase);
--- a/src/share/vm/runtime/objectMonitor.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/objectMonitor.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -311,6 +311,7 @@
 
  public:
   static int Knob_Verbose;
+  static int Knob_VerifyInUse;
   static int Knob_SpinLimit;
   void* operator new (size_t size) throw() {
     return AllocateHeap(size, mtInternal);
--- a/src/share/vm/runtime/os.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/os.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -46,7 +46,7 @@
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
 #include "services/attachListener.hpp"
@@ -54,18 +54,6 @@
 #include "services/threadService.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/events.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 # include <signal.h>
 
--- a/src/share/vm/runtime/os.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/os.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -442,16 +442,7 @@
   // ms = 0, will sleep for the least amount of time allowed by the OS.
   static void naked_short_sleep(jlong ms);
   static void infinite_sleep(); // never returns, use with CAUTION
-  static void yield();        // Yields to all threads with same priority
-  enum YieldResult {
-    YIELD_SWITCHED = 1,         // caller descheduled, other ready threads exist & ran
-    YIELD_NONEREADY = 0,        // No other runnable/ready threads.
-                                // platform-specific yield return immediately
-    YIELD_UNKNOWN = -1          // Unknown: platform doesn't support _SWITCHED or _NONEREADY
-    // YIELD_SWITCHED and YIELD_NONREADY imply the platform supports a "strong"
-    // yield that can be used in lieu of blocking.
-  } ;
-  static YieldResult NakedYield () ;
+  static void naked_yield () ;
   static OSReturn set_priority(Thread* thread, ThreadPriority priority);
   static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
 
@@ -629,11 +620,6 @@
   static void     print_jni_name_prefix_on(outputStream* st, int args_size);
   static void     print_jni_name_suffix_on(outputStream* st, int args_size);
 
-  // File conventions
-  static const char* file_separator();
-  static const char* line_separator();
-  static const char* path_separator();
-
   // Init os specific system properties values
   static void init_system_properties_values();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/runtime/os.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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_RUNTIME_OS_INLINE_HPP
+#define SHARE_VM_RUNTIME_OS_INLINE_HPP
+
+#include "runtime/os.hpp"
+
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_aix
+# include "os_aix.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_bsd
+# include "os_bsd.inline.hpp"
+#endif
+
+#endif // SHARE_VM_RUNTIME_OS_INLINE_HPP
--- a/src/share/vm/runtime/safepoint.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/safepoint.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -322,7 +322,7 @@
         SpinPause() ;     // MP-Polite spin
       } else
       if (steps < DeferThrSuspendLoopCount) {
-        os::NakedYield() ;
+        os::naked_yield() ;
       } else {
         os::naked_short_sleep(1);
       }
--- a/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1810,14 +1810,8 @@
 
 
 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
-#ifndef PRODUCT
-int SharedRuntime::_monitor_enter_ctr=0;
-#endif
 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
   oop obj(_obj);
-#ifndef PRODUCT
-  _monitor_enter_ctr++;             // monitor enter slow
-#endif
   if (PrintBiasedLockingStatistics) {
     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
   }
@@ -1831,15 +1825,9 @@
   assert(!HAS_PENDING_EXCEPTION, "Should have no exception here");
 JRT_END
 
-#ifndef PRODUCT
-int SharedRuntime::_monitor_exit_ctr=0;
-#endif
 // Handles the uncommon cases of monitor unlocking in compiled code
 JRT_LEAF(void, SharedRuntime::complete_monitor_unlocking_C(oopDesc* _obj, BasicLock* lock))
    oop obj(_obj);
-#ifndef PRODUCT
-  _monitor_exit_ctr++;              // monitor exit slow
-#endif
   Thread* THREAD = JavaThread::current();
   // I'm not convinced we need the code contained by MIGHT_HAVE_PENDING anymore
   // testing was unable to ever fire the assert that guarded it so I have removed it.
@@ -1879,8 +1867,6 @@
   ttyLocker ttyl;
   if (xtty != NULL)  xtty->head("statistics type='SharedRuntime'");
 
-  if (_monitor_enter_ctr) tty->print_cr("%5d monitor enter slow",  _monitor_enter_ctr);
-  if (_monitor_exit_ctr) tty->print_cr("%5d monitor exit slow",   _monitor_exit_ctr);
   if (_throw_null_ctr) tty->print_cr("%5d implicit null throw", _throw_null_ctr);
 
   SharedRuntime::print_ic_miss_histogram();
@@ -2464,9 +2450,9 @@
     if (PrintAdapterHandlers || PrintStubCode) {
       ttyLocker ttyl;
       entry->print_adapter_on(tty);
-      tty->print_cr("i2c argument handler #%d for: %s %s (%d bytes generated)",
+      tty->print_cr("i2c argument handler #%d for: %s %s %s (%d bytes generated)",
                     _adapters->number_of_entries(), (method->is_static() ? "static" : "receiver"),
-                    method->signature()->as_C_string(), insts_size);
+                    method->signature()->as_C_string(), fingerprint->as_string(), insts_size);
       tty->print_cr("c2i argument handler starts at %p", entry->get_c2i_entry());
       if (Verbose || PrintStubCode) {
         address first_pc = entry->base_address();
--- a/src/share/vm/runtime/sharedRuntime.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/sharedRuntime.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -516,8 +516,6 @@
   static void trace_ic_miss(address at);
 
  public:
-  static int _monitor_enter_ctr;                 // monitor enter slow
-  static int _monitor_exit_ctr;                  // monitor exit slow
   static int _throw_null_ctr;                    // throwing a null-pointer exception
   static int _ic_miss_ctr;                       // total # of IC misses
   static int _wrong_method_ctr;
--- a/src/share/vm/runtime/synchronizer.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/synchronizer.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -41,24 +41,12 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/preserveException.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 #if defined(__GNUC__) && !defined(PPC64)
   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
-  #define ATTR __attribute__((noinline))
+  #define NOINLINE __attribute__((noinline))
 #else
-  #define ATTR
+  #define NOINLINE
 #endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
@@ -218,14 +206,6 @@
     return;
   }
 
-#if 0
-  // The following optimization isn't particularly useful.
-  if (mark->has_monitor() && mark->monitor()->is_entered(THREAD)) {
-    lock->set_displaced_header(NULL);
-    return;
-  }
-#endif
-
   // The object header will never be displaced to this lock,
   // so it does not matter what the value is, except that it
   // must be non-zero to avoid looking like a re-entrant lock,
@@ -469,7 +449,7 @@
     ++its;
     if (its > 10000 || !os::is_MP()) {
        if (its & 1) {
-         os::NakedYield();
+         os::naked_yield();
          TEVENT(Inflate: INFLATING - yield);
        } else {
          // Note that the following code attenuates the livelock problem but is not
@@ -499,7 +479,7 @@
            if ((YieldThenBlock++) >= 16) {
               Thread::current()->_ParkEvent->park(1);
            } else {
-              os::NakedYield();
+              os::naked_yield();
            }
          }
          Thread::muxRelease(InflationLocks + ix);
@@ -585,7 +565,7 @@
     // added check of the bias pattern is to avoid useless calls to
     // thread-local storage.
     if (obj->mark()->has_bias_pattern()) {
-      // Box and unbox the raw reference just in case we cause a STW safepoint.
+      // Handle for oop obj in case of STW safepoint
       Handle hobj(Self, obj);
       // Relaxing assertion for bug 6320749.
       assert(Universe::verify_in_progress() ||
@@ -902,23 +882,23 @@
     }
   }
 }
-/* Too slow for general assert or debug
+
 void ObjectSynchronizer::verifyInUse (Thread *Self) {
    ObjectMonitor* mid;
    int inusetally = 0;
    for (mid = Self->omInUseList; mid != NULL; mid = mid->FreeNext) {
-     inusetally ++;
+     inusetally++;
    }
    assert(inusetally == Self->omInUseCount, "inuse count off");
 
    int freetally = 0;
    for (mid = Self->omFreeList; mid != NULL; mid = mid->FreeNext) {
-     freetally ++;
+     freetally++;
    }
    assert(freetally == Self->omFreeCount, "free count off");
 }
-*/
-ObjectMonitor * ATTR ObjectSynchronizer::omAlloc (Thread * Self) {
+
+ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc (Thread * Self) {
     // A large MAXPRIVATE value reduces both list lock contention
     // and list coherency traffic, but also tends to increase the
     // number of objectMonitors in circulation as well as the STW
@@ -944,7 +924,9 @@
              m->FreeNext = Self->omInUseList;
              Self->omInUseList = m;
              Self->omInUseCount++;
-             // verifyInUse(Self);
+             if (ObjectMonitor::Knob_VerifyInUse) {
+               verifyInUse(Self);
+             }
            } else {
              m->FreeNext = NULL;
            }
@@ -1064,7 +1046,9 @@
            curmidinuse->FreeNext = mid->FreeNext; // maintain the current thread inuselist
          }
          Self->omInUseCount--;
-         // verifyInUse(Self);
+         if (ObjectMonitor::Knob_VerifyInUse) {
+           verifyInUse(Self);
+         }
          break;
        } else {
          curmidinuse = mid;
@@ -1073,7 +1057,7 @@
     }
   }
 
-  // FreeNext is used for both onInUseList and omFreeList, so clear old before setting new
+  // FreeNext is used for both omInUseList and omFreeList, so clear old before setting new
   m->FreeNext = Self->omFreeList;
   Self->omFreeList = m;
   Self->omFreeCount++;
@@ -1086,7 +1070,7 @@
 // consecutive STW safepoints.  Relatedly, we might decay
 // omFreeProvision at STW safepoints.
 //
-// Also return the monitors of a moribund thread"s omInUseList to
+// Also return the monitors of a moribund thread's omInUseList to
 // a global gOmInUseList under the global list lock so these
 // will continue to be scanned.
 //
@@ -1127,7 +1111,6 @@
         InUseTail = curom;
         InUseTally++;
       }
-// TODO debug
       assert(Self->omInUseCount == InUseTally, "inuse count off");
       Self->omInUseCount = 0;
       guarantee(InUseTail != NULL && InUseList != NULL, "invariant");
@@ -1166,7 +1149,7 @@
 // multiple locks occupy the same $ line.  Padding might be appropriate.
 
 
-ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
+ObjectMonitor * NOINLINE ObjectSynchronizer::inflate (Thread * Self, oop object) {
   // Inflate mutates the heap ...
   // Relaxing assertion for bug 6320749.
   assert(Universe::verify_in_progress() ||
@@ -1397,7 +1380,7 @@
 // Deflate a single monitor if not in use
 // Return true if deflated, false if in use
 bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
-                                         ObjectMonitor** FreeHeadp, ObjectMonitor** FreeTailp) {
+                                         ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp) {
   bool deflated;
   // Normal case ... The monitor is associated with obj.
   guarantee(obj->mark() == markOopDesc::encode(mid), "invariant");
@@ -1427,13 +1410,13 @@
      assert(mid->object() == NULL, "invariant");
 
      // Move the object to the working free list defined by FreeHead,FreeTail.
-     if (*FreeHeadp == NULL) *FreeHeadp = mid;
-     if (*FreeTailp != NULL) {
-       ObjectMonitor * prevtail = *FreeTailp;
+     if (*freeHeadp == NULL) *freeHeadp = mid;
+     if (*freeTailp != NULL) {
+       ObjectMonitor * prevtail = *freeTailp;
        assert(prevtail->FreeNext == NULL, "cleaned up deflated?"); // TODO KK
        prevtail->FreeNext = mid;
       }
-     *FreeTailp = mid;
+     *freeTailp = mid;
      deflated = true;
   }
   return deflated;
@@ -1441,7 +1424,7 @@
 
 // Caller acquires ListLock
 int ObjectSynchronizer::walk_monitor_list(ObjectMonitor** listheadp,
-                                          ObjectMonitor** FreeHeadp, ObjectMonitor** FreeTailp) {
+                                          ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp) {
   ObjectMonitor* mid;
   ObjectMonitor* next;
   ObjectMonitor* curmidinuse = NULL;
@@ -1451,7 +1434,7 @@
      oop obj = (oop) mid->object();
      bool deflated = false;
      if (obj != NULL) {
-       deflated = deflate_monitor(mid, obj, FreeHeadp, FreeTailp);
+       deflated = deflate_monitor(mid, obj, freeHeadp, freeTailp);
      }
      if (deflated) {
        // extract from per-thread in-use-list
@@ -1494,7 +1477,9 @@
       nInCirculation+= cur->omInUseCount;
       int deflatedcount = walk_monitor_list(cur->omInUseList_addr(), &FreeHead, &FreeTail);
       cur->omInUseCount-= deflatedcount;
-      // verifyInUse(cur);
+      if (ObjectMonitor::Knob_VerifyInUse) {
+        verifyInUse(cur);
+      }
       nScavenged += deflatedcount;
       nInuse += cur->omInUseCount;
      }
--- a/src/share/vm/runtime/synchronizer.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/synchronizer.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -84,7 +84,7 @@
   static void reenter            (Handle obj, intptr_t recursion, TRAPS);
 
   // thread-specific and global objectMonitor free list accessors
-//  static void verifyInUse (Thread * Self) ; too slow for general assert/debug
+  static void verifyInUse(Thread * Self);
   static ObjectMonitor * omAlloc(Thread * Self);
   static void omRelease(Thread * Self, ObjectMonitor * m, bool FromPerThreadAlloc);
   static void omFlush(Thread * Self);
@@ -114,10 +114,10 @@
   // An adaptive profile-based deflation policy could be used if needed
   static void deflate_idle_monitors();
   static int walk_monitor_list(ObjectMonitor** listheadp,
-                               ObjectMonitor** FreeHeadp,
-                               ObjectMonitor** FreeTailp);
-  static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** FreeHeadp,
-                              ObjectMonitor** FreeTailp);
+                               ObjectMonitor** freeHeadp,
+                               ObjectMonitor** freeTailp);
+  static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** freeHeadp,
+                              ObjectMonitor** freeTailp);
   static void oops_do(OopClosure* f);
 
   // debugging
@@ -130,7 +130,10 @@
   enum { _BLOCKSIZE = 128 };
   static ObjectMonitor* gBlockList;
   static ObjectMonitor * volatile gFreeList;
-  static ObjectMonitor * volatile gOmInUseList; // for moribund thread, so monitors they inflated still get scanned
+  // global monitor in use list, for moribund threads,
+  // monitors they inflated need to be scanned for deflation
+  static ObjectMonitor * volatile gOmInUseList;
+  // count of entries in gOmInUseList
   static int gOmInUseCount;
 
 };
--- a/src/share/vm/runtime/task.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/task.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,18 +28,6 @@
 #include "runtime/task.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/timer.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 int PeriodicTask::_num_tasks = 0;
 PeriodicTask* PeriodicTask::_tasks[PeriodicTask::max_tasks];
--- a/src/share/vm/runtime/thread.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/thread.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -85,18 +85,6 @@
 #include "utilities/events.hpp"
 #include "utilities/preserveException.hpp"
 #include "utilities/macros.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
@@ -1358,14 +1346,24 @@
 }
 
 void WatcherThread::stop() {
-  {
-    MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
-    _should_terminate = true;
-    OrderAccess::fence();  // ensure WatcherThread sees update in main loop
-
+  // Get the PeriodicTask_lock if we can. If we cannot, then the
+  // WatcherThread is using it and we don't want to block on that lock
+  // here because that might cause a safepoint deadlock depending on
+  // what the current WatcherThread tasks are doing.
+  bool have_lock = PeriodicTask_lock->try_lock();
+
+  _should_terminate = true;
+  OrderAccess::fence();  // ensure WatcherThread sees update in main loop
+
+  if (have_lock) {
     WatcherThread* watcher = watcher_thread();
-    if (watcher != NULL)
+    if (watcher != NULL) {
+      // If we managed to get the lock, then we should unpark the
+      // WatcherThread so that it can see we want it to stop.
       watcher->unpark();
+    }
+
+    PeriodicTask_lock->unlock();
   }
 
   // it is ok to take late safepoints here, if needed
@@ -4376,7 +4374,7 @@
            if (Yields > 5) {
              os::naked_short_sleep(1);
            } else {
-             os::NakedYield();
+             os::naked_yield();
              ++Yields;
            }
         } else {
@@ -4394,6 +4392,12 @@
   // It's safe if subsequent LDs and STs float "up" into the critical section,
   // but prior LDs and STs within the critical section can't be allowed
   // to reorder or float past the ST that releases the lock.
+  // Loads and stores in the critical section - which appear in program
+  // order before the store that releases the lock - must also appear
+  // before the store that releases the lock in memory visibility order.
+  // Conceptually we need a #loadstore|#storestore "release" MEMBAR before
+  // the ST of 0 into the lock-word which releases the lock, so fence
+  // more than covers this on all platforms.
   *adr = 0;
 }
 
@@ -4575,18 +4579,25 @@
 // This implementation pops from the head of the list.  This is unfair,
 // but tends to provide excellent throughput as hot threads remain hot.
 // (We wake recently run threads first).
-
+//
+// All paths through muxRelease() will execute a CAS.
+// Release consistency -- We depend on the CAS in muxRelease() to provide full
+// bidirectional fence/MEMBAR semantics, ensuring that all prior memory operations
+// executed within the critical section are complete and globally visible before the
+// store (CAS) to the lock-word that releases the lock becomes globally visible.
 void Thread::muxRelease (volatile intptr_t * Lock)  {
   for (;;) {
     const intptr_t w = Atomic::cmpxchg_ptr(0, Lock, LOCKBIT);
     assert(w & LOCKBIT, "invariant");
     if (w == LOCKBIT) return;
-    ParkEvent * List = (ParkEvent *)(w & ~LOCKBIT);
+    ParkEvent * const List = (ParkEvent *) (w & ~LOCKBIT);
     assert(List != NULL, "invariant");
     assert(List->OnList == intptr_t(Lock), "invariant");
-    ParkEvent * nxt = List->ListNext;
+    ParkEvent * const nxt = List->ListNext;
+    guarantee((intptr_t(nxt) & LOCKBIT) == 0, "invariant");
 
     // The following CAS() releases the lock and pops the head element.
+    // The CAS() also ratifies the previously fetched lock-word value.
     if (Atomic::cmpxchg_ptr (intptr_t(nxt), Lock, w) != w) {
       continue;
     }
--- a/src/share/vm/runtime/thread.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/thread.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1761,34 +1761,6 @@
   return (CompilerThread*)this;
 }
 
-inline bool JavaThread::stack_guard_zone_unused() {
-  return _stack_guard_state == stack_guard_unused;
-}
-
-inline bool JavaThread::stack_yellow_zone_disabled() {
-  return _stack_guard_state == stack_guard_yellow_disabled;
-}
-
-inline bool JavaThread::stack_yellow_zone_enabled() {
-#ifdef ASSERT
-  if (os::uses_stack_guard_pages()) {
-    assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use");
-  }
-#endif
-    return _stack_guard_state == stack_guard_enabled;
-}
-
-inline size_t JavaThread::stack_available(address cur_sp) {
-  // This code assumes java stacks grow down
-  address low_addr; // Limit on the address for deepest stack depth
-  if (_stack_guard_state == stack_guard_unused) {
-    low_addr =  stack_base() - stack_size();
-  } else {
-    low_addr = stack_yellow_zone_base();
-  }
-  return cur_sp > low_addr ? cur_sp - low_addr : 0;
-}
-
 // A thread used for Compilation.
 class CompilerThread : public JavaThread {
   friend class VMStructs;
@@ -1863,7 +1835,6 @@
   return JavaThread::current()->as_CompilerThread();
 }
 
-
 // The active thread queue. It also keeps track of the current used
 // thread priorities.
 class Threads: AllStatic {
--- a/src/share/vm/runtime/thread.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/thread.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP_SCOPE
 
 #include "runtime/atomic.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/thread.hpp"
 #ifdef TARGET_OS_FAMILY_linux
 # include "thread_linux.inline.hpp"
@@ -136,4 +137,32 @@
   OrderAccess::fence();
 }
 
+inline bool JavaThread::stack_guard_zone_unused() {
+  return _stack_guard_state == stack_guard_unused;
+}
+
+inline bool JavaThread::stack_yellow_zone_disabled() {
+  return _stack_guard_state == stack_guard_yellow_disabled;
+}
+
+inline size_t JavaThread::stack_available(address cur_sp) {
+  // This code assumes java stacks grow down
+  address low_addr; // Limit on the address for deepest stack depth
+  if (_stack_guard_state == stack_guard_unused) {
+    low_addr =  stack_base() - stack_size();
+  } else {
+    low_addr = stack_yellow_zone_base();
+  }
+  return cur_sp > low_addr ? cur_sp - low_addr : 0;
+}
+
+inline bool JavaThread::stack_yellow_zone_enabled() {
+#ifdef ASSERT
+  if (os::uses_stack_guard_pages()) {
+    assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use");
+  }
+#endif
+  return _stack_guard_state == stack_guard_enabled;
+}
+
 #endif // SHARE_VM_RUNTIME_THREAD_INLINE_HPP
--- a/src/share/vm/runtime/threadLocalStorage.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/threadLocalStorage.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,20 +23,9 @@
  */
 
 #include "precompiled.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadLocalStorage.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // static member initialization
 int ThreadLocalStorage::_thread_index = -1;
--- a/src/share/vm/runtime/timer.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/timer.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -26,21 +26,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/timer.hpp"
 #include "utilities/ostream.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 double TimeHelper::counter_to_seconds(jlong counter) {
   double count = (double) counter;
--- a/src/share/vm/runtime/vframe.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/vframe.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -260,66 +260,156 @@
   return fr().interpreter_frame_method();
 }
 
-StackValueCollection* interpretedVFrame::locals() const {
-  int length = method()->max_locals();
+static StackValue* create_stack_value_from_oop_map(const InterpreterOopMap& oop_mask,
+                                                   int index,
+                                                   const intptr_t* const addr) {
 
-  if (method()->is_native()) {
-    // If the method is native, max_locals is not telling the truth.
-    // maxlocals then equals the size of parameters
-    length = method()->size_of_parameters();
+  assert(index >= 0 &&
+         index < oop_mask.number_of_entries(), "invariant");
+
+  // categorize using oop_mask
+  if (oop_mask.is_oop(index)) {
+    // reference (oop) "r"
+    Handle h(addr != NULL ? (*(oop*)addr) : (oop)NULL);
+    return new StackValue(h);
+  }
+  // value (integer) "v"
+  return new StackValue(addr != NULL ? *addr : 0);
+}
+
+static bool is_in_expression_stack(const frame& fr, const intptr_t* const addr) {
+  assert(addr != NULL, "invariant");
+
+  // Ensure to be 'inside' the expresion stack (i.e., addr >= sp for Intel).
+  // In case of exceptions, the expression stack is invalid and the sp
+  // will be reset to express this condition.
+  if (frame::interpreter_frame_expression_stack_direction() > 0) {
+    return addr <= fr.interpreter_frame_tos_address();
   }
 
-  StackValueCollection* result = new StackValueCollection(length);
+  return addr >= fr.interpreter_frame_tos_address();
+}
 
-  // Get oopmap describing oops and int for current bci
+static void stack_locals(StackValueCollection* result,
+                         int length,
+                         const InterpreterOopMap& oop_mask,
+                         const frame& fr) {
+
+  assert(result != NULL, "invariant");
+
+  for (int i = 0; i < length; ++i) {
+    const intptr_t* const addr = fr.interpreter_frame_local_at(i);
+    assert(addr != NULL, "invariant");
+    assert(addr >= fr.sp(), "must be inside the frame");
+
+    StackValue* const sv = create_stack_value_from_oop_map(oop_mask, i, addr);
+    assert(sv != NULL, "sanity check");
+
+    result->add(sv);
+  }
+}
+
+static void stack_expressions(StackValueCollection* result,
+                              int length,
+                              int max_locals,
+                              const InterpreterOopMap& oop_mask,
+                              const frame& fr) {
+
+  assert(result != NULL, "invariant");
+
+  for (int i = 0; i < length; ++i) {
+    const intptr_t* addr = fr.interpreter_frame_expression_stack_at(i);
+    assert(addr != NULL, "invariant");
+    if (!is_in_expression_stack(fr, addr)) {
+      // Need to ensure no bogus escapes.
+      addr = NULL;
+    }
+
+    StackValue* const sv = create_stack_value_from_oop_map(oop_mask,
+                                                           i + max_locals,
+                                                           addr);
+    assert(sv != NULL, "sanity check");
+
+    result->add(sv);
+  }
+}
+
+StackValueCollection* interpretedVFrame::locals() const {
+  return stack_data(false);
+}
+
+StackValueCollection* interpretedVFrame::expressions() const {
+  return stack_data(true);
+}
+
+/*
+ * Worker routine for fetching references and/or values
+ * for a particular bci in the interpretedVFrame.
+ *
+ * Returns data for either "locals" or "expressions",
+ * using bci relative oop_map (oop_mask) information.
+ *
+ * @param expressions  bool switch controlling what data to return
+                       (false == locals / true == expression)
+ *
+ */
+StackValueCollection* interpretedVFrame::stack_data(bool expressions) const {
+
   InterpreterOopMap oop_mask;
+  // oopmap for current bci
   if (TraceDeoptimization && Verbose) {
-    // need the current JavaThread and not thread()
     methodHandle m_h(Thread::current(), method());
     OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
   } else {
     method()->mask_for(bci(), &oop_mask);
   }
-  // handle locals
-  for(int i=0; i < length; i++) {
-    // Find stack location
-    intptr_t *addr = locals_addr_at(i);
 
-    // Depending on oop/int put it in the right package
-    StackValue *sv;
-    if (oop_mask.is_oop(i)) {
-      // oop value
-      Handle h(*(oop *)addr);
-      sv = new StackValue(h);
-    } else {
-      // integer
-      sv = new StackValue(*addr);
-    }
-    assert(sv != NULL, "sanity check");
-    result->add(sv);
+  const int mask_len = oop_mask.number_of_entries();
+
+  // If the method is native, method()->max_locals() is not telling the truth.
+  // For our purposes, max locals instead equals the size of parameters.
+  const int max_locals = method()->is_native() ?
+    method()->size_of_parameters() : method()->max_locals();
+
+  assert(mask_len >= max_locals, "invariant");
+
+  const int length = expressions ? mask_len - max_locals : max_locals;
+  assert(length >= 0, "invariant");
+
+  StackValueCollection* const result = new StackValueCollection(length);
+
+  if (0 == length) {
+    return result;
   }
+
+  if (expressions) {
+    stack_expressions(result, length, max_locals, oop_mask, fr());
+  } else {
+    stack_locals(result, length, oop_mask, fr());
+  }
+
+  assert(length == result->size(), "invariant");
+
   return result;
 }
 
 void interpretedVFrame::set_locals(StackValueCollection* values) const {
   if (values == NULL || values->size() == 0) return;
 
-  int length = method()->max_locals();
-  if (method()->is_native()) {
-    // If the method is native, max_locals is not telling the truth.
-    // maxlocals then equals the size of parameters
-    length = method()->size_of_parameters();
-  }
+  // If the method is native, max_locals is not telling the truth.
+  // maxlocals then equals the size of parameters
+  const int max_locals = method()->is_native() ?
+    method()->size_of_parameters() : method()->max_locals();
 
-  assert(length == values->size(), "Mismatch between actual stack format and supplied data");
+  assert(max_locals == values->size(), "Mismatch between actual stack format and supplied data");
 
   // handle locals
-  for (int i = 0; i < length; i++) {
+  for (int i = 0; i < max_locals; i++) {
     // Find stack location
     intptr_t *addr = locals_addr_at(i);
 
     // Depending on oop/int put it in the right package
-    StackValue *sv = values->at(i);
+    const StackValue* const sv = values->at(i);
     assert(sv != NULL, "sanity check");
     if (sv->type() == T_OBJECT) {
       *(oop *) addr = (sv->get_obj())();
@@ -329,61 +419,6 @@
   }
 }
 
-StackValueCollection* interpretedVFrame::expressions() const {
-
-  InterpreterOopMap oop_mask;
-
-  if (!method()->is_native()) {
-    // Get oopmap describing oops and int for current bci
-    if (TraceDeoptimization && Verbose) {
-      // need the current JavaThread and not thread()
-      methodHandle m_h(Thread::current(), method());
-      OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
-    } else {
-      method()->mask_for(bci(), &oop_mask);
-    }
-  }
-
-  // If the bci is a call instruction, i.e. any of the invoke* instructions,
-  // the InterpreterOopMap does not include expression/operand stack liveness
-  // info in the oop_mask/bit_mask. This can lead to a discrepancy of what
-  // is actually on the expression stack compared to what is given by the
-  // oop_map. We need to use the length reported in the oop_map.
-  int length = oop_mask.expression_stack_size();
-
-  assert(fr().interpreter_frame_expression_stack_size() >= length,
-    "error in expression stack!");
-
-  StackValueCollection* result = new StackValueCollection(length);
-
-  if (0 == length) {
-    return result;
-  }
-
-  int nof_locals = method()->max_locals();
-
-  // handle expressions
-  for(int i=0; i < length; i++) {
-    // Find stack location
-    intptr_t *addr = fr().interpreter_frame_expression_stack_at(i);
-
-    // Depending on oop/int put it in the right package
-    StackValue *sv;
-    if (oop_mask.is_oop(i + nof_locals)) {
-      // oop value
-      Handle h(*(oop *)addr);
-      sv = new StackValue(h);
-    } else {
-      // integer
-      sv = new StackValue(*addr);
-    }
-    assert(sv != NULL, "sanity check");
-    result->add(sv);
-  }
-  return result;
-}
-
-
 // ------------- cChunk --------------
 
 entryVFrame::entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
--- a/src/share/vm/runtime/vframe.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/vframe.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -186,7 +186,7 @@
  private:
   static const int bcp_offset;
   intptr_t* locals_addr_at(int offset) const;
-
+  StackValueCollection* stack_data(bool expressions) const;
   // returns where the parameters starts relative to the frame pointer
   int start_of_parameters() const;
 
--- a/src/share/vm/runtime/virtualspace.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/runtime/virtualspace.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -27,21 +27,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/virtualspace.hpp"
 #include "services/memTracker.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/src/share/vm/services/heapDumper.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/services/heapDumper.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -33,6 +33,7 @@
 #include "oops/objArrayKlass.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
 #include "runtime/reflectionUtils.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vmThread.hpp"
--- a/src/share/vm/services/memTracker.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/services/memTracker.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -484,7 +484,7 @@
       // as short sleep.
       os::naked_short_sleep(1);
 #else
-      os::NakedYield();
+      os::naked_yield();
 #endif
     }
   }
--- a/src/share/vm/trace/tracetypes.xml	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/trace/tracetypes.xml	Fri Jul 11 05:59:08 2014 -0700
@@ -98,6 +98,7 @@
       <value type="SYMBOL" field="name" label="Name"/>
       <value type="SYMBOL" field="signature" label="Signature"/>
       <value type="SHORT" field="modifiers" label="Access modifiers"/>
+      <value type="BOOLEAN" field="hidden" label="Hidden"/>
     </content_type>
 
     <content_type id="UTFConstant" hr_name="UTF constant"
--- a/src/share/vm/utilities/accessFlags.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/utilities/accessFlags.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,22 +26,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "utilities/accessFlags.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 
 void AccessFlags::atomic_set_bits(jint bits) {
   // Atomically update the flags with the bits given
--- a/src/share/vm/utilities/bitMap.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/utilities/bitMap.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -28,22 +28,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 #include "utilities/copy.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 
 BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
   _map(map), _size(size_in_bits), _map_allocator(false)
--- a/src/share/vm/utilities/debug.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/utilities/debug.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -42,6 +42,7 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/frame.hpp"
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
@@ -52,18 +53,6 @@
 #include "utilities/events.hpp"
 #include "utilities/top.hpp"
 #include "utilities/vmError.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 #ifndef ASSERT
 #  ifdef _DEBUG
--- a/src/share/vm/utilities/events.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/utilities/events.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
 #include "runtime/mutexLocker.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadCritical.hpp"
--- a/src/share/vm/utilities/histogram.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/utilities/histogram.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,21 +28,6 @@
 #include "memory/allocation.hpp"
 #include "runtime/os.hpp"
 #include "utilities/growableArray.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // This class provides a framework for collecting various statistics.
 // The current implementation is oriented towards counting invocations
--- a/src/share/vm/utilities/ostream.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/utilities/ostream.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -27,25 +27,11 @@
 #include "gc_implementation/shared/gcId.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/top.hpp"
 #include "utilities/xmlstream.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 extern "C" void jio_print(const char* s); // Declarationtion of jvm method
 
--- a/src/share/vm/utilities/taskqueue.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/src/share/vm/utilities/taskqueue.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -142,7 +142,7 @@
 
 void ParallelTaskTerminator::yield() {
   assert(_offered_termination <= _n_threads, "Invariant");
-  os::yield();
+  os::naked_yield();
 }
 
 void ParallelTaskTerminator::sleep(uint millis) {
--- a/test/compiler/6775880/Test.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/6775880/Test.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
  * @test
  * @bug 6775880
  * @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now")
- * @compile -source 1.4 -target 1.4 Test.java
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append Test
  */
 
--- a/test/compiler/8009761/Test8009761.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/8009761/Test8009761.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,11 +21,7 @@
  * questions.
  */
 
-import com.sun.management.HotSpotDiagnosticMXBean;
-import com.sun.management.VMOption;
 import sun.hotspot.WhiteBox;
-import sun.management.ManagementFactoryHelper;
-
 import java.lang.reflect.Method;
 
 /*
@@ -40,6 +36,7 @@
 public class Test8009761 {
 
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+    private static int COMP_LEVEL_SIMPLE = 1;
     private static int COMP_LEVEL_FULL_OPTIMIZATION = 4;
     private static Method m3 = null;
 
@@ -236,7 +233,7 @@
 
     static public void main(String[] args) {
         // Make sure background compilation is disabled
-        if (backgroundCompilationEnabled()) {
+        if (WHITE_BOX.getBooleanVMFlag("BackgroundCompilation")) {
             throw new RuntimeException("Background compilation enabled");
         }
 
@@ -256,7 +253,11 @@
         c1 = count;
 
         // Force the compilation of m3() that will inline m1()
-        WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION);
+        if(!WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION)) {
+            // C2 compiler not available, compile with C1
+            WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_SIMPLE);
+        }
+
         // Because background compilation is disabled, method should now be compiled
         if(!WHITE_BOX.isMethodCompiled(m3)) {
             throw new RuntimeException(m3 + " not compiled");
@@ -278,19 +279,4 @@
             System.out.println("PASSED " + c1);
         }
     }
-
-    /**
-     * Checks if background compilation (-XX:+BackgroundCompilation) is enabled.
-     * @return True if background compilation is enabled, false otherwise
-     */
-    private static boolean backgroundCompilationEnabled() {
-      HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
-      VMOption backgroundCompilation;
-      try {
-          backgroundCompilation = diagnostic.getVMOption("BackgroundCompilation");
-      } catch (IllegalArgumentException e) {
-          return false;
-      }
-      return Boolean.valueOf(backgroundCompilation.getValue());
-    }
 }
--- a/test/compiler/ciReplay/TestSA.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/ciReplay/TestSA.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 ##
 ## @test
 ## @bug 8011675
+## @ignore 8032226, 8031978
 ## @summary testing of ciReplay with using generated by SA replay.txt 
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestSA.sh
--- a/test/compiler/ciReplay/TestVM.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/ciReplay/TestVM.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 ##
 ## @test
 ## @bug 8011675
+## @ignore 8031978
 ## @summary testing of ciReplay with using generated by VM replay.txt 
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestVM.sh
--- a/test/compiler/ciReplay/TestVM_no_comp_level.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/ciReplay/TestVM_no_comp_level.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 ##
 ## @test
 ## @bug 8011675
+## @ignore 8031978
 ## @summary testing of ciReplay with using generated by VM replay.txt w/o comp_level
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestVM_no_comp_level.sh
--- a/test/compiler/tiered/NonTieredLevelsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/tiered/NonTieredLevelsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -25,6 +25,7 @@
 
 /**
  * @test NonTieredLevelsTest
+ * @ignore 8046268
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/test/compiler/tiered/TieredLevelsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/tiered/TieredLevelsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test TieredLevelsTest
+ * @ignore 8046268
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/test/compiler/whitebox/ClearMethodStateTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/whitebox/ClearMethodStateTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test ClearMethodStateTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build ClearMethodStateTest
--- a/test/compiler/whitebox/DeoptimizeAllTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/whitebox/DeoptimizeAllTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test DeoptimizeAllTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build DeoptimizeAllTest
--- a/test/compiler/whitebox/DeoptimizeMethodTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/whitebox/DeoptimizeMethodTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test DeoptimizeMethodTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build DeoptimizeMethodTest
--- a/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test EnqueueMethodForCompilationTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build EnqueueMethodForCompilationTest
--- a/test/compiler/whitebox/GetNMethodTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/whitebox/GetNMethodTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 
 /*
  * @test GetNMethodTest
+ * @ignore 8046268
  * @bug 8038240
  * @library /testlibrary /testlibrary/whitebox
  * @build GetNMethodTest
--- a/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test MakeMethodNotCompilableTest
+ * @ignore 8046268
  * @bug 8012322 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build MakeMethodNotCompilableTest
--- a/test/runtime/6626217/Test6626217.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/runtime/6626217/Test6626217.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 # 
-#  Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+#  Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
 #  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 # 
 #  This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
 
 # Compile all the usual suspects, including the default 'many_loader'
 ${CP} many_loader1.java.foo many_loader.java
-${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java
+${JAVAC} ${TESTJAVACOPTS} -Xlint *.java
 
 # Rename the class files, so the custom loader (and not the system loader) will find it
 ${MV} from_loader2.class from_loader2.impl2
@@ -62,7 +62,7 @@
 # Compile the next version of 'many_loader'
 ${MV} many_loader.class many_loader.impl1
 ${CP} many_loader2.java.foo many_loader.java
-${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java
+${JAVAC} ${TESTJAVACOPTS} -Xlint many_loader.java
 
 # Rename the class file, so the custom loader (and not the system loader) will find it
 ${MV} many_loader.class many_loader.impl2
--- a/test/runtime/8003720/Test8003720.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/runtime/8003720/Test8003720.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @test
  * @bug 8003720
  * @summary Method in interpreter stack frame can be deallocated
- * @compile -XDignore.symbol.file -source 1.7 -target 1.7 Victim.java
+ * @compile -XDignore.symbol.file Victim.java
  * @run main/othervm -Xverify:all -Xint Test8003720
  */
 
--- a/test/runtime/Unsafe/RangeCheck.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/test/runtime/Unsafe/RangeCheck.java	Fri Jul 11 05:59:08 2014 -0700
@@ -43,6 +43,7 @@
                 true,
                 "-Xmx32m",
                 "-XX:-TransmitErrorReport",
+                "-XX:-InlineUnsafeOps", // The compiler intrinsics doesn't have the assert
                 DummyClassWithMainRangeCheck.class.getName());
 
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/verifier/OverriderMsg.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import com.oracle.java.testlibrary.*;
+
+/*
+ * @test OverriderMsg
+ * @bug 8026894
+ * @library /testlibrary
+ * @compile -XDignore.symbol.file OverriderMsg.java
+ * @run main/othervm OverriderMsg
+ */
+
+// This test checks that the super class name is included in the message when
+// a method is detected overriding a final method in its super class.  The
+// asm part of the test creates these two classes:
+//
+//     public class HasFinal {
+//         public final void m(String s) { }
+//     }
+//
+//     public class Overrider extends HasFinal {
+//         public void m(String s) { }
+//         public static void main(String[] args) { }
+//     }
+//
+public class OverriderMsg {
+
+    public static void dump_HasFinal () throws Exception {
+
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, "HasFinal", null, "java/lang/Object", null);
+
+        {
+            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(1, 1);
+            mv.visitEnd();
+        }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "m", "(Ljava/lang/String;)V", null, null);
+            mv.visitCode();
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 2);
+            mv.visitEnd();
+        }
+        cw.visitEnd();
+        try (FileOutputStream fos = new FileOutputStream(new File("HasFinal.class"))) {
+             fos.write(cw.toByteArray());
+        }
+    }
+
+
+    public static void dump_Overrider () throws Exception {
+
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+        cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, "Overrider", null, "HasFinal", null);
+
+        {
+            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitMethodInsn(INVOKESPECIAL, "HasFinal", "<init>", "()V");
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(1, 1);
+            mv.visitEnd();
+        }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC, "m", "(Ljava/lang/String;)V", null, null);
+            mv.visitCode();
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 2);
+            mv.visitEnd();
+        }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
+            mv.visitCode();
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 1);
+            mv.visitEnd();
+        }
+        cw.visitEnd();
+
+        try (FileOutputStream fos = new FileOutputStream(new File("Overrider.class"))) {
+             fos.write(cw.toByteArray());
+        }
+    }
+
+
+    public static void main(String... args) throws Exception {
+        dump_HasFinal();
+        dump_Overrider();
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".",  "Overrider");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain(
+            "java.lang.VerifyError: class Overrider overrides final method HasFinal.m(Ljava/lang/String;)V");
+        output.shouldHaveExitValue(1);
+    }
+
+}